@treasuredata/tdx 2026.3.15 β†’ 2026.3.17

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 (202) hide show
  1. package/README.md +9 -0
  2. package/dist/bin.js +1 -1
  3. package/dist/build-info.json +3 -3
  4. package/dist/cli-categories.js +1 -1
  5. package/dist/cli.js +1 -1
  6. package/dist/commands/activations.js +1 -1
  7. package/dist/commands/agent-command.js +1 -1
  8. package/dist/commands/agent-test-command.js +1 -1
  9. package/dist/commands/api-command.js +1 -1
  10. package/dist/commands/auth-command.js +1 -1
  11. package/dist/commands/auth-login-command.js +1 -1
  12. package/dist/commands/chat-command.js +1 -1
  13. package/dist/commands/claude-command.js +1 -1
  14. package/dist/commands/claude-statusline-command.js +1 -1
  15. package/dist/commands/claude-usage-command.js +1 -1
  16. package/dist/commands/command.js +1 -1
  17. package/dist/commands/connection-command.js +1 -1
  18. package/dist/commands/databases.js +1 -1
  19. package/dist/commands/delivery-command.js +1 -1
  20. package/dist/commands/describe.js +1 -1
  21. package/dist/commands/engage-campaign-pull-command.js +1 -1
  22. package/dist/commands/engage-campaign-push-command.js +1 -1
  23. package/dist/commands/engage-campaign-validate-command.js +1 -1
  24. package/dist/commands/engage-command.js +1 -1
  25. package/dist/commands/engage-template-pull-command.js +1 -1
  26. package/dist/commands/engage-template-push-command.js +1 -1
  27. package/dist/commands/engage-template-validate-command.js +1 -1
  28. package/dist/commands/job-command.js +1 -1
  29. package/dist/commands/journey-command.js +1 -1
  30. package/dist/commands/journey-validate-command.js +1 -1
  31. package/dist/commands/llm-command.js +1 -1
  32. package/dist/commands/mcp-command.js +1 -1
  33. package/dist/commands/parent-segment-command.js +1 -1
  34. package/dist/commands/profile-command.js +1 -1
  35. package/dist/commands/profiles-command.js +1 -1
  36. package/dist/commands/query-command.js +1 -1
  37. package/dist/commands/schedule-command.js +1 -1
  38. package/dist/commands/segment-command.js +1 -1
  39. package/dist/commands/segment-create-command.js +1 -1
  40. package/dist/commands/segment-fields-command.js +1 -1
  41. package/dist/commands/segment-pull-command.js +1 -1
  42. package/dist/commands/segment-push-command.js +1 -1
  43. package/dist/commands/segment-update-command.js +1 -1
  44. package/dist/commands/segment-use-command.js +1 -1
  45. package/dist/commands/segment-validate-command.js +1 -1
  46. package/dist/commands/segments.js +1 -1
  47. package/dist/commands/show.js +1 -1
  48. package/dist/commands/status-command.js +1 -1
  49. package/dist/commands/tables.js +1 -1
  50. package/dist/commands/unset-command.js +1 -1
  51. package/dist/commands/upgrade-command.js +1 -1
  52. package/dist/commands/use-command.js +1 -1
  53. package/dist/commands/user-command.js +1 -1
  54. package/dist/commands/workflow-command.js +1 -1
  55. package/dist/core/auth.js +1 -1
  56. package/dist/core/command-output.js +1 -1
  57. package/dist/core/config.js +1 -1
  58. package/dist/core/connection-cache.js +1 -1
  59. package/dist/core/constants.js +1 -1
  60. package/dist/core/credential-cache.js +1 -1
  61. package/dist/core/global-context.js +1 -1
  62. package/dist/core/keychain.js +1 -1
  63. package/dist/core/oauth-keychain.js +1 -1
  64. package/dist/core/oauth.js +1 -1
  65. package/dist/core/profile.js +1 -1
  66. package/dist/core/project-config.js +1 -1
  67. package/dist/core/session.js +1 -1
  68. package/dist/core/user-cache.js +1 -1
  69. package/dist/core/version.js +1 -1
  70. package/dist/index.js +1 -1
  71. package/dist/mcp/server.js +1 -1
  72. package/dist/mcp/tools/index.js +1 -1
  73. package/dist/mcp/tools/tdx-run.js +1 -1
  74. package/dist/mcp/tools/tdx-search.js +1 -1
  75. package/dist/mcp/utils.js +1 -1
  76. package/dist/proxy/claude-usage-tracker.js +1 -1
  77. package/dist/proxy/passthrough-server.js +1 -1
  78. package/dist/proxy/sse-usage-parser.js +1 -1
  79. package/dist/sdk/agent/agent-config.js +1 -1
  80. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  81. package/dist/sdk/agent/agent-yaml.js +1 -1
  82. package/dist/sdk/agent/test/evaluator.js +1 -1
  83. package/dist/sdk/agent/test/executor.js +1 -1
  84. package/dist/sdk/agent/test/index.js +1 -1
  85. package/dist/sdk/agent/test/output.js +1 -1
  86. package/dist/sdk/agent/test/parser.js +1 -1
  87. package/dist/sdk/agent/tool-target-registry.js +1 -1
  88. package/dist/sdk/api.js +1 -1
  89. package/dist/sdk/client/cdp-api-client.js +1 -1
  90. package/dist/sdk/client/delivery-api-client.js +1 -1
  91. package/dist/sdk/client/endpoints.js +1 -1
  92. package/dist/sdk/client/engage-api-client.js +1 -1
  93. package/dist/sdk/client/http-client.js +1 -1
  94. package/dist/sdk/client/llm-api-client.js +1 -1
  95. package/dist/sdk/client/oauth-refresh.js +1 -1
  96. package/dist/sdk/client/rate-limiter.js +1 -1
  97. package/dist/sdk/client/td-api-client.js +1 -1
  98. package/dist/sdk/client/trino-api-client.js +1 -1
  99. package/dist/sdk/client/workflow-client.js +1 -1
  100. package/dist/sdk/connection-validator.js +1 -1
  101. package/dist/sdk/connection.js +1 -1
  102. package/dist/sdk/delivery.js +1 -1
  103. package/dist/sdk/engage/campaign-pull.js +1 -1
  104. package/dist/sdk/engage/campaign-push.js +1 -1
  105. package/dist/sdk/engage/campaign-validator.js +1 -1
  106. package/dist/sdk/engage/campaign-yaml.js +1 -1
  107. package/dist/sdk/engage/template-pull.js +1 -1
  108. package/dist/sdk/engage/template-push.js +1 -1
  109. package/dist/sdk/engage/template-validator.js +1 -1
  110. package/dist/sdk/engage/template-yaml.js +1 -1
  111. package/dist/sdk/engage/types/campaign-def.js +1 -1
  112. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  113. package/dist/sdk/engage/types/template-schema.js +1 -1
  114. package/dist/sdk/engage.js +1 -1
  115. package/dist/sdk/errors.js +1 -1
  116. package/dist/sdk/index.js +1 -1
  117. package/dist/sdk/io/index.js +1 -1
  118. package/dist/sdk/io/node-filesystem.js +1 -1
  119. package/dist/sdk/job.js +1 -1
  120. package/dist/sdk/journey.js +1 -1
  121. package/dist/sdk/llm/chat-cache.js +1 -1
  122. package/dist/sdk/llm/index.js +1 -1
  123. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  124. package/dist/sdk/llm/model-factors.js +1 -1
  125. package/dist/sdk/personalization.js +1 -1
  126. package/dist/sdk/query/index.js +1 -1
  127. package/dist/sdk/query/sql-parser.js +1 -1
  128. package/dist/sdk/realtime.js +1 -1
  129. package/dist/sdk/schedule.js +1 -1
  130. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  131. package/dist/sdk/segment/fields-display.js +1 -1
  132. package/dist/sdk/segment/file-discovery.js +1 -1
  133. package/dist/sdk/segment/journey-utils.js +1 -1
  134. package/dist/sdk/segment/journey-validator.js +1 -1
  135. package/dist/sdk/segment/journey-yaml.js +1 -1
  136. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  137. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  138. package/dist/sdk/segment/pull-workflow.js +1 -1
  139. package/dist/sdk/segment/push-recovery.js +1 -1
  140. package/dist/sdk/segment/push-workflow.js +1 -1
  141. package/dist/sdk/segment/resolution-context.js +1 -1
  142. package/dist/sdk/segment/segment-path-parser.js +1 -1
  143. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  144. package/dist/sdk/segment/segment-validator.js +1 -1
  145. package/dist/sdk/segment/target-resolution.js +1 -1
  146. package/dist/sdk/segment/tdx-config.js +1 -1
  147. package/dist/sdk/segment/types/activation-schema.js +1 -1
  148. package/dist/sdk/segment/types/journey-def.js +1 -1
  149. package/dist/sdk/segment/types/journey-schema.js +1 -1
  150. package/dist/sdk/segment/types/segment-def.js +1 -1
  151. package/dist/sdk/segment/types/segment-schema.js +1 -1
  152. package/dist/sdk/segment/validate-files.js +1 -1
  153. package/dist/sdk/segment/yaml-validator.js +1 -1
  154. package/dist/sdk/segment.js +1 -1
  155. package/dist/sdk/types/index.js +1 -1
  156. package/dist/sdk/types/progress.js +1 -1
  157. package/dist/sdk/user.js +1 -1
  158. package/dist/sdk/util/format-detector.js +1 -1
  159. package/dist/sdk/util/formatters.js +1 -1
  160. package/dist/sdk/util/index.js +1 -1
  161. package/dist/sdk/util/paginate.js +1 -1
  162. package/dist/sdk/util/tree-formatter.js +1 -1
  163. package/dist/sdk/workflow/archive-validation.js +1 -1
  164. package/dist/sdk/workflow/clone-workflow.js +1 -1
  165. package/dist/sdk/workflow/index.js +1 -1
  166. package/dist/sdk/workflow/pull-workflow.js +1 -1
  167. package/dist/sdk/workflow/push-workflow.js +1 -1
  168. package/dist/sdk/workflow/tdx-config.js +1 -1
  169. package/dist/sdk/workflow/workflow-utils.js +1 -1
  170. package/dist/test-utils/command-runner.js +1 -1
  171. package/dist/test-utils/factories.js +1 -1
  172. package/dist/test-utils/fixtures.js +1 -1
  173. package/dist/test-utils/http-mock.js +1 -1
  174. package/dist/test-utils/index.js +1 -1
  175. package/dist/utils/async.js +1 -1
  176. package/dist/utils/colors.js +1 -1
  177. package/dist/utils/diff.js +1 -1
  178. package/dist/utils/file-permissions.js +1 -1
  179. package/dist/utils/file-reader.js +1 -1
  180. package/dist/utils/github-releases.js +1 -1
  181. package/dist/utils/global-cache.js +1 -1
  182. package/dist/utils/json-loader.js +1 -1
  183. package/dist/utils/local-cache.js +1 -1
  184. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  185. package/dist/utils/logger/formatters/index.js +1 -1
  186. package/dist/utils/logger/handlers/console-handler.js +1 -1
  187. package/dist/utils/logger/handlers/file-handler.js +1 -1
  188. package/dist/utils/logger/handlers/index.js +1 -1
  189. package/dist/utils/logger/handlers/null-handler.js +1 -1
  190. package/dist/utils/logger/index.js +1 -1
  191. package/dist/utils/logger/logger.js +1 -1
  192. package/dist/utils/logger/types.js +1 -1
  193. package/dist/utils/option-validation.js +1 -1
  194. package/dist/utils/process.js +1 -1
  195. package/dist/utils/prompt.js +1 -1
  196. package/dist/utils/spinner.js +1 -1
  197. package/dist/utils/sse-parser.js +1 -1
  198. package/dist/utils/string-utils.js +1 -1
  199. package/dist/utils/table-ref-parser.js +1 -1
  200. package/dist/utils/tdx-logger.js +1 -1
  201. package/dist/utils/version-check.js +1 -1
  202. package/package.json +3 -3
@@ -1 +1 @@
1
- const a34_0x109a39=a34_0x25ab;(function(_0x18dd64,_0x44e24d){const _0x4665da=a34_0x25ab,_0x4efefb=_0x18dd64();while(!![]){try{const _0x2ff46e=-parseInt(_0x4665da(0x199))/0x1*(parseInt(_0x4665da(0x19f))/0x2)+-parseInt(_0x4665da(0x1bd))/0x3*(parseInt(_0x4665da(0x19b))/0x4)+-parseInt(_0x4665da(0x16b))/0x5+-parseInt(_0x4665da(0x1ad))/0x6+parseInt(_0x4665da(0x1b0))/0x7*(-parseInt(_0x4665da(0x155))/0x8)+-parseInt(_0x4665da(0x1c7))/0x9+parseInt(_0x4665da(0x1d0))/0xa;if(_0x2ff46e===_0x44e24d)break;else _0x4efefb['push'](_0x4efefb['shift']());}catch(_0x2501e1){_0x4efefb['push'](_0x4efefb['shift']());}}}(a34_0x52fc,0xd9468));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 a34_0x4ea172 from'chalk';function formatRelativeTime(_0x5897b4){const _0x377847=a34_0x25ab,_0x491d98=new Date(_0x5897b4),_0x2bbf8f=new Date(),_0x3e50a8=_0x491d98['getTime']()-_0x2bbf8f[_0x377847(0x16c)](),_0x22b29b=Math[_0x377847(0x194)](_0x3e50a8)/0x3e8,_0x567645=_0x3e50a8<0x0;if(_0x22b29b<0x3c)return _0x567645?_0x377847(0x163):_0x377847(0x179);else{if(_0x22b29b<0xe10){const _0x18d0ca=Math[_0x377847(0x1b4)](_0x22b29b/0x3c);return _0x567645?_0x18d0ca+_0x377847(0x191):_0x377847(0x1bf)+_0x18d0ca+'m';}else{if(_0x22b29b<0x15180){const _0x21c62c=Math[_0x377847(0x1b4)](_0x22b29b/0xe10);return _0x567645?_0x21c62c+'h\x20ago':_0x377847(0x1bf)+_0x21c62c+'h';}else{if(_0x22b29b<0x93a80){const _0x582d89=Math[_0x377847(0x1b4)](_0x22b29b/0x15180);return _0x567645?_0x582d89+'d\x20ago':_0x377847(0x1bf)+_0x582d89+'d';}else return _0x491d98[_0x377847(0x1a9)]();}}}}export class ScheduleListCommand extends BaseCommand{['name']=a34_0x109a39(0x1c6);[a34_0x109a39(0x180)]=a34_0x109a39(0x1a4);async['execute'](_0x3ae7f3){const _0x5ee10=a34_0x109a39,{options:_0x52fd33,args:_0x422e9d,tdx:_0x1b80f5}=_0x3ae7f3,_0x535c6f=resolveLimit(_0x52fd33[_0x5ee10(0x15d)],DEFAULT_DISPLAY_LIMIT),_0x2b1fca=_0x422e9d[0x0],_0x14907b=_0x2b1fca?'Searching\x20scheduled\x20queries\x20matching\x20\x22'+_0x2b1fca+_0x5ee10(0x1c1):_0x5ee10(0x18b),_0xfdaa0a=await withSpinner(_0x14907b,()=>_0x1b80f5[_0x5ee10(0x183)][_0x5ee10(0x1a6)]({'limit':_0x535c6f,'scheduled':!![],'pattern':_0x2b1fca}),{'verbose':_0x52fd33['verbose']}),_0xabd94f=_0xfdaa0a[_0x5ee10(0x189)][_0x5ee10(0x1d5)],_0x2aa0ff=_0xfdaa0a[_0x5ee10(0x189)][_0x5ee10(0x1a3)][_0x5ee10(0x18d)],_0x27799c=_0x2b1fca?_0x5ee10(0x165)+_0x2b1fca+'\x22':'';_0x2aa0ff?console[_0x5ee10(0x1ae)](_0x5ee10(0x1d2)+_0xabd94f[_0x5ee10(0x1c9)]+_0x5ee10(0x15b)+_0x27799c+_0x5ee10(0x193)):console['error']('Found\x20'+_0xabd94f[_0x5ee10(0x1c9)]+_0x5ee10(0x1ba)+(_0xabd94f[_0x5ee10(0x1c9)]!==0x1?_0x5ee10(0x17d):'y')+_0x27799c);if(_0x52fd33[_0x5ee10(0x1bc)]==='json'||_0x52fd33['format']===_0x5ee10(0x164)||_0x52fd33[_0x5ee10(0x1bc)]===_0x5ee10(0x152)||_0x52fd33[_0x5ee10(0x1bc)]==='tsv'){const _0x92f1ae=_0xabd94f['map'](_0x30bbc0=>({'id':_0x30bbc0['id'],'name':_0x30bbc0[_0x5ee10(0x161)],'cron':_0x30bbc0[_0x5ee10(0x1c8)],'database':_0x30bbc0[_0x5ee10(0x166)]?.[_0x5ee10(0x161)],'type':_0x30bbc0[_0x5ee10(0x1d4)],'timezone':_0x30bbc0[_0x5ee10(0x160)],'user_name':_0x30bbc0['user']?.[_0x5ee10(0x161)],'updated_at':_0x30bbc0[_0x5ee10(0x1d7)],'next_run_at':_0x30bbc0[_0x5ee10(0x1b8)],'last_job_status':_0x30bbc0[_0x5ee10(0x1c2)]?.[_0x5ee10(0x1bb)]}));await handleSDKOutput(_0x92f1ae,_0x52fd33);}else{if(_0xabd94f[_0x5ee10(0x1c9)]===0x0)console[_0x5ee10(0x14f)](_0x5ee10(0x170));else{const _0x10b7b2=_0x52fd33[_0x5ee10(0x14b)],_0x1501a7=_0xabd94f['map'](_0x4dce0a=>{const _0x4fc7aa=_0x5ee10,_0x195af9=_0x4dce0a[_0x4fc7aa(0x1c2)]?.['status']?_0x4dce0a['last_job'][_0x4fc7aa(0x1bb)]===_0x4fc7aa(0x1c3)?'βœ“':'βœ—':'-',_0x26fa79=_0x4dce0a[_0x4fc7aa(0x1c2)]?.[_0x4fc7aa(0x192)]?formatRelativeTime(_0x4dce0a[_0x4fc7aa(0x1c2)]['ended_at']):_0x4fc7aa(0x1b6),_0xf3f86e=_0x4dce0a['next_run_at']?formatRelativeTime(_0x4dce0a['next_run_at']):'-',_0x1ef5ab=_0x4dce0a['cron']||'',_0x40f5bf=_0x4dce0a[_0x4fc7aa(0x161)]||_0x4fc7aa(0x1b3),_0x52ba56=getConsoleUrl(_0x10b7b2,'/app/queries/editor?queryId='+_0x4dce0a['id']);return{'statusIcon':_0x195af9,'lastRun':_0x26fa79,'nextRun':_0xf3f86e,'cron':_0x1ef5ab,'name':_0x40f5bf,'queryUrl':_0x52ba56,'status':_0x4dce0a[_0x4fc7aa(0x1c2)]?.[_0x4fc7aa(0x1bb)]};}),_0xabdb06=Math[_0x5ee10(0x195)](..._0x1501a7[_0x5ee10(0x158)](_0x3aacfa=>_0x3aacfa[_0x5ee10(0x1a8)][_0x5ee10(0x1c9)])),_0x3e4155=Math[_0x5ee10(0x195)](..._0x1501a7['map'](_0x48a2c0=>_0x48a2c0[_0x5ee10(0x177)]['length'])),_0x500d17=Math[_0x5ee10(0x195)](..._0x1501a7['map'](_0x4751da=>_0x4751da[_0x5ee10(0x1c8)]['length'])),_0x1ac31b=_0x1501a7[_0x5ee10(0x158)](_0x5327d6=>{const _0x56d96e=_0x5ee10,_0x420e8e=_0x5327d6[_0x56d96e(0x1bb)]==='success'?a34_0x4ea172['green'](_0x5327d6['statusIcon']):_0x5327d6['status']==='error'?a34_0x4ea172['red'](_0x5327d6['statusIcon']):a34_0x4ea172[_0x56d96e(0x15c)](_0x5327d6[_0x56d96e(0x168)]),_0x4d3610=_0x5327d6[_0x56d96e(0x1a8)]['padEnd'](_0xabdb06),_0x581fd0=_0x5327d6[_0x56d96e(0x177)][_0x56d96e(0x157)](_0x3e4155),_0x3f6f54=_0x5327d6[_0x56d96e(0x1c8)]?a34_0x4ea172['cyan'](_0x5327d6['cron']['padEnd'](_0x500d17)):'\x20'['repeat'](_0x500d17),_0x243745=hyperlink(_0x5327d6['name'],_0x5327d6[_0x56d96e(0x162)]);return _0x56d96e(0x16d)+_0x420e8e+'\x20'+_0x4d3610+_0x56d96e(0x17f)+_0x581fd0+'\x20\x20'+_0x3f6f54+'\x20\x20'+_0x243745;});await writeOutput(_0x1ac31b[_0x5ee10(0x171)]('\x0a'),_0x52fd33[_0x5ee10(0x16f)],_0x5ee10(0x1b2));}}return 0x0;}}export class ScheduleShowCommand extends BaseCommand{['name']=a34_0x109a39(0x16a);['description']=a34_0x109a39(0x15a);['validate'](_0x17ebbe){const _0x52d959=a34_0x109a39,_0x555dcd=_0x17ebbe[_0x52d959(0x1ce)][0x0];if(!_0x555dcd)return'Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20show\x20<name>';return undefined;}async['execute'](_0x2628bd){const _0x29b8c3=a34_0x109a39,{options:_0x3ed2f3,args:_0x3fcd7b,tdx:_0x359356}=_0x2628bd,_0x8014c2=_0x3fcd7b[0x0],_0x4ba6e3=await withSpinner(_0x29b8c3(0x174),()=>_0x359356[_0x29b8c3(0x183)][_0x29b8c3(0x14a)](_0x8014c2),{'verbose':_0x3ed2f3[_0x29b8c3(0x197)]}),_0x18ab59=_0x4ba6e3[_0x29b8c3(0x189)],_0x11f174={'name':_0x18ab59[_0x29b8c3(0x161)],'cron':_0x18ab59[_0x29b8c3(0x1c8)],'database':_0x18ab59['database'],'type':_0x18ab59[_0x29b8c3(0x1d4)],'timezone':_0x18ab59[_0x29b8c3(0x1d3)],'user_name':_0x18ab59[_0x29b8c3(0x1be)],'created_at':_0x18ab59['created_at'],'engine_version':_0x18ab59[_0x29b8c3(0x17e)],'executing_user_id':_0x18ab59[_0x29b8c3(0x1a2)],'query':_0x18ab59[_0x29b8c3(0x1b5)],'delay':_0x18ab59[_0x29b8c3(0x154)],'priority':_0x18ab59['priority'],'retry_limit':_0x18ab59[_0x29b8c3(0x175)],..._0x18ab59[_0x29b8c3(0x19a)]&&{'result':_0x18ab59[_0x29b8c3(0x19a)]}};return await handleSingleObjectOutput(_0x11f174,_0x3ed2f3),0x0;}}export class ScheduleCreateCommand extends BaseCommand{[a34_0x109a39(0x161)]='schedule:create';['description']=a34_0x109a39(0x19c);['validate'](_0x37c5be){const _0x51df6c=a34_0x109a39,_0x2e032f=_0x37c5be[_0x51df6c(0x1ce)][0x0];if(!_0x2e032f)return _0x51df6c(0x181);const _0x2fc73c=_0x37c5be['options'];if(!_0x2fc73c[_0x51df6c(0x166)])return _0x51df6c(0x188);return undefined;}async[a34_0x109a39(0x19e)](_0x5a31ab){const _0x5bddad=a34_0x109a39,{options:_0x502fe3,args:_0x3b8b7f,tdx:_0x2bbc6e}=_0x5a31ab,_0x1cd316=_0x3b8b7f[0x0],_0x432042=_0x502fe3,_0xb8725c=_0x432042['database'],_0x181c2f=_0x432042[_0x5bddad(0x198)],_0xbea690=_0x432042[_0x5bddad(0x1d4)]||_0x5bddad(0x1c5);let _0x49639c;try{_0x49639c=readFileSync(_0x181c2f,'utf-8')[_0x5bddad(0x15f)]();}catch(_0x348950){throw new SDKError(ErrorCode[_0x5bddad(0x18a)],_0x5bddad(0x151)+_0x181c2f,_0x348950 instanceof Error?_0x348950:undefined);}if(!_0x49639c)throw new SDKError(ErrorCode[_0x5bddad(0x18a)],'Query\x20file\x20is\x20empty');const _0x5bb1c1={'database':_0xb8725c,'query':_0x49639c,'type':_0xbea690};if(_0x432042['cron'])_0x5bb1c1[_0x5bddad(0x1c8)]=_0x432042[_0x5bddad(0x1c8)];if(_0x432042[_0x5bddad(0x1d3)])_0x5bb1c1['timezone']=_0x432042[_0x5bddad(0x1d3)];if(_0x432042[_0x5bddad(0x154)]!==undefined)_0x5bb1c1[_0x5bddad(0x154)]=Number(_0x432042[_0x5bddad(0x154)]);if(_0x432042[_0x5bddad(0x1aa)]!==undefined)_0x5bb1c1[_0x5bddad(0x1aa)]=Number(_0x432042[_0x5bddad(0x1aa)]);if(_0x432042[_0x5bddad(0x156)]!==undefined)_0x5bb1c1[_0x5bddad(0x175)]=Number(_0x432042['retryLimit']);if(_0x432042[_0x5bddad(0x1cf)])_0x5bb1c1['engine_version']=_0x432042[_0x5bddad(0x1cf)];if(_0x432042['result'])_0x5bb1c1['result']=_0x432042[_0x5bddad(0x19a)];if(_0x502fe3[_0x5bddad(0x197)]){console[_0x5bddad(0x1ae)](_0x5bddad(0x14e)+_0x1cd316),console['error'](_0x5bddad(0x1af)+_0xb8725c),console['error'](_0x5bddad(0x17c)+_0xbea690);if(_0x5bb1c1[_0x5bddad(0x1c8)])console[_0x5bddad(0x1ae)](_0x5bddad(0x15e)+_0x5bb1c1[_0x5bddad(0x1c8)]);if(_0x5bb1c1['timezone'])console[_0x5bddad(0x1ae)](_0x5bddad(0x1a5)+_0x5bb1c1[_0x5bddad(0x1d3)]);}const _0x610a3c=await withSpinner(_0x5bddad(0x18f),()=>_0x2bbc6e['schedules'][_0x5bddad(0x1b7)](_0x1cd316,_0x5bb1c1),{'verbose':_0x502fe3[_0x5bddad(0x197)]});return console[_0x5bddad(0x1ae)]('Schedule\x20created:\x20'+_0x610a3c[_0x5bddad(0x189)]['name']),await handleSingleObjectOutput(_0x610a3c[_0x5bddad(0x189)],_0x502fe3),0x0;}}export class ScheduleUpdateCommand extends BaseCommand{['name']=a34_0x109a39(0x17a);[a34_0x109a39(0x180)]=a34_0x109a39(0x178);[a34_0x109a39(0x1b9)](_0x3cff97){const _0x5ee614=a34_0x109a39,_0x4d25d7=_0x3cff97[_0x5ee614(0x1ce)][0x0];if(!_0x4d25d7)return _0x5ee614(0x1a7);return undefined;}async[a34_0x109a39(0x19e)](_0x49e958){const _0x45e112=a34_0x109a39,{options:_0x2f53a4,args:_0x197a5f,tdx:_0x1ceb7f}=_0x49e958,_0xd1e0f0=_0x197a5f[0x0],_0x5ac2e5=_0x2f53a4,_0x54b76f={};if(_0x5ac2e5[_0x45e112(0x166)])_0x54b76f[_0x45e112(0x166)]=_0x5ac2e5[_0x45e112(0x166)];if(_0x5ac2e5[_0x45e112(0x1d4)])_0x54b76f[_0x45e112(0x1d4)]=_0x5ac2e5['type'];if(_0x5ac2e5[_0x45e112(0x1c8)])_0x54b76f[_0x45e112(0x1c8)]=_0x5ac2e5[_0x45e112(0x1c8)];if(_0x5ac2e5[_0x45e112(0x1d3)])_0x54b76f[_0x45e112(0x1d3)]=_0x5ac2e5[_0x45e112(0x1d3)];if(_0x5ac2e5[_0x45e112(0x154)]!==undefined)_0x54b76f[_0x45e112(0x154)]=Number(_0x5ac2e5[_0x45e112(0x154)]);if(_0x5ac2e5[_0x45e112(0x1aa)]!==undefined)_0x54b76f[_0x45e112(0x1aa)]=Number(_0x5ac2e5[_0x45e112(0x1aa)]);if(_0x5ac2e5[_0x45e112(0x156)]!==undefined)_0x54b76f[_0x45e112(0x175)]=Number(_0x5ac2e5['retryLimit']);if(_0x5ac2e5['engineVersion'])_0x54b76f['engine_version']=_0x5ac2e5[_0x45e112(0x1cf)];if(_0x5ac2e5[_0x45e112(0x19a)])_0x54b76f[_0x45e112(0x19a)]=_0x5ac2e5[_0x45e112(0x19a)];if(_0x5ac2e5[_0x45e112(0x198)])try{_0x54b76f['query']=readFileSync(_0x5ac2e5[_0x45e112(0x198)],_0x45e112(0x1cd))[_0x45e112(0x15f)]();}catch(_0x15be07){throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x45e112(0x151)+_0x5ac2e5[_0x45e112(0x198)],_0x15be07 instanceof Error?_0x15be07:undefined);}if(Object['keys'](_0x54b76f)['length']===0x0)throw new SDKError(ErrorCode[_0x45e112(0x18a)],_0x45e112(0x14c));if(_0x2f53a4[_0x45e112(0x197)]){console[_0x45e112(0x1ae)](_0x45e112(0x186)+_0xd1e0f0);for(const [_0x3a5c15,_0x35a527]of Object[_0x45e112(0x1a0)](_0x54b76f)){_0x3a5c15==='query'?console[_0x45e112(0x1ae)]('\x20\x20'+_0x3a5c15+':\x20'+_0x35a527['substring'](0x0,0x32)+_0x45e112(0x182)):console[_0x45e112(0x1ae)]('\x20\x20'+_0x3a5c15+':\x20'+_0x35a527);}}const _0x441e65=await withSpinner('Updating\x20schedule...',()=>_0x1ceb7f['schedules'][_0x45e112(0x1b1)](_0xd1e0f0,_0x54b76f),{'verbose':_0x2f53a4[_0x45e112(0x197)]});return console['error'](_0x45e112(0x16e)+_0x441e65[_0x45e112(0x189)]['name']),await handleSingleObjectOutput(_0x441e65[_0x45e112(0x189)],_0x2f53a4),0x0;}}function a34_0x25ab(_0x1eb502,_0x48a5be){_0x1eb502=_0x1eb502-0x14a;const _0x52fc4b=a34_0x52fc();let _0x25ab4e=_0x52fc4b[_0x1eb502];return _0x25ab4e;}export class ScheduleDeleteCommand extends BaseCommand{[a34_0x109a39(0x161)]=a34_0x109a39(0x196);[a34_0x109a39(0x180)]=a34_0x109a39(0x1c4);[a34_0x109a39(0x1b9)](_0x80576d){const _0x4306db=a34_0x109a39,_0x360aeb=_0x80576d[_0x4306db(0x1ce)][0x0];if(!_0x360aeb)return'Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20delete\x20<name>';return undefined;}async[a34_0x109a39(0x19e)](_0x149837){const _0x324b66=a34_0x109a39,{options:_0x52fd2e,args:_0x37ab3e,tdx:_0x22b048}=_0x149837,_0x5262b7=_0x37ab3e[0x0];if(!_0x52fd2e['yes']){const _0x53d2f8=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20schedule\x20\x22'+_0x5262b7+'\x22?');if(!_0x53d2f8)return console[_0x324b66(0x1ae)](_0x324b66(0x184)),0x0;}const _0x198f26=await withSpinner(_0x324b66(0x1d6),()=>_0x22b048['schedules'][_0x324b66(0x173)](_0x5262b7),{'verbose':_0x52fd2e['verbose']});return console[_0x324b66(0x1ae)]('Schedule\x20deleted:\x20'+_0x198f26[_0x324b66(0x189)][_0x324b66(0x161)]),0x0;}}export class ScheduleRunCommand extends BaseCommand{[a34_0x109a39(0x161)]=a34_0x109a39(0x18e);[a34_0x109a39(0x180)]=a34_0x109a39(0x1c0);['validate'](_0x461176){const _0x2b3aef=a34_0x109a39,_0x273b50=_0x461176[_0x2b3aef(0x1ce)][0x0];if(!_0x273b50)return'Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20run\x20<name>\x20[--time\x20<iso8601>]\x20[--num\x20<1-10>]';return undefined;}async['execute'](_0x26193a){const _0xa4d22b=a34_0x109a39,{options:_0x2d4d5f,args:_0xf3a733,tdx:_0x16768d}=_0x26193a,_0x40a4d6=_0xf3a733[0x0],_0x2ce0ac=_0x2d4d5f,_0x4c00e9=_0x2ce0ac[_0xa4d22b(0x190)],_0x25fb80=_0x2ce0ac[_0xa4d22b(0x19d)]!==undefined?Number(_0x2ce0ac[_0xa4d22b(0x19d)]):undefined;if(_0x2d4d5f[_0xa4d22b(0x197)]){console[_0xa4d22b(0x1ae)](_0xa4d22b(0x1ac)+_0x40a4d6);if(_0x4c00e9)console['error']('\x20\x20Time:\x20'+_0x4c00e9);if(_0x25fb80)console[_0xa4d22b(0x1ae)](_0xa4d22b(0x176)+_0x25fb80);}const _0xc55549=await withSpinner(_0xa4d22b(0x159),()=>_0x16768d['schedules'][_0xa4d22b(0x18c)](_0x40a4d6,{'time':_0x4c00e9,'num':_0x25fb80}),{'verbose':_0x2d4d5f[_0xa4d22b(0x197)]}),_0x4a2ed9=_0xc55549['data'][_0xa4d22b(0x153)];console[_0xa4d22b(0x1ae)]('Schedule\x20run\x20submitted:\x20'+_0x4a2ed9[_0xa4d22b(0x1c9)]+_0xa4d22b(0x17b)+(_0x4a2ed9[_0xa4d22b(0x1c9)]!==0x1?'s':'')+_0xa4d22b(0x14d));for(const _0x154ea5 of _0x4a2ed9){console[_0xa4d22b(0x1ae)](_0xa4d22b(0x169)+_0x154ea5[_0xa4d22b(0x1cb)]);}return await handleSDKOutput(_0x4a2ed9,_0x2d4d5f),0x0;}}function a34_0x52fc(){const _0x1259cf=['3956UjZmcr','Create\x20a\x20scheduled\x20query','num','execute','2501502KllWQE','entries','count','executing_user_id','pagination','List\x20scheduled\x20queries','\x20\x20Timezone:\x20','listQueries','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20update\x20<name>\x20[options]','lastRun','toLocaleDateString','priority','Found\x20','Running\x20schedule:\x20','838410PvkKAL','error','\x20\x20Database:\x20','4270567KfRVju','update','list','(unnamed)','round','query','never','create','next_run_at','validate','\x20scheduled\x20quer','status','format','4173Fdtpns','user_name','in\x20','Run\x20a\x20scheduled\x20query\x20immediately','\x22...','last_job','success','Delete\x20a\x20scheduled\x20query','trino','schedule:list','12826800evSRhS','cron','length','schedule:history','job_id','history','utf-8','args','engineVersion','67700700LFAhRd','from','Showing\x20first\x20','timezone','type','queries','Deleting\x20schedule...','updated_at','show','site','At\x20least\x20one\x20option\x20must\x20be\x20provided\x20to\x20update','\x20created','Creating\x20schedule:\x20','log','\x20(showing\x20','Failed\x20to\x20read\x20file:\x20','table','jobs','delay','8XyMLbh','retryLimit','padEnd','map','Running\x20schedule...','Show\x20schedule\x20details','\x20schedules','dim','limit','\x20\x20Cron:\x20','trim','time_zone','name','queryUrl','just\x20now','jsonl','\x20matching\x20\x22','database','Getting\x20schedule\x20history...','statusIcon','\x20\x20Job\x20ID:\x20','schedule:show','5393220dZxJMW','getTime','πŸ“…\x20','Schedule\x20updated:\x20','output','No\x20scheduled\x20queries\x20found','join','end_at','delete','Getting\x20schedule\x20details...','retry_limit','\x20\x20Num:\x20','nextRun','Update\x20a\x20scheduled\x20query','soon','schedule:update','\x20job','\x20\x20Type:\x20','ies','engine_version','\x20\x20β†’\x20','description','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20create\x20<name>\x20-d\x20<db>\x20--file\x20<path>\x20[options]','...','schedules','Cancelled','start_at','Updating\x20schedule:\x20','created_at','Database\x20is\x20required\x0aUsage:\x20job\x20schedule\x20create\x20<name>\x20-d\x20<db>\x20--file\x20<path>\x20[options]','data','INVALID_ARGUMENT','Listing\x20scheduled\x20queries...','run','has_next_page','schedule:run','Creating\x20schedule...','time','m\x20ago','ended_at','\x20(use\x20--limit\x20to\x20see\x20more)','abs','max','schedule:delete','verbose','file','1znTbUc','result'];a34_0x52fc=function(){return _0x1259cf;};return a34_0x52fc();}export class ScheduleHistoryCommand extends BaseCommand{['name']=a34_0x109a39(0x1ca);[a34_0x109a39(0x180)]='Show\x20schedule\x20execution\x20history';[a34_0x109a39(0x1b9)](_0xfda32d){const _0x1b07d3=a34_0x109a39,_0x94339e=_0xfda32d[_0x1b07d3(0x1ce)][0x0];if(!_0x94339e)return'Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20history\x20<name>\x20[--from\x20<n>]\x20[--to\x20<n>]';return undefined;}async['execute'](_0x51532f){const _0x13c07d=a34_0x109a39,{options:_0x344327,args:_0x5919fb,tdx:_0x138d74}=_0x51532f,_0x58eaa3=_0x5919fb[0x0],_0x3e784d=_0x344327,_0x41da93=_0x3e784d[_0x13c07d(0x1d1)]!==undefined?Number(_0x3e784d[_0x13c07d(0x1d1)]):undefined,_0x50a7cb=_0x3e784d['to']!==undefined?Number(_0x3e784d['to']):undefined,_0x343474=await withSpinner(_0x13c07d(0x167),()=>_0x138d74[_0x13c07d(0x183)][_0x13c07d(0x1cc)](_0x58eaa3,{'from':_0x41da93,'to':_0x50a7cb}),{'verbose':_0x344327[_0x13c07d(0x197)]}),_0x38e1fb=_0x343474[_0x13c07d(0x189)];console[_0x13c07d(0x1ae)](_0x13c07d(0x1ab)+_0x38e1fb['count']+'\x20execution'+(_0x38e1fb[_0x13c07d(0x1a1)]!==0x1?'s':'')+_0x13c07d(0x150)+_0x38e1fb[_0x13c07d(0x1d1)]+'-'+_0x38e1fb['to']+')');const _0xf3d8b3=_0x38e1fb['history'][_0x13c07d(0x158)](_0x2c864f=>({'job_id':_0x2c864f[_0x13c07d(0x1cb)],'type':_0x2c864f[_0x13c07d(0x1d4)],'status':_0x2c864f['status'],'scheduled_at':_0x2c864f['scheduled_at'],'created_at':_0x2c864f[_0x13c07d(0x187)],'start_at':_0x2c864f[_0x13c07d(0x185)],'end_at':_0x2c864f[_0x13c07d(0x172)]}));return await handleSDKOutput(_0xf3d8b3,_0x344327),0x0;}}
1
+ function a34_0x2ebe(){const _0x3cd337=['query','list','delete','has_next_page','(unnamed)','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20history\x20<name>\x20[--from\x20<n>]\x20[--to\x20<n>]','Running\x20schedule...','retryLimit','ies','ended_at','schedule:history','priority','schedule:run','Getting\x20schedule\x20details...','\x20\x20Time:\x20','statusIcon','Database\x20is\x20required\x0aUsage:\x20job\x20schedule\x20create\x20<name>\x20-d\x20<db>\x20--file\x20<path>\x20[options]','last_job','Deleting\x20schedule...','lastRun','\x20matching\x20\x22','Schedule\x20updated:\x20','157128JqQKRe','Updating\x20schedule...','data','just\x20now','round','1058616LBPAak','success','soon','site','schedule:show','verbose','No\x20scheduled\x20queries\x20found','At\x20least\x20one\x20option\x20must\x20be\x20provided\x20to\x20update','\x20\x20Num:\x20','abs','options','pagination','schedule:update','utf-8','engineVersion','Create\x20a\x20scheduled\x20query','max','Showing\x20first\x20','table','in\x20','history','args','listQueries','\x20\x20β†’\x20','type','Updating\x20schedule:\x20','tsv','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20show\x20<name>','output','error','executing_user_id','\x20scheduled\x20quer','name','\x20(use\x20--limit\x20to\x20see\x20more)','Creating\x20schedule:\x20','schedule:create','m\x20ago','user_name','next_run_at','status','file','nextRun','\x20\x20Cron:\x20','validate','timezone','description','\x20\x20Database:\x20','never','show','πŸ“…\x20','user','scheduled_at','Found\x20','8754888OhboRB','565698DntlOi','\x20job','\x20\x20Timezone:\x20','queryUrl','54kULSaJ','4gaRYwF','getTime','end_at','execute','Schedule\x20created:\x20','...','retry_limit','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20delete\x20<name>','\x20(showing\x20','repeat','update','Run\x20a\x20scheduled\x20query\x20immediately','updated_at','job_id','format','Creating\x20schedule...','trim','cron','create','INVALID_ARGUMENT','queries','1668djOhZS','engine_version','padEnd','result','red','map','time','Query\x20file\x20is\x20empty','database','Cancelled','substring','\x20schedules','time_zone','Delete\x20a\x20scheduled\x20query','3179BEigtf','\x20execution','cyan','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20schedule\x20\x22','84627xlyIti','/app/queries/editor?queryId=','1054420WBjsJp','\x20\x20Job\x20ID:\x20','d\x20ago','created_at','dim','keys','1640saZTNL','\x20created','length','green','Searching\x20scheduled\x20queries\x20matching\x20\x22','schedules','schedule:delete','7NluvTG','Schedule\x20deleted:\x20','Failed\x20to\x20read\x20file:\x20','h\x20ago','schedule:list','delay','entries','from','Show\x20schedule\x20execution\x20history','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20run\x20<name>\x20[--time\x20<iso8601>]\x20[--num\x20<1-10>]','\x22...','num','Update\x20a\x20scheduled\x20query','count','limit'];a34_0x2ebe=function(){return _0x3cd337;};return a34_0x2ebe();}const a34_0x9bfb35=a34_0xcb4f;(function(_0x32a133,_0x2c96da){const _0x591cf7=a34_0xcb4f,_0x308cc8=_0x32a133();while(!![]){try{const _0x3e436f=parseInt(_0x591cf7(0x156))/0x1*(-parseInt(_0x591cf7(0x15b))/0x2)+-parseInt(_0x591cf7(0x182))/0x3+parseInt(_0x591cf7(0x170))/0x4*(-parseInt(_0x591cf7(0x18a))/0x5)+-parseInt(_0x591cf7(0x120))/0x6*(parseInt(_0x591cf7(0x191))/0x7)+-parseInt(_0x591cf7(0x155))/0x8+parseInt(_0x591cf7(0x15a))/0x9*(-parseInt(_0x591cf7(0x184))/0xa)+-parseInt(_0x591cf7(0x17e))/0xb*(-parseInt(_0x591cf7(0x11b))/0xc);if(_0x3e436f===_0x2c96da)break;else _0x308cc8['push'](_0x308cc8['shift']());}catch(_0x5a5b2e){_0x308cc8['push'](_0x308cc8['shift']());}}}(a34_0x2ebe,0x8ea90));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 a34_0x2e487a from'chalk';function formatRelativeTime(_0x20e5c5){const _0x30cb38=a34_0xcb4f,_0xb3fa08=new Date(_0x20e5c5),_0x51fa64=new Date(),_0x667b51=_0xb3fa08[_0x30cb38(0x15c)]()-_0x51fa64[_0x30cb38(0x15c)](),_0x47d643=Math[_0x30cb38(0x129)](_0x667b51)/0x3e8,_0x5e1ff2=_0x667b51<0x0;if(_0x47d643<0x3c)return _0x5e1ff2?_0x30cb38(0x11e):_0x30cb38(0x122);else{if(_0x47d643<0xe10){const _0x5dcf40=Math['round'](_0x47d643/0x3c);return _0x5e1ff2?_0x5dcf40+_0x30cb38(0x144):_0x30cb38(0x133)+_0x5dcf40+'m';}else{if(_0x47d643<0x15180){const _0x40d9d2=Math[_0x30cb38(0x11f)](_0x47d643/0xe10);return _0x5e1ff2?_0x40d9d2+_0x30cb38(0x194):'in\x20'+_0x40d9d2+'h';}else{if(_0x47d643<0x93a80){const _0x523484=Math['round'](_0x47d643/0x15180);return _0x5e1ff2?_0x523484+_0x30cb38(0x186):_0x30cb38(0x133)+_0x523484+'d';}else return _0xb3fa08['toLocaleDateString']();}}}}export class ScheduleListCommand extends BaseCommand{['name']=a34_0x9bfb35(0x195);[a34_0x9bfb35(0x14d)]='List\x20scheduled\x20queries';async['execute'](_0x5310d0){const _0x1c67c8=a34_0x9bfb35,{options:_0x5240c7,args:_0x3ee1fb,tdx:_0x167e81}=_0x5310d0,_0xaa81fe=resolveLimit(_0x5240c7[_0x1c67c8(0x19f)],DEFAULT_DISPLAY_LIMIT),_0x305850=_0x3ee1fb[0x0],_0x4090d0=_0x305850?_0x1c67c8(0x18e)+_0x305850+_0x1c67c8(0x19b):'Listing\x20scheduled\x20queries...',_0x23ba0e=await withSpinner(_0x4090d0,()=>_0x167e81[_0x1c67c8(0x18f)][_0x1c67c8(0x136)]({'limit':_0xaa81fe,'scheduled':!![],'pattern':_0x305850}),{'verbose':_0x5240c7[_0x1c67c8(0x125)]}),_0x2a5505=_0x23ba0e[_0x1c67c8(0x11d)][_0x1c67c8(0x16f)],_0x41fd55=_0x23ba0e[_0x1c67c8(0x11d)][_0x1c67c8(0x12b)][_0x1c67c8(0x108)],_0x140eed=_0x305850?_0x1c67c8(0x119)+_0x305850+'\x22':'';_0x41fd55?console[_0x1c67c8(0x13d)](_0x1c67c8(0x131)+_0x2a5505[_0x1c67c8(0x18c)]+_0x1c67c8(0x17b)+_0x140eed+_0x1c67c8(0x141)):console['error']('Found\x20'+_0x2a5505[_0x1c67c8(0x18c)]+_0x1c67c8(0x13f)+(_0x2a5505[_0x1c67c8(0x18c)]!==0x1?_0x1c67c8(0x10d):'y')+_0x140eed);if(_0x5240c7['format']==='json'||_0x5240c7[_0x1c67c8(0x169)]==='jsonl'||_0x5240c7[_0x1c67c8(0x169)]===_0x1c67c8(0x132)||_0x5240c7['format']===_0x1c67c8(0x13a)){const _0xe22866=_0x2a5505['map'](_0x3f593b=>({'id':_0x3f593b['id'],'name':_0x3f593b['name'],'cron':_0x3f593b[_0x1c67c8(0x16c)],'database':_0x3f593b[_0x1c67c8(0x178)]?.['name'],'type':_0x3f593b[_0x1c67c8(0x138)],'timezone':_0x3f593b[_0x1c67c8(0x17c)],'user_name':_0x3f593b[_0x1c67c8(0x152)]?.[_0x1c67c8(0x140)],'updated_at':_0x3f593b[_0x1c67c8(0x167)],'next_run_at':_0x3f593b[_0x1c67c8(0x146)],'last_job_status':_0x3f593b[_0x1c67c8(0x116)]?.[_0x1c67c8(0x147)]}));await handleSDKOutput(_0xe22866,_0x5240c7);}else{if(_0x2a5505['length']===0x0)console['log'](_0x1c67c8(0x126));else{const _0x41d489=_0x5240c7[_0x1c67c8(0x123)],_0x14d969=_0x2a5505[_0x1c67c8(0x175)](_0x51673d=>{const _0x3f068d=_0x1c67c8,_0x4f84ed=_0x51673d[_0x3f068d(0x116)]?.[_0x3f068d(0x147)]?_0x51673d[_0x3f068d(0x116)]['status']===_0x3f068d(0x121)?'βœ“':'βœ—':'-',_0x765aa5=_0x51673d[_0x3f068d(0x116)]?.['ended_at']?formatRelativeTime(_0x51673d[_0x3f068d(0x116)][_0x3f068d(0x10e)]):_0x3f068d(0x14f),_0x3406f8=_0x51673d['next_run_at']?formatRelativeTime(_0x51673d['next_run_at']):'-',_0x1f353b=_0x51673d['cron']||'',_0x5036d9=_0x51673d['name']||_0x3f068d(0x109),_0x170073=getConsoleUrl(_0x41d489,_0x3f068d(0x183)+_0x51673d['id']);return{'statusIcon':_0x4f84ed,'lastRun':_0x765aa5,'nextRun':_0x3406f8,'cron':_0x1f353b,'name':_0x5036d9,'queryUrl':_0x170073,'status':_0x51673d[_0x3f068d(0x116)]?.[_0x3f068d(0x147)]};}),_0x51970c=Math[_0x1c67c8(0x130)](..._0x14d969[_0x1c67c8(0x175)](_0xb3dff=>_0xb3dff[_0x1c67c8(0x118)][_0x1c67c8(0x18c)])),_0x106dde=Math[_0x1c67c8(0x130)](..._0x14d969[_0x1c67c8(0x175)](_0x11c782=>_0x11c782[_0x1c67c8(0x149)][_0x1c67c8(0x18c)])),_0xd6fadc=Math[_0x1c67c8(0x130)](..._0x14d969[_0x1c67c8(0x175)](_0x1d4bb3=>_0x1d4bb3['cron'][_0x1c67c8(0x18c)])),_0x5e4c73=_0x14d969[_0x1c67c8(0x175)](_0xef3bff=>{const _0x339e8a=_0x1c67c8,_0x3aa5b2=_0xef3bff[_0x339e8a(0x147)]===_0x339e8a(0x121)?a34_0x2e487a[_0x339e8a(0x18d)](_0xef3bff[_0x339e8a(0x114)]):_0xef3bff[_0x339e8a(0x147)]===_0x339e8a(0x13d)?a34_0x2e487a[_0x339e8a(0x174)](_0xef3bff[_0x339e8a(0x114)]):a34_0x2e487a[_0x339e8a(0x188)](_0xef3bff[_0x339e8a(0x114)]),_0x65c2=_0xef3bff['lastRun']['padEnd'](_0x51970c),_0x4695f4=_0xef3bff[_0x339e8a(0x149)][_0x339e8a(0x172)](_0x106dde),_0x310776=_0xef3bff[_0x339e8a(0x16c)]?a34_0x2e487a[_0x339e8a(0x180)](_0xef3bff[_0x339e8a(0x16c)][_0x339e8a(0x172)](_0xd6fadc)):'\x20'[_0x339e8a(0x164)](_0xd6fadc),_0x27c76d=hyperlink(_0xef3bff[_0x339e8a(0x140)],_0xef3bff[_0x339e8a(0x159)]);return _0x339e8a(0x151)+_0x3aa5b2+'\x20'+_0x65c2+_0x339e8a(0x137)+_0x4695f4+'\x20\x20'+_0x310776+'\x20\x20'+_0x27c76d;});await writeOutput(_0x5e4c73['join']('\x0a'),_0x5240c7[_0x1c67c8(0x13c)],_0x1c67c8(0x1a1));}}return 0x0;}}export class ScheduleShowCommand extends BaseCommand{['name']=a34_0x9bfb35(0x124);['description']='Show\x20schedule\x20details';['validate'](_0x15e571){const _0x5240a0=a34_0x9bfb35,_0x2afca0=_0x15e571[_0x5240a0(0x135)][0x0];if(!_0x2afca0)return _0x5240a0(0x13b);return undefined;}async[a34_0x9bfb35(0x15e)](_0x1f0807){const _0x256f48=a34_0x9bfb35,{options:_0x121ffe,args:_0x293e8a,tdx:_0x44d0af}=_0x1f0807,_0x35dc70=_0x293e8a[0x0],_0x57149a=await withSpinner(_0x256f48(0x112),()=>_0x44d0af['schedules'][_0x256f48(0x150)](_0x35dc70),{'verbose':_0x121ffe[_0x256f48(0x125)]}),_0x535214=_0x57149a[_0x256f48(0x11d)],_0xbd3e0c={'name':_0x535214['name'],'cron':_0x535214[_0x256f48(0x16c)],'database':_0x535214[_0x256f48(0x178)],'type':_0x535214['type'],'timezone':_0x535214[_0x256f48(0x14c)],'user_name':_0x535214[_0x256f48(0x145)],'created_at':_0x535214[_0x256f48(0x187)],'engine_version':_0x535214['engine_version'],'executing_user_id':_0x535214[_0x256f48(0x13e)],'query':_0x535214['query'],'delay':_0x535214['delay'],'priority':_0x535214['priority'],'retry_limit':_0x535214[_0x256f48(0x161)],..._0x535214[_0x256f48(0x173)]&&{'result':_0x535214[_0x256f48(0x173)]}};return await handleSingleObjectOutput(_0xbd3e0c,_0x121ffe),0x0;}}function a34_0xcb4f(_0x24dd3d,_0x39d8a3){_0x24dd3d=_0x24dd3d-0x107;const _0x2ebe3e=a34_0x2ebe();let _0xcb4f6a=_0x2ebe3e[_0x24dd3d];return _0xcb4f6a;}export class ScheduleCreateCommand extends BaseCommand{[a34_0x9bfb35(0x140)]=a34_0x9bfb35(0x143);[a34_0x9bfb35(0x14d)]=a34_0x9bfb35(0x12f);[a34_0x9bfb35(0x14b)](_0x24d00c){const _0x3ac86f=a34_0x9bfb35,_0x45146e=_0x24d00c[_0x3ac86f(0x135)][0x0];if(!_0x45146e)return'Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20create\x20<name>\x20-d\x20<db>\x20--file\x20<path>\x20[options]';const _0xf6dcff=_0x24d00c[_0x3ac86f(0x12a)];if(!_0xf6dcff[_0x3ac86f(0x178)])return _0x3ac86f(0x115);return undefined;}async[a34_0x9bfb35(0x15e)](_0x543d9c){const _0x421ba8=a34_0x9bfb35,{options:_0x21618c,args:_0x32aba0,tdx:_0x5290e8}=_0x543d9c,_0x1ae80b=_0x32aba0[0x0],_0x32e6dc=_0x21618c,_0x3ae393=_0x32e6dc[_0x421ba8(0x178)],_0x37b4fa=_0x32e6dc['file'],_0x56b2fb=_0x32e6dc[_0x421ba8(0x138)]||'trino';let _0x325683;try{_0x325683=readFileSync(_0x37b4fa,'utf-8')[_0x421ba8(0x16b)]();}catch(_0x2370a9){throw new SDKError(ErrorCode['INVALID_ARGUMENT'],'Failed\x20to\x20read\x20file:\x20'+_0x37b4fa,_0x2370a9 instanceof Error?_0x2370a9:undefined);}if(!_0x325683)throw new SDKError(ErrorCode[_0x421ba8(0x16e)],_0x421ba8(0x177));const _0x668d4f={'database':_0x3ae393,'query':_0x325683,'type':_0x56b2fb};if(_0x32e6dc['cron'])_0x668d4f[_0x421ba8(0x16c)]=_0x32e6dc['cron'];if(_0x32e6dc[_0x421ba8(0x14c)])_0x668d4f[_0x421ba8(0x14c)]=_0x32e6dc['timezone'];if(_0x32e6dc[_0x421ba8(0x196)]!==undefined)_0x668d4f[_0x421ba8(0x196)]=Number(_0x32e6dc[_0x421ba8(0x196)]);if(_0x32e6dc[_0x421ba8(0x110)]!==undefined)_0x668d4f[_0x421ba8(0x110)]=Number(_0x32e6dc[_0x421ba8(0x110)]);if(_0x32e6dc[_0x421ba8(0x10c)]!==undefined)_0x668d4f[_0x421ba8(0x161)]=Number(_0x32e6dc['retryLimit']);if(_0x32e6dc[_0x421ba8(0x12e)])_0x668d4f[_0x421ba8(0x171)]=_0x32e6dc[_0x421ba8(0x12e)];if(_0x32e6dc[_0x421ba8(0x173)])_0x668d4f[_0x421ba8(0x173)]=_0x32e6dc[_0x421ba8(0x173)];if(_0x21618c[_0x421ba8(0x125)]){console[_0x421ba8(0x13d)](_0x421ba8(0x142)+_0x1ae80b),console[_0x421ba8(0x13d)](_0x421ba8(0x14e)+_0x3ae393),console[_0x421ba8(0x13d)]('\x20\x20Type:\x20'+_0x56b2fb);if(_0x668d4f[_0x421ba8(0x16c)])console[_0x421ba8(0x13d)](_0x421ba8(0x14a)+_0x668d4f[_0x421ba8(0x16c)]);if(_0x668d4f[_0x421ba8(0x14c)])console[_0x421ba8(0x13d)](_0x421ba8(0x158)+_0x668d4f['timezone']);}const _0x4b06cd=await withSpinner(_0x421ba8(0x16a),()=>_0x5290e8[_0x421ba8(0x18f)][_0x421ba8(0x16d)](_0x1ae80b,_0x668d4f),{'verbose':_0x21618c[_0x421ba8(0x125)]});return console['error'](_0x421ba8(0x15f)+_0x4b06cd['data']['name']),await handleSingleObjectOutput(_0x4b06cd[_0x421ba8(0x11d)],_0x21618c),0x0;}}export class ScheduleUpdateCommand extends BaseCommand{['name']=a34_0x9bfb35(0x12c);['description']=a34_0x9bfb35(0x19d);[a34_0x9bfb35(0x14b)](_0x3e0660){const _0x362048=a34_0x9bfb35,_0x394b33=_0x3e0660[_0x362048(0x135)][0x0];if(!_0x394b33)return'Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20update\x20<name>\x20[options]';return undefined;}async[a34_0x9bfb35(0x15e)](_0x693fde){const _0x12c391=a34_0x9bfb35,{options:_0xb1548e,args:_0x826e7b,tdx:_0x3bcae3}=_0x693fde,_0x530b24=_0x826e7b[0x0],_0x2e68f9=_0xb1548e,_0x375993={};if(_0x2e68f9[_0x12c391(0x178)])_0x375993[_0x12c391(0x178)]=_0x2e68f9['database'];if(_0x2e68f9['type'])_0x375993[_0x12c391(0x138)]=_0x2e68f9['type'];if(_0x2e68f9[_0x12c391(0x16c)])_0x375993['cron']=_0x2e68f9[_0x12c391(0x16c)];if(_0x2e68f9[_0x12c391(0x14c)])_0x375993[_0x12c391(0x14c)]=_0x2e68f9[_0x12c391(0x14c)];if(_0x2e68f9['delay']!==undefined)_0x375993['delay']=Number(_0x2e68f9[_0x12c391(0x196)]);if(_0x2e68f9['priority']!==undefined)_0x375993[_0x12c391(0x110)]=Number(_0x2e68f9['priority']);if(_0x2e68f9[_0x12c391(0x10c)]!==undefined)_0x375993[_0x12c391(0x161)]=Number(_0x2e68f9['retryLimit']);if(_0x2e68f9['engineVersion'])_0x375993[_0x12c391(0x171)]=_0x2e68f9[_0x12c391(0x12e)];if(_0x2e68f9[_0x12c391(0x173)])_0x375993[_0x12c391(0x173)]=_0x2e68f9['result'];if(_0x2e68f9['file'])try{_0x375993[_0x12c391(0x1a0)]=readFileSync(_0x2e68f9[_0x12c391(0x148)],_0x12c391(0x12d))[_0x12c391(0x16b)]();}catch(_0x511af1){throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x12c391(0x193)+_0x2e68f9[_0x12c391(0x148)],_0x511af1 instanceof Error?_0x511af1:undefined);}if(Object[_0x12c391(0x189)](_0x375993)[_0x12c391(0x18c)]===0x0)throw new SDKError(ErrorCode[_0x12c391(0x16e)],_0x12c391(0x127));if(_0xb1548e['verbose']){console['error'](_0x12c391(0x139)+_0x530b24);for(const [_0x16e2d0,_0x7b0fca]of Object[_0x12c391(0x197)](_0x375993)){_0x16e2d0===_0x12c391(0x1a0)?console['error']('\x20\x20'+_0x16e2d0+':\x20'+_0x7b0fca[_0x12c391(0x17a)](0x0,0x32)+_0x12c391(0x160)):console[_0x12c391(0x13d)]('\x20\x20'+_0x16e2d0+':\x20'+_0x7b0fca);}}const _0x2611f3=await withSpinner(_0x12c391(0x11c),()=>_0x3bcae3[_0x12c391(0x18f)][_0x12c391(0x165)](_0x530b24,_0x375993),{'verbose':_0xb1548e['verbose']});return console[_0x12c391(0x13d)](_0x12c391(0x11a)+_0x2611f3['data'][_0x12c391(0x140)]),await handleSingleObjectOutput(_0x2611f3[_0x12c391(0x11d)],_0xb1548e),0x0;}}export class ScheduleDeleteCommand extends BaseCommand{[a34_0x9bfb35(0x140)]=a34_0x9bfb35(0x190);[a34_0x9bfb35(0x14d)]=a34_0x9bfb35(0x17d);['validate'](_0xce91b){const _0x1fc1ed=a34_0x9bfb35,_0x335979=_0xce91b[_0x1fc1ed(0x135)][0x0];if(!_0x335979)return _0x1fc1ed(0x162);return undefined;}async[a34_0x9bfb35(0x15e)](_0x1684f0){const _0x13cd89=a34_0x9bfb35,{options:_0x5476fe,args:_0x378243,tdx:_0x15d0cf}=_0x1684f0,_0x5ae915=_0x378243[0x0];if(!_0x5476fe['yes']){const _0x5b0c89=await confirm(_0x13cd89(0x181)+_0x5ae915+'\x22?');if(!_0x5b0c89)return console[_0x13cd89(0x13d)](_0x13cd89(0x179)),0x0;}const _0xfda51f=await withSpinner(_0x13cd89(0x117),()=>_0x15d0cf[_0x13cd89(0x18f)][_0x13cd89(0x107)](_0x5ae915),{'verbose':_0x5476fe[_0x13cd89(0x125)]});return console[_0x13cd89(0x13d)](_0x13cd89(0x192)+_0xfda51f[_0x13cd89(0x11d)][_0x13cd89(0x140)]),0x0;}}export class ScheduleRunCommand extends BaseCommand{[a34_0x9bfb35(0x140)]=a34_0x9bfb35(0x111);[a34_0x9bfb35(0x14d)]=a34_0x9bfb35(0x166);['validate'](_0x573f17){const _0x571df2=a34_0x9bfb35,_0x57ce8d=_0x573f17[_0x571df2(0x135)][0x0];if(!_0x57ce8d)return _0x571df2(0x19a);return undefined;}async[a34_0x9bfb35(0x15e)](_0x161429){const _0xe58d9c=a34_0x9bfb35,{options:_0x6efc28,args:_0x4241cd,tdx:_0x5670b1}=_0x161429,_0x616b53=_0x4241cd[0x0],_0x18234e=_0x6efc28,_0x1d0658=_0x18234e[_0xe58d9c(0x176)],_0x5caa55=_0x18234e[_0xe58d9c(0x19c)]!==undefined?Number(_0x18234e[_0xe58d9c(0x19c)]):undefined;if(_0x6efc28[_0xe58d9c(0x125)]){console[_0xe58d9c(0x13d)]('Running\x20schedule:\x20'+_0x616b53);if(_0x1d0658)console[_0xe58d9c(0x13d)](_0xe58d9c(0x113)+_0x1d0658);if(_0x5caa55)console[_0xe58d9c(0x13d)](_0xe58d9c(0x128)+_0x5caa55);}const _0xdfc6f8=await withSpinner(_0xe58d9c(0x10b),()=>_0x5670b1[_0xe58d9c(0x18f)]['run'](_0x616b53,{'time':_0x1d0658,'num':_0x5caa55}),{'verbose':_0x6efc28[_0xe58d9c(0x125)]}),_0x1a581f=_0xdfc6f8[_0xe58d9c(0x11d)]['jobs'];console[_0xe58d9c(0x13d)]('Schedule\x20run\x20submitted:\x20'+_0x1a581f['length']+_0xe58d9c(0x157)+(_0x1a581f['length']!==0x1?'s':'')+_0xe58d9c(0x18b));for(const _0x47b8e1 of _0x1a581f){console['error'](_0xe58d9c(0x185)+_0x47b8e1[_0xe58d9c(0x168)]);}return await handleSDKOutput(_0x1a581f,_0x6efc28),0x0;}}export class ScheduleHistoryCommand extends BaseCommand{[a34_0x9bfb35(0x140)]=a34_0x9bfb35(0x10f);[a34_0x9bfb35(0x14d)]=a34_0x9bfb35(0x199);['validate'](_0x4edf08){const _0x313bf7=a34_0x9bfb35,_0x26bd68=_0x4edf08[_0x313bf7(0x135)][0x0];if(!_0x26bd68)return _0x313bf7(0x10a);return undefined;}async['execute'](_0x3c74f5){const _0x4ebc09=a34_0x9bfb35,{options:_0x3d7d4b,args:_0x340d98,tdx:_0x47167f}=_0x3c74f5,_0x368ca9=_0x340d98[0x0],_0x2d5b01=_0x3d7d4b,_0x57b7c6=_0x2d5b01[_0x4ebc09(0x198)]!==undefined?Number(_0x2d5b01[_0x4ebc09(0x198)]):undefined,_0x4823c9=_0x2d5b01['to']!==undefined?Number(_0x2d5b01['to']):undefined,_0x1da94a=await withSpinner('Getting\x20schedule\x20history...',()=>_0x47167f['schedules'][_0x4ebc09(0x134)](_0x368ca9,{'from':_0x57b7c6,'to':_0x4823c9}),{'verbose':_0x3d7d4b[_0x4ebc09(0x125)]}),_0xef89ec=_0x1da94a[_0x4ebc09(0x11d)];console[_0x4ebc09(0x13d)](_0x4ebc09(0x154)+_0xef89ec[_0x4ebc09(0x19e)]+_0x4ebc09(0x17f)+(_0xef89ec[_0x4ebc09(0x19e)]!==0x1?'s':'')+_0x4ebc09(0x163)+_0xef89ec[_0x4ebc09(0x198)]+'-'+_0xef89ec['to']+')');const _0x222059=_0xef89ec[_0x4ebc09(0x134)][_0x4ebc09(0x175)](_0x91d754=>({'job_id':_0x91d754['job_id'],'type':_0x91d754[_0x4ebc09(0x138)],'status':_0x91d754[_0x4ebc09(0x147)],'scheduled_at':_0x91d754[_0x4ebc09(0x153)],'created_at':_0x91d754[_0x4ebc09(0x187)],'start_at':_0x91d754['start_at'],'end_at':_0x91d754[_0x4ebc09(0x15d)]}));return await handleSDKOutput(_0x222059,_0x3d7d4b),0x0;}}
@@ -1 +1 @@
1
- const a35_0xcd4784=a35_0x23e7;(function(_0x1ed834,_0x14137d){const _0x2f8f92=a35_0x23e7,_0xbef112=_0x1ed834();while(!![]){try{const _0x1ffa67=-parseInt(_0x2f8f92(0x27f))/0x1+parseInt(_0x2f8f92(0x209))/0x2*(-parseInt(_0x2f8f92(0x264))/0x3)+-parseInt(_0x2f8f92(0x228))/0x4*(parseInt(_0x2f8f92(0x26d))/0x5)+-parseInt(_0x2f8f92(0x1ff))/0x6+parseInt(_0x2f8f92(0x1eb))/0x7*(-parseInt(_0x2f8f92(0x272))/0x8)+parseInt(_0x2f8f92(0x21f))/0x9+parseInt(_0x2f8f92(0x219))/0xa;if(_0x1ffa67===_0x14137d)break;else _0xbef112['push'](_0xbef112['shift']());}catch(_0x522ba7){_0xbef112['push'](_0xbef112['shift']());}}}(a35_0xbb56,0xbf60a));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner,formatElapsed}from'../utils/spinner.js';import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';function a35_0x23e7(_0x4632fc,_0x1e7f41){_0x4632fc=_0x4632fc-0x1da;const _0xbb5671=a35_0xbb56();let _0x23e7ab=_0xbb5671[_0x4632fc];return _0x23e7ab;}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';function a35_0xbb56(){const _0x5dc2d1=['Error:\x20Cannot\x20execute\x20query\x20for\x20parent\x20segment\x20with\x20this\x20command.','log','Error:\x20Cannot\x20show\x20schema\x20for\x20a\x20folder.','segment:folder:list','segment','Resolved\x20YAML\x20file:\x20','Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.\x20Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','json','996737mFYmUA','folder','Segment\x20ID:\x20','resolvePathToResource','Use:\x20tdx\x20ps\x20desc','toLocaleString','Fetching\x20SQL\x20for\x20segment...','getSQLFromServerSegment','\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','length','content','Error:\x20Folder\x20or\x20segment\x20name,\x20or\x20YAML\x20file\x20path\x20is\x20required','Folder\x20ID\x20missing\x20from\x20resolved\x20path','Resolved\x20parent\x20ID:\x20','red','\x20\x20tdx\x20sg\x20sql\x20\x22Premium\x20Users\x22','SEGMENT_FOLDER_NOT_FOUND','limit','Error:\x20','\x20\x20-w,\x20--web\x20\x20Open\x20segment\x20in\x20web\x20browser','6674070WyJYoJ','Use:\x20tdx\x20ps\x20show','Fetching\x20folder\x20details...','Fetching\x20segment\x20details...','Error:\x20Cannot\x20open\x20folder\x20in\x20web\x20browser.\x20Use\x20a\x20segment\x20name\x20instead.','segmentPath','parentId','Resolved\x20folder\x20ID:\x20','\x20\x20Cause:\x20','path','190qEQVjr','data','Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>','SQL\x20query:\x0a','Error:\x20Specify\x20either\x20segment\x20name\x20or\x20--path,\x20not\x20both','listFolders','Use:\x20tdx\x20sg\x20view\x20<name>\x20\x20#\x20To\x20show\x20folder\x20details','Get\x20SQL\x20query\x20for\x20child\x20segment','\x20\x20Server-side\x20segment:\x20\x20tdx\x20sg\x20sql\x20<name>','Parent\x20ID:\x20','green','parent','Use:\x20tdx\x20ps\x20view','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','getSQLFromYamlFile','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','42308000kKrxry','βœ–\x20Query\x20failed\x20[','Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)','web','getSegment','\x20\x20tdx\x20sg\x20show\x20\x22Premium\x20Users\x22','13776624mWudSx','cause','verbose','segment:view','segment:show','getSegmentSQLFromYaml','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','jsonl','site','5457044YGbUSI','in\x20','Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>','Folder\x20ID:\x20','Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required','Fetching\x20parent\x20segment\x20details...','folderId','Examples:','Site:\x20','SELECT\x20*\x20FROM\x20(\x0a','Error:\x20YAML\x20file\x20paths\x20must\x20be\x20specified\x20with\x20--path\x20option','type','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22','βœ”\x20Query\x20completed:\x20Processed\x20','\x20rows\x20','Folder\x20name:\x20','/e/','processedRows','\x20\x20tdx\x20sg\x20sql\x20--path\x20segments/my-audience/premium-users.yml','Fetching\x20SQL\x20from\x20rule...','segmentName','createFolder','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20-w\x20\x20#\x20Open\x20segment\x20in\x20web\x20browser','execute','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22','jobId','Resolving\x20\x27','\x27...','Creating\x20folder\x20\x27','getFolder','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20view\x20<path/to/segment.yml>','\x20\x20tdx\x20sg\x20show\x20segments/my-audience/premium-users.yml','Segment\x20ID\x20missing\x20from\x20resolved\x20path','message','Executing\x20segment\x20query...','segment:sql','getParent','resolveParentId','resolveFolderId','Target\x20path:\x20','(root)','\x20\x20Folder\x20path:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20show\x20<path/to/segment.yml>','segment:describe','parentSegment','segment:folder:create','Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]','Resolved\x20relative\x20path\x20to:\x20','Error:\x20Segment\x20name\x20or\x20--path\x20is\x20required','/app/ps/','parentFolder','fullPath','information_schema','\x20\x20tdx\x20sg\x20sql\x20--path\x20','\x20\x20Full\x20path:\x20','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20\x20\x20\x20\x20#\x20View\x20child\x20segment\x20details','stats','query','Resolving\x20parent\x20segment\x20\x27','Error:\x20Cannot\x20open\x20parent\x20segment\x20with\x20this\x20command.','25143NxvuUv','folderPath','Fetching\x20folder\x20\x27','\x20folder','SEGMENT_NOT_FOUND','INVALID_ARGUMENT','Usage:\x20tdx\x20sg\x20desc\x20<name>','\x27\x20with\x20ID:\x20','Usage:','5zViHgE','Parent\x20name:\x20','Resolving\x20path\x20\x27','Error:\x20Parent\x20segment\x20name\x20is\x20required','βœ”\x20Created\x20folder\x20\x27','40pqxRsN','description','trim','Resolved\x20parent\x20folder\x20ID:\x20','segmentId','Error:\x20Cannot\x20show\x20schema\x20for\x20parent\x20segment\x20with\x20this\x20command.','name','Resolved\x20type:\x20','code','Options:','setJobId','Show\x20child\x20segment\x20schema\x20(column\x20types)','\x20\x20Parent\x20segment:\x20','992898VCwgOz','error','segment:folder:show','\x20\x20Segment\x20name:\x20','Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required','\x20[Job\x20ID:\x20','format','\x20\x20tdx\x20sg\x20desc\x20segments/my-audience/premium-users.yml','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20desc\x20<path/to/segment.yml>','Use:\x20tdx\x20ps\x20view\x20-w','Resolved:\x20','Resolving\x20parent\x20folder\x20\x27'];a35_0xbb56=function(){return _0x5dc2d1;};return a35_0xbb56();}import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{openBrowser}from'../utils/process.js';import a35_0x46420a from'chalk';async function resolveSegmentTarget(_0x11ead4,_0x4b4479,_0x1dde3a){const _0x4a32da=a35_0x23e7;if(isYamlFilePath(_0x11ead4))try{const _0x5b47d8=await resolveYamlFilePath(_0x11ead4);return _0x1dde3a&&(console[_0x4a32da(0x280)](_0x4a32da(0x1e8)+_0x11ead4),console['error'](_0x4a32da(0x27e)+_0x5b47d8[_0x4a32da(0x254)]),console[_0x4a32da(0x280)](_0x4a32da(0x1da)+_0x5b47d8[_0x4a32da(0x23c)]),console[_0x4a32da(0x280)](_0x4a32da(0x251)+(_0x5b47d8[_0x4a32da(0x265)]||_0x4a32da(0x250))),console[_0x4a32da(0x280)](_0x4a32da(0x25e)+_0x5b47d8['fullPath'])),_0x5b47d8[_0x4a32da(0x25b)];}catch(_0x385a7d){throw new SDKError(ErrorCode[_0x4a32da(0x269)],_0x4a32da(0x218)+_0x385a7d['message']);}if(!_0x4b4479)throw new SDKError(ErrorCode[_0x4a32da(0x269)],'No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22');return _0x4b4479+'/'+_0x11ead4;}export class SegmentDescribeCommand extends BaseCommand{[a35_0xcd4784(0x278)]=a35_0xcd4784(0x253);[a35_0xcd4784(0x273)]='Show\x20segment\x20or\x20folder\x20details';async[a35_0xcd4784(0x23f)](_0x35addb){const _0x16ac65=a35_0xcd4784,{options:_0x33f47c,args:_0x405506,tdx:_0x12bd05}=_0x35addb,_0x184314=_0x405506[0x0],_0x26caed=!_0x184314&&!!_0x33f47c[_0x16ac65(0x254)],_0x338f47=_0x184314||_0x33f47c[_0x16ac65(0x254)];if(!_0x338f47)return console[_0x16ac65(0x280)]('Error:\x20Path\x20or\x20name\x20is\x20required'),console[_0x16ac65(0x280)]('Usage:\x20tdx\x20segment\x20describe\x20<path>'),console[_0x16ac65(0x280)](_0x16ac65(0x22f)),console[_0x16ac65(0x280)](_0x16ac65(0x240)),console['error'](_0x16ac65(0x234)),console[_0x16ac65(0x280)](_0x16ac65(0x1f3)),console[_0x16ac65(0x280)](_0x16ac65(0x225)),0x1;try{const _0x415d85=_0x33f47c[_0x16ac65(0x204)];let _0x4d6a9b=_0x338f47;!_0x26caed&&_0x415d85&&!_0x338f47['includes']('/')&&(_0x4d6a9b=_0x415d85+'/'+_0x338f47,_0x33f47c[_0x16ac65(0x221)]&&console[_0x16ac65(0x280)](_0x16ac65(0x257)+_0x4d6a9b));const _0x3dba7e=await withSpinner(_0x16ac65(0x26f)+_0x4d6a9b+_0x16ac65(0x243),()=>_0x12bd05['segment']['resolvePathToResource'](_0x4d6a9b),{'verbose':_0x33f47c['verbose']}),_0xd894e0=_0x3dba7e[_0x16ac65(0x20a)];_0x33f47c['verbose']&&(console[_0x16ac65(0x280)](_0x16ac65(0x279)+_0xd894e0[_0x16ac65(0x233)]),console[_0x16ac65(0x280)]('Parent\x20ID:\x20'+_0xd894e0[_0x16ac65(0x205)]),_0xd894e0[_0x16ac65(0x22e)]&&console[_0x16ac65(0x280)](_0x16ac65(0x22b)+_0xd894e0[_0x16ac65(0x22e)]),_0xd894e0[_0x16ac65(0x276)]&&console[_0x16ac65(0x280)](_0x16ac65(0x1ed)+_0xd894e0['segmentId']));if(_0xd894e0[_0x16ac65(0x233)]===_0x16ac65(0x214)){const _0x3398c1=await withSpinner(_0x16ac65(0x22d),()=>_0x12bd05[_0x16ac65(0x1e7)][_0x16ac65(0x24c)](_0xd894e0[_0x16ac65(0x205)]),{'verbose':_0x33f47c['verbose']});await handleSingleObjectOutput(_0x3398c1[_0x16ac65(0x20a)],_0x33f47c);}else{if(_0xd894e0[_0x16ac65(0x233)]===_0x16ac65(0x1ec)){if(!_0xd894e0[_0x16ac65(0x22e)])throw new SDKError(ErrorCode[_0x16ac65(0x1fb)],_0x16ac65(0x1f7));const _0x201fad=await withSpinner('Fetching\x20folder\x20details...',()=>_0x12bd05[_0x16ac65(0x1e7)]['getFolder'](_0xd894e0[_0x16ac65(0x22e)]),{'verbose':_0x33f47c[_0x16ac65(0x221)]});await handleSingleObjectOutput(_0x201fad[_0x16ac65(0x20a)],_0x33f47c);}else{if(_0xd894e0['type']===_0x16ac65(0x1e7)){if(!_0xd894e0['segmentId'])throw new SDKError(ErrorCode[_0x16ac65(0x268)],_0x16ac65(0x248));const _0x38d2ba=await withSpinner(_0x16ac65(0x202),()=>_0x12bd05[_0x16ac65(0x1e7)][_0x16ac65(0x21d)](_0xd894e0[_0x16ac65(0x205)],_0xd894e0[_0x16ac65(0x276)]),{'verbose':_0x33f47c[_0x16ac65(0x221)]});await handleSingleObjectOutput(_0x38d2ba[_0x16ac65(0x20a)],_0x33f47c);}}}return 0x0;}catch(_0x642490){if(_0x642490 instanceof SDKError)return console[_0x16ac65(0x280)](_0x16ac65(0x1fd)+_0x642490[_0x16ac65(0x249)]),_0x642490[_0x16ac65(0x220)]&&console['error'](_0x16ac65(0x207)+_0x642490[_0x16ac65(0x220)]),0x1;throw _0x642490;}}}export class SegmentShowCommand extends BaseCommand{[a35_0xcd4784(0x278)]=a35_0xcd4784(0x223);[a35_0xcd4784(0x273)]='Execute\x20child\x20segment\x20SQL\x20query\x20and\x20show\x20results';async[a35_0xcd4784(0x23f)](_0x4d940c){const _0xf5c438=a35_0xcd4784,{options:_0x4f8651,args:_0x551f9c,tdx:_0xbb435e}=_0x4d940c,_0x124a19=_0x551f9c[0x0];if(!_0x124a19)return console[_0xf5c438(0x280)](_0xf5c438(0x1db)),console[_0xf5c438(0x280)]('Usage:\x20tdx\x20sg\x20show\x20<name>'),console[_0xf5c438(0x280)](_0xf5c438(0x252)),console[_0xf5c438(0x280)](_0xf5c438(0x22f)),console[_0xf5c438(0x280)](_0xf5c438(0x21e)),console['error'](_0xf5c438(0x247)),0x1;try{const _0x2c012a=_0x4f8651['parentSegment'],_0x53faf9=await resolveSegmentTarget(_0x124a19,_0x2c012a,_0x4f8651['verbose']);_0x4f8651[_0xf5c438(0x221)]&&console[_0xf5c438(0x280)](_0xf5c438(0x24f)+_0x53faf9);const _0x15ad44=await withSpinner(_0xf5c438(0x242)+_0x124a19+_0xf5c438(0x243),()=>_0xbb435e['segment'][_0xf5c438(0x1ee)](_0x53faf9),{'verbose':_0x4f8651[_0xf5c438(0x221)]}),_0x2bc697=_0x15ad44[_0xf5c438(0x20a)];_0x4f8651[_0xf5c438(0x221)]&&(console[_0xf5c438(0x280)]('Resolved\x20type:\x20'+_0x2bc697[_0xf5c438(0x233)]),console[_0xf5c438(0x280)](_0xf5c438(0x212)+_0x2bc697['parentId']));if(_0x2bc697[_0xf5c438(0x233)]===_0xf5c438(0x1ec))return console[_0xf5c438(0x280)]('Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.'),console[_0xf5c438(0x280)](_0xf5c438(0x20f)),0x1;if(_0x2bc697[_0xf5c438(0x233)]===_0xf5c438(0x214))return console['error'](_0xf5c438(0x1e3)),console[_0xf5c438(0x280)](_0xf5c438(0x200)),0x1;if(!_0x2bc697[_0xf5c438(0x276)])throw new SDKError(ErrorCode[_0xf5c438(0x268)],_0xf5c438(0x248));const _0x276cdb=await withSpinner(_0xf5c438(0x1f1),()=>_0xbb435e['segment']['getSegmentSQL'](_0x2bc697[_0xf5c438(0x205)],_0x2bc697[_0xf5c438(0x276)]),{'verbose':_0x4f8651[_0xf5c438(0x221)]});let _0xb5b519=_0x276cdb['data'];const _0x22d0ce=resolveLimit(_0x4f8651[_0xf5c438(0x1fc)],DEFAULT_DISPLAY_LIMIT),_0x4c35d9=/\bLIMIT\s+\d+/i['test'](_0xb5b519);!_0x4c35d9&&(_0xb5b519=_0xb5b519[_0xf5c438(0x274)]()['replace'](/;+$/,''),_0xb5b519=_0xf5c438(0x231)+_0xb5b519+'\x0a)\x20AS\x20segment_query\x0aLIMIT\x20'+_0x22d0ce);_0x4f8651['verbose']&&console[_0xf5c438(0x280)](_0xf5c438(0x20c)+_0xb5b519);const _0x2637ef=await withProgressSpinner(_0xf5c438(0x24a),async _0x44a2fd=>{const _0x4bfa29=_0xf5c438,_0x5bb04d=await _0xbb435e[_0x4bfa29(0x261)][_0x4bfa29(0x23f)](_0xb5b519,{'catalog':'td','schema':_0x4bfa29(0x25c),'onJobId':_0x337e7c=>{const _0x5bfbc3=_0x4bfa29;_0x44a2fd[_0x5bfbc3(0x27c)](_0x337e7c);}});return _0x5bb04d;},{'verbose':_0x4f8651[_0xf5c438(0x221)]}),_0x42af68=_0x2637ef[_0xf5c438(0x20a)],_0x3c4065=_0x42af68[_0xf5c438(0x241)]?_0xf5c438(0x1dc)+_0x42af68[_0xf5c438(0x241)]+']':'';return console['error'](_0xf5c438(0x235)+_0x42af68[_0xf5c438(0x260)][_0xf5c438(0x239)][_0xf5c438(0x1f0)]()+_0xf5c438(0x236)+(_0xf5c438(0x229)+formatElapsed(_0x42af68[_0xf5c438(0x260)]['elapsedTimeMillis'])+_0x3c4065)),await handleQueryOutput(_0x42af68,_0x4f8651),0x0;}catch(_0x3dfdaa){if(_0x3dfdaa instanceof SDKError)return console[_0xf5c438(0x280)](_0xf5c438(0x21a)+_0x3dfdaa[_0xf5c438(0x27a)]+']'),console[_0xf5c438(0x280)]('\x0a'+_0x3dfdaa[_0xf5c438(0x249)]),0x1;throw _0x3dfdaa;}}}export class SegmentFolderListCommand extends BaseCommand{[a35_0xcd4784(0x278)]=a35_0xcd4784(0x1e6);[a35_0xcd4784(0x273)]='List\x20segment\x20folders\x20under\x20a\x20parent\x20segment';async['execute'](_0x2a986c){const _0x4e8f8d=a35_0xcd4784,{options:_0x5a62f8,args:_0x30806e,tdx:_0x4491f6}=_0x2a986c;if(_0x30806e['length']===0x0)return console[_0x4e8f8d(0x280)](_0x4e8f8d(0x270)),console[_0x4e8f8d(0x280)](_0x4e8f8d(0x20b)),0x1;const _0xdbbfe6=_0x30806e[0x0];try{_0x5a62f8[_0x4e8f8d(0x221)]&&(console['error'](_0x4e8f8d(0x230)+_0x5a62f8['site']),console[_0x4e8f8d(0x280)](_0x4e8f8d(0x26e)+_0xdbbfe6));const _0x3ee60b=await withSpinner(_0x4e8f8d(0x262)+_0xdbbfe6+'\x27...',()=>_0x4491f6['segment'][_0x4e8f8d(0x24d)](_0xdbbfe6),{'verbose':_0x5a62f8[_0x4e8f8d(0x221)]}),_0x280325=_0x3ee60b['data'];_0x5a62f8[_0x4e8f8d(0x221)]&&console[_0x4e8f8d(0x280)](_0x4e8f8d(0x1f8)+_0x280325);const _0x2df397=await withSpinner('Listing\x20folders\x20for\x20parent\x20\x27'+_0xdbbfe6+_0x4e8f8d(0x243),()=>_0x4491f6[_0x4e8f8d(0x1e7)][_0x4e8f8d(0x20e)](_0x280325),{'verbose':_0x5a62f8[_0x4e8f8d(0x221)]}),_0x231237=_0x2df397['data'];return console[_0x4e8f8d(0x280)]('βœ”\x20Found\x20'+_0x231237['length']+_0x4e8f8d(0x267)+(_0x231237[_0x4e8f8d(0x1f4)]!==0x1?'s':'')),await handleSDKOutput(_0x231237,_0x5a62f8),0x0;}catch(_0x4d5b9c){if(_0x4d5b9c instanceof SDKError)return console[_0x4e8f8d(0x280)]('Error:\x20'+_0x4d5b9c[_0x4e8f8d(0x249)]),_0x4d5b9c[_0x4e8f8d(0x220)]&&console[_0x4e8f8d(0x280)]('\x20\x20Cause:\x20'+_0x4d5b9c[_0x4e8f8d(0x220)]),0x1;throw _0x4d5b9c;}}}export class SegmentFolderShowCommand extends BaseCommand{['name']=a35_0xcd4784(0x281);[a35_0xcd4784(0x273)]='Show\x20segment\x20folder\x20details';async[a35_0xcd4784(0x23f)](_0x4798d7){const _0x3b6477=a35_0xcd4784,{options:_0x223a13,args:_0x36d9d9,tdx:_0x421944}=_0x4798d7;if(_0x36d9d9[_0x3b6477(0x1f4)]===0x0)return console[_0x3b6477(0x280)]('Error:\x20Folder\x20reference\x20is\x20required'),console[_0x3b6477(0x280)](_0x3b6477(0x22a)),0x1;try{const {parentId:_0x164906,childId:_0xdac675}=parseSegmentRef(_0x36d9d9[0x0]);_0x223a13['verbose']&&(console['error'](_0x3b6477(0x230)+_0x223a13[_0x3b6477(0x227)]),console[_0x3b6477(0x280)](_0x3b6477(0x26e)+_0x164906),_0xdac675&&console[_0x3b6477(0x280)]('Folder\x20name:\x20'+_0xdac675));if(!_0xdac675)return console[_0x3b6477(0x280)](_0x3b6477(0x21b)),0x1;const _0x4ef387=await withSpinner(_0x3b6477(0x262)+_0x164906+_0x3b6477(0x243),()=>_0x421944['segment'][_0x3b6477(0x24d)](_0x164906),{'verbose':_0x223a13['verbose']}),_0x959b6b=_0x4ef387[_0x3b6477(0x20a)];_0x223a13['verbose']&&console[_0x3b6477(0x280)](_0x3b6477(0x1f8)+_0x959b6b);const _0x3a350e=await withSpinner('Resolving\x20folder\x20\x27'+_0xdac675+_0x3b6477(0x243),()=>_0x421944[_0x3b6477(0x1e7)]['resolveFolderId'](_0x959b6b,_0xdac675),{'verbose':_0x223a13['verbose']}),_0x327dca=_0x3a350e[_0x3b6477(0x20a)];_0x223a13['verbose']&&console[_0x3b6477(0x280)](_0x3b6477(0x206)+_0x327dca);const _0xcdce65=await withSpinner(_0x3b6477(0x266)+_0xdac675+'\x27...',()=>_0x421944[_0x3b6477(0x1e7)]['getFolder'](_0x327dca),{'verbose':_0x223a13[_0x3b6477(0x221)]});return await handleSDKOutput([_0xcdce65[_0x3b6477(0x20a)]],_0x223a13),0x0;}catch(_0xc97d05){if(_0xc97d05 instanceof SDKError)return console[_0x3b6477(0x280)]('Error:\x20'+_0xc97d05[_0x3b6477(0x249)]),_0xc97d05['cause']&&console[_0x3b6477(0x280)]('\x20\x20Cause:\x20'+_0xc97d05[_0x3b6477(0x220)]),0x1;throw _0xc97d05;}}}export class SegmentSQLCommand extends BaseCommand{[a35_0xcd4784(0x278)]=a35_0xcd4784(0x24b);['description']=a35_0xcd4784(0x210);async[a35_0xcd4784(0x23f)](_0x52587a){const _0xe8dda8=a35_0xcd4784,{options:_0x41a95c,args:_0x41f5bf}=_0x52587a,_0x20cf25=_0x41a95c,_0x2520c8=_0x20cf25[_0xe8dda8(0x208)],_0x2de303=_0x41f5bf[0x0];if(!_0x2de303&&!_0x2520c8)return console[_0xe8dda8(0x280)](a35_0x46420a[_0xe8dda8(0x1f9)](_0xe8dda8(0x258))),console[_0xe8dda8(0x280)](_0xe8dda8(0x26c)),console[_0xe8dda8(0x280)](_0xe8dda8(0x211)),console[_0xe8dda8(0x280)]('\x20\x20Local\x20YAML\x20file:\x20\x20\x20\x20\x20\x20tdx\x20sg\x20sql\x20--path\x20<file-path>'),console[_0xe8dda8(0x280)](_0xe8dda8(0x22f)),console['error'](_0xe8dda8(0x1fa)),console[_0xe8dda8(0x280)](_0xe8dda8(0x23a)),0x1;if(_0x2de303&&_0x2520c8)return console[_0xe8dda8(0x280)](a35_0x46420a['red'](_0xe8dda8(0x20d))),0x1;try{let _0x2e9a35;if(_0x2520c8)_0x2e9a35=await this[_0xe8dda8(0x217)](_0x2520c8,_0x52587a);else{if(isYamlFilePath(_0x2de303))return console[_0xe8dda8(0x280)](a35_0x46420a[_0xe8dda8(0x1f9)](_0xe8dda8(0x232))),console[_0xe8dda8(0x280)](_0xe8dda8(0x25d)+_0x2de303),0x1;else _0x2e9a35=await this[_0xe8dda8(0x1f2)](_0x2de303,_0x52587a);}return _0x41a95c[_0xe8dda8(0x1dd)]===_0xe8dda8(0x1ea)||_0x41a95c[_0xe8dda8(0x1dd)]===_0xe8dda8(0x226)?await handleSDKOutput([{'sql':_0x2e9a35}],_0x41a95c):console[_0xe8dda8(0x1e4)](_0x2e9a35),0x0;}catch(_0x130fbd){if(_0x130fbd instanceof SDKError)return console[_0xe8dda8(0x280)](_0xe8dda8(0x1fd)+_0x130fbd[_0xe8dda8(0x249)]),_0x130fbd['cause']&&console['error'](_0xe8dda8(0x207)+_0x130fbd['cause']),0x1;throw _0x130fbd;}}async[a35_0xcd4784(0x217)](_0x1451d8,_0x3a8c5c){const _0x3afb8c=a35_0xcd4784,{options:_0x2bafc8,tdx:_0xc24019}=_0x3a8c5c;let _0x32cd74;try{_0x32cd74=await resolveYamlFilePath(_0x1451d8);}catch(_0x4a0ad5){throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x3afb8c(0x218)+_0x4a0ad5['message']);}_0x2bafc8[_0x3afb8c(0x221)]&&console['error'](_0x3afb8c(0x1e1)+_0x32cd74[_0x3afb8c(0x254)]+'/'+_0x32cd74[_0x3afb8c(0x23c)]);const _0x1af17b=await withSpinner(_0x3afb8c(0x23b),()=>_0xc24019[_0x3afb8c(0x1e7)][_0x3afb8c(0x224)](_0x32cd74[_0x3afb8c(0x1f5)],_0x32cd74['parentSegment'],_0x32cd74[_0x3afb8c(0x23c)]),{'verbose':_0x2bafc8[_0x3afb8c(0x221)]});return _0x1af17b[_0x3afb8c(0x20a)];}async[a35_0xcd4784(0x1f2)](_0x3b2f04,_0x537c53){const _0x125ea0=a35_0xcd4784,{options:_0x2b6c26,tdx:_0x53876b}=_0x537c53,_0x194a74=_0x2b6c26[_0x125ea0(0x254)],_0x5d3f45=await resolveSegmentTarget(_0x3b2f04,_0x194a74,_0x2b6c26[_0x125ea0(0x221)]);_0x2b6c26[_0x125ea0(0x221)]&&console[_0x125ea0(0x280)](_0x125ea0(0x24f)+_0x5d3f45);const _0x467daf=await withSpinner('Resolving\x20\x27'+_0x3b2f04+_0x125ea0(0x243),()=>_0x53876b[_0x125ea0(0x1e7)][_0x125ea0(0x1ee)](_0x5d3f45),{'verbose':_0x2b6c26[_0x125ea0(0x221)]}),_0x36ddc9=_0x467daf[_0x125ea0(0x20a)];_0x2b6c26[_0x125ea0(0x221)]&&(console['error'](_0x125ea0(0x279)+_0x36ddc9[_0x125ea0(0x233)]),console['error'](_0x125ea0(0x212)+_0x36ddc9[_0x125ea0(0x205)]));if(_0x36ddc9[_0x125ea0(0x233)]==='folder')throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x125ea0(0x1e9));if(_0x36ddc9[_0x125ea0(0x233)]==='parent')throw new SDKError(ErrorCode[_0x125ea0(0x269)],'Cannot\x20get\x20SQL\x20for\x20parent\x20segment\x20with\x20this\x20command.\x20Use:\x20tdx\x20ps\x20sql');if(!_0x36ddc9[_0x125ea0(0x276)])throw new SDKError(ErrorCode[_0x125ea0(0x268)],_0x125ea0(0x248));const _0x2dd59c=await withSpinner(_0x125ea0(0x1f1),()=>_0x53876b[_0x125ea0(0x1e7)]['getSegmentSQL'](_0x36ddc9[_0x125ea0(0x205)],_0x36ddc9['segmentId']),{'verbose':_0x2b6c26[_0x125ea0(0x221)]});return _0x2dd59c[_0x125ea0(0x20a)];}}export class SegmentFolderCreateCommand extends BaseCommand{[a35_0xcd4784(0x278)]=a35_0xcd4784(0x255);[a35_0xcd4784(0x273)]='Create\x20segment\x20folder\x20for\x20organization';async[a35_0xcd4784(0x23f)](_0x1ca0ca){const _0x2d11f7=a35_0xcd4784,{options:_0x10eaf7,args:_0x5f424c,tdx:_0x199bd8}=_0x1ca0ca,_0x40d2b2=_0x10eaf7;if(_0x5f424c[_0x2d11f7(0x1f4)]<0x2)return console['error'](_0x2d11f7(0x22c)),console[_0x2d11f7(0x280)](_0x2d11f7(0x256)),0x1;const _0x479cbf=_0x5f424c[0x0],_0x4afa34=_0x5f424c[0x1];_0x40d2b2['verbose']&&(console[_0x2d11f7(0x280)](_0x2d11f7(0x230)+_0x40d2b2[_0x2d11f7(0x227)]),console[_0x2d11f7(0x280)]('Parent\x20segment:\x20'+_0x479cbf),console[_0x2d11f7(0x280)](_0x2d11f7(0x237)+_0x4afa34));let _0x59d0b8;if(_0x40d2b2[_0x2d11f7(0x25a)]){const _0x3d5ead=_0x40d2b2[_0x2d11f7(0x25a)],_0x375ad3=await withSpinner(_0x2d11f7(0x262)+_0x479cbf+'\x27...',()=>_0x199bd8[_0x2d11f7(0x1e7)][_0x2d11f7(0x24d)](_0x479cbf),{'verbose':_0x40d2b2[_0x2d11f7(0x221)]}),_0x50df42=_0x375ad3[_0x2d11f7(0x20a)],_0x448603=await withSpinner(_0x2d11f7(0x1e2)+_0x3d5ead+_0x2d11f7(0x243),()=>_0x199bd8[_0x2d11f7(0x1e7)][_0x2d11f7(0x24e)](_0x50df42,_0x3d5ead),{'verbose':_0x40d2b2[_0x2d11f7(0x221)]});_0x59d0b8=_0x448603[_0x2d11f7(0x20a)],_0x40d2b2[_0x2d11f7(0x221)]&&console[_0x2d11f7(0x280)](_0x2d11f7(0x275)+_0x59d0b8);}const _0x1a376e={'name':_0x4afa34,'description':_0x40d2b2[_0x2d11f7(0x273)],'parentFolderId':_0x59d0b8},_0x36705c=await withSpinner(_0x2d11f7(0x244)+_0x4afa34+_0x2d11f7(0x243),()=>_0x199bd8[_0x2d11f7(0x1e7)][_0x2d11f7(0x23d)](_0x479cbf,_0x1a376e),{'verbose':_0x40d2b2[_0x2d11f7(0x221)]}),_0x19d915=_0x36705c[_0x2d11f7(0x20a)];return console[_0x2d11f7(0x280)](_0x2d11f7(0x271)+_0x19d915[_0x2d11f7(0x278)]+_0x2d11f7(0x26b)+_0x19d915['id']),await handleSDKOutput([_0x19d915],_0x40d2b2),0x0;}}export class SegmentViewCommand extends BaseCommand{[a35_0xcd4784(0x278)]=a35_0xcd4784(0x222);[a35_0xcd4784(0x273)]='Show\x20folder\x20or\x20child\x20segment\x20details';async[a35_0xcd4784(0x23f)](_0x5d4fb9){const _0x4e6826=a35_0xcd4784,{options:_0x5c13aa,args:_0x174e32,tdx:_0x2bb082}=_0x5d4fb9,_0x954132=_0x174e32[0x0];if(!_0x954132)return console[_0x4e6826(0x280)](_0x4e6826(0x1f6)),console[_0x4e6826(0x280)]('Usage:\x20tdx\x20sg\x20view\x20<name>\x20[-w]'),console[_0x4e6826(0x280)](_0x4e6826(0x246)),console['error'](_0x4e6826(0x27b)),console['error'](_0x4e6826(0x1fe)),console['error'](_0x4e6826(0x22f)),console[_0x4e6826(0x280)]('\x20\x20tdx\x20sg\x20view\x20\x22Marketing\x22\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20folder\x20details'),console[_0x4e6826(0x280)](_0x4e6826(0x25f)),console['error'](_0x4e6826(0x23e)),console['error']('\x20\x20tdx\x20sg\x20view\x20segments/my-audience/premium-users.yml'),0x1;try{const _0xe5e62d=_0x5c13aa[_0x4e6826(0x254)],_0x4d7dfe=await resolveSegmentTarget(_0x954132,_0xe5e62d,_0x5c13aa[_0x4e6826(0x221)]);_0x5c13aa[_0x4e6826(0x221)]&&console[_0x4e6826(0x280)]('Target\x20path:\x20'+_0x4d7dfe);const _0x57d320=await withSpinner('Resolving\x20\x27'+_0x954132+_0x4e6826(0x243),()=>_0x2bb082[_0x4e6826(0x1e7)]['resolvePathToResource'](_0x4d7dfe),{'verbose':_0x5c13aa[_0x4e6826(0x221)]}),_0x527c3d=_0x57d320[_0x4e6826(0x20a)];_0x5c13aa[_0x4e6826(0x221)]&&(console[_0x4e6826(0x280)](_0x4e6826(0x279)+_0x527c3d[_0x4e6826(0x233)]),console['error'](_0x4e6826(0x212)+_0x527c3d[_0x4e6826(0x205)]),_0x527c3d[_0x4e6826(0x22e)]&&console[_0x4e6826(0x280)](_0x4e6826(0x22b)+_0x527c3d[_0x4e6826(0x22e)]),_0x527c3d['segmentId']&&console[_0x4e6826(0x280)](_0x4e6826(0x1ed)+_0x527c3d[_0x4e6826(0x276)]));if(_0x5c13aa[_0x4e6826(0x21c)]){if(_0x527c3d['type']===_0x4e6826(0x1ec))return console['error'](_0x4e6826(0x203)),0x1;if(_0x527c3d['type']===_0x4e6826(0x214))return console[_0x4e6826(0x280)](_0x4e6826(0x263)),console[_0x4e6826(0x280)](_0x4e6826(0x1e0)),0x1;if(!_0x527c3d['segmentId'])throw new SDKError(ErrorCode[_0x4e6826(0x268)],_0x4e6826(0x248));const _0xa2e03a=getConsoleNextUrl(_0x5c13aa[_0x4e6826(0x227)],_0x4e6826(0x259)+_0x527c3d[_0x4e6826(0x205)]+_0x4e6826(0x238)+_0x527c3d[_0x4e6826(0x276)]);return console[_0x4e6826(0x280)](a35_0x46420a[_0x4e6826(0x213)]('βœ”')+'\x20Opening\x20'+a35_0x46420a['cyan'](_0xa2e03a)),openBrowser(_0xa2e03a),0x0;}if(_0x527c3d[_0x4e6826(0x233)]===_0x4e6826(0x1ec)){if(!_0x527c3d[_0x4e6826(0x22e)])throw new SDKError(ErrorCode[_0x4e6826(0x1fb)],_0x4e6826(0x1f7));const _0x53a047=await withSpinner(_0x4e6826(0x201),()=>_0x2bb082[_0x4e6826(0x1e7)][_0x4e6826(0x245)](_0x527c3d[_0x4e6826(0x22e)]),{'verbose':_0x5c13aa['verbose']});await handleSingleObjectOutput(_0x53a047[_0x4e6826(0x20a)],_0x5c13aa);}else{if(_0x527c3d['type']===_0x4e6826(0x1e7)){if(!_0x527c3d['segmentId'])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x4e6826(0x248));const _0x2d95aa=await withSpinner(_0x4e6826(0x202),()=>_0x2bb082[_0x4e6826(0x1e7)][_0x4e6826(0x21d)](_0x527c3d[_0x4e6826(0x205)],_0x527c3d[_0x4e6826(0x276)]),{'verbose':_0x5c13aa['verbose']}),_0x3b6e04=getConsoleNextUrl(_0x5c13aa[_0x4e6826(0x227)],_0x4e6826(0x259)+_0x527c3d['parentId']+'/e/'+_0x527c3d[_0x4e6826(0x276)]),_0x4e2d42=_0x2d95aa['data'];_0x4e2d42['url']=_0x3b6e04,await handleSingleObjectOutput(_0x4e2d42,_0x5c13aa);}else return console['error']('Error:\x20Cannot\x20view\x20parent\x20segment\x20details\x20with\x20this\x20command.'),console[_0x4e6826(0x280)](_0x4e6826(0x215)),0x1;}return 0x0;}catch(_0x6c2eb){if(_0x6c2eb instanceof SDKError)return console['error']('Error:\x20'+_0x6c2eb['message']),_0x6c2eb[_0x4e6826(0x220)]&&console['error']('\x20\x20Cause:\x20'+_0x6c2eb['cause']),0x1;throw _0x6c2eb;}}}export const SegmentInfoCommand=SegmentViewCommand;export class SegmentDescCommand extends BaseCommand{['name']='segment:desc';[a35_0xcd4784(0x273)]=a35_0xcd4784(0x27d);async[a35_0xcd4784(0x23f)](_0x4d1807){const _0x4b8c7a=a35_0xcd4784,{options:_0x5be202,args:_0xa6e79a,tdx:_0x2c3e3a}=_0x4d1807,_0x4e63aa=_0xa6e79a[0x0];if(!_0x4e63aa)return console['error'](_0x4b8c7a(0x1db)),console[_0x4b8c7a(0x280)](_0x4b8c7a(0x26a)),console['error'](_0x4b8c7a(0x1df)),console[_0x4b8c7a(0x280)](_0x4b8c7a(0x22f)),console['error']('\x20\x20tdx\x20sg\x20desc\x20\x22Premium\x20Users\x22'),console['error'](_0x4b8c7a(0x1de)),0x1;try{const _0x10b7a3=_0x5be202[_0x4b8c7a(0x254)],_0xfbea62=await resolveSegmentTarget(_0x4e63aa,_0x10b7a3,_0x5be202[_0x4b8c7a(0x221)]);_0x5be202[_0x4b8c7a(0x221)]&&console[_0x4b8c7a(0x280)]('Target\x20path:\x20'+_0xfbea62);const _0x1a1a53=await withSpinner(_0x4b8c7a(0x242)+_0x4e63aa+_0x4b8c7a(0x243),()=>_0x2c3e3a[_0x4b8c7a(0x1e7)][_0x4b8c7a(0x1ee)](_0xfbea62),{'verbose':_0x5be202['verbose']}),_0x37e3ca=_0x1a1a53[_0x4b8c7a(0x20a)];_0x5be202['verbose']&&(console['error'](_0x4b8c7a(0x279)+_0x37e3ca[_0x4b8c7a(0x233)]),console[_0x4b8c7a(0x280)](_0x4b8c7a(0x212)+_0x37e3ca[_0x4b8c7a(0x205)]));if(_0x37e3ca[_0x4b8c7a(0x233)]==='folder')return console['error'](_0x4b8c7a(0x1e5)),console[_0x4b8c7a(0x280)](_0x4b8c7a(0x216)),0x1;if(_0x37e3ca[_0x4b8c7a(0x233)]===_0x4b8c7a(0x214))return console[_0x4b8c7a(0x280)](_0x4b8c7a(0x277)),console[_0x4b8c7a(0x280)](_0x4b8c7a(0x1ef)),0x1;if(!_0x37e3ca[_0x4b8c7a(0x276)])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x4b8c7a(0x248));const _0x25621c=await withSpinner(_0x4b8c7a(0x1f1),()=>_0x2c3e3a[_0x4b8c7a(0x1e7)]['getSegmentSQL'](_0x37e3ca[_0x4b8c7a(0x205)],_0x37e3ca[_0x4b8c7a(0x276)]),{'verbose':_0x5be202[_0x4b8c7a(0x221)]}),_0x3087cc=_0x25621c[_0x4b8c7a(0x20a)],_0xa14d1a=await executeSchemaQuery(_0x3087cc,_0x2c3e3a,_0x5be202);return await handleQueryOutput(_0xa14d1a,_0x5be202),0x0;}catch(_0x247347){if(_0x247347 instanceof SDKError)return console['error'](_0x4b8c7a(0x1fd)+_0x247347[_0x4b8c7a(0x249)]),_0x247347[_0x4b8c7a(0x220)]&&console[_0x4b8c7a(0x280)](_0x4b8c7a(0x207)+_0x247347[_0x4b8c7a(0x220)]),0x1;throw _0x247347;}}}
1
+ const a35_0x1189b6=a35_0x303a;function a35_0x303a(_0x16c3d1,_0x56f5f6){_0x16c3d1=_0x16c3d1-0xc7;const _0x4f5a91=a35_0x4f5a();let _0x303a47=_0x4f5a91[_0x16c3d1];return _0x303a47;}(function(_0x1e95c5,_0x1c9e20){const _0x36e8db=a35_0x303a,_0x13884a=_0x1e95c5();while(!![]){try{const _0x1dd5d8=-parseInt(_0x36e8db(0xf9))/0x1+parseInt(_0x36e8db(0x148))/0x2+-parseInt(_0x36e8db(0x147))/0x3+-parseInt(_0x36e8db(0xcf))/0x4*(-parseInt(_0x36e8db(0xfa))/0x5)+parseInt(_0x36e8db(0xe5))/0x6*(parseInt(_0x36e8db(0x105))/0x7)+parseInt(_0x36e8db(0xd4))/0x8*(parseInt(_0x36e8db(0xeb))/0x9)+parseInt(_0x36e8db(0x103))/0xa*(parseInt(_0x36e8db(0x13e))/0xb);if(_0x1dd5d8===_0x1c9e20)break;else _0x13884a['push'](_0x13884a['shift']());}catch(_0xd60164){_0x13884a['push'](_0x13884a['shift']());}}}(a35_0x4f5a,0x231fa));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner,formatElapsed}from'../utils/spinner.js';import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';function a35_0x4f5a(){const _0x14f660=['Fetching\x20SQL\x20from\x20rule...','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22','Error:\x20Segment\x20name\x20or\x20--path\x20is\x20required','Error:\x20Cannot\x20open\x20folder\x20in\x20web\x20browser.\x20Use\x20a\x20segment\x20name\x20instead.','174852RHwdTr','56365OXxoGb','Show\x20child\x20segment\x20schema\x20(column\x20types)','jsonl','\x20\x20Cause:\x20','parent','replace','log','/app/ps/','\x20\x20tdx\x20sg\x20sql\x20--path\x20segments/my-audience/premium-users.yml','30dSSOAf','site','7ayhLVR','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22','segment:view','Resolving\x20parent\x20folder\x20\x27','segment:desc','Executing\x20segment\x20query...','Fetching\x20parent\x20segment\x20details...','\x20\x20tdx\x20sg\x20show\x20segments/my-audience/premium-users.yml','Resolving\x20\x27','segment','Show\x20segment\x20or\x20folder\x20details','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20view\x20<path/to/segment.yml>','Fetching\x20folder\x20details...','toLocaleString','Error:\x20Folder\x20reference\x20is\x20required','segment:folder:list','getSQLFromYamlFile','Resolved\x20folder\x20ID:\x20','Parent\x20name:\x20','\x20\x20Server-side\x20segment:\x20\x20tdx\x20sg\x20sql\x20<name>','Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required','green','Error:\x20Specify\x20either\x20segment\x20name\x20or\x20--path,\x20not\x20both','/e/','Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.','Resolved\x20type:\x20','Folder\x20name:\x20','Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]','Resolved\x20parent\x20ID:\x20','\x20\x20Full\x20path:\x20','resolveFolderId','error','Segment\x20ID:\x20','resolveParentId','Examples:','\x27...','Error:\x20Cannot\x20view\x20parent\x20segment\x20details\x20with\x20this\x20command.','Fetching\x20folder\x20\x27','message','query','SQL\x20query:\x0a','Error:\x20Cannot\x20open\x20parent\x20segment\x20with\x20this\x20command.','Resolved\x20relative\x20path\x20to:\x20','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','getSegmentSQL','Creating\x20folder\x20\x27','Error:\x20Cannot\x20show\x20schema\x20for\x20a\x20folder.','\x20\x20Segment\x20name:\x20','Resolving\x20parent\x20segment\x20\x27','Folder\x20ID:\x20','Segment\x20ID\x20missing\x20from\x20resolved\x20path','elapsedTimeMillis','Resolved:\x20','getSQLFromServerSegment','setJobId','description','Parent\x20segment:\x20','771441FZjYSm','folderPath','\x20\x20tdx\x20sg\x20sql\x20\x22Premium\x20Users\x22','data','Parent\x20ID:\x20','red','Use:\x20tdx\x20ps\x20show','code','INVALID_ARGUMENT','813585YxomZe','219218IfVOpa','cause','getFolder','segmentId','createFolder','Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>','Folder\x20ID\x20missing\x20from\x20resolved\x20path','segment:folder:create','cyan','test','Error:\x20','Error:\x20Cannot\x20show\x20schema\x20for\x20parent\x20segment\x20with\x20this\x20command.','parentFolder','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','trim','web','Cannot\x20get\x20SQL\x20for\x20parent\x20segment\x20with\x20this\x20command.\x20Use:\x20tdx\x20ps\x20sql','jobId','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20\x20\x20\x20\x20#\x20View\x20child\x20segment\x20details','fullPath','path','Target\x20path:\x20','Options:','name','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20show\x20<path/to/segment.yml>','stats','\x20rows\x20','Site:\x20','in\x20','Get\x20SQL\x20query\x20for\x20child\x20segment','Usage:\x20tdx\x20sg\x20desc\x20<name>','segment:sql','limit','Fetching\x20SQL\x20for\x20segment...','execute','Resolved\x20parent\x20folder\x20ID:\x20','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','includes','Resolving\x20folder\x20\x27','resolvePathToResource','8XkoaNT','\x20\x20Local\x20YAML\x20file:\x20\x20\x20\x20\x20\x20tdx\x20sg\x20sql\x20--path\x20<file-path>','Use:\x20tdx\x20ps\x20desc','\x20\x20Folder\x20path:\x20','folder','923344vAjTSC','\x20\x20tdx\x20sg\x20sql\x20--path\x20','verbose','parentId','Usage:\x20tdx\x20sg\x20show\x20<name>','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20desc\x20<path/to/segment.yml>','length','SELECT\x20*\x20FROM\x20(\x0a','folderId','Error:\x20Parent\x20segment\x20name\x20is\x20required','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','segment:describe','segmentName','content','Fetching\x20segment\x20details...','\x20\x20tdx\x20sg\x20show\x20\x22Premium\x20Users\x22','SEGMENT_FOLDER_NOT_FOUND','791682QhwDQB','parentSegment','getSegment','Error:\x20Folder\x20or\x20segment\x20name,\x20or\x20YAML\x20file\x20path\x20is\x20required','Usage:\x20tdx\x20sg\x20view\x20<name>\x20[-w]','βœ”\x20Created\x20folder\x20\x27','9ROMVZL','SEGMENT_NOT_FOUND','getParent','segment:show','βœ”\x20Query\x20completed:\x20Processed\x20','Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)','\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','url','type','Use:\x20tdx\x20ps\x20view'];a35_0x4f5a=function(){return _0x14f660;};return a35_0x4f5a();}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 a35_0x2f1bdc from'chalk';async function resolveSegmentTarget(_0x4983cc,_0x5d7e4c,_0x531623){const _0x1d898d=a35_0x303a;if(isYamlFilePath(_0x4983cc))try{const _0xbe11c6=await resolveYamlFilePath(_0x4983cc);return _0x531623&&(console[_0x1d898d(0x124)]('Resolved\x20YAML\x20file:\x20'+_0x4983cc),console[_0x1d898d(0x124)]('\x20\x20Parent\x20segment:\x20'+_0xbe11c6[_0x1d898d(0xe6)]),console['error'](_0x1d898d(0x134)+_0xbe11c6[_0x1d898d(0xe0)]),console[_0x1d898d(0x124)](_0x1d898d(0xd2)+(_0xbe11c6[_0x1d898d(0x13f)]||'(root)')),console[_0x1d898d(0x124)](_0x1d898d(0x122)+_0xbe11c6[_0x1d898d(0x15b)])),_0xbe11c6['fullPath'];}catch(_0x160e4e){throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x1d898d(0xde)+_0x160e4e['message']);}if(!_0x5d7e4c)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x1d898d(0x130));return _0x5d7e4c+'/'+_0x4983cc;}export class SegmentDescribeCommand extends BaseCommand{[a35_0x1189b6(0x15f)]=a35_0x1189b6(0xdf);['description']=a35_0x1189b6(0x10f);async[a35_0x1189b6(0xc9)](_0x24e67a){const _0x37f148=a35_0x1189b6,{options:_0x7c053d,args:_0x56a7a7,tdx:_0x36ed1e}=_0x24e67a,_0x37826b=_0x56a7a7[0x0],_0x7a2d12=!_0x37826b&&!!_0x7c053d[_0x37f148(0xe6)],_0x4ed645=_0x37826b||_0x7c053d[_0x37f148(0xe6)];if(!_0x4ed645)return console['error']('Error:\x20Path\x20or\x20name\x20is\x20required'),console[_0x37f148(0x124)]('Usage:\x20tdx\x20segment\x20describe\x20<path>'),console[_0x37f148(0x124)]('Examples:'),console[_0x37f148(0x124)](_0x37f148(0xf6)),console[_0x37f148(0x124)](_0x37f148(0x106)),console[_0x37f148(0x124)](_0x37f148(0xf1)),console['error'](_0x37f148(0x155)),0x1;try{const _0x1d032e=_0x7c053d['segmentPath'];let _0x2b35b4=_0x4ed645;!_0x7a2d12&&_0x1d032e&&!_0x4ed645[_0x37f148(0xcc)]('/')&&(_0x2b35b4=_0x1d032e+'/'+_0x4ed645,_0x7c053d['verbose']&&console[_0x37f148(0x124)](_0x37f148(0x12f)+_0x2b35b4));const _0x1bfe2b=await withSpinner('Resolving\x20path\x20\x27'+_0x2b35b4+_0x37f148(0x128),()=>_0x36ed1e[_0x37f148(0x10e)][_0x37f148(0xce)](_0x2b35b4),{'verbose':_0x7c053d[_0x37f148(0xd6)]}),_0x2cae62=_0x1bfe2b[_0x37f148(0x141)];_0x7c053d[_0x37f148(0xd6)]&&(console[_0x37f148(0x124)](_0x37f148(0x11e)+_0x2cae62[_0x37f148(0xf3)]),console[_0x37f148(0x124)](_0x37f148(0x142)+_0x2cae62[_0x37f148(0xd7)]),_0x2cae62['folderId']&&console[_0x37f148(0x124)](_0x37f148(0x136)+_0x2cae62[_0x37f148(0xdc)]),_0x2cae62[_0x37f148(0x14b)]&&console[_0x37f148(0x124)](_0x37f148(0x125)+_0x2cae62[_0x37f148(0x14b)]));if(_0x2cae62['type']==='parent'){const _0x537ae7=await withSpinner(_0x37f148(0x10b),()=>_0x36ed1e['segment'][_0x37f148(0xed)](_0x2cae62['parentId']),{'verbose':_0x7c053d[_0x37f148(0xd6)]});await handleSingleObjectOutput(_0x537ae7[_0x37f148(0x141)],_0x7c053d);}else{if(_0x2cae62[_0x37f148(0xf3)]===_0x37f148(0xd3)){if(!_0x2cae62[_0x37f148(0xdc)])throw new SDKError(ErrorCode[_0x37f148(0xe4)],_0x37f148(0x14e));const _0x16e984=await withSpinner('Fetching\x20folder\x20details...',()=>_0x36ed1e[_0x37f148(0x10e)]['getFolder'](_0x2cae62[_0x37f148(0xdc)]),{'verbose':_0x7c053d[_0x37f148(0xd6)]});await handleSingleObjectOutput(_0x16e984[_0x37f148(0x141)],_0x7c053d);}else{if(_0x2cae62[_0x37f148(0xf3)]==='segment'){if(!_0x2cae62[_0x37f148(0x14b)])throw new SDKError(ErrorCode[_0x37f148(0xec)],_0x37f148(0x137));const _0x3e962b=await withSpinner(_0x37f148(0xe2),()=>_0x36ed1e[_0x37f148(0x10e)][_0x37f148(0xe7)](_0x2cae62[_0x37f148(0xd7)],_0x2cae62['segmentId']),{'verbose':_0x7c053d['verbose']});await handleSingleObjectOutput(_0x3e962b[_0x37f148(0x141)],_0x7c053d);}}}return 0x0;}catch(_0x1f6465){if(_0x1f6465 instanceof SDKError)return console[_0x37f148(0x124)](_0x37f148(0x152)+_0x1f6465[_0x37f148(0x12b)]),_0x1f6465['cause']&&console['error'](_0x37f148(0xfd)+_0x1f6465[_0x37f148(0x149)]),0x1;throw _0x1f6465;}}}export class SegmentShowCommand extends BaseCommand{[a35_0x1189b6(0x15f)]=a35_0x1189b6(0xee);[a35_0x1189b6(0x13c)]='Execute\x20child\x20segment\x20SQL\x20query\x20and\x20show\x20results';async[a35_0x1189b6(0xc9)](_0x32db1a){const _0x98ecc3=a35_0x1189b6,{options:_0x1657ec,args:_0x111d2f,tdx:_0x4ac3f1}=_0x32db1a,_0x49750f=_0x111d2f[0x0];if(!_0x49750f)return console[_0x98ecc3(0x124)](_0x98ecc3(0x119)),console['error'](_0x98ecc3(0xd8)),console[_0x98ecc3(0x124)](_0x98ecc3(0x160)),console['error'](_0x98ecc3(0x127)),console['error'](_0x98ecc3(0xe3)),console[_0x98ecc3(0x124)](_0x98ecc3(0x10c)),0x1;try{const _0xa237ff=_0x1657ec[_0x98ecc3(0xe6)],_0x47f0c4=await resolveSegmentTarget(_0x49750f,_0xa237ff,_0x1657ec[_0x98ecc3(0xd6)]);_0x1657ec[_0x98ecc3(0xd6)]&&console[_0x98ecc3(0x124)](_0x98ecc3(0x15d)+_0x47f0c4);const _0x22b5b6=await withSpinner('Resolving\x20\x27'+_0x49750f+_0x98ecc3(0x128),()=>_0x4ac3f1['segment'][_0x98ecc3(0xce)](_0x47f0c4),{'verbose':_0x1657ec[_0x98ecc3(0xd6)]}),_0x3f796b=_0x22b5b6['data'];_0x1657ec[_0x98ecc3(0xd6)]&&(console[_0x98ecc3(0x124)](_0x98ecc3(0x11e)+_0x3f796b[_0x98ecc3(0xf3)]),console['error'](_0x98ecc3(0x142)+_0x3f796b[_0x98ecc3(0xd7)]));if(_0x3f796b[_0x98ecc3(0xf3)]===_0x98ecc3(0xd3))return console[_0x98ecc3(0x124)](_0x98ecc3(0x11d)),console['error']('Use:\x20tdx\x20sg\x20view\x20<name>\x20\x20#\x20To\x20show\x20folder\x20details'),0x1;if(_0x3f796b[_0x98ecc3(0xf3)]===_0x98ecc3(0xfe))return console[_0x98ecc3(0x124)]('Error:\x20Cannot\x20execute\x20query\x20for\x20parent\x20segment\x20with\x20this\x20command.'),console[_0x98ecc3(0x124)](_0x98ecc3(0x144)),0x1;if(!_0x3f796b[_0x98ecc3(0x14b)])throw new SDKError(ErrorCode[_0x98ecc3(0xec)],_0x98ecc3(0x137));const _0xaa0320=await withSpinner(_0x98ecc3(0xc8),()=>_0x4ac3f1['segment'][_0x98ecc3(0x131)](_0x3f796b['parentId'],_0x3f796b[_0x98ecc3(0x14b)]),{'verbose':_0x1657ec[_0x98ecc3(0xd6)]});let _0x5c64f8=_0xaa0320[_0x98ecc3(0x141)];const _0x5de3f6=resolveLimit(_0x1657ec[_0x98ecc3(0xc7)],DEFAULT_DISPLAY_LIMIT),_0x22b241=/\bLIMIT\s+\d+/i[_0x98ecc3(0x151)](_0x5c64f8);!_0x22b241&&(_0x5c64f8=_0x5c64f8[_0x98ecc3(0x156)]()[_0x98ecc3(0xff)](/;+$/,''),_0x5c64f8=_0x98ecc3(0xdb)+_0x5c64f8+'\x0a)\x20AS\x20segment_query\x0aLIMIT\x20'+_0x5de3f6);_0x1657ec['verbose']&&console[_0x98ecc3(0x124)](_0x98ecc3(0x12d)+_0x5c64f8);const _0x3e4ed4=await withProgressSpinner(_0x98ecc3(0x10a),async _0x4c9d9d=>{const _0x1dc1c8=_0x98ecc3,_0x5bdee3=await _0x4ac3f1[_0x1dc1c8(0x12c)][_0x1dc1c8(0xc9)](_0x5c64f8,{'catalog':'td','schema':'information_schema','onJobId':_0x4a66fa=>{const _0x4cbfd0=_0x1dc1c8;_0x4c9d9d[_0x4cbfd0(0x13b)](_0x4a66fa);}});return _0x5bdee3;},{'verbose':_0x1657ec[_0x98ecc3(0xd6)]}),_0xbdd64d=_0x3e4ed4['data'],_0x3f3332=_0xbdd64d[_0x98ecc3(0x159)]?'\x20[Job\x20ID:\x20'+_0xbdd64d[_0x98ecc3(0x159)]+']':'';return console[_0x98ecc3(0x124)](_0x98ecc3(0xef)+_0xbdd64d['stats']['processedRows'][_0x98ecc3(0x112)]()+_0x98ecc3(0x162)+(_0x98ecc3(0x164)+formatElapsed(_0xbdd64d[_0x98ecc3(0x161)][_0x98ecc3(0x138)])+_0x3f3332)),await handleQueryOutput(_0xbdd64d,_0x1657ec),0x0;}catch(_0x934f3f){if(_0x934f3f instanceof SDKError)return console[_0x98ecc3(0x124)]('βœ–\x20Query\x20failed\x20['+_0x934f3f[_0x98ecc3(0x145)]+']'),console[_0x98ecc3(0x124)]('\x0a'+_0x934f3f[_0x98ecc3(0x12b)]),0x1;throw _0x934f3f;}}}export class SegmentFolderListCommand extends BaseCommand{[a35_0x1189b6(0x15f)]=a35_0x1189b6(0x114);[a35_0x1189b6(0x13c)]='List\x20segment\x20folders\x20under\x20a\x20parent\x20segment';async[a35_0x1189b6(0xc9)](_0x1f459c){const _0x16c157=a35_0x1189b6,{options:_0x31e8cd,args:_0x228481,tdx:_0x3855f3}=_0x1f459c;if(_0x228481['length']===0x0)return console[_0x16c157(0x124)](_0x16c157(0xdd)),console[_0x16c157(0x124)](_0x16c157(0x14d)),0x1;const _0x1752d4=_0x228481[0x0];try{_0x31e8cd[_0x16c157(0xd6)]&&(console['error'](_0x16c157(0x163)+_0x31e8cd[_0x16c157(0x104)]),console[_0x16c157(0x124)](_0x16c157(0x117)+_0x1752d4));const _0x51c652=await withSpinner(_0x16c157(0x135)+_0x1752d4+_0x16c157(0x128),()=>_0x3855f3[_0x16c157(0x10e)][_0x16c157(0x126)](_0x1752d4),{'verbose':_0x31e8cd[_0x16c157(0xd6)]}),_0x16024b=_0x51c652[_0x16c157(0x141)];_0x31e8cd['verbose']&&console[_0x16c157(0x124)](_0x16c157(0x121)+_0x16024b);const _0x278d81=await withSpinner('Listing\x20folders\x20for\x20parent\x20\x27'+_0x1752d4+_0x16c157(0x128),()=>_0x3855f3[_0x16c157(0x10e)]['listFolders'](_0x16024b),{'verbose':_0x31e8cd[_0x16c157(0xd6)]}),_0x41af38=_0x278d81[_0x16c157(0x141)];return console['error']('βœ”\x20Found\x20'+_0x41af38[_0x16c157(0xda)]+'\x20folder'+(_0x41af38[_0x16c157(0xda)]!==0x1?'s':'')),await handleSDKOutput(_0x41af38,_0x31e8cd),0x0;}catch(_0x5af53f){if(_0x5af53f instanceof SDKError)return console[_0x16c157(0x124)](_0x16c157(0x152)+_0x5af53f[_0x16c157(0x12b)]),_0x5af53f[_0x16c157(0x149)]&&console[_0x16c157(0x124)](_0x16c157(0xfd)+_0x5af53f[_0x16c157(0x149)]),0x1;throw _0x5af53f;}}}export class SegmentFolderShowCommand extends BaseCommand{['name']='segment:folder:show';[a35_0x1189b6(0x13c)]='Show\x20segment\x20folder\x20details';async[a35_0x1189b6(0xc9)](_0x1865cb){const _0x5f3a1d=a35_0x1189b6,{options:_0x318417,args:_0x4eec2b,tdx:_0x4f162d}=_0x1865cb;if(_0x4eec2b['length']===0x0)return console[_0x5f3a1d(0x124)](_0x5f3a1d(0x113)),console['error']('Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>'),0x1;try{const {parentId:_0x44251f,childId:_0x5b69b7}=parseSegmentRef(_0x4eec2b[0x0]);_0x318417[_0x5f3a1d(0xd6)]&&(console['error'](_0x5f3a1d(0x163)+_0x318417[_0x5f3a1d(0x104)]),console[_0x5f3a1d(0x124)](_0x5f3a1d(0x117)+_0x44251f),_0x5b69b7&&console[_0x5f3a1d(0x124)]('Folder\x20name:\x20'+_0x5b69b7));if(!_0x5b69b7)return console[_0x5f3a1d(0x124)](_0x5f3a1d(0xf0)),0x1;const _0x517e92=await withSpinner(_0x5f3a1d(0x135)+_0x44251f+_0x5f3a1d(0x128),()=>_0x4f162d[_0x5f3a1d(0x10e)][_0x5f3a1d(0x126)](_0x44251f),{'verbose':_0x318417[_0x5f3a1d(0xd6)]}),_0x8511e=_0x517e92[_0x5f3a1d(0x141)];_0x318417[_0x5f3a1d(0xd6)]&&console['error'](_0x5f3a1d(0x121)+_0x8511e);const _0x45b62f=await withSpinner(_0x5f3a1d(0xcd)+_0x5b69b7+'\x27...',()=>_0x4f162d[_0x5f3a1d(0x10e)]['resolveFolderId'](_0x8511e,_0x5b69b7),{'verbose':_0x318417[_0x5f3a1d(0xd6)]}),_0x52cc01=_0x45b62f['data'];_0x318417[_0x5f3a1d(0xd6)]&&console[_0x5f3a1d(0x124)](_0x5f3a1d(0x116)+_0x52cc01);const _0xddd838=await withSpinner(_0x5f3a1d(0x12a)+_0x5b69b7+'\x27...',()=>_0x4f162d[_0x5f3a1d(0x10e)][_0x5f3a1d(0x14a)](_0x52cc01),{'verbose':_0x318417[_0x5f3a1d(0xd6)]});return await handleSDKOutput([_0xddd838[_0x5f3a1d(0x141)]],_0x318417),0x0;}catch(_0x5eca75){if(_0x5eca75 instanceof SDKError)return console[_0x5f3a1d(0x124)](_0x5f3a1d(0x152)+_0x5eca75[_0x5f3a1d(0x12b)]),_0x5eca75[_0x5f3a1d(0x149)]&&console[_0x5f3a1d(0x124)](_0x5f3a1d(0xfd)+_0x5eca75[_0x5f3a1d(0x149)]),0x1;throw _0x5eca75;}}}export class SegmentSQLCommand extends BaseCommand{[a35_0x1189b6(0x15f)]=a35_0x1189b6(0x167);[a35_0x1189b6(0x13c)]=a35_0x1189b6(0x165);async[a35_0x1189b6(0xc9)](_0x3f532a){const _0x1d97d6=a35_0x1189b6,{options:_0x2e0c05,args:_0x4b4c5c}=_0x3f532a,_0x3c9d72=_0x2e0c05,_0x33322c=_0x3c9d72[_0x1d97d6(0x15c)],_0x371127=_0x4b4c5c[0x0];if(!_0x371127&&!_0x33322c)return console['error'](a35_0x2f1bdc[_0x1d97d6(0x143)](_0x1d97d6(0xf7))),console[_0x1d97d6(0x124)]('Usage:'),console[_0x1d97d6(0x124)](_0x1d97d6(0x118)),console[_0x1d97d6(0x124)](_0x1d97d6(0xd0)),console[_0x1d97d6(0x124)](_0x1d97d6(0x127)),console[_0x1d97d6(0x124)](_0x1d97d6(0x140)),console[_0x1d97d6(0x124)](_0x1d97d6(0x102)),0x1;if(_0x371127&&_0x33322c)return console[_0x1d97d6(0x124)](a35_0x2f1bdc[_0x1d97d6(0x143)](_0x1d97d6(0x11b))),0x1;try{let _0x20260b;if(_0x33322c)_0x20260b=await this[_0x1d97d6(0x115)](_0x33322c,_0x3f532a);else{if(isYamlFilePath(_0x371127))return console[_0x1d97d6(0x124)](a35_0x2f1bdc[_0x1d97d6(0x143)]('Error:\x20YAML\x20file\x20paths\x20must\x20be\x20specified\x20with\x20--path\x20option')),console[_0x1d97d6(0x124)](_0x1d97d6(0xd5)+_0x371127),0x1;else _0x20260b=await this['getSQLFromServerSegment'](_0x371127,_0x3f532a);}return _0x2e0c05['format']==='json'||_0x2e0c05['format']===_0x1d97d6(0xfc)?await handleSDKOutput([{'sql':_0x20260b}],_0x2e0c05):console[_0x1d97d6(0x100)](_0x20260b),0x0;}catch(_0x22801f){if(_0x22801f instanceof SDKError)return console['error'](_0x1d97d6(0x152)+_0x22801f[_0x1d97d6(0x12b)]),_0x22801f['cause']&&console[_0x1d97d6(0x124)]('\x20\x20Cause:\x20'+_0x22801f[_0x1d97d6(0x149)]),0x1;throw _0x22801f;}}async[a35_0x1189b6(0x115)](_0x4c02ca,_0x1a8d57){const _0x8f348f=a35_0x1189b6,{options:_0x12ec42,tdx:_0x52f5cd}=_0x1a8d57;let _0x5d2eca;try{_0x5d2eca=await resolveYamlFilePath(_0x4c02ca);}catch(_0x495d18){throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x8f348f(0xde)+_0x495d18[_0x8f348f(0x12b)]);}_0x12ec42[_0x8f348f(0xd6)]&&console[_0x8f348f(0x124)](_0x8f348f(0x139)+_0x5d2eca[_0x8f348f(0xe6)]+'/'+_0x5d2eca[_0x8f348f(0xe0)]);const _0x5eaa7e=await withSpinner(_0x8f348f(0xf5),()=>_0x52f5cd['segment']['getSegmentSQLFromYaml'](_0x5d2eca[_0x8f348f(0xe1)],_0x5d2eca['parentSegment'],_0x5d2eca[_0x8f348f(0xe0)]),{'verbose':_0x12ec42['verbose']});return _0x5eaa7e[_0x8f348f(0x141)];}async[a35_0x1189b6(0x13a)](_0x1e3f8e,_0x226408){const _0x33eb06=a35_0x1189b6,{options:_0x561928,tdx:_0x340d8d}=_0x226408,_0x564b6e=_0x561928[_0x33eb06(0xe6)],_0x18c897=await resolveSegmentTarget(_0x1e3f8e,_0x564b6e,_0x561928[_0x33eb06(0xd6)]);_0x561928[_0x33eb06(0xd6)]&&console[_0x33eb06(0x124)]('Target\x20path:\x20'+_0x18c897);const _0x1fa548=await withSpinner(_0x33eb06(0x10d)+_0x1e3f8e+'\x27...',()=>_0x340d8d['segment']['resolvePathToResource'](_0x18c897),{'verbose':_0x561928[_0x33eb06(0xd6)]}),_0x318571=_0x1fa548[_0x33eb06(0x141)];_0x561928[_0x33eb06(0xd6)]&&(console[_0x33eb06(0x124)](_0x33eb06(0x11e)+_0x318571['type']),console[_0x33eb06(0x124)](_0x33eb06(0x142)+_0x318571[_0x33eb06(0xd7)]));if(_0x318571[_0x33eb06(0xf3)]==='folder')throw new SDKError(ErrorCode[_0x33eb06(0x146)],'Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.\x20Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.');if(_0x318571[_0x33eb06(0xf3)]==='parent')throw new SDKError(ErrorCode[_0x33eb06(0x146)],_0x33eb06(0x158));if(!_0x318571['segmentId'])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x33eb06(0x137));const _0x201628=await withSpinner('Fetching\x20SQL\x20for\x20segment...',()=>_0x340d8d[_0x33eb06(0x10e)][_0x33eb06(0x131)](_0x318571['parentId'],_0x318571[_0x33eb06(0x14b)]),{'verbose':_0x561928[_0x33eb06(0xd6)]});return _0x201628['data'];}}export class SegmentFolderCreateCommand extends BaseCommand{[a35_0x1189b6(0x15f)]=a35_0x1189b6(0x14f);[a35_0x1189b6(0x13c)]='Create\x20segment\x20folder\x20for\x20organization';async[a35_0x1189b6(0xc9)](_0x48dd3a){const _0x194076=a35_0x1189b6,{options:_0x1b10bd,args:_0x3514d3,tdx:_0x53e2dc}=_0x48dd3a,_0x37d263=_0x1b10bd;if(_0x3514d3['length']<0x2)return console[_0x194076(0x124)]('Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required'),console[_0x194076(0x124)](_0x194076(0x120)),0x1;const _0x13bcd5=_0x3514d3[0x0],_0x5357af=_0x3514d3[0x1];_0x37d263[_0x194076(0xd6)]&&(console[_0x194076(0x124)](_0x194076(0x163)+_0x37d263[_0x194076(0x104)]),console[_0x194076(0x124)](_0x194076(0x13d)+_0x13bcd5),console[_0x194076(0x124)](_0x194076(0x11f)+_0x5357af));let _0x334727;if(_0x37d263['parentFolder']){const _0x1a96bb=_0x37d263[_0x194076(0x154)],_0x17e4bb=await withSpinner(_0x194076(0x135)+_0x13bcd5+_0x194076(0x128),()=>_0x53e2dc[_0x194076(0x10e)][_0x194076(0x126)](_0x13bcd5),{'verbose':_0x37d263[_0x194076(0xd6)]}),_0x2a1e86=_0x17e4bb[_0x194076(0x141)],_0x2caaa3=await withSpinner(_0x194076(0x108)+_0x1a96bb+_0x194076(0x128),()=>_0x53e2dc['segment'][_0x194076(0x123)](_0x2a1e86,_0x1a96bb),{'verbose':_0x37d263[_0x194076(0xd6)]});_0x334727=_0x2caaa3[_0x194076(0x141)],_0x37d263[_0x194076(0xd6)]&&console[_0x194076(0x124)](_0x194076(0xca)+_0x334727);}const _0x503111={'name':_0x5357af,'description':_0x37d263[_0x194076(0x13c)],'parentFolderId':_0x334727},_0x20c638=await withSpinner(_0x194076(0x132)+_0x5357af+'\x27...',()=>_0x53e2dc[_0x194076(0x10e)][_0x194076(0x14c)](_0x13bcd5,_0x503111),{'verbose':_0x37d263['verbose']}),_0x2b03b4=_0x20c638[_0x194076(0x141)];return console['error'](_0x194076(0xea)+_0x2b03b4[_0x194076(0x15f)]+'\x27\x20with\x20ID:\x20'+_0x2b03b4['id']),await handleSDKOutput([_0x2b03b4],_0x37d263),0x0;}}export class SegmentViewCommand extends BaseCommand{[a35_0x1189b6(0x15f)]=a35_0x1189b6(0x107);[a35_0x1189b6(0x13c)]='Show\x20folder\x20or\x20child\x20segment\x20details';async[a35_0x1189b6(0xc9)](_0x585169){const _0x3242c4=a35_0x1189b6,{options:_0x5ad2b2,args:_0x1c3b6c,tdx:_0x13593f}=_0x585169,_0x42c46b=_0x1c3b6c[0x0];if(!_0x42c46b)return console[_0x3242c4(0x124)](_0x3242c4(0xe8)),console[_0x3242c4(0x124)](_0x3242c4(0xe9)),console[_0x3242c4(0x124)](_0x3242c4(0x110)),console['error'](_0x3242c4(0x15e)),console[_0x3242c4(0x124)]('\x20\x20-w,\x20--web\x20\x20Open\x20segment\x20in\x20web\x20browser'),console[_0x3242c4(0x124)](_0x3242c4(0x127)),console[_0x3242c4(0x124)]('\x20\x20tdx\x20sg\x20view\x20\x22Marketing\x22\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20folder\x20details'),console[_0x3242c4(0x124)](_0x3242c4(0x15a)),console[_0x3242c4(0x124)]('\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20-w\x20\x20#\x20Open\x20segment\x20in\x20web\x20browser'),console[_0x3242c4(0x124)]('\x20\x20tdx\x20sg\x20view\x20segments/my-audience/premium-users.yml'),0x1;try{const _0x3ab9bf=_0x5ad2b2['parentSegment'],_0x3d670e=await resolveSegmentTarget(_0x42c46b,_0x3ab9bf,_0x5ad2b2[_0x3242c4(0xd6)]);_0x5ad2b2[_0x3242c4(0xd6)]&&console[_0x3242c4(0x124)](_0x3242c4(0x15d)+_0x3d670e);const _0x129c92=await withSpinner(_0x3242c4(0x10d)+_0x42c46b+'\x27...',()=>_0x13593f['segment'][_0x3242c4(0xce)](_0x3d670e),{'verbose':_0x5ad2b2['verbose']}),_0x339b5=_0x129c92[_0x3242c4(0x141)];_0x5ad2b2['verbose']&&(console[_0x3242c4(0x124)](_0x3242c4(0x11e)+_0x339b5[_0x3242c4(0xf3)]),console[_0x3242c4(0x124)]('Parent\x20ID:\x20'+_0x339b5[_0x3242c4(0xd7)]),_0x339b5[_0x3242c4(0xdc)]&&console['error'](_0x3242c4(0x136)+_0x339b5[_0x3242c4(0xdc)]),_0x339b5['segmentId']&&console['error'](_0x3242c4(0x125)+_0x339b5['segmentId']));if(_0x5ad2b2[_0x3242c4(0x157)]){if(_0x339b5[_0x3242c4(0xf3)]===_0x3242c4(0xd3))return console[_0x3242c4(0x124)](_0x3242c4(0xf8)),0x1;if(_0x339b5[_0x3242c4(0xf3)]===_0x3242c4(0xfe))return console[_0x3242c4(0x124)](_0x3242c4(0x12e)),console[_0x3242c4(0x124)]('Use:\x20tdx\x20ps\x20view\x20-w'),0x1;if(!_0x339b5[_0x3242c4(0x14b)])throw new SDKError(ErrorCode[_0x3242c4(0xec)],_0x3242c4(0x137));const _0xba16d=getConsoleNextUrl(_0x5ad2b2[_0x3242c4(0x104)],'/app/ps/'+_0x339b5[_0x3242c4(0xd7)]+_0x3242c4(0x11c)+_0x339b5[_0x3242c4(0x14b)]);return console['error'](a35_0x2f1bdc[_0x3242c4(0x11a)]('βœ”')+'\x20Opening\x20'+a35_0x2f1bdc[_0x3242c4(0x150)](_0xba16d)),openBrowser(_0xba16d),0x0;}if(_0x339b5[_0x3242c4(0xf3)]==='folder'){if(!_0x339b5[_0x3242c4(0xdc)])throw new SDKError(ErrorCode[_0x3242c4(0xe4)],_0x3242c4(0x14e));const _0x245c01=await withSpinner(_0x3242c4(0x111),()=>_0x13593f[_0x3242c4(0x10e)][_0x3242c4(0x14a)](_0x339b5[_0x3242c4(0xdc)]),{'verbose':_0x5ad2b2[_0x3242c4(0xd6)]});await handleSingleObjectOutput(_0x245c01['data'],_0x5ad2b2);}else{if(_0x339b5[_0x3242c4(0xf3)]===_0x3242c4(0x10e)){if(!_0x339b5[_0x3242c4(0x14b)])throw new SDKError(ErrorCode[_0x3242c4(0xec)],_0x3242c4(0x137));const _0xd695fc=await withSpinner(_0x3242c4(0xe2),()=>_0x13593f[_0x3242c4(0x10e)][_0x3242c4(0xe7)](_0x339b5[_0x3242c4(0xd7)],_0x339b5['segmentId']),{'verbose':_0x5ad2b2[_0x3242c4(0xd6)]}),_0x76ed73=getConsoleNextUrl(_0x5ad2b2[_0x3242c4(0x104)],_0x3242c4(0x101)+_0x339b5[_0x3242c4(0xd7)]+_0x3242c4(0x11c)+_0x339b5[_0x3242c4(0x14b)]),_0x492fba=_0xd695fc['data'];_0x492fba[_0x3242c4(0xf2)]=_0x76ed73,await handleSingleObjectOutput(_0x492fba,_0x5ad2b2);}else return console[_0x3242c4(0x124)](_0x3242c4(0x129)),console[_0x3242c4(0x124)](_0x3242c4(0xf4)),0x1;}return 0x0;}catch(_0x5e3a34){if(_0x5e3a34 instanceof SDKError)return console[_0x3242c4(0x124)](_0x3242c4(0x152)+_0x5e3a34[_0x3242c4(0x12b)]),_0x5e3a34[_0x3242c4(0x149)]&&console[_0x3242c4(0x124)](_0x3242c4(0xfd)+_0x5e3a34[_0x3242c4(0x149)]),0x1;throw _0x5e3a34;}}}export const SegmentInfoCommand=SegmentViewCommand;export class SegmentDescCommand extends BaseCommand{[a35_0x1189b6(0x15f)]=a35_0x1189b6(0x109);['description']=a35_0x1189b6(0xfb);async['execute'](_0x43fb64){const _0x5d6f4f=a35_0x1189b6,{options:_0x2b7a73,args:_0x2ed826,tdx:_0x43d9c4}=_0x43fb64,_0x4fe4ce=_0x2ed826[0x0];if(!_0x4fe4ce)return console[_0x5d6f4f(0x124)]('Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required'),console[_0x5d6f4f(0x124)](_0x5d6f4f(0x166)),console[_0x5d6f4f(0x124)](_0x5d6f4f(0xd9)),console['error'](_0x5d6f4f(0x127)),console['error']('\x20\x20tdx\x20sg\x20desc\x20\x22Premium\x20Users\x22'),console[_0x5d6f4f(0x124)]('\x20\x20tdx\x20sg\x20desc\x20segments/my-audience/premium-users.yml'),0x1;try{const _0x21ce32=_0x2b7a73[_0x5d6f4f(0xe6)],_0x2c70df=await resolveSegmentTarget(_0x4fe4ce,_0x21ce32,_0x2b7a73[_0x5d6f4f(0xd6)]);_0x2b7a73[_0x5d6f4f(0xd6)]&&console['error']('Target\x20path:\x20'+_0x2c70df);const _0x3ce90d=await withSpinner('Resolving\x20\x27'+_0x4fe4ce+_0x5d6f4f(0x128),()=>_0x43d9c4[_0x5d6f4f(0x10e)]['resolvePathToResource'](_0x2c70df),{'verbose':_0x2b7a73[_0x5d6f4f(0xd6)]}),_0x41e849=_0x3ce90d['data'];_0x2b7a73[_0x5d6f4f(0xd6)]&&(console[_0x5d6f4f(0x124)](_0x5d6f4f(0x11e)+_0x41e849[_0x5d6f4f(0xf3)]),console['error']('Parent\x20ID:\x20'+_0x41e849[_0x5d6f4f(0xd7)]));if(_0x41e849[_0x5d6f4f(0xf3)]==='folder')return console['error'](_0x5d6f4f(0x133)),console[_0x5d6f4f(0x124)](_0x5d6f4f(0xcb)),0x1;if(_0x41e849[_0x5d6f4f(0xf3)]==='parent')return console[_0x5d6f4f(0x124)](_0x5d6f4f(0x153)),console[_0x5d6f4f(0x124)](_0x5d6f4f(0xd1)),0x1;if(!_0x41e849[_0x5d6f4f(0x14b)])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x5d6f4f(0x137));const _0x2df12c=await withSpinner(_0x5d6f4f(0xc8),()=>_0x43d9c4[_0x5d6f4f(0x10e)][_0x5d6f4f(0x131)](_0x41e849[_0x5d6f4f(0xd7)],_0x41e849['segmentId']),{'verbose':_0x2b7a73[_0x5d6f4f(0xd6)]}),_0x3c4d25=_0x2df12c[_0x5d6f4f(0x141)],_0x58fc50=await executeSchemaQuery(_0x3c4d25,_0x43d9c4,_0x2b7a73);return await handleQueryOutput(_0x58fc50,_0x2b7a73),0x0;}catch(_0x11dc8c){if(_0x11dc8c instanceof SDKError)return console[_0x5d6f4f(0x124)](_0x5d6f4f(0x152)+_0x11dc8c[_0x5d6f4f(0x12b)]),_0x11dc8c[_0x5d6f4f(0x149)]&&console[_0x5d6f4f(0x124)](_0x5d6f4f(0xfd)+_0x11dc8c[_0x5d6f4f(0x149)]),0x1;throw _0x11dc8c;}}}
@@ -1 +1 @@
1
- const a36_0x342c18=a36_0x511b;(function(_0x4bd1a5,_0x34cbf9){const _0x2ba994=a36_0x511b,_0x4c1ebe=_0x4bd1a5();while(!![]){try{const _0x32f60b=parseInt(_0x2ba994(0x179))/0x1+parseInt(_0x2ba994(0x182))/0x2*(-parseInt(_0x2ba994(0x18b))/0x3)+-parseInt(_0x2ba994(0x193))/0x4+parseInt(_0x2ba994(0x17e))/0x5+parseInt(_0x2ba994(0x174))/0x6+-parseInt(_0x2ba994(0x16e))/0x7+-parseInt(_0x2ba994(0x18d))/0x8;if(_0x32f60b===_0x34cbf9)break;else _0x4c1ebe['push'](_0x4c1ebe['shift']());}catch(_0x410910){_0x4c1ebe['push'](_0x4c1ebe['shift']());}}}(a36_0x5caa,0x34ba6));function a36_0x5caa(){const _0x41b57e=['folder','1473332wOFmOj','segmentPath','type','Resolved\x20folder\x20ID:\x20','\x27\x20with\x20ID:\x20','βœ”\x20Created\x20segment\x20\x27','905520iqGXxw','\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','invisible','Examples:','ruleFile','60783FipjFt','resolvePathToResource','Create\x20child\x20segment\x20with\x20filtering\x20rules','\x27...','description','2083010EyJpYe','segment','yellow','noCountPopulation','4926TZCjWV','Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]','folderId','name','Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','Resolving\x20parent\x20segment\x20\x27','rule','Target\x20path:\x20','63ZFbJsC','resolveFolderId','1182064nvpXxl','segments','Segment\x20name:\x20','length','Resolving\x20folder\x20\x27','⚠\x20Deprecation\x20warning:\x20`segment\x20create`\x20is\x20deprecated.','9496xLnnBm','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','data','Parent:\x20','Creating\x20segment\x20\x27','kind','Resolving\x20folder\x20path\x20\x27','error','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27','verbose','execute','Parent\x20path:\x20'];a36_0x5caa=function(){return _0x41b57e;};return a36_0x5caa();}import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';function a36_0x511b(_0x485459,_0x36b714){_0x485459=_0x485459-0x168;const _0x5caa4b=a36_0x5caa();let _0x511b31=_0x5caa4b[_0x485459];return _0x511b31;}import{parsePath,getParentPath,getBaseName}from'../sdk/segment/segment-path-parser.js';import a36_0x440bbc from'chalk';export class SegmentCreateCommand extends BaseCommand{[a36_0x342c18(0x185)]='segment:create';[a36_0x342c18(0x17d)]=a36_0x342c18(0x17b);async[a36_0x342c18(0x16b)](_0x58d20f){const _0x6ce7ea=a36_0x342c18;console['error'](a36_0x440bbc[_0x6ce7ea(0x180)](_0x6ce7ea(0x192))),console['error'](a36_0x440bbc[_0x6ce7ea(0x180)](_0x6ce7ea(0x194)));const {options:_0x2aaacc,args:_0x797978,tdx:_0x263c1b}=_0x58d20f,_0x132237=_0x2aaacc;if(_0x797978[_0x6ce7ea(0x190)]===0x0)return console[_0x6ce7ea(0x168)](_0x6ce7ea(0x187)),console[_0x6ce7ea(0x168)]('Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]'),console[_0x6ce7ea(0x168)](_0x6ce7ea(0x177)),console[_0x6ce7ea(0x168)](_0x6ce7ea(0x169)),console[_0x6ce7ea(0x168)]('\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27'),console['error'](_0x6ce7ea(0x175)),0x1;const _0x211ff6=_0x797978[0x0],_0x4ecefa=_0x2aaacc[_0x6ce7ea(0x16f)];let _0x4fa09d=_0x211ff6;_0x4ecefa&&!_0x211ff6['includes']('/')&&(_0x4fa09d=_0x4ecefa+'/'+_0x211ff6,_0x132237[_0x6ce7ea(0x16a)]&&console[_0x6ce7ea(0x168)]('Resolved\x20relative\x20path\x20to:\x20'+_0x4fa09d));const _0xce1964=parsePath(_0x4fa09d);if(_0xce1964[_0x6ce7ea(0x18e)][_0x6ce7ea(0x190)]<0x2)return console['error']('Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)'),console[_0x6ce7ea(0x168)](_0x6ce7ea(0x183)),0x1;const _0x146456=_0xce1964[_0x6ce7ea(0x18e)][0x0],_0x4954aa=getBaseName(_0x4fa09d),_0x3dfb28=getParentPath(_0x4fa09d);_0x132237['verbose']&&(console[_0x6ce7ea(0x168)]('Site:\x20'+_0x132237['site']),console[_0x6ce7ea(0x168)](_0x6ce7ea(0x18a)+_0x4fa09d),console[_0x6ce7ea(0x168)](_0x6ce7ea(0x196)+_0x146456),console[_0x6ce7ea(0x168)](_0x6ce7ea(0x18f)+_0x4954aa),console[_0x6ce7ea(0x168)](_0x6ce7ea(0x16c)+_0x3dfb28));const _0x1696b5=await withSpinner(_0x6ce7ea(0x188)+_0x146456+_0x6ce7ea(0x17c),()=>_0x263c1b[_0x6ce7ea(0x17f)]['resolveParentId'](_0x146456),{'verbose':_0x132237[_0x6ce7ea(0x16a)]}),_0x280822=_0x1696b5[_0x6ce7ea(0x195)];let _0x444ef3;if(_0xce1964[_0x6ce7ea(0x18e)][_0x6ce7ea(0x190)]>0x2){const _0x37d0c6=await withSpinner(_0x6ce7ea(0x199)+_0x3dfb28+_0x6ce7ea(0x17c),()=>_0x263c1b[_0x6ce7ea(0x17f)][_0x6ce7ea(0x17a)](_0x3dfb28),{'verbose':_0x132237[_0x6ce7ea(0x16a)]}),_0x31e7b6=_0x37d0c6[_0x6ce7ea(0x195)];if(_0x31e7b6['type']!==_0x6ce7ea(0x16d)&&_0x31e7b6[_0x6ce7ea(0x170)]!=='parent')return console[_0x6ce7ea(0x168)](_0x6ce7ea(0x186)),0x1;_0x444ef3=_0x31e7b6[_0x6ce7ea(0x184)];}else{if(_0x132237[_0x6ce7ea(0x16d)]){const _0x9746a7=await withSpinner(_0x6ce7ea(0x191)+_0x132237[_0x6ce7ea(0x16d)]+_0x6ce7ea(0x17c),()=>_0x263c1b[_0x6ce7ea(0x17f)][_0x6ce7ea(0x18c)](_0x280822,_0x132237[_0x6ce7ea(0x16d)]),{'verbose':_0x132237[_0x6ce7ea(0x16a)]});_0x444ef3=_0x9746a7[_0x6ce7ea(0x195)];}}_0x132237['verbose']&&_0x444ef3&&console['error'](_0x6ce7ea(0x171)+_0x444ef3);const _0x501a99=await loadJSONFromOptions(_0x132237[_0x6ce7ea(0x189)],_0x132237[_0x6ce7ea(0x178)]),_0x477a87={'name':_0x4954aa,'description':_0x132237[_0x6ce7ea(0x17d)],'rule':_0x501a99,'kind':_0x132237[_0x6ce7ea(0x198)]!==undefined?parseInt(_0x132237[_0x6ce7ea(0x198)],0xa):undefined,'isVisible':_0x132237[_0x6ce7ea(0x176)]?![]:undefined,'segmentFolderId':_0x444ef3,'countPopulation':_0x132237[_0x6ce7ea(0x181)]?![]:undefined},_0xabc8fc=await withSpinner(_0x6ce7ea(0x197)+_0x4954aa+_0x6ce7ea(0x17c),()=>_0x263c1b[_0x6ce7ea(0x17f)]['createSegment'](_0x280822,_0x477a87),{'verbose':_0x132237['verbose']}),_0x27eec3=_0xabc8fc['data'];return console[_0x6ce7ea(0x168)](_0x6ce7ea(0x173)+_0x27eec3[_0x6ce7ea(0x185)]+_0x6ce7ea(0x172)+_0x27eec3['id']),_0x4fa09d!==_0x211ff6&&console[_0x6ce7ea(0x168)]('\x20\x20\x20Path:\x20'+_0x4fa09d),await handleSDKOutput([_0x27eec3],_0x132237),0x0;}}
1
+ const a36_0x4e5001=a36_0x517f;(function(_0x12c5b9,_0x179b1c){const _0x3066e0=a36_0x517f,_0x2aa236=_0x12c5b9();while(!![]){try{const _0x4af9cd=parseInt(_0x3066e0(0x19c))/0x1*(parseInt(_0x3066e0(0x1ac))/0x2)+parseInt(_0x3066e0(0x1a0))/0x3+-parseInt(_0x3066e0(0x1b0))/0x4*(-parseInt(_0x3066e0(0x1ad))/0x5)+-parseInt(_0x3066e0(0x1bc))/0x6*(parseInt(_0x3066e0(0x1b2))/0x7)+parseInt(_0x3066e0(0x1b8))/0x8+-parseInt(_0x3066e0(0x1b9))/0x9+-parseInt(_0x3066e0(0x1a4))/0xa*(parseInt(_0x3066e0(0x191))/0xb);if(_0x4af9cd===_0x179b1c)break;else _0x2aa236['push'](_0x2aa236['shift']());}catch(_0x346251){_0x2aa236['push'](_0x2aa236['shift']());}}}(a36_0x2933,0x51ca2));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';function a36_0x2933(){const _0x198a2c=['error','1447770JvoAuk','createSegment','Resolving\x20folder\x20path\x20\x27','segments','name','\x20\x20\x20Path:\x20','segmentPath','verbose','26hWnwqp','5tLKpMz','Resolved\x20relative\x20path\x20to:\x20','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27','815484nQPucT','Site:\x20','2961rzlxdw','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','resolveParentId','βœ”\x20Created\x20segment\x20\x27','Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.','yellow','1702336xPboey','2206008VsmvTJ','Creating\x20segment\x20\x27','⚠\x20Deprecation\x20warning:\x20`segment\x20create`\x20is\x20deprecated.','1266BNLUND','\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','includes','resolvePathToResource','Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]','segment','site','description','noCountPopulation','Resolving\x20parent\x20segment\x20\x27','resolveFolderId','33DOyjOY','Parent:\x20','Create\x20child\x20segment\x20with\x20filtering\x20rules','Resolved\x20folder\x20ID:\x20','data','Parent\x20path:\x20','Target\x20path:\x20','kind','Resolving\x20folder\x20\x27','length','Segment\x20name:\x20','20243QIeOER','segment:create','folder','folderId','1271652ztrsax','Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)','\x27...'];a36_0x2933=function(){return _0x198a2c;};return a36_0x2933();}import{loadJSONFromOptions}from'../utils/json-loader.js';import{parsePath,getParentPath,getBaseName}from'../sdk/segment/segment-path-parser.js';import a36_0x32d1a9 from'chalk';function a36_0x517f(_0x104f3c,_0x565cc1){_0x104f3c=_0x104f3c-0x18f;const _0x293342=a36_0x2933();let _0x517f07=_0x293342[_0x104f3c];return _0x517f07;}export class SegmentCreateCommand extends BaseCommand{['name']=a36_0x4e5001(0x19d);['description']=a36_0x4e5001(0x193);async['execute'](_0x38a445){const _0x3346a5=a36_0x4e5001;console['error'](a36_0x32d1a9['yellow'](_0x3346a5(0x1bb))),console[_0x3346a5(0x1a3)](a36_0x32d1a9[_0x3346a5(0x1b7)]('\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a'));const {options:_0x5b0f25,args:_0x44f261,tdx:_0xf47744}=_0x38a445,_0x59de17=_0x5b0f25;if(_0x44f261['length']===0x0)return console[_0x3346a5(0x1a3)](_0x3346a5(0x1b3)),console['error']('Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]'),console[_0x3346a5(0x1a3)]('Examples:'),console[_0x3346a5(0x1a3)]('\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27'),console[_0x3346a5(0x1a3)](_0x3346a5(0x1af)),console[_0x3346a5(0x1a3)](_0x3346a5(0x1bd)),0x1;const _0x158895=_0x44f261[0x0],_0x5f075b=_0x5b0f25[_0x3346a5(0x1aa)];let _0xe6c205=_0x158895;_0x5f075b&&!_0x158895[_0x3346a5(0x1be)]('/')&&(_0xe6c205=_0x5f075b+'/'+_0x158895,_0x59de17['verbose']&&console[_0x3346a5(0x1a3)](_0x3346a5(0x1ae)+_0xe6c205));const _0x24f224=parsePath(_0xe6c205);if(_0x24f224[_0x3346a5(0x1a7)]['length']<0x2)return console[_0x3346a5(0x1a3)](_0x3346a5(0x1a1)),console[_0x3346a5(0x1a3)](_0x3346a5(0x1c0)),0x1;const _0x28e819=_0x24f224[_0x3346a5(0x1a7)][0x0],_0x36c7a0=getBaseName(_0xe6c205),_0x4ca1c4=getParentPath(_0xe6c205);_0x59de17[_0x3346a5(0x1ab)]&&(console[_0x3346a5(0x1a3)](_0x3346a5(0x1b1)+_0x59de17[_0x3346a5(0x1c2)]),console[_0x3346a5(0x1a3)](_0x3346a5(0x197)+_0xe6c205),console[_0x3346a5(0x1a3)](_0x3346a5(0x192)+_0x28e819),console[_0x3346a5(0x1a3)](_0x3346a5(0x19b)+_0x36c7a0),console[_0x3346a5(0x1a3)](_0x3346a5(0x196)+_0x4ca1c4));const _0x2548a5=await withSpinner(_0x3346a5(0x18f)+_0x28e819+_0x3346a5(0x1a2),()=>_0xf47744[_0x3346a5(0x1c1)][_0x3346a5(0x1b4)](_0x28e819),{'verbose':_0x59de17[_0x3346a5(0x1ab)]}),_0x270879=_0x2548a5[_0x3346a5(0x195)];let _0x343f79;if(_0x24f224[_0x3346a5(0x1a7)][_0x3346a5(0x19a)]>0x2){const _0x900792=await withSpinner(_0x3346a5(0x1a6)+_0x4ca1c4+_0x3346a5(0x1a2),()=>_0xf47744[_0x3346a5(0x1c1)][_0x3346a5(0x1bf)](_0x4ca1c4),{'verbose':_0x59de17[_0x3346a5(0x1ab)]}),_0x52f4e2=_0x900792['data'];if(_0x52f4e2['type']!=='folder'&&_0x52f4e2['type']!=='parent')return console['error'](_0x3346a5(0x1b6)),0x1;_0x343f79=_0x52f4e2[_0x3346a5(0x19f)];}else{if(_0x59de17[_0x3346a5(0x19e)]){const _0x46a5ff=await withSpinner(_0x3346a5(0x199)+_0x59de17[_0x3346a5(0x19e)]+_0x3346a5(0x1a2),()=>_0xf47744[_0x3346a5(0x1c1)][_0x3346a5(0x190)](_0x270879,_0x59de17['folder']),{'verbose':_0x59de17[_0x3346a5(0x1ab)]});_0x343f79=_0x46a5ff['data'];}}_0x59de17[_0x3346a5(0x1ab)]&&_0x343f79&&console['error'](_0x3346a5(0x194)+_0x343f79);const _0x20d938=await loadJSONFromOptions(_0x59de17['rule'],_0x59de17['ruleFile']),_0x18430b={'name':_0x36c7a0,'description':_0x59de17[_0x3346a5(0x1c3)],'rule':_0x20d938,'kind':_0x59de17[_0x3346a5(0x198)]!==undefined?parseInt(_0x59de17[_0x3346a5(0x198)],0xa):undefined,'isVisible':_0x59de17['invisible']?![]:undefined,'segmentFolderId':_0x343f79,'countPopulation':_0x59de17[_0x3346a5(0x1c4)]?![]:undefined},_0x4d9d6d=await withSpinner(_0x3346a5(0x1ba)+_0x36c7a0+_0x3346a5(0x1a2),()=>_0xf47744[_0x3346a5(0x1c1)][_0x3346a5(0x1a5)](_0x270879,_0x18430b),{'verbose':_0x59de17[_0x3346a5(0x1ab)]}),_0x183bb3=_0x4d9d6d['data'];return console[_0x3346a5(0x1a3)](_0x3346a5(0x1b5)+_0x183bb3[_0x3346a5(0x1a8)]+'\x27\x20with\x20ID:\x20'+_0x183bb3['id']),_0xe6c205!==_0x158895&&console[_0x3346a5(0x1a3)](_0x3346a5(0x1a9)+_0xe6c205),await handleSDKOutput([_0x183bb3],_0x59de17),0x0;}}
@@ -1 +1 @@
1
- const a37_0x1acb5b=a37_0x360d;(function(_0x47bc2d,_0x2b79d5){const _0x2fb00a=a37_0x360d,_0x23e215=_0x47bc2d();while(!![]){try{const _0x41fdbd=-parseInt(_0x2fb00a(0x127))/0x1*(parseInt(_0x2fb00a(0x123))/0x2)+parseInt(_0x2fb00a(0x125))/0x3*(-parseInt(_0x2fb00a(0x132))/0x4)+parseInt(_0x2fb00a(0x11d))/0x5+parseInt(_0x2fb00a(0x122))/0x6+-parseInt(_0x2fb00a(0x12a))/0x7+parseInt(_0x2fb00a(0x12c))/0x8*(-parseInt(_0x2fb00a(0x11f))/0x9)+parseInt(_0x2fb00a(0x130))/0xa;if(_0x41fdbd===_0x2b79d5)break;else _0x23e215['push'](_0x23e215['shift']());}catch(_0xc052e6){_0x23e215['push'](_0x23e215['shift']());}}}(a37_0x4ff5,0x33ac7));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';function a37_0x4ff5(){const _0x610276=['Error:\x20Parent\x20segment\x20name\x20is\x20required','6190080CsmRZM','description','20HBVXzY','Usage:\x20tdx\x20segment\x20fields\x20<parent_name>','List\x20available\x20fields\x20for\x20segmentation','data','\x20field','Listing\x20fields\x20for\x20\x27','Site:\x20','jsonl','name','768840qcirIy','\x27...','9pBkQwx','verbose','segment','1547730XGoRin','186CRJfzk','parentSegment','59199JrHAcn','βœ”\x20Found\x20','3985feWezv','error','Parent\x20segment:\x20','1146187hrlFAY','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','1488520WDuMut','site','segment:fields'];a37_0x4ff5=function(){return _0x610276;};return a37_0x4ff5();}import{withSpinner}from'../utils/spinner.js';function a37_0x360d(_0x41af99,_0x292415){_0x41af99=_0x41af99-0x115;const _0x4ff532=a37_0x4ff5();let _0x360db7=_0x4ff532[_0x41af99];return _0x360db7;}import{displayFieldsHumanReadable}from'../sdk/segment/fields-display.js';export class SegmentFieldsCommand extends BaseCommand{[a37_0x1acb5b(0x11c)]=a37_0x1acb5b(0x12e);[a37_0x1acb5b(0x131)]=a37_0x1acb5b(0x116);async['execute'](_0x368ae5){const _0x5f25f4=a37_0x1acb5b,{options:_0x206c4c,args:_0x389582,tdx:_0xd87a57}=_0x368ae5,_0x277c19=_0x389582[0x0]||_0x206c4c[_0x5f25f4(0x124)];if(!_0x277c19)return console['error'](_0x5f25f4(0x12f)),console[_0x5f25f4(0x128)](_0x5f25f4(0x115)),console['error'](_0x5f25f4(0x12b)),0x1;_0x206c4c[_0x5f25f4(0x120)]&&(console['error'](_0x5f25f4(0x11a)+_0x206c4c[_0x5f25f4(0x12d)]),console[_0x5f25f4(0x128)](_0x5f25f4(0x129)+_0x277c19));const _0x3848ef=await withSpinner(_0x5f25f4(0x119)+_0x277c19+_0x5f25f4(0x11e),()=>_0xd87a57[_0x5f25f4(0x121)]['listFields'](_0x277c19),{'verbose':_0x206c4c[_0x5f25f4(0x120)]}),_0x483a2a=_0x3848ef[_0x5f25f4(0x117)];console['error'](_0x5f25f4(0x126)+_0x483a2a['length']+_0x5f25f4(0x118)+(_0x483a2a['length']!==0x1?'s':''));if(_0x206c4c['json']||_0x206c4c[_0x5f25f4(0x11b)])return await handleSDKOutput(_0x483a2a,_0x206c4c),0x0;return displayFieldsHumanReadable(_0x483a2a,_0x277c19),0x0;}}
1
+ function a37_0x2246(){const _0x58a917=['listFields','7548792KhkoMe','execute','site','58236slGMvm','4338531PmAiKf','9iYgvZk','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','description','Parent\x20segment:\x20','List\x20available\x20fields\x20for\x20segmentation','Error:\x20Parent\x20segment\x20name\x20is\x20required','1080AfCRpK','20QmXwPT','193501KUoGSB','jsonl','272212qAuqdW','name','verbose','βœ”\x20Found\x20','error','\x27...','length','Usage:\x20tdx\x20segment\x20fields\x20<parent_name>','parentSegment','4858KMhtqH','27993680bkiRXo','\x20field','205eykwXC','segment','segment:fields','Site:\x20','Listing\x20fields\x20for\x20\x27'];a37_0x2246=function(){return _0x58a917;};return a37_0x2246();}const a37_0x4fdc4c=a37_0x564f;(function(_0x3d6834,_0x1574c6){const _0xcbddb8=a37_0x564f,_0x5d5536=_0x3d6834();while(!![]){try{const _0x46887a=-parseInt(_0xcbddb8(0x19a))/0x1+parseInt(_0xcbddb8(0x19c))/0x2*(-parseInt(_0xcbddb8(0x192))/0x3)+parseInt(_0xcbddb8(0x1b1))/0x4*(parseInt(_0xcbddb8(0x1a8))/0x5)+-parseInt(_0xcbddb8(0x198))/0x6*(-parseInt(_0xcbddb8(0x1a5))/0x7)+-parseInt(_0xcbddb8(0x1ae))/0x8+-parseInt(_0xcbddb8(0x191))/0x9*(parseInt(_0xcbddb8(0x199))/0xa)+parseInt(_0xcbddb8(0x1a6))/0xb;if(_0x46887a===_0x1574c6)break;else _0x5d5536['push'](_0x5d5536['shift']());}catch(_0x4028b2){_0x5d5536['push'](_0x5d5536['shift']());}}}(a37_0x2246,0xb8dbf));import{BaseCommand}from'./command.js';function a37_0x564f(_0x320dec,_0x39f3b9){_0x320dec=_0x320dec-0x191;const _0x2246a0=a37_0x2246();let _0x564f88=_0x2246a0[_0x320dec];return _0x564f88;}import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{displayFieldsHumanReadable}from'../sdk/segment/fields-display.js';export class SegmentFieldsCommand extends BaseCommand{[a37_0x4fdc4c(0x19d)]=a37_0x4fdc4c(0x1aa);[a37_0x4fdc4c(0x194)]=a37_0x4fdc4c(0x196);async[a37_0x4fdc4c(0x1af)](_0x385a99){const _0xc7e9f2=a37_0x4fdc4c,{options:_0x491633,args:_0x1a2e24,tdx:_0x619a26}=_0x385a99,_0x545a9f=_0x1a2e24[0x0]||_0x491633[_0xc7e9f2(0x1a4)];if(!_0x545a9f)return console[_0xc7e9f2(0x1a0)](_0xc7e9f2(0x197)),console[_0xc7e9f2(0x1a0)](_0xc7e9f2(0x1a3)),console[_0xc7e9f2(0x1a0)](_0xc7e9f2(0x193)),0x1;_0x491633[_0xc7e9f2(0x19e)]&&(console[_0xc7e9f2(0x1a0)](_0xc7e9f2(0x1ab)+_0x491633[_0xc7e9f2(0x1b0)]),console[_0xc7e9f2(0x1a0)](_0xc7e9f2(0x195)+_0x545a9f));const _0x2b6caa=await withSpinner(_0xc7e9f2(0x1ac)+_0x545a9f+_0xc7e9f2(0x1a1),()=>_0x619a26[_0xc7e9f2(0x1a9)][_0xc7e9f2(0x1ad)](_0x545a9f),{'verbose':_0x491633[_0xc7e9f2(0x19e)]}),_0x4e6964=_0x2b6caa['data'];console[_0xc7e9f2(0x1a0)](_0xc7e9f2(0x19f)+_0x4e6964[_0xc7e9f2(0x1a2)]+_0xc7e9f2(0x1a7)+(_0x4e6964[_0xc7e9f2(0x1a2)]!==0x1?'s':''));if(_0x491633['json']||_0x491633[_0xc7e9f2(0x19b)])return await handleSDKOutput(_0x4e6964,_0x491633),0x0;return displayFieldsHumanReadable(_0x4e6964,_0x545a9f),0x0;}}
@@ -1 +1 @@
1
- const a38_0x44ae17=a38_0x5b90;(function(_0x3d42f7,_0x135855){const _0x4cb576=a38_0x5b90,_0x54943b=_0x3d42f7();while(!![]){try{const _0x1ad0a9=-parseInt(_0x4cb576(0xb7))/0x1+parseInt(_0x4cb576(0xb4))/0x2*(-parseInt(_0x4cb576(0xde))/0x3)+-parseInt(_0x4cb576(0x9f))/0x4+parseInt(_0x4cb576(0xb9))/0x5+parseInt(_0x4cb576(0xaf))/0x6+-parseInt(_0x4cb576(0xbd))/0x7*(parseInt(_0x4cb576(0xa7))/0x8)+-parseInt(_0x4cb576(0xa3))/0x9*(-parseInt(_0x4cb576(0xd7))/0xa);if(_0x1ad0a9===_0x135855)break;else _0x54943b['push'](_0x54943b['shift']());}catch(_0x562b83){_0x54943b['push'](_0x54943b['shift']());}}}(a38_0x1d71,0x31ddf));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{saveSessionContext}from'../core/session.js';function a38_0x1d71(){const _0x688228=['helpText','execute','site','\x0aPull\x20summary\x20for\x20\x27','content','no_parent','\x20files\x20to\x20','\x0aChanges\x20to\x20\x27','description','Write\x20','errorCode','activations','dryRun','1437292VBLpBl','parentName','dirname','\x20files?','36Cayzlj','data','\x0aError:','Target\x20resource:\x20','128SJutuQ','yellow','file','\x20\x20🎯\x20','setPhase','relativePath','red','βœ”\x20Context\x20set:\x20','562920bZIlPN','\x20new\x20files','message','\x20versions)','isNew','2OpyCTo','green','Pulling\x20segments\x20from\x20\x27','338150VqdmdC','parentSegment','740180uSCGWe','targetDir','error','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file','43652IddBZr','\x20with\x20','\x20\x20πŸ—ΊοΈ\x20\x20','\x20activations','βœ”\x20Pulled\x20','\x20unchanged\x20files','length','dim','\x20journeys','type','hasChanges','No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27','\x20segments','parent_segment','segment:pull','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','segments','\x20\x20Target:\x20','files','diff','cyan','\x20changed\x20files','journeyVersions','verbose','session','Aborted.','2783480WRfXpE','\x27...','\x20=\x20','Parent\x20segment:\x20','segment','filter','absolutePath','1061232crXPlg','yes','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','counts','journeys'];a38_0x1d71=function(){return _0x688228;};return a38_0x1d71();}function a38_0x5b90(_0x43c5d3,_0xe8362b){_0x43c5d3=_0x43c5d3-0x9c;const _0x1d7135=a38_0x1d71();let _0x5b9000=_0x1d7135[_0x43c5d3];return _0x5b9000;}import a38_0x3e319a from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';import a38_0x457981 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']=a38_0x44ae17(0xcb);[a38_0x44ae17(0xeb)]='Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files';async[a38_0x44ae17(0xe4)](_0x592de3){const _0xec711f=a38_0x44ae17,{options:_0x4c8306,args:_0x1995ee,tdx:_0x170aa4}=_0x592de3,_0x35c81c=_0x4c8306,_0x3b38f0=await resolveTarget({'arg':_0x1995ee[0x0],'contextParent':_0x4c8306[_0xec711f(0xb8)],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x3b38f0))return _0x3b38f0[_0xec711f(0x9c)]===_0xec711f(0xe8)?(console[_0xec711f(0xbb)](a38_0x3e319a[_0xec711f(0xa8)](_0xec711f(0xcc))),console[_0xec711f(0xbb)]('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']('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent'),console[_0xec711f(0xbb)](_0xec711f(0xbc))):(console[_0xec711f(0xbb)](a38_0x3e319a[_0xec711f(0xad)]('Error:\x20'+_0x3b38f0[_0xec711f(0xb1)]+'\x0a')),_0x3b38f0[_0xec711f(0xe3)]&&console[_0xec711f(0xbb)](a38_0x3e319a[_0xec711f(0xd1)](_0x3b38f0['helpText']))),0x1;const _0xccb151=_0x3b38f0[_0xec711f(0xa0)],_0x5a6df2=_0x3b38f0[_0xec711f(0xba)],_0x44393b=_0x3b38f0[_0xec711f(0xc6)]===_0xec711f(0xa9)?_0x3b38f0['resourceName']:undefined;_0x35c81c['verbose']&&(console[_0xec711f(0xbb)]('Site:\x20'+_0x35c81c[_0xec711f(0xe5)]),console[_0xec711f(0xbb)](_0xec711f(0xda)+_0xccb151),_0x44393b&&console['error'](_0xec711f(0xa6)+_0x44393b));const _0xf4858=await withProgressSpinner(_0xec711f(0xb6)+_0xccb151+_0xec711f(0xd8),_0x4d7c0c=>_0x170aa4[_0xec711f(0xdb)]['pullSegments'](_0xccb151,{'targetDir':_0x5a6df2,'targetResourceName':_0x44393b,'verbose':_0x35c81c[_0xec711f(0xd4)],'progress':{'update':_0x4cb8bc=>{const _0x20f7e5=_0xec711f;_0x4d7c0c[_0x20f7e5(0xab)](_0x4cb8bc),_0x35c81c[_0x20f7e5(0xd4)]&&console[_0x20f7e5(0xbb)]('\x20\x20'+_0x4cb8bc);}}}),{'verbose':_0x35c81c[_0xec711f(0xd4)]}),_0x6ff04=_0xf4858[_0xec711f(0xa4)];if(_0x6ff04[_0xec711f(0xe1)][_0xec711f(0xcd)]===0x0&&_0x6ff04['counts'][_0xec711f(0xe2)]===0x0)return console['error'](a38_0x3e319a[_0xec711f(0xa8)](_0xec711f(0xc8)+_0x6ff04[_0xec711f(0xa0)]+'\x27')),0x0;const _0x1cfd6b=_0x6ff04['files'][_0xec711f(0xdc)](_0x487876=>_0x487876[_0xec711f(0xb3)]),_0x15093e=_0x6ff04[_0xec711f(0xcf)][_0xec711f(0xdc)](_0x22085b=>!_0x22085b[_0xec711f(0xb3)]&&_0x22085b[_0xec711f(0xc7)]),_0x2243fe=_0x6ff04[_0xec711f(0xcf)][_0xec711f(0xdc)](_0x3945c3=>!_0x3945c3[_0xec711f(0xb3)]&&!_0x3945c3[_0xec711f(0xc7)]);console[_0xec711f(0xbb)](_0xec711f(0xe6)+_0x6ff04[_0xec711f(0xa0)]+'\x27:'),console[_0xec711f(0xbb)](_0xec711f(0xaa)+a38_0x3e319a[_0xec711f(0xd1)](_0x6ff04[_0xec711f(0xe1)][_0xec711f(0xcd)]+_0xec711f(0xc9))+_0xec711f(0xbe)+a38_0x3e319a[_0xec711f(0xd1)](_0x6ff04[_0xec711f(0xe1)][_0xec711f(0x9d)]+_0xec711f(0xc0)));if(_0x6ff04[_0xec711f(0xe1)][_0xec711f(0xe2)]>0x0){const _0x1468da=_0x6ff04['counts'][_0xec711f(0xd3)]>_0x6ff04[_0xec711f(0xe1)][_0xec711f(0xe2)]?'\x20('+_0x6ff04[_0xec711f(0xe1)]['journeyVersions']+_0xec711f(0xb2):'';console[_0xec711f(0xbb)](_0xec711f(0xbf)+a38_0x3e319a[_0xec711f(0xd1)](_0x6ff04[_0xec711f(0xe1)][_0xec711f(0xe2)]+_0xec711f(0xc5))+a38_0x3e319a[_0xec711f(0xc4)](_0x1468da));}console['error']('\x20\x20'+a38_0x3e319a[_0xec711f(0xb5)]('+\x20'+_0x1cfd6b[_0xec711f(0xc3)]+_0xec711f(0xb0))),console['error']('\x20\x20'+a38_0x3e319a['yellow']('~\x20'+_0x15093e['length']+_0xec711f(0xd2))),console['error']('\x20\x20'+a38_0x3e319a['dim']('=\x20'+_0x2243fe[_0xec711f(0xc3)]+_0xec711f(0xc2))),console[_0xec711f(0xbb)](_0xec711f(0xce)+a38_0x3e319a[_0xec711f(0xd1)](_0x6ff04['targetDir'])+'\x0a');if(_0x15093e[_0xec711f(0xc3)]>0x0)for(const _0x5d6caf of _0x15093e){console[_0xec711f(0xbb)](_0xec711f(0xea)+_0x5d6caf[_0xec711f(0xac)]+'\x27:'),console['error']('─'['repeat'](0x3c)),console[_0xec711f(0xbb)](_0x5d6caf[_0xec711f(0xd0)]),console[_0xec711f(0xbb)]('─'['repeat'](0x3c));}if(_0x35c81c[_0xec711f(0x9e)])return console['error'](a38_0x3e319a[_0xec711f(0xa8)]('\x0a[Dry\x20run]\x20No\x20files\x20were\x20written')),0x0;if(_0x1cfd6b[_0xec711f(0xc3)]===0x0&&_0x15093e[_0xec711f(0xc3)]===0x0)return console[_0xec711f(0xbb)](a38_0x3e319a[_0xec711f(0xb5)]('βœ”\x20All\x20files\x20are\x20up\x20to\x20date')),saveSessionContext({'parent_segment':_0x6ff04['parentName']},_0x35c81c[_0xec711f(0xd5)]),console[_0xec711f(0xbb)](a38_0x3e319a[_0xec711f(0xb5)]('βœ”\x20Context\x20set:\x20'+a38_0x3e319a[_0xec711f(0xc4)]('parent_segment')+_0xec711f(0xd9)+a38_0x3e319a[_0xec711f(0xd1)](_0x6ff04['parentName']))),0x0;if(!_0x35c81c[_0xec711f(0xdf)]){if(!isInteractive())return console['error'](a38_0x3e319a[_0xec711f(0xad)](_0xec711f(0xa5)),_0xec711f(0xe0)),console[_0xec711f(0xbb)](a38_0x3e319a[_0xec711f(0xc4)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0xac5d2=await confirmKey(_0xec711f(0xec)+(_0x1cfd6b[_0xec711f(0xc3)]+_0x15093e[_0xec711f(0xc3)])+_0xec711f(0xa2));if(!_0xac5d2)return console[_0xec711f(0xbb)](a38_0x3e319a[_0xec711f(0xa8)](_0xec711f(0xd6)),'-\x20no\x20files\x20written'),0x1;}for(const _0x51f1bf of _0x6ff04[_0xec711f(0xcf)]){if(_0x51f1bf[_0xec711f(0xb3)]||_0x51f1bf[_0xec711f(0xc7)]){const _0x35c0a9=a38_0x457981[_0xec711f(0xa1)](_0x51f1bf[_0xec711f(0xdd)]);!existsSync(_0x35c0a9)&&mkdirSync(_0x35c0a9,{'recursive':!![]}),writeFileSync(_0x51f1bf['absolutePath'],_0x51f1bf[_0xec711f(0xe7)],'utf-8');}}return console[_0xec711f(0xbb)](a38_0x3e319a[_0xec711f(0xb5)](_0xec711f(0xc1)+(_0x1cfd6b[_0xec711f(0xc3)]+_0x15093e[_0xec711f(0xc3)])+_0xec711f(0xe9)+_0x6ff04[_0xec711f(0xba)])),saveSessionContext({'parent_segment':_0x6ff04[_0xec711f(0xa0)]},_0x35c81c['session']),console[_0xec711f(0xbb)](a38_0x3e319a['green'](_0xec711f(0xae)+a38_0x3e319a['dim'](_0xec711f(0xca))+'\x20=\x20'+a38_0x3e319a[_0xec711f(0xd1)](_0x6ff04[_0xec711f(0xa0)]))),0x0;}}
1
+ const a38_0x47ef95=a38_0x586d;(function(_0x2cd7e1,_0x769aed){const _0x43aa07=a38_0x586d,_0xf9fd58=_0x2cd7e1();while(!![]){try{const _0x57c744=-parseInt(_0x43aa07(0x129))/0x1*(parseInt(_0x43aa07(0x13d))/0x2)+-parseInt(_0x43aa07(0x108))/0x3*(parseInt(_0x43aa07(0x13a))/0x4)+-parseInt(_0x43aa07(0x103))/0x5+-parseInt(_0x43aa07(0x116))/0x6+-parseInt(_0x43aa07(0x14d))/0x7+parseInt(_0x43aa07(0x139))/0x8*(parseInt(_0x43aa07(0x107))/0x9)+parseInt(_0x43aa07(0x126))/0xa;if(_0x57c744===_0x769aed)break;else _0xf9fd58['push'](_0xf9fd58['shift']());}catch(_0x591166){_0xf9fd58['push'](_0xf9fd58['shift']());}}}(a38_0x2ad6,0x8bdbb));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{saveSessionContext}from'../core/session.js';function a38_0x2ad6(){const _0x40e8d4=['\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files','\x20versions)','setPhase','type','βœ”\x20Context\x20set:\x20','\x20journeys','yes','Parent\x20segment:\x20','parentName','yellow','length','message','utf-8','data','26451520njrTPr','\x20\x20Target:\x20','file','1pdBSpA','Site:\x20','\x20=\x20','cwd','Error:\x20','targetDir','error','\x20segments','description','cyan','pullSegments','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)','absolutePath','\x0aPull\x20summary\x20for\x20\x27','filter','isNew','24gAWHOj','2093260pGAheb','activations','segments','1359986ahWcqj','helpText','βœ”\x20All\x20files\x20are\x20up\x20to\x20date','\x20new\x20files','\x27...','files','\x20activations','journeys','dryRun','-\x20no\x20files\x20written','verbose','no_parent','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent','Write\x20','repeat','name','5375111MMJdxy','counts','\x20unchanged\x20files','parent_segment','resourceName','parentSegment','3779485csPuLv','\x20\x20🎯\x20','βœ”\x20Pulled\x20','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','2183886dqvTXa','3bHphMI','\x20with\x20','\x0aError:','diff','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','green','segment:pull','dim','hasChanges','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file','errorCode','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','\x20\x20πŸ—ΊοΈ\x20\x20','\x0aChanges\x20to\x20\x27','439062iTgWog'];a38_0x2ad6=function(){return _0x40e8d4;};return a38_0x2ad6();}import a38_0x516896 from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';function a38_0x586d(_0xf9c8fc,_0x1868eb){_0xf9c8fc=_0xf9c8fc-0x100;const _0x2ad642=a38_0x2ad6();let _0x586d06=_0x2ad642[_0xf9c8fc];return _0x586d06;}import a38_0x4c5a86 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{[a38_0x47ef95(0x14c)]=a38_0x47ef95(0x10e);[a38_0x47ef95(0x131)]=a38_0x47ef95(0x118);async['execute'](_0x2c6d8a){const _0x3a52f0=a38_0x47ef95,{options:_0x5172f4,args:_0x2e68af,tdx:_0x545523}=_0x2c6d8a,_0x45297b=_0x5172f4,_0x516ad4=await resolveTarget({'arg':_0x2e68af[0x0],'contextParent':_0x5172f4[_0x3a52f0(0x102)],'cwd':process[_0x3a52f0(0x12c)]()});if(!isSuccessfulResolution(_0x516ad4))return _0x516ad4[_0x3a52f0(0x112)]===_0x3a52f0(0x148)?(console[_0x3a52f0(0x12f)](a38_0x516896[_0x3a52f0(0x121)](_0x3a52f0(0x106))),console[_0x3a52f0(0x12f)](_0x3a52f0(0x134)),console[_0x3a52f0(0x12f)](_0x3a52f0(0x149)),console[_0x3a52f0(0x12f)](_0x3a52f0(0x111))):(console['error'](a38_0x516896['red'](_0x3a52f0(0x12d)+_0x516ad4[_0x3a52f0(0x123)]+'\x0a')),_0x516ad4[_0x3a52f0(0x13e)]&&console[_0x3a52f0(0x12f)](a38_0x516896['cyan'](_0x516ad4[_0x3a52f0(0x13e)]))),0x1;const _0x342852=_0x516ad4['parentName'],_0x2340e4=_0x516ad4[_0x3a52f0(0x12e)],_0x49ee39=_0x516ad4[_0x3a52f0(0x11b)]===_0x3a52f0(0x128)?_0x516ad4[_0x3a52f0(0x101)]:undefined;_0x45297b[_0x3a52f0(0x147)]&&(console['error'](_0x3a52f0(0x12a)+_0x45297b['site']),console[_0x3a52f0(0x12f)](_0x3a52f0(0x11f)+_0x342852),_0x49ee39&&console[_0x3a52f0(0x12f)]('Target\x20resource:\x20'+_0x49ee39));const _0x273058=await withProgressSpinner('Pulling\x20segments\x20from\x20\x27'+_0x342852+_0x3a52f0(0x141),_0x3f928c=>_0x545523['segment'][_0x3a52f0(0x133)](_0x342852,{'targetDir':_0x2340e4,'targetResourceName':_0x49ee39,'verbose':_0x45297b[_0x3a52f0(0x147)],'progress':{'update':_0x4584fa=>{const _0x336613=_0x3a52f0;_0x3f928c[_0x336613(0x11a)](_0x4584fa),_0x45297b[_0x336613(0x147)]&&console[_0x336613(0x12f)]('\x20\x20'+_0x4584fa);}}}),{'verbose':_0x45297b['verbose']}),_0x3bc790=_0x273058[_0x3a52f0(0x125)];if(_0x3bc790['counts'][_0x3a52f0(0x13c)]===0x0&&_0x3bc790[_0x3a52f0(0x14e)][_0x3a52f0(0x144)]===0x0)return console[_0x3a52f0(0x12f)](a38_0x516896[_0x3a52f0(0x121)]('No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27'+_0x3bc790[_0x3a52f0(0x120)]+'\x27')),0x0;const _0x575267=_0x3bc790[_0x3a52f0(0x142)][_0x3a52f0(0x137)](_0x371ee7=>_0x371ee7[_0x3a52f0(0x138)]),_0x55238c=_0x3bc790['files'][_0x3a52f0(0x137)](_0x2afb07=>!_0x2afb07[_0x3a52f0(0x138)]&&_0x2afb07[_0x3a52f0(0x110)]),_0x170afa=_0x3bc790[_0x3a52f0(0x142)][_0x3a52f0(0x137)](_0x406c1c=>!_0x406c1c[_0x3a52f0(0x138)]&&!_0x406c1c['hasChanges']);console[_0x3a52f0(0x12f)](_0x3a52f0(0x136)+_0x3bc790['parentName']+'\x27:'),console[_0x3a52f0(0x12f)](_0x3a52f0(0x104)+a38_0x516896[_0x3a52f0(0x132)](_0x3bc790[_0x3a52f0(0x14e)]['segments']+_0x3a52f0(0x130))+_0x3a52f0(0x109)+a38_0x516896['cyan'](_0x3bc790['counts'][_0x3a52f0(0x13b)]+_0x3a52f0(0x143)));if(_0x3bc790['counts'][_0x3a52f0(0x144)]>0x0){const _0x2950df=_0x3bc790[_0x3a52f0(0x14e)]['journeyVersions']>_0x3bc790[_0x3a52f0(0x14e)][_0x3a52f0(0x144)]?'\x20('+_0x3bc790['counts']['journeyVersions']+_0x3a52f0(0x119):'';console[_0x3a52f0(0x12f)](_0x3a52f0(0x114)+a38_0x516896['cyan'](_0x3bc790[_0x3a52f0(0x14e)][_0x3a52f0(0x144)]+_0x3a52f0(0x11d))+a38_0x516896[_0x3a52f0(0x10f)](_0x2950df));}console[_0x3a52f0(0x12f)]('\x20\x20'+a38_0x516896[_0x3a52f0(0x10d)]('+\x20'+_0x575267[_0x3a52f0(0x122)]+_0x3a52f0(0x140))),console['error']('\x20\x20'+a38_0x516896['yellow']('~\x20'+_0x55238c[_0x3a52f0(0x122)]+'\x20changed\x20files')),console[_0x3a52f0(0x12f)]('\x20\x20'+a38_0x516896['dim']('=\x20'+_0x170afa[_0x3a52f0(0x122)]+_0x3a52f0(0x14f))),console[_0x3a52f0(0x12f)](_0x3a52f0(0x127)+a38_0x516896[_0x3a52f0(0x132)](_0x3bc790['targetDir'])+'\x0a');if(_0x55238c['length']>0x0)for(const _0x1f2da2 of _0x55238c){console[_0x3a52f0(0x12f)](_0x3a52f0(0x115)+_0x1f2da2['relativePath']+'\x27:'),console[_0x3a52f0(0x12f)]('─'['repeat'](0x3c)),console[_0x3a52f0(0x12f)](_0x1f2da2[_0x3a52f0(0x10b)]),console[_0x3a52f0(0x12f)]('─'[_0x3a52f0(0x14b)](0x3c));}if(_0x45297b[_0x3a52f0(0x145)])return console[_0x3a52f0(0x12f)](a38_0x516896[_0x3a52f0(0x121)](_0x3a52f0(0x117))),0x0;if(_0x575267[_0x3a52f0(0x122)]===0x0&&_0x55238c[_0x3a52f0(0x122)]===0x0)return console[_0x3a52f0(0x12f)](a38_0x516896[_0x3a52f0(0x10d)](_0x3a52f0(0x13f))),saveSessionContext({'parent_segment':_0x3bc790['parentName']},_0x45297b['session']),console[_0x3a52f0(0x12f)](a38_0x516896[_0x3a52f0(0x10d)](_0x3a52f0(0x11c)+a38_0x516896['dim'](_0x3a52f0(0x100))+_0x3a52f0(0x12b)+a38_0x516896[_0x3a52f0(0x132)](_0x3bc790[_0x3a52f0(0x120)]))),0x0;if(!_0x45297b[_0x3a52f0(0x11e)]){if(!isInteractive())return console[_0x3a52f0(0x12f)](a38_0x516896['red'](_0x3a52f0(0x10a)),_0x3a52f0(0x113)),console['error'](a38_0x516896['dim'](_0x3a52f0(0x10c))),0x1;const _0x580837=await confirmKey(_0x3a52f0(0x14a)+(_0x575267[_0x3a52f0(0x122)]+_0x55238c[_0x3a52f0(0x122)])+'\x20files?');if(!_0x580837)return console[_0x3a52f0(0x12f)](a38_0x516896[_0x3a52f0(0x121)]('Aborted.'),_0x3a52f0(0x146)),0x1;}for(const _0x4d6156 of _0x3bc790[_0x3a52f0(0x142)]){if(_0x4d6156[_0x3a52f0(0x138)]||_0x4d6156['hasChanges']){const _0x5aab8d=a38_0x4c5a86['dirname'](_0x4d6156[_0x3a52f0(0x135)]);!existsSync(_0x5aab8d)&&mkdirSync(_0x5aab8d,{'recursive':!![]}),writeFileSync(_0x4d6156[_0x3a52f0(0x135)],_0x4d6156['content'],_0x3a52f0(0x124));}}return console[_0x3a52f0(0x12f)](a38_0x516896[_0x3a52f0(0x10d)](_0x3a52f0(0x105)+(_0x575267['length']+_0x55238c[_0x3a52f0(0x122)])+'\x20files\x20to\x20'+_0x3bc790[_0x3a52f0(0x12e)])),saveSessionContext({'parent_segment':_0x3bc790['parentName']},_0x45297b['session']),console['error'](a38_0x516896[_0x3a52f0(0x10d)](_0x3a52f0(0x11c)+a38_0x516896[_0x3a52f0(0x10f)](_0x3a52f0(0x100))+_0x3a52f0(0x12b)+a38_0x516896[_0x3a52f0(0x132)](_0x3bc790[_0x3a52f0(0x120)]))),0x0;}}
@@ -1 +1 @@
1
- const a39_0x53e847=a39_0x20a9;function a39_0x5322(){const _0x2f6bda=['Changes\x20to:','4589760rifIZA','journeyId','listSegments','New\x20journey:','journeyBundleName','\x20updated','createdAt','journey','message','Scoped\x20to\x20folder:\x20','set','yellow','parentSegment','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','Delete\x20segment:','dim','parent_name','Delete\x20journey:','\x27...','\x20unchanged','\x0aβœ”\x20Push\x20complete','dryRun','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','relationships','execute','Preparing\x20journeys...','\x20\x20Activations:\x20','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','\x20to\x20delete','yamlConfig','filter','βœ”\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','Error:\x20','state','red','journeys','\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20','getOutputSchemaWithCache','type','existingJourney','folderPath','nameToType','repeat','toCreate','folders','file','deleted','updatedAt','journeysOnly','results','\x0aError:','\x20YAML\x20files\x20found','yes','7497152ErNKVR','verbose','Site:\x20','resolveParentId','site','cwd','\x0aPush\x20summary\x20for\x20\x27','listFolders','filePath','segment\x20or\x20journey','errorCode','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','segment:push','Fetching\x20existing\x20activations...','existingSegment','error','delete','\x20new','get','parentFolder','\x20\x20\x20\x20','blue','\x20folders\x20to\x20create','name','endsWith','(Journey\x20will\x20be\x20deleted)','paused','changed','Resolving\x20parent\x20segment\x20\x27','green','isScoped','segment','segments','/e/','New\x20segment:','nameToId','\x20\x20Journeys:\x20','updated','scopedFolderPath','getJourney','list','buildUserMaps','idToName','Fetching\x20connections\x20for\x20name\x20resolution...','folderId','created','data','Changes\x20to\x20journey:','description','\x20\x20πŸ“Š\x20Segments:','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','cyan','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)','add','diff','\x0aValidation\x20failed:','toUpdate','map','439538qZwKpB','\x20\x20Source:\x20','isNew','attributes','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file','14dowAmu','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','listJourneysWithDetailsFromParentSegment','listActivations','\x20\x20Activations:','/app/ps/','.yaml','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','\x20deleted','segmentFolderId','push','no_parent','\x20changed','versionNumber','βœ”\x20All\x20journeys\x20are\x20up\x20to\x20date','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','all','1328344TOZGek','connection','journeyBundleId','unchanged','1029048YcZPvZ','join','activations','createdSegmentIds','3253761XOqapC','length','new','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','464428icQAmO','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','targetDir','Fetching\x20existing\x20data...','\x20created','helpText','setPhase','Aborted.','then','toDelete','\x20activations]','/sb/da/esr','getParent'];a39_0x5322=function(){return _0x2f6bda;};return a39_0x5322();}(function(_0x24f2c0,_0xb5a7bf){const _0x1d2c40=a39_0x20a9,_0x559bb9=_0x24f2c0();while(!![]){try{const _0x598e97=-parseInt(_0x1d2c40(0x17b))/0x1+-parseInt(_0x1d2c40(0x191))/0x2+-parseInt(_0x1d2c40(0x199))/0x3+parseInt(_0x1d2c40(0x19d))/0x4+parseInt(_0x1d2c40(0x1ab))/0x5+-parseInt(_0x1d2c40(0x195))/0x6+parseInt(_0x1d2c40(0x180))/0x7*(parseInt(_0x1d2c40(0x141))/0x8);if(_0x598e97===_0xb5a7bf)break;else _0x559bb9['push'](_0x559bb9['shift']());}catch(_0x1d268e){_0x559bb9['push'](_0x559bb9['shift']());}}}(a39_0x5322,0x85ebe));import{BaseCommand}from'./command.js';function a39_0x20a9(_0x647cbf,_0x4d89c8){_0x647cbf=_0x647cbf-0x11b;const _0x5322f9=a39_0x5322();let _0x20a912=_0x5322f9[_0x647cbf];return _0x20a912;}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 a39_0x335156 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{[a39_0x53e847(0x158)]=a39_0x53e847(0x14d);['description']=a39_0x53e847(0x122);async[a39_0x53e847(0x124)](_0x3f48fb){const _0x5945bc=a39_0x53e847,{options:_0x5c7fea,args:_0x4a34d7,tdx:_0x1a0847}=_0x3f48fb,_0x51827d=_0x5c7fea,_0x52d3b9=await resolveTarget({'arg':_0x4a34d7[0x0],'contextParent':_0x5c7fea[_0x5945bc(0x1b7)],'cwd':process[_0x5945bc(0x146)]()});if(!isSuccessfulResolution(_0x52d3b9))return _0x52d3b9[_0x5945bc(0x14b)]===_0x5945bc(0x18b)?(console[_0x5945bc(0x150)](a39_0x335156[_0x5945bc(0x1b6)](_0x5945bc(0x187))),console[_0x5945bc(0x150)](_0x5945bc(0x175)),console[_0x5945bc(0x150)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent'),console['error'](_0x5945bc(0x17f))):(console[_0x5945bc(0x150)](a39_0x335156[_0x5945bc(0x12e)](_0x5945bc(0x12c)+_0x52d3b9[_0x5945bc(0x1b3)]+'\x0a')),_0x52d3b9[_0x5945bc(0x1a2)]&&console[_0x5945bc(0x150)](a39_0x335156[_0x5945bc(0x174)](_0x52d3b9[_0x5945bc(0x1a2)]))),0x1;if(_0x52d3b9[_0x5945bc(0x132)]===_0x5945bc(0x11c))return console['error'](a39_0x335156[_0x5945bc(0x12e)]('Error:\x20Directory\x20not\x20found:\x20'+_0x52d3b9[_0x5945bc(0x19f)]+'\x0a')),console['error'](a39_0x335156[_0x5945bc(0x174)](_0x5945bc(0x181))),0x1;const _0x3c9d7e=_0x52d3b9['parentName'],_0x31a92b=_0x52d3b9[_0x5945bc(0x19f)],_0x247c47=_0x52d3b9['type']===_0x5945bc(0x139)?_0x52d3b9[_0x5945bc(0x149)]:undefined,_0x2f112b=getScopedDetails(_0x52d3b9),_0x158e7c=_0x2f112b?.[_0x5945bc(0x15f)]??![],_0x30a00c=_0x2f112b?.[_0x5945bc(0x167)]??'';if(!existsSync(_0x31a92b))return console['error'](a39_0x335156[_0x5945bc(0x12e)]('Error:\x20Directory\x20not\x20found:\x20'+_0x31a92b+'\x0a')),console[_0x5945bc(0x150)](a39_0x335156[_0x5945bc(0x174)]('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;_0x51827d['verbose']&&(console['error'](_0x5945bc(0x143)+_0x51827d[_0x5945bc(0x145)]),console[_0x5945bc(0x150)]('Parent\x20segment:\x20'+_0x3c9d7e),console[_0x5945bc(0x150)]('Source\x20directory:\x20'+_0x31a92b),_0x158e7c&&console['error'](_0x5945bc(0x1b4)+_0x30a00c));const _0x86aad5=await withSpinner(_0x5945bc(0x15d)+_0x3c9d7e+_0x5945bc(0x11e),()=>_0x1a0847[_0x5945bc(0x160)][_0x5945bc(0x144)](_0x3c9d7e),{'verbose':_0x51827d[_0x5945bc(0x142)]}),_0x2d80ec=_0x86aad5['data'],{parentSegmentResult:_0x2e6f25,segmentsResult:_0x326297,foldersResult:_0x53d5f2,journeysWithDetailsResult:_0x32660f,userMaps:_0x2b2590}=await withSpinner(_0x5945bc(0x1a0),async()=>{const _0x4042df=_0x5945bc,[_0x1930d0,_0x552522,_0x3095b6,_0x119223,_0x26d67b]=await Promise['all']([_0x1a0847[_0x4042df(0x160)][_0x4042df(0x1a9)](_0x2d80ec),_0x1a0847[_0x4042df(0x160)][_0x4042df(0x1ad)](_0x2d80ec),_0x1a0847['segment'][_0x4042df(0x148)](_0x2d80ec),_0x1a0847[_0x4042df(0x1b2)][_0x4042df(0x182)](_0x2d80ec,{'includeAllVersions':!![]}),_0x1a0847['user'][_0x4042df(0x16a)]()]);return{'parentSegmentResult':_0x1930d0,'segmentsResult':_0x552522,'foldersResult':_0x3095b6,'journeysWithDetailsResult':_0x119223,'userMaps':_0x26d67b};},{'verbose':_0x51827d[_0x5945bc(0x142)]})[_0x5945bc(0x1a5)](_0x226958=>_0x226958[_0x5945bc(0x16f)]),_0x449a6e=_0x2e6f25,_0x4930fa=extractRootFolderId(_0x449a6e),_0x3b0a44=_0x326297,_0xac1f0a=_0x53d5f2,{journeys:_0x597488,activationStepsById:_0x5da580}=_0x32660f,_0x584b3d=new Map(_0x597488[_0x5945bc(0x17a)](_0x2aa6c1=>[_0x2aa6c1['id'],_0x2aa6c1])),_0x2e8b03=_0x597488[_0x5945bc(0x17a)](_0x21d721=>({'id':_0x21d721['id'],'name':_0x21d721[_0x5945bc(0x17e)][_0x5945bc(0x158)],'journeyBundleName':_0x21d721[_0x5945bc(0x17e)][_0x5945bc(0x1af)]||'','journeyBundleId':_0x21d721[_0x5945bc(0x17e)][_0x5945bc(0x193)]||'','versionNumber':_0x21d721[_0x5945bc(0x17e)][_0x5945bc(0x18d)],'description':_0x21d721['attributes'][_0x5945bc(0x171)],'state':_0x21d721[_0x5945bc(0x17e)][_0x5945bc(0x12d)],'paused':_0x21d721[_0x5945bc(0x17e)][_0x5945bc(0x15b)],'audienceId':_0x21d721[_0x5945bc(0x17e)]['audienceId'],'folderId':_0x21d721[_0x5945bc(0x123)]?.[_0x5945bc(0x154)]?.['data']?.['id'],'createdAt':_0x21d721[_0x5945bc(0x17e)][_0x5945bc(0x1b1)],'updatedAt':_0x21d721[_0x5945bc(0x17e)][_0x5945bc(0x13b)]})),{emailToId:_0x149a4b,idToEmail:_0x208b1e}=_0x2b2590,_0x1e41fa=await withSpinner(_0x5945bc(0x16c),async()=>{const _0x36b014=_0x5945bc,_0x511178=await _0x1a0847['connection'][_0x36b014(0x169)]();return buildConnectionMaps(_0x511178);},{'verbose':_0x51827d[_0x5945bc(0x142)]})[_0x5945bc(0x1a5)](_0x3c7bd6=>_0x3c7bd6[_0x5945bc(0x16f)]),_0x46e7e9=_0x1e41fa[_0x5945bc(0x164)],_0x37ad9d=_0x1e41fa[_0x5945bc(0x16b)],_0x22d826=_0x1e41fa[_0x5945bc(0x135)],_0x284e46={'emailToIdMap':_0x149a4b,'connectionNameToIdMap':_0x46e7e9,'connectionNameToTypeMap':_0x22d826,'getSchema':_0x8c1937=>_0x1a0847[_0x5945bc(0x192)][_0x5945bc(0x131)](_0x8c1937)};let {pathToId:_0x2b4e3e,idToPath:_0x1e7128}=buildFolderMaps(_0xac1f0a);const _0xd2449=buildSegmentLookupMap(_0x3b0a44,_0x1e7128),_0x18830e=buildSegmentNameToIdMap(_0x3b0a44),_0x42fb4c=buildJourneyBundleLookupMap(_0x2e8b03,_0x1e7128);let _0x25a692;if(_0x247c47){if(!_0x247c47[_0x5945bc(0x159)]('.yml')&&!_0x247c47['endsWith'](_0x5945bc(0x186)))return console[_0x5945bc(0x150)](a39_0x335156['red']('Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20'+_0x247c47+'\x0a')),0x1;_0x25a692=[_0x247c47];}else _0x25a692=findYamlFiles(_0x31a92b);if(_0x25a692[_0x5945bc(0x19a)]===0x0)return console[_0x5945bc(0x150)](a39_0x335156[_0x5945bc(0x12e)](_0x5945bc(0x1b8)+_0x31a92b+'\x0a')),console[_0x5945bc(0x150)](a39_0x335156['cyan'](_0x5945bc(0x127))),0x1;let _0x1bfe36,_0x5b8aec;try{const _0x535149=parseAndClassifyYamlFiles(_0x25a692,_0x31a92b,{'skipSegments':_0x51827d[_0x5945bc(0x13c)]});_0x1bfe36=_0x535149[_0x5945bc(0x161)],_0x5b8aec=_0x535149[_0x5945bc(0x12f)];const _0x12ee3f=validateParsedFiles(_0x535149,_0x31a92b);if(_0x12ee3f[_0x5945bc(0x19a)]>0x0)return console[_0x5945bc(0x150)](a39_0x335156[_0x5945bc(0x12e)](_0x5945bc(0x178))),console['error'](formatValidationErrors(_0x12ee3f)),console[_0x5945bc(0x150)](a39_0x335156[_0x5945bc(0x1b6)](_0x5945bc(0x18f))),0x1;}catch(_0x404c18){return console[_0x5945bc(0x150)](a39_0x335156[_0x5945bc(0x12e)]('Error\x20parsing\x20YAML:\x20'+(_0x404c18 instanceof Error?_0x404c18[_0x5945bc(0x1b3)]:_0x404c18))),0x1;}if(_0x1bfe36[_0x5945bc(0x19a)]===0x0&&_0x5b8aec[_0x5945bc(0x19a)]===0x0){const _0x4a4cff=_0x51827d[_0x5945bc(0x13c)]?'journey':_0x5945bc(0x14a);return console[_0x5945bc(0x150)](a39_0x335156['yellow']('No\x20'+_0x4a4cff+_0x5945bc(0x13f))),0x0;}const _0x365879=new Map();_0x3b0a44[_0x5945bc(0x19a)]>0x0&&!_0x51827d[_0x5945bc(0x13c)]&&await withSpinner(_0x5945bc(0x14e),async()=>{await batchAsync(_0x3b0a44,async _0x522532=>{const _0x5537ab=a39_0x20a9,_0x33ba30=await _0x1a0847[_0x5537ab(0x160)][_0x5537ab(0x183)](_0x2d80ec,_0x522532['id']);_0x365879[_0x5537ab(0x1b5)](_0x522532['id'],_0x33ba30);});},{'verbose':_0x51827d[_0x5945bc(0x142)]});const {segmentFiles:_0x3a1965,foldersToCreate:_0x101586}=await prepareSegmentFiles(_0x1bfe36,{'segmentByFolderAndName':_0xd2449,'activationsBySegmentId':_0x365879,'folderPathToId':_0x2b4e3e,'idToEmailMap':_0x208b1e,'connectionIdToNameMap':_0x37ad9d},_0x284e46,_0x158e7c,_0x30a00c),_0x328b25=_0x247c47?[]:findSegmentsToDelete(_0x3b0a44,_0x1bfe36[_0x5945bc(0x17a)](({yamlConfig:_0x5aa020,folderPath:_0x6a0962})=>({'yamlConfig':_0x5aa020,'folderPath':resolveTDFolderPath(_0x6a0962,_0x158e7c,_0x30a00c)})),_0x1e7128,_0x30a00c,_0x158e7c),{journeyFiles:_0x5f279c,foldersToCreate:_0x360b98}=await withProgressSpinner(_0x5945bc(0x125),async _0x31403d=>prepareJourneyFiles(_0x5b8aec,{'fetchJourney':async _0x90d7e7=>_0x1a0847[_0x5945bc(0x1b2)][_0x5945bc(0x168)](_0x90d7e7['journeyId']),'journeyBundlesByFolderAndName':_0x42fb4c,'folderPathToId':_0x2b4e3e,'idToEmailMap':_0x208b1e,'connectionIdToNameMap':_0x37ad9d,'existingSegments':_0x3b0a44,'parentId':_0x2d80ec,'deps':_0x1a0847,'progress':{'update':_0x1fffac=>{const _0xc86316=_0x5945bc;_0x31403d[_0xc86316(0x1a3)](_0x1fffac),_0x51827d[_0xc86316(0x142)]&&console[_0xc86316(0x150)]('\x20\x20'+_0x1fffac);}},'journeyById':_0x584b3d,'activationStepsById':_0x5da580},_0x158e7c,_0x30a00c),{'verbose':_0x51827d[_0x5945bc(0x142)]})[_0x5945bc(0x1a5)](_0x2602d3=>_0x2602d3[_0x5945bc(0x16f)]);for(const _0x530f78 of _0x360b98){_0x101586[_0x5945bc(0x176)](_0x530f78);}const _0xe901f2=_0x247c47?[]:findJourneysToDelete(_0x2e8b03,_0x5b8aec['map'](({yamlConfig:_0x311d17,folderPath:_0x10ae5c})=>({'yamlConfig':_0x311d17,'folderPath':resolveTDFolderPath(_0x10ae5c,_0x158e7c,_0x30a00c)})),_0x1e7128,_0x30a00c,_0x158e7c),_0x4a46c7=calculatePushStats(_0x3a1965,_0x5f279c,_0x101586,_0x328b25,_0xe901f2,!!_0x51827d[_0x5945bc(0x151)],!!_0x51827d['journeysOnly']),_0x370fab=_0x4a46c7[_0x5945bc(0x161)]['new'],_0x55f1d2=_0x4a46c7[_0x5945bc(0x161)][_0x5945bc(0x15c)],_0xd0b07c=_0x4a46c7[_0x5945bc(0x161)][_0x5945bc(0x194)],_0x4d94a2=_0x4a46c7['segments'][_0x5945bc(0x1a6)],_0x35cf50=_0x4a46c7[_0x5945bc(0x138)][_0x5945bc(0x137)],_0x22565d=_0x4a46c7[_0x5945bc(0x12f)][_0x5945bc(0x19b)],_0x154aef=_0x4a46c7[_0x5945bc(0x12f)][_0x5945bc(0x15c)],_0x233a2e=_0x4a46c7['journeys'][_0x5945bc(0x194)],_0x2d5aca=_0x4a46c7[_0x5945bc(0x12f)]['toDelete'],_0x5e4dc7=_0x4a46c7[_0x5945bc(0x197)][_0x5945bc(0x190)],_0x500459=_0x4a46c7['activations'][_0x5945bc(0x137)],_0x20c828=_0x4a46c7[_0x5945bc(0x197)][_0x5945bc(0x179)],_0x3e8b0f=_0x4a46c7[_0x5945bc(0x197)]['toDelete'];console[_0x5945bc(0x150)](_0x5945bc(0x147)+_0x3c9d7e+'\x27:');_0x35cf50[_0x5945bc(0x19a)]>0x0&&console[_0x5945bc(0x150)]('\x20\x20'+a39_0x335156['blue']('πŸ“\x20'+_0x35cf50[_0x5945bc(0x19a)]+_0x5945bc(0x157)));if(!_0x51827d[_0x5945bc(0x13c)]){console[_0x5945bc(0x150)](_0x5945bc(0x172)),console['error'](_0x5945bc(0x155)+a39_0x335156[_0x5945bc(0x15e)]('+\x20'+_0x370fab[_0x5945bc(0x19a)]+_0x5945bc(0x152))),console[_0x5945bc(0x150)](_0x5945bc(0x155)+a39_0x335156[_0x5945bc(0x1b6)]('~\x20'+_0x55f1d2[_0x5945bc(0x19a)]+_0x5945bc(0x18c)));if(_0x4d94a2[_0x5945bc(0x19a)]>0x0)console['error'](_0x5945bc(0x155)+a39_0x335156[_0x5945bc(0x12e)]('-\x20'+_0x4d94a2[_0x5945bc(0x19a)]+_0x5945bc(0x128)));else _0x328b25[_0x5945bc(0x19a)]>0x0&&!_0x51827d['delete']&&console[_0x5945bc(0x150)](_0x5945bc(0x155)+a39_0x335156[_0x5945bc(0x11b)](_0x328b25[_0x5945bc(0x19a)]+_0x5945bc(0x14c)));console[_0x5945bc(0x150)](_0x5945bc(0x155)+a39_0x335156[_0x5945bc(0x11b)]('=\x20'+_0xd0b07c[_0x5945bc(0x19a)]+_0x5945bc(0x11f)));}if(_0x5f279c['length']>0x0||_0xe901f2[_0x5945bc(0x19a)]>0x0){console[_0x5945bc(0x150)]('\x20\x20πŸ—ΊοΈ\x20\x20Journeys:'),console['error'](_0x5945bc(0x155)+a39_0x335156[_0x5945bc(0x15e)]('+\x20'+_0x22565d[_0x5945bc(0x19a)]+_0x5945bc(0x152))),console[_0x5945bc(0x150)](_0x5945bc(0x155)+a39_0x335156[_0x5945bc(0x1b6)]('~\x20'+_0x154aef[_0x5945bc(0x19a)]+_0x5945bc(0x18c)));if(_0x2d5aca['length']>0x0)console[_0x5945bc(0x150)](_0x5945bc(0x155)+a39_0x335156[_0x5945bc(0x12e)]('-\x20'+_0x2d5aca[_0x5945bc(0x19a)]+'\x20to\x20delete'));else _0xe901f2[_0x5945bc(0x19a)]>0x0&&!_0x51827d['delete']&&console[_0x5945bc(0x150)]('\x20\x20\x20\x20'+a39_0x335156[_0x5945bc(0x11b)](_0xe901f2[_0x5945bc(0x19a)]+'\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)'));console[_0x5945bc(0x150)](_0x5945bc(0x155)+a39_0x335156['dim']('=\x20'+_0x233a2e[_0x5945bc(0x19a)]+_0x5945bc(0x11f)));}_0x5e4dc7['length']>0x0&&!_0x51827d[_0x5945bc(0x13c)]&&(console['error'](''),console['error'](_0x5945bc(0x184)),_0x500459[_0x5945bc(0x19a)]>0x0&&console[_0x5945bc(0x150)](_0x5945bc(0x155)+a39_0x335156[_0x5945bc(0x15e)]('+\x20'+_0x500459[_0x5945bc(0x19a)]+'\x20to\x20create')),_0x20c828[_0x5945bc(0x19a)]>0x0&&console['error']('\x20\x20\x20\x20'+a39_0x335156[_0x5945bc(0x1b6)]('~\x20'+_0x20c828['length']+'\x20to\x20update')),_0x3e8b0f[_0x5945bc(0x19a)]>0x0&&console['error'](_0x5945bc(0x155)+a39_0x335156['red']('-\x20'+_0x3e8b0f[_0x5945bc(0x19a)]+_0x5945bc(0x128))));console['error'](_0x5945bc(0x17c)+a39_0x335156[_0x5945bc(0x174)](_0x31a92b)+'\x0a');if(_0x35cf50[_0x5945bc(0x19a)]>0x0){console[_0x5945bc(0x150)]('Folders\x20to\x20create:');for(const _0x1bfc29 of _0x35cf50){console[_0x5945bc(0x150)]('\x20\x20'+a39_0x335156[_0x5945bc(0x156)]('+')+'\x20'+_0x1bfc29);}console[_0x5945bc(0x150)]('');}if(_0x370fab[_0x5945bc(0x19a)]>0x0&&!_0x51827d[_0x5945bc(0x13c)])for(const _0x3c6c2a of _0x370fab){const _0x178126=_0x3c6c2a['folderPath']?_0x3c6c2a['folderPath']+'/'+_0x3c6c2a[_0x5945bc(0x129)]['name']:_0x3c6c2a[_0x5945bc(0x129)][_0x5945bc(0x158)],_0x39db2c=_0x3c6c2a[_0x5945bc(0x129)][_0x5945bc(0x197)]?.['length']||0x0,_0xdcdfa6=_0x39db2c>0x0?a39_0x335156[_0x5945bc(0x11b)]('\x20['+_0x39db2c+'\x20activations]'):'';console['error']('\x0a'+a39_0x335156[_0x5945bc(0x15e)](_0x5945bc(0x163))+'\x20'+_0x178126+_0xdcdfa6),console[_0x5945bc(0x150)]('─'[_0x5945bc(0x136)](0x3c)),_0x3c6c2a[_0x5945bc(0x177)]&&console[_0x5945bc(0x150)](_0x3c6c2a[_0x5945bc(0x177)]),console[_0x5945bc(0x150)]('─'['repeat'](0x3c));}if(_0x4d94a2[_0x5945bc(0x19a)]>0x0&&!_0x51827d[_0x5945bc(0x13c)])for(const _0x18d3c2 of _0x4d94a2){const _0x113f50=_0x18d3c2[_0x5945bc(0x189)]?_0x1e7128[_0x5945bc(0x153)](_0x18d3c2[_0x5945bc(0x189)]['toString']())||'':'',_0x373db3=_0x113f50?_0x113f50+'/'+_0x18d3c2[_0x5945bc(0x158)]:_0x18d3c2[_0x5945bc(0x158)],_0x2ea4ed=_0x365879['get'](_0x18d3c2['id'])||[],_0x234bd2=_0x2ea4ed[_0x5945bc(0x19a)]>0x0?a39_0x335156['dim']('\x20['+_0x2ea4ed[_0x5945bc(0x19a)]+_0x5945bc(0x1a7)):'';console['error']('\x0a'+a39_0x335156['red'](_0x5945bc(0x1b9))+'\x20'+_0x373db3+_0x234bd2),console[_0x5945bc(0x150)]('─'['repeat'](0x3c));const _0x1af375=segmentWithActivationsToYaml(_0x18d3c2,_0x2ea4ed,undefined,_0x208b1e,_0x37ad9d),_0x3634d6=segmentToYamlString(_0x1af375),_0x132f9c=generateDiff(_0x3634d6,'');console['error'](formatDiffWithColors(_0x132f9c)),console[_0x5945bc(0x150)]('─'[_0x5945bc(0x136)](0x3c));}const _0x51433e=_0x3a1965[_0x5945bc(0x12a)](_0x4aeb35=>!_0x4aeb35['isNew']&&_0x4aeb35[_0x5945bc(0x177)]);if(_0x51433e[_0x5945bc(0x19a)]>0x0&&!_0x51827d[_0x5945bc(0x13c)])for(const _0x28eef5 of _0x51433e){const _0x115a38=_0x28eef5[_0x5945bc(0x134)]?_0x28eef5['folderPath']+'/'+_0x28eef5[_0x5945bc(0x129)]['name']:_0x28eef5['yamlConfig'][_0x5945bc(0x158)];console[_0x5945bc(0x150)]('\x0a'+a39_0x335156[_0x5945bc(0x1b6)](_0x5945bc(0x1aa))+'\x20'+_0x115a38),console['error']('─'[_0x5945bc(0x136)](0x3c)),console[_0x5945bc(0x150)](_0x28eef5[_0x5945bc(0x177)]),console['error']('─'['repeat'](0x3c));}if(_0x22565d[_0x5945bc(0x19a)]>0x0)for(const _0x5cf674 of _0x22565d){const _0x3fdd9e=_0x5cf674['folderPath']?_0x5cf674['folderPath']+'/'+_0x5cf674[_0x5945bc(0x129)]['name']:_0x5cf674[_0x5945bc(0x129)]['name'];console[_0x5945bc(0x150)]('\x0a'+a39_0x335156['green'](_0x5945bc(0x1ae))+'\x20'+_0x3fdd9e),console[_0x5945bc(0x150)]('─'['repeat'](0x3c)),_0x5cf674[_0x5945bc(0x177)]&&console[_0x5945bc(0x150)](_0x5cf674[_0x5945bc(0x177)]),console[_0x5945bc(0x150)]('─'[_0x5945bc(0x136)](0x3c));}const _0x367aee=_0x5f279c['filter'](_0x5284c6=>!_0x5284c6[_0x5945bc(0x17d)]&&_0x5284c6[_0x5945bc(0x177)]);if(_0x367aee[_0x5945bc(0x19a)]>0x0)for(const _0x532d00 of _0x367aee){const _0x1a9aea=_0x532d00[_0x5945bc(0x134)]?_0x532d00[_0x5945bc(0x134)]+'/'+_0x532d00['yamlConfig']['name']:_0x532d00[_0x5945bc(0x129)][_0x5945bc(0x158)];console[_0x5945bc(0x150)]('\x0a'+a39_0x335156[_0x5945bc(0x1b6)](_0x5945bc(0x170))+'\x20'+_0x1a9aea),console[_0x5945bc(0x150)]('─'['repeat'](0x3c)),console[_0x5945bc(0x150)](_0x532d00[_0x5945bc(0x177)]),console['error']('─'[_0x5945bc(0x136)](0x3c));}if(_0x2d5aca[_0x5945bc(0x19a)]>0x0)for(const _0x285129 of _0x2d5aca){const _0x2b511e=_0x285129[_0x5945bc(0x16d)]?_0x1e7128[_0x5945bc(0x153)](_0x285129[_0x5945bc(0x16d)])||'':'',_0x55fbb5=_0x2b511e?_0x2b511e+'/'+_0x285129[_0x5945bc(0x1af)]:_0x285129['journeyBundleName'];console[_0x5945bc(0x150)]('\x0a'+a39_0x335156['red'](_0x5945bc(0x11d))+'\x20'+_0x55fbb5),console[_0x5945bc(0x150)]('─'[_0x5945bc(0x136)](0x3c)),console[_0x5945bc(0x150)](a39_0x335156['red'](_0x5945bc(0x15a))),console[_0x5945bc(0x150)]('─'[_0x5945bc(0x136)](0x3c));}if(_0x51827d[_0x5945bc(0x121)])return console[_0x5945bc(0x150)](a39_0x335156[_0x5945bc(0x1b6)](_0x5945bc(0x173))),0x0;const _0x18e4cb=_0x51827d[_0x5945bc(0x13c)]?![]:_0x370fab[_0x5945bc(0x19a)]>0x0||_0x55f1d2[_0x5945bc(0x19a)]>0x0||_0x4d94a2[_0x5945bc(0x19a)]>0x0,_0x22c08e=_0x22565d[_0x5945bc(0x19a)]>0x0||_0x154aef['length']>0x0||_0x2d5aca['length']>0x0,_0x329c50=_0x51827d[_0x5945bc(0x13c)]?![]:_0x5e4dc7[_0x5945bc(0x19a)]>0x0,_0x5acbc0=_0x35cf50[_0x5945bc(0x19a)]>0x0;if(!_0x18e4cb&&!_0x22c08e&&!_0x329c50&&!_0x5acbc0){const _0x5b5b81=_0x51827d[_0x5945bc(0x13c)]?_0x5945bc(0x18e):_0x5945bc(0x12b);console['error'](a39_0x335156['green'](_0x5b5b81));if(_0x247c47&&_0xd0b07c[_0x5945bc(0x19a)]===0x1){const _0x38f537=_0xd0b07c[0x0];if(_0x38f537[_0x5945bc(0x14f)]?.['id']){const _0x118bc8=getConsoleNextUrl(_0x51827d['site'],_0x5945bc(0x185)+_0x2d80ec+_0x5945bc(0x162)+_0x38f537[_0x5945bc(0x14f)]['id']+_0x5945bc(0x1a8));console['error']('\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20'+a39_0x335156[_0x5945bc(0x174)](_0x118bc8));}}if(_0x247c47&&_0x233a2e['length']===0x1){const _0x1dfb00=_0x233a2e[0x0];if(_0x1dfb00[_0x5945bc(0x133)]?.['id']){const _0x827504=getConsoleNextUrl(_0x51827d[_0x5945bc(0x145)],_0x5945bc(0x185)+_0x2d80ec+_0x5945bc(0x162)+_0x1dfb00['existingJourney']['id']+'/j/da/je');console[_0x5945bc(0x150)]('\x20\x20'+a39_0x335156[_0x5945bc(0x174)](_0x827504));}}return 0x0;}const _0x994772=_0x51827d[_0x5945bc(0x13c)]?_0x22565d[_0x5945bc(0x19a)]+_0x154aef[_0x5945bc(0x19a)]+_0x2d5aca['length']+_0x35cf50[_0x5945bc(0x19a)]:_0x370fab[_0x5945bc(0x19a)]+_0x55f1d2[_0x5945bc(0x19a)]+_0x4d94a2[_0x5945bc(0x19a)]+_0x22565d[_0x5945bc(0x19a)]+_0x154aef[_0x5945bc(0x19a)]+_0x2d5aca['length']+_0x35cf50[_0x5945bc(0x19a)]+_0x5e4dc7['length'];if(!_0x51827d[_0x5945bc(0x140)]&&_0x994772>0x0){if(!isInteractive())return console[_0x5945bc(0x150)](a39_0x335156[_0x5945bc(0x12e)](_0x5945bc(0x13e)),_0x5945bc(0x19e)),console[_0x5945bc(0x150)](a39_0x335156['dim'](_0x5945bc(0x19c))),0x1;const _0x294255=await confirmKey('Push\x20'+_0x994772+'\x20changes?');if(!_0x294255)return console['error'](a39_0x335156[_0x5945bc(0x1b6)](_0x5945bc(0x1a4))),0x1;}const _0x46a02c={'withProgress':async(_0xee15c1,_0x4589b9)=>{const _0x212afc=_0x5945bc,_0x57dd7f=await withSpinner(_0xee15c1,_0x4589b9,{'verbose':_0x51827d[_0x212afc(0x142)]});return{'data':_0x57dd7f[_0x212afc(0x16f)]};},'logInfo':_0x411636=>console[_0x5945bc(0x150)](a39_0x335156[_0x5945bc(0x156)]('βœ”\x20'+_0x411636)),'logSuccess':_0x481381=>console['error'](a39_0x335156[_0x5945bc(0x15e)]('βœ”\x20'+_0x481381)),'logWarning':_0x2e10bc=>console[_0x5945bc(0x150)](a39_0x335156['yellow']('⚠\x20'+_0x2e10bc)),'logDeleted':_0x2eea49=>console['error'](a39_0x335156['red']('βœ”\x20'+_0x2eea49))},_0x3df71a={'segment':_0x1a0847[_0x5945bc(0x160)],'journey':_0x1a0847['journey'],'user':_0x1a0847['user'],'connection':_0x1a0847[_0x5945bc(0x192)]};_0x35cf50[_0x5945bc(0x19a)]>0x0&&(_0x2b4e3e=await executePushFolders(_0x3df71a,_0x35cf50,_0x2b4e3e,{'parentId':_0x2d80ec},_0x46a02c));const _0x30916a={'rootFolderId':_0x4930fa,'folderPathToId':_0x2b4e3e,'folderIdToPath':_0x1e7128,'segmentNameToId':_0x18830e,'activationsBySegmentId':_0x365879,'emailToIdMap':_0x149a4b,'idToEmailMap':_0x208b1e,'connectionNameToIdMap':_0x1e41fa['nameToId'],'connectionIdToNameMap':_0x1e41fa[_0x5945bc(0x16b)],'connectionNameToTypeMap':_0x22d826},_0x1d8bef=await executePushSegments(_0x3df71a,_0x51827d['journeysOnly']?[]:_0x3a1965,_0x30916a,{'parentId':_0x2d80ec},_0x46a02c),_0x347fc4=_0x1d8bef['created'],_0x4545a1=_0x1d8bef[_0x5945bc(0x166)],_0x52a694=_0x1d8bef['activations'][_0x5945bc(0x16e)],_0x4c80cc=_0x1d8bef[_0x5945bc(0x197)][_0x5945bc(0x166)],_0x2cc842=_0x1d8bef[_0x5945bc(0x197)][_0x5945bc(0x13a)];let _0x373a82;if(_0x247c47&&_0x3a1965['length']===0x1){const _0x117f54=_0x3a1965[0x0];_0x373a82=_0x117f54[_0x5945bc(0x14f)]?.['id']??_0x1d8bef[_0x5945bc(0x198)][_0x5945bc(0x153)](_0x117f54['yamlConfig'][_0x5945bc(0x158)]);}const _0x1d6ac6=await executePushSegmentDeletions(_0x3df71a,_0x51827d['journeysOnly']?[]:_0x4d94a2,_0x46a02c);let _0x580fc0=0x0,_0x2fff22=0x0,_0x13e899=0x0;const _0x26d007=new Map(_0x18830e);for(const [_0x7101fc,_0x31a5d3]of _0x1d8bef['createdSegmentIds']){_0x26d007['set'](_0x7101fc,_0x31a5d3);}if(_0x5f279c['length']>0x0){const _0x19a7ae={..._0x30916a,'segmentNameToId':_0x26d007,'existingSegments':_0x3b0a44,'activationContext':_0x284e46},_0x283824=await executePushJourneys(_0x3df71a,_0x5f279c,_0x19a7ae,{'parentId':_0x2d80ec,'rootFolderId':_0x4930fa,'verbose':_0x51827d[_0x5945bc(0x142)]},_0x46a02c);_0x580fc0=_0x283824['created'],_0x2fff22=_0x283824['updated'];if(_0x247c47&&_0x283824[_0x5945bc(0x13d)]['length']===0x1){const _0x2479d4=_0x283824[_0x5945bc(0x13d)][0x0];if(_0x2479d4[_0x5945bc(0x1ac)]){const _0x4c7f8d=getConsoleNextUrl(_0x51827d[_0x5945bc(0x145)],_0x5945bc(0x185)+_0x2d80ec+'/e/'+_0x2479d4[_0x5945bc(0x1ac)]+'/j/da/je');console[_0x5945bc(0x150)]('\x20\x20'+a39_0x335156[_0x5945bc(0x174)](_0x4c7f8d));}}}for(const _0x41fc4b of _0x2d5aca){console[_0x5945bc(0x150)](a39_0x335156[_0x5945bc(0x1b6)]('⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20'+_0x41fc4b[_0x5945bc(0x1af)])),_0x13e899++;}const _0x169afa=[];if(_0x347fc4>0x0)_0x169afa[_0x5945bc(0x18a)](_0x347fc4+_0x5945bc(0x1a1));if(_0x4545a1>0x0)_0x169afa[_0x5945bc(0x18a)](_0x4545a1+'\x20updated');if(_0x1d6ac6>0x0)_0x169afa[_0x5945bc(0x18a)](_0x1d6ac6+'\x20deleted');const _0xbdb05d=[];if(_0x580fc0>0x0)_0xbdb05d[_0x5945bc(0x18a)](_0x580fc0+_0x5945bc(0x1a1));if(_0x2fff22>0x0)_0xbdb05d[_0x5945bc(0x18a)](_0x2fff22+'\x20updated');if(_0x13e899>0x0)_0xbdb05d[_0x5945bc(0x18a)](_0x13e899+_0x5945bc(0x188));const _0x582629=[];if(_0x52a694>0x0)_0x582629[_0x5945bc(0x18a)](_0x52a694+'\x20created');if(_0x4c80cc>0x0)_0x582629[_0x5945bc(0x18a)](_0x4c80cc+_0x5945bc(0x1b0));if(_0x2cc842>0x0)_0x582629[_0x5945bc(0x18a)](_0x2cc842+_0x5945bc(0x188));console['error'](a39_0x335156['green'](_0x5945bc(0x120)));_0x169afa['length']>0x0&&!_0x51827d[_0x5945bc(0x13c)]&&console[_0x5945bc(0x150)]('\x20\x20Segments:\x20'+_0x169afa[_0x5945bc(0x196)](',\x20'));_0xbdb05d['length']>0x0&&console['error'](_0x5945bc(0x165)+_0xbdb05d[_0x5945bc(0x196)](',\x20'));_0x582629['length']>0x0&&!_0x51827d[_0x5945bc(0x13c)]&&console[_0x5945bc(0x150)](_0x5945bc(0x126)+_0x582629[_0x5945bc(0x196)](',\x20'));if(_0x373a82){const _0x5b1f00=getConsoleNextUrl(_0x51827d[_0x5945bc(0x145)],_0x5945bc(0x185)+_0x2d80ec+_0x5945bc(0x162)+_0x373a82+_0x5945bc(0x1a8));console['error'](_0x5945bc(0x130)+a39_0x335156[_0x5945bc(0x174)](_0x5b1f00));}return 0x0;}}
1
+ const a39_0x4f0c1e=a39_0x37a0;(function(_0xfd718,_0x5acdcd){const _0x5d1354=a39_0x37a0,_0x3f0d73=_0xfd718();while(!![]){try{const _0x47cba5=parseInt(_0x5d1354(0x12d))/0x1+-parseInt(_0x5d1354(0xb8))/0x2+parseInt(_0x5d1354(0x115))/0x3*(parseInt(_0x5d1354(0xd4))/0x4)+-parseInt(_0x5d1354(0x129))/0x5*(parseInt(_0x5d1354(0x11f))/0x6)+parseInt(_0x5d1354(0xdc))/0x7+parseInt(_0x5d1354(0x103))/0x8*(parseInt(_0x5d1354(0xb1))/0x9)+parseInt(_0x5d1354(0xec))/0xa*(-parseInt(_0x5d1354(0xe9))/0xb);if(_0x47cba5===_0x5acdcd)break;else _0x3f0d73['push'](_0x3f0d73['shift']());}catch(_0x5259e9){_0x3f0d73['push'](_0x3f0d73['shift']());}}}(a39_0xb36b,0xd8cd2));import{BaseCommand}from'./command.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';function a39_0xb36b(){const _0x12cc31=['\x20changed','2107392NYobnG','unchanged','New\x20journey:','updatedAt','attributes','\x20\x20Segments:\x20','\x20folders\x20to\x20create','deleted','execute','length','blue','message','New\x20segment:','/j/da/je','journeyId','segment\x20or\x20journey','diff','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','set','delete','listFolders','\x20changes?','\x20\x20πŸ“Š\x20Segments:','toCreate','list','listActivations','βœ”\x20All\x20journeys\x20are\x20up\x20to\x20date','verbose','287132HaqAKr','created','\x20\x20\x20\x20','Fetching\x20connections\x20for\x20name\x20resolution...','all','helpText','Error:\x20Directory\x20not\x20found:\x20','getParent','6200537KUHDOz','yes','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','\x20activations]','type','\x27...','endsWith','Aborted.','getJourney','journeysOnly','join','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','Delete\x20journey:','16083672RTviGm','\x20created','get','10ZsejTn','.yaml','new','state','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','segments','Scoped\x20to\x20folder:\x20','\x20\x20Activations:\x20','toString','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','data','changed','parentName','isScoped','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','parentFolder','yellow','red','(Journey\x20will\x20be\x20deleted)','error','repeat','folders','11433976HHQKlv','green','\x20updated','\x0aValidation\x20failed:','add','cwd','/app/ps/','Site:\x20','site','scopedFolderPath','push','folderId','Error:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file','segment','\x20\x20Source:\x20','file','No\x20','69wfOPbE','\x20unchanged','resolveParentId','cyan','journeyBundleName','createdAt','journey','buildUserMaps','createdSegmentIds','Resolving\x20parent\x20segment\x20\x27','276bGHDiK','existingSegment','filePath','Changes\x20to\x20journey:','\x20new','Push\x20','paused','\x20deleted','activations','existingJourney','153470McIXoA','versionNumber','no_parent','\x0aPush\x20summary\x20for\x20\x27','849743EaTgSY','connection','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)','dim','\x0aError:','\x20to\x20delete','journeys','user','segment:push','\x20to\x20create','Fetching\x20existing\x20activations...','map','\x20\x20πŸ—ΊοΈ\x20\x20Journeys:','parent_name','Preparing\x20journeys...','description','\x20\x20Activations:','/sb/da/esr','Source\x20directory:\x20','filter','folderPath','name','updated','Changes\x20to:','then','idToName','Delete\x20segment:','toDelete','\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','nameToId','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','/e/','9CaHBhT','segmentFolderId','yamlConfig','Error\x20parsing\x20YAML:\x20','targetDir','isNew'];a39_0xb36b=function(){return _0x12cc31;};return a39_0xb36b();}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 a39_0x247d52 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';function a39_0x37a0(_0x44a6a3,_0x45f9cc){_0x44a6a3=_0x44a6a3-0xaa;const _0xb36be8=a39_0xb36b();let _0x37a012=_0xb36be8[_0x44a6a3];return _0x37a012;}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{['name']=a39_0x4f0c1e(0x135);[a39_0x4f0c1e(0x13c)]='Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments';async[a39_0x4f0c1e(0xc0)](_0x28f904){const _0x58e197=a39_0x4f0c1e,{options:_0x3b5e8e,args:_0x3fc4dd,tdx:_0x21989c}=_0x28f904,_0x16c303=_0x3b5e8e,_0x34eb04=await resolveTarget({'arg':_0x3fc4dd[0x0],'contextParent':_0x3b5e8e['parentSegment'],'cwd':process[_0x58e197(0x108)]()});if(!isSuccessfulResolution(_0x34eb04))return _0x34eb04['errorCode']===_0x58e197(0x12b)?(console[_0x58e197(0x100)](a39_0x247d52[_0x58e197(0xfd)](_0x58e197(0xde))),console[_0x58e197(0x100)](_0x58e197(0x12f)),console[_0x58e197(0x100)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent'),console[_0x58e197(0x100)](_0x58e197(0x110))):(console[_0x58e197(0x100)](a39_0x247d52['red'](_0x58e197(0x10f)+_0x34eb04[_0x58e197(0xc3)]+'\x0a')),_0x34eb04[_0x58e197(0xd9)]&&console[_0x58e197(0x100)](a39_0x247d52[_0x58e197(0x118)](_0x34eb04[_0x58e197(0xd9)]))),0x1;if(_0x34eb04[_0x58e197(0xe0)]===_0x58e197(0x13a))return console[_0x58e197(0x100)](a39_0x247d52['red'](_0x58e197(0xda)+_0x34eb04['targetDir']+'\x0a')),console[_0x58e197(0x100)](a39_0x247d52['cyan'](_0x58e197(0xaf))),0x1;const _0x212cec=_0x34eb04[_0x58e197(0xf8)],_0x52f893=_0x34eb04[_0x58e197(0xb5)],_0x559818=_0x34eb04['type']===_0x58e197(0x113)?_0x34eb04[_0x58e197(0x121)]:undefined,_0x2ec021=getScopedDetails(_0x34eb04),_0x5972a4=_0x2ec021?.[_0x58e197(0xf9)]??![],_0x5d6f66=_0x2ec021?.[_0x58e197(0x10c)]??'';if(!existsSync(_0x52f893))return console[_0x58e197(0x100)](a39_0x247d52['red'](_0x58e197(0xda)+_0x52f893+'\x0a')),console[_0x58e197(0x100)](a39_0x247d52[_0x58e197(0x118)]('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;_0x16c303[_0x58e197(0xd3)]&&(console[_0x58e197(0x100)](_0x58e197(0x10a)+_0x16c303[_0x58e197(0x10b)]),console['error']('Parent\x20segment:\x20'+_0x212cec),console[_0x58e197(0x100)](_0x58e197(0x13f)+_0x52f893),_0x5972a4&&console[_0x58e197(0x100)](_0x58e197(0xf2)+_0x5d6f66));const _0x2b4a96=await withSpinner(_0x58e197(0x11e)+_0x212cec+_0x58e197(0xe1),()=>_0x21989c[_0x58e197(0x111)][_0x58e197(0x117)](_0x212cec),{'verbose':_0x16c303['verbose']}),_0x21acdf=_0x2b4a96['data'],{parentSegmentResult:_0x5aa1e6,segmentsResult:_0x138c41,foldersResult:_0x53d638,journeysWithDetailsResult:_0x21f1aa,userMaps:_0xf9a6b3}=await withSpinner('Fetching\x20existing\x20data...',async()=>{const _0x3364bd=_0x58e197,[_0x3546f5,_0x239714,_0x112f8f,_0x262119,_0xfe94ac]=await Promise[_0x3364bd(0xd8)]([_0x21989c[_0x3364bd(0x111)][_0x3364bd(0xdb)](_0x21acdf),_0x21989c['segment']['listSegments'](_0x21acdf),_0x21989c[_0x3364bd(0x111)][_0x3364bd(0xcc)](_0x21acdf),_0x21989c[_0x3364bd(0x11b)]['listJourneysWithDetailsFromParentSegment'](_0x21acdf,{'includeAllVersions':!![]}),_0x21989c[_0x3364bd(0x134)][_0x3364bd(0x11c)]()]);return{'parentSegmentResult':_0x3546f5,'segmentsResult':_0x239714,'foldersResult':_0x112f8f,'journeysWithDetailsResult':_0x262119,'userMaps':_0xfe94ac};},{'verbose':_0x16c303[_0x58e197(0xd3)]})[_0x58e197(0x145)](_0x5a9450=>_0x5a9450[_0x58e197(0xf6)]),_0x561ca4=_0x5aa1e6,_0x24d20a=extractRootFolderId(_0x561ca4),_0x3fb192=_0x138c41,_0x10d75c=_0x53d638,{journeys:_0x5814f1,activationStepsById:_0x40713d}=_0x21f1aa,_0x589efb=new Map(_0x5814f1[_0x58e197(0x138)](_0x4150f2=>[_0x4150f2['id'],_0x4150f2])),_0x2ee3bd=_0x5814f1[_0x58e197(0x138)](_0x3403c5=>({'id':_0x3403c5['id'],'name':_0x3403c5['attributes']['name'],'journeyBundleName':_0x3403c5[_0x58e197(0xbc)]['journeyBundleName']||'','journeyBundleId':_0x3403c5[_0x58e197(0xbc)]['journeyBundleId']||'','versionNumber':_0x3403c5[_0x58e197(0xbc)][_0x58e197(0x12a)],'description':_0x3403c5[_0x58e197(0xbc)]['description'],'state':_0x3403c5[_0x58e197(0xbc)][_0x58e197(0xef)],'paused':_0x3403c5[_0x58e197(0xbc)][_0x58e197(0x125)],'audienceId':_0x3403c5[_0x58e197(0xbc)]['audienceId'],'folderId':_0x3403c5['relationships']?.[_0x58e197(0xfc)]?.[_0x58e197(0xf6)]?.['id'],'createdAt':_0x3403c5[_0x58e197(0xbc)][_0x58e197(0x11a)],'updatedAt':_0x3403c5[_0x58e197(0xbc)][_0x58e197(0xbb)]})),{emailToId:_0x2a8845,idToEmail:_0x248fce}=_0xf9a6b3,_0x5df252=await withSpinner(_0x58e197(0xd7),async()=>{const _0x169513=_0x58e197,_0x38c0bc=await _0x21989c[_0x169513(0x12e)][_0x169513(0xd0)]();return buildConnectionMaps(_0x38c0bc);},{'verbose':_0x16c303[_0x58e197(0xd3)]})[_0x58e197(0x145)](_0x38d7a7=>_0x38d7a7[_0x58e197(0xf6)]),_0x33aa63=_0x5df252[_0x58e197(0xae)],_0xd33dd=_0x5df252['idToName'],_0x4be8cb=_0x5df252['nameToType'],_0x1179cd={'emailToIdMap':_0x2a8845,'connectionNameToIdMap':_0x33aa63,'connectionNameToTypeMap':_0x4be8cb,'getSchema':_0x587bd0=>_0x21989c[_0x58e197(0x12e)]['getOutputSchemaWithCache'](_0x587bd0)};let {pathToId:_0x26b5f7,idToPath:_0x39e11c}=buildFolderMaps(_0x10d75c);const _0x103dce=buildSegmentLookupMap(_0x3fb192,_0x39e11c),_0x463468=buildSegmentNameToIdMap(_0x3fb192),_0x29acf1=buildJourneyBundleLookupMap(_0x2ee3bd,_0x39e11c);let _0x30f288;if(_0x559818){if(!_0x559818[_0x58e197(0xe2)]('.yml')&&!_0x559818[_0x58e197(0xe2)](_0x58e197(0xed)))return console['error'](a39_0x247d52[_0x58e197(0xfe)](_0x58e197(0xad)+_0x559818+'\x0a')),0x1;_0x30f288=[_0x559818];}else _0x30f288=findYamlFiles(_0x52f893);if(_0x30f288[_0x58e197(0xc1)]===0x0)return console[_0x58e197(0x100)](a39_0x247d52[_0x58e197(0xfe)]('Error:\x20No\x20YAML\x20files\x20found\x20in\x20'+_0x52f893+'\x0a')),console[_0x58e197(0x100)](a39_0x247d52[_0x58e197(0x118)](_0x58e197(0xf5))),0x1;let _0x2053d8,_0x48ccc7;try{const _0x4ab3f6=parseAndClassifyYamlFiles(_0x30f288,_0x52f893,{'skipSegments':_0x16c303['journeysOnly']});_0x2053d8=_0x4ab3f6[_0x58e197(0xf1)],_0x48ccc7=_0x4ab3f6[_0x58e197(0x133)];const _0x8a657f=validateParsedFiles(_0x4ab3f6,_0x52f893);if(_0x8a657f[_0x58e197(0xc1)]>0x0)return console[_0x58e197(0x100)](a39_0x247d52[_0x58e197(0xfe)](_0x58e197(0x106))),console['error'](formatValidationErrors(_0x8a657f)),console[_0x58e197(0x100)](a39_0x247d52[_0x58e197(0xfd)]('\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.')),0x1;}catch(_0x157cb7){return console['error'](a39_0x247d52[_0x58e197(0xfe)](_0x58e197(0xb4)+(_0x157cb7 instanceof Error?_0x157cb7[_0x58e197(0xc3)]:_0x157cb7))),0x1;}if(_0x2053d8[_0x58e197(0xc1)]===0x0&&_0x48ccc7['length']===0x0){const _0x3bc39e=_0x16c303[_0x58e197(0xe5)]?_0x58e197(0x11b):_0x58e197(0xc7);return console['error'](a39_0x247d52[_0x58e197(0xfd)](_0x58e197(0x114)+_0x3bc39e+'\x20YAML\x20files\x20found')),0x0;}const _0x447908=new Map();_0x3fb192[_0x58e197(0xc1)]>0x0&&!_0x16c303[_0x58e197(0xe5)]&&await withSpinner(_0x58e197(0x137),async()=>{await batchAsync(_0x3fb192,async _0x51f0e3=>{const _0x16fadf=a39_0x37a0,_0x247fe9=await _0x21989c[_0x16fadf(0x111)][_0x16fadf(0xd1)](_0x21acdf,_0x51f0e3['id']);_0x447908[_0x16fadf(0xca)](_0x51f0e3['id'],_0x247fe9);});},{'verbose':_0x16c303[_0x58e197(0xd3)]});const {segmentFiles:_0x3e4137,foldersToCreate:_0x5db9ac}=await prepareSegmentFiles(_0x2053d8,{'segmentByFolderAndName':_0x103dce,'activationsBySegmentId':_0x447908,'folderPathToId':_0x26b5f7,'idToEmailMap':_0x248fce,'connectionIdToNameMap':_0xd33dd},_0x1179cd,_0x5972a4,_0x5d6f66),_0x2c6205=_0x559818?[]:findSegmentsToDelete(_0x3fb192,_0x2053d8[_0x58e197(0x138)](({yamlConfig:_0x5411b0,folderPath:_0x1b6785})=>({'yamlConfig':_0x5411b0,'folderPath':resolveTDFolderPath(_0x1b6785,_0x5972a4,_0x5d6f66)})),_0x39e11c,_0x5d6f66,_0x5972a4),{journeyFiles:_0x903edc,foldersToCreate:_0x17a69b}=await withProgressSpinner(_0x58e197(0x13b),async _0x4c845c=>prepareJourneyFiles(_0x48ccc7,{'fetchJourney':async _0x490728=>_0x21989c[_0x58e197(0x11b)][_0x58e197(0xe4)](_0x490728[_0x58e197(0xc6)]),'journeyBundlesByFolderAndName':_0x29acf1,'folderPathToId':_0x26b5f7,'idToEmailMap':_0x248fce,'connectionIdToNameMap':_0xd33dd,'existingSegments':_0x3fb192,'parentId':_0x21acdf,'deps':_0x21989c,'progress':{'update':_0xd6b8e6=>{const _0x12e1a3=_0x58e197;_0x4c845c['setPhase'](_0xd6b8e6),_0x16c303[_0x12e1a3(0xd3)]&&console[_0x12e1a3(0x100)]('\x20\x20'+_0xd6b8e6);}},'journeyById':_0x589efb,'activationStepsById':_0x40713d},_0x5972a4,_0x5d6f66),{'verbose':_0x16c303['verbose']})['then'](_0x666bab=>_0x666bab[_0x58e197(0xf6)]);for(const _0x17e892 of _0x17a69b){_0x5db9ac[_0x58e197(0x107)](_0x17e892);}const _0x5461e3=_0x559818?[]:findJourneysToDelete(_0x2ee3bd,_0x48ccc7['map'](({yamlConfig:_0x1f969d,folderPath:_0x22bbd4})=>({'yamlConfig':_0x1f969d,'folderPath':resolveTDFolderPath(_0x22bbd4,_0x5972a4,_0x5d6f66)})),_0x39e11c,_0x5d6f66,_0x5972a4),_0x207c9e=calculatePushStats(_0x3e4137,_0x903edc,_0x5db9ac,_0x2c6205,_0x5461e3,!!_0x16c303[_0x58e197(0xcb)],!!_0x16c303['journeysOnly']),_0x1ba209=_0x207c9e[_0x58e197(0xf1)][_0x58e197(0xee)],_0x11132b=_0x207c9e[_0x58e197(0xf1)][_0x58e197(0xf7)],_0x9f87f4=_0x207c9e[_0x58e197(0xf1)]['unchanged'],_0x19825a=_0x207c9e[_0x58e197(0xf1)][_0x58e197(0xab)],_0x3f956a=_0x207c9e[_0x58e197(0x102)][_0x58e197(0xcf)],_0x765293=_0x207c9e['journeys'][_0x58e197(0xee)],_0x372e88=_0x207c9e[_0x58e197(0x133)][_0x58e197(0xf7)],_0x3c4aa2=_0x207c9e['journeys'][_0x58e197(0xb9)],_0x5d76a0=_0x207c9e[_0x58e197(0x133)][_0x58e197(0xab)],_0x25a3ec=_0x207c9e[_0x58e197(0x127)]['all'],_0x25f0a7=_0x207c9e['activations']['toCreate'],_0x21f78b=_0x207c9e[_0x58e197(0x127)]['toUpdate'],_0x3ff9bb=_0x207c9e['activations']['toDelete'];console[_0x58e197(0x100)](_0x58e197(0x12c)+_0x212cec+'\x27:');_0x3f956a[_0x58e197(0xc1)]>0x0&&console[_0x58e197(0x100)]('\x20\x20'+a39_0x247d52[_0x58e197(0xc2)]('πŸ“\x20'+_0x3f956a[_0x58e197(0xc1)]+_0x58e197(0xbe)));if(!_0x16c303[_0x58e197(0xe5)]){console[_0x58e197(0x100)](_0x58e197(0xce)),console[_0x58e197(0x100)](_0x58e197(0xd6)+a39_0x247d52[_0x58e197(0x104)]('+\x20'+_0x1ba209[_0x58e197(0xc1)]+_0x58e197(0x123))),console[_0x58e197(0x100)](_0x58e197(0xd6)+a39_0x247d52['yellow']('~\x20'+_0x11132b[_0x58e197(0xc1)]+_0x58e197(0xb7)));if(_0x19825a[_0x58e197(0xc1)]>0x0)console[_0x58e197(0x100)](_0x58e197(0xd6)+a39_0x247d52[_0x58e197(0xfe)]('-\x20'+_0x19825a['length']+_0x58e197(0x132)));else _0x2c6205[_0x58e197(0xc1)]>0x0&&!_0x16c303[_0x58e197(0xcb)]&&console['error'](_0x58e197(0xd6)+a39_0x247d52[_0x58e197(0x130)](_0x2c6205['length']+'\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)'));console['error'](_0x58e197(0xd6)+a39_0x247d52['dim']('=\x20'+_0x9f87f4[_0x58e197(0xc1)]+_0x58e197(0x116)));}if(_0x903edc[_0x58e197(0xc1)]>0x0||_0x5461e3[_0x58e197(0xc1)]>0x0){console[_0x58e197(0x100)](_0x58e197(0x139)),console[_0x58e197(0x100)](_0x58e197(0xd6)+a39_0x247d52[_0x58e197(0x104)]('+\x20'+_0x765293['length']+_0x58e197(0x123))),console['error'](_0x58e197(0xd6)+a39_0x247d52['yellow']('~\x20'+_0x372e88[_0x58e197(0xc1)]+'\x20changed'));if(_0x5d76a0['length']>0x0)console[_0x58e197(0x100)](_0x58e197(0xd6)+a39_0x247d52[_0x58e197(0xfe)]('-\x20'+_0x5d76a0[_0x58e197(0xc1)]+_0x58e197(0x132)));else _0x5461e3['length']>0x0&&!_0x16c303[_0x58e197(0xcb)]&&console['error'](_0x58e197(0xd6)+a39_0x247d52[_0x58e197(0x130)](_0x5461e3[_0x58e197(0xc1)]+_0x58e197(0xfa)));console[_0x58e197(0x100)](_0x58e197(0xd6)+a39_0x247d52[_0x58e197(0x130)]('=\x20'+_0x3c4aa2['length']+_0x58e197(0x116)));}_0x25a3ec[_0x58e197(0xc1)]>0x0&&!_0x16c303[_0x58e197(0xe5)]&&(console[_0x58e197(0x100)](''),console[_0x58e197(0x100)](_0x58e197(0x13d)),_0x25f0a7[_0x58e197(0xc1)]>0x0&&console[_0x58e197(0x100)](_0x58e197(0xd6)+a39_0x247d52['green']('+\x20'+_0x25f0a7[_0x58e197(0xc1)]+_0x58e197(0x136))),_0x21f78b[_0x58e197(0xc1)]>0x0&&console[_0x58e197(0x100)]('\x20\x20\x20\x20'+a39_0x247d52[_0x58e197(0xfd)]('~\x20'+_0x21f78b[_0x58e197(0xc1)]+'\x20to\x20update')),_0x3ff9bb[_0x58e197(0xc1)]>0x0&&console[_0x58e197(0x100)](_0x58e197(0xd6)+a39_0x247d52[_0x58e197(0xfe)]('-\x20'+_0x3ff9bb[_0x58e197(0xc1)]+'\x20to\x20delete')));console['error'](_0x58e197(0x112)+a39_0x247d52['cyan'](_0x52f893)+'\x0a');if(_0x3f956a[_0x58e197(0xc1)]>0x0){console[_0x58e197(0x100)]('Folders\x20to\x20create:');for(const _0x23bc23 of _0x3f956a){console[_0x58e197(0x100)]('\x20\x20'+a39_0x247d52[_0x58e197(0xc2)]('+')+'\x20'+_0x23bc23);}console[_0x58e197(0x100)]('');}if(_0x1ba209[_0x58e197(0xc1)]>0x0&&!_0x16c303['journeysOnly'])for(const _0xe4f486 of _0x1ba209){const _0x292978=_0xe4f486[_0x58e197(0x141)]?_0xe4f486[_0x58e197(0x141)]+'/'+_0xe4f486[_0x58e197(0xb3)][_0x58e197(0x142)]:_0xe4f486[_0x58e197(0xb3)][_0x58e197(0x142)],_0x3454d5=_0xe4f486['yamlConfig'][_0x58e197(0x127)]?.[_0x58e197(0xc1)]||0x0,_0x42bed7=_0x3454d5>0x0?a39_0x247d52[_0x58e197(0x130)]('\x20['+_0x3454d5+_0x58e197(0xdf)):'';console['error']('\x0a'+a39_0x247d52[_0x58e197(0x104)](_0x58e197(0xc4))+'\x20'+_0x292978+_0x42bed7),console[_0x58e197(0x100)]('─'['repeat'](0x3c)),_0xe4f486[_0x58e197(0xc8)]&&console['error'](_0xe4f486[_0x58e197(0xc8)]),console['error']('─'['repeat'](0x3c));}if(_0x19825a['length']>0x0&&!_0x16c303['journeysOnly'])for(const _0x5bce32 of _0x19825a){const _0x4cbc3b=_0x5bce32[_0x58e197(0xb2)]?_0x39e11c['get'](_0x5bce32[_0x58e197(0xb2)][_0x58e197(0xf4)]())||'':'',_0x459d2d=_0x4cbc3b?_0x4cbc3b+'/'+_0x5bce32[_0x58e197(0x142)]:_0x5bce32[_0x58e197(0x142)],_0x1729ec=_0x447908[_0x58e197(0xeb)](_0x5bce32['id'])||[],_0x589280=_0x1729ec[_0x58e197(0xc1)]>0x0?a39_0x247d52[_0x58e197(0x130)]('\x20['+_0x1729ec[_0x58e197(0xc1)]+_0x58e197(0xdf)):'';console[_0x58e197(0x100)]('\x0a'+a39_0x247d52[_0x58e197(0xfe)](_0x58e197(0xaa))+'\x20'+_0x459d2d+_0x589280),console['error']('─'['repeat'](0x3c));const _0x31b2fb=segmentWithActivationsToYaml(_0x5bce32,_0x1729ec,undefined,_0x248fce,_0xd33dd),_0x573147=segmentToYamlString(_0x31b2fb),_0x57f6a2=generateDiff(_0x573147,'');console[_0x58e197(0x100)](formatDiffWithColors(_0x57f6a2)),console[_0x58e197(0x100)]('─'['repeat'](0x3c));}const _0x5ea346=_0x3e4137[_0x58e197(0x140)](_0x17711a=>!_0x17711a[_0x58e197(0xb6)]&&_0x17711a[_0x58e197(0xc8)]);if(_0x5ea346[_0x58e197(0xc1)]>0x0&&!_0x16c303[_0x58e197(0xe5)])for(const _0xbd6c2a of _0x5ea346){const _0x28c3d8=_0xbd6c2a[_0x58e197(0x141)]?_0xbd6c2a['folderPath']+'/'+_0xbd6c2a[_0x58e197(0xb3)][_0x58e197(0x142)]:_0xbd6c2a[_0x58e197(0xb3)][_0x58e197(0x142)];console['error']('\x0a'+a39_0x247d52[_0x58e197(0xfd)](_0x58e197(0x144))+'\x20'+_0x28c3d8),console['error']('─'[_0x58e197(0x101)](0x3c)),console[_0x58e197(0x100)](_0xbd6c2a[_0x58e197(0xc8)]),console['error']('─'[_0x58e197(0x101)](0x3c));}if(_0x765293['length']>0x0)for(const _0x96e10f of _0x765293){const _0x1f2f5a=_0x96e10f[_0x58e197(0x141)]?_0x96e10f[_0x58e197(0x141)]+'/'+_0x96e10f['yamlConfig']['name']:_0x96e10f[_0x58e197(0xb3)][_0x58e197(0x142)];console[_0x58e197(0x100)]('\x0a'+a39_0x247d52['green'](_0x58e197(0xba))+'\x20'+_0x1f2f5a),console[_0x58e197(0x100)]('─'[_0x58e197(0x101)](0x3c)),_0x96e10f[_0x58e197(0xc8)]&&console['error'](_0x96e10f[_0x58e197(0xc8)]),console[_0x58e197(0x100)]('─'[_0x58e197(0x101)](0x3c));}const _0x221ac5=_0x903edc[_0x58e197(0x140)](_0x334578=>!_0x334578[_0x58e197(0xb6)]&&_0x334578[_0x58e197(0xc8)]);if(_0x221ac5[_0x58e197(0xc1)]>0x0)for(const _0x4f0d03 of _0x221ac5){const _0x4aedb8=_0x4f0d03[_0x58e197(0x141)]?_0x4f0d03['folderPath']+'/'+_0x4f0d03[_0x58e197(0xb3)][_0x58e197(0x142)]:_0x4f0d03[_0x58e197(0xb3)][_0x58e197(0x142)];console[_0x58e197(0x100)]('\x0a'+a39_0x247d52[_0x58e197(0xfd)](_0x58e197(0x122))+'\x20'+_0x4aedb8),console[_0x58e197(0x100)]('─'['repeat'](0x3c)),console[_0x58e197(0x100)](_0x4f0d03[_0x58e197(0xc8)]),console[_0x58e197(0x100)]('─'[_0x58e197(0x101)](0x3c));}if(_0x5d76a0[_0x58e197(0xc1)]>0x0)for(const _0x1c17f4 of _0x5d76a0){const _0x269ffd=_0x1c17f4[_0x58e197(0x10e)]?_0x39e11c['get'](_0x1c17f4[_0x58e197(0x10e)])||'':'',_0x42d106=_0x269ffd?_0x269ffd+'/'+_0x1c17f4[_0x58e197(0x119)]:_0x1c17f4[_0x58e197(0x119)];console[_0x58e197(0x100)]('\x0a'+a39_0x247d52['red'](_0x58e197(0xe8))+'\x20'+_0x42d106),console[_0x58e197(0x100)]('─'[_0x58e197(0x101)](0x3c)),console[_0x58e197(0x100)](a39_0x247d52[_0x58e197(0xfe)](_0x58e197(0xff))),console[_0x58e197(0x100)]('─'[_0x58e197(0x101)](0x3c));}if(_0x16c303['dryRun'])return console[_0x58e197(0x100)](a39_0x247d52[_0x58e197(0xfd)](_0x58e197(0xe7))),0x0;const _0x4eb0e2=_0x16c303[_0x58e197(0xe5)]?![]:_0x1ba209['length']>0x0||_0x11132b[_0x58e197(0xc1)]>0x0||_0x19825a[_0x58e197(0xc1)]>0x0,_0x3cc95d=_0x765293[_0x58e197(0xc1)]>0x0||_0x372e88[_0x58e197(0xc1)]>0x0||_0x5d76a0['length']>0x0,_0x3f2958=_0x16c303[_0x58e197(0xe5)]?![]:_0x25a3ec[_0x58e197(0xc1)]>0x0,_0x428c70=_0x3f956a['length']>0x0;if(!_0x4eb0e2&&!_0x3cc95d&&!_0x3f2958&&!_0x428c70){const _0x5903f0=_0x16c303[_0x58e197(0xe5)]?_0x58e197(0xd2):'βœ”\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date';console[_0x58e197(0x100)](a39_0x247d52[_0x58e197(0x104)](_0x5903f0));if(_0x559818&&_0x9f87f4['length']===0x1){const _0x281906=_0x9f87f4[0x0];if(_0x281906[_0x58e197(0x120)]?.['id']){const _0x59b8f0=getConsoleNextUrl(_0x16c303[_0x58e197(0x10b)],_0x58e197(0x109)+_0x21acdf+_0x58e197(0xb0)+_0x281906[_0x58e197(0x120)]['id']+_0x58e197(0x13e));console[_0x58e197(0x100)](_0x58e197(0xac)+a39_0x247d52['cyan'](_0x59b8f0));}}if(_0x559818&&_0x3c4aa2[_0x58e197(0xc1)]===0x1){const _0x1cf4e4=_0x3c4aa2[0x0];if(_0x1cf4e4['existingJourney']?.['id']){const _0x53569c=getConsoleNextUrl(_0x16c303[_0x58e197(0x10b)],'/app/ps/'+_0x21acdf+_0x58e197(0xb0)+_0x1cf4e4[_0x58e197(0x128)]['id']+'/j/da/je');console[_0x58e197(0x100)]('\x20\x20'+a39_0x247d52[_0x58e197(0x118)](_0x53569c));}}return 0x0;}const _0x4326a8=_0x16c303[_0x58e197(0xe5)]?_0x765293[_0x58e197(0xc1)]+_0x372e88['length']+_0x5d76a0[_0x58e197(0xc1)]+_0x3f956a[_0x58e197(0xc1)]:_0x1ba209[_0x58e197(0xc1)]+_0x11132b[_0x58e197(0xc1)]+_0x19825a[_0x58e197(0xc1)]+_0x765293['length']+_0x372e88[_0x58e197(0xc1)]+_0x5d76a0['length']+_0x3f956a[_0x58e197(0xc1)]+_0x25a3ec[_0x58e197(0xc1)];if(!_0x16c303[_0x58e197(0xdd)]&&_0x4326a8>0x0){if(!isInteractive())return console[_0x58e197(0x100)](a39_0x247d52[_0x58e197(0xfe)](_0x58e197(0x131)),_0x58e197(0xf0)),console[_0x58e197(0x100)](a39_0x247d52[_0x58e197(0x130)](_0x58e197(0xfb))),0x1;const _0x5679ce=await confirmKey(_0x58e197(0x124)+_0x4326a8+_0x58e197(0xcd));if(!_0x5679ce)return console[_0x58e197(0x100)](a39_0x247d52[_0x58e197(0xfd)](_0x58e197(0xe3))),0x1;}const _0x2941d6={'withProgress':async(_0x3e38ae,_0x25dca6)=>{const _0x2af588=_0x58e197,_0x4b2882=await withSpinner(_0x3e38ae,_0x25dca6,{'verbose':_0x16c303['verbose']});return{'data':_0x4b2882[_0x2af588(0xf6)]};},'logInfo':_0x12975a=>console['error'](a39_0x247d52['blue']('βœ”\x20'+_0x12975a)),'logSuccess':_0x419633=>console[_0x58e197(0x100)](a39_0x247d52[_0x58e197(0x104)]('βœ”\x20'+_0x419633)),'logWarning':_0x4239e6=>console['error'](a39_0x247d52[_0x58e197(0xfd)]('⚠\x20'+_0x4239e6)),'logDeleted':_0x22dff6=>console[_0x58e197(0x100)](a39_0x247d52[_0x58e197(0xfe)]('βœ”\x20'+_0x22dff6))},_0x3a5b61={'segment':_0x21989c['segment'],'journey':_0x21989c[_0x58e197(0x11b)],'user':_0x21989c['user'],'connection':_0x21989c[_0x58e197(0x12e)]};_0x3f956a[_0x58e197(0xc1)]>0x0&&(_0x26b5f7=await executePushFolders(_0x3a5b61,_0x3f956a,_0x26b5f7,{'parentId':_0x21acdf},_0x2941d6));const _0x2e9108={'rootFolderId':_0x24d20a,'folderPathToId':_0x26b5f7,'folderIdToPath':_0x39e11c,'segmentNameToId':_0x463468,'activationsBySegmentId':_0x447908,'emailToIdMap':_0x2a8845,'idToEmailMap':_0x248fce,'connectionNameToIdMap':_0x5df252[_0x58e197(0xae)],'connectionIdToNameMap':_0x5df252[_0x58e197(0x146)],'connectionNameToTypeMap':_0x4be8cb},_0x4a1691=await executePushSegments(_0x3a5b61,_0x16c303['journeysOnly']?[]:_0x3e4137,_0x2e9108,{'parentId':_0x21acdf},_0x2941d6),_0x2d9e62=_0x4a1691[_0x58e197(0xd5)],_0x3b62b9=_0x4a1691[_0x58e197(0x143)],_0x188d03=_0x4a1691['activations'][_0x58e197(0xd5)],_0x2ccc9b=_0x4a1691['activations']['updated'],_0x2f07e6=_0x4a1691[_0x58e197(0x127)][_0x58e197(0xbf)];let _0x324b60;if(_0x559818&&_0x3e4137['length']===0x1){const _0x488c74=_0x3e4137[0x0];_0x324b60=_0x488c74[_0x58e197(0x120)]?.['id']??_0x4a1691[_0x58e197(0x11d)][_0x58e197(0xeb)](_0x488c74[_0x58e197(0xb3)][_0x58e197(0x142)]);}const _0x54e034=await executePushSegmentDeletions(_0x3a5b61,_0x16c303[_0x58e197(0xe5)]?[]:_0x19825a,_0x2941d6);let _0x4b695f=0x0,_0x3996ec=0x0,_0x44b8a2=0x0;const _0x1ccdb6=new Map(_0x463468);for(const [_0x55f561,_0x30f497]of _0x4a1691[_0x58e197(0x11d)]){_0x1ccdb6[_0x58e197(0xca)](_0x55f561,_0x30f497);}if(_0x903edc[_0x58e197(0xc1)]>0x0){const _0x2d8a71={..._0x2e9108,'segmentNameToId':_0x1ccdb6,'existingSegments':_0x3fb192,'activationContext':_0x1179cd},_0x4681d8=await executePushJourneys(_0x3a5b61,_0x903edc,_0x2d8a71,{'parentId':_0x21acdf,'rootFolderId':_0x24d20a,'verbose':_0x16c303[_0x58e197(0xd3)]},_0x2941d6);_0x4b695f=_0x4681d8[_0x58e197(0xd5)],_0x3996ec=_0x4681d8['updated'];if(_0x559818&&_0x4681d8['results'][_0x58e197(0xc1)]===0x1){const _0x196133=_0x4681d8['results'][0x0];if(_0x196133[_0x58e197(0xc6)]){const _0x30c064=getConsoleNextUrl(_0x16c303['site'],'/app/ps/'+_0x21acdf+_0x58e197(0xb0)+_0x196133[_0x58e197(0xc6)]+_0x58e197(0xc5));console[_0x58e197(0x100)]('\x20\x20'+a39_0x247d52[_0x58e197(0x118)](_0x30c064));}}}for(const _0x56066b of _0x5d76a0){console[_0x58e197(0x100)](a39_0x247d52[_0x58e197(0xfd)](_0x58e197(0xc9)+_0x56066b['journeyBundleName'])),_0x44b8a2++;}const _0x4609d6=[];if(_0x2d9e62>0x0)_0x4609d6[_0x58e197(0x10d)](_0x2d9e62+_0x58e197(0xea));if(_0x3b62b9>0x0)_0x4609d6[_0x58e197(0x10d)](_0x3b62b9+_0x58e197(0x105));if(_0x54e034>0x0)_0x4609d6[_0x58e197(0x10d)](_0x54e034+_0x58e197(0x126));const _0x1d997c=[];if(_0x4b695f>0x0)_0x1d997c[_0x58e197(0x10d)](_0x4b695f+_0x58e197(0xea));if(_0x3996ec>0x0)_0x1d997c[_0x58e197(0x10d)](_0x3996ec+_0x58e197(0x105));if(_0x44b8a2>0x0)_0x1d997c[_0x58e197(0x10d)](_0x44b8a2+_0x58e197(0x126));const _0x56041e=[];if(_0x188d03>0x0)_0x56041e[_0x58e197(0x10d)](_0x188d03+'\x20created');if(_0x2ccc9b>0x0)_0x56041e['push'](_0x2ccc9b+_0x58e197(0x105));if(_0x2f07e6>0x0)_0x56041e[_0x58e197(0x10d)](_0x2f07e6+_0x58e197(0x126));console[_0x58e197(0x100)](a39_0x247d52[_0x58e197(0x104)]('\x0aβœ”\x20Push\x20complete'));_0x4609d6[_0x58e197(0xc1)]>0x0&&!_0x16c303[_0x58e197(0xe5)]&&console[_0x58e197(0x100)](_0x58e197(0xbd)+_0x4609d6[_0x58e197(0xe6)](',\x20'));_0x1d997c[_0x58e197(0xc1)]>0x0&&console[_0x58e197(0x100)]('\x20\x20Journeys:\x20'+_0x1d997c[_0x58e197(0xe6)](',\x20'));_0x56041e['length']>0x0&&!_0x16c303['journeysOnly']&&console[_0x58e197(0x100)](_0x58e197(0xf3)+_0x56041e[_0x58e197(0xe6)](',\x20'));if(_0x324b60){const _0x334da1=getConsoleNextUrl(_0x16c303[_0x58e197(0x10b)],_0x58e197(0x109)+_0x21acdf+_0x58e197(0xb0)+_0x324b60+_0x58e197(0x13e));console[_0x58e197(0x100)](_0x58e197(0xac)+a39_0x247d52[_0x58e197(0x118)](_0x334da1));}return 0x0;}}