@treasuredata/tdx 0.28.6 → 0.28.8

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 (181) 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/delivery-command.js +1 -1
  18. package/dist/commands/describe.js +1 -1
  19. package/dist/commands/engage-campaign-pull-command.js +1 -1
  20. package/dist/commands/engage-campaign-push-command.js +1 -1
  21. package/dist/commands/engage-campaign-validate-command.js +1 -1
  22. package/dist/commands/engage-command.js +1 -1
  23. package/dist/commands/job-command.js +1 -1
  24. package/dist/commands/journey-command.js +1 -1
  25. package/dist/commands/journey-validate-command.js +1 -1
  26. package/dist/commands/llm-command.js +1 -1
  27. package/dist/commands/mcp-command.js +1 -1
  28. package/dist/commands/parent-segment-command.js +1 -1
  29. package/dist/commands/profile-command.js +1 -1
  30. package/dist/commands/profiles-command.js +1 -1
  31. package/dist/commands/query-command.js +1 -1
  32. package/dist/commands/schedule-command.js +1 -1
  33. package/dist/commands/segment-command.js +1 -1
  34. package/dist/commands/segment-create-command.js +1 -1
  35. package/dist/commands/segment-fields-command.js +1 -1
  36. package/dist/commands/segment-pull-command.js +1 -1
  37. package/dist/commands/segment-push-command.js +1 -1
  38. package/dist/commands/segment-update-command.js +1 -1
  39. package/dist/commands/segment-use-command.js +1 -1
  40. package/dist/commands/segment-validate-command.js +1 -1
  41. package/dist/commands/segments.js +1 -1
  42. package/dist/commands/show.js +1 -1
  43. package/dist/commands/status-command.js +1 -1
  44. package/dist/commands/tables.js +1 -1
  45. package/dist/commands/unset-command.js +1 -1
  46. package/dist/commands/upgrade-command.js +1 -1
  47. package/dist/commands/use-command.js +1 -1
  48. package/dist/commands/user-command.js +1 -1
  49. package/dist/commands/workflow-command.js +1 -1
  50. package/dist/core/auth.js +1 -1
  51. package/dist/core/command-output.js +1 -1
  52. package/dist/core/config.js +1 -1
  53. package/dist/core/connection-cache.js +1 -1
  54. package/dist/core/constants.js +1 -1
  55. package/dist/core/credential-cache.js +1 -1
  56. package/dist/core/global-context.js +1 -1
  57. package/dist/core/keychain.js +1 -1
  58. package/dist/core/profile.js +1 -1
  59. package/dist/core/project-config.js +1 -1
  60. package/dist/core/session.js +1 -1
  61. package/dist/core/user-cache.js +1 -1
  62. package/dist/core/version.js +1 -1
  63. package/dist/index.js +1 -1
  64. package/dist/mcp/server.js +1 -1
  65. package/dist/mcp/tools/index.js +1 -1
  66. package/dist/mcp/tools/tdx-run.js +1 -1
  67. package/dist/mcp/tools/tdx-search.js +1 -1
  68. package/dist/mcp/utils.js +1 -1
  69. package/dist/proxy/claude-usage-tracker.js +1 -1
  70. package/dist/proxy/passthrough-server.js +1 -1
  71. package/dist/proxy/sse-usage-parser.js +1 -1
  72. package/dist/sdk/agent/agent-config.js +1 -1
  73. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  74. package/dist/sdk/agent/agent-yaml.js +1 -1
  75. package/dist/sdk/agent/test/evaluator.js +1 -1
  76. package/dist/sdk/agent/test/executor.js +1 -1
  77. package/dist/sdk/agent/test/index.js +1 -1
  78. package/dist/sdk/agent/test/output.js +1 -1
  79. package/dist/sdk/agent/test/parser.js +1 -1
  80. package/dist/sdk/agent/tool-target-registry.js +1 -1
  81. package/dist/sdk/api.js +1 -1
  82. package/dist/sdk/client/cdp-api-client.js +1 -1
  83. package/dist/sdk/client/delivery-api-client.js +1 -1
  84. package/dist/sdk/client/endpoints.js +1 -1
  85. package/dist/sdk/client/engage-api-client.js +1 -1
  86. package/dist/sdk/client/http-client.js +1 -1
  87. package/dist/sdk/client/llm-api-client.js +1 -1
  88. package/dist/sdk/client/rate-limiter.js +1 -1
  89. package/dist/sdk/client/td-api-client.js +1 -1
  90. package/dist/sdk/client/trino-api-client.js +1 -1
  91. package/dist/sdk/client/workflow-client.js +1 -1
  92. package/dist/sdk/connection-validator.js +1 -1
  93. package/dist/sdk/connection.js +1 -1
  94. package/dist/sdk/delivery.js +1 -1
  95. package/dist/sdk/engage/campaign-pull.js +1 -1
  96. package/dist/sdk/engage/campaign-push.js +1 -1
  97. package/dist/sdk/engage/campaign-validator.js +1 -1
  98. package/dist/sdk/engage/campaign-yaml.js +1 -1
  99. package/dist/sdk/engage/types/campaign-def.js +1 -1
  100. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  101. package/dist/sdk/engage.js +1 -1
  102. package/dist/sdk/errors.js +1 -1
  103. package/dist/sdk/index.js +1 -1
  104. package/dist/sdk/io/index.js +1 -1
  105. package/dist/sdk/io/node-filesystem.js +1 -1
  106. package/dist/sdk/job.js +1 -1
  107. package/dist/sdk/journey.js +1 -1
  108. package/dist/sdk/llm/chat-cache.js +1 -1
  109. package/dist/sdk/llm/index.js +1 -1
  110. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  111. package/dist/sdk/llm/model-factors.js +1 -1
  112. package/dist/sdk/personalization.js +1 -1
  113. package/dist/sdk/query/index.js +1 -1
  114. package/dist/sdk/query/sql-parser.js +1 -1
  115. package/dist/sdk/realtime.js +1 -1
  116. package/dist/sdk/schedule.js +1 -1
  117. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  118. package/dist/sdk/segment/fields-display.js +1 -1
  119. package/dist/sdk/segment/file-discovery.js +1 -1
  120. package/dist/sdk/segment/journey-utils.js +1 -1
  121. package/dist/sdk/segment/journey-validator.js +1 -1
  122. package/dist/sdk/segment/journey-yaml.js +1 -1
  123. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  124. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  125. package/dist/sdk/segment/pull-workflow.js +1 -1
  126. package/dist/sdk/segment/push-recovery.js +1 -1
  127. package/dist/sdk/segment/push-workflow.js +1 -1
  128. package/dist/sdk/segment/resolution-context.js +1 -1
  129. package/dist/sdk/segment/segment-path-parser.js +1 -1
  130. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  131. package/dist/sdk/segment/target-resolution.js +1 -1
  132. package/dist/sdk/segment/tdx-config.js +1 -1
  133. package/dist/sdk/segment/validate-files.js +1 -1
  134. package/dist/sdk/segment/yaml-validator.js +1 -1
  135. package/dist/sdk/segment.js +1 -1
  136. package/dist/sdk/types/index.js +1 -1
  137. package/dist/sdk/types/progress.js +1 -1
  138. package/dist/sdk/user.js +1 -1
  139. package/dist/sdk/util/format-detector.js +1 -1
  140. package/dist/sdk/util/formatters.js +1 -1
  141. package/dist/sdk/util/index.js +1 -1
  142. package/dist/sdk/util/tree-formatter.js +1 -1
  143. package/dist/sdk/workflow/archive-validation.js +1 -1
  144. package/dist/sdk/workflow/clone-workflow.js +1 -1
  145. package/dist/sdk/workflow/index.js +1 -1
  146. package/dist/sdk/workflow/pull-workflow.js +1 -1
  147. package/dist/sdk/workflow/push-workflow.js +1 -1
  148. package/dist/sdk/workflow/tdx-config.js +1 -1
  149. package/dist/sdk/workflow/workflow-utils.js +1 -1
  150. package/dist/test-utils/command-runner.js +1 -1
  151. package/dist/test-utils/factories.js +1 -1
  152. package/dist/test-utils/fixtures.js +1 -1
  153. package/dist/test-utils/http-mock.js +1 -1
  154. package/dist/test-utils/index.js +1 -1
  155. package/dist/utils/async.js +1 -1
  156. package/dist/utils/colors.js +1 -1
  157. package/dist/utils/diff.js +1 -1
  158. package/dist/utils/file-permissions.js +1 -1
  159. package/dist/utils/file-reader.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/process.js +1 -1
  174. package/dist/utils/prompt.js +1 -1
  175. package/dist/utils/spinner.js +1 -1
  176. package/dist/utils/sse-parser.js +1 -1
  177. package/dist/utils/string-utils.js +1 -1
  178. package/dist/utils/table-ref-parser.js +1 -1
  179. package/dist/utils/tdx-logger.js +1 -1
  180. package/dist/utils/version-check.js +1 -1
  181. package/package.json +1 -1
@@ -1 +1 @@
1
- const a30_0x464544=a30_0x416e;(function(_0x26ee3f,_0x593f28){const _0x3ad120=a30_0x416e,_0x437b21=_0x26ee3f();while(!![]){try{const _0x45d5d5=-parseInt(_0x3ad120(0xed))/0x1*(-parseInt(_0x3ad120(0x137))/0x2)+-parseInt(_0x3ad120(0xd5))/0x3+-parseInt(_0x3ad120(0x117))/0x4+parseInt(_0x3ad120(0xce))/0x5+parseInt(_0x3ad120(0xe8))/0x6+parseInt(_0x3ad120(0xfd))/0x7*(-parseInt(_0x3ad120(0x13a))/0x8)+-parseInt(_0x3ad120(0x12a))/0x9;if(_0x45d5d5===_0x593f28)break;else _0x437b21['push'](_0x437b21['shift']());}catch(_0x3c04a7){_0x437b21['push'](_0x437b21['shift']());}}}(a30_0x4d38,0xed0d7));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput,writeOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{confirm}from'../utils/prompt.js';import{readFileSync}from'fs';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';function a30_0x416e(_0x5a85d8,_0x49077c){_0x5a85d8=_0x5a85d8-0xc1;const _0x4d3877=a30_0x4d38();let _0x416eeb=_0x4d3877[_0x5a85d8];return _0x416eeb;}import{hyperlink}from'../sdk/util/formatters.js';import a30_0x3e5b36 from'chalk';function formatRelativeTime(_0x23b07b){const _0x42574c=a30_0x416e,_0x4ca47b=new Date(_0x23b07b),_0x1c9e0f=new Date(),_0x41dd1f=_0x4ca47b[_0x42574c(0x10b)]()-_0x1c9e0f[_0x42574c(0x10b)](),_0x5f9874=Math[_0x42574c(0x123)](_0x41dd1f)/0x3e8,_0x4d8e77=_0x41dd1f<0x0;if(_0x5f9874<0x3c)return _0x4d8e77?_0x42574c(0xeb):_0x42574c(0x10f);else{if(_0x5f9874<0xe10){const _0xd78c4b=Math[_0x42574c(0xca)](_0x5f9874/0x3c);return _0x4d8e77?_0xd78c4b+'m\x20ago':_0x42574c(0xe7)+_0xd78c4b+'m';}else{if(_0x5f9874<0x15180){const _0x517e11=Math[_0x42574c(0xca)](_0x5f9874/0xe10);return _0x4d8e77?_0x517e11+_0x42574c(0xdd):_0x42574c(0xe7)+_0x517e11+'h';}else{if(_0x5f9874<0x93a80){const _0xcfc29b=Math['round'](_0x5f9874/0x15180);return _0x4d8e77?_0xcfc29b+_0x42574c(0xf7):_0x42574c(0xe7)+_0xcfc29b+'d';}else return _0x4ca47b['toLocaleDateString']();}}}}export class ScheduleListCommand extends BaseCommand{['name']='schedule:list';['description']=a30_0x464544(0x105);async['execute'](_0x33fd53){const _0x191589=a30_0x464544,{options:_0x41ddad,args:_0x26c85b,tdx:_0x45deec}=_0x33fd53,_0x5dda2e=resolveLimit(_0x41ddad[_0x191589(0xd8)],DEFAULT_DISPLAY_LIMIT),_0x443a9d=_0x26c85b[0x0],_0x5b1de2=_0x443a9d?_0x191589(0x142)+_0x443a9d+_0x191589(0x11c):'Listing\x20scheduled\x20queries...',_0x18b65c=await withSpinner(_0x5b1de2,()=>_0x45deec[_0x191589(0xc7)][_0x191589(0x13d)]({'limit':_0x5dda2e,'scheduled':!![],'pattern':_0x443a9d}),{'verbose':_0x41ddad[_0x191589(0x14b)]}),_0x253849=_0x18b65c[_0x191589(0xec)][_0x191589(0x11e)],_0x110964=_0x18b65c['data'][_0x191589(0x111)][_0x191589(0xdc)],_0x49741a=_0x443a9d?_0x191589(0x12c)+_0x443a9d+'\x22':'';_0x110964?console[_0x191589(0x12e)](_0x191589(0x131)+_0x253849['length']+_0x191589(0x11f)+_0x49741a+_0x191589(0xc4)):console[_0x191589(0x12e)](_0x191589(0x115)+_0x253849[_0x191589(0x146)]+_0x191589(0x136)+(_0x253849[_0x191589(0x146)]!==0x1?'ies':'y')+_0x49741a);if(_0x41ddad[_0x191589(0xc8)]===_0x191589(0xef)||_0x41ddad[_0x191589(0xc8)]===_0x191589(0x130)||_0x41ddad[_0x191589(0xc8)]==='table'||_0x41ddad[_0x191589(0xc8)]==='tsv'){const _0x3aaea9=_0x253849[_0x191589(0x119)](_0x4e8b71=>({'id':_0x4e8b71['id'],'name':_0x4e8b71[_0x191589(0x100)],'cron':_0x4e8b71[_0x191589(0x113)],'database':_0x4e8b71['database']?.['name'],'type':_0x4e8b71[_0x191589(0x145)],'timezone':_0x4e8b71['time_zone'],'user_name':_0x4e8b71[_0x191589(0x108)]?.[_0x191589(0x100)],'updated_at':_0x4e8b71['updated_at'],'next_run_at':_0x4e8b71[_0x191589(0x14a)],'last_job_status':_0x4e8b71['last_job']?.[_0x191589(0x118)]}));await handleSDKOutput(_0x3aaea9,_0x41ddad);}else{if(_0x253849['length']===0x0)console[_0x191589(0xee)]('No\x20scheduled\x20queries\x20found');else{const _0x4040e5=_0x41ddad[_0x191589(0x114)],_0x40fc14=_0x253849[_0x191589(0x119)](_0x31ed63=>{const _0x12ea41=_0x191589,_0x1809c2=_0x31ed63[_0x12ea41(0xf0)]?.[_0x12ea41(0x118)]?_0x31ed63[_0x12ea41(0xf0)]['status']===_0x12ea41(0xe1)?'✓':'✗':'-',_0xb9c12f=_0x31ed63[_0x12ea41(0xf0)]?.[_0x12ea41(0x132)]?formatRelativeTime(_0x31ed63['last_job'][_0x12ea41(0x132)]):_0x12ea41(0xf2),_0x2a3812=_0x31ed63['next_run_at']?formatRelativeTime(_0x31ed63[_0x12ea41(0x14a)]):'-',_0x14189c=_0x31ed63[_0x12ea41(0x113)]||'',_0x1a2076=_0x31ed63['name']||_0x12ea41(0xd1),_0x23155a=getConsoleUrl(_0x4040e5,_0x12ea41(0x112)+_0x31ed63['id']);return{'statusIcon':_0x1809c2,'lastRun':_0xb9c12f,'nextRun':_0x2a3812,'cron':_0x14189c,'name':_0x1a2076,'queryUrl':_0x23155a,'status':_0x31ed63[_0x12ea41(0xf0)]?.[_0x12ea41(0x118)]};}),_0x33d9af=Math['max'](..._0x40fc14[_0x191589(0x119)](_0x32c581=>_0x32c581[_0x191589(0x11d)][_0x191589(0x146)])),_0x4d77a9=Math['max'](..._0x40fc14[_0x191589(0x119)](_0x26e35d=>_0x26e35d['nextRun'][_0x191589(0x146)])),_0x24b2ce=Math[_0x191589(0xfb)](..._0x40fc14['map'](_0x31e96d=>_0x31e96d[_0x191589(0x113)][_0x191589(0x146)])),_0x382ccf=_0x40fc14[_0x191589(0x119)](_0x1b31bb=>{const _0x14a9fc=_0x191589,_0x50827c=_0x1b31bb[_0x14a9fc(0x118)]===_0x14a9fc(0xe1)?a30_0x3e5b36[_0x14a9fc(0x13b)](_0x1b31bb['statusIcon']):_0x1b31bb[_0x14a9fc(0x118)]===_0x14a9fc(0x12e)?a30_0x3e5b36[_0x14a9fc(0x10a)](_0x1b31bb[_0x14a9fc(0xf4)]):a30_0x3e5b36['dim'](_0x1b31bb[_0x14a9fc(0xf4)]),_0x49484e=_0x1b31bb[_0x14a9fc(0x11d)]['padEnd'](_0x33d9af),_0x218043=_0x1b31bb['nextRun'][_0x14a9fc(0x149)](_0x4d77a9),_0x41ec96=_0x1b31bb['cron']?a30_0x3e5b36[_0x14a9fc(0xd7)](_0x1b31bb['cron'][_0x14a9fc(0x149)](_0x24b2ce)):'\x20'[_0x14a9fc(0x140)](_0x24b2ce),_0x4f4fe2=hyperlink(_0x1b31bb['name'],_0x1b31bb[_0x14a9fc(0xc2)]);return'📅\x20'+_0x50827c+'\x20'+_0x49484e+_0x14a9fc(0x144)+_0x218043+'\x20\x20'+_0x41ec96+'\x20\x20'+_0x4f4fe2;});await writeOutput(_0x382ccf[_0x191589(0x13c)]('\x0a'),_0x41ddad[_0x191589(0xe0)],_0x191589(0x122));}}return 0x0;}}export class ScheduleShowCommand extends BaseCommand{['name']=a30_0x464544(0xde);[a30_0x464544(0xcc)]='Show\x20schedule\x20details';['validate'](_0x56fd53){const _0x55f357=_0x56fd53['args'][0x0];if(!_0x55f357)return'Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20show\x20<name>';return undefined;}async[a30_0x464544(0x109)](_0x491f97){const _0x2a3129=a30_0x464544,{options:_0x4c7ca0,args:_0x4f6cfd,tdx:_0x2c69cb}=_0x491f97,_0x58f1ce=_0x4f6cfd[0x0],_0x5ea242=await withSpinner(_0x2a3129(0x12f),()=>_0x2c69cb['schedules'][_0x2a3129(0xf1)](_0x58f1ce),{'verbose':_0x4c7ca0[_0x2a3129(0x14b)]}),_0x1002ac=_0x5ea242[_0x2a3129(0xec)],_0x86297b={'name':_0x1002ac[_0x2a3129(0x100)],'cron':_0x1002ac[_0x2a3129(0x113)],'database':_0x1002ac[_0x2a3129(0xfe)],'type':_0x1002ac[_0x2a3129(0x145)],'timezone':_0x1002ac[_0x2a3129(0xc6)],'user_name':_0x1002ac[_0x2a3129(0xe9)],'created_at':_0x1002ac['created_at'],'engine_version':_0x1002ac['engine_version'],'executing_user_id':_0x1002ac[_0x2a3129(0xc9)],'query':_0x1002ac[_0x2a3129(0xd3)],'delay':_0x1002ac['delay'],'priority':_0x1002ac[_0x2a3129(0xf6)],'retry_limit':_0x1002ac[_0x2a3129(0x106)],..._0x1002ac[_0x2a3129(0x14c)]&&{'result':_0x1002ac[_0x2a3129(0x14c)]}};return await handleSingleObjectOutput(_0x86297b,_0x4c7ca0),0x0;}}export class ScheduleCreateCommand extends BaseCommand{[a30_0x464544(0x100)]=a30_0x464544(0x116);[a30_0x464544(0xcc)]=a30_0x464544(0xd0);[a30_0x464544(0x141)](_0x904bd){const _0x48b9ef=a30_0x464544,_0x2c46bb=_0x904bd[_0x48b9ef(0xd2)][0x0];if(!_0x2c46bb)return _0x48b9ef(0xcd);const _0xa2eb61=_0x904bd['options'];if(!_0xa2eb61[_0x48b9ef(0xfe)])return _0x48b9ef(0xd9);return undefined;}async[a30_0x464544(0x109)](_0x639caf){const _0x3d8878=a30_0x464544,{options:_0x369aa9,args:_0x17fb91,tdx:_0x478619}=_0x639caf,_0x10077f=_0x17fb91[0x0],_0x22b9fd=_0x369aa9,_0x1e4f5e=_0x22b9fd[_0x3d8878(0xfe)],_0xdb7184=_0x22b9fd[_0x3d8878(0x104)],_0x3174f2=_0x22b9fd['type']||_0x3d8878(0xc3);let _0x1fa8fd;try{_0x1fa8fd=readFileSync(_0xdb7184,'utf-8')[_0x3d8878(0xe4)]();}catch(_0x4b6856){throw new SDKError(ErrorCode[_0x3d8878(0xcb)],'Failed\x20to\x20read\x20file:\x20'+_0xdb7184,_0x4b6856 instanceof Error?_0x4b6856:undefined);}if(!_0x1fa8fd)throw new SDKError(ErrorCode[_0x3d8878(0xcb)],'Query\x20file\x20is\x20empty');const _0x51646a={'database':_0x1e4f5e,'query':_0x1fa8fd,'type':_0x3174f2};if(_0x22b9fd[_0x3d8878(0x113)])_0x51646a[_0x3d8878(0x113)]=_0x22b9fd[_0x3d8878(0x113)];if(_0x22b9fd[_0x3d8878(0xc6)])_0x51646a[_0x3d8878(0xc6)]=_0x22b9fd['timezone'];if(_0x22b9fd[_0x3d8878(0x107)]!==undefined)_0x51646a[_0x3d8878(0x107)]=Number(_0x22b9fd['delay']);if(_0x22b9fd[_0x3d8878(0xf6)]!==undefined)_0x51646a[_0x3d8878(0xf6)]=Number(_0x22b9fd[_0x3d8878(0xf6)]);if(_0x22b9fd[_0x3d8878(0xf3)]!==undefined)_0x51646a[_0x3d8878(0x106)]=Number(_0x22b9fd[_0x3d8878(0xf3)]);if(_0x22b9fd[_0x3d8878(0x147)])_0x51646a[_0x3d8878(0xdf)]=_0x22b9fd[_0x3d8878(0x147)];if(_0x22b9fd[_0x3d8878(0x14c)])_0x51646a[_0x3d8878(0x14c)]=_0x22b9fd[_0x3d8878(0x14c)];if(_0x369aa9[_0x3d8878(0x14b)]){console[_0x3d8878(0x12e)]('Creating\x20schedule:\x20'+_0x10077f),console['error'](_0x3d8878(0x129)+_0x1e4f5e),console[_0x3d8878(0x12e)](_0x3d8878(0xe3)+_0x3174f2);if(_0x51646a[_0x3d8878(0x113)])console[_0x3d8878(0x12e)]('\x20\x20Cron:\x20'+_0x51646a[_0x3d8878(0x113)]);if(_0x51646a[_0x3d8878(0xc6)])console['error']('\x20\x20Timezone:\x20'+_0x51646a[_0x3d8878(0xc6)]);}const _0x3d4c3d=await withSpinner(_0x3d8878(0xe6),()=>_0x478619[_0x3d8878(0xc7)]['create'](_0x10077f,_0x51646a),{'verbose':_0x369aa9['verbose']});return console[_0x3d8878(0x12e)](_0x3d8878(0xdb)+_0x3d4c3d['data'][_0x3d8878(0x100)]),await handleSingleObjectOutput(_0x3d4c3d['data'],_0x369aa9),0x0;}}export class ScheduleUpdateCommand extends BaseCommand{['name']='schedule:update';['description']=a30_0x464544(0x12b);[a30_0x464544(0x141)](_0x79724){const _0x4000ee=a30_0x464544,_0x48d911=_0x79724['args'][0x0];if(!_0x48d911)return _0x4000ee(0x13e);return undefined;}async['execute'](_0x4bcf5e){const _0x37ad6f=a30_0x464544,{options:_0x221cdf,args:_0x2d6ba3,tdx:_0x10189f}=_0x4bcf5e,_0x116afd=_0x2d6ba3[0x0],_0x5b2214=_0x221cdf,_0x580e97={};if(_0x5b2214[_0x37ad6f(0xfe)])_0x580e97[_0x37ad6f(0xfe)]=_0x5b2214[_0x37ad6f(0xfe)];if(_0x5b2214[_0x37ad6f(0x145)])_0x580e97['type']=_0x5b2214[_0x37ad6f(0x145)];if(_0x5b2214[_0x37ad6f(0x113)])_0x580e97[_0x37ad6f(0x113)]=_0x5b2214[_0x37ad6f(0x113)];if(_0x5b2214['timezone'])_0x580e97[_0x37ad6f(0xc6)]=_0x5b2214['timezone'];if(_0x5b2214['delay']!==undefined)_0x580e97[_0x37ad6f(0x107)]=Number(_0x5b2214[_0x37ad6f(0x107)]);if(_0x5b2214[_0x37ad6f(0xf6)]!==undefined)_0x580e97[_0x37ad6f(0xf6)]=Number(_0x5b2214[_0x37ad6f(0xf6)]);if(_0x5b2214[_0x37ad6f(0xf3)]!==undefined)_0x580e97[_0x37ad6f(0x106)]=Number(_0x5b2214[_0x37ad6f(0xf3)]);if(_0x5b2214[_0x37ad6f(0x147)])_0x580e97['engine_version']=_0x5b2214['engineVersion'];if(_0x5b2214['result'])_0x580e97[_0x37ad6f(0x14c)]=_0x5b2214[_0x37ad6f(0x14c)];if(_0x5b2214[_0x37ad6f(0x104)])try{_0x580e97['query']=readFileSync(_0x5b2214['file'],_0x37ad6f(0xfc))['trim']();}catch(_0x2ab315){throw new SDKError(ErrorCode[_0x37ad6f(0xcb)],_0x37ad6f(0x10c)+_0x5b2214[_0x37ad6f(0x104)],_0x2ab315 instanceof Error?_0x2ab315:undefined);}if(Object[_0x37ad6f(0xe2)](_0x580e97)[_0x37ad6f(0x146)]===0x0)throw new SDKError(ErrorCode[_0x37ad6f(0xcb)],'At\x20least\x20one\x20option\x20must\x20be\x20provided\x20to\x20update');if(_0x221cdf[_0x37ad6f(0x14b)]){console[_0x37ad6f(0x12e)](_0x37ad6f(0x135)+_0x116afd);for(const [_0x411da5,_0x2ceb8a]of Object['entries'](_0x580e97)){_0x411da5==='query'?console[_0x37ad6f(0x12e)]('\x20\x20'+_0x411da5+':\x20'+_0x2ceb8a[_0x37ad6f(0x134)](0x0,0x32)+_0x37ad6f(0x133)):console[_0x37ad6f(0x12e)]('\x20\x20'+_0x411da5+':\x20'+_0x2ceb8a);}}const _0x491a4f=await withSpinner('Updating\x20schedule...',()=>_0x10189f['schedules']['update'](_0x116afd,_0x580e97),{'verbose':_0x221cdf[_0x37ad6f(0x14b)]});return console[_0x37ad6f(0x12e)](_0x37ad6f(0x101)+_0x491a4f[_0x37ad6f(0xec)][_0x37ad6f(0x100)]),await handleSingleObjectOutput(_0x491a4f[_0x37ad6f(0xec)],_0x221cdf),0x0;}}export class ScheduleDeleteCommand extends BaseCommand{[a30_0x464544(0x100)]=a30_0x464544(0xcf);[a30_0x464544(0xcc)]=a30_0x464544(0x124);[a30_0x464544(0x141)](_0x1553ba){const _0x244cad=a30_0x464544,_0x1e80ac=_0x1553ba['args'][0x0];if(!_0x1e80ac)return _0x244cad(0x139);return undefined;}async[a30_0x464544(0x109)](_0x40f4fb){const _0x52d623=a30_0x464544,{options:_0x1704a4,args:_0x8011b0,tdx:_0x5d4989}=_0x40f4fb,_0x2ec2a9=_0x8011b0[0x0];if(!_0x1704a4['yes']){const _0x261375=await confirm(_0x52d623(0xc1)+_0x2ec2a9+'\x22?');if(!_0x261375)return console[_0x52d623(0x12e)](_0x52d623(0x120)),0x0;}const _0x547bb3=await withSpinner('Deleting\x20schedule...',()=>_0x5d4989[_0x52d623(0xc7)][_0x52d623(0xd4)](_0x2ec2a9),{'verbose':_0x1704a4[_0x52d623(0x14b)]});return console[_0x52d623(0x12e)](_0x52d623(0x11b)+_0x547bb3['data'][_0x52d623(0x100)]),0x0;}}function a30_0x4d38(){const _0x409cb5=['\x20\x20Time:\x20','name','Schedule\x20updated:\x20','\x20created','num','file','List\x20scheduled\x20queries','retry_limit','delay','user','execute','red','getTime','Failed\x20to\x20read\x20file:\x20','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20history\x20<name>\x20[--from\x20<n>]\x20[--to\x20<n>]','from','soon','created_at','pagination','/app/queries/editor?queryId=','cron','site','Found\x20','schedule:create','7624972VqRjdq','status','map','Running\x20schedule...','Schedule\x20deleted:\x20','\x22...','lastRun','queries','\x20schedules','Cancelled','Show\x20schedule\x20execution\x20history','list','abs','Delete\x20a\x20scheduled\x20query','schedule:run','Run\x20a\x20scheduled\x20query\x20immediately','end_at','Schedule\x20run\x20submitted:\x20','\x20\x20Database:\x20','806139UobHGB','Update\x20a\x20scheduled\x20query','\x20matching\x20\x22','time','error','Getting\x20schedule\x20details...','jsonl','Showing\x20first\x20','ended_at','...','substring','Updating\x20schedule:\x20','\x20scheduled\x20quer','150xrHbix','\x20job','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20delete\x20<name>','13240AjuIbS','green','join','listQueries','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20update\x20<name>\x20[options]','count','repeat','validate','Searching\x20scheduled\x20queries\x20matching\x20\x22','scheduled_at','\x20\x20→\x20','type','length','engineVersion','history','padEnd','next_run_at','verbose','result','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20schedule\x20\x22','queryUrl','trino','\x20(use\x20--limit\x20to\x20see\x20more)','job_id','timezone','schedules','format','executing_user_id','round','INVALID_ARGUMENT','description','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20create\x20<name>\x20-d\x20<db>\x20--file\x20<path>\x20[options]','8533195uKftJE','schedule:delete','Create\x20a\x20scheduled\x20query','(unnamed)','args','query','delete','1672908hnuFAt','start_at','cyan','limit','Database\x20is\x20required\x0aUsage:\x20job\x20schedule\x20create\x20<name>\x20-d\x20<db>\x20--file\x20<path>\x20[options]','\x20\x20Job\x20ID:\x20','Schedule\x20created:\x20','has_next_page','h\x20ago','schedule:show','engine_version','output','success','keys','\x20\x20Type:\x20','trim','jobs','Creating\x20schedule...','in\x20','11442828lplHXL','user_name','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20run\x20<name>\x20[--time\x20<iso8601>]\x20[--num\x20<1-10>]','just\x20now','data','8893JRtwQC','log','json','last_job','show','never','retryLimit','statusIcon','Running\x20schedule:\x20','priority','d\x20ago','\x20execution','\x20(showing\x20','run','max','utf-8','3199IxREVo','database'];a30_0x4d38=function(){return _0x409cb5;};return a30_0x4d38();}export class ScheduleRunCommand extends BaseCommand{[a30_0x464544(0x100)]=a30_0x464544(0x125);[a30_0x464544(0xcc)]=a30_0x464544(0x126);[a30_0x464544(0x141)](_0x5ba2b3){const _0x4563ca=a30_0x464544,_0x491037=_0x5ba2b3[_0x4563ca(0xd2)][0x0];if(!_0x491037)return _0x4563ca(0xea);return undefined;}async[a30_0x464544(0x109)](_0x550efd){const _0x4170d8=a30_0x464544,{options:_0x52139e,args:_0x3293d3,tdx:_0x423133}=_0x550efd,_0x41741a=_0x3293d3[0x0],_0x1cd90b=_0x52139e,_0x232fa1=_0x1cd90b[_0x4170d8(0x12d)],_0x4c7b83=_0x1cd90b[_0x4170d8(0x103)]!==undefined?Number(_0x1cd90b[_0x4170d8(0x103)]):undefined;if(_0x52139e['verbose']){console['error'](_0x4170d8(0xf5)+_0x41741a);if(_0x232fa1)console['error'](_0x4170d8(0xff)+_0x232fa1);if(_0x4c7b83)console[_0x4170d8(0x12e)]('\x20\x20Num:\x20'+_0x4c7b83);}const _0x40fad5=await withSpinner(_0x4170d8(0x11a),()=>_0x423133[_0x4170d8(0xc7)][_0x4170d8(0xfa)](_0x41741a,{'time':_0x232fa1,'num':_0x4c7b83}),{'verbose':_0x52139e[_0x4170d8(0x14b)]}),_0x553480=_0x40fad5[_0x4170d8(0xec)][_0x4170d8(0xe5)];console[_0x4170d8(0x12e)](_0x4170d8(0x128)+_0x553480[_0x4170d8(0x146)]+_0x4170d8(0x138)+(_0x553480[_0x4170d8(0x146)]!==0x1?'s':'')+_0x4170d8(0x102));for(const _0x348840 of _0x553480){console[_0x4170d8(0x12e)](_0x4170d8(0xda)+_0x348840[_0x4170d8(0xc5)]);}return await handleSDKOutput(_0x553480,_0x52139e),0x0;}}export class ScheduleHistoryCommand extends BaseCommand{['name']='schedule:history';[a30_0x464544(0xcc)]=a30_0x464544(0x121);[a30_0x464544(0x141)](_0x3a1581){const _0x658199=a30_0x464544,_0x32785c=_0x3a1581[_0x658199(0xd2)][0x0];if(!_0x32785c)return _0x658199(0x10d);return undefined;}async['execute'](_0x5e2508){const _0x30a23f=a30_0x464544,{options:_0x556a58,args:_0x18b78a,tdx:_0x1bb48e}=_0x5e2508,_0x4e3abf=_0x18b78a[0x0],_0x28e047=_0x556a58,_0x1a32d1=_0x28e047['from']!==undefined?Number(_0x28e047[_0x30a23f(0x10e)]):undefined,_0xcd12fe=_0x28e047['to']!==undefined?Number(_0x28e047['to']):undefined,_0x369354=await withSpinner('Getting\x20schedule\x20history...',()=>_0x1bb48e[_0x30a23f(0xc7)][_0x30a23f(0x148)](_0x4e3abf,{'from':_0x1a32d1,'to':_0xcd12fe}),{'verbose':_0x556a58['verbose']}),_0x4f582b=_0x369354[_0x30a23f(0xec)];console['error'](_0x30a23f(0x115)+_0x4f582b[_0x30a23f(0x13f)]+_0x30a23f(0xf8)+(_0x4f582b[_0x30a23f(0x13f)]!==0x1?'s':'')+_0x30a23f(0xf9)+_0x4f582b[_0x30a23f(0x10e)]+'-'+_0x4f582b['to']+')');const _0x3937d6=_0x4f582b[_0x30a23f(0x148)]['map'](_0x3b570c=>({'job_id':_0x3b570c[_0x30a23f(0xc5)],'type':_0x3b570c[_0x30a23f(0x145)],'status':_0x3b570c[_0x30a23f(0x118)],'scheduled_at':_0x3b570c[_0x30a23f(0x143)],'created_at':_0x3b570c[_0x30a23f(0x110)],'start_at':_0x3b570c[_0x30a23f(0xd6)],'end_at':_0x3b570c[_0x30a23f(0x127)]}));return await handleSDKOutput(_0x3937d6,_0x556a58),0x0;}}
1
+ const a30_0x35d599=a30_0x5878;(function(_0x15639,_0x3427ae){const _0x5bfa27=a30_0x5878,_0x39b140=_0x15639();while(!![]){try{const _0x239733=parseInt(_0x5bfa27(0x258))/0x1+parseInt(_0x5bfa27(0x22a))/0x2+parseInt(_0x5bfa27(0x275))/0x3+-parseInt(_0x5bfa27(0x23c))/0x4+parseInt(_0x5bfa27(0x236))/0x5+parseInt(_0x5bfa27(0x272))/0x6*(parseInt(_0x5bfa27(0x225))/0x7)+-parseInt(_0x5bfa27(0x216))/0x8;if(_0x239733===_0x3427ae)break;else _0x39b140['push'](_0x39b140['shift']());}catch(_0x56cd87){_0x39b140['push'](_0x39b140['shift']());}}}(a30_0x25f6,0x80539));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput,writeOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{confirm}from'../utils/prompt.js';import{readFileSync}from'fs';function a30_0x25f6(){const _0x467c44=['scheduled_at','file','create','schedule:delete','never','format','getTime','2947795NZOgTE','log','INVALID_ARGUMENT','...','\x20\x20Type:\x20','\x22...','2496232OrXvZU','error','cron','At\x20least\x20one\x20option\x20must\x20be\x20provided\x20to\x20update','round','validate','created_at','pagination','ended_at','Found\x20','red','num','next_run_at','retryLimit','Query\x20file\x20is\x20empty','join','has_next_page','schedule:update','Show\x20schedule\x20details','schedule:list','show','(unnamed)','engineVersion','updated_at','limit','Getting\x20schedule\x20history...','Schedule\x20updated:\x20','📅\x20','1005031XttvhF','query','args','\x20created','name','schedules','time_zone','timezone','delay','type','\x20\x20Time:\x20','dim','engine_version','Create\x20a\x20scheduled\x20query','\x20\x20Cron:\x20','Delete\x20a\x20scheduled\x20query','tsv','entries','Creating\x20schedule...','\x20job','update','Schedule\x20created:\x20','Deleting\x20schedule...','toLocaleDateString','\x20(use\x20--limit\x20to\x20see\x20more)','retry_limit','4575186yoiITl','status','priority','1437840qZHWVE','jobs','trino','trim','\x20schedules','queries','delete','data','success','Running\x20schedule...','keys','Update\x20a\x20scheduled\x20query','run','Updating\x20schedule...','List\x20scheduled\x20queries','database','user_name','jsonl','history','count','map','result','site','Getting\x20schedule\x20details...','from','soon','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20delete\x20<name>','\x20scheduled\x20quer','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20run\x20<name>\x20[--time\x20<iso8601>]\x20[--num\x20<1-10>]','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20show\x20<name>','output','Cancelled','Searching\x20scheduled\x20queries\x20matching\x20\x22','yes','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20schedule\x20\x22','\x20execution','execute','Failed\x20to\x20read\x20file:\x20','description','executing_user_id','schedule:run','Updating\x20schedule:\x20','cyan','\x20\x20Timezone:\x20','job_id','schedule:create','in\x20','last_job','Show\x20schedule\x20execution\x20history','list','Schedule\x20run\x20submitted:\x20','16149216BAvJWR','Run\x20a\x20scheduled\x20query\x20immediately','lastRun','h\x20ago','verbose','Showing\x20first\x20','ies','padEnd','options','listQueries','statusIcon','length','end_at','max','table','7FXvRin','\x20\x20Num:\x20','Running\x20schedule:\x20','schedule:show','m\x20ago','663868QjBKqA','utf-8','Listing\x20scheduled\x20queries...','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20history\x20<name>\x20[--from\x20<n>]\x20[--to\x20<n>]','nextRun'];a30_0x25f6=function(){return _0x467c44;};return a30_0x25f6();}import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{hyperlink}from'../sdk/util/formatters.js';import a30_0x913d8f from'chalk';function formatRelativeTime(_0x4873c9){const _0xe73083=a30_0x5878,_0x30e932=new Date(_0x4873c9),_0x439a34=new Date(),_0x553689=_0x30e932[_0xe73083(0x235)]()-_0x439a34[_0xe73083(0x235)](),_0x58d857=Math['abs'](_0x553689)/0x3e8,_0x3690c8=_0x553689<0x0;if(_0x58d857<0x3c)return _0x3690c8?'just\x20now':_0xe73083(0x1fc);else{if(_0x58d857<0xe10){const _0x53de74=Math[_0xe73083(0x240)](_0x58d857/0x3c);return _0x3690c8?_0x53de74+_0xe73083(0x229):'in\x20'+_0x53de74+'m';}else{if(_0x58d857<0x15180){const _0xd1e1f7=Math['round'](_0x58d857/0xe10);return _0x3690c8?_0xd1e1f7+_0xe73083(0x219):_0xe73083(0x211)+_0xd1e1f7+'h';}else{if(_0x58d857<0x93a80){const _0x45353c=Math[_0xe73083(0x240)](_0x58d857/0x15180);return _0x3690c8?_0x45353c+'d\x20ago':_0xe73083(0x211)+_0x45353c+'d';}else return _0x30e932[_0xe73083(0x26f)]();}}}}export class ScheduleListCommand extends BaseCommand{['name']=a30_0x35d599(0x24f);[a30_0x35d599(0x209)]=a30_0x35d599(0x1f1);async['execute'](_0x1634cb){const _0x369d81=a30_0x35d599,{options:_0x4d4bff,args:_0xb57288,tdx:_0x56e791}=_0x1634cb,_0x4856b2=resolveLimit(_0x4d4bff[_0x369d81(0x254)],DEFAULT_DISPLAY_LIMIT),_0x1e751e=_0xb57288[0x0],_0x15e9ab=_0x1e751e?_0x369d81(0x203)+_0x1e751e+_0x369d81(0x23b):_0x369d81(0x22c),_0x1851c7=await withSpinner(_0x15e9ab,()=>_0x56e791['schedules'][_0x369d81(0x21f)]({'limit':_0x4856b2,'scheduled':!![],'pattern':_0x1e751e}),{'verbose':_0x4d4bff[_0x369d81(0x21a)]}),_0x1b2e52=_0x1851c7[_0x369d81(0x1ea)][_0x369d81(0x1e8)],_0x557d08=_0x1851c7['data'][_0x369d81(0x243)][_0x369d81(0x24c)],_0x2d5f4e=_0x1e751e?'\x20matching\x20\x22'+_0x1e751e+'\x22':'';_0x557d08?console['error'](_0x369d81(0x21b)+_0x1b2e52['length']+_0x369d81(0x1e7)+_0x2d5f4e+_0x369d81(0x270)):console[_0x369d81(0x23d)](_0x369d81(0x245)+_0x1b2e52[_0x369d81(0x221)]+_0x369d81(0x1fe)+(_0x1b2e52[_0x369d81(0x221)]!==0x1?_0x369d81(0x21c):'y')+_0x2d5f4e);if(_0x4d4bff[_0x369d81(0x234)]==='json'||_0x4d4bff[_0x369d81(0x234)]===_0x369d81(0x1f4)||_0x4d4bff[_0x369d81(0x234)]===_0x369d81(0x224)||_0x4d4bff[_0x369d81(0x234)]===_0x369d81(0x268)){const _0x12e65b=_0x1b2e52[_0x369d81(0x1f7)](_0x1c12ca=>({'id':_0x1c12ca['id'],'name':_0x1c12ca[_0x369d81(0x25c)],'cron':_0x1c12ca[_0x369d81(0x23e)],'database':_0x1c12ca[_0x369d81(0x1f2)]?.[_0x369d81(0x25c)],'type':_0x1c12ca['type'],'timezone':_0x1c12ca[_0x369d81(0x25e)],'user_name':_0x1c12ca['user']?.['name'],'updated_at':_0x1c12ca[_0x369d81(0x253)],'next_run_at':_0x1c12ca[_0x369d81(0x248)],'last_job_status':_0x1c12ca[_0x369d81(0x212)]?.[_0x369d81(0x273)]}));await handleSDKOutput(_0x12e65b,_0x4d4bff);}else{if(_0x1b2e52[_0x369d81(0x221)]===0x0)console[_0x369d81(0x237)]('No\x20scheduled\x20queries\x20found');else{const _0x43b1e3=_0x4d4bff[_0x369d81(0x1f9)],_0x3d3eaa=_0x1b2e52[_0x369d81(0x1f7)](_0x529879=>{const _0x2d65c9=_0x369d81,_0x334bad=_0x529879[_0x2d65c9(0x212)]?.['status']?_0x529879[_0x2d65c9(0x212)]['status']===_0x2d65c9(0x1eb)?'✓':'✗':'-',_0x457f32=_0x529879['last_job']?.[_0x2d65c9(0x244)]?formatRelativeTime(_0x529879[_0x2d65c9(0x212)][_0x2d65c9(0x244)]):_0x2d65c9(0x233),_0x42c9ea=_0x529879[_0x2d65c9(0x248)]?formatRelativeTime(_0x529879[_0x2d65c9(0x248)]):'-',_0x5ebf51=_0x529879[_0x2d65c9(0x23e)]||'',_0x45f1c2=_0x529879[_0x2d65c9(0x25c)]||_0x2d65c9(0x251),_0x38f388=getConsoleUrl(_0x43b1e3,'/app/queries/editor?queryId='+_0x529879['id']);return{'statusIcon':_0x334bad,'lastRun':_0x457f32,'nextRun':_0x42c9ea,'cron':_0x5ebf51,'name':_0x45f1c2,'queryUrl':_0x38f388,'status':_0x529879[_0x2d65c9(0x212)]?.['status']};}),_0x398b7f=Math[_0x369d81(0x223)](..._0x3d3eaa['map'](_0x42aa54=>_0x42aa54[_0x369d81(0x218)][_0x369d81(0x221)])),_0x59dae=Math[_0x369d81(0x223)](..._0x3d3eaa[_0x369d81(0x1f7)](_0x5194d9=>_0x5194d9[_0x369d81(0x22e)]['length'])),_0x20fb2b=Math[_0x369d81(0x223)](..._0x3d3eaa[_0x369d81(0x1f7)](_0x13bf75=>_0x13bf75[_0x369d81(0x23e)][_0x369d81(0x221)])),_0x225558=_0x3d3eaa[_0x369d81(0x1f7)](_0x14711d=>{const _0x5c745a=_0x369d81,_0x126de3=_0x14711d[_0x5c745a(0x273)]===_0x5c745a(0x1eb)?a30_0x913d8f['green'](_0x14711d[_0x5c745a(0x220)]):_0x14711d[_0x5c745a(0x273)]===_0x5c745a(0x23d)?a30_0x913d8f[_0x5c745a(0x246)](_0x14711d['statusIcon']):a30_0x913d8f[_0x5c745a(0x263)](_0x14711d[_0x5c745a(0x220)]),_0x134956=_0x14711d[_0x5c745a(0x218)][_0x5c745a(0x21d)](_0x398b7f),_0x2dfd34=_0x14711d[_0x5c745a(0x22e)]['padEnd'](_0x59dae),_0x276c24=_0x14711d[_0x5c745a(0x23e)]?a30_0x913d8f[_0x5c745a(0x20d)](_0x14711d[_0x5c745a(0x23e)][_0x5c745a(0x21d)](_0x20fb2b)):'\x20'['repeat'](_0x20fb2b),_0x17643e=hyperlink(_0x14711d['name'],_0x14711d['queryUrl']);return _0x5c745a(0x257)+_0x126de3+'\x20'+_0x134956+'\x20\x20→\x20'+_0x2dfd34+'\x20\x20'+_0x276c24+'\x20\x20'+_0x17643e;});await writeOutput(_0x225558[_0x369d81(0x24b)]('\x0a'),_0x4d4bff[_0x369d81(0x201)],_0x369d81(0x214));}}return 0x0;}}export class ScheduleShowCommand extends BaseCommand{[a30_0x35d599(0x25c)]=a30_0x35d599(0x228);['description']=a30_0x35d599(0x24e);['validate'](_0x5e5924){const _0x1a77ce=a30_0x35d599,_0xcc9dd4=_0x5e5924['args'][0x0];if(!_0xcc9dd4)return _0x1a77ce(0x200);return undefined;}async[a30_0x35d599(0x207)](_0x19f5db){const _0x4bca23=a30_0x35d599,{options:_0x3f9c32,args:_0x5333ac,tdx:_0x4105f3}=_0x19f5db,_0x2dcc65=_0x5333ac[0x0],_0x5bd752=await withSpinner(_0x4bca23(0x1fa),()=>_0x4105f3[_0x4bca23(0x25d)][_0x4bca23(0x250)](_0x2dcc65),{'verbose':_0x3f9c32[_0x4bca23(0x21a)]}),_0x4dfa71=_0x5bd752[_0x4bca23(0x1ea)],_0x9a4e86={'name':_0x4dfa71[_0x4bca23(0x25c)],'cron':_0x4dfa71[_0x4bca23(0x23e)],'database':_0x4dfa71[_0x4bca23(0x1f2)],'type':_0x4dfa71[_0x4bca23(0x261)],'timezone':_0x4dfa71[_0x4bca23(0x25f)],'user_name':_0x4dfa71[_0x4bca23(0x1f3)],'created_at':_0x4dfa71[_0x4bca23(0x242)],'engine_version':_0x4dfa71[_0x4bca23(0x264)],'executing_user_id':_0x4dfa71[_0x4bca23(0x20a)],'query':_0x4dfa71[_0x4bca23(0x259)],'delay':_0x4dfa71[_0x4bca23(0x260)],'priority':_0x4dfa71[_0x4bca23(0x274)],'retry_limit':_0x4dfa71[_0x4bca23(0x271)],..._0x4dfa71[_0x4bca23(0x1f8)]&&{'result':_0x4dfa71['result']}};return await handleSingleObjectOutput(_0x9a4e86,_0x3f9c32),0x0;}}export class ScheduleCreateCommand extends BaseCommand{[a30_0x35d599(0x25c)]=a30_0x35d599(0x210);[a30_0x35d599(0x209)]=a30_0x35d599(0x265);[a30_0x35d599(0x241)](_0x14eee0){const _0x316477=a30_0x35d599,_0x525e83=_0x14eee0[_0x316477(0x25a)][0x0];if(!_0x525e83)return'Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20create\x20<name>\x20-d\x20<db>\x20--file\x20<path>\x20[options]';const _0x14cece=_0x14eee0[_0x316477(0x21e)];if(!_0x14cece[_0x316477(0x1f2)])return'Database\x20is\x20required\x0aUsage:\x20job\x20schedule\x20create\x20<name>\x20-d\x20<db>\x20--file\x20<path>\x20[options]';return undefined;}async[a30_0x35d599(0x207)](_0x48bef4){const _0x263249=a30_0x35d599,{options:_0x304194,args:_0x277430,tdx:_0x3b45f3}=_0x48bef4,_0x3479cb=_0x277430[0x0],_0x1b0056=_0x304194,_0x567937=_0x1b0056[_0x263249(0x1f2)],_0x12d4e5=_0x1b0056[_0x263249(0x230)],_0x1c11d2=_0x1b0056[_0x263249(0x261)]||_0x263249(0x1e5);let _0x23147c;try{_0x23147c=readFileSync(_0x12d4e5,_0x263249(0x22b))[_0x263249(0x1e6)]();}catch(_0x466cf4){throw new SDKError(ErrorCode[_0x263249(0x238)],_0x263249(0x208)+_0x12d4e5,_0x466cf4 instanceof Error?_0x466cf4:undefined);}if(!_0x23147c)throw new SDKError(ErrorCode[_0x263249(0x238)],_0x263249(0x24a));const _0x3b82a1={'database':_0x567937,'query':_0x23147c,'type':_0x1c11d2};if(_0x1b0056[_0x263249(0x23e)])_0x3b82a1['cron']=_0x1b0056[_0x263249(0x23e)];if(_0x1b0056['timezone'])_0x3b82a1[_0x263249(0x25f)]=_0x1b0056[_0x263249(0x25f)];if(_0x1b0056['delay']!==undefined)_0x3b82a1[_0x263249(0x260)]=Number(_0x1b0056['delay']);if(_0x1b0056['priority']!==undefined)_0x3b82a1[_0x263249(0x274)]=Number(_0x1b0056[_0x263249(0x274)]);if(_0x1b0056[_0x263249(0x249)]!==undefined)_0x3b82a1['retry_limit']=Number(_0x1b0056[_0x263249(0x249)]);if(_0x1b0056[_0x263249(0x252)])_0x3b82a1[_0x263249(0x264)]=_0x1b0056[_0x263249(0x252)];if(_0x1b0056[_0x263249(0x1f8)])_0x3b82a1[_0x263249(0x1f8)]=_0x1b0056[_0x263249(0x1f8)];if(_0x304194[_0x263249(0x21a)]){console[_0x263249(0x23d)]('Creating\x20schedule:\x20'+_0x3479cb),console[_0x263249(0x23d)]('\x20\x20Database:\x20'+_0x567937),console[_0x263249(0x23d)](_0x263249(0x23a)+_0x1c11d2);if(_0x3b82a1['cron'])console[_0x263249(0x23d)](_0x263249(0x266)+_0x3b82a1[_0x263249(0x23e)]);if(_0x3b82a1[_0x263249(0x25f)])console[_0x263249(0x23d)](_0x263249(0x20e)+_0x3b82a1[_0x263249(0x25f)]);}const _0x16b1dc=await withSpinner(_0x263249(0x26a),()=>_0x3b45f3[_0x263249(0x25d)][_0x263249(0x231)](_0x3479cb,_0x3b82a1),{'verbose':_0x304194[_0x263249(0x21a)]});return console[_0x263249(0x23d)](_0x263249(0x26d)+_0x16b1dc['data'][_0x263249(0x25c)]),await handleSingleObjectOutput(_0x16b1dc[_0x263249(0x1ea)],_0x304194),0x0;}}export class ScheduleUpdateCommand extends BaseCommand{['name']=a30_0x35d599(0x24d);[a30_0x35d599(0x209)]=a30_0x35d599(0x1ee);[a30_0x35d599(0x241)](_0x2d62dc){const _0x36b967=_0x2d62dc['args'][0x0];if(!_0x36b967)return'Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20update\x20<name>\x20[options]';return undefined;}async[a30_0x35d599(0x207)](_0x52af00){const _0x3154d7=a30_0x35d599,{options:_0x22af86,args:_0x5aa0cd,tdx:_0x412b6a}=_0x52af00,_0x50f2cf=_0x5aa0cd[0x0],_0x3962d6=_0x22af86,_0x5d3434={};if(_0x3962d6['database'])_0x5d3434[_0x3154d7(0x1f2)]=_0x3962d6[_0x3154d7(0x1f2)];if(_0x3962d6[_0x3154d7(0x261)])_0x5d3434['type']=_0x3962d6[_0x3154d7(0x261)];if(_0x3962d6[_0x3154d7(0x23e)])_0x5d3434[_0x3154d7(0x23e)]=_0x3962d6[_0x3154d7(0x23e)];if(_0x3962d6[_0x3154d7(0x25f)])_0x5d3434[_0x3154d7(0x25f)]=_0x3962d6['timezone'];if(_0x3962d6['delay']!==undefined)_0x5d3434['delay']=Number(_0x3962d6[_0x3154d7(0x260)]);if(_0x3962d6[_0x3154d7(0x274)]!==undefined)_0x5d3434[_0x3154d7(0x274)]=Number(_0x3962d6[_0x3154d7(0x274)]);if(_0x3962d6['retryLimit']!==undefined)_0x5d3434['retry_limit']=Number(_0x3962d6[_0x3154d7(0x249)]);if(_0x3962d6[_0x3154d7(0x252)])_0x5d3434[_0x3154d7(0x264)]=_0x3962d6[_0x3154d7(0x252)];if(_0x3962d6[_0x3154d7(0x1f8)])_0x5d3434['result']=_0x3962d6[_0x3154d7(0x1f8)];if(_0x3962d6[_0x3154d7(0x230)])try{_0x5d3434['query']=readFileSync(_0x3962d6[_0x3154d7(0x230)],_0x3154d7(0x22b))['trim']();}catch(_0x272f06){throw new SDKError(ErrorCode[_0x3154d7(0x238)],_0x3154d7(0x208)+_0x3962d6[_0x3154d7(0x230)],_0x272f06 instanceof Error?_0x272f06:undefined);}if(Object[_0x3154d7(0x1ed)](_0x5d3434)[_0x3154d7(0x221)]===0x0)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x3154d7(0x23f));if(_0x22af86['verbose']){console[_0x3154d7(0x23d)](_0x3154d7(0x20c)+_0x50f2cf);for(const [_0x5b98a5,_0x364478]of Object[_0x3154d7(0x269)](_0x5d3434)){_0x5b98a5==='query'?console[_0x3154d7(0x23d)]('\x20\x20'+_0x5b98a5+':\x20'+_0x364478['substring'](0x0,0x32)+_0x3154d7(0x239)):console['error']('\x20\x20'+_0x5b98a5+':\x20'+_0x364478);}}const _0xc51189=await withSpinner(_0x3154d7(0x1f0),()=>_0x412b6a['schedules'][_0x3154d7(0x26c)](_0x50f2cf,_0x5d3434),{'verbose':_0x22af86['verbose']});return console[_0x3154d7(0x23d)](_0x3154d7(0x256)+_0xc51189['data']['name']),await handleSingleObjectOutput(_0xc51189[_0x3154d7(0x1ea)],_0x22af86),0x0;}}export class ScheduleDeleteCommand extends BaseCommand{[a30_0x35d599(0x25c)]=a30_0x35d599(0x232);[a30_0x35d599(0x209)]=a30_0x35d599(0x267);[a30_0x35d599(0x241)](_0x419019){const _0x8502d2=a30_0x35d599,_0x2e06db=_0x419019[_0x8502d2(0x25a)][0x0];if(!_0x2e06db)return _0x8502d2(0x1fd);return undefined;}async[a30_0x35d599(0x207)](_0x182bd0){const _0x4318ad=a30_0x35d599,{options:_0x2ae05c,args:_0x203791,tdx:_0x48f9ba}=_0x182bd0,_0x515d94=_0x203791[0x0];if(!_0x2ae05c[_0x4318ad(0x204)]){const _0x53bcaf=await confirm(_0x4318ad(0x205)+_0x515d94+'\x22?');if(!_0x53bcaf)return console[_0x4318ad(0x23d)](_0x4318ad(0x202)),0x0;}const _0x1e8aa8=await withSpinner(_0x4318ad(0x26e),()=>_0x48f9ba[_0x4318ad(0x25d)][_0x4318ad(0x1e9)](_0x515d94),{'verbose':_0x2ae05c[_0x4318ad(0x21a)]});return console[_0x4318ad(0x23d)]('Schedule\x20deleted:\x20'+_0x1e8aa8[_0x4318ad(0x1ea)][_0x4318ad(0x25c)]),0x0;}}export class ScheduleRunCommand extends BaseCommand{[a30_0x35d599(0x25c)]=a30_0x35d599(0x20b);[a30_0x35d599(0x209)]=a30_0x35d599(0x217);[a30_0x35d599(0x241)](_0x59b2c2){const _0x4c297e=a30_0x35d599,_0xab7594=_0x59b2c2['args'][0x0];if(!_0xab7594)return _0x4c297e(0x1ff);return undefined;}async[a30_0x35d599(0x207)](_0x270b4d){const _0x3c6032=a30_0x35d599,{options:_0x120e95,args:_0x5f8f81,tdx:_0x1c4a97}=_0x270b4d,_0xa5ff37=_0x5f8f81[0x0],_0x726825=_0x120e95,_0xa2732=_0x726825['time'],_0x451b26=_0x726825['num']!==undefined?Number(_0x726825[_0x3c6032(0x247)]):undefined;if(_0x120e95[_0x3c6032(0x21a)]){console[_0x3c6032(0x23d)](_0x3c6032(0x227)+_0xa5ff37);if(_0xa2732)console[_0x3c6032(0x23d)](_0x3c6032(0x262)+_0xa2732);if(_0x451b26)console['error'](_0x3c6032(0x226)+_0x451b26);}const _0x1f966f=await withSpinner(_0x3c6032(0x1ec),()=>_0x1c4a97[_0x3c6032(0x25d)][_0x3c6032(0x1ef)](_0xa5ff37,{'time':_0xa2732,'num':_0x451b26}),{'verbose':_0x120e95[_0x3c6032(0x21a)]}),_0x536bf8=_0x1f966f[_0x3c6032(0x1ea)][_0x3c6032(0x276)];console[_0x3c6032(0x23d)](_0x3c6032(0x215)+_0x536bf8[_0x3c6032(0x221)]+_0x3c6032(0x26b)+(_0x536bf8[_0x3c6032(0x221)]!==0x1?'s':'')+_0x3c6032(0x25b));for(const _0x51e102 of _0x536bf8){console['error']('\x20\x20Job\x20ID:\x20'+_0x51e102[_0x3c6032(0x20f)]);}return await handleSDKOutput(_0x536bf8,_0x120e95),0x0;}}function a30_0x5878(_0x4d99a6,_0x1c0e08){_0x4d99a6=_0x4d99a6-0x1e5;const _0x25f664=a30_0x25f6();let _0x587890=_0x25f664[_0x4d99a6];return _0x587890;}export class ScheduleHistoryCommand extends BaseCommand{[a30_0x35d599(0x25c)]='schedule:history';[a30_0x35d599(0x209)]=a30_0x35d599(0x213);[a30_0x35d599(0x241)](_0x1aa09e){const _0x359916=a30_0x35d599,_0x2484ff=_0x1aa09e[_0x359916(0x25a)][0x0];if(!_0x2484ff)return _0x359916(0x22d);return undefined;}async['execute'](_0x1a6605){const _0x1bcb38=a30_0x35d599,{options:_0x5eeb7a,args:_0x212fb9,tdx:_0x31d0a0}=_0x1a6605,_0xf8b280=_0x212fb9[0x0],_0x110a22=_0x5eeb7a,_0x2ee584=_0x110a22[_0x1bcb38(0x1fb)]!==undefined?Number(_0x110a22[_0x1bcb38(0x1fb)]):undefined,_0x15814a=_0x110a22['to']!==undefined?Number(_0x110a22['to']):undefined,_0x2f9ca6=await withSpinner(_0x1bcb38(0x255),()=>_0x31d0a0[_0x1bcb38(0x25d)][_0x1bcb38(0x1f5)](_0xf8b280,{'from':_0x2ee584,'to':_0x15814a}),{'verbose':_0x5eeb7a[_0x1bcb38(0x21a)]}),_0x534bec=_0x2f9ca6[_0x1bcb38(0x1ea)];console[_0x1bcb38(0x23d)](_0x1bcb38(0x245)+_0x534bec['count']+_0x1bcb38(0x206)+(_0x534bec[_0x1bcb38(0x1f6)]!==0x1?'s':'')+'\x20(showing\x20'+_0x534bec[_0x1bcb38(0x1fb)]+'-'+_0x534bec['to']+')');const _0x4f90ca=_0x534bec[_0x1bcb38(0x1f5)][_0x1bcb38(0x1f7)](_0x2316ec=>({'job_id':_0x2316ec[_0x1bcb38(0x20f)],'type':_0x2316ec['type'],'status':_0x2316ec[_0x1bcb38(0x273)],'scheduled_at':_0x2316ec[_0x1bcb38(0x22f)],'created_at':_0x2316ec[_0x1bcb38(0x242)],'start_at':_0x2316ec['start_at'],'end_at':_0x2316ec[_0x1bcb38(0x222)]}));return await handleSDKOutput(_0x4f90ca,_0x5eeb7a),0x0;}}
@@ -1 +1 @@
1
- const a31_0x3dbff1=a31_0x1e90;function a31_0x1e90(_0x5293c3,_0x4fe750){_0x5293c3=_0x5293c3-0xce;const _0x5ae5ae=a31_0x5ae5();let _0x1e9007=_0x5ae5ae[_0x5293c3];return _0x1e9007;}(function(_0x1ac9d5,_0x3e172d){const _0x201cd7=a31_0x1e90,_0x1a086c=_0x1ac9d5();while(!![]){try{const _0x5dc2c8=parseInt(_0x201cd7(0xd8))/0x1*(-parseInt(_0x201cd7(0x153))/0x2)+-parseInt(_0x201cd7(0x13f))/0x3+parseInt(_0x201cd7(0x151))/0x4*(parseInt(_0x201cd7(0x14a))/0x5)+-parseInt(_0x201cd7(0xe4))/0x6+-parseInt(_0x201cd7(0xde))/0x7+-parseInt(_0x201cd7(0x139))/0x8+parseInt(_0x201cd7(0xea))/0x9;if(_0x5dc2c8===_0x3e172d)break;else _0x1a086c['push'](_0x1a086c['shift']());}catch(_0x487d3e){_0x1a086c['push'](_0x1a086c['shift']());}}}(a31_0x5ae5,0x44775));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 a31_0x46ffb from'chalk';async function resolveSegmentTarget(_0x14a1a6,_0x58247f,_0x5aae33){const _0x39e99b=a31_0x1e90;if(isYamlFilePath(_0x14a1a6))try{const _0x29ffa6=await resolveYamlFilePath(_0x14a1a6);return _0x5aae33&&(console[_0x39e99b(0xe2)](_0x39e99b(0x150)+_0x14a1a6),console[_0x39e99b(0xe2)](_0x39e99b(0x10f)+_0x29ffa6[_0x39e99b(0x159)]),console[_0x39e99b(0xe2)]('\x20\x20Segment\x20name:\x20'+_0x29ffa6[_0x39e99b(0xd6)]),console[_0x39e99b(0xe2)](_0x39e99b(0xf1)+(_0x29ffa6['folderPath']||_0x39e99b(0x14f))),console[_0x39e99b(0xe2)](_0x39e99b(0x137)+_0x29ffa6['fullPath'])),_0x29ffa6['fullPath'];}catch(_0x40730f){throw new SDKError(ErrorCode[_0x39e99b(0x10b)],'Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20'+_0x40730f['message']);}if(!_0x58247f)throw new SDKError(ErrorCode[_0x39e99b(0x10b)],_0x39e99b(0x129));return _0x58247f+'/'+_0x14a1a6;}export class SegmentDescribeCommand extends BaseCommand{['name']=a31_0x3dbff1(0x115);[a31_0x3dbff1(0xe0)]=a31_0x3dbff1(0x15d);async[a31_0x3dbff1(0x156)](_0xe71c4d){const _0xe0fa17=a31_0x3dbff1,{options:_0x22c3de,args:_0x2cab65,tdx:_0x4a4ac0}=_0xe71c4d,_0x54fc8c=_0x2cab65[0x0],_0x26844e=!_0x54fc8c&&!!_0x22c3de[_0xe0fa17(0x159)],_0xa7697a=_0x54fc8c||_0x22c3de[_0xe0fa17(0x159)];if(!_0xa7697a)return console[_0xe0fa17(0xe2)]('Error:\x20Path\x20or\x20name\x20is\x20required'),console['error']('Usage:\x20tdx\x20segment\x20describe\x20<path>'),console[_0xe0fa17(0xe2)](_0xe0fa17(0xdf)),console['error'](_0xe0fa17(0xfe)),console[_0xe0fa17(0xe2)](_0xe0fa17(0x128)),console[_0xe0fa17(0xe2)]('\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context'),console[_0xe0fa17(0xe2)](_0xe0fa17(0x12d)),0x1;try{const _0x28f82=_0x22c3de[_0xe0fa17(0x133)];let _0x25fe1a=_0xa7697a;!_0x26844e&&_0x28f82&&!_0xa7697a[_0xe0fa17(0x109)]('/')&&(_0x25fe1a=_0x28f82+'/'+_0xa7697a,_0x22c3de[_0xe0fa17(0x117)]&&console[_0xe0fa17(0xe2)](_0xe0fa17(0x120)+_0x25fe1a));const _0x29568b=await withSpinner('Resolving\x20path\x20\x27'+_0x25fe1a+'\x27...',()=>_0x4a4ac0[_0xe0fa17(0x143)][_0xe0fa17(0xf7)](_0x25fe1a),{'verbose':_0x22c3de['verbose']}),_0x58655a=_0x29568b['data'];_0x22c3de[_0xe0fa17(0x117)]&&(console[_0xe0fa17(0xe2)]('Resolved\x20type:\x20'+_0x58655a['type']),console['error'](_0xe0fa17(0x101)+_0x58655a[_0xe0fa17(0x136)]),_0x58655a[_0xe0fa17(0xdd)]&&console[_0xe0fa17(0xe2)]('Folder\x20ID:\x20'+_0x58655a['folderId']),_0x58655a[_0xe0fa17(0x12c)]&&console[_0xe0fa17(0xe2)]('Segment\x20ID:\x20'+_0x58655a[_0xe0fa17(0x12c)]));if(_0x58655a['type']===_0xe0fa17(0xfa)){const _0x68d21d=await withSpinner(_0xe0fa17(0x123),()=>_0x4a4ac0[_0xe0fa17(0x143)][_0xe0fa17(0x166)](_0x58655a['parentId']),{'verbose':_0x22c3de[_0xe0fa17(0x117)]});await handleSingleObjectOutput(_0x68d21d[_0xe0fa17(0x10c)],_0x22c3de);}else{if(_0x58655a[_0xe0fa17(0xd9)]===_0xe0fa17(0xf2)){if(!_0x58655a[_0xe0fa17(0xdd)])throw new SDKError(ErrorCode[_0xe0fa17(0x158)],_0xe0fa17(0x13a));const _0x43afb5=await withSpinner(_0xe0fa17(0xe7),()=>_0x4a4ac0[_0xe0fa17(0x143)][_0xe0fa17(0x140)](_0x58655a[_0xe0fa17(0xdd)]),{'verbose':_0x22c3de['verbose']});await handleSingleObjectOutput(_0x43afb5[_0xe0fa17(0x10c)],_0x22c3de);}else{if(_0x58655a[_0xe0fa17(0xd9)]===_0xe0fa17(0x143)){if(!_0x58655a['segmentId'])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0xe0fa17(0x12b));const _0x4bfe49=await withSpinner('Fetching\x20segment\x20details...',()=>_0x4a4ac0[_0xe0fa17(0x143)][_0xe0fa17(0x138)](_0x58655a[_0xe0fa17(0x136)],_0x58655a[_0xe0fa17(0x12c)]),{'verbose':_0x22c3de[_0xe0fa17(0x117)]});await handleSingleObjectOutput(_0x4bfe49[_0xe0fa17(0x10c)],_0x22c3de);}}}return 0x0;}catch(_0x5efc17){if(_0x5efc17 instanceof SDKError)return console[_0xe0fa17(0xe2)]('Error:\x20'+_0x5efc17[_0xe0fa17(0xf6)]),_0x5efc17[_0xe0fa17(0xe6)]&&console[_0xe0fa17(0xe2)](_0xe0fa17(0x119)+_0x5efc17[_0xe0fa17(0xe6)]),0x1;throw _0x5efc17;}}}export class SegmentShowCommand extends BaseCommand{[a31_0x3dbff1(0x10d)]='segment:show';[a31_0x3dbff1(0xe0)]=a31_0x3dbff1(0x11e);async[a31_0x3dbff1(0x156)](_0x261f37){const _0x2949ef=a31_0x3dbff1,{options:_0x23f13c,args:_0x2d558b,tdx:_0x4eca0f}=_0x261f37,_0x57f038=_0x2d558b[0x0];if(!_0x57f038)return console[_0x2949ef(0xe2)](_0x2949ef(0x112)),console[_0x2949ef(0xe2)](_0x2949ef(0xef)),console[_0x2949ef(0xe2)](_0x2949ef(0x15e)),console[_0x2949ef(0xe2)](_0x2949ef(0xdf)),console[_0x2949ef(0xe2)]('\x20\x20tdx\x20sg\x20show\x20\x22Premium\x20Users\x22'),console[_0x2949ef(0xe2)](_0x2949ef(0x107)),0x1;try{const _0x45c972=_0x23f13c[_0x2949ef(0x159)],_0x2d0253=await resolveSegmentTarget(_0x57f038,_0x45c972,_0x23f13c[_0x2949ef(0x117)]);_0x23f13c['verbose']&&console[_0x2949ef(0xe2)]('Target\x20path:\x20'+_0x2d0253);const _0x14595b=await withSpinner(_0x2949ef(0x141)+_0x57f038+_0x2949ef(0xd2),()=>_0x4eca0f[_0x2949ef(0x143)]['resolvePathToResource'](_0x2d0253),{'verbose':_0x23f13c[_0x2949ef(0x117)]}),_0x3dfde6=_0x14595b[_0x2949ef(0x10c)];_0x23f13c[_0x2949ef(0x117)]&&(console['error'](_0x2949ef(0xec)+_0x3dfde6[_0x2949ef(0xd9)]),console[_0x2949ef(0xe2)](_0x2949ef(0x101)+_0x3dfde6['parentId']));if(_0x3dfde6[_0x2949ef(0xd9)]===_0x2949ef(0xf2))return console['error'](_0x2949ef(0xdb)),console[_0x2949ef(0xe2)](_0x2949ef(0x15b)),0x1;if(_0x3dfde6[_0x2949ef(0xd9)]==='parent')return console['error'](_0x2949ef(0x145)),console[_0x2949ef(0xe2)](_0x2949ef(0x11a)),0x1;if(!_0x3dfde6[_0x2949ef(0x12c)])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x2949ef(0x12b));const _0x20841d=await withSpinner(_0x2949ef(0x14e),()=>_0x4eca0f[_0x2949ef(0x143)][_0x2949ef(0x130)](_0x3dfde6[_0x2949ef(0x136)],_0x3dfde6[_0x2949ef(0x12c)]),{'verbose':_0x23f13c[_0x2949ef(0x117)]});let _0x5debdf=_0x20841d[_0x2949ef(0x10c)];const _0x33abd3=resolveLimit(_0x23f13c[_0x2949ef(0x160)],DEFAULT_DISPLAY_LIMIT),_0x2640da=/\bLIMIT\s+\d+/i[_0x2949ef(0x126)](_0x5debdf);!_0x2640da&&(_0x5debdf=_0x5debdf[_0x2949ef(0x103)]()[_0x2949ef(0x164)](/;+$/,''),_0x5debdf='SELECT\x20*\x20FROM\x20(\x0a'+_0x5debdf+_0x2949ef(0x102)+_0x33abd3);_0x23f13c['verbose']&&console[_0x2949ef(0xe2)]('SQL\x20query:\x0a'+_0x5debdf);const _0x136f56=await withProgressSpinner(_0x2949ef(0x148),async _0xfdbdd6=>{const _0x266ed3=_0x2949ef,_0x473038=await _0x4eca0f[_0x266ed3(0xf8)][_0x266ed3(0x156)](_0x5debdf,{'catalog':'td','schema':_0x266ed3(0x14c),'onJobId':_0x15491a=>{const _0x599e9e=_0x266ed3;_0xfdbdd6[_0x599e9e(0x13b)](_0x15491a);}});return _0x473038;},{'verbose':_0x23f13c['verbose']}),_0x550d77=_0x136f56[_0x2949ef(0x10c)],_0x3f98d9=_0x550d77[_0x2949ef(0x157)]?_0x2949ef(0xfb)+_0x550d77[_0x2949ef(0x157)]+']':'';return console[_0x2949ef(0xe2)](_0x2949ef(0x122)+_0x550d77[_0x2949ef(0x152)][_0x2949ef(0x11c)][_0x2949ef(0x108)]()+'\x20rows\x20'+('in\x20'+formatElapsed(_0x550d77['stats'][_0x2949ef(0x110)])+_0x3f98d9)),await handleQueryOutput(_0x550d77,_0x23f13c),0x0;}catch(_0x485f4c){if(_0x485f4c instanceof SDKError)return console['error'](_0x2949ef(0xe3)+_0x485f4c[_0x2949ef(0x12a)]+']'),console[_0x2949ef(0xe2)]('\x0a'+_0x485f4c[_0x2949ef(0xf6)]),0x1;throw _0x485f4c;}}}export class SegmentFolderListCommand extends BaseCommand{[a31_0x3dbff1(0x10d)]=a31_0x3dbff1(0xff);['description']='List\x20segment\x20folders\x20under\x20a\x20parent\x20segment';async[a31_0x3dbff1(0x156)](_0xb7bc47){const _0x5302d4=a31_0x3dbff1,{options:_0x39c5a5,args:_0x286c30,tdx:_0x4946c1}=_0xb7bc47;if(_0x286c30['length']===0x0)return console[_0x5302d4(0xe2)](_0x5302d4(0x165)),console[_0x5302d4(0xe2)](_0x5302d4(0xda)),0x1;const _0x1001c9=_0x286c30[0x0];try{_0x39c5a5[_0x5302d4(0x117)]&&(console['error'](_0x5302d4(0x111)+_0x39c5a5['site']),console['error'](_0x5302d4(0x121)+_0x1001c9));const _0x4461df=await withSpinner(_0x5302d4(0x14b)+_0x1001c9+_0x5302d4(0xd2),()=>_0x4946c1['segment']['resolveParentId'](_0x1001c9),{'verbose':_0x39c5a5[_0x5302d4(0x117)]}),_0x37a1bc=_0x4461df[_0x5302d4(0x10c)];_0x39c5a5[_0x5302d4(0x117)]&&console[_0x5302d4(0xe2)](_0x5302d4(0xfd)+_0x37a1bc);const _0x45b7b1=await withSpinner('Listing\x20folders\x20for\x20parent\x20\x27'+_0x1001c9+'\x27...',()=>_0x4946c1[_0x5302d4(0x143)][_0x5302d4(0x149)](_0x37a1bc),{'verbose':_0x39c5a5[_0x5302d4(0x117)]}),_0x2346c3=_0x45b7b1['data'];return console[_0x5302d4(0xe2)](_0x5302d4(0x104)+_0x2346c3[_0x5302d4(0x144)]+_0x5302d4(0x113)+(_0x2346c3[_0x5302d4(0x144)]!==0x1?'s':'')),await handleSDKOutput(_0x2346c3,_0x39c5a5),0x0;}catch(_0xe6705b){if(_0xe6705b instanceof SDKError)return console[_0x5302d4(0xe2)](_0x5302d4(0x118)+_0xe6705b[_0x5302d4(0xf6)]),_0xe6705b['cause']&&console[_0x5302d4(0xe2)](_0x5302d4(0x119)+_0xe6705b[_0x5302d4(0xe6)]),0x1;throw _0xe6705b;}}}export class SegmentFolderShowCommand extends BaseCommand{['name']='segment:folder:show';[a31_0x3dbff1(0xe0)]=a31_0x3dbff1(0x132);async[a31_0x3dbff1(0x156)](_0x37fada){const _0x5de705=a31_0x3dbff1,{options:_0x258c8b,args:_0x19c71b,tdx:_0x2bd8e1}=_0x37fada;if(_0x19c71b['length']===0x0)return console[_0x5de705(0xe2)]('Error:\x20Folder\x20reference\x20is\x20required'),console[_0x5de705(0xe2)](_0x5de705(0x161)),0x1;try{const {parentId:_0x1fe33f,childId:_0x2d260e}=parseSegmentRef(_0x19c71b[0x0]);_0x258c8b[_0x5de705(0x117)]&&(console[_0x5de705(0xe2)](_0x5de705(0x111)+_0x258c8b[_0x5de705(0x116)]),console[_0x5de705(0xe2)](_0x5de705(0x121)+_0x1fe33f),_0x2d260e&&console['error'](_0x5de705(0x124)+_0x2d260e));if(!_0x2d260e)return console['error'](_0x5de705(0x146)),0x1;const _0x1bb4d9=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x1fe33f+_0x5de705(0xd2),()=>_0x2bd8e1['segment'][_0x5de705(0xed)](_0x1fe33f),{'verbose':_0x258c8b[_0x5de705(0x117)]}),_0x151cad=_0x1bb4d9[_0x5de705(0x10c)];_0x258c8b[_0x5de705(0x117)]&&console[_0x5de705(0xe2)](_0x5de705(0xfd)+_0x151cad);const _0x307c31=await withSpinner(_0x5de705(0x100)+_0x2d260e+'\x27...',()=>_0x2bd8e1[_0x5de705(0x143)]['resolveFolderId'](_0x151cad,_0x2d260e),{'verbose':_0x258c8b[_0x5de705(0x117)]}),_0x447c3b=_0x307c31[_0x5de705(0x10c)];_0x258c8b[_0x5de705(0x117)]&&console[_0x5de705(0xe2)](_0x5de705(0xd1)+_0x447c3b);const _0x2dc335=await withSpinner(_0x5de705(0x163)+_0x2d260e+_0x5de705(0xd2),()=>_0x2bd8e1[_0x5de705(0x143)][_0x5de705(0x140)](_0x447c3b),{'verbose':_0x258c8b[_0x5de705(0x117)]});return await handleSDKOutput([_0x2dc335[_0x5de705(0x10c)]],_0x258c8b),0x0;}catch(_0x2f2049){if(_0x2f2049 instanceof SDKError)return console['error'](_0x5de705(0x118)+_0x2f2049['message']),_0x2f2049[_0x5de705(0xe6)]&&console[_0x5de705(0xe2)](_0x5de705(0x119)+_0x2f2049['cause']),0x1;throw _0x2f2049;}}}export class SegmentSQLCommand extends BaseCommand{[a31_0x3dbff1(0x10d)]=a31_0x3dbff1(0x162);['description']=a31_0x3dbff1(0x135);async[a31_0x3dbff1(0x156)](_0x47976e){const _0x29a7b3=a31_0x3dbff1,{options:_0x211fd3,args:_0x3843b9,tdx:_0x1d9096}=_0x47976e,_0x1a2364=_0x3843b9[0x0];if(!_0x1a2364)return console[_0x29a7b3(0xe2)](_0x29a7b3(0x112)),console[_0x29a7b3(0xe2)](_0x29a7b3(0xf9)),console[_0x29a7b3(0xe2)](_0x29a7b3(0xf3)),console['error'](_0x29a7b3(0xdf)),console[_0x29a7b3(0xe2)](_0x29a7b3(0x106)),console['error'](_0x29a7b3(0xd4)),0x1;try{const _0x5ba65c=_0x211fd3['parentSegment'],_0x2f1cc0=await resolveSegmentTarget(_0x1a2364,_0x5ba65c,_0x211fd3[_0x29a7b3(0x117)]);_0x211fd3[_0x29a7b3(0x117)]&&console[_0x29a7b3(0xe2)](_0x29a7b3(0xd7)+_0x2f1cc0);const _0x5138ca=await withSpinner(_0x29a7b3(0x141)+_0x1a2364+_0x29a7b3(0xd2),()=>_0x1d9096[_0x29a7b3(0x143)]['resolvePathToResource'](_0x2f1cc0),{'verbose':_0x211fd3[_0x29a7b3(0x117)]}),_0x5d9d23=_0x5138ca[_0x29a7b3(0x10c)];_0x211fd3[_0x29a7b3(0x117)]&&(console[_0x29a7b3(0xe2)](_0x29a7b3(0xec)+_0x5d9d23[_0x29a7b3(0xd9)]),console[_0x29a7b3(0xe2)](_0x29a7b3(0x101)+_0x5d9d23[_0x29a7b3(0x136)]));if(_0x5d9d23[_0x29a7b3(0xd9)]===_0x29a7b3(0xf2))return console[_0x29a7b3(0xe2)]('Error:\x20Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.'),console['error'](_0x29a7b3(0xd3)),0x1;if(_0x5d9d23['type']===_0x29a7b3(0xfa))return console[_0x29a7b3(0xe2)]('Error:\x20Cannot\x20get\x20SQL\x20for\x20parent\x20segment\x20with\x20this\x20command.'),console['error']('Use:\x20tdx\x20ps\x20sql'),0x1;if(!_0x5d9d23[_0x29a7b3(0x12c)])throw new SDKError(ErrorCode[_0x29a7b3(0x11b)],_0x29a7b3(0x12b));const _0x2e6a7d=await withSpinner(_0x29a7b3(0x14e),()=>_0x1d9096[_0x29a7b3(0x143)][_0x29a7b3(0x130)](_0x5d9d23['parentId'],_0x5d9d23[_0x29a7b3(0x12c)]),{'verbose':_0x211fd3[_0x29a7b3(0x117)]}),_0x4027d6=_0x2e6a7d[_0x29a7b3(0x10c)];return _0x211fd3[_0x29a7b3(0x15f)]===_0x29a7b3(0x142)||_0x211fd3[_0x29a7b3(0x15f)]==='jsonl'?await handleSDKOutput([{'sql':_0x4027d6}],_0x211fd3):console[_0x29a7b3(0x14d)](_0x4027d6),0x0;}catch(_0x351778){if(_0x351778 instanceof SDKError)return console[_0x29a7b3(0xe2)](_0x29a7b3(0x118)+_0x351778[_0x29a7b3(0xf6)]),_0x351778[_0x29a7b3(0xe6)]&&console[_0x29a7b3(0xe2)](_0x29a7b3(0x119)+_0x351778[_0x29a7b3(0xe6)]),0x1;throw _0x351778;}}}export class SegmentFolderCreateCommand extends BaseCommand{['name']='segment:folder:create';[a31_0x3dbff1(0xe0)]=a31_0x3dbff1(0x12f);async[a31_0x3dbff1(0x156)](_0x11b2f8){const _0x25b9cd=a31_0x3dbff1,{options:_0x3637ad,args:_0x3af6e6,tdx:_0x459eca}=_0x11b2f8,_0x3358bb=_0x3637ad;if(_0x3af6e6['length']<0x2)return console[_0x25b9cd(0xe2)]('Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required'),console['error'](_0x25b9cd(0xfc)),0x1;const _0x256faf=_0x3af6e6[0x0],_0x428e69=_0x3af6e6[0x1];_0x3358bb[_0x25b9cd(0x117)]&&(console[_0x25b9cd(0xe2)](_0x25b9cd(0x111)+_0x3358bb[_0x25b9cd(0x116)]),console[_0x25b9cd(0xe2)](_0x25b9cd(0xdc)+_0x256faf),console['error']('Folder\x20name:\x20'+_0x428e69));let _0x4463fb;if(_0x3358bb[_0x25b9cd(0xf0)]){const _0x4e3ea9=_0x3358bb[_0x25b9cd(0xf0)],_0xbf50e4=await withSpinner(_0x25b9cd(0x14b)+_0x256faf+_0x25b9cd(0xd2),()=>_0x459eca[_0x25b9cd(0x143)][_0x25b9cd(0xed)](_0x256faf),{'verbose':_0x3358bb['verbose']}),_0x48b2b9=_0xbf50e4[_0x25b9cd(0x10c)],_0x16c883=await withSpinner(_0x25b9cd(0xce)+_0x4e3ea9+_0x25b9cd(0xd2),()=>_0x459eca[_0x25b9cd(0x143)][_0x25b9cd(0x147)](_0x48b2b9,_0x4e3ea9),{'verbose':_0x3358bb['verbose']});_0x4463fb=_0x16c883['data'],_0x3358bb['verbose']&&console['error'](_0x25b9cd(0xe8)+_0x4463fb);}const _0x1d0be1={'name':_0x428e69,'description':_0x3358bb[_0x25b9cd(0xe0)],'parentFolderId':_0x4463fb},_0x4884de=await withSpinner(_0x25b9cd(0xf5)+_0x428e69+_0x25b9cd(0xd2),()=>_0x459eca[_0x25b9cd(0x143)]['createFolder'](_0x256faf,_0x1d0be1),{'verbose':_0x3358bb[_0x25b9cd(0x117)]}),_0x5d2762=_0x4884de[_0x25b9cd(0x10c)];return console[_0x25b9cd(0xe2)]('✔\x20Created\x20folder\x20\x27'+_0x5d2762[_0x25b9cd(0x10d)]+_0x25b9cd(0xd0)+_0x5d2762['id']),await handleSDKOutput([_0x5d2762],_0x3358bb),0x0;}}export class SegmentViewCommand extends BaseCommand{['name']=a31_0x3dbff1(0x12e);[a31_0x3dbff1(0xe0)]=a31_0x3dbff1(0x10a);async[a31_0x3dbff1(0x156)](_0x2b0fe8){const _0x1bea9f=a31_0x3dbff1,{options:_0x56476b,args:_0x4216b7,tdx:_0x80a715}=_0x2b0fe8,_0x4f4cc1=_0x4216b7[0x0];if(!_0x4f4cc1)return console[_0x1bea9f(0xe2)](_0x1bea9f(0xee)),console[_0x1bea9f(0xe2)](_0x1bea9f(0x114)),console[_0x1bea9f(0xe2)](_0x1bea9f(0x105)),console['error']('Options:'),console[_0x1bea9f(0xe2)]('\x20\x20-w,\x20--web\x20\x20Open\x20segment\x20in\x20web\x20browser'),console[_0x1bea9f(0xe2)](_0x1bea9f(0xdf)),console[_0x1bea9f(0xe2)](_0x1bea9f(0x131)),console[_0x1bea9f(0xe2)](_0x1bea9f(0x127)),console['error']('\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20-w\x20\x20#\x20Open\x20segment\x20in\x20web\x20browser'),console['error'](_0x1bea9f(0xe1)),0x1;try{const _0x1f7f11=_0x56476b[_0x1bea9f(0x159)],_0x4e8a26=await resolveSegmentTarget(_0x4f4cc1,_0x1f7f11,_0x56476b[_0x1bea9f(0x117)]);_0x56476b[_0x1bea9f(0x117)]&&console['error'](_0x1bea9f(0xd7)+_0x4e8a26);const _0x83b811=await withSpinner('Resolving\x20\x27'+_0x4f4cc1+_0x1bea9f(0xd2),()=>_0x80a715[_0x1bea9f(0x143)][_0x1bea9f(0xf7)](_0x4e8a26),{'verbose':_0x56476b['verbose']}),_0x6ec61f=_0x83b811[_0x1bea9f(0x10c)];_0x56476b['verbose']&&(console['error'](_0x1bea9f(0xec)+_0x6ec61f[_0x1bea9f(0xd9)]),console[_0x1bea9f(0xe2)]('Parent\x20ID:\x20'+_0x6ec61f['parentId']),_0x6ec61f['folderId']&&console[_0x1bea9f(0xe2)](_0x1bea9f(0x15a)+_0x6ec61f[_0x1bea9f(0xdd)]),_0x6ec61f[_0x1bea9f(0x12c)]&&console['error'](_0x1bea9f(0x10e)+_0x6ec61f['segmentId']));if(_0x56476b['web']){if(_0x6ec61f[_0x1bea9f(0xd9)]===_0x1bea9f(0xf2))return console[_0x1bea9f(0xe2)](_0x1bea9f(0x13e)),0x1;if(_0x6ec61f[_0x1bea9f(0xd9)]===_0x1bea9f(0xfa))return console[_0x1bea9f(0xe2)]('Error:\x20Cannot\x20open\x20parent\x20segment\x20with\x20this\x20command.'),console['error'](_0x1bea9f(0x11f)),0x1;if(!_0x6ec61f[_0x1bea9f(0x12c)])throw new SDKError(ErrorCode[_0x1bea9f(0x11b)],_0x1bea9f(0x12b));const _0x2ee451=getConsoleNextUrl(_0x56476b[_0x1bea9f(0x116)],_0x1bea9f(0x155)+_0x6ec61f[_0x1bea9f(0x136)]+_0x1bea9f(0xcf)+_0x6ec61f[_0x1bea9f(0x12c)]);return console[_0x1bea9f(0xe2)](a31_0x46ffb[_0x1bea9f(0x13d)]('✔')+_0x1bea9f(0x15c)+a31_0x46ffb[_0x1bea9f(0x125)](_0x2ee451)),openBrowser(_0x2ee451),0x0;}if(_0x6ec61f[_0x1bea9f(0xd9)]==='folder'){if(!_0x6ec61f['folderId'])throw new SDKError(ErrorCode[_0x1bea9f(0x158)],_0x1bea9f(0x13a));const _0x33e1eb=await withSpinner(_0x1bea9f(0xe7),()=>_0x80a715[_0x1bea9f(0x143)][_0x1bea9f(0x140)](_0x6ec61f['folderId']),{'verbose':_0x56476b[_0x1bea9f(0x117)]});await handleSingleObjectOutput(_0x33e1eb[_0x1bea9f(0x10c)],_0x56476b);}else{if(_0x6ec61f[_0x1bea9f(0xd9)]==='segment'){if(!_0x6ec61f['segmentId'])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x1bea9f(0x12b));const _0x3aa555=await withSpinner(_0x1bea9f(0xd5),()=>_0x80a715[_0x1bea9f(0x143)][_0x1bea9f(0x138)](_0x6ec61f[_0x1bea9f(0x136)],_0x6ec61f['segmentId']),{'verbose':_0x56476b[_0x1bea9f(0x117)]}),_0xae3b68=getConsoleNextUrl(_0x56476b[_0x1bea9f(0x116)],_0x1bea9f(0x155)+_0x6ec61f[_0x1bea9f(0x136)]+_0x1bea9f(0xcf)+_0x6ec61f[_0x1bea9f(0x12c)]),_0x45f1ec=_0x3aa555[_0x1bea9f(0x10c)];_0x45f1ec['url']=_0xae3b68,await handleSingleObjectOutput(_0x45f1ec,_0x56476b);}else return console[_0x1bea9f(0xe2)](_0x1bea9f(0xe9)),console[_0x1bea9f(0xe2)]('Use:\x20tdx\x20ps\x20view'),0x1;}return 0x0;}catch(_0x4901df){if(_0x4901df instanceof SDKError)return console[_0x1bea9f(0xe2)](_0x1bea9f(0x118)+_0x4901df[_0x1bea9f(0xf6)]),_0x4901df['cause']&&console[_0x1bea9f(0xe2)](_0x1bea9f(0x119)+_0x4901df[_0x1bea9f(0xe6)]),0x1;throw _0x4901df;}}}function a31_0x5ae5(){const _0x185f61=['listFolders','35JwtZYz','Resolving\x20parent\x20segment\x20\x27','information_schema','log','Fetching\x20SQL\x20for\x20segment...','(root)','Resolved\x20YAML\x20file:\x20','313364XZBbJN','stats','127522QNmodF','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20desc\x20<path/to/segment.yml>','/app/ps/','execute','jobId','SEGMENT_FOLDER_NOT_FOUND','parentSegment','Folder\x20ID:\x20','Use:\x20tdx\x20sg\x20view\x20<name>\x20\x20#\x20To\x20show\x20folder\x20details','\x20Opening\x20','Show\x20segment\x20or\x20folder\x20details','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20show\x20<path/to/segment.yml>','format','limit','Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>','segment:sql','Fetching\x20folder\x20\x27','replace','Error:\x20Parent\x20segment\x20name\x20is\x20required','getParent','Resolving\x20parent\x20folder\x20\x27','/e/','\x27\x20with\x20ID:\x20','Resolved\x20folder\x20ID:\x20','\x27...','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','\x20\x20tdx\x20sg\x20sql\x20segments/my-audience/premium-users.yml','Fetching\x20segment\x20details...','segmentName','Target\x20path:\x20','5OkXzSo','type','Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>','Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.','Parent\x20segment:\x20','folderId','3361127ojHvWl','Examples:','description','\x20\x20tdx\x20sg\x20view\x20segments/my-audience/premium-users.yml','error','✖\x20Query\x20failed\x20[','727614EGCteQ','segment:desc','cause','Fetching\x20folder\x20details...','Resolved\x20parent\x20folder\x20ID:\x20','Error:\x20Cannot\x20view\x20parent\x20segment\x20details\x20with\x20this\x20command.','10884771rKQQjn','Error:\x20Cannot\x20show\x20schema\x20for\x20parent\x20segment\x20with\x20this\x20command.','Resolved\x20type:\x20','resolveParentId','Error:\x20Folder\x20or\x20segment\x20name,\x20or\x20YAML\x20file\x20path\x20is\x20required','Usage:\x20tdx\x20sg\x20show\x20<name>','parentFolder','\x20\x20Folder\x20path:\x20','folder','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20sql\x20<path/to/segment.yml>','Error:\x20Cannot\x20show\x20schema\x20for\x20a\x20folder.','Creating\x20folder\x20\x27','message','resolvePathToResource','query','Usage:\x20tdx\x20sg\x20sql\x20<name>','parent','\x20[Job\x20ID:\x20','Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]','Resolved\x20parent\x20ID:\x20','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22','segment:folder:list','Resolving\x20folder\x20\x27','Parent\x20ID:\x20','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','trim','✔\x20Found\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20view\x20<path/to/segment.yml>','\x20\x20tdx\x20sg\x20sql\x20\x22Premium\x20Users\x22','\x20\x20tdx\x20sg\x20show\x20segments/my-audience/premium-users.yml','toLocaleString','includes','Show\x20folder\x20or\x20child\x20segment\x20details','INVALID_ARGUMENT','data','name','Segment\x20ID:\x20','\x20\x20Parent\x20segment:\x20','elapsedTimeMillis','Site:\x20','Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required','\x20folder','Usage:\x20tdx\x20sg\x20view\x20<name>\x20[-w]','segment:describe','site','verbose','Error:\x20','\x20\x20Cause:\x20','Use:\x20tdx\x20ps\x20show','SEGMENT_NOT_FOUND','processedRows','Usage:\x20tdx\x20sg\x20desc\x20<name>','Execute\x20child\x20segment\x20SQL\x20query\x20and\x20show\x20results','Use:\x20tdx\x20ps\x20view\x20-w','Resolved\x20relative\x20path\x20to:\x20','Parent\x20name:\x20','✔\x20Query\x20completed:\x20Processed\x20','Fetching\x20parent\x20segment\x20details...','Folder\x20name:\x20','cyan','test','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20\x20\x20\x20\x20#\x20View\x20child\x20segment\x20details','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','code','Segment\x20ID\x20missing\x20from\x20resolved\x20path','segmentId','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','segment:view','Create\x20segment\x20folder\x20for\x20organization','getSegmentSQL','\x20\x20tdx\x20sg\x20view\x20\x22Marketing\x22\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20folder\x20details','Show\x20segment\x20folder\x20details','segmentPath','\x20\x20tdx\x20sg\x20desc\x20\x22Premium\x20Users\x22','Get\x20SQL\x20query\x20for\x20child\x20segment','parentId','\x20\x20Full\x20path:\x20','getSegment','2158528gPuxrA','Folder\x20ID\x20missing\x20from\x20resolved\x20path','setJobId','Show\x20child\x20segment\x20schema\x20(column\x20types)','green','Error:\x20Cannot\x20open\x20folder\x20in\x20web\x20browser.\x20Use\x20a\x20segment\x20name\x20instead.','861954ILAjIc','getFolder','Resolving\x20\x27','json','segment','length','Error:\x20Cannot\x20execute\x20query\x20for\x20parent\x20segment\x20with\x20this\x20command.','Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)','resolveFolderId','Executing\x20segment\x20query...'];a31_0x5ae5=function(){return _0x185f61;};return a31_0x5ae5();}export const SegmentInfoCommand=SegmentViewCommand;export class SegmentDescCommand extends BaseCommand{['name']=a31_0x3dbff1(0xe5);['description']=a31_0x3dbff1(0x13c);async[a31_0x3dbff1(0x156)](_0x1f916d){const _0xb0ee00=a31_0x3dbff1,{options:_0x2b4e08,args:_0x34d64b,tdx:_0x3e0dd1}=_0x1f916d,_0x39fcb6=_0x34d64b[0x0];if(!_0x39fcb6)return console[_0xb0ee00(0xe2)](_0xb0ee00(0x112)),console[_0xb0ee00(0xe2)](_0xb0ee00(0x11d)),console['error'](_0xb0ee00(0x154)),console[_0xb0ee00(0xe2)](_0xb0ee00(0xdf)),console[_0xb0ee00(0xe2)](_0xb0ee00(0x134)),console[_0xb0ee00(0xe2)]('\x20\x20tdx\x20sg\x20desc\x20segments/my-audience/premium-users.yml'),0x1;try{const _0x309c50=_0x2b4e08['parentSegment'],_0x56c1c0=await resolveSegmentTarget(_0x39fcb6,_0x309c50,_0x2b4e08[_0xb0ee00(0x117)]);_0x2b4e08[_0xb0ee00(0x117)]&&console['error'](_0xb0ee00(0xd7)+_0x56c1c0);const _0x313248=await withSpinner(_0xb0ee00(0x141)+_0x39fcb6+_0xb0ee00(0xd2),()=>_0x3e0dd1[_0xb0ee00(0x143)][_0xb0ee00(0xf7)](_0x56c1c0),{'verbose':_0x2b4e08[_0xb0ee00(0x117)]}),_0xd824fb=_0x313248[_0xb0ee00(0x10c)];_0x2b4e08[_0xb0ee00(0x117)]&&(console[_0xb0ee00(0xe2)](_0xb0ee00(0xec)+_0xd824fb[_0xb0ee00(0xd9)]),console[_0xb0ee00(0xe2)]('Parent\x20ID:\x20'+_0xd824fb[_0xb0ee00(0x136)]));if(_0xd824fb['type']===_0xb0ee00(0xf2))return console[_0xb0ee00(0xe2)](_0xb0ee00(0xf4)),console[_0xb0ee00(0xe2)](_0xb0ee00(0xd3)),0x1;if(_0xd824fb[_0xb0ee00(0xd9)]===_0xb0ee00(0xfa))return console['error'](_0xb0ee00(0xeb)),console[_0xb0ee00(0xe2)]('Use:\x20tdx\x20ps\x20desc'),0x1;if(!_0xd824fb['segmentId'])throw new SDKError(ErrorCode[_0xb0ee00(0x11b)],_0xb0ee00(0x12b));const _0x4275ef=await withSpinner(_0xb0ee00(0x14e),()=>_0x3e0dd1[_0xb0ee00(0x143)][_0xb0ee00(0x130)](_0xd824fb[_0xb0ee00(0x136)],_0xd824fb[_0xb0ee00(0x12c)]),{'verbose':_0x2b4e08['verbose']}),_0x32e739=_0x4275ef[_0xb0ee00(0x10c)],_0x10be91=await executeSchemaQuery(_0x32e739,_0x3e0dd1,_0x2b4e08);return await handleQueryOutput(_0x10be91,_0x2b4e08),0x0;}catch(_0x4e5265){if(_0x4e5265 instanceof SDKError)return console[_0xb0ee00(0xe2)](_0xb0ee00(0x118)+_0x4e5265['message']),_0x4e5265[_0xb0ee00(0xe6)]&&console[_0xb0ee00(0xe2)](_0xb0ee00(0x119)+_0x4e5265['cause']),0x1;throw _0x4e5265;}}}
1
+ const a31_0xb52cfe=a31_0x3522;(function(_0x125b66,_0x61a61d){const _0x24128f=a31_0x3522,_0x53dd90=_0x125b66();while(!![]){try{const _0x5a18be=parseInt(_0x24128f(0x1d5))/0x1*(parseInt(_0x24128f(0x1b9))/0x2)+parseInt(_0x24128f(0x1d9))/0x3*(parseInt(_0x24128f(0x1e1))/0x4)+-parseInt(_0x24128f(0x1d8))/0x5+parseInt(_0x24128f(0x18b))/0x6+-parseInt(_0x24128f(0x1b8))/0x7*(parseInt(_0x24128f(0x18a))/0x8)+parseInt(_0x24128f(0x1fe))/0x9*(parseInt(_0x24128f(0x206))/0xa)+-parseInt(_0x24128f(0x1de))/0xb;if(_0x5a18be===_0x61a61d)break;else _0x53dd90['push'](_0x53dd90['shift']());}catch(_0x395183){_0x53dd90['push'](_0x53dd90['shift']());}}}(a31_0x578c,0x8f49a));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';function a31_0x3522(_0x5a2e1e,_0x1d1a85){_0x5a2e1e=_0x5a2e1e-0x176;const _0x578c55=a31_0x578c();let _0x3522a7=_0x578c55[_0x5a2e1e];return _0x3522a7;}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 a31_0x1bdaba from'chalk';async function resolveSegmentTarget(_0x34c012,_0x5f19e5,_0x18c1be){const _0x171ca4=a31_0x3522;if(isYamlFilePath(_0x34c012))try{const _0x42727d=await resolveYamlFilePath(_0x34c012);return _0x18c1be&&(console['error']('Resolved\x20YAML\x20file:\x20'+_0x34c012),console['error'](_0x171ca4(0x192)+_0x42727d['parentSegment']),console['error'](_0x171ca4(0x194)+_0x42727d[_0x171ca4(0x1b4)]),console[_0x171ca4(0x1dd)]('\x20\x20Folder\x20path:\x20'+(_0x42727d[_0x171ca4(0x1dc)]||_0x171ca4(0x1ed))),console[_0x171ca4(0x1dd)](_0x171ca4(0x199)+_0x42727d[_0x171ca4(0x20e)])),_0x42727d[_0x171ca4(0x20e)];}catch(_0xbb8894){throw new SDKError(ErrorCode['INVALID_ARGUMENT'],'Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20'+_0xbb8894[_0x171ca4(0x1bb)]);}if(!_0x5f19e5)throw new SDKError(ErrorCode[_0x171ca4(0x17f)],_0x171ca4(0x20c));return _0x5f19e5+'/'+_0x34c012;}export class SegmentDescribeCommand extends BaseCommand{[a31_0xb52cfe(0x19d)]=a31_0xb52cfe(0x17d);[a31_0xb52cfe(0x1c3)]=a31_0xb52cfe(0x176);async['execute'](_0x1ab45b){const _0x31570e=a31_0xb52cfe,{options:_0x5f015c,args:_0x415ec4,tdx:_0x246026}=_0x1ab45b,_0x4582c4=_0x415ec4[0x0],_0x2abd73=!_0x4582c4&&!!_0x5f015c[_0x31570e(0x191)],_0x4182c6=_0x4582c4||_0x5f015c[_0x31570e(0x191)];if(!_0x4182c6)return console['error'](_0x31570e(0x1e6)),console['error']('Usage:\x20tdx\x20segment\x20describe\x20<path>'),console[_0x31570e(0x1dd)](_0x31570e(0x1fc)),console[_0x31570e(0x1dd)](_0x31570e(0x1b5)),console[_0x31570e(0x1dd)](_0x31570e(0x17a)),console[_0x31570e(0x1dd)](_0x31570e(0x20b)),console[_0x31570e(0x1dd)](_0x31570e(0x1ac)),0x1;try{const _0x213969=_0x5f015c[_0x31570e(0x18c)];let _0x82b990=_0x4182c6;!_0x2abd73&&_0x213969&&!_0x4182c6[_0x31570e(0x1d3)]('/')&&(_0x82b990=_0x213969+'/'+_0x4182c6,_0x5f015c[_0x31570e(0x20a)]&&console[_0x31570e(0x1dd)](_0x31570e(0x1f5)+_0x82b990));const _0x37c550=await withSpinner(_0x31570e(0x185)+_0x82b990+_0x31570e(0x1c7),()=>_0x246026['segment']['resolvePathToResource'](_0x82b990),{'verbose':_0x5f015c[_0x31570e(0x20a)]}),_0x18d1a3=_0x37c550[_0x31570e(0x1be)];_0x5f015c[_0x31570e(0x20a)]&&(console[_0x31570e(0x1dd)]('Resolved\x20type:\x20'+_0x18d1a3[_0x31570e(0x20f)]),console[_0x31570e(0x1dd)](_0x31570e(0x1e5)+_0x18d1a3[_0x31570e(0x1fd)]),_0x18d1a3[_0x31570e(0x209)]&&console[_0x31570e(0x1dd)](_0x31570e(0x1a5)+_0x18d1a3[_0x31570e(0x209)]),_0x18d1a3[_0x31570e(0x19b)]&&console['error'](_0x31570e(0x1ce)+_0x18d1a3['segmentId']));if(_0x18d1a3[_0x31570e(0x20f)]===_0x31570e(0x1e8)){const _0x2fe460=await withSpinner(_0x31570e(0x1e4),()=>_0x246026[_0x31570e(0x1a2)][_0x31570e(0x1a8)](_0x18d1a3[_0x31570e(0x1fd)]),{'verbose':_0x5f015c[_0x31570e(0x20a)]});await handleSingleObjectOutput(_0x2fe460['data'],_0x5f015c);}else{if(_0x18d1a3['type']===_0x31570e(0x1c6)){if(!_0x18d1a3['folderId'])throw new SDKError(ErrorCode['SEGMENT_FOLDER_NOT_FOUND'],_0x31570e(0x18d));const _0x4ce97e=await withSpinner(_0x31570e(0x184),()=>_0x246026['segment'][_0x31570e(0x210)](_0x18d1a3[_0x31570e(0x209)]),{'verbose':_0x5f015c[_0x31570e(0x20a)]});await handleSingleObjectOutput(_0x4ce97e['data'],_0x5f015c);}else{if(_0x18d1a3[_0x31570e(0x20f)]===_0x31570e(0x1a2)){if(!_0x18d1a3[_0x31570e(0x19b)])throw new SDKError(ErrorCode[_0x31570e(0x197)],_0x31570e(0x198));const _0x4001f8=await withSpinner('Fetching\x20segment\x20details...',()=>_0x246026[_0x31570e(0x1a2)][_0x31570e(0x179)](_0x18d1a3[_0x31570e(0x1fd)],_0x18d1a3[_0x31570e(0x19b)]),{'verbose':_0x5f015c[_0x31570e(0x20a)]});await handleSingleObjectOutput(_0x4001f8[_0x31570e(0x1be)],_0x5f015c);}}}return 0x0;}catch(_0x4be33d){if(_0x4be33d instanceof SDKError)return console[_0x31570e(0x1dd)](_0x31570e(0x1f3)+_0x4be33d['message']),_0x4be33d[_0x31570e(0x1f0)]&&console['error'](_0x31570e(0x1ae)+_0x4be33d['cause']),0x1;throw _0x4be33d;}}}export class SegmentShowCommand extends BaseCommand{[a31_0xb52cfe(0x19d)]='segment:show';[a31_0xb52cfe(0x1c3)]=a31_0xb52cfe(0x182);async['execute'](_0x424163){const _0x171fe8=a31_0xb52cfe,{options:_0x74da3c,args:_0x8265a1,tdx:_0x1b6870}=_0x424163,_0x407765=_0x8265a1[0x0];if(!_0x407765)return console[_0x171fe8(0x1dd)](_0x171fe8(0x1ff)),console[_0x171fe8(0x1dd)]('Usage:\x20tdx\x20sg\x20show\x20<name>'),console[_0x171fe8(0x1dd)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20show\x20<path/to/segment.yml>'),console[_0x171fe8(0x1dd)](_0x171fe8(0x1fc)),console['error'](_0x171fe8(0x1fb)),console['error'](_0x171fe8(0x1cf)),0x1;try{const _0x316b41=_0x74da3c[_0x171fe8(0x191)],_0x25b55c=await resolveSegmentTarget(_0x407765,_0x316b41,_0x74da3c[_0x171fe8(0x20a)]);_0x74da3c[_0x171fe8(0x20a)]&&console[_0x171fe8(0x1dd)](_0x171fe8(0x1bf)+_0x25b55c);const _0xb61b60=await withSpinner(_0x171fe8(0x205)+_0x407765+_0x171fe8(0x1c7),()=>_0x1b6870[_0x171fe8(0x1a2)][_0x171fe8(0x186)](_0x25b55c),{'verbose':_0x74da3c[_0x171fe8(0x20a)]}),_0x275495=_0xb61b60[_0x171fe8(0x1be)];_0x74da3c[_0x171fe8(0x20a)]&&(console[_0x171fe8(0x1dd)](_0x171fe8(0x203)+_0x275495[_0x171fe8(0x20f)]),console[_0x171fe8(0x1dd)]('Parent\x20ID:\x20'+_0x275495['parentId']));if(_0x275495[_0x171fe8(0x20f)]==='folder')return console[_0x171fe8(0x1dd)](_0x171fe8(0x20d)),console['error'](_0x171fe8(0x1ad)),0x1;if(_0x275495[_0x171fe8(0x20f)]===_0x171fe8(0x1e8))return console[_0x171fe8(0x1dd)](_0x171fe8(0x1da)),console[_0x171fe8(0x1dd)](_0x171fe8(0x1a4)),0x1;if(!_0x275495[_0x171fe8(0x19b)])throw new SDKError(ErrorCode[_0x171fe8(0x197)],_0x171fe8(0x198));const _0x47744c=await withSpinner(_0x171fe8(0x1d0),()=>_0x1b6870[_0x171fe8(0x1a2)]['getSegmentSQL'](_0x275495[_0x171fe8(0x1fd)],_0x275495[_0x171fe8(0x19b)]),{'verbose':_0x74da3c[_0x171fe8(0x20a)]});let _0x163d7d=_0x47744c['data'];const _0xcfd1c1=resolveLimit(_0x74da3c['limit'],DEFAULT_DISPLAY_LIMIT),_0x4a337c=/\bLIMIT\s+\d+/i['test'](_0x163d7d);!_0x4a337c&&(_0x163d7d=_0x163d7d[_0x171fe8(0x1cb)]()['replace'](/;+$/,''),_0x163d7d='SELECT\x20*\x20FROM\x20(\x0a'+_0x163d7d+_0x171fe8(0x1f8)+_0xcfd1c1);_0x74da3c[_0x171fe8(0x20a)]&&console['error'](_0x171fe8(0x1fa)+_0x163d7d);const _0x55e35d=await withProgressSpinner(_0x171fe8(0x1f2),async _0x3d3cea=>{const _0x3986e4=_0x171fe8,_0x194d1f=await _0x1b6870[_0x3986e4(0x18f)][_0x3986e4(0x1d4)](_0x163d7d,{'catalog':'td','schema':'information_schema','onJobId':_0x2cba29=>{const _0x268c6a=_0x3986e4;_0x3d3cea[_0x268c6a(0x17c)](_0x2cba29);}});return _0x194d1f;},{'verbose':_0x74da3c[_0x171fe8(0x20a)]}),_0x2d142f=_0x55e35d['data'],_0x6857b2=_0x2d142f[_0x171fe8(0x1a7)]?_0x171fe8(0x1ab)+_0x2d142f[_0x171fe8(0x1a7)]+']':'';return console[_0x171fe8(0x1dd)](_0x171fe8(0x1e3)+_0x2d142f['stats'][_0x171fe8(0x1eb)][_0x171fe8(0x19f)]()+_0x171fe8(0x1ca)+(_0x171fe8(0x180)+formatElapsed(_0x2d142f[_0x171fe8(0x207)][_0x171fe8(0x1f4)])+_0x6857b2)),await handleQueryOutput(_0x2d142f,_0x74da3c),0x0;}catch(_0x2fb04b){if(_0x2fb04b instanceof SDKError)return console[_0x171fe8(0x1dd)]('✖\x20Query\x20failed\x20['+_0x2fb04b[_0x171fe8(0x1ec)]+']'),console['error']('\x0a'+_0x2fb04b[_0x171fe8(0x1bb)]),0x1;throw _0x2fb04b;}}}export class SegmentFolderListCommand extends BaseCommand{['name']=a31_0xb52cfe(0x202);[a31_0xb52cfe(0x1c3)]='List\x20segment\x20folders\x20under\x20a\x20parent\x20segment';async[a31_0xb52cfe(0x1d4)](_0x33c99c){const _0x44571d=a31_0xb52cfe,{options:_0x26c6f6,args:_0x56a143,tdx:_0x3a8d9d}=_0x33c99c;if(_0x56a143[_0x44571d(0x1c0)]===0x0)return console[_0x44571d(0x1dd)]('Error:\x20Parent\x20segment\x20name\x20is\x20required'),console[_0x44571d(0x1dd)](_0x44571d(0x1a3)),0x1;const _0x41e042=_0x56a143[0x0];try{_0x26c6f6[_0x44571d(0x20a)]&&(console[_0x44571d(0x1dd)](_0x44571d(0x1bd)+_0x26c6f6['site']),console[_0x44571d(0x1dd)]('Parent\x20name:\x20'+_0x41e042));const _0x2fe144=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x41e042+'\x27...',()=>_0x3a8d9d[_0x44571d(0x1a2)][_0x44571d(0x1bc)](_0x41e042),{'verbose':_0x26c6f6[_0x44571d(0x20a)]}),_0x463780=_0x2fe144['data'];_0x26c6f6['verbose']&&console[_0x44571d(0x1dd)]('Resolved\x20parent\x20ID:\x20'+_0x463780);const _0x5654e5=await withSpinner('Listing\x20folders\x20for\x20parent\x20\x27'+_0x41e042+'\x27...',()=>_0x3a8d9d['segment'][_0x44571d(0x177)](_0x463780),{'verbose':_0x26c6f6[_0x44571d(0x20a)]}),_0x36d9cd=_0x5654e5[_0x44571d(0x1be)];return console[_0x44571d(0x1dd)](_0x44571d(0x1c1)+_0x36d9cd[_0x44571d(0x1c0)]+_0x44571d(0x1db)+(_0x36d9cd[_0x44571d(0x1c0)]!==0x1?'s':'')),await handleSDKOutput(_0x36d9cd,_0x26c6f6),0x0;}catch(_0x2dfdcc){if(_0x2dfdcc instanceof SDKError)return console[_0x44571d(0x1dd)](_0x44571d(0x1f3)+_0x2dfdcc[_0x44571d(0x1bb)]),_0x2dfdcc[_0x44571d(0x1f0)]&&console[_0x44571d(0x1dd)]('\x20\x20Cause:\x20'+_0x2dfdcc['cause']),0x1;throw _0x2dfdcc;}}}export class SegmentFolderShowCommand extends BaseCommand{[a31_0xb52cfe(0x19d)]='segment:folder:show';['description']='Show\x20segment\x20folder\x20details';async[a31_0xb52cfe(0x1d4)](_0x54493d){const _0x2c39ee=a31_0xb52cfe,{options:_0x2280e3,args:_0x4dbaca,tdx:_0x39191f}=_0x54493d;if(_0x4dbaca[_0x2c39ee(0x1c0)]===0x0)return console['error']('Error:\x20Folder\x20reference\x20is\x20required'),console[_0x2c39ee(0x1dd)](_0x2c39ee(0x1b7)),0x1;try{const {parentId:_0x584482,childId:_0x4004cc}=parseSegmentRef(_0x4dbaca[0x0]);_0x2280e3[_0x2c39ee(0x20a)]&&(console[_0x2c39ee(0x1dd)](_0x2c39ee(0x1bd)+_0x2280e3[_0x2c39ee(0x1e0)]),console['error'](_0x2c39ee(0x1a1)+_0x584482),_0x4004cc&&console['error'](_0x2c39ee(0x1b2)+_0x4004cc));if(!_0x4004cc)return console[_0x2c39ee(0x1dd)]('Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)'),0x1;const _0x153c07=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x584482+'\x27...',()=>_0x39191f[_0x2c39ee(0x1a2)][_0x2c39ee(0x1bc)](_0x584482),{'verbose':_0x2280e3[_0x2c39ee(0x20a)]}),_0x49554f=_0x153c07[_0x2c39ee(0x1be)];_0x2280e3[_0x2c39ee(0x20a)]&&console['error'](_0x2c39ee(0x1e7)+_0x49554f);const _0x19c188=await withSpinner(_0x2c39ee(0x1d7)+_0x4004cc+_0x2c39ee(0x1c7),()=>_0x39191f[_0x2c39ee(0x1a2)][_0x2c39ee(0x1ba)](_0x49554f,_0x4004cc),{'verbose':_0x2280e3[_0x2c39ee(0x20a)]}),_0x4f1aa9=_0x19c188[_0x2c39ee(0x1be)];_0x2280e3[_0x2c39ee(0x20a)]&&console[_0x2c39ee(0x1dd)](_0x2c39ee(0x1a6)+_0x4f1aa9);const _0x396cf8=await withSpinner(_0x2c39ee(0x1aa)+_0x4004cc+_0x2c39ee(0x1c7),()=>_0x39191f['segment'][_0x2c39ee(0x210)](_0x4f1aa9),{'verbose':_0x2280e3[_0x2c39ee(0x20a)]});return await handleSDKOutput([_0x396cf8[_0x2c39ee(0x1be)]],_0x2280e3),0x0;}catch(_0x35649b){if(_0x35649b instanceof SDKError)return console[_0x2c39ee(0x1dd)](_0x2c39ee(0x1f3)+_0x35649b['message']),_0x35649b['cause']&&console[_0x2c39ee(0x1dd)](_0x2c39ee(0x1ae)+_0x35649b['cause']),0x1;throw _0x35649b;}}}export class SegmentSQLCommand extends BaseCommand{[a31_0xb52cfe(0x19d)]='segment:sql';['description']=a31_0xb52cfe(0x1cc);async[a31_0xb52cfe(0x1d4)](_0x469799){const _0x498d17=a31_0xb52cfe,{options:_0x5e4eaa,args:_0x34f271,tdx:_0x236ed1}=_0x469799,_0xcb02ad=_0x34f271[0x0];if(!_0xcb02ad)return console[_0x498d17(0x1dd)](_0x498d17(0x1ff)),console[_0x498d17(0x1dd)](_0x498d17(0x1e9)),console['error']('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20sql\x20<path/to/segment.yml>'),console['error'](_0x498d17(0x1fc)),console[_0x498d17(0x1dd)](_0x498d17(0x1af)),console[_0x498d17(0x1dd)](_0x498d17(0x189)),0x1;try{const _0x3c02a0=_0x5e4eaa[_0x498d17(0x191)],_0x161123=await resolveSegmentTarget(_0xcb02ad,_0x3c02a0,_0x5e4eaa['verbose']);_0x5e4eaa[_0x498d17(0x20a)]&&console[_0x498d17(0x1dd)](_0x498d17(0x1bf)+_0x161123);const _0x4956e2=await withSpinner(_0x498d17(0x205)+_0xcb02ad+_0x498d17(0x1c7),()=>_0x236ed1[_0x498d17(0x1a2)][_0x498d17(0x186)](_0x161123),{'verbose':_0x5e4eaa['verbose']}),_0x3fa8d3=_0x4956e2[_0x498d17(0x1be)];_0x5e4eaa['verbose']&&(console['error']('Resolved\x20type:\x20'+_0x3fa8d3[_0x498d17(0x20f)]),console[_0x498d17(0x1dd)](_0x498d17(0x1e5)+_0x3fa8d3[_0x498d17(0x1fd)]));if(_0x3fa8d3[_0x498d17(0x20f)]==='folder')return console[_0x498d17(0x1dd)]('Error:\x20Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.'),console[_0x498d17(0x1dd)](_0x498d17(0x1cd)),0x1;if(_0x3fa8d3['type']===_0x498d17(0x1e8))return console[_0x498d17(0x1dd)](_0x498d17(0x1f9)),console[_0x498d17(0x1dd)](_0x498d17(0x1c5)),0x1;if(!_0x3fa8d3[_0x498d17(0x19b)])throw new SDKError(ErrorCode[_0x498d17(0x197)],_0x498d17(0x198));const _0x19de73=await withSpinner(_0x498d17(0x1d0),()=>_0x236ed1[_0x498d17(0x1a2)][_0x498d17(0x196)](_0x3fa8d3[_0x498d17(0x1fd)],_0x3fa8d3[_0x498d17(0x19b)]),{'verbose':_0x5e4eaa[_0x498d17(0x20a)]}),_0x16b324=_0x19de73[_0x498d17(0x1be)];return _0x5e4eaa['format']===_0x498d17(0x183)||_0x5e4eaa[_0x498d17(0x1b3)]===_0x498d17(0x187)?await handleSDKOutput([{'sql':_0x16b324}],_0x5e4eaa):console['log'](_0x16b324),0x0;}catch(_0x39d590){if(_0x39d590 instanceof SDKError)return console[_0x498d17(0x1dd)](_0x498d17(0x1f3)+_0x39d590['message']),_0x39d590[_0x498d17(0x1f0)]&&console[_0x498d17(0x1dd)]('\x20\x20Cause:\x20'+_0x39d590[_0x498d17(0x1f0)]),0x1;throw _0x39d590;}}}export class SegmentFolderCreateCommand extends BaseCommand{[a31_0xb52cfe(0x19d)]=a31_0xb52cfe(0x1f7);[a31_0xb52cfe(0x1c3)]='Create\x20segment\x20folder\x20for\x20organization';async[a31_0xb52cfe(0x1d4)](_0x2936fb){const _0x262627=a31_0xb52cfe,{options:_0x460929,args:_0x6f0312,tdx:_0x5c85db}=_0x2936fb,_0xfa60e7=_0x460929;if(_0x6f0312['length']<0x2)return console['error'](_0x262627(0x1b0)),console[_0x262627(0x1dd)](_0x262627(0x1df)),0x1;const _0x2c617d=_0x6f0312[0x0],_0x2f8bdf=_0x6f0312[0x1];_0xfa60e7['verbose']&&(console[_0x262627(0x1dd)](_0x262627(0x1bd)+_0xfa60e7['site']),console['error']('Parent\x20segment:\x20'+_0x2c617d),console[_0x262627(0x1dd)](_0x262627(0x1b2)+_0x2f8bdf));let _0xe3169d;if(_0xfa60e7[_0x262627(0x17b)]){const _0x1151f0=_0xfa60e7[_0x262627(0x17b)],_0xe66c63=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x2c617d+_0x262627(0x1c7),()=>_0x5c85db[_0x262627(0x1a2)]['resolveParentId'](_0x2c617d),{'verbose':_0xfa60e7[_0x262627(0x20a)]}),_0x5ecf5b=_0xe66c63[_0x262627(0x1be)],_0x1a08d6=await withSpinner(_0x262627(0x1f1)+_0x1151f0+_0x262627(0x1c7),()=>_0x5c85db[_0x262627(0x1a2)][_0x262627(0x1ba)](_0x5ecf5b,_0x1151f0),{'verbose':_0xfa60e7['verbose']});_0xe3169d=_0x1a08d6[_0x262627(0x1be)],_0xfa60e7[_0x262627(0x20a)]&&console[_0x262627(0x1dd)](_0x262627(0x1e2)+_0xe3169d);}const _0x501b41={'name':_0x2f8bdf,'description':_0xfa60e7[_0x262627(0x1c3)],'parentFolderId':_0xe3169d},_0x107804=await withSpinner(_0x262627(0x178)+_0x2f8bdf+_0x262627(0x1c7),()=>_0x5c85db['segment'][_0x262627(0x1c8)](_0x2c617d,_0x501b41),{'verbose':_0xfa60e7[_0x262627(0x20a)]}),_0x5a39a5=_0x107804[_0x262627(0x1be)];return console['error'](_0x262627(0x1d2)+_0x5a39a5[_0x262627(0x19d)]+_0x262627(0x1c4)+_0x5a39a5['id']),await handleSDKOutput([_0x5a39a5],_0xfa60e7),0x0;}}function a31_0x578c(){const _0x3b4079=['\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22','parentFolder','setJobId','segment:describe','Usage:\x20tdx\x20sg\x20view\x20<name>\x20[-w]','INVALID_ARGUMENT','in\x20','\x20\x20tdx\x20sg\x20view\x20\x22Marketing\x22\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20folder\x20details','Execute\x20child\x20segment\x20SQL\x20query\x20and\x20show\x20results','json','Fetching\x20folder\x20details...','Resolving\x20path\x20\x27','resolvePathToResource','jsonl','Show\x20folder\x20or\x20child\x20segment\x20details','\x20\x20tdx\x20sg\x20sql\x20segments/my-audience/premium-users.yml','8hVgxQf','596664eynBhV','segmentPath','Folder\x20ID\x20missing\x20from\x20resolved\x20path','segment:desc','query','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20-w\x20\x20#\x20Open\x20segment\x20in\x20web\x20browser','parentSegment','\x20\x20Parent\x20segment:\x20','\x20\x20tdx\x20sg\x20desc\x20segments/my-audience/premium-users.yml','\x20\x20Segment\x20name:\x20','Use:\x20tdx\x20ps\x20view','getSegmentSQL','SEGMENT_NOT_FOUND','Segment\x20ID\x20missing\x20from\x20resolved\x20path','\x20\x20Full\x20path:\x20','Error:\x20Cannot\x20open\x20folder\x20in\x20web\x20browser.\x20Use\x20a\x20segment\x20name\x20instead.','segmentId','cyan','name','green','toLocaleString','/e/','Parent\x20name:\x20','segment','Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>','Use:\x20tdx\x20ps\x20show','Folder\x20ID:\x20','Resolved\x20folder\x20ID:\x20','jobId','getParent','Use:\x20tdx\x20ps\x20desc','Fetching\x20folder\x20\x27','\x20[Job\x20ID:\x20','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','Use:\x20tdx\x20sg\x20view\x20<name>\x20\x20#\x20To\x20show\x20folder\x20details','\x20\x20Cause:\x20','\x20\x20tdx\x20sg\x20sql\x20\x22Premium\x20Users\x22','Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required','Options:','Folder\x20name:\x20','format','segmentName','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22','Error:\x20Cannot\x20show\x20schema\x20for\x20parent\x20segment\x20with\x20this\x20command.','Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>','6347929usOzfa','542CqzEoE','resolveFolderId','message','resolveParentId','Site:\x20','data','Target\x20path:\x20','length','✔\x20Found\x20','\x20\x20-w,\x20--web\x20\x20Open\x20segment\x20in\x20web\x20browser','description','\x27\x20with\x20ID:\x20','Use:\x20tdx\x20ps\x20sql','folder','\x27...','createFolder','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20desc\x20<path/to/segment.yml>','\x20rows\x20','trim','Get\x20SQL\x20query\x20for\x20child\x20segment','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','Segment\x20ID:\x20','\x20\x20tdx\x20sg\x20show\x20segments/my-audience/premium-users.yml','Fetching\x20SQL\x20for\x20segment...','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20view\x20<path/to/segment.yml>','✔\x20Created\x20folder\x20\x27','includes','execute','1483MmPMkV','Error:\x20Cannot\x20show\x20schema\x20for\x20a\x20folder.','Resolving\x20folder\x20\x27','1467380PsKpwj','17133JWoKdb','Error:\x20Cannot\x20execute\x20query\x20for\x20parent\x20segment\x20with\x20this\x20command.','\x20folder','folderPath','error','6956433dSmQkp','Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]','site','716lSNxsE','Resolved\x20parent\x20folder\x20ID:\x20','✔\x20Query\x20completed:\x20Processed\x20','Fetching\x20parent\x20segment\x20details...','Parent\x20ID:\x20','Error:\x20Path\x20or\x20name\x20is\x20required','Resolved\x20parent\x20ID:\x20','parent','Usage:\x20tdx\x20sg\x20sql\x20<name>','\x20\x20tdx\x20sg\x20view\x20segments/my-audience/premium-users.yml','processedRows','code','(root)','Error:\x20Folder\x20or\x20segment\x20name,\x20or\x20YAML\x20file\x20path\x20is\x20required','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20\x20\x20\x20\x20#\x20View\x20child\x20segment\x20details','cause','Resolving\x20parent\x20folder\x20\x27','Executing\x20segment\x20query...','Error:\x20','elapsedTimeMillis','Resolved\x20relative\x20path\x20to:\x20','segment:view','segment:folder:create','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','Error:\x20Cannot\x20get\x20SQL\x20for\x20parent\x20segment\x20with\x20this\x20command.','SQL\x20query:\x0a','\x20\x20tdx\x20sg\x20show\x20\x22Premium\x20Users\x22','Examples:','parentId','4032117kyzhMF','Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required','web','url','segment:folder:list','Resolved\x20type:\x20','\x20Opening\x20','Resolving\x20\x27','20NjFYkn','stats','Error:\x20Cannot\x20view\x20parent\x20segment\x20details\x20with\x20this\x20command.','folderId','verbose','\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.','fullPath','type','getFolder','Show\x20segment\x20or\x20folder\x20details','listFolders','Creating\x20folder\x20\x27','getSegment'];a31_0x578c=function(){return _0x3b4079;};return a31_0x578c();}export class SegmentViewCommand extends BaseCommand{[a31_0xb52cfe(0x19d)]=a31_0xb52cfe(0x1f6);['description']=a31_0xb52cfe(0x188);async[a31_0xb52cfe(0x1d4)](_0x5aa781){const _0xf14eb4=a31_0xb52cfe,{options:_0x5a95c7,args:_0x5acf50,tdx:_0x48a049}=_0x5aa781,_0x5d69bf=_0x5acf50[0x0];if(!_0x5d69bf)return console[_0xf14eb4(0x1dd)](_0xf14eb4(0x1ee)),console['error'](_0xf14eb4(0x17e)),console[_0xf14eb4(0x1dd)](_0xf14eb4(0x1d1)),console['error'](_0xf14eb4(0x1b1)),console[_0xf14eb4(0x1dd)](_0xf14eb4(0x1c2)),console[_0xf14eb4(0x1dd)](_0xf14eb4(0x1fc)),console['error'](_0xf14eb4(0x181)),console['error'](_0xf14eb4(0x1ef)),console['error'](_0xf14eb4(0x190)),console['error'](_0xf14eb4(0x1ea)),0x1;try{const _0x519acb=_0x5a95c7['parentSegment'],_0x583d9f=await resolveSegmentTarget(_0x5d69bf,_0x519acb,_0x5a95c7[_0xf14eb4(0x20a)]);_0x5a95c7['verbose']&&console[_0xf14eb4(0x1dd)]('Target\x20path:\x20'+_0x583d9f);const _0x4de219=await withSpinner(_0xf14eb4(0x205)+_0x5d69bf+_0xf14eb4(0x1c7),()=>_0x48a049[_0xf14eb4(0x1a2)][_0xf14eb4(0x186)](_0x583d9f),{'verbose':_0x5a95c7[_0xf14eb4(0x20a)]}),_0x45d712=_0x4de219['data'];_0x5a95c7['verbose']&&(console[_0xf14eb4(0x1dd)](_0xf14eb4(0x203)+_0x45d712['type']),console[_0xf14eb4(0x1dd)](_0xf14eb4(0x1e5)+_0x45d712[_0xf14eb4(0x1fd)]),_0x45d712[_0xf14eb4(0x209)]&&console[_0xf14eb4(0x1dd)](_0xf14eb4(0x1a5)+_0x45d712[_0xf14eb4(0x209)]),_0x45d712[_0xf14eb4(0x19b)]&&console[_0xf14eb4(0x1dd)](_0xf14eb4(0x1ce)+_0x45d712[_0xf14eb4(0x19b)]));if(_0x5a95c7[_0xf14eb4(0x200)]){if(_0x45d712[_0xf14eb4(0x20f)]===_0xf14eb4(0x1c6))return console[_0xf14eb4(0x1dd)](_0xf14eb4(0x19a)),0x1;if(_0x45d712[_0xf14eb4(0x20f)]===_0xf14eb4(0x1e8))return console[_0xf14eb4(0x1dd)]('Error:\x20Cannot\x20open\x20parent\x20segment\x20with\x20this\x20command.'),console[_0xf14eb4(0x1dd)]('Use:\x20tdx\x20ps\x20view\x20-w'),0x1;if(!_0x45d712[_0xf14eb4(0x19b)])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0xc975a3=getConsoleNextUrl(_0x5a95c7[_0xf14eb4(0x1e0)],'/app/ps/'+_0x45d712[_0xf14eb4(0x1fd)]+_0xf14eb4(0x1a0)+_0x45d712[_0xf14eb4(0x19b)]);return console[_0xf14eb4(0x1dd)](a31_0x1bdaba[_0xf14eb4(0x19e)]('✔')+_0xf14eb4(0x204)+a31_0x1bdaba[_0xf14eb4(0x19c)](_0xc975a3)),openBrowser(_0xc975a3),0x0;}if(_0x45d712[_0xf14eb4(0x20f)]===_0xf14eb4(0x1c6)){if(!_0x45d712[_0xf14eb4(0x209)])throw new SDKError(ErrorCode['SEGMENT_FOLDER_NOT_FOUND'],_0xf14eb4(0x18d));const _0x1e3a3f=await withSpinner(_0xf14eb4(0x184),()=>_0x48a049['segment']['getFolder'](_0x45d712[_0xf14eb4(0x209)]),{'verbose':_0x5a95c7[_0xf14eb4(0x20a)]});await handleSingleObjectOutput(_0x1e3a3f['data'],_0x5a95c7);}else{if(_0x45d712['type']==='segment'){if(!_0x45d712[_0xf14eb4(0x19b)])throw new SDKError(ErrorCode[_0xf14eb4(0x197)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0xbe2559=await withSpinner('Fetching\x20segment\x20details...',()=>_0x48a049[_0xf14eb4(0x1a2)][_0xf14eb4(0x179)](_0x45d712[_0xf14eb4(0x1fd)],_0x45d712[_0xf14eb4(0x19b)]),{'verbose':_0x5a95c7['verbose']}),_0x4ca8b4=getConsoleNextUrl(_0x5a95c7[_0xf14eb4(0x1e0)],'/app/ps/'+_0x45d712[_0xf14eb4(0x1fd)]+_0xf14eb4(0x1a0)+_0x45d712[_0xf14eb4(0x19b)]),_0x5e229c=_0xbe2559[_0xf14eb4(0x1be)];_0x5e229c[_0xf14eb4(0x201)]=_0x4ca8b4,await handleSingleObjectOutput(_0x5e229c,_0x5a95c7);}else return console[_0xf14eb4(0x1dd)](_0xf14eb4(0x208)),console[_0xf14eb4(0x1dd)](_0xf14eb4(0x195)),0x1;}return 0x0;}catch(_0x4daa5a){if(_0x4daa5a instanceof SDKError)return console['error'](_0xf14eb4(0x1f3)+_0x4daa5a[_0xf14eb4(0x1bb)]),_0x4daa5a[_0xf14eb4(0x1f0)]&&console[_0xf14eb4(0x1dd)](_0xf14eb4(0x1ae)+_0x4daa5a[_0xf14eb4(0x1f0)]),0x1;throw _0x4daa5a;}}}export const SegmentInfoCommand=SegmentViewCommand;export class SegmentDescCommand extends BaseCommand{[a31_0xb52cfe(0x19d)]=a31_0xb52cfe(0x18e);[a31_0xb52cfe(0x1c3)]='Show\x20child\x20segment\x20schema\x20(column\x20types)';async[a31_0xb52cfe(0x1d4)](_0x413943){const _0x1ef01e=a31_0xb52cfe,{options:_0x58b150,args:_0x394749,tdx:_0x1ebf74}=_0x413943,_0x19aaaf=_0x394749[0x0];if(!_0x19aaaf)return console[_0x1ef01e(0x1dd)](_0x1ef01e(0x1ff)),console['error']('Usage:\x20tdx\x20sg\x20desc\x20<name>'),console['error'](_0x1ef01e(0x1c9)),console[_0x1ef01e(0x1dd)](_0x1ef01e(0x1fc)),console['error']('\x20\x20tdx\x20sg\x20desc\x20\x22Premium\x20Users\x22'),console[_0x1ef01e(0x1dd)](_0x1ef01e(0x193)),0x1;try{const _0x3850c4=_0x58b150[_0x1ef01e(0x191)],_0x339a87=await resolveSegmentTarget(_0x19aaaf,_0x3850c4,_0x58b150[_0x1ef01e(0x20a)]);_0x58b150[_0x1ef01e(0x20a)]&&console[_0x1ef01e(0x1dd)]('Target\x20path:\x20'+_0x339a87);const _0x2ac5c3=await withSpinner(_0x1ef01e(0x205)+_0x19aaaf+_0x1ef01e(0x1c7),()=>_0x1ebf74[_0x1ef01e(0x1a2)]['resolvePathToResource'](_0x339a87),{'verbose':_0x58b150[_0x1ef01e(0x20a)]}),_0x7fa5e2=_0x2ac5c3[_0x1ef01e(0x1be)];_0x58b150[_0x1ef01e(0x20a)]&&(console[_0x1ef01e(0x1dd)](_0x1ef01e(0x203)+_0x7fa5e2['type']),console[_0x1ef01e(0x1dd)](_0x1ef01e(0x1e5)+_0x7fa5e2[_0x1ef01e(0x1fd)]));if(_0x7fa5e2[_0x1ef01e(0x20f)]===_0x1ef01e(0x1c6))return console[_0x1ef01e(0x1dd)](_0x1ef01e(0x1d6)),console[_0x1ef01e(0x1dd)](_0x1ef01e(0x1cd)),0x1;if(_0x7fa5e2['type']==='parent')return console[_0x1ef01e(0x1dd)](_0x1ef01e(0x1b6)),console[_0x1ef01e(0x1dd)](_0x1ef01e(0x1a9)),0x1;if(!_0x7fa5e2[_0x1ef01e(0x19b)])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x1ef01e(0x198));const _0x518125=await withSpinner(_0x1ef01e(0x1d0),()=>_0x1ebf74['segment'][_0x1ef01e(0x196)](_0x7fa5e2[_0x1ef01e(0x1fd)],_0x7fa5e2['segmentId']),{'verbose':_0x58b150[_0x1ef01e(0x20a)]}),_0x2761a9=_0x518125[_0x1ef01e(0x1be)],_0x5ee7cc=await executeSchemaQuery(_0x2761a9,_0x1ebf74,_0x58b150);return await handleQueryOutput(_0x5ee7cc,_0x58b150),0x0;}catch(_0x56e77d){if(_0x56e77d instanceof SDKError)return console[_0x1ef01e(0x1dd)]('Error:\x20'+_0x56e77d[_0x1ef01e(0x1bb)]),_0x56e77d[_0x1ef01e(0x1f0)]&&console[_0x1ef01e(0x1dd)](_0x1ef01e(0x1ae)+_0x56e77d[_0x1ef01e(0x1f0)]),0x1;throw _0x56e77d;}}}
@@ -1 +1 @@
1
- const a32_0x5500ae=a32_0x559f;(function(_0x39d356,_0x1985af){const _0x4a5a26=a32_0x559f,_0x223ab3=_0x39d356();while(!![]){try{const _0x3be520=-parseInt(_0x4a5a26(0x137))/0x1*(-parseInt(_0x4a5a26(0x144))/0x2)+parseInt(_0x4a5a26(0x159))/0x3+parseInt(_0x4a5a26(0x15d))/0x4*(parseInt(_0x4a5a26(0x147))/0x5)+parseInt(_0x4a5a26(0x166))/0x6+parseInt(_0x4a5a26(0x164))/0x7+-parseInt(_0x4a5a26(0x141))/0x8+-parseInt(_0x4a5a26(0x136))/0x9;if(_0x3be520===_0x1985af)break;else _0x223ab3['push'](_0x223ab3['shift']());}catch(_0x5a3f78){_0x223ab3['push'](_0x223ab3['shift']());}}}(a32_0x9ff8,0x37356));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';function a32_0x559f(_0x3683e2,_0x307998){_0x3683e2=_0x3683e2-0x132;const _0x9ff8b1=a32_0x9ff8();let _0x559f05=_0x9ff8b1[_0x3683e2];return _0x559f05;}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 a32_0x9ff8(){const _0x25c3bb=['Segment\x20name:\x20','folder','segments','Target\x20path:\x20','segment','Site:\x20','1235205usMfNW','execute','createSegment','invisible','8HOXwNs','includes','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]','\x20\x20\x20Path:\x20','name','548730SDSNmk','length','2448552Lxzfnm','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27','Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.','Resolved\x20folder\x20ID:\x20','segmentPath','noCountPopulation','Resolving\x20folder\x20path\x20\x27','Parent:\x20','site','8189919tzPdlZ','19IGZIIZ','\x27\x20with\x20ID:\x20','Creating\x20segment\x20\x27','verbose','Resolved\x20relative\x20path\x20to:\x20','Parent\x20path:\x20','Create\x20child\x20segment\x20with\x20filtering\x20rules','error','ruleFile','Examples:','972776QaYulW','Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]','segment:create','33002vcHxFF','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','resolveParentId','114965ZdLVxR','\x27...','Resolving\x20parent\x20segment\x20\x27','type','data','resolveFolderId','rule','description','resolvePathToResource','yellow','kind','Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)'];a32_0x9ff8=function(){return _0x25c3bb;};return a32_0x9ff8();}import a32_0x12b6a1 from'chalk';export class SegmentCreateCommand extends BaseCommand{[a32_0x5500ae(0x163)]=a32_0x5500ae(0x143);['description']=a32_0x5500ae(0x13d);async[a32_0x5500ae(0x15a)](_0x3fc14d){const _0x7e2b58=a32_0x5500ae;console[_0x7e2b58(0x13e)](a32_0x12b6a1['yellow']('⚠\x20Deprecation\x20warning:\x20`segment\x20create`\x20is\x20deprecated.')),console[_0x7e2b58(0x13e)](a32_0x12b6a1[_0x7e2b58(0x150)](_0x7e2b58(0x15f)));const {options:_0x5395f4,args:_0x116685,tdx:_0x46cdc5}=_0x3fc14d,_0x244568=_0x5395f4;if(_0x116685['length']===0x0)return console[_0x7e2b58(0x13e)](_0x7e2b58(0x145)),console[_0x7e2b58(0x13e)](_0x7e2b58(0x142)),console[_0x7e2b58(0x13e)](_0x7e2b58(0x140)),console['error'](_0x7e2b58(0x167)),console[_0x7e2b58(0x13e)]('\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27'),console[_0x7e2b58(0x13e)](_0x7e2b58(0x160)),0x1;const _0x1f843f=_0x116685[0x0],_0x5802d9=_0x5395f4[_0x7e2b58(0x16a)];let _0x2625dc=_0x1f843f;_0x5802d9&&!_0x1f843f[_0x7e2b58(0x15e)]('/')&&(_0x2625dc=_0x5802d9+'/'+_0x1f843f,_0x244568[_0x7e2b58(0x13a)]&&console[_0x7e2b58(0x13e)](_0x7e2b58(0x13b)+_0x2625dc));const _0x1c8e98=parsePath(_0x2625dc);if(_0x1c8e98[_0x7e2b58(0x155)][_0x7e2b58(0x165)]<0x2)return console['error'](_0x7e2b58(0x152)),console['error'](_0x7e2b58(0x161)),0x1;const _0x179363=_0x1c8e98[_0x7e2b58(0x155)][0x0],_0x1b021e=getBaseName(_0x2625dc),_0xe8b803=getParentPath(_0x2625dc);_0x244568[_0x7e2b58(0x13a)]&&(console[_0x7e2b58(0x13e)](_0x7e2b58(0x158)+_0x244568[_0x7e2b58(0x135)]),console['error'](_0x7e2b58(0x156)+_0x2625dc),console[_0x7e2b58(0x13e)](_0x7e2b58(0x134)+_0x179363),console[_0x7e2b58(0x13e)](_0x7e2b58(0x153)+_0x1b021e),console['error'](_0x7e2b58(0x13c)+_0xe8b803));const _0x4bf3a0=await withSpinner(_0x7e2b58(0x149)+_0x179363+_0x7e2b58(0x148),()=>_0x46cdc5[_0x7e2b58(0x157)][_0x7e2b58(0x146)](_0x179363),{'verbose':_0x244568['verbose']}),_0x4d5e1d=_0x4bf3a0['data'];let _0x197a47;if(_0x1c8e98[_0x7e2b58(0x155)][_0x7e2b58(0x165)]>0x2){const _0x49d7be=await withSpinner(_0x7e2b58(0x133)+_0xe8b803+_0x7e2b58(0x148),()=>_0x46cdc5[_0x7e2b58(0x157)][_0x7e2b58(0x14f)](_0xe8b803),{'verbose':_0x244568[_0x7e2b58(0x13a)]}),_0x1fb175=_0x49d7be[_0x7e2b58(0x14b)];if(_0x1fb175[_0x7e2b58(0x14a)]!==_0x7e2b58(0x154)&&_0x1fb175['type']!=='parent')return console[_0x7e2b58(0x13e)](_0x7e2b58(0x168)),0x1;_0x197a47=_0x1fb175['folderId'];}else{if(_0x244568['folder']){const _0x354abf=await withSpinner('Resolving\x20folder\x20\x27'+_0x244568['folder']+_0x7e2b58(0x148),()=>_0x46cdc5[_0x7e2b58(0x157)][_0x7e2b58(0x14c)](_0x4d5e1d,_0x244568[_0x7e2b58(0x154)]),{'verbose':_0x244568[_0x7e2b58(0x13a)]});_0x197a47=_0x354abf[_0x7e2b58(0x14b)];}}_0x244568['verbose']&&_0x197a47&&console['error'](_0x7e2b58(0x169)+_0x197a47);const _0x4c16b8=await loadJSONFromOptions(_0x244568[_0x7e2b58(0x14d)],_0x244568[_0x7e2b58(0x13f)]),_0x45f77c={'name':_0x1b021e,'description':_0x244568[_0x7e2b58(0x14e)],'rule':_0x4c16b8,'kind':_0x244568[_0x7e2b58(0x151)]!==undefined?parseInt(_0x244568['kind'],0xa):undefined,'isVisible':_0x244568[_0x7e2b58(0x15c)]?![]:undefined,'segmentFolderId':_0x197a47,'countPopulation':_0x244568[_0x7e2b58(0x132)]?![]:undefined},_0x1ed9da=await withSpinner(_0x7e2b58(0x139)+_0x1b021e+_0x7e2b58(0x148),()=>_0x46cdc5['segment'][_0x7e2b58(0x15b)](_0x4d5e1d,_0x45f77c),{'verbose':_0x244568['verbose']}),_0x35989b=_0x1ed9da[_0x7e2b58(0x14b)];return console['error']('✔\x20Created\x20segment\x20\x27'+_0x35989b[_0x7e2b58(0x163)]+_0x7e2b58(0x138)+_0x35989b['id']),_0x2625dc!==_0x1f843f&&console[_0x7e2b58(0x13e)](_0x7e2b58(0x162)+_0x2625dc),await handleSDKOutput([_0x35989b],_0x244568),0x0;}}
1
+ const a32_0x1f0cd4=a32_0x2f3b;(function(_0x155285,_0x658c79){const _0xc25467=a32_0x2f3b,_0x3cfc89=_0x155285();while(!![]){try{const _0x3aed35=-parseInt(_0xc25467(0x1c7))/0x1*(-parseInt(_0xc25467(0x1cd))/0x2)+parseInt(_0xc25467(0x1c2))/0x3*(-parseInt(_0xc25467(0x1d6))/0x4)+parseInt(_0xc25467(0x1bd))/0x5+parseInt(_0xc25467(0x1dd))/0x6+-parseInt(_0xc25467(0x1d5))/0x7*(parseInt(_0xc25467(0x1b4))/0x8)+-parseInt(_0xc25467(0x1b2))/0x9+parseInt(_0xc25467(0x1ce))/0xa;if(_0x3aed35===_0x658c79)break;else _0x3cfc89['push'](_0x3cfc89['shift']());}catch(_0x20c85f){_0x3cfc89['push'](_0x3cfc89['shift']());}}}(a32_0x49ec,0x97985));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';function a32_0x49ec(){const _0x25eeb2=['12440320bIqRFV','resolveFolderId','⚠\x20Deprecation\x20warning:\x20`segment\x20create`\x20is\x20deprecated.','segmentPath','\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','data','Resolving\x20parent\x20segment\x20\x27','6790287BRsmsI','256324afbMXk','✔\x20Created\x20segment\x20\x27','Resolving\x20folder\x20\x27','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','Parent:\x20','\x27...','Site:\x20','7188342YWrXos','Segment\x20name:\x20','Target\x20path:\x20','segments','resolveParentId','yellow','Examples:','Resolved\x20folder\x20ID:\x20','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','9736398MxDHfa','execute','8LfeZAw','name','ruleFile','error','\x20\x20\x20Path:\x20','segment:create','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27','Creating\x20segment\x20\x27','Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)','2105220MhjCvu','site','folder','resolvePathToResource','folderId','30HRwbrd','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27','segment','invisible','verbose','450473VPFgjU','description','noCountPopulation','parent','length','includes','2QqsQSf'];a32_0x49ec=function(){return _0x25eeb2;};return a32_0x49ec();}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 a32_0xb62d0a from'chalk';function a32_0x2f3b(_0x375edf,_0x23e9d5){_0x375edf=_0x375edf-0x1b1;const _0x49ec72=a32_0x49ec();let _0x2f3b2=_0x49ec72[_0x375edf];return _0x2f3b2;}export class SegmentCreateCommand extends BaseCommand{[a32_0x1f0cd4(0x1b5)]=a32_0x1f0cd4(0x1b9);[a32_0x1f0cd4(0x1c8)]='Create\x20child\x20segment\x20with\x20filtering\x20rules';async[a32_0x1f0cd4(0x1b3)](_0x4ae6b4){const _0x33e807=a32_0x1f0cd4;console['error'](a32_0xb62d0a[_0x33e807(0x1e2)](_0x33e807(0x1d0))),console[_0x33e807(0x1b7)](a32_0xb62d0a[_0x33e807(0x1e2)](_0x33e807(0x1d9)));const {options:_0x333a6e,args:_0x1d0720,tdx:_0x3cd8e6}=_0x4ae6b4,_0x56ef64=_0x333a6e;if(_0x1d0720['length']===0x0)return console['error'](_0x33e807(0x1b1)),console[_0x33e807(0x1b7)]('Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]'),console['error'](_0x33e807(0x1e3)),console[_0x33e807(0x1b7)](_0x33e807(0x1ba)),console['error'](_0x33e807(0x1c3)),console[_0x33e807(0x1b7)](_0x33e807(0x1d2)),0x1;const _0x2a6c07=_0x1d0720[0x0],_0x36eedf=_0x333a6e[_0x33e807(0x1d1)];let _0x498d78=_0x2a6c07;_0x36eedf&&!_0x2a6c07[_0x33e807(0x1cc)]('/')&&(_0x498d78=_0x36eedf+'/'+_0x2a6c07,_0x56ef64[_0x33e807(0x1c6)]&&console[_0x33e807(0x1b7)]('Resolved\x20relative\x20path\x20to:\x20'+_0x498d78));const _0x27aa58=parsePath(_0x498d78);if(_0x27aa58['segments']['length']<0x2)return console[_0x33e807(0x1b7)](_0x33e807(0x1bc)),console[_0x33e807(0x1b7)]('Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]'),0x1;const _0x2b19b9=_0x27aa58[_0x33e807(0x1e0)][0x0],_0x2a5521=getBaseName(_0x498d78),_0x4eec86=getParentPath(_0x498d78);_0x56ef64['verbose']&&(console[_0x33e807(0x1b7)](_0x33e807(0x1dc)+_0x56ef64[_0x33e807(0x1be)]),console['error'](_0x33e807(0x1df)+_0x498d78),console['error'](_0x33e807(0x1da)+_0x2b19b9),console[_0x33e807(0x1b7)](_0x33e807(0x1de)+_0x2a5521),console[_0x33e807(0x1b7)]('Parent\x20path:\x20'+_0x4eec86));const _0x4a88f7=await withSpinner(_0x33e807(0x1d4)+_0x2b19b9+_0x33e807(0x1db),()=>_0x3cd8e6['segment'][_0x33e807(0x1e1)](_0x2b19b9),{'verbose':_0x56ef64[_0x33e807(0x1c6)]}),_0x2555b2=_0x4a88f7[_0x33e807(0x1d3)];let _0x475228;if(_0x27aa58[_0x33e807(0x1e0)][_0x33e807(0x1cb)]>0x2){const _0x55b6bc=await withSpinner('Resolving\x20folder\x20path\x20\x27'+_0x4eec86+'\x27...',()=>_0x3cd8e6['segment'][_0x33e807(0x1c0)](_0x4eec86),{'verbose':_0x56ef64['verbose']}),_0xed7755=_0x55b6bc[_0x33e807(0x1d3)];if(_0xed7755['type']!==_0x33e807(0x1bf)&&_0xed7755['type']!==_0x33e807(0x1ca))return console[_0x33e807(0x1b7)]('Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.'),0x1;_0x475228=_0xed7755[_0x33e807(0x1c1)];}else{if(_0x56ef64[_0x33e807(0x1bf)]){const _0x241d37=await withSpinner(_0x33e807(0x1d8)+_0x56ef64[_0x33e807(0x1bf)]+_0x33e807(0x1db),()=>_0x3cd8e6['segment'][_0x33e807(0x1cf)](_0x2555b2,_0x56ef64[_0x33e807(0x1bf)]),{'verbose':_0x56ef64[_0x33e807(0x1c6)]});_0x475228=_0x241d37['data'];}}_0x56ef64['verbose']&&_0x475228&&console['error'](_0x33e807(0x1e4)+_0x475228);const _0x2cc75b=await loadJSONFromOptions(_0x56ef64['rule'],_0x56ef64[_0x33e807(0x1b6)]),_0x1f6d46={'name':_0x2a5521,'description':_0x56ef64[_0x33e807(0x1c8)],'rule':_0x2cc75b,'kind':_0x56ef64['kind']!==undefined?parseInt(_0x56ef64['kind'],0xa):undefined,'isVisible':_0x56ef64[_0x33e807(0x1c5)]?![]:undefined,'segmentFolderId':_0x475228,'countPopulation':_0x56ef64[_0x33e807(0x1c9)]?![]:undefined},_0x46047c=await withSpinner(_0x33e807(0x1bb)+_0x2a5521+_0x33e807(0x1db),()=>_0x3cd8e6[_0x33e807(0x1c4)]['createSegment'](_0x2555b2,_0x1f6d46),{'verbose':_0x56ef64['verbose']}),_0x492d53=_0x46047c[_0x33e807(0x1d3)];return console[_0x33e807(0x1b7)](_0x33e807(0x1d7)+_0x492d53[_0x33e807(0x1b5)]+'\x27\x20with\x20ID:\x20'+_0x492d53['id']),_0x498d78!==_0x2a6c07&&console['error'](_0x33e807(0x1b8)+_0x498d78),await handleSDKOutput([_0x492d53],_0x56ef64),0x0;}}
@@ -1 +1 @@
1
- const a33_0x29de60=a33_0x4399;function a33_0x4399(_0x43ec01,_0x1d7d17){_0x43ec01=_0x43ec01-0xeb;const _0x16cbcf=a33_0x16cb();let _0x43995c=_0x16cbcf[_0x43ec01];return _0x43995c;}(function(_0x2fc7c2,_0x3d4a9c){const _0x270f1a=a33_0x4399,_0x52b864=_0x2fc7c2();while(!![]){try{const _0x3a0470=parseInt(_0x270f1a(0x109))/0x1*(parseInt(_0x270f1a(0xf4))/0x2)+-parseInt(_0x270f1a(0x103))/0x3+parseInt(_0x270f1a(0xfa))/0x4*(parseInt(_0x270f1a(0xeb))/0x5)+-parseInt(_0x270f1a(0xfd))/0x6+-parseInt(_0x270f1a(0x108))/0x7*(-parseInt(_0x270f1a(0xfc))/0x8)+parseInt(_0x270f1a(0xf7))/0x9*(parseInt(_0x270f1a(0xee))/0xa)+parseInt(_0x270f1a(0xed))/0xb*(-parseInt(_0x270f1a(0xf0))/0xc);if(_0x3a0470===_0x3d4a9c)break;else _0x52b864['push'](_0x52b864['shift']());}catch(_0x21ff5f){_0x52b864['push'](_0x52b864['shift']());}}}(a33_0x16cb,0xcf61b));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';function a33_0x16cb(){const _0x5dd349=['name','330246pdEuNE','✔\x20Found\x20','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','segment','site','27069DlgdbT','73AKGGeY','Parent\x20segment:\x20','2866715QilRTR','\x20field','592966CyjkZc','30KrMKAE','\x27...','240AGXEaj','List\x20available\x20fields\x20for\x20segmentation','error','description','43746MGRggV','verbose','Site:\x20','907227rZRrJB','listFields','Error:\x20Parent\x20segment\x20name\x20is\x20required','4vxSeQj','json','872mRJVyF','5138082QoKQua','Usage:\x20tdx\x20segment\x20fields\x20<parent_name>','segment:fields','length','parentSegment'];a33_0x16cb=function(){return _0x5dd349;};return a33_0x16cb();}import{displayFieldsHumanReadable}from'../sdk/segment/fields-display.js';export class SegmentFieldsCommand extends BaseCommand{[a33_0x29de60(0x102)]=a33_0x29de60(0xff);[a33_0x29de60(0xf3)]=a33_0x29de60(0xf1);async['execute'](_0x4cdee3){const _0x5065c4=a33_0x29de60,{options:_0x28262d,args:_0x24a586,tdx:_0x2f96a7}=_0x4cdee3,_0x4147f9=_0x24a586[0x0]||_0x28262d[_0x5065c4(0x101)];if(!_0x4147f9)return console[_0x5065c4(0xf2)](_0x5065c4(0xf9)),console[_0x5065c4(0xf2)](_0x5065c4(0xfe)),console[_0x5065c4(0xf2)](_0x5065c4(0x105)),0x1;_0x28262d[_0x5065c4(0xf5)]&&(console[_0x5065c4(0xf2)](_0x5065c4(0xf6)+_0x28262d[_0x5065c4(0x107)]),console[_0x5065c4(0xf2)](_0x5065c4(0x10a)+_0x4147f9));const _0x168085=await withSpinner('Listing\x20fields\x20for\x20\x27'+_0x4147f9+_0x5065c4(0xef),()=>_0x2f96a7[_0x5065c4(0x106)][_0x5065c4(0xf8)](_0x4147f9),{'verbose':_0x28262d[_0x5065c4(0xf5)]}),_0x4e4fe8=_0x168085['data'];console[_0x5065c4(0xf2)](_0x5065c4(0x104)+_0x4e4fe8['length']+_0x5065c4(0xec)+(_0x4e4fe8[_0x5065c4(0x100)]!==0x1?'s':''));if(_0x28262d[_0x5065c4(0xfb)]||_0x28262d['jsonl'])return await handleSDKOutput(_0x4e4fe8,_0x28262d),0x0;return displayFieldsHumanReadable(_0x4e4fe8,_0x4147f9),0x0;}}
1
+ const a33_0x372233=a33_0x556c;(function(_0x231d27,_0x4a425d){const _0x2e088e=a33_0x556c,_0x375b0f=_0x231d27();while(!![]){try{const _0x474d9c=parseInt(_0x2e088e(0x115))/0x1*(-parseInt(_0x2e088e(0x127))/0x2)+parseInt(_0x2e088e(0x126))/0x3+parseInt(_0x2e088e(0x123))/0x4+parseInt(_0x2e088e(0x112))/0x5+parseInt(_0x2e088e(0x116))/0x6+parseInt(_0x2e088e(0x118))/0x7+parseInt(_0x2e088e(0x111))/0x8*(-parseInt(_0x2e088e(0x121))/0x9);if(_0x474d9c===_0x4a425d)break;else _0x375b0f['push'](_0x375b0f['shift']());}catch(_0xad109e){_0x375b0f['push'](_0x375b0f['shift']());}}}(a33_0x25a0,0x3f4b0));function a33_0x25a0(){const _0xc9fe61=['description','parentSegment','verbose','site','8229177VlqBrg','Site:\x20','410052QWEKBG','jsonl','execute','97131rgCFoP','3154esGthJ','8OAXjYR','2471700udkhMT','data','name','7pfCEkl','2548068WekRSq','error','915124WPcJex','segment:fields','\x27...','Error:\x20Parent\x20segment\x20name\x20is\x20required','length'];a33_0x25a0=function(){return _0xc9fe61;};return a33_0x25a0();}import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';function a33_0x556c(_0x19bd13,_0x3cf98c){_0x19bd13=_0x19bd13-0x111;const _0x25a0bd=a33_0x25a0();let _0x556c22=_0x25a0bd[_0x19bd13];return _0x556c22;}import{withSpinner}from'../utils/spinner.js';import{displayFieldsHumanReadable}from'../sdk/segment/fields-display.js';export class SegmentFieldsCommand extends BaseCommand{[a33_0x372233(0x114)]=a33_0x372233(0x119);[a33_0x372233(0x11d)]='List\x20available\x20fields\x20for\x20segmentation';async[a33_0x372233(0x125)](_0x2959ff){const _0x4752c6=a33_0x372233,{options:_0x2cb836,args:_0x2c0ebe,tdx:_0x1ab7e9}=_0x2959ff,_0x437aeb=_0x2c0ebe[0x0]||_0x2cb836[_0x4752c6(0x11e)];if(!_0x437aeb)return console[_0x4752c6(0x117)](_0x4752c6(0x11b)),console[_0x4752c6(0x117)]('Usage:\x20tdx\x20segment\x20fields\x20<parent_name>'),console[_0x4752c6(0x117)]('\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>'),0x1;_0x2cb836[_0x4752c6(0x11f)]&&(console['error'](_0x4752c6(0x122)+_0x2cb836[_0x4752c6(0x120)]),console[_0x4752c6(0x117)]('Parent\x20segment:\x20'+_0x437aeb));const _0x3e2f99=await withSpinner('Listing\x20fields\x20for\x20\x27'+_0x437aeb+_0x4752c6(0x11a),()=>_0x1ab7e9['segment']['listFields'](_0x437aeb),{'verbose':_0x2cb836[_0x4752c6(0x11f)]}),_0x180207=_0x3e2f99[_0x4752c6(0x113)];console[_0x4752c6(0x117)]('✔\x20Found\x20'+_0x180207[_0x4752c6(0x11c)]+'\x20field'+(_0x180207[_0x4752c6(0x11c)]!==0x1?'s':''));if(_0x2cb836['json']||_0x2cb836[_0x4752c6(0x124)])return await handleSDKOutput(_0x180207,_0x2cb836),0x0;return displayFieldsHumanReadable(_0x180207,_0x437aeb),0x0;}}
@@ -1 +1 @@
1
- function a34_0xfa9b(_0x29164f,_0xc458e0){_0x29164f=_0x29164f-0x87;const _0x4035ba=a34_0x4035();let _0xfa9bd4=_0x4035ba[_0x29164f];return _0xfa9bd4;}const a34_0x271f4b=a34_0xfa9b;(function(_0x50edba,_0x14aaf8){const _0x296a32=a34_0xfa9b,_0x5a267f=_0x50edba();while(!![]){try{const _0x2617eb=parseInt(_0x296a32(0xc4))/0x1*(parseInt(_0x296a32(0xbd))/0x2)+-parseInt(_0x296a32(0x8e))/0x3*(parseInt(_0x296a32(0xcd))/0x4)+parseInt(_0x296a32(0x94))/0x5*(-parseInt(_0x296a32(0x8f))/0x6)+parseInt(_0x296a32(0xb1))/0x7+parseInt(_0x296a32(0xba))/0x8+parseInt(_0x296a32(0x9e))/0x9*(-parseInt(_0x296a32(0xa2))/0xa)+-parseInt(_0x296a32(0x9a))/0xb*(parseInt(_0x296a32(0xc5))/0xc);if(_0x2617eb===_0x14aaf8)break;else _0x5a267f['push'](_0x5a267f['shift']());}catch(_0x46785a){_0x5a267f['push'](_0x5a267f['shift']());}}}(a34_0x4035,0xb79cd));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 a34_0x4156fe from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';import a34_0x255e03 from'path';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';export{buildFolderIdToPathMap as buildFolderPathMap}from'../sdk/segment/resolution-context.js';function a34_0x4035(){const _0x401f1a=['\x20journeys','3jhRdft','222GDfSSY','repeat','segments','Aborted.','hasChanges','91405aNVFNk','\x20\x20🗺️\x20\x20','no_parent','file','parentSegment','content','4041961EIBMyN','dim','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)','\x20\x20🎯\x20','2127519imvUYb','length','errorCode','Pulling\x20segments\x20from\x20\x27','20ToNAqX','red','Write\x20','\x20files?','diff','journeys','parentName','\x0aError:','\x20versions)','Parent\x20segment:\x20','green','error','utf-8','✔\x20Pulled\x20','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','2998373WRYmPo','yes','\x20files\x20to\x20','-\x20no\x20files\x20written','absolutePath','resourceName','pullSegments','segment','Target\x20resource:\x20','7590144uUBAcE','data','yellow','2483982pnalfi','site','session','\x20unchanged\x20files','parent_segment','cyan','isNew','1RyXNlj','12xAEjmT','files','dirname','targetDir','journeyVersions','message','\x20=\x20','execute','1401564dqWgpA','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','counts','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','segment:pull','verbose','Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files','helpText','relativePath','✔\x20Context\x20set:\x20','description','activations','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent','name'];a34_0x4035=function(){return _0x401f1a;};return a34_0x4035();}export class SegmentPullCommand extends BaseCommand{[a34_0x271f4b(0x8c)]=a34_0x271f4b(0xd1);[a34_0x271f4b(0x89)]=a34_0x271f4b(0xd3);async[a34_0x271f4b(0xcc)](_0x16884d){const _0x5367d1=a34_0x271f4b,{options:_0x4c93e5,args:_0x25ef2a,tdx:_0x49d2ea}=_0x16884d,_0x485e35=_0x4c93e5,_0x26826b=await resolveTarget({'arg':_0x25ef2a[0x0],'contextParent':_0x4c93e5[_0x5367d1(0x98)],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x26826b))return _0x26826b[_0x5367d1(0xa0)]===_0x5367d1(0x96)?(console[_0x5367d1(0xad)](a34_0x4156fe[_0x5367d1(0xbc)](_0x5367d1(0xb0))),console[_0x5367d1(0xad)](_0x5367d1(0x9c)),console['error'](_0x5367d1(0x8b)),console[_0x5367d1(0xad)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file')):(console[_0x5367d1(0xad)](a34_0x4156fe[_0x5367d1(0xa3)]('Error:\x20'+_0x26826b[_0x5367d1(0xca)]+'\x0a')),_0x26826b[_0x5367d1(0xd4)]&&console[_0x5367d1(0xad)](a34_0x4156fe[_0x5367d1(0xc2)](_0x26826b[_0x5367d1(0xd4)]))),0x1;const _0x4ada8a=_0x26826b[_0x5367d1(0xa8)],_0x447d83=_0x26826b[_0x5367d1(0xc8)],_0x225d63=_0x26826b['type']===_0x5367d1(0x97)?_0x26826b[_0x5367d1(0xb6)]:undefined;_0x485e35[_0x5367d1(0xd2)]&&(console[_0x5367d1(0xad)]('Site:\x20'+_0x485e35[_0x5367d1(0xbe)]),console['error'](_0x5367d1(0xab)+_0x4ada8a),_0x225d63&&console['error'](_0x5367d1(0xb9)+_0x225d63));const _0x4614f7=await withProgressSpinner(_0x5367d1(0xa1)+_0x4ada8a+'\x27...',_0xb3e06=>_0x49d2ea[_0x5367d1(0xb8)][_0x5367d1(0xb7)](_0x4ada8a,{'targetDir':_0x447d83,'targetResourceName':_0x225d63,'verbose':_0x485e35[_0x5367d1(0xd2)],'progress':{'update':_0x4648bc=>{_0xb3e06['setPhase'](_0x4648bc),_0x485e35['verbose']&&console['error']('\x20\x20'+_0x4648bc);}}}),{'verbose':_0x485e35['verbose']}),_0x2494aa=_0x4614f7[_0x5367d1(0xbb)];if(_0x2494aa[_0x5367d1(0xcf)][_0x5367d1(0x91)]===0x0&&_0x2494aa['counts'][_0x5367d1(0xa7)]===0x0)return console[_0x5367d1(0xad)](a34_0x4156fe[_0x5367d1(0xbc)]('No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27'+_0x2494aa[_0x5367d1(0xa8)]+'\x27')),0x0;const _0x1306c7=_0x2494aa[_0x5367d1(0xc6)]['filter'](_0x1deaef=>_0x1deaef[_0x5367d1(0xc3)]),_0xc89716=_0x2494aa[_0x5367d1(0xc6)]['filter'](_0x382320=>!_0x382320[_0x5367d1(0xc3)]&&_0x382320['hasChanges']),_0x49f10b=_0x2494aa[_0x5367d1(0xc6)]['filter'](_0x155728=>!_0x155728[_0x5367d1(0xc3)]&&!_0x155728['hasChanges']);console['error']('\x0aPull\x20summary\x20for\x20\x27'+_0x2494aa[_0x5367d1(0xa8)]+'\x27:'),console['error'](_0x5367d1(0x9d)+a34_0x4156fe['cyan'](_0x2494aa['counts'][_0x5367d1(0x91)]+'\x20segments')+'\x20with\x20'+a34_0x4156fe[_0x5367d1(0xc2)](_0x2494aa[_0x5367d1(0xcf)][_0x5367d1(0x8a)]+'\x20activations'));if(_0x2494aa[_0x5367d1(0xcf)]['journeys']>0x0){const _0x1651c8=_0x2494aa[_0x5367d1(0xcf)][_0x5367d1(0xc9)]>_0x2494aa[_0x5367d1(0xcf)]['journeys']?'\x20('+_0x2494aa[_0x5367d1(0xcf)][_0x5367d1(0xc9)]+_0x5367d1(0xaa):'';console[_0x5367d1(0xad)](_0x5367d1(0x95)+a34_0x4156fe[_0x5367d1(0xc2)](_0x2494aa[_0x5367d1(0xcf)][_0x5367d1(0xa7)]+_0x5367d1(0x8d))+a34_0x4156fe[_0x5367d1(0x9b)](_0x1651c8));}console[_0x5367d1(0xad)]('\x20\x20'+a34_0x4156fe[_0x5367d1(0xac)]('+\x20'+_0x1306c7[_0x5367d1(0x9f)]+'\x20new\x20files')),console[_0x5367d1(0xad)]('\x20\x20'+a34_0x4156fe[_0x5367d1(0xbc)]('~\x20'+_0xc89716[_0x5367d1(0x9f)]+'\x20changed\x20files')),console['error']('\x20\x20'+a34_0x4156fe[_0x5367d1(0x9b)]('=\x20'+_0x49f10b[_0x5367d1(0x9f)]+_0x5367d1(0xc0))),console[_0x5367d1(0xad)]('\x20\x20Target:\x20'+a34_0x4156fe['cyan'](_0x2494aa[_0x5367d1(0xc8)])+'\x0a');if(_0xc89716['length']>0x0)for(const _0x44d92c of _0xc89716){console['error']('\x0aChanges\x20to\x20\x27'+_0x44d92c[_0x5367d1(0x87)]+'\x27:'),console[_0x5367d1(0xad)]('─'[_0x5367d1(0x90)](0x3c)),console['error'](_0x44d92c[_0x5367d1(0xa6)]),console[_0x5367d1(0xad)]('─'[_0x5367d1(0x90)](0x3c));}if(_0x485e35['dryRun'])return console['error'](a34_0x4156fe[_0x5367d1(0xbc)]('\x0a[Dry\x20run]\x20No\x20files\x20were\x20written')),0x0;if(_0x1306c7['length']===0x0&&_0xc89716[_0x5367d1(0x9f)]===0x0)return console['error'](a34_0x4156fe[_0x5367d1(0xac)]('✔\x20All\x20files\x20are\x20up\x20to\x20date')),saveSessionContext({'parent_segment':_0x2494aa['parentName']},_0x485e35[_0x5367d1(0xbf)]),console[_0x5367d1(0xad)](a34_0x4156fe['green']('✔\x20Context\x20set:\x20'+a34_0x4156fe[_0x5367d1(0x9b)](_0x5367d1(0xc1))+_0x5367d1(0xcb)+a34_0x4156fe['cyan'](_0x2494aa[_0x5367d1(0xa8)]))),0x0;if(!_0x485e35[_0x5367d1(0xb2)]){if(!isInteractive())return console[_0x5367d1(0xad)](a34_0x4156fe[_0x5367d1(0xa3)](_0x5367d1(0xa9)),_0x5367d1(0xd0)),console[_0x5367d1(0xad)](a34_0x4156fe[_0x5367d1(0x9b)](_0x5367d1(0xce))),0x1;const _0x1b369e=await confirmKey(_0x5367d1(0xa4)+(_0x1306c7[_0x5367d1(0x9f)]+_0xc89716[_0x5367d1(0x9f)])+_0x5367d1(0xa5));if(!_0x1b369e)return console[_0x5367d1(0xad)](a34_0x4156fe[_0x5367d1(0xbc)](_0x5367d1(0x92)),_0x5367d1(0xb4)),0x1;}for(const _0x1ca170 of _0x2494aa[_0x5367d1(0xc6)]){if(_0x1ca170[_0x5367d1(0xc3)]||_0x1ca170[_0x5367d1(0x93)]){const _0x4017c8=a34_0x255e03[_0x5367d1(0xc7)](_0x1ca170[_0x5367d1(0xb5)]);!existsSync(_0x4017c8)&&mkdirSync(_0x4017c8,{'recursive':!![]}),writeFileSync(_0x1ca170['absolutePath'],_0x1ca170[_0x5367d1(0x99)],_0x5367d1(0xae));}}return console[_0x5367d1(0xad)](a34_0x4156fe[_0x5367d1(0xac)](_0x5367d1(0xaf)+(_0x1306c7['length']+_0xc89716[_0x5367d1(0x9f)])+_0x5367d1(0xb3)+_0x2494aa[_0x5367d1(0xc8)])),saveSessionContext({'parent_segment':_0x2494aa[_0x5367d1(0xa8)]},_0x485e35['session']),console[_0x5367d1(0xad)](a34_0x4156fe[_0x5367d1(0xac)](_0x5367d1(0x88)+a34_0x4156fe[_0x5367d1(0x9b)](_0x5367d1(0xc1))+_0x5367d1(0xcb)+a34_0x4156fe[_0x5367d1(0xc2)](_0x2494aa['parentName']))),0x0;}}
1
+ const a34_0x305353=a34_0x7613;(function(_0x49084a,_0x567b78){const _0x26701d=a34_0x7613,_0x24f30b=_0x49084a();while(!![]){try{const _0x408bd6=parseInt(_0x26701d(0x224))/0x1*(parseInt(_0x26701d(0x216))/0x2)+-parseInt(_0x26701d(0x1fc))/0x3*(-parseInt(_0x26701d(0x21c))/0x4)+parseInt(_0x26701d(0x212))/0x5+-parseInt(_0x26701d(0x219))/0x6*(parseInt(_0x26701d(0x235))/0x7)+parseInt(_0x26701d(0x225))/0x8*(-parseInt(_0x26701d(0x204))/0x9)+-parseInt(_0x26701d(0x228))/0xa*(-parseInt(_0x26701d(0x20c))/0xb)+-parseInt(_0x26701d(0x1ee))/0xc;if(_0x408bd6===_0x567b78)break;else _0x24f30b['push'](_0x24f30b['shift']());}catch(_0x4b470c){_0x24f30b['push'](_0x24f30b['shift']());}}}(a34_0x4297,0x5bdb4));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';function a34_0x4297(){const _0x230193=['\x20versions)','content','segment:pull','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file','\x20files?','10661fLHbxw','Error:\x20','diff','site','cyan','yes','journeyVersions','Parent\x20segment:\x20','Usage:\x20tdx\x20sg\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20(requires\x20context\x20or\x20tdx.json)','\x20files\x20to\x20','resourceName','\x20changed\x20files','10187220zNJRcR','repeat','Pulling\x20segments\x20from\x20\x27','segments','Site:\x20','✔\x20All\x20files\x20are\x20up\x20to\x20date','length','pullSegments','counts','segment','name','parentSegment','absolutePath','isNew','141FINMnE','\x20\x20🎯\x20','\x20journeys','\x0aChanges\x20to\x20\x27','red','green','cwd','\x20\x20Target:\x20','1054386RCtGUw','description','files','\x20\x20🗺️\x20\x20','targetDir','✔\x20Context\x20set:\x20','yellow','dryRun','2642299ytsXuz','error','\x20new\x20files','\x20=\x20','Write\x20','✔\x20Pulled\x20','3280055QkFAyN','Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files','\x20unchanged\x20files','\x20activations','715110SIqztN','errorCode','helpText','1758CZFrRM','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','verbose','4628XvFEqV','dirname','parentName','\x0aError:','hasChanges','session','dim','journeys','1LfXnpV','8lTQrks','no_parent','execute','30TKqYWr','\x20segments','filter','activations','parent_segment','-\x20no\x20files\x20written','data','type'];a34_0x4297=function(){return _0x230193;};return a34_0x4297();}import{confirmKey,isInteractive}from'../utils/prompt.js';import{saveSessionContext}from'../core/session.js';import a34_0x2f97ed from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';function a34_0x7613(_0x5ee030,_0x84b9c4){_0x5ee030=_0x5ee030-0x1e5;const _0x429796=a34_0x4297();let _0x76138e=_0x429796[_0x5ee030];return _0x76138e;}import a34_0x32567b from'path';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';export{buildFolderIdToPathMap as buildFolderPathMap}from'../sdk/segment/resolution-context.js';export class SegmentPullCommand extends BaseCommand{[a34_0x305353(0x1f8)]=a34_0x305353(0x232);[a34_0x305353(0x205)]=a34_0x305353(0x213);async[a34_0x305353(0x227)](_0x3cde7f){const _0x516b74=a34_0x305353,{options:_0x3a1934,args:_0x19c680,tdx:_0x3b9716}=_0x3cde7f,_0xa7d773=_0x3a1934,_0x52a942=await resolveTarget({'arg':_0x19c680[0x0],'contextParent':_0x3a1934[_0x516b74(0x1f9)],'cwd':process[_0x516b74(0x202)]()});if(!isSuccessfulResolution(_0x52a942))return _0x52a942[_0x516b74(0x217)]===_0x516b74(0x226)?(console[_0x516b74(0x20d)](a34_0x2f97ed[_0x516b74(0x20a)]('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console[_0x516b74(0x20d)](_0x516b74(0x1ea)),console[_0x516b74(0x20d)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent'),console[_0x516b74(0x20d)](_0x516b74(0x233))):(console['error'](a34_0x2f97ed['red'](_0x516b74(0x236)+_0x52a942['message']+'\x0a')),_0x52a942[_0x516b74(0x218)]&&console[_0x516b74(0x20d)](a34_0x2f97ed[_0x516b74(0x1e6)](_0x52a942['helpText']))),0x1;const _0x16f3e6=_0x52a942[_0x516b74(0x21e)],_0x1c16e8=_0x52a942['targetDir'],_0x20a83c=_0x52a942[_0x516b74(0x22f)]==='file'?_0x52a942[_0x516b74(0x1ec)]:undefined;_0xa7d773[_0x516b74(0x21b)]&&(console[_0x516b74(0x20d)](_0x516b74(0x1f2)+_0xa7d773[_0x516b74(0x1e5)]),console[_0x516b74(0x20d)](_0x516b74(0x1e9)+_0x16f3e6),_0x20a83c&&console['error']('Target\x20resource:\x20'+_0x20a83c));const _0x567c9f=await withProgressSpinner(_0x516b74(0x1f0)+_0x16f3e6+'\x27...',_0x1e483d=>_0x3b9716[_0x516b74(0x1f7)][_0x516b74(0x1f5)](_0x16f3e6,{'targetDir':_0x1c16e8,'targetResourceName':_0x20a83c,'verbose':_0xa7d773[_0x516b74(0x21b)],'progress':{'update':_0x57f4be=>{const _0x1ddb16=_0x516b74;_0x1e483d['setPhase'](_0x57f4be),_0xa7d773['verbose']&&console[_0x1ddb16(0x20d)]('\x20\x20'+_0x57f4be);}}}),{'verbose':_0xa7d773[_0x516b74(0x21b)]}),_0x3aeaea=_0x567c9f[_0x516b74(0x22e)];if(_0x3aeaea[_0x516b74(0x1f6)][_0x516b74(0x1f1)]===0x0&&_0x3aeaea[_0x516b74(0x1f6)][_0x516b74(0x223)]===0x0)return console['error'](a34_0x2f97ed[_0x516b74(0x20a)]('No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27'+_0x3aeaea[_0x516b74(0x21e)]+'\x27')),0x0;const _0xb8b980=_0x3aeaea[_0x516b74(0x206)]['filter'](_0x53b7ff=>_0x53b7ff['isNew']),_0x755938=_0x3aeaea[_0x516b74(0x206)][_0x516b74(0x22a)](_0x3aaf53=>!_0x3aaf53[_0x516b74(0x1fb)]&&_0x3aaf53[_0x516b74(0x220)]),_0x1b6bfb=_0x3aeaea[_0x516b74(0x206)][_0x516b74(0x22a)](_0x25adb1=>!_0x25adb1[_0x516b74(0x1fb)]&&!_0x25adb1[_0x516b74(0x220)]);console[_0x516b74(0x20d)]('\x0aPull\x20summary\x20for\x20\x27'+_0x3aeaea[_0x516b74(0x21e)]+'\x27:'),console[_0x516b74(0x20d)](_0x516b74(0x1fd)+a34_0x2f97ed[_0x516b74(0x1e6)](_0x3aeaea[_0x516b74(0x1f6)][_0x516b74(0x1f1)]+_0x516b74(0x229))+'\x20with\x20'+a34_0x2f97ed[_0x516b74(0x1e6)](_0x3aeaea[_0x516b74(0x1f6)][_0x516b74(0x22b)]+_0x516b74(0x215)));if(_0x3aeaea['counts']['journeys']>0x0){const _0x315488=_0x3aeaea[_0x516b74(0x1f6)][_0x516b74(0x1e8)]>_0x3aeaea[_0x516b74(0x1f6)][_0x516b74(0x223)]?'\x20('+_0x3aeaea[_0x516b74(0x1f6)][_0x516b74(0x1e8)]+_0x516b74(0x230):'';console[_0x516b74(0x20d)](_0x516b74(0x207)+a34_0x2f97ed[_0x516b74(0x1e6)](_0x3aeaea[_0x516b74(0x1f6)]['journeys']+_0x516b74(0x1fe))+a34_0x2f97ed[_0x516b74(0x222)](_0x315488));}console[_0x516b74(0x20d)]('\x20\x20'+a34_0x2f97ed['green']('+\x20'+_0xb8b980[_0x516b74(0x1f4)]+_0x516b74(0x20e))),console[_0x516b74(0x20d)]('\x20\x20'+a34_0x2f97ed['yellow']('~\x20'+_0x755938[_0x516b74(0x1f4)]+_0x516b74(0x1ed))),console[_0x516b74(0x20d)]('\x20\x20'+a34_0x2f97ed[_0x516b74(0x222)]('=\x20'+_0x1b6bfb['length']+_0x516b74(0x214))),console[_0x516b74(0x20d)](_0x516b74(0x203)+a34_0x2f97ed['cyan'](_0x3aeaea[_0x516b74(0x208)])+'\x0a');if(_0x755938[_0x516b74(0x1f4)]>0x0)for(const _0x5c4c31 of _0x755938){console[_0x516b74(0x20d)](_0x516b74(0x1ff)+_0x5c4c31['relativePath']+'\x27:'),console[_0x516b74(0x20d)]('─'[_0x516b74(0x1ef)](0x3c)),console[_0x516b74(0x20d)](_0x5c4c31[_0x516b74(0x237)]),console['error']('─'[_0x516b74(0x1ef)](0x3c));}if(_0xa7d773[_0x516b74(0x20b)])return console[_0x516b74(0x20d)](a34_0x2f97ed[_0x516b74(0x20a)]('\x0a[Dry\x20run]\x20No\x20files\x20were\x20written')),0x0;if(_0xb8b980['length']===0x0&&_0x755938[_0x516b74(0x1f4)]===0x0)return console[_0x516b74(0x20d)](a34_0x2f97ed[_0x516b74(0x201)](_0x516b74(0x1f3))),saveSessionContext({'parent_segment':_0x3aeaea['parentName']},_0xa7d773[_0x516b74(0x221)]),console['error'](a34_0x2f97ed[_0x516b74(0x201)]('✔\x20Context\x20set:\x20'+a34_0x2f97ed[_0x516b74(0x222)]('parent_segment')+_0x516b74(0x20f)+a34_0x2f97ed[_0x516b74(0x1e6)](_0x3aeaea[_0x516b74(0x21e)]))),0x0;if(!_0xa7d773[_0x516b74(0x1e7)]){if(!isInteractive())return console['error'](a34_0x2f97ed[_0x516b74(0x200)](_0x516b74(0x21f)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x516b74(0x20d)](a34_0x2f97ed[_0x516b74(0x222)](_0x516b74(0x21a))),0x1;const _0x5c30c0=await confirmKey(_0x516b74(0x210)+(_0xb8b980['length']+_0x755938['length'])+_0x516b74(0x234));if(!_0x5c30c0)return console[_0x516b74(0x20d)](a34_0x2f97ed[_0x516b74(0x20a)]('Aborted.'),_0x516b74(0x22d)),0x1;}for(const _0x5719cf of _0x3aeaea[_0x516b74(0x206)]){if(_0x5719cf[_0x516b74(0x1fb)]||_0x5719cf[_0x516b74(0x220)]){const _0x9878f2=a34_0x32567b[_0x516b74(0x21d)](_0x5719cf[_0x516b74(0x1fa)]);!existsSync(_0x9878f2)&&mkdirSync(_0x9878f2,{'recursive':!![]}),writeFileSync(_0x5719cf[_0x516b74(0x1fa)],_0x5719cf[_0x516b74(0x231)],'utf-8');}}return console[_0x516b74(0x20d)](a34_0x2f97ed[_0x516b74(0x201)](_0x516b74(0x211)+(_0xb8b980[_0x516b74(0x1f4)]+_0x755938[_0x516b74(0x1f4)])+_0x516b74(0x1eb)+_0x3aeaea['targetDir'])),saveSessionContext({'parent_segment':_0x3aeaea[_0x516b74(0x21e)]},_0xa7d773['session']),console[_0x516b74(0x20d)](a34_0x2f97ed[_0x516b74(0x201)](_0x516b74(0x209)+a34_0x2f97ed[_0x516b74(0x222)](_0x516b74(0x22c))+_0x516b74(0x20f)+a34_0x2f97ed[_0x516b74(0x1e6)](_0x3aeaea[_0x516b74(0x21e)]))),0x0;}}
@@ -1 +1 @@
1
- function a35_0xa010(){const _0x140b71=['toUpdate','Fetching\x20connections\x20for\x20name\x20resolution...','journeyBundleId','add','Error:\x20Directory\x20not\x20found:\x20','journeyId','19645080NDydHo','folderPath','resolveParentId','file','name','error','state','execute','nameToType','connection','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','listActivations','updatedAt','/j/da/je','listJourneysWithDetailsFromParentSegment','segment\x20or\x20journey','errorCode','\x20changed','unchanged','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)','length','Parent\x20segment:\x20','Site:\x20','\x20to\x20delete','created','push','\x20unchanged','Source\x20directory:\x20','green','Error:\x20','journeys','getOutputSchemaWithCache','98885LuZFst','createdAt','\x20updated','.yaml','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','dim','user','746774CxlAYU','idToName','isNew','yes','folderId','new','segment','segments','\x20changes?','Changes\x20to\x20journey:','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','\x20new','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file','no_parent','4311UOSyjG','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','Delete\x20journey:','journeysOnly','getJourney','Error\x20parsing\x20YAML:\x20','segment:push','endsWith','relationships','diff','\x20activations]','/app/ps/','No\x20','\x20to\x20create','\x27...','parentFolder','get','getParent','Scoped\x20to\x20folder:\x20','yamlConfig','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','delete','repeat','Fetching\x20existing\x20activations...','audienceId','existingJourney','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','8376aKmjzk','New\x20segment:','✔\x20All\x20journeys\x20are\x20up\x20to\x20date','83484qsaNDz','cyan','\x20YAML\x20files\x20found','filePath','Folders\x20to\x20create:','setPhase','helpText','6173245BTeqov','\x20folders\x20to\x20create','\x20created','description','yellow','\x0a✔\x20Push\x20complete','toDelete','updated','createdSegmentIds','journey','\x20\x20Activations:','message','parentSegment','New\x20journey:','\x0aValidation\x20failed:','attributes','54iGdegW','(Journey\x20will\x20be\x20deleted)','/e/','blue','verbose','join','changed','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','results','\x0aError:','segmentFolderId','activations','type','\x20\x20\x20\x20','Changes\x20to:','site','Preparing\x20journeys...','2NwpDtm','\x20to\x20update','filter','journeyBundleName','parent_name','4700308YJHetQ','📁\x20','then','toCreate','\x20\x20Activations:\x20','buildUserMaps','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','set','data','nameToId','\x20\x20Journeys:\x20','red','map','Resolving\x20parent\x20segment\x20\x27','\x20deleted','\x20\x20Source:\x20','targetDir','Fetching\x20existing\x20data...'];a35_0xa010=function(){return _0x140b71;};return a35_0xa010();}const a35_0x4a630e=a35_0x357a;function a35_0x357a(_0x5ed56d,_0x333616){_0x5ed56d=_0x5ed56d-0x14f;const _0xa0103b=a35_0xa010();let _0x357a24=_0xa0103b[_0x5ed56d];return _0x357a24;}(function(_0x1496e4,_0x1d85ec){const _0x5db1f6=a35_0x357a,_0x1df841=_0x1496e4();while(!![]){try{const _0x328154=parseInt(_0x5db1f6(0x196))/0x1*(-parseInt(_0x5db1f6(0x159))/0x2)+-parseInt(_0x5db1f6(0x1c9))/0x3+parseInt(_0x5db1f6(0x15e))/0x4+parseInt(_0x5db1f6(0x1d0))/0x5+-parseInt(_0x5db1f6(0x1e0))/0x6*(-parseInt(_0x5db1f6(0x19d))/0x7)+-parseInt(_0x5db1f6(0x1c6))/0x8*(parseInt(_0x5db1f6(0x1ab))/0x9)+-parseInt(_0x5db1f6(0x176))/0xa;if(_0x328154===_0x1d85ec)break;else _0x1df841['push'](_0x1df841['shift']());}catch(_0x579d14){_0x1df841['push'](_0x1df841['shift']());}}}(a35_0xa010,0xbdbaa));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 a35_0x4b8a26 from'chalk';import{existsSync}from'fs';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{resolveTarget,isSuccessfulResolution,getScopedDetails}from'../sdk/segment/target-resolution.js';import{buildFolderMaps}from'../sdk/segment/resolution-context.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{resolveTDFolderPath,findSegmentsToDelete,findJourneysToDelete,buildSegmentLookupMap,buildSegmentNameToIdMap,buildJourneyBundleLookupMap,parseAndClassifyYamlFiles,validateParsedFiles,formatValidationErrors,extractRootFolderId,buildConnectionMaps,calculatePushStats,prepareSegmentFiles,prepareJourneyFiles,executePushSegments,executePushFolders,executePushSegmentDeletions,executePushJourneys}from'../sdk/segment/push-workflow.js';export class SegmentPushCommand extends BaseCommand{[a35_0x4a630e(0x17a)]=a35_0x4a630e(0x1b1);[a35_0x4a630e(0x1d3)]=a35_0x4a630e(0x164);async[a35_0x4a630e(0x17d)](_0x24e702){const _0x38524a=a35_0x4a630e,{options:_0x53ce84,args:_0xf7cb6b,tdx:_0x11c9ed}=_0x24e702,_0x126553=_0x53ce84,_0x1f8776=await resolveTarget({'arg':_0xf7cb6b[0x0],'contextParent':_0x53ce84[_0x38524a(0x1dc)],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x1f8776))return _0x1f8776[_0x38524a(0x186)]===_0x38524a(0x1aa)?(console[_0x38524a(0x17b)](a35_0x4b8a26[_0x38524a(0x1d4)](_0x38524a(0x1ac))),console['error'](_0x38524a(0x189)),console['error']('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent'),console[_0x38524a(0x17b)](_0x38524a(0x1a9))):(console[_0x38524a(0x17b)](a35_0x4b8a26[_0x38524a(0x169)](_0x38524a(0x193)+_0x1f8776[_0x38524a(0x1db)]+'\x0a')),_0x1f8776[_0x38524a(0x1cf)]&&console[_0x38524a(0x17b)](a35_0x4b8a26[_0x38524a(0x1ca)](_0x1f8776['helpText']))),0x1;if(_0x1f8776[_0x38524a(0x154)]===_0x38524a(0x15d))return console[_0x38524a(0x17b)](a35_0x4b8a26['red'](_0x38524a(0x174)+_0x1f8776[_0x38524a(0x16e)]+'\x0a')),console[_0x38524a(0x17b)](a35_0x4b8a26['cyan'](_0x38524a(0x1bf))),0x1;const _0x17dba2=_0x1f8776['parentName'],_0x12b57d=_0x1f8776['targetDir'],_0x126e1b=_0x1f8776[_0x38524a(0x154)]===_0x38524a(0x179)?_0x1f8776[_0x38524a(0x1cc)]:undefined,_0x10da08=getScopedDetails(_0x1f8776),_0x442e1d=_0x10da08?.['isScoped']??![],_0x2863c6=_0x10da08?.['scopedFolderPath']??'';if(!existsSync(_0x12b57d))return console['error'](a35_0x4b8a26[_0x38524a(0x169)](_0x38524a(0x174)+_0x12b57d+'\x0a')),console[_0x38524a(0x17b)](a35_0x4b8a26[_0x38524a(0x1ca)](_0x38524a(0x1bf))),0x1;_0x126553['verbose']&&(console[_0x38524a(0x17b)](_0x38524a(0x18c)+_0x126553[_0x38524a(0x157)]),console['error'](_0x38524a(0x18b)+_0x17dba2),console['error'](_0x38524a(0x191)+_0x12b57d),_0x442e1d&&console['error'](_0x38524a(0x1bd)+_0x2863c6));const _0x20c457=await withSpinner(_0x38524a(0x16b)+_0x17dba2+_0x38524a(0x1b9),()=>_0x11c9ed[_0x38524a(0x1a3)][_0x38524a(0x178)](_0x17dba2),{'verbose':_0x126553[_0x38524a(0x1e4)]}),_0x5adaed=_0x20c457[_0x38524a(0x166)],{parentSegmentResult:_0x49ff73,segmentsResult:_0xccde1b,foldersResult:_0x5cae2a,journeysWithDetailsResult:_0x597241,userMaps:_0x2f1edb}=await withSpinner(_0x38524a(0x16f),async()=>{const _0x182a30=_0x38524a,[_0x215791,_0x5a64d7,_0x41d215,_0x24b2e0,_0x157bcf]=await Promise['all']([_0x11c9ed[_0x182a30(0x1a3)][_0x182a30(0x1bc)](_0x5adaed),_0x11c9ed[_0x182a30(0x1a3)]['listSegments'](_0x5adaed),_0x11c9ed[_0x182a30(0x1a3)]['listFolders'](_0x5adaed),_0x11c9ed[_0x182a30(0x1d9)][_0x182a30(0x184)](_0x5adaed,{'includeAllVersions':!![]}),_0x11c9ed[_0x182a30(0x19c)][_0x182a30(0x163)]()]);return{'parentSegmentResult':_0x215791,'segmentsResult':_0x5a64d7,'foldersResult':_0x41d215,'journeysWithDetailsResult':_0x24b2e0,'userMaps':_0x157bcf};},{'verbose':_0x126553['verbose']})[_0x38524a(0x160)](_0x47fba0=>_0x47fba0[_0x38524a(0x166)]),_0x70185b=_0x49ff73,_0x59ac49=extractRootFolderId(_0x70185b),_0x208779=_0xccde1b,_0x113d37=_0x5cae2a,{journeys:_0x150874,activationStepsById:_0xe18794}=_0x597241,_0x1d826b=new Map(_0x150874[_0x38524a(0x16a)](_0x2ca096=>[_0x2ca096['id'],_0x2ca096])),_0x4140c6=_0x150874['map'](_0x5ebf19=>({'id':_0x5ebf19['id'],'name':_0x5ebf19['attributes'][_0x38524a(0x17a)],'journeyBundleName':_0x5ebf19['attributes'][_0x38524a(0x15c)]||'','journeyBundleId':_0x5ebf19[_0x38524a(0x1df)][_0x38524a(0x172)]||'','versionNumber':_0x5ebf19[_0x38524a(0x1df)]['versionNumber'],'description':_0x5ebf19[_0x38524a(0x1df)][_0x38524a(0x1d3)],'state':_0x5ebf19['attributes'][_0x38524a(0x17c)],'paused':_0x5ebf19['attributes']['paused'],'audienceId':_0x5ebf19['attributes'][_0x38524a(0x1c3)],'folderId':_0x5ebf19[_0x38524a(0x1b3)]?.[_0x38524a(0x1ba)]?.['data']?.['id'],'createdAt':_0x5ebf19[_0x38524a(0x1df)][_0x38524a(0x197)],'updatedAt':_0x5ebf19[_0x38524a(0x1df)][_0x38524a(0x182)]})),{emailToId:_0x4fb8ee,idToEmail:_0x462988}=_0x2f1edb,_0x13659d=await withSpinner(_0x38524a(0x171),async()=>{const _0x529e67=_0x38524a,_0x4e1f5e=await _0x11c9ed[_0x529e67(0x17f)]['list']();return buildConnectionMaps(_0x4e1f5e);},{'verbose':_0x126553['verbose']})['then'](_0x2f1f71=>_0x2f1f71[_0x38524a(0x166)]),_0x6cf927=_0x13659d[_0x38524a(0x167)],_0x340bce=_0x13659d[_0x38524a(0x19e)],_0xa7f085=_0x13659d[_0x38524a(0x17e)],_0x298d6d={'emailToIdMap':_0x4fb8ee,'connectionNameToIdMap':_0x6cf927,'connectionNameToTypeMap':_0xa7f085,'getSchema':_0x46b771=>_0x11c9ed[_0x38524a(0x17f)][_0x38524a(0x195)](_0x46b771)};let {pathToId:_0x3e8940,idToPath:_0x4ce666}=buildFolderMaps(_0x113d37);const _0x575ca1=buildSegmentLookupMap(_0x208779,_0x4ce666),_0xc15e63=buildSegmentNameToIdMap(_0x208779),_0x4de19b=buildJourneyBundleLookupMap(_0x4140c6,_0x4ce666);let _0x30e2f0;if(_0x126e1b){if(!_0x126e1b[_0x38524a(0x1b2)]('.yml')&&!_0x126e1b[_0x38524a(0x1b2)](_0x38524a(0x199)))return console['error'](a35_0x4b8a26[_0x38524a(0x169)](_0x38524a(0x180)+_0x126e1b+'\x0a')),0x1;_0x30e2f0=[_0x126e1b];}else _0x30e2f0=findYamlFiles(_0x12b57d);if(_0x30e2f0[_0x38524a(0x18a)]===0x0)return console['error'](a35_0x4b8a26[_0x38524a(0x169)](_0x38524a(0x14f)+_0x12b57d+'\x0a')),console['error'](a35_0x4b8a26[_0x38524a(0x1ca)](_0x38524a(0x1c5))),0x1;let _0x5708e8,_0x1f9518;try{const _0x4baa5a=parseAndClassifyYamlFiles(_0x30e2f0,_0x12b57d,{'skipSegments':_0x126553[_0x38524a(0x1ae)]});_0x5708e8=_0x4baa5a[_0x38524a(0x1a4)],_0x1f9518=_0x4baa5a[_0x38524a(0x194)];const _0x275c6f=validateParsedFiles(_0x4baa5a,_0x12b57d);if(_0x275c6f[_0x38524a(0x18a)]>0x0)return console[_0x38524a(0x17b)](a35_0x4b8a26[_0x38524a(0x169)](_0x38524a(0x1de))),console['error'](formatValidationErrors(_0x275c6f)),console['error'](a35_0x4b8a26['yellow']('\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.')),0x1;}catch(_0xfa3222){return console[_0x38524a(0x17b)](a35_0x4b8a26[_0x38524a(0x169)](_0x38524a(0x1b0)+(_0xfa3222 instanceof Error?_0xfa3222[_0x38524a(0x1db)]:_0xfa3222))),0x1;}if(_0x5708e8[_0x38524a(0x18a)]===0x0&&_0x1f9518[_0x38524a(0x18a)]===0x0){const _0x229731=_0x126553[_0x38524a(0x1ae)]?_0x38524a(0x1d9):_0x38524a(0x185);return console['error'](a35_0x4b8a26['yellow'](_0x38524a(0x1b7)+_0x229731+_0x38524a(0x1cb))),0x0;}const _0x355373=new Map();_0x208779[_0x38524a(0x18a)]>0x0&&!_0x126553[_0x38524a(0x1ae)]&&await withSpinner(_0x38524a(0x1c2),async()=>{await batchAsync(_0x208779,async _0x22890a=>{const _0x19608d=a35_0x357a,_0x36ac5b=await _0x11c9ed['segment'][_0x19608d(0x181)](_0x5adaed,_0x22890a['id']);_0x355373[_0x19608d(0x165)](_0x22890a['id'],_0x36ac5b);});},{'verbose':_0x126553[_0x38524a(0x1e4)]});const {segmentFiles:_0x318b9f,foldersToCreate:_0x48a465}=await prepareSegmentFiles(_0x5708e8,{'segmentByFolderAndName':_0x575ca1,'activationsBySegmentId':_0x355373,'folderPathToId':_0x3e8940,'idToEmailMap':_0x462988,'connectionIdToNameMap':_0x340bce},_0x298d6d,_0x442e1d,_0x2863c6),_0x1854a9=_0x126e1b?[]:findSegmentsToDelete(_0x208779,_0x5708e8[_0x38524a(0x16a)](({yamlConfig:_0x16a88f,folderPath:_0x1e46fd})=>({'yamlConfig':_0x16a88f,'folderPath':resolveTDFolderPath(_0x1e46fd,_0x442e1d,_0x2863c6)})),_0x4ce666,_0x2863c6,_0x442e1d),{journeyFiles:_0x349c65,foldersToCreate:_0x24f7eb}=await withProgressSpinner(_0x38524a(0x158),async _0x4df199=>prepareJourneyFiles(_0x1f9518,{'fetchJourney':async _0x535dcf=>_0x11c9ed[_0x38524a(0x1d9)][_0x38524a(0x1af)](_0x535dcf[_0x38524a(0x175)]),'journeyBundlesByFolderAndName':_0x4de19b,'folderPathToId':_0x3e8940,'idToEmailMap':_0x462988,'connectionIdToNameMap':_0x340bce,'existingSegments':_0x208779,'parentId':_0x5adaed,'deps':_0x11c9ed,'progress':{'update':_0xe63d82=>{const _0x453aa8=_0x38524a;_0x4df199[_0x453aa8(0x1ce)](_0xe63d82),_0x126553[_0x453aa8(0x1e4)]&&console[_0x453aa8(0x17b)]('\x20\x20'+_0xe63d82);}},'journeyById':_0x1d826b,'activationStepsById':_0xe18794},_0x442e1d,_0x2863c6),{'verbose':_0x126553[_0x38524a(0x1e4)]})[_0x38524a(0x160)](_0x57cb97=>_0x57cb97['data']);for(const _0x4e6771 of _0x24f7eb){_0x48a465[_0x38524a(0x173)](_0x4e6771);}const _0x5cc565=_0x126e1b?[]:findJourneysToDelete(_0x4140c6,_0x1f9518[_0x38524a(0x16a)](({yamlConfig:_0x304548,folderPath:_0x5055aa})=>({'yamlConfig':_0x304548,'folderPath':resolveTDFolderPath(_0x5055aa,_0x442e1d,_0x2863c6)})),_0x4ce666,_0x2863c6,_0x442e1d),_0x39f7ac=calculatePushStats(_0x318b9f,_0x349c65,_0x48a465,_0x1854a9,_0x5cc565,!!_0x126553[_0x38524a(0x1c0)],!!_0x126553[_0x38524a(0x1ae)]),_0x5327e4=_0x39f7ac[_0x38524a(0x1a4)][_0x38524a(0x1a2)],_0x54d338=_0x39f7ac[_0x38524a(0x1a4)][_0x38524a(0x1e6)],_0x191a88=_0x39f7ac[_0x38524a(0x1a4)][_0x38524a(0x188)],_0x2e2f49=_0x39f7ac[_0x38524a(0x1a4)][_0x38524a(0x1d6)],_0x5b9fee=_0x39f7ac['folders'][_0x38524a(0x161)],_0x1baee3=_0x39f7ac[_0x38524a(0x194)][_0x38524a(0x1a2)],_0x40a556=_0x39f7ac[_0x38524a(0x194)][_0x38524a(0x1e6)],_0x562c16=_0x39f7ac['journeys'][_0x38524a(0x188)],_0x486b5c=_0x39f7ac[_0x38524a(0x194)]['toDelete'],_0x16eb1d=_0x39f7ac[_0x38524a(0x153)]['all'],_0x2b7bfe=_0x39f7ac[_0x38524a(0x153)][_0x38524a(0x161)],_0x50ecd8=_0x39f7ac[_0x38524a(0x153)][_0x38524a(0x170)],_0x47fb2e=_0x39f7ac[_0x38524a(0x153)]['toDelete'];console['error']('\x0aPush\x20summary\x20for\x20\x27'+_0x17dba2+'\x27:');_0x5b9fee[_0x38524a(0x18a)]>0x0&&console[_0x38524a(0x17b)]('\x20\x20'+a35_0x4b8a26[_0x38524a(0x1e3)](_0x38524a(0x15f)+_0x5b9fee[_0x38524a(0x18a)]+_0x38524a(0x1d1)));if(!_0x126553['journeysOnly']){console[_0x38524a(0x17b)]('\x20\x20📊\x20Segments:'),console[_0x38524a(0x17b)](_0x38524a(0x155)+a35_0x4b8a26[_0x38524a(0x192)]('+\x20'+_0x5327e4[_0x38524a(0x18a)]+_0x38524a(0x1a8))),console['error']('\x20\x20\x20\x20'+a35_0x4b8a26['yellow']('~\x20'+_0x54d338['length']+'\x20changed'));if(_0x2e2f49[_0x38524a(0x18a)]>0x0)console[_0x38524a(0x17b)]('\x20\x20\x20\x20'+a35_0x4b8a26[_0x38524a(0x169)]('-\x20'+_0x2e2f49[_0x38524a(0x18a)]+_0x38524a(0x18d)));else _0x1854a9[_0x38524a(0x18a)]>0x0&&!_0x126553[_0x38524a(0x1c0)]&&console['error']('\x20\x20\x20\x20'+a35_0x4b8a26[_0x38524a(0x19b)](_0x1854a9[_0x38524a(0x18a)]+_0x38524a(0x1a7)));console['error'](_0x38524a(0x155)+a35_0x4b8a26[_0x38524a(0x19b)]('=\x20'+_0x191a88[_0x38524a(0x18a)]+_0x38524a(0x190)));}if(_0x349c65[_0x38524a(0x18a)]>0x0||_0x5cc565[_0x38524a(0x18a)]>0x0){console['error']('\x20\x20🗺️\x20\x20Journeys:'),console[_0x38524a(0x17b)](_0x38524a(0x155)+a35_0x4b8a26[_0x38524a(0x192)]('+\x20'+_0x1baee3[_0x38524a(0x18a)]+_0x38524a(0x1a8))),console[_0x38524a(0x17b)](_0x38524a(0x155)+a35_0x4b8a26[_0x38524a(0x1d4)]('~\x20'+_0x40a556[_0x38524a(0x18a)]+_0x38524a(0x187)));if(_0x486b5c[_0x38524a(0x18a)]>0x0)console[_0x38524a(0x17b)](_0x38524a(0x155)+a35_0x4b8a26['red']('-\x20'+_0x486b5c[_0x38524a(0x18a)]+'\x20to\x20delete'));else _0x5cc565[_0x38524a(0x18a)]>0x0&&!_0x126553['delete']&&console[_0x38524a(0x17b)](_0x38524a(0x155)+a35_0x4b8a26[_0x38524a(0x19b)](_0x5cc565[_0x38524a(0x18a)]+_0x38524a(0x1a7)));console['error']('\x20\x20\x20\x20'+a35_0x4b8a26[_0x38524a(0x19b)]('=\x20'+_0x562c16[_0x38524a(0x18a)]+_0x38524a(0x190)));}_0x16eb1d['length']>0x0&&!_0x126553[_0x38524a(0x1ae)]&&(console[_0x38524a(0x17b)](''),console[_0x38524a(0x17b)](_0x38524a(0x1da)),_0x2b7bfe[_0x38524a(0x18a)]>0x0&&console['error'](_0x38524a(0x155)+a35_0x4b8a26[_0x38524a(0x192)]('+\x20'+_0x2b7bfe['length']+_0x38524a(0x1b8))),_0x50ecd8['length']>0x0&&console[_0x38524a(0x17b)](_0x38524a(0x155)+a35_0x4b8a26[_0x38524a(0x1d4)]('~\x20'+_0x50ecd8[_0x38524a(0x18a)]+_0x38524a(0x15a))),_0x47fb2e['length']>0x0&&console[_0x38524a(0x17b)](_0x38524a(0x155)+a35_0x4b8a26[_0x38524a(0x169)]('-\x20'+_0x47fb2e[_0x38524a(0x18a)]+'\x20to\x20delete')));console['error'](_0x38524a(0x16d)+a35_0x4b8a26[_0x38524a(0x1ca)](_0x12b57d)+'\x0a');if(_0x5b9fee[_0x38524a(0x18a)]>0x0){console[_0x38524a(0x17b)](_0x38524a(0x1cd));for(const _0x47e128 of _0x5b9fee){console[_0x38524a(0x17b)]('\x20\x20'+a35_0x4b8a26[_0x38524a(0x1e3)]('+')+'\x20'+_0x47e128);}console['error']('');}if(_0x5327e4[_0x38524a(0x18a)]>0x0&&!_0x126553[_0x38524a(0x1ae)])for(const _0x1a8663 of _0x5327e4){const _0xd93e06=_0x1a8663[_0x38524a(0x177)]?_0x1a8663['folderPath']+'/'+_0x1a8663[_0x38524a(0x1be)][_0x38524a(0x17a)]:_0x1a8663[_0x38524a(0x1be)][_0x38524a(0x17a)],_0x4a3bd3=_0x1a8663[_0x38524a(0x1be)]['activations']?.[_0x38524a(0x18a)]||0x0,_0x8e751f=_0x4a3bd3>0x0?a35_0x4b8a26[_0x38524a(0x19b)]('\x20['+_0x4a3bd3+_0x38524a(0x1b5)):'';console[_0x38524a(0x17b)]('\x0a'+a35_0x4b8a26[_0x38524a(0x192)](_0x38524a(0x1c7))+'\x20'+_0xd93e06+_0x8e751f),console[_0x38524a(0x17b)]('─'[_0x38524a(0x1c1)](0x3c)),_0x1a8663[_0x38524a(0x1b4)]&&console[_0x38524a(0x17b)](_0x1a8663[_0x38524a(0x1b4)]),console[_0x38524a(0x17b)]('─'[_0x38524a(0x1c1)](0x3c));}if(_0x2e2f49[_0x38524a(0x18a)]>0x0&&!_0x126553[_0x38524a(0x1ae)])for(const _0x2b62c2 of _0x2e2f49){const _0x5d4941=_0x2b62c2[_0x38524a(0x152)]?_0x4ce666[_0x38524a(0x1bb)](_0x2b62c2[_0x38524a(0x152)]['toString']())||'':'',_0x2ec747=_0x5d4941?_0x5d4941+'/'+_0x2b62c2[_0x38524a(0x17a)]:_0x2b62c2[_0x38524a(0x17a)],_0x74e158=_0x355373['get'](_0x2b62c2['id'])||[],_0x244884=_0x74e158[_0x38524a(0x18a)]>0x0?a35_0x4b8a26[_0x38524a(0x19b)]('\x20['+_0x74e158['length']+'\x20activations]'):'';console[_0x38524a(0x17b)]('\x0a'+a35_0x4b8a26[_0x38524a(0x169)]('Delete\x20segment:')+'\x20'+_0x2ec747+_0x244884),console[_0x38524a(0x17b)]('─'[_0x38524a(0x1c1)](0x3c));const _0x1a2275=segmentWithActivationsToYaml(_0x2b62c2,_0x74e158,undefined,_0x462988,_0x340bce),_0xab3729=segmentToYamlString(_0x1a2275),_0x18dd74=generateDiff(_0xab3729,'');console[_0x38524a(0x17b)](formatDiffWithColors(_0x18dd74)),console[_0x38524a(0x17b)]('─'[_0x38524a(0x1c1)](0x3c));}const _0x4c0b18=_0x318b9f[_0x38524a(0x15b)](_0x17a4cc=>!_0x17a4cc[_0x38524a(0x19f)]&&_0x17a4cc[_0x38524a(0x1b4)]);if(_0x4c0b18[_0x38524a(0x18a)]>0x0&&!_0x126553[_0x38524a(0x1ae)])for(const _0x295711 of _0x4c0b18){const _0x24e308=_0x295711['folderPath']?_0x295711['folderPath']+'/'+_0x295711[_0x38524a(0x1be)][_0x38524a(0x17a)]:_0x295711[_0x38524a(0x1be)][_0x38524a(0x17a)];console[_0x38524a(0x17b)]('\x0a'+a35_0x4b8a26[_0x38524a(0x1d4)](_0x38524a(0x156))+'\x20'+_0x24e308),console['error']('─'[_0x38524a(0x1c1)](0x3c)),console[_0x38524a(0x17b)](_0x295711[_0x38524a(0x1b4)]),console[_0x38524a(0x17b)]('─'['repeat'](0x3c));}if(_0x1baee3[_0x38524a(0x18a)]>0x0)for(const _0x59604f of _0x1baee3){const _0x2e5d8e=_0x59604f[_0x38524a(0x177)]?_0x59604f[_0x38524a(0x177)]+'/'+_0x59604f[_0x38524a(0x1be)]['name']:_0x59604f['yamlConfig'][_0x38524a(0x17a)];console[_0x38524a(0x17b)]('\x0a'+a35_0x4b8a26['green'](_0x38524a(0x1dd))+'\x20'+_0x2e5d8e),console[_0x38524a(0x17b)]('─'['repeat'](0x3c)),_0x59604f[_0x38524a(0x1b4)]&&console['error'](_0x59604f[_0x38524a(0x1b4)]),console[_0x38524a(0x17b)]('─'[_0x38524a(0x1c1)](0x3c));}const _0x1f3d28=_0x349c65[_0x38524a(0x15b)](_0x2786a3=>!_0x2786a3[_0x38524a(0x19f)]&&_0x2786a3[_0x38524a(0x1b4)]);if(_0x1f3d28[_0x38524a(0x18a)]>0x0)for(const _0x3c2c36 of _0x1f3d28){const _0x3f9853=_0x3c2c36['folderPath']?_0x3c2c36['folderPath']+'/'+_0x3c2c36['yamlConfig']['name']:_0x3c2c36[_0x38524a(0x1be)][_0x38524a(0x17a)];console['error']('\x0a'+a35_0x4b8a26['yellow'](_0x38524a(0x1a6))+'\x20'+_0x3f9853),console['error']('─'['repeat'](0x3c)),console[_0x38524a(0x17b)](_0x3c2c36[_0x38524a(0x1b4)]),console[_0x38524a(0x17b)]('─'[_0x38524a(0x1c1)](0x3c));}if(_0x486b5c['length']>0x0)for(const _0x3ca6ac of _0x486b5c){const _0x20d02d=_0x3ca6ac[_0x38524a(0x1a1)]?_0x4ce666['get'](_0x3ca6ac['folderId'])||'':'',_0x519680=_0x20d02d?_0x20d02d+'/'+_0x3ca6ac[_0x38524a(0x15c)]:_0x3ca6ac[_0x38524a(0x15c)];console[_0x38524a(0x17b)]('\x0a'+a35_0x4b8a26[_0x38524a(0x169)](_0x38524a(0x1ad))+'\x20'+_0x519680),console['error']('─'[_0x38524a(0x1c1)](0x3c)),console[_0x38524a(0x17b)](a35_0x4b8a26['red'](_0x38524a(0x1e1))),console['error']('─'[_0x38524a(0x1c1)](0x3c));}if(_0x126553['dryRun'])return console['error'](a35_0x4b8a26['yellow']('\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made')),0x0;const _0x58e721=_0x126553['journeysOnly']?![]:_0x5327e4[_0x38524a(0x18a)]>0x0||_0x54d338[_0x38524a(0x18a)]>0x0||_0x2e2f49[_0x38524a(0x18a)]>0x0,_0x2799f9=_0x1baee3[_0x38524a(0x18a)]>0x0||_0x40a556[_0x38524a(0x18a)]>0x0||_0x486b5c['length']>0x0,_0x42b074=_0x126553[_0x38524a(0x1ae)]?![]:_0x16eb1d['length']>0x0,_0x3db78f=_0x5b9fee[_0x38524a(0x18a)]>0x0;if(!_0x58e721&&!_0x2799f9&&!_0x42b074&&!_0x3db78f){const _0x4a688f=_0x126553['journeysOnly']?_0x38524a(0x1c8):'✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date';console[_0x38524a(0x17b)](a35_0x4b8a26[_0x38524a(0x192)](_0x4a688f));if(_0x126e1b&&_0x562c16['length']===0x1){const _0x2d98a9=_0x562c16[0x0];if(_0x2d98a9['existingJourney']?.['id']){const _0x5ea4dd=getConsoleNextUrl(_0x126553[_0x38524a(0x157)],_0x38524a(0x1b6)+_0x5adaed+_0x38524a(0x1e2)+_0x2d98a9[_0x38524a(0x1c4)]['id']+_0x38524a(0x183));console[_0x38524a(0x17b)]('\x20\x20'+a35_0x4b8a26[_0x38524a(0x1ca)](_0x5ea4dd));}}return 0x0;}const _0x8330a9=_0x126553['journeysOnly']?_0x1baee3[_0x38524a(0x18a)]+_0x40a556[_0x38524a(0x18a)]+_0x486b5c['length']+_0x5b9fee[_0x38524a(0x18a)]:_0x5327e4[_0x38524a(0x18a)]+_0x54d338[_0x38524a(0x18a)]+_0x2e2f49['length']+_0x1baee3[_0x38524a(0x18a)]+_0x40a556[_0x38524a(0x18a)]+_0x486b5c['length']+_0x5b9fee[_0x38524a(0x18a)]+_0x16eb1d[_0x38524a(0x18a)];if(!_0x126553[_0x38524a(0x1a0)]&&_0x8330a9>0x0){if(!isInteractive())return console[_0x38524a(0x17b)](a35_0x4b8a26[_0x38524a(0x169)](_0x38524a(0x151)),_0x38524a(0x19a)),console[_0x38524a(0x17b)](a35_0x4b8a26[_0x38524a(0x19b)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x3db4f3=await confirmKey('Push\x20'+_0x8330a9+_0x38524a(0x1a5));if(!_0x3db4f3)return console[_0x38524a(0x17b)](a35_0x4b8a26['yellow']('Aborted.')),0x1;}const _0x2ead98={'withProgress':async(_0x49c70a,_0x2ebd96)=>{const _0x1bb228=_0x38524a,_0x42d2f9=await withSpinner(_0x49c70a,_0x2ebd96,{'verbose':_0x126553[_0x1bb228(0x1e4)]});return{'data':_0x42d2f9[_0x1bb228(0x166)]};},'logInfo':_0x46661f=>console[_0x38524a(0x17b)](a35_0x4b8a26['blue']('✔\x20'+_0x46661f)),'logSuccess':_0x1202f1=>console[_0x38524a(0x17b)](a35_0x4b8a26['green']('✔\x20'+_0x1202f1)),'logWarning':_0x314fd6=>console[_0x38524a(0x17b)](a35_0x4b8a26[_0x38524a(0x1d4)]('⚠\x20'+_0x314fd6)),'logDeleted':_0xee863e=>console[_0x38524a(0x17b)](a35_0x4b8a26[_0x38524a(0x169)]('✔\x20'+_0xee863e))},_0x535d7f={'segment':_0x11c9ed[_0x38524a(0x1a3)],'journey':_0x11c9ed[_0x38524a(0x1d9)],'user':_0x11c9ed['user'],'connection':_0x11c9ed[_0x38524a(0x17f)]};_0x5b9fee[_0x38524a(0x18a)]>0x0&&(_0x3e8940=await executePushFolders(_0x535d7f,_0x5b9fee,_0x3e8940,{'parentId':_0x5adaed},_0x2ead98));const _0x324e56={'rootFolderId':_0x59ac49,'folderPathToId':_0x3e8940,'folderIdToPath':_0x4ce666,'segmentNameToId':_0xc15e63,'activationsBySegmentId':_0x355373,'emailToIdMap':_0x4fb8ee,'idToEmailMap':_0x462988,'connectionNameToIdMap':_0x13659d['nameToId'],'connectionIdToNameMap':_0x13659d[_0x38524a(0x19e)],'connectionNameToTypeMap':_0xa7f085},_0x142f9d=await executePushSegments(_0x535d7f,_0x126553['journeysOnly']?[]:_0x318b9f,_0x324e56,{'parentId':_0x5adaed},_0x2ead98),_0x1a2577=_0x142f9d[_0x38524a(0x18e)],_0x573be6=_0x142f9d[_0x38524a(0x1d7)],_0xd6ca1a=_0x142f9d[_0x38524a(0x153)]['created'],_0x3ceb48=_0x142f9d[_0x38524a(0x153)][_0x38524a(0x1d7)],_0x533dac=_0x142f9d[_0x38524a(0x153)]['deleted'],_0x183ae2=await executePushSegmentDeletions(_0x535d7f,_0x126553[_0x38524a(0x1ae)]?[]:_0x2e2f49,_0x2ead98);let _0x4481f6=0x0,_0x106237=0x0,_0x34b61c=0x0;const _0x534d33=new Map(_0xc15e63);for(const [_0x33293a,_0x48ec9b]of _0x142f9d[_0x38524a(0x1d8)]){_0x534d33[_0x38524a(0x165)](_0x33293a,_0x48ec9b);}if(_0x349c65[_0x38524a(0x18a)]>0x0){const _0x475c46={..._0x324e56,'segmentNameToId':_0x534d33,'existingSegments':_0x208779,'activationContext':_0x298d6d},_0x4c29c2=await executePushJourneys(_0x535d7f,_0x349c65,_0x475c46,{'parentId':_0x5adaed,'rootFolderId':_0x59ac49,'verbose':_0x126553[_0x38524a(0x1e4)]},_0x2ead98);_0x4481f6=_0x4c29c2[_0x38524a(0x18e)],_0x106237=_0x4c29c2['updated'];if(_0x126e1b&&_0x4c29c2[_0x38524a(0x150)][_0x38524a(0x18a)]===0x1){const _0x2c8bcc=_0x4c29c2[_0x38524a(0x150)][0x0];if(_0x2c8bcc[_0x38524a(0x175)]){const _0x24004c=getConsoleNextUrl(_0x126553[_0x38524a(0x157)],'/app/ps/'+_0x5adaed+'/e/'+_0x2c8bcc['journeyId']+_0x38524a(0x183));console['error']('\x20\x20'+a35_0x4b8a26[_0x38524a(0x1ca)](_0x24004c));}}}for(const _0x589bb2 of _0x486b5c){console[_0x38524a(0x17b)](a35_0x4b8a26[_0x38524a(0x1d4)]('⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20'+_0x589bb2[_0x38524a(0x15c)])),_0x34b61c++;}const _0x4d084e=[];if(_0x1a2577>0x0)_0x4d084e[_0x38524a(0x18f)](_0x1a2577+'\x20created');if(_0x573be6>0x0)_0x4d084e[_0x38524a(0x18f)](_0x573be6+_0x38524a(0x198));if(_0x183ae2>0x0)_0x4d084e[_0x38524a(0x18f)](_0x183ae2+_0x38524a(0x16c));const _0x5a898b=[];if(_0x4481f6>0x0)_0x5a898b[_0x38524a(0x18f)](_0x4481f6+_0x38524a(0x1d2));if(_0x106237>0x0)_0x5a898b[_0x38524a(0x18f)](_0x106237+_0x38524a(0x198));if(_0x34b61c>0x0)_0x5a898b[_0x38524a(0x18f)](_0x34b61c+_0x38524a(0x16c));const _0x30dd8c=[];if(_0xd6ca1a>0x0)_0x30dd8c[_0x38524a(0x18f)](_0xd6ca1a+'\x20created');if(_0x3ceb48>0x0)_0x30dd8c[_0x38524a(0x18f)](_0x3ceb48+_0x38524a(0x198));if(_0x533dac>0x0)_0x30dd8c[_0x38524a(0x18f)](_0x533dac+'\x20deleted');return console[_0x38524a(0x17b)](a35_0x4b8a26[_0x38524a(0x192)](_0x38524a(0x1d5))),_0x4d084e[_0x38524a(0x18a)]>0x0&&!_0x126553[_0x38524a(0x1ae)]&&console['error']('\x20\x20Segments:\x20'+_0x4d084e[_0x38524a(0x1e5)](',\x20')),_0x5a898b[_0x38524a(0x18a)]>0x0&&console[_0x38524a(0x17b)](_0x38524a(0x168)+_0x5a898b[_0x38524a(0x1e5)](',\x20')),_0x30dd8c['length']>0x0&&!_0x126553['journeysOnly']&&console[_0x38524a(0x17b)](_0x38524a(0x162)+_0x30dd8c[_0x38524a(0x1e5)](',\x20')),0x0;}}
1
+ const a35_0x1306b7=a35_0x1ce0;(function(_0xaf2ec9,_0x11a67c){const _0x5db403=a35_0x1ce0,_0x26fce1=_0xaf2ec9();while(!![]){try{const _0x2321e7=parseInt(_0x5db403(0xbe))/0x1*(parseInt(_0x5db403(0x8c))/0x2)+-parseInt(_0x5db403(0xf3))/0x3+-parseInt(_0x5db403(0xd9))/0x4+-parseInt(_0x5db403(0xe3))/0x5*(-parseInt(_0x5db403(0xaa))/0x6)+parseInt(_0x5db403(0xb5))/0x7+parseInt(_0x5db403(0x85))/0x8+-parseInt(_0x5db403(0xc5))/0x9;if(_0x2321e7===_0x11a67c)break;else _0x26fce1['push'](_0x26fce1['shift']());}catch(_0x5043e0){_0x26fce1['push'](_0x26fce1['shift']());}}}(a35_0x2d7d,0xef8d8));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 a35_0x5b2343 from'chalk';function a35_0x2d7d(){const _0x1857fc=['helpText','then','3526516ahkMCf','\x20changes?','length','Delete\x20journey:','toString','✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','\x0aValidation\x20failed:','updatedAt','description','Source\x20directory:\x20','55tRBWcv','isNew','idToName','verbose','data','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file','journeysOnly','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','scopedFolderPath','diff','error','blue','execute','nameToType','Parent\x20segment:\x20','Fetching\x20connections\x20for\x20name\x20resolution...','2997234gOdLRb','✔\x20All\x20journeys\x20are\x20up\x20to\x20date','changed','Error:\x20','\x20updated','filePath','existingJourney','paused','\x20YAML\x20files\x20found','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','results','activations','getParent','audienceId','\x20\x20Source:\x20','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','\x0aPush\x20summary\x20for\x20\x27','getOutputSchemaWithCache','Scoped\x20to\x20folder:\x20','\x20created','errorCode','journey','journeyBundleId','\x20new','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','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)','green','getJourney','new','parentName','relationships','yamlConfig','user','resolveParentId','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','\x20changed','.yml','journeyBundleName','\x20\x20Activations:\x20','listJourneysWithDetailsFromParentSegment','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','Delete\x20segment:','deleted','New\x20segment:','\x20\x20\x20\x20','segment:push','\x20deleted','parentFolder','/e/','(Journey\x20will\x20be\x20deleted)','\x0aError:','10506000fdprWP','site','\x20\x20📊\x20Segments:','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','\x20\x20Activations:','cwd','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','38SlMgoO','targetDir','join','set','.yaml','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','Preparing\x20journeys...','folderId','journeys','all','\x20unchanged','/j/da/je','segment','toDelete','repeat','Changes\x20to\x20journey:','\x27...','\x20folders\x20to\x20create','name','versionNumber','segmentFolderId','add','New\x20journey:','Site:\x20','parent_name','Aborted.','Push\x20','segment\x20or\x20journey','attributes','dryRun','126138AGDywo','endsWith','list','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','filter','created','unchanged','state','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','Error\x20parsing\x20YAML:\x20','Error:\x20Directory\x20not\x20found:\x20','13459404pkzQGj','cyan','push','No\x20','buildUserMaps','folderPath','dim','segments','updated','7716XYzWHD','parentSegment','\x20\x20Journeys:\x20','toCreate','folders','\x20to\x20delete','red','6767676IYoSkc','Resolving\x20parent\x20segment\x20\x27','yellow','\x0a✔\x20Push\x20complete','get','listSegments','📁\x20','journeyId','connection','createdSegmentIds','nameToId','listActivations','\x20activations]','message','type','delete','map','/app/ps/'];a35_0x2d7d=function(){return _0x1857fc;};return a35_0x2d7d();}function a35_0x1ce0(_0x46d040,_0x410fb0){_0x46d040=_0x46d040-0x75;const _0x2d7d92=a35_0x2d7d();let _0x1ce0e7=_0x2d7d92[_0x46d040];return _0x1ce0e7;}import{existsSync}from'fs';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{resolveTarget,isSuccessfulResolution,getScopedDetails}from'../sdk/segment/target-resolution.js';import{buildFolderMaps}from'../sdk/segment/resolution-context.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{resolveTDFolderPath,findSegmentsToDelete,findJourneysToDelete,buildSegmentLookupMap,buildSegmentNameToIdMap,buildJourneyBundleLookupMap,parseAndClassifyYamlFiles,validateParsedFiles,formatValidationErrors,extractRootFolderId,buildConnectionMaps,calculatePushStats,prepareSegmentFiles,prepareJourneyFiles,executePushSegments,executePushFolders,executePushSegmentDeletions,executePushJourneys}from'../sdk/segment/push-workflow.js';export class SegmentPushCommand extends BaseCommand{[a35_0x1306b7(0x9e)]=a35_0x1306b7(0x7f);[a35_0x1306b7(0xe1)]=a35_0x1306b7(0x10b);async[a35_0x1306b7(0xef)](_0x59a88f){const _0x488617=a35_0x1306b7,{options:_0x24e803,args:_0x5eb391,tdx:_0x2a260a}=_0x59a88f,_0x2d9c1f=_0x24e803,_0xc62217=await resolveTarget({'arg':_0x5eb391[0x0],'contextParent':_0x24e803[_0x488617(0xbf)],'cwd':process[_0x488617(0x8a)]()});if(!isSuccessfulResolution(_0xc62217))return _0xc62217[_0x488617(0x107)]==='no_parent'?(console[_0x488617(0xed)](a35_0x5b2343['yellow'](_0x488617(0x8b))),console[_0x488617(0xed)](_0x488617(0x10c)),console['error'](_0x488617(0x115)),console[_0x488617(0xed)](_0x488617(0xe8))):(console['error'](a35_0x5b2343[_0x488617(0xc4)](_0x488617(0xf6)+_0xc62217[_0x488617(0xd2)]+'\x0a')),_0xc62217[_0x488617(0xd7)]&&console['error'](a35_0x5b2343[_0x488617(0xb6)](_0xc62217[_0x488617(0xd7)]))),0x1;if(_0xc62217[_0x488617(0xd3)]===_0x488617(0xa4))return console[_0x488617(0xed)](a35_0x5b2343['red']('Error:\x20Directory\x20not\x20found:\x20'+_0xc62217[_0x488617(0x8d)]+'\x0a')),console['error'](a35_0x5b2343[_0x488617(0xb6)]('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;const _0x55661a=_0xc62217[_0x488617(0x110)],_0xd1ce9e=_0xc62217['targetDir'],_0xb15075=_0xc62217[_0x488617(0xd3)]==='file'?_0xc62217[_0x488617(0xf8)]:undefined,_0x3f93a0=getScopedDetails(_0xc62217),_0x36e3f0=_0x3f93a0?.['isScoped']??![],_0x2883e4=_0x3f93a0?.[_0x488617(0xeb)]??'';if(!existsSync(_0xd1ce9e))return console[_0x488617(0xed)](a35_0x5b2343['red'](_0x488617(0xb4)+_0xd1ce9e+'\x0a')),console['error'](a35_0x5b2343['cyan'](_0x488617(0xb2))),0x1;_0x2d9c1f[_0x488617(0xe6)]&&(console[_0x488617(0xed)](_0x488617(0xa3)+_0x2d9c1f[_0x488617(0x86)]),console[_0x488617(0xed)](_0x488617(0xf1)+_0x55661a),console[_0x488617(0xed)](_0x488617(0xe2)+_0xd1ce9e),_0x36e3f0&&console[_0x488617(0xed)](_0x488617(0x105)+_0x2883e4));const _0x53769d=await withSpinner(_0x488617(0xc6)+_0x55661a+_0x488617(0x9c),()=>_0x2a260a['segment'][_0x488617(0x114)](_0x55661a),{'verbose':_0x2d9c1f[_0x488617(0xe6)]}),_0x3a0a31=_0x53769d['data'],{parentSegmentResult:_0x590f5a,segmentsResult:_0x448c43,foldersResult:_0x265834,journeysWithDetailsResult:_0x37f580,userMaps:_0x1f8ede}=await withSpinner('Fetching\x20existing\x20data...',async()=>{const _0x469156=_0x488617,[_0x5282df,_0x36d2a5,_0xd43dbf,_0x1ef9d5,_0x342a86]=await Promise['all']([_0x2a260a[_0x469156(0x98)][_0x469156(0xff)](_0x3a0a31),_0x2a260a['segment'][_0x469156(0xca)](_0x3a0a31),_0x2a260a['segment']['listFolders'](_0x3a0a31),_0x2a260a[_0x469156(0x108)][_0x469156(0x79)](_0x3a0a31,{'includeAllVersions':!![]}),_0x2a260a[_0x469156(0x113)][_0x469156(0xb9)]()]);return{'parentSegmentResult':_0x5282df,'segmentsResult':_0x36d2a5,'foldersResult':_0xd43dbf,'journeysWithDetailsResult':_0x1ef9d5,'userMaps':_0x342a86};},{'verbose':_0x2d9c1f[_0x488617(0xe6)]})[_0x488617(0xd8)](_0x3d62ce=>_0x3d62ce[_0x488617(0xe7)]),_0x28588c=_0x590f5a,_0x3cf8b2=extractRootFolderId(_0x28588c),_0x595c25=_0x448c43,_0x331bae=_0x265834,{journeys:_0x25678a,activationStepsById:_0x2e6132}=_0x37f580,_0x6c5ec2=new Map(_0x25678a[_0x488617(0xd5)](_0x50568d=>[_0x50568d['id'],_0x50568d])),_0x18d49e=_0x25678a[_0x488617(0xd5)](_0x387d22=>({'id':_0x387d22['id'],'name':_0x387d22['attributes'][_0x488617(0x9e)],'journeyBundleName':_0x387d22[_0x488617(0xa8)][_0x488617(0x77)]||'','journeyBundleId':_0x387d22[_0x488617(0xa8)][_0x488617(0x109)]||'','versionNumber':_0x387d22['attributes'][_0x488617(0x9f)],'description':_0x387d22['attributes'][_0x488617(0xe1)],'state':_0x387d22[_0x488617(0xa8)][_0x488617(0xb1)],'paused':_0x387d22[_0x488617(0xa8)][_0x488617(0xfa)],'audienceId':_0x387d22['attributes'][_0x488617(0x100)],'folderId':_0x387d22[_0x488617(0x111)]?.[_0x488617(0x81)]?.[_0x488617(0xe7)]?.['id'],'createdAt':_0x387d22[_0x488617(0xa8)]['createdAt'],'updatedAt':_0x387d22['attributes'][_0x488617(0xe0)]})),{emailToId:_0x2af0da,idToEmail:_0x46c3f0}=_0x1f8ede,_0x2628ac=await withSpinner(_0x488617(0xf2),async()=>{const _0x3b3a1f=_0x488617,_0x55d4eb=await _0x2a260a[_0x3b3a1f(0xcd)][_0x3b3a1f(0xac)]();return buildConnectionMaps(_0x55d4eb);},{'verbose':_0x2d9c1f[_0x488617(0xe6)]})[_0x488617(0xd8)](_0x15c9b7=>_0x15c9b7[_0x488617(0xe7)]),_0x167cdc=_0x2628ac[_0x488617(0xcf)],_0x2e5030=_0x2628ac[_0x488617(0xe5)],_0x1d55cc=_0x2628ac[_0x488617(0xf0)],_0x46c526={'emailToIdMap':_0x2af0da,'connectionNameToIdMap':_0x167cdc,'connectionNameToTypeMap':_0x1d55cc,'getSchema':_0x4a5af0=>_0x2a260a[_0x488617(0xcd)][_0x488617(0x104)](_0x4a5af0)};let {pathToId:_0x4eca28,idToPath:_0x1993b7}=buildFolderMaps(_0x331bae);const _0xeca8f2=buildSegmentLookupMap(_0x595c25,_0x1993b7),_0x5e7f5e=buildSegmentNameToIdMap(_0x595c25),_0x2d9c2b=buildJourneyBundleLookupMap(_0x18d49e,_0x1993b7);let _0x101cdd;if(_0xb15075){if(!_0xb15075[_0x488617(0xab)](_0x488617(0x76))&&!_0xb15075[_0x488617(0xab)](_0x488617(0x90)))return console[_0x488617(0xed)](a35_0x5b2343[_0x488617(0xc4)](_0x488617(0xea)+_0xb15075+'\x0a')),0x1;_0x101cdd=[_0xb15075];}else _0x101cdd=findYamlFiles(_0xd1ce9e);if(_0x101cdd[_0x488617(0xdb)]===0x0)return console[_0x488617(0xed)](a35_0x5b2343[_0x488617(0xc4)](_0x488617(0x7a)+_0xd1ce9e+'\x0a')),console['error'](a35_0x5b2343[_0x488617(0xb6)](_0x488617(0x102))),0x1;let _0x2833a2,_0x2eb34a;try{const _0x4b280b=parseAndClassifyYamlFiles(_0x101cdd,_0xd1ce9e,{'skipSegments':_0x2d9c1f[_0x488617(0xe9)]});_0x2833a2=_0x4b280b[_0x488617(0xbc)],_0x2eb34a=_0x4b280b['journeys'];const _0x4b2bd5=validateParsedFiles(_0x4b280b,_0xd1ce9e);if(_0x4b2bd5[_0x488617(0xdb)]>0x0)return console[_0x488617(0xed)](a35_0x5b2343['red'](_0x488617(0xdf))),console[_0x488617(0xed)](formatValidationErrors(_0x4b2bd5)),console[_0x488617(0xed)](a35_0x5b2343[_0x488617(0xc7)](_0x488617(0xad))),0x1;}catch(_0x34a9ef){return console['error'](a35_0x5b2343[_0x488617(0xc4)](_0x488617(0xb3)+(_0x34a9ef instanceof Error?_0x34a9ef[_0x488617(0xd2)]:_0x34a9ef))),0x1;}if(_0x2833a2['length']===0x0&&_0x2eb34a[_0x488617(0xdb)]===0x0){const _0x352a5c=_0x2d9c1f['journeysOnly']?_0x488617(0x108):_0x488617(0xa7);return console[_0x488617(0xed)](a35_0x5b2343[_0x488617(0xc7)](_0x488617(0xb8)+_0x352a5c+_0x488617(0xfb))),0x0;}const _0x3787c0=new Map();_0x595c25['length']>0x0&&!_0x2d9c1f['journeysOnly']&&await withSpinner('Fetching\x20existing\x20activations...',async()=>{await batchAsync(_0x595c25,async _0x18168b=>{const _0x72f7a2=a35_0x1ce0,_0x375668=await _0x2a260a[_0x72f7a2(0x98)][_0x72f7a2(0xd0)](_0x3a0a31,_0x18168b['id']);_0x3787c0[_0x72f7a2(0x8f)](_0x18168b['id'],_0x375668);});},{'verbose':_0x2d9c1f[_0x488617(0xe6)]});const {segmentFiles:_0x9781fc,foldersToCreate:_0x280f23}=await prepareSegmentFiles(_0x2833a2,{'segmentByFolderAndName':_0xeca8f2,'activationsBySegmentId':_0x3787c0,'folderPathToId':_0x4eca28,'idToEmailMap':_0x46c3f0,'connectionIdToNameMap':_0x2e5030},_0x46c526,_0x36e3f0,_0x2883e4),_0x48c79b=_0xb15075?[]:findSegmentsToDelete(_0x595c25,_0x2833a2[_0x488617(0xd5)](({yamlConfig:_0x472e57,folderPath:_0x15d667})=>({'yamlConfig':_0x472e57,'folderPath':resolveTDFolderPath(_0x15d667,_0x36e3f0,_0x2883e4)})),_0x1993b7,_0x2883e4,_0x36e3f0),{journeyFiles:_0x2f9bc6,foldersToCreate:_0x4b55f4}=await withProgressSpinner(_0x488617(0x92),async _0x2c932b=>prepareJourneyFiles(_0x2eb34a,{'fetchJourney':async _0x26faf3=>_0x2a260a[_0x488617(0x108)][_0x488617(0x10e)](_0x26faf3[_0x488617(0xcc)]),'journeyBundlesByFolderAndName':_0x2d9c2b,'folderPathToId':_0x4eca28,'idToEmailMap':_0x46c3f0,'connectionIdToNameMap':_0x2e5030,'existingSegments':_0x595c25,'parentId':_0x3a0a31,'deps':_0x2a260a,'progress':{'update':_0x12fdf6=>{_0x2c932b['setPhase'](_0x12fdf6),_0x2d9c1f['verbose']&&console['error']('\x20\x20'+_0x12fdf6);}},'journeyById':_0x6c5ec2,'activationStepsById':_0x2e6132},_0x36e3f0,_0x2883e4),{'verbose':_0x2d9c1f[_0x488617(0xe6)]})[_0x488617(0xd8)](_0x385aee=>_0x385aee[_0x488617(0xe7)]);for(const _0x29eb48 of _0x4b55f4){_0x280f23[_0x488617(0xa1)](_0x29eb48);}const _0x22a7fa=_0xb15075?[]:findJourneysToDelete(_0x18d49e,_0x2eb34a[_0x488617(0xd5)](({yamlConfig:_0x20fcee,folderPath:_0x39380})=>({'yamlConfig':_0x20fcee,'folderPath':resolveTDFolderPath(_0x39380,_0x36e3f0,_0x2883e4)})),_0x1993b7,_0x2883e4,_0x36e3f0),_0x224316=calculatePushStats(_0x9781fc,_0x2f9bc6,_0x280f23,_0x48c79b,_0x22a7fa,!!_0x2d9c1f[_0x488617(0xd4)],!!_0x2d9c1f['journeysOnly']),_0x145681=_0x224316['segments']['new'],_0x1d5b7a=_0x224316[_0x488617(0xbc)][_0x488617(0xf5)],_0x3107d0=_0x224316['segments'][_0x488617(0xb0)],_0x43b62e=_0x224316[_0x488617(0xbc)][_0x488617(0x99)],_0x21e4ab=_0x224316[_0x488617(0xc2)]['toCreate'],_0x523365=_0x224316[_0x488617(0x94)][_0x488617(0x10f)],_0x26e1b8=_0x224316[_0x488617(0x94)][_0x488617(0xf5)],_0x210462=_0x224316['journeys'][_0x488617(0xb0)],_0x1db665=_0x224316[_0x488617(0x94)][_0x488617(0x99)],_0xaa3ae9=_0x224316['activations'][_0x488617(0x95)],_0x2b733f=_0x224316[_0x488617(0xfe)][_0x488617(0xc1)],_0x3cc3e4=_0x224316[_0x488617(0xfe)]['toUpdate'],_0x47e87f=_0x224316[_0x488617(0xfe)]['toDelete'];console[_0x488617(0xed)](_0x488617(0x103)+_0x55661a+'\x27:');_0x21e4ab['length']>0x0&&console['error']('\x20\x20'+a35_0x5b2343['blue'](_0x488617(0xcb)+_0x21e4ab['length']+_0x488617(0x9d)));if(!_0x2d9c1f['journeysOnly']){console[_0x488617(0xed)](_0x488617(0x87)),console['error']('\x20\x20\x20\x20'+a35_0x5b2343[_0x488617(0x10d)]('+\x20'+_0x145681[_0x488617(0xdb)]+'\x20new')),console[_0x488617(0xed)](_0x488617(0x7e)+a35_0x5b2343[_0x488617(0xc7)]('~\x20'+_0x1d5b7a[_0x488617(0xdb)]+_0x488617(0x75)));if(_0x43b62e[_0x488617(0xdb)]>0x0)console['error'](_0x488617(0x7e)+a35_0x5b2343[_0x488617(0xc4)]('-\x20'+_0x43b62e[_0x488617(0xdb)]+'\x20to\x20delete'));else _0x48c79b[_0x488617(0xdb)]>0x0&&!_0x2d9c1f[_0x488617(0xd4)]&&console[_0x488617(0xed)](_0x488617(0x7e)+a35_0x5b2343[_0x488617(0xbb)](_0x48c79b[_0x488617(0xdb)]+_0x488617(0xfc)));console[_0x488617(0xed)](_0x488617(0x7e)+a35_0x5b2343[_0x488617(0xbb)]('=\x20'+_0x3107d0[_0x488617(0xdb)]+_0x488617(0x96)));}if(_0x2f9bc6[_0x488617(0xdb)]>0x0||_0x22a7fa[_0x488617(0xdb)]>0x0){console[_0x488617(0xed)]('\x20\x20🗺️\x20\x20Journeys:'),console[_0x488617(0xed)](_0x488617(0x7e)+a35_0x5b2343['green']('+\x20'+_0x523365[_0x488617(0xdb)]+_0x488617(0x10a))),console[_0x488617(0xed)]('\x20\x20\x20\x20'+a35_0x5b2343['yellow']('~\x20'+_0x26e1b8[_0x488617(0xdb)]+_0x488617(0x75)));if(_0x1db665[_0x488617(0xdb)]>0x0)console[_0x488617(0xed)]('\x20\x20\x20\x20'+a35_0x5b2343[_0x488617(0xc4)]('-\x20'+_0x1db665[_0x488617(0xdb)]+'\x20to\x20delete'));else _0x22a7fa['length']>0x0&&!_0x2d9c1f[_0x488617(0xd4)]&&console[_0x488617(0xed)](_0x488617(0x7e)+a35_0x5b2343['dim'](_0x22a7fa[_0x488617(0xdb)]+'\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)'));console[_0x488617(0xed)](_0x488617(0x7e)+a35_0x5b2343[_0x488617(0xbb)]('=\x20'+_0x210462[_0x488617(0xdb)]+'\x20unchanged'));}_0xaa3ae9['length']>0x0&&!_0x2d9c1f[_0x488617(0xe9)]&&(console[_0x488617(0xed)](''),console['error'](_0x488617(0x89)),_0x2b733f[_0x488617(0xdb)]>0x0&&console[_0x488617(0xed)](_0x488617(0x7e)+a35_0x5b2343[_0x488617(0x10d)]('+\x20'+_0x2b733f[_0x488617(0xdb)]+'\x20to\x20create')),_0x3cc3e4[_0x488617(0xdb)]>0x0&&console[_0x488617(0xed)]('\x20\x20\x20\x20'+a35_0x5b2343['yellow']('~\x20'+_0x3cc3e4[_0x488617(0xdb)]+'\x20to\x20update')),_0x47e87f[_0x488617(0xdb)]>0x0&&console['error'](_0x488617(0x7e)+a35_0x5b2343[_0x488617(0xc4)]('-\x20'+_0x47e87f[_0x488617(0xdb)]+_0x488617(0xc3))));console[_0x488617(0xed)](_0x488617(0x101)+a35_0x5b2343['cyan'](_0xd1ce9e)+'\x0a');if(_0x21e4ab[_0x488617(0xdb)]>0x0){console[_0x488617(0xed)]('Folders\x20to\x20create:');for(const _0x3c6479 of _0x21e4ab){console[_0x488617(0xed)]('\x20\x20'+a35_0x5b2343['blue']('+')+'\x20'+_0x3c6479);}console[_0x488617(0xed)]('');}if(_0x145681['length']>0x0&&!_0x2d9c1f[_0x488617(0xe9)])for(const _0x297fee of _0x145681){const _0x547425=_0x297fee['folderPath']?_0x297fee[_0x488617(0xba)]+'/'+_0x297fee[_0x488617(0x112)][_0x488617(0x9e)]:_0x297fee[_0x488617(0x112)][_0x488617(0x9e)],_0x1b1aca=_0x297fee[_0x488617(0x112)]['activations']?.[_0x488617(0xdb)]||0x0,_0x5ac938=_0x1b1aca>0x0?a35_0x5b2343[_0x488617(0xbb)]('\x20['+_0x1b1aca+_0x488617(0xd1)):'';console['error']('\x0a'+a35_0x5b2343['green'](_0x488617(0x7d))+'\x20'+_0x547425+_0x5ac938),console['error']('─'[_0x488617(0x9a)](0x3c)),_0x297fee[_0x488617(0xec)]&&console[_0x488617(0xed)](_0x297fee[_0x488617(0xec)]),console[_0x488617(0xed)]('─'[_0x488617(0x9a)](0x3c));}if(_0x43b62e[_0x488617(0xdb)]>0x0&&!_0x2d9c1f[_0x488617(0xe9)])for(const _0x589594 of _0x43b62e){const _0x3dd767=_0x589594[_0x488617(0xa0)]?_0x1993b7[_0x488617(0xc9)](_0x589594['segmentFolderId'][_0x488617(0xdd)]())||'':'',_0x4c0802=_0x3dd767?_0x3dd767+'/'+_0x589594[_0x488617(0x9e)]:_0x589594[_0x488617(0x9e)],_0x5e2523=_0x3787c0[_0x488617(0xc9)](_0x589594['id'])||[],_0x455ec0=_0x5e2523[_0x488617(0xdb)]>0x0?a35_0x5b2343[_0x488617(0xbb)]('\x20['+_0x5e2523[_0x488617(0xdb)]+_0x488617(0xd1)):'';console[_0x488617(0xed)]('\x0a'+a35_0x5b2343[_0x488617(0xc4)](_0x488617(0x7b))+'\x20'+_0x4c0802+_0x455ec0),console[_0x488617(0xed)]('─'['repeat'](0x3c));const _0x2c8f6b=segmentWithActivationsToYaml(_0x589594,_0x5e2523,undefined,_0x46c3f0,_0x2e5030),_0x19d858=segmentToYamlString(_0x2c8f6b),_0x15931a=generateDiff(_0x19d858,'');console[_0x488617(0xed)](formatDiffWithColors(_0x15931a)),console['error']('─'[_0x488617(0x9a)](0x3c));}const _0xcbe098=_0x9781fc[_0x488617(0xae)](_0x2406fb=>!_0x2406fb['isNew']&&_0x2406fb[_0x488617(0xec)]);if(_0xcbe098['length']>0x0&&!_0x2d9c1f['journeysOnly'])for(const _0x466859 of _0xcbe098){const _0x278688=_0x466859['folderPath']?_0x466859[_0x488617(0xba)]+'/'+_0x466859[_0x488617(0x112)]['name']:_0x466859[_0x488617(0x112)]['name'];console[_0x488617(0xed)]('\x0a'+a35_0x5b2343[_0x488617(0xc7)]('Changes\x20to:')+'\x20'+_0x278688),console[_0x488617(0xed)]('─'[_0x488617(0x9a)](0x3c)),console[_0x488617(0xed)](_0x466859[_0x488617(0xec)]),console[_0x488617(0xed)]('─'[_0x488617(0x9a)](0x3c));}if(_0x523365[_0x488617(0xdb)]>0x0)for(const _0x28ed62 of _0x523365){const _0x4ba179=_0x28ed62[_0x488617(0xba)]?_0x28ed62[_0x488617(0xba)]+'/'+_0x28ed62[_0x488617(0x112)][_0x488617(0x9e)]:_0x28ed62[_0x488617(0x112)]['name'];console['error']('\x0a'+a35_0x5b2343[_0x488617(0x10d)](_0x488617(0xa2))+'\x20'+_0x4ba179),console[_0x488617(0xed)]('─'[_0x488617(0x9a)](0x3c)),_0x28ed62[_0x488617(0xec)]&&console['error'](_0x28ed62[_0x488617(0xec)]),console[_0x488617(0xed)]('─'[_0x488617(0x9a)](0x3c));}const _0x2c88b5=_0x2f9bc6['filter'](_0x173031=>!_0x173031[_0x488617(0xe4)]&&_0x173031[_0x488617(0xec)]);if(_0x2c88b5['length']>0x0)for(const _0x2506e7 of _0x2c88b5){const _0x554438=_0x2506e7[_0x488617(0xba)]?_0x2506e7[_0x488617(0xba)]+'/'+_0x2506e7[_0x488617(0x112)][_0x488617(0x9e)]:_0x2506e7['yamlConfig'][_0x488617(0x9e)];console[_0x488617(0xed)]('\x0a'+a35_0x5b2343['yellow'](_0x488617(0x9b))+'\x20'+_0x554438),console['error']('─'[_0x488617(0x9a)](0x3c)),console['error'](_0x2506e7[_0x488617(0xec)]),console['error']('─'['repeat'](0x3c));}if(_0x1db665[_0x488617(0xdb)]>0x0)for(const _0x523b5e of _0x1db665){const _0x28d658=_0x523b5e[_0x488617(0x93)]?_0x1993b7['get'](_0x523b5e[_0x488617(0x93)])||'':'',_0x5b10d8=_0x28d658?_0x28d658+'/'+_0x523b5e[_0x488617(0x77)]:_0x523b5e[_0x488617(0x77)];console['error']('\x0a'+a35_0x5b2343['red'](_0x488617(0xdc))+'\x20'+_0x5b10d8),console[_0x488617(0xed)]('─'['repeat'](0x3c)),console[_0x488617(0xed)](a35_0x5b2343['red'](_0x488617(0x83))),console[_0x488617(0xed)]('─'[_0x488617(0x9a)](0x3c));}if(_0x2d9c1f[_0x488617(0xa9)])return console[_0x488617(0xed)](a35_0x5b2343[_0x488617(0xc7)](_0x488617(0x88))),0x0;const _0x1c8e1e=_0x2d9c1f[_0x488617(0xe9)]?![]:_0x145681[_0x488617(0xdb)]>0x0||_0x1d5b7a[_0x488617(0xdb)]>0x0||_0x43b62e[_0x488617(0xdb)]>0x0,_0xca5a32=_0x523365[_0x488617(0xdb)]>0x0||_0x26e1b8[_0x488617(0xdb)]>0x0||_0x1db665['length']>0x0,_0x2dafee=_0x2d9c1f['journeysOnly']?![]:_0xaa3ae9[_0x488617(0xdb)]>0x0,_0x47dd2f=_0x21e4ab[_0x488617(0xdb)]>0x0;if(!_0x1c8e1e&&!_0xca5a32&&!_0x2dafee&&!_0x47dd2f){const _0x52f5f6=_0x2d9c1f[_0x488617(0xe9)]?_0x488617(0xf4):_0x488617(0xde);console['error'](a35_0x5b2343[_0x488617(0x10d)](_0x52f5f6));if(_0xb15075&&_0x210462[_0x488617(0xdb)]===0x1){const _0x3057ba=_0x210462[0x0];if(_0x3057ba[_0x488617(0xf9)]?.['id']){const _0x31c8ed=getConsoleNextUrl(_0x2d9c1f[_0x488617(0x86)],_0x488617(0xd6)+_0x3a0a31+_0x488617(0x82)+_0x3057ba[_0x488617(0xf9)]['id']+_0x488617(0x97));console['error']('\x20\x20'+a35_0x5b2343[_0x488617(0xb6)](_0x31c8ed));}}return 0x0;}const _0x52c26f=_0x2d9c1f[_0x488617(0xe9)]?_0x523365['length']+_0x26e1b8[_0x488617(0xdb)]+_0x1db665[_0x488617(0xdb)]+_0x21e4ab[_0x488617(0xdb)]:_0x145681[_0x488617(0xdb)]+_0x1d5b7a['length']+_0x43b62e[_0x488617(0xdb)]+_0x523365[_0x488617(0xdb)]+_0x26e1b8[_0x488617(0xdb)]+_0x1db665[_0x488617(0xdb)]+_0x21e4ab['length']+_0xaa3ae9[_0x488617(0xdb)];if(!_0x2d9c1f['yes']&&_0x52c26f>0x0){if(!isInteractive())return console['error'](a35_0x5b2343[_0x488617(0xc4)](_0x488617(0x84)),_0x488617(0x91)),console['error'](a35_0x5b2343['dim']('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x528ff5=await confirmKey(_0x488617(0xa6)+_0x52c26f+_0x488617(0xda));if(!_0x528ff5)return console['error'](a35_0x5b2343[_0x488617(0xc7)](_0x488617(0xa5))),0x1;}const _0x5a98d8={'withProgress':async(_0x3db936,_0x56e679)=>{const _0x52ea3e=_0x488617,_0x5a5d2b=await withSpinner(_0x3db936,_0x56e679,{'verbose':_0x2d9c1f[_0x52ea3e(0xe6)]});return{'data':_0x5a5d2b[_0x52ea3e(0xe7)]};},'logInfo':_0x1cbbf1=>console[_0x488617(0xed)](a35_0x5b2343[_0x488617(0xee)]('✔\x20'+_0x1cbbf1)),'logSuccess':_0x445c00=>console[_0x488617(0xed)](a35_0x5b2343[_0x488617(0x10d)]('✔\x20'+_0x445c00)),'logWarning':_0x4b0195=>console[_0x488617(0xed)](a35_0x5b2343[_0x488617(0xc7)]('⚠\x20'+_0x4b0195)),'logDeleted':_0x11f920=>console[_0x488617(0xed)](a35_0x5b2343['red']('✔\x20'+_0x11f920))},_0x401820={'segment':_0x2a260a['segment'],'journey':_0x2a260a[_0x488617(0x108)],'user':_0x2a260a[_0x488617(0x113)],'connection':_0x2a260a['connection']};_0x21e4ab['length']>0x0&&(_0x4eca28=await executePushFolders(_0x401820,_0x21e4ab,_0x4eca28,{'parentId':_0x3a0a31},_0x5a98d8));const _0x2c8550={'rootFolderId':_0x3cf8b2,'folderPathToId':_0x4eca28,'folderIdToPath':_0x1993b7,'segmentNameToId':_0x5e7f5e,'activationsBySegmentId':_0x3787c0,'emailToIdMap':_0x2af0da,'idToEmailMap':_0x46c3f0,'connectionNameToIdMap':_0x2628ac[_0x488617(0xcf)],'connectionIdToNameMap':_0x2628ac['idToName'],'connectionNameToTypeMap':_0x1d55cc},_0x4f6d19=await executePushSegments(_0x401820,_0x2d9c1f['journeysOnly']?[]:_0x9781fc,_0x2c8550,{'parentId':_0x3a0a31},_0x5a98d8),_0xff3dd7=_0x4f6d19['created'],_0x92f4cc=_0x4f6d19['updated'],_0x1e6d7c=_0x4f6d19[_0x488617(0xfe)][_0x488617(0xaf)],_0x22c07b=_0x4f6d19[_0x488617(0xfe)][_0x488617(0xbd)],_0x362e17=_0x4f6d19[_0x488617(0xfe)][_0x488617(0x7c)],_0x38415f=await executePushSegmentDeletions(_0x401820,_0x2d9c1f[_0x488617(0xe9)]?[]:_0x43b62e,_0x5a98d8);let _0xab4f74=0x0,_0x4641f7=0x0,_0x1db8fa=0x0;const _0x21481e=new Map(_0x5e7f5e);for(const [_0x599dde,_0x21b122]of _0x4f6d19[_0x488617(0xce)]){_0x21481e['set'](_0x599dde,_0x21b122);}if(_0x2f9bc6[_0x488617(0xdb)]>0x0){const _0x21d77c={..._0x2c8550,'segmentNameToId':_0x21481e,'existingSegments':_0x595c25,'activationContext':_0x46c526},_0x1a3ee8=await executePushJourneys(_0x401820,_0x2f9bc6,_0x21d77c,{'parentId':_0x3a0a31,'rootFolderId':_0x3cf8b2,'verbose':_0x2d9c1f[_0x488617(0xe6)]},_0x5a98d8);_0xab4f74=_0x1a3ee8['created'],_0x4641f7=_0x1a3ee8[_0x488617(0xbd)];if(_0xb15075&&_0x1a3ee8[_0x488617(0xfd)]['length']===0x1){const _0x24b1f6=_0x1a3ee8[_0x488617(0xfd)][0x0];if(_0x24b1f6[_0x488617(0xcc)]){const _0x12fa05=getConsoleNextUrl(_0x2d9c1f[_0x488617(0x86)],_0x488617(0xd6)+_0x3a0a31+'/e/'+_0x24b1f6[_0x488617(0xcc)]+'/j/da/je');console[_0x488617(0xed)]('\x20\x20'+a35_0x5b2343['cyan'](_0x12fa05));}}}for(const _0x2f9fc9 of _0x1db665){console['error'](a35_0x5b2343[_0x488617(0xc7)]('⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20'+_0x2f9fc9['journeyBundleName'])),_0x1db8fa++;}const _0x4b81d6=[];if(_0xff3dd7>0x0)_0x4b81d6[_0x488617(0xb7)](_0xff3dd7+_0x488617(0x106));if(_0x92f4cc>0x0)_0x4b81d6[_0x488617(0xb7)](_0x92f4cc+_0x488617(0xf7));if(_0x38415f>0x0)_0x4b81d6[_0x488617(0xb7)](_0x38415f+_0x488617(0x80));const _0x173877=[];if(_0xab4f74>0x0)_0x173877[_0x488617(0xb7)](_0xab4f74+_0x488617(0x106));if(_0x4641f7>0x0)_0x173877[_0x488617(0xb7)](_0x4641f7+'\x20updated');if(_0x1db8fa>0x0)_0x173877['push'](_0x1db8fa+_0x488617(0x80));const _0x121bcf=[];if(_0x1e6d7c>0x0)_0x121bcf['push'](_0x1e6d7c+_0x488617(0x106));if(_0x22c07b>0x0)_0x121bcf[_0x488617(0xb7)](_0x22c07b+'\x20updated');if(_0x362e17>0x0)_0x121bcf['push'](_0x362e17+_0x488617(0x80));return console[_0x488617(0xed)](a35_0x5b2343[_0x488617(0x10d)](_0x488617(0xc8))),_0x4b81d6['length']>0x0&&!_0x2d9c1f[_0x488617(0xe9)]&&console[_0x488617(0xed)]('\x20\x20Segments:\x20'+_0x4b81d6[_0x488617(0x8e)](',\x20')),_0x173877[_0x488617(0xdb)]>0x0&&console['error'](_0x488617(0xc0)+_0x173877['join'](',\x20')),_0x121bcf[_0x488617(0xdb)]>0x0&&!_0x2d9c1f[_0x488617(0xe9)]&&console[_0x488617(0xed)](_0x488617(0x78)+_0x121bcf[_0x488617(0x8e)](',\x20')),0x0;}}