@treasuredata/tdx 0.21.0 β†’ 0.22.0

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 (175) hide show
  1. package/README.md +4 -13
  2. package/dist/bin.js +1 -1
  3. package/dist/build-info.json +3 -3
  4. package/dist/cli-categories.js +1 -1
  5. package/dist/cli.js +1 -1
  6. package/dist/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/chat-command.js +1 -1
  13. package/dist/commands/claude-command.js +1 -1
  14. package/dist/commands/claude-statusline-command.js +1 -1
  15. package/dist/commands/claude-usage-command.js +1 -1
  16. package/dist/commands/command.js +1 -1
  17. package/dist/commands/connection-command.js +1 -1
  18. package/dist/commands/databases.js +1 -1
  19. package/dist/commands/describe.js +1 -1
  20. package/dist/commands/engage-command.js +1 -1
  21. package/dist/commands/job-command.js +1 -1
  22. package/dist/commands/journey-command.js +1 -1
  23. package/dist/commands/journey-validate-command.js +1 -1
  24. package/dist/commands/llm-command.js +1 -1
  25. package/dist/commands/mcp-command.js +1 -1
  26. package/dist/commands/parent-segment-command.js +1 -1
  27. package/dist/commands/profile-command.js +1 -1
  28. package/dist/commands/profile-command.js.map +1 -1
  29. package/dist/commands/profiles-command.js +1 -1
  30. package/dist/commands/query-command.js +1 -1
  31. package/dist/commands/schedule-command.js +1 -1
  32. package/dist/commands/segment-command.js +1 -1
  33. package/dist/commands/segment-create-command.js +1 -1
  34. package/dist/commands/segment-fields-command.js +1 -1
  35. package/dist/commands/segment-pull-command.js +1 -1
  36. package/dist/commands/segment-push-command.js +1 -1
  37. package/dist/commands/segment-update-command.js +1 -1
  38. package/dist/commands/segment-use-command.js +1 -1
  39. package/dist/commands/segment-validate-command.js +1 -1
  40. package/dist/commands/segments.js +1 -1
  41. package/dist/commands/show.js +1 -1
  42. package/dist/commands/status-command.js +1 -1
  43. package/dist/commands/tables.js +1 -1
  44. package/dist/commands/unset-command.js +1 -1
  45. package/dist/commands/unset-command.js.map +1 -1
  46. package/dist/commands/use-command.js +1 -1
  47. package/dist/commands/use-command.js.map +1 -1
  48. package/dist/commands/user-command.js +1 -1
  49. package/dist/commands/workflow-command.js +1 -1
  50. package/dist/core/auth.js +1 -1
  51. package/dist/core/command-output.js +1 -1
  52. package/dist/core/config.js +1 -1
  53. package/dist/core/config.js.map +1 -1
  54. package/dist/core/connection-cache.js +1 -1
  55. package/dist/core/constants.js +1 -1
  56. package/dist/core/credential-cache.js +1 -1
  57. package/dist/core/global-context.js +1 -1
  58. package/dist/core/global-context.js.map +1 -1
  59. package/dist/core/keychain.js +1 -1
  60. package/dist/core/profile.d.ts +1 -1
  61. package/dist/core/profile.js +1 -1
  62. package/dist/core/project-config.js +1 -1
  63. package/dist/core/session.d.ts.map +1 -1
  64. package/dist/core/session.js +1 -1
  65. package/dist/core/session.js.map +1 -1
  66. package/dist/core/user-cache.js +1 -1
  67. package/dist/core/version.js +1 -1
  68. package/dist/index.js +1 -1
  69. package/dist/mcp/server.js +1 -1
  70. package/dist/mcp/tools/index.js +1 -1
  71. package/dist/mcp/tools/tdx-run.js +1 -1
  72. package/dist/mcp/tools/tdx-run.js.map +1 -1
  73. package/dist/mcp/tools/tdx-search.js +1 -1
  74. package/dist/mcp/utils.js +1 -1
  75. package/dist/proxy/claude-usage-tracker.js +1 -1
  76. package/dist/proxy/passthrough-server.js +1 -1
  77. package/dist/proxy/sse-usage-parser.js +1 -1
  78. package/dist/sdk/agent/agent-config.js +1 -1
  79. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  80. package/dist/sdk/agent/agent-yaml.js +1 -1
  81. package/dist/sdk/agent/test/evaluator.js +1 -1
  82. package/dist/sdk/agent/test/executor.js +1 -1
  83. package/dist/sdk/agent/test/index.js +1 -1
  84. package/dist/sdk/agent/test/output.js +1 -1
  85. package/dist/sdk/agent/test/parser.js +1 -1
  86. package/dist/sdk/api.js +1 -1
  87. package/dist/sdk/client/cdp-api-client.js +1 -1
  88. package/dist/sdk/client/endpoints.js +1 -1
  89. package/dist/sdk/client/engage-api-client.js +1 -1
  90. package/dist/sdk/client/http-client.js +1 -1
  91. package/dist/sdk/client/llm-api-client.js +1 -1
  92. package/dist/sdk/client/rate-limiter.js +1 -1
  93. package/dist/sdk/client/td-api-client.js +1 -1
  94. package/dist/sdk/client/trino-api-client.js +1 -1
  95. package/dist/sdk/client/workflow-client.js +1 -1
  96. package/dist/sdk/connection-validator.js +1 -1
  97. package/dist/sdk/connection.js +1 -1
  98. package/dist/sdk/engage.js +1 -1
  99. package/dist/sdk/errors.js +1 -1
  100. package/dist/sdk/index.js +1 -1
  101. package/dist/sdk/io/index.js +1 -1
  102. package/dist/sdk/io/node-filesystem.js +1 -1
  103. package/dist/sdk/job.js +1 -1
  104. package/dist/sdk/journey.js +1 -1
  105. package/dist/sdk/llm/chat-cache.js +1 -1
  106. package/dist/sdk/llm/index.js +1 -1
  107. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  108. package/dist/sdk/llm/model-factors.js +1 -1
  109. package/dist/sdk/query/index.js +1 -1
  110. package/dist/sdk/query/sql-parser.js +1 -1
  111. package/dist/sdk/schedule.js +1 -1
  112. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  113. package/dist/sdk/segment/fields-display.js +1 -1
  114. package/dist/sdk/segment/file-discovery.js +1 -1
  115. package/dist/sdk/segment/journey-utils.js +1 -1
  116. package/dist/sdk/segment/journey-yaml.js +1 -1
  117. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  118. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  119. package/dist/sdk/segment/pull-workflow.js +1 -1
  120. package/dist/sdk/segment/push-workflow.js +1 -1
  121. package/dist/sdk/segment/resolution-context.js +1 -1
  122. package/dist/sdk/segment/segment-path-parser.js +1 -1
  123. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  124. package/dist/sdk/segment/target-resolution.js +1 -1
  125. package/dist/sdk/segment/tdx-config.js +1 -1
  126. package/dist/sdk/segment/validate-files.js +1 -1
  127. package/dist/sdk/segment/yaml-validator.js +1 -1
  128. package/dist/sdk/segment.js +1 -1
  129. package/dist/sdk/types/index.js +1 -1
  130. package/dist/sdk/types/progress.js +1 -1
  131. package/dist/sdk/user.js +1 -1
  132. package/dist/sdk/util/format-detector.js +1 -1
  133. package/dist/sdk/util/formatters.js +1 -1
  134. package/dist/sdk/util/index.js +1 -1
  135. package/dist/sdk/util/tree-formatter.js +1 -1
  136. package/dist/sdk/workflow/archive-validation.js +1 -1
  137. package/dist/sdk/workflow/clone-workflow.js +1 -1
  138. package/dist/sdk/workflow/index.js +1 -1
  139. package/dist/sdk/workflow/pull-workflow.js +1 -1
  140. package/dist/sdk/workflow/push-workflow.js +1 -1
  141. package/dist/sdk/workflow/tdx-config.js +1 -1
  142. package/dist/sdk/workflow/workflow-utils.js +1 -1
  143. package/dist/test-utils/command-runner.js +1 -1
  144. package/dist/test-utils/factories.js +1 -1
  145. package/dist/test-utils/fixtures.js +1 -1
  146. package/dist/test-utils/http-mock.js +1 -1
  147. package/dist/test-utils/index.js +1 -1
  148. package/dist/utils/async.js +1 -1
  149. package/dist/utils/colors.js +1 -1
  150. package/dist/utils/diff.js +1 -1
  151. package/dist/utils/file-permissions.js +1 -1
  152. package/dist/utils/global-cache.js +1 -1
  153. package/dist/utils/json-loader.js +1 -1
  154. package/dist/utils/local-cache.js +1 -1
  155. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  156. package/dist/utils/logger/formatters/index.js +1 -1
  157. package/dist/utils/logger/handlers/console-handler.js +1 -1
  158. package/dist/utils/logger/handlers/file-handler.js +1 -1
  159. package/dist/utils/logger/handlers/index.js +1 -1
  160. package/dist/utils/logger/handlers/null-handler.js +1 -1
  161. package/dist/utils/logger/index.js +1 -1
  162. package/dist/utils/logger/logger.js +1 -1
  163. package/dist/utils/logger/types.js +1 -1
  164. package/dist/utils/option-validation.js +1 -1
  165. package/dist/utils/port.js +1 -1
  166. package/dist/utils/process.js +1 -1
  167. package/dist/utils/process.js.map +1 -1
  168. package/dist/utils/prompt.js +1 -1
  169. package/dist/utils/spinner.js +1 -1
  170. package/dist/utils/sse-parser.js +1 -1
  171. package/dist/utils/string-utils.js +1 -1
  172. package/dist/utils/table-ref-parser.js +1 -1
  173. package/dist/utils/tdx-logger.js +1 -1
  174. package/dist/utils/version-check.js +1 -1
  175. package/package.json +1 -1
@@ -1 +1 @@
1
- const a26_0x20f9c5=a26_0x5314;(function(_0x31f9dc,_0x177c75){const _0x5ddcdb=a26_0x5314,_0x5715f2=_0x31f9dc();while(!![]){try{const _0x4694e6=-parseInt(_0x5ddcdb(0x181))/0x1*(parseInt(_0x5ddcdb(0x13e))/0x2)+parseInt(_0x5ddcdb(0x195))/0x3+parseInt(_0x5ddcdb(0x17c))/0x4*(parseInt(_0x5ddcdb(0x16d))/0x5)+-parseInt(_0x5ddcdb(0x17b))/0x6+parseInt(_0x5ddcdb(0x184))/0x7*(-parseInt(_0x5ddcdb(0x182))/0x8)+-parseInt(_0x5ddcdb(0x140))/0x9+parseInt(_0x5ddcdb(0x199))/0xa;if(_0x4694e6===_0x177c75)break;else _0x5715f2['push'](_0x5715f2['shift']());}catch(_0x1ee0f0){_0x5715f2['push'](_0x5715f2['shift']());}}}(a26_0x4a2d,0x79db7));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';function a26_0x5314(_0x598c21,_0xbb2af9){_0x598c21=_0x598c21-0x11d;const _0x4a2d36=a26_0x4a2d();let _0x531469=_0x4a2d36[_0x598c21];return _0x531469;}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 a26_0x25f255 from'chalk';function formatRelativeTime(_0x40d3ba){const _0x19d99d=a26_0x5314,_0x5626e8=new Date(_0x40d3ba),_0x57076c=new Date(),_0x433b8b=_0x5626e8['getTime']()-_0x57076c[_0x19d99d(0x12d)](),_0x25f34d=Math[_0x19d99d(0x16c)](_0x433b8b)/0x3e8,_0x23b77c=_0x433b8b<0x0;if(_0x25f34d<0x3c)return _0x23b77c?_0x19d99d(0x14a):_0x19d99d(0x15d);else{if(_0x25f34d<0xe10){const _0x581230=Math[_0x19d99d(0x13a)](_0x25f34d/0x3c);return _0x23b77c?_0x581230+_0x19d99d(0x19a):_0x19d99d(0x190)+_0x581230+'m';}else{if(_0x25f34d<0x15180){const _0x43df39=Math[_0x19d99d(0x13a)](_0x25f34d/0xe10);return _0x23b77c?_0x43df39+_0x19d99d(0x1a6):_0x19d99d(0x190)+_0x43df39+'h';}else{if(_0x25f34d<0x93a80){const _0x4ce40a=Math[_0x19d99d(0x13a)](_0x25f34d/0x15180);return _0x23b77c?_0x4ce40a+_0x19d99d(0x127):'in\x20'+_0x4ce40a+'d';}else return _0x5626e8[_0x19d99d(0x164)]();}}}}export class ScheduleListCommand extends BaseCommand{['name']=a26_0x20f9c5(0x194);[a26_0x20f9c5(0x18e)]=a26_0x20f9c5(0x16a);async[a26_0x20f9c5(0x177)](_0x52237e){const _0x2f2197=a26_0x20f9c5,{options:_0xc3f885,args:_0x28bfb6,tdx:_0x5ac513}=_0x52237e,_0x409911=resolveLimit(_0xc3f885[_0x2f2197(0x11d)],DEFAULT_DISPLAY_LIMIT),_0xa2323a=_0x28bfb6[0x0],_0xf38863=_0xa2323a?_0x2f2197(0x13d)+_0xa2323a+_0x2f2197(0x154):_0x2f2197(0x19e),_0x101842=await withSpinner(_0xf38863,()=>_0x5ac513[_0x2f2197(0x15a)]['listQueries']({'limit':_0x409911,'scheduled':!![],'pattern':_0xa2323a}),{'verbose':_0xc3f885[_0x2f2197(0x159)]}),_0x5ac61b=_0x101842['data'][_0x2f2197(0x178)],_0x547943=_0x101842[_0x2f2197(0x125)]['pagination']['has_next_page'],_0x13e74b=_0xa2323a?_0x2f2197(0x123)+_0xa2323a+'\x22':'';_0x547943?console[_0x2f2197(0x13f)](_0x2f2197(0x150)+_0x5ac61b[_0x2f2197(0x14f)]+_0x2f2197(0x15b)+_0x13e74b+'\x20(use\x20--limit\x20to\x20see\x20more)'):console[_0x2f2197(0x13f)](_0x2f2197(0x1a1)+_0x5ac61b[_0x2f2197(0x14f)]+_0x2f2197(0x19d)+(_0x5ac61b[_0x2f2197(0x14f)]!==0x1?_0x2f2197(0x18f):'y')+_0x13e74b);if(_0xc3f885[_0x2f2197(0x133)]===_0x2f2197(0x158)||_0xc3f885[_0x2f2197(0x133)]===_0x2f2197(0x16e)||_0xc3f885[_0x2f2197(0x133)]===_0x2f2197(0x153)||_0xc3f885['format']==='tsv'){const _0x4a6908=_0x5ac61b[_0x2f2197(0x14d)](_0x47cd90=>({'id':_0x47cd90['id'],'name':_0x47cd90[_0x2f2197(0x168)],'cron':_0x47cd90[_0x2f2197(0x12f)],'database':_0x47cd90[_0x2f2197(0x187)]?.['name'],'type':_0x47cd90[_0x2f2197(0x19c)],'timezone':_0x47cd90['time_zone'],'user_name':_0x47cd90[_0x2f2197(0x183)]?.[_0x2f2197(0x168)],'updated_at':_0x47cd90[_0x2f2197(0x12e)],'next_run_at':_0x47cd90['next_run_at'],'last_job_status':_0x47cd90[_0x2f2197(0x13b)]?.['status']}));await handleSDKOutput(_0x4a6908,_0xc3f885);}else{if(_0x5ac61b[_0x2f2197(0x14f)]===0x0)console['log'](_0x2f2197(0x173));else{const _0x413535=_0xc3f885[_0x2f2197(0x12b)],_0x1b767b=_0x5ac61b[_0x2f2197(0x14d)](_0x1a940a=>{const _0x27fc3e=_0x2f2197,_0x41fdaa=_0x1a940a[_0x27fc3e(0x13b)]?.[_0x27fc3e(0x148)]?_0x1a940a['last_job'][_0x27fc3e(0x148)]==='success'?'βœ“':'βœ—':'-',_0x449525=_0x1a940a['last_job']?.[_0x27fc3e(0x131)]?formatRelativeTime(_0x1a940a[_0x27fc3e(0x13b)][_0x27fc3e(0x131)]):'never',_0x47eca4=_0x1a940a[_0x27fc3e(0x121)]?formatRelativeTime(_0x1a940a[_0x27fc3e(0x121)]):'-',_0x33b2e0=_0x1a940a['cron']||'',_0xc0eb70=_0x1a940a['name']||'(unnamed)',_0x5c5ae1=getConsoleUrl(_0x413535,_0x27fc3e(0x157)+_0x1a940a['id']);return{'statusIcon':_0x41fdaa,'lastRun':_0x449525,'nextRun':_0x47eca4,'cron':_0x33b2e0,'name':_0xc0eb70,'queryUrl':_0x5c5ae1,'status':_0x1a940a[_0x27fc3e(0x13b)]?.[_0x27fc3e(0x148)]};}),_0x58a384=Math[_0x2f2197(0x197)](..._0x1b767b[_0x2f2197(0x14d)](_0x28b6a0=>_0x28b6a0[_0x2f2197(0x18d)][_0x2f2197(0x14f)])),_0x12d1f7=Math[_0x2f2197(0x197)](..._0x1b767b['map'](_0x5a1b53=>_0x5a1b53[_0x2f2197(0x130)][_0x2f2197(0x14f)])),_0x137646=Math[_0x2f2197(0x197)](..._0x1b767b[_0x2f2197(0x14d)](_0x56aa29=>_0x56aa29['cron'][_0x2f2197(0x14f)])),_0x254962=_0x1b767b[_0x2f2197(0x14d)](_0x281a62=>{const _0x4c3bec=_0x2f2197,_0x3d79e0=_0x281a62['status']===_0x4c3bec(0x15e)?a26_0x25f255[_0x4c3bec(0x15f)](_0x281a62[_0x4c3bec(0x136)]):_0x281a62[_0x4c3bec(0x148)]===_0x4c3bec(0x13f)?a26_0x25f255[_0x4c3bec(0x1a2)](_0x281a62[_0x4c3bec(0x136)]):a26_0x25f255['dim'](_0x281a62['statusIcon']),_0x5cd6c1=_0x281a62['lastRun'][_0x4c3bec(0x151)](_0x58a384),_0x3262a4=_0x281a62[_0x4c3bec(0x130)]['padEnd'](_0x12d1f7),_0x287ad5=_0x281a62[_0x4c3bec(0x12f)]?a26_0x25f255['cyan'](_0x281a62[_0x4c3bec(0x12f)][_0x4c3bec(0x151)](_0x137646)):'\x20'['repeat'](_0x137646),_0x43db25=hyperlink(_0x281a62[_0x4c3bec(0x168)],_0x281a62[_0x4c3bec(0x17e)]);return _0x4c3bec(0x180)+_0x3d79e0+'\x20'+_0x5cd6c1+_0x4c3bec(0x174)+_0x3262a4+'\x20\x20'+_0x287ad5+'\x20\x20'+_0x43db25;});await writeOutput(_0x254962[_0x2f2197(0x156)]('\x0a'),_0xc3f885[_0x2f2197(0x11f)],_0x2f2197(0x134));}}return 0x0;}}export class ScheduleShowCommand extends BaseCommand{[a26_0x20f9c5(0x168)]=a26_0x20f9c5(0x191);[a26_0x20f9c5(0x18e)]=a26_0x20f9c5(0x149);['validate'](_0x5b21c7){const _0x4a9f4d=a26_0x20f9c5,_0x1527b0=_0x5b21c7['args'][0x0];if(!_0x1527b0)return _0x4a9f4d(0x147);return undefined;}async['execute'](_0x777af){const _0x31f415=a26_0x20f9c5,{options:_0x2c642d,args:_0xdbf6d8,tdx:_0x52d16a}=_0x777af,_0x39d0a0=_0xdbf6d8[0x0],_0x32d75f=await withSpinner('Getting\x20schedule\x20details...',()=>_0x52d16a['schedules']['show'](_0x39d0a0),{'verbose':_0x2c642d[_0x31f415(0x159)]}),_0x4de4f3=_0x32d75f[_0x31f415(0x125)],_0x5eaf1f={'name':_0x4de4f3[_0x31f415(0x168)],'cron':_0x4de4f3[_0x31f415(0x12f)],'database':_0x4de4f3[_0x31f415(0x187)],'type':_0x4de4f3[_0x31f415(0x19c)],'timezone':_0x4de4f3[_0x31f415(0x128)],'user_name':_0x4de4f3[_0x31f415(0x196)],'created_at':_0x4de4f3[_0x31f415(0x169)],'engine_version':_0x4de4f3[_0x31f415(0x175)],'executing_user_id':_0x4de4f3['executing_user_id'],'query':_0x4de4f3[_0x31f415(0x14e)],'delay':_0x4de4f3[_0x31f415(0x172)],'priority':_0x4de4f3[_0x31f415(0x124)],'retry_limit':_0x4de4f3[_0x31f415(0x12c)],..._0x4de4f3[_0x31f415(0x17f)]&&{'result':_0x4de4f3['result']}};return await handleSingleObjectOutput(_0x5eaf1f,_0x2c642d),0x0;}}export class ScheduleCreateCommand extends BaseCommand{[a26_0x20f9c5(0x168)]=a26_0x20f9c5(0x192);[a26_0x20f9c5(0x18e)]=a26_0x20f9c5(0x186);[a26_0x20f9c5(0x12a)](_0x5ac233){const _0x258447=a26_0x20f9c5,_0x362386=_0x5ac233[_0x258447(0x19f)][0x0];if(!_0x362386)return _0x258447(0x141);return undefined;}async[a26_0x20f9c5(0x177)](_0x1bd778){const _0x2a97cc=a26_0x20f9c5,{options:_0x14509d,args:_0x221ad1,tdx:_0x285392}=_0x1bd778,_0x35eef8=_0x221ad1[0x0],_0x1db63b=_0x14509d,_0x441f79=_0x1db63b['database'],_0x12b142=_0x1db63b[_0x2a97cc(0x144)],_0x11bc36=_0x1db63b[_0x2a97cc(0x19c)]||_0x2a97cc(0x14c);let _0xb0ac32;try{_0xb0ac32=readFileSync(_0x12b142,'utf-8')[_0x2a97cc(0x139)]();}catch(_0x5362c8){throw new SDKError(ErrorCode[_0x2a97cc(0x15c)],_0x2a97cc(0x1a3)+_0x12b142,_0x5362c8 instanceof Error?_0x5362c8:undefined);}if(!_0xb0ac32)throw new SDKError(ErrorCode[_0x2a97cc(0x15c)],_0x2a97cc(0x16f));const _0x31772d={'database':_0x441f79,'query':_0xb0ac32,'type':_0x11bc36};if(_0x1db63b[_0x2a97cc(0x12f)])_0x31772d['cron']=_0x1db63b[_0x2a97cc(0x12f)];if(_0x1db63b[_0x2a97cc(0x128)])_0x31772d[_0x2a97cc(0x128)]=_0x1db63b[_0x2a97cc(0x128)];if(_0x1db63b['delay']!==undefined)_0x31772d[_0x2a97cc(0x172)]=Number(_0x1db63b[_0x2a97cc(0x172)]);if(_0x1db63b['priority']!==undefined)_0x31772d['priority']=Number(_0x1db63b['priority']);if(_0x1db63b['retryLimit']!==undefined)_0x31772d[_0x2a97cc(0x12c)]=Number(_0x1db63b['retryLimit']);if(_0x1db63b[_0x2a97cc(0x18c)])_0x31772d['engine_version']=_0x1db63b['engineVersion'];if(_0x1db63b['result'])_0x31772d['result']=_0x1db63b[_0x2a97cc(0x17f)];if(_0x14509d[_0x2a97cc(0x159)]){console['error'](_0x2a97cc(0x18b)+_0x35eef8),console[_0x2a97cc(0x13f)](_0x2a97cc(0x155)+_0x441f79),console[_0x2a97cc(0x13f)]('\x20\x20Type:\x20'+_0x11bc36);if(_0x31772d[_0x2a97cc(0x12f)])console[_0x2a97cc(0x13f)](_0x2a97cc(0x11e)+_0x31772d['cron']);if(_0x31772d[_0x2a97cc(0x128)])console[_0x2a97cc(0x13f)]('\x20\x20Timezone:\x20'+_0x31772d['timezone']);}const _0x3a3418=await withSpinner(_0x2a97cc(0x145),()=>_0x285392[_0x2a97cc(0x15a)][_0x2a97cc(0x19b)](_0x35eef8,_0x31772d),{'verbose':_0x14509d[_0x2a97cc(0x159)]});return console[_0x2a97cc(0x13f)](_0x2a97cc(0x122)+_0x3a3418[_0x2a97cc(0x125)]['name']),await handleSingleObjectOutput(_0x3a3418['data'],_0x14509d),0x0;}}export class ScheduleUpdateCommand extends BaseCommand{[a26_0x20f9c5(0x168)]=a26_0x20f9c5(0x162);[a26_0x20f9c5(0x18e)]=a26_0x20f9c5(0x1a4);[a26_0x20f9c5(0x12a)](_0x431653){const _0x5e9892=a26_0x20f9c5,_0x255053=_0x431653[_0x5e9892(0x19f)][0x0];if(!_0x255053)return'Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20update\x20<name>\x20[options]';return undefined;}async['execute'](_0x2ccf0c){const _0x3ef826=a26_0x20f9c5,{options:_0x1c64ac,args:_0x45a776,tdx:_0x437d3a}=_0x2ccf0c,_0x57a91d=_0x45a776[0x0],_0x380ce6=_0x1c64ac,_0x3c803b={};if(_0x380ce6['database'])_0x3c803b[_0x3ef826(0x187)]=_0x380ce6['database'];if(_0x380ce6[_0x3ef826(0x19c)])_0x3c803b['type']=_0x380ce6['type'];if(_0x380ce6[_0x3ef826(0x12f)])_0x3c803b[_0x3ef826(0x12f)]=_0x380ce6[_0x3ef826(0x12f)];if(_0x380ce6['timezone'])_0x3c803b[_0x3ef826(0x128)]=_0x380ce6[_0x3ef826(0x128)];if(_0x380ce6[_0x3ef826(0x172)]!==undefined)_0x3c803b[_0x3ef826(0x172)]=Number(_0x380ce6[_0x3ef826(0x172)]);if(_0x380ce6['priority']!==undefined)_0x3c803b[_0x3ef826(0x124)]=Number(_0x380ce6['priority']);if(_0x380ce6['retryLimit']!==undefined)_0x3c803b[_0x3ef826(0x12c)]=Number(_0x380ce6['retryLimit']);if(_0x380ce6['engineVersion'])_0x3c803b[_0x3ef826(0x175)]=_0x380ce6[_0x3ef826(0x18c)];if(_0x380ce6[_0x3ef826(0x17f)])_0x3c803b['result']=_0x380ce6[_0x3ef826(0x17f)];if(_0x380ce6['file'])try{_0x3c803b[_0x3ef826(0x14e)]=readFileSync(_0x380ce6[_0x3ef826(0x144)],'utf-8')[_0x3ef826(0x139)]();}catch(_0x48ae28){throw new SDKError(ErrorCode[_0x3ef826(0x15c)],'Failed\x20to\x20read\x20file:\x20'+_0x380ce6[_0x3ef826(0x144)],_0x48ae28 instanceof Error?_0x48ae28:undefined);}if(Object[_0x3ef826(0x185)](_0x3c803b)['length']===0x0)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x3ef826(0x126));if(_0x1c64ac[_0x3ef826(0x159)]){console['error'](_0x3ef826(0x163)+_0x57a91d);for(const [_0x4942c7,_0x20a4a9]of Object[_0x3ef826(0x193)](_0x3c803b)){_0x4942c7===_0x3ef826(0x14e)?console[_0x3ef826(0x13f)]('\x20\x20'+_0x4942c7+':\x20'+_0x20a4a9[_0x3ef826(0x1a5)](0x0,0x32)+'...'):console['error']('\x20\x20'+_0x4942c7+':\x20'+_0x20a4a9);}}const _0x19256a=await withSpinner(_0x3ef826(0x17d),()=>_0x437d3a['schedules'][_0x3ef826(0x198)](_0x57a91d,_0x3c803b),{'verbose':_0x1c64ac[_0x3ef826(0x159)]});return console[_0x3ef826(0x13f)](_0x3ef826(0x176)+_0x19256a[_0x3ef826(0x125)]['name']),await handleSingleObjectOutput(_0x19256a[_0x3ef826(0x125)],_0x1c64ac),0x0;}}export class ScheduleDeleteCommand extends BaseCommand{[a26_0x20f9c5(0x168)]='schedule:delete';[a26_0x20f9c5(0x18e)]='Delete\x20a\x20scheduled\x20query';[a26_0x20f9c5(0x12a)](_0x3d34f7){const _0x41a9cb=a26_0x20f9c5,_0x2308da=_0x3d34f7[_0x41a9cb(0x19f)][0x0];if(!_0x2308da)return _0x41a9cb(0x170);return undefined;}async[a26_0x20f9c5(0x177)](_0x442611){const _0x303925=a26_0x20f9c5,{options:_0x5243b4,args:_0x69c943,tdx:_0x225dc5}=_0x442611,_0x16fe38=_0x69c943[0x0];if(!_0x5243b4[_0x303925(0x120)]){const _0x58c359=await confirm(_0x303925(0x14b)+_0x16fe38+'\x22?');if(!_0x58c359)return console[_0x303925(0x13f)]('Cancelled'),0x0;}const _0x2063c6=await withSpinner(_0x303925(0x1a7),()=>_0x225dc5[_0x303925(0x15a)][_0x303925(0x179)](_0x16fe38),{'verbose':_0x5243b4[_0x303925(0x159)]});return console[_0x303925(0x13f)](_0x303925(0x152)+_0x2063c6[_0x303925(0x125)][_0x303925(0x168)]),0x0;}}export class ScheduleRunCommand extends BaseCommand{['name']=a26_0x20f9c5(0x18a);[a26_0x20f9c5(0x18e)]='Run\x20a\x20scheduled\x20query\x20immediately';[a26_0x20f9c5(0x12a)](_0x224726){const _0x2cca9a=a26_0x20f9c5,_0x5104f6=_0x224726['args'][0x0];if(!_0x5104f6)return _0x2cca9a(0x16b);return undefined;}async['execute'](_0x2d0ac6){const _0x2012a5=a26_0x20f9c5,{options:_0x4c4af6,args:_0x293220,tdx:_0x5180f0}=_0x2d0ac6,_0x3f9ba9=_0x293220[0x0],_0x5445b2=_0x4c4af6,_0x1aeaa2=_0x5445b2['time'],_0x2e76b1=_0x5445b2[_0x2012a5(0x146)]!==undefined?Number(_0x5445b2['num']):undefined;if(_0x4c4af6[_0x2012a5(0x159)]){console[_0x2012a5(0x13f)]('Running\x20schedule:\x20'+_0x3f9ba9);if(_0x1aeaa2)console['error'](_0x2012a5(0x160)+_0x1aeaa2);if(_0x2e76b1)console[_0x2012a5(0x13f)]('\x20\x20Num:\x20'+_0x2e76b1);}const _0x2acbdb=await withSpinner(_0x2012a5(0x165),()=>_0x5180f0[_0x2012a5(0x15a)][_0x2012a5(0x188)](_0x3f9ba9,{'time':_0x1aeaa2,'num':_0x2e76b1}),{'verbose':_0x4c4af6[_0x2012a5(0x159)]}),_0x20cfee=_0x2acbdb[_0x2012a5(0x125)][_0x2012a5(0x167)];console[_0x2012a5(0x13f)](_0x2012a5(0x142)+_0x20cfee[_0x2012a5(0x14f)]+_0x2012a5(0x143)+(_0x20cfee[_0x2012a5(0x14f)]!==0x1?'s':'')+'\x20created');for(const _0x20d6c0 of _0x20cfee){console[_0x2012a5(0x13f)](_0x2012a5(0x171)+_0x20d6c0[_0x2012a5(0x137)]);}return await handleSDKOutput(_0x20cfee,_0x4c4af6),0x0;}}export class ScheduleHistoryCommand extends BaseCommand{[a26_0x20f9c5(0x168)]=a26_0x20f9c5(0x166);[a26_0x20f9c5(0x18e)]=a26_0x20f9c5(0x17a);[a26_0x20f9c5(0x12a)](_0x468dd7){const _0x3c8373=a26_0x20f9c5,_0x251669=_0x468dd7[_0x3c8373(0x19f)][0x0];if(!_0x251669)return _0x3c8373(0x135);return undefined;}async[a26_0x20f9c5(0x177)](_0x21b276){const _0x4e311e=a26_0x20f9c5,{options:_0x4bebe4,args:_0x444556,tdx:_0x4cf68a}=_0x21b276,_0x2a1c7b=_0x444556[0x0],_0x5b8ed1=_0x4bebe4,_0x4ddefd=_0x5b8ed1[_0x4e311e(0x13c)]!==undefined?Number(_0x5b8ed1[_0x4e311e(0x13c)]):undefined,_0x30303a=_0x5b8ed1['to']!==undefined?Number(_0x5b8ed1['to']):undefined,_0x50af49=await withSpinner('Getting\x20schedule\x20history...',()=>_0x4cf68a[_0x4e311e(0x15a)][_0x4e311e(0x138)](_0x2a1c7b,{'from':_0x4ddefd,'to':_0x30303a}),{'verbose':_0x4bebe4[_0x4e311e(0x159)]}),_0x1feda8=_0x50af49[_0x4e311e(0x125)];console[_0x4e311e(0x13f)](_0x4e311e(0x1a1)+_0x1feda8[_0x4e311e(0x161)]+'\x20execution'+(_0x1feda8[_0x4e311e(0x161)]!==0x1?'s':'')+_0x4e311e(0x129)+_0x1feda8[_0x4e311e(0x13c)]+'-'+_0x1feda8['to']+')');const _0x5c8e2a=_0x1feda8[_0x4e311e(0x138)][_0x4e311e(0x14d)](_0x4e32a9=>({'job_id':_0x4e32a9[_0x4e311e(0x137)],'type':_0x4e32a9[_0x4e311e(0x19c)],'status':_0x4e32a9[_0x4e311e(0x148)],'scheduled_at':_0x4e32a9[_0x4e311e(0x189)],'created_at':_0x4e32a9[_0x4e311e(0x169)],'start_at':_0x4e32a9[_0x4e311e(0x1a0)],'end_at':_0x4e32a9[_0x4e311e(0x132)]}));return await handleSDKOutput(_0x5c8e2a,_0x4bebe4),0x0;}}function a26_0x4a2d(){const _0x3a8ccc=['validate','site','retry_limit','getTime','updated_at','cron','nextRun','ended_at','end_at','format','list','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20history\x20<name>\x20[--from\x20<n>]\x20[--to\x20<n>]','statusIcon','job_id','history','trim','round','last_job','from','Searching\x20scheduled\x20queries\x20matching\x20\x22','2494NKqgEl','error','1094922DjdmaP','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20create\x20<name>\x20-d\x20<db>\x20--file\x20<path>\x20[options]','Schedule\x20run\x20submitted:\x20','\x20job','file','Creating\x20schedule...','num','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20show\x20<name>','status','Show\x20schedule\x20details','just\x20now','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20schedule\x20\x22','trino','map','query','length','Showing\x20first\x20','padEnd','Schedule\x20deleted:\x20','table','\x22...','\x20\x20Database:\x20','join','/app/queries/editor?queryId=','json','verbose','schedules','\x20schedules','INVALID_ARGUMENT','soon','success','green','\x20\x20Time:\x20','count','schedule:update','Updating\x20schedule:\x20','toLocaleDateString','Running\x20schedule...','schedule:history','jobs','name','created_at','List\x20scheduled\x20queries','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20run\x20<name>\x20[--time\x20<iso8601>]\x20[--num\x20<1-10>]','abs','341440tWnReQ','jsonl','Query\x20file\x20is\x20empty','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20delete\x20<name>','\x20\x20Job\x20ID:\x20','delay','No\x20scheduled\x20queries\x20found','\x20\x20β†’\x20','engine_version','Schedule\x20updated:\x20','execute','queries','delete','Show\x20schedule\x20execution\x20history','5148858nWJftX','20HHexJX','Updating\x20schedule...','queryUrl','result','πŸ“…\x20','77JlPeEc','601096UKINPY','user','77BMTRUD','keys','Create\x20a\x20scheduled\x20query','database','run','scheduled_at','schedule:run','Creating\x20schedule:\x20','engineVersion','lastRun','description','ies','in\x20','schedule:show','schedule:create','entries','schedule:list','1938072YNcKPO','user_name','max','update','14139900RHpBWp','m\x20ago','create','type','\x20scheduled\x20quer','Listing\x20scheduled\x20queries...','args','start_at','Found\x20','red','Failed\x20to\x20read\x20file:\x20','Update\x20a\x20scheduled\x20query','substring','h\x20ago','Deleting\x20schedule...','limit','\x20\x20Cron:\x20','output','yes','next_run_at','Schedule\x20created:\x20','\x20matching\x20\x22','priority','data','At\x20least\x20one\x20option\x20must\x20be\x20provided\x20to\x20update','d\x20ago','timezone','\x20(showing\x20'];a26_0x4a2d=function(){return _0x3a8ccc;};return a26_0x4a2d();}
1
+ const a26_0x56e718=a26_0x2273;(function(_0x553828,_0x2568d9){const _0x31faee=a26_0x2273,_0x223a6a=_0x553828();while(!![]){try{const _0x2d39c4=parseInt(_0x31faee(0x118))/0x1+parseInt(_0x31faee(0x105))/0x2+parseInt(_0x31faee(0xf8))/0x3*(parseInt(_0x31faee(0x12c))/0x4)+-parseInt(_0x31faee(0xf5))/0x5*(parseInt(_0x31faee(0x13c))/0x6)+parseInt(_0x31faee(0xea))/0x7+parseInt(_0x31faee(0xe2))/0x8+parseInt(_0x31faee(0x136))/0x9*(-parseInt(_0x31faee(0x157))/0xa);if(_0x2d39c4===_0x2568d9)break;else _0x223a6a['push'](_0x223a6a['shift']());}catch(_0x5b4f57){_0x223a6a['push'](_0x223a6a['shift']());}}}(a26_0x3589,0x500cc));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';function a26_0x2273(_0x2c4abc,_0x205b1d){_0x2c4abc=_0x2c4abc-0xe2;const _0x3589e6=a26_0x3589();let _0x22734d=_0x3589e6[_0x2c4abc];return _0x22734d;}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 a26_0x27ab04 from'chalk';function formatRelativeTime(_0x576ed0){const _0x292466=a26_0x2273,_0x4a4e79=new Date(_0x576ed0),_0x444733=new Date(),_0x505f87=_0x4a4e79[_0x292466(0x15a)]()-_0x444733[_0x292466(0x15a)](),_0x119aa3=Math['abs'](_0x505f87)/0x3e8,_0x37a9c9=_0x505f87<0x0;if(_0x119aa3<0x3c)return _0x37a9c9?_0x292466(0x16a):_0x292466(0x16e);else{if(_0x119aa3<0xe10){const _0x5621cc=Math[_0x292466(0xf7)](_0x119aa3/0x3c);return _0x37a9c9?_0x5621cc+_0x292466(0x10a):_0x292466(0x15e)+_0x5621cc+'m';}else{if(_0x119aa3<0x15180){const _0x407d27=Math[_0x292466(0xf7)](_0x119aa3/0xe10);return _0x37a9c9?_0x407d27+_0x292466(0x129):_0x292466(0x15e)+_0x407d27+'h';}else{if(_0x119aa3<0x93a80){const _0x383c5a=Math[_0x292466(0xf7)](_0x119aa3/0x15180);return _0x37a9c9?_0x383c5a+_0x292466(0x101):'in\x20'+_0x383c5a+'d';}else return _0x4a4e79[_0x292466(0x12a)]();}}}}export class ScheduleListCommand extends BaseCommand{['name']=a26_0x56e718(0x16d);['description']='List\x20scheduled\x20queries';async[a26_0x56e718(0x159)](_0xde3c53){const _0x512276=a26_0x56e718,{options:_0x1f036a,args:_0x36b9fd,tdx:_0x169282}=_0xde3c53,_0x5d85c4=resolveLimit(_0x1f036a['limit'],DEFAULT_DISPLAY_LIMIT),_0x44b376=_0x36b9fd[0x0],_0x47e986=_0x44b376?_0x512276(0x144)+_0x44b376+_0x512276(0x16c):'Listing\x20scheduled\x20queries...',_0x206802=await withSpinner(_0x47e986,()=>_0x169282['schedules'][_0x512276(0x13f)]({'limit':_0x5d85c4,'scheduled':!![],'pattern':_0x44b376}),{'verbose':_0x1f036a[_0x512276(0x163)]}),_0x2bc5e3=_0x206802[_0x512276(0x102)][_0x512276(0x130)],_0x5a8869=_0x206802[_0x512276(0x102)][_0x512276(0x15f)]['has_next_page'],_0x4195ed=_0x44b376?_0x512276(0x173)+_0x44b376+'\x22':'';_0x5a8869?console[_0x512276(0x14f)](_0x512276(0x16b)+_0x2bc5e3[_0x512276(0x110)]+'\x20schedules'+_0x4195ed+'\x20(use\x20--limit\x20to\x20see\x20more)'):console[_0x512276(0x14f)](_0x512276(0x11e)+_0x2bc5e3[_0x512276(0x110)]+_0x512276(0x11d)+(_0x2bc5e3[_0x512276(0x110)]!==0x1?'ies':'y')+_0x4195ed);if(_0x1f036a[_0x512276(0x15d)]===_0x512276(0x162)||_0x1f036a[_0x512276(0x15d)]==='jsonl'||_0x1f036a['format']===_0x512276(0xf0)||_0x1f036a[_0x512276(0x15d)]===_0x512276(0x169)){const _0x57ebfa=_0x2bc5e3[_0x512276(0x10d)](_0x113c0e=>({'id':_0x113c0e['id'],'name':_0x113c0e[_0x512276(0x158)],'cron':_0x113c0e[_0x512276(0x124)],'database':_0x113c0e[_0x512276(0xed)]?.[_0x512276(0x158)],'type':_0x113c0e['type'],'timezone':_0x113c0e[_0x512276(0xe5)],'user_name':_0x113c0e['user']?.[_0x512276(0x158)],'updated_at':_0x113c0e[_0x512276(0x109)],'next_run_at':_0x113c0e[_0x512276(0x138)],'last_job_status':_0x113c0e[_0x512276(0x154)]?.[_0x512276(0xec)]}));await handleSDKOutput(_0x57ebfa,_0x1f036a);}else{if(_0x2bc5e3[_0x512276(0x110)]===0x0)console[_0x512276(0x146)](_0x512276(0x133));else{const _0x1edab1=_0x1f036a['site'],_0x33a80d=_0x2bc5e3['map'](_0x15e59c=>{const _0x4fb135=_0x512276,_0x244a90=_0x15e59c[_0x4fb135(0x154)]?.['status']?_0x15e59c[_0x4fb135(0x154)][_0x4fb135(0xec)]==='success'?'βœ“':'βœ—':'-',_0x50abfd=_0x15e59c[_0x4fb135(0x154)]?.[_0x4fb135(0x170)]?formatRelativeTime(_0x15e59c[_0x4fb135(0x154)]['ended_at']):_0x4fb135(0x112),_0x19fff0=_0x15e59c[_0x4fb135(0x138)]?formatRelativeTime(_0x15e59c['next_run_at']):'-',_0x471f4c=_0x15e59c[_0x4fb135(0x124)]||'',_0x234188=_0x15e59c[_0x4fb135(0x158)]||_0x4fb135(0xe8),_0x56bf09=getConsoleUrl(_0x1edab1,_0x4fb135(0x152)+_0x15e59c['id']);return{'statusIcon':_0x244a90,'lastRun':_0x50abfd,'nextRun':_0x19fff0,'cron':_0x471f4c,'name':_0x234188,'queryUrl':_0x56bf09,'status':_0x15e59c[_0x4fb135(0x154)]?.[_0x4fb135(0xec)]};}),_0x4153c1=Math[_0x512276(0xfb)](..._0x33a80d['map'](_0x219ea2=>_0x219ea2[_0x512276(0xf6)][_0x512276(0x110)])),_0x77c143=Math[_0x512276(0xfb)](..._0x33a80d['map'](_0xc51794=>_0xc51794[_0x512276(0x113)][_0x512276(0x110)])),_0x3ea41d=Math[_0x512276(0xfb)](..._0x33a80d['map'](_0x167595=>_0x167595[_0x512276(0x124)]['length'])),_0x1d4b05=_0x33a80d[_0x512276(0x10d)](_0x42ace2=>{const _0x5eb276=_0x512276,_0x5056b0=_0x42ace2[_0x5eb276(0xec)]===_0x5eb276(0x142)?a26_0x27ab04[_0x5eb276(0xfc)](_0x42ace2[_0x5eb276(0xee)]):_0x42ace2['status']==='error'?a26_0x27ab04[_0x5eb276(0xf2)](_0x42ace2[_0x5eb276(0xee)]):a26_0x27ab04[_0x5eb276(0x13b)](_0x42ace2[_0x5eb276(0xee)]),_0x58acaf=_0x42ace2[_0x5eb276(0xf6)]['padEnd'](_0x4153c1),_0x31fcab=_0x42ace2[_0x5eb276(0x113)][_0x5eb276(0x155)](_0x77c143),_0x3b97b4=_0x42ace2[_0x5eb276(0x124)]?a26_0x27ab04[_0x5eb276(0x11c)](_0x42ace2[_0x5eb276(0x124)][_0x5eb276(0x155)](_0x3ea41d)):'\x20'[_0x5eb276(0x140)](_0x3ea41d),_0x4e0e6b=hyperlink(_0x42ace2[_0x5eb276(0x158)],_0x42ace2[_0x5eb276(0xf3)]);return _0x5eb276(0x14a)+_0x5056b0+'\x20'+_0x58acaf+_0x5eb276(0x14d)+_0x31fcab+'\x20\x20'+_0x3b97b4+'\x20\x20'+_0x4e0e6b;});await writeOutput(_0x1d4b05[_0x512276(0x100)]('\x0a'),_0x1f036a[_0x512276(0x115)],_0x512276(0x108));}}return 0x0;}}export class ScheduleShowCommand extends BaseCommand{[a26_0x56e718(0x158)]=a26_0x56e718(0x166);['description']='Show\x20schedule\x20details';[a26_0x56e718(0x116)](_0x4ebe5e){const _0xe5ccd1=a26_0x56e718,_0x26ad85=_0x4ebe5e[_0xe5ccd1(0x15b)][0x0];if(!_0x26ad85)return'Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20show\x20<name>';return undefined;}async[a26_0x56e718(0x159)](_0xfc3216){const _0x32b4b7=a26_0x56e718,{options:_0x4e6619,args:_0x34c57c,tdx:_0x342a0c}=_0xfc3216,_0x51dea2=_0x34c57c[0x0],_0x1aa549=await withSpinner(_0x32b4b7(0x131),()=>_0x342a0c[_0x32b4b7(0x160)][_0x32b4b7(0xfa)](_0x51dea2),{'verbose':_0x4e6619[_0x32b4b7(0x163)]}),_0x5d58b3=_0x1aa549['data'],_0x18fb55={'name':_0x5d58b3[_0x32b4b7(0x158)],'cron':_0x5d58b3[_0x32b4b7(0x124)],'database':_0x5d58b3[_0x32b4b7(0xed)],'type':_0x5d58b3[_0x32b4b7(0x127)],'timezone':_0x5d58b3[_0x32b4b7(0x117)],'user_name':_0x5d58b3[_0x32b4b7(0x150)],'created_at':_0x5d58b3[_0x32b4b7(0x106)],'engine_version':_0x5d58b3['engine_version'],'executing_user_id':_0x5d58b3[_0x32b4b7(0xeb)],'query':_0x5d58b3[_0x32b4b7(0x126)],'delay':_0x5d58b3[_0x32b4b7(0x153)],'priority':_0x5d58b3[_0x32b4b7(0x120)],'retry_limit':_0x5d58b3['retry_limit'],..._0x5d58b3[_0x32b4b7(0x107)]&&{'result':_0x5d58b3[_0x32b4b7(0x107)]}};return await handleSingleObjectOutput(_0x18fb55,_0x4e6619),0x0;}}export class ScheduleCreateCommand extends BaseCommand{[a26_0x56e718(0x158)]=a26_0x56e718(0x10f);['description']=a26_0x56e718(0x12b);['validate'](_0x1929a7){const _0x37c6bf=a26_0x56e718,_0x1bbc1c=_0x1929a7[_0x37c6bf(0x15b)][0x0];if(!_0x1bbc1c)return _0x37c6bf(0x14e);return undefined;}async[a26_0x56e718(0x159)](_0x30f72f){const _0x22ba9e=a26_0x56e718,{options:_0x14ca9c,args:_0xb3ba08,tdx:_0x1eb8f7}=_0x30f72f,_0x287606=_0xb3ba08[0x0],_0x27ecdd=_0x14ca9c,_0x2e9e4e=_0x27ecdd['database'],_0x584abb=_0x27ecdd[_0x22ba9e(0x14b)],_0xe9bee3=_0x27ecdd[_0x22ba9e(0x127)]||_0x22ba9e(0xf1);let _0xffd630;try{_0xffd630=readFileSync(_0x584abb,'utf-8')['trim']();}catch(_0x217618){throw new SDKError(ErrorCode['INVALID_ARGUMENT'],'Failed\x20to\x20read\x20file:\x20'+_0x584abb,_0x217618 instanceof Error?_0x217618:undefined);}if(!_0xffd630)throw new SDKError(ErrorCode[_0x22ba9e(0x128)],_0x22ba9e(0x12d));const _0x495817={'database':_0x2e9e4e,'query':_0xffd630,'type':_0xe9bee3};if(_0x27ecdd[_0x22ba9e(0x124)])_0x495817[_0x22ba9e(0x124)]=_0x27ecdd[_0x22ba9e(0x124)];if(_0x27ecdd[_0x22ba9e(0x117)])_0x495817[_0x22ba9e(0x117)]=_0x27ecdd[_0x22ba9e(0x117)];if(_0x27ecdd['delay']!==undefined)_0x495817[_0x22ba9e(0x153)]=Number(_0x27ecdd[_0x22ba9e(0x153)]);if(_0x27ecdd[_0x22ba9e(0x120)]!==undefined)_0x495817['priority']=Number(_0x27ecdd['priority']);if(_0x27ecdd[_0x22ba9e(0x10e)]!==undefined)_0x495817['retry_limit']=Number(_0x27ecdd[_0x22ba9e(0x10e)]);if(_0x27ecdd['engineVersion'])_0x495817[_0x22ba9e(0xff)]=_0x27ecdd[_0x22ba9e(0xf4)];if(_0x27ecdd[_0x22ba9e(0x107)])_0x495817['result']=_0x27ecdd[_0x22ba9e(0x107)];if(_0x14ca9c['verbose']){console[_0x22ba9e(0x14f)](_0x22ba9e(0x15c)+_0x287606),console[_0x22ba9e(0x14f)](_0x22ba9e(0x14c)+_0x2e9e4e),console[_0x22ba9e(0x14f)](_0x22ba9e(0x145)+_0xe9bee3);if(_0x495817[_0x22ba9e(0x124)])console['error'](_0x22ba9e(0x104)+_0x495817[_0x22ba9e(0x124)]);if(_0x495817[_0x22ba9e(0x117)])console[_0x22ba9e(0x14f)](_0x22ba9e(0x12f)+_0x495817['timezone']);}const _0xa5c884=await withSpinner(_0x22ba9e(0x156),()=>_0x1eb8f7[_0x22ba9e(0x160)][_0x22ba9e(0x149)](_0x287606,_0x495817),{'verbose':_0x14ca9c[_0x22ba9e(0x163)]});return console[_0x22ba9e(0x14f)](_0x22ba9e(0xe7)+_0xa5c884[_0x22ba9e(0x102)][_0x22ba9e(0x158)]),await handleSingleObjectOutput(_0xa5c884['data'],_0x14ca9c),0x0;}}export class ScheduleUpdateCommand extends BaseCommand{['name']=a26_0x56e718(0x10c);[a26_0x56e718(0x161)]=a26_0x56e718(0x139);[a26_0x56e718(0x116)](_0x20d0a4){const _0x2ee098=a26_0x56e718,_0x14fd9a=_0x20d0a4[_0x2ee098(0x15b)][0x0];if(!_0x14fd9a)return _0x2ee098(0xe9);return undefined;}async[a26_0x56e718(0x159)](_0x30c167){const _0x264f81=a26_0x56e718,{options:_0x2ccb08,args:_0x401979,tdx:_0x488a5c}=_0x30c167,_0x248168=_0x401979[0x0],_0x3ae50d=_0x2ccb08,_0x26b13c={};if(_0x3ae50d[_0x264f81(0xed)])_0x26b13c[_0x264f81(0xed)]=_0x3ae50d['database'];if(_0x3ae50d[_0x264f81(0x127)])_0x26b13c[_0x264f81(0x127)]=_0x3ae50d['type'];if(_0x3ae50d[_0x264f81(0x124)])_0x26b13c[_0x264f81(0x124)]=_0x3ae50d[_0x264f81(0x124)];if(_0x3ae50d[_0x264f81(0x117)])_0x26b13c[_0x264f81(0x117)]=_0x3ae50d[_0x264f81(0x117)];if(_0x3ae50d[_0x264f81(0x153)]!==undefined)_0x26b13c[_0x264f81(0x153)]=Number(_0x3ae50d[_0x264f81(0x153)]);if(_0x3ae50d['priority']!==undefined)_0x26b13c['priority']=Number(_0x3ae50d[_0x264f81(0x120)]);if(_0x3ae50d[_0x264f81(0x10e)]!==undefined)_0x26b13c[_0x264f81(0x122)]=Number(_0x3ae50d['retryLimit']);if(_0x3ae50d['engineVersion'])_0x26b13c[_0x264f81(0xff)]=_0x3ae50d[_0x264f81(0xf4)];if(_0x3ae50d[_0x264f81(0x107)])_0x26b13c['result']=_0x3ae50d[_0x264f81(0x107)];if(_0x3ae50d['file'])try{_0x26b13c['query']=readFileSync(_0x3ae50d[_0x264f81(0x14b)],_0x264f81(0xfe))[_0x264f81(0xe6)]();}catch(_0x26a7ac){throw new SDKError(ErrorCode[_0x264f81(0x128)],'Failed\x20to\x20read\x20file:\x20'+_0x3ae50d[_0x264f81(0x14b)],_0x26a7ac instanceof Error?_0x26a7ac:undefined);}if(Object[_0x264f81(0x125)](_0x26b13c)[_0x264f81(0x110)]===0x0)throw new SDKError(ErrorCode[_0x264f81(0x128)],_0x264f81(0x164));if(_0x2ccb08[_0x264f81(0x163)]){console[_0x264f81(0x14f)](_0x264f81(0xe3)+_0x248168);for(const [_0x58706e,_0x2460a1]of Object[_0x264f81(0x171)](_0x26b13c)){_0x58706e==='query'?console[_0x264f81(0x14f)]('\x20\x20'+_0x58706e+':\x20'+_0x2460a1['substring'](0x0,0x32)+_0x264f81(0x148)):console[_0x264f81(0x14f)]('\x20\x20'+_0x58706e+':\x20'+_0x2460a1);}}const _0x1190db=await withSpinner(_0x264f81(0x172),()=>_0x488a5c[_0x264f81(0x160)][_0x264f81(0x11f)](_0x248168,_0x26b13c),{'verbose':_0x2ccb08['verbose']});return console[_0x264f81(0x14f)]('Schedule\x20updated:\x20'+_0x1190db[_0x264f81(0x102)]['name']),await handleSingleObjectOutput(_0x1190db['data'],_0x2ccb08),0x0;}}export class ScheduleDeleteCommand extends BaseCommand{[a26_0x56e718(0x158)]='schedule:delete';['description']=a26_0x56e718(0x151);[a26_0x56e718(0x116)](_0x27fd7f){const _0x160676=a26_0x56e718,_0x2bc5cf=_0x27fd7f['args'][0x0];if(!_0x2bc5cf)return _0x160676(0x167);return undefined;}async['execute'](_0x48c921){const _0x147b55=a26_0x56e718,{options:_0x3d6ecd,args:_0x2ad61e,tdx:_0x5dc1f2}=_0x48c921,_0x243bac=_0x2ad61e[0x0];if(!_0x3d6ecd[_0x147b55(0xf9)]){const _0x10e200=await confirm(_0x147b55(0x137)+_0x243bac+'\x22?');if(!_0x10e200)return console[_0x147b55(0x14f)](_0x147b55(0x135)),0x0;}const _0x11ee86=await withSpinner(_0x147b55(0x114),()=>_0x5dc1f2[_0x147b55(0x160)][_0x147b55(0x134)](_0x243bac),{'verbose':_0x3d6ecd[_0x147b55(0x163)]});return console['error'](_0x147b55(0xef)+_0x11ee86[_0x147b55(0x102)][_0x147b55(0x158)]),0x0;}}function a26_0x3589(){const _0x27ef09=['schedules','description','json','verbose','At\x20least\x20one\x20option\x20must\x20be\x20provided\x20to\x20update','\x20execution','schedule:show','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20delete\x20<name>','history','tsv','just\x20now','Showing\x20first\x20','\x22...','schedule:list','soon','scheduled_at','ended_at','entries','Updating\x20schedule...','\x20matching\x20\x22','1427464PxRmVq','Updating\x20schedule:\x20','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20history\x20<name>\x20[--from\x20<n>]\x20[--to\x20<n>]','time_zone','trim','Schedule\x20created:\x20','(unnamed)','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20update\x20<name>\x20[options]','98329ypcWLA','executing_user_id','status','database','statusIcon','Schedule\x20deleted:\x20','table','trino','red','queryUrl','engineVersion','5eOQEis','lastRun','round','39YwbAhK','yes','show','max','green','\x20\x20Job\x20ID:\x20','utf-8','engine_version','join','d\x20ago','data','\x20\x20Time:\x20','\x20\x20Cron:\x20','1200596qTlxIT','created_at','result','list','updated_at','m\x20ago','start_at','schedule:update','map','retryLimit','schedule:create','length','Running\x20schedule:\x20','never','nextRun','Deleting\x20schedule...','output','validate','timezone','13845USKoAN','Schedule\x20run\x20submitted:\x20','schedule:history','from','cyan','\x20scheduled\x20quer','Found\x20','update','priority','Run\x20a\x20scheduled\x20query\x20immediately','retry_limit','\x20(showing\x20','cron','keys','query','type','INVALID_ARGUMENT','h\x20ago','toLocaleDateString','Create\x20a\x20scheduled\x20query','181420smALOq','Query\x20file\x20is\x20empty','\x20\x20Num:\x20','\x20\x20Timezone:\x20','queries','Getting\x20schedule\x20details...','job_id','No\x20scheduled\x20queries\x20found','delete','Cancelled','72aBQCQz','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20schedule\x20\x22','next_run_at','Update\x20a\x20scheduled\x20query','Getting\x20schedule\x20history...','dim','3736668kgbaFV','count','num','listQueries','repeat','end_at','success','\x20created','Searching\x20scheduled\x20queries\x20matching\x20\x22','\x20\x20Type:\x20','log','schedule:run','...','create','πŸ“…\x20','file','\x20\x20Database:\x20','\x20\x20β†’\x20','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20create\x20<name>\x20-d\x20<db>\x20--file\x20<path>\x20[options]','error','user_name','Delete\x20a\x20scheduled\x20query','/app/queries/editor?queryId=','delay','last_job','padEnd','Creating\x20schedule...','556970BEvJkY','name','execute','getTime','args','Creating\x20schedule:\x20','format','in\x20','pagination'];a26_0x3589=function(){return _0x27ef09;};return a26_0x3589();}export class ScheduleRunCommand extends BaseCommand{['name']=a26_0x56e718(0x147);['description']=a26_0x56e718(0x121);[a26_0x56e718(0x116)](_0x31bb2d){const _0x5493ee=a26_0x56e718,_0x40470d=_0x31bb2d[_0x5493ee(0x15b)][0x0];if(!_0x40470d)return'Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20run\x20<name>\x20[--time\x20<iso8601>]\x20[--num\x20<1-10>]';return undefined;}async[a26_0x56e718(0x159)](_0x745116){const _0x479eb9=a26_0x56e718,{options:_0x1e99e2,args:_0x22dbe2,tdx:_0x56fc8f}=_0x745116,_0x163f2e=_0x22dbe2[0x0],_0x5a09d4=_0x1e99e2,_0x5ca856=_0x5a09d4['time'],_0x3f775e=_0x5a09d4[_0x479eb9(0x13e)]!==undefined?Number(_0x5a09d4['num']):undefined;if(_0x1e99e2['verbose']){console[_0x479eb9(0x14f)](_0x479eb9(0x111)+_0x163f2e);if(_0x5ca856)console['error'](_0x479eb9(0x103)+_0x5ca856);if(_0x3f775e)console[_0x479eb9(0x14f)](_0x479eb9(0x12e)+_0x3f775e);}const _0x2572ad=await withSpinner('Running\x20schedule...',()=>_0x56fc8f[_0x479eb9(0x160)]['run'](_0x163f2e,{'time':_0x5ca856,'num':_0x3f775e}),{'verbose':_0x1e99e2['verbose']}),_0xf6c558=_0x2572ad[_0x479eb9(0x102)]['jobs'];console[_0x479eb9(0x14f)](_0x479eb9(0x119)+_0xf6c558[_0x479eb9(0x110)]+'\x20job'+(_0xf6c558[_0x479eb9(0x110)]!==0x1?'s':'')+_0x479eb9(0x143));for(const _0x56a9bb of _0xf6c558){console[_0x479eb9(0x14f)](_0x479eb9(0xfd)+_0x56a9bb[_0x479eb9(0x132)]);}return await handleSDKOutput(_0xf6c558,_0x1e99e2),0x0;}}export class ScheduleHistoryCommand extends BaseCommand{[a26_0x56e718(0x158)]=a26_0x56e718(0x11a);[a26_0x56e718(0x161)]='Show\x20schedule\x20execution\x20history';['validate'](_0x4d1085){const _0x4325ef=a26_0x56e718,_0x5a9321=_0x4d1085['args'][0x0];if(!_0x5a9321)return _0x4325ef(0xe4);return undefined;}async[a26_0x56e718(0x159)](_0x721ac6){const _0x58c536=a26_0x56e718,{options:_0x14b76e,args:_0x2f41bb,tdx:_0x56c7f2}=_0x721ac6,_0x56b06c=_0x2f41bb[0x0],_0x13ac80=_0x14b76e,_0x5b6656=_0x13ac80[_0x58c536(0x11b)]!==undefined?Number(_0x13ac80[_0x58c536(0x11b)]):undefined,_0x367c0b=_0x13ac80['to']!==undefined?Number(_0x13ac80['to']):undefined,_0x4c0df1=await withSpinner(_0x58c536(0x13a),()=>_0x56c7f2[_0x58c536(0x160)]['history'](_0x56b06c,{'from':_0x5b6656,'to':_0x367c0b}),{'verbose':_0x14b76e[_0x58c536(0x163)]}),_0x45643a=_0x4c0df1[_0x58c536(0x102)];console[_0x58c536(0x14f)]('Found\x20'+_0x45643a[_0x58c536(0x13d)]+_0x58c536(0x165)+(_0x45643a[_0x58c536(0x13d)]!==0x1?'s':'')+_0x58c536(0x123)+_0x45643a[_0x58c536(0x11b)]+'-'+_0x45643a['to']+')');const _0x38951e=_0x45643a[_0x58c536(0x168)][_0x58c536(0x10d)](_0xba0b0a=>({'job_id':_0xba0b0a[_0x58c536(0x132)],'type':_0xba0b0a[_0x58c536(0x127)],'status':_0xba0b0a['status'],'scheduled_at':_0xba0b0a[_0x58c536(0x16f)],'created_at':_0xba0b0a[_0x58c536(0x106)],'start_at':_0xba0b0a[_0x58c536(0x10b)],'end_at':_0xba0b0a[_0x58c536(0x141)]}));return await handleSDKOutput(_0x38951e,_0x14b76e),0x0;}}
@@ -1 +1 @@
1
- const a27_0x1b2446=a27_0x78ee;(function(_0x1fb48f,_0x35b0f2){const _0x4d815f=a27_0x78ee,_0x36ae10=_0x1fb48f();while(!![]){try{const _0x3786cd=parseInt(_0x4d815f(0x147))/0x1+parseInt(_0x4d815f(0x14e))/0x2*(-parseInt(_0x4d815f(0x102))/0x3)+parseInt(_0x4d815f(0x160))/0x4*(-parseInt(_0x4d815f(0x16c))/0x5)+parseInt(_0x4d815f(0x103))/0x6+-parseInt(_0x4d815f(0x11a))/0x7*(-parseInt(_0x4d815f(0x175))/0x8)+-parseInt(_0x4d815f(0x169))/0x9+parseInt(_0x4d815f(0x158))/0xa*(parseInt(_0x4d815f(0x104))/0xb);if(_0x3786cd===_0x35b0f2)break;else _0x36ae10['push'](_0x36ae10['shift']());}catch(_0x1aaa0f){_0x36ae10['push'](_0x36ae10['shift']());}}}(a27_0x43b8,0x35d65));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner,formatElapsed}from'../utils/spinner.js';import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{executeSchemaQuery}from'../sdk/segment/fields-display.js';import{isYamlFilePath,resolveYamlFilePath}from'../sdk/segment/segment-path-parser.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{openBrowser}from'../utils/process.js';function a27_0x78ee(_0x1971a4,_0x4ac94c){_0x1971a4=_0x1971a4-0xe6;const _0x43b881=a27_0x43b8();let _0x78eefd=_0x43b881[_0x1971a4];return _0x78eefd;}import a27_0x68b9f2 from'chalk';async function resolveSegmentTarget(_0x24b3e1,_0x14580d,_0x5ce3ef){const _0x21d54a=a27_0x78ee;if(isYamlFilePath(_0x24b3e1))try{const _0x75386e=await resolveYamlFilePath(_0x24b3e1);return _0x5ce3ef&&(console['error']('Resolved\x20YAML\x20file:\x20'+_0x24b3e1),console[_0x21d54a(0x16a)]('\x20\x20Parent\x20segment:\x20'+_0x75386e[_0x21d54a(0xf1)]),console['error'](_0x21d54a(0x11e)+_0x75386e['segmentName']),console[_0x21d54a(0x16a)](_0x21d54a(0x107)+(_0x75386e[_0x21d54a(0x17f)]||_0x21d54a(0x154))),console[_0x21d54a(0x16a)]('\x20\x20Full\x20path:\x20'+_0x75386e[_0x21d54a(0x166)])),_0x75386e[_0x21d54a(0x166)];}catch(_0x1c3b6b){throw new SDKError(ErrorCode[_0x21d54a(0xf6)],_0x21d54a(0x12b)+_0x1c3b6b[_0x21d54a(0x113)]);}if(!_0x14580d)throw new SDKError(ErrorCode[_0x21d54a(0xf6)],_0x21d54a(0xf5));return _0x14580d+'/'+_0x24b3e1;}export class SegmentDescribeCommand extends BaseCommand{[a27_0x1b2446(0xff)]='segment:describe';['description']=a27_0x1b2446(0xf8);async[a27_0x1b2446(0x10e)](_0x760bcd){const _0x954772=a27_0x1b2446,{options:_0x5cc9bc,args:_0x5335c6,tdx:_0x16530e}=_0x760bcd,_0x182534=_0x5335c6[0x0],_0x1e5c17=!_0x182534&&!!_0x5cc9bc[_0x954772(0xf1)],_0x2ed54d=_0x182534||_0x5cc9bc[_0x954772(0xf1)];if(!_0x2ed54d)return console['error'](_0x954772(0x140)),console[_0x954772(0x16a)](_0x954772(0xea)),console['error'](_0x954772(0x15c)),console[_0x954772(0x16a)](_0x954772(0x10c)),console[_0x954772(0x16a)](_0x954772(0xf3)),console['error'](_0x954772(0x177)),console[_0x954772(0x16a)]('\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>'),0x1;try{const _0x426da3=_0x5cc9bc[_0x954772(0xe8)];let _0x32246f=_0x2ed54d;!_0x1e5c17&&_0x426da3&&!_0x2ed54d['includes']('/')&&(_0x32246f=_0x426da3+'/'+_0x2ed54d,_0x5cc9bc[_0x954772(0x121)]&&console['error']('Resolved\x20relative\x20path\x20to:\x20'+_0x32246f));const _0xf2c980=await withSpinner('Resolving\x20path\x20\x27'+_0x32246f+_0x954772(0x181),()=>_0x16530e[_0x954772(0xeb)][_0x954772(0x16f)](_0x32246f),{'verbose':_0x5cc9bc[_0x954772(0x121)]}),_0x76994a=_0xf2c980[_0x954772(0x10d)];_0x5cc9bc['verbose']&&(console[_0x954772(0x16a)](_0x954772(0x11c)+_0x76994a['type']),console[_0x954772(0x16a)](_0x954772(0x105)+_0x76994a['parentId']),_0x76994a[_0x954772(0x14b)]&&console[_0x954772(0x16a)]('Folder\x20ID:\x20'+_0x76994a[_0x954772(0x14b)]),_0x76994a['segmentId']&&console[_0x954772(0x16a)](_0x954772(0xfe)+_0x76994a[_0x954772(0x11b)]));if(_0x76994a['type']==='parent'){const _0x1dec3e=await withSpinner(_0x954772(0xef),()=>_0x16530e[_0x954772(0xeb)][_0x954772(0x136)](_0x76994a[_0x954772(0x157)]),{'verbose':_0x5cc9bc[_0x954772(0x121)]});await handleSingleObjectOutput(_0x1dec3e['data'],_0x5cc9bc);}else{if(_0x76994a['type']===_0x954772(0x182)){if(!_0x76994a[_0x954772(0x14b)])throw new SDKError(ErrorCode[_0x954772(0x123)],_0x954772(0xee));const _0x406084=await withSpinner('Fetching\x20folder\x20details...',()=>_0x16530e[_0x954772(0xeb)]['getFolder'](_0x76994a[_0x954772(0x14b)]),{'verbose':_0x5cc9bc[_0x954772(0x121)]});await handleSingleObjectOutput(_0x406084[_0x954772(0x10d)],_0x5cc9bc);}else{if(_0x76994a[_0x954772(0xec)]==='segment'){if(!_0x76994a['segmentId'])throw new SDKError(ErrorCode[_0x954772(0xf7)],_0x954772(0x15b));const _0x476cd5=await withSpinner('Fetching\x20segment\x20details...',()=>_0x16530e[_0x954772(0xeb)]['getSegment'](_0x76994a[_0x954772(0x157)],_0x76994a[_0x954772(0x11b)]),{'verbose':_0x5cc9bc['verbose']});await handleSingleObjectOutput(_0x476cd5['data'],_0x5cc9bc);}}}return 0x0;}catch(_0x3891fb){if(_0x3891fb instanceof SDKError)return console[_0x954772(0x16a)]('Error:\x20'+_0x3891fb[_0x954772(0x113)]),_0x3891fb[_0x954772(0x17e)]&&console[_0x954772(0x16a)](_0x954772(0x116)+_0x3891fb[_0x954772(0x17e)]),0x1;throw _0x3891fb;}}}export class SegmentShowCommand extends BaseCommand{[a27_0x1b2446(0xff)]=a27_0x1b2446(0x13f);[a27_0x1b2446(0x148)]=a27_0x1b2446(0x135);async[a27_0x1b2446(0x10e)](_0x65821e){const _0x149291=a27_0x1b2446,{options:_0x20bea2,args:_0x4d88b,tdx:_0x1b2448}=_0x65821e,_0x5115f4=_0x4d88b[0x0];if(!_0x5115f4)return console[_0x149291(0x16a)](_0x149291(0x108)),console['error'](_0x149291(0x122)),console[_0x149291(0x16a)](_0x149291(0x12d)),console[_0x149291(0x16a)](_0x149291(0x15c)),console[_0x149291(0x16a)](_0x149291(0x171)),console[_0x149291(0x16a)](_0x149291(0x162)),0x1;try{const _0x2cfce4=_0x20bea2['parentSegment'],_0x3f72f1=await resolveSegmentTarget(_0x5115f4,_0x2cfce4,_0x20bea2[_0x149291(0x121)]);_0x20bea2['verbose']&&console['error'](_0x149291(0x117)+_0x3f72f1);const _0x4c9a45=await withSpinner(_0x149291(0x143)+_0x5115f4+_0x149291(0x181),()=>_0x1b2448[_0x149291(0xeb)]['resolvePathToResource'](_0x3f72f1),{'verbose':_0x20bea2[_0x149291(0x121)]}),_0x569106=_0x4c9a45[_0x149291(0x10d)];_0x20bea2[_0x149291(0x121)]&&(console[_0x149291(0x16a)](_0x149291(0x11c)+_0x569106[_0x149291(0xec)]),console[_0x149291(0x16a)](_0x149291(0x105)+_0x569106['parentId']));if(_0x569106[_0x149291(0xec)]===_0x149291(0x182))return console['error']('Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.'),console[_0x149291(0x16a)](_0x149291(0x14a)),0x1;if(_0x569106[_0x149291(0xec)]==='parent')return console['error'](_0x149291(0x167)),console['error'](_0x149291(0xfa)),0x1;if(!_0x569106[_0x149291(0x11b)])throw new SDKError(ErrorCode[_0x149291(0xf7)],_0x149291(0x15b));const _0x104c57=await withSpinner(_0x149291(0x110),()=>_0x1b2448[_0x149291(0xeb)][_0x149291(0x151)](_0x569106[_0x149291(0x157)],_0x569106[_0x149291(0x11b)]),{'verbose':_0x20bea2['verbose']});let _0x5c5566=_0x104c57[_0x149291(0x10d)];const _0x652986=resolveLimit(_0x20bea2[_0x149291(0x137)],DEFAULT_DISPLAY_LIMIT),_0x326fdd=/\bLIMIT\s+\d+/i[_0x149291(0xf2)](_0x5c5566);!_0x326fdd&&(_0x5c5566=_0x5c5566[_0x149291(0x13a)]()[_0x149291(0x176)](/;+$/,''),_0x5c5566=_0x149291(0x106)+_0x5c5566+'\x0a)\x20AS\x20segment_query\x0aLIMIT\x20'+_0x652986);_0x20bea2[_0x149291(0x121)]&&console['error'](_0x149291(0xfc)+_0x5c5566);const _0x44f991=await withProgressSpinner(_0x149291(0x16d),async _0x13461b=>{const _0x136f4d=_0x149291,_0x329a5d=await _0x1b2448[_0x136f4d(0x120)]['execute'](_0x5c5566,{'catalog':'td','schema':_0x136f4d(0x13d),'onJobId':_0x41d826=>{const _0x19f054=_0x136f4d;_0x13461b[_0x19f054(0x156)](_0x41d826);}});return _0x329a5d;},{'verbose':_0x20bea2[_0x149291(0x121)]}),_0x5708ab=_0x44f991[_0x149291(0x10d)],_0x2cfe77=_0x5708ab['jobId']?'\x20[Job\x20ID:\x20'+_0x5708ab[_0x149291(0x173)]+']':'';return console[_0x149291(0x16a)](_0x149291(0x183)+_0x5708ab['stats'][_0x149291(0x15d)][_0x149291(0x153)]()+_0x149291(0x13b)+(_0x149291(0x174)+formatElapsed(_0x5708ab[_0x149291(0x114)][_0x149291(0x14c)])+_0x2cfe77)),await handleQueryOutput(_0x5708ab,_0x20bea2),0x0;}catch(_0x228b41){if(_0x228b41 instanceof SDKError)return console[_0x149291(0x16a)](_0x149291(0x14d)+_0x228b41[_0x149291(0xf4)]+']'),console[_0x149291(0x16a)]('\x0a'+_0x228b41[_0x149291(0x113)]),0x1;throw _0x228b41;}}}export class SegmentFolderListCommand extends BaseCommand{[a27_0x1b2446(0xff)]='segment:folder:list';[a27_0x1b2446(0x148)]=a27_0x1b2446(0x12f);async[a27_0x1b2446(0x10e)](_0x44cbe4){const _0x37c0fc=a27_0x1b2446,{options:_0x5be00d,args:_0x532e03,tdx:_0x1ce17b}=_0x44cbe4;if(_0x532e03['length']===0x0)return console[_0x37c0fc(0x16a)](_0x37c0fc(0x17b)),console[_0x37c0fc(0x16a)](_0x37c0fc(0x10f)),0x1;const _0x37698c=_0x532e03[0x0];try{_0x5be00d[_0x37c0fc(0x121)]&&(console[_0x37c0fc(0x16a)](_0x37c0fc(0x100)+_0x5be00d['site']),console[_0x37c0fc(0x16a)](_0x37c0fc(0x12a)+_0x37698c));const _0x3223cb=await withSpinner(_0x37c0fc(0x141)+_0x37698c+'\x27...',()=>_0x1ce17b[_0x37c0fc(0xeb)][_0x37c0fc(0x101)](_0x37698c),{'verbose':_0x5be00d['verbose']}),_0x49614a=_0x3223cb[_0x37c0fc(0x10d)];_0x5be00d[_0x37c0fc(0x121)]&&console[_0x37c0fc(0x16a)](_0x37c0fc(0x15e)+_0x49614a);const _0x170682=await withSpinner('Listing\x20folders\x20for\x20parent\x20\x27'+_0x37698c+_0x37c0fc(0x181),()=>_0x1ce17b[_0x37c0fc(0xeb)][_0x37c0fc(0x132)](_0x49614a),{'verbose':_0x5be00d[_0x37c0fc(0x121)]}),_0x4ba541=_0x170682[_0x37c0fc(0x10d)];return console[_0x37c0fc(0x16a)](_0x37c0fc(0x172)+_0x4ba541[_0x37c0fc(0xe7)]+'\x20folder'+(_0x4ba541[_0x37c0fc(0xe7)]!==0x1?'s':'')),await handleSDKOutput(_0x4ba541,_0x5be00d),0x0;}catch(_0x176fcb){if(_0x176fcb instanceof SDKError)return console[_0x37c0fc(0x16a)](_0x37c0fc(0x10b)+_0x176fcb[_0x37c0fc(0x113)]),_0x176fcb[_0x37c0fc(0x17e)]&&console[_0x37c0fc(0x16a)]('\x20\x20Cause:\x20'+_0x176fcb[_0x37c0fc(0x17e)]),0x1;throw _0x176fcb;}}}export class SegmentFolderShowCommand extends BaseCommand{['name']='segment:folder:show';[a27_0x1b2446(0x148)]=a27_0x1b2446(0x16b);async['execute'](_0x49d048){const _0x1852b1=a27_0x1b2446,{options:_0x4651d6,args:_0x2dc569,tdx:_0x31c37d}=_0x49d048;if(_0x2dc569['length']===0x0)return console[_0x1852b1(0x16a)](_0x1852b1(0x10a)),console[_0x1852b1(0x16a)](_0x1852b1(0x129)),0x1;try{const {parentId:_0x524a7b,childId:_0x5ef0eb}=parseSegmentRef(_0x2dc569[0x0]);_0x4651d6[_0x1852b1(0x121)]&&(console[_0x1852b1(0x16a)]('Site:\x20'+_0x4651d6[_0x1852b1(0x13c)]),console[_0x1852b1(0x16a)](_0x1852b1(0x12a)+_0x524a7b),_0x5ef0eb&&console[_0x1852b1(0x16a)](_0x1852b1(0xf0)+_0x5ef0eb));if(!_0x5ef0eb)return console[_0x1852b1(0x16a)]('Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)'),0x1;const _0x2604c8=await withSpinner(_0x1852b1(0x141)+_0x524a7b+'\x27...',()=>_0x31c37d['segment'][_0x1852b1(0x101)](_0x524a7b),{'verbose':_0x4651d6['verbose']}),_0x418850=_0x2604c8[_0x1852b1(0x10d)];_0x4651d6[_0x1852b1(0x121)]&&console[_0x1852b1(0x16a)](_0x1852b1(0x15e)+_0x418850);const _0x50a6de=await withSpinner(_0x1852b1(0x145)+_0x5ef0eb+_0x1852b1(0x181),()=>_0x31c37d[_0x1852b1(0xeb)][_0x1852b1(0xf9)](_0x418850,_0x5ef0eb),{'verbose':_0x4651d6['verbose']}),_0xb3be7a=_0x50a6de[_0x1852b1(0x10d)];_0x4651d6['verbose']&&console[_0x1852b1(0x16a)]('Resolved\x20folder\x20ID:\x20'+_0xb3be7a);const _0x32f687=await withSpinner(_0x1852b1(0x127)+_0x5ef0eb+_0x1852b1(0x181),()=>_0x31c37d[_0x1852b1(0xeb)][_0x1852b1(0x11f)](_0xb3be7a),{'verbose':_0x4651d6[_0x1852b1(0x121)]});return await handleSDKOutput([_0x32f687[_0x1852b1(0x10d)]],_0x4651d6),0x0;}catch(_0x499ecd){if(_0x499ecd instanceof SDKError)return console['error'](_0x1852b1(0x10b)+_0x499ecd[_0x1852b1(0x113)]),_0x499ecd[_0x1852b1(0x17e)]&&console[_0x1852b1(0x16a)]('\x20\x20Cause:\x20'+_0x499ecd[_0x1852b1(0x17e)]),0x1;throw _0x499ecd;}}}export class SegmentSQLCommand extends BaseCommand{[a27_0x1b2446(0xff)]=a27_0x1b2446(0x130);[a27_0x1b2446(0x148)]=a27_0x1b2446(0x17d);async['execute'](_0x19e8e0){const _0x5e8454=a27_0x1b2446,{options:_0x1acbd4,args:_0x1e7138,tdx:_0x35f795}=_0x19e8e0,_0x2b3cbd=_0x1e7138[0x0];if(!_0x2b3cbd)return console['error'](_0x5e8454(0x108)),console[_0x5e8454(0x16a)](_0x5e8454(0x124)),console[_0x5e8454(0x16a)](_0x5e8454(0x112)),console[_0x5e8454(0x16a)](_0x5e8454(0x15c)),console[_0x5e8454(0x16a)](_0x5e8454(0x150)),console[_0x5e8454(0x16a)](_0x5e8454(0x17a)),0x1;try{const _0x16b6ad=_0x1acbd4[_0x5e8454(0xf1)],_0xa738b=await resolveSegmentTarget(_0x2b3cbd,_0x16b6ad,_0x1acbd4[_0x5e8454(0x121)]);_0x1acbd4[_0x5e8454(0x121)]&&console[_0x5e8454(0x16a)](_0x5e8454(0x117)+_0xa738b);const _0x32e419=await withSpinner('Resolving\x20\x27'+_0x2b3cbd+_0x5e8454(0x181),()=>_0x35f795[_0x5e8454(0xeb)][_0x5e8454(0x16f)](_0xa738b),{'verbose':_0x1acbd4[_0x5e8454(0x121)]}),_0x22a868=_0x32e419['data'];_0x1acbd4[_0x5e8454(0x121)]&&(console[_0x5e8454(0x16a)](_0x5e8454(0x11c)+_0x22a868['type']),console[_0x5e8454(0x16a)](_0x5e8454(0x105)+_0x22a868['parentId']));if(_0x22a868[_0x5e8454(0xec)]==='folder')return console[_0x5e8454(0x16a)](_0x5e8454(0xfb)),console['error'](_0x5e8454(0x161)),0x1;if(_0x22a868[_0x5e8454(0xec)]===_0x5e8454(0x15a))return console[_0x5e8454(0x16a)]('Error:\x20Cannot\x20get\x20SQL\x20for\x20parent\x20segment\x20with\x20this\x20command.'),console[_0x5e8454(0x16a)](_0x5e8454(0x118)),0x1;if(!_0x22a868[_0x5e8454(0x11b)])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x5e8454(0x15b));const _0x5d572e=await withSpinner(_0x5e8454(0x110),()=>_0x35f795[_0x5e8454(0xeb)][_0x5e8454(0x151)](_0x22a868[_0x5e8454(0x157)],_0x22a868['segmentId']),{'verbose':_0x1acbd4[_0x5e8454(0x121)]}),_0x2bea5b=_0x5d572e['data'];return _0x1acbd4[_0x5e8454(0x152)]===_0x5e8454(0x163)||_0x1acbd4['format']===_0x5e8454(0x16e)?await handleSDKOutput([{'sql':_0x2bea5b}],_0x1acbd4):console[_0x5e8454(0x155)](_0x2bea5b),0x0;}catch(_0x79d89){if(_0x79d89 instanceof SDKError)return console[_0x5e8454(0x16a)](_0x5e8454(0x10b)+_0x79d89[_0x5e8454(0x113)]),_0x79d89['cause']&&console[_0x5e8454(0x16a)](_0x5e8454(0x116)+_0x79d89['cause']),0x1;throw _0x79d89;}}}function a27_0x43b8(){const _0x4497cb=['69308fSDSIp','description','parentFolder','Use:\x20tdx\x20sg\x20view\x20<name>\x20\x20#\x20To\x20show\x20folder\x20details','folderId','elapsedTimeMillis','βœ–\x20Query\x20failed\x20[','30JVmKFX','segment:folder:create','\x20\x20tdx\x20sg\x20sql\x20\x22Premium\x20Users\x22','getSegmentSQL','format','toLocaleString','(root)','log','setJobId','parentId','10lIYIyR','Fetching\x20folder\x20details...','parent','Segment\x20ID\x20missing\x20from\x20resolved\x20path','Examples:','processedRows','Resolved\x20parent\x20ID:\x20','Usage:\x20tdx\x20sg\x20view\x20<name>\x20[-w]','4ghmCTe','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','\x20\x20tdx\x20sg\x20show\x20segments/my-audience/premium-users.yml','json','Create\x20segment\x20folder\x20for\x20organization','Use:\x20tdx\x20ps\x20desc','fullPath','Error:\x20Cannot\x20execute\x20query\x20for\x20parent\x20segment\x20with\x20this\x20command.','Show\x20child\x20segment\x20schema\x20(column\x20types)','53901AeerFL','error','Show\x20segment\x20folder\x20details','1700140jACVeH','Executing\x20segment\x20query...','jsonl','resolvePathToResource','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20view\x20<path/to/segment.yml>','\x20\x20tdx\x20sg\x20show\x20\x22Premium\x20Users\x22','βœ”\x20Found\x20','jobId','in\x20','696880PqPaZZ','replace','\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','green','Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required','\x20\x20tdx\x20sg\x20sql\x20segments/my-audience/premium-users.yml','Error:\x20Parent\x20segment\x20name\x20is\x20required','Folder\x20ID:\x20','Get\x20SQL\x20query\x20for\x20child\x20segment','cause','folderPath','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20-w\x20\x20#\x20Open\x20segment\x20in\x20web\x20browser','\x27...','folder','βœ”\x20Query\x20completed:\x20Processed\x20','Use:\x20tdx\x20ps\x20view\x20-w','length','segmentPath','Usage:\x20tdx\x20sg\x20desc\x20<name>','Usage:\x20tdx\x20segment\x20describe\x20<path>','segment','type','/app/ps/','Folder\x20ID\x20missing\x20from\x20resolved\x20path','Fetching\x20parent\x20segment\x20details...','Folder\x20name:\x20','parentSegment','test','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22','code','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','INVALID_ARGUMENT','SEGMENT_NOT_FOUND','Show\x20segment\x20or\x20folder\x20details','resolveFolderId','Use:\x20tdx\x20ps\x20show','Error:\x20Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.','SQL\x20query:\x0a','/e/','Segment\x20ID:\x20','name','Site:\x20','resolveParentId','30978aQveLQ','1313022ZAXrHF','3807859Kkpelg','Parent\x20ID:\x20','SELECT\x20*\x20FROM\x20(\x0a','\x20\x20Folder\x20path:\x20','Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required','Error:\x20Cannot\x20open\x20parent\x20segment\x20with\x20this\x20command.','Error:\x20Folder\x20reference\x20is\x20required','Error:\x20','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22','data','execute','Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>','Fetching\x20SQL\x20for\x20segment...','createFolder','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20sql\x20<path/to/segment.yml>','message','stats','cyan','\x20\x20Cause:\x20','Target\x20path:\x20','Use:\x20tdx\x20ps\x20sql','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20\x20\x20\x20\x20#\x20View\x20child\x20segment\x20details','7dTcMLu','segmentId','Resolved\x20type:\x20','\x20Opening\x20','\x20\x20Segment\x20name:\x20','getFolder','query','verbose','Usage:\x20tdx\x20sg\x20show\x20<name>','SEGMENT_FOLDER_NOT_FOUND','Usage:\x20tdx\x20sg\x20sql\x20<name>','\x20\x20tdx\x20sg\x20desc\x20\x22Premium\x20Users\x22','Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]','Fetching\x20folder\x20\x27','Resolved\x20parent\x20folder\x20ID:\x20','Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>','Parent\x20name:\x20','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','Use:\x20tdx\x20ps\x20view','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20show\x20<path/to/segment.yml>','segment:view','List\x20segment\x20folders\x20under\x20a\x20parent\x20segment','segment:sql','Parent\x20segment:\x20','listFolders','Error:\x20Folder\x20or\x20segment\x20name,\x20or\x20YAML\x20file\x20path\x20is\x20required','url','Execute\x20child\x20segment\x20SQL\x20query\x20and\x20show\x20results','getParent','limit','Error:\x20Cannot\x20view\x20parent\x20segment\x20details\x20with\x20this\x20command.','web','trim','\x20rows\x20','site','information_schema','Options:','segment:show','Error:\x20Path\x20or\x20name\x20is\x20required','Resolving\x20parent\x20segment\x20\x27','Error:\x20Cannot\x20show\x20schema\x20for\x20parent\x20segment\x20with\x20this\x20command.','Resolving\x20\x27','βœ”\x20Created\x20folder\x20\x27','Resolving\x20folder\x20\x27','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20desc\x20<path/to/segment.yml>'];a27_0x43b8=function(){return _0x4497cb;};return a27_0x43b8();}export class SegmentFolderCreateCommand extends BaseCommand{[a27_0x1b2446(0xff)]=a27_0x1b2446(0x14f);[a27_0x1b2446(0x148)]=a27_0x1b2446(0x164);async[a27_0x1b2446(0x10e)](_0x1ef559){const _0x4def44=a27_0x1b2446,{options:_0x5a7832,args:_0x3a1041,tdx:_0x3347b5}=_0x1ef559,_0x322103=_0x5a7832;if(_0x3a1041[_0x4def44(0xe7)]<0x2)return console['error'](_0x4def44(0x179)),console['error'](_0x4def44(0x126)),0x1;const _0x136e49=_0x3a1041[0x0],_0x2716e5=_0x3a1041[0x1];_0x322103[_0x4def44(0x121)]&&(console[_0x4def44(0x16a)](_0x4def44(0x100)+_0x322103[_0x4def44(0x13c)]),console[_0x4def44(0x16a)](_0x4def44(0x131)+_0x136e49),console[_0x4def44(0x16a)](_0x4def44(0xf0)+_0x2716e5));let _0x24c65e;if(_0x322103[_0x4def44(0x149)]){const _0x75b7ec=_0x322103[_0x4def44(0x149)],_0x5d6a42=await withSpinner(_0x4def44(0x141)+_0x136e49+'\x27...',()=>_0x3347b5['segment']['resolveParentId'](_0x136e49),{'verbose':_0x322103['verbose']}),_0xb4c957=_0x5d6a42['data'],_0x2ac59a=await withSpinner('Resolving\x20parent\x20folder\x20\x27'+_0x75b7ec+_0x4def44(0x181),()=>_0x3347b5['segment'][_0x4def44(0xf9)](_0xb4c957,_0x75b7ec),{'verbose':_0x322103[_0x4def44(0x121)]});_0x24c65e=_0x2ac59a[_0x4def44(0x10d)],_0x322103[_0x4def44(0x121)]&&console['error'](_0x4def44(0x128)+_0x24c65e);}const _0x27d14c={'name':_0x2716e5,'description':_0x322103[_0x4def44(0x148)],'parentFolderId':_0x24c65e},_0x5afff6=await withSpinner('Creating\x20folder\x20\x27'+_0x2716e5+_0x4def44(0x181),()=>_0x3347b5['segment'][_0x4def44(0x111)](_0x136e49,_0x27d14c),{'verbose':_0x322103[_0x4def44(0x121)]}),_0x4d5fa3=_0x5afff6[_0x4def44(0x10d)];return console[_0x4def44(0x16a)](_0x4def44(0x144)+_0x4d5fa3[_0x4def44(0xff)]+'\x27\x20with\x20ID:\x20'+_0x4d5fa3['id']),await handleSDKOutput([_0x4d5fa3],_0x322103),0x0;}}export class SegmentViewCommand extends BaseCommand{['name']=a27_0x1b2446(0x12e);[a27_0x1b2446(0x148)]='Show\x20folder\x20or\x20child\x20segment\x20details';async[a27_0x1b2446(0x10e)](_0x2d36b8){const _0x4007ee=a27_0x1b2446,{options:_0xd54376,args:_0x3680fc,tdx:_0x2cf79d}=_0x2d36b8,_0x441048=_0x3680fc[0x0];if(!_0x441048)return console[_0x4007ee(0x16a)](_0x4007ee(0x133)),console[_0x4007ee(0x16a)](_0x4007ee(0x15f)),console[_0x4007ee(0x16a)](_0x4007ee(0x170)),console[_0x4007ee(0x16a)](_0x4007ee(0x13e)),console[_0x4007ee(0x16a)]('\x20\x20-w,\x20--web\x20\x20Open\x20segment\x20in\x20web\x20browser'),console['error'](_0x4007ee(0x15c)),console[_0x4007ee(0x16a)]('\x20\x20tdx\x20sg\x20view\x20\x22Marketing\x22\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20folder\x20details'),console[_0x4007ee(0x16a)](_0x4007ee(0x119)),console['error'](_0x4007ee(0x180)),console['error']('\x20\x20tdx\x20sg\x20view\x20segments/my-audience/premium-users.yml'),0x1;try{const _0x45607e=_0xd54376[_0x4007ee(0xf1)],_0x50aaee=await resolveSegmentTarget(_0x441048,_0x45607e,_0xd54376[_0x4007ee(0x121)]);_0xd54376[_0x4007ee(0x121)]&&console['error'](_0x4007ee(0x117)+_0x50aaee);const _0x2199f4=await withSpinner(_0x4007ee(0x143)+_0x441048+_0x4007ee(0x181),()=>_0x2cf79d[_0x4007ee(0xeb)][_0x4007ee(0x16f)](_0x50aaee),{'verbose':_0xd54376[_0x4007ee(0x121)]}),_0x130488=_0x2199f4['data'];_0xd54376[_0x4007ee(0x121)]&&(console['error'](_0x4007ee(0x11c)+_0x130488[_0x4007ee(0xec)]),console['error'](_0x4007ee(0x105)+_0x130488[_0x4007ee(0x157)]),_0x130488[_0x4007ee(0x14b)]&&console[_0x4007ee(0x16a)](_0x4007ee(0x17c)+_0x130488[_0x4007ee(0x14b)]),_0x130488[_0x4007ee(0x11b)]&&console['error']('Segment\x20ID:\x20'+_0x130488['segmentId']));if(_0xd54376[_0x4007ee(0x139)]){if(_0x130488['type']===_0x4007ee(0x182))return console[_0x4007ee(0x16a)]('Error:\x20Cannot\x20open\x20folder\x20in\x20web\x20browser.\x20Use\x20a\x20segment\x20name\x20instead.'),0x1;if(_0x130488['type']==='parent')return console['error'](_0x4007ee(0x109)),console['error'](_0x4007ee(0xe6)),0x1;if(!_0x130488[_0x4007ee(0x11b)])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x4007ee(0x15b));const _0x4b27c0=getConsoleNextUrl(_0xd54376[_0x4007ee(0x13c)],_0x4007ee(0xed)+_0x130488[_0x4007ee(0x157)]+_0x4007ee(0xfd)+_0x130488[_0x4007ee(0x11b)]);return console[_0x4007ee(0x16a)](a27_0x68b9f2[_0x4007ee(0x178)]('βœ”')+_0x4007ee(0x11d)+a27_0x68b9f2[_0x4007ee(0x115)](_0x4b27c0)),openBrowser(_0x4b27c0),0x0;}if(_0x130488[_0x4007ee(0xec)]===_0x4007ee(0x182)){if(!_0x130488[_0x4007ee(0x14b)])throw new SDKError(ErrorCode[_0x4007ee(0x123)],'Folder\x20ID\x20missing\x20from\x20resolved\x20path');const _0x35ba92=await withSpinner(_0x4007ee(0x159),()=>_0x2cf79d[_0x4007ee(0xeb)][_0x4007ee(0x11f)](_0x130488[_0x4007ee(0x14b)]),{'verbose':_0xd54376[_0x4007ee(0x121)]});await handleSingleObjectOutput(_0x35ba92['data'],_0xd54376);}else{if(_0x130488[_0x4007ee(0xec)]==='segment'){if(!_0x130488[_0x4007ee(0x11b)])throw new SDKError(ErrorCode[_0x4007ee(0xf7)],_0x4007ee(0x15b));const _0x3741c7=await withSpinner('Fetching\x20segment\x20details...',()=>_0x2cf79d[_0x4007ee(0xeb)]['getSegment'](_0x130488['parentId'],_0x130488[_0x4007ee(0x11b)]),{'verbose':_0xd54376[_0x4007ee(0x121)]}),_0x4dcbd1=getConsoleNextUrl(_0xd54376[_0x4007ee(0x13c)],_0x4007ee(0xed)+_0x130488['parentId']+'/e/'+_0x130488[_0x4007ee(0x11b)]),_0x2c21f0=_0x3741c7['data'];_0x2c21f0[_0x4007ee(0x134)]=_0x4dcbd1,await handleSingleObjectOutput(_0x2c21f0,_0xd54376);}else return console[_0x4007ee(0x16a)](_0x4007ee(0x138)),console[_0x4007ee(0x16a)](_0x4007ee(0x12c)),0x1;}return 0x0;}catch(_0x2cf312){if(_0x2cf312 instanceof SDKError)return console['error']('Error:\x20'+_0x2cf312['message']),_0x2cf312[_0x4007ee(0x17e)]&&console[_0x4007ee(0x16a)](_0x4007ee(0x116)+_0x2cf312[_0x4007ee(0x17e)]),0x1;throw _0x2cf312;}}}export const SegmentInfoCommand=SegmentViewCommand;export class SegmentDescCommand extends BaseCommand{[a27_0x1b2446(0xff)]='segment:desc';[a27_0x1b2446(0x148)]=a27_0x1b2446(0x168);async[a27_0x1b2446(0x10e)](_0x94a6aa){const _0x498aa9=a27_0x1b2446,{options:_0x3e68b0,args:_0x496d94,tdx:_0x1c7cfc}=_0x94a6aa,_0x29d844=_0x496d94[0x0];if(!_0x29d844)return console['error'](_0x498aa9(0x108)),console[_0x498aa9(0x16a)](_0x498aa9(0xe9)),console[_0x498aa9(0x16a)](_0x498aa9(0x146)),console['error'](_0x498aa9(0x15c)),console[_0x498aa9(0x16a)](_0x498aa9(0x125)),console[_0x498aa9(0x16a)]('\x20\x20tdx\x20sg\x20desc\x20segments/my-audience/premium-users.yml'),0x1;try{const _0x391d58=_0x3e68b0[_0x498aa9(0xf1)],_0xcca07b=await resolveSegmentTarget(_0x29d844,_0x391d58,_0x3e68b0['verbose']);_0x3e68b0[_0x498aa9(0x121)]&&console['error'](_0x498aa9(0x117)+_0xcca07b);const _0x3c36fb=await withSpinner('Resolving\x20\x27'+_0x29d844+'\x27...',()=>_0x1c7cfc[_0x498aa9(0xeb)][_0x498aa9(0x16f)](_0xcca07b),{'verbose':_0x3e68b0[_0x498aa9(0x121)]}),_0xe1948=_0x3c36fb['data'];_0x3e68b0[_0x498aa9(0x121)]&&(console[_0x498aa9(0x16a)](_0x498aa9(0x11c)+_0xe1948['type']),console[_0x498aa9(0x16a)](_0x498aa9(0x105)+_0xe1948['parentId']));if(_0xe1948[_0x498aa9(0xec)]===_0x498aa9(0x182))return console['error']('Error:\x20Cannot\x20show\x20schema\x20for\x20a\x20folder.'),console[_0x498aa9(0x16a)]('Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.'),0x1;if(_0xe1948[_0x498aa9(0xec)]===_0x498aa9(0x15a))return console['error'](_0x498aa9(0x142)),console['error'](_0x498aa9(0x165)),0x1;if(!_0xe1948[_0x498aa9(0x11b)])throw new SDKError(ErrorCode[_0x498aa9(0xf7)],_0x498aa9(0x15b));const _0x24b81a=await withSpinner(_0x498aa9(0x110),()=>_0x1c7cfc[_0x498aa9(0xeb)][_0x498aa9(0x151)](_0xe1948[_0x498aa9(0x157)],_0xe1948['segmentId']),{'verbose':_0x3e68b0['verbose']}),_0xdbefdf=_0x24b81a[_0x498aa9(0x10d)],_0x5a954d=await executeSchemaQuery(_0xdbefdf,_0x1c7cfc,_0x3e68b0);return await handleQueryOutput(_0x5a954d,_0x3e68b0),0x0;}catch(_0x2ae424){if(_0x2ae424 instanceof SDKError)return console[_0x498aa9(0x16a)](_0x498aa9(0x10b)+_0x2ae424[_0x498aa9(0x113)]),_0x2ae424[_0x498aa9(0x17e)]&&console[_0x498aa9(0x16a)](_0x498aa9(0x116)+_0x2ae424[_0x498aa9(0x17e)]),0x1;throw _0x2ae424;}}}
1
+ const a27_0x56960b=a27_0x28f1;(function(_0x3f91a6,_0x51285e){const _0x95e9b=a27_0x28f1,_0x2d978f=_0x3f91a6();while(!![]){try{const _0x589945=parseInt(_0x95e9b(0x19c))/0x1+-parseInt(_0x95e9b(0x1aa))/0x2+-parseInt(_0x95e9b(0x1bd))/0x3*(parseInt(_0x95e9b(0x1b7))/0x4)+parseInt(_0x95e9b(0x1ab))/0x5+parseInt(_0x95e9b(0x1f5))/0x6*(parseInt(_0x95e9b(0x19a))/0x7)+-parseInt(_0x95e9b(0x1ca))/0x8*(-parseInt(_0x95e9b(0x1ce))/0x9)+-parseInt(_0x95e9b(0x1e9))/0xa*(parseInt(_0x95e9b(0x1de))/0xb);if(_0x589945===_0x51285e)break;else _0x2d978f['push'](_0x2d978f['shift']());}catch(_0x2f38c9){_0x2d978f['push'](_0x2d978f['shift']());}}}(a27_0x4edb,0xa880b));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner,formatElapsed}from'../utils/spinner.js';import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{executeSchemaQuery}from'../sdk/segment/fields-display.js';import{isYamlFilePath,resolveYamlFilePath}from'../sdk/segment/segment-path-parser.js';function a27_0x4edb(){const _0x11a86f=['elapsedTimeMillis','395342OPKQWS','1755670pJAzzW','web','green','error','\x27\x20with\x20ID:\x20','Error:\x20Cannot\x20get\x20SQL\x20for\x20parent\x20segment\x20with\x20this\x20command.','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20desc\x20<path/to/segment.yml>','resolveParentId','Error:\x20Cannot\x20execute\x20query\x20for\x20parent\x20segment\x20with\x20this\x20command.','Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]','Usage:\x20tdx\x20segment\x20describe\x20<path>','52EywshY','INVALID_ARGUMENT','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','\x20\x20tdx\x20sg\x20desc\x20\x22Premium\x20Users\x22','\x20\x20Folder\x20path:\x20','Use:\x20tdx\x20ps\x20desc','18201DsRVZo','Use:\x20tdx\x20sg\x20view\x20<name>\x20\x20#\x20To\x20show\x20folder\x20details','stats','replace','listFolders','segment:folder:list','information_schema','Usage:\x20tdx\x20sg\x20desc\x20<name>','\x20\x20Full\x20path:\x20','Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>','Usage:\x20tdx\x20sg\x20show\x20<name>','execute','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','32laDNAy','Target\x20path:\x20','segment:show','Show\x20segment\x20folder\x20details','9405aujvad','Parent\x20segment:\x20','\x20\x20tdx\x20sg\x20sql\x20\x22Premium\x20Users\x22','/e/','format','Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)','\x20Opening\x20','parentId','createFolder','Usage:\x20tdx\x20sg\x20sql\x20<name>','βœ”\x20Found\x20','Show\x20child\x20segment\x20schema\x20(column\x20types)','Error:\x20Cannot\x20show\x20schema\x20for\x20parent\x20segment\x20with\x20this\x20command.','fullPath','segmentName','βœ”\x20Query\x20completed:\x20Processed\x20','3099833fHHSHp','name','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22','getSegment','segment','getSegmentSQL','log','Site:\x20','trim','Error:\x20Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.','Folder\x20ID\x20missing\x20from\x20resolved\x20path','50tEwYWg','\x20\x20tdx\x20sg\x20show\x20segments/my-audience/premium-users.yml','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22','code','βœ”\x20Created\x20folder\x20\x27','Error:\x20Cannot\x20view\x20parent\x20segment\x20details\x20with\x20this\x20command.','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20view\x20<path/to/segment.yml>','parent','segment:describe','Fetching\x20folder\x20details...','\x20\x20tdx\x20sg\x20view\x20\x22Marketing\x22\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20folder\x20details','12dFIaXA','getFolder','Segment\x20ID\x20missing\x20from\x20resolved\x20path','\x20\x20tdx\x20sg\x20sql\x20segments/my-audience/premium-users.yml','Resolved\x20YAML\x20file:\x20','Usage:\x20tdx\x20sg\x20view\x20<name>\x20[-w]','length','includes','segmentPath','folderPath','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20sql\x20<path/to/segment.yml>','Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required','processedRows','segment:folder:create','Use:\x20tdx\x20ps\x20sql','Get\x20SQL\x20query\x20for\x20child\x20segment','verbose','cause','Use:\x20tdx\x20ps\x20show','Resolved\x20parent\x20folder\x20ID:\x20','site','\x20\x20Segment\x20name:\x20','\x20[Job\x20ID:\x20','Fetching\x20parent\x20segment\x20details...','data','Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.','getParent','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20-w\x20\x20#\x20Open\x20segment\x20in\x20web\x20browser','Listing\x20folders\x20for\x20parent\x20\x27','\x20\x20tdx\x20sg\x20view\x20segments/my-audience/premium-users.yml','Error:\x20Path\x20or\x20name\x20is\x20required','resolveFolderId','Resolving\x20\x27','folder','setJobId','parentFolder','\x20\x20Cause:\x20','parentSegment','Show\x20segment\x20or\x20folder\x20details','Resolving\x20parent\x20segment\x20\x27','\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','jobId','Resolving\x20path\x20\x27','\x20\x20tdx\x20sg\x20show\x20\x22Premium\x20Users\x22','SEGMENT_NOT_FOUND','toLocaleString','Executing\x20segment\x20query...','Fetching\x20SQL\x20for\x20segment...','Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>','Examples:','Parent\x20name:\x20','\x20\x20Parent\x20segment:\x20','\x27...','Fetching\x20segment\x20details...','SEGMENT_FOLDER_NOT_FOUND','Parent\x20ID:\x20','test','Error:\x20','SQL\x20query:\x0a','resolvePathToResource','segment:folder:show','message','βœ–\x20Query\x20failed\x20[','segmentId','Execute\x20child\x20segment\x20SQL\x20query\x20and\x20show\x20results','jsonl','Folder\x20name:\x20','Folder\x20ID:\x20','url','Resolved\x20type:\x20','2326191ALZRdL','/app/ps/','1355804UKCrGz','type','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20show\x20<path/to/segment.yml>','List\x20segment\x20folders\x20under\x20a\x20parent\x20segment','Error:\x20Cannot\x20show\x20schema\x20for\x20a\x20folder.','folderId','Error:\x20Cannot\x20open\x20folder\x20in\x20web\x20browser.\x20Use\x20a\x20segment\x20name\x20instead.','cyan','description','Error:\x20Parent\x20segment\x20name\x20is\x20required','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','Options:','\x20rows\x20'];a27_0x4edb=function(){return _0x11a86f;};return a27_0x4edb();}import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{openBrowser}from'../utils/process.js';import a27_0x102316 from'chalk';async function resolveSegmentTarget(_0x1a5179,_0x4ce47a,_0x5b0c11){const _0x43ae89=a27_0x28f1;if(isYamlFilePath(_0x1a5179))try{const _0x4c07af=await resolveYamlFilePath(_0x1a5179);return _0x5b0c11&&(console[_0x43ae89(0x1ae)](_0x43ae89(0x1f9)+_0x1a5179),console[_0x43ae89(0x1ae)](_0x43ae89(0x187)+_0x4c07af[_0x43ae89(0x179)]),console[_0x43ae89(0x1ae)](_0x43ae89(0x169)+_0x4c07af[_0x43ae89(0x1dc)]),console['error'](_0x43ae89(0x1bb)+(_0x4c07af[_0x43ae89(0x1fe)]||'(root)')),console[_0x43ae89(0x1ae)](_0x43ae89(0x1c5)+_0x4c07af[_0x43ae89(0x1db)])),_0x4c07af[_0x43ae89(0x1db)];}catch(_0x28edad){throw new SDKError(ErrorCode[_0x43ae89(0x1b8)],_0x43ae89(0x1ef)+_0x28edad[_0x43ae89(0x191)]);}if(!_0x4ce47a)throw new SDKError(ErrorCode[_0x43ae89(0x1b8)],_0x43ae89(0x1c9));return _0x4ce47a+'/'+_0x1a5179;}export class SegmentDescribeCommand extends BaseCommand{['name']=a27_0x56960b(0x1f2);[a27_0x56960b(0x1a4)]=a27_0x56960b(0x17a);async['execute'](_0x4b4d41){const _0x39423a=a27_0x56960b,{options:_0x1e9b4c,args:_0x142c11,tdx:_0x4981ec}=_0x4b4d41,_0x5cd7d2=_0x142c11[0x0],_0x17012f=!_0x5cd7d2&&!!_0x1e9b4c[_0x39423a(0x179)],_0x4c7bac=_0x5cd7d2||_0x1e9b4c[_0x39423a(0x179)];if(!_0x4c7bac)return console[_0x39423a(0x1ae)](_0x39423a(0x172)),console[_0x39423a(0x1ae)](_0x39423a(0x1b6)),console[_0x39423a(0x1ae)]('Examples:'),console[_0x39423a(0x1ae)](_0x39423a(0x1eb)),console[_0x39423a(0x1ae)](_0x39423a(0x1e0)),console[_0x39423a(0x1ae)](_0x39423a(0x17c)),console[_0x39423a(0x1ae)](_0x39423a(0x1b9)),0x1;try{const _0xaf140e=_0x1e9b4c[_0x39423a(0x1fd)];let _0x32ef3e=_0x4c7bac;!_0x17012f&&_0xaf140e&&!_0x4c7bac[_0x39423a(0x1fc)]('/')&&(_0x32ef3e=_0xaf140e+'/'+_0x4c7bac,_0x1e9b4c[_0x39423a(0x205)]&&console['error']('Resolved\x20relative\x20path\x20to:\x20'+_0x32ef3e));const _0xb6df3=await withSpinner(_0x39423a(0x17e)+_0x32ef3e+_0x39423a(0x188),()=>_0x4981ec[_0x39423a(0x1e2)]['resolvePathToResource'](_0x32ef3e),{'verbose':_0x1e9b4c[_0x39423a(0x205)]}),_0x5b9262=_0xb6df3[_0x39423a(0x16c)];_0x1e9b4c[_0x39423a(0x205)]&&(console[_0x39423a(0x1ae)](_0x39423a(0x199)+_0x5b9262[_0x39423a(0x19d)]),console[_0x39423a(0x1ae)](_0x39423a(0x18b)+_0x5b9262['parentId']),_0x5b9262[_0x39423a(0x1a1)]&&console['error'](_0x39423a(0x197)+_0x5b9262[_0x39423a(0x1a1)]),_0x5b9262[_0x39423a(0x193)]&&console['error']('Segment\x20ID:\x20'+_0x5b9262[_0x39423a(0x193)]));if(_0x5b9262[_0x39423a(0x19d)]===_0x39423a(0x1f1)){const _0xa59595=await withSpinner(_0x39423a(0x16b),()=>_0x4981ec[_0x39423a(0x1e2)][_0x39423a(0x16e)](_0x5b9262[_0x39423a(0x1d5)]),{'verbose':_0x1e9b4c['verbose']});await handleSingleObjectOutput(_0xa59595[_0x39423a(0x16c)],_0x1e9b4c);}else{if(_0x5b9262['type']==='folder'){if(!_0x5b9262['folderId'])throw new SDKError(ErrorCode[_0x39423a(0x18a)],_0x39423a(0x1e8));const _0x191ec7=await withSpinner(_0x39423a(0x1f3),()=>_0x4981ec[_0x39423a(0x1e2)][_0x39423a(0x1f6)](_0x5b9262[_0x39423a(0x1a1)]),{'verbose':_0x1e9b4c[_0x39423a(0x205)]});await handleSingleObjectOutput(_0x191ec7[_0x39423a(0x16c)],_0x1e9b4c);}else{if(_0x5b9262[_0x39423a(0x19d)]===_0x39423a(0x1e2)){if(!_0x5b9262[_0x39423a(0x193)])throw new SDKError(ErrorCode[_0x39423a(0x180)],_0x39423a(0x1f7));const _0x25d6f7=await withSpinner(_0x39423a(0x189),()=>_0x4981ec[_0x39423a(0x1e2)]['getSegment'](_0x5b9262['parentId'],_0x5b9262[_0x39423a(0x193)]),{'verbose':_0x1e9b4c[_0x39423a(0x205)]});await handleSingleObjectOutput(_0x25d6f7[_0x39423a(0x16c)],_0x1e9b4c);}}}return 0x0;}catch(_0x3898cf){if(_0x3898cf instanceof SDKError)return console[_0x39423a(0x1ae)](_0x39423a(0x18d)+_0x3898cf['message']),_0x3898cf['cause']&&console[_0x39423a(0x1ae)](_0x39423a(0x178)+_0x3898cf[_0x39423a(0x206)]),0x1;throw _0x3898cf;}}}export class SegmentShowCommand extends BaseCommand{[a27_0x56960b(0x1df)]=a27_0x56960b(0x1cc);[a27_0x56960b(0x1a4)]=a27_0x56960b(0x194);async[a27_0x56960b(0x1c8)](_0x126ee8){const _0x4a56ad=a27_0x56960b,{options:_0x17b7fd,args:_0x2fe417,tdx:_0xc4cf85}=_0x126ee8,_0x4c076d=_0x2fe417[0x0];if(!_0x4c076d)return console['error']('Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required'),console[_0x4a56ad(0x1ae)](_0x4a56ad(0x1c7)),console[_0x4a56ad(0x1ae)](_0x4a56ad(0x19e)),console[_0x4a56ad(0x1ae)](_0x4a56ad(0x185)),console[_0x4a56ad(0x1ae)](_0x4a56ad(0x17f)),console[_0x4a56ad(0x1ae)](_0x4a56ad(0x1ea)),0x1;try{const _0x2b5a31=_0x17b7fd['parentSegment'],_0x1170e1=await resolveSegmentTarget(_0x4c076d,_0x2b5a31,_0x17b7fd[_0x4a56ad(0x205)]);_0x17b7fd[_0x4a56ad(0x205)]&&console['error'](_0x4a56ad(0x1cb)+_0x1170e1);const _0xe0df2d=await withSpinner('Resolving\x20\x27'+_0x4c076d+'\x27...',()=>_0xc4cf85[_0x4a56ad(0x1e2)]['resolvePathToResource'](_0x1170e1),{'verbose':_0x17b7fd[_0x4a56ad(0x205)]}),_0x23e2a9=_0xe0df2d[_0x4a56ad(0x16c)];_0x17b7fd['verbose']&&(console[_0x4a56ad(0x1ae)](_0x4a56ad(0x199)+_0x23e2a9[_0x4a56ad(0x19d)]),console['error'](_0x4a56ad(0x18b)+_0x23e2a9[_0x4a56ad(0x1d5)]));if(_0x23e2a9[_0x4a56ad(0x19d)]==='folder')return console[_0x4a56ad(0x1ae)](_0x4a56ad(0x16d)),console['error'](_0x4a56ad(0x1be)),0x1;if(_0x23e2a9[_0x4a56ad(0x19d)]===_0x4a56ad(0x1f1))return console[_0x4a56ad(0x1ae)](_0x4a56ad(0x1b4)),console[_0x4a56ad(0x1ae)](_0x4a56ad(0x207)),0x1;if(!_0x23e2a9[_0x4a56ad(0x193)])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x4a56ad(0x1f7));const _0x48a0e5=await withSpinner(_0x4a56ad(0x183),()=>_0xc4cf85[_0x4a56ad(0x1e2)][_0x4a56ad(0x1e3)](_0x23e2a9[_0x4a56ad(0x1d5)],_0x23e2a9[_0x4a56ad(0x193)]),{'verbose':_0x17b7fd['verbose']});let _0x5534bc=_0x48a0e5[_0x4a56ad(0x16c)];const _0x458680=resolveLimit(_0x17b7fd['limit'],DEFAULT_DISPLAY_LIMIT),_0x2c6917=/\bLIMIT\s+\d+/i[_0x4a56ad(0x18c)](_0x5534bc);!_0x2c6917&&(_0x5534bc=_0x5534bc[_0x4a56ad(0x1e6)]()[_0x4a56ad(0x1c0)](/;+$/,''),_0x5534bc='SELECT\x20*\x20FROM\x20(\x0a'+_0x5534bc+_0x4a56ad(0x1b1)+_0x458680);_0x17b7fd[_0x4a56ad(0x205)]&&console['error'](_0x4a56ad(0x18e)+_0x5534bc);const _0x4a38b9=await withProgressSpinner(_0x4a56ad(0x182),async _0x26a84d=>{const _0x1f9d4b=_0x4a56ad,_0x571afe=await _0xc4cf85['query'][_0x1f9d4b(0x1c8)](_0x5534bc,{'catalog':'td','schema':_0x1f9d4b(0x1c3),'onJobId':_0x3dc52b=>{const _0x160c05=_0x1f9d4b;_0x26a84d[_0x160c05(0x176)](_0x3dc52b);}});return _0x571afe;},{'verbose':_0x17b7fd['verbose']}),_0x446719=_0x4a38b9[_0x4a56ad(0x16c)],_0x2fc2c9=_0x446719['jobId']?_0x4a56ad(0x16a)+_0x446719[_0x4a56ad(0x17d)]+']':'';return console[_0x4a56ad(0x1ae)](_0x4a56ad(0x1dd)+_0x446719[_0x4a56ad(0x1bf)][_0x4a56ad(0x201)][_0x4a56ad(0x181)]()+_0x4a56ad(0x1a8)+('in\x20'+formatElapsed(_0x446719[_0x4a56ad(0x1bf)][_0x4a56ad(0x1a9)])+_0x2fc2c9)),await handleQueryOutput(_0x446719,_0x17b7fd),0x0;}catch(_0x306dc9){if(_0x306dc9 instanceof SDKError)return console[_0x4a56ad(0x1ae)](_0x4a56ad(0x192)+_0x306dc9[_0x4a56ad(0x1ec)]+']'),console[_0x4a56ad(0x1ae)]('\x0a'+_0x306dc9[_0x4a56ad(0x191)]),0x1;throw _0x306dc9;}}}export class SegmentFolderListCommand extends BaseCommand{[a27_0x56960b(0x1df)]=a27_0x56960b(0x1c2);['description']=a27_0x56960b(0x19f);async[a27_0x56960b(0x1c8)](_0x18e230){const _0x574de4=a27_0x56960b,{options:_0x20a5d,args:_0x44f71b,tdx:_0x580750}=_0x18e230;if(_0x44f71b['length']===0x0)return console[_0x574de4(0x1ae)](_0x574de4(0x1a5)),console[_0x574de4(0x1ae)](_0x574de4(0x184)),0x1;const _0x61d265=_0x44f71b[0x0];try{_0x20a5d['verbose']&&(console['error']('Site:\x20'+_0x20a5d['site']),console[_0x574de4(0x1ae)](_0x574de4(0x186)+_0x61d265));const _0x13a5f7=await withSpinner(_0x574de4(0x17b)+_0x61d265+'\x27...',()=>_0x580750[_0x574de4(0x1e2)][_0x574de4(0x1b3)](_0x61d265),{'verbose':_0x20a5d[_0x574de4(0x205)]}),_0x33235d=_0x13a5f7[_0x574de4(0x16c)];_0x20a5d['verbose']&&console[_0x574de4(0x1ae)]('Resolved\x20parent\x20ID:\x20'+_0x33235d);const _0x4cfe15=await withSpinner(_0x574de4(0x170)+_0x61d265+'\x27...',()=>_0x580750[_0x574de4(0x1e2)][_0x574de4(0x1c1)](_0x33235d),{'verbose':_0x20a5d[_0x574de4(0x205)]}),_0xa361e6=_0x4cfe15[_0x574de4(0x16c)];return console['error'](_0x574de4(0x1d8)+_0xa361e6['length']+'\x20folder'+(_0xa361e6[_0x574de4(0x1fb)]!==0x1?'s':'')),await handleSDKOutput(_0xa361e6,_0x20a5d),0x0;}catch(_0x324b53){if(_0x324b53 instanceof SDKError)return console['error']('Error:\x20'+_0x324b53[_0x574de4(0x191)]),_0x324b53[_0x574de4(0x206)]&&console[_0x574de4(0x1ae)](_0x574de4(0x178)+_0x324b53[_0x574de4(0x206)]),0x1;throw _0x324b53;}}}export class SegmentFolderShowCommand extends BaseCommand{['name']=a27_0x56960b(0x190);[a27_0x56960b(0x1a4)]=a27_0x56960b(0x1cd);async[a27_0x56960b(0x1c8)](_0x1a75fd){const _0x358e3e=a27_0x56960b,{options:_0x1b6c64,args:_0x253f4a,tdx:_0xb4f898}=_0x1a75fd;if(_0x253f4a[_0x358e3e(0x1fb)]===0x0)return console[_0x358e3e(0x1ae)]('Error:\x20Folder\x20reference\x20is\x20required'),console['error'](_0x358e3e(0x1c6)),0x1;try{const {parentId:_0x293504,childId:_0x745864}=parseSegmentRef(_0x253f4a[0x0]);_0x1b6c64[_0x358e3e(0x205)]&&(console['error'](_0x358e3e(0x1e5)+_0x1b6c64[_0x358e3e(0x209)]),console[_0x358e3e(0x1ae)](_0x358e3e(0x186)+_0x293504),_0x745864&&console[_0x358e3e(0x1ae)]('Folder\x20name:\x20'+_0x745864));if(!_0x745864)return console['error'](_0x358e3e(0x1d3)),0x1;const _0x201b65=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x293504+_0x358e3e(0x188),()=>_0xb4f898[_0x358e3e(0x1e2)][_0x358e3e(0x1b3)](_0x293504),{'verbose':_0x1b6c64[_0x358e3e(0x205)]}),_0x36ad68=_0x201b65[_0x358e3e(0x16c)];_0x1b6c64[_0x358e3e(0x205)]&&console['error']('Resolved\x20parent\x20ID:\x20'+_0x36ad68);const _0x46e76e=await withSpinner('Resolving\x20folder\x20\x27'+_0x745864+_0x358e3e(0x188),()=>_0xb4f898[_0x358e3e(0x1e2)][_0x358e3e(0x173)](_0x36ad68,_0x745864),{'verbose':_0x1b6c64[_0x358e3e(0x205)]}),_0x3de688=_0x46e76e[_0x358e3e(0x16c)];_0x1b6c64[_0x358e3e(0x205)]&&console[_0x358e3e(0x1ae)]('Resolved\x20folder\x20ID:\x20'+_0x3de688);const _0x155a6c=await withSpinner('Fetching\x20folder\x20\x27'+_0x745864+_0x358e3e(0x188),()=>_0xb4f898[_0x358e3e(0x1e2)][_0x358e3e(0x1f6)](_0x3de688),{'verbose':_0x1b6c64['verbose']});return await handleSDKOutput([_0x155a6c[_0x358e3e(0x16c)]],_0x1b6c64),0x0;}catch(_0x475dc4){if(_0x475dc4 instanceof SDKError)return console[_0x358e3e(0x1ae)]('Error:\x20'+_0x475dc4[_0x358e3e(0x191)]),_0x475dc4[_0x358e3e(0x206)]&&console[_0x358e3e(0x1ae)]('\x20\x20Cause:\x20'+_0x475dc4['cause']),0x1;throw _0x475dc4;}}}export class SegmentSQLCommand extends BaseCommand{[a27_0x56960b(0x1df)]='segment:sql';[a27_0x56960b(0x1a4)]=a27_0x56960b(0x204);async[a27_0x56960b(0x1c8)](_0x32bd69){const _0x42a0b8=a27_0x56960b,{options:_0x11c3cc,args:_0x34c26f,tdx:_0x5e1a06}=_0x32bd69,_0x3b77dd=_0x34c26f[0x0];if(!_0x3b77dd)return console[_0x42a0b8(0x1ae)]('Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required'),console[_0x42a0b8(0x1ae)](_0x42a0b8(0x1d7)),console[_0x42a0b8(0x1ae)](_0x42a0b8(0x1ff)),console[_0x42a0b8(0x1ae)]('Examples:'),console['error'](_0x42a0b8(0x1d0)),console[_0x42a0b8(0x1ae)](_0x42a0b8(0x1f8)),0x1;try{const _0x49ffdb=_0x11c3cc[_0x42a0b8(0x179)],_0x176723=await resolveSegmentTarget(_0x3b77dd,_0x49ffdb,_0x11c3cc[_0x42a0b8(0x205)]);_0x11c3cc['verbose']&&console[_0x42a0b8(0x1ae)]('Target\x20path:\x20'+_0x176723);const _0x188d4b=await withSpinner(_0x42a0b8(0x174)+_0x3b77dd+_0x42a0b8(0x188),()=>_0x5e1a06[_0x42a0b8(0x1e2)]['resolvePathToResource'](_0x176723),{'verbose':_0x11c3cc[_0x42a0b8(0x205)]}),_0x2f82b5=_0x188d4b[_0x42a0b8(0x16c)];_0x11c3cc['verbose']&&(console['error']('Resolved\x20type:\x20'+_0x2f82b5['type']),console[_0x42a0b8(0x1ae)]('Parent\x20ID:\x20'+_0x2f82b5['parentId']));if(_0x2f82b5[_0x42a0b8(0x19d)]===_0x42a0b8(0x175))return console[_0x42a0b8(0x1ae)](_0x42a0b8(0x1e7)),console['error']('Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.'),0x1;if(_0x2f82b5[_0x42a0b8(0x19d)]===_0x42a0b8(0x1f1))return console[_0x42a0b8(0x1ae)](_0x42a0b8(0x1b0)),console[_0x42a0b8(0x1ae)](_0x42a0b8(0x203)),0x1;if(!_0x2f82b5[_0x42a0b8(0x193)])throw new SDKError(ErrorCode[_0x42a0b8(0x180)],_0x42a0b8(0x1f7));const _0x29999a=await withSpinner(_0x42a0b8(0x183),()=>_0x5e1a06[_0x42a0b8(0x1e2)][_0x42a0b8(0x1e3)](_0x2f82b5['parentId'],_0x2f82b5[_0x42a0b8(0x193)]),{'verbose':_0x11c3cc[_0x42a0b8(0x205)]}),_0x5031d0=_0x29999a[_0x42a0b8(0x16c)];return _0x11c3cc['format']==='json'||_0x11c3cc[_0x42a0b8(0x1d2)]===_0x42a0b8(0x195)?await handleSDKOutput([{'sql':_0x5031d0}],_0x11c3cc):console[_0x42a0b8(0x1e4)](_0x5031d0),0x0;}catch(_0xe4d536){if(_0xe4d536 instanceof SDKError)return console[_0x42a0b8(0x1ae)](_0x42a0b8(0x18d)+_0xe4d536['message']),_0xe4d536[_0x42a0b8(0x206)]&&console['error']('\x20\x20Cause:\x20'+_0xe4d536['cause']),0x1;throw _0xe4d536;}}}export class SegmentFolderCreateCommand extends BaseCommand{['name']=a27_0x56960b(0x202);[a27_0x56960b(0x1a4)]='Create\x20segment\x20folder\x20for\x20organization';async['execute'](_0x336ee5){const _0x4dc840=a27_0x56960b,{options:_0x4b179c,args:_0x198a02,tdx:_0x209308}=_0x336ee5,_0x4aa1f0=_0x4b179c;if(_0x198a02[_0x4dc840(0x1fb)]<0x2)return console[_0x4dc840(0x1ae)]('Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required'),console[_0x4dc840(0x1ae)](_0x4dc840(0x1b5)),0x1;const _0x5d2e2a=_0x198a02[0x0],_0x106a01=_0x198a02[0x1];_0x4aa1f0[_0x4dc840(0x205)]&&(console[_0x4dc840(0x1ae)]('Site:\x20'+_0x4aa1f0[_0x4dc840(0x209)]),console[_0x4dc840(0x1ae)](_0x4dc840(0x1cf)+_0x5d2e2a),console[_0x4dc840(0x1ae)](_0x4dc840(0x196)+_0x106a01));let _0x59ecc2;if(_0x4aa1f0[_0x4dc840(0x177)]){const _0x172d65=_0x4aa1f0[_0x4dc840(0x177)],_0x494254=await withSpinner(_0x4dc840(0x17b)+_0x5d2e2a+_0x4dc840(0x188),()=>_0x209308[_0x4dc840(0x1e2)]['resolveParentId'](_0x5d2e2a),{'verbose':_0x4aa1f0[_0x4dc840(0x205)]}),_0x4bf286=_0x494254['data'],_0x44aee2=await withSpinner('Resolving\x20parent\x20folder\x20\x27'+_0x172d65+_0x4dc840(0x188),()=>_0x209308[_0x4dc840(0x1e2)][_0x4dc840(0x173)](_0x4bf286,_0x172d65),{'verbose':_0x4aa1f0[_0x4dc840(0x205)]});_0x59ecc2=_0x44aee2[_0x4dc840(0x16c)],_0x4aa1f0['verbose']&&console['error'](_0x4dc840(0x208)+_0x59ecc2);}const _0x1ec3b2={'name':_0x106a01,'description':_0x4aa1f0[_0x4dc840(0x1a4)],'parentFolderId':_0x59ecc2},_0x6c1e8c=await withSpinner('Creating\x20folder\x20\x27'+_0x106a01+_0x4dc840(0x188),()=>_0x209308[_0x4dc840(0x1e2)][_0x4dc840(0x1d6)](_0x5d2e2a,_0x1ec3b2),{'verbose':_0x4aa1f0[_0x4dc840(0x205)]}),_0x133ff6=_0x6c1e8c[_0x4dc840(0x16c)];return console['error'](_0x4dc840(0x1ed)+_0x133ff6[_0x4dc840(0x1df)]+_0x4dc840(0x1af)+_0x133ff6['id']),await handleSDKOutput([_0x133ff6],_0x4aa1f0),0x0;}}function a27_0x28f1(_0x355613,_0x4e935e){_0x355613=_0x355613-0x169;const _0x4edb61=a27_0x4edb();let _0x28f190=_0x4edb61[_0x355613];return _0x28f190;}export class SegmentViewCommand extends BaseCommand{[a27_0x56960b(0x1df)]='segment:view';[a27_0x56960b(0x1a4)]='Show\x20folder\x20or\x20child\x20segment\x20details';async['execute'](_0x977209){const _0x33abb9=a27_0x56960b,{options:_0x3253c5,args:_0x29998b,tdx:_0x498ef1}=_0x977209,_0x40de7f=_0x29998b[0x0];if(!_0x40de7f)return console[_0x33abb9(0x1ae)]('Error:\x20Folder\x20or\x20segment\x20name,\x20or\x20YAML\x20file\x20path\x20is\x20required'),console[_0x33abb9(0x1ae)](_0x33abb9(0x1fa)),console[_0x33abb9(0x1ae)](_0x33abb9(0x1f0)),console[_0x33abb9(0x1ae)](_0x33abb9(0x1a7)),console[_0x33abb9(0x1ae)]('\x20\x20-w,\x20--web\x20\x20Open\x20segment\x20in\x20web\x20browser'),console[_0x33abb9(0x1ae)](_0x33abb9(0x185)),console[_0x33abb9(0x1ae)](_0x33abb9(0x1f4)),console['error']('\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20\x20\x20\x20\x20#\x20View\x20child\x20segment\x20details'),console[_0x33abb9(0x1ae)](_0x33abb9(0x16f)),console[_0x33abb9(0x1ae)](_0x33abb9(0x171)),0x1;try{const _0x2016b6=_0x3253c5[_0x33abb9(0x179)],_0x2c0bdb=await resolveSegmentTarget(_0x40de7f,_0x2016b6,_0x3253c5[_0x33abb9(0x205)]);_0x3253c5[_0x33abb9(0x205)]&&console['error']('Target\x20path:\x20'+_0x2c0bdb);const _0xc6bca8=await withSpinner('Resolving\x20\x27'+_0x40de7f+_0x33abb9(0x188),()=>_0x498ef1[_0x33abb9(0x1e2)][_0x33abb9(0x18f)](_0x2c0bdb),{'verbose':_0x3253c5[_0x33abb9(0x205)]}),_0x314be6=_0xc6bca8['data'];_0x3253c5[_0x33abb9(0x205)]&&(console[_0x33abb9(0x1ae)](_0x33abb9(0x199)+_0x314be6[_0x33abb9(0x19d)]),console[_0x33abb9(0x1ae)](_0x33abb9(0x18b)+_0x314be6[_0x33abb9(0x1d5)]),_0x314be6[_0x33abb9(0x1a1)]&&console[_0x33abb9(0x1ae)](_0x33abb9(0x197)+_0x314be6[_0x33abb9(0x1a1)]),_0x314be6['segmentId']&&console[_0x33abb9(0x1ae)]('Segment\x20ID:\x20'+_0x314be6[_0x33abb9(0x193)]));if(_0x3253c5[_0x33abb9(0x1ac)]){if(_0x314be6[_0x33abb9(0x19d)]==='folder')return console[_0x33abb9(0x1ae)](_0x33abb9(0x1a2)),0x1;if(_0x314be6[_0x33abb9(0x19d)]==='parent')return console[_0x33abb9(0x1ae)]('Error:\x20Cannot\x20open\x20parent\x20segment\x20with\x20this\x20command.'),console[_0x33abb9(0x1ae)]('Use:\x20tdx\x20ps\x20view\x20-w'),0x1;if(!_0x314be6[_0x33abb9(0x193)])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x33abb9(0x1f7));const _0x485692=getConsoleNextUrl(_0x3253c5['site'],'/app/ps/'+_0x314be6['parentId']+'/e/'+_0x314be6[_0x33abb9(0x193)]);return console['error'](a27_0x102316[_0x33abb9(0x1ad)]('βœ”')+_0x33abb9(0x1d4)+a27_0x102316[_0x33abb9(0x1a3)](_0x485692)),openBrowser(_0x485692),0x0;}if(_0x314be6['type']===_0x33abb9(0x175)){if(!_0x314be6['folderId'])throw new SDKError(ErrorCode[_0x33abb9(0x18a)],_0x33abb9(0x1e8));const _0x32aef7=await withSpinner(_0x33abb9(0x1f3),()=>_0x498ef1[_0x33abb9(0x1e2)][_0x33abb9(0x1f6)](_0x314be6['folderId']),{'verbose':_0x3253c5['verbose']});await handleSingleObjectOutput(_0x32aef7['data'],_0x3253c5);}else{if(_0x314be6[_0x33abb9(0x19d)]==='segment'){if(!_0x314be6[_0x33abb9(0x193)])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x5c34ba=await withSpinner(_0x33abb9(0x189),()=>_0x498ef1[_0x33abb9(0x1e2)][_0x33abb9(0x1e1)](_0x314be6['parentId'],_0x314be6[_0x33abb9(0x193)]),{'verbose':_0x3253c5['verbose']}),_0x281139=getConsoleNextUrl(_0x3253c5[_0x33abb9(0x209)],_0x33abb9(0x19b)+_0x314be6[_0x33abb9(0x1d5)]+_0x33abb9(0x1d1)+_0x314be6[_0x33abb9(0x193)]),_0x5825d1=_0x5c34ba['data'];_0x5825d1[_0x33abb9(0x198)]=_0x281139,await handleSingleObjectOutput(_0x5825d1,_0x3253c5);}else return console[_0x33abb9(0x1ae)](_0x33abb9(0x1ee)),console['error']('Use:\x20tdx\x20ps\x20view'),0x1;}return 0x0;}catch(_0x4496ac){if(_0x4496ac instanceof SDKError)return console['error'](_0x33abb9(0x18d)+_0x4496ac[_0x33abb9(0x191)]),_0x4496ac[_0x33abb9(0x206)]&&console['error'](_0x33abb9(0x178)+_0x4496ac[_0x33abb9(0x206)]),0x1;throw _0x4496ac;}}}export const SegmentInfoCommand=SegmentViewCommand;export class SegmentDescCommand extends BaseCommand{['name']='segment:desc';[a27_0x56960b(0x1a4)]=a27_0x56960b(0x1d9);async[a27_0x56960b(0x1c8)](_0xc1cdef){const _0x254493=a27_0x56960b,{options:_0x9df834,args:_0x50fb45,tdx:_0x22a33d}=_0xc1cdef,_0x413f3e=_0x50fb45[0x0];if(!_0x413f3e)return console[_0x254493(0x1ae)](_0x254493(0x200)),console[_0x254493(0x1ae)](_0x254493(0x1c4)),console[_0x254493(0x1ae)](_0x254493(0x1b2)),console[_0x254493(0x1ae)](_0x254493(0x185)),console['error'](_0x254493(0x1ba)),console[_0x254493(0x1ae)]('\x20\x20tdx\x20sg\x20desc\x20segments/my-audience/premium-users.yml'),0x1;try{const _0x187524=_0x9df834[_0x254493(0x179)],_0x37f404=await resolveSegmentTarget(_0x413f3e,_0x187524,_0x9df834[_0x254493(0x205)]);_0x9df834['verbose']&&console[_0x254493(0x1ae)]('Target\x20path:\x20'+_0x37f404);const _0x338f5d=await withSpinner('Resolving\x20\x27'+_0x413f3e+_0x254493(0x188),()=>_0x22a33d[_0x254493(0x1e2)][_0x254493(0x18f)](_0x37f404),{'verbose':_0x9df834[_0x254493(0x205)]}),_0x29531c=_0x338f5d[_0x254493(0x16c)];_0x9df834[_0x254493(0x205)]&&(console['error'](_0x254493(0x199)+_0x29531c[_0x254493(0x19d)]),console[_0x254493(0x1ae)](_0x254493(0x18b)+_0x29531c[_0x254493(0x1d5)]));if(_0x29531c[_0x254493(0x19d)]===_0x254493(0x175))return console['error'](_0x254493(0x1a0)),console['error'](_0x254493(0x1a6)),0x1;if(_0x29531c[_0x254493(0x19d)]===_0x254493(0x1f1))return console[_0x254493(0x1ae)](_0x254493(0x1da)),console[_0x254493(0x1ae)](_0x254493(0x1bc)),0x1;if(!_0x29531c[_0x254493(0x193)])throw new SDKError(ErrorCode[_0x254493(0x180)],_0x254493(0x1f7));const _0x5152b5=await withSpinner(_0x254493(0x183),()=>_0x22a33d[_0x254493(0x1e2)][_0x254493(0x1e3)](_0x29531c[_0x254493(0x1d5)],_0x29531c[_0x254493(0x193)]),{'verbose':_0x9df834['verbose']}),_0x8fc37a=_0x5152b5[_0x254493(0x16c)],_0x57e00b=await executeSchemaQuery(_0x8fc37a,_0x22a33d,_0x9df834);return await handleQueryOutput(_0x57e00b,_0x9df834),0x0;}catch(_0x477cf1){if(_0x477cf1 instanceof SDKError)return console[_0x254493(0x1ae)]('Error:\x20'+_0x477cf1[_0x254493(0x191)]),_0x477cf1['cause']&&console[_0x254493(0x1ae)]('\x20\x20Cause:\x20'+_0x477cf1[_0x254493(0x206)]),0x1;throw _0x477cf1;}}}
@@ -1 +1 @@
1
- const a28_0x3bfa96=a28_0x2cca;(function(_0x14d5e1,_0xc8299f){const _0x5904a5=a28_0x2cca,_0x2bd4b3=_0x14d5e1();while(!![]){try{const _0x4ae765=-parseInt(_0x5904a5(0xdd))/0x1*(parseInt(_0x5904a5(0xd9))/0x2)+parseInt(_0x5904a5(0xda))/0x3*(parseInt(_0x5904a5(0x10c))/0x4)+parseInt(_0x5904a5(0xf5))/0x5+parseInt(_0x5904a5(0xf7))/0x6*(-parseInt(_0x5904a5(0xe3))/0x7)+parseInt(_0x5904a5(0xea))/0x8*(parseInt(_0x5904a5(0xef))/0x9)+parseInt(_0x5904a5(0xf3))/0xa*(-parseInt(_0x5904a5(0xf6))/0xb)+parseInt(_0x5904a5(0xfe))/0xc;if(_0x4ae765===_0xc8299f)break;else _0x2bd4b3['push'](_0x2bd4b3['shift']());}catch(_0x13c724){_0x2bd4b3['push'](_0x2bd4b3['shift']());}}}(a28_0x10ce,0xa605b));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 a28_0xcef91c from'chalk';export class SegmentCreateCommand extends BaseCommand{[a28_0x3bfa96(0xeb)]=a28_0x3bfa96(0xd5);['description']=a28_0x3bfa96(0xe0);async[a28_0x3bfa96(0xdf)](_0x1e213a){const _0x260b6d=a28_0x3bfa96;console['error'](a28_0xcef91c[_0x260b6d(0xd7)](_0x260b6d(0xe6))),console[_0x260b6d(0x10f)](a28_0xcef91c[_0x260b6d(0xd7)](_0x260b6d(0xe9)));const {options:_0x4171e5,args:_0x5633c2,tdx:_0x76f5cb}=_0x1e213a,_0x95ba7=_0x4171e5;if(_0x5633c2['length']===0x0)return console[_0x260b6d(0x10f)](_0x260b6d(0x10d)),console[_0x260b6d(0x10f)](_0x260b6d(0xe2)),console[_0x260b6d(0x10f)](_0x260b6d(0x109)),console['error'](_0x260b6d(0x102)),console[_0x260b6d(0x10f)](_0x260b6d(0x10b)),console[_0x260b6d(0x10f)](_0x260b6d(0xe7)),0x1;const _0x54f417=_0x5633c2[0x0],_0x320626=_0x4171e5[_0x260b6d(0x100)];let _0x59fb82=_0x54f417;_0x320626&&!_0x54f417[_0x260b6d(0xdc)]('/')&&(_0x59fb82=_0x320626+'/'+_0x54f417,_0x95ba7[_0x260b6d(0xf9)]&&console[_0x260b6d(0x10f)](_0x260b6d(0xd6)+_0x59fb82));const _0x5ceae7=parsePath(_0x59fb82);if(_0x5ceae7['segments'][_0x260b6d(0xee)]<0x2)return console['error'](_0x260b6d(0xf8)),console[_0x260b6d(0x10f)](_0x260b6d(0xe5)),0x1;const _0x354873=_0x5ceae7[_0x260b6d(0x10e)][0x0],_0x1fdc25=getBaseName(_0x59fb82),_0x378450=getParentPath(_0x59fb82);_0x95ba7[_0x260b6d(0xf9)]&&(console[_0x260b6d(0x10f)]('Site:\x20'+_0x95ba7['site']),console[_0x260b6d(0x10f)](_0x260b6d(0x105)+_0x59fb82),console[_0x260b6d(0x10f)](_0x260b6d(0xf4)+_0x354873),console[_0x260b6d(0x10f)](_0x260b6d(0x104)+_0x1fdc25),console[_0x260b6d(0x10f)](_0x260b6d(0x108)+_0x378450));const _0x2cd835=await withSpinner(_0x260b6d(0x106)+_0x354873+_0x260b6d(0x107),()=>_0x76f5cb[_0x260b6d(0xfc)][_0x260b6d(0xff)](_0x354873),{'verbose':_0x95ba7[_0x260b6d(0xf9)]}),_0x38162a=_0x2cd835[_0x260b6d(0xed)];let _0x52fa18;if(_0x5ceae7[_0x260b6d(0x10e)]['length']>0x2){const _0x511c00=await withSpinner(_0x260b6d(0x10a)+_0x378450+_0x260b6d(0x107),()=>_0x76f5cb[_0x260b6d(0xfc)]['resolvePathToResource'](_0x378450),{'verbose':_0x95ba7[_0x260b6d(0xf9)]}),_0x4dacbc=_0x511c00[_0x260b6d(0xed)];if(_0x4dacbc[_0x260b6d(0xdb)]!==_0x260b6d(0xde)&&_0x4dacbc[_0x260b6d(0xdb)]!==_0x260b6d(0xe1))return console[_0x260b6d(0x10f)](_0x260b6d(0xfb)),0x1;_0x52fa18=_0x4dacbc[_0x260b6d(0x110)];}else{if(_0x95ba7[_0x260b6d(0xde)]){const _0x5e9349=await withSpinner('Resolving\x20folder\x20\x27'+_0x95ba7['folder']+'\x27...',()=>_0x76f5cb[_0x260b6d(0xfc)][_0x260b6d(0xe4)](_0x38162a,_0x95ba7[_0x260b6d(0xde)]),{'verbose':_0x95ba7[_0x260b6d(0xf9)]});_0x52fa18=_0x5e9349[_0x260b6d(0xed)];}}_0x95ba7['verbose']&&_0x52fa18&&console[_0x260b6d(0x10f)](_0x260b6d(0x111)+_0x52fa18);const _0x3377b6=await loadJSONFromOptions(_0x95ba7[_0x260b6d(0xd8)],_0x95ba7[_0x260b6d(0xf1)]),_0x5afbe6={'name':_0x1fdc25,'description':_0x95ba7[_0x260b6d(0x103)],'rule':_0x3377b6,'kind':_0x95ba7[_0x260b6d(0xec)]!==undefined?parseInt(_0x95ba7['kind'],0xa):undefined,'isVisible':_0x95ba7[_0x260b6d(0xf0)]?![]:undefined,'segmentFolderId':_0x52fa18,'countPopulation':_0x95ba7[_0x260b6d(0xf2)]?![]:undefined},_0x21769f=await withSpinner('Creating\x20segment\x20\x27'+_0x1fdc25+_0x260b6d(0x107),()=>_0x76f5cb['segment'][_0x260b6d(0xfd)](_0x38162a,_0x5afbe6),{'verbose':_0x95ba7['verbose']}),_0x1f189b=_0x21769f[_0x260b6d(0xed)];return console[_0x260b6d(0x10f)](_0x260b6d(0xe8)+_0x1f189b[_0x260b6d(0xeb)]+_0x260b6d(0xfa)+_0x1f189b['id']),_0x59fb82!==_0x54f417&&console[_0x260b6d(0x10f)](_0x260b6d(0x101)+_0x59fb82),await handleSDKOutput([_0x1f189b],_0x95ba7),0x0;}}function a28_0x2cca(_0x4846a1,_0x260025){_0x4846a1=_0x4846a1-0xd5;const _0x10cea2=a28_0x10ce();let _0x2cca0c=_0x10cea2[_0x4846a1];return _0x2cca0c;}function a28_0x10ce(){const _0x5f5cb3=['Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.','segment','createSegment','14877024unjJdY','resolveParentId','segmentPath','\x20\x20\x20Path:\x20','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27','description','Segment\x20name:\x20','Target\x20path:\x20','Resolving\x20parent\x20segment\x20\x27','\x27...','Parent\x20path:\x20','Examples:','Resolving\x20folder\x20path\x20\x27','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27','1280956UUprBZ','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','segments','error','folderId','Resolved\x20folder\x20ID:\x20','segment:create','Resolved\x20relative\x20path\x20to:\x20','yellow','rule','35588DcxKha','9DJrgDC','type','includes','27kYjfpg','folder','execute','Create\x20child\x20segment\x20with\x20filtering\x20rules','parent','Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]','17675OFUKsJ','resolveFolderId','Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]','⚠\x20Deprecation\x20warning:\x20`segment\x20create`\x20is\x20deprecated.','\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','βœ”\x20Created\x20segment\x20\x27','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','8UCtOOa','name','kind','data','length','461367ayokVv','invisible','ruleFile','noCountPopulation','20EGFBeL','Parent:\x20','5166620ThVLyu','5505313iVrMSb','2670jjOXCl','Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)','verbose','\x27\x20with\x20ID:\x20'];a28_0x10ce=function(){return _0x5f5cb3;};return a28_0x10ce();}
1
+ const a28_0x505b4f=a28_0x5eed;(function(_0x42f679,_0x42dc1a){const _0xa65fb3=a28_0x5eed,_0x17c68a=_0x42f679();while(!![]){try{const _0x252777=-parseInt(_0xa65fb3(0x115))/0x1+parseInt(_0xa65fb3(0xf6))/0x2*(-parseInt(_0xa65fb3(0x105))/0x3)+parseInt(_0xa65fb3(0x122))/0x4*(parseInt(_0xa65fb3(0x111))/0x5)+parseInt(_0xa65fb3(0xf8))/0x6+parseInt(_0xa65fb3(0x123))/0x7*(parseInt(_0xa65fb3(0x114))/0x8)+parseInt(_0xa65fb3(0xf5))/0x9*(parseInt(_0xa65fb3(0x10f))/0xa)+parseInt(_0xa65fb3(0xff))/0xb*(-parseInt(_0xa65fb3(0x104))/0xc);if(_0x252777===_0x42dc1a)break;else _0x17c68a['push'](_0x17c68a['shift']());}catch(_0x334dc4){_0x17c68a['push'](_0x17c68a['shift']());}}}(a28_0x2861,0x38c75));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';function a28_0x5eed(_0x481f6a,_0x5b46ee){_0x481f6a=_0x481f6a-0xf0;const _0x28613a=a28_0x2861();let _0x5eed7a=_0x28613a[_0x481f6a];return _0x5eed7a;}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 a28_0x2861(){const _0x1e011b=['description','10sLBwNt','segments','length','360504oKspKZ','400514iqpDLl','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','Site:\x20','verbose','Examples:','rule','\x20\x20\x20Path:\x20','segment','Parent:\x20','parent','data','error','folder','155804kldsEs','35WspjIv','resolvePathToResource','Segment\x20name:\x20','Resolved\x20relative\x20path\x20to:\x20','type','Create\x20child\x20segment\x20with\x20filtering\x20rules','kind','72QdQcCQ','2rzrDvc','site','2090520VfZSWl','Target\x20path:\x20','Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]','folderId','noCountPopulation','Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.','\x27...','11IwMHJa','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','⚠\x20Deprecation\x20warning:\x20`segment\x20create`\x20is\x20deprecated.','includes','Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)','3492612SmovWu','510441mwAOhb','βœ”\x20Created\x20segment\x20\x27','yellow','segment:create','resolveFolderId','resolveParentId','Resolving\x20folder\x20path\x20\x27','name','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27','invisible','553300htWNGj'];a28_0x2861=function(){return _0x1e011b;};return a28_0x2861();}import a28_0x41c848 from'chalk';export class SegmentCreateCommand extends BaseCommand{[a28_0x505b4f(0x10c)]=a28_0x505b4f(0x108);[a28_0x505b4f(0x110)]=a28_0x505b4f(0xf3);async['execute'](_0x2df752){const _0x3b6b0a=a28_0x505b4f;console[_0x3b6b0a(0x120)](a28_0x41c848[_0x3b6b0a(0x107)](_0x3b6b0a(0x101))),console[_0x3b6b0a(0x120)](a28_0x41c848[_0x3b6b0a(0x107)](_0x3b6b0a(0x100)));const {options:_0x3da1ad,args:_0x3674a9,tdx:_0x39aed6}=_0x2df752,_0x1c7e66=_0x3da1ad;if(_0x3674a9['length']===0x0)return console[_0x3b6b0a(0x120)](_0x3b6b0a(0x116)),console[_0x3b6b0a(0x120)](_0x3b6b0a(0xfa)),console[_0x3b6b0a(0x120)](_0x3b6b0a(0x119)),console[_0x3b6b0a(0x120)](_0x3b6b0a(0x10d)),console[_0x3b6b0a(0x120)]('\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27'),console['error']('\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context'),0x1;const _0x442ba4=_0x3674a9[0x0],_0x1b6c60=_0x3da1ad['segmentPath'];let _0x4b89b0=_0x442ba4;_0x1b6c60&&!_0x442ba4[_0x3b6b0a(0x102)]('/')&&(_0x4b89b0=_0x1b6c60+'/'+_0x442ba4,_0x1c7e66['verbose']&&console[_0x3b6b0a(0x120)](_0x3b6b0a(0xf1)+_0x4b89b0));const _0x1d552d=parsePath(_0x4b89b0);if(_0x1d552d[_0x3b6b0a(0x112)][_0x3b6b0a(0x113)]<0x2)return console[_0x3b6b0a(0x120)](_0x3b6b0a(0x103)),console[_0x3b6b0a(0x120)]('Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]'),0x1;const _0x4e9aa3=_0x1d552d['segments'][0x0],_0x201052=getBaseName(_0x4b89b0),_0x352786=getParentPath(_0x4b89b0);_0x1c7e66[_0x3b6b0a(0x118)]&&(console[_0x3b6b0a(0x120)](_0x3b6b0a(0x117)+_0x1c7e66[_0x3b6b0a(0xf7)]),console[_0x3b6b0a(0x120)](_0x3b6b0a(0xf9)+_0x4b89b0),console['error'](_0x3b6b0a(0x11d)+_0x4e9aa3),console['error'](_0x3b6b0a(0xf0)+_0x201052),console[_0x3b6b0a(0x120)]('Parent\x20path:\x20'+_0x352786));const _0xbb60e5=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x4e9aa3+_0x3b6b0a(0xfe),()=>_0x39aed6[_0x3b6b0a(0x11c)][_0x3b6b0a(0x10a)](_0x4e9aa3),{'verbose':_0x1c7e66[_0x3b6b0a(0x118)]}),_0x36b61f=_0xbb60e5['data'];let _0xfea04b;if(_0x1d552d[_0x3b6b0a(0x112)][_0x3b6b0a(0x113)]>0x2){const _0x30404b=await withSpinner(_0x3b6b0a(0x10b)+_0x352786+_0x3b6b0a(0xfe),()=>_0x39aed6[_0x3b6b0a(0x11c)][_0x3b6b0a(0x124)](_0x352786),{'verbose':_0x1c7e66[_0x3b6b0a(0x118)]}),_0x56fb76=_0x30404b[_0x3b6b0a(0x11f)];if(_0x56fb76['type']!==_0x3b6b0a(0x121)&&_0x56fb76[_0x3b6b0a(0xf2)]!==_0x3b6b0a(0x11e))return console[_0x3b6b0a(0x120)](_0x3b6b0a(0xfd)),0x1;_0xfea04b=_0x56fb76[_0x3b6b0a(0xfb)];}else{if(_0x1c7e66[_0x3b6b0a(0x121)]){const _0x23ba79=await withSpinner('Resolving\x20folder\x20\x27'+_0x1c7e66[_0x3b6b0a(0x121)]+_0x3b6b0a(0xfe),()=>_0x39aed6[_0x3b6b0a(0x11c)][_0x3b6b0a(0x109)](_0x36b61f,_0x1c7e66[_0x3b6b0a(0x121)]),{'verbose':_0x1c7e66['verbose']});_0xfea04b=_0x23ba79['data'];}}_0x1c7e66[_0x3b6b0a(0x118)]&&_0xfea04b&&console[_0x3b6b0a(0x120)]('Resolved\x20folder\x20ID:\x20'+_0xfea04b);const _0x29d3db=await loadJSONFromOptions(_0x1c7e66[_0x3b6b0a(0x11a)],_0x1c7e66['ruleFile']),_0x4c9f72={'name':_0x201052,'description':_0x1c7e66[_0x3b6b0a(0x110)],'rule':_0x29d3db,'kind':_0x1c7e66[_0x3b6b0a(0xf4)]!==undefined?parseInt(_0x1c7e66[_0x3b6b0a(0xf4)],0xa):undefined,'isVisible':_0x1c7e66[_0x3b6b0a(0x10e)]?![]:undefined,'segmentFolderId':_0xfea04b,'countPopulation':_0x1c7e66[_0x3b6b0a(0xfc)]?![]:undefined},_0x4b6a96=await withSpinner('Creating\x20segment\x20\x27'+_0x201052+_0x3b6b0a(0xfe),()=>_0x39aed6[_0x3b6b0a(0x11c)]['createSegment'](_0x36b61f,_0x4c9f72),{'verbose':_0x1c7e66['verbose']}),_0x49eef3=_0x4b6a96[_0x3b6b0a(0x11f)];return console[_0x3b6b0a(0x120)](_0x3b6b0a(0x106)+_0x49eef3[_0x3b6b0a(0x10c)]+'\x27\x20with\x20ID:\x20'+_0x49eef3['id']),_0x4b89b0!==_0x442ba4&&console[_0x3b6b0a(0x120)](_0x3b6b0a(0x11b)+_0x4b89b0),await handleSDKOutput([_0x49eef3],_0x1c7e66),0x0;}}
@@ -1 +1 @@
1
- const a29_0x18ee33=a29_0x59e4;(function(_0x2ef1f3,_0x1064ff){const _0x2e7659=a29_0x59e4,_0x57d008=_0x2ef1f3();while(!![]){try{const _0x77ca40=parseInt(_0x2e7659(0x10d))/0x1+parseInt(_0x2e7659(0x114))/0x2*(parseInt(_0x2e7659(0x121))/0x3)+parseInt(_0x2e7659(0x115))/0x4+-parseInt(_0x2e7659(0x10b))/0x5*(-parseInt(_0x2e7659(0x117))/0x6)+-parseInt(_0x2e7659(0x124))/0x7+-parseInt(_0x2e7659(0x11a))/0x8+-parseInt(_0x2e7659(0x123))/0x9*(parseInt(_0x2e7659(0x11e))/0xa);if(_0x77ca40===_0x1064ff)break;else _0x57d008['push'](_0x57d008['shift']());}catch(_0x485454){_0x57d008['push'](_0x57d008['shift']());}}}(a29_0x2109,0x31073));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';function a29_0x2109(){const _0x3a790e=['7655tjihtu','\x27...','164752vvGEOk','Site:\x20','description','Parent\x20segment:\x20','jsonl','verbose','name','19238nXlgyq','188128KylIZD','Listing\x20fields\x20for\x20\x27','1374XIRrgD','error','List\x20available\x20fields\x20for\x20segmentation','698672FjiTOx','Error:\x20Parent\x20segment\x20name\x20is\x20required','length','data','590cqkZOo','site','Usage:\x20tdx\x20segment\x20fields\x20<parent_name>','96htsbje','βœ”\x20Found\x20','50202qZThfa','1770552pfLPQe','\x20field'];a29_0x2109=function(){return _0x3a790e;};return a29_0x2109();}function a29_0x59e4(_0xebd908,_0x3fc0ba){_0xebd908=_0xebd908-0x10b;const _0x2109cd=a29_0x2109();let _0x59e465=_0x2109cd[_0xebd908];return _0x59e465;}import{displayFieldsHumanReadable}from'../sdk/segment/fields-display.js';export class SegmentFieldsCommand extends BaseCommand{[a29_0x18ee33(0x113)]='segment:fields';[a29_0x18ee33(0x10f)]=a29_0x18ee33(0x119);async['execute'](_0x2f1147){const _0x39c7b0=a29_0x18ee33,{options:_0x4c0aaa,args:_0x1726ff,tdx:_0x1b794b}=_0x2f1147,_0x40713d=_0x1726ff[0x0]||_0x4c0aaa['parentSegment'];if(!_0x40713d)return console[_0x39c7b0(0x118)](_0x39c7b0(0x11b)),console[_0x39c7b0(0x118)](_0x39c7b0(0x120)),console[_0x39c7b0(0x118)]('\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>'),0x1;_0x4c0aaa[_0x39c7b0(0x112)]&&(console[_0x39c7b0(0x118)](_0x39c7b0(0x10e)+_0x4c0aaa[_0x39c7b0(0x11f)]),console[_0x39c7b0(0x118)](_0x39c7b0(0x110)+_0x40713d));const _0x1ede4f=await withSpinner(_0x39c7b0(0x116)+_0x40713d+_0x39c7b0(0x10c),()=>_0x1b794b['segment']['listFields'](_0x40713d),{'verbose':_0x4c0aaa[_0x39c7b0(0x112)]}),_0x170865=_0x1ede4f[_0x39c7b0(0x11d)];console[_0x39c7b0(0x118)](_0x39c7b0(0x122)+_0x170865[_0x39c7b0(0x11c)]+_0x39c7b0(0x125)+(_0x170865[_0x39c7b0(0x11c)]!==0x1?'s':''));if(_0x4c0aaa['json']||_0x4c0aaa[_0x39c7b0(0x111)])return await handleSDKOutput(_0x170865,_0x4c0aaa),0x0;return displayFieldsHumanReadable(_0x170865,_0x40713d),0x0;}}
1
+ function a29_0x28f2(_0x35d0b5,_0x1c546f){_0x35d0b5=_0x35d0b5-0x146;const _0x2f6201=a29_0x2f62();let _0x28f242=_0x2f6201[_0x35d0b5];return _0x28f242;}function a29_0x2f62(){const _0xa5de10=['segment','Parent\x20segment:\x20','Usage:\x20tdx\x20segment\x20fields\x20<parent_name>','json','data','βœ”\x20Found\x20','3549628VFWhES','site','\x20field','parentSegment','verbose','length','4yEpCai','16215768BBcNeD','Site:\x20','jsonl','description','1473708XRbjLj','listFields','7403185yrydJz','error','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','8otfPyw','910778newkOQ','Error:\x20Parent\x20segment\x20name\x20is\x20required','\x27...','5962818uEuxAL','1704535ufbUeI','Listing\x20fields\x20for\x20\x27'];a29_0x2f62=function(){return _0xa5de10;};return a29_0x2f62();}const a29_0x2bdcc3=a29_0x28f2;(function(_0xa4552b,_0x4e7eba){const _0x371996=a29_0x28f2,_0x399a33=_0xa4552b();while(!![]){try{const _0x4fcf0e=parseInt(_0x371996(0x152))/0x1*(parseInt(_0x371996(0x147))/0x2)+parseInt(_0x371996(0x14c))/0x3+-parseInt(_0x371996(0x15e))/0x4+-parseInt(_0x371996(0x14e))/0x5+-parseInt(_0x371996(0x155))/0x6+parseInt(_0x371996(0x156))/0x7+parseInt(_0x371996(0x151))/0x8*(parseInt(_0x371996(0x148))/0x9);if(_0x4fcf0e===_0x4e7eba)break;else _0x399a33['push'](_0x399a33['shift']());}catch(_0xdc6167){_0x399a33['push'](_0x399a33['shift']());}}}(a29_0x2f62,0xf336a));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';export class SegmentFieldsCommand extends BaseCommand{['name']='segment:fields';[a29_0x2bdcc3(0x14b)]='List\x20available\x20fields\x20for\x20segmentation';async['execute'](_0x2c4acc){const _0x3e79a7=a29_0x2bdcc3,{options:_0x45752c,args:_0x5afcc0,tdx:_0x472a2f}=_0x2c4acc,_0x4d02e7=_0x5afcc0[0x0]||_0x45752c[_0x3e79a7(0x161)];if(!_0x4d02e7)return console[_0x3e79a7(0x14f)](_0x3e79a7(0x153)),console[_0x3e79a7(0x14f)](_0x3e79a7(0x15a)),console[_0x3e79a7(0x14f)](_0x3e79a7(0x150)),0x1;_0x45752c[_0x3e79a7(0x162)]&&(console['error'](_0x3e79a7(0x149)+_0x45752c[_0x3e79a7(0x15f)]),console[_0x3e79a7(0x14f)](_0x3e79a7(0x159)+_0x4d02e7));const _0x12a47f=await withSpinner(_0x3e79a7(0x157)+_0x4d02e7+_0x3e79a7(0x154),()=>_0x472a2f[_0x3e79a7(0x158)][_0x3e79a7(0x14d)](_0x4d02e7),{'verbose':_0x45752c[_0x3e79a7(0x162)]}),_0x2109d4=_0x12a47f[_0x3e79a7(0x15c)];console[_0x3e79a7(0x14f)](_0x3e79a7(0x15d)+_0x2109d4[_0x3e79a7(0x146)]+_0x3e79a7(0x160)+(_0x2109d4[_0x3e79a7(0x146)]!==0x1?'s':''));if(_0x45752c[_0x3e79a7(0x15b)]||_0x45752c[_0x3e79a7(0x14a)])return await handleSDKOutput(_0x2109d4,_0x45752c),0x0;return displayFieldsHumanReadable(_0x2109d4,_0x4d02e7),0x0;}}
@@ -1 +1 @@
1
- const a30_0x112ec1=a30_0x52b4;(function(_0x4648e6,_0x31cbc5){const _0x12513e=a30_0x52b4,_0x18ece3=_0x4648e6();while(!![]){try{const _0x5d56ca=parseInt(_0x12513e(0x132))/0x1*(parseInt(_0x12513e(0x140))/0x2)+-parseInt(_0x12513e(0x131))/0x3*(-parseInt(_0x12513e(0x148))/0x4)+parseInt(_0x12513e(0x14f))/0x5*(parseInt(_0x12513e(0x14a))/0x6)+-parseInt(_0x12513e(0x125))/0x7+-parseInt(_0x12513e(0x135))/0x8*(parseInt(_0x12513e(0x12d))/0x9)+parseInt(_0x12513e(0x149))/0xa*(parseInt(_0x12513e(0x127))/0xb)+-parseInt(_0x12513e(0x11a))/0xc*(parseInt(_0x12513e(0x128))/0xd);if(_0x5d56ca===_0x31cbc5)break;else _0x18ece3['push'](_0x18ece3['shift']());}catch(_0x359a95){_0x18ece3['push'](_0x18ece3['shift']());}}}(a30_0xd362,0xde07c));import{BaseCommand}from'./command.js';function a30_0xd362(){const _0x3e7909=['dryRun','session','\x20activations','9DPpweZ','green','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','diff','9QEiYty','152683wGVZMc','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','execute','9277880qNQxiY','parentSegment','content','\x20journeys','pullSegments','\x0aPull\x20summary\x20for\x20\x27','No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27','\x20versions)','site','message','files','14JjConD','segments','\x20\x20🎯\x20','activations','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)','verbose','\x20\x20πŸ—ΊοΈ\x20\x20','name','1643204IYpoRy','970EXUpYn','2525136XNrcGN','Aborted.','repeat','parentName','βœ”\x20Pulled\x20','10xcIuSd','targetDir','resourceName','dim','yellow','Parent\x20segment:\x20','Site:\x20','cyan','Write\x20','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','-\x20no\x20files\x20written','hasChanges','segment:pull','\x20segments','\x20new\x20files','\x20with\x20','\x20files?','parent_segment','βœ”\x20Context\x20set:\x20','counts','Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files','type','cwd','error','filter','Pulling\x20segments\x20from\x20\x27','helpText','journeys','Target\x20resource:\x20','utf-8','12svashA','isNew','segment','yes','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','no_parent','setPhase','relativePath','Error:\x20','\x27...','red','2728194DhyYAY','\x20\x20Target:\x20','116666eVYxdw','22265945ABNTAb','length'];a30_0xd362=function(){return _0x3e7909;};return a30_0xd362();}import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{saveSessionContext}from'../core/session.js';function a30_0x52b4(_0x194ce2,_0x57f332){_0x194ce2=_0x194ce2-0x118;const _0xd36232=a30_0xd362();let _0x52b42d=_0xd36232[_0x194ce2];return _0x52b42d;}import a30_0x20db2a from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';import a30_0x1f7a96 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{[a30_0x112ec1(0x147)]=a30_0x112ec1(0x15b);['description']=a30_0x112ec1(0x163);async[a30_0x112ec1(0x134)](_0x30ceba){const _0x525d67=a30_0x112ec1,{options:_0x3b3b2a,args:_0x288fed,tdx:_0xcf1505}=_0x30ceba,_0x304f43=_0x3b3b2a,_0x3ec0f2=await resolveTarget({'arg':_0x288fed[0x0],'contextParent':_0x3b3b2a[_0x525d67(0x136)],'cwd':process[_0x525d67(0x165)]()});if(!isSuccessfulResolution(_0x3ec0f2))return _0x3ec0f2['errorCode']===_0x525d67(0x11f)?(console[_0x525d67(0x166)](a30_0x20db2a[_0x525d67(0x153)](_0x525d67(0x158))),console[_0x525d67(0x166)](_0x525d67(0x144)),console['error']('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent'),console[_0x525d67(0x166)]('\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[_0x525d67(0x166)](a30_0x20db2a[_0x525d67(0x124)](_0x525d67(0x122)+_0x3ec0f2[_0x525d67(0x13e)]+'\x0a')),_0x3ec0f2[_0x525d67(0x169)]&&console[_0x525d67(0x166)](a30_0x20db2a['cyan'](_0x3ec0f2['helpText']))),0x1;const _0x518e17=_0x3ec0f2[_0x525d67(0x14d)],_0x37fbcc=_0x3ec0f2[_0x525d67(0x150)],_0x518de6=_0x3ec0f2[_0x525d67(0x164)]==='file'?_0x3ec0f2[_0x525d67(0x151)]:undefined;_0x304f43['verbose']&&(console[_0x525d67(0x166)](_0x525d67(0x155)+_0x304f43[_0x525d67(0x13d)]),console[_0x525d67(0x166)](_0x525d67(0x154)+_0x518e17),_0x518de6&&console[_0x525d67(0x166)](_0x525d67(0x118)+_0x518de6));const _0x18859b=await withProgressSpinner(_0x525d67(0x168)+_0x518e17+_0x525d67(0x123),_0x284e04=>_0xcf1505[_0x525d67(0x11c)][_0x525d67(0x139)](_0x518e17,{'targetDir':_0x37fbcc,'targetResourceName':_0x518de6,'verbose':_0x304f43[_0x525d67(0x145)],'progress':{'update':_0x46bc15=>{const _0x179662=_0x525d67;_0x284e04[_0x179662(0x120)](_0x46bc15),_0x304f43[_0x179662(0x145)]&&console[_0x179662(0x166)]('\x20\x20'+_0x46bc15);}}}),{'verbose':_0x304f43[_0x525d67(0x145)]}),_0x58b77b=_0x18859b['data'];if(_0x58b77b[_0x525d67(0x162)][_0x525d67(0x141)]===0x0&&_0x58b77b[_0x525d67(0x162)]['journeys']===0x0)return console[_0x525d67(0x166)](a30_0x20db2a[_0x525d67(0x153)](_0x525d67(0x13b)+_0x58b77b[_0x525d67(0x14d)]+'\x27')),0x0;const _0x450a23=_0x58b77b[_0x525d67(0x13f)][_0x525d67(0x167)](_0x2999a3=>_0x2999a3['isNew']),_0x32f7d9=_0x58b77b[_0x525d67(0x13f)][_0x525d67(0x167)](_0x4ceffc=>!_0x4ceffc[_0x525d67(0x11b)]&&_0x4ceffc[_0x525d67(0x15a)]),_0x42ab6a=_0x58b77b[_0x525d67(0x13f)][_0x525d67(0x167)](_0x56411f=>!_0x56411f[_0x525d67(0x11b)]&&!_0x56411f[_0x525d67(0x15a)]);console[_0x525d67(0x166)](_0x525d67(0x13a)+_0x58b77b[_0x525d67(0x14d)]+'\x27:'),console[_0x525d67(0x166)](_0x525d67(0x142)+a30_0x20db2a[_0x525d67(0x156)](_0x58b77b[_0x525d67(0x162)][_0x525d67(0x141)]+_0x525d67(0x15c))+_0x525d67(0x15e)+a30_0x20db2a[_0x525d67(0x156)](_0x58b77b[_0x525d67(0x162)][_0x525d67(0x143)]+_0x525d67(0x12c)));if(_0x58b77b[_0x525d67(0x162)][_0x525d67(0x16a)]>0x0){const _0x44cdea=_0x58b77b[_0x525d67(0x162)]['journeyVersions']>_0x58b77b[_0x525d67(0x162)]['journeys']?'\x20('+_0x58b77b['counts']['journeyVersions']+_0x525d67(0x13c):'';console[_0x525d67(0x166)](_0x525d67(0x146)+a30_0x20db2a[_0x525d67(0x156)](_0x58b77b['counts'][_0x525d67(0x16a)]+_0x525d67(0x138))+a30_0x20db2a['dim'](_0x44cdea));}console[_0x525d67(0x166)]('\x20\x20'+a30_0x20db2a['green']('+\x20'+_0x450a23[_0x525d67(0x129)]+_0x525d67(0x15d))),console[_0x525d67(0x166)]('\x20\x20'+a30_0x20db2a['yellow']('~\x20'+_0x32f7d9[_0x525d67(0x129)]+'\x20changed\x20files')),console[_0x525d67(0x166)]('\x20\x20'+a30_0x20db2a[_0x525d67(0x152)]('=\x20'+_0x42ab6a[_0x525d67(0x129)]+'\x20unchanged\x20files')),console['error'](_0x525d67(0x126)+a30_0x20db2a['cyan'](_0x58b77b[_0x525d67(0x150)])+'\x0a');if(_0x32f7d9['length']>0x0)for(const _0x1eace1 of _0x32f7d9){console[_0x525d67(0x166)]('\x0aChanges\x20to\x20\x27'+_0x1eace1[_0x525d67(0x121)]+'\x27:'),console[_0x525d67(0x166)]('─'[_0x525d67(0x14c)](0x3c)),console[_0x525d67(0x166)](_0x1eace1[_0x525d67(0x130)]),console['error']('─'['repeat'](0x3c));}if(_0x304f43[_0x525d67(0x12a)])return console[_0x525d67(0x166)](a30_0x20db2a['yellow'](_0x525d67(0x12f))),0x0;if(_0x450a23[_0x525d67(0x129)]===0x0&&_0x32f7d9[_0x525d67(0x129)]===0x0)return console[_0x525d67(0x166)](a30_0x20db2a[_0x525d67(0x12e)]('βœ”\x20All\x20files\x20are\x20up\x20to\x20date')),saveSessionContext({'parent_segment':_0x58b77b['parentName']},_0x304f43[_0x525d67(0x12b)]),console[_0x525d67(0x166)](a30_0x20db2a[_0x525d67(0x12e)](_0x525d67(0x161)+a30_0x20db2a[_0x525d67(0x152)](_0x525d67(0x160))+'\x20=\x20'+a30_0x20db2a[_0x525d67(0x156)](_0x58b77b[_0x525d67(0x14d)]))),0x0;if(!_0x304f43[_0x525d67(0x11d)]){if(!isInteractive())return console['error'](a30_0x20db2a[_0x525d67(0x124)]('\x0aError:'),_0x525d67(0x11e)),console[_0x525d67(0x166)](a30_0x20db2a[_0x525d67(0x152)](_0x525d67(0x133))),0x1;const _0x2cf1b3=await confirmKey(_0x525d67(0x157)+(_0x450a23[_0x525d67(0x129)]+_0x32f7d9['length'])+_0x525d67(0x15f));if(!_0x2cf1b3)return console[_0x525d67(0x166)](a30_0x20db2a[_0x525d67(0x153)](_0x525d67(0x14b)),_0x525d67(0x159)),0x1;}for(const _0x424105 of _0x58b77b[_0x525d67(0x13f)]){if(_0x424105[_0x525d67(0x11b)]||_0x424105['hasChanges']){const _0x489a1e=a30_0x1f7a96['dirname'](_0x424105['absolutePath']);!existsSync(_0x489a1e)&&mkdirSync(_0x489a1e,{'recursive':!![]}),writeFileSync(_0x424105['absolutePath'],_0x424105[_0x525d67(0x137)],_0x525d67(0x119));}}return console[_0x525d67(0x166)](a30_0x20db2a[_0x525d67(0x12e)](_0x525d67(0x14e)+(_0x450a23['length']+_0x32f7d9['length'])+'\x20files\x20to\x20'+_0x58b77b[_0x525d67(0x150)])),saveSessionContext({'parent_segment':_0x58b77b['parentName']},_0x304f43[_0x525d67(0x12b)]),console[_0x525d67(0x166)](a30_0x20db2a[_0x525d67(0x12e)](_0x525d67(0x161)+a30_0x20db2a[_0x525d67(0x152)](_0x525d67(0x160))+'\x20=\x20'+a30_0x20db2a[_0x525d67(0x156)](_0x58b77b[_0x525d67(0x14d)]))),0x0;}}
1
+ const a30_0x6736a8=a30_0x28fc;(function(_0x10401d,_0x2ba36e){const _0x2980f6=a30_0x28fc,_0x258af1=_0x10401d();while(!![]){try{const _0x19b3d6=-parseInt(_0x2980f6(0xdb))/0x1+-parseInt(_0x2980f6(0xbd))/0x2*(-parseInt(_0x2980f6(0xd5))/0x3)+-parseInt(_0x2980f6(0xed))/0x4+parseInt(_0x2980f6(0xd7))/0x5*(-parseInt(_0x2980f6(0xe9))/0x6)+parseInt(_0x2980f6(0xce))/0x7+-parseInt(_0x2980f6(0xcb))/0x8+parseInt(_0x2980f6(0xec))/0x9;if(_0x19b3d6===_0x2ba36e)break;else _0x258af1['push'](_0x258af1['shift']());}catch(_0x147003){_0x258af1['push'](_0x258af1['shift']());}}}(a30_0x4df3,0x37034));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{saveSessionContext}from'../core/session.js';import a30_0x159112 from'chalk';function a30_0x28fc(_0x5cf42c,_0x270a85){_0x5cf42c=_0x5cf42c-0xb2;const _0x4df323=a30_0x4df3();let _0x28fc13=_0x4df323[_0x5cf42c];return _0x28fc13;}import{existsSync,mkdirSync,writeFileSync}from'fs';function a30_0x4df3(){const _0x18358a=['1049419jqwxLt','dryRun','yellow','\x20files\x20to\x20','\x20files?','\x20=\x20','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','3lvzjhI','isNew','210XFIiJN','no_parent','verbose','data','287844feEHFo','Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files','pullSegments','Site:\x20','parent_segment','files','diff','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file','Write\x20','errorCode','activations','dirname','type','hasChanges','14454KhqBHj','helpText','parentName','5553819pfQTnn','1381396PpsXRo','relativePath','counts','dim','green','\x20versions)','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)','session','Pulling\x20segments\x20from\x20\x27','βœ”\x20All\x20files\x20are\x20up\x20to\x20date','yes','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','\x20unchanged\x20files','error','utf-8','-\x20no\x20files\x20written','setPhase','\x20changed\x20files','\x0aPull\x20summary\x20for\x20\x27','\x20activations','segment:pull','absolutePath','journeyVersions','\x27...','\x20\x20Target:\x20','Error:\x20','segments','732098NxrSwy','cyan','length','cwd','\x20segments','Parent\x20segment:\x20','red','content','\x20\x20πŸ—ΊοΈ\x20\x20','targetDir','filter','\x20\x20🎯\x20','Aborted.','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','1386832wLChzN','\x0aChanges\x20to\x20\x27','journeys'];a30_0x4df3=function(){return _0x18358a;};return a30_0x4df3();}import a30_0xe82c4f from'path';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';export{buildFolderIdToPathMap as buildFolderPathMap}from'../sdk/segment/resolution-context.js';export class SegmentPullCommand extends BaseCommand{['name']=a30_0x6736a8(0xb6);['description']=a30_0x6736a8(0xdc);async['execute'](_0x1ed4c6){const _0x322e65=a30_0x6736a8,{options:_0x3217ba,args:_0x45d041,tdx:_0x5430f7}=_0x1ed4c6,_0x54464c=_0x3217ba,_0x4e6536=await resolveTarget({'arg':_0x45d041[0x0],'contextParent':_0x3217ba['parentSegment'],'cwd':process[_0x322e65(0xc0)]()});if(!isSuccessfulResolution(_0x4e6536))return _0x4e6536[_0x322e65(0xe4)]===_0x322e65(0xd8)?(console['error'](a30_0x159112[_0x322e65(0xd0)](_0x322e65(0xca))),console[_0x322e65(0xfa)](_0x322e65(0xf3)),console[_0x322e65(0xfa)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent'),console['error'](_0x322e65(0xe2))):(console[_0x322e65(0xfa)](a30_0x159112['red'](_0x322e65(0xbb)+_0x4e6536['message']+'\x0a')),_0x4e6536[_0x322e65(0xea)]&&console[_0x322e65(0xfa)](a30_0x159112[_0x322e65(0xbe)](_0x4e6536[_0x322e65(0xea)]))),0x1;const _0x3df703=_0x4e6536[_0x322e65(0xeb)],_0x2acefb=_0x4e6536[_0x322e65(0xc6)],_0x545687=_0x4e6536[_0x322e65(0xe7)]==='file'?_0x4e6536['resourceName']:undefined;_0x54464c[_0x322e65(0xd9)]&&(console[_0x322e65(0xfa)](_0x322e65(0xde)+_0x54464c['site']),console[_0x322e65(0xfa)](_0x322e65(0xc2)+_0x3df703),_0x545687&&console[_0x322e65(0xfa)]('Target\x20resource:\x20'+_0x545687));const _0x3f1255=await withProgressSpinner(_0x322e65(0xf5)+_0x3df703+_0x322e65(0xb9),_0x3081f0=>_0x5430f7['segment'][_0x322e65(0xdd)](_0x3df703,{'targetDir':_0x2acefb,'targetResourceName':_0x545687,'verbose':_0x54464c[_0x322e65(0xd9)],'progress':{'update':_0xd10783=>{const _0x62e88b=_0x322e65;_0x3081f0[_0x62e88b(0xb2)](_0xd10783),_0x54464c[_0x62e88b(0xd9)]&&console[_0x62e88b(0xfa)]('\x20\x20'+_0xd10783);}}}),{'verbose':_0x54464c[_0x322e65(0xd9)]}),_0x4a954b=_0x3f1255[_0x322e65(0xda)];if(_0x4a954b['counts'][_0x322e65(0xbc)]===0x0&&_0x4a954b['counts'][_0x322e65(0xcd)]===0x0)return console['error'](a30_0x159112[_0x322e65(0xd0)]('No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27'+_0x4a954b['parentName']+'\x27')),0x0;const _0x54689e=_0x4a954b['files']['filter'](_0x5ea6ab=>_0x5ea6ab[_0x322e65(0xd6)]),_0x4d79d0=_0x4a954b[_0x322e65(0xe0)][_0x322e65(0xc7)](_0x43d496=>!_0x43d496[_0x322e65(0xd6)]&&_0x43d496['hasChanges']),_0x40a6f5=_0x4a954b[_0x322e65(0xe0)][_0x322e65(0xc7)](_0x57a9f0=>!_0x57a9f0[_0x322e65(0xd6)]&&!_0x57a9f0['hasChanges']);console[_0x322e65(0xfa)](_0x322e65(0xb4)+_0x4a954b[_0x322e65(0xeb)]+'\x27:'),console[_0x322e65(0xfa)](_0x322e65(0xc8)+a30_0x159112[_0x322e65(0xbe)](_0x4a954b[_0x322e65(0xef)][_0x322e65(0xbc)]+_0x322e65(0xc1))+'\x20with\x20'+a30_0x159112[_0x322e65(0xbe)](_0x4a954b[_0x322e65(0xef)][_0x322e65(0xe5)]+_0x322e65(0xb5)));if(_0x4a954b['counts']['journeys']>0x0){const _0x51a3e4=_0x4a954b[_0x322e65(0xef)][_0x322e65(0xb8)]>_0x4a954b['counts'][_0x322e65(0xcd)]?'\x20('+_0x4a954b[_0x322e65(0xef)]['journeyVersions']+_0x322e65(0xf2):'';console[_0x322e65(0xfa)](_0x322e65(0xc5)+a30_0x159112[_0x322e65(0xbe)](_0x4a954b['counts'][_0x322e65(0xcd)]+'\x20journeys')+a30_0x159112[_0x322e65(0xf0)](_0x51a3e4));}console['error']('\x20\x20'+a30_0x159112['green']('+\x20'+_0x54689e[_0x322e65(0xbf)]+'\x20new\x20files')),console['error']('\x20\x20'+a30_0x159112[_0x322e65(0xd0)]('~\x20'+_0x4d79d0['length']+_0x322e65(0xb3))),console[_0x322e65(0xfa)]('\x20\x20'+a30_0x159112['dim']('=\x20'+_0x40a6f5['length']+_0x322e65(0xf9))),console[_0x322e65(0xfa)](_0x322e65(0xba)+a30_0x159112[_0x322e65(0xbe)](_0x4a954b['targetDir'])+'\x0a');if(_0x4d79d0['length']>0x0)for(const _0x10553b of _0x4d79d0){console['error'](_0x322e65(0xcc)+_0x10553b[_0x322e65(0xee)]+'\x27:'),console['error']('─'['repeat'](0x3c)),console['error'](_0x10553b[_0x322e65(0xe1)]),console['error']('─'['repeat'](0x3c));}if(_0x54464c[_0x322e65(0xcf)])return console[_0x322e65(0xfa)](a30_0x159112[_0x322e65(0xd0)](_0x322e65(0xd4))),0x0;if(_0x54689e[_0x322e65(0xbf)]===0x0&&_0x4d79d0[_0x322e65(0xbf)]===0x0)return console['error'](a30_0x159112[_0x322e65(0xf1)](_0x322e65(0xf6))),saveSessionContext({'parent_segment':_0x4a954b['parentName']},_0x54464c[_0x322e65(0xf4)]),console['error'](a30_0x159112[_0x322e65(0xf1)]('βœ”\x20Context\x20set:\x20'+a30_0x159112[_0x322e65(0xf0)](_0x322e65(0xdf))+_0x322e65(0xd3)+a30_0x159112[_0x322e65(0xbe)](_0x4a954b[_0x322e65(0xeb)]))),0x0;if(!_0x54464c[_0x322e65(0xf7)]){if(!isInteractive())return console['error'](a30_0x159112[_0x322e65(0xc3)]('\x0aError:'),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console['error'](a30_0x159112['dim'](_0x322e65(0xf8))),0x1;const _0x322ab7=await confirmKey(_0x322e65(0xe3)+(_0x54689e['length']+_0x4d79d0['length'])+_0x322e65(0xd2));if(!_0x322ab7)return console[_0x322e65(0xfa)](a30_0x159112[_0x322e65(0xd0)](_0x322e65(0xc9)),_0x322e65(0xfc)),0x1;}for(const _0x496143 of _0x4a954b[_0x322e65(0xe0)]){if(_0x496143['isNew']||_0x496143[_0x322e65(0xe8)]){const _0x4f4a14=a30_0xe82c4f[_0x322e65(0xe6)](_0x496143['absolutePath']);!existsSync(_0x4f4a14)&&mkdirSync(_0x4f4a14,{'recursive':!![]}),writeFileSync(_0x496143[_0x322e65(0xb7)],_0x496143[_0x322e65(0xc4)],_0x322e65(0xfb));}}return console[_0x322e65(0xfa)](a30_0x159112[_0x322e65(0xf1)]('βœ”\x20Pulled\x20'+(_0x54689e[_0x322e65(0xbf)]+_0x4d79d0[_0x322e65(0xbf)])+_0x322e65(0xd1)+_0x4a954b[_0x322e65(0xc6)])),saveSessionContext({'parent_segment':_0x4a954b[_0x322e65(0xeb)]},_0x54464c[_0x322e65(0xf4)]),console[_0x322e65(0xfa)](a30_0x159112[_0x322e65(0xf1)]('βœ”\x20Context\x20set:\x20'+a30_0x159112['dim'](_0x322e65(0xdf))+'\x20=\x20'+a30_0x159112[_0x322e65(0xbe)](_0x4a954b[_0x322e65(0xeb)]))),0x0;}}
@@ -1 +1 @@
1
- const a31_0x2b8d57=a31_0x398a;function a31_0x54b0(){const _0x2a0750=['\x20deleted','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','\x20\x20Activations:','parentName','scopedFolderPath','Folders\x20to\x20create:','Fetching\x20existing\x20activations...','buildUserMaps','name','\x27...','segment','Fetching\x20parent\x20segment\x20details...','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','results','journeyBundleId','listActivations','Aborted.','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','10565DCnAqj','filePath','2214EHtPGT','join','.yaml','versionNumber','toString','πŸ“\x20','cyan','dim','repeat','\x0aValidation\x20failed:','342dHipTC','New\x20journey:','description','Scoped\x20to\x20folder:\x20','Fetching\x20existing\x20segments...','execute','journeys','\x20changed','\x20\x20\x20\x20','\x20\x20Source:\x20','data','Changes\x20to:','updated','nameToType','errorCode','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','No\x20','helpText','error','dryRun','createdAt','yamlConfig','user','listFolders','all','Resolving\x20parent\x20segment\x20\x27','Push\x20','yes','644AohsWG','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','folderPath','journeysOnly','segment:push','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file','filter','activations','then','diff','\x20updated','idToName','blue','parentFolder','deleted','unchanged','new','get','\x0aError:','targetDir','existingJourney','toCreate','created','journeyBundleName','setPhase','getOutputSchemaWithCache','Error:\x20','Fetching\x20existing\x20journeys...','\x20new','Delete\x20segment:','createdSegmentIds','green','connection','\x20\x20Activations:\x20','journeyId','26915euCpKj','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)','folderId','listSegments','\x0aβœ”\x20Push\x20complete','\x20to\x20create','isNew','yellow','state','getParent','Error:\x20Directory\x20not\x20found:\x20','changed','length','Fetching\x20users\x20for\x20email\x20resolution...','105490vdjYGl','paused','attributes','push','βœ”\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','listJourneysWithDetailsFromParentSegment','Changes\x20to\x20journey:','toUpdate','resolveParentId','list','segments','red','Fetching\x20existing\x20folders...','Fetching\x20connections\x20for\x20name\x20resolution...','folders','βœ”\x20All\x20journeys\x20are\x20up\x20to\x20date','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','site','map','\x20folders\x20to\x20create','verbose','\x20unchanged','journey','endsWith','toDelete','/j/da/je','1766840QcqjdG','set','\x20to\x20update','\x20\x20Journeys:\x20','no_parent','/app/ps/','message','69896kBqGzq','type','(Journey\x20will\x20be\x20deleted)','Error\x20parsing\x20YAML:\x20','Preparing\x20journeys...','\x20\x20πŸ—ΊοΈ\x20\x20Journeys:','Source\x20directory:\x20','add','isScoped','nameToId','Parent\x20segment:\x20','New\x20segment:','2196061SVHOCG','\x20to\x20delete','delete','\x20\x20πŸ“Š\x20Segments:','50CIYboi','audienceId','\x0aPush\x20summary\x20for\x20\x27','45MmdBGv','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)'];a31_0x54b0=function(){return _0x2a0750;};return a31_0x54b0();}(function(_0x4761dd,_0x5594e8){const _0x288833=a31_0x398a,_0x35f118=_0x4761dd();while(!![]){try{const _0x32f20c=parseInt(_0x288833(0x251))/0x1*(parseInt(_0x288833(0x239))/0x2)+parseInt(_0x288833(0x253))/0x3*(parseInt(_0x288833(0x1d7))/0x4)+parseInt(_0x288833(0x1fa))/0x5*(-parseInt(_0x288833(0x25d))/0x6)+parseInt(_0x288833(0x235))/0x7+parseInt(_0x288833(0x229))/0x8*(-parseInt(_0x288833(0x23c))/0x9)+-parseInt(_0x288833(0x222))/0xa+-parseInt(_0x288833(0x208))/0xb;if(_0x32f20c===_0x5594e8)break;else _0x35f118['push'](_0x35f118['shift']());}catch(_0x4419cd){_0x35f118['push'](_0x35f118['shift']());}}}(a31_0x54b0,0x27084));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 a31_0x1d0107 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 a31_0x398a(_0x361bec,_0x5bbd90){_0x361bec=_0x361bec-0x1d7;const _0x54b013=a31_0x54b0();let _0x398a5d=_0x54b013[_0x361bec];return _0x398a5d;}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{[a31_0x2b8d57(0x246)]=a31_0x2b8d57(0x1db);[a31_0x2b8d57(0x25f)]='Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments';async[a31_0x2b8d57(0x262)](_0x22dd0d){const _0x3475dd=a31_0x2b8d57,{options:_0x128839,args:_0xd2c9d9,tdx:_0xe2dc49}=_0x22dd0d,_0x46c506=_0x128839,_0x5a3abc=await resolveTarget({'arg':_0xd2c9d9[0x0],'contextParent':_0x128839['parentSegment'],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x5a3abc))return _0x5a3abc[_0x3475dd(0x26b)]===_0x3475dd(0x226)?(console[_0x3475dd(0x26f)](a31_0x1d0107[_0x3475dd(0x201)]('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console['error'](_0x3475dd(0x1fb)),console['error'](_0x3475dd(0x24a)),console[_0x3475dd(0x26f)](_0x3475dd(0x1dc))):(console['error'](a31_0x1d0107[_0x3475dd(0x213)](_0x3475dd(0x1f1)+_0x5a3abc[_0x3475dd(0x228)]+'\x0a')),_0x5a3abc['helpText']&&console[_0x3475dd(0x26f)](a31_0x1d0107['cyan'](_0x5a3abc[_0x3475dd(0x26e)]))),0x1;if(_0x5a3abc[_0x3475dd(0x22a)]==='parent_name')return console['error'](a31_0x1d0107[_0x3475dd(0x213)]('Error:\x20Directory\x20not\x20found:\x20'+_0x5a3abc[_0x3475dd(0x1ea)]+'\x0a')),console[_0x3475dd(0x26f)](a31_0x1d0107[_0x3475dd(0x259)](_0x3475dd(0x250))),0x1;const _0x4c3a67=_0x5a3abc[_0x3475dd(0x241)],_0x254f0b=_0x5a3abc[_0x3475dd(0x1ea)],_0x30661a=_0x5a3abc[_0x3475dd(0x22a)]==='file'?_0x5a3abc[_0x3475dd(0x252)]:undefined,_0x42266f=getScopedDetails(_0x5a3abc),_0x56571b=_0x42266f?.[_0x3475dd(0x231)]??![],_0x89cf67=_0x42266f?.[_0x3475dd(0x242)]??'';if(!existsSync(_0x254f0b))return console[_0x3475dd(0x26f)](a31_0x1d0107[_0x3475dd(0x213)](_0x3475dd(0x204)+_0x254f0b+'\x0a')),console[_0x3475dd(0x26f)](a31_0x1d0107[_0x3475dd(0x259)]('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;_0x46c506[_0x3475dd(0x21c)]&&(console[_0x3475dd(0x26f)]('Site:\x20'+_0x46c506['site']),console['error'](_0x3475dd(0x233)+_0x4c3a67),console[_0x3475dd(0x26f)](_0x3475dd(0x22f)+_0x254f0b),_0x56571b&&console['error'](_0x3475dd(0x260)+_0x89cf67));const _0x56184a=await withSpinner(_0x3475dd(0x276)+_0x4c3a67+_0x3475dd(0x247),()=>_0xe2dc49[_0x3475dd(0x248)][_0x3475dd(0x210)](_0x4c3a67),{'verbose':_0x46c506[_0x3475dd(0x21c)]}),_0xa7fb83=_0x56184a['data'],[_0x4b8302,_0x244dca,_0x256ae9,_0x1b2bc7,_0x281f2f]=await Promise[_0x3475dd(0x275)]([withSpinner(_0x3475dd(0x249),()=>_0xe2dc49[_0x3475dd(0x248)][_0x3475dd(0x203)](_0xa7fb83),{'verbose':_0x46c506[_0x3475dd(0x21c)]}),withSpinner(_0x3475dd(0x261),()=>_0xe2dc49[_0x3475dd(0x248)][_0x3475dd(0x1fd)](_0xa7fb83),{'verbose':_0x46c506[_0x3475dd(0x21c)]}),withSpinner(_0x3475dd(0x214),()=>_0xe2dc49[_0x3475dd(0x248)][_0x3475dd(0x274)](_0xa7fb83),{'verbose':_0x46c506['verbose']}),withSpinner(_0x3475dd(0x1f2),()=>_0xe2dc49[_0x3475dd(0x21e)][_0x3475dd(0x20d)](_0xa7fb83,{'includeAllVersions':!![]}),{'verbose':_0x46c506[_0x3475dd(0x21c)]}),withSpinner(_0x3475dd(0x207),()=>_0xe2dc49[_0x3475dd(0x273)][_0x3475dd(0x245)](),{'verbose':_0x46c506[_0x3475dd(0x21c)]})[_0x3475dd(0x1df)](_0x38d9fe=>_0x38d9fe[_0x3475dd(0x267)])]),_0x35a675=_0x4b8302[_0x3475dd(0x267)],_0x32c07e=extractRootFolderId(_0x35a675),_0x2d2f2b=_0x244dca[_0x3475dd(0x267)],_0x2d03f1=_0x256ae9[_0x3475dd(0x267)],{journeys:_0x35110a,activationStepsById:_0x3b8d15}=_0x1b2bc7[_0x3475dd(0x267)],_0x1e616f=new Map(_0x35110a[_0x3475dd(0x21a)](_0x501d5=>[_0x501d5['id'],_0x501d5])),_0x5d46a0=_0x35110a['map'](_0x22f456=>({'id':_0x22f456['id'],'name':_0x22f456[_0x3475dd(0x20a)]['name'],'journeyBundleName':_0x22f456['attributes'][_0x3475dd(0x1ee)]||'','journeyBundleId':_0x22f456[_0x3475dd(0x20a)][_0x3475dd(0x24c)]||'','versionNumber':_0x22f456[_0x3475dd(0x20a)][_0x3475dd(0x256)],'description':_0x22f456[_0x3475dd(0x20a)][_0x3475dd(0x25f)],'state':_0x22f456[_0x3475dd(0x20a)][_0x3475dd(0x202)],'paused':_0x22f456['attributes'][_0x3475dd(0x209)],'audienceId':_0x22f456[_0x3475dd(0x20a)][_0x3475dd(0x23a)],'folderId':_0x22f456['relationships']?.[_0x3475dd(0x1e4)]?.[_0x3475dd(0x267)]?.['id'],'createdAt':_0x22f456[_0x3475dd(0x20a)][_0x3475dd(0x271)],'updatedAt':_0x22f456[_0x3475dd(0x20a)]['updatedAt']})),{emailToId:_0x3bb7a5,idToEmail:_0x293956}=_0x281f2f,_0x4cfe61=await withSpinner(_0x3475dd(0x215),async()=>{const _0x131f7a=_0x3475dd,_0x3fa921=await _0xe2dc49[_0x131f7a(0x1f7)][_0x131f7a(0x211)]();return buildConnectionMaps(_0x3fa921);},{'verbose':_0x46c506[_0x3475dd(0x21c)]})[_0x3475dd(0x1df)](_0xda042b=>_0xda042b[_0x3475dd(0x267)]),_0x43f8d7=_0x4cfe61[_0x3475dd(0x232)],_0x18cfb4=_0x4cfe61[_0x3475dd(0x1e2)],_0x64ac74=_0x4cfe61[_0x3475dd(0x26a)],_0x5d2b16={'emailToIdMap':_0x3bb7a5,'connectionNameToIdMap':_0x43f8d7,'connectionNameToTypeMap':_0x64ac74,'getSchema':_0x1394bc=>_0xe2dc49[_0x3475dd(0x1f7)][_0x3475dd(0x1f0)](_0x1394bc)};let {pathToId:_0x1057f0,idToPath:_0x414613}=buildFolderMaps(_0x2d03f1);const _0x28fc22=buildSegmentLookupMap(_0x2d2f2b,_0x414613),_0x228ae0=buildSegmentNameToIdMap(_0x2d2f2b),_0x3f1de8=buildJourneyBundleLookupMap(_0x5d46a0,_0x414613);let _0x8ea275;if(_0x30661a){if(!_0x30661a[_0x3475dd(0x21f)]('.yml')&&!_0x30661a[_0x3475dd(0x21f)](_0x3475dd(0x255)))return console[_0x3475dd(0x26f)](a31_0x1d0107[_0x3475dd(0x213)]('Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20'+_0x30661a+'\x0a')),0x1;_0x8ea275=[_0x30661a];}else _0x8ea275=findYamlFiles(_0x254f0b);if(_0x8ea275[_0x3475dd(0x206)]===0x0)return console[_0x3475dd(0x26f)](a31_0x1d0107[_0x3475dd(0x213)](_0x3475dd(0x26c)+_0x254f0b+'\x0a')),console[_0x3475dd(0x26f)](a31_0x1d0107[_0x3475dd(0x259)](_0x3475dd(0x1d8))),0x1;let _0x5f32ff,_0x337b4e;try{const _0x2a6067=parseAndClassifyYamlFiles(_0x8ea275,_0x254f0b,{'skipSegments':_0x46c506[_0x3475dd(0x1da)]});_0x5f32ff=_0x2a6067[_0x3475dd(0x212)],_0x337b4e=_0x2a6067[_0x3475dd(0x263)];const _0x3e8ee2=validateParsedFiles(_0x2a6067,_0x254f0b);if(_0x3e8ee2[_0x3475dd(0x206)]>0x0)return console['error'](a31_0x1d0107['red'](_0x3475dd(0x25c))),console[_0x3475dd(0x26f)](formatValidationErrors(_0x3e8ee2)),console['error'](a31_0x1d0107[_0x3475dd(0x201)](_0x3475dd(0x24f))),0x1;}catch(_0x7c9c3c){return console['error'](a31_0x1d0107[_0x3475dd(0x213)](_0x3475dd(0x22c)+(_0x7c9c3c instanceof Error?_0x7c9c3c[_0x3475dd(0x228)]:_0x7c9c3c))),0x1;}if(_0x5f32ff[_0x3475dd(0x206)]===0x0&&_0x337b4e['length']===0x0){const _0x4f33b7=_0x46c506[_0x3475dd(0x1da)]?_0x3475dd(0x21e):'segment\x20or\x20journey';return console[_0x3475dd(0x26f)](a31_0x1d0107[_0x3475dd(0x201)](_0x3475dd(0x26d)+_0x4f33b7+'\x20YAML\x20files\x20found')),0x0;}const _0xf511ee=new Map();_0x2d2f2b[_0x3475dd(0x206)]>0x0&&!_0x46c506[_0x3475dd(0x1da)]&&await withSpinner(_0x3475dd(0x244),async()=>{await batchAsync(_0x2d2f2b,async _0x3e6c5c=>{const _0x213456=a31_0x398a,_0x5e86ce=await _0xe2dc49[_0x213456(0x248)][_0x213456(0x24d)](_0xa7fb83,_0x3e6c5c['id']);_0xf511ee[_0x213456(0x223)](_0x3e6c5c['id'],_0x5e86ce);});},{'verbose':_0x46c506[_0x3475dd(0x21c)]});const {segmentFiles:_0xf77f86,foldersToCreate:_0x1884d3}=await prepareSegmentFiles(_0x5f32ff,{'segmentByFolderAndName':_0x28fc22,'activationsBySegmentId':_0xf511ee,'folderPathToId':_0x1057f0,'idToEmailMap':_0x293956,'connectionIdToNameMap':_0x18cfb4},_0x5d2b16,_0x56571b,_0x89cf67),_0x5f44f3=_0x30661a?[]:findSegmentsToDelete(_0x2d2f2b,_0x5f32ff[_0x3475dd(0x21a)](({yamlConfig:_0x3d1519,folderPath:_0x39a276})=>({'yamlConfig':_0x3d1519,'folderPath':resolveTDFolderPath(_0x39a276,_0x56571b,_0x89cf67)})),_0x414613,_0x89cf67,_0x56571b),{journeyFiles:_0x4262c5,foldersToCreate:_0x3e7e37}=await withProgressSpinner(_0x3475dd(0x22d),async _0xf97bb5=>prepareJourneyFiles(_0x337b4e,{'fetchJourney':async _0x1a7159=>_0xe2dc49[_0x3475dd(0x21e)]['getJourney'](_0x1a7159['journeyId']),'journeyBundlesByFolderAndName':_0x3f1de8,'folderPathToId':_0x1057f0,'idToEmailMap':_0x293956,'connectionIdToNameMap':_0x18cfb4,'existingSegments':_0x2d2f2b,'parentId':_0xa7fb83,'deps':_0xe2dc49,'progress':{'update':_0x31364a=>{const _0x4b6e47=_0x3475dd;_0xf97bb5[_0x4b6e47(0x1ef)](_0x31364a),_0x46c506[_0x4b6e47(0x21c)]&&console[_0x4b6e47(0x26f)]('\x20\x20'+_0x31364a);}},'journeyById':_0x1e616f,'activationStepsById':_0x3b8d15},_0x56571b,_0x89cf67),{'verbose':_0x46c506[_0x3475dd(0x21c)]})[_0x3475dd(0x1df)](_0x36efcf=>_0x36efcf[_0x3475dd(0x267)]);for(const _0x4cc73d of _0x3e7e37){_0x1884d3[_0x3475dd(0x230)](_0x4cc73d);}const _0x3fdb9c=_0x30661a?[]:findJourneysToDelete(_0x5d46a0,_0x337b4e[_0x3475dd(0x21a)](({yamlConfig:_0x46adc5,folderPath:_0x4869a1})=>({'yamlConfig':_0x46adc5,'folderPath':resolveTDFolderPath(_0x4869a1,_0x56571b,_0x89cf67)})),_0x414613,_0x89cf67,_0x56571b),_0x29b20a=calculatePushStats(_0xf77f86,_0x4262c5,_0x1884d3,_0x5f44f3,_0x3fdb9c,!!_0x46c506[_0x3475dd(0x237)],!!_0x46c506[_0x3475dd(0x1da)]),_0x1e8e74=_0x29b20a[_0x3475dd(0x212)][_0x3475dd(0x1e7)],_0x57d50c=_0x29b20a[_0x3475dd(0x212)]['changed'],_0x3971c4=_0x29b20a[_0x3475dd(0x212)][_0x3475dd(0x1e6)],_0x5abbf4=_0x29b20a[_0x3475dd(0x212)][_0x3475dd(0x220)],_0x4b762b=_0x29b20a[_0x3475dd(0x216)][_0x3475dd(0x1ec)],_0x2e08b1=_0x29b20a[_0x3475dd(0x263)][_0x3475dd(0x1e7)],_0x2b6d82=_0x29b20a[_0x3475dd(0x263)][_0x3475dd(0x205)],_0x26a580=_0x29b20a[_0x3475dd(0x263)][_0x3475dd(0x1e6)],_0x971244=_0x29b20a[_0x3475dd(0x263)][_0x3475dd(0x220)],_0x15de74=_0x29b20a['activations']['all'],_0x52bfb0=_0x29b20a[_0x3475dd(0x1de)][_0x3475dd(0x1ec)],_0x523074=_0x29b20a[_0x3475dd(0x1de)][_0x3475dd(0x20f)],_0x388b2e=_0x29b20a[_0x3475dd(0x1de)][_0x3475dd(0x220)];console[_0x3475dd(0x26f)](_0x3475dd(0x23b)+_0x4c3a67+'\x27:');_0x4b762b[_0x3475dd(0x206)]>0x0&&console[_0x3475dd(0x26f)]('\x20\x20'+a31_0x1d0107[_0x3475dd(0x1e3)](_0x3475dd(0x258)+_0x4b762b['length']+_0x3475dd(0x21b)));if(!_0x46c506[_0x3475dd(0x1da)]){console[_0x3475dd(0x26f)](_0x3475dd(0x238)),console['error']('\x20\x20\x20\x20'+a31_0x1d0107[_0x3475dd(0x1f6)]('+\x20'+_0x1e8e74[_0x3475dd(0x206)]+'\x20new')),console[_0x3475dd(0x26f)]('\x20\x20\x20\x20'+a31_0x1d0107[_0x3475dd(0x201)]('~\x20'+_0x57d50c[_0x3475dd(0x206)]+_0x3475dd(0x264)));if(_0x5abbf4[_0x3475dd(0x206)]>0x0)console['error'](_0x3475dd(0x265)+a31_0x1d0107[_0x3475dd(0x213)]('-\x20'+_0x5abbf4['length']+'\x20to\x20delete'));else _0x5f44f3[_0x3475dd(0x206)]>0x0&&!_0x46c506[_0x3475dd(0x237)]&&console[_0x3475dd(0x26f)](_0x3475dd(0x265)+a31_0x1d0107[_0x3475dd(0x25a)](_0x5f44f3[_0x3475dd(0x206)]+'\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)'));console['error'](_0x3475dd(0x265)+a31_0x1d0107[_0x3475dd(0x25a)]('=\x20'+_0x3971c4['length']+_0x3475dd(0x21d)));}if(_0x4262c5['length']>0x0||_0x3fdb9c[_0x3475dd(0x206)]>0x0){console['error'](_0x3475dd(0x22e)),console['error']('\x20\x20\x20\x20'+a31_0x1d0107['green']('+\x20'+_0x2e08b1['length']+_0x3475dd(0x1f3))),console[_0x3475dd(0x26f)](_0x3475dd(0x265)+a31_0x1d0107['yellow']('~\x20'+_0x2b6d82[_0x3475dd(0x206)]+'\x20changed'));if(_0x971244[_0x3475dd(0x206)]>0x0)console[_0x3475dd(0x26f)](_0x3475dd(0x265)+a31_0x1d0107[_0x3475dd(0x213)]('-\x20'+_0x971244['length']+'\x20to\x20delete'));else _0x3fdb9c['length']>0x0&&!_0x46c506[_0x3475dd(0x237)]&&console[_0x3475dd(0x26f)](_0x3475dd(0x265)+a31_0x1d0107[_0x3475dd(0x25a)](_0x3fdb9c[_0x3475dd(0x206)]+_0x3475dd(0x23d)));console[_0x3475dd(0x26f)]('\x20\x20\x20\x20'+a31_0x1d0107['dim']('=\x20'+_0x26a580['length']+_0x3475dd(0x21d)));}_0x15de74['length']>0x0&&!_0x46c506[_0x3475dd(0x1da)]&&(console[_0x3475dd(0x26f)](''),console[_0x3475dd(0x26f)](_0x3475dd(0x240)),_0x52bfb0[_0x3475dd(0x206)]>0x0&&console['error']('\x20\x20\x20\x20'+a31_0x1d0107[_0x3475dd(0x1f6)]('+\x20'+_0x52bfb0[_0x3475dd(0x206)]+_0x3475dd(0x1ff))),_0x523074[_0x3475dd(0x206)]>0x0&&console[_0x3475dd(0x26f)](_0x3475dd(0x265)+a31_0x1d0107[_0x3475dd(0x201)]('~\x20'+_0x523074[_0x3475dd(0x206)]+_0x3475dd(0x224))),_0x388b2e[_0x3475dd(0x206)]>0x0&&console[_0x3475dd(0x26f)](_0x3475dd(0x265)+a31_0x1d0107[_0x3475dd(0x213)]('-\x20'+_0x388b2e['length']+_0x3475dd(0x236))));console['error'](_0x3475dd(0x266)+a31_0x1d0107[_0x3475dd(0x259)](_0x254f0b)+'\x0a');if(_0x4b762b['length']>0x0){console[_0x3475dd(0x26f)](_0x3475dd(0x243));for(const _0x19dbc4 of _0x4b762b){console['error']('\x20\x20'+a31_0x1d0107['blue']('+')+'\x20'+_0x19dbc4);}console['error']('');}if(_0x1e8e74[_0x3475dd(0x206)]>0x0&&!_0x46c506[_0x3475dd(0x1da)])for(const _0x2ba2ec of _0x1e8e74){const _0x4df84c=_0x2ba2ec[_0x3475dd(0x1d9)]?_0x2ba2ec[_0x3475dd(0x1d9)]+'/'+_0x2ba2ec[_0x3475dd(0x272)][_0x3475dd(0x246)]:_0x2ba2ec[_0x3475dd(0x272)][_0x3475dd(0x246)],_0x1db3c4=_0x2ba2ec[_0x3475dd(0x272)][_0x3475dd(0x1de)]?.[_0x3475dd(0x206)]||0x0,_0x34f19a=_0x1db3c4>0x0?a31_0x1d0107[_0x3475dd(0x25a)]('\x20['+_0x1db3c4+'\x20activations]'):'';console[_0x3475dd(0x26f)]('\x0a'+a31_0x1d0107[_0x3475dd(0x1f6)](_0x3475dd(0x234))+'\x20'+_0x4df84c+_0x34f19a),console[_0x3475dd(0x26f)]('─'[_0x3475dd(0x25b)](0x3c)),_0x2ba2ec[_0x3475dd(0x1e0)]&&console[_0x3475dd(0x26f)](_0x2ba2ec['diff']),console['error']('─'['repeat'](0x3c));}if(_0x5abbf4[_0x3475dd(0x206)]>0x0&&!_0x46c506[_0x3475dd(0x1da)])for(const _0x141099 of _0x5abbf4){const _0x3016fb=_0x141099['segmentFolderId']?_0x414613[_0x3475dd(0x1e8)](_0x141099['segmentFolderId'][_0x3475dd(0x257)]())||'':'',_0x274b5e=_0x3016fb?_0x3016fb+'/'+_0x141099[_0x3475dd(0x246)]:_0x141099['name'],_0x3f3ccc=_0xf511ee[_0x3475dd(0x1e8)](_0x141099['id'])||[],_0x4cc034=_0x3f3ccc[_0x3475dd(0x206)]>0x0?a31_0x1d0107[_0x3475dd(0x25a)]('\x20['+_0x3f3ccc[_0x3475dd(0x206)]+'\x20activations]'):'';console['error']('\x0a'+a31_0x1d0107['red'](_0x3475dd(0x1f4))+'\x20'+_0x274b5e+_0x4cc034),console[_0x3475dd(0x26f)]('─'[_0x3475dd(0x25b)](0x3c));const _0x3169f5=segmentWithActivationsToYaml(_0x141099,_0x3f3ccc,undefined,_0x293956,_0x18cfb4),_0x2460c4=segmentToYamlString(_0x3169f5),_0x1c4687=generateDiff(_0x2460c4,'');console[_0x3475dd(0x26f)](formatDiffWithColors(_0x1c4687)),console[_0x3475dd(0x26f)]('─'[_0x3475dd(0x25b)](0x3c));}const _0x4fbc23=_0xf77f86[_0x3475dd(0x1dd)](_0x43412e=>!_0x43412e['isNew']&&_0x43412e[_0x3475dd(0x1e0)]);if(_0x4fbc23[_0x3475dd(0x206)]>0x0&&!_0x46c506['journeysOnly'])for(const _0x5a215c of _0x4fbc23){const _0x3b0730=_0x5a215c[_0x3475dd(0x1d9)]?_0x5a215c['folderPath']+'/'+_0x5a215c[_0x3475dd(0x272)][_0x3475dd(0x246)]:_0x5a215c[_0x3475dd(0x272)]['name'];console[_0x3475dd(0x26f)]('\x0a'+a31_0x1d0107['yellow'](_0x3475dd(0x268))+'\x20'+_0x3b0730),console[_0x3475dd(0x26f)]('─'['repeat'](0x3c)),console[_0x3475dd(0x26f)](_0x5a215c[_0x3475dd(0x1e0)]),console[_0x3475dd(0x26f)]('─'['repeat'](0x3c));}if(_0x2e08b1[_0x3475dd(0x206)]>0x0)for(const _0x4e8fd5 of _0x2e08b1){const _0x441b99=_0x4e8fd5['folderPath']?_0x4e8fd5[_0x3475dd(0x1d9)]+'/'+_0x4e8fd5[_0x3475dd(0x272)][_0x3475dd(0x246)]:_0x4e8fd5[_0x3475dd(0x272)][_0x3475dd(0x246)];console['error']('\x0a'+a31_0x1d0107[_0x3475dd(0x1f6)](_0x3475dd(0x25e))+'\x20'+_0x441b99),console[_0x3475dd(0x26f)]('─'['repeat'](0x3c)),_0x4e8fd5['diff']&&console[_0x3475dd(0x26f)](_0x4e8fd5['diff']),console['error']('─'[_0x3475dd(0x25b)](0x3c));}const _0x18f12b=_0x4262c5['filter'](_0x388c09=>!_0x388c09[_0x3475dd(0x200)]&&_0x388c09[_0x3475dd(0x1e0)]);if(_0x18f12b[_0x3475dd(0x206)]>0x0)for(const _0x5aa12c of _0x18f12b){const _0x54d6dd=_0x5aa12c['folderPath']?_0x5aa12c['folderPath']+'/'+_0x5aa12c['yamlConfig'][_0x3475dd(0x246)]:_0x5aa12c[_0x3475dd(0x272)]['name'];console[_0x3475dd(0x26f)]('\x0a'+a31_0x1d0107[_0x3475dd(0x201)](_0x3475dd(0x20e))+'\x20'+_0x54d6dd),console['error']('─'[_0x3475dd(0x25b)](0x3c)),console[_0x3475dd(0x26f)](_0x5aa12c['diff']),console['error']('─'[_0x3475dd(0x25b)](0x3c));}if(_0x971244['length']>0x0)for(const _0x19d1ea of _0x971244){const _0x285272=_0x19d1ea[_0x3475dd(0x1fc)]?_0x414613['get'](_0x19d1ea[_0x3475dd(0x1fc)])||'':'',_0x2761ff=_0x285272?_0x285272+'/'+_0x19d1ea['journeyBundleName']:_0x19d1ea[_0x3475dd(0x1ee)];console[_0x3475dd(0x26f)]('\x0a'+a31_0x1d0107[_0x3475dd(0x213)]('Delete\x20journey:')+'\x20'+_0x2761ff),console[_0x3475dd(0x26f)]('─'[_0x3475dd(0x25b)](0x3c)),console['error'](a31_0x1d0107[_0x3475dd(0x213)](_0x3475dd(0x22b))),console[_0x3475dd(0x26f)]('─'['repeat'](0x3c));}if(_0x46c506[_0x3475dd(0x270)])return console[_0x3475dd(0x26f)](a31_0x1d0107[_0x3475dd(0x201)]('\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made')),0x0;const _0x5e192f=_0x46c506[_0x3475dd(0x1da)]?![]:_0x1e8e74[_0x3475dd(0x206)]>0x0||_0x57d50c[_0x3475dd(0x206)]>0x0||_0x5abbf4[_0x3475dd(0x206)]>0x0,_0x42a200=_0x2e08b1[_0x3475dd(0x206)]>0x0||_0x2b6d82[_0x3475dd(0x206)]>0x0||_0x971244['length']>0x0,_0x507cad=_0x46c506[_0x3475dd(0x1da)]?![]:_0x15de74[_0x3475dd(0x206)]>0x0,_0x163971=_0x4b762b[_0x3475dd(0x206)]>0x0;if(!_0x5e192f&&!_0x42a200&&!_0x507cad&&!_0x163971){const _0x10e8ae=_0x46c506[_0x3475dd(0x1da)]?_0x3475dd(0x217):_0x3475dd(0x20c);console[_0x3475dd(0x26f)](a31_0x1d0107[_0x3475dd(0x1f6)](_0x10e8ae));if(_0x30661a&&_0x26a580['length']===0x1){const _0x1cf950=_0x26a580[0x0];if(_0x1cf950[_0x3475dd(0x1eb)]?.['id']){const _0x4bcf20=getConsoleNextUrl(_0x46c506[_0x3475dd(0x219)],_0x3475dd(0x227)+_0xa7fb83+'/e/'+_0x1cf950[_0x3475dd(0x1eb)]['id']+_0x3475dd(0x221));console[_0x3475dd(0x26f)]('\x20\x20'+a31_0x1d0107[_0x3475dd(0x259)](_0x4bcf20));}}return 0x0;}const _0x1437bf=_0x46c506[_0x3475dd(0x1da)]?_0x2e08b1[_0x3475dd(0x206)]+_0x2b6d82[_0x3475dd(0x206)]+_0x971244[_0x3475dd(0x206)]+_0x4b762b[_0x3475dd(0x206)]:_0x1e8e74['length']+_0x57d50c[_0x3475dd(0x206)]+_0x5abbf4[_0x3475dd(0x206)]+_0x2e08b1[_0x3475dd(0x206)]+_0x2b6d82[_0x3475dd(0x206)]+_0x971244[_0x3475dd(0x206)]+_0x4b762b[_0x3475dd(0x206)]+_0x15de74[_0x3475dd(0x206)];if(!_0x46c506[_0x3475dd(0x278)]&&_0x1437bf>0x0){if(!isInteractive())return console[_0x3475dd(0x26f)](a31_0x1d0107[_0x3475dd(0x213)](_0x3475dd(0x1e9)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x3475dd(0x26f)](a31_0x1d0107[_0x3475dd(0x25a)](_0x3475dd(0x218))),0x1;const _0x614122=await confirmKey(_0x3475dd(0x277)+_0x1437bf+'\x20changes?');if(!_0x614122)return console[_0x3475dd(0x26f)](a31_0x1d0107[_0x3475dd(0x201)](_0x3475dd(0x24e))),0x1;}const _0x15e113={'withProgress':async(_0xa5ae0d,_0x495b9)=>{const _0x402f14=_0x3475dd,_0x5a26a1=await withSpinner(_0xa5ae0d,_0x495b9,{'verbose':_0x46c506[_0x402f14(0x21c)]});return{'data':_0x5a26a1[_0x402f14(0x267)]};},'logInfo':_0x41aeee=>console['error'](a31_0x1d0107[_0x3475dd(0x1e3)]('βœ”\x20'+_0x41aeee)),'logSuccess':_0x154c7d=>console[_0x3475dd(0x26f)](a31_0x1d0107[_0x3475dd(0x1f6)]('βœ”\x20'+_0x154c7d)),'logWarning':_0x52a8cf=>console['error'](a31_0x1d0107[_0x3475dd(0x201)]('⚠\x20'+_0x52a8cf)),'logDeleted':_0x1c749d=>console[_0x3475dd(0x26f)](a31_0x1d0107[_0x3475dd(0x213)]('βœ”\x20'+_0x1c749d))},_0x15a495={'segment':_0xe2dc49[_0x3475dd(0x248)],'journey':_0xe2dc49[_0x3475dd(0x21e)],'user':_0xe2dc49['user'],'connection':_0xe2dc49[_0x3475dd(0x1f7)]};_0x4b762b['length']>0x0&&(_0x1057f0=await executePushFolders(_0x15a495,_0x4b762b,_0x1057f0,{'parentId':_0xa7fb83},_0x15e113));const _0x104c26={'rootFolderId':_0x32c07e,'folderPathToId':_0x1057f0,'folderIdToPath':_0x414613,'segmentNameToId':_0x228ae0,'activationsBySegmentId':_0xf511ee,'emailToIdMap':_0x3bb7a5,'idToEmailMap':_0x293956,'connectionNameToIdMap':_0x4cfe61[_0x3475dd(0x232)],'connectionIdToNameMap':_0x4cfe61[_0x3475dd(0x1e2)],'connectionNameToTypeMap':_0x64ac74},_0x1041e5=await executePushSegments(_0x15a495,_0x46c506[_0x3475dd(0x1da)]?[]:_0xf77f86,_0x104c26,{'parentId':_0xa7fb83},_0x15e113),_0x3958b1=_0x1041e5[_0x3475dd(0x1ed)],_0x5f1353=_0x1041e5[_0x3475dd(0x269)],_0x140a6a=_0x1041e5[_0x3475dd(0x1de)][_0x3475dd(0x1ed)],_0x5ec331=_0x1041e5[_0x3475dd(0x1de)][_0x3475dd(0x269)],_0x1f2ce3=_0x1041e5[_0x3475dd(0x1de)][_0x3475dd(0x1e5)],_0x3a616c=await executePushSegmentDeletions(_0x15a495,_0x46c506[_0x3475dd(0x1da)]?[]:_0x5abbf4,_0x15e113);let _0x34953f=0x0,_0x3312f3=0x0,_0x18e381=0x0;const _0x4fa022=new Map(_0x228ae0);for(const [_0xd1151d,_0x327532]of _0x1041e5[_0x3475dd(0x1f5)]){_0x4fa022[_0x3475dd(0x223)](_0xd1151d,_0x327532);}if(_0x4262c5[_0x3475dd(0x206)]>0x0){const _0x4bb337={..._0x104c26,'segmentNameToId':_0x4fa022,'existingSegments':_0x2d2f2b,'activationContext':_0x5d2b16},_0x1735b9=await executePushJourneys(_0x15a495,_0x4262c5,_0x4bb337,{'parentId':_0xa7fb83,'rootFolderId':_0x32c07e,'verbose':_0x46c506[_0x3475dd(0x21c)]},_0x15e113);_0x34953f=_0x1735b9['created'],_0x3312f3=_0x1735b9[_0x3475dd(0x269)];if(_0x30661a&&_0x1735b9[_0x3475dd(0x24b)][_0x3475dd(0x206)]===0x1){const _0x57898c=_0x1735b9['results'][0x0];if(_0x57898c['journeyId']){const _0x25056b=getConsoleNextUrl(_0x46c506[_0x3475dd(0x219)],_0x3475dd(0x227)+_0xa7fb83+'/e/'+_0x57898c[_0x3475dd(0x1f9)]+_0x3475dd(0x221));console[_0x3475dd(0x26f)]('\x20\x20'+a31_0x1d0107[_0x3475dd(0x259)](_0x25056b));}}}for(const _0x147df4 of _0x971244){console['error'](a31_0x1d0107[_0x3475dd(0x201)](_0x3475dd(0x23f)+_0x147df4[_0x3475dd(0x1ee)])),_0x18e381++;}const _0x1b9507=[];if(_0x3958b1>0x0)_0x1b9507[_0x3475dd(0x20b)](_0x3958b1+'\x20created');if(_0x5f1353>0x0)_0x1b9507[_0x3475dd(0x20b)](_0x5f1353+_0x3475dd(0x1e1));if(_0x3a616c>0x0)_0x1b9507[_0x3475dd(0x20b)](_0x3a616c+'\x20deleted');const _0x5ea299=[];if(_0x34953f>0x0)_0x5ea299[_0x3475dd(0x20b)](_0x34953f+'\x20created');if(_0x3312f3>0x0)_0x5ea299[_0x3475dd(0x20b)](_0x3312f3+'\x20updated');if(_0x18e381>0x0)_0x5ea299[_0x3475dd(0x20b)](_0x18e381+_0x3475dd(0x23e));const _0x57e007=[];if(_0x140a6a>0x0)_0x57e007['push'](_0x140a6a+'\x20created');if(_0x5ec331>0x0)_0x57e007[_0x3475dd(0x20b)](_0x5ec331+'\x20updated');if(_0x1f2ce3>0x0)_0x57e007[_0x3475dd(0x20b)](_0x1f2ce3+'\x20deleted');return console[_0x3475dd(0x26f)](a31_0x1d0107[_0x3475dd(0x1f6)](_0x3475dd(0x1fe))),_0x1b9507['length']>0x0&&!_0x46c506[_0x3475dd(0x1da)]&&console[_0x3475dd(0x26f)]('\x20\x20Segments:\x20'+_0x1b9507[_0x3475dd(0x254)](',\x20')),_0x5ea299['length']>0x0&&console['error'](_0x3475dd(0x225)+_0x5ea299[_0x3475dd(0x254)](',\x20')),_0x57e007[_0x3475dd(0x206)]>0x0&&!_0x46c506[_0x3475dd(0x1da)]&&console[_0x3475dd(0x26f)](_0x3475dd(0x1f8)+_0x57e007[_0x3475dd(0x254)](',\x20')),0x0;}}
1
+ const a31_0x48dd15=a31_0x44b8;function a31_0x368d(){const _0x143c6b=['user','updated','activations','4837rRIiOC','get','existingJourney','.yaml','\x20deleted','Error\x20parsing\x20YAML:\x20','paused','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','journeyId','cyan','Scoped\x20to\x20folder:\x20','data','length','blue','filter','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','changed','New\x20segment:','attributes','listSegments','Fetching\x20existing\x20segments...','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','Delete\x20segment:','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','toCreate','diff','toDelete','add','Error:\x20Directory\x20not\x20found:\x20','state','push','verbose','\x0aError:','parentName','set','βœ”\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','list','\x20unchanged','journeyBundleName','\x20\x20Source:\x20','New\x20journey:','Fetching\x20existing\x20journeys...','toUpdate','listJourneysWithDetailsFromParentSegment','execute','\x20\x20Activations:','/e/','toString','Delete\x20journey:','segment','\x20folders\x20to\x20create','/app/ps/','9rYnVTq','map','\x20\x20\x20\x20','yamlConfig','Aborted.','\x20\x20Segments:\x20','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','then','isNew','journeysOnly','error','\x27...','Folders\x20to\x20create:','unchanged','138517sHSyjf','name','\x20to\x20delete','βœ”\x20All\x20journeys\x20are\x20up\x20to\x20date','\x20\x20πŸ“Š\x20Segments:','delete','created','\x20updated','\x20changed','site','Fetching\x20connections\x20for\x20name\x20resolution...','63nWEVjo','getJourney','type','description','folderId','connection','getParent','Source\x20directory:\x20','\x20\x20Journeys:\x20','resolveParentId','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','\x20activations]','yellow','green','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','15oQYvKI','29742024diLpFS','dim','Error:\x20','137396OMEsoa','dryRun','versionNumber','setPhase','createdAt','3053140chaMYo','\x20to\x20create','folderPath','segmentFolderId','Fetching\x20parent\x20segment\x20details...','nameToType','journey','Changes\x20to:','\x20\x20Activations:\x20','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','segments','isScoped','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','repeat','helpText','11FYKtiw','\x20new','new','folders','No\x20','Parent\x20segment:\x20','Fetching\x20users\x20for\x20email\x20resolution...','endsWith','/j/da/je','updatedAt','πŸ“\x20','\x20YAML\x20files\x20found','journeys','red','parentSegment','targetDir','Preparing\x20journeys...','1043944xniJcs','1227078uwvGxB','(Journey\x20will\x20be\x20deleted)','Push\x20','Fetching\x20existing\x20activations...','\x20changes?','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)','listFolders','join','\x20created','9752lOPNUo'];a31_0x368d=function(){return _0x143c6b;};return a31_0x368d();}(function(_0x3e770a,_0x505b55){const _0x228788=a31_0x44b8,_0x1f72cf=_0x3e770a();while(!![]){try{const _0xda94a5=-parseInt(_0x228788(0x231))/0x1+-parseInt(_0x228788(0x274))/0x2+parseInt(_0x228788(0x23c))/0x3*(-parseInt(_0x228788(0x24f))/0x4)+-parseInt(_0x228788(0x24b))/0x5*(-parseInt(_0x228788(0x275))/0x6)+-parseInt(_0x228788(0x282))/0x7*(parseInt(_0x228788(0x27e))/0x8)+-parseInt(_0x228788(0x223))/0x9*(parseInt(_0x228788(0x254))/0xa)+-parseInt(_0x228788(0x263))/0xb*(-parseInt(_0x228788(0x24c))/0xc);if(_0xda94a5===_0x505b55)break;else _0x1f72cf['push'](_0x1f72cf['shift']());}catch(_0x40cdfa){_0x1f72cf['push'](_0x1f72cf['shift']());}}}(a31_0x368d,0x89594));import{BaseCommand}from'./command.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';function a31_0x44b8(_0x3d6767,_0x4b4883){_0x3d6767=_0x3d6767-0x1f0;const _0x368d39=a31_0x368d();let _0x44b84e=_0x368d39[_0x3d6767];return _0x44b84e;}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 a31_0x230a92 from'chalk';import{existsSync}from'fs';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{resolveTarget,isSuccessfulResolution,getScopedDetails}from'../sdk/segment/target-resolution.js';import{buildFolderMaps}from'../sdk/segment/resolution-context.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{resolveTDFolderPath,findSegmentsToDelete,findJourneysToDelete,buildSegmentLookupMap,buildSegmentNameToIdMap,buildJourneyBundleLookupMap,parseAndClassifyYamlFiles,validateParsedFiles,formatValidationErrors,extractRootFolderId,buildConnectionMaps,calculatePushStats,prepareSegmentFiles,prepareJourneyFiles,executePushSegments,executePushFolders,executePushSegmentDeletions,executePushJourneys}from'../sdk/segment/push-workflow.js';export class SegmentPushCommand extends BaseCommand{[a31_0x48dd15(0x232)]='segment:push';[a31_0x48dd15(0x23f)]=a31_0x48dd15(0x206);async[a31_0x48dd15(0x21b)](_0x2d6c78){const _0x3b74f4=a31_0x48dd15,{options:_0x1a1c0d,args:_0x460e87,tdx:_0xe4524a}=_0x2d6c78,_0x3df165=_0x1a1c0d,_0x45b053=await resolveTarget({'arg':_0x460e87[0x0],'contextParent':_0x1a1c0d[_0x3b74f4(0x271)],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x45b053))return _0x45b053['errorCode']==='no_parent'?(console[_0x3b74f4(0x22d)](a31_0x230a92['yellow'](_0x3b74f4(0x246))),console[_0x3b74f4(0x22d)](_0x3b74f4(0x27a)),console[_0x3b74f4(0x22d)](_0x3b74f4(0x260)),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[_0x3b74f4(0x22d)](a31_0x230a92[_0x3b74f4(0x270)](_0x3b74f4(0x24e)+_0x45b053['message']+'\x0a')),_0x45b053[_0x3b74f4(0x262)]&&console[_0x3b74f4(0x22d)](a31_0x230a92[_0x3b74f4(0x1f8)](_0x45b053[_0x3b74f4(0x262)]))),0x1;if(_0x45b053[_0x3b74f4(0x23e)]==='parent_name')return console[_0x3b74f4(0x22d)](a31_0x230a92[_0x3b74f4(0x270)]('Error:\x20Directory\x20not\x20found:\x20'+_0x45b053[_0x3b74f4(0x272)]+'\x0a')),console['error'](a31_0x230a92[_0x3b74f4(0x1f8)](_0x3b74f4(0x204))),0x1;const _0x1b00cf=_0x45b053[_0x3b74f4(0x210)],_0x4409db=_0x45b053['targetDir'],_0x330fae=_0x45b053[_0x3b74f4(0x23e)]==='file'?_0x45b053['filePath']:undefined,_0x3f3126=getScopedDetails(_0x45b053),_0x4340d7=_0x3f3126?.[_0x3b74f4(0x25f)]??![],_0x57d4c8=_0x3f3126?.['scopedFolderPath']??'';if(!existsSync(_0x4409db))return console[_0x3b74f4(0x22d)](a31_0x230a92[_0x3b74f4(0x270)](_0x3b74f4(0x20b)+_0x4409db+'\x0a')),console[_0x3b74f4(0x22d)](a31_0x230a92[_0x3b74f4(0x1f8)]('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;_0x3df165[_0x3b74f4(0x20e)]&&(console[_0x3b74f4(0x22d)]('Site:\x20'+_0x3df165[_0x3b74f4(0x23a)]),console['error'](_0x3b74f4(0x268)+_0x1b00cf),console[_0x3b74f4(0x22d)](_0x3b74f4(0x243)+_0x4409db),_0x4340d7&&console['error'](_0x3b74f4(0x1f9)+_0x57d4c8));const _0x5ba1e9=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x1b00cf+_0x3b74f4(0x22e),()=>_0xe4524a[_0x3b74f4(0x220)][_0x3b74f4(0x245)](_0x1b00cf),{'verbose':_0x3df165[_0x3b74f4(0x20e)]}),_0x1c962d=_0x5ba1e9['data'],[_0x11a3aa,_0x19ab05,_0x432ddd,_0x3af402,_0x131c9e]=await Promise['all']([withSpinner(_0x3b74f4(0x258),()=>_0xe4524a[_0x3b74f4(0x220)][_0x3b74f4(0x242)](_0x1c962d),{'verbose':_0x3df165[_0x3b74f4(0x20e)]}),withSpinner(_0x3b74f4(0x203),()=>_0xe4524a[_0x3b74f4(0x220)][_0x3b74f4(0x202)](_0x1c962d),{'verbose':_0x3df165[_0x3b74f4(0x20e)]}),withSpinner('Fetching\x20existing\x20folders...',()=>_0xe4524a[_0x3b74f4(0x220)][_0x3b74f4(0x27b)](_0x1c962d),{'verbose':_0x3df165[_0x3b74f4(0x20e)]}),withSpinner(_0x3b74f4(0x218),()=>_0xe4524a[_0x3b74f4(0x25a)][_0x3b74f4(0x21a)](_0x1c962d,{'includeAllVersions':!![]}),{'verbose':_0x3df165[_0x3b74f4(0x20e)]}),withSpinner(_0x3b74f4(0x269),()=>_0xe4524a[_0x3b74f4(0x27f)]['buildUserMaps'](),{'verbose':_0x3df165[_0x3b74f4(0x20e)]})[_0x3b74f4(0x22a)](_0x52f134=>_0x52f134[_0x3b74f4(0x1fa)])]),_0x36bd29=_0x11a3aa[_0x3b74f4(0x1fa)],_0x5e248e=extractRootFolderId(_0x36bd29),_0x307374=_0x19ab05[_0x3b74f4(0x1fa)],_0x3558f8=_0x432ddd[_0x3b74f4(0x1fa)],{journeys:_0x1d77f0,activationStepsById:_0x3fc8ae}=_0x3af402[_0x3b74f4(0x1fa)],_0x58c47b=new Map(_0x1d77f0['map'](_0x29722d=>[_0x29722d['id'],_0x29722d])),_0x3e9713=_0x1d77f0['map'](_0x149c4c=>({'id':_0x149c4c['id'],'name':_0x149c4c[_0x3b74f4(0x201)]['name'],'journeyBundleName':_0x149c4c[_0x3b74f4(0x201)]['journeyBundleName']||'','journeyBundleId':_0x149c4c['attributes']['journeyBundleId']||'','versionNumber':_0x149c4c[_0x3b74f4(0x201)][_0x3b74f4(0x251)],'description':_0x149c4c[_0x3b74f4(0x201)][_0x3b74f4(0x23f)],'state':_0x149c4c[_0x3b74f4(0x201)][_0x3b74f4(0x20c)],'paused':_0x149c4c['attributes'][_0x3b74f4(0x1f5)],'audienceId':_0x149c4c['attributes']['audienceId'],'folderId':_0x149c4c['relationships']?.['parentFolder']?.['data']?.['id'],'createdAt':_0x149c4c[_0x3b74f4(0x201)][_0x3b74f4(0x253)],'updatedAt':_0x149c4c[_0x3b74f4(0x201)][_0x3b74f4(0x26c)]})),{emailToId:_0x390ca2,idToEmail:_0x5c8a1d}=_0x131c9e,_0x2a5fba=await withSpinner(_0x3b74f4(0x23b),async()=>{const _0x144001=_0x3b74f4,_0x404c7c=await _0xe4524a[_0x144001(0x241)][_0x144001(0x213)]();return buildConnectionMaps(_0x404c7c);},{'verbose':_0x3df165['verbose']})['then'](_0xd3c448=>_0xd3c448['data']),_0x3d5766=_0x2a5fba['nameToId'],_0x164cbc=_0x2a5fba['idToName'],_0x444a0d=_0x2a5fba[_0x3b74f4(0x259)],_0x55e04a={'emailToIdMap':_0x390ca2,'connectionNameToIdMap':_0x3d5766,'connectionNameToTypeMap':_0x444a0d,'getSchema':_0x323576=>_0xe4524a[_0x3b74f4(0x241)]['getOutputSchemaWithCache'](_0x323576)};let {pathToId:_0x1b61de,idToPath:_0x5cc522}=buildFolderMaps(_0x3558f8);const _0x28e31b=buildSegmentLookupMap(_0x307374,_0x5cc522),_0x54716f=buildSegmentNameToIdMap(_0x307374),_0x48624a=buildJourneyBundleLookupMap(_0x3e9713,_0x5cc522);let _0x566317;if(_0x330fae){if(!_0x330fae[_0x3b74f4(0x26a)]('.yml')&&!_0x330fae[_0x3b74f4(0x26a)](_0x3b74f4(0x1f2)))return console['error'](a31_0x230a92[_0x3b74f4(0x270)](_0x3b74f4(0x229)+_0x330fae+'\x0a')),0x1;_0x566317=[_0x330fae];}else _0x566317=findYamlFiles(_0x4409db);if(_0x566317[_0x3b74f4(0x1fb)]===0x0)return console['error'](a31_0x230a92[_0x3b74f4(0x270)]('Error:\x20No\x20YAML\x20files\x20found\x20in\x20'+_0x4409db+'\x0a')),console[_0x3b74f4(0x22d)](a31_0x230a92['cyan'](_0x3b74f4(0x1fe))),0x1;let _0x2b0f91,_0x85e874;try{const _0x253837=parseAndClassifyYamlFiles(_0x566317,_0x4409db,{'skipSegments':_0x3df165[_0x3b74f4(0x22c)]});_0x2b0f91=_0x253837[_0x3b74f4(0x25e)],_0x85e874=_0x253837[_0x3b74f4(0x26f)];const _0x4f340c=validateParsedFiles(_0x253837,_0x4409db);if(_0x4f340c[_0x3b74f4(0x1fb)]>0x0)return console[_0x3b74f4(0x22d)](a31_0x230a92[_0x3b74f4(0x270)]('\x0aValidation\x20failed:')),console[_0x3b74f4(0x22d)](formatValidationErrors(_0x4f340c)),console[_0x3b74f4(0x22d)](a31_0x230a92[_0x3b74f4(0x248)]('\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.')),0x1;}catch(_0x123d73){return console[_0x3b74f4(0x22d)](a31_0x230a92[_0x3b74f4(0x270)](_0x3b74f4(0x1f4)+(_0x123d73 instanceof Error?_0x123d73['message']:_0x123d73))),0x1;}if(_0x2b0f91[_0x3b74f4(0x1fb)]===0x0&&_0x85e874[_0x3b74f4(0x1fb)]===0x0){const _0x37ce37=_0x3df165[_0x3b74f4(0x22c)]?'journey':'segment\x20or\x20journey';return console[_0x3b74f4(0x22d)](a31_0x230a92[_0x3b74f4(0x248)](_0x3b74f4(0x267)+_0x37ce37+_0x3b74f4(0x26e))),0x0;}const _0x111401=new Map();_0x307374[_0x3b74f4(0x1fb)]>0x0&&!_0x3df165[_0x3b74f4(0x22c)]&&await withSpinner(_0x3b74f4(0x278),async()=>{await batchAsync(_0x307374,async _0x469edf=>{const _0x38a345=a31_0x44b8,_0x46a4bb=await _0xe4524a[_0x38a345(0x220)]['listActivations'](_0x1c962d,_0x469edf['id']);_0x111401[_0x38a345(0x211)](_0x469edf['id'],_0x46a4bb);});},{'verbose':_0x3df165[_0x3b74f4(0x20e)]});const {segmentFiles:_0x4d21d2,foldersToCreate:_0x14c902}=await prepareSegmentFiles(_0x2b0f91,{'segmentByFolderAndName':_0x28e31b,'activationsBySegmentId':_0x111401,'folderPathToId':_0x1b61de,'idToEmailMap':_0x5c8a1d,'connectionIdToNameMap':_0x164cbc},_0x55e04a,_0x4340d7,_0x57d4c8),_0x44c872=_0x330fae?[]:findSegmentsToDelete(_0x307374,_0x2b0f91[_0x3b74f4(0x224)](({yamlConfig:_0x21d437,folderPath:_0x379b0e})=>({'yamlConfig':_0x21d437,'folderPath':resolveTDFolderPath(_0x379b0e,_0x4340d7,_0x57d4c8)})),_0x5cc522,_0x57d4c8,_0x4340d7),{journeyFiles:_0x5ae990,foldersToCreate:_0x3bb84e}=await withProgressSpinner(_0x3b74f4(0x273),async _0x2e778d=>prepareJourneyFiles(_0x85e874,{'fetchJourney':async _0x17a9e2=>_0xe4524a['journey'][_0x3b74f4(0x23d)](_0x17a9e2[_0x3b74f4(0x1f7)]),'journeyBundlesByFolderAndName':_0x48624a,'folderPathToId':_0x1b61de,'idToEmailMap':_0x5c8a1d,'connectionIdToNameMap':_0x164cbc,'existingSegments':_0x307374,'parentId':_0x1c962d,'deps':_0xe4524a,'progress':{'update':_0x5dd061=>{const _0x14aee2=_0x3b74f4;_0x2e778d[_0x14aee2(0x252)](_0x5dd061),_0x3df165['verbose']&&console[_0x14aee2(0x22d)]('\x20\x20'+_0x5dd061);}},'journeyById':_0x58c47b,'activationStepsById':_0x3fc8ae},_0x4340d7,_0x57d4c8),{'verbose':_0x3df165['verbose']})[_0x3b74f4(0x22a)](_0x5b8e5d=>_0x5b8e5d[_0x3b74f4(0x1fa)]);for(const _0x129439 of _0x3bb84e){_0x14c902[_0x3b74f4(0x20a)](_0x129439);}const _0x9bf860=_0x330fae?[]:findJourneysToDelete(_0x3e9713,_0x85e874[_0x3b74f4(0x224)](({yamlConfig:_0x24ecec,folderPath:_0x206afc})=>({'yamlConfig':_0x24ecec,'folderPath':resolveTDFolderPath(_0x206afc,_0x4340d7,_0x57d4c8)})),_0x5cc522,_0x57d4c8,_0x4340d7),_0x59ec61=calculatePushStats(_0x4d21d2,_0x5ae990,_0x14c902,_0x44c872,_0x9bf860,!!_0x3df165['delete'],!!_0x3df165['journeysOnly']),_0x20b07f=_0x59ec61[_0x3b74f4(0x25e)][_0x3b74f4(0x265)],_0xe2a618=_0x59ec61[_0x3b74f4(0x25e)][_0x3b74f4(0x1ff)],_0x15525=_0x59ec61[_0x3b74f4(0x25e)]['unchanged'],_0x41eb6a=_0x59ec61[_0x3b74f4(0x25e)][_0x3b74f4(0x209)],_0x15a4b8=_0x59ec61[_0x3b74f4(0x266)][_0x3b74f4(0x207)],_0x1ba4c3=_0x59ec61[_0x3b74f4(0x26f)][_0x3b74f4(0x265)],_0x446e99=_0x59ec61['journeys'][_0x3b74f4(0x1ff)],_0x342ea0=_0x59ec61['journeys'][_0x3b74f4(0x230)],_0x3ad6ab=_0x59ec61[_0x3b74f4(0x26f)][_0x3b74f4(0x209)],_0x6d6c86=_0x59ec61[_0x3b74f4(0x281)]['all'],_0x37cac7=_0x59ec61[_0x3b74f4(0x281)][_0x3b74f4(0x207)],_0x2af70e=_0x59ec61[_0x3b74f4(0x281)][_0x3b74f4(0x219)],_0x21cf4e=_0x59ec61['activations'][_0x3b74f4(0x209)];console['error']('\x0aPush\x20summary\x20for\x20\x27'+_0x1b00cf+'\x27:');_0x15a4b8['length']>0x0&&console[_0x3b74f4(0x22d)]('\x20\x20'+a31_0x230a92['blue'](_0x3b74f4(0x26d)+_0x15a4b8['length']+_0x3b74f4(0x221)));if(!_0x3df165[_0x3b74f4(0x22c)]){console[_0x3b74f4(0x22d)](_0x3b74f4(0x235)),console[_0x3b74f4(0x22d)](_0x3b74f4(0x225)+a31_0x230a92[_0x3b74f4(0x249)]('+\x20'+_0x20b07f[_0x3b74f4(0x1fb)]+_0x3b74f4(0x264))),console['error'](_0x3b74f4(0x225)+a31_0x230a92[_0x3b74f4(0x248)]('~\x20'+_0xe2a618['length']+_0x3b74f4(0x239)));if(_0x41eb6a[_0x3b74f4(0x1fb)]>0x0)console[_0x3b74f4(0x22d)](_0x3b74f4(0x225)+a31_0x230a92[_0x3b74f4(0x270)]('-\x20'+_0x41eb6a['length']+'\x20to\x20delete'));else _0x44c872[_0x3b74f4(0x1fb)]>0x0&&!_0x3df165[_0x3b74f4(0x236)]&&console[_0x3b74f4(0x22d)]('\x20\x20\x20\x20'+a31_0x230a92[_0x3b74f4(0x24d)](_0x44c872[_0x3b74f4(0x1fb)]+_0x3b74f4(0x1f6)));console[_0x3b74f4(0x22d)](_0x3b74f4(0x225)+a31_0x230a92[_0x3b74f4(0x24d)]('=\x20'+_0x15525[_0x3b74f4(0x1fb)]+_0x3b74f4(0x214)));}if(_0x5ae990[_0x3b74f4(0x1fb)]>0x0||_0x9bf860['length']>0x0){console[_0x3b74f4(0x22d)]('\x20\x20πŸ—ΊοΈ\x20\x20Journeys:'),console[_0x3b74f4(0x22d)](_0x3b74f4(0x225)+a31_0x230a92[_0x3b74f4(0x249)]('+\x20'+_0x1ba4c3[_0x3b74f4(0x1fb)]+_0x3b74f4(0x264))),console[_0x3b74f4(0x22d)](_0x3b74f4(0x225)+a31_0x230a92[_0x3b74f4(0x248)]('~\x20'+_0x446e99[_0x3b74f4(0x1fb)]+_0x3b74f4(0x239)));if(_0x3ad6ab[_0x3b74f4(0x1fb)]>0x0)console['error'](_0x3b74f4(0x225)+a31_0x230a92[_0x3b74f4(0x270)]('-\x20'+_0x3ad6ab[_0x3b74f4(0x1fb)]+'\x20to\x20delete'));else _0x9bf860[_0x3b74f4(0x1fb)]>0x0&&!_0x3df165[_0x3b74f4(0x236)]&&console[_0x3b74f4(0x22d)]('\x20\x20\x20\x20'+a31_0x230a92[_0x3b74f4(0x24d)](_0x9bf860[_0x3b74f4(0x1fb)]+'\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)'));console[_0x3b74f4(0x22d)](_0x3b74f4(0x225)+a31_0x230a92[_0x3b74f4(0x24d)]('=\x20'+_0x342ea0[_0x3b74f4(0x1fb)]+_0x3b74f4(0x214)));}_0x6d6c86[_0x3b74f4(0x1fb)]>0x0&&!_0x3df165[_0x3b74f4(0x22c)]&&(console[_0x3b74f4(0x22d)](''),console[_0x3b74f4(0x22d)](_0x3b74f4(0x21c)),_0x37cac7[_0x3b74f4(0x1fb)]>0x0&&console[_0x3b74f4(0x22d)]('\x20\x20\x20\x20'+a31_0x230a92[_0x3b74f4(0x249)]('+\x20'+_0x37cac7[_0x3b74f4(0x1fb)]+_0x3b74f4(0x255))),_0x2af70e[_0x3b74f4(0x1fb)]>0x0&&console[_0x3b74f4(0x22d)]('\x20\x20\x20\x20'+a31_0x230a92[_0x3b74f4(0x248)]('~\x20'+_0x2af70e[_0x3b74f4(0x1fb)]+'\x20to\x20update')),_0x21cf4e[_0x3b74f4(0x1fb)]>0x0&&console['error'](_0x3b74f4(0x225)+a31_0x230a92['red']('-\x20'+_0x21cf4e['length']+_0x3b74f4(0x233))));console['error'](_0x3b74f4(0x216)+a31_0x230a92[_0x3b74f4(0x1f8)](_0x4409db)+'\x0a');if(_0x15a4b8['length']>0x0){console[_0x3b74f4(0x22d)](_0x3b74f4(0x22f));for(const _0x328b92 of _0x15a4b8){console[_0x3b74f4(0x22d)]('\x20\x20'+a31_0x230a92[_0x3b74f4(0x1fc)]('+')+'\x20'+_0x328b92);}console['error']('');}if(_0x20b07f[_0x3b74f4(0x1fb)]>0x0&&!_0x3df165[_0x3b74f4(0x22c)])for(const _0x17c9bc of _0x20b07f){const _0x25adac=_0x17c9bc[_0x3b74f4(0x256)]?_0x17c9bc[_0x3b74f4(0x256)]+'/'+_0x17c9bc[_0x3b74f4(0x226)]['name']:_0x17c9bc[_0x3b74f4(0x226)][_0x3b74f4(0x232)],_0x2938d8=_0x17c9bc[_0x3b74f4(0x226)][_0x3b74f4(0x281)]?.[_0x3b74f4(0x1fb)]||0x0,_0x325284=_0x2938d8>0x0?a31_0x230a92[_0x3b74f4(0x24d)]('\x20['+_0x2938d8+_0x3b74f4(0x247)):'';console['error']('\x0a'+a31_0x230a92[_0x3b74f4(0x249)](_0x3b74f4(0x200))+'\x20'+_0x25adac+_0x325284),console[_0x3b74f4(0x22d)]('─'[_0x3b74f4(0x261)](0x3c)),_0x17c9bc['diff']&&console[_0x3b74f4(0x22d)](_0x17c9bc[_0x3b74f4(0x208)]),console[_0x3b74f4(0x22d)]('─'[_0x3b74f4(0x261)](0x3c));}if(_0x41eb6a[_0x3b74f4(0x1fb)]>0x0&&!_0x3df165['journeysOnly'])for(const _0x26400a of _0x41eb6a){const _0x53140b=_0x26400a[_0x3b74f4(0x257)]?_0x5cc522['get'](_0x26400a['segmentFolderId'][_0x3b74f4(0x21e)]())||'':'',_0x32e802=_0x53140b?_0x53140b+'/'+_0x26400a[_0x3b74f4(0x232)]:_0x26400a['name'],_0x4b2cb7=_0x111401[_0x3b74f4(0x1f0)](_0x26400a['id'])||[],_0x143b89=_0x4b2cb7[_0x3b74f4(0x1fb)]>0x0?a31_0x230a92[_0x3b74f4(0x24d)]('\x20['+_0x4b2cb7[_0x3b74f4(0x1fb)]+_0x3b74f4(0x247)):'';console[_0x3b74f4(0x22d)]('\x0a'+a31_0x230a92['red'](_0x3b74f4(0x205))+'\x20'+_0x32e802+_0x143b89),console[_0x3b74f4(0x22d)]('─'['repeat'](0x3c));const _0x53463e=segmentWithActivationsToYaml(_0x26400a,_0x4b2cb7,undefined,_0x5c8a1d,_0x164cbc),_0x4c9c01=segmentToYamlString(_0x53463e),_0x4d0df9=generateDiff(_0x4c9c01,'');console[_0x3b74f4(0x22d)](formatDiffWithColors(_0x4d0df9)),console['error']('─'[_0x3b74f4(0x261)](0x3c));}const _0x1460ef=_0x4d21d2[_0x3b74f4(0x1fd)](_0x4b3d1e=>!_0x4b3d1e[_0x3b74f4(0x22b)]&&_0x4b3d1e[_0x3b74f4(0x208)]);if(_0x1460ef['length']>0x0&&!_0x3df165[_0x3b74f4(0x22c)])for(const _0x2c9962 of _0x1460ef){const _0xf5a359=_0x2c9962[_0x3b74f4(0x256)]?_0x2c9962['folderPath']+'/'+_0x2c9962[_0x3b74f4(0x226)][_0x3b74f4(0x232)]:_0x2c9962['yamlConfig']['name'];console['error']('\x0a'+a31_0x230a92['yellow'](_0x3b74f4(0x25b))+'\x20'+_0xf5a359),console['error']('─'['repeat'](0x3c)),console[_0x3b74f4(0x22d)](_0x2c9962['diff']),console[_0x3b74f4(0x22d)]('─'[_0x3b74f4(0x261)](0x3c));}if(_0x1ba4c3[_0x3b74f4(0x1fb)]>0x0)for(const _0x3d5493 of _0x1ba4c3){const _0x5c547e=_0x3d5493[_0x3b74f4(0x256)]?_0x3d5493[_0x3b74f4(0x256)]+'/'+_0x3d5493[_0x3b74f4(0x226)][_0x3b74f4(0x232)]:_0x3d5493[_0x3b74f4(0x226)][_0x3b74f4(0x232)];console[_0x3b74f4(0x22d)]('\x0a'+a31_0x230a92[_0x3b74f4(0x249)](_0x3b74f4(0x217))+'\x20'+_0x5c547e),console[_0x3b74f4(0x22d)]('─'[_0x3b74f4(0x261)](0x3c)),_0x3d5493[_0x3b74f4(0x208)]&&console['error'](_0x3d5493[_0x3b74f4(0x208)]),console['error']('─'[_0x3b74f4(0x261)](0x3c));}const _0x23a717=_0x5ae990[_0x3b74f4(0x1fd)](_0x3d7e74=>!_0x3d7e74[_0x3b74f4(0x22b)]&&_0x3d7e74[_0x3b74f4(0x208)]);if(_0x23a717[_0x3b74f4(0x1fb)]>0x0)for(const _0x4a99fb of _0x23a717){const _0x7108fd=_0x4a99fb[_0x3b74f4(0x256)]?_0x4a99fb[_0x3b74f4(0x256)]+'/'+_0x4a99fb['yamlConfig'][_0x3b74f4(0x232)]:_0x4a99fb[_0x3b74f4(0x226)]['name'];console[_0x3b74f4(0x22d)]('\x0a'+a31_0x230a92['yellow']('Changes\x20to\x20journey:')+'\x20'+_0x7108fd),console[_0x3b74f4(0x22d)]('─'['repeat'](0x3c)),console['error'](_0x4a99fb[_0x3b74f4(0x208)]),console[_0x3b74f4(0x22d)]('─'[_0x3b74f4(0x261)](0x3c));}if(_0x3ad6ab['length']>0x0)for(const _0x251853 of _0x3ad6ab){const _0x256122=_0x251853[_0x3b74f4(0x240)]?_0x5cc522[_0x3b74f4(0x1f0)](_0x251853[_0x3b74f4(0x240)])||'':'',_0x1b321e=_0x256122?_0x256122+'/'+_0x251853[_0x3b74f4(0x215)]:_0x251853['journeyBundleName'];console[_0x3b74f4(0x22d)]('\x0a'+a31_0x230a92[_0x3b74f4(0x270)](_0x3b74f4(0x21f))+'\x20'+_0x1b321e),console[_0x3b74f4(0x22d)]('─'[_0x3b74f4(0x261)](0x3c)),console[_0x3b74f4(0x22d)](a31_0x230a92[_0x3b74f4(0x270)](_0x3b74f4(0x276))),console[_0x3b74f4(0x22d)]('─'['repeat'](0x3c));}if(_0x3df165[_0x3b74f4(0x250)])return console['error'](a31_0x230a92[_0x3b74f4(0x248)]('\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made')),0x0;const _0x257c22=_0x3df165[_0x3b74f4(0x22c)]?![]:_0x20b07f['length']>0x0||_0xe2a618[_0x3b74f4(0x1fb)]>0x0||_0x41eb6a[_0x3b74f4(0x1fb)]>0x0,_0x34abe4=_0x1ba4c3[_0x3b74f4(0x1fb)]>0x0||_0x446e99[_0x3b74f4(0x1fb)]>0x0||_0x3ad6ab[_0x3b74f4(0x1fb)]>0x0,_0x10f9d3=_0x3df165['journeysOnly']?![]:_0x6d6c86[_0x3b74f4(0x1fb)]>0x0,_0x14cf1e=_0x15a4b8[_0x3b74f4(0x1fb)]>0x0;if(!_0x257c22&&!_0x34abe4&&!_0x10f9d3&&!_0x14cf1e){const _0x1661af=_0x3df165[_0x3b74f4(0x22c)]?_0x3b74f4(0x234):_0x3b74f4(0x212);console['error'](a31_0x230a92['green'](_0x1661af));if(_0x330fae&&_0x342ea0[_0x3b74f4(0x1fb)]===0x1){const _0x356f1c=_0x342ea0[0x0];if(_0x356f1c[_0x3b74f4(0x1f1)]?.['id']){const _0x49120e=getConsoleNextUrl(_0x3df165['site'],_0x3b74f4(0x222)+_0x1c962d+'/e/'+_0x356f1c[_0x3b74f4(0x1f1)]['id']+'/j/da/je');console['error']('\x20\x20'+a31_0x230a92[_0x3b74f4(0x1f8)](_0x49120e));}}return 0x0;}const _0x34e980=_0x3df165['journeysOnly']?_0x1ba4c3[_0x3b74f4(0x1fb)]+_0x446e99['length']+_0x3ad6ab['length']+_0x15a4b8[_0x3b74f4(0x1fb)]:_0x20b07f[_0x3b74f4(0x1fb)]+_0xe2a618[_0x3b74f4(0x1fb)]+_0x41eb6a[_0x3b74f4(0x1fb)]+_0x1ba4c3[_0x3b74f4(0x1fb)]+_0x446e99['length']+_0x3ad6ab[_0x3b74f4(0x1fb)]+_0x15a4b8[_0x3b74f4(0x1fb)]+_0x6d6c86[_0x3b74f4(0x1fb)];if(!_0x3df165['yes']&&_0x34e980>0x0){if(!isInteractive())return console['error'](a31_0x230a92[_0x3b74f4(0x270)](_0x3b74f4(0x20f)),_0x3b74f4(0x24a)),console[_0x3b74f4(0x22d)](a31_0x230a92[_0x3b74f4(0x24d)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x2e9816=await confirmKey(_0x3b74f4(0x277)+_0x34e980+_0x3b74f4(0x279));if(!_0x2e9816)return console[_0x3b74f4(0x22d)](a31_0x230a92['yellow'](_0x3b74f4(0x227))),0x1;}const _0x2f9ea2={'withProgress':async(_0x2a58bb,_0x3b4fa2)=>{const _0x8082b5=_0x3b74f4,_0xf2d17b=await withSpinner(_0x2a58bb,_0x3b4fa2,{'verbose':_0x3df165[_0x8082b5(0x20e)]});return{'data':_0xf2d17b[_0x8082b5(0x1fa)]};},'logInfo':_0x45970d=>console[_0x3b74f4(0x22d)](a31_0x230a92['blue']('βœ”\x20'+_0x45970d)),'logSuccess':_0x3b12d4=>console[_0x3b74f4(0x22d)](a31_0x230a92[_0x3b74f4(0x249)]('βœ”\x20'+_0x3b12d4)),'logWarning':_0x53df5=>console[_0x3b74f4(0x22d)](a31_0x230a92['yellow']('⚠\x20'+_0x53df5)),'logDeleted':_0xe10cf5=>console[_0x3b74f4(0x22d)](a31_0x230a92[_0x3b74f4(0x270)]('βœ”\x20'+_0xe10cf5))},_0x132933={'segment':_0xe4524a[_0x3b74f4(0x220)],'journey':_0xe4524a['journey'],'user':_0xe4524a[_0x3b74f4(0x27f)],'connection':_0xe4524a[_0x3b74f4(0x241)]};_0x15a4b8[_0x3b74f4(0x1fb)]>0x0&&(_0x1b61de=await executePushFolders(_0x132933,_0x15a4b8,_0x1b61de,{'parentId':_0x1c962d},_0x2f9ea2));const _0x5b37b1={'rootFolderId':_0x5e248e,'folderPathToId':_0x1b61de,'folderIdToPath':_0x5cc522,'segmentNameToId':_0x54716f,'activationsBySegmentId':_0x111401,'emailToIdMap':_0x390ca2,'idToEmailMap':_0x5c8a1d,'connectionNameToIdMap':_0x2a5fba['nameToId'],'connectionIdToNameMap':_0x2a5fba['idToName'],'connectionNameToTypeMap':_0x444a0d},_0x1bc268=await executePushSegments(_0x132933,_0x3df165[_0x3b74f4(0x22c)]?[]:_0x4d21d2,_0x5b37b1,{'parentId':_0x1c962d},_0x2f9ea2),_0x3b7410=_0x1bc268[_0x3b74f4(0x237)],_0x373da7=_0x1bc268[_0x3b74f4(0x280)],_0x473d97=_0x1bc268['activations'][_0x3b74f4(0x237)],_0x454cd6=_0x1bc268['activations']['updated'],_0x8caace=_0x1bc268[_0x3b74f4(0x281)]['deleted'],_0x194937=await executePushSegmentDeletions(_0x132933,_0x3df165[_0x3b74f4(0x22c)]?[]:_0x41eb6a,_0x2f9ea2);let _0x175534=0x0,_0x31a747=0x0,_0x51c9b2=0x0;const _0x1617d5=new Map(_0x54716f);for(const [_0x52288d,_0x2df6de]of _0x1bc268['createdSegmentIds']){_0x1617d5[_0x3b74f4(0x211)](_0x52288d,_0x2df6de);}if(_0x5ae990['length']>0x0){const _0x3fd428={..._0x5b37b1,'segmentNameToId':_0x1617d5,'existingSegments':_0x307374,'activationContext':_0x55e04a},_0x1eaea4=await executePushJourneys(_0x132933,_0x5ae990,_0x3fd428,{'parentId':_0x1c962d,'rootFolderId':_0x5e248e,'verbose':_0x3df165[_0x3b74f4(0x20e)]},_0x2f9ea2);_0x175534=_0x1eaea4['created'],_0x31a747=_0x1eaea4[_0x3b74f4(0x280)];if(_0x330fae&&_0x1eaea4['results'][_0x3b74f4(0x1fb)]===0x1){const _0x541bbb=_0x1eaea4['results'][0x0];if(_0x541bbb['journeyId']){const _0x9f36be=getConsoleNextUrl(_0x3df165['site'],_0x3b74f4(0x222)+_0x1c962d+_0x3b74f4(0x21d)+_0x541bbb[_0x3b74f4(0x1f7)]+_0x3b74f4(0x26b));console[_0x3b74f4(0x22d)]('\x20\x20'+a31_0x230a92[_0x3b74f4(0x1f8)](_0x9f36be));}}}for(const _0x1a4804 of _0x3ad6ab){console[_0x3b74f4(0x22d)](a31_0x230a92[_0x3b74f4(0x248)](_0x3b74f4(0x25d)+_0x1a4804[_0x3b74f4(0x215)])),_0x51c9b2++;}const _0x2fb2e2=[];if(_0x3b7410>0x0)_0x2fb2e2[_0x3b74f4(0x20d)](_0x3b7410+_0x3b74f4(0x27d));if(_0x373da7>0x0)_0x2fb2e2[_0x3b74f4(0x20d)](_0x373da7+_0x3b74f4(0x238));if(_0x194937>0x0)_0x2fb2e2[_0x3b74f4(0x20d)](_0x194937+_0x3b74f4(0x1f3));const _0x313747=[];if(_0x175534>0x0)_0x313747[_0x3b74f4(0x20d)](_0x175534+_0x3b74f4(0x27d));if(_0x31a747>0x0)_0x313747[_0x3b74f4(0x20d)](_0x31a747+_0x3b74f4(0x238));if(_0x51c9b2>0x0)_0x313747[_0x3b74f4(0x20d)](_0x51c9b2+_0x3b74f4(0x1f3));const _0x31c755=[];if(_0x473d97>0x0)_0x31c755[_0x3b74f4(0x20d)](_0x473d97+_0x3b74f4(0x27d));if(_0x454cd6>0x0)_0x31c755[_0x3b74f4(0x20d)](_0x454cd6+_0x3b74f4(0x238));if(_0x8caace>0x0)_0x31c755[_0x3b74f4(0x20d)](_0x8caace+_0x3b74f4(0x1f3));return console[_0x3b74f4(0x22d)](a31_0x230a92[_0x3b74f4(0x249)]('\x0aβœ”\x20Push\x20complete')),_0x2fb2e2[_0x3b74f4(0x1fb)]>0x0&&!_0x3df165[_0x3b74f4(0x22c)]&&console['error'](_0x3b74f4(0x228)+_0x2fb2e2[_0x3b74f4(0x27c)](',\x20')),_0x313747[_0x3b74f4(0x1fb)]>0x0&&console['error'](_0x3b74f4(0x244)+_0x313747[_0x3b74f4(0x27c)](',\x20')),_0x31c755[_0x3b74f4(0x1fb)]>0x0&&!_0x3df165[_0x3b74f4(0x22c)]&&console[_0x3b74f4(0x22d)](_0x3b74f4(0x25c)+_0x31c755[_0x3b74f4(0x27c)](',\x20')),0x0;}}