@treasuredata/tdx 2026.3.12 → 2026.3.14

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 (201) 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/auth-login-command.js +1 -1
  11. package/dist/commands/chat-command.js +1 -1
  12. package/dist/commands/claude-command.js +1 -1
  13. package/dist/commands/claude-statusline-command.js +1 -1
  14. package/dist/commands/claude-usage-command.js +1 -1
  15. package/dist/commands/command.js +1 -1
  16. package/dist/commands/connection-command.js +1 -1
  17. package/dist/commands/databases.js +1 -1
  18. package/dist/commands/delivery-command.js +1 -1
  19. package/dist/commands/describe.js +1 -1
  20. package/dist/commands/engage-campaign-pull-command.js +1 -1
  21. package/dist/commands/engage-campaign-push-command.js +1 -1
  22. package/dist/commands/engage-campaign-validate-command.js +1 -1
  23. package/dist/commands/engage-command.js +1 -1
  24. package/dist/commands/engage-template-pull-command.js +1 -1
  25. package/dist/commands/engage-template-push-command.js +1 -1
  26. package/dist/commands/engage-template-validate-command.js +1 -1
  27. package/dist/commands/job-command.js +1 -1
  28. package/dist/commands/journey-command.js +1 -1
  29. package/dist/commands/journey-validate-command.js +1 -1
  30. package/dist/commands/llm-command.js +1 -1
  31. package/dist/commands/mcp-command.js +1 -1
  32. package/dist/commands/parent-segment-command.js +1 -1
  33. package/dist/commands/profile-command.js +1 -1
  34. package/dist/commands/profiles-command.js +1 -1
  35. package/dist/commands/query-command.js +1 -1
  36. package/dist/commands/schedule-command.js +1 -1
  37. package/dist/commands/segment-command.js +1 -1
  38. package/dist/commands/segment-create-command.js +1 -1
  39. package/dist/commands/segment-fields-command.js +1 -1
  40. package/dist/commands/segment-pull-command.js +1 -1
  41. package/dist/commands/segment-push-command.js +1 -1
  42. package/dist/commands/segment-update-command.js +1 -1
  43. package/dist/commands/segment-use-command.js +1 -1
  44. package/dist/commands/segment-validate-command.js +1 -1
  45. package/dist/commands/segments.js +1 -1
  46. package/dist/commands/show.js +1 -1
  47. package/dist/commands/status-command.js +1 -1
  48. package/dist/commands/tables.js +1 -1
  49. package/dist/commands/unset-command.js +1 -1
  50. package/dist/commands/upgrade-command.js +1 -1
  51. package/dist/commands/use-command.js +1 -1
  52. package/dist/commands/user-command.js +1 -1
  53. package/dist/commands/workflow-command.js +1 -1
  54. package/dist/core/auth.js +1 -1
  55. package/dist/core/command-output.js +1 -1
  56. package/dist/core/config.js +1 -1
  57. package/dist/core/connection-cache.js +1 -1
  58. package/dist/core/constants.js +1 -1
  59. package/dist/core/credential-cache.js +1 -1
  60. package/dist/core/global-context.js +1 -1
  61. package/dist/core/keychain.js +1 -1
  62. package/dist/core/oauth-keychain.js +1 -1
  63. package/dist/core/oauth.js +1 -1
  64. package/dist/core/profile.js +1 -1
  65. package/dist/core/project-config.js +1 -1
  66. package/dist/core/session.js +1 -1
  67. package/dist/core/user-cache.js +1 -1
  68. package/dist/core/version.js +1 -1
  69. package/dist/index.js +1 -1
  70. package/dist/mcp/server.js +1 -1
  71. package/dist/mcp/tools/index.js +1 -1
  72. package/dist/mcp/tools/tdx-run.js +1 -1
  73. package/dist/mcp/tools/tdx-search.js +1 -1
  74. package/dist/mcp/utils.js +1 -1
  75. package/dist/proxy/claude-usage-tracker.js +1 -1
  76. package/dist/proxy/passthrough-server.js +1 -1
  77. package/dist/proxy/sse-usage-parser.js +1 -1
  78. package/dist/sdk/agent/agent-config.js +1 -1
  79. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  80. package/dist/sdk/agent/agent-yaml.js +1 -1
  81. package/dist/sdk/agent/test/evaluator.js +1 -1
  82. package/dist/sdk/agent/test/executor.js +1 -1
  83. package/dist/sdk/agent/test/index.js +1 -1
  84. package/dist/sdk/agent/test/output.js +1 -1
  85. package/dist/sdk/agent/test/parser.js +1 -1
  86. package/dist/sdk/agent/tool-target-registry.js +1 -1
  87. package/dist/sdk/api.js +1 -1
  88. package/dist/sdk/client/cdp-api-client.js +1 -1
  89. package/dist/sdk/client/delivery-api-client.js +1 -1
  90. package/dist/sdk/client/endpoints.js +1 -1
  91. package/dist/sdk/client/engage-api-client.js +1 -1
  92. package/dist/sdk/client/http-client.js +1 -1
  93. package/dist/sdk/client/llm-api-client.js +1 -1
  94. package/dist/sdk/client/oauth-refresh.js +1 -1
  95. package/dist/sdk/client/rate-limiter.js +1 -1
  96. package/dist/sdk/client/td-api-client.js +1 -1
  97. package/dist/sdk/client/trino-api-client.js +1 -1
  98. package/dist/sdk/client/workflow-client.js +1 -1
  99. package/dist/sdk/connection-validator.js +1 -1
  100. package/dist/sdk/connection.js +1 -1
  101. package/dist/sdk/delivery.js +1 -1
  102. package/dist/sdk/engage/campaign-pull.js +1 -1
  103. package/dist/sdk/engage/campaign-push.js +1 -1
  104. package/dist/sdk/engage/campaign-validator.js +1 -1
  105. package/dist/sdk/engage/campaign-yaml.js +1 -1
  106. package/dist/sdk/engage/template-pull.js +1 -1
  107. package/dist/sdk/engage/template-push.js +1 -1
  108. package/dist/sdk/engage/template-validator.js +1 -1
  109. package/dist/sdk/engage/template-yaml.js +1 -1
  110. package/dist/sdk/engage/types/campaign-def.js +1 -1
  111. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  112. package/dist/sdk/engage/types/template-schema.js +1 -1
  113. package/dist/sdk/engage.js +1 -1
  114. package/dist/sdk/errors.js +1 -1
  115. package/dist/sdk/index.js +1 -1
  116. package/dist/sdk/io/index.js +1 -1
  117. package/dist/sdk/io/node-filesystem.js +1 -1
  118. package/dist/sdk/job.js +1 -1
  119. package/dist/sdk/journey.js +1 -1
  120. package/dist/sdk/llm/chat-cache.js +1 -1
  121. package/dist/sdk/llm/index.js +1 -1
  122. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  123. package/dist/sdk/llm/model-factors.js +1 -1
  124. package/dist/sdk/personalization.js +1 -1
  125. package/dist/sdk/query/index.js +1 -1
  126. package/dist/sdk/query/sql-parser.js +1 -1
  127. package/dist/sdk/realtime.js +1 -1
  128. package/dist/sdk/schedule.js +1 -1
  129. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  130. package/dist/sdk/segment/fields-display.js +1 -1
  131. package/dist/sdk/segment/file-discovery.js +1 -1
  132. package/dist/sdk/segment/journey-utils.js +1 -1
  133. package/dist/sdk/segment/journey-validator.js +1 -1
  134. package/dist/sdk/segment/journey-yaml.js +1 -1
  135. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  136. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  137. package/dist/sdk/segment/pull-workflow.js +1 -1
  138. package/dist/sdk/segment/push-recovery.js +1 -1
  139. package/dist/sdk/segment/push-workflow.js +1 -1
  140. package/dist/sdk/segment/resolution-context.js +1 -1
  141. package/dist/sdk/segment/segment-path-parser.js +1 -1
  142. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  143. package/dist/sdk/segment/segment-validator.js +1 -1
  144. package/dist/sdk/segment/target-resolution.js +1 -1
  145. package/dist/sdk/segment/tdx-config.js +1 -1
  146. package/dist/sdk/segment/types/activation-schema.js +1 -1
  147. package/dist/sdk/segment/types/journey-def.js +1 -1
  148. package/dist/sdk/segment/types/journey-schema.js +1 -1
  149. package/dist/sdk/segment/types/segment-def.js +1 -1
  150. package/dist/sdk/segment/types/segment-schema.js +1 -1
  151. package/dist/sdk/segment/validate-files.js +1 -1
  152. package/dist/sdk/segment/yaml-validator.js +1 -1
  153. package/dist/sdk/segment.js +1 -1
  154. package/dist/sdk/types/index.js +1 -1
  155. package/dist/sdk/types/progress.js +1 -1
  156. package/dist/sdk/user.js +1 -1
  157. package/dist/sdk/util/format-detector.js +1 -1
  158. package/dist/sdk/util/formatters.js +1 -1
  159. package/dist/sdk/util/index.js +1 -1
  160. package/dist/sdk/util/paginate.js +1 -1
  161. package/dist/sdk/util/tree-formatter.js +1 -1
  162. package/dist/sdk/workflow/archive-validation.js +1 -1
  163. package/dist/sdk/workflow/clone-workflow.js +1 -1
  164. package/dist/sdk/workflow/index.js +1 -1
  165. package/dist/sdk/workflow/pull-workflow.js +1 -1
  166. package/dist/sdk/workflow/push-workflow.js +1 -1
  167. package/dist/sdk/workflow/tdx-config.js +1 -1
  168. package/dist/sdk/workflow/workflow-utils.js +1 -1
  169. package/dist/test-utils/command-runner.js +1 -1
  170. package/dist/test-utils/factories.js +1 -1
  171. package/dist/test-utils/fixtures.js +1 -1
  172. package/dist/test-utils/http-mock.js +1 -1
  173. package/dist/test-utils/index.js +1 -1
  174. package/dist/utils/async.js +1 -1
  175. package/dist/utils/colors.js +1 -1
  176. package/dist/utils/diff.js +1 -1
  177. package/dist/utils/file-permissions.js +1 -1
  178. package/dist/utils/file-reader.js +1 -1
  179. package/dist/utils/github-releases.js +1 -1
  180. package/dist/utils/global-cache.js +1 -1
  181. package/dist/utils/json-loader.js +1 -1
  182. package/dist/utils/local-cache.js +1 -1
  183. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  184. package/dist/utils/logger/formatters/index.js +1 -1
  185. package/dist/utils/logger/handlers/console-handler.js +1 -1
  186. package/dist/utils/logger/handlers/file-handler.js +1 -1
  187. package/dist/utils/logger/handlers/index.js +1 -1
  188. package/dist/utils/logger/handlers/null-handler.js +1 -1
  189. package/dist/utils/logger/index.js +1 -1
  190. package/dist/utils/logger/logger.js +1 -1
  191. package/dist/utils/logger/types.js +1 -1
  192. package/dist/utils/option-validation.js +1 -1
  193. package/dist/utils/process.js +1 -1
  194. package/dist/utils/prompt.js +1 -1
  195. package/dist/utils/spinner.js +1 -1
  196. package/dist/utils/sse-parser.js +1 -1
  197. package/dist/utils/string-utils.js +1 -1
  198. package/dist/utils/table-ref-parser.js +1 -1
  199. package/dist/utils/tdx-logger.js +1 -1
  200. package/dist/utils/version-check.js +1 -1
  201. package/package.json +1 -1
@@ -1 +1 @@
1
- const a34_0x33a2e9=a34_0x4f62;(function(_0x3ace69,_0x15c554){const _0x25db01=a34_0x4f62,_0x1a3369=_0x3ace69();while(!![]){try{const _0x44b53f=-parseInt(_0x25db01(0x9c))/0x1*(-parseInt(_0x25db01(0x6c))/0x2)+-parseInt(_0x25db01(0xa0))/0x3*(-parseInt(_0x25db01(0x96))/0x4)+parseInt(_0x25db01(0xd9))/0x5*(-parseInt(_0x25db01(0xea))/0x6)+parseInt(_0x25db01(0xca))/0x7*(parseInt(_0x25db01(0xaa))/0x8)+parseInt(_0x25db01(0xa1))/0x9*(parseInt(_0x25db01(0xec))/0xa)+parseInt(_0x25db01(0xdc))/0xb*(-parseInt(_0x25db01(0xf4))/0xc)+parseInt(_0x25db01(0xfc))/0xd*(parseInt(_0x25db01(0xc2))/0xe);if(_0x44b53f===_0x15c554)break;else _0x1a3369['push'](_0x1a3369['shift']());}catch(_0x172aa0){_0x1a3369['push'](_0x1a3369['shift']());}}}(a34_0xd7e3,0x63440));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 a34_0xd7e3(){const _0x33c36f=['tsv','delay','2VqzduK','timezone','queryUrl','utf-8','show','\x20\x20Type:\x20','schedule:run','length','schedule:show','Schedule\x20deleted:\x20','dim','keys','\x20schedules','time','user','\x20execution','Updating\x20schedule:\x20','scheduled_at','Show\x20schedule\x20execution\x20history','file','\x20\x20Num:\x20','verbose','num','trino','abs','from','\x20matching\x20\x22','...','\x20\x20Job\x20ID:\x20','output','ended_at','just\x20now','Showing\x20first\x20','listQueries','m\x20ago','\x20\x20→\x20','format','Schedule\x20created:\x20','engineVersion','name','\x20(showing\x20','cron','8QkPDNx','list','schedule:delete','end_at','type','next_run_at','65659ZmeJHQ','database','pagination','entries','101922MUAAHO','9dUbUeR','Schedule\x20run\x20submitted:\x20','result','toLocaleDateString','jsonl','INVALID_ARGUMENT','Creating\x20schedule...','error','limit','8aYaioj','never','history','schedule:create','green','args','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20schedule\x20\x22','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20create\x20<name>\x20-d\x20<db>\x20--file\x20<path>\x20[options]','validate','has_next_page','log','substring','schedule:update','queries','Found\x20','in\x20','join','Database\x20is\x20required\x0aUsage:\x20job\x20schedule\x20create\x20<name>\x20-d\x20<db>\x20--file\x20<path>\x20[options]','Running\x20schedule...','priority','schedule:list','Run\x20a\x20scheduled\x20query\x20immediately','data','success','14IdZvpB','At\x20least\x20one\x20option\x20must\x20be\x20provided\x20to\x20update','retry_limit','Show\x20schedule\x20details','Cancelled','execute','created_at','trim','5253199xcwFhY','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20history\x20<name>\x20[--from\x20<n>]\x20[--to\x20<n>]','Getting\x20schedule\x20details...','getTime','job_id','Query\x20file\x20is\x20empty','\x20\x20Database:\x20','schedule:history','d\x20ago','Create\x20a\x20scheduled\x20query','Deleting\x20schedule...','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20update\x20<name>\x20[options]','max','/app/queries/editor?queryId=','\x20\x20Timezone:\x20','10cJzLey','jobs','List\x20scheduled\x20queries','11Glwnkg','delete','h\x20ago','count','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20show\x20<name>','schedules','site','Delete\x20a\x20scheduled\x20query','nextRun','last_job','lastRun','start_at','Failed\x20to\x20read\x20file:\x20','query','1565538HSEdXe','round','260560rZiVtd','map','Getting\x20schedule\x20history...','create','retryLimit','\x20created','description','status','5409588MgboUF','Update\x20a\x20scheduled\x20query','Creating\x20schedule:\x20','Searching\x20scheduled\x20queries\x20matching\x20\x22','padEnd','run','\x20job','statusIcon','6098521bknFbw','update'];a34_0xd7e3=function(){return _0x33c36f;};return a34_0xd7e3();}function a34_0x4f62(_0x529f67,_0x59c370){_0x529f67=_0x529f67-0x69;const _0xd7e349=a34_0xd7e3();let _0x4f6257=_0xd7e349[_0x529f67];return _0x4f6257;}import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{hyperlink}from'../sdk/util/formatters.js';import a34_0x19a858 from'chalk';function formatRelativeTime(_0x880bc0){const _0x35fc07=a34_0x4f62,_0x4141e0=new Date(_0x880bc0),_0x25b3ac=new Date(),_0x51e13c=_0x4141e0[_0x35fc07(0xcd)]()-_0x25b3ac[_0x35fc07(0xcd)](),_0x31d6e2=Math[_0x35fc07(0x84)](_0x51e13c)/0x3e8,_0x1fb920=_0x51e13c<0x0;if(_0x31d6e2<0x3c)return _0x1fb920?_0x35fc07(0x8b):'soon';else{if(_0x31d6e2<0xe10){const _0x3888ce=Math[_0x35fc07(0xeb)](_0x31d6e2/0x3c);return _0x1fb920?_0x3888ce+_0x35fc07(0x8e):_0x35fc07(0xb9)+_0x3888ce+'m';}else{if(_0x31d6e2<0x15180){const _0x11f806=Math['round'](_0x31d6e2/0xe10);return _0x1fb920?_0x11f806+_0x35fc07(0xde):'in\x20'+_0x11f806+'h';}else{if(_0x31d6e2<0x93a80){const _0x4fd5f4=Math[_0x35fc07(0xeb)](_0x31d6e2/0x15180);return _0x1fb920?_0x4fd5f4+_0x35fc07(0xd2):'in\x20'+_0x4fd5f4+'d';}else return _0x4141e0[_0x35fc07(0xa4)]();}}}}export class ScheduleListCommand extends BaseCommand{[a34_0x33a2e9(0x93)]=a34_0x33a2e9(0xbe);[a34_0x33a2e9(0xf2)]=a34_0x33a2e9(0xdb);async[a34_0x33a2e9(0xc7)](_0x3ff6f0){const _0x25898d=a34_0x33a2e9,{options:_0x26e50a,args:_0x15afdc,tdx:_0x520b98}=_0x3ff6f0,_0x23f173=resolveLimit(_0x26e50a[_0x25898d(0xa9)],DEFAULT_DISPLAY_LIMIT),_0x93326c=_0x15afdc[0x0],_0x355c52=_0x93326c?_0x25898d(0xf7)+_0x93326c+'\x22...':'Listing\x20scheduled\x20queries...',_0x289da7=await withSpinner(_0x355c52,()=>_0x520b98[_0x25898d(0xe1)][_0x25898d(0x8d)]({'limit':_0x23f173,'scheduled':!![],'pattern':_0x93326c}),{'verbose':_0x26e50a[_0x25898d(0x81)]}),_0x45a504=_0x289da7[_0x25898d(0xc0)][_0x25898d(0xb7)],_0x55e56e=_0x289da7[_0x25898d(0xc0)][_0x25898d(0x9e)][_0x25898d(0xb3)],_0x2b1426=_0x93326c?_0x25898d(0x86)+_0x93326c+'\x22':'';_0x55e56e?console['error'](_0x25898d(0x8c)+_0x45a504['length']+_0x25898d(0x78)+_0x2b1426+'\x20(use\x20--limit\x20to\x20see\x20more)'):console[_0x25898d(0xa8)](_0x25898d(0xb8)+_0x45a504[_0x25898d(0x73)]+'\x20scheduled\x20quer'+(_0x45a504[_0x25898d(0x73)]!==0x1?'ies':'y')+_0x2b1426);if(_0x26e50a[_0x25898d(0x90)]==='json'||_0x26e50a[_0x25898d(0x90)]===_0x25898d(0xa5)||_0x26e50a[_0x25898d(0x90)]==='table'||_0x26e50a[_0x25898d(0x90)]===_0x25898d(0x6a)){const _0x25549e=_0x45a504[_0x25898d(0xed)](_0x756bd=>({'id':_0x756bd['id'],'name':_0x756bd[_0x25898d(0x93)],'cron':_0x756bd[_0x25898d(0x95)],'database':_0x756bd['database']?.['name'],'type':_0x756bd[_0x25898d(0x9a)],'timezone':_0x756bd['time_zone'],'user_name':_0x756bd[_0x25898d(0x7a)]?.['name'],'updated_at':_0x756bd['updated_at'],'next_run_at':_0x756bd[_0x25898d(0x9b)],'last_job_status':_0x756bd[_0x25898d(0xe5)]?.[_0x25898d(0xf3)]}));await handleSDKOutput(_0x25549e,_0x26e50a);}else{if(_0x45a504[_0x25898d(0x73)]===0x0)console[_0x25898d(0xb4)]('No\x20scheduled\x20queries\x20found');else{const _0x16c56d=_0x26e50a[_0x25898d(0xe2)],_0x2ad995=_0x45a504[_0x25898d(0xed)](_0x1dedde=>{const _0x5f2263=_0x25898d,_0x38a50e=_0x1dedde[_0x5f2263(0xe5)]?.['status']?_0x1dedde[_0x5f2263(0xe5)][_0x5f2263(0xf3)]==='success'?'✓':'✗':'-',_0x1515bb=_0x1dedde[_0x5f2263(0xe5)]?.[_0x5f2263(0x8a)]?formatRelativeTime(_0x1dedde[_0x5f2263(0xe5)][_0x5f2263(0x8a)]):_0x5f2263(0xab),_0x4f0edd=_0x1dedde['next_run_at']?formatRelativeTime(_0x1dedde[_0x5f2263(0x9b)]):'-',_0x65956e=_0x1dedde['cron']||'',_0x1496dc=_0x1dedde[_0x5f2263(0x93)]||'(unnamed)',_0x35529e=getConsoleUrl(_0x16c56d,_0x5f2263(0xd7)+_0x1dedde['id']);return{'statusIcon':_0x38a50e,'lastRun':_0x1515bb,'nextRun':_0x4f0edd,'cron':_0x65956e,'name':_0x1496dc,'queryUrl':_0x35529e,'status':_0x1dedde[_0x5f2263(0xe5)]?.[_0x5f2263(0xf3)]};}),_0x57869f=Math[_0x25898d(0xd6)](..._0x2ad995[_0x25898d(0xed)](_0x2e20a8=>_0x2e20a8[_0x25898d(0xe6)]['length'])),_0x550cca=Math['max'](..._0x2ad995[_0x25898d(0xed)](_0x4a5848=>_0x4a5848['nextRun'][_0x25898d(0x73)])),_0x5a55ba=Math[_0x25898d(0xd6)](..._0x2ad995[_0x25898d(0xed)](_0x2d9da1=>_0x2d9da1[_0x25898d(0x95)][_0x25898d(0x73)])),_0x59e926=_0x2ad995[_0x25898d(0xed)](_0x2c95d6=>{const _0x197476=_0x25898d,_0x1042fe=_0x2c95d6[_0x197476(0xf3)]===_0x197476(0xc1)?a34_0x19a858[_0x197476(0xae)](_0x2c95d6[_0x197476(0xfb)]):_0x2c95d6['status']===_0x197476(0xa8)?a34_0x19a858['red'](_0x2c95d6['statusIcon']):a34_0x19a858[_0x197476(0x76)](_0x2c95d6[_0x197476(0xfb)]),_0x5f5b4c=_0x2c95d6['lastRun']['padEnd'](_0x57869f),_0xb01175=_0x2c95d6[_0x197476(0xe4)][_0x197476(0xf8)](_0x550cca),_0x2a350d=_0x2c95d6[_0x197476(0x95)]?a34_0x19a858['cyan'](_0x2c95d6['cron'][_0x197476(0xf8)](_0x5a55ba)):'\x20'['repeat'](_0x5a55ba),_0x4f984b=hyperlink(_0x2c95d6[_0x197476(0x93)],_0x2c95d6[_0x197476(0x6e)]);return'📅\x20'+_0x1042fe+'\x20'+_0x5f5b4c+_0x197476(0x8f)+_0xb01175+'\x20\x20'+_0x2a350d+'\x20\x20'+_0x4f984b;});await writeOutput(_0x59e926[_0x25898d(0xba)]('\x0a'),_0x26e50a[_0x25898d(0x89)],_0x25898d(0x97));}}return 0x0;}}export class ScheduleShowCommand extends BaseCommand{[a34_0x33a2e9(0x93)]=a34_0x33a2e9(0x74);[a34_0x33a2e9(0xf2)]=a34_0x33a2e9(0xc5);[a34_0x33a2e9(0xb2)](_0x2729b6){const _0x11df0b=a34_0x33a2e9,_0x27ea15=_0x2729b6[_0x11df0b(0xaf)][0x0];if(!_0x27ea15)return _0x11df0b(0xe0);return undefined;}async[a34_0x33a2e9(0xc7)](_0x5412b7){const _0x5769f3=a34_0x33a2e9,{options:_0x1078d1,args:_0x263c86,tdx:_0x323024}=_0x5412b7,_0x15b034=_0x263c86[0x0],_0x4dacff=await withSpinner(_0x5769f3(0xcc),()=>_0x323024[_0x5769f3(0xe1)][_0x5769f3(0x70)](_0x15b034),{'verbose':_0x1078d1[_0x5769f3(0x81)]}),_0x376669=_0x4dacff[_0x5769f3(0xc0)],_0x2fe221={'name':_0x376669[_0x5769f3(0x93)],'cron':_0x376669['cron'],'database':_0x376669[_0x5769f3(0x9d)],'type':_0x376669[_0x5769f3(0x9a)],'timezone':_0x376669[_0x5769f3(0x6d)],'user_name':_0x376669['user_name'],'created_at':_0x376669[_0x5769f3(0xc8)],'engine_version':_0x376669['engine_version'],'executing_user_id':_0x376669['executing_user_id'],'query':_0x376669[_0x5769f3(0xe9)],'delay':_0x376669[_0x5769f3(0x6b)],'priority':_0x376669[_0x5769f3(0xbd)],'retry_limit':_0x376669[_0x5769f3(0xc4)],..._0x376669[_0x5769f3(0xa3)]&&{'result':_0x376669[_0x5769f3(0xa3)]}};return await handleSingleObjectOutput(_0x2fe221,_0x1078d1),0x0;}}export class ScheduleCreateCommand extends BaseCommand{['name']=a34_0x33a2e9(0xad);[a34_0x33a2e9(0xf2)]=a34_0x33a2e9(0xd3);[a34_0x33a2e9(0xb2)](_0x544dee){const _0x154057=a34_0x33a2e9,_0x2937d7=_0x544dee[_0x154057(0xaf)][0x0];if(!_0x2937d7)return _0x154057(0xb1);const _0x41145c=_0x544dee['options'];if(!_0x41145c['database'])return _0x154057(0xbb);return undefined;}async['execute'](_0x47c547){const _0x1336d6=a34_0x33a2e9,{options:_0xea1ce6,args:_0x584525,tdx:_0xba5da2}=_0x47c547,_0x529b37=_0x584525[0x0],_0xa12def=_0xea1ce6,_0x100ea9=_0xa12def[_0x1336d6(0x9d)],_0x3d53ce=_0xa12def[_0x1336d6(0x7f)],_0x55ce43=_0xa12def[_0x1336d6(0x9a)]||_0x1336d6(0x83);let _0x464217;try{_0x464217=readFileSync(_0x3d53ce,_0x1336d6(0x6f))[_0x1336d6(0xc9)]();}catch(_0x1cad71){throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x1336d6(0xe8)+_0x3d53ce,_0x1cad71 instanceof Error?_0x1cad71:undefined);}if(!_0x464217)throw new SDKError(ErrorCode[_0x1336d6(0xa6)],_0x1336d6(0xcf));const _0x2db129={'database':_0x100ea9,'query':_0x464217,'type':_0x55ce43};if(_0xa12def[_0x1336d6(0x95)])_0x2db129[_0x1336d6(0x95)]=_0xa12def[_0x1336d6(0x95)];if(_0xa12def[_0x1336d6(0x6d)])_0x2db129[_0x1336d6(0x6d)]=_0xa12def[_0x1336d6(0x6d)];if(_0xa12def[_0x1336d6(0x6b)]!==undefined)_0x2db129[_0x1336d6(0x6b)]=Number(_0xa12def[_0x1336d6(0x6b)]);if(_0xa12def['priority']!==undefined)_0x2db129[_0x1336d6(0xbd)]=Number(_0xa12def[_0x1336d6(0xbd)]);if(_0xa12def[_0x1336d6(0xf0)]!==undefined)_0x2db129[_0x1336d6(0xc4)]=Number(_0xa12def[_0x1336d6(0xf0)]);if(_0xa12def[_0x1336d6(0x92)])_0x2db129['engine_version']=_0xa12def[_0x1336d6(0x92)];if(_0xa12def[_0x1336d6(0xa3)])_0x2db129[_0x1336d6(0xa3)]=_0xa12def[_0x1336d6(0xa3)];if(_0xea1ce6[_0x1336d6(0x81)]){console[_0x1336d6(0xa8)](_0x1336d6(0xf6)+_0x529b37),console[_0x1336d6(0xa8)](_0x1336d6(0xd0)+_0x100ea9),console[_0x1336d6(0xa8)](_0x1336d6(0x71)+_0x55ce43);if(_0x2db129[_0x1336d6(0x95)])console[_0x1336d6(0xa8)]('\x20\x20Cron:\x20'+_0x2db129['cron']);if(_0x2db129[_0x1336d6(0x6d)])console[_0x1336d6(0xa8)](_0x1336d6(0xd8)+_0x2db129[_0x1336d6(0x6d)]);}const _0x5b0cb5=await withSpinner(_0x1336d6(0xa7),()=>_0xba5da2[_0x1336d6(0xe1)][_0x1336d6(0xef)](_0x529b37,_0x2db129),{'verbose':_0xea1ce6[_0x1336d6(0x81)]});return console[_0x1336d6(0xa8)](_0x1336d6(0x91)+_0x5b0cb5[_0x1336d6(0xc0)]['name']),await handleSingleObjectOutput(_0x5b0cb5[_0x1336d6(0xc0)],_0xea1ce6),0x0;}}export class ScheduleUpdateCommand extends BaseCommand{[a34_0x33a2e9(0x93)]=a34_0x33a2e9(0xb6);['description']=a34_0x33a2e9(0xf5);[a34_0x33a2e9(0xb2)](_0x395ba6){const _0x34780c=a34_0x33a2e9,_0x3b74d1=_0x395ba6[_0x34780c(0xaf)][0x0];if(!_0x3b74d1)return _0x34780c(0xd5);return undefined;}async[a34_0x33a2e9(0xc7)](_0x401708){const _0xa9ed69=a34_0x33a2e9,{options:_0x1d8583,args:_0x55b95a,tdx:_0x2cb6a7}=_0x401708,_0x8b4c06=_0x55b95a[0x0],_0x469dfc=_0x1d8583,_0xb404fb={};if(_0x469dfc['database'])_0xb404fb[_0xa9ed69(0x9d)]=_0x469dfc['database'];if(_0x469dfc['type'])_0xb404fb[_0xa9ed69(0x9a)]=_0x469dfc[_0xa9ed69(0x9a)];if(_0x469dfc[_0xa9ed69(0x95)])_0xb404fb[_0xa9ed69(0x95)]=_0x469dfc[_0xa9ed69(0x95)];if(_0x469dfc[_0xa9ed69(0x6d)])_0xb404fb[_0xa9ed69(0x6d)]=_0x469dfc['timezone'];if(_0x469dfc[_0xa9ed69(0x6b)]!==undefined)_0xb404fb[_0xa9ed69(0x6b)]=Number(_0x469dfc['delay']);if(_0x469dfc[_0xa9ed69(0xbd)]!==undefined)_0xb404fb['priority']=Number(_0x469dfc[_0xa9ed69(0xbd)]);if(_0x469dfc['retryLimit']!==undefined)_0xb404fb[_0xa9ed69(0xc4)]=Number(_0x469dfc[_0xa9ed69(0xf0)]);if(_0x469dfc[_0xa9ed69(0x92)])_0xb404fb['engine_version']=_0x469dfc[_0xa9ed69(0x92)];if(_0x469dfc[_0xa9ed69(0xa3)])_0xb404fb[_0xa9ed69(0xa3)]=_0x469dfc[_0xa9ed69(0xa3)];if(_0x469dfc['file'])try{_0xb404fb[_0xa9ed69(0xe9)]=readFileSync(_0x469dfc[_0xa9ed69(0x7f)],_0xa9ed69(0x6f))[_0xa9ed69(0xc9)]();}catch(_0x562ae5){throw new SDKError(ErrorCode[_0xa9ed69(0xa6)],_0xa9ed69(0xe8)+_0x469dfc['file'],_0x562ae5 instanceof Error?_0x562ae5:undefined);}if(Object[_0xa9ed69(0x77)](_0xb404fb)[_0xa9ed69(0x73)]===0x0)throw new SDKError(ErrorCode[_0xa9ed69(0xa6)],_0xa9ed69(0xc3));if(_0x1d8583['verbose']){console[_0xa9ed69(0xa8)](_0xa9ed69(0x7c)+_0x8b4c06);for(const [_0x5259dd,_0x1df900]of Object[_0xa9ed69(0x9f)](_0xb404fb)){_0x5259dd===_0xa9ed69(0xe9)?console[_0xa9ed69(0xa8)]('\x20\x20'+_0x5259dd+':\x20'+_0x1df900[_0xa9ed69(0xb5)](0x0,0x32)+_0xa9ed69(0x87)):console[_0xa9ed69(0xa8)]('\x20\x20'+_0x5259dd+':\x20'+_0x1df900);}}const _0x65e59d=await withSpinner('Updating\x20schedule...',()=>_0x2cb6a7[_0xa9ed69(0xe1)][_0xa9ed69(0x69)](_0x8b4c06,_0xb404fb),{'verbose':_0x1d8583[_0xa9ed69(0x81)]});return console['error']('Schedule\x20updated:\x20'+_0x65e59d['data'][_0xa9ed69(0x93)]),await handleSingleObjectOutput(_0x65e59d[_0xa9ed69(0xc0)],_0x1d8583),0x0;}}export class ScheduleDeleteCommand extends BaseCommand{['name']=a34_0x33a2e9(0x98);[a34_0x33a2e9(0xf2)]=a34_0x33a2e9(0xe3);[a34_0x33a2e9(0xb2)](_0x2b20f5){const _0xaa66b8=a34_0x33a2e9,_0x2a6199=_0x2b20f5[_0xaa66b8(0xaf)][0x0];if(!_0x2a6199)return'Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20delete\x20<name>';return undefined;}async[a34_0x33a2e9(0xc7)](_0x1dbc65){const _0x59dff6=a34_0x33a2e9,{options:_0x16a3bc,args:_0x14e2a7,tdx:_0x40c8f0}=_0x1dbc65,_0x2df443=_0x14e2a7[0x0];if(!_0x16a3bc['yes']){const _0x5e7535=await confirm(_0x59dff6(0xb0)+_0x2df443+'\x22?');if(!_0x5e7535)return console[_0x59dff6(0xa8)](_0x59dff6(0xc6)),0x0;}const _0xbc240f=await withSpinner(_0x59dff6(0xd4),()=>_0x40c8f0[_0x59dff6(0xe1)][_0x59dff6(0xdd)](_0x2df443),{'verbose':_0x16a3bc[_0x59dff6(0x81)]});return console['error'](_0x59dff6(0x75)+_0xbc240f[_0x59dff6(0xc0)][_0x59dff6(0x93)]),0x0;}}export class ScheduleRunCommand extends BaseCommand{[a34_0x33a2e9(0x93)]=a34_0x33a2e9(0x72);['description']=a34_0x33a2e9(0xbf);[a34_0x33a2e9(0xb2)](_0x3bad0d){const _0x2dd86f=a34_0x33a2e9,_0x111ddf=_0x3bad0d[_0x2dd86f(0xaf)][0x0];if(!_0x111ddf)return'Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20run\x20<name>\x20[--time\x20<iso8601>]\x20[--num\x20<1-10>]';return undefined;}async['execute'](_0x564969){const _0x8e2fb2=a34_0x33a2e9,{options:_0x2976c4,args:_0x14f296,tdx:_0x579535}=_0x564969,_0x573ae5=_0x14f296[0x0],_0x128253=_0x2976c4,_0x4595fb=_0x128253[_0x8e2fb2(0x79)],_0x882a31=_0x128253[_0x8e2fb2(0x82)]!==undefined?Number(_0x128253[_0x8e2fb2(0x82)]):undefined;if(_0x2976c4[_0x8e2fb2(0x81)]){console[_0x8e2fb2(0xa8)]('Running\x20schedule:\x20'+_0x573ae5);if(_0x4595fb)console[_0x8e2fb2(0xa8)]('\x20\x20Time:\x20'+_0x4595fb);if(_0x882a31)console[_0x8e2fb2(0xa8)](_0x8e2fb2(0x80)+_0x882a31);}const _0x44725d=await withSpinner(_0x8e2fb2(0xbc),()=>_0x579535[_0x8e2fb2(0xe1)][_0x8e2fb2(0xf9)](_0x573ae5,{'time':_0x4595fb,'num':_0x882a31}),{'verbose':_0x2976c4['verbose']}),_0x1bab1a=_0x44725d['data'][_0x8e2fb2(0xda)];console['error'](_0x8e2fb2(0xa2)+_0x1bab1a['length']+_0x8e2fb2(0xfa)+(_0x1bab1a[_0x8e2fb2(0x73)]!==0x1?'s':'')+_0x8e2fb2(0xf1));for(const _0x211d93 of _0x1bab1a){console[_0x8e2fb2(0xa8)](_0x8e2fb2(0x88)+_0x211d93[_0x8e2fb2(0xce)]);}return await handleSDKOutput(_0x1bab1a,_0x2976c4),0x0;}}export class ScheduleHistoryCommand extends BaseCommand{[a34_0x33a2e9(0x93)]=a34_0x33a2e9(0xd1);[a34_0x33a2e9(0xf2)]=a34_0x33a2e9(0x7e);['validate'](_0x3d3996){const _0xbae0f5=a34_0x33a2e9,_0x4e8c87=_0x3d3996[_0xbae0f5(0xaf)][0x0];if(!_0x4e8c87)return _0xbae0f5(0xcb);return undefined;}async[a34_0x33a2e9(0xc7)](_0x3b061c){const _0x4aaed7=a34_0x33a2e9,{options:_0x45a558,args:_0x22f98c,tdx:_0x5a1999}=_0x3b061c,_0x5ecfd2=_0x22f98c[0x0],_0x325951=_0x45a558,_0x16139a=_0x325951[_0x4aaed7(0x85)]!==undefined?Number(_0x325951['from']):undefined,_0x326e35=_0x325951['to']!==undefined?Number(_0x325951['to']):undefined,_0x3836e1=await withSpinner(_0x4aaed7(0xee),()=>_0x5a1999['schedules'][_0x4aaed7(0xac)](_0x5ecfd2,{'from':_0x16139a,'to':_0x326e35}),{'verbose':_0x45a558[_0x4aaed7(0x81)]}),_0x1d9b71=_0x3836e1[_0x4aaed7(0xc0)];console['error'](_0x4aaed7(0xb8)+_0x1d9b71[_0x4aaed7(0xdf)]+_0x4aaed7(0x7b)+(_0x1d9b71[_0x4aaed7(0xdf)]!==0x1?'s':'')+_0x4aaed7(0x94)+_0x1d9b71[_0x4aaed7(0x85)]+'-'+_0x1d9b71['to']+')');const _0x1bb8c9=_0x1d9b71[_0x4aaed7(0xac)][_0x4aaed7(0xed)](_0x292161=>({'job_id':_0x292161[_0x4aaed7(0xce)],'type':_0x292161[_0x4aaed7(0x9a)],'status':_0x292161['status'],'scheduled_at':_0x292161[_0x4aaed7(0x7d)],'created_at':_0x292161[_0x4aaed7(0xc8)],'start_at':_0x292161[_0x4aaed7(0xe7)],'end_at':_0x292161[_0x4aaed7(0x99)]}));return await handleSDKOutput(_0x1bb8c9,_0x45a558),0x0;}}
1
+ const a34_0x872857=a34_0x1e85;(function(_0x474507,_0x45ea57){const _0x285f4b=a34_0x1e85,_0x3e3156=_0x474507();while(!![]){try{const _0x17bb3a=-parseInt(_0x285f4b(0xdd))/0x1*(parseInt(_0x285f4b(0x122))/0x2)+-parseInt(_0x285f4b(0x11f))/0x3*(-parseInt(_0x285f4b(0xb6))/0x4)+parseInt(_0x285f4b(0x109))/0x5+parseInt(_0x285f4b(0xe3))/0x6+-parseInt(_0x285f4b(0x135))/0x7+-parseInt(_0x285f4b(0xbb))/0x8+-parseInt(_0x285f4b(0x10f))/0x9;if(_0x17bb3a===_0x45ea57)break;else _0x3e3156['push'](_0x3e3156['shift']());}catch(_0x52c9df){_0x3e3156['push'](_0x3e3156['shift']());}}}(a34_0x4801,0xc2856));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';function a34_0x1e85(_0x1f41c0,_0x298ca6){_0x1f41c0=_0x1f41c0-0xa4;const _0x480163=a34_0x4801();let _0x1e8530=_0x480163[_0x1f41c0];return _0x1e8530;}import{handleSDKOutput,handleSingleObjectOutput,writeOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{confirm}from'../utils/prompt.js';import{readFileSync}from'fs';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{hyperlink}from'../sdk/util/formatters.js';import a34_0x365f45 from'chalk';function formatRelativeTime(_0x232c79){const _0x43c72f=a34_0x1e85,_0x5a3aee=new Date(_0x232c79),_0xc30833=new Date(),_0x1eff70=_0x5a3aee[_0x43c72f(0xa6)]()-_0xc30833[_0x43c72f(0xa6)](),_0x4fb2c3=Math[_0x43c72f(0xcf)](_0x1eff70)/0x3e8,_0x43d5a8=_0x1eff70<0x0;if(_0x4fb2c3<0x3c)return _0x43d5a8?_0x43c72f(0xf8):_0x43c72f(0xfb);else{if(_0x4fb2c3<0xe10){const _0xa4202d=Math[_0x43c72f(0x138)](_0x4fb2c3/0x3c);return _0x43d5a8?_0xa4202d+_0x43c72f(0x124):_0x43c72f(0xcc)+_0xa4202d+'m';}else{if(_0x4fb2c3<0x15180){const _0x5d7736=Math[_0x43c72f(0x138)](_0x4fb2c3/0xe10);return _0x43d5a8?_0x5d7736+_0x43c72f(0x10e):_0x43c72f(0xcc)+_0x5d7736+'h';}else{if(_0x4fb2c3<0x93a80){const _0x8636e=Math['round'](_0x4fb2c3/0x15180);return _0x43d5a8?_0x8636e+_0x43c72f(0xbc):_0x43c72f(0xcc)+_0x8636e+'d';}else return _0x5a3aee['toLocaleDateString']();}}}}export class ScheduleListCommand extends BaseCommand{[a34_0x872857(0xe6)]=a34_0x872857(0xd5);['description']=a34_0x872857(0xf5);async[a34_0x872857(0x103)](_0x326342){const _0x2a8d51=a34_0x872857,{options:_0x41b18c,args:_0x1b3867,tdx:_0x5b19e6}=_0x326342,_0x2c1223=resolveLimit(_0x41b18c[_0x2a8d51(0xff)],DEFAULT_DISPLAY_LIMIT),_0x107f60=_0x1b3867[0x0],_0x11248c=_0x107f60?'Searching\x20scheduled\x20queries\x20matching\x20\x22'+_0x107f60+_0x2a8d51(0xd3):_0x2a8d51(0xba),_0x19524f=await withSpinner(_0x11248c,()=>_0x5b19e6['schedules'][_0x2a8d51(0xca)]({'limit':_0x2c1223,'scheduled':!![],'pattern':_0x107f60}),{'verbose':_0x41b18c[_0x2a8d51(0x115)]}),_0x44acef=_0x19524f[_0x2a8d51(0xc5)][_0x2a8d51(0xc1)],_0x18cd68=_0x19524f['data'][_0x2a8d51(0x11e)][_0x2a8d51(0xfd)],_0x4e6634=_0x107f60?_0x2a8d51(0x11a)+_0x107f60+'\x22':'';_0x18cd68?console[_0x2a8d51(0xd7)](_0x2a8d51(0xdf)+_0x44acef[_0x2a8d51(0xc0)]+_0x2a8d51(0xaf)+_0x4e6634+_0x2a8d51(0x121)):console[_0x2a8d51(0xd7)]('Found\x20'+_0x44acef['length']+_0x2a8d51(0xa9)+(_0x44acef[_0x2a8d51(0xc0)]!==0x1?_0x2a8d51(0x125):'y')+_0x4e6634);if(_0x41b18c[_0x2a8d51(0xf6)]===_0x2a8d51(0x113)||_0x41b18c[_0x2a8d51(0xf6)]===_0x2a8d51(0x10d)||_0x41b18c[_0x2a8d51(0xf6)]===_0x2a8d51(0xd8)||_0x41b18c[_0x2a8d51(0xf6)]===_0x2a8d51(0x12d)){const _0x55d9bb=_0x44acef[_0x2a8d51(0xe0)](_0x362cd2=>({'id':_0x362cd2['id'],'name':_0x362cd2['name'],'cron':_0x362cd2[_0x2a8d51(0xae)],'database':_0x362cd2[_0x2a8d51(0xf4)]?.[_0x2a8d51(0xe6)],'type':_0x362cd2[_0x2a8d51(0xe9)],'timezone':_0x362cd2[_0x2a8d51(0xa7)],'user_name':_0x362cd2['user']?.[_0x2a8d51(0xe6)],'updated_at':_0x362cd2[_0x2a8d51(0xad)],'next_run_at':_0x362cd2['next_run_at'],'last_job_status':_0x362cd2['last_job']?.['status']}));await handleSDKOutput(_0x55d9bb,_0x41b18c);}else{if(_0x44acef[_0x2a8d51(0xc0)]===0x0)console[_0x2a8d51(0xb8)](_0x2a8d51(0xcb));else{const _0x315cd8=_0x41b18c[_0x2a8d51(0xbe)],_0x151eed=_0x44acef[_0x2a8d51(0xe0)](_0x48b587=>{const _0x2a7068=_0x2a8d51,_0x55df3a=_0x48b587[_0x2a7068(0xa5)]?.[_0x2a7068(0x136)]?_0x48b587['last_job'][_0x2a7068(0x136)]===_0x2a7068(0xfa)?'✓':'✗':'-',_0x579917=_0x48b587['last_job']?.[_0x2a7068(0x12a)]?formatRelativeTime(_0x48b587[_0x2a7068(0xa5)][_0x2a7068(0x12a)]):_0x2a7068(0x132),_0x1a7e29=_0x48b587[_0x2a7068(0x106)]?formatRelativeTime(_0x48b587[_0x2a7068(0x106)]):'-',_0x3dde97=_0x48b587[_0x2a7068(0xae)]||'',_0x2d2e4a=_0x48b587[_0x2a7068(0xe6)]||_0x2a7068(0x10c),_0x5d5f8e=getConsoleUrl(_0x315cd8,_0x2a7068(0x120)+_0x48b587['id']);return{'statusIcon':_0x55df3a,'lastRun':_0x579917,'nextRun':_0x1a7e29,'cron':_0x3dde97,'name':_0x2d2e4a,'queryUrl':_0x5d5f8e,'status':_0x48b587['last_job']?.[_0x2a7068(0x136)]};}),_0x42c03e=Math[_0x2a8d51(0xf7)](..._0x151eed['map'](_0x12db18=>_0x12db18[_0x2a8d51(0x107)][_0x2a8d51(0xc0)])),_0x3611ec=Math[_0x2a8d51(0xf7)](..._0x151eed[_0x2a8d51(0xe0)](_0x34e6c5=>_0x34e6c5[_0x2a8d51(0xc9)][_0x2a8d51(0xc0)])),_0x73d55e=Math[_0x2a8d51(0xf7)](..._0x151eed[_0x2a8d51(0xe0)](_0x10096f=>_0x10096f[_0x2a8d51(0xae)]['length'])),_0x5d71ff=_0x151eed[_0x2a8d51(0xe0)](_0x1c7efa=>{const _0x497c0c=_0x2a8d51,_0x3cfff9=_0x1c7efa[_0x497c0c(0x136)]===_0x497c0c(0xfa)?a34_0x365f45[_0x497c0c(0xac)](_0x1c7efa[_0x497c0c(0xc7)]):_0x1c7efa[_0x497c0c(0x136)]===_0x497c0c(0xd7)?a34_0x365f45[_0x497c0c(0x105)](_0x1c7efa[_0x497c0c(0xc7)]):a34_0x365f45[_0x497c0c(0xb3)](_0x1c7efa[_0x497c0c(0xc7)]),_0x38a1ea=_0x1c7efa[_0x497c0c(0x107)][_0x497c0c(0xeb)](_0x42c03e),_0x22a079=_0x1c7efa[_0x497c0c(0xc9)][_0x497c0c(0xeb)](_0x3611ec),_0x3b261e=_0x1c7efa['cron']?a34_0x365f45[_0x497c0c(0xd1)](_0x1c7efa['cron'][_0x497c0c(0xeb)](_0x73d55e)):'\x20'[_0x497c0c(0xb1)](_0x73d55e),_0x2c7a21=hyperlink(_0x1c7efa[_0x497c0c(0xe6)],_0x1c7efa['queryUrl']);return _0x497c0c(0xcd)+_0x3cfff9+'\x20'+_0x38a1ea+'\x20\x20→\x20'+_0x22a079+'\x20\x20'+_0x3b261e+'\x20\x20'+_0x2c7a21;});await writeOutput(_0x5d71ff[_0x2a8d51(0xf1)]('\x0a'),_0x41b18c[_0x2a8d51(0x112)],_0x2a8d51(0x11b));}}return 0x0;}}function a34_0x4801(){const _0x566354=['delay','priority','entries','data','description','statusIcon','\x20(showing\x20','nextRun','listQueries','No\x20scheduled\x20queries\x20found','in\x20','📅\x20','engineVersion','abs','Failed\x20to\x20read\x20file:\x20','cyan','from','\x22...','trino','schedule:list','schedule:create','error','table','schedules','executing_user_id','args','Found\x20','218807hayxQC','Run\x20a\x20scheduled\x20query\x20immediately','Showing\x20first\x20','map','Schedule\x20run\x20submitted:\x20','query','4379148EivTIH','timezone','engine_version','name','schedule:show','\x20\x20Database:\x20','type','schedule:update','padEnd','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20run\x20<name>\x20[--time\x20<iso8601>]\x20[--num\x20<1-10>]','Delete\x20a\x20scheduled\x20query','run','Cancelled','Show\x20schedule\x20details','join','keys','create','database','List\x20scheduled\x20queries','format','max','just\x20now','substring','success','soon','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20show\x20<name>','has_next_page','num','limit','start_at','\x20job','Running\x20schedule...','execute','Schedule\x20deleted:\x20','red','next_run_at','lastRun','utf-8','4541045WucpTl','user_name','Getting\x20schedule\x20history...','(unnamed)','jsonl','h\x20ago','5035815WnYbil','time','update','output','json','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20schedule\x20\x22','verbose','schedule:delete','Updating\x20schedule:\x20','\x20\x20Cron:\x20','jobs','\x20matching\x20\x22','list','INVALID_ARGUMENT','Show\x20schedule\x20execution\x20history','pagination','2663049CmgXar','/app/queries/editor?queryId=','\x20(use\x20--limit\x20to\x20see\x20more)','8NPcULE','result','m\x20ago','ies','count','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20delete\x20<name>','history','...','ended_at','job_id','Create\x20a\x20scheduled\x20query','tsv','options','Creating\x20schedule:\x20','Running\x20schedule:\x20','retryLimit','never','delete','\x20\x20Time:\x20','446481hqyyns','status','file','round','Query\x20file\x20is\x20empty','last_job','getTime','time_zone','\x20\x20Job\x20ID:\x20','\x20scheduled\x20quer','Deleting\x20schedule...','schedule:run','green','updated_at','cron','\x20schedules','Update\x20a\x20scheduled\x20query','repeat','trim','dim','created_at','\x20\x20Timezone:\x20','4VFdOPB','validate','log','end_at','Listing\x20scheduled\x20queries...','1843568WCMymd','d\x20ago','At\x20least\x20one\x20option\x20must\x20be\x20provided\x20to\x20update','site','retry_limit','length','queries'];a34_0x4801=function(){return _0x566354;};return a34_0x4801();}export class ScheduleShowCommand extends BaseCommand{[a34_0x872857(0xe6)]=a34_0x872857(0xe7);[a34_0x872857(0xc6)]=a34_0x872857(0xf0);[a34_0x872857(0xb7)](_0x2ed77c){const _0x2f38ab=a34_0x872857,_0x586215=_0x2ed77c[_0x2f38ab(0xdb)][0x0];if(!_0x586215)return _0x2f38ab(0xfc);return undefined;}async[a34_0x872857(0x103)](_0x25a1b2){const _0x1f5948=a34_0x872857,{options:_0x50ea09,args:_0x50ab42,tdx:_0xf7b7b6}=_0x25a1b2,_0x95327=_0x50ab42[0x0],_0x4d7df7=await withSpinner('Getting\x20schedule\x20details...',()=>_0xf7b7b6['schedules']['show'](_0x95327),{'verbose':_0x50ea09[_0x1f5948(0x115)]}),_0x2c70fb=_0x4d7df7[_0x1f5948(0xc5)],_0xae7415={'name':_0x2c70fb['name'],'cron':_0x2c70fb[_0x1f5948(0xae)],'database':_0x2c70fb['database'],'type':_0x2c70fb[_0x1f5948(0xe9)],'timezone':_0x2c70fb[_0x1f5948(0xe4)],'user_name':_0x2c70fb[_0x1f5948(0x10a)],'created_at':_0x2c70fb['created_at'],'engine_version':_0x2c70fb[_0x1f5948(0xe5)],'executing_user_id':_0x2c70fb[_0x1f5948(0xda)],'query':_0x2c70fb[_0x1f5948(0xe2)],'delay':_0x2c70fb[_0x1f5948(0xc2)],'priority':_0x2c70fb[_0x1f5948(0xc3)],'retry_limit':_0x2c70fb[_0x1f5948(0xbf)],..._0x2c70fb[_0x1f5948(0x123)]&&{'result':_0x2c70fb[_0x1f5948(0x123)]}};return await handleSingleObjectOutput(_0xae7415,_0x50ea09),0x0;}}export class ScheduleCreateCommand extends BaseCommand{['name']=a34_0x872857(0xd6);[a34_0x872857(0xc6)]=a34_0x872857(0x12c);[a34_0x872857(0xb7)](_0x33d05c){const _0x484a75=a34_0x872857,_0x29779d=_0x33d05c[_0x484a75(0xdb)][0x0];if(!_0x29779d)return'Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20create\x20<name>\x20-d\x20<db>\x20--file\x20<path>\x20[options]';const _0x12429f=_0x33d05c[_0x484a75(0x12e)];if(!_0x12429f[_0x484a75(0xf4)])return'Database\x20is\x20required\x0aUsage:\x20job\x20schedule\x20create\x20<name>\x20-d\x20<db>\x20--file\x20<path>\x20[options]';return undefined;}async[a34_0x872857(0x103)](_0x3e4207){const _0x3d9d12=a34_0x872857,{options:_0x25fe88,args:_0x19a827,tdx:_0x253d79}=_0x3e4207,_0x125517=_0x19a827[0x0],_0x275c7e=_0x25fe88,_0x3d19f6=_0x275c7e[_0x3d9d12(0xf4)],_0x69ad6e=_0x275c7e['file'],_0xad8414=_0x275c7e[_0x3d9d12(0xe9)]||_0x3d9d12(0xd4);let _0x29b49c;try{_0x29b49c=readFileSync(_0x69ad6e,_0x3d9d12(0x108))['trim']();}catch(_0x4a46fc){throw new SDKError(ErrorCode[_0x3d9d12(0x11c)],_0x3d9d12(0xd0)+_0x69ad6e,_0x4a46fc instanceof Error?_0x4a46fc:undefined);}if(!_0x29b49c)throw new SDKError(ErrorCode[_0x3d9d12(0x11c)],_0x3d9d12(0xa4));const _0x34f15c={'database':_0x3d19f6,'query':_0x29b49c,'type':_0xad8414};if(_0x275c7e[_0x3d9d12(0xae)])_0x34f15c[_0x3d9d12(0xae)]=_0x275c7e[_0x3d9d12(0xae)];if(_0x275c7e[_0x3d9d12(0xe4)])_0x34f15c['timezone']=_0x275c7e['timezone'];if(_0x275c7e[_0x3d9d12(0xc2)]!==undefined)_0x34f15c[_0x3d9d12(0xc2)]=Number(_0x275c7e[_0x3d9d12(0xc2)]);if(_0x275c7e[_0x3d9d12(0xc3)]!==undefined)_0x34f15c['priority']=Number(_0x275c7e[_0x3d9d12(0xc3)]);if(_0x275c7e[_0x3d9d12(0x131)]!==undefined)_0x34f15c[_0x3d9d12(0xbf)]=Number(_0x275c7e['retryLimit']);if(_0x275c7e[_0x3d9d12(0xce)])_0x34f15c[_0x3d9d12(0xe5)]=_0x275c7e[_0x3d9d12(0xce)];if(_0x275c7e[_0x3d9d12(0x123)])_0x34f15c[_0x3d9d12(0x123)]=_0x275c7e[_0x3d9d12(0x123)];if(_0x25fe88[_0x3d9d12(0x115)]){console[_0x3d9d12(0xd7)](_0x3d9d12(0x12f)+_0x125517),console[_0x3d9d12(0xd7)](_0x3d9d12(0xe8)+_0x3d19f6),console['error']('\x20\x20Type:\x20'+_0xad8414);if(_0x34f15c[_0x3d9d12(0xae)])console['error'](_0x3d9d12(0x118)+_0x34f15c[_0x3d9d12(0xae)]);if(_0x34f15c[_0x3d9d12(0xe4)])console[_0x3d9d12(0xd7)](_0x3d9d12(0xb5)+_0x34f15c[_0x3d9d12(0xe4)]);}const _0x28e99a=await withSpinner('Creating\x20schedule...',()=>_0x253d79[_0x3d9d12(0xd9)][_0x3d9d12(0xf3)](_0x125517,_0x34f15c),{'verbose':_0x25fe88[_0x3d9d12(0x115)]});return console[_0x3d9d12(0xd7)]('Schedule\x20created:\x20'+_0x28e99a[_0x3d9d12(0xc5)][_0x3d9d12(0xe6)]),await handleSingleObjectOutput(_0x28e99a['data'],_0x25fe88),0x0;}}export class ScheduleUpdateCommand extends BaseCommand{[a34_0x872857(0xe6)]=a34_0x872857(0xea);[a34_0x872857(0xc6)]=a34_0x872857(0xb0);[a34_0x872857(0xb7)](_0x3b6c73){const _0x29f104=a34_0x872857,_0xf9d1ff=_0x3b6c73[_0x29f104(0xdb)][0x0];if(!_0xf9d1ff)return'Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20update\x20<name>\x20[options]';return undefined;}async[a34_0x872857(0x103)](_0x2974ad){const _0x4d4181=a34_0x872857,{options:_0x36f05e,args:_0x13b78c,tdx:_0x4acddf}=_0x2974ad,_0x357825=_0x13b78c[0x0],_0x48117b=_0x36f05e,_0x5124d8={};if(_0x48117b[_0x4d4181(0xf4)])_0x5124d8[_0x4d4181(0xf4)]=_0x48117b[_0x4d4181(0xf4)];if(_0x48117b[_0x4d4181(0xe9)])_0x5124d8[_0x4d4181(0xe9)]=_0x48117b[_0x4d4181(0xe9)];if(_0x48117b[_0x4d4181(0xae)])_0x5124d8[_0x4d4181(0xae)]=_0x48117b[_0x4d4181(0xae)];if(_0x48117b[_0x4d4181(0xe4)])_0x5124d8[_0x4d4181(0xe4)]=_0x48117b['timezone'];if(_0x48117b[_0x4d4181(0xc2)]!==undefined)_0x5124d8['delay']=Number(_0x48117b['delay']);if(_0x48117b[_0x4d4181(0xc3)]!==undefined)_0x5124d8[_0x4d4181(0xc3)]=Number(_0x48117b[_0x4d4181(0xc3)]);if(_0x48117b['retryLimit']!==undefined)_0x5124d8['retry_limit']=Number(_0x48117b[_0x4d4181(0x131)]);if(_0x48117b[_0x4d4181(0xce)])_0x5124d8['engine_version']=_0x48117b[_0x4d4181(0xce)];if(_0x48117b['result'])_0x5124d8['result']=_0x48117b[_0x4d4181(0x123)];if(_0x48117b['file'])try{_0x5124d8[_0x4d4181(0xe2)]=readFileSync(_0x48117b['file'],'utf-8')[_0x4d4181(0xb2)]();}catch(_0x13cd5b){throw new SDKError(ErrorCode[_0x4d4181(0x11c)],_0x4d4181(0xd0)+_0x48117b[_0x4d4181(0x137)],_0x13cd5b instanceof Error?_0x13cd5b:undefined);}if(Object[_0x4d4181(0xf2)](_0x5124d8)[_0x4d4181(0xc0)]===0x0)throw new SDKError(ErrorCode[_0x4d4181(0x11c)],_0x4d4181(0xbd));if(_0x36f05e[_0x4d4181(0x115)]){console[_0x4d4181(0xd7)](_0x4d4181(0x117)+_0x357825);for(const [_0x13ef83,_0x3ba61b]of Object[_0x4d4181(0xc4)](_0x5124d8)){_0x13ef83==='query'?console['error']('\x20\x20'+_0x13ef83+':\x20'+_0x3ba61b[_0x4d4181(0xf9)](0x0,0x32)+_0x4d4181(0x129)):console[_0x4d4181(0xd7)]('\x20\x20'+_0x13ef83+':\x20'+_0x3ba61b);}}const _0x10961c=await withSpinner('Updating\x20schedule...',()=>_0x4acddf[_0x4d4181(0xd9)][_0x4d4181(0x111)](_0x357825,_0x5124d8),{'verbose':_0x36f05e[_0x4d4181(0x115)]});return console[_0x4d4181(0xd7)]('Schedule\x20updated:\x20'+_0x10961c[_0x4d4181(0xc5)]['name']),await handleSingleObjectOutput(_0x10961c[_0x4d4181(0xc5)],_0x36f05e),0x0;}}export class ScheduleDeleteCommand extends BaseCommand{['name']=a34_0x872857(0x116);[a34_0x872857(0xc6)]=a34_0x872857(0xed);[a34_0x872857(0xb7)](_0x104f89){const _0x1b401c=a34_0x872857,_0x34b779=_0x104f89[_0x1b401c(0xdb)][0x0];if(!_0x34b779)return _0x1b401c(0x127);return undefined;}async[a34_0x872857(0x103)](_0x4ee8cd){const _0x490aad=a34_0x872857,{options:_0x17e2a1,args:_0x698c7d,tdx:_0x1071da}=_0x4ee8cd,_0xed1316=_0x698c7d[0x0];if(!_0x17e2a1['yes']){const _0x961890=await confirm(_0x490aad(0x114)+_0xed1316+'\x22?');if(!_0x961890)return console[_0x490aad(0xd7)](_0x490aad(0xef)),0x0;}const _0x4fb0c1=await withSpinner(_0x490aad(0xaa),()=>_0x1071da[_0x490aad(0xd9)][_0x490aad(0x133)](_0xed1316),{'verbose':_0x17e2a1['verbose']});return console[_0x490aad(0xd7)](_0x490aad(0x104)+_0x4fb0c1['data'][_0x490aad(0xe6)]),0x0;}}export class ScheduleRunCommand extends BaseCommand{[a34_0x872857(0xe6)]=a34_0x872857(0xab);[a34_0x872857(0xc6)]=a34_0x872857(0xde);['validate'](_0x2d8ce3){const _0x3a8907=a34_0x872857,_0x212df4=_0x2d8ce3[_0x3a8907(0xdb)][0x0];if(!_0x212df4)return _0x3a8907(0xec);return undefined;}async[a34_0x872857(0x103)](_0x32db8f){const _0x1fe2f2=a34_0x872857,{options:_0x3f8763,args:_0x43d289,tdx:_0x4ac431}=_0x32db8f,_0x30f05c=_0x43d289[0x0],_0x4c8d6e=_0x3f8763,_0x2b8cf0=_0x4c8d6e[_0x1fe2f2(0x110)],_0x7e7281=_0x4c8d6e[_0x1fe2f2(0xfe)]!==undefined?Number(_0x4c8d6e[_0x1fe2f2(0xfe)]):undefined;if(_0x3f8763['verbose']){console['error'](_0x1fe2f2(0x130)+_0x30f05c);if(_0x2b8cf0)console[_0x1fe2f2(0xd7)](_0x1fe2f2(0x134)+_0x2b8cf0);if(_0x7e7281)console['error']('\x20\x20Num:\x20'+_0x7e7281);}const _0x29ca1f=await withSpinner(_0x1fe2f2(0x102),()=>_0x4ac431[_0x1fe2f2(0xd9)][_0x1fe2f2(0xee)](_0x30f05c,{'time':_0x2b8cf0,'num':_0x7e7281}),{'verbose':_0x3f8763['verbose']}),_0x754ec3=_0x29ca1f[_0x1fe2f2(0xc5)][_0x1fe2f2(0x119)];console[_0x1fe2f2(0xd7)](_0x1fe2f2(0xe1)+_0x754ec3['length']+_0x1fe2f2(0x101)+(_0x754ec3[_0x1fe2f2(0xc0)]!==0x1?'s':'')+'\x20created');for(const _0x3c0ba7 of _0x754ec3){console[_0x1fe2f2(0xd7)](_0x1fe2f2(0xa8)+_0x3c0ba7[_0x1fe2f2(0x12b)]);}return await handleSDKOutput(_0x754ec3,_0x3f8763),0x0;}}export class ScheduleHistoryCommand extends BaseCommand{[a34_0x872857(0xe6)]='schedule:history';[a34_0x872857(0xc6)]=a34_0x872857(0x11d);[a34_0x872857(0xb7)](_0x11a834){const _0x524eb0=a34_0x872857,_0x13c8d6=_0x11a834[_0x524eb0(0xdb)][0x0];if(!_0x13c8d6)return'Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20history\x20<name>\x20[--from\x20<n>]\x20[--to\x20<n>]';return undefined;}async['execute'](_0x2f0829){const _0x55a8d9=a34_0x872857,{options:_0x22ce67,args:_0x4c4854,tdx:_0x58fe55}=_0x2f0829,_0x4889a4=_0x4c4854[0x0],_0xba585f=_0x22ce67,_0x587d0c=_0xba585f[_0x55a8d9(0xd2)]!==undefined?Number(_0xba585f['from']):undefined,_0xf8e33d=_0xba585f['to']!==undefined?Number(_0xba585f['to']):undefined,_0x5ce003=await withSpinner(_0x55a8d9(0x10b),()=>_0x58fe55[_0x55a8d9(0xd9)][_0x55a8d9(0x128)](_0x4889a4,{'from':_0x587d0c,'to':_0xf8e33d}),{'verbose':_0x22ce67[_0x55a8d9(0x115)]}),_0x13b382=_0x5ce003['data'];console[_0x55a8d9(0xd7)](_0x55a8d9(0xdc)+_0x13b382[_0x55a8d9(0x126)]+'\x20execution'+(_0x13b382[_0x55a8d9(0x126)]!==0x1?'s':'')+_0x55a8d9(0xc8)+_0x13b382[_0x55a8d9(0xd2)]+'-'+_0x13b382['to']+')');const _0x24c662=_0x13b382[_0x55a8d9(0x128)][_0x55a8d9(0xe0)](_0x54966d=>({'job_id':_0x54966d[_0x55a8d9(0x12b)],'type':_0x54966d[_0x55a8d9(0xe9)],'status':_0x54966d[_0x55a8d9(0x136)],'scheduled_at':_0x54966d['scheduled_at'],'created_at':_0x54966d[_0x55a8d9(0xb4)],'start_at':_0x54966d[_0x55a8d9(0x100)],'end_at':_0x54966d[_0x55a8d9(0xb9)]}));return await handleSDKOutput(_0x24c662,_0x22ce67),0x0;}}
@@ -1 +1 @@
1
- const a35_0x887130=a35_0x458b;(function(_0x330c2a,_0x537c68){const _0x410b6d=a35_0x458b,_0x3f59b7=_0x330c2a();while(!![]){try{const _0x22e47f=-parseInt(_0x410b6d(0xf2))/0x1*(parseInt(_0x410b6d(0x132))/0x2)+parseInt(_0x410b6d(0x14f))/0x3+parseInt(_0x410b6d(0x137))/0x4+parseInt(_0x410b6d(0xc3))/0x5*(parseInt(_0x410b6d(0x119))/0x6)+parseInt(_0x410b6d(0x121))/0x7+-parseInt(_0x410b6d(0xe1))/0x8+-parseInt(_0x410b6d(0x13d))/0x9*(parseInt(_0x410b6d(0x111))/0xa);if(_0x22e47f===_0x537c68)break;else _0x3f59b7['push'](_0x3f59b7['shift']());}catch(_0x16f403){_0x3f59b7['push'](_0x3f59b7['shift']());}}}(a35_0x2de9,0xe084f));import{BaseCommand}from'./command.js';function a35_0x458b(_0xc1207e,_0x55a8b8){_0xc1207e=_0xc1207e-0xbe;const _0x2de938=a35_0x2de9();let _0x458b7c=_0x2de938[_0xc1207e];return _0x458b7c;}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 a35_0x557d03 from'chalk';async function resolveSegmentTarget(_0x251f74,_0x50991c,_0x4eefde){const _0x4b1297=a35_0x458b;if(isYamlFilePath(_0x251f74))try{const _0x399390=await resolveYamlFilePath(_0x251f74);return _0x4eefde&&(console[_0x4b1297(0x144)]('Resolved\x20YAML\x20file:\x20'+_0x251f74),console[_0x4b1297(0x144)](_0x4b1297(0x145)+_0x399390['parentSegment']),console[_0x4b1297(0x144)](_0x4b1297(0x13b)+_0x399390[_0x4b1297(0xf3)]),console[_0x4b1297(0x144)](_0x4b1297(0x14a)+(_0x399390[_0x4b1297(0x14c)]||'(root)')),console['error'](_0x4b1297(0x15a)+_0x399390[_0x4b1297(0xeb)])),_0x399390[_0x4b1297(0xeb)];}catch(_0x14a49e){throw new SDKError(ErrorCode[_0x4b1297(0xcc)],_0x4b1297(0x10e)+_0x14a49e[_0x4b1297(0x15c)]);}if(!_0x50991c)throw new SDKError(ErrorCode[_0x4b1297(0xcc)],_0x4b1297(0x13f));return _0x50991c+'/'+_0x251f74;}export class SegmentDescribeCommand extends BaseCommand{[a35_0x887130(0x151)]=a35_0x887130(0xd2);[a35_0x887130(0x16b)]=a35_0x887130(0xe4);async[a35_0x887130(0x154)](_0x2cafa5){const _0x4c7ede=a35_0x887130,{options:_0x37736d,args:_0x126e50,tdx:_0x2964e9}=_0x2cafa5,_0x4bd9f4=_0x126e50[0x0],_0x229fd0=!_0x4bd9f4&&!!_0x37736d[_0x4c7ede(0xce)],_0x5c4163=_0x4bd9f4||_0x37736d[_0x4c7ede(0xce)];if(!_0x5c4163)return console[_0x4c7ede(0x144)]('Error:\x20Path\x20or\x20name\x20is\x20required'),console['error'](_0x4c7ede(0xd7)),console[_0x4c7ede(0x144)]('Examples:'),console[_0x4c7ede(0x144)]('\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22'),console[_0x4c7ede(0x144)](_0x4c7ede(0x10a)),console['error']('\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context'),console[_0x4c7ede(0x144)](_0x4c7ede(0x14e)),0x1;try{const _0x343f17=_0x37736d['segmentPath'];let _0x43a6bb=_0x5c4163;!_0x229fd0&&_0x343f17&&!_0x5c4163[_0x4c7ede(0xfa)]('/')&&(_0x43a6bb=_0x343f17+'/'+_0x5c4163,_0x37736d['verbose']&&console[_0x4c7ede(0x144)](_0x4c7ede(0x113)+_0x43a6bb));const _0x26b9f5=await withSpinner(_0x4c7ede(0x142)+_0x43a6bb+_0x4c7ede(0xc4),()=>_0x2964e9['segment'][_0x4c7ede(0x16a)](_0x43a6bb),{'verbose':_0x37736d[_0x4c7ede(0x148)]}),_0x492cd3=_0x26b9f5['data'];_0x37736d[_0x4c7ede(0x148)]&&(console['error'](_0x4c7ede(0x155)+_0x492cd3['type']),console[_0x4c7ede(0x144)](_0x4c7ede(0x11a)+_0x492cd3[_0x4c7ede(0x110)]),_0x492cd3[_0x4c7ede(0x117)]&&console[_0x4c7ede(0x144)]('Folder\x20ID:\x20'+_0x492cd3[_0x4c7ede(0x117)]),_0x492cd3[_0x4c7ede(0x13c)]&&console[_0x4c7ede(0x144)]('Segment\x20ID:\x20'+_0x492cd3[_0x4c7ede(0x13c)]));if(_0x492cd3[_0x4c7ede(0xc2)]===_0x4c7ede(0x10c)){const _0x339304=await withSpinner(_0x4c7ede(0x106),()=>_0x2964e9[_0x4c7ede(0xd0)][_0x4c7ede(0x129)](_0x492cd3[_0x4c7ede(0x110)]),{'verbose':_0x37736d[_0x4c7ede(0x148)]});await handleSingleObjectOutput(_0x339304[_0x4c7ede(0x11f)],_0x37736d);}else{if(_0x492cd3['type']===_0x4c7ede(0xd8)){if(!_0x492cd3['folderId'])throw new SDKError(ErrorCode[_0x4c7ede(0x114)],_0x4c7ede(0x138));const _0x55891a=await withSpinner(_0x4c7ede(0xed),()=>_0x2964e9[_0x4c7ede(0xd0)]['getFolder'](_0x492cd3[_0x4c7ede(0x117)]),{'verbose':_0x37736d['verbose']});await handleSingleObjectOutput(_0x55891a[_0x4c7ede(0x11f)],_0x37736d);}else{if(_0x492cd3[_0x4c7ede(0xc2)]===_0x4c7ede(0xd0)){if(!_0x492cd3[_0x4c7ede(0x13c)])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x26ca95=await withSpinner(_0x4c7ede(0x15b),()=>_0x2964e9[_0x4c7ede(0xd0)][_0x4c7ede(0x11c)](_0x492cd3[_0x4c7ede(0x110)],_0x492cd3[_0x4c7ede(0x13c)]),{'verbose':_0x37736d[_0x4c7ede(0x148)]});await handleSingleObjectOutput(_0x26ca95[_0x4c7ede(0x11f)],_0x37736d);}}}return 0x0;}catch(_0x79731f){if(_0x79731f instanceof SDKError)return console[_0x4c7ede(0x144)]('Error:\x20'+_0x79731f['message']),_0x79731f[_0x4c7ede(0x15e)]&&console[_0x4c7ede(0x144)](_0x4c7ede(0xca)+_0x79731f[_0x4c7ede(0x15e)]),0x1;throw _0x79731f;}}}export class SegmentShowCommand extends BaseCommand{[a35_0x887130(0x151)]=a35_0x887130(0xfe);[a35_0x887130(0x16b)]=a35_0x887130(0x136);async[a35_0x887130(0x154)](_0x356182){const _0x17a445=a35_0x887130,{options:_0x2a9f85,args:_0x46af24,tdx:_0x3d9c1d}=_0x356182,_0x11ca95=_0x46af24[0x0];if(!_0x11ca95)return console[_0x17a445(0x144)](_0x17a445(0xf8)),console['error'](_0x17a445(0xe7)),console[_0x17a445(0x144)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20show\x20<path/to/segment.yml>'),console['error']('Examples:'),console['error']('\x20\x20tdx\x20sg\x20show\x20\x22Premium\x20Users\x22'),console['error']('\x20\x20tdx\x20sg\x20show\x20segments/my-audience/premium-users.yml'),0x1;try{const _0xb071e6=_0x2a9f85[_0x17a445(0xce)],_0xa0b657=await resolveSegmentTarget(_0x11ca95,_0xb071e6,_0x2a9f85[_0x17a445(0x148)]);_0x2a9f85[_0x17a445(0x148)]&&console[_0x17a445(0x144)]('Target\x20path:\x20'+_0xa0b657);const _0x4ee75b=await withSpinner(_0x17a445(0xdd)+_0x11ca95+_0x17a445(0xc4),()=>_0x3d9c1d[_0x17a445(0xd0)][_0x17a445(0x16a)](_0xa0b657),{'verbose':_0x2a9f85['verbose']}),_0x332921=_0x4ee75b['data'];_0x2a9f85['verbose']&&(console[_0x17a445(0x144)](_0x17a445(0x155)+_0x332921['type']),console[_0x17a445(0x144)](_0x17a445(0x11a)+_0x332921[_0x17a445(0x110)]));if(_0x332921[_0x17a445(0xc2)]===_0x17a445(0xd8))return console['error'](_0x17a445(0x115)),console[_0x17a445(0x144)](_0x17a445(0xc1)),0x1;if(_0x332921[_0x17a445(0xc2)]==='parent')return console['error'](_0x17a445(0xd1)),console[_0x17a445(0x144)](_0x17a445(0xef)),0x1;if(!_0x332921['segmentId'])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x17a445(0xde));const _0x274174=await withSpinner('Fetching\x20SQL\x20for\x20segment...',()=>_0x3d9c1d[_0x17a445(0xd0)][_0x17a445(0xe0)](_0x332921['parentId'],_0x332921[_0x17a445(0x13c)]),{'verbose':_0x2a9f85[_0x17a445(0x148)]});let _0x56580a=_0x274174[_0x17a445(0x11f)];const _0x215c2a=resolveLimit(_0x2a9f85[_0x17a445(0x12a)],DEFAULT_DISPLAY_LIMIT),_0x473f7d=/\bLIMIT\s+\d+/i[_0x17a445(0xc8)](_0x56580a);!_0x473f7d&&(_0x56580a=_0x56580a[_0x17a445(0xe8)]()[_0x17a445(0x13a)](/;+$/,''),_0x56580a=_0x17a445(0xbe)+_0x56580a+_0x17a445(0x10b)+_0x215c2a);_0x2a9f85[_0x17a445(0x148)]&&console[_0x17a445(0x144)]('SQL\x20query:\x0a'+_0x56580a);const _0x416a1c=await withProgressSpinner(_0x17a445(0x10d),async _0x5e956c=>{const _0x5b4f3f=_0x17a445,_0x491744=await _0x3d9c1d[_0x5b4f3f(0x153)]['execute'](_0x56580a,{'catalog':'td','schema':_0x5b4f3f(0x15d),'onJobId':_0x2c3f47=>{_0x5e956c['setJobId'](_0x2c3f47);}});return _0x491744;},{'verbose':_0x2a9f85['verbose']}),_0x4b470b=_0x416a1c['data'],_0x5c739e=_0x4b470b[_0x17a445(0x12d)]?'\x20[Job\x20ID:\x20'+_0x4b470b[_0x17a445(0x12d)]+']':'';return console[_0x17a445(0x144)](_0x17a445(0xe9)+_0x4b470b[_0x17a445(0x120)][_0x17a445(0x104)][_0x17a445(0xd3)]()+_0x17a445(0x165)+(_0x17a445(0xcb)+formatElapsed(_0x4b470b[_0x17a445(0x120)][_0x17a445(0x135)])+_0x5c739e)),await handleQueryOutput(_0x4b470b,_0x2a9f85),0x0;}catch(_0x16dc63){if(_0x16dc63 instanceof SDKError)return console[_0x17a445(0x144)](_0x17a445(0x11e)+_0x16dc63[_0x17a445(0x134)]+']'),console[_0x17a445(0x144)]('\x0a'+_0x16dc63[_0x17a445(0x15c)]),0x1;throw _0x16dc63;}}}export class SegmentFolderListCommand extends BaseCommand{[a35_0x887130(0x151)]='segment:folder:list';[a35_0x887130(0x16b)]=a35_0x887130(0xc7);async[a35_0x887130(0x154)](_0xa103ba){const _0x136d10=a35_0x887130,{options:_0x58e14d,args:_0x427d1e,tdx:_0x59d05c}=_0xa103ba;if(_0x427d1e['length']===0x0)return console[_0x136d10(0x144)](_0x136d10(0x118)),console[_0x136d10(0x144)](_0x136d10(0xff)),0x1;const _0x4241b5=_0x427d1e[0x0];try{_0x58e14d['verbose']&&(console[_0x136d10(0x144)](_0x136d10(0xfd)+_0x58e14d[_0x136d10(0xfc)]),console[_0x136d10(0x144)](_0x136d10(0xda)+_0x4241b5));const _0x1b2dbc=await withSpinner(_0x136d10(0x13e)+_0x4241b5+_0x136d10(0xc4),()=>_0x59d05c[_0x136d10(0xd0)][_0x136d10(0xf9)](_0x4241b5),{'verbose':_0x58e14d[_0x136d10(0x148)]}),_0x2da79c=_0x1b2dbc['data'];_0x58e14d[_0x136d10(0x148)]&&console[_0x136d10(0x144)](_0x136d10(0x139)+_0x2da79c);const _0x584f97=await withSpinner('Listing\x20folders\x20for\x20parent\x20\x27'+_0x4241b5+_0x136d10(0xc4),()=>_0x59d05c[_0x136d10(0xd0)][_0x136d10(0x123)](_0x2da79c),{'verbose':_0x58e14d['verbose']}),_0x33912f=_0x584f97[_0x136d10(0x11f)];return console[_0x136d10(0x144)](_0x136d10(0x141)+_0x33912f[_0x136d10(0xf4)]+_0x136d10(0xf6)+(_0x33912f[_0x136d10(0xf4)]!==0x1?'s':'')),await handleSDKOutput(_0x33912f,_0x58e14d),0x0;}catch(_0x452af2){if(_0x452af2 instanceof SDKError)return console[_0x136d10(0x144)](_0x136d10(0x161)+_0x452af2[_0x136d10(0x15c)]),_0x452af2['cause']&&console[_0x136d10(0x144)](_0x136d10(0xca)+_0x452af2[_0x136d10(0x15e)]),0x1;throw _0x452af2;}}}function a35_0x2de9(){const _0x128fd8=['getParent','limit','Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required','red','jobId','Folder\x20ID:\x20','Error:\x20Segment\x20name\x20or\x20--path\x20is\x20required','Target\x20path:\x20','Fetching\x20SQL\x20for\x20segment...','1168606VffmLw','\x20\x20tdx\x20sg\x20desc\x20segments/my-audience/premium-users.yml','code','elapsedTimeMillis','Execute\x20child\x20segment\x20SQL\x20query\x20and\x20show\x20results','621324YCOSAx','Folder\x20ID\x20missing\x20from\x20resolved\x20path','Resolved\x20parent\x20ID:\x20','replace','\x20\x20Segment\x20name:\x20','segmentId','9HlMgZe','Resolving\x20parent\x20segment\x20\x27','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','Options:','✔\x20Found\x20','Resolving\x20path\x20\x27','Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)','error','\x20\x20Parent\x20segment:\x20','Use:\x20tdx\x20ps\x20view','Error:\x20Folder\x20or\x20segment\x20name,\x20or\x20YAML\x20file\x20path\x20is\x20required','verbose','segment:folder:create','\x20\x20Folder\x20path:\x20','Fetching\x20folder\x20\x27','folderPath','getSegmentSQLFromYaml','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','3476379HLTygx','Usage:\x20tdx\x20sg\x20desc\x20<name>','name','Resolved\x20folder\x20ID:\x20','query','execute','Resolved\x20type:\x20','getSQLFromYamlFile','Create\x20segment\x20folder\x20for\x20organization','Fetching\x20SQL\x20from\x20rule...','Usage:','\x20\x20Full\x20path:\x20','Fetching\x20segment\x20details...','message','information_schema','cause','Show\x20folder\x20or\x20child\x20segment\x20details','log','Error:\x20','Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.\x20Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','parentFolder','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20-w\x20\x20#\x20Open\x20segment\x20in\x20web\x20browser','\x20rows\x20','format','\x27\x20with\x20ID:\x20','content','Show\x20segment\x20folder\x20details','resolvePathToResource','description','SELECT\x20*\x20FROM\x20(\x0a','Creating\x20folder\x20\x27','SEGMENT_NOT_FOUND','Use:\x20tdx\x20sg\x20view\x20<name>\x20\x20#\x20To\x20show\x20folder\x20details','type','474335jgRinV','\x27...','Error:\x20Folder\x20reference\x20is\x20required','/e/','List\x20segment\x20folders\x20under\x20a\x20parent\x20segment','test','Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>','\x20\x20Cause:\x20','in\x20','INVALID_ARGUMENT','Error:\x20Cannot\x20open\x20folder\x20in\x20web\x20browser.\x20Use\x20a\x20segment\x20name\x20instead.','parentSegment','/app/ps/','segment','Error:\x20Cannot\x20execute\x20query\x20for\x20parent\x20segment\x20with\x20this\x20command.','segment:describe','toLocaleString','path','\x20\x20tdx\x20sg\x20sql\x20\x22Premium\x20Users\x22','green','Usage:\x20tdx\x20segment\x20describe\x20<path>','folder','\x20\x20Server-side\x20segment:\x20\x20tdx\x20sg\x20sql\x20<name>','Parent\x20name:\x20','Use:\x20tdx\x20ps\x20view\x20-w','\x20\x20tdx\x20sg\x20sql\x20--path\x20','Resolving\x20\x27','Segment\x20ID\x20missing\x20from\x20resolved\x20path','\x20\x20tdx\x20sg\x20desc\x20\x22Premium\x20Users\x22','getSegmentSQL','10434696ROvvog','url','Use:\x20tdx\x20ps\x20desc','Show\x20segment\x20or\x20folder\x20details','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20\x20\x20\x20\x20#\x20View\x20child\x20segment\x20details','Error:\x20Cannot\x20show\x20schema\x20for\x20a\x20folder.','Usage:\x20tdx\x20sg\x20show\x20<name>','trim','✔\x20Query\x20completed:\x20Processed\x20','segment:folder:show','fullPath','getSQLFromServerSegment','Fetching\x20folder\x20details...','Resolving\x20parent\x20folder\x20\x27','Use:\x20tdx\x20ps\x20show','Error:\x20Cannot\x20show\x20schema\x20for\x20parent\x20segment\x20with\x20this\x20command.','getFolder','2oyBufu','segmentName','length','Resolved\x20parent\x20folder\x20ID:\x20','\x20folder','\x20Opening\x20','Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required','resolveParentId','includes','cyan','site','Site:\x20','segment:show','Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>','✔\x20Created\x20folder\x20\x27','Error:\x20Cannot\x20view\x20parent\x20segment\x20details\x20with\x20this\x20command.','\x20\x20tdx\x20sg\x20sql\x20--path\x20segments/my-audience/premium-users.yml','Get\x20SQL\x20query\x20for\x20child\x20segment','processedRows','Resolved:\x20','Fetching\x20parent\x20segment\x20details...','createFolder','resolveFolderId','Examples:','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','parent','Executing\x20segment\x20query...','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','Folder\x20name:\x20','parentId','7261050BbQqxF','segment:view','Resolved\x20relative\x20path\x20to:\x20','SEGMENT_FOLDER_NOT_FOUND','Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.','\x20\x20Local\x20YAML\x20file:\x20\x20\x20\x20\x20\x20tdx\x20sg\x20sql\x20--path\x20<file-path>','folderId','Error:\x20Parent\x20segment\x20name\x20is\x20required','108FhVDGy','Parent\x20ID:\x20','Parent\x20segment:\x20','getSegment','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20view\x20<path/to/segment.yml>','✖\x20Query\x20failed\x20[','data','stats','7678643qmKosr','Resolving\x20folder\x20\x27','listFolders','\x20\x20-w,\x20--web\x20\x20Open\x20segment\x20in\x20web\x20browser','Error:\x20Cannot\x20open\x20parent\x20segment\x20with\x20this\x20command.','Error:\x20Specify\x20either\x20segment\x20name\x20or\x20--path,\x20not\x20both','\x20\x20tdx\x20sg\x20view\x20segments/my-audience/premium-users.yml','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20desc\x20<path/to/segment.yml>'];a35_0x2de9=function(){return _0x128fd8;};return a35_0x2de9();}export class SegmentFolderShowCommand extends BaseCommand{['name']=a35_0x887130(0xea);[a35_0x887130(0x16b)]=a35_0x887130(0x169);async[a35_0x887130(0x154)](_0x260827){const _0x5ca94f=a35_0x887130,{options:_0x3d2a0f,args:_0x5d19a4,tdx:_0x1f0381}=_0x260827;if(_0x5d19a4[_0x5ca94f(0xf4)]===0x0)return console[_0x5ca94f(0x144)](_0x5ca94f(0xc5)),console[_0x5ca94f(0x144)](_0x5ca94f(0xc9)),0x1;try{const {parentId:_0x222955,childId:_0x2971b5}=parseSegmentRef(_0x5d19a4[0x0]);_0x3d2a0f[_0x5ca94f(0x148)]&&(console['error']('Site:\x20'+_0x3d2a0f[_0x5ca94f(0xfc)]),console['error'](_0x5ca94f(0xda)+_0x222955),_0x2971b5&&console[_0x5ca94f(0x144)]('Folder\x20name:\x20'+_0x2971b5));if(!_0x2971b5)return console[_0x5ca94f(0x144)](_0x5ca94f(0x143)),0x1;const _0x41e748=await withSpinner(_0x5ca94f(0x13e)+_0x222955+_0x5ca94f(0xc4),()=>_0x1f0381['segment'][_0x5ca94f(0xf9)](_0x222955),{'verbose':_0x3d2a0f['verbose']}),_0x24ad7e=_0x41e748['data'];_0x3d2a0f[_0x5ca94f(0x148)]&&console[_0x5ca94f(0x144)](_0x5ca94f(0x139)+_0x24ad7e);const _0x485efa=await withSpinner(_0x5ca94f(0x122)+_0x2971b5+_0x5ca94f(0xc4),()=>_0x1f0381[_0x5ca94f(0xd0)]['resolveFolderId'](_0x24ad7e,_0x2971b5),{'verbose':_0x3d2a0f[_0x5ca94f(0x148)]}),_0x572b68=_0x485efa[_0x5ca94f(0x11f)];_0x3d2a0f[_0x5ca94f(0x148)]&&console[_0x5ca94f(0x144)](_0x5ca94f(0x152)+_0x572b68);const _0x2afa3e=await withSpinner(_0x5ca94f(0x14b)+_0x2971b5+'\x27...',()=>_0x1f0381['segment']['getFolder'](_0x572b68),{'verbose':_0x3d2a0f[_0x5ca94f(0x148)]});return await handleSDKOutput([_0x2afa3e[_0x5ca94f(0x11f)]],_0x3d2a0f),0x0;}catch(_0x29e2d3){if(_0x29e2d3 instanceof SDKError)return console[_0x5ca94f(0x144)]('Error:\x20'+_0x29e2d3[_0x5ca94f(0x15c)]),_0x29e2d3['cause']&&console['error'](_0x5ca94f(0xca)+_0x29e2d3[_0x5ca94f(0x15e)]),0x1;throw _0x29e2d3;}}}export class SegmentSQLCommand extends BaseCommand{['name']='segment:sql';['description']=a35_0x887130(0x103);async['execute'](_0x2afeda){const _0x2b10f1=a35_0x887130,{options:_0x379af6,args:_0x1e7fb2}=_0x2afeda,_0x569248=_0x379af6,_0x58fb03=_0x569248[_0x2b10f1(0xd4)],_0x3c5782=_0x1e7fb2[0x0];if(!_0x3c5782&&!_0x58fb03)return console[_0x2b10f1(0x144)](a35_0x557d03[_0x2b10f1(0x12c)](_0x2b10f1(0x12f))),console[_0x2b10f1(0x144)](_0x2b10f1(0x159)),console[_0x2b10f1(0x144)](_0x2b10f1(0xd9)),console['error'](_0x2b10f1(0x116)),console[_0x2b10f1(0x144)](_0x2b10f1(0x109)),console[_0x2b10f1(0x144)](_0x2b10f1(0xd5)),console[_0x2b10f1(0x144)](_0x2b10f1(0x102)),0x1;if(_0x3c5782&&_0x58fb03)return console[_0x2b10f1(0x144)](a35_0x557d03[_0x2b10f1(0x12c)](_0x2b10f1(0x126))),0x1;try{let _0x1b8be8;if(_0x58fb03)_0x1b8be8=await this[_0x2b10f1(0x156)](_0x58fb03,_0x2afeda);else{if(isYamlFilePath(_0x3c5782))return console[_0x2b10f1(0x144)](a35_0x557d03[_0x2b10f1(0x12c)]('Error:\x20YAML\x20file\x20paths\x20must\x20be\x20specified\x20with\x20--path\x20option')),console['error'](_0x2b10f1(0xdc)+_0x3c5782),0x1;else _0x1b8be8=await this['getSQLFromServerSegment'](_0x3c5782,_0x2afeda);}return _0x379af6[_0x2b10f1(0x166)]==='json'||_0x379af6[_0x2b10f1(0x166)]==='jsonl'?await handleSDKOutput([{'sql':_0x1b8be8}],_0x379af6):console[_0x2b10f1(0x160)](_0x1b8be8),0x0;}catch(_0x7f8126){if(_0x7f8126 instanceof SDKError)return console['error'](_0x2b10f1(0x161)+_0x7f8126['message']),_0x7f8126[_0x2b10f1(0x15e)]&&console[_0x2b10f1(0x144)](_0x2b10f1(0xca)+_0x7f8126['cause']),0x1;throw _0x7f8126;}}async[a35_0x887130(0x156)](_0x4f7992,_0x1a80f5){const _0x446013=a35_0x887130,{options:_0x52c51e,tdx:_0x24994c}=_0x1a80f5;let _0x55cfab;try{_0x55cfab=await resolveYamlFilePath(_0x4f7992);}catch(_0x1b34b9){throw new SDKError(ErrorCode[_0x446013(0xcc)],_0x446013(0x10e)+_0x1b34b9['message']);}_0x52c51e[_0x446013(0x148)]&&console[_0x446013(0x144)](_0x446013(0x105)+_0x55cfab[_0x446013(0xce)]+'/'+_0x55cfab['segmentName']);const _0x14aa1a=await withSpinner(_0x446013(0x158),()=>_0x24994c[_0x446013(0xd0)][_0x446013(0x14d)](_0x55cfab[_0x446013(0x168)],_0x55cfab[_0x446013(0xce)],_0x55cfab['segmentName']),{'verbose':_0x52c51e[_0x446013(0x148)]});return _0x14aa1a[_0x446013(0x11f)];}async[a35_0x887130(0xec)](_0x449779,_0x527126){const _0x528577=a35_0x887130,{options:_0x2d647f,tdx:_0x4d5b5a}=_0x527126,_0x401149=_0x2d647f[_0x528577(0xce)],_0x5215f2=await resolveSegmentTarget(_0x449779,_0x401149,_0x2d647f[_0x528577(0x148)]);_0x2d647f[_0x528577(0x148)]&&console[_0x528577(0x144)](_0x528577(0x130)+_0x5215f2);const _0xf59f3f=await withSpinner(_0x528577(0xdd)+_0x449779+_0x528577(0xc4),()=>_0x4d5b5a['segment'][_0x528577(0x16a)](_0x5215f2),{'verbose':_0x2d647f[_0x528577(0x148)]}),_0x3d7b56=_0xf59f3f['data'];_0x2d647f['verbose']&&(console[_0x528577(0x144)]('Resolved\x20type:\x20'+_0x3d7b56[_0x528577(0xc2)]),console[_0x528577(0x144)](_0x528577(0x11a)+_0x3d7b56[_0x528577(0x110)]));if(_0x3d7b56[_0x528577(0xc2)]===_0x528577(0xd8))throw new SDKError(ErrorCode[_0x528577(0xcc)],_0x528577(0x162));if(_0x3d7b56[_0x528577(0xc2)]==='parent')throw new SDKError(ErrorCode[_0x528577(0xcc)],'Cannot\x20get\x20SQL\x20for\x20parent\x20segment\x20with\x20this\x20command.\x20Use:\x20tdx\x20ps\x20sql');if(!_0x3d7b56['segmentId'])throw new SDKError(ErrorCode[_0x528577(0xc0)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x45f765=await withSpinner(_0x528577(0x131),()=>_0x4d5b5a[_0x528577(0xd0)]['getSegmentSQL'](_0x3d7b56[_0x528577(0x110)],_0x3d7b56[_0x528577(0x13c)]),{'verbose':_0x2d647f['verbose']});return _0x45f765[_0x528577(0x11f)];}}export class SegmentFolderCreateCommand extends BaseCommand{[a35_0x887130(0x151)]=a35_0x887130(0x149);[a35_0x887130(0x16b)]=a35_0x887130(0x157);async[a35_0x887130(0x154)](_0x3b6983){const _0x5a9693=a35_0x887130,{options:_0x4c81e0,args:_0x53bcf0,tdx:_0x252a94}=_0x3b6983,_0x17afd6=_0x4c81e0;if(_0x53bcf0[_0x5a9693(0xf4)]<0x2)return console[_0x5a9693(0x144)](_0x5a9693(0x12b)),console[_0x5a9693(0x144)]('Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]'),0x1;const _0x35c234=_0x53bcf0[0x0],_0x2c741f=_0x53bcf0[0x1];_0x17afd6[_0x5a9693(0x148)]&&(console['error'](_0x5a9693(0xfd)+_0x17afd6['site']),console[_0x5a9693(0x144)](_0x5a9693(0x11b)+_0x35c234),console[_0x5a9693(0x144)](_0x5a9693(0x10f)+_0x2c741f));let _0x4aac6e;if(_0x17afd6[_0x5a9693(0x163)]){const _0x444d86=_0x17afd6['parentFolder'],_0x5711c1=await withSpinner(_0x5a9693(0x13e)+_0x35c234+_0x5a9693(0xc4),()=>_0x252a94['segment'][_0x5a9693(0xf9)](_0x35c234),{'verbose':_0x17afd6[_0x5a9693(0x148)]}),_0x23f20c=_0x5711c1[_0x5a9693(0x11f)],_0x4c92d5=await withSpinner(_0x5a9693(0xee)+_0x444d86+'\x27...',()=>_0x252a94[_0x5a9693(0xd0)][_0x5a9693(0x108)](_0x23f20c,_0x444d86),{'verbose':_0x17afd6[_0x5a9693(0x148)]});_0x4aac6e=_0x4c92d5[_0x5a9693(0x11f)],_0x17afd6[_0x5a9693(0x148)]&&console['error'](_0x5a9693(0xf5)+_0x4aac6e);}const _0x1c9a7f={'name':_0x2c741f,'description':_0x17afd6[_0x5a9693(0x16b)],'parentFolderId':_0x4aac6e},_0xbf5655=await withSpinner(_0x5a9693(0xbf)+_0x2c741f+_0x5a9693(0xc4),()=>_0x252a94[_0x5a9693(0xd0)][_0x5a9693(0x107)](_0x35c234,_0x1c9a7f),{'verbose':_0x17afd6[_0x5a9693(0x148)]}),_0x3c14ec=_0xbf5655['data'];return console[_0x5a9693(0x144)](_0x5a9693(0x100)+_0x3c14ec[_0x5a9693(0x151)]+_0x5a9693(0x167)+_0x3c14ec['id']),await handleSDKOutput([_0x3c14ec],_0x17afd6),0x0;}}export class SegmentViewCommand extends BaseCommand{[a35_0x887130(0x151)]=a35_0x887130(0x112);[a35_0x887130(0x16b)]=a35_0x887130(0x15f);async[a35_0x887130(0x154)](_0x1aea56){const _0x4f5b65=a35_0x887130,{options:_0x518431,args:_0x2d6bd9,tdx:_0x50762d}=_0x1aea56,_0x5dd59f=_0x2d6bd9[0x0];if(!_0x5dd59f)return console[_0x4f5b65(0x144)](_0x4f5b65(0x147)),console[_0x4f5b65(0x144)]('Usage:\x20tdx\x20sg\x20view\x20<name>\x20[-w]'),console['error'](_0x4f5b65(0x11d)),console[_0x4f5b65(0x144)](_0x4f5b65(0x140)),console[_0x4f5b65(0x144)](_0x4f5b65(0x124)),console[_0x4f5b65(0x144)](_0x4f5b65(0x109)),console[_0x4f5b65(0x144)]('\x20\x20tdx\x20sg\x20view\x20\x22Marketing\x22\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20folder\x20details'),console[_0x4f5b65(0x144)](_0x4f5b65(0xe5)),console[_0x4f5b65(0x144)](_0x4f5b65(0x164)),console['error'](_0x4f5b65(0x127)),0x1;try{const _0x8c0161=_0x518431[_0x4f5b65(0xce)],_0x11f3c4=await resolveSegmentTarget(_0x5dd59f,_0x8c0161,_0x518431[_0x4f5b65(0x148)]);_0x518431['verbose']&&console['error'](_0x4f5b65(0x130)+_0x11f3c4);const _0x4e81fc=await withSpinner(_0x4f5b65(0xdd)+_0x5dd59f+_0x4f5b65(0xc4),()=>_0x50762d[_0x4f5b65(0xd0)][_0x4f5b65(0x16a)](_0x11f3c4),{'verbose':_0x518431[_0x4f5b65(0x148)]}),_0x246a85=_0x4e81fc['data'];_0x518431[_0x4f5b65(0x148)]&&(console[_0x4f5b65(0x144)](_0x4f5b65(0x155)+_0x246a85[_0x4f5b65(0xc2)]),console[_0x4f5b65(0x144)]('Parent\x20ID:\x20'+_0x246a85[_0x4f5b65(0x110)]),_0x246a85[_0x4f5b65(0x117)]&&console[_0x4f5b65(0x144)](_0x4f5b65(0x12e)+_0x246a85['folderId']),_0x246a85['segmentId']&&console[_0x4f5b65(0x144)]('Segment\x20ID:\x20'+_0x246a85['segmentId']));if(_0x518431['web']){if(_0x246a85[_0x4f5b65(0xc2)]===_0x4f5b65(0xd8))return console['error'](_0x4f5b65(0xcd)),0x1;if(_0x246a85[_0x4f5b65(0xc2)]===_0x4f5b65(0x10c))return console[_0x4f5b65(0x144)](_0x4f5b65(0x125)),console['error'](_0x4f5b65(0xdb)),0x1;if(!_0x246a85[_0x4f5b65(0x13c)])throw new SDKError(ErrorCode[_0x4f5b65(0xc0)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x1c93e9=getConsoleNextUrl(_0x518431['site'],'/app/ps/'+_0x246a85[_0x4f5b65(0x110)]+'/e/'+_0x246a85['segmentId']);return console[_0x4f5b65(0x144)](a35_0x557d03[_0x4f5b65(0xd6)]('✔')+_0x4f5b65(0xf7)+a35_0x557d03[_0x4f5b65(0xfb)](_0x1c93e9)),openBrowser(_0x1c93e9),0x0;}if(_0x246a85[_0x4f5b65(0xc2)]==='folder'){if(!_0x246a85[_0x4f5b65(0x117)])throw new SDKError(ErrorCode[_0x4f5b65(0x114)],_0x4f5b65(0x138));const _0x3a5d4d=await withSpinner(_0x4f5b65(0xed),()=>_0x50762d[_0x4f5b65(0xd0)][_0x4f5b65(0xf1)](_0x246a85['folderId']),{'verbose':_0x518431[_0x4f5b65(0x148)]});await handleSingleObjectOutput(_0x3a5d4d[_0x4f5b65(0x11f)],_0x518431);}else{if(_0x246a85[_0x4f5b65(0xc2)]===_0x4f5b65(0xd0)){if(!_0x246a85[_0x4f5b65(0x13c)])throw new SDKError(ErrorCode[_0x4f5b65(0xc0)],_0x4f5b65(0xde));const _0x54aabb=await withSpinner(_0x4f5b65(0x15b),()=>_0x50762d['segment'][_0x4f5b65(0x11c)](_0x246a85[_0x4f5b65(0x110)],_0x246a85['segmentId']),{'verbose':_0x518431[_0x4f5b65(0x148)]}),_0x2f72eb=getConsoleNextUrl(_0x518431[_0x4f5b65(0xfc)],_0x4f5b65(0xcf)+_0x246a85[_0x4f5b65(0x110)]+_0x4f5b65(0xc6)+_0x246a85[_0x4f5b65(0x13c)]),_0x118532=_0x54aabb[_0x4f5b65(0x11f)];_0x118532[_0x4f5b65(0xe2)]=_0x2f72eb,await handleSingleObjectOutput(_0x118532,_0x518431);}else return console['error'](_0x4f5b65(0x101)),console['error'](_0x4f5b65(0x146)),0x1;}return 0x0;}catch(_0x4700ac){if(_0x4700ac instanceof SDKError)return console[_0x4f5b65(0x144)](_0x4f5b65(0x161)+_0x4700ac[_0x4f5b65(0x15c)]),_0x4700ac[_0x4f5b65(0x15e)]&&console[_0x4f5b65(0x144)](_0x4f5b65(0xca)+_0x4700ac[_0x4f5b65(0x15e)]),0x1;throw _0x4700ac;}}}export const SegmentInfoCommand=SegmentViewCommand;export class SegmentDescCommand extends BaseCommand{[a35_0x887130(0x151)]='segment:desc';[a35_0x887130(0x16b)]='Show\x20child\x20segment\x20schema\x20(column\x20types)';async[a35_0x887130(0x154)](_0x1fd0f2){const _0x2cc43c=a35_0x887130,{options:_0x3d3fa6,args:_0x25fc11,tdx:_0x7b03c}=_0x1fd0f2,_0x476280=_0x25fc11[0x0];if(!_0x476280)return console[_0x2cc43c(0x144)](_0x2cc43c(0xf8)),console['error'](_0x2cc43c(0x150)),console[_0x2cc43c(0x144)](_0x2cc43c(0x128)),console[_0x2cc43c(0x144)](_0x2cc43c(0x109)),console['error'](_0x2cc43c(0xdf)),console[_0x2cc43c(0x144)](_0x2cc43c(0x133)),0x1;try{const _0x48c632=_0x3d3fa6[_0x2cc43c(0xce)],_0x2febb0=await resolveSegmentTarget(_0x476280,_0x48c632,_0x3d3fa6[_0x2cc43c(0x148)]);_0x3d3fa6[_0x2cc43c(0x148)]&&console[_0x2cc43c(0x144)](_0x2cc43c(0x130)+_0x2febb0);const _0x4b46e0=await withSpinner(_0x2cc43c(0xdd)+_0x476280+_0x2cc43c(0xc4),()=>_0x7b03c[_0x2cc43c(0xd0)][_0x2cc43c(0x16a)](_0x2febb0),{'verbose':_0x3d3fa6[_0x2cc43c(0x148)]}),_0x47c86c=_0x4b46e0['data'];_0x3d3fa6['verbose']&&(console['error']('Resolved\x20type:\x20'+_0x47c86c[_0x2cc43c(0xc2)]),console[_0x2cc43c(0x144)]('Parent\x20ID:\x20'+_0x47c86c[_0x2cc43c(0x110)]));if(_0x47c86c['type']===_0x2cc43c(0xd8))return console[_0x2cc43c(0x144)](_0x2cc43c(0xe6)),console[_0x2cc43c(0x144)]('Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.'),0x1;if(_0x47c86c[_0x2cc43c(0xc2)]===_0x2cc43c(0x10c))return console[_0x2cc43c(0x144)](_0x2cc43c(0xf0)),console[_0x2cc43c(0x144)](_0x2cc43c(0xe3)),0x1;if(!_0x47c86c[_0x2cc43c(0x13c)])throw new SDKError(ErrorCode[_0x2cc43c(0xc0)],_0x2cc43c(0xde));const _0x382fb6=await withSpinner(_0x2cc43c(0x131),()=>_0x7b03c[_0x2cc43c(0xd0)][_0x2cc43c(0xe0)](_0x47c86c['parentId'],_0x47c86c[_0x2cc43c(0x13c)]),{'verbose':_0x3d3fa6[_0x2cc43c(0x148)]}),_0x3fa55f=_0x382fb6[_0x2cc43c(0x11f)],_0x398556=await executeSchemaQuery(_0x3fa55f,_0x7b03c,_0x3d3fa6);return await handleQueryOutput(_0x398556,_0x3d3fa6),0x0;}catch(_0xfb4648){if(_0xfb4648 instanceof SDKError)return console[_0x2cc43c(0x144)](_0x2cc43c(0x161)+_0xfb4648[_0x2cc43c(0x15c)]),_0xfb4648[_0x2cc43c(0x15e)]&&console[_0x2cc43c(0x144)](_0x2cc43c(0xca)+_0xfb4648[_0x2cc43c(0x15e)]),0x1;throw _0xfb4648;}}}
1
+ const a35_0xb2e73=a35_0x2749;function a35_0xd446(){const _0x35aacf=['getSQLFromYamlFile','Error:\x20Cannot\x20view\x20parent\x20segment\x20details\x20with\x20this\x20command.','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20show\x20<path/to/segment.yml>','getSQLFromServerSegment','segment:folder:show','7IAHxLI','\x20\x20tdx\x20sg\x20view\x20\x22Marketing\x22\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20folder\x20details','Fetching\x20folder\x20details...','Parent\x20ID:\x20','execute','Error:\x20Cannot\x20open\x20parent\x20segment\x20with\x20this\x20command.','Usage:\x20tdx\x20segment\x20describe\x20<path>','Resolving\x20\x27','✖\x20Query\x20failed\x20[','data','Use:\x20tdx\x20ps\x20show','Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required','url','INVALID_ARGUMENT','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','jobId','Resolving\x20parent\x20folder\x20\x27','1512078GlMkKU','✔\x20Query\x20completed:\x20Processed\x20','\x20[Job\x20ID:\x20','description','Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.','41880AXAKJq','Show\x20segment\x20folder\x20details','Error:\x20Cannot\x20show\x20schema\x20for\x20a\x20folder.','log','SEGMENT_NOT_FOUND','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','type','Resolved\x20folder\x20ID:\x20','Folder\x20ID:\x20','Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required','3975224CSHFTS','folderId','Segment\x20ID:\x20','segment','\x20\x20tdx\x20sg\x20show\x20segments/my-audience/premium-users.yml','replace','segmentId','Resolved\x20relative\x20path\x20to:\x20','Usage:\x20tdx\x20sg\x20show\x20<name>','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20-w\x20\x20#\x20Open\x20segment\x20in\x20web\x20browser','\x20\x20tdx\x20sg\x20desc\x20segments/my-audience/premium-users.yml','cause','getParent','\x20\x20tdx\x20sg\x20sql\x20\x22Premium\x20Users\x22','segment:folder:list','Resolved\x20type:\x20','folder','Options:','SQL\x20query:\x0a','Listing\x20folders\x20for\x20parent\x20\x27','Resolved\x20parent\x20ID:\x20','segment:sql','site','\x27...','Use:\x20tdx\x20ps\x20desc','code','Use:\x20tdx\x20ps\x20view','20743hVwxXj','segmentPath','\x27\x20with\x20ID:\x20','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','limit','length','segment:folder:create','resolvePathToResource','891oOsTUy','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20\x20\x20\x20\x20#\x20View\x20child\x20segment\x20details','includes','\x20folder','segment:desc','getSegment','Use:\x20tdx\x20ps\x20view\x20-w','\x20\x20tdx\x20sg\x20show\x20\x22Premium\x20Users\x22','getSegmentSQLFromYaml','\x20\x20-w,\x20--web\x20\x20Open\x20segment\x20in\x20web\x20browser','Error:\x20Cannot\x20open\x20folder\x20in\x20web\x20browser.\x20Use\x20a\x20segment\x20name\x20instead.','Usage:\x20tdx\x20sg\x20desc\x20<name>','Error:\x20Segment\x20name\x20or\x20--path\x20is\x20required','trim','Usage:','Target\x20path:\x20','json','Fetching\x20SQL\x20for\x20segment...','\x20\x20tdx\x20sg\x20desc\x20\x22Premium\x20Users\x22','resolveFolderId','Fetching\x20folder\x20\x27','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','getSegmentSQL','Folder\x20name:\x20','\x20\x20Local\x20YAML\x20file:\x20\x20\x20\x20\x20\x20tdx\x20sg\x20sql\x20--path\x20<file-path>','\x20\x20Folder\x20path:\x20','SEGMENT_FOLDER_NOT_FOUND','content','Examples:','Error:\x20Specify\x20either\x20segment\x20name\x20or\x20--path,\x20not\x20both','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20desc\x20<path/to/segment.yml>','Error:\x20','segment:show','message','160085gPHFnD','\x20\x20Server-side\x20segment:\x20\x20tdx\x20sg\x20sql\x20<name>','Error:\x20Cannot\x20show\x20schema\x20for\x20parent\x20segment\x20with\x20this\x20command.','✔\x20Created\x20folder\x20\x27','Usage:\x20tdx\x20sg\x20view\x20<name>\x20[-w]','Resolved\x20parent\x20folder\x20ID:\x20','Show\x20child\x20segment\x20schema\x20(column\x20types)','name','parentId','folderPath','SELECT\x20*\x20FROM\x20(\x0a','Folder\x20ID\x20missing\x20from\x20resolved\x20path','\x20rows\x20','error','22csxZPb','Creating\x20folder\x20\x27','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','jsonl','Resolving\x20parent\x20segment\x20\x27','getFolder','List\x20segment\x20folders\x20under\x20a\x20parent\x20segment','119487iSDFXO','Resolved\x20YAML\x20file:\x20','Parent\x20name:\x20','test','Resolving\x20folder\x20\x27','parentSegment','Get\x20SQL\x20query\x20for\x20child\x20segment','Execute\x20child\x20segment\x20SQL\x20query\x20and\x20show\x20results','information_schema','listFolders','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20view\x20<path/to/segment.yml>','Site:\x20','segment:view','Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>','Fetching\x20SQL\x20from\x20rule...','red','\x20\x20Cause:\x20','stats','\x20Opening\x20','\x20\x20Segment\x20name:\x20','Executing\x20segment\x20query...','elapsedTimeMillis','Parent\x20segment:\x20','parent','Segment\x20ID\x20missing\x20from\x20resolved\x20path','Fetching\x20segment\x20details...','fullPath','verbose','\x20\x20tdx\x20sg\x20view\x20segments/my-audience/premium-users.yml','setJobId','Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]','/e/','\x20\x20tdx\x20sg\x20sql\x20--path\x20segments/my-audience/premium-users.yml','274640sjYGsu','32CbEnOi','Error:\x20Folder\x20or\x20segment\x20name,\x20or\x20YAML\x20file\x20path\x20is\x20required','resolveParentId','/app/ps/','segmentName','Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>','format','segment:describe'];a35_0xd446=function(){return _0x35aacf;};return a35_0xd446();}(function(_0x177e42,_0x513fce){const _0xf3b71c=a35_0x2749,_0x58b0db=_0x177e42();while(!![]){try{const _0x3f584f=parseInt(_0xf3b71c(0x1a2))/0x1*(parseInt(_0xf3b71c(0x1da))/0x2)+parseInt(_0xf3b71c(0x1e1))/0x3*(-parseInt(_0xf3b71c(0x203))/0x4)+parseInt(_0xf3b71c(0x1cc))/0x5+-parseInt(_0xf3b71c(0x178))/0x6*(parseInt(_0xf3b71c(0x167))/0x7)+-parseInt(_0xf3b71c(0x202))/0x8+-parseInt(_0xf3b71c(0x1aa))/0x9*(-parseInt(_0xf3b71c(0x17d))/0xa)+parseInt(_0xf3b71c(0x187))/0xb;if(_0x3f584f===_0x513fce)break;else _0x58b0db['push'](_0x58b0db['shift']());}catch(_0x5b5eb6){_0x58b0db['push'](_0x58b0db['shift']());}}}(a35_0xd446,0x6946b));function a35_0x2749(_0x181e02,_0x9a88a0){_0x181e02=_0x181e02-0x165;const _0xd446c1=a35_0xd446();let _0x274983=_0xd446c1[_0x181e02];return _0x274983;}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 a35_0xae67ad from'chalk';async function resolveSegmentTarget(_0x5d8cd7,_0x1fc9ae,_0x4ab06c){const _0x20cae1=a35_0x2749;if(isYamlFilePath(_0x5d8cd7))try{const _0x2673ad=await resolveYamlFilePath(_0x5d8cd7);return _0x4ab06c&&(console[_0x20cae1(0x1d9)](_0x20cae1(0x1e2)+_0x5d8cd7),console[_0x20cae1(0x1d9)]('\x20\x20Parent\x20segment:\x20'+_0x2673ad['parentSegment']),console[_0x20cae1(0x1d9)](_0x20cae1(0x1f4)+_0x2673ad[_0x20cae1(0x207)]),console[_0x20cae1(0x1d9)](_0x20cae1(0x1c3)+(_0x2673ad[_0x20cae1(0x1d5)]||'(root)')),console[_0x20cae1(0x1d9)]('\x20\x20Full\x20path:\x20'+_0x2673ad[_0x20cae1(0x1fb)])),_0x2673ad[_0x20cae1(0x1fb)];}catch(_0x13308c){throw new SDKError(ErrorCode[_0x20cae1(0x174)],_0x20cae1(0x1dc)+_0x13308c[_0x20cae1(0x1cb)]);}if(!_0x1fc9ae)throw new SDKError(ErrorCode[_0x20cae1(0x174)],_0x20cae1(0x182));return _0x1fc9ae+'/'+_0x5d8cd7;}export class SegmentDescribeCommand extends BaseCommand{['name']=a35_0xb2e73(0x20a);[a35_0xb2e73(0x17b)]='Show\x20segment\x20or\x20folder\x20details';async['execute'](_0x23077a){const _0x412fa8=a35_0xb2e73,{options:_0x292ff3,args:_0x357276,tdx:_0x1bb076}=_0x23077a,_0xc998ec=_0x357276[0x0],_0x1b09d6=!_0xc998ec&&!!_0x292ff3[_0x412fa8(0x1e6)],_0x2424e7=_0xc998ec||_0x292ff3[_0x412fa8(0x1e6)];if(!_0x2424e7)return console['error']('Error:\x20Path\x20or\x20name\x20is\x20required'),console[_0x412fa8(0x1d9)](_0x412fa8(0x16d)),console[_0x412fa8(0x1d9)](_0x412fa8(0x1c6)),console[_0x412fa8(0x1d9)]('\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22'),console['error']('\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22'),console[_0x412fa8(0x1d9)]('\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context'),console['error'](_0x412fa8(0x1a5)),0x1;try{const _0x35e8f5=_0x292ff3[_0x412fa8(0x1a3)];let _0x205092=_0x2424e7;!_0x1b09d6&&_0x35e8f5&&!_0x2424e7[_0x412fa8(0x1ac)]('/')&&(_0x205092=_0x35e8f5+'/'+_0x2424e7,_0x292ff3[_0x412fa8(0x1fc)]&&console[_0x412fa8(0x1d9)](_0x412fa8(0x18e)+_0x205092));const _0x23d40d=await withSpinner('Resolving\x20path\x20\x27'+_0x205092+'\x27...',()=>_0x1bb076[_0x412fa8(0x18a)]['resolvePathToResource'](_0x205092),{'verbose':_0x292ff3[_0x412fa8(0x1fc)]}),_0x2e2dd4=_0x23d40d[_0x412fa8(0x170)];_0x292ff3[_0x412fa8(0x1fc)]&&(console[_0x412fa8(0x1d9)](_0x412fa8(0x196)+_0x2e2dd4[_0x412fa8(0x183)]),console[_0x412fa8(0x1d9)](_0x412fa8(0x16a)+_0x2e2dd4[_0x412fa8(0x1d4)]),_0x2e2dd4[_0x412fa8(0x188)]&&console[_0x412fa8(0x1d9)]('Folder\x20ID:\x20'+_0x2e2dd4[_0x412fa8(0x188)]),_0x2e2dd4[_0x412fa8(0x18d)]&&console[_0x412fa8(0x1d9)](_0x412fa8(0x189)+_0x2e2dd4[_0x412fa8(0x18d)]));if(_0x2e2dd4[_0x412fa8(0x183)]===_0x412fa8(0x1f8)){const _0x524bf6=await withSpinner('Fetching\x20parent\x20segment\x20details...',()=>_0x1bb076[_0x412fa8(0x18a)][_0x412fa8(0x193)](_0x2e2dd4['parentId']),{'verbose':_0x292ff3['verbose']});await handleSingleObjectOutput(_0x524bf6[_0x412fa8(0x170)],_0x292ff3);}else{if(_0x2e2dd4[_0x412fa8(0x183)]===_0x412fa8(0x197)){if(!_0x2e2dd4[_0x412fa8(0x188)])throw new SDKError(ErrorCode[_0x412fa8(0x1c4)],_0x412fa8(0x1d7));const _0x3f8791=await withSpinner(_0x412fa8(0x169),()=>_0x1bb076['segment'][_0x412fa8(0x1df)](_0x2e2dd4['folderId']),{'verbose':_0x292ff3[_0x412fa8(0x1fc)]});await handleSingleObjectOutput(_0x3f8791[_0x412fa8(0x170)],_0x292ff3);}else{if(_0x2e2dd4[_0x412fa8(0x183)]==='segment'){if(!_0x2e2dd4[_0x412fa8(0x18d)])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x412fa8(0x1f9));const _0x2715a4=await withSpinner(_0x412fa8(0x1fa),()=>_0x1bb076[_0x412fa8(0x18a)]['getSegment'](_0x2e2dd4['parentId'],_0x2e2dd4[_0x412fa8(0x18d)]),{'verbose':_0x292ff3[_0x412fa8(0x1fc)]});await handleSingleObjectOutput(_0x2715a4[_0x412fa8(0x170)],_0x292ff3);}}}return 0x0;}catch(_0x15ed8a){if(_0x15ed8a instanceof SDKError)return console[_0x412fa8(0x1d9)](_0x412fa8(0x1c9)+_0x15ed8a[_0x412fa8(0x1cb)]),_0x15ed8a[_0x412fa8(0x192)]&&console['error'](_0x412fa8(0x1f1)+_0x15ed8a['cause']),0x1;throw _0x15ed8a;}}}export class SegmentShowCommand extends BaseCommand{[a35_0xb2e73(0x1d3)]=a35_0xb2e73(0x1ca);['description']=a35_0xb2e73(0x1e8);async['execute'](_0x927400){const _0x2b50f7=a35_0xb2e73,{options:_0x4cc6cb,args:_0x2b312e,tdx:_0x4d0605}=_0x927400,_0x509e4c=_0x2b312e[0x0];if(!_0x509e4c)return console[_0x2b50f7(0x1d9)](_0x2b50f7(0x186)),console[_0x2b50f7(0x1d9)](_0x2b50f7(0x18f)),console[_0x2b50f7(0x1d9)](_0x2b50f7(0x20d)),console[_0x2b50f7(0x1d9)]('Examples:'),console[_0x2b50f7(0x1d9)](_0x2b50f7(0x1b1)),console[_0x2b50f7(0x1d9)](_0x2b50f7(0x18b)),0x1;try{const _0x4f203e=_0x4cc6cb[_0x2b50f7(0x1e6)],_0x2d9047=await resolveSegmentTarget(_0x509e4c,_0x4f203e,_0x4cc6cb[_0x2b50f7(0x1fc)]);_0x4cc6cb[_0x2b50f7(0x1fc)]&&console[_0x2b50f7(0x1d9)](_0x2b50f7(0x1b9)+_0x2d9047);const _0xc8150e=await withSpinner(_0x2b50f7(0x16e)+_0x509e4c+_0x2b50f7(0x19e),()=>_0x4d0605[_0x2b50f7(0x18a)][_0x2b50f7(0x1a9)](_0x2d9047),{'verbose':_0x4cc6cb[_0x2b50f7(0x1fc)]}),_0x4eea1a=_0xc8150e[_0x2b50f7(0x170)];_0x4cc6cb[_0x2b50f7(0x1fc)]&&(console[_0x2b50f7(0x1d9)](_0x2b50f7(0x196)+_0x4eea1a[_0x2b50f7(0x183)]),console['error'](_0x2b50f7(0x16a)+_0x4eea1a[_0x2b50f7(0x1d4)]));if(_0x4eea1a[_0x2b50f7(0x183)]==='folder')return console[_0x2b50f7(0x1d9)](_0x2b50f7(0x17c)),console[_0x2b50f7(0x1d9)]('Use:\x20tdx\x20sg\x20view\x20<name>\x20\x20#\x20To\x20show\x20folder\x20details'),0x1;if(_0x4eea1a[_0x2b50f7(0x183)]==='parent')return console['error']('Error:\x20Cannot\x20execute\x20query\x20for\x20parent\x20segment\x20with\x20this\x20command.'),console[_0x2b50f7(0x1d9)](_0x2b50f7(0x171)),0x1;if(!_0x4eea1a[_0x2b50f7(0x18d)])throw new SDKError(ErrorCode[_0x2b50f7(0x181)],_0x2b50f7(0x1f9));const _0x13bf3c=await withSpinner(_0x2b50f7(0x1bb),()=>_0x4d0605[_0x2b50f7(0x18a)][_0x2b50f7(0x1c0)](_0x4eea1a[_0x2b50f7(0x1d4)],_0x4eea1a[_0x2b50f7(0x18d)]),{'verbose':_0x4cc6cb[_0x2b50f7(0x1fc)]});let _0x500736=_0x13bf3c['data'];const _0x28a676=resolveLimit(_0x4cc6cb[_0x2b50f7(0x1a6)],DEFAULT_DISPLAY_LIMIT),_0x56a4a3=/\bLIMIT\s+\d+/i[_0x2b50f7(0x1e4)](_0x500736);!_0x56a4a3&&(_0x500736=_0x500736[_0x2b50f7(0x1b7)]()[_0x2b50f7(0x18c)](/;+$/,''),_0x500736=_0x2b50f7(0x1d6)+_0x500736+_0x2b50f7(0x175)+_0x28a676);_0x4cc6cb[_0x2b50f7(0x1fc)]&&console[_0x2b50f7(0x1d9)](_0x2b50f7(0x199)+_0x500736);const _0x269eb7=await withProgressSpinner(_0x2b50f7(0x1f5),async _0x488c54=>{const _0x4391d8=_0x2b50f7,_0x54013a=await _0x4d0605['query'][_0x4391d8(0x16b)](_0x500736,{'catalog':'td','schema':_0x4391d8(0x1e9),'onJobId':_0x440539=>{const _0x4b086c=_0x4391d8;_0x488c54[_0x4b086c(0x1fe)](_0x440539);}});return _0x54013a;},{'verbose':_0x4cc6cb['verbose']}),_0x4d64a6=_0x269eb7[_0x2b50f7(0x170)],_0x53e0ad=_0x4d64a6[_0x2b50f7(0x176)]?_0x2b50f7(0x17a)+_0x4d64a6[_0x2b50f7(0x176)]+']':'';return console[_0x2b50f7(0x1d9)](_0x2b50f7(0x179)+_0x4d64a6[_0x2b50f7(0x1f2)]['processedRows']['toLocaleString']()+_0x2b50f7(0x1d8)+('in\x20'+formatElapsed(_0x4d64a6['stats'][_0x2b50f7(0x1f6)])+_0x53e0ad)),await handleQueryOutput(_0x4d64a6,_0x4cc6cb),0x0;}catch(_0x48714a){if(_0x48714a instanceof SDKError)return console[_0x2b50f7(0x1d9)](_0x2b50f7(0x16f)+_0x48714a[_0x2b50f7(0x1a0)]+']'),console[_0x2b50f7(0x1d9)]('\x0a'+_0x48714a[_0x2b50f7(0x1cb)]),0x1;throw _0x48714a;}}}export class SegmentFolderListCommand extends BaseCommand{[a35_0xb2e73(0x1d3)]=a35_0xb2e73(0x195);[a35_0xb2e73(0x17b)]=a35_0xb2e73(0x1e0);async[a35_0xb2e73(0x16b)](_0x3395dc){const _0x475a7b=a35_0xb2e73,{options:_0xa40490,args:_0x1700c1,tdx:_0x113754}=_0x3395dc;if(_0x1700c1[_0x475a7b(0x1a7)]===0x0)return console['error']('Error:\x20Parent\x20segment\x20name\x20is\x20required'),console['error'](_0x475a7b(0x1ee)),0x1;const _0x32e19b=_0x1700c1[0x0];try{_0xa40490[_0x475a7b(0x1fc)]&&(console['error'](_0x475a7b(0x1ec)+_0xa40490[_0x475a7b(0x19d)]),console['error'](_0x475a7b(0x1e3)+_0x32e19b));const _0x2a30a4=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x32e19b+'\x27...',()=>_0x113754[_0x475a7b(0x18a)]['resolveParentId'](_0x32e19b),{'verbose':_0xa40490[_0x475a7b(0x1fc)]}),_0x1c923d=_0x2a30a4[_0x475a7b(0x170)];_0xa40490[_0x475a7b(0x1fc)]&&console['error'](_0x475a7b(0x19b)+_0x1c923d);const _0x1ed629=await withSpinner(_0x475a7b(0x19a)+_0x32e19b+_0x475a7b(0x19e),()=>_0x113754['segment'][_0x475a7b(0x1ea)](_0x1c923d),{'verbose':_0xa40490[_0x475a7b(0x1fc)]}),_0x30d0c6=_0x1ed629[_0x475a7b(0x170)];return console[_0x475a7b(0x1d9)]('✔\x20Found\x20'+_0x30d0c6[_0x475a7b(0x1a7)]+_0x475a7b(0x1ad)+(_0x30d0c6[_0x475a7b(0x1a7)]!==0x1?'s':'')),await handleSDKOutput(_0x30d0c6,_0xa40490),0x0;}catch(_0x4a256a){if(_0x4a256a instanceof SDKError)return console['error'](_0x475a7b(0x1c9)+_0x4a256a[_0x475a7b(0x1cb)]),_0x4a256a[_0x475a7b(0x192)]&&console['error'](_0x475a7b(0x1f1)+_0x4a256a[_0x475a7b(0x192)]),0x1;throw _0x4a256a;}}}export class SegmentFolderShowCommand extends BaseCommand{[a35_0xb2e73(0x1d3)]=a35_0xb2e73(0x166);[a35_0xb2e73(0x17b)]=a35_0xb2e73(0x17e);async[a35_0xb2e73(0x16b)](_0x365d95){const _0x1eb486=a35_0xb2e73,{options:_0x5e511d,args:_0x312854,tdx:_0x38474c}=_0x365d95;if(_0x312854[_0x1eb486(0x1a7)]===0x0)return console[_0x1eb486(0x1d9)]('Error:\x20Folder\x20reference\x20is\x20required'),console[_0x1eb486(0x1d9)](_0x1eb486(0x208)),0x1;try{const {parentId:_0x1b4c0e,childId:_0x156b2a}=parseSegmentRef(_0x312854[0x0]);_0x5e511d[_0x1eb486(0x1fc)]&&(console[_0x1eb486(0x1d9)](_0x1eb486(0x1ec)+_0x5e511d['site']),console['error']('Parent\x20name:\x20'+_0x1b4c0e),_0x156b2a&&console[_0x1eb486(0x1d9)](_0x1eb486(0x1c1)+_0x156b2a));if(!_0x156b2a)return console[_0x1eb486(0x1d9)]('Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)'),0x1;const _0x336eb6=await withSpinner(_0x1eb486(0x1de)+_0x1b4c0e+_0x1eb486(0x19e),()=>_0x38474c[_0x1eb486(0x18a)][_0x1eb486(0x205)](_0x1b4c0e),{'verbose':_0x5e511d[_0x1eb486(0x1fc)]}),_0x52e8de=_0x336eb6[_0x1eb486(0x170)];_0x5e511d[_0x1eb486(0x1fc)]&&console[_0x1eb486(0x1d9)]('Resolved\x20parent\x20ID:\x20'+_0x52e8de);const _0x136be0=await withSpinner(_0x1eb486(0x1e5)+_0x156b2a+_0x1eb486(0x19e),()=>_0x38474c[_0x1eb486(0x18a)][_0x1eb486(0x1bd)](_0x52e8de,_0x156b2a),{'verbose':_0x5e511d[_0x1eb486(0x1fc)]}),_0x500c51=_0x136be0[_0x1eb486(0x170)];_0x5e511d['verbose']&&console['error'](_0x1eb486(0x184)+_0x500c51);const _0x25886e=await withSpinner(_0x1eb486(0x1be)+_0x156b2a+_0x1eb486(0x19e),()=>_0x38474c['segment'][_0x1eb486(0x1df)](_0x500c51),{'verbose':_0x5e511d[_0x1eb486(0x1fc)]});return await handleSDKOutput([_0x25886e['data']],_0x5e511d),0x0;}catch(_0x181892){if(_0x181892 instanceof SDKError)return console[_0x1eb486(0x1d9)]('Error:\x20'+_0x181892[_0x1eb486(0x1cb)]),_0x181892[_0x1eb486(0x192)]&&console[_0x1eb486(0x1d9)]('\x20\x20Cause:\x20'+_0x181892[_0x1eb486(0x192)]),0x1;throw _0x181892;}}}export class SegmentSQLCommand extends BaseCommand{[a35_0xb2e73(0x1d3)]=a35_0xb2e73(0x19c);['description']=a35_0xb2e73(0x1e7);async[a35_0xb2e73(0x16b)](_0x20ade5){const _0x811220=a35_0xb2e73,{options:_0x3c251b,args:_0x4223af}=_0x20ade5,_0x1686fb=_0x3c251b,_0x504d3f=_0x1686fb['path'],_0xbfdf8b=_0x4223af[0x0];if(!_0xbfdf8b&&!_0x504d3f)return console[_0x811220(0x1d9)](a35_0xae67ad[_0x811220(0x1f0)](_0x811220(0x1b6))),console['error'](_0x811220(0x1b8)),console[_0x811220(0x1d9)](_0x811220(0x1cd)),console[_0x811220(0x1d9)](_0x811220(0x1c2)),console[_0x811220(0x1d9)](_0x811220(0x1c6)),console['error'](_0x811220(0x194)),console['error'](_0x811220(0x201)),0x1;if(_0xbfdf8b&&_0x504d3f)return console[_0x811220(0x1d9)](a35_0xae67ad[_0x811220(0x1f0)](_0x811220(0x1c7))),0x1;try{let _0x347acc;if(_0x504d3f)_0x347acc=await this[_0x811220(0x20b)](_0x504d3f,_0x20ade5);else{if(isYamlFilePath(_0xbfdf8b))return console[_0x811220(0x1d9)](a35_0xae67ad[_0x811220(0x1f0)]('Error:\x20YAML\x20file\x20paths\x20must\x20be\x20specified\x20with\x20--path\x20option')),console[_0x811220(0x1d9)]('\x20\x20tdx\x20sg\x20sql\x20--path\x20'+_0xbfdf8b),0x1;else _0x347acc=await this['getSQLFromServerSegment'](_0xbfdf8b,_0x20ade5);}return _0x3c251b[_0x811220(0x209)]===_0x811220(0x1ba)||_0x3c251b[_0x811220(0x209)]===_0x811220(0x1dd)?await handleSDKOutput([{'sql':_0x347acc}],_0x3c251b):console[_0x811220(0x180)](_0x347acc),0x0;}catch(_0x8c589d){if(_0x8c589d instanceof SDKError)return console[_0x811220(0x1d9)]('Error:\x20'+_0x8c589d[_0x811220(0x1cb)]),_0x8c589d[_0x811220(0x192)]&&console[_0x811220(0x1d9)](_0x811220(0x1f1)+_0x8c589d[_0x811220(0x192)]),0x1;throw _0x8c589d;}}async[a35_0xb2e73(0x20b)](_0x572699,_0x9e165b){const _0x10536a=a35_0xb2e73,{options:_0x32629d,tdx:_0x305163}=_0x9e165b;let _0x385548;try{_0x385548=await resolveYamlFilePath(_0x572699);}catch(_0x1c8adb){throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x10536a(0x1dc)+_0x1c8adb[_0x10536a(0x1cb)]);}_0x32629d[_0x10536a(0x1fc)]&&console['error']('Resolved:\x20'+_0x385548[_0x10536a(0x1e6)]+'/'+_0x385548['segmentName']);const _0x3d690a=await withSpinner(_0x10536a(0x1ef),()=>_0x305163['segment'][_0x10536a(0x1b2)](_0x385548[_0x10536a(0x1c5)],_0x385548['parentSegment'],_0x385548[_0x10536a(0x207)]),{'verbose':_0x32629d[_0x10536a(0x1fc)]});return _0x3d690a[_0x10536a(0x170)];}async[a35_0xb2e73(0x165)](_0x4acecb,_0x10e17f){const _0xd9400a=a35_0xb2e73,{options:_0x15eeed,tdx:_0x9e23e2}=_0x10e17f,_0x1057a1=_0x15eeed[_0xd9400a(0x1e6)],_0x35ba4b=await resolveSegmentTarget(_0x4acecb,_0x1057a1,_0x15eeed[_0xd9400a(0x1fc)]);_0x15eeed['verbose']&&console[_0xd9400a(0x1d9)](_0xd9400a(0x1b9)+_0x35ba4b);const _0x21e6b6=await withSpinner(_0xd9400a(0x16e)+_0x4acecb+_0xd9400a(0x19e),()=>_0x9e23e2['segment'][_0xd9400a(0x1a9)](_0x35ba4b),{'verbose':_0x15eeed[_0xd9400a(0x1fc)]}),_0x58fc32=_0x21e6b6[_0xd9400a(0x170)];_0x15eeed['verbose']&&(console[_0xd9400a(0x1d9)](_0xd9400a(0x196)+_0x58fc32['type']),console['error'](_0xd9400a(0x16a)+_0x58fc32[_0xd9400a(0x1d4)]));if(_0x58fc32[_0xd9400a(0x183)]===_0xd9400a(0x197))throw new SDKError(ErrorCode['INVALID_ARGUMENT'],'Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.\x20Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.');if(_0x58fc32[_0xd9400a(0x183)]===_0xd9400a(0x1f8))throw new SDKError(ErrorCode[_0xd9400a(0x174)],'Cannot\x20get\x20SQL\x20for\x20parent\x20segment\x20with\x20this\x20command.\x20Use:\x20tdx\x20ps\x20sql');if(!_0x58fc32[_0xd9400a(0x18d)])throw new SDKError(ErrorCode[_0xd9400a(0x181)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x421461=await withSpinner('Fetching\x20SQL\x20for\x20segment...',()=>_0x9e23e2['segment']['getSegmentSQL'](_0x58fc32[_0xd9400a(0x1d4)],_0x58fc32[_0xd9400a(0x18d)]),{'verbose':_0x15eeed['verbose']});return _0x421461[_0xd9400a(0x170)];}}export class SegmentFolderCreateCommand extends BaseCommand{['name']=a35_0xb2e73(0x1a8);[a35_0xb2e73(0x17b)]='Create\x20segment\x20folder\x20for\x20organization';async[a35_0xb2e73(0x16b)](_0x3f3882){const _0x56dad0=a35_0xb2e73,{options:_0x5abf42,args:_0x585eb3,tdx:_0x30222b}=_0x3f3882,_0x311c97=_0x5abf42;if(_0x585eb3[_0x56dad0(0x1a7)]<0x2)return console[_0x56dad0(0x1d9)](_0x56dad0(0x172)),console['error'](_0x56dad0(0x1ff)),0x1;const _0xfd98da=_0x585eb3[0x0],_0x58c385=_0x585eb3[0x1];_0x311c97[_0x56dad0(0x1fc)]&&(console[_0x56dad0(0x1d9)]('Site:\x20'+_0x311c97['site']),console[_0x56dad0(0x1d9)](_0x56dad0(0x1f7)+_0xfd98da),console[_0x56dad0(0x1d9)]('Folder\x20name:\x20'+_0x58c385));let _0x35b894;if(_0x311c97['parentFolder']){const _0x1bc8e0=_0x311c97['parentFolder'],_0x147cc5=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0xfd98da+_0x56dad0(0x19e),()=>_0x30222b['segment'][_0x56dad0(0x205)](_0xfd98da),{'verbose':_0x311c97[_0x56dad0(0x1fc)]}),_0x158f1d=_0x147cc5[_0x56dad0(0x170)],_0x2a8f7b=await withSpinner(_0x56dad0(0x177)+_0x1bc8e0+_0x56dad0(0x19e),()=>_0x30222b[_0x56dad0(0x18a)][_0x56dad0(0x1bd)](_0x158f1d,_0x1bc8e0),{'verbose':_0x311c97[_0x56dad0(0x1fc)]});_0x35b894=_0x2a8f7b[_0x56dad0(0x170)],_0x311c97[_0x56dad0(0x1fc)]&&console[_0x56dad0(0x1d9)](_0x56dad0(0x1d1)+_0x35b894);}const _0x2b6564={'name':_0x58c385,'description':_0x311c97['description'],'parentFolderId':_0x35b894},_0x29c1e9=await withSpinner(_0x56dad0(0x1db)+_0x58c385+_0x56dad0(0x19e),()=>_0x30222b[_0x56dad0(0x18a)]['createFolder'](_0xfd98da,_0x2b6564),{'verbose':_0x311c97[_0x56dad0(0x1fc)]}),_0x23399e=_0x29c1e9[_0x56dad0(0x170)];return console[_0x56dad0(0x1d9)](_0x56dad0(0x1cf)+_0x23399e[_0x56dad0(0x1d3)]+_0x56dad0(0x1a4)+_0x23399e['id']),await handleSDKOutput([_0x23399e],_0x311c97),0x0;}}export class SegmentViewCommand extends BaseCommand{[a35_0xb2e73(0x1d3)]=a35_0xb2e73(0x1ed);[a35_0xb2e73(0x17b)]='Show\x20folder\x20or\x20child\x20segment\x20details';async[a35_0xb2e73(0x16b)](_0x3738a5){const _0x373600=a35_0xb2e73,{options:_0x5b340a,args:_0x79ada2,tdx:_0x16b9a1}=_0x3738a5,_0x29d797=_0x79ada2[0x0];if(!_0x29d797)return console[_0x373600(0x1d9)](_0x373600(0x204)),console[_0x373600(0x1d9)](_0x373600(0x1d0)),console[_0x373600(0x1d9)](_0x373600(0x1eb)),console[_0x373600(0x1d9)](_0x373600(0x198)),console[_0x373600(0x1d9)](_0x373600(0x1b3)),console['error'](_0x373600(0x1c6)),console[_0x373600(0x1d9)](_0x373600(0x168)),console['error'](_0x373600(0x1ab)),console[_0x373600(0x1d9)](_0x373600(0x190)),console[_0x373600(0x1d9)](_0x373600(0x1fd)),0x1;try{const _0x1ce3f9=_0x5b340a[_0x373600(0x1e6)],_0x215f35=await resolveSegmentTarget(_0x29d797,_0x1ce3f9,_0x5b340a[_0x373600(0x1fc)]);_0x5b340a[_0x373600(0x1fc)]&&console[_0x373600(0x1d9)](_0x373600(0x1b9)+_0x215f35);const _0x568ad1=await withSpinner(_0x373600(0x16e)+_0x29d797+_0x373600(0x19e),()=>_0x16b9a1['segment'][_0x373600(0x1a9)](_0x215f35),{'verbose':_0x5b340a[_0x373600(0x1fc)]}),_0x5111b8=_0x568ad1[_0x373600(0x170)];_0x5b340a[_0x373600(0x1fc)]&&(console[_0x373600(0x1d9)]('Resolved\x20type:\x20'+_0x5111b8['type']),console['error'](_0x373600(0x16a)+_0x5111b8['parentId']),_0x5111b8[_0x373600(0x188)]&&console[_0x373600(0x1d9)](_0x373600(0x185)+_0x5111b8['folderId']),_0x5111b8[_0x373600(0x18d)]&&console[_0x373600(0x1d9)](_0x373600(0x189)+_0x5111b8['segmentId']));if(_0x5b340a['web']){if(_0x5111b8['type']===_0x373600(0x197))return console[_0x373600(0x1d9)](_0x373600(0x1b4)),0x1;if(_0x5111b8[_0x373600(0x183)]===_0x373600(0x1f8))return console['error'](_0x373600(0x16c)),console[_0x373600(0x1d9)](_0x373600(0x1b0)),0x1;if(!_0x5111b8['segmentId'])throw new SDKError(ErrorCode[_0x373600(0x181)],_0x373600(0x1f9));const _0x2deddd=getConsoleNextUrl(_0x5b340a['site'],'/app/ps/'+_0x5111b8[_0x373600(0x1d4)]+_0x373600(0x200)+_0x5111b8['segmentId']);return console['error'](a35_0xae67ad['green']('✔')+_0x373600(0x1f3)+a35_0xae67ad['cyan'](_0x2deddd)),openBrowser(_0x2deddd),0x0;}if(_0x5111b8[_0x373600(0x183)]==='folder'){if(!_0x5111b8[_0x373600(0x188)])throw new SDKError(ErrorCode[_0x373600(0x1c4)],_0x373600(0x1d7));const _0x5159ee=await withSpinner('Fetching\x20folder\x20details...',()=>_0x16b9a1[_0x373600(0x18a)][_0x373600(0x1df)](_0x5111b8[_0x373600(0x188)]),{'verbose':_0x5b340a['verbose']});await handleSingleObjectOutput(_0x5159ee[_0x373600(0x170)],_0x5b340a);}else{if(_0x5111b8[_0x373600(0x183)]==='segment'){if(!_0x5111b8[_0x373600(0x18d)])throw new SDKError(ErrorCode[_0x373600(0x181)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0xd3bc44=await withSpinner('Fetching\x20segment\x20details...',()=>_0x16b9a1[_0x373600(0x18a)][_0x373600(0x1af)](_0x5111b8[_0x373600(0x1d4)],_0x5111b8[_0x373600(0x18d)]),{'verbose':_0x5b340a[_0x373600(0x1fc)]}),_0xdd5e19=getConsoleNextUrl(_0x5b340a[_0x373600(0x19d)],_0x373600(0x206)+_0x5111b8['parentId']+_0x373600(0x200)+_0x5111b8[_0x373600(0x18d)]),_0x1dbe9a=_0xd3bc44['data'];_0x1dbe9a[_0x373600(0x173)]=_0xdd5e19,await handleSingleObjectOutput(_0x1dbe9a,_0x5b340a);}else return console[_0x373600(0x1d9)](_0x373600(0x20c)),console[_0x373600(0x1d9)](_0x373600(0x1a1)),0x1;}return 0x0;}catch(_0x3cd488){if(_0x3cd488 instanceof SDKError)return console[_0x373600(0x1d9)]('Error:\x20'+_0x3cd488[_0x373600(0x1cb)]),_0x3cd488[_0x373600(0x192)]&&console[_0x373600(0x1d9)](_0x373600(0x1f1)+_0x3cd488['cause']),0x1;throw _0x3cd488;}}}export const SegmentInfoCommand=SegmentViewCommand;export class SegmentDescCommand extends BaseCommand{[a35_0xb2e73(0x1d3)]=a35_0xb2e73(0x1ae);[a35_0xb2e73(0x17b)]=a35_0xb2e73(0x1d2);async[a35_0xb2e73(0x16b)](_0x59fe8a){const _0x34af9a=a35_0xb2e73,{options:_0x2b816d,args:_0x3d40dc,tdx:_0x2d2709}=_0x59fe8a,_0x2d977=_0x3d40dc[0x0];if(!_0x2d977)return console[_0x34af9a(0x1d9)](_0x34af9a(0x186)),console[_0x34af9a(0x1d9)](_0x34af9a(0x1b5)),console['error'](_0x34af9a(0x1c8)),console[_0x34af9a(0x1d9)]('Examples:'),console[_0x34af9a(0x1d9)](_0x34af9a(0x1bc)),console[_0x34af9a(0x1d9)](_0x34af9a(0x191)),0x1;try{const _0x486c77=_0x2b816d[_0x34af9a(0x1e6)],_0x4311b6=await resolveSegmentTarget(_0x2d977,_0x486c77,_0x2b816d[_0x34af9a(0x1fc)]);_0x2b816d[_0x34af9a(0x1fc)]&&console['error'](_0x34af9a(0x1b9)+_0x4311b6);const _0xe7bc72=await withSpinner(_0x34af9a(0x16e)+_0x2d977+_0x34af9a(0x19e),()=>_0x2d2709[_0x34af9a(0x18a)][_0x34af9a(0x1a9)](_0x4311b6),{'verbose':_0x2b816d['verbose']}),_0x434d52=_0xe7bc72[_0x34af9a(0x170)];_0x2b816d[_0x34af9a(0x1fc)]&&(console[_0x34af9a(0x1d9)](_0x34af9a(0x196)+_0x434d52[_0x34af9a(0x183)]),console[_0x34af9a(0x1d9)]('Parent\x20ID:\x20'+_0x434d52[_0x34af9a(0x1d4)]));if(_0x434d52[_0x34af9a(0x183)]===_0x34af9a(0x197))return console[_0x34af9a(0x1d9)](_0x34af9a(0x17f)),console[_0x34af9a(0x1d9)](_0x34af9a(0x1bf)),0x1;if(_0x434d52['type']==='parent')return console[_0x34af9a(0x1d9)](_0x34af9a(0x1ce)),console['error'](_0x34af9a(0x19f)),0x1;if(!_0x434d52['segmentId'])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x34af9a(0x1f9));const _0x4bfe41=await withSpinner(_0x34af9a(0x1bb),()=>_0x2d2709[_0x34af9a(0x18a)]['getSegmentSQL'](_0x434d52[_0x34af9a(0x1d4)],_0x434d52['segmentId']),{'verbose':_0x2b816d[_0x34af9a(0x1fc)]}),_0x3f0a01=_0x4bfe41[_0x34af9a(0x170)],_0x2338af=await executeSchemaQuery(_0x3f0a01,_0x2d2709,_0x2b816d);return await handleQueryOutput(_0x2338af,_0x2b816d),0x0;}catch(_0x1e70b3){if(_0x1e70b3 instanceof SDKError)return console[_0x34af9a(0x1d9)](_0x34af9a(0x1c9)+_0x1e70b3[_0x34af9a(0x1cb)]),_0x1e70b3[_0x34af9a(0x192)]&&console[_0x34af9a(0x1d9)](_0x34af9a(0x1f1)+_0x1e70b3['cause']),0x1;throw _0x1e70b3;}}}
@@ -1 +1 @@
1
- const a36_0x47e695=a36_0x8dc4;(function(_0x394117,_0x50a741){const _0x3c77f7=a36_0x8dc4,_0x540650=_0x394117();while(!![]){try{const _0x32bd2f=parseInt(_0x3c77f7(0xd1))/0x1*(parseInt(_0x3c77f7(0xc2))/0x2)+parseInt(_0x3c77f7(0xdb))/0x3+-parseInt(_0x3c77f7(0xba))/0x4*(-parseInt(_0x3c77f7(0xb4))/0x5)+parseInt(_0x3c77f7(0xe2))/0x6*(-parseInt(_0x3c77f7(0xca))/0x7)+-parseInt(_0x3c77f7(0xd0))/0x8*(-parseInt(_0x3c77f7(0xdc))/0x9)+parseInt(_0x3c77f7(0xd7))/0xa*(-parseInt(_0x3c77f7(0xb6))/0xb)+-parseInt(_0x3c77f7(0xd2))/0xc;if(_0x32bd2f===_0x50a741)break;else _0x540650['push'](_0x540650['shift']());}catch(_0x2ff964){_0x540650['push'](_0x540650['shift']());}}}(a36_0x37ac,0x357ec));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';function a36_0x8dc4(_0x43edbf,_0x470989){_0x43edbf=_0x43edbf-0xaf;const _0x37acc6=a36_0x37ac();let _0x8dc4f9=_0x37acc6[_0x43edbf];return _0x8dc4f9;}import{loadJSONFromOptions}from'../utils/json-loader.js';import{parsePath,getParentPath,getBaseName}from'../sdk/segment/segment-path-parser.js';function a36_0x37ac(){const _0xa7cd67=['Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)','kind','error','\x27\x20with\x20ID:\x20','3400864JjmIMz','499rYQwqg','557076fUmEpy','\x20\x20\x20Path:\x20','Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]','✔\x20Created\x20segment\x20\x27','Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]','160260yxatsz','\x27...','yellow','Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.','82425UBWsHJ','9xrEAsK','Resolved\x20relative\x20path\x20to:\x20','name','parent','includes','noCountPopulation','114cFdxIe','Parent\x20path:\x20','Segment\x20name:\x20','resolveFolderId','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27','segment:create','segment','Target\x20path:\x20','Parent:\x20','execute','1101115uBUqJB','createSegment','198ZnxUvV','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','Site:\x20','Resolved\x20folder\x20ID:\x20','4TwTueh','Create\x20child\x20segment\x20with\x20filtering\x20rules','Creating\x20segment\x20\x27','description','\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','Resolving\x20parent\x20segment\x20\x27','data','Resolving\x20folder\x20path\x20\x27','634rebHIV','segments','resolvePathToResource','verbose','type','length','⚠\x20Deprecation\x20warning:\x20`segment\x20create`\x20is\x20deprecated.','invisible','102046UJqRYn','folder'];a36_0x37ac=function(){return _0xa7cd67;};return a36_0x37ac();}import a36_0x5c63e8 from'chalk';export class SegmentCreateCommand extends BaseCommand{[a36_0x47e695(0xde)]=a36_0x47e695(0xaf);[a36_0x47e695(0xbd)]=a36_0x47e695(0xbb);async[a36_0x47e695(0xb3)](_0x368057){const _0x25c290=a36_0x47e695;console['error'](a36_0x5c63e8[_0x25c290(0xd9)](_0x25c290(0xc8))),console[_0x25c290(0xce)](a36_0x5c63e8[_0x25c290(0xd9)](_0x25c290(0xb7)));const {options:_0x13e41f,args:_0x3156a2,tdx:_0x5ab7e0}=_0x368057,_0x1dcf77=_0x13e41f;if(_0x3156a2[_0x25c290(0xc7)]===0x0)return console[_0x25c290(0xce)]('Error:\x20Segment\x20path\x20or\x20name\x20is\x20required'),console['error'](_0x25c290(0xd4)),console[_0x25c290(0xce)]('Examples:'),console[_0x25c290(0xce)]('\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27'),console[_0x25c290(0xce)](_0x25c290(0xe6)),console[_0x25c290(0xce)](_0x25c290(0xbe)),0x1;const _0x112f55=_0x3156a2[0x0],_0x73fca4=_0x13e41f['segmentPath'];let _0x560d7e=_0x112f55;_0x73fca4&&!_0x112f55[_0x25c290(0xe0)]('/')&&(_0x560d7e=_0x73fca4+'/'+_0x112f55,_0x1dcf77[_0x25c290(0xc5)]&&console[_0x25c290(0xce)](_0x25c290(0xdd)+_0x560d7e));const _0x4c1e0a=parsePath(_0x560d7e);if(_0x4c1e0a[_0x25c290(0xc3)][_0x25c290(0xc7)]<0x2)return console[_0x25c290(0xce)](_0x25c290(0xcc)),console[_0x25c290(0xce)](_0x25c290(0xd6)),0x1;const _0x2b060a=_0x4c1e0a['segments'][0x0],_0x5d173b=getBaseName(_0x560d7e),_0x1a2d64=getParentPath(_0x560d7e);_0x1dcf77['verbose']&&(console[_0x25c290(0xce)](_0x25c290(0xb8)+_0x1dcf77['site']),console[_0x25c290(0xce)](_0x25c290(0xb1)+_0x560d7e),console['error'](_0x25c290(0xb2)+_0x2b060a),console['error'](_0x25c290(0xe4)+_0x5d173b),console[_0x25c290(0xce)](_0x25c290(0xe3)+_0x1a2d64));const _0x52432e=await withSpinner(_0x25c290(0xbf)+_0x2b060a+'\x27...',()=>_0x5ab7e0[_0x25c290(0xb0)]['resolveParentId'](_0x2b060a),{'verbose':_0x1dcf77[_0x25c290(0xc5)]}),_0x5f1968=_0x52432e[_0x25c290(0xc0)];let _0x222336;if(_0x4c1e0a[_0x25c290(0xc3)][_0x25c290(0xc7)]>0x2){const _0x442f49=await withSpinner(_0x25c290(0xc1)+_0x1a2d64+_0x25c290(0xd8),()=>_0x5ab7e0[_0x25c290(0xb0)][_0x25c290(0xc4)](_0x1a2d64),{'verbose':_0x1dcf77[_0x25c290(0xc5)]}),_0x655c55=_0x442f49[_0x25c290(0xc0)];if(_0x655c55[_0x25c290(0xc6)]!==_0x25c290(0xcb)&&_0x655c55['type']!==_0x25c290(0xdf))return console['error'](_0x25c290(0xda)),0x1;_0x222336=_0x655c55['folderId'];}else{if(_0x1dcf77[_0x25c290(0xcb)]){const _0x335162=await withSpinner('Resolving\x20folder\x20\x27'+_0x1dcf77['folder']+_0x25c290(0xd8),()=>_0x5ab7e0[_0x25c290(0xb0)][_0x25c290(0xe5)](_0x5f1968,_0x1dcf77[_0x25c290(0xcb)]),{'verbose':_0x1dcf77[_0x25c290(0xc5)]});_0x222336=_0x335162[_0x25c290(0xc0)];}}_0x1dcf77[_0x25c290(0xc5)]&&_0x222336&&console['error'](_0x25c290(0xb9)+_0x222336);const _0x182e8d=await loadJSONFromOptions(_0x1dcf77['rule'],_0x1dcf77['ruleFile']),_0x28cb3c={'name':_0x5d173b,'description':_0x1dcf77['description'],'rule':_0x182e8d,'kind':_0x1dcf77[_0x25c290(0xcd)]!==undefined?parseInt(_0x1dcf77[_0x25c290(0xcd)],0xa):undefined,'isVisible':_0x1dcf77[_0x25c290(0xc9)]?![]:undefined,'segmentFolderId':_0x222336,'countPopulation':_0x1dcf77[_0x25c290(0xe1)]?![]:undefined},_0x347eb4=await withSpinner(_0x25c290(0xbc)+_0x5d173b+_0x25c290(0xd8),()=>_0x5ab7e0[_0x25c290(0xb0)][_0x25c290(0xb5)](_0x5f1968,_0x28cb3c),{'verbose':_0x1dcf77[_0x25c290(0xc5)]}),_0x2c71a4=_0x347eb4[_0x25c290(0xc0)];return console[_0x25c290(0xce)](_0x25c290(0xd5)+_0x2c71a4[_0x25c290(0xde)]+_0x25c290(0xcf)+_0x2c71a4['id']),_0x560d7e!==_0x112f55&&console[_0x25c290(0xce)](_0x25c290(0xd3)+_0x560d7e),await handleSDKOutput([_0x2c71a4],_0x1dcf77),0x0;}}
1
+ const a36_0x502573=a36_0x5c52;(function(_0x5db93a,_0x30fd8b){const _0x3215ba=a36_0x5c52,_0xd3df94=_0x5db93a();while(!![]){try{const _0x43ad64=-parseInt(_0x3215ba(0x112))/0x1*(parseInt(_0x3215ba(0xf1))/0x2)+parseInt(_0x3215ba(0xf6))/0x3*(parseInt(_0x3215ba(0x115))/0x4)+parseInt(_0x3215ba(0x118))/0x5*(-parseInt(_0x3215ba(0x11c))/0x6)+parseInt(_0x3215ba(0x116))/0x7+parseInt(_0x3215ba(0x11f))/0x8*(parseInt(_0x3215ba(0x10e))/0x9)+-parseInt(_0x3215ba(0xf0))/0xa+parseInt(_0x3215ba(0x110))/0xb;if(_0x43ad64===_0x30fd8b)break;else _0xd3df94['push'](_0xd3df94['shift']());}catch(_0x19c6e2){_0xd3df94['push'](_0xd3df94['shift']());}}}(a36_0x8eb0,0xa11ff));function a36_0x8eb0(){const _0x11930c=['Resolved\x20folder\x20ID:\x20','\x20\x20\x20Path:\x20','516VwQNZx','5851699oLNbrx','verbose','51080dFdfTb','Parent\x20path:\x20','error','name','294FXoRce','length','data','3786272XISSbQ','Create\x20child\x20segment\x20with\x20filtering\x20rules','Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)','createSegment','segments','kind','folder','site','\x27...','3638930yZkQjU','16cySrPY','yellow','resolvePathToResource','type','includes','12774YMoMze','description','Resolving\x20folder\x20\x27','✔\x20Created\x20segment\x20\x27','Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]','segment:create','Examples:','\x27\x20with\x20ID:\x20','execute','Resolved\x20relative\x20path\x20to:\x20','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27','rule','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27','\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','segmentPath','⚠\x20Deprecation\x20warning:\x20`segment\x20create`\x20is\x20deprecated.','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','folderId','Resolving\x20folder\x20path\x20\x27','Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.','resolveParentId','segment','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','Segment\x20name:\x20','18hhitgY','resolveFolderId','1890823fyUFVE','Target\x20path:\x20','122407RRZEdI'];a36_0x8eb0=function(){return _0x11930c;};return a36_0x8eb0();}import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{parsePath,getParentPath,getBaseName}from'../sdk/segment/segment-path-parser.js';import a36_0xc3923f from'chalk';function a36_0x5c52(_0x44e811,_0x59edfc){_0x44e811=_0x44e811-0xef;const _0x8eb086=a36_0x8eb0();let _0x5c52a3=_0x8eb086[_0x44e811];return _0x5c52a3;}export class SegmentCreateCommand extends BaseCommand{[a36_0x502573(0x11b)]=a36_0x502573(0xfb);[a36_0x502573(0xf7)]=a36_0x502573(0x120);async[a36_0x502573(0xfe)](_0x21f485){const _0x6a8574=a36_0x502573;console[_0x6a8574(0x11a)](a36_0xc3923f[_0x6a8574(0xf2)](_0x6a8574(0x105))),console[_0x6a8574(0x11a)](a36_0xc3923f['yellow'](_0x6a8574(0x10c)));const {options:_0x30b520,args:_0x4d9bd3,tdx:_0x2967ab}=_0x21f485,_0x515bbd=_0x30b520;if(_0x4d9bd3[_0x6a8574(0x11d)]===0x0)return console[_0x6a8574(0x11a)](_0x6a8574(0x106)),console[_0x6a8574(0x11a)]('Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]'),console[_0x6a8574(0x11a)](_0x6a8574(0xfc)),console[_0x6a8574(0x11a)](_0x6a8574(0x100)),console[_0x6a8574(0x11a)](_0x6a8574(0x102)),console['error'](_0x6a8574(0x103)),0x1;const _0x48c177=_0x4d9bd3[0x0],_0x19225a=_0x30b520[_0x6a8574(0x104)];let _0x5cb2a6=_0x48c177;_0x19225a&&!_0x48c177[_0x6a8574(0xf5)]('/')&&(_0x5cb2a6=_0x19225a+'/'+_0x48c177,_0x515bbd[_0x6a8574(0x117)]&&console[_0x6a8574(0x11a)](_0x6a8574(0xff)+_0x5cb2a6));const _0x525409=parsePath(_0x5cb2a6);if(_0x525409[_0x6a8574(0x123)][_0x6a8574(0x11d)]<0x2)return console[_0x6a8574(0x11a)](_0x6a8574(0x121)),console['error'](_0x6a8574(0xfa)),0x1;const _0x31b149=_0x525409[_0x6a8574(0x123)][0x0],_0x59dd08=getBaseName(_0x5cb2a6),_0x15089a=getParentPath(_0x5cb2a6);_0x515bbd[_0x6a8574(0x117)]&&(console[_0x6a8574(0x11a)]('Site:\x20'+_0x515bbd[_0x6a8574(0x126)]),console[_0x6a8574(0x11a)](_0x6a8574(0x111)+_0x5cb2a6),console[_0x6a8574(0x11a)]('Parent:\x20'+_0x31b149),console[_0x6a8574(0x11a)](_0x6a8574(0x10d)+_0x59dd08),console[_0x6a8574(0x11a)](_0x6a8574(0x119)+_0x15089a));const _0x1ba830=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x31b149+'\x27...',()=>_0x2967ab[_0x6a8574(0x10b)][_0x6a8574(0x10a)](_0x31b149),{'verbose':_0x515bbd['verbose']}),_0x4dcdaa=_0x1ba830[_0x6a8574(0x11e)];let _0x1e98c3;if(_0x525409[_0x6a8574(0x123)][_0x6a8574(0x11d)]>0x2){const _0x20f1e0=await withSpinner(_0x6a8574(0x108)+_0x15089a+_0x6a8574(0xef),()=>_0x2967ab[_0x6a8574(0x10b)][_0x6a8574(0xf3)](_0x15089a),{'verbose':_0x515bbd['verbose']}),_0x46e748=_0x20f1e0[_0x6a8574(0x11e)];if(_0x46e748[_0x6a8574(0xf4)]!==_0x6a8574(0x125)&&_0x46e748[_0x6a8574(0xf4)]!=='parent')return console[_0x6a8574(0x11a)](_0x6a8574(0x109)),0x1;_0x1e98c3=_0x46e748[_0x6a8574(0x107)];}else{if(_0x515bbd[_0x6a8574(0x125)]){const _0x29b6c2=await withSpinner(_0x6a8574(0xf8)+_0x515bbd[_0x6a8574(0x125)]+_0x6a8574(0xef),()=>_0x2967ab[_0x6a8574(0x10b)][_0x6a8574(0x10f)](_0x4dcdaa,_0x515bbd[_0x6a8574(0x125)]),{'verbose':_0x515bbd['verbose']});_0x1e98c3=_0x29b6c2[_0x6a8574(0x11e)];}}_0x515bbd[_0x6a8574(0x117)]&&_0x1e98c3&&console[_0x6a8574(0x11a)](_0x6a8574(0x113)+_0x1e98c3);const _0x3a8717=await loadJSONFromOptions(_0x515bbd[_0x6a8574(0x101)],_0x515bbd['ruleFile']),_0x26d9ab={'name':_0x59dd08,'description':_0x515bbd[_0x6a8574(0xf7)],'rule':_0x3a8717,'kind':_0x515bbd[_0x6a8574(0x124)]!==undefined?parseInt(_0x515bbd[_0x6a8574(0x124)],0xa):undefined,'isVisible':_0x515bbd['invisible']?![]:undefined,'segmentFolderId':_0x1e98c3,'countPopulation':_0x515bbd['noCountPopulation']?![]:undefined},_0x36f2c9=await withSpinner('Creating\x20segment\x20\x27'+_0x59dd08+'\x27...',()=>_0x2967ab['segment'][_0x6a8574(0x122)](_0x4dcdaa,_0x26d9ab),{'verbose':_0x515bbd['verbose']}),_0x48a8c7=_0x36f2c9[_0x6a8574(0x11e)];return console[_0x6a8574(0x11a)](_0x6a8574(0xf9)+_0x48a8c7[_0x6a8574(0x11b)]+_0x6a8574(0xfd)+_0x48a8c7['id']),_0x5cb2a6!==_0x48c177&&console[_0x6a8574(0x11a)](_0x6a8574(0x114)+_0x5cb2a6),await handleSDKOutput([_0x48a8c7],_0x515bbd),0x0;}}
@@ -1 +1 @@
1
- const a37_0x1ba1af=a37_0x2d24;(function(_0x2fe751,_0x208634){const _0x23b90a=a37_0x2d24,_0x290f8e=_0x2fe751();while(!![]){try{const _0x294417=parseInt(_0x23b90a(0xce))/0x1+-parseInt(_0x23b90a(0xd4))/0x2*(-parseInt(_0x23b90a(0xc2))/0x3)+-parseInt(_0x23b90a(0xc5))/0x4+parseInt(_0x23b90a(0xc6))/0x5*(-parseInt(_0x23b90a(0xc4))/0x6)+-parseInt(_0x23b90a(0xd0))/0x7*(parseInt(_0x23b90a(0xcb))/0x8)+-parseInt(_0x23b90a(0xcd))/0x9+parseInt(_0x23b90a(0xda))/0xa;if(_0x294417===_0x208634)break;else _0x290f8e['push'](_0x290f8e['shift']());}catch(_0xc29574){_0x290f8e['push'](_0x290f8e['shift']());}}}(a37_0x3e43,0x869d3));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';function a37_0x3e43(){const _0x190cd8=['Usage:\x20tdx\x20segment\x20fields\x20<parent_name>','data','segment','22425950JRGslL','Listing\x20fields\x20for\x20\x27','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','listFields','✔\x20Found\x20','List\x20available\x20fields\x20for\x20segmentation','Error:\x20Parent\x20segment\x20name\x20is\x20required','1521FFMLkV','description','28182suWyRC','598476snTMeV','250NwGbIa','Site:\x20','json','name','length','7830280NqMdkV','verbose','9660015yQybuK','680984hwLCGv','\x20field','7vNLyma','Parent\x20segment:\x20','site','execute','254IFeFBn','error','\x27...'];a37_0x3e43=function(){return _0x190cd8;};return a37_0x3e43();}import{displayFieldsHumanReadable}from'../sdk/segment/fields-display.js';function a37_0x2d24(_0x18ed4d,_0x222f56){_0x18ed4d=_0x18ed4d-0xc0;const _0x3e43f9=a37_0x3e43();let _0x2d2460=_0x3e43f9[_0x18ed4d];return _0x2d2460;}export class SegmentFieldsCommand extends BaseCommand{[a37_0x1ba1af(0xc9)]='segment:fields';[a37_0x1ba1af(0xc3)]=a37_0x1ba1af(0xc0);async[a37_0x1ba1af(0xd3)](_0x401f26){const _0x1e170c=a37_0x1ba1af,{options:_0x53bc40,args:_0x286f83,tdx:_0x1bdbd2}=_0x401f26,_0x388c4d=_0x286f83[0x0]||_0x53bc40['parentSegment'];if(!_0x388c4d)return console[_0x1e170c(0xd5)](_0x1e170c(0xc1)),console[_0x1e170c(0xd5)](_0x1e170c(0xd7)),console[_0x1e170c(0xd5)](_0x1e170c(0xdc)),0x1;_0x53bc40[_0x1e170c(0xcc)]&&(console['error'](_0x1e170c(0xc7)+_0x53bc40[_0x1e170c(0xd2)]),console[_0x1e170c(0xd5)](_0x1e170c(0xd1)+_0x388c4d));const _0x341e44=await withSpinner(_0x1e170c(0xdb)+_0x388c4d+_0x1e170c(0xd6),()=>_0x1bdbd2[_0x1e170c(0xd9)][_0x1e170c(0xdd)](_0x388c4d),{'verbose':_0x53bc40[_0x1e170c(0xcc)]}),_0x2b02c5=_0x341e44[_0x1e170c(0xd8)];console[_0x1e170c(0xd5)](_0x1e170c(0xde)+_0x2b02c5[_0x1e170c(0xca)]+_0x1e170c(0xcf)+(_0x2b02c5[_0x1e170c(0xca)]!==0x1?'s':''));if(_0x53bc40[_0x1e170c(0xc8)]||_0x53bc40['jsonl'])return await handleSDKOutput(_0x2b02c5,_0x53bc40),0x0;return displayFieldsHumanReadable(_0x2b02c5,_0x388c4d),0x0;}}
1
+ function a37_0x25a0(){const _0x8264bf=['Usage:\x20tdx\x20segment\x20fields\x20<parent_name>','error','\x20field','9772XfnyeF','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','713161AXxJkG','Error:\x20Parent\x20segment\x20name\x20is\x20required','execute','25166844BDlzMd','2242430qsHpPl','segment:fields','verbose','List\x20available\x20fields\x20for\x20segmentation','8328xYDdLW','listFields','\x27...','Site:\x20','parentSegment','Listing\x20fields\x20for\x20\x27','8PcRUAB','data','10877766BXHcgf','2159344XZprKg','1978425xYJSth','length','✔\x20Found\x20','jsonl'];a37_0x25a0=function(){return _0x8264bf;};return a37_0x25a0();}const a37_0x36c44c=a37_0x374d;(function(_0x39459e,_0x4cd6a3){const _0x316516=a37_0x374d,_0x1166ee=_0x39459e();while(!![]){try{const _0x4a922a=parseInt(_0x316516(0x1af))/0x1+parseInt(_0x316516(0x1c0))/0x2+parseInt(_0x316516(0x1c1))/0x3+parseInt(_0x316516(0x1bd))/0x4*(parseInt(_0x316516(0x1b3))/0x5)+parseInt(_0x316516(0x1bf))/0x6+parseInt(_0x316516(0x1c8))/0x7*(-parseInt(_0x316516(0x1b7))/0x8)+-parseInt(_0x316516(0x1b2))/0x9;if(_0x4a922a===_0x4cd6a3)break;else _0x1166ee['push'](_0x1166ee['shift']());}catch(_0x540f42){_0x1166ee['push'](_0x1166ee['shift']());}}}(a37_0x25a0,0xded31));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';function a37_0x374d(_0x5e561e,_0x469aca){_0x5e561e=_0x5e561e-0x1ae;const _0x25a01d=a37_0x25a0();let _0x374d2c=_0x25a01d[_0x5e561e];return _0x374d2c;}import{displayFieldsHumanReadable}from'../sdk/segment/fields-display.js';export class SegmentFieldsCommand extends BaseCommand{['name']=a37_0x36c44c(0x1b4);['description']=a37_0x36c44c(0x1b6);async[a37_0x36c44c(0x1b1)](_0x29c6d6){const _0x517e02=a37_0x36c44c,{options:_0x1a62c6,args:_0x1ca17a,tdx:_0x504a91}=_0x29c6d6,_0x591dc3=_0x1ca17a[0x0]||_0x1a62c6[_0x517e02(0x1bb)];if(!_0x591dc3)return console['error'](_0x517e02(0x1b0)),console[_0x517e02(0x1c6)](_0x517e02(0x1c5)),console[_0x517e02(0x1c6)](_0x517e02(0x1ae)),0x1;_0x1a62c6[_0x517e02(0x1b5)]&&(console['error'](_0x517e02(0x1ba)+_0x1a62c6['site']),console[_0x517e02(0x1c6)]('Parent\x20segment:\x20'+_0x591dc3));const _0x5e7b9d=await withSpinner(_0x517e02(0x1bc)+_0x591dc3+_0x517e02(0x1b9),()=>_0x504a91['segment'][_0x517e02(0x1b8)](_0x591dc3),{'verbose':_0x1a62c6[_0x517e02(0x1b5)]}),_0x37f094=_0x5e7b9d[_0x517e02(0x1be)];console['error'](_0x517e02(0x1c3)+_0x37f094[_0x517e02(0x1c2)]+_0x517e02(0x1c7)+(_0x37f094[_0x517e02(0x1c2)]!==0x1?'s':''));if(_0x1a62c6['json']||_0x1a62c6[_0x517e02(0x1c4)])return await handleSDKOutput(_0x37f094,_0x1a62c6),0x0;return displayFieldsHumanReadable(_0x37f094,_0x591dc3),0x0;}}
@@ -1 +1 @@
1
- const a38_0x4b4fc9=a38_0x42b6;(function(_0x5baa52,_0x1101d7){const _0x40a7f6=a38_0x42b6,_0x373a0f=_0x5baa52();while(!![]){try{const _0x18c063=-parseInt(_0x40a7f6(0x130))/0x1*(-parseInt(_0x40a7f6(0xfc))/0x2)+-parseInt(_0x40a7f6(0x12b))/0x3*(-parseInt(_0x40a7f6(0x112))/0x4)+parseInt(_0x40a7f6(0xf9))/0x5*(-parseInt(_0x40a7f6(0xfb))/0x6)+parseInt(_0x40a7f6(0xf5))/0x7+parseInt(_0x40a7f6(0xe5))/0x8*(-parseInt(_0x40a7f6(0x103))/0x9)+-parseInt(_0x40a7f6(0x107))/0xa*(parseInt(_0x40a7f6(0xdf))/0xb)+parseInt(_0x40a7f6(0xf0))/0xc;if(_0x18c063===_0x1101d7)break;else _0x373a0f['push'](_0x373a0f['shift']());}catch(_0x231def){_0x373a0f['push'](_0x373a0f['shift']());}}}(a38_0x55c3,0x90c7d));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';function a38_0x55c3(){const _0x519e1d=['3107864aoGSSM','parentSegment','✔\x20Pulled\x20','No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27','dryRun','yellow','counts','session','✔\x20All\x20files\x20are\x20up\x20to\x20date','filter','helpText','7962048YOubjS','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)','error','\x20with\x20','Error:\x20','6143921FTWXri','site','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','\x20=\x20','10grAvbD','✔\x20Context\x20set:\x20','2189622CkuYFj','78zeAAni','length','type','parentName','content','\x20changed\x20files','description','9yhhEWV','-\x20no\x20files\x20written','\x20versions)','dim','1650QZVPMr','cwd','\x20\x20Target:\x20','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','segments','utf-8','Write\x20','yes','Aborted.','\x0aChanges\x20to\x20\x27','diff','104552gzEUhZ','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file','\x0aPull\x20summary\x20for\x20\x27','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','segment:pull','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent','parent_segment','message','files','\x20journeys','repeat','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','journeys','Site:\x20','\x0aError:','green','cyan','Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files','hasChanges','file','data','\x27...','targetDir','\x20files\x20to\x20','\x20\x20🎯\x20','75TnigjM','\x20files?','red','Parent\x20segment:\x20','resourceName','8834JtNYrx','verbose','no_parent','pullSegments','segment','dirname','55187WARfLS','Target\x20resource:\x20','isNew','relativePath','setPhase','\x20unchanged\x20files'];a38_0x55c3=function(){return _0x519e1d;};return a38_0x55c3();}import{confirmKey,isInteractive}from'../utils/prompt.js';import{saveSessionContext}from'../core/session.js';function a38_0x42b6(_0x1a1e1b,_0x4538d6){_0x1a1e1b=_0x1a1e1b-0xda;const _0x55c33c=a38_0x55c3();let _0x42b682=_0x55c33c[_0x1a1e1b];return _0x42b682;}import a38_0x507e98 from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';import a38_0x1baa51 from'path';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';export{buildFolderIdToPathMap as buildFolderPathMap}from'../sdk/segment/resolution-context.js';export class SegmentPullCommand extends BaseCommand{['name']=a38_0x4b4fc9(0x116);[a38_0x4b4fc9(0x102)]=a38_0x4b4fc9(0x123);async['execute'](_0x22b494){const _0x4d7365=a38_0x4b4fc9,{options:_0x47b111,args:_0x40c1bc,tdx:_0x287d63}=_0x22b494,_0x5ba569=_0x47b111,_0x1156d6=await resolveTarget({'arg':_0x40c1bc[0x0],'contextParent':_0x47b111[_0x4d7365(0xe6)],'cwd':process[_0x4d7365(0x108)]()});if(!isSuccessfulResolution(_0x1156d6))return _0x1156d6['errorCode']===_0x4d7365(0xdb)?(console[_0x4d7365(0xf2)](a38_0x507e98[_0x4d7365(0xea)](_0x4d7365(0x10a))),console[_0x4d7365(0xf2)](_0x4d7365(0xf1)),console[_0x4d7365(0xf2)](_0x4d7365(0x117)),console[_0x4d7365(0xf2)](_0x4d7365(0x113))):(console[_0x4d7365(0xf2)](a38_0x507e98[_0x4d7365(0x12d)](_0x4d7365(0xf4)+_0x1156d6[_0x4d7365(0x119)]+'\x0a')),_0x1156d6[_0x4d7365(0xef)]&&console[_0x4d7365(0xf2)](a38_0x507e98[_0x4d7365(0x122)](_0x1156d6[_0x4d7365(0xef)]))),0x1;const _0x31d339=_0x1156d6[_0x4d7365(0xff)],_0x3bc4ff=_0x1156d6[_0x4d7365(0x128)],_0x549f32=_0x1156d6[_0x4d7365(0xfe)]===_0x4d7365(0x125)?_0x1156d6[_0x4d7365(0x12f)]:undefined;_0x5ba569['verbose']&&(console[_0x4d7365(0xf2)](_0x4d7365(0x11f)+_0x5ba569[_0x4d7365(0xf6)]),console[_0x4d7365(0xf2)](_0x4d7365(0x12e)+_0x31d339),_0x549f32&&console[_0x4d7365(0xf2)](_0x4d7365(0xe0)+_0x549f32));const _0x494dab=await withProgressSpinner('Pulling\x20segments\x20from\x20\x27'+_0x31d339+_0x4d7365(0x127),_0x15b46c=>_0x287d63[_0x4d7365(0xdd)][_0x4d7365(0xdc)](_0x31d339,{'targetDir':_0x3bc4ff,'targetResourceName':_0x549f32,'verbose':_0x5ba569[_0x4d7365(0xda)],'progress':{'update':_0x1ff1bc=>{const _0x1cf769=_0x4d7365;_0x15b46c[_0x1cf769(0xe3)](_0x1ff1bc),_0x5ba569[_0x1cf769(0xda)]&&console[_0x1cf769(0xf2)]('\x20\x20'+_0x1ff1bc);}}}),{'verbose':_0x5ba569[_0x4d7365(0xda)]}),_0x6384d5=_0x494dab[_0x4d7365(0x126)];if(_0x6384d5[_0x4d7365(0xeb)][_0x4d7365(0x10b)]===0x0&&_0x6384d5['counts'][_0x4d7365(0x11e)]===0x0)return console[_0x4d7365(0xf2)](a38_0x507e98[_0x4d7365(0xea)](_0x4d7365(0xe8)+_0x6384d5['parentName']+'\x27')),0x0;const _0x184d0c=_0x6384d5['files'][_0x4d7365(0xee)](_0x541953=>_0x541953[_0x4d7365(0xe1)]),_0x545de8=_0x6384d5[_0x4d7365(0x11a)][_0x4d7365(0xee)](_0x3e0d2c=>!_0x3e0d2c[_0x4d7365(0xe1)]&&_0x3e0d2c['hasChanges']),_0x3bbf3e=_0x6384d5[_0x4d7365(0x11a)][_0x4d7365(0xee)](_0x321ac3=>!_0x321ac3['isNew']&&!_0x321ac3[_0x4d7365(0x124)]);console[_0x4d7365(0xf2)](_0x4d7365(0x114)+_0x6384d5[_0x4d7365(0xff)]+'\x27:'),console[_0x4d7365(0xf2)](_0x4d7365(0x12a)+a38_0x507e98[_0x4d7365(0x122)](_0x6384d5['counts'][_0x4d7365(0x10b)]+'\x20segments')+_0x4d7365(0xf3)+a38_0x507e98[_0x4d7365(0x122)](_0x6384d5[_0x4d7365(0xeb)]['activations']+'\x20activations'));if(_0x6384d5[_0x4d7365(0xeb)][_0x4d7365(0x11e)]>0x0){const _0x1bb9e7=_0x6384d5['counts']['journeyVersions']>_0x6384d5['counts'][_0x4d7365(0x11e)]?'\x20('+_0x6384d5[_0x4d7365(0xeb)]['journeyVersions']+_0x4d7365(0x105):'';console[_0x4d7365(0xf2)]('\x20\x20🗺️\x20\x20'+a38_0x507e98[_0x4d7365(0x122)](_0x6384d5[_0x4d7365(0xeb)][_0x4d7365(0x11e)]+_0x4d7365(0x11b))+a38_0x507e98[_0x4d7365(0x106)](_0x1bb9e7));}console[_0x4d7365(0xf2)]('\x20\x20'+a38_0x507e98[_0x4d7365(0x121)]('+\x20'+_0x184d0c[_0x4d7365(0xfd)]+'\x20new\x20files')),console['error']('\x20\x20'+a38_0x507e98[_0x4d7365(0xea)]('~\x20'+_0x545de8[_0x4d7365(0xfd)]+_0x4d7365(0x101))),console[_0x4d7365(0xf2)]('\x20\x20'+a38_0x507e98['dim']('=\x20'+_0x3bbf3e[_0x4d7365(0xfd)]+_0x4d7365(0xe4))),console[_0x4d7365(0xf2)](_0x4d7365(0x109)+a38_0x507e98[_0x4d7365(0x122)](_0x6384d5['targetDir'])+'\x0a');if(_0x545de8[_0x4d7365(0xfd)]>0x0)for(const _0x5f52ac of _0x545de8){console[_0x4d7365(0xf2)](_0x4d7365(0x110)+_0x5f52ac[_0x4d7365(0xe2)]+'\x27:'),console[_0x4d7365(0xf2)]('─'[_0x4d7365(0x11c)](0x3c)),console[_0x4d7365(0xf2)](_0x5f52ac[_0x4d7365(0x111)]),console[_0x4d7365(0xf2)]('─'[_0x4d7365(0x11c)](0x3c));}if(_0x5ba569[_0x4d7365(0xe9)])return console[_0x4d7365(0xf2)](a38_0x507e98['yellow'](_0x4d7365(0x115))),0x0;if(_0x184d0c[_0x4d7365(0xfd)]===0x0&&_0x545de8[_0x4d7365(0xfd)]===0x0)return console['error'](a38_0x507e98[_0x4d7365(0x121)](_0x4d7365(0xed))),saveSessionContext({'parent_segment':_0x6384d5[_0x4d7365(0xff)]},_0x5ba569['session']),console['error'](a38_0x507e98[_0x4d7365(0x121)]('✔\x20Context\x20set:\x20'+a38_0x507e98[_0x4d7365(0x106)](_0x4d7365(0x118))+_0x4d7365(0xf8)+a38_0x507e98[_0x4d7365(0x122)](_0x6384d5[_0x4d7365(0xff)]))),0x0;if(!_0x5ba569[_0x4d7365(0x10e)]){if(!isInteractive())return console[_0x4d7365(0xf2)](a38_0x507e98[_0x4d7365(0x12d)](_0x4d7365(0x120)),_0x4d7365(0x11d)),console[_0x4d7365(0xf2)](a38_0x507e98[_0x4d7365(0x106)](_0x4d7365(0xf7))),0x1;const _0x57ccb5=await confirmKey(_0x4d7365(0x10d)+(_0x184d0c[_0x4d7365(0xfd)]+_0x545de8['length'])+_0x4d7365(0x12c));if(!_0x57ccb5)return console[_0x4d7365(0xf2)](a38_0x507e98[_0x4d7365(0xea)](_0x4d7365(0x10f)),_0x4d7365(0x104)),0x1;}for(const _0x37c26b of _0x6384d5['files']){if(_0x37c26b[_0x4d7365(0xe1)]||_0x37c26b[_0x4d7365(0x124)]){const _0x3bded7=a38_0x1baa51[_0x4d7365(0xde)](_0x37c26b['absolutePath']);!existsSync(_0x3bded7)&&mkdirSync(_0x3bded7,{'recursive':!![]}),writeFileSync(_0x37c26b['absolutePath'],_0x37c26b[_0x4d7365(0x100)],_0x4d7365(0x10c));}}return console[_0x4d7365(0xf2)](a38_0x507e98['green'](_0x4d7365(0xe7)+(_0x184d0c[_0x4d7365(0xfd)]+_0x545de8['length'])+_0x4d7365(0x129)+_0x6384d5[_0x4d7365(0x128)])),saveSessionContext({'parent_segment':_0x6384d5['parentName']},_0x5ba569[_0x4d7365(0xec)]),console[_0x4d7365(0xf2)](a38_0x507e98[_0x4d7365(0x121)](_0x4d7365(0xfa)+a38_0x507e98[_0x4d7365(0x106)](_0x4d7365(0x118))+'\x20=\x20'+a38_0x507e98[_0x4d7365(0x122)](_0x6384d5[_0x4d7365(0xff)]))),0x0;}}
1
+ const a38_0xd4de2e=a38_0x40e5;(function(_0x58b86b,_0x5d8e2c){const _0x4c7632=a38_0x40e5,_0x50c039=_0x58b86b();while(!![]){try{const _0xcb18ee=parseInt(_0x4c7632(0xca))/0x1*(parseInt(_0x4c7632(0xbd))/0x2)+parseInt(_0x4c7632(0x9f))/0x3*(-parseInt(_0x4c7632(0xb2))/0x4)+-parseInt(_0x4c7632(0xa2))/0x5*(parseInt(_0x4c7632(0xe7))/0x6)+-parseInt(_0x4c7632(0xa9))/0x7*(-parseInt(_0x4c7632(0xaf))/0x8)+parseInt(_0x4c7632(0xc0))/0x9+-parseInt(_0x4c7632(0xe5))/0xa*(-parseInt(_0x4c7632(0xd3))/0xb)+-parseInt(_0x4c7632(0xe3))/0xc*(-parseInt(_0x4c7632(0xcd))/0xd);if(_0xcb18ee===_0x5d8e2c)break;else _0x50c039['push'](_0x50c039['shift']());}catch(_0x181de8){_0x50c039['push'](_0x50c039['shift']());}}}(a38_0x53c0,0xe4f35));import{BaseCommand}from'./command.js';function a38_0x53c0(){const _0x1eb2bb=['journeyVersions','\x20new\x20files','✔\x20All\x20files\x20are\x20up\x20to\x20date','cwd','Target\x20resource:\x20','setPhase','✔\x20Pulled\x20','dirname','\x20\x20🎯\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent','hasChanges','12RsWegm','error','576890tAMwxV','\x20=\x20','12Mtxoch','helpText','\x20activations','Parent\x20segment:\x20','diff','type','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)','parentSegment','\x20versions)','yellow','603iHLpci','name','file','3080245rWqucF','segments','targetDir','\x27...','\x20changed\x20files','Error:\x20','utf-8','273301DZFQlH','files','site','journeys','segment','execute','112KwLPaC','\x20files?','\x20with\x20','12004vKRFDw','cyan','filter','no_parent','verbose','No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27','\x20journeys','\x0aChanges\x20to\x20\x27','parentName','\x0aPull\x20summary\x20for\x20\x27','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','369716NGQdjv','segment:pull','relativePath','1139067QCAbwu','red','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','isNew','Pulling\x20segments\x20from\x20\x27','resourceName','dim','\x20\x20Target:\x20','\x20\x20🗺️\x20\x20','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','10zEfnbV','✔\x20Context\x20set:\x20','data','1767441rDDmIK','absolutePath','counts','yes','length','message','22vDjlmO','\x0aError:','green','Write\x20','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation'];a38_0x53c0=function(){return _0x1eb2bb;};return a38_0x53c0();}import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{saveSessionContext}from'../core/session.js';import a38_0xcd39d3 from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';import a38_0x50ddfb from'path';function a38_0x40e5(_0x41c370,_0x3cf8b7){_0x41c370=_0x41c370-0x9e;const _0x53c0da=a38_0x53c0();let _0x40e55e=_0x53c0da[_0x41c370];return _0x40e55e;}import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';export{buildFolderIdToPathMap as buildFolderPathMap}from'../sdk/segment/resolution-context.js';export class SegmentPullCommand extends BaseCommand{[a38_0xd4de2e(0xa0)]=a38_0xd4de2e(0xbe);['description']='Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files';async[a38_0xd4de2e(0xae)](_0x2fb934){const _0x289041=a38_0xd4de2e,{options:_0x4cdc06,args:_0x15eeb6,tdx:_0x4e74ac}=_0x2fb934,_0x3d7fee=_0x4cdc06,_0x2094d4=await resolveTarget({'arg':_0x15eeb6[0x0],'contextParent':_0x4cdc06[_0x289041(0xee)],'cwd':process[_0x289041(0xdb)]()});if(!isSuccessfulResolution(_0x2094d4))return _0x2094d4['errorCode']===_0x289041(0xb5)?(console[_0x289041(0xe4)](a38_0xcd39d3[_0x289041(0x9e)](_0x289041(0xc2))),console[_0x289041(0xe4)](_0x289041(0xed)),console[_0x289041(0xe4)](_0x289041(0xe1)),console['error']('\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[_0x289041(0xe4)](a38_0xcd39d3['red'](_0x289041(0xa7)+_0x2094d4[_0x289041(0xd2)]+'\x0a')),_0x2094d4[_0x289041(0xe8)]&&console[_0x289041(0xe4)](a38_0xcd39d3['cyan'](_0x2094d4[_0x289041(0xe8)]))),0x1;const _0x4e0b8e=_0x2094d4[_0x289041(0xba)],_0x541bf6=_0x2094d4['targetDir'],_0x41ad9e=_0x2094d4[_0x289041(0xec)]===_0x289041(0xa1)?_0x2094d4[_0x289041(0xc5)]:undefined;_0x3d7fee[_0x289041(0xb6)]&&(console[_0x289041(0xe4)]('Site:\x20'+_0x3d7fee[_0x289041(0xab)]),console[_0x289041(0xe4)](_0x289041(0xea)+_0x4e0b8e),_0x41ad9e&&console[_0x289041(0xe4)](_0x289041(0xdc)+_0x41ad9e));const _0x2318bf=await withProgressSpinner(_0x289041(0xc4)+_0x4e0b8e+_0x289041(0xa5),_0x512ccd=>_0x4e74ac[_0x289041(0xad)]['pullSegments'](_0x4e0b8e,{'targetDir':_0x541bf6,'targetResourceName':_0x41ad9e,'verbose':_0x3d7fee[_0x289041(0xb6)],'progress':{'update':_0x133cf4=>{const _0x122795=_0x289041;_0x512ccd[_0x122795(0xdd)](_0x133cf4),_0x3d7fee[_0x122795(0xb6)]&&console[_0x122795(0xe4)]('\x20\x20'+_0x133cf4);}}}),{'verbose':_0x3d7fee['verbose']}),_0x5b5495=_0x2318bf[_0x289041(0xcc)];if(_0x5b5495[_0x289041(0xcf)][_0x289041(0xa3)]===0x0&&_0x5b5495[_0x289041(0xcf)][_0x289041(0xac)]===0x0)return console[_0x289041(0xe4)](a38_0xcd39d3['yellow'](_0x289041(0xb7)+_0x5b5495[_0x289041(0xba)]+'\x27')),0x0;const _0x2b3dc1=_0x5b5495[_0x289041(0xaa)][_0x289041(0xb4)](_0x23dd71=>_0x23dd71[_0x289041(0xc3)]),_0x5e9626=_0x5b5495[_0x289041(0xaa)][_0x289041(0xb4)](_0x1fc810=>!_0x1fc810['isNew']&&_0x1fc810['hasChanges']),_0x4534af=_0x5b5495[_0x289041(0xaa)][_0x289041(0xb4)](_0x527f58=>!_0x527f58[_0x289041(0xc3)]&&!_0x527f58[_0x289041(0xe2)]);console[_0x289041(0xe4)](_0x289041(0xbb)+_0x5b5495[_0x289041(0xba)]+'\x27:'),console[_0x289041(0xe4)](_0x289041(0xe0)+a38_0xcd39d3[_0x289041(0xb3)](_0x5b5495['counts'][_0x289041(0xa3)]+'\x20segments')+_0x289041(0xb1)+a38_0xcd39d3[_0x289041(0xb3)](_0x5b5495[_0x289041(0xcf)]['activations']+_0x289041(0xe9)));if(_0x5b5495[_0x289041(0xcf)][_0x289041(0xac)]>0x0){const _0x1a0f1a=_0x5b5495[_0x289041(0xcf)][_0x289041(0xd8)]>_0x5b5495[_0x289041(0xcf)][_0x289041(0xac)]?'\x20('+_0x5b5495[_0x289041(0xcf)][_0x289041(0xd8)]+_0x289041(0xef):'';console['error'](_0x289041(0xc8)+a38_0xcd39d3[_0x289041(0xb3)](_0x5b5495['counts'][_0x289041(0xac)]+_0x289041(0xb8))+a38_0xcd39d3[_0x289041(0xc6)](_0x1a0f1a));}console['error']('\x20\x20'+a38_0xcd39d3[_0x289041(0xd5)]('+\x20'+_0x2b3dc1[_0x289041(0xd1)]+_0x289041(0xd9))),console[_0x289041(0xe4)]('\x20\x20'+a38_0xcd39d3[_0x289041(0x9e)]('~\x20'+_0x5e9626[_0x289041(0xd1)]+_0x289041(0xa6))),console[_0x289041(0xe4)]('\x20\x20'+a38_0xcd39d3[_0x289041(0xc6)]('=\x20'+_0x4534af[_0x289041(0xd1)]+'\x20unchanged\x20files')),console[_0x289041(0xe4)](_0x289041(0xc7)+a38_0xcd39d3[_0x289041(0xb3)](_0x5b5495[_0x289041(0xa4)])+'\x0a');if(_0x5e9626['length']>0x0)for(const _0x50e91f of _0x5e9626){console[_0x289041(0xe4)](_0x289041(0xb9)+_0x50e91f[_0x289041(0xbf)]+'\x27:'),console[_0x289041(0xe4)]('─'['repeat'](0x3c)),console[_0x289041(0xe4)](_0x50e91f[_0x289041(0xeb)]),console[_0x289041(0xe4)]('─'['repeat'](0x3c));}if(_0x3d7fee['dryRun'])return console['error'](a38_0xcd39d3[_0x289041(0x9e)](_0x289041(0xc9))),0x0;if(_0x2b3dc1[_0x289041(0xd1)]===0x0&&_0x5e9626[_0x289041(0xd1)]===0x0)return console['error'](a38_0xcd39d3[_0x289041(0xd5)](_0x289041(0xda))),saveSessionContext({'parent_segment':_0x5b5495[_0x289041(0xba)]},_0x3d7fee['session']),console[_0x289041(0xe4)](a38_0xcd39d3[_0x289041(0xd5)](_0x289041(0xcb)+a38_0xcd39d3['dim']('parent_segment')+_0x289041(0xe6)+a38_0xcd39d3[_0x289041(0xb3)](_0x5b5495[_0x289041(0xba)]))),0x0;if(!_0x3d7fee[_0x289041(0xd0)]){if(!isInteractive())return console[_0x289041(0xe4)](a38_0xcd39d3[_0x289041(0xc1)](_0x289041(0xd4)),_0x289041(0xbc)),console['error'](a38_0xcd39d3[_0x289041(0xc6)](_0x289041(0xd7))),0x1;const _0x2a8dd1=await confirmKey(_0x289041(0xd6)+(_0x2b3dc1[_0x289041(0xd1)]+_0x5e9626[_0x289041(0xd1)])+_0x289041(0xb0));if(!_0x2a8dd1)return console[_0x289041(0xe4)](a38_0xcd39d3[_0x289041(0x9e)]('Aborted.'),'-\x20no\x20files\x20written'),0x1;}for(const _0x57fd6d of _0x5b5495[_0x289041(0xaa)]){if(_0x57fd6d[_0x289041(0xc3)]||_0x57fd6d[_0x289041(0xe2)]){const _0x364113=a38_0x50ddfb[_0x289041(0xdf)](_0x57fd6d[_0x289041(0xce)]);!existsSync(_0x364113)&&mkdirSync(_0x364113,{'recursive':!![]}),writeFileSync(_0x57fd6d[_0x289041(0xce)],_0x57fd6d['content'],_0x289041(0xa8));}}return console[_0x289041(0xe4)](a38_0xcd39d3[_0x289041(0xd5)](_0x289041(0xde)+(_0x2b3dc1['length']+_0x5e9626[_0x289041(0xd1)])+'\x20files\x20to\x20'+_0x5b5495[_0x289041(0xa4)])),saveSessionContext({'parent_segment':_0x5b5495[_0x289041(0xba)]},_0x3d7fee['session']),console[_0x289041(0xe4)](a38_0xcd39d3[_0x289041(0xd5)](_0x289041(0xcb)+a38_0xcd39d3[_0x289041(0xc6)]('parent_segment')+'\x20=\x20'+a38_0xcd39d3[_0x289041(0xb3)](_0x5b5495[_0x289041(0xba)]))),0x0;}}
@@ -1 +1 @@
1
- const a39_0x2b9c18=a39_0x47dc;(function(_0x3b5a6b,_0x475f98){const _0x3b66d4=a39_0x47dc,_0x21021b=_0x3b5a6b();while(!![]){try{const _0x34c6c6=-parseInt(_0x3b66d4(0xf6))/0x1*(parseInt(_0x3b66d4(0x95))/0x2)+-parseInt(_0x3b66d4(0xb3))/0x3+-parseInt(_0x3b66d4(0xa1))/0x4*(-parseInt(_0x3b66d4(0xf3))/0x5)+parseInt(_0x3b66d4(0xd9))/0x6+parseInt(_0x3b66d4(0x10c))/0x7+-parseInt(_0x3b66d4(0xc3))/0x8*(parseInt(_0x3b66d4(0xcd))/0x9)+-parseInt(_0x3b66d4(0x93))/0xa*(-parseInt(_0x3b66d4(0x107))/0xb);if(_0x34c6c6===_0x475f98)break;else _0x21021b['push'](_0x21021b['shift']());}catch(_0x43fb15){_0x21021b['push'](_0x21021b['shift']());}}}(a39_0x29e8,0x48bff));import{BaseCommand}from'./command.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';function a39_0x47dc(_0x1db9a8,_0x1bf07b){_0x1db9a8=_0x1db9a8-0x92;const _0x29e8db=a39_0x29e8();let _0x47dc4c=_0x29e8db[_0x1db9a8];return _0x47dc4c;}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 a39_0x1bc6de 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';function a39_0x29e8(){const _0x4ca7d9=['7953cPIhDs','buildUserMaps','data','type','parentFolder','395689AJUONT','yes','Error\x20parsing\x20YAML:\x20','existingSegment','\x20unchanged','paused','New\x20journey:','\x20to\x20create','name','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','add','dryRun','Changes\x20to:','all','filter','Aborted.','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','audienceId','/e/','map','\x20\x20Source:\x20','Error:\x20','setPhase','\x0aPush\x20summary\x20for\x20\x27','\x20\x20\x20\x20','\x20changes?','list','updated','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','segment\x20or\x20journey','parent_name','\x20YAML\x20files\x20found','Folders\x20to\x20create:','\x20\x20Segments:\x20','toDelete','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file','versionNumber','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','idToName','Error:\x20Directory\x20not\x20found:\x20','created','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','getJourney','13010ZrOQSL','description','7358kvWpZV','\x0aError:','join','toUpdate','deleted','isNew','/sb/da/esr','Resolving\x20parent\x20segment\x20\x27','green','folderId','attributes','errorCode','490276itXZNw','resolveParentId','\x20new','filePath','site','nameToId','changed','✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','Source\x20directory:\x20','\x20to\x20delete','segmentFolderId','state','Preparing\x20journeys...','dim','activations','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)','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','✔\x20All\x20journeys\x20are\x20up\x20to\x20date','1383768sNdXNj','segment:push','Parent\x20segment:\x20','targetDir','file','\x20changed','yamlConfig','\x20\x20Activations:\x20','segment','red','length','new','toString','connection','results','delete','16PFnSdP','\x27...','.yml','get','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','yellow','error','\x0a✔\x20Push\x20complete','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','journeysOnly','2335653mLRsXd','parentName','createdSegmentIds','\x20activations]','\x20updated','Fetching\x20existing\x20data...','journeyBundleName','push','\x20folders\x20to\x20create','Push\x20','endsWith','isScoped','1436952DQYqFy','\x20\x20Activations:','Site:\x20','set','toCreate','New\x20segment:','journeyId','createdAt','no_parent','getParent','/app/ps/','user','getOutputSchemaWithCache','folderPath','then','repeat','\x20created','nameToType','Scoped\x20to\x20folder:\x20','diff','journeyBundleId','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','(Journey\x20will\x20be\x20deleted)','verbose','updatedAt','Delete\x20segment:','5ntTAiK','segments','journey','22MrofUW','/j/da/je','cwd','unchanged','execute','listActivations','relationships','cyan','\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20','helpText','Changes\x20to\x20journey:','blue','\x20deleted','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','.yaml','journeys','existingJourney'];a39_0x29e8=function(){return _0x4ca7d9;};return a39_0x29e8();}import{resolveTDFolderPath,findSegmentsToDelete,findJourneysToDelete,buildSegmentLookupMap,buildSegmentNameToIdMap,buildJourneyBundleLookupMap,parseAndClassifyYamlFiles,validateParsedFiles,formatValidationErrors,extractRootFolderId,buildConnectionMaps,calculatePushStats,prepareSegmentFiles,prepareJourneyFiles,executePushSegments,executePushFolders,executePushSegmentDeletions,executePushJourneys}from'../sdk/segment/push-workflow.js';export class SegmentPushCommand extends BaseCommand{['name']=a39_0x2b9c18(0xb4);[a39_0x2b9c18(0x94)]='Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments';async[a39_0x2b9c18(0xfa)](_0x39d945){const _0x53c215=a39_0x2b9c18,{options:_0x3699fb,args:_0x332666,tdx:_0x19185a}=_0x39d945,_0x357875=_0x3699fb,_0x365ff7=await resolveTarget({'arg':_0x332666[0x0],'contextParent':_0x3699fb['parentSegment'],'cwd':process[_0x53c215(0xf8)]()});if(!isSuccessfulResolution(_0x365ff7))return _0x365ff7[_0x53c215(0xa0)]===_0x53c215(0xe1)?(console['error'](a39_0x1bc6de[_0x53c215(0xc8)](_0x53c215(0x128))),console[_0x53c215(0xc9)](_0x53c215(0xb0)),console['error'](_0x53c215(0x132)),console[_0x53c215(0xc9)](_0x53c215(0x130))):(console['error'](a39_0x1bc6de[_0x53c215(0xbc)](_0x53c215(0x121)+_0x365ff7['message']+'\x0a')),_0x365ff7['helpText']&&console[_0x53c215(0xc9)](a39_0x1bc6de[_0x53c215(0xfd)](_0x365ff7[_0x53c215(0xff)]))),0x1;if(_0x365ff7[_0x53c215(0x10a)]===_0x53c215(0x12b))return console['error'](a39_0x1bc6de[_0x53c215(0xbc)](_0x53c215(0x134)+_0x365ff7['targetDir']+'\x0a')),console[_0x53c215(0xc9)](a39_0x1bc6de[_0x53c215(0xfd)](_0x53c215(0x103))),0x1;const _0x23eadb=_0x365ff7[_0x53c215(0xce)],_0x4fcdc2=_0x365ff7[_0x53c215(0xb6)],_0x2f2571=_0x365ff7[_0x53c215(0x10a)]===_0x53c215(0xb7)?_0x365ff7[_0x53c215(0xa4)]:undefined,_0x15d5d1=getScopedDetails(_0x365ff7),_0x57f142=_0x15d5d1?.[_0x53c215(0xd8)]??![],_0x2613fc=_0x15d5d1?.['scopedFolderPath']??'';if(!existsSync(_0x4fcdc2))return console['error'](a39_0x1bc6de['red'](_0x53c215(0x134)+_0x4fcdc2+'\x0a')),console[_0x53c215(0xc9)](a39_0x1bc6de[_0x53c215(0xfd)](_0x53c215(0x103))),0x1;_0x357875[_0x53c215(0xf0)]&&(console['error'](_0x53c215(0xdb)+_0x357875[_0x53c215(0xa5)]),console[_0x53c215(0xc9)](_0x53c215(0xb5)+_0x23eadb),console[_0x53c215(0xc9)](_0x53c215(0xa9)+_0x4fcdc2),_0x57f142&&console['error'](_0x53c215(0xeb)+_0x2613fc));const _0xe117bf=await withSpinner(_0x53c215(0x9c)+_0x23eadb+_0x53c215(0xc4),()=>_0x19185a['segment'][_0x53c215(0xa2)](_0x23eadb),{'verbose':_0x357875[_0x53c215(0xf0)]}),_0x2e7129=_0xe117bf[_0x53c215(0x109)],{parentSegmentResult:_0x1ab5e7,segmentsResult:_0x43d6f3,foldersResult:_0x5de8ed,journeysWithDetailsResult:_0x3f02f8,userMaps:_0x465ccf}=await withSpinner(_0x53c215(0xd2),async()=>{const _0x15e2a0=_0x53c215,[_0x3cae78,_0x212850,_0x14a32a,_0x27de00,_0x2944f1]=await Promise[_0x15e2a0(0x119)]([_0x19185a['segment'][_0x15e2a0(0xe2)](_0x2e7129),_0x19185a[_0x15e2a0(0xbb)]['listSegments'](_0x2e7129),_0x19185a[_0x15e2a0(0xbb)]['listFolders'](_0x2e7129),_0x19185a['journey']['listJourneysWithDetailsFromParentSegment'](_0x2e7129,{'includeAllVersions':!![]}),_0x19185a[_0x15e2a0(0xe4)][_0x15e2a0(0x108)]()]);return{'parentSegmentResult':_0x3cae78,'segmentsResult':_0x212850,'foldersResult':_0x14a32a,'journeysWithDetailsResult':_0x27de00,'userMaps':_0x2944f1};},{'verbose':_0x357875[_0x53c215(0xf0)]})[_0x53c215(0xe7)](_0x3477d8=>_0x3477d8[_0x53c215(0x109)]),_0x28cbae=_0x1ab5e7,_0x5628b6=extractRootFolderId(_0x28cbae),_0x30fd11=_0x43d6f3,_0x41f328=_0x5de8ed,{journeys:_0xca9fc,activationStepsById:_0x3f00a4}=_0x3f02f8,_0x59d085=new Map(_0xca9fc['map'](_0x29b7d3=>[_0x29b7d3['id'],_0x29b7d3])),_0x48d2f3=_0xca9fc['map'](_0x2bda9a=>({'id':_0x2bda9a['id'],'name':_0x2bda9a[_0x53c215(0x9f)][_0x53c215(0x114)],'journeyBundleName':_0x2bda9a[_0x53c215(0x9f)][_0x53c215(0xd3)]||'','journeyBundleId':_0x2bda9a[_0x53c215(0x9f)][_0x53c215(0xed)]||'','versionNumber':_0x2bda9a[_0x53c215(0x9f)][_0x53c215(0x131)],'description':_0x2bda9a['attributes'][_0x53c215(0x94)],'state':_0x2bda9a[_0x53c215(0x9f)][_0x53c215(0xac)],'paused':_0x2bda9a['attributes'][_0x53c215(0x111)],'audienceId':_0x2bda9a[_0x53c215(0x9f)][_0x53c215(0x11d)],'folderId':_0x2bda9a[_0x53c215(0xfc)]?.[_0x53c215(0x10b)]?.[_0x53c215(0x109)]?.['id'],'createdAt':_0x2bda9a[_0x53c215(0x9f)][_0x53c215(0xe0)],'updatedAt':_0x2bda9a[_0x53c215(0x9f)][_0x53c215(0xf1)]})),{emailToId:_0x21a1fc,idToEmail:_0x591757}=_0x465ccf,_0x265064=await withSpinner('Fetching\x20connections\x20for\x20name\x20resolution...',async()=>{const _0x425f41=_0x53c215,_0x25c1b4=await _0x19185a[_0x425f41(0xc0)][_0x425f41(0x126)]();return buildConnectionMaps(_0x25c1b4);},{'verbose':_0x357875['verbose']})['then'](_0x2b45e6=>_0x2b45e6[_0x53c215(0x109)]),_0x26d8aa=_0x265064['nameToId'],_0x29128d=_0x265064[_0x53c215(0x133)],_0x215b8b=_0x265064[_0x53c215(0xea)],_0x1ce3d9={'emailToIdMap':_0x21a1fc,'connectionNameToIdMap':_0x26d8aa,'connectionNameToTypeMap':_0x215b8b,'getSchema':_0x3993ea=>_0x19185a[_0x53c215(0xc0)][_0x53c215(0xe5)](_0x3993ea)};let {pathToId:_0x5c4c14,idToPath:_0x4e476b}=buildFolderMaps(_0x41f328);const _0xad9031=buildSegmentLookupMap(_0x30fd11,_0x4e476b),_0xe605eb=buildSegmentNameToIdMap(_0x30fd11),_0x19307b=buildJourneyBundleLookupMap(_0x48d2f3,_0x4e476b);let _0x461e8e;if(_0x2f2571){if(!_0x2f2571['endsWith'](_0x53c215(0xc5))&&!_0x2f2571[_0x53c215(0xd7)](_0x53c215(0x104)))return console['error'](a39_0x1bc6de[_0x53c215(0xbc)](_0x53c215(0x136)+_0x2f2571+'\x0a')),0x1;_0x461e8e=[_0x2f2571];}else _0x461e8e=findYamlFiles(_0x4fcdc2);if(_0x461e8e[_0x53c215(0xbd)]===0x0)return console[_0x53c215(0xc9)](a39_0x1bc6de[_0x53c215(0xbc)]('Error:\x20No\x20YAML\x20files\x20found\x20in\x20'+_0x4fcdc2+'\x0a')),console[_0x53c215(0xc9)](a39_0x1bc6de[_0x53c215(0xfd)](_0x53c215(0xee))),0x1;let _0x404a7f,_0x1437b1;try{const _0x404024=parseAndClassifyYamlFiles(_0x461e8e,_0x4fcdc2,{'skipSegments':_0x357875[_0x53c215(0xcc)]});_0x404a7f=_0x404024[_0x53c215(0xf4)],_0x1437b1=_0x404024['journeys'];const _0x4567cb=validateParsedFiles(_0x404024,_0x4fcdc2);if(_0x4567cb[_0x53c215(0xbd)]>0x0)return console[_0x53c215(0xc9)](a39_0x1bc6de['red']('\x0aValidation\x20failed:')),console[_0x53c215(0xc9)](formatValidationErrors(_0x4567cb)),console[_0x53c215(0xc9)](a39_0x1bc6de[_0x53c215(0xc8)](_0x53c215(0x115))),0x1;}catch(_0x366724){return console[_0x53c215(0xc9)](a39_0x1bc6de[_0x53c215(0xbc)](_0x53c215(0x10e)+(_0x366724 instanceof Error?_0x366724['message']:_0x366724))),0x1;}if(_0x404a7f['length']===0x0&&_0x1437b1[_0x53c215(0xbd)]===0x0){const _0x1194b7=_0x357875[_0x53c215(0xcc)]?_0x53c215(0xf5):_0x53c215(0x12a);return console[_0x53c215(0xc9)](a39_0x1bc6de['yellow']('No\x20'+_0x1194b7+_0x53c215(0x12c))),0x0;}const _0x44f9bd=new Map();_0x30fd11[_0x53c215(0xbd)]>0x0&&!_0x357875[_0x53c215(0xcc)]&&await withSpinner('Fetching\x20existing\x20activations...',async()=>{await batchAsync(_0x30fd11,async _0x43cf08=>{const _0x3fe1e8=a39_0x47dc,_0x3067ab=await _0x19185a['segment'][_0x3fe1e8(0xfb)](_0x2e7129,_0x43cf08['id']);_0x44f9bd[_0x3fe1e8(0xdc)](_0x43cf08['id'],_0x3067ab);});},{'verbose':_0x357875[_0x53c215(0xf0)]});const {segmentFiles:_0x15aefc,foldersToCreate:_0xf77fdc}=await prepareSegmentFiles(_0x404a7f,{'segmentByFolderAndName':_0xad9031,'activationsBySegmentId':_0x44f9bd,'folderPathToId':_0x5c4c14,'idToEmailMap':_0x591757,'connectionIdToNameMap':_0x29128d},_0x1ce3d9,_0x57f142,_0x2613fc),_0x3fdef6=_0x2f2571?[]:findSegmentsToDelete(_0x30fd11,_0x404a7f[_0x53c215(0x11f)](({yamlConfig:_0x1307f2,folderPath:_0x1f2468})=>({'yamlConfig':_0x1307f2,'folderPath':resolveTDFolderPath(_0x1f2468,_0x57f142,_0x2613fc)})),_0x4e476b,_0x2613fc,_0x57f142),{journeyFiles:_0x45945b,foldersToCreate:_0x479c5e}=await withProgressSpinner(_0x53c215(0xad),async _0x3bdce5=>prepareJourneyFiles(_0x1437b1,{'fetchJourney':async _0x50b367=>_0x19185a[_0x53c215(0xf5)][_0x53c215(0x92)](_0x50b367[_0x53c215(0xdf)]),'journeyBundlesByFolderAndName':_0x19307b,'folderPathToId':_0x5c4c14,'idToEmailMap':_0x591757,'connectionIdToNameMap':_0x29128d,'existingSegments':_0x30fd11,'parentId':_0x2e7129,'deps':_0x19185a,'progress':{'update':_0x5521e3=>{const _0x60a45c=_0x53c215;_0x3bdce5[_0x60a45c(0x122)](_0x5521e3),_0x357875[_0x60a45c(0xf0)]&&console['error']('\x20\x20'+_0x5521e3);}},'journeyById':_0x59d085,'activationStepsById':_0x3f00a4},_0x57f142,_0x2613fc),{'verbose':_0x357875[_0x53c215(0xf0)]})['then'](_0x4e6873=>_0x4e6873[_0x53c215(0x109)]);for(const _0x7d1275 of _0x479c5e){_0xf77fdc[_0x53c215(0x116)](_0x7d1275);}const _0x2e474c=_0x2f2571?[]:findJourneysToDelete(_0x48d2f3,_0x1437b1[_0x53c215(0x11f)](({yamlConfig:_0xe53560,folderPath:_0x5ec383})=>({'yamlConfig':_0xe53560,'folderPath':resolveTDFolderPath(_0x5ec383,_0x57f142,_0x2613fc)})),_0x4e476b,_0x2613fc,_0x57f142),_0x3b49b6=calculatePushStats(_0x15aefc,_0x45945b,_0xf77fdc,_0x3fdef6,_0x2e474c,!!_0x357875[_0x53c215(0xc2)],!!_0x357875[_0x53c215(0xcc)]),_0x2aa937=_0x3b49b6[_0x53c215(0xf4)][_0x53c215(0xbe)],_0x5c7752=_0x3b49b6['segments'][_0x53c215(0xa7)],_0x2db4e0=_0x3b49b6[_0x53c215(0xf4)][_0x53c215(0xf9)],_0x2c1768=_0x3b49b6['segments']['toDelete'],_0x5c80b7=_0x3b49b6['folders'][_0x53c215(0xdd)],_0x249b48=_0x3b49b6['journeys'][_0x53c215(0xbe)],_0x24e8c3=_0x3b49b6[_0x53c215(0x105)][_0x53c215(0xa7)],_0x291fab=_0x3b49b6[_0x53c215(0x105)][_0x53c215(0xf9)],_0x4c27ff=_0x3b49b6[_0x53c215(0x105)][_0x53c215(0x12f)],_0x545b18=_0x3b49b6[_0x53c215(0xaf)][_0x53c215(0x119)],_0x32aa56=_0x3b49b6[_0x53c215(0xaf)][_0x53c215(0xdd)],_0x6c8142=_0x3b49b6['activations'][_0x53c215(0x98)],_0x120469=_0x3b49b6[_0x53c215(0xaf)][_0x53c215(0x12f)];console[_0x53c215(0xc9)](_0x53c215(0x123)+_0x23eadb+'\x27:');_0x5c80b7[_0x53c215(0xbd)]>0x0&&console[_0x53c215(0xc9)]('\x20\x20'+a39_0x1bc6de['blue']('📁\x20'+_0x5c80b7[_0x53c215(0xbd)]+_0x53c215(0xd5)));if(!_0x357875[_0x53c215(0xcc)]){console[_0x53c215(0xc9)]('\x20\x20📊\x20Segments:'),console[_0x53c215(0xc9)]('\x20\x20\x20\x20'+a39_0x1bc6de[_0x53c215(0x9d)]('+\x20'+_0x2aa937[_0x53c215(0xbd)]+'\x20new')),console[_0x53c215(0xc9)](_0x53c215(0x124)+a39_0x1bc6de[_0x53c215(0xc8)]('~\x20'+_0x5c7752['length']+_0x53c215(0xb8)));if(_0x2c1768['length']>0x0)console[_0x53c215(0xc9)](_0x53c215(0x124)+a39_0x1bc6de[_0x53c215(0xbc)]('-\x20'+_0x2c1768[_0x53c215(0xbd)]+_0x53c215(0xaa)));else _0x3fdef6[_0x53c215(0xbd)]>0x0&&!_0x357875[_0x53c215(0xc2)]&&console[_0x53c215(0xc9)](_0x53c215(0x124)+a39_0x1bc6de['dim'](_0x3fdef6[_0x53c215(0xbd)]+'\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)'));console['error'](_0x53c215(0x124)+a39_0x1bc6de[_0x53c215(0xae)]('=\x20'+_0x2db4e0['length']+'\x20unchanged'));}if(_0x45945b[_0x53c215(0xbd)]>0x0||_0x2e474c[_0x53c215(0xbd)]>0x0){console['error']('\x20\x20🗺️\x20\x20Journeys:'),console[_0x53c215(0xc9)](_0x53c215(0x124)+a39_0x1bc6de[_0x53c215(0x9d)]('+\x20'+_0x249b48['length']+_0x53c215(0xa3))),console[_0x53c215(0xc9)](_0x53c215(0x124)+a39_0x1bc6de['yellow']('~\x20'+_0x24e8c3['length']+_0x53c215(0xb8)));if(_0x4c27ff['length']>0x0)console[_0x53c215(0xc9)](_0x53c215(0x124)+a39_0x1bc6de['red']('-\x20'+_0x4c27ff[_0x53c215(0xbd)]+_0x53c215(0xaa)));else _0x2e474c[_0x53c215(0xbd)]>0x0&&!_0x357875['delete']&&console['error']('\x20\x20\x20\x20'+a39_0x1bc6de[_0x53c215(0xae)](_0x2e474c['length']+_0x53c215(0xcb)));console[_0x53c215(0xc9)](_0x53c215(0x124)+a39_0x1bc6de[_0x53c215(0xae)]('=\x20'+_0x291fab[_0x53c215(0xbd)]+_0x53c215(0x110)));}_0x545b18[_0x53c215(0xbd)]>0x0&&!_0x357875[_0x53c215(0xcc)]&&(console[_0x53c215(0xc9)](''),console[_0x53c215(0xc9)](_0x53c215(0xda)),_0x32aa56['length']>0x0&&console['error']('\x20\x20\x20\x20'+a39_0x1bc6de[_0x53c215(0x9d)]('+\x20'+_0x32aa56['length']+_0x53c215(0x113))),_0x6c8142[_0x53c215(0xbd)]>0x0&&console[_0x53c215(0xc9)](_0x53c215(0x124)+a39_0x1bc6de[_0x53c215(0xc8)]('~\x20'+_0x6c8142['length']+'\x20to\x20update')),_0x120469[_0x53c215(0xbd)]>0x0&&console[_0x53c215(0xc9)](_0x53c215(0x124)+a39_0x1bc6de[_0x53c215(0xbc)]('-\x20'+_0x120469[_0x53c215(0xbd)]+_0x53c215(0xaa))));console['error'](_0x53c215(0x120)+a39_0x1bc6de[_0x53c215(0xfd)](_0x4fcdc2)+'\x0a');if(_0x5c80b7[_0x53c215(0xbd)]>0x0){console[_0x53c215(0xc9)](_0x53c215(0x12d));for(const _0x25dd71 of _0x5c80b7){console[_0x53c215(0xc9)]('\x20\x20'+a39_0x1bc6de[_0x53c215(0x101)]('+')+'\x20'+_0x25dd71);}console[_0x53c215(0xc9)]('');}if(_0x2aa937[_0x53c215(0xbd)]>0x0&&!_0x357875[_0x53c215(0xcc)])for(const _0x3797a2 of _0x2aa937){const _0x27b328=_0x3797a2[_0x53c215(0xe6)]?_0x3797a2[_0x53c215(0xe6)]+'/'+_0x3797a2['yamlConfig'][_0x53c215(0x114)]:_0x3797a2[_0x53c215(0xb9)][_0x53c215(0x114)],_0x4f1f82=_0x3797a2[_0x53c215(0xb9)][_0x53c215(0xaf)]?.[_0x53c215(0xbd)]||0x0,_0x35a5d4=_0x4f1f82>0x0?a39_0x1bc6de[_0x53c215(0xae)]('\x20['+_0x4f1f82+_0x53c215(0xd0)):'';console[_0x53c215(0xc9)]('\x0a'+a39_0x1bc6de[_0x53c215(0x9d)](_0x53c215(0xde))+'\x20'+_0x27b328+_0x35a5d4),console['error']('─'[_0x53c215(0xe8)](0x3c)),_0x3797a2[_0x53c215(0xec)]&&console[_0x53c215(0xc9)](_0x3797a2[_0x53c215(0xec)]),console[_0x53c215(0xc9)]('─'[_0x53c215(0xe8)](0x3c));}if(_0x2c1768[_0x53c215(0xbd)]>0x0&&!_0x357875['journeysOnly'])for(const _0x2bce7f of _0x2c1768){const _0x28ab1c=_0x2bce7f[_0x53c215(0xab)]?_0x4e476b[_0x53c215(0xc6)](_0x2bce7f[_0x53c215(0xab)][_0x53c215(0xbf)]())||'':'',_0x135d36=_0x28ab1c?_0x28ab1c+'/'+_0x2bce7f['name']:_0x2bce7f[_0x53c215(0x114)],_0x4a371b=_0x44f9bd['get'](_0x2bce7f['id'])||[],_0x5491ab=_0x4a371b[_0x53c215(0xbd)]>0x0?a39_0x1bc6de['dim']('\x20['+_0x4a371b[_0x53c215(0xbd)]+_0x53c215(0xd0)):'';console[_0x53c215(0xc9)]('\x0a'+a39_0x1bc6de[_0x53c215(0xbc)](_0x53c215(0xf2))+'\x20'+_0x135d36+_0x5491ab),console[_0x53c215(0xc9)]('─'[_0x53c215(0xe8)](0x3c));const _0x13342d=segmentWithActivationsToYaml(_0x2bce7f,_0x4a371b,undefined,_0x591757,_0x29128d),_0x52cf70=segmentToYamlString(_0x13342d),_0x10e560=generateDiff(_0x52cf70,'');console[_0x53c215(0xc9)](formatDiffWithColors(_0x10e560)),console[_0x53c215(0xc9)]('─'['repeat'](0x3c));}const _0x557c7d=_0x15aefc[_0x53c215(0x11a)](_0x22105e=>!_0x22105e[_0x53c215(0x9a)]&&_0x22105e[_0x53c215(0xec)]);if(_0x557c7d['length']>0x0&&!_0x357875[_0x53c215(0xcc)])for(const _0x446ce1 of _0x557c7d){const _0x29734d=_0x446ce1[_0x53c215(0xe6)]?_0x446ce1[_0x53c215(0xe6)]+'/'+_0x446ce1[_0x53c215(0xb9)][_0x53c215(0x114)]:_0x446ce1[_0x53c215(0xb9)][_0x53c215(0x114)];console['error']('\x0a'+a39_0x1bc6de[_0x53c215(0xc8)](_0x53c215(0x118))+'\x20'+_0x29734d),console[_0x53c215(0xc9)]('─'[_0x53c215(0xe8)](0x3c)),console[_0x53c215(0xc9)](_0x446ce1['diff']),console['error']('─'['repeat'](0x3c));}if(_0x249b48[_0x53c215(0xbd)]>0x0)for(const _0x2c3876 of _0x249b48){const _0x4be5e6=_0x2c3876['folderPath']?_0x2c3876[_0x53c215(0xe6)]+'/'+_0x2c3876[_0x53c215(0xb9)]['name']:_0x2c3876[_0x53c215(0xb9)][_0x53c215(0x114)];console[_0x53c215(0xc9)]('\x0a'+a39_0x1bc6de['green'](_0x53c215(0x112))+'\x20'+_0x4be5e6),console[_0x53c215(0xc9)]('─'[_0x53c215(0xe8)](0x3c)),_0x2c3876[_0x53c215(0xec)]&&console['error'](_0x2c3876['diff']),console[_0x53c215(0xc9)]('─'['repeat'](0x3c));}const _0x590428=_0x45945b[_0x53c215(0x11a)](_0x4233ad=>!_0x4233ad[_0x53c215(0x9a)]&&_0x4233ad['diff']);if(_0x590428['length']>0x0)for(const _0x280388 of _0x590428){const _0x175942=_0x280388['folderPath']?_0x280388[_0x53c215(0xe6)]+'/'+_0x280388[_0x53c215(0xb9)][_0x53c215(0x114)]:_0x280388[_0x53c215(0xb9)][_0x53c215(0x114)];console[_0x53c215(0xc9)]('\x0a'+a39_0x1bc6de['yellow'](_0x53c215(0x100))+'\x20'+_0x175942),console[_0x53c215(0xc9)]('─'[_0x53c215(0xe8)](0x3c)),console[_0x53c215(0xc9)](_0x280388[_0x53c215(0xec)]),console[_0x53c215(0xc9)]('─'['repeat'](0x3c));}if(_0x4c27ff[_0x53c215(0xbd)]>0x0)for(const _0x5132ca of _0x4c27ff){const _0x599ca0=_0x5132ca[_0x53c215(0x9e)]?_0x4e476b[_0x53c215(0xc6)](_0x5132ca[_0x53c215(0x9e)])||'':'',_0x3ff062=_0x599ca0?_0x599ca0+'/'+_0x5132ca[_0x53c215(0xd3)]:_0x5132ca[_0x53c215(0xd3)];console[_0x53c215(0xc9)]('\x0a'+a39_0x1bc6de['red']('Delete\x20journey:')+'\x20'+_0x3ff062),console[_0x53c215(0xc9)]('─'['repeat'](0x3c)),console[_0x53c215(0xc9)](a39_0x1bc6de[_0x53c215(0xbc)](_0x53c215(0xef))),console[_0x53c215(0xc9)]('─'[_0x53c215(0xe8)](0x3c));}if(_0x357875[_0x53c215(0x117)])return console[_0x53c215(0xc9)](a39_0x1bc6de[_0x53c215(0xc8)](_0x53c215(0x129))),0x0;const _0x506d97=_0x357875[_0x53c215(0xcc)]?![]:_0x2aa937[_0x53c215(0xbd)]>0x0||_0x5c7752[_0x53c215(0xbd)]>0x0||_0x2c1768[_0x53c215(0xbd)]>0x0,_0x5a276b=_0x249b48['length']>0x0||_0x24e8c3[_0x53c215(0xbd)]>0x0||_0x4c27ff[_0x53c215(0xbd)]>0x0,_0x5cca84=_0x357875[_0x53c215(0xcc)]?![]:_0x545b18[_0x53c215(0xbd)]>0x0,_0x5f27e5=_0x5c80b7[_0x53c215(0xbd)]>0x0;if(!_0x506d97&&!_0x5a276b&&!_0x5cca84&&!_0x5f27e5){const _0x2e0ddb=_0x357875[_0x53c215(0xcc)]?_0x53c215(0xb2):_0x53c215(0xa8);console[_0x53c215(0xc9)](a39_0x1bc6de[_0x53c215(0x9d)](_0x2e0ddb));if(_0x2f2571&&_0x2db4e0[_0x53c215(0xbd)]===0x1){const _0x5e942d=_0x2db4e0[0x0];if(_0x5e942d[_0x53c215(0x10f)]?.['id']){const _0x115b28=getConsoleNextUrl(_0x357875['site'],_0x53c215(0xe3)+_0x2e7129+'/e/'+_0x5e942d[_0x53c215(0x10f)]['id']+'/sb/da/esr');console[_0x53c215(0xc9)](_0x53c215(0xfe)+a39_0x1bc6de[_0x53c215(0xfd)](_0x115b28));}}if(_0x2f2571&&_0x291fab['length']===0x1){const _0x5ad7b6=_0x291fab[0x0];if(_0x5ad7b6[_0x53c215(0x106)]?.['id']){const _0x4d763b=getConsoleNextUrl(_0x357875[_0x53c215(0xa5)],'/app/ps/'+_0x2e7129+_0x53c215(0x11e)+_0x5ad7b6[_0x53c215(0x106)]['id']+_0x53c215(0xf7));console[_0x53c215(0xc9)]('\x20\x20'+a39_0x1bc6de[_0x53c215(0xfd)](_0x4d763b));}}return 0x0;}const _0x5a9dfc=_0x357875[_0x53c215(0xcc)]?_0x249b48[_0x53c215(0xbd)]+_0x24e8c3[_0x53c215(0xbd)]+_0x4c27ff[_0x53c215(0xbd)]+_0x5c80b7[_0x53c215(0xbd)]:_0x2aa937['length']+_0x5c7752[_0x53c215(0xbd)]+_0x2c1768['length']+_0x249b48[_0x53c215(0xbd)]+_0x24e8c3[_0x53c215(0xbd)]+_0x4c27ff['length']+_0x5c80b7['length']+_0x545b18[_0x53c215(0xbd)];if(!_0x357875[_0x53c215(0x10d)]&&_0x5a9dfc>0x0){if(!isInteractive())return console[_0x53c215(0xc9)](a39_0x1bc6de[_0x53c215(0xbc)](_0x53c215(0x96)),_0x53c215(0x11c)),console['error'](a39_0x1bc6de[_0x53c215(0xae)](_0x53c215(0xb1))),0x1;const _0x1e28ae=await confirmKey(_0x53c215(0xd6)+_0x5a9dfc+_0x53c215(0x125));if(!_0x1e28ae)return console['error'](a39_0x1bc6de[_0x53c215(0xc8)](_0x53c215(0x11b))),0x1;}const _0x49620={'withProgress':async(_0x3f9ecd,_0x253c49)=>{const _0xf86a65=_0x53c215,_0x19dbd5=await withSpinner(_0x3f9ecd,_0x253c49,{'verbose':_0x357875[_0xf86a65(0xf0)]});return{'data':_0x19dbd5[_0xf86a65(0x109)]};},'logInfo':_0x50b699=>console[_0x53c215(0xc9)](a39_0x1bc6de[_0x53c215(0x101)]('✔\x20'+_0x50b699)),'logSuccess':_0x226f7a=>console[_0x53c215(0xc9)](a39_0x1bc6de[_0x53c215(0x9d)]('✔\x20'+_0x226f7a)),'logWarning':_0x40d564=>console[_0x53c215(0xc9)](a39_0x1bc6de[_0x53c215(0xc8)]('⚠\x20'+_0x40d564)),'logDeleted':_0x2737c7=>console['error'](a39_0x1bc6de[_0x53c215(0xbc)]('✔\x20'+_0x2737c7))},_0x3f04f0={'segment':_0x19185a[_0x53c215(0xbb)],'journey':_0x19185a['journey'],'user':_0x19185a[_0x53c215(0xe4)],'connection':_0x19185a[_0x53c215(0xc0)]};_0x5c80b7[_0x53c215(0xbd)]>0x0&&(_0x5c4c14=await executePushFolders(_0x3f04f0,_0x5c80b7,_0x5c4c14,{'parentId':_0x2e7129},_0x49620));const _0x5652e1={'rootFolderId':_0x5628b6,'folderPathToId':_0x5c4c14,'folderIdToPath':_0x4e476b,'segmentNameToId':_0xe605eb,'activationsBySegmentId':_0x44f9bd,'emailToIdMap':_0x21a1fc,'idToEmailMap':_0x591757,'connectionNameToIdMap':_0x265064[_0x53c215(0xa6)],'connectionIdToNameMap':_0x265064[_0x53c215(0x133)],'connectionNameToTypeMap':_0x215b8b},_0x254684=await executePushSegments(_0x3f04f0,_0x357875[_0x53c215(0xcc)]?[]:_0x15aefc,_0x5652e1,{'parentId':_0x2e7129},_0x49620),_0x1d38e2=_0x254684[_0x53c215(0x135)],_0x253f62=_0x254684[_0x53c215(0x127)],_0x2ca960=_0x254684[_0x53c215(0xaf)][_0x53c215(0x135)],_0x5decff=_0x254684['activations'][_0x53c215(0x127)],_0x256c8c=_0x254684[_0x53c215(0xaf)][_0x53c215(0x99)];let _0x163007;if(_0x2f2571&&_0x15aefc[_0x53c215(0xbd)]===0x1){const _0x392aac=_0x15aefc[0x0];_0x163007=_0x392aac[_0x53c215(0x10f)]?.['id']??_0x254684[_0x53c215(0xcf)][_0x53c215(0xc6)](_0x392aac[_0x53c215(0xb9)]['name']);}const _0x100e2f=await executePushSegmentDeletions(_0x3f04f0,_0x357875[_0x53c215(0xcc)]?[]:_0x2c1768,_0x49620);let _0x244e1f=0x0,_0x139c54=0x0,_0x30c192=0x0;const _0x3bcf58=new Map(_0xe605eb);for(const [_0x46bbe3,_0x19ad4f]of _0x254684[_0x53c215(0xcf)]){_0x3bcf58[_0x53c215(0xdc)](_0x46bbe3,_0x19ad4f);}if(_0x45945b[_0x53c215(0xbd)]>0x0){const _0x2c9f94={..._0x5652e1,'segmentNameToId':_0x3bcf58,'existingSegments':_0x30fd11,'activationContext':_0x1ce3d9},_0x3e202e=await executePushJourneys(_0x3f04f0,_0x45945b,_0x2c9f94,{'parentId':_0x2e7129,'rootFolderId':_0x5628b6,'verbose':_0x357875[_0x53c215(0xf0)]},_0x49620);_0x244e1f=_0x3e202e['created'],_0x139c54=_0x3e202e[_0x53c215(0x127)];if(_0x2f2571&&_0x3e202e[_0x53c215(0xc1)][_0x53c215(0xbd)]===0x1){const _0x18d408=_0x3e202e[_0x53c215(0xc1)][0x0];if(_0x18d408['journeyId']){const _0x465c67=getConsoleNextUrl(_0x357875[_0x53c215(0xa5)],'/app/ps/'+_0x2e7129+'/e/'+_0x18d408[_0x53c215(0xdf)]+_0x53c215(0xf7));console[_0x53c215(0xc9)]('\x20\x20'+a39_0x1bc6de[_0x53c215(0xfd)](_0x465c67));}}}for(const _0x282b69 of _0x4c27ff){console[_0x53c215(0xc9)](a39_0x1bc6de['yellow'](_0x53c215(0xc7)+_0x282b69['journeyBundleName'])),_0x30c192++;}const _0x4e2e67=[];if(_0x1d38e2>0x0)_0x4e2e67[_0x53c215(0xd4)](_0x1d38e2+_0x53c215(0xe9));if(_0x253f62>0x0)_0x4e2e67['push'](_0x253f62+'\x20updated');if(_0x100e2f>0x0)_0x4e2e67[_0x53c215(0xd4)](_0x100e2f+_0x53c215(0x102));const _0x1166dd=[];if(_0x244e1f>0x0)_0x1166dd[_0x53c215(0xd4)](_0x244e1f+_0x53c215(0xe9));if(_0x139c54>0x0)_0x1166dd[_0x53c215(0xd4)](_0x139c54+_0x53c215(0xd1));if(_0x30c192>0x0)_0x1166dd['push'](_0x30c192+_0x53c215(0x102));const _0x46ef07=[];if(_0x2ca960>0x0)_0x46ef07['push'](_0x2ca960+'\x20created');if(_0x5decff>0x0)_0x46ef07[_0x53c215(0xd4)](_0x5decff+_0x53c215(0xd1));if(_0x256c8c>0x0)_0x46ef07['push'](_0x256c8c+_0x53c215(0x102));console['error'](a39_0x1bc6de[_0x53c215(0x9d)](_0x53c215(0xca)));_0x4e2e67[_0x53c215(0xbd)]>0x0&&!_0x357875[_0x53c215(0xcc)]&&console[_0x53c215(0xc9)](_0x53c215(0x12e)+_0x4e2e67[_0x53c215(0x97)](',\x20'));_0x1166dd[_0x53c215(0xbd)]>0x0&&console[_0x53c215(0xc9)]('\x20\x20Journeys:\x20'+_0x1166dd[_0x53c215(0x97)](',\x20'));_0x46ef07[_0x53c215(0xbd)]>0x0&&!_0x357875[_0x53c215(0xcc)]&&console[_0x53c215(0xc9)](_0x53c215(0xba)+_0x46ef07[_0x53c215(0x97)](',\x20'));if(_0x163007){const _0x5cb4e1=getConsoleNextUrl(_0x357875[_0x53c215(0xa5)],'/app/ps/'+_0x2e7129+_0x53c215(0x11e)+_0x163007+_0x53c215(0x9b));console['error']('\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20'+a39_0x1bc6de['cyan'](_0x5cb4e1));}return 0x0;}}
1
+ const a39_0x1a49d2=a39_0x1894;(function(_0x25673d,_0x1c528c){const _0x4ccc4c=a39_0x1894,_0x58272c=_0x25673d();while(!![]){try{const _0x150bc2=-parseInt(_0x4ccc4c(0xf4))/0x1*(parseInt(_0x4ccc4c(0xef))/0x2)+-parseInt(_0x4ccc4c(0x16a))/0x3+parseInt(_0x4ccc4c(0x117))/0x4*(-parseInt(_0x4ccc4c(0x129))/0x5)+parseInt(_0x4ccc4c(0x152))/0x6+-parseInt(_0x4ccc4c(0x106))/0x7*(parseInt(_0x4ccc4c(0x13a))/0x8)+-parseInt(_0x4ccc4c(0xfe))/0x9+parseInt(_0x4ccc4c(0xfd))/0xa;if(_0x150bc2===_0x1c528c)break;else _0x58272c['push'](_0x58272c['shift']());}catch(_0x575b1e){_0x58272c['push'](_0x58272c['shift']());}}}(a39_0x5a4c,0x30182));function a39_0x1894(_0x59b59c,_0x289124){_0x59b59c=_0x59b59c-0xd3;const _0x5a4c5d=a39_0x5a4c();let _0x189438=_0x5a4c5d[_0x59b59c];return _0x189438;}import{BaseCommand}from'./command.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{generateDiff,formatDiffWithColors}from'../utils/diff.js';function a39_0x5a4c(){const _0x2b5492=['Parent\x20segment:\x20','length','\x20\x20Segments:\x20','blue','10335750oaaZIc','3147597HwxYbo','isScoped','\x20\x20🗺️\x20\x20Journeys:','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','\x20\x20Source:\x20','data','New\x20segment:','attributes','7ZHeNav','Preparing\x20journeys...','\x20changes?','description','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','unchanged','journey','created','createdAt','endsWith','join','\x20to\x20update','helpText','journeysOnly','updatedAt','✔\x20All\x20journeys\x20are\x20up\x20to\x20date','verbose','48244IegaNV','yes','type','set','/e/','\x20deleted','\x20folders\x20to\x20create','Resolving\x20parent\x20segment\x20\x27','getParent','folderId','\x0aError:','\x0aPush\x20summary\x20for\x20\x27','\x20changed','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','\x20unchanged','parentSegment','\x0a✔\x20Push\x20complete','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','70XfYbOO','error','red','segment\x20or\x20journey','push','toCreate','\x27...','idToName','listActivations','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','existingSegment','all','deleted','\x20to\x20create','message','targetDir','changed','2346672UZhuvI','get','state','\x20updated','Fetching\x20existing\x20data...','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)','\x20YAML\x20files\x20found','updated','site','New\x20journey:','listFolders','\x20\x20📊\x20Segments:','Error:\x20Directory\x20not\x20found:\x20','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','\x20to\x20delete','\x20activations]','dim','delete','existingJourney','Error\x20parsing\x20YAML:\x20','paused','green','Folders\x20to\x20create:','segments','1964652dYOdng','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','errorCode','\x20\x20Activations:\x20','then','results','segmentFolderId','nameToId','Aborted.','scopedFolderPath','diff','\x20new','getOutputSchemaWithCache','parentFolder','/app/ps/','filePath','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','Scoped\x20to\x20folder:\x20','📁\x20','journeyBundleName','No\x20','map','(Journey\x20will\x20be\x20deleted)','75987MUIDfg','segment','relationships','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','journeys','Delete\x20segment:','yellow','connection','\x20\x20Activations:','\x20\x20\x20\x20','getJourney','/sb/da/esr','toString','\x0aValidation\x20failed:','Fetching\x20existing\x20activations...','folders','.yaml','Delete\x20journey:','activations','.yml','name','parentName','toDelete','no_parent','✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','createdSegmentIds','Site:\x20','nameToType','list','new','repeat','2AlFpXE','cyan','journeyId','isNew','folderPath','326773qKhWsL','user','yamlConfig','resolveParentId','\x20created'];a39_0x5a4c=function(){return _0x2b5492;};return a39_0x5a4c();}import{confirmKey,isInteractive}from'../utils/prompt.js';import{batchAsync}from'../utils/async.js';import{segmentToYamlString,segmentWithActivationsToYaml}from'../sdk/segment/child-segment-yaml.js';import a39_0x2185ed 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{[a39_0x1a49d2(0xe4)]='segment:push';[a39_0x1a49d2(0x109)]=a39_0x1a49d2(0x128);async['execute'](_0x40b00a){const _0xe3d454=a39_0x1a49d2,{options:_0x536442,args:_0x51e818,tdx:_0x36dbe7}=_0x40b00a,_0x458cc3=_0x536442,_0x2a8055=await resolveTarget({'arg':_0x51e818[0x0],'contextParent':_0x536442[_0xe3d454(0x126)],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x2a8055))return _0x2a8055[_0xe3d454(0x155)]===_0xe3d454(0xe7)?(console[_0xe3d454(0x12a)](a39_0x2185ed[_0xe3d454(0xd6)](_0xe3d454(0xd3))),console[_0xe3d454(0x12a)](_0xe3d454(0x13f)),console[_0xe3d454(0x12a)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent'),console[_0xe3d454(0x12a)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file')):(console[_0xe3d454(0x12a)](a39_0x2185ed[_0xe3d454(0x12b)]('Error:\x20'+_0x2a8055[_0xe3d454(0x137)]+'\x0a')),_0x2a8055['helpText']&&console['error'](a39_0x2185ed[_0xe3d454(0xf0)](_0x2a8055[_0xe3d454(0x112)]))),0x1;if(_0x2a8055['type']==='parent_name')return console['error'](a39_0x2185ed[_0xe3d454(0x12b)](_0xe3d454(0x146)+_0x2a8055[_0xe3d454(0x138)]+'\x0a')),console[_0xe3d454(0x12a)](a39_0x2185ed[_0xe3d454(0xf0)](_0xe3d454(0x163))),0x1;const _0x4b9d68=_0x2a8055[_0xe3d454(0xe5)],_0x371891=_0x2a8055[_0xe3d454(0x138)],_0x4769dc=_0x2a8055[_0xe3d454(0x119)]==='file'?_0x2a8055[_0xe3d454(0x162)]:undefined,_0x12e5a6=getScopedDetails(_0x2a8055),_0x3c59cd=_0x12e5a6?.[_0xe3d454(0xff)]??![],_0x5274f7=_0x12e5a6?.[_0xe3d454(0x15c)]??'';if(!existsSync(_0x371891))return console[_0xe3d454(0x12a)](a39_0x2185ed[_0xe3d454(0x12b)](_0xe3d454(0x146)+_0x371891+'\x0a')),console['error'](a39_0x2185ed['cyan'](_0xe3d454(0x163))),0x1;_0x458cc3[_0xe3d454(0x116)]&&(console[_0xe3d454(0x12a)](_0xe3d454(0xea)+_0x458cc3[_0xe3d454(0x142)]),console[_0xe3d454(0x12a)](_0xe3d454(0xf9)+_0x4b9d68),console[_0xe3d454(0x12a)]('Source\x20directory:\x20'+_0x371891),_0x3c59cd&&console[_0xe3d454(0x12a)](_0xe3d454(0x164)+_0x5274f7));const _0x28a48d=await withSpinner(_0xe3d454(0x11e)+_0x4b9d68+_0xe3d454(0x12f),()=>_0x36dbe7[_0xe3d454(0x16b)][_0xe3d454(0xf7)](_0x4b9d68),{'verbose':_0x458cc3['verbose']}),_0x212b14=_0x28a48d[_0xe3d454(0x103)],{parentSegmentResult:_0x7aaa7d,segmentsResult:_0x30c998,foldersResult:_0x128055,journeysWithDetailsResult:_0x163ba8,userMaps:_0x4e8a00}=await withSpinner(_0xe3d454(0x13e),async()=>{const _0x3d87de=_0xe3d454,[_0x79b5,_0x225070,_0x3fd4de,_0x46e751,_0x523f07]=await Promise[_0x3d87de(0x134)]([_0x36dbe7[_0x3d87de(0x16b)][_0x3d87de(0x11f)](_0x212b14),_0x36dbe7[_0x3d87de(0x16b)]['listSegments'](_0x212b14),_0x36dbe7[_0x3d87de(0x16b)][_0x3d87de(0x144)](_0x212b14),_0x36dbe7[_0x3d87de(0x10c)]['listJourneysWithDetailsFromParentSegment'](_0x212b14,{'includeAllVersions':!![]}),_0x36dbe7['user']['buildUserMaps']()]);return{'parentSegmentResult':_0x79b5,'segmentsResult':_0x225070,'foldersResult':_0x3fd4de,'journeysWithDetailsResult':_0x46e751,'userMaps':_0x523f07};},{'verbose':_0x458cc3[_0xe3d454(0x116)]})['then'](_0x1d3c67=>_0x1d3c67['data']),_0x15639c=_0x7aaa7d,_0x44f244=extractRootFolderId(_0x15639c),_0x130922=_0x30c998,_0xe4dc59=_0x128055,{journeys:_0x2e1b13,activationStepsById:_0x399796}=_0x163ba8,_0x35d339=new Map(_0x2e1b13[_0xe3d454(0x168)](_0x50458d=>[_0x50458d['id'],_0x50458d])),_0x58e035=_0x2e1b13['map'](_0xe318f0=>({'id':_0xe318f0['id'],'name':_0xe318f0[_0xe3d454(0x105)][_0xe3d454(0xe4)],'journeyBundleName':_0xe318f0['attributes'][_0xe3d454(0x166)]||'','journeyBundleId':_0xe318f0[_0xe3d454(0x105)]['journeyBundleId']||'','versionNumber':_0xe318f0['attributes']['versionNumber'],'description':_0xe318f0[_0xe3d454(0x105)]['description'],'state':_0xe318f0[_0xe3d454(0x105)][_0xe3d454(0x13c)],'paused':_0xe318f0[_0xe3d454(0x105)][_0xe3d454(0x14e)],'audienceId':_0xe318f0[_0xe3d454(0x105)]['audienceId'],'folderId':_0xe318f0[_0xe3d454(0x16c)]?.[_0xe3d454(0x160)]?.['data']?.['id'],'createdAt':_0xe318f0[_0xe3d454(0x105)][_0xe3d454(0x10e)],'updatedAt':_0xe318f0[_0xe3d454(0x105)][_0xe3d454(0x114)]})),{emailToId:_0x130b41,idToEmail:_0x141957}=_0x4e8a00,_0x59aab1=await withSpinner('Fetching\x20connections\x20for\x20name\x20resolution...',async()=>{const _0x1c3c34=_0xe3d454,_0x50be20=await _0x36dbe7[_0x1c3c34(0xd7)][_0x1c3c34(0xec)]();return buildConnectionMaps(_0x50be20);},{'verbose':_0x458cc3['verbose']})[_0xe3d454(0x157)](_0xdd18bb=>_0xdd18bb['data']),_0x5740a5=_0x59aab1[_0xe3d454(0x15a)],_0x1068ba=_0x59aab1[_0xe3d454(0x130)],_0x49dfca=_0x59aab1[_0xe3d454(0xeb)],_0x2ea0c5={'emailToIdMap':_0x130b41,'connectionNameToIdMap':_0x5740a5,'connectionNameToTypeMap':_0x49dfca,'getSchema':_0x6a1f7a=>_0x36dbe7[_0xe3d454(0xd7)][_0xe3d454(0x15f)](_0x6a1f7a)};let {pathToId:_0x237422,idToPath:_0xd4dfc4}=buildFolderMaps(_0xe4dc59);const _0x267281=buildSegmentLookupMap(_0x130922,_0xd4dfc4),_0xbf7f0=buildSegmentNameToIdMap(_0x130922),_0x48fe50=buildJourneyBundleLookupMap(_0x58e035,_0xd4dfc4);let _0x5b3782;if(_0x4769dc){if(!_0x4769dc[_0xe3d454(0x10f)](_0xe3d454(0xe3))&&!_0x4769dc[_0xe3d454(0x10f)](_0xe3d454(0xe0)))return console['error'](a39_0x2185ed[_0xe3d454(0x12b)](_0xe3d454(0x124)+_0x4769dc+'\x0a')),0x1;_0x5b3782=[_0x4769dc];}else _0x5b3782=findYamlFiles(_0x371891);if(_0x5b3782[_0xe3d454(0xfa)]===0x0)return console['error'](a39_0x2185ed[_0xe3d454(0x12b)](_0xe3d454(0x10a)+_0x371891+'\x0a')),console[_0xe3d454(0x12a)](a39_0x2185ed['cyan']('Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files')),0x1;let _0x28c217,_0x5439d8;try{const _0x1bb0a5=parseAndClassifyYamlFiles(_0x5b3782,_0x371891,{'skipSegments':_0x458cc3[_0xe3d454(0x113)]});_0x28c217=_0x1bb0a5[_0xe3d454(0x151)],_0x5439d8=_0x1bb0a5[_0xe3d454(0xd4)];const _0x4e4d72=validateParsedFiles(_0x1bb0a5,_0x371891);if(_0x4e4d72[_0xe3d454(0xfa)]>0x0)return console['error'](a39_0x2185ed[_0xe3d454(0x12b)](_0xe3d454(0xdd))),console[_0xe3d454(0x12a)](formatValidationErrors(_0x4e4d72)),console[_0xe3d454(0x12a)](a39_0x2185ed['yellow'](_0xe3d454(0x132))),0x1;}catch(_0x5c6480){return console[_0xe3d454(0x12a)](a39_0x2185ed['red'](_0xe3d454(0x14d)+(_0x5c6480 instanceof Error?_0x5c6480[_0xe3d454(0x137)]:_0x5c6480))),0x1;}if(_0x28c217[_0xe3d454(0xfa)]===0x0&&_0x5439d8[_0xe3d454(0xfa)]===0x0){const _0x24538d=_0x458cc3[_0xe3d454(0x113)]?'journey':_0xe3d454(0x12c);return console[_0xe3d454(0x12a)](a39_0x2185ed[_0xe3d454(0xd6)](_0xe3d454(0x167)+_0x24538d+_0xe3d454(0x140))),0x0;}const _0x3ad5cb=new Map();_0x130922[_0xe3d454(0xfa)]>0x0&&!_0x458cc3['journeysOnly']&&await withSpinner(_0xe3d454(0xde),async()=>{await batchAsync(_0x130922,async _0x3d7d1f=>{const _0xa32093=a39_0x1894,_0x6bfe72=await _0x36dbe7[_0xa32093(0x16b)][_0xa32093(0x131)](_0x212b14,_0x3d7d1f['id']);_0x3ad5cb[_0xa32093(0x11a)](_0x3d7d1f['id'],_0x6bfe72);});},{'verbose':_0x458cc3[_0xe3d454(0x116)]});const {segmentFiles:_0x59bd46,foldersToCreate:_0x52e9b4}=await prepareSegmentFiles(_0x28c217,{'segmentByFolderAndName':_0x267281,'activationsBySegmentId':_0x3ad5cb,'folderPathToId':_0x237422,'idToEmailMap':_0x141957,'connectionIdToNameMap':_0x1068ba},_0x2ea0c5,_0x3c59cd,_0x5274f7),_0x3cfd3f=_0x4769dc?[]:findSegmentsToDelete(_0x130922,_0x28c217[_0xe3d454(0x168)](({yamlConfig:_0x14e442,folderPath:_0xbdad7f})=>({'yamlConfig':_0x14e442,'folderPath':resolveTDFolderPath(_0xbdad7f,_0x3c59cd,_0x5274f7)})),_0xd4dfc4,_0x5274f7,_0x3c59cd),{journeyFiles:_0x5b5905,foldersToCreate:_0xc84631}=await withProgressSpinner(_0xe3d454(0x107),async _0x504d58=>prepareJourneyFiles(_0x5439d8,{'fetchJourney':async _0xdff14c=>_0x36dbe7[_0xe3d454(0x10c)][_0xe3d454(0xda)](_0xdff14c[_0xe3d454(0xf1)]),'journeyBundlesByFolderAndName':_0x48fe50,'folderPathToId':_0x237422,'idToEmailMap':_0x141957,'connectionIdToNameMap':_0x1068ba,'existingSegments':_0x130922,'parentId':_0x212b14,'deps':_0x36dbe7,'progress':{'update':_0xb7b939=>{const _0x1720a4=_0xe3d454;_0x504d58['setPhase'](_0xb7b939),_0x458cc3['verbose']&&console[_0x1720a4(0x12a)]('\x20\x20'+_0xb7b939);}},'journeyById':_0x35d339,'activationStepsById':_0x399796},_0x3c59cd,_0x5274f7),{'verbose':_0x458cc3[_0xe3d454(0x116)]})['then'](_0x113bf9=>_0x113bf9[_0xe3d454(0x103)]);for(const _0x339362 of _0xc84631){_0x52e9b4['add'](_0x339362);}const _0x2e324a=_0x4769dc?[]:findJourneysToDelete(_0x58e035,_0x5439d8['map'](({yamlConfig:_0x337180,folderPath:_0x2fdbd7})=>({'yamlConfig':_0x337180,'folderPath':resolveTDFolderPath(_0x2fdbd7,_0x3c59cd,_0x5274f7)})),_0xd4dfc4,_0x5274f7,_0x3c59cd),_0xa52e8e=calculatePushStats(_0x59bd46,_0x5b5905,_0x52e9b4,_0x3cfd3f,_0x2e324a,!!_0x458cc3[_0xe3d454(0x14b)],!!_0x458cc3[_0xe3d454(0x113)]),_0x1a2aa1=_0xa52e8e[_0xe3d454(0x151)][_0xe3d454(0xed)],_0x3ef934=_0xa52e8e['segments'][_0xe3d454(0x139)],_0x5d58c2=_0xa52e8e[_0xe3d454(0x151)][_0xe3d454(0x10b)],_0x46f89b=_0xa52e8e[_0xe3d454(0x151)][_0xe3d454(0xe6)],_0x27b4b0=_0xa52e8e[_0xe3d454(0xdf)][_0xe3d454(0x12e)],_0xfd615b=_0xa52e8e[_0xe3d454(0xd4)][_0xe3d454(0xed)],_0xdd022f=_0xa52e8e[_0xe3d454(0xd4)][_0xe3d454(0x139)],_0x1f5951=_0xa52e8e['journeys'][_0xe3d454(0x10b)],_0x389169=_0xa52e8e['journeys'][_0xe3d454(0xe6)],_0x159629=_0xa52e8e['activations'][_0xe3d454(0x134)],_0x12efcf=_0xa52e8e[_0xe3d454(0xe2)][_0xe3d454(0x12e)],_0x40d9e4=_0xa52e8e[_0xe3d454(0xe2)]['toUpdate'],_0x3d0ac4=_0xa52e8e[_0xe3d454(0xe2)]['toDelete'];console[_0xe3d454(0x12a)](_0xe3d454(0x122)+_0x4b9d68+'\x27:');_0x27b4b0['length']>0x0&&console['error']('\x20\x20'+a39_0x2185ed[_0xe3d454(0xfc)](_0xe3d454(0x165)+_0x27b4b0[_0xe3d454(0xfa)]+_0xe3d454(0x11d)));if(!_0x458cc3[_0xe3d454(0x113)]){console[_0xe3d454(0x12a)](_0xe3d454(0x145)),console[_0xe3d454(0x12a)]('\x20\x20\x20\x20'+a39_0x2185ed['green']('+\x20'+_0x1a2aa1[_0xe3d454(0xfa)]+_0xe3d454(0x15e))),console[_0xe3d454(0x12a)]('\x20\x20\x20\x20'+a39_0x2185ed[_0xe3d454(0xd6)]('~\x20'+_0x3ef934[_0xe3d454(0xfa)]+_0xe3d454(0x123)));if(_0x46f89b[_0xe3d454(0xfa)]>0x0)console[_0xe3d454(0x12a)](_0xe3d454(0xd9)+a39_0x2185ed[_0xe3d454(0x12b)]('-\x20'+_0x46f89b[_0xe3d454(0xfa)]+_0xe3d454(0x148)));else _0x3cfd3f[_0xe3d454(0xfa)]>0x0&&!_0x458cc3[_0xe3d454(0x14b)]&&console[_0xe3d454(0x12a)](_0xe3d454(0xd9)+a39_0x2185ed[_0xe3d454(0x14a)](_0x3cfd3f[_0xe3d454(0xfa)]+_0xe3d454(0x154)));console[_0xe3d454(0x12a)](_0xe3d454(0xd9)+a39_0x2185ed[_0xe3d454(0x14a)]('=\x20'+_0x5d58c2[_0xe3d454(0xfa)]+_0xe3d454(0x125)));}if(_0x5b5905[_0xe3d454(0xfa)]>0x0||_0x2e324a[_0xe3d454(0xfa)]>0x0){console['error'](_0xe3d454(0x100)),console[_0xe3d454(0x12a)]('\x20\x20\x20\x20'+a39_0x2185ed[_0xe3d454(0x14f)]('+\x20'+_0xfd615b[_0xe3d454(0xfa)]+_0xe3d454(0x15e))),console[_0xe3d454(0x12a)]('\x20\x20\x20\x20'+a39_0x2185ed['yellow']('~\x20'+_0xdd022f[_0xe3d454(0xfa)]+'\x20changed'));if(_0x389169[_0xe3d454(0xfa)]>0x0)console[_0xe3d454(0x12a)](_0xe3d454(0xd9)+a39_0x2185ed[_0xe3d454(0x12b)]('-\x20'+_0x389169['length']+_0xe3d454(0x148)));else _0x2e324a[_0xe3d454(0xfa)]>0x0&&!_0x458cc3[_0xe3d454(0x14b)]&&console[_0xe3d454(0x12a)](_0xe3d454(0xd9)+a39_0x2185ed[_0xe3d454(0x14a)](_0x2e324a[_0xe3d454(0xfa)]+'\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)'));console[_0xe3d454(0x12a)](_0xe3d454(0xd9)+a39_0x2185ed[_0xe3d454(0x14a)]('=\x20'+_0x1f5951[_0xe3d454(0xfa)]+'\x20unchanged'));}_0x159629['length']>0x0&&!_0x458cc3[_0xe3d454(0x113)]&&(console['error'](''),console[_0xe3d454(0x12a)](_0xe3d454(0xd8)),_0x12efcf[_0xe3d454(0xfa)]>0x0&&console[_0xe3d454(0x12a)](_0xe3d454(0xd9)+a39_0x2185ed[_0xe3d454(0x14f)]('+\x20'+_0x12efcf['length']+_0xe3d454(0x136))),_0x40d9e4[_0xe3d454(0xfa)]>0x0&&console[_0xe3d454(0x12a)](_0xe3d454(0xd9)+a39_0x2185ed[_0xe3d454(0xd6)]('~\x20'+_0x40d9e4[_0xe3d454(0xfa)]+_0xe3d454(0x111))),_0x3d0ac4['length']>0x0&&console[_0xe3d454(0x12a)](_0xe3d454(0xd9)+a39_0x2185ed[_0xe3d454(0x12b)]('-\x20'+_0x3d0ac4[_0xe3d454(0xfa)]+_0xe3d454(0x148))));console[_0xe3d454(0x12a)](_0xe3d454(0x102)+a39_0x2185ed[_0xe3d454(0xf0)](_0x371891)+'\x0a');if(_0x27b4b0[_0xe3d454(0xfa)]>0x0){console['error'](_0xe3d454(0x150));for(const _0x482467 of _0x27b4b0){console[_0xe3d454(0x12a)]('\x20\x20'+a39_0x2185ed[_0xe3d454(0xfc)]('+')+'\x20'+_0x482467);}console[_0xe3d454(0x12a)]('');}if(_0x1a2aa1[_0xe3d454(0xfa)]>0x0&&!_0x458cc3[_0xe3d454(0x113)])for(const _0x21ed7a of _0x1a2aa1){const _0x357e61=_0x21ed7a[_0xe3d454(0xf3)]?_0x21ed7a[_0xe3d454(0xf3)]+'/'+_0x21ed7a['yamlConfig'][_0xe3d454(0xe4)]:_0x21ed7a[_0xe3d454(0xf6)][_0xe3d454(0xe4)],_0x196285=_0x21ed7a[_0xe3d454(0xf6)]['activations']?.[_0xe3d454(0xfa)]||0x0,_0x86aeb8=_0x196285>0x0?a39_0x2185ed['dim']('\x20['+_0x196285+'\x20activations]'):'';console[_0xe3d454(0x12a)]('\x0a'+a39_0x2185ed[_0xe3d454(0x14f)](_0xe3d454(0x104))+'\x20'+_0x357e61+_0x86aeb8),console[_0xe3d454(0x12a)]('─'[_0xe3d454(0xee)](0x3c)),_0x21ed7a[_0xe3d454(0x15d)]&&console['error'](_0x21ed7a[_0xe3d454(0x15d)]),console[_0xe3d454(0x12a)]('─'[_0xe3d454(0xee)](0x3c));}if(_0x46f89b[_0xe3d454(0xfa)]>0x0&&!_0x458cc3[_0xe3d454(0x113)])for(const _0x356d51 of _0x46f89b){const _0x255dff=_0x356d51[_0xe3d454(0x159)]?_0xd4dfc4[_0xe3d454(0x13b)](_0x356d51[_0xe3d454(0x159)][_0xe3d454(0xdc)]())||'':'',_0x436b81=_0x255dff?_0x255dff+'/'+_0x356d51[_0xe3d454(0xe4)]:_0x356d51[_0xe3d454(0xe4)],_0x568953=_0x3ad5cb[_0xe3d454(0x13b)](_0x356d51['id'])||[],_0xb766e8=_0x568953[_0xe3d454(0xfa)]>0x0?a39_0x2185ed[_0xe3d454(0x14a)]('\x20['+_0x568953[_0xe3d454(0xfa)]+_0xe3d454(0x149)):'';console[_0xe3d454(0x12a)]('\x0a'+a39_0x2185ed[_0xe3d454(0x12b)](_0xe3d454(0xd5))+'\x20'+_0x436b81+_0xb766e8),console[_0xe3d454(0x12a)]('─'[_0xe3d454(0xee)](0x3c));const _0x2b301e=segmentWithActivationsToYaml(_0x356d51,_0x568953,undefined,_0x141957,_0x1068ba),_0x55880a=segmentToYamlString(_0x2b301e),_0x32e34b=generateDiff(_0x55880a,'');console[_0xe3d454(0x12a)](formatDiffWithColors(_0x32e34b)),console[_0xe3d454(0x12a)]('─'[_0xe3d454(0xee)](0x3c));}const _0x10ff80=_0x59bd46['filter'](_0x363041=>!_0x363041[_0xe3d454(0xf2)]&&_0x363041[_0xe3d454(0x15d)]);if(_0x10ff80[_0xe3d454(0xfa)]>0x0&&!_0x458cc3[_0xe3d454(0x113)])for(const _0x4d64f8 of _0x10ff80){const _0x1d60f2=_0x4d64f8[_0xe3d454(0xf3)]?_0x4d64f8[_0xe3d454(0xf3)]+'/'+_0x4d64f8[_0xe3d454(0xf6)][_0xe3d454(0xe4)]:_0x4d64f8[_0xe3d454(0xf6)][_0xe3d454(0xe4)];console['error']('\x0a'+a39_0x2185ed[_0xe3d454(0xd6)]('Changes\x20to:')+'\x20'+_0x1d60f2),console[_0xe3d454(0x12a)]('─'[_0xe3d454(0xee)](0x3c)),console['error'](_0x4d64f8[_0xe3d454(0x15d)]),console['error']('─'[_0xe3d454(0xee)](0x3c));}if(_0xfd615b[_0xe3d454(0xfa)]>0x0)for(const _0x59ca33 of _0xfd615b){const _0x44622e=_0x59ca33[_0xe3d454(0xf3)]?_0x59ca33['folderPath']+'/'+_0x59ca33[_0xe3d454(0xf6)]['name']:_0x59ca33['yamlConfig'][_0xe3d454(0xe4)];console[_0xe3d454(0x12a)]('\x0a'+a39_0x2185ed[_0xe3d454(0x14f)](_0xe3d454(0x143))+'\x20'+_0x44622e),console[_0xe3d454(0x12a)]('─'['repeat'](0x3c)),_0x59ca33[_0xe3d454(0x15d)]&&console[_0xe3d454(0x12a)](_0x59ca33['diff']),console[_0xe3d454(0x12a)]('─'[_0xe3d454(0xee)](0x3c));}const _0xa3ef3=_0x5b5905['filter'](_0x40f58a=>!_0x40f58a[_0xe3d454(0xf2)]&&_0x40f58a[_0xe3d454(0x15d)]);if(_0xa3ef3[_0xe3d454(0xfa)]>0x0)for(const _0x44e707 of _0xa3ef3){const _0x1b8a44=_0x44e707[_0xe3d454(0xf3)]?_0x44e707[_0xe3d454(0xf3)]+'/'+_0x44e707['yamlConfig']['name']:_0x44e707[_0xe3d454(0xf6)][_0xe3d454(0xe4)];console[_0xe3d454(0x12a)]('\x0a'+a39_0x2185ed[_0xe3d454(0xd6)]('Changes\x20to\x20journey:')+'\x20'+_0x1b8a44),console['error']('─'[_0xe3d454(0xee)](0x3c)),console[_0xe3d454(0x12a)](_0x44e707[_0xe3d454(0x15d)]),console[_0xe3d454(0x12a)]('─'[_0xe3d454(0xee)](0x3c));}if(_0x389169[_0xe3d454(0xfa)]>0x0)for(const _0x3265c2 of _0x389169){const _0x3d5899=_0x3265c2[_0xe3d454(0x120)]?_0xd4dfc4[_0xe3d454(0x13b)](_0x3265c2[_0xe3d454(0x120)])||'':'',_0x595358=_0x3d5899?_0x3d5899+'/'+_0x3265c2[_0xe3d454(0x166)]:_0x3265c2[_0xe3d454(0x166)];console[_0xe3d454(0x12a)]('\x0a'+a39_0x2185ed[_0xe3d454(0x12b)](_0xe3d454(0xe1))+'\x20'+_0x595358),console[_0xe3d454(0x12a)]('─'[_0xe3d454(0xee)](0x3c)),console[_0xe3d454(0x12a)](a39_0x2185ed['red'](_0xe3d454(0x169))),console[_0xe3d454(0x12a)]('─'[_0xe3d454(0xee)](0x3c));}if(_0x458cc3['dryRun'])return console[_0xe3d454(0x12a)](a39_0x2185ed[_0xe3d454(0xd6)](_0xe3d454(0x101))),0x0;const _0x197b07=_0x458cc3[_0xe3d454(0x113)]?![]:_0x1a2aa1['length']>0x0||_0x3ef934['length']>0x0||_0x46f89b[_0xe3d454(0xfa)]>0x0,_0x2c752c=_0xfd615b[_0xe3d454(0xfa)]>0x0||_0xdd022f[_0xe3d454(0xfa)]>0x0||_0x389169['length']>0x0,_0x3fb6d5=_0x458cc3[_0xe3d454(0x113)]?![]:_0x159629['length']>0x0,_0x2999ac=_0x27b4b0[_0xe3d454(0xfa)]>0x0;if(!_0x197b07&&!_0x2c752c&&!_0x3fb6d5&&!_0x2999ac){const _0x126e57=_0x458cc3[_0xe3d454(0x113)]?_0xe3d454(0x115):_0xe3d454(0xe8);console[_0xe3d454(0x12a)](a39_0x2185ed[_0xe3d454(0x14f)](_0x126e57));if(_0x4769dc&&_0x5d58c2[_0xe3d454(0xfa)]===0x1){const _0x49344a=_0x5d58c2[0x0];if(_0x49344a[_0xe3d454(0x133)]?.['id']){const _0x5a8bad=getConsoleNextUrl(_0x458cc3[_0xe3d454(0x142)],_0xe3d454(0x161)+_0x212b14+'/e/'+_0x49344a['existingSegment']['id']+_0xe3d454(0xdb));console[_0xe3d454(0x12a)]('\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20'+a39_0x2185ed[_0xe3d454(0xf0)](_0x5a8bad));}}if(_0x4769dc&&_0x1f5951[_0xe3d454(0xfa)]===0x1){const _0xd28561=_0x1f5951[0x0];if(_0xd28561[_0xe3d454(0x14c)]?.['id']){const _0x18e03b=getConsoleNextUrl(_0x458cc3[_0xe3d454(0x142)],_0xe3d454(0x161)+_0x212b14+_0xe3d454(0x11b)+_0xd28561[_0xe3d454(0x14c)]['id']+'/j/da/je');console[_0xe3d454(0x12a)]('\x20\x20'+a39_0x2185ed[_0xe3d454(0xf0)](_0x18e03b));}}return 0x0;}const _0x399ceb=_0x458cc3[_0xe3d454(0x113)]?_0xfd615b[_0xe3d454(0xfa)]+_0xdd022f['length']+_0x389169[_0xe3d454(0xfa)]+_0x27b4b0[_0xe3d454(0xfa)]:_0x1a2aa1[_0xe3d454(0xfa)]+_0x3ef934[_0xe3d454(0xfa)]+_0x46f89b['length']+_0xfd615b[_0xe3d454(0xfa)]+_0xdd022f[_0xe3d454(0xfa)]+_0x389169[_0xe3d454(0xfa)]+_0x27b4b0[_0xe3d454(0xfa)]+_0x159629[_0xe3d454(0xfa)];if(!_0x458cc3[_0xe3d454(0x118)]&&_0x399ceb>0x0){if(!isInteractive())return console['error'](a39_0x2185ed[_0xe3d454(0x12b)](_0xe3d454(0x121)),_0xe3d454(0x153)),console['error'](a39_0x2185ed['dim'](_0xe3d454(0x147))),0x1;const _0x3e7c8a=await confirmKey('Push\x20'+_0x399ceb+_0xe3d454(0x108));if(!_0x3e7c8a)return console[_0xe3d454(0x12a)](a39_0x2185ed[_0xe3d454(0xd6)](_0xe3d454(0x15b))),0x1;}const _0x1cc92f={'withProgress':async(_0x236fde,_0x325538)=>{const _0x339e52=_0xe3d454,_0x44912d=await withSpinner(_0x236fde,_0x325538,{'verbose':_0x458cc3[_0x339e52(0x116)]});return{'data':_0x44912d[_0x339e52(0x103)]};},'logInfo':_0x20efc4=>console[_0xe3d454(0x12a)](a39_0x2185ed[_0xe3d454(0xfc)]('✔\x20'+_0x20efc4)),'logSuccess':_0x52df48=>console[_0xe3d454(0x12a)](a39_0x2185ed[_0xe3d454(0x14f)]('✔\x20'+_0x52df48)),'logWarning':_0x34c6c3=>console[_0xe3d454(0x12a)](a39_0x2185ed[_0xe3d454(0xd6)]('⚠\x20'+_0x34c6c3)),'logDeleted':_0x532bb9=>console['error'](a39_0x2185ed[_0xe3d454(0x12b)]('✔\x20'+_0x532bb9))},_0x2c0ee9={'segment':_0x36dbe7[_0xe3d454(0x16b)],'journey':_0x36dbe7[_0xe3d454(0x10c)],'user':_0x36dbe7[_0xe3d454(0xf5)],'connection':_0x36dbe7[_0xe3d454(0xd7)]};_0x27b4b0[_0xe3d454(0xfa)]>0x0&&(_0x237422=await executePushFolders(_0x2c0ee9,_0x27b4b0,_0x237422,{'parentId':_0x212b14},_0x1cc92f));const _0x4a9d72={'rootFolderId':_0x44f244,'folderPathToId':_0x237422,'folderIdToPath':_0xd4dfc4,'segmentNameToId':_0xbf7f0,'activationsBySegmentId':_0x3ad5cb,'emailToIdMap':_0x130b41,'idToEmailMap':_0x141957,'connectionNameToIdMap':_0x59aab1[_0xe3d454(0x15a)],'connectionIdToNameMap':_0x59aab1[_0xe3d454(0x130)],'connectionNameToTypeMap':_0x49dfca},_0x3fbce0=await executePushSegments(_0x2c0ee9,_0x458cc3['journeysOnly']?[]:_0x59bd46,_0x4a9d72,{'parentId':_0x212b14},_0x1cc92f),_0x1b698d=_0x3fbce0[_0xe3d454(0x10d)],_0x192808=_0x3fbce0['updated'],_0x40ffb3=_0x3fbce0['activations'][_0xe3d454(0x10d)],_0x511bcf=_0x3fbce0['activations'][_0xe3d454(0x141)],_0x58b94d=_0x3fbce0[_0xe3d454(0xe2)][_0xe3d454(0x135)];let _0x4b8fef;if(_0x4769dc&&_0x59bd46[_0xe3d454(0xfa)]===0x1){const _0x1f8871=_0x59bd46[0x0];_0x4b8fef=_0x1f8871['existingSegment']?.['id']??_0x3fbce0[_0xe3d454(0xe9)][_0xe3d454(0x13b)](_0x1f8871[_0xe3d454(0xf6)][_0xe3d454(0xe4)]);}const _0x2c1011=await executePushSegmentDeletions(_0x2c0ee9,_0x458cc3['journeysOnly']?[]:_0x46f89b,_0x1cc92f);let _0x30cc6b=0x0,_0x1b542d=0x0,_0x364503=0x0;const _0x5df265=new Map(_0xbf7f0);for(const [_0x3c298b,_0x12ecc4]of _0x3fbce0[_0xe3d454(0xe9)]){_0x5df265['set'](_0x3c298b,_0x12ecc4);}if(_0x5b5905[_0xe3d454(0xfa)]>0x0){const _0x10fccf={..._0x4a9d72,'segmentNameToId':_0x5df265,'existingSegments':_0x130922,'activationContext':_0x2ea0c5},_0x1849c0=await executePushJourneys(_0x2c0ee9,_0x5b5905,_0x10fccf,{'parentId':_0x212b14,'rootFolderId':_0x44f244,'verbose':_0x458cc3[_0xe3d454(0x116)]},_0x1cc92f);_0x30cc6b=_0x1849c0[_0xe3d454(0x10d)],_0x1b542d=_0x1849c0[_0xe3d454(0x141)];if(_0x4769dc&&_0x1849c0[_0xe3d454(0x158)][_0xe3d454(0xfa)]===0x1){const _0x17549d=_0x1849c0[_0xe3d454(0x158)][0x0];if(_0x17549d[_0xe3d454(0xf1)]){const _0x2b5e6f=getConsoleNextUrl(_0x458cc3[_0xe3d454(0x142)],_0xe3d454(0x161)+_0x212b14+_0xe3d454(0x11b)+_0x17549d[_0xe3d454(0xf1)]+'/j/da/je');console[_0xe3d454(0x12a)]('\x20\x20'+a39_0x2185ed['cyan'](_0x2b5e6f));}}}for(const _0x24b7a7 of _0x389169){console[_0xe3d454(0x12a)](a39_0x2185ed[_0xe3d454(0xd6)]('⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20'+_0x24b7a7[_0xe3d454(0x166)])),_0x364503++;}const _0x2c8bca=[];if(_0x1b698d>0x0)_0x2c8bca[_0xe3d454(0x12d)](_0x1b698d+_0xe3d454(0xf8));if(_0x192808>0x0)_0x2c8bca[_0xe3d454(0x12d)](_0x192808+_0xe3d454(0x13d));if(_0x2c1011>0x0)_0x2c8bca[_0xe3d454(0x12d)](_0x2c1011+_0xe3d454(0x11c));const _0x5b7eea=[];if(_0x30cc6b>0x0)_0x5b7eea[_0xe3d454(0x12d)](_0x30cc6b+_0xe3d454(0xf8));if(_0x1b542d>0x0)_0x5b7eea[_0xe3d454(0x12d)](_0x1b542d+_0xe3d454(0x13d));if(_0x364503>0x0)_0x5b7eea[_0xe3d454(0x12d)](_0x364503+_0xe3d454(0x11c));const _0x2615cf=[];if(_0x40ffb3>0x0)_0x2615cf[_0xe3d454(0x12d)](_0x40ffb3+_0xe3d454(0xf8));if(_0x511bcf>0x0)_0x2615cf[_0xe3d454(0x12d)](_0x511bcf+_0xe3d454(0x13d));if(_0x58b94d>0x0)_0x2615cf[_0xe3d454(0x12d)](_0x58b94d+'\x20deleted');console[_0xe3d454(0x12a)](a39_0x2185ed[_0xe3d454(0x14f)](_0xe3d454(0x127)));_0x2c8bca['length']>0x0&&!_0x458cc3[_0xe3d454(0x113)]&&console['error'](_0xe3d454(0xfb)+_0x2c8bca[_0xe3d454(0x110)](',\x20'));_0x5b7eea[_0xe3d454(0xfa)]>0x0&&console[_0xe3d454(0x12a)]('\x20\x20Journeys:\x20'+_0x5b7eea[_0xe3d454(0x110)](',\x20'));_0x2615cf[_0xe3d454(0xfa)]>0x0&&!_0x458cc3[_0xe3d454(0x113)]&&console[_0xe3d454(0x12a)](_0xe3d454(0x156)+_0x2615cf['join'](',\x20'));if(_0x4b8fef){const _0x362586=getConsoleNextUrl(_0x458cc3['site'],_0xe3d454(0x161)+_0x212b14+'/e/'+_0x4b8fef+'/sb/da/esr');console[_0xe3d454(0x12a)]('\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20'+a39_0x2185ed[_0xe3d454(0xf0)](_0x362586));}return 0x0;}}