@treasuredata/tdx 0.19.1 → 0.20.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 (182) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.js +1 -1
  5. package/dist/commands/activations.js +1 -1
  6. package/dist/commands/agent-command.js +1 -1
  7. package/dist/commands/agent-test-command.js +1 -1
  8. package/dist/commands/api-command.js +1 -1
  9. package/dist/commands/auth-command.js +1 -1
  10. package/dist/commands/chat-command.js +1 -1
  11. package/dist/commands/claude-command.js +1 -1
  12. package/dist/commands/claude-statusline-command.js +1 -1
  13. package/dist/commands/claude-usage-command.js +1 -1
  14. package/dist/commands/command.js +1 -1
  15. package/dist/commands/connection-command.js +1 -1
  16. package/dist/commands/databases.js +1 -1
  17. package/dist/commands/describe.js +1 -1
  18. package/dist/commands/engage-command.js +1 -1
  19. package/dist/commands/job-command.js +1 -1
  20. package/dist/commands/journey-command.js +1 -1
  21. package/dist/commands/journey-validate-command.js +1 -1
  22. package/dist/commands/llm-command.js +1 -1
  23. package/dist/commands/llm-proxy.js +1 -1
  24. package/dist/commands/mcp-command.js +1 -1
  25. package/dist/commands/parent-segment-command.js +1 -1
  26. package/dist/commands/profile-command.js +1 -1
  27. package/dist/commands/profiles-command.js +1 -1
  28. package/dist/commands/query-command.js +1 -1
  29. package/dist/commands/schedule-command.js +1 -1
  30. package/dist/commands/segment-command.js +1 -1
  31. package/dist/commands/segment-create-command.js +1 -1
  32. package/dist/commands/segment-fields-command.js +1 -1
  33. package/dist/commands/segment-pull-command.js +1 -1
  34. package/dist/commands/segment-push-command.js +1 -1
  35. package/dist/commands/segment-update-command.js +1 -1
  36. package/dist/commands/segment-use-command.js +1 -1
  37. package/dist/commands/segment-validate-command.js +1 -1
  38. package/dist/commands/segments.js +1 -1
  39. package/dist/commands/show.js +1 -1
  40. package/dist/commands/status-command.d.ts.map +1 -1
  41. package/dist/commands/status-command.js +1 -1
  42. package/dist/commands/status-command.js.map +1 -1
  43. package/dist/commands/tables.js +1 -1
  44. package/dist/commands/unset-command.js +1 -1
  45. package/dist/commands/use-command.js +1 -1
  46. package/dist/commands/user-command.js +1 -1
  47. package/dist/commands/workflow-command.js +1 -1
  48. package/dist/core/auth.d.ts +2 -2
  49. package/dist/core/auth.d.ts.map +1 -1
  50. package/dist/core/auth.js +1 -1
  51. package/dist/core/auth.js.map +1 -1
  52. package/dist/core/command-output.js +1 -1
  53. package/dist/core/config.d.ts +12 -20
  54. package/dist/core/config.d.ts.map +1 -1
  55. package/dist/core/config.js +1 -1
  56. package/dist/core/config.js.map +1 -1
  57. package/dist/core/connection-cache.js +1 -1
  58. package/dist/core/constants.js +1 -1
  59. package/dist/core/credential-cache.js +1 -1
  60. package/dist/core/global-context.d.ts +3 -0
  61. package/dist/core/global-context.d.ts.map +1 -1
  62. package/dist/core/global-context.js +1 -1
  63. package/dist/core/global-context.js.map +1 -1
  64. package/dist/core/keychain.js +1 -1
  65. package/dist/core/profile.js +1 -1
  66. package/dist/core/project-config.js +1 -1
  67. package/dist/core/session.js +1 -1
  68. package/dist/core/user-cache.js +1 -1
  69. package/dist/core/version.js +1 -1
  70. package/dist/index.js +1 -1
  71. package/dist/mcp/server.js +1 -1
  72. package/dist/mcp/tools/index.js +1 -1
  73. package/dist/mcp/tools/tdx-run.js +1 -1
  74. package/dist/mcp/tools/tdx-search.js +1 -1
  75. package/dist/mcp/utils.js +1 -1
  76. package/dist/proxy/anthropic-adapter.js +1 -1
  77. package/dist/proxy/claude-usage-tracker.js +1 -1
  78. package/dist/proxy/context-signature.js +1 -1
  79. package/dist/proxy/conversation-utils.js +1 -1
  80. package/dist/proxy/passthrough-server.js +1 -1
  81. package/dist/proxy/server.js +1 -1
  82. package/dist/proxy/session-cache.js +1 -1
  83. package/dist/proxy/sse-usage-parser.js +1 -1
  84. package/dist/sdk/agent/agent-config.js +1 -1
  85. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  86. package/dist/sdk/agent/agent-yaml.js +1 -1
  87. package/dist/sdk/agent/test/evaluator.js +1 -1
  88. package/dist/sdk/agent/test/executor.js +1 -1
  89. package/dist/sdk/agent/test/index.js +1 -1
  90. package/dist/sdk/agent/test/output.js +1 -1
  91. package/dist/sdk/agent/test/parser.js +1 -1
  92. package/dist/sdk/api.js +1 -1
  93. package/dist/sdk/client/cdp-api-client.js +1 -1
  94. package/dist/sdk/client/endpoints.js +1 -1
  95. package/dist/sdk/client/engage-api-client.js +1 -1
  96. package/dist/sdk/client/http-client.js +1 -1
  97. package/dist/sdk/client/llm-api-client.js +1 -1
  98. package/dist/sdk/client/rate-limiter.js +1 -1
  99. package/dist/sdk/client/td-api-client.js +1 -1
  100. package/dist/sdk/client/trino-api-client.js +1 -1
  101. package/dist/sdk/client/workflow-client.js +1 -1
  102. package/dist/sdk/connection-validator.js +1 -1
  103. package/dist/sdk/connection.js +1 -1
  104. package/dist/sdk/engage.js +1 -1
  105. package/dist/sdk/errors.js +1 -1
  106. package/dist/sdk/index.js +1 -1
  107. package/dist/sdk/index.js.map +1 -1
  108. package/dist/sdk/io/index.js +1 -1
  109. package/dist/sdk/io/node-filesystem.js +1 -1
  110. package/dist/sdk/job.js +1 -1
  111. package/dist/sdk/journey.js +1 -1
  112. package/dist/sdk/llm/chat-cache.js +1 -1
  113. package/dist/sdk/llm/index.js +1 -1
  114. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  115. package/dist/sdk/llm/model-aliases.js +1 -1
  116. package/dist/sdk/llm/model-factors.js +1 -1
  117. package/dist/sdk/query/index.js +1 -1
  118. package/dist/sdk/query/sql-parser.js +1 -1
  119. package/dist/sdk/schedule.js +1 -1
  120. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  121. package/dist/sdk/segment/fields-display.js +1 -1
  122. package/dist/sdk/segment/file-discovery.js +1 -1
  123. package/dist/sdk/segment/journey-utils.js +1 -1
  124. package/dist/sdk/segment/journey-yaml.js +1 -1
  125. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  126. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  127. package/dist/sdk/segment/pull-workflow.js +1 -1
  128. package/dist/sdk/segment/push-workflow.js +1 -1
  129. package/dist/sdk/segment/resolution-context.js +1 -1
  130. package/dist/sdk/segment/segment-path-parser.js +1 -1
  131. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  132. package/dist/sdk/segment/target-resolution.js +1 -1
  133. package/dist/sdk/segment/tdx-config.js +1 -1
  134. package/dist/sdk/segment/validate-files.js +1 -1
  135. package/dist/sdk/segment/yaml-validator.js +1 -1
  136. package/dist/sdk/segment.js +1 -1
  137. package/dist/sdk/types/index.js +1 -1
  138. package/dist/sdk/types/progress.js +1 -1
  139. package/dist/sdk/user.js +1 -1
  140. package/dist/sdk/util/format-detector.js +1 -1
  141. package/dist/sdk/util/formatters.js +1 -1
  142. package/dist/sdk/util/index.js +1 -1
  143. package/dist/sdk/util/tree-formatter.js +1 -1
  144. package/dist/sdk/workflow/archive-validation.js +1 -1
  145. package/dist/sdk/workflow/clone-workflow.js +1 -1
  146. package/dist/sdk/workflow/index.js +1 -1
  147. package/dist/sdk/workflow/pull-workflow.js +1 -1
  148. package/dist/sdk/workflow/push-workflow.js +1 -1
  149. package/dist/sdk/workflow/tdx-config.js +1 -1
  150. package/dist/sdk/workflow/workflow-utils.js +1 -1
  151. package/dist/test-utils/command-runner.js +1 -1
  152. package/dist/test-utils/factories.js +1 -1
  153. package/dist/test-utils/fixtures.js +1 -1
  154. package/dist/test-utils/http-mock.js +1 -1
  155. package/dist/test-utils/index.js +1 -1
  156. package/dist/utils/async.js +1 -1
  157. package/dist/utils/colors.js +1 -1
  158. package/dist/utils/diff.js +1 -1
  159. package/dist/utils/file-permissions.js +1 -1
  160. package/dist/utils/global-cache.js +1 -1
  161. package/dist/utils/json-loader.js +1 -1
  162. package/dist/utils/local-cache.js +1 -1
  163. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  164. package/dist/utils/logger/formatters/index.js +1 -1
  165. package/dist/utils/logger/handlers/console-handler.js +1 -1
  166. package/dist/utils/logger/handlers/file-handler.js +1 -1
  167. package/dist/utils/logger/handlers/index.js +1 -1
  168. package/dist/utils/logger/handlers/null-handler.js +1 -1
  169. package/dist/utils/logger/index.js +1 -1
  170. package/dist/utils/logger/logger.js +1 -1
  171. package/dist/utils/logger/types.js +1 -1
  172. package/dist/utils/option-validation.js +1 -1
  173. package/dist/utils/port.js +1 -1
  174. package/dist/utils/process.js +1 -1
  175. package/dist/utils/prompt.js +1 -1
  176. package/dist/utils/spinner.js +1 -1
  177. package/dist/utils/sse-parser.js +1 -1
  178. package/dist/utils/string-utils.js +1 -1
  179. package/dist/utils/table-ref-parser.js +1 -1
  180. package/dist/utils/tdx-logger.js +1 -1
  181. package/dist/utils/version-check.js +1 -1
  182. package/package.json +1 -1
@@ -1 +1 @@
1
- const a27_0x5d80d7=a27_0x28cd;(function(_0x2b743e,_0x176fa2){const _0xf1ce80=a27_0x28cd,_0x2d2c1f=_0x2b743e();while(!![]){try{const _0x3a69da=-parseInt(_0xf1ce80(0xc7))/0x1+-parseInt(_0xf1ce80(0xb3))/0x2*(-parseInt(_0xf1ce80(0xb9))/0x3)+-parseInt(_0xf1ce80(0x10d))/0x4*(-parseInt(_0xf1ce80(0xf9))/0x5)+parseInt(_0xf1ce80(0x10c))/0x6*(-parseInt(_0xf1ce80(0xcf))/0x7)+parseInt(_0xf1ce80(0xe1))/0x8+parseInt(_0xf1ce80(0xc6))/0x9*(parseInt(_0xf1ce80(0xd3))/0xa)+-parseInt(_0xf1ce80(0xf6))/0xb*(parseInt(_0xf1ce80(0xf8))/0xc);if(_0x3a69da===_0x176fa2)break;else _0x2d2c1f['push'](_0x2d2c1f['shift']());}catch(_0x386dfd){_0x2d2c1f['push'](_0x2d2c1f['shift']());}}}(a27_0x33a7,0xeb81e));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput,writeOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{confirm}from'../utils/prompt.js';import{readFileSync}from'fs';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{hyperlink}from'../sdk/util/formatters.js';import a27_0x1ff090 from'chalk';function formatRelativeTime(_0x38f89b){const _0x545f31=a27_0x28cd,_0x187c7f=new Date(_0x38f89b),_0x218a90=new Date(),_0x144b21=_0x187c7f[_0x545f31(0xae)]()-_0x218a90['getTime'](),_0x28e3b4=Math[_0x545f31(0x135)](_0x144b21)/0x3e8,_0x17f195=_0x144b21<0x0;if(_0x28e3b4<0x3c)return _0x17f195?_0x545f31(0x105):_0x545f31(0x101);else{if(_0x28e3b4<0xe10){const _0x41248c=Math['round'](_0x28e3b4/0x3c);return _0x17f195?_0x41248c+_0x545f31(0x118):_0x545f31(0xe9)+_0x41248c+'m';}else{if(_0x28e3b4<0x15180){const _0x38550a=Math[_0x545f31(0x115)](_0x28e3b4/0xe10);return _0x17f195?_0x38550a+_0x545f31(0x11e):_0x545f31(0xe9)+_0x38550a+'h';}else{if(_0x28e3b4<0x93a80){const _0x289672=Math[_0x545f31(0x115)](_0x28e3b4/0x15180);return _0x17f195?_0x289672+_0x545f31(0xe7):'in\x20'+_0x289672+'d';}else return _0x187c7f[_0x545f31(0xb2)]();}}}}function a27_0x28cd(_0x45156f,_0x42d08d){_0x45156f=_0x45156f-0xa5;const _0x33a7ee=a27_0x33a7();let _0x28cd46=_0x33a7ee[_0x45156f];return _0x28cd46;}export class ScheduleListCommand extends BaseCommand{['name']=a27_0x5d80d7(0x11d);[a27_0x5d80d7(0xde)]='List\x20scheduled\x20queries';async[a27_0x5d80d7(0x104)](_0x4713cc){const _0x1b1835=a27_0x5d80d7,{options:_0x39fa71,args:_0x20f5b4,tdx:_0x2b80a7}=_0x4713cc,_0x28050f=resolveLimit(_0x39fa71[_0x1b1835(0x138)],DEFAULT_DISPLAY_LIMIT),_0x4ff7ca=_0x20f5b4[0x0],_0x2f183b=_0x4ff7ca?_0x1b1835(0x133)+_0x4ff7ca+'\x22...':_0x1b1835(0xf2),_0x13a70e=await withSpinner(_0x2f183b,()=>_0x2b80a7[_0x1b1835(0xdb)]['listQueries']({'limit':_0x28050f,'scheduled':!![],'pattern':_0x4ff7ca}),{'verbose':_0x39fa71[_0x1b1835(0xda)]}),_0x187567=_0x13a70e[_0x1b1835(0xf0)]['queries'],_0xc344=_0x13a70e[_0x1b1835(0xf0)][_0x1b1835(0x114)][_0x1b1835(0xc8)],_0x3749c5=_0x4ff7ca?'\x20matching\x20\x22'+_0x4ff7ca+'\x22':'';_0xc344?console[_0x1b1835(0xeb)](_0x1b1835(0xb7)+_0x187567[_0x1b1835(0x112)]+'\x20schedules'+_0x3749c5+_0x1b1835(0xd4)):console['error'](_0x1b1835(0xc5)+_0x187567[_0x1b1835(0x112)]+_0x1b1835(0xbf)+(_0x187567[_0x1b1835(0x112)]!==0x1?_0x1b1835(0xb0):'y')+_0x3749c5);if(_0x39fa71[_0x1b1835(0xce)]==='json'||_0x39fa71['format']===_0x1b1835(0xcb)||_0x39fa71[_0x1b1835(0xce)]===_0x1b1835(0xec)||_0x39fa71[_0x1b1835(0xce)]===_0x1b1835(0x11a)){const _0x3d3d2b=_0x187567[_0x1b1835(0xa8)](_0x515cba=>({'id':_0x515cba['id'],'name':_0x515cba[_0x1b1835(0x11c)],'cron':_0x515cba[_0x1b1835(0xe8)],'database':_0x515cba['database']?.['name'],'type':_0x515cba['type'],'timezone':_0x515cba[_0x1b1835(0xea)],'user_name':_0x515cba[_0x1b1835(0x131)]?.[_0x1b1835(0x11c)],'updated_at':_0x515cba['updated_at'],'next_run_at':_0x515cba['next_run_at'],'last_job_status':_0x515cba[_0x1b1835(0x11f)]?.[_0x1b1835(0xfc)]}));await handleSDKOutput(_0x3d3d2b,_0x39fa71);}else{if(_0x187567[_0x1b1835(0x112)]===0x0)console['log'](_0x1b1835(0xf1));else{const _0x43a29d=_0x39fa71[_0x1b1835(0xee)],_0x3793f4=_0x187567[_0x1b1835(0xa8)](_0x187167=>{const _0x1ae324=_0x1b1835,_0x151a72=_0x187167['last_job']?.[_0x1ae324(0xfc)]?_0x187167['last_job'][_0x1ae324(0xfc)]==='success'?'✓':'✗':'-',_0x36f8e9=_0x187167[_0x1ae324(0x11f)]?.[_0x1ae324(0xef)]?formatRelativeTime(_0x187167[_0x1ae324(0x11f)]['ended_at']):_0x1ae324(0xe5),_0x4c4cb0=_0x187167[_0x1ae324(0xcd)]?formatRelativeTime(_0x187167[_0x1ae324(0xcd)]):'-',_0x3a2a16=_0x187167[_0x1ae324(0xe8)]||'',_0x3b7294=_0x187167[_0x1ae324(0x11c)]||_0x1ae324(0x122),_0xcddbd8=getConsoleUrl(_0x43a29d,'/app/queries/editor?queryId='+_0x187167['id']);return{'statusIcon':_0x151a72,'lastRun':_0x36f8e9,'nextRun':_0x4c4cb0,'cron':_0x3a2a16,'name':_0x3b7294,'queryUrl':_0xcddbd8,'status':_0x187167[_0x1ae324(0x11f)]?.[_0x1ae324(0xfc)]};}),_0x982182=Math[_0x1b1835(0x111)](..._0x3793f4[_0x1b1835(0xa8)](_0x5d9149=>_0x5d9149[_0x1b1835(0x119)]['length'])),_0x570284=Math[_0x1b1835(0x111)](..._0x3793f4[_0x1b1835(0xa8)](_0x5df45e=>_0x5df45e[_0x1b1835(0xba)]['length'])),_0x2f5dff=Math[_0x1b1835(0x111)](..._0x3793f4['map'](_0x19aded=>_0x19aded[_0x1b1835(0xe8)][_0x1b1835(0x112)])),_0xf700a6=_0x3793f4[_0x1b1835(0xa8)](_0x54b840=>{const _0x42acbe=_0x1b1835,_0x49e4c6=_0x54b840['status']===_0x42acbe(0xd1)?a27_0x1ff090[_0x42acbe(0x12c)](_0x54b840['statusIcon']):_0x54b840[_0x42acbe(0xfc)]==='error'?a27_0x1ff090['red'](_0x54b840[_0x42acbe(0xfb)]):a27_0x1ff090[_0x42acbe(0xf3)](_0x54b840[_0x42acbe(0xfb)]),_0x497867=_0x54b840[_0x42acbe(0x119)]['padEnd'](_0x982182),_0x472bce=_0x54b840[_0x42acbe(0xba)]['padEnd'](_0x570284),_0x558699=_0x54b840['cron']?a27_0x1ff090[_0x42acbe(0xaa)](_0x54b840[_0x42acbe(0xe8)][_0x42acbe(0x103)](_0x2f5dff)):'\x20'[_0x42acbe(0xfa)](_0x2f5dff),_0x2b09b6=hyperlink(_0x54b840[_0x42acbe(0x11c)],_0x54b840['queryUrl']);return _0x42acbe(0x134)+_0x49e4c6+'\x20'+_0x497867+_0x42acbe(0xd6)+_0x472bce+'\x20\x20'+_0x558699+'\x20\x20'+_0x2b09b6;});await writeOutput(_0xf700a6['join']('\x0a'),_0x39fa71[_0x1b1835(0xb5)],'list');}}return 0x0;}}export class ScheduleShowCommand extends BaseCommand{[a27_0x5d80d7(0x11c)]=a27_0x5d80d7(0xc3);[a27_0x5d80d7(0xde)]=a27_0x5d80d7(0xb6);[a27_0x5d80d7(0x128)](_0x3f73cd){const _0x4ba627=a27_0x5d80d7,_0x17cc06=_0x3f73cd[_0x4ba627(0x11b)][0x0];if(!_0x17cc06)return _0x4ba627(0xdd);return undefined;}async[a27_0x5d80d7(0x104)](_0x161a98){const _0x4e84fb=a27_0x5d80d7,{options:_0x4bb660,args:_0x2f0529,tdx:_0x360772}=_0x161a98,_0x5d6521=_0x2f0529[0x0],_0x4de2ac=await withSpinner(_0x4e84fb(0x125),()=>_0x360772[_0x4e84fb(0xdb)][_0x4e84fb(0xcc)](_0x5d6521),{'verbose':_0x4bb660[_0x4e84fb(0xda)]}),_0x2ee522=_0x4de2ac['data'],_0x234042={'name':_0x2ee522['name'],'cron':_0x2ee522['cron'],'database':_0x2ee522['database'],'type':_0x2ee522[_0x4e84fb(0xd8)],'timezone':_0x2ee522[_0x4e84fb(0x10f)],'user_name':_0x2ee522['user_name'],'created_at':_0x2ee522[_0x4e84fb(0xdf)],'engine_version':_0x2ee522[_0x4e84fb(0xf7)],'executing_user_id':_0x2ee522['executing_user_id'],'query':_0x2ee522[_0x4e84fb(0x12a)],'delay':_0x2ee522[_0x4e84fb(0xab)],'priority':_0x2ee522['priority'],'retry_limit':_0x2ee522['retry_limit'],..._0x2ee522[_0x4e84fb(0x123)]&&{'result':_0x2ee522['result']}};return await handleSingleObjectOutput(_0x234042,_0x4bb660),0x0;}}export class ScheduleCreateCommand extends BaseCommand{[a27_0x5d80d7(0x11c)]=a27_0x5d80d7(0xe6);[a27_0x5d80d7(0xde)]=a27_0x5d80d7(0xaf);['validate'](_0x35817b){const _0x4c03c6=a27_0x5d80d7,_0x39cc4e=_0x35817b['args'][0x0];if(!_0x39cc4e)return _0x4c03c6(0x106);return undefined;}async[a27_0x5d80d7(0x104)](_0x5ac02a){const _0x1749c9=a27_0x5d80d7,{options:_0x16b336,args:_0x866cd7,tdx:_0x2a1ab7}=_0x5ac02a,_0x5929ff=_0x866cd7[0x0],_0x54185d=_0x16b336,_0x1c2b31=_0x54185d[_0x1749c9(0xf4)],_0xc56ffc=_0x54185d[_0x1749c9(0x136)],_0x33986a=_0x54185d[_0x1749c9(0xd8)]||_0x1749c9(0xb4);let _0x43b79f;try{_0x43b79f=readFileSync(_0xc56ffc,_0x1749c9(0x130))[_0x1749c9(0xc2)]();}catch(_0x456278){throw new SDKError(ErrorCode[_0x1749c9(0x127)],_0x1749c9(0x132)+_0xc56ffc,_0x456278 instanceof Error?_0x456278:undefined);}if(!_0x43b79f)throw new SDKError(ErrorCode[_0x1749c9(0x127)],_0x1749c9(0xd2));const _0x2c447d={'database':_0x1c2b31,'query':_0x43b79f,'type':_0x33986a};if(_0x54185d[_0x1749c9(0xe8)])_0x2c447d[_0x1749c9(0xe8)]=_0x54185d[_0x1749c9(0xe8)];if(_0x54185d[_0x1749c9(0x10f)])_0x2c447d[_0x1749c9(0x10f)]=_0x54185d['timezone'];if(_0x54185d[_0x1749c9(0xab)]!==undefined)_0x2c447d['delay']=Number(_0x54185d['delay']);if(_0x54185d[_0x1749c9(0xbb)]!==undefined)_0x2c447d[_0x1749c9(0xbb)]=Number(_0x54185d[_0x1749c9(0xbb)]);if(_0x54185d[_0x1749c9(0xfe)]!==undefined)_0x2c447d[_0x1749c9(0xb8)]=Number(_0x54185d[_0x1749c9(0xfe)]);if(_0x54185d[_0x1749c9(0xe2)])_0x2c447d['engine_version']=_0x54185d['engineVersion'];if(_0x54185d['result'])_0x2c447d['result']=_0x54185d[_0x1749c9(0x123)];if(_0x16b336[_0x1749c9(0xda)]){console[_0x1749c9(0xeb)]('Creating\x20schedule:\x20'+_0x5929ff),console[_0x1749c9(0xeb)](_0x1749c9(0x107)+_0x1c2b31),console[_0x1749c9(0xeb)]('\x20\x20Type:\x20'+_0x33986a);if(_0x2c447d['cron'])console[_0x1749c9(0xeb)](_0x1749c9(0xac)+_0x2c447d[_0x1749c9(0xe8)]);if(_0x2c447d[_0x1749c9(0x10f)])console[_0x1749c9(0xeb)]('\x20\x20Timezone:\x20'+_0x2c447d[_0x1749c9(0x10f)]);}const _0x242b8a=await withSpinner(_0x1749c9(0xd7),()=>_0x2a1ab7[_0x1749c9(0xdb)][_0x1749c9(0xd9)](_0x5929ff,_0x2c447d),{'verbose':_0x16b336[_0x1749c9(0xda)]});return console[_0x1749c9(0xeb)](_0x1749c9(0x12f)+_0x242b8a['data'][_0x1749c9(0x11c)]),await handleSingleObjectOutput(_0x242b8a[_0x1749c9(0xf0)],_0x16b336),0x0;}}function a27_0x33a7(){const _0x5cbb13=['site','ended_at','data','No\x20scheduled\x20queries\x20found','Listing\x20scheduled\x20queries...','dim','database','run','2629itbFZU','engine_version','70788jOvJtb','52805daJxbt','repeat','statusIcon','status','\x20\x20Time:\x20','retryLimit','schedule:history','Deleting\x20schedule...','soon','\x20(showing\x20','padEnd','execute','just\x20now','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20create\x20<name>\x20-d\x20<db>\x20--file\x20<path>\x20[options]','\x20\x20Database:\x20','from','scheduled_at','At\x20least\x20one\x20option\x20must\x20be\x20provided\x20to\x20update','Updating\x20schedule...','6648402rbcBJQ','364hJqGdC','Update\x20a\x20scheduled\x20query','timezone','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20update\x20<name>\x20[options]','max','length','substring','pagination','round','Delete\x20a\x20scheduled\x20query','update','m\x20ago','lastRun','tsv','args','name','schedule:list','h\x20ago','last_job','Updating\x20schedule:\x20','\x20execution','(unnamed)','result','schedule:update','Getting\x20schedule\x20details...','Running\x20schedule...','INVALID_ARGUMENT','validate','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20history\x20<name>\x20[--from\x20<n>]\x20[--to\x20<n>]','query','Schedule\x20updated:\x20','green','schedule:run','jobs','Schedule\x20created:\x20','utf-8','user','Failed\x20to\x20read\x20file:\x20','Searching\x20scheduled\x20queries\x20matching\x20\x22','📅\x20','abs','file','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20schedule\x20\x22','limit','yes','job_id','Getting\x20schedule\x20history...','map','keys','cyan','delay','\x20\x20Cron:\x20','Schedule\x20deleted:\x20','getTime','Create\x20a\x20scheduled\x20query','ies','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20run\x20<name>\x20[--time\x20<iso8601>]\x20[--num\x20<1-10>]','toLocaleDateString','4QdMxEc','trino','output','Show\x20schedule\x20details','Showing\x20first\x20','retry_limit','2100921TqBmyY','nextRun','priority','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20delete\x20<name>','Schedule\x20run\x20submitted:\x20','num','\x20scheduled\x20quer','count','end_at','trim','schedule:show','time','Found\x20','927aMYsDe','818342xNmNNO','has_next_page','Run\x20a\x20scheduled\x20query\x20immediately','Cancelled','jsonl','show','next_run_at','format','7pysWys','\x20created','success','Query\x20file\x20is\x20empty','43910VrDwrE','\x20(use\x20--limit\x20to\x20see\x20more)','...','\x20\x20→\x20','Creating\x20schedule...','type','create','verbose','schedules','\x20job','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20show\x20<name>','description','created_at','delete','11895760zcxJfd','engineVersion','start_at','Show\x20schedule\x20execution\x20history','never','schedule:create','d\x20ago','cron','in\x20','time_zone','error','table','history'];a27_0x33a7=function(){return _0x5cbb13;};return a27_0x33a7();}export class ScheduleUpdateCommand extends BaseCommand{[a27_0x5d80d7(0x11c)]=a27_0x5d80d7(0x124);[a27_0x5d80d7(0xde)]=a27_0x5d80d7(0x10e);[a27_0x5d80d7(0x128)](_0x4a8baa){const _0x295254=a27_0x5d80d7,_0x1f12f3=_0x4a8baa[_0x295254(0x11b)][0x0];if(!_0x1f12f3)return _0x295254(0x110);return undefined;}async[a27_0x5d80d7(0x104)](_0x254880){const _0x25b6f6=a27_0x5d80d7,{options:_0x4ebc5e,args:_0x15c907,tdx:_0x34eb7d}=_0x254880,_0x567235=_0x15c907[0x0],_0x15193f=_0x4ebc5e,_0x3fed0a={};if(_0x15193f[_0x25b6f6(0xf4)])_0x3fed0a[_0x25b6f6(0xf4)]=_0x15193f[_0x25b6f6(0xf4)];if(_0x15193f[_0x25b6f6(0xd8)])_0x3fed0a[_0x25b6f6(0xd8)]=_0x15193f[_0x25b6f6(0xd8)];if(_0x15193f[_0x25b6f6(0xe8)])_0x3fed0a[_0x25b6f6(0xe8)]=_0x15193f[_0x25b6f6(0xe8)];if(_0x15193f[_0x25b6f6(0x10f)])_0x3fed0a[_0x25b6f6(0x10f)]=_0x15193f[_0x25b6f6(0x10f)];if(_0x15193f[_0x25b6f6(0xab)]!==undefined)_0x3fed0a[_0x25b6f6(0xab)]=Number(_0x15193f[_0x25b6f6(0xab)]);if(_0x15193f[_0x25b6f6(0xbb)]!==undefined)_0x3fed0a[_0x25b6f6(0xbb)]=Number(_0x15193f[_0x25b6f6(0xbb)]);if(_0x15193f[_0x25b6f6(0xfe)]!==undefined)_0x3fed0a[_0x25b6f6(0xb8)]=Number(_0x15193f[_0x25b6f6(0xfe)]);if(_0x15193f[_0x25b6f6(0xe2)])_0x3fed0a[_0x25b6f6(0xf7)]=_0x15193f[_0x25b6f6(0xe2)];if(_0x15193f[_0x25b6f6(0x123)])_0x3fed0a[_0x25b6f6(0x123)]=_0x15193f[_0x25b6f6(0x123)];if(_0x15193f[_0x25b6f6(0x136)])try{_0x3fed0a[_0x25b6f6(0x12a)]=readFileSync(_0x15193f['file'],_0x25b6f6(0x130))[_0x25b6f6(0xc2)]();}catch(_0x5a5aba){throw new SDKError(ErrorCode[_0x25b6f6(0x127)],_0x25b6f6(0x132)+_0x15193f[_0x25b6f6(0x136)],_0x5a5aba instanceof Error?_0x5a5aba:undefined);}if(Object[_0x25b6f6(0xa9)](_0x3fed0a)[_0x25b6f6(0x112)]===0x0)throw new SDKError(ErrorCode[_0x25b6f6(0x127)],_0x25b6f6(0x10a));if(_0x4ebc5e['verbose']){console[_0x25b6f6(0xeb)](_0x25b6f6(0x120)+_0x567235);for(const [_0x14272c,_0x379833]of Object['entries'](_0x3fed0a)){_0x14272c===_0x25b6f6(0x12a)?console['error']('\x20\x20'+_0x14272c+':\x20'+_0x379833[_0x25b6f6(0x113)](0x0,0x32)+_0x25b6f6(0xd5)):console['error']('\x20\x20'+_0x14272c+':\x20'+_0x379833);}}const _0xd4cf26=await withSpinner(_0x25b6f6(0x10b),()=>_0x34eb7d[_0x25b6f6(0xdb)][_0x25b6f6(0x117)](_0x567235,_0x3fed0a),{'verbose':_0x4ebc5e[_0x25b6f6(0xda)]});return console[_0x25b6f6(0xeb)](_0x25b6f6(0x12b)+_0xd4cf26['data'][_0x25b6f6(0x11c)]),await handleSingleObjectOutput(_0xd4cf26[_0x25b6f6(0xf0)],_0x4ebc5e),0x0;}}export class ScheduleDeleteCommand extends BaseCommand{[a27_0x5d80d7(0x11c)]='schedule:delete';[a27_0x5d80d7(0xde)]=a27_0x5d80d7(0x116);[a27_0x5d80d7(0x128)](_0x23e144){const _0x1c0f4b=a27_0x5d80d7,_0x44e5f2=_0x23e144['args'][0x0];if(!_0x44e5f2)return _0x1c0f4b(0xbc);return undefined;}async['execute'](_0xd0de46){const _0x341cae=a27_0x5d80d7,{options:_0x4a347d,args:_0x467879,tdx:_0xa32a50}=_0xd0de46,_0x142712=_0x467879[0x0];if(!_0x4a347d[_0x341cae(0xa5)]){const _0xd8bea4=await confirm(_0x341cae(0x137)+_0x142712+'\x22?');if(!_0xd8bea4)return console[_0x341cae(0xeb)](_0x341cae(0xca)),0x0;}const _0x519198=await withSpinner(_0x341cae(0x100),()=>_0xa32a50[_0x341cae(0xdb)][_0x341cae(0xe0)](_0x142712),{'verbose':_0x4a347d[_0x341cae(0xda)]});return console[_0x341cae(0xeb)](_0x341cae(0xad)+_0x519198['data']['name']),0x0;}}export class ScheduleRunCommand extends BaseCommand{[a27_0x5d80d7(0x11c)]=a27_0x5d80d7(0x12d);[a27_0x5d80d7(0xde)]=a27_0x5d80d7(0xc9);[a27_0x5d80d7(0x128)](_0x31bbe8){const _0x58ddb0=a27_0x5d80d7,_0x5f247b=_0x31bbe8[_0x58ddb0(0x11b)][0x0];if(!_0x5f247b)return _0x58ddb0(0xb1);return undefined;}async[a27_0x5d80d7(0x104)](_0x38ffd4){const _0x33d121=a27_0x5d80d7,{options:_0x13ae01,args:_0x2e145d,tdx:_0x30873b}=_0x38ffd4,_0x378cd3=_0x2e145d[0x0],_0xabd0c7=_0x13ae01,_0xb98924=_0xabd0c7[_0x33d121(0xc4)],_0x2dd74e=_0xabd0c7[_0x33d121(0xbe)]!==undefined?Number(_0xabd0c7[_0x33d121(0xbe)]):undefined;if(_0x13ae01[_0x33d121(0xda)]){console[_0x33d121(0xeb)]('Running\x20schedule:\x20'+_0x378cd3);if(_0xb98924)console[_0x33d121(0xeb)](_0x33d121(0xfd)+_0xb98924);if(_0x2dd74e)console[_0x33d121(0xeb)]('\x20\x20Num:\x20'+_0x2dd74e);}const _0x5ba469=await withSpinner(_0x33d121(0x126),()=>_0x30873b[_0x33d121(0xdb)][_0x33d121(0xf5)](_0x378cd3,{'time':_0xb98924,'num':_0x2dd74e}),{'verbose':_0x13ae01[_0x33d121(0xda)]}),_0x17889f=_0x5ba469['data'][_0x33d121(0x12e)];console['error'](_0x33d121(0xbd)+_0x17889f[_0x33d121(0x112)]+_0x33d121(0xdc)+(_0x17889f[_0x33d121(0x112)]!==0x1?'s':'')+_0x33d121(0xd0));for(const _0x4977f6 of _0x17889f){console['error']('\x20\x20Job\x20ID:\x20'+_0x4977f6[_0x33d121(0xa6)]);}return await handleSDKOutput(_0x17889f,_0x13ae01),0x0;}}export class ScheduleHistoryCommand extends BaseCommand{[a27_0x5d80d7(0x11c)]=a27_0x5d80d7(0xff);[a27_0x5d80d7(0xde)]=a27_0x5d80d7(0xe4);['validate'](_0x2763a6){const _0x55ef58=a27_0x5d80d7,_0x542047=_0x2763a6['args'][0x0];if(!_0x542047)return _0x55ef58(0x129);return undefined;}async['execute'](_0x602fd1){const _0x386afa=a27_0x5d80d7,{options:_0x10eb6f,args:_0x472605,tdx:_0x3d0fa9}=_0x602fd1,_0x555ee8=_0x472605[0x0],_0x3b8d42=_0x10eb6f,_0x4d153c=_0x3b8d42[_0x386afa(0x108)]!==undefined?Number(_0x3b8d42['from']):undefined,_0x17a0f6=_0x3b8d42['to']!==undefined?Number(_0x3b8d42['to']):undefined,_0x39ec71=await withSpinner(_0x386afa(0xa7),()=>_0x3d0fa9['schedules'][_0x386afa(0xed)](_0x555ee8,{'from':_0x4d153c,'to':_0x17a0f6}),{'verbose':_0x10eb6f[_0x386afa(0xda)]}),_0x966b46=_0x39ec71[_0x386afa(0xf0)];console['error'](_0x386afa(0xc5)+_0x966b46[_0x386afa(0xc0)]+_0x386afa(0x121)+(_0x966b46[_0x386afa(0xc0)]!==0x1?'s':'')+_0x386afa(0x102)+_0x966b46[_0x386afa(0x108)]+'-'+_0x966b46['to']+')');const _0x4d93f6=_0x966b46[_0x386afa(0xed)][_0x386afa(0xa8)](_0x365ef3=>({'job_id':_0x365ef3['job_id'],'type':_0x365ef3[_0x386afa(0xd8)],'status':_0x365ef3['status'],'scheduled_at':_0x365ef3[_0x386afa(0x109)],'created_at':_0x365ef3['created_at'],'start_at':_0x365ef3[_0x386afa(0xe3)],'end_at':_0x365ef3[_0x386afa(0xc1)]}));return await handleSDKOutput(_0x4d93f6,_0x10eb6f),0x0;}}
1
+ const a27_0x1736b9=a27_0x3960;(function(_0x40da4d,_0xdbafb2){const _0xf1a4e8=a27_0x3960,_0x3e5a75=_0x40da4d();while(!![]){try{const _0x4dd091=parseInt(_0xf1a4e8(0x1f5))/0x1*(parseInt(_0xf1a4e8(0x1d1))/0x2)+parseInt(_0xf1a4e8(0x222))/0x3*(parseInt(_0xf1a4e8(0x207))/0x4)+parseInt(_0xf1a4e8(0x1e7))/0x5+parseInt(_0xf1a4e8(0x1de))/0x6*(parseInt(_0xf1a4e8(0x19d))/0x7)+-parseInt(_0xf1a4e8(0x1b6))/0x8*(-parseInt(_0xf1a4e8(0x210))/0x9)+parseInt(_0xf1a4e8(0x1a3))/0xa+-parseInt(_0xf1a4e8(0x1d4))/0xb;if(_0x4dd091===_0xdbafb2)break;else _0x3e5a75['push'](_0x3e5a75['shift']());}catch(_0x10773e){_0x3e5a75['push'](_0x3e5a75['shift']());}}}(a27_0x28ff,0x31ddf));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput,writeOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{confirm}from'../utils/prompt.js';import{readFileSync}from'fs';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{hyperlink}from'../sdk/util/formatters.js';function a27_0x3960(_0x1f281b,_0x53af4a){_0x1f281b=_0x1f281b-0x199;const _0x28ff1d=a27_0x28ff();let _0x3960a0=_0x28ff1d[_0x1f281b];return _0x3960a0;}import a27_0x177291 from'chalk';function formatRelativeTime(_0x4e71c5){const _0x59619c=a27_0x3960,_0x48aab6=new Date(_0x4e71c5),_0x52da2c=new Date(),_0x25b881=_0x48aab6[_0x59619c(0x20b)]()-_0x52da2c[_0x59619c(0x20b)](),_0x1fd215=Math[_0x59619c(0x1ec)](_0x25b881)/0x3e8,_0x230d55=_0x25b881<0x0;if(_0x1fd215<0x3c)return _0x230d55?_0x59619c(0x1ce):'soon';else{if(_0x1fd215<0xe10){const _0x37f107=Math[_0x59619c(0x1bc)](_0x1fd215/0x3c);return _0x230d55?_0x37f107+_0x59619c(0x20e):'in\x20'+_0x37f107+'m';}else{if(_0x1fd215<0x15180){const _0x1a634d=Math[_0x59619c(0x1bc)](_0x1fd215/0xe10);return _0x230d55?_0x1a634d+_0x59619c(0x1f0):_0x59619c(0x1c5)+_0x1a634d+'h';}else{if(_0x1fd215<0x93a80){const _0x28e85f=Math[_0x59619c(0x1bc)](_0x1fd215/0x15180);return _0x230d55?_0x28e85f+_0x59619c(0x1bd):_0x59619c(0x1c5)+_0x28e85f+'d';}else return _0x48aab6['toLocaleDateString']();}}}}export class ScheduleListCommand extends BaseCommand{[a27_0x1736b9(0x1ab)]='schedule:list';[a27_0x1736b9(0x22a)]='List\x20scheduled\x20queries';async[a27_0x1736b9(0x1be)](_0x3ef781){const _0x3fad4f=a27_0x1736b9,{options:_0x3f0243,args:_0x4f6d26,tdx:_0x5aebcf}=_0x3ef781,_0x5a4ecf=resolveLimit(_0x3f0243[_0x3fad4f(0x1a1)],DEFAULT_DISPLAY_LIMIT),_0x3face7=_0x4f6d26[0x0],_0x193c52=_0x3face7?_0x3fad4f(0x1ff)+_0x3face7+_0x3fad4f(0x1f7):'Listing\x20scheduled\x20queries...',_0x56276b=await withSpinner(_0x193c52,()=>_0x5aebcf[_0x3fad4f(0x1f1)][_0x3fad4f(0x1c3)]({'limit':_0x5a4ecf,'scheduled':!![],'pattern':_0x3face7}),{'verbose':_0x3f0243[_0x3fad4f(0x1df)]}),_0x250281=_0x56276b[_0x3fad4f(0x1dc)]['queries'],_0x12d2e7=_0x56276b[_0x3fad4f(0x1dc)][_0x3fad4f(0x1e5)][_0x3fad4f(0x228)],_0x21ddde=_0x3face7?_0x3fad4f(0x1e0)+_0x3face7+'\x22':'';_0x12d2e7?console[_0x3fad4f(0x1ba)](_0x3fad4f(0x21c)+_0x250281[_0x3fad4f(0x220)]+_0x3fad4f(0x1b8)+_0x21ddde+_0x3fad4f(0x1f9)):console[_0x3fad4f(0x1ba)](_0x3fad4f(0x1f8)+_0x250281[_0x3fad4f(0x220)]+_0x3fad4f(0x1e2)+(_0x250281[_0x3fad4f(0x220)]!==0x1?_0x3fad4f(0x1c8):'y')+_0x21ddde);if(_0x3f0243[_0x3fad4f(0x1fb)]===_0x3fad4f(0x1e8)||_0x3f0243[_0x3fad4f(0x1fb)]===_0x3fad4f(0x199)||_0x3f0243['format']===_0x3fad4f(0x1d9)||_0x3f0243[_0x3fad4f(0x1fb)]==='tsv'){const _0xae6e9c=_0x250281[_0x3fad4f(0x202)](_0x32dc87=>({'id':_0x32dc87['id'],'name':_0x32dc87[_0x3fad4f(0x1ab)],'cron':_0x32dc87['cron'],'database':_0x32dc87['database']?.['name'],'type':_0x32dc87[_0x3fad4f(0x1aa)],'timezone':_0x32dc87['time_zone'],'user_name':_0x32dc87[_0x3fad4f(0x223)]?.[_0x3fad4f(0x1ab)],'updated_at':_0x32dc87['updated_at'],'next_run_at':_0x32dc87[_0x3fad4f(0x1c2)],'last_job_status':_0x32dc87[_0x3fad4f(0x1ed)]?.[_0x3fad4f(0x1e1)]}));await handleSDKOutput(_0xae6e9c,_0x3f0243);}else{if(_0x250281[_0x3fad4f(0x220)]===0x0)console[_0x3fad4f(0x1ac)]('No\x20scheduled\x20queries\x20found');else{const _0x102645=_0x3f0243[_0x3fad4f(0x219)],_0x522517=_0x250281[_0x3fad4f(0x202)](_0x5f2d73=>{const _0x3eb663=_0x3fad4f,_0x298c2a=_0x5f2d73[_0x3eb663(0x1ed)]?.[_0x3eb663(0x1e1)]?_0x5f2d73['last_job'][_0x3eb663(0x1e1)]===_0x3eb663(0x1ca)?'✓':'✗':'-',_0x49d5f2=_0x5f2d73[_0x3eb663(0x1ed)]?.[_0x3eb663(0x218)]?formatRelativeTime(_0x5f2d73['last_job']['ended_at']):_0x3eb663(0x216),_0x421e2b=_0x5f2d73[_0x3eb663(0x1c2)]?formatRelativeTime(_0x5f2d73['next_run_at']):'-',_0x36a328=_0x5f2d73[_0x3eb663(0x214)]||'',_0x5eca17=_0x5f2d73[_0x3eb663(0x1ab)]||_0x3eb663(0x20a),_0x5ebe49=getConsoleUrl(_0x102645,_0x3eb663(0x20f)+_0x5f2d73['id']);return{'statusIcon':_0x298c2a,'lastRun':_0x49d5f2,'nextRun':_0x421e2b,'cron':_0x36a328,'name':_0x5eca17,'queryUrl':_0x5ebe49,'status':_0x5f2d73[_0x3eb663(0x1ed)]?.[_0x3eb663(0x1e1)]};}),_0x24113b=Math[_0x3fad4f(0x1bf)](..._0x522517[_0x3fad4f(0x202)](_0x183201=>_0x183201[_0x3fad4f(0x221)][_0x3fad4f(0x220)])),_0x5c60bf=Math['max'](..._0x522517[_0x3fad4f(0x202)](_0x4a4038=>_0x4a4038[_0x3fad4f(0x1b1)]['length'])),_0x21f90a=Math[_0x3fad4f(0x1bf)](..._0x522517[_0x3fad4f(0x202)](_0x1e5954=>_0x1e5954[_0x3fad4f(0x214)][_0x3fad4f(0x220)])),_0x18c2a1=_0x522517[_0x3fad4f(0x202)](_0x1430b6=>{const _0x2d4e3a=_0x3fad4f,_0x43a427=_0x1430b6[_0x2d4e3a(0x1e1)]===_0x2d4e3a(0x1ca)?a27_0x177291[_0x2d4e3a(0x1cc)](_0x1430b6[_0x2d4e3a(0x217)]):_0x1430b6['status']==='error'?a27_0x177291[_0x2d4e3a(0x1e3)](_0x1430b6[_0x2d4e3a(0x217)]):a27_0x177291[_0x2d4e3a(0x1a2)](_0x1430b6[_0x2d4e3a(0x217)]),_0x47abac=_0x1430b6[_0x2d4e3a(0x221)][_0x2d4e3a(0x21a)](_0x24113b),_0x368ef7=_0x1430b6[_0x2d4e3a(0x1b1)]['padEnd'](_0x5c60bf),_0x2df3f8=_0x1430b6[_0x2d4e3a(0x214)]?a27_0x177291[_0x2d4e3a(0x204)](_0x1430b6[_0x2d4e3a(0x214)][_0x2d4e3a(0x21a)](_0x21f90a)):'\x20'['repeat'](_0x21f90a),_0x55dd90=hyperlink(_0x1430b6[_0x2d4e3a(0x1ab)],_0x1430b6[_0x2d4e3a(0x1da)]);return'📅\x20'+_0x43a427+'\x20'+_0x47abac+_0x2d4e3a(0x1c7)+_0x368ef7+'\x20\x20'+_0x2df3f8+'\x20\x20'+_0x55dd90;});await writeOutput(_0x18c2a1[_0x3fad4f(0x1d2)]('\x0a'),_0x3f0243[_0x3fad4f(0x1c9)],_0x3fad4f(0x1b5));}}return 0x0;}}export class ScheduleShowCommand extends BaseCommand{[a27_0x1736b9(0x1ab)]=a27_0x1736b9(0x1a8);['description']='Show\x20schedule\x20details';[a27_0x1736b9(0x206)](_0x16d7ed){const _0xe8201f=a27_0x1736b9,_0xe56411=_0x16d7ed[_0xe8201f(0x1db)][0x0];if(!_0xe56411)return _0xe8201f(0x1d7);return undefined;}async['execute'](_0x5800a0){const _0x278845=a27_0x1736b9,{options:_0x393d6e,args:_0x548b89,tdx:_0x5b3e7f}=_0x5800a0,_0x16759c=_0x548b89[0x0],_0x4a97ff=await withSpinner('Getting\x20schedule\x20details...',()=>_0x5b3e7f[_0x278845(0x1f1)][_0x278845(0x1b9)](_0x16759c),{'verbose':_0x393d6e['verbose']}),_0x19c903=_0x4a97ff[_0x278845(0x1dc)],_0x4eed5d={'name':_0x19c903[_0x278845(0x1ab)],'cron':_0x19c903[_0x278845(0x214)],'database':_0x19c903['database'],'type':_0x19c903['type'],'timezone':_0x19c903[_0x278845(0x201)],'user_name':_0x19c903['user_name'],'created_at':_0x19c903['created_at'],'engine_version':_0x19c903[_0x278845(0x1d8)],'executing_user_id':_0x19c903[_0x278845(0x1cf)],'query':_0x19c903[_0x278845(0x1a0)],'delay':_0x19c903[_0x278845(0x1ae)],'priority':_0x19c903[_0x278845(0x209)],'retry_limit':_0x19c903[_0x278845(0x1ad)],..._0x19c903[_0x278845(0x1fd)]&&{'result':_0x19c903['result']}};return await handleSingleObjectOutput(_0x4eed5d,_0x393d6e),0x0;}}export class ScheduleCreateCommand extends BaseCommand{[a27_0x1736b9(0x1ab)]=a27_0x1736b9(0x1ef);[a27_0x1736b9(0x22a)]=a27_0x1736b9(0x229);[a27_0x1736b9(0x206)](_0x2f6737){const _0x5cb28c=a27_0x1736b9,_0xc855e4=_0x2f6737[_0x5cb28c(0x1db)][0x0];if(!_0xc855e4)return _0x5cb28c(0x19b);return undefined;}async[a27_0x1736b9(0x1be)](_0x4003b4){const _0x50d622=a27_0x1736b9,{options:_0x20bb03,args:_0x19adb8,tdx:_0x3e5013}=_0x4003b4,_0x22bffa=_0x19adb8[0x0],_0x4d3d1d=_0x20bb03,_0x4ae37e=_0x4d3d1d['database'],_0xbbe74=_0x4d3d1d[_0x50d622(0x19c)],_0x5ab150=_0x4d3d1d[_0x50d622(0x1aa)]||_0x50d622(0x1c4);let _0x1a8303;try{_0x1a8303=readFileSync(_0xbbe74,_0x50d622(0x1a5))[_0x50d622(0x1dd)]();}catch(_0x3305f4){throw new SDKError(ErrorCode[_0x50d622(0x1e6)],_0x50d622(0x1fa)+_0xbbe74,_0x3305f4 instanceof Error?_0x3305f4:undefined);}if(!_0x1a8303)throw new SDKError(ErrorCode[_0x50d622(0x1e6)],_0x50d622(0x1ee));const _0x4165f1={'database':_0x4ae37e,'query':_0x1a8303,'type':_0x5ab150};if(_0x4d3d1d['cron'])_0x4165f1[_0x50d622(0x214)]=_0x4d3d1d[_0x50d622(0x214)];if(_0x4d3d1d[_0x50d622(0x201)])_0x4165f1['timezone']=_0x4d3d1d[_0x50d622(0x201)];if(_0x4d3d1d['delay']!==undefined)_0x4165f1['delay']=Number(_0x4d3d1d[_0x50d622(0x1ae)]);if(_0x4d3d1d[_0x50d622(0x209)]!==undefined)_0x4165f1['priority']=Number(_0x4d3d1d['priority']);if(_0x4d3d1d['retryLimit']!==undefined)_0x4165f1[_0x50d622(0x1ad)]=Number(_0x4d3d1d[_0x50d622(0x21d)]);if(_0x4d3d1d[_0x50d622(0x1ea)])_0x4165f1[_0x50d622(0x1d8)]=_0x4d3d1d[_0x50d622(0x1ea)];if(_0x4d3d1d[_0x50d622(0x1fd)])_0x4165f1[_0x50d622(0x1fd)]=_0x4d3d1d[_0x50d622(0x1fd)];if(_0x20bb03[_0x50d622(0x1df)]){console[_0x50d622(0x1ba)]('Creating\x20schedule:\x20'+_0x22bffa),console[_0x50d622(0x1ba)](_0x50d622(0x1b2)+_0x4ae37e),console[_0x50d622(0x1ba)]('\x20\x20Type:\x20'+_0x5ab150);if(_0x4165f1[_0x50d622(0x214)])console[_0x50d622(0x1ba)](_0x50d622(0x1c1)+_0x4165f1[_0x50d622(0x214)]);if(_0x4165f1[_0x50d622(0x201)])console[_0x50d622(0x1ba)](_0x50d622(0x21e)+_0x4165f1[_0x50d622(0x201)]);}const _0x1cea68=await withSpinner(_0x50d622(0x1eb),()=>_0x3e5013['schedules'][_0x50d622(0x200)](_0x22bffa,_0x4165f1),{'verbose':_0x20bb03[_0x50d622(0x1df)]});return console[_0x50d622(0x1ba)](_0x50d622(0x1fc)+_0x1cea68['data'][_0x50d622(0x1ab)]),await handleSingleObjectOutput(_0x1cea68[_0x50d622(0x1dc)],_0x20bb03),0x0;}}export class ScheduleUpdateCommand extends BaseCommand{[a27_0x1736b9(0x1ab)]=a27_0x1736b9(0x227);[a27_0x1736b9(0x22a)]=a27_0x1736b9(0x213);['validate'](_0x367ad3){const _0x3ea62c=_0x367ad3['args'][0x0];if(!_0x3ea62c)return'Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20update\x20<name>\x20[options]';return undefined;}async[a27_0x1736b9(0x1be)](_0x459a18){const _0x23c3b8=a27_0x1736b9,{options:_0x1b1b00,args:_0x572d55,tdx:_0x87e90f}=_0x459a18,_0x272276=_0x572d55[0x0],_0xa667d1=_0x1b1b00,_0x51e822={};if(_0xa667d1[_0x23c3b8(0x1a6)])_0x51e822[_0x23c3b8(0x1a6)]=_0xa667d1[_0x23c3b8(0x1a6)];if(_0xa667d1['type'])_0x51e822[_0x23c3b8(0x1aa)]=_0xa667d1[_0x23c3b8(0x1aa)];if(_0xa667d1[_0x23c3b8(0x214)])_0x51e822['cron']=_0xa667d1['cron'];if(_0xa667d1[_0x23c3b8(0x201)])_0x51e822[_0x23c3b8(0x201)]=_0xa667d1['timezone'];if(_0xa667d1[_0x23c3b8(0x1ae)]!==undefined)_0x51e822[_0x23c3b8(0x1ae)]=Number(_0xa667d1[_0x23c3b8(0x1ae)]);if(_0xa667d1[_0x23c3b8(0x209)]!==undefined)_0x51e822['priority']=Number(_0xa667d1[_0x23c3b8(0x209)]);if(_0xa667d1[_0x23c3b8(0x21d)]!==undefined)_0x51e822[_0x23c3b8(0x1ad)]=Number(_0xa667d1['retryLimit']);if(_0xa667d1[_0x23c3b8(0x1ea)])_0x51e822[_0x23c3b8(0x1d8)]=_0xa667d1['engineVersion'];if(_0xa667d1[_0x23c3b8(0x1fd)])_0x51e822[_0x23c3b8(0x1fd)]=_0xa667d1[_0x23c3b8(0x1fd)];if(_0xa667d1['file'])try{_0x51e822[_0x23c3b8(0x1a0)]=readFileSync(_0xa667d1[_0x23c3b8(0x19c)],'utf-8')[_0x23c3b8(0x1dd)]();}catch(_0x373030){throw new SDKError(ErrorCode[_0x23c3b8(0x1e6)],'Failed\x20to\x20read\x20file:\x20'+_0xa667d1['file'],_0x373030 instanceof Error?_0x373030:undefined);}if(Object[_0x23c3b8(0x1f2)](_0x51e822)[_0x23c3b8(0x220)]===0x0)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x23c3b8(0x1d0));if(_0x1b1b00['verbose']){console[_0x23c3b8(0x1ba)](_0x23c3b8(0x21f)+_0x272276);for(const [_0x38f5a8,_0x225af9]of Object['entries'](_0x51e822)){_0x38f5a8===_0x23c3b8(0x1a0)?console[_0x23c3b8(0x1ba)]('\x20\x20'+_0x38f5a8+':\x20'+_0x225af9[_0x23c3b8(0x1f4)](0x0,0x32)+_0x23c3b8(0x226)):console[_0x23c3b8(0x1ba)]('\x20\x20'+_0x38f5a8+':\x20'+_0x225af9);}}const _0x5476d9=await withSpinner(_0x23c3b8(0x1a7),()=>_0x87e90f[_0x23c3b8(0x1f1)][_0x23c3b8(0x225)](_0x272276,_0x51e822),{'verbose':_0x1b1b00[_0x23c3b8(0x1df)]});return console[_0x23c3b8(0x1ba)]('Schedule\x20updated:\x20'+_0x5476d9[_0x23c3b8(0x1dc)][_0x23c3b8(0x1ab)]),await handleSingleObjectOutput(_0x5476d9[_0x23c3b8(0x1dc)],_0x1b1b00),0x0;}}function a27_0x28ff(){const _0x108867=['green','Getting\x20schedule\x20history...','just\x20now','executing_user_id','At\x20least\x20one\x20option\x20must\x20be\x20provided\x20to\x20update','8QLidqI','join','\x20job','11065450vIXOJe','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20schedule\x20\x22','schedule:delete','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20show\x20<name>','engine_version','table','queryUrl','args','data','trim','37752PczMTn','verbose','\x20matching\x20\x22','status','\x20scheduled\x20quer','red','\x20\x20Num:\x20','pagination','INVALID_ARGUMENT','989365gHExvk','json','Deleting\x20schedule...','engineVersion','Creating\x20schedule...','abs','last_job','Query\x20file\x20is\x20empty','schedule:create','h\x20ago','schedules','keys','history','substring','2749ZLMiia','Running\x20schedule:\x20','\x22...','Found\x20','\x20(use\x20--limit\x20to\x20see\x20more)','Failed\x20to\x20read\x20file:\x20','format','Schedule\x20created:\x20','result','time','Searching\x20scheduled\x20queries\x20matching\x20\x22','create','timezone','map','from','cyan','\x20execution','validate','164tbnGWA','end_at','priority','(unnamed)','getTime','Cancelled','run','m\x20ago','/app/queries/editor?queryId=','99ueYqdI','job_id','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20history\x20<name>\x20[--from\x20<n>]\x20[--to\x20<n>]','Update\x20a\x20scheduled\x20query','cron','\x20created','never','statusIcon','ended_at','site','padEnd','Show\x20schedule\x20execution\x20history','Showing\x20first\x20','retryLimit','\x20\x20Timezone:\x20','Updating\x20schedule:\x20','length','lastRun','10356vYXHoH','user','Running\x20schedule...','update','...','schedule:update','has_next_page','Create\x20a\x20scheduled\x20query','description','\x20\x20Time:\x20','jsonl','\x20\x20Job\x20ID:\x20','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20create\x20<name>\x20-d\x20<db>\x20--file\x20<path>\x20[options]','file','322HuyhnL','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20run\x20<name>\x20[--time\x20<iso8601>]\x20[--num\x20<1-10>]','\x20(showing\x20','query','limit','dim','2242020UpclvA','created_at','utf-8','database','Updating\x20schedule...','schedule:show','Delete\x20a\x20scheduled\x20query','type','name','log','retry_limit','delay','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20delete\x20<name>','scheduled_at','nextRun','\x20\x20Database:\x20','jobs','delete','list','251760ALRwcJ','schedule:run','\x20schedules','show','error','start_at','round','d\x20ago','execute','max','yes','\x20\x20Cron:\x20','next_run_at','listQueries','trino','in\x20','num','\x20\x20→\x20','ies','output','success','Schedule\x20deleted:\x20'];a27_0x28ff=function(){return _0x108867;};return a27_0x28ff();}export class ScheduleDeleteCommand extends BaseCommand{[a27_0x1736b9(0x1ab)]=a27_0x1736b9(0x1d6);[a27_0x1736b9(0x22a)]=a27_0x1736b9(0x1a9);['validate'](_0x18fc39){const _0x2d66ac=a27_0x1736b9,_0x30a130=_0x18fc39[_0x2d66ac(0x1db)][0x0];if(!_0x30a130)return _0x2d66ac(0x1af);return undefined;}async['execute'](_0x2dd781){const _0x161aeb=a27_0x1736b9,{options:_0x26a560,args:_0x2ff87a,tdx:_0x2fbc84}=_0x2dd781,_0x5e34a9=_0x2ff87a[0x0];if(!_0x26a560[_0x161aeb(0x1c0)]){const _0x5c9bb1=await confirm(_0x161aeb(0x1d5)+_0x5e34a9+'\x22?');if(!_0x5c9bb1)return console[_0x161aeb(0x1ba)](_0x161aeb(0x20c)),0x0;}const _0x51ce45=await withSpinner(_0x161aeb(0x1e9),()=>_0x2fbc84['schedules'][_0x161aeb(0x1b4)](_0x5e34a9),{'verbose':_0x26a560[_0x161aeb(0x1df)]});return console[_0x161aeb(0x1ba)](_0x161aeb(0x1cb)+_0x51ce45[_0x161aeb(0x1dc)]['name']),0x0;}}export class ScheduleRunCommand extends BaseCommand{[a27_0x1736b9(0x1ab)]=a27_0x1736b9(0x1b7);[a27_0x1736b9(0x22a)]='Run\x20a\x20scheduled\x20query\x20immediately';[a27_0x1736b9(0x206)](_0x357107){const _0x2fc355=a27_0x1736b9,_0x144d74=_0x357107[_0x2fc355(0x1db)][0x0];if(!_0x144d74)return _0x2fc355(0x19e);return undefined;}async[a27_0x1736b9(0x1be)](_0x596acb){const _0x536aba=a27_0x1736b9,{options:_0x393882,args:_0x117df7,tdx:_0x4bb9ac}=_0x596acb,_0x591a4b=_0x117df7[0x0],_0x1c9b65=_0x393882,_0x3358f6=_0x1c9b65[_0x536aba(0x1fe)],_0x2f9f65=_0x1c9b65['num']!==undefined?Number(_0x1c9b65[_0x536aba(0x1c6)]):undefined;if(_0x393882[_0x536aba(0x1df)]){console[_0x536aba(0x1ba)](_0x536aba(0x1f6)+_0x591a4b);if(_0x3358f6)console[_0x536aba(0x1ba)](_0x536aba(0x22b)+_0x3358f6);if(_0x2f9f65)console[_0x536aba(0x1ba)](_0x536aba(0x1e4)+_0x2f9f65);}const _0xedbd58=await withSpinner(_0x536aba(0x224),()=>_0x4bb9ac[_0x536aba(0x1f1)][_0x536aba(0x20d)](_0x591a4b,{'time':_0x3358f6,'num':_0x2f9f65}),{'verbose':_0x393882[_0x536aba(0x1df)]}),_0xb1f598=_0xedbd58[_0x536aba(0x1dc)][_0x536aba(0x1b3)];console[_0x536aba(0x1ba)]('Schedule\x20run\x20submitted:\x20'+_0xb1f598[_0x536aba(0x220)]+_0x536aba(0x1d3)+(_0xb1f598[_0x536aba(0x220)]!==0x1?'s':'')+_0x536aba(0x215));for(const _0x77c9a1 of _0xb1f598){console[_0x536aba(0x1ba)](_0x536aba(0x19a)+_0x77c9a1[_0x536aba(0x211)]);}return await handleSDKOutput(_0xb1f598,_0x393882),0x0;}}export class ScheduleHistoryCommand extends BaseCommand{[a27_0x1736b9(0x1ab)]='schedule:history';[a27_0x1736b9(0x22a)]=a27_0x1736b9(0x21b);[a27_0x1736b9(0x206)](_0x5a0261){const _0x8da350=a27_0x1736b9,_0x28ba16=_0x5a0261[_0x8da350(0x1db)][0x0];if(!_0x28ba16)return _0x8da350(0x212);return undefined;}async[a27_0x1736b9(0x1be)](_0x1dee3b){const _0x5286a6=a27_0x1736b9,{options:_0x44b2e5,args:_0x5c16bb,tdx:_0x8443ef}=_0x1dee3b,_0x3f13a3=_0x5c16bb[0x0],_0x2904ca=_0x44b2e5,_0x2746ba=_0x2904ca[_0x5286a6(0x203)]!==undefined?Number(_0x2904ca[_0x5286a6(0x203)]):undefined,_0x1a2e59=_0x2904ca['to']!==undefined?Number(_0x2904ca['to']):undefined,_0x2fa60b=await withSpinner(_0x5286a6(0x1cd),()=>_0x8443ef[_0x5286a6(0x1f1)][_0x5286a6(0x1f3)](_0x3f13a3,{'from':_0x2746ba,'to':_0x1a2e59}),{'verbose':_0x44b2e5[_0x5286a6(0x1df)]}),_0x2aaec2=_0x2fa60b[_0x5286a6(0x1dc)];console['error'](_0x5286a6(0x1f8)+_0x2aaec2['count']+_0x5286a6(0x205)+(_0x2aaec2['count']!==0x1?'s':'')+_0x5286a6(0x19f)+_0x2aaec2['from']+'-'+_0x2aaec2['to']+')');const _0x1578dd=_0x2aaec2[_0x5286a6(0x1f3)][_0x5286a6(0x202)](_0x2fe60b=>({'job_id':_0x2fe60b[_0x5286a6(0x211)],'type':_0x2fe60b[_0x5286a6(0x1aa)],'status':_0x2fe60b[_0x5286a6(0x1e1)],'scheduled_at':_0x2fe60b[_0x5286a6(0x1b0)],'created_at':_0x2fe60b[_0x5286a6(0x1a4)],'start_at':_0x2fe60b[_0x5286a6(0x1bb)],'end_at':_0x2fe60b[_0x5286a6(0x208)]}));return await handleSDKOutput(_0x1578dd,_0x44b2e5),0x0;}}
@@ -1 +1 @@
1
- const a28_0x5c638e=a28_0x4e7a;(function(_0x3b4dbd,_0xcc1609){const _0x44ac7b=a28_0x4e7a,_0x23d990=_0x3b4dbd();while(!![]){try{const _0x3a7fd7=-parseInt(_0x44ac7b(0x13c))/0x1+-parseInt(_0x44ac7b(0x138))/0x2*(parseInt(_0x44ac7b(0xfb))/0x3)+-parseInt(_0x44ac7b(0x18f))/0x4*(-parseInt(_0x44ac7b(0x133))/0x5)+parseInt(_0x44ac7b(0x11e))/0x6*(parseInt(_0x44ac7b(0x160))/0x7)+-parseInt(_0x44ac7b(0xfa))/0x8+-parseInt(_0x44ac7b(0x12f))/0x9+parseInt(_0x44ac7b(0x13f))/0xa;if(_0x3a7fd7===_0xcc1609)break;else _0x23d990['push'](_0x23d990['shift']());}catch(_0x594493){_0x23d990['push'](_0x23d990['shift']());}}}(a28_0x2575,0x2e887));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner,formatElapsed}from'../utils/spinner.js';import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{executeSchemaQuery}from'../sdk/segment/fields-display.js';import{isYamlFilePath,resolveYamlFilePath}from'../sdk/segment/segment-path-parser.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{openBrowser}from'../utils/process.js';import a28_0x386346 from'chalk';function a28_0x2575(){const _0x3ee33d=['\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20sql\x20<path/to/segment.yml>','Usage:\x20tdx\x20sg\x20sql\x20<name>','\x20\x20tdx\x20sg\x20view\x20segments/my-audience/premium-users.yml','Get\x20SQL\x20query\x20for\x20child\x20segment','\x20rows\x20','segment:folder:show','segment','error','Error:\x20Cannot\x20get\x20SQL\x20for\x20parent\x20segment\x20with\x20this\x20command.','Resolving\x20parent\x20segment\x20\x27','\x20Opening\x20','toLocaleString','Error:\x20Cannot\x20view\x20parent\x20segment\x20details\x20with\x20this\x20command.','Folder\x20ID:\x20','fullPath','Show\x20segment\x20or\x20folder\x20details','\x20\x20tdx\x20sg\x20desc\x20segments/my-audience/premium-users.yml','test','segment:describe','segment:sql','in\x20','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','jsonl','12ALAmwp','stats','\x27...','INVALID_ARGUMENT','Resolving\x20\x27','segment:folder:create','Segment\x20ID:\x20','\x20\x20Cause:\x20','1665488EiqsUY','690WVzCCI','Fetching\x20segment\x20details...','parentId','verbose','segment:show','cyan','trim','resolveFolderId','\x27\x20with\x20ID:\x20','Show\x20child\x20segment\x20schema\x20(column\x20types)','Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>','type','web','Error:\x20Cannot\x20open\x20folder\x20in\x20web\x20browser.\x20Use\x20a\x20segment\x20name\x20instead.','Error:\x20Cannot\x20show\x20schema\x20for\x20a\x20folder.','folderId','execute','Error:\x20Cannot\x20open\x20parent\x20segment\x20with\x20this\x20command.','includes','segmentPath','Site:\x20','cause','Parent\x20segment:\x20','Use:\x20tdx\x20ps\x20view','query','json','Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required','\x20\x20tdx\x20sg\x20view\x20\x22Marketing\x22\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20folder\x20details','Options:','resolveParentId','SEGMENT_NOT_FOUND','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20\x20\x20\x20\x20#\x20View\x20child\x20segment\x20details','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22','Use:\x20tdx\x20ps\x20desc','Error:\x20Folder\x20or\x20segment\x20name,\x20or\x20YAML\x20file\x20path\x20is\x20required','6VDSLut','elapsedTimeMillis','format','message','Use:\x20tdx\x20ps\x20sql','Parent\x20name:\x20','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','code','Fetching\x20folder\x20\x27','getFolder','log','Show\x20folder\x20or\x20child\x20segment\x20details','Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>','Fetching\x20SQL\x20for\x20segment...','Show\x20segment\x20folder\x20details','jobId','data','1802340QhqgrQ','Resolved\x20YAML\x20file:\x20','Folder\x20name:\x20','Usage:\x20tdx\x20segment\x20describe\x20<path>','517885ybslgv','processedRows','getSegmentSQL','Usage:\x20tdx\x20sg\x20desc\x20<name>','Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required','1046QTzPLY','Use:\x20tdx\x20ps\x20view\x20-w','Creating\x20folder\x20\x27','segment:desc','215071gsLOjV','createFolder','description','3909160trIEeF','SEGMENT_FOLDER_NOT_FOUND','Usage:\x20tdx\x20sg\x20show\x20<name>','parentSegment','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20-w\x20\x20#\x20Open\x20segment\x20in\x20web\x20browser','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','Use:\x20tdx\x20ps\x20show','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20view\x20<path/to/segment.yml>','Segment\x20ID\x20missing\x20from\x20resolved\x20path','segment:folder:list','\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','Resolved\x20folder\x20ID:\x20','✔\x20Found\x20','parent','limit','Error:\x20Parent\x20segment\x20name\x20is\x20required','Fetching\x20parent\x20segment\x20details...','folder','Resolved\x20type:\x20','Error:\x20Cannot\x20show\x20schema\x20for\x20parent\x20segment\x20with\x20this\x20command.','parentFolder','Resolved\x20parent\x20ID:\x20','getSegment','Resolved\x20relative\x20path\x20to:\x20','Examples:','Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.','Target\x20path:\x20','\x20\x20Folder\x20path:\x20','\x20\x20Segment\x20name:\x20','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22','\x20\x20Parent\x20segment:\x20','resolvePathToResource','\x20\x20tdx\x20sg\x20show\x20segments/my-audience/premium-users.yml','1629313AmrFfm','\x20folder','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20desc\x20<path/to/segment.yml>','✔\x20Query\x20completed:\x20Processed\x20','site','\x20\x20tdx\x20sg\x20sql\x20\x22Premium\x20Users\x22','setJobId','segmentId','Error:\x20','(root)','Parent\x20ID:\x20','url','name','Error:\x20Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.','Folder\x20ID\x20missing\x20from\x20resolved\x20path','/app/ps/','\x20\x20tdx\x20sg\x20show\x20\x22Premium\x20Users\x22','Use:\x20tdx\x20sg\x20view\x20<name>\x20\x20#\x20To\x20show\x20folder\x20details','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','Error:\x20Cannot\x20execute\x20query\x20for\x20parent\x20segment\x20with\x20this\x20command.','length','replace','listFolders','\x20\x20tdx\x20sg\x20desc\x20\x22Premium\x20Users\x22'];a28_0x2575=function(){return _0x3ee33d;};return a28_0x2575();}async function resolveSegmentTarget(_0x15fdfc,_0x4f9664,_0x5c4178){const _0x5a09ea=a28_0x4e7a;if(isYamlFilePath(_0x15fdfc))try{const _0x5f45f7=await resolveYamlFilePath(_0x15fdfc);return _0x5c4178&&(console[_0x5a09ea(0x17f)](_0x5a09ea(0x130)+_0x15fdfc),console[_0x5a09ea(0x17f)](_0x5a09ea(0x15d)+_0x5f45f7['parentSegment']),console[_0x5a09ea(0x17f)](_0x5a09ea(0x15b)+_0x5f45f7['segmentName']),console[_0x5a09ea(0x17f)](_0x5a09ea(0x15a)+(_0x5f45f7['folderPath']||_0x5a09ea(0x169))),console[_0x5a09ea(0x17f)]('\x20\x20Full\x20path:\x20'+_0x5f45f7[_0x5a09ea(0x186)])),_0x5f45f7[_0x5a09ea(0x186)];}catch(_0x4c4341){throw new SDKError(ErrorCode[_0x5a09ea(0xf5)],_0x5a09ea(0x172)+_0x4c4341[_0x5a09ea(0x121)]);}if(!_0x4f9664)throw new SDKError(ErrorCode[_0x5a09ea(0xf5)],_0x5a09ea(0x144));return _0x4f9664+'/'+_0x15fdfc;}export class SegmentDescribeCommand extends BaseCommand{[a28_0x5c638e(0x16c)]=a28_0x5c638e(0x18a);[a28_0x5c638e(0x13e)]=a28_0x5c638e(0x187);async[a28_0x5c638e(0x10b)](_0x318b49){const _0x5da77d=a28_0x5c638e,{options:_0x54997d,args:_0x3559d1,tdx:_0x23e4d0}=_0x318b49,_0x4bc8f2=_0x3559d1[0x0],_0x5982b5=!_0x4bc8f2&&!!_0x54997d['parentSegment'],_0x2c3ca3=_0x4bc8f2||_0x54997d[_0x5da77d(0x142)];if(!_0x2c3ca3)return console[_0x5da77d(0x17f)]('Error:\x20Path\x20or\x20name\x20is\x20required'),console[_0x5da77d(0x17f)](_0x5da77d(0x132)),console[_0x5da77d(0x17f)](_0x5da77d(0x157)),console[_0x5da77d(0x17f)](_0x5da77d(0x11b)),console[_0x5da77d(0x17f)](_0x5da77d(0x15c)),console[_0x5da77d(0x17f)](_0x5da77d(0x149)),console[_0x5da77d(0x17f)]('\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>'),0x1;try{const _0xf4e548=_0x54997d[_0x5da77d(0x10e)];let _0x2b7f22=_0x2c3ca3;!_0x5982b5&&_0xf4e548&&!_0x2c3ca3[_0x5da77d(0x10d)]('/')&&(_0x2b7f22=_0xf4e548+'/'+_0x2c3ca3,_0x54997d['verbose']&&console[_0x5da77d(0x17f)](_0x5da77d(0x156)+_0x2b7f22));const _0x2de935=await withSpinner('Resolving\x20path\x20\x27'+_0x2b7f22+'\x27...',()=>_0x23e4d0[_0x5da77d(0x17e)]['resolvePathToResource'](_0x2b7f22),{'verbose':_0x54997d['verbose']}),_0x5ed49a=_0x2de935[_0x5da77d(0x12e)];_0x54997d[_0x5da77d(0xfe)]&&(console[_0x5da77d(0x17f)](_0x5da77d(0x151)+_0x5ed49a[_0x5da77d(0x106)]),console[_0x5da77d(0x17f)](_0x5da77d(0x16a)+_0x5ed49a[_0x5da77d(0xfd)]),_0x5ed49a[_0x5da77d(0x10a)]&&console[_0x5da77d(0x17f)](_0x5da77d(0x185)+_0x5ed49a['folderId']),_0x5ed49a[_0x5da77d(0x167)]&&console[_0x5da77d(0x17f)](_0x5da77d(0xf8)+_0x5ed49a['segmentId']));if(_0x5ed49a[_0x5da77d(0x106)]===_0x5da77d(0x14c)){const _0x2e59f4=await withSpinner(_0x5da77d(0x14f),()=>_0x23e4d0[_0x5da77d(0x17e)]['getParent'](_0x5ed49a[_0x5da77d(0xfd)]),{'verbose':_0x54997d[_0x5da77d(0xfe)]});await handleSingleObjectOutput(_0x2e59f4[_0x5da77d(0x12e)],_0x54997d);}else{if(_0x5ed49a[_0x5da77d(0x106)]===_0x5da77d(0x150)){if(!_0x5ed49a['folderId'])throw new SDKError(ErrorCode[_0x5da77d(0x140)],_0x5da77d(0x16e));const _0x1ab8a1=await withSpinner('Fetching\x20folder\x20details...',()=>_0x23e4d0[_0x5da77d(0x17e)][_0x5da77d(0x127)](_0x5ed49a[_0x5da77d(0x10a)]),{'verbose':_0x54997d['verbose']});await handleSingleObjectOutput(_0x1ab8a1[_0x5da77d(0x12e)],_0x54997d);}else{if(_0x5ed49a['type']===_0x5da77d(0x17e)){if(!_0x5ed49a['segmentId'])throw new SDKError(ErrorCode[_0x5da77d(0x119)],_0x5da77d(0x147));const _0xa2da6e=await withSpinner(_0x5da77d(0xfc),()=>_0x23e4d0['segment'][_0x5da77d(0x155)](_0x5ed49a[_0x5da77d(0xfd)],_0x5ed49a['segmentId']),{'verbose':_0x54997d[_0x5da77d(0xfe)]});await handleSingleObjectOutput(_0xa2da6e[_0x5da77d(0x12e)],_0x54997d);}}}return 0x0;}catch(_0x173b0f){if(_0x173b0f instanceof SDKError)return console[_0x5da77d(0x17f)](_0x5da77d(0x168)+_0x173b0f['message']),_0x173b0f[_0x5da77d(0x110)]&&console[_0x5da77d(0x17f)](_0x5da77d(0xf9)+_0x173b0f['cause']),0x1;throw _0x173b0f;}}}export class SegmentShowCommand extends BaseCommand{[a28_0x5c638e(0x16c)]=a28_0x5c638e(0xff);[a28_0x5c638e(0x13e)]='Execute\x20child\x20segment\x20SQL\x20query\x20and\x20show\x20results';async[a28_0x5c638e(0x10b)](_0x137199){const _0xcda091=a28_0x5c638e,{options:_0x13c1fe,args:_0x49ee5e,tdx:_0xff3862}=_0x137199,_0xaa8ee2=_0x49ee5e[0x0];if(!_0xaa8ee2)return console[_0xcda091(0x17f)]('Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required'),console['error'](_0xcda091(0x141)),console[_0xcda091(0x17f)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20show\x20<path/to/segment.yml>'),console['error'](_0xcda091(0x157)),console['error'](_0xcda091(0x170)),console['error'](_0xcda091(0x15f)),0x1;try{const _0x47a3c6=_0x13c1fe['parentSegment'],_0x525f91=await resolveSegmentTarget(_0xaa8ee2,_0x47a3c6,_0x13c1fe[_0xcda091(0xfe)]);_0x13c1fe[_0xcda091(0xfe)]&&console['error'](_0xcda091(0x159)+_0x525f91);const _0x5a3edf=await withSpinner(_0xcda091(0xf6)+_0xaa8ee2+'\x27...',()=>_0xff3862[_0xcda091(0x17e)][_0xcda091(0x15e)](_0x525f91),{'verbose':_0x13c1fe[_0xcda091(0xfe)]}),_0xeb0c18=_0x5a3edf[_0xcda091(0x12e)];_0x13c1fe[_0xcda091(0xfe)]&&(console[_0xcda091(0x17f)](_0xcda091(0x151)+_0xeb0c18[_0xcda091(0x106)]),console[_0xcda091(0x17f)](_0xcda091(0x16a)+_0xeb0c18['parentId']));if(_0xeb0c18[_0xcda091(0x106)]===_0xcda091(0x150))return console[_0xcda091(0x17f)](_0xcda091(0x158)),console[_0xcda091(0x17f)](_0xcda091(0x171)),0x1;if(_0xeb0c18[_0xcda091(0x106)]==='parent')return console['error'](_0xcda091(0x173)),console['error'](_0xcda091(0x145)),0x1;if(!_0xeb0c18[_0xcda091(0x167)])throw new SDKError(ErrorCode[_0xcda091(0x119)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x395b0d=await withSpinner('Fetching\x20SQL\x20for\x20segment...',()=>_0xff3862[_0xcda091(0x17e)][_0xcda091(0x135)](_0xeb0c18[_0xcda091(0xfd)],_0xeb0c18[_0xcda091(0x167)]),{'verbose':_0x13c1fe[_0xcda091(0xfe)]});let _0x587f48=_0x395b0d[_0xcda091(0x12e)];const _0x2ba76d=resolveLimit(_0x13c1fe[_0xcda091(0x14d)],DEFAULT_DISPLAY_LIMIT),_0x3e5479=/\bLIMIT\s+\d+/i[_0xcda091(0x189)](_0x587f48);!_0x3e5479&&(_0x587f48=_0x587f48[_0xcda091(0x101)]()[_0xcda091(0x175)](/;+$/,''),_0x587f48='SELECT\x20*\x20FROM\x20(\x0a'+_0x587f48+_0xcda091(0x124)+_0x2ba76d);_0x13c1fe[_0xcda091(0xfe)]&&console[_0xcda091(0x17f)]('SQL\x20query:\x0a'+_0x587f48);const _0x14b508=await withProgressSpinner('Executing\x20segment\x20query...',async _0x59b348=>{const _0x56b7fd=_0xcda091,_0xb2040f=await _0xff3862[_0x56b7fd(0x113)][_0x56b7fd(0x10b)](_0x587f48,{'catalog':'td','schema':'information_schema','onJobId':_0x13b213=>{const _0xf7ef2d=_0x56b7fd;_0x59b348[_0xf7ef2d(0x166)](_0x13b213);}});return _0xb2040f;},{'verbose':_0x13c1fe['verbose']}),_0x77938b=_0x14b508[_0xcda091(0x12e)],_0x16a0c3=_0x77938b[_0xcda091(0x12d)]?'\x20[Job\x20ID:\x20'+_0x77938b[_0xcda091(0x12d)]+']':'';return console[_0xcda091(0x17f)](_0xcda091(0x163)+_0x77938b[_0xcda091(0x190)][_0xcda091(0x134)][_0xcda091(0x183)]()+_0xcda091(0x17c)+(_0xcda091(0x18c)+formatElapsed(_0x77938b[_0xcda091(0x190)][_0xcda091(0x11f)])+_0x16a0c3)),await handleQueryOutput(_0x77938b,_0x13c1fe),0x0;}catch(_0x2c9059){if(_0x2c9059 instanceof SDKError)return console[_0xcda091(0x17f)]('✖\x20Query\x20failed\x20['+_0x2c9059[_0xcda091(0x125)]+']'),console[_0xcda091(0x17f)]('\x0a'+_0x2c9059[_0xcda091(0x121)]),0x1;throw _0x2c9059;}}}export class SegmentFolderListCommand extends BaseCommand{[a28_0x5c638e(0x16c)]=a28_0x5c638e(0x148);[a28_0x5c638e(0x13e)]='List\x20segment\x20folders\x20under\x20a\x20parent\x20segment';async[a28_0x5c638e(0x10b)](_0x36616c){const _0x36de72=a28_0x5c638e,{options:_0x3d72a9,args:_0x38f4b3,tdx:_0x2d7d74}=_0x36616c;if(_0x38f4b3[_0x36de72(0x174)]===0x0)return console[_0x36de72(0x17f)](_0x36de72(0x14e)),console[_0x36de72(0x17f)](_0x36de72(0x12a)),0x1;const _0x24db88=_0x38f4b3[0x0];try{_0x3d72a9[_0x36de72(0xfe)]&&(console[_0x36de72(0x17f)]('Site:\x20'+_0x3d72a9[_0x36de72(0x164)]),console[_0x36de72(0x17f)]('Parent\x20name:\x20'+_0x24db88));const _0x3c1443=await withSpinner(_0x36de72(0x181)+_0x24db88+_0x36de72(0x191),()=>_0x2d7d74[_0x36de72(0x17e)][_0x36de72(0x118)](_0x24db88),{'verbose':_0x3d72a9[_0x36de72(0xfe)]}),_0x54bbc0=_0x3c1443['data'];_0x3d72a9[_0x36de72(0xfe)]&&console['error'](_0x36de72(0x154)+_0x54bbc0);const _0x5ef2fb=await withSpinner('Listing\x20folders\x20for\x20parent\x20\x27'+_0x24db88+_0x36de72(0x191),()=>_0x2d7d74[_0x36de72(0x17e)][_0x36de72(0x176)](_0x54bbc0),{'verbose':_0x3d72a9[_0x36de72(0xfe)]}),_0x141578=_0x5ef2fb[_0x36de72(0x12e)];return console[_0x36de72(0x17f)](_0x36de72(0x14b)+_0x141578[_0x36de72(0x174)]+_0x36de72(0x161)+(_0x141578[_0x36de72(0x174)]!==0x1?'s':'')),await handleSDKOutput(_0x141578,_0x3d72a9),0x0;}catch(_0x4badf9){if(_0x4badf9 instanceof SDKError)return console[_0x36de72(0x17f)](_0x36de72(0x168)+_0x4badf9[_0x36de72(0x121)]),_0x4badf9[_0x36de72(0x110)]&&console['error']('\x20\x20Cause:\x20'+_0x4badf9[_0x36de72(0x110)]),0x1;throw _0x4badf9;}}}export class SegmentFolderShowCommand extends BaseCommand{[a28_0x5c638e(0x16c)]=a28_0x5c638e(0x17d);[a28_0x5c638e(0x13e)]=a28_0x5c638e(0x12c);async[a28_0x5c638e(0x10b)](_0x309b11){const _0xa040a3=a28_0x5c638e,{options:_0x28f486,args:_0xf4378e,tdx:_0x475016}=_0x309b11;if(_0xf4378e['length']===0x0)return console[_0xa040a3(0x17f)]('Error:\x20Folder\x20reference\x20is\x20required'),console[_0xa040a3(0x17f)](_0xa040a3(0x105)),0x1;try{const {parentId:_0x24660d,childId:_0x49d89a}=parseSegmentRef(_0xf4378e[0x0]);_0x28f486[_0xa040a3(0xfe)]&&(console[_0xa040a3(0x17f)](_0xa040a3(0x10f)+_0x28f486[_0xa040a3(0x164)]),console['error'](_0xa040a3(0x123)+_0x24660d),_0x49d89a&&console['error'](_0xa040a3(0x131)+_0x49d89a));if(!_0x49d89a)return console[_0xa040a3(0x17f)]('Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)'),0x1;const _0x7e5ade=await withSpinner(_0xa040a3(0x181)+_0x24660d+_0xa040a3(0x191),()=>_0x475016[_0xa040a3(0x17e)][_0xa040a3(0x118)](_0x24660d),{'verbose':_0x28f486[_0xa040a3(0xfe)]}),_0x1ca212=_0x7e5ade['data'];_0x28f486[_0xa040a3(0xfe)]&&console[_0xa040a3(0x17f)](_0xa040a3(0x154)+_0x1ca212);const _0x2a8be6=await withSpinner('Resolving\x20folder\x20\x27'+_0x49d89a+'\x27...',()=>_0x475016[_0xa040a3(0x17e)][_0xa040a3(0x102)](_0x1ca212,_0x49d89a),{'verbose':_0x28f486[_0xa040a3(0xfe)]}),_0x3bb3e3=_0x2a8be6['data'];_0x28f486[_0xa040a3(0xfe)]&&console[_0xa040a3(0x17f)](_0xa040a3(0x14a)+_0x3bb3e3);const _0x1f4ed3=await withSpinner(_0xa040a3(0x126)+_0x49d89a+_0xa040a3(0x191),()=>_0x475016[_0xa040a3(0x17e)][_0xa040a3(0x127)](_0x3bb3e3),{'verbose':_0x28f486[_0xa040a3(0xfe)]});return await handleSDKOutput([_0x1f4ed3['data']],_0x28f486),0x0;}catch(_0x2b27f9){if(_0x2b27f9 instanceof SDKError)return console[_0xa040a3(0x17f)](_0xa040a3(0x168)+_0x2b27f9[_0xa040a3(0x121)]),_0x2b27f9[_0xa040a3(0x110)]&&console[_0xa040a3(0x17f)](_0xa040a3(0xf9)+_0x2b27f9[_0xa040a3(0x110)]),0x1;throw _0x2b27f9;}}}function a28_0x4e7a(_0x4ac516,_0x5e75f1){_0x4ac516=_0x4ac516-0xf5;const _0x2575bf=a28_0x2575();let _0x4e7a18=_0x2575bf[_0x4ac516];return _0x4e7a18;}export class SegmentSQLCommand extends BaseCommand{[a28_0x5c638e(0x16c)]=a28_0x5c638e(0x18b);[a28_0x5c638e(0x13e)]=a28_0x5c638e(0x17b);async['execute'](_0x51fc2e){const _0x21326d=a28_0x5c638e,{options:_0x13e6e2,args:_0xce3bac,tdx:_0x2ff932}=_0x51fc2e,_0x2cd3de=_0xce3bac[0x0];if(!_0x2cd3de)return console['error']('Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required'),console['error'](_0x21326d(0x179)),console[_0x21326d(0x17f)](_0x21326d(0x178)),console[_0x21326d(0x17f)](_0x21326d(0x157)),console[_0x21326d(0x17f)](_0x21326d(0x165)),console[_0x21326d(0x17f)]('\x20\x20tdx\x20sg\x20sql\x20segments/my-audience/premium-users.yml'),0x1;try{const _0x1d0e77=_0x13e6e2[_0x21326d(0x142)],_0x25baef=await resolveSegmentTarget(_0x2cd3de,_0x1d0e77,_0x13e6e2[_0x21326d(0xfe)]);_0x13e6e2['verbose']&&console[_0x21326d(0x17f)](_0x21326d(0x159)+_0x25baef);const _0x272060=await withSpinner(_0x21326d(0xf6)+_0x2cd3de+_0x21326d(0x191),()=>_0x2ff932[_0x21326d(0x17e)][_0x21326d(0x15e)](_0x25baef),{'verbose':_0x13e6e2[_0x21326d(0xfe)]}),_0x126b92=_0x272060[_0x21326d(0x12e)];_0x13e6e2[_0x21326d(0xfe)]&&(console[_0x21326d(0x17f)](_0x21326d(0x151)+_0x126b92[_0x21326d(0x106)]),console['error'](_0x21326d(0x16a)+_0x126b92[_0x21326d(0xfd)]));if(_0x126b92[_0x21326d(0x106)]===_0x21326d(0x150))return console[_0x21326d(0x17f)](_0x21326d(0x16d)),console[_0x21326d(0x17f)](_0x21326d(0x18d)),0x1;if(_0x126b92['type']===_0x21326d(0x14c))return console['error'](_0x21326d(0x180)),console['error'](_0x21326d(0x122)),0x1;if(!_0x126b92[_0x21326d(0x167)])throw new SDKError(ErrorCode[_0x21326d(0x119)],_0x21326d(0x147));const _0x7354e7=await withSpinner(_0x21326d(0x12b),()=>_0x2ff932[_0x21326d(0x17e)][_0x21326d(0x135)](_0x126b92[_0x21326d(0xfd)],_0x126b92['segmentId']),{'verbose':_0x13e6e2['verbose']}),_0x65cbab=_0x7354e7[_0x21326d(0x12e)];return _0x13e6e2['format']===_0x21326d(0x114)||_0x13e6e2[_0x21326d(0x120)]===_0x21326d(0x18e)?await handleSDKOutput([{'sql':_0x65cbab}],_0x13e6e2):console[_0x21326d(0x128)](_0x65cbab),0x0;}catch(_0x57c2d0){if(_0x57c2d0 instanceof SDKError)return console[_0x21326d(0x17f)](_0x21326d(0x168)+_0x57c2d0[_0x21326d(0x121)]),_0x57c2d0['cause']&&console[_0x21326d(0x17f)](_0x21326d(0xf9)+_0x57c2d0[_0x21326d(0x110)]),0x1;throw _0x57c2d0;}}}export class SegmentFolderCreateCommand extends BaseCommand{[a28_0x5c638e(0x16c)]=a28_0x5c638e(0xf7);[a28_0x5c638e(0x13e)]='Create\x20segment\x20folder\x20for\x20organization';async['execute'](_0x5d76d4){const _0x1368ad=a28_0x5c638e,{options:_0x3e3a28,args:_0x18fb7c,tdx:_0x33b039}=_0x5d76d4,_0x374fda=_0x3e3a28;if(_0x18fb7c[_0x1368ad(0x174)]<0x2)return console[_0x1368ad(0x17f)](_0x1368ad(0x115)),console[_0x1368ad(0x17f)]('Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]'),0x1;const _0x18857a=_0x18fb7c[0x0],_0x22e1c9=_0x18fb7c[0x1];_0x374fda[_0x1368ad(0xfe)]&&(console[_0x1368ad(0x17f)](_0x1368ad(0x10f)+_0x374fda[_0x1368ad(0x164)]),console['error'](_0x1368ad(0x111)+_0x18857a),console[_0x1368ad(0x17f)](_0x1368ad(0x131)+_0x22e1c9));let _0x30a1b2;if(_0x374fda['parentFolder']){const _0x30e989=_0x374fda[_0x1368ad(0x153)],_0x5e5489=await withSpinner(_0x1368ad(0x181)+_0x18857a+'\x27...',()=>_0x33b039[_0x1368ad(0x17e)][_0x1368ad(0x118)](_0x18857a),{'verbose':_0x374fda[_0x1368ad(0xfe)]}),_0x19ca46=_0x5e5489[_0x1368ad(0x12e)],_0x4c1801=await withSpinner('Resolving\x20parent\x20folder\x20\x27'+_0x30e989+_0x1368ad(0x191),()=>_0x33b039[_0x1368ad(0x17e)][_0x1368ad(0x102)](_0x19ca46,_0x30e989),{'verbose':_0x374fda[_0x1368ad(0xfe)]});_0x30a1b2=_0x4c1801['data'],_0x374fda['verbose']&&console['error']('Resolved\x20parent\x20folder\x20ID:\x20'+_0x30a1b2);}const _0x258bce={'name':_0x22e1c9,'description':_0x374fda[_0x1368ad(0x13e)],'parentFolderId':_0x30a1b2},_0x370e0e=await withSpinner(_0x1368ad(0x13a)+_0x22e1c9+'\x27...',()=>_0x33b039[_0x1368ad(0x17e)][_0x1368ad(0x13d)](_0x18857a,_0x258bce),{'verbose':_0x374fda[_0x1368ad(0xfe)]}),_0x1c99a5=_0x370e0e[_0x1368ad(0x12e)];return console[_0x1368ad(0x17f)]('✔\x20Created\x20folder\x20\x27'+_0x1c99a5[_0x1368ad(0x16c)]+_0x1368ad(0x103)+_0x1c99a5['id']),await handleSDKOutput([_0x1c99a5],_0x374fda),0x0;}}export class SegmentViewCommand extends BaseCommand{[a28_0x5c638e(0x16c)]='segment:view';[a28_0x5c638e(0x13e)]=a28_0x5c638e(0x129);async[a28_0x5c638e(0x10b)](_0xbcf597){const _0x1e0271=a28_0x5c638e,{options:_0x5afc3f,args:_0x567141,tdx:_0x1b3cea}=_0xbcf597,_0x490340=_0x567141[0x0];if(!_0x490340)return console[_0x1e0271(0x17f)](_0x1e0271(0x11d)),console[_0x1e0271(0x17f)]('Usage:\x20tdx\x20sg\x20view\x20<name>\x20[-w]'),console[_0x1e0271(0x17f)](_0x1e0271(0x146)),console[_0x1e0271(0x17f)](_0x1e0271(0x117)),console[_0x1e0271(0x17f)]('\x20\x20-w,\x20--web\x20\x20Open\x20segment\x20in\x20web\x20browser'),console['error'](_0x1e0271(0x157)),console[_0x1e0271(0x17f)](_0x1e0271(0x116)),console[_0x1e0271(0x17f)](_0x1e0271(0x11a)),console[_0x1e0271(0x17f)](_0x1e0271(0x143)),console[_0x1e0271(0x17f)](_0x1e0271(0x17a)),0x1;try{const _0x3e51ec=_0x5afc3f[_0x1e0271(0x142)],_0x47450d=await resolveSegmentTarget(_0x490340,_0x3e51ec,_0x5afc3f[_0x1e0271(0xfe)]);_0x5afc3f['verbose']&&console[_0x1e0271(0x17f)]('Target\x20path:\x20'+_0x47450d);const _0x1cfb1f=await withSpinner(_0x1e0271(0xf6)+_0x490340+_0x1e0271(0x191),()=>_0x1b3cea[_0x1e0271(0x17e)][_0x1e0271(0x15e)](_0x47450d),{'verbose':_0x5afc3f[_0x1e0271(0xfe)]}),_0x107eb=_0x1cfb1f[_0x1e0271(0x12e)];_0x5afc3f[_0x1e0271(0xfe)]&&(console['error'](_0x1e0271(0x151)+_0x107eb[_0x1e0271(0x106)]),console[_0x1e0271(0x17f)]('Parent\x20ID:\x20'+_0x107eb[_0x1e0271(0xfd)]),_0x107eb[_0x1e0271(0x10a)]&&console[_0x1e0271(0x17f)](_0x1e0271(0x185)+_0x107eb['folderId']),_0x107eb[_0x1e0271(0x167)]&&console[_0x1e0271(0x17f)]('Segment\x20ID:\x20'+_0x107eb[_0x1e0271(0x167)]));if(_0x5afc3f[_0x1e0271(0x107)]){if(_0x107eb[_0x1e0271(0x106)]===_0x1e0271(0x150))return console[_0x1e0271(0x17f)](_0x1e0271(0x108)),0x1;if(_0x107eb['type']===_0x1e0271(0x14c))return console['error'](_0x1e0271(0x10c)),console['error'](_0x1e0271(0x139)),0x1;if(!_0x107eb[_0x1e0271(0x167)])throw new SDKError(ErrorCode[_0x1e0271(0x119)],_0x1e0271(0x147));const _0x3d3a0d=getConsoleNextUrl(_0x5afc3f[_0x1e0271(0x164)],_0x1e0271(0x16f)+_0x107eb[_0x1e0271(0xfd)]+'/e/'+_0x107eb['segmentId']);return console[_0x1e0271(0x17f)](a28_0x386346['green']('✔')+_0x1e0271(0x182)+a28_0x386346[_0x1e0271(0x100)](_0x3d3a0d)),openBrowser(_0x3d3a0d),0x0;}if(_0x107eb[_0x1e0271(0x106)]===_0x1e0271(0x150)){if(!_0x107eb[_0x1e0271(0x10a)])throw new SDKError(ErrorCode[_0x1e0271(0x140)],_0x1e0271(0x16e));const _0x1c6e2a=await withSpinner('Fetching\x20folder\x20details...',()=>_0x1b3cea[_0x1e0271(0x17e)][_0x1e0271(0x127)](_0x107eb['folderId']),{'verbose':_0x5afc3f[_0x1e0271(0xfe)]});await handleSingleObjectOutput(_0x1c6e2a[_0x1e0271(0x12e)],_0x5afc3f);}else{if(_0x107eb[_0x1e0271(0x106)]==='segment'){if(!_0x107eb['segmentId'])throw new SDKError(ErrorCode[_0x1e0271(0x119)],_0x1e0271(0x147));const _0x11a8cd=await withSpinner(_0x1e0271(0xfc),()=>_0x1b3cea[_0x1e0271(0x17e)][_0x1e0271(0x155)](_0x107eb[_0x1e0271(0xfd)],_0x107eb['segmentId']),{'verbose':_0x5afc3f[_0x1e0271(0xfe)]}),_0x2cf782=getConsoleNextUrl(_0x5afc3f['site'],_0x1e0271(0x16f)+_0x107eb[_0x1e0271(0xfd)]+'/e/'+_0x107eb[_0x1e0271(0x167)]),_0x2916bb=_0x11a8cd[_0x1e0271(0x12e)];_0x2916bb[_0x1e0271(0x16b)]=_0x2cf782,await handleSingleObjectOutput(_0x2916bb,_0x5afc3f);}else return console[_0x1e0271(0x17f)](_0x1e0271(0x184)),console[_0x1e0271(0x17f)](_0x1e0271(0x112)),0x1;}return 0x0;}catch(_0x1a0c70){if(_0x1a0c70 instanceof SDKError)return console[_0x1e0271(0x17f)](_0x1e0271(0x168)+_0x1a0c70['message']),_0x1a0c70['cause']&&console[_0x1e0271(0x17f)](_0x1e0271(0xf9)+_0x1a0c70['cause']),0x1;throw _0x1a0c70;}}}export const SegmentInfoCommand=SegmentViewCommand;export class SegmentDescCommand extends BaseCommand{['name']=a28_0x5c638e(0x13b);[a28_0x5c638e(0x13e)]=a28_0x5c638e(0x104);async[a28_0x5c638e(0x10b)](_0x5a1d0f){const _0x534d32=a28_0x5c638e,{options:_0x821880,args:_0x3e8438,tdx:_0x9f06aa}=_0x5a1d0f,_0x5eecd6=_0x3e8438[0x0];if(!_0x5eecd6)return console[_0x534d32(0x17f)](_0x534d32(0x137)),console[_0x534d32(0x17f)](_0x534d32(0x136)),console[_0x534d32(0x17f)](_0x534d32(0x162)),console[_0x534d32(0x17f)](_0x534d32(0x157)),console[_0x534d32(0x17f)](_0x534d32(0x177)),console['error'](_0x534d32(0x188)),0x1;try{const _0x50de5b=_0x821880[_0x534d32(0x142)],_0x31e7c2=await resolveSegmentTarget(_0x5eecd6,_0x50de5b,_0x821880[_0x534d32(0xfe)]);_0x821880['verbose']&&console['error']('Target\x20path:\x20'+_0x31e7c2);const _0x166fcc=await withSpinner(_0x534d32(0xf6)+_0x5eecd6+_0x534d32(0x191),()=>_0x9f06aa['segment'][_0x534d32(0x15e)](_0x31e7c2),{'verbose':_0x821880[_0x534d32(0xfe)]}),_0x4880f1=_0x166fcc['data'];_0x821880[_0x534d32(0xfe)]&&(console[_0x534d32(0x17f)](_0x534d32(0x151)+_0x4880f1['type']),console[_0x534d32(0x17f)](_0x534d32(0x16a)+_0x4880f1[_0x534d32(0xfd)]));if(_0x4880f1[_0x534d32(0x106)]===_0x534d32(0x150))return console['error'](_0x534d32(0x109)),console[_0x534d32(0x17f)]('Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.'),0x1;if(_0x4880f1[_0x534d32(0x106)]===_0x534d32(0x14c))return console['error'](_0x534d32(0x152)),console[_0x534d32(0x17f)](_0x534d32(0x11c)),0x1;if(!_0x4880f1[_0x534d32(0x167)])throw new SDKError(ErrorCode[_0x534d32(0x119)],_0x534d32(0x147));const _0x38a56d=await withSpinner(_0x534d32(0x12b),()=>_0x9f06aa[_0x534d32(0x17e)][_0x534d32(0x135)](_0x4880f1[_0x534d32(0xfd)],_0x4880f1['segmentId']),{'verbose':_0x821880[_0x534d32(0xfe)]}),_0x215532=_0x38a56d[_0x534d32(0x12e)],_0x5e31d5=await executeSchemaQuery(_0x215532,_0x9f06aa,_0x821880);return await handleQueryOutput(_0x5e31d5,_0x821880),0x0;}catch(_0x519a09){if(_0x519a09 instanceof SDKError)return console[_0x534d32(0x17f)](_0x534d32(0x168)+_0x519a09['message']),_0x519a09[_0x534d32(0x110)]&&console[_0x534d32(0x17f)](_0x534d32(0xf9)+_0x519a09[_0x534d32(0x110)]),0x1;throw _0x519a09;}}}
1
+ const a28_0xfea2b9=a28_0x5ad7;function a28_0x5ad7(_0x128f23,_0x4bfea0){_0x128f23=_0x128f23-0x19b;const _0x3ada4d=a28_0x3ada();let _0x5ad730=_0x3ada4d[_0x128f23];return _0x5ad730;}(function(_0x34973b,_0x4c1e63){const _0x5080f3=a28_0x5ad7,_0x48b674=_0x34973b();while(!![]){try{const _0x4dccbf=-parseInt(_0x5080f3(0x22c))/0x1+-parseInt(_0x5080f3(0x1b6))/0x2+parseInt(_0x5080f3(0x228))/0x3+parseInt(_0x5080f3(0x237))/0x4*(parseInt(_0x5080f3(0x202))/0x5)+-parseInt(_0x5080f3(0x238))/0x6+-parseInt(_0x5080f3(0x1bd))/0x7*(parseInt(_0x5080f3(0x1b1))/0x8)+parseInt(_0x5080f3(0x1a7))/0x9*(parseInt(_0x5080f3(0x229))/0xa);if(_0x4dccbf===_0x4c1e63)break;else _0x48b674['push'](_0x48b674['shift']());}catch(_0x1f05a1){_0x48b674['push'](_0x48b674['shift']());}}}(a28_0x3ada,0x2ab7b));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner,formatElapsed}from'../utils/spinner.js';import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';function a28_0x3ada(){const _0x2638ff=['Parent\x20segment:\x20','Get\x20SQL\x20query\x20for\x20child\x20segment','34274XqEPWO','segmentId','Error:\x20Folder\x20or\x20segment\x20name,\x20or\x20YAML\x20file\x20path\x20is\x20required','log','message','/app/ps/','Fetching\x20SQL\x20for\x20segment...','Fetching\x20segment\x20details...','List\x20segment\x20folders\x20under\x20a\x20parent\x20segment','Usage:\x20tdx\x20sg\x20sql\x20<name>','description','517948WQhgFY','293952xPtZrS','segment:sql','Target\x20path:\x20','includes','getSegmentSQL','Resolving\x20path\x20\x27','type','Error:\x20Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.','Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>','query','Usage:\x20tdx\x20segment\x20describe\x20<path>','folderId','Execute\x20child\x20segment\x20SQL\x20query\x20and\x20show\x20results','100521jgdnLx','listFolders','Error:\x20Cannot\x20execute\x20query\x20for\x20parent\x20segment\x20with\x20this\x20command.','segmentPath','\x27\x20with\x20ID:\x20','jsonl','/e/','Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)','Parent\x20ID:\x20','data','16hmmnpH','test','\x20\x20tdx\x20sg\x20view\x20segments/my-audience/premium-users.yml','\x20\x20Segment\x20name:\x20','site','338650QkbsBG','segment:folder:show','segment:folder:list','Folder\x20name:\x20','Resolving\x20folder\x20\x27','Show\x20segment\x20folder\x20details','jobId','865298JebYiT','Show\x20folder\x20or\x20child\x20segment\x20details','Site:\x20','replace','length','Folder\x20ID:\x20','resolveParentId','format','parentFolder','Error:\x20Cannot\x20show\x20schema\x20for\x20a\x20folder.','\x20rows\x20','Resolving\x20\x27','Resolved\x20relative\x20path\x20to:\x20','Error:\x20Cannot\x20open\x20folder\x20in\x20web\x20browser.\x20Use\x20a\x20segment\x20name\x20instead.','\x20\x20tdx\x20sg\x20view\x20\x22Marketing\x22\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20folder\x20details','execute','Folder\x20ID\x20missing\x20from\x20resolved\x20path','json','cause','Creating\x20folder\x20\x27','\x20\x20Cause:\x20','resolvePathToResource','parentSegment','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20desc\x20<path/to/segment.yml>','segment:describe','SQL\x20query:\x0a','Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]','web','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22','Resolving\x20parent\x20folder\x20\x27','Resolving\x20parent\x20segment\x20\x27','getFolder','resolveFolderId','getSegment','segment:desc','getParent','SEGMENT_FOLDER_NOT_FOUND','stats','Listing\x20folders\x20for\x20parent\x20\x27','✔\x20Found\x20','toLocaleString','name','\x20\x20Full\x20path:\x20','Show\x20segment\x20or\x20folder\x20details','verbose','Error:\x20Parent\x20segment\x20name\x20is\x20required','Error:\x20Cannot\x20view\x20parent\x20segment\x20details\x20with\x20this\x20command.','folder','Resolved\x20folder\x20ID:\x20','Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','✔\x20Created\x20folder\x20\x27','Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.','parent','Use:\x20tdx\x20sg\x20view\x20<name>\x20\x20#\x20To\x20show\x20folder\x20details','Segment\x20ID:\x20','\x27...','Use:\x20tdx\x20ps\x20show','trim','Resolved\x20parent\x20folder\x20ID:\x20','\x20\x20tdx\x20sg\x20show\x20segments/my-audience/premium-users.yml','Error:\x20Cannot\x20show\x20schema\x20for\x20parent\x20segment\x20with\x20this\x20command.','segmentName','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20show\x20<path/to/segment.yml>','Examples:','information_schema','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20sql\x20<path/to/segment.yml>','Usage:\x20tdx\x20sg\x20view\x20<name>\x20[-w]','cyan','10icMHxc','segment','\x20\x20tdx\x20sg\x20desc\x20\x22Premium\x20Users\x22','Create\x20segment\x20folder\x20for\x20organization','Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required','\x20\x20tdx\x20sg\x20desc\x20segments/my-audience/premium-users.yml','segment:show','processedRows','createFolder','Use:\x20tdx\x20ps\x20view','Show\x20child\x20segment\x20schema\x20(column\x20types)','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20view\x20<path/to/segment.yml>','Use:\x20tdx\x20ps\x20desc','Use:\x20tdx\x20ps\x20sql','folderPath','Segment\x20ID\x20missing\x20from\x20resolved\x20path','Resolved\x20type:\x20','Fetching\x20folder\x20details...','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20-w\x20\x20#\x20Open\x20segment\x20in\x20web\x20browser','Executing\x20segment\x20query...','Fetching\x20folder\x20\x27','fullPath','SEGMENT_NOT_FOUND','Error:\x20Folder\x20reference\x20is\x20required','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','Fetching\x20parent\x20segment\x20details...','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','INVALID_ARGUMENT','error','parentId','Parent\x20name:\x20','Resolved\x20parent\x20ID:\x20','Error:\x20','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','SELECT\x20*\x20FROM\x20(\x0a','limit','segment:folder:create','\x20\x20Parent\x20segment:\x20','644322QMwZUZ','180cBBnPS'];a28_0x3ada=function(){return _0x2638ff;};return a28_0x3ada();}import{executeSchemaQuery}from'../sdk/segment/fields-display.js';import{isYamlFilePath,resolveYamlFilePath}from'../sdk/segment/segment-path-parser.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{openBrowser}from'../utils/process.js';import a28_0x2fa847 from'chalk';async function resolveSegmentTarget(_0x544ce0,_0x29896b,_0x3488ad){const _0x23e313=a28_0x5ad7;if(isYamlFilePath(_0x544ce0))try{const _0x4701fb=await resolveYamlFilePath(_0x544ce0);return _0x3488ad&&(console['error']('Resolved\x20YAML\x20file:\x20'+_0x544ce0),console[_0x23e313(0x21e)](_0x23e313(0x227)+_0x4701fb[_0x23e313(0x1d3)]),console['error'](_0x23e313(0x1b4)+_0x4701fb[_0x23e313(0x1fb)]),console[_0x23e313(0x21e)]('\x20\x20Folder\x20path:\x20'+(_0x4701fb[_0x23e313(0x210)]||'(root)')),console[_0x23e313(0x21e)](_0x23e313(0x1e7)+_0x4701fb[_0x23e313(0x217)])),_0x4701fb[_0x23e313(0x217)];}catch(_0x329448){throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x23e313(0x223)+_0x329448[_0x23e313(0x230)]);}if(!_0x29896b)throw new SDKError(ErrorCode[_0x23e313(0x21d)],'No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22');return _0x29896b+'/'+_0x544ce0;}export class SegmentDescribeCommand extends BaseCommand{[a28_0xfea2b9(0x1e6)]=a28_0xfea2b9(0x1d5);['description']=a28_0xfea2b9(0x1e8);async[a28_0xfea2b9(0x1cc)](_0x5872be){const _0x1379c9=a28_0xfea2b9,{options:_0x34b4cb,args:_0x403e8f,tdx:_0x41f4cf}=_0x5872be,_0x1c78ab=_0x403e8f[0x0],_0x55f312=!_0x1c78ab&&!!_0x34b4cb[_0x1379c9(0x1d3)],_0x5ab977=_0x1c78ab||_0x34b4cb[_0x1379c9(0x1d3)];if(!_0x5ab977)return console['error']('Error:\x20Path\x20or\x20name\x20is\x20required'),console['error'](_0x1379c9(0x1a4)),console[_0x1379c9(0x21e)]('Examples:'),console[_0x1379c9(0x21e)]('\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22'),console[_0x1379c9(0x21e)](_0x1379c9(0x1d9)),console['error']('\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context'),console['error'](_0x1379c9(0x1ef)),0x1;try{const _0x968cbf=_0x34b4cb[_0x1379c9(0x1aa)];let _0x2b8bb6=_0x5ab977;!_0x55f312&&_0x968cbf&&!_0x5ab977[_0x1379c9(0x19d)]('/')&&(_0x2b8bb6=_0x968cbf+'/'+_0x5ab977,_0x34b4cb[_0x1379c9(0x1e9)]&&console[_0x1379c9(0x21e)](_0x1379c9(0x1c9)+_0x2b8bb6));const _0x4d39e6=await withSpinner(_0x1379c9(0x19f)+_0x2b8bb6+_0x1379c9(0x1f5),()=>_0x41f4cf[_0x1379c9(0x203)][_0x1379c9(0x1d2)](_0x2b8bb6),{'verbose':_0x34b4cb[_0x1379c9(0x1e9)]}),_0x3f8d46=_0x4d39e6[_0x1379c9(0x1b0)];_0x34b4cb['verbose']&&(console[_0x1379c9(0x21e)](_0x1379c9(0x212)+_0x3f8d46[_0x1379c9(0x1a0)]),console['error']('Parent\x20ID:\x20'+_0x3f8d46[_0x1379c9(0x21f)]),_0x3f8d46[_0x1379c9(0x1a5)]&&console[_0x1379c9(0x21e)](_0x1379c9(0x1c2)+_0x3f8d46[_0x1379c9(0x1a5)]),_0x3f8d46[_0x1379c9(0x22d)]&&console['error'](_0x1379c9(0x1f4)+_0x3f8d46[_0x1379c9(0x22d)]));if(_0x3f8d46[_0x1379c9(0x1a0)]===_0x1379c9(0x1f2)){const _0x3799b4=await withSpinner(_0x1379c9(0x21b),()=>_0x41f4cf[_0x1379c9(0x203)][_0x1379c9(0x1e0)](_0x3f8d46['parentId']),{'verbose':_0x34b4cb[_0x1379c9(0x1e9)]});await handleSingleObjectOutput(_0x3799b4[_0x1379c9(0x1b0)],_0x34b4cb);}else{if(_0x3f8d46['type']===_0x1379c9(0x1ec)){if(!_0x3f8d46[_0x1379c9(0x1a5)])throw new SDKError(ErrorCode[_0x1379c9(0x1e1)],_0x1379c9(0x1cd));const _0x17d4bb=await withSpinner('Fetching\x20folder\x20details...',()=>_0x41f4cf[_0x1379c9(0x203)][_0x1379c9(0x1dc)](_0x3f8d46[_0x1379c9(0x1a5)]),{'verbose':_0x34b4cb[_0x1379c9(0x1e9)]});await handleSingleObjectOutput(_0x17d4bb[_0x1379c9(0x1b0)],_0x34b4cb);}else{if(_0x3f8d46[_0x1379c9(0x1a0)]===_0x1379c9(0x203)){if(!_0x3f8d46['segmentId'])throw new SDKError(ErrorCode[_0x1379c9(0x218)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x4c8ad4=await withSpinner(_0x1379c9(0x233),()=>_0x41f4cf[_0x1379c9(0x203)][_0x1379c9(0x1de)](_0x3f8d46['parentId'],_0x3f8d46[_0x1379c9(0x22d)]),{'verbose':_0x34b4cb[_0x1379c9(0x1e9)]});await handleSingleObjectOutput(_0x4c8ad4[_0x1379c9(0x1b0)],_0x34b4cb);}}}return 0x0;}catch(_0x133868){if(_0x133868 instanceof SDKError)return console[_0x1379c9(0x21e)](_0x1379c9(0x222)+_0x133868[_0x1379c9(0x230)]),_0x133868['cause']&&console['error']('\x20\x20Cause:\x20'+_0x133868[_0x1379c9(0x1cf)]),0x1;throw _0x133868;}}}export class SegmentShowCommand extends BaseCommand{['name']=a28_0xfea2b9(0x208);[a28_0xfea2b9(0x236)]=a28_0xfea2b9(0x1a6);async['execute'](_0x214686){const _0x18e0a0=a28_0xfea2b9,{options:_0x52e07a,args:_0x579671,tdx:_0x18fe48}=_0x214686,_0x2212e1=_0x579671[0x0];if(!_0x2212e1)return console[_0x18e0a0(0x21e)]('Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required'),console[_0x18e0a0(0x21e)]('Usage:\x20tdx\x20sg\x20show\x20<name>'),console[_0x18e0a0(0x21e)](_0x18e0a0(0x1fc)),console[_0x18e0a0(0x21e)]('Examples:'),console[_0x18e0a0(0x21e)]('\x20\x20tdx\x20sg\x20show\x20\x22Premium\x20Users\x22'),console['error'](_0x18e0a0(0x1f9)),0x1;try{const _0x5306ba=_0x52e07a['parentSegment'],_0x176605=await resolveSegmentTarget(_0x2212e1,_0x5306ba,_0x52e07a[_0x18e0a0(0x1e9)]);_0x52e07a[_0x18e0a0(0x1e9)]&&console[_0x18e0a0(0x21e)](_0x18e0a0(0x19c)+_0x176605);const _0x559c81=await withSpinner(_0x18e0a0(0x1c8)+_0x2212e1+_0x18e0a0(0x1f5),()=>_0x18fe48[_0x18e0a0(0x203)][_0x18e0a0(0x1d2)](_0x176605),{'verbose':_0x52e07a[_0x18e0a0(0x1e9)]}),_0x3cf9cf=_0x559c81[_0x18e0a0(0x1b0)];_0x52e07a[_0x18e0a0(0x1e9)]&&(console[_0x18e0a0(0x21e)](_0x18e0a0(0x212)+_0x3cf9cf[_0x18e0a0(0x1a0)]),console[_0x18e0a0(0x21e)](_0x18e0a0(0x1af)+_0x3cf9cf[_0x18e0a0(0x21f)]));if(_0x3cf9cf[_0x18e0a0(0x1a0)]===_0x18e0a0(0x1ec))return console['error'](_0x18e0a0(0x1f1)),console['error'](_0x18e0a0(0x1f3)),0x1;if(_0x3cf9cf[_0x18e0a0(0x1a0)]===_0x18e0a0(0x1f2))return console[_0x18e0a0(0x21e)](_0x18e0a0(0x1a9)),console[_0x18e0a0(0x21e)](_0x18e0a0(0x1f6)),0x1;if(!_0x3cf9cf[_0x18e0a0(0x22d)])throw new SDKError(ErrorCode[_0x18e0a0(0x218)],_0x18e0a0(0x211));const _0x61e0a=await withSpinner(_0x18e0a0(0x232),()=>_0x18fe48[_0x18e0a0(0x203)]['getSegmentSQL'](_0x3cf9cf[_0x18e0a0(0x21f)],_0x3cf9cf[_0x18e0a0(0x22d)]),{'verbose':_0x52e07a[_0x18e0a0(0x1e9)]});let _0x30a4e7=_0x61e0a[_0x18e0a0(0x1b0)];const _0x217f15=resolveLimit(_0x52e07a[_0x18e0a0(0x225)],DEFAULT_DISPLAY_LIMIT),_0x448fe1=/\bLIMIT\s+\d+/i[_0x18e0a0(0x1b2)](_0x30a4e7);!_0x448fe1&&(_0x30a4e7=_0x30a4e7[_0x18e0a0(0x1f7)]()[_0x18e0a0(0x1c0)](/;+$/,''),_0x30a4e7=_0x18e0a0(0x224)+_0x30a4e7+_0x18e0a0(0x21c)+_0x217f15);_0x52e07a[_0x18e0a0(0x1e9)]&&console[_0x18e0a0(0x21e)](_0x18e0a0(0x1d6)+_0x30a4e7);const _0x1cc036=await withProgressSpinner(_0x18e0a0(0x215),async _0x4b1a88=>{const _0xd3cf48=_0x18e0a0,_0x137ff0=await _0x18fe48[_0xd3cf48(0x1a3)][_0xd3cf48(0x1cc)](_0x30a4e7,{'catalog':'td','schema':_0xd3cf48(0x1fe),'onJobId':_0x2a197c=>{_0x4b1a88['setJobId'](_0x2a197c);}});return _0x137ff0;},{'verbose':_0x52e07a[_0x18e0a0(0x1e9)]}),_0x4efe65=_0x1cc036['data'],_0x1f3631=_0x4efe65[_0x18e0a0(0x1bc)]?'\x20[Job\x20ID:\x20'+_0x4efe65['jobId']+']':'';return console[_0x18e0a0(0x21e)]('✔\x20Query\x20completed:\x20Processed\x20'+_0x4efe65[_0x18e0a0(0x1e2)][_0x18e0a0(0x209)][_0x18e0a0(0x1e5)]()+_0x18e0a0(0x1c7)+('in\x20'+formatElapsed(_0x4efe65[_0x18e0a0(0x1e2)]['elapsedTimeMillis'])+_0x1f3631)),await handleQueryOutput(_0x4efe65,_0x52e07a),0x0;}catch(_0x232742){if(_0x232742 instanceof SDKError)return console[_0x18e0a0(0x21e)]('✖\x20Query\x20failed\x20['+_0x232742['code']+']'),console[_0x18e0a0(0x21e)]('\x0a'+_0x232742['message']),0x1;throw _0x232742;}}}export class SegmentFolderListCommand extends BaseCommand{['name']=a28_0xfea2b9(0x1b8);['description']=a28_0xfea2b9(0x234);async[a28_0xfea2b9(0x1cc)](_0x5a0639){const _0x8397d3=a28_0xfea2b9,{options:_0x161e93,args:_0x250ec0,tdx:_0x1a4702}=_0x5a0639;if(_0x250ec0[_0x8397d3(0x1c1)]===0x0)return console[_0x8397d3(0x21e)](_0x8397d3(0x1ea)),console[_0x8397d3(0x21e)]('Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>'),0x1;const _0x119099=_0x250ec0[0x0];try{_0x161e93['verbose']&&(console[_0x8397d3(0x21e)]('Site:\x20'+_0x161e93[_0x8397d3(0x1b5)]),console[_0x8397d3(0x21e)]('Parent\x20name:\x20'+_0x119099));const _0x5ca707=await withSpinner(_0x8397d3(0x1db)+_0x119099+_0x8397d3(0x1f5),()=>_0x1a4702[_0x8397d3(0x203)][_0x8397d3(0x1c3)](_0x119099),{'verbose':_0x161e93[_0x8397d3(0x1e9)]}),_0x5b081a=_0x5ca707['data'];_0x161e93[_0x8397d3(0x1e9)]&&console[_0x8397d3(0x21e)](_0x8397d3(0x221)+_0x5b081a);const _0x31062c=await withSpinner(_0x8397d3(0x1e3)+_0x119099+'\x27...',()=>_0x1a4702['segment'][_0x8397d3(0x1a8)](_0x5b081a),{'verbose':_0x161e93[_0x8397d3(0x1e9)]}),_0x2844fc=_0x31062c[_0x8397d3(0x1b0)];return console[_0x8397d3(0x21e)](_0x8397d3(0x1e4)+_0x2844fc[_0x8397d3(0x1c1)]+'\x20folder'+(_0x2844fc[_0x8397d3(0x1c1)]!==0x1?'s':'')),await handleSDKOutput(_0x2844fc,_0x161e93),0x0;}catch(_0x425c93){if(_0x425c93 instanceof SDKError)return console['error']('Error:\x20'+_0x425c93[_0x8397d3(0x230)]),_0x425c93[_0x8397d3(0x1cf)]&&console[_0x8397d3(0x21e)](_0x8397d3(0x1d1)+_0x425c93['cause']),0x1;throw _0x425c93;}}}export class SegmentFolderShowCommand extends BaseCommand{[a28_0xfea2b9(0x1e6)]=a28_0xfea2b9(0x1b7);[a28_0xfea2b9(0x236)]=a28_0xfea2b9(0x1bb);async[a28_0xfea2b9(0x1cc)](_0x1d9f2b){const _0x1da478=a28_0xfea2b9,{options:_0x588122,args:_0x5f2ad4,tdx:_0x33b115}=_0x1d9f2b;if(_0x5f2ad4[_0x1da478(0x1c1)]===0x0)return console[_0x1da478(0x21e)](_0x1da478(0x219)),console[_0x1da478(0x21e)](_0x1da478(0x1a2)),0x1;try{const {parentId:_0x5293e7,childId:_0x34722d}=parseSegmentRef(_0x5f2ad4[0x0]);_0x588122['verbose']&&(console[_0x1da478(0x21e)](_0x1da478(0x1bf)+_0x588122['site']),console['error'](_0x1da478(0x220)+_0x5293e7),_0x34722d&&console[_0x1da478(0x21e)]('Folder\x20name:\x20'+_0x34722d));if(!_0x34722d)return console['error'](_0x1da478(0x1ae)),0x1;const _0x7254ec=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x5293e7+_0x1da478(0x1f5),()=>_0x33b115['segment'][_0x1da478(0x1c3)](_0x5293e7),{'verbose':_0x588122[_0x1da478(0x1e9)]}),_0x9df2a3=_0x7254ec['data'];_0x588122[_0x1da478(0x1e9)]&&console[_0x1da478(0x21e)](_0x1da478(0x221)+_0x9df2a3);const _0x30acff=await withSpinner(_0x1da478(0x1ba)+_0x34722d+_0x1da478(0x1f5),()=>_0x33b115[_0x1da478(0x203)][_0x1da478(0x1dd)](_0x9df2a3,_0x34722d),{'verbose':_0x588122[_0x1da478(0x1e9)]}),_0x3d37e5=_0x30acff[_0x1da478(0x1b0)];_0x588122[_0x1da478(0x1e9)]&&console['error'](_0x1da478(0x1ed)+_0x3d37e5);const _0x512e58=await withSpinner(_0x1da478(0x216)+_0x34722d+_0x1da478(0x1f5),()=>_0x33b115[_0x1da478(0x203)][_0x1da478(0x1dc)](_0x3d37e5),{'verbose':_0x588122[_0x1da478(0x1e9)]});return await handleSDKOutput([_0x512e58[_0x1da478(0x1b0)]],_0x588122),0x0;}catch(_0x5e6cfc){if(_0x5e6cfc instanceof SDKError)return console[_0x1da478(0x21e)](_0x1da478(0x222)+_0x5e6cfc[_0x1da478(0x230)]),_0x5e6cfc['cause']&&console['error'](_0x1da478(0x1d1)+_0x5e6cfc[_0x1da478(0x1cf)]),0x1;throw _0x5e6cfc;}}}export class SegmentSQLCommand extends BaseCommand{[a28_0xfea2b9(0x1e6)]=a28_0xfea2b9(0x19b);['description']=a28_0xfea2b9(0x22b);async[a28_0xfea2b9(0x1cc)](_0x34eecd){const _0x237d3a=a28_0xfea2b9,{options:_0x22f0e5,args:_0x8b765d,tdx:_0x19a99f}=_0x34eecd,_0x584516=_0x8b765d[0x0];if(!_0x584516)return console[_0x237d3a(0x21e)](_0x237d3a(0x1ee)),console[_0x237d3a(0x21e)](_0x237d3a(0x235)),console[_0x237d3a(0x21e)](_0x237d3a(0x1ff)),console[_0x237d3a(0x21e)](_0x237d3a(0x1fd)),console[_0x237d3a(0x21e)]('\x20\x20tdx\x20sg\x20sql\x20\x22Premium\x20Users\x22'),console[_0x237d3a(0x21e)]('\x20\x20tdx\x20sg\x20sql\x20segments/my-audience/premium-users.yml'),0x1;try{const _0x4f5c64=_0x22f0e5['parentSegment'],_0x5b8623=await resolveSegmentTarget(_0x584516,_0x4f5c64,_0x22f0e5[_0x237d3a(0x1e9)]);_0x22f0e5[_0x237d3a(0x1e9)]&&console[_0x237d3a(0x21e)]('Target\x20path:\x20'+_0x5b8623);const _0x3c8eba=await withSpinner(_0x237d3a(0x1c8)+_0x584516+_0x237d3a(0x1f5),()=>_0x19a99f[_0x237d3a(0x203)][_0x237d3a(0x1d2)](_0x5b8623),{'verbose':_0x22f0e5[_0x237d3a(0x1e9)]}),_0x30a898=_0x3c8eba[_0x237d3a(0x1b0)];_0x22f0e5[_0x237d3a(0x1e9)]&&(console[_0x237d3a(0x21e)](_0x237d3a(0x212)+_0x30a898[_0x237d3a(0x1a0)]),console[_0x237d3a(0x21e)](_0x237d3a(0x1af)+_0x30a898['parentId']));if(_0x30a898[_0x237d3a(0x1a0)]===_0x237d3a(0x1ec))return console[_0x237d3a(0x21e)](_0x237d3a(0x1a1)),console[_0x237d3a(0x21e)]('Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.'),0x1;if(_0x30a898[_0x237d3a(0x1a0)]===_0x237d3a(0x1f2))return console['error']('Error:\x20Cannot\x20get\x20SQL\x20for\x20parent\x20segment\x20with\x20this\x20command.'),console[_0x237d3a(0x21e)](_0x237d3a(0x20f)),0x1;if(!_0x30a898[_0x237d3a(0x22d)])throw new SDKError(ErrorCode[_0x237d3a(0x218)],_0x237d3a(0x211));const _0xde156a=await withSpinner(_0x237d3a(0x232),()=>_0x19a99f[_0x237d3a(0x203)][_0x237d3a(0x19e)](_0x30a898[_0x237d3a(0x21f)],_0x30a898[_0x237d3a(0x22d)]),{'verbose':_0x22f0e5[_0x237d3a(0x1e9)]}),_0x2a95da=_0xde156a[_0x237d3a(0x1b0)];return _0x22f0e5[_0x237d3a(0x1c4)]===_0x237d3a(0x1ce)||_0x22f0e5[_0x237d3a(0x1c4)]===_0x237d3a(0x1ac)?await handleSDKOutput([{'sql':_0x2a95da}],_0x22f0e5):console[_0x237d3a(0x22f)](_0x2a95da),0x0;}catch(_0x3d3b12){if(_0x3d3b12 instanceof SDKError)return console['error']('Error:\x20'+_0x3d3b12[_0x237d3a(0x230)]),_0x3d3b12[_0x237d3a(0x1cf)]&&console[_0x237d3a(0x21e)]('\x20\x20Cause:\x20'+_0x3d3b12[_0x237d3a(0x1cf)]),0x1;throw _0x3d3b12;}}}export class SegmentFolderCreateCommand extends BaseCommand{[a28_0xfea2b9(0x1e6)]=a28_0xfea2b9(0x226);[a28_0xfea2b9(0x236)]=a28_0xfea2b9(0x205);async['execute'](_0x2b9afb){const _0x38bba6=a28_0xfea2b9,{options:_0xb599c4,args:_0x4d4cd5,tdx:_0x540318}=_0x2b9afb,_0x19a357=_0xb599c4;if(_0x4d4cd5[_0x38bba6(0x1c1)]<0x2)return console['error'](_0x38bba6(0x206)),console[_0x38bba6(0x21e)](_0x38bba6(0x1d7)),0x1;const _0x41aa58=_0x4d4cd5[0x0],_0x556cd0=_0x4d4cd5[0x1];_0x19a357['verbose']&&(console[_0x38bba6(0x21e)](_0x38bba6(0x1bf)+_0x19a357[_0x38bba6(0x1b5)]),console[_0x38bba6(0x21e)](_0x38bba6(0x22a)+_0x41aa58),console[_0x38bba6(0x21e)](_0x38bba6(0x1b9)+_0x556cd0));let _0x4851b9;if(_0x19a357[_0x38bba6(0x1c5)]){const _0x86943c=_0x19a357[_0x38bba6(0x1c5)],_0x302c20=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x41aa58+_0x38bba6(0x1f5),()=>_0x540318[_0x38bba6(0x203)]['resolveParentId'](_0x41aa58),{'verbose':_0x19a357[_0x38bba6(0x1e9)]}),_0x132665=_0x302c20[_0x38bba6(0x1b0)],_0x2e3d71=await withSpinner(_0x38bba6(0x1da)+_0x86943c+_0x38bba6(0x1f5),()=>_0x540318[_0x38bba6(0x203)][_0x38bba6(0x1dd)](_0x132665,_0x86943c),{'verbose':_0x19a357['verbose']});_0x4851b9=_0x2e3d71['data'],_0x19a357['verbose']&&console['error'](_0x38bba6(0x1f8)+_0x4851b9);}const _0x33ba5f={'name':_0x556cd0,'description':_0x19a357['description'],'parentFolderId':_0x4851b9},_0x1b1dc3=await withSpinner(_0x38bba6(0x1d0)+_0x556cd0+_0x38bba6(0x1f5),()=>_0x540318[_0x38bba6(0x203)][_0x38bba6(0x20a)](_0x41aa58,_0x33ba5f),{'verbose':_0x19a357[_0x38bba6(0x1e9)]}),_0x203866=_0x1b1dc3[_0x38bba6(0x1b0)];return console[_0x38bba6(0x21e)](_0x38bba6(0x1f0)+_0x203866[_0x38bba6(0x1e6)]+_0x38bba6(0x1ab)+_0x203866['id']),await handleSDKOutput([_0x203866],_0x19a357),0x0;}}export class SegmentViewCommand extends BaseCommand{[a28_0xfea2b9(0x1e6)]='segment:view';[a28_0xfea2b9(0x236)]=a28_0xfea2b9(0x1be);async[a28_0xfea2b9(0x1cc)](_0x343954){const _0x19f3b3=a28_0xfea2b9,{options:_0x5a0583,args:_0xe38ffa,tdx:_0x5cdd79}=_0x343954,_0x206970=_0xe38ffa[0x0];if(!_0x206970)return console[_0x19f3b3(0x21e)](_0x19f3b3(0x22e)),console[_0x19f3b3(0x21e)](_0x19f3b3(0x200)),console[_0x19f3b3(0x21e)](_0x19f3b3(0x20d)),console['error']('Options:'),console[_0x19f3b3(0x21e)]('\x20\x20-w,\x20--web\x20\x20Open\x20segment\x20in\x20web\x20browser'),console[_0x19f3b3(0x21e)](_0x19f3b3(0x1fd)),console[_0x19f3b3(0x21e)](_0x19f3b3(0x1cb)),console[_0x19f3b3(0x21e)]('\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20\x20\x20\x20\x20#\x20View\x20child\x20segment\x20details'),console[_0x19f3b3(0x21e)](_0x19f3b3(0x214)),console[_0x19f3b3(0x21e)](_0x19f3b3(0x1b3)),0x1;try{const _0x31dba0=_0x5a0583[_0x19f3b3(0x1d3)],_0x2639ed=await resolveSegmentTarget(_0x206970,_0x31dba0,_0x5a0583[_0x19f3b3(0x1e9)]);_0x5a0583[_0x19f3b3(0x1e9)]&&console[_0x19f3b3(0x21e)](_0x19f3b3(0x19c)+_0x2639ed);const _0x392cf1=await withSpinner('Resolving\x20\x27'+_0x206970+_0x19f3b3(0x1f5),()=>_0x5cdd79[_0x19f3b3(0x203)][_0x19f3b3(0x1d2)](_0x2639ed),{'verbose':_0x5a0583[_0x19f3b3(0x1e9)]}),_0x2bf988=_0x392cf1[_0x19f3b3(0x1b0)];_0x5a0583[_0x19f3b3(0x1e9)]&&(console[_0x19f3b3(0x21e)]('Resolved\x20type:\x20'+_0x2bf988[_0x19f3b3(0x1a0)]),console['error'](_0x19f3b3(0x1af)+_0x2bf988[_0x19f3b3(0x21f)]),_0x2bf988[_0x19f3b3(0x1a5)]&&console[_0x19f3b3(0x21e)]('Folder\x20ID:\x20'+_0x2bf988[_0x19f3b3(0x1a5)]),_0x2bf988['segmentId']&&console[_0x19f3b3(0x21e)](_0x19f3b3(0x1f4)+_0x2bf988['segmentId']));if(_0x5a0583[_0x19f3b3(0x1d8)]){if(_0x2bf988[_0x19f3b3(0x1a0)]===_0x19f3b3(0x1ec))return console[_0x19f3b3(0x21e)](_0x19f3b3(0x1ca)),0x1;if(_0x2bf988[_0x19f3b3(0x1a0)]==='parent')return console[_0x19f3b3(0x21e)]('Error:\x20Cannot\x20open\x20parent\x20segment\x20with\x20this\x20command.'),console[_0x19f3b3(0x21e)]('Use:\x20tdx\x20ps\x20view\x20-w'),0x1;if(!_0x2bf988[_0x19f3b3(0x22d)])throw new SDKError(ErrorCode[_0x19f3b3(0x218)],_0x19f3b3(0x211));const _0x392f31=getConsoleNextUrl(_0x5a0583[_0x19f3b3(0x1b5)],_0x19f3b3(0x231)+_0x2bf988[_0x19f3b3(0x21f)]+_0x19f3b3(0x1ad)+_0x2bf988[_0x19f3b3(0x22d)]);return console[_0x19f3b3(0x21e)](a28_0x2fa847['green']('✔')+'\x20Opening\x20'+a28_0x2fa847[_0x19f3b3(0x201)](_0x392f31)),openBrowser(_0x392f31),0x0;}if(_0x2bf988[_0x19f3b3(0x1a0)]===_0x19f3b3(0x1ec)){if(!_0x2bf988[_0x19f3b3(0x1a5)])throw new SDKError(ErrorCode[_0x19f3b3(0x1e1)],_0x19f3b3(0x1cd));const _0x5b4a8f=await withSpinner(_0x19f3b3(0x213),()=>_0x5cdd79[_0x19f3b3(0x203)][_0x19f3b3(0x1dc)](_0x2bf988[_0x19f3b3(0x1a5)]),{'verbose':_0x5a0583[_0x19f3b3(0x1e9)]});await handleSingleObjectOutput(_0x5b4a8f[_0x19f3b3(0x1b0)],_0x5a0583);}else{if(_0x2bf988[_0x19f3b3(0x1a0)]===_0x19f3b3(0x203)){if(!_0x2bf988[_0x19f3b3(0x22d)])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x19f3b3(0x211));const _0x181e60=await withSpinner(_0x19f3b3(0x233),()=>_0x5cdd79['segment'][_0x19f3b3(0x1de)](_0x2bf988[_0x19f3b3(0x21f)],_0x2bf988[_0x19f3b3(0x22d)]),{'verbose':_0x5a0583[_0x19f3b3(0x1e9)]}),_0x29ae9a=getConsoleNextUrl(_0x5a0583[_0x19f3b3(0x1b5)],_0x19f3b3(0x231)+_0x2bf988['parentId']+'/e/'+_0x2bf988[_0x19f3b3(0x22d)]),_0x1e9975=_0x181e60[_0x19f3b3(0x1b0)];_0x1e9975['url']=_0x29ae9a,await handleSingleObjectOutput(_0x1e9975,_0x5a0583);}else return console[_0x19f3b3(0x21e)](_0x19f3b3(0x1eb)),console[_0x19f3b3(0x21e)](_0x19f3b3(0x20b)),0x1;}return 0x0;}catch(_0x1881fc){if(_0x1881fc instanceof SDKError)return console[_0x19f3b3(0x21e)](_0x19f3b3(0x222)+_0x1881fc[_0x19f3b3(0x230)]),_0x1881fc[_0x19f3b3(0x1cf)]&&console['error'](_0x19f3b3(0x1d1)+_0x1881fc[_0x19f3b3(0x1cf)]),0x1;throw _0x1881fc;}}}export const SegmentInfoCommand=SegmentViewCommand;export class SegmentDescCommand extends BaseCommand{['name']=a28_0xfea2b9(0x1df);[a28_0xfea2b9(0x236)]=a28_0xfea2b9(0x20c);async[a28_0xfea2b9(0x1cc)](_0x268817){const _0x51cdac=a28_0xfea2b9,{options:_0x3265ab,args:_0x125785,tdx:_0x95d1ce}=_0x268817,_0x4bbdd7=_0x125785[0x0];if(!_0x4bbdd7)return console[_0x51cdac(0x21e)](_0x51cdac(0x1ee)),console['error']('Usage:\x20tdx\x20sg\x20desc\x20<name>'),console['error'](_0x51cdac(0x1d4)),console[_0x51cdac(0x21e)]('Examples:'),console[_0x51cdac(0x21e)](_0x51cdac(0x204)),console['error'](_0x51cdac(0x207)),0x1;try{const _0x2ee31f=_0x3265ab[_0x51cdac(0x1d3)],_0x482fa9=await resolveSegmentTarget(_0x4bbdd7,_0x2ee31f,_0x3265ab[_0x51cdac(0x1e9)]);_0x3265ab[_0x51cdac(0x1e9)]&&console[_0x51cdac(0x21e)]('Target\x20path:\x20'+_0x482fa9);const _0x1bd847=await withSpinner(_0x51cdac(0x1c8)+_0x4bbdd7+_0x51cdac(0x1f5),()=>_0x95d1ce[_0x51cdac(0x203)][_0x51cdac(0x1d2)](_0x482fa9),{'verbose':_0x3265ab[_0x51cdac(0x1e9)]}),_0x57d35d=_0x1bd847['data'];_0x3265ab['verbose']&&(console[_0x51cdac(0x21e)](_0x51cdac(0x212)+_0x57d35d[_0x51cdac(0x1a0)]),console[_0x51cdac(0x21e)]('Parent\x20ID:\x20'+_0x57d35d[_0x51cdac(0x21f)]));if(_0x57d35d[_0x51cdac(0x1a0)]===_0x51cdac(0x1ec))return console['error'](_0x51cdac(0x1c6)),console[_0x51cdac(0x21e)](_0x51cdac(0x21a)),0x1;if(_0x57d35d['type']===_0x51cdac(0x1f2))return console[_0x51cdac(0x21e)](_0x51cdac(0x1fa)),console['error'](_0x51cdac(0x20e)),0x1;if(!_0x57d35d[_0x51cdac(0x22d)])throw new SDKError(ErrorCode[_0x51cdac(0x218)],_0x51cdac(0x211));const _0x88a1fb=await withSpinner(_0x51cdac(0x232),()=>_0x95d1ce['segment'][_0x51cdac(0x19e)](_0x57d35d[_0x51cdac(0x21f)],_0x57d35d['segmentId']),{'verbose':_0x3265ab[_0x51cdac(0x1e9)]}),_0x59d8d2=_0x88a1fb[_0x51cdac(0x1b0)],_0x5ca07d=await executeSchemaQuery(_0x59d8d2,_0x95d1ce,_0x3265ab);return await handleQueryOutput(_0x5ca07d,_0x3265ab),0x0;}catch(_0x3f33ea){if(_0x3f33ea instanceof SDKError)return console[_0x51cdac(0x21e)](_0x51cdac(0x222)+_0x3f33ea[_0x51cdac(0x230)]),_0x3f33ea[_0x51cdac(0x1cf)]&&console[_0x51cdac(0x21e)]('\x20\x20Cause:\x20'+_0x3f33ea[_0x51cdac(0x1cf)]),0x1;throw _0x3f33ea;}}}
@@ -1 +1 @@
1
- const a29_0x394f27=a29_0x3b27;function a29_0x3b27(_0xd043e0,_0x20c29d){_0xd043e0=_0xd043e0-0x171;const _0x407270=a29_0x4072();let _0x3b2727=_0x407270[_0xd043e0];return _0x3b2727;}(function(_0x5a943e,_0xb73640){const _0x5469cc=a29_0x3b27,_0xa51324=_0x5a943e();while(!![]){try{const _0x47f860=-parseInt(_0x5469cc(0x177))/0x1*(-parseInt(_0x5469cc(0x19c))/0x2)+-parseInt(_0x5469cc(0x182))/0x3*(-parseInt(_0x5469cc(0x196))/0x4)+-parseInt(_0x5469cc(0x195))/0x5*(-parseInt(_0x5469cc(0x1aa))/0x6)+-parseInt(_0x5469cc(0x179))/0x7+parseInt(_0x5469cc(0x17a))/0x8*(-parseInt(_0x5469cc(0x1a5))/0x9)+parseInt(_0x5469cc(0x1a1))/0xa+-parseInt(_0x5469cc(0x1a3))/0xb*(parseInt(_0x5469cc(0x18a))/0xc);if(_0x47f860===_0xb73640)break;else _0xa51324['push'](_0xa51324['shift']());}catch(_0x33a30d){_0xa51324['push'](_0xa51324['shift']());}}}(a29_0x4072,0xb82b1));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';function a29_0x4072(){const _0x5d0af6=['execute','name','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27','\x27\x20with\x20ID:\x20','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','Site:\x20','31513iCpGKD','Resolving\x20parent\x20segment\x20\x27','5713036fGkEyO','3088KRacLx','Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.','rule','resolveParentId','Resolved\x20folder\x20ID:\x20','✔\x20Created\x20segment\x20\x27','Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]','type','3EUCmnq','Resolved\x20relative\x20path\x20to:\x20','segment:create','folder','resolvePathToResource','kind','\x27...','Resolving\x20folder\x20path\x20\x27','12NTUrrL','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27','resolveFolderId','data','Resolving\x20folder\x20\x27','length','description','Examples:','Parent:\x20','error','segment','3025925YvHkIn','2177044uHaDIN','Creating\x20segment\x20\x27','site','verbose','includes','parent','54SFoXgf','\x20\x20\x20Path:\x20','Create\x20child\x20segment\x20with\x20filtering\x20rules','createSegment','Target\x20path:\x20','910160EJEezA','Parent\x20path:\x20','6118871wuISbQ','Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)','13284ZCQDEH','yellow','segments','invisible','segmentPath','12WQbdwm','noCountPopulation','Segment\x20name:\x20'];a29_0x4072=function(){return _0x5d0af6;};return a29_0x4072();}import a29_0x2b188 from'chalk';export class SegmentCreateCommand extends BaseCommand{[a29_0x394f27(0x172)]=a29_0x394f27(0x184);[a29_0x394f27(0x190)]=a29_0x394f27(0x19e);async[a29_0x394f27(0x171)](_0x162a81){const _0x3b04b4=a29_0x394f27;console[_0x3b04b4(0x193)](a29_0x2b188['yellow']('⚠\x20Deprecation\x20warning:\x20`segment\x20create`\x20is\x20deprecated.')),console[_0x3b04b4(0x193)](a29_0x2b188[_0x3b04b4(0x1a6)](_0x3b04b4(0x175)));const {options:_0x4082c3,args:_0x498197,tdx:_0x297f32}=_0x162a81,_0x39de1f=_0x4082c3;if(_0x498197['length']===0x0)return console[_0x3b04b4(0x193)]('Error:\x20Segment\x20path\x20or\x20name\x20is\x20required'),console['error'](_0x3b04b4(0x180)),console[_0x3b04b4(0x193)](_0x3b04b4(0x191)),console['error'](_0x3b04b4(0x173)),console[_0x3b04b4(0x193)](_0x3b04b4(0x18b)),console[_0x3b04b4(0x193)]('\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context'),0x1;const _0x224a32=_0x498197[0x0],_0x72df4b=_0x4082c3[_0x3b04b4(0x1a9)];let _0x368ae1=_0x224a32;_0x72df4b&&!_0x224a32[_0x3b04b4(0x19a)]('/')&&(_0x368ae1=_0x72df4b+'/'+_0x224a32,_0x39de1f['verbose']&&console[_0x3b04b4(0x193)](_0x3b04b4(0x183)+_0x368ae1));const _0x50bb7b=parsePath(_0x368ae1);if(_0x50bb7b[_0x3b04b4(0x1a7)][_0x3b04b4(0x18f)]<0x2)return console[_0x3b04b4(0x193)](_0x3b04b4(0x1a4)),console['error']('Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]'),0x1;const _0xdb508=_0x50bb7b[_0x3b04b4(0x1a7)][0x0],_0x225648=getBaseName(_0x368ae1),_0x63caa3=getParentPath(_0x368ae1);_0x39de1f['verbose']&&(console[_0x3b04b4(0x193)](_0x3b04b4(0x176)+_0x39de1f[_0x3b04b4(0x198)]),console[_0x3b04b4(0x193)](_0x3b04b4(0x1a0)+_0x368ae1),console['error'](_0x3b04b4(0x192)+_0xdb508),console[_0x3b04b4(0x193)](_0x3b04b4(0x1ac)+_0x225648),console['error'](_0x3b04b4(0x1a2)+_0x63caa3));const _0x3abd0b=await withSpinner(_0x3b04b4(0x178)+_0xdb508+_0x3b04b4(0x188),()=>_0x297f32[_0x3b04b4(0x194)][_0x3b04b4(0x17d)](_0xdb508),{'verbose':_0x39de1f[_0x3b04b4(0x199)]}),_0x1a56a1=_0x3abd0b['data'];let _0x5f4171;if(_0x50bb7b['segments'][_0x3b04b4(0x18f)]>0x2){const _0x5ac250=await withSpinner(_0x3b04b4(0x189)+_0x63caa3+'\x27...',()=>_0x297f32['segment'][_0x3b04b4(0x186)](_0x63caa3),{'verbose':_0x39de1f[_0x3b04b4(0x199)]}),_0x46f927=_0x5ac250['data'];if(_0x46f927[_0x3b04b4(0x181)]!==_0x3b04b4(0x185)&&_0x46f927['type']!==_0x3b04b4(0x19b))return console['error'](_0x3b04b4(0x17b)),0x1;_0x5f4171=_0x46f927['folderId'];}else{if(_0x39de1f['folder']){const _0xd5de62=await withSpinner(_0x3b04b4(0x18e)+_0x39de1f[_0x3b04b4(0x185)]+'\x27...',()=>_0x297f32[_0x3b04b4(0x194)][_0x3b04b4(0x18c)](_0x1a56a1,_0x39de1f['folder']),{'verbose':_0x39de1f['verbose']});_0x5f4171=_0xd5de62[_0x3b04b4(0x18d)];}}_0x39de1f[_0x3b04b4(0x199)]&&_0x5f4171&&console[_0x3b04b4(0x193)](_0x3b04b4(0x17e)+_0x5f4171);const _0x3199ae=await loadJSONFromOptions(_0x39de1f[_0x3b04b4(0x17c)],_0x39de1f['ruleFile']),_0x2bf1ab={'name':_0x225648,'description':_0x39de1f[_0x3b04b4(0x190)],'rule':_0x3199ae,'kind':_0x39de1f[_0x3b04b4(0x187)]!==undefined?parseInt(_0x39de1f['kind'],0xa):undefined,'isVisible':_0x39de1f[_0x3b04b4(0x1a8)]?![]:undefined,'segmentFolderId':_0x5f4171,'countPopulation':_0x39de1f[_0x3b04b4(0x1ab)]?![]:undefined},_0x4f7cbd=await withSpinner(_0x3b04b4(0x197)+_0x225648+_0x3b04b4(0x188),()=>_0x297f32[_0x3b04b4(0x194)][_0x3b04b4(0x19f)](_0x1a56a1,_0x2bf1ab),{'verbose':_0x39de1f[_0x3b04b4(0x199)]}),_0x189e19=_0x4f7cbd['data'];return console[_0x3b04b4(0x193)](_0x3b04b4(0x17f)+_0x189e19[_0x3b04b4(0x172)]+_0x3b04b4(0x174)+_0x189e19['id']),_0x368ae1!==_0x224a32&&console[_0x3b04b4(0x193)](_0x3b04b4(0x19d)+_0x368ae1),await handleSDKOutput([_0x189e19],_0x39de1f),0x0;}}
1
+ function a29_0x28d9(){const _0x3e0f7c=['\x20\x20\x20Path:\x20','Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.','114112kuCjym','Resolved\x20relative\x20path\x20to:\x20','verbose','Parent\x20path:\x20','description','Parent:\x20','375fmgjgs','segment','Site:\x20','name','\x27...','Examples:','segmentPath','kind','✔\x20Created\x20segment\x20\x27','resolveParentId','Target\x20path:\x20','segment:create','Segment\x20name:\x20','231882AXrpor','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27','folder','Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]','rule','Resolved\x20folder\x20ID:\x20','Resolving\x20parent\x20segment\x20\x27','6mCvUWe','Resolving\x20folder\x20path\x20\x27','ruleFile','data','length','3785928RFDDFZ','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','403291mPezIv','noCountPopulation','26736AAoqqo','createSegment','type','error','site','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','⚠\x20Deprecation\x20warning:\x20`segment\x20create`\x20is\x20deprecated.','830mkOmFU','segments','1719117YTqrKC','yellow','folderId','103563dsITVY','Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]','parent','resolvePathToResource'];a29_0x28d9=function(){return _0x3e0f7c;};return a29_0x28d9();}function a29_0x5a63(_0xdbe01d,_0x2b4c3e){_0xdbe01d=_0xdbe01d-0x185;const _0x28d974=a29_0x28d9();let _0x5a63d3=_0x28d974[_0xdbe01d];return _0x5a63d3;}const a29_0x474677=a29_0x5a63;(function(_0x2e93d5,_0x22e9f7){const _0x1a3f38=a29_0x5a63,_0x4d7f40=_0x2e93d5();while(!![]){try{const _0x1934c7=-parseInt(_0x1a3f38(0x18d))/0x1*(parseInt(_0x1a3f38(0x1a8))/0x2)+parseInt(_0x1a3f38(0x19f))/0x3+-parseInt(_0x1a3f38(0x196))/0x4*(parseInt(_0x1a3f38(0x1ae))/0x5)+parseInt(_0x1a3f38(0x186))/0x6+parseInt(_0x1a3f38(0x194))/0x7+-parseInt(_0x1a3f38(0x192))/0x8+parseInt(_0x1a3f38(0x1a2))/0x9*(parseInt(_0x1a3f38(0x19d))/0xa);if(_0x1934c7===_0x22e9f7)break;else _0x4d7f40['push'](_0x4d7f40['shift']());}catch(_0x22defa){_0x4d7f40['push'](_0x4d7f40['shift']());}}}(a29_0x28d9,0x4b12f));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 a29_0x2edec2 from'chalk';export class SegmentCreateCommand extends BaseCommand{[a29_0x474677(0x1b1)]=a29_0x474677(0x1b9);[a29_0x474677(0x1ac)]='Create\x20child\x20segment\x20with\x20filtering\x20rules';async['execute'](_0x5cf47f){const _0x5b9a46=a29_0x474677;console[_0x5b9a46(0x199)](a29_0x2edec2[_0x5b9a46(0x1a0)](_0x5b9a46(0x19c))),console[_0x5b9a46(0x199)](a29_0x2edec2[_0x5b9a46(0x1a0)](_0x5b9a46(0x193)));const {options:_0x213639,args:_0x326bdf,tdx:_0x130ee3}=_0x5cf47f,_0x4b64f1=_0x213639;if(_0x326bdf[_0x5b9a46(0x191)]===0x0)return console[_0x5b9a46(0x199)](_0x5b9a46(0x19b)),console[_0x5b9a46(0x199)](_0x5b9a46(0x1a3)),console[_0x5b9a46(0x199)](_0x5b9a46(0x1b3)),console[_0x5b9a46(0x199)](_0x5b9a46(0x187)),console['error']('\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27'),console[_0x5b9a46(0x199)]('\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context'),0x1;const _0x1a8afc=_0x326bdf[0x0],_0x38ada2=_0x213639[_0x5b9a46(0x1b4)];let _0x58416e=_0x1a8afc;_0x38ada2&&!_0x1a8afc['includes']('/')&&(_0x58416e=_0x38ada2+'/'+_0x1a8afc,_0x4b64f1['verbose']&&console[_0x5b9a46(0x199)](_0x5b9a46(0x1a9)+_0x58416e));const _0x334998=parsePath(_0x58416e);if(_0x334998[_0x5b9a46(0x19e)][_0x5b9a46(0x191)]<0x2)return console[_0x5b9a46(0x199)]('Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)'),console[_0x5b9a46(0x199)](_0x5b9a46(0x189)),0x1;const _0x19f28a=_0x334998[_0x5b9a46(0x19e)][0x0],_0x19a2a3=getBaseName(_0x58416e),_0x467fe5=getParentPath(_0x58416e);_0x4b64f1[_0x5b9a46(0x1aa)]&&(console[_0x5b9a46(0x199)](_0x5b9a46(0x1b0)+_0x4b64f1[_0x5b9a46(0x19a)]),console[_0x5b9a46(0x199)](_0x5b9a46(0x1b8)+_0x58416e),console['error'](_0x5b9a46(0x1ad)+_0x19f28a),console[_0x5b9a46(0x199)](_0x5b9a46(0x185)+_0x19a2a3),console[_0x5b9a46(0x199)](_0x5b9a46(0x1ab)+_0x467fe5));const _0x42cf45=await withSpinner(_0x5b9a46(0x18c)+_0x19f28a+'\x27...',()=>_0x130ee3[_0x5b9a46(0x1af)][_0x5b9a46(0x1b7)](_0x19f28a),{'verbose':_0x4b64f1[_0x5b9a46(0x1aa)]}),_0xf1a7e3=_0x42cf45[_0x5b9a46(0x190)];let _0x358485;if(_0x334998['segments'][_0x5b9a46(0x191)]>0x2){const _0x1bdd6c=await withSpinner(_0x5b9a46(0x18e)+_0x467fe5+_0x5b9a46(0x1b2),()=>_0x130ee3[_0x5b9a46(0x1af)][_0x5b9a46(0x1a5)](_0x467fe5),{'verbose':_0x4b64f1[_0x5b9a46(0x1aa)]}),_0x1b3439=_0x1bdd6c[_0x5b9a46(0x190)];if(_0x1b3439[_0x5b9a46(0x198)]!=='folder'&&_0x1b3439['type']!==_0x5b9a46(0x1a4))return console[_0x5b9a46(0x199)](_0x5b9a46(0x1a7)),0x1;_0x358485=_0x1b3439[_0x5b9a46(0x1a1)];}else{if(_0x4b64f1[_0x5b9a46(0x188)]){const _0x4a9a93=await withSpinner('Resolving\x20folder\x20\x27'+_0x4b64f1[_0x5b9a46(0x188)]+_0x5b9a46(0x1b2),()=>_0x130ee3[_0x5b9a46(0x1af)]['resolveFolderId'](_0xf1a7e3,_0x4b64f1[_0x5b9a46(0x188)]),{'verbose':_0x4b64f1[_0x5b9a46(0x1aa)]});_0x358485=_0x4a9a93[_0x5b9a46(0x190)];}}_0x4b64f1['verbose']&&_0x358485&&console[_0x5b9a46(0x199)](_0x5b9a46(0x18b)+_0x358485);const _0x1676bc=await loadJSONFromOptions(_0x4b64f1[_0x5b9a46(0x18a)],_0x4b64f1[_0x5b9a46(0x18f)]),_0x37c0a6={'name':_0x19a2a3,'description':_0x4b64f1['description'],'rule':_0x1676bc,'kind':_0x4b64f1[_0x5b9a46(0x1b5)]!==undefined?parseInt(_0x4b64f1['kind'],0xa):undefined,'isVisible':_0x4b64f1['invisible']?![]:undefined,'segmentFolderId':_0x358485,'countPopulation':_0x4b64f1[_0x5b9a46(0x195)]?![]:undefined},_0x4242a7=await withSpinner('Creating\x20segment\x20\x27'+_0x19a2a3+_0x5b9a46(0x1b2),()=>_0x130ee3[_0x5b9a46(0x1af)][_0x5b9a46(0x197)](_0xf1a7e3,_0x37c0a6),{'verbose':_0x4b64f1[_0x5b9a46(0x1aa)]}),_0x136221=_0x4242a7[_0x5b9a46(0x190)];return console[_0x5b9a46(0x199)](_0x5b9a46(0x1b6)+_0x136221[_0x5b9a46(0x1b1)]+'\x27\x20with\x20ID:\x20'+_0x136221['id']),_0x58416e!==_0x1a8afc&&console[_0x5b9a46(0x199)](_0x5b9a46(0x1a6)+_0x58416e),await handleSDKOutput([_0x136221],_0x4b64f1),0x0;}}
@@ -1 +1 @@
1
- const a30_0x2da84a=a30_0x28b5;(function(_0x34d471,_0x4129fe){const _0x17ad2c=a30_0x28b5,_0x156b7d=_0x34d471();while(!![]){try{const _0x4b9efa=parseInt(_0x17ad2c(0x140))/0x1+parseInt(_0x17ad2c(0x149))/0x2+-parseInt(_0x17ad2c(0x135))/0x3*(parseInt(_0x17ad2c(0x142))/0x4)+parseInt(_0x17ad2c(0x139))/0x5+-parseInt(_0x17ad2c(0x13b))/0x6*(parseInt(_0x17ad2c(0x14f))/0x7)+-parseInt(_0x17ad2c(0x137))/0x8*(parseInt(_0x17ad2c(0x145))/0x9)+parseInt(_0x17ad2c(0x13e))/0xa;if(_0x4b9efa===_0x4129fe)break;else _0x156b7d['push'](_0x156b7d['shift']());}catch(_0x499908){_0x156b7d['push'](_0x156b7d['shift']());}}}(a30_0x5043,0x5471e));import{BaseCommand}from'./command.js';function a30_0x5043(){const _0x2693dd=['verbose','1198932ZUlLAF','description','\x20field','\x27...','error','execute','2552032mwLNLN','3405BLnCDs','Listing\x20fields\x20for\x20\x27','48280ONoXqf','segment:fields','652590sEvcen','Parent\x20segment:\x20','6RGYfoP','listFields','List\x20available\x20fields\x20for\x20segmentation','794240PLnfSW','name','641914PEfzgt','✔\x20Found\x20','952GifMKm','Usage:\x20tdx\x20segment\x20fields\x20<parent_name>','jsonl','702FqIeXl','Error:\x20Parent\x20segment\x20name\x20is\x20required','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>'];a30_0x5043=function(){return _0x2693dd;};return a30_0x5043();}import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{displayFieldsHumanReadable}from'../sdk/segment/fields-display.js';function a30_0x28b5(_0x323b30,_0x3b0bb2){_0x323b30=_0x323b30-0x135;const _0x504349=a30_0x5043();let _0x28b57c=_0x504349[_0x323b30];return _0x28b57c;}export class SegmentFieldsCommand extends BaseCommand{[a30_0x2da84a(0x13f)]=a30_0x2da84a(0x138);[a30_0x2da84a(0x14a)]=a30_0x2da84a(0x13d);async[a30_0x2da84a(0x14e)](_0x57253d){const _0x32c3c3=a30_0x2da84a,{options:_0x14c289,args:_0x21cb22,tdx:_0x584a46}=_0x57253d,_0x219b75=_0x21cb22[0x0]||_0x14c289['parentSegment'];if(!_0x219b75)return console[_0x32c3c3(0x14d)](_0x32c3c3(0x146)),console[_0x32c3c3(0x14d)](_0x32c3c3(0x143)),console['error'](_0x32c3c3(0x147)),0x1;_0x14c289[_0x32c3c3(0x148)]&&(console[_0x32c3c3(0x14d)]('Site:\x20'+_0x14c289['site']),console[_0x32c3c3(0x14d)](_0x32c3c3(0x13a)+_0x219b75));const _0x49ac3e=await withSpinner(_0x32c3c3(0x136)+_0x219b75+_0x32c3c3(0x14c),()=>_0x584a46['segment'][_0x32c3c3(0x13c)](_0x219b75),{'verbose':_0x14c289[_0x32c3c3(0x148)]}),_0x336e06=_0x49ac3e['data'];console[_0x32c3c3(0x14d)](_0x32c3c3(0x141)+_0x336e06['length']+_0x32c3c3(0x14b)+(_0x336e06['length']!==0x1?'s':''));if(_0x14c289['json']||_0x14c289[_0x32c3c3(0x144)])return await handleSDKOutput(_0x336e06,_0x14c289),0x0;return displayFieldsHumanReadable(_0x336e06,_0x219b75),0x0;}}
1
+ function a30_0x3acb(_0x4948e5,_0x255d0d){_0x4948e5=_0x4948e5-0x130;const _0x2acddb=a30_0x2acd();let _0x3acb08=_0x2acddb[_0x4948e5];return _0x3acb08;}const a30_0x43e214=a30_0x3acb;(function(_0x241582,_0x3eded2){const _0x1e3620=a30_0x3acb,_0x22623f=_0x241582();while(!![]){try{const _0x1b97f9=parseInt(_0x1e3620(0x137))/0x1+parseInt(_0x1e3620(0x13d))/0x2+parseInt(_0x1e3620(0x142))/0x3+-parseInt(_0x1e3620(0x148))/0x4+parseInt(_0x1e3620(0x141))/0x5*(parseInt(_0x1e3620(0x146))/0x6)+-parseInt(_0x1e3620(0x133))/0x7*(-parseInt(_0x1e3620(0x14b))/0x8)+-parseInt(_0x1e3620(0x14a))/0x9*(parseInt(_0x1e3620(0x13b))/0xa);if(_0x1b97f9===_0x3eded2)break;else _0x22623f['push'](_0x22623f['shift']());}catch(_0x5bb90c){_0x22623f['push'](_0x22623f['shift']());}}}(a30_0x2acd,0xa2a81));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';function a30_0x2acd(){const _0x26ed05=['site','verbose','name','292932Bxvxty','Site:\x20','Listing\x20fields\x20for\x20\x27','data','20dRIStx','List\x20available\x20fields\x20for\x20segmentation','292942ZCdrVC','segment','length','segment:fields','5TvFade','1280712mvNoBY','description','json','\x27...','6627918jqGUBc','Error:\x20Parent\x20segment\x20name\x20is\x20required','471732Xjmpsl','parentSegment','9170721csMrdr','64VejexM','execute','error','jsonl','744758YhsijO'];a30_0x2acd=function(){return _0x26ed05;};return a30_0x2acd();}import{withSpinner}from'../utils/spinner.js';import{displayFieldsHumanReadable}from'../sdk/segment/fields-display.js';export class SegmentFieldsCommand extends BaseCommand{[a30_0x43e214(0x136)]=a30_0x43e214(0x140);[a30_0x43e214(0x143)]=a30_0x43e214(0x13c);async[a30_0x43e214(0x130)](_0x3711dd){const _0x382040=a30_0x43e214,{options:_0x4d080f,args:_0x3c6663,tdx:_0x1379e5}=_0x3711dd,_0x3ec3f7=_0x3c6663[0x0]||_0x4d080f[_0x382040(0x149)];if(!_0x3ec3f7)return console[_0x382040(0x131)](_0x382040(0x147)),console['error']('Usage:\x20tdx\x20segment\x20fields\x20<parent_name>'),console[_0x382040(0x131)]('\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>'),0x1;_0x4d080f[_0x382040(0x135)]&&(console[_0x382040(0x131)](_0x382040(0x138)+_0x4d080f[_0x382040(0x134)]),console[_0x382040(0x131)]('Parent\x20segment:\x20'+_0x3ec3f7));const _0x5b0154=await withSpinner(_0x382040(0x139)+_0x3ec3f7+_0x382040(0x145),()=>_0x1379e5[_0x382040(0x13e)]['listFields'](_0x3ec3f7),{'verbose':_0x4d080f[_0x382040(0x135)]}),_0x5e07e8=_0x5b0154[_0x382040(0x13a)];console[_0x382040(0x131)]('✔\x20Found\x20'+_0x5e07e8['length']+'\x20field'+(_0x5e07e8[_0x382040(0x13f)]!==0x1?'s':''));if(_0x4d080f[_0x382040(0x144)]||_0x4d080f[_0x382040(0x132)])return await handleSDKOutput(_0x5e07e8,_0x4d080f),0x0;return displayFieldsHumanReadable(_0x5e07e8,_0x3ec3f7),0x0;}}
@@ -1 +1 @@
1
- const a31_0x3121f0=a31_0x1927;(function(_0x35ea79,_0x1e5d31){const _0x4f1c2a=a31_0x1927,_0x142266=_0x35ea79();while(!![]){try{const _0x2dcbde=-parseInt(_0x4f1c2a(0x1f8))/0x1+parseInt(_0x4f1c2a(0x207))/0x2*(-parseInt(_0x4f1c2a(0x210))/0x3)+-parseInt(_0x4f1c2a(0x208))/0x4*(parseInt(_0x4f1c2a(0x1ef))/0x5)+-parseInt(_0x4f1c2a(0x1f0))/0x6+-parseInt(_0x4f1c2a(0x1f4))/0x7*(-parseInt(_0x4f1c2a(0x211))/0x8)+parseInt(_0x4f1c2a(0x212))/0x9*(parseInt(_0x4f1c2a(0x20d))/0xa)+-parseInt(_0x4f1c2a(0x220))/0xb*(-parseInt(_0x4f1c2a(0x21b))/0xc);if(_0x2dcbde===_0x1e5d31)break;else _0x142266['push'](_0x142266['shift']());}catch(_0x27712f){_0x142266['push'](_0x142266['shift']());}}}(a31_0x373a,0xa4dc1));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 a31_0x5cc9f7 from'chalk';function a31_0x373a(){const _0x2ef6ce=['✔\x20Context\x20set:\x20','content','name','Site:\x20','diff','no_parent','parentSegment','\x0aChanges\x20to\x20\x27','segment','absolutePath','\x20files\x20to\x20','\x20\x20Target:\x20','site','\x20\x20🗺️\x20\x20','files','hasChanges','error','235xkMSiW','1479252uaqsfJ','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','isNew','setPhase','91RqBSCX','dryRun','Pulling\x20segments\x20from\x20\x27','\x20unchanged\x20files','1317072mQqkwF','red','helpText','✔\x20Pulled\x20','length','session','segments','dim','\x20=\x20','errorCode','cyan','\x20files?','description','Error:\x20','\x27...','39868wElaVL','106044BABfUF','parentName','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)','\x20with\x20','journeyVersions','160010KVfKBy','\x20new\x20files','\x20changed\x20files','6pOolSm','234344LGJKvN','351CbqQYJ','green','\x0aPull\x20summary\x20for\x20\x27','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file','Parent\x20segment:\x20','verbose','repeat','message','Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files','359988pPCcoY','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','Aborted.','\x20activations','filter','924wxtfTJ','-\x20no\x20files\x20written','counts','utf-8','targetDir','yes','\x20segments','relativePath','✔\x20All\x20files\x20are\x20up\x20to\x20date','data','execute','No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27','journeys','type','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent','Target\x20resource:\x20','\x0aError:','dirname','yellow'];a31_0x373a=function(){return _0x2ef6ce;};return a31_0x373a();}import{existsSync,mkdirSync,writeFileSync}from'fs';import a31_0x1e6ec9 from'path';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';export{buildFolderIdToPathMap as buildFolderPathMap}from'../sdk/segment/resolution-context.js';function a31_0x1927(_0x27273f,_0x2cddf4){_0x27273f=_0x27273f-0x1e3;const _0x373a58=a31_0x373a();let _0x1927c7=_0x373a58[_0x27273f];return _0x1927c7;}export class SegmentPullCommand extends BaseCommand{[a31_0x3121f0(0x235)]='segment:pull';[a31_0x3121f0(0x204)]=a31_0x3121f0(0x21a);async[a31_0x3121f0(0x22a)](_0x3ac912){const _0x514297=a31_0x3121f0,{options:_0x4440ef,args:_0x1c11e4,tdx:_0x65df63}=_0x3ac912,_0x1355af=_0x4440ef,_0x2e3936=await resolveTarget({'arg':_0x1c11e4[0x0],'contextParent':_0x4440ef[_0x514297(0x1e4)],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x2e3936))return _0x2e3936[_0x514297(0x201)]===_0x514297(0x1e3)?(console[_0x514297(0x1ee)](a31_0x5cc9f7[_0x514297(0x232)]('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console['error'](_0x514297(0x20a)),console[_0x514297(0x1ee)](_0x514297(0x22e)),console[_0x514297(0x1ee)](_0x514297(0x215))):(console[_0x514297(0x1ee)](a31_0x5cc9f7[_0x514297(0x1f9)](_0x514297(0x205)+_0x2e3936[_0x514297(0x219)]+'\x0a')),_0x2e3936[_0x514297(0x1fa)]&&console[_0x514297(0x1ee)](a31_0x5cc9f7[_0x514297(0x202)](_0x2e3936[_0x514297(0x1fa)]))),0x1;const _0x1a40bf=_0x2e3936[_0x514297(0x209)],_0x568056=_0x2e3936[_0x514297(0x224)],_0xfb3669=_0x2e3936[_0x514297(0x22d)]==='file'?_0x2e3936['resourceName']:undefined;_0x1355af[_0x514297(0x217)]&&(console[_0x514297(0x1ee)](_0x514297(0x236)+_0x1355af[_0x514297(0x1ea)]),console[_0x514297(0x1ee)](_0x514297(0x216)+_0x1a40bf),_0xfb3669&&console['error'](_0x514297(0x22f)+_0xfb3669));const _0x5f5c9e=await withProgressSpinner(_0x514297(0x1f6)+_0x1a40bf+_0x514297(0x206),_0x581581=>_0x65df63[_0x514297(0x1e6)]['pullSegments'](_0x1a40bf,{'targetDir':_0x568056,'targetResourceName':_0xfb3669,'verbose':_0x1355af[_0x514297(0x217)],'progress':{'update':_0x1cb10d=>{const _0xaa3829=_0x514297;_0x581581[_0xaa3829(0x1f3)](_0x1cb10d),_0x1355af['verbose']&&console['error']('\x20\x20'+_0x1cb10d);}}}),{'verbose':_0x1355af[_0x514297(0x217)]}),_0x2c0628=_0x5f5c9e[_0x514297(0x229)];if(_0x2c0628[_0x514297(0x222)]['segments']===0x0&&_0x2c0628[_0x514297(0x222)][_0x514297(0x22c)]===0x0)return console[_0x514297(0x1ee)](a31_0x5cc9f7[_0x514297(0x232)](_0x514297(0x22b)+_0x2c0628[_0x514297(0x209)]+'\x27')),0x0;const _0x566ed8=_0x2c0628['files']['filter'](_0x139149=>_0x139149['isNew']),_0x25b866=_0x2c0628[_0x514297(0x1ec)]['filter'](_0x58f2e7=>!_0x58f2e7[_0x514297(0x1f2)]&&_0x58f2e7[_0x514297(0x1ed)]),_0x273f39=_0x2c0628[_0x514297(0x1ec)][_0x514297(0x21f)](_0x4b7600=>!_0x4b7600[_0x514297(0x1f2)]&&!_0x4b7600[_0x514297(0x1ed)]);console[_0x514297(0x1ee)](_0x514297(0x214)+_0x2c0628[_0x514297(0x209)]+'\x27:'),console[_0x514297(0x1ee)]('\x20\x20🎯\x20'+a31_0x5cc9f7[_0x514297(0x202)](_0x2c0628['counts'][_0x514297(0x1fe)]+_0x514297(0x226))+_0x514297(0x20b)+a31_0x5cc9f7[_0x514297(0x202)](_0x2c0628[_0x514297(0x222)]['activations']+_0x514297(0x21e)));if(_0x2c0628[_0x514297(0x222)]['journeys']>0x0){const _0x23fccc=_0x2c0628['counts'][_0x514297(0x20c)]>_0x2c0628[_0x514297(0x222)]['journeys']?'\x20('+_0x2c0628[_0x514297(0x222)]['journeyVersions']+'\x20versions)':'';console[_0x514297(0x1ee)](_0x514297(0x1eb)+a31_0x5cc9f7['cyan'](_0x2c0628[_0x514297(0x222)][_0x514297(0x22c)]+'\x20journeys')+a31_0x5cc9f7['dim'](_0x23fccc));}console[_0x514297(0x1ee)]('\x20\x20'+a31_0x5cc9f7[_0x514297(0x213)]('+\x20'+_0x566ed8[_0x514297(0x1fc)]+_0x514297(0x20e))),console[_0x514297(0x1ee)]('\x20\x20'+a31_0x5cc9f7[_0x514297(0x232)]('~\x20'+_0x25b866[_0x514297(0x1fc)]+_0x514297(0x20f))),console[_0x514297(0x1ee)]('\x20\x20'+a31_0x5cc9f7[_0x514297(0x1ff)]('=\x20'+_0x273f39[_0x514297(0x1fc)]+_0x514297(0x1f7))),console['error'](_0x514297(0x1e9)+a31_0x5cc9f7[_0x514297(0x202)](_0x2c0628['targetDir'])+'\x0a');if(_0x25b866[_0x514297(0x1fc)]>0x0)for(const _0x1bf808 of _0x25b866){console[_0x514297(0x1ee)](_0x514297(0x1e5)+_0x1bf808[_0x514297(0x227)]+'\x27:'),console[_0x514297(0x1ee)]('─'[_0x514297(0x218)](0x3c)),console[_0x514297(0x1ee)](_0x1bf808[_0x514297(0x237)]),console['error']('─'[_0x514297(0x218)](0x3c));}if(_0x1355af[_0x514297(0x1f5)])return console[_0x514297(0x1ee)](a31_0x5cc9f7[_0x514297(0x232)](_0x514297(0x21c))),0x0;if(_0x566ed8[_0x514297(0x1fc)]===0x0&&_0x25b866['length']===0x0)return console['error'](a31_0x5cc9f7['green'](_0x514297(0x228))),saveSessionContext({'parent_segment':_0x2c0628[_0x514297(0x209)]},_0x1355af[_0x514297(0x1fd)]),console['error'](a31_0x5cc9f7[_0x514297(0x213)](_0x514297(0x233)+a31_0x5cc9f7[_0x514297(0x1ff)]('parent_segment')+_0x514297(0x200)+a31_0x5cc9f7['cyan'](_0x2c0628[_0x514297(0x209)]))),0x0;if(!_0x1355af[_0x514297(0x225)]){if(!isInteractive())return console[_0x514297(0x1ee)](a31_0x5cc9f7[_0x514297(0x1f9)](_0x514297(0x230)),_0x514297(0x1f1)),console[_0x514297(0x1ee)](a31_0x5cc9f7['dim']('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x1477c5=await confirmKey('Write\x20'+(_0x566ed8[_0x514297(0x1fc)]+_0x25b866[_0x514297(0x1fc)])+_0x514297(0x203));if(!_0x1477c5)return console[_0x514297(0x1ee)](a31_0x5cc9f7[_0x514297(0x232)](_0x514297(0x21d)),_0x514297(0x221)),0x1;}for(const _0x33b83c of _0x2c0628[_0x514297(0x1ec)]){if(_0x33b83c[_0x514297(0x1f2)]||_0x33b83c['hasChanges']){const _0x61bac3=a31_0x1e6ec9[_0x514297(0x231)](_0x33b83c[_0x514297(0x1e7)]);!existsSync(_0x61bac3)&&mkdirSync(_0x61bac3,{'recursive':!![]}),writeFileSync(_0x33b83c[_0x514297(0x1e7)],_0x33b83c[_0x514297(0x234)],_0x514297(0x223));}}return console['error'](a31_0x5cc9f7['green'](_0x514297(0x1fb)+(_0x566ed8[_0x514297(0x1fc)]+_0x25b866[_0x514297(0x1fc)])+_0x514297(0x1e8)+_0x2c0628[_0x514297(0x224)])),saveSessionContext({'parent_segment':_0x2c0628[_0x514297(0x209)]},_0x1355af[_0x514297(0x1fd)]),console[_0x514297(0x1ee)](a31_0x5cc9f7[_0x514297(0x213)]('✔\x20Context\x20set:\x20'+a31_0x5cc9f7['dim']('parent_segment')+'\x20=\x20'+a31_0x5cc9f7[_0x514297(0x202)](_0x2c0628[_0x514297(0x209)]))),0x0;}}
1
+ const a31_0x1f5227=a31_0x2222;(function(_0x137426,_0x351b23){const _0x2c99dd=a31_0x2222,_0x679ab9=_0x137426();while(!![]){try{const _0x239b7e=parseInt(_0x2c99dd(0xf3))/0x1*(parseInt(_0x2c99dd(0xeb))/0x2)+parseInt(_0x2c99dd(0xd0))/0x3+-parseInt(_0x2c99dd(0xfd))/0x4*(parseInt(_0x2c99dd(0xfc))/0x5)+-parseInt(_0x2c99dd(0xdb))/0x6+parseInt(_0x2c99dd(0xe8))/0x7*(parseInt(_0x2c99dd(0xc2))/0x8)+-parseInt(_0x2c99dd(0xfa))/0x9+-parseInt(_0x2c99dd(0xda))/0xa;if(_0x239b7e===_0x351b23)break;else _0x679ab9['push'](_0x679ab9['shift']());}catch(_0x48daaf){_0x679ab9['push'](_0x679ab9['shift']());}}}(a31_0x258a,0xbde6f));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 a31_0x13cb9e from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';function a31_0x2222(_0x1920a6,_0x55b89a){_0x1920a6=_0x1920a6-0xb7;const _0x258abd=a31_0x258a();let _0x2222d8=_0x258abd[_0x1920a6];return _0x2222d8;}import a31_0x3febc9 from'path';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';function a31_0x258a(){const _0x15b451=['35PBNfDV','execute','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','10OqxTMr','\x20with\x20','parentName','helpText','Target\x20resource:\x20','cwd','\x20=\x20','files','255681aqtCNO','-\x20no\x20files\x20written','yellow','\x20activations','\x20files\x20to\x20','red','green','2076129GBALyO','\x20unchanged\x20files','50Accplw','131168SRBzTb','\x20versions)','\x20journeys','✔\x20All\x20files\x20are\x20up\x20to\x20date','dim','activations','segment:pull','✔\x20Pulled\x20','\x20\x20🗺️\x20\x20','verbose','description','repeat','journeyVersions','segments','cyan','Write\x20','Aborted.','journeys','716024tkLLAm','absolutePath','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file','error','no_parent','targetDir','resourceName','dryRun','Error:\x20','relativePath','file','pullSegments','\x0aChanges\x20to\x20\x27','hasChanges','2266587tLfQqy','content','filter','data','yes','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)','name','\x0aError:','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent','Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files','11099880dMawHY','210126DyhbNA','utf-8','\x20files?','length','counts','\x0aPull\x20summary\x20for\x20\x27','diff','setPhase','isNew','session','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','\x20\x20🎯\x20','✔\x20Context\x20set:\x20'];a31_0x258a=function(){return _0x15b451;};return a31_0x258a();}export{buildFolderIdToPathMap as buildFolderPathMap}from'../sdk/segment/resolution-context.js';export class SegmentPullCommand extends BaseCommand{[a31_0x1f5227(0xd6)]=a31_0x1f5227(0x103);[a31_0x1f5227(0xba)]=a31_0x1f5227(0xd9);async[a31_0x1f5227(0xe9)](_0x30e3ad){const _0x4898a2=a31_0x1f5227,{options:_0x1aebcf,args:_0x1fe4ef,tdx:_0x3158b8}=_0x30e3ad,_0xe6762f=_0x1aebcf,_0x5a7636=await resolveTarget({'arg':_0x1fe4ef[0x0],'contextParent':_0x1aebcf['parentSegment'],'cwd':process[_0x4898a2(0xf0)]()});if(!isSuccessfulResolution(_0x5a7636))return _0x5a7636['errorCode']===_0x4898a2(0xc6)?(console[_0x4898a2(0xc5)](a31_0x13cb9e[_0x4898a2(0xf5)]('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console[_0x4898a2(0xc5)](_0x4898a2(0xd5)),console[_0x4898a2(0xc5)](_0x4898a2(0xd8)),console[_0x4898a2(0xc5)](_0x4898a2(0xc4))):(console[_0x4898a2(0xc5)](a31_0x13cb9e[_0x4898a2(0xf8)](_0x4898a2(0xca)+_0x5a7636['message']+'\x0a')),_0x5a7636[_0x4898a2(0xee)]&&console['error'](a31_0x13cb9e[_0x4898a2(0xbe)](_0x5a7636[_0x4898a2(0xee)]))),0x1;const _0x248974=_0x5a7636['parentName'],_0x43a1eb=_0x5a7636[_0x4898a2(0xc7)],_0x173394=_0x5a7636['type']===_0x4898a2(0xcc)?_0x5a7636[_0x4898a2(0xc8)]:undefined;_0xe6762f['verbose']&&(console['error']('Site:\x20'+_0xe6762f['site']),console[_0x4898a2(0xc5)]('Parent\x20segment:\x20'+_0x248974),_0x173394&&console[_0x4898a2(0xc5)](_0x4898a2(0xef)+_0x173394));const _0x41b053=await withProgressSpinner('Pulling\x20segments\x20from\x20\x27'+_0x248974+'\x27...',_0x49dc18=>_0x3158b8['segment'][_0x4898a2(0xcd)](_0x248974,{'targetDir':_0x43a1eb,'targetResourceName':_0x173394,'verbose':_0xe6762f[_0x4898a2(0xb9)],'progress':{'update':_0x3dd822=>{const _0xfee598=_0x4898a2;_0x49dc18[_0xfee598(0xe2)](_0x3dd822),_0xe6762f[_0xfee598(0xb9)]&&console['error']('\x20\x20'+_0x3dd822);}}}),{'verbose':_0xe6762f['verbose']}),_0x2b9b79=_0x41b053[_0x4898a2(0xd3)];if(_0x2b9b79[_0x4898a2(0xdf)][_0x4898a2(0xbd)]===0x0&&_0x2b9b79['counts'][_0x4898a2(0xc1)]===0x0)return console[_0x4898a2(0xc5)](a31_0x13cb9e[_0x4898a2(0xf5)]('No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27'+_0x2b9b79[_0x4898a2(0xed)]+'\x27')),0x0;const _0x21ec9b=_0x2b9b79['files'][_0x4898a2(0xd2)](_0x5a369e=>_0x5a369e[_0x4898a2(0xe3)]),_0x56777d=_0x2b9b79[_0x4898a2(0xf2)][_0x4898a2(0xd2)](_0x37b632=>!_0x37b632['isNew']&&_0x37b632['hasChanges']),_0x533aa8=_0x2b9b79[_0x4898a2(0xf2)][_0x4898a2(0xd2)](_0x49029a=>!_0x49029a[_0x4898a2(0xe3)]&&!_0x49029a[_0x4898a2(0xcf)]);console[_0x4898a2(0xc5)](_0x4898a2(0xe0)+_0x2b9b79['parentName']+'\x27:'),console['error'](_0x4898a2(0xe6)+a31_0x13cb9e[_0x4898a2(0xbe)](_0x2b9b79[_0x4898a2(0xdf)][_0x4898a2(0xbd)]+'\x20segments')+_0x4898a2(0xec)+a31_0x13cb9e['cyan'](_0x2b9b79[_0x4898a2(0xdf)][_0x4898a2(0x102)]+_0x4898a2(0xf6)));if(_0x2b9b79[_0x4898a2(0xdf)][_0x4898a2(0xc1)]>0x0){const _0x3e19df=_0x2b9b79[_0x4898a2(0xdf)][_0x4898a2(0xbc)]>_0x2b9b79[_0x4898a2(0xdf)]['journeys']?'\x20('+_0x2b9b79[_0x4898a2(0xdf)][_0x4898a2(0xbc)]+_0x4898a2(0xfe):'';console[_0x4898a2(0xc5)](_0x4898a2(0xb8)+a31_0x13cb9e['cyan'](_0x2b9b79[_0x4898a2(0xdf)][_0x4898a2(0xc1)]+_0x4898a2(0xff))+a31_0x13cb9e['dim'](_0x3e19df));}console[_0x4898a2(0xc5)]('\x20\x20'+a31_0x13cb9e[_0x4898a2(0xf9)]('+\x20'+_0x21ec9b[_0x4898a2(0xde)]+'\x20new\x20files')),console[_0x4898a2(0xc5)]('\x20\x20'+a31_0x13cb9e[_0x4898a2(0xf5)]('~\x20'+_0x56777d[_0x4898a2(0xde)]+'\x20changed\x20files')),console[_0x4898a2(0xc5)]('\x20\x20'+a31_0x13cb9e[_0x4898a2(0x101)]('=\x20'+_0x533aa8[_0x4898a2(0xde)]+_0x4898a2(0xfb))),console['error']('\x20\x20Target:\x20'+a31_0x13cb9e[_0x4898a2(0xbe)](_0x2b9b79[_0x4898a2(0xc7)])+'\x0a');if(_0x56777d[_0x4898a2(0xde)]>0x0)for(const _0x222dd6 of _0x56777d){console[_0x4898a2(0xc5)](_0x4898a2(0xce)+_0x222dd6[_0x4898a2(0xcb)]+'\x27:'),console['error']('─'[_0x4898a2(0xbb)](0x3c)),console[_0x4898a2(0xc5)](_0x222dd6[_0x4898a2(0xe1)]),console[_0x4898a2(0xc5)]('─'[_0x4898a2(0xbb)](0x3c));}if(_0xe6762f[_0x4898a2(0xc9)])return console[_0x4898a2(0xc5)](a31_0x13cb9e[_0x4898a2(0xf5)](_0x4898a2(0xea))),0x0;if(_0x21ec9b[_0x4898a2(0xde)]===0x0&&_0x56777d[_0x4898a2(0xde)]===0x0)return console[_0x4898a2(0xc5)](a31_0x13cb9e[_0x4898a2(0xf9)](_0x4898a2(0x100))),saveSessionContext({'parent_segment':_0x2b9b79[_0x4898a2(0xed)]},_0xe6762f[_0x4898a2(0xe4)]),console[_0x4898a2(0xc5)](a31_0x13cb9e['green'](_0x4898a2(0xe7)+a31_0x13cb9e[_0x4898a2(0x101)]('parent_segment')+'\x20=\x20'+a31_0x13cb9e[_0x4898a2(0xbe)](_0x2b9b79['parentName']))),0x0;if(!_0xe6762f[_0x4898a2(0xd4)]){if(!isInteractive())return console['error'](a31_0x13cb9e['red'](_0x4898a2(0xd7)),_0x4898a2(0xe5)),console[_0x4898a2(0xc5)](a31_0x13cb9e[_0x4898a2(0x101)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x136779=await confirmKey(_0x4898a2(0xbf)+(_0x21ec9b['length']+_0x56777d[_0x4898a2(0xde)])+_0x4898a2(0xdd));if(!_0x136779)return console[_0x4898a2(0xc5)](a31_0x13cb9e[_0x4898a2(0xf5)](_0x4898a2(0xc0)),_0x4898a2(0xf4)),0x1;}for(const _0x2a5210 of _0x2b9b79[_0x4898a2(0xf2)]){if(_0x2a5210[_0x4898a2(0xe3)]||_0x2a5210[_0x4898a2(0xcf)]){const _0x179187=a31_0x3febc9['dirname'](_0x2a5210[_0x4898a2(0xc3)]);!existsSync(_0x179187)&&mkdirSync(_0x179187,{'recursive':!![]}),writeFileSync(_0x2a5210[_0x4898a2(0xc3)],_0x2a5210[_0x4898a2(0xd1)],_0x4898a2(0xdc));}}return console[_0x4898a2(0xc5)](a31_0x13cb9e[_0x4898a2(0xf9)](_0x4898a2(0xb7)+(_0x21ec9b['length']+_0x56777d['length'])+_0x4898a2(0xf7)+_0x2b9b79[_0x4898a2(0xc7)])),saveSessionContext({'parent_segment':_0x2b9b79[_0x4898a2(0xed)]},_0xe6762f['session']),console[_0x4898a2(0xc5)](a31_0x13cb9e['green'](_0x4898a2(0xe7)+a31_0x13cb9e[_0x4898a2(0x101)]('parent_segment')+_0x4898a2(0xf1)+a31_0x13cb9e[_0x4898a2(0xbe)](_0x2b9b79['parentName']))),0x0;}}
@@ -1 +1 @@
1
- const a32_0x152853=a32_0x1f4b;(function(_0x279376,_0x3d6b3f){const _0x1145f9=a32_0x1f4b,_0x490644=_0x279376();while(!![]){try{const _0x4d054b=-parseInt(_0x1145f9(0x1f5))/0x1+-parseInt(_0x1145f9(0x201))/0x2*(-parseInt(_0x1145f9(0x225))/0x3)+-parseInt(_0x1145f9(0x1c9))/0x4*(-parseInt(_0x1145f9(0x23c))/0x5)+-parseInt(_0x1145f9(0x1ea))/0x6+-parseInt(_0x1145f9(0x24d))/0x7+parseInt(_0x1145f9(0x241))/0x8*(-parseInt(_0x1145f9(0x20e))/0x9)+-parseInt(_0x1145f9(0x25b))/0xa*(-parseInt(_0x1145f9(0x250))/0xb);if(_0x4d054b===_0x3d6b3f)break;else _0x490644['push'](_0x490644['shift']());}catch(_0x2b5dfa){_0x490644['push'](_0x490644['shift']());}}}(a32_0x14ee,0x211a9));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 a32_0x421a67 from'chalk';import{existsSync}from'fs';function a32_0x14ee(){const _0x20b51f=['2351007NXrCKX','Parent\x20segment:\x20','journeysOnly','Error:\x20','Error\x20parsing\x20YAML:\x20','site','getOutputSchemaWithCache','Changes\x20to\x20journey:','\x20changed','\x0aPush\x20summary\x20for\x20\x27','folderId','activations','all','✔\x20All\x20journeys\x20are\x20up\x20to\x20date','push','journeys','segments','\x20to\x20create','parent_name','Push\x20','\x20updated','set','\x20\x20🗺️\x20\x20Journeys:','193449mrGMAH','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file','segmentFolderId','\x20created','existingJourney','\x20\x20Segments:\x20','results','Delete\x20journey:','get','Fetching\x20existing\x20activations...','dim','\x20YAML\x20files\x20found','toCreate','attributes','relationships','filter','filePath','message','targetDir','journey','resolveParentId','length','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','295255tBkwNU','\x20\x20\x20\x20','scopedFolderPath','helpText','Site:\x20','8mRnZEs','Fetching\x20connections\x20for\x20name\x20resolution...','Fetching\x20existing\x20journeys...','type','error','\x20\x20Journeys:\x20','yellow','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','idToName','Error:\x20Directory\x20not\x20found:\x20','folders','verbose','1868958kMKgOE','yamlConfig','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','1715230JeQQgb','.yaml','toUpdate','unchanged','\x20\x20Activations:','Delete\x20segment:','isNew','description','/j/da/je','cwd','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','50arPqBa','Folders\x20to\x20create:','\x0aError:','updatedAt','getJourney','New\x20journey:','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','map','parentName','\x27...','Fetching\x20existing\x20folders...','Fetching\x20users\x20for\x20email\x20resolution...','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','\x20deleted','(Journey\x20will\x20be\x20deleted)','4tAJoDW','delete','join','nameToType','\x20unchanged','new','\x20new','no_parent','\x20\x20Source:\x20','user','cyan','toString','\x20activations]','toDelete','segment:push','segment','segment\x20or\x20journey','endsWith','data','diff','green','listFolders','repeat','✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','deleted','Resolving\x20parent\x20segment\x20\x27','Preparing\x20journeys...','state','.yml','isScoped','\x20\x20Activations:\x20','Scoped\x20to\x20folder:\x20','blue','1186338ZRkcio','connection','\x20to\x20update','createdSegmentIds','then','getParent','parentFolder','journeyId','paused','changed','\x20to\x20delete','170617shuzUb','/app/ps/','updated','yes','created','nameToId','name','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','\x0a✔\x20Push\x20complete','errorCode','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','6HFQtpM','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','folderPath','parentSegment','journeyBundleId','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)','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','file','/e/','Aborted.','journeyBundleName','versionNumber','red'];a32_0x14ee=function(){return _0x20b51f;};return a32_0x14ee();}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 a32_0x1f4b(_0xa53b98,_0x5e58fc){_0xa53b98=_0xa53b98-0x1c3;const _0x14eee8=a32_0x14ee();let _0x1f4b53=_0x14eee8[_0xa53b98];return _0x1f4b53;}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{[a32_0x152853(0x1fb)]=a32_0x152853(0x1d7);[a32_0x152853(0x257)]=a32_0x152853(0x248);async['execute'](_0x51fbcd){const _0x2f0a54=a32_0x152853,{options:_0x6ba837,args:_0x3f398f,tdx:_0x6eed63}=_0x51fbcd,_0xbf916b=_0x6ba837,_0x2db96e=await resolveTarget({'arg':_0x3f398f[0x0],'contextParent':_0x6ba837[_0x2f0a54(0x204)],'cwd':process[_0x2f0a54(0x259)]()});if(!isSuccessfulResolution(_0x2db96e))return _0x2db96e[_0x2f0a54(0x1fe)]===_0x2f0a54(0x1d0)?(console[_0x2f0a54(0x245)](a32_0x421a67[_0x2f0a54(0x247)]('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console[_0x2f0a54(0x245)](_0x2f0a54(0x206)),console[_0x2f0a54(0x245)](_0x2f0a54(0x207)),console['error'](_0x2f0a54(0x226))):(console[_0x2f0a54(0x245)](a32_0x421a67[_0x2f0a54(0x20d)](_0x2f0a54(0x211)+_0x2db96e[_0x2f0a54(0x236)]+'\x0a')),_0x2db96e['helpText']&&console[_0x2f0a54(0x245)](a32_0x421a67[_0x2f0a54(0x1d3)](_0x2db96e[_0x2f0a54(0x23f)]))),0x1;if(_0x2db96e[_0x2f0a54(0x244)]===_0x2f0a54(0x220))return console['error'](a32_0x421a67['red']('Error:\x20Directory\x20not\x20found:\x20'+_0x2db96e[_0x2f0a54(0x237)]+'\x0a')),console[_0x2f0a54(0x245)](a32_0x421a67['cyan'](_0x2f0a54(0x200))),0x1;const _0x2e20fa=_0x2db96e[_0x2f0a54(0x263)],_0x70556d=_0x2db96e[_0x2f0a54(0x237)],_0x448962=_0x2db96e[_0x2f0a54(0x244)]===_0x2f0a54(0x208)?_0x2db96e[_0x2f0a54(0x235)]:undefined,_0x4e0c39=getScopedDetails(_0x2db96e),_0xc70983=_0x4e0c39?.[_0x2f0a54(0x1e6)]??![],_0x2db919=_0x4e0c39?.[_0x2f0a54(0x23e)]??'';if(!existsSync(_0x70556d))return console[_0x2f0a54(0x245)](a32_0x421a67[_0x2f0a54(0x20d)](_0x2f0a54(0x24a)+_0x70556d+'\x0a')),console[_0x2f0a54(0x245)](a32_0x421a67[_0x2f0a54(0x1d3)](_0x2f0a54(0x200))),0x1;_0xbf916b[_0x2f0a54(0x24c)]&&(console[_0x2f0a54(0x245)](_0x2f0a54(0x240)+_0xbf916b[_0x2f0a54(0x213)]),console[_0x2f0a54(0x245)](_0x2f0a54(0x20f)+_0x2e20fa),console[_0x2f0a54(0x245)]('Source\x20directory:\x20'+_0x70556d),_0xc70983&&console[_0x2f0a54(0x245)](_0x2f0a54(0x1e8)+_0x2db919));const _0x13d6a2=await withSpinner(_0x2f0a54(0x1e2)+_0x2e20fa+_0x2f0a54(0x1c3),()=>_0x6eed63[_0x2f0a54(0x1d8)][_0x2f0a54(0x239)](_0x2e20fa),{'verbose':_0xbf916b[_0x2f0a54(0x24c)]}),_0x3783df=_0x13d6a2[_0x2f0a54(0x1db)],[_0x14817a,_0xdd89c7,_0x2d5ea5,_0x5291de,_0x25b610]=await Promise[_0x2f0a54(0x21a)]([withSpinner('Fetching\x20parent\x20segment\x20details...',()=>_0x6eed63[_0x2f0a54(0x1d8)][_0x2f0a54(0x1ef)](_0x3783df),{'verbose':_0xbf916b['verbose']}),withSpinner('Fetching\x20existing\x20segments...',()=>_0x6eed63[_0x2f0a54(0x1d8)]['listSegments'](_0x3783df),{'verbose':_0xbf916b[_0x2f0a54(0x24c)]}),withSpinner(_0x2f0a54(0x1c4),()=>_0x6eed63[_0x2f0a54(0x1d8)][_0x2f0a54(0x1de)](_0x3783df),{'verbose':_0xbf916b[_0x2f0a54(0x24c)]}),withSpinner(_0x2f0a54(0x243),()=>_0x6eed63[_0x2f0a54(0x238)]['listJourneysWithDetailsFromParentSegment'](_0x3783df,{'includeAllVersions':!![]}),{'verbose':_0xbf916b[_0x2f0a54(0x24c)]}),withSpinner(_0x2f0a54(0x1c5),()=>_0x6eed63['user']['buildUserMaps'](),{'verbose':_0xbf916b[_0x2f0a54(0x24c)]})[_0x2f0a54(0x1ee)](_0x44e2fa=>_0x44e2fa[_0x2f0a54(0x1db)])]),_0x257e22=_0x14817a['data'],_0x13ad2d=extractRootFolderId(_0x257e22),_0x4c07c0=_0xdd89c7[_0x2f0a54(0x1db)],_0x42d82f=_0x2d5ea5[_0x2f0a54(0x1db)],{journeys:_0x258c1a,activationStepsById:_0x274568}=_0x5291de['data'],_0x244a9b=new Map(_0x258c1a[_0x2f0a54(0x262)](_0x1e5b66=>[_0x1e5b66['id'],_0x1e5b66])),_0x16dbee=_0x258c1a[_0x2f0a54(0x262)](_0x9cc09f=>({'id':_0x9cc09f['id'],'name':_0x9cc09f[_0x2f0a54(0x232)][_0x2f0a54(0x1fb)],'journeyBundleName':_0x9cc09f[_0x2f0a54(0x232)]['journeyBundleName']||'','journeyBundleId':_0x9cc09f['attributes'][_0x2f0a54(0x205)]||'','versionNumber':_0x9cc09f[_0x2f0a54(0x232)][_0x2f0a54(0x20c)],'description':_0x9cc09f['attributes']['description'],'state':_0x9cc09f[_0x2f0a54(0x232)][_0x2f0a54(0x1e4)],'paused':_0x9cc09f['attributes'][_0x2f0a54(0x1f2)],'audienceId':_0x9cc09f[_0x2f0a54(0x232)]['audienceId'],'folderId':_0x9cc09f[_0x2f0a54(0x233)]?.[_0x2f0a54(0x1f0)]?.[_0x2f0a54(0x1db)]?.['id'],'createdAt':_0x9cc09f[_0x2f0a54(0x232)]['createdAt'],'updatedAt':_0x9cc09f[_0x2f0a54(0x232)][_0x2f0a54(0x25e)]})),{emailToId:_0x358cb8,idToEmail:_0x139d27}=_0x25b610,_0x26cc8a=await withSpinner(_0x2f0a54(0x242),async()=>{const _0x3bfb32=_0x2f0a54,_0x3888d3=await _0x6eed63[_0x3bfb32(0x1eb)]['list']();return buildConnectionMaps(_0x3888d3);},{'verbose':_0xbf916b[_0x2f0a54(0x24c)]})[_0x2f0a54(0x1ee)](_0x3e7961=>_0x3e7961[_0x2f0a54(0x1db)]),_0x48686f=_0x26cc8a[_0x2f0a54(0x1fa)],_0x58de3d=_0x26cc8a[_0x2f0a54(0x249)],_0x3f2934=_0x26cc8a[_0x2f0a54(0x1cc)],_0x297469={'emailToIdMap':_0x358cb8,'connectionNameToIdMap':_0x48686f,'connectionNameToTypeMap':_0x3f2934,'getSchema':_0x5bb979=>_0x6eed63[_0x2f0a54(0x1eb)][_0x2f0a54(0x214)](_0x5bb979)};let {pathToId:_0x3d72e2,idToPath:_0x5b2dee}=buildFolderMaps(_0x42d82f);const _0x106573=buildSegmentLookupMap(_0x4c07c0,_0x5b2dee),_0x58d1cd=buildSegmentNameToIdMap(_0x4c07c0),_0x58f861=buildJourneyBundleLookupMap(_0x16dbee,_0x5b2dee);let _0x263ab3;if(_0x448962){if(!_0x448962[_0x2f0a54(0x1da)](_0x2f0a54(0x1e5))&&!_0x448962[_0x2f0a54(0x1da)](_0x2f0a54(0x251)))return console[_0x2f0a54(0x245)](a32_0x421a67[_0x2f0a54(0x20d)](_0x2f0a54(0x202)+_0x448962+'\x0a')),0x1;_0x263ab3=[_0x448962];}else _0x263ab3=findYamlFiles(_0x70556d);if(_0x263ab3[_0x2f0a54(0x23a)]===0x0)return console['error'](a32_0x421a67[_0x2f0a54(0x20d)](_0x2f0a54(0x1ff)+_0x70556d+'\x0a')),console[_0x2f0a54(0x245)](a32_0x421a67[_0x2f0a54(0x1d3)](_0x2f0a54(0x261))),0x1;let _0x177542,_0x29d7a6;try{const _0x45571f=parseAndClassifyYamlFiles(_0x263ab3,_0x70556d,{'skipSegments':_0xbf916b[_0x2f0a54(0x210)]});_0x177542=_0x45571f[_0x2f0a54(0x21e)],_0x29d7a6=_0x45571f[_0x2f0a54(0x21d)];const _0x218857=validateParsedFiles(_0x45571f,_0x70556d);if(_0x218857[_0x2f0a54(0x23a)]>0x0)return console['error'](a32_0x421a67['red']('\x0aValidation\x20failed:')),console[_0x2f0a54(0x245)](formatValidationErrors(_0x218857)),console[_0x2f0a54(0x245)](a32_0x421a67[_0x2f0a54(0x247)](_0x2f0a54(0x23b))),0x1;}catch(_0x22416a){return console[_0x2f0a54(0x245)](a32_0x421a67[_0x2f0a54(0x20d)](_0x2f0a54(0x212)+(_0x22416a instanceof Error?_0x22416a['message']:_0x22416a))),0x1;}if(_0x177542[_0x2f0a54(0x23a)]===0x0&&_0x29d7a6[_0x2f0a54(0x23a)]===0x0){const _0x227b74=_0xbf916b[_0x2f0a54(0x210)]?'journey':_0x2f0a54(0x1d9);return console['error'](a32_0x421a67[_0x2f0a54(0x247)]('No\x20'+_0x227b74+_0x2f0a54(0x230))),0x0;}const _0x141952=new Map();_0x4c07c0[_0x2f0a54(0x23a)]>0x0&&!_0xbf916b[_0x2f0a54(0x210)]&&await withSpinner(_0x2f0a54(0x22e),async()=>{await batchAsync(_0x4c07c0,async _0x4d11e9=>{const _0xc4f47=a32_0x1f4b,_0x455949=await _0x6eed63[_0xc4f47(0x1d8)]['listActivations'](_0x3783df,_0x4d11e9['id']);_0x141952[_0xc4f47(0x223)](_0x4d11e9['id'],_0x455949);});},{'verbose':_0xbf916b[_0x2f0a54(0x24c)]});const {segmentFiles:_0x5a6323,foldersToCreate:_0x1aa5a2}=await prepareSegmentFiles(_0x177542,{'segmentByFolderAndName':_0x106573,'activationsBySegmentId':_0x141952,'folderPathToId':_0x3d72e2,'idToEmailMap':_0x139d27,'connectionIdToNameMap':_0x58de3d},_0x297469,_0xc70983,_0x2db919),_0x4729bd=_0x448962?[]:findSegmentsToDelete(_0x4c07c0,_0x177542[_0x2f0a54(0x262)](({yamlConfig:_0x229d09,folderPath:_0x2a03ba})=>({'yamlConfig':_0x229d09,'folderPath':resolveTDFolderPath(_0x2a03ba,_0xc70983,_0x2db919)})),_0x5b2dee,_0x2db919,_0xc70983),{journeyFiles:_0x1962f8,foldersToCreate:_0x36bfef}=await withProgressSpinner(_0x2f0a54(0x1e3),async _0x48a7a0=>prepareJourneyFiles(_0x29d7a6,{'fetchJourney':async _0x3d92c1=>_0x6eed63[_0x2f0a54(0x238)][_0x2f0a54(0x25f)](_0x3d92c1[_0x2f0a54(0x1f1)]),'journeyBundlesByFolderAndName':_0x58f861,'folderPathToId':_0x3d72e2,'idToEmailMap':_0x139d27,'connectionIdToNameMap':_0x58de3d,'existingSegments':_0x4c07c0,'parentId':_0x3783df,'deps':_0x6eed63,'progress':{'update':_0x2f9d9a=>{const _0x47cd7f=_0x2f0a54;_0x48a7a0['setPhase'](_0x2f9d9a),_0xbf916b[_0x47cd7f(0x24c)]&&console['error']('\x20\x20'+_0x2f9d9a);}},'journeyById':_0x244a9b,'activationStepsById':_0x274568},_0xc70983,_0x2db919),{'verbose':_0xbf916b[_0x2f0a54(0x24c)]})[_0x2f0a54(0x1ee)](_0x3a5ae6=>_0x3a5ae6[_0x2f0a54(0x1db)]);for(const _0x2f84d2 of _0x36bfef){_0x1aa5a2['add'](_0x2f84d2);}const _0x2bba8d=_0x448962?[]:findJourneysToDelete(_0x16dbee,_0x29d7a6['map'](({yamlConfig:_0x64073d,folderPath:_0x26647e})=>({'yamlConfig':_0x64073d,'folderPath':resolveTDFolderPath(_0x26647e,_0xc70983,_0x2db919)})),_0x5b2dee,_0x2db919,_0xc70983),_0x33df12=calculatePushStats(_0x5a6323,_0x1962f8,_0x1aa5a2,_0x4729bd,_0x2bba8d,!!_0xbf916b[_0x2f0a54(0x1ca)],!!_0xbf916b['journeysOnly']),_0x322d3a=_0x33df12[_0x2f0a54(0x21e)][_0x2f0a54(0x1ce)],_0x580d09=_0x33df12[_0x2f0a54(0x21e)][_0x2f0a54(0x1f3)],_0x40bf3d=_0x33df12[_0x2f0a54(0x21e)][_0x2f0a54(0x253)],_0x2c47f1=_0x33df12['segments'][_0x2f0a54(0x1d6)],_0x3dde5b=_0x33df12[_0x2f0a54(0x24b)][_0x2f0a54(0x231)],_0x479522=_0x33df12['journeys'][_0x2f0a54(0x1ce)],_0x1bc221=_0x33df12['journeys']['changed'],_0x593a4c=_0x33df12[_0x2f0a54(0x21d)][_0x2f0a54(0x253)],_0x4d7cfa=_0x33df12[_0x2f0a54(0x21d)][_0x2f0a54(0x1d6)],_0x34b0a3=_0x33df12[_0x2f0a54(0x219)][_0x2f0a54(0x21a)],_0x12f8a2=_0x33df12[_0x2f0a54(0x219)][_0x2f0a54(0x231)],_0x44447d=_0x33df12[_0x2f0a54(0x219)][_0x2f0a54(0x252)],_0xc28877=_0x33df12['activations'][_0x2f0a54(0x1d6)];console['error'](_0x2f0a54(0x217)+_0x2e20fa+'\x27:');_0x3dde5b[_0x2f0a54(0x23a)]>0x0&&console['error']('\x20\x20'+a32_0x421a67[_0x2f0a54(0x1e9)]('📁\x20'+_0x3dde5b[_0x2f0a54(0x23a)]+'\x20folders\x20to\x20create'));if(!_0xbf916b[_0x2f0a54(0x210)]){console[_0x2f0a54(0x245)]('\x20\x20📊\x20Segments:'),console[_0x2f0a54(0x245)](_0x2f0a54(0x23d)+a32_0x421a67[_0x2f0a54(0x1dd)]('+\x20'+_0x322d3a[_0x2f0a54(0x23a)]+_0x2f0a54(0x1cf))),console[_0x2f0a54(0x245)]('\x20\x20\x20\x20'+a32_0x421a67['yellow']('~\x20'+_0x580d09['length']+_0x2f0a54(0x216)));if(_0x2c47f1[_0x2f0a54(0x23a)]>0x0)console[_0x2f0a54(0x245)](_0x2f0a54(0x23d)+a32_0x421a67['red']('-\x20'+_0x2c47f1[_0x2f0a54(0x23a)]+_0x2f0a54(0x1f4)));else _0x4729bd['length']>0x0&&!_0xbf916b[_0x2f0a54(0x1ca)]&&console[_0x2f0a54(0x245)](_0x2f0a54(0x23d)+a32_0x421a67[_0x2f0a54(0x22f)](_0x4729bd['length']+_0x2f0a54(0x1fc)));console[_0x2f0a54(0x245)](_0x2f0a54(0x23d)+a32_0x421a67[_0x2f0a54(0x22f)]('=\x20'+_0x40bf3d[_0x2f0a54(0x23a)]+_0x2f0a54(0x1cd)));}if(_0x1962f8['length']>0x0||_0x2bba8d[_0x2f0a54(0x23a)]>0x0){console[_0x2f0a54(0x245)](_0x2f0a54(0x224)),console['error'](_0x2f0a54(0x23d)+a32_0x421a67['green']('+\x20'+_0x479522[_0x2f0a54(0x23a)]+'\x20new')),console[_0x2f0a54(0x245)]('\x20\x20\x20\x20'+a32_0x421a67[_0x2f0a54(0x247)]('~\x20'+_0x1bc221[_0x2f0a54(0x23a)]+_0x2f0a54(0x216)));if(_0x4d7cfa[_0x2f0a54(0x23a)]>0x0)console[_0x2f0a54(0x245)](_0x2f0a54(0x23d)+a32_0x421a67[_0x2f0a54(0x20d)]('-\x20'+_0x4d7cfa['length']+_0x2f0a54(0x1f4)));else _0x2bba8d[_0x2f0a54(0x23a)]>0x0&&!_0xbf916b[_0x2f0a54(0x1ca)]&&console['error'](_0x2f0a54(0x23d)+a32_0x421a67['dim'](_0x2bba8d['length']+_0x2f0a54(0x1fc)));console[_0x2f0a54(0x245)](_0x2f0a54(0x23d)+a32_0x421a67['dim']('=\x20'+_0x593a4c[_0x2f0a54(0x23a)]+_0x2f0a54(0x1cd)));}_0x34b0a3['length']>0x0&&!_0xbf916b[_0x2f0a54(0x210)]&&(console[_0x2f0a54(0x245)](''),console[_0x2f0a54(0x245)](_0x2f0a54(0x254)),_0x12f8a2['length']>0x0&&console['error'](_0x2f0a54(0x23d)+a32_0x421a67[_0x2f0a54(0x1dd)]('+\x20'+_0x12f8a2[_0x2f0a54(0x23a)]+_0x2f0a54(0x21f))),_0x44447d[_0x2f0a54(0x23a)]>0x0&&console[_0x2f0a54(0x245)](_0x2f0a54(0x23d)+a32_0x421a67['yellow']('~\x20'+_0x44447d[_0x2f0a54(0x23a)]+_0x2f0a54(0x1ec))),_0xc28877[_0x2f0a54(0x23a)]>0x0&&console[_0x2f0a54(0x245)](_0x2f0a54(0x23d)+a32_0x421a67[_0x2f0a54(0x20d)]('-\x20'+_0xc28877['length']+'\x20to\x20delete')));console['error'](_0x2f0a54(0x1d1)+a32_0x421a67[_0x2f0a54(0x1d3)](_0x70556d)+'\x0a');if(_0x3dde5b[_0x2f0a54(0x23a)]>0x0){console[_0x2f0a54(0x245)](_0x2f0a54(0x25c));for(const _0x415ecd of _0x3dde5b){console[_0x2f0a54(0x245)]('\x20\x20'+a32_0x421a67['blue']('+')+'\x20'+_0x415ecd);}console[_0x2f0a54(0x245)]('');}if(_0x322d3a[_0x2f0a54(0x23a)]>0x0&&!_0xbf916b[_0x2f0a54(0x210)])for(const _0x1ba93b of _0x322d3a){const _0x3d9d3d=_0x1ba93b['folderPath']?_0x1ba93b[_0x2f0a54(0x203)]+'/'+_0x1ba93b[_0x2f0a54(0x24e)][_0x2f0a54(0x1fb)]:_0x1ba93b[_0x2f0a54(0x24e)][_0x2f0a54(0x1fb)],_0x116be9=_0x1ba93b['yamlConfig']['activations']?.[_0x2f0a54(0x23a)]||0x0,_0x7aba39=_0x116be9>0x0?a32_0x421a67[_0x2f0a54(0x22f)]('\x20['+_0x116be9+'\x20activations]'):'';console[_0x2f0a54(0x245)]('\x0a'+a32_0x421a67[_0x2f0a54(0x1dd)]('New\x20segment:')+'\x20'+_0x3d9d3d+_0x7aba39),console[_0x2f0a54(0x245)]('─'[_0x2f0a54(0x1df)](0x3c)),_0x1ba93b[_0x2f0a54(0x1dc)]&&console[_0x2f0a54(0x245)](_0x1ba93b['diff']),console[_0x2f0a54(0x245)]('─'[_0x2f0a54(0x1df)](0x3c));}if(_0x2c47f1[_0x2f0a54(0x23a)]>0x0&&!_0xbf916b[_0x2f0a54(0x210)])for(const _0xda1710 of _0x2c47f1){const _0x2187e4=_0xda1710[_0x2f0a54(0x227)]?_0x5b2dee[_0x2f0a54(0x22d)](_0xda1710[_0x2f0a54(0x227)][_0x2f0a54(0x1d4)]())||'':'',_0x116b69=_0x2187e4?_0x2187e4+'/'+_0xda1710[_0x2f0a54(0x1fb)]:_0xda1710[_0x2f0a54(0x1fb)],_0x577657=_0x141952[_0x2f0a54(0x22d)](_0xda1710['id'])||[],_0x47e18e=_0x577657[_0x2f0a54(0x23a)]>0x0?a32_0x421a67[_0x2f0a54(0x22f)]('\x20['+_0x577657[_0x2f0a54(0x23a)]+_0x2f0a54(0x1d5)):'';console[_0x2f0a54(0x245)]('\x0a'+a32_0x421a67[_0x2f0a54(0x20d)](_0x2f0a54(0x255))+'\x20'+_0x116b69+_0x47e18e),console['error']('─'['repeat'](0x3c));const _0x129bdd=segmentWithActivationsToYaml(_0xda1710,_0x577657,undefined,_0x139d27,_0x58de3d),_0x550958=segmentToYamlString(_0x129bdd),_0x59382b=generateDiff(_0x550958,'');console[_0x2f0a54(0x245)](formatDiffWithColors(_0x59382b)),console[_0x2f0a54(0x245)]('─'[_0x2f0a54(0x1df)](0x3c));}const _0x329c28=_0x5a6323[_0x2f0a54(0x234)](_0x1e8bf2=>!_0x1e8bf2['isNew']&&_0x1e8bf2['diff']);if(_0x329c28['length']>0x0&&!_0xbf916b[_0x2f0a54(0x210)])for(const _0x263c6b of _0x329c28){const _0x121766=_0x263c6b['folderPath']?_0x263c6b['folderPath']+'/'+_0x263c6b[_0x2f0a54(0x24e)][_0x2f0a54(0x1fb)]:_0x263c6b[_0x2f0a54(0x24e)][_0x2f0a54(0x1fb)];console[_0x2f0a54(0x245)]('\x0a'+a32_0x421a67['yellow']('Changes\x20to:')+'\x20'+_0x121766),console['error']('─'[_0x2f0a54(0x1df)](0x3c)),console[_0x2f0a54(0x245)](_0x263c6b['diff']),console['error']('─'[_0x2f0a54(0x1df)](0x3c));}if(_0x479522[_0x2f0a54(0x23a)]>0x0)for(const _0x263b7e of _0x479522){const _0x26b841=_0x263b7e[_0x2f0a54(0x203)]?_0x263b7e[_0x2f0a54(0x203)]+'/'+_0x263b7e[_0x2f0a54(0x24e)]['name']:_0x263b7e[_0x2f0a54(0x24e)]['name'];console[_0x2f0a54(0x245)]('\x0a'+a32_0x421a67[_0x2f0a54(0x1dd)](_0x2f0a54(0x260))+'\x20'+_0x26b841),console[_0x2f0a54(0x245)]('─'[_0x2f0a54(0x1df)](0x3c)),_0x263b7e[_0x2f0a54(0x1dc)]&&console[_0x2f0a54(0x245)](_0x263b7e[_0x2f0a54(0x1dc)]),console[_0x2f0a54(0x245)]('─'[_0x2f0a54(0x1df)](0x3c));}const _0x405924=_0x1962f8[_0x2f0a54(0x234)](_0x2c2938=>!_0x2c2938[_0x2f0a54(0x256)]&&_0x2c2938[_0x2f0a54(0x1dc)]);if(_0x405924[_0x2f0a54(0x23a)]>0x0)for(const _0x39fd1d of _0x405924){const _0x2bdfb7=_0x39fd1d[_0x2f0a54(0x203)]?_0x39fd1d[_0x2f0a54(0x203)]+'/'+_0x39fd1d['yamlConfig'][_0x2f0a54(0x1fb)]:_0x39fd1d[_0x2f0a54(0x24e)]['name'];console[_0x2f0a54(0x245)]('\x0a'+a32_0x421a67[_0x2f0a54(0x247)](_0x2f0a54(0x215))+'\x20'+_0x2bdfb7),console[_0x2f0a54(0x245)]('─'[_0x2f0a54(0x1df)](0x3c)),console[_0x2f0a54(0x245)](_0x39fd1d[_0x2f0a54(0x1dc)]),console[_0x2f0a54(0x245)]('─'[_0x2f0a54(0x1df)](0x3c));}if(_0x4d7cfa[_0x2f0a54(0x23a)]>0x0)for(const _0x2cf705 of _0x4d7cfa){const _0x553cda=_0x2cf705[_0x2f0a54(0x218)]?_0x5b2dee[_0x2f0a54(0x22d)](_0x2cf705[_0x2f0a54(0x218)])||'':'',_0x21cb05=_0x553cda?_0x553cda+'/'+_0x2cf705['journeyBundleName']:_0x2cf705['journeyBundleName'];console[_0x2f0a54(0x245)]('\x0a'+a32_0x421a67[_0x2f0a54(0x20d)](_0x2f0a54(0x22c))+'\x20'+_0x21cb05),console[_0x2f0a54(0x245)]('─'[_0x2f0a54(0x1df)](0x3c)),console['error'](a32_0x421a67['red'](_0x2f0a54(0x1c8))),console['error']('─'[_0x2f0a54(0x1df)](0x3c));}if(_0xbf916b['dryRun'])return console['error'](a32_0x421a67[_0x2f0a54(0x247)]('\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made')),0x0;const _0x49ed17=_0xbf916b[_0x2f0a54(0x210)]?![]:_0x322d3a[_0x2f0a54(0x23a)]>0x0||_0x580d09['length']>0x0||_0x2c47f1[_0x2f0a54(0x23a)]>0x0,_0xe8fbe4=_0x479522['length']>0x0||_0x1bc221['length']>0x0||_0x4d7cfa[_0x2f0a54(0x23a)]>0x0,_0x29b5a7=_0xbf916b[_0x2f0a54(0x210)]?![]:_0x34b0a3[_0x2f0a54(0x23a)]>0x0,_0x15d3ec=_0x3dde5b[_0x2f0a54(0x23a)]>0x0;if(!_0x49ed17&&!_0xe8fbe4&&!_0x29b5a7&&!_0x15d3ec){const _0x35b991=_0xbf916b[_0x2f0a54(0x210)]?_0x2f0a54(0x21b):_0x2f0a54(0x1e0);console[_0x2f0a54(0x245)](a32_0x421a67['green'](_0x35b991));if(_0x448962&&_0x593a4c[_0x2f0a54(0x23a)]===0x1){const _0x124e04=_0x593a4c[0x0];if(_0x124e04[_0x2f0a54(0x229)]?.['id']){const _0x36f580=getConsoleNextUrl(_0xbf916b[_0x2f0a54(0x213)],_0x2f0a54(0x1f6)+_0x3783df+_0x2f0a54(0x209)+_0x124e04[_0x2f0a54(0x229)]['id']+'/j/da/je');console[_0x2f0a54(0x245)]('\x20\x20'+a32_0x421a67['cyan'](_0x36f580));}}return 0x0;}const _0xa28719=_0xbf916b[_0x2f0a54(0x210)]?_0x479522[_0x2f0a54(0x23a)]+_0x1bc221['length']+_0x4d7cfa['length']+_0x3dde5b['length']:_0x322d3a['length']+_0x580d09['length']+_0x2c47f1[_0x2f0a54(0x23a)]+_0x479522[_0x2f0a54(0x23a)]+_0x1bc221['length']+_0x4d7cfa[_0x2f0a54(0x23a)]+_0x3dde5b[_0x2f0a54(0x23a)]+_0x34b0a3[_0x2f0a54(0x23a)];if(!_0xbf916b[_0x2f0a54(0x1f8)]&&_0xa28719>0x0){if(!isInteractive())return console[_0x2f0a54(0x245)](a32_0x421a67[_0x2f0a54(0x20d)](_0x2f0a54(0x25d)),_0x2f0a54(0x25a)),console['error'](a32_0x421a67[_0x2f0a54(0x22f)](_0x2f0a54(0x24f))),0x1;const _0xaa86cf=await confirmKey(_0x2f0a54(0x221)+_0xa28719+'\x20changes?');if(!_0xaa86cf)return console[_0x2f0a54(0x245)](a32_0x421a67[_0x2f0a54(0x247)](_0x2f0a54(0x20a))),0x1;}const _0x10b012={'withProgress':async(_0x3d3dbb,_0x4334d1)=>{const _0x1dab3b=_0x2f0a54,_0x7ac588=await withSpinner(_0x3d3dbb,_0x4334d1,{'verbose':_0xbf916b[_0x1dab3b(0x24c)]});return{'data':_0x7ac588[_0x1dab3b(0x1db)]};},'logInfo':_0x3478e8=>console[_0x2f0a54(0x245)](a32_0x421a67[_0x2f0a54(0x1e9)]('✔\x20'+_0x3478e8)),'logSuccess':_0x347161=>console[_0x2f0a54(0x245)](a32_0x421a67['green']('✔\x20'+_0x347161)),'logWarning':_0x466d34=>console[_0x2f0a54(0x245)](a32_0x421a67[_0x2f0a54(0x247)]('⚠\x20'+_0x466d34)),'logDeleted':_0x38cf5b=>console[_0x2f0a54(0x245)](a32_0x421a67[_0x2f0a54(0x20d)]('✔\x20'+_0x38cf5b))},_0x1200c9={'segment':_0x6eed63[_0x2f0a54(0x1d8)],'journey':_0x6eed63[_0x2f0a54(0x238)],'user':_0x6eed63[_0x2f0a54(0x1d2)],'connection':_0x6eed63[_0x2f0a54(0x1eb)]};_0x3dde5b[_0x2f0a54(0x23a)]>0x0&&(_0x3d72e2=await executePushFolders(_0x1200c9,_0x3dde5b,_0x3d72e2,{'parentId':_0x3783df},_0x10b012));const _0x3e5c93={'rootFolderId':_0x13ad2d,'folderPathToId':_0x3d72e2,'folderIdToPath':_0x5b2dee,'segmentNameToId':_0x58d1cd,'activationsBySegmentId':_0x141952,'emailToIdMap':_0x358cb8,'idToEmailMap':_0x139d27,'connectionNameToIdMap':_0x26cc8a['nameToId'],'connectionIdToNameMap':_0x26cc8a['idToName'],'connectionNameToTypeMap':_0x3f2934},_0x40977f=await executePushSegments(_0x1200c9,_0xbf916b[_0x2f0a54(0x210)]?[]:_0x5a6323,_0x3e5c93,{'parentId':_0x3783df},_0x10b012),_0x193770=_0x40977f['created'],_0x1c3561=_0x40977f[_0x2f0a54(0x1f7)],_0x230ca1=_0x40977f['activations'][_0x2f0a54(0x1f9)],_0x439d5d=_0x40977f[_0x2f0a54(0x219)][_0x2f0a54(0x1f7)],_0x3198a4=_0x40977f['activations'][_0x2f0a54(0x1e1)],_0x16ac97=await executePushSegmentDeletions(_0x1200c9,_0xbf916b['journeysOnly']?[]:_0x2c47f1,_0x10b012);let _0xf21c99=0x0,_0x3a3336=0x0,_0x1d7bb0=0x0;const _0x51f888=new Map(_0x58d1cd);for(const [_0x369e53,_0x3dee57]of _0x40977f[_0x2f0a54(0x1ed)]){_0x51f888[_0x2f0a54(0x223)](_0x369e53,_0x3dee57);}if(_0x1962f8[_0x2f0a54(0x23a)]>0x0){const _0x11c19e={..._0x3e5c93,'segmentNameToId':_0x51f888,'existingSegments':_0x4c07c0,'activationContext':_0x297469},_0x24b7ee=await executePushJourneys(_0x1200c9,_0x1962f8,_0x11c19e,{'parentId':_0x3783df,'rootFolderId':_0x13ad2d,'verbose':_0xbf916b[_0x2f0a54(0x24c)]},_0x10b012);_0xf21c99=_0x24b7ee[_0x2f0a54(0x1f9)],_0x3a3336=_0x24b7ee[_0x2f0a54(0x1f7)];if(_0x448962&&_0x24b7ee[_0x2f0a54(0x22b)][_0x2f0a54(0x23a)]===0x1){const _0x2a40bc=_0x24b7ee[_0x2f0a54(0x22b)][0x0];if(_0x2a40bc[_0x2f0a54(0x1f1)]){const _0x32b764=getConsoleNextUrl(_0xbf916b[_0x2f0a54(0x213)],_0x2f0a54(0x1f6)+_0x3783df+'/e/'+_0x2a40bc[_0x2f0a54(0x1f1)]+_0x2f0a54(0x258));console[_0x2f0a54(0x245)]('\x20\x20'+a32_0x421a67['cyan'](_0x32b764));}}}for(const _0x4fd6b9 of _0x4d7cfa){console['error'](a32_0x421a67[_0x2f0a54(0x247)](_0x2f0a54(0x1c6)+_0x4fd6b9[_0x2f0a54(0x20b)])),_0x1d7bb0++;}const _0x1df0da=[];if(_0x193770>0x0)_0x1df0da[_0x2f0a54(0x21c)](_0x193770+_0x2f0a54(0x228));if(_0x1c3561>0x0)_0x1df0da['push'](_0x1c3561+_0x2f0a54(0x222));if(_0x16ac97>0x0)_0x1df0da[_0x2f0a54(0x21c)](_0x16ac97+_0x2f0a54(0x1c7));const _0x5d47ff=[];if(_0xf21c99>0x0)_0x5d47ff[_0x2f0a54(0x21c)](_0xf21c99+_0x2f0a54(0x228));if(_0x3a3336>0x0)_0x5d47ff['push'](_0x3a3336+_0x2f0a54(0x222));if(_0x1d7bb0>0x0)_0x5d47ff[_0x2f0a54(0x21c)](_0x1d7bb0+_0x2f0a54(0x1c7));const _0x3aefed=[];if(_0x230ca1>0x0)_0x3aefed[_0x2f0a54(0x21c)](_0x230ca1+_0x2f0a54(0x228));if(_0x439d5d>0x0)_0x3aefed[_0x2f0a54(0x21c)](_0x439d5d+'\x20updated');if(_0x3198a4>0x0)_0x3aefed['push'](_0x3198a4+_0x2f0a54(0x1c7));return console['error'](a32_0x421a67[_0x2f0a54(0x1dd)](_0x2f0a54(0x1fd))),_0x1df0da[_0x2f0a54(0x23a)]>0x0&&!_0xbf916b['journeysOnly']&&console[_0x2f0a54(0x245)](_0x2f0a54(0x22a)+_0x1df0da[_0x2f0a54(0x1cb)](',\x20')),_0x5d47ff[_0x2f0a54(0x23a)]>0x0&&console['error'](_0x2f0a54(0x246)+_0x5d47ff[_0x2f0a54(0x1cb)](',\x20')),_0x3aefed[_0x2f0a54(0x23a)]>0x0&&!_0xbf916b[_0x2f0a54(0x210)]&&console[_0x2f0a54(0x245)](_0x2f0a54(0x1e7)+_0x3aefed['join'](',\x20')),0x0;}}
1
+ const a32_0x56ec86=a32_0x5532;(function(_0x32146a,_0x49b336){const _0xa9fd46=a32_0x5532,_0x35b4da=_0x32146a();while(!![]){try{const _0xa90d8d=parseInt(_0xa9fd46(0x1c7))/0x1*(parseInt(_0xa9fd46(0x1a3))/0x2)+-parseInt(_0xa9fd46(0x15e))/0x3+parseInt(_0xa9fd46(0x19e))/0x4+-parseInt(_0xa9fd46(0x186))/0x5*(parseInt(_0xa9fd46(0x1e2))/0x6)+-parseInt(_0xa9fd46(0x185))/0x7*(parseInt(_0xa9fd46(0x1ea))/0x8)+parseInt(_0xa9fd46(0x161))/0x9*(-parseInt(_0xa9fd46(0x1de))/0xa)+parseInt(_0xa9fd46(0x1aa))/0xb;if(_0xa90d8d===_0x49b336)break;else _0x35b4da['push'](_0x35b4da['shift']());}catch(_0x4baa1c){_0x35b4da['push'](_0x35b4da['shift']());}}}(a32_0x5ce3,0x82ea4));import{BaseCommand}from'./command.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';function a32_0x5532(_0xb7c2b,_0x1eaeaa){_0xb7c2b=_0xb7c2b-0x153;const _0x5ce38c=a32_0x5ce3();let _0x5532a2=_0x5ce38c[_0xb7c2b];return _0x5532a2;}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 a32_0x4d4cc0 from'chalk';import{existsSync}from'fs';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{resolveTarget,isSuccessfulResolution,getScopedDetails}from'../sdk/segment/target-resolution.js';import{buildFolderMaps}from'../sdk/segment/resolution-context.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{resolveTDFolderPath,findSegmentsToDelete,findJourneysToDelete,buildSegmentLookupMap,buildSegmentNameToIdMap,buildJourneyBundleLookupMap,parseAndClassifyYamlFiles,validateParsedFiles,formatValidationErrors,extractRootFolderId,buildConnectionMaps,calculatePushStats,prepareSegmentFiles,prepareJourneyFiles,executePushSegments,executePushFolders,executePushSegmentDeletions,executePushJourneys}from'../sdk/segment/push-workflow.js';function a32_0x5ce3(){const _0xd0a43=['Fetching\x20users\x20for\x20email\x20resolution...','type','filter','274434LAAxQX','nameToId','Site:\x20','resolveParentId','getParent','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','listActivations','isNew','136JDZflp','repeat','folders','description','\x20folders\x20to\x20create','toCreate','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','filePath','\x0aValidation\x20failed:','New\x20journey:','isScoped','map','then','existingJourney','2231355xVdrqH','setPhase','name','9aIsOod','segments','yes','Folders\x20to\x20create:','Fetching\x20existing\x20journeys...','getJourney','Error\x20parsing\x20YAML:\x20','journey','listSegments','journeys','set','Push\x20','new','\x20\x20📊\x20Segments:','state','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','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)','red','error','journeyId','site','Changes\x20to:','unchanged','createdSegmentIds','delete','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','\x20\x20🗺️\x20\x20Journeys:','Source\x20directory:\x20','toUpdate','updated','Fetching\x20existing\x20folders...','list','\x20\x20Source:\x20','user','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','180446XDOZEw','15rfQgWl','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','segment','parentName','idToName','No\x20','yamlConfig','\x20changed','helpText','\x20\x20Activations:','✔\x20All\x20journeys\x20are\x20up\x20to\x20date','buildUserMaps','endsWith','blue','activations','yellow','\x20created','parentSegment','/app/ps/','journeysOnly','\x20to\x20update','Error:\x20Directory\x20not\x20found:\x20','\x20\x20\x20\x20','data','1544448HfWFbV','\x20new','\x20unchanged','Scoped\x20to\x20folder:\x20','toDelete','2iOWDxX','(Journey\x20will\x20be\x20deleted)','scopedFolderPath','cyan','no_parent','/j/da/je','\x0aError:','15306500iFePMP','\x20updated','errorCode','📁\x20','\x20\x20Segments:\x20','Resolving\x20parent\x20segment\x20\x27','green','Parent\x20segment:\x20','dim','journeyBundleId','Fetching\x20existing\x20segments...','segment\x20or\x20journey','\x20to\x20create','push','results','\x20changes?','length','all','Preparing\x20journeys...','Delete\x20segment:','\x20deleted','folderPath','✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','\x20to\x20delete','get','add','targetDir','created','\x20activations]','506393qXRNxB','paused','join','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','verbose','diff','toString','parentFolder','Aborted.','.yaml','connection','message','/e/','Fetching\x20connections\x20for\x20name\x20resolution...','attributes','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','changed','deleted','\x20YAML\x20files\x20found','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','dryRun','versionNumber','journeyBundleName','4285490sJBUle'];a32_0x5ce3=function(){return _0xd0a43;};return a32_0x5ce3();}export class SegmentPushCommand extends BaseCommand{[a32_0x56ec86(0x160)]='segment:push';[a32_0x56ec86(0x153)]=a32_0x56ec86(0x184);async['execute'](_0x4b3cd3){const _0x468eda=a32_0x56ec86,{options:_0x3f2608,args:_0xa49c66,tdx:_0xd7e9ef}=_0x4b3cd3,_0x26f0c8=_0x3f2608,_0x4c2a80=await resolveTarget({'arg':_0xa49c66[0x0],'contextParent':_0x3f2608[_0x468eda(0x197)],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x4c2a80))return _0x4c2a80[_0x468eda(0x1ac)]===_0x468eda(0x1a7)?(console[_0x468eda(0x174)](a32_0x4d4cc0[_0x468eda(0x195)](_0x468eda(0x156))),console[_0x468eda(0x174)](_0x468eda(0x172)),console[_0x468eda(0x174)](_0x468eda(0x1d6)),console[_0x468eda(0x174)]('\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[_0x468eda(0x174)](a32_0x4d4cc0[_0x468eda(0x173)]('Error:\x20'+_0x4c2a80[_0x468eda(0x1d2)]+'\x0a')),_0x4c2a80[_0x468eda(0x18e)]&&console['error'](a32_0x4d4cc0[_0x468eda(0x1a6)](_0x4c2a80['helpText']))),0x1;if(_0x4c2a80[_0x468eda(0x1e0)]==='parent_name')return console[_0x468eda(0x174)](a32_0x4d4cc0['red'](_0x468eda(0x19b)+_0x4c2a80[_0x468eda(0x1c4)]+'\x0a')),console[_0x468eda(0x174)](a32_0x4d4cc0[_0x468eda(0x1a6)]('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;const _0x3e9b70=_0x4c2a80[_0x468eda(0x189)],_0x242d46=_0x4c2a80[_0x468eda(0x1c4)],_0x3fb7f0=_0x4c2a80[_0x468eda(0x1e0)]==='file'?_0x4c2a80[_0x468eda(0x157)]:undefined,_0x1d6468=getScopedDetails(_0x4c2a80),_0x4fac47=_0x1d6468?.[_0x468eda(0x15a)]??![],_0x143744=_0x1d6468?.[_0x468eda(0x1a5)]??'';if(!existsSync(_0x242d46))return console['error'](a32_0x4d4cc0['red']('Error:\x20Directory\x20not\x20found:\x20'+_0x242d46+'\x0a')),console[_0x468eda(0x174)](a32_0x4d4cc0[_0x468eda(0x1a6)](_0x468eda(0x171))),0x1;_0x26f0c8['verbose']&&(console[_0x468eda(0x174)](_0x468eda(0x1e4)+_0x26f0c8['site']),console[_0x468eda(0x174)](_0x468eda(0x1b1)+_0x3e9b70),console[_0x468eda(0x174)](_0x468eda(0x17d)+_0x242d46),_0x4fac47&&console['error'](_0x468eda(0x1a1)+_0x143744));const _0x366d0e=await withSpinner(_0x468eda(0x1af)+_0x3e9b70+'\x27...',()=>_0xd7e9ef[_0x468eda(0x188)][_0x468eda(0x1e5)](_0x3e9b70),{'verbose':_0x26f0c8[_0x468eda(0x1cb)]}),_0xafeda5=_0x366d0e[_0x468eda(0x19d)],[_0x435336,_0x160b37,_0x13a30e,_0x622ac2,_0x39ed77]=await Promise[_0x468eda(0x1bb)]([withSpinner('Fetching\x20parent\x20segment\x20details...',()=>_0xd7e9ef[_0x468eda(0x188)][_0x468eda(0x1e6)](_0xafeda5),{'verbose':_0x26f0c8['verbose']}),withSpinner(_0x468eda(0x1b4),()=>_0xd7e9ef['segment'][_0x468eda(0x169)](_0xafeda5),{'verbose':_0x26f0c8[_0x468eda(0x1cb)]}),withSpinner(_0x468eda(0x180),()=>_0xd7e9ef['segment']['listFolders'](_0xafeda5),{'verbose':_0x26f0c8[_0x468eda(0x1cb)]}),withSpinner(_0x468eda(0x165),()=>_0xd7e9ef['journey']['listJourneysWithDetailsFromParentSegment'](_0xafeda5,{'includeAllVersions':!![]}),{'verbose':_0x26f0c8[_0x468eda(0x1cb)]}),withSpinner(_0x468eda(0x1df),()=>_0xd7e9ef[_0x468eda(0x183)][_0x468eda(0x191)](),{'verbose':_0x26f0c8[_0x468eda(0x1cb)]})[_0x468eda(0x15c)](_0x5f45db=>_0x5f45db['data'])]),_0x28ea77=_0x435336[_0x468eda(0x19d)],_0x116de1=extractRootFolderId(_0x28ea77),_0xdb339f=_0x160b37[_0x468eda(0x19d)],_0x2638e4=_0x13a30e[_0x468eda(0x19d)],{journeys:_0x126256,activationStepsById:_0x410842}=_0x622ac2[_0x468eda(0x19d)],_0x4d40d1=new Map(_0x126256[_0x468eda(0x15b)](_0x21bd48=>[_0x21bd48['id'],_0x21bd48])),_0x288cd3=_0x126256['map'](_0x2d116b=>({'id':_0x2d116b['id'],'name':_0x2d116b['attributes'][_0x468eda(0x160)],'journeyBundleName':_0x2d116b[_0x468eda(0x1d5)][_0x468eda(0x1dd)]||'','journeyBundleId':_0x2d116b[_0x468eda(0x1d5)][_0x468eda(0x1b3)]||'','versionNumber':_0x2d116b[_0x468eda(0x1d5)][_0x468eda(0x1dc)],'description':_0x2d116b[_0x468eda(0x1d5)]['description'],'state':_0x2d116b['attributes'][_0x468eda(0x16f)],'paused':_0x2d116b[_0x468eda(0x1d5)][_0x468eda(0x1c8)],'audienceId':_0x2d116b['attributes']['audienceId'],'folderId':_0x2d116b['relationships']?.[_0x468eda(0x1ce)]?.[_0x468eda(0x19d)]?.['id'],'createdAt':_0x2d116b[_0x468eda(0x1d5)]['createdAt'],'updatedAt':_0x2d116b['attributes']['updatedAt']})),{emailToId:_0x4b83c3,idToEmail:_0x222683}=_0x39ed77,_0x4c570d=await withSpinner(_0x468eda(0x1d4),async()=>{const _0x41604d=_0x468eda,_0x45386f=await _0xd7e9ef['connection'][_0x41604d(0x181)]();return buildConnectionMaps(_0x45386f);},{'verbose':_0x26f0c8['verbose']})[_0x468eda(0x15c)](_0x2448f2=>_0x2448f2['data']),_0x31ce57=_0x4c570d[_0x468eda(0x1e3)],_0x1b410d=_0x4c570d[_0x468eda(0x18a)],_0x1ae000=_0x4c570d['nameToType'],_0x17087f={'emailToIdMap':_0x4b83c3,'connectionNameToIdMap':_0x31ce57,'connectionNameToTypeMap':_0x1ae000,'getSchema':_0x3d9ff1=>_0xd7e9ef[_0x468eda(0x1d1)]['getOutputSchemaWithCache'](_0x3d9ff1)};let {pathToId:_0x5b4a41,idToPath:_0x44e367}=buildFolderMaps(_0x2638e4);const _0x489191=buildSegmentLookupMap(_0xdb339f,_0x44e367),_0x56d7d5=buildSegmentNameToIdMap(_0xdb339f),_0xd8d219=buildJourneyBundleLookupMap(_0x288cd3,_0x44e367);let _0x1827ed;if(_0x3fb7f0){if(!_0x3fb7f0['endsWith']('.yml')&&!_0x3fb7f0[_0x468eda(0x192)](_0x468eda(0x1d0)))return console[_0x468eda(0x174)](a32_0x4d4cc0[_0x468eda(0x173)](_0x468eda(0x1e7)+_0x3fb7f0+'\x0a')),0x1;_0x1827ed=[_0x3fb7f0];}else _0x1827ed=findYamlFiles(_0x242d46);if(_0x1827ed[_0x468eda(0x1ba)]===0x0)return console['error'](a32_0x4d4cc0[_0x468eda(0x173)]('Error:\x20No\x20YAML\x20files\x20found\x20in\x20'+_0x242d46+'\x0a')),console['error'](a32_0x4d4cc0[_0x468eda(0x1a6)](_0x468eda(0x17b))),0x1;let _0x4d8ce5,_0x2bc766;try{const _0x503be5=parseAndClassifyYamlFiles(_0x1827ed,_0x242d46,{'skipSegments':_0x26f0c8['journeysOnly']});_0x4d8ce5=_0x503be5[_0x468eda(0x162)],_0x2bc766=_0x503be5[_0x468eda(0x16a)];const _0x224b23=validateParsedFiles(_0x503be5,_0x242d46);if(_0x224b23[_0x468eda(0x1ba)]>0x0)return console['error'](a32_0x4d4cc0[_0x468eda(0x173)](_0x468eda(0x158))),console[_0x468eda(0x174)](formatValidationErrors(_0x224b23)),console['error'](a32_0x4d4cc0[_0x468eda(0x195)]('\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.')),0x1;}catch(_0x438fae){return console[_0x468eda(0x174)](a32_0x4d4cc0[_0x468eda(0x173)](_0x468eda(0x167)+(_0x438fae instanceof Error?_0x438fae[_0x468eda(0x1d2)]:_0x438fae))),0x1;}if(_0x4d8ce5[_0x468eda(0x1ba)]===0x0&&_0x2bc766['length']===0x0){const _0x92b4b1=_0x26f0c8[_0x468eda(0x199)]?'journey':_0x468eda(0x1b5);return console[_0x468eda(0x174)](a32_0x4d4cc0[_0x468eda(0x195)](_0x468eda(0x18b)+_0x92b4b1+_0x468eda(0x1d9))),0x0;}const _0x56d545=new Map();_0xdb339f[_0x468eda(0x1ba)]>0x0&&!_0x26f0c8[_0x468eda(0x199)]&&await withSpinner('Fetching\x20existing\x20activations...',async()=>{await batchAsync(_0xdb339f,async _0x4151a5=>{const _0x3c5300=a32_0x5532,_0xe0f7b2=await _0xd7e9ef['segment'][_0x3c5300(0x1e8)](_0xafeda5,_0x4151a5['id']);_0x56d545[_0x3c5300(0x16b)](_0x4151a5['id'],_0xe0f7b2);});},{'verbose':_0x26f0c8['verbose']});const {segmentFiles:_0x3135aa,foldersToCreate:_0x394760}=await prepareSegmentFiles(_0x4d8ce5,{'segmentByFolderAndName':_0x489191,'activationsBySegmentId':_0x56d545,'folderPathToId':_0x5b4a41,'idToEmailMap':_0x222683,'connectionIdToNameMap':_0x1b410d},_0x17087f,_0x4fac47,_0x143744),_0x28f51a=_0x3fb7f0?[]:findSegmentsToDelete(_0xdb339f,_0x4d8ce5[_0x468eda(0x15b)](({yamlConfig:_0x3f572d,folderPath:_0x58c674})=>({'yamlConfig':_0x3f572d,'folderPath':resolveTDFolderPath(_0x58c674,_0x4fac47,_0x143744)})),_0x44e367,_0x143744,_0x4fac47),{journeyFiles:_0x3a7416,foldersToCreate:_0x25da73}=await withProgressSpinner(_0x468eda(0x1bc),async _0x11e9b0=>prepareJourneyFiles(_0x2bc766,{'fetchJourney':async _0xf8ff60=>_0xd7e9ef[_0x468eda(0x168)][_0x468eda(0x166)](_0xf8ff60[_0x468eda(0x175)]),'journeyBundlesByFolderAndName':_0xd8d219,'folderPathToId':_0x5b4a41,'idToEmailMap':_0x222683,'connectionIdToNameMap':_0x1b410d,'existingSegments':_0xdb339f,'parentId':_0xafeda5,'deps':_0xd7e9ef,'progress':{'update':_0xe36ef2=>{const _0x8bea65=_0x468eda;_0x11e9b0[_0x8bea65(0x15f)](_0xe36ef2),_0x26f0c8['verbose']&&console['error']('\x20\x20'+_0xe36ef2);}},'journeyById':_0x4d40d1,'activationStepsById':_0x410842},_0x4fac47,_0x143744),{'verbose':_0x26f0c8['verbose']})[_0x468eda(0x15c)](_0x53c1d0=>_0x53c1d0[_0x468eda(0x19d)]);for(const _0x48f53d of _0x25da73){_0x394760[_0x468eda(0x1c3)](_0x48f53d);}const _0x5d8b11=_0x3fb7f0?[]:findJourneysToDelete(_0x288cd3,_0x2bc766[_0x468eda(0x15b)](({yamlConfig:_0x35ea88,folderPath:_0x1991dc})=>({'yamlConfig':_0x35ea88,'folderPath':resolveTDFolderPath(_0x1991dc,_0x4fac47,_0x143744)})),_0x44e367,_0x143744,_0x4fac47),_0x5a7fd2=calculatePushStats(_0x3135aa,_0x3a7416,_0x394760,_0x28f51a,_0x5d8b11,!!_0x26f0c8[_0x468eda(0x17a)],!!_0x26f0c8[_0x468eda(0x199)]),_0x292430=_0x5a7fd2[_0x468eda(0x162)][_0x468eda(0x16d)],_0x378371=_0x5a7fd2[_0x468eda(0x162)]['changed'],_0x143e03=_0x5a7fd2['segments'][_0x468eda(0x178)],_0x3b5667=_0x5a7fd2[_0x468eda(0x162)][_0x468eda(0x1a2)],_0x534e8e=_0x5a7fd2[_0x468eda(0x1ec)][_0x468eda(0x155)],_0x730010=_0x5a7fd2[_0x468eda(0x16a)][_0x468eda(0x16d)],_0x5980e4=_0x5a7fd2['journeys'][_0x468eda(0x1d7)],_0x2cb2aa=_0x5a7fd2['journeys']['unchanged'],_0x3a0b56=_0x5a7fd2[_0x468eda(0x16a)][_0x468eda(0x1a2)],_0x44f573=_0x5a7fd2[_0x468eda(0x194)][_0x468eda(0x1bb)],_0x38d0d2=_0x5a7fd2[_0x468eda(0x194)][_0x468eda(0x155)],_0x581ed4=_0x5a7fd2[_0x468eda(0x194)][_0x468eda(0x17e)],_0x1bb550=_0x5a7fd2[_0x468eda(0x194)][_0x468eda(0x1a2)];console[_0x468eda(0x174)]('\x0aPush\x20summary\x20for\x20\x27'+_0x3e9b70+'\x27:');_0x534e8e[_0x468eda(0x1ba)]>0x0&&console[_0x468eda(0x174)]('\x20\x20'+a32_0x4d4cc0[_0x468eda(0x193)](_0x468eda(0x1ad)+_0x534e8e[_0x468eda(0x1ba)]+_0x468eda(0x154)));if(!_0x26f0c8[_0x468eda(0x199)]){console[_0x468eda(0x174)](_0x468eda(0x16e)),console[_0x468eda(0x174)]('\x20\x20\x20\x20'+a32_0x4d4cc0[_0x468eda(0x1b0)]('+\x20'+_0x292430[_0x468eda(0x1ba)]+_0x468eda(0x19f))),console[_0x468eda(0x174)](_0x468eda(0x19c)+a32_0x4d4cc0['yellow']('~\x20'+_0x378371[_0x468eda(0x1ba)]+_0x468eda(0x18d)));if(_0x3b5667[_0x468eda(0x1ba)]>0x0)console[_0x468eda(0x174)]('\x20\x20\x20\x20'+a32_0x4d4cc0['red']('-\x20'+_0x3b5667[_0x468eda(0x1ba)]+'\x20to\x20delete'));else _0x28f51a[_0x468eda(0x1ba)]>0x0&&!_0x26f0c8['delete']&&console[_0x468eda(0x174)](_0x468eda(0x19c)+a32_0x4d4cc0[_0x468eda(0x1b2)](_0x28f51a['length']+_0x468eda(0x170)));console[_0x468eda(0x174)](_0x468eda(0x19c)+a32_0x4d4cc0['dim']('=\x20'+_0x143e03[_0x468eda(0x1ba)]+_0x468eda(0x1a0)));}if(_0x3a7416[_0x468eda(0x1ba)]>0x0||_0x5d8b11[_0x468eda(0x1ba)]>0x0){console[_0x468eda(0x174)](_0x468eda(0x17c)),console[_0x468eda(0x174)](_0x468eda(0x19c)+a32_0x4d4cc0[_0x468eda(0x1b0)]('+\x20'+_0x730010['length']+'\x20new')),console['error'](_0x468eda(0x19c)+a32_0x4d4cc0['yellow']('~\x20'+_0x5980e4[_0x468eda(0x1ba)]+_0x468eda(0x18d)));if(_0x3a0b56[_0x468eda(0x1ba)]>0x0)console[_0x468eda(0x174)](_0x468eda(0x19c)+a32_0x4d4cc0[_0x468eda(0x173)]('-\x20'+_0x3a0b56[_0x468eda(0x1ba)]+_0x468eda(0x1c1)));else _0x5d8b11[_0x468eda(0x1ba)]>0x0&&!_0x26f0c8['delete']&&console['error'](_0x468eda(0x19c)+a32_0x4d4cc0['dim'](_0x5d8b11[_0x468eda(0x1ba)]+_0x468eda(0x170)));console[_0x468eda(0x174)](_0x468eda(0x19c)+a32_0x4d4cc0['dim']('=\x20'+_0x2cb2aa[_0x468eda(0x1ba)]+_0x468eda(0x1a0)));}_0x44f573[_0x468eda(0x1ba)]>0x0&&!_0x26f0c8[_0x468eda(0x199)]&&(console[_0x468eda(0x174)](''),console['error'](_0x468eda(0x18f)),_0x38d0d2[_0x468eda(0x1ba)]>0x0&&console['error'](_0x468eda(0x19c)+a32_0x4d4cc0[_0x468eda(0x1b0)]('+\x20'+_0x38d0d2[_0x468eda(0x1ba)]+_0x468eda(0x1b6))),_0x581ed4['length']>0x0&&console[_0x468eda(0x174)](_0x468eda(0x19c)+a32_0x4d4cc0[_0x468eda(0x195)]('~\x20'+_0x581ed4[_0x468eda(0x1ba)]+_0x468eda(0x19a))),_0x1bb550[_0x468eda(0x1ba)]>0x0&&console[_0x468eda(0x174)](_0x468eda(0x19c)+a32_0x4d4cc0[_0x468eda(0x173)]('-\x20'+_0x1bb550[_0x468eda(0x1ba)]+'\x20to\x20delete')));console['error'](_0x468eda(0x182)+a32_0x4d4cc0['cyan'](_0x242d46)+'\x0a');if(_0x534e8e[_0x468eda(0x1ba)]>0x0){console['error'](_0x468eda(0x164));for(const _0x481ed1 of _0x534e8e){console['error']('\x20\x20'+a32_0x4d4cc0['blue']('+')+'\x20'+_0x481ed1);}console['error']('');}if(_0x292430['length']>0x0&&!_0x26f0c8[_0x468eda(0x199)])for(const _0x35c79e of _0x292430){const _0x574160=_0x35c79e[_0x468eda(0x1bf)]?_0x35c79e[_0x468eda(0x1bf)]+'/'+_0x35c79e[_0x468eda(0x18c)][_0x468eda(0x160)]:_0x35c79e[_0x468eda(0x18c)][_0x468eda(0x160)],_0x2ecfa9=_0x35c79e[_0x468eda(0x18c)][_0x468eda(0x194)]?.['length']||0x0,_0x1f2027=_0x2ecfa9>0x0?a32_0x4d4cc0['dim']('\x20['+_0x2ecfa9+_0x468eda(0x1c6)):'';console['error']('\x0a'+a32_0x4d4cc0['green']('New\x20segment:')+'\x20'+_0x574160+_0x1f2027),console[_0x468eda(0x174)]('─'[_0x468eda(0x1eb)](0x3c)),_0x35c79e['diff']&&console[_0x468eda(0x174)](_0x35c79e[_0x468eda(0x1cc)]),console[_0x468eda(0x174)]('─'[_0x468eda(0x1eb)](0x3c));}if(_0x3b5667[_0x468eda(0x1ba)]>0x0&&!_0x26f0c8[_0x468eda(0x199)])for(const _0x2db139 of _0x3b5667){const _0x48b810=_0x2db139['segmentFolderId']?_0x44e367[_0x468eda(0x1c2)](_0x2db139['segmentFolderId'][_0x468eda(0x1cd)]())||'':'',_0x3afe53=_0x48b810?_0x48b810+'/'+_0x2db139[_0x468eda(0x160)]:_0x2db139[_0x468eda(0x160)],_0x2c8c48=_0x56d545['get'](_0x2db139['id'])||[],_0x27342c=_0x2c8c48[_0x468eda(0x1ba)]>0x0?a32_0x4d4cc0[_0x468eda(0x1b2)]('\x20['+_0x2c8c48['length']+_0x468eda(0x1c6)):'';console[_0x468eda(0x174)]('\x0a'+a32_0x4d4cc0['red'](_0x468eda(0x1bd))+'\x20'+_0x3afe53+_0x27342c),console[_0x468eda(0x174)]('─'[_0x468eda(0x1eb)](0x3c));const _0x9674de=segmentWithActivationsToYaml(_0x2db139,_0x2c8c48,undefined,_0x222683,_0x1b410d),_0x3b34b5=segmentToYamlString(_0x9674de),_0x953575=generateDiff(_0x3b34b5,'');console['error'](formatDiffWithColors(_0x953575)),console[_0x468eda(0x174)]('─'[_0x468eda(0x1eb)](0x3c));}const _0x66988c=_0x3135aa[_0x468eda(0x1e1)](_0x2799a6=>!_0x2799a6[_0x468eda(0x1e9)]&&_0x2799a6[_0x468eda(0x1cc)]);if(_0x66988c[_0x468eda(0x1ba)]>0x0&&!_0x26f0c8[_0x468eda(0x199)])for(const _0x2600ec of _0x66988c){const _0x1e32b1=_0x2600ec[_0x468eda(0x1bf)]?_0x2600ec['folderPath']+'/'+_0x2600ec['yamlConfig']['name']:_0x2600ec[_0x468eda(0x18c)][_0x468eda(0x160)];console['error']('\x0a'+a32_0x4d4cc0['yellow'](_0x468eda(0x177))+'\x20'+_0x1e32b1),console[_0x468eda(0x174)]('─'[_0x468eda(0x1eb)](0x3c)),console[_0x468eda(0x174)](_0x2600ec[_0x468eda(0x1cc)]),console[_0x468eda(0x174)]('─'[_0x468eda(0x1eb)](0x3c));}if(_0x730010['length']>0x0)for(const _0x542179 of _0x730010){const _0x50fdea=_0x542179[_0x468eda(0x1bf)]?_0x542179[_0x468eda(0x1bf)]+'/'+_0x542179['yamlConfig'][_0x468eda(0x160)]:_0x542179[_0x468eda(0x18c)][_0x468eda(0x160)];console[_0x468eda(0x174)]('\x0a'+a32_0x4d4cc0[_0x468eda(0x1b0)](_0x468eda(0x159))+'\x20'+_0x50fdea),console[_0x468eda(0x174)]('─'[_0x468eda(0x1eb)](0x3c)),_0x542179[_0x468eda(0x1cc)]&&console[_0x468eda(0x174)](_0x542179[_0x468eda(0x1cc)]),console[_0x468eda(0x174)]('─'['repeat'](0x3c));}const _0x561009=_0x3a7416[_0x468eda(0x1e1)](_0x89c181=>!_0x89c181[_0x468eda(0x1e9)]&&_0x89c181[_0x468eda(0x1cc)]);if(_0x561009[_0x468eda(0x1ba)]>0x0)for(const _0x3ccf58 of _0x561009){const _0x4ce288=_0x3ccf58[_0x468eda(0x1bf)]?_0x3ccf58[_0x468eda(0x1bf)]+'/'+_0x3ccf58[_0x468eda(0x18c)]['name']:_0x3ccf58[_0x468eda(0x18c)][_0x468eda(0x160)];console[_0x468eda(0x174)]('\x0a'+a32_0x4d4cc0['yellow']('Changes\x20to\x20journey:')+'\x20'+_0x4ce288),console[_0x468eda(0x174)]('─'['repeat'](0x3c)),console[_0x468eda(0x174)](_0x3ccf58[_0x468eda(0x1cc)]),console[_0x468eda(0x174)]('─'[_0x468eda(0x1eb)](0x3c));}if(_0x3a0b56['length']>0x0)for(const _0x8c1a43 of _0x3a0b56){const _0x46e3c4=_0x8c1a43['folderId']?_0x44e367['get'](_0x8c1a43['folderId'])||'':'',_0x42ae00=_0x46e3c4?_0x46e3c4+'/'+_0x8c1a43[_0x468eda(0x1dd)]:_0x8c1a43[_0x468eda(0x1dd)];console['error']('\x0a'+a32_0x4d4cc0[_0x468eda(0x173)]('Delete\x20journey:')+'\x20'+_0x42ae00),console[_0x468eda(0x174)]('─'[_0x468eda(0x1eb)](0x3c)),console[_0x468eda(0x174)](a32_0x4d4cc0[_0x468eda(0x173)](_0x468eda(0x1a4))),console[_0x468eda(0x174)]('─'[_0x468eda(0x1eb)](0x3c));}if(_0x26f0c8[_0x468eda(0x1db)])return console[_0x468eda(0x174)](a32_0x4d4cc0[_0x468eda(0x195)]('\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made')),0x0;const _0x1981ed=_0x26f0c8['journeysOnly']?![]:_0x292430['length']>0x0||_0x378371[_0x468eda(0x1ba)]>0x0||_0x3b5667['length']>0x0,_0x341099=_0x730010[_0x468eda(0x1ba)]>0x0||_0x5980e4[_0x468eda(0x1ba)]>0x0||_0x3a0b56['length']>0x0,_0x3beb48=_0x26f0c8[_0x468eda(0x199)]?![]:_0x44f573[_0x468eda(0x1ba)]>0x0,_0x1b7bbf=_0x534e8e[_0x468eda(0x1ba)]>0x0;if(!_0x1981ed&&!_0x341099&&!_0x3beb48&&!_0x1b7bbf){const _0x1e8357=_0x26f0c8[_0x468eda(0x199)]?_0x468eda(0x190):_0x468eda(0x1c0);console[_0x468eda(0x174)](a32_0x4d4cc0[_0x468eda(0x1b0)](_0x1e8357));if(_0x3fb7f0&&_0x2cb2aa[_0x468eda(0x1ba)]===0x1){const _0x1c3515=_0x2cb2aa[0x0];if(_0x1c3515[_0x468eda(0x15d)]?.['id']){const _0x207ec3=getConsoleNextUrl(_0x26f0c8[_0x468eda(0x176)],_0x468eda(0x198)+_0xafeda5+_0x468eda(0x1d3)+_0x1c3515[_0x468eda(0x15d)]['id']+_0x468eda(0x1a8));console[_0x468eda(0x174)]('\x20\x20'+a32_0x4d4cc0['cyan'](_0x207ec3));}}return 0x0;}const _0x470fc7=_0x26f0c8[_0x468eda(0x199)]?_0x730010[_0x468eda(0x1ba)]+_0x5980e4[_0x468eda(0x1ba)]+_0x3a0b56['length']+_0x534e8e[_0x468eda(0x1ba)]:_0x292430[_0x468eda(0x1ba)]+_0x378371[_0x468eda(0x1ba)]+_0x3b5667[_0x468eda(0x1ba)]+_0x730010[_0x468eda(0x1ba)]+_0x5980e4[_0x468eda(0x1ba)]+_0x3a0b56[_0x468eda(0x1ba)]+_0x534e8e[_0x468eda(0x1ba)]+_0x44f573['length'];if(!_0x26f0c8[_0x468eda(0x163)]&&_0x470fc7>0x0){if(!isInteractive())return console[_0x468eda(0x174)](a32_0x4d4cc0[_0x468eda(0x173)](_0x468eda(0x1a9)),_0x468eda(0x1da)),console['error'](a32_0x4d4cc0[_0x468eda(0x1b2)](_0x468eda(0x187))),0x1;const _0x6c90e7=await confirmKey(_0x468eda(0x16c)+_0x470fc7+_0x468eda(0x1b9));if(!_0x6c90e7)return console['error'](a32_0x4d4cc0[_0x468eda(0x195)](_0x468eda(0x1cf))),0x1;}const _0x5c4a3f={'withProgress':async(_0x3043c7,_0x4cb5b0)=>{const _0x41eca1=_0x468eda,_0x3725ca=await withSpinner(_0x3043c7,_0x4cb5b0,{'verbose':_0x26f0c8['verbose']});return{'data':_0x3725ca[_0x41eca1(0x19d)]};},'logInfo':_0x335213=>console[_0x468eda(0x174)](a32_0x4d4cc0[_0x468eda(0x193)]('✔\x20'+_0x335213)),'logSuccess':_0x297b67=>console[_0x468eda(0x174)](a32_0x4d4cc0[_0x468eda(0x1b0)]('✔\x20'+_0x297b67)),'logWarning':_0x1c8ade=>console[_0x468eda(0x174)](a32_0x4d4cc0[_0x468eda(0x195)]('⚠\x20'+_0x1c8ade)),'logDeleted':_0x3abc38=>console[_0x468eda(0x174)](a32_0x4d4cc0[_0x468eda(0x173)]('✔\x20'+_0x3abc38))},_0x2bbd31={'segment':_0xd7e9ef[_0x468eda(0x188)],'journey':_0xd7e9ef[_0x468eda(0x168)],'user':_0xd7e9ef[_0x468eda(0x183)],'connection':_0xd7e9ef[_0x468eda(0x1d1)]};_0x534e8e[_0x468eda(0x1ba)]>0x0&&(_0x5b4a41=await executePushFolders(_0x2bbd31,_0x534e8e,_0x5b4a41,{'parentId':_0xafeda5},_0x5c4a3f));const _0x413c2a={'rootFolderId':_0x116de1,'folderPathToId':_0x5b4a41,'folderIdToPath':_0x44e367,'segmentNameToId':_0x56d7d5,'activationsBySegmentId':_0x56d545,'emailToIdMap':_0x4b83c3,'idToEmailMap':_0x222683,'connectionNameToIdMap':_0x4c570d['nameToId'],'connectionIdToNameMap':_0x4c570d[_0x468eda(0x18a)],'connectionNameToTypeMap':_0x1ae000},_0x2de8d1=await executePushSegments(_0x2bbd31,_0x26f0c8[_0x468eda(0x199)]?[]:_0x3135aa,_0x413c2a,{'parentId':_0xafeda5},_0x5c4a3f),_0x30567=_0x2de8d1[_0x468eda(0x1c5)],_0x5343ba=_0x2de8d1['updated'],_0x5dec41=_0x2de8d1[_0x468eda(0x194)][_0x468eda(0x1c5)],_0x47ca6f=_0x2de8d1[_0x468eda(0x194)]['updated'],_0x3a4ddf=_0x2de8d1[_0x468eda(0x194)][_0x468eda(0x1d8)],_0x5ea4d3=await executePushSegmentDeletions(_0x2bbd31,_0x26f0c8[_0x468eda(0x199)]?[]:_0x3b5667,_0x5c4a3f);let _0x32da82=0x0,_0x2a9695=0x0,_0x5a3342=0x0;const _0xc77e66=new Map(_0x56d7d5);for(const [_0x3a1aa0,_0xcf642e]of _0x2de8d1[_0x468eda(0x179)]){_0xc77e66[_0x468eda(0x16b)](_0x3a1aa0,_0xcf642e);}if(_0x3a7416[_0x468eda(0x1ba)]>0x0){const _0x135c9f={..._0x413c2a,'segmentNameToId':_0xc77e66,'existingSegments':_0xdb339f,'activationContext':_0x17087f},_0x5d08e8=await executePushJourneys(_0x2bbd31,_0x3a7416,_0x135c9f,{'parentId':_0xafeda5,'rootFolderId':_0x116de1,'verbose':_0x26f0c8['verbose']},_0x5c4a3f);_0x32da82=_0x5d08e8[_0x468eda(0x1c5)],_0x2a9695=_0x5d08e8[_0x468eda(0x17f)];if(_0x3fb7f0&&_0x5d08e8[_0x468eda(0x1b8)][_0x468eda(0x1ba)]===0x1){const _0x19919c=_0x5d08e8[_0x468eda(0x1b8)][0x0];if(_0x19919c[_0x468eda(0x175)]){const _0x12772e=getConsoleNextUrl(_0x26f0c8[_0x468eda(0x176)],_0x468eda(0x198)+_0xafeda5+_0x468eda(0x1d3)+_0x19919c['journeyId']+_0x468eda(0x1a8));console['error']('\x20\x20'+a32_0x4d4cc0['cyan'](_0x12772e));}}}for(const _0x868669 of _0x3a0b56){console['error'](a32_0x4d4cc0[_0x468eda(0x195)](_0x468eda(0x1ca)+_0x868669[_0x468eda(0x1dd)])),_0x5a3342++;}const _0xeb0efb=[];if(_0x30567>0x0)_0xeb0efb['push'](_0x30567+'\x20created');if(_0x5343ba>0x0)_0xeb0efb[_0x468eda(0x1b7)](_0x5343ba+_0x468eda(0x1ab));if(_0x5ea4d3>0x0)_0xeb0efb[_0x468eda(0x1b7)](_0x5ea4d3+'\x20deleted');const _0x16b30b=[];if(_0x32da82>0x0)_0x16b30b[_0x468eda(0x1b7)](_0x32da82+_0x468eda(0x196));if(_0x2a9695>0x0)_0x16b30b[_0x468eda(0x1b7)](_0x2a9695+_0x468eda(0x1ab));if(_0x5a3342>0x0)_0x16b30b[_0x468eda(0x1b7)](_0x5a3342+_0x468eda(0x1be));const _0x1b3d94=[];if(_0x5dec41>0x0)_0x1b3d94[_0x468eda(0x1b7)](_0x5dec41+_0x468eda(0x196));if(_0x47ca6f>0x0)_0x1b3d94[_0x468eda(0x1b7)](_0x47ca6f+_0x468eda(0x1ab));if(_0x3a4ddf>0x0)_0x1b3d94[_0x468eda(0x1b7)](_0x3a4ddf+_0x468eda(0x1be));return console['error'](a32_0x4d4cc0[_0x468eda(0x1b0)]('\x0a✔\x20Push\x20complete')),_0xeb0efb['length']>0x0&&!_0x26f0c8['journeysOnly']&&console[_0x468eda(0x174)](_0x468eda(0x1ae)+_0xeb0efb[_0x468eda(0x1c9)](',\x20')),_0x16b30b[_0x468eda(0x1ba)]>0x0&&console[_0x468eda(0x174)]('\x20\x20Journeys:\x20'+_0x16b30b['join'](',\x20')),_0x1b3d94[_0x468eda(0x1ba)]>0x0&&!_0x26f0c8[_0x468eda(0x199)]&&console[_0x468eda(0x174)]('\x20\x20Activations:\x20'+_0x1b3d94['join'](',\x20')),0x0;}}