@treasuredata/tdx 2026.3.10 β†’ 2026.3.12

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 (201) 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.js +1 -1
  130. package/dist/sdk/segment/fields-display.js +1 -1
  131. package/dist/sdk/segment/file-discovery.js +1 -1
  132. package/dist/sdk/segment/journey-utils.js +1 -1
  133. package/dist/sdk/segment/journey-validator.js +1 -1
  134. package/dist/sdk/segment/journey-yaml.js +1 -1
  135. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  136. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  137. package/dist/sdk/segment/pull-workflow.js +1 -1
  138. package/dist/sdk/segment/push-recovery.js +1 -1
  139. package/dist/sdk/segment/push-workflow.js +1 -1
  140. package/dist/sdk/segment/resolution-context.js +1 -1
  141. package/dist/sdk/segment/segment-path-parser.js +1 -1
  142. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  143. package/dist/sdk/segment/segment-validator.js +1 -1
  144. package/dist/sdk/segment/target-resolution.js +1 -1
  145. package/dist/sdk/segment/tdx-config.js +1 -1
  146. package/dist/sdk/segment/types/activation-schema.js +1 -1
  147. package/dist/sdk/segment/types/journey-def.js +1 -1
  148. package/dist/sdk/segment/types/journey-schema.js +1 -1
  149. package/dist/sdk/segment/types/segment-def.js +1 -1
  150. package/dist/sdk/segment/types/segment-schema.js +1 -1
  151. package/dist/sdk/segment/validate-files.js +1 -1
  152. package/dist/sdk/segment/yaml-validator.js +1 -1
  153. package/dist/sdk/segment.js +1 -1
  154. package/dist/sdk/types/index.js +1 -1
  155. package/dist/sdk/types/progress.js +1 -1
  156. package/dist/sdk/user.js +1 -1
  157. package/dist/sdk/util/format-detector.js +1 -1
  158. package/dist/sdk/util/formatters.js +1 -1
  159. package/dist/sdk/util/index.js +1 -1
  160. package/dist/sdk/util/paginate.js +1 -1
  161. package/dist/sdk/util/tree-formatter.js +1 -1
  162. package/dist/sdk/workflow/archive-validation.js +1 -1
  163. package/dist/sdk/workflow/clone-workflow.js +1 -1
  164. package/dist/sdk/workflow/index.js +1 -1
  165. package/dist/sdk/workflow/pull-workflow.js +1 -1
  166. package/dist/sdk/workflow/push-workflow.js +1 -1
  167. package/dist/sdk/workflow/tdx-config.js +1 -1
  168. package/dist/sdk/workflow/workflow-utils.js +1 -1
  169. package/dist/test-utils/command-runner.js +1 -1
  170. package/dist/test-utils/factories.js +1 -1
  171. package/dist/test-utils/fixtures.js +1 -1
  172. package/dist/test-utils/http-mock.js +1 -1
  173. package/dist/test-utils/index.js +1 -1
  174. package/dist/utils/async.js +1 -1
  175. package/dist/utils/colors.js +1 -1
  176. package/dist/utils/diff.js +1 -1
  177. package/dist/utils/file-permissions.js +1 -1
  178. package/dist/utils/file-reader.js +1 -1
  179. package/dist/utils/github-releases.js +1 -1
  180. package/dist/utils/global-cache.js +1 -1
  181. package/dist/utils/json-loader.js +1 -1
  182. package/dist/utils/local-cache.js +1 -1
  183. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  184. package/dist/utils/logger/formatters/index.js +1 -1
  185. package/dist/utils/logger/handlers/console-handler.js +1 -1
  186. package/dist/utils/logger/handlers/file-handler.js +1 -1
  187. package/dist/utils/logger/handlers/index.js +1 -1
  188. package/dist/utils/logger/handlers/null-handler.js +1 -1
  189. package/dist/utils/logger/index.js +1 -1
  190. package/dist/utils/logger/logger.js +1 -1
  191. package/dist/utils/logger/types.js +1 -1
  192. package/dist/utils/option-validation.js +1 -1
  193. package/dist/utils/process.js +1 -1
  194. package/dist/utils/prompt.js +1 -1
  195. package/dist/utils/spinner.js +1 -1
  196. package/dist/utils/sse-parser.js +1 -1
  197. package/dist/utils/string-utils.js +1 -1
  198. package/dist/utils/table-ref-parser.js +1 -1
  199. package/dist/utils/tdx-logger.js +1 -1
  200. package/dist/utils/version-check.js +1 -1
  201. package/package.json +1 -1
@@ -1 +1 @@
1
- function a34_0x417a(){const _0x39b041=['Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20update\x20<name>\x20[options]','name','engineVersion','has_next_page','delete','\x20\x20Database:\x20','27589991GeHbKU','args','start_at','delay','verbose','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20delete\x20<name>','priority','getTime','trim','query','Getting\x20schedule\x20details...','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20history\x20<name>\x20[--from\x20<n>]\x20[--to\x20<n>]','data','last_job','trino','nextRun','num','toLocaleDateString','status','show','\x20\x20Type:\x20','next_run_at','(unnamed)','update','execute','ies','validate','substring','16433280Lngkrv','Getting\x20schedule\x20history...','\x20execution','user_name','padEnd','output','format','created_at','cyan','schedule:show','\x20(use\x20--limit\x20to\x20see\x20more)','schedules','retry_limit','result','11JIfNTx','round','Updating\x20schedule:\x20','map','retryLimit','statusIcon','\x20\x20Cron:\x20','schedule:list','length','options','time_zone','/app/queries/editor?queryId=','create','keys','success','Found\x20','error','\x20\x20Job\x20ID:\x20','timezone','just\x20now','Running\x20schedule...','886554ohIcKn','type','soon','Showing\x20first\x20','19984toXLxg','2548SUGGAc','Updating\x20schedule...','time','max','Running\x20schedule:\x20','No\x20scheduled\x20queries\x20found','Database\x20is\x20required\x0aUsage:\x20job\x20schedule\x20create\x20<name>\x20-d\x20<db>\x20--file\x20<path>\x20[options]','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20schedule\x20\x22','7iaattV','join','\x22...','Failed\x20to\x20read\x20file:\x20','utf-8','from','lastRun','never','end_at','h\x20ago','green','in\x20','schedule:history','\x20\x20Timezone:\x20','13310qryXod','repeat','listQueries','user','\x20created','3785358eiBKyi','abs','Cancelled','cron','schedule:delete','List\x20scheduled\x20queries','d\x20ago','jsonl','INVALID_ARGUMENT','updated_at','history','Query\x20file\x20is\x20empty','engine_version','2484jTTSiN','entries','scheduled_at','Show\x20schedule\x20execution\x20history','database','Run\x20a\x20scheduled\x20query\x20immediately','description','file','schedule:create','tsv','red','Searching\x20scheduled\x20queries\x20matching\x20\x22','limit','pagination','job_id','ended_at','317742ggQktB','Schedule\x20updated:\x20','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20run\x20<name>\x20[--time\x20<iso8601>]\x20[--num\x20<1-10>]','schedule:run'];a34_0x417a=function(){return _0x39b041;};return a34_0x417a();}const a34_0x1ef183=a34_0x4faa;(function(_0x46276b,_0x35b6c5){const _0x3f2f46=a34_0x4faa,_0x3616c0=_0x46276b();while(!![]){try{const _0x34d54a=parseInt(_0x3f2f46(0x249))/0x1*(-parseInt(_0x3f2f46(0x215))/0x2)+parseInt(_0x3f2f46(0x25e))/0x3+parseInt(_0x3f2f46(0x263))/0x4*(-parseInt(_0x3f2f46(0x1f3))/0x5)+-parseInt(_0x3f2f46(0x1f8))/0x6*(-parseInt(_0x3f2f46(0x26b))/0x7)+-parseInt(_0x3f2f46(0x262))/0x8*(parseInt(_0x3f2f46(0x205))/0x9)+parseInt(_0x3f2f46(0x23b))/0xa+parseInt(_0x3f2f46(0x21f))/0xb;if(_0x34d54a===_0x35b6c5)break;else _0x3616c0['push'](_0x3616c0['shift']());}catch(_0x11c089){_0x3616c0['push'](_0x3616c0['shift']());}}}(a34_0x417a,0xe6c2d));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput,writeOutput}from'../core/command-output.js';function a34_0x4faa(_0xb0d9d8,_0x433229){_0xb0d9d8=_0xb0d9d8-0x1e8;const _0x417aa8=a34_0x417a();let _0x4faac9=_0x417aa8[_0xb0d9d8];return _0x4faac9;}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_0xc4b67b from'chalk';function formatRelativeTime(_0x26f2a6){const _0x2f26b5=a34_0x4faa,_0x426c4b=new Date(_0x26f2a6),_0x510a10=new Date(),_0x2dd5d8=_0x426c4b['getTime']()-_0x510a10[_0x2f26b5(0x226)](),_0x1c0c58=Math[_0x2f26b5(0x1f9)](_0x2dd5d8)/0x3e8,_0x41f00e=_0x2dd5d8<0x0;if(_0x1c0c58<0x3c)return _0x41f00e?_0x2f26b5(0x25c):_0x2f26b5(0x260);else{if(_0x1c0c58<0xe10){const _0x187039=Math[_0x2f26b5(0x24a)](_0x1c0c58/0x3c);return _0x41f00e?_0x187039+'m\x20ago':_0x2f26b5(0x1f0)+_0x187039+'m';}else{if(_0x1c0c58<0x15180){const _0x5b5933=Math[_0x2f26b5(0x24a)](_0x1c0c58/0xe10);return _0x41f00e?_0x5b5933+_0x2f26b5(0x1ee):_0x2f26b5(0x1f0)+_0x5b5933+'h';}else{if(_0x1c0c58<0x93a80){const _0x3922d7=Math[_0x2f26b5(0x24a)](_0x1c0c58/0x15180);return _0x41f00e?_0x3922d7+_0x2f26b5(0x1fe):_0x2f26b5(0x1f0)+_0x3922d7+'d';}else return _0x426c4b[_0x2f26b5(0x230)]();}}}}export class ScheduleListCommand extends BaseCommand{[a34_0x1ef183(0x21a)]=a34_0x1ef183(0x250);['description']=a34_0x1ef183(0x1fd);async['execute'](_0x358875){const _0x32c223=a34_0x1ef183,{options:_0x39320c,args:_0xe033fb,tdx:_0xa795ff}=_0x358875,_0x52e75c=resolveLimit(_0x39320c[_0x32c223(0x211)],DEFAULT_DISPLAY_LIMIT),_0x3bcc96=_0xe033fb[0x0],_0x544237=_0x3bcc96?_0x32c223(0x210)+_0x3bcc96+_0x32c223(0x26d):'Listing\x20scheduled\x20queries...',_0x4d939d=await withSpinner(_0x544237,()=>_0xa795ff[_0x32c223(0x246)][_0x32c223(0x1f5)]({'limit':_0x52e75c,'scheduled':!![],'pattern':_0x3bcc96}),{'verbose':_0x39320c['verbose']}),_0x99cdf=_0x4d939d['data']['queries'],_0x467cb1=_0x4d939d[_0x32c223(0x22b)][_0x32c223(0x212)][_0x32c223(0x21c)],_0x9de846=_0x3bcc96?'\x20matching\x20\x22'+_0x3bcc96+'\x22':'';_0x467cb1?console['error'](_0x32c223(0x261)+_0x99cdf[_0x32c223(0x251)]+'\x20schedules'+_0x9de846+_0x32c223(0x245)):console[_0x32c223(0x259)](_0x32c223(0x258)+_0x99cdf[_0x32c223(0x251)]+'\x20scheduled\x20quer'+(_0x99cdf['length']!==0x1?_0x32c223(0x238):'y')+_0x9de846);if(_0x39320c[_0x32c223(0x241)]==='json'||_0x39320c[_0x32c223(0x241)]===_0x32c223(0x1ff)||_0x39320c[_0x32c223(0x241)]==='table'||_0x39320c[_0x32c223(0x241)]===_0x32c223(0x20e)){const _0x1d9dbe=_0x99cdf['map'](_0x4711a0=>({'id':_0x4711a0['id'],'name':_0x4711a0['name'],'cron':_0x4711a0[_0x32c223(0x1fb)],'database':_0x4711a0[_0x32c223(0x209)]?.[_0x32c223(0x21a)],'type':_0x4711a0[_0x32c223(0x25f)],'timezone':_0x4711a0[_0x32c223(0x253)],'user_name':_0x4711a0[_0x32c223(0x1f6)]?.[_0x32c223(0x21a)],'updated_at':_0x4711a0[_0x32c223(0x201)],'next_run_at':_0x4711a0[_0x32c223(0x234)],'last_job_status':_0x4711a0['last_job']?.[_0x32c223(0x231)]}));await handleSDKOutput(_0x1d9dbe,_0x39320c);}else{if(_0x99cdf[_0x32c223(0x251)]===0x0)console['log'](_0x32c223(0x268));else{const _0x55c97c=_0x39320c['site'],_0x179308=_0x99cdf[_0x32c223(0x24c)](_0x1633df=>{const _0x425d3d=_0x32c223,_0x1e6861=_0x1633df[_0x425d3d(0x22c)]?.[_0x425d3d(0x231)]?_0x1633df['last_job'][_0x425d3d(0x231)]===_0x425d3d(0x257)?'βœ“':'βœ—':'-',_0x30a5e8=_0x1633df[_0x425d3d(0x22c)]?.['ended_at']?formatRelativeTime(_0x1633df[_0x425d3d(0x22c)][_0x425d3d(0x214)]):_0x425d3d(0x1ec),_0x2e9bbd=_0x1633df[_0x425d3d(0x234)]?formatRelativeTime(_0x1633df['next_run_at']):'-',_0x2a51ca=_0x1633df[_0x425d3d(0x1fb)]||'',_0x4b5a94=_0x1633df['name']||_0x425d3d(0x235),_0x2a73fe=getConsoleUrl(_0x55c97c,_0x425d3d(0x254)+_0x1633df['id']);return{'statusIcon':_0x1e6861,'lastRun':_0x30a5e8,'nextRun':_0x2e9bbd,'cron':_0x2a51ca,'name':_0x4b5a94,'queryUrl':_0x2a73fe,'status':_0x1633df[_0x425d3d(0x22c)]?.[_0x425d3d(0x231)]};}),_0x2dbd03=Math[_0x32c223(0x266)](..._0x179308[_0x32c223(0x24c)](_0x438400=>_0x438400[_0x32c223(0x1eb)]['length'])),_0x5bb21f=Math[_0x32c223(0x266)](..._0x179308[_0x32c223(0x24c)](_0x31e33b=>_0x31e33b[_0x32c223(0x22e)][_0x32c223(0x251)])),_0x4357bb=Math['max'](..._0x179308[_0x32c223(0x24c)](_0x1db5e8=>_0x1db5e8[_0x32c223(0x1fb)][_0x32c223(0x251)])),_0x310644=_0x179308[_0x32c223(0x24c)](_0x55882b=>{const _0xbbce0d=_0x32c223,_0x1e7b48=_0x55882b[_0xbbce0d(0x231)]==='success'?a34_0xc4b67b[_0xbbce0d(0x1ef)](_0x55882b[_0xbbce0d(0x24e)]):_0x55882b[_0xbbce0d(0x231)]===_0xbbce0d(0x259)?a34_0xc4b67b[_0xbbce0d(0x20f)](_0x55882b[_0xbbce0d(0x24e)]):a34_0xc4b67b['dim'](_0x55882b['statusIcon']),_0x4045a2=_0x55882b[_0xbbce0d(0x1eb)][_0xbbce0d(0x23f)](_0x2dbd03),_0x94dab=_0x55882b[_0xbbce0d(0x22e)][_0xbbce0d(0x23f)](_0x5bb21f),_0x11d627=_0x55882b[_0xbbce0d(0x1fb)]?a34_0xc4b67b[_0xbbce0d(0x243)](_0x55882b[_0xbbce0d(0x1fb)][_0xbbce0d(0x23f)](_0x4357bb)):'\x20'[_0xbbce0d(0x1f4)](_0x4357bb),_0x597ba2=hyperlink(_0x55882b['name'],_0x55882b['queryUrl']);return'πŸ“…\x20'+_0x1e7b48+'\x20'+_0x4045a2+'\x20\x20β†’\x20'+_0x94dab+'\x20\x20'+_0x11d627+'\x20\x20'+_0x597ba2;});await writeOutput(_0x310644[_0x32c223(0x26c)]('\x0a'),_0x39320c[_0x32c223(0x240)],'list');}}return 0x0;}}export class ScheduleShowCommand extends BaseCommand{[a34_0x1ef183(0x21a)]=a34_0x1ef183(0x244);[a34_0x1ef183(0x20b)]='Show\x20schedule\x20details';['validate'](_0x3f6562){const _0x48a723=a34_0x1ef183,_0x405a26=_0x3f6562[_0x48a723(0x220)][0x0];if(!_0x405a26)return'Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20show\x20<name>';return undefined;}async[a34_0x1ef183(0x237)](_0xd1481e){const _0x2222a3=a34_0x1ef183,{options:_0xee9a3d,args:_0x117698,tdx:_0x2de8b1}=_0xd1481e,_0x48d62e=_0x117698[0x0],_0x3ab39a=await withSpinner(_0x2222a3(0x229),()=>_0x2de8b1['schedules'][_0x2222a3(0x232)](_0x48d62e),{'verbose':_0xee9a3d['verbose']}),_0x225418=_0x3ab39a[_0x2222a3(0x22b)],_0x5a1a22={'name':_0x225418[_0x2222a3(0x21a)],'cron':_0x225418[_0x2222a3(0x1fb)],'database':_0x225418['database'],'type':_0x225418[_0x2222a3(0x25f)],'timezone':_0x225418[_0x2222a3(0x25b)],'user_name':_0x225418[_0x2222a3(0x23e)],'created_at':_0x225418[_0x2222a3(0x242)],'engine_version':_0x225418[_0x2222a3(0x204)],'executing_user_id':_0x225418['executing_user_id'],'query':_0x225418['query'],'delay':_0x225418[_0x2222a3(0x222)],'priority':_0x225418['priority'],'retry_limit':_0x225418[_0x2222a3(0x247)],..._0x225418['result']&&{'result':_0x225418[_0x2222a3(0x248)]}};return await handleSingleObjectOutput(_0x5a1a22,_0xee9a3d),0x0;}}export class ScheduleCreateCommand extends BaseCommand{['name']=a34_0x1ef183(0x20d);[a34_0x1ef183(0x20b)]='Create\x20a\x20scheduled\x20query';['validate'](_0x256874){const _0x1b06c9=a34_0x1ef183,_0x787fc7=_0x256874[_0x1b06c9(0x220)][0x0];if(!_0x787fc7)return'Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20create\x20<name>\x20-d\x20<db>\x20--file\x20<path>\x20[options]';const _0x5c0029=_0x256874[_0x1b06c9(0x252)];if(!_0x5c0029[_0x1b06c9(0x209)])return _0x1b06c9(0x269);return undefined;}async['execute'](_0x16e060){const _0x57f9c3=a34_0x1ef183,{options:_0x547e98,args:_0x3c48a4,tdx:_0x415ee3}=_0x16e060,_0x15454d=_0x3c48a4[0x0],_0x2baaf7=_0x547e98,_0x24e991=_0x2baaf7[_0x57f9c3(0x209)],_0x1e9a66=_0x2baaf7[_0x57f9c3(0x20c)],_0xd6d211=_0x2baaf7[_0x57f9c3(0x25f)]||_0x57f9c3(0x22d);let _0x2710de;try{_0x2710de=readFileSync(_0x1e9a66,_0x57f9c3(0x1e9))[_0x57f9c3(0x227)]();}catch(_0x2acc3e){throw new SDKError(ErrorCode[_0x57f9c3(0x200)],'Failed\x20to\x20read\x20file:\x20'+_0x1e9a66,_0x2acc3e instanceof Error?_0x2acc3e:undefined);}if(!_0x2710de)throw new SDKError(ErrorCode[_0x57f9c3(0x200)],_0x57f9c3(0x203));const _0x238be7={'database':_0x24e991,'query':_0x2710de,'type':_0xd6d211};if(_0x2baaf7[_0x57f9c3(0x1fb)])_0x238be7[_0x57f9c3(0x1fb)]=_0x2baaf7[_0x57f9c3(0x1fb)];if(_0x2baaf7[_0x57f9c3(0x25b)])_0x238be7[_0x57f9c3(0x25b)]=_0x2baaf7[_0x57f9c3(0x25b)];if(_0x2baaf7[_0x57f9c3(0x222)]!==undefined)_0x238be7[_0x57f9c3(0x222)]=Number(_0x2baaf7['delay']);if(_0x2baaf7['priority']!==undefined)_0x238be7[_0x57f9c3(0x225)]=Number(_0x2baaf7['priority']);if(_0x2baaf7[_0x57f9c3(0x24d)]!==undefined)_0x238be7[_0x57f9c3(0x247)]=Number(_0x2baaf7[_0x57f9c3(0x24d)]);if(_0x2baaf7[_0x57f9c3(0x21b)])_0x238be7[_0x57f9c3(0x204)]=_0x2baaf7['engineVersion'];if(_0x2baaf7[_0x57f9c3(0x248)])_0x238be7[_0x57f9c3(0x248)]=_0x2baaf7[_0x57f9c3(0x248)];if(_0x547e98[_0x57f9c3(0x223)]){console['error']('Creating\x20schedule:\x20'+_0x15454d),console[_0x57f9c3(0x259)](_0x57f9c3(0x21e)+_0x24e991),console[_0x57f9c3(0x259)](_0x57f9c3(0x233)+_0xd6d211);if(_0x238be7['cron'])console[_0x57f9c3(0x259)](_0x57f9c3(0x24f)+_0x238be7[_0x57f9c3(0x1fb)]);if(_0x238be7['timezone'])console[_0x57f9c3(0x259)](_0x57f9c3(0x1f2)+_0x238be7[_0x57f9c3(0x25b)]);}const _0x1c81b9=await withSpinner('Creating\x20schedule...',()=>_0x415ee3[_0x57f9c3(0x246)][_0x57f9c3(0x255)](_0x15454d,_0x238be7),{'verbose':_0x547e98[_0x57f9c3(0x223)]});return console['error']('Schedule\x20created:\x20'+_0x1c81b9[_0x57f9c3(0x22b)][_0x57f9c3(0x21a)]),await handleSingleObjectOutput(_0x1c81b9[_0x57f9c3(0x22b)],_0x547e98),0x0;}}export class ScheduleUpdateCommand extends BaseCommand{[a34_0x1ef183(0x21a)]='schedule:update';[a34_0x1ef183(0x20b)]='Update\x20a\x20scheduled\x20query';[a34_0x1ef183(0x239)](_0x4a0cbd){const _0x5f4722=a34_0x1ef183,_0x124d36=_0x4a0cbd[_0x5f4722(0x220)][0x0];if(!_0x124d36)return _0x5f4722(0x219);return undefined;}async[a34_0x1ef183(0x237)](_0x858d78){const _0xee1156=a34_0x1ef183,{options:_0x467d34,args:_0x324623,tdx:_0x3ce21e}=_0x858d78,_0x65f03d=_0x324623[0x0],_0x1b241c=_0x467d34,_0x4c36a9={};if(_0x1b241c[_0xee1156(0x209)])_0x4c36a9[_0xee1156(0x209)]=_0x1b241c['database'];if(_0x1b241c[_0xee1156(0x25f)])_0x4c36a9['type']=_0x1b241c['type'];if(_0x1b241c[_0xee1156(0x1fb)])_0x4c36a9[_0xee1156(0x1fb)]=_0x1b241c[_0xee1156(0x1fb)];if(_0x1b241c[_0xee1156(0x25b)])_0x4c36a9['timezone']=_0x1b241c['timezone'];if(_0x1b241c[_0xee1156(0x222)]!==undefined)_0x4c36a9['delay']=Number(_0x1b241c[_0xee1156(0x222)]);if(_0x1b241c[_0xee1156(0x225)]!==undefined)_0x4c36a9[_0xee1156(0x225)]=Number(_0x1b241c['priority']);if(_0x1b241c['retryLimit']!==undefined)_0x4c36a9[_0xee1156(0x247)]=Number(_0x1b241c['retryLimit']);if(_0x1b241c[_0xee1156(0x21b)])_0x4c36a9[_0xee1156(0x204)]=_0x1b241c[_0xee1156(0x21b)];if(_0x1b241c[_0xee1156(0x248)])_0x4c36a9[_0xee1156(0x248)]=_0x1b241c[_0xee1156(0x248)];if(_0x1b241c[_0xee1156(0x20c)])try{_0x4c36a9[_0xee1156(0x228)]=readFileSync(_0x1b241c['file'],'utf-8')[_0xee1156(0x227)]();}catch(_0x327a4b){throw new SDKError(ErrorCode[_0xee1156(0x200)],_0xee1156(0x1e8)+_0x1b241c['file'],_0x327a4b instanceof Error?_0x327a4b:undefined);}if(Object[_0xee1156(0x256)](_0x4c36a9)[_0xee1156(0x251)]===0x0)throw new SDKError(ErrorCode[_0xee1156(0x200)],'At\x20least\x20one\x20option\x20must\x20be\x20provided\x20to\x20update');if(_0x467d34['verbose']){console['error'](_0xee1156(0x24b)+_0x65f03d);for(const [_0x154540,_0x59f664]of Object[_0xee1156(0x206)](_0x4c36a9)){_0x154540===_0xee1156(0x228)?console['error']('\x20\x20'+_0x154540+':\x20'+_0x59f664[_0xee1156(0x23a)](0x0,0x32)+'...'):console['error']('\x20\x20'+_0x154540+':\x20'+_0x59f664);}}const _0x5a83c7=await withSpinner(_0xee1156(0x264),()=>_0x3ce21e['schedules'][_0xee1156(0x236)](_0x65f03d,_0x4c36a9),{'verbose':_0x467d34[_0xee1156(0x223)]});return console[_0xee1156(0x259)](_0xee1156(0x216)+_0x5a83c7[_0xee1156(0x22b)][_0xee1156(0x21a)]),await handleSingleObjectOutput(_0x5a83c7[_0xee1156(0x22b)],_0x467d34),0x0;}}export class ScheduleDeleteCommand extends BaseCommand{[a34_0x1ef183(0x21a)]=a34_0x1ef183(0x1fc);[a34_0x1ef183(0x20b)]='Delete\x20a\x20scheduled\x20query';[a34_0x1ef183(0x239)](_0x280aa5){const _0x1f0495=a34_0x1ef183,_0x4b5fdb=_0x280aa5['args'][0x0];if(!_0x4b5fdb)return _0x1f0495(0x224);return undefined;}async['execute'](_0x582d7a){const _0x1e6910=a34_0x1ef183,{options:_0x2fd486,args:_0x5d1132,tdx:_0x5de99e}=_0x582d7a,_0x31b8ca=_0x5d1132[0x0];if(!_0x2fd486['yes']){const _0x3b483b=await confirm(_0x1e6910(0x26a)+_0x31b8ca+'\x22?');if(!_0x3b483b)return console['error'](_0x1e6910(0x1fa)),0x0;}const _0x48763c=await withSpinner('Deleting\x20schedule...',()=>_0x5de99e[_0x1e6910(0x246)][_0x1e6910(0x21d)](_0x31b8ca),{'verbose':_0x2fd486['verbose']});return console[_0x1e6910(0x259)]('Schedule\x20deleted:\x20'+_0x48763c[_0x1e6910(0x22b)][_0x1e6910(0x21a)]),0x0;}}export class ScheduleRunCommand extends BaseCommand{[a34_0x1ef183(0x21a)]=a34_0x1ef183(0x218);[a34_0x1ef183(0x20b)]=a34_0x1ef183(0x20a);[a34_0x1ef183(0x239)](_0x2890ce){const _0x384e0a=a34_0x1ef183,_0x2e1297=_0x2890ce[_0x384e0a(0x220)][0x0];if(!_0x2e1297)return _0x384e0a(0x217);return undefined;}async[a34_0x1ef183(0x237)](_0x501d0a){const _0x1ec42e=a34_0x1ef183,{options:_0x139a64,args:_0x51cff3,tdx:_0x4f093b}=_0x501d0a,_0x3dcfda=_0x51cff3[0x0],_0x4ce5cc=_0x139a64,_0x5f427c=_0x4ce5cc[_0x1ec42e(0x265)],_0x51bc7a=_0x4ce5cc[_0x1ec42e(0x22f)]!==undefined?Number(_0x4ce5cc[_0x1ec42e(0x22f)]):undefined;if(_0x139a64[_0x1ec42e(0x223)]){console['error'](_0x1ec42e(0x267)+_0x3dcfda);if(_0x5f427c)console[_0x1ec42e(0x259)]('\x20\x20Time:\x20'+_0x5f427c);if(_0x51bc7a)console[_0x1ec42e(0x259)]('\x20\x20Num:\x20'+_0x51bc7a);}const _0x2aeb9c=await withSpinner(_0x1ec42e(0x25d),()=>_0x4f093b[_0x1ec42e(0x246)]['run'](_0x3dcfda,{'time':_0x5f427c,'num':_0x51bc7a}),{'verbose':_0x139a64[_0x1ec42e(0x223)]}),_0x18096c=_0x2aeb9c[_0x1ec42e(0x22b)]['jobs'];console[_0x1ec42e(0x259)]('Schedule\x20run\x20submitted:\x20'+_0x18096c[_0x1ec42e(0x251)]+'\x20job'+(_0x18096c[_0x1ec42e(0x251)]!==0x1?'s':'')+_0x1ec42e(0x1f7));for(const _0x53b27a of _0x18096c){console[_0x1ec42e(0x259)](_0x1ec42e(0x25a)+_0x53b27a[_0x1ec42e(0x213)]);}return await handleSDKOutput(_0x18096c,_0x139a64),0x0;}}export class ScheduleHistoryCommand extends BaseCommand{[a34_0x1ef183(0x21a)]=a34_0x1ef183(0x1f1);[a34_0x1ef183(0x20b)]=a34_0x1ef183(0x208);[a34_0x1ef183(0x239)](_0x4fd38d){const _0x2161a7=a34_0x1ef183,_0x43df09=_0x4fd38d[_0x2161a7(0x220)][0x0];if(!_0x43df09)return _0x2161a7(0x22a);return undefined;}async[a34_0x1ef183(0x237)](_0x10c339){const _0x1c5d72=a34_0x1ef183,{options:_0x13c4fd,args:_0x4a3772,tdx:_0x19f1b4}=_0x10c339,_0x5db886=_0x4a3772[0x0],_0x25dd5a=_0x13c4fd,_0x16ebed=_0x25dd5a[_0x1c5d72(0x1ea)]!==undefined?Number(_0x25dd5a[_0x1c5d72(0x1ea)]):undefined,_0x2db185=_0x25dd5a['to']!==undefined?Number(_0x25dd5a['to']):undefined,_0x58cedc=await withSpinner(_0x1c5d72(0x23c),()=>_0x19f1b4[_0x1c5d72(0x246)]['history'](_0x5db886,{'from':_0x16ebed,'to':_0x2db185}),{'verbose':_0x13c4fd['verbose']}),_0x37bc02=_0x58cedc[_0x1c5d72(0x22b)];console[_0x1c5d72(0x259)](_0x1c5d72(0x258)+_0x37bc02['count']+_0x1c5d72(0x23d)+(_0x37bc02['count']!==0x1?'s':'')+'\x20(showing\x20'+_0x37bc02[_0x1c5d72(0x1ea)]+'-'+_0x37bc02['to']+')');const _0x163cc6=_0x37bc02[_0x1c5d72(0x202)][_0x1c5d72(0x24c)](_0x5d4e6c=>({'job_id':_0x5d4e6c['job_id'],'type':_0x5d4e6c[_0x1c5d72(0x25f)],'status':_0x5d4e6c[_0x1c5d72(0x231)],'scheduled_at':_0x5d4e6c[_0x1c5d72(0x207)],'created_at':_0x5d4e6c[_0x1c5d72(0x242)],'start_at':_0x5d4e6c[_0x1c5d72(0x221)],'end_at':_0x5d4e6c[_0x1c5d72(0x1ed)]}));return await handleSDKOutput(_0x163cc6,_0x13c4fd),0x0;}}
1
+ const a34_0x33a2e9=a34_0x4f62;(function(_0x3ace69,_0x15c554){const _0x25db01=a34_0x4f62,_0x1a3369=_0x3ace69();while(!![]){try{const _0x44b53f=-parseInt(_0x25db01(0x9c))/0x1*(-parseInt(_0x25db01(0x6c))/0x2)+-parseInt(_0x25db01(0xa0))/0x3*(-parseInt(_0x25db01(0x96))/0x4)+parseInt(_0x25db01(0xd9))/0x5*(-parseInt(_0x25db01(0xea))/0x6)+parseInt(_0x25db01(0xca))/0x7*(parseInt(_0x25db01(0xaa))/0x8)+parseInt(_0x25db01(0xa1))/0x9*(parseInt(_0x25db01(0xec))/0xa)+parseInt(_0x25db01(0xdc))/0xb*(-parseInt(_0x25db01(0xf4))/0xc)+parseInt(_0x25db01(0xfc))/0xd*(parseInt(_0x25db01(0xc2))/0xe);if(_0x44b53f===_0x15c554)break;else _0x1a3369['push'](_0x1a3369['shift']());}catch(_0x172aa0){_0x1a3369['push'](_0x1a3369['shift']());}}}(a34_0xd7e3,0x63440));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput,writeOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{confirm}from'../utils/prompt.js';import{readFileSync}from'fs';function a34_0xd7e3(){const _0x33c36f=['tsv','delay','2VqzduK','timezone','queryUrl','utf-8','show','\x20\x20Type:\x20','schedule:run','length','schedule:show','Schedule\x20deleted:\x20','dim','keys','\x20schedules','time','user','\x20execution','Updating\x20schedule:\x20','scheduled_at','Show\x20schedule\x20execution\x20history','file','\x20\x20Num:\x20','verbose','num','trino','abs','from','\x20matching\x20\x22','...','\x20\x20Job\x20ID:\x20','output','ended_at','just\x20now','Showing\x20first\x20','listQueries','m\x20ago','\x20\x20β†’\x20','format','Schedule\x20created:\x20','engineVersion','name','\x20(showing\x20','cron','8QkPDNx','list','schedule:delete','end_at','type','next_run_at','65659ZmeJHQ','database','pagination','entries','101922MUAAHO','9dUbUeR','Schedule\x20run\x20submitted:\x20','result','toLocaleDateString','jsonl','INVALID_ARGUMENT','Creating\x20schedule...','error','limit','8aYaioj','never','history','schedule:create','green','args','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20schedule\x20\x22','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20create\x20<name>\x20-d\x20<db>\x20--file\x20<path>\x20[options]','validate','has_next_page','log','substring','schedule:update','queries','Found\x20','in\x20','join','Database\x20is\x20required\x0aUsage:\x20job\x20schedule\x20create\x20<name>\x20-d\x20<db>\x20--file\x20<path>\x20[options]','Running\x20schedule...','priority','schedule:list','Run\x20a\x20scheduled\x20query\x20immediately','data','success','14IdZvpB','At\x20least\x20one\x20option\x20must\x20be\x20provided\x20to\x20update','retry_limit','Show\x20schedule\x20details','Cancelled','execute','created_at','trim','5253199xcwFhY','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20history\x20<name>\x20[--from\x20<n>]\x20[--to\x20<n>]','Getting\x20schedule\x20details...','getTime','job_id','Query\x20file\x20is\x20empty','\x20\x20Database:\x20','schedule:history','d\x20ago','Create\x20a\x20scheduled\x20query','Deleting\x20schedule...','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20update\x20<name>\x20[options]','max','/app/queries/editor?queryId=','\x20\x20Timezone:\x20','10cJzLey','jobs','List\x20scheduled\x20queries','11Glwnkg','delete','h\x20ago','count','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20show\x20<name>','schedules','site','Delete\x20a\x20scheduled\x20query','nextRun','last_job','lastRun','start_at','Failed\x20to\x20read\x20file:\x20','query','1565538HSEdXe','round','260560rZiVtd','map','Getting\x20schedule\x20history...','create','retryLimit','\x20created','description','status','5409588MgboUF','Update\x20a\x20scheduled\x20query','Creating\x20schedule:\x20','Searching\x20scheduled\x20queries\x20matching\x20\x22','padEnd','run','\x20job','statusIcon','6098521bknFbw','update'];a34_0xd7e3=function(){return _0x33c36f;};return a34_0xd7e3();}function a34_0x4f62(_0x529f67,_0x59c370){_0x529f67=_0x529f67-0x69;const _0xd7e349=a34_0xd7e3();let _0x4f6257=_0xd7e349[_0x529f67];return _0x4f6257;}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_0x19a858 from'chalk';function formatRelativeTime(_0x880bc0){const _0x35fc07=a34_0x4f62,_0x4141e0=new Date(_0x880bc0),_0x25b3ac=new Date(),_0x51e13c=_0x4141e0[_0x35fc07(0xcd)]()-_0x25b3ac[_0x35fc07(0xcd)](),_0x31d6e2=Math[_0x35fc07(0x84)](_0x51e13c)/0x3e8,_0x1fb920=_0x51e13c<0x0;if(_0x31d6e2<0x3c)return _0x1fb920?_0x35fc07(0x8b):'soon';else{if(_0x31d6e2<0xe10){const _0x3888ce=Math[_0x35fc07(0xeb)](_0x31d6e2/0x3c);return _0x1fb920?_0x3888ce+_0x35fc07(0x8e):_0x35fc07(0xb9)+_0x3888ce+'m';}else{if(_0x31d6e2<0x15180){const _0x11f806=Math['round'](_0x31d6e2/0xe10);return _0x1fb920?_0x11f806+_0x35fc07(0xde):'in\x20'+_0x11f806+'h';}else{if(_0x31d6e2<0x93a80){const _0x4fd5f4=Math[_0x35fc07(0xeb)](_0x31d6e2/0x15180);return _0x1fb920?_0x4fd5f4+_0x35fc07(0xd2):'in\x20'+_0x4fd5f4+'d';}else return _0x4141e0[_0x35fc07(0xa4)]();}}}}export class ScheduleListCommand extends BaseCommand{[a34_0x33a2e9(0x93)]=a34_0x33a2e9(0xbe);[a34_0x33a2e9(0xf2)]=a34_0x33a2e9(0xdb);async[a34_0x33a2e9(0xc7)](_0x3ff6f0){const _0x25898d=a34_0x33a2e9,{options:_0x26e50a,args:_0x15afdc,tdx:_0x520b98}=_0x3ff6f0,_0x23f173=resolveLimit(_0x26e50a[_0x25898d(0xa9)],DEFAULT_DISPLAY_LIMIT),_0x93326c=_0x15afdc[0x0],_0x355c52=_0x93326c?_0x25898d(0xf7)+_0x93326c+'\x22...':'Listing\x20scheduled\x20queries...',_0x289da7=await withSpinner(_0x355c52,()=>_0x520b98[_0x25898d(0xe1)][_0x25898d(0x8d)]({'limit':_0x23f173,'scheduled':!![],'pattern':_0x93326c}),{'verbose':_0x26e50a[_0x25898d(0x81)]}),_0x45a504=_0x289da7[_0x25898d(0xc0)][_0x25898d(0xb7)],_0x55e56e=_0x289da7[_0x25898d(0xc0)][_0x25898d(0x9e)][_0x25898d(0xb3)],_0x2b1426=_0x93326c?_0x25898d(0x86)+_0x93326c+'\x22':'';_0x55e56e?console['error'](_0x25898d(0x8c)+_0x45a504['length']+_0x25898d(0x78)+_0x2b1426+'\x20(use\x20--limit\x20to\x20see\x20more)'):console[_0x25898d(0xa8)](_0x25898d(0xb8)+_0x45a504[_0x25898d(0x73)]+'\x20scheduled\x20quer'+(_0x45a504[_0x25898d(0x73)]!==0x1?'ies':'y')+_0x2b1426);if(_0x26e50a[_0x25898d(0x90)]==='json'||_0x26e50a[_0x25898d(0x90)]===_0x25898d(0xa5)||_0x26e50a[_0x25898d(0x90)]==='table'||_0x26e50a[_0x25898d(0x90)]===_0x25898d(0x6a)){const _0x25549e=_0x45a504[_0x25898d(0xed)](_0x756bd=>({'id':_0x756bd['id'],'name':_0x756bd[_0x25898d(0x93)],'cron':_0x756bd[_0x25898d(0x95)],'database':_0x756bd['database']?.['name'],'type':_0x756bd[_0x25898d(0x9a)],'timezone':_0x756bd['time_zone'],'user_name':_0x756bd[_0x25898d(0x7a)]?.['name'],'updated_at':_0x756bd['updated_at'],'next_run_at':_0x756bd[_0x25898d(0x9b)],'last_job_status':_0x756bd[_0x25898d(0xe5)]?.[_0x25898d(0xf3)]}));await handleSDKOutput(_0x25549e,_0x26e50a);}else{if(_0x45a504[_0x25898d(0x73)]===0x0)console[_0x25898d(0xb4)]('No\x20scheduled\x20queries\x20found');else{const _0x16c56d=_0x26e50a[_0x25898d(0xe2)],_0x2ad995=_0x45a504[_0x25898d(0xed)](_0x1dedde=>{const _0x5f2263=_0x25898d,_0x38a50e=_0x1dedde[_0x5f2263(0xe5)]?.['status']?_0x1dedde[_0x5f2263(0xe5)][_0x5f2263(0xf3)]==='success'?'βœ“':'βœ—':'-',_0x1515bb=_0x1dedde[_0x5f2263(0xe5)]?.[_0x5f2263(0x8a)]?formatRelativeTime(_0x1dedde[_0x5f2263(0xe5)][_0x5f2263(0x8a)]):_0x5f2263(0xab),_0x4f0edd=_0x1dedde['next_run_at']?formatRelativeTime(_0x1dedde[_0x5f2263(0x9b)]):'-',_0x65956e=_0x1dedde['cron']||'',_0x1496dc=_0x1dedde[_0x5f2263(0x93)]||'(unnamed)',_0x35529e=getConsoleUrl(_0x16c56d,_0x5f2263(0xd7)+_0x1dedde['id']);return{'statusIcon':_0x38a50e,'lastRun':_0x1515bb,'nextRun':_0x4f0edd,'cron':_0x65956e,'name':_0x1496dc,'queryUrl':_0x35529e,'status':_0x1dedde[_0x5f2263(0xe5)]?.[_0x5f2263(0xf3)]};}),_0x57869f=Math[_0x25898d(0xd6)](..._0x2ad995[_0x25898d(0xed)](_0x2e20a8=>_0x2e20a8[_0x25898d(0xe6)]['length'])),_0x550cca=Math['max'](..._0x2ad995[_0x25898d(0xed)](_0x4a5848=>_0x4a5848['nextRun'][_0x25898d(0x73)])),_0x5a55ba=Math[_0x25898d(0xd6)](..._0x2ad995[_0x25898d(0xed)](_0x2d9da1=>_0x2d9da1[_0x25898d(0x95)][_0x25898d(0x73)])),_0x59e926=_0x2ad995[_0x25898d(0xed)](_0x2c95d6=>{const _0x197476=_0x25898d,_0x1042fe=_0x2c95d6[_0x197476(0xf3)]===_0x197476(0xc1)?a34_0x19a858[_0x197476(0xae)](_0x2c95d6[_0x197476(0xfb)]):_0x2c95d6['status']===_0x197476(0xa8)?a34_0x19a858['red'](_0x2c95d6['statusIcon']):a34_0x19a858[_0x197476(0x76)](_0x2c95d6[_0x197476(0xfb)]),_0x5f5b4c=_0x2c95d6['lastRun']['padEnd'](_0x57869f),_0xb01175=_0x2c95d6[_0x197476(0xe4)][_0x197476(0xf8)](_0x550cca),_0x2a350d=_0x2c95d6[_0x197476(0x95)]?a34_0x19a858['cyan'](_0x2c95d6['cron'][_0x197476(0xf8)](_0x5a55ba)):'\x20'['repeat'](_0x5a55ba),_0x4f984b=hyperlink(_0x2c95d6[_0x197476(0x93)],_0x2c95d6[_0x197476(0x6e)]);return'πŸ“…\x20'+_0x1042fe+'\x20'+_0x5f5b4c+_0x197476(0x8f)+_0xb01175+'\x20\x20'+_0x2a350d+'\x20\x20'+_0x4f984b;});await writeOutput(_0x59e926[_0x25898d(0xba)]('\x0a'),_0x26e50a[_0x25898d(0x89)],_0x25898d(0x97));}}return 0x0;}}export class ScheduleShowCommand extends BaseCommand{[a34_0x33a2e9(0x93)]=a34_0x33a2e9(0x74);[a34_0x33a2e9(0xf2)]=a34_0x33a2e9(0xc5);[a34_0x33a2e9(0xb2)](_0x2729b6){const _0x11df0b=a34_0x33a2e9,_0x27ea15=_0x2729b6[_0x11df0b(0xaf)][0x0];if(!_0x27ea15)return _0x11df0b(0xe0);return undefined;}async[a34_0x33a2e9(0xc7)](_0x5412b7){const _0x5769f3=a34_0x33a2e9,{options:_0x1078d1,args:_0x263c86,tdx:_0x323024}=_0x5412b7,_0x15b034=_0x263c86[0x0],_0x4dacff=await withSpinner(_0x5769f3(0xcc),()=>_0x323024[_0x5769f3(0xe1)][_0x5769f3(0x70)](_0x15b034),{'verbose':_0x1078d1[_0x5769f3(0x81)]}),_0x376669=_0x4dacff[_0x5769f3(0xc0)],_0x2fe221={'name':_0x376669[_0x5769f3(0x93)],'cron':_0x376669['cron'],'database':_0x376669[_0x5769f3(0x9d)],'type':_0x376669[_0x5769f3(0x9a)],'timezone':_0x376669[_0x5769f3(0x6d)],'user_name':_0x376669['user_name'],'created_at':_0x376669[_0x5769f3(0xc8)],'engine_version':_0x376669['engine_version'],'executing_user_id':_0x376669['executing_user_id'],'query':_0x376669[_0x5769f3(0xe9)],'delay':_0x376669[_0x5769f3(0x6b)],'priority':_0x376669[_0x5769f3(0xbd)],'retry_limit':_0x376669[_0x5769f3(0xc4)],..._0x376669[_0x5769f3(0xa3)]&&{'result':_0x376669[_0x5769f3(0xa3)]}};return await handleSingleObjectOutput(_0x2fe221,_0x1078d1),0x0;}}export class ScheduleCreateCommand extends BaseCommand{['name']=a34_0x33a2e9(0xad);[a34_0x33a2e9(0xf2)]=a34_0x33a2e9(0xd3);[a34_0x33a2e9(0xb2)](_0x544dee){const _0x154057=a34_0x33a2e9,_0x2937d7=_0x544dee[_0x154057(0xaf)][0x0];if(!_0x2937d7)return _0x154057(0xb1);const _0x41145c=_0x544dee['options'];if(!_0x41145c['database'])return _0x154057(0xbb);return undefined;}async['execute'](_0x47c547){const _0x1336d6=a34_0x33a2e9,{options:_0xea1ce6,args:_0x584525,tdx:_0xba5da2}=_0x47c547,_0x529b37=_0x584525[0x0],_0xa12def=_0xea1ce6,_0x100ea9=_0xa12def[_0x1336d6(0x9d)],_0x3d53ce=_0xa12def[_0x1336d6(0x7f)],_0x55ce43=_0xa12def[_0x1336d6(0x9a)]||_0x1336d6(0x83);let _0x464217;try{_0x464217=readFileSync(_0x3d53ce,_0x1336d6(0x6f))[_0x1336d6(0xc9)]();}catch(_0x1cad71){throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x1336d6(0xe8)+_0x3d53ce,_0x1cad71 instanceof Error?_0x1cad71:undefined);}if(!_0x464217)throw new SDKError(ErrorCode[_0x1336d6(0xa6)],_0x1336d6(0xcf));const _0x2db129={'database':_0x100ea9,'query':_0x464217,'type':_0x55ce43};if(_0xa12def[_0x1336d6(0x95)])_0x2db129[_0x1336d6(0x95)]=_0xa12def[_0x1336d6(0x95)];if(_0xa12def[_0x1336d6(0x6d)])_0x2db129[_0x1336d6(0x6d)]=_0xa12def[_0x1336d6(0x6d)];if(_0xa12def[_0x1336d6(0x6b)]!==undefined)_0x2db129[_0x1336d6(0x6b)]=Number(_0xa12def[_0x1336d6(0x6b)]);if(_0xa12def['priority']!==undefined)_0x2db129[_0x1336d6(0xbd)]=Number(_0xa12def[_0x1336d6(0xbd)]);if(_0xa12def[_0x1336d6(0xf0)]!==undefined)_0x2db129[_0x1336d6(0xc4)]=Number(_0xa12def[_0x1336d6(0xf0)]);if(_0xa12def[_0x1336d6(0x92)])_0x2db129['engine_version']=_0xa12def[_0x1336d6(0x92)];if(_0xa12def[_0x1336d6(0xa3)])_0x2db129[_0x1336d6(0xa3)]=_0xa12def[_0x1336d6(0xa3)];if(_0xea1ce6[_0x1336d6(0x81)]){console[_0x1336d6(0xa8)](_0x1336d6(0xf6)+_0x529b37),console[_0x1336d6(0xa8)](_0x1336d6(0xd0)+_0x100ea9),console[_0x1336d6(0xa8)](_0x1336d6(0x71)+_0x55ce43);if(_0x2db129[_0x1336d6(0x95)])console[_0x1336d6(0xa8)]('\x20\x20Cron:\x20'+_0x2db129['cron']);if(_0x2db129[_0x1336d6(0x6d)])console[_0x1336d6(0xa8)](_0x1336d6(0xd8)+_0x2db129[_0x1336d6(0x6d)]);}const _0x5b0cb5=await withSpinner(_0x1336d6(0xa7),()=>_0xba5da2[_0x1336d6(0xe1)][_0x1336d6(0xef)](_0x529b37,_0x2db129),{'verbose':_0xea1ce6[_0x1336d6(0x81)]});return console[_0x1336d6(0xa8)](_0x1336d6(0x91)+_0x5b0cb5[_0x1336d6(0xc0)]['name']),await handleSingleObjectOutput(_0x5b0cb5[_0x1336d6(0xc0)],_0xea1ce6),0x0;}}export class ScheduleUpdateCommand extends BaseCommand{[a34_0x33a2e9(0x93)]=a34_0x33a2e9(0xb6);['description']=a34_0x33a2e9(0xf5);[a34_0x33a2e9(0xb2)](_0x395ba6){const _0x34780c=a34_0x33a2e9,_0x3b74d1=_0x395ba6[_0x34780c(0xaf)][0x0];if(!_0x3b74d1)return _0x34780c(0xd5);return undefined;}async[a34_0x33a2e9(0xc7)](_0x401708){const _0xa9ed69=a34_0x33a2e9,{options:_0x1d8583,args:_0x55b95a,tdx:_0x2cb6a7}=_0x401708,_0x8b4c06=_0x55b95a[0x0],_0x469dfc=_0x1d8583,_0xb404fb={};if(_0x469dfc['database'])_0xb404fb[_0xa9ed69(0x9d)]=_0x469dfc['database'];if(_0x469dfc['type'])_0xb404fb[_0xa9ed69(0x9a)]=_0x469dfc[_0xa9ed69(0x9a)];if(_0x469dfc[_0xa9ed69(0x95)])_0xb404fb[_0xa9ed69(0x95)]=_0x469dfc[_0xa9ed69(0x95)];if(_0x469dfc[_0xa9ed69(0x6d)])_0xb404fb[_0xa9ed69(0x6d)]=_0x469dfc['timezone'];if(_0x469dfc[_0xa9ed69(0x6b)]!==undefined)_0xb404fb[_0xa9ed69(0x6b)]=Number(_0x469dfc['delay']);if(_0x469dfc[_0xa9ed69(0xbd)]!==undefined)_0xb404fb['priority']=Number(_0x469dfc[_0xa9ed69(0xbd)]);if(_0x469dfc['retryLimit']!==undefined)_0xb404fb[_0xa9ed69(0xc4)]=Number(_0x469dfc[_0xa9ed69(0xf0)]);if(_0x469dfc[_0xa9ed69(0x92)])_0xb404fb['engine_version']=_0x469dfc[_0xa9ed69(0x92)];if(_0x469dfc[_0xa9ed69(0xa3)])_0xb404fb[_0xa9ed69(0xa3)]=_0x469dfc[_0xa9ed69(0xa3)];if(_0x469dfc['file'])try{_0xb404fb[_0xa9ed69(0xe9)]=readFileSync(_0x469dfc[_0xa9ed69(0x7f)],_0xa9ed69(0x6f))[_0xa9ed69(0xc9)]();}catch(_0x562ae5){throw new SDKError(ErrorCode[_0xa9ed69(0xa6)],_0xa9ed69(0xe8)+_0x469dfc['file'],_0x562ae5 instanceof Error?_0x562ae5:undefined);}if(Object[_0xa9ed69(0x77)](_0xb404fb)[_0xa9ed69(0x73)]===0x0)throw new SDKError(ErrorCode[_0xa9ed69(0xa6)],_0xa9ed69(0xc3));if(_0x1d8583['verbose']){console[_0xa9ed69(0xa8)](_0xa9ed69(0x7c)+_0x8b4c06);for(const [_0x5259dd,_0x1df900]of Object[_0xa9ed69(0x9f)](_0xb404fb)){_0x5259dd===_0xa9ed69(0xe9)?console[_0xa9ed69(0xa8)]('\x20\x20'+_0x5259dd+':\x20'+_0x1df900[_0xa9ed69(0xb5)](0x0,0x32)+_0xa9ed69(0x87)):console[_0xa9ed69(0xa8)]('\x20\x20'+_0x5259dd+':\x20'+_0x1df900);}}const _0x65e59d=await withSpinner('Updating\x20schedule...',()=>_0x2cb6a7[_0xa9ed69(0xe1)][_0xa9ed69(0x69)](_0x8b4c06,_0xb404fb),{'verbose':_0x1d8583[_0xa9ed69(0x81)]});return console['error']('Schedule\x20updated:\x20'+_0x65e59d['data'][_0xa9ed69(0x93)]),await handleSingleObjectOutput(_0x65e59d[_0xa9ed69(0xc0)],_0x1d8583),0x0;}}export class ScheduleDeleteCommand extends BaseCommand{['name']=a34_0x33a2e9(0x98);[a34_0x33a2e9(0xf2)]=a34_0x33a2e9(0xe3);[a34_0x33a2e9(0xb2)](_0x2b20f5){const _0xaa66b8=a34_0x33a2e9,_0x2a6199=_0x2b20f5[_0xaa66b8(0xaf)][0x0];if(!_0x2a6199)return'Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20delete\x20<name>';return undefined;}async[a34_0x33a2e9(0xc7)](_0x1dbc65){const _0x59dff6=a34_0x33a2e9,{options:_0x16a3bc,args:_0x14e2a7,tdx:_0x40c8f0}=_0x1dbc65,_0x2df443=_0x14e2a7[0x0];if(!_0x16a3bc['yes']){const _0x5e7535=await confirm(_0x59dff6(0xb0)+_0x2df443+'\x22?');if(!_0x5e7535)return console[_0x59dff6(0xa8)](_0x59dff6(0xc6)),0x0;}const _0xbc240f=await withSpinner(_0x59dff6(0xd4),()=>_0x40c8f0[_0x59dff6(0xe1)][_0x59dff6(0xdd)](_0x2df443),{'verbose':_0x16a3bc[_0x59dff6(0x81)]});return console['error'](_0x59dff6(0x75)+_0xbc240f[_0x59dff6(0xc0)][_0x59dff6(0x93)]),0x0;}}export class ScheduleRunCommand extends BaseCommand{[a34_0x33a2e9(0x93)]=a34_0x33a2e9(0x72);['description']=a34_0x33a2e9(0xbf);[a34_0x33a2e9(0xb2)](_0x3bad0d){const _0x2dd86f=a34_0x33a2e9,_0x111ddf=_0x3bad0d[_0x2dd86f(0xaf)][0x0];if(!_0x111ddf)return'Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20run\x20<name>\x20[--time\x20<iso8601>]\x20[--num\x20<1-10>]';return undefined;}async['execute'](_0x564969){const _0x8e2fb2=a34_0x33a2e9,{options:_0x2976c4,args:_0x14f296,tdx:_0x579535}=_0x564969,_0x573ae5=_0x14f296[0x0],_0x128253=_0x2976c4,_0x4595fb=_0x128253[_0x8e2fb2(0x79)],_0x882a31=_0x128253[_0x8e2fb2(0x82)]!==undefined?Number(_0x128253[_0x8e2fb2(0x82)]):undefined;if(_0x2976c4[_0x8e2fb2(0x81)]){console[_0x8e2fb2(0xa8)]('Running\x20schedule:\x20'+_0x573ae5);if(_0x4595fb)console[_0x8e2fb2(0xa8)]('\x20\x20Time:\x20'+_0x4595fb);if(_0x882a31)console[_0x8e2fb2(0xa8)](_0x8e2fb2(0x80)+_0x882a31);}const _0x44725d=await withSpinner(_0x8e2fb2(0xbc),()=>_0x579535[_0x8e2fb2(0xe1)][_0x8e2fb2(0xf9)](_0x573ae5,{'time':_0x4595fb,'num':_0x882a31}),{'verbose':_0x2976c4['verbose']}),_0x1bab1a=_0x44725d['data'][_0x8e2fb2(0xda)];console['error'](_0x8e2fb2(0xa2)+_0x1bab1a['length']+_0x8e2fb2(0xfa)+(_0x1bab1a[_0x8e2fb2(0x73)]!==0x1?'s':'')+_0x8e2fb2(0xf1));for(const _0x211d93 of _0x1bab1a){console[_0x8e2fb2(0xa8)](_0x8e2fb2(0x88)+_0x211d93[_0x8e2fb2(0xce)]);}return await handleSDKOutput(_0x1bab1a,_0x2976c4),0x0;}}export class ScheduleHistoryCommand extends BaseCommand{[a34_0x33a2e9(0x93)]=a34_0x33a2e9(0xd1);[a34_0x33a2e9(0xf2)]=a34_0x33a2e9(0x7e);['validate'](_0x3d3996){const _0xbae0f5=a34_0x33a2e9,_0x4e8c87=_0x3d3996[_0xbae0f5(0xaf)][0x0];if(!_0x4e8c87)return _0xbae0f5(0xcb);return undefined;}async[a34_0x33a2e9(0xc7)](_0x3b061c){const _0x4aaed7=a34_0x33a2e9,{options:_0x45a558,args:_0x22f98c,tdx:_0x5a1999}=_0x3b061c,_0x5ecfd2=_0x22f98c[0x0],_0x325951=_0x45a558,_0x16139a=_0x325951[_0x4aaed7(0x85)]!==undefined?Number(_0x325951['from']):undefined,_0x326e35=_0x325951['to']!==undefined?Number(_0x325951['to']):undefined,_0x3836e1=await withSpinner(_0x4aaed7(0xee),()=>_0x5a1999['schedules'][_0x4aaed7(0xac)](_0x5ecfd2,{'from':_0x16139a,'to':_0x326e35}),{'verbose':_0x45a558[_0x4aaed7(0x81)]}),_0x1d9b71=_0x3836e1[_0x4aaed7(0xc0)];console['error'](_0x4aaed7(0xb8)+_0x1d9b71[_0x4aaed7(0xdf)]+_0x4aaed7(0x7b)+(_0x1d9b71[_0x4aaed7(0xdf)]!==0x1?'s':'')+_0x4aaed7(0x94)+_0x1d9b71[_0x4aaed7(0x85)]+'-'+_0x1d9b71['to']+')');const _0x1bb8c9=_0x1d9b71[_0x4aaed7(0xac)][_0x4aaed7(0xed)](_0x292161=>({'job_id':_0x292161[_0x4aaed7(0xce)],'type':_0x292161[_0x4aaed7(0x9a)],'status':_0x292161['status'],'scheduled_at':_0x292161[_0x4aaed7(0x7d)],'created_at':_0x292161[_0x4aaed7(0xc8)],'start_at':_0x292161[_0x4aaed7(0xe7)],'end_at':_0x292161[_0x4aaed7(0x99)]}));return await handleSDKOutput(_0x1bb8c9,_0x45a558),0x0;}}
@@ -1 +1 @@
1
- const a35_0x500582=a35_0x5279;(function(_0x5537ac,_0x57c730){const _0x3eb798=a35_0x5279,_0x5f55a7=_0x5537ac();while(!![]){try{const _0x2b7d55=-parseInt(_0x3eb798(0x24f))/0x1+parseInt(_0x3eb798(0x22e))/0x2*(-parseInt(_0x3eb798(0x24e))/0x3)+-parseInt(_0x3eb798(0x235))/0x4*(parseInt(_0x3eb798(0x24a))/0x5)+-parseInt(_0x3eb798(0x22b))/0x6+-parseInt(_0x3eb798(0x208))/0x7+parseInt(_0x3eb798(0x21d))/0x8*(-parseInt(_0x3eb798(0x252))/0x9)+parseInt(_0x3eb798(0x23b))/0xa;if(_0x2b7d55===_0x57c730)break;else _0x5f55a7['push'](_0x5f55a7['shift']());}catch(_0x22202f){_0x5f55a7['push'](_0x5f55a7['shift']());}}}(a35_0x3147,0x25382));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';function a35_0x3147(){const _0xbe9302=['Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required','Folder\x20name:\x20','Error:\x20YAML\x20file\x20paths\x20must\x20be\x20specified\x20with\x20--path\x20option','SEGMENT_NOT_FOUND','segment','Show\x20segment\x20folder\x20details','parent','\x20\x20-w,\x20--web\x20\x20Open\x20segment\x20in\x20web\x20browser','Examples:','\x20[Job\x20ID:\x20','Error:\x20Path\x20or\x20name\x20is\x20required','Error:\x20Cannot\x20execute\x20query\x20for\x20parent\x20segment\x20with\x20this\x20command.','Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>','message','stats','resolveFolderId','Executing\x20segment\x20query...','/e/','Fetching\x20SQL\x20from\x20rule...','Usage:\x20tdx\x20sg\x20view\x20<name>\x20[-w]','getSQLFromServerSegment','green','Cannot\x20get\x20SQL\x20for\x20parent\x20segment\x20with\x20this\x20command.\x20Use:\x20tdx\x20ps\x20sql','Site:\x20','path','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22','964467QMgmfb','Use:\x20tdx\x20sg\x20view\x20<name>\x20\x20#\x20To\x20show\x20folder\x20details','Create\x20segment\x20folder\x20for\x20organization','List\x20segment\x20folders\x20under\x20a\x20parent\x20segment','Resolved:\x20','Resolved\x20type:\x20','toLocaleString','error','type','\x20\x20Segment\x20name:\x20','\x20\x20tdx\x20sg\x20sql\x20--path\x20','Resolved\x20parent\x20ID:\x20','limit','SELECT\x20*\x20FROM\x20(\x0a','cyan','json','url','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','createFolder','Parent\x20ID:\x20','site','1672FAMKbd','Target\x20path:\x20','\x20\x20Full\x20path:\x20','segment:describe','resolvePathToResource','Fetching\x20folder\x20\x27','processedRows','log','Resolved\x20relative\x20path\x20to:\x20','Fetching\x20SQL\x20for\x20segment...','folderPath','getSegmentSQLFromYaml','resolveParentId','Error:\x20Specify\x20either\x20segment\x20name\x20or\x20--path,\x20not\x20both','770136DoiHOD','Use:\x20tdx\x20ps\x20view','segment:desc','2PmlbdU','getSegment','Resolved\x20folder\x20ID:\x20','segmentPath','\x20\x20tdx\x20sg\x20view\x20\x22Marketing\x22\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20folder\x20details','Folder\x20ID\x20missing\x20from\x20resolved\x20path','parentSegment','144djYNDa','jobId','Usage:\x20tdx\x20segment\x20describe\x20<path>','data','Fetching\x20parent\x20segment\x20details...','SEGMENT_FOLDER_NOT_FOUND','12135180FapgOy','code','red','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','execute','Resolving\x20parent\x20folder\x20\x27','trim','cause','Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.\x20Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','segmentId','Error:\x20Cannot\x20view\x20parent\x20segment\x20details\x20with\x20this\x20command.','SQL\x20query:\x0a','\x27\x20with\x20ID:\x20','getFolder','\x20\x20tdx\x20sg\x20desc\x20segments/my-audience/premium-users.yml','27460HLbxqx','Resolved\x20YAML\x20file:\x20','getSQLFromYamlFile','Show\x20segment\x20or\x20folder\x20details','757899GVRbuJ','293590KzDiJT','name','Error:\x20Cannot\x20open\x20parent\x20segment\x20with\x20this\x20command.','2196bknzKD','Listing\x20folders\x20for\x20parent\x20\x27','Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]','segment:folder:create','elapsedTimeMillis','Error:\x20Folder\x20reference\x20is\x20required','segment:view','format','replace','βœ”\x20Found\x20','setJobId','Error:\x20','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20-w\x20\x20#\x20Open\x20segment\x20in\x20web\x20browser','Parent\x20name:\x20','Options:','parentId','Creating\x20folder\x20\x27','Resolving\x20\x27','Error:\x20Cannot\x20open\x20folder\x20in\x20web\x20browser.\x20Use\x20a\x20segment\x20name\x20instead.','content','Show\x20folder\x20or\x20child\x20segment\x20details','information_schema','description','Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required','Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22','folder','Get\x20SQL\x20query\x20for\x20child\x20segment','Error:\x20Segment\x20name\x20or\x20--path\x20is\x20required','Execute\x20child\x20segment\x20SQL\x20query\x20and\x20show\x20results','\x20\x20tdx\x20sg\x20sql\x20--path\x20segments/my-audience/premium-users.yml','Resolving\x20path\x20\x27','\x20Opening\x20','βœ–\x20Query\x20failed\x20[','Segment\x20ID:\x20','getSegmentSQL','in\x20','segmentName','\x20\x20Server-side\x20segment:\x20\x20tdx\x20sg\x20sql\x20<name>','\x20\x20Parent\x20segment:\x20','Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)','Show\x20child\x20segment\x20schema\x20(column\x20types)','Error:\x20Folder\x20or\x20segment\x20name,\x20or\x20YAML\x20file\x20path\x20is\x20required','Parent\x20segment:\x20','web','Resolving\x20parent\x20segment\x20\x27','Segment\x20ID\x20missing\x20from\x20resolved\x20path','Fetching\x20segment\x20details...','length','verbose','Use:\x20tdx\x20ps\x20show','Resolving\x20folder\x20\x27','Fetching\x20folder\x20details...','\x20\x20tdx\x20sg\x20show\x20segments/my-audience/premium-users.yml','\x20\x20Cause:\x20','segment:folder:list','/app/ps/','folderId','\x20\x20Local\x20YAML\x20file:\x20\x20\x20\x20\x20\x20tdx\x20sg\x20sql\x20--path\x20<file-path>','\x20\x20Folder\x20path:\x20','\x20rows\x20','\x27...','Usage:\x20tdx\x20sg\x20show\x20<name>','INVALID_ARGUMENT','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20show\x20<path/to/segment.yml>','Error:\x20Cannot\x20show\x20schema\x20for\x20a\x20folder.','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22'];a35_0x3147=function(){return _0xbe9302;};return a35_0x3147();}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_0x2c9435 from'chalk';async function resolveSegmentTarget(_0x671a80,_0x195da0,_0x215b03){const _0x1a2191=a35_0x5279;if(isYamlFilePath(_0x671a80))try{const _0x230de4=await resolveYamlFilePath(_0x671a80);return _0x215b03&&(console[_0x1a2191(0x20f)](_0x1a2191(0x24b)+_0x671a80),console[_0x1a2191(0x20f)](_0x1a2191(0x279)+_0x230de4[_0x1a2191(0x234)]),console['error'](_0x1a2191(0x211)+_0x230de4[_0x1a2191(0x277)]),console[_0x1a2191(0x20f)](_0x1a2191(0x1e6)+(_0x230de4[_0x1a2191(0x227)]||'(root)')),console[_0x1a2191(0x20f)](_0x1a2191(0x21f)+_0x230de4['fullPath'])),_0x230de4['fullPath'];}catch(_0x3abc69){throw new SDKError(ErrorCode[_0x1a2191(0x1ea)],_0x1a2191(0x219)+_0x3abc69['message']);}if(!_0x195da0)throw new SDKError(ErrorCode[_0x1a2191(0x1ea)],_0x1a2191(0x1ed));return _0x195da0+'/'+_0x671a80;}export class SegmentDescribeCommand extends BaseCommand{[a35_0x500582(0x250)]=a35_0x500582(0x220);[a35_0x500582(0x268)]=a35_0x500582(0x24d);async[a35_0x500582(0x23f)](_0x52c859){const _0xf49753=a35_0x500582,{options:_0x1eccde,args:_0x1ddf27,tdx:_0x31295b}=_0x52c859,_0x5ca0ea=_0x1ddf27[0x0],_0x1cdf78=!_0x5ca0ea&&!!_0x1eccde['parentSegment'],_0x533a9b=_0x5ca0ea||_0x1eccde[_0xf49753(0x234)];if(!_0x533a9b)return console['error'](_0xf49753(0x1f8)),console[_0xf49753(0x20f)](_0xf49753(0x237)),console[_0xf49753(0x20f)](_0xf49753(0x1f6)),console[_0xf49753(0x20f)](_0xf49753(0x26b)),console['error'](_0xf49753(0x207)),console[_0xf49753(0x20f)]('\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context'),console[_0xf49753(0x20f)](_0xf49753(0x23e)),0x1;try{const _0x5b40aa=_0x1eccde[_0xf49753(0x231)];let _0xc83fae=_0x533a9b;!_0x1cdf78&&_0x5b40aa&&!_0x533a9b['includes']('/')&&(_0xc83fae=_0x5b40aa+'/'+_0x533a9b,_0x1eccde[_0xf49753(0x283)]&&console[_0xf49753(0x20f)](_0xf49753(0x225)+_0xc83fae));const _0x45c71e=await withSpinner(_0xf49753(0x271)+_0xc83fae+_0xf49753(0x1e8),()=>_0x31295b[_0xf49753(0x1f2)][_0xf49753(0x221)](_0xc83fae),{'verbose':_0x1eccde[_0xf49753(0x283)]}),_0x484c3c=_0x45c71e[_0xf49753(0x238)];_0x1eccde[_0xf49753(0x283)]&&(console['error'](_0xf49753(0x20d)+_0x484c3c[_0xf49753(0x210)]),console[_0xf49753(0x20f)](_0xf49753(0x21b)+_0x484c3c[_0xf49753(0x261)]),_0x484c3c[_0xf49753(0x1e4)]&&console[_0xf49753(0x20f)]('Folder\x20ID:\x20'+_0x484c3c['folderId']),_0x484c3c[_0xf49753(0x244)]&&console[_0xf49753(0x20f)](_0xf49753(0x274)+_0x484c3c[_0xf49753(0x244)]));if(_0x484c3c[_0xf49753(0x210)]===_0xf49753(0x1f4)){const _0x4784d1=await withSpinner(_0xf49753(0x239),()=>_0x31295b[_0xf49753(0x1f2)]['getParent'](_0x484c3c[_0xf49753(0x261)]),{'verbose':_0x1eccde[_0xf49753(0x283)]});await handleSingleObjectOutput(_0x4784d1[_0xf49753(0x238)],_0x1eccde);}else{if(_0x484c3c[_0xf49753(0x210)]===_0xf49753(0x26c)){if(!_0x484c3c[_0xf49753(0x1e4)])throw new SDKError(ErrorCode[_0xf49753(0x23a)],'Folder\x20ID\x20missing\x20from\x20resolved\x20path');const _0x266fea=await withSpinner(_0xf49753(0x286),()=>_0x31295b['segment'][_0xf49753(0x248)](_0x484c3c[_0xf49753(0x1e4)]),{'verbose':_0x1eccde[_0xf49753(0x283)]});await handleSingleObjectOutput(_0x266fea[_0xf49753(0x238)],_0x1eccde);}else{if(_0x484c3c[_0xf49753(0x210)]===_0xf49753(0x1f2)){if(!_0x484c3c[_0xf49753(0x244)])throw new SDKError(ErrorCode[_0xf49753(0x1f1)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x5ccec2=await withSpinner(_0xf49753(0x281),()=>_0x31295b['segment'][_0xf49753(0x22f)](_0x484c3c[_0xf49753(0x261)],_0x484c3c[_0xf49753(0x244)]),{'verbose':_0x1eccde[_0xf49753(0x283)]});await handleSingleObjectOutput(_0x5ccec2[_0xf49753(0x238)],_0x1eccde);}}}return 0x0;}catch(_0x56f1e6){if(_0x56f1e6 instanceof SDKError)return console[_0xf49753(0x20f)](_0xf49753(0x25d)+_0x56f1e6['message']),_0x56f1e6[_0xf49753(0x242)]&&console[_0xf49753(0x20f)](_0xf49753(0x288)+_0x56f1e6['cause']),0x1;throw _0x56f1e6;}}}export class SegmentShowCommand extends BaseCommand{['name']='segment:show';['description']=a35_0x500582(0x26f);async[a35_0x500582(0x23f)](_0x1af566){const _0x4513f4=a35_0x500582,{options:_0x28db20,args:_0x3cb688,tdx:_0x11fc00}=_0x1af566,_0x4f39c9=_0x3cb688[0x0];if(!_0x4f39c9)return console[_0x4513f4(0x20f)](_0x4513f4(0x1ee)),console[_0x4513f4(0x20f)](_0x4513f4(0x1e9)),console[_0x4513f4(0x20f)](_0x4513f4(0x1eb)),console['error']('Examples:'),console[_0x4513f4(0x20f)]('\x20\x20tdx\x20sg\x20show\x20\x22Premium\x20Users\x22'),console[_0x4513f4(0x20f)](_0x4513f4(0x287)),0x1;try{const _0x48d063=_0x28db20['parentSegment'],_0xf7bc83=await resolveSegmentTarget(_0x4f39c9,_0x48d063,_0x28db20[_0x4513f4(0x283)]);_0x28db20[_0x4513f4(0x283)]&&console[_0x4513f4(0x20f)](_0x4513f4(0x21e)+_0xf7bc83);const _0x542eab=await withSpinner(_0x4513f4(0x263)+_0x4f39c9+_0x4513f4(0x1e8),()=>_0x11fc00[_0x4513f4(0x1f2)][_0x4513f4(0x221)](_0xf7bc83),{'verbose':_0x28db20[_0x4513f4(0x283)]}),_0x442d28=_0x542eab[_0x4513f4(0x238)];_0x28db20[_0x4513f4(0x283)]&&(console['error'](_0x4513f4(0x20d)+_0x442d28[_0x4513f4(0x210)]),console['error']('Parent\x20ID:\x20'+_0x442d28[_0x4513f4(0x261)]));if(_0x442d28['type']==='folder')return console[_0x4513f4(0x20f)](_0x4513f4(0x26a)),console['error'](_0x4513f4(0x209)),0x1;if(_0x442d28[_0x4513f4(0x210)]==='parent')return console[_0x4513f4(0x20f)](_0x4513f4(0x1f9)),console[_0x4513f4(0x20f)](_0x4513f4(0x284)),0x1;if(!_0x442d28[_0x4513f4(0x244)])throw new SDKError(ErrorCode[_0x4513f4(0x1f1)],_0x4513f4(0x280));const _0x495fa7=await withSpinner(_0x4513f4(0x226),()=>_0x11fc00['segment'][_0x4513f4(0x275)](_0x442d28[_0x4513f4(0x261)],_0x442d28[_0x4513f4(0x244)]),{'verbose':_0x28db20['verbose']});let _0x3e76c6=_0x495fa7[_0x4513f4(0x238)];const _0x3d2113=resolveLimit(_0x28db20[_0x4513f4(0x214)],DEFAULT_DISPLAY_LIMIT),_0x3a4d2c=/\bLIMIT\s+\d+/i['test'](_0x3e76c6);!_0x3a4d2c&&(_0x3e76c6=_0x3e76c6[_0x4513f4(0x241)]()[_0x4513f4(0x25a)](/;+$/,''),_0x3e76c6=_0x4513f4(0x215)+_0x3e76c6+'\x0a)\x20AS\x20segment_query\x0aLIMIT\x20'+_0x3d2113);_0x28db20[_0x4513f4(0x283)]&&console['error'](_0x4513f4(0x246)+_0x3e76c6);const _0x2cb81c=await withProgressSpinner(_0x4513f4(0x1fe),async _0x5d9c69=>{const _0x5af5b1=_0x4513f4,_0xd914c4=await _0x11fc00['query']['execute'](_0x3e76c6,{'catalog':'td','schema':_0x5af5b1(0x267),'onJobId':_0x565699=>{const _0x2700a5=_0x5af5b1;_0x5d9c69[_0x2700a5(0x25c)](_0x565699);}});return _0xd914c4;},{'verbose':_0x28db20[_0x4513f4(0x283)]}),_0x230e60=_0x2cb81c[_0x4513f4(0x238)],_0x16c259=_0x230e60[_0x4513f4(0x236)]?_0x4513f4(0x1f7)+_0x230e60['jobId']+']':'';return console[_0x4513f4(0x20f)]('βœ”\x20Query\x20completed:\x20Processed\x20'+_0x230e60[_0x4513f4(0x1fc)][_0x4513f4(0x223)][_0x4513f4(0x20e)]()+_0x4513f4(0x1e7)+(_0x4513f4(0x276)+formatElapsed(_0x230e60[_0x4513f4(0x1fc)][_0x4513f4(0x256)])+_0x16c259)),await handleQueryOutput(_0x230e60,_0x28db20),0x0;}catch(_0x4c43b3){if(_0x4c43b3 instanceof SDKError)return console[_0x4513f4(0x20f)](_0x4513f4(0x273)+_0x4c43b3[_0x4513f4(0x23c)]+']'),console[_0x4513f4(0x20f)]('\x0a'+_0x4c43b3[_0x4513f4(0x1fb)]),0x1;throw _0x4c43b3;}}}export class SegmentFolderListCommand extends BaseCommand{[a35_0x500582(0x250)]=a35_0x500582(0x289);[a35_0x500582(0x268)]=a35_0x500582(0x20b);async[a35_0x500582(0x23f)](_0x5e34df){const _0x548757=a35_0x500582,{options:_0x1043f4,args:_0x4df0f3,tdx:_0x516e5e}=_0x5e34df;if(_0x4df0f3['length']===0x0)return console[_0x548757(0x20f)]('Error:\x20Parent\x20segment\x20name\x20is\x20required'),console[_0x548757(0x20f)]('Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>'),0x1;const _0x43f69e=_0x4df0f3[0x0];try{_0x1043f4[_0x548757(0x283)]&&(console['error'](_0x548757(0x205)+_0x1043f4[_0x548757(0x21c)]),console[_0x548757(0x20f)](_0x548757(0x25f)+_0x43f69e));const _0x56265a=await withSpinner(_0x548757(0x27f)+_0x43f69e+_0x548757(0x1e8),()=>_0x516e5e[_0x548757(0x1f2)][_0x548757(0x229)](_0x43f69e),{'verbose':_0x1043f4[_0x548757(0x283)]}),_0x3a18a5=_0x56265a[_0x548757(0x238)];_0x1043f4[_0x548757(0x283)]&&console['error'](_0x548757(0x213)+_0x3a18a5);const _0x61d116=await withSpinner(_0x548757(0x253)+_0x43f69e+'\x27...',()=>_0x516e5e[_0x548757(0x1f2)]['listFolders'](_0x3a18a5),{'verbose':_0x1043f4[_0x548757(0x283)]}),_0x5b4559=_0x61d116[_0x548757(0x238)];return console[_0x548757(0x20f)](_0x548757(0x25b)+_0x5b4559['length']+'\x20folder'+(_0x5b4559[_0x548757(0x282)]!==0x1?'s':'')),await handleSDKOutput(_0x5b4559,_0x1043f4),0x0;}catch(_0x19ba92){if(_0x19ba92 instanceof SDKError)return console[_0x548757(0x20f)]('Error:\x20'+_0x19ba92['message']),_0x19ba92[_0x548757(0x242)]&&console[_0x548757(0x20f)](_0x548757(0x288)+_0x19ba92[_0x548757(0x242)]),0x1;throw _0x19ba92;}}}export class SegmentFolderShowCommand extends BaseCommand{['name']='segment:folder:show';[a35_0x500582(0x268)]=a35_0x500582(0x1f3);async[a35_0x500582(0x23f)](_0x459f39){const _0x58b4f6=a35_0x500582,{options:_0x2838a8,args:_0x48d8f9,tdx:_0x4642cd}=_0x459f39;if(_0x48d8f9['length']===0x0)return console[_0x58b4f6(0x20f)](_0x58b4f6(0x257)),console[_0x58b4f6(0x20f)](_0x58b4f6(0x1fa)),0x1;try{const {parentId:_0x3064ab,childId:_0x3338ea}=parseSegmentRef(_0x48d8f9[0x0]);_0x2838a8[_0x58b4f6(0x283)]&&(console[_0x58b4f6(0x20f)]('Site:\x20'+_0x2838a8[_0x58b4f6(0x21c)]),console[_0x58b4f6(0x20f)](_0x58b4f6(0x25f)+_0x3064ab),_0x3338ea&&console[_0x58b4f6(0x20f)](_0x58b4f6(0x1ef)+_0x3338ea));if(!_0x3338ea)return console['error'](_0x58b4f6(0x27a)),0x1;const _0x41bc99=await withSpinner(_0x58b4f6(0x27f)+_0x3064ab+_0x58b4f6(0x1e8),()=>_0x4642cd['segment'][_0x58b4f6(0x229)](_0x3064ab),{'verbose':_0x2838a8[_0x58b4f6(0x283)]}),_0xe6f687=_0x41bc99[_0x58b4f6(0x238)];_0x2838a8[_0x58b4f6(0x283)]&&console[_0x58b4f6(0x20f)]('Resolved\x20parent\x20ID:\x20'+_0xe6f687);const _0xb299eb=await withSpinner(_0x58b4f6(0x285)+_0x3338ea+_0x58b4f6(0x1e8),()=>_0x4642cd[_0x58b4f6(0x1f2)][_0x58b4f6(0x1fd)](_0xe6f687,_0x3338ea),{'verbose':_0x2838a8['verbose']}),_0x1ebaa6=_0xb299eb[_0x58b4f6(0x238)];_0x2838a8[_0x58b4f6(0x283)]&&console['error'](_0x58b4f6(0x230)+_0x1ebaa6);const _0x2c2b14=await withSpinner(_0x58b4f6(0x222)+_0x3338ea+_0x58b4f6(0x1e8),()=>_0x4642cd[_0x58b4f6(0x1f2)]['getFolder'](_0x1ebaa6),{'verbose':_0x2838a8[_0x58b4f6(0x283)]});return await handleSDKOutput([_0x2c2b14[_0x58b4f6(0x238)]],_0x2838a8),0x0;}catch(_0x24824f){if(_0x24824f instanceof SDKError)return console[_0x58b4f6(0x20f)]('Error:\x20'+_0x24824f[_0x58b4f6(0x1fb)]),_0x24824f[_0x58b4f6(0x242)]&&console[_0x58b4f6(0x20f)]('\x20\x20Cause:\x20'+_0x24824f[_0x58b4f6(0x242)]),0x1;throw _0x24824f;}}}export class SegmentSQLCommand extends BaseCommand{[a35_0x500582(0x250)]='segment:sql';[a35_0x500582(0x268)]=a35_0x500582(0x26d);async[a35_0x500582(0x23f)](_0x9a28c){const _0x480600=a35_0x500582,{options:_0x469aba,args:_0x46291b}=_0x9a28c,_0x472e69=_0x469aba,_0x6fe391=_0x472e69[_0x480600(0x206)],_0x2870e0=_0x46291b[0x0];if(!_0x2870e0&&!_0x6fe391)return console['error'](a35_0x2c9435[_0x480600(0x23d)](_0x480600(0x26e))),console[_0x480600(0x20f)]('Usage:'),console[_0x480600(0x20f)](_0x480600(0x278)),console[_0x480600(0x20f)](_0x480600(0x1e5)),console['error'](_0x480600(0x1f6)),console[_0x480600(0x20f)]('\x20\x20tdx\x20sg\x20sql\x20\x22Premium\x20Users\x22'),console[_0x480600(0x20f)](_0x480600(0x270)),0x1;if(_0x2870e0&&_0x6fe391)return console[_0x480600(0x20f)](a35_0x2c9435[_0x480600(0x23d)](_0x480600(0x22a))),0x1;try{let _0x41b39b;if(_0x6fe391)_0x41b39b=await this[_0x480600(0x24c)](_0x6fe391,_0x9a28c);else{if(isYamlFilePath(_0x2870e0))return console[_0x480600(0x20f)](a35_0x2c9435[_0x480600(0x23d)](_0x480600(0x1f0))),console[_0x480600(0x20f)](_0x480600(0x212)+_0x2870e0),0x1;else _0x41b39b=await this[_0x480600(0x202)](_0x2870e0,_0x9a28c);}return _0x469aba[_0x480600(0x259)]===_0x480600(0x217)||_0x469aba[_0x480600(0x259)]==='jsonl'?await handleSDKOutput([{'sql':_0x41b39b}],_0x469aba):console[_0x480600(0x224)](_0x41b39b),0x0;}catch(_0x2f07db){if(_0x2f07db instanceof SDKError)return console[_0x480600(0x20f)](_0x480600(0x25d)+_0x2f07db['message']),_0x2f07db[_0x480600(0x242)]&&console[_0x480600(0x20f)](_0x480600(0x288)+_0x2f07db[_0x480600(0x242)]),0x1;throw _0x2f07db;}}async['getSQLFromYamlFile'](_0x48d2ff,_0x59fafe){const _0x3aaed4=a35_0x500582,{options:_0xa6945c,tdx:_0x4ee636}=_0x59fafe;let _0x31df44;try{_0x31df44=await resolveYamlFilePath(_0x48d2ff);}catch(_0x3cf2c3){throw new SDKError(ErrorCode[_0x3aaed4(0x1ea)],_0x3aaed4(0x219)+_0x3cf2c3[_0x3aaed4(0x1fb)]);}_0xa6945c[_0x3aaed4(0x283)]&&console[_0x3aaed4(0x20f)](_0x3aaed4(0x20c)+_0x31df44[_0x3aaed4(0x234)]+'/'+_0x31df44[_0x3aaed4(0x277)]);const _0x45e8ed=await withSpinner(_0x3aaed4(0x200),()=>_0x4ee636[_0x3aaed4(0x1f2)][_0x3aaed4(0x228)](_0x31df44[_0x3aaed4(0x265)],_0x31df44[_0x3aaed4(0x234)],_0x31df44[_0x3aaed4(0x277)]),{'verbose':_0xa6945c[_0x3aaed4(0x283)]});return _0x45e8ed['data'];}async[a35_0x500582(0x202)](_0x111df1,_0x57ff77){const _0x3b195b=a35_0x500582,{options:_0x543a5e,tdx:_0x5662fe}=_0x57ff77,_0x55faf5=_0x543a5e['parentSegment'],_0x4af65f=await resolveSegmentTarget(_0x111df1,_0x55faf5,_0x543a5e[_0x3b195b(0x283)]);_0x543a5e[_0x3b195b(0x283)]&&console['error']('Target\x20path:\x20'+_0x4af65f);const _0x465ba8=await withSpinner('Resolving\x20\x27'+_0x111df1+_0x3b195b(0x1e8),()=>_0x5662fe[_0x3b195b(0x1f2)][_0x3b195b(0x221)](_0x4af65f),{'verbose':_0x543a5e['verbose']}),_0x51db23=_0x465ba8[_0x3b195b(0x238)];_0x543a5e[_0x3b195b(0x283)]&&(console['error'](_0x3b195b(0x20d)+_0x51db23['type']),console['error'](_0x3b195b(0x21b)+_0x51db23[_0x3b195b(0x261)]));if(_0x51db23[_0x3b195b(0x210)]==='folder')throw new SDKError(ErrorCode[_0x3b195b(0x1ea)],_0x3b195b(0x243));if(_0x51db23['type']===_0x3b195b(0x1f4))throw new SDKError(ErrorCode[_0x3b195b(0x1ea)],_0x3b195b(0x204));if(!_0x51db23[_0x3b195b(0x244)])throw new SDKError(ErrorCode[_0x3b195b(0x1f1)],_0x3b195b(0x280));const _0x17989a=await withSpinner(_0x3b195b(0x226),()=>_0x5662fe['segment'][_0x3b195b(0x275)](_0x51db23[_0x3b195b(0x261)],_0x51db23[_0x3b195b(0x244)]),{'verbose':_0x543a5e['verbose']});return _0x17989a[_0x3b195b(0x238)];}}export class SegmentFolderCreateCommand extends BaseCommand{[a35_0x500582(0x250)]=a35_0x500582(0x255);[a35_0x500582(0x268)]=a35_0x500582(0x20a);async[a35_0x500582(0x23f)](_0x58537d){const _0x326166=a35_0x500582,{options:_0x4c250e,args:_0x23af79,tdx:_0x884f1c}=_0x58537d,_0x2b912d=_0x4c250e;if(_0x23af79['length']<0x2)return console[_0x326166(0x20f)](_0x326166(0x269)),console[_0x326166(0x20f)](_0x326166(0x254)),0x1;const _0x1881e2=_0x23af79[0x0],_0x4d2f1d=_0x23af79[0x1];_0x2b912d['verbose']&&(console[_0x326166(0x20f)](_0x326166(0x205)+_0x2b912d[_0x326166(0x21c)]),console[_0x326166(0x20f)](_0x326166(0x27d)+_0x1881e2),console['error'](_0x326166(0x1ef)+_0x4d2f1d));let _0x50c830;if(_0x2b912d['parentFolder']){const _0x493cc8=_0x2b912d['parentFolder'],_0xa79752=await withSpinner(_0x326166(0x27f)+_0x1881e2+'\x27...',()=>_0x884f1c['segment'][_0x326166(0x229)](_0x1881e2),{'verbose':_0x2b912d[_0x326166(0x283)]}),_0x2cbb34=_0xa79752['data'],_0x3265be=await withSpinner(_0x326166(0x240)+_0x493cc8+_0x326166(0x1e8),()=>_0x884f1c[_0x326166(0x1f2)][_0x326166(0x1fd)](_0x2cbb34,_0x493cc8),{'verbose':_0x2b912d[_0x326166(0x283)]});_0x50c830=_0x3265be[_0x326166(0x238)],_0x2b912d['verbose']&&console[_0x326166(0x20f)]('Resolved\x20parent\x20folder\x20ID:\x20'+_0x50c830);}const _0x3f3250={'name':_0x4d2f1d,'description':_0x2b912d[_0x326166(0x268)],'parentFolderId':_0x50c830},_0x5d24b3=await withSpinner(_0x326166(0x262)+_0x4d2f1d+_0x326166(0x1e8),()=>_0x884f1c[_0x326166(0x1f2)][_0x326166(0x21a)](_0x1881e2,_0x3f3250),{'verbose':_0x2b912d['verbose']}),_0x4ed740=_0x5d24b3[_0x326166(0x238)];return console[_0x326166(0x20f)]('βœ”\x20Created\x20folder\x20\x27'+_0x4ed740[_0x326166(0x250)]+_0x326166(0x247)+_0x4ed740['id']),await handleSDKOutput([_0x4ed740],_0x2b912d),0x0;}}export class SegmentViewCommand extends BaseCommand{['name']=a35_0x500582(0x258);['description']=a35_0x500582(0x266);async[a35_0x500582(0x23f)](_0x1140ce){const _0x199449=a35_0x500582,{options:_0x5c01b2,args:_0x1640cd,tdx:_0xd87fa8}=_0x1140ce,_0x10b694=_0x1640cd[0x0];if(!_0x10b694)return console['error'](_0x199449(0x27c)),console['error'](_0x199449(0x201)),console[_0x199449(0x20f)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20view\x20<path/to/segment.yml>'),console[_0x199449(0x20f)](_0x199449(0x260)),console[_0x199449(0x20f)](_0x199449(0x1f5)),console[_0x199449(0x20f)](_0x199449(0x1f6)),console[_0x199449(0x20f)](_0x199449(0x232)),console[_0x199449(0x20f)]('\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20\x20\x20\x20\x20#\x20View\x20child\x20segment\x20details'),console['error'](_0x199449(0x25e)),console['error']('\x20\x20tdx\x20sg\x20view\x20segments/my-audience/premium-users.yml'),0x1;try{const _0x12e05e=_0x5c01b2[_0x199449(0x234)],_0x1e9ad0=await resolveSegmentTarget(_0x10b694,_0x12e05e,_0x5c01b2[_0x199449(0x283)]);_0x5c01b2[_0x199449(0x283)]&&console[_0x199449(0x20f)](_0x199449(0x21e)+_0x1e9ad0);const _0x14315a=await withSpinner(_0x199449(0x263)+_0x10b694+_0x199449(0x1e8),()=>_0xd87fa8['segment'][_0x199449(0x221)](_0x1e9ad0),{'verbose':_0x5c01b2[_0x199449(0x283)]}),_0x14f020=_0x14315a[_0x199449(0x238)];_0x5c01b2[_0x199449(0x283)]&&(console[_0x199449(0x20f)](_0x199449(0x20d)+_0x14f020[_0x199449(0x210)]),console[_0x199449(0x20f)](_0x199449(0x21b)+_0x14f020['parentId']),_0x14f020[_0x199449(0x1e4)]&&console[_0x199449(0x20f)]('Folder\x20ID:\x20'+_0x14f020[_0x199449(0x1e4)]),_0x14f020[_0x199449(0x244)]&&console[_0x199449(0x20f)](_0x199449(0x274)+_0x14f020[_0x199449(0x244)]));if(_0x5c01b2[_0x199449(0x27e)]){if(_0x14f020[_0x199449(0x210)]===_0x199449(0x26c))return console[_0x199449(0x20f)](_0x199449(0x264)),0x1;if(_0x14f020[_0x199449(0x210)]===_0x199449(0x1f4))return console[_0x199449(0x20f)](_0x199449(0x251)),console[_0x199449(0x20f)]('Use:\x20tdx\x20ps\x20view\x20-w'),0x1;if(!_0x14f020[_0x199449(0x244)])throw new SDKError(ErrorCode[_0x199449(0x1f1)],_0x199449(0x280));const _0x4e08e6=getConsoleNextUrl(_0x5c01b2[_0x199449(0x21c)],_0x199449(0x28a)+_0x14f020[_0x199449(0x261)]+_0x199449(0x1ff)+_0x14f020[_0x199449(0x244)]);return console[_0x199449(0x20f)](a35_0x2c9435[_0x199449(0x203)]('βœ”')+_0x199449(0x272)+a35_0x2c9435[_0x199449(0x216)](_0x4e08e6)),openBrowser(_0x4e08e6),0x0;}if(_0x14f020[_0x199449(0x210)]===_0x199449(0x26c)){if(!_0x14f020['folderId'])throw new SDKError(ErrorCode[_0x199449(0x23a)],_0x199449(0x233));const _0x129a8a=await withSpinner('Fetching\x20folder\x20details...',()=>_0xd87fa8['segment'][_0x199449(0x248)](_0x14f020['folderId']),{'verbose':_0x5c01b2[_0x199449(0x283)]});await handleSingleObjectOutput(_0x129a8a[_0x199449(0x238)],_0x5c01b2);}else{if(_0x14f020[_0x199449(0x210)]==='segment'){if(!_0x14f020[_0x199449(0x244)])throw new SDKError(ErrorCode[_0x199449(0x1f1)],_0x199449(0x280));const _0x2d1f57=await withSpinner(_0x199449(0x281),()=>_0xd87fa8[_0x199449(0x1f2)][_0x199449(0x22f)](_0x14f020[_0x199449(0x261)],_0x14f020[_0x199449(0x244)]),{'verbose':_0x5c01b2['verbose']}),_0x26075b=getConsoleNextUrl(_0x5c01b2[_0x199449(0x21c)],_0x199449(0x28a)+_0x14f020['parentId']+_0x199449(0x1ff)+_0x14f020[_0x199449(0x244)]),_0x49b6e3=_0x2d1f57[_0x199449(0x238)];_0x49b6e3[_0x199449(0x218)]=_0x26075b,await handleSingleObjectOutput(_0x49b6e3,_0x5c01b2);}else return console['error'](_0x199449(0x245)),console[_0x199449(0x20f)](_0x199449(0x22c)),0x1;}return 0x0;}catch(_0x48c9c9){if(_0x48c9c9 instanceof SDKError)return console[_0x199449(0x20f)](_0x199449(0x25d)+_0x48c9c9[_0x199449(0x1fb)]),_0x48c9c9[_0x199449(0x242)]&&console[_0x199449(0x20f)](_0x199449(0x288)+_0x48c9c9[_0x199449(0x242)]),0x1;throw _0x48c9c9;}}}export const SegmentInfoCommand=SegmentViewCommand;function a35_0x5279(_0x16f262,_0x41fb09){_0x16f262=_0x16f262-0x1e4;const _0x314702=a35_0x3147();let _0x5279f8=_0x314702[_0x16f262];return _0x5279f8;}export class SegmentDescCommand extends BaseCommand{[a35_0x500582(0x250)]=a35_0x500582(0x22d);[a35_0x500582(0x268)]=a35_0x500582(0x27b);async[a35_0x500582(0x23f)](_0x3ba57a){const _0x11b17b=a35_0x500582,{options:_0x18cb03,args:_0x9c6330,tdx:_0x2c84a2}=_0x3ba57a,_0x24aee7=_0x9c6330[0x0];if(!_0x24aee7)return console[_0x11b17b(0x20f)](_0x11b17b(0x1ee)),console['error']('Usage:\x20tdx\x20sg\x20desc\x20<name>'),console[_0x11b17b(0x20f)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20desc\x20<path/to/segment.yml>'),console[_0x11b17b(0x20f)](_0x11b17b(0x1f6)),console[_0x11b17b(0x20f)]('\x20\x20tdx\x20sg\x20desc\x20\x22Premium\x20Users\x22'),console[_0x11b17b(0x20f)](_0x11b17b(0x249)),0x1;try{const _0x2fa767=_0x18cb03[_0x11b17b(0x234)],_0x3166e2=await resolveSegmentTarget(_0x24aee7,_0x2fa767,_0x18cb03[_0x11b17b(0x283)]);_0x18cb03[_0x11b17b(0x283)]&&console['error'](_0x11b17b(0x21e)+_0x3166e2);const _0x46d574=await withSpinner(_0x11b17b(0x263)+_0x24aee7+_0x11b17b(0x1e8),()=>_0x2c84a2[_0x11b17b(0x1f2)]['resolvePathToResource'](_0x3166e2),{'verbose':_0x18cb03[_0x11b17b(0x283)]}),_0x2882c1=_0x46d574[_0x11b17b(0x238)];_0x18cb03[_0x11b17b(0x283)]&&(console['error']('Resolved\x20type:\x20'+_0x2882c1[_0x11b17b(0x210)]),console[_0x11b17b(0x20f)]('Parent\x20ID:\x20'+_0x2882c1[_0x11b17b(0x261)]));if(_0x2882c1['type']===_0x11b17b(0x26c))return console[_0x11b17b(0x20f)](_0x11b17b(0x1ec)),console[_0x11b17b(0x20f)]('Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.'),0x1;if(_0x2882c1[_0x11b17b(0x210)]===_0x11b17b(0x1f4))return console[_0x11b17b(0x20f)]('Error:\x20Cannot\x20show\x20schema\x20for\x20parent\x20segment\x20with\x20this\x20command.'),console[_0x11b17b(0x20f)]('Use:\x20tdx\x20ps\x20desc'),0x1;if(!_0x2882c1[_0x11b17b(0x244)])throw new SDKError(ErrorCode[_0x11b17b(0x1f1)],_0x11b17b(0x280));const _0x1217ac=await withSpinner(_0x11b17b(0x226),()=>_0x2c84a2[_0x11b17b(0x1f2)][_0x11b17b(0x275)](_0x2882c1['parentId'],_0x2882c1[_0x11b17b(0x244)]),{'verbose':_0x18cb03[_0x11b17b(0x283)]}),_0x26de0b=_0x1217ac['data'],_0x371366=await executeSchemaQuery(_0x26de0b,_0x2c84a2,_0x18cb03);return await handleQueryOutput(_0x371366,_0x18cb03),0x0;}catch(_0x52206d){if(_0x52206d instanceof SDKError)return console[_0x11b17b(0x20f)](_0x11b17b(0x25d)+_0x52206d[_0x11b17b(0x1fb)]),_0x52206d[_0x11b17b(0x242)]&&console[_0x11b17b(0x20f)]('\x20\x20Cause:\x20'+_0x52206d[_0x11b17b(0x242)]),0x1;throw _0x52206d;}}}
1
+ const a35_0x887130=a35_0x458b;(function(_0x330c2a,_0x537c68){const _0x410b6d=a35_0x458b,_0x3f59b7=_0x330c2a();while(!![]){try{const _0x22e47f=-parseInt(_0x410b6d(0xf2))/0x1*(parseInt(_0x410b6d(0x132))/0x2)+parseInt(_0x410b6d(0x14f))/0x3+parseInt(_0x410b6d(0x137))/0x4+parseInt(_0x410b6d(0xc3))/0x5*(parseInt(_0x410b6d(0x119))/0x6)+parseInt(_0x410b6d(0x121))/0x7+-parseInt(_0x410b6d(0xe1))/0x8+-parseInt(_0x410b6d(0x13d))/0x9*(parseInt(_0x410b6d(0x111))/0xa);if(_0x22e47f===_0x537c68)break;else _0x3f59b7['push'](_0x3f59b7['shift']());}catch(_0x16f403){_0x3f59b7['push'](_0x3f59b7['shift']());}}}(a35_0x2de9,0xe084f));import{BaseCommand}from'./command.js';function a35_0x458b(_0xc1207e,_0x55a8b8){_0xc1207e=_0xc1207e-0xbe;const _0x2de938=a35_0x2de9();let _0x458b7c=_0x2de938[_0xc1207e];return _0x458b7c;}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_0x557d03 from'chalk';async function resolveSegmentTarget(_0x251f74,_0x50991c,_0x4eefde){const _0x4b1297=a35_0x458b;if(isYamlFilePath(_0x251f74))try{const _0x399390=await resolveYamlFilePath(_0x251f74);return _0x4eefde&&(console[_0x4b1297(0x144)]('Resolved\x20YAML\x20file:\x20'+_0x251f74),console[_0x4b1297(0x144)](_0x4b1297(0x145)+_0x399390['parentSegment']),console[_0x4b1297(0x144)](_0x4b1297(0x13b)+_0x399390[_0x4b1297(0xf3)]),console[_0x4b1297(0x144)](_0x4b1297(0x14a)+(_0x399390[_0x4b1297(0x14c)]||'(root)')),console['error'](_0x4b1297(0x15a)+_0x399390[_0x4b1297(0xeb)])),_0x399390[_0x4b1297(0xeb)];}catch(_0x14a49e){throw new SDKError(ErrorCode[_0x4b1297(0xcc)],_0x4b1297(0x10e)+_0x14a49e[_0x4b1297(0x15c)]);}if(!_0x50991c)throw new SDKError(ErrorCode[_0x4b1297(0xcc)],_0x4b1297(0x13f));return _0x50991c+'/'+_0x251f74;}export class SegmentDescribeCommand extends BaseCommand{[a35_0x887130(0x151)]=a35_0x887130(0xd2);[a35_0x887130(0x16b)]=a35_0x887130(0xe4);async[a35_0x887130(0x154)](_0x2cafa5){const _0x4c7ede=a35_0x887130,{options:_0x37736d,args:_0x126e50,tdx:_0x2964e9}=_0x2cafa5,_0x4bd9f4=_0x126e50[0x0],_0x229fd0=!_0x4bd9f4&&!!_0x37736d[_0x4c7ede(0xce)],_0x5c4163=_0x4bd9f4||_0x37736d[_0x4c7ede(0xce)];if(!_0x5c4163)return console[_0x4c7ede(0x144)]('Error:\x20Path\x20or\x20name\x20is\x20required'),console['error'](_0x4c7ede(0xd7)),console[_0x4c7ede(0x144)]('Examples:'),console[_0x4c7ede(0x144)]('\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22'),console[_0x4c7ede(0x144)](_0x4c7ede(0x10a)),console['error']('\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context'),console[_0x4c7ede(0x144)](_0x4c7ede(0x14e)),0x1;try{const _0x343f17=_0x37736d['segmentPath'];let _0x43a6bb=_0x5c4163;!_0x229fd0&&_0x343f17&&!_0x5c4163[_0x4c7ede(0xfa)]('/')&&(_0x43a6bb=_0x343f17+'/'+_0x5c4163,_0x37736d['verbose']&&console[_0x4c7ede(0x144)](_0x4c7ede(0x113)+_0x43a6bb));const _0x26b9f5=await withSpinner(_0x4c7ede(0x142)+_0x43a6bb+_0x4c7ede(0xc4),()=>_0x2964e9['segment'][_0x4c7ede(0x16a)](_0x43a6bb),{'verbose':_0x37736d[_0x4c7ede(0x148)]}),_0x492cd3=_0x26b9f5['data'];_0x37736d[_0x4c7ede(0x148)]&&(console['error'](_0x4c7ede(0x155)+_0x492cd3['type']),console[_0x4c7ede(0x144)](_0x4c7ede(0x11a)+_0x492cd3[_0x4c7ede(0x110)]),_0x492cd3[_0x4c7ede(0x117)]&&console[_0x4c7ede(0x144)]('Folder\x20ID:\x20'+_0x492cd3[_0x4c7ede(0x117)]),_0x492cd3[_0x4c7ede(0x13c)]&&console[_0x4c7ede(0x144)]('Segment\x20ID:\x20'+_0x492cd3[_0x4c7ede(0x13c)]));if(_0x492cd3[_0x4c7ede(0xc2)]===_0x4c7ede(0x10c)){const _0x339304=await withSpinner(_0x4c7ede(0x106),()=>_0x2964e9[_0x4c7ede(0xd0)][_0x4c7ede(0x129)](_0x492cd3[_0x4c7ede(0x110)]),{'verbose':_0x37736d[_0x4c7ede(0x148)]});await handleSingleObjectOutput(_0x339304[_0x4c7ede(0x11f)],_0x37736d);}else{if(_0x492cd3['type']===_0x4c7ede(0xd8)){if(!_0x492cd3['folderId'])throw new SDKError(ErrorCode[_0x4c7ede(0x114)],_0x4c7ede(0x138));const _0x55891a=await withSpinner(_0x4c7ede(0xed),()=>_0x2964e9[_0x4c7ede(0xd0)]['getFolder'](_0x492cd3[_0x4c7ede(0x117)]),{'verbose':_0x37736d['verbose']});await handleSingleObjectOutput(_0x55891a[_0x4c7ede(0x11f)],_0x37736d);}else{if(_0x492cd3[_0x4c7ede(0xc2)]===_0x4c7ede(0xd0)){if(!_0x492cd3[_0x4c7ede(0x13c)])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x26ca95=await withSpinner(_0x4c7ede(0x15b),()=>_0x2964e9[_0x4c7ede(0xd0)][_0x4c7ede(0x11c)](_0x492cd3[_0x4c7ede(0x110)],_0x492cd3[_0x4c7ede(0x13c)]),{'verbose':_0x37736d[_0x4c7ede(0x148)]});await handleSingleObjectOutput(_0x26ca95[_0x4c7ede(0x11f)],_0x37736d);}}}return 0x0;}catch(_0x79731f){if(_0x79731f instanceof SDKError)return console[_0x4c7ede(0x144)]('Error:\x20'+_0x79731f['message']),_0x79731f[_0x4c7ede(0x15e)]&&console[_0x4c7ede(0x144)](_0x4c7ede(0xca)+_0x79731f[_0x4c7ede(0x15e)]),0x1;throw _0x79731f;}}}export class SegmentShowCommand extends BaseCommand{[a35_0x887130(0x151)]=a35_0x887130(0xfe);[a35_0x887130(0x16b)]=a35_0x887130(0x136);async[a35_0x887130(0x154)](_0x356182){const _0x17a445=a35_0x887130,{options:_0x2a9f85,args:_0x46af24,tdx:_0x3d9c1d}=_0x356182,_0x11ca95=_0x46af24[0x0];if(!_0x11ca95)return console[_0x17a445(0x144)](_0x17a445(0xf8)),console['error'](_0x17a445(0xe7)),console[_0x17a445(0x144)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20show\x20<path/to/segment.yml>'),console['error']('Examples:'),console['error']('\x20\x20tdx\x20sg\x20show\x20\x22Premium\x20Users\x22'),console['error']('\x20\x20tdx\x20sg\x20show\x20segments/my-audience/premium-users.yml'),0x1;try{const _0xb071e6=_0x2a9f85[_0x17a445(0xce)],_0xa0b657=await resolveSegmentTarget(_0x11ca95,_0xb071e6,_0x2a9f85[_0x17a445(0x148)]);_0x2a9f85[_0x17a445(0x148)]&&console[_0x17a445(0x144)]('Target\x20path:\x20'+_0xa0b657);const _0x4ee75b=await withSpinner(_0x17a445(0xdd)+_0x11ca95+_0x17a445(0xc4),()=>_0x3d9c1d[_0x17a445(0xd0)][_0x17a445(0x16a)](_0xa0b657),{'verbose':_0x2a9f85['verbose']}),_0x332921=_0x4ee75b['data'];_0x2a9f85['verbose']&&(console[_0x17a445(0x144)](_0x17a445(0x155)+_0x332921['type']),console[_0x17a445(0x144)](_0x17a445(0x11a)+_0x332921[_0x17a445(0x110)]));if(_0x332921[_0x17a445(0xc2)]===_0x17a445(0xd8))return console['error'](_0x17a445(0x115)),console[_0x17a445(0x144)](_0x17a445(0xc1)),0x1;if(_0x332921[_0x17a445(0xc2)]==='parent')return console['error'](_0x17a445(0xd1)),console[_0x17a445(0x144)](_0x17a445(0xef)),0x1;if(!_0x332921['segmentId'])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x17a445(0xde));const _0x274174=await withSpinner('Fetching\x20SQL\x20for\x20segment...',()=>_0x3d9c1d[_0x17a445(0xd0)][_0x17a445(0xe0)](_0x332921['parentId'],_0x332921[_0x17a445(0x13c)]),{'verbose':_0x2a9f85[_0x17a445(0x148)]});let _0x56580a=_0x274174[_0x17a445(0x11f)];const _0x215c2a=resolveLimit(_0x2a9f85[_0x17a445(0x12a)],DEFAULT_DISPLAY_LIMIT),_0x473f7d=/\bLIMIT\s+\d+/i[_0x17a445(0xc8)](_0x56580a);!_0x473f7d&&(_0x56580a=_0x56580a[_0x17a445(0xe8)]()[_0x17a445(0x13a)](/;+$/,''),_0x56580a=_0x17a445(0xbe)+_0x56580a+_0x17a445(0x10b)+_0x215c2a);_0x2a9f85[_0x17a445(0x148)]&&console[_0x17a445(0x144)]('SQL\x20query:\x0a'+_0x56580a);const _0x416a1c=await withProgressSpinner(_0x17a445(0x10d),async _0x5e956c=>{const _0x5b4f3f=_0x17a445,_0x491744=await _0x3d9c1d[_0x5b4f3f(0x153)]['execute'](_0x56580a,{'catalog':'td','schema':_0x5b4f3f(0x15d),'onJobId':_0x2c3f47=>{_0x5e956c['setJobId'](_0x2c3f47);}});return _0x491744;},{'verbose':_0x2a9f85['verbose']}),_0x4b470b=_0x416a1c['data'],_0x5c739e=_0x4b470b[_0x17a445(0x12d)]?'\x20[Job\x20ID:\x20'+_0x4b470b[_0x17a445(0x12d)]+']':'';return console[_0x17a445(0x144)](_0x17a445(0xe9)+_0x4b470b[_0x17a445(0x120)][_0x17a445(0x104)][_0x17a445(0xd3)]()+_0x17a445(0x165)+(_0x17a445(0xcb)+formatElapsed(_0x4b470b[_0x17a445(0x120)][_0x17a445(0x135)])+_0x5c739e)),await handleQueryOutput(_0x4b470b,_0x2a9f85),0x0;}catch(_0x16dc63){if(_0x16dc63 instanceof SDKError)return console[_0x17a445(0x144)](_0x17a445(0x11e)+_0x16dc63[_0x17a445(0x134)]+']'),console[_0x17a445(0x144)]('\x0a'+_0x16dc63[_0x17a445(0x15c)]),0x1;throw _0x16dc63;}}}export class SegmentFolderListCommand extends BaseCommand{[a35_0x887130(0x151)]='segment:folder:list';[a35_0x887130(0x16b)]=a35_0x887130(0xc7);async[a35_0x887130(0x154)](_0xa103ba){const _0x136d10=a35_0x887130,{options:_0x58e14d,args:_0x427d1e,tdx:_0x59d05c}=_0xa103ba;if(_0x427d1e['length']===0x0)return console[_0x136d10(0x144)](_0x136d10(0x118)),console[_0x136d10(0x144)](_0x136d10(0xff)),0x1;const _0x4241b5=_0x427d1e[0x0];try{_0x58e14d['verbose']&&(console[_0x136d10(0x144)](_0x136d10(0xfd)+_0x58e14d[_0x136d10(0xfc)]),console[_0x136d10(0x144)](_0x136d10(0xda)+_0x4241b5));const _0x1b2dbc=await withSpinner(_0x136d10(0x13e)+_0x4241b5+_0x136d10(0xc4),()=>_0x59d05c[_0x136d10(0xd0)][_0x136d10(0xf9)](_0x4241b5),{'verbose':_0x58e14d[_0x136d10(0x148)]}),_0x2da79c=_0x1b2dbc['data'];_0x58e14d[_0x136d10(0x148)]&&console[_0x136d10(0x144)](_0x136d10(0x139)+_0x2da79c);const _0x584f97=await withSpinner('Listing\x20folders\x20for\x20parent\x20\x27'+_0x4241b5+_0x136d10(0xc4),()=>_0x59d05c[_0x136d10(0xd0)][_0x136d10(0x123)](_0x2da79c),{'verbose':_0x58e14d['verbose']}),_0x33912f=_0x584f97[_0x136d10(0x11f)];return console[_0x136d10(0x144)](_0x136d10(0x141)+_0x33912f[_0x136d10(0xf4)]+_0x136d10(0xf6)+(_0x33912f[_0x136d10(0xf4)]!==0x1?'s':'')),await handleSDKOutput(_0x33912f,_0x58e14d),0x0;}catch(_0x452af2){if(_0x452af2 instanceof SDKError)return console[_0x136d10(0x144)](_0x136d10(0x161)+_0x452af2[_0x136d10(0x15c)]),_0x452af2['cause']&&console[_0x136d10(0x144)](_0x136d10(0xca)+_0x452af2[_0x136d10(0x15e)]),0x1;throw _0x452af2;}}}function a35_0x2de9(){const _0x128fd8=['getParent','limit','Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required','red','jobId','Folder\x20ID:\x20','Error:\x20Segment\x20name\x20or\x20--path\x20is\x20required','Target\x20path:\x20','Fetching\x20SQL\x20for\x20segment...','1168606VffmLw','\x20\x20tdx\x20sg\x20desc\x20segments/my-audience/premium-users.yml','code','elapsedTimeMillis','Execute\x20child\x20segment\x20SQL\x20query\x20and\x20show\x20results','621324YCOSAx','Folder\x20ID\x20missing\x20from\x20resolved\x20path','Resolved\x20parent\x20ID:\x20','replace','\x20\x20Segment\x20name:\x20','segmentId','9HlMgZe','Resolving\x20parent\x20segment\x20\x27','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','Options:','βœ”\x20Found\x20','Resolving\x20path\x20\x27','Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)','error','\x20\x20Parent\x20segment:\x20','Use:\x20tdx\x20ps\x20view','Error:\x20Folder\x20or\x20segment\x20name,\x20or\x20YAML\x20file\x20path\x20is\x20required','verbose','segment:folder:create','\x20\x20Folder\x20path:\x20','Fetching\x20folder\x20\x27','folderPath','getSegmentSQLFromYaml','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','3476379HLTygx','Usage:\x20tdx\x20sg\x20desc\x20<name>','name','Resolved\x20folder\x20ID:\x20','query','execute','Resolved\x20type:\x20','getSQLFromYamlFile','Create\x20segment\x20folder\x20for\x20organization','Fetching\x20SQL\x20from\x20rule...','Usage:','\x20\x20Full\x20path:\x20','Fetching\x20segment\x20details...','message','information_schema','cause','Show\x20folder\x20or\x20child\x20segment\x20details','log','Error:\x20','Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.\x20Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','parentFolder','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20-w\x20\x20#\x20Open\x20segment\x20in\x20web\x20browser','\x20rows\x20','format','\x27\x20with\x20ID:\x20','content','Show\x20segment\x20folder\x20details','resolvePathToResource','description','SELECT\x20*\x20FROM\x20(\x0a','Creating\x20folder\x20\x27','SEGMENT_NOT_FOUND','Use:\x20tdx\x20sg\x20view\x20<name>\x20\x20#\x20To\x20show\x20folder\x20details','type','474335jgRinV','\x27...','Error:\x20Folder\x20reference\x20is\x20required','/e/','List\x20segment\x20folders\x20under\x20a\x20parent\x20segment','test','Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>','\x20\x20Cause:\x20','in\x20','INVALID_ARGUMENT','Error:\x20Cannot\x20open\x20folder\x20in\x20web\x20browser.\x20Use\x20a\x20segment\x20name\x20instead.','parentSegment','/app/ps/','segment','Error:\x20Cannot\x20execute\x20query\x20for\x20parent\x20segment\x20with\x20this\x20command.','segment:describe','toLocaleString','path','\x20\x20tdx\x20sg\x20sql\x20\x22Premium\x20Users\x22','green','Usage:\x20tdx\x20segment\x20describe\x20<path>','folder','\x20\x20Server-side\x20segment:\x20\x20tdx\x20sg\x20sql\x20<name>','Parent\x20name:\x20','Use:\x20tdx\x20ps\x20view\x20-w','\x20\x20tdx\x20sg\x20sql\x20--path\x20','Resolving\x20\x27','Segment\x20ID\x20missing\x20from\x20resolved\x20path','\x20\x20tdx\x20sg\x20desc\x20\x22Premium\x20Users\x22','getSegmentSQL','10434696ROvvog','url','Use:\x20tdx\x20ps\x20desc','Show\x20segment\x20or\x20folder\x20details','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20\x20\x20\x20\x20#\x20View\x20child\x20segment\x20details','Error:\x20Cannot\x20show\x20schema\x20for\x20a\x20folder.','Usage:\x20tdx\x20sg\x20show\x20<name>','trim','βœ”\x20Query\x20completed:\x20Processed\x20','segment:folder:show','fullPath','getSQLFromServerSegment','Fetching\x20folder\x20details...','Resolving\x20parent\x20folder\x20\x27','Use:\x20tdx\x20ps\x20show','Error:\x20Cannot\x20show\x20schema\x20for\x20parent\x20segment\x20with\x20this\x20command.','getFolder','2oyBufu','segmentName','length','Resolved\x20parent\x20folder\x20ID:\x20','\x20folder','\x20Opening\x20','Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required','resolveParentId','includes','cyan','site','Site:\x20','segment:show','Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>','βœ”\x20Created\x20folder\x20\x27','Error:\x20Cannot\x20view\x20parent\x20segment\x20details\x20with\x20this\x20command.','\x20\x20tdx\x20sg\x20sql\x20--path\x20segments/my-audience/premium-users.yml','Get\x20SQL\x20query\x20for\x20child\x20segment','processedRows','Resolved:\x20','Fetching\x20parent\x20segment\x20details...','createFolder','resolveFolderId','Examples:','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','parent','Executing\x20segment\x20query...','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','Folder\x20name:\x20','parentId','7261050BbQqxF','segment:view','Resolved\x20relative\x20path\x20to:\x20','SEGMENT_FOLDER_NOT_FOUND','Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.','\x20\x20Local\x20YAML\x20file:\x20\x20\x20\x20\x20\x20tdx\x20sg\x20sql\x20--path\x20<file-path>','folderId','Error:\x20Parent\x20segment\x20name\x20is\x20required','108FhVDGy','Parent\x20ID:\x20','Parent\x20segment:\x20','getSegment','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20view\x20<path/to/segment.yml>','βœ–\x20Query\x20failed\x20[','data','stats','7678643qmKosr','Resolving\x20folder\x20\x27','listFolders','\x20\x20-w,\x20--web\x20\x20Open\x20segment\x20in\x20web\x20browser','Error:\x20Cannot\x20open\x20parent\x20segment\x20with\x20this\x20command.','Error:\x20Specify\x20either\x20segment\x20name\x20or\x20--path,\x20not\x20both','\x20\x20tdx\x20sg\x20view\x20segments/my-audience/premium-users.yml','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20desc\x20<path/to/segment.yml>'];a35_0x2de9=function(){return _0x128fd8;};return a35_0x2de9();}export class SegmentFolderShowCommand extends BaseCommand{['name']=a35_0x887130(0xea);[a35_0x887130(0x16b)]=a35_0x887130(0x169);async[a35_0x887130(0x154)](_0x260827){const _0x5ca94f=a35_0x887130,{options:_0x3d2a0f,args:_0x5d19a4,tdx:_0x1f0381}=_0x260827;if(_0x5d19a4[_0x5ca94f(0xf4)]===0x0)return console[_0x5ca94f(0x144)](_0x5ca94f(0xc5)),console[_0x5ca94f(0x144)](_0x5ca94f(0xc9)),0x1;try{const {parentId:_0x222955,childId:_0x2971b5}=parseSegmentRef(_0x5d19a4[0x0]);_0x3d2a0f[_0x5ca94f(0x148)]&&(console['error']('Site:\x20'+_0x3d2a0f[_0x5ca94f(0xfc)]),console['error'](_0x5ca94f(0xda)+_0x222955),_0x2971b5&&console[_0x5ca94f(0x144)]('Folder\x20name:\x20'+_0x2971b5));if(!_0x2971b5)return console[_0x5ca94f(0x144)](_0x5ca94f(0x143)),0x1;const _0x41e748=await withSpinner(_0x5ca94f(0x13e)+_0x222955+_0x5ca94f(0xc4),()=>_0x1f0381['segment'][_0x5ca94f(0xf9)](_0x222955),{'verbose':_0x3d2a0f['verbose']}),_0x24ad7e=_0x41e748['data'];_0x3d2a0f[_0x5ca94f(0x148)]&&console[_0x5ca94f(0x144)](_0x5ca94f(0x139)+_0x24ad7e);const _0x485efa=await withSpinner(_0x5ca94f(0x122)+_0x2971b5+_0x5ca94f(0xc4),()=>_0x1f0381[_0x5ca94f(0xd0)]['resolveFolderId'](_0x24ad7e,_0x2971b5),{'verbose':_0x3d2a0f[_0x5ca94f(0x148)]}),_0x572b68=_0x485efa[_0x5ca94f(0x11f)];_0x3d2a0f[_0x5ca94f(0x148)]&&console[_0x5ca94f(0x144)](_0x5ca94f(0x152)+_0x572b68);const _0x2afa3e=await withSpinner(_0x5ca94f(0x14b)+_0x2971b5+'\x27...',()=>_0x1f0381['segment']['getFolder'](_0x572b68),{'verbose':_0x3d2a0f[_0x5ca94f(0x148)]});return await handleSDKOutput([_0x2afa3e[_0x5ca94f(0x11f)]],_0x3d2a0f),0x0;}catch(_0x29e2d3){if(_0x29e2d3 instanceof SDKError)return console[_0x5ca94f(0x144)]('Error:\x20'+_0x29e2d3[_0x5ca94f(0x15c)]),_0x29e2d3['cause']&&console['error'](_0x5ca94f(0xca)+_0x29e2d3[_0x5ca94f(0x15e)]),0x1;throw _0x29e2d3;}}}export class SegmentSQLCommand extends BaseCommand{['name']='segment:sql';['description']=a35_0x887130(0x103);async['execute'](_0x2afeda){const _0x2b10f1=a35_0x887130,{options:_0x379af6,args:_0x1e7fb2}=_0x2afeda,_0x569248=_0x379af6,_0x58fb03=_0x569248[_0x2b10f1(0xd4)],_0x3c5782=_0x1e7fb2[0x0];if(!_0x3c5782&&!_0x58fb03)return console[_0x2b10f1(0x144)](a35_0x557d03[_0x2b10f1(0x12c)](_0x2b10f1(0x12f))),console[_0x2b10f1(0x144)](_0x2b10f1(0x159)),console[_0x2b10f1(0x144)](_0x2b10f1(0xd9)),console['error'](_0x2b10f1(0x116)),console[_0x2b10f1(0x144)](_0x2b10f1(0x109)),console[_0x2b10f1(0x144)](_0x2b10f1(0xd5)),console[_0x2b10f1(0x144)](_0x2b10f1(0x102)),0x1;if(_0x3c5782&&_0x58fb03)return console[_0x2b10f1(0x144)](a35_0x557d03[_0x2b10f1(0x12c)](_0x2b10f1(0x126))),0x1;try{let _0x1b8be8;if(_0x58fb03)_0x1b8be8=await this[_0x2b10f1(0x156)](_0x58fb03,_0x2afeda);else{if(isYamlFilePath(_0x3c5782))return console[_0x2b10f1(0x144)](a35_0x557d03[_0x2b10f1(0x12c)]('Error:\x20YAML\x20file\x20paths\x20must\x20be\x20specified\x20with\x20--path\x20option')),console['error'](_0x2b10f1(0xdc)+_0x3c5782),0x1;else _0x1b8be8=await this['getSQLFromServerSegment'](_0x3c5782,_0x2afeda);}return _0x379af6[_0x2b10f1(0x166)]==='json'||_0x379af6[_0x2b10f1(0x166)]==='jsonl'?await handleSDKOutput([{'sql':_0x1b8be8}],_0x379af6):console[_0x2b10f1(0x160)](_0x1b8be8),0x0;}catch(_0x7f8126){if(_0x7f8126 instanceof SDKError)return console['error'](_0x2b10f1(0x161)+_0x7f8126['message']),_0x7f8126[_0x2b10f1(0x15e)]&&console[_0x2b10f1(0x144)](_0x2b10f1(0xca)+_0x7f8126['cause']),0x1;throw _0x7f8126;}}async[a35_0x887130(0x156)](_0x4f7992,_0x1a80f5){const _0x446013=a35_0x887130,{options:_0x52c51e,tdx:_0x24994c}=_0x1a80f5;let _0x55cfab;try{_0x55cfab=await resolveYamlFilePath(_0x4f7992);}catch(_0x1b34b9){throw new SDKError(ErrorCode[_0x446013(0xcc)],_0x446013(0x10e)+_0x1b34b9['message']);}_0x52c51e[_0x446013(0x148)]&&console[_0x446013(0x144)](_0x446013(0x105)+_0x55cfab[_0x446013(0xce)]+'/'+_0x55cfab['segmentName']);const _0x14aa1a=await withSpinner(_0x446013(0x158),()=>_0x24994c[_0x446013(0xd0)][_0x446013(0x14d)](_0x55cfab[_0x446013(0x168)],_0x55cfab[_0x446013(0xce)],_0x55cfab['segmentName']),{'verbose':_0x52c51e[_0x446013(0x148)]});return _0x14aa1a[_0x446013(0x11f)];}async[a35_0x887130(0xec)](_0x449779,_0x527126){const _0x528577=a35_0x887130,{options:_0x2d647f,tdx:_0x4d5b5a}=_0x527126,_0x401149=_0x2d647f[_0x528577(0xce)],_0x5215f2=await resolveSegmentTarget(_0x449779,_0x401149,_0x2d647f[_0x528577(0x148)]);_0x2d647f[_0x528577(0x148)]&&console[_0x528577(0x144)](_0x528577(0x130)+_0x5215f2);const _0xf59f3f=await withSpinner(_0x528577(0xdd)+_0x449779+_0x528577(0xc4),()=>_0x4d5b5a['segment'][_0x528577(0x16a)](_0x5215f2),{'verbose':_0x2d647f[_0x528577(0x148)]}),_0x3d7b56=_0xf59f3f['data'];_0x2d647f['verbose']&&(console[_0x528577(0x144)]('Resolved\x20type:\x20'+_0x3d7b56[_0x528577(0xc2)]),console[_0x528577(0x144)](_0x528577(0x11a)+_0x3d7b56[_0x528577(0x110)]));if(_0x3d7b56[_0x528577(0xc2)]===_0x528577(0xd8))throw new SDKError(ErrorCode[_0x528577(0xcc)],_0x528577(0x162));if(_0x3d7b56[_0x528577(0xc2)]==='parent')throw new SDKError(ErrorCode[_0x528577(0xcc)],'Cannot\x20get\x20SQL\x20for\x20parent\x20segment\x20with\x20this\x20command.\x20Use:\x20tdx\x20ps\x20sql');if(!_0x3d7b56['segmentId'])throw new SDKError(ErrorCode[_0x528577(0xc0)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x45f765=await withSpinner(_0x528577(0x131),()=>_0x4d5b5a[_0x528577(0xd0)]['getSegmentSQL'](_0x3d7b56[_0x528577(0x110)],_0x3d7b56[_0x528577(0x13c)]),{'verbose':_0x2d647f['verbose']});return _0x45f765[_0x528577(0x11f)];}}export class SegmentFolderCreateCommand extends BaseCommand{[a35_0x887130(0x151)]=a35_0x887130(0x149);[a35_0x887130(0x16b)]=a35_0x887130(0x157);async[a35_0x887130(0x154)](_0x3b6983){const _0x5a9693=a35_0x887130,{options:_0x4c81e0,args:_0x53bcf0,tdx:_0x252a94}=_0x3b6983,_0x17afd6=_0x4c81e0;if(_0x53bcf0[_0x5a9693(0xf4)]<0x2)return console[_0x5a9693(0x144)](_0x5a9693(0x12b)),console[_0x5a9693(0x144)]('Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]'),0x1;const _0x35c234=_0x53bcf0[0x0],_0x2c741f=_0x53bcf0[0x1];_0x17afd6[_0x5a9693(0x148)]&&(console['error'](_0x5a9693(0xfd)+_0x17afd6['site']),console[_0x5a9693(0x144)](_0x5a9693(0x11b)+_0x35c234),console[_0x5a9693(0x144)](_0x5a9693(0x10f)+_0x2c741f));let _0x4aac6e;if(_0x17afd6[_0x5a9693(0x163)]){const _0x444d86=_0x17afd6['parentFolder'],_0x5711c1=await withSpinner(_0x5a9693(0x13e)+_0x35c234+_0x5a9693(0xc4),()=>_0x252a94['segment'][_0x5a9693(0xf9)](_0x35c234),{'verbose':_0x17afd6[_0x5a9693(0x148)]}),_0x23f20c=_0x5711c1[_0x5a9693(0x11f)],_0x4c92d5=await withSpinner(_0x5a9693(0xee)+_0x444d86+'\x27...',()=>_0x252a94[_0x5a9693(0xd0)][_0x5a9693(0x108)](_0x23f20c,_0x444d86),{'verbose':_0x17afd6[_0x5a9693(0x148)]});_0x4aac6e=_0x4c92d5[_0x5a9693(0x11f)],_0x17afd6[_0x5a9693(0x148)]&&console['error'](_0x5a9693(0xf5)+_0x4aac6e);}const _0x1c9a7f={'name':_0x2c741f,'description':_0x17afd6[_0x5a9693(0x16b)],'parentFolderId':_0x4aac6e},_0xbf5655=await withSpinner(_0x5a9693(0xbf)+_0x2c741f+_0x5a9693(0xc4),()=>_0x252a94[_0x5a9693(0xd0)][_0x5a9693(0x107)](_0x35c234,_0x1c9a7f),{'verbose':_0x17afd6[_0x5a9693(0x148)]}),_0x3c14ec=_0xbf5655['data'];return console[_0x5a9693(0x144)](_0x5a9693(0x100)+_0x3c14ec[_0x5a9693(0x151)]+_0x5a9693(0x167)+_0x3c14ec['id']),await handleSDKOutput([_0x3c14ec],_0x17afd6),0x0;}}export class SegmentViewCommand extends BaseCommand{[a35_0x887130(0x151)]=a35_0x887130(0x112);[a35_0x887130(0x16b)]=a35_0x887130(0x15f);async[a35_0x887130(0x154)](_0x1aea56){const _0x4f5b65=a35_0x887130,{options:_0x518431,args:_0x2d6bd9,tdx:_0x50762d}=_0x1aea56,_0x5dd59f=_0x2d6bd9[0x0];if(!_0x5dd59f)return console[_0x4f5b65(0x144)](_0x4f5b65(0x147)),console[_0x4f5b65(0x144)]('Usage:\x20tdx\x20sg\x20view\x20<name>\x20[-w]'),console['error'](_0x4f5b65(0x11d)),console[_0x4f5b65(0x144)](_0x4f5b65(0x140)),console[_0x4f5b65(0x144)](_0x4f5b65(0x124)),console[_0x4f5b65(0x144)](_0x4f5b65(0x109)),console[_0x4f5b65(0x144)]('\x20\x20tdx\x20sg\x20view\x20\x22Marketing\x22\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20folder\x20details'),console[_0x4f5b65(0x144)](_0x4f5b65(0xe5)),console[_0x4f5b65(0x144)](_0x4f5b65(0x164)),console['error'](_0x4f5b65(0x127)),0x1;try{const _0x8c0161=_0x518431[_0x4f5b65(0xce)],_0x11f3c4=await resolveSegmentTarget(_0x5dd59f,_0x8c0161,_0x518431[_0x4f5b65(0x148)]);_0x518431['verbose']&&console['error'](_0x4f5b65(0x130)+_0x11f3c4);const _0x4e81fc=await withSpinner(_0x4f5b65(0xdd)+_0x5dd59f+_0x4f5b65(0xc4),()=>_0x50762d[_0x4f5b65(0xd0)][_0x4f5b65(0x16a)](_0x11f3c4),{'verbose':_0x518431[_0x4f5b65(0x148)]}),_0x246a85=_0x4e81fc['data'];_0x518431[_0x4f5b65(0x148)]&&(console[_0x4f5b65(0x144)](_0x4f5b65(0x155)+_0x246a85[_0x4f5b65(0xc2)]),console[_0x4f5b65(0x144)]('Parent\x20ID:\x20'+_0x246a85[_0x4f5b65(0x110)]),_0x246a85[_0x4f5b65(0x117)]&&console[_0x4f5b65(0x144)](_0x4f5b65(0x12e)+_0x246a85['folderId']),_0x246a85['segmentId']&&console[_0x4f5b65(0x144)]('Segment\x20ID:\x20'+_0x246a85['segmentId']));if(_0x518431['web']){if(_0x246a85[_0x4f5b65(0xc2)]===_0x4f5b65(0xd8))return console['error'](_0x4f5b65(0xcd)),0x1;if(_0x246a85[_0x4f5b65(0xc2)]===_0x4f5b65(0x10c))return console[_0x4f5b65(0x144)](_0x4f5b65(0x125)),console['error'](_0x4f5b65(0xdb)),0x1;if(!_0x246a85[_0x4f5b65(0x13c)])throw new SDKError(ErrorCode[_0x4f5b65(0xc0)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x1c93e9=getConsoleNextUrl(_0x518431['site'],'/app/ps/'+_0x246a85[_0x4f5b65(0x110)]+'/e/'+_0x246a85['segmentId']);return console[_0x4f5b65(0x144)](a35_0x557d03[_0x4f5b65(0xd6)]('βœ”')+_0x4f5b65(0xf7)+a35_0x557d03[_0x4f5b65(0xfb)](_0x1c93e9)),openBrowser(_0x1c93e9),0x0;}if(_0x246a85[_0x4f5b65(0xc2)]==='folder'){if(!_0x246a85[_0x4f5b65(0x117)])throw new SDKError(ErrorCode[_0x4f5b65(0x114)],_0x4f5b65(0x138));const _0x3a5d4d=await withSpinner(_0x4f5b65(0xed),()=>_0x50762d[_0x4f5b65(0xd0)][_0x4f5b65(0xf1)](_0x246a85['folderId']),{'verbose':_0x518431[_0x4f5b65(0x148)]});await handleSingleObjectOutput(_0x3a5d4d[_0x4f5b65(0x11f)],_0x518431);}else{if(_0x246a85[_0x4f5b65(0xc2)]===_0x4f5b65(0xd0)){if(!_0x246a85[_0x4f5b65(0x13c)])throw new SDKError(ErrorCode[_0x4f5b65(0xc0)],_0x4f5b65(0xde));const _0x54aabb=await withSpinner(_0x4f5b65(0x15b),()=>_0x50762d['segment'][_0x4f5b65(0x11c)](_0x246a85[_0x4f5b65(0x110)],_0x246a85['segmentId']),{'verbose':_0x518431[_0x4f5b65(0x148)]}),_0x2f72eb=getConsoleNextUrl(_0x518431[_0x4f5b65(0xfc)],_0x4f5b65(0xcf)+_0x246a85[_0x4f5b65(0x110)]+_0x4f5b65(0xc6)+_0x246a85[_0x4f5b65(0x13c)]),_0x118532=_0x54aabb[_0x4f5b65(0x11f)];_0x118532[_0x4f5b65(0xe2)]=_0x2f72eb,await handleSingleObjectOutput(_0x118532,_0x518431);}else return console['error'](_0x4f5b65(0x101)),console['error'](_0x4f5b65(0x146)),0x1;}return 0x0;}catch(_0x4700ac){if(_0x4700ac instanceof SDKError)return console[_0x4f5b65(0x144)](_0x4f5b65(0x161)+_0x4700ac[_0x4f5b65(0x15c)]),_0x4700ac[_0x4f5b65(0x15e)]&&console[_0x4f5b65(0x144)](_0x4f5b65(0xca)+_0x4700ac[_0x4f5b65(0x15e)]),0x1;throw _0x4700ac;}}}export const SegmentInfoCommand=SegmentViewCommand;export class SegmentDescCommand extends BaseCommand{[a35_0x887130(0x151)]='segment:desc';[a35_0x887130(0x16b)]='Show\x20child\x20segment\x20schema\x20(column\x20types)';async[a35_0x887130(0x154)](_0x1fd0f2){const _0x2cc43c=a35_0x887130,{options:_0x3d3fa6,args:_0x25fc11,tdx:_0x7b03c}=_0x1fd0f2,_0x476280=_0x25fc11[0x0];if(!_0x476280)return console[_0x2cc43c(0x144)](_0x2cc43c(0xf8)),console['error'](_0x2cc43c(0x150)),console[_0x2cc43c(0x144)](_0x2cc43c(0x128)),console[_0x2cc43c(0x144)](_0x2cc43c(0x109)),console['error'](_0x2cc43c(0xdf)),console[_0x2cc43c(0x144)](_0x2cc43c(0x133)),0x1;try{const _0x48c632=_0x3d3fa6[_0x2cc43c(0xce)],_0x2febb0=await resolveSegmentTarget(_0x476280,_0x48c632,_0x3d3fa6[_0x2cc43c(0x148)]);_0x3d3fa6[_0x2cc43c(0x148)]&&console[_0x2cc43c(0x144)](_0x2cc43c(0x130)+_0x2febb0);const _0x4b46e0=await withSpinner(_0x2cc43c(0xdd)+_0x476280+_0x2cc43c(0xc4),()=>_0x7b03c[_0x2cc43c(0xd0)][_0x2cc43c(0x16a)](_0x2febb0),{'verbose':_0x3d3fa6[_0x2cc43c(0x148)]}),_0x47c86c=_0x4b46e0['data'];_0x3d3fa6['verbose']&&(console['error']('Resolved\x20type:\x20'+_0x47c86c[_0x2cc43c(0xc2)]),console[_0x2cc43c(0x144)]('Parent\x20ID:\x20'+_0x47c86c[_0x2cc43c(0x110)]));if(_0x47c86c['type']===_0x2cc43c(0xd8))return console[_0x2cc43c(0x144)](_0x2cc43c(0xe6)),console[_0x2cc43c(0x144)]('Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.'),0x1;if(_0x47c86c[_0x2cc43c(0xc2)]===_0x2cc43c(0x10c))return console[_0x2cc43c(0x144)](_0x2cc43c(0xf0)),console[_0x2cc43c(0x144)](_0x2cc43c(0xe3)),0x1;if(!_0x47c86c[_0x2cc43c(0x13c)])throw new SDKError(ErrorCode[_0x2cc43c(0xc0)],_0x2cc43c(0xde));const _0x382fb6=await withSpinner(_0x2cc43c(0x131),()=>_0x7b03c[_0x2cc43c(0xd0)][_0x2cc43c(0xe0)](_0x47c86c['parentId'],_0x47c86c[_0x2cc43c(0x13c)]),{'verbose':_0x3d3fa6[_0x2cc43c(0x148)]}),_0x3fa55f=_0x382fb6[_0x2cc43c(0x11f)],_0x398556=await executeSchemaQuery(_0x3fa55f,_0x7b03c,_0x3d3fa6);return await handleQueryOutput(_0x398556,_0x3d3fa6),0x0;}catch(_0xfb4648){if(_0xfb4648 instanceof SDKError)return console[_0x2cc43c(0x144)](_0x2cc43c(0x161)+_0xfb4648[_0x2cc43c(0x15c)]),_0xfb4648[_0x2cc43c(0x15e)]&&console[_0x2cc43c(0x144)](_0x2cc43c(0xca)+_0xfb4648[_0x2cc43c(0x15e)]),0x1;throw _0xfb4648;}}}
@@ -1 +1 @@
1
- const a36_0x456f9c=a36_0x4ae9;(function(_0x18afbc,_0x1fa796){const _0x49e667=a36_0x4ae9,_0x18d781=_0x18afbc();while(!![]){try{const _0x565868=parseInt(_0x49e667(0x121))/0x1+parseInt(_0x49e667(0x111))/0x2+parseInt(_0x49e667(0x118))/0x3+parseInt(_0x49e667(0x109))/0x4*(-parseInt(_0x49e667(0x122))/0x5)+-parseInt(_0x49e667(0x115))/0x6+-parseInt(_0x49e667(0x11b))/0x7*(-parseInt(_0x49e667(0x124))/0x8)+-parseInt(_0x49e667(0xf3))/0x9;if(_0x565868===_0x1fa796)break;else _0x18d781['push'](_0x18d781['shift']());}catch(_0x570cc0){_0x18d781['push'](_0x18d781['shift']());}}}(a36_0x3e13,0x384fd));function a36_0x3e13(){const _0x3a8b45=['resolvePathToResource','Segment\x20name:\x20','noCountPopulation','1759902zvrKAj','invisible','Target\x20path:\x20','987213iNAnKE','Site:\x20','createSegment','3374IqjReO','Resolved\x20relative\x20path\x20to:\x20','site','segments','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27','⚠\x20Deprecation\x20warning:\x20`segment\x20create`\x20is\x20deprecated.','116588NfSWYy','5JmbYOw','data','3568xNCweZ','segment','Examples:','folderId','Create\x20child\x20segment\x20with\x20filtering\x20rules','βœ”\x20Created\x20segment\x20\x27','771516SBcivE','\x20\x20\x20Path:\x20','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27','Resolving\x20parent\x20segment\x20\x27','name','\x27...','description','yellow','Resolving\x20folder\x20path\x20\x27','length','Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]','Resolving\x20folder\x20\x27','parent','Creating\x20segment\x20\x27','\x27\x20with\x20ID:\x20','kind','verbose','type','Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.','Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]','error','folder','1280412MwcAcT','segment:create','Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','Parent\x20path:\x20','segmentPath','Resolved\x20folder\x20ID:\x20','execute','538332icNWYI'];a36_0x3e13=function(){return _0x3a8b45;};return a36_0x3e13();}import{BaseCommand}from'./command.js';function a36_0x4ae9(_0x5233fd,_0x22b172){_0x5233fd=_0x5233fd-0xee;const _0x3e13fc=a36_0x3e13();let _0x4ae9b0=_0x3e13fc[_0x5233fd];return _0x4ae9b0;}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_0xa3fe56 from'chalk';export class SegmentCreateCommand extends BaseCommand{[a36_0x456f9c(0xf7)]=a36_0x456f9c(0x10a);['description']=a36_0x456f9c(0xf1);async[a36_0x456f9c(0x110)](_0x508b0a){const _0x2ccdf5=a36_0x456f9c;console['error'](a36_0xa3fe56[_0x2ccdf5(0xfa)](_0x2ccdf5(0x120))),console[_0x2ccdf5(0x107)](a36_0xa3fe56[_0x2ccdf5(0xfa)](_0x2ccdf5(0x10c)));const {options:_0x2a4c06,args:_0x475952,tdx:_0xeea564}=_0x508b0a,_0x346140=_0x2a4c06;if(_0x475952['length']===0x0)return console[_0x2ccdf5(0x107)]('Error:\x20Segment\x20path\x20or\x20name\x20is\x20required'),console['error'](_0x2ccdf5(0xfd)),console['error'](_0x2ccdf5(0xef)),console[_0x2ccdf5(0x107)](_0x2ccdf5(0xf5)),console[_0x2ccdf5(0x107)](_0x2ccdf5(0x11f)),console[_0x2ccdf5(0x107)]('\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context'),0x1;const _0x1e8242=_0x475952[0x0],_0x427365=_0x2a4c06[_0x2ccdf5(0x10e)];let _0x49dbf8=_0x1e8242;_0x427365&&!_0x1e8242['includes']('/')&&(_0x49dbf8=_0x427365+'/'+_0x1e8242,_0x346140['verbose']&&console[_0x2ccdf5(0x107)](_0x2ccdf5(0x11c)+_0x49dbf8));const _0x50b311=parsePath(_0x49dbf8);if(_0x50b311[_0x2ccdf5(0x11e)]['length']<0x2)return console[_0x2ccdf5(0x107)](_0x2ccdf5(0x10b)),console[_0x2ccdf5(0x107)](_0x2ccdf5(0x106)),0x1;const _0x44abd2=_0x50b311[_0x2ccdf5(0x11e)][0x0],_0x38a2e0=getBaseName(_0x49dbf8),_0x595612=getParentPath(_0x49dbf8);_0x346140['verbose']&&(console[_0x2ccdf5(0x107)](_0x2ccdf5(0x119)+_0x346140[_0x2ccdf5(0x11d)]),console[_0x2ccdf5(0x107)](_0x2ccdf5(0x117)+_0x49dbf8),console[_0x2ccdf5(0x107)]('Parent:\x20'+_0x44abd2),console['error'](_0x2ccdf5(0x113)+_0x38a2e0),console[_0x2ccdf5(0x107)](_0x2ccdf5(0x10d)+_0x595612));const _0x28c31d=await withSpinner(_0x2ccdf5(0xf6)+_0x44abd2+_0x2ccdf5(0xf8),()=>_0xeea564[_0x2ccdf5(0xee)]['resolveParentId'](_0x44abd2),{'verbose':_0x346140['verbose']}),_0x3680fe=_0x28c31d[_0x2ccdf5(0x123)];let _0x235f3b;if(_0x50b311[_0x2ccdf5(0x11e)][_0x2ccdf5(0xfc)]>0x2){const _0x3cead1=await withSpinner(_0x2ccdf5(0xfb)+_0x595612+_0x2ccdf5(0xf8),()=>_0xeea564[_0x2ccdf5(0xee)][_0x2ccdf5(0x112)](_0x595612),{'verbose':_0x346140[_0x2ccdf5(0x103)]}),_0x5c254d=_0x3cead1[_0x2ccdf5(0x123)];if(_0x5c254d[_0x2ccdf5(0x104)]!==_0x2ccdf5(0x108)&&_0x5c254d['type']!==_0x2ccdf5(0xff))return console[_0x2ccdf5(0x107)](_0x2ccdf5(0x105)),0x1;_0x235f3b=_0x5c254d[_0x2ccdf5(0xf0)];}else{if(_0x346140['folder']){const _0x49d264=await withSpinner(_0x2ccdf5(0xfe)+_0x346140['folder']+_0x2ccdf5(0xf8),()=>_0xeea564[_0x2ccdf5(0xee)]['resolveFolderId'](_0x3680fe,_0x346140['folder']),{'verbose':_0x346140['verbose']});_0x235f3b=_0x49d264[_0x2ccdf5(0x123)];}}_0x346140[_0x2ccdf5(0x103)]&&_0x235f3b&&console[_0x2ccdf5(0x107)](_0x2ccdf5(0x10f)+_0x235f3b);const _0x26765f=await loadJSONFromOptions(_0x346140['rule'],_0x346140['ruleFile']),_0x5b0b37={'name':_0x38a2e0,'description':_0x346140[_0x2ccdf5(0xf9)],'rule':_0x26765f,'kind':_0x346140[_0x2ccdf5(0x102)]!==undefined?parseInt(_0x346140[_0x2ccdf5(0x102)],0xa):undefined,'isVisible':_0x346140[_0x2ccdf5(0x116)]?![]:undefined,'segmentFolderId':_0x235f3b,'countPopulation':_0x346140[_0x2ccdf5(0x114)]?![]:undefined},_0x5d83ce=await withSpinner(_0x2ccdf5(0x100)+_0x38a2e0+_0x2ccdf5(0xf8),()=>_0xeea564[_0x2ccdf5(0xee)][_0x2ccdf5(0x11a)](_0x3680fe,_0x5b0b37),{'verbose':_0x346140['verbose']}),_0x41995d=_0x5d83ce[_0x2ccdf5(0x123)];return console['error'](_0x2ccdf5(0xf2)+_0x41995d['name']+_0x2ccdf5(0x101)+_0x41995d['id']),_0x49dbf8!==_0x1e8242&&console[_0x2ccdf5(0x107)](_0x2ccdf5(0xf4)+_0x49dbf8),await handleSDKOutput([_0x41995d],_0x346140),0x0;}}
1
+ const a36_0x47e695=a36_0x8dc4;(function(_0x394117,_0x50a741){const _0x3c77f7=a36_0x8dc4,_0x540650=_0x394117();while(!![]){try{const _0x32bd2f=parseInt(_0x3c77f7(0xd1))/0x1*(parseInt(_0x3c77f7(0xc2))/0x2)+parseInt(_0x3c77f7(0xdb))/0x3+-parseInt(_0x3c77f7(0xba))/0x4*(-parseInt(_0x3c77f7(0xb4))/0x5)+parseInt(_0x3c77f7(0xe2))/0x6*(-parseInt(_0x3c77f7(0xca))/0x7)+-parseInt(_0x3c77f7(0xd0))/0x8*(-parseInt(_0x3c77f7(0xdc))/0x9)+parseInt(_0x3c77f7(0xd7))/0xa*(-parseInt(_0x3c77f7(0xb6))/0xb)+-parseInt(_0x3c77f7(0xd2))/0xc;if(_0x32bd2f===_0x50a741)break;else _0x540650['push'](_0x540650['shift']());}catch(_0x2ff964){_0x540650['push'](_0x540650['shift']());}}}(a36_0x37ac,0x357ec));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';function a36_0x8dc4(_0x43edbf,_0x470989){_0x43edbf=_0x43edbf-0xaf;const _0x37acc6=a36_0x37ac();let _0x8dc4f9=_0x37acc6[_0x43edbf];return _0x8dc4f9;}import{loadJSONFromOptions}from'../utils/json-loader.js';import{parsePath,getParentPath,getBaseName}from'../sdk/segment/segment-path-parser.js';function a36_0x37ac(){const _0xa7cd67=['Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)','kind','error','\x27\x20with\x20ID:\x20','3400864JjmIMz','499rYQwqg','557076fUmEpy','\x20\x20\x20Path:\x20','Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]','βœ”\x20Created\x20segment\x20\x27','Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]','160260yxatsz','\x27...','yellow','Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.','82425UBWsHJ','9xrEAsK','Resolved\x20relative\x20path\x20to:\x20','name','parent','includes','noCountPopulation','114cFdxIe','Parent\x20path:\x20','Segment\x20name:\x20','resolveFolderId','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27','segment:create','segment','Target\x20path:\x20','Parent:\x20','execute','1101115uBUqJB','createSegment','198ZnxUvV','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','Site:\x20','Resolved\x20folder\x20ID:\x20','4TwTueh','Create\x20child\x20segment\x20with\x20filtering\x20rules','Creating\x20segment\x20\x27','description','\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','Resolving\x20parent\x20segment\x20\x27','data','Resolving\x20folder\x20path\x20\x27','634rebHIV','segments','resolvePathToResource','verbose','type','length','⚠\x20Deprecation\x20warning:\x20`segment\x20create`\x20is\x20deprecated.','invisible','102046UJqRYn','folder'];a36_0x37ac=function(){return _0xa7cd67;};return a36_0x37ac();}import a36_0x5c63e8 from'chalk';export class SegmentCreateCommand extends BaseCommand{[a36_0x47e695(0xde)]=a36_0x47e695(0xaf);[a36_0x47e695(0xbd)]=a36_0x47e695(0xbb);async[a36_0x47e695(0xb3)](_0x368057){const _0x25c290=a36_0x47e695;console['error'](a36_0x5c63e8[_0x25c290(0xd9)](_0x25c290(0xc8))),console[_0x25c290(0xce)](a36_0x5c63e8[_0x25c290(0xd9)](_0x25c290(0xb7)));const {options:_0x13e41f,args:_0x3156a2,tdx:_0x5ab7e0}=_0x368057,_0x1dcf77=_0x13e41f;if(_0x3156a2[_0x25c290(0xc7)]===0x0)return console[_0x25c290(0xce)]('Error:\x20Segment\x20path\x20or\x20name\x20is\x20required'),console['error'](_0x25c290(0xd4)),console[_0x25c290(0xce)]('Examples:'),console[_0x25c290(0xce)]('\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27'),console[_0x25c290(0xce)](_0x25c290(0xe6)),console[_0x25c290(0xce)](_0x25c290(0xbe)),0x1;const _0x112f55=_0x3156a2[0x0],_0x73fca4=_0x13e41f['segmentPath'];let _0x560d7e=_0x112f55;_0x73fca4&&!_0x112f55[_0x25c290(0xe0)]('/')&&(_0x560d7e=_0x73fca4+'/'+_0x112f55,_0x1dcf77[_0x25c290(0xc5)]&&console[_0x25c290(0xce)](_0x25c290(0xdd)+_0x560d7e));const _0x4c1e0a=parsePath(_0x560d7e);if(_0x4c1e0a[_0x25c290(0xc3)][_0x25c290(0xc7)]<0x2)return console[_0x25c290(0xce)](_0x25c290(0xcc)),console[_0x25c290(0xce)](_0x25c290(0xd6)),0x1;const _0x2b060a=_0x4c1e0a['segments'][0x0],_0x5d173b=getBaseName(_0x560d7e),_0x1a2d64=getParentPath(_0x560d7e);_0x1dcf77['verbose']&&(console[_0x25c290(0xce)](_0x25c290(0xb8)+_0x1dcf77['site']),console[_0x25c290(0xce)](_0x25c290(0xb1)+_0x560d7e),console['error'](_0x25c290(0xb2)+_0x2b060a),console['error'](_0x25c290(0xe4)+_0x5d173b),console[_0x25c290(0xce)](_0x25c290(0xe3)+_0x1a2d64));const _0x52432e=await withSpinner(_0x25c290(0xbf)+_0x2b060a+'\x27...',()=>_0x5ab7e0[_0x25c290(0xb0)]['resolveParentId'](_0x2b060a),{'verbose':_0x1dcf77[_0x25c290(0xc5)]}),_0x5f1968=_0x52432e[_0x25c290(0xc0)];let _0x222336;if(_0x4c1e0a[_0x25c290(0xc3)][_0x25c290(0xc7)]>0x2){const _0x442f49=await withSpinner(_0x25c290(0xc1)+_0x1a2d64+_0x25c290(0xd8),()=>_0x5ab7e0[_0x25c290(0xb0)][_0x25c290(0xc4)](_0x1a2d64),{'verbose':_0x1dcf77[_0x25c290(0xc5)]}),_0x655c55=_0x442f49[_0x25c290(0xc0)];if(_0x655c55[_0x25c290(0xc6)]!==_0x25c290(0xcb)&&_0x655c55['type']!==_0x25c290(0xdf))return console['error'](_0x25c290(0xda)),0x1;_0x222336=_0x655c55['folderId'];}else{if(_0x1dcf77[_0x25c290(0xcb)]){const _0x335162=await withSpinner('Resolving\x20folder\x20\x27'+_0x1dcf77['folder']+_0x25c290(0xd8),()=>_0x5ab7e0[_0x25c290(0xb0)][_0x25c290(0xe5)](_0x5f1968,_0x1dcf77[_0x25c290(0xcb)]),{'verbose':_0x1dcf77[_0x25c290(0xc5)]});_0x222336=_0x335162[_0x25c290(0xc0)];}}_0x1dcf77[_0x25c290(0xc5)]&&_0x222336&&console['error'](_0x25c290(0xb9)+_0x222336);const _0x182e8d=await loadJSONFromOptions(_0x1dcf77['rule'],_0x1dcf77['ruleFile']),_0x28cb3c={'name':_0x5d173b,'description':_0x1dcf77['description'],'rule':_0x182e8d,'kind':_0x1dcf77[_0x25c290(0xcd)]!==undefined?parseInt(_0x1dcf77[_0x25c290(0xcd)],0xa):undefined,'isVisible':_0x1dcf77[_0x25c290(0xc9)]?![]:undefined,'segmentFolderId':_0x222336,'countPopulation':_0x1dcf77[_0x25c290(0xe1)]?![]:undefined},_0x347eb4=await withSpinner(_0x25c290(0xbc)+_0x5d173b+_0x25c290(0xd8),()=>_0x5ab7e0[_0x25c290(0xb0)][_0x25c290(0xb5)](_0x5f1968,_0x28cb3c),{'verbose':_0x1dcf77[_0x25c290(0xc5)]}),_0x2c71a4=_0x347eb4[_0x25c290(0xc0)];return console[_0x25c290(0xce)](_0x25c290(0xd5)+_0x2c71a4[_0x25c290(0xde)]+_0x25c290(0xcf)+_0x2c71a4['id']),_0x560d7e!==_0x112f55&&console[_0x25c290(0xce)](_0x25c290(0xd3)+_0x560d7e),await handleSDKOutput([_0x2c71a4],_0x1dcf77),0x0;}}
@@ -1 +1 @@
1
- function a37_0x49a4(_0x416b0c,_0x467c1e){_0x416b0c=_0x416b0c-0xed;const _0x5849f9=a37_0x5849();let _0x49a478=_0x5849f9[_0x416b0c];return _0x49a478;}const a37_0x5c016e=a37_0x49a4;(function(_0xdeb3b7,_0xd8bfc5){const _0x15c3a1=a37_0x49a4,_0x59a6d7=_0xdeb3b7();while(!![]){try{const _0x209ac3=-parseInt(_0x15c3a1(0xf8))/0x1+-parseInt(_0x15c3a1(0xf4))/0x2*(-parseInt(_0x15c3a1(0xfa))/0x3)+parseInt(_0x15c3a1(0x105))/0x4+-parseInt(_0x15c3a1(0xf1))/0x5*(-parseInt(_0x15c3a1(0x101))/0x6)+-parseInt(_0x15c3a1(0xf9))/0x7*(-parseInt(_0x15c3a1(0xfd))/0x8)+parseInt(_0x15c3a1(0x106))/0x9*(parseInt(_0x15c3a1(0xfe))/0xa)+-parseInt(_0x15c3a1(0xfb))/0xb;if(_0x209ac3===_0xd8bfc5)break;else _0x59a6d7['push'](_0x59a6d7['shift']());}catch(_0x44cc59){_0x59a6d7['push'](_0x59a6d7['shift']());}}}(a37_0x5849,0x2f6f3));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{displayFieldsHumanReadable}from'../sdk/segment/fields-display.js';function a37_0x5849(){const _0x1e802f=['851917vEGqBR','name','7528lmyGHJ','257320ugIfhQ','data','segment:fields','366HOUfxr','\x20field','error','segment','168592aUYilm','27JwTHoP','execute','length','description','json','\x27...','13495gyktXu','jsonl','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','4bLvFSa','Listing\x20fields\x20for\x20\x27','βœ”\x20Found\x20','parentSegment','184474NYYrDw','1281zJKRoc','39IxUCTb'];a37_0x5849=function(){return _0x1e802f;};return a37_0x5849();}export class SegmentFieldsCommand extends BaseCommand{[a37_0x5c016e(0xfc)]=a37_0x5c016e(0x100);[a37_0x5c016e(0xee)]='List\x20available\x20fields\x20for\x20segmentation';async[a37_0x5c016e(0x107)](_0x2e8e81){const _0x54c66d=a37_0x5c016e,{options:_0x43b580,args:_0x3cc4d1,tdx:_0xbd0ac9}=_0x2e8e81,_0x102a3a=_0x3cc4d1[0x0]||_0x43b580[_0x54c66d(0xf7)];if(!_0x102a3a)return console[_0x54c66d(0x103)]('Error:\x20Parent\x20segment\x20name\x20is\x20required'),console[_0x54c66d(0x103)]('Usage:\x20tdx\x20segment\x20fields\x20<parent_name>'),console['error'](_0x54c66d(0xf3)),0x1;_0x43b580['verbose']&&(console[_0x54c66d(0x103)]('Site:\x20'+_0x43b580['site']),console[_0x54c66d(0x103)]('Parent\x20segment:\x20'+_0x102a3a));const _0x4630c7=await withSpinner(_0x54c66d(0xf5)+_0x102a3a+_0x54c66d(0xf0),()=>_0xbd0ac9[_0x54c66d(0x104)]['listFields'](_0x102a3a),{'verbose':_0x43b580['verbose']}),_0x4cfd31=_0x4630c7[_0x54c66d(0xff)];console['error'](_0x54c66d(0xf6)+_0x4cfd31[_0x54c66d(0xed)]+_0x54c66d(0x102)+(_0x4cfd31[_0x54c66d(0xed)]!==0x1?'s':''));if(_0x43b580[_0x54c66d(0xef)]||_0x43b580[_0x54c66d(0xf2)])return await handleSDKOutput(_0x4cfd31,_0x43b580),0x0;return displayFieldsHumanReadable(_0x4cfd31,_0x102a3a),0x0;}}
1
+ const a37_0x1ba1af=a37_0x2d24;(function(_0x2fe751,_0x208634){const _0x23b90a=a37_0x2d24,_0x290f8e=_0x2fe751();while(!![]){try{const _0x294417=parseInt(_0x23b90a(0xce))/0x1+-parseInt(_0x23b90a(0xd4))/0x2*(-parseInt(_0x23b90a(0xc2))/0x3)+-parseInt(_0x23b90a(0xc5))/0x4+parseInt(_0x23b90a(0xc6))/0x5*(-parseInt(_0x23b90a(0xc4))/0x6)+-parseInt(_0x23b90a(0xd0))/0x7*(parseInt(_0x23b90a(0xcb))/0x8)+-parseInt(_0x23b90a(0xcd))/0x9+parseInt(_0x23b90a(0xda))/0xa;if(_0x294417===_0x208634)break;else _0x290f8e['push'](_0x290f8e['shift']());}catch(_0xc29574){_0x290f8e['push'](_0x290f8e['shift']());}}}(a37_0x3e43,0x869d3));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';function a37_0x3e43(){const _0x190cd8=['Usage:\x20tdx\x20segment\x20fields\x20<parent_name>','data','segment','22425950JRGslL','Listing\x20fields\x20for\x20\x27','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','listFields','βœ”\x20Found\x20','List\x20available\x20fields\x20for\x20segmentation','Error:\x20Parent\x20segment\x20name\x20is\x20required','1521FFMLkV','description','28182suWyRC','598476snTMeV','250NwGbIa','Site:\x20','json','name','length','7830280NqMdkV','verbose','9660015yQybuK','680984hwLCGv','\x20field','7vNLyma','Parent\x20segment:\x20','site','execute','254IFeFBn','error','\x27...'];a37_0x3e43=function(){return _0x190cd8;};return a37_0x3e43();}import{displayFieldsHumanReadable}from'../sdk/segment/fields-display.js';function a37_0x2d24(_0x18ed4d,_0x222f56){_0x18ed4d=_0x18ed4d-0xc0;const _0x3e43f9=a37_0x3e43();let _0x2d2460=_0x3e43f9[_0x18ed4d];return _0x2d2460;}export class SegmentFieldsCommand extends BaseCommand{[a37_0x1ba1af(0xc9)]='segment:fields';[a37_0x1ba1af(0xc3)]=a37_0x1ba1af(0xc0);async[a37_0x1ba1af(0xd3)](_0x401f26){const _0x1e170c=a37_0x1ba1af,{options:_0x53bc40,args:_0x286f83,tdx:_0x1bdbd2}=_0x401f26,_0x388c4d=_0x286f83[0x0]||_0x53bc40['parentSegment'];if(!_0x388c4d)return console[_0x1e170c(0xd5)](_0x1e170c(0xc1)),console[_0x1e170c(0xd5)](_0x1e170c(0xd7)),console[_0x1e170c(0xd5)](_0x1e170c(0xdc)),0x1;_0x53bc40[_0x1e170c(0xcc)]&&(console['error'](_0x1e170c(0xc7)+_0x53bc40[_0x1e170c(0xd2)]),console[_0x1e170c(0xd5)](_0x1e170c(0xd1)+_0x388c4d));const _0x341e44=await withSpinner(_0x1e170c(0xdb)+_0x388c4d+_0x1e170c(0xd6),()=>_0x1bdbd2[_0x1e170c(0xd9)][_0x1e170c(0xdd)](_0x388c4d),{'verbose':_0x53bc40[_0x1e170c(0xcc)]}),_0x2b02c5=_0x341e44[_0x1e170c(0xd8)];console[_0x1e170c(0xd5)](_0x1e170c(0xde)+_0x2b02c5[_0x1e170c(0xca)]+_0x1e170c(0xcf)+(_0x2b02c5[_0x1e170c(0xca)]!==0x1?'s':''));if(_0x53bc40[_0x1e170c(0xc8)]||_0x53bc40['jsonl'])return await handleSDKOutput(_0x2b02c5,_0x53bc40),0x0;return displayFieldsHumanReadable(_0x2b02c5,_0x388c4d),0x0;}}
@@ -1 +1 @@
1
- const a38_0x140efe=a38_0x4df9;(function(_0x363669,_0x262d1c){const _0x55a187=a38_0x4df9,_0x387fb7=_0x363669();while(!![]){try{const _0x9c8c0f=-parseInt(_0x55a187(0x145))/0x1+parseInt(_0x55a187(0x150))/0x2+-parseInt(_0x55a187(0x11a))/0x3*(parseInt(_0x55a187(0x158))/0x4)+parseInt(_0x55a187(0x12f))/0x5*(-parseInt(_0x55a187(0x137))/0x6)+-parseInt(_0x55a187(0x144))/0x7*(parseInt(_0x55a187(0x14d))/0x8)+-parseInt(_0x55a187(0x122))/0x9*(parseInt(_0x55a187(0x111))/0xa)+parseInt(_0x55a187(0x12c))/0xb;if(_0x9c8c0f===_0x262d1c)break;else _0x387fb7['push'](_0x387fb7['shift']());}catch(_0x1426e7){_0x387fb7['push'](_0x387fb7['shift']());}}}(a38_0x1484,0x86888));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_0x5d623c from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';function a38_0x1484(){const _0x5358c0=['journeys','\x20new\x20files','green','absolutePath','repeat','relativePath','\x20activations','Target\x20resource:\x20','targetDir','3399648HwvDoK','87462QdRmIt','\x0aError:','setPhase','\x20\x20🎯\x20','hasChanges','\x0aChanges\x20to\x20\x27','\x0aPull\x20summary\x20for\x20\x27','name','8vyFDwK','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)','parentName','138362fiopSW','activations','Error:\x20','utf-8','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','pullSegments','segments','Site:\x20','25876VqhnxC','message','parent_segment','execute','\x20segments','Parent\x20segment:\x20','isNew','Aborted.','dryRun','error','5051980BuPWuq','\x20changed\x20files','length','site','\x20=\x20','\x20journeys','yes','filter','Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files','393ABbLej','red','diff','\x20files?','dim','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','yellow','\x20with\x20','18ovBuJu','dirname','type','counts','\x20unchanged\x20files','Pulling\x20segments\x20from\x20\x27','resourceName','errorCode','verbose','cwd','33854370bpvbbN','\x20\x20Target:\x20','cyan','412105TgBNst','session','βœ”\x20Context\x20set:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent','βœ”\x20Pulled\x20','files','segment','file','12CBoqWi','helpText','journeyVersions','data'];a38_0x1484=function(){return _0x5358c0;};return a38_0x1484();}import a38_0x53d5ce from'path';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';function a38_0x4df9(_0x5c38b5,_0x3dc6a9){_0x5c38b5=_0x5c38b5-0x10f;const _0x14843c=a38_0x1484();let _0x4df9da=_0x14843c[_0x5c38b5];return _0x4df9da;}export{buildFolderIdToPathMap as buildFolderPathMap}from'../sdk/segment/resolution-context.js';export class SegmentPullCommand extends BaseCommand{[a38_0x140efe(0x14c)]='segment:pull';['description']=a38_0x140efe(0x119);async[a38_0x140efe(0x15b)](_0x2d9c0e){const _0xc04fcc=a38_0x140efe,{options:_0x6ad6e,args:_0x178c6f,tdx:_0x39ed0c}=_0x2d9c0e,_0x54680d=_0x6ad6e,_0x338504=await resolveTarget({'arg':_0x178c6f[0x0],'contextParent':_0x6ad6e['parentSegment'],'cwd':process[_0xc04fcc(0x12b)]()});if(!isSuccessfulResolution(_0x338504))return _0x338504[_0xc04fcc(0x129)]==='no_parent'?(console[_0xc04fcc(0x110)](a38_0x5d623c[_0xc04fcc(0x120)](_0xc04fcc(0x11f))),console[_0xc04fcc(0x110)](_0xc04fcc(0x14e)),console[_0xc04fcc(0x110)](_0xc04fcc(0x132)),console[_0xc04fcc(0x110)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file')):(console[_0xc04fcc(0x110)](a38_0x5d623c[_0xc04fcc(0x11b)](_0xc04fcc(0x152)+_0x338504[_0xc04fcc(0x159)]+'\x0a')),_0x338504[_0xc04fcc(0x138)]&&console[_0xc04fcc(0x110)](a38_0x5d623c[_0xc04fcc(0x12e)](_0x338504[_0xc04fcc(0x138)]))),0x1;const _0x2858c1=_0x338504[_0xc04fcc(0x14f)],_0xbc1820=_0x338504[_0xc04fcc(0x143)],_0xa0de24=_0x338504[_0xc04fcc(0x124)]===_0xc04fcc(0x136)?_0x338504[_0xc04fcc(0x128)]:undefined;_0x54680d[_0xc04fcc(0x12a)]&&(console['error'](_0xc04fcc(0x157)+_0x54680d[_0xc04fcc(0x114)]),console[_0xc04fcc(0x110)](_0xc04fcc(0x15d)+_0x2858c1),_0xa0de24&&console[_0xc04fcc(0x110)](_0xc04fcc(0x142)+_0xa0de24));const _0x4d37e1=await withProgressSpinner(_0xc04fcc(0x127)+_0x2858c1+'\x27...',_0x54b26a=>_0x39ed0c[_0xc04fcc(0x135)][_0xc04fcc(0x155)](_0x2858c1,{'targetDir':_0xbc1820,'targetResourceName':_0xa0de24,'verbose':_0x54680d[_0xc04fcc(0x12a)],'progress':{'update':_0x5d9e67=>{const _0x13a85b=_0xc04fcc;_0x54b26a[_0x13a85b(0x147)](_0x5d9e67),_0x54680d[_0x13a85b(0x12a)]&&console[_0x13a85b(0x110)]('\x20\x20'+_0x5d9e67);}}}),{'verbose':_0x54680d['verbose']}),_0x3923de=_0x4d37e1[_0xc04fcc(0x13a)];if(_0x3923de[_0xc04fcc(0x125)][_0xc04fcc(0x156)]===0x0&&_0x3923de[_0xc04fcc(0x125)]['journeys']===0x0)return console['error'](a38_0x5d623c['yellow']('No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27'+_0x3923de[_0xc04fcc(0x14f)]+'\x27')),0x0;const _0x48e9f1=_0x3923de[_0xc04fcc(0x134)][_0xc04fcc(0x118)](_0x2913e4=>_0x2913e4['isNew']),_0x52d1f7=_0x3923de[_0xc04fcc(0x134)]['filter'](_0x4fd4f1=>!_0x4fd4f1[_0xc04fcc(0x15e)]&&_0x4fd4f1[_0xc04fcc(0x149)]),_0x18d9ed=_0x3923de['files'][_0xc04fcc(0x118)](_0x7023aa=>!_0x7023aa[_0xc04fcc(0x15e)]&&!_0x7023aa[_0xc04fcc(0x149)]);console[_0xc04fcc(0x110)](_0xc04fcc(0x14b)+_0x3923de['parentName']+'\x27:'),console[_0xc04fcc(0x110)](_0xc04fcc(0x148)+a38_0x5d623c[_0xc04fcc(0x12e)](_0x3923de['counts'][_0xc04fcc(0x156)]+_0xc04fcc(0x15c))+_0xc04fcc(0x121)+a38_0x5d623c[_0xc04fcc(0x12e)](_0x3923de[_0xc04fcc(0x125)][_0xc04fcc(0x151)]+_0xc04fcc(0x141)));if(_0x3923de[_0xc04fcc(0x125)][_0xc04fcc(0x13b)]>0x0){const _0x37a9d2=_0x3923de['counts'][_0xc04fcc(0x139)]>_0x3923de['counts'][_0xc04fcc(0x13b)]?'\x20('+_0x3923de[_0xc04fcc(0x125)][_0xc04fcc(0x139)]+'\x20versions)':'';console[_0xc04fcc(0x110)]('\x20\x20πŸ—ΊοΈ\x20\x20'+a38_0x5d623c[_0xc04fcc(0x12e)](_0x3923de[_0xc04fcc(0x125)][_0xc04fcc(0x13b)]+_0xc04fcc(0x116))+a38_0x5d623c['dim'](_0x37a9d2));}console['error']('\x20\x20'+a38_0x5d623c['green']('+\x20'+_0x48e9f1['length']+_0xc04fcc(0x13c))),console[_0xc04fcc(0x110)]('\x20\x20'+a38_0x5d623c['yellow']('~\x20'+_0x52d1f7[_0xc04fcc(0x113)]+_0xc04fcc(0x112))),console[_0xc04fcc(0x110)]('\x20\x20'+a38_0x5d623c[_0xc04fcc(0x11e)]('=\x20'+_0x18d9ed[_0xc04fcc(0x113)]+_0xc04fcc(0x126))),console[_0xc04fcc(0x110)](_0xc04fcc(0x12d)+a38_0x5d623c[_0xc04fcc(0x12e)](_0x3923de['targetDir'])+'\x0a');if(_0x52d1f7[_0xc04fcc(0x113)]>0x0)for(const _0x4d0727 of _0x52d1f7){console[_0xc04fcc(0x110)](_0xc04fcc(0x14a)+_0x4d0727[_0xc04fcc(0x140)]+'\x27:'),console[_0xc04fcc(0x110)]('─'[_0xc04fcc(0x13f)](0x3c)),console[_0xc04fcc(0x110)](_0x4d0727[_0xc04fcc(0x11c)]),console[_0xc04fcc(0x110)]('─'[_0xc04fcc(0x13f)](0x3c));}if(_0x54680d[_0xc04fcc(0x10f)])return console[_0xc04fcc(0x110)](a38_0x5d623c[_0xc04fcc(0x120)]('\x0a[Dry\x20run]\x20No\x20files\x20were\x20written')),0x0;if(_0x48e9f1[_0xc04fcc(0x113)]===0x0&&_0x52d1f7['length']===0x0)return console[_0xc04fcc(0x110)](a38_0x5d623c['green']('βœ”\x20All\x20files\x20are\x20up\x20to\x20date')),saveSessionContext({'parent_segment':_0x3923de[_0xc04fcc(0x14f)]},_0x54680d[_0xc04fcc(0x130)]),console[_0xc04fcc(0x110)](a38_0x5d623c['green'](_0xc04fcc(0x131)+a38_0x5d623c[_0xc04fcc(0x11e)]('parent_segment')+_0xc04fcc(0x115)+a38_0x5d623c[_0xc04fcc(0x12e)](_0x3923de[_0xc04fcc(0x14f)]))),0x0;if(!_0x54680d[_0xc04fcc(0x117)]){if(!isInteractive())return console[_0xc04fcc(0x110)](a38_0x5d623c[_0xc04fcc(0x11b)](_0xc04fcc(0x146)),_0xc04fcc(0x154)),console[_0xc04fcc(0x110)](a38_0x5d623c[_0xc04fcc(0x11e)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x4e1218=await confirmKey('Write\x20'+(_0x48e9f1[_0xc04fcc(0x113)]+_0x52d1f7[_0xc04fcc(0x113)])+_0xc04fcc(0x11d));if(!_0x4e1218)return console[_0xc04fcc(0x110)](a38_0x5d623c[_0xc04fcc(0x120)](_0xc04fcc(0x15f)),'-\x20no\x20files\x20written'),0x1;}for(const _0x48afc0 of _0x3923de[_0xc04fcc(0x134)]){if(_0x48afc0[_0xc04fcc(0x15e)]||_0x48afc0['hasChanges']){const _0x353e5f=a38_0x53d5ce[_0xc04fcc(0x123)](_0x48afc0[_0xc04fcc(0x13e)]);!existsSync(_0x353e5f)&&mkdirSync(_0x353e5f,{'recursive':!![]}),writeFileSync(_0x48afc0['absolutePath'],_0x48afc0['content'],_0xc04fcc(0x153));}}return console[_0xc04fcc(0x110)](a38_0x5d623c['green'](_0xc04fcc(0x133)+(_0x48e9f1[_0xc04fcc(0x113)]+_0x52d1f7[_0xc04fcc(0x113)])+'\x20files\x20to\x20'+_0x3923de['targetDir'])),saveSessionContext({'parent_segment':_0x3923de[_0xc04fcc(0x14f)]},_0x54680d[_0xc04fcc(0x130)]),console[_0xc04fcc(0x110)](a38_0x5d623c[_0xc04fcc(0x13d)](_0xc04fcc(0x131)+a38_0x5d623c['dim'](_0xc04fcc(0x15a))+'\x20=\x20'+a38_0x5d623c[_0xc04fcc(0x12e)](_0x3923de[_0xc04fcc(0x14f)]))),0x0;}}
1
+ const a38_0x4b4fc9=a38_0x42b6;(function(_0x5baa52,_0x1101d7){const _0x40a7f6=a38_0x42b6,_0x373a0f=_0x5baa52();while(!![]){try{const _0x18c063=-parseInt(_0x40a7f6(0x130))/0x1*(-parseInt(_0x40a7f6(0xfc))/0x2)+-parseInt(_0x40a7f6(0x12b))/0x3*(-parseInt(_0x40a7f6(0x112))/0x4)+parseInt(_0x40a7f6(0xf9))/0x5*(-parseInt(_0x40a7f6(0xfb))/0x6)+parseInt(_0x40a7f6(0xf5))/0x7+parseInt(_0x40a7f6(0xe5))/0x8*(-parseInt(_0x40a7f6(0x103))/0x9)+-parseInt(_0x40a7f6(0x107))/0xa*(parseInt(_0x40a7f6(0xdf))/0xb)+parseInt(_0x40a7f6(0xf0))/0xc;if(_0x18c063===_0x1101d7)break;else _0x373a0f['push'](_0x373a0f['shift']());}catch(_0x231def){_0x373a0f['push'](_0x373a0f['shift']());}}}(a38_0x55c3,0x90c7d));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';function a38_0x55c3(){const _0x519e1d=['3107864aoGSSM','parentSegment','βœ”\x20Pulled\x20','No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27','dryRun','yellow','counts','session','βœ”\x20All\x20files\x20are\x20up\x20to\x20date','filter','helpText','7962048YOubjS','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)','error','\x20with\x20','Error:\x20','6143921FTWXri','site','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','\x20=\x20','10grAvbD','βœ”\x20Context\x20set:\x20','2189622CkuYFj','78zeAAni','length','type','parentName','content','\x20changed\x20files','description','9yhhEWV','-\x20no\x20files\x20written','\x20versions)','dim','1650QZVPMr','cwd','\x20\x20Target:\x20','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','segments','utf-8','Write\x20','yes','Aborted.','\x0aChanges\x20to\x20\x27','diff','104552gzEUhZ','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file','\x0aPull\x20summary\x20for\x20\x27','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','segment:pull','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent','parent_segment','message','files','\x20journeys','repeat','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','journeys','Site:\x20','\x0aError:','green','cyan','Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files','hasChanges','file','data','\x27...','targetDir','\x20files\x20to\x20','\x20\x20🎯\x20','75TnigjM','\x20files?','red','Parent\x20segment:\x20','resourceName','8834JtNYrx','verbose','no_parent','pullSegments','segment','dirname','55187WARfLS','Target\x20resource:\x20','isNew','relativePath','setPhase','\x20unchanged\x20files'];a38_0x55c3=function(){return _0x519e1d;};return a38_0x55c3();}import{confirmKey,isInteractive}from'../utils/prompt.js';import{saveSessionContext}from'../core/session.js';function a38_0x42b6(_0x1a1e1b,_0x4538d6){_0x1a1e1b=_0x1a1e1b-0xda;const _0x55c33c=a38_0x55c3();let _0x42b682=_0x55c33c[_0x1a1e1b];return _0x42b682;}import a38_0x507e98 from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';import a38_0x1baa51 from'path';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';export{buildFolderIdToPathMap as buildFolderPathMap}from'../sdk/segment/resolution-context.js';export class SegmentPullCommand extends BaseCommand{['name']=a38_0x4b4fc9(0x116);[a38_0x4b4fc9(0x102)]=a38_0x4b4fc9(0x123);async['execute'](_0x22b494){const _0x4d7365=a38_0x4b4fc9,{options:_0x47b111,args:_0x40c1bc,tdx:_0x287d63}=_0x22b494,_0x5ba569=_0x47b111,_0x1156d6=await resolveTarget({'arg':_0x40c1bc[0x0],'contextParent':_0x47b111[_0x4d7365(0xe6)],'cwd':process[_0x4d7365(0x108)]()});if(!isSuccessfulResolution(_0x1156d6))return _0x1156d6['errorCode']===_0x4d7365(0xdb)?(console[_0x4d7365(0xf2)](a38_0x507e98[_0x4d7365(0xea)](_0x4d7365(0x10a))),console[_0x4d7365(0xf2)](_0x4d7365(0xf1)),console[_0x4d7365(0xf2)](_0x4d7365(0x117)),console[_0x4d7365(0xf2)](_0x4d7365(0x113))):(console[_0x4d7365(0xf2)](a38_0x507e98[_0x4d7365(0x12d)](_0x4d7365(0xf4)+_0x1156d6[_0x4d7365(0x119)]+'\x0a')),_0x1156d6[_0x4d7365(0xef)]&&console[_0x4d7365(0xf2)](a38_0x507e98[_0x4d7365(0x122)](_0x1156d6[_0x4d7365(0xef)]))),0x1;const _0x31d339=_0x1156d6[_0x4d7365(0xff)],_0x3bc4ff=_0x1156d6[_0x4d7365(0x128)],_0x549f32=_0x1156d6[_0x4d7365(0xfe)]===_0x4d7365(0x125)?_0x1156d6[_0x4d7365(0x12f)]:undefined;_0x5ba569['verbose']&&(console[_0x4d7365(0xf2)](_0x4d7365(0x11f)+_0x5ba569[_0x4d7365(0xf6)]),console[_0x4d7365(0xf2)](_0x4d7365(0x12e)+_0x31d339),_0x549f32&&console[_0x4d7365(0xf2)](_0x4d7365(0xe0)+_0x549f32));const _0x494dab=await withProgressSpinner('Pulling\x20segments\x20from\x20\x27'+_0x31d339+_0x4d7365(0x127),_0x15b46c=>_0x287d63[_0x4d7365(0xdd)][_0x4d7365(0xdc)](_0x31d339,{'targetDir':_0x3bc4ff,'targetResourceName':_0x549f32,'verbose':_0x5ba569[_0x4d7365(0xda)],'progress':{'update':_0x1ff1bc=>{const _0x1cf769=_0x4d7365;_0x15b46c[_0x1cf769(0xe3)](_0x1ff1bc),_0x5ba569[_0x1cf769(0xda)]&&console[_0x1cf769(0xf2)]('\x20\x20'+_0x1ff1bc);}}}),{'verbose':_0x5ba569[_0x4d7365(0xda)]}),_0x6384d5=_0x494dab[_0x4d7365(0x126)];if(_0x6384d5[_0x4d7365(0xeb)][_0x4d7365(0x10b)]===0x0&&_0x6384d5['counts'][_0x4d7365(0x11e)]===0x0)return console[_0x4d7365(0xf2)](a38_0x507e98[_0x4d7365(0xea)](_0x4d7365(0xe8)+_0x6384d5['parentName']+'\x27')),0x0;const _0x184d0c=_0x6384d5['files'][_0x4d7365(0xee)](_0x541953=>_0x541953[_0x4d7365(0xe1)]),_0x545de8=_0x6384d5[_0x4d7365(0x11a)][_0x4d7365(0xee)](_0x3e0d2c=>!_0x3e0d2c[_0x4d7365(0xe1)]&&_0x3e0d2c['hasChanges']),_0x3bbf3e=_0x6384d5[_0x4d7365(0x11a)][_0x4d7365(0xee)](_0x321ac3=>!_0x321ac3['isNew']&&!_0x321ac3[_0x4d7365(0x124)]);console[_0x4d7365(0xf2)](_0x4d7365(0x114)+_0x6384d5[_0x4d7365(0xff)]+'\x27:'),console[_0x4d7365(0xf2)](_0x4d7365(0x12a)+a38_0x507e98[_0x4d7365(0x122)](_0x6384d5['counts'][_0x4d7365(0x10b)]+'\x20segments')+_0x4d7365(0xf3)+a38_0x507e98[_0x4d7365(0x122)](_0x6384d5[_0x4d7365(0xeb)]['activations']+'\x20activations'));if(_0x6384d5[_0x4d7365(0xeb)][_0x4d7365(0x11e)]>0x0){const _0x1bb9e7=_0x6384d5['counts']['journeyVersions']>_0x6384d5['counts'][_0x4d7365(0x11e)]?'\x20('+_0x6384d5[_0x4d7365(0xeb)]['journeyVersions']+_0x4d7365(0x105):'';console[_0x4d7365(0xf2)]('\x20\x20πŸ—ΊοΈ\x20\x20'+a38_0x507e98[_0x4d7365(0x122)](_0x6384d5[_0x4d7365(0xeb)][_0x4d7365(0x11e)]+_0x4d7365(0x11b))+a38_0x507e98[_0x4d7365(0x106)](_0x1bb9e7));}console[_0x4d7365(0xf2)]('\x20\x20'+a38_0x507e98[_0x4d7365(0x121)]('+\x20'+_0x184d0c[_0x4d7365(0xfd)]+'\x20new\x20files')),console['error']('\x20\x20'+a38_0x507e98[_0x4d7365(0xea)]('~\x20'+_0x545de8[_0x4d7365(0xfd)]+_0x4d7365(0x101))),console[_0x4d7365(0xf2)]('\x20\x20'+a38_0x507e98['dim']('=\x20'+_0x3bbf3e[_0x4d7365(0xfd)]+_0x4d7365(0xe4))),console[_0x4d7365(0xf2)](_0x4d7365(0x109)+a38_0x507e98[_0x4d7365(0x122)](_0x6384d5['targetDir'])+'\x0a');if(_0x545de8[_0x4d7365(0xfd)]>0x0)for(const _0x5f52ac of _0x545de8){console[_0x4d7365(0xf2)](_0x4d7365(0x110)+_0x5f52ac[_0x4d7365(0xe2)]+'\x27:'),console[_0x4d7365(0xf2)]('─'[_0x4d7365(0x11c)](0x3c)),console[_0x4d7365(0xf2)](_0x5f52ac[_0x4d7365(0x111)]),console[_0x4d7365(0xf2)]('─'[_0x4d7365(0x11c)](0x3c));}if(_0x5ba569[_0x4d7365(0xe9)])return console[_0x4d7365(0xf2)](a38_0x507e98['yellow'](_0x4d7365(0x115))),0x0;if(_0x184d0c[_0x4d7365(0xfd)]===0x0&&_0x545de8[_0x4d7365(0xfd)]===0x0)return console['error'](a38_0x507e98[_0x4d7365(0x121)](_0x4d7365(0xed))),saveSessionContext({'parent_segment':_0x6384d5[_0x4d7365(0xff)]},_0x5ba569['session']),console['error'](a38_0x507e98[_0x4d7365(0x121)]('βœ”\x20Context\x20set:\x20'+a38_0x507e98[_0x4d7365(0x106)](_0x4d7365(0x118))+_0x4d7365(0xf8)+a38_0x507e98[_0x4d7365(0x122)](_0x6384d5[_0x4d7365(0xff)]))),0x0;if(!_0x5ba569[_0x4d7365(0x10e)]){if(!isInteractive())return console[_0x4d7365(0xf2)](a38_0x507e98[_0x4d7365(0x12d)](_0x4d7365(0x120)),_0x4d7365(0x11d)),console[_0x4d7365(0xf2)](a38_0x507e98[_0x4d7365(0x106)](_0x4d7365(0xf7))),0x1;const _0x57ccb5=await confirmKey(_0x4d7365(0x10d)+(_0x184d0c[_0x4d7365(0xfd)]+_0x545de8['length'])+_0x4d7365(0x12c));if(!_0x57ccb5)return console[_0x4d7365(0xf2)](a38_0x507e98[_0x4d7365(0xea)](_0x4d7365(0x10f)),_0x4d7365(0x104)),0x1;}for(const _0x37c26b of _0x6384d5['files']){if(_0x37c26b[_0x4d7365(0xe1)]||_0x37c26b[_0x4d7365(0x124)]){const _0x3bded7=a38_0x1baa51[_0x4d7365(0xde)](_0x37c26b['absolutePath']);!existsSync(_0x3bded7)&&mkdirSync(_0x3bded7,{'recursive':!![]}),writeFileSync(_0x37c26b['absolutePath'],_0x37c26b[_0x4d7365(0x100)],_0x4d7365(0x10c));}}return console[_0x4d7365(0xf2)](a38_0x507e98['green'](_0x4d7365(0xe7)+(_0x184d0c[_0x4d7365(0xfd)]+_0x545de8['length'])+_0x4d7365(0x129)+_0x6384d5[_0x4d7365(0x128)])),saveSessionContext({'parent_segment':_0x6384d5['parentName']},_0x5ba569[_0x4d7365(0xec)]),console[_0x4d7365(0xf2)](a38_0x507e98[_0x4d7365(0x121)](_0x4d7365(0xfa)+a38_0x507e98[_0x4d7365(0x106)](_0x4d7365(0x118))+'\x20=\x20'+a38_0x507e98[_0x4d7365(0x122)](_0x6384d5[_0x4d7365(0xff)]))),0x0;}}
@@ -1 +1 @@
1
- const a39_0x55db05=a39_0x9a59;(function(_0x2e04ba,_0x59c389){const _0x150fa0=a39_0x9a59,_0x4f7ffb=_0x2e04ba();while(!![]){try{const _0x253f4f=-parseInt(_0x150fa0(0x1af))/0x1+-parseInt(_0x150fa0(0x1f5))/0x2+parseInt(_0x150fa0(0x1f0))/0x3*(parseInt(_0x150fa0(0x1da))/0x4)+-parseInt(_0x150fa0(0x20a))/0x5*(-parseInt(_0x150fa0(0x1ca))/0x6)+-parseInt(_0x150fa0(0x181))/0x7*(-parseInt(_0x150fa0(0x1fe))/0x8)+parseInt(_0x150fa0(0x1a9))/0x9+parseInt(_0x150fa0(0x1b0))/0xa*(-parseInt(_0x150fa0(0x1ef))/0xb);if(_0x253f4f===_0x59c389)break;else _0x4f7ffb['push'](_0x4f7ffb['shift']());}catch(_0x3ed213){_0x4f7ffb['push'](_0x4f7ffb['shift']());}}}(a39_0x1a43,0xde6c0));import{BaseCommand}from'./command.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{generateDiff,formatDiffWithColors}from'../utils/diff.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{batchAsync}from'../utils/async.js';import{segmentToYamlString,segmentWithActivationsToYaml}from'../sdk/segment/child-segment-yaml.js';import a39_0x23710a from'chalk';import{existsSync}from'fs';function a39_0x9a59(_0x83e5ef,_0xf38dee){_0x83e5ef=_0x83e5ef-0x171;const _0x1a4340=a39_0x1a43();let _0x9a5991=_0x1a4340[_0x83e5ef];return _0x9a5991;}function a39_0x1a43(){const _0x407b16=['all','βœ”\x20All\x20journeys\x20are\x20up\x20to\x20date','Folders\x20to\x20create:','\x20\x20Journeys:\x20','audienceId','Delete\x20journey:','\x20\x20Segments:\x20','length','site','toCreate','isNew','Delete\x20segment:','helpText','listActivations','isScoped','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','getParent','set','verbose','list','name','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','versionNumber','then','12FimJwV','existingSegment','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','dryRun','created','changed','red','get','New\x20journey:','journey','\x20\x20Activations:','type','Scoped\x20to\x20folder:\x20','delete','unchanged','updated','1667228yflBhh','journeyId','parentName','description','Error:\x20','execute','results','getOutputSchemaWithCache','parentSegment','error','listSegments','/app/ps/','targetDir','\x0aβœ”\x20Push\x20complete','Preparing\x20journeys...','\x20to\x20create','\x20to\x20delete','yellow','No\x20','\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20','\x0aValidation\x20failed:','22HhybuZ','6CPRdPH','\x20YAML\x20files\x20found','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file','\x20folders\x20to\x20create','new','219144YmnwFD','nameToType','cyan','Parent\x20segment:\x20','(Journey\x20will\x20be\x20deleted)','Changes\x20to\x20journey:','folderId','createdSegmentIds','Fetching\x20connections\x20for\x20name\x20resolution...','8134344oOnrgw','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','join','updatedAt','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','yes','journeyBundleName','setPhase','nameToId','/j/da/je','segment:push','activations','3466510pmCSbd','push','folderPath','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','user','Fetching\x20existing\x20data...','segment\x20or\x20journey','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','diff','Source\x20directory:\x20','journeysOnly','existingJourney','Push\x20','πŸ“\x20','\x20changes?','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','segmentFolderId','\x20\x20Source:\x20','.yaml','Resolving\x20parent\x20segment\x20\x27','\x20created','7ZHEVSm','toString','map','folders','\x20new','/sb/da/esr','filter','\x20updated','repeat','\x20activations]','\x20to\x20update','.yml','add','\x0aError:','endsWith','\x20\x20Activations:\x20','message','deleted','parentFolder','file','blue','\x20unchanged','connection','\x20deleted','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','data','\x20changed','idToName','\x20\x20πŸ“Š\x20Segments:','journeys','segment','yamlConfig','toDelete','filePath','segments','attributes','dim','journeyBundleId','green','\x20\x20\x20\x20','9073107MaUMPw','buildUserMaps','Changes\x20to:','state','/e/','Error\x20parsing\x20YAML:\x20','816790FrOOpA','12038660CAAVlN'];a39_0x1a43=function(){return _0x407b16;};return a39_0x1a43();}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_0x55db05(0x1c6)]=a39_0x55db05(0x208);[a39_0x55db05(0x1dd)]=a39_0x55db05(0x1ff);async[a39_0x55db05(0x1df)](_0x126b7f){const _0x238454=a39_0x55db05,{options:_0x454caf,args:_0x336a8f,tdx:_0x150b9f}=_0x126b7f,_0xe967d5=_0x454caf,_0x1fad65=await resolveTarget({'arg':_0x336a8f[0x0],'contextParent':_0x454caf[_0x238454(0x1e2)],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x1fad65))return _0x1fad65['errorCode']==='no_parent'?(console[_0x238454(0x1e3)](a39_0x23710a[_0x238454(0x1eb)]('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console['error']('Usage:\x20tdx\x20sg\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20(requires\x20context)'),console[_0x238454(0x1e3)](_0x238454(0x1c1)),console['error'](_0x238454(0x1f2))):(console[_0x238454(0x1e3)](a39_0x23710a[_0x238454(0x1d0)](_0x238454(0x1de)+_0x1fad65[_0x238454(0x191)]+'\x0a')),_0x1fad65[_0x238454(0x1bd)]&&console[_0x238454(0x1e3)](a39_0x23710a[_0x238454(0x1f7)](_0x1fad65['helpText']))),0x1;if(_0x1fad65['type']==='parent_name')return console[_0x238454(0x1e3)](a39_0x23710a[_0x238454(0x1d0)]('Error:\x20Directory\x20not\x20found:\x20'+_0x1fad65[_0x238454(0x1e6)]+'\x0a')),console['error'](a39_0x23710a[_0x238454(0x1f7)]('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;const _0x196118=_0x1fad65[_0x238454(0x1dc)],_0xbc7751=_0x1fad65[_0x238454(0x1e6)],_0xcb50c6=_0x1fad65[_0x238454(0x1d5)]===_0x238454(0x194)?_0x1fad65[_0x238454(0x1a2)]:undefined,_0xf7f5ee=getScopedDetails(_0x1fad65),_0x2f210d=_0xf7f5ee?.[_0x238454(0x1bf)]??![],_0x4a2f31=_0xf7f5ee?.['scopedFolderPath']??'';if(!existsSync(_0xbc7751))return console['error'](a39_0x23710a['red']('Error:\x20Directory\x20not\x20found:\x20'+_0xbc7751+'\x0a')),console['error'](a39_0x23710a['cyan'](_0x238454(0x173))),0x1;_0xe967d5[_0x238454(0x1c4)]&&(console[_0x238454(0x1e3)]('Site:\x20'+_0xe967d5[_0x238454(0x1b9)]),console['error'](_0x238454(0x1f8)+_0x196118),console[_0x238454(0x1e3)](_0x238454(0x175)+_0xbc7751),_0x2f210d&&console[_0x238454(0x1e3)](_0x238454(0x1d6)+_0x4a2f31));const _0x3b8382=await withSpinner(_0x238454(0x17f)+_0x196118+'\x27...',()=>_0x150b9f[_0x238454(0x19f)]['resolveParentId'](_0x196118),{'verbose':_0xe967d5[_0x238454(0x1c4)]}),_0x2cb142=_0x3b8382[_0x238454(0x19a)],{parentSegmentResult:_0x447cad,segmentsResult:_0x3bbdd3,foldersResult:_0x2cc728,journeysWithDetailsResult:_0x23ad85,userMaps:_0x2febf3}=await withSpinner(_0x238454(0x171),async()=>{const _0x3486af=_0x238454,[_0x35b805,_0x2fefc6,_0x47222b,_0xe2b25c,_0x22904f]=await Promise[_0x3486af(0x1b1)]([_0x150b9f['segment'][_0x3486af(0x1c2)](_0x2cb142),_0x150b9f[_0x3486af(0x19f)][_0x3486af(0x1e4)](_0x2cb142),_0x150b9f[_0x3486af(0x19f)]['listFolders'](_0x2cb142),_0x150b9f['journey']['listJourneysWithDetailsFromParentSegment'](_0x2cb142,{'includeAllVersions':!![]}),_0x150b9f[_0x3486af(0x20e)][_0x3486af(0x1aa)]()]);return{'parentSegmentResult':_0x35b805,'segmentsResult':_0x2fefc6,'foldersResult':_0x47222b,'journeysWithDetailsResult':_0xe2b25c,'userMaps':_0x22904f};},{'verbose':_0xe967d5[_0x238454(0x1c4)]})[_0x238454(0x1c9)](_0x3f8b9d=>_0x3f8b9d[_0x238454(0x19a)]),_0x4d327e=_0x447cad,_0x4e9b35=extractRootFolderId(_0x4d327e),_0x370230=_0x3bbdd3,_0x5ea6e5=_0x2cc728,{journeys:_0x5780bf,activationStepsById:_0x19a97d}=_0x23ad85,_0x5f2cce=new Map(_0x5780bf[_0x238454(0x183)](_0x252630=>[_0x252630['id'],_0x252630])),_0x2da442=_0x5780bf[_0x238454(0x183)](_0x147ff9=>({'id':_0x147ff9['id'],'name':_0x147ff9[_0x238454(0x1a4)][_0x238454(0x1c6)],'journeyBundleName':_0x147ff9[_0x238454(0x1a4)][_0x238454(0x204)]||'','journeyBundleId':_0x147ff9['attributes'][_0x238454(0x1a6)]||'','versionNumber':_0x147ff9[_0x238454(0x1a4)][_0x238454(0x1c8)],'description':_0x147ff9[_0x238454(0x1a4)][_0x238454(0x1dd)],'state':_0x147ff9['attributes'][_0x238454(0x1ac)],'paused':_0x147ff9[_0x238454(0x1a4)]['paused'],'audienceId':_0x147ff9[_0x238454(0x1a4)][_0x238454(0x1b5)],'folderId':_0x147ff9['relationships']?.[_0x238454(0x193)]?.[_0x238454(0x19a)]?.['id'],'createdAt':_0x147ff9[_0x238454(0x1a4)]['createdAt'],'updatedAt':_0x147ff9['attributes'][_0x238454(0x201)]})),{emailToId:_0x585d8d,idToEmail:_0x429617}=_0x2febf3,_0x254b90=await withSpinner(_0x238454(0x1fd),async()=>{const _0x220c5b=_0x238454,_0x105087=await _0x150b9f[_0x220c5b(0x197)][_0x220c5b(0x1c5)]();return buildConnectionMaps(_0x105087);},{'verbose':_0xe967d5[_0x238454(0x1c4)]})[_0x238454(0x1c9)](_0x46c05b=>_0x46c05b['data']),_0x4f975b=_0x254b90['nameToId'],_0x9dcac=_0x254b90[_0x238454(0x19c)],_0x3427b7=_0x254b90[_0x238454(0x1f6)],_0x15203b={'emailToIdMap':_0x585d8d,'connectionNameToIdMap':_0x4f975b,'connectionNameToTypeMap':_0x3427b7,'getSchema':_0x14ee65=>_0x150b9f[_0x238454(0x197)][_0x238454(0x1e1)](_0x14ee65)};let {pathToId:_0x58c233,idToPath:_0x28d875}=buildFolderMaps(_0x5ea6e5);const _0x49758a=buildSegmentLookupMap(_0x370230,_0x28d875),_0x4c3ae5=buildSegmentNameToIdMap(_0x370230),_0x297761=buildJourneyBundleLookupMap(_0x2da442,_0x28d875);let _0x4999b6;if(_0xcb50c6){if(!_0xcb50c6[_0x238454(0x18f)](_0x238454(0x18c))&&!_0xcb50c6[_0x238454(0x18f)](_0x238454(0x17e)))return console[_0x238454(0x1e3)](a39_0x23710a[_0x238454(0x1d0)](_0x238454(0x1c7)+_0xcb50c6+'\x0a')),0x1;_0x4999b6=[_0xcb50c6];}else _0x4999b6=findYamlFiles(_0xbc7751);if(_0x4999b6['length']===0x0)return console[_0x238454(0x1e3)](a39_0x23710a[_0x238454(0x1d0)](_0x238454(0x199)+_0xbc7751+'\x0a')),console['error'](a39_0x23710a[_0x238454(0x1f7)](_0x238454(0x20d))),0x1;let _0x386940,_0x5d20be;try{const _0x23eccb=parseAndClassifyYamlFiles(_0x4999b6,_0xbc7751,{'skipSegments':_0xe967d5[_0x238454(0x176)]});_0x386940=_0x23eccb[_0x238454(0x1a3)],_0x5d20be=_0x23eccb[_0x238454(0x19e)];const _0x7de073=validateParsedFiles(_0x23eccb,_0xbc7751);if(_0x7de073[_0x238454(0x1b8)]>0x0)return console[_0x238454(0x1e3)](a39_0x23710a[_0x238454(0x1d0)](_0x238454(0x1ee))),console['error'](formatValidationErrors(_0x7de073)),console[_0x238454(0x1e3)](a39_0x23710a[_0x238454(0x1eb)]('\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.')),0x1;}catch(_0x48eaa2){return console['error'](a39_0x23710a[_0x238454(0x1d0)](_0x238454(0x1ae)+(_0x48eaa2 instanceof Error?_0x48eaa2[_0x238454(0x191)]:_0x48eaa2))),0x1;}if(_0x386940['length']===0x0&&_0x5d20be[_0x238454(0x1b8)]===0x0){const _0x5d18cf=_0xe967d5[_0x238454(0x176)]?_0x238454(0x1d3):_0x238454(0x172);return console['error'](a39_0x23710a[_0x238454(0x1eb)](_0x238454(0x1ec)+_0x5d18cf+_0x238454(0x1f1))),0x0;}const _0x2a870c=new Map();_0x370230['length']>0x0&&!_0xe967d5[_0x238454(0x176)]&&await withSpinner('Fetching\x20existing\x20activations...',async()=>{await batchAsync(_0x370230,async _0x30afe3=>{const _0x1dce88=a39_0x9a59,_0x2df1b9=await _0x150b9f[_0x1dce88(0x19f)][_0x1dce88(0x1be)](_0x2cb142,_0x30afe3['id']);_0x2a870c[_0x1dce88(0x1c3)](_0x30afe3['id'],_0x2df1b9);});},{'verbose':_0xe967d5[_0x238454(0x1c4)]});const {segmentFiles:_0x27fda2,foldersToCreate:_0x4e3a0a}=await prepareSegmentFiles(_0x386940,{'segmentByFolderAndName':_0x49758a,'activationsBySegmentId':_0x2a870c,'folderPathToId':_0x58c233,'idToEmailMap':_0x429617,'connectionIdToNameMap':_0x9dcac},_0x15203b,_0x2f210d,_0x4a2f31),_0x425cad=_0xcb50c6?[]:findSegmentsToDelete(_0x370230,_0x386940[_0x238454(0x183)](({yamlConfig:_0x1dcc73,folderPath:_0x499b44})=>({'yamlConfig':_0x1dcc73,'folderPath':resolveTDFolderPath(_0x499b44,_0x2f210d,_0x4a2f31)})),_0x28d875,_0x4a2f31,_0x2f210d),{journeyFiles:_0x92c354,foldersToCreate:_0x2eec5f}=await withProgressSpinner(_0x238454(0x1e8),async _0x1e5a4e=>prepareJourneyFiles(_0x5d20be,{'fetchJourney':async _0x167508=>_0x150b9f[_0x238454(0x1d3)]['getJourney'](_0x167508[_0x238454(0x1db)]),'journeyBundlesByFolderAndName':_0x297761,'folderPathToId':_0x58c233,'idToEmailMap':_0x429617,'connectionIdToNameMap':_0x9dcac,'existingSegments':_0x370230,'parentId':_0x2cb142,'deps':_0x150b9f,'progress':{'update':_0x37fcaf=>{const _0x42ae5c=_0x238454;_0x1e5a4e[_0x42ae5c(0x205)](_0x37fcaf),_0xe967d5[_0x42ae5c(0x1c4)]&&console[_0x42ae5c(0x1e3)]('\x20\x20'+_0x37fcaf);}},'journeyById':_0x5f2cce,'activationStepsById':_0x19a97d},_0x2f210d,_0x4a2f31),{'verbose':_0xe967d5['verbose']})[_0x238454(0x1c9)](_0x3117ca=>_0x3117ca[_0x238454(0x19a)]);for(const _0x7dd349 of _0x2eec5f){_0x4e3a0a[_0x238454(0x18d)](_0x7dd349);}const _0x3ecc7a=_0xcb50c6?[]:findJourneysToDelete(_0x2da442,_0x5d20be[_0x238454(0x183)](({yamlConfig:_0x59b6bb,folderPath:_0x26e172})=>({'yamlConfig':_0x59b6bb,'folderPath':resolveTDFolderPath(_0x26e172,_0x2f210d,_0x4a2f31)})),_0x28d875,_0x4a2f31,_0x2f210d),_0x50336a=calculatePushStats(_0x27fda2,_0x92c354,_0x4e3a0a,_0x425cad,_0x3ecc7a,!!_0xe967d5[_0x238454(0x1d7)],!!_0xe967d5[_0x238454(0x176)]),_0x2ff3e1=_0x50336a[_0x238454(0x1a3)][_0x238454(0x1f4)],_0x3f540b=_0x50336a[_0x238454(0x1a3)][_0x238454(0x1cf)],_0x5578f4=_0x50336a[_0x238454(0x1a3)][_0x238454(0x1d8)],_0x500f37=_0x50336a[_0x238454(0x1a3)][_0x238454(0x1a1)],_0x121e37=_0x50336a[_0x238454(0x184)][_0x238454(0x1ba)],_0x2a14f4=_0x50336a[_0x238454(0x19e)]['new'],_0x3124c6=_0x50336a['journeys']['changed'],_0x3c8afc=_0x50336a[_0x238454(0x19e)][_0x238454(0x1d8)],_0xc36bd8=_0x50336a[_0x238454(0x19e)][_0x238454(0x1a1)],_0x4e2c74=_0x50336a['activations'][_0x238454(0x1b1)],_0xbf5d51=_0x50336a[_0x238454(0x209)][_0x238454(0x1ba)],_0x589328=_0x50336a[_0x238454(0x209)]['toUpdate'],_0x2a326a=_0x50336a[_0x238454(0x209)]['toDelete'];console['error']('\x0aPush\x20summary\x20for\x20\x27'+_0x196118+'\x27:');_0x121e37['length']>0x0&&console[_0x238454(0x1e3)]('\x20\x20'+a39_0x23710a['blue'](_0x238454(0x179)+_0x121e37[_0x238454(0x1b8)]+_0x238454(0x1f3)));if(!_0xe967d5[_0x238454(0x176)]){console[_0x238454(0x1e3)](_0x238454(0x19d)),console['error'](_0x238454(0x1a8)+a39_0x23710a['green']('+\x20'+_0x2ff3e1[_0x238454(0x1b8)]+_0x238454(0x185))),console[_0x238454(0x1e3)](_0x238454(0x1a8)+a39_0x23710a[_0x238454(0x1eb)]('~\x20'+_0x3f540b[_0x238454(0x1b8)]+_0x238454(0x19b)));if(_0x500f37[_0x238454(0x1b8)]>0x0)console[_0x238454(0x1e3)](_0x238454(0x1a8)+a39_0x23710a[_0x238454(0x1d0)]('-\x20'+_0x500f37[_0x238454(0x1b8)]+_0x238454(0x1ea)));else _0x425cad[_0x238454(0x1b8)]>0x0&&!_0xe967d5[_0x238454(0x1d7)]&&console[_0x238454(0x1e3)](_0x238454(0x1a8)+a39_0x23710a['dim'](_0x425cad[_0x238454(0x1b8)]+_0x238454(0x1c0)));console['error'](_0x238454(0x1a8)+a39_0x23710a[_0x238454(0x1a5)]('=\x20'+_0x5578f4[_0x238454(0x1b8)]+_0x238454(0x196)));}if(_0x92c354[_0x238454(0x1b8)]>0x0||_0x3ecc7a[_0x238454(0x1b8)]>0x0){console[_0x238454(0x1e3)]('\x20\x20πŸ—ΊοΈ\x20\x20Journeys:'),console[_0x238454(0x1e3)](_0x238454(0x1a8)+a39_0x23710a[_0x238454(0x1a7)]('+\x20'+_0x2a14f4[_0x238454(0x1b8)]+_0x238454(0x185))),console['error']('\x20\x20\x20\x20'+a39_0x23710a['yellow']('~\x20'+_0x3124c6[_0x238454(0x1b8)]+_0x238454(0x19b)));if(_0xc36bd8[_0x238454(0x1b8)]>0x0)console[_0x238454(0x1e3)](_0x238454(0x1a8)+a39_0x23710a[_0x238454(0x1d0)]('-\x20'+_0xc36bd8['length']+_0x238454(0x1ea)));else _0x3ecc7a[_0x238454(0x1b8)]>0x0&&!_0xe967d5[_0x238454(0x1d7)]&&console[_0x238454(0x1e3)](_0x238454(0x1a8)+a39_0x23710a[_0x238454(0x1a5)](_0x3ecc7a['length']+_0x238454(0x1c0)));console['error'](_0x238454(0x1a8)+a39_0x23710a[_0x238454(0x1a5)]('=\x20'+_0x3c8afc['length']+_0x238454(0x196)));}_0x4e2c74[_0x238454(0x1b8)]>0x0&&!_0xe967d5[_0x238454(0x176)]&&(console[_0x238454(0x1e3)](''),console[_0x238454(0x1e3)](_0x238454(0x1d4)),_0xbf5d51[_0x238454(0x1b8)]>0x0&&console['error'](_0x238454(0x1a8)+a39_0x23710a[_0x238454(0x1a7)]('+\x20'+_0xbf5d51['length']+_0x238454(0x1e9))),_0x589328[_0x238454(0x1b8)]>0x0&&console[_0x238454(0x1e3)](_0x238454(0x1a8)+a39_0x23710a[_0x238454(0x1eb)]('~\x20'+_0x589328[_0x238454(0x1b8)]+_0x238454(0x18b))),_0x2a326a[_0x238454(0x1b8)]>0x0&&console[_0x238454(0x1e3)](_0x238454(0x1a8)+a39_0x23710a['red']('-\x20'+_0x2a326a[_0x238454(0x1b8)]+_0x238454(0x1ea))));console['error'](_0x238454(0x17d)+a39_0x23710a[_0x238454(0x1f7)](_0xbc7751)+'\x0a');if(_0x121e37['length']>0x0){console[_0x238454(0x1e3)](_0x238454(0x1b3));for(const _0xb95523 of _0x121e37){console[_0x238454(0x1e3)]('\x20\x20'+a39_0x23710a[_0x238454(0x195)]('+')+'\x20'+_0xb95523);}console[_0x238454(0x1e3)]('');}if(_0x2ff3e1[_0x238454(0x1b8)]>0x0&&!_0xe967d5[_0x238454(0x176)])for(const _0x13393b of _0x2ff3e1){const _0xa5c999=_0x13393b[_0x238454(0x20c)]?_0x13393b['folderPath']+'/'+_0x13393b['yamlConfig'][_0x238454(0x1c6)]:_0x13393b['yamlConfig'][_0x238454(0x1c6)],_0x4188bf=_0x13393b[_0x238454(0x1a0)]['activations']?.['length']||0x0,_0x401b7e=_0x4188bf>0x0?a39_0x23710a['dim']('\x20['+_0x4188bf+_0x238454(0x18a)):'';console[_0x238454(0x1e3)]('\x0a'+a39_0x23710a[_0x238454(0x1a7)]('New\x20segment:')+'\x20'+_0xa5c999+_0x401b7e),console['error']('─'[_0x238454(0x189)](0x3c)),_0x13393b[_0x238454(0x174)]&&console[_0x238454(0x1e3)](_0x13393b[_0x238454(0x174)]),console['error']('─'[_0x238454(0x189)](0x3c));}if(_0x500f37[_0x238454(0x1b8)]>0x0&&!_0xe967d5['journeysOnly'])for(const _0x109c37 of _0x500f37){const _0x368a14=_0x109c37[_0x238454(0x17c)]?_0x28d875[_0x238454(0x1d1)](_0x109c37[_0x238454(0x17c)][_0x238454(0x182)]())||'':'',_0x16f05b=_0x368a14?_0x368a14+'/'+_0x109c37[_0x238454(0x1c6)]:_0x109c37[_0x238454(0x1c6)],_0x3d831a=_0x2a870c[_0x238454(0x1d1)](_0x109c37['id'])||[],_0x13ae4=_0x3d831a[_0x238454(0x1b8)]>0x0?a39_0x23710a['dim']('\x20['+_0x3d831a[_0x238454(0x1b8)]+'\x20activations]'):'';console['error']('\x0a'+a39_0x23710a[_0x238454(0x1d0)](_0x238454(0x1bc))+'\x20'+_0x16f05b+_0x13ae4),console['error']('─'[_0x238454(0x189)](0x3c));const _0xb08301=segmentWithActivationsToYaml(_0x109c37,_0x3d831a,undefined,_0x429617,_0x9dcac),_0x187029=segmentToYamlString(_0xb08301),_0x422ab2=generateDiff(_0x187029,'');console['error'](formatDiffWithColors(_0x422ab2)),console[_0x238454(0x1e3)]('─'[_0x238454(0x189)](0x3c));}const _0x528451=_0x27fda2[_0x238454(0x187)](_0x1840d7=>!_0x1840d7[_0x238454(0x1bb)]&&_0x1840d7[_0x238454(0x174)]);if(_0x528451[_0x238454(0x1b8)]>0x0&&!_0xe967d5[_0x238454(0x176)])for(const _0x2c20b6 of _0x528451){const _0x3d9cf0=_0x2c20b6['folderPath']?_0x2c20b6['folderPath']+'/'+_0x2c20b6[_0x238454(0x1a0)][_0x238454(0x1c6)]:_0x2c20b6[_0x238454(0x1a0)][_0x238454(0x1c6)];console[_0x238454(0x1e3)]('\x0a'+a39_0x23710a[_0x238454(0x1eb)](_0x238454(0x1ab))+'\x20'+_0x3d9cf0),console[_0x238454(0x1e3)]('─'[_0x238454(0x189)](0x3c)),console['error'](_0x2c20b6[_0x238454(0x174)]),console[_0x238454(0x1e3)]('─'['repeat'](0x3c));}if(_0x2a14f4[_0x238454(0x1b8)]>0x0)for(const _0x3197ca of _0x2a14f4){const _0x24c267=_0x3197ca[_0x238454(0x20c)]?_0x3197ca['folderPath']+'/'+_0x3197ca[_0x238454(0x1a0)][_0x238454(0x1c6)]:_0x3197ca[_0x238454(0x1a0)][_0x238454(0x1c6)];console[_0x238454(0x1e3)]('\x0a'+a39_0x23710a['green'](_0x238454(0x1d2))+'\x20'+_0x24c267),console[_0x238454(0x1e3)]('─'[_0x238454(0x189)](0x3c)),_0x3197ca[_0x238454(0x174)]&&console[_0x238454(0x1e3)](_0x3197ca[_0x238454(0x174)]),console[_0x238454(0x1e3)]('─'[_0x238454(0x189)](0x3c));}const _0x58dbac=_0x92c354['filter'](_0x247f03=>!_0x247f03[_0x238454(0x1bb)]&&_0x247f03[_0x238454(0x174)]);if(_0x58dbac[_0x238454(0x1b8)]>0x0)for(const _0x151866 of _0x58dbac){const _0x4d25f6=_0x151866['folderPath']?_0x151866[_0x238454(0x20c)]+'/'+_0x151866[_0x238454(0x1a0)]['name']:_0x151866[_0x238454(0x1a0)][_0x238454(0x1c6)];console[_0x238454(0x1e3)]('\x0a'+a39_0x23710a['yellow'](_0x238454(0x1fa))+'\x20'+_0x4d25f6),console['error']('─'['repeat'](0x3c)),console[_0x238454(0x1e3)](_0x151866['diff']),console[_0x238454(0x1e3)]('─'['repeat'](0x3c));}if(_0xc36bd8[_0x238454(0x1b8)]>0x0)for(const _0x390ecc of _0xc36bd8){const _0x31a236=_0x390ecc['folderId']?_0x28d875[_0x238454(0x1d1)](_0x390ecc[_0x238454(0x1fb)])||'':'',_0x440aa3=_0x31a236?_0x31a236+'/'+_0x390ecc[_0x238454(0x204)]:_0x390ecc['journeyBundleName'];console[_0x238454(0x1e3)]('\x0a'+a39_0x23710a['red'](_0x238454(0x1b6))+'\x20'+_0x440aa3),console['error']('─'[_0x238454(0x189)](0x3c)),console['error'](a39_0x23710a[_0x238454(0x1d0)](_0x238454(0x1f9))),console[_0x238454(0x1e3)]('─'['repeat'](0x3c));}if(_0xe967d5[_0x238454(0x1cd)])return console['error'](a39_0x23710a['yellow'](_0x238454(0x202))),0x0;const _0x3606e2=_0xe967d5[_0x238454(0x176)]?![]:_0x2ff3e1[_0x238454(0x1b8)]>0x0||_0x3f540b['length']>0x0||_0x500f37[_0x238454(0x1b8)]>0x0,_0xa2b9f5=_0x2a14f4['length']>0x0||_0x3124c6[_0x238454(0x1b8)]>0x0||_0xc36bd8['length']>0x0,_0x394774=_0xe967d5['journeysOnly']?![]:_0x4e2c74['length']>0x0,_0x479948=_0x121e37[_0x238454(0x1b8)]>0x0;if(!_0x3606e2&&!_0xa2b9f5&&!_0x394774&&!_0x479948){const _0x10bf48=_0xe967d5[_0x238454(0x176)]?_0x238454(0x1b2):'βœ”\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date';console[_0x238454(0x1e3)](a39_0x23710a[_0x238454(0x1a7)](_0x10bf48));if(_0xcb50c6&&_0x5578f4[_0x238454(0x1b8)]===0x1){const _0x5c5981=_0x5578f4[0x0];if(_0x5c5981[_0x238454(0x1cb)]?.['id']){const _0x105baa=getConsoleNextUrl(_0xe967d5['site'],_0x238454(0x1e5)+_0x2cb142+_0x238454(0x1ad)+_0x5c5981['existingSegment']['id']+_0x238454(0x186));console['error']('\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20'+a39_0x23710a[_0x238454(0x1f7)](_0x105baa));}}if(_0xcb50c6&&_0x3c8afc[_0x238454(0x1b8)]===0x1){const _0x2eae00=_0x3c8afc[0x0];if(_0x2eae00[_0x238454(0x177)]?.['id']){const _0x433dbb=getConsoleNextUrl(_0xe967d5[_0x238454(0x1b9)],'/app/ps/'+_0x2cb142+'/e/'+_0x2eae00[_0x238454(0x177)]['id']+'/j/da/je');console[_0x238454(0x1e3)]('\x20\x20'+a39_0x23710a[_0x238454(0x1f7)](_0x433dbb));}}return 0x0;}const _0x3bcaec=_0xe967d5['journeysOnly']?_0x2a14f4[_0x238454(0x1b8)]+_0x3124c6['length']+_0xc36bd8['length']+_0x121e37[_0x238454(0x1b8)]:_0x2ff3e1['length']+_0x3f540b[_0x238454(0x1b8)]+_0x500f37['length']+_0x2a14f4[_0x238454(0x1b8)]+_0x3124c6[_0x238454(0x1b8)]+_0xc36bd8[_0x238454(0x1b8)]+_0x121e37[_0x238454(0x1b8)]+_0x4e2c74[_0x238454(0x1b8)];if(!_0xe967d5[_0x238454(0x203)]&&_0x3bcaec>0x0){if(!isInteractive())return console[_0x238454(0x1e3)](a39_0x23710a[_0x238454(0x1d0)](_0x238454(0x18e)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console['error'](a39_0x23710a[_0x238454(0x1a5)](_0x238454(0x1cc))),0x1;const _0x158030=await confirmKey(_0x238454(0x178)+_0x3bcaec+_0x238454(0x17a));if(!_0x158030)return console['error'](a39_0x23710a['yellow']('Aborted.')),0x1;}const _0x50c690={'withProgress':async(_0x3ce11d,_0x3815d3)=>{const _0x3ba173=_0x238454,_0x5628dd=await withSpinner(_0x3ce11d,_0x3815d3,{'verbose':_0xe967d5['verbose']});return{'data':_0x5628dd[_0x3ba173(0x19a)]};},'logInfo':_0x46feb8=>console['error'](a39_0x23710a[_0x238454(0x195)]('βœ”\x20'+_0x46feb8)),'logSuccess':_0x48442c=>console[_0x238454(0x1e3)](a39_0x23710a[_0x238454(0x1a7)]('βœ”\x20'+_0x48442c)),'logWarning':_0x377fb1=>console['error'](a39_0x23710a['yellow']('⚠\x20'+_0x377fb1)),'logDeleted':_0x410943=>console[_0x238454(0x1e3)](a39_0x23710a[_0x238454(0x1d0)]('βœ”\x20'+_0x410943))},_0x52046e={'segment':_0x150b9f['segment'],'journey':_0x150b9f[_0x238454(0x1d3)],'user':_0x150b9f[_0x238454(0x20e)],'connection':_0x150b9f[_0x238454(0x197)]};_0x121e37[_0x238454(0x1b8)]>0x0&&(_0x58c233=await executePushFolders(_0x52046e,_0x121e37,_0x58c233,{'parentId':_0x2cb142},_0x50c690));const _0x5e3d19={'rootFolderId':_0x4e9b35,'folderPathToId':_0x58c233,'folderIdToPath':_0x28d875,'segmentNameToId':_0x4c3ae5,'activationsBySegmentId':_0x2a870c,'emailToIdMap':_0x585d8d,'idToEmailMap':_0x429617,'connectionNameToIdMap':_0x254b90[_0x238454(0x206)],'connectionIdToNameMap':_0x254b90[_0x238454(0x19c)],'connectionNameToTypeMap':_0x3427b7},_0x59c1f=await executePushSegments(_0x52046e,_0xe967d5[_0x238454(0x176)]?[]:_0x27fda2,_0x5e3d19,{'parentId':_0x2cb142},_0x50c690),_0x35a507=_0x59c1f[_0x238454(0x1ce)],_0x6ce50c=_0x59c1f[_0x238454(0x1d9)],_0x2dcc0e=_0x59c1f['activations'][_0x238454(0x1ce)],_0x535cfb=_0x59c1f[_0x238454(0x209)][_0x238454(0x1d9)],_0x197e11=_0x59c1f[_0x238454(0x209)][_0x238454(0x192)];let _0xe68a25;if(_0xcb50c6&&_0x27fda2[_0x238454(0x1b8)]===0x1){const _0x95a425=_0x27fda2[0x0];_0xe68a25=_0x95a425['existingSegment']?.['id']??_0x59c1f['createdSegmentIds'][_0x238454(0x1d1)](_0x95a425['yamlConfig'][_0x238454(0x1c6)]);}const _0x1fefa9=await executePushSegmentDeletions(_0x52046e,_0xe967d5['journeysOnly']?[]:_0x500f37,_0x50c690);let _0x4788d9=0x0,_0x33abc7=0x0,_0x6e6ecf=0x0;const _0x5e2b7f=new Map(_0x4c3ae5);for(const [_0x439cfd,_0x21c2c7]of _0x59c1f[_0x238454(0x1fc)]){_0x5e2b7f[_0x238454(0x1c3)](_0x439cfd,_0x21c2c7);}if(_0x92c354[_0x238454(0x1b8)]>0x0){const _0x6d590a={..._0x5e3d19,'segmentNameToId':_0x5e2b7f,'existingSegments':_0x370230,'activationContext':_0x15203b},_0x222874=await executePushJourneys(_0x52046e,_0x92c354,_0x6d590a,{'parentId':_0x2cb142,'rootFolderId':_0x4e9b35,'verbose':_0xe967d5[_0x238454(0x1c4)]},_0x50c690);_0x4788d9=_0x222874[_0x238454(0x1ce)],_0x33abc7=_0x222874['updated'];if(_0xcb50c6&&_0x222874[_0x238454(0x1e0)][_0x238454(0x1b8)]===0x1){const _0xb7844e=_0x222874['results'][0x0];if(_0xb7844e['journeyId']){const _0x437d59=getConsoleNextUrl(_0xe967d5[_0x238454(0x1b9)],'/app/ps/'+_0x2cb142+_0x238454(0x1ad)+_0xb7844e['journeyId']+_0x238454(0x207));console[_0x238454(0x1e3)]('\x20\x20'+a39_0x23710a['cyan'](_0x437d59));}}}for(const _0x2f2757 of _0xc36bd8){console['error'](a39_0x23710a[_0x238454(0x1eb)](_0x238454(0x17b)+_0x2f2757[_0x238454(0x204)])),_0x6e6ecf++;}const _0x2701f2=[];if(_0x35a507>0x0)_0x2701f2['push'](_0x35a507+_0x238454(0x180));if(_0x6ce50c>0x0)_0x2701f2['push'](_0x6ce50c+_0x238454(0x188));if(_0x1fefa9>0x0)_0x2701f2[_0x238454(0x20b)](_0x1fefa9+_0x238454(0x198));const _0x3807c8=[];if(_0x4788d9>0x0)_0x3807c8[_0x238454(0x20b)](_0x4788d9+'\x20created');if(_0x33abc7>0x0)_0x3807c8[_0x238454(0x20b)](_0x33abc7+_0x238454(0x188));if(_0x6e6ecf>0x0)_0x3807c8['push'](_0x6e6ecf+'\x20deleted');const _0x207cab=[];if(_0x2dcc0e>0x0)_0x207cab[_0x238454(0x20b)](_0x2dcc0e+_0x238454(0x180));if(_0x535cfb>0x0)_0x207cab[_0x238454(0x20b)](_0x535cfb+_0x238454(0x188));if(_0x197e11>0x0)_0x207cab[_0x238454(0x20b)](_0x197e11+_0x238454(0x198));console[_0x238454(0x1e3)](a39_0x23710a['green'](_0x238454(0x1e7)));_0x2701f2[_0x238454(0x1b8)]>0x0&&!_0xe967d5['journeysOnly']&&console[_0x238454(0x1e3)](_0x238454(0x1b7)+_0x2701f2['join'](',\x20'));_0x3807c8['length']>0x0&&console['error'](_0x238454(0x1b4)+_0x3807c8[_0x238454(0x200)](',\x20'));_0x207cab[_0x238454(0x1b8)]>0x0&&!_0xe967d5[_0x238454(0x176)]&&console[_0x238454(0x1e3)](_0x238454(0x190)+_0x207cab[_0x238454(0x200)](',\x20'));if(_0xe68a25){const _0x5e4547=getConsoleNextUrl(_0xe967d5[_0x238454(0x1b9)],'/app/ps/'+_0x2cb142+'/e/'+_0xe68a25+_0x238454(0x186));console[_0x238454(0x1e3)](_0x238454(0x1ed)+a39_0x23710a[_0x238454(0x1f7)](_0x5e4547));}return 0x0;}}
1
+ const a39_0x2b9c18=a39_0x47dc;(function(_0x3b5a6b,_0x475f98){const _0x3b66d4=a39_0x47dc,_0x21021b=_0x3b5a6b();while(!![]){try{const _0x34c6c6=-parseInt(_0x3b66d4(0xf6))/0x1*(parseInt(_0x3b66d4(0x95))/0x2)+-parseInt(_0x3b66d4(0xb3))/0x3+-parseInt(_0x3b66d4(0xa1))/0x4*(-parseInt(_0x3b66d4(0xf3))/0x5)+parseInt(_0x3b66d4(0xd9))/0x6+parseInt(_0x3b66d4(0x10c))/0x7+-parseInt(_0x3b66d4(0xc3))/0x8*(parseInt(_0x3b66d4(0xcd))/0x9)+-parseInt(_0x3b66d4(0x93))/0xa*(-parseInt(_0x3b66d4(0x107))/0xb);if(_0x34c6c6===_0x475f98)break;else _0x21021b['push'](_0x21021b['shift']());}catch(_0x43fb15){_0x21021b['push'](_0x21021b['shift']());}}}(a39_0x29e8,0x48bff));import{BaseCommand}from'./command.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';function a39_0x47dc(_0x1db9a8,_0x1bf07b){_0x1db9a8=_0x1db9a8-0x92;const _0x29e8db=a39_0x29e8();let _0x47dc4c=_0x29e8db[_0x1db9a8];return _0x47dc4c;}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_0x1bc6de 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_0x29e8(){const _0x4ca7d9=['7953cPIhDs','buildUserMaps','data','type','parentFolder','395689AJUONT','yes','Error\x20parsing\x20YAML:\x20','existingSegment','\x20unchanged','paused','New\x20journey:','\x20to\x20create','name','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','add','dryRun','Changes\x20to:','all','filter','Aborted.','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','audienceId','/e/','map','\x20\x20Source:\x20','Error:\x20','setPhase','\x0aPush\x20summary\x20for\x20\x27','\x20\x20\x20\x20','\x20changes?','list','updated','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','segment\x20or\x20journey','parent_name','\x20YAML\x20files\x20found','Folders\x20to\x20create:','\x20\x20Segments:\x20','toDelete','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file','versionNumber','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','idToName','Error:\x20Directory\x20not\x20found:\x20','created','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','getJourney','13010ZrOQSL','description','7358kvWpZV','\x0aError:','join','toUpdate','deleted','isNew','/sb/da/esr','Resolving\x20parent\x20segment\x20\x27','green','folderId','attributes','errorCode','490276itXZNw','resolveParentId','\x20new','filePath','site','nameToId','changed','βœ”\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','Source\x20directory:\x20','\x20to\x20delete','segmentFolderId','state','Preparing\x20journeys...','dim','activations','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)','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','βœ”\x20All\x20journeys\x20are\x20up\x20to\x20date','1383768sNdXNj','segment:push','Parent\x20segment:\x20','targetDir','file','\x20changed','yamlConfig','\x20\x20Activations:\x20','segment','red','length','new','toString','connection','results','delete','16PFnSdP','\x27...','.yml','get','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','yellow','error','\x0aβœ”\x20Push\x20complete','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','journeysOnly','2335653mLRsXd','parentName','createdSegmentIds','\x20activations]','\x20updated','Fetching\x20existing\x20data...','journeyBundleName','push','\x20folders\x20to\x20create','Push\x20','endsWith','isScoped','1436952DQYqFy','\x20\x20Activations:','Site:\x20','set','toCreate','New\x20segment:','journeyId','createdAt','no_parent','getParent','/app/ps/','user','getOutputSchemaWithCache','folderPath','then','repeat','\x20created','nameToType','Scoped\x20to\x20folder:\x20','diff','journeyBundleId','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','(Journey\x20will\x20be\x20deleted)','verbose','updatedAt','Delete\x20segment:','5ntTAiK','segments','journey','22MrofUW','/j/da/je','cwd','unchanged','execute','listActivations','relationships','cyan','\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20','helpText','Changes\x20to\x20journey:','blue','\x20deleted','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','.yaml','journeys','existingJourney'];a39_0x29e8=function(){return _0x4ca7d9;};return a39_0x29e8();}import{resolveTDFolderPath,findSegmentsToDelete,findJourneysToDelete,buildSegmentLookupMap,buildSegmentNameToIdMap,buildJourneyBundleLookupMap,parseAndClassifyYamlFiles,validateParsedFiles,formatValidationErrors,extractRootFolderId,buildConnectionMaps,calculatePushStats,prepareSegmentFiles,prepareJourneyFiles,executePushSegments,executePushFolders,executePushSegmentDeletions,executePushJourneys}from'../sdk/segment/push-workflow.js';export class SegmentPushCommand extends BaseCommand{['name']=a39_0x2b9c18(0xb4);[a39_0x2b9c18(0x94)]='Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments';async[a39_0x2b9c18(0xfa)](_0x39d945){const _0x53c215=a39_0x2b9c18,{options:_0x3699fb,args:_0x332666,tdx:_0x19185a}=_0x39d945,_0x357875=_0x3699fb,_0x365ff7=await resolveTarget({'arg':_0x332666[0x0],'contextParent':_0x3699fb['parentSegment'],'cwd':process[_0x53c215(0xf8)]()});if(!isSuccessfulResolution(_0x365ff7))return _0x365ff7[_0x53c215(0xa0)]===_0x53c215(0xe1)?(console['error'](a39_0x1bc6de[_0x53c215(0xc8)](_0x53c215(0x128))),console[_0x53c215(0xc9)](_0x53c215(0xb0)),console['error'](_0x53c215(0x132)),console[_0x53c215(0xc9)](_0x53c215(0x130))):(console['error'](a39_0x1bc6de[_0x53c215(0xbc)](_0x53c215(0x121)+_0x365ff7['message']+'\x0a')),_0x365ff7['helpText']&&console[_0x53c215(0xc9)](a39_0x1bc6de[_0x53c215(0xfd)](_0x365ff7[_0x53c215(0xff)]))),0x1;if(_0x365ff7[_0x53c215(0x10a)]===_0x53c215(0x12b))return console['error'](a39_0x1bc6de[_0x53c215(0xbc)](_0x53c215(0x134)+_0x365ff7['targetDir']+'\x0a')),console[_0x53c215(0xc9)](a39_0x1bc6de[_0x53c215(0xfd)](_0x53c215(0x103))),0x1;const _0x23eadb=_0x365ff7[_0x53c215(0xce)],_0x4fcdc2=_0x365ff7[_0x53c215(0xb6)],_0x2f2571=_0x365ff7[_0x53c215(0x10a)]===_0x53c215(0xb7)?_0x365ff7[_0x53c215(0xa4)]:undefined,_0x15d5d1=getScopedDetails(_0x365ff7),_0x57f142=_0x15d5d1?.[_0x53c215(0xd8)]??![],_0x2613fc=_0x15d5d1?.['scopedFolderPath']??'';if(!existsSync(_0x4fcdc2))return console['error'](a39_0x1bc6de['red'](_0x53c215(0x134)+_0x4fcdc2+'\x0a')),console[_0x53c215(0xc9)](a39_0x1bc6de[_0x53c215(0xfd)](_0x53c215(0x103))),0x1;_0x357875[_0x53c215(0xf0)]&&(console['error'](_0x53c215(0xdb)+_0x357875[_0x53c215(0xa5)]),console[_0x53c215(0xc9)](_0x53c215(0xb5)+_0x23eadb),console[_0x53c215(0xc9)](_0x53c215(0xa9)+_0x4fcdc2),_0x57f142&&console['error'](_0x53c215(0xeb)+_0x2613fc));const _0xe117bf=await withSpinner(_0x53c215(0x9c)+_0x23eadb+_0x53c215(0xc4),()=>_0x19185a['segment'][_0x53c215(0xa2)](_0x23eadb),{'verbose':_0x357875[_0x53c215(0xf0)]}),_0x2e7129=_0xe117bf[_0x53c215(0x109)],{parentSegmentResult:_0x1ab5e7,segmentsResult:_0x43d6f3,foldersResult:_0x5de8ed,journeysWithDetailsResult:_0x3f02f8,userMaps:_0x465ccf}=await withSpinner(_0x53c215(0xd2),async()=>{const _0x15e2a0=_0x53c215,[_0x3cae78,_0x212850,_0x14a32a,_0x27de00,_0x2944f1]=await Promise[_0x15e2a0(0x119)]([_0x19185a['segment'][_0x15e2a0(0xe2)](_0x2e7129),_0x19185a[_0x15e2a0(0xbb)]['listSegments'](_0x2e7129),_0x19185a[_0x15e2a0(0xbb)]['listFolders'](_0x2e7129),_0x19185a['journey']['listJourneysWithDetailsFromParentSegment'](_0x2e7129,{'includeAllVersions':!![]}),_0x19185a[_0x15e2a0(0xe4)][_0x15e2a0(0x108)]()]);return{'parentSegmentResult':_0x3cae78,'segmentsResult':_0x212850,'foldersResult':_0x14a32a,'journeysWithDetailsResult':_0x27de00,'userMaps':_0x2944f1};},{'verbose':_0x357875[_0x53c215(0xf0)]})[_0x53c215(0xe7)](_0x3477d8=>_0x3477d8[_0x53c215(0x109)]),_0x28cbae=_0x1ab5e7,_0x5628b6=extractRootFolderId(_0x28cbae),_0x30fd11=_0x43d6f3,_0x41f328=_0x5de8ed,{journeys:_0xca9fc,activationStepsById:_0x3f00a4}=_0x3f02f8,_0x59d085=new Map(_0xca9fc['map'](_0x29b7d3=>[_0x29b7d3['id'],_0x29b7d3])),_0x48d2f3=_0xca9fc['map'](_0x2bda9a=>({'id':_0x2bda9a['id'],'name':_0x2bda9a[_0x53c215(0x9f)][_0x53c215(0x114)],'journeyBundleName':_0x2bda9a[_0x53c215(0x9f)][_0x53c215(0xd3)]||'','journeyBundleId':_0x2bda9a[_0x53c215(0x9f)][_0x53c215(0xed)]||'','versionNumber':_0x2bda9a[_0x53c215(0x9f)][_0x53c215(0x131)],'description':_0x2bda9a['attributes'][_0x53c215(0x94)],'state':_0x2bda9a[_0x53c215(0x9f)][_0x53c215(0xac)],'paused':_0x2bda9a['attributes'][_0x53c215(0x111)],'audienceId':_0x2bda9a[_0x53c215(0x9f)][_0x53c215(0x11d)],'folderId':_0x2bda9a[_0x53c215(0xfc)]?.[_0x53c215(0x10b)]?.[_0x53c215(0x109)]?.['id'],'createdAt':_0x2bda9a[_0x53c215(0x9f)][_0x53c215(0xe0)],'updatedAt':_0x2bda9a[_0x53c215(0x9f)][_0x53c215(0xf1)]})),{emailToId:_0x21a1fc,idToEmail:_0x591757}=_0x465ccf,_0x265064=await withSpinner('Fetching\x20connections\x20for\x20name\x20resolution...',async()=>{const _0x425f41=_0x53c215,_0x25c1b4=await _0x19185a[_0x425f41(0xc0)][_0x425f41(0x126)]();return buildConnectionMaps(_0x25c1b4);},{'verbose':_0x357875['verbose']})['then'](_0x2b45e6=>_0x2b45e6[_0x53c215(0x109)]),_0x26d8aa=_0x265064['nameToId'],_0x29128d=_0x265064[_0x53c215(0x133)],_0x215b8b=_0x265064[_0x53c215(0xea)],_0x1ce3d9={'emailToIdMap':_0x21a1fc,'connectionNameToIdMap':_0x26d8aa,'connectionNameToTypeMap':_0x215b8b,'getSchema':_0x3993ea=>_0x19185a[_0x53c215(0xc0)][_0x53c215(0xe5)](_0x3993ea)};let {pathToId:_0x5c4c14,idToPath:_0x4e476b}=buildFolderMaps(_0x41f328);const _0xad9031=buildSegmentLookupMap(_0x30fd11,_0x4e476b),_0xe605eb=buildSegmentNameToIdMap(_0x30fd11),_0x19307b=buildJourneyBundleLookupMap(_0x48d2f3,_0x4e476b);let _0x461e8e;if(_0x2f2571){if(!_0x2f2571['endsWith'](_0x53c215(0xc5))&&!_0x2f2571[_0x53c215(0xd7)](_0x53c215(0x104)))return console['error'](a39_0x1bc6de[_0x53c215(0xbc)](_0x53c215(0x136)+_0x2f2571+'\x0a')),0x1;_0x461e8e=[_0x2f2571];}else _0x461e8e=findYamlFiles(_0x4fcdc2);if(_0x461e8e[_0x53c215(0xbd)]===0x0)return console[_0x53c215(0xc9)](a39_0x1bc6de[_0x53c215(0xbc)]('Error:\x20No\x20YAML\x20files\x20found\x20in\x20'+_0x4fcdc2+'\x0a')),console[_0x53c215(0xc9)](a39_0x1bc6de[_0x53c215(0xfd)](_0x53c215(0xee))),0x1;let _0x404a7f,_0x1437b1;try{const _0x404024=parseAndClassifyYamlFiles(_0x461e8e,_0x4fcdc2,{'skipSegments':_0x357875[_0x53c215(0xcc)]});_0x404a7f=_0x404024[_0x53c215(0xf4)],_0x1437b1=_0x404024['journeys'];const _0x4567cb=validateParsedFiles(_0x404024,_0x4fcdc2);if(_0x4567cb[_0x53c215(0xbd)]>0x0)return console[_0x53c215(0xc9)](a39_0x1bc6de['red']('\x0aValidation\x20failed:')),console[_0x53c215(0xc9)](formatValidationErrors(_0x4567cb)),console[_0x53c215(0xc9)](a39_0x1bc6de[_0x53c215(0xc8)](_0x53c215(0x115))),0x1;}catch(_0x366724){return console[_0x53c215(0xc9)](a39_0x1bc6de[_0x53c215(0xbc)](_0x53c215(0x10e)+(_0x366724 instanceof Error?_0x366724['message']:_0x366724))),0x1;}if(_0x404a7f['length']===0x0&&_0x1437b1[_0x53c215(0xbd)]===0x0){const _0x1194b7=_0x357875[_0x53c215(0xcc)]?_0x53c215(0xf5):_0x53c215(0x12a);return console[_0x53c215(0xc9)](a39_0x1bc6de['yellow']('No\x20'+_0x1194b7+_0x53c215(0x12c))),0x0;}const _0x44f9bd=new Map();_0x30fd11[_0x53c215(0xbd)]>0x0&&!_0x357875[_0x53c215(0xcc)]&&await withSpinner('Fetching\x20existing\x20activations...',async()=>{await batchAsync(_0x30fd11,async _0x43cf08=>{const _0x3fe1e8=a39_0x47dc,_0x3067ab=await _0x19185a['segment'][_0x3fe1e8(0xfb)](_0x2e7129,_0x43cf08['id']);_0x44f9bd[_0x3fe1e8(0xdc)](_0x43cf08['id'],_0x3067ab);});},{'verbose':_0x357875[_0x53c215(0xf0)]});const {segmentFiles:_0x15aefc,foldersToCreate:_0xf77fdc}=await prepareSegmentFiles(_0x404a7f,{'segmentByFolderAndName':_0xad9031,'activationsBySegmentId':_0x44f9bd,'folderPathToId':_0x5c4c14,'idToEmailMap':_0x591757,'connectionIdToNameMap':_0x29128d},_0x1ce3d9,_0x57f142,_0x2613fc),_0x3fdef6=_0x2f2571?[]:findSegmentsToDelete(_0x30fd11,_0x404a7f[_0x53c215(0x11f)](({yamlConfig:_0x1307f2,folderPath:_0x1f2468})=>({'yamlConfig':_0x1307f2,'folderPath':resolveTDFolderPath(_0x1f2468,_0x57f142,_0x2613fc)})),_0x4e476b,_0x2613fc,_0x57f142),{journeyFiles:_0x45945b,foldersToCreate:_0x479c5e}=await withProgressSpinner(_0x53c215(0xad),async _0x3bdce5=>prepareJourneyFiles(_0x1437b1,{'fetchJourney':async _0x50b367=>_0x19185a[_0x53c215(0xf5)][_0x53c215(0x92)](_0x50b367[_0x53c215(0xdf)]),'journeyBundlesByFolderAndName':_0x19307b,'folderPathToId':_0x5c4c14,'idToEmailMap':_0x591757,'connectionIdToNameMap':_0x29128d,'existingSegments':_0x30fd11,'parentId':_0x2e7129,'deps':_0x19185a,'progress':{'update':_0x5521e3=>{const _0x60a45c=_0x53c215;_0x3bdce5[_0x60a45c(0x122)](_0x5521e3),_0x357875[_0x60a45c(0xf0)]&&console['error']('\x20\x20'+_0x5521e3);}},'journeyById':_0x59d085,'activationStepsById':_0x3f00a4},_0x57f142,_0x2613fc),{'verbose':_0x357875[_0x53c215(0xf0)]})['then'](_0x4e6873=>_0x4e6873[_0x53c215(0x109)]);for(const _0x7d1275 of _0x479c5e){_0xf77fdc[_0x53c215(0x116)](_0x7d1275);}const _0x2e474c=_0x2f2571?[]:findJourneysToDelete(_0x48d2f3,_0x1437b1[_0x53c215(0x11f)](({yamlConfig:_0xe53560,folderPath:_0x5ec383})=>({'yamlConfig':_0xe53560,'folderPath':resolveTDFolderPath(_0x5ec383,_0x57f142,_0x2613fc)})),_0x4e476b,_0x2613fc,_0x57f142),_0x3b49b6=calculatePushStats(_0x15aefc,_0x45945b,_0xf77fdc,_0x3fdef6,_0x2e474c,!!_0x357875[_0x53c215(0xc2)],!!_0x357875[_0x53c215(0xcc)]),_0x2aa937=_0x3b49b6[_0x53c215(0xf4)][_0x53c215(0xbe)],_0x5c7752=_0x3b49b6['segments'][_0x53c215(0xa7)],_0x2db4e0=_0x3b49b6[_0x53c215(0xf4)][_0x53c215(0xf9)],_0x2c1768=_0x3b49b6['segments']['toDelete'],_0x5c80b7=_0x3b49b6['folders'][_0x53c215(0xdd)],_0x249b48=_0x3b49b6['journeys'][_0x53c215(0xbe)],_0x24e8c3=_0x3b49b6[_0x53c215(0x105)][_0x53c215(0xa7)],_0x291fab=_0x3b49b6[_0x53c215(0x105)][_0x53c215(0xf9)],_0x4c27ff=_0x3b49b6[_0x53c215(0x105)][_0x53c215(0x12f)],_0x545b18=_0x3b49b6[_0x53c215(0xaf)][_0x53c215(0x119)],_0x32aa56=_0x3b49b6[_0x53c215(0xaf)][_0x53c215(0xdd)],_0x6c8142=_0x3b49b6['activations'][_0x53c215(0x98)],_0x120469=_0x3b49b6[_0x53c215(0xaf)][_0x53c215(0x12f)];console[_0x53c215(0xc9)](_0x53c215(0x123)+_0x23eadb+'\x27:');_0x5c80b7[_0x53c215(0xbd)]>0x0&&console[_0x53c215(0xc9)]('\x20\x20'+a39_0x1bc6de['blue']('πŸ“\x20'+_0x5c80b7[_0x53c215(0xbd)]+_0x53c215(0xd5)));if(!_0x357875[_0x53c215(0xcc)]){console[_0x53c215(0xc9)]('\x20\x20πŸ“Š\x20Segments:'),console[_0x53c215(0xc9)]('\x20\x20\x20\x20'+a39_0x1bc6de[_0x53c215(0x9d)]('+\x20'+_0x2aa937[_0x53c215(0xbd)]+'\x20new')),console[_0x53c215(0xc9)](_0x53c215(0x124)+a39_0x1bc6de[_0x53c215(0xc8)]('~\x20'+_0x5c7752['length']+_0x53c215(0xb8)));if(_0x2c1768['length']>0x0)console[_0x53c215(0xc9)](_0x53c215(0x124)+a39_0x1bc6de[_0x53c215(0xbc)]('-\x20'+_0x2c1768[_0x53c215(0xbd)]+_0x53c215(0xaa)));else _0x3fdef6[_0x53c215(0xbd)]>0x0&&!_0x357875[_0x53c215(0xc2)]&&console[_0x53c215(0xc9)](_0x53c215(0x124)+a39_0x1bc6de['dim'](_0x3fdef6[_0x53c215(0xbd)]+'\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)'));console['error'](_0x53c215(0x124)+a39_0x1bc6de[_0x53c215(0xae)]('=\x20'+_0x2db4e0['length']+'\x20unchanged'));}if(_0x45945b[_0x53c215(0xbd)]>0x0||_0x2e474c[_0x53c215(0xbd)]>0x0){console['error']('\x20\x20πŸ—ΊοΈ\x20\x20Journeys:'),console[_0x53c215(0xc9)](_0x53c215(0x124)+a39_0x1bc6de[_0x53c215(0x9d)]('+\x20'+_0x249b48['length']+_0x53c215(0xa3))),console[_0x53c215(0xc9)](_0x53c215(0x124)+a39_0x1bc6de['yellow']('~\x20'+_0x24e8c3['length']+_0x53c215(0xb8)));if(_0x4c27ff['length']>0x0)console[_0x53c215(0xc9)](_0x53c215(0x124)+a39_0x1bc6de['red']('-\x20'+_0x4c27ff[_0x53c215(0xbd)]+_0x53c215(0xaa)));else _0x2e474c[_0x53c215(0xbd)]>0x0&&!_0x357875['delete']&&console['error']('\x20\x20\x20\x20'+a39_0x1bc6de[_0x53c215(0xae)](_0x2e474c['length']+_0x53c215(0xcb)));console[_0x53c215(0xc9)](_0x53c215(0x124)+a39_0x1bc6de[_0x53c215(0xae)]('=\x20'+_0x291fab[_0x53c215(0xbd)]+_0x53c215(0x110)));}_0x545b18[_0x53c215(0xbd)]>0x0&&!_0x357875[_0x53c215(0xcc)]&&(console[_0x53c215(0xc9)](''),console[_0x53c215(0xc9)](_0x53c215(0xda)),_0x32aa56['length']>0x0&&console['error']('\x20\x20\x20\x20'+a39_0x1bc6de[_0x53c215(0x9d)]('+\x20'+_0x32aa56['length']+_0x53c215(0x113))),_0x6c8142[_0x53c215(0xbd)]>0x0&&console[_0x53c215(0xc9)](_0x53c215(0x124)+a39_0x1bc6de[_0x53c215(0xc8)]('~\x20'+_0x6c8142['length']+'\x20to\x20update')),_0x120469[_0x53c215(0xbd)]>0x0&&console[_0x53c215(0xc9)](_0x53c215(0x124)+a39_0x1bc6de[_0x53c215(0xbc)]('-\x20'+_0x120469[_0x53c215(0xbd)]+_0x53c215(0xaa))));console['error'](_0x53c215(0x120)+a39_0x1bc6de[_0x53c215(0xfd)](_0x4fcdc2)+'\x0a');if(_0x5c80b7[_0x53c215(0xbd)]>0x0){console[_0x53c215(0xc9)](_0x53c215(0x12d));for(const _0x25dd71 of _0x5c80b7){console[_0x53c215(0xc9)]('\x20\x20'+a39_0x1bc6de[_0x53c215(0x101)]('+')+'\x20'+_0x25dd71);}console[_0x53c215(0xc9)]('');}if(_0x2aa937[_0x53c215(0xbd)]>0x0&&!_0x357875[_0x53c215(0xcc)])for(const _0x3797a2 of _0x2aa937){const _0x27b328=_0x3797a2[_0x53c215(0xe6)]?_0x3797a2[_0x53c215(0xe6)]+'/'+_0x3797a2['yamlConfig'][_0x53c215(0x114)]:_0x3797a2[_0x53c215(0xb9)][_0x53c215(0x114)],_0x4f1f82=_0x3797a2[_0x53c215(0xb9)][_0x53c215(0xaf)]?.[_0x53c215(0xbd)]||0x0,_0x35a5d4=_0x4f1f82>0x0?a39_0x1bc6de[_0x53c215(0xae)]('\x20['+_0x4f1f82+_0x53c215(0xd0)):'';console[_0x53c215(0xc9)]('\x0a'+a39_0x1bc6de[_0x53c215(0x9d)](_0x53c215(0xde))+'\x20'+_0x27b328+_0x35a5d4),console['error']('─'[_0x53c215(0xe8)](0x3c)),_0x3797a2[_0x53c215(0xec)]&&console[_0x53c215(0xc9)](_0x3797a2[_0x53c215(0xec)]),console[_0x53c215(0xc9)]('─'[_0x53c215(0xe8)](0x3c));}if(_0x2c1768[_0x53c215(0xbd)]>0x0&&!_0x357875['journeysOnly'])for(const _0x2bce7f of _0x2c1768){const _0x28ab1c=_0x2bce7f[_0x53c215(0xab)]?_0x4e476b[_0x53c215(0xc6)](_0x2bce7f[_0x53c215(0xab)][_0x53c215(0xbf)]())||'':'',_0x135d36=_0x28ab1c?_0x28ab1c+'/'+_0x2bce7f['name']:_0x2bce7f[_0x53c215(0x114)],_0x4a371b=_0x44f9bd['get'](_0x2bce7f['id'])||[],_0x5491ab=_0x4a371b[_0x53c215(0xbd)]>0x0?a39_0x1bc6de['dim']('\x20['+_0x4a371b[_0x53c215(0xbd)]+_0x53c215(0xd0)):'';console[_0x53c215(0xc9)]('\x0a'+a39_0x1bc6de[_0x53c215(0xbc)](_0x53c215(0xf2))+'\x20'+_0x135d36+_0x5491ab),console[_0x53c215(0xc9)]('─'[_0x53c215(0xe8)](0x3c));const _0x13342d=segmentWithActivationsToYaml(_0x2bce7f,_0x4a371b,undefined,_0x591757,_0x29128d),_0x52cf70=segmentToYamlString(_0x13342d),_0x10e560=generateDiff(_0x52cf70,'');console[_0x53c215(0xc9)](formatDiffWithColors(_0x10e560)),console[_0x53c215(0xc9)]('─'['repeat'](0x3c));}const _0x557c7d=_0x15aefc[_0x53c215(0x11a)](_0x22105e=>!_0x22105e[_0x53c215(0x9a)]&&_0x22105e[_0x53c215(0xec)]);if(_0x557c7d['length']>0x0&&!_0x357875[_0x53c215(0xcc)])for(const _0x446ce1 of _0x557c7d){const _0x29734d=_0x446ce1[_0x53c215(0xe6)]?_0x446ce1[_0x53c215(0xe6)]+'/'+_0x446ce1[_0x53c215(0xb9)][_0x53c215(0x114)]:_0x446ce1[_0x53c215(0xb9)][_0x53c215(0x114)];console['error']('\x0a'+a39_0x1bc6de[_0x53c215(0xc8)](_0x53c215(0x118))+'\x20'+_0x29734d),console[_0x53c215(0xc9)]('─'[_0x53c215(0xe8)](0x3c)),console[_0x53c215(0xc9)](_0x446ce1['diff']),console['error']('─'['repeat'](0x3c));}if(_0x249b48[_0x53c215(0xbd)]>0x0)for(const _0x2c3876 of _0x249b48){const _0x4be5e6=_0x2c3876['folderPath']?_0x2c3876[_0x53c215(0xe6)]+'/'+_0x2c3876[_0x53c215(0xb9)]['name']:_0x2c3876[_0x53c215(0xb9)][_0x53c215(0x114)];console[_0x53c215(0xc9)]('\x0a'+a39_0x1bc6de['green'](_0x53c215(0x112))+'\x20'+_0x4be5e6),console[_0x53c215(0xc9)]('─'[_0x53c215(0xe8)](0x3c)),_0x2c3876[_0x53c215(0xec)]&&console['error'](_0x2c3876['diff']),console[_0x53c215(0xc9)]('─'['repeat'](0x3c));}const _0x590428=_0x45945b[_0x53c215(0x11a)](_0x4233ad=>!_0x4233ad[_0x53c215(0x9a)]&&_0x4233ad['diff']);if(_0x590428['length']>0x0)for(const _0x280388 of _0x590428){const _0x175942=_0x280388['folderPath']?_0x280388[_0x53c215(0xe6)]+'/'+_0x280388[_0x53c215(0xb9)][_0x53c215(0x114)]:_0x280388[_0x53c215(0xb9)][_0x53c215(0x114)];console[_0x53c215(0xc9)]('\x0a'+a39_0x1bc6de['yellow'](_0x53c215(0x100))+'\x20'+_0x175942),console[_0x53c215(0xc9)]('─'[_0x53c215(0xe8)](0x3c)),console[_0x53c215(0xc9)](_0x280388[_0x53c215(0xec)]),console[_0x53c215(0xc9)]('─'['repeat'](0x3c));}if(_0x4c27ff[_0x53c215(0xbd)]>0x0)for(const _0x5132ca of _0x4c27ff){const _0x599ca0=_0x5132ca[_0x53c215(0x9e)]?_0x4e476b[_0x53c215(0xc6)](_0x5132ca[_0x53c215(0x9e)])||'':'',_0x3ff062=_0x599ca0?_0x599ca0+'/'+_0x5132ca[_0x53c215(0xd3)]:_0x5132ca[_0x53c215(0xd3)];console[_0x53c215(0xc9)]('\x0a'+a39_0x1bc6de['red']('Delete\x20journey:')+'\x20'+_0x3ff062),console[_0x53c215(0xc9)]('─'['repeat'](0x3c)),console[_0x53c215(0xc9)](a39_0x1bc6de[_0x53c215(0xbc)](_0x53c215(0xef))),console[_0x53c215(0xc9)]('─'[_0x53c215(0xe8)](0x3c));}if(_0x357875[_0x53c215(0x117)])return console[_0x53c215(0xc9)](a39_0x1bc6de[_0x53c215(0xc8)](_0x53c215(0x129))),0x0;const _0x506d97=_0x357875[_0x53c215(0xcc)]?![]:_0x2aa937[_0x53c215(0xbd)]>0x0||_0x5c7752[_0x53c215(0xbd)]>0x0||_0x2c1768[_0x53c215(0xbd)]>0x0,_0x5a276b=_0x249b48['length']>0x0||_0x24e8c3[_0x53c215(0xbd)]>0x0||_0x4c27ff[_0x53c215(0xbd)]>0x0,_0x5cca84=_0x357875[_0x53c215(0xcc)]?![]:_0x545b18[_0x53c215(0xbd)]>0x0,_0x5f27e5=_0x5c80b7[_0x53c215(0xbd)]>0x0;if(!_0x506d97&&!_0x5a276b&&!_0x5cca84&&!_0x5f27e5){const _0x2e0ddb=_0x357875[_0x53c215(0xcc)]?_0x53c215(0xb2):_0x53c215(0xa8);console[_0x53c215(0xc9)](a39_0x1bc6de[_0x53c215(0x9d)](_0x2e0ddb));if(_0x2f2571&&_0x2db4e0[_0x53c215(0xbd)]===0x1){const _0x5e942d=_0x2db4e0[0x0];if(_0x5e942d[_0x53c215(0x10f)]?.['id']){const _0x115b28=getConsoleNextUrl(_0x357875['site'],_0x53c215(0xe3)+_0x2e7129+'/e/'+_0x5e942d[_0x53c215(0x10f)]['id']+'/sb/da/esr');console[_0x53c215(0xc9)](_0x53c215(0xfe)+a39_0x1bc6de[_0x53c215(0xfd)](_0x115b28));}}if(_0x2f2571&&_0x291fab['length']===0x1){const _0x5ad7b6=_0x291fab[0x0];if(_0x5ad7b6[_0x53c215(0x106)]?.['id']){const _0x4d763b=getConsoleNextUrl(_0x357875[_0x53c215(0xa5)],'/app/ps/'+_0x2e7129+_0x53c215(0x11e)+_0x5ad7b6[_0x53c215(0x106)]['id']+_0x53c215(0xf7));console[_0x53c215(0xc9)]('\x20\x20'+a39_0x1bc6de[_0x53c215(0xfd)](_0x4d763b));}}return 0x0;}const _0x5a9dfc=_0x357875[_0x53c215(0xcc)]?_0x249b48[_0x53c215(0xbd)]+_0x24e8c3[_0x53c215(0xbd)]+_0x4c27ff[_0x53c215(0xbd)]+_0x5c80b7[_0x53c215(0xbd)]:_0x2aa937['length']+_0x5c7752[_0x53c215(0xbd)]+_0x2c1768['length']+_0x249b48[_0x53c215(0xbd)]+_0x24e8c3[_0x53c215(0xbd)]+_0x4c27ff['length']+_0x5c80b7['length']+_0x545b18[_0x53c215(0xbd)];if(!_0x357875[_0x53c215(0x10d)]&&_0x5a9dfc>0x0){if(!isInteractive())return console[_0x53c215(0xc9)](a39_0x1bc6de[_0x53c215(0xbc)](_0x53c215(0x96)),_0x53c215(0x11c)),console['error'](a39_0x1bc6de[_0x53c215(0xae)](_0x53c215(0xb1))),0x1;const _0x1e28ae=await confirmKey(_0x53c215(0xd6)+_0x5a9dfc+_0x53c215(0x125));if(!_0x1e28ae)return console['error'](a39_0x1bc6de[_0x53c215(0xc8)](_0x53c215(0x11b))),0x1;}const _0x49620={'withProgress':async(_0x3f9ecd,_0x253c49)=>{const _0xf86a65=_0x53c215,_0x19dbd5=await withSpinner(_0x3f9ecd,_0x253c49,{'verbose':_0x357875[_0xf86a65(0xf0)]});return{'data':_0x19dbd5[_0xf86a65(0x109)]};},'logInfo':_0x50b699=>console[_0x53c215(0xc9)](a39_0x1bc6de[_0x53c215(0x101)]('βœ”\x20'+_0x50b699)),'logSuccess':_0x226f7a=>console[_0x53c215(0xc9)](a39_0x1bc6de[_0x53c215(0x9d)]('βœ”\x20'+_0x226f7a)),'logWarning':_0x40d564=>console[_0x53c215(0xc9)](a39_0x1bc6de[_0x53c215(0xc8)]('⚠\x20'+_0x40d564)),'logDeleted':_0x2737c7=>console['error'](a39_0x1bc6de[_0x53c215(0xbc)]('βœ”\x20'+_0x2737c7))},_0x3f04f0={'segment':_0x19185a[_0x53c215(0xbb)],'journey':_0x19185a['journey'],'user':_0x19185a[_0x53c215(0xe4)],'connection':_0x19185a[_0x53c215(0xc0)]};_0x5c80b7[_0x53c215(0xbd)]>0x0&&(_0x5c4c14=await executePushFolders(_0x3f04f0,_0x5c80b7,_0x5c4c14,{'parentId':_0x2e7129},_0x49620));const _0x5652e1={'rootFolderId':_0x5628b6,'folderPathToId':_0x5c4c14,'folderIdToPath':_0x4e476b,'segmentNameToId':_0xe605eb,'activationsBySegmentId':_0x44f9bd,'emailToIdMap':_0x21a1fc,'idToEmailMap':_0x591757,'connectionNameToIdMap':_0x265064[_0x53c215(0xa6)],'connectionIdToNameMap':_0x265064[_0x53c215(0x133)],'connectionNameToTypeMap':_0x215b8b},_0x254684=await executePushSegments(_0x3f04f0,_0x357875[_0x53c215(0xcc)]?[]:_0x15aefc,_0x5652e1,{'parentId':_0x2e7129},_0x49620),_0x1d38e2=_0x254684[_0x53c215(0x135)],_0x253f62=_0x254684[_0x53c215(0x127)],_0x2ca960=_0x254684[_0x53c215(0xaf)][_0x53c215(0x135)],_0x5decff=_0x254684['activations'][_0x53c215(0x127)],_0x256c8c=_0x254684[_0x53c215(0xaf)][_0x53c215(0x99)];let _0x163007;if(_0x2f2571&&_0x15aefc[_0x53c215(0xbd)]===0x1){const _0x392aac=_0x15aefc[0x0];_0x163007=_0x392aac[_0x53c215(0x10f)]?.['id']??_0x254684[_0x53c215(0xcf)][_0x53c215(0xc6)](_0x392aac[_0x53c215(0xb9)]['name']);}const _0x100e2f=await executePushSegmentDeletions(_0x3f04f0,_0x357875[_0x53c215(0xcc)]?[]:_0x2c1768,_0x49620);let _0x244e1f=0x0,_0x139c54=0x0,_0x30c192=0x0;const _0x3bcf58=new Map(_0xe605eb);for(const [_0x46bbe3,_0x19ad4f]of _0x254684[_0x53c215(0xcf)]){_0x3bcf58[_0x53c215(0xdc)](_0x46bbe3,_0x19ad4f);}if(_0x45945b[_0x53c215(0xbd)]>0x0){const _0x2c9f94={..._0x5652e1,'segmentNameToId':_0x3bcf58,'existingSegments':_0x30fd11,'activationContext':_0x1ce3d9},_0x3e202e=await executePushJourneys(_0x3f04f0,_0x45945b,_0x2c9f94,{'parentId':_0x2e7129,'rootFolderId':_0x5628b6,'verbose':_0x357875[_0x53c215(0xf0)]},_0x49620);_0x244e1f=_0x3e202e['created'],_0x139c54=_0x3e202e[_0x53c215(0x127)];if(_0x2f2571&&_0x3e202e[_0x53c215(0xc1)][_0x53c215(0xbd)]===0x1){const _0x18d408=_0x3e202e[_0x53c215(0xc1)][0x0];if(_0x18d408['journeyId']){const _0x465c67=getConsoleNextUrl(_0x357875[_0x53c215(0xa5)],'/app/ps/'+_0x2e7129+'/e/'+_0x18d408[_0x53c215(0xdf)]+_0x53c215(0xf7));console[_0x53c215(0xc9)]('\x20\x20'+a39_0x1bc6de[_0x53c215(0xfd)](_0x465c67));}}}for(const _0x282b69 of _0x4c27ff){console[_0x53c215(0xc9)](a39_0x1bc6de['yellow'](_0x53c215(0xc7)+_0x282b69['journeyBundleName'])),_0x30c192++;}const _0x4e2e67=[];if(_0x1d38e2>0x0)_0x4e2e67[_0x53c215(0xd4)](_0x1d38e2+_0x53c215(0xe9));if(_0x253f62>0x0)_0x4e2e67['push'](_0x253f62+'\x20updated');if(_0x100e2f>0x0)_0x4e2e67[_0x53c215(0xd4)](_0x100e2f+_0x53c215(0x102));const _0x1166dd=[];if(_0x244e1f>0x0)_0x1166dd[_0x53c215(0xd4)](_0x244e1f+_0x53c215(0xe9));if(_0x139c54>0x0)_0x1166dd[_0x53c215(0xd4)](_0x139c54+_0x53c215(0xd1));if(_0x30c192>0x0)_0x1166dd['push'](_0x30c192+_0x53c215(0x102));const _0x46ef07=[];if(_0x2ca960>0x0)_0x46ef07['push'](_0x2ca960+'\x20created');if(_0x5decff>0x0)_0x46ef07[_0x53c215(0xd4)](_0x5decff+_0x53c215(0xd1));if(_0x256c8c>0x0)_0x46ef07['push'](_0x256c8c+_0x53c215(0x102));console['error'](a39_0x1bc6de[_0x53c215(0x9d)](_0x53c215(0xca)));_0x4e2e67[_0x53c215(0xbd)]>0x0&&!_0x357875[_0x53c215(0xcc)]&&console[_0x53c215(0xc9)](_0x53c215(0x12e)+_0x4e2e67[_0x53c215(0x97)](',\x20'));_0x1166dd[_0x53c215(0xbd)]>0x0&&console[_0x53c215(0xc9)]('\x20\x20Journeys:\x20'+_0x1166dd[_0x53c215(0x97)](',\x20'));_0x46ef07[_0x53c215(0xbd)]>0x0&&!_0x357875[_0x53c215(0xcc)]&&console[_0x53c215(0xc9)](_0x53c215(0xba)+_0x46ef07[_0x53c215(0x97)](',\x20'));if(_0x163007){const _0x5cb4e1=getConsoleNextUrl(_0x357875[_0x53c215(0xa5)],'/app/ps/'+_0x2e7129+_0x53c215(0x11e)+_0x163007+_0x53c215(0x9b));console['error']('\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20'+a39_0x1bc6de['cyan'](_0x5cb4e1));}return 0x0;}}