@treasuredata/tdx 2026.3.27 β†’ 2026.3.28

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 (222) 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.d.ts.map +1 -1
  5. package/dist/cli.js +1 -1
  6. package/dist/cli.js.map +1 -1
  7. package/dist/commands/activations.js +1 -1
  8. package/dist/commands/agent-command.js +1 -1
  9. package/dist/commands/agent-test-command.js +1 -1
  10. package/dist/commands/api-command.js +1 -1
  11. package/dist/commands/auth-command.js +1 -1
  12. package/dist/commands/auth-login-command.js +1 -1
  13. package/dist/commands/chat-command.js +1 -1
  14. package/dist/commands/claude-command.js +1 -1
  15. package/dist/commands/claude-statusline-command.js +1 -1
  16. package/dist/commands/claude-usage-command.js +1 -1
  17. package/dist/commands/command.js +1 -1
  18. package/dist/commands/connection-command.js +1 -1
  19. package/dist/commands/databases.js +1 -1
  20. package/dist/commands/delivery-command.js +1 -1
  21. package/dist/commands/describe.js +1 -1
  22. package/dist/commands/engage-campaign-pull-command.js +1 -1
  23. package/dist/commands/engage-campaign-push-command.js +1 -1
  24. package/dist/commands/engage-campaign-validate-command.js +1 -1
  25. package/dist/commands/engage-command.js +1 -1
  26. package/dist/commands/engage-template-pull-command.js +1 -1
  27. package/dist/commands/engage-template-push-command.js +1 -1
  28. package/dist/commands/engage-template-validate-command.js +1 -1
  29. package/dist/commands/job-command.js +1 -1
  30. package/dist/commands/journey-command.js +1 -1
  31. package/dist/commands/journey-validate-command.js +1 -1
  32. package/dist/commands/llm-command.js +1 -1
  33. package/dist/commands/mcp-command.js +1 -1
  34. package/dist/commands/parent-segment-command.d.ts +141 -2
  35. package/dist/commands/parent-segment-command.d.ts.map +1 -1
  36. package/dist/commands/parent-segment-command.js +1 -1
  37. package/dist/commands/parent-segment-command.js.map +1 -1
  38. package/dist/commands/policy-command.js +1 -1
  39. package/dist/commands/profile-command.js +1 -1
  40. package/dist/commands/profiles-command.js +1 -1
  41. package/dist/commands/query-command.js +1 -1
  42. package/dist/commands/schedule-command.js +1 -1
  43. package/dist/commands/segment-command.js +1 -1
  44. package/dist/commands/segment-create-command.js +1 -1
  45. package/dist/commands/segment-fields-command.js +1 -1
  46. package/dist/commands/segment-pull-command.js +1 -1
  47. package/dist/commands/segment-push-command.js +1 -1
  48. package/dist/commands/segment-update-command.js +1 -1
  49. package/dist/commands/segment-use-command.js +1 -1
  50. package/dist/commands/segment-validate-command.js +1 -1
  51. package/dist/commands/segments.js +1 -1
  52. package/dist/commands/show.js +1 -1
  53. package/dist/commands/status-command.js +1 -1
  54. package/dist/commands/tables.js +1 -1
  55. package/dist/commands/unset-command.js +1 -1
  56. package/dist/commands/upgrade-command.js +1 -1
  57. package/dist/commands/use-command.js +1 -1
  58. package/dist/commands/user-command.js +1 -1
  59. package/dist/commands/workflow-command.js +1 -1
  60. package/dist/core/auth.js +1 -1
  61. package/dist/core/command-output.js +1 -1
  62. package/dist/core/config.js +1 -1
  63. package/dist/core/connection-cache.js +1 -1
  64. package/dist/core/constants.js +1 -1
  65. package/dist/core/credential-cache.js +1 -1
  66. package/dist/core/global-context.js +1 -1
  67. package/dist/core/keychain.js +1 -1
  68. package/dist/core/oauth-keychain.js +1 -1
  69. package/dist/core/oauth.js +1 -1
  70. package/dist/core/profile.js +1 -1
  71. package/dist/core/project-config.js +1 -1
  72. package/dist/core/session.js +1 -1
  73. package/dist/core/user-cache.js +1 -1
  74. package/dist/core/version.js +1 -1
  75. package/dist/index.js +1 -1
  76. package/dist/mcp/server.js +1 -1
  77. package/dist/mcp/tools/index.js +1 -1
  78. package/dist/mcp/tools/tdx-run.js +1 -1
  79. package/dist/mcp/tools/tdx-search.js +1 -1
  80. package/dist/mcp/utils.js +1 -1
  81. package/dist/proxy/claude-usage-tracker.js +1 -1
  82. package/dist/proxy/passthrough-server.js +1 -1
  83. package/dist/proxy/sse-usage-parser.js +1 -1
  84. package/dist/sdk/agent/agent-config.js +1 -1
  85. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  86. package/dist/sdk/agent/agent-yaml.js +1 -1
  87. package/dist/sdk/agent/test/evaluator.js +1 -1
  88. package/dist/sdk/agent/test/executor.js +1 -1
  89. package/dist/sdk/agent/test/index.js +1 -1
  90. package/dist/sdk/agent/test/output.js +1 -1
  91. package/dist/sdk/agent/test/parser.js +1 -1
  92. package/dist/sdk/agent/tool-target-registry.js +1 -1
  93. package/dist/sdk/api.js +1 -1
  94. package/dist/sdk/client/cdp-api-client.d.ts +29 -1
  95. package/dist/sdk/client/cdp-api-client.d.ts.map +1 -1
  96. package/dist/sdk/client/cdp-api-client.js +1 -1
  97. package/dist/sdk/client/cdp-api-client.js.map +1 -1
  98. package/dist/sdk/client/delivery-api-client.js +1 -1
  99. package/dist/sdk/client/endpoints.js +1 -1
  100. package/dist/sdk/client/engage-api-client.js +1 -1
  101. package/dist/sdk/client/http-client.js +1 -1
  102. package/dist/sdk/client/llm-api-client.js +1 -1
  103. package/dist/sdk/client/oauth-refresh.js +1 -1
  104. package/dist/sdk/client/rate-limiter.js +1 -1
  105. package/dist/sdk/client/td-api-client.js +1 -1
  106. package/dist/sdk/client/trino-api-client.js +1 -1
  107. package/dist/sdk/client/workflow-client.js +1 -1
  108. package/dist/sdk/connection-validator.js +1 -1
  109. package/dist/sdk/connection.js +1 -1
  110. package/dist/sdk/delivery.js +1 -1
  111. package/dist/sdk/engage/campaign-pull.js +1 -1
  112. package/dist/sdk/engage/campaign-push.js +1 -1
  113. package/dist/sdk/engage/campaign-validator.js +1 -1
  114. package/dist/sdk/engage/campaign-yaml.js +1 -1
  115. package/dist/sdk/engage/template-pull.js +1 -1
  116. package/dist/sdk/engage/template-push.js +1 -1
  117. package/dist/sdk/engage/template-validator.js +1 -1
  118. package/dist/sdk/engage/template-yaml.js +1 -1
  119. package/dist/sdk/engage/types/campaign-def.js +1 -1
  120. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  121. package/dist/sdk/engage/types/template-schema.js +1 -1
  122. package/dist/sdk/engage.js +1 -1
  123. package/dist/sdk/errors.js +1 -1
  124. package/dist/sdk/index.js +1 -1
  125. package/dist/sdk/io/index.js +1 -1
  126. package/dist/sdk/io/node-filesystem.js +1 -1
  127. package/dist/sdk/job.js +1 -1
  128. package/dist/sdk/journey.js +1 -1
  129. package/dist/sdk/llm/chat-cache.js +1 -1
  130. package/dist/sdk/llm/index.js +1 -1
  131. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  132. package/dist/sdk/llm/model-factors.js +1 -1
  133. package/dist/sdk/personalization.d.ts +228 -0
  134. package/dist/sdk/personalization.d.ts.map +1 -1
  135. package/dist/sdk/personalization.js +1 -1
  136. package/dist/sdk/personalization.js.map +1 -1
  137. package/dist/sdk/policy.js +1 -1
  138. package/dist/sdk/query/index.js +1 -1
  139. package/dist/sdk/query/sql-parser.js +1 -1
  140. package/dist/sdk/realtime.d.ts +57 -0
  141. package/dist/sdk/realtime.d.ts.map +1 -1
  142. package/dist/sdk/realtime.js +1 -1
  143. package/dist/sdk/realtime.js.map +1 -1
  144. package/dist/sdk/schedule.js +1 -1
  145. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  146. package/dist/sdk/segment/fields-display.js +1 -1
  147. package/dist/sdk/segment/file-discovery.js +1 -1
  148. package/dist/sdk/segment/journey-utils.js +1 -1
  149. package/dist/sdk/segment/journey-validator.js +1 -1
  150. package/dist/sdk/segment/journey-yaml.js +1 -1
  151. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  152. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  153. package/dist/sdk/segment/pull-workflow.js +1 -1
  154. package/dist/sdk/segment/push-recovery.js +1 -1
  155. package/dist/sdk/segment/push-workflow.js +1 -1
  156. package/dist/sdk/segment/resolution-context.js +1 -1
  157. package/dist/sdk/segment/segment-path-parser.js +1 -1
  158. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  159. package/dist/sdk/segment/segment-validator.js +1 -1
  160. package/dist/sdk/segment/target-resolution.js +1 -1
  161. package/dist/sdk/segment/tdx-config.js +1 -1
  162. package/dist/sdk/segment/types/activation-schema.js +1 -1
  163. package/dist/sdk/segment/types/journey-def.js +1 -1
  164. package/dist/sdk/segment/types/journey-schema.js +1 -1
  165. package/dist/sdk/segment/types/segment-def.js +1 -1
  166. package/dist/sdk/segment/types/segment-schema.js +1 -1
  167. package/dist/sdk/segment/validate-files.js +1 -1
  168. package/dist/sdk/segment/yaml-validator.js +1 -1
  169. package/dist/sdk/segment.js +1 -1
  170. package/dist/sdk/types/cdp.d.ts +76 -0
  171. package/dist/sdk/types/cdp.d.ts.map +1 -1
  172. package/dist/sdk/types/index.d.ts +1 -1
  173. package/dist/sdk/types/index.d.ts.map +1 -1
  174. package/dist/sdk/types/index.js +1 -1
  175. package/dist/sdk/types/index.js.map +1 -1
  176. package/dist/sdk/types/progress.js +1 -1
  177. package/dist/sdk/user.js +1 -1
  178. package/dist/sdk/util/format-detector.js +1 -1
  179. package/dist/sdk/util/formatters.js +1 -1
  180. package/dist/sdk/util/index.js +1 -1
  181. package/dist/sdk/util/paginate.js +1 -1
  182. package/dist/sdk/util/tree-formatter.js +1 -1
  183. package/dist/sdk/workflow/archive-validation.js +1 -1
  184. package/dist/sdk/workflow/clone-workflow.js +1 -1
  185. package/dist/sdk/workflow/index.js +1 -1
  186. package/dist/sdk/workflow/pull-workflow.js +1 -1
  187. package/dist/sdk/workflow/push-workflow.js +1 -1
  188. package/dist/sdk/workflow/tdx-config.js +1 -1
  189. package/dist/sdk/workflow/workflow-utils.js +1 -1
  190. package/dist/test-utils/command-runner.js +1 -1
  191. package/dist/test-utils/factories.js +1 -1
  192. package/dist/test-utils/fixtures.js +1 -1
  193. package/dist/test-utils/http-mock.js +1 -1
  194. package/dist/test-utils/index.js +1 -1
  195. package/dist/utils/async.js +1 -1
  196. package/dist/utils/colors.js +1 -1
  197. package/dist/utils/diff.js +1 -1
  198. package/dist/utils/file-permissions.js +1 -1
  199. package/dist/utils/file-reader.js +1 -1
  200. package/dist/utils/github-releases.js +1 -1
  201. package/dist/utils/global-cache.js +1 -1
  202. package/dist/utils/json-loader.js +1 -1
  203. package/dist/utils/local-cache.js +1 -1
  204. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  205. package/dist/utils/logger/formatters/index.js +1 -1
  206. package/dist/utils/logger/handlers/console-handler.js +1 -1
  207. package/dist/utils/logger/handlers/file-handler.js +1 -1
  208. package/dist/utils/logger/handlers/index.js +1 -1
  209. package/dist/utils/logger/handlers/null-handler.js +1 -1
  210. package/dist/utils/logger/index.js +1 -1
  211. package/dist/utils/logger/logger.js +1 -1
  212. package/dist/utils/logger/types.js +1 -1
  213. package/dist/utils/option-validation.js +1 -1
  214. package/dist/utils/process.js +1 -1
  215. package/dist/utils/prompt.js +1 -1
  216. package/dist/utils/spinner.js +1 -1
  217. package/dist/utils/sse-parser.js +1 -1
  218. package/dist/utils/string-utils.js +1 -1
  219. package/dist/utils/table-ref-parser.js +1 -1
  220. package/dist/utils/tdx-logger.js +1 -1
  221. package/dist/utils/version-check.js +1 -1
  222. package/package.json +1 -1
@@ -1 +1 @@
1
- const a35_0x130e8a=a35_0x5b91;(function(_0x41f942,_0x2fdf5a){const _0x20a34e=a35_0x5b91,_0x38496d=_0x41f942();while(!![]){try{const _0x16dd0e=parseInt(_0x20a34e(0x22f))/0x1+-parseInt(_0x20a34e(0x228))/0x2+parseInt(_0x20a34e(0x248))/0x3+parseInt(_0x20a34e(0x247))/0x4+parseInt(_0x20a34e(0x275))/0x5*(parseInt(_0x20a34e(0x242))/0x6)+parseInt(_0x20a34e(0x26f))/0x7*(-parseInt(_0x20a34e(0x1f9))/0x8)+-parseInt(_0x20a34e(0x25e))/0x9;if(_0x16dd0e===_0x2fdf5a)break;else _0x38496d['push'](_0x38496d['shift']());}catch(_0x20a25f){_0x38496d['push'](_0x38496d['shift']());}}}(a35_0x3614,0xa58ab));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput,writeOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{confirm}from'../utils/prompt.js';import{readFileSync}from'fs';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{hyperlink}from'../sdk/util/formatters.js';import a35_0x296d83 from'chalk';function a35_0x5b91(_0x49494c,_0x4b2303){_0x49494c=_0x49494c-0x1f0;const _0x3614c0=a35_0x3614();let _0x5b9181=_0x3614c0[_0x49494c];return _0x5b9181;}function formatRelativeTime(_0x21ccf1){const _0xf09d6=a35_0x5b91,_0x19fb44=new Date(_0x21ccf1),_0x40a272=new Date(),_0x14a62e=_0x19fb44[_0xf09d6(0x23f)]()-_0x40a272[_0xf09d6(0x23f)](),_0x1d0052=Math[_0xf09d6(0x264)](_0x14a62e)/0x3e8,_0xeedeb=_0x14a62e<0x0;if(_0x1d0052<0x3c)return _0xeedeb?_0xf09d6(0x23e):_0xf09d6(0x270);else{if(_0x1d0052<0xe10){const _0x546f4f=Math[_0xf09d6(0x23c)](_0x1d0052/0x3c);return _0xeedeb?_0x546f4f+_0xf09d6(0x268):_0xf09d6(0x230)+_0x546f4f+'m';}else{if(_0x1d0052<0x15180){const _0x47f322=Math[_0xf09d6(0x23c)](_0x1d0052/0xe10);return _0xeedeb?_0x47f322+_0xf09d6(0x22e):'in\x20'+_0x47f322+'h';}else{if(_0x1d0052<0x93a80){const _0x4e762a=Math[_0xf09d6(0x23c)](_0x1d0052/0x15180);return _0xeedeb?_0x4e762a+_0xf09d6(0x255):'in\x20'+_0x4e762a+'d';}else return _0x19fb44[_0xf09d6(0x1f0)]();}}}}export class ScheduleListCommand extends BaseCommand{[a35_0x130e8a(0x214)]=a35_0x130e8a(0x235);['description']=a35_0x130e8a(0x234);async['execute'](_0x4b7717){const _0x7c3f29=a35_0x130e8a,{options:_0x175826,args:_0x3bab11,tdx:_0x10fdd8}=_0x4b7717,_0x5d44ae=resolveLimit(_0x175826['limit'],DEFAULT_DISPLAY_LIMIT),_0x3d486d=_0x3bab11[0x0],_0x293c49=_0x3d486d?_0x7c3f29(0x240)+_0x3d486d+_0x7c3f29(0x204):'Listing\x20scheduled\x20queries...',_0x243fd8=await withSpinner(_0x293c49,()=>_0x10fdd8['schedules']['listQueries']({'limit':_0x5d44ae,'scheduled':!![],'pattern':_0x3d486d}),{'verbose':_0x175826[_0x7c3f29(0x212)]}),_0x18e49f=_0x243fd8[_0x7c3f29(0x206)][_0x7c3f29(0x21b)],_0x36fb59=_0x243fd8['data'][_0x7c3f29(0x26b)][_0x7c3f29(0x202)],_0x52381c=_0x3d486d?'\x20matching\x20\x22'+_0x3d486d+'\x22':'';_0x36fb59?console[_0x7c3f29(0x25d)](_0x7c3f29(0x27a)+_0x18e49f['length']+'\x20schedules'+_0x52381c+_0x7c3f29(0x1fd)):console[_0x7c3f29(0x25d)]('Found\x20'+_0x18e49f[_0x7c3f29(0x24b)]+_0x7c3f29(0x25b)+(_0x18e49f[_0x7c3f29(0x24b)]!==0x1?'ies':'y')+_0x52381c);if(_0x175826[_0x7c3f29(0x215)]==='json'||_0x175826[_0x7c3f29(0x215)]==='jsonl'||_0x175826['format']===_0x7c3f29(0x217)||_0x175826[_0x7c3f29(0x215)]===_0x7c3f29(0x226)){const _0x12a55f=_0x18e49f[_0x7c3f29(0x271)](_0x36bf5e=>({'id':_0x36bf5e['id'],'name':_0x36bf5e[_0x7c3f29(0x214)],'cron':_0x36bf5e[_0x7c3f29(0x21d)],'database':_0x36bf5e['database']?.[_0x7c3f29(0x214)],'type':_0x36bf5e[_0x7c3f29(0x23a)],'timezone':_0x36bf5e['time_zone'],'user_name':_0x36bf5e[_0x7c3f29(0x269)]?.[_0x7c3f29(0x214)],'updated_at':_0x36bf5e[_0x7c3f29(0x245)],'next_run_at':_0x36bf5e[_0x7c3f29(0x236)],'last_job_status':_0x36bf5e['last_job']?.[_0x7c3f29(0x249)]}));await handleSDKOutput(_0x12a55f,_0x175826);}else{if(_0x18e49f['length']===0x0)console['log'](_0x7c3f29(0x265));else{const _0x45f3f=_0x175826[_0x7c3f29(0x276)],_0x239ae3=_0x18e49f[_0x7c3f29(0x271)](_0x73a3d=>{const _0xae06f8=_0x7c3f29,_0x301ca0=_0x73a3d[_0xae06f8(0x278)]?.[_0xae06f8(0x249)]?_0x73a3d['last_job'][_0xae06f8(0x249)]===_0xae06f8(0x250)?'βœ“':'βœ—':'-',_0x318af9=_0x73a3d[_0xae06f8(0x278)]?.[_0xae06f8(0x277)]?formatRelativeTime(_0x73a3d['last_job'][_0xae06f8(0x277)]):_0xae06f8(0x21e),_0x3cbf6e=_0x73a3d['next_run_at']?formatRelativeTime(_0x73a3d['next_run_at']):'-',_0x1f8c0a=_0x73a3d[_0xae06f8(0x21d)]||'',_0x3ef640=_0x73a3d[_0xae06f8(0x214)]||'(unnamed)',_0x5413e8=getConsoleUrl(_0x45f3f,_0xae06f8(0x261)+_0x73a3d['id']);return{'statusIcon':_0x301ca0,'lastRun':_0x318af9,'nextRun':_0x3cbf6e,'cron':_0x1f8c0a,'name':_0x3ef640,'queryUrl':_0x5413e8,'status':_0x73a3d['last_job']?.[_0xae06f8(0x249)]};}),_0x78805f=Math['max'](..._0x239ae3[_0x7c3f29(0x271)](_0x4a023f=>_0x4a023f[_0x7c3f29(0x216)][_0x7c3f29(0x24b)])),_0x38f687=Math[_0x7c3f29(0x262)](..._0x239ae3[_0x7c3f29(0x271)](_0x36eb50=>_0x36eb50[_0x7c3f29(0x1f2)][_0x7c3f29(0x24b)])),_0x21e10d=Math[_0x7c3f29(0x262)](..._0x239ae3['map'](_0x109636=>_0x109636['cron'][_0x7c3f29(0x24b)])),_0x43de6f=_0x239ae3[_0x7c3f29(0x271)](_0xaa543b=>{const _0x3a5253=_0x7c3f29,_0x3056d9=_0xaa543b[_0x3a5253(0x249)]===_0x3a5253(0x250)?a35_0x296d83[_0x3a5253(0x26e)](_0xaa543b['statusIcon']):_0xaa543b['status']===_0x3a5253(0x25d)?a35_0x296d83[_0x3a5253(0x238)](_0xaa543b[_0x3a5253(0x253)]):a35_0x296d83[_0x3a5253(0x20f)](_0xaa543b[_0x3a5253(0x253)]),_0xb380c5=_0xaa543b['lastRun'][_0x3a5253(0x20b)](_0x78805f),_0x10a699=_0xaa543b[_0x3a5253(0x1f2)][_0x3a5253(0x20b)](_0x38f687),_0x1965b8=_0xaa543b['cron']?a35_0x296d83['cyan'](_0xaa543b[_0x3a5253(0x21d)][_0x3a5253(0x20b)](_0x21e10d)):'\x20'[_0x3a5253(0x23b)](_0x21e10d),_0x222f08=hyperlink(_0xaa543b[_0x3a5253(0x214)],_0xaa543b['queryUrl']);return _0x3a5253(0x244)+_0x3056d9+'\x20'+_0xb380c5+_0x3a5253(0x279)+_0x10a699+'\x20\x20'+_0x1965b8+'\x20\x20'+_0x222f08;});await writeOutput(_0x43de6f[_0x7c3f29(0x21f)]('\x0a'),_0x175826[_0x7c3f29(0x257)],_0x7c3f29(0x221));}}return 0x0;}}export class ScheduleShowCommand extends BaseCommand{[a35_0x130e8a(0x214)]='schedule:show';[a35_0x130e8a(0x20e)]=a35_0x130e8a(0x24e);[a35_0x130e8a(0x200)](_0x41fbda){const _0x1abcf7=a35_0x130e8a,_0x123cc3=_0x41fbda[_0x1abcf7(0x252)][0x0];if(!_0x123cc3)return _0x1abcf7(0x20c);return undefined;}async[a35_0x130e8a(0x1fa)](_0x557851){const _0x438205=a35_0x130e8a,{options:_0x5b3926,args:_0x1ea1c1,tdx:_0xce305d}=_0x557851,_0x62a5fc=_0x1ea1c1[0x0],_0x50cf92=await withSpinner(_0x438205(0x224),()=>_0xce305d[_0x438205(0x223)]['show'](_0x62a5fc),{'verbose':_0x5b3926[_0x438205(0x212)]}),_0x10899d=_0x50cf92[_0x438205(0x206)],_0x2dc5c1={'name':_0x10899d['name'],'cron':_0x10899d[_0x438205(0x21d)],'database':_0x10899d[_0x438205(0x1fc)],'type':_0x10899d['type'],'timezone':_0x10899d['timezone'],'user_name':_0x10899d[_0x438205(0x20d)],'created_at':_0x10899d['created_at'],'engine_version':_0x10899d[_0x438205(0x219)],'executing_user_id':_0x10899d[_0x438205(0x218)],'query':_0x10899d[_0x438205(0x20a)],'delay':_0x10899d['delay'],'priority':_0x10899d[_0x438205(0x213)],'retry_limit':_0x10899d['retry_limit'],..._0x10899d[_0x438205(0x24c)]&&{'result':_0x10899d[_0x438205(0x24c)]}};return await handleSingleObjectOutput(_0x2dc5c1,_0x5b3926),0x0;}}function a35_0x3614(){const _0x2edfe7=['has_next_page','create','\x22...','Update\x20a\x20scheduled\x20query','data','scheduled_at','count','yes','query','padEnd','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20show\x20<name>','user_name','description','dim','history','Updating\x20schedule...','verbose','priority','name','format','lastRun','table','executing_user_id','engine_version','end_at','queries','...','cron','never','join','engineVersion','list','\x20created','schedules','Getting\x20schedule\x20details...','from','tsv','Schedule\x20created:\x20','1398058fvCsme','retry_limit','Failed\x20to\x20read\x20file:\x20','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20history\x20<name>\x20[--from\x20<n>]\x20[--to\x20<n>]','Schedule\x20updated:\x20','\x20execution','h\x20ago','567996fvrpmP','in\x20','trim','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20delete\x20<name>','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20run\x20<name>\x20[--time\x20<iso8601>]\x20[--num\x20<1-10>]','List\x20scheduled\x20queries','schedule:list','next_run_at','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20schedule\x20\x22','red','start_at','type','repeat','round','schedule:history','just\x20now','getTime','Searching\x20scheduled\x20queries\x20matching\x20\x22','\x20\x20Job\x20ID:\x20','42bHfkuR','INVALID_ARGUMENT','πŸ“…\x20','updated_at','Cancelled','5348248DTqaFR','1804542ddondQ','status','\x20\x20Num:\x20','length','result','Run\x20a\x20scheduled\x20query\x20immediately','Show\x20schedule\x20details','trino','success','At\x20least\x20one\x20option\x20must\x20be\x20provided\x20to\x20update','args','statusIcon','utf-8','d\x20ago','\x20\x20Database:\x20','output','timezone','entries','num','\x20scheduled\x20quer','Creating\x20schedule...','error','8312823Ozhsto','\x20(showing\x20','keys','/app/queries/editor?queryId=','max','Found\x20','abs','No\x20scheduled\x20queries\x20found','Updating\x20schedule:\x20','update','m\x20ago','user','run','pagination','Running\x20schedule...','file','green','5129530iczWxV','soon','map','options','jobs','\x20\x20Type:\x20','376395OSDDnz','site','ended_at','last_job','\x20\x20β†’\x20','Showing\x20first\x20','delay','toLocaleDateString','Delete\x20a\x20scheduled\x20query','nextRun','Show\x20schedule\x20execution\x20history','Running\x20schedule:\x20','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20create\x20<name>\x20-d\x20<db>\x20--file\x20<path>\x20[options]','schedule:create','job_id','\x20\x20Cron:\x20','8KGsAPx','execute','Query\x20file\x20is\x20empty','database','\x20(use\x20--limit\x20to\x20see\x20more)','delete','retryLimit','validate','Schedule\x20deleted:\x20'];a35_0x3614=function(){return _0x2edfe7;};return a35_0x3614();}export class ScheduleCreateCommand extends BaseCommand{[a35_0x130e8a(0x214)]=a35_0x130e8a(0x1f6);[a35_0x130e8a(0x20e)]='Create\x20a\x20scheduled\x20query';['validate'](_0x159588){const _0x1ab555=a35_0x130e8a,_0x4ea52b=_0x159588['args'][0x0];if(!_0x4ea52b)return _0x1ab555(0x1f5);const _0x24ea70=_0x159588[_0x1ab555(0x272)];if(!_0x24ea70[_0x1ab555(0x1fc)])return'Database\x20is\x20required\x0aUsage:\x20job\x20schedule\x20create\x20<name>\x20-d\x20<db>\x20--file\x20<path>\x20[options]';return undefined;}async['execute'](_0x33d108){const _0x399dcf=a35_0x130e8a,{options:_0x5c30ca,args:_0x11276a,tdx:_0x34c7e2}=_0x33d108,_0x18c321=_0x11276a[0x0],_0x175dc1=_0x5c30ca,_0x215bad=_0x175dc1[_0x399dcf(0x1fc)],_0x301d22=_0x175dc1[_0x399dcf(0x26d)],_0x2be003=_0x175dc1[_0x399dcf(0x23a)]||_0x399dcf(0x24f);let _0x48402a;try{_0x48402a=readFileSync(_0x301d22,_0x399dcf(0x254))[_0x399dcf(0x231)]();}catch(_0x5133a6){throw new SDKError(ErrorCode[_0x399dcf(0x243)],'Failed\x20to\x20read\x20file:\x20'+_0x301d22,_0x5133a6 instanceof Error?_0x5133a6:undefined);}if(!_0x48402a)throw new SDKError(ErrorCode[_0x399dcf(0x243)],_0x399dcf(0x1fb));const _0x5a316e={'database':_0x215bad,'query':_0x48402a,'type':_0x2be003};if(_0x175dc1['cron'])_0x5a316e[_0x399dcf(0x21d)]=_0x175dc1[_0x399dcf(0x21d)];if(_0x175dc1[_0x399dcf(0x258)])_0x5a316e[_0x399dcf(0x258)]=_0x175dc1[_0x399dcf(0x258)];if(_0x175dc1[_0x399dcf(0x27b)]!==undefined)_0x5a316e[_0x399dcf(0x27b)]=Number(_0x175dc1['delay']);if(_0x175dc1['priority']!==undefined)_0x5a316e[_0x399dcf(0x213)]=Number(_0x175dc1[_0x399dcf(0x213)]);if(_0x175dc1[_0x399dcf(0x1ff)]!==undefined)_0x5a316e[_0x399dcf(0x229)]=Number(_0x175dc1[_0x399dcf(0x1ff)]);if(_0x175dc1[_0x399dcf(0x220)])_0x5a316e[_0x399dcf(0x219)]=_0x175dc1['engineVersion'];if(_0x175dc1[_0x399dcf(0x24c)])_0x5a316e[_0x399dcf(0x24c)]=_0x175dc1[_0x399dcf(0x24c)];if(_0x5c30ca[_0x399dcf(0x212)]){console['error']('Creating\x20schedule:\x20'+_0x18c321),console['error'](_0x399dcf(0x256)+_0x215bad),console[_0x399dcf(0x25d)](_0x399dcf(0x274)+_0x2be003);if(_0x5a316e[_0x399dcf(0x21d)])console[_0x399dcf(0x25d)](_0x399dcf(0x1f8)+_0x5a316e[_0x399dcf(0x21d)]);if(_0x5a316e[_0x399dcf(0x258)])console[_0x399dcf(0x25d)]('\x20\x20Timezone:\x20'+_0x5a316e[_0x399dcf(0x258)]);}const _0x59acc0=await withSpinner(_0x399dcf(0x25c),()=>_0x34c7e2[_0x399dcf(0x223)][_0x399dcf(0x203)](_0x18c321,_0x5a316e),{'verbose':_0x5c30ca[_0x399dcf(0x212)]});return console['error'](_0x399dcf(0x227)+_0x59acc0[_0x399dcf(0x206)][_0x399dcf(0x214)]),await handleSingleObjectOutput(_0x59acc0['data'],_0x5c30ca),0x0;}}export class ScheduleUpdateCommand extends BaseCommand{['name']='schedule:update';[a35_0x130e8a(0x20e)]=a35_0x130e8a(0x205);[a35_0x130e8a(0x200)](_0x5dfe28){const _0x205065=_0x5dfe28['args'][0x0];if(!_0x205065)return'Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20update\x20<name>\x20[options]';return undefined;}async[a35_0x130e8a(0x1fa)](_0x30a476){const _0x551824=a35_0x130e8a,{options:_0x26d8f1,args:_0x5c2b61,tdx:_0x411e95}=_0x30a476,_0x3c187d=_0x5c2b61[0x0],_0x4d9c69=_0x26d8f1,_0x2da557={};if(_0x4d9c69[_0x551824(0x1fc)])_0x2da557[_0x551824(0x1fc)]=_0x4d9c69[_0x551824(0x1fc)];if(_0x4d9c69['type'])_0x2da557[_0x551824(0x23a)]=_0x4d9c69[_0x551824(0x23a)];if(_0x4d9c69[_0x551824(0x21d)])_0x2da557['cron']=_0x4d9c69['cron'];if(_0x4d9c69[_0x551824(0x258)])_0x2da557[_0x551824(0x258)]=_0x4d9c69[_0x551824(0x258)];if(_0x4d9c69[_0x551824(0x27b)]!==undefined)_0x2da557['delay']=Number(_0x4d9c69[_0x551824(0x27b)]);if(_0x4d9c69[_0x551824(0x213)]!==undefined)_0x2da557['priority']=Number(_0x4d9c69[_0x551824(0x213)]);if(_0x4d9c69[_0x551824(0x1ff)]!==undefined)_0x2da557[_0x551824(0x229)]=Number(_0x4d9c69[_0x551824(0x1ff)]);if(_0x4d9c69['engineVersion'])_0x2da557[_0x551824(0x219)]=_0x4d9c69['engineVersion'];if(_0x4d9c69[_0x551824(0x24c)])_0x2da557[_0x551824(0x24c)]=_0x4d9c69[_0x551824(0x24c)];if(_0x4d9c69['file'])try{_0x2da557[_0x551824(0x20a)]=readFileSync(_0x4d9c69['file'],_0x551824(0x254))[_0x551824(0x231)]();}catch(_0x1d2f50){throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x551824(0x22a)+_0x4d9c69[_0x551824(0x26d)],_0x1d2f50 instanceof Error?_0x1d2f50:undefined);}if(Object[_0x551824(0x260)](_0x2da557)[_0x551824(0x24b)]===0x0)throw new SDKError(ErrorCode[_0x551824(0x243)],_0x551824(0x251));if(_0x26d8f1[_0x551824(0x212)]){console[_0x551824(0x25d)](_0x551824(0x266)+_0x3c187d);for(const [_0x282fa2,_0x1b57ac]of Object[_0x551824(0x259)](_0x2da557)){_0x282fa2===_0x551824(0x20a)?console[_0x551824(0x25d)]('\x20\x20'+_0x282fa2+':\x20'+_0x1b57ac['substring'](0x0,0x32)+_0x551824(0x21c)):console['error']('\x20\x20'+_0x282fa2+':\x20'+_0x1b57ac);}}const _0x30d6e6=await withSpinner(_0x551824(0x211),()=>_0x411e95[_0x551824(0x223)][_0x551824(0x267)](_0x3c187d,_0x2da557),{'verbose':_0x26d8f1[_0x551824(0x212)]});return console['error'](_0x551824(0x22c)+_0x30d6e6[_0x551824(0x206)][_0x551824(0x214)]),await handleSingleObjectOutput(_0x30d6e6[_0x551824(0x206)],_0x26d8f1),0x0;}}export class ScheduleDeleteCommand extends BaseCommand{[a35_0x130e8a(0x214)]='schedule:delete';['description']=a35_0x130e8a(0x1f1);[a35_0x130e8a(0x200)](_0x3ec021){const _0x29934e=a35_0x130e8a,_0x46526c=_0x3ec021['args'][0x0];if(!_0x46526c)return _0x29934e(0x232);return undefined;}async[a35_0x130e8a(0x1fa)](_0xc2e5c0){const _0x111d21=a35_0x130e8a,{options:_0x2cf01a,args:_0x4a64c5,tdx:_0xc14fcc}=_0xc2e5c0,_0x39e162=_0x4a64c5[0x0];if(!_0x2cf01a[_0x111d21(0x209)]){const _0x514f61=await confirm(_0x111d21(0x237)+_0x39e162+'\x22?');if(!_0x514f61)return console[_0x111d21(0x25d)](_0x111d21(0x246)),0x0;}const _0x2f5ead=await withSpinner('Deleting\x20schedule...',()=>_0xc14fcc[_0x111d21(0x223)][_0x111d21(0x1fe)](_0x39e162),{'verbose':_0x2cf01a[_0x111d21(0x212)]});return console[_0x111d21(0x25d)](_0x111d21(0x201)+_0x2f5ead[_0x111d21(0x206)][_0x111d21(0x214)]),0x0;}}export class ScheduleRunCommand extends BaseCommand{['name']='schedule:run';['description']=a35_0x130e8a(0x24d);[a35_0x130e8a(0x200)](_0x338faf){const _0x5e0051=a35_0x130e8a,_0x2427ab=_0x338faf['args'][0x0];if(!_0x2427ab)return _0x5e0051(0x233);return undefined;}async[a35_0x130e8a(0x1fa)](_0x2c0101){const _0x2c7f88=a35_0x130e8a,{options:_0x1e4720,args:_0x574987,tdx:_0x513fe5}=_0x2c0101,_0x107303=_0x574987[0x0],_0x488141=_0x1e4720,_0x1e6646=_0x488141['time'],_0x184451=_0x488141[_0x2c7f88(0x25a)]!==undefined?Number(_0x488141[_0x2c7f88(0x25a)]):undefined;if(_0x1e4720[_0x2c7f88(0x212)]){console[_0x2c7f88(0x25d)](_0x2c7f88(0x1f4)+_0x107303);if(_0x1e6646)console[_0x2c7f88(0x25d)]('\x20\x20Time:\x20'+_0x1e6646);if(_0x184451)console[_0x2c7f88(0x25d)](_0x2c7f88(0x24a)+_0x184451);}const _0x439e23=await withSpinner(_0x2c7f88(0x26c),()=>_0x513fe5['schedules'][_0x2c7f88(0x26a)](_0x107303,{'time':_0x1e6646,'num':_0x184451}),{'verbose':_0x1e4720['verbose']}),_0x3f3738=_0x439e23['data'][_0x2c7f88(0x273)];console[_0x2c7f88(0x25d)]('Schedule\x20run\x20submitted:\x20'+_0x3f3738[_0x2c7f88(0x24b)]+'\x20job'+(_0x3f3738[_0x2c7f88(0x24b)]!==0x1?'s':'')+_0x2c7f88(0x222));for(const _0x480646 of _0x3f3738){console[_0x2c7f88(0x25d)](_0x2c7f88(0x241)+_0x480646[_0x2c7f88(0x1f7)]);}return await handleSDKOutput(_0x3f3738,_0x1e4720),0x0;}}export class ScheduleHistoryCommand extends BaseCommand{[a35_0x130e8a(0x214)]=a35_0x130e8a(0x23d);[a35_0x130e8a(0x20e)]=a35_0x130e8a(0x1f3);['validate'](_0x59d6b2){const _0x31be5f=a35_0x130e8a,_0x2e0b1e=_0x59d6b2[_0x31be5f(0x252)][0x0];if(!_0x2e0b1e)return _0x31be5f(0x22b);return undefined;}async[a35_0x130e8a(0x1fa)](_0x11bfa0){const _0x4b1c89=a35_0x130e8a,{options:_0x128cc1,args:_0x1c8a1d,tdx:_0x2767c6}=_0x11bfa0,_0x48c0e5=_0x1c8a1d[0x0],_0x4cbaf0=_0x128cc1,_0x149e43=_0x4cbaf0[_0x4b1c89(0x225)]!==undefined?Number(_0x4cbaf0[_0x4b1c89(0x225)]):undefined,_0x579083=_0x4cbaf0['to']!==undefined?Number(_0x4cbaf0['to']):undefined,_0x23aa5f=await withSpinner('Getting\x20schedule\x20history...',()=>_0x2767c6[_0x4b1c89(0x223)][_0x4b1c89(0x210)](_0x48c0e5,{'from':_0x149e43,'to':_0x579083}),{'verbose':_0x128cc1['verbose']}),_0x16400e=_0x23aa5f['data'];console[_0x4b1c89(0x25d)](_0x4b1c89(0x263)+_0x16400e['count']+_0x4b1c89(0x22d)+(_0x16400e[_0x4b1c89(0x208)]!==0x1?'s':'')+_0x4b1c89(0x25f)+_0x16400e[_0x4b1c89(0x225)]+'-'+_0x16400e['to']+')');const _0x318357=_0x16400e[_0x4b1c89(0x210)][_0x4b1c89(0x271)](_0x5a0fe0=>({'job_id':_0x5a0fe0[_0x4b1c89(0x1f7)],'type':_0x5a0fe0[_0x4b1c89(0x23a)],'status':_0x5a0fe0[_0x4b1c89(0x249)],'scheduled_at':_0x5a0fe0[_0x4b1c89(0x207)],'created_at':_0x5a0fe0['created_at'],'start_at':_0x5a0fe0[_0x4b1c89(0x239)],'end_at':_0x5a0fe0[_0x4b1c89(0x21a)]}));return await handleSDKOutput(_0x318357,_0x128cc1),0x0;}}
1
+ const a35_0x42a9e2=a35_0x53ea;(function(_0x363a0f,_0x2f692d){const _0x587a29=a35_0x53ea,_0x585be2=_0x363a0f();while(!![]){try{const _0x222df8=parseInt(_0x587a29(0x1e2))/0x1*(parseInt(_0x587a29(0x18d))/0x2)+parseInt(_0x587a29(0x206))/0x3+-parseInt(_0x587a29(0x1bf))/0x4+-parseInt(_0x587a29(0x1f6))/0x5+parseInt(_0x587a29(0x1f2))/0x6*(-parseInt(_0x587a29(0x1cb))/0x7)+-parseInt(_0x587a29(0x1cc))/0x8+-parseInt(_0x587a29(0x1ec))/0x9*(-parseInt(_0x587a29(0x1be))/0xa);if(_0x222df8===_0x2f692d)break;else _0x585be2['push'](_0x585be2['shift']());}catch(_0x54e5e1){_0x585be2['push'](_0x585be2['shift']());}}}(a35_0x1a6e,0xd01f7));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput,writeOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{confirm}from'../utils/prompt.js';import{readFileSync}from'fs';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';function a35_0x1a6e(){const _0x4e1c73=['\x20matching\x20\x22','show','lastRun','last_job','\x22...','\x20(use\x20--limit\x20to\x20see\x20more)','success','delay','length','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20delete\x20<name>','\x20execution','Searching\x20scheduled\x20queries\x20matching\x20\x22','schedule:history','never','error','user_name','schedule:run','join','Listing\x20scheduled\x20queries...','schedules','No\x20scheduled\x20queries\x20found','nextRun','pagination','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20show\x20<name>','count','schedule:update','created_at','listQueries','ended_at','queryUrl','padEnd','jobs','Update\x20a\x20scheduled\x20query','engineVersion','List\x20scheduled\x20queries','10OTcotn','2602312CdKxQu','status','keys','args','delete','data','time_zone','Running\x20schedule...','verbose','Schedule\x20updated:\x20','query','getTime','7MdvMuq','246504xrBflr','\x20\x20Num:\x20','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20schedule\x20\x22','log','Failed\x20to\x20read\x20file:\x20','retry_limit','entries','retryLimit','file','\x20job','repeat','\x20\x20Type:\x20','dim','(unnamed)','name','yes','Creating\x20schedule:\x20','h\x20ago','trino','Show\x20schedule\x20details','Database\x20is\x20required\x0aUsage:\x20job\x20schedule\x20create\x20<name>\x20-d\x20<db>\x20--file\x20<path>\x20[options]','Schedule\x20run\x20submitted:\x20','164899LPlQsQ','job_id','start_at','list','queries','Cancelled','from','substring','user','next_run_at','21041181aAwPFg','\x20scheduled\x20quer','m\x20ago','time','format','\x20\x20Cron:\x20','6448626tPObIr','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20run\x20<name>\x20[--time\x20<iso8601>]\x20[--num\x20<1-10>]','result','timezone','1061540nHwPbD','Delete\x20a\x20scheduled\x20query','INVALID_ARGUMENT','cron','history','tsv','type','Updating\x20schedule...','site','round','d\x20ago','scheduled_at','Creating\x20schedule...','trim','schedule:list','create','954399InSPXv','Found\x20','updated_at','Updating\x20schedule:\x20','num','in\x20','abs','jsonl','\x20\x20Timezone:\x20','Run\x20a\x20scheduled\x20query\x20immediately','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20history\x20<name>\x20[--from\x20<n>]\x20[--to\x20<n>]','...','utf-8','table','/app/queries/editor?queryId=','map','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20create\x20<name>\x20-d\x20<db>\x20--file\x20<path>\x20[options]','\x20\x20Time:\x20','statusIcon','Schedule\x20deleted:\x20','schedule:show','executing_user_id','\x20created','database','cyan','validate','Getting\x20schedule\x20details...','2plcUMv','Create\x20a\x20scheduled\x20query','end_at','description','has_next_page','Showing\x20first\x20','priority','engine_version','πŸ“…\x20','just\x20now','execute','At\x20least\x20one\x20option\x20must\x20be\x20provided\x20to\x20update','max','Deleting\x20schedule...'];a35_0x1a6e=function(){return _0x4e1c73;};return a35_0x1a6e();}import{hyperlink}from'../sdk/util/formatters.js';import a35_0x168a99 from'chalk';function a35_0x53ea(_0x6f2dd5,_0x3c2346){_0x6f2dd5=_0x6f2dd5-0x17a;const _0x1a6e5d=a35_0x1a6e();let _0x53ea56=_0x1a6e5d[_0x6f2dd5];return _0x53ea56;}function formatRelativeTime(_0x8b3818){const _0x3a6065=a35_0x53ea,_0x424b80=new Date(_0x8b3818),_0x5b5558=new Date(),_0x3c6fbf=_0x424b80['getTime']()-_0x5b5558[_0x3a6065(0x1ca)](),_0x61487f=Math[_0x3a6065(0x20c)](_0x3c6fbf)/0x3e8,_0x5909b3=_0x3c6fbf<0x0;if(_0x61487f<0x3c)return _0x5909b3?_0x3a6065(0x196):'soon';else{if(_0x61487f<0xe10){const _0x31645f=Math[_0x3a6065(0x1ff)](_0x61487f/0x3c);return _0x5909b3?_0x31645f+_0x3a6065(0x1ee):'in\x20'+_0x31645f+'m';}else{if(_0x61487f<0x15180){const _0x3ae283=Math[_0x3a6065(0x1ff)](_0x61487f/0xe10);return _0x5909b3?_0x3ae283+_0x3a6065(0x1dd):'in\x20'+_0x3ae283+'h';}else{if(_0x61487f<0x93a80){const _0x28483e=Math[_0x3a6065(0x1ff)](_0x61487f/0x15180);return _0x5909b3?_0x28483e+_0x3a6065(0x200):_0x3a6065(0x20b)+_0x28483e+'d';}else return _0x424b80['toLocaleDateString']();}}}}export class ScheduleListCommand extends BaseCommand{[a35_0x42a9e2(0x1da)]=a35_0x42a9e2(0x204);[a35_0x42a9e2(0x190)]=a35_0x42a9e2(0x1bd);async[a35_0x42a9e2(0x197)](_0x580191){const _0x219cb3=a35_0x42a9e2,{options:_0x371666,args:_0x3c600c,tdx:_0x34f2a2}=_0x580191,_0x389f51=resolveLimit(_0x371666['limit'],DEFAULT_DISPLAY_LIMIT),_0xa7e1d=_0x3c600c[0x0],_0x4a15c6=_0xa7e1d?_0x219cb3(0x1a6)+_0xa7e1d+_0x219cb3(0x19f):_0x219cb3(0x1ad),_0x1b2f31=await withSpinner(_0x4a15c6,()=>_0x34f2a2['schedules'][_0x219cb3(0x1b6)]({'limit':_0x389f51,'scheduled':!![],'pattern':_0xa7e1d}),{'verbose':_0x371666[_0x219cb3(0x1c7)]}),_0x2100c2=_0x1b2f31['data'][_0x219cb3(0x1e6)],_0x573b5a=_0x1b2f31['data'][_0x219cb3(0x1b1)][_0x219cb3(0x191)],_0x3f7d62=_0xa7e1d?_0x219cb3(0x19b)+_0xa7e1d+'\x22':'';_0x573b5a?console[_0x219cb3(0x1a9)](_0x219cb3(0x192)+_0x2100c2[_0x219cb3(0x1a3)]+'\x20schedules'+_0x3f7d62+_0x219cb3(0x1a0)):console['error']('Found\x20'+_0x2100c2[_0x219cb3(0x1a3)]+_0x219cb3(0x1ed)+(_0x2100c2['length']!==0x1?'ies':'y')+_0x3f7d62);if(_0x371666[_0x219cb3(0x1f0)]==='json'||_0x371666[_0x219cb3(0x1f0)]===_0x219cb3(0x20d)||_0x371666[_0x219cb3(0x1f0)]===_0x219cb3(0x17f)||_0x371666[_0x219cb3(0x1f0)]===_0x219cb3(0x1fb)){const _0x2abab0=_0x2100c2[_0x219cb3(0x181)](_0x30f1e6=>({'id':_0x30f1e6['id'],'name':_0x30f1e6['name'],'cron':_0x30f1e6[_0x219cb3(0x1f9)],'database':_0x30f1e6['database']?.[_0x219cb3(0x1da)],'type':_0x30f1e6[_0x219cb3(0x1fc)],'timezone':_0x30f1e6[_0x219cb3(0x1c5)],'user_name':_0x30f1e6[_0x219cb3(0x1ea)]?.[_0x219cb3(0x1da)],'updated_at':_0x30f1e6[_0x219cb3(0x208)],'next_run_at':_0x30f1e6[_0x219cb3(0x1eb)],'last_job_status':_0x30f1e6[_0x219cb3(0x19e)]?.['status']}));await handleSDKOutput(_0x2abab0,_0x371666);}else{if(_0x2100c2['length']===0x0)console[_0x219cb3(0x1cf)](_0x219cb3(0x1af));else{const _0x5a55ce=_0x371666[_0x219cb3(0x1fe)],_0x4c83f8=_0x2100c2[_0x219cb3(0x181)](_0x4353e9=>{const _0x772057=_0x219cb3,_0x71da2b=_0x4353e9['last_job']?.[_0x772057(0x1c0)]?_0x4353e9[_0x772057(0x19e)][_0x772057(0x1c0)]==='success'?'βœ“':'βœ—':'-',_0x109983=_0x4353e9['last_job']?.[_0x772057(0x1b7)]?formatRelativeTime(_0x4353e9['last_job']['ended_at']):_0x772057(0x1a8),_0x1c79db=_0x4353e9[_0x772057(0x1eb)]?formatRelativeTime(_0x4353e9[_0x772057(0x1eb)]):'-',_0x2b28c3=_0x4353e9[_0x772057(0x1f9)]||'',_0x2c3a0d=_0x4353e9[_0x772057(0x1da)]||_0x772057(0x1d9),_0x360231=getConsoleUrl(_0x5a55ce,_0x772057(0x180)+_0x4353e9['id']);return{'statusIcon':_0x71da2b,'lastRun':_0x109983,'nextRun':_0x1c79db,'cron':_0x2b28c3,'name':_0x2c3a0d,'queryUrl':_0x360231,'status':_0x4353e9['last_job']?.[_0x772057(0x1c0)]};}),_0x35b07b=Math[_0x219cb3(0x199)](..._0x4c83f8[_0x219cb3(0x181)](_0x37c5a2=>_0x37c5a2[_0x219cb3(0x19d)][_0x219cb3(0x1a3)])),_0x11960e=Math['max'](..._0x4c83f8['map'](_0x52e05f=>_0x52e05f[_0x219cb3(0x1b0)][_0x219cb3(0x1a3)])),_0x5d4c25=Math[_0x219cb3(0x199)](..._0x4c83f8[_0x219cb3(0x181)](_0x3a5b68=>_0x3a5b68[_0x219cb3(0x1f9)][_0x219cb3(0x1a3)])),_0x43d585=_0x4c83f8[_0x219cb3(0x181)](_0x5afe15=>{const _0xa9f241=_0x219cb3,_0x5c876e=_0x5afe15['status']===_0xa9f241(0x1a1)?a35_0x168a99['green'](_0x5afe15['statusIcon']):_0x5afe15['status']===_0xa9f241(0x1a9)?a35_0x168a99['red'](_0x5afe15[_0xa9f241(0x184)]):a35_0x168a99[_0xa9f241(0x1d8)](_0x5afe15[_0xa9f241(0x184)]),_0x36ff1d=_0x5afe15[_0xa9f241(0x19d)][_0xa9f241(0x1b9)](_0x35b07b),_0x2f300b=_0x5afe15[_0xa9f241(0x1b0)][_0xa9f241(0x1b9)](_0x11960e),_0x333ad6=_0x5afe15[_0xa9f241(0x1f9)]?a35_0x168a99[_0xa9f241(0x18a)](_0x5afe15[_0xa9f241(0x1f9)][_0xa9f241(0x1b9)](_0x5d4c25)):'\x20'[_0xa9f241(0x1d6)](_0x5d4c25),_0x4821a7=hyperlink(_0x5afe15[_0xa9f241(0x1da)],_0x5afe15[_0xa9f241(0x1b8)]);return _0xa9f241(0x195)+_0x5c876e+'\x20'+_0x36ff1d+'\x20\x20β†’\x20'+_0x2f300b+'\x20\x20'+_0x333ad6+'\x20\x20'+_0x4821a7;});await writeOutput(_0x43d585[_0x219cb3(0x1ac)]('\x0a'),_0x371666['output'],_0x219cb3(0x1e5));}}return 0x0;}}export class ScheduleShowCommand extends BaseCommand{[a35_0x42a9e2(0x1da)]=a35_0x42a9e2(0x186);[a35_0x42a9e2(0x190)]=a35_0x42a9e2(0x1df);[a35_0x42a9e2(0x18b)](_0x51cf73){const _0x584023=a35_0x42a9e2,_0x1978fb=_0x51cf73[_0x584023(0x1c2)][0x0];if(!_0x1978fb)return _0x584023(0x1b2);return undefined;}async[a35_0x42a9e2(0x197)](_0x24ba04){const _0x3f2d57=a35_0x42a9e2,{options:_0x5ab8fb,args:_0xfbe77e,tdx:_0x28e1f6}=_0x24ba04,_0x1bef0d=_0xfbe77e[0x0],_0x58e008=await withSpinner(_0x3f2d57(0x18c),()=>_0x28e1f6[_0x3f2d57(0x1ae)][_0x3f2d57(0x19c)](_0x1bef0d),{'verbose':_0x5ab8fb[_0x3f2d57(0x1c7)]}),_0x2f63d2=_0x58e008[_0x3f2d57(0x1c4)],_0x2f735e={'name':_0x2f63d2[_0x3f2d57(0x1da)],'cron':_0x2f63d2['cron'],'database':_0x2f63d2[_0x3f2d57(0x189)],'type':_0x2f63d2[_0x3f2d57(0x1fc)],'timezone':_0x2f63d2[_0x3f2d57(0x1f5)],'user_name':_0x2f63d2[_0x3f2d57(0x1aa)],'created_at':_0x2f63d2[_0x3f2d57(0x1b5)],'engine_version':_0x2f63d2[_0x3f2d57(0x194)],'executing_user_id':_0x2f63d2[_0x3f2d57(0x187)],'query':_0x2f63d2[_0x3f2d57(0x1c9)],'delay':_0x2f63d2[_0x3f2d57(0x1a2)],'priority':_0x2f63d2[_0x3f2d57(0x193)],'retry_limit':_0x2f63d2[_0x3f2d57(0x1d1)],..._0x2f63d2[_0x3f2d57(0x1f4)]&&{'result':_0x2f63d2['result']}};return await handleSingleObjectOutput(_0x2f735e,_0x5ab8fb),0x0;}}export class ScheduleCreateCommand extends BaseCommand{[a35_0x42a9e2(0x1da)]='schedule:create';[a35_0x42a9e2(0x190)]=a35_0x42a9e2(0x18e);[a35_0x42a9e2(0x18b)](_0x153d1f){const _0x39127c=a35_0x42a9e2,_0x10e4bb=_0x153d1f[_0x39127c(0x1c2)][0x0];if(!_0x10e4bb)return _0x39127c(0x182);const _0x1d99b2=_0x153d1f['options'];if(!_0x1d99b2[_0x39127c(0x189)])return _0x39127c(0x1e0);return undefined;}async[a35_0x42a9e2(0x197)](_0x55b6f5){const _0x31c463=a35_0x42a9e2,{options:_0x393296,args:_0x44b3b3,tdx:_0x206d4f}=_0x55b6f5,_0xc521b9=_0x44b3b3[0x0],_0x43dcb6=_0x393296,_0x58873d=_0x43dcb6['database'],_0xc596a7=_0x43dcb6[_0x31c463(0x1d4)],_0x2c56cd=_0x43dcb6['type']||_0x31c463(0x1de);let _0x174d57;try{_0x174d57=readFileSync(_0xc596a7,_0x31c463(0x17e))[_0x31c463(0x203)]();}catch(_0x77ff2d){throw new SDKError(ErrorCode[_0x31c463(0x1f8)],_0x31c463(0x1d0)+_0xc596a7,_0x77ff2d instanceof Error?_0x77ff2d:undefined);}if(!_0x174d57)throw new SDKError(ErrorCode[_0x31c463(0x1f8)],'Query\x20file\x20is\x20empty');const _0x4cb0ef={'database':_0x58873d,'query':_0x174d57,'type':_0x2c56cd};if(_0x43dcb6['cron'])_0x4cb0ef[_0x31c463(0x1f9)]=_0x43dcb6['cron'];if(_0x43dcb6[_0x31c463(0x1f5)])_0x4cb0ef[_0x31c463(0x1f5)]=_0x43dcb6[_0x31c463(0x1f5)];if(_0x43dcb6[_0x31c463(0x1a2)]!==undefined)_0x4cb0ef[_0x31c463(0x1a2)]=Number(_0x43dcb6[_0x31c463(0x1a2)]);if(_0x43dcb6[_0x31c463(0x193)]!==undefined)_0x4cb0ef[_0x31c463(0x193)]=Number(_0x43dcb6[_0x31c463(0x193)]);if(_0x43dcb6[_0x31c463(0x1d3)]!==undefined)_0x4cb0ef[_0x31c463(0x1d1)]=Number(_0x43dcb6['retryLimit']);if(_0x43dcb6[_0x31c463(0x1bc)])_0x4cb0ef[_0x31c463(0x194)]=_0x43dcb6[_0x31c463(0x1bc)];if(_0x43dcb6[_0x31c463(0x1f4)])_0x4cb0ef['result']=_0x43dcb6[_0x31c463(0x1f4)];if(_0x393296[_0x31c463(0x1c7)]){console[_0x31c463(0x1a9)](_0x31c463(0x1dc)+_0xc521b9),console[_0x31c463(0x1a9)]('\x20\x20Database:\x20'+_0x58873d),console[_0x31c463(0x1a9)](_0x31c463(0x1d7)+_0x2c56cd);if(_0x4cb0ef[_0x31c463(0x1f9)])console[_0x31c463(0x1a9)](_0x31c463(0x1f1)+_0x4cb0ef[_0x31c463(0x1f9)]);if(_0x4cb0ef['timezone'])console[_0x31c463(0x1a9)](_0x31c463(0x17a)+_0x4cb0ef[_0x31c463(0x1f5)]);}const _0x23b7f8=await withSpinner(_0x31c463(0x202),()=>_0x206d4f[_0x31c463(0x1ae)][_0x31c463(0x205)](_0xc521b9,_0x4cb0ef),{'verbose':_0x393296[_0x31c463(0x1c7)]});return console[_0x31c463(0x1a9)]('Schedule\x20created:\x20'+_0x23b7f8[_0x31c463(0x1c4)]['name']),await handleSingleObjectOutput(_0x23b7f8[_0x31c463(0x1c4)],_0x393296),0x0;}}export class ScheduleUpdateCommand extends BaseCommand{['name']=a35_0x42a9e2(0x1b4);[a35_0x42a9e2(0x190)]=a35_0x42a9e2(0x1bb);[a35_0x42a9e2(0x18b)](_0x5cec79){const _0x1f617f=a35_0x42a9e2,_0x4c844b=_0x5cec79[_0x1f617f(0x1c2)][0x0];if(!_0x4c844b)return'Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20update\x20<name>\x20[options]';return undefined;}async[a35_0x42a9e2(0x197)](_0x1a06c7){const _0x31efc3=a35_0x42a9e2,{options:_0x145cba,args:_0x328137,tdx:_0x1933e9}=_0x1a06c7,_0xbfc238=_0x328137[0x0],_0x4e0966=_0x145cba,_0x8156dd={};if(_0x4e0966[_0x31efc3(0x189)])_0x8156dd['database']=_0x4e0966['database'];if(_0x4e0966[_0x31efc3(0x1fc)])_0x8156dd[_0x31efc3(0x1fc)]=_0x4e0966[_0x31efc3(0x1fc)];if(_0x4e0966[_0x31efc3(0x1f9)])_0x8156dd[_0x31efc3(0x1f9)]=_0x4e0966[_0x31efc3(0x1f9)];if(_0x4e0966[_0x31efc3(0x1f5)])_0x8156dd[_0x31efc3(0x1f5)]=_0x4e0966[_0x31efc3(0x1f5)];if(_0x4e0966['delay']!==undefined)_0x8156dd[_0x31efc3(0x1a2)]=Number(_0x4e0966['delay']);if(_0x4e0966[_0x31efc3(0x193)]!==undefined)_0x8156dd['priority']=Number(_0x4e0966[_0x31efc3(0x193)]);if(_0x4e0966['retryLimit']!==undefined)_0x8156dd['retry_limit']=Number(_0x4e0966[_0x31efc3(0x1d3)]);if(_0x4e0966[_0x31efc3(0x1bc)])_0x8156dd[_0x31efc3(0x194)]=_0x4e0966[_0x31efc3(0x1bc)];if(_0x4e0966[_0x31efc3(0x1f4)])_0x8156dd['result']=_0x4e0966['result'];if(_0x4e0966[_0x31efc3(0x1d4)])try{_0x8156dd[_0x31efc3(0x1c9)]=readFileSync(_0x4e0966[_0x31efc3(0x1d4)],'utf-8')[_0x31efc3(0x203)]();}catch(_0x5e5ff4){throw new SDKError(ErrorCode['INVALID_ARGUMENT'],'Failed\x20to\x20read\x20file:\x20'+_0x4e0966['file'],_0x5e5ff4 instanceof Error?_0x5e5ff4:undefined);}if(Object[_0x31efc3(0x1c1)](_0x8156dd)['length']===0x0)throw new SDKError(ErrorCode[_0x31efc3(0x1f8)],_0x31efc3(0x198));if(_0x145cba[_0x31efc3(0x1c7)]){console[_0x31efc3(0x1a9)](_0x31efc3(0x209)+_0xbfc238);for(const [_0x4a1a2b,_0x575976]of Object[_0x31efc3(0x1d2)](_0x8156dd)){_0x4a1a2b===_0x31efc3(0x1c9)?console[_0x31efc3(0x1a9)]('\x20\x20'+_0x4a1a2b+':\x20'+_0x575976[_0x31efc3(0x1e9)](0x0,0x32)+_0x31efc3(0x17d)):console[_0x31efc3(0x1a9)]('\x20\x20'+_0x4a1a2b+':\x20'+_0x575976);}}const _0x370ffb=await withSpinner(_0x31efc3(0x1fd),()=>_0x1933e9[_0x31efc3(0x1ae)]['update'](_0xbfc238,_0x8156dd),{'verbose':_0x145cba[_0x31efc3(0x1c7)]});return console[_0x31efc3(0x1a9)](_0x31efc3(0x1c8)+_0x370ffb['data']['name']),await handleSingleObjectOutput(_0x370ffb[_0x31efc3(0x1c4)],_0x145cba),0x0;}}export class ScheduleDeleteCommand extends BaseCommand{['name']='schedule:delete';['description']=a35_0x42a9e2(0x1f7);['validate'](_0x2e8bb5){const _0x512f9d=a35_0x42a9e2,_0x457007=_0x2e8bb5[_0x512f9d(0x1c2)][0x0];if(!_0x457007)return _0x512f9d(0x1a4);return undefined;}async[a35_0x42a9e2(0x197)](_0x2cb90f){const _0x2cb4c0=a35_0x42a9e2,{options:_0x21af3c,args:_0x2d016e,tdx:_0x39cfc2}=_0x2cb90f,_0x1eb8f1=_0x2d016e[0x0];if(!_0x21af3c[_0x2cb4c0(0x1db)]){const _0x650fc2=await confirm(_0x2cb4c0(0x1ce)+_0x1eb8f1+'\x22?');if(!_0x650fc2)return console[_0x2cb4c0(0x1a9)](_0x2cb4c0(0x1e7)),0x0;}const _0x22c0e4=await withSpinner(_0x2cb4c0(0x19a),()=>_0x39cfc2[_0x2cb4c0(0x1ae)][_0x2cb4c0(0x1c3)](_0x1eb8f1),{'verbose':_0x21af3c[_0x2cb4c0(0x1c7)]});return console[_0x2cb4c0(0x1a9)](_0x2cb4c0(0x185)+_0x22c0e4[_0x2cb4c0(0x1c4)]['name']),0x0;}}export class ScheduleRunCommand extends BaseCommand{[a35_0x42a9e2(0x1da)]=a35_0x42a9e2(0x1ab);[a35_0x42a9e2(0x190)]=a35_0x42a9e2(0x17b);[a35_0x42a9e2(0x18b)](_0x4e544c){const _0x4cc60f=a35_0x42a9e2,_0x221665=_0x4e544c[_0x4cc60f(0x1c2)][0x0];if(!_0x221665)return _0x4cc60f(0x1f3);return undefined;}async[a35_0x42a9e2(0x197)](_0x3e540e){const _0x3d9e54=a35_0x42a9e2,{options:_0x163bbf,args:_0x256275,tdx:_0x5cc04b}=_0x3e540e,_0x4a5936=_0x256275[0x0],_0x286477=_0x163bbf,_0x301ebf=_0x286477[_0x3d9e54(0x1ef)],_0x33a459=_0x286477[_0x3d9e54(0x20a)]!==undefined?Number(_0x286477[_0x3d9e54(0x20a)]):undefined;if(_0x163bbf[_0x3d9e54(0x1c7)]){console[_0x3d9e54(0x1a9)]('Running\x20schedule:\x20'+_0x4a5936);if(_0x301ebf)console[_0x3d9e54(0x1a9)](_0x3d9e54(0x183)+_0x301ebf);if(_0x33a459)console['error'](_0x3d9e54(0x1cd)+_0x33a459);}const _0x410b28=await withSpinner(_0x3d9e54(0x1c6),()=>_0x5cc04b[_0x3d9e54(0x1ae)]['run'](_0x4a5936,{'time':_0x301ebf,'num':_0x33a459}),{'verbose':_0x163bbf[_0x3d9e54(0x1c7)]}),_0x5dbb54=_0x410b28[_0x3d9e54(0x1c4)][_0x3d9e54(0x1ba)];console[_0x3d9e54(0x1a9)](_0x3d9e54(0x1e1)+_0x5dbb54[_0x3d9e54(0x1a3)]+_0x3d9e54(0x1d5)+(_0x5dbb54['length']!==0x1?'s':'')+_0x3d9e54(0x188));for(const _0x326d97 of _0x5dbb54){console[_0x3d9e54(0x1a9)]('\x20\x20Job\x20ID:\x20'+_0x326d97[_0x3d9e54(0x1e3)]);}return await handleSDKOutput(_0x5dbb54,_0x163bbf),0x0;}}export class ScheduleHistoryCommand extends BaseCommand{['name']=a35_0x42a9e2(0x1a7);[a35_0x42a9e2(0x190)]='Show\x20schedule\x20execution\x20history';[a35_0x42a9e2(0x18b)](_0x2de377){const _0x4d8628=a35_0x42a9e2,_0x277fab=_0x2de377[_0x4d8628(0x1c2)][0x0];if(!_0x277fab)return _0x4d8628(0x17c);return undefined;}async[a35_0x42a9e2(0x197)](_0x548329){const _0x42281f=a35_0x42a9e2,{options:_0x20ddca,args:_0x5b15d4,tdx:_0x4757c2}=_0x548329,_0x1496ad=_0x5b15d4[0x0],_0x228584=_0x20ddca,_0x19384f=_0x228584['from']!==undefined?Number(_0x228584['from']):undefined,_0x195064=_0x228584['to']!==undefined?Number(_0x228584['to']):undefined,_0x532856=await withSpinner('Getting\x20schedule\x20history...',()=>_0x4757c2['schedules']['history'](_0x1496ad,{'from':_0x19384f,'to':_0x195064}),{'verbose':_0x20ddca[_0x42281f(0x1c7)]}),_0x36895d=_0x532856['data'];console[_0x42281f(0x1a9)](_0x42281f(0x207)+_0x36895d[_0x42281f(0x1b3)]+_0x42281f(0x1a5)+(_0x36895d['count']!==0x1?'s':'')+'\x20(showing\x20'+_0x36895d[_0x42281f(0x1e8)]+'-'+_0x36895d['to']+')');const _0x2a0320=_0x36895d[_0x42281f(0x1fa)][_0x42281f(0x181)](_0x5b122f=>({'job_id':_0x5b122f[_0x42281f(0x1e3)],'type':_0x5b122f[_0x42281f(0x1fc)],'status':_0x5b122f[_0x42281f(0x1c0)],'scheduled_at':_0x5b122f[_0x42281f(0x201)],'created_at':_0x5b122f[_0x42281f(0x1b5)],'start_at':_0x5b122f[_0x42281f(0x1e4)],'end_at':_0x5b122f[_0x42281f(0x18f)]}));return await handleSDKOutput(_0x2a0320,_0x20ddca),0x0;}}
@@ -1 +1 @@
1
- const a36_0xccb750=a36_0x44bc;(function(_0x2aab9b,_0xa6c5d4){const _0x2faea4=a36_0x44bc,_0x3f0c6d=_0x2aab9b();while(!![]){try{const _0x34b651=-parseInt(_0x2faea4(0x194))/0x1*(-parseInt(_0x2faea4(0x152))/0x2)+-parseInt(_0x2faea4(0x165))/0x3+-parseInt(_0x2faea4(0x1bb))/0x4*(parseInt(_0x2faea4(0x14e))/0x5)+parseInt(_0x2faea4(0x171))/0x6*(-parseInt(_0x2faea4(0x189))/0x7)+-parseInt(_0x2faea4(0x1a2))/0x8*(-parseInt(_0x2faea4(0x1df))/0x9)+-parseInt(_0x2faea4(0x170))/0xa*(parseInt(_0x2faea4(0x17e))/0xb)+-parseInt(_0x2faea4(0x166))/0xc;if(_0x34b651===_0xa6c5d4)break;else _0x3f0c6d['push'](_0x3f0c6d['shift']());}catch(_0x4fa3cd){_0x3f0c6d['push'](_0x3f0c6d['shift']());}}}(a36_0x41b3,0xa9e5d));import{BaseCommand}from'./command.js';function a36_0x41b3(){const _0x429fa7=['\x20\x20tdx\x20sg\x20sql\x20--path\x20','Resolving\x20folder\x20\x27','getFolder','information_schema','Folder\x20name:\x20','1348989amwJpE','5641320QmPYwM','Resolved\x20folder\x20ID:\x20','parent','parentSegment','segment','includes','getSQLFromServerSegment','Listing\x20folders\x20for\x20parent\x20\x27','length','url','10OtjoqE','1980582BfuKyb','execute','folderId','description','resolvePathToResource','Show\x20folder\x20or\x20child\x20segment\x20details','trim','\x20\x20tdx\x20sg\x20sql\x20--path\x20segments/my-audience/premium-users.yml','Use:\x20tdx\x20ps\x20view\x20-w','green','cyan','Fetching\x20folder\x20\x27','Fetching\x20segment\x20details...','2926055lzornz','\x20\x20Folder\x20path:\x20','\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','processedRows','resolveFolderId','Fetching\x20SQL\x20for\x20segment...','parentFolder','Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required','Fetching\x20SQL\x20from\x20rule...','7sBjkqd','Executing\x20segment\x20query...','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20-w\x20\x20#\x20Open\x20segment\x20in\x20web\x20browser','Target\x20path:\x20','listFolders','Error:\x20Folder\x20reference\x20is\x20required','Use:\x20tdx\x20ps\x20view','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','type','Error:\x20','Show\x20segment\x20folder\x20details','1PLIzLf','segment:folder:create','Error:\x20Specify\x20either\x20segment\x20name\x20or\x20--path,\x20not\x20both','Error:\x20Path\x20or\x20name\x20is\x20required','Site:\x20','\x20\x20Full\x20path:\x20','segmentId','/e/','Parent\x20segment:\x20','cause','Resolved\x20relative\x20path\x20to:\x20','Fetching\x20folder\x20details...','elapsedTimeMillis','βœ”\x20Created\x20folder\x20\x27','2548328PbaeCX','verbose','(root)','content','\x20\x20-w,\x20--web\x20\x20Open\x20segment\x20in\x20web\x20browser','Error:\x20Parent\x20segment\x20name\x20is\x20required','Segment\x20ID:\x20','βœ”\x20Found\x20','\x20\x20Parent\x20segment:\x20','βœ–\x20Query\x20failed\x20[','replace','getSegmentSQL','Resolving\x20parent\x20segment\x20\x27','Error:\x20Cannot\x20execute\x20query\x20for\x20parent\x20segment\x20with\x20this\x20command.','Creating\x20folder\x20\x27','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20show\x20<path/to/segment.yml>','segment:folder:show','Parent\x20ID:\x20','\x20\x20tdx\x20sg\x20view\x20segments/my-audience/premium-users.yml','site','Create\x20segment\x20folder\x20for\x20organization','data','query','Show\x20child\x20segment\x20schema\x20(column\x20types)','SELECT\x20*\x20FROM\x20(\x0a','45544SckCot','\x20\x20tdx\x20sg\x20desc\x20segments/my-audience/premium-users.yml','fullPath','Resolved:\x20','stats','getSQLFromYamlFile','Error:\x20Cannot\x20view\x20parent\x20segment\x20details\x20with\x20this\x20command.','Resolving\x20path\x20\x27','Examples:','\x20[Job\x20ID:\x20','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','\x20\x20tdx\x20sg\x20sql\x20\x22Premium\x20Users\x22','Error:\x20Cannot\x20open\x20folder\x20in\x20web\x20browser.\x20Use\x20a\x20segment\x20name\x20instead.','List\x20segment\x20folders\x20under\x20a\x20parent\x20segment','Resolving\x20\x27','Fetching\x20parent\x20segment\x20details...','getSegment','Use:\x20tdx\x20ps\x20desc','Error:\x20Cannot\x20open\x20parent\x20segment\x20with\x20this\x20command.','segment:describe','toLocaleString','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','βœ”\x20Query\x20completed:\x20Processed\x20','\x20rows\x20','\x20\x20Segment\x20name:\x20','SQL\x20query:\x0a','format','Error:\x20Cannot\x20show\x20schema\x20for\x20parent\x20segment\x20with\x20this\x20command.','Get\x20SQL\x20query\x20for\x20child\x20segment','Parent\x20name:\x20','\x20\x20Cause:\x20','Resolved\x20parent\x20ID:\x20','json','name','folderPath','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22','36SQlPQk','segmentName','Use:\x20tdx\x20sg\x20view\x20<name>\x20\x20#\x20To\x20show\x20folder\x20details','SEGMENT_FOLDER_NOT_FOUND','test','Error:\x20Segment\x20name\x20or\x20--path\x20is\x20required','\x27...','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20desc\x20<path/to/segment.yml>','jobId','Segment\x20ID\x20missing\x20from\x20resolved\x20path','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20view\x20<path/to/segment.yml>','Resolved\x20YAML\x20file:\x20','Usage:\x20tdx\x20sg\x20desc\x20<name>','Cannot\x20get\x20SQL\x20for\x20parent\x20segment\x20with\x20this\x20command.\x20Use:\x20tdx\x20ps\x20sql','getSegmentSQLFromYaml','SEGMENT_NOT_FOUND','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','web','Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>','segment:view','jsonl','Error:\x20Folder\x20or\x20segment\x20name,\x20or\x20YAML\x20file\x20path\x20is\x20required','Use:\x20tdx\x20ps\x20show','message','folder','\x20\x20tdx\x20sg\x20desc\x20\x22Premium\x20Users\x22','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20\x20\x20\x20\x20#\x20View\x20child\x20segment\x20details','parentId','5BQiLkF','Folder\x20ID:\x20','segment:sql','Folder\x20ID\x20missing\x20from\x20resolved\x20path','1897996rBhdMy','resolveParentId','Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required','error','INVALID_ARGUMENT','limit','Resolved\x20type:\x20','red','Usage:\x20tdx\x20segment\x20describe\x20<path>','\x27\x20with\x20ID:\x20','segment:desc','setJobId','Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.','Options:'];a36_0x41b3=function(){return _0x429fa7;};return a36_0x41b3();}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 a36_0x16767b from'chalk';async function resolveSegmentTarget(_0x33a9fa,_0x2fb360,_0x21a6e7){const _0x274b16=a36_0x44bc;if(isYamlFilePath(_0x33a9fa))try{const _0x4948d2=await resolveYamlFilePath(_0x33a9fa);return _0x21a6e7&&(console[_0x274b16(0x155)](_0x274b16(0x1ea)+_0x33a9fa),console['error'](_0x274b16(0x1aa)+_0x4948d2[_0x274b16(0x169)]),console[_0x274b16(0x155)](_0x274b16(0x1d3)+_0x4948d2[_0x274b16(0x1e0)]),console[_0x274b16(0x155)](_0x274b16(0x17f)+(_0x4948d2[_0x274b16(0x1dd)]||_0x274b16(0x1a4))),console[_0x274b16(0x155)](_0x274b16(0x199)+_0x4948d2[_0x274b16(0x1bd)])),_0x4948d2[_0x274b16(0x1bd)];}catch(_0x369f7f){throw new SDKError(ErrorCode[_0x274b16(0x156)],_0x274b16(0x1c5)+_0x369f7f['message']);}if(!_0x2fb360)throw new SDKError(ErrorCode[_0x274b16(0x156)],_0x274b16(0x1ef));return _0x2fb360+'/'+_0x33a9fa;}export class SegmentDescribeCommand extends BaseCommand{[a36_0xccb750(0x1dc)]=a36_0xccb750(0x1ce);['description']='Show\x20segment\x20or\x20folder\x20details';async[a36_0xccb750(0x172)](_0x17910d){const _0x14a9fe=a36_0xccb750,{options:_0x55918e,args:_0x3cbb39,tdx:_0x4b3629}=_0x17910d,_0x161d13=_0x3cbb39[0x0],_0x5f3b75=!_0x161d13&&!!_0x55918e[_0x14a9fe(0x169)],_0x44c29f=_0x161d13||_0x55918e[_0x14a9fe(0x169)];if(!_0x44c29f)return console['error'](_0x14a9fe(0x197)),console[_0x14a9fe(0x155)](_0x14a9fe(0x15a)),console[_0x14a9fe(0x155)](_0x14a9fe(0x1c3)),console[_0x14a9fe(0x155)]('\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22'),console[_0x14a9fe(0x155)](_0x14a9fe(0x1de)),console['error'](_0x14a9fe(0x180)),console[_0x14a9fe(0x155)](_0x14a9fe(0x186)),0x1;try{const _0x24767f=_0x55918e['segmentPath'];let _0x249a8c=_0x44c29f;!_0x5f3b75&&_0x24767f&&!_0x44c29f[_0x14a9fe(0x16b)]('/')&&(_0x249a8c=_0x24767f+'/'+_0x44c29f,_0x55918e['verbose']&&console[_0x14a9fe(0x155)](_0x14a9fe(0x19e)+_0x249a8c));const _0x59d97f=await withSpinner(_0x14a9fe(0x1c2)+_0x249a8c+_0x14a9fe(0x1e5),()=>_0x4b3629[_0x14a9fe(0x16a)][_0x14a9fe(0x175)](_0x249a8c),{'verbose':_0x55918e['verbose']}),_0x5bca01=_0x59d97f[_0x14a9fe(0x1b7)];_0x55918e[_0x14a9fe(0x1a3)]&&(console[_0x14a9fe(0x155)](_0x14a9fe(0x158)+_0x5bca01[_0x14a9fe(0x191)]),console[_0x14a9fe(0x155)](_0x14a9fe(0x1b3)+_0x5bca01['parentId']),_0x5bca01[_0x14a9fe(0x173)]&&console[_0x14a9fe(0x155)](_0x14a9fe(0x14f)+_0x5bca01[_0x14a9fe(0x173)]),_0x5bca01[_0x14a9fe(0x19a)]&&console[_0x14a9fe(0x155)](_0x14a9fe(0x1a8)+_0x5bca01[_0x14a9fe(0x19a)]));if(_0x5bca01[_0x14a9fe(0x191)]===_0x14a9fe(0x168)){const _0x363f90=await withSpinner(_0x14a9fe(0x1ca),()=>_0x4b3629[_0x14a9fe(0x16a)]['getParent'](_0x5bca01[_0x14a9fe(0x14d)]),{'verbose':_0x55918e[_0x14a9fe(0x1a3)]});await handleSingleObjectOutput(_0x363f90[_0x14a9fe(0x1b7)],_0x55918e);}else{if(_0x5bca01[_0x14a9fe(0x191)]==='folder'){if(!_0x5bca01[_0x14a9fe(0x173)])throw new SDKError(ErrorCode['SEGMENT_FOLDER_NOT_FOUND'],'Folder\x20ID\x20missing\x20from\x20resolved\x20path');const _0x4fddf8=await withSpinner('Fetching\x20folder\x20details...',()=>_0x4b3629['segment']['getFolder'](_0x5bca01[_0x14a9fe(0x173)]),{'verbose':_0x55918e[_0x14a9fe(0x1a3)]});await handleSingleObjectOutput(_0x4fddf8[_0x14a9fe(0x1b7)],_0x55918e);}else{if(_0x5bca01[_0x14a9fe(0x191)]==='segment'){if(!_0x5bca01[_0x14a9fe(0x19a)])throw new SDKError(ErrorCode[_0x14a9fe(0x1ee)],_0x14a9fe(0x1e8));const _0x1a2659=await withSpinner(_0x14a9fe(0x17d),()=>_0x4b3629[_0x14a9fe(0x16a)][_0x14a9fe(0x1cb)](_0x5bca01[_0x14a9fe(0x14d)],_0x5bca01[_0x14a9fe(0x19a)]),{'verbose':_0x55918e[_0x14a9fe(0x1a3)]});await handleSingleObjectOutput(_0x1a2659[_0x14a9fe(0x1b7)],_0x55918e);}}}return 0x0;}catch(_0x4bf5fe){if(_0x4bf5fe instanceof SDKError)return console['error']('Error:\x20'+_0x4bf5fe[_0x14a9fe(0x1f6)]),_0x4bf5fe[_0x14a9fe(0x19d)]&&console[_0x14a9fe(0x155)]('\x20\x20Cause:\x20'+_0x4bf5fe[_0x14a9fe(0x19d)]),0x1;throw _0x4bf5fe;}}}function a36_0x44bc(_0x4c9529,_0x480211){_0x4c9529=_0x4c9529-0x14a;const _0x41b364=a36_0x41b3();let _0x44bced=_0x41b364[_0x4c9529];return _0x44bced;}export class SegmentShowCommand extends BaseCommand{[a36_0xccb750(0x1dc)]='segment:show';['description']='Execute\x20child\x20segment\x20SQL\x20query\x20and\x20show\x20results';async[a36_0xccb750(0x172)](_0x2188c7){const _0x360e55=a36_0xccb750,{options:_0x207d56,args:_0x11da8c,tdx:_0x37c64e}=_0x2188c7,_0x2ff8fb=_0x11da8c[0x0];if(!_0x2ff8fb)return console[_0x360e55(0x155)]('Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required'),console[_0x360e55(0x155)]('Usage:\x20tdx\x20sg\x20show\x20<name>'),console[_0x360e55(0x155)](_0x360e55(0x1b1)),console['error'](_0x360e55(0x1c3)),console['error']('\x20\x20tdx\x20sg\x20show\x20\x22Premium\x20Users\x22'),console[_0x360e55(0x155)]('\x20\x20tdx\x20sg\x20show\x20segments/my-audience/premium-users.yml'),0x1;try{const _0x3a9945=_0x207d56[_0x360e55(0x169)],_0x5666d8=await resolveSegmentTarget(_0x2ff8fb,_0x3a9945,_0x207d56[_0x360e55(0x1a3)]);_0x207d56[_0x360e55(0x1a3)]&&console[_0x360e55(0x155)](_0x360e55(0x18c)+_0x5666d8);const _0x3af244=await withSpinner(_0x360e55(0x1c9)+_0x2ff8fb+_0x360e55(0x1e5),()=>_0x37c64e[_0x360e55(0x16a)][_0x360e55(0x175)](_0x5666d8),{'verbose':_0x207d56[_0x360e55(0x1a3)]}),_0x5dff3b=_0x3af244['data'];_0x207d56[_0x360e55(0x1a3)]&&(console[_0x360e55(0x155)](_0x360e55(0x158)+_0x5dff3b['type']),console[_0x360e55(0x155)](_0x360e55(0x1b3)+_0x5dff3b[_0x360e55(0x14d)]));if(_0x5dff3b[_0x360e55(0x191)]===_0x360e55(0x14a))return console[_0x360e55(0x155)](_0x360e55(0x15e)),console['error'](_0x360e55(0x1e1)),0x1;if(_0x5dff3b['type']==='parent')return console[_0x360e55(0x155)](_0x360e55(0x1af)),console['error'](_0x360e55(0x1f5)),0x1;if(!_0x5dff3b['segmentId'])throw new SDKError(ErrorCode[_0x360e55(0x1ee)],_0x360e55(0x1e8));const _0x4c83a2=await withSpinner(_0x360e55(0x183),()=>_0x37c64e[_0x360e55(0x16a)][_0x360e55(0x1ad)](_0x5dff3b[_0x360e55(0x14d)],_0x5dff3b[_0x360e55(0x19a)]),{'verbose':_0x207d56[_0x360e55(0x1a3)]});let _0x30f400=_0x4c83a2[_0x360e55(0x1b7)];const _0x3f46d1=resolveLimit(_0x207d56[_0x360e55(0x157)],DEFAULT_DISPLAY_LIMIT),_0x34ca13=/\bLIMIT\s+\d+/i[_0x360e55(0x1e3)](_0x30f400);!_0x34ca13&&(_0x30f400=_0x30f400[_0x360e55(0x177)]()[_0x360e55(0x1ac)](/;+$/,''),_0x30f400=_0x360e55(0x1ba)+_0x30f400+_0x360e55(0x190)+_0x3f46d1);_0x207d56[_0x360e55(0x1a3)]&&console['error'](_0x360e55(0x1d4)+_0x30f400);const _0x23bda3=await withProgressSpinner(_0x360e55(0x18a),async _0x588124=>{const _0x1376fe=_0x360e55,_0x5e8e70=await _0x37c64e[_0x1376fe(0x1b8)]['execute'](_0x30f400,{'catalog':'td','schema':_0x1376fe(0x163),'onJobId':_0x43bbfc=>{const _0x53ac4c=_0x1376fe;_0x588124[_0x53ac4c(0x15d)](_0x43bbfc);}});return _0x5e8e70;},{'verbose':_0x207d56[_0x360e55(0x1a3)]}),_0x5aa002=_0x23bda3[_0x360e55(0x1b7)],_0x41ec28=_0x5aa002[_0x360e55(0x1e7)]?_0x360e55(0x1c4)+_0x5aa002[_0x360e55(0x1e7)]+']':'';return console['error'](_0x360e55(0x1d1)+_0x5aa002['stats'][_0x360e55(0x181)][_0x360e55(0x1cf)]()+_0x360e55(0x1d2)+('in\x20'+formatElapsed(_0x5aa002[_0x360e55(0x1bf)][_0x360e55(0x1a0)])+_0x41ec28)),await handleQueryOutput(_0x5aa002,_0x207d56),0x0;}catch(_0x4a6656){if(_0x4a6656 instanceof SDKError)return console[_0x360e55(0x155)](_0x360e55(0x1ab)+_0x4a6656['code']+']'),console[_0x360e55(0x155)]('\x0a'+_0x4a6656[_0x360e55(0x1f6)]),0x1;throw _0x4a6656;}}}export class SegmentFolderListCommand extends BaseCommand{[a36_0xccb750(0x1dc)]='segment:folder:list';[a36_0xccb750(0x174)]=a36_0xccb750(0x1c8);async[a36_0xccb750(0x172)](_0x5cdbe5){const _0x13ca31=a36_0xccb750,{options:_0x460a8d,args:_0x18c69e,tdx:_0x59e0f5}=_0x5cdbe5;if(_0x18c69e[_0x13ca31(0x16e)]===0x0)return console[_0x13ca31(0x155)](_0x13ca31(0x1a7)),console[_0x13ca31(0x155)](_0x13ca31(0x1f1)),0x1;const _0x8addfa=_0x18c69e[0x0];try{_0x460a8d[_0x13ca31(0x1a3)]&&(console['error'](_0x13ca31(0x198)+_0x460a8d[_0x13ca31(0x1b5)]),console[_0x13ca31(0x155)](_0x13ca31(0x1d8)+_0x8addfa));const _0x232943=await withSpinner(_0x13ca31(0x1ae)+_0x8addfa+_0x13ca31(0x1e5),()=>_0x59e0f5['segment'][_0x13ca31(0x153)](_0x8addfa),{'verbose':_0x460a8d['verbose']}),_0x9d12b=_0x232943[_0x13ca31(0x1b7)];_0x460a8d[_0x13ca31(0x1a3)]&&console['error'](_0x13ca31(0x1da)+_0x9d12b);const _0x566e47=await withSpinner(_0x13ca31(0x16d)+_0x8addfa+'\x27...',()=>_0x59e0f5[_0x13ca31(0x16a)][_0x13ca31(0x18d)](_0x9d12b),{'verbose':_0x460a8d[_0x13ca31(0x1a3)]}),_0x17fde8=_0x566e47[_0x13ca31(0x1b7)];return console[_0x13ca31(0x155)](_0x13ca31(0x1a9)+_0x17fde8[_0x13ca31(0x16e)]+'\x20folder'+(_0x17fde8[_0x13ca31(0x16e)]!==0x1?'s':'')),await handleSDKOutput(_0x17fde8,_0x460a8d),0x0;}catch(_0x302161){if(_0x302161 instanceof SDKError)return console[_0x13ca31(0x155)](_0x13ca31(0x192)+_0x302161[_0x13ca31(0x1f6)]),_0x302161[_0x13ca31(0x19d)]&&console[_0x13ca31(0x155)](_0x13ca31(0x1d9)+_0x302161['cause']),0x1;throw _0x302161;}}}export class SegmentFolderShowCommand extends BaseCommand{[a36_0xccb750(0x1dc)]=a36_0xccb750(0x1b2);[a36_0xccb750(0x174)]=a36_0xccb750(0x193);async[a36_0xccb750(0x172)](_0xc5b58){const _0x10868c=a36_0xccb750,{options:_0x13a39b,args:_0x34eff3,tdx:_0x4eaff0}=_0xc5b58;if(_0x34eff3[_0x10868c(0x16e)]===0x0)return console[_0x10868c(0x155)](_0x10868c(0x18e)),console[_0x10868c(0x155)](_0x10868c(0x185)),0x1;try{const {parentId:_0x471533,childId:_0x1f472e}=parseSegmentRef(_0x34eff3[0x0]);_0x13a39b[_0x10868c(0x1a3)]&&(console[_0x10868c(0x155)](_0x10868c(0x198)+_0x13a39b[_0x10868c(0x1b5)]),console[_0x10868c(0x155)](_0x10868c(0x1d8)+_0x471533),_0x1f472e&&console['error']('Folder\x20name:\x20'+_0x1f472e));if(!_0x1f472e)return console['error']('Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)'),0x1;const _0x37da6a=await withSpinner(_0x10868c(0x1ae)+_0x471533+_0x10868c(0x1e5),()=>_0x4eaff0['segment'][_0x10868c(0x153)](_0x471533),{'verbose':_0x13a39b[_0x10868c(0x1a3)]}),_0x1d9368=_0x37da6a[_0x10868c(0x1b7)];_0x13a39b['verbose']&&console[_0x10868c(0x155)](_0x10868c(0x1da)+_0x1d9368);const _0x21ccb4=await withSpinner(_0x10868c(0x161)+_0x1f472e+_0x10868c(0x1e5),()=>_0x4eaff0[_0x10868c(0x16a)]['resolveFolderId'](_0x1d9368,_0x1f472e),{'verbose':_0x13a39b[_0x10868c(0x1a3)]}),_0x1faf84=_0x21ccb4[_0x10868c(0x1b7)];_0x13a39b[_0x10868c(0x1a3)]&&console[_0x10868c(0x155)](_0x10868c(0x167)+_0x1faf84);const _0x50a6d8=await withSpinner(_0x10868c(0x17c)+_0x1f472e+'\x27...',()=>_0x4eaff0[_0x10868c(0x16a)][_0x10868c(0x162)](_0x1faf84),{'verbose':_0x13a39b[_0x10868c(0x1a3)]});return await handleSDKOutput([_0x50a6d8[_0x10868c(0x1b7)]],_0x13a39b),0x0;}catch(_0x163246){if(_0x163246 instanceof SDKError)return console['error'](_0x10868c(0x192)+_0x163246['message']),_0x163246[_0x10868c(0x19d)]&&console[_0x10868c(0x155)](_0x10868c(0x1d9)+_0x163246[_0x10868c(0x19d)]),0x1;throw _0x163246;}}}export class SegmentSQLCommand extends BaseCommand{[a36_0xccb750(0x1dc)]=a36_0xccb750(0x150);['description']=a36_0xccb750(0x1d7);async[a36_0xccb750(0x172)](_0x44a064){const _0x4bfe48=a36_0xccb750,{options:_0x458a59,args:_0x475593}=_0x44a064,_0x4abf7d=_0x458a59,_0x2b6cb3=_0x4abf7d['path'],_0x4544e4=_0x475593[0x0];if(!_0x4544e4&&!_0x2b6cb3)return console['error'](a36_0x16767b[_0x4bfe48(0x159)](_0x4bfe48(0x1e4))),console[_0x4bfe48(0x155)]('Usage:'),console[_0x4bfe48(0x155)]('\x20\x20Server-side\x20segment:\x20\x20tdx\x20sg\x20sql\x20<name>'),console[_0x4bfe48(0x155)]('\x20\x20Local\x20YAML\x20file:\x20\x20\x20\x20\x20\x20tdx\x20sg\x20sql\x20--path\x20<file-path>'),console[_0x4bfe48(0x155)](_0x4bfe48(0x1c3)),console[_0x4bfe48(0x155)](_0x4bfe48(0x1c6)),console[_0x4bfe48(0x155)](_0x4bfe48(0x178)),0x1;if(_0x4544e4&&_0x2b6cb3)return console[_0x4bfe48(0x155)](a36_0x16767b[_0x4bfe48(0x159)](_0x4bfe48(0x196))),0x1;try{let _0x23095f;if(_0x2b6cb3)_0x23095f=await this[_0x4bfe48(0x1c0)](_0x2b6cb3,_0x44a064);else{if(isYamlFilePath(_0x4544e4))return console[_0x4bfe48(0x155)](a36_0x16767b[_0x4bfe48(0x159)]('Error:\x20YAML\x20file\x20paths\x20must\x20be\x20specified\x20with\x20--path\x20option')),console['error'](_0x4bfe48(0x160)+_0x4544e4),0x1;else _0x23095f=await this[_0x4bfe48(0x16c)](_0x4544e4,_0x44a064);}return _0x458a59[_0x4bfe48(0x1d5)]===_0x4bfe48(0x1db)||_0x458a59[_0x4bfe48(0x1d5)]===_0x4bfe48(0x1f3)?await handleSDKOutput([{'sql':_0x23095f}],_0x458a59):console['log'](_0x23095f),0x0;}catch(_0x40ee73){if(_0x40ee73 instanceof SDKError)return console['error'](_0x4bfe48(0x192)+_0x40ee73[_0x4bfe48(0x1f6)]),_0x40ee73[_0x4bfe48(0x19d)]&&console[_0x4bfe48(0x155)](_0x4bfe48(0x1d9)+_0x40ee73[_0x4bfe48(0x19d)]),0x1;throw _0x40ee73;}}async[a36_0xccb750(0x1c0)](_0x429f9a,_0x19e930){const _0x55ae0e=a36_0xccb750,{options:_0x581ec8,tdx:_0x3a5d54}=_0x19e930;let _0x284c68;try{_0x284c68=await resolveYamlFilePath(_0x429f9a);}catch(_0x4cdc21){throw new SDKError(ErrorCode[_0x55ae0e(0x156)],_0x55ae0e(0x1c5)+_0x4cdc21['message']);}_0x581ec8[_0x55ae0e(0x1a3)]&&console['error'](_0x55ae0e(0x1be)+_0x284c68[_0x55ae0e(0x169)]+'/'+_0x284c68[_0x55ae0e(0x1e0)]);const _0x389a67=await withSpinner(_0x55ae0e(0x188),()=>_0x3a5d54[_0x55ae0e(0x16a)][_0x55ae0e(0x1ed)](_0x284c68[_0x55ae0e(0x1a5)],_0x284c68[_0x55ae0e(0x169)],_0x284c68[_0x55ae0e(0x1e0)]),{'verbose':_0x581ec8[_0x55ae0e(0x1a3)]});return _0x389a67[_0x55ae0e(0x1b7)];}async['getSQLFromServerSegment'](_0x4ccd16,_0x36c416){const _0x7ff028=a36_0xccb750,{options:_0x49edd9,tdx:_0xde3858}=_0x36c416,_0x456e2b=_0x49edd9[_0x7ff028(0x169)],_0x59df80=await resolveSegmentTarget(_0x4ccd16,_0x456e2b,_0x49edd9[_0x7ff028(0x1a3)]);_0x49edd9[_0x7ff028(0x1a3)]&&console[_0x7ff028(0x155)](_0x7ff028(0x18c)+_0x59df80);const _0x2101c0=await withSpinner('Resolving\x20\x27'+_0x4ccd16+'\x27...',()=>_0xde3858['segment']['resolvePathToResource'](_0x59df80),{'verbose':_0x49edd9[_0x7ff028(0x1a3)]}),_0x105078=_0x2101c0['data'];_0x49edd9[_0x7ff028(0x1a3)]&&(console[_0x7ff028(0x155)](_0x7ff028(0x158)+_0x105078['type']),console[_0x7ff028(0x155)]('Parent\x20ID:\x20'+_0x105078[_0x7ff028(0x14d)]));if(_0x105078[_0x7ff028(0x191)]===_0x7ff028(0x14a))throw new SDKError(ErrorCode[_0x7ff028(0x156)],'Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.\x20Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.');if(_0x105078['type']===_0x7ff028(0x168))throw new SDKError(ErrorCode[_0x7ff028(0x156)],_0x7ff028(0x1ec));if(!_0x105078[_0x7ff028(0x19a)])throw new SDKError(ErrorCode[_0x7ff028(0x1ee)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x19f0ed=await withSpinner(_0x7ff028(0x183),()=>_0xde3858[_0x7ff028(0x16a)]['getSegmentSQL'](_0x105078[_0x7ff028(0x14d)],_0x105078[_0x7ff028(0x19a)]),{'verbose':_0x49edd9['verbose']});return _0x19f0ed[_0x7ff028(0x1b7)];}}export class SegmentFolderCreateCommand extends BaseCommand{[a36_0xccb750(0x1dc)]=a36_0xccb750(0x195);['description']=a36_0xccb750(0x1b6);async[a36_0xccb750(0x172)](_0x3f7429){const _0x58435d=a36_0xccb750,{options:_0x51565d,args:_0x2f5c33,tdx:_0x5837cd}=_0x3f7429,_0x43b390=_0x51565d;if(_0x2f5c33[_0x58435d(0x16e)]<0x2)return console[_0x58435d(0x155)](_0x58435d(0x154)),console[_0x58435d(0x155)]('Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]'),0x1;const _0x59b1dc=_0x2f5c33[0x0],_0x44de2e=_0x2f5c33[0x1];_0x43b390[_0x58435d(0x1a3)]&&(console[_0x58435d(0x155)](_0x58435d(0x198)+_0x43b390[_0x58435d(0x1b5)]),console[_0x58435d(0x155)](_0x58435d(0x19c)+_0x59b1dc),console[_0x58435d(0x155)](_0x58435d(0x164)+_0x44de2e));let _0x3b9530;if(_0x43b390['parentFolder']){const _0x4f89c1=_0x43b390[_0x58435d(0x184)],_0x994b01=await withSpinner(_0x58435d(0x1ae)+_0x59b1dc+'\x27...',()=>_0x5837cd[_0x58435d(0x16a)][_0x58435d(0x153)](_0x59b1dc),{'verbose':_0x43b390[_0x58435d(0x1a3)]}),_0x4cc02a=_0x994b01[_0x58435d(0x1b7)],_0x5e7a9b=await withSpinner('Resolving\x20parent\x20folder\x20\x27'+_0x4f89c1+_0x58435d(0x1e5),()=>_0x5837cd['segment'][_0x58435d(0x182)](_0x4cc02a,_0x4f89c1),{'verbose':_0x43b390[_0x58435d(0x1a3)]});_0x3b9530=_0x5e7a9b['data'],_0x43b390[_0x58435d(0x1a3)]&&console[_0x58435d(0x155)]('Resolved\x20parent\x20folder\x20ID:\x20'+_0x3b9530);}const _0x15ef78={'name':_0x44de2e,'description':_0x43b390[_0x58435d(0x174)],'parentFolderId':_0x3b9530},_0x42d1d2=await withSpinner(_0x58435d(0x1b0)+_0x44de2e+_0x58435d(0x1e5),()=>_0x5837cd['segment']['createFolder'](_0x59b1dc,_0x15ef78),{'verbose':_0x43b390[_0x58435d(0x1a3)]}),_0x1c2a9c=_0x42d1d2[_0x58435d(0x1b7)];return console['error'](_0x58435d(0x1a1)+_0x1c2a9c[_0x58435d(0x1dc)]+_0x58435d(0x15b)+_0x1c2a9c['id']),await handleSDKOutput([_0x1c2a9c],_0x43b390),0x0;}}export class SegmentViewCommand extends BaseCommand{[a36_0xccb750(0x1dc)]=a36_0xccb750(0x1f2);[a36_0xccb750(0x174)]=a36_0xccb750(0x176);async[a36_0xccb750(0x172)](_0x5b872d){const _0x5a3eb7=a36_0xccb750,{options:_0x371264,args:_0x48e7e7,tdx:_0x3ad76e}=_0x5b872d,_0x488786=_0x48e7e7[0x0];if(!_0x488786)return console['error'](_0x5a3eb7(0x1f4)),console[_0x5a3eb7(0x155)]('Usage:\x20tdx\x20sg\x20view\x20<name>\x20[-w]'),console['error'](_0x5a3eb7(0x1e9)),console[_0x5a3eb7(0x155)](_0x5a3eb7(0x15f)),console['error'](_0x5a3eb7(0x1a6)),console['error']('Examples:'),console[_0x5a3eb7(0x155)]('\x20\x20tdx\x20sg\x20view\x20\x22Marketing\x22\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20folder\x20details'),console[_0x5a3eb7(0x155)](_0x5a3eb7(0x14c)),console[_0x5a3eb7(0x155)](_0x5a3eb7(0x18b)),console[_0x5a3eb7(0x155)](_0x5a3eb7(0x1b4)),0x1;try{const _0xf8c3d0=_0x371264[_0x5a3eb7(0x169)],_0x5a9e8a=await resolveSegmentTarget(_0x488786,_0xf8c3d0,_0x371264[_0x5a3eb7(0x1a3)]);_0x371264[_0x5a3eb7(0x1a3)]&&console['error'](_0x5a3eb7(0x18c)+_0x5a9e8a);const _0x1f3553=await withSpinner(_0x5a3eb7(0x1c9)+_0x488786+_0x5a3eb7(0x1e5),()=>_0x3ad76e[_0x5a3eb7(0x16a)][_0x5a3eb7(0x175)](_0x5a9e8a),{'verbose':_0x371264[_0x5a3eb7(0x1a3)]}),_0x4d9f3f=_0x1f3553['data'];_0x371264['verbose']&&(console[_0x5a3eb7(0x155)](_0x5a3eb7(0x158)+_0x4d9f3f[_0x5a3eb7(0x191)]),console['error'](_0x5a3eb7(0x1b3)+_0x4d9f3f[_0x5a3eb7(0x14d)]),_0x4d9f3f['folderId']&&console[_0x5a3eb7(0x155)](_0x5a3eb7(0x14f)+_0x4d9f3f[_0x5a3eb7(0x173)]),_0x4d9f3f[_0x5a3eb7(0x19a)]&&console['error'](_0x5a3eb7(0x1a8)+_0x4d9f3f[_0x5a3eb7(0x19a)]));if(_0x371264[_0x5a3eb7(0x1f0)]){if(_0x4d9f3f[_0x5a3eb7(0x191)]===_0x5a3eb7(0x14a))return console[_0x5a3eb7(0x155)](_0x5a3eb7(0x1c7)),0x1;if(_0x4d9f3f[_0x5a3eb7(0x191)]===_0x5a3eb7(0x168))return console[_0x5a3eb7(0x155)](_0x5a3eb7(0x1cd)),console[_0x5a3eb7(0x155)](_0x5a3eb7(0x179)),0x1;if(!_0x4d9f3f[_0x5a3eb7(0x19a)])throw new SDKError(ErrorCode[_0x5a3eb7(0x1ee)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x55328e=getConsoleNextUrl(_0x371264[_0x5a3eb7(0x1b5)],'/app/ps/'+_0x4d9f3f[_0x5a3eb7(0x14d)]+'/e/'+_0x4d9f3f[_0x5a3eb7(0x19a)]);return console[_0x5a3eb7(0x155)](a36_0x16767b[_0x5a3eb7(0x17a)]('βœ”')+'\x20Opening\x20'+a36_0x16767b[_0x5a3eb7(0x17b)](_0x55328e)),openBrowser(_0x55328e),0x0;}if(_0x4d9f3f['type']==='folder'){if(!_0x4d9f3f['folderId'])throw new SDKError(ErrorCode[_0x5a3eb7(0x1e2)],_0x5a3eb7(0x151));const _0x1a4ace=await withSpinner(_0x5a3eb7(0x19f),()=>_0x3ad76e[_0x5a3eb7(0x16a)][_0x5a3eb7(0x162)](_0x4d9f3f[_0x5a3eb7(0x173)]),{'verbose':_0x371264[_0x5a3eb7(0x1a3)]});await handleSingleObjectOutput(_0x1a4ace[_0x5a3eb7(0x1b7)],_0x371264);}else{if(_0x4d9f3f['type']==='segment'){if(!_0x4d9f3f[_0x5a3eb7(0x19a)])throw new SDKError(ErrorCode[_0x5a3eb7(0x1ee)],_0x5a3eb7(0x1e8));const _0x39455f=await withSpinner(_0x5a3eb7(0x17d),()=>_0x3ad76e[_0x5a3eb7(0x16a)][_0x5a3eb7(0x1cb)](_0x4d9f3f[_0x5a3eb7(0x14d)],_0x4d9f3f[_0x5a3eb7(0x19a)]),{'verbose':_0x371264[_0x5a3eb7(0x1a3)]}),_0x49e446=getConsoleNextUrl(_0x371264[_0x5a3eb7(0x1b5)],'/app/ps/'+_0x4d9f3f['parentId']+_0x5a3eb7(0x19b)+_0x4d9f3f[_0x5a3eb7(0x19a)]),_0x4e9a5f=_0x39455f[_0x5a3eb7(0x1b7)];_0x4e9a5f[_0x5a3eb7(0x16f)]=_0x49e446,await handleSingleObjectOutput(_0x4e9a5f,_0x371264);}else return console[_0x5a3eb7(0x155)](_0x5a3eb7(0x1c1)),console[_0x5a3eb7(0x155)](_0x5a3eb7(0x18f)),0x1;}return 0x0;}catch(_0x223f98){if(_0x223f98 instanceof SDKError)return console[_0x5a3eb7(0x155)](_0x5a3eb7(0x192)+_0x223f98[_0x5a3eb7(0x1f6)]),_0x223f98[_0x5a3eb7(0x19d)]&&console[_0x5a3eb7(0x155)]('\x20\x20Cause:\x20'+_0x223f98[_0x5a3eb7(0x19d)]),0x1;throw _0x223f98;}}}export const SegmentInfoCommand=SegmentViewCommand;export class SegmentDescCommand extends BaseCommand{['name']=a36_0xccb750(0x15c);[a36_0xccb750(0x174)]=a36_0xccb750(0x1b9);async['execute'](_0x4eb090){const _0xe6e4c7=a36_0xccb750,{options:_0x59fb46,args:_0x5c382b,tdx:_0x5babbb}=_0x4eb090,_0xab9a3a=_0x5c382b[0x0];if(!_0xab9a3a)return console[_0xe6e4c7(0x155)](_0xe6e4c7(0x187)),console['error'](_0xe6e4c7(0x1eb)),console[_0xe6e4c7(0x155)](_0xe6e4c7(0x1e6)),console[_0xe6e4c7(0x155)]('Examples:'),console[_0xe6e4c7(0x155)](_0xe6e4c7(0x14b)),console[_0xe6e4c7(0x155)](_0xe6e4c7(0x1bc)),0x1;try{const _0xa69a66=_0x59fb46['parentSegment'],_0x508bab=await resolveSegmentTarget(_0xab9a3a,_0xa69a66,_0x59fb46[_0xe6e4c7(0x1a3)]);_0x59fb46[_0xe6e4c7(0x1a3)]&&console[_0xe6e4c7(0x155)](_0xe6e4c7(0x18c)+_0x508bab);const _0x3fda76=await withSpinner(_0xe6e4c7(0x1c9)+_0xab9a3a+_0xe6e4c7(0x1e5),()=>_0x5babbb[_0xe6e4c7(0x16a)]['resolvePathToResource'](_0x508bab),{'verbose':_0x59fb46[_0xe6e4c7(0x1a3)]}),_0xc7537e=_0x3fda76[_0xe6e4c7(0x1b7)];_0x59fb46[_0xe6e4c7(0x1a3)]&&(console['error']('Resolved\x20type:\x20'+_0xc7537e['type']),console['error'](_0xe6e4c7(0x1b3)+_0xc7537e[_0xe6e4c7(0x14d)]));if(_0xc7537e[_0xe6e4c7(0x191)]===_0xe6e4c7(0x14a))return console[_0xe6e4c7(0x155)]('Error:\x20Cannot\x20show\x20schema\x20for\x20a\x20folder.'),console['error'](_0xe6e4c7(0x1d0)),0x1;if(_0xc7537e[_0xe6e4c7(0x191)]===_0xe6e4c7(0x168))return console[_0xe6e4c7(0x155)](_0xe6e4c7(0x1d6)),console[_0xe6e4c7(0x155)](_0xe6e4c7(0x1cc)),0x1;if(!_0xc7537e[_0xe6e4c7(0x19a)])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0xe6e4c7(0x1e8));const _0x59e2bb=await withSpinner(_0xe6e4c7(0x183),()=>_0x5babbb[_0xe6e4c7(0x16a)][_0xe6e4c7(0x1ad)](_0xc7537e['parentId'],_0xc7537e[_0xe6e4c7(0x19a)]),{'verbose':_0x59fb46[_0xe6e4c7(0x1a3)]}),_0x39c30c=_0x59e2bb['data'],_0x6ddba7=await executeSchemaQuery(_0x39c30c,_0x5babbb,_0x59fb46);return await handleQueryOutput(_0x6ddba7,_0x59fb46),0x0;}catch(_0x386ed7){if(_0x386ed7 instanceof SDKError)return console[_0xe6e4c7(0x155)](_0xe6e4c7(0x192)+_0x386ed7[_0xe6e4c7(0x1f6)]),_0x386ed7['cause']&&console['error'](_0xe6e4c7(0x1d9)+_0x386ed7[_0xe6e4c7(0x19d)]),0x1;throw _0x386ed7;}}}
1
+ const a36_0x2a13a5=a36_0x4310;(function(_0x5cc326,_0x1fe04b){const _0x2fde9c=a36_0x4310,_0x490bc7=_0x5cc326();while(!![]){try{const _0x345d22=-parseInt(_0x2fde9c(0x1df))/0x1+parseInt(_0x2fde9c(0x1b8))/0x2*(parseInt(_0x2fde9c(0x1cc))/0x3)+-parseInt(_0x2fde9c(0x1bb))/0x4*(parseInt(_0x2fde9c(0x1e3))/0x5)+-parseInt(_0x2fde9c(0x205))/0x6*(-parseInt(_0x2fde9c(0x1fd))/0x7)+parseInt(_0x2fde9c(0x230))/0x8+parseInt(_0x2fde9c(0x23a))/0x9*(-parseInt(_0x2fde9c(0x255))/0xa)+-parseInt(_0x2fde9c(0x1b0))/0xb*(-parseInt(_0x2fde9c(0x20f))/0xc);if(_0x345d22===_0x1fe04b)break;else _0x490bc7['push'](_0x490bc7['shift']());}catch(_0x54290b){_0x490bc7['push'](_0x490bc7['shift']());}}}(a36_0xcee7,0x450aa));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner,formatElapsed}from'../utils/spinner.js';import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{executeSchemaQuery}from'../sdk/segment/fields-display.js';import{isYamlFilePath,resolveYamlFilePath}from'../sdk/segment/segment-path-parser.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{openBrowser}from'../utils/process.js';function a36_0xcee7(){const _0x205487=['url','getSegment','Error:\x20Cannot\x20execute\x20query\x20for\x20parent\x20segment\x20with\x20this\x20command.','Use:\x20tdx\x20sg\x20view\x20<name>\x20\x20#\x20To\x20show\x20folder\x20details','Creating\x20folder\x20\x27','cause','Create\x20segment\x20folder\x20for\x20organization','segment:sql','segmentId','\x20\x20tdx\x20sg\x20view\x20segments/my-audience/premium-users.yml','setJobId','\x20\x20Server-side\x20segment:\x20\x20tdx\x20sg\x20sql\x20<name>','Parent\x20segment:\x20','folderId','Site:\x20','SEGMENT_FOLDER_NOT_FOUND','Resolved\x20relative\x20path\x20to:\x20','Usage:\x20tdx\x20sg\x20view\x20<name>\x20[-w]','Get\x20SQL\x20query\x20for\x20child\x20segment','INVALID_ARGUMENT','resolveParentId','142856wkSEOR','green','Error:\x20Path\x20or\x20name\x20is\x20required','\x27\x20with\x20ID:\x20','Error:\x20Cannot\x20view\x20parent\x20segment\x20details\x20with\x20this\x20command.','\x20\x20Folder\x20path:\x20','Usage:\x20tdx\x20sg\x20show\x20<name>','parentFolder','66pvgujF','Resolving\x20path\x20\x27','Executing\x20segment\x20query...','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22','Fetching\x20SQL\x20from\x20rule...','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20\x20\x20\x20\x20#\x20View\x20child\x20segment\x20details','listFolders','Error:\x20Segment\x20name\x20or\x20--path\x20is\x20required','parentId','log','1126392RRsoCW','resolveFolderId','\x27...','getSegmentSQL','Use:\x20tdx\x20ps\x20desc','\x20\x20tdx\x20sg\x20desc\x20\x22Premium\x20Users\x22','folder','Segment\x20ID\x20missing\x20from\x20resolved\x20path','jsonl','parentSegment','Error:\x20Cannot\x20show\x20schema\x20for\x20parent\x20segment\x20with\x20this\x20command.','information_schema','json','Use:\x20tdx\x20ps\x20view\x20-w','SEGMENT_NOT_FOUND','resolvePathToResource','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','execute','Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>','query','Error:\x20Cannot\x20show\x20schema\x20for\x20a\x20folder.','\x20\x20tdx\x20sg\x20show\x20segments/my-audience/premium-users.yml','Target\x20path:\x20','description','getSQLFromYamlFile','Parent\x20ID:\x20','Error:\x20Specify\x20either\x20segment\x20name\x20or\x20--path,\x20not\x20both','\x20\x20Cause:\x20','\x20\x20tdx\x20sg\x20sql\x20\x22Premium\x20Users\x22','segment:desc','fullPath','type','in\x20','3325936vjpFBm','jobId','Error:\x20Folder\x20or\x20segment\x20name,\x20or\x20YAML\x20file\x20path\x20is\x20required','\x20\x20tdx\x20sg\x20view\x20\x22Marketing\x22\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20folder\x20details','Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>','Show\x20folder\x20or\x20child\x20segment\x20details','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','Resolving\x20folder\x20\x27','Resolved\x20type:\x20','Error:\x20YAML\x20file\x20paths\x20must\x20be\x20specified\x20with\x20--path\x20option','5013wyEAzq','/e/','\x20Opening\x20','/app/ps/','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20-w\x20\x20#\x20Open\x20segment\x20in\x20web\x20browser','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20desc\x20<path/to/segment.yml>','Use:\x20tdx\x20ps\x20view','Fetching\x20segment\x20details...','\x20\x20tdx\x20sg\x20desc\x20segments/my-audience/premium-users.yml','Resolving\x20parent\x20segment\x20\x27','Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20show\x20<path/to/segment.yml>','format','segment:folder:show','Cannot\x20get\x20SQL\x20for\x20parent\x20segment\x20with\x20this\x20command.\x20Use:\x20tdx\x20ps\x20sql','βœ–\x20Query\x20failed\x20[','path','Error:\x20','Resolved\x20YAML\x20file:\x20','folderPath','parent','Show\x20segment\x20or\x20folder\x20details','test','\x20[Job\x20ID:\x20','Resolving\x20\x27','Folder\x20name:\x20','2390YkYVLR','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','Examples:','Usage:\x20tdx\x20segment\x20describe\x20<path>','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22','Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required','\x20\x20tdx\x20sg\x20show\x20\x22Premium\x20Users\x22','red','replace','11kuOJQN','message','segmentName','Execute\x20child\x20segment\x20SQL\x20query\x20and\x20show\x20results','\x20\x20-w,\x20--web\x20\x20Open\x20segment\x20in\x20web\x20browser','stats','Folder\x20ID\x20missing\x20from\x20resolved\x20path','getSegmentSQLFromYaml','218ByIUaL','(root)','Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.\x20Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','228nuzycj','\x20\x20tdx\x20sg\x20sql\x20--path\x20segments/my-audience/premium-users.yml','Fetching\x20SQL\x20for\x20segment...','getSQLFromServerSegment','Listing\x20folders\x20for\x20parent\x20\x27','getParent','createFolder','Parent\x20name:\x20','limit','\x20\x20tdx\x20sg\x20sql\x20--path\x20','Resolved\x20parent\x20ID:\x20','segment','Resolved\x20folder\x20ID:\x20','Folder\x20ID:\x20','Fetching\x20folder\x20details...','Error:\x20Parent\x20segment\x20name\x20is\x20required','verbose','9129phLClA','processedRows','elapsedTimeMillis','Options:','Error:\x20Folder\x20reference\x20is\x20required','web','\x20\x20Parent\x20segment:\x20','segmentPath','error','Error:\x20Cannot\x20open\x20parent\x20segment\x20with\x20this\x20command.','Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]','Error:\x20Cannot\x20open\x20folder\x20in\x20web\x20browser.\x20Use\x20a\x20segment\x20name\x20instead.','Use:\x20tdx\x20ps\x20show','length','segment:show','\x20folder','site','data','SQL\x20query:\x0a','208401LXuxiO','SELECT\x20*\x20FROM\x20(\x0a','Usage:\x20tdx\x20sg\x20desc\x20<name>','name','38725OJQWPD','βœ”\x20Query\x20completed:\x20Processed\x20','getFolder','Usage:','code'];a36_0xcee7=function(){return _0x205487;};return a36_0xcee7();}import a36_0x234e0a from'chalk';async function resolveSegmentTarget(_0x31e382,_0x259f6d,_0xf4afb6){const _0x102cbe=a36_0x4310;if(isYamlFilePath(_0x31e382))try{const _0x49b478=await resolveYamlFilePath(_0x31e382);return _0xf4afb6&&(console[_0x102cbe(0x1d4)](_0x102cbe(0x24d)+_0x31e382),console[_0x102cbe(0x1d4)](_0x102cbe(0x1d2)+_0x49b478[_0x102cbe(0x218)]),console[_0x102cbe(0x1d4)]('\x20\x20Segment\x20name:\x20'+_0x49b478[_0x102cbe(0x1b2)]),console['error'](_0x102cbe(0x202)+(_0x49b478[_0x102cbe(0x24e)]||_0x102cbe(0x1b9))),console[_0x102cbe(0x1d4)]('\x20\x20Full\x20path:\x20'+_0x49b478[_0x102cbe(0x22d)])),_0x49b478['fullPath'];}catch(_0x2278bc){throw new SDKError(ErrorCode[_0x102cbe(0x1fb)],_0x102cbe(0x21f)+_0x2278bc[_0x102cbe(0x1b1)]);}if(!_0x259f6d)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x102cbe(0x236));return _0x259f6d+'/'+_0x31e382;}function a36_0x4310(_0x536513,_0x56d715){_0x536513=_0x536513-0x1a7;const _0xcee7ad=a36_0xcee7();let _0x4310b5=_0xcee7ad[_0x536513];return _0x4310b5;}export class SegmentDescribeCommand extends BaseCommand{['name']='segment:describe';[a36_0x2a13a5(0x226)]=a36_0x2a13a5(0x250);async[a36_0x2a13a5(0x220)](_0x335595){const _0x11151a=a36_0x2a13a5,{options:_0x11442d,args:_0x2288f2,tdx:_0x5713b6}=_0x335595,_0x1fbb22=_0x2288f2[0x0],_0x3a74d9=!_0x1fbb22&&!!_0x11442d['parentSegment'],_0x5dbe10=_0x1fbb22||_0x11442d[_0x11151a(0x218)];if(!_0x5dbe10)return console[_0x11151a(0x1d4)](_0x11151a(0x1ff)),console[_0x11151a(0x1d4)](_0x11151a(0x1aa)),console['error'](_0x11151a(0x1a9)),console[_0x11151a(0x1d4)](_0x11151a(0x1ab)),console['error'](_0x11151a(0x208)),console[_0x11151a(0x1d4)]('\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context'),console[_0x11151a(0x1d4)](_0x11151a(0x1a7)),0x1;try{const _0x5df1cc=_0x11442d[_0x11151a(0x1d3)];let _0x447a94=_0x5dbe10;!_0x3a74d9&&_0x5df1cc&&!_0x5dbe10['includes']('/')&&(_0x447a94=_0x5df1cc+'/'+_0x5dbe10,_0x11442d[_0x11151a(0x1cb)]&&console[_0x11151a(0x1d4)](_0x11151a(0x1f8)+_0x447a94));const _0x90df0f=await withSpinner(_0x11151a(0x206)+_0x447a94+'\x27...',()=>_0x5713b6['segment'][_0x11151a(0x21e)](_0x447a94),{'verbose':_0x11442d[_0x11151a(0x1cb)]}),_0x9fcad4=_0x90df0f[_0x11151a(0x1dd)];_0x11442d[_0x11151a(0x1cb)]&&(console['error']('Resolved\x20type:\x20'+_0x9fcad4['type']),console['error'](_0x11151a(0x228)+_0x9fcad4[_0x11151a(0x20d)]),_0x9fcad4[_0x11151a(0x1f5)]&&console[_0x11151a(0x1d4)](_0x11151a(0x1c8)+_0x9fcad4[_0x11151a(0x1f5)]),_0x9fcad4[_0x11151a(0x1f0)]&&console[_0x11151a(0x1d4)]('Segment\x20ID:\x20'+_0x9fcad4[_0x11151a(0x1f0)]));if(_0x9fcad4['type']==='parent'){const _0x4d3b5b=await withSpinner('Fetching\x20parent\x20segment\x20details...',()=>_0x5713b6['segment'][_0x11151a(0x1c0)](_0x9fcad4[_0x11151a(0x20d)]),{'verbose':_0x11442d[_0x11151a(0x1cb)]});await handleSingleObjectOutput(_0x4d3b5b[_0x11151a(0x1dd)],_0x11442d);}else{if(_0x9fcad4[_0x11151a(0x22e)]===_0x11151a(0x215)){if(!_0x9fcad4[_0x11151a(0x1f5)])throw new SDKError(ErrorCode[_0x11151a(0x1f7)],_0x11151a(0x1b6));const _0x157dea=await withSpinner(_0x11151a(0x1c9),()=>_0x5713b6[_0x11151a(0x1c6)][_0x11151a(0x1e5)](_0x9fcad4[_0x11151a(0x1f5)]),{'verbose':_0x11442d[_0x11151a(0x1cb)]});await handleSingleObjectOutput(_0x157dea[_0x11151a(0x1dd)],_0x11442d);}else{if(_0x9fcad4['type']===_0x11151a(0x1c6)){if(!_0x9fcad4[_0x11151a(0x1f0)])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x11151a(0x216));const _0x27de04=await withSpinner(_0x11151a(0x242),()=>_0x5713b6['segment'][_0x11151a(0x1e9)](_0x9fcad4[_0x11151a(0x20d)],_0x9fcad4[_0x11151a(0x1f0)]),{'verbose':_0x11442d[_0x11151a(0x1cb)]});await handleSingleObjectOutput(_0x27de04[_0x11151a(0x1dd)],_0x11442d);}}}return 0x0;}catch(_0x5847f5){if(_0x5847f5 instanceof SDKError)return console[_0x11151a(0x1d4)]('Error:\x20'+_0x5847f5[_0x11151a(0x1b1)]),_0x5847f5[_0x11151a(0x1ed)]&&console['error'](_0x11151a(0x22a)+_0x5847f5[_0x11151a(0x1ed)]),0x1;throw _0x5847f5;}}}export class SegmentShowCommand extends BaseCommand{['name']=a36_0x2a13a5(0x1da);[a36_0x2a13a5(0x226)]=a36_0x2a13a5(0x1b3);async[a36_0x2a13a5(0x220)](_0x265dbe){const _0x1f62de=a36_0x2a13a5,{options:_0x544f29,args:_0x38540d,tdx:_0x114974}=_0x265dbe,_0x539a45=_0x38540d[0x0];if(!_0x539a45)return console[_0x1f62de(0x1d4)](_0x1f62de(0x1ac)),console[_0x1f62de(0x1d4)](_0x1f62de(0x203)),console[_0x1f62de(0x1d4)](_0x1f62de(0x246)),console[_0x1f62de(0x1d4)](_0x1f62de(0x1a9)),console['error'](_0x1f62de(0x1ad)),console[_0x1f62de(0x1d4)](_0x1f62de(0x224)),0x1;try{const _0x4cb7e0=_0x544f29['parentSegment'],_0x4c6163=await resolveSegmentTarget(_0x539a45,_0x4cb7e0,_0x544f29['verbose']);_0x544f29[_0x1f62de(0x1cb)]&&console[_0x1f62de(0x1d4)](_0x1f62de(0x225)+_0x4c6163);const _0x57fac2=await withSpinner('Resolving\x20\x27'+_0x539a45+_0x1f62de(0x211),()=>_0x114974['segment'][_0x1f62de(0x21e)](_0x4c6163),{'verbose':_0x544f29[_0x1f62de(0x1cb)]}),_0x32f0a0=_0x57fac2[_0x1f62de(0x1dd)];_0x544f29[_0x1f62de(0x1cb)]&&(console[_0x1f62de(0x1d4)](_0x1f62de(0x238)+_0x32f0a0['type']),console[_0x1f62de(0x1d4)](_0x1f62de(0x228)+_0x32f0a0[_0x1f62de(0x20d)]));if(_0x32f0a0['type']==='folder')return console[_0x1f62de(0x1d4)](_0x1f62de(0x245)),console[_0x1f62de(0x1d4)](_0x1f62de(0x1eb)),0x1;if(_0x32f0a0[_0x1f62de(0x22e)]===_0x1f62de(0x24f))return console[_0x1f62de(0x1d4)](_0x1f62de(0x1ea)),console['error'](_0x1f62de(0x1d8)),0x1;if(!_0x32f0a0[_0x1f62de(0x1f0)])throw new SDKError(ErrorCode[_0x1f62de(0x21d)],_0x1f62de(0x216));const _0x10296e=await withSpinner(_0x1f62de(0x1bd),()=>_0x114974[_0x1f62de(0x1c6)]['getSegmentSQL'](_0x32f0a0[_0x1f62de(0x20d)],_0x32f0a0[_0x1f62de(0x1f0)]),{'verbose':_0x544f29[_0x1f62de(0x1cb)]});let _0x14c116=_0x10296e['data'];const _0x5980c2=resolveLimit(_0x544f29[_0x1f62de(0x1c3)],DEFAULT_DISPLAY_LIMIT),_0x591df5=/\bLIMIT\s+\d+/i[_0x1f62de(0x251)](_0x14c116);!_0x591df5&&(_0x14c116=_0x14c116['trim']()[_0x1f62de(0x1af)](/;+$/,''),_0x14c116=_0x1f62de(0x1e0)+_0x14c116+_0x1f62de(0x1a8)+_0x5980c2);_0x544f29[_0x1f62de(0x1cb)]&&console[_0x1f62de(0x1d4)](_0x1f62de(0x1de)+_0x14c116);const _0x2f2c36=await withProgressSpinner(_0x1f62de(0x207),async _0x5e8c98=>{const _0x479d20=_0x1f62de,_0x4f78cd=await _0x114974[_0x479d20(0x222)][_0x479d20(0x220)](_0x14c116,{'catalog':'td','schema':_0x479d20(0x21a),'onJobId':_0x43d3bb=>{const _0x17c01b=_0x479d20;_0x5e8c98[_0x17c01b(0x1f2)](_0x43d3bb);}});return _0x4f78cd;},{'verbose':_0x544f29[_0x1f62de(0x1cb)]}),_0x133f14=_0x2f2c36[_0x1f62de(0x1dd)],_0x557f97=_0x133f14[_0x1f62de(0x231)]?_0x1f62de(0x252)+_0x133f14[_0x1f62de(0x231)]+']':'';return console[_0x1f62de(0x1d4)](_0x1f62de(0x1e4)+_0x133f14[_0x1f62de(0x1b5)][_0x1f62de(0x1cd)]['toLocaleString']()+'\x20rows\x20'+(_0x1f62de(0x22f)+formatElapsed(_0x133f14['stats'][_0x1f62de(0x1ce)])+_0x557f97)),await handleQueryOutput(_0x133f14,_0x544f29),0x0;}catch(_0x388594){if(_0x388594 instanceof SDKError)return console[_0x1f62de(0x1d4)](_0x1f62de(0x24a)+_0x388594[_0x1f62de(0x1e7)]+']'),console[_0x1f62de(0x1d4)]('\x0a'+_0x388594[_0x1f62de(0x1b1)]),0x1;throw _0x388594;}}}export class SegmentFolderListCommand extends BaseCommand{['name']='segment:folder:list';[a36_0x2a13a5(0x226)]='List\x20segment\x20folders\x20under\x20a\x20parent\x20segment';async[a36_0x2a13a5(0x220)](_0x2bb614){const _0x39667a=a36_0x2a13a5,{options:_0x38f6db,args:_0x2a666f,tdx:_0x2a235c}=_0x2bb614;if(_0x2a666f[_0x39667a(0x1d9)]===0x0)return console[_0x39667a(0x1d4)](_0x39667a(0x1ca)),console['error'](_0x39667a(0x221)),0x1;const _0x372c4b=_0x2a666f[0x0];try{_0x38f6db[_0x39667a(0x1cb)]&&(console[_0x39667a(0x1d4)](_0x39667a(0x1f6)+_0x38f6db[_0x39667a(0x1dc)]),console[_0x39667a(0x1d4)](_0x39667a(0x1c2)+_0x372c4b));const _0x1aeeeb=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x372c4b+_0x39667a(0x211),()=>_0x2a235c['segment'][_0x39667a(0x1fc)](_0x372c4b),{'verbose':_0x38f6db[_0x39667a(0x1cb)]}),_0x5c5ea8=_0x1aeeeb[_0x39667a(0x1dd)];_0x38f6db[_0x39667a(0x1cb)]&&console[_0x39667a(0x1d4)](_0x39667a(0x1c5)+_0x5c5ea8);const _0xa2a001=await withSpinner(_0x39667a(0x1bf)+_0x372c4b+_0x39667a(0x211),()=>_0x2a235c[_0x39667a(0x1c6)][_0x39667a(0x20b)](_0x5c5ea8),{'verbose':_0x38f6db[_0x39667a(0x1cb)]}),_0x393347=_0xa2a001[_0x39667a(0x1dd)];return console[_0x39667a(0x1d4)]('βœ”\x20Found\x20'+_0x393347[_0x39667a(0x1d9)]+_0x39667a(0x1db)+(_0x393347[_0x39667a(0x1d9)]!==0x1?'s':'')),await handleSDKOutput(_0x393347,_0x38f6db),0x0;}catch(_0x39803f){if(_0x39803f instanceof SDKError)return console[_0x39667a(0x1d4)](_0x39667a(0x24c)+_0x39803f[_0x39667a(0x1b1)]),_0x39803f[_0x39667a(0x1ed)]&&console[_0x39667a(0x1d4)](_0x39667a(0x22a)+_0x39803f[_0x39667a(0x1ed)]),0x1;throw _0x39803f;}}}export class SegmentFolderShowCommand extends BaseCommand{[a36_0x2a13a5(0x1e2)]=a36_0x2a13a5(0x248);[a36_0x2a13a5(0x226)]='Show\x20segment\x20folder\x20details';async[a36_0x2a13a5(0x220)](_0x34ae0d){const _0x508bcf=a36_0x2a13a5,{options:_0x9884f3,args:_0x52e413,tdx:_0x4fd324}=_0x34ae0d;if(_0x52e413[_0x508bcf(0x1d9)]===0x0)return console[_0x508bcf(0x1d4)](_0x508bcf(0x1d0)),console['error'](_0x508bcf(0x234)),0x1;try{const {parentId:_0x10f0a4,childId:_0x126e2a}=parseSegmentRef(_0x52e413[0x0]);_0x9884f3[_0x508bcf(0x1cb)]&&(console[_0x508bcf(0x1d4)](_0x508bcf(0x1f6)+_0x9884f3['site']),console[_0x508bcf(0x1d4)](_0x508bcf(0x1c2)+_0x10f0a4),_0x126e2a&&console[_0x508bcf(0x1d4)](_0x508bcf(0x254)+_0x126e2a));if(!_0x126e2a)return console[_0x508bcf(0x1d4)]('Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)'),0x1;const _0x37a8c0=await withSpinner(_0x508bcf(0x244)+_0x10f0a4+_0x508bcf(0x211),()=>_0x4fd324[_0x508bcf(0x1c6)][_0x508bcf(0x1fc)](_0x10f0a4),{'verbose':_0x9884f3[_0x508bcf(0x1cb)]}),_0x201974=_0x37a8c0[_0x508bcf(0x1dd)];_0x9884f3['verbose']&&console[_0x508bcf(0x1d4)](_0x508bcf(0x1c5)+_0x201974);const _0x48c09d=await withSpinner(_0x508bcf(0x237)+_0x126e2a+_0x508bcf(0x211),()=>_0x4fd324[_0x508bcf(0x1c6)][_0x508bcf(0x210)](_0x201974,_0x126e2a),{'verbose':_0x9884f3['verbose']}),_0x382f9a=_0x48c09d[_0x508bcf(0x1dd)];_0x9884f3[_0x508bcf(0x1cb)]&&console[_0x508bcf(0x1d4)](_0x508bcf(0x1c7)+_0x382f9a);const _0x525818=await withSpinner('Fetching\x20folder\x20\x27'+_0x126e2a+_0x508bcf(0x211),()=>_0x4fd324[_0x508bcf(0x1c6)][_0x508bcf(0x1e5)](_0x382f9a),{'verbose':_0x9884f3[_0x508bcf(0x1cb)]});return await handleSDKOutput([_0x525818[_0x508bcf(0x1dd)]],_0x9884f3),0x0;}catch(_0x8de2a7){if(_0x8de2a7 instanceof SDKError)return console[_0x508bcf(0x1d4)]('Error:\x20'+_0x8de2a7[_0x508bcf(0x1b1)]),_0x8de2a7[_0x508bcf(0x1ed)]&&console[_0x508bcf(0x1d4)](_0x508bcf(0x22a)+_0x8de2a7[_0x508bcf(0x1ed)]),0x1;throw _0x8de2a7;}}}export class SegmentSQLCommand extends BaseCommand{['name']=a36_0x2a13a5(0x1ef);[a36_0x2a13a5(0x226)]=a36_0x2a13a5(0x1fa);async['execute'](_0x109ca7){const _0x1a175d=a36_0x2a13a5,{options:_0x3b3f6,args:_0x37a6ae}=_0x109ca7,_0x3a06c5=_0x3b3f6,_0x18755b=_0x3a06c5[_0x1a175d(0x24b)],_0x29b792=_0x37a6ae[0x0];if(!_0x29b792&&!_0x18755b)return console[_0x1a175d(0x1d4)](a36_0x234e0a[_0x1a175d(0x1ae)](_0x1a175d(0x20c))),console[_0x1a175d(0x1d4)](_0x1a175d(0x1e6)),console[_0x1a175d(0x1d4)](_0x1a175d(0x1f3)),console[_0x1a175d(0x1d4)]('\x20\x20Local\x20YAML\x20file:\x20\x20\x20\x20\x20\x20tdx\x20sg\x20sql\x20--path\x20<file-path>'),console['error']('Examples:'),console['error'](_0x1a175d(0x22b)),console[_0x1a175d(0x1d4)](_0x1a175d(0x1bc)),0x1;if(_0x29b792&&_0x18755b)return console[_0x1a175d(0x1d4)](a36_0x234e0a['red'](_0x1a175d(0x229))),0x1;try{let _0x5eaf9;if(_0x18755b)_0x5eaf9=await this[_0x1a175d(0x227)](_0x18755b,_0x109ca7);else{if(isYamlFilePath(_0x29b792))return console[_0x1a175d(0x1d4)](a36_0x234e0a['red'](_0x1a175d(0x239))),console[_0x1a175d(0x1d4)](_0x1a175d(0x1c4)+_0x29b792),0x1;else _0x5eaf9=await this[_0x1a175d(0x1be)](_0x29b792,_0x109ca7);}return _0x3b3f6[_0x1a175d(0x247)]===_0x1a175d(0x21b)||_0x3b3f6['format']===_0x1a175d(0x217)?await handleSDKOutput([{'sql':_0x5eaf9}],_0x3b3f6):console[_0x1a175d(0x20e)](_0x5eaf9),0x0;}catch(_0x10e502){if(_0x10e502 instanceof SDKError)return console[_0x1a175d(0x1d4)](_0x1a175d(0x24c)+_0x10e502['message']),_0x10e502[_0x1a175d(0x1ed)]&&console[_0x1a175d(0x1d4)]('\x20\x20Cause:\x20'+_0x10e502[_0x1a175d(0x1ed)]),0x1;throw _0x10e502;}}async[a36_0x2a13a5(0x227)](_0xfa6f34,_0x5209a1){const _0x1edb5c=a36_0x2a13a5,{options:_0x304975,tdx:_0x1ed468}=_0x5209a1;let _0x5b2398;try{_0x5b2398=await resolveYamlFilePath(_0xfa6f34);}catch(_0x3a9f83){throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x1edb5c(0x21f)+_0x3a9f83[_0x1edb5c(0x1b1)]);}_0x304975['verbose']&&console[_0x1edb5c(0x1d4)]('Resolved:\x20'+_0x5b2398[_0x1edb5c(0x218)]+'/'+_0x5b2398['segmentName']);const _0x533bb3=await withSpinner(_0x1edb5c(0x209),()=>_0x1ed468[_0x1edb5c(0x1c6)][_0x1edb5c(0x1b7)](_0x5b2398['content'],_0x5b2398[_0x1edb5c(0x218)],_0x5b2398[_0x1edb5c(0x1b2)]),{'verbose':_0x304975[_0x1edb5c(0x1cb)]});return _0x533bb3[_0x1edb5c(0x1dd)];}async[a36_0x2a13a5(0x1be)](_0x5eaceb,_0x36ff44){const _0x6f43f6=a36_0x2a13a5,{options:_0x159934,tdx:_0x14c6b9}=_0x36ff44,_0x37b80e=_0x159934[_0x6f43f6(0x218)],_0x22b4b3=await resolveSegmentTarget(_0x5eaceb,_0x37b80e,_0x159934['verbose']);_0x159934['verbose']&&console[_0x6f43f6(0x1d4)]('Target\x20path:\x20'+_0x22b4b3);const _0x9b4a98=await withSpinner(_0x6f43f6(0x253)+_0x5eaceb+_0x6f43f6(0x211),()=>_0x14c6b9[_0x6f43f6(0x1c6)][_0x6f43f6(0x21e)](_0x22b4b3),{'verbose':_0x159934[_0x6f43f6(0x1cb)]}),_0x16d460=_0x9b4a98['data'];_0x159934[_0x6f43f6(0x1cb)]&&(console[_0x6f43f6(0x1d4)](_0x6f43f6(0x238)+_0x16d460['type']),console[_0x6f43f6(0x1d4)](_0x6f43f6(0x228)+_0x16d460[_0x6f43f6(0x20d)]));if(_0x16d460[_0x6f43f6(0x22e)]==='folder')throw new SDKError(ErrorCode[_0x6f43f6(0x1fb)],_0x6f43f6(0x1ba));if(_0x16d460[_0x6f43f6(0x22e)]===_0x6f43f6(0x24f))throw new SDKError(ErrorCode[_0x6f43f6(0x1fb)],_0x6f43f6(0x249));if(!_0x16d460['segmentId'])throw new SDKError(ErrorCode[_0x6f43f6(0x21d)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x2be914=await withSpinner(_0x6f43f6(0x1bd),()=>_0x14c6b9[_0x6f43f6(0x1c6)]['getSegmentSQL'](_0x16d460['parentId'],_0x16d460[_0x6f43f6(0x1f0)]),{'verbose':_0x159934['verbose']});return _0x2be914[_0x6f43f6(0x1dd)];}}export class SegmentFolderCreateCommand extends BaseCommand{['name']='segment:folder:create';[a36_0x2a13a5(0x226)]=a36_0x2a13a5(0x1ee);async[a36_0x2a13a5(0x220)](_0x2e27a6){const _0x240df1=a36_0x2a13a5,{options:_0x294fee,args:_0x3fd184,tdx:_0x40911f}=_0x2e27a6,_0x11eb45=_0x294fee;if(_0x3fd184['length']<0x2)return console[_0x240df1(0x1d4)]('Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required'),console['error'](_0x240df1(0x1d6)),0x1;const _0x35798f=_0x3fd184[0x0],_0x5ce0cd=_0x3fd184[0x1];_0x11eb45[_0x240df1(0x1cb)]&&(console[_0x240df1(0x1d4)](_0x240df1(0x1f6)+_0x11eb45['site']),console[_0x240df1(0x1d4)](_0x240df1(0x1f4)+_0x35798f),console['error'](_0x240df1(0x254)+_0x5ce0cd));let _0x355283;if(_0x11eb45[_0x240df1(0x204)]){const _0xde6c3=_0x11eb45['parentFolder'],_0x105e6f=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x35798f+'\x27...',()=>_0x40911f['segment'][_0x240df1(0x1fc)](_0x35798f),{'verbose':_0x11eb45['verbose']}),_0x3935ac=_0x105e6f[_0x240df1(0x1dd)],_0x1bd0ac=await withSpinner('Resolving\x20parent\x20folder\x20\x27'+_0xde6c3+_0x240df1(0x211),()=>_0x40911f[_0x240df1(0x1c6)]['resolveFolderId'](_0x3935ac,_0xde6c3),{'verbose':_0x11eb45[_0x240df1(0x1cb)]});_0x355283=_0x1bd0ac['data'],_0x11eb45[_0x240df1(0x1cb)]&&console[_0x240df1(0x1d4)]('Resolved\x20parent\x20folder\x20ID:\x20'+_0x355283);}const _0x4b5fac={'name':_0x5ce0cd,'description':_0x11eb45[_0x240df1(0x226)],'parentFolderId':_0x355283},_0x153ae5=await withSpinner(_0x240df1(0x1ec)+_0x5ce0cd+_0x240df1(0x211),()=>_0x40911f['segment'][_0x240df1(0x1c1)](_0x35798f,_0x4b5fac),{'verbose':_0x11eb45[_0x240df1(0x1cb)]}),_0x38b7fb=_0x153ae5['data'];return console[_0x240df1(0x1d4)]('βœ”\x20Created\x20folder\x20\x27'+_0x38b7fb[_0x240df1(0x1e2)]+_0x240df1(0x200)+_0x38b7fb['id']),await handleSDKOutput([_0x38b7fb],_0x11eb45),0x0;}}export class SegmentViewCommand extends BaseCommand{[a36_0x2a13a5(0x1e2)]='segment:view';[a36_0x2a13a5(0x226)]=a36_0x2a13a5(0x235);async[a36_0x2a13a5(0x220)](_0x12b69e){const _0x2e8ca3=a36_0x2a13a5,{options:_0x4c87b6,args:_0x1406a1,tdx:_0x1fcb54}=_0x12b69e,_0x3d6a9c=_0x1406a1[0x0];if(!_0x3d6a9c)return console[_0x2e8ca3(0x1d4)](_0x2e8ca3(0x232)),console[_0x2e8ca3(0x1d4)](_0x2e8ca3(0x1f9)),console[_0x2e8ca3(0x1d4)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20view\x20<path/to/segment.yml>'),console[_0x2e8ca3(0x1d4)](_0x2e8ca3(0x1cf)),console[_0x2e8ca3(0x1d4)](_0x2e8ca3(0x1b4)),console[_0x2e8ca3(0x1d4)](_0x2e8ca3(0x1a9)),console[_0x2e8ca3(0x1d4)](_0x2e8ca3(0x233)),console[_0x2e8ca3(0x1d4)](_0x2e8ca3(0x20a)),console[_0x2e8ca3(0x1d4)](_0x2e8ca3(0x23e)),console['error'](_0x2e8ca3(0x1f1)),0x1;try{const _0x42dcf6=_0x4c87b6[_0x2e8ca3(0x218)],_0x350a82=await resolveSegmentTarget(_0x3d6a9c,_0x42dcf6,_0x4c87b6[_0x2e8ca3(0x1cb)]);_0x4c87b6[_0x2e8ca3(0x1cb)]&&console[_0x2e8ca3(0x1d4)](_0x2e8ca3(0x225)+_0x350a82);const _0x498f55=await withSpinner(_0x2e8ca3(0x253)+_0x3d6a9c+_0x2e8ca3(0x211),()=>_0x1fcb54[_0x2e8ca3(0x1c6)][_0x2e8ca3(0x21e)](_0x350a82),{'verbose':_0x4c87b6[_0x2e8ca3(0x1cb)]}),_0x49aaf6=_0x498f55['data'];_0x4c87b6[_0x2e8ca3(0x1cb)]&&(console[_0x2e8ca3(0x1d4)]('Resolved\x20type:\x20'+_0x49aaf6[_0x2e8ca3(0x22e)]),console[_0x2e8ca3(0x1d4)](_0x2e8ca3(0x228)+_0x49aaf6[_0x2e8ca3(0x20d)]),_0x49aaf6[_0x2e8ca3(0x1f5)]&&console[_0x2e8ca3(0x1d4)](_0x2e8ca3(0x1c8)+_0x49aaf6['folderId']),_0x49aaf6[_0x2e8ca3(0x1f0)]&&console[_0x2e8ca3(0x1d4)]('Segment\x20ID:\x20'+_0x49aaf6['segmentId']));if(_0x4c87b6[_0x2e8ca3(0x1d1)]){if(_0x49aaf6[_0x2e8ca3(0x22e)]==='folder')return console[_0x2e8ca3(0x1d4)](_0x2e8ca3(0x1d7)),0x1;if(_0x49aaf6['type']===_0x2e8ca3(0x24f))return console[_0x2e8ca3(0x1d4)](_0x2e8ca3(0x1d5)),console[_0x2e8ca3(0x1d4)](_0x2e8ca3(0x21c)),0x1;if(!_0x49aaf6[_0x2e8ca3(0x1f0)])throw new SDKError(ErrorCode[_0x2e8ca3(0x21d)],_0x2e8ca3(0x216));const _0x1aa478=getConsoleNextUrl(_0x4c87b6[_0x2e8ca3(0x1dc)],_0x2e8ca3(0x23d)+_0x49aaf6[_0x2e8ca3(0x20d)]+_0x2e8ca3(0x23b)+_0x49aaf6[_0x2e8ca3(0x1f0)]);return console[_0x2e8ca3(0x1d4)](a36_0x234e0a[_0x2e8ca3(0x1fe)]('βœ”')+_0x2e8ca3(0x23c)+a36_0x234e0a['cyan'](_0x1aa478)),openBrowser(_0x1aa478),0x0;}if(_0x49aaf6[_0x2e8ca3(0x22e)]==='folder'){if(!_0x49aaf6[_0x2e8ca3(0x1f5)])throw new SDKError(ErrorCode[_0x2e8ca3(0x1f7)],_0x2e8ca3(0x1b6));const _0xa56a9e=await withSpinner('Fetching\x20folder\x20details...',()=>_0x1fcb54['segment'][_0x2e8ca3(0x1e5)](_0x49aaf6[_0x2e8ca3(0x1f5)]),{'verbose':_0x4c87b6[_0x2e8ca3(0x1cb)]});await handleSingleObjectOutput(_0xa56a9e[_0x2e8ca3(0x1dd)],_0x4c87b6);}else{if(_0x49aaf6[_0x2e8ca3(0x22e)]===_0x2e8ca3(0x1c6)){if(!_0x49aaf6[_0x2e8ca3(0x1f0)])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x2e8ca3(0x216));const _0x55aa2c=await withSpinner(_0x2e8ca3(0x242),()=>_0x1fcb54[_0x2e8ca3(0x1c6)][_0x2e8ca3(0x1e9)](_0x49aaf6[_0x2e8ca3(0x20d)],_0x49aaf6[_0x2e8ca3(0x1f0)]),{'verbose':_0x4c87b6['verbose']}),_0x3eefee=getConsoleNextUrl(_0x4c87b6['site'],_0x2e8ca3(0x23d)+_0x49aaf6[_0x2e8ca3(0x20d)]+_0x2e8ca3(0x23b)+_0x49aaf6[_0x2e8ca3(0x1f0)]),_0x5973e6=_0x55aa2c[_0x2e8ca3(0x1dd)];_0x5973e6[_0x2e8ca3(0x1e8)]=_0x3eefee,await handleSingleObjectOutput(_0x5973e6,_0x4c87b6);}else return console[_0x2e8ca3(0x1d4)](_0x2e8ca3(0x201)),console[_0x2e8ca3(0x1d4)](_0x2e8ca3(0x241)),0x1;}return 0x0;}catch(_0x455005){if(_0x455005 instanceof SDKError)return console[_0x2e8ca3(0x1d4)]('Error:\x20'+_0x455005['message']),_0x455005[_0x2e8ca3(0x1ed)]&&console[_0x2e8ca3(0x1d4)]('\x20\x20Cause:\x20'+_0x455005['cause']),0x1;throw _0x455005;}}}export const SegmentInfoCommand=SegmentViewCommand;export class SegmentDescCommand extends BaseCommand{['name']=a36_0x2a13a5(0x22c);[a36_0x2a13a5(0x226)]='Show\x20child\x20segment\x20schema\x20(column\x20types)';async[a36_0x2a13a5(0x220)](_0x5005a7){const _0x329867=a36_0x2a13a5,{options:_0x306103,args:_0x5391b9,tdx:_0x5bab0c}=_0x5005a7,_0x3aff3d=_0x5391b9[0x0];if(!_0x3aff3d)return console['error']('Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required'),console[_0x329867(0x1d4)](_0x329867(0x1e1)),console[_0x329867(0x1d4)](_0x329867(0x240)),console[_0x329867(0x1d4)](_0x329867(0x1a9)),console[_0x329867(0x1d4)](_0x329867(0x214)),console[_0x329867(0x1d4)](_0x329867(0x243)),0x1;try{const _0x29ebb0=_0x306103['parentSegment'],_0x2103d4=await resolveSegmentTarget(_0x3aff3d,_0x29ebb0,_0x306103[_0x329867(0x1cb)]);_0x306103[_0x329867(0x1cb)]&&console[_0x329867(0x1d4)](_0x329867(0x225)+_0x2103d4);const _0x4007d=await withSpinner(_0x329867(0x253)+_0x3aff3d+_0x329867(0x211),()=>_0x5bab0c[_0x329867(0x1c6)][_0x329867(0x21e)](_0x2103d4),{'verbose':_0x306103['verbose']}),_0x1ed104=_0x4007d[_0x329867(0x1dd)];_0x306103[_0x329867(0x1cb)]&&(console[_0x329867(0x1d4)](_0x329867(0x238)+_0x1ed104[_0x329867(0x22e)]),console[_0x329867(0x1d4)](_0x329867(0x228)+_0x1ed104[_0x329867(0x20d)]));if(_0x1ed104['type']===_0x329867(0x215))return console[_0x329867(0x1d4)](_0x329867(0x223)),console[_0x329867(0x1d4)](_0x329867(0x23f)),0x1;if(_0x1ed104[_0x329867(0x22e)]===_0x329867(0x24f))return console['error'](_0x329867(0x219)),console[_0x329867(0x1d4)](_0x329867(0x213)),0x1;if(!_0x1ed104[_0x329867(0x1f0)])throw new SDKError(ErrorCode[_0x329867(0x21d)],_0x329867(0x216));const _0x39528a=await withSpinner('Fetching\x20SQL\x20for\x20segment...',()=>_0x5bab0c[_0x329867(0x1c6)][_0x329867(0x212)](_0x1ed104[_0x329867(0x20d)],_0x1ed104[_0x329867(0x1f0)]),{'verbose':_0x306103[_0x329867(0x1cb)]}),_0x502217=_0x39528a[_0x329867(0x1dd)],_0x550b10=await executeSchemaQuery(_0x502217,_0x5bab0c,_0x306103);return await handleQueryOutput(_0x550b10,_0x306103),0x0;}catch(_0x3157b7){if(_0x3157b7 instanceof SDKError)return console['error']('Error:\x20'+_0x3157b7[_0x329867(0x1b1)]),_0x3157b7['cause']&&console[_0x329867(0x1d4)]('\x20\x20Cause:\x20'+_0x3157b7[_0x329867(0x1ed)]),0x1;throw _0x3157b7;}}}
@@ -1 +1 @@
1
- const a37_0x5eddc3=a37_0x1855;(function(_0x1ea4ae,_0x2e9d0a){const _0x24e926=a37_0x1855,_0x416d6e=_0x1ea4ae();while(!![]){try{const _0x2ac4fb=-parseInt(_0x24e926(0x193))/0x1*(parseInt(_0x24e926(0x1b0))/0x2)+-parseInt(_0x24e926(0x1b5))/0x3*(parseInt(_0x24e926(0x1a0))/0x4)+parseInt(_0x24e926(0x1aa))/0x5*(-parseInt(_0x24e926(0x1b7))/0x6)+parseInt(_0x24e926(0x1b3))/0x7*(-parseInt(_0x24e926(0x196))/0x8)+-parseInt(_0x24e926(0x199))/0x9*(-parseInt(_0x24e926(0x1c3))/0xa)+parseInt(_0x24e926(0x1bd))/0xb+parseInt(_0x24e926(0x1a1))/0xc;if(_0x2ac4fb===_0x2e9d0a)break;else _0x416d6e['push'](_0x416d6e['shift']());}catch(_0x48002b){_0x416d6e['push'](_0x416d6e['shift']());}}}(a37_0x457a,0x8f294));import{BaseCommand}from'./command.js';function a37_0x457a(){const _0x291a24=['\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','6JtHoNi','folder','error','Creating\x20segment\x20\x27','Segment\x20name:\x20','\x27\x20with\x20ID:\x20','1719520vZEayK','Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]','includes','Resolved\x20relative\x20path\x20to:\x20','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','verbose','243710dMJfbU','length','ruleFile','resolveParentId','folderId','5838nlDoBc','segmentPath','kind','5049224tAhhGc','Resolving\x20folder\x20path\x20\x27','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27','261zargyY','Resolved\x20folder\x20ID:\x20','rule','segment','Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]','data','resolveFolderId','2350324zQMCOt','25522296bccFVS','⚠\x20Deprecation\x20warning:\x20`segment\x20create`\x20is\x20deprecated.','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','description','createSegment','Resolving\x20parent\x20segment\x20\x27','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27','type','noCountPopulation','407165SuZjfB','segments','\x27...','Examples:','Target\x20path:\x20','name','378JyQEJW','yellow','Create\x20child\x20segment\x20with\x20filtering\x20rules','7sRRZYv','resolvePathToResource','3UBdxRT'];a37_0x457a=function(){return _0x291a24;};return a37_0x457a();}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';function a37_0x1855(_0x236f21,_0x15fa6a){_0x236f21=_0x236f21-0x192;const _0x457aa1=a37_0x457a();let _0x18557d=_0x457aa1[_0x236f21];return _0x18557d;}import a37_0x208173 from'chalk';export class SegmentCreateCommand extends BaseCommand{[a37_0x5eddc3(0x1af)]='segment:create';['description']=a37_0x5eddc3(0x1b2);async['execute'](_0x56d1ea){const _0x2af6c9=a37_0x5eddc3;console['error'](a37_0x208173[_0x2af6c9(0x1b1)](_0x2af6c9(0x1a2))),console['error'](a37_0x208173[_0x2af6c9(0x1b1)](_0x2af6c9(0x1a3)));const {options:_0x10b6eb,args:_0x1c0c1e,tdx:_0x2349b5}=_0x56d1ea,_0x45b50e=_0x10b6eb;if(_0x1c0c1e[_0x2af6c9(0x1c4)]===0x0)return console['error'](_0x2af6c9(0x1c1)),console[_0x2af6c9(0x1b9)](_0x2af6c9(0x19d)),console[_0x2af6c9(0x1b9)](_0x2af6c9(0x1ad)),console[_0x2af6c9(0x1b9)](_0x2af6c9(0x198)),console['error'](_0x2af6c9(0x1a7)),console[_0x2af6c9(0x1b9)](_0x2af6c9(0x1b6)),0x1;const _0x5e6b43=_0x1c0c1e[0x0],_0x232910=_0x10b6eb[_0x2af6c9(0x194)];let _0x47119f=_0x5e6b43;_0x232910&&!_0x5e6b43[_0x2af6c9(0x1bf)]('/')&&(_0x47119f=_0x232910+'/'+_0x5e6b43,_0x45b50e[_0x2af6c9(0x1c2)]&&console['error'](_0x2af6c9(0x1c0)+_0x47119f));const _0xcbe32c=parsePath(_0x47119f);if(_0xcbe32c[_0x2af6c9(0x1ab)][_0x2af6c9(0x1c4)]<0x2)return console['error']('Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)'),console['error'](_0x2af6c9(0x1be)),0x1;const _0x3037f7=_0xcbe32c[_0x2af6c9(0x1ab)][0x0],_0x2058c6=getBaseName(_0x47119f),_0x625830=getParentPath(_0x47119f);_0x45b50e[_0x2af6c9(0x1c2)]&&(console[_0x2af6c9(0x1b9)]('Site:\x20'+_0x45b50e['site']),console[_0x2af6c9(0x1b9)](_0x2af6c9(0x1ae)+_0x47119f),console[_0x2af6c9(0x1b9)]('Parent:\x20'+_0x3037f7),console[_0x2af6c9(0x1b9)](_0x2af6c9(0x1bb)+_0x2058c6),console[_0x2af6c9(0x1b9)]('Parent\x20path:\x20'+_0x625830));const _0x5619a0=await withSpinner(_0x2af6c9(0x1a6)+_0x3037f7+_0x2af6c9(0x1ac),()=>_0x2349b5[_0x2af6c9(0x19c)][_0x2af6c9(0x1c6)](_0x3037f7),{'verbose':_0x45b50e['verbose']}),_0x221dbc=_0x5619a0[_0x2af6c9(0x19e)];let _0xf90dcc;if(_0xcbe32c[_0x2af6c9(0x1ab)][_0x2af6c9(0x1c4)]>0x2){const _0x5091a0=await withSpinner(_0x2af6c9(0x197)+_0x625830+_0x2af6c9(0x1ac),()=>_0x2349b5[_0x2af6c9(0x19c)][_0x2af6c9(0x1b4)](_0x625830),{'verbose':_0x45b50e[_0x2af6c9(0x1c2)]}),_0x18d9c2=_0x5091a0['data'];if(_0x18d9c2[_0x2af6c9(0x1a8)]!==_0x2af6c9(0x1b8)&&_0x18d9c2[_0x2af6c9(0x1a8)]!=='parent')return console[_0x2af6c9(0x1b9)]('Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.'),0x1;_0xf90dcc=_0x18d9c2[_0x2af6c9(0x192)];}else{if(_0x45b50e[_0x2af6c9(0x1b8)]){const _0x200510=await withSpinner('Resolving\x20folder\x20\x27'+_0x45b50e[_0x2af6c9(0x1b8)]+_0x2af6c9(0x1ac),()=>_0x2349b5[_0x2af6c9(0x19c)][_0x2af6c9(0x19f)](_0x221dbc,_0x45b50e[_0x2af6c9(0x1b8)]),{'verbose':_0x45b50e[_0x2af6c9(0x1c2)]});_0xf90dcc=_0x200510[_0x2af6c9(0x19e)];}}_0x45b50e[_0x2af6c9(0x1c2)]&&_0xf90dcc&&console[_0x2af6c9(0x1b9)](_0x2af6c9(0x19a)+_0xf90dcc);const _0x2ca96f=await loadJSONFromOptions(_0x45b50e[_0x2af6c9(0x19b)],_0x45b50e[_0x2af6c9(0x1c5)]),_0x4fde64={'name':_0x2058c6,'description':_0x45b50e[_0x2af6c9(0x1a4)],'rule':_0x2ca96f,'kind':_0x45b50e[_0x2af6c9(0x195)]!==undefined?parseInt(_0x45b50e[_0x2af6c9(0x195)],0xa):undefined,'isVisible':_0x45b50e['invisible']?![]:undefined,'segmentFolderId':_0xf90dcc,'countPopulation':_0x45b50e[_0x2af6c9(0x1a9)]?![]:undefined},_0x40f422=await withSpinner(_0x2af6c9(0x1ba)+_0x2058c6+_0x2af6c9(0x1ac),()=>_0x2349b5[_0x2af6c9(0x19c)][_0x2af6c9(0x1a5)](_0x221dbc,_0x4fde64),{'verbose':_0x45b50e[_0x2af6c9(0x1c2)]}),_0x2736d2=_0x40f422[_0x2af6c9(0x19e)];return console[_0x2af6c9(0x1b9)]('βœ”\x20Created\x20segment\x20\x27'+_0x2736d2[_0x2af6c9(0x1af)]+_0x2af6c9(0x1bc)+_0x2736d2['id']),_0x47119f!==_0x5e6b43&&console[_0x2af6c9(0x1b9)]('\x20\x20\x20Path:\x20'+_0x47119f),await handleSDKOutput([_0x2736d2],_0x45b50e),0x0;}}
1
+ const a37_0x4dd119=a37_0x23dd;(function(_0xee01b8,_0x38c2a7){const _0x3c6d42=a37_0x23dd,_0x23203e=_0xee01b8();while(!![]){try{const _0x4d09fe=-parseInt(_0x3c6d42(0x87))/0x1+-parseInt(_0x3c6d42(0x86))/0x2+-parseInt(_0x3c6d42(0x6b))/0x3+parseInt(_0x3c6d42(0x8f))/0x4+parseInt(_0x3c6d42(0x80))/0x5+parseInt(_0x3c6d42(0x8b))/0x6+parseInt(_0x3c6d42(0x8e))/0x7;if(_0x4d09fe===_0x38c2a7)break;else _0x23203e['push'](_0x23203e['shift']());}catch(_0x20632d){_0x23203e['push'](_0x23203e['shift']());}}}(a37_0x29e0,0x5c8db));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';function a37_0x29e0(){const _0x354e60=['segment','Creating\x20segment\x20\x27','Resolved\x20folder\x20ID:\x20','type','segmentPath','Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.','data','Segment\x20name:\x20','682030lqrjXw','\x27...','Create\x20child\x20segment\x20with\x20filtering\x20rules','⚠\x20Deprecation\x20warning:\x20`segment\x20create`\x20is\x20deprecated.','Resolved\x20relative\x20path\x20to:\x20','kind','847238ZGiWpq','604035PiwLjZ','name','Examples:','Resolving\x20parent\x20segment\x20\x27','872076CSrOiu','resolveParentId','verbose','5073635YcmtEv','2574220tailfE','error','invisible','ruleFile','folderId','segments','description','Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)','folder','includes','Resolving\x20folder\x20path\x20\x27','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27','execute','Resolving\x20folder\x20\x27','730077QBdOJc','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27','parent','resolveFolderId','Target\x20path:\x20','Parent:\x20','resolvePathToResource','length','βœ”\x20Created\x20segment\x20\x27','noCountPopulation','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','\x27\x20with\x20ID:\x20'];a37_0x29e0=function(){return _0x354e60;};return a37_0x29e0();}import{withSpinner}from'../utils/spinner.js';function a37_0x23dd(_0x2f38a5,_0x3dbaca){_0x2f38a5=_0x2f38a5-0x65;const _0x29e0b4=a37_0x29e0();let _0x23dd40=_0x29e0b4[_0x2f38a5];return _0x23dd40;}import{loadJSONFromOptions}from'../utils/json-loader.js';import{parsePath,getParentPath,getBaseName}from'../sdk/segment/segment-path-parser.js';import a37_0xdd990f from'chalk';export class SegmentCreateCommand extends BaseCommand{[a37_0x4dd119(0x88)]='segment:create';['description']=a37_0x4dd119(0x82);async[a37_0x4dd119(0x69)](_0x5f077c){const _0x381516=a37_0x4dd119;console[_0x381516(0x90)](a37_0xdd990f['yellow'](_0x381516(0x83))),console[_0x381516(0x90)](a37_0xdd990f['yellow'](_0x381516(0x6c)));const {options:_0x3aa2ae,args:_0x2ebd58,tdx:_0x1841eb}=_0x5f077c,_0x7f5da7=_0x3aa2ae;if(_0x2ebd58[_0x381516(0x73)]===0x0)return console[_0x381516(0x90)](_0x381516(0x76)),console[_0x381516(0x90)]('Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]'),console[_0x381516(0x90)](_0x381516(0x89)),console[_0x381516(0x90)](_0x381516(0x6d)),console[_0x381516(0x90)](_0x381516(0x68)),console[_0x381516(0x90)]('\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context'),0x1;const _0xa9be03=_0x2ebd58[0x0],_0x3ef9f6=_0x3aa2ae[_0x381516(0x7c)];let _0xfdee9c=_0xa9be03;_0x3ef9f6&&!_0xa9be03[_0x381516(0x66)]('/')&&(_0xfdee9c=_0x3ef9f6+'/'+_0xa9be03,_0x7f5da7['verbose']&&console['error'](_0x381516(0x84)+_0xfdee9c));const _0x5b173d=parsePath(_0xfdee9c);if(_0x5b173d[_0x381516(0x94)][_0x381516(0x73)]<0x2)return console[_0x381516(0x90)](_0x381516(0x96)),console['error']('Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]'),0x1;const _0x48660b=_0x5b173d[_0x381516(0x94)][0x0],_0x19f908=getBaseName(_0xfdee9c),_0x19c786=getParentPath(_0xfdee9c);_0x7f5da7[_0x381516(0x8d)]&&(console[_0x381516(0x90)]('Site:\x20'+_0x7f5da7['site']),console[_0x381516(0x90)](_0x381516(0x70)+_0xfdee9c),console[_0x381516(0x90)](_0x381516(0x71)+_0x48660b),console[_0x381516(0x90)](_0x381516(0x7f)+_0x19f908),console['error']('Parent\x20path:\x20'+_0x19c786));const _0x1641fb=await withSpinner(_0x381516(0x8a)+_0x48660b+_0x381516(0x81),()=>_0x1841eb[_0x381516(0x78)][_0x381516(0x8c)](_0x48660b),{'verbose':_0x7f5da7[_0x381516(0x8d)]}),_0x33730a=_0x1641fb[_0x381516(0x7e)];let _0x278011;if(_0x5b173d[_0x381516(0x94)][_0x381516(0x73)]>0x2){const _0x40d94a=await withSpinner(_0x381516(0x67)+_0x19c786+_0x381516(0x81),()=>_0x1841eb['segment'][_0x381516(0x72)](_0x19c786),{'verbose':_0x7f5da7[_0x381516(0x8d)]}),_0x532f30=_0x40d94a[_0x381516(0x7e)];if(_0x532f30[_0x381516(0x7b)]!=='folder'&&_0x532f30['type']!==_0x381516(0x6e))return console[_0x381516(0x90)](_0x381516(0x7d)),0x1;_0x278011=_0x532f30[_0x381516(0x93)];}else{if(_0x7f5da7[_0x381516(0x65)]){const _0x3e5121=await withSpinner(_0x381516(0x6a)+_0x7f5da7['folder']+_0x381516(0x81),()=>_0x1841eb['segment'][_0x381516(0x6f)](_0x33730a,_0x7f5da7[_0x381516(0x65)]),{'verbose':_0x7f5da7['verbose']});_0x278011=_0x3e5121['data'];}}_0x7f5da7[_0x381516(0x8d)]&&_0x278011&&console[_0x381516(0x90)](_0x381516(0x7a)+_0x278011);const _0x3d275f=await loadJSONFromOptions(_0x7f5da7['rule'],_0x7f5da7[_0x381516(0x92)]),_0x1b6dba={'name':_0x19f908,'description':_0x7f5da7[_0x381516(0x95)],'rule':_0x3d275f,'kind':_0x7f5da7['kind']!==undefined?parseInt(_0x7f5da7[_0x381516(0x85)],0xa):undefined,'isVisible':_0x7f5da7[_0x381516(0x91)]?![]:undefined,'segmentFolderId':_0x278011,'countPopulation':_0x7f5da7[_0x381516(0x75)]?![]:undefined},_0x5dca0b=await withSpinner(_0x381516(0x79)+_0x19f908+_0x381516(0x81),()=>_0x1841eb[_0x381516(0x78)]['createSegment'](_0x33730a,_0x1b6dba),{'verbose':_0x7f5da7[_0x381516(0x8d)]}),_0x58484f=_0x5dca0b[_0x381516(0x7e)];return console[_0x381516(0x90)](_0x381516(0x74)+_0x58484f[_0x381516(0x88)]+_0x381516(0x77)+_0x58484f['id']),_0xfdee9c!==_0xa9be03&&console['error']('\x20\x20\x20Path:\x20'+_0xfdee9c),await handleSDKOutput([_0x58484f],_0x7f5da7),0x0;}}
@@ -1 +1 @@
1
- const a38_0x200baf=a38_0x4cb6;(function(_0x475003,_0x11bae2){const _0x37a72e=a38_0x4cb6,_0x25d266=_0x475003();while(!![]){try{const _0x14aba0=-parseInt(_0x37a72e(0x192))/0x1+parseInt(_0x37a72e(0x186))/0x2*(-parseInt(_0x37a72e(0x193))/0x3)+-parseInt(_0x37a72e(0x18f))/0x4+-parseInt(_0x37a72e(0x184))/0x5*(parseInt(_0x37a72e(0x18e))/0x6)+parseInt(_0x37a72e(0x181))/0x7+-parseInt(_0x37a72e(0x18b))/0x8+parseInt(_0x37a72e(0x185))/0x9*(parseInt(_0x37a72e(0x189))/0xa);if(_0x14aba0===_0x11bae2)break;else _0x25d266['push'](_0x25d266['shift']());}catch(_0x1b53cd){_0x25d266['push'](_0x25d266['shift']());}}}(a38_0x1922,0x37c30));function a38_0x4cb6(_0x466a88,_0x263011){_0x466a88=_0x466a88-0x181;const _0x192227=a38_0x1922();let _0x4cb6d5=_0x192227[_0x466a88];return _0x4cb6d5;}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 a38_0x1922(){const _0x53e730=['data','parentSegment','20hzzZFz','error','2478600IvbTXB','description','name','14754goFYCH','249924ucKVLV','listFields','Site:\x20','300051nmMijl','76614VyHQDw','segment:fields','List\x20available\x20fields\x20for\x20segmentation','jsonl','segment','verbose','\x20field','2754696ksiomf','length','\x27...','605zXMngC','5000508uElXdy','24iOiTjH'];a38_0x1922=function(){return _0x53e730;};return a38_0x1922();}export class SegmentFieldsCommand extends BaseCommand{[a38_0x200baf(0x18d)]=a38_0x200baf(0x194);[a38_0x200baf(0x18c)]=a38_0x200baf(0x195);async['execute'](_0x5c74fa){const _0x475a28=a38_0x200baf,{options:_0x2e03fa,args:_0x3760d2,tdx:_0x2562a3}=_0x5c74fa,_0xe092e7=_0x3760d2[0x0]||_0x2e03fa[_0x475a28(0x188)];if(!_0xe092e7)return console[_0x475a28(0x18a)]('Error:\x20Parent\x20segment\x20name\x20is\x20required'),console[_0x475a28(0x18a)]('Usage:\x20tdx\x20segment\x20fields\x20<parent_name>'),console[_0x475a28(0x18a)]('\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>'),0x1;_0x2e03fa[_0x475a28(0x198)]&&(console[_0x475a28(0x18a)](_0x475a28(0x191)+_0x2e03fa['site']),console[_0x475a28(0x18a)]('Parent\x20segment:\x20'+_0xe092e7));const _0x3b605d=await withSpinner('Listing\x20fields\x20for\x20\x27'+_0xe092e7+_0x475a28(0x183),()=>_0x2562a3[_0x475a28(0x197)][_0x475a28(0x190)](_0xe092e7),{'verbose':_0x2e03fa[_0x475a28(0x198)]}),_0x51966a=_0x3b605d[_0x475a28(0x187)];console[_0x475a28(0x18a)]('βœ”\x20Found\x20'+_0x51966a[_0x475a28(0x182)]+_0x475a28(0x199)+(_0x51966a['length']!==0x1?'s':''));if(_0x2e03fa['json']||_0x2e03fa[_0x475a28(0x196)])return await handleSDKOutput(_0x51966a,_0x2e03fa),0x0;return displayFieldsHumanReadable(_0x51966a,_0xe092e7),0x0;}}
1
+ const a38_0xbbbe4b=a38_0x53a8;(function(_0xf8a6c1,_0x1ad2cc){const _0x3206ef=a38_0x53a8,_0x2e62d0=_0xf8a6c1();while(!![]){try{const _0x58a2c7=parseInt(_0x3206ef(0x19c))/0x1+-parseInt(_0x3206ef(0x1a4))/0x2+-parseInt(_0x3206ef(0x198))/0x3*(-parseInt(_0x3206ef(0x193))/0x4)+-parseInt(_0x3206ef(0x18d))/0x5*(-parseInt(_0x3206ef(0x18c))/0x6)+parseInt(_0x3206ef(0x188))/0x7+parseInt(_0x3206ef(0x191))/0x8*(-parseInt(_0x3206ef(0x19f))/0x9)+-parseInt(_0x3206ef(0x1a2))/0xa*(parseInt(_0x3206ef(0x18f))/0xb);if(_0x58a2c7===_0x1ad2cc)break;else _0x2e62d0['push'](_0x2e62d0['shift']());}catch(_0x45dfad){_0x2e62d0['push'](_0x2e62d0['shift']());}}}(a38_0x27c4,0x9e43c));function a38_0x53a8(_0x497f14,_0x131ee5){_0x497f14=_0x497f14-0x188;const _0x27c477=a38_0x27c4();let _0x53a87a=_0x27c477[_0x497f14];return _0x53a87a;}import{BaseCommand}from'./command.js';function a38_0x27c4(){const _0x1b83df=['data','Usage:\x20tdx\x20segment\x20fields\x20<parent_name>','873rDZwIM','site','error','10sjXhLT','List\x20available\x20fields\x20for\x20segmentation','1151452XFfkPu','324702vpZeuu','verbose','segment:fields','Parent\x20segment:\x20','120984WqDkTH','110ueZogt','Error:\x20Parent\x20segment\x20name\x20is\x20required','594319KvcKrW','length','72176hAatSC','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','1594616WocBsC','Site:\x20','Listing\x20fields\x20for\x20\x27','listFields','\x27...','3EgLOke','execute','\x20field','name','1264493yVGrDe'];a38_0x27c4=function(){return _0x1b83df;};return a38_0x27c4();}import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{displayFieldsHumanReadable}from'../sdk/segment/fields-display.js';export class SegmentFieldsCommand extends BaseCommand{[a38_0xbbbe4b(0x19b)]=a38_0xbbbe4b(0x18a);['description']=a38_0xbbbe4b(0x1a3);async[a38_0xbbbe4b(0x199)](_0x3ccdab){const _0x3f69fd=a38_0xbbbe4b,{options:_0x17e335,args:_0x3b4bb1,tdx:_0x4fa5d4}=_0x3ccdab,_0x5de70e=_0x3b4bb1[0x0]||_0x17e335['parentSegment'];if(!_0x5de70e)return console[_0x3f69fd(0x1a1)](_0x3f69fd(0x18e)),console['error'](_0x3f69fd(0x19e)),console[_0x3f69fd(0x1a1)](_0x3f69fd(0x192)),0x1;_0x17e335[_0x3f69fd(0x189)]&&(console[_0x3f69fd(0x1a1)](_0x3f69fd(0x194)+_0x17e335[_0x3f69fd(0x1a0)]),console[_0x3f69fd(0x1a1)](_0x3f69fd(0x18b)+_0x5de70e));const _0x3df8d5=await withSpinner(_0x3f69fd(0x195)+_0x5de70e+_0x3f69fd(0x197),()=>_0x4fa5d4['segment'][_0x3f69fd(0x196)](_0x5de70e),{'verbose':_0x17e335['verbose']}),_0x1a40fb=_0x3df8d5[_0x3f69fd(0x19d)];console[_0x3f69fd(0x1a1)]('βœ”\x20Found\x20'+_0x1a40fb[_0x3f69fd(0x190)]+_0x3f69fd(0x19a)+(_0x1a40fb['length']!==0x1?'s':''));if(_0x17e335['json']||_0x17e335['jsonl'])return await handleSDKOutput(_0x1a40fb,_0x17e335),0x0;return displayFieldsHumanReadable(_0x1a40fb,_0x5de70e),0x0;}}
@@ -1 +1 @@
1
- const a39_0x35977f=a39_0x1106;(function(_0x2c082f,_0x178b7e){const _0x19ac4c=a39_0x1106,_0x3a613e=_0x2c082f();while(!![]){try{const _0x1e7512=parseInt(_0x19ac4c(0x149))/0x1+-parseInt(_0x19ac4c(0x166))/0x2*(parseInt(_0x19ac4c(0x145))/0x3)+-parseInt(_0x19ac4c(0x143))/0x4*(-parseInt(_0x19ac4c(0x187))/0x5)+-parseInt(_0x19ac4c(0x147))/0x6*(-parseInt(_0x19ac4c(0x18e))/0x7)+-parseInt(_0x19ac4c(0x179))/0x8+parseInt(_0x19ac4c(0x174))/0x9*(parseInt(_0x19ac4c(0x17f))/0xa)+parseInt(_0x19ac4c(0x183))/0xb*(-parseInt(_0x19ac4c(0x16c))/0xc);if(_0x1e7512===_0x178b7e)break;else _0x3a613e['push'](_0x3a613e['shift']());}catch(_0x5b811a){_0x3a613e['push'](_0x3a613e['shift']());}}}(a39_0x3614,0x7e5eb));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{saveSessionContext}from'../core/session.js';function a39_0x3614(){const _0x76027b=['green','\x20new\x20files','file','Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files','2626284QkVcwi','journeys','error','No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27','message','dirname','description','cwd','18LcfOTd','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','execute','length','\x20\x20🎯\x20','3614376WUqzIE','Write\x20','dryRun','Target\x20resource:\x20','site','\x0aError:','2426490GkBiGh','segments','\x20journeys','counts','11lrvyXL','\x27...','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent','pullSegments','95YYadfV','βœ”\x20Context\x20set:\x20','isNew','yes','repeat','no_parent','\x20segments','7fwdjsz','targetDir','errorCode','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','files','Parent\x20segment:\x20','Aborted.','relativePath','\x0aChanges\x20to\x20\x27','3244cCLtWB','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','3eHTIJy','parent_segment','4453386caSUNQ','βœ”\x20Pulled\x20','559810OrTJdQ','\x20versions)','\x20=\x20','\x20files?','red','\x20files\x20to\x20','verbose','\x20unchanged\x20files','session','Error:\x20','Site:\x20','absolutePath','-\x20no\x20files\x20written','\x20changed\x20files','utf-8','βœ”\x20All\x20files\x20are\x20up\x20to\x20date','cyan','yellow','parentName','name','segment:pull','Pulling\x20segments\x20from\x20\x27','\x20with\x20','type','dim','hasChanges','resourceName','diff','filter','1228966IlygLs','segment'];a39_0x3614=function(){return _0x76027b;};return a39_0x3614();}import a39_0x168faa from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';import a39_0x1e1813 from'path';function a39_0x1106(_0x2b8e17,_0x1e17c5){_0x2b8e17=_0x2b8e17-0x141;const _0x361415=a39_0x3614();let _0x11068f=_0x361415[_0x2b8e17];return _0x11068f;}import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';export{buildFolderIdToPathMap as buildFolderPathMap}from'../sdk/segment/resolution-context.js';export class SegmentPullCommand extends BaseCommand{[a39_0x35977f(0x15c)]=a39_0x35977f(0x15d);[a39_0x35977f(0x172)]=a39_0x35977f(0x16b);async[a39_0x35977f(0x176)](_0x5b2e6b){const _0x23ca86=a39_0x35977f,{options:_0x471b01,args:_0x2d14db,tdx:_0x475c88}=_0x5b2e6b,_0x4a2550=_0x471b01,_0x1754eb=await resolveTarget({'arg':_0x2d14db[0x0],'contextParent':_0x471b01['parentSegment'],'cwd':process[_0x23ca86(0x173)]()});if(!isSuccessfulResolution(_0x1754eb))return _0x1754eb[_0x23ca86(0x190)]===_0x23ca86(0x18c)?(console[_0x23ca86(0x16e)](a39_0x168faa[_0x23ca86(0x15a)](_0x23ca86(0x175))),console['error']('Usage:\x20tdx\x20sg\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20(requires\x20context\x20or\x20tdx.json)'),console['error'](_0x23ca86(0x185)),console[_0x23ca86(0x16e)]('\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[_0x23ca86(0x16e)](a39_0x168faa['red'](_0x23ca86(0x152)+_0x1754eb[_0x23ca86(0x170)]+'\x0a')),_0x1754eb['helpText']&&console[_0x23ca86(0x16e)](a39_0x168faa[_0x23ca86(0x159)](_0x1754eb['helpText']))),0x1;const _0x4e6c69=_0x1754eb[_0x23ca86(0x15b)],_0x43bfe0=_0x1754eb[_0x23ca86(0x18f)],_0x13e60b=_0x1754eb[_0x23ca86(0x160)]===_0x23ca86(0x16a)?_0x1754eb[_0x23ca86(0x163)]:undefined;_0x4a2550[_0x23ca86(0x14f)]&&(console[_0x23ca86(0x16e)](_0x23ca86(0x153)+_0x4a2550[_0x23ca86(0x17d)]),console[_0x23ca86(0x16e)](_0x23ca86(0x193)+_0x4e6c69),_0x13e60b&&console[_0x23ca86(0x16e)](_0x23ca86(0x17c)+_0x13e60b));const _0x40fd11=await withProgressSpinner(_0x23ca86(0x15e)+_0x4e6c69+_0x23ca86(0x184),_0x491c90=>_0x475c88[_0x23ca86(0x167)][_0x23ca86(0x186)](_0x4e6c69,{'targetDir':_0x43bfe0,'targetResourceName':_0x13e60b,'verbose':_0x4a2550[_0x23ca86(0x14f)],'progress':{'update':_0x9ed4f7=>{const _0x58ae98=_0x23ca86;_0x491c90['setPhase'](_0x9ed4f7),_0x4a2550[_0x58ae98(0x14f)]&&console[_0x58ae98(0x16e)]('\x20\x20'+_0x9ed4f7);}}}),{'verbose':_0x4a2550[_0x23ca86(0x14f)]}),_0x4a9d84=_0x40fd11['data'];if(_0x4a9d84[_0x23ca86(0x182)]['segments']===0x0&&_0x4a9d84[_0x23ca86(0x182)][_0x23ca86(0x16d)]===0x0)return console[_0x23ca86(0x16e)](a39_0x168faa[_0x23ca86(0x15a)](_0x23ca86(0x16f)+_0x4a9d84[_0x23ca86(0x15b)]+'\x27')),0x0;const _0x169943=_0x4a9d84[_0x23ca86(0x192)]['filter'](_0x215475=>_0x215475['isNew']),_0x4387d=_0x4a9d84[_0x23ca86(0x192)][_0x23ca86(0x165)](_0x1003ee=>!_0x1003ee[_0x23ca86(0x189)]&&_0x1003ee[_0x23ca86(0x162)]),_0x519abb=_0x4a9d84[_0x23ca86(0x192)]['filter'](_0x1bca00=>!_0x1bca00[_0x23ca86(0x189)]&&!_0x1bca00[_0x23ca86(0x162)]);console[_0x23ca86(0x16e)]('\x0aPull\x20summary\x20for\x20\x27'+_0x4a9d84[_0x23ca86(0x15b)]+'\x27:'),console[_0x23ca86(0x16e)](_0x23ca86(0x178)+a39_0x168faa['cyan'](_0x4a9d84['counts'][_0x23ca86(0x180)]+_0x23ca86(0x18d))+_0x23ca86(0x15f)+a39_0x168faa[_0x23ca86(0x159)](_0x4a9d84[_0x23ca86(0x182)]['activations']+'\x20activations'));if(_0x4a9d84['counts'][_0x23ca86(0x16d)]>0x0){const _0x3c3a36=_0x4a9d84['counts']['journeyVersions']>_0x4a9d84['counts'][_0x23ca86(0x16d)]?'\x20('+_0x4a9d84[_0x23ca86(0x182)]['journeyVersions']+_0x23ca86(0x14a):'';console[_0x23ca86(0x16e)]('\x20\x20πŸ—ΊοΈ\x20\x20'+a39_0x168faa['cyan'](_0x4a9d84['counts'][_0x23ca86(0x16d)]+_0x23ca86(0x181))+a39_0x168faa[_0x23ca86(0x161)](_0x3c3a36));}console['error']('\x20\x20'+a39_0x168faa[_0x23ca86(0x168)]('+\x20'+_0x169943['length']+_0x23ca86(0x169))),console['error']('\x20\x20'+a39_0x168faa[_0x23ca86(0x15a)]('~\x20'+_0x4387d[_0x23ca86(0x177)]+_0x23ca86(0x156))),console[_0x23ca86(0x16e)]('\x20\x20'+a39_0x168faa['dim']('=\x20'+_0x519abb[_0x23ca86(0x177)]+_0x23ca86(0x150))),console[_0x23ca86(0x16e)]('\x20\x20Target:\x20'+a39_0x168faa['cyan'](_0x4a9d84['targetDir'])+'\x0a');if(_0x4387d['length']>0x0)for(const _0xd42110 of _0x4387d){console['error'](_0x23ca86(0x142)+_0xd42110[_0x23ca86(0x141)]+'\x27:'),console['error']('─'[_0x23ca86(0x18b)](0x3c)),console[_0x23ca86(0x16e)](_0xd42110[_0x23ca86(0x164)]),console[_0x23ca86(0x16e)]('─'[_0x23ca86(0x18b)](0x3c));}if(_0x4a2550[_0x23ca86(0x17b)])return console[_0x23ca86(0x16e)](a39_0x168faa[_0x23ca86(0x15a)]('\x0a[Dry\x20run]\x20No\x20files\x20were\x20written')),0x0;if(_0x169943[_0x23ca86(0x177)]===0x0&&_0x4387d[_0x23ca86(0x177)]===0x0)return console[_0x23ca86(0x16e)](a39_0x168faa[_0x23ca86(0x168)](_0x23ca86(0x158))),saveSessionContext({'parent_segment':_0x4a9d84[_0x23ca86(0x15b)]},_0x4a2550[_0x23ca86(0x151)]),console[_0x23ca86(0x16e)](a39_0x168faa[_0x23ca86(0x168)](_0x23ca86(0x188)+a39_0x168faa[_0x23ca86(0x161)](_0x23ca86(0x146))+_0x23ca86(0x14b)+a39_0x168faa[_0x23ca86(0x159)](_0x4a9d84[_0x23ca86(0x15b)]))),0x0;if(!_0x4a2550[_0x23ca86(0x18a)]){if(!isInteractive())return console['error'](a39_0x168faa[_0x23ca86(0x14d)](_0x23ca86(0x17e)),_0x23ca86(0x144)),console[_0x23ca86(0x16e)](a39_0x168faa['dim'](_0x23ca86(0x191))),0x1;const _0x43257e=await confirmKey(_0x23ca86(0x17a)+(_0x169943[_0x23ca86(0x177)]+_0x4387d[_0x23ca86(0x177)])+_0x23ca86(0x14c));if(!_0x43257e)return console[_0x23ca86(0x16e)](a39_0x168faa[_0x23ca86(0x15a)](_0x23ca86(0x194)),_0x23ca86(0x155)),0x1;}for(const _0x486269 of _0x4a9d84[_0x23ca86(0x192)]){if(_0x486269['isNew']||_0x486269[_0x23ca86(0x162)]){const _0xe8d963=a39_0x1e1813[_0x23ca86(0x171)](_0x486269[_0x23ca86(0x154)]);!existsSync(_0xe8d963)&&mkdirSync(_0xe8d963,{'recursive':!![]}),writeFileSync(_0x486269[_0x23ca86(0x154)],_0x486269['content'],_0x23ca86(0x157));}}return console[_0x23ca86(0x16e)](a39_0x168faa['green'](_0x23ca86(0x148)+(_0x169943[_0x23ca86(0x177)]+_0x4387d[_0x23ca86(0x177)])+_0x23ca86(0x14e)+_0x4a9d84[_0x23ca86(0x18f)])),saveSessionContext({'parent_segment':_0x4a9d84['parentName']},_0x4a2550[_0x23ca86(0x151)]),console[_0x23ca86(0x16e)](a39_0x168faa['green'](_0x23ca86(0x188)+a39_0x168faa[_0x23ca86(0x161)]('parent_segment')+'\x20=\x20'+a39_0x168faa[_0x23ca86(0x159)](_0x4a9d84[_0x23ca86(0x15b)]))),0x0;}}
1
+ const a39_0x3075a5=a39_0x2da2;(function(_0x5c49d8,_0xc04cdd){const _0x40543c=a39_0x2da2,_0x580f13=_0x5c49d8();while(!![]){try{const _0x3d46e7=-parseInt(_0x40543c(0xb9))/0x1+-parseInt(_0x40543c(0xad))/0x2+parseInt(_0x40543c(0x8e))/0x3+parseInt(_0x40543c(0x90))/0x4*(parseInt(_0x40543c(0x81))/0x5)+parseInt(_0x40543c(0xa8))/0x6*(-parseInt(_0x40543c(0xac))/0x7)+parseInt(_0x40543c(0xa5))/0x8*(-parseInt(_0x40543c(0xb8))/0x9)+parseInt(_0x40543c(0x8b))/0xa;if(_0x3d46e7===_0xc04cdd)break;else _0x580f13['push'](_0x580f13['shift']());}catch(_0x52dd11){_0x580f13['push'](_0x580f13['shift']());}}}(a39_0x4c36,0xd7f95));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';function a39_0x4c36(){const _0x1cad41=['segments','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','error','parentName','\x20files\x20to\x20','dim','parent_segment','209140qdvoSc','\x20files?','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','site','dryRun','execute','hasChanges','length','diff','relativePath','35131260NATESz','\x20journeys','Parent\x20segment:\x20','3043761DOQtfB','βœ”\x20All\x20files\x20are\x20up\x20to\x20date','20MOcpqg','\x20\x20🎯\x20','message','Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files','errorCode','dirname','\x27...','journeys','segment:pull','\x20\x20πŸ—ΊοΈ\x20\x20','\x20segments','\x0aError:','\x20unchanged\x20files','isNew','absolutePath','cyan','targetDir','pullSegments','No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27','\x20\x20Target:\x20','yes','56024yZEAAI','content','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent','41964krLCtz','no_parent','\x20changed\x20files','type','973tEYfOT','2217040KjDPKW','Aborted.','segment','Error:\x20','files','helpText','green','counts','\x20=\x20','yellow','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)','1413knFEgG','672067iBZbsL','Site:\x20','Target\x20resource:\x20','βœ”\x20Context\x20set:\x20','resourceName','utf-8','red','βœ”\x20Pulled\x20','session','repeat','Pulling\x20segments\x20from\x20\x27','file','filter','journeyVersions','\x20with\x20','\x20new\x20files','cwd','activations','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','Write\x20','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written'];a39_0x4c36=function(){return _0x1cad41;};return a39_0x4c36();}import{confirmKey,isInteractive}from'../utils/prompt.js';import{saveSessionContext}from'../core/session.js';import a39_0x364acc from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';function a39_0x2da2(_0x44688f,_0x5f819a){_0x44688f=_0x44688f-0x67;const _0x4c3610=a39_0x4c36();let _0x2da27d=_0x4c3610[_0x44688f];return _0x2da27d;}import a39_0x2440ef 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']=a39_0x3075a5(0x98);['description']=a39_0x3075a5(0x93);async[a39_0x3075a5(0x86)](_0x4146fe){const _0x5c05dd=a39_0x3075a5,{options:_0x957702,args:_0x35c6b6,tdx:_0x3e07cf}=_0x4146fe,_0x245017=_0x957702,_0xc0f9e9=await resolveTarget({'arg':_0x35c6b6[0x0],'contextParent':_0x957702['parentSegment'],'cwd':process[_0x5c05dd(0x75)]()});if(!isSuccessfulResolution(_0xc0f9e9))return _0xc0f9e9[_0x5c05dd(0x94)]===_0x5c05dd(0xa9)?(console['error'](a39_0x364acc[_0x5c05dd(0xb6)](_0x5c05dd(0x83))),console['error'](_0x5c05dd(0xb7)),console['error'](_0x5c05dd(0xa7)),console[_0x5c05dd(0x7c)]('\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[_0x5c05dd(0x7c)](a39_0x364acc[_0x5c05dd(0x6b)](_0x5c05dd(0xb0)+_0xc0f9e9[_0x5c05dd(0x92)]+'\x0a')),_0xc0f9e9[_0x5c05dd(0xb2)]&&console['error'](a39_0x364acc[_0x5c05dd(0x9f)](_0xc0f9e9[_0x5c05dd(0xb2)]))),0x1;const _0x12a742=_0xc0f9e9['parentName'],_0x4d1ae3=_0xc0f9e9[_0x5c05dd(0xa0)],_0x6b42cf=_0xc0f9e9[_0x5c05dd(0xab)]===_0x5c05dd(0x70)?_0xc0f9e9[_0x5c05dd(0x69)]:undefined;_0x245017['verbose']&&(console['error'](_0x5c05dd(0xba)+_0x245017[_0x5c05dd(0x84)]),console[_0x5c05dd(0x7c)](_0x5c05dd(0x8d)+_0x12a742),_0x6b42cf&&console[_0x5c05dd(0x7c)](_0x5c05dd(0x67)+_0x6b42cf));const _0x3ea98d=await withProgressSpinner(_0x5c05dd(0x6f)+_0x12a742+_0x5c05dd(0x96),_0x47a0c6=>_0x3e07cf[_0x5c05dd(0xaf)][_0x5c05dd(0xa1)](_0x12a742,{'targetDir':_0x4d1ae3,'targetResourceName':_0x6b42cf,'verbose':_0x245017['verbose'],'progress':{'update':_0x48eadc=>{_0x47a0c6['setPhase'](_0x48eadc),_0x245017['verbose']&&console['error']('\x20\x20'+_0x48eadc);}}}),{'verbose':_0x245017['verbose']}),_0x4ac206=_0x3ea98d['data'];if(_0x4ac206[_0x5c05dd(0xb4)][_0x5c05dd(0x7a)]===0x0&&_0x4ac206['counts'][_0x5c05dd(0x97)]===0x0)return console[_0x5c05dd(0x7c)](a39_0x364acc['yellow'](_0x5c05dd(0xa2)+_0x4ac206[_0x5c05dd(0x7d)]+'\x27')),0x0;const _0x54c771=_0x4ac206[_0x5c05dd(0xb1)][_0x5c05dd(0x71)](_0x13e8ba=>_0x13e8ba[_0x5c05dd(0x9d)]),_0x2abb5b=_0x4ac206[_0x5c05dd(0xb1)][_0x5c05dd(0x71)](_0x811713=>!_0x811713['isNew']&&_0x811713[_0x5c05dd(0x87)]),_0x5ba8c5=_0x4ac206[_0x5c05dd(0xb1)]['filter'](_0x1f976e=>!_0x1f976e[_0x5c05dd(0x9d)]&&!_0x1f976e[_0x5c05dd(0x87)]);console['error']('\x0aPull\x20summary\x20for\x20\x27'+_0x4ac206[_0x5c05dd(0x7d)]+'\x27:'),console[_0x5c05dd(0x7c)](_0x5c05dd(0x91)+a39_0x364acc[_0x5c05dd(0x9f)](_0x4ac206[_0x5c05dd(0xb4)][_0x5c05dd(0x7a)]+_0x5c05dd(0x9a))+_0x5c05dd(0x73)+a39_0x364acc[_0x5c05dd(0x9f)](_0x4ac206[_0x5c05dd(0xb4)][_0x5c05dd(0x76)]+'\x20activations'));if(_0x4ac206[_0x5c05dd(0xb4)][_0x5c05dd(0x97)]>0x0){const _0x3be419=_0x4ac206[_0x5c05dd(0xb4)][_0x5c05dd(0x72)]>_0x4ac206[_0x5c05dd(0xb4)]['journeys']?'\x20('+_0x4ac206[_0x5c05dd(0xb4)]['journeyVersions']+'\x20versions)':'';console[_0x5c05dd(0x7c)](_0x5c05dd(0x99)+a39_0x364acc[_0x5c05dd(0x9f)](_0x4ac206[_0x5c05dd(0xb4)][_0x5c05dd(0x97)]+_0x5c05dd(0x8c))+a39_0x364acc[_0x5c05dd(0x7f)](_0x3be419));}console['error']('\x20\x20'+a39_0x364acc[_0x5c05dd(0xb3)]('+\x20'+_0x54c771['length']+_0x5c05dd(0x74))),console[_0x5c05dd(0x7c)]('\x20\x20'+a39_0x364acc[_0x5c05dd(0xb6)]('~\x20'+_0x2abb5b[_0x5c05dd(0x88)]+_0x5c05dd(0xaa))),console[_0x5c05dd(0x7c)]('\x20\x20'+a39_0x364acc[_0x5c05dd(0x7f)]('=\x20'+_0x5ba8c5[_0x5c05dd(0x88)]+_0x5c05dd(0x9c))),console['error'](_0x5c05dd(0xa3)+a39_0x364acc[_0x5c05dd(0x9f)](_0x4ac206[_0x5c05dd(0xa0)])+'\x0a');if(_0x2abb5b[_0x5c05dd(0x88)]>0x0)for(const _0x4733dc of _0x2abb5b){console[_0x5c05dd(0x7c)]('\x0aChanges\x20to\x20\x27'+_0x4733dc[_0x5c05dd(0x8a)]+'\x27:'),console[_0x5c05dd(0x7c)]('─'[_0x5c05dd(0x6e)](0x3c)),console[_0x5c05dd(0x7c)](_0x4733dc[_0x5c05dd(0x89)]),console[_0x5c05dd(0x7c)]('─'[_0x5c05dd(0x6e)](0x3c));}if(_0x245017[_0x5c05dd(0x85)])return console[_0x5c05dd(0x7c)](a39_0x364acc[_0x5c05dd(0xb6)](_0x5c05dd(0x79))),0x0;if(_0x54c771[_0x5c05dd(0x88)]===0x0&&_0x2abb5b[_0x5c05dd(0x88)]===0x0)return console[_0x5c05dd(0x7c)](a39_0x364acc[_0x5c05dd(0xb3)](_0x5c05dd(0x8f))),saveSessionContext({'parent_segment':_0x4ac206[_0x5c05dd(0x7d)]},_0x245017[_0x5c05dd(0x6d)]),console[_0x5c05dd(0x7c)](a39_0x364acc['green'](_0x5c05dd(0x68)+a39_0x364acc[_0x5c05dd(0x7f)]('parent_segment')+'\x20=\x20'+a39_0x364acc[_0x5c05dd(0x9f)](_0x4ac206[_0x5c05dd(0x7d)]))),0x0;if(!_0x245017[_0x5c05dd(0xa4)]){if(!isInteractive())return console['error'](a39_0x364acc['red'](_0x5c05dd(0x9b)),_0x5c05dd(0x77)),console[_0x5c05dd(0x7c)](a39_0x364acc[_0x5c05dd(0x7f)](_0x5c05dd(0x7b))),0x1;const _0x4c84a4=await confirmKey(_0x5c05dd(0x78)+(_0x54c771[_0x5c05dd(0x88)]+_0x2abb5b[_0x5c05dd(0x88)])+_0x5c05dd(0x82));if(!_0x4c84a4)return console[_0x5c05dd(0x7c)](a39_0x364acc['yellow'](_0x5c05dd(0xae)),'-\x20no\x20files\x20written'),0x1;}for(const _0x2c77b3 of _0x4ac206[_0x5c05dd(0xb1)]){if(_0x2c77b3[_0x5c05dd(0x9d)]||_0x2c77b3[_0x5c05dd(0x87)]){const _0x5b63d1=a39_0x2440ef[_0x5c05dd(0x95)](_0x2c77b3[_0x5c05dd(0x9e)]);!existsSync(_0x5b63d1)&&mkdirSync(_0x5b63d1,{'recursive':!![]}),writeFileSync(_0x2c77b3[_0x5c05dd(0x9e)],_0x2c77b3[_0x5c05dd(0xa6)],_0x5c05dd(0x6a));}}return console[_0x5c05dd(0x7c)](a39_0x364acc[_0x5c05dd(0xb3)](_0x5c05dd(0x6c)+(_0x54c771['length']+_0x2abb5b[_0x5c05dd(0x88)])+_0x5c05dd(0x7e)+_0x4ac206[_0x5c05dd(0xa0)])),saveSessionContext({'parent_segment':_0x4ac206[_0x5c05dd(0x7d)]},_0x245017[_0x5c05dd(0x6d)]),console[_0x5c05dd(0x7c)](a39_0x364acc[_0x5c05dd(0xb3)](_0x5c05dd(0x68)+a39_0x364acc['dim'](_0x5c05dd(0x80))+_0x5c05dd(0xb5)+a39_0x364acc[_0x5c05dd(0x9f)](_0x4ac206[_0x5c05dd(0x7d)]))),0x0;}}
@@ -1 +1 @@
1
- function a40_0x5003(){const _0x207d37=['\x20updated','blue','\x20folders\x20to\x20create','type','\x20created','segment\x20or\x20journey','journeyId','set','segmentFolderId','21384jicUBd','.yaml','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','updatedAt','paused','βœ”\x20All\x20journeys\x20are\x20up\x20to\x20date','existingJourney','new','unchanged','/app/ps/','\x20\x20\x20\x20','green','journeys','/sb/da/esr','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','yellow','activations','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','user','\x20changes?','\x20\x20Segments:\x20','journeysOnly','2802118eNkAzY','delete','resolveParentId','toDelete','targetDir','\x20\x20Activations:','repeat','segment','all','endsWith','state','journey','createdSegmentIds','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','listJourneysWithDetailsFromParentSegment','diff','Delete\x20journey:','/e/','versionNumber','\x20unchanged','message','parentFolder','\x20deleted','dim','listFolders','Resolving\x20parent\x20segment\x20\x27','/j/da/je','isNew','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','Preparing\x20journeys...','folderPath','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','helpText','description','\x20\x20πŸ—ΊοΈ\x20\x20Journeys:','Error:\x20','toUpdate','108TLzKpT','Aborted.','Changes\x20to:','site','get','connection','scopedFolderPath','data','243730SzSwtM','folderId','yes','New\x20segment:','nameToId','.yml','580820vlKRPB','created','πŸ“\x20','parentSegment','\x20to\x20delete','yamlConfig','\x20YAML\x20files\x20found','getParent','Parent\x20segment:\x20','\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20','164732UNSAog','idToName','name','then','\x0aError:','nameToType','\x20new','\x20\x20Activations:\x20','1IlrFbf','Error\x20parsing\x20YAML:\x20','Scoped\x20to\x20folder:\x20','listSegments','map','red','cyan','updated','verbose','audienceId','Source\x20directory:\x20','buildUserMaps','toString','\x20\x20Journeys:\x20','12LxXjLa','file','toCreate','attributes','\x27...','New\x20journey:','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','12824kArBxz','\x20to\x20create','existingSegment','Delete\x20segment:','parentName','\x0aValidation\x20failed:','βœ”\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','Error:\x20Directory\x20not\x20found:\x20','4eWcLTR','getJourney','Changes\x20to\x20journey:','\x20activations]','Site:\x20','Push\x20','689759GjVaPR','length','\x20changed','results','segments','\x20to\x20update','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','journeyBundleName','listActivations','push','dryRun','join','error','errorCode','deleted','setPhase','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)','isScoped'];a40_0x5003=function(){return _0x207d37;};return a40_0x5003();}const a40_0x584493=a40_0x29c6;(function(_0x29047e,_0x26c9d1){const _0x4b598d=a40_0x29c6,_0x40d8e9=_0x29047e();while(!![]){try{const _0x2d1d8c=-parseInt(_0x4b598d(0x206))/0x1*(-parseInt(_0x4b598d(0x1fe))/0x2)+-parseInt(_0x4b598d(0x1aa))/0x3+-parseInt(_0x4b598d(0x223))/0x4*(-parseInt(_0x4b598d(0x1ee))/0x5)+-parseInt(_0x4b598d(0x214))/0x6*(-parseInt(_0x4b598d(0x229))/0x7)+parseInt(_0x4b598d(0x21b))/0x8*(-parseInt(_0x4b598d(0x1e6))/0x9)+parseInt(_0x4b598d(0x1f4))/0xa+-parseInt(_0x4b598d(0x1c1))/0xb;if(_0x2d1d8c===_0x26c9d1)break;else _0x40d8e9['push'](_0x40d8e9['shift']());}catch(_0x46bb25){_0x40d8e9['push'](_0x40d8e9['shift']());}}}(a40_0x5003,0x19ace));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 a40_0x35f3da 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';function a40_0x29c6(_0x249990,_0x98097b){_0x249990=_0x249990-0x19d;const _0x500324=a40_0x5003();let _0x29c631=_0x500324[_0x249990];return _0x29c631;}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{[a40_0x584493(0x200)]='segment:push';[a40_0x584493(0x1e2)]=a40_0x584493(0x1dd);async['execute'](_0x31f7a2){const _0x493c18=a40_0x584493,{options:_0x1b9c71,args:_0x4d5109,tdx:_0x21c6ec}=_0x31f7a2,_0x5d658f=_0x1b9c71,_0xbc4628=await resolveTarget({'arg':_0x4d5109[0x0],'contextParent':_0x1b9c71[_0x493c18(0x1f7)],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0xbc4628))return _0xbc4628[_0x493c18(0x236)]==='no_parent'?(console[_0x493c18(0x235)](a40_0x35f3da[_0x493c18(0x1b9)](_0x493c18(0x1bb))),console[_0x493c18(0x235)](_0x493c18(0x19f)),console[_0x493c18(0x235)](_0x493c18(0x1ac)),console[_0x493c18(0x235)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file')):(console['error'](a40_0x35f3da['red'](_0x493c18(0x1e4)+_0xbc4628[_0x493c18(0x1d5)]+'\x0a')),_0xbc4628['helpText']&&console[_0x493c18(0x235)](a40_0x35f3da[_0x493c18(0x20c)](_0xbc4628[_0x493c18(0x1e1)]))),0x1;if(_0xbc4628[_0x493c18(0x1a4)]==='parent_name')return console[_0x493c18(0x235)](a40_0x35f3da[_0x493c18(0x20b)]('Error:\x20Directory\x20not\x20found:\x20'+_0xbc4628[_0x493c18(0x1c5)]+'\x0a')),console[_0x493c18(0x235)](a40_0x35f3da[_0x493c18(0x20c)](_0x493c18(0x1e0))),0x1;const _0x1a5201=_0xbc4628[_0x493c18(0x21f)],_0x4fd76c=_0xbc4628[_0x493c18(0x1c5)],_0x3d88a0=_0xbc4628['type']===_0x493c18(0x215)?_0xbc4628['filePath']:undefined,_0x196ff1=getScopedDetails(_0xbc4628),_0x4973b8=_0x196ff1?.[_0x493c18(0x1a0)]??![],_0x1e9e4c=_0x196ff1?.[_0x493c18(0x1ec)]??'';if(!existsSync(_0x4fd76c))return console[_0x493c18(0x235)](a40_0x35f3da[_0x493c18(0x20b)](_0x493c18(0x222)+_0x4fd76c+'\x0a')),console[_0x493c18(0x235)](a40_0x35f3da[_0x493c18(0x20c)]('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;_0x5d658f[_0x493c18(0x20e)]&&(console[_0x493c18(0x235)](_0x493c18(0x227)+_0x5d658f[_0x493c18(0x1e9)]),console[_0x493c18(0x235)](_0x493c18(0x1fc)+_0x1a5201),console[_0x493c18(0x235)](_0x493c18(0x210)+_0x4fd76c),_0x4973b8&&console[_0x493c18(0x235)](_0x493c18(0x208)+_0x1e9e4c));const _0x4af65d=await withSpinner(_0x493c18(0x1da)+_0x1a5201+_0x493c18(0x218),()=>_0x21c6ec[_0x493c18(0x1c8)][_0x493c18(0x1c3)](_0x1a5201),{'verbose':_0x5d658f[_0x493c18(0x20e)]}),_0x271701=_0x4af65d[_0x493c18(0x1ed)],{parentSegmentResult:_0x58089d,segmentsResult:_0x36928b,foldersResult:_0x248701,journeysWithDetailsResult:_0x5875f2,userMaps:_0x57b384}=await withSpinner('Fetching\x20existing\x20data...',async()=>{const _0x343bef=_0x493c18,[_0xeb8260,_0x24bf03,_0x494290,_0x56cf02,_0x45e4f4]=await Promise[_0x343bef(0x1c9)]([_0x21c6ec[_0x343bef(0x1c8)][_0x343bef(0x1fb)](_0x271701),_0x21c6ec[_0x343bef(0x1c8)][_0x343bef(0x209)](_0x271701),_0x21c6ec[_0x343bef(0x1c8)][_0x343bef(0x1d9)](_0x271701),_0x21c6ec['journey'][_0x343bef(0x1cf)](_0x271701,{'includeAllVersions':!![]}),_0x21c6ec[_0x343bef(0x1bd)][_0x343bef(0x211)]()]);return{'parentSegmentResult':_0xeb8260,'segmentsResult':_0x24bf03,'foldersResult':_0x494290,'journeysWithDetailsResult':_0x56cf02,'userMaps':_0x45e4f4};},{'verbose':_0x5d658f[_0x493c18(0x20e)]})['then'](_0x8ccb46=>_0x8ccb46[_0x493c18(0x1ed)]),_0x3dc29a=_0x58089d,_0x5df4b3=extractRootFolderId(_0x3dc29a),_0x1808fd=_0x36928b,_0x379b95=_0x248701,{journeys:_0x550bea,activationStepsById:_0x59f918}=_0x5875f2,_0x5f5779=new Map(_0x550bea[_0x493c18(0x20a)](_0x3d9983=>[_0x3d9983['id'],_0x3d9983])),_0x5110bb=_0x550bea['map'](_0x4d0633=>({'id':_0x4d0633['id'],'name':_0x4d0633['attributes']['name'],'journeyBundleName':_0x4d0633[_0x493c18(0x217)][_0x493c18(0x230)]||'','journeyBundleId':_0x4d0633['attributes']['journeyBundleId']||'','versionNumber':_0x4d0633[_0x493c18(0x217)][_0x493c18(0x1d3)],'description':_0x4d0633[_0x493c18(0x217)][_0x493c18(0x1e2)],'state':_0x4d0633['attributes'][_0x493c18(0x1cb)],'paused':_0x4d0633['attributes'][_0x493c18(0x1ae)],'audienceId':_0x4d0633[_0x493c18(0x217)][_0x493c18(0x20f)],'folderId':_0x4d0633['relationships']?.[_0x493c18(0x1d6)]?.[_0x493c18(0x1ed)]?.['id'],'createdAt':_0x4d0633[_0x493c18(0x217)]['createdAt'],'updatedAt':_0x4d0633[_0x493c18(0x217)][_0x493c18(0x1ad)]})),{emailToId:_0x57dd1c,idToEmail:_0x37c8ee}=_0x57b384,_0x540dca=await withSpinner('Fetching\x20connections\x20for\x20name\x20resolution...',async()=>{const _0x118d57=_0x493c18,_0x9efec6=await _0x21c6ec[_0x118d57(0x1eb)]['list']();return buildConnectionMaps(_0x9efec6);},{'verbose':_0x5d658f['verbose']})['then'](_0x1861b4=>_0x1861b4['data']),_0x3f773f=_0x540dca[_0x493c18(0x1f2)],_0x56c0a6=_0x540dca[_0x493c18(0x1ff)],_0x4137b4=_0x540dca[_0x493c18(0x203)],_0x3f5e02={'emailToIdMap':_0x57dd1c,'connectionNameToIdMap':_0x3f773f,'connectionNameToTypeMap':_0x4137b4,'getSchema':_0x42acba=>_0x21c6ec['connection']['getOutputSchemaWithCache'](_0x42acba)};let {pathToId:_0x5db452,idToPath:_0x28f245}=buildFolderMaps(_0x379b95);const _0x189514=buildSegmentLookupMap(_0x1808fd,_0x28f245),_0x4f5a2d=buildSegmentNameToIdMap(_0x1808fd),_0x12e004=buildJourneyBundleLookupMap(_0x5110bb,_0x28f245);let _0x2a27da;if(_0x3d88a0){if(!_0x3d88a0['endsWith'](_0x493c18(0x1f3))&&!_0x3d88a0[_0x493c18(0x1ca)](_0x493c18(0x1ab)))return console['error'](a40_0x35f3da[_0x493c18(0x20b)](_0x493c18(0x21a)+_0x3d88a0+'\x0a')),0x1;_0x2a27da=[_0x3d88a0];}else _0x2a27da=findYamlFiles(_0x4fd76c);if(_0x2a27da['length']===0x0)return console[_0x493c18(0x235)](a40_0x35f3da[_0x493c18(0x20b)]('Error:\x20No\x20YAML\x20files\x20found\x20in\x20'+_0x4fd76c+'\x0a')),console[_0x493c18(0x235)](a40_0x35f3da[_0x493c18(0x20c)]('Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files')),0x1;let _0x1f21bc,_0x8d366b;try{const _0x49efd2=parseAndClassifyYamlFiles(_0x2a27da,_0x4fd76c,{'skipSegments':_0x5d658f[_0x493c18(0x1c0)]});_0x1f21bc=_0x49efd2['segments'],_0x8d366b=_0x49efd2['journeys'];const _0x1d37d4=validateParsedFiles(_0x49efd2,_0x4fd76c);if(_0x1d37d4[_0x493c18(0x22a)]>0x0)return console[_0x493c18(0x235)](a40_0x35f3da[_0x493c18(0x20b)](_0x493c18(0x220))),console['error'](formatValidationErrors(_0x1d37d4)),console[_0x493c18(0x235)](a40_0x35f3da[_0x493c18(0x1b9)](_0x493c18(0x22f))),0x1;}catch(_0x2ef5b7){return console[_0x493c18(0x235)](a40_0x35f3da[_0x493c18(0x20b)](_0x493c18(0x207)+(_0x2ef5b7 instanceof Error?_0x2ef5b7[_0x493c18(0x1d5)]:_0x2ef5b7))),0x1;}if(_0x1f21bc[_0x493c18(0x22a)]===0x0&&_0x8d366b[_0x493c18(0x22a)]===0x0){const _0x4a81de=_0x5d658f[_0x493c18(0x1c0)]?_0x493c18(0x1cc):_0x493c18(0x1a6);return console[_0x493c18(0x235)](a40_0x35f3da[_0x493c18(0x1b9)]('No\x20'+_0x4a81de+_0x493c18(0x1fa))),0x0;}const _0x38e45a=new Map();_0x1808fd[_0x493c18(0x22a)]>0x0&&!_0x5d658f['journeysOnly']&&await withSpinner('Fetching\x20existing\x20activations...',async()=>{await batchAsync(_0x1808fd,async _0x174103=>{const _0x7e63f1=a40_0x29c6,_0x5836b0=await _0x21c6ec['segment'][_0x7e63f1(0x231)](_0x271701,_0x174103['id']);_0x38e45a[_0x7e63f1(0x1a8)](_0x174103['id'],_0x5836b0);});},{'verbose':_0x5d658f[_0x493c18(0x20e)]});const {segmentFiles:_0x565e12,foldersToCreate:_0x17cba0}=await prepareSegmentFiles(_0x1f21bc,{'segmentByFolderAndName':_0x189514,'activationsBySegmentId':_0x38e45a,'folderPathToId':_0x5db452,'idToEmailMap':_0x37c8ee,'connectionIdToNameMap':_0x56c0a6},_0x3f5e02,_0x4973b8,_0x1e9e4c),_0x2bc97a=_0x3d88a0?[]:findSegmentsToDelete(_0x1808fd,_0x1f21bc[_0x493c18(0x20a)](({yamlConfig:_0x26a97b,folderPath:_0x3d74fe})=>({'yamlConfig':_0x26a97b,'folderPath':resolveTDFolderPath(_0x3d74fe,_0x4973b8,_0x1e9e4c)})),_0x28f245,_0x1e9e4c,_0x4973b8),{journeyFiles:_0xfc6539,foldersToCreate:_0x40f38f}=await withProgressSpinner(_0x493c18(0x1de),async _0x280814=>prepareJourneyFiles(_0x8d366b,{'fetchJourney':async _0x20d286=>_0x21c6ec[_0x493c18(0x1cc)][_0x493c18(0x224)](_0x20d286[_0x493c18(0x1a7)]),'journeyBundlesByFolderAndName':_0x12e004,'folderPathToId':_0x5db452,'idToEmailMap':_0x37c8ee,'connectionIdToNameMap':_0x56c0a6,'existingSegments':_0x1808fd,'parentId':_0x271701,'deps':_0x21c6ec,'progress':{'update':_0x2b45bd=>{const _0x3b38ce=_0x493c18;_0x280814[_0x3b38ce(0x19e)](_0x2b45bd),_0x5d658f[_0x3b38ce(0x20e)]&&console['error']('\x20\x20'+_0x2b45bd);}},'journeyById':_0x5f5779,'activationStepsById':_0x59f918},_0x4973b8,_0x1e9e4c),{'verbose':_0x5d658f[_0x493c18(0x20e)]})[_0x493c18(0x201)](_0x5d6882=>_0x5d6882[_0x493c18(0x1ed)]);for(const _0x2f0c34 of _0x40f38f){_0x17cba0['add'](_0x2f0c34);}const _0x48d809=_0x3d88a0?[]:findJourneysToDelete(_0x5110bb,_0x8d366b[_0x493c18(0x20a)](({yamlConfig:_0x202857,folderPath:_0x9f709d})=>({'yamlConfig':_0x202857,'folderPath':resolveTDFolderPath(_0x9f709d,_0x4973b8,_0x1e9e4c)})),_0x28f245,_0x1e9e4c,_0x4973b8),_0x4e3b23=calculatePushStats(_0x565e12,_0xfc6539,_0x17cba0,_0x2bc97a,_0x48d809,!!_0x5d658f['delete'],!!_0x5d658f[_0x493c18(0x1c0)]),_0x39d9ad=_0x4e3b23[_0x493c18(0x22d)][_0x493c18(0x1b1)],_0x1b01c7=_0x4e3b23[_0x493c18(0x22d)]['changed'],_0x16a54c=_0x4e3b23[_0x493c18(0x22d)]['unchanged'],_0x5e41cd=_0x4e3b23['segments']['toDelete'],_0x345c27=_0x4e3b23['folders'][_0x493c18(0x216)],_0x4c0e9f=_0x4e3b23[_0x493c18(0x1b6)][_0x493c18(0x1b1)],_0x481d31=_0x4e3b23[_0x493c18(0x1b6)]['changed'],_0x51b121=_0x4e3b23[_0x493c18(0x1b6)][_0x493c18(0x1b2)],_0x3a348b=_0x4e3b23['journeys']['toDelete'],_0x42b088=_0x4e3b23[_0x493c18(0x1ba)][_0x493c18(0x1c9)],_0x110ea3=_0x4e3b23[_0x493c18(0x1ba)][_0x493c18(0x216)],_0x2313a7=_0x4e3b23['activations'][_0x493c18(0x1e5)],_0x20b593=_0x4e3b23[_0x493c18(0x1ba)][_0x493c18(0x1c4)];console[_0x493c18(0x235)]('\x0aPush\x20summary\x20for\x20\x27'+_0x1a5201+'\x27:');_0x345c27[_0x493c18(0x22a)]>0x0&&console[_0x493c18(0x235)]('\x20\x20'+a40_0x35f3da[_0x493c18(0x1a2)](_0x493c18(0x1f6)+_0x345c27[_0x493c18(0x22a)]+_0x493c18(0x1a3)));if(!_0x5d658f[_0x493c18(0x1c0)]){console['error']('\x20\x20πŸ“Š\x20Segments:'),console['error'](_0x493c18(0x1b4)+a40_0x35f3da[_0x493c18(0x1b5)]('+\x20'+_0x39d9ad[_0x493c18(0x22a)]+_0x493c18(0x204))),console['error'](_0x493c18(0x1b4)+a40_0x35f3da[_0x493c18(0x1b9)]('~\x20'+_0x1b01c7['length']+_0x493c18(0x22b)));if(_0x5e41cd[_0x493c18(0x22a)]>0x0)console['error'](_0x493c18(0x1b4)+a40_0x35f3da['red']('-\x20'+_0x5e41cd['length']+_0x493c18(0x1f8)));else _0x2bc97a['length']>0x0&&!_0x5d658f[_0x493c18(0x1c2)]&&console['error'](_0x493c18(0x1b4)+a40_0x35f3da['dim'](_0x2bc97a[_0x493c18(0x22a)]+_0x493c18(0x1bc)));console[_0x493c18(0x235)](_0x493c18(0x1b4)+a40_0x35f3da['dim']('=\x20'+_0x16a54c['length']+'\x20unchanged'));}if(_0xfc6539['length']>0x0||_0x48d809[_0x493c18(0x22a)]>0x0){console['error'](_0x493c18(0x1e3)),console[_0x493c18(0x235)]('\x20\x20\x20\x20'+a40_0x35f3da[_0x493c18(0x1b5)]('+\x20'+_0x4c0e9f[_0x493c18(0x22a)]+_0x493c18(0x204))),console['error'](_0x493c18(0x1b4)+a40_0x35f3da[_0x493c18(0x1b9)]('~\x20'+_0x481d31[_0x493c18(0x22a)]+_0x493c18(0x22b)));if(_0x3a348b['length']>0x0)console[_0x493c18(0x235)]('\x20\x20\x20\x20'+a40_0x35f3da[_0x493c18(0x20b)]('-\x20'+_0x3a348b['length']+_0x493c18(0x1f8)));else _0x48d809[_0x493c18(0x22a)]>0x0&&!_0x5d658f['delete']&&console[_0x493c18(0x235)](_0x493c18(0x1b4)+a40_0x35f3da[_0x493c18(0x1d8)](_0x48d809['length']+'\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)'));console['error']('\x20\x20\x20\x20'+a40_0x35f3da[_0x493c18(0x1d8)]('=\x20'+_0x51b121[_0x493c18(0x22a)]+_0x493c18(0x1d4)));}_0x42b088[_0x493c18(0x22a)]>0x0&&!_0x5d658f['journeysOnly']&&(console[_0x493c18(0x235)](''),console['error'](_0x493c18(0x1c6)),_0x110ea3['length']>0x0&&console[_0x493c18(0x235)]('\x20\x20\x20\x20'+a40_0x35f3da[_0x493c18(0x1b5)]('+\x20'+_0x110ea3[_0x493c18(0x22a)]+_0x493c18(0x21c))),_0x2313a7[_0x493c18(0x22a)]>0x0&&console[_0x493c18(0x235)]('\x20\x20\x20\x20'+a40_0x35f3da[_0x493c18(0x1b9)]('~\x20'+_0x2313a7[_0x493c18(0x22a)]+_0x493c18(0x22e))),_0x20b593[_0x493c18(0x22a)]>0x0&&console[_0x493c18(0x235)](_0x493c18(0x1b4)+a40_0x35f3da[_0x493c18(0x20b)]('-\x20'+_0x20b593['length']+'\x20to\x20delete')));console[_0x493c18(0x235)]('\x20\x20Source:\x20'+a40_0x35f3da['cyan'](_0x4fd76c)+'\x0a');if(_0x345c27[_0x493c18(0x22a)]>0x0){console['error']('Folders\x20to\x20create:');for(const _0x15ef79 of _0x345c27){console['error']('\x20\x20'+a40_0x35f3da[_0x493c18(0x1a2)]('+')+'\x20'+_0x15ef79);}console[_0x493c18(0x235)]('');}if(_0x39d9ad[_0x493c18(0x22a)]>0x0&&!_0x5d658f['journeysOnly'])for(const _0x3a5255 of _0x39d9ad){const _0x154e82=_0x3a5255[_0x493c18(0x1df)]?_0x3a5255['folderPath']+'/'+_0x3a5255['yamlConfig'][_0x493c18(0x200)]:_0x3a5255[_0x493c18(0x1f9)][_0x493c18(0x200)],_0x23c3cf=_0x3a5255[_0x493c18(0x1f9)][_0x493c18(0x1ba)]?.[_0x493c18(0x22a)]||0x0,_0x4a25f5=_0x23c3cf>0x0?a40_0x35f3da[_0x493c18(0x1d8)]('\x20['+_0x23c3cf+_0x493c18(0x226)):'';console[_0x493c18(0x235)]('\x0a'+a40_0x35f3da[_0x493c18(0x1b5)](_0x493c18(0x1f1))+'\x20'+_0x154e82+_0x4a25f5),console[_0x493c18(0x235)]('─'[_0x493c18(0x1c7)](0x3c)),_0x3a5255[_0x493c18(0x1d0)]&&console[_0x493c18(0x235)](_0x3a5255[_0x493c18(0x1d0)]),console[_0x493c18(0x235)]('─'['repeat'](0x3c));}if(_0x5e41cd['length']>0x0&&!_0x5d658f[_0x493c18(0x1c0)])for(const _0x30734a of _0x5e41cd){const _0x3f6156=_0x30734a[_0x493c18(0x1a9)]?_0x28f245[_0x493c18(0x1ea)](_0x30734a[_0x493c18(0x1a9)][_0x493c18(0x212)]())||'':'',_0x567f40=_0x3f6156?_0x3f6156+'/'+_0x30734a[_0x493c18(0x200)]:_0x30734a['name'],_0x4ea76c=_0x38e45a[_0x493c18(0x1ea)](_0x30734a['id'])||[],_0x1a45e0=_0x4ea76c[_0x493c18(0x22a)]>0x0?a40_0x35f3da[_0x493c18(0x1d8)]('\x20['+_0x4ea76c[_0x493c18(0x22a)]+'\x20activations]'):'';console[_0x493c18(0x235)]('\x0a'+a40_0x35f3da[_0x493c18(0x20b)](_0x493c18(0x21e))+'\x20'+_0x567f40+_0x1a45e0),console[_0x493c18(0x235)]('─'[_0x493c18(0x1c7)](0x3c));const _0x3463bb=segmentWithActivationsToYaml(_0x30734a,_0x4ea76c,undefined,_0x37c8ee,_0x56c0a6),_0x52c99b=segmentToYamlString(_0x3463bb),_0xd1ad58=generateDiff(_0x52c99b,'');console['error'](formatDiffWithColors(_0xd1ad58)),console[_0x493c18(0x235)]('─'[_0x493c18(0x1c7)](0x3c));}const _0x5a46aa=_0x565e12['filter'](_0x406ed2=>!_0x406ed2[_0x493c18(0x1dc)]&&_0x406ed2['diff']);if(_0x5a46aa['length']>0x0&&!_0x5d658f[_0x493c18(0x1c0)])for(const _0x1ce15d of _0x5a46aa){const _0x332b07=_0x1ce15d['folderPath']?_0x1ce15d[_0x493c18(0x1df)]+'/'+_0x1ce15d[_0x493c18(0x1f9)][_0x493c18(0x200)]:_0x1ce15d['yamlConfig'][_0x493c18(0x200)];console[_0x493c18(0x235)]('\x0a'+a40_0x35f3da[_0x493c18(0x1b9)](_0x493c18(0x1e8))+'\x20'+_0x332b07),console['error']('─'[_0x493c18(0x1c7)](0x3c)),console[_0x493c18(0x235)](_0x1ce15d[_0x493c18(0x1d0)]),console[_0x493c18(0x235)]('─'['repeat'](0x3c));}if(_0x4c0e9f[_0x493c18(0x22a)]>0x0)for(const _0x39d55d of _0x4c0e9f){const _0x16ee5e=_0x39d55d[_0x493c18(0x1df)]?_0x39d55d[_0x493c18(0x1df)]+'/'+_0x39d55d[_0x493c18(0x1f9)][_0x493c18(0x200)]:_0x39d55d['yamlConfig'][_0x493c18(0x200)];console['error']('\x0a'+a40_0x35f3da['green'](_0x493c18(0x219))+'\x20'+_0x16ee5e),console[_0x493c18(0x235)]('─'['repeat'](0x3c)),_0x39d55d[_0x493c18(0x1d0)]&&console[_0x493c18(0x235)](_0x39d55d['diff']),console[_0x493c18(0x235)]('─'[_0x493c18(0x1c7)](0x3c));}const _0x27446d=_0xfc6539['filter'](_0x137b58=>!_0x137b58[_0x493c18(0x1dc)]&&_0x137b58['diff']);if(_0x27446d[_0x493c18(0x22a)]>0x0)for(const _0x42ff73 of _0x27446d){const _0x769384=_0x42ff73[_0x493c18(0x1df)]?_0x42ff73[_0x493c18(0x1df)]+'/'+_0x42ff73[_0x493c18(0x1f9)][_0x493c18(0x200)]:_0x42ff73[_0x493c18(0x1f9)]['name'];console[_0x493c18(0x235)]('\x0a'+a40_0x35f3da[_0x493c18(0x1b9)](_0x493c18(0x225))+'\x20'+_0x769384),console[_0x493c18(0x235)]('─'[_0x493c18(0x1c7)](0x3c)),console[_0x493c18(0x235)](_0x42ff73[_0x493c18(0x1d0)]),console[_0x493c18(0x235)]('─'[_0x493c18(0x1c7)](0x3c));}if(_0x3a348b[_0x493c18(0x22a)]>0x0)for(const _0x46205c of _0x3a348b){const _0x41fff9=_0x46205c[_0x493c18(0x1ef)]?_0x28f245[_0x493c18(0x1ea)](_0x46205c[_0x493c18(0x1ef)])||'':'',_0x397f5b=_0x41fff9?_0x41fff9+'/'+_0x46205c['journeyBundleName']:_0x46205c[_0x493c18(0x230)];console[_0x493c18(0x235)]('\x0a'+a40_0x35f3da[_0x493c18(0x20b)](_0x493c18(0x1d1))+'\x20'+_0x397f5b),console[_0x493c18(0x235)]('─'[_0x493c18(0x1c7)](0x3c)),console[_0x493c18(0x235)](a40_0x35f3da[_0x493c18(0x20b)]('(Journey\x20will\x20be\x20deleted)')),console['error']('─'[_0x493c18(0x1c7)](0x3c));}if(_0x5d658f[_0x493c18(0x233)])return console['error'](a40_0x35f3da[_0x493c18(0x1b9)]('\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made')),0x0;const _0x25d605=_0x5d658f[_0x493c18(0x1c0)]?![]:_0x39d9ad['length']>0x0||_0x1b01c7[_0x493c18(0x22a)]>0x0||_0x5e41cd['length']>0x0,_0x17008f=_0x4c0e9f[_0x493c18(0x22a)]>0x0||_0x481d31[_0x493c18(0x22a)]>0x0||_0x3a348b['length']>0x0,_0x2b4a25=_0x5d658f[_0x493c18(0x1c0)]?![]:_0x42b088[_0x493c18(0x22a)]>0x0,_0xec1a3d=_0x345c27[_0x493c18(0x22a)]>0x0;if(!_0x25d605&&!_0x17008f&&!_0x2b4a25&&!_0xec1a3d){const _0xce480a=_0x5d658f[_0x493c18(0x1c0)]?_0x493c18(0x1af):_0x493c18(0x221);console[_0x493c18(0x235)](a40_0x35f3da[_0x493c18(0x1b5)](_0xce480a));if(_0x3d88a0&&_0x16a54c[_0x493c18(0x22a)]===0x1){const _0x346d81=_0x16a54c[0x0];if(_0x346d81[_0x493c18(0x21d)]?.['id']){const _0x3371ce=getConsoleNextUrl(_0x5d658f[_0x493c18(0x1e9)],_0x493c18(0x1b3)+_0x271701+_0x493c18(0x1d2)+_0x346d81['existingSegment']['id']+_0x493c18(0x1b7));console[_0x493c18(0x235)](_0x493c18(0x1fd)+a40_0x35f3da[_0x493c18(0x20c)](_0x3371ce));}}if(_0x3d88a0&&_0x51b121[_0x493c18(0x22a)]===0x1){const _0xb08500=_0x51b121[0x0];if(_0xb08500[_0x493c18(0x1b0)]?.['id']){const _0x2a4488=getConsoleNextUrl(_0x5d658f[_0x493c18(0x1e9)],_0x493c18(0x1b3)+_0x271701+_0x493c18(0x1d2)+_0xb08500[_0x493c18(0x1b0)]['id']+_0x493c18(0x1db));console['error']('\x20\x20'+a40_0x35f3da['cyan'](_0x2a4488));}}return 0x0;}const _0x247410=_0x5d658f[_0x493c18(0x1c0)]?_0x4c0e9f[_0x493c18(0x22a)]+_0x481d31['length']+_0x3a348b[_0x493c18(0x22a)]+_0x345c27[_0x493c18(0x22a)]:_0x39d9ad['length']+_0x1b01c7[_0x493c18(0x22a)]+_0x5e41cd['length']+_0x4c0e9f[_0x493c18(0x22a)]+_0x481d31[_0x493c18(0x22a)]+_0x3a348b[_0x493c18(0x22a)]+_0x345c27['length']+_0x42b088[_0x493c18(0x22a)];if(!_0x5d658f[_0x493c18(0x1f0)]&&_0x247410>0x0){if(!isInteractive())return console['error'](a40_0x35f3da[_0x493c18(0x20b)](_0x493c18(0x202)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console['error'](a40_0x35f3da[_0x493c18(0x1d8)](_0x493c18(0x1ce))),0x1;const _0x501ddd=await confirmKey(_0x493c18(0x228)+_0x247410+_0x493c18(0x1be));if(!_0x501ddd)return console[_0x493c18(0x235)](a40_0x35f3da['yellow'](_0x493c18(0x1e7))),0x1;}const _0xe1fb0b={'withProgress':async(_0x359b96,_0x1d75dd)=>{const _0x55d73c=_0x493c18,_0x15235c=await withSpinner(_0x359b96,_0x1d75dd,{'verbose':_0x5d658f['verbose']});return{'data':_0x15235c[_0x55d73c(0x1ed)]};},'logInfo':_0x3f1afa=>console[_0x493c18(0x235)](a40_0x35f3da[_0x493c18(0x1a2)]('βœ”\x20'+_0x3f1afa)),'logSuccess':_0x158cdb=>console['error'](a40_0x35f3da[_0x493c18(0x1b5)]('βœ”\x20'+_0x158cdb)),'logWarning':_0x49cf48=>console[_0x493c18(0x235)](a40_0x35f3da['yellow']('⚠\x20'+_0x49cf48)),'logDeleted':_0xc9f815=>console[_0x493c18(0x235)](a40_0x35f3da['red']('βœ”\x20'+_0xc9f815))},_0x2365de={'segment':_0x21c6ec[_0x493c18(0x1c8)],'journey':_0x21c6ec[_0x493c18(0x1cc)],'user':_0x21c6ec['user'],'connection':_0x21c6ec[_0x493c18(0x1eb)]};_0x345c27['length']>0x0&&(_0x5db452=await executePushFolders(_0x2365de,_0x345c27,_0x5db452,{'parentId':_0x271701},_0xe1fb0b));const _0x4246bc={'rootFolderId':_0x5df4b3,'folderPathToId':_0x5db452,'folderIdToPath':_0x28f245,'segmentNameToId':_0x4f5a2d,'activationsBySegmentId':_0x38e45a,'emailToIdMap':_0x57dd1c,'idToEmailMap':_0x37c8ee,'connectionNameToIdMap':_0x540dca['nameToId'],'connectionIdToNameMap':_0x540dca[_0x493c18(0x1ff)],'connectionNameToTypeMap':_0x4137b4},_0x28836a=await executePushSegments(_0x2365de,_0x5d658f['journeysOnly']?[]:_0x565e12,_0x4246bc,{'parentId':_0x271701},_0xe1fb0b),_0x43fcbe=_0x28836a[_0x493c18(0x1f5)],_0x1795c5=_0x28836a[_0x493c18(0x20d)],_0x237adc=_0x28836a[_0x493c18(0x1ba)]['created'],_0x548a5c=_0x28836a[_0x493c18(0x1ba)]['updated'],_0x108a1a=_0x28836a[_0x493c18(0x1ba)][_0x493c18(0x19d)];let _0x299ba2;if(_0x3d88a0&&_0x565e12[_0x493c18(0x22a)]===0x1){const _0x47b264=_0x565e12[0x0];_0x299ba2=_0x47b264[_0x493c18(0x21d)]?.['id']??_0x28836a[_0x493c18(0x1cd)][_0x493c18(0x1ea)](_0x47b264[_0x493c18(0x1f9)]['name']);}const _0x39e2c4=await executePushSegmentDeletions(_0x2365de,_0x5d658f[_0x493c18(0x1c0)]?[]:_0x5e41cd,_0xe1fb0b);let _0x5af689=0x0,_0xcf4452=0x0,_0x4523e1=0x0;const _0x3b4954=new Map(_0x4f5a2d);for(const [_0x1b0908,_0x5f5d5a]of _0x28836a['createdSegmentIds']){_0x3b4954[_0x493c18(0x1a8)](_0x1b0908,_0x5f5d5a);}if(_0xfc6539[_0x493c18(0x22a)]>0x0){const _0x83b450={..._0x4246bc,'segmentNameToId':_0x3b4954,'existingSegments':_0x1808fd,'activationContext':_0x3f5e02},_0x17b331=await executePushJourneys(_0x2365de,_0xfc6539,_0x83b450,{'parentId':_0x271701,'rootFolderId':_0x5df4b3,'verbose':_0x5d658f[_0x493c18(0x20e)]},_0xe1fb0b);_0x5af689=_0x17b331[_0x493c18(0x1f5)],_0xcf4452=_0x17b331['updated'];if(_0x3d88a0&&_0x17b331[_0x493c18(0x22c)][_0x493c18(0x22a)]===0x1){const _0x1e1d25=_0x17b331[_0x493c18(0x22c)][0x0];if(_0x1e1d25[_0x493c18(0x1a7)]){const _0x487045=getConsoleNextUrl(_0x5d658f['site'],_0x493c18(0x1b3)+_0x271701+_0x493c18(0x1d2)+_0x1e1d25[_0x493c18(0x1a7)]+_0x493c18(0x1db));console[_0x493c18(0x235)]('\x20\x20'+a40_0x35f3da['cyan'](_0x487045));}}}for(const _0xc235f4 of _0x3a348b){console[_0x493c18(0x235)](a40_0x35f3da[_0x493c18(0x1b9)](_0x493c18(0x1b8)+_0xc235f4[_0x493c18(0x230)])),_0x4523e1++;}const _0x3b0708=[];if(_0x43fcbe>0x0)_0x3b0708[_0x493c18(0x232)](_0x43fcbe+'\x20created');if(_0x1795c5>0x0)_0x3b0708[_0x493c18(0x232)](_0x1795c5+_0x493c18(0x1a1));if(_0x39e2c4>0x0)_0x3b0708[_0x493c18(0x232)](_0x39e2c4+_0x493c18(0x1d7));const _0x49ad01=[];if(_0x5af689>0x0)_0x49ad01[_0x493c18(0x232)](_0x5af689+_0x493c18(0x1a5));if(_0xcf4452>0x0)_0x49ad01[_0x493c18(0x232)](_0xcf4452+'\x20updated');if(_0x4523e1>0x0)_0x49ad01[_0x493c18(0x232)](_0x4523e1+_0x493c18(0x1d7));const _0x3ebd19=[];if(_0x237adc>0x0)_0x3ebd19[_0x493c18(0x232)](_0x237adc+_0x493c18(0x1a5));if(_0x548a5c>0x0)_0x3ebd19['push'](_0x548a5c+'\x20updated');if(_0x108a1a>0x0)_0x3ebd19[_0x493c18(0x232)](_0x108a1a+'\x20deleted');console[_0x493c18(0x235)](a40_0x35f3da[_0x493c18(0x1b5)]('\x0aβœ”\x20Push\x20complete'));_0x3b0708[_0x493c18(0x22a)]>0x0&&!_0x5d658f[_0x493c18(0x1c0)]&&console[_0x493c18(0x235)](_0x493c18(0x1bf)+_0x3b0708[_0x493c18(0x234)](',\x20'));_0x49ad01[_0x493c18(0x22a)]>0x0&&console[_0x493c18(0x235)](_0x493c18(0x213)+_0x49ad01[_0x493c18(0x234)](',\x20'));_0x3ebd19[_0x493c18(0x22a)]>0x0&&!_0x5d658f['journeysOnly']&&console[_0x493c18(0x235)](_0x493c18(0x205)+_0x3ebd19[_0x493c18(0x234)](',\x20'));if(_0x299ba2){const _0x13d1b0=getConsoleNextUrl(_0x5d658f[_0x493c18(0x1e9)],_0x493c18(0x1b3)+_0x271701+_0x493c18(0x1d2)+_0x299ba2+_0x493c18(0x1b7));console['error'](_0x493c18(0x1fd)+a40_0x35f3da[_0x493c18(0x20c)](_0x13d1b0));}return 0x0;}}
1
+ const a40_0x39d805=a40_0x13d1;(function(_0x1e63e3,_0x59250d){const _0x33933a=a40_0x13d1,_0x218dbb=_0x1e63e3();while(!![]){try{const _0x28078a=-parseInt(_0x33933a(0x1d0))/0x1*(parseInt(_0x33933a(0x201))/0x2)+-parseInt(_0x33933a(0x1ad))/0x3*(-parseInt(_0x33933a(0x21c))/0x4)+-parseInt(_0x33933a(0x18c))/0x5+-parseInt(_0x33933a(0x213))/0x6+-parseInt(_0x33933a(0x1de))/0x7*(parseInt(_0x33933a(0x1a4))/0x8)+parseInt(_0x33933a(0x1b0))/0x9*(parseInt(_0x33933a(0x210))/0xa)+-parseInt(_0x33933a(0x1b3))/0xb*(-parseInt(_0x33933a(0x206))/0xc);if(_0x28078a===_0x59250d)break;else _0x218dbb['push'](_0x218dbb['shift']());}catch(_0x480aa6){_0x218dbb['push'](_0x218dbb['shift']());}}}(a40_0x2abd,0x65233));function a40_0x13d1(_0x4327dc,_0xae7e89){_0x4327dc=_0x4327dc-0x189;const _0x2abd7d=a40_0x2abd();let _0x13d1a1=_0x2abd7d[_0x4327dc];return _0x13d1a1;}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 a40_0x4837c3 from'chalk';import{existsSync}from'fs';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{resolveTarget,isSuccessfulResolution,getScopedDetails}from'../sdk/segment/target-resolution.js';import{buildFolderMaps}from'../sdk/segment/resolution-context.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{resolveTDFolderPath,findSegmentsToDelete,findJourneysToDelete,buildSegmentLookupMap,buildSegmentNameToIdMap,buildJourneyBundleLookupMap,parseAndClassifyYamlFiles,validateParsedFiles,formatValidationErrors,extractRootFolderId,buildConnectionMaps,calculatePushStats,prepareSegmentFiles,prepareJourneyFiles,executePushSegments,executePushFolders,executePushSegmentDeletions,executePushJourneys}from'../sdk/segment/push-workflow.js';function a40_0x2abd(){const _0x48716f=['\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','281270fUmaYd','\x0aβœ”\x20Push\x20complete','filter','176490FSmvWd','isNew','βœ”\x20All\x20journeys\x20are\x20up\x20to\x20date','\x20updated','\x0aError:','helpText','Push\x20','filePath','parentFolder','20yyLCer','listJourneysWithDetailsFromParentSegment','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','changed','created','idToName','no_parent','segments','476955FDesIy','\x20unchanged','audienceId','/sb/da/esr','createdSegmentIds','Aborted.','results','journeys','\x0aPush\x20summary\x20for\x20\x27','\x20\x20πŸ“Š\x20Segments:','journeyBundleName','\x20changed','endsWith','folderId','map','type','Delete\x20segment:','\x20new','\x20\x20Journeys:\x20','updated','verbose','Parent\x20segment:\x20','getParent','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','848vcZtvO','green','repeat','nameToId','user','data','Error\x20parsing\x20YAML:\x20','segmentFolderId','description','464451QoIVcm','resolveParentId','journeyId','45yQccsF','journeysOnly','attributes','66iBAmVD','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','length','yellow','blue','versionNumber','\x20to\x20delete','existingSegment','yamlConfig','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','Error:\x20','delete','Folders\x20to\x20create:','Source\x20directory:\x20','push','updatedAt','cyan','deleted','setPhase','/app/ps/','Resolving\x20parent\x20segment\x20\x27','message','\x20\x20\x20\x20','journey','dim','\x20activations]','site','New\x20journey:','\x20\x20πŸ—ΊοΈ\x20\x20Journeys:','1sKboOu','listSegments','parent_name','Site:\x20','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','paused','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','all','join','Scoped\x20to\x20folder:\x20','\x20deleted','folderPath','segment:push','Error:\x20Directory\x20not\x20found:\x20','20237MHICmy','existingJourney','listActivations','\x20to\x20create','/e/','Fetching\x20existing\x20data...','toDelete','toCreate','folders','\x20\x20Activations:','error','\x0aValidation\x20failed:','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','Fetching\x20connections\x20for\x20name\x20resolution...','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','buildUserMaps','segment\x20or\x20journey','new','listFolders','New\x20segment:','\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20','Changes\x20to:','\x27...','name','No\x20','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)','journeyBundleId','set','πŸ“\x20','\x20folders\x20to\x20create','red','βœ”\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','createdAt','scopedFolderPath','737434CRYGDV','execute','unchanged','\x20changes?','activations','599016TQxGfS','then','segment','nameToType','diff','\x20created','.yml','get','Preparing\x20journeys...'];a40_0x2abd=function(){return _0x48716f;};return a40_0x2abd();}export class SegmentPushCommand extends BaseCommand{[a40_0x39d805(0x1f6)]=a40_0x39d805(0x1dc);[a40_0x39d805(0x1ac)]=a40_0x39d805(0x1b4);async[a40_0x39d805(0x202)](_0x32fb42){const _0x1bcdc1=a40_0x39d805,{options:_0x30611c,args:_0x5e3b2d,tdx:_0x42cfdb}=_0x32fb42,_0x31bcea=_0x30611c,_0x52e1bb=await resolveTarget({'arg':_0x5e3b2d[0x0],'contextParent':_0x30611c['parentSegment'],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x52e1bb))return _0x52e1bb['errorCode']===_0x1bcdc1(0x18a)?(console[_0x1bcdc1(0x1e8)](a40_0x4837c3[_0x1bcdc1(0x1b6)](_0x1bcdc1(0x1d4))),console[_0x1bcdc1(0x1e8)](_0x1bcdc1(0x1f8)),console[_0x1bcdc1(0x1e8)](_0x1bcdc1(0x1ea)),console[_0x1bcdc1(0x1e8)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file')):(console['error'](a40_0x4837c3['red'](_0x1bcdc1(0x1bd)+_0x52e1bb[_0x1bcdc1(0x1c8)]+'\x0a')),_0x52e1bb[_0x1bcdc1(0x218)]&&console[_0x1bcdc1(0x1e8)](a40_0x4837c3[_0x1bcdc1(0x1c3)](_0x52e1bb[_0x1bcdc1(0x218)]))),0x1;if(_0x52e1bb[_0x1bcdc1(0x19b)]===_0x1bcdc1(0x1d2))return console[_0x1bcdc1(0x1e8)](a40_0x4837c3[_0x1bcdc1(0x1fd)](_0x1bcdc1(0x1dd)+_0x52e1bb['targetDir']+'\x0a')),console[_0x1bcdc1(0x1e8)](a40_0x4837c3[_0x1bcdc1(0x1c3)]('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;const _0xcc4312=_0x52e1bb['parentName'],_0x19284e=_0x52e1bb['targetDir'],_0x47bc84=_0x52e1bb[_0x1bcdc1(0x19b)]==='file'?_0x52e1bb[_0x1bcdc1(0x21a)]:undefined,_0x5c905b=getScopedDetails(_0x52e1bb),_0x124606=_0x5c905b?.['isScoped']??![],_0x37bd7c=_0x5c905b?.[_0x1bcdc1(0x200)]??'';if(!existsSync(_0x19284e))return console[_0x1bcdc1(0x1e8)](a40_0x4837c3[_0x1bcdc1(0x1fd)](_0x1bcdc1(0x1dd)+_0x19284e+'\x0a')),console[_0x1bcdc1(0x1e8)](a40_0x4837c3['cyan'](_0x1bcdc1(0x1a3))),0x1;_0x31bcea[_0x1bcdc1(0x1a0)]&&(console[_0x1bcdc1(0x1e8)](_0x1bcdc1(0x1d3)+_0x31bcea[_0x1bcdc1(0x1cd)]),console[_0x1bcdc1(0x1e8)](_0x1bcdc1(0x1a1)+_0xcc4312),console['error'](_0x1bcdc1(0x1c0)+_0x19284e),_0x124606&&console[_0x1bcdc1(0x1e8)](_0x1bcdc1(0x1d9)+_0x37bd7c));const _0x546640=await withSpinner(_0x1bcdc1(0x1c7)+_0xcc4312+_0x1bcdc1(0x1f5),()=>_0x42cfdb[_0x1bcdc1(0x208)][_0x1bcdc1(0x1ae)](_0xcc4312),{'verbose':_0x31bcea[_0x1bcdc1(0x1a0)]}),_0x3238ce=_0x546640[_0x1bcdc1(0x1a9)],{parentSegmentResult:_0x2c7464,segmentsResult:_0x372d83,foldersResult:_0x1917b6,journeysWithDetailsResult:_0x1f9c40,userMaps:_0x31b8ed}=await withSpinner(_0x1bcdc1(0x1e3),async()=>{const _0x22f16d=_0x1bcdc1,[_0x230827,_0x255dc3,_0x43c163,_0x46a11a,_0x49a25f]=await Promise[_0x22f16d(0x1d7)]([_0x42cfdb[_0x22f16d(0x208)][_0x22f16d(0x1a2)](_0x3238ce),_0x42cfdb[_0x22f16d(0x208)][_0x22f16d(0x1d1)](_0x3238ce),_0x42cfdb[_0x22f16d(0x208)][_0x22f16d(0x1f1)](_0x3238ce),_0x42cfdb[_0x22f16d(0x1ca)][_0x22f16d(0x21d)](_0x3238ce,{'includeAllVersions':!![]}),_0x42cfdb[_0x22f16d(0x1a8)][_0x22f16d(0x1ee)]()]);return{'parentSegmentResult':_0x230827,'segmentsResult':_0x255dc3,'foldersResult':_0x43c163,'journeysWithDetailsResult':_0x46a11a,'userMaps':_0x49a25f};},{'verbose':_0x31bcea[_0x1bcdc1(0x1a0)]})['then'](_0x4ec8aa=>_0x4ec8aa[_0x1bcdc1(0x1a9)]),_0x26fd00=_0x2c7464,_0x108e70=extractRootFolderId(_0x26fd00),_0x45ffa8=_0x372d83,_0x22b156=_0x1917b6,{journeys:_0x4d1f95,activationStepsById:_0x572606}=_0x1f9c40,_0x53e8c3=new Map(_0x4d1f95[_0x1bcdc1(0x19a)](_0x34b3e9=>[_0x34b3e9['id'],_0x34b3e9])),_0x2dc2bb=_0x4d1f95[_0x1bcdc1(0x19a)](_0x297e3b=>({'id':_0x297e3b['id'],'name':_0x297e3b['attributes'][_0x1bcdc1(0x1f6)],'journeyBundleName':_0x297e3b['attributes'][_0x1bcdc1(0x196)]||'','journeyBundleId':_0x297e3b[_0x1bcdc1(0x1b2)][_0x1bcdc1(0x1f9)]||'','versionNumber':_0x297e3b[_0x1bcdc1(0x1b2)][_0x1bcdc1(0x1b8)],'description':_0x297e3b[_0x1bcdc1(0x1b2)][_0x1bcdc1(0x1ac)],'state':_0x297e3b['attributes']['state'],'paused':_0x297e3b['attributes'][_0x1bcdc1(0x1d5)],'audienceId':_0x297e3b['attributes'][_0x1bcdc1(0x18e)],'folderId':_0x297e3b['relationships']?.[_0x1bcdc1(0x21b)]?.[_0x1bcdc1(0x1a9)]?.['id'],'createdAt':_0x297e3b[_0x1bcdc1(0x1b2)][_0x1bcdc1(0x1ff)],'updatedAt':_0x297e3b['attributes'][_0x1bcdc1(0x1c2)]})),{emailToId:_0x185af7,idToEmail:_0x206cde}=_0x31b8ed,_0x1e11c3=await withSpinner(_0x1bcdc1(0x1ec),async()=>{const _0x3e3ba2=await _0x42cfdb['connection']['list']();return buildConnectionMaps(_0x3e3ba2);},{'verbose':_0x31bcea['verbose']})[_0x1bcdc1(0x207)](_0x4121fa=>_0x4121fa['data']),_0x2f9d3f=_0x1e11c3[_0x1bcdc1(0x1a7)],_0x51d8ce=_0x1e11c3[_0x1bcdc1(0x189)],_0x1e02e8=_0x1e11c3[_0x1bcdc1(0x209)],_0x4b6f2b={'emailToIdMap':_0x185af7,'connectionNameToIdMap':_0x2f9d3f,'connectionNameToTypeMap':_0x1e02e8,'getSchema':_0x3aefad=>_0x42cfdb['connection']['getOutputSchemaWithCache'](_0x3aefad)};let {pathToId:_0xf45865,idToPath:_0x4a8924}=buildFolderMaps(_0x22b156);const _0x174575=buildSegmentLookupMap(_0x45ffa8,_0x4a8924),_0x12a00b=buildSegmentNameToIdMap(_0x45ffa8),_0x23cb83=buildJourneyBundleLookupMap(_0x2dc2bb,_0x4a8924);let _0x3a58d4;if(_0x47bc84){if(!_0x47bc84[_0x1bcdc1(0x198)](_0x1bcdc1(0x20c))&&!_0x47bc84[_0x1bcdc1(0x198)]('.yaml'))return console[_0x1bcdc1(0x1e8)](a40_0x4837c3[_0x1bcdc1(0x1fd)](_0x1bcdc1(0x21e)+_0x47bc84+'\x0a')),0x1;_0x3a58d4=[_0x47bc84];}else _0x3a58d4=findYamlFiles(_0x19284e);if(_0x3a58d4[_0x1bcdc1(0x1b5)]===0x0)return console[_0x1bcdc1(0x1e8)](a40_0x4837c3[_0x1bcdc1(0x1fd)](_0x1bcdc1(0x1eb)+_0x19284e+'\x0a')),console['error'](a40_0x4837c3[_0x1bcdc1(0x1c3)](_0x1bcdc1(0x1ed))),0x1;let _0x32fdda,_0x1406b9;try{const _0x30e730=parseAndClassifyYamlFiles(_0x3a58d4,_0x19284e,{'skipSegments':_0x31bcea['journeysOnly']});_0x32fdda=_0x30e730[_0x1bcdc1(0x18b)],_0x1406b9=_0x30e730[_0x1bcdc1(0x193)];const _0x527a03=validateParsedFiles(_0x30e730,_0x19284e);if(_0x527a03[_0x1bcdc1(0x1b5)]>0x0)return console['error'](a40_0x4837c3[_0x1bcdc1(0x1fd)](_0x1bcdc1(0x1e9))),console['error'](formatValidationErrors(_0x527a03)),console[_0x1bcdc1(0x1e8)](a40_0x4837c3[_0x1bcdc1(0x1b6)]('\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.')),0x1;}catch(_0x123f56){return console[_0x1bcdc1(0x1e8)](a40_0x4837c3[_0x1bcdc1(0x1fd)](_0x1bcdc1(0x1aa)+(_0x123f56 instanceof Error?_0x123f56['message']:_0x123f56))),0x1;}if(_0x32fdda['length']===0x0&&_0x1406b9[_0x1bcdc1(0x1b5)]===0x0){const _0x1322c5=_0x31bcea['journeysOnly']?_0x1bcdc1(0x1ca):_0x1bcdc1(0x1ef);return console[_0x1bcdc1(0x1e8)](a40_0x4837c3[_0x1bcdc1(0x1b6)](_0x1bcdc1(0x1f7)+_0x1322c5+'\x20YAML\x20files\x20found')),0x0;}const _0x2fa760=new Map();_0x45ffa8[_0x1bcdc1(0x1b5)]>0x0&&!_0x31bcea[_0x1bcdc1(0x1b1)]&&await withSpinner('Fetching\x20existing\x20activations...',async()=>{await batchAsync(_0x45ffa8,async _0x5e1bb4=>{const _0x3c8d9d=a40_0x13d1,_0x380ca0=await _0x42cfdb[_0x3c8d9d(0x208)][_0x3c8d9d(0x1e0)](_0x3238ce,_0x5e1bb4['id']);_0x2fa760[_0x3c8d9d(0x1fa)](_0x5e1bb4['id'],_0x380ca0);});},{'verbose':_0x31bcea[_0x1bcdc1(0x1a0)]});const {segmentFiles:_0x3e2e0b,foldersToCreate:_0x4fb853}=await prepareSegmentFiles(_0x32fdda,{'segmentByFolderAndName':_0x174575,'activationsBySegmentId':_0x2fa760,'folderPathToId':_0xf45865,'idToEmailMap':_0x206cde,'connectionIdToNameMap':_0x51d8ce},_0x4b6f2b,_0x124606,_0x37bd7c),_0x5b7dba=_0x47bc84?[]:findSegmentsToDelete(_0x45ffa8,_0x32fdda['map'](({yamlConfig:_0xb99739,folderPath:_0x400005})=>({'yamlConfig':_0xb99739,'folderPath':resolveTDFolderPath(_0x400005,_0x124606,_0x37bd7c)})),_0x4a8924,_0x37bd7c,_0x124606),{journeyFiles:_0x24e58a,foldersToCreate:_0x2d024a}=await withProgressSpinner(_0x1bcdc1(0x20e),async _0x64ea93=>prepareJourneyFiles(_0x1406b9,{'fetchJourney':async _0x3cfade=>_0x42cfdb[_0x1bcdc1(0x1ca)]['getJourney'](_0x3cfade[_0x1bcdc1(0x1af)]),'journeyBundlesByFolderAndName':_0x23cb83,'folderPathToId':_0xf45865,'idToEmailMap':_0x206cde,'connectionIdToNameMap':_0x51d8ce,'existingSegments':_0x45ffa8,'parentId':_0x3238ce,'deps':_0x42cfdb,'progress':{'update':_0x2b399c=>{const _0x384b2c=_0x1bcdc1;_0x64ea93[_0x384b2c(0x1c5)](_0x2b399c),_0x31bcea[_0x384b2c(0x1a0)]&&console[_0x384b2c(0x1e8)]('\x20\x20'+_0x2b399c);}},'journeyById':_0x53e8c3,'activationStepsById':_0x572606},_0x124606,_0x37bd7c),{'verbose':_0x31bcea['verbose']})[_0x1bcdc1(0x207)](_0x4a0a91=>_0x4a0a91[_0x1bcdc1(0x1a9)]);for(const _0x37ba19 of _0x2d024a){_0x4fb853['add'](_0x37ba19);}const _0x38b090=_0x47bc84?[]:findJourneysToDelete(_0x2dc2bb,_0x1406b9[_0x1bcdc1(0x19a)](({yamlConfig:_0x3b9c24,folderPath:_0x30d8f8})=>({'yamlConfig':_0x3b9c24,'folderPath':resolveTDFolderPath(_0x30d8f8,_0x124606,_0x37bd7c)})),_0x4a8924,_0x37bd7c,_0x124606),_0x3bfc94=calculatePushStats(_0x3e2e0b,_0x24e58a,_0x4fb853,_0x5b7dba,_0x38b090,!!_0x31bcea[_0x1bcdc1(0x1be)],!!_0x31bcea[_0x1bcdc1(0x1b1)]),_0x13c798=_0x3bfc94[_0x1bcdc1(0x18b)][_0x1bcdc1(0x1f0)],_0x82e2ca=_0x3bfc94[_0x1bcdc1(0x18b)][_0x1bcdc1(0x21f)],_0x4d1006=_0x3bfc94[_0x1bcdc1(0x18b)][_0x1bcdc1(0x203)],_0xf76b87=_0x3bfc94[_0x1bcdc1(0x18b)][_0x1bcdc1(0x1e4)],_0x1490d9=_0x3bfc94[_0x1bcdc1(0x1e6)][_0x1bcdc1(0x1e5)],_0x5e97c3=_0x3bfc94[_0x1bcdc1(0x193)][_0x1bcdc1(0x1f0)],_0x264b3b=_0x3bfc94[_0x1bcdc1(0x193)]['changed'],_0x4acd5b=_0x3bfc94[_0x1bcdc1(0x193)]['unchanged'],_0x3fb1be=_0x3bfc94['journeys']['toDelete'],_0x187096=_0x3bfc94[_0x1bcdc1(0x205)][_0x1bcdc1(0x1d7)],_0x8d97ac=_0x3bfc94['activations'][_0x1bcdc1(0x1e5)],_0x3a3b99=_0x3bfc94[_0x1bcdc1(0x205)]['toUpdate'],_0x49eeeb=_0x3bfc94['activations']['toDelete'];console['error'](_0x1bcdc1(0x194)+_0xcc4312+'\x27:');_0x1490d9[_0x1bcdc1(0x1b5)]>0x0&&console[_0x1bcdc1(0x1e8)]('\x20\x20'+a40_0x4837c3[_0x1bcdc1(0x1b7)](_0x1bcdc1(0x1fb)+_0x1490d9[_0x1bcdc1(0x1b5)]+_0x1bcdc1(0x1fc)));if(!_0x31bcea[_0x1bcdc1(0x1b1)]){console[_0x1bcdc1(0x1e8)](_0x1bcdc1(0x195)),console[_0x1bcdc1(0x1e8)](_0x1bcdc1(0x1c9)+a40_0x4837c3['green']('+\x20'+_0x13c798['length']+_0x1bcdc1(0x19d))),console['error'](_0x1bcdc1(0x1c9)+a40_0x4837c3[_0x1bcdc1(0x1b6)]('~\x20'+_0x82e2ca['length']+_0x1bcdc1(0x197)));if(_0xf76b87['length']>0x0)console[_0x1bcdc1(0x1e8)](_0x1bcdc1(0x1c9)+a40_0x4837c3['red']('-\x20'+_0xf76b87[_0x1bcdc1(0x1b5)]+_0x1bcdc1(0x1b9)));else _0x5b7dba[_0x1bcdc1(0x1b5)]>0x0&&!_0x31bcea['delete']&&console[_0x1bcdc1(0x1e8)](_0x1bcdc1(0x1c9)+a40_0x4837c3[_0x1bcdc1(0x1cb)](_0x5b7dba[_0x1bcdc1(0x1b5)]+_0x1bcdc1(0x20f)));console[_0x1bcdc1(0x1e8)]('\x20\x20\x20\x20'+a40_0x4837c3[_0x1bcdc1(0x1cb)]('=\x20'+_0x4d1006[_0x1bcdc1(0x1b5)]+'\x20unchanged'));}if(_0x24e58a[_0x1bcdc1(0x1b5)]>0x0||_0x38b090[_0x1bcdc1(0x1b5)]>0x0){console[_0x1bcdc1(0x1e8)](_0x1bcdc1(0x1cf)),console['error'](_0x1bcdc1(0x1c9)+a40_0x4837c3[_0x1bcdc1(0x1a5)]('+\x20'+_0x5e97c3[_0x1bcdc1(0x1b5)]+_0x1bcdc1(0x19d))),console[_0x1bcdc1(0x1e8)](_0x1bcdc1(0x1c9)+a40_0x4837c3[_0x1bcdc1(0x1b6)]('~\x20'+_0x264b3b[_0x1bcdc1(0x1b5)]+_0x1bcdc1(0x197)));if(_0x3fb1be[_0x1bcdc1(0x1b5)]>0x0)console[_0x1bcdc1(0x1e8)](_0x1bcdc1(0x1c9)+a40_0x4837c3['red']('-\x20'+_0x3fb1be[_0x1bcdc1(0x1b5)]+_0x1bcdc1(0x1b9)));else _0x38b090[_0x1bcdc1(0x1b5)]>0x0&&!_0x31bcea[_0x1bcdc1(0x1be)]&&console[_0x1bcdc1(0x1e8)](_0x1bcdc1(0x1c9)+a40_0x4837c3[_0x1bcdc1(0x1cb)](_0x38b090[_0x1bcdc1(0x1b5)]+_0x1bcdc1(0x20f)));console['error'](_0x1bcdc1(0x1c9)+a40_0x4837c3[_0x1bcdc1(0x1cb)]('=\x20'+_0x4acd5b['length']+_0x1bcdc1(0x18d)));}_0x187096[_0x1bcdc1(0x1b5)]>0x0&&!_0x31bcea[_0x1bcdc1(0x1b1)]&&(console[_0x1bcdc1(0x1e8)](''),console[_0x1bcdc1(0x1e8)](_0x1bcdc1(0x1e7)),_0x8d97ac[_0x1bcdc1(0x1b5)]>0x0&&console['error'](_0x1bcdc1(0x1c9)+a40_0x4837c3[_0x1bcdc1(0x1a5)]('+\x20'+_0x8d97ac[_0x1bcdc1(0x1b5)]+_0x1bcdc1(0x1e1))),_0x3a3b99['length']>0x0&&console[_0x1bcdc1(0x1e8)](_0x1bcdc1(0x1c9)+a40_0x4837c3[_0x1bcdc1(0x1b6)]('~\x20'+_0x3a3b99['length']+'\x20to\x20update')),_0x49eeeb['length']>0x0&&console[_0x1bcdc1(0x1e8)](_0x1bcdc1(0x1c9)+a40_0x4837c3[_0x1bcdc1(0x1fd)]('-\x20'+_0x49eeeb[_0x1bcdc1(0x1b5)]+_0x1bcdc1(0x1b9))));console[_0x1bcdc1(0x1e8)]('\x20\x20Source:\x20'+a40_0x4837c3['cyan'](_0x19284e)+'\x0a');if(_0x1490d9[_0x1bcdc1(0x1b5)]>0x0){console[_0x1bcdc1(0x1e8)](_0x1bcdc1(0x1bf));for(const _0x31740b of _0x1490d9){console['error']('\x20\x20'+a40_0x4837c3[_0x1bcdc1(0x1b7)]('+')+'\x20'+_0x31740b);}console[_0x1bcdc1(0x1e8)]('');}if(_0x13c798['length']>0x0&&!_0x31bcea[_0x1bcdc1(0x1b1)])for(const _0x205286 of _0x13c798){const _0x389f96=_0x205286[_0x1bcdc1(0x1db)]?_0x205286['folderPath']+'/'+_0x205286[_0x1bcdc1(0x1bb)][_0x1bcdc1(0x1f6)]:_0x205286[_0x1bcdc1(0x1bb)][_0x1bcdc1(0x1f6)],_0x161b7f=_0x205286[_0x1bcdc1(0x1bb)][_0x1bcdc1(0x205)]?.['length']||0x0,_0x2c9e9d=_0x161b7f>0x0?a40_0x4837c3['dim']('\x20['+_0x161b7f+_0x1bcdc1(0x1cc)):'';console[_0x1bcdc1(0x1e8)]('\x0a'+a40_0x4837c3[_0x1bcdc1(0x1a5)](_0x1bcdc1(0x1f2))+'\x20'+_0x389f96+_0x2c9e9d),console[_0x1bcdc1(0x1e8)]('─'[_0x1bcdc1(0x1a6)](0x3c)),_0x205286[_0x1bcdc1(0x20a)]&&console[_0x1bcdc1(0x1e8)](_0x205286['diff']),console[_0x1bcdc1(0x1e8)]('─'[_0x1bcdc1(0x1a6)](0x3c));}if(_0xf76b87[_0x1bcdc1(0x1b5)]>0x0&&!_0x31bcea[_0x1bcdc1(0x1b1)])for(const _0x5570bc of _0xf76b87){const _0x4c73de=_0x5570bc['segmentFolderId']?_0x4a8924[_0x1bcdc1(0x20d)](_0x5570bc[_0x1bcdc1(0x1ab)]['toString']())||'':'',_0xfc70c8=_0x4c73de?_0x4c73de+'/'+_0x5570bc[_0x1bcdc1(0x1f6)]:_0x5570bc[_0x1bcdc1(0x1f6)],_0x4dcbdf=_0x2fa760[_0x1bcdc1(0x20d)](_0x5570bc['id'])||[],_0x43cc01=_0x4dcbdf[_0x1bcdc1(0x1b5)]>0x0?a40_0x4837c3['dim']('\x20['+_0x4dcbdf['length']+_0x1bcdc1(0x1cc)):'';console[_0x1bcdc1(0x1e8)]('\x0a'+a40_0x4837c3['red'](_0x1bcdc1(0x19c))+'\x20'+_0xfc70c8+_0x43cc01),console[_0x1bcdc1(0x1e8)]('─'['repeat'](0x3c));const _0x37e9b3=segmentWithActivationsToYaml(_0x5570bc,_0x4dcbdf,undefined,_0x206cde,_0x51d8ce),_0x473231=segmentToYamlString(_0x37e9b3),_0x1f8546=generateDiff(_0x473231,'');console[_0x1bcdc1(0x1e8)](formatDiffWithColors(_0x1f8546)),console[_0x1bcdc1(0x1e8)]('─'[_0x1bcdc1(0x1a6)](0x3c));}const _0x505e8e=_0x3e2e0b[_0x1bcdc1(0x212)](_0x1c58eb=>!_0x1c58eb['isNew']&&_0x1c58eb[_0x1bcdc1(0x20a)]);if(_0x505e8e[_0x1bcdc1(0x1b5)]>0x0&&!_0x31bcea[_0x1bcdc1(0x1b1)])for(const _0x45a68a of _0x505e8e){const _0x31985c=_0x45a68a[_0x1bcdc1(0x1db)]?_0x45a68a[_0x1bcdc1(0x1db)]+'/'+_0x45a68a['yamlConfig'][_0x1bcdc1(0x1f6)]:_0x45a68a['yamlConfig'][_0x1bcdc1(0x1f6)];console[_0x1bcdc1(0x1e8)]('\x0a'+a40_0x4837c3[_0x1bcdc1(0x1b6)](_0x1bcdc1(0x1f4))+'\x20'+_0x31985c),console[_0x1bcdc1(0x1e8)]('─'['repeat'](0x3c)),console[_0x1bcdc1(0x1e8)](_0x45a68a[_0x1bcdc1(0x20a)]),console[_0x1bcdc1(0x1e8)]('─'['repeat'](0x3c));}if(_0x5e97c3[_0x1bcdc1(0x1b5)]>0x0)for(const _0xd69c25 of _0x5e97c3){const _0x35e55a=_0xd69c25[_0x1bcdc1(0x1db)]?_0xd69c25[_0x1bcdc1(0x1db)]+'/'+_0xd69c25[_0x1bcdc1(0x1bb)]['name']:_0xd69c25[_0x1bcdc1(0x1bb)][_0x1bcdc1(0x1f6)];console[_0x1bcdc1(0x1e8)]('\x0a'+a40_0x4837c3[_0x1bcdc1(0x1a5)](_0x1bcdc1(0x1ce))+'\x20'+_0x35e55a),console[_0x1bcdc1(0x1e8)]('─'['repeat'](0x3c)),_0xd69c25[_0x1bcdc1(0x20a)]&&console['error'](_0xd69c25[_0x1bcdc1(0x20a)]),console[_0x1bcdc1(0x1e8)]('─'['repeat'](0x3c));}const _0x5b2e89=_0x24e58a[_0x1bcdc1(0x212)](_0x465074=>!_0x465074[_0x1bcdc1(0x214)]&&_0x465074[_0x1bcdc1(0x20a)]);if(_0x5b2e89[_0x1bcdc1(0x1b5)]>0x0)for(const _0x2127df of _0x5b2e89){const _0x18f78b=_0x2127df[_0x1bcdc1(0x1db)]?_0x2127df[_0x1bcdc1(0x1db)]+'/'+_0x2127df[_0x1bcdc1(0x1bb)][_0x1bcdc1(0x1f6)]:_0x2127df[_0x1bcdc1(0x1bb)][_0x1bcdc1(0x1f6)];console[_0x1bcdc1(0x1e8)]('\x0a'+a40_0x4837c3[_0x1bcdc1(0x1b6)]('Changes\x20to\x20journey:')+'\x20'+_0x18f78b),console[_0x1bcdc1(0x1e8)]('─'['repeat'](0x3c)),console[_0x1bcdc1(0x1e8)](_0x2127df[_0x1bcdc1(0x20a)]),console[_0x1bcdc1(0x1e8)]('─'[_0x1bcdc1(0x1a6)](0x3c));}if(_0x3fb1be[_0x1bcdc1(0x1b5)]>0x0)for(const _0x454b0e of _0x3fb1be){const _0x376453=_0x454b0e['folderId']?_0x4a8924[_0x1bcdc1(0x20d)](_0x454b0e[_0x1bcdc1(0x199)])||'':'',_0x246c99=_0x376453?_0x376453+'/'+_0x454b0e[_0x1bcdc1(0x196)]:_0x454b0e['journeyBundleName'];console[_0x1bcdc1(0x1e8)]('\x0a'+a40_0x4837c3[_0x1bcdc1(0x1fd)]('Delete\x20journey:')+'\x20'+_0x246c99),console[_0x1bcdc1(0x1e8)]('─'['repeat'](0x3c)),console[_0x1bcdc1(0x1e8)](a40_0x4837c3[_0x1bcdc1(0x1fd)]('(Journey\x20will\x20be\x20deleted)')),console['error']('─'[_0x1bcdc1(0x1a6)](0x3c));}if(_0x31bcea['dryRun'])return console['error'](a40_0x4837c3[_0x1bcdc1(0x1b6)]('\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made')),0x0;const _0x9ce6f4=_0x31bcea[_0x1bcdc1(0x1b1)]?![]:_0x13c798[_0x1bcdc1(0x1b5)]>0x0||_0x82e2ca[_0x1bcdc1(0x1b5)]>0x0||_0xf76b87['length']>0x0,_0xfa84e=_0x5e97c3[_0x1bcdc1(0x1b5)]>0x0||_0x264b3b[_0x1bcdc1(0x1b5)]>0x0||_0x3fb1be[_0x1bcdc1(0x1b5)]>0x0,_0x153e12=_0x31bcea[_0x1bcdc1(0x1b1)]?![]:_0x187096['length']>0x0,_0x177f5c=_0x1490d9[_0x1bcdc1(0x1b5)]>0x0;if(!_0x9ce6f4&&!_0xfa84e&&!_0x153e12&&!_0x177f5c){const _0x38f166=_0x31bcea[_0x1bcdc1(0x1b1)]?_0x1bcdc1(0x215):_0x1bcdc1(0x1fe);console[_0x1bcdc1(0x1e8)](a40_0x4837c3[_0x1bcdc1(0x1a5)](_0x38f166));if(_0x47bc84&&_0x4d1006[_0x1bcdc1(0x1b5)]===0x1){const _0x469a29=_0x4d1006[0x0];if(_0x469a29['existingSegment']?.['id']){const _0x25f2d9=getConsoleNextUrl(_0x31bcea[_0x1bcdc1(0x1cd)],_0x1bcdc1(0x1c6)+_0x3238ce+'/e/'+_0x469a29[_0x1bcdc1(0x1ba)]['id']+'/sb/da/esr');console[_0x1bcdc1(0x1e8)](_0x1bcdc1(0x1f3)+a40_0x4837c3[_0x1bcdc1(0x1c3)](_0x25f2d9));}}if(_0x47bc84&&_0x4acd5b[_0x1bcdc1(0x1b5)]===0x1){const _0x248e34=_0x4acd5b[0x0];if(_0x248e34['existingJourney']?.['id']){const _0x5c1d8c=getConsoleNextUrl(_0x31bcea['site'],_0x1bcdc1(0x1c6)+_0x3238ce+'/e/'+_0x248e34[_0x1bcdc1(0x1df)]['id']+'/j/da/je');console[_0x1bcdc1(0x1e8)]('\x20\x20'+a40_0x4837c3[_0x1bcdc1(0x1c3)](_0x5c1d8c));}}return 0x0;}const _0x5b5f0a=_0x31bcea[_0x1bcdc1(0x1b1)]?_0x5e97c3['length']+_0x264b3b[_0x1bcdc1(0x1b5)]+_0x3fb1be[_0x1bcdc1(0x1b5)]+_0x1490d9[_0x1bcdc1(0x1b5)]:_0x13c798[_0x1bcdc1(0x1b5)]+_0x82e2ca[_0x1bcdc1(0x1b5)]+_0xf76b87[_0x1bcdc1(0x1b5)]+_0x5e97c3[_0x1bcdc1(0x1b5)]+_0x264b3b['length']+_0x3fb1be[_0x1bcdc1(0x1b5)]+_0x1490d9[_0x1bcdc1(0x1b5)]+_0x187096[_0x1bcdc1(0x1b5)];if(!_0x31bcea['yes']&&_0x5b5f0a>0x0){if(!isInteractive())return console['error'](a40_0x4837c3[_0x1bcdc1(0x1fd)](_0x1bcdc1(0x217)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x1bcdc1(0x1e8)](a40_0x4837c3['dim'](_0x1bcdc1(0x1bc))),0x1;const _0x3b8d66=await confirmKey(_0x1bcdc1(0x219)+_0x5b5f0a+_0x1bcdc1(0x204));if(!_0x3b8d66)return console[_0x1bcdc1(0x1e8)](a40_0x4837c3['yellow'](_0x1bcdc1(0x191))),0x1;}const _0x22224f={'withProgress':async(_0x46a6c6,_0x4bc09b)=>{const _0x564547=_0x1bcdc1,_0x1d0d88=await withSpinner(_0x46a6c6,_0x4bc09b,{'verbose':_0x31bcea[_0x564547(0x1a0)]});return{'data':_0x1d0d88[_0x564547(0x1a9)]};},'logInfo':_0x5332c1=>console[_0x1bcdc1(0x1e8)](a40_0x4837c3['blue']('βœ”\x20'+_0x5332c1)),'logSuccess':_0x2fe6f3=>console['error'](a40_0x4837c3[_0x1bcdc1(0x1a5)]('βœ”\x20'+_0x2fe6f3)),'logWarning':_0x4fda3e=>console[_0x1bcdc1(0x1e8)](a40_0x4837c3[_0x1bcdc1(0x1b6)]('⚠\x20'+_0x4fda3e)),'logDeleted':_0x5f5cbb=>console[_0x1bcdc1(0x1e8)](a40_0x4837c3[_0x1bcdc1(0x1fd)]('βœ”\x20'+_0x5f5cbb))},_0x23a61a={'segment':_0x42cfdb[_0x1bcdc1(0x208)],'journey':_0x42cfdb[_0x1bcdc1(0x1ca)],'user':_0x42cfdb[_0x1bcdc1(0x1a8)],'connection':_0x42cfdb['connection']};_0x1490d9['length']>0x0&&(_0xf45865=await executePushFolders(_0x23a61a,_0x1490d9,_0xf45865,{'parentId':_0x3238ce},_0x22224f));const _0x321cff={'rootFolderId':_0x108e70,'folderPathToId':_0xf45865,'folderIdToPath':_0x4a8924,'segmentNameToId':_0x12a00b,'activationsBySegmentId':_0x2fa760,'emailToIdMap':_0x185af7,'idToEmailMap':_0x206cde,'connectionNameToIdMap':_0x1e11c3['nameToId'],'connectionIdToNameMap':_0x1e11c3[_0x1bcdc1(0x189)],'connectionNameToTypeMap':_0x1e02e8},_0x30aed2=await executePushSegments(_0x23a61a,_0x31bcea[_0x1bcdc1(0x1b1)]?[]:_0x3e2e0b,_0x321cff,{'parentId':_0x3238ce},_0x22224f),_0x26da45=_0x30aed2['created'],_0x23ea77=_0x30aed2[_0x1bcdc1(0x19f)],_0x870350=_0x30aed2[_0x1bcdc1(0x205)]['created'],_0x9b57cf=_0x30aed2[_0x1bcdc1(0x205)]['updated'],_0x2e1f64=_0x30aed2['activations'][_0x1bcdc1(0x1c4)];let _0x1b9846;if(_0x47bc84&&_0x3e2e0b[_0x1bcdc1(0x1b5)]===0x1){const _0x1a0b48=_0x3e2e0b[0x0];_0x1b9846=_0x1a0b48['existingSegment']?.['id']??_0x30aed2[_0x1bcdc1(0x190)][_0x1bcdc1(0x20d)](_0x1a0b48[_0x1bcdc1(0x1bb)][_0x1bcdc1(0x1f6)]);}const _0x3ae8de=await executePushSegmentDeletions(_0x23a61a,_0x31bcea['journeysOnly']?[]:_0xf76b87,_0x22224f);let _0x35e863=0x0,_0x2b18e4=0x0,_0x32c02e=0x0;const _0x33ab66=new Map(_0x12a00b);for(const [_0x7cbd83,_0x20ff54]of _0x30aed2['createdSegmentIds']){_0x33ab66[_0x1bcdc1(0x1fa)](_0x7cbd83,_0x20ff54);}if(_0x24e58a[_0x1bcdc1(0x1b5)]>0x0){const _0x180a07={..._0x321cff,'segmentNameToId':_0x33ab66,'existingSegments':_0x45ffa8,'activationContext':_0x4b6f2b},_0x38871f=await executePushJourneys(_0x23a61a,_0x24e58a,_0x180a07,{'parentId':_0x3238ce,'rootFolderId':_0x108e70,'verbose':_0x31bcea[_0x1bcdc1(0x1a0)]},_0x22224f);_0x35e863=_0x38871f[_0x1bcdc1(0x220)],_0x2b18e4=_0x38871f['updated'];if(_0x47bc84&&_0x38871f[_0x1bcdc1(0x192)][_0x1bcdc1(0x1b5)]===0x1){const _0x290c77=_0x38871f[_0x1bcdc1(0x192)][0x0];if(_0x290c77[_0x1bcdc1(0x1af)]){const _0x1ecb2e=getConsoleNextUrl(_0x31bcea[_0x1bcdc1(0x1cd)],'/app/ps/'+_0x3238ce+_0x1bcdc1(0x1e2)+_0x290c77['journeyId']+'/j/da/je');console[_0x1bcdc1(0x1e8)]('\x20\x20'+a40_0x4837c3[_0x1bcdc1(0x1c3)](_0x1ecb2e));}}}for(const _0x468889 of _0x3fb1be){console[_0x1bcdc1(0x1e8)](a40_0x4837c3[_0x1bcdc1(0x1b6)](_0x1bcdc1(0x1d6)+_0x468889[_0x1bcdc1(0x196)])),_0x32c02e++;}const _0x4ccaae=[];if(_0x26da45>0x0)_0x4ccaae[_0x1bcdc1(0x1c1)](_0x26da45+_0x1bcdc1(0x20b));if(_0x23ea77>0x0)_0x4ccaae['push'](_0x23ea77+_0x1bcdc1(0x216));if(_0x3ae8de>0x0)_0x4ccaae[_0x1bcdc1(0x1c1)](_0x3ae8de+_0x1bcdc1(0x1da));const _0x444ae0=[];if(_0x35e863>0x0)_0x444ae0[_0x1bcdc1(0x1c1)](_0x35e863+_0x1bcdc1(0x20b));if(_0x2b18e4>0x0)_0x444ae0[_0x1bcdc1(0x1c1)](_0x2b18e4+_0x1bcdc1(0x216));if(_0x32c02e>0x0)_0x444ae0['push'](_0x32c02e+'\x20deleted');const _0x1992c8=[];if(_0x870350>0x0)_0x1992c8[_0x1bcdc1(0x1c1)](_0x870350+_0x1bcdc1(0x20b));if(_0x9b57cf>0x0)_0x1992c8[_0x1bcdc1(0x1c1)](_0x9b57cf+'\x20updated');if(_0x2e1f64>0x0)_0x1992c8[_0x1bcdc1(0x1c1)](_0x2e1f64+_0x1bcdc1(0x1da));console[_0x1bcdc1(0x1e8)](a40_0x4837c3[_0x1bcdc1(0x1a5)](_0x1bcdc1(0x211)));_0x4ccaae[_0x1bcdc1(0x1b5)]>0x0&&!_0x31bcea[_0x1bcdc1(0x1b1)]&&console[_0x1bcdc1(0x1e8)]('\x20\x20Segments:\x20'+_0x4ccaae['join'](',\x20'));_0x444ae0[_0x1bcdc1(0x1b5)]>0x0&&console[_0x1bcdc1(0x1e8)](_0x1bcdc1(0x19e)+_0x444ae0[_0x1bcdc1(0x1d8)](',\x20'));_0x1992c8['length']>0x0&&!_0x31bcea[_0x1bcdc1(0x1b1)]&&console[_0x1bcdc1(0x1e8)]('\x20\x20Activations:\x20'+_0x1992c8[_0x1bcdc1(0x1d8)](',\x20'));if(_0x1b9846){const _0x1bdc08=getConsoleNextUrl(_0x31bcea[_0x1bcdc1(0x1cd)],'/app/ps/'+_0x3238ce+_0x1bcdc1(0x1e2)+_0x1b9846+_0x1bcdc1(0x18f));console['error']('\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20'+a40_0x4837c3[_0x1bcdc1(0x1c3)](_0x1bdc08));}return 0x0;}}