@treasuredata/tdx 0.28.2 → 0.28.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (184) 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.d.ts.map +1 -1
  120. package/dist/sdk/segment/journey-utils.js +1 -1
  121. package/dist/sdk/segment/journey-utils.js.map +1 -1
  122. package/dist/sdk/segment/journey-validator.js +1 -1
  123. package/dist/sdk/segment/journey-validator.js.map +1 -1
  124. package/dist/sdk/segment/journey-yaml.d.ts.map +1 -1
  125. package/dist/sdk/segment/journey-yaml.js +1 -1
  126. package/dist/sdk/segment/journey-yaml.js.map +1 -1
  127. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  128. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  129. package/dist/sdk/segment/pull-workflow.js +1 -1
  130. package/dist/sdk/segment/push-recovery.js +1 -1
  131. package/dist/sdk/segment/push-workflow.js +1 -1
  132. package/dist/sdk/segment/resolution-context.js +1 -1
  133. package/dist/sdk/segment/segment-path-parser.js +1 -1
  134. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  135. package/dist/sdk/segment/target-resolution.js +1 -1
  136. package/dist/sdk/segment/tdx-config.js +1 -1
  137. package/dist/sdk/segment/validate-files.js +1 -1
  138. package/dist/sdk/segment/yaml-validator.js +1 -1
  139. package/dist/sdk/segment.js +1 -1
  140. package/dist/sdk/types/index.js +1 -1
  141. package/dist/sdk/types/progress.js +1 -1
  142. package/dist/sdk/user.js +1 -1
  143. package/dist/sdk/util/format-detector.js +1 -1
  144. package/dist/sdk/util/formatters.js +1 -1
  145. package/dist/sdk/util/index.js +1 -1
  146. package/dist/sdk/util/tree-formatter.js +1 -1
  147. package/dist/sdk/workflow/archive-validation.js +1 -1
  148. package/dist/sdk/workflow/clone-workflow.js +1 -1
  149. package/dist/sdk/workflow/index.js +1 -1
  150. package/dist/sdk/workflow/pull-workflow.js +1 -1
  151. package/dist/sdk/workflow/push-workflow.js +1 -1
  152. package/dist/sdk/workflow/tdx-config.js +1 -1
  153. package/dist/sdk/workflow/workflow-utils.js +1 -1
  154. package/dist/test-utils/command-runner.js +1 -1
  155. package/dist/test-utils/factories.js +1 -1
  156. package/dist/test-utils/fixtures.js +1 -1
  157. package/dist/test-utils/http-mock.js +1 -1
  158. package/dist/test-utils/index.js +1 -1
  159. package/dist/utils/async.js +1 -1
  160. package/dist/utils/colors.js +1 -1
  161. package/dist/utils/diff.js +1 -1
  162. package/dist/utils/file-permissions.js +1 -1
  163. package/dist/utils/global-cache.js +1 -1
  164. package/dist/utils/json-loader.js +1 -1
  165. package/dist/utils/local-cache.js +1 -1
  166. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  167. package/dist/utils/logger/formatters/index.js +1 -1
  168. package/dist/utils/logger/handlers/console-handler.js +1 -1
  169. package/dist/utils/logger/handlers/file-handler.js +1 -1
  170. package/dist/utils/logger/handlers/index.js +1 -1
  171. package/dist/utils/logger/handlers/null-handler.js +1 -1
  172. package/dist/utils/logger/index.js +1 -1
  173. package/dist/utils/logger/logger.js +1 -1
  174. package/dist/utils/logger/types.js +1 -1
  175. package/dist/utils/option-validation.js +1 -1
  176. package/dist/utils/process.js +1 -1
  177. package/dist/utils/prompt.js +1 -1
  178. package/dist/utils/spinner.js +1 -1
  179. package/dist/utils/sse-parser.js +1 -1
  180. package/dist/utils/string-utils.js +1 -1
  181. package/dist/utils/table-ref-parser.js +1 -1
  182. package/dist/utils/tdx-logger.js +1 -1
  183. package/dist/utils/version-check.js +1 -1
  184. 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_0x3f1c4d=a30_0x5e09;(function(_0x1be752,_0x3fc358){const _0x4bb3d9=a30_0x5e09,_0x20a03c=_0x1be752();while(!![]){try{const _0x32aa04=-parseInt(_0x4bb3d9(0x213))/0x1+-parseInt(_0x4bb3d9(0x1eb))/0x2*(-parseInt(_0x4bb3d9(0x254))/0x3)+parseInt(_0x4bb3d9(0x23f))/0x4+-parseInt(_0x4bb3d9(0x26d))/0x5*(-parseInt(_0x4bb3d9(0x208))/0x6)+parseInt(_0x4bb3d9(0x20f))/0x7*(-parseInt(_0x4bb3d9(0x26a))/0x8)+-parseInt(_0x4bb3d9(0x25b))/0x9+-parseInt(_0x4bb3d9(0x233))/0xa*(-parseInt(_0x4bb3d9(0x22f))/0xb);if(_0x32aa04===_0x3fc358)break;else _0x20a03c['push'](_0x20a03c['shift']());}catch(_0x2917dc){_0x20a03c['push'](_0x20a03c['shift']());}}}(a30_0x17ef,0xca2b1));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_0x16abd3 from'chalk';function formatRelativeTime(_0x47d8a5){const _0x215ef8=a30_0x5e09,_0x1aa660=new Date(_0x47d8a5),_0x29d050=new Date(),_0x572feb=_0x1aa660[_0x215ef8(0x24b)]()-_0x29d050[_0x215ef8(0x24b)](),_0x4fd95d=Math[_0x215ef8(0x22e)](_0x572feb)/0x3e8,_0x44674f=_0x572feb<0x0;if(_0x4fd95d<0x3c)return _0x44674f?_0x215ef8(0x240):_0x215ef8(0x202);else{if(_0x4fd95d<0xe10){const _0xa677d8=Math[_0x215ef8(0x226)](_0x4fd95d/0x3c);return _0x44674f?_0xa677d8+_0x215ef8(0x207):_0x215ef8(0x1ef)+_0xa677d8+'m';}else{if(_0x4fd95d<0x15180){const _0x14a26e=Math[_0x215ef8(0x226)](_0x4fd95d/0xe10);return _0x44674f?_0x14a26e+_0x215ef8(0x218):'in\x20'+_0x14a26e+'h';}else{if(_0x4fd95d<0x93a80){const _0x2ab634=Math['round'](_0x4fd95d/0x15180);return _0x44674f?_0x2ab634+_0x215ef8(0x228):_0x215ef8(0x1ef)+_0x2ab634+'d';}else return _0x1aa660[_0x215ef8(0x1f3)]();}}}}export class ScheduleListCommand extends BaseCommand{['name']=a30_0x3f1c4d(0x272);['description']=a30_0x3f1c4d(0x227);async[a30_0x3f1c4d(0x1e9)](_0x5411d2){const _0x48d875=a30_0x3f1c4d,{options:_0x52b61c,args:_0x556d5e,tdx:_0x45d47b}=_0x5411d2,_0x1650b9=resolveLimit(_0x52b61c['limit'],DEFAULT_DISPLAY_LIMIT),_0x31f0c8=_0x556d5e[0x0],_0x48f056=_0x31f0c8?_0x48d875(0x23d)+_0x31f0c8+_0x48d875(0x1fb):_0x48d875(0x24a),_0x210038=await withSpinner(_0x48f056,()=>_0x45d47b['schedules'][_0x48d875(0x209)]({'limit':_0x1650b9,'scheduled':!![],'pattern':_0x31f0c8}),{'verbose':_0x52b61c[_0x48d875(0x21b)]}),_0x401b8b=_0x210038[_0x48d875(0x23e)][_0x48d875(0x267)],_0x430e25=_0x210038[_0x48d875(0x23e)][_0x48d875(0x223)][_0x48d875(0x20a)],_0x27f06e=_0x31f0c8?'\x20matching\x20\x22'+_0x31f0c8+'\x22':'';_0x430e25?console[_0x48d875(0x1ea)](_0x48d875(0x24c)+_0x401b8b[_0x48d875(0x216)]+'\x20schedules'+_0x27f06e+_0x48d875(0x236)):console['error'](_0x48d875(0x276)+_0x401b8b[_0x48d875(0x216)]+_0x48d875(0x205)+(_0x401b8b['length']!==0x1?_0x48d875(0x25f):'y')+_0x27f06e);if(_0x52b61c[_0x48d875(0x273)]===_0x48d875(0x21c)||_0x52b61c['format']===_0x48d875(0x1fd)||_0x52b61c[_0x48d875(0x273)]===_0x48d875(0x26c)||_0x52b61c[_0x48d875(0x273)]===_0x48d875(0x262)){const _0x20480d=_0x401b8b['map'](_0x107f6c=>({'id':_0x107f6c['id'],'name':_0x107f6c['name'],'cron':_0x107f6c[_0x48d875(0x212)],'database':_0x107f6c[_0x48d875(0x1f5)]?.[_0x48d875(0x237)],'type':_0x107f6c[_0x48d875(0x21f)],'timezone':_0x107f6c[_0x48d875(0x1f7)],'user_name':_0x107f6c['user']?.[_0x48d875(0x237)],'updated_at':_0x107f6c[_0x48d875(0x1ed)],'next_run_at':_0x107f6c['next_run_at'],'last_job_status':_0x107f6c[_0x48d875(0x22d)]?.[_0x48d875(0x1f9)]}));await handleSDKOutput(_0x20480d,_0x52b61c);}else{if(_0x401b8b[_0x48d875(0x216)]===0x0)console[_0x48d875(0x1ec)](_0x48d875(0x20d));else{const _0x279eb5=_0x52b61c[_0x48d875(0x1f0)],_0x4b8e91=_0x401b8b[_0x48d875(0x25e)](_0x10555b=>{const _0x32e34c=_0x48d875,_0x5ba5b6=_0x10555b[_0x32e34c(0x22d)]?.[_0x32e34c(0x1f9)]?_0x10555b['last_job'][_0x32e34c(0x1f9)]===_0x32e34c(0x268)?'✓':'✗':'-',_0x2ef144=_0x10555b['last_job']?.[_0x32e34c(0x265)]?formatRelativeTime(_0x10555b[_0x32e34c(0x22d)][_0x32e34c(0x265)]):_0x32e34c(0x257),_0x399a4b=_0x10555b[_0x32e34c(0x232)]?formatRelativeTime(_0x10555b[_0x32e34c(0x232)]):'-',_0x27f07e=_0x10555b[_0x32e34c(0x212)]||'',_0x4c1d48=_0x10555b['name']||'(unnamed)',_0x10ae47=getConsoleUrl(_0x279eb5,_0x32e34c(0x256)+_0x10555b['id']);return{'statusIcon':_0x5ba5b6,'lastRun':_0x2ef144,'nextRun':_0x399a4b,'cron':_0x27f07e,'name':_0x4c1d48,'queryUrl':_0x10ae47,'status':_0x10555b[_0x32e34c(0x22d)]?.['status']};}),_0x5be0cc=Math['max'](..._0x4b8e91[_0x48d875(0x25e)](_0xbb2d9c=>_0xbb2d9c[_0x48d875(0x21e)][_0x48d875(0x216)])),_0x5f55c5=Math[_0x48d875(0x253)](..._0x4b8e91[_0x48d875(0x25e)](_0xc52743=>_0xc52743[_0x48d875(0x1fa)]['length'])),_0x1c0d88=Math[_0x48d875(0x253)](..._0x4b8e91[_0x48d875(0x25e)](_0x25b0f0=>_0x25b0f0['cron'][_0x48d875(0x216)])),_0x39991b=_0x4b8e91[_0x48d875(0x25e)](_0xa7f418=>{const _0x596fc=_0x48d875,_0x12175=_0xa7f418['status']===_0x596fc(0x268)?a30_0x16abd3[_0x596fc(0x215)](_0xa7f418[_0x596fc(0x249)]):_0xa7f418[_0x596fc(0x1f9)]===_0x596fc(0x1ea)?a30_0x16abd3[_0x596fc(0x259)](_0xa7f418[_0x596fc(0x249)]):a30_0x16abd3[_0x596fc(0x274)](_0xa7f418[_0x596fc(0x249)]),_0x44e780=_0xa7f418['lastRun'][_0x596fc(0x23a)](_0x5be0cc),_0x5a4704=_0xa7f418[_0x596fc(0x1fa)][_0x596fc(0x23a)](_0x5f55c5),_0x3acaaf=_0xa7f418[_0x596fc(0x212)]?a30_0x16abd3[_0x596fc(0x244)](_0xa7f418[_0x596fc(0x212)][_0x596fc(0x23a)](_0x1c0d88)):'\x20'['repeat'](_0x1c0d88),_0x21ac73=hyperlink(_0xa7f418[_0x596fc(0x237)],_0xa7f418['queryUrl']);return _0x596fc(0x275)+_0x12175+'\x20'+_0x44e780+_0x596fc(0x217)+_0x5a4704+'\x20\x20'+_0x3acaaf+'\x20\x20'+_0x21ac73;});await writeOutput(_0x39991b[_0x48d875(0x26f)]('\x0a'),_0x52b61c['output'],_0x48d875(0x1f2));}}return 0x0;}}export class ScheduleShowCommand extends BaseCommand{[a30_0x3f1c4d(0x237)]=a30_0x3f1c4d(0x22b);[a30_0x3f1c4d(0x24e)]='Show\x20schedule\x20details';[a30_0x3f1c4d(0x231)](_0x209517){const _0x593ee8=a30_0x3f1c4d,_0x2f081c=_0x209517['args'][0x0];if(!_0x2f081c)return _0x593ee8(0x270);return undefined;}async[a30_0x3f1c4d(0x1e9)](_0x174660){const _0x4f1145=a30_0x3f1c4d,{options:_0x3bd651,args:_0x407d72,tdx:_0x3a9ed9}=_0x174660,_0xb433bc=_0x407d72[0x0],_0x4fe2d5=await withSpinner(_0x4f1145(0x203),()=>_0x3a9ed9[_0x4f1145(0x230)]['show'](_0xb433bc),{'verbose':_0x3bd651[_0x4f1145(0x21b)]}),_0x555f4e=_0x4fe2d5[_0x4f1145(0x23e)],_0x102712={'name':_0x555f4e[_0x4f1145(0x237)],'cron':_0x555f4e['cron'],'database':_0x555f4e[_0x4f1145(0x1f5)],'type':_0x555f4e['type'],'timezone':_0x555f4e[_0x4f1145(0x271)],'user_name':_0x555f4e[_0x4f1145(0x21a)],'created_at':_0x555f4e[_0x4f1145(0x25d)],'engine_version':_0x555f4e['engine_version'],'executing_user_id':_0x555f4e[_0x4f1145(0x23c)],'query':_0x555f4e[_0x4f1145(0x242)],'delay':_0x555f4e[_0x4f1145(0x21d)],'priority':_0x555f4e[_0x4f1145(0x1f1)],'retry_limit':_0x555f4e['retry_limit'],..._0x555f4e[_0x4f1145(0x248)]&&{'result':_0x555f4e['result']}};return await handleSingleObjectOutput(_0x102712,_0x3bd651),0x0;}}export class ScheduleCreateCommand extends BaseCommand{[a30_0x3f1c4d(0x237)]=a30_0x3f1c4d(0x239);[a30_0x3f1c4d(0x24e)]=a30_0x3f1c4d(0x258);[a30_0x3f1c4d(0x231)](_0x5c5f89){const _0x42f684=a30_0x3f1c4d,_0x5e21b7=_0x5c5f89['args'][0x0];if(!_0x5e21b7)return _0x42f684(0x241);const _0x45f466=_0x5c5f89[_0x42f684(0x247)];if(!_0x45f466[_0x42f684(0x1f5)])return'Database\x20is\x20required\x0aUsage:\x20job\x20schedule\x20create\x20<name>\x20-d\x20<db>\x20--file\x20<path>\x20[options]';return undefined;}async[a30_0x3f1c4d(0x1e9)](_0x5cb754){const _0x43d95c=a30_0x3f1c4d,{options:_0x5f3977,args:_0x48e21c,tdx:_0xdc6160}=_0x5cb754,_0x1302a6=_0x48e21c[0x0],_0xc5a913=_0x5f3977,_0x56a8c2=_0xc5a913[_0x43d95c(0x1f5)],_0x684831=_0xc5a913['file'],_0x42e103=_0xc5a913['type']||_0x43d95c(0x1f8);let _0xa7f480;try{_0xa7f480=readFileSync(_0x684831,_0x43d95c(0x24d))['trim']();}catch(_0xb21ac6){throw new SDKError(ErrorCode[_0x43d95c(0x24f)],_0x43d95c(0x246)+_0x684831,_0xb21ac6 instanceof Error?_0xb21ac6:undefined);}if(!_0xa7f480)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x43d95c(0x235));const _0x22ef6b={'database':_0x56a8c2,'query':_0xa7f480,'type':_0x42e103};if(_0xc5a913[_0x43d95c(0x212)])_0x22ef6b[_0x43d95c(0x212)]=_0xc5a913['cron'];if(_0xc5a913[_0x43d95c(0x271)])_0x22ef6b[_0x43d95c(0x271)]=_0xc5a913[_0x43d95c(0x271)];if(_0xc5a913['delay']!==undefined)_0x22ef6b[_0x43d95c(0x21d)]=Number(_0xc5a913[_0x43d95c(0x21d)]);if(_0xc5a913[_0x43d95c(0x1f1)]!==undefined)_0x22ef6b[_0x43d95c(0x1f1)]=Number(_0xc5a913[_0x43d95c(0x1f1)]);if(_0xc5a913[_0x43d95c(0x255)]!==undefined)_0x22ef6b['retry_limit']=Number(_0xc5a913[_0x43d95c(0x255)]);if(_0xc5a913[_0x43d95c(0x222)])_0x22ef6b[_0x43d95c(0x219)]=_0xc5a913[_0x43d95c(0x222)];if(_0xc5a913[_0x43d95c(0x248)])_0x22ef6b['result']=_0xc5a913[_0x43d95c(0x248)];if(_0x5f3977['verbose']){console['error'](_0x43d95c(0x264)+_0x1302a6),console['error'](_0x43d95c(0x20b)+_0x56a8c2),console[_0x43d95c(0x1ea)](_0x43d95c(0x1e5)+_0x42e103);if(_0x22ef6b[_0x43d95c(0x212)])console['error'](_0x43d95c(0x234)+_0x22ef6b[_0x43d95c(0x212)]);if(_0x22ef6b[_0x43d95c(0x271)])console[_0x43d95c(0x1ea)](_0x43d95c(0x214)+_0x22ef6b[_0x43d95c(0x271)]);}const _0x5cbeb1=await withSpinner(_0x43d95c(0x238),()=>_0xdc6160[_0x43d95c(0x230)][_0x43d95c(0x1fe)](_0x1302a6,_0x22ef6b),{'verbose':_0x5f3977['verbose']});return console[_0x43d95c(0x1ea)]('Schedule\x20created:\x20'+_0x5cbeb1[_0x43d95c(0x23e)][_0x43d95c(0x237)]),await handleSingleObjectOutput(_0x5cbeb1[_0x43d95c(0x23e)],_0x5f3977),0x0;}}export class ScheduleUpdateCommand extends BaseCommand{[a30_0x3f1c4d(0x237)]='schedule:update';[a30_0x3f1c4d(0x24e)]=a30_0x3f1c4d(0x263);['validate'](_0x5ab85f){const _0x460aa7=a30_0x3f1c4d,_0xd1886a=_0x5ab85f[_0x460aa7(0x229)][0x0];if(!_0xd1886a)return'Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20update\x20<name>\x20[options]';return undefined;}async[a30_0x3f1c4d(0x1e9)](_0x1a537b){const _0x3f3a8b=a30_0x3f1c4d,{options:_0x286300,args:_0x1d6074,tdx:_0x5343c8}=_0x1a537b,_0x3d4a6e=_0x1d6074[0x0],_0x8c5b85=_0x286300,_0x2f1b31={};if(_0x8c5b85['database'])_0x2f1b31[_0x3f3a8b(0x1f5)]=_0x8c5b85['database'];if(_0x8c5b85['type'])_0x2f1b31[_0x3f3a8b(0x21f)]=_0x8c5b85[_0x3f3a8b(0x21f)];if(_0x8c5b85[_0x3f3a8b(0x212)])_0x2f1b31[_0x3f3a8b(0x212)]=_0x8c5b85['cron'];if(_0x8c5b85[_0x3f3a8b(0x271)])_0x2f1b31[_0x3f3a8b(0x271)]=_0x8c5b85[_0x3f3a8b(0x271)];if(_0x8c5b85[_0x3f3a8b(0x21d)]!==undefined)_0x2f1b31[_0x3f3a8b(0x21d)]=Number(_0x8c5b85[_0x3f3a8b(0x21d)]);if(_0x8c5b85[_0x3f3a8b(0x1f1)]!==undefined)_0x2f1b31['priority']=Number(_0x8c5b85[_0x3f3a8b(0x1f1)]);if(_0x8c5b85[_0x3f3a8b(0x255)]!==undefined)_0x2f1b31['retry_limit']=Number(_0x8c5b85[_0x3f3a8b(0x255)]);if(_0x8c5b85[_0x3f3a8b(0x222)])_0x2f1b31[_0x3f3a8b(0x219)]=_0x8c5b85['engineVersion'];if(_0x8c5b85[_0x3f3a8b(0x248)])_0x2f1b31[_0x3f3a8b(0x248)]=_0x8c5b85[_0x3f3a8b(0x248)];if(_0x8c5b85[_0x3f3a8b(0x1fc)])try{_0x2f1b31[_0x3f3a8b(0x242)]=readFileSync(_0x8c5b85[_0x3f3a8b(0x1fc)],_0x3f3a8b(0x24d))[_0x3f3a8b(0x23b)]();}catch(_0x23e51b){throw new SDKError(ErrorCode[_0x3f3a8b(0x24f)],'Failed\x20to\x20read\x20file:\x20'+_0x8c5b85[_0x3f3a8b(0x1fc)],_0x23e51b instanceof Error?_0x23e51b:undefined);}if(Object[_0x3f3a8b(0x224)](_0x2f1b31)[_0x3f3a8b(0x216)]===0x0)throw new SDKError(ErrorCode[_0x3f3a8b(0x24f)],_0x3f3a8b(0x1e8));if(_0x286300[_0x3f3a8b(0x21b)]){console[_0x3f3a8b(0x1ea)]('Updating\x20schedule:\x20'+_0x3d4a6e);for(const [_0x3d525a,_0x172d46]of Object[_0x3f3a8b(0x260)](_0x2f1b31)){_0x3d525a===_0x3f3a8b(0x242)?console[_0x3f3a8b(0x1ea)]('\x20\x20'+_0x3d525a+':\x20'+_0x172d46[_0x3f3a8b(0x1ff)](0x0,0x32)+_0x3f3a8b(0x1f4)):console['error']('\x20\x20'+_0x3d525a+':\x20'+_0x172d46);}}const _0x32d5f9=await withSpinner(_0x3f3a8b(0x22c),()=>_0x5343c8[_0x3f3a8b(0x230)][_0x3f3a8b(0x26b)](_0x3d4a6e,_0x2f1b31),{'verbose':_0x286300['verbose']});return console[_0x3f3a8b(0x1ea)]('Schedule\x20updated:\x20'+_0x32d5f9[_0x3f3a8b(0x23e)][_0x3f3a8b(0x237)]),await handleSingleObjectOutput(_0x32d5f9[_0x3f3a8b(0x23e)],_0x286300),0x0;}}function a30_0x5e09(_0xc785cd,_0x433c75){_0xc785cd=_0xc785cd-0x1e5;const _0x17eff9=a30_0x17ef();let _0x5e0976=_0x17eff9[_0xc785cd];return _0x5e0976;}function a30_0x17ef(){const _0x121de7=['updated_at','scheduled_at','in\x20','site','priority','list','toLocaleDateString','...','database','history','time_zone','trino','status','nextRun','\x22...','file','jsonl','create','substring','Deleting\x20schedule...','Run\x20a\x20scheduled\x20query\x20immediately','soon','Getting\x20schedule\x20details...','schedule:run','\x20scheduled\x20quer','\x20\x20Time:\x20','m\x20ago','30PYIDns','listQueries','has_next_page','\x20\x20Database:\x20','end_at','No\x20scheduled\x20queries\x20found','Running\x20schedule...','3247594QfWoPk','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20schedule\x20\x22','Getting\x20schedule\x20history...','cron','806502mDnCGw','\x20\x20Timezone:\x20','green','length','\x20\x20→\x20','h\x20ago','engine_version','user_name','verbose','json','delay','lastRun','type','from','Schedule\x20deleted:\x20','engineVersion','pagination','keys','num','round','List\x20scheduled\x20queries','d\x20ago','args','Schedule\x20run\x20submitted:\x20','schedule:show','Updating\x20schedule...','last_job','abs','1716539CkNCwT','schedules','validate','next_run_at','70rPDZIr','\x20\x20Cron:\x20','Query\x20file\x20is\x20empty','\x20(use\x20--limit\x20to\x20see\x20more)','name','Creating\x20schedule...','schedule:create','padEnd','trim','executing_user_id','Searching\x20scheduled\x20queries\x20matching\x20\x22','data','215772QOYyQV','just\x20now','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20create\x20<name>\x20-d\x20<db>\x20--file\x20<path>\x20[options]','query','\x20job','cyan','run','Failed\x20to\x20read\x20file:\x20','options','result','statusIcon','Listing\x20scheduled\x20queries...','getTime','Showing\x20first\x20','utf-8','description','INVALID_ARGUMENT','Delete\x20a\x20scheduled\x20query','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20run\x20<name>\x20[--time\x20<iso8601>]\x20[--num\x20<1-10>]','\x20created','max','84387cRBpcw','retryLimit','/app/queries/editor?queryId=','never','Create\x20a\x20scheduled\x20query','red','start_at','9295659NKedpv','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20history\x20<name>\x20[--from\x20<n>]\x20[--to\x20<n>]','created_at','map','ies','entries','Running\x20schedule:\x20','tsv','Update\x20a\x20scheduled\x20query','Creating\x20schedule:\x20','ended_at','count','queries','success','yes','16qWiJoX','update','table','1520775axjlOo','schedule:delete','join','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20show\x20<name>','timezone','schedule:list','format','dim','📅\x20','Found\x20','\x20\x20Type:\x20','job_id','\x20(showing\x20','At\x20least\x20one\x20option\x20must\x20be\x20provided\x20to\x20update','execute','error','66hPZzcQ','log'];a30_0x17ef=function(){return _0x121de7;};return a30_0x17ef();}export class ScheduleDeleteCommand extends BaseCommand{[a30_0x3f1c4d(0x237)]=a30_0x3f1c4d(0x26e);['description']=a30_0x3f1c4d(0x250);[a30_0x3f1c4d(0x231)](_0x3ab8cb){const _0x541a34=_0x3ab8cb['args'][0x0];if(!_0x541a34)return'Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20delete\x20<name>';return undefined;}async['execute'](_0x29d54b){const _0x4d2417=a30_0x3f1c4d,{options:_0xe984e1,args:_0x20e97a,tdx:_0x4623fe}=_0x29d54b,_0x34b3ba=_0x20e97a[0x0];if(!_0xe984e1[_0x4d2417(0x269)]){const _0x292d7b=await confirm(_0x4d2417(0x210)+_0x34b3ba+'\x22?');if(!_0x292d7b)return console[_0x4d2417(0x1ea)]('Cancelled'),0x0;}const _0x3ee67e=await withSpinner(_0x4d2417(0x200),()=>_0x4623fe['schedules']['delete'](_0x34b3ba),{'verbose':_0xe984e1[_0x4d2417(0x21b)]});return console[_0x4d2417(0x1ea)](_0x4d2417(0x221)+_0x3ee67e[_0x4d2417(0x23e)][_0x4d2417(0x237)]),0x0;}}export class ScheduleRunCommand extends BaseCommand{[a30_0x3f1c4d(0x237)]=a30_0x3f1c4d(0x204);[a30_0x3f1c4d(0x24e)]=a30_0x3f1c4d(0x201);[a30_0x3f1c4d(0x231)](_0x1ef48f){const _0x3cf496=a30_0x3f1c4d,_0x50fc9d=_0x1ef48f[_0x3cf496(0x229)][0x0];if(!_0x50fc9d)return _0x3cf496(0x251);return undefined;}async[a30_0x3f1c4d(0x1e9)](_0x2d39d0){const _0xf345de=a30_0x3f1c4d,{options:_0x2f8f80,args:_0x47b69e,tdx:_0x55b5d2}=_0x2d39d0,_0xad5733=_0x47b69e[0x0],_0x4b162b=_0x2f8f80,_0x3e970e=_0x4b162b['time'],_0x1067d=_0x4b162b[_0xf345de(0x225)]!==undefined?Number(_0x4b162b[_0xf345de(0x225)]):undefined;if(_0x2f8f80[_0xf345de(0x21b)]){console[_0xf345de(0x1ea)](_0xf345de(0x261)+_0xad5733);if(_0x3e970e)console['error'](_0xf345de(0x206)+_0x3e970e);if(_0x1067d)console[_0xf345de(0x1ea)]('\x20\x20Num:\x20'+_0x1067d);}const _0x37199e=await withSpinner(_0xf345de(0x20e),()=>_0x55b5d2[_0xf345de(0x230)][_0xf345de(0x245)](_0xad5733,{'time':_0x3e970e,'num':_0x1067d}),{'verbose':_0x2f8f80[_0xf345de(0x21b)]}),_0xb82c81=_0x37199e[_0xf345de(0x23e)]['jobs'];console['error'](_0xf345de(0x22a)+_0xb82c81['length']+_0xf345de(0x243)+(_0xb82c81[_0xf345de(0x216)]!==0x1?'s':'')+_0xf345de(0x252));for(const _0x236634 of _0xb82c81){console[_0xf345de(0x1ea)]('\x20\x20Job\x20ID:\x20'+_0x236634[_0xf345de(0x1e6)]);}return await handleSDKOutput(_0xb82c81,_0x2f8f80),0x0;}}export class ScheduleHistoryCommand extends BaseCommand{[a30_0x3f1c4d(0x237)]='schedule:history';[a30_0x3f1c4d(0x24e)]='Show\x20schedule\x20execution\x20history';['validate'](_0x247cce){const _0x17107b=a30_0x3f1c4d,_0x44f7a9=_0x247cce[_0x17107b(0x229)][0x0];if(!_0x44f7a9)return _0x17107b(0x25c);return undefined;}async[a30_0x3f1c4d(0x1e9)](_0x35e934){const _0x54d018=a30_0x3f1c4d,{options:_0x2ea533,args:_0x212fde,tdx:_0x3b6b09}=_0x35e934,_0x156f31=_0x212fde[0x0],_0x4b69b5=_0x2ea533,_0x37f5e3=_0x4b69b5[_0x54d018(0x220)]!==undefined?Number(_0x4b69b5['from']):undefined,_0x487a48=_0x4b69b5['to']!==undefined?Number(_0x4b69b5['to']):undefined,_0x787908=await withSpinner(_0x54d018(0x211),()=>_0x3b6b09[_0x54d018(0x230)][_0x54d018(0x1f6)](_0x156f31,{'from':_0x37f5e3,'to':_0x487a48}),{'verbose':_0x2ea533[_0x54d018(0x21b)]}),_0x2e16a5=_0x787908['data'];console[_0x54d018(0x1ea)](_0x54d018(0x276)+_0x2e16a5[_0x54d018(0x266)]+'\x20execution'+(_0x2e16a5[_0x54d018(0x266)]!==0x1?'s':'')+_0x54d018(0x1e7)+_0x2e16a5[_0x54d018(0x220)]+'-'+_0x2e16a5['to']+')');const _0x3c2f2e=_0x2e16a5[_0x54d018(0x1f6)][_0x54d018(0x25e)](_0x21e1a6=>({'job_id':_0x21e1a6[_0x54d018(0x1e6)],'type':_0x21e1a6[_0x54d018(0x21f)],'status':_0x21e1a6[_0x54d018(0x1f9)],'scheduled_at':_0x21e1a6[_0x54d018(0x1ee)],'created_at':_0x21e1a6[_0x54d018(0x25d)],'start_at':_0x21e1a6[_0x54d018(0x25a)],'end_at':_0x21e1a6[_0x54d018(0x20c)]}));return await handleSDKOutput(_0x3c2f2e,_0x2ea533),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_0x580cc0=a31_0x1219;(function(_0x2b8832,_0x105395){const _0x1217cd=a31_0x1219,_0x364447=_0x2b8832();while(!![]){try{const _0x419dcb=-parseInt(_0x1217cd(0x22b))/0x1*(parseInt(_0x1217cd(0x234))/0x2)+-parseInt(_0x1217cd(0x1fb))/0x3*(-parseInt(_0x1217cd(0x267))/0x4)+parseInt(_0x1217cd(0x20c))/0x5*(-parseInt(_0x1217cd(0x21f))/0x6)+-parseInt(_0x1217cd(0x1fa))/0x7+-parseInt(_0x1217cd(0x245))/0x8+parseInt(_0x1217cd(0x263))/0x9+parseInt(_0x1217cd(0x269))/0xa;if(_0x419dcb===_0x105395)break;else _0x364447['push'](_0x364447['shift']());}catch(_0x4f3ae6){_0x364447['push'](_0x364447['shift']());}}}(a31_0x906c,0x54af3));function a31_0x1219(_0x57fa4a,_0x321be7){_0x57fa4a=_0x57fa4a-0x1e1;const _0x906c79=a31_0x906c();let _0x1219c1=_0x906c79[_0x57fa4a];return _0x1219c1;}import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';function a31_0x906c(){const _0x1060a8=['code','\x20\x20tdx\x20sg\x20sql\x20segments/my-audience/premium-users.yml','Usage:\x20tdx\x20segment\x20describe\x20<path>','Folder\x20ID:\x20','Error:\x20Parent\x20segment\x20name\x20is\x20required','\x20\x20Full\x20path:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20desc\x20<path/to/segment.yml>','length','Executing\x20segment\x20query...','segment:desc','Target\x20path:\x20','segment:sql','Error:\x20Cannot\x20open\x20parent\x20segment\x20with\x20this\x20command.','error','Use:\x20tdx\x20ps\x20show','format','jobId','stats','data','Usage:\x20tdx\x20sg\x20desc\x20<name>','Resolved\x20parent\x20folder\x20ID:\x20','getParent','Usage:\x20tdx\x20sg\x20view\x20<name>\x20[-w]','2397024zMNFZp','Usage:\x20tdx\x20sg\x20sql\x20<name>','✔\x20Created\x20folder\x20\x27','Resolved\x20type:\x20','944JOQzvG','Fetching\x20folder\x20details...','13468790DnOQZH','\x20\x20tdx\x20sg\x20show\x20\x22Premium\x20Users\x22','Segment\x20ID\x20missing\x20from\x20resolved\x20path','description','Parent\x20segment:\x20','Resolving\x20folder\x20\x27','Listing\x20folders\x20for\x20parent\x20\x27','Resolved\x20YAML\x20file:\x20','segmentId','parentId','folder','\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','Use:\x20tdx\x20ps\x20view\x20-w','limit','parent','Resolved\x20parent\x20ID:\x20','segmentPath','Segment\x20ID:\x20','SQL\x20query:\x0a','log','Fetching\x20folder\x20\x27','folderId','List\x20segment\x20folders\x20under\x20a\x20parent\x20segment','green','Error:\x20Folder\x20reference\x20is\x20required','Use:\x20tdx\x20ps\x20sql','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','elapsedTimeMillis','Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]','Examples:','Options:','Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)','Error:\x20Cannot\x20view\x20parent\x20segment\x20details\x20with\x20this\x20command.','\x20\x20-w,\x20--web\x20\x20Open\x20segment\x20in\x20web\x20browser','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20\x20\x20\x20\x20#\x20View\x20child\x20segment\x20details','Site:\x20','\x20\x20tdx\x20sg\x20view\x20\x22Marketing\x22\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20folder\x20details','resolveParentId','replace','✖\x20Query\x20failed\x20[','cyan','\x20\x20tdx\x20sg\x20desc\x20\x22Premium\x20Users\x22','Error:\x20Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.','\x27\x20with\x20ID:\x20','parentSegment','url','message','3306380FHpBZL','3717eypVxp','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','name','\x20rows\x20','Creating\x20folder\x20\x27','Use:\x20tdx\x20ps\x20view','verbose','Parent\x20ID:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20sql\x20<path/to/segment.yml>','Use:\x20tdx\x20ps\x20desc','Error:\x20','in\x20','Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required','Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.','Resolving\x20parent\x20folder\x20\x27','includes','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20-w\x20\x20#\x20Open\x20segment\x20in\x20web\x20browser','19495wJQqKt','(root)','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','Execute\x20child\x20segment\x20SQL\x20query\x20and\x20show\x20results','/app/ps/','INVALID_ARGUMENT','fullPath','Resolving\x20parent\x20segment\x20\x27','\x20\x20tdx\x20sg\x20show\x20segments/my-audience/premium-users.yml','Show\x20segment\x20folder\x20details','Parent\x20name:\x20','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22','Resolved\x20relative\x20path\x20to:\x20','execute','cause','getSegment','trim','web','Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>','66euiOdN','segment:folder:list','\x20\x20Folder\x20path:\x20','Error:\x20Cannot\x20show\x20schema\x20for\x20parent\x20segment\x20with\x20this\x20command.','Fetching\x20SQL\x20for\x20segment...','getFolder','Show\x20folder\x20or\x20child\x20segment\x20details','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22','information_schema','/e/','Folder\x20ID\x20missing\x20from\x20resolved\x20path','Fetching\x20segment\x20details...','26tsjxkH','Error:\x20Cannot\x20open\x20folder\x20in\x20web\x20browser.\x20Use\x20a\x20segment\x20name\x20instead.','Resolved\x20folder\x20ID:\x20','SEGMENT_FOLDER_NOT_FOUND','resolvePathToResource','resolveFolderId','Show\x20child\x20segment\x20schema\x20(column\x20types)','SEGMENT_NOT_FOUND','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20view\x20<path/to/segment.yml>','50726SePdVk','setJobId','type','Use:\x20tdx\x20sg\x20view\x20<name>\x20\x20#\x20To\x20show\x20folder\x20details','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','json','Fetching\x20parent\x20segment\x20details...','segment:folder:show','\x27...','processedRows','parentFolder','\x20\x20tdx\x20sg\x20view\x20segments/my-audience/premium-users.yml','getSegmentSQL','Resolving\x20\x27','\x20Opening\x20','✔\x20Query\x20completed:\x20Processed\x20','segment:describe','3072680xZAjGH','segment','segmentName','\x20folder','\x20\x20Segment\x20name:\x20','\x20\x20Cause:\x20','Folder\x20name:\x20'];a31_0x906c=function(){return _0x1060a8;};return a31_0x906c();}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_0x399677 from'chalk';async function resolveSegmentTarget(_0x1f1354,_0x1777ad,_0x49a8ae){const _0x395697=a31_0x1219;if(isYamlFilePath(_0x1f1354))try{const _0x5cddbf=await resolveYamlFilePath(_0x1f1354);return _0x49a8ae&&(console[_0x395697(0x259)](_0x395697(0x270)+_0x1f1354),console[_0x395697(0x259)]('\x20\x20Parent\x20segment:\x20'+_0x5cddbf[_0x395697(0x1f7)]),console[_0x395697(0x259)](_0x395697(0x249)+_0x5cddbf[_0x395697(0x247)]),console[_0x395697(0x259)](_0x395697(0x221)+(_0x5cddbf['folderPath']||_0x395697(0x20d))),console[_0x395697(0x259)](_0x395697(0x251)+_0x5cddbf[_0x395697(0x212)])),_0x5cddbf['fullPath'];}catch(_0x305486){throw new SDKError(ErrorCode[_0x395697(0x211)],_0x395697(0x238)+_0x305486[_0x395697(0x1f9)]);}if(!_0x1777ad)throw new SDKError(ErrorCode[_0x395697(0x211)],_0x395697(0x1e5));return _0x1777ad+'/'+_0x1f1354;}export class SegmentDescribeCommand extends BaseCommand{[a31_0x580cc0(0x1fd)]=a31_0x580cc0(0x244);[a31_0x580cc0(0x26c)]='Show\x20segment\x20or\x20folder\x20details';async[a31_0x580cc0(0x219)](_0x19bfae){const _0x31c23a=a31_0x580cc0,{options:_0x409c40,args:_0x485e49,tdx:_0x4da891}=_0x19bfae,_0x2cd5d1=_0x485e49[0x0],_0x1f1dcb=!_0x2cd5d1&&!!_0x409c40['parentSegment'],_0x22f5da=_0x2cd5d1||_0x409c40[_0x31c23a(0x1f7)];if(!_0x22f5da)return console[_0x31c23a(0x259)]('Error:\x20Path\x20or\x20name\x20is\x20required'),console[_0x31c23a(0x259)](_0x31c23a(0x24e)),console[_0x31c23a(0x259)](_0x31c23a(0x1e8)),console[_0x31c23a(0x259)](_0x31c23a(0x226)),console['error'](_0x31c23a(0x217)),console['error'](_0x31c23a(0x274)),console[_0x31c23a(0x259)]('\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>'),0x1;try{const _0x1ee15e=_0x409c40[_0x31c23a(0x279)];let _0x24ac37=_0x22f5da;!_0x1f1dcb&&_0x1ee15e&&!_0x22f5da[_0x31c23a(0x20a)]('/')&&(_0x24ac37=_0x1ee15e+'/'+_0x22f5da,_0x409c40['verbose']&&console[_0x31c23a(0x259)](_0x31c23a(0x218)+_0x24ac37));const _0x2d1330=await withSpinner('Resolving\x20path\x20\x27'+_0x24ac37+_0x31c23a(0x23c),()=>_0x4da891[_0x31c23a(0x246)][_0x31c23a(0x22f)](_0x24ac37),{'verbose':_0x409c40[_0x31c23a(0x201)]}),_0x103eb3=_0x2d1330['data'];_0x409c40['verbose']&&(console['error'](_0x31c23a(0x266)+_0x103eb3[_0x31c23a(0x236)]),console['error']('Parent\x20ID:\x20'+_0x103eb3['parentId']),_0x103eb3['folderId']&&console['error'](_0x31c23a(0x24f)+_0x103eb3['folderId']),_0x103eb3[_0x31c23a(0x271)]&&console[_0x31c23a(0x259)](_0x31c23a(0x27a)+_0x103eb3['segmentId']));if(_0x103eb3[_0x31c23a(0x236)]==='parent'){const _0x62410b=await withSpinner(_0x31c23a(0x23a),()=>_0x4da891['segment'][_0x31c23a(0x261)](_0x103eb3[_0x31c23a(0x272)]),{'verbose':_0x409c40['verbose']});await handleSingleObjectOutput(_0x62410b['data'],_0x409c40);}else{if(_0x103eb3[_0x31c23a(0x236)]==='folder'){if(!_0x103eb3[_0x31c23a(0x27e)])throw new SDKError(ErrorCode[_0x31c23a(0x22e)],_0x31c23a(0x229));const _0x298c90=await withSpinner(_0x31c23a(0x268),()=>_0x4da891[_0x31c23a(0x246)]['getFolder'](_0x103eb3['folderId']),{'verbose':_0x409c40[_0x31c23a(0x201)]});await handleSingleObjectOutput(_0x298c90['data'],_0x409c40);}else{if(_0x103eb3['type']===_0x31c23a(0x246)){if(!_0x103eb3[_0x31c23a(0x271)])throw new SDKError(ErrorCode[_0x31c23a(0x232)],_0x31c23a(0x26b));const _0x598823=await withSpinner(_0x31c23a(0x22a),()=>_0x4da891[_0x31c23a(0x246)]['getSegment'](_0x103eb3[_0x31c23a(0x272)],_0x103eb3[_0x31c23a(0x271)]),{'verbose':_0x409c40['verbose']});await handleSingleObjectOutput(_0x598823['data'],_0x409c40);}}}return 0x0;}catch(_0x422426){if(_0x422426 instanceof SDKError)return console[_0x31c23a(0x259)](_0x31c23a(0x205)+_0x422426['message']),_0x422426['cause']&&console['error'](_0x31c23a(0x24a)+_0x422426[_0x31c23a(0x21a)]),0x1;throw _0x422426;}}}export class SegmentShowCommand extends BaseCommand{['name']='segment:show';[a31_0x580cc0(0x26c)]=a31_0x580cc0(0x20f);async[a31_0x580cc0(0x219)](_0x3de730){const _0x5cbb51=a31_0x580cc0,{options:_0x12b775,args:_0x2873d8,tdx:_0x10e67a}=_0x3de730,_0x444cbc=_0x2873d8[0x0];if(!_0x444cbc)return console[_0x5cbb51(0x259)](_0x5cbb51(0x207)),console[_0x5cbb51(0x259)]('Usage:\x20tdx\x20sg\x20show\x20<name>'),console[_0x5cbb51(0x259)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20show\x20<path/to/segment.yml>'),console['error'](_0x5cbb51(0x1e8)),console[_0x5cbb51(0x259)](_0x5cbb51(0x26a)),console['error'](_0x5cbb51(0x214)),0x1;try{const _0x2d63e7=_0x12b775[_0x5cbb51(0x1f7)],_0x5df1ae=await resolveSegmentTarget(_0x444cbc,_0x2d63e7,_0x12b775[_0x5cbb51(0x201)]);_0x12b775[_0x5cbb51(0x201)]&&console[_0x5cbb51(0x259)](_0x5cbb51(0x256)+_0x5df1ae);const _0x5abd31=await withSpinner(_0x5cbb51(0x241)+_0x444cbc+_0x5cbb51(0x23c),()=>_0x10e67a[_0x5cbb51(0x246)]['resolvePathToResource'](_0x5df1ae),{'verbose':_0x12b775[_0x5cbb51(0x201)]}),_0x2c3d2c=_0x5abd31[_0x5cbb51(0x25e)];_0x12b775['verbose']&&(console[_0x5cbb51(0x259)](_0x5cbb51(0x266)+_0x2c3d2c['type']),console[_0x5cbb51(0x259)](_0x5cbb51(0x202)+_0x2c3d2c[_0x5cbb51(0x272)]));if(_0x2c3d2c[_0x5cbb51(0x236)]===_0x5cbb51(0x273))return console[_0x5cbb51(0x259)](_0x5cbb51(0x208)),console[_0x5cbb51(0x259)](_0x5cbb51(0x237)),0x1;if(_0x2c3d2c[_0x5cbb51(0x236)]===_0x5cbb51(0x277))return console[_0x5cbb51(0x259)]('Error:\x20Cannot\x20execute\x20query\x20for\x20parent\x20segment\x20with\x20this\x20command.'),console[_0x5cbb51(0x259)](_0x5cbb51(0x25a)),0x1;if(!_0x2c3d2c[_0x5cbb51(0x271)])throw new SDKError(ErrorCode[_0x5cbb51(0x232)],_0x5cbb51(0x26b));const _0x58f66b=await withSpinner(_0x5cbb51(0x223),()=>_0x10e67a[_0x5cbb51(0x246)][_0x5cbb51(0x240)](_0x2c3d2c[_0x5cbb51(0x272)],_0x2c3d2c[_0x5cbb51(0x271)]),{'verbose':_0x12b775[_0x5cbb51(0x201)]});let _0x1fdcc6=_0x58f66b[_0x5cbb51(0x25e)];const _0x3344a4=resolveLimit(_0x12b775[_0x5cbb51(0x276)],DEFAULT_DISPLAY_LIMIT),_0x2455b3=/\bLIMIT\s+\d+/i['test'](_0x1fdcc6);!_0x2455b3&&(_0x1fdcc6=_0x1fdcc6[_0x5cbb51(0x21c)]()[_0x5cbb51(0x1f1)](/;+$/,''),_0x1fdcc6='SELECT\x20*\x20FROM\x20(\x0a'+_0x1fdcc6+_0x5cbb51(0x1fc)+_0x3344a4);_0x12b775[_0x5cbb51(0x201)]&&console[_0x5cbb51(0x259)](_0x5cbb51(0x27b)+_0x1fdcc6);const _0x24dcfd=await withProgressSpinner(_0x5cbb51(0x254),async _0x489db9=>{const _0xc5cbe9=_0x5cbb51,_0x438a91=await _0x10e67a['query']['execute'](_0x1fdcc6,{'catalog':'td','schema':_0xc5cbe9(0x227),'onJobId':_0xf5291c=>{const _0x49b524=_0xc5cbe9;_0x489db9[_0x49b524(0x235)](_0xf5291c);}});return _0x438a91;},{'verbose':_0x12b775[_0x5cbb51(0x201)]}),_0x561b37=_0x24dcfd[_0x5cbb51(0x25e)],_0x376d08=_0x561b37['jobId']?'\x20[Job\x20ID:\x20'+_0x561b37[_0x5cbb51(0x25c)]+']':'';return console['error'](_0x5cbb51(0x243)+_0x561b37[_0x5cbb51(0x25d)][_0x5cbb51(0x23d)]['toLocaleString']()+_0x5cbb51(0x1fe)+(_0x5cbb51(0x206)+formatElapsed(_0x561b37[_0x5cbb51(0x25d)][_0x5cbb51(0x1e6)])+_0x376d08)),await handleQueryOutput(_0x561b37,_0x12b775),0x0;}catch(_0x3981bc){if(_0x3981bc instanceof SDKError)return console[_0x5cbb51(0x259)](_0x5cbb51(0x1f2)+_0x3981bc[_0x5cbb51(0x24c)]+']'),console[_0x5cbb51(0x259)]('\x0a'+_0x3981bc[_0x5cbb51(0x1f9)]),0x1;throw _0x3981bc;}}}export class SegmentFolderListCommand extends BaseCommand{[a31_0x580cc0(0x1fd)]=a31_0x580cc0(0x220);[a31_0x580cc0(0x26c)]=a31_0x580cc0(0x1e1);async['execute'](_0x1a72d2){const _0x74dc9d=a31_0x580cc0,{options:_0x573ae2,args:_0x59f140,tdx:_0x481c82}=_0x1a72d2;if(_0x59f140[_0x74dc9d(0x253)]===0x0)return console[_0x74dc9d(0x259)](_0x74dc9d(0x250)),console[_0x74dc9d(0x259)]('Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>'),0x1;const _0x4a0cba=_0x59f140[0x0];try{_0x573ae2[_0x74dc9d(0x201)]&&(console[_0x74dc9d(0x259)](_0x74dc9d(0x1ee)+_0x573ae2['site']),console[_0x74dc9d(0x259)](_0x74dc9d(0x216)+_0x4a0cba));const _0x5a6238=await withSpinner(_0x74dc9d(0x213)+_0x4a0cba+_0x74dc9d(0x23c),()=>_0x481c82['segment']['resolveParentId'](_0x4a0cba),{'verbose':_0x573ae2[_0x74dc9d(0x201)]}),_0x3cd7b1=_0x5a6238[_0x74dc9d(0x25e)];_0x573ae2['verbose']&&console[_0x74dc9d(0x259)](_0x74dc9d(0x278)+_0x3cd7b1);const _0x9fbaf9=await withSpinner(_0x74dc9d(0x26f)+_0x4a0cba+_0x74dc9d(0x23c),()=>_0x481c82[_0x74dc9d(0x246)]['listFolders'](_0x3cd7b1),{'verbose':_0x573ae2[_0x74dc9d(0x201)]}),_0x161127=_0x9fbaf9['data'];return console[_0x74dc9d(0x259)]('✔\x20Found\x20'+_0x161127[_0x74dc9d(0x253)]+_0x74dc9d(0x248)+(_0x161127[_0x74dc9d(0x253)]!==0x1?'s':'')),await handleSDKOutput(_0x161127,_0x573ae2),0x0;}catch(_0x3d7eaa){if(_0x3d7eaa instanceof SDKError)return console[_0x74dc9d(0x259)](_0x74dc9d(0x205)+_0x3d7eaa['message']),_0x3d7eaa[_0x74dc9d(0x21a)]&&console[_0x74dc9d(0x259)](_0x74dc9d(0x24a)+_0x3d7eaa['cause']),0x1;throw _0x3d7eaa;}}}export class SegmentFolderShowCommand extends BaseCommand{[a31_0x580cc0(0x1fd)]=a31_0x580cc0(0x23b);['description']=a31_0x580cc0(0x215);async[a31_0x580cc0(0x219)](_0x349057){const _0x4d6399=a31_0x580cc0,{options:_0x1ddb5b,args:_0x44c2c7,tdx:_0x115f33}=_0x349057;if(_0x44c2c7[_0x4d6399(0x253)]===0x0)return console['error'](_0x4d6399(0x1e3)),console[_0x4d6399(0x259)](_0x4d6399(0x21e)),0x1;try{const {parentId:_0x1d4cf3,childId:_0x5f407c}=parseSegmentRef(_0x44c2c7[0x0]);_0x1ddb5b[_0x4d6399(0x201)]&&(console[_0x4d6399(0x259)](_0x4d6399(0x1ee)+_0x1ddb5b['site']),console[_0x4d6399(0x259)](_0x4d6399(0x216)+_0x1d4cf3),_0x5f407c&&console['error'](_0x4d6399(0x24b)+_0x5f407c));if(!_0x5f407c)return console[_0x4d6399(0x259)](_0x4d6399(0x1ea)),0x1;const _0x287520=await withSpinner(_0x4d6399(0x213)+_0x1d4cf3+_0x4d6399(0x23c),()=>_0x115f33[_0x4d6399(0x246)][_0x4d6399(0x1f0)](_0x1d4cf3),{'verbose':_0x1ddb5b[_0x4d6399(0x201)]}),_0x2cbea0=_0x287520[_0x4d6399(0x25e)];_0x1ddb5b[_0x4d6399(0x201)]&&console[_0x4d6399(0x259)](_0x4d6399(0x278)+_0x2cbea0);const _0x444caa=await withSpinner(_0x4d6399(0x26e)+_0x5f407c+'\x27...',()=>_0x115f33[_0x4d6399(0x246)][_0x4d6399(0x230)](_0x2cbea0,_0x5f407c),{'verbose':_0x1ddb5b[_0x4d6399(0x201)]}),_0xaaa1bb=_0x444caa[_0x4d6399(0x25e)];_0x1ddb5b[_0x4d6399(0x201)]&&console[_0x4d6399(0x259)](_0x4d6399(0x22d)+_0xaaa1bb);const _0x581ed6=await withSpinner(_0x4d6399(0x27d)+_0x5f407c+_0x4d6399(0x23c),()=>_0x115f33['segment'][_0x4d6399(0x224)](_0xaaa1bb),{'verbose':_0x1ddb5b[_0x4d6399(0x201)]});return await handleSDKOutput([_0x581ed6['data']],_0x1ddb5b),0x0;}catch(_0x28e2fd){if(_0x28e2fd instanceof SDKError)return console[_0x4d6399(0x259)]('Error:\x20'+_0x28e2fd[_0x4d6399(0x1f9)]),_0x28e2fd[_0x4d6399(0x21a)]&&console[_0x4d6399(0x259)](_0x4d6399(0x24a)+_0x28e2fd['cause']),0x1;throw _0x28e2fd;}}}export class SegmentSQLCommand extends BaseCommand{[a31_0x580cc0(0x1fd)]=a31_0x580cc0(0x257);['description']='Get\x20SQL\x20query\x20for\x20child\x20segment';async[a31_0x580cc0(0x219)](_0x922b9f){const _0x3da5d3=a31_0x580cc0,{options:_0x5d20b9,args:_0x258dff,tdx:_0xbea2e8}=_0x922b9f,_0x44edf5=_0x258dff[0x0];if(!_0x44edf5)return console[_0x3da5d3(0x259)](_0x3da5d3(0x207)),console[_0x3da5d3(0x259)](_0x3da5d3(0x264)),console[_0x3da5d3(0x259)](_0x3da5d3(0x203)),console[_0x3da5d3(0x259)](_0x3da5d3(0x1e8)),console[_0x3da5d3(0x259)]('\x20\x20tdx\x20sg\x20sql\x20\x22Premium\x20Users\x22'),console['error'](_0x3da5d3(0x24d)),0x1;try{const _0x3d5673=_0x5d20b9['parentSegment'],_0x4dfa16=await resolveSegmentTarget(_0x44edf5,_0x3d5673,_0x5d20b9[_0x3da5d3(0x201)]);_0x5d20b9[_0x3da5d3(0x201)]&&console['error'](_0x3da5d3(0x256)+_0x4dfa16);const _0x4d975b=await withSpinner(_0x3da5d3(0x241)+_0x44edf5+'\x27...',()=>_0xbea2e8[_0x3da5d3(0x246)][_0x3da5d3(0x22f)](_0x4dfa16),{'verbose':_0x5d20b9[_0x3da5d3(0x201)]}),_0x9cc294=_0x4d975b['data'];_0x5d20b9[_0x3da5d3(0x201)]&&(console[_0x3da5d3(0x259)](_0x3da5d3(0x266)+_0x9cc294[_0x3da5d3(0x236)]),console[_0x3da5d3(0x259)]('Parent\x20ID:\x20'+_0x9cc294[_0x3da5d3(0x272)]));if(_0x9cc294[_0x3da5d3(0x236)]===_0x3da5d3(0x273))return console[_0x3da5d3(0x259)](_0x3da5d3(0x1f5)),console[_0x3da5d3(0x259)](_0x3da5d3(0x20e)),0x1;if(_0x9cc294[_0x3da5d3(0x236)]===_0x3da5d3(0x277))return console[_0x3da5d3(0x259)]('Error:\x20Cannot\x20get\x20SQL\x20for\x20parent\x20segment\x20with\x20this\x20command.'),console[_0x3da5d3(0x259)](_0x3da5d3(0x1e4)),0x1;if(!_0x9cc294['segmentId'])throw new SDKError(ErrorCode[_0x3da5d3(0x232)],_0x3da5d3(0x26b));const _0x105a74=await withSpinner(_0x3da5d3(0x223),()=>_0xbea2e8['segment'][_0x3da5d3(0x240)](_0x9cc294[_0x3da5d3(0x272)],_0x9cc294[_0x3da5d3(0x271)]),{'verbose':_0x5d20b9['verbose']}),_0x27e3eb=_0x105a74['data'];return _0x5d20b9[_0x3da5d3(0x25b)]===_0x3da5d3(0x239)||_0x5d20b9[_0x3da5d3(0x25b)]==='jsonl'?await handleSDKOutput([{'sql':_0x27e3eb}],_0x5d20b9):console[_0x3da5d3(0x27c)](_0x27e3eb),0x0;}catch(_0x4d40ba){if(_0x4d40ba instanceof SDKError)return console[_0x3da5d3(0x259)](_0x3da5d3(0x205)+_0x4d40ba[_0x3da5d3(0x1f9)]),_0x4d40ba[_0x3da5d3(0x21a)]&&console[_0x3da5d3(0x259)]('\x20\x20Cause:\x20'+_0x4d40ba['cause']),0x1;throw _0x4d40ba;}}}export class SegmentFolderCreateCommand extends BaseCommand{[a31_0x580cc0(0x1fd)]='segment:folder:create';[a31_0x580cc0(0x26c)]='Create\x20segment\x20folder\x20for\x20organization';async[a31_0x580cc0(0x219)](_0x5ab3c0){const _0x3838c1=a31_0x580cc0,{options:_0xa1f398,args:_0x749406,tdx:_0x25bb8a}=_0x5ab3c0,_0x46e632=_0xa1f398;if(_0x749406[_0x3838c1(0x253)]<0x2)return console['error']('Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required'),console['error'](_0x3838c1(0x1e7)),0x1;const _0x4cdec2=_0x749406[0x0],_0x5d7a14=_0x749406[0x1];_0x46e632[_0x3838c1(0x201)]&&(console[_0x3838c1(0x259)](_0x3838c1(0x1ee)+_0x46e632['site']),console['error'](_0x3838c1(0x26d)+_0x4cdec2),console[_0x3838c1(0x259)]('Folder\x20name:\x20'+_0x5d7a14));let _0x21231a;if(_0x46e632[_0x3838c1(0x23e)]){const _0x23fc01=_0x46e632[_0x3838c1(0x23e)],_0x3b5284=await withSpinner(_0x3838c1(0x213)+_0x4cdec2+_0x3838c1(0x23c),()=>_0x25bb8a['segment'][_0x3838c1(0x1f0)](_0x4cdec2),{'verbose':_0x46e632[_0x3838c1(0x201)]}),_0x487800=_0x3b5284[_0x3838c1(0x25e)],_0x5560d5=await withSpinner(_0x3838c1(0x209)+_0x23fc01+_0x3838c1(0x23c),()=>_0x25bb8a[_0x3838c1(0x246)][_0x3838c1(0x230)](_0x487800,_0x23fc01),{'verbose':_0x46e632[_0x3838c1(0x201)]});_0x21231a=_0x5560d5[_0x3838c1(0x25e)],_0x46e632[_0x3838c1(0x201)]&&console['error'](_0x3838c1(0x260)+_0x21231a);}const _0xf8b27a={'name':_0x5d7a14,'description':_0x46e632[_0x3838c1(0x26c)],'parentFolderId':_0x21231a},_0x4513c2=await withSpinner(_0x3838c1(0x1ff)+_0x5d7a14+_0x3838c1(0x23c),()=>_0x25bb8a['segment']['createFolder'](_0x4cdec2,_0xf8b27a),{'verbose':_0x46e632[_0x3838c1(0x201)]}),_0x28d2d8=_0x4513c2[_0x3838c1(0x25e)];return console[_0x3838c1(0x259)](_0x3838c1(0x265)+_0x28d2d8[_0x3838c1(0x1fd)]+_0x3838c1(0x1f6)+_0x28d2d8['id']),await handleSDKOutput([_0x28d2d8],_0x46e632),0x0;}}export class SegmentViewCommand extends BaseCommand{[a31_0x580cc0(0x1fd)]='segment:view';[a31_0x580cc0(0x26c)]=a31_0x580cc0(0x225);async[a31_0x580cc0(0x219)](_0x33def7){const _0x3ebc1a=a31_0x580cc0,{options:_0x10a55a,args:_0x5bafc7,tdx:_0x15f686}=_0x33def7,_0x1fd063=_0x5bafc7[0x0];if(!_0x1fd063)return console[_0x3ebc1a(0x259)]('Error:\x20Folder\x20or\x20segment\x20name,\x20or\x20YAML\x20file\x20path\x20is\x20required'),console[_0x3ebc1a(0x259)](_0x3ebc1a(0x262)),console['error'](_0x3ebc1a(0x233)),console['error'](_0x3ebc1a(0x1e9)),console['error'](_0x3ebc1a(0x1ec)),console[_0x3ebc1a(0x259)]('Examples:'),console[_0x3ebc1a(0x259)](_0x3ebc1a(0x1ef)),console[_0x3ebc1a(0x259)](_0x3ebc1a(0x1ed)),console[_0x3ebc1a(0x259)](_0x3ebc1a(0x20b)),console[_0x3ebc1a(0x259)](_0x3ebc1a(0x23f)),0x1;try{const _0x593e14=_0x10a55a['parentSegment'],_0x29ca4e=await resolveSegmentTarget(_0x1fd063,_0x593e14,_0x10a55a[_0x3ebc1a(0x201)]);_0x10a55a['verbose']&&console[_0x3ebc1a(0x259)](_0x3ebc1a(0x256)+_0x29ca4e);const _0x39e950=await withSpinner(_0x3ebc1a(0x241)+_0x1fd063+_0x3ebc1a(0x23c),()=>_0x15f686[_0x3ebc1a(0x246)][_0x3ebc1a(0x22f)](_0x29ca4e),{'verbose':_0x10a55a['verbose']}),_0x3d3040=_0x39e950[_0x3ebc1a(0x25e)];_0x10a55a[_0x3ebc1a(0x201)]&&(console[_0x3ebc1a(0x259)](_0x3ebc1a(0x266)+_0x3d3040[_0x3ebc1a(0x236)]),console[_0x3ebc1a(0x259)](_0x3ebc1a(0x202)+_0x3d3040['parentId']),_0x3d3040[_0x3ebc1a(0x27e)]&&console[_0x3ebc1a(0x259)](_0x3ebc1a(0x24f)+_0x3d3040[_0x3ebc1a(0x27e)]),_0x3d3040['segmentId']&&console['error'](_0x3ebc1a(0x27a)+_0x3d3040['segmentId']));if(_0x10a55a[_0x3ebc1a(0x21d)]){if(_0x3d3040[_0x3ebc1a(0x236)]===_0x3ebc1a(0x273))return console[_0x3ebc1a(0x259)](_0x3ebc1a(0x22c)),0x1;if(_0x3d3040[_0x3ebc1a(0x236)]===_0x3ebc1a(0x277))return console[_0x3ebc1a(0x259)](_0x3ebc1a(0x258)),console['error'](_0x3ebc1a(0x275)),0x1;if(!_0x3d3040[_0x3ebc1a(0x271)])throw new SDKError(ErrorCode[_0x3ebc1a(0x232)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x32bf81=getConsoleNextUrl(_0x10a55a['site'],'/app/ps/'+_0x3d3040[_0x3ebc1a(0x272)]+_0x3ebc1a(0x228)+_0x3d3040['segmentId']);return console[_0x3ebc1a(0x259)](a31_0x399677[_0x3ebc1a(0x1e2)]('✔')+_0x3ebc1a(0x242)+a31_0x399677[_0x3ebc1a(0x1f3)](_0x32bf81)),openBrowser(_0x32bf81),0x0;}if(_0x3d3040[_0x3ebc1a(0x236)]===_0x3ebc1a(0x273)){if(!_0x3d3040[_0x3ebc1a(0x27e)])throw new SDKError(ErrorCode[_0x3ebc1a(0x22e)],_0x3ebc1a(0x229));const _0x1fe49b=await withSpinner(_0x3ebc1a(0x268),()=>_0x15f686[_0x3ebc1a(0x246)][_0x3ebc1a(0x224)](_0x3d3040[_0x3ebc1a(0x27e)]),{'verbose':_0x10a55a[_0x3ebc1a(0x201)]});await handleSingleObjectOutput(_0x1fe49b[_0x3ebc1a(0x25e)],_0x10a55a);}else{if(_0x3d3040[_0x3ebc1a(0x236)]===_0x3ebc1a(0x246)){if(!_0x3d3040[_0x3ebc1a(0x271)])throw new SDKError(ErrorCode[_0x3ebc1a(0x232)],_0x3ebc1a(0x26b));const _0x96ce3e=await withSpinner(_0x3ebc1a(0x22a),()=>_0x15f686[_0x3ebc1a(0x246)][_0x3ebc1a(0x21b)](_0x3d3040['parentId'],_0x3d3040[_0x3ebc1a(0x271)]),{'verbose':_0x10a55a[_0x3ebc1a(0x201)]}),_0xb3067c=getConsoleNextUrl(_0x10a55a['site'],_0x3ebc1a(0x210)+_0x3d3040[_0x3ebc1a(0x272)]+_0x3ebc1a(0x228)+_0x3d3040[_0x3ebc1a(0x271)]),_0x338acd=_0x96ce3e['data'];_0x338acd[_0x3ebc1a(0x1f8)]=_0xb3067c,await handleSingleObjectOutput(_0x338acd,_0x10a55a);}else return console[_0x3ebc1a(0x259)](_0x3ebc1a(0x1eb)),console[_0x3ebc1a(0x259)](_0x3ebc1a(0x200)),0x1;}return 0x0;}catch(_0x25d4dd){if(_0x25d4dd instanceof SDKError)return console[_0x3ebc1a(0x259)]('Error:\x20'+_0x25d4dd[_0x3ebc1a(0x1f9)]),_0x25d4dd['cause']&&console[_0x3ebc1a(0x259)](_0x3ebc1a(0x24a)+_0x25d4dd['cause']),0x1;throw _0x25d4dd;}}}export const SegmentInfoCommand=SegmentViewCommand;export class SegmentDescCommand extends BaseCommand{[a31_0x580cc0(0x1fd)]=a31_0x580cc0(0x255);[a31_0x580cc0(0x26c)]=a31_0x580cc0(0x231);async[a31_0x580cc0(0x219)](_0x583355){const _0x2d24d8=a31_0x580cc0,{options:_0x194326,args:_0x374562,tdx:_0xb9c8f1}=_0x583355,_0x5aceec=_0x374562[0x0];if(!_0x5aceec)return console['error'](_0x2d24d8(0x207)),console[_0x2d24d8(0x259)](_0x2d24d8(0x25f)),console[_0x2d24d8(0x259)](_0x2d24d8(0x252)),console[_0x2d24d8(0x259)](_0x2d24d8(0x1e8)),console[_0x2d24d8(0x259)](_0x2d24d8(0x1f4)),console[_0x2d24d8(0x259)]('\x20\x20tdx\x20sg\x20desc\x20segments/my-audience/premium-users.yml'),0x1;try{const _0x5cf56c=_0x194326[_0x2d24d8(0x1f7)],_0x28477d=await resolveSegmentTarget(_0x5aceec,_0x5cf56c,_0x194326['verbose']);_0x194326[_0x2d24d8(0x201)]&&console[_0x2d24d8(0x259)]('Target\x20path:\x20'+_0x28477d);const _0x32d2c5=await withSpinner(_0x2d24d8(0x241)+_0x5aceec+_0x2d24d8(0x23c),()=>_0xb9c8f1['segment'][_0x2d24d8(0x22f)](_0x28477d),{'verbose':_0x194326[_0x2d24d8(0x201)]}),_0x3afd08=_0x32d2c5['data'];_0x194326[_0x2d24d8(0x201)]&&(console['error']('Resolved\x20type:\x20'+_0x3afd08['type']),console[_0x2d24d8(0x259)]('Parent\x20ID:\x20'+_0x3afd08['parentId']));if(_0x3afd08[_0x2d24d8(0x236)]===_0x2d24d8(0x273))return console[_0x2d24d8(0x259)]('Error:\x20Cannot\x20show\x20schema\x20for\x20a\x20folder.'),console[_0x2d24d8(0x259)]('Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.'),0x1;if(_0x3afd08['type']==='parent')return console[_0x2d24d8(0x259)](_0x2d24d8(0x222)),console[_0x2d24d8(0x259)](_0x2d24d8(0x204)),0x1;if(!_0x3afd08[_0x2d24d8(0x271)])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x2d24d8(0x26b));const _0x91d0f2=await withSpinner(_0x2d24d8(0x223),()=>_0xb9c8f1['segment'][_0x2d24d8(0x240)](_0x3afd08['parentId'],_0x3afd08[_0x2d24d8(0x271)]),{'verbose':_0x194326[_0x2d24d8(0x201)]}),_0x35b106=_0x91d0f2[_0x2d24d8(0x25e)],_0x385ca5=await executeSchemaQuery(_0x35b106,_0xb9c8f1,_0x194326);return await handleQueryOutput(_0x385ca5,_0x194326),0x0;}catch(_0x347f4e){if(_0x347f4e instanceof SDKError)return console['error']('Error:\x20'+_0x347f4e[_0x2d24d8(0x1f9)]),_0x347f4e[_0x2d24d8(0x21a)]&&console[_0x2d24d8(0x259)](_0x2d24d8(0x24a)+_0x347f4e[_0x2d24d8(0x21a)]),0x1;throw _0x347f4e;}}}
@@ -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_0x368262=a32_0x2aba;(function(_0x200289,_0x307faf){const _0x2e4314=a32_0x2aba,_0x52388d=_0x200289();while(!![]){try{const _0x4de0ea=-parseInt(_0x2e4314(0x1ba))/0x1*(-parseInt(_0x2e4314(0x1ac))/0x2)+parseInt(_0x2e4314(0x1b8))/0x3+parseInt(_0x2e4314(0x196))/0x4*(parseInt(_0x2e4314(0x194))/0x5)+parseInt(_0x2e4314(0x1b7))/0x6+parseInt(_0x2e4314(0x1b0))/0x7+parseInt(_0x2e4314(0x1a1))/0x8*(-parseInt(_0x2e4314(0x198))/0x9)+-parseInt(_0x2e4314(0x1a0))/0xa;if(_0x4de0ea===_0x307faf)break;else _0x52388d['push'](_0x52388d['shift']());}catch(_0x48316b){_0x52388d['push'](_0x52388d['shift']());}}}(a32_0x80b9,0x26428));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';function a32_0x80b9(){const _0x1bba80=['name','description','\x20\x20\x20Path:\x20','segments','Site:\x20','noCountPopulation','Resolved\x20folder\x20ID:\x20','Segment\x20name:\x20','Resolving\x20parent\x20segment\x20\x27','\x27\x20with\x20ID:\x20','createSegment','segment','5aJgSqg','yellow','550568NumAVb','⚠\x20Deprecation\x20warning:\x20`segment\x20create`\x20is\x20deprecated.','2402091DMWLfd','error','folder','includes','\x27...','Resolved\x20relative\x20path\x20to:\x20','Create\x20child\x20segment\x20with\x20filtering\x20rules','Parent:\x20','4371300xywiEi','8TWcPlF','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','execute','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27','kind','resolvePathToResource','verbose','Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]','invisible','Target\x20path:\x20','Resolving\x20folder\x20\x27','17606tetySJ','Parent\x20path:\x20','Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.','length','582589sCuFEY','site','rule','data','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27','Resolving\x20folder\x20path\x20\x27','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','1601664CyhKgw','564195NaADYW','✔\x20Created\x20segment\x20\x27','21KRuweH','type'];a32_0x80b9=function(){return _0x1bba80;};return a32_0x80b9();}import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{parsePath,getParentPath,getBaseName}from'../sdk/segment/segment-path-parser.js';function a32_0x2aba(_0x19e061,_0x2830fe){_0x19e061=_0x19e061-0x190;const _0x80b9a=a32_0x80b9();let _0x2aba66=_0x80b9a[_0x19e061];return _0x2aba66;}import a32_0x312ece from'chalk';export class SegmentCreateCommand extends BaseCommand{[a32_0x368262(0x1bc)]='segment:create';[a32_0x368262(0x1bd)]=a32_0x368262(0x19e);async[a32_0x368262(0x1a3)](_0x227144){const _0x18c300=a32_0x368262;console[_0x18c300(0x199)](a32_0x312ece['yellow'](_0x18c300(0x197))),console[_0x18c300(0x199)](a32_0x312ece[_0x18c300(0x195)](_0x18c300(0x1b6)));const {options:_0x5becbb,args:_0x345316,tdx:_0x2c39e6}=_0x227144,_0x5562c4=_0x5becbb;if(_0x345316[_0x18c300(0x1af)]===0x0)return console['error'](_0x18c300(0x1a2)),console[_0x18c300(0x199)]('Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]'),console[_0x18c300(0x199)]('Examples:'),console[_0x18c300(0x199)](_0x18c300(0x1a4)),console['error'](_0x18c300(0x1b4)),console['error']('\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context'),0x1;const _0x18b06c=_0x345316[0x0],_0x527c44=_0x5becbb['segmentPath'];let _0x50d469=_0x18b06c;_0x527c44&&!_0x18b06c[_0x18c300(0x19b)]('/')&&(_0x50d469=_0x527c44+'/'+_0x18b06c,_0x5562c4['verbose']&&console['error'](_0x18c300(0x19d)+_0x50d469));const _0x1f090b=parsePath(_0x50d469);if(_0x1f090b[_0x18c300(0x1bf)]['length']<0x2)return console['error']('Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)'),console[_0x18c300(0x199)](_0x18c300(0x1a8)),0x1;const _0x609865=_0x1f090b[_0x18c300(0x1bf)][0x0],_0x5c8462=getBaseName(_0x50d469),_0x7691dc=getParentPath(_0x50d469);_0x5562c4[_0x18c300(0x1a7)]&&(console['error'](_0x18c300(0x1c0)+_0x5562c4[_0x18c300(0x1b1)]),console[_0x18c300(0x199)](_0x18c300(0x1aa)+_0x50d469),console['error'](_0x18c300(0x19f)+_0x609865),console[_0x18c300(0x199)](_0x18c300(0x1c3)+_0x5c8462),console[_0x18c300(0x199)](_0x18c300(0x1ad)+_0x7691dc));const _0x2f0fee=await withSpinner(_0x18c300(0x190)+_0x609865+'\x27...',()=>_0x2c39e6[_0x18c300(0x193)]['resolveParentId'](_0x609865),{'verbose':_0x5562c4[_0x18c300(0x1a7)]}),_0x46b77b=_0x2f0fee['data'];let _0x5e7da3;if(_0x1f090b['segments'][_0x18c300(0x1af)]>0x2){const _0x29ebe2=await withSpinner(_0x18c300(0x1b5)+_0x7691dc+_0x18c300(0x19c),()=>_0x2c39e6['segment'][_0x18c300(0x1a6)](_0x7691dc),{'verbose':_0x5562c4[_0x18c300(0x1a7)]}),_0x49e7d2=_0x29ebe2[_0x18c300(0x1b3)];if(_0x49e7d2[_0x18c300(0x1bb)]!==_0x18c300(0x19a)&&_0x49e7d2['type']!=='parent')return console[_0x18c300(0x199)](_0x18c300(0x1ae)),0x1;_0x5e7da3=_0x49e7d2['folderId'];}else{if(_0x5562c4[_0x18c300(0x19a)]){const _0x38a5ca=await withSpinner(_0x18c300(0x1ab)+_0x5562c4[_0x18c300(0x19a)]+_0x18c300(0x19c),()=>_0x2c39e6[_0x18c300(0x193)]['resolveFolderId'](_0x46b77b,_0x5562c4[_0x18c300(0x19a)]),{'verbose':_0x5562c4[_0x18c300(0x1a7)]});_0x5e7da3=_0x38a5ca['data'];}}_0x5562c4[_0x18c300(0x1a7)]&&_0x5e7da3&&console[_0x18c300(0x199)](_0x18c300(0x1c2)+_0x5e7da3);const _0x1dfde2=await loadJSONFromOptions(_0x5562c4[_0x18c300(0x1b2)],_0x5562c4['ruleFile']),_0x23c891={'name':_0x5c8462,'description':_0x5562c4[_0x18c300(0x1bd)],'rule':_0x1dfde2,'kind':_0x5562c4[_0x18c300(0x1a5)]!==undefined?parseInt(_0x5562c4[_0x18c300(0x1a5)],0xa):undefined,'isVisible':_0x5562c4[_0x18c300(0x1a9)]?![]:undefined,'segmentFolderId':_0x5e7da3,'countPopulation':_0x5562c4[_0x18c300(0x1c1)]?![]:undefined},_0x3bc9cd=await withSpinner('Creating\x20segment\x20\x27'+_0x5c8462+'\x27...',()=>_0x2c39e6[_0x18c300(0x193)][_0x18c300(0x192)](_0x46b77b,_0x23c891),{'verbose':_0x5562c4[_0x18c300(0x1a7)]}),_0x347794=_0x3bc9cd[_0x18c300(0x1b3)];return console[_0x18c300(0x199)](_0x18c300(0x1b9)+_0x347794[_0x18c300(0x1bc)]+_0x18c300(0x191)+_0x347794['id']),_0x50d469!==_0x18b06c&&console[_0x18c300(0x199)](_0x18c300(0x1be)+_0x50d469),await handleSDKOutput([_0x347794],_0x5562c4),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
+ const a33_0x24a17b=a33_0x55bc;(function(_0x14c7a6,_0x59809f){const _0xfd2021=a33_0x55bc,_0x3394a1=_0x14c7a6();while(!![]){try{const _0x4feaf7=parseInt(_0xfd2021(0x101))/0x1+parseInt(_0xfd2021(0xed))/0x2*(parseInt(_0xfd2021(0xf7))/0x3)+-parseInt(_0xfd2021(0x106))/0x4*(-parseInt(_0xfd2021(0x103))/0x5)+-parseInt(_0xfd2021(0xfe))/0x6*(-parseInt(_0xfd2021(0xf4))/0x7)+parseInt(_0xfd2021(0xec))/0x8*(parseInt(_0xfd2021(0xf0))/0x9)+-parseInt(_0xfd2021(0xfb))/0xa+parseInt(_0xfd2021(0xf5))/0xb*(-parseInt(_0xfd2021(0xfd))/0xc);if(_0x4feaf7===_0x59809f)break;else _0x3394a1['push'](_0x3394a1['shift']());}catch(_0x5a58f3){_0x3394a1['push'](_0x3394a1['shift']());}}}(a33_0x59ab,0xb3d83));import{BaseCommand}from'./command.js';function a33_0x55bc(_0x4ef722,_0x5f29e4){_0x4ef722=_0x4ef722-0xeb;const _0x59abb9=a33_0x59ab();let _0x55bc8a=_0x59abb9[_0x4ef722];return _0x55bc8a;}import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{displayFieldsHumanReadable}from'../sdk/segment/fields-display.js';function a33_0x59ab(){const _0x3c9d3e=['verbose','3313639VFcHcP','1001jRiNbJ','length','177438CwGoZV','error','\x27...','description','5690850NQojnh','Site:\x20','436044qhCkoa','12DIGfiE','Usage:\x20tdx\x20segment\x20fields\x20<parent_name>','listFields','403762VZBnMt','jsonl','32135XuwtqZ','\x20field','parentSegment','452mTodBx','segment:fields','json','4464496DGTQtG','48qporJI','Parent\x20segment:\x20','execute','18viHDaC','segment','Error:\x20Parent\x20segment\x20name\x20is\x20required'];a33_0x59ab=function(){return _0x3c9d3e;};return a33_0x59ab();}export class SegmentFieldsCommand extends BaseCommand{['name']=a33_0x24a17b(0x107);[a33_0x24a17b(0xfa)]='List\x20available\x20fields\x20for\x20segmentation';async[a33_0x24a17b(0xef)](_0x20887a){const _0x42a6ee=a33_0x24a17b,{options:_0x2a5fe0,args:_0x3194e1,tdx:_0x5618a4}=_0x20887a,_0x5916ea=_0x3194e1[0x0]||_0x2a5fe0[_0x42a6ee(0x105)];if(!_0x5916ea)return console['error'](_0x42a6ee(0xf2)),console[_0x42a6ee(0xf8)](_0x42a6ee(0xff)),console[_0x42a6ee(0xf8)]('\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>'),0x1;_0x2a5fe0[_0x42a6ee(0xf3)]&&(console[_0x42a6ee(0xf8)](_0x42a6ee(0xfc)+_0x2a5fe0['site']),console['error'](_0x42a6ee(0xee)+_0x5916ea));const _0x7a0856=await withSpinner('Listing\x20fields\x20for\x20\x27'+_0x5916ea+_0x42a6ee(0xf9),()=>_0x5618a4[_0x42a6ee(0xf1)][_0x42a6ee(0x100)](_0x5916ea),{'verbose':_0x2a5fe0[_0x42a6ee(0xf3)]}),_0x545fdc=_0x7a0856['data'];console[_0x42a6ee(0xf8)]('✔\x20Found\x20'+_0x545fdc[_0x42a6ee(0xf6)]+_0x42a6ee(0x104)+(_0x545fdc[_0x42a6ee(0xf6)]!==0x1?'s':''));if(_0x2a5fe0[_0x42a6ee(0xeb)]||_0x2a5fe0[_0x42a6ee(0x102)])return await handleSDKOutput(_0x545fdc,_0x2a5fe0),0x0;return displayFieldsHumanReadable(_0x545fdc,_0x5916ea),0x0;}}
@@ -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_0x54976b=a34_0x3368;(function(_0x482739,_0x39aa6a){const _0xae6fbf=a34_0x3368,_0xabd65f=_0x482739();while(!![]){try{const _0x18938a=-parseInt(_0xae6fbf(0x11f))/0x1*(parseInt(_0xae6fbf(0x13a))/0x2)+-parseInt(_0xae6fbf(0x11d))/0x3+parseInt(_0xae6fbf(0x10a))/0x4*(parseInt(_0xae6fbf(0x124))/0x5)+-parseInt(_0xae6fbf(0x10c))/0x6+-parseInt(_0xae6fbf(0x12a))/0x7+parseInt(_0xae6fbf(0x137))/0x8+parseInt(_0xae6fbf(0x12b))/0x9;if(_0x18938a===_0x39aa6a)break;else _0xabd65f['push'](_0xabd65f['shift']());}catch(_0x332006){_0xabd65f['push'](_0xabd65f['shift']());}}}(a34_0xf76f,0x41d33));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_0x3206a6 from'chalk';function a34_0xf76f(){const _0x40f10b=['absolutePath','\x20\x20Target:\x20','setPhase','\x20segments','helpText','journeyVersions','\x20\x20🗺️\x20\x20','\x20with\x20','\x20changed\x20files','red','error','✔\x20All\x20files\x20are\x20up\x20to\x20date','segments','\x0aPull\x20summary\x20for\x20\x27','937203hCXGxM','repeat','1hyZbQy','Parent\x20segment:\x20','site','\x0aChanges\x20to\x20\x27','\x20journeys','375845uNjgYp','\x20=\x20','counts','yellow','utf-8','dryRun','3549210BjabzJ','5699655PFnBMn','no_parent','parent_segment','\x20\x20🎯\x20','Usage:\x20tdx\x20sg\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20(requires\x20context\x20or\x20tdx.json)','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','verbose','segment','content','dirname','Error:\x20','✔\x20Pulled\x20','2760040tdVKvV','Pulling\x20segments\x20from\x20\x27','parentSegment','291718XFnVda','isNew','✔\x20Context\x20set:\x20','cyan','filter','Site:\x20','activations','\x0aError:','\x20files\x20to\x20','No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27','dim','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','session','hasChanges','file','green','\x20unchanged\x20files','cwd','parentName','description','targetDir','length','\x20new\x20files','errorCode','files','type','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','24wQwqUJ','Aborted.','1166430dKMEGk','Target\x20resource:\x20','\x20versions)'];a34_0xf76f=function(){return _0x40f10b;};return a34_0xf76f();}function a34_0x3368(_0x1177fb,_0x58c3d0){_0x1177fb=_0x1177fb-0xf7;const _0xf76fe0=a34_0xf76f();let _0x336810=_0xf76fe0[_0x1177fb];return _0x336810;}import{existsSync,mkdirSync,writeFileSync}from'fs';import a34_0x4d16fd from'path';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';export{buildFolderIdToPathMap as buildFolderPathMap}from'../sdk/segment/resolution-context.js';export class SegmentPullCommand extends BaseCommand{['name']='segment:pull';[a34_0x54976b(0xff)]='Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files';async['execute'](_0x5625de){const _0x1966cc=a34_0x54976b,{options:_0x2d9165,args:_0x169a73,tdx:_0x3ec74e}=_0x5625de,_0x9c09a7=_0x2d9165,_0x2fe4d5=await resolveTarget({'arg':_0x169a73[0x0],'contextParent':_0x2d9165[_0x1966cc(0x139)],'cwd':process[_0x1966cc(0xfd)]()});if(!isSuccessfulResolution(_0x2fe4d5))return _0x2fe4d5[_0x1966cc(0x103)]===_0x1966cc(0x12c)?(console[_0x1966cc(0x119)](a34_0x3206a6[_0x1966cc(0x127)](_0x1966cc(0x109))),console[_0x1966cc(0x119)](_0x1966cc(0x12f)),console[_0x1966cc(0x119)](_0x1966cc(0x107)),console[_0x1966cc(0x119)](_0x1966cc(0xf7))):(console[_0x1966cc(0x119)](a34_0x3206a6[_0x1966cc(0x118)](_0x1966cc(0x135)+_0x2fe4d5['message']+'\x0a')),_0x2fe4d5[_0x1966cc(0x113)]&&console[_0x1966cc(0x119)](a34_0x3206a6['cyan'](_0x2fe4d5['helpText']))),0x1;const _0x54d306=_0x2fe4d5[_0x1966cc(0xfe)],_0x1890c9=_0x2fe4d5[_0x1966cc(0x100)],_0xcd25c6=_0x2fe4d5[_0x1966cc(0x105)]===_0x1966cc(0xfa)?_0x2fe4d5['resourceName']:undefined;_0x9c09a7[_0x1966cc(0x131)]&&(console[_0x1966cc(0x119)](_0x1966cc(0x13f)+_0x9c09a7[_0x1966cc(0x121)]),console[_0x1966cc(0x119)](_0x1966cc(0x120)+_0x54d306),_0xcd25c6&&console[_0x1966cc(0x119)](_0x1966cc(0x10d)+_0xcd25c6));const _0x3be5e2=await withProgressSpinner(_0x1966cc(0x138)+_0x54d306+'\x27...',_0x530b9c=>_0x3ec74e[_0x1966cc(0x132)]['pullSegments'](_0x54d306,{'targetDir':_0x1890c9,'targetResourceName':_0xcd25c6,'verbose':_0x9c09a7[_0x1966cc(0x131)],'progress':{'update':_0x5c416d=>{const _0x36f68e=_0x1966cc;_0x530b9c[_0x36f68e(0x111)](_0x5c416d),_0x9c09a7[_0x36f68e(0x131)]&&console['error']('\x20\x20'+_0x5c416d);}}}),{'verbose':_0x9c09a7[_0x1966cc(0x131)]}),_0x39eee9=_0x3be5e2['data'];if(_0x39eee9['counts']['segments']===0x0&&_0x39eee9['counts'][_0x1966cc(0x145)]===0x0)return console['error'](a34_0x3206a6['yellow'](_0x1966cc(0x143)+_0x39eee9[_0x1966cc(0xfe)]+'\x27')),0x0;const _0x448741=_0x39eee9[_0x1966cc(0x104)][_0x1966cc(0x13e)](_0x2f01e8=>_0x2f01e8['isNew']),_0x45db7a=_0x39eee9[_0x1966cc(0x104)][_0x1966cc(0x13e)](_0x31def7=>!_0x31def7['isNew']&&_0x31def7[_0x1966cc(0xf9)]),_0x1b100e=_0x39eee9[_0x1966cc(0x104)][_0x1966cc(0x13e)](_0x507e23=>!_0x507e23[_0x1966cc(0x13b)]&&!_0x507e23[_0x1966cc(0xf9)]);console[_0x1966cc(0x119)](_0x1966cc(0x11c)+_0x39eee9[_0x1966cc(0xfe)]+'\x27:'),console[_0x1966cc(0x119)](_0x1966cc(0x12e)+a34_0x3206a6['cyan'](_0x39eee9[_0x1966cc(0x126)][_0x1966cc(0x11b)]+_0x1966cc(0x112))+_0x1966cc(0x116)+a34_0x3206a6[_0x1966cc(0x13d)](_0x39eee9[_0x1966cc(0x126)][_0x1966cc(0x140)]+'\x20activations'));if(_0x39eee9[_0x1966cc(0x126)]['journeys']>0x0){const _0x29f9c8=_0x39eee9['counts'][_0x1966cc(0x114)]>_0x39eee9['counts']['journeys']?'\x20('+_0x39eee9['counts']['journeyVersions']+_0x1966cc(0x10e):'';console[_0x1966cc(0x119)](_0x1966cc(0x115)+a34_0x3206a6[_0x1966cc(0x13d)](_0x39eee9[_0x1966cc(0x126)][_0x1966cc(0x145)]+_0x1966cc(0x123))+a34_0x3206a6['dim'](_0x29f9c8));}console['error']('\x20\x20'+a34_0x3206a6[_0x1966cc(0xfb)]('+\x20'+_0x448741[_0x1966cc(0x101)]+_0x1966cc(0x102))),console['error']('\x20\x20'+a34_0x3206a6[_0x1966cc(0x127)]('~\x20'+_0x45db7a['length']+_0x1966cc(0x117))),console[_0x1966cc(0x119)]('\x20\x20'+a34_0x3206a6['dim']('=\x20'+_0x1b100e[_0x1966cc(0x101)]+_0x1966cc(0xfc))),console[_0x1966cc(0x119)](_0x1966cc(0x110)+a34_0x3206a6['cyan'](_0x39eee9[_0x1966cc(0x100)])+'\x0a');if(_0x45db7a[_0x1966cc(0x101)]>0x0)for(const _0x34d081 of _0x45db7a){console[_0x1966cc(0x119)](_0x1966cc(0x122)+_0x34d081['relativePath']+'\x27:'),console['error']('─'[_0x1966cc(0x11e)](0x3c)),console[_0x1966cc(0x119)](_0x34d081['diff']),console[_0x1966cc(0x119)]('─'[_0x1966cc(0x11e)](0x3c));}if(_0x9c09a7[_0x1966cc(0x129)])return console[_0x1966cc(0x119)](a34_0x3206a6[_0x1966cc(0x127)](_0x1966cc(0x108))),0x0;if(_0x448741[_0x1966cc(0x101)]===0x0&&_0x45db7a[_0x1966cc(0x101)]===0x0)return console[_0x1966cc(0x119)](a34_0x3206a6[_0x1966cc(0xfb)](_0x1966cc(0x11a))),saveSessionContext({'parent_segment':_0x39eee9[_0x1966cc(0xfe)]},_0x9c09a7['session']),console[_0x1966cc(0x119)](a34_0x3206a6[_0x1966cc(0xfb)]('✔\x20Context\x20set:\x20'+a34_0x3206a6['dim'](_0x1966cc(0x12d))+_0x1966cc(0x125)+a34_0x3206a6[_0x1966cc(0x13d)](_0x39eee9[_0x1966cc(0xfe)]))),0x0;if(!_0x9c09a7['yes']){if(!isInteractive())return console['error'](a34_0x3206a6['red'](_0x1966cc(0x141)),_0x1966cc(0x106)),console['error'](a34_0x3206a6[_0x1966cc(0x144)](_0x1966cc(0x130))),0x1;const _0x33a950=await confirmKey('Write\x20'+(_0x448741[_0x1966cc(0x101)]+_0x45db7a[_0x1966cc(0x101)])+'\x20files?');if(!_0x33a950)return console['error'](a34_0x3206a6[_0x1966cc(0x127)](_0x1966cc(0x10b)),'-\x20no\x20files\x20written'),0x1;}for(const _0x29c63b of _0x39eee9['files']){if(_0x29c63b[_0x1966cc(0x13b)]||_0x29c63b['hasChanges']){const _0x4a46d5=a34_0x4d16fd[_0x1966cc(0x134)](_0x29c63b[_0x1966cc(0x10f)]);!existsSync(_0x4a46d5)&&mkdirSync(_0x4a46d5,{'recursive':!![]}),writeFileSync(_0x29c63b[_0x1966cc(0x10f)],_0x29c63b[_0x1966cc(0x133)],_0x1966cc(0x128));}}return console[_0x1966cc(0x119)](a34_0x3206a6['green'](_0x1966cc(0x136)+(_0x448741[_0x1966cc(0x101)]+_0x45db7a['length'])+_0x1966cc(0x142)+_0x39eee9[_0x1966cc(0x100)])),saveSessionContext({'parent_segment':_0x39eee9['parentName']},_0x9c09a7[_0x1966cc(0xf8)]),console['error'](a34_0x3206a6[_0x1966cc(0xfb)](_0x1966cc(0x13c)+a34_0x3206a6[_0x1966cc(0x144)]('parent_segment')+'\x20=\x20'+a34_0x3206a6[_0x1966cc(0x13d)](_0x39eee9[_0x1966cc(0xfe)]))),0x0;}}
@@ -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
+ const a35_0x41e595=a35_0x5ded;(function(_0x49fb72,_0x41d39a){const _0x4def33=a35_0x5ded,_0x4b394b=_0x49fb72();while(!![]){try{const _0x4cafa6=-parseInt(_0x4def33(0x202))/0x1+-parseInt(_0x4def33(0x24d))/0x2+-parseInt(_0x4def33(0x21e))/0x3+-parseInt(_0x4def33(0x239))/0x4*(-parseInt(_0x4def33(0x20d))/0x5)+parseInt(_0x4def33(0x24b))/0x6*(parseInt(_0x4def33(0x221))/0x7)+parseInt(_0x4def33(0x255))/0x8*(-parseInt(_0x4def33(0x1ea))/0x9)+parseInt(_0x4def33(0x25f))/0xa;if(_0x4cafa6===_0x41d39a)break;else _0x4b394b['push'](_0x4b394b['shift']());}catch(_0x8e460b){_0x4b394b['push'](_0x4b394b['shift']());}}}(a35_0x1b32,0x78885));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_0x16b3a5 from'chalk';import{existsSync}from'fs';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';function a35_0x1b32(){const _0x49c990=['\x20activations]','\x20\x20Source:\x20','site','endsWith','setPhase','segment:push','activations','user','\x20new','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','folderId','then','listFolders','175993npNQRl','nameToType','Folders\x20to\x20create:','updatedAt','\x20changes?','nameToId','\x20YAML\x20files\x20found','\x20deleted','targetDir','Fetching\x20existing\x20data...','file','4460155lNUnIp','Changes\x20to:','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','verbose','list','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','\x20changed','message','.yml','helpText','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','Fetching\x20connections\x20for\x20name\x20resolution...','scopedFolderPath','green','red','get','2792586ltcawC','/app/ps/','journeys','56DBQDmT','\x20\x20📊\x20Segments:','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','\x20\x20\x20\x20','\x0aError:','createdAt','errorCode','\x20to\x20create','isNew','Scoped\x20to\x20folder:\x20','\x0aPush\x20summary\x20for\x20\x27','listJourneysWithDetailsFromParentSegment','getJourney','error','journeysOnly','✔\x20All\x20journeys\x20are\x20up\x20to\x20date','folders','segments','parentName','join','\x20updated','Error:\x20Directory\x20not\x20found:\x20','connection','dim','4piuJGZ','yellow','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','\x20to\x20update','audienceId','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)','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','listActivations','no_parent','toUpdate','toDelete','deleted','all','New\x20segment:','📁\x20','parentSegment','463464cKcYxS','getParent','1531190uRrrGk','folderPath','toCreate','Resolving\x20parent\x20segment\x20\x27','\x20\x20🗺️\x20\x20Journeys:','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','delete','Changes\x20to\x20journey:','40616IneGSs','Site:\x20','\x20created','idToName','parent_name','yamlConfig','repeat','/e/','blue','type','13334060rzbLbM','results','journeyBundleName','description','cwd','segmentFolderId','buildUserMaps','changed','\x20unchanged','add','toString','length','map','Push\x20','unchanged','attributes','filter','parentFolder','name','segment\x20or\x20journey','\x20\x20Journeys:\x20','journey','cyan','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','Error\x20parsing\x20YAML:\x20','created','data','Fetching\x20existing\x20activations...','Delete\x20segment:','updated','segment','resolveParentId','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','diff','\x20to\x20delete','journeyId','set','846zPRirI','Preparing\x20journeys...','push','state','listSegments','new','getOutputSchemaWithCache','\x20\x20Activations:\x20','Delete\x20journey:','\x20folders\x20to\x20create','\x0aValidation\x20failed:'];a35_0x1b32=function(){return _0x49c990;};return a35_0x1b32();}import{resolveTarget,isSuccessfulResolution,getScopedDetails}from'../sdk/segment/target-resolution.js';function a35_0x5ded(_0x120799,_0x2dde1e){_0x120799=_0x120799-0x1ca;const _0x1b3246=a35_0x1b32();let _0x5dedee=_0x1b3246[_0x120799];return _0x5dedee;}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_0x41e595(0x1d7)]=a35_0x41e595(0x1fa);[a35_0x41e595(0x262)]=a35_0x41e595(0x1dc);async['execute'](_0x52393b){const _0x394dab=a35_0x41e595,{options:_0x5f0efb,args:_0x9340c9,tdx:_0x4e8965}=_0x52393b,_0x3e70b2=_0x5f0efb,_0x406083=await resolveTarget({'arg':_0x9340c9[0x0],'contextParent':_0x5f0efb[_0x394dab(0x24a)],'cwd':process[_0x394dab(0x263)]()});if(!isSuccessfulResolution(_0x406083))return _0x406083[_0x394dab(0x227)]===_0x394dab(0x243)?(console['error'](a35_0x16b3a5[_0x394dab(0x23a)](_0x394dab(0x223))),console['error'](_0x394dab(0x23f)),console[_0x394dab(0x22e)](_0x394dab(0x1e5)),console['error']('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file')):(console[_0x394dab(0x22e)](a35_0x16b3a5[_0x394dab(0x21c)]('Error:\x20'+_0x406083['message']+'\x0a')),_0x406083['helpText']&&console[_0x394dab(0x22e)](a35_0x16b3a5[_0x394dab(0x1db)](_0x406083[_0x394dab(0x216)]))),0x1;if(_0x406083[_0x394dab(0x25e)]===_0x394dab(0x259))return console['error'](a35_0x16b3a5[_0x394dab(0x21c)](_0x394dab(0x236)+_0x406083[_0x394dab(0x20a)]+'\x0a')),console[_0x394dab(0x22e)](a35_0x16b3a5[_0x394dab(0x1db)](_0x394dab(0x240))),0x1;const _0x75714f=_0x406083[_0x394dab(0x233)],_0x537c4c=_0x406083[_0x394dab(0x20a)],_0x27790a=_0x406083['type']===_0x394dab(0x20c)?_0x406083['filePath']:undefined,_0x41122f=getScopedDetails(_0x406083),_0x2a984b=_0x41122f?.['isScoped']??![],_0x21d435=_0x41122f?.[_0x394dab(0x21a)]??'';if(!existsSync(_0x537c4c))return console[_0x394dab(0x22e)](a35_0x16b3a5['red'](_0x394dab(0x236)+_0x537c4c+'\x0a')),console[_0x394dab(0x22e)](a35_0x16b3a5['cyan'](_0x394dab(0x240))),0x1;_0x3e70b2[_0x394dab(0x210)]&&(console['error'](_0x394dab(0x256)+_0x3e70b2[_0x394dab(0x1f7)]),console[_0x394dab(0x22e)]('Parent\x20segment:\x20'+_0x75714f),console['error']('Source\x20directory:\x20'+_0x537c4c),_0x2a984b&&console[_0x394dab(0x22e)](_0x394dab(0x22a)+_0x21d435));const _0x2d2664=await withSpinner(_0x394dab(0x250)+_0x75714f+'\x27...',()=>_0x4e8965[_0x394dab(0x1e3)][_0x394dab(0x1e4)](_0x75714f),{'verbose':_0x3e70b2[_0x394dab(0x210)]}),_0x4ae4fc=_0x2d2664[_0x394dab(0x1df)],{parentSegmentResult:_0x4a48b9,segmentsResult:_0x5e000d,foldersResult:_0x259238,journeysWithDetailsResult:_0x21df43,userMaps:_0x585678}=await withSpinner(_0x394dab(0x20b),async()=>{const _0x3d37b8=_0x394dab,[_0x1e7fb6,_0x5adab9,_0x2c9314,_0x32c08c,_0x292a89]=await Promise[_0x3d37b8(0x247)]([_0x4e8965['segment'][_0x3d37b8(0x24c)](_0x4ae4fc),_0x4e8965[_0x3d37b8(0x1e3)][_0x3d37b8(0x1ee)](_0x4ae4fc),_0x4e8965[_0x3d37b8(0x1e3)][_0x3d37b8(0x201)](_0x4ae4fc),_0x4e8965['journey'][_0x3d37b8(0x22c)](_0x4ae4fc,{'includeAllVersions':!![]}),_0x4e8965[_0x3d37b8(0x1fc)][_0x3d37b8(0x1cb)]()]);return{'parentSegmentResult':_0x1e7fb6,'segmentsResult':_0x5adab9,'foldersResult':_0x2c9314,'journeysWithDetailsResult':_0x32c08c,'userMaps':_0x292a89};},{'verbose':_0x3e70b2['verbose']})[_0x394dab(0x200)](_0x130c59=>_0x130c59[_0x394dab(0x1df)]),_0x4b3862=_0x4a48b9,_0x21b782=extractRootFolderId(_0x4b3862),_0x4803a9=_0x5e000d,_0x2a89c3=_0x259238,{journeys:_0x1f448f,activationStepsById:_0x37444e}=_0x21df43,_0x178983=new Map(_0x1f448f[_0x394dab(0x1d1)](_0x31b86d=>[_0x31b86d['id'],_0x31b86d])),_0x366e99=_0x1f448f[_0x394dab(0x1d1)](_0x566ffb=>({'id':_0x566ffb['id'],'name':_0x566ffb[_0x394dab(0x1d4)][_0x394dab(0x1d7)],'journeyBundleName':_0x566ffb[_0x394dab(0x1d4)][_0x394dab(0x261)]||'','journeyBundleId':_0x566ffb['attributes']['journeyBundleId']||'','versionNumber':_0x566ffb['attributes']['versionNumber'],'description':_0x566ffb['attributes'][_0x394dab(0x262)],'state':_0x566ffb[_0x394dab(0x1d4)][_0x394dab(0x1ed)],'paused':_0x566ffb[_0x394dab(0x1d4)]['paused'],'audienceId':_0x566ffb[_0x394dab(0x1d4)][_0x394dab(0x23e)],'folderId':_0x566ffb['relationships']?.[_0x394dab(0x1d6)]?.[_0x394dab(0x1df)]?.['id'],'createdAt':_0x566ffb[_0x394dab(0x1d4)][_0x394dab(0x226)],'updatedAt':_0x566ffb[_0x394dab(0x1d4)][_0x394dab(0x205)]})),{emailToId:_0x425aa9,idToEmail:_0x25f330}=_0x585678,_0x5c2b28=await withSpinner(_0x394dab(0x219),async()=>{const _0x7279b5=_0x394dab,_0x1940b0=await _0x4e8965[_0x7279b5(0x237)][_0x7279b5(0x211)]();return buildConnectionMaps(_0x1940b0);},{'verbose':_0x3e70b2[_0x394dab(0x210)]})['then'](_0x44fd11=>_0x44fd11[_0x394dab(0x1df)]),_0x2da4b3=_0x5c2b28[_0x394dab(0x207)],_0x6533d0=_0x5c2b28[_0x394dab(0x258)],_0x439abe=_0x5c2b28[_0x394dab(0x203)],_0x396f4e={'emailToIdMap':_0x425aa9,'connectionNameToIdMap':_0x2da4b3,'connectionNameToTypeMap':_0x439abe,'getSchema':_0xa47290=>_0x4e8965[_0x394dab(0x237)][_0x394dab(0x1f0)](_0xa47290)};let {pathToId:_0x43cc0f,idToPath:_0x417e77}=buildFolderMaps(_0x2a89c3);const _0x18ec79=buildSegmentLookupMap(_0x4803a9,_0x417e77),_0x4af660=buildSegmentNameToIdMap(_0x4803a9),_0x73e69c=buildJourneyBundleLookupMap(_0x366e99,_0x417e77);let _0x2cd115;if(_0x27790a){if(!_0x27790a[_0x394dab(0x1f8)](_0x394dab(0x215))&&!_0x27790a['endsWith']('.yaml'))return console[_0x394dab(0x22e)](a35_0x16b3a5[_0x394dab(0x21c)]('Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20'+_0x27790a+'\x0a')),0x1;_0x2cd115=[_0x27790a];}else _0x2cd115=findYamlFiles(_0x537c4c);if(_0x2cd115['length']===0x0)return console[_0x394dab(0x22e)](a35_0x16b3a5[_0x394dab(0x21c)](_0x394dab(0x252)+_0x537c4c+'\x0a')),console[_0x394dab(0x22e)](a35_0x16b3a5[_0x394dab(0x1db)](_0x394dab(0x23c))),0x1;let _0x2b100e,_0x493e5f;try{const _0xee09cb=parseAndClassifyYamlFiles(_0x2cd115,_0x537c4c,{'skipSegments':_0x3e70b2[_0x394dab(0x22f)]});_0x2b100e=_0xee09cb['segments'],_0x493e5f=_0xee09cb['journeys'];const _0x407484=validateParsedFiles(_0xee09cb,_0x537c4c);if(_0x407484[_0x394dab(0x1d0)]>0x0)return console['error'](a35_0x16b3a5[_0x394dab(0x21c)](_0x394dab(0x1f4))),console['error'](formatValidationErrors(_0x407484)),console['error'](a35_0x16b3a5[_0x394dab(0x23a)](_0x394dab(0x241))),0x1;}catch(_0x1c6262){return console[_0x394dab(0x22e)](a35_0x16b3a5[_0x394dab(0x21c)](_0x394dab(0x1dd)+(_0x1c6262 instanceof Error?_0x1c6262[_0x394dab(0x214)]:_0x1c6262))),0x1;}if(_0x2b100e[_0x394dab(0x1d0)]===0x0&&_0x493e5f[_0x394dab(0x1d0)]===0x0){const _0x3f57a6=_0x3e70b2[_0x394dab(0x22f)]?_0x394dab(0x1da):_0x394dab(0x1d8);return console[_0x394dab(0x22e)](a35_0x16b3a5[_0x394dab(0x23a)]('No\x20'+_0x3f57a6+_0x394dab(0x208))),0x0;}const _0x4acbbc=new Map();_0x4803a9[_0x394dab(0x1d0)]>0x0&&!_0x3e70b2['journeysOnly']&&await withSpinner(_0x394dab(0x1e0),async()=>{await batchAsync(_0x4803a9,async _0x18d85b=>{const _0x423cd9=a35_0x5ded,_0x2b1504=await _0x4e8965[_0x423cd9(0x1e3)][_0x423cd9(0x242)](_0x4ae4fc,_0x18d85b['id']);_0x4acbbc[_0x423cd9(0x1e9)](_0x18d85b['id'],_0x2b1504);});},{'verbose':_0x3e70b2[_0x394dab(0x210)]});const {segmentFiles:_0x5783d7,foldersToCreate:_0x37f039}=await prepareSegmentFiles(_0x2b100e,{'segmentByFolderAndName':_0x18ec79,'activationsBySegmentId':_0x4acbbc,'folderPathToId':_0x43cc0f,'idToEmailMap':_0x25f330,'connectionIdToNameMap':_0x6533d0},_0x396f4e,_0x2a984b,_0x21d435),_0x347862=_0x27790a?[]:findSegmentsToDelete(_0x4803a9,_0x2b100e[_0x394dab(0x1d1)](({yamlConfig:_0x294e2d,folderPath:_0x186377})=>({'yamlConfig':_0x294e2d,'folderPath':resolveTDFolderPath(_0x186377,_0x2a984b,_0x21d435)})),_0x417e77,_0x21d435,_0x2a984b),{journeyFiles:_0xc6df71,foldersToCreate:_0x54f192}=await withProgressSpinner(_0x394dab(0x1eb),async _0x43ec60=>prepareJourneyFiles(_0x493e5f,{'fetchJourney':async _0xc59219=>_0x4e8965[_0x394dab(0x1da)][_0x394dab(0x22d)](_0xc59219['journeyId']),'journeyBundlesByFolderAndName':_0x73e69c,'folderPathToId':_0x43cc0f,'idToEmailMap':_0x25f330,'connectionIdToNameMap':_0x6533d0,'existingSegments':_0x4803a9,'parentId':_0x4ae4fc,'deps':_0x4e8965,'progress':{'update':_0x1f45ce=>{const _0x43baef=_0x394dab;_0x43ec60[_0x43baef(0x1f9)](_0x1f45ce),_0x3e70b2['verbose']&&console['error']('\x20\x20'+_0x1f45ce);}},'journeyById':_0x178983,'activationStepsById':_0x37444e},_0x2a984b,_0x21d435),{'verbose':_0x3e70b2[_0x394dab(0x210)]})[_0x394dab(0x200)](_0x269828=>_0x269828['data']);for(const _0x5e243c of _0x54f192){_0x37f039[_0x394dab(0x1ce)](_0x5e243c);}const _0x55f9c6=_0x27790a?[]:findJourneysToDelete(_0x366e99,_0x493e5f[_0x394dab(0x1d1)](({yamlConfig:_0x535480,folderPath:_0x447f71})=>({'yamlConfig':_0x535480,'folderPath':resolveTDFolderPath(_0x447f71,_0x2a984b,_0x21d435)})),_0x417e77,_0x21d435,_0x2a984b),_0x312fd5=calculatePushStats(_0x5783d7,_0xc6df71,_0x37f039,_0x347862,_0x55f9c6,!!_0x3e70b2[_0x394dab(0x253)],!!_0x3e70b2[_0x394dab(0x22f)]),_0x410822=_0x312fd5[_0x394dab(0x232)][_0x394dab(0x1ef)],_0x4194ae=_0x312fd5[_0x394dab(0x232)][_0x394dab(0x1cc)],_0x82e528=_0x312fd5['segments']['unchanged'],_0x2cc937=_0x312fd5[_0x394dab(0x232)]['toDelete'],_0x3cc7a0=_0x312fd5[_0x394dab(0x231)][_0x394dab(0x24f)],_0x32f561=_0x312fd5['journeys']['new'],_0x253c53=_0x312fd5[_0x394dab(0x220)][_0x394dab(0x1cc)],_0x97e39=_0x312fd5['journeys'][_0x394dab(0x1d3)],_0xaa8b8c=_0x312fd5['journeys'][_0x394dab(0x245)],_0x5b3824=_0x312fd5[_0x394dab(0x1fb)][_0x394dab(0x247)],_0x26bb8c=_0x312fd5[_0x394dab(0x1fb)][_0x394dab(0x24f)],_0x343405=_0x312fd5[_0x394dab(0x1fb)][_0x394dab(0x244)],_0x2de05f=_0x312fd5[_0x394dab(0x1fb)][_0x394dab(0x245)];console[_0x394dab(0x22e)](_0x394dab(0x22b)+_0x75714f+'\x27:');_0x3cc7a0[_0x394dab(0x1d0)]>0x0&&console[_0x394dab(0x22e)]('\x20\x20'+a35_0x16b3a5[_0x394dab(0x25d)](_0x394dab(0x249)+_0x3cc7a0['length']+_0x394dab(0x1f3)));if(!_0x3e70b2[_0x394dab(0x22f)]){console[_0x394dab(0x22e)](_0x394dab(0x222)),console[_0x394dab(0x22e)](_0x394dab(0x224)+a35_0x16b3a5[_0x394dab(0x21b)]('+\x20'+_0x410822[_0x394dab(0x1d0)]+_0x394dab(0x1fd))),console['error']('\x20\x20\x20\x20'+a35_0x16b3a5[_0x394dab(0x23a)]('~\x20'+_0x4194ae['length']+_0x394dab(0x213)));if(_0x2cc937[_0x394dab(0x1d0)]>0x0)console[_0x394dab(0x22e)](_0x394dab(0x224)+a35_0x16b3a5[_0x394dab(0x21c)]('-\x20'+_0x2cc937[_0x394dab(0x1d0)]+'\x20to\x20delete'));else _0x347862[_0x394dab(0x1d0)]>0x0&&!_0x3e70b2[_0x394dab(0x253)]&&console[_0x394dab(0x22e)](_0x394dab(0x224)+a35_0x16b3a5[_0x394dab(0x238)](_0x347862['length']+_0x394dab(0x23b)));console['error'](_0x394dab(0x224)+a35_0x16b3a5[_0x394dab(0x238)]('=\x20'+_0x82e528[_0x394dab(0x1d0)]+_0x394dab(0x1cd)));}if(_0xc6df71[_0x394dab(0x1d0)]>0x0||_0x55f9c6['length']>0x0){console[_0x394dab(0x22e)](_0x394dab(0x251)),console[_0x394dab(0x22e)]('\x20\x20\x20\x20'+a35_0x16b3a5[_0x394dab(0x21b)]('+\x20'+_0x32f561[_0x394dab(0x1d0)]+_0x394dab(0x1fd))),console[_0x394dab(0x22e)](_0x394dab(0x224)+a35_0x16b3a5[_0x394dab(0x23a)]('~\x20'+_0x253c53[_0x394dab(0x1d0)]+_0x394dab(0x213)));if(_0xaa8b8c['length']>0x0)console['error']('\x20\x20\x20\x20'+a35_0x16b3a5[_0x394dab(0x21c)]('-\x20'+_0xaa8b8c[_0x394dab(0x1d0)]+'\x20to\x20delete'));else _0x55f9c6[_0x394dab(0x1d0)]>0x0&&!_0x3e70b2[_0x394dab(0x253)]&&console[_0x394dab(0x22e)](_0x394dab(0x224)+a35_0x16b3a5[_0x394dab(0x238)](_0x55f9c6[_0x394dab(0x1d0)]+_0x394dab(0x23b)));console[_0x394dab(0x22e)](_0x394dab(0x224)+a35_0x16b3a5[_0x394dab(0x238)]('=\x20'+_0x97e39['length']+'\x20unchanged'));}_0x5b3824[_0x394dab(0x1d0)]>0x0&&!_0x3e70b2[_0x394dab(0x22f)]&&(console[_0x394dab(0x22e)](''),console[_0x394dab(0x22e)]('\x20\x20Activations:'),_0x26bb8c[_0x394dab(0x1d0)]>0x0&&console[_0x394dab(0x22e)](_0x394dab(0x224)+a35_0x16b3a5['green']('+\x20'+_0x26bb8c['length']+_0x394dab(0x228))),_0x343405['length']>0x0&&console[_0x394dab(0x22e)](_0x394dab(0x224)+a35_0x16b3a5[_0x394dab(0x23a)]('~\x20'+_0x343405[_0x394dab(0x1d0)]+_0x394dab(0x23d))),_0x2de05f[_0x394dab(0x1d0)]>0x0&&console[_0x394dab(0x22e)](_0x394dab(0x224)+a35_0x16b3a5[_0x394dab(0x21c)]('-\x20'+_0x2de05f[_0x394dab(0x1d0)]+_0x394dab(0x1e7))));console[_0x394dab(0x22e)](_0x394dab(0x1f6)+a35_0x16b3a5[_0x394dab(0x1db)](_0x537c4c)+'\x0a');if(_0x3cc7a0[_0x394dab(0x1d0)]>0x0){console[_0x394dab(0x22e)](_0x394dab(0x204));for(const _0x3e78a9 of _0x3cc7a0){console[_0x394dab(0x22e)]('\x20\x20'+a35_0x16b3a5[_0x394dab(0x25d)]('+')+'\x20'+_0x3e78a9);}console[_0x394dab(0x22e)]('');}if(_0x410822[_0x394dab(0x1d0)]>0x0&&!_0x3e70b2[_0x394dab(0x22f)])for(const _0x518d6e of _0x410822){const _0x122484=_0x518d6e[_0x394dab(0x24e)]?_0x518d6e[_0x394dab(0x24e)]+'/'+_0x518d6e[_0x394dab(0x25a)][_0x394dab(0x1d7)]:_0x518d6e['yamlConfig'][_0x394dab(0x1d7)],_0x4f2da9=_0x518d6e[_0x394dab(0x25a)]['activations']?.['length']||0x0,_0x5b2ece=_0x4f2da9>0x0?a35_0x16b3a5['dim']('\x20['+_0x4f2da9+'\x20activations]'):'';console['error']('\x0a'+a35_0x16b3a5[_0x394dab(0x21b)](_0x394dab(0x248))+'\x20'+_0x122484+_0x5b2ece),console[_0x394dab(0x22e)]('─'[_0x394dab(0x25b)](0x3c)),_0x518d6e[_0x394dab(0x1e6)]&&console[_0x394dab(0x22e)](_0x518d6e['diff']),console[_0x394dab(0x22e)]('─'[_0x394dab(0x25b)](0x3c));}if(_0x2cc937[_0x394dab(0x1d0)]>0x0&&!_0x3e70b2['journeysOnly'])for(const _0x3e0fa5 of _0x2cc937){const _0x44ac3d=_0x3e0fa5[_0x394dab(0x1ca)]?_0x417e77[_0x394dab(0x21d)](_0x3e0fa5[_0x394dab(0x1ca)][_0x394dab(0x1cf)]())||'':'',_0x276b4e=_0x44ac3d?_0x44ac3d+'/'+_0x3e0fa5[_0x394dab(0x1d7)]:_0x3e0fa5[_0x394dab(0x1d7)],_0x20eece=_0x4acbbc[_0x394dab(0x21d)](_0x3e0fa5['id'])||[],_0x2c9e7c=_0x20eece['length']>0x0?a35_0x16b3a5['dim']('\x20['+_0x20eece['length']+_0x394dab(0x1f5)):'';console[_0x394dab(0x22e)]('\x0a'+a35_0x16b3a5['red'](_0x394dab(0x1e1))+'\x20'+_0x276b4e+_0x2c9e7c),console[_0x394dab(0x22e)]('─'['repeat'](0x3c));const _0x3823ee=segmentWithActivationsToYaml(_0x3e0fa5,_0x20eece,undefined,_0x25f330,_0x6533d0),_0x590f60=segmentToYamlString(_0x3823ee),_0x267cda=generateDiff(_0x590f60,'');console[_0x394dab(0x22e)](formatDiffWithColors(_0x267cda)),console[_0x394dab(0x22e)]('─'['repeat'](0x3c));}const _0x32fdbf=_0x5783d7[_0x394dab(0x1d5)](_0x103844=>!_0x103844[_0x394dab(0x229)]&&_0x103844['diff']);if(_0x32fdbf[_0x394dab(0x1d0)]>0x0&&!_0x3e70b2['journeysOnly'])for(const _0x5ba5a3 of _0x32fdbf){const _0x5c79c7=_0x5ba5a3[_0x394dab(0x24e)]?_0x5ba5a3[_0x394dab(0x24e)]+'/'+_0x5ba5a3[_0x394dab(0x25a)][_0x394dab(0x1d7)]:_0x5ba5a3[_0x394dab(0x25a)][_0x394dab(0x1d7)];console[_0x394dab(0x22e)]('\x0a'+a35_0x16b3a5[_0x394dab(0x23a)](_0x394dab(0x20e))+'\x20'+_0x5c79c7),console[_0x394dab(0x22e)]('─'[_0x394dab(0x25b)](0x3c)),console[_0x394dab(0x22e)](_0x5ba5a3[_0x394dab(0x1e6)]),console['error']('─'[_0x394dab(0x25b)](0x3c));}if(_0x32f561[_0x394dab(0x1d0)]>0x0)for(const _0xde8c61 of _0x32f561){const _0x457568=_0xde8c61['folderPath']?_0xde8c61[_0x394dab(0x24e)]+'/'+_0xde8c61[_0x394dab(0x25a)][_0x394dab(0x1d7)]:_0xde8c61[_0x394dab(0x25a)][_0x394dab(0x1d7)];console['error']('\x0a'+a35_0x16b3a5[_0x394dab(0x21b)]('New\x20journey:')+'\x20'+_0x457568),console[_0x394dab(0x22e)]('─'['repeat'](0x3c)),_0xde8c61['diff']&&console['error'](_0xde8c61[_0x394dab(0x1e6)]),console[_0x394dab(0x22e)]('─'[_0x394dab(0x25b)](0x3c));}const _0x53c5f3=_0xc6df71[_0x394dab(0x1d5)](_0x55d69e=>!_0x55d69e['isNew']&&_0x55d69e[_0x394dab(0x1e6)]);if(_0x53c5f3['length']>0x0)for(const _0x425fe5 of _0x53c5f3){const _0x4b4e3f=_0x425fe5[_0x394dab(0x24e)]?_0x425fe5['folderPath']+'/'+_0x425fe5[_0x394dab(0x25a)][_0x394dab(0x1d7)]:_0x425fe5['yamlConfig']['name'];console[_0x394dab(0x22e)]('\x0a'+a35_0x16b3a5[_0x394dab(0x23a)](_0x394dab(0x254))+'\x20'+_0x4b4e3f),console[_0x394dab(0x22e)]('─'[_0x394dab(0x25b)](0x3c)),console[_0x394dab(0x22e)](_0x425fe5[_0x394dab(0x1e6)]),console[_0x394dab(0x22e)]('─'[_0x394dab(0x25b)](0x3c));}if(_0xaa8b8c[_0x394dab(0x1d0)]>0x0)for(const _0x418837 of _0xaa8b8c){const _0x4ffcef=_0x418837[_0x394dab(0x1ff)]?_0x417e77[_0x394dab(0x21d)](_0x418837[_0x394dab(0x1ff)])||'':'',_0x3fe7aa=_0x4ffcef?_0x4ffcef+'/'+_0x418837[_0x394dab(0x261)]:_0x418837['journeyBundleName'];console[_0x394dab(0x22e)]('\x0a'+a35_0x16b3a5[_0x394dab(0x21c)](_0x394dab(0x1f2))+'\x20'+_0x3fe7aa),console[_0x394dab(0x22e)]('─'['repeat'](0x3c)),console[_0x394dab(0x22e)](a35_0x16b3a5[_0x394dab(0x21c)]('(Journey\x20will\x20be\x20deleted)')),console[_0x394dab(0x22e)]('─'['repeat'](0x3c));}if(_0x3e70b2['dryRun'])return console['error'](a35_0x16b3a5['yellow'](_0x394dab(0x1fe))),0x0;const _0x429c9a=_0x3e70b2[_0x394dab(0x22f)]?![]:_0x410822['length']>0x0||_0x4194ae[_0x394dab(0x1d0)]>0x0||_0x2cc937[_0x394dab(0x1d0)]>0x0,_0x1fc87b=_0x32f561[_0x394dab(0x1d0)]>0x0||_0x253c53[_0x394dab(0x1d0)]>0x0||_0xaa8b8c[_0x394dab(0x1d0)]>0x0,_0x25d94a=_0x3e70b2[_0x394dab(0x22f)]?![]:_0x5b3824[_0x394dab(0x1d0)]>0x0,_0x767a7b=_0x3cc7a0['length']>0x0;if(!_0x429c9a&&!_0x1fc87b&&!_0x25d94a&&!_0x767a7b){const _0x852c40=_0x3e70b2[_0x394dab(0x22f)]?_0x394dab(0x230):_0x394dab(0x218);console[_0x394dab(0x22e)](a35_0x16b3a5['green'](_0x852c40));if(_0x27790a&&_0x97e39['length']===0x1){const _0x379854=_0x97e39[0x0];if(_0x379854['existingJourney']?.['id']){const _0x40554c=getConsoleNextUrl(_0x3e70b2[_0x394dab(0x1f7)],_0x394dab(0x21f)+_0x4ae4fc+_0x394dab(0x25c)+_0x379854['existingJourney']['id']+'/j/da/je');console[_0x394dab(0x22e)]('\x20\x20'+a35_0x16b3a5['cyan'](_0x40554c));}}return 0x0;}const _0x15a84c=_0x3e70b2[_0x394dab(0x22f)]?_0x32f561['length']+_0x253c53[_0x394dab(0x1d0)]+_0xaa8b8c[_0x394dab(0x1d0)]+_0x3cc7a0['length']:_0x410822[_0x394dab(0x1d0)]+_0x4194ae[_0x394dab(0x1d0)]+_0x2cc937[_0x394dab(0x1d0)]+_0x32f561[_0x394dab(0x1d0)]+_0x253c53[_0x394dab(0x1d0)]+_0xaa8b8c['length']+_0x3cc7a0['length']+_0x5b3824[_0x394dab(0x1d0)];if(!_0x3e70b2['yes']&&_0x15a84c>0x0){if(!isInteractive())return console[_0x394dab(0x22e)](a35_0x16b3a5[_0x394dab(0x21c)](_0x394dab(0x225)),_0x394dab(0x212)),console[_0x394dab(0x22e)](a35_0x16b3a5[_0x394dab(0x238)](_0x394dab(0x217))),0x1;const _0x15852f=await confirmKey(_0x394dab(0x1d2)+_0x15a84c+_0x394dab(0x206));if(!_0x15852f)return console[_0x394dab(0x22e)](a35_0x16b3a5[_0x394dab(0x23a)]('Aborted.')),0x1;}const _0x2f1cd3={'withProgress':async(_0x3c879c,_0x5316ba)=>{const _0x3a14d9=_0x394dab,_0x3d857c=await withSpinner(_0x3c879c,_0x5316ba,{'verbose':_0x3e70b2['verbose']});return{'data':_0x3d857c[_0x3a14d9(0x1df)]};},'logInfo':_0x281008=>console['error'](a35_0x16b3a5[_0x394dab(0x25d)]('✔\x20'+_0x281008)),'logSuccess':_0x396808=>console['error'](a35_0x16b3a5[_0x394dab(0x21b)]('✔\x20'+_0x396808)),'logWarning':_0x32d956=>console['error'](a35_0x16b3a5['yellow']('⚠\x20'+_0x32d956)),'logDeleted':_0x59ae52=>console['error'](a35_0x16b3a5[_0x394dab(0x21c)]('✔\x20'+_0x59ae52))},_0x1b0bef={'segment':_0x4e8965[_0x394dab(0x1e3)],'journey':_0x4e8965[_0x394dab(0x1da)],'user':_0x4e8965[_0x394dab(0x1fc)],'connection':_0x4e8965[_0x394dab(0x237)]};_0x3cc7a0[_0x394dab(0x1d0)]>0x0&&(_0x43cc0f=await executePushFolders(_0x1b0bef,_0x3cc7a0,_0x43cc0f,{'parentId':_0x4ae4fc},_0x2f1cd3));const _0x52dca5={'rootFolderId':_0x21b782,'folderPathToId':_0x43cc0f,'folderIdToPath':_0x417e77,'segmentNameToId':_0x4af660,'activationsBySegmentId':_0x4acbbc,'emailToIdMap':_0x425aa9,'idToEmailMap':_0x25f330,'connectionNameToIdMap':_0x5c2b28['nameToId'],'connectionIdToNameMap':_0x5c2b28[_0x394dab(0x258)],'connectionNameToTypeMap':_0x439abe},_0x395d9d=await executePushSegments(_0x1b0bef,_0x3e70b2[_0x394dab(0x22f)]?[]:_0x5783d7,_0x52dca5,{'parentId':_0x4ae4fc},_0x2f1cd3),_0x1391c9=_0x395d9d['created'],_0x4b1989=_0x395d9d[_0x394dab(0x1e2)],_0x3c24ee=_0x395d9d[_0x394dab(0x1fb)][_0x394dab(0x1de)],_0x931822=_0x395d9d[_0x394dab(0x1fb)][_0x394dab(0x1e2)],_0x3a164f=_0x395d9d['activations'][_0x394dab(0x246)],_0x199408=await executePushSegmentDeletions(_0x1b0bef,_0x3e70b2[_0x394dab(0x22f)]?[]:_0x2cc937,_0x2f1cd3);let _0x2a3420=0x0,_0x7b0940=0x0,_0x6b8a7=0x0;const _0x137343=new Map(_0x4af660);for(const [_0xab3fe0,_0x303064]of _0x395d9d['createdSegmentIds']){_0x137343[_0x394dab(0x1e9)](_0xab3fe0,_0x303064);}if(_0xc6df71[_0x394dab(0x1d0)]>0x0){const _0x47fa76={..._0x52dca5,'segmentNameToId':_0x137343,'existingSegments':_0x4803a9,'activationContext':_0x396f4e},_0x150de8=await executePushJourneys(_0x1b0bef,_0xc6df71,_0x47fa76,{'parentId':_0x4ae4fc,'rootFolderId':_0x21b782,'verbose':_0x3e70b2['verbose']},_0x2f1cd3);_0x2a3420=_0x150de8[_0x394dab(0x1de)],_0x7b0940=_0x150de8[_0x394dab(0x1e2)];if(_0x27790a&&_0x150de8[_0x394dab(0x260)][_0x394dab(0x1d0)]===0x1){const _0x39f880=_0x150de8[_0x394dab(0x260)][0x0];if(_0x39f880['journeyId']){const _0x3551c8=getConsoleNextUrl(_0x3e70b2[_0x394dab(0x1f7)],'/app/ps/'+_0x4ae4fc+'/e/'+_0x39f880[_0x394dab(0x1e8)]+'/j/da/je');console[_0x394dab(0x22e)]('\x20\x20'+a35_0x16b3a5['cyan'](_0x3551c8));}}}for(const _0x1548bb of _0xaa8b8c){console[_0x394dab(0x22e)](a35_0x16b3a5[_0x394dab(0x23a)](_0x394dab(0x20f)+_0x1548bb['journeyBundleName'])),_0x6b8a7++;}const _0x41cf23=[];if(_0x1391c9>0x0)_0x41cf23[_0x394dab(0x1ec)](_0x1391c9+'\x20created');if(_0x4b1989>0x0)_0x41cf23[_0x394dab(0x1ec)](_0x4b1989+'\x20updated');if(_0x199408>0x0)_0x41cf23[_0x394dab(0x1ec)](_0x199408+_0x394dab(0x209));const _0x2eec66=[];if(_0x2a3420>0x0)_0x2eec66[_0x394dab(0x1ec)](_0x2a3420+_0x394dab(0x257));if(_0x7b0940>0x0)_0x2eec66[_0x394dab(0x1ec)](_0x7b0940+_0x394dab(0x235));if(_0x6b8a7>0x0)_0x2eec66[_0x394dab(0x1ec)](_0x6b8a7+_0x394dab(0x209));const _0x58d68d=[];if(_0x3c24ee>0x0)_0x58d68d[_0x394dab(0x1ec)](_0x3c24ee+_0x394dab(0x257));if(_0x931822>0x0)_0x58d68d['push'](_0x931822+'\x20updated');if(_0x3a164f>0x0)_0x58d68d[_0x394dab(0x1ec)](_0x3a164f+_0x394dab(0x209));return console[_0x394dab(0x22e)](a35_0x16b3a5['green']('\x0a✔\x20Push\x20complete')),_0x41cf23['length']>0x0&&!_0x3e70b2['journeysOnly']&&console[_0x394dab(0x22e)]('\x20\x20Segments:\x20'+_0x41cf23[_0x394dab(0x234)](',\x20')),_0x2eec66['length']>0x0&&console[_0x394dab(0x22e)](_0x394dab(0x1d9)+_0x2eec66[_0x394dab(0x234)](',\x20')),_0x58d68d[_0x394dab(0x1d0)]>0x0&&!_0x3e70b2[_0x394dab(0x22f)]&&console[_0x394dab(0x22e)](_0x394dab(0x1f1)+_0x58d68d[_0x394dab(0x234)](',\x20')),0x0;}}