@treasuredata/tdx 2026.3.18 β†’ 2026.3.20

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 (204) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.js +1 -1
  5. package/dist/commands/activations.js +1 -1
  6. package/dist/commands/agent-command.js +1 -1
  7. package/dist/commands/agent-test-command.js +1 -1
  8. package/dist/commands/api-command.js +1 -1
  9. package/dist/commands/auth-command.js +1 -1
  10. package/dist/commands/auth-login-command.js +1 -1
  11. package/dist/commands/chat-command.js +1 -1
  12. package/dist/commands/claude-command.js +1 -1
  13. package/dist/commands/claude-statusline-command.js +1 -1
  14. package/dist/commands/claude-usage-command.js +1 -1
  15. package/dist/commands/command.js +1 -1
  16. package/dist/commands/connection-command.js +1 -1
  17. package/dist/commands/databases.js +1 -1
  18. package/dist/commands/delivery-command.js +1 -1
  19. package/dist/commands/describe.js +1 -1
  20. package/dist/commands/engage-campaign-pull-command.js +1 -1
  21. package/dist/commands/engage-campaign-push-command.js +1 -1
  22. package/dist/commands/engage-campaign-validate-command.js +1 -1
  23. package/dist/commands/engage-command.js +1 -1
  24. package/dist/commands/engage-template-pull-command.js +1 -1
  25. package/dist/commands/engage-template-push-command.js +1 -1
  26. package/dist/commands/engage-template-validate-command.js +1 -1
  27. package/dist/commands/job-command.js +1 -1
  28. package/dist/commands/journey-command.js +1 -1
  29. package/dist/commands/journey-validate-command.js +1 -1
  30. package/dist/commands/llm-command.js +1 -1
  31. package/dist/commands/mcp-command.js +1 -1
  32. package/dist/commands/parent-segment-command.js +1 -1
  33. package/dist/commands/profile-command.js +1 -1
  34. package/dist/commands/profiles-command.js +1 -1
  35. package/dist/commands/query-command.js +1 -1
  36. package/dist/commands/schedule-command.js +1 -1
  37. package/dist/commands/segment-command.js +1 -1
  38. package/dist/commands/segment-create-command.js +1 -1
  39. package/dist/commands/segment-fields-command.js +1 -1
  40. package/dist/commands/segment-pull-command.js +1 -1
  41. package/dist/commands/segment-push-command.js +1 -1
  42. package/dist/commands/segment-update-command.js +1 -1
  43. package/dist/commands/segment-use-command.js +1 -1
  44. package/dist/commands/segment-validate-command.js +1 -1
  45. package/dist/commands/segments.js +1 -1
  46. package/dist/commands/show.js +1 -1
  47. package/dist/commands/status-command.js +1 -1
  48. package/dist/commands/tables.js +1 -1
  49. package/dist/commands/unset-command.js +1 -1
  50. package/dist/commands/upgrade-command.js +1 -1
  51. package/dist/commands/use-command.js +1 -1
  52. package/dist/commands/user-command.js +1 -1
  53. package/dist/commands/workflow-command.js +1 -1
  54. package/dist/core/auth.js +1 -1
  55. package/dist/core/command-output.js +1 -1
  56. package/dist/core/config.js +1 -1
  57. package/dist/core/connection-cache.js +1 -1
  58. package/dist/core/constants.js +1 -1
  59. package/dist/core/credential-cache.js +1 -1
  60. package/dist/core/global-context.js +1 -1
  61. package/dist/core/keychain.js +1 -1
  62. package/dist/core/oauth-keychain.js +1 -1
  63. package/dist/core/oauth.js +1 -1
  64. package/dist/core/profile.js +1 -1
  65. package/dist/core/project-config.js +1 -1
  66. package/dist/core/session.js +1 -1
  67. package/dist/core/user-cache.js +1 -1
  68. package/dist/core/version.js +1 -1
  69. package/dist/index.js +1 -1
  70. package/dist/mcp/server.js +1 -1
  71. package/dist/mcp/tools/index.js +1 -1
  72. package/dist/mcp/tools/tdx-run.js +1 -1
  73. package/dist/mcp/tools/tdx-search.js +1 -1
  74. package/dist/mcp/utils.js +1 -1
  75. package/dist/proxy/claude-usage-tracker.js +1 -1
  76. package/dist/proxy/passthrough-server.js +1 -1
  77. package/dist/proxy/sse-usage-parser.js +1 -1
  78. package/dist/sdk/agent/agent-config.js +1 -1
  79. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  80. package/dist/sdk/agent/agent-yaml.js +1 -1
  81. package/dist/sdk/agent/test/evaluator.js +1 -1
  82. package/dist/sdk/agent/test/executor.js +1 -1
  83. package/dist/sdk/agent/test/index.js +1 -1
  84. package/dist/sdk/agent/test/output.js +1 -1
  85. package/dist/sdk/agent/test/parser.js +1 -1
  86. package/dist/sdk/agent/tool-target-registry.js +1 -1
  87. package/dist/sdk/api.js +1 -1
  88. package/dist/sdk/client/cdp-api-client.js +1 -1
  89. package/dist/sdk/client/delivery-api-client.js +1 -1
  90. package/dist/sdk/client/endpoints.js +1 -1
  91. package/dist/sdk/client/engage-api-client.js +1 -1
  92. package/dist/sdk/client/http-client.js +1 -1
  93. package/dist/sdk/client/llm-api-client.js +1 -1
  94. package/dist/sdk/client/oauth-refresh.js +1 -1
  95. package/dist/sdk/client/rate-limiter.js +1 -1
  96. package/dist/sdk/client/td-api-client.js +1 -1
  97. package/dist/sdk/client/trino-api-client.js +1 -1
  98. package/dist/sdk/client/workflow-client.js +1 -1
  99. package/dist/sdk/connection-validator.js +1 -1
  100. package/dist/sdk/connection.js +1 -1
  101. package/dist/sdk/delivery.js +1 -1
  102. package/dist/sdk/engage/campaign-pull.js +1 -1
  103. package/dist/sdk/engage/campaign-push.js +1 -1
  104. package/dist/sdk/engage/campaign-validator.js +1 -1
  105. package/dist/sdk/engage/campaign-yaml.js +1 -1
  106. package/dist/sdk/engage/template-pull.js +1 -1
  107. package/dist/sdk/engage/template-push.js +1 -1
  108. package/dist/sdk/engage/template-validator.js +1 -1
  109. package/dist/sdk/engage/template-yaml.js +1 -1
  110. package/dist/sdk/engage/types/campaign-def.js +1 -1
  111. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  112. package/dist/sdk/engage/types/template-schema.js +1 -1
  113. package/dist/sdk/engage.js +1 -1
  114. package/dist/sdk/errors.js +1 -1
  115. package/dist/sdk/index.js +1 -1
  116. package/dist/sdk/io/index.js +1 -1
  117. package/dist/sdk/io/node-filesystem.js +1 -1
  118. package/dist/sdk/job.js +1 -1
  119. package/dist/sdk/journey.js +1 -1
  120. package/dist/sdk/llm/chat-cache.js +1 -1
  121. package/dist/sdk/llm/index.js +1 -1
  122. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  123. package/dist/sdk/llm/model-factors.js +1 -1
  124. package/dist/sdk/personalization.js +1 -1
  125. package/dist/sdk/query/index.js +1 -1
  126. package/dist/sdk/query/sql-parser.js +1 -1
  127. package/dist/sdk/realtime.js +1 -1
  128. package/dist/sdk/schedule.js +1 -1
  129. package/dist/sdk/segment/child-segment-yaml.d.ts.map +1 -1
  130. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  131. package/dist/sdk/segment/child-segment-yaml.js.map +1 -1
  132. package/dist/sdk/segment/fields-display.js +1 -1
  133. package/dist/sdk/segment/file-discovery.js +1 -1
  134. package/dist/sdk/segment/journey-utils.js +1 -1
  135. package/dist/sdk/segment/journey-validator.js +1 -1
  136. package/dist/sdk/segment/journey-yaml.js +1 -1
  137. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  138. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  139. package/dist/sdk/segment/pull-workflow.js +1 -1
  140. package/dist/sdk/segment/push-recovery.js +1 -1
  141. package/dist/sdk/segment/push-workflow.js +1 -1
  142. package/dist/sdk/segment/resolution-context.js +1 -1
  143. package/dist/sdk/segment/segment-path-parser.js +1 -1
  144. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  145. package/dist/sdk/segment/segment-validator.js +1 -1
  146. package/dist/sdk/segment/segment-validator.js.map +1 -1
  147. package/dist/sdk/segment/target-resolution.js +1 -1
  148. package/dist/sdk/segment/tdx-config.js +1 -1
  149. package/dist/sdk/segment/types/activation-schema.js +1 -1
  150. package/dist/sdk/segment/types/journey-def.js +1 -1
  151. package/dist/sdk/segment/types/journey-schema.js +1 -1
  152. package/dist/sdk/segment/types/segment-def.js +1 -1
  153. package/dist/sdk/segment/types/segment-schema.js +1 -1
  154. package/dist/sdk/segment/validate-files.js +1 -1
  155. package/dist/sdk/segment/yaml-validator.js +1 -1
  156. package/dist/sdk/segment.js +1 -1
  157. package/dist/sdk/types/index.js +1 -1
  158. package/dist/sdk/types/progress.js +1 -1
  159. package/dist/sdk/user.js +1 -1
  160. package/dist/sdk/util/format-detector.js +1 -1
  161. package/dist/sdk/util/formatters.js +1 -1
  162. package/dist/sdk/util/index.js +1 -1
  163. package/dist/sdk/util/paginate.js +1 -1
  164. package/dist/sdk/util/tree-formatter.js +1 -1
  165. package/dist/sdk/workflow/archive-validation.js +1 -1
  166. package/dist/sdk/workflow/clone-workflow.js +1 -1
  167. package/dist/sdk/workflow/index.js +1 -1
  168. package/dist/sdk/workflow/pull-workflow.js +1 -1
  169. package/dist/sdk/workflow/push-workflow.js +1 -1
  170. package/dist/sdk/workflow/tdx-config.js +1 -1
  171. package/dist/sdk/workflow/workflow-utils.js +1 -1
  172. package/dist/test-utils/command-runner.js +1 -1
  173. package/dist/test-utils/factories.js +1 -1
  174. package/dist/test-utils/fixtures.js +1 -1
  175. package/dist/test-utils/http-mock.js +1 -1
  176. package/dist/test-utils/index.js +1 -1
  177. package/dist/utils/async.js +1 -1
  178. package/dist/utils/colors.js +1 -1
  179. package/dist/utils/diff.js +1 -1
  180. package/dist/utils/file-permissions.js +1 -1
  181. package/dist/utils/file-reader.js +1 -1
  182. package/dist/utils/github-releases.js +1 -1
  183. package/dist/utils/global-cache.js +1 -1
  184. package/dist/utils/json-loader.js +1 -1
  185. package/dist/utils/local-cache.js +1 -1
  186. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  187. package/dist/utils/logger/formatters/index.js +1 -1
  188. package/dist/utils/logger/handlers/console-handler.js +1 -1
  189. package/dist/utils/logger/handlers/file-handler.js +1 -1
  190. package/dist/utils/logger/handlers/index.js +1 -1
  191. package/dist/utils/logger/handlers/null-handler.js +1 -1
  192. package/dist/utils/logger/index.js +1 -1
  193. package/dist/utils/logger/logger.js +1 -1
  194. package/dist/utils/logger/types.js +1 -1
  195. package/dist/utils/option-validation.js +1 -1
  196. package/dist/utils/process.js +1 -1
  197. package/dist/utils/prompt.js +1 -1
  198. package/dist/utils/spinner.js +1 -1
  199. package/dist/utils/sse-parser.js +1 -1
  200. package/dist/utils/string-utils.js +1 -1
  201. package/dist/utils/table-ref-parser.js +1 -1
  202. package/dist/utils/tdx-logger.js +1 -1
  203. package/dist/utils/version-check.js +1 -1
  204. package/package.json +1 -1
@@ -1 +1 @@
1
- const a34_0x25e1d1=a34_0x1b84;(function(_0x2dc335,_0xcfa7e7){const _0x39a728=a34_0x1b84,_0x2d4918=_0x2dc335();while(!![]){try{const _0x1e723f=parseInt(_0x39a728(0x193))/0x1+parseInt(_0x39a728(0x122))/0x2*(parseInt(_0x39a728(0x14b))/0x3)+parseInt(_0x39a728(0x192))/0x4*(parseInt(_0x39a728(0x164))/0x5)+parseInt(_0x39a728(0x17d))/0x6+-parseInt(_0x39a728(0x120))/0x7+-parseInt(_0x39a728(0x10f))/0x8*(parseInt(_0x39a728(0x169))/0x9)+-parseInt(_0x39a728(0x13f))/0xa;if(_0x1e723f===_0xcfa7e7)break;else _0x2d4918['push'](_0x2d4918['shift']());}catch(_0x40351c){_0x2d4918['push'](_0x2d4918['shift']());}}}(a34_0x273d,0x70cef));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';function a34_0x1b84(_0xc17d5,_0x3b039d){_0xc17d5=_0xc17d5-0x10d;const _0x273dde=a34_0x273d();let _0x1b8495=_0x273dde[_0xc17d5];return _0x1b8495;}import{getConsoleUrl}from'../sdk/client/endpoints.js';import{hyperlink}from'../sdk/util/formatters.js';import a34_0x3bc83c from'chalk';function formatRelativeTime(_0x4046b0){const _0x63bc34=a34_0x1b84,_0x10f5c9=new Date(_0x4046b0),_0x220d95=new Date(),_0x4e664c=_0x10f5c9[_0x63bc34(0x16f)]()-_0x220d95['getTime'](),_0x4fde44=Math[_0x63bc34(0x12e)](_0x4e664c)/0x3e8,_0x16ab2e=_0x4e664c<0x0;if(_0x4fde44<0x3c)return _0x16ab2e?_0x63bc34(0x162):'soon';else{if(_0x4fde44<0xe10){const _0x472502=Math[_0x63bc34(0x12c)](_0x4fde44/0x3c);return _0x16ab2e?_0x472502+_0x63bc34(0x176):_0x63bc34(0x121)+_0x472502+'m';}else{if(_0x4fde44<0x15180){const _0x58af5c=Math['round'](_0x4fde44/0xe10);return _0x16ab2e?_0x58af5c+_0x63bc34(0x14f):'in\x20'+_0x58af5c+'h';}else{if(_0x4fde44<0x93a80){const _0x439cfb=Math[_0x63bc34(0x12c)](_0x4fde44/0x15180);return _0x16ab2e?_0x439cfb+_0x63bc34(0x115):'in\x20'+_0x439cfb+'d';}else return _0x10f5c9[_0x63bc34(0x117)]();}}}}export class ScheduleListCommand extends BaseCommand{[a34_0x25e1d1(0x15c)]=a34_0x25e1d1(0x19d);[a34_0x25e1d1(0x16a)]=a34_0x25e1d1(0x15e);async[a34_0x25e1d1(0x16d)](_0x1e039b){const _0x159f83=a34_0x25e1d1,{options:_0x30b8a7,args:_0x3995ed,tdx:_0x12bd1e}=_0x1e039b,_0x985f08=resolveLimit(_0x30b8a7['limit'],DEFAULT_DISPLAY_LIMIT),_0x117b4b=_0x3995ed[0x0],_0x53303c=_0x117b4b?_0x159f83(0x174)+_0x117b4b+_0x159f83(0x158):_0x159f83(0x11a),_0x42b5af=await withSpinner(_0x53303c,()=>_0x12bd1e['schedules'][_0x159f83(0x18e)]({'limit':_0x985f08,'scheduled':!![],'pattern':_0x117b4b}),{'verbose':_0x30b8a7[_0x159f83(0x154)]}),_0x55058d=_0x42b5af['data'][_0x159f83(0x134)],_0x2f1919=_0x42b5af['data'][_0x159f83(0x179)][_0x159f83(0x199)],_0x332063=_0x117b4b?_0x159f83(0x14c)+_0x117b4b+'\x22':'';_0x2f1919?console[_0x159f83(0x171)](_0x159f83(0x127)+_0x55058d[_0x159f83(0x182)]+'\x20schedules'+_0x332063+_0x159f83(0x16c)):console[_0x159f83(0x171)](_0x159f83(0x118)+_0x55058d[_0x159f83(0x182)]+_0x159f83(0x15d)+(_0x55058d[_0x159f83(0x182)]!==0x1?_0x159f83(0x144):'y')+_0x332063);if(_0x30b8a7['format']===_0x159f83(0x123)||_0x30b8a7[_0x159f83(0x12f)]===_0x159f83(0x18c)||_0x30b8a7['format']===_0x159f83(0x183)||_0x30b8a7[_0x159f83(0x12f)]==='tsv'){const _0x537e52=_0x55058d[_0x159f83(0x16b)](_0x52abed=>({'id':_0x52abed['id'],'name':_0x52abed['name'],'cron':_0x52abed[_0x159f83(0x11e)],'database':_0x52abed['database']?.[_0x159f83(0x15c)],'type':_0x52abed[_0x159f83(0x19c)],'timezone':_0x52abed[_0x159f83(0x17a)],'user_name':_0x52abed[_0x159f83(0x17b)]?.['name'],'updated_at':_0x52abed['updated_at'],'next_run_at':_0x52abed[_0x159f83(0x18a)],'last_job_status':_0x52abed[_0x159f83(0x116)]?.[_0x159f83(0x124)]}));await handleSDKOutput(_0x537e52,_0x30b8a7);}else{if(_0x55058d['length']===0x0)console[_0x159f83(0x140)](_0x159f83(0x14a));else{const _0x2124d4=_0x30b8a7['site'],_0x593e9f=_0x55058d['map'](_0x30fd74=>{const _0x49a543=_0x159f83,_0x969e61=_0x30fd74[_0x49a543(0x116)]?.['status']?_0x30fd74['last_job']['status']==='success'?'βœ“':'βœ—':'-',_0x4fe268=_0x30fd74['last_job']?.[_0x49a543(0x148)]?formatRelativeTime(_0x30fd74['last_job'][_0x49a543(0x148)]):'never',_0x2b4c7b=_0x30fd74[_0x49a543(0x18a)]?formatRelativeTime(_0x30fd74[_0x49a543(0x18a)]):'-',_0x2d9204=_0x30fd74['cron']||'',_0x36a562=_0x30fd74[_0x49a543(0x15c)]||_0x49a543(0x198),_0x40f941=getConsoleUrl(_0x2124d4,_0x49a543(0x110)+_0x30fd74['id']);return{'statusIcon':_0x969e61,'lastRun':_0x4fe268,'nextRun':_0x2b4c7b,'cron':_0x2d9204,'name':_0x36a562,'queryUrl':_0x40f941,'status':_0x30fd74[_0x49a543(0x116)]?.[_0x49a543(0x124)]};}),_0xfdc602=Math[_0x159f83(0x130)](..._0x593e9f[_0x159f83(0x16b)](_0x52d6b9=>_0x52d6b9['lastRun']['length'])),_0x3cd33c=Math[_0x159f83(0x130)](..._0x593e9f[_0x159f83(0x16b)](_0x2af7ac=>_0x2af7ac['nextRun'][_0x159f83(0x182)])),_0x1e8bba=Math[_0x159f83(0x130)](..._0x593e9f['map'](_0x559f0b=>_0x559f0b[_0x159f83(0x11e)]['length'])),_0x2e300f=_0x593e9f[_0x159f83(0x16b)](_0x364cf5=>{const _0x2c79c8=_0x159f83,_0x53f663=_0x364cf5[_0x2c79c8(0x124)]===_0x2c79c8(0x15b)?a34_0x3bc83c[_0x2c79c8(0x114)](_0x364cf5['statusIcon']):_0x364cf5[_0x2c79c8(0x124)]===_0x2c79c8(0x171)?a34_0x3bc83c[_0x2c79c8(0x194)](_0x364cf5[_0x2c79c8(0x155)]):a34_0x3bc83c[_0x2c79c8(0x135)](_0x364cf5[_0x2c79c8(0x155)]),_0x53ae25=_0x364cf5['lastRun']['padEnd'](_0xfdc602),_0x901ef7=_0x364cf5[_0x2c79c8(0x137)][_0x2c79c8(0x186)](_0x3cd33c),_0x59247e=_0x364cf5[_0x2c79c8(0x11e)]?a34_0x3bc83c[_0x2c79c8(0x18b)](_0x364cf5[_0x2c79c8(0x11e)][_0x2c79c8(0x186)](_0x1e8bba)):'\x20'['repeat'](_0x1e8bba),_0xd697c3=hyperlink(_0x364cf5[_0x2c79c8(0x15c)],_0x364cf5[_0x2c79c8(0x147)]);return'πŸ“…\x20'+_0x53f663+'\x20'+_0x53ae25+'\x20\x20β†’\x20'+_0x901ef7+'\x20\x20'+_0x59247e+'\x20\x20'+_0xd697c3;});await writeOutput(_0x2e300f[_0x159f83(0x161)]('\x0a'),_0x30b8a7[_0x159f83(0x12a)],_0x159f83(0x172));}}return 0x0;}}export class ScheduleShowCommand extends BaseCommand{['name']=a34_0x25e1d1(0x159);[a34_0x25e1d1(0x16a)]=a34_0x25e1d1(0x143);[a34_0x25e1d1(0x19f)](_0xf551e1){const _0x345e5a=a34_0x25e1d1,_0x97b142=_0xf551e1[_0x345e5a(0x14d)][0x0];if(!_0x97b142)return _0x345e5a(0x17e);return undefined;}async['execute'](_0x1edeee){const _0x3097f9=a34_0x25e1d1,{options:_0x362f96,args:_0x225fbd,tdx:_0x12152f}=_0x1edeee,_0x3ed755=_0x225fbd[0x0],_0x441d8a=await withSpinner('Getting\x20schedule\x20details...',()=>_0x12152f[_0x3097f9(0x10d)][_0x3097f9(0x13b)](_0x3ed755),{'verbose':_0x362f96['verbose']}),_0x3062e1=_0x441d8a[_0x3097f9(0x185)],_0x2605fc={'name':_0x3062e1['name'],'cron':_0x3062e1['cron'],'database':_0x3062e1[_0x3097f9(0x160)],'type':_0x3062e1[_0x3097f9(0x19c)],'timezone':_0x3062e1[_0x3097f9(0x19b)],'user_name':_0x3062e1['user_name'],'created_at':_0x3062e1['created_at'],'engine_version':_0x3062e1[_0x3097f9(0x11f)],'executing_user_id':_0x3062e1['executing_user_id'],'query':_0x3062e1[_0x3097f9(0x157)],'delay':_0x3062e1[_0x3097f9(0x142)],'priority':_0x3062e1['priority'],'retry_limit':_0x3062e1['retry_limit'],..._0x3062e1[_0x3097f9(0x190)]&&{'result':_0x3062e1['result']}};return await handleSingleObjectOutput(_0x2605fc,_0x362f96),0x0;}}function a34_0x273d(){const _0x4b4c28=['green','d\x20ago','last_job','toLocaleDateString','Found\x20','...','Listing\x20scheduled\x20queries...','Creating\x20schedule...','run','Create\x20a\x20scheduled\x20query','cron','engine_version','1529787evGMXH','in\x20','130362yNxwVz','json','status','Schedule\x20deleted:\x20','Failed\x20to\x20read\x20file:\x20','Showing\x20first\x20','entries','utf-8','output','delete','round','\x20created','abs','format','max','INVALID_ARGUMENT','trino','priority','queries','dim','\x20\x20Cron:\x20','nextRun','schedule:update','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20schedule\x20\x22','options','show','schedule:run','time','Updating\x20schedule:\x20','466930kQiwGs','log','keys','delay','Show\x20schedule\x20details','ies','create','\x20\x20Timezone:\x20','queryUrl','ended_at','Cancelled','No\x20scheduled\x20queries\x20found','15aYbAVL','\x20matching\x20\x22','args','schedule:create','h\x20ago','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20run\x20<name>\x20[--time\x20<iso8601>]\x20[--num\x20<1-10>]','num','retry_limit','\x20\x20Database:\x20','verbose','statusIcon','Deleting\x20schedule...','query','\x22...','schedule:show','\x20\x20Job\x20ID:\x20','success','name','\x20scheduled\x20quer','List\x20scheduled\x20queries','from','database','join','just\x20now','\x20\x20Type:\x20','428015xyuJdn','Delete\x20a\x20scheduled\x20query','Updating\x20schedule...','start_at','engineVersion','82449UaniDp','description','map','\x20(use\x20--limit\x20to\x20see\x20more)','execute','\x20job','getTime','Getting\x20schedule\x20history...','error','list','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20delete\x20<name>','Searching\x20scheduled\x20queries\x20matching\x20\x22','At\x20least\x20one\x20option\x20must\x20be\x20provided\x20to\x20update','m\x20ago','retryLimit','history','pagination','time_zone','user','\x20\x20Num:\x20','846162hURoum','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20show\x20<name>','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20update\x20<name>\x20[options]','Schedule\x20created:\x20','Creating\x20schedule:\x20','length','table','job_id','data','padEnd','Database\x20is\x20required\x0aUsage:\x20job\x20schedule\x20create\x20<name>\x20-d\x20<db>\x20--file\x20<path>\x20[options]','Update\x20a\x20scheduled\x20query','Schedule\x20updated:\x20','next_run_at','cyan','jsonl','update','listQueries','count','result','Run\x20a\x20scheduled\x20query\x20immediately','24hDUxze','58221iUIlgn','red','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20history\x20<name>\x20[--from\x20<n>]\x20[--to\x20<n>]','file','\x20(showing\x20','(unnamed)','has_next_page','end_at','timezone','type','schedule:list','trim','validate','schedules','schedule:history','272durldU','/app/queries/editor?queryId=','jobs','Schedule\x20run\x20submitted:\x20','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20create\x20<name>\x20-d\x20<db>\x20--file\x20<path>\x20[options]'];a34_0x273d=function(){return _0x4b4c28;};return a34_0x273d();}export class ScheduleCreateCommand extends BaseCommand{[a34_0x25e1d1(0x15c)]=a34_0x25e1d1(0x14e);[a34_0x25e1d1(0x16a)]=a34_0x25e1d1(0x11d);['validate'](_0x287cdb){const _0x173c13=a34_0x25e1d1,_0x520954=_0x287cdb['args'][0x0];if(!_0x520954)return _0x173c13(0x113);const _0x26568f=_0x287cdb[_0x173c13(0x13a)];if(!_0x26568f['database'])return _0x173c13(0x187);return undefined;}async['execute'](_0x587f62){const _0x338004=a34_0x25e1d1,{options:_0x5cf415,args:_0xf24e99,tdx:_0x48c1fa}=_0x587f62,_0x2012a1=_0xf24e99[0x0],_0x1913f7=_0x5cf415,_0x17d505=_0x1913f7[_0x338004(0x160)],_0x1249d9=_0x1913f7[_0x338004(0x196)],_0x40d503=_0x1913f7['type']||_0x338004(0x132);let _0x4127c7;try{_0x4127c7=readFileSync(_0x1249d9,_0x338004(0x129))[_0x338004(0x19e)]();}catch(_0x327e04){throw new SDKError(ErrorCode[_0x338004(0x131)],_0x338004(0x126)+_0x1249d9,_0x327e04 instanceof Error?_0x327e04:undefined);}if(!_0x4127c7)throw new SDKError(ErrorCode[_0x338004(0x131)],'Query\x20file\x20is\x20empty');const _0x4b3a70={'database':_0x17d505,'query':_0x4127c7,'type':_0x40d503};if(_0x1913f7[_0x338004(0x11e)])_0x4b3a70[_0x338004(0x11e)]=_0x1913f7[_0x338004(0x11e)];if(_0x1913f7[_0x338004(0x19b)])_0x4b3a70[_0x338004(0x19b)]=_0x1913f7['timezone'];if(_0x1913f7['delay']!==undefined)_0x4b3a70[_0x338004(0x142)]=Number(_0x1913f7['delay']);if(_0x1913f7[_0x338004(0x133)]!==undefined)_0x4b3a70[_0x338004(0x133)]=Number(_0x1913f7['priority']);if(_0x1913f7[_0x338004(0x177)]!==undefined)_0x4b3a70[_0x338004(0x152)]=Number(_0x1913f7[_0x338004(0x177)]);if(_0x1913f7[_0x338004(0x168)])_0x4b3a70[_0x338004(0x11f)]=_0x1913f7[_0x338004(0x168)];if(_0x1913f7['result'])_0x4b3a70[_0x338004(0x190)]=_0x1913f7['result'];if(_0x5cf415['verbose']){console['error'](_0x338004(0x181)+_0x2012a1),console[_0x338004(0x171)](_0x338004(0x153)+_0x17d505),console['error'](_0x338004(0x163)+_0x40d503);if(_0x4b3a70['cron'])console['error'](_0x338004(0x136)+_0x4b3a70[_0x338004(0x11e)]);if(_0x4b3a70[_0x338004(0x19b)])console[_0x338004(0x171)](_0x338004(0x146)+_0x4b3a70['timezone']);}const _0x3171bf=await withSpinner(_0x338004(0x11b),()=>_0x48c1fa[_0x338004(0x10d)][_0x338004(0x145)](_0x2012a1,_0x4b3a70),{'verbose':_0x5cf415[_0x338004(0x154)]});return console[_0x338004(0x171)](_0x338004(0x180)+_0x3171bf[_0x338004(0x185)][_0x338004(0x15c)]),await handleSingleObjectOutput(_0x3171bf[_0x338004(0x185)],_0x5cf415),0x0;}}export class ScheduleUpdateCommand extends BaseCommand{[a34_0x25e1d1(0x15c)]=a34_0x25e1d1(0x138);[a34_0x25e1d1(0x16a)]=a34_0x25e1d1(0x188);['validate'](_0x48c0e4){const _0x3d8fe6=a34_0x25e1d1,_0x126cf2=_0x48c0e4[_0x3d8fe6(0x14d)][0x0];if(!_0x126cf2)return _0x3d8fe6(0x17f);return undefined;}async[a34_0x25e1d1(0x16d)](_0x2acbae){const _0x62d120=a34_0x25e1d1,{options:_0x181255,args:_0xbe3c80,tdx:_0x1a3deb}=_0x2acbae,_0x4c26b3=_0xbe3c80[0x0],_0x397a16=_0x181255,_0x1372a2={};if(_0x397a16['database'])_0x1372a2['database']=_0x397a16[_0x62d120(0x160)];if(_0x397a16['type'])_0x1372a2[_0x62d120(0x19c)]=_0x397a16[_0x62d120(0x19c)];if(_0x397a16[_0x62d120(0x11e)])_0x1372a2[_0x62d120(0x11e)]=_0x397a16[_0x62d120(0x11e)];if(_0x397a16[_0x62d120(0x19b)])_0x1372a2[_0x62d120(0x19b)]=_0x397a16[_0x62d120(0x19b)];if(_0x397a16[_0x62d120(0x142)]!==undefined)_0x1372a2[_0x62d120(0x142)]=Number(_0x397a16[_0x62d120(0x142)]);if(_0x397a16[_0x62d120(0x133)]!==undefined)_0x1372a2['priority']=Number(_0x397a16[_0x62d120(0x133)]);if(_0x397a16['retryLimit']!==undefined)_0x1372a2[_0x62d120(0x152)]=Number(_0x397a16['retryLimit']);if(_0x397a16[_0x62d120(0x168)])_0x1372a2[_0x62d120(0x11f)]=_0x397a16[_0x62d120(0x168)];if(_0x397a16[_0x62d120(0x190)])_0x1372a2['result']=_0x397a16[_0x62d120(0x190)];if(_0x397a16[_0x62d120(0x196)])try{_0x1372a2[_0x62d120(0x157)]=readFileSync(_0x397a16[_0x62d120(0x196)],_0x62d120(0x129))['trim']();}catch(_0x2f6094){throw new SDKError(ErrorCode[_0x62d120(0x131)],_0x62d120(0x126)+_0x397a16[_0x62d120(0x196)],_0x2f6094 instanceof Error?_0x2f6094:undefined);}if(Object[_0x62d120(0x141)](_0x1372a2)[_0x62d120(0x182)]===0x0)throw new SDKError(ErrorCode[_0x62d120(0x131)],_0x62d120(0x175));if(_0x181255['verbose']){console[_0x62d120(0x171)](_0x62d120(0x13e)+_0x4c26b3);for(const [_0x38f8ca,_0x4c0f80]of Object[_0x62d120(0x128)](_0x1372a2)){_0x38f8ca===_0x62d120(0x157)?console[_0x62d120(0x171)]('\x20\x20'+_0x38f8ca+':\x20'+_0x4c0f80['substring'](0x0,0x32)+_0x62d120(0x119)):console[_0x62d120(0x171)]('\x20\x20'+_0x38f8ca+':\x20'+_0x4c0f80);}}const _0x1d71bd=await withSpinner(_0x62d120(0x166),()=>_0x1a3deb[_0x62d120(0x10d)][_0x62d120(0x18d)](_0x4c26b3,_0x1372a2),{'verbose':_0x181255[_0x62d120(0x154)]});return console[_0x62d120(0x171)](_0x62d120(0x189)+_0x1d71bd[_0x62d120(0x185)][_0x62d120(0x15c)]),await handleSingleObjectOutput(_0x1d71bd[_0x62d120(0x185)],_0x181255),0x0;}}export class ScheduleDeleteCommand extends BaseCommand{[a34_0x25e1d1(0x15c)]='schedule:delete';[a34_0x25e1d1(0x16a)]=a34_0x25e1d1(0x165);['validate'](_0x1be25b){const _0x255b0a=a34_0x25e1d1,_0x57a308=_0x1be25b[_0x255b0a(0x14d)][0x0];if(!_0x57a308)return _0x255b0a(0x173);return undefined;}async['execute'](_0x134855){const _0x211f17=a34_0x25e1d1,{options:_0x45fd2b,args:_0x469ced,tdx:_0x38e63f}=_0x134855,_0x2e23b2=_0x469ced[0x0];if(!_0x45fd2b['yes']){const _0x157c71=await confirm(_0x211f17(0x139)+_0x2e23b2+'\x22?');if(!_0x157c71)return console[_0x211f17(0x171)](_0x211f17(0x149)),0x0;}const _0x5670e0=await withSpinner(_0x211f17(0x156),()=>_0x38e63f[_0x211f17(0x10d)][_0x211f17(0x12b)](_0x2e23b2),{'verbose':_0x45fd2b[_0x211f17(0x154)]});return console[_0x211f17(0x171)](_0x211f17(0x125)+_0x5670e0[_0x211f17(0x185)]['name']),0x0;}}export class ScheduleRunCommand extends BaseCommand{[a34_0x25e1d1(0x15c)]=a34_0x25e1d1(0x13c);['description']=a34_0x25e1d1(0x191);[a34_0x25e1d1(0x19f)](_0x4055e1){const _0x2803e9=a34_0x25e1d1,_0x502d13=_0x4055e1[_0x2803e9(0x14d)][0x0];if(!_0x502d13)return _0x2803e9(0x150);return undefined;}async[a34_0x25e1d1(0x16d)](_0x5b420e){const _0xd9f054=a34_0x25e1d1,{options:_0x307897,args:_0x2a15c2,tdx:_0xcc737}=_0x5b420e,_0x3b9ab0=_0x2a15c2[0x0],_0x128e8c=_0x307897,_0x3a3ff3=_0x128e8c[_0xd9f054(0x13d)],_0x1f3b03=_0x128e8c['num']!==undefined?Number(_0x128e8c[_0xd9f054(0x151)]):undefined;if(_0x307897['verbose']){console[_0xd9f054(0x171)]('Running\x20schedule:\x20'+_0x3b9ab0);if(_0x3a3ff3)console['error']('\x20\x20Time:\x20'+_0x3a3ff3);if(_0x1f3b03)console[_0xd9f054(0x171)](_0xd9f054(0x17c)+_0x1f3b03);}const _0x491cb9=await withSpinner('Running\x20schedule...',()=>_0xcc737[_0xd9f054(0x10d)][_0xd9f054(0x11c)](_0x3b9ab0,{'time':_0x3a3ff3,'num':_0x1f3b03}),{'verbose':_0x307897[_0xd9f054(0x154)]}),_0x4a1635=_0x491cb9['data'][_0xd9f054(0x111)];console['error'](_0xd9f054(0x112)+_0x4a1635[_0xd9f054(0x182)]+_0xd9f054(0x16e)+(_0x4a1635[_0xd9f054(0x182)]!==0x1?'s':'')+_0xd9f054(0x12d));for(const _0x5417ae of _0x4a1635){console[_0xd9f054(0x171)](_0xd9f054(0x15a)+_0x5417ae[_0xd9f054(0x184)]);}return await handleSDKOutput(_0x4a1635,_0x307897),0x0;}}export class ScheduleHistoryCommand extends BaseCommand{[a34_0x25e1d1(0x15c)]=a34_0x25e1d1(0x10e);[a34_0x25e1d1(0x16a)]='Show\x20schedule\x20execution\x20history';[a34_0x25e1d1(0x19f)](_0x18b4b9){const _0x3d6ab8=a34_0x25e1d1,_0x131698=_0x18b4b9[_0x3d6ab8(0x14d)][0x0];if(!_0x131698)return _0x3d6ab8(0x195);return undefined;}async[a34_0x25e1d1(0x16d)](_0xfd1fe8){const _0x593008=a34_0x25e1d1,{options:_0x4913aa,args:_0x502639,tdx:_0x47a0b0}=_0xfd1fe8,_0x484158=_0x502639[0x0],_0x53d000=_0x4913aa,_0x142c21=_0x53d000[_0x593008(0x15f)]!==undefined?Number(_0x53d000[_0x593008(0x15f)]):undefined,_0x58e717=_0x53d000['to']!==undefined?Number(_0x53d000['to']):undefined,_0x22d0be=await withSpinner(_0x593008(0x170),()=>_0x47a0b0[_0x593008(0x10d)][_0x593008(0x178)](_0x484158,{'from':_0x142c21,'to':_0x58e717}),{'verbose':_0x4913aa[_0x593008(0x154)]}),_0x412eaa=_0x22d0be[_0x593008(0x185)];console[_0x593008(0x171)]('Found\x20'+_0x412eaa[_0x593008(0x18f)]+'\x20execution'+(_0x412eaa[_0x593008(0x18f)]!==0x1?'s':'')+_0x593008(0x197)+_0x412eaa[_0x593008(0x15f)]+'-'+_0x412eaa['to']+')');const _0x16bd74=_0x412eaa['history'][_0x593008(0x16b)](_0x262f92=>({'job_id':_0x262f92[_0x593008(0x184)],'type':_0x262f92[_0x593008(0x19c)],'status':_0x262f92[_0x593008(0x124)],'scheduled_at':_0x262f92['scheduled_at'],'created_at':_0x262f92['created_at'],'start_at':_0x262f92[_0x593008(0x167)],'end_at':_0x262f92[_0x593008(0x19a)]}));return await handleSDKOutput(_0x16bd74,_0x4913aa),0x0;}}
1
+ const a34_0x50663e=a34_0x1c09;(function(_0x34860c,_0x75140b){const _0x1e67c6=a34_0x1c09,_0xb6aebc=_0x34860c();while(!![]){try{const _0x44a031=parseInt(_0x1e67c6(0x196))/0x1+parseInt(_0x1e67c6(0x193))/0x2+-parseInt(_0x1e67c6(0x17a))/0x3+-parseInt(_0x1e67c6(0x167))/0x4*(-parseInt(_0x1e67c6(0x186))/0x5)+parseInt(_0x1e67c6(0x143))/0x6*(parseInt(_0x1e67c6(0x11e))/0x7)+parseInt(_0x1e67c6(0x189))/0x8+-parseInt(_0x1e67c6(0x174))/0x9*(parseInt(_0x1e67c6(0x145))/0xa);if(_0x44a031===_0x75140b)break;else _0xb6aebc['push'](_0xb6aebc['shift']());}catch(_0x4500ee){_0xb6aebc['push'](_0xb6aebc['shift']());}}}(a34_0xb884,0xbf601));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_0x4502d6 from'chalk';function a34_0xb884(){const _0x13bc7d=['\x20\x20Job\x20ID:\x20','nextRun','Schedule\x20deleted:\x20','getTime','Creating\x20schedule...','2640390hTldeZ','schedule:create','retryLimit','48401NHXEoq','Found\x20','Show\x20schedule\x20details','has_next_page','Schedule\x20created:\x20','last_job','time','limit','\x20\x20β†’\x20','result','in\x20','8555932HINepX','schedule:delete','timezone','args','Database\x20is\x20required\x0aUsage:\x20job\x20schedule\x20create\x20<name>\x20-d\x20<db>\x20--file\x20<path>\x20[options]','length','m\x20ago','file','dim','d\x20ago','map','num','type','Listing\x20scheduled\x20queries...','name','No\x20scheduled\x20queries\x20found','max','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20update\x20<name>\x20[options]','Failed\x20to\x20read\x20file:\x20','executing_user_id','Query\x20file\x20is\x20empty','Getting\x20schedule\x20history...','green','format','toLocaleDateString','\x20schedules','yes','\x20scheduled\x20quer','cyan','ended_at','Delete\x20a\x20scheduled\x20query','description','site','jsonl','\x20matching\x20\x22','cron','delay','6vNhIpm','Updating\x20schedule...','5812370uSzMOg','status','Creating\x20schedule:\x20','engine_version','show','from','/app/queries/editor?queryId=','(unnamed)','validate','schedule:list','statusIcon','user_name','next_run_at','run','\x20\x20Timezone:\x20','job_id','schedules','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20delete\x20<name>','start_at','substring','execute','\x20(use\x20--limit\x20to\x20see\x20more)','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20run\x20<name>\x20[--time\x20<iso8601>]\x20[--num\x20<1-10>]','Searching\x20scheduled\x20queries\x20matching\x20\x22','utf-8','tsv','just\x20now','Getting\x20schedule\x20details...','Schedule\x20updated:\x20','database','query','listQueries','Deleting\x20schedule...','priority','1710756PjIbOO','list','options','data','created_at','entries','schedule:run','history','πŸ“…\x20','Cancelled','At\x20least\x20one\x20option\x20must\x20be\x20provided\x20to\x20update','round','soon','63tiKtEp','\x20(showing\x20','\x20\x20Num:\x20','schedule:update','count','user','153093QFGhNh','INVALID_ARGUMENT','\x20\x20Database:\x20','error','...','repeat','\x20\x20Time:\x20','Show\x20schedule\x20execution\x20history','jobs','join','trim','time_zone','10Jmlnlt','List\x20scheduled\x20queries','engineVersion','11658504LcjDQD','retry_limit','padEnd','verbose','queryUrl'];a34_0xb884=function(){return _0x13bc7d;};return a34_0xb884();}function formatRelativeTime(_0x579d13){const _0x5b81cb=a34_0x1c09,_0x3aede3=new Date(_0x579d13),_0x480305=new Date(),_0x32dc39=_0x3aede3[_0x5b81cb(0x191)]()-_0x480305[_0x5b81cb(0x191)](),_0x34e2de=Math['abs'](_0x32dc39)/0x3e8,_0x1c36f7=_0x32dc39<0x0;if(_0x34e2de<0x3c)return _0x1c36f7?_0x5b81cb(0x15f):_0x5b81cb(0x173);else{if(_0x34e2de<0xe10){const _0x411a80=Math[_0x5b81cb(0x172)](_0x34e2de/0x3c);return _0x1c36f7?_0x411a80+_0x5b81cb(0x124):_0x5b81cb(0x11d)+_0x411a80+'m';}else{if(_0x34e2de<0x15180){const _0x40a18a=Math['round'](_0x34e2de/0xe10);return _0x1c36f7?_0x40a18a+'h\x20ago':_0x5b81cb(0x11d)+_0x40a18a+'h';}else{if(_0x34e2de<0x93a80){const _0x1e2bcb=Math[_0x5b81cb(0x172)](_0x34e2de/0x15180);return _0x1c36f7?_0x1e2bcb+_0x5b81cb(0x127):'in\x20'+_0x1e2bcb+'d';}else return _0x3aede3[_0x5b81cb(0x136)]();}}}}export class ScheduleListCommand extends BaseCommand{[a34_0x50663e(0x12c)]=a34_0x50663e(0x14e);[a34_0x50663e(0x13d)]=a34_0x50663e(0x187);async[a34_0x50663e(0x159)](_0x51a308){const _0x1602c7=a34_0x50663e,{options:_0x240a20,args:_0x1a77cd,tdx:_0x28a504}=_0x51a308,_0x3009f1=resolveLimit(_0x240a20[_0x1602c7(0x11a)],DEFAULT_DISPLAY_LIMIT),_0x107317=_0x1a77cd[0x0],_0x400056=_0x107317?_0x1602c7(0x15c)+_0x107317+'\x22...':_0x1602c7(0x12b),_0x45ef05=await withSpinner(_0x400056,()=>_0x28a504['schedules'][_0x1602c7(0x164)]({'limit':_0x3009f1,'scheduled':!![],'pattern':_0x107317}),{'verbose':_0x240a20[_0x1602c7(0x18c)]}),_0x3b8eab=_0x45ef05[_0x1602c7(0x16a)]['queries'],_0x5537ee=_0x45ef05[_0x1602c7(0x16a)]['pagination'][_0x1602c7(0x116)],_0x221fe3=_0x107317?_0x1602c7(0x140)+_0x107317+'\x22':'';_0x5537ee?console[_0x1602c7(0x17d)]('Showing\x20first\x20'+_0x3b8eab[_0x1602c7(0x123)]+_0x1602c7(0x137)+_0x221fe3+_0x1602c7(0x15a)):console[_0x1602c7(0x17d)]('Found\x20'+_0x3b8eab[_0x1602c7(0x123)]+_0x1602c7(0x139)+(_0x3b8eab[_0x1602c7(0x123)]!==0x1?'ies':'y')+_0x221fe3);if(_0x240a20['format']==='json'||_0x240a20[_0x1602c7(0x135)]===_0x1602c7(0x13f)||_0x240a20[_0x1602c7(0x135)]==='table'||_0x240a20[_0x1602c7(0x135)]===_0x1602c7(0x15e)){const _0x49ea61=_0x3b8eab[_0x1602c7(0x128)](_0x21b982=>({'id':_0x21b982['id'],'name':_0x21b982[_0x1602c7(0x12c)],'cron':_0x21b982['cron'],'database':_0x21b982['database']?.['name'],'type':_0x21b982[_0x1602c7(0x12a)],'timezone':_0x21b982[_0x1602c7(0x185)],'user_name':_0x21b982[_0x1602c7(0x179)]?.[_0x1602c7(0x12c)],'updated_at':_0x21b982['updated_at'],'next_run_at':_0x21b982[_0x1602c7(0x151)],'last_job_status':_0x21b982['last_job']?.[_0x1602c7(0x146)]}));await handleSDKOutput(_0x49ea61,_0x240a20);}else{if(_0x3b8eab[_0x1602c7(0x123)]===0x0)console['log'](_0x1602c7(0x12d));else{const _0x2d4f45=_0x240a20[_0x1602c7(0x13e)],_0xba1aa0=_0x3b8eab['map'](_0x1909c9=>{const _0x108042=_0x1602c7,_0x30e82b=_0x1909c9['last_job']?.[_0x108042(0x146)]?_0x1909c9[_0x108042(0x118)][_0x108042(0x146)]==='success'?'βœ“':'βœ—':'-',_0x345c41=_0x1909c9[_0x108042(0x118)]?.[_0x108042(0x13b)]?formatRelativeTime(_0x1909c9[_0x108042(0x118)][_0x108042(0x13b)]):'never',_0x2a1c9c=_0x1909c9['next_run_at']?formatRelativeTime(_0x1909c9['next_run_at']):'-',_0xeed898=_0x1909c9[_0x108042(0x141)]||'',_0x5e3632=_0x1909c9['name']||_0x108042(0x14c),_0x3cd74e=getConsoleUrl(_0x2d4f45,_0x108042(0x14b)+_0x1909c9['id']);return{'statusIcon':_0x30e82b,'lastRun':_0x345c41,'nextRun':_0x2a1c9c,'cron':_0xeed898,'name':_0x5e3632,'queryUrl':_0x3cd74e,'status':_0x1909c9[_0x108042(0x118)]?.['status']};}),_0x1a77ee=Math['max'](..._0xba1aa0[_0x1602c7(0x128)](_0x256a4e=>_0x256a4e['lastRun']['length'])),_0x36b7fc=Math[_0x1602c7(0x12e)](..._0xba1aa0['map'](_0x8c827a=>_0x8c827a['nextRun'][_0x1602c7(0x123)])),_0x26b522=Math[_0x1602c7(0x12e)](..._0xba1aa0[_0x1602c7(0x128)](_0xbed00c=>_0xbed00c[_0x1602c7(0x141)][_0x1602c7(0x123)])),_0x404795=_0xba1aa0['map'](_0x2b5b60=>{const _0x2bcad9=_0x1602c7,_0x41e3c7=_0x2b5b60[_0x2bcad9(0x146)]==='success'?a34_0x4502d6[_0x2bcad9(0x134)](_0x2b5b60[_0x2bcad9(0x14f)]):_0x2b5b60['status']===_0x2bcad9(0x17d)?a34_0x4502d6['red'](_0x2b5b60['statusIcon']):a34_0x4502d6[_0x2bcad9(0x126)](_0x2b5b60[_0x2bcad9(0x14f)]),_0x5206b6=_0x2b5b60['lastRun'][_0x2bcad9(0x18b)](_0x1a77ee),_0xaec250=_0x2b5b60[_0x2bcad9(0x18f)][_0x2bcad9(0x18b)](_0x36b7fc),_0x4a907f=_0x2b5b60[_0x2bcad9(0x141)]?a34_0x4502d6[_0x2bcad9(0x13a)](_0x2b5b60[_0x2bcad9(0x141)][_0x2bcad9(0x18b)](_0x26b522)):'\x20'[_0x2bcad9(0x17f)](_0x26b522),_0x57111e=hyperlink(_0x2b5b60[_0x2bcad9(0x12c)],_0x2b5b60[_0x2bcad9(0x18d)]);return _0x2bcad9(0x16f)+_0x41e3c7+'\x20'+_0x5206b6+_0x2bcad9(0x11b)+_0xaec250+'\x20\x20'+_0x4a907f+'\x20\x20'+_0x57111e;});await writeOutput(_0x404795[_0x1602c7(0x183)]('\x0a'),_0x240a20['output'],_0x1602c7(0x168));}}return 0x0;}}export class ScheduleShowCommand extends BaseCommand{['name']='schedule:show';['description']=a34_0x50663e(0x198);['validate'](_0xcb631f){const _0x48a9bf=a34_0x50663e,_0x5ef0bf=_0xcb631f[_0x48a9bf(0x121)][0x0];if(!_0x5ef0bf)return'Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20show\x20<name>';return undefined;}async[a34_0x50663e(0x159)](_0x2dbb0b){const _0x39b539=a34_0x50663e,{options:_0x32ba58,args:_0x40acb1,tdx:_0x4d3b10}=_0x2dbb0b,_0x165cc4=_0x40acb1[0x0],_0x45afd8=await withSpinner(_0x39b539(0x160),()=>_0x4d3b10[_0x39b539(0x155)][_0x39b539(0x149)](_0x165cc4),{'verbose':_0x32ba58[_0x39b539(0x18c)]}),_0x2f99f8=_0x45afd8['data'],_0x436d4b={'name':_0x2f99f8[_0x39b539(0x12c)],'cron':_0x2f99f8['cron'],'database':_0x2f99f8[_0x39b539(0x162)],'type':_0x2f99f8[_0x39b539(0x12a)],'timezone':_0x2f99f8[_0x39b539(0x120)],'user_name':_0x2f99f8[_0x39b539(0x150)],'created_at':_0x2f99f8['created_at'],'engine_version':_0x2f99f8[_0x39b539(0x148)],'executing_user_id':_0x2f99f8[_0x39b539(0x131)],'query':_0x2f99f8[_0x39b539(0x163)],'delay':_0x2f99f8[_0x39b539(0x142)],'priority':_0x2f99f8[_0x39b539(0x166)],'retry_limit':_0x2f99f8['retry_limit'],..._0x2f99f8[_0x39b539(0x11c)]&&{'result':_0x2f99f8[_0x39b539(0x11c)]}};return await handleSingleObjectOutput(_0x436d4b,_0x32ba58),0x0;}}export class ScheduleCreateCommand extends BaseCommand{['name']=a34_0x50663e(0x194);[a34_0x50663e(0x13d)]='Create\x20a\x20scheduled\x20query';[a34_0x50663e(0x14d)](_0x50392b){const _0x7c5dcd=a34_0x50663e,_0x5f3578=_0x50392b[_0x7c5dcd(0x121)][0x0];if(!_0x5f3578)return'Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20create\x20<name>\x20-d\x20<db>\x20--file\x20<path>\x20[options]';const _0x35305a=_0x50392b[_0x7c5dcd(0x169)];if(!_0x35305a['database'])return _0x7c5dcd(0x122);return undefined;}async[a34_0x50663e(0x159)](_0x4a8d8e){const _0x244243=a34_0x50663e,{options:_0x5c3260,args:_0x3228c1,tdx:_0xec0e8f}=_0x4a8d8e,_0x42ef58=_0x3228c1[0x0],_0x316b95=_0x5c3260,_0x1ab431=_0x316b95[_0x244243(0x162)],_0x9bb0d9=_0x316b95[_0x244243(0x125)],_0x3ed305=_0x316b95[_0x244243(0x12a)]||'trino';let _0x1fae01;try{_0x1fae01=readFileSync(_0x9bb0d9,_0x244243(0x15d))[_0x244243(0x184)]();}catch(_0x254637){throw new SDKError(ErrorCode[_0x244243(0x17b)],'Failed\x20to\x20read\x20file:\x20'+_0x9bb0d9,_0x254637 instanceof Error?_0x254637:undefined);}if(!_0x1fae01)throw new SDKError(ErrorCode[_0x244243(0x17b)],_0x244243(0x132));const _0x588d09={'database':_0x1ab431,'query':_0x1fae01,'type':_0x3ed305};if(_0x316b95[_0x244243(0x141)])_0x588d09[_0x244243(0x141)]=_0x316b95[_0x244243(0x141)];if(_0x316b95[_0x244243(0x120)])_0x588d09['timezone']=_0x316b95[_0x244243(0x120)];if(_0x316b95[_0x244243(0x142)]!==undefined)_0x588d09[_0x244243(0x142)]=Number(_0x316b95['delay']);if(_0x316b95[_0x244243(0x166)]!==undefined)_0x588d09[_0x244243(0x166)]=Number(_0x316b95[_0x244243(0x166)]);if(_0x316b95['retryLimit']!==undefined)_0x588d09[_0x244243(0x18a)]=Number(_0x316b95['retryLimit']);if(_0x316b95['engineVersion'])_0x588d09[_0x244243(0x148)]=_0x316b95[_0x244243(0x188)];if(_0x316b95['result'])_0x588d09[_0x244243(0x11c)]=_0x316b95['result'];if(_0x5c3260[_0x244243(0x18c)]){console['error'](_0x244243(0x147)+_0x42ef58),console[_0x244243(0x17d)](_0x244243(0x17c)+_0x1ab431),console[_0x244243(0x17d)]('\x20\x20Type:\x20'+_0x3ed305);if(_0x588d09['cron'])console['error']('\x20\x20Cron:\x20'+_0x588d09[_0x244243(0x141)]);if(_0x588d09[_0x244243(0x120)])console['error'](_0x244243(0x153)+_0x588d09['timezone']);}const _0x37393b=await withSpinner(_0x244243(0x192),()=>_0xec0e8f[_0x244243(0x155)]['create'](_0x42ef58,_0x588d09),{'verbose':_0x5c3260[_0x244243(0x18c)]});return console[_0x244243(0x17d)](_0x244243(0x117)+_0x37393b[_0x244243(0x16a)][_0x244243(0x12c)]),await handleSingleObjectOutput(_0x37393b[_0x244243(0x16a)],_0x5c3260),0x0;}}export class ScheduleUpdateCommand extends BaseCommand{[a34_0x50663e(0x12c)]=a34_0x50663e(0x177);[a34_0x50663e(0x13d)]='Update\x20a\x20scheduled\x20query';[a34_0x50663e(0x14d)](_0x5ba27){const _0x5869f2=a34_0x50663e,_0x563c49=_0x5ba27[_0x5869f2(0x121)][0x0];if(!_0x563c49)return _0x5869f2(0x12f);return undefined;}async['execute'](_0x463c79){const _0xdd1840=a34_0x50663e,{options:_0x4f7942,args:_0x53acfd,tdx:_0x117c9c}=_0x463c79,_0x232376=_0x53acfd[0x0],_0x34cb34=_0x4f7942,_0x43f80a={};if(_0x34cb34[_0xdd1840(0x162)])_0x43f80a[_0xdd1840(0x162)]=_0x34cb34['database'];if(_0x34cb34[_0xdd1840(0x12a)])_0x43f80a[_0xdd1840(0x12a)]=_0x34cb34[_0xdd1840(0x12a)];if(_0x34cb34['cron'])_0x43f80a[_0xdd1840(0x141)]=_0x34cb34[_0xdd1840(0x141)];if(_0x34cb34[_0xdd1840(0x120)])_0x43f80a[_0xdd1840(0x120)]=_0x34cb34[_0xdd1840(0x120)];if(_0x34cb34[_0xdd1840(0x142)]!==undefined)_0x43f80a[_0xdd1840(0x142)]=Number(_0x34cb34['delay']);if(_0x34cb34[_0xdd1840(0x166)]!==undefined)_0x43f80a[_0xdd1840(0x166)]=Number(_0x34cb34[_0xdd1840(0x166)]);if(_0x34cb34[_0xdd1840(0x195)]!==undefined)_0x43f80a[_0xdd1840(0x18a)]=Number(_0x34cb34['retryLimit']);if(_0x34cb34[_0xdd1840(0x188)])_0x43f80a['engine_version']=_0x34cb34[_0xdd1840(0x188)];if(_0x34cb34[_0xdd1840(0x11c)])_0x43f80a['result']=_0x34cb34[_0xdd1840(0x11c)];if(_0x34cb34['file'])try{_0x43f80a[_0xdd1840(0x163)]=readFileSync(_0x34cb34[_0xdd1840(0x125)],_0xdd1840(0x15d))['trim']();}catch(_0x55629d){throw new SDKError(ErrorCode[_0xdd1840(0x17b)],_0xdd1840(0x130)+_0x34cb34[_0xdd1840(0x125)],_0x55629d instanceof Error?_0x55629d:undefined);}if(Object['keys'](_0x43f80a)['length']===0x0)throw new SDKError(ErrorCode[_0xdd1840(0x17b)],_0xdd1840(0x171));if(_0x4f7942[_0xdd1840(0x18c)]){console['error']('Updating\x20schedule:\x20'+_0x232376);for(const [_0x37008b,_0x391dd7]of Object[_0xdd1840(0x16c)](_0x43f80a)){_0x37008b===_0xdd1840(0x163)?console[_0xdd1840(0x17d)]('\x20\x20'+_0x37008b+':\x20'+_0x391dd7[_0xdd1840(0x158)](0x0,0x32)+_0xdd1840(0x17e)):console[_0xdd1840(0x17d)]('\x20\x20'+_0x37008b+':\x20'+_0x391dd7);}}const _0x5138f3=await withSpinner(_0xdd1840(0x144),()=>_0x117c9c['schedules']['update'](_0x232376,_0x43f80a),{'verbose':_0x4f7942[_0xdd1840(0x18c)]});return console[_0xdd1840(0x17d)](_0xdd1840(0x161)+_0x5138f3[_0xdd1840(0x16a)]['name']),await handleSingleObjectOutput(_0x5138f3[_0xdd1840(0x16a)],_0x4f7942),0x0;}}function a34_0x1c09(_0x4b68b7,_0x5c988f){_0x4b68b7=_0x4b68b7-0x116;const _0xb88430=a34_0xb884();let _0x1c0918=_0xb88430[_0x4b68b7];return _0x1c0918;}export class ScheduleDeleteCommand extends BaseCommand{[a34_0x50663e(0x12c)]=a34_0x50663e(0x11f);[a34_0x50663e(0x13d)]=a34_0x50663e(0x13c);[a34_0x50663e(0x14d)](_0xc2acdf){const _0x289b8f=a34_0x50663e,_0x250d9f=_0xc2acdf['args'][0x0];if(!_0x250d9f)return _0x289b8f(0x156);return undefined;}async['execute'](_0x42a1b0){const _0x1a5d7f=a34_0x50663e,{options:_0x83d510,args:_0x2ab1a0,tdx:_0x53ff9a}=_0x42a1b0,_0x134705=_0x2ab1a0[0x0];if(!_0x83d510[_0x1a5d7f(0x138)]){const _0x1c2186=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20schedule\x20\x22'+_0x134705+'\x22?');if(!_0x1c2186)return console[_0x1a5d7f(0x17d)](_0x1a5d7f(0x170)),0x0;}const _0x435da3=await withSpinner(_0x1a5d7f(0x165),()=>_0x53ff9a[_0x1a5d7f(0x155)]['delete'](_0x134705),{'verbose':_0x83d510['verbose']});return console[_0x1a5d7f(0x17d)](_0x1a5d7f(0x190)+_0x435da3[_0x1a5d7f(0x16a)][_0x1a5d7f(0x12c)]),0x0;}}export class ScheduleRunCommand extends BaseCommand{[a34_0x50663e(0x12c)]=a34_0x50663e(0x16d);[a34_0x50663e(0x13d)]='Run\x20a\x20scheduled\x20query\x20immediately';[a34_0x50663e(0x14d)](_0x4cddc0){const _0x255d18=a34_0x50663e,_0x209946=_0x4cddc0[_0x255d18(0x121)][0x0];if(!_0x209946)return _0x255d18(0x15b);return undefined;}async[a34_0x50663e(0x159)](_0x1029ca){const _0x76a361=a34_0x50663e,{options:_0x46e018,args:_0x4a4150,tdx:_0xa3e6f7}=_0x1029ca,_0x35bd64=_0x4a4150[0x0],_0x10e873=_0x46e018,_0x78d0da=_0x10e873[_0x76a361(0x119)],_0x3e16a9=_0x10e873['num']!==undefined?Number(_0x10e873[_0x76a361(0x129)]):undefined;if(_0x46e018[_0x76a361(0x18c)]){console[_0x76a361(0x17d)]('Running\x20schedule:\x20'+_0x35bd64);if(_0x78d0da)console[_0x76a361(0x17d)](_0x76a361(0x180)+_0x78d0da);if(_0x3e16a9)console[_0x76a361(0x17d)](_0x76a361(0x176)+_0x3e16a9);}const _0x5e7fc5=await withSpinner('Running\x20schedule...',()=>_0xa3e6f7[_0x76a361(0x155)][_0x76a361(0x152)](_0x35bd64,{'time':_0x78d0da,'num':_0x3e16a9}),{'verbose':_0x46e018[_0x76a361(0x18c)]}),_0x28d9e5=_0x5e7fc5[_0x76a361(0x16a)][_0x76a361(0x182)];console[_0x76a361(0x17d)]('Schedule\x20run\x20submitted:\x20'+_0x28d9e5[_0x76a361(0x123)]+'\x20job'+(_0x28d9e5[_0x76a361(0x123)]!==0x1?'s':'')+'\x20created');for(const _0x2dd5a1 of _0x28d9e5){console[_0x76a361(0x17d)](_0x76a361(0x18e)+_0x2dd5a1[_0x76a361(0x154)]);}return await handleSDKOutput(_0x28d9e5,_0x46e018),0x0;}}export class ScheduleHistoryCommand extends BaseCommand{[a34_0x50663e(0x12c)]='schedule:history';['description']=a34_0x50663e(0x181);[a34_0x50663e(0x14d)](_0x812aa9){const _0x23f946=_0x812aa9['args'][0x0];if(!_0x23f946)return'Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20history\x20<name>\x20[--from\x20<n>]\x20[--to\x20<n>]';return undefined;}async[a34_0x50663e(0x159)](_0x21d391){const _0x2eb6fd=a34_0x50663e,{options:_0x473a66,args:_0x7dbad6,tdx:_0x3ac36c}=_0x21d391,_0x2201df=_0x7dbad6[0x0],_0x5eadb7=_0x473a66,_0x120aa2=_0x5eadb7[_0x2eb6fd(0x14a)]!==undefined?Number(_0x5eadb7['from']):undefined,_0x17389d=_0x5eadb7['to']!==undefined?Number(_0x5eadb7['to']):undefined,_0x37533b=await withSpinner(_0x2eb6fd(0x133),()=>_0x3ac36c['schedules'][_0x2eb6fd(0x16e)](_0x2201df,{'from':_0x120aa2,'to':_0x17389d}),{'verbose':_0x473a66[_0x2eb6fd(0x18c)]}),_0x2f6487=_0x37533b[_0x2eb6fd(0x16a)];console[_0x2eb6fd(0x17d)](_0x2eb6fd(0x197)+_0x2f6487[_0x2eb6fd(0x178)]+'\x20execution'+(_0x2f6487[_0x2eb6fd(0x178)]!==0x1?'s':'')+_0x2eb6fd(0x175)+_0x2f6487['from']+'-'+_0x2f6487['to']+')');const _0x6e4dc3=_0x2f6487['history'][_0x2eb6fd(0x128)](_0x41c345=>({'job_id':_0x41c345[_0x2eb6fd(0x154)],'type':_0x41c345[_0x2eb6fd(0x12a)],'status':_0x41c345[_0x2eb6fd(0x146)],'scheduled_at':_0x41c345['scheduled_at'],'created_at':_0x41c345[_0x2eb6fd(0x16b)],'start_at':_0x41c345[_0x2eb6fd(0x157)],'end_at':_0x41c345['end_at']}));return await handleSDKOutput(_0x6e4dc3,_0x473a66),0x0;}}
@@ -1 +1 @@
1
- const a35_0x2f6a02=a35_0x45c6;(function(_0x17695e,_0x5aea9c){const _0x1501f9=a35_0x45c6,_0x5261cd=_0x17695e();while(!![]){try{const _0x31f993=parseInt(_0x1501f9(0x15b))/0x1+-parseInt(_0x1501f9(0x179))/0x2+parseInt(_0x1501f9(0x149))/0x3+parseInt(_0x1501f9(0x1d1))/0x4*(-parseInt(_0x1501f9(0x167))/0x5)+parseInt(_0x1501f9(0x156))/0x6+-parseInt(_0x1501f9(0x1d4))/0x7+parseInt(_0x1501f9(0x16c))/0x8;if(_0x31f993===_0x5aea9c)break;else _0x5261cd['push'](_0x5261cd['shift']());}catch(_0x17fcd1){_0x5261cd['push'](_0x5261cd['shift']());}}}(a35_0x2046,0x78bfa));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner,formatElapsed}from'../utils/spinner.js';import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{executeSchemaQuery}from'../sdk/segment/fields-display.js';import{isYamlFilePath,resolveYamlFilePath}from'../sdk/segment/segment-path-parser.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{openBrowser}from'../utils/process.js';import a35_0x10ce32 from'chalk';async function resolveSegmentTarget(_0x3eea24,_0x350a51,_0x47ffda){const _0x2c026c=a35_0x45c6;if(isYamlFilePath(_0x3eea24))try{const _0x4eb535=await resolveYamlFilePath(_0x3eea24);return _0x47ffda&&(console[_0x2c026c(0x1c9)](_0x2c026c(0x1c4)+_0x3eea24),console[_0x2c026c(0x1c9)]('\x20\x20Parent\x20segment:\x20'+_0x4eb535['parentSegment']),console[_0x2c026c(0x1c9)](_0x2c026c(0x1bc)+_0x4eb535[_0x2c026c(0x150)]),console['error'](_0x2c026c(0x192)+(_0x4eb535[_0x2c026c(0x178)]||'(root)')),console[_0x2c026c(0x1c9)]('\x20\x20Full\x20path:\x20'+_0x4eb535[_0x2c026c(0x19f)])),_0x4eb535[_0x2c026c(0x19f)];}catch(_0x44e665){throw new SDKError(ErrorCode[_0x2c026c(0x17f)],_0x2c026c(0x1cb)+_0x44e665[_0x2c026c(0x171)]);}if(!_0x350a51)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],'No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22');return _0x350a51+'/'+_0x3eea24;}export class SegmentDescribeCommand extends BaseCommand{[a35_0x2f6a02(0x1bb)]=a35_0x2f6a02(0x145);[a35_0x2f6a02(0x1a0)]='Show\x20segment\x20or\x20folder\x20details';async[a35_0x2f6a02(0x155)](_0x4cd340){const _0x34abc4=a35_0x2f6a02,{options:_0x2a8b14,args:_0xe72236,tdx:_0x4bf29d}=_0x4cd340,_0xa30dff=_0xe72236[0x0],_0x511f26=!_0xa30dff&&!!_0x2a8b14[_0x34abc4(0x1c6)],_0x314ee2=_0xa30dff||_0x2a8b14[_0x34abc4(0x1c6)];if(!_0x314ee2)return console[_0x34abc4(0x1c9)](_0x34abc4(0x16b)),console[_0x34abc4(0x1c9)](_0x34abc4(0x1ad)),console[_0x34abc4(0x1c9)]('Examples:'),console[_0x34abc4(0x1c9)]('\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22'),console[_0x34abc4(0x1c9)]('\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22'),console[_0x34abc4(0x1c9)](_0x34abc4(0x15d)),console[_0x34abc4(0x1c9)](_0x34abc4(0x18c)),0x1;try{const _0x1e8234=_0x2a8b14[_0x34abc4(0x14d)];let _0x321bbd=_0x314ee2;!_0x511f26&&_0x1e8234&&!_0x314ee2[_0x34abc4(0x161)]('/')&&(_0x321bbd=_0x1e8234+'/'+_0x314ee2,_0x2a8b14[_0x34abc4(0x1c8)]&&console[_0x34abc4(0x1c9)]('Resolved\x20relative\x20path\x20to:\x20'+_0x321bbd));const _0x9cf25b=await withSpinner(_0x34abc4(0x14a)+_0x321bbd+'\x27...',()=>_0x4bf29d['segment'][_0x34abc4(0x1b6)](_0x321bbd),{'verbose':_0x2a8b14[_0x34abc4(0x1c8)]}),_0x111d20=_0x9cf25b['data'];_0x2a8b14[_0x34abc4(0x1c8)]&&(console[_0x34abc4(0x1c9)](_0x34abc4(0x18a)+_0x111d20[_0x34abc4(0x19a)]),console[_0x34abc4(0x1c9)](_0x34abc4(0x196)+_0x111d20['parentId']),_0x111d20[_0x34abc4(0x16e)]&&console['error'](_0x34abc4(0x173)+_0x111d20[_0x34abc4(0x16e)]),_0x111d20['segmentId']&&console['error']('Segment\x20ID:\x20'+_0x111d20[_0x34abc4(0x19d)]));if(_0x111d20['type']==='parent'){const _0xd2feef=await withSpinner(_0x34abc4(0x19e),()=>_0x4bf29d[_0x34abc4(0x158)]['getParent'](_0x111d20[_0x34abc4(0x18d)]),{'verbose':_0x2a8b14['verbose']});await handleSingleObjectOutput(_0xd2feef[_0x34abc4(0x1be)],_0x2a8b14);}else{if(_0x111d20[_0x34abc4(0x19a)]==='folder'){if(!_0x111d20[_0x34abc4(0x16e)])throw new SDKError(ErrorCode[_0x34abc4(0x187)],_0x34abc4(0x159));const _0x24b348=await withSpinner('Fetching\x20folder\x20details...',()=>_0x4bf29d[_0x34abc4(0x158)][_0x34abc4(0x151)](_0x111d20[_0x34abc4(0x16e)]),{'verbose':_0x2a8b14[_0x34abc4(0x1c8)]});await handleSingleObjectOutput(_0x24b348[_0x34abc4(0x1be)],_0x2a8b14);}else{if(_0x111d20[_0x34abc4(0x19a)]===_0x34abc4(0x158)){if(!_0x111d20[_0x34abc4(0x19d)])throw new SDKError(ErrorCode[_0x34abc4(0x188)],_0x34abc4(0x1b8));const _0xd0b109=await withSpinner(_0x34abc4(0x1ba),()=>_0x4bf29d[_0x34abc4(0x158)][_0x34abc4(0x1b4)](_0x111d20['parentId'],_0x111d20['segmentId']),{'verbose':_0x2a8b14['verbose']});await handleSingleObjectOutput(_0xd0b109[_0x34abc4(0x1be)],_0x2a8b14);}}}return 0x0;}catch(_0x2643c4){if(_0x2643c4 instanceof SDKError)return console['error'](_0x34abc4(0x18b)+_0x2643c4[_0x34abc4(0x171)]),_0x2643c4[_0x34abc4(0x19c)]&&console[_0x34abc4(0x1c9)]('\x20\x20Cause:\x20'+_0x2643c4[_0x34abc4(0x19c)]),0x1;throw _0x2643c4;}}}function a35_0x45c6(_0x6a9f68,_0x1b0d83){_0x6a9f68=_0x6a9f68-0x145;const _0x2046b0=a35_0x2046();let _0x45c6a9=_0x2046b0[_0x6a9f68];return _0x45c6a9;}export class SegmentShowCommand extends BaseCommand{[a35_0x2f6a02(0x1bb)]='segment:show';[a35_0x2f6a02(0x1a0)]=a35_0x2f6a02(0x1ce);async['execute'](_0x592b29){const _0x3e314d=a35_0x2f6a02,{options:_0x2d8ece,args:_0x2173e6,tdx:_0xceb6fc}=_0x592b29,_0x1e4e49=_0x2173e6[0x0];if(!_0x1e4e49)return console[_0x3e314d(0x1c9)](_0x3e314d(0x1ac)),console[_0x3e314d(0x1c9)]('Usage:\x20tdx\x20sg\x20show\x20<name>'),console[_0x3e314d(0x1c9)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20show\x20<path/to/segment.yml>'),console[_0x3e314d(0x1c9)](_0x3e314d(0x15c)),console[_0x3e314d(0x1c9)](_0x3e314d(0x1a6)),console[_0x3e314d(0x1c9)](_0x3e314d(0x1cc)),0x1;try{const _0x3d9fa0=_0x2d8ece[_0x3e314d(0x1c6)],_0x2721c9=await resolveSegmentTarget(_0x1e4e49,_0x3d9fa0,_0x2d8ece['verbose']);_0x2d8ece[_0x3e314d(0x1c8)]&&console['error'](_0x3e314d(0x146)+_0x2721c9);const _0x5b0f32=await withSpinner(_0x3e314d(0x1b9)+_0x1e4e49+'\x27...',()=>_0xceb6fc[_0x3e314d(0x158)][_0x3e314d(0x1b6)](_0x2721c9),{'verbose':_0x2d8ece['verbose']}),_0x32c5e1=_0x5b0f32[_0x3e314d(0x1be)];_0x2d8ece[_0x3e314d(0x1c8)]&&(console[_0x3e314d(0x1c9)](_0x3e314d(0x18a)+_0x32c5e1['type']),console[_0x3e314d(0x1c9)](_0x3e314d(0x196)+_0x32c5e1[_0x3e314d(0x18d)]));if(_0x32c5e1[_0x3e314d(0x19a)]===_0x3e314d(0x191))return console['error']('Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.'),console[_0x3e314d(0x1c9)](_0x3e314d(0x174)),0x1;if(_0x32c5e1[_0x3e314d(0x19a)]===_0x3e314d(0x169))return console[_0x3e314d(0x1c9)]('Error:\x20Cannot\x20execute\x20query\x20for\x20parent\x20segment\x20with\x20this\x20command.'),console[_0x3e314d(0x1c9)](_0x3e314d(0x1a7)),0x1;if(!_0x32c5e1['segmentId'])throw new SDKError(ErrorCode[_0x3e314d(0x188)],_0x3e314d(0x1b8));const _0x57d816=await withSpinner(_0x3e314d(0x198),()=>_0xceb6fc[_0x3e314d(0x158)]['getSegmentSQL'](_0x32c5e1[_0x3e314d(0x18d)],_0x32c5e1[_0x3e314d(0x19d)]),{'verbose':_0x2d8ece[_0x3e314d(0x1c8)]});let _0x1de571=_0x57d816[_0x3e314d(0x1be)];const _0x800972=resolveLimit(_0x2d8ece['limit'],DEFAULT_DISPLAY_LIMIT),_0x38ed8d=/\bLIMIT\s+\d+/i['test'](_0x1de571);!_0x38ed8d&&(_0x1de571=_0x1de571[_0x3e314d(0x18e)]()[_0x3e314d(0x157)](/;+$/,''),_0x1de571=_0x3e314d(0x175)+_0x1de571+'\x0a)\x20AS\x20segment_query\x0aLIMIT\x20'+_0x800972);_0x2d8ece[_0x3e314d(0x1c8)]&&console['error'](_0x3e314d(0x1af)+_0x1de571);const _0x48c65e=await withProgressSpinner('Executing\x20segment\x20query...',async _0x518956=>{const _0xfde832=_0x3e314d,_0x27da0b=await _0xceb6fc[_0xfde832(0x1d6)][_0xfde832(0x155)](_0x1de571,{'catalog':'td','schema':_0xfde832(0x14b),'onJobId':_0x48c10c=>{const _0x307603=_0xfde832;_0x518956[_0x307603(0x17d)](_0x48c10c);}});return _0x27da0b;},{'verbose':_0x2d8ece[_0x3e314d(0x1c8)]}),_0x25cb05=_0x48c65e[_0x3e314d(0x1be)],_0x2c072e=_0x25cb05[_0x3e314d(0x1a3)]?_0x3e314d(0x1b0)+_0x25cb05[_0x3e314d(0x1a3)]+']':'';return console['error']('βœ”\x20Query\x20completed:\x20Processed\x20'+_0x25cb05[_0x3e314d(0x195)][_0x3e314d(0x1c5)]['toLocaleString']()+'\x20rows\x20'+('in\x20'+formatElapsed(_0x25cb05['stats'][_0x3e314d(0x1c2)])+_0x2c072e)),await handleQueryOutput(_0x25cb05,_0x2d8ece),0x0;}catch(_0x22c877){if(_0x22c877 instanceof SDKError)return console['error']('βœ–\x20Query\x20failed\x20['+_0x22c877[_0x3e314d(0x17c)]+']'),console['error']('\x0a'+_0x22c877[_0x3e314d(0x171)]),0x1;throw _0x22c877;}}}export class SegmentFolderListCommand extends BaseCommand{[a35_0x2f6a02(0x1bb)]=a35_0x2f6a02(0x14c);[a35_0x2f6a02(0x1a0)]=a35_0x2f6a02(0x172);async['execute'](_0x4ba497){const _0x1a16a2=a35_0x2f6a02,{options:_0x1ab39e,args:_0x3bb269,tdx:_0x66d1c0}=_0x4ba497;if(_0x3bb269['length']===0x0)return console[_0x1a16a2(0x1c9)]('Error:\x20Parent\x20segment\x20name\x20is\x20required'),console[_0x1a16a2(0x1c9)](_0x1a16a2(0x180)),0x1;const _0x565a49=_0x3bb269[0x0];try{_0x1ab39e[_0x1a16a2(0x1c8)]&&(console[_0x1a16a2(0x1c9)](_0x1a16a2(0x153)+_0x1ab39e['site']),console[_0x1a16a2(0x1c9)]('Parent\x20name:\x20'+_0x565a49));const _0x4f1618=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x565a49+_0x1a16a2(0x183),()=>_0x66d1c0[_0x1a16a2(0x158)]['resolveParentId'](_0x565a49),{'verbose':_0x1ab39e[_0x1a16a2(0x1c8)]}),_0x2199ec=_0x4f1618['data'];_0x1ab39e[_0x1a16a2(0x1c8)]&&console['error'](_0x1a16a2(0x17a)+_0x2199ec);const _0x23200b=await withSpinner(_0x1a16a2(0x181)+_0x565a49+_0x1a16a2(0x183),()=>_0x66d1c0[_0x1a16a2(0x158)][_0x1a16a2(0x1cd)](_0x2199ec),{'verbose':_0x1ab39e[_0x1a16a2(0x1c8)]}),_0x2b3c7e=_0x23200b[_0x1a16a2(0x1be)];return console[_0x1a16a2(0x1c9)]('βœ”\x20Found\x20'+_0x2b3c7e[_0x1a16a2(0x170)]+_0x1a16a2(0x1b1)+(_0x2b3c7e[_0x1a16a2(0x170)]!==0x1?'s':'')),await handleSDKOutput(_0x2b3c7e,_0x1ab39e),0x0;}catch(_0x13b366){if(_0x13b366 instanceof SDKError)return console[_0x1a16a2(0x1c9)]('Error:\x20'+_0x13b366[_0x1a16a2(0x171)]),_0x13b366['cause']&&console[_0x1a16a2(0x1c9)]('\x20\x20Cause:\x20'+_0x13b366[_0x1a16a2(0x19c)]),0x1;throw _0x13b366;}}}function a35_0x2046(){const _0x2222a1=['List\x20segment\x20folders\x20under\x20a\x20parent\x20segment','Folder\x20ID:\x20','Use:\x20tdx\x20sg\x20view\x20<name>\x20\x20#\x20To\x20show\x20folder\x20details','SELECT\x20*\x20FROM\x20(\x0a','\x27\x20with\x20ID:\x20','Segment\x20ID:\x20','folderPath','1388562VFwrSS','Resolved\x20parent\x20ID:\x20','Resolved\x20parent\x20folder\x20ID:\x20','code','setJobId','Show\x20segment\x20folder\x20details','INVALID_ARGUMENT','Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>','Listing\x20folders\x20for\x20parent\x20\x27','/e/','\x27...','log','βœ”\x20Created\x20folder\x20\x27','getSQLFromServerSegment','SEGMENT_FOLDER_NOT_FOUND','SEGMENT_NOT_FOUND','url','Resolved\x20type:\x20','Error:\x20','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','parentId','trim','Fetching\x20SQL\x20from\x20rule...','segment:folder:show','folder','\x20\x20Folder\x20path:\x20','/app/ps/','Parent\x20segment:\x20','stats','Parent\x20ID:\x20','resolveFolderId','Fetching\x20SQL\x20for\x20segment...','Usage:\x20tdx\x20sg\x20desc\x20<name>','type','Error:\x20Segment\x20name\x20or\x20--path\x20is\x20required','cause','segmentId','Fetching\x20parent\x20segment\x20details...','fullPath','description','Error:\x20Cannot\x20view\x20parent\x20segment\x20details\x20with\x20this\x20command.','\x20\x20-w,\x20--web\x20\x20Open\x20segment\x20in\x20web\x20browser','jobId','content','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20view\x20<path/to/segment.yml>','\x20\x20tdx\x20sg\x20show\x20\x22Premium\x20Users\x22','Use:\x20tdx\x20ps\x20show','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required','Options:','\x20\x20tdx\x20sg\x20view\x20segments/my-audience/premium-users.yml','Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required','Usage:\x20tdx\x20segment\x20describe\x20<path>','site','SQL\x20query:\x0a','\x20[Job\x20ID:\x20','\x20folder','\x20\x20Local\x20YAML\x20file:\x20\x20\x20\x20\x20\x20tdx\x20sg\x20sql\x20--path\x20<file-path>','\x20\x20Cause:\x20','getSegment','segment:sql','resolvePathToResource','parentFolder','Segment\x20ID\x20missing\x20from\x20resolved\x20path','Resolving\x20\x27','Fetching\x20segment\x20details...','name','\x20\x20Segment\x20name:\x20','\x20\x20tdx\x20sg\x20sql\x20--path\x20segments/my-audience/premium-users.yml','data','getSQLFromYamlFile','segment:folder:create','segment:desc','elapsedTimeMillis','Resolving\x20parent\x20segment\x20\x27','Resolved\x20YAML\x20file:\x20','processedRows','parentSegment','\x20\x20tdx\x20sg\x20sql\x20--path\x20','verbose','error','cyan','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','\x20\x20tdx\x20sg\x20show\x20segments/my-audience/premium-users.yml','listFolders','Execute\x20child\x20segment\x20SQL\x20query\x20and\x20show\x20results','Resolving\x20parent\x20folder\x20\x27','web','256DjKrrO','Show\x20child\x20segment\x20schema\x20(column\x20types)','Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)','3693088FSXAjI','path','query','segment:describe','Target\x20path:\x20','Folder\x20name:\x20','\x20Opening\x20','1587408CTPMnq','Resolving\x20path\x20\x27','information_schema','segment:folder:list','segmentPath','getSegmentSQL','createFolder','segmentName','getFolder','\x20\x20tdx\x20sg\x20desc\x20segments/my-audience/premium-users.yml','Site:\x20','getSegmentSQLFromYaml','execute','423918lGYArp','replace','segment','Folder\x20ID\x20missing\x20from\x20resolved\x20path','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20desc\x20<path/to/segment.yml>','866562rJHufm','Examples:','\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','green','Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>','Error:\x20Cannot\x20open\x20folder\x20in\x20web\x20browser.\x20Use\x20a\x20segment\x20name\x20instead.','includes','Error:\x20YAML\x20file\x20paths\x20must\x20be\x20specified\x20with\x20--path\x20option','red','resolveParentId','Usage:\x20tdx\x20sg\x20view\x20<name>\x20[-w]','Create\x20segment\x20folder\x20for\x20organization','4820Zwndex','Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]','parent','format','Error:\x20Path\x20or\x20name\x20is\x20required','2494368iMdoia','Use:\x20tdx\x20ps\x20view','folderId','Error:\x20Folder\x20or\x20segment\x20name,\x20or\x20YAML\x20file\x20path\x20is\x20required','length','message'];a35_0x2046=function(){return _0x2222a1;};return a35_0x2046();}export class SegmentFolderShowCommand extends BaseCommand{[a35_0x2f6a02(0x1bb)]=a35_0x2f6a02(0x190);[a35_0x2f6a02(0x1a0)]=a35_0x2f6a02(0x17e);async[a35_0x2f6a02(0x155)](_0x595cd1){const _0x52a1fa=a35_0x2f6a02,{options:_0x5e363f,args:_0x59af0d,tdx:_0x277965}=_0x595cd1;if(_0x59af0d['length']===0x0)return console[_0x52a1fa(0x1c9)]('Error:\x20Folder\x20reference\x20is\x20required'),console['error'](_0x52a1fa(0x15f)),0x1;try{const {parentId:_0x5e2b1c,childId:_0x365f76}=parseSegmentRef(_0x59af0d[0x0]);_0x5e363f[_0x52a1fa(0x1c8)]&&(console[_0x52a1fa(0x1c9)](_0x52a1fa(0x153)+_0x5e363f[_0x52a1fa(0x1ae)]),console[_0x52a1fa(0x1c9)]('Parent\x20name:\x20'+_0x5e2b1c),_0x365f76&&console[_0x52a1fa(0x1c9)]('Folder\x20name:\x20'+_0x365f76));if(!_0x365f76)return console[_0x52a1fa(0x1c9)](_0x52a1fa(0x1d3)),0x1;const _0x1943f1=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x5e2b1c+_0x52a1fa(0x183),()=>_0x277965[_0x52a1fa(0x158)]['resolveParentId'](_0x5e2b1c),{'verbose':_0x5e363f[_0x52a1fa(0x1c8)]}),_0x85a500=_0x1943f1[_0x52a1fa(0x1be)];_0x5e363f[_0x52a1fa(0x1c8)]&&console[_0x52a1fa(0x1c9)](_0x52a1fa(0x17a)+_0x85a500);const _0x26b656=await withSpinner('Resolving\x20folder\x20\x27'+_0x365f76+'\x27...',()=>_0x277965[_0x52a1fa(0x158)][_0x52a1fa(0x197)](_0x85a500,_0x365f76),{'verbose':_0x5e363f[_0x52a1fa(0x1c8)]}),_0x2ba5b4=_0x26b656[_0x52a1fa(0x1be)];_0x5e363f['verbose']&&console[_0x52a1fa(0x1c9)]('Resolved\x20folder\x20ID:\x20'+_0x2ba5b4);const _0x122ab6=await withSpinner('Fetching\x20folder\x20\x27'+_0x365f76+_0x52a1fa(0x183),()=>_0x277965[_0x52a1fa(0x158)][_0x52a1fa(0x151)](_0x2ba5b4),{'verbose':_0x5e363f['verbose']});return await handleSDKOutput([_0x122ab6[_0x52a1fa(0x1be)]],_0x5e363f),0x0;}catch(_0x299e83){if(_0x299e83 instanceof SDKError)return console[_0x52a1fa(0x1c9)](_0x52a1fa(0x18b)+_0x299e83[_0x52a1fa(0x171)]),_0x299e83['cause']&&console[_0x52a1fa(0x1c9)](_0x52a1fa(0x1b3)+_0x299e83[_0x52a1fa(0x19c)]),0x1;throw _0x299e83;}}}export class SegmentSQLCommand extends BaseCommand{['name']=a35_0x2f6a02(0x1b5);['description']='Get\x20SQL\x20query\x20for\x20child\x20segment';async['execute'](_0x7d5f0){const _0x38077e=a35_0x2f6a02,{options:_0x525512,args:_0x1554b5}=_0x7d5f0,_0x2e80f3=_0x525512,_0x3047b2=_0x2e80f3[_0x38077e(0x1d5)],_0x3c2a39=_0x1554b5[0x0];if(!_0x3c2a39&&!_0x3047b2)return console[_0x38077e(0x1c9)](a35_0x10ce32[_0x38077e(0x163)](_0x38077e(0x19b))),console[_0x38077e(0x1c9)]('Usage:'),console[_0x38077e(0x1c9)]('\x20\x20Server-side\x20segment:\x20\x20tdx\x20sg\x20sql\x20<name>'),console[_0x38077e(0x1c9)](_0x38077e(0x1b2)),console['error'](_0x38077e(0x15c)),console[_0x38077e(0x1c9)]('\x20\x20tdx\x20sg\x20sql\x20\x22Premium\x20Users\x22'),console[_0x38077e(0x1c9)](_0x38077e(0x1bd)),0x1;if(_0x3c2a39&&_0x3047b2)return console[_0x38077e(0x1c9)](a35_0x10ce32[_0x38077e(0x163)]('Error:\x20Specify\x20either\x20segment\x20name\x20or\x20--path,\x20not\x20both')),0x1;try{let _0x6242e0;if(_0x3047b2)_0x6242e0=await this[_0x38077e(0x1bf)](_0x3047b2,_0x7d5f0);else{if(isYamlFilePath(_0x3c2a39))return console[_0x38077e(0x1c9)](a35_0x10ce32[_0x38077e(0x163)](_0x38077e(0x162))),console[_0x38077e(0x1c9)](_0x38077e(0x1c7)+_0x3c2a39),0x1;else _0x6242e0=await this['getSQLFromServerSegment'](_0x3c2a39,_0x7d5f0);}return _0x525512['format']==='json'||_0x525512[_0x38077e(0x16a)]==='jsonl'?await handleSDKOutput([{'sql':_0x6242e0}],_0x525512):console[_0x38077e(0x184)](_0x6242e0),0x0;}catch(_0x2903da){if(_0x2903da instanceof SDKError)return console['error'](_0x38077e(0x18b)+_0x2903da[_0x38077e(0x171)]),_0x2903da[_0x38077e(0x19c)]&&console['error'](_0x38077e(0x1b3)+_0x2903da['cause']),0x1;throw _0x2903da;}}async['getSQLFromYamlFile'](_0x198844,_0x5c3141){const _0x53ba69=a35_0x2f6a02,{options:_0x4ab629,tdx:_0x4f5696}=_0x5c3141;let _0x526f47;try{_0x526f47=await resolveYamlFilePath(_0x198844);}catch(_0x5d1ab8){throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x53ba69(0x1cb)+_0x5d1ab8[_0x53ba69(0x171)]);}_0x4ab629[_0x53ba69(0x1c8)]&&console[_0x53ba69(0x1c9)]('Resolved:\x20'+_0x526f47['parentSegment']+'/'+_0x526f47['segmentName']);const _0x5d5555=await withSpinner(_0x53ba69(0x18f),()=>_0x4f5696[_0x53ba69(0x158)][_0x53ba69(0x154)](_0x526f47[_0x53ba69(0x1a4)],_0x526f47['parentSegment'],_0x526f47[_0x53ba69(0x150)]),{'verbose':_0x4ab629[_0x53ba69(0x1c8)]});return _0x5d5555[_0x53ba69(0x1be)];}async[a35_0x2f6a02(0x186)](_0xafddba,_0x5193d7){const _0x51e393=a35_0x2f6a02,{options:_0x149ee0,tdx:_0x333010}=_0x5193d7,_0x1d606c=_0x149ee0[_0x51e393(0x1c6)],_0x4415ac=await resolveSegmentTarget(_0xafddba,_0x1d606c,_0x149ee0[_0x51e393(0x1c8)]);_0x149ee0['verbose']&&console[_0x51e393(0x1c9)](_0x51e393(0x146)+_0x4415ac);const _0x54e350=await withSpinner(_0x51e393(0x1b9)+_0xafddba+'\x27...',()=>_0x333010[_0x51e393(0x158)]['resolvePathToResource'](_0x4415ac),{'verbose':_0x149ee0[_0x51e393(0x1c8)]}),_0x45ae5a=_0x54e350[_0x51e393(0x1be)];_0x149ee0[_0x51e393(0x1c8)]&&(console[_0x51e393(0x1c9)]('Resolved\x20type:\x20'+_0x45ae5a[_0x51e393(0x19a)]),console[_0x51e393(0x1c9)](_0x51e393(0x196)+_0x45ae5a['parentId']));if(_0x45ae5a[_0x51e393(0x19a)]===_0x51e393(0x191))throw new SDKError(ErrorCode[_0x51e393(0x17f)],'Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.\x20Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.');if(_0x45ae5a['type']===_0x51e393(0x169))throw new SDKError(ErrorCode[_0x51e393(0x17f)],'Cannot\x20get\x20SQL\x20for\x20parent\x20segment\x20with\x20this\x20command.\x20Use:\x20tdx\x20ps\x20sql');if(!_0x45ae5a[_0x51e393(0x19d)])throw new SDKError(ErrorCode[_0x51e393(0x188)],_0x51e393(0x1b8));const _0x28c83b=await withSpinner(_0x51e393(0x198),()=>_0x333010[_0x51e393(0x158)][_0x51e393(0x14e)](_0x45ae5a['parentId'],_0x45ae5a[_0x51e393(0x19d)]),{'verbose':_0x149ee0[_0x51e393(0x1c8)]});return _0x28c83b[_0x51e393(0x1be)];}}export class SegmentFolderCreateCommand extends BaseCommand{[a35_0x2f6a02(0x1bb)]=a35_0x2f6a02(0x1c0);[a35_0x2f6a02(0x1a0)]=a35_0x2f6a02(0x166);async[a35_0x2f6a02(0x155)](_0x2f0635){const _0x5c9ba1=a35_0x2f6a02,{options:_0x18d363,args:_0x51de1a,tdx:_0x479601}=_0x2f0635,_0x494df4=_0x18d363;if(_0x51de1a['length']<0x2)return console[_0x5c9ba1(0x1c9)](_0x5c9ba1(0x1a9)),console[_0x5c9ba1(0x1c9)](_0x5c9ba1(0x168)),0x1;const _0x26dd30=_0x51de1a[0x0],_0x34f1df=_0x51de1a[0x1];_0x494df4[_0x5c9ba1(0x1c8)]&&(console[_0x5c9ba1(0x1c9)](_0x5c9ba1(0x153)+_0x494df4[_0x5c9ba1(0x1ae)]),console[_0x5c9ba1(0x1c9)](_0x5c9ba1(0x194)+_0x26dd30),console[_0x5c9ba1(0x1c9)](_0x5c9ba1(0x147)+_0x34f1df));let _0x53074e;if(_0x494df4[_0x5c9ba1(0x1b7)]){const _0x446bf1=_0x494df4[_0x5c9ba1(0x1b7)],_0xf4fff5=await withSpinner(_0x5c9ba1(0x1c3)+_0x26dd30+'\x27...',()=>_0x479601['segment'][_0x5c9ba1(0x164)](_0x26dd30),{'verbose':_0x494df4[_0x5c9ba1(0x1c8)]}),_0x225654=_0xf4fff5[_0x5c9ba1(0x1be)],_0x2a1c13=await withSpinner(_0x5c9ba1(0x1cf)+_0x446bf1+'\x27...',()=>_0x479601[_0x5c9ba1(0x158)][_0x5c9ba1(0x197)](_0x225654,_0x446bf1),{'verbose':_0x494df4[_0x5c9ba1(0x1c8)]});_0x53074e=_0x2a1c13[_0x5c9ba1(0x1be)],_0x494df4[_0x5c9ba1(0x1c8)]&&console[_0x5c9ba1(0x1c9)](_0x5c9ba1(0x17b)+_0x53074e);}const _0x3389b1={'name':_0x34f1df,'description':_0x494df4[_0x5c9ba1(0x1a0)],'parentFolderId':_0x53074e},_0x407399=await withSpinner('Creating\x20folder\x20\x27'+_0x34f1df+'\x27...',()=>_0x479601[_0x5c9ba1(0x158)][_0x5c9ba1(0x14f)](_0x26dd30,_0x3389b1),{'verbose':_0x494df4['verbose']}),_0x34b3cd=_0x407399[_0x5c9ba1(0x1be)];return console[_0x5c9ba1(0x1c9)](_0x5c9ba1(0x185)+_0x34b3cd[_0x5c9ba1(0x1bb)]+_0x5c9ba1(0x176)+_0x34b3cd['id']),await handleSDKOutput([_0x34b3cd],_0x494df4),0x0;}}export class SegmentViewCommand extends BaseCommand{[a35_0x2f6a02(0x1bb)]='segment:view';[a35_0x2f6a02(0x1a0)]='Show\x20folder\x20or\x20child\x20segment\x20details';async[a35_0x2f6a02(0x155)](_0x2685e6){const _0x1bb54f=a35_0x2f6a02,{options:_0x2e9f8b,args:_0x1a6335,tdx:_0x24c124}=_0x2685e6,_0x453213=_0x1a6335[0x0];if(!_0x453213)return console['error'](_0x1bb54f(0x16f)),console[_0x1bb54f(0x1c9)](_0x1bb54f(0x165)),console[_0x1bb54f(0x1c9)](_0x1bb54f(0x1a5)),console[_0x1bb54f(0x1c9)](_0x1bb54f(0x1aa)),console[_0x1bb54f(0x1c9)](_0x1bb54f(0x1a2)),console[_0x1bb54f(0x1c9)]('Examples:'),console['error']('\x20\x20tdx\x20sg\x20view\x20\x22Marketing\x22\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20folder\x20details'),console[_0x1bb54f(0x1c9)]('\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20\x20\x20\x20\x20#\x20View\x20child\x20segment\x20details'),console['error']('\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20-w\x20\x20#\x20Open\x20segment\x20in\x20web\x20browser'),console[_0x1bb54f(0x1c9)](_0x1bb54f(0x1ab)),0x1;try{const _0x16dcd3=_0x2e9f8b[_0x1bb54f(0x1c6)],_0x29df10=await resolveSegmentTarget(_0x453213,_0x16dcd3,_0x2e9f8b[_0x1bb54f(0x1c8)]);_0x2e9f8b[_0x1bb54f(0x1c8)]&&console[_0x1bb54f(0x1c9)](_0x1bb54f(0x146)+_0x29df10);const _0x222c9d=await withSpinner(_0x1bb54f(0x1b9)+_0x453213+'\x27...',()=>_0x24c124[_0x1bb54f(0x158)][_0x1bb54f(0x1b6)](_0x29df10),{'verbose':_0x2e9f8b['verbose']}),_0x3cd70a=_0x222c9d[_0x1bb54f(0x1be)];_0x2e9f8b[_0x1bb54f(0x1c8)]&&(console[_0x1bb54f(0x1c9)]('Resolved\x20type:\x20'+_0x3cd70a[_0x1bb54f(0x19a)]),console[_0x1bb54f(0x1c9)](_0x1bb54f(0x196)+_0x3cd70a['parentId']),_0x3cd70a[_0x1bb54f(0x16e)]&&console[_0x1bb54f(0x1c9)](_0x1bb54f(0x173)+_0x3cd70a[_0x1bb54f(0x16e)]),_0x3cd70a[_0x1bb54f(0x19d)]&&console[_0x1bb54f(0x1c9)](_0x1bb54f(0x177)+_0x3cd70a[_0x1bb54f(0x19d)]));if(_0x2e9f8b[_0x1bb54f(0x1d0)]){if(_0x3cd70a[_0x1bb54f(0x19a)]===_0x1bb54f(0x191))return console[_0x1bb54f(0x1c9)](_0x1bb54f(0x160)),0x1;if(_0x3cd70a[_0x1bb54f(0x19a)]===_0x1bb54f(0x169))return console[_0x1bb54f(0x1c9)]('Error:\x20Cannot\x20open\x20parent\x20segment\x20with\x20this\x20command.'),console[_0x1bb54f(0x1c9)]('Use:\x20tdx\x20ps\x20view\x20-w'),0x1;if(!_0x3cd70a[_0x1bb54f(0x19d)])throw new SDKError(ErrorCode[_0x1bb54f(0x188)],_0x1bb54f(0x1b8));const _0x2d6362=getConsoleNextUrl(_0x2e9f8b[_0x1bb54f(0x1ae)],'/app/ps/'+_0x3cd70a[_0x1bb54f(0x18d)]+_0x1bb54f(0x182)+_0x3cd70a[_0x1bb54f(0x19d)]);return console[_0x1bb54f(0x1c9)](a35_0x10ce32[_0x1bb54f(0x15e)]('βœ”')+_0x1bb54f(0x148)+a35_0x10ce32[_0x1bb54f(0x1ca)](_0x2d6362)),openBrowser(_0x2d6362),0x0;}if(_0x3cd70a[_0x1bb54f(0x19a)]==='folder'){if(!_0x3cd70a[_0x1bb54f(0x16e)])throw new SDKError(ErrorCode[_0x1bb54f(0x187)],_0x1bb54f(0x159));const _0x3e7fd6=await withSpinner('Fetching\x20folder\x20details...',()=>_0x24c124[_0x1bb54f(0x158)][_0x1bb54f(0x151)](_0x3cd70a[_0x1bb54f(0x16e)]),{'verbose':_0x2e9f8b['verbose']});await handleSingleObjectOutput(_0x3e7fd6[_0x1bb54f(0x1be)],_0x2e9f8b);}else{if(_0x3cd70a[_0x1bb54f(0x19a)]==='segment'){if(!_0x3cd70a[_0x1bb54f(0x19d)])throw new SDKError(ErrorCode[_0x1bb54f(0x188)],_0x1bb54f(0x1b8));const _0x2105be=await withSpinner(_0x1bb54f(0x1ba),()=>_0x24c124[_0x1bb54f(0x158)]['getSegment'](_0x3cd70a[_0x1bb54f(0x18d)],_0x3cd70a[_0x1bb54f(0x19d)]),{'verbose':_0x2e9f8b[_0x1bb54f(0x1c8)]}),_0x574529=getConsoleNextUrl(_0x2e9f8b[_0x1bb54f(0x1ae)],_0x1bb54f(0x193)+_0x3cd70a['parentId']+_0x1bb54f(0x182)+_0x3cd70a[_0x1bb54f(0x19d)]),_0x2d2ef1=_0x2105be[_0x1bb54f(0x1be)];_0x2d2ef1[_0x1bb54f(0x189)]=_0x574529,await handleSingleObjectOutput(_0x2d2ef1,_0x2e9f8b);}else return console[_0x1bb54f(0x1c9)](_0x1bb54f(0x1a1)),console[_0x1bb54f(0x1c9)](_0x1bb54f(0x16d)),0x1;}return 0x0;}catch(_0x2c21cf){if(_0x2c21cf instanceof SDKError)return console[_0x1bb54f(0x1c9)]('Error:\x20'+_0x2c21cf[_0x1bb54f(0x171)]),_0x2c21cf[_0x1bb54f(0x19c)]&&console[_0x1bb54f(0x1c9)]('\x20\x20Cause:\x20'+_0x2c21cf[_0x1bb54f(0x19c)]),0x1;throw _0x2c21cf;}}}export const SegmentInfoCommand=SegmentViewCommand;export class SegmentDescCommand extends BaseCommand{[a35_0x2f6a02(0x1bb)]=a35_0x2f6a02(0x1c1);[a35_0x2f6a02(0x1a0)]=a35_0x2f6a02(0x1d2);async[a35_0x2f6a02(0x155)](_0x52c4bf){const _0x21fe95=a35_0x2f6a02,{options:_0x5f15da,args:_0x252703,tdx:_0x23dc62}=_0x52c4bf,_0x1d8c55=_0x252703[0x0];if(!_0x1d8c55)return console[_0x21fe95(0x1c9)]('Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required'),console[_0x21fe95(0x1c9)](_0x21fe95(0x199)),console[_0x21fe95(0x1c9)](_0x21fe95(0x15a)),console[_0x21fe95(0x1c9)](_0x21fe95(0x15c)),console['error']('\x20\x20tdx\x20sg\x20desc\x20\x22Premium\x20Users\x22'),console['error'](_0x21fe95(0x152)),0x1;try{const _0x2b0354=_0x5f15da['parentSegment'],_0x1d4da3=await resolveSegmentTarget(_0x1d8c55,_0x2b0354,_0x5f15da[_0x21fe95(0x1c8)]);_0x5f15da[_0x21fe95(0x1c8)]&&console[_0x21fe95(0x1c9)](_0x21fe95(0x146)+_0x1d4da3);const _0x2b8ac3=await withSpinner('Resolving\x20\x27'+_0x1d8c55+'\x27...',()=>_0x23dc62['segment']['resolvePathToResource'](_0x1d4da3),{'verbose':_0x5f15da[_0x21fe95(0x1c8)]}),_0x3e7a3e=_0x2b8ac3[_0x21fe95(0x1be)];_0x5f15da[_0x21fe95(0x1c8)]&&(console[_0x21fe95(0x1c9)]('Resolved\x20type:\x20'+_0x3e7a3e[_0x21fe95(0x19a)]),console['error'](_0x21fe95(0x196)+_0x3e7a3e['parentId']));if(_0x3e7a3e[_0x21fe95(0x19a)]==='folder')return console['error']('Error:\x20Cannot\x20show\x20schema\x20for\x20a\x20folder.'),console[_0x21fe95(0x1c9)](_0x21fe95(0x1a8)),0x1;if(_0x3e7a3e[_0x21fe95(0x19a)]==='parent')return console[_0x21fe95(0x1c9)]('Error:\x20Cannot\x20show\x20schema\x20for\x20parent\x20segment\x20with\x20this\x20command.'),console[_0x21fe95(0x1c9)]('Use:\x20tdx\x20ps\x20desc'),0x1;if(!_0x3e7a3e[_0x21fe95(0x19d)])throw new SDKError(ErrorCode[_0x21fe95(0x188)],_0x21fe95(0x1b8));const _0x5e6e79=await withSpinner('Fetching\x20SQL\x20for\x20segment...',()=>_0x23dc62[_0x21fe95(0x158)][_0x21fe95(0x14e)](_0x3e7a3e[_0x21fe95(0x18d)],_0x3e7a3e[_0x21fe95(0x19d)]),{'verbose':_0x5f15da[_0x21fe95(0x1c8)]}),_0x8354d2=_0x5e6e79['data'],_0x2cb370=await executeSchemaQuery(_0x8354d2,_0x23dc62,_0x5f15da);return await handleQueryOutput(_0x2cb370,_0x5f15da),0x0;}catch(_0x300018){if(_0x300018 instanceof SDKError)return console[_0x21fe95(0x1c9)](_0x21fe95(0x18b)+_0x300018['message']),_0x300018[_0x21fe95(0x19c)]&&console[_0x21fe95(0x1c9)](_0x21fe95(0x1b3)+_0x300018[_0x21fe95(0x19c)]),0x1;throw _0x300018;}}}
1
+ const a35_0x29f1cb=a35_0x2ff3;function a35_0x2ff3(_0x30c0f1,_0x215d2f){_0x30c0f1=_0x30c0f1-0xf5;const _0x119a00=a35_0x119a();let _0x2ff346=_0x119a00[_0x30c0f1];return _0x2ff346;}(function(_0x4c3402,_0x26c750){const _0x222912=a35_0x2ff3,_0x423e6f=_0x4c3402();while(!![]){try{const _0x5492c0=-parseInt(_0x222912(0x14b))/0x1*(parseInt(_0x222912(0x13b))/0x2)+parseInt(_0x222912(0x153))/0x3+parseInt(_0x222912(0x11f))/0x4*(-parseInt(_0x222912(0x107))/0x5)+-parseInt(_0x222912(0x15b))/0x6+parseInt(_0x222912(0x11a))/0x7*(parseInt(_0x222912(0x112))/0x8)+-parseInt(_0x222912(0x17e))/0x9+parseInt(_0x222912(0x102))/0xa*(parseInt(_0x222912(0x15e))/0xb);if(_0x5492c0===_0x26c750)break;else _0x423e6f['push'](_0x423e6f['shift']());}catch(_0x1cbd78){_0x423e6f['push'](_0x423e6f['shift']());}}}(a35_0x119a,0x7fab5));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner,formatElapsed}from'../utils/spinner.js';import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{executeSchemaQuery}from'../sdk/segment/fields-display.js';function a35_0x119a(){const _0x4f6acf=['List\x20segment\x20folders\x20under\x20a\x20parent\x20segment','Fetching\x20SQL\x20for\x20segment...','Folder\x20name:\x20','Show\x20folder\x20or\x20child\x20segment\x20details','error','256NqDHdB','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','Error:\x20Cannot\x20execute\x20query\x20for\x20parent\x20segment\x20with\x20this\x20command.','Get\x20SQL\x20query\x20for\x20child\x20segment','message','Execute\x20child\x20segment\x20SQL\x20query\x20and\x20show\x20results','listFolders','segment:sql','161336XTfHdp','elapsedTimeMillis','Resolving\x20parent\x20segment\x20\x27','Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.\x20Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','Listing\x20folders\x20for\x20parent\x20\x27','367228dvTXdX','Folder\x20ID:\x20','SELECT\x20*\x20FROM\x20(\x0a','Use:\x20tdx\x20ps\x20desc','\x20\x20Local\x20YAML\x20file:\x20\x20\x20\x20\x20\x20tdx\x20sg\x20sql\x20--path\x20<file-path>','Use:\x20tdx\x20ps\x20show','Show\x20child\x20segment\x20schema\x20(column\x20types)','getSQLFromServerSegment','\x20Opening\x20','Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required','segment:show','Error:\x20Cannot\x20open\x20folder\x20in\x20web\x20browser.\x20Use\x20a\x20segment\x20name\x20instead.','test','segment','path','type','\x27...','SEGMENT_NOT_FOUND','\x20folder','cyan','segment:folder:list','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','Create\x20segment\x20folder\x20for\x20organization','createFolder','red','Usage:\x20tdx\x20sg\x20desc\x20<name>','\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','Resolving\x20parent\x20folder\x20\x27','8JIwvjI','jobId','Usage:\x20tdx\x20sg\x20view\x20<name>\x20[-w]','Resolved\x20YAML\x20file:\x20','Error:\x20','cause','Resolving\x20folder\x20\x27','Resolved\x20parent\x20ID:\x20','Parent\x20name:\x20','Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20show\x20<path/to/segment.yml>','getFolder','log','Fetching\x20parent\x20segment\x20details...','segment:folder:create','74709esGgLN','getSegmentSQLFromYaml','processedRows','\x20\x20Folder\x20path:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20view\x20<path/to/segment.yml>','Fetching\x20folder\x20details...','INVALID_ARGUMENT','Target\x20path:\x20','274533roOYJZ','limit','\x20\x20Segment\x20name:\x20','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22','getSegment','resolvePathToResource','parent','information_schema','2847852DMRbfD','format','\x20\x20tdx\x20sg\x20desc\x20\x22Premium\x20Users\x22','11GHicVe','url','\x20rows\x20','\x20\x20tdx\x20sg\x20sql\x20\x22Premium\x20Users\x22','Examples:','length','segmentName','parentFolder','stats','data','\x20\x20Full\x20path:\x20','Cannot\x20get\x20SQL\x20for\x20parent\x20segment\x20with\x20this\x20command.\x20Use:\x20tdx\x20ps\x20sql','Error:\x20Folder\x20reference\x20is\x20required','parentId','folderPath','Error:\x20Specify\x20either\x20segment\x20name\x20or\x20--path,\x20not\x20both','Folder\x20ID\x20missing\x20from\x20resolved\x20path','folder','βœ”\x20Found\x20','Error:\x20Parent\x20segment\x20name\x20is\x20required','βœ–\x20Query\x20failed\x20[','\x20\x20Server-side\x20segment:\x20\x20tdx\x20sg\x20sql\x20<name>','\x20\x20tdx\x20sg\x20sql\x20--path\x20segments/my-audience/premium-users.yml','\x20\x20Cause:\x20','Use:\x20tdx\x20ps\x20view','includes','\x20\x20tdx\x20sg\x20show\x20segments/my-audience/premium-users.yml','(root)','/e/','segment:describe','\x20\x20tdx\x20sg\x20view\x20\x22Marketing\x22\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20folder\x20details','/app/ps/','4294332ccImzs','Error:\x20Segment\x20name\x20or\x20--path\x20is\x20required','json','description','Resolved\x20folder\x20ID:\x20','segment:folder:show','Usage:','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','\x20\x20Parent\x20segment:\x20','\x20\x20tdx\x20sg\x20sql\x20--path\x20','Resolving\x20\x27','βœ”\x20Query\x20completed:\x20Processed\x20','\x27\x20with\x20ID:\x20','name','content','Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required','Error:\x20Cannot\x20open\x20parent\x20segment\x20with\x20this\x20command.','query','setJobId','execute','SEGMENT_FOLDER_NOT_FOUND','Segment\x20ID:\x20','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22','Parent\x20ID:\x20','Error:\x20YAML\x20file\x20paths\x20must\x20be\x20specified\x20with\x20--path\x20option','folderId','fullPath','\x20\x20tdx\x20sg\x20view\x20segments/my-audience/premium-users.yml','\x20[Job\x20ID:\x20','Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)','replace','Site:\x20','segment:desc','Use:\x20tdx\x20sg\x20view\x20<name>\x20\x20#\x20To\x20show\x20folder\x20details','verbose','resolveParentId','Options:','Error:\x20Cannot\x20view\x20parent\x20segment\x20details\x20with\x20this\x20command.','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20desc\x20<path/to/segment.yml>','Use:\x20tdx\x20ps\x20view\x20-w','site','Resolved\x20type:\x20','Fetching\x20SQL\x20from\x20rule...','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20-w\x20\x20#\x20Open\x20segment\x20in\x20web\x20browser','segmentId','10363190WiySSt','parentSegment','Usage:\x20tdx\x20sg\x20show\x20<name>','getSQLFromYamlFile','Usage:\x20tdx\x20segment\x20describe\x20<path>','5CbjZgr','Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>','resolveFolderId','Show\x20segment\x20folder\x20details','getSegmentSQL','Segment\x20ID\x20missing\x20from\x20resolved\x20path'];a35_0x119a=function(){return _0x4f6acf;};return a35_0x119a();}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_0x4e64e3 from'chalk';async function resolveSegmentTarget(_0x1e670d,_0x2888f4,_0x3ace87){const _0x4d42fa=a35_0x2ff3;if(isYamlFilePath(_0x1e670d))try{const _0x3301d9=await resolveYamlFilePath(_0x1e670d);return _0x3ace87&&(console['error'](_0x4d42fa(0x13e)+_0x1e670d),console[_0x4d42fa(0x111)](_0x4d42fa(0x186)+_0x3301d9['parentSegment']),console[_0x4d42fa(0x111)](_0x4d42fa(0x155)+_0x3301d9['segmentName']),console[_0x4d42fa(0x111)](_0x4d42fa(0x14e)+(_0x3301d9[_0x4d42fa(0x16c)]||_0x4d42fa(0x179))),console[_0x4d42fa(0x111)](_0x4d42fa(0x168)+_0x3301d9[_0x4d42fa(0x198)])),_0x3301d9[_0x4d42fa(0x198)];}catch(_0x283ea9){throw new SDKError(ErrorCode[_0x4d42fa(0x151)],_0x4d42fa(0x113)+_0x283ea9[_0x4d42fa(0x116)]);}if(!_0x2888f4)throw new SDKError(ErrorCode[_0x4d42fa(0x151)],_0x4d42fa(0x145));return _0x2888f4+'/'+_0x1e670d;}export class SegmentDescribeCommand extends BaseCommand{['name']=a35_0x29f1cb(0x17b);[a35_0x29f1cb(0x181)]='Show\x20segment\x20or\x20folder\x20details';async[a35_0x29f1cb(0x191)](_0x183af9){const _0x257e9e=a35_0x29f1cb,{options:_0xb224f0,args:_0x44a266,tdx:_0x587c9c}=_0x183af9,_0x163ea3=_0x44a266[0x0],_0x15a39d=!_0x163ea3&&!!_0xb224f0['parentSegment'],_0x450201=_0x163ea3||_0xb224f0[_0x257e9e(0x103)];if(!_0x450201)return console['error']('Error:\x20Path\x20or\x20name\x20is\x20required'),console[_0x257e9e(0x111)](_0x257e9e(0x106)),console[_0x257e9e(0x111)](_0x257e9e(0x162)),console[_0x257e9e(0x111)](_0x257e9e(0x194)),console[_0x257e9e(0x111)](_0x257e9e(0x156)),console[_0x257e9e(0x111)](_0x257e9e(0x139)),console[_0x257e9e(0x111)](_0x257e9e(0x134)),0x1;try{const _0x3ee423=_0xb224f0['segmentPath'];let _0x4d62d1=_0x450201;!_0x15a39d&&_0x3ee423&&!_0x450201[_0x257e9e(0x177)]('/')&&(_0x4d62d1=_0x3ee423+'/'+_0x450201,_0xb224f0[_0x257e9e(0xf7)]&&console[_0x257e9e(0x111)]('Resolved\x20relative\x20path\x20to:\x20'+_0x4d62d1));const _0x416078=await withSpinner('Resolving\x20path\x20\x27'+_0x4d62d1+_0x257e9e(0x12f),()=>_0x587c9c[_0x257e9e(0x12c)][_0x257e9e(0x158)](_0x4d62d1),{'verbose':_0xb224f0[_0x257e9e(0xf7)]}),_0x4609d7=_0x416078['data'];_0xb224f0['verbose']&&(console[_0x257e9e(0x111)]('Resolved\x20type:\x20'+_0x4609d7[_0x257e9e(0x12e)]),console[_0x257e9e(0x111)](_0x257e9e(0x195)+_0x4609d7[_0x257e9e(0x16b)]),_0x4609d7['folderId']&&console[_0x257e9e(0x111)](_0x257e9e(0x120)+_0x4609d7[_0x257e9e(0x197)]),_0x4609d7[_0x257e9e(0x101)]&&console[_0x257e9e(0x111)](_0x257e9e(0x193)+_0x4609d7[_0x257e9e(0x101)]));if(_0x4609d7[_0x257e9e(0x12e)]===_0x257e9e(0x159)){const _0x3cf45b=await withSpinner(_0x257e9e(0x149),()=>_0x587c9c[_0x257e9e(0x12c)]['getParent'](_0x4609d7['parentId']),{'verbose':_0xb224f0[_0x257e9e(0xf7)]});await handleSingleObjectOutput(_0x3cf45b[_0x257e9e(0x167)],_0xb224f0);}else{if(_0x4609d7[_0x257e9e(0x12e)]==='folder'){if(!_0x4609d7[_0x257e9e(0x197)])throw new SDKError(ErrorCode[_0x257e9e(0x192)],_0x257e9e(0x16e));const _0x5a35fe=await withSpinner('Fetching\x20folder\x20details...',()=>_0x587c9c[_0x257e9e(0x12c)][_0x257e9e(0x147)](_0x4609d7['folderId']),{'verbose':_0xb224f0['verbose']});await handleSingleObjectOutput(_0x5a35fe[_0x257e9e(0x167)],_0xb224f0);}else{if(_0x4609d7[_0x257e9e(0x12e)]==='segment'){if(!_0x4609d7[_0x257e9e(0x101)])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x257e9e(0x10c));const _0x24d4b8=await withSpinner('Fetching\x20segment\x20details...',()=>_0x587c9c[_0x257e9e(0x12c)][_0x257e9e(0x157)](_0x4609d7[_0x257e9e(0x16b)],_0x4609d7[_0x257e9e(0x101)]),{'verbose':_0xb224f0['verbose']});await handleSingleObjectOutput(_0x24d4b8[_0x257e9e(0x167)],_0xb224f0);}}}return 0x0;}catch(_0x20e2bc){if(_0x20e2bc instanceof SDKError)return console['error'](_0x257e9e(0x13f)+_0x20e2bc[_0x257e9e(0x116)]),_0x20e2bc[_0x257e9e(0x140)]&&console['error'](_0x257e9e(0x175)+_0x20e2bc[_0x257e9e(0x140)]),0x1;throw _0x20e2bc;}}}export class SegmentShowCommand extends BaseCommand{[a35_0x29f1cb(0x18b)]=a35_0x29f1cb(0x129);[a35_0x29f1cb(0x181)]=a35_0x29f1cb(0x117);async['execute'](_0x448335){const _0x284dd4=a35_0x29f1cb,{options:_0x47134e,args:_0x489832,tdx:_0x2bb139}=_0x448335,_0x45e090=_0x489832[0x0];if(!_0x45e090)return console[_0x284dd4(0x111)](_0x284dd4(0x18d)),console[_0x284dd4(0x111)](_0x284dd4(0x104)),console[_0x284dd4(0x111)](_0x284dd4(0x146)),console[_0x284dd4(0x111)](_0x284dd4(0x162)),console[_0x284dd4(0x111)]('\x20\x20tdx\x20sg\x20show\x20\x22Premium\x20Users\x22'),console[_0x284dd4(0x111)](_0x284dd4(0x178)),0x1;try{const _0x4fa510=_0x47134e[_0x284dd4(0x103)],_0x33a40c=await resolveSegmentTarget(_0x45e090,_0x4fa510,_0x47134e[_0x284dd4(0xf7)]);_0x47134e[_0x284dd4(0xf7)]&&console['error'](_0x284dd4(0x152)+_0x33a40c);const _0x2ecf00=await withSpinner(_0x284dd4(0x188)+_0x45e090+_0x284dd4(0x12f),()=>_0x2bb139[_0x284dd4(0x12c)][_0x284dd4(0x158)](_0x33a40c),{'verbose':_0x47134e['verbose']}),_0x480ea0=_0x2ecf00[_0x284dd4(0x167)];_0x47134e['verbose']&&(console[_0x284dd4(0x111)](_0x284dd4(0xfe)+_0x480ea0[_0x284dd4(0x12e)]),console[_0x284dd4(0x111)](_0x284dd4(0x195)+_0x480ea0['parentId']));if(_0x480ea0['type']===_0x284dd4(0x16f))return console[_0x284dd4(0x111)]('Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.'),console[_0x284dd4(0x111)](_0x284dd4(0xf6)),0x1;if(_0x480ea0[_0x284dd4(0x12e)]==='parent')return console['error'](_0x284dd4(0x114)),console[_0x284dd4(0x111)](_0x284dd4(0x124)),0x1;if(!_0x480ea0['segmentId'])throw new SDKError(ErrorCode[_0x284dd4(0x130)],_0x284dd4(0x10c));const _0x42f17b=await withSpinner(_0x284dd4(0x10e),()=>_0x2bb139[_0x284dd4(0x12c)][_0x284dd4(0x10b)](_0x480ea0['parentId'],_0x480ea0[_0x284dd4(0x101)]),{'verbose':_0x47134e[_0x284dd4(0xf7)]});let _0x281ac9=_0x42f17b['data'];const _0x479589=resolveLimit(_0x47134e[_0x284dd4(0x154)],DEFAULT_DISPLAY_LIMIT),_0x4dceaf=/\bLIMIT\s+\d+/i[_0x284dd4(0x12b)](_0x281ac9);!_0x4dceaf&&(_0x281ac9=_0x281ac9['trim']()[_0x284dd4(0x19c)](/;+$/,''),_0x281ac9=_0x284dd4(0x121)+_0x281ac9+'\x0a)\x20AS\x20segment_query\x0aLIMIT\x20'+_0x479589);_0x47134e[_0x284dd4(0xf7)]&&console['error']('SQL\x20query:\x0a'+_0x281ac9);const _0x2a5510=await withProgressSpinner('Executing\x20segment\x20query...',async _0x450d37=>{const _0x15a9f5=_0x284dd4,_0x5cb43e=await _0x2bb139[_0x15a9f5(0x18f)][_0x15a9f5(0x191)](_0x281ac9,{'catalog':'td','schema':_0x15a9f5(0x15a),'onJobId':_0x548919=>{const _0x5d69f6=_0x15a9f5;_0x450d37[_0x5d69f6(0x190)](_0x548919);}});return _0x5cb43e;},{'verbose':_0x47134e[_0x284dd4(0xf7)]}),_0x404e35=_0x2a5510[_0x284dd4(0x167)],_0x4040aa=_0x404e35['jobId']?_0x284dd4(0x19a)+_0x404e35[_0x284dd4(0x13c)]+']':'';return console[_0x284dd4(0x111)](_0x284dd4(0x189)+_0x404e35[_0x284dd4(0x166)][_0x284dd4(0x14d)]['toLocaleString']()+_0x284dd4(0x160)+('in\x20'+formatElapsed(_0x404e35['stats'][_0x284dd4(0x11b)])+_0x4040aa)),await handleQueryOutput(_0x404e35,_0x47134e),0x0;}catch(_0x1f2794){if(_0x1f2794 instanceof SDKError)return console['error'](_0x284dd4(0x172)+_0x1f2794['code']+']'),console[_0x284dd4(0x111)]('\x0a'+_0x1f2794[_0x284dd4(0x116)]),0x1;throw _0x1f2794;}}}export class SegmentFolderListCommand extends BaseCommand{['name']=a35_0x29f1cb(0x133);[a35_0x29f1cb(0x181)]=a35_0x29f1cb(0x10d);async[a35_0x29f1cb(0x191)](_0x5c31fe){const _0x29ca05=a35_0x29f1cb,{options:_0x43ee4e,args:_0x6781,tdx:_0x442279}=_0x5c31fe;if(_0x6781['length']===0x0)return console[_0x29ca05(0x111)](_0x29ca05(0x171)),console['error'](_0x29ca05(0x108)),0x1;const _0x1f97ce=_0x6781[0x0];try{_0x43ee4e[_0x29ca05(0xf7)]&&(console[_0x29ca05(0x111)]('Site:\x20'+_0x43ee4e[_0x29ca05(0xfd)]),console[_0x29ca05(0x111)](_0x29ca05(0x143)+_0x1f97ce));const _0x563a95=await withSpinner(_0x29ca05(0x11c)+_0x1f97ce+'\x27...',()=>_0x442279[_0x29ca05(0x12c)][_0x29ca05(0xf8)](_0x1f97ce),{'verbose':_0x43ee4e[_0x29ca05(0xf7)]}),_0x36ee18=_0x563a95[_0x29ca05(0x167)];_0x43ee4e[_0x29ca05(0xf7)]&&console[_0x29ca05(0x111)]('Resolved\x20parent\x20ID:\x20'+_0x36ee18);const _0x286520=await withSpinner(_0x29ca05(0x11e)+_0x1f97ce+_0x29ca05(0x12f),()=>_0x442279[_0x29ca05(0x12c)][_0x29ca05(0x118)](_0x36ee18),{'verbose':_0x43ee4e[_0x29ca05(0xf7)]}),_0x2fe7ee=_0x286520['data'];return console[_0x29ca05(0x111)](_0x29ca05(0x170)+_0x2fe7ee[_0x29ca05(0x163)]+_0x29ca05(0x131)+(_0x2fe7ee[_0x29ca05(0x163)]!==0x1?'s':'')),await handleSDKOutput(_0x2fe7ee,_0x43ee4e),0x0;}catch(_0x37a285){if(_0x37a285 instanceof SDKError)return console[_0x29ca05(0x111)](_0x29ca05(0x13f)+_0x37a285[_0x29ca05(0x116)]),_0x37a285['cause']&&console[_0x29ca05(0x111)](_0x29ca05(0x175)+_0x37a285[_0x29ca05(0x140)]),0x1;throw _0x37a285;}}}export class SegmentFolderShowCommand extends BaseCommand{[a35_0x29f1cb(0x18b)]=a35_0x29f1cb(0x183);['description']=a35_0x29f1cb(0x10a);async[a35_0x29f1cb(0x191)](_0x4e22c8){const _0xe2eceb=a35_0x29f1cb,{options:_0x42c969,args:_0x315102,tdx:_0x2fbe68}=_0x4e22c8;if(_0x315102[_0xe2eceb(0x163)]===0x0)return console['error'](_0xe2eceb(0x16a)),console[_0xe2eceb(0x111)]('Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>'),0x1;try{const {parentId:_0x4078c0,childId:_0x4ea406}=parseSegmentRef(_0x315102[0x0]);_0x42c969[_0xe2eceb(0xf7)]&&(console[_0xe2eceb(0x111)](_0xe2eceb(0x19d)+_0x42c969['site']),console[_0xe2eceb(0x111)]('Parent\x20name:\x20'+_0x4078c0),_0x4ea406&&console[_0xe2eceb(0x111)](_0xe2eceb(0x10f)+_0x4ea406));if(!_0x4ea406)return console[_0xe2eceb(0x111)](_0xe2eceb(0x19b)),0x1;const _0x299e29=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x4078c0+_0xe2eceb(0x12f),()=>_0x2fbe68[_0xe2eceb(0x12c)][_0xe2eceb(0xf8)](_0x4078c0),{'verbose':_0x42c969['verbose']}),_0x31f7dc=_0x299e29[_0xe2eceb(0x167)];_0x42c969[_0xe2eceb(0xf7)]&&console[_0xe2eceb(0x111)](_0xe2eceb(0x142)+_0x31f7dc);const _0x27bc27=await withSpinner(_0xe2eceb(0x141)+_0x4ea406+_0xe2eceb(0x12f),()=>_0x2fbe68['segment'][_0xe2eceb(0x109)](_0x31f7dc,_0x4ea406),{'verbose':_0x42c969[_0xe2eceb(0xf7)]}),_0x2200fa=_0x27bc27[_0xe2eceb(0x167)];_0x42c969[_0xe2eceb(0xf7)]&&console[_0xe2eceb(0x111)](_0xe2eceb(0x182)+_0x2200fa);const _0x1bbed4=await withSpinner('Fetching\x20folder\x20\x27'+_0x4ea406+_0xe2eceb(0x12f),()=>_0x2fbe68[_0xe2eceb(0x12c)][_0xe2eceb(0x147)](_0x2200fa),{'verbose':_0x42c969['verbose']});return await handleSDKOutput([_0x1bbed4[_0xe2eceb(0x167)]],_0x42c969),0x0;}catch(_0x31f330){if(_0x31f330 instanceof SDKError)return console[_0xe2eceb(0x111)](_0xe2eceb(0x13f)+_0x31f330[_0xe2eceb(0x116)]),_0x31f330[_0xe2eceb(0x140)]&&console[_0xe2eceb(0x111)](_0xe2eceb(0x175)+_0x31f330[_0xe2eceb(0x140)]),0x1;throw _0x31f330;}}}export class SegmentSQLCommand extends BaseCommand{[a35_0x29f1cb(0x18b)]=a35_0x29f1cb(0x119);['description']=a35_0x29f1cb(0x115);async['execute'](_0x3e0b6e){const _0x490cb9=a35_0x29f1cb,{options:_0x1ffe71,args:_0x13f961}=_0x3e0b6e,_0x85e944=_0x1ffe71,_0x16fb9e=_0x85e944[_0x490cb9(0x12d)],_0x43f75a=_0x13f961[0x0];if(!_0x43f75a&&!_0x16fb9e)return console[_0x490cb9(0x111)](a35_0x4e64e3[_0x490cb9(0x137)](_0x490cb9(0x17f))),console[_0x490cb9(0x111)](_0x490cb9(0x184)),console[_0x490cb9(0x111)](_0x490cb9(0x173)),console[_0x490cb9(0x111)](_0x490cb9(0x123)),console[_0x490cb9(0x111)]('Examples:'),console['error'](_0x490cb9(0x161)),console[_0x490cb9(0x111)](_0x490cb9(0x174)),0x1;if(_0x43f75a&&_0x16fb9e)return console[_0x490cb9(0x111)](a35_0x4e64e3[_0x490cb9(0x137)](_0x490cb9(0x16d))),0x1;try{let _0x326f87;if(_0x16fb9e)_0x326f87=await this[_0x490cb9(0x105)](_0x16fb9e,_0x3e0b6e);else{if(isYamlFilePath(_0x43f75a))return console[_0x490cb9(0x111)](a35_0x4e64e3['red'](_0x490cb9(0x196))),console[_0x490cb9(0x111)](_0x490cb9(0x187)+_0x43f75a),0x1;else _0x326f87=await this[_0x490cb9(0x126)](_0x43f75a,_0x3e0b6e);}return _0x1ffe71[_0x490cb9(0x15c)]===_0x490cb9(0x180)||_0x1ffe71[_0x490cb9(0x15c)]==='jsonl'?await handleSDKOutput([{'sql':_0x326f87}],_0x1ffe71):console[_0x490cb9(0x148)](_0x326f87),0x0;}catch(_0x78cb7d){if(_0x78cb7d instanceof SDKError)return console[_0x490cb9(0x111)](_0x490cb9(0x13f)+_0x78cb7d[_0x490cb9(0x116)]),_0x78cb7d[_0x490cb9(0x140)]&&console[_0x490cb9(0x111)](_0x490cb9(0x175)+_0x78cb7d[_0x490cb9(0x140)]),0x1;throw _0x78cb7d;}}async[a35_0x29f1cb(0x105)](_0x1f2227,_0x29e9a4){const _0x46f3a2=a35_0x29f1cb,{options:_0x577f80,tdx:_0x595832}=_0x29e9a4;let _0x501981;try{_0x501981=await resolveYamlFilePath(_0x1f2227);}catch(_0x56bc17){throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x46f3a2(0x113)+_0x56bc17[_0x46f3a2(0x116)]);}_0x577f80[_0x46f3a2(0xf7)]&&console[_0x46f3a2(0x111)]('Resolved:\x20'+_0x501981[_0x46f3a2(0x103)]+'/'+_0x501981[_0x46f3a2(0x164)]);const _0x29d900=await withSpinner(_0x46f3a2(0xff),()=>_0x595832[_0x46f3a2(0x12c)][_0x46f3a2(0x14c)](_0x501981[_0x46f3a2(0x18c)],_0x501981[_0x46f3a2(0x103)],_0x501981['segmentName']),{'verbose':_0x577f80[_0x46f3a2(0xf7)]});return _0x29d900[_0x46f3a2(0x167)];}async[a35_0x29f1cb(0x126)](_0x3ed7c0,_0x39f724){const _0x4a8029=a35_0x29f1cb,{options:_0x39f2da,tdx:_0x58c445}=_0x39f724,_0x58fa2a=_0x39f2da['parentSegment'],_0x5a7e75=await resolveSegmentTarget(_0x3ed7c0,_0x58fa2a,_0x39f2da[_0x4a8029(0xf7)]);_0x39f2da['verbose']&&console[_0x4a8029(0x111)]('Target\x20path:\x20'+_0x5a7e75);const _0x59f070=await withSpinner(_0x4a8029(0x188)+_0x3ed7c0+_0x4a8029(0x12f),()=>_0x58c445[_0x4a8029(0x12c)][_0x4a8029(0x158)](_0x5a7e75),{'verbose':_0x39f2da[_0x4a8029(0xf7)]}),_0x19f95d=_0x59f070[_0x4a8029(0x167)];_0x39f2da[_0x4a8029(0xf7)]&&(console[_0x4a8029(0x111)](_0x4a8029(0xfe)+_0x19f95d[_0x4a8029(0x12e)]),console[_0x4a8029(0x111)]('Parent\x20ID:\x20'+_0x19f95d[_0x4a8029(0x16b)]));if(_0x19f95d['type']==='folder')throw new SDKError(ErrorCode[_0x4a8029(0x151)],_0x4a8029(0x11d));if(_0x19f95d[_0x4a8029(0x12e)]===_0x4a8029(0x159))throw new SDKError(ErrorCode[_0x4a8029(0x151)],_0x4a8029(0x169));if(!_0x19f95d[_0x4a8029(0x101)])throw new SDKError(ErrorCode[_0x4a8029(0x130)],_0x4a8029(0x10c));const _0x177f5a=await withSpinner('Fetching\x20SQL\x20for\x20segment...',()=>_0x58c445[_0x4a8029(0x12c)][_0x4a8029(0x10b)](_0x19f95d[_0x4a8029(0x16b)],_0x19f95d[_0x4a8029(0x101)]),{'verbose':_0x39f2da[_0x4a8029(0xf7)]});return _0x177f5a[_0x4a8029(0x167)];}}export class SegmentFolderCreateCommand extends BaseCommand{[a35_0x29f1cb(0x18b)]=a35_0x29f1cb(0x14a);[a35_0x29f1cb(0x181)]=a35_0x29f1cb(0x135);async[a35_0x29f1cb(0x191)](_0x5e6218){const _0x546090=a35_0x29f1cb,{options:_0x3634c6,args:_0x11b78b,tdx:_0x3e6ae1}=_0x5e6218,_0x1ef102=_0x3634c6;if(_0x11b78b[_0x546090(0x163)]<0x2)return console[_0x546090(0x111)](_0x546090(0x128)),console[_0x546090(0x111)](_0x546090(0x144)),0x1;const _0x33255f=_0x11b78b[0x0],_0x518614=_0x11b78b[0x1];_0x1ef102[_0x546090(0xf7)]&&(console[_0x546090(0x111)]('Site:\x20'+_0x1ef102[_0x546090(0xfd)]),console[_0x546090(0x111)]('Parent\x20segment:\x20'+_0x33255f),console[_0x546090(0x111)](_0x546090(0x10f)+_0x518614));let _0x16472a;if(_0x1ef102[_0x546090(0x165)]){const _0x35ec7f=_0x1ef102[_0x546090(0x165)],_0x208a02=await withSpinner(_0x546090(0x11c)+_0x33255f+_0x546090(0x12f),()=>_0x3e6ae1[_0x546090(0x12c)]['resolveParentId'](_0x33255f),{'verbose':_0x1ef102[_0x546090(0xf7)]}),_0x34f213=_0x208a02[_0x546090(0x167)],_0x504947=await withSpinner(_0x546090(0x13a)+_0x35ec7f+_0x546090(0x12f),()=>_0x3e6ae1['segment'][_0x546090(0x109)](_0x34f213,_0x35ec7f),{'verbose':_0x1ef102[_0x546090(0xf7)]});_0x16472a=_0x504947[_0x546090(0x167)],_0x1ef102[_0x546090(0xf7)]&&console[_0x546090(0x111)]('Resolved\x20parent\x20folder\x20ID:\x20'+_0x16472a);}const _0x1ace21={'name':_0x518614,'description':_0x1ef102[_0x546090(0x181)],'parentFolderId':_0x16472a},_0x3ab7e4=await withSpinner('Creating\x20folder\x20\x27'+_0x518614+'\x27...',()=>_0x3e6ae1[_0x546090(0x12c)][_0x546090(0x136)](_0x33255f,_0x1ace21),{'verbose':_0x1ef102['verbose']}),_0x4d4f=_0x3ab7e4[_0x546090(0x167)];return console[_0x546090(0x111)]('βœ”\x20Created\x20folder\x20\x27'+_0x4d4f[_0x546090(0x18b)]+_0x546090(0x18a)+_0x4d4f['id']),await handleSDKOutput([_0x4d4f],_0x1ef102),0x0;}}export class SegmentViewCommand extends BaseCommand{['name']='segment:view';['description']=a35_0x29f1cb(0x110);async['execute'](_0x208a42){const _0x53e92d=a35_0x29f1cb,{options:_0x2b322d,args:_0x1628bd,tdx:_0x130fb5}=_0x208a42,_0x21332d=_0x1628bd[0x0];if(!_0x21332d)return console[_0x53e92d(0x111)]('Error:\x20Folder\x20or\x20segment\x20name,\x20or\x20YAML\x20file\x20path\x20is\x20required'),console['error'](_0x53e92d(0x13d)),console['error'](_0x53e92d(0x14f)),console[_0x53e92d(0x111)](_0x53e92d(0xf9)),console[_0x53e92d(0x111)]('\x20\x20-w,\x20--web\x20\x20Open\x20segment\x20in\x20web\x20browser'),console['error'](_0x53e92d(0x162)),console[_0x53e92d(0x111)](_0x53e92d(0x17c)),console['error']('\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20\x20\x20\x20\x20#\x20View\x20child\x20segment\x20details'),console['error'](_0x53e92d(0x100)),console[_0x53e92d(0x111)](_0x53e92d(0x199)),0x1;try{const _0x15271c=_0x2b322d[_0x53e92d(0x103)],_0x50020f=await resolveSegmentTarget(_0x21332d,_0x15271c,_0x2b322d[_0x53e92d(0xf7)]);_0x2b322d[_0x53e92d(0xf7)]&&console[_0x53e92d(0x111)](_0x53e92d(0x152)+_0x50020f);const _0xf92564=await withSpinner(_0x53e92d(0x188)+_0x21332d+_0x53e92d(0x12f),()=>_0x130fb5['segment'][_0x53e92d(0x158)](_0x50020f),{'verbose':_0x2b322d[_0x53e92d(0xf7)]}),_0x56caa3=_0xf92564['data'];_0x2b322d[_0x53e92d(0xf7)]&&(console[_0x53e92d(0x111)](_0x53e92d(0xfe)+_0x56caa3[_0x53e92d(0x12e)]),console['error'](_0x53e92d(0x195)+_0x56caa3['parentId']),_0x56caa3['folderId']&&console[_0x53e92d(0x111)](_0x53e92d(0x120)+_0x56caa3['folderId']),_0x56caa3[_0x53e92d(0x101)]&&console['error'](_0x53e92d(0x193)+_0x56caa3[_0x53e92d(0x101)]));if(_0x2b322d['web']){if(_0x56caa3[_0x53e92d(0x12e)]===_0x53e92d(0x16f))return console[_0x53e92d(0x111)](_0x53e92d(0x12a)),0x1;if(_0x56caa3[_0x53e92d(0x12e)]===_0x53e92d(0x159))return console[_0x53e92d(0x111)](_0x53e92d(0x18e)),console['error'](_0x53e92d(0xfc)),0x1;if(!_0x56caa3['segmentId'])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x53e92d(0x10c));const _0x546d07=getConsoleNextUrl(_0x2b322d[_0x53e92d(0xfd)],_0x53e92d(0x17d)+_0x56caa3[_0x53e92d(0x16b)]+_0x53e92d(0x17a)+_0x56caa3[_0x53e92d(0x101)]);return console[_0x53e92d(0x111)](a35_0x4e64e3['green']('βœ”')+_0x53e92d(0x127)+a35_0x4e64e3[_0x53e92d(0x132)](_0x546d07)),openBrowser(_0x546d07),0x0;}if(_0x56caa3['type']===_0x53e92d(0x16f)){if(!_0x56caa3['folderId'])throw new SDKError(ErrorCode[_0x53e92d(0x192)],'Folder\x20ID\x20missing\x20from\x20resolved\x20path');const _0x1c7b1f=await withSpinner(_0x53e92d(0x150),()=>_0x130fb5[_0x53e92d(0x12c)][_0x53e92d(0x147)](_0x56caa3[_0x53e92d(0x197)]),{'verbose':_0x2b322d['verbose']});await handleSingleObjectOutput(_0x1c7b1f[_0x53e92d(0x167)],_0x2b322d);}else{if(_0x56caa3[_0x53e92d(0x12e)]===_0x53e92d(0x12c)){if(!_0x56caa3['segmentId'])throw new SDKError(ErrorCode[_0x53e92d(0x130)],_0x53e92d(0x10c));const _0x52504d=await withSpinner('Fetching\x20segment\x20details...',()=>_0x130fb5[_0x53e92d(0x12c)][_0x53e92d(0x157)](_0x56caa3[_0x53e92d(0x16b)],_0x56caa3[_0x53e92d(0x101)]),{'verbose':_0x2b322d['verbose']}),_0x1d40b5=getConsoleNextUrl(_0x2b322d[_0x53e92d(0xfd)],_0x53e92d(0x17d)+_0x56caa3[_0x53e92d(0x16b)]+_0x53e92d(0x17a)+_0x56caa3[_0x53e92d(0x101)]),_0x19bcbf=_0x52504d[_0x53e92d(0x167)];_0x19bcbf[_0x53e92d(0x15f)]=_0x1d40b5,await handleSingleObjectOutput(_0x19bcbf,_0x2b322d);}else return console[_0x53e92d(0x111)](_0x53e92d(0xfa)),console['error'](_0x53e92d(0x176)),0x1;}return 0x0;}catch(_0x31933c){if(_0x31933c instanceof SDKError)return console[_0x53e92d(0x111)](_0x53e92d(0x13f)+_0x31933c[_0x53e92d(0x116)]),_0x31933c['cause']&&console[_0x53e92d(0x111)](_0x53e92d(0x175)+_0x31933c[_0x53e92d(0x140)]),0x1;throw _0x31933c;}}}export const SegmentInfoCommand=SegmentViewCommand;export class SegmentDescCommand extends BaseCommand{['name']=a35_0x29f1cb(0xf5);[a35_0x29f1cb(0x181)]=a35_0x29f1cb(0x125);async[a35_0x29f1cb(0x191)](_0x1dfb1c){const _0x3d5b80=a35_0x29f1cb,{options:_0x3a8749,args:_0x271f1d,tdx:_0xbad1e3}=_0x1dfb1c,_0xf89302=_0x271f1d[0x0];if(!_0xf89302)return console[_0x3d5b80(0x111)](_0x3d5b80(0x18d)),console[_0x3d5b80(0x111)](_0x3d5b80(0x138)),console['error'](_0x3d5b80(0xfb)),console[_0x3d5b80(0x111)](_0x3d5b80(0x162)),console[_0x3d5b80(0x111)](_0x3d5b80(0x15d)),console['error']('\x20\x20tdx\x20sg\x20desc\x20segments/my-audience/premium-users.yml'),0x1;try{const _0x2f4f7d=_0x3a8749[_0x3d5b80(0x103)],_0x1a84ac=await resolveSegmentTarget(_0xf89302,_0x2f4f7d,_0x3a8749[_0x3d5b80(0xf7)]);_0x3a8749[_0x3d5b80(0xf7)]&&console[_0x3d5b80(0x111)](_0x3d5b80(0x152)+_0x1a84ac);const _0x52d050=await withSpinner(_0x3d5b80(0x188)+_0xf89302+_0x3d5b80(0x12f),()=>_0xbad1e3[_0x3d5b80(0x12c)][_0x3d5b80(0x158)](_0x1a84ac),{'verbose':_0x3a8749[_0x3d5b80(0xf7)]}),_0x4a77f8=_0x52d050[_0x3d5b80(0x167)];_0x3a8749[_0x3d5b80(0xf7)]&&(console[_0x3d5b80(0x111)](_0x3d5b80(0xfe)+_0x4a77f8[_0x3d5b80(0x12e)]),console[_0x3d5b80(0x111)](_0x3d5b80(0x195)+_0x4a77f8[_0x3d5b80(0x16b)]));if(_0x4a77f8[_0x3d5b80(0x12e)]==='folder')return console[_0x3d5b80(0x111)]('Error:\x20Cannot\x20show\x20schema\x20for\x20a\x20folder.'),console['error'](_0x3d5b80(0x185)),0x1;if(_0x4a77f8[_0x3d5b80(0x12e)]==='parent')return console[_0x3d5b80(0x111)]('Error:\x20Cannot\x20show\x20schema\x20for\x20parent\x20segment\x20with\x20this\x20command.'),console[_0x3d5b80(0x111)](_0x3d5b80(0x122)),0x1;if(!_0x4a77f8['segmentId'])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x3d5b80(0x10c));const _0x51e48e=await withSpinner(_0x3d5b80(0x10e),()=>_0xbad1e3[_0x3d5b80(0x12c)][_0x3d5b80(0x10b)](_0x4a77f8[_0x3d5b80(0x16b)],_0x4a77f8[_0x3d5b80(0x101)]),{'verbose':_0x3a8749[_0x3d5b80(0xf7)]}),_0x467962=_0x51e48e['data'],_0xeb260=await executeSchemaQuery(_0x467962,_0xbad1e3,_0x3a8749);return await handleQueryOutput(_0xeb260,_0x3a8749),0x0;}catch(_0x4627b9){if(_0x4627b9 instanceof SDKError)return console[_0x3d5b80(0x111)]('Error:\x20'+_0x4627b9[_0x3d5b80(0x116)]),_0x4627b9['cause']&&console['error'](_0x3d5b80(0x175)+_0x4627b9['cause']),0x1;throw _0x4627b9;}}}
@@ -1 +1 @@
1
- function a36_0x2dfe(){const _0x57267d=['Parent\x20path:\x20','createSegment','Examples:','\x20\x20\x20Path:\x20','invisible','Resolving\x20parent\x20segment\x20\x27','resolveFolderId','ruleFile','\x27\x20with\x20ID:\x20','24666inPven','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','segment','Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]','data','noCountPopulation','folder','525bdleLe','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','Segment\x20name:\x20','5840124BBQaMg','12786dLfKIv','⚠\x20Deprecation\x20warning:\x20`segment\x20create`\x20is\x20deprecated.','Resolved\x20relative\x20path\x20to:\x20','121bZBHbL','13tCYxVA','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27','segments','Resolving\x20folder\x20\x27','Resolved\x20folder\x20ID:\x20','length','Parent:\x20','12WbkGJd','336123sUsOyH','\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','kind','206020WyrmJw','error','Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)','8WtTHkn','description','Target\x20path:\x20','parent','name','site','Site:\x20','88ikUuXh','115011kDnBJb','verbose','rule','401385qtephI','execute','folderId','Resolving\x20folder\x20path\x20\x27','type','resolvePathToResource','segmentPath','\x27...','yellow'];a36_0x2dfe=function(){return _0x57267d;};return a36_0x2dfe();}const a36_0x2e5a9d=a36_0x5d8b;function a36_0x5d8b(_0x2da479,_0x4fa4b0){_0x2da479=_0x2da479-0x14d;const _0x2dfe02=a36_0x2dfe();let _0x5d8bc0=_0x2dfe02[_0x2da479];return _0x5d8bc0;}(function(_0x4e5786,_0x1e5790){const _0x4d2942=a36_0x5d8b,_0x14d9bd=_0x4e5786();while(!![]){try{const _0x4a1d77=parseInt(_0x4d2942(0x181))/0x1+parseInt(_0x4d2942(0x175))/0x2*(-parseInt(_0x4d2942(0x180))/0x3)+parseInt(_0x4d2942(0x14d))/0x4*(parseInt(_0x4d2942(0x158))/0x5)+-parseInt(_0x4d2942(0x16a))/0x6*(-parseInt(_0x4d2942(0x171))/0x7)+parseInt(_0x4d2942(0x154))/0x8*(parseInt(_0x4d2942(0x155))/0x9)+-parseInt(_0x4d2942(0x184))/0xa*(parseInt(_0x4d2942(0x178))/0xb)+-parseInt(_0x4d2942(0x174))/0xc*(parseInt(_0x4d2942(0x179))/0xd);if(_0x4a1d77===_0x1e5790)break;else _0x14d9bd['push'](_0x14d9bd['shift']());}catch(_0x950f8d){_0x14d9bd['push'](_0x14d9bd['shift']());}}}(a36_0x2dfe,0x3276c));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{parsePath,getParentPath,getBaseName}from'../sdk/segment/segment-path-parser.js';import a36_0x367ac7 from'chalk';export class SegmentCreateCommand extends BaseCommand{[a36_0x2e5a9d(0x151)]='segment:create';[a36_0x2e5a9d(0x14e)]='Create\x20child\x20segment\x20with\x20filtering\x20rules';async[a36_0x2e5a9d(0x159)](_0x12d6e3){const _0x5840ee=a36_0x2e5a9d;console[_0x5840ee(0x185)](a36_0x367ac7['yellow'](_0x5840ee(0x176))),console[_0x5840ee(0x185)](a36_0x367ac7[_0x5840ee(0x160)](_0x5840ee(0x172)));const {options:_0x1c8526,args:_0x44273f,tdx:_0x507c05}=_0x12d6e3,_0x1d84bb=_0x1c8526;if(_0x44273f[_0x5840ee(0x17e)]===0x0)return console['error'](_0x5840ee(0x16b)),console['error']('Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]'),console['error'](_0x5840ee(0x163)),console['error']('\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27'),console[_0x5840ee(0x185)](_0x5840ee(0x17a)),console['error'](_0x5840ee(0x182)),0x1;const _0x409d07=_0x44273f[0x0],_0x53b482=_0x1c8526[_0x5840ee(0x15e)];let _0x140724=_0x409d07;_0x53b482&&!_0x409d07['includes']('/')&&(_0x140724=_0x53b482+'/'+_0x409d07,_0x1d84bb[_0x5840ee(0x156)]&&console[_0x5840ee(0x185)](_0x5840ee(0x177)+_0x140724));const _0x29aae9=parsePath(_0x140724);if(_0x29aae9['segments'][_0x5840ee(0x17e)]<0x2)return console[_0x5840ee(0x185)](_0x5840ee(0x186)),console[_0x5840ee(0x185)](_0x5840ee(0x16d)),0x1;const _0x285b11=_0x29aae9['segments'][0x0],_0x275a20=getBaseName(_0x140724),_0xa8e262=getParentPath(_0x140724);_0x1d84bb[_0x5840ee(0x156)]&&(console[_0x5840ee(0x185)](_0x5840ee(0x153)+_0x1d84bb[_0x5840ee(0x152)]),console['error'](_0x5840ee(0x14f)+_0x140724),console[_0x5840ee(0x185)](_0x5840ee(0x17f)+_0x285b11),console[_0x5840ee(0x185)](_0x5840ee(0x173)+_0x275a20),console[_0x5840ee(0x185)](_0x5840ee(0x161)+_0xa8e262));const _0x108bc7=await withSpinner(_0x5840ee(0x166)+_0x285b11+'\x27...',()=>_0x507c05[_0x5840ee(0x16c)]['resolveParentId'](_0x285b11),{'verbose':_0x1d84bb[_0x5840ee(0x156)]}),_0x3281ed=_0x108bc7[_0x5840ee(0x16e)];let _0x43b87e;if(_0x29aae9[_0x5840ee(0x17b)][_0x5840ee(0x17e)]>0x2){const _0x1bfd7c=await withSpinner(_0x5840ee(0x15b)+_0xa8e262+_0x5840ee(0x15f),()=>_0x507c05[_0x5840ee(0x16c)][_0x5840ee(0x15d)](_0xa8e262),{'verbose':_0x1d84bb['verbose']}),_0x579a6b=_0x1bfd7c[_0x5840ee(0x16e)];if(_0x579a6b[_0x5840ee(0x15c)]!=='folder'&&_0x579a6b[_0x5840ee(0x15c)]!==_0x5840ee(0x150))return console[_0x5840ee(0x185)]('Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.'),0x1;_0x43b87e=_0x579a6b[_0x5840ee(0x15a)];}else{if(_0x1d84bb[_0x5840ee(0x170)]){const _0x546d13=await withSpinner(_0x5840ee(0x17c)+_0x1d84bb[_0x5840ee(0x170)]+'\x27...',()=>_0x507c05[_0x5840ee(0x16c)][_0x5840ee(0x167)](_0x3281ed,_0x1d84bb[_0x5840ee(0x170)]),{'verbose':_0x1d84bb[_0x5840ee(0x156)]});_0x43b87e=_0x546d13['data'];}}_0x1d84bb[_0x5840ee(0x156)]&&_0x43b87e&&console[_0x5840ee(0x185)](_0x5840ee(0x17d)+_0x43b87e);const _0x403d5e=await loadJSONFromOptions(_0x1d84bb[_0x5840ee(0x157)],_0x1d84bb[_0x5840ee(0x168)]),_0xccaf35={'name':_0x275a20,'description':_0x1d84bb[_0x5840ee(0x14e)],'rule':_0x403d5e,'kind':_0x1d84bb[_0x5840ee(0x183)]!==undefined?parseInt(_0x1d84bb[_0x5840ee(0x183)],0xa):undefined,'isVisible':_0x1d84bb[_0x5840ee(0x165)]?![]:undefined,'segmentFolderId':_0x43b87e,'countPopulation':_0x1d84bb[_0x5840ee(0x16f)]?![]:undefined},_0x2bbbed=await withSpinner('Creating\x20segment\x20\x27'+_0x275a20+_0x5840ee(0x15f),()=>_0x507c05[_0x5840ee(0x16c)][_0x5840ee(0x162)](_0x3281ed,_0xccaf35),{'verbose':_0x1d84bb[_0x5840ee(0x156)]}),_0x784dde=_0x2bbbed[_0x5840ee(0x16e)];return console[_0x5840ee(0x185)]('βœ”\x20Created\x20segment\x20\x27'+_0x784dde[_0x5840ee(0x151)]+_0x5840ee(0x169)+_0x784dde['id']),_0x140724!==_0x409d07&&console['error'](_0x5840ee(0x164)+_0x140724),await handleSDKOutput([_0x784dde],_0x1d84bb),0x0;}}
1
+ const a36_0x4f3780=a36_0x2ea9;(function(_0x152d18,_0x927819){const _0x257ecb=a36_0x2ea9,_0x3e286f=_0x152d18();while(!![]){try{const _0x320ffc=-parseInt(_0x257ecb(0x129))/0x1*(parseInt(_0x257ecb(0x10c))/0x2)+parseInt(_0x257ecb(0x117))/0x3+parseInt(_0x257ecb(0x124))/0x4*(-parseInt(_0x257ecb(0x114))/0x5)+-parseInt(_0x257ecb(0x12c))/0x6*(-parseInt(_0x257ecb(0x137))/0x7)+-parseInt(_0x257ecb(0x11f))/0x8*(parseInt(_0x257ecb(0x13a))/0x9)+parseInt(_0x257ecb(0x128))/0xa+parseInt(_0x257ecb(0x121))/0xb;if(_0x320ffc===_0x927819)break;else _0x3e286f['push'](_0x3e286f['shift']());}catch(_0x544930){_0x3e286f['push'](_0x3e286f['shift']());}}}(a36_0x30d5,0xde19c));function a36_0x2ea9(_0xb3753c,_0x394ba0){_0xb3753c=_0xb3753c-0x10a;const _0x30d50f=a36_0x30d5();let _0x2ea911=_0x30d50f[_0xb3753c];return _0x2ea911;}import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';function a36_0x30d5(){const _0x17a904=['Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)','resolveFolderId','17044zSSGzB','\x27\x20with\x20ID:\x20','includes','site','error','length','folderId','Segment\x20name:\x20','1508505FfbIjh','segments','Target\x20path:\x20','1219740vPPYUK','execute','description','resolvePathToResource','\x27...','invisible','βœ”\x20Created\x20segment\x20\x27','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27','1472104LllaDR','\x20\x20\x20Path:\x20','4187172UxeYcI','name','type','4HkBZuk','Parent:\x20','rule','segment:create','8857180pSIpcf','103cBUYNn','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','kind','12cFdSba','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','data','segmentPath','segment','folder','Resolving\x20folder\x20path\x20\x27','\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','parent','Site:\x20','Resolving\x20folder\x20\x27','4677071xDmmUM','verbose','Resolved\x20relative\x20path\x20to:\x20','45nGjZUl','Examples:','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27','Creating\x20segment\x20\x27'];a36_0x30d5=function(){return _0x17a904;};return a36_0x30d5();}import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{parsePath,getParentPath,getBaseName}from'../sdk/segment/segment-path-parser.js';import a36_0x3dd5dd from'chalk';export class SegmentCreateCommand extends BaseCommand{[a36_0x4f3780(0x122)]=a36_0x4f3780(0x127);[a36_0x4f3780(0x119)]='Create\x20child\x20segment\x20with\x20filtering\x20rules';async[a36_0x4f3780(0x118)](_0x449d95){const _0xe96fd7=a36_0x4f3780;console[_0xe96fd7(0x110)](a36_0x3dd5dd['yellow']('⚠\x20Deprecation\x20warning:\x20`segment\x20create`\x20is\x20deprecated.')),console[_0xe96fd7(0x110)](a36_0x3dd5dd['yellow'](_0xe96fd7(0x12d)));const {options:_0x3d4613,args:_0x355d4e,tdx:_0x341f1d}=_0x449d95,_0xe08f53=_0x3d4613;if(_0x355d4e[_0xe96fd7(0x111)]===0x0)return console['error'](_0xe96fd7(0x12a)),console[_0xe96fd7(0x110)]('Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]'),console[_0xe96fd7(0x110)](_0xe96fd7(0x13b)),console[_0xe96fd7(0x110)](_0xe96fd7(0x11e)),console[_0xe96fd7(0x110)](_0xe96fd7(0x13c)),console[_0xe96fd7(0x110)](_0xe96fd7(0x133)),0x1;const _0x574884=_0x355d4e[0x0],_0x33e313=_0x3d4613[_0xe96fd7(0x12f)];let _0x132f05=_0x574884;_0x33e313&&!_0x574884[_0xe96fd7(0x10e)]('/')&&(_0x132f05=_0x33e313+'/'+_0x574884,_0xe08f53[_0xe96fd7(0x138)]&&console[_0xe96fd7(0x110)](_0xe96fd7(0x139)+_0x132f05));const _0x31e4fa=parsePath(_0x132f05);if(_0x31e4fa[_0xe96fd7(0x115)]['length']<0x2)return console['error'](_0xe96fd7(0x10a)),console[_0xe96fd7(0x110)]('Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]'),0x1;const _0x58e895=_0x31e4fa[_0xe96fd7(0x115)][0x0],_0x3b0e32=getBaseName(_0x132f05),_0x5d48ca=getParentPath(_0x132f05);_0xe08f53['verbose']&&(console[_0xe96fd7(0x110)](_0xe96fd7(0x135)+_0xe08f53[_0xe96fd7(0x10f)]),console['error'](_0xe96fd7(0x116)+_0x132f05),console[_0xe96fd7(0x110)](_0xe96fd7(0x125)+_0x58e895),console[_0xe96fd7(0x110)](_0xe96fd7(0x113)+_0x3b0e32),console['error']('Parent\x20path:\x20'+_0x5d48ca));const _0x4c2ee9=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x58e895+_0xe96fd7(0x11b),()=>_0x341f1d[_0xe96fd7(0x130)]['resolveParentId'](_0x58e895),{'verbose':_0xe08f53['verbose']}),_0x4cc953=_0x4c2ee9[_0xe96fd7(0x12e)];let _0x262c50;if(_0x31e4fa[_0xe96fd7(0x115)][_0xe96fd7(0x111)]>0x2){const _0x5e36b2=await withSpinner(_0xe96fd7(0x132)+_0x5d48ca+_0xe96fd7(0x11b),()=>_0x341f1d[_0xe96fd7(0x130)][_0xe96fd7(0x11a)](_0x5d48ca),{'verbose':_0xe08f53[_0xe96fd7(0x138)]}),_0x50e17f=_0x5e36b2[_0xe96fd7(0x12e)];if(_0x50e17f[_0xe96fd7(0x123)]!=='folder'&&_0x50e17f['type']!==_0xe96fd7(0x134))return console[_0xe96fd7(0x110)]('Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.'),0x1;_0x262c50=_0x50e17f[_0xe96fd7(0x112)];}else{if(_0xe08f53[_0xe96fd7(0x131)]){const _0x32daa4=await withSpinner(_0xe96fd7(0x136)+_0xe08f53['folder']+_0xe96fd7(0x11b),()=>_0x341f1d[_0xe96fd7(0x130)][_0xe96fd7(0x10b)](_0x4cc953,_0xe08f53['folder']),{'verbose':_0xe08f53[_0xe96fd7(0x138)]});_0x262c50=_0x32daa4[_0xe96fd7(0x12e)];}}_0xe08f53['verbose']&&_0x262c50&&console['error']('Resolved\x20folder\x20ID:\x20'+_0x262c50);const _0x144b1e=await loadJSONFromOptions(_0xe08f53[_0xe96fd7(0x126)],_0xe08f53['ruleFile']),_0x8c610e={'name':_0x3b0e32,'description':_0xe08f53[_0xe96fd7(0x119)],'rule':_0x144b1e,'kind':_0xe08f53['kind']!==undefined?parseInt(_0xe08f53[_0xe96fd7(0x12b)],0xa):undefined,'isVisible':_0xe08f53[_0xe96fd7(0x11c)]?![]:undefined,'segmentFolderId':_0x262c50,'countPopulation':_0xe08f53['noCountPopulation']?![]:undefined},_0x283847=await withSpinner(_0xe96fd7(0x13d)+_0x3b0e32+_0xe96fd7(0x11b),()=>_0x341f1d[_0xe96fd7(0x130)]['createSegment'](_0x4cc953,_0x8c610e),{'verbose':_0xe08f53[_0xe96fd7(0x138)]}),_0x117283=_0x283847['data'];return console[_0xe96fd7(0x110)](_0xe96fd7(0x11d)+_0x117283['name']+_0xe96fd7(0x10d)+_0x117283['id']),_0x132f05!==_0x574884&&console[_0xe96fd7(0x110)](_0xe96fd7(0x120)+_0x132f05),await handleSDKOutput([_0x117283],_0xe08f53),0x0;}}
@@ -1 +1 @@
1
- const a37_0x1ec996=a37_0x36c5;(function(_0x5b3c48,_0xeb7a40){const _0x48ea14=a37_0x36c5,_0x1e6527=_0x5b3c48();while(!![]){try{const _0x4909d2=parseInt(_0x48ea14(0xe3))/0x1*(parseInt(_0x48ea14(0xfc))/0x2)+-parseInt(_0x48ea14(0xf9))/0x3+parseInt(_0x48ea14(0xf1))/0x4*(parseInt(_0x48ea14(0xea))/0x5)+-parseInt(_0x48ea14(0xf3))/0x6+parseInt(_0x48ea14(0xfd))/0x7*(-parseInt(_0x48ea14(0xf0))/0x8)+parseInt(_0x48ea14(0xee))/0x9+-parseInt(_0x48ea14(0xfa))/0xa*(-parseInt(_0x48ea14(0xfb))/0xb);if(_0x4909d2===_0xeb7a40)break;else _0x1e6527['push'](_0x1e6527['shift']());}catch(_0x2a3191){_0x1e6527['push'](_0x1e6527['shift']());}}}(a37_0x1b54,0x778fd));function a37_0x1b54(){const _0x3c83d1=['parentSegment','List\x20available\x20fields\x20for\x20segmentation','2220129AgxyiT','segment','10712USFUpP','3193880KIgaim','βœ”\x20Found\x20','4710180AvSnyG','\x27...','jsonl','Usage:\x20tdx\x20segment\x20fields\x20<parent_name>','data','Parent\x20segment:\x20','859185rJwKtM','4070nFfHAO','23485DFAGJL','315478uHICvh','4319QJyGny','length','execute','name','3rkzqGc','site','Error:\x20Parent\x20segment\x20name\x20is\x20required','verbose','error','json','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','5HtYkCE','description'];a37_0x1b54=function(){return _0x3c83d1;};return a37_0x1b54();}import{BaseCommand}from'./command.js';function a37_0x36c5(_0x4e8d67,_0x3e25a7){_0x4e8d67=_0x4e8d67-0xe0;const _0x1b54ca=a37_0x1b54();let _0x36c541=_0x1b54ca[_0x4e8d67];return _0x36c541;}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_0x1ec996(0xe2)]='segment:fields';[a37_0x1ec996(0xeb)]=a37_0x1ec996(0xed);async[a37_0x1ec996(0xe1)](_0x3ab018){const _0x17826d=a37_0x1ec996,{options:_0x53e2e0,args:_0x34d31e,tdx:_0x332bd4}=_0x3ab018,_0x443d43=_0x34d31e[0x0]||_0x53e2e0[_0x17826d(0xec)];if(!_0x443d43)return console[_0x17826d(0xe7)](_0x17826d(0xe5)),console[_0x17826d(0xe7)](_0x17826d(0xf6)),console[_0x17826d(0xe7)](_0x17826d(0xe9)),0x1;_0x53e2e0[_0x17826d(0xe6)]&&(console[_0x17826d(0xe7)]('Site:\x20'+_0x53e2e0[_0x17826d(0xe4)]),console[_0x17826d(0xe7)](_0x17826d(0xf8)+_0x443d43));const _0xbdca83=await withSpinner('Listing\x20fields\x20for\x20\x27'+_0x443d43+_0x17826d(0xf4),()=>_0x332bd4[_0x17826d(0xef)]['listFields'](_0x443d43),{'verbose':_0x53e2e0['verbose']}),_0x3283e4=_0xbdca83[_0x17826d(0xf7)];console[_0x17826d(0xe7)](_0x17826d(0xf2)+_0x3283e4[_0x17826d(0xe0)]+'\x20field'+(_0x3283e4[_0x17826d(0xe0)]!==0x1?'s':''));if(_0x53e2e0[_0x17826d(0xe8)]||_0x53e2e0[_0x17826d(0xf5)])return await handleSDKOutput(_0x3283e4,_0x53e2e0),0x0;return displayFieldsHumanReadable(_0x3283e4,_0x443d43),0x0;}}
1
+ const a37_0x213ad5=a37_0x5309;(function(_0x3028b4,_0x3f03c6){const _0xf473f0=a37_0x5309,_0x35bf6f=_0x3028b4();while(!![]){try{const _0x36970d=parseInt(_0xf473f0(0x8a))/0x1*(-parseInt(_0xf473f0(0x82))/0x2)+-parseInt(_0xf473f0(0x70))/0x3*(-parseInt(_0xf473f0(0x71))/0x4)+parseInt(_0xf473f0(0x89))/0x5*(-parseInt(_0xf473f0(0x74))/0x6)+parseInt(_0xf473f0(0x7d))/0x7*(parseInt(_0xf473f0(0x7a))/0x8)+-parseInt(_0xf473f0(0x8b))/0x9*(parseInt(_0xf473f0(0x80))/0xa)+parseInt(_0xf473f0(0x87))/0xb+parseInt(_0xf473f0(0x84))/0xc;if(_0x36970d===_0x3f03c6)break;else _0x35bf6f['push'](_0x35bf6f['shift']());}catch(_0x52cf20){_0x35bf6f['push'](_0x35bf6f['shift']());}}}(a37_0x260b,0xda018));import{BaseCommand}from'./command.js';function a37_0x5309(_0x437c09,_0x4184aa){_0x437c09=_0x437c09-0x6e;const _0x260bd5=a37_0x260b();let _0x530956=_0x260bd5[_0x437c09];return _0x530956;}function a37_0x260b(){const _0x4cd3ef=['\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','3crcciw','944792WVATQi','error','Error:\x20Parent\x20segment\x20name\x20is\x20required','1704PyFYIi','site','List\x20available\x20fields\x20for\x20segmentation','βœ”\x20Found\x20','data','jsonl','31792sygvfq','json','segment:fields','581IxymKr','Parent\x20segment:\x20','Listing\x20fields\x20for\x20\x27','10rfUUXL','\x27...','70VDqIhT','description','33210888YXBpNi','verbose','length','18083813EgPXZA','\x20field','30110JcJJwk','44777qXnnaX','7264818qSnJEn','Usage:\x20tdx\x20segment\x20fields\x20<parent_name>','name'];a37_0x260b=function(){return _0x4cd3ef;};return a37_0x260b();}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_0x213ad5(0x6e)]=a37_0x213ad5(0x7c);[a37_0x213ad5(0x83)]=a37_0x213ad5(0x76);async['execute'](_0x1fb9ec){const _0x16a8f1=a37_0x213ad5,{options:_0xf92578,args:_0x188d1c,tdx:_0x26fa16}=_0x1fb9ec,_0x317dff=_0x188d1c[0x0]||_0xf92578['parentSegment'];if(!_0x317dff)return console[_0x16a8f1(0x72)](_0x16a8f1(0x73)),console['error'](_0x16a8f1(0x8c)),console[_0x16a8f1(0x72)](_0x16a8f1(0x6f)),0x1;_0xf92578[_0x16a8f1(0x85)]&&(console[_0x16a8f1(0x72)]('Site:\x20'+_0xf92578[_0x16a8f1(0x75)]),console[_0x16a8f1(0x72)](_0x16a8f1(0x7e)+_0x317dff));const _0x4abcd2=await withSpinner(_0x16a8f1(0x7f)+_0x317dff+_0x16a8f1(0x81),()=>_0x26fa16['segment']['listFields'](_0x317dff),{'verbose':_0xf92578['verbose']}),_0x4f20fc=_0x4abcd2[_0x16a8f1(0x78)];console['error'](_0x16a8f1(0x77)+_0x4f20fc['length']+_0x16a8f1(0x88)+(_0x4f20fc[_0x16a8f1(0x86)]!==0x1?'s':''));if(_0xf92578[_0x16a8f1(0x7b)]||_0xf92578[_0x16a8f1(0x79)])return await handleSDKOutput(_0x4f20fc,_0xf92578),0x0;return displayFieldsHumanReadable(_0x4f20fc,_0x317dff),0x0;}}
@@ -1 +1 @@
1
- const a38_0x411cac=a38_0x1899;(function(_0x179761,_0x2e724b){const _0x2803ff=a38_0x1899,_0x1194f6=_0x179761();while(!![]){try{const _0x973476=parseInt(_0x2803ff(0xed))/0x1*(-parseInt(_0x2803ff(0x126))/0x2)+-parseInt(_0x2803ff(0x113))/0x3+-parseInt(_0x2803ff(0x129))/0x4+parseInt(_0x2803ff(0x10a))/0x5*(parseInt(_0x2803ff(0xfb))/0x6)+-parseInt(_0x2803ff(0xf5))/0x7+-parseInt(_0x2803ff(0xfc))/0x8+-parseInt(_0x2803ff(0xf6))/0x9*(-parseInt(_0x2803ff(0xeb))/0xa);if(_0x973476===_0x2e724b)break;else _0x1194f6['push'](_0x1194f6['shift']());}catch(_0x3d4d80){_0x1194f6['push'](_0x1194f6['shift']());}}}(a38_0xf549,0x8dcd7));function a38_0x1899(_0x16d4a0,_0x45d102){_0x16d4a0=_0x16d4a0-0xe9;const _0xf5495b=a38_0xf549();let _0x189960=_0xf5495b[_0x16d4a0];return _0x189960;}import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';function a38_0xf549(){const _0x4bbec9=['Error:\x20','93430CbZJfG','file','isNew','dim','diff','length','session','data','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file','2889207wAeMTr','resourceName','\x20\x20Target:\x20','parent_segment','execute','βœ”\x20Context\x20set:\x20','Target\x20resource:\x20','segments','dryRun','message','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','error','Usage:\x20tdx\x20sg\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20(requires\x20context\x20or\x20tdx.json)','activations','Pulling\x20segments\x20from\x20\x27','dirname','\x0aChanges\x20to\x20\x27','\x20files\x20to\x20','No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27','6452qbngSL','Write\x20','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','1449280uvFSfu','filter','cyan','type','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','\x20=\x20','errorCode','counts','setPhase','content','βœ”\x20Pulled\x20','Parent\x20segment:\x20','\x20\x20🎯\x20','targetDir','20893910qdbgad','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','54cXUEGK','utf-8','\x20unchanged\x20files','Aborted.','\x20changed\x20files','parentName','files','hasChanges','278019yatevv','9FnynVU','journeys','helpText','absolutePath','Site:\x20','114rrfFbM','2594336DGhtmX','relativePath','\x20journeys','yellow','journeyVersions','green','-\x20no\x20files\x20written','Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files','repeat','pullSegments','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent','segment','verbose'];a38_0xf549=function(){return _0x4bbec9;};return a38_0xf549();}import{saveSessionContext}from'../core/session.js';import a38_0x351079 from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';import a38_0x3bab0b from'path';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';export{buildFolderIdToPathMap as buildFolderPathMap}from'../sdk/segment/resolution-context.js';export class SegmentPullCommand extends BaseCommand{['name']='segment:pull';['description']=a38_0x411cac(0x103);async[a38_0x411cac(0x117)](_0x4c5071){const _0x1d50ee=a38_0x411cac,{options:_0x517908,args:_0x529982,tdx:_0x4bc378}=_0x4c5071,_0x23017f=_0x517908,_0x26a68e=await resolveTarget({'arg':_0x529982[0x0],'contextParent':_0x517908['parentSegment'],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x26a68e))return _0x26a68e[_0x1d50ee(0x12f)]==='no_parent'?(console[_0x1d50ee(0x11e)](a38_0x351079[_0x1d50ee(0xff)](_0x1d50ee(0x11d))),console[_0x1d50ee(0x11e)](_0x1d50ee(0x11f)),console['error'](_0x1d50ee(0x106)),console[_0x1d50ee(0x11e)](_0x1d50ee(0x112))):(console[_0x1d50ee(0x11e)](a38_0x351079['red'](_0x1d50ee(0x109)+_0x26a68e[_0x1d50ee(0x11c)]+'\x0a')),_0x26a68e[_0x1d50ee(0xf8)]&&console[_0x1d50ee(0x11e)](a38_0x351079[_0x1d50ee(0x12b)](_0x26a68e[_0x1d50ee(0xf8)]))),0x1;const _0x32fcee=_0x26a68e['parentName'],_0x2c8d7e=_0x26a68e['targetDir'],_0x234ef2=_0x26a68e[_0x1d50ee(0x12c)]===_0x1d50ee(0x10b)?_0x26a68e[_0x1d50ee(0x114)]:undefined;_0x23017f[_0x1d50ee(0x108)]&&(console[_0x1d50ee(0x11e)](_0x1d50ee(0xfa)+_0x23017f['site']),console['error'](_0x1d50ee(0x134)+_0x32fcee),_0x234ef2&&console[_0x1d50ee(0x11e)](_0x1d50ee(0x119)+_0x234ef2));const _0x481da5=await withProgressSpinner(_0x1d50ee(0x121)+_0x32fcee+'\x27...',_0x39d837=>_0x4bc378[_0x1d50ee(0x107)][_0x1d50ee(0x105)](_0x32fcee,{'targetDir':_0x2c8d7e,'targetResourceName':_0x234ef2,'verbose':_0x23017f[_0x1d50ee(0x108)],'progress':{'update':_0x1a077e=>{const _0x12606a=_0x1d50ee;_0x39d837[_0x12606a(0x131)](_0x1a077e),_0x23017f['verbose']&&console['error']('\x20\x20'+_0x1a077e);}}}),{'verbose':_0x23017f['verbose']}),_0x346e37=_0x481da5[_0x1d50ee(0x111)];if(_0x346e37[_0x1d50ee(0x130)][_0x1d50ee(0x11a)]===0x0&&_0x346e37[_0x1d50ee(0x130)][_0x1d50ee(0xf7)]===0x0)return console['error'](a38_0x351079[_0x1d50ee(0xff)](_0x1d50ee(0x125)+_0x346e37[_0x1d50ee(0xf2)]+'\x27')),0x0;const _0x45621f=_0x346e37[_0x1d50ee(0xf3)]['filter'](_0x244937=>_0x244937[_0x1d50ee(0x10c)]),_0xa0f544=_0x346e37[_0x1d50ee(0xf3)][_0x1d50ee(0x12a)](_0x26afb4=>!_0x26afb4[_0x1d50ee(0x10c)]&&_0x26afb4[_0x1d50ee(0xf4)]),_0x1275cc=_0x346e37[_0x1d50ee(0xf3)][_0x1d50ee(0x12a)](_0x5289c2=>!_0x5289c2[_0x1d50ee(0x10c)]&&!_0x5289c2[_0x1d50ee(0xf4)]);console[_0x1d50ee(0x11e)]('\x0aPull\x20summary\x20for\x20\x27'+_0x346e37[_0x1d50ee(0xf2)]+'\x27:'),console[_0x1d50ee(0x11e)](_0x1d50ee(0xe9)+a38_0x351079[_0x1d50ee(0x12b)](_0x346e37[_0x1d50ee(0x130)][_0x1d50ee(0x11a)]+'\x20segments')+'\x20with\x20'+a38_0x351079[_0x1d50ee(0x12b)](_0x346e37[_0x1d50ee(0x130)][_0x1d50ee(0x120)]+'\x20activations'));if(_0x346e37['counts'][_0x1d50ee(0xf7)]>0x0){const _0x4e339b=_0x346e37[_0x1d50ee(0x130)][_0x1d50ee(0x100)]>_0x346e37[_0x1d50ee(0x130)][_0x1d50ee(0xf7)]?'\x20('+_0x346e37[_0x1d50ee(0x130)]['journeyVersions']+'\x20versions)':'';console[_0x1d50ee(0x11e)]('\x20\x20πŸ—ΊοΈ\x20\x20'+a38_0x351079[_0x1d50ee(0x12b)](_0x346e37['counts']['journeys']+_0x1d50ee(0xfe))+a38_0x351079[_0x1d50ee(0x10d)](_0x4e339b));}console[_0x1d50ee(0x11e)]('\x20\x20'+a38_0x351079[_0x1d50ee(0x101)]('+\x20'+_0x45621f['length']+'\x20new\x20files')),console['error']('\x20\x20'+a38_0x351079[_0x1d50ee(0xff)]('~\x20'+_0xa0f544[_0x1d50ee(0x10f)]+_0x1d50ee(0xf1))),console['error']('\x20\x20'+a38_0x351079[_0x1d50ee(0x10d)]('=\x20'+_0x1275cc[_0x1d50ee(0x10f)]+_0x1d50ee(0xef))),console[_0x1d50ee(0x11e)](_0x1d50ee(0x115)+a38_0x351079['cyan'](_0x346e37['targetDir'])+'\x0a');if(_0xa0f544['length']>0x0)for(const _0x59aad8 of _0xa0f544){console['error'](_0x1d50ee(0x123)+_0x59aad8[_0x1d50ee(0xfd)]+'\x27:'),console[_0x1d50ee(0x11e)]('─'[_0x1d50ee(0x104)](0x3c)),console['error'](_0x59aad8[_0x1d50ee(0x10e)]),console[_0x1d50ee(0x11e)]('─'[_0x1d50ee(0x104)](0x3c));}if(_0x23017f[_0x1d50ee(0x11b)])return console[_0x1d50ee(0x11e)](a38_0x351079[_0x1d50ee(0xff)](_0x1d50ee(0x12d))),0x0;if(_0x45621f[_0x1d50ee(0x10f)]===0x0&&_0xa0f544[_0x1d50ee(0x10f)]===0x0)return console[_0x1d50ee(0x11e)](a38_0x351079[_0x1d50ee(0x101)]('βœ”\x20All\x20files\x20are\x20up\x20to\x20date')),saveSessionContext({'parent_segment':_0x346e37['parentName']},_0x23017f[_0x1d50ee(0x110)]),console[_0x1d50ee(0x11e)](a38_0x351079[_0x1d50ee(0x101)](_0x1d50ee(0x118)+a38_0x351079[_0x1d50ee(0x10d)]('parent_segment')+_0x1d50ee(0x12e)+a38_0x351079[_0x1d50ee(0x12b)](_0x346e37[_0x1d50ee(0xf2)]))),0x0;if(!_0x23017f['yes']){if(!isInteractive())return console[_0x1d50ee(0x11e)](a38_0x351079['red']('\x0aError:'),_0x1d50ee(0x128)),console['error'](a38_0x351079['dim'](_0x1d50ee(0xec))),0x1;const _0x26ce86=await confirmKey(_0x1d50ee(0x127)+(_0x45621f['length']+_0xa0f544[_0x1d50ee(0x10f)])+'\x20files?');if(!_0x26ce86)return console[_0x1d50ee(0x11e)](a38_0x351079['yellow'](_0x1d50ee(0xf0)),_0x1d50ee(0x102)),0x1;}for(const _0x2c3d7d of _0x346e37['files']){if(_0x2c3d7d['isNew']||_0x2c3d7d['hasChanges']){const _0x22bcbf=a38_0x3bab0b[_0x1d50ee(0x122)](_0x2c3d7d[_0x1d50ee(0xf9)]);!existsSync(_0x22bcbf)&&mkdirSync(_0x22bcbf,{'recursive':!![]}),writeFileSync(_0x2c3d7d[_0x1d50ee(0xf9)],_0x2c3d7d[_0x1d50ee(0x132)],_0x1d50ee(0xee));}}return console[_0x1d50ee(0x11e)](a38_0x351079['green'](_0x1d50ee(0x133)+(_0x45621f[_0x1d50ee(0x10f)]+_0xa0f544[_0x1d50ee(0x10f)])+_0x1d50ee(0x124)+_0x346e37[_0x1d50ee(0xea)])),saveSessionContext({'parent_segment':_0x346e37[_0x1d50ee(0xf2)]},_0x23017f[_0x1d50ee(0x110)]),console[_0x1d50ee(0x11e)](a38_0x351079[_0x1d50ee(0x101)](_0x1d50ee(0x118)+a38_0x351079['dim'](_0x1d50ee(0x116))+_0x1d50ee(0x12e)+a38_0x351079[_0x1d50ee(0x12b)](_0x346e37['parentName']))),0x0;}}
1
+ const a38_0x3d5dd9=a38_0x5009;function a38_0x4c50(){const _0x30615a=['\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','1281501XJtVgt','content','length','yes','\x20new\x20files','\x20segments','description','type','targetDir','Pulling\x20segments\x20from\x20\x27','diff','red','\x20\x20🎯\x20','verbose','-\x20no\x20files\x20written','15VxnDGA','absolutePath','segment','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)','site','parent_segment','message','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','helpText','resourceName','Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files','repeat','βœ”\x20Context\x20set:\x20','\x20unchanged\x20files','relativePath','Target\x20resource:\x20','\x20changed\x20files','\x20files?','\x0aPull\x20summary\x20for\x20\x27','pullSegments','hasChanges','name','files','27853767QgoEqh','155414UuPqWp','filter','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','\x0aError:','green','segment:pull','\x0aChanges\x20to\x20\x27','\x20versions)','\x27...','activations','isNew','14vjQQwo','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent','dirname','no_parent','cyan','dim','segments','\x20=\x20','\x20files\x20to\x20','journeyVersions','file','1749184oZuesy','βœ”\x20Pulled\x20','parentSegment','\x20journeys','yellow','counts','Error:\x20','error','\x20with\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file','1480182VJVffd','cwd','data','session','dryRun','errorCode','7190040hyjLFQ','journeys','3168024EYHkwH','parentName','utf-8'];a38_0x4c50=function(){return _0x30615a;};return a38_0x4c50();}(function(_0x40bddc,_0x276c4d){const _0x37bfaa=a38_0x5009,_0x20d3a5=_0x40bddc();while(!![]){try{const _0x35c842=parseInt(_0x37bfaa(0x1ee))/0x1*(-parseInt(_0x37bfaa(0x1b3))/0x2)+parseInt(_0x37bfaa(0x1df))/0x3+parseInt(_0x37bfaa(0x1db))/0x4+-parseInt(_0x37bfaa(0x1d9))/0x5+parseInt(_0x37bfaa(0x1d3))/0x6*(-parseInt(_0x37bfaa(0x1be))/0x7)+-parseInt(_0x37bfaa(0x1c9))/0x8+parseInt(_0x37bfaa(0x1b2))/0x9;if(_0x35c842===_0x276c4d)break;else _0x20d3a5['push'](_0x20d3a5['shift']());}catch(_0x4590a9){_0x20d3a5['push'](_0x20d3a5['shift']());}}}(a38_0x4c50,0xf3bed));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{saveSessionContext}from'../core/session.js';import a38_0x5a4ccd from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';import a38_0x2d8895 from'path';function a38_0x5009(_0x5e9b48,_0x18542a){_0x5e9b48=_0x5e9b48-0x1b2;const _0x4c50b2=a38_0x4c50();let _0x500915=_0x4c50b2[_0x5e9b48];return _0x500915;}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_0x3d5dd9(0x203)]=a38_0x3d5dd9(0x1b8);[a38_0x3d5dd9(0x1e5)]=a38_0x3d5dd9(0x1f8);async['execute'](_0x4d3011){const _0xdd4a3a=a38_0x3d5dd9,{options:_0x406970,args:_0x4dcac2,tdx:_0x3fcfc0}=_0x4d3011,_0x1d8b56=_0x406970,_0x59de1c=await resolveTarget({'arg':_0x4dcac2[0x0],'contextParent':_0x406970[_0xdd4a3a(0x1cb)],'cwd':process[_0xdd4a3a(0x1d4)]()});if(!isSuccessfulResolution(_0x59de1c))return _0x59de1c[_0xdd4a3a(0x1d8)]===_0xdd4a3a(0x1c1)?(console[_0xdd4a3a(0x1d0)](a38_0x5a4ccd['yellow'](_0xdd4a3a(0x1b5))),console['error'](_0xdd4a3a(0x1f1)),console[_0xdd4a3a(0x1d0)](_0xdd4a3a(0x1bf)),console['error'](_0xdd4a3a(0x1d2))):(console[_0xdd4a3a(0x1d0)](a38_0x5a4ccd[_0xdd4a3a(0x1ea)](_0xdd4a3a(0x1cf)+_0x59de1c[_0xdd4a3a(0x1f4)]+'\x0a')),_0x59de1c['helpText']&&console[_0xdd4a3a(0x1d0)](a38_0x5a4ccd[_0xdd4a3a(0x1c2)](_0x59de1c[_0xdd4a3a(0x1f6)]))),0x1;const _0x511967=_0x59de1c['parentName'],_0x2c9e0e=_0x59de1c[_0xdd4a3a(0x1e7)],_0x23ab7a=_0x59de1c[_0xdd4a3a(0x1e6)]===_0xdd4a3a(0x1c8)?_0x59de1c[_0xdd4a3a(0x1f7)]:undefined;_0x1d8b56['verbose']&&(console[_0xdd4a3a(0x1d0)]('Site:\x20'+_0x1d8b56[_0xdd4a3a(0x1f2)]),console[_0xdd4a3a(0x1d0)]('Parent\x20segment:\x20'+_0x511967),_0x23ab7a&&console[_0xdd4a3a(0x1d0)](_0xdd4a3a(0x1fd)+_0x23ab7a));const _0x1502b7=await withProgressSpinner(_0xdd4a3a(0x1e8)+_0x511967+_0xdd4a3a(0x1bb),_0x1e721d=>_0x3fcfc0[_0xdd4a3a(0x1f0)][_0xdd4a3a(0x201)](_0x511967,{'targetDir':_0x2c9e0e,'targetResourceName':_0x23ab7a,'verbose':_0x1d8b56[_0xdd4a3a(0x1ec)],'progress':{'update':_0x357399=>{_0x1e721d['setPhase'](_0x357399),_0x1d8b56['verbose']&&console['error']('\x20\x20'+_0x357399);}}}),{'verbose':_0x1d8b56[_0xdd4a3a(0x1ec)]}),_0x2f2234=_0x1502b7[_0xdd4a3a(0x1d5)];if(_0x2f2234[_0xdd4a3a(0x1ce)]['segments']===0x0&&_0x2f2234[_0xdd4a3a(0x1ce)][_0xdd4a3a(0x1da)]===0x0)return console[_0xdd4a3a(0x1d0)](a38_0x5a4ccd[_0xdd4a3a(0x1cd)]('No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27'+_0x2f2234['parentName']+'\x27')),0x0;const _0x4ee40f=_0x2f2234['files'][_0xdd4a3a(0x1b4)](_0xc189bb=>_0xc189bb[_0xdd4a3a(0x1bd)]),_0x30dc55=_0x2f2234[_0xdd4a3a(0x204)]['filter'](_0xd06369=>!_0xd06369[_0xdd4a3a(0x1bd)]&&_0xd06369[_0xdd4a3a(0x202)]),_0x334975=_0x2f2234[_0xdd4a3a(0x204)]['filter'](_0x1c5149=>!_0x1c5149[_0xdd4a3a(0x1bd)]&&!_0x1c5149[_0xdd4a3a(0x202)]);console[_0xdd4a3a(0x1d0)](_0xdd4a3a(0x200)+_0x2f2234[_0xdd4a3a(0x1dc)]+'\x27:'),console[_0xdd4a3a(0x1d0)](_0xdd4a3a(0x1eb)+a38_0x5a4ccd['cyan'](_0x2f2234[_0xdd4a3a(0x1ce)][_0xdd4a3a(0x1c4)]+_0xdd4a3a(0x1e4))+_0xdd4a3a(0x1d1)+a38_0x5a4ccd[_0xdd4a3a(0x1c2)](_0x2f2234['counts'][_0xdd4a3a(0x1bc)]+'\x20activations'));if(_0x2f2234['counts'][_0xdd4a3a(0x1da)]>0x0){const _0x234f18=_0x2f2234['counts']['journeyVersions']>_0x2f2234['counts'][_0xdd4a3a(0x1da)]?'\x20('+_0x2f2234[_0xdd4a3a(0x1ce)][_0xdd4a3a(0x1c7)]+_0xdd4a3a(0x1ba):'';console['error']('\x20\x20πŸ—ΊοΈ\x20\x20'+a38_0x5a4ccd['cyan'](_0x2f2234[_0xdd4a3a(0x1ce)]['journeys']+_0xdd4a3a(0x1cc))+a38_0x5a4ccd[_0xdd4a3a(0x1c3)](_0x234f18));}console[_0xdd4a3a(0x1d0)]('\x20\x20'+a38_0x5a4ccd[_0xdd4a3a(0x1b7)]('+\x20'+_0x4ee40f[_0xdd4a3a(0x1e1)]+_0xdd4a3a(0x1e3))),console['error']('\x20\x20'+a38_0x5a4ccd[_0xdd4a3a(0x1cd)]('~\x20'+_0x30dc55[_0xdd4a3a(0x1e1)]+_0xdd4a3a(0x1fe))),console[_0xdd4a3a(0x1d0)]('\x20\x20'+a38_0x5a4ccd[_0xdd4a3a(0x1c3)]('=\x20'+_0x334975[_0xdd4a3a(0x1e1)]+_0xdd4a3a(0x1fb))),console['error']('\x20\x20Target:\x20'+a38_0x5a4ccd[_0xdd4a3a(0x1c2)](_0x2f2234[_0xdd4a3a(0x1e7)])+'\x0a');if(_0x30dc55[_0xdd4a3a(0x1e1)]>0x0)for(const _0x26e2de of _0x30dc55){console['error'](_0xdd4a3a(0x1b9)+_0x26e2de[_0xdd4a3a(0x1fc)]+'\x27:'),console[_0xdd4a3a(0x1d0)]('─'[_0xdd4a3a(0x1f9)](0x3c)),console[_0xdd4a3a(0x1d0)](_0x26e2de[_0xdd4a3a(0x1e9)]),console[_0xdd4a3a(0x1d0)]('─'[_0xdd4a3a(0x1f9)](0x3c));}if(_0x1d8b56[_0xdd4a3a(0x1d7)])return console[_0xdd4a3a(0x1d0)](a38_0x5a4ccd[_0xdd4a3a(0x1cd)](_0xdd4a3a(0x1de))),0x0;if(_0x4ee40f['length']===0x0&&_0x30dc55[_0xdd4a3a(0x1e1)]===0x0)return console[_0xdd4a3a(0x1d0)](a38_0x5a4ccd[_0xdd4a3a(0x1b7)]('βœ”\x20All\x20files\x20are\x20up\x20to\x20date')),saveSessionContext({'parent_segment':_0x2f2234[_0xdd4a3a(0x1dc)]},_0x1d8b56['session']),console[_0xdd4a3a(0x1d0)](a38_0x5a4ccd[_0xdd4a3a(0x1b7)](_0xdd4a3a(0x1fa)+a38_0x5a4ccd[_0xdd4a3a(0x1c3)](_0xdd4a3a(0x1f3))+'\x20=\x20'+a38_0x5a4ccd[_0xdd4a3a(0x1c2)](_0x2f2234[_0xdd4a3a(0x1dc)]))),0x0;if(!_0x1d8b56[_0xdd4a3a(0x1e2)]){if(!isInteractive())return console['error'](a38_0x5a4ccd['red'](_0xdd4a3a(0x1b6)),_0xdd4a3a(0x1f5)),console[_0xdd4a3a(0x1d0)](a38_0x5a4ccd[_0xdd4a3a(0x1c3)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x380c36=await confirmKey('Write\x20'+(_0x4ee40f['length']+_0x30dc55[_0xdd4a3a(0x1e1)])+_0xdd4a3a(0x1ff));if(!_0x380c36)return console[_0xdd4a3a(0x1d0)](a38_0x5a4ccd[_0xdd4a3a(0x1cd)]('Aborted.'),_0xdd4a3a(0x1ed)),0x1;}for(const _0x3b0b64 of _0x2f2234[_0xdd4a3a(0x204)]){if(_0x3b0b64[_0xdd4a3a(0x1bd)]||_0x3b0b64[_0xdd4a3a(0x202)]){const _0x39904f=a38_0x2d8895[_0xdd4a3a(0x1c0)](_0x3b0b64['absolutePath']);!existsSync(_0x39904f)&&mkdirSync(_0x39904f,{'recursive':!![]}),writeFileSync(_0x3b0b64[_0xdd4a3a(0x1ef)],_0x3b0b64[_0xdd4a3a(0x1e0)],_0xdd4a3a(0x1dd));}}return console[_0xdd4a3a(0x1d0)](a38_0x5a4ccd[_0xdd4a3a(0x1b7)](_0xdd4a3a(0x1ca)+(_0x4ee40f['length']+_0x30dc55[_0xdd4a3a(0x1e1)])+_0xdd4a3a(0x1c6)+_0x2f2234[_0xdd4a3a(0x1e7)])),saveSessionContext({'parent_segment':_0x2f2234[_0xdd4a3a(0x1dc)]},_0x1d8b56[_0xdd4a3a(0x1d6)]),console[_0xdd4a3a(0x1d0)](a38_0x5a4ccd[_0xdd4a3a(0x1b7)]('βœ”\x20Context\x20set:\x20'+a38_0x5a4ccd[_0xdd4a3a(0x1c3)](_0xdd4a3a(0x1f3))+_0xdd4a3a(0x1c5)+a38_0x5a4ccd[_0xdd4a3a(0x1c2)](_0x2f2234[_0xdd4a3a(0x1dc)]))),0x0;}}
@@ -1 +1 @@
1
- const a39_0x3c6822=a39_0x1a44;(function(_0x5937e4,_0x58641a){const _0x4f91c7=a39_0x1a44,_0x417994=_0x5937e4();while(!![]){try{const _0x5617d0=parseInt(_0x4f91c7(0x195))/0x1*(parseInt(_0x4f91c7(0x20a))/0x2)+parseInt(_0x4f91c7(0x1d3))/0x3*(-parseInt(_0x4f91c7(0x1e0))/0x4)+-parseInt(_0x4f91c7(0x194))/0x5*(-parseInt(_0x4f91c7(0x1ba))/0x6)+parseInt(_0x4f91c7(0x198))/0x7+parseInt(_0x4f91c7(0x1cd))/0x8*(parseInt(_0x4f91c7(0x1a0))/0x9)+-parseInt(_0x4f91c7(0x18e))/0xa*(-parseInt(_0x4f91c7(0x181))/0xb)+parseInt(_0x4f91c7(0x185))/0xc*(-parseInt(_0x4f91c7(0x20d))/0xd);if(_0x5617d0===_0x58641a)break;else _0x417994['push'](_0x417994['shift']());}catch(_0x490f9b){_0x417994['push'](_0x417994['shift']());}}}(a39_0x10f9,0x64ca2));import{BaseCommand}from'./command.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{generateDiff,formatDiffWithColors}from'../utils/diff.js';function a39_0x10f9(){const _0x4084c3=['638463tPzUDA','resolveParentId','\x20\x20Activations:\x20','idToName','targetDir','segmentFolderId','\x20\x20\x20\x20','journeys','267048XQFlBA','file','buildUserMaps','no_parent','helpText','endsWith','journeysOnly','created','error','name','Error:\x20','folders','get','/e/','listActivations','Fetching\x20connections\x20for\x20name\x20resolution...','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','New\x20journey:','\x0aError:','type','βœ”\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','journeyBundleId','setPhase','getOutputSchemaWithCache','listJourneysWithDetailsFromParentSegment','updatedAt','12AQAyNo','Changes\x20to:','segment','cyan','verbose','.yaml','createdAt','\x20updated','filePath','\x20folders\x20to\x20create','parent_name','Site:\x20','set','push','.yml','\x20to\x20create','blue','listFolders','Changes\x20to\x20journey:','56DbOdgD','cwd','\x20unchanged','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','Preparing\x20journeys...','/j/da/je','13938OMBQgK','existingJourney','\x20to\x20update','\x20\x20Activations:','Fetching\x20existing\x20data...','getJourney','red','\x0aValidation\x20failed:','errorCode','connection','execute','\x20YAML\x20files\x20found','yellow','20LfnJBK','parentFolder','Folders\x20to\x20create:','state','parentName','createdSegmentIds','dim','attributes','Resolving\x20parent\x20segment\x20\x27','\x27...','yamlConfig','then','\x20new','Error:\x20Directory\x20not\x20found:\x20','Source\x20directory:\x20','changed','segment:push','isScoped','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','toString','\x0aβœ”\x20Push\x20complete','repeat','Fetching\x20existing\x20activations...','folderId','\x20to\x20delete','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','\x20created','new','updated','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','message','user','πŸ“\x20','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','activations','existingSegment','\x20\x20Source:\x20','folderPath','audienceId','toCreate','toDelete','deleted','589714UgmmMF','segments','green','597701iwOzCL','map','isNew','nameToId','Delete\x20segment:','\x20deleted','Parent\x20segment:\x20','parentSegment','Aborted.','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','data','Push\x20','list','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','site','journeyId','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','Scoped\x20to\x20folder:\x20','\x20activations]','\x20\x20Segments:\x20','55099eXhbIY','\x20changed','all','\x20\x20πŸ“Š\x20Segments:','468DESKWb','journeyBundleName','join','journey','delete','add','/sb/da/esr','\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20','unchanged','1260eSqAsU','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','results','description','diff','relationships','1773515uaoXmw','2LqdQSS','/app/ps/','length'];a39_0x10f9=function(){return _0x4084c3;};return a39_0x10f9();}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_0x30ea8b 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_0x1a44(_0x114171,_0x5e159f){_0x114171=_0x114171-0x174;const _0x10f9da=a39_0x10f9();let _0x1a4434=_0x10f9da[_0x114171];return _0x1a4434;}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_0x3c6822(0x1a9)]=a39_0x3c6822(0x1f0);['description']=a39_0x3c6822(0x176);async[a39_0x3c6822(0x1dd)](_0x36466b){const _0x3c4aa7=a39_0x3c6822,{options:_0x2853cc,args:_0x338141,tdx:_0xf398e}=_0x36466b,_0x179d89=_0x2853cc,_0x464c7f=await resolveTarget({'arg':_0x338141[0x0],'contextParent':_0x2853cc[_0x3c4aa7(0x174)],'cwd':process[_0x3c4aa7(0x1ce)]()});if(!isSuccessfulResolution(_0x464c7f))return _0x464c7f[_0x3c4aa7(0x1db)]===_0x3c4aa7(0x1a3)?(console[_0x3c4aa7(0x1a8)](a39_0x30ea8b[_0x3c4aa7(0x1df)](_0x3c4aa7(0x201))),console[_0x3c4aa7(0x1a8)]('Usage:\x20tdx\x20sg\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20(requires\x20context)'),console[_0x3c4aa7(0x1a8)](_0x3c4aa7(0x1f9)),console['error']('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file')):(console[_0x3c4aa7(0x1a8)](a39_0x30ea8b[_0x3c4aa7(0x1d9)](_0x3c4aa7(0x1aa)+_0x464c7f[_0x3c4aa7(0x1fe)]+'\x0a')),_0x464c7f[_0x3c4aa7(0x1a4)]&&console[_0x3c4aa7(0x1a8)](a39_0x30ea8b['cyan'](_0x464c7f['helpText']))),0x1;if(_0x464c7f[_0x3c4aa7(0x1b3)]===_0x3c4aa7(0x1c4))return console[_0x3c4aa7(0x1a8)](a39_0x30ea8b[_0x3c4aa7(0x1d9)](_0x3c4aa7(0x1ed)+_0x464c7f[_0x3c4aa7(0x19c)]+'\x0a')),console[_0x3c4aa7(0x1a8)](a39_0x30ea8b[_0x3c4aa7(0x1bd)](_0x3c4aa7(0x17a))),0x1;const _0x5e8349=_0x464c7f[_0x3c4aa7(0x1e4)],_0x4469a6=_0x464c7f[_0x3c4aa7(0x19c)],_0x454d92=_0x464c7f[_0x3c4aa7(0x1b3)]===_0x3c4aa7(0x1a1)?_0x464c7f[_0x3c4aa7(0x1c2)]:undefined,_0x5b647d=getScopedDetails(_0x464c7f),_0x5dce64=_0x5b647d?.[_0x3c4aa7(0x1f1)]??![],_0x2d5f09=_0x5b647d?.['scopedFolderPath']??'';if(!existsSync(_0x4469a6))return console[_0x3c4aa7(0x1a8)](a39_0x30ea8b[_0x3c4aa7(0x1d9)](_0x3c4aa7(0x1ed)+_0x4469a6+'\x0a')),console[_0x3c4aa7(0x1a8)](a39_0x30ea8b['cyan']('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;_0x179d89[_0x3c4aa7(0x1be)]&&(console['error'](_0x3c4aa7(0x1c5)+_0x179d89['site']),console[_0x3c4aa7(0x1a8)](_0x3c4aa7(0x213)+_0x5e8349),console[_0x3c4aa7(0x1a8)](_0x3c4aa7(0x1ee)+_0x4469a6),_0x5dce64&&console[_0x3c4aa7(0x1a8)](_0x3c4aa7(0x17e)+_0x2d5f09));const _0x4d1c8a=await withSpinner(_0x3c4aa7(0x1e8)+_0x5e8349+_0x3c4aa7(0x1e9),()=>_0xf398e[_0x3c4aa7(0x1bc)][_0x3c4aa7(0x199)](_0x5e8349),{'verbose':_0x179d89[_0x3c4aa7(0x1be)]}),_0x27c4c2=_0x4d1c8a[_0x3c4aa7(0x177)],{parentSegmentResult:_0x479604,segmentsResult:_0x120128,foldersResult:_0x231ac7,journeysWithDetailsResult:_0x5e4cb2,userMaps:_0x273183}=await withSpinner(_0x3c4aa7(0x1d7),async()=>{const _0x106810=_0x3c4aa7,[_0x4f476b,_0x5c6e47,_0x9559b7,_0x1dbb01,_0x2c296c]=await Promise[_0x106810(0x183)]([_0xf398e['segment']['getParent'](_0x27c4c2),_0xf398e[_0x106810(0x1bc)]['listSegments'](_0x27c4c2),_0xf398e[_0x106810(0x1bc)][_0x106810(0x1cb)](_0x27c4c2),_0xf398e[_0x106810(0x188)][_0x106810(0x1b8)](_0x27c4c2,{'includeAllVersions':!![]}),_0xf398e['user'][_0x106810(0x1a2)]()]);return{'parentSegmentResult':_0x4f476b,'segmentsResult':_0x5c6e47,'foldersResult':_0x9559b7,'journeysWithDetailsResult':_0x1dbb01,'userMaps':_0x2c296c};},{'verbose':_0x179d89[_0x3c4aa7(0x1be)]})[_0x3c4aa7(0x1eb)](_0x2b9c3f=>_0x2b9c3f[_0x3c4aa7(0x177)]),_0x5855f7=_0x479604,_0x5aca44=extractRootFolderId(_0x5855f7),_0x4c50b7=_0x120128,_0x14b404=_0x231ac7,{journeys:_0x4eabf7,activationStepsById:_0x27bad3}=_0x5e4cb2,_0x3e9f46=new Map(_0x4eabf7[_0x3c4aa7(0x20e)](_0x3bbbe7=>[_0x3bbbe7['id'],_0x3bbbe7])),_0x9a09dd=_0x4eabf7[_0x3c4aa7(0x20e)](_0x4ef5fa=>({'id':_0x4ef5fa['id'],'name':_0x4ef5fa[_0x3c4aa7(0x1e7)][_0x3c4aa7(0x1a9)],'journeyBundleName':_0x4ef5fa[_0x3c4aa7(0x1e7)][_0x3c4aa7(0x186)]||'','journeyBundleId':_0x4ef5fa['attributes'][_0x3c4aa7(0x1b5)]||'','versionNumber':_0x4ef5fa[_0x3c4aa7(0x1e7)]['versionNumber'],'description':_0x4ef5fa[_0x3c4aa7(0x1e7)][_0x3c4aa7(0x191)],'state':_0x4ef5fa[_0x3c4aa7(0x1e7)][_0x3c4aa7(0x1e3)],'paused':_0x4ef5fa['attributes']['paused'],'audienceId':_0x4ef5fa[_0x3c4aa7(0x1e7)][_0x3c4aa7(0x206)],'folderId':_0x4ef5fa[_0x3c4aa7(0x193)]?.[_0x3c4aa7(0x1e1)]?.[_0x3c4aa7(0x177)]?.['id'],'createdAt':_0x4ef5fa[_0x3c4aa7(0x1e7)][_0x3c4aa7(0x1c0)],'updatedAt':_0x4ef5fa[_0x3c4aa7(0x1e7)][_0x3c4aa7(0x1b9)]})),{emailToId:_0x1261a0,idToEmail:_0x12e592}=_0x273183,_0x753f53=await withSpinner(_0x3c4aa7(0x1af),async()=>{const _0x42cce1=_0x3c4aa7,_0x1167ae=await _0xf398e[_0x42cce1(0x1dc)][_0x42cce1(0x179)]();return buildConnectionMaps(_0x1167ae);},{'verbose':_0x179d89[_0x3c4aa7(0x1be)]})[_0x3c4aa7(0x1eb)](_0x22b705=>_0x22b705[_0x3c4aa7(0x177)]),_0x30d14a=_0x753f53[_0x3c4aa7(0x210)],_0x2eb4a7=_0x753f53[_0x3c4aa7(0x19b)],_0x5c3fbe=_0x753f53['nameToType'],_0x369f1c={'emailToIdMap':_0x1261a0,'connectionNameToIdMap':_0x30d14a,'connectionNameToTypeMap':_0x5c3fbe,'getSchema':_0x3a6f15=>_0xf398e[_0x3c4aa7(0x1dc)][_0x3c4aa7(0x1b7)](_0x3a6f15)};let {pathToId:_0x54cf4a,idToPath:_0x6b7ab2}=buildFolderMaps(_0x14b404);const _0x47f6c8=buildSegmentLookupMap(_0x4c50b7,_0x6b7ab2),_0x3cc844=buildSegmentNameToIdMap(_0x4c50b7),_0x3a2291=buildJourneyBundleLookupMap(_0x9a09dd,_0x6b7ab2);let _0x32aa0d;if(_0x454d92){if(!_0x454d92[_0x3c4aa7(0x1a5)](_0x3c4aa7(0x1c8))&&!_0x454d92['endsWith'](_0x3c4aa7(0x1bf)))return console[_0x3c4aa7(0x1a8)](a39_0x30ea8b[_0x3c4aa7(0x1d9)](_0x3c4aa7(0x1f2)+_0x454d92+'\x0a')),0x1;_0x32aa0d=[_0x454d92];}else _0x32aa0d=findYamlFiles(_0x4469a6);if(_0x32aa0d['length']===0x0)return console['error'](a39_0x30ea8b[_0x3c4aa7(0x1d9)](_0x3c4aa7(0x17d)+_0x4469a6+'\x0a')),console['error'](a39_0x30ea8b[_0x3c4aa7(0x1bd)]('Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files')),0x1;let _0x25f969,_0x2185ae;try{const _0x29ef6f=parseAndClassifyYamlFiles(_0x32aa0d,_0x4469a6,{'skipSegments':_0x179d89[_0x3c4aa7(0x1a6)]});_0x25f969=_0x29ef6f[_0x3c4aa7(0x20b)],_0x2185ae=_0x29ef6f[_0x3c4aa7(0x19f)];const _0x493b34=validateParsedFiles(_0x29ef6f,_0x4469a6);if(_0x493b34[_0x3c4aa7(0x197)]>0x0)return console[_0x3c4aa7(0x1a8)](a39_0x30ea8b[_0x3c4aa7(0x1d9)](_0x3c4aa7(0x1da))),console[_0x3c4aa7(0x1a8)](formatValidationErrors(_0x493b34)),console['error'](a39_0x30ea8b[_0x3c4aa7(0x1df)]('\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.')),0x1;}catch(_0xd0fce6){return console[_0x3c4aa7(0x1a8)](a39_0x30ea8b['red']('Error\x20parsing\x20YAML:\x20'+(_0xd0fce6 instanceof Error?_0xd0fce6[_0x3c4aa7(0x1fe)]:_0xd0fce6))),0x1;}if(_0x25f969[_0x3c4aa7(0x197)]===0x0&&_0x2185ae[_0x3c4aa7(0x197)]===0x0){const _0x47907a=_0x179d89['journeysOnly']?_0x3c4aa7(0x188):'segment\x20or\x20journey';return console['error'](a39_0x30ea8b[_0x3c4aa7(0x1df)]('No\x20'+_0x47907a+_0x3c4aa7(0x1de))),0x0;}const _0x38e917=new Map();_0x4c50b7['length']>0x0&&!_0x179d89['journeysOnly']&&await withSpinner(_0x3c4aa7(0x1f6),async()=>{await batchAsync(_0x4c50b7,async _0x576479=>{const _0x53ebad=a39_0x1a44,_0x571327=await _0xf398e['segment'][_0x53ebad(0x1ae)](_0x27c4c2,_0x576479['id']);_0x38e917[_0x53ebad(0x1c6)](_0x576479['id'],_0x571327);});},{'verbose':_0x179d89[_0x3c4aa7(0x1be)]});const {segmentFiles:_0x5048ac,foldersToCreate:_0xb93ae0}=await prepareSegmentFiles(_0x25f969,{'segmentByFolderAndName':_0x47f6c8,'activationsBySegmentId':_0x38e917,'folderPathToId':_0x54cf4a,'idToEmailMap':_0x12e592,'connectionIdToNameMap':_0x2eb4a7},_0x369f1c,_0x5dce64,_0x2d5f09),_0x23a66c=_0x454d92?[]:findSegmentsToDelete(_0x4c50b7,_0x25f969[_0x3c4aa7(0x20e)](({yamlConfig:_0x48815a,folderPath:_0x100306})=>({'yamlConfig':_0x48815a,'folderPath':resolveTDFolderPath(_0x100306,_0x5dce64,_0x2d5f09)})),_0x6b7ab2,_0x2d5f09,_0x5dce64),{journeyFiles:_0x26dfdc,foldersToCreate:_0xa528b0}=await withProgressSpinner(_0x3c4aa7(0x1d1),async _0x23e92b=>prepareJourneyFiles(_0x2185ae,{'fetchJourney':async _0x5fa5e2=>_0xf398e[_0x3c4aa7(0x188)][_0x3c4aa7(0x1d8)](_0x5fa5e2[_0x3c4aa7(0x17c)]),'journeyBundlesByFolderAndName':_0x3a2291,'folderPathToId':_0x54cf4a,'idToEmailMap':_0x12e592,'connectionIdToNameMap':_0x2eb4a7,'existingSegments':_0x4c50b7,'parentId':_0x27c4c2,'deps':_0xf398e,'progress':{'update':_0x35f932=>{const _0x13f785=_0x3c4aa7;_0x23e92b[_0x13f785(0x1b6)](_0x35f932),_0x179d89[_0x13f785(0x1be)]&&console[_0x13f785(0x1a8)]('\x20\x20'+_0x35f932);}},'journeyById':_0x3e9f46,'activationStepsById':_0x27bad3},_0x5dce64,_0x2d5f09),{'verbose':_0x179d89[_0x3c4aa7(0x1be)]})[_0x3c4aa7(0x1eb)](_0xa07a6c=>_0xa07a6c[_0x3c4aa7(0x177)]);for(const _0x45e717 of _0xa528b0){_0xb93ae0[_0x3c4aa7(0x18a)](_0x45e717);}const _0x2be252=_0x454d92?[]:findJourneysToDelete(_0x9a09dd,_0x2185ae[_0x3c4aa7(0x20e)](({yamlConfig:_0x23d3a8,folderPath:_0x513c5a})=>({'yamlConfig':_0x23d3a8,'folderPath':resolveTDFolderPath(_0x513c5a,_0x5dce64,_0x2d5f09)})),_0x6b7ab2,_0x2d5f09,_0x5dce64),_0x492beb=calculatePushStats(_0x5048ac,_0x26dfdc,_0xb93ae0,_0x23a66c,_0x2be252,!!_0x179d89['delete'],!!_0x179d89[_0x3c4aa7(0x1a6)]),_0x4db57f=_0x492beb[_0x3c4aa7(0x20b)]['new'],_0x290ab9=_0x492beb[_0x3c4aa7(0x20b)][_0x3c4aa7(0x1ef)],_0x3dd41f=_0x492beb[_0x3c4aa7(0x20b)][_0x3c4aa7(0x18d)],_0x41f115=_0x492beb[_0x3c4aa7(0x20b)][_0x3c4aa7(0x208)],_0x465414=_0x492beb[_0x3c4aa7(0x1ab)][_0x3c4aa7(0x207)],_0x59a7d4=_0x492beb[_0x3c4aa7(0x19f)][_0x3c4aa7(0x1fb)],_0x4a9f7f=_0x492beb['journeys'][_0x3c4aa7(0x1ef)],_0x13e9a8=_0x492beb[_0x3c4aa7(0x19f)][_0x3c4aa7(0x18d)],_0x3beed2=_0x492beb[_0x3c4aa7(0x19f)][_0x3c4aa7(0x208)],_0x478817=_0x492beb[_0x3c4aa7(0x202)]['all'],_0x3a079c=_0x492beb['activations'][_0x3c4aa7(0x207)],_0x2161a4=_0x492beb['activations']['toUpdate'],_0x151d9f=_0x492beb[_0x3c4aa7(0x202)][_0x3c4aa7(0x208)];console['error']('\x0aPush\x20summary\x20for\x20\x27'+_0x5e8349+'\x27:');_0x465414[_0x3c4aa7(0x197)]>0x0&&console[_0x3c4aa7(0x1a8)]('\x20\x20'+a39_0x30ea8b[_0x3c4aa7(0x1ca)](_0x3c4aa7(0x200)+_0x465414[_0x3c4aa7(0x197)]+_0x3c4aa7(0x1c3)));if(!_0x179d89[_0x3c4aa7(0x1a6)]){console[_0x3c4aa7(0x1a8)](_0x3c4aa7(0x184)),console[_0x3c4aa7(0x1a8)]('\x20\x20\x20\x20'+a39_0x30ea8b[_0x3c4aa7(0x20c)]('+\x20'+_0x4db57f['length']+_0x3c4aa7(0x1ec))),console[_0x3c4aa7(0x1a8)](_0x3c4aa7(0x19e)+a39_0x30ea8b[_0x3c4aa7(0x1df)]('~\x20'+_0x290ab9[_0x3c4aa7(0x197)]+_0x3c4aa7(0x182)));if(_0x41f115[_0x3c4aa7(0x197)]>0x0)console[_0x3c4aa7(0x1a8)](_0x3c4aa7(0x19e)+a39_0x30ea8b[_0x3c4aa7(0x1d9)]('-\x20'+_0x41f115[_0x3c4aa7(0x197)]+_0x3c4aa7(0x1f8)));else _0x23a66c[_0x3c4aa7(0x197)]>0x0&&!_0x179d89[_0x3c4aa7(0x189)]&&console[_0x3c4aa7(0x1a8)](_0x3c4aa7(0x19e)+a39_0x30ea8b[_0x3c4aa7(0x1e6)](_0x23a66c[_0x3c4aa7(0x197)]+_0x3c4aa7(0x1fd)));console[_0x3c4aa7(0x1a8)](_0x3c4aa7(0x19e)+a39_0x30ea8b[_0x3c4aa7(0x1e6)]('=\x20'+_0x3dd41f['length']+_0x3c4aa7(0x1cf)));}if(_0x26dfdc['length']>0x0||_0x2be252[_0x3c4aa7(0x197)]>0x0){console['error']('\x20\x20πŸ—ΊοΈ\x20\x20Journeys:'),console[_0x3c4aa7(0x1a8)](_0x3c4aa7(0x19e)+a39_0x30ea8b[_0x3c4aa7(0x20c)]('+\x20'+_0x59a7d4[_0x3c4aa7(0x197)]+_0x3c4aa7(0x1ec))),console[_0x3c4aa7(0x1a8)](_0x3c4aa7(0x19e)+a39_0x30ea8b[_0x3c4aa7(0x1df)]('~\x20'+_0x4a9f7f[_0x3c4aa7(0x197)]+_0x3c4aa7(0x182)));if(_0x3beed2[_0x3c4aa7(0x197)]>0x0)console[_0x3c4aa7(0x1a8)]('\x20\x20\x20\x20'+a39_0x30ea8b['red']('-\x20'+_0x3beed2[_0x3c4aa7(0x197)]+_0x3c4aa7(0x1f8)));else _0x2be252['length']>0x0&&!_0x179d89[_0x3c4aa7(0x189)]&&console[_0x3c4aa7(0x1a8)](_0x3c4aa7(0x19e)+a39_0x30ea8b[_0x3c4aa7(0x1e6)](_0x2be252['length']+_0x3c4aa7(0x1fd)));console['error']('\x20\x20\x20\x20'+a39_0x30ea8b[_0x3c4aa7(0x1e6)]('=\x20'+_0x13e9a8[_0x3c4aa7(0x197)]+_0x3c4aa7(0x1cf)));}_0x478817[_0x3c4aa7(0x197)]>0x0&&!_0x179d89[_0x3c4aa7(0x1a6)]&&(console['error'](''),console[_0x3c4aa7(0x1a8)](_0x3c4aa7(0x1d6)),_0x3a079c[_0x3c4aa7(0x197)]>0x0&&console[_0x3c4aa7(0x1a8)](_0x3c4aa7(0x19e)+a39_0x30ea8b[_0x3c4aa7(0x20c)]('+\x20'+_0x3a079c[_0x3c4aa7(0x197)]+_0x3c4aa7(0x1c9))),_0x2161a4[_0x3c4aa7(0x197)]>0x0&&console[_0x3c4aa7(0x1a8)](_0x3c4aa7(0x19e)+a39_0x30ea8b[_0x3c4aa7(0x1df)]('~\x20'+_0x2161a4[_0x3c4aa7(0x197)]+_0x3c4aa7(0x1d5))),_0x151d9f[_0x3c4aa7(0x197)]>0x0&&console[_0x3c4aa7(0x1a8)]('\x20\x20\x20\x20'+a39_0x30ea8b[_0x3c4aa7(0x1d9)]('-\x20'+_0x151d9f[_0x3c4aa7(0x197)]+_0x3c4aa7(0x1f8))));console[_0x3c4aa7(0x1a8)](_0x3c4aa7(0x204)+a39_0x30ea8b[_0x3c4aa7(0x1bd)](_0x4469a6)+'\x0a');if(_0x465414[_0x3c4aa7(0x197)]>0x0){console[_0x3c4aa7(0x1a8)](_0x3c4aa7(0x1e2));for(const _0x530495 of _0x465414){console[_0x3c4aa7(0x1a8)]('\x20\x20'+a39_0x30ea8b['blue']('+')+'\x20'+_0x530495);}console['error']('');}if(_0x4db57f[_0x3c4aa7(0x197)]>0x0&&!_0x179d89[_0x3c4aa7(0x1a6)])for(const _0x459d8a of _0x4db57f){const _0x486aeb=_0x459d8a[_0x3c4aa7(0x205)]?_0x459d8a[_0x3c4aa7(0x205)]+'/'+_0x459d8a['yamlConfig'][_0x3c4aa7(0x1a9)]:_0x459d8a[_0x3c4aa7(0x1ea)][_0x3c4aa7(0x1a9)],_0xefa5a6=_0x459d8a[_0x3c4aa7(0x1ea)]['activations']?.[_0x3c4aa7(0x197)]||0x0,_0x1e7f61=_0xefa5a6>0x0?a39_0x30ea8b[_0x3c4aa7(0x1e6)]('\x20['+_0xefa5a6+_0x3c4aa7(0x17f)):'';console[_0x3c4aa7(0x1a8)]('\x0a'+a39_0x30ea8b[_0x3c4aa7(0x20c)]('New\x20segment:')+'\x20'+_0x486aeb+_0x1e7f61),console[_0x3c4aa7(0x1a8)]('─'[_0x3c4aa7(0x1f5)](0x3c)),_0x459d8a[_0x3c4aa7(0x192)]&&console[_0x3c4aa7(0x1a8)](_0x459d8a['diff']),console[_0x3c4aa7(0x1a8)]('─'['repeat'](0x3c));}if(_0x41f115[_0x3c4aa7(0x197)]>0x0&&!_0x179d89[_0x3c4aa7(0x1a6)])for(const _0x37f245 of _0x41f115){const _0x342106=_0x37f245[_0x3c4aa7(0x19d)]?_0x6b7ab2[_0x3c4aa7(0x1ac)](_0x37f245[_0x3c4aa7(0x19d)][_0x3c4aa7(0x1f3)]())||'':'',_0x53db03=_0x342106?_0x342106+'/'+_0x37f245[_0x3c4aa7(0x1a9)]:_0x37f245['name'],_0x4e10ed=_0x38e917['get'](_0x37f245['id'])||[],_0x59de94=_0x4e10ed['length']>0x0?a39_0x30ea8b['dim']('\x20['+_0x4e10ed[_0x3c4aa7(0x197)]+'\x20activations]'):'';console[_0x3c4aa7(0x1a8)]('\x0a'+a39_0x30ea8b['red'](_0x3c4aa7(0x211))+'\x20'+_0x53db03+_0x59de94),console['error']('─'['repeat'](0x3c));const _0x157d59=segmentWithActivationsToYaml(_0x37f245,_0x4e10ed,undefined,_0x12e592,_0x2eb4a7),_0x1a8611=segmentToYamlString(_0x157d59),_0xf20e40=generateDiff(_0x1a8611,'');console[_0x3c4aa7(0x1a8)](formatDiffWithColors(_0xf20e40)),console[_0x3c4aa7(0x1a8)]('─'[_0x3c4aa7(0x1f5)](0x3c));}const _0x3f4ff6=_0x5048ac['filter'](_0x55b131=>!_0x55b131['isNew']&&_0x55b131[_0x3c4aa7(0x192)]);if(_0x3f4ff6[_0x3c4aa7(0x197)]>0x0&&!_0x179d89[_0x3c4aa7(0x1a6)])for(const _0x59fccd of _0x3f4ff6){const _0x26de66=_0x59fccd['folderPath']?_0x59fccd[_0x3c4aa7(0x205)]+'/'+_0x59fccd[_0x3c4aa7(0x1ea)][_0x3c4aa7(0x1a9)]:_0x59fccd[_0x3c4aa7(0x1ea)]['name'];console[_0x3c4aa7(0x1a8)]('\x0a'+a39_0x30ea8b[_0x3c4aa7(0x1df)](_0x3c4aa7(0x1bb))+'\x20'+_0x26de66),console[_0x3c4aa7(0x1a8)]('─'['repeat'](0x3c)),console[_0x3c4aa7(0x1a8)](_0x59fccd[_0x3c4aa7(0x192)]),console['error']('─'[_0x3c4aa7(0x1f5)](0x3c));}if(_0x59a7d4[_0x3c4aa7(0x197)]>0x0)for(const _0x5d0cfb of _0x59a7d4){const _0x3d03bf=_0x5d0cfb[_0x3c4aa7(0x205)]?_0x5d0cfb[_0x3c4aa7(0x205)]+'/'+_0x5d0cfb[_0x3c4aa7(0x1ea)][_0x3c4aa7(0x1a9)]:_0x5d0cfb[_0x3c4aa7(0x1ea)][_0x3c4aa7(0x1a9)];console[_0x3c4aa7(0x1a8)]('\x0a'+a39_0x30ea8b[_0x3c4aa7(0x20c)](_0x3c4aa7(0x1b1))+'\x20'+_0x3d03bf),console['error']('─'['repeat'](0x3c)),_0x5d0cfb[_0x3c4aa7(0x192)]&&console[_0x3c4aa7(0x1a8)](_0x5d0cfb[_0x3c4aa7(0x192)]),console[_0x3c4aa7(0x1a8)]('─'[_0x3c4aa7(0x1f5)](0x3c));}const _0x3d646d=_0x26dfdc['filter'](_0x40ccfa=>!_0x40ccfa[_0x3c4aa7(0x20f)]&&_0x40ccfa[_0x3c4aa7(0x192)]);if(_0x3d646d['length']>0x0)for(const _0x5582e0 of _0x3d646d){const _0x3f1f83=_0x5582e0[_0x3c4aa7(0x205)]?_0x5582e0[_0x3c4aa7(0x205)]+'/'+_0x5582e0[_0x3c4aa7(0x1ea)]['name']:_0x5582e0[_0x3c4aa7(0x1ea)][_0x3c4aa7(0x1a9)];console[_0x3c4aa7(0x1a8)]('\x0a'+a39_0x30ea8b[_0x3c4aa7(0x1df)](_0x3c4aa7(0x1cc))+'\x20'+_0x3f1f83),console['error']('─'['repeat'](0x3c)),console[_0x3c4aa7(0x1a8)](_0x5582e0[_0x3c4aa7(0x192)]),console[_0x3c4aa7(0x1a8)]('─'['repeat'](0x3c));}if(_0x3beed2['length']>0x0)for(const _0x4f01d4 of _0x3beed2){const _0x55390f=_0x4f01d4[_0x3c4aa7(0x1f7)]?_0x6b7ab2[_0x3c4aa7(0x1ac)](_0x4f01d4['folderId'])||'':'',_0x124cbe=_0x55390f?_0x55390f+'/'+_0x4f01d4['journeyBundleName']:_0x4f01d4[_0x3c4aa7(0x186)];console[_0x3c4aa7(0x1a8)]('\x0a'+a39_0x30ea8b['red']('Delete\x20journey:')+'\x20'+_0x124cbe),console[_0x3c4aa7(0x1a8)]('─'[_0x3c4aa7(0x1f5)](0x3c)),console['error'](a39_0x30ea8b[_0x3c4aa7(0x1d9)]('(Journey\x20will\x20be\x20deleted)')),console['error']('─'['repeat'](0x3c));}if(_0x179d89['dryRun'])return console[_0x3c4aa7(0x1a8)](a39_0x30ea8b['yellow']('\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made')),0x0;const _0x596dfa=_0x179d89[_0x3c4aa7(0x1a6)]?![]:_0x4db57f[_0x3c4aa7(0x197)]>0x0||_0x290ab9['length']>0x0||_0x41f115[_0x3c4aa7(0x197)]>0x0,_0x3fbf21=_0x59a7d4[_0x3c4aa7(0x197)]>0x0||_0x4a9f7f[_0x3c4aa7(0x197)]>0x0||_0x3beed2['length']>0x0,_0xde3d5d=_0x179d89[_0x3c4aa7(0x1a6)]?![]:_0x478817[_0x3c4aa7(0x197)]>0x0,_0x33ef64=_0x465414['length']>0x0;if(!_0x596dfa&&!_0x3fbf21&&!_0xde3d5d&&!_0x33ef64){const _0x4f6182=_0x179d89[_0x3c4aa7(0x1a6)]?'βœ”\x20All\x20journeys\x20are\x20up\x20to\x20date':_0x3c4aa7(0x1b4);console[_0x3c4aa7(0x1a8)](a39_0x30ea8b[_0x3c4aa7(0x20c)](_0x4f6182));if(_0x454d92&&_0x3dd41f[_0x3c4aa7(0x197)]===0x1){const _0x272ed8=_0x3dd41f[0x0];if(_0x272ed8[_0x3c4aa7(0x203)]?.['id']){const _0x376c52=getConsoleNextUrl(_0x179d89[_0x3c4aa7(0x17b)],_0x3c4aa7(0x196)+_0x27c4c2+_0x3c4aa7(0x1ad)+_0x272ed8[_0x3c4aa7(0x203)]['id']+_0x3c4aa7(0x18b));console[_0x3c4aa7(0x1a8)](_0x3c4aa7(0x18c)+a39_0x30ea8b[_0x3c4aa7(0x1bd)](_0x376c52));}}if(_0x454d92&&_0x13e9a8['length']===0x1){const _0x3600ca=_0x13e9a8[0x0];if(_0x3600ca[_0x3c4aa7(0x1d4)]?.['id']){const _0x36a041=getConsoleNextUrl(_0x179d89[_0x3c4aa7(0x17b)],'/app/ps/'+_0x27c4c2+_0x3c4aa7(0x1ad)+_0x3600ca['existingJourney']['id']+_0x3c4aa7(0x1d2));console[_0x3c4aa7(0x1a8)]('\x20\x20'+a39_0x30ea8b[_0x3c4aa7(0x1bd)](_0x36a041));}}return 0x0;}const _0x274e38=_0x179d89[_0x3c4aa7(0x1a6)]?_0x59a7d4[_0x3c4aa7(0x197)]+_0x4a9f7f[_0x3c4aa7(0x197)]+_0x3beed2[_0x3c4aa7(0x197)]+_0x465414[_0x3c4aa7(0x197)]:_0x4db57f[_0x3c4aa7(0x197)]+_0x290ab9[_0x3c4aa7(0x197)]+_0x41f115[_0x3c4aa7(0x197)]+_0x59a7d4[_0x3c4aa7(0x197)]+_0x4a9f7f['length']+_0x3beed2['length']+_0x465414[_0x3c4aa7(0x197)]+_0x478817[_0x3c4aa7(0x197)];if(!_0x179d89['yes']&&_0x274e38>0x0){if(!isInteractive())return console[_0x3c4aa7(0x1a8)](a39_0x30ea8b['red'](_0x3c4aa7(0x1b2)),_0x3c4aa7(0x18f)),console[_0x3c4aa7(0x1a8)](a39_0x30ea8b[_0x3c4aa7(0x1e6)](_0x3c4aa7(0x1d0))),0x1;const _0x4dbcf1=await confirmKey(_0x3c4aa7(0x178)+_0x274e38+'\x20changes?');if(!_0x4dbcf1)return console['error'](a39_0x30ea8b[_0x3c4aa7(0x1df)](_0x3c4aa7(0x175))),0x1;}const _0x566d57={'withProgress':async(_0x2af465,_0x3a4d73)=>{const _0xa2ee3=_0x3c4aa7,_0x463693=await withSpinner(_0x2af465,_0x3a4d73,{'verbose':_0x179d89[_0xa2ee3(0x1be)]});return{'data':_0x463693[_0xa2ee3(0x177)]};},'logInfo':_0x138d6b=>console[_0x3c4aa7(0x1a8)](a39_0x30ea8b[_0x3c4aa7(0x1ca)]('βœ”\x20'+_0x138d6b)),'logSuccess':_0xf4cf46=>console[_0x3c4aa7(0x1a8)](a39_0x30ea8b['green']('βœ”\x20'+_0xf4cf46)),'logWarning':_0x378e24=>console['error'](a39_0x30ea8b[_0x3c4aa7(0x1df)]('⚠\x20'+_0x378e24)),'logDeleted':_0x189591=>console[_0x3c4aa7(0x1a8)](a39_0x30ea8b[_0x3c4aa7(0x1d9)]('βœ”\x20'+_0x189591))},_0x188bb5={'segment':_0xf398e[_0x3c4aa7(0x1bc)],'journey':_0xf398e['journey'],'user':_0xf398e[_0x3c4aa7(0x1ff)],'connection':_0xf398e[_0x3c4aa7(0x1dc)]};_0x465414[_0x3c4aa7(0x197)]>0x0&&(_0x54cf4a=await executePushFolders(_0x188bb5,_0x465414,_0x54cf4a,{'parentId':_0x27c4c2},_0x566d57));const _0x127846={'rootFolderId':_0x5aca44,'folderPathToId':_0x54cf4a,'folderIdToPath':_0x6b7ab2,'segmentNameToId':_0x3cc844,'activationsBySegmentId':_0x38e917,'emailToIdMap':_0x1261a0,'idToEmailMap':_0x12e592,'connectionNameToIdMap':_0x753f53[_0x3c4aa7(0x210)],'connectionIdToNameMap':_0x753f53['idToName'],'connectionNameToTypeMap':_0x5c3fbe},_0x299271=await executePushSegments(_0x188bb5,_0x179d89[_0x3c4aa7(0x1a6)]?[]:_0x5048ac,_0x127846,{'parentId':_0x27c4c2},_0x566d57),_0x34ecdc=_0x299271[_0x3c4aa7(0x1a7)],_0x227240=_0x299271[_0x3c4aa7(0x1fc)],_0x30c76a=_0x299271[_0x3c4aa7(0x202)]['created'],_0x25ac52=_0x299271[_0x3c4aa7(0x202)][_0x3c4aa7(0x1fc)],_0x336ae2=_0x299271['activations'][_0x3c4aa7(0x209)];let _0x142598;if(_0x454d92&&_0x5048ac['length']===0x1){const _0x108c69=_0x5048ac[0x0];_0x142598=_0x108c69[_0x3c4aa7(0x203)]?.['id']??_0x299271[_0x3c4aa7(0x1e5)][_0x3c4aa7(0x1ac)](_0x108c69[_0x3c4aa7(0x1ea)][_0x3c4aa7(0x1a9)]);}const _0x3c32db=await executePushSegmentDeletions(_0x188bb5,_0x179d89[_0x3c4aa7(0x1a6)]?[]:_0x41f115,_0x566d57);let _0x3b56eb=0x0,_0x2fb9fa=0x0,_0x5b59bb=0x0;const _0x1e9df6=new Map(_0x3cc844);for(const [_0x596406,_0x4c9901]of _0x299271[_0x3c4aa7(0x1e5)]){_0x1e9df6[_0x3c4aa7(0x1c6)](_0x596406,_0x4c9901);}if(_0x26dfdc[_0x3c4aa7(0x197)]>0x0){const _0x405402={..._0x127846,'segmentNameToId':_0x1e9df6,'existingSegments':_0x4c50b7,'activationContext':_0x369f1c},_0x5a442c=await executePushJourneys(_0x188bb5,_0x26dfdc,_0x405402,{'parentId':_0x27c4c2,'rootFolderId':_0x5aca44,'verbose':_0x179d89[_0x3c4aa7(0x1be)]},_0x566d57);_0x3b56eb=_0x5a442c[_0x3c4aa7(0x1a7)],_0x2fb9fa=_0x5a442c[_0x3c4aa7(0x1fc)];if(_0x454d92&&_0x5a442c[_0x3c4aa7(0x190)][_0x3c4aa7(0x197)]===0x1){const _0x58b955=_0x5a442c[_0x3c4aa7(0x190)][0x0];if(_0x58b955[_0x3c4aa7(0x17c)]){const _0x3b339b=getConsoleNextUrl(_0x179d89[_0x3c4aa7(0x17b)],_0x3c4aa7(0x196)+_0x27c4c2+_0x3c4aa7(0x1ad)+_0x58b955['journeyId']+_0x3c4aa7(0x1d2));console[_0x3c4aa7(0x1a8)]('\x20\x20'+a39_0x30ea8b['cyan'](_0x3b339b));}}}for(const _0x5501d7 of _0x3beed2){console['error'](a39_0x30ea8b[_0x3c4aa7(0x1df)](_0x3c4aa7(0x1b0)+_0x5501d7[_0x3c4aa7(0x186)])),_0x5b59bb++;}const _0x32d2c5=[];if(_0x34ecdc>0x0)_0x32d2c5[_0x3c4aa7(0x1c7)](_0x34ecdc+_0x3c4aa7(0x1fa));if(_0x227240>0x0)_0x32d2c5['push'](_0x227240+_0x3c4aa7(0x1c1));if(_0x3c32db>0x0)_0x32d2c5[_0x3c4aa7(0x1c7)](_0x3c32db+_0x3c4aa7(0x212));const _0x17af64=[];if(_0x3b56eb>0x0)_0x17af64[_0x3c4aa7(0x1c7)](_0x3b56eb+_0x3c4aa7(0x1fa));if(_0x2fb9fa>0x0)_0x17af64[_0x3c4aa7(0x1c7)](_0x2fb9fa+_0x3c4aa7(0x1c1));if(_0x5b59bb>0x0)_0x17af64[_0x3c4aa7(0x1c7)](_0x5b59bb+_0x3c4aa7(0x212));const _0x1073de=[];if(_0x30c76a>0x0)_0x1073de['push'](_0x30c76a+_0x3c4aa7(0x1fa));if(_0x25ac52>0x0)_0x1073de[_0x3c4aa7(0x1c7)](_0x25ac52+_0x3c4aa7(0x1c1));if(_0x336ae2>0x0)_0x1073de[_0x3c4aa7(0x1c7)](_0x336ae2+_0x3c4aa7(0x212));console[_0x3c4aa7(0x1a8)](a39_0x30ea8b['green'](_0x3c4aa7(0x1f4)));_0x32d2c5[_0x3c4aa7(0x197)]>0x0&&!_0x179d89[_0x3c4aa7(0x1a6)]&&console[_0x3c4aa7(0x1a8)](_0x3c4aa7(0x180)+_0x32d2c5[_0x3c4aa7(0x187)](',\x20'));_0x17af64[_0x3c4aa7(0x197)]>0x0&&console['error']('\x20\x20Journeys:\x20'+_0x17af64[_0x3c4aa7(0x187)](',\x20'));_0x1073de[_0x3c4aa7(0x197)]>0x0&&!_0x179d89[_0x3c4aa7(0x1a6)]&&console[_0x3c4aa7(0x1a8)](_0x3c4aa7(0x19a)+_0x1073de[_0x3c4aa7(0x187)](',\x20'));if(_0x142598){const _0x34b8d2=getConsoleNextUrl(_0x179d89[_0x3c4aa7(0x17b)],_0x3c4aa7(0x196)+_0x27c4c2+_0x3c4aa7(0x1ad)+_0x142598+_0x3c4aa7(0x18b));console['error']('\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20'+a39_0x30ea8b[_0x3c4aa7(0x1bd)](_0x34b8d2));}return 0x0;}}
1
+ const a39_0x407809=a39_0xcbab;function a39_0xcbab(_0x475088,_0xbc354a){_0x475088=_0x475088-0x19c;const _0x17c9e4=a39_0x17c9();let _0xcbab37=_0x17c9e4[_0x475088];return _0xcbab37;}(function(_0x299faf,_0x4acb0b){const _0x38196b=a39_0xcbab,_0x981383=_0x299faf();while(!![]){try{const _0x98edba=-parseInt(_0x38196b(0x1c0))/0x1*(parseInt(_0x38196b(0x1c9))/0x2)+parseInt(_0x38196b(0x1ba))/0x3*(-parseInt(_0x38196b(0x1f8))/0x4)+-parseInt(_0x38196b(0x1d6))/0x5+-parseInt(_0x38196b(0x1cf))/0x6+-parseInt(_0x38196b(0x1ee))/0x7+-parseInt(_0x38196b(0x1df))/0x8*(-parseInt(_0x38196b(0x1d9))/0x9)+parseInt(_0x38196b(0x235))/0xa;if(_0x98edba===_0x4acb0b)break;else _0x981383['push'](_0x981383['shift']());}catch(_0x179efc){_0x981383['push'](_0x981383['shift']());}}}(a39_0x17c9,0x5c3b2));import{BaseCommand}from'./command.js';function a39_0x17c9(){const _0x48fe92=['toDelete','push','attributes','\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20','Resolving\x20parent\x20segment\x20\x27','Delete\x20journey:','folderId','Error\x20parsing\x20YAML:\x20','Parent\x20segment:\x20','(Journey\x20will\x20be\x20deleted)','repeat','journey','Scoped\x20to\x20folder:\x20','\x20\x20πŸ—ΊοΈ\x20\x20Journeys:','New\x20segment:','segment\x20or\x20journey','no_parent','.yml','3TcWhaP','segmentFolderId','segments','\x20changed','segment','\x27...','7047gBwfqd','\x20folders\x20to\x20create','results','/e/','relationships','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','\x20to\x20update','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','26VmbGel','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','dryRun','existingSegment','\x20changes?','Site:\x20','147642JhdFqY','parentName','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','Fetching\x20connections\x20for\x20name\x20resolution...','journeys','diff','segment:push','3008050CrWOsI','yes','cyan','171tswzht','green','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','connection','new','nameToType','33032NjFzoA','targetDir','verbose','listActivations','Changes\x20to:','parentSegment','journeyBundleName','\x20YAML\x20files\x20found','\x20updated','join','execute','error','site','blue','/app/ps/','1495592sRJMda','user','\x0aβœ”\x20Push\x20complete','state','buildUserMaps','\x20created','createdAt','Fetching\x20existing\x20activations...','journeysOnly','folderPath','2678964MeuNJs','isNew','\x20to\x20delete','length','nameToId','Changes\x20to\x20journey:','getOutputSchemaWithCache','created','isScoped','toCreate','file','cwd','\x20\x20Segments:\x20','changed','type','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','endsWith','\x20deleted','updated','scopedFolderPath','\x20\x20\x20\x20','journeyId','toUpdate','getJourney','versionNumber','message','data','red','Delete\x20segment:','idToName','\x20\x20Source:\x20','\x20unchanged','existingJourney','list','\x20activations]','deleted','set','setPhase','Fetching\x20existing\x20data...','\x20\x20πŸ“Š\x20Segments:','folders','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','name','all','\x0aPush\x20summary\x20for\x20\x27','helpText','journeyBundleId','activations','listSegments','map','yamlConfig','audienceId','\x20new','listJourneysWithDetailsFromParentSegment','description','Preparing\x20journeys...','/sb/da/esr','createdSegmentIds','/j/da/je','Error:\x20Directory\x20not\x20found:\x20','19005520hpgQdl','Push\x20','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','resolveParentId','errorCode','parent_name','New\x20journey:','\x20\x20Activations:\x20','\x0aValidation\x20failed:','.yaml','delete','πŸ“\x20','yellow','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','βœ”\x20All\x20journeys\x20are\x20up\x20to\x20date','paused','dim','then','updatedAt','get'];a39_0x17c9=function(){return _0x48fe92;};return a39_0x17c9();}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_0x320717 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_0x407809(0x223)]=a39_0x407809(0x1d5);['description']=a39_0x407809(0x1c7);async[a39_0x407809(0x1e9)](_0x53718f){const _0xe57bcf=a39_0x407809,{options:_0x49774f,args:_0x34c195,tdx:_0x46419}=_0x53718f,_0x565639=_0x49774f,_0x59ff7a=await resolveTarget({'arg':_0x34c195[0x0],'contextParent':_0x49774f[_0xe57bcf(0x1e4)],'cwd':process[_0xe57bcf(0x203)]()});if(!isSuccessfulResolution(_0x59ff7a))return _0x59ff7a[_0xe57bcf(0x239)]===_0xe57bcf(0x1b8)?(console[_0xe57bcf(0x1ea)](a39_0x320717[_0xe57bcf(0x1a0)](_0xe57bcf(0x237))),console[_0xe57bcf(0x1ea)]('Usage:\x20tdx\x20sg\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20(requires\x20context)'),console['error'](_0xe57bcf(0x1c5)),console[_0xe57bcf(0x1ea)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file')):(console[_0xe57bcf(0x1ea)](a39_0x320717[_0xe57bcf(0x214)]('Error:\x20'+_0x59ff7a['message']+'\x0a')),_0x59ff7a[_0xe57bcf(0x226)]&&console['error'](a39_0x320717[_0xe57bcf(0x1d8)](_0x59ff7a[_0xe57bcf(0x226)]))),0x1;if(_0x59ff7a[_0xe57bcf(0x206)]===_0xe57bcf(0x23a))return console[_0xe57bcf(0x1ea)](a39_0x320717[_0xe57bcf(0x214)](_0xe57bcf(0x234)+_0x59ff7a[_0xe57bcf(0x1e0)]+'\x0a')),console[_0xe57bcf(0x1ea)](a39_0x320717['cyan'](_0xe57bcf(0x207))),0x1;const _0x4c47ff=_0x59ff7a[_0xe57bcf(0x1d0)],_0x46313f=_0x59ff7a[_0xe57bcf(0x1e0)],_0x268dc2=_0x59ff7a['type']===_0xe57bcf(0x202)?_0x59ff7a['filePath']:undefined,_0x310d9a=getScopedDetails(_0x59ff7a),_0x3bf1e7=_0x310d9a?.[_0xe57bcf(0x200)]??![],_0x2af325=_0x310d9a?.[_0xe57bcf(0x20c)]??'';if(!existsSync(_0x46313f))return console[_0xe57bcf(0x1ea)](a39_0x320717[_0xe57bcf(0x214)](_0xe57bcf(0x234)+_0x46313f+'\x0a')),console[_0xe57bcf(0x1ea)](a39_0x320717[_0xe57bcf(0x1d8)](_0xe57bcf(0x207))),0x1;_0x565639[_0xe57bcf(0x1e1)]&&(console[_0xe57bcf(0x1ea)](_0xe57bcf(0x1ce)+_0x565639['site']),console[_0xe57bcf(0x1ea)](_0xe57bcf(0x1b0)+_0x4c47ff),console[_0xe57bcf(0x1ea)]('Source\x20directory:\x20'+_0x46313f),_0x3bf1e7&&console[_0xe57bcf(0x1ea)](_0xe57bcf(0x1b4)+_0x2af325));const _0x3fdcd7=await withSpinner(_0xe57bcf(0x1ac)+_0x4c47ff+_0xe57bcf(0x1bf),()=>_0x46419[_0xe57bcf(0x1be)][_0xe57bcf(0x238)](_0x4c47ff),{'verbose':_0x565639['verbose']}),_0x45d092=_0x3fdcd7[_0xe57bcf(0x213)],{parentSegmentResult:_0x73cc84,segmentsResult:_0x443d07,foldersResult:_0x21cab3,journeysWithDetailsResult:_0x366ba0,userMaps:_0x3fd701}=await withSpinner(_0xe57bcf(0x21f),async()=>{const _0x312a2d=_0xe57bcf,[_0x41af3e,_0x435b4d,_0x9205a9,_0x19ea9f,_0x3fc8f3]=await Promise[_0x312a2d(0x224)]([_0x46419[_0x312a2d(0x1be)]['getParent'](_0x45d092),_0x46419[_0x312a2d(0x1be)][_0x312a2d(0x229)](_0x45d092),_0x46419[_0x312a2d(0x1be)]['listFolders'](_0x45d092),_0x46419[_0x312a2d(0x1b3)][_0x312a2d(0x22e)](_0x45d092,{'includeAllVersions':!![]}),_0x46419[_0x312a2d(0x1ef)][_0x312a2d(0x1f2)]()]);return{'parentSegmentResult':_0x41af3e,'segmentsResult':_0x435b4d,'foldersResult':_0x9205a9,'journeysWithDetailsResult':_0x19ea9f,'userMaps':_0x3fc8f3};},{'verbose':_0x565639[_0xe57bcf(0x1e1)]})['then'](_0xe3df22=>_0xe3df22[_0xe57bcf(0x213)]),_0x2de7f2=_0x73cc84,_0x1a7416=extractRootFolderId(_0x2de7f2),_0x3e79e8=_0x443d07,_0x5c896b=_0x21cab3,{journeys:_0x42a06f,activationStepsById:_0x3887f2}=_0x366ba0,_0x2e240f=new Map(_0x42a06f['map'](_0x5086e5=>[_0x5086e5['id'],_0x5086e5])),_0x2e4f42=_0x42a06f[_0xe57bcf(0x22a)](_0x29046d=>({'id':_0x29046d['id'],'name':_0x29046d[_0xe57bcf(0x1aa)]['name'],'journeyBundleName':_0x29046d[_0xe57bcf(0x1aa)][_0xe57bcf(0x1e5)]||'','journeyBundleId':_0x29046d[_0xe57bcf(0x1aa)][_0xe57bcf(0x227)]||'','versionNumber':_0x29046d[_0xe57bcf(0x1aa)][_0xe57bcf(0x211)],'description':_0x29046d['attributes'][_0xe57bcf(0x22f)],'state':_0x29046d[_0xe57bcf(0x1aa)][_0xe57bcf(0x1f1)],'paused':_0x29046d['attributes'][_0xe57bcf(0x1a3)],'audienceId':_0x29046d['attributes'][_0xe57bcf(0x22c)],'folderId':_0x29046d[_0xe57bcf(0x1c4)]?.['parentFolder']?.[_0xe57bcf(0x213)]?.['id'],'createdAt':_0x29046d[_0xe57bcf(0x1aa)][_0xe57bcf(0x1f4)],'updatedAt':_0x29046d[_0xe57bcf(0x1aa)][_0xe57bcf(0x1a6)]})),{emailToId:_0x104eb4,idToEmail:_0x5a9b61}=_0x3fd701,_0xa9a82f=await withSpinner(_0xe57bcf(0x1d2),async()=>{const _0x38af27=_0xe57bcf,_0x4af08c=await _0x46419[_0x38af27(0x1dc)][_0x38af27(0x21a)]();return buildConnectionMaps(_0x4af08c);},{'verbose':_0x565639[_0xe57bcf(0x1e1)]})[_0xe57bcf(0x1a5)](_0x37ab40=>_0x37ab40[_0xe57bcf(0x213)]),_0x4e3582=_0xa9a82f['nameToId'],_0x818ea6=_0xa9a82f[_0xe57bcf(0x216)],_0x5d85a5=_0xa9a82f[_0xe57bcf(0x1de)],_0x33affa={'emailToIdMap':_0x104eb4,'connectionNameToIdMap':_0x4e3582,'connectionNameToTypeMap':_0x5d85a5,'getSchema':_0x230650=>_0x46419[_0xe57bcf(0x1dc)][_0xe57bcf(0x1fe)](_0x230650)};let {pathToId:_0x5e96ef,idToPath:_0x5ac8d8}=buildFolderMaps(_0x5c896b);const _0xea3b79=buildSegmentLookupMap(_0x3e79e8,_0x5ac8d8),_0x1157f7=buildSegmentNameToIdMap(_0x3e79e8),_0x3b887a=buildJourneyBundleLookupMap(_0x2e4f42,_0x5ac8d8);let _0x5e7bca;if(_0x268dc2){if(!_0x268dc2[_0xe57bcf(0x209)](_0xe57bcf(0x1b9))&&!_0x268dc2[_0xe57bcf(0x209)](_0xe57bcf(0x19d)))return console[_0xe57bcf(0x1ea)](a39_0x320717[_0xe57bcf(0x214)](_0xe57bcf(0x1ca)+_0x268dc2+'\x0a')),0x1;_0x5e7bca=[_0x268dc2];}else _0x5e7bca=findYamlFiles(_0x46313f);if(_0x5e7bca[_0xe57bcf(0x1fb)]===0x0)return console[_0xe57bcf(0x1ea)](a39_0x320717['red'](_0xe57bcf(0x1d1)+_0x46313f+'\x0a')),console[_0xe57bcf(0x1ea)](a39_0x320717[_0xe57bcf(0x1d8)]('Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files')),0x1;let _0x41c3f2,_0x16fffe;try{const _0x243eb7=parseAndClassifyYamlFiles(_0x5e7bca,_0x46313f,{'skipSegments':_0x565639[_0xe57bcf(0x1f6)]});_0x41c3f2=_0x243eb7[_0xe57bcf(0x1bc)],_0x16fffe=_0x243eb7[_0xe57bcf(0x1d3)];const _0x20c9ef=validateParsedFiles(_0x243eb7,_0x46313f);if(_0x20c9ef[_0xe57bcf(0x1fb)]>0x0)return console[_0xe57bcf(0x1ea)](a39_0x320717['red'](_0xe57bcf(0x19c))),console[_0xe57bcf(0x1ea)](formatValidationErrors(_0x20c9ef)),console[_0xe57bcf(0x1ea)](a39_0x320717[_0xe57bcf(0x1a0)](_0xe57bcf(0x1db))),0x1;}catch(_0x4c81b6){return console[_0xe57bcf(0x1ea)](a39_0x320717[_0xe57bcf(0x214)](_0xe57bcf(0x1af)+(_0x4c81b6 instanceof Error?_0x4c81b6[_0xe57bcf(0x212)]:_0x4c81b6))),0x1;}if(_0x41c3f2[_0xe57bcf(0x1fb)]===0x0&&_0x16fffe[_0xe57bcf(0x1fb)]===0x0){const _0x5f241b=_0x565639[_0xe57bcf(0x1f6)]?'journey':_0xe57bcf(0x1b7);return console['error'](a39_0x320717[_0xe57bcf(0x1a0)]('No\x20'+_0x5f241b+_0xe57bcf(0x1e6))),0x0;}const _0x9a66d2=new Map();_0x3e79e8[_0xe57bcf(0x1fb)]>0x0&&!_0x565639[_0xe57bcf(0x1f6)]&&await withSpinner(_0xe57bcf(0x1f5),async()=>{await batchAsync(_0x3e79e8,async _0x231104=>{const _0x51dd39=a39_0xcbab,_0x3d7e7d=await _0x46419['segment'][_0x51dd39(0x1e2)](_0x45d092,_0x231104['id']);_0x9a66d2['set'](_0x231104['id'],_0x3d7e7d);});},{'verbose':_0x565639[_0xe57bcf(0x1e1)]});const {segmentFiles:_0x10b2e0,foldersToCreate:_0x57defc}=await prepareSegmentFiles(_0x41c3f2,{'segmentByFolderAndName':_0xea3b79,'activationsBySegmentId':_0x9a66d2,'folderPathToId':_0x5e96ef,'idToEmailMap':_0x5a9b61,'connectionIdToNameMap':_0x818ea6},_0x33affa,_0x3bf1e7,_0x2af325),_0x30f092=_0x268dc2?[]:findSegmentsToDelete(_0x3e79e8,_0x41c3f2[_0xe57bcf(0x22a)](({yamlConfig:_0x218c32,folderPath:_0x5e04bf})=>({'yamlConfig':_0x218c32,'folderPath':resolveTDFolderPath(_0x5e04bf,_0x3bf1e7,_0x2af325)})),_0x5ac8d8,_0x2af325,_0x3bf1e7),{journeyFiles:_0x41e325,foldersToCreate:_0x1b3994}=await withProgressSpinner(_0xe57bcf(0x230),async _0x4bdfbf=>prepareJourneyFiles(_0x16fffe,{'fetchJourney':async _0x3696eb=>_0x46419[_0xe57bcf(0x1b3)][_0xe57bcf(0x210)](_0x3696eb[_0xe57bcf(0x20e)]),'journeyBundlesByFolderAndName':_0x3b887a,'folderPathToId':_0x5e96ef,'idToEmailMap':_0x5a9b61,'connectionIdToNameMap':_0x818ea6,'existingSegments':_0x3e79e8,'parentId':_0x45d092,'deps':_0x46419,'progress':{'update':_0x13950b=>{const _0x6c338d=_0xe57bcf;_0x4bdfbf[_0x6c338d(0x21e)](_0x13950b),_0x565639[_0x6c338d(0x1e1)]&&console[_0x6c338d(0x1ea)]('\x20\x20'+_0x13950b);}},'journeyById':_0x2e240f,'activationStepsById':_0x3887f2},_0x3bf1e7,_0x2af325),{'verbose':_0x565639[_0xe57bcf(0x1e1)]})[_0xe57bcf(0x1a5)](_0x300ba1=>_0x300ba1[_0xe57bcf(0x213)]);for(const _0x4b0af7 of _0x1b3994){_0x57defc['add'](_0x4b0af7);}const _0x3d3fa1=_0x268dc2?[]:findJourneysToDelete(_0x2e4f42,_0x16fffe[_0xe57bcf(0x22a)](({yamlConfig:_0x5984f2,folderPath:_0x38ac33})=>({'yamlConfig':_0x5984f2,'folderPath':resolveTDFolderPath(_0x38ac33,_0x3bf1e7,_0x2af325)})),_0x5ac8d8,_0x2af325,_0x3bf1e7),_0xfd06fd=calculatePushStats(_0x10b2e0,_0x41e325,_0x57defc,_0x30f092,_0x3d3fa1,!!_0x565639[_0xe57bcf(0x19e)],!!_0x565639[_0xe57bcf(0x1f6)]),_0x292cbe=_0xfd06fd['segments'][_0xe57bcf(0x1dd)],_0x5ebd28=_0xfd06fd[_0xe57bcf(0x1bc)][_0xe57bcf(0x205)],_0x58fc29=_0xfd06fd[_0xe57bcf(0x1bc)]['unchanged'],_0xf94c0b=_0xfd06fd[_0xe57bcf(0x1bc)][_0xe57bcf(0x1a8)],_0x25d0f2=_0xfd06fd[_0xe57bcf(0x221)][_0xe57bcf(0x201)],_0x250d7b=_0xfd06fd[_0xe57bcf(0x1d3)][_0xe57bcf(0x1dd)],_0x3e15d3=_0xfd06fd[_0xe57bcf(0x1d3)]['changed'],_0x550c81=_0xfd06fd[_0xe57bcf(0x1d3)]['unchanged'],_0x18b3bc=_0xfd06fd[_0xe57bcf(0x1d3)][_0xe57bcf(0x1a8)],_0x58a7ec=_0xfd06fd[_0xe57bcf(0x228)][_0xe57bcf(0x224)],_0x554f41=_0xfd06fd['activations']['toCreate'],_0x4fca37=_0xfd06fd[_0xe57bcf(0x228)][_0xe57bcf(0x20f)],_0x57c0ba=_0xfd06fd[_0xe57bcf(0x228)][_0xe57bcf(0x1a8)];console[_0xe57bcf(0x1ea)](_0xe57bcf(0x225)+_0x4c47ff+'\x27:');_0x25d0f2['length']>0x0&&console['error']('\x20\x20'+a39_0x320717[_0xe57bcf(0x1ec)](_0xe57bcf(0x19f)+_0x25d0f2[_0xe57bcf(0x1fb)]+_0xe57bcf(0x1c1)));if(!_0x565639[_0xe57bcf(0x1f6)]){console[_0xe57bcf(0x1ea)](_0xe57bcf(0x220)),console[_0xe57bcf(0x1ea)](_0xe57bcf(0x20d)+a39_0x320717[_0xe57bcf(0x1da)]('+\x20'+_0x292cbe['length']+_0xe57bcf(0x22d))),console['error'](_0xe57bcf(0x20d)+a39_0x320717[_0xe57bcf(0x1a0)]('~\x20'+_0x5ebd28['length']+'\x20changed'));if(_0xf94c0b['length']>0x0)console[_0xe57bcf(0x1ea)](_0xe57bcf(0x20d)+a39_0x320717[_0xe57bcf(0x214)]('-\x20'+_0xf94c0b[_0xe57bcf(0x1fb)]+'\x20to\x20delete'));else _0x30f092[_0xe57bcf(0x1fb)]>0x0&&!_0x565639['delete']&&console[_0xe57bcf(0x1ea)]('\x20\x20\x20\x20'+a39_0x320717[_0xe57bcf(0x1a4)](_0x30f092[_0xe57bcf(0x1fb)]+'\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)'));console[_0xe57bcf(0x1ea)](_0xe57bcf(0x20d)+a39_0x320717['dim']('=\x20'+_0x58fc29[_0xe57bcf(0x1fb)]+_0xe57bcf(0x218)));}if(_0x41e325['length']>0x0||_0x3d3fa1[_0xe57bcf(0x1fb)]>0x0){console[_0xe57bcf(0x1ea)](_0xe57bcf(0x1b5)),console[_0xe57bcf(0x1ea)](_0xe57bcf(0x20d)+a39_0x320717['green']('+\x20'+_0x250d7b[_0xe57bcf(0x1fb)]+_0xe57bcf(0x22d))),console[_0xe57bcf(0x1ea)](_0xe57bcf(0x20d)+a39_0x320717[_0xe57bcf(0x1a0)]('~\x20'+_0x3e15d3[_0xe57bcf(0x1fb)]+_0xe57bcf(0x1bd)));if(_0x18b3bc[_0xe57bcf(0x1fb)]>0x0)console['error'](_0xe57bcf(0x20d)+a39_0x320717[_0xe57bcf(0x214)]('-\x20'+_0x18b3bc[_0xe57bcf(0x1fb)]+'\x20to\x20delete'));else _0x3d3fa1['length']>0x0&&!_0x565639[_0xe57bcf(0x19e)]&&console[_0xe57bcf(0x1ea)](_0xe57bcf(0x20d)+a39_0x320717[_0xe57bcf(0x1a4)](_0x3d3fa1[_0xe57bcf(0x1fb)]+_0xe57bcf(0x1a1)));console[_0xe57bcf(0x1ea)](_0xe57bcf(0x20d)+a39_0x320717[_0xe57bcf(0x1a4)]('=\x20'+_0x550c81['length']+_0xe57bcf(0x218)));}_0x58a7ec['length']>0x0&&!_0x565639['journeysOnly']&&(console[_0xe57bcf(0x1ea)](''),console['error']('\x20\x20Activations:'),_0x554f41[_0xe57bcf(0x1fb)]>0x0&&console[_0xe57bcf(0x1ea)](_0xe57bcf(0x20d)+a39_0x320717[_0xe57bcf(0x1da)]('+\x20'+_0x554f41['length']+'\x20to\x20create')),_0x4fca37['length']>0x0&&console['error'](_0xe57bcf(0x20d)+a39_0x320717['yellow']('~\x20'+_0x4fca37[_0xe57bcf(0x1fb)]+_0xe57bcf(0x1c6))),_0x57c0ba['length']>0x0&&console[_0xe57bcf(0x1ea)]('\x20\x20\x20\x20'+a39_0x320717[_0xe57bcf(0x214)]('-\x20'+_0x57c0ba[_0xe57bcf(0x1fb)]+_0xe57bcf(0x1fa))));console['error'](_0xe57bcf(0x217)+a39_0x320717[_0xe57bcf(0x1d8)](_0x46313f)+'\x0a');if(_0x25d0f2[_0xe57bcf(0x1fb)]>0x0){console[_0xe57bcf(0x1ea)]('Folders\x20to\x20create:');for(const _0x11c217 of _0x25d0f2){console[_0xe57bcf(0x1ea)]('\x20\x20'+a39_0x320717[_0xe57bcf(0x1ec)]('+')+'\x20'+_0x11c217);}console[_0xe57bcf(0x1ea)]('');}if(_0x292cbe['length']>0x0&&!_0x565639[_0xe57bcf(0x1f6)])for(const _0x38578e of _0x292cbe){const _0x403589=_0x38578e[_0xe57bcf(0x1f7)]?_0x38578e[_0xe57bcf(0x1f7)]+'/'+_0x38578e[_0xe57bcf(0x22b)][_0xe57bcf(0x223)]:_0x38578e[_0xe57bcf(0x22b)]['name'],_0x5afa43=_0x38578e[_0xe57bcf(0x22b)][_0xe57bcf(0x228)]?.['length']||0x0,_0x22c922=_0x5afa43>0x0?a39_0x320717['dim']('\x20['+_0x5afa43+_0xe57bcf(0x21b)):'';console[_0xe57bcf(0x1ea)]('\x0a'+a39_0x320717[_0xe57bcf(0x1da)](_0xe57bcf(0x1b6))+'\x20'+_0x403589+_0x22c922),console[_0xe57bcf(0x1ea)]('─'[_0xe57bcf(0x1b2)](0x3c)),_0x38578e[_0xe57bcf(0x1d4)]&&console['error'](_0x38578e[_0xe57bcf(0x1d4)]),console['error']('─'[_0xe57bcf(0x1b2)](0x3c));}if(_0xf94c0b['length']>0x0&&!_0x565639[_0xe57bcf(0x1f6)])for(const _0x2b036e of _0xf94c0b){const _0x9436e6=_0x2b036e['segmentFolderId']?_0x5ac8d8['get'](_0x2b036e[_0xe57bcf(0x1bb)]['toString']())||'':'',_0x2e5d12=_0x9436e6?_0x9436e6+'/'+_0x2b036e[_0xe57bcf(0x223)]:_0x2b036e[_0xe57bcf(0x223)],_0x1cec9a=_0x9a66d2[_0xe57bcf(0x1a7)](_0x2b036e['id'])||[],_0x120618=_0x1cec9a['length']>0x0?a39_0x320717[_0xe57bcf(0x1a4)]('\x20['+_0x1cec9a['length']+_0xe57bcf(0x21b)):'';console[_0xe57bcf(0x1ea)]('\x0a'+a39_0x320717[_0xe57bcf(0x214)](_0xe57bcf(0x215))+'\x20'+_0x2e5d12+_0x120618),console['error']('─'[_0xe57bcf(0x1b2)](0x3c));const _0x20ad6a=segmentWithActivationsToYaml(_0x2b036e,_0x1cec9a,undefined,_0x5a9b61,_0x818ea6),_0x34ee9d=segmentToYamlString(_0x20ad6a),_0x24b763=generateDiff(_0x34ee9d,'');console[_0xe57bcf(0x1ea)](formatDiffWithColors(_0x24b763)),console[_0xe57bcf(0x1ea)]('─'[_0xe57bcf(0x1b2)](0x3c));}const _0x2acfcb=_0x10b2e0['filter'](_0x5d0879=>!_0x5d0879[_0xe57bcf(0x1f9)]&&_0x5d0879['diff']);if(_0x2acfcb[_0xe57bcf(0x1fb)]>0x0&&!_0x565639[_0xe57bcf(0x1f6)])for(const _0x444c85 of _0x2acfcb){const _0x16a1e7=_0x444c85[_0xe57bcf(0x1f7)]?_0x444c85[_0xe57bcf(0x1f7)]+'/'+_0x444c85[_0xe57bcf(0x22b)]['name']:_0x444c85[_0xe57bcf(0x22b)][_0xe57bcf(0x223)];console['error']('\x0a'+a39_0x320717['yellow'](_0xe57bcf(0x1e3))+'\x20'+_0x16a1e7),console['error']('─'[_0xe57bcf(0x1b2)](0x3c)),console[_0xe57bcf(0x1ea)](_0x444c85[_0xe57bcf(0x1d4)]),console[_0xe57bcf(0x1ea)]('─'[_0xe57bcf(0x1b2)](0x3c));}if(_0x250d7b[_0xe57bcf(0x1fb)]>0x0)for(const _0x5281d1 of _0x250d7b){const _0x2c56cc=_0x5281d1[_0xe57bcf(0x1f7)]?_0x5281d1[_0xe57bcf(0x1f7)]+'/'+_0x5281d1[_0xe57bcf(0x22b)][_0xe57bcf(0x223)]:_0x5281d1['yamlConfig'][_0xe57bcf(0x223)];console[_0xe57bcf(0x1ea)]('\x0a'+a39_0x320717['green'](_0xe57bcf(0x23b))+'\x20'+_0x2c56cc),console['error']('─'[_0xe57bcf(0x1b2)](0x3c)),_0x5281d1['diff']&&console[_0xe57bcf(0x1ea)](_0x5281d1['diff']),console[_0xe57bcf(0x1ea)]('─'[_0xe57bcf(0x1b2)](0x3c));}const _0x2e8188=_0x41e325['filter'](_0x1291dc=>!_0x1291dc['isNew']&&_0x1291dc[_0xe57bcf(0x1d4)]);if(_0x2e8188[_0xe57bcf(0x1fb)]>0x0)for(const _0x15dea2 of _0x2e8188){const _0x24bc4a=_0x15dea2[_0xe57bcf(0x1f7)]?_0x15dea2[_0xe57bcf(0x1f7)]+'/'+_0x15dea2[_0xe57bcf(0x22b)][_0xe57bcf(0x223)]:_0x15dea2[_0xe57bcf(0x22b)][_0xe57bcf(0x223)];console[_0xe57bcf(0x1ea)]('\x0a'+a39_0x320717[_0xe57bcf(0x1a0)](_0xe57bcf(0x1fd))+'\x20'+_0x24bc4a),console[_0xe57bcf(0x1ea)]('─'[_0xe57bcf(0x1b2)](0x3c)),console[_0xe57bcf(0x1ea)](_0x15dea2[_0xe57bcf(0x1d4)]),console[_0xe57bcf(0x1ea)]('─'['repeat'](0x3c));}if(_0x18b3bc[_0xe57bcf(0x1fb)]>0x0)for(const _0x106b7b of _0x18b3bc){const _0x388095=_0x106b7b[_0xe57bcf(0x1ae)]?_0x5ac8d8[_0xe57bcf(0x1a7)](_0x106b7b[_0xe57bcf(0x1ae)])||'':'',_0x3d1f00=_0x388095?_0x388095+'/'+_0x106b7b[_0xe57bcf(0x1e5)]:_0x106b7b[_0xe57bcf(0x1e5)];console[_0xe57bcf(0x1ea)]('\x0a'+a39_0x320717[_0xe57bcf(0x214)](_0xe57bcf(0x1ad))+'\x20'+_0x3d1f00),console[_0xe57bcf(0x1ea)]('─'['repeat'](0x3c)),console[_0xe57bcf(0x1ea)](a39_0x320717[_0xe57bcf(0x214)](_0xe57bcf(0x1b1))),console[_0xe57bcf(0x1ea)]('─'[_0xe57bcf(0x1b2)](0x3c));}if(_0x565639[_0xe57bcf(0x1cb)])return console[_0xe57bcf(0x1ea)](a39_0x320717[_0xe57bcf(0x1a0)](_0xe57bcf(0x222))),0x0;const _0x2a1de3=_0x565639[_0xe57bcf(0x1f6)]?![]:_0x292cbe[_0xe57bcf(0x1fb)]>0x0||_0x5ebd28[_0xe57bcf(0x1fb)]>0x0||_0xf94c0b[_0xe57bcf(0x1fb)]>0x0,_0x340381=_0x250d7b[_0xe57bcf(0x1fb)]>0x0||_0x3e15d3[_0xe57bcf(0x1fb)]>0x0||_0x18b3bc[_0xe57bcf(0x1fb)]>0x0,_0xad1e67=_0x565639[_0xe57bcf(0x1f6)]?![]:_0x58a7ec[_0xe57bcf(0x1fb)]>0x0,_0x2419c9=_0x25d0f2['length']>0x0;if(!_0x2a1de3&&!_0x340381&&!_0xad1e67&&!_0x2419c9){const _0x33d990=_0x565639[_0xe57bcf(0x1f6)]?_0xe57bcf(0x1a2):'βœ”\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date';console[_0xe57bcf(0x1ea)](a39_0x320717[_0xe57bcf(0x1da)](_0x33d990));if(_0x268dc2&&_0x58fc29['length']===0x1){const _0x4f4319=_0x58fc29[0x0];if(_0x4f4319[_0xe57bcf(0x1cc)]?.['id']){const _0x26203e=getConsoleNextUrl(_0x565639[_0xe57bcf(0x1eb)],_0xe57bcf(0x1ed)+_0x45d092+_0xe57bcf(0x1c3)+_0x4f4319[_0xe57bcf(0x1cc)]['id']+_0xe57bcf(0x231));console[_0xe57bcf(0x1ea)](_0xe57bcf(0x1ab)+a39_0x320717[_0xe57bcf(0x1d8)](_0x26203e));}}if(_0x268dc2&&_0x550c81[_0xe57bcf(0x1fb)]===0x1){const _0x36dca7=_0x550c81[0x0];if(_0x36dca7[_0xe57bcf(0x219)]?.['id']){const _0x3aa730=getConsoleNextUrl(_0x565639[_0xe57bcf(0x1eb)],'/app/ps/'+_0x45d092+_0xe57bcf(0x1c3)+_0x36dca7[_0xe57bcf(0x219)]['id']+'/j/da/je');console[_0xe57bcf(0x1ea)]('\x20\x20'+a39_0x320717[_0xe57bcf(0x1d8)](_0x3aa730));}}return 0x0;}const _0x645e2e=_0x565639[_0xe57bcf(0x1f6)]?_0x250d7b[_0xe57bcf(0x1fb)]+_0x3e15d3[_0xe57bcf(0x1fb)]+_0x18b3bc[_0xe57bcf(0x1fb)]+_0x25d0f2[_0xe57bcf(0x1fb)]:_0x292cbe[_0xe57bcf(0x1fb)]+_0x5ebd28[_0xe57bcf(0x1fb)]+_0xf94c0b[_0xe57bcf(0x1fb)]+_0x250d7b[_0xe57bcf(0x1fb)]+_0x3e15d3[_0xe57bcf(0x1fb)]+_0x18b3bc['length']+_0x25d0f2[_0xe57bcf(0x1fb)]+_0x58a7ec[_0xe57bcf(0x1fb)];if(!_0x565639[_0xe57bcf(0x1d7)]&&_0x645e2e>0x0){if(!isInteractive())return console[_0xe57bcf(0x1ea)](a39_0x320717[_0xe57bcf(0x214)]('\x0aError:'),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0xe57bcf(0x1ea)](a39_0x320717[_0xe57bcf(0x1a4)](_0xe57bcf(0x208))),0x1;const _0x26298d=await confirmKey(_0xe57bcf(0x236)+_0x645e2e+_0xe57bcf(0x1cd));if(!_0x26298d)return console[_0xe57bcf(0x1ea)](a39_0x320717[_0xe57bcf(0x1a0)]('Aborted.')),0x1;}const _0x4b75fe={'withProgress':async(_0x31a580,_0x1eeb10)=>{const _0x314942=_0xe57bcf,_0x1bb4bb=await withSpinner(_0x31a580,_0x1eeb10,{'verbose':_0x565639['verbose']});return{'data':_0x1bb4bb[_0x314942(0x213)]};},'logInfo':_0x5d28c3=>console[_0xe57bcf(0x1ea)](a39_0x320717[_0xe57bcf(0x1ec)]('βœ”\x20'+_0x5d28c3)),'logSuccess':_0x48b87b=>console[_0xe57bcf(0x1ea)](a39_0x320717['green']('βœ”\x20'+_0x48b87b)),'logWarning':_0x169020=>console[_0xe57bcf(0x1ea)](a39_0x320717['yellow']('⚠\x20'+_0x169020)),'logDeleted':_0x113156=>console['error'](a39_0x320717[_0xe57bcf(0x214)]('βœ”\x20'+_0x113156))},_0x2468f9={'segment':_0x46419['segment'],'journey':_0x46419[_0xe57bcf(0x1b3)],'user':_0x46419[_0xe57bcf(0x1ef)],'connection':_0x46419[_0xe57bcf(0x1dc)]};_0x25d0f2[_0xe57bcf(0x1fb)]>0x0&&(_0x5e96ef=await executePushFolders(_0x2468f9,_0x25d0f2,_0x5e96ef,{'parentId':_0x45d092},_0x4b75fe));const _0x4a63eb={'rootFolderId':_0x1a7416,'folderPathToId':_0x5e96ef,'folderIdToPath':_0x5ac8d8,'segmentNameToId':_0x1157f7,'activationsBySegmentId':_0x9a66d2,'emailToIdMap':_0x104eb4,'idToEmailMap':_0x5a9b61,'connectionNameToIdMap':_0xa9a82f[_0xe57bcf(0x1fc)],'connectionIdToNameMap':_0xa9a82f[_0xe57bcf(0x216)],'connectionNameToTypeMap':_0x5d85a5},_0x2a1e9d=await executePushSegments(_0x2468f9,_0x565639[_0xe57bcf(0x1f6)]?[]:_0x10b2e0,_0x4a63eb,{'parentId':_0x45d092},_0x4b75fe),_0x3ff1f1=_0x2a1e9d[_0xe57bcf(0x1ff)],_0x314e91=_0x2a1e9d[_0xe57bcf(0x20b)],_0x58cc3c=_0x2a1e9d[_0xe57bcf(0x228)][_0xe57bcf(0x1ff)],_0xba49fe=_0x2a1e9d['activations']['updated'],_0x205433=_0x2a1e9d[_0xe57bcf(0x228)][_0xe57bcf(0x21c)];let _0x5a1adf;if(_0x268dc2&&_0x10b2e0[_0xe57bcf(0x1fb)]===0x1){const _0x5d4f0d=_0x10b2e0[0x0];_0x5a1adf=_0x5d4f0d[_0xe57bcf(0x1cc)]?.['id']??_0x2a1e9d[_0xe57bcf(0x232)]['get'](_0x5d4f0d['yamlConfig'][_0xe57bcf(0x223)]);}const _0x15ea72=await executePushSegmentDeletions(_0x2468f9,_0x565639[_0xe57bcf(0x1f6)]?[]:_0xf94c0b,_0x4b75fe);let _0x40e9cd=0x0,_0xf54358=0x0,_0x24cc24=0x0;const _0x224435=new Map(_0x1157f7);for(const [_0x4e6a46,_0x1429be]of _0x2a1e9d['createdSegmentIds']){_0x224435[_0xe57bcf(0x21d)](_0x4e6a46,_0x1429be);}if(_0x41e325['length']>0x0){const _0x1e143f={..._0x4a63eb,'segmentNameToId':_0x224435,'existingSegments':_0x3e79e8,'activationContext':_0x33affa},_0x37b452=await executePushJourneys(_0x2468f9,_0x41e325,_0x1e143f,{'parentId':_0x45d092,'rootFolderId':_0x1a7416,'verbose':_0x565639[_0xe57bcf(0x1e1)]},_0x4b75fe);_0x40e9cd=_0x37b452[_0xe57bcf(0x1ff)],_0xf54358=_0x37b452[_0xe57bcf(0x20b)];if(_0x268dc2&&_0x37b452[_0xe57bcf(0x1c2)][_0xe57bcf(0x1fb)]===0x1){const _0x4b8bd8=_0x37b452[_0xe57bcf(0x1c2)][0x0];if(_0x4b8bd8['journeyId']){const _0x135770=getConsoleNextUrl(_0x565639[_0xe57bcf(0x1eb)],_0xe57bcf(0x1ed)+_0x45d092+_0xe57bcf(0x1c3)+_0x4b8bd8[_0xe57bcf(0x20e)]+_0xe57bcf(0x233));console[_0xe57bcf(0x1ea)]('\x20\x20'+a39_0x320717[_0xe57bcf(0x1d8)](_0x135770));}}}for(const _0x548baa of _0x18b3bc){console['error'](a39_0x320717[_0xe57bcf(0x1a0)](_0xe57bcf(0x1c8)+_0x548baa[_0xe57bcf(0x1e5)])),_0x24cc24++;}const _0x4f6adc=[];if(_0x3ff1f1>0x0)_0x4f6adc[_0xe57bcf(0x1a9)](_0x3ff1f1+_0xe57bcf(0x1f3));if(_0x314e91>0x0)_0x4f6adc[_0xe57bcf(0x1a9)](_0x314e91+'\x20updated');if(_0x15ea72>0x0)_0x4f6adc[_0xe57bcf(0x1a9)](_0x15ea72+_0xe57bcf(0x20a));const _0x35e08e=[];if(_0x40e9cd>0x0)_0x35e08e[_0xe57bcf(0x1a9)](_0x40e9cd+'\x20created');if(_0xf54358>0x0)_0x35e08e[_0xe57bcf(0x1a9)](_0xf54358+_0xe57bcf(0x1e7));if(_0x24cc24>0x0)_0x35e08e[_0xe57bcf(0x1a9)](_0x24cc24+'\x20deleted');const _0x43769f=[];if(_0x58cc3c>0x0)_0x43769f[_0xe57bcf(0x1a9)](_0x58cc3c+_0xe57bcf(0x1f3));if(_0xba49fe>0x0)_0x43769f[_0xe57bcf(0x1a9)](_0xba49fe+_0xe57bcf(0x1e7));if(_0x205433>0x0)_0x43769f['push'](_0x205433+'\x20deleted');console[_0xe57bcf(0x1ea)](a39_0x320717[_0xe57bcf(0x1da)](_0xe57bcf(0x1f0)));_0x4f6adc[_0xe57bcf(0x1fb)]>0x0&&!_0x565639[_0xe57bcf(0x1f6)]&&console[_0xe57bcf(0x1ea)](_0xe57bcf(0x204)+_0x4f6adc['join'](',\x20'));_0x35e08e[_0xe57bcf(0x1fb)]>0x0&&console['error']('\x20\x20Journeys:\x20'+_0x35e08e[_0xe57bcf(0x1e8)](',\x20'));_0x43769f[_0xe57bcf(0x1fb)]>0x0&&!_0x565639[_0xe57bcf(0x1f6)]&&console['error'](_0xe57bcf(0x23c)+_0x43769f[_0xe57bcf(0x1e8)](',\x20'));if(_0x5a1adf){const _0x5ac147=getConsoleNextUrl(_0x565639[_0xe57bcf(0x1eb)],_0xe57bcf(0x1ed)+_0x45d092+_0xe57bcf(0x1c3)+_0x5a1adf+_0xe57bcf(0x231));console[_0xe57bcf(0x1ea)](_0xe57bcf(0x1ab)+a39_0x320717['cyan'](_0x5ac147));}return 0x0;}}