@treasuredata/tdx 2026.3.27 β†’ 2026.3.29

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_0x5bf13f=a35_0x45f2;(function(_0x27176d,_0x156daf){const _0x33bbff=a35_0x45f2,_0x41ad1b=_0x27176d();while(!![]){try{const _0x3a1bf7=-parseInt(_0x33bbff(0x224))/0x1+parseInt(_0x33bbff(0x1f3))/0x2+-parseInt(_0x33bbff(0x228))/0x3*(parseInt(_0x33bbff(0x255))/0x4)+-parseInt(_0x33bbff(0x1e8))/0x5*(-parseInt(_0x33bbff(0x233))/0x6)+parseInt(_0x33bbff(0x261))/0x7*(-parseInt(_0x33bbff(0x1f5))/0x8)+-parseInt(_0x33bbff(0x211))/0x9*(parseInt(_0x33bbff(0x263))/0xa)+parseInt(_0x33bbff(0x202))/0xb;if(_0x3a1bf7===_0x156daf)break;else _0x41ad1b['push'](_0x41ad1b['shift']());}catch(_0x5a728c){_0x41ad1b['push'](_0x41ad1b['shift']());}}}(a35_0xbecc,0x83142));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_0x1993fd from'chalk';function formatRelativeTime(_0x55a866){const _0x18e48e=a35_0x45f2,_0x55db42=new Date(_0x55a866),_0x471729=new Date(),_0x2c4b2b=_0x55db42[_0x18e48e(0x1fc)]()-_0x471729['getTime'](),_0x22602d=Math[_0x18e48e(0x26b)](_0x2c4b2b)/0x3e8,_0x3ab293=_0x2c4b2b<0x0;if(_0x22602d<0x3c)return _0x3ab293?_0x18e48e(0x269):_0x18e48e(0x266);else{if(_0x22602d<0xe10){const _0x5083bd=Math[_0x18e48e(0x23e)](_0x22602d/0x3c);return _0x3ab293?_0x5083bd+'m\x20ago':_0x18e48e(0x25b)+_0x5083bd+'m';}else{if(_0x22602d<0x15180){const _0x30ad51=Math['round'](_0x22602d/0xe10);return _0x3ab293?_0x30ad51+_0x18e48e(0x26e):_0x18e48e(0x25b)+_0x30ad51+'h';}else{if(_0x22602d<0x93a80){const _0x216a6c=Math[_0x18e48e(0x23e)](_0x22602d/0x15180);return _0x3ab293?_0x216a6c+_0x18e48e(0x22a):_0x18e48e(0x25b)+_0x216a6c+'d';}else return _0x55db42['toLocaleDateString']();}}}}function a35_0x45f2(_0x131141,_0x9bc890){_0x131141=_0x131141-0x1e0;const _0xbecc19=a35_0xbecc();let _0x45f267=_0xbecc19[_0x131141];return _0x45f267;}export class ScheduleListCommand extends BaseCommand{[a35_0x5bf13f(0x209)]=a35_0x5bf13f(0x204);[a35_0x5bf13f(0x248)]=a35_0x5bf13f(0x1f2);async['execute'](_0x1770b4){const _0x2c6b2d=a35_0x5bf13f,{options:_0x1f54b6,args:_0x7782d3,tdx:_0x293531}=_0x1770b4,_0x4b61d7=resolveLimit(_0x1f54b6[_0x2c6b2d(0x267)],DEFAULT_DISPLAY_LIMIT),_0xfbcfe=_0x7782d3[0x0],_0x1e342d=_0xfbcfe?_0x2c6b2d(0x1e3)+_0xfbcfe+_0x2c6b2d(0x236):_0x2c6b2d(0x244),_0x147c75=await withSpinner(_0x1e342d,()=>_0x293531[_0x2c6b2d(0x260)]['listQueries']({'limit':_0x4b61d7,'scheduled':!![],'pattern':_0xfbcfe}),{'verbose':_0x1f54b6[_0x2c6b2d(0x246)]}),_0x173024=_0x147c75[_0x2c6b2d(0x229)][_0x2c6b2d(0x215)],_0x3a6d5d=_0x147c75[_0x2c6b2d(0x229)][_0x2c6b2d(0x24c)]['has_next_page'],_0x36f9c5=_0xfbcfe?_0x2c6b2d(0x25c)+_0xfbcfe+'\x22':'';_0x3a6d5d?console['error'](_0x2c6b2d(0x24b)+_0x173024['length']+_0x2c6b2d(0x207)+_0x36f9c5+_0x2c6b2d(0x1e5)):console[_0x2c6b2d(0x1ea)](_0x2c6b2d(0x221)+_0x173024[_0x2c6b2d(0x22f)]+'\x20scheduled\x20quer'+(_0x173024['length']!==0x1?'ies':'y')+_0x36f9c5);if(_0x1f54b6[_0x2c6b2d(0x1e4)]===_0x2c6b2d(0x1fe)||_0x1f54b6[_0x2c6b2d(0x1e4)]===_0x2c6b2d(0x1ef)||_0x1f54b6[_0x2c6b2d(0x1e4)]===_0x2c6b2d(0x241)||_0x1f54b6[_0x2c6b2d(0x1e4)]==='tsv'){const _0x126074=_0x173024['map'](_0x33bb2a=>({'id':_0x33bb2a['id'],'name':_0x33bb2a[_0x2c6b2d(0x209)],'cron':_0x33bb2a[_0x2c6b2d(0x1ee)],'database':_0x33bb2a[_0x2c6b2d(0x251)]?.[_0x2c6b2d(0x209)],'type':_0x33bb2a[_0x2c6b2d(0x272)],'timezone':_0x33bb2a[_0x2c6b2d(0x25e)],'user_name':_0x33bb2a[_0x2c6b2d(0x245)]?.['name'],'updated_at':_0x33bb2a[_0x2c6b2d(0x20a)],'next_run_at':_0x33bb2a[_0x2c6b2d(0x214)],'last_job_status':_0x33bb2a[_0x2c6b2d(0x24f)]?.[_0x2c6b2d(0x250)]}));await handleSDKOutput(_0x126074,_0x1f54b6);}else{if(_0x173024[_0x2c6b2d(0x22f)]===0x0)console[_0x2c6b2d(0x23d)](_0x2c6b2d(0x1f4));else{const _0x4c6c4c=_0x1f54b6[_0x2c6b2d(0x21b)],_0x4df152=_0x173024[_0x2c6b2d(0x262)](_0x14e49a=>{const _0x150956=_0x2c6b2d,_0x56bdd4=_0x14e49a[_0x150956(0x24f)]?.[_0x150956(0x250)]?_0x14e49a[_0x150956(0x24f)]['status']==='success'?'βœ“':'βœ—':'-',_0x5ccef1=_0x14e49a[_0x150956(0x24f)]?.[_0x150956(0x1e9)]?formatRelativeTime(_0x14e49a[_0x150956(0x24f)][_0x150956(0x1e9)]):_0x150956(0x21e),_0x4b7d60=_0x14e49a[_0x150956(0x214)]?formatRelativeTime(_0x14e49a[_0x150956(0x214)]):'-',_0x4efc96=_0x14e49a['cron']||'',_0x232363=_0x14e49a[_0x150956(0x209)]||'(unnamed)',_0x2dc265=getConsoleUrl(_0x4c6c4c,_0x150956(0x1f7)+_0x14e49a['id']);return{'statusIcon':_0x56bdd4,'lastRun':_0x5ccef1,'nextRun':_0x4b7d60,'cron':_0x4efc96,'name':_0x232363,'queryUrl':_0x2dc265,'status':_0x14e49a[_0x150956(0x24f)]?.['status']};}),_0xd6d037=Math[_0x2c6b2d(0x259)](..._0x4df152['map'](_0x283474=>_0x283474[_0x2c6b2d(0x200)][_0x2c6b2d(0x22f)])),_0x5dc239=Math[_0x2c6b2d(0x259)](..._0x4df152[_0x2c6b2d(0x262)](_0x14c60a=>_0x14c60a[_0x2c6b2d(0x25d)][_0x2c6b2d(0x22f)])),_0x33098d=Math[_0x2c6b2d(0x259)](..._0x4df152['map'](_0x30886d=>_0x30886d['cron']['length'])),_0x482bed=_0x4df152[_0x2c6b2d(0x262)](_0xa91452=>{const _0x20f051=_0x2c6b2d,_0x10058f=_0xa91452[_0x20f051(0x250)]===_0x20f051(0x1ff)?a35_0x1993fd[_0x20f051(0x230)](_0xa91452[_0x20f051(0x265)]):_0xa91452[_0x20f051(0x250)]==='error'?a35_0x1993fd[_0x20f051(0x223)](_0xa91452[_0x20f051(0x265)]):a35_0x1993fd['dim'](_0xa91452[_0x20f051(0x265)]),_0x27a499=_0xa91452[_0x20f051(0x200)]['padEnd'](_0xd6d037),_0x21754c=_0xa91452[_0x20f051(0x25d)][_0x20f051(0x1e7)](_0x5dc239),_0x212f78=_0xa91452['cron']?a35_0x1993fd[_0x20f051(0x253)](_0xa91452['cron']['padEnd'](_0x33098d)):'\x20'[_0x20f051(0x22e)](_0x33098d),_0x3e4fd7=hyperlink(_0xa91452[_0x20f051(0x209)],_0xa91452[_0x20f051(0x26d)]);return _0x20f051(0x22d)+_0x10058f+'\x20'+_0x27a499+_0x20f051(0x226)+_0x21754c+'\x20\x20'+_0x212f78+'\x20\x20'+_0x3e4fd7;});await writeOutput(_0x482bed[_0x2c6b2d(0x216)]('\x0a'),_0x1f54b6[_0x2c6b2d(0x264)],_0x2c6b2d(0x25f));}}return 0x0;}}export class ScheduleShowCommand extends BaseCommand{[a35_0x5bf13f(0x209)]=a35_0x5bf13f(0x258);['description']=a35_0x5bf13f(0x238);['validate'](_0x549a17){const _0x483e29=a35_0x5bf13f,_0x2a4a41=_0x549a17[_0x483e29(0x240)][0x0];if(!_0x2a4a41)return _0x483e29(0x26a);return undefined;}async['execute'](_0x783cc){const _0x3c09fc=a35_0x5bf13f,{options:_0x24b9e2,args:_0x422b57,tdx:_0x157cc3}=_0x783cc,_0x5b0de5=_0x422b57[0x0],_0x4cedc1=await withSpinner(_0x3c09fc(0x20f),()=>_0x157cc3[_0x3c09fc(0x260)][_0x3c09fc(0x270)](_0x5b0de5),{'verbose':_0x24b9e2[_0x3c09fc(0x246)]}),_0x422bf3=_0x4cedc1[_0x3c09fc(0x229)],_0x531067={'name':_0x422bf3[_0x3c09fc(0x209)],'cron':_0x422bf3[_0x3c09fc(0x1ee)],'database':_0x422bf3[_0x3c09fc(0x251)],'type':_0x422bf3[_0x3c09fc(0x272)],'timezone':_0x422bf3['timezone'],'user_name':_0x422bf3[_0x3c09fc(0x1e2)],'created_at':_0x422bf3[_0x3c09fc(0x26f)],'engine_version':_0x422bf3['engine_version'],'executing_user_id':_0x422bf3[_0x3c09fc(0x218)],'query':_0x422bf3['query'],'delay':_0x422bf3[_0x3c09fc(0x237)],'priority':_0x422bf3[_0x3c09fc(0x25a)],'retry_limit':_0x422bf3['retry_limit'],..._0x422bf3[_0x3c09fc(0x235)]&&{'result':_0x422bf3['result']}};return await handleSingleObjectOutput(_0x531067,_0x24b9e2),0x0;}}function a35_0xbecc(){const _0x350c1e=['Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20delete\x20<name>','schedule:show','max','priority','in\x20','\x20matching\x20\x22','nextRun','time_zone','list','schedules','899647QpcfwJ','map','1480wHDYKV','output','statusIcon','soon','limit','Running\x20schedule...','just\x20now','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20show\x20<name>','abs','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20schedule\x20\x22','queryUrl','h\x20ago','created_at','show','keys','type','Run\x20a\x20scheduled\x20query\x20immediately','utf-8','user_name','Searching\x20scheduled\x20queries\x20matching\x20\x22','format','\x20(use\x20--limit\x20to\x20see\x20more)','trino','padEnd','145dJqloz','ended_at','error','query','Schedule\x20deleted:\x20','...','cron','jsonl','num','file','List\x20scheduled\x20queries','1237062SfLRAl','No\x20scheduled\x20queries\x20found','32vepXRp','Schedule\x20run\x20submitted:\x20','/app/queries/editor?queryId=','\x20\x20Num:\x20','\x20\x20Type:\x20','run','\x20created','getTime','trim','json','success','lastRun','Database\x20is\x20required\x0aUsage:\x20job\x20schedule\x20create\x20<name>\x20-d\x20<db>\x20--file\x20<path>\x20[options]','24521915aNhjib','retryLimit','schedule:list','entries','Schedule\x20updated:\x20','\x20schedules','delete','name','updated_at','Delete\x20a\x20scheduled\x20query','create','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20history\x20<name>\x20[--from\x20<n>]\x20[--to\x20<n>]','Getting\x20schedule\x20history...','Getting\x20schedule\x20details...','retry_limit','60102MmNlce','yes','timezone','next_run_at','queries','join','Create\x20a\x20scheduled\x20query','executing_user_id','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20run\x20<name>\x20[--time\x20<iso8601>]\x20[--num\x20<1-10>]','engineVersion','site','Cancelled','validate','never','time','\x20\x20Time:\x20','Found\x20','end_at','red','182567mWPHdU','schedule:run','\x20\x20β†’\x20','count','3NCtGvJ','data','d\x20ago','Updating\x20schedule:\x20','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20update\x20<name>\x20[options]','πŸ“…\x20','repeat','length','green','Running\x20schedule:\x20','job_id','57324rXqiTf','history','result','\x22...','delay','Show\x20schedule\x20details','\x20job','\x20\x20Timezone:\x20','from','Schedule\x20created:\x20','log','round','INVALID_ARGUMENT','args','table','jobs','Failed\x20to\x20read\x20file:\x20','Listing\x20scheduled\x20queries...','user','verbose','Updating\x20schedule...','description','Creating\x20schedule...','options','Showing\x20first\x20','pagination','execute','Query\x20file\x20is\x20empty','last_job','status','database','engine_version','cyan','schedule:update','3611876YQrBAZ','\x20execution'];a35_0xbecc=function(){return _0x350c1e;};return a35_0xbecc();}export class ScheduleCreateCommand extends BaseCommand{[a35_0x5bf13f(0x209)]='schedule:create';[a35_0x5bf13f(0x248)]=a35_0x5bf13f(0x217);[a35_0x5bf13f(0x21d)](_0x5141c8){const _0x33d64a=a35_0x5bf13f,_0x5f5731=_0x5141c8[_0x33d64a(0x240)][0x0];if(!_0x5f5731)return'Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20create\x20<name>\x20-d\x20<db>\x20--file\x20<path>\x20[options]';const _0x4c5077=_0x5141c8[_0x33d64a(0x24a)];if(!_0x4c5077['database'])return _0x33d64a(0x201);return undefined;}async[a35_0x5bf13f(0x24d)](_0x3be46b){const _0xcb662=a35_0x5bf13f,{options:_0x292d0f,args:_0x316b0a,tdx:_0x3430a6}=_0x3be46b,_0x554b5b=_0x316b0a[0x0],_0x356692=_0x292d0f,_0xcbc8e1=_0x356692['database'],_0x4dcce1=_0x356692[_0xcb662(0x1f1)],_0x378a1d=_0x356692[_0xcb662(0x272)]||_0xcb662(0x1e6);let _0x315c4a;try{_0x315c4a=readFileSync(_0x4dcce1,_0xcb662(0x1e1))[_0xcb662(0x1fd)]();}catch(_0x46d790){throw new SDKError(ErrorCode[_0xcb662(0x23f)],'Failed\x20to\x20read\x20file:\x20'+_0x4dcce1,_0x46d790 instanceof Error?_0x46d790:undefined);}if(!_0x315c4a)throw new SDKError(ErrorCode[_0xcb662(0x23f)],_0xcb662(0x24e));const _0x15b9e4={'database':_0xcbc8e1,'query':_0x315c4a,'type':_0x378a1d};if(_0x356692[_0xcb662(0x1ee)])_0x15b9e4[_0xcb662(0x1ee)]=_0x356692[_0xcb662(0x1ee)];if(_0x356692[_0xcb662(0x213)])_0x15b9e4['timezone']=_0x356692[_0xcb662(0x213)];if(_0x356692[_0xcb662(0x237)]!==undefined)_0x15b9e4[_0xcb662(0x237)]=Number(_0x356692[_0xcb662(0x237)]);if(_0x356692[_0xcb662(0x25a)]!==undefined)_0x15b9e4[_0xcb662(0x25a)]=Number(_0x356692[_0xcb662(0x25a)]);if(_0x356692[_0xcb662(0x203)]!==undefined)_0x15b9e4['retry_limit']=Number(_0x356692[_0xcb662(0x203)]);if(_0x356692[_0xcb662(0x21a)])_0x15b9e4[_0xcb662(0x252)]=_0x356692[_0xcb662(0x21a)];if(_0x356692[_0xcb662(0x235)])_0x15b9e4[_0xcb662(0x235)]=_0x356692['result'];if(_0x292d0f[_0xcb662(0x246)]){console[_0xcb662(0x1ea)]('Creating\x20schedule:\x20'+_0x554b5b),console[_0xcb662(0x1ea)]('\x20\x20Database:\x20'+_0xcbc8e1),console[_0xcb662(0x1ea)](_0xcb662(0x1f9)+_0x378a1d);if(_0x15b9e4['cron'])console['error']('\x20\x20Cron:\x20'+_0x15b9e4['cron']);if(_0x15b9e4[_0xcb662(0x213)])console[_0xcb662(0x1ea)](_0xcb662(0x23a)+_0x15b9e4[_0xcb662(0x213)]);}const _0x25c280=await withSpinner(_0xcb662(0x249),()=>_0x3430a6['schedules'][_0xcb662(0x20c)](_0x554b5b,_0x15b9e4),{'verbose':_0x292d0f['verbose']});return console[_0xcb662(0x1ea)](_0xcb662(0x23c)+_0x25c280[_0xcb662(0x229)][_0xcb662(0x209)]),await handleSingleObjectOutput(_0x25c280[_0xcb662(0x229)],_0x292d0f),0x0;}}export class ScheduleUpdateCommand extends BaseCommand{['name']=a35_0x5bf13f(0x254);[a35_0x5bf13f(0x248)]='Update\x20a\x20scheduled\x20query';['validate'](_0x353cdb){const _0xc5a29b=a35_0x5bf13f,_0x9a8867=_0x353cdb['args'][0x0];if(!_0x9a8867)return _0xc5a29b(0x22c);return undefined;}async[a35_0x5bf13f(0x24d)](_0x4978b8){const _0xc1656=a35_0x5bf13f,{options:_0x460f17,args:_0x39cc21,tdx:_0x56db17}=_0x4978b8,_0x6eb457=_0x39cc21[0x0],_0x4453de=_0x460f17,_0x587187={};if(_0x4453de[_0xc1656(0x251)])_0x587187[_0xc1656(0x251)]=_0x4453de[_0xc1656(0x251)];if(_0x4453de[_0xc1656(0x272)])_0x587187[_0xc1656(0x272)]=_0x4453de[_0xc1656(0x272)];if(_0x4453de[_0xc1656(0x1ee)])_0x587187['cron']=_0x4453de[_0xc1656(0x1ee)];if(_0x4453de[_0xc1656(0x213)])_0x587187[_0xc1656(0x213)]=_0x4453de[_0xc1656(0x213)];if(_0x4453de[_0xc1656(0x237)]!==undefined)_0x587187[_0xc1656(0x237)]=Number(_0x4453de[_0xc1656(0x237)]);if(_0x4453de[_0xc1656(0x25a)]!==undefined)_0x587187[_0xc1656(0x25a)]=Number(_0x4453de['priority']);if(_0x4453de[_0xc1656(0x203)]!==undefined)_0x587187[_0xc1656(0x210)]=Number(_0x4453de[_0xc1656(0x203)]);if(_0x4453de[_0xc1656(0x21a)])_0x587187[_0xc1656(0x252)]=_0x4453de[_0xc1656(0x21a)];if(_0x4453de['result'])_0x587187[_0xc1656(0x235)]=_0x4453de[_0xc1656(0x235)];if(_0x4453de['file'])try{_0x587187[_0xc1656(0x1eb)]=readFileSync(_0x4453de[_0xc1656(0x1f1)],_0xc1656(0x1e1))[_0xc1656(0x1fd)]();}catch(_0x4fe145){throw new SDKError(ErrorCode[_0xc1656(0x23f)],_0xc1656(0x243)+_0x4453de[_0xc1656(0x1f1)],_0x4fe145 instanceof Error?_0x4fe145:undefined);}if(Object[_0xc1656(0x271)](_0x587187)['length']===0x0)throw new SDKError(ErrorCode[_0xc1656(0x23f)],'At\x20least\x20one\x20option\x20must\x20be\x20provided\x20to\x20update');if(_0x460f17['verbose']){console['error'](_0xc1656(0x22b)+_0x6eb457);for(const [_0x475c89,_0x1e5f49]of Object[_0xc1656(0x205)](_0x587187)){_0x475c89===_0xc1656(0x1eb)?console[_0xc1656(0x1ea)]('\x20\x20'+_0x475c89+':\x20'+_0x1e5f49['substring'](0x0,0x32)+_0xc1656(0x1ed)):console[_0xc1656(0x1ea)]('\x20\x20'+_0x475c89+':\x20'+_0x1e5f49);}}const _0x218bc7=await withSpinner(_0xc1656(0x247),()=>_0x56db17[_0xc1656(0x260)]['update'](_0x6eb457,_0x587187),{'verbose':_0x460f17['verbose']});return console[_0xc1656(0x1ea)](_0xc1656(0x206)+_0x218bc7[_0xc1656(0x229)]['name']),await handleSingleObjectOutput(_0x218bc7[_0xc1656(0x229)],_0x460f17),0x0;}}export class ScheduleDeleteCommand extends BaseCommand{['name']='schedule:delete';[a35_0x5bf13f(0x248)]=a35_0x5bf13f(0x20b);[a35_0x5bf13f(0x21d)](_0x37921e){const _0x412831=a35_0x5bf13f,_0x4135df=_0x37921e[_0x412831(0x240)][0x0];if(!_0x4135df)return _0x412831(0x257);return undefined;}async[a35_0x5bf13f(0x24d)](_0x283160){const _0x67ecee=a35_0x5bf13f,{options:_0x5b906a,args:_0x2cf32f,tdx:_0x445903}=_0x283160,_0x4d48f4=_0x2cf32f[0x0];if(!_0x5b906a[_0x67ecee(0x212)]){const _0x55011b=await confirm(_0x67ecee(0x26c)+_0x4d48f4+'\x22?');if(!_0x55011b)return console[_0x67ecee(0x1ea)](_0x67ecee(0x21c)),0x0;}const _0x21f420=await withSpinner('Deleting\x20schedule...',()=>_0x445903[_0x67ecee(0x260)][_0x67ecee(0x208)](_0x4d48f4),{'verbose':_0x5b906a[_0x67ecee(0x246)]});return console[_0x67ecee(0x1ea)](_0x67ecee(0x1ec)+_0x21f420[_0x67ecee(0x229)][_0x67ecee(0x209)]),0x0;}}export class ScheduleRunCommand extends BaseCommand{[a35_0x5bf13f(0x209)]=a35_0x5bf13f(0x225);['description']=a35_0x5bf13f(0x1e0);['validate'](_0x34e6ae){const _0x1e5eff=a35_0x5bf13f,_0x17d58b=_0x34e6ae[_0x1e5eff(0x240)][0x0];if(!_0x17d58b)return _0x1e5eff(0x219);return undefined;}async['execute'](_0x20652f){const _0x37ba6b=a35_0x5bf13f,{options:_0x1c789f,args:_0x40ec0d,tdx:_0x2a0b69}=_0x20652f,_0x101118=_0x40ec0d[0x0],_0x3f0d5d=_0x1c789f,_0x584aac=_0x3f0d5d[_0x37ba6b(0x21f)],_0x49f892=_0x3f0d5d['num']!==undefined?Number(_0x3f0d5d[_0x37ba6b(0x1f0)]):undefined;if(_0x1c789f[_0x37ba6b(0x246)]){console[_0x37ba6b(0x1ea)](_0x37ba6b(0x231)+_0x101118);if(_0x584aac)console[_0x37ba6b(0x1ea)](_0x37ba6b(0x220)+_0x584aac);if(_0x49f892)console[_0x37ba6b(0x1ea)](_0x37ba6b(0x1f8)+_0x49f892);}const _0x51dc25=await withSpinner(_0x37ba6b(0x268),()=>_0x2a0b69['schedules'][_0x37ba6b(0x1fa)](_0x101118,{'time':_0x584aac,'num':_0x49f892}),{'verbose':_0x1c789f[_0x37ba6b(0x246)]}),_0x5aa337=_0x51dc25[_0x37ba6b(0x229)][_0x37ba6b(0x242)];console[_0x37ba6b(0x1ea)](_0x37ba6b(0x1f6)+_0x5aa337['length']+_0x37ba6b(0x239)+(_0x5aa337[_0x37ba6b(0x22f)]!==0x1?'s':'')+_0x37ba6b(0x1fb));for(const _0x546aec of _0x5aa337){console['error']('\x20\x20Job\x20ID:\x20'+_0x546aec[_0x37ba6b(0x232)]);}return await handleSDKOutput(_0x5aa337,_0x1c789f),0x0;}}export class ScheduleHistoryCommand extends BaseCommand{['name']='schedule:history';[a35_0x5bf13f(0x248)]='Show\x20schedule\x20execution\x20history';[a35_0x5bf13f(0x21d)](_0x59690c){const _0x2dac30=a35_0x5bf13f,_0x818527=_0x59690c[_0x2dac30(0x240)][0x0];if(!_0x818527)return _0x2dac30(0x20d);return undefined;}async['execute'](_0x46aba8){const _0x2ed816=a35_0x5bf13f,{options:_0xff40c3,args:_0x3924ba,tdx:_0x2ebb94}=_0x46aba8,_0x553ea8=_0x3924ba[0x0],_0xbe4188=_0xff40c3,_0x222d1c=_0xbe4188[_0x2ed816(0x23b)]!==undefined?Number(_0xbe4188[_0x2ed816(0x23b)]):undefined,_0xb48be1=_0xbe4188['to']!==undefined?Number(_0xbe4188['to']):undefined,_0x451a39=await withSpinner(_0x2ed816(0x20e),()=>_0x2ebb94[_0x2ed816(0x260)][_0x2ed816(0x234)](_0x553ea8,{'from':_0x222d1c,'to':_0xb48be1}),{'verbose':_0xff40c3['verbose']}),_0x31196d=_0x451a39[_0x2ed816(0x229)];console[_0x2ed816(0x1ea)](_0x2ed816(0x221)+_0x31196d[_0x2ed816(0x227)]+_0x2ed816(0x256)+(_0x31196d[_0x2ed816(0x227)]!==0x1?'s':'')+'\x20(showing\x20'+_0x31196d[_0x2ed816(0x23b)]+'-'+_0x31196d['to']+')');const _0x884773=_0x31196d[_0x2ed816(0x234)][_0x2ed816(0x262)](_0x154ce0=>({'job_id':_0x154ce0[_0x2ed816(0x232)],'type':_0x154ce0[_0x2ed816(0x272)],'status':_0x154ce0['status'],'scheduled_at':_0x154ce0['scheduled_at'],'created_at':_0x154ce0[_0x2ed816(0x26f)],'start_at':_0x154ce0['start_at'],'end_at':_0x154ce0[_0x2ed816(0x222)]}));return await handleSDKOutput(_0x884773,_0xff40c3),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_0x18f4a0=a36_0x2864;(function(_0x1001b1,_0x2bb37e){const _0x2c003d=a36_0x2864,_0x138ee5=_0x1001b1();while(!![]){try{const _0x4eb33c=parseInt(_0x2c003d(0x14a))/0x1*(-parseInt(_0x2c003d(0x118))/0x2)+parseInt(_0x2c003d(0xe2))/0x3+parseInt(_0x2c003d(0x119))/0x4+parseInt(_0x2c003d(0xb7))/0x5*(parseInt(_0x2c003d(0x100))/0x6)+-parseInt(_0x2c003d(0xe4))/0x7*(parseInt(_0x2c003d(0x145))/0x8)+-parseInt(_0x2c003d(0x126))/0x9+parseInt(_0x2c003d(0xc5))/0xa;if(_0x4eb33c===_0x2bb37e)break;else _0x138ee5['push'](_0x138ee5['shift']());}catch(_0x35bdd3){_0x138ee5['push'](_0x138ee5['shift']());}}}(a36_0x5a7e,0xdb587));function a36_0x2864(_0x33b044,_0x4a122c){_0x33b044=_0x33b044-0xaf;const _0x5a7e26=a36_0x5a7e();let _0x2864fc=_0x5a7e26[_0x33b044];return _0x2864fc;}import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput}from'../core/command-output.js';function a36_0x5a7e(){const _0x65104f=['2113140gbMvFf','βœ”\x20Created\x20folder\x20\x27','Resolved:\x20','parentFolder','Fetching\x20SQL\x20for\x20segment...','Folder\x20name:\x20','Resolving\x20folder\x20\x27','\x20[Job\x20ID:\x20','Usage:\x20tdx\x20segment\x20describe\x20<path>','INVALID_ARGUMENT','\x20\x20tdx\x20sg\x20view\x20segments/my-audience/premium-users.yml','Usage:\x20tdx\x20sg\x20view\x20<name>\x20[-w]','getFolder','14314113nUyDmE','SEGMENT_NOT_FOUND','Fetching\x20folder\x20details...','type','Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required','Creating\x20folder\x20\x27','Folder\x20ID\x20missing\x20from\x20resolved\x20path','Resolved\x20relative\x20path\x20to:\x20','Cannot\x20get\x20SQL\x20for\x20parent\x20segment\x20with\x20this\x20command.\x20Use:\x20tdx\x20ps\x20sql','trim','verbose','Error:\x20YAML\x20file\x20paths\x20must\x20be\x20specified\x20with\x20--path\x20option','Use:\x20tdx\x20ps\x20view','segmentName','Segment\x20ID\x20missing\x20from\x20resolved\x20path','\x20\x20Parent\x20segment:\x20','\x20Opening\x20','folder','\x20folder','\x20\x20-w,\x20--web\x20\x20Open\x20segment\x20in\x20web\x20browser','Error:\x20','\x20\x20Segment\x20name:\x20','listFolders','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20show\x20<path/to/segment.yml>','Use:\x20tdx\x20sg\x20view\x20<name>\x20\x20#\x20To\x20show\x20folder\x20details','Resolving\x20parent\x20folder\x20\x27','Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>','\x20\x20Cause:\x20','segment:view','Error:\x20Parent\x20segment\x20name\x20is\x20required','\x20\x20Folder\x20path:\x20','1256OoYCyG','\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','/app/ps/','segment','Parent\x20ID:\x20','45NGyGMk','SEGMENT_FOLDER_NOT_FOUND','segment:describe','cause','Listing\x20folders\x20for\x20parent\x20\x27','Error:\x20Cannot\x20execute\x20query\x20for\x20parent\x20segment\x20with\x20this\x20command.','information_schema','Target\x20path:\x20','\x27...','5ulHCAI','toLocaleString','processedRows','segment:sql','stats','\x20\x20tdx\x20sg\x20sql\x20--path\x20segments/my-audience/premium-users.yml','Error:\x20Folder\x20reference\x20is\x20required','createFolder','Usage:','Show\x20child\x20segment\x20schema\x20(column\x20types)','data','log','fullPath','Parent\x20name:\x20','28476800kVBJEU','\x20\x20tdx\x20sg\x20view\x20\x22Marketing\x22\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20folder\x20details','length','Use:\x20tdx\x20ps\x20desc','getSegment','Folder\x20ID:\x20','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','getSQLFromYamlFile','Error:\x20Path\x20or\x20name\x20is\x20required','List\x20segment\x20folders\x20under\x20a\x20parent\x20segment','Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)','resolvePathToResource','includes','Segment\x20ID:\x20','parent','Resolving\x20\x27','Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.','elapsedTimeMillis','Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required','Fetching\x20parent\x20segment\x20details...','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','folderId','SELECT\x20*\x20FROM\x20(\x0a','Show\x20folder\x20or\x20child\x20segment\x20details','site','Site:\x20','segment:folder:show','red','Resolving\x20parent\x20segment\x20\x27','3236436bZnekT','\x20\x20tdx\x20sg\x20show\x20\x22Premium\x20Users\x22','33418XeZwQd','name','in\x20','/e/','folderPath','content','cyan','segment:show','getSegmentSQL','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20-w\x20\x20#\x20Open\x20segment\x20in\x20web\x20browser','Parent\x20segment:\x20','parentId','green','Fetching\x20segment\x20details...','query','Use:\x20tdx\x20ps\x20show','(root)','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20view\x20<path/to/segment.yml>','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20desc\x20<path/to/segment.yml>','setJobId','\x20\x20tdx\x20sg\x20sql\x20\x22Premium\x20Users\x22','error','format','Error:\x20Cannot\x20open\x20folder\x20in\x20web\x20browser.\x20Use\x20a\x20segment\x20name\x20instead.','\x20\x20Server-side\x20segment:\x20\x20tdx\x20sg\x20sql\x20<name>','json','replace','segment:folder:create','2667522svvsWC','resolveFolderId','Error:\x20Cannot\x20show\x20schema\x20for\x20a\x20folder.','message','Resolved\x20type:\x20','Usage:\x20tdx\x20sg\x20show\x20<name>','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22','segmentId','Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]','execute','\x20\x20tdx\x20sg\x20sql\x20--path\x20','βœ–\x20Query\x20failed\x20[','Fetching\x20SQL\x20from\x20rule...','Create\x20segment\x20folder\x20for\x20organization','parentSegment','resolveParentId','\x20\x20Local\x20YAML\x20file:\x20\x20\x20\x20\x20\x20tdx\x20sg\x20sql\x20--path\x20<file-path>','getSQLFromServerSegment','description','Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>','SQL\x20query:\x0a','getSegmentSQLFromYaml','jobId','Examples:','73820boSkTJ'];a36_0x5a7e=function(){return _0x65104f;};return a36_0x5a7e();}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_0x132e25 from'chalk';async function resolveSegmentTarget(_0x436a48,_0x3c1073,_0x2509cb){const _0x54eebf=a36_0x2864;if(isYamlFilePath(_0x436a48))try{const _0x52172b=await resolveYamlFilePath(_0x436a48);return _0x2509cb&&(console['error']('Resolved\x20YAML\x20file:\x20'+_0x436a48),console[_0x54eebf(0xf9)](_0x54eebf(0x135)+_0x52172b['parentSegment']),console[_0x54eebf(0xf9)](_0x54eebf(0x13b)+_0x52172b[_0x54eebf(0x133)]),console['error'](_0x54eebf(0x144)+(_0x52172b[_0x54eebf(0xe8)]||_0x54eebf(0xf4))),console[_0x54eebf(0xf9)]('\x20\x20Full\x20path:\x20'+_0x52172b[_0x54eebf(0xc3)])),_0x52172b[_0x54eebf(0xc3)];}catch(_0x270b76){throw new SDKError(ErrorCode['INVALID_ARGUMENT'],'Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20'+_0x270b76['message']);}if(!_0x3c1073)throw new SDKError(ErrorCode[_0x54eebf(0x122)],'No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22');return _0x3c1073+'/'+_0x436a48;}export class SegmentDescribeCommand extends BaseCommand{[a36_0x18f4a0(0xe5)]=a36_0x18f4a0(0xb0);['description']='Show\x20segment\x20or\x20folder\x20details';async[a36_0x18f4a0(0x109)](_0x39e71e){const _0x11e119=a36_0x18f4a0,{options:_0x4401ca,args:_0x2cad44,tdx:_0x3f06c3}=_0x39e71e,_0x43a865=_0x2cad44[0x0],_0x16a07f=!_0x43a865&&!!_0x4401ca[_0x11e119(0x10e)],_0x121b3c=_0x43a865||_0x4401ca[_0x11e119(0x10e)];if(!_0x121b3c)return console[_0x11e119(0xf9)](_0x11e119(0xcd)),console['error'](_0x11e119(0x121)),console[_0x11e119(0xf9)](_0x11e119(0x117)),console[_0x11e119(0xf9)]('\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22'),console[_0x11e119(0xf9)](_0x11e119(0x106)),console[_0x11e119(0xf9)](_0x11e119(0x146)),console[_0x11e119(0xf9)](_0x11e119(0xd9)),0x1;try{const _0x207ee4=_0x4401ca['segmentPath'];let _0x408d03=_0x121b3c;!_0x16a07f&&_0x207ee4&&!_0x121b3c[_0x11e119(0xd1)]('/')&&(_0x408d03=_0x207ee4+'/'+_0x121b3c,_0x4401ca[_0x11e119(0x130)]&&console[_0x11e119(0xf9)](_0x11e119(0x12d)+_0x408d03));const _0x486cad=await withSpinner('Resolving\x20path\x20\x27'+_0x408d03+_0x11e119(0xb6),()=>_0x3f06c3[_0x11e119(0x148)][_0x11e119(0xd0)](_0x408d03),{'verbose':_0x4401ca[_0x11e119(0x130)]}),_0x13c9c5=_0x486cad[_0x11e119(0xc1)];_0x4401ca[_0x11e119(0x130)]&&(console['error'](_0x11e119(0x104)+_0x13c9c5[_0x11e119(0x129)]),console[_0x11e119(0xf9)](_0x11e119(0x149)+_0x13c9c5[_0x11e119(0xef)]),_0x13c9c5[_0x11e119(0xda)]&&console[_0x11e119(0xf9)](_0x11e119(0xca)+_0x13c9c5[_0x11e119(0xda)]),_0x13c9c5[_0x11e119(0x107)]&&console[_0x11e119(0xf9)](_0x11e119(0xd2)+_0x13c9c5[_0x11e119(0x107)]));if(_0x13c9c5[_0x11e119(0x129)]==='parent'){const _0x12251f=await withSpinner(_0x11e119(0xd8),()=>_0x3f06c3['segment']['getParent'](_0x13c9c5['parentId']),{'verbose':_0x4401ca[_0x11e119(0x130)]});await handleSingleObjectOutput(_0x12251f[_0x11e119(0xc1)],_0x4401ca);}else{if(_0x13c9c5[_0x11e119(0x129)]===_0x11e119(0x137)){if(!_0x13c9c5['folderId'])throw new SDKError(ErrorCode[_0x11e119(0xaf)],_0x11e119(0x12c));const _0x21c757=await withSpinner(_0x11e119(0x128),()=>_0x3f06c3[_0x11e119(0x148)][_0x11e119(0x125)](_0x13c9c5[_0x11e119(0xda)]),{'verbose':_0x4401ca[_0x11e119(0x130)]});await handleSingleObjectOutput(_0x21c757['data'],_0x4401ca);}else{if(_0x13c9c5[_0x11e119(0x129)]===_0x11e119(0x148)){if(!_0x13c9c5['segmentId'])throw new SDKError(ErrorCode[_0x11e119(0x127)],_0x11e119(0x134));const _0x219c0a=await withSpinner(_0x11e119(0xf1),()=>_0x3f06c3[_0x11e119(0x148)][_0x11e119(0xc9)](_0x13c9c5[_0x11e119(0xef)],_0x13c9c5[_0x11e119(0x107)]),{'verbose':_0x4401ca[_0x11e119(0x130)]});await handleSingleObjectOutput(_0x219c0a[_0x11e119(0xc1)],_0x4401ca);}}}return 0x0;}catch(_0x75f77f){if(_0x75f77f instanceof SDKError)return console[_0x11e119(0xf9)](_0x11e119(0x13a)+_0x75f77f[_0x11e119(0x103)]),_0x75f77f[_0x11e119(0xb1)]&&console['error'](_0x11e119(0x141)+_0x75f77f[_0x11e119(0xb1)]),0x1;throw _0x75f77f;}}}export class SegmentShowCommand extends BaseCommand{[a36_0x18f4a0(0xe5)]=a36_0x18f4a0(0xeb);[a36_0x18f4a0(0x112)]='Execute\x20child\x20segment\x20SQL\x20query\x20and\x20show\x20results';async[a36_0x18f4a0(0x109)](_0x30bb7b){const _0x35e415=a36_0x18f4a0,{options:_0xf15988,args:_0x27a779,tdx:_0x1cd92c}=_0x30bb7b,_0x143ab9=_0x27a779[0x0];if(!_0x143ab9)return console[_0x35e415(0xf9)](_0x35e415(0x12a)),console[_0x35e415(0xf9)](_0x35e415(0x105)),console[_0x35e415(0xf9)](_0x35e415(0x13d)),console['error']('Examples:'),console[_0x35e415(0xf9)](_0x35e415(0xe3)),console[_0x35e415(0xf9)]('\x20\x20tdx\x20sg\x20show\x20segments/my-audience/premium-users.yml'),0x1;try{const _0x523189=_0xf15988[_0x35e415(0x10e)],_0x356282=await resolveSegmentTarget(_0x143ab9,_0x523189,_0xf15988['verbose']);_0xf15988[_0x35e415(0x130)]&&console[_0x35e415(0xf9)](_0x35e415(0xb5)+_0x356282);const _0x2582c1=await withSpinner(_0x35e415(0xd4)+_0x143ab9+_0x35e415(0xb6),()=>_0x1cd92c[_0x35e415(0x148)][_0x35e415(0xd0)](_0x356282),{'verbose':_0xf15988[_0x35e415(0x130)]}),_0x421e54=_0x2582c1['data'];_0xf15988[_0x35e415(0x130)]&&(console[_0x35e415(0xf9)](_0x35e415(0x104)+_0x421e54[_0x35e415(0x129)]),console[_0x35e415(0xf9)]('Parent\x20ID:\x20'+_0x421e54[_0x35e415(0xef)]));if(_0x421e54[_0x35e415(0x129)]===_0x35e415(0x137))return console['error'](_0x35e415(0xd5)),console[_0x35e415(0xf9)](_0x35e415(0x13e)),0x1;if(_0x421e54[_0x35e415(0x129)]==='parent')return console[_0x35e415(0xf9)](_0x35e415(0xb3)),console['error'](_0x35e415(0xf3)),0x1;if(!_0x421e54['segmentId'])throw new SDKError(ErrorCode[_0x35e415(0x127)],_0x35e415(0x134));const _0x3c5fa9=await withSpinner('Fetching\x20SQL\x20for\x20segment...',()=>_0x1cd92c[_0x35e415(0x148)][_0x35e415(0xec)](_0x421e54[_0x35e415(0xef)],_0x421e54[_0x35e415(0x107)]),{'verbose':_0xf15988[_0x35e415(0x130)]});let _0x431702=_0x3c5fa9['data'];const _0x5ac853=resolveLimit(_0xf15988['limit'],DEFAULT_DISPLAY_LIMIT),_0x376164=/\bLIMIT\s+\d+/i['test'](_0x431702);!_0x376164&&(_0x431702=_0x431702[_0x35e415(0x12f)]()[_0x35e415(0xfe)](/;+$/,''),_0x431702=_0x35e415(0xdb)+_0x431702+_0x35e415(0xcb)+_0x5ac853);_0xf15988[_0x35e415(0x130)]&&console[_0x35e415(0xf9)](_0x35e415(0x114)+_0x431702);const _0x2fd34f=await withProgressSpinner('Executing\x20segment\x20query...',async _0x1367f2=>{const _0x5acae3=_0x35e415,_0x16986b=await _0x1cd92c[_0x5acae3(0xf2)]['execute'](_0x431702,{'catalog':'td','schema':_0x5acae3(0xb4),'onJobId':_0x46d8d1=>{const _0x221159=_0x5acae3;_0x1367f2[_0x221159(0xf7)](_0x46d8d1);}});return _0x16986b;},{'verbose':_0xf15988[_0x35e415(0x130)]}),_0x427275=_0x2fd34f[_0x35e415(0xc1)],_0x29725b=_0x427275[_0x35e415(0x116)]?_0x35e415(0x120)+_0x427275[_0x35e415(0x116)]+']':'';return console[_0x35e415(0xf9)]('βœ”\x20Query\x20completed:\x20Processed\x20'+_0x427275[_0x35e415(0xbb)][_0x35e415(0xb9)][_0x35e415(0xb8)]()+'\x20rows\x20'+(_0x35e415(0xe6)+formatElapsed(_0x427275[_0x35e415(0xbb)][_0x35e415(0xd6)])+_0x29725b)),await handleQueryOutput(_0x427275,_0xf15988),0x0;}catch(_0x1a846b){if(_0x1a846b instanceof SDKError)return console['error'](_0x35e415(0x10b)+_0x1a846b['code']+']'),console['error']('\x0a'+_0x1a846b[_0x35e415(0x103)]),0x1;throw _0x1a846b;}}}export class SegmentFolderListCommand extends BaseCommand{[a36_0x18f4a0(0xe5)]='segment:folder:list';[a36_0x18f4a0(0x112)]=a36_0x18f4a0(0xce);async[a36_0x18f4a0(0x109)](_0x231b01){const _0x37dba8=a36_0x18f4a0,{options:_0x5d86b2,args:_0x24d903,tdx:_0x7d02db}=_0x231b01;if(_0x24d903[_0x37dba8(0xc7)]===0x0)return console[_0x37dba8(0xf9)](_0x37dba8(0x143)),console[_0x37dba8(0xf9)](_0x37dba8(0x113)),0x1;const _0x2a745c=_0x24d903[0x0];try{_0x5d86b2['verbose']&&(console['error'](_0x37dba8(0xde)+_0x5d86b2['site']),console['error']('Parent\x20name:\x20'+_0x2a745c));const _0x12c297=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x2a745c+_0x37dba8(0xb6),()=>_0x7d02db[_0x37dba8(0x148)][_0x37dba8(0x10f)](_0x2a745c),{'verbose':_0x5d86b2[_0x37dba8(0x130)]}),_0x3d9cba=_0x12c297['data'];_0x5d86b2[_0x37dba8(0x130)]&&console[_0x37dba8(0xf9)]('Resolved\x20parent\x20ID:\x20'+_0x3d9cba);const _0x29a77b=await withSpinner(_0x37dba8(0xb2)+_0x2a745c+_0x37dba8(0xb6),()=>_0x7d02db[_0x37dba8(0x148)][_0x37dba8(0x13c)](_0x3d9cba),{'verbose':_0x5d86b2[_0x37dba8(0x130)]}),_0x10fbd3=_0x29a77b[_0x37dba8(0xc1)];return console['error']('βœ”\x20Found\x20'+_0x10fbd3[_0x37dba8(0xc7)]+_0x37dba8(0x138)+(_0x10fbd3[_0x37dba8(0xc7)]!==0x1?'s':'')),await handleSDKOutput(_0x10fbd3,_0x5d86b2),0x0;}catch(_0x4551b5){if(_0x4551b5 instanceof SDKError)return console[_0x37dba8(0xf9)](_0x37dba8(0x13a)+_0x4551b5[_0x37dba8(0x103)]),_0x4551b5[_0x37dba8(0xb1)]&&console[_0x37dba8(0xf9)](_0x37dba8(0x141)+_0x4551b5[_0x37dba8(0xb1)]),0x1;throw _0x4551b5;}}}export class SegmentFolderShowCommand extends BaseCommand{[a36_0x18f4a0(0xe5)]=a36_0x18f4a0(0xdf);[a36_0x18f4a0(0x112)]='Show\x20segment\x20folder\x20details';async[a36_0x18f4a0(0x109)](_0x5edaed){const _0x501f8b=a36_0x18f4a0,{options:_0x48255a,args:_0x4ff787,tdx:_0x8844d}=_0x5edaed;if(_0x4ff787['length']===0x0)return console['error'](_0x501f8b(0xbd)),console['error'](_0x501f8b(0x140)),0x1;try{const {parentId:_0x2e5535,childId:_0x20c966}=parseSegmentRef(_0x4ff787[0x0]);_0x48255a[_0x501f8b(0x130)]&&(console['error'](_0x501f8b(0xde)+_0x48255a['site']),console[_0x501f8b(0xf9)](_0x501f8b(0xc4)+_0x2e5535),_0x20c966&&console[_0x501f8b(0xf9)](_0x501f8b(0x11e)+_0x20c966));if(!_0x20c966)return console[_0x501f8b(0xf9)](_0x501f8b(0xcf)),0x1;const _0x8e55f6=await withSpinner(_0x501f8b(0xe1)+_0x2e5535+'\x27...',()=>_0x8844d[_0x501f8b(0x148)][_0x501f8b(0x10f)](_0x2e5535),{'verbose':_0x48255a['verbose']}),_0x4f2b91=_0x8e55f6[_0x501f8b(0xc1)];_0x48255a[_0x501f8b(0x130)]&&console['error']('Resolved\x20parent\x20ID:\x20'+_0x4f2b91);const _0x104434=await withSpinner(_0x501f8b(0x11f)+_0x20c966+'\x27...',()=>_0x8844d['segment'][_0x501f8b(0x101)](_0x4f2b91,_0x20c966),{'verbose':_0x48255a['verbose']}),_0x34dd4d=_0x104434[_0x501f8b(0xc1)];_0x48255a[_0x501f8b(0x130)]&&console[_0x501f8b(0xf9)]('Resolved\x20folder\x20ID:\x20'+_0x34dd4d);const _0x4d3b50=await withSpinner('Fetching\x20folder\x20\x27'+_0x20c966+_0x501f8b(0xb6),()=>_0x8844d[_0x501f8b(0x148)][_0x501f8b(0x125)](_0x34dd4d),{'verbose':_0x48255a[_0x501f8b(0x130)]});return await handleSDKOutput([_0x4d3b50['data']],_0x48255a),0x0;}catch(_0x3dd390){if(_0x3dd390 instanceof SDKError)return console[_0x501f8b(0xf9)](_0x501f8b(0x13a)+_0x3dd390[_0x501f8b(0x103)]),_0x3dd390['cause']&&console['error'](_0x501f8b(0x141)+_0x3dd390[_0x501f8b(0xb1)]),0x1;throw _0x3dd390;}}}export class SegmentSQLCommand extends BaseCommand{[a36_0x18f4a0(0xe5)]=a36_0x18f4a0(0xba);['description']='Get\x20SQL\x20query\x20for\x20child\x20segment';async['execute'](_0x2ff0af){const _0x18194c=a36_0x18f4a0,{options:_0x3c4a4d,args:_0x310e26}=_0x2ff0af,_0x289100=_0x3c4a4d,_0x9e5750=_0x289100['path'],_0x48b214=_0x310e26[0x0];if(!_0x48b214&&!_0x9e5750)return console['error'](a36_0x132e25['red']('Error:\x20Segment\x20name\x20or\x20--path\x20is\x20required')),console[_0x18194c(0xf9)](_0x18194c(0xbf)),console[_0x18194c(0xf9)](_0x18194c(0xfc)),console[_0x18194c(0xf9)](_0x18194c(0x110)),console[_0x18194c(0xf9)]('Examples:'),console[_0x18194c(0xf9)](_0x18194c(0xf8)),console['error'](_0x18194c(0xbc)),0x1;if(_0x48b214&&_0x9e5750)return console[_0x18194c(0xf9)](a36_0x132e25[_0x18194c(0xe0)]('Error:\x20Specify\x20either\x20segment\x20name\x20or\x20--path,\x20not\x20both')),0x1;try{let _0x1a3cc9;if(_0x9e5750)_0x1a3cc9=await this[_0x18194c(0xcc)](_0x9e5750,_0x2ff0af);else{if(isYamlFilePath(_0x48b214))return console[_0x18194c(0xf9)](a36_0x132e25[_0x18194c(0xe0)](_0x18194c(0x131))),console[_0x18194c(0xf9)](_0x18194c(0x10a)+_0x48b214),0x1;else _0x1a3cc9=await this['getSQLFromServerSegment'](_0x48b214,_0x2ff0af);}return _0x3c4a4d[_0x18194c(0xfa)]===_0x18194c(0xfd)||_0x3c4a4d['format']==='jsonl'?await handleSDKOutput([{'sql':_0x1a3cc9}],_0x3c4a4d):console[_0x18194c(0xc2)](_0x1a3cc9),0x0;}catch(_0x3767a0){if(_0x3767a0 instanceof SDKError)return console[_0x18194c(0xf9)](_0x18194c(0x13a)+_0x3767a0[_0x18194c(0x103)]),_0x3767a0[_0x18194c(0xb1)]&&console['error']('\x20\x20Cause:\x20'+_0x3767a0[_0x18194c(0xb1)]),0x1;throw _0x3767a0;}}async[a36_0x18f4a0(0xcc)](_0xbfa5e7,_0x5893de){const _0x592ab4=a36_0x18f4a0,{options:_0x122b1a,tdx:_0x23056a}=_0x5893de;let _0x4e9b44;try{_0x4e9b44=await resolveYamlFilePath(_0xbfa5e7);}catch(_0xa58db2){throw new SDKError(ErrorCode[_0x592ab4(0x122)],'Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20'+_0xa58db2[_0x592ab4(0x103)]);}_0x122b1a[_0x592ab4(0x130)]&&console[_0x592ab4(0xf9)](_0x592ab4(0x11b)+_0x4e9b44[_0x592ab4(0x10e)]+'/'+_0x4e9b44['segmentName']);const _0x1ececc=await withSpinner(_0x592ab4(0x10c),()=>_0x23056a[_0x592ab4(0x148)][_0x592ab4(0x115)](_0x4e9b44[_0x592ab4(0xe9)],_0x4e9b44['parentSegment'],_0x4e9b44[_0x592ab4(0x133)]),{'verbose':_0x122b1a[_0x592ab4(0x130)]});return _0x1ececc[_0x592ab4(0xc1)];}async[a36_0x18f4a0(0x111)](_0x341c41,_0x1b88f5){const _0xd3c273=a36_0x18f4a0,{options:_0x407c3e,tdx:_0x33de31}=_0x1b88f5,_0x3daf87=_0x407c3e[_0xd3c273(0x10e)],_0x2170a9=await resolveSegmentTarget(_0x341c41,_0x3daf87,_0x407c3e['verbose']);_0x407c3e[_0xd3c273(0x130)]&&console[_0xd3c273(0xf9)](_0xd3c273(0xb5)+_0x2170a9);const _0x2f2540=await withSpinner(_0xd3c273(0xd4)+_0x341c41+_0xd3c273(0xb6),()=>_0x33de31[_0xd3c273(0x148)][_0xd3c273(0xd0)](_0x2170a9),{'verbose':_0x407c3e[_0xd3c273(0x130)]}),_0x4e9114=_0x2f2540[_0xd3c273(0xc1)];_0x407c3e[_0xd3c273(0x130)]&&(console['error'](_0xd3c273(0x104)+_0x4e9114[_0xd3c273(0x129)]),console[_0xd3c273(0xf9)](_0xd3c273(0x149)+_0x4e9114[_0xd3c273(0xef)]));if(_0x4e9114[_0xd3c273(0x129)]===_0xd3c273(0x137))throw new SDKError(ErrorCode[_0xd3c273(0x122)],'Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.\x20Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.');if(_0x4e9114[_0xd3c273(0x129)]===_0xd3c273(0xd3))throw new SDKError(ErrorCode[_0xd3c273(0x122)],_0xd3c273(0x12e));if(!_0x4e9114[_0xd3c273(0x107)])throw new SDKError(ErrorCode[_0xd3c273(0x127)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x3db9e9=await withSpinner(_0xd3c273(0x11d),()=>_0x33de31[_0xd3c273(0x148)][_0xd3c273(0xec)](_0x4e9114[_0xd3c273(0xef)],_0x4e9114[_0xd3c273(0x107)]),{'verbose':_0x407c3e['verbose']});return _0x3db9e9[_0xd3c273(0xc1)];}}export class SegmentFolderCreateCommand extends BaseCommand{[a36_0x18f4a0(0xe5)]=a36_0x18f4a0(0xff);[a36_0x18f4a0(0x112)]=a36_0x18f4a0(0x10d);async[a36_0x18f4a0(0x109)](_0x229291){const _0x1c167a=a36_0x18f4a0,{options:_0x292551,args:_0x284ab1,tdx:_0x21024a}=_0x229291,_0x482ba6=_0x292551;if(_0x284ab1[_0x1c167a(0xc7)]<0x2)return console[_0x1c167a(0xf9)](_0x1c167a(0xd7)),console['error'](_0x1c167a(0x108)),0x1;const _0x822cf4=_0x284ab1[0x0],_0x4d1f29=_0x284ab1[0x1];_0x482ba6[_0x1c167a(0x130)]&&(console[_0x1c167a(0xf9)]('Site:\x20'+_0x482ba6['site']),console[_0x1c167a(0xf9)](_0x1c167a(0xee)+_0x822cf4),console['error'](_0x1c167a(0x11e)+_0x4d1f29));let _0x1b8076;if(_0x482ba6[_0x1c167a(0x11c)]){const _0x202807=_0x482ba6[_0x1c167a(0x11c)],_0x37f24a=await withSpinner(_0x1c167a(0xe1)+_0x822cf4+_0x1c167a(0xb6),()=>_0x21024a['segment'][_0x1c167a(0x10f)](_0x822cf4),{'verbose':_0x482ba6[_0x1c167a(0x130)]}),_0x25398a=_0x37f24a[_0x1c167a(0xc1)],_0x5c7b51=await withSpinner(_0x1c167a(0x13f)+_0x202807+_0x1c167a(0xb6),()=>_0x21024a['segment'][_0x1c167a(0x101)](_0x25398a,_0x202807),{'verbose':_0x482ba6[_0x1c167a(0x130)]});_0x1b8076=_0x5c7b51[_0x1c167a(0xc1)],_0x482ba6[_0x1c167a(0x130)]&&console[_0x1c167a(0xf9)]('Resolved\x20parent\x20folder\x20ID:\x20'+_0x1b8076);}const _0x5d22b5={'name':_0x4d1f29,'description':_0x482ba6[_0x1c167a(0x112)],'parentFolderId':_0x1b8076},_0xac5f6d=await withSpinner(_0x1c167a(0x12b)+_0x4d1f29+'\x27...',()=>_0x21024a[_0x1c167a(0x148)][_0x1c167a(0xbe)](_0x822cf4,_0x5d22b5),{'verbose':_0x482ba6[_0x1c167a(0x130)]}),_0x5eaa62=_0xac5f6d['data'];return console['error'](_0x1c167a(0x11a)+_0x5eaa62['name']+'\x27\x20with\x20ID:\x20'+_0x5eaa62['id']),await handleSDKOutput([_0x5eaa62],_0x482ba6),0x0;}}export class SegmentViewCommand extends BaseCommand{[a36_0x18f4a0(0xe5)]=a36_0x18f4a0(0x142);[a36_0x18f4a0(0x112)]=a36_0x18f4a0(0xdc);async[a36_0x18f4a0(0x109)](_0x32eb3b){const _0x23674a=a36_0x18f4a0,{options:_0x3af976,args:_0x33773a,tdx:_0x5f11fb}=_0x32eb3b,_0x153c5c=_0x33773a[0x0];if(!_0x153c5c)return console['error']('Error:\x20Folder\x20or\x20segment\x20name,\x20or\x20YAML\x20file\x20path\x20is\x20required'),console[_0x23674a(0xf9)](_0x23674a(0x124)),console['error'](_0x23674a(0xf5)),console[_0x23674a(0xf9)]('Options:'),console[_0x23674a(0xf9)](_0x23674a(0x139)),console[_0x23674a(0xf9)](_0x23674a(0x117)),console[_0x23674a(0xf9)](_0x23674a(0xc6)),console['error']('\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20\x20\x20\x20\x20#\x20View\x20child\x20segment\x20details'),console[_0x23674a(0xf9)](_0x23674a(0xed)),console[_0x23674a(0xf9)](_0x23674a(0x123)),0x1;try{const _0x1f044c=_0x3af976[_0x23674a(0x10e)],_0x37aa8e=await resolveSegmentTarget(_0x153c5c,_0x1f044c,_0x3af976[_0x23674a(0x130)]);_0x3af976[_0x23674a(0x130)]&&console[_0x23674a(0xf9)]('Target\x20path:\x20'+_0x37aa8e);const _0x2c32e5=await withSpinner(_0x23674a(0xd4)+_0x153c5c+_0x23674a(0xb6),()=>_0x5f11fb[_0x23674a(0x148)][_0x23674a(0xd0)](_0x37aa8e),{'verbose':_0x3af976[_0x23674a(0x130)]}),_0x5dfb6e=_0x2c32e5[_0x23674a(0xc1)];_0x3af976[_0x23674a(0x130)]&&(console[_0x23674a(0xf9)](_0x23674a(0x104)+_0x5dfb6e['type']),console[_0x23674a(0xf9)](_0x23674a(0x149)+_0x5dfb6e[_0x23674a(0xef)]),_0x5dfb6e['folderId']&&console[_0x23674a(0xf9)](_0x23674a(0xca)+_0x5dfb6e[_0x23674a(0xda)]),_0x5dfb6e[_0x23674a(0x107)]&&console[_0x23674a(0xf9)]('Segment\x20ID:\x20'+_0x5dfb6e[_0x23674a(0x107)]));if(_0x3af976['web']){if(_0x5dfb6e[_0x23674a(0x129)]===_0x23674a(0x137))return console[_0x23674a(0xf9)](_0x23674a(0xfb)),0x1;if(_0x5dfb6e['type']===_0x23674a(0xd3))return console[_0x23674a(0xf9)]('Error:\x20Cannot\x20open\x20parent\x20segment\x20with\x20this\x20command.'),console[_0x23674a(0xf9)]('Use:\x20tdx\x20ps\x20view\x20-w'),0x1;if(!_0x5dfb6e['segmentId'])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x23674a(0x134));const _0x45c0c8=getConsoleNextUrl(_0x3af976[_0x23674a(0xdd)],_0x23674a(0x147)+_0x5dfb6e[_0x23674a(0xef)]+'/e/'+_0x5dfb6e['segmentId']);return console[_0x23674a(0xf9)](a36_0x132e25[_0x23674a(0xf0)]('βœ”')+_0x23674a(0x136)+a36_0x132e25[_0x23674a(0xea)](_0x45c0c8)),openBrowser(_0x45c0c8),0x0;}if(_0x5dfb6e[_0x23674a(0x129)]===_0x23674a(0x137)){if(!_0x5dfb6e[_0x23674a(0xda)])throw new SDKError(ErrorCode[_0x23674a(0xaf)],_0x23674a(0x12c));const _0x1308d2=await withSpinner(_0x23674a(0x128),()=>_0x5f11fb[_0x23674a(0x148)][_0x23674a(0x125)](_0x5dfb6e[_0x23674a(0xda)]),{'verbose':_0x3af976[_0x23674a(0x130)]});await handleSingleObjectOutput(_0x1308d2[_0x23674a(0xc1)],_0x3af976);}else{if(_0x5dfb6e[_0x23674a(0x129)]===_0x23674a(0x148)){if(!_0x5dfb6e['segmentId'])throw new SDKError(ErrorCode[_0x23674a(0x127)],_0x23674a(0x134));const _0x4ecac9=await withSpinner(_0x23674a(0xf1),()=>_0x5f11fb[_0x23674a(0x148)][_0x23674a(0xc9)](_0x5dfb6e[_0x23674a(0xef)],_0x5dfb6e['segmentId']),{'verbose':_0x3af976['verbose']}),_0x19c60d=getConsoleNextUrl(_0x3af976[_0x23674a(0xdd)],_0x23674a(0x147)+_0x5dfb6e[_0x23674a(0xef)]+_0x23674a(0xe7)+_0x5dfb6e[_0x23674a(0x107)]),_0x417284=_0x4ecac9[_0x23674a(0xc1)];_0x417284['url']=_0x19c60d,await handleSingleObjectOutput(_0x417284,_0x3af976);}else return console[_0x23674a(0xf9)]('Error:\x20Cannot\x20view\x20parent\x20segment\x20details\x20with\x20this\x20command.'),console[_0x23674a(0xf9)](_0x23674a(0x132)),0x1;}return 0x0;}catch(_0x22fe86){if(_0x22fe86 instanceof SDKError)return console['error'](_0x23674a(0x13a)+_0x22fe86[_0x23674a(0x103)]),_0x22fe86[_0x23674a(0xb1)]&&console[_0x23674a(0xf9)](_0x23674a(0x141)+_0x22fe86[_0x23674a(0xb1)]),0x1;throw _0x22fe86;}}}export const SegmentInfoCommand=SegmentViewCommand;export class SegmentDescCommand extends BaseCommand{['name']='segment:desc';[a36_0x18f4a0(0x112)]=a36_0x18f4a0(0xc0);async[a36_0x18f4a0(0x109)](_0x4a78d7){const _0x1bee4a=a36_0x18f4a0,{options:_0x25daaa,args:_0x39b5ab,tdx:_0x25697a}=_0x4a78d7,_0x21e966=_0x39b5ab[0x0];if(!_0x21e966)return console['error'](_0x1bee4a(0x12a)),console['error']('Usage:\x20tdx\x20sg\x20desc\x20<name>'),console[_0x1bee4a(0xf9)](_0x1bee4a(0xf6)),console[_0x1bee4a(0xf9)](_0x1bee4a(0x117)),console['error']('\x20\x20tdx\x20sg\x20desc\x20\x22Premium\x20Users\x22'),console[_0x1bee4a(0xf9)]('\x20\x20tdx\x20sg\x20desc\x20segments/my-audience/premium-users.yml'),0x1;try{const _0x3e354b=_0x25daaa[_0x1bee4a(0x10e)],_0x582ad6=await resolveSegmentTarget(_0x21e966,_0x3e354b,_0x25daaa[_0x1bee4a(0x130)]);_0x25daaa[_0x1bee4a(0x130)]&&console['error'](_0x1bee4a(0xb5)+_0x582ad6);const _0x18b7a2=await withSpinner(_0x1bee4a(0xd4)+_0x21e966+_0x1bee4a(0xb6),()=>_0x25697a['segment'][_0x1bee4a(0xd0)](_0x582ad6),{'verbose':_0x25daaa[_0x1bee4a(0x130)]}),_0x303c03=_0x18b7a2['data'];_0x25daaa['verbose']&&(console[_0x1bee4a(0xf9)](_0x1bee4a(0x104)+_0x303c03['type']),console[_0x1bee4a(0xf9)](_0x1bee4a(0x149)+_0x303c03[_0x1bee4a(0xef)]));if(_0x303c03[_0x1bee4a(0x129)]===_0x1bee4a(0x137))return console[_0x1bee4a(0xf9)](_0x1bee4a(0x102)),console['error']('Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.'),0x1;if(_0x303c03[_0x1bee4a(0x129)]==='parent')return console[_0x1bee4a(0xf9)]('Error:\x20Cannot\x20show\x20schema\x20for\x20parent\x20segment\x20with\x20this\x20command.'),console['error'](_0x1bee4a(0xc8)),0x1;if(!_0x303c03[_0x1bee4a(0x107)])throw new SDKError(ErrorCode[_0x1bee4a(0x127)],_0x1bee4a(0x134));const _0x4c4600=await withSpinner(_0x1bee4a(0x11d),()=>_0x25697a[_0x1bee4a(0x148)][_0x1bee4a(0xec)](_0x303c03['parentId'],_0x303c03['segmentId']),{'verbose':_0x25daaa[_0x1bee4a(0x130)]}),_0x1ee504=_0x4c4600['data'],_0x284007=await executeSchemaQuery(_0x1ee504,_0x25697a,_0x25daaa);return await handleQueryOutput(_0x284007,_0x25daaa),0x0;}catch(_0x4144c1){if(_0x4144c1 instanceof SDKError)return console['error'](_0x1bee4a(0x13a)+_0x4144c1[_0x1bee4a(0x103)]),_0x4144c1['cause']&&console[_0x1bee4a(0xf9)](_0x1bee4a(0x141)+_0x4144c1[_0x1bee4a(0xb1)]),0x1;throw _0x4144c1;}}}
@@ -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_0x5bad05=a37_0x3f6a;(function(_0x2fac67,_0x312f1b){const _0x4da66e=a37_0x3f6a,_0x1e1811=_0x2fac67();while(!![]){try{const _0x3bcd53=-parseInt(_0x4da66e(0x219))/0x1*(-parseInt(_0x4da66e(0x215))/0x2)+parseInt(_0x4da66e(0x207))/0x3+-parseInt(_0x4da66e(0x21b))/0x4*(-parseInt(_0x4da66e(0x206))/0x5)+-parseInt(_0x4da66e(0x201))/0x6+parseInt(_0x4da66e(0x225))/0x7*(-parseInt(_0x4da66e(0x216))/0x8)+-parseInt(_0x4da66e(0x218))/0x9*(-parseInt(_0x4da66e(0x21d))/0xa)+parseInt(_0x4da66e(0x1f8))/0xb;if(_0x3bcd53===_0x312f1b)break;else _0x1e1811['push'](_0x1e1811['shift']());}catch(_0x150868){_0x1e1811['push'](_0x1e1811['shift']());}}}(a37_0x3f2f,0x7fa47));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{parsePath,getParentPath,getBaseName}from'../sdk/segment/segment-path-parser.js';import a37_0x5ddb42 from'chalk';export class SegmentCreateCommand extends BaseCommand{[a37_0x5bad05(0x20b)]=a37_0x5bad05(0x21c);[a37_0x5bad05(0x1fd)]=a37_0x5bad05(0x21a);async[a37_0x5bad05(0x20c)](_0x118d49){const _0x4656db=a37_0x5bad05;console[_0x4656db(0x223)](a37_0x5ddb42[_0x4656db(0x20d)](_0x4656db(0x208))),console[_0x4656db(0x223)](a37_0x5ddb42['yellow'](_0x4656db(0x205)));const {options:_0x3befaa,args:_0x2e3d92,tdx:_0x90d0fc}=_0x118d49,_0x2f56ca=_0x3befaa;if(_0x2e3d92['length']===0x0)return console[_0x4656db(0x223)](_0x4656db(0x1f3)),console[_0x4656db(0x223)]('Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]'),console[_0x4656db(0x223)](_0x4656db(0x20f)),console[_0x4656db(0x223)](_0x4656db(0x20a)),console['error']('\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27'),console[_0x4656db(0x223)](_0x4656db(0x217)),0x1;const _0x36f98a=_0x2e3d92[0x0],_0x33c05e=_0x3befaa[_0x4656db(0x202)];let _0x412874=_0x36f98a;_0x33c05e&&!_0x36f98a[_0x4656db(0x1fb)]('/')&&(_0x412874=_0x33c05e+'/'+_0x36f98a,_0x2f56ca['verbose']&&console[_0x4656db(0x223)](_0x4656db(0x1f7)+_0x412874));const _0x567710=parsePath(_0x412874);if(_0x567710[_0x4656db(0x220)][_0x4656db(0x204)]<0x2)return console[_0x4656db(0x223)]('Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)'),console['error'](_0x4656db(0x200)),0x1;const _0x526b65=_0x567710[_0x4656db(0x220)][0x0],_0x391d3b=getBaseName(_0x412874),_0xadb161=getParentPath(_0x412874);_0x2f56ca[_0x4656db(0x222)]&&(console[_0x4656db(0x223)](_0x4656db(0x224)+_0x2f56ca[_0x4656db(0x1f4)]),console[_0x4656db(0x223)](_0x4656db(0x203)+_0x412874),console[_0x4656db(0x223)](_0x4656db(0x1fc)+_0x526b65),console[_0x4656db(0x223)](_0x4656db(0x21f)+_0x391d3b),console['error'](_0x4656db(0x21e)+_0xadb161));const _0x344f03=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x526b65+_0x4656db(0x1fe),()=>_0x90d0fc[_0x4656db(0x212)]['resolveParentId'](_0x526b65),{'verbose':_0x2f56ca['verbose']}),_0x3618ea=_0x344f03[_0x4656db(0x210)];let _0x175b51;if(_0x567710[_0x4656db(0x220)][_0x4656db(0x204)]>0x2){const _0x1aae73=await withSpinner('Resolving\x20folder\x20path\x20\x27'+_0xadb161+_0x4656db(0x1fe),()=>_0x90d0fc[_0x4656db(0x212)][_0x4656db(0x214)](_0xadb161),{'verbose':_0x2f56ca['verbose']}),_0x1de332=_0x1aae73['data'];if(_0x1de332['type']!==_0x4656db(0x1f6)&&_0x1de332['type']!=='parent')return console['error'](_0x4656db(0x226)),0x1;_0x175b51=_0x1de332[_0x4656db(0x213)];}else{if(_0x2f56ca[_0x4656db(0x1f6)]){const _0x58bf3c=await withSpinner('Resolving\x20folder\x20\x27'+_0x2f56ca[_0x4656db(0x1f6)]+'\x27...',()=>_0x90d0fc[_0x4656db(0x212)][_0x4656db(0x1f9)](_0x3618ea,_0x2f56ca[_0x4656db(0x1f6)]),{'verbose':_0x2f56ca[_0x4656db(0x222)]});_0x175b51=_0x58bf3c[_0x4656db(0x210)];}}_0x2f56ca[_0x4656db(0x222)]&&_0x175b51&&console['error']('Resolved\x20folder\x20ID:\x20'+_0x175b51);const _0x150afc=await loadJSONFromOptions(_0x2f56ca[_0x4656db(0x1f5)],_0x2f56ca[_0x4656db(0x221)]),_0x2d328f={'name':_0x391d3b,'description':_0x2f56ca['description'],'rule':_0x150afc,'kind':_0x2f56ca[_0x4656db(0x20e)]!==undefined?parseInt(_0x2f56ca[_0x4656db(0x20e)],0xa):undefined,'isVisible':_0x2f56ca[_0x4656db(0x209)]?![]:undefined,'segmentFolderId':_0x175b51,'countPopulation':_0x2f56ca[_0x4656db(0x1ff)]?![]:undefined},_0x144550=await withSpinner(_0x4656db(0x211)+_0x391d3b+'\x27...',()=>_0x90d0fc['segment']['createSegment'](_0x3618ea,_0x2d328f),{'verbose':_0x2f56ca[_0x4656db(0x222)]}),_0x3be258=_0x144550['data'];return console[_0x4656db(0x223)]('βœ”\x20Created\x20segment\x20\x27'+_0x3be258[_0x4656db(0x20b)]+_0x4656db(0x1fa)+_0x3be258['id']),_0x412874!==_0x36f98a&&console['error']('\x20\x20\x20Path:\x20'+_0x412874),await handleSDKOutput([_0x3be258],_0x2f56ca),0x0;}}function a37_0x3f6a(_0x46caba,_0x48185b){_0x46caba=_0x46caba-0x1f3;const _0x3f2fa2=a37_0x3f2f();let _0x3f6aba=_0x3f2fa2[_0x46caba];return _0x3f6aba;}function a37_0x3f2f(){const _0x31d2cd=['Creating\x20segment\x20\x27','segment','folderId','resolvePathToResource','388GqmPGg','56koYMoK','\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','56187ZKInzR','697pGElBe','Create\x20child\x20segment\x20with\x20filtering\x20rules','20OQjfDu','segment:create','350xzQLgX','Parent\x20path:\x20','Segment\x20name:\x20','segments','ruleFile','verbose','error','Site:\x20','1033375gnUcLc','Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','site','rule','folder','Resolved\x20relative\x20path\x20to:\x20','8815730MCXypw','resolveFolderId','\x27\x20with\x20ID:\x20','includes','Parent:\x20','description','\x27...','noCountPopulation','Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]','2857788lXYRBz','segmentPath','Target\x20path:\x20','length','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','851795IswbbM','76644ttTqzz','⚠\x20Deprecation\x20warning:\x20`segment\x20create`\x20is\x20deprecated.','invisible','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27','name','execute','yellow','kind','Examples:','data'];a37_0x3f2f=function(){return _0x31d2cd;};return a37_0x3f2f();}
@@ -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_0x23aac3=a38_0x832f;(function(_0x3dd15a,_0x203778){const _0x9ed784=a38_0x832f,_0x44c010=_0x3dd15a();while(!![]){try{const _0x458896=parseInt(_0x9ed784(0x1b7))/0x1+parseInt(_0x9ed784(0x1a5))/0x2*(-parseInt(_0x9ed784(0x1af))/0x3)+parseInt(_0x9ed784(0x1b9))/0x4*(-parseInt(_0x9ed784(0x1a3))/0x5)+parseInt(_0x9ed784(0x1ba))/0x6+-parseInt(_0x9ed784(0x1b8))/0x7*(-parseInt(_0x9ed784(0x1a4))/0x8)+-parseInt(_0x9ed784(0x1bb))/0x9+parseInt(_0x9ed784(0x1b3))/0xa*(parseInt(_0x9ed784(0x1ad))/0xb);if(_0x458896===_0x203778)break;else _0x44c010['push'](_0x44c010['shift']());}catch(_0x58a856){_0x44c010['push'](_0x44c010['shift']());}}}(a38_0x1398,0xc4c2b));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';function a38_0x1398(){const _0x149365=['547712wLMCrT','json','3JqLohO','verbose','error','List\x20available\x20fields\x20for\x20segmentation','320HksdxS','Error:\x20Parent\x20segment\x20name\x20is\x20required','site','length','426090AxWsQD','1119916BwqBQQ','4crLLqZ','4191108BgHNYN','9463464MjFLAy','description','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','parentSegment','jsonl','segment','5336795AATBwv','80dLhnFR','2786092RntRDr','Parent\x20segment:\x20','\x27...','execute','Usage:\x20tdx\x20segment\x20fields\x20<parent_name>','name','data','Listing\x20fields\x20for\x20\x27'];a38_0x1398=function(){return _0x149365;};return a38_0x1398();}function a38_0x832f(_0x5ca459,_0xe8ee2b){_0x5ca459=_0x5ca459-0x19f;const _0x1398f0=a38_0x1398();let _0x832feb=_0x1398f0[_0x5ca459];return _0x832feb;}import{displayFieldsHumanReadable}from'../sdk/segment/fields-display.js';export class SegmentFieldsCommand extends BaseCommand{[a38_0x23aac3(0x1aa)]='segment:fields';[a38_0x23aac3(0x1bc)]=a38_0x23aac3(0x1b2);async[a38_0x23aac3(0x1a8)](_0x10fe73){const _0xc0fcae=a38_0x23aac3,{options:_0x1d7873,args:_0x2c52b,tdx:_0x22230b}=_0x10fe73,_0x5c90fb=_0x2c52b[0x0]||_0x1d7873[_0xc0fcae(0x1a0)];if(!_0x5c90fb)return console[_0xc0fcae(0x1b1)](_0xc0fcae(0x1b4)),console[_0xc0fcae(0x1b1)](_0xc0fcae(0x1a9)),console['error'](_0xc0fcae(0x19f)),0x1;_0x1d7873[_0xc0fcae(0x1b0)]&&(console[_0xc0fcae(0x1b1)]('Site:\x20'+_0x1d7873[_0xc0fcae(0x1b5)]),console[_0xc0fcae(0x1b1)](_0xc0fcae(0x1a6)+_0x5c90fb));const _0x27ff44=await withSpinner(_0xc0fcae(0x1ac)+_0x5c90fb+_0xc0fcae(0x1a7),()=>_0x22230b[_0xc0fcae(0x1a2)]['listFields'](_0x5c90fb),{'verbose':_0x1d7873['verbose']}),_0x40e626=_0x27ff44[_0xc0fcae(0x1ab)];console[_0xc0fcae(0x1b1)]('βœ”\x20Found\x20'+_0x40e626[_0xc0fcae(0x1b6)]+'\x20field'+(_0x40e626[_0xc0fcae(0x1b6)]!==0x1?'s':''));if(_0x1d7873[_0xc0fcae(0x1ae)]||_0x1d7873[_0xc0fcae(0x1a1)])return await handleSDKOutput(_0x40e626,_0x1d7873),0x0;return displayFieldsHumanReadable(_0x40e626,_0x5c90fb),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_0x1d3919=a39_0x6443;(function(_0x39c4ab,_0x35996f){const _0x3adc40=a39_0x6443,_0x3c3a02=_0x39c4ab();while(!![]){try{const _0x1526d4=parseInt(_0x3adc40(0x108))/0x1+parseInt(_0x3adc40(0x12a))/0x2+-parseInt(_0x3adc40(0x117))/0x3*(parseInt(_0x3adc40(0x119))/0x4)+-parseInt(_0x3adc40(0x104))/0x5*(parseInt(_0x3adc40(0x135))/0x6)+-parseInt(_0x3adc40(0x101))/0x7+parseInt(_0x3adc40(0x130))/0x8+-parseInt(_0x3adc40(0x120))/0x9;if(_0x1526d4===_0x35996f)break;else _0x3c3a02['push'](_0x3c3a02['shift']());}catch(_0x3ed14b){_0x3c3a02['push'](_0x3c3a02['shift']());}}}(a39_0x3086,0x7de05));function a39_0x3086(){const _0x3e1221=['error','helpText','\x20unchanged\x20files','relativePath','\x20files\x20to\x20','βœ”\x20Context\x20set:\x20','yes','counts','βœ”\x20All\x20files\x20are\x20up\x20to\x20date','errorCode','utf-8','name','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','-\x20no\x20files\x20written','45kFkiOK','segment','152696iQPfNn','targetDir','session','repeat','filter','\x20\x20πŸ—ΊοΈ\x20\x20','Write\x20','294813cvIexH','parentSegment','Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files','description','Aborted.','yellow','parent_segment','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent','journeys','activations','1331882ITpiKX','absolutePath','\x20files?','journeyVersions','site','hasChanges','7992176rGRJcR','pullSegments','\x20new\x20files','\x0aPull\x20summary\x20for\x20\x27','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','366054BmIXKd','green','files','Pulling\x20segments\x20from\x20\x27','isNew','content','\x20with\x20','segments','red','No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27','resourceName','\x20=\x20','Usage:\x20tdx\x20sg\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20(requires\x20context\x20or\x20tdx.json)','βœ”\x20Pulled\x20','\x20segments','\x20\x20Target:\x20','message','parentName','\x20changed\x20files','Error:\x20','length','execute','Site:\x20','cyan','dim','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','7037044aDRFLf','diff','verbose','5HVsgId','no_parent','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file','522294lzlJmb'];a39_0x3086=function(){return _0x3e1221;};return a39_0x3086();}import{BaseCommand}from'./command.js';function a39_0x6443(_0x4a1d77,_0x2db33b){_0x4a1d77=_0x4a1d77-0xfb;const _0x3086a4=a39_0x3086();let _0x644372=_0x3086a4[_0x4a1d77];return _0x644372;}import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{saveSessionContext}from'../core/session.js';import a39_0x598b3e from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';import a39_0x73862e 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{[a39_0x1d3919(0x114)]='segment:pull';[a39_0x1d3919(0x123)]=a39_0x1d3919(0x122);async[a39_0x1d3919(0xfc)](_0x55aa1c){const _0xcfb361=a39_0x1d3919,{options:_0x3c6448,args:_0x1459d7,tdx:_0x52f4ee}=_0x55aa1c,_0xad67bd=_0x3c6448,_0x495aa1=await resolveTarget({'arg':_0x1459d7[0x0],'contextParent':_0x3c6448[_0xcfb361(0x121)],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x495aa1))return _0x495aa1[_0xcfb361(0x112)]===_0xcfb361(0x105)?(console[_0xcfb361(0x109)](a39_0x598b3e['yellow'](_0xcfb361(0x106))),console[_0xcfb361(0x109)](_0xcfb361(0x141)),console['error'](_0xcfb361(0x127)),console['error'](_0xcfb361(0x107))):(console[_0xcfb361(0x109)](a39_0x598b3e[_0xcfb361(0x13d)](_0xcfb361(0x148)+_0x495aa1[_0xcfb361(0x145)]+'\x0a')),_0x495aa1[_0xcfb361(0x10a)]&&console['error'](a39_0x598b3e[_0xcfb361(0xfe)](_0x495aa1[_0xcfb361(0x10a)]))),0x1;const _0x32a4a0=_0x495aa1[_0xcfb361(0x146)],_0xe0fe5e=_0x495aa1[_0xcfb361(0x11a)],_0x30c553=_0x495aa1['type']==='file'?_0x495aa1[_0xcfb361(0x13f)]:undefined;_0xad67bd[_0xcfb361(0x103)]&&(console[_0xcfb361(0x109)](_0xcfb361(0xfd)+_0xad67bd[_0xcfb361(0x12e)]),console[_0xcfb361(0x109)]('Parent\x20segment:\x20'+_0x32a4a0),_0x30c553&&console[_0xcfb361(0x109)]('Target\x20resource:\x20'+_0x30c553));const _0x2c59b7=await withProgressSpinner(_0xcfb361(0x138)+_0x32a4a0+'\x27...',_0x578e2c=>_0x52f4ee[_0xcfb361(0x118)][_0xcfb361(0x131)](_0x32a4a0,{'targetDir':_0xe0fe5e,'targetResourceName':_0x30c553,'verbose':_0xad67bd['verbose'],'progress':{'update':_0x10652b=>{const _0x32e856=_0xcfb361;_0x578e2c['setPhase'](_0x10652b),_0xad67bd[_0x32e856(0x103)]&&console['error']('\x20\x20'+_0x10652b);}}}),{'verbose':_0xad67bd[_0xcfb361(0x103)]}),_0x36fdce=_0x2c59b7['data'];if(_0x36fdce[_0xcfb361(0x110)][_0xcfb361(0x13c)]===0x0&&_0x36fdce[_0xcfb361(0x110)][_0xcfb361(0x128)]===0x0)return console[_0xcfb361(0x109)](a39_0x598b3e[_0xcfb361(0x125)](_0xcfb361(0x13e)+_0x36fdce[_0xcfb361(0x146)]+'\x27')),0x0;const _0x335f2e=_0x36fdce['files']['filter'](_0x2e638a=>_0x2e638a['isNew']),_0x4bf40c=_0x36fdce['files'][_0xcfb361(0x11d)](_0x106f4c=>!_0x106f4c[_0xcfb361(0x139)]&&_0x106f4c[_0xcfb361(0x12f)]),_0x2a342d=_0x36fdce['files'][_0xcfb361(0x11d)](_0x4b5f07=>!_0x4b5f07[_0xcfb361(0x139)]&&!_0x4b5f07['hasChanges']);console[_0xcfb361(0x109)](_0xcfb361(0x133)+_0x36fdce[_0xcfb361(0x146)]+'\x27:'),console['error']('\x20\x20🎯\x20'+a39_0x598b3e['cyan'](_0x36fdce[_0xcfb361(0x110)][_0xcfb361(0x13c)]+_0xcfb361(0x143))+_0xcfb361(0x13b)+a39_0x598b3e[_0xcfb361(0xfe)](_0x36fdce[_0xcfb361(0x110)][_0xcfb361(0x129)]+'\x20activations'));if(_0x36fdce[_0xcfb361(0x110)][_0xcfb361(0x128)]>0x0){const _0x514a1d=_0x36fdce[_0xcfb361(0x110)][_0xcfb361(0x12d)]>_0x36fdce['counts'][_0xcfb361(0x128)]?'\x20('+_0x36fdce[_0xcfb361(0x110)][_0xcfb361(0x12d)]+'\x20versions)':'';console[_0xcfb361(0x109)](_0xcfb361(0x11e)+a39_0x598b3e[_0xcfb361(0xfe)](_0x36fdce[_0xcfb361(0x110)][_0xcfb361(0x128)]+'\x20journeys')+a39_0x598b3e[_0xcfb361(0xff)](_0x514a1d));}console['error']('\x20\x20'+a39_0x598b3e['green']('+\x20'+_0x335f2e[_0xcfb361(0xfb)]+_0xcfb361(0x132))),console[_0xcfb361(0x109)]('\x20\x20'+a39_0x598b3e[_0xcfb361(0x125)]('~\x20'+_0x4bf40c[_0xcfb361(0xfb)]+_0xcfb361(0x147))),console[_0xcfb361(0x109)]('\x20\x20'+a39_0x598b3e['dim']('=\x20'+_0x2a342d[_0xcfb361(0xfb)]+_0xcfb361(0x10b))),console[_0xcfb361(0x109)](_0xcfb361(0x144)+a39_0x598b3e['cyan'](_0x36fdce['targetDir'])+'\x0a');if(_0x4bf40c[_0xcfb361(0xfb)]>0x0)for(const _0x576b00 of _0x4bf40c){console[_0xcfb361(0x109)]('\x0aChanges\x20to\x20\x27'+_0x576b00[_0xcfb361(0x10c)]+'\x27:'),console[_0xcfb361(0x109)]('─'[_0xcfb361(0x11c)](0x3c)),console['error'](_0x576b00[_0xcfb361(0x102)]),console[_0xcfb361(0x109)]('─'['repeat'](0x3c));}if(_0xad67bd['dryRun'])return console[_0xcfb361(0x109)](a39_0x598b3e[_0xcfb361(0x125)](_0xcfb361(0x134))),0x0;if(_0x335f2e[_0xcfb361(0xfb)]===0x0&&_0x4bf40c['length']===0x0)return console[_0xcfb361(0x109)](a39_0x598b3e[_0xcfb361(0x136)](_0xcfb361(0x111))),saveSessionContext({'parent_segment':_0x36fdce[_0xcfb361(0x146)]},_0xad67bd[_0xcfb361(0x11b)]),console['error'](a39_0x598b3e[_0xcfb361(0x136)]('βœ”\x20Context\x20set:\x20'+a39_0x598b3e[_0xcfb361(0xff)](_0xcfb361(0x126))+_0xcfb361(0x140)+a39_0x598b3e[_0xcfb361(0xfe)](_0x36fdce[_0xcfb361(0x146)]))),0x0;if(!_0xad67bd[_0xcfb361(0x10f)]){if(!isInteractive())return console[_0xcfb361(0x109)](a39_0x598b3e[_0xcfb361(0x13d)]('\x0aError:'),_0xcfb361(0x100)),console[_0xcfb361(0x109)](a39_0x598b3e['dim'](_0xcfb361(0x115))),0x1;const _0x46ee57=await confirmKey(_0xcfb361(0x11f)+(_0x335f2e[_0xcfb361(0xfb)]+_0x4bf40c[_0xcfb361(0xfb)])+_0xcfb361(0x12c));if(!_0x46ee57)return console[_0xcfb361(0x109)](a39_0x598b3e['yellow'](_0xcfb361(0x124)),_0xcfb361(0x116)),0x1;}for(const _0x3a241e of _0x36fdce[_0xcfb361(0x137)]){if(_0x3a241e[_0xcfb361(0x139)]||_0x3a241e['hasChanges']){const _0x5df194=a39_0x73862e['dirname'](_0x3a241e['absolutePath']);!existsSync(_0x5df194)&&mkdirSync(_0x5df194,{'recursive':!![]}),writeFileSync(_0x3a241e[_0xcfb361(0x12b)],_0x3a241e[_0xcfb361(0x13a)],_0xcfb361(0x113));}}return console[_0xcfb361(0x109)](a39_0x598b3e[_0xcfb361(0x136)](_0xcfb361(0x142)+(_0x335f2e['length']+_0x4bf40c[_0xcfb361(0xfb)])+_0xcfb361(0x10d)+_0x36fdce[_0xcfb361(0x11a)])),saveSessionContext({'parent_segment':_0x36fdce[_0xcfb361(0x146)]},_0xad67bd[_0xcfb361(0x11b)]),console['error'](a39_0x598b3e[_0xcfb361(0x136)](_0xcfb361(0x10e)+a39_0x598b3e[_0xcfb361(0xff)]('parent_segment')+_0xcfb361(0x140)+a39_0x598b3e[_0xcfb361(0xfe)](_0x36fdce[_0xcfb361(0x146)]))),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_0x3b97bb=a40_0x584d;(function(_0x1407de,_0x47e359){const _0x3d104e=a40_0x584d,_0x2c8169=_0x1407de();while(!![]){try{const _0x12564c=parseInt(_0x3d104e(0xe4))/0x1+-parseInt(_0x3d104e(0x135))/0x2+parseInt(_0x3d104e(0xf7))/0x3*(parseInt(_0x3d104e(0x11d))/0x4)+-parseInt(_0x3d104e(0x12c))/0x5+parseInt(_0x3d104e(0xf0))/0x6+-parseInt(_0x3d104e(0xf2))/0x7+parseInt(_0x3d104e(0x120))/0x8;if(_0x12564c===_0x47e359)break;else _0x2c8169['push'](_0x2c8169['shift']());}catch(_0x470c30){_0x2c8169['push'](_0x2c8169['shift']());}}}(a40_0x372c,0xda6c7));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_0x1cabe2 from'chalk';import{existsSync}from'fs';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';function a40_0x584d(_0xd35120,_0x7289d5){_0xd35120=_0xd35120-0xcf;const _0x372c64=a40_0x372c();let _0x584d5b=_0x372c64[_0xd35120];return _0x584d5b;}function a40_0x372c(){const _0x35243d=['parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','changed','toDelete','toUpdate','audienceId','results','Error:\x20Directory\x20not\x20found:\x20','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','relationships','\x20new','green','Error\x20parsing\x20YAML:\x20','segment','dim','map','\x20deleted','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','new','delete','toCreate','/e/','cwd','set','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','blue','add','existingJourney','no_parent','Fetching\x20existing\x20data...','/sb/da/esr','\x20unchanged','error','journeyBundleName','Parent\x20segment:\x20','message','New\x20journey:','journeyBundleId','Folders\x20to\x20create:','targetDir','folderPath','existingSegment','updatedAt','39000mhoJZq','yamlConfig','connection','idToName','diff','buildUserMaps','\x0aError:','filter','\x20\x20πŸ—ΊοΈ\x20\x20Journeys:','unchanged','state','journeys','5146014HAUjCw','repeat','12098051uywWNX','\x0aPush\x20summary\x20for\x20\x27','parent_name','file','segment:push','57ajzAih','errorCode','\x27...','parentSegment','helpText','\x0aValidation\x20failed:','user','\x20\x20Segments:\x20','\x0aβœ”\x20Push\x20complete','listSegments','\x20\x20Source:\x20','yellow','endsWith','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','.yaml','\x20created','getParent','segments','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','activations','resolveParentId','nameToType','Changes\x20to\x20journey:','(Journey\x20will\x20be\x20deleted)','description','listJourneysWithDetailsFromParentSegment','join','site','nameToId','\x20\x20Journeys:\x20','cyan','\x20to\x20update','segmentFolderId','\x20changes?','\x20activations]','get','createdSegmentIds','folders','97772eQwsdV','/j/da/je','Error:\x20','20072520obVAEf','journey','parentFolder','scopedFolderPath','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','yes','push','\x20to\x20create','updated','createdAt','created','Aborted.','2742920SNVlhV','Preparing\x20journeys...','\x20to\x20delete','deleted','getOutputSchemaWithCache','red','folderId','execute','list','1397222CYiCNs','\x20changed','journeyId','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','\x20\x20Activations:\x20','journeysOnly','\x20\x20\x20\x20','\x20YAML\x20files\x20found','listActivations','\x20updated','Fetching\x20connections\x20for\x20name\x20resolution...','length','data','then','isNew','Push\x20','Delete\x20segment:','parentName','all','attributes','paused','verbose','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','type','\x20\x20πŸ“Š\x20Segments:','Site:\x20','\x20folders\x20to\x20create','\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20','name','/app/ps/','isScoped'];a40_0x372c=function(){return _0x35243d;};return a40_0x372c();}import{resolveTarget,isSuccessfulResolution,getScopedDetails}from'../sdk/segment/target-resolution.js';import{buildFolderMaps}from'../sdk/segment/resolution-context.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{resolveTDFolderPath,findSegmentsToDelete,findJourneysToDelete,buildSegmentLookupMap,buildSegmentNameToIdMap,buildJourneyBundleLookupMap,parseAndClassifyYamlFiles,validateParsedFiles,formatValidationErrors,extractRootFolderId,buildConnectionMaps,calculatePushStats,prepareSegmentFiles,prepareJourneyFiles,executePushSegments,executePushFolders,executePushSegmentDeletions,executePushJourneys}from'../sdk/segment/push-workflow.js';export class SegmentPushCommand extends BaseCommand{['name']=a40_0x3b97bb(0xf6);['description']=a40_0x3b97bb(0x165);async[a40_0x3b97bb(0x133)](_0x513747){const _0x2c20f0=a40_0x3b97bb,{options:_0x3d184b,args:_0x4d5483,tdx:_0x557ce8}=_0x513747,_0x4d607b=_0x3d184b,_0x3827b2=await resolveTarget({'arg':_0x4d5483[0x0],'contextParent':_0x3d184b[_0x2c20f0(0xfa)],'cwd':process[_0x2c20f0(0xcf)]()});if(!isSuccessfulResolution(_0x3827b2))return _0x3827b2[_0x2c20f0(0xf8)]===_0x2c20f0(0xd5)?(console['error'](a40_0x1cabe2['yellow'](_0x2c20f0(0x154))),console[_0x2c20f0(0xd9)]('Usage:\x20tdx\x20sg\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20(requires\x20context)'),console[_0x2c20f0(0xd9)](_0x2c20f0(0x138)),console['error']('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file')):(console[_0x2c20f0(0xd9)](a40_0x1cabe2[_0x2c20f0(0x131)](_0x2c20f0(0x11f)+_0x3827b2[_0x2c20f0(0xdc)]+'\x0a')),_0x3827b2[_0x2c20f0(0xfb)]&&console[_0x2c20f0(0xd9)](a40_0x1cabe2[_0x2c20f0(0x115)](_0x3827b2[_0x2c20f0(0xfb)]))),0x1;if(_0x3827b2['type']===_0x2c20f0(0xf4))return console['error'](a40_0x1cabe2[_0x2c20f0(0x131)]('Error:\x20Directory\x20not\x20found:\x20'+_0x3827b2[_0x2c20f0(0xe0)]+'\x0a')),console['error'](a40_0x1cabe2[_0x2c20f0(0x115)]('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;const _0x335dd5=_0x3827b2[_0x2c20f0(0x146)],_0x2b94e8=_0x3827b2[_0x2c20f0(0xe0)],_0x95b67=_0x3827b2[_0x2c20f0(0x14c)]===_0x2c20f0(0xf5)?_0x3827b2['filePath']:undefined,_0x4f2b7e=getScopedDetails(_0x3827b2),_0x32d3e3=_0x4f2b7e?.[_0x2c20f0(0x153)]??![],_0x43daab=_0x4f2b7e?.[_0x2c20f0(0x123)]??'';if(!existsSync(_0x2b94e8))return console[_0x2c20f0(0xd9)](a40_0x1cabe2['red'](_0x2c20f0(0x15a)+_0x2b94e8+'\x0a')),console[_0x2c20f0(0xd9)](a40_0x1cabe2[_0x2c20f0(0x115)](_0x2c20f0(0x164))),0x1;_0x4d607b[_0x2c20f0(0x14a)]&&(console[_0x2c20f0(0xd9)](_0x2c20f0(0x14e)+_0x4d607b[_0x2c20f0(0x112)]),console[_0x2c20f0(0xd9)](_0x2c20f0(0xdb)+_0x335dd5),console[_0x2c20f0(0xd9)]('Source\x20directory:\x20'+_0x2b94e8),_0x32d3e3&&console[_0x2c20f0(0xd9)]('Scoped\x20to\x20folder:\x20'+_0x43daab));const _0x299193=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x335dd5+_0x2c20f0(0xf9),()=>_0x557ce8[_0x2c20f0(0x160)][_0x2c20f0(0x10b)](_0x335dd5),{'verbose':_0x4d607b[_0x2c20f0(0x14a)]}),_0x6b9fa3=_0x299193[_0x2c20f0(0x141)],{parentSegmentResult:_0x3f8deb,segmentsResult:_0x2e177a,foldersResult:_0x46a74e,journeysWithDetailsResult:_0x346ae3,userMaps:_0x16a605}=await withSpinner(_0x2c20f0(0xd6),async()=>{const _0x29515b=_0x2c20f0,[_0x3ad3b2,_0x57d81d,_0x3fa835,_0x76e4c4,_0x4de838]=await Promise[_0x29515b(0x147)]([_0x557ce8['segment'][_0x29515b(0x107)](_0x6b9fa3),_0x557ce8[_0x29515b(0x160)][_0x29515b(0x100)](_0x6b9fa3),_0x557ce8['segment']['listFolders'](_0x6b9fa3),_0x557ce8[_0x29515b(0x121)][_0x29515b(0x110)](_0x6b9fa3,{'includeAllVersions':!![]}),_0x557ce8[_0x29515b(0xfd)][_0x29515b(0xe9)]()]);return{'parentSegmentResult':_0x3ad3b2,'segmentsResult':_0x57d81d,'foldersResult':_0x3fa835,'journeysWithDetailsResult':_0x76e4c4,'userMaps':_0x4de838};},{'verbose':_0x4d607b[_0x2c20f0(0x14a)]})[_0x2c20f0(0x142)](_0x2749d9=>_0x2749d9[_0x2c20f0(0x141)]),_0x5c89a6=_0x3f8deb,_0x3fe99f=extractRootFolderId(_0x5c89a6),_0xd8603b=_0x2e177a,_0xacb869=_0x46a74e,{journeys:_0x4a2607,activationStepsById:_0x3c442e}=_0x346ae3,_0x2a9881=new Map(_0x4a2607[_0x2c20f0(0x162)](_0x4211a0=>[_0x4211a0['id'],_0x4211a0])),_0x338716=_0x4a2607[_0x2c20f0(0x162)](_0x46b423=>({'id':_0x46b423['id'],'name':_0x46b423[_0x2c20f0(0x148)][_0x2c20f0(0x151)],'journeyBundleName':_0x46b423[_0x2c20f0(0x148)][_0x2c20f0(0xda)]||'','journeyBundleId':_0x46b423[_0x2c20f0(0x148)][_0x2c20f0(0xde)]||'','versionNumber':_0x46b423[_0x2c20f0(0x148)]['versionNumber'],'description':_0x46b423['attributes'][_0x2c20f0(0x10f)],'state':_0x46b423[_0x2c20f0(0x148)][_0x2c20f0(0xee)],'paused':_0x46b423[_0x2c20f0(0x148)][_0x2c20f0(0x149)],'audienceId':_0x46b423[_0x2c20f0(0x148)][_0x2c20f0(0x158)],'folderId':_0x46b423[_0x2c20f0(0x15c)]?.[_0x2c20f0(0x122)]?.[_0x2c20f0(0x141)]?.['id'],'createdAt':_0x46b423[_0x2c20f0(0x148)][_0x2c20f0(0x129)],'updatedAt':_0x46b423[_0x2c20f0(0x148)][_0x2c20f0(0xe3)]})),{emailToId:_0x51ee8a,idToEmail:_0x1222e0}=_0x16a605,_0x90856c=await withSpinner(_0x2c20f0(0x13f),async()=>{const _0x9c1b9=_0x2c20f0,_0x36178d=await _0x557ce8[_0x9c1b9(0xe6)][_0x9c1b9(0x134)]();return buildConnectionMaps(_0x36178d);},{'verbose':_0x4d607b[_0x2c20f0(0x14a)]})['then'](_0x447858=>_0x447858[_0x2c20f0(0x141)]),_0x2fb347=_0x90856c[_0x2c20f0(0x113)],_0x1fc89c=_0x90856c['idToName'],_0xc8bf87=_0x90856c[_0x2c20f0(0x10c)],_0x2f8d94={'emailToIdMap':_0x51ee8a,'connectionNameToIdMap':_0x2fb347,'connectionNameToTypeMap':_0xc8bf87,'getSchema':_0x4fc605=>_0x557ce8['connection'][_0x2c20f0(0x130)](_0x4fc605)};let {pathToId:_0x5d7bd6,idToPath:_0x19d30f}=buildFolderMaps(_0xacb869);const _0x31e17f=buildSegmentLookupMap(_0xd8603b,_0x19d30f),_0x404b25=buildSegmentNameToIdMap(_0xd8603b),_0x4c77e7=buildJourneyBundleLookupMap(_0x338716,_0x19d30f);let _0x2054bd;if(_0x95b67){if(!_0x95b67[_0x2c20f0(0x103)]('.yml')&&!_0x95b67['endsWith'](_0x2c20f0(0x105)))return console['error'](a40_0x1cabe2['red']('Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20'+_0x95b67+'\x0a')),0x1;_0x2054bd=[_0x95b67];}else _0x2054bd=findYamlFiles(_0x2b94e8);if(_0x2054bd[_0x2c20f0(0x140)]===0x0)return console[_0x2c20f0(0xd9)](a40_0x1cabe2[_0x2c20f0(0x131)](_0x2c20f0(0x15b)+_0x2b94e8+'\x0a')),console['error'](a40_0x1cabe2['cyan'](_0x2c20f0(0x109))),0x1;let _0x33a480,_0x737ea9;try{const _0x1e9c01=parseAndClassifyYamlFiles(_0x2054bd,_0x2b94e8,{'skipSegments':_0x4d607b[_0x2c20f0(0x13a)]});_0x33a480=_0x1e9c01[_0x2c20f0(0x108)],_0x737ea9=_0x1e9c01['journeys'];const _0x5c4eb2=validateParsedFiles(_0x1e9c01,_0x2b94e8);if(_0x5c4eb2[_0x2c20f0(0x140)]>0x0)return console[_0x2c20f0(0xd9)](a40_0x1cabe2[_0x2c20f0(0x131)](_0x2c20f0(0xfc))),console[_0x2c20f0(0xd9)](formatValidationErrors(_0x5c4eb2)),console[_0x2c20f0(0xd9)](a40_0x1cabe2[_0x2c20f0(0x102)](_0x2c20f0(0x104))),0x1;}catch(_0x232b63){return console[_0x2c20f0(0xd9)](a40_0x1cabe2['red'](_0x2c20f0(0x15f)+(_0x232b63 instanceof Error?_0x232b63['message']:_0x232b63))),0x1;}if(_0x33a480[_0x2c20f0(0x140)]===0x0&&_0x737ea9[_0x2c20f0(0x140)]===0x0){const _0x202f35=_0x4d607b[_0x2c20f0(0x13a)]?'journey':'segment\x20or\x20journey';return console['error'](a40_0x1cabe2[_0x2c20f0(0x102)]('No\x20'+_0x202f35+_0x2c20f0(0x13c))),0x0;}const _0x4a946d=new Map();_0xd8603b[_0x2c20f0(0x140)]>0x0&&!_0x4d607b[_0x2c20f0(0x13a)]&&await withSpinner('Fetching\x20existing\x20activations...',async()=>{await batchAsync(_0xd8603b,async _0xdd39ac=>{const _0x444696=a40_0x584d,_0x5e0c0a=await _0x557ce8[_0x444696(0x160)][_0x444696(0x13d)](_0x6b9fa3,_0xdd39ac['id']);_0x4a946d[_0x444696(0xd0)](_0xdd39ac['id'],_0x5e0c0a);});},{'verbose':_0x4d607b['verbose']});const {segmentFiles:_0x56f87b,foldersToCreate:_0x29d74a}=await prepareSegmentFiles(_0x33a480,{'segmentByFolderAndName':_0x31e17f,'activationsBySegmentId':_0x4a946d,'folderPathToId':_0x5d7bd6,'idToEmailMap':_0x1222e0,'connectionIdToNameMap':_0x1fc89c},_0x2f8d94,_0x32d3e3,_0x43daab),_0x57572b=_0x95b67?[]:findSegmentsToDelete(_0xd8603b,_0x33a480[_0x2c20f0(0x162)](({yamlConfig:_0x4cb676,folderPath:_0xab26c6})=>({'yamlConfig':_0x4cb676,'folderPath':resolveTDFolderPath(_0xab26c6,_0x32d3e3,_0x43daab)})),_0x19d30f,_0x43daab,_0x32d3e3),{journeyFiles:_0x5a0e7e,foldersToCreate:_0x58cb15}=await withProgressSpinner(_0x2c20f0(0x12d),async _0x4e6499=>prepareJourneyFiles(_0x737ea9,{'fetchJourney':async _0x2df6ff=>_0x557ce8[_0x2c20f0(0x121)]['getJourney'](_0x2df6ff[_0x2c20f0(0x137)]),'journeyBundlesByFolderAndName':_0x4c77e7,'folderPathToId':_0x5d7bd6,'idToEmailMap':_0x1222e0,'connectionIdToNameMap':_0x1fc89c,'existingSegments':_0xd8603b,'parentId':_0x6b9fa3,'deps':_0x557ce8,'progress':{'update':_0x3545e6=>{const _0x556ea3=_0x2c20f0;_0x4e6499['setPhase'](_0x3545e6),_0x4d607b[_0x556ea3(0x14a)]&&console['error']('\x20\x20'+_0x3545e6);}},'journeyById':_0x2a9881,'activationStepsById':_0x3c442e},_0x32d3e3,_0x43daab),{'verbose':_0x4d607b['verbose']})[_0x2c20f0(0x142)](_0x2d2eb5=>_0x2d2eb5[_0x2c20f0(0x141)]);for(const _0x245067 of _0x58cb15){_0x29d74a[_0x2c20f0(0xd3)](_0x245067);}const _0x49426a=_0x95b67?[]:findJourneysToDelete(_0x338716,_0x737ea9['map'](({yamlConfig:_0x122f9b,folderPath:_0x5c2015})=>({'yamlConfig':_0x122f9b,'folderPath':resolveTDFolderPath(_0x5c2015,_0x32d3e3,_0x43daab)})),_0x19d30f,_0x43daab,_0x32d3e3),_0x11badf=calculatePushStats(_0x56f87b,_0x5a0e7e,_0x29d74a,_0x57572b,_0x49426a,!!_0x4d607b[_0x2c20f0(0x167)],!!_0x4d607b[_0x2c20f0(0x13a)]),_0x5464ca=_0x11badf['segments'][_0x2c20f0(0x166)],_0x2ed1c1=_0x11badf[_0x2c20f0(0x108)][_0x2c20f0(0x155)],_0x4e3810=_0x11badf[_0x2c20f0(0x108)][_0x2c20f0(0xed)],_0x514386=_0x11badf[_0x2c20f0(0x108)][_0x2c20f0(0x156)],_0x5f40d5=_0x11badf[_0x2c20f0(0x11c)][_0x2c20f0(0x168)],_0x1317ca=_0x11badf['journeys']['new'],_0x1746c7=_0x11badf[_0x2c20f0(0xef)][_0x2c20f0(0x155)],_0x535e6d=_0x11badf['journeys']['unchanged'],_0xc2afb1=_0x11badf[_0x2c20f0(0xef)][_0x2c20f0(0x156)],_0x17899c=_0x11badf[_0x2c20f0(0x10a)][_0x2c20f0(0x147)],_0x52c734=_0x11badf[_0x2c20f0(0x10a)]['toCreate'],_0x430467=_0x11badf['activations'][_0x2c20f0(0x157)],_0x21fc15=_0x11badf[_0x2c20f0(0x10a)]['toDelete'];console[_0x2c20f0(0xd9)](_0x2c20f0(0xf3)+_0x335dd5+'\x27:');_0x5f40d5[_0x2c20f0(0x140)]>0x0&&console[_0x2c20f0(0xd9)]('\x20\x20'+a40_0x1cabe2[_0x2c20f0(0xd2)]('πŸ“\x20'+_0x5f40d5['length']+_0x2c20f0(0x14f)));if(!_0x4d607b[_0x2c20f0(0x13a)]){console[_0x2c20f0(0xd9)](_0x2c20f0(0x14d)),console[_0x2c20f0(0xd9)](_0x2c20f0(0x13b)+a40_0x1cabe2[_0x2c20f0(0x15e)]('+\x20'+_0x5464ca[_0x2c20f0(0x140)]+_0x2c20f0(0x15d))),console[_0x2c20f0(0xd9)](_0x2c20f0(0x13b)+a40_0x1cabe2['yellow']('~\x20'+_0x2ed1c1[_0x2c20f0(0x140)]+_0x2c20f0(0x136)));if(_0x514386[_0x2c20f0(0x140)]>0x0)console['error']('\x20\x20\x20\x20'+a40_0x1cabe2[_0x2c20f0(0x131)]('-\x20'+_0x514386['length']+_0x2c20f0(0x12e)));else _0x57572b['length']>0x0&&!_0x4d607b[_0x2c20f0(0x167)]&&console[_0x2c20f0(0xd9)]('\x20\x20\x20\x20'+a40_0x1cabe2['dim'](_0x57572b[_0x2c20f0(0x140)]+_0x2c20f0(0x14b)));console[_0x2c20f0(0xd9)](_0x2c20f0(0x13b)+a40_0x1cabe2[_0x2c20f0(0x161)]('=\x20'+_0x4e3810[_0x2c20f0(0x140)]+_0x2c20f0(0xd8)));}if(_0x5a0e7e[_0x2c20f0(0x140)]>0x0||_0x49426a[_0x2c20f0(0x140)]>0x0){console[_0x2c20f0(0xd9)](_0x2c20f0(0xec)),console[_0x2c20f0(0xd9)]('\x20\x20\x20\x20'+a40_0x1cabe2[_0x2c20f0(0x15e)]('+\x20'+_0x1317ca['length']+_0x2c20f0(0x15d))),console[_0x2c20f0(0xd9)]('\x20\x20\x20\x20'+a40_0x1cabe2[_0x2c20f0(0x102)]('~\x20'+_0x1746c7[_0x2c20f0(0x140)]+_0x2c20f0(0x136)));if(_0xc2afb1[_0x2c20f0(0x140)]>0x0)console[_0x2c20f0(0xd9)](_0x2c20f0(0x13b)+a40_0x1cabe2['red']('-\x20'+_0xc2afb1[_0x2c20f0(0x140)]+_0x2c20f0(0x12e)));else _0x49426a[_0x2c20f0(0x140)]>0x0&&!_0x4d607b[_0x2c20f0(0x167)]&&console[_0x2c20f0(0xd9)](_0x2c20f0(0x13b)+a40_0x1cabe2[_0x2c20f0(0x161)](_0x49426a['length']+'\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)'));console[_0x2c20f0(0xd9)](_0x2c20f0(0x13b)+a40_0x1cabe2[_0x2c20f0(0x161)]('=\x20'+_0x535e6d['length']+'\x20unchanged'));}_0x17899c['length']>0x0&&!_0x4d607b[_0x2c20f0(0x13a)]&&(console[_0x2c20f0(0xd9)](''),console[_0x2c20f0(0xd9)]('\x20\x20Activations:'),_0x52c734[_0x2c20f0(0x140)]>0x0&&console[_0x2c20f0(0xd9)](_0x2c20f0(0x13b)+a40_0x1cabe2[_0x2c20f0(0x15e)]('+\x20'+_0x52c734[_0x2c20f0(0x140)]+_0x2c20f0(0x127))),_0x430467[_0x2c20f0(0x140)]>0x0&&console[_0x2c20f0(0xd9)](_0x2c20f0(0x13b)+a40_0x1cabe2[_0x2c20f0(0x102)]('~\x20'+_0x430467['length']+_0x2c20f0(0x116))),_0x21fc15[_0x2c20f0(0x140)]>0x0&&console[_0x2c20f0(0xd9)](_0x2c20f0(0x13b)+a40_0x1cabe2['red']('-\x20'+_0x21fc15['length']+'\x20to\x20delete')));console[_0x2c20f0(0xd9)](_0x2c20f0(0x101)+a40_0x1cabe2[_0x2c20f0(0x115)](_0x2b94e8)+'\x0a');if(_0x5f40d5[_0x2c20f0(0x140)]>0x0){console[_0x2c20f0(0xd9)](_0x2c20f0(0xdf));for(const _0x515901 of _0x5f40d5){console[_0x2c20f0(0xd9)]('\x20\x20'+a40_0x1cabe2[_0x2c20f0(0xd2)]('+')+'\x20'+_0x515901);}console[_0x2c20f0(0xd9)]('');}if(_0x5464ca[_0x2c20f0(0x140)]>0x0&&!_0x4d607b[_0x2c20f0(0x13a)])for(const _0x3cce1f of _0x5464ca){const _0x131dc6=_0x3cce1f[_0x2c20f0(0xe1)]?_0x3cce1f[_0x2c20f0(0xe1)]+'/'+_0x3cce1f['yamlConfig'][_0x2c20f0(0x151)]:_0x3cce1f[_0x2c20f0(0xe5)][_0x2c20f0(0x151)],_0xa490c7=_0x3cce1f['yamlConfig'][_0x2c20f0(0x10a)]?.['length']||0x0,_0x9dad62=_0xa490c7>0x0?a40_0x1cabe2[_0x2c20f0(0x161)]('\x20['+_0xa490c7+_0x2c20f0(0x119)):'';console[_0x2c20f0(0xd9)]('\x0a'+a40_0x1cabe2[_0x2c20f0(0x15e)]('New\x20segment:')+'\x20'+_0x131dc6+_0x9dad62),console['error']('─'[_0x2c20f0(0xf1)](0x3c)),_0x3cce1f[_0x2c20f0(0xe8)]&&console[_0x2c20f0(0xd9)](_0x3cce1f[_0x2c20f0(0xe8)]),console[_0x2c20f0(0xd9)]('─'[_0x2c20f0(0xf1)](0x3c));}if(_0x514386['length']>0x0&&!_0x4d607b[_0x2c20f0(0x13a)])for(const _0x1be2dd of _0x514386){const _0x280dfd=_0x1be2dd[_0x2c20f0(0x117)]?_0x19d30f['get'](_0x1be2dd[_0x2c20f0(0x117)]['toString']())||'':'',_0x20a17e=_0x280dfd?_0x280dfd+'/'+_0x1be2dd[_0x2c20f0(0x151)]:_0x1be2dd[_0x2c20f0(0x151)],_0x503bcc=_0x4a946d['get'](_0x1be2dd['id'])||[],_0xaec7e0=_0x503bcc[_0x2c20f0(0x140)]>0x0?a40_0x1cabe2[_0x2c20f0(0x161)]('\x20['+_0x503bcc[_0x2c20f0(0x140)]+_0x2c20f0(0x119)):'';console['error']('\x0a'+a40_0x1cabe2[_0x2c20f0(0x131)](_0x2c20f0(0x145))+'\x20'+_0x20a17e+_0xaec7e0),console[_0x2c20f0(0xd9)]('─'['repeat'](0x3c));const _0xfb52e0=segmentWithActivationsToYaml(_0x1be2dd,_0x503bcc,undefined,_0x1222e0,_0x1fc89c),_0x4b4758=segmentToYamlString(_0xfb52e0),_0x5c87a0=generateDiff(_0x4b4758,'');console['error'](formatDiffWithColors(_0x5c87a0)),console[_0x2c20f0(0xd9)]('─'[_0x2c20f0(0xf1)](0x3c));}const _0x291217=_0x56f87b['filter'](_0x40ac13=>!_0x40ac13['isNew']&&_0x40ac13['diff']);if(_0x291217[_0x2c20f0(0x140)]>0x0&&!_0x4d607b[_0x2c20f0(0x13a)])for(const _0x347406 of _0x291217){const _0x2e5807=_0x347406[_0x2c20f0(0xe1)]?_0x347406[_0x2c20f0(0xe1)]+'/'+_0x347406[_0x2c20f0(0xe5)][_0x2c20f0(0x151)]:_0x347406[_0x2c20f0(0xe5)][_0x2c20f0(0x151)];console[_0x2c20f0(0xd9)]('\x0a'+a40_0x1cabe2[_0x2c20f0(0x102)]('Changes\x20to:')+'\x20'+_0x2e5807),console['error']('─'[_0x2c20f0(0xf1)](0x3c)),console['error'](_0x347406[_0x2c20f0(0xe8)]),console[_0x2c20f0(0xd9)]('─'[_0x2c20f0(0xf1)](0x3c));}if(_0x1317ca['length']>0x0)for(const _0x1ea88c of _0x1317ca){const _0x148248=_0x1ea88c[_0x2c20f0(0xe1)]?_0x1ea88c[_0x2c20f0(0xe1)]+'/'+_0x1ea88c[_0x2c20f0(0xe5)][_0x2c20f0(0x151)]:_0x1ea88c[_0x2c20f0(0xe5)][_0x2c20f0(0x151)];console[_0x2c20f0(0xd9)]('\x0a'+a40_0x1cabe2[_0x2c20f0(0x15e)](_0x2c20f0(0xdd))+'\x20'+_0x148248),console[_0x2c20f0(0xd9)]('─'['repeat'](0x3c)),_0x1ea88c[_0x2c20f0(0xe8)]&&console[_0x2c20f0(0xd9)](_0x1ea88c[_0x2c20f0(0xe8)]),console[_0x2c20f0(0xd9)]('─'['repeat'](0x3c));}const _0x217155=_0x5a0e7e[_0x2c20f0(0xeb)](_0x256433=>!_0x256433[_0x2c20f0(0x143)]&&_0x256433['diff']);if(_0x217155['length']>0x0)for(const _0x460f7a of _0x217155){const _0xad1910=_0x460f7a[_0x2c20f0(0xe1)]?_0x460f7a[_0x2c20f0(0xe1)]+'/'+_0x460f7a['yamlConfig'][_0x2c20f0(0x151)]:_0x460f7a[_0x2c20f0(0xe5)][_0x2c20f0(0x151)];console[_0x2c20f0(0xd9)]('\x0a'+a40_0x1cabe2[_0x2c20f0(0x102)](_0x2c20f0(0x10d))+'\x20'+_0xad1910),console[_0x2c20f0(0xd9)]('─'[_0x2c20f0(0xf1)](0x3c)),console[_0x2c20f0(0xd9)](_0x460f7a[_0x2c20f0(0xe8)]),console['error']('─'[_0x2c20f0(0xf1)](0x3c));}if(_0xc2afb1[_0x2c20f0(0x140)]>0x0)for(const _0x2ab87b of _0xc2afb1){const _0x2e1b0c=_0x2ab87b[_0x2c20f0(0x132)]?_0x19d30f[_0x2c20f0(0x11a)](_0x2ab87b[_0x2c20f0(0x132)])||'':'',_0x5a3ab9=_0x2e1b0c?_0x2e1b0c+'/'+_0x2ab87b[_0x2c20f0(0xda)]:_0x2ab87b['journeyBundleName'];console[_0x2c20f0(0xd9)]('\x0a'+a40_0x1cabe2[_0x2c20f0(0x131)]('Delete\x20journey:')+'\x20'+_0x5a3ab9),console[_0x2c20f0(0xd9)]('─'[_0x2c20f0(0xf1)](0x3c)),console[_0x2c20f0(0xd9)](a40_0x1cabe2[_0x2c20f0(0x131)](_0x2c20f0(0x10e))),console[_0x2c20f0(0xd9)]('─'[_0x2c20f0(0xf1)](0x3c));}if(_0x4d607b['dryRun'])return console[_0x2c20f0(0xd9)](a40_0x1cabe2[_0x2c20f0(0x102)](_0x2c20f0(0x124))),0x0;const _0x5561cd=_0x4d607b[_0x2c20f0(0x13a)]?![]:_0x5464ca[_0x2c20f0(0x140)]>0x0||_0x2ed1c1[_0x2c20f0(0x140)]>0x0||_0x514386[_0x2c20f0(0x140)]>0x0,_0x10bcbe=_0x1317ca[_0x2c20f0(0x140)]>0x0||_0x1746c7[_0x2c20f0(0x140)]>0x0||_0xc2afb1[_0x2c20f0(0x140)]>0x0,_0x3403b2=_0x4d607b[_0x2c20f0(0x13a)]?![]:_0x17899c[_0x2c20f0(0x140)]>0x0,_0x2a483e=_0x5f40d5['length']>0x0;if(!_0x5561cd&&!_0x10bcbe&&!_0x3403b2&&!_0x2a483e){const _0x3a95a8=_0x4d607b['journeysOnly']?'βœ”\x20All\x20journeys\x20are\x20up\x20to\x20date':'βœ”\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date';console['error'](a40_0x1cabe2[_0x2c20f0(0x15e)](_0x3a95a8));if(_0x95b67&&_0x4e3810['length']===0x1){const _0x3359ed=_0x4e3810[0x0];if(_0x3359ed[_0x2c20f0(0xe2)]?.['id']){const _0xf2fab3=getConsoleNextUrl(_0x4d607b['site'],_0x2c20f0(0x152)+_0x6b9fa3+_0x2c20f0(0x169)+_0x3359ed[_0x2c20f0(0xe2)]['id']+_0x2c20f0(0xd7));console[_0x2c20f0(0xd9)]('\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20'+a40_0x1cabe2[_0x2c20f0(0x115)](_0xf2fab3));}}if(_0x95b67&&_0x535e6d[_0x2c20f0(0x140)]===0x1){const _0x29e05d=_0x535e6d[0x0];if(_0x29e05d[_0x2c20f0(0xd4)]?.['id']){const _0x57536=getConsoleNextUrl(_0x4d607b[_0x2c20f0(0x112)],_0x2c20f0(0x152)+_0x6b9fa3+_0x2c20f0(0x169)+_0x29e05d['existingJourney']['id']+'/j/da/je');console['error']('\x20\x20'+a40_0x1cabe2[_0x2c20f0(0x115)](_0x57536));}}return 0x0;}const _0x547fe5=_0x4d607b[_0x2c20f0(0x13a)]?_0x1317ca['length']+_0x1746c7[_0x2c20f0(0x140)]+_0xc2afb1[_0x2c20f0(0x140)]+_0x5f40d5[_0x2c20f0(0x140)]:_0x5464ca['length']+_0x2ed1c1[_0x2c20f0(0x140)]+_0x514386[_0x2c20f0(0x140)]+_0x1317ca[_0x2c20f0(0x140)]+_0x1746c7[_0x2c20f0(0x140)]+_0xc2afb1['length']+_0x5f40d5['length']+_0x17899c[_0x2c20f0(0x140)];if(!_0x4d607b[_0x2c20f0(0x125)]&&_0x547fe5>0x0){if(!isInteractive())return console[_0x2c20f0(0xd9)](a40_0x1cabe2[_0x2c20f0(0x131)](_0x2c20f0(0xea)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x2c20f0(0xd9)](a40_0x1cabe2[_0x2c20f0(0x161)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x126226=await confirmKey(_0x2c20f0(0x144)+_0x547fe5+_0x2c20f0(0x118));if(!_0x126226)return console[_0x2c20f0(0xd9)](a40_0x1cabe2['yellow'](_0x2c20f0(0x12b))),0x1;}const _0x5bd8cf={'withProgress':async(_0x5673f0,_0x4144a8)=>{const _0x8ef56a=_0x2c20f0,_0x527061=await withSpinner(_0x5673f0,_0x4144a8,{'verbose':_0x4d607b[_0x8ef56a(0x14a)]});return{'data':_0x527061[_0x8ef56a(0x141)]};},'logInfo':_0x1d0880=>console['error'](a40_0x1cabe2[_0x2c20f0(0xd2)]('βœ”\x20'+_0x1d0880)),'logSuccess':_0x4cd96f=>console[_0x2c20f0(0xd9)](a40_0x1cabe2[_0x2c20f0(0x15e)]('βœ”\x20'+_0x4cd96f)),'logWarning':_0x417c95=>console[_0x2c20f0(0xd9)](a40_0x1cabe2[_0x2c20f0(0x102)]('⚠\x20'+_0x417c95)),'logDeleted':_0x55558e=>console['error'](a40_0x1cabe2['red']('βœ”\x20'+_0x55558e))},_0x213d42={'segment':_0x557ce8[_0x2c20f0(0x160)],'journey':_0x557ce8[_0x2c20f0(0x121)],'user':_0x557ce8[_0x2c20f0(0xfd)],'connection':_0x557ce8[_0x2c20f0(0xe6)]};_0x5f40d5[_0x2c20f0(0x140)]>0x0&&(_0x5d7bd6=await executePushFolders(_0x213d42,_0x5f40d5,_0x5d7bd6,{'parentId':_0x6b9fa3},_0x5bd8cf));const _0x176383={'rootFolderId':_0x3fe99f,'folderPathToId':_0x5d7bd6,'folderIdToPath':_0x19d30f,'segmentNameToId':_0x404b25,'activationsBySegmentId':_0x4a946d,'emailToIdMap':_0x51ee8a,'idToEmailMap':_0x1222e0,'connectionNameToIdMap':_0x90856c[_0x2c20f0(0x113)],'connectionIdToNameMap':_0x90856c[_0x2c20f0(0xe7)],'connectionNameToTypeMap':_0xc8bf87},_0x53ee3f=await executePushSegments(_0x213d42,_0x4d607b[_0x2c20f0(0x13a)]?[]:_0x56f87b,_0x176383,{'parentId':_0x6b9fa3},_0x5bd8cf),_0x4c4c2b=_0x53ee3f['created'],_0x49d1d1=_0x53ee3f[_0x2c20f0(0x128)],_0x2fec04=_0x53ee3f[_0x2c20f0(0x10a)][_0x2c20f0(0x12a)],_0x378f4e=_0x53ee3f[_0x2c20f0(0x10a)][_0x2c20f0(0x128)],_0x4864f3=_0x53ee3f[_0x2c20f0(0x10a)][_0x2c20f0(0x12f)];let _0x578660;if(_0x95b67&&_0x56f87b[_0x2c20f0(0x140)]===0x1){const _0x2a3979=_0x56f87b[0x0];_0x578660=_0x2a3979['existingSegment']?.['id']??_0x53ee3f[_0x2c20f0(0x11b)][_0x2c20f0(0x11a)](_0x2a3979[_0x2c20f0(0xe5)][_0x2c20f0(0x151)]);}const _0x5d1557=await executePushSegmentDeletions(_0x213d42,_0x4d607b['journeysOnly']?[]:_0x514386,_0x5bd8cf);let _0x386ff8=0x0,_0x6e9767=0x0,_0x6a0dea=0x0;const _0x4707e4=new Map(_0x404b25);for(const [_0xf293f2,_0xc6f516]of _0x53ee3f[_0x2c20f0(0x11b)]){_0x4707e4['set'](_0xf293f2,_0xc6f516);}if(_0x5a0e7e['length']>0x0){const _0x3c3ada={..._0x176383,'segmentNameToId':_0x4707e4,'existingSegments':_0xd8603b,'activationContext':_0x2f8d94},_0x16390f=await executePushJourneys(_0x213d42,_0x5a0e7e,_0x3c3ada,{'parentId':_0x6b9fa3,'rootFolderId':_0x3fe99f,'verbose':_0x4d607b[_0x2c20f0(0x14a)]},_0x5bd8cf);_0x386ff8=_0x16390f['created'],_0x6e9767=_0x16390f[_0x2c20f0(0x128)];if(_0x95b67&&_0x16390f[_0x2c20f0(0x159)]['length']===0x1){const _0x578fde=_0x16390f[_0x2c20f0(0x159)][0x0];if(_0x578fde[_0x2c20f0(0x137)]){const _0x3082e9=getConsoleNextUrl(_0x4d607b[_0x2c20f0(0x112)],_0x2c20f0(0x152)+_0x6b9fa3+_0x2c20f0(0x169)+_0x578fde['journeyId']+_0x2c20f0(0x11e));console[_0x2c20f0(0xd9)]('\x20\x20'+a40_0x1cabe2[_0x2c20f0(0x115)](_0x3082e9));}}}for(const _0x191f4e of _0xc2afb1){console[_0x2c20f0(0xd9)](a40_0x1cabe2[_0x2c20f0(0x102)](_0x2c20f0(0xd1)+_0x191f4e['journeyBundleName'])),_0x6a0dea++;}const _0x506def=[];if(_0x4c4c2b>0x0)_0x506def[_0x2c20f0(0x126)](_0x4c4c2b+_0x2c20f0(0x106));if(_0x49d1d1>0x0)_0x506def[_0x2c20f0(0x126)](_0x49d1d1+_0x2c20f0(0x13e));if(_0x5d1557>0x0)_0x506def[_0x2c20f0(0x126)](_0x5d1557+_0x2c20f0(0x163));const _0x4a6f1d=[];if(_0x386ff8>0x0)_0x4a6f1d[_0x2c20f0(0x126)](_0x386ff8+'\x20created');if(_0x6e9767>0x0)_0x4a6f1d[_0x2c20f0(0x126)](_0x6e9767+_0x2c20f0(0x13e));if(_0x6a0dea>0x0)_0x4a6f1d[_0x2c20f0(0x126)](_0x6a0dea+_0x2c20f0(0x163));const _0x5c9566=[];if(_0x2fec04>0x0)_0x5c9566[_0x2c20f0(0x126)](_0x2fec04+_0x2c20f0(0x106));if(_0x378f4e>0x0)_0x5c9566[_0x2c20f0(0x126)](_0x378f4e+'\x20updated');if(_0x4864f3>0x0)_0x5c9566[_0x2c20f0(0x126)](_0x4864f3+'\x20deleted');console[_0x2c20f0(0xd9)](a40_0x1cabe2[_0x2c20f0(0x15e)](_0x2c20f0(0xff)));_0x506def[_0x2c20f0(0x140)]>0x0&&!_0x4d607b[_0x2c20f0(0x13a)]&&console[_0x2c20f0(0xd9)](_0x2c20f0(0xfe)+_0x506def[_0x2c20f0(0x111)](',\x20'));_0x4a6f1d[_0x2c20f0(0x140)]>0x0&&console['error'](_0x2c20f0(0x114)+_0x4a6f1d['join'](',\x20'));_0x5c9566[_0x2c20f0(0x140)]>0x0&&!_0x4d607b['journeysOnly']&&console[_0x2c20f0(0xd9)](_0x2c20f0(0x139)+_0x5c9566[_0x2c20f0(0x111)](',\x20'));if(_0x578660){const _0x480274=getConsoleNextUrl(_0x4d607b['site'],'/app/ps/'+_0x6b9fa3+_0x2c20f0(0x169)+_0x578660+_0x2c20f0(0xd7));console[_0x2c20f0(0xd9)](_0x2c20f0(0x150)+a40_0x1cabe2['cyan'](_0x480274));}return 0x0;}}