@treasuredata/tdx 2026.5.1 → 2026.6.1

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 (236) 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/cas-command.js +1 -1
  11. package/dist/commands/cas-segment-command.js +1 -1
  12. package/dist/commands/chat-command.js +1 -1
  13. package/dist/commands/claude-command.js +1 -1
  14. package/dist/commands/claude-statusline-command.js +1 -1
  15. package/dist/commands/claude-usage-command.js +1 -1
  16. package/dist/commands/command.js +1 -1
  17. package/dist/commands/connection-command.js +1 -1
  18. package/dist/commands/databases.js +1 -1
  19. package/dist/commands/delivery-command.js +1 -1
  20. package/dist/commands/describe.js +1 -1
  21. package/dist/commands/engage-campaign-pull-command.js +1 -1
  22. package/dist/commands/engage-campaign-push-command.js +1 -1
  23. package/dist/commands/engage-campaign-validate-command.js +1 -1
  24. package/dist/commands/engage-command.js +1 -1
  25. package/dist/commands/engage-template-pull-command.js +1 -1
  26. package/dist/commands/engage-template-push-command.js +1 -1
  27. package/dist/commands/engage-template-validate-command.js +1 -1
  28. package/dist/commands/job-command.js +1 -1
  29. package/dist/commands/journey-command.js +1 -1
  30. package/dist/commands/journey-validate-command.js +1 -1
  31. package/dist/commands/llm-command.js +1 -1
  32. package/dist/commands/mcp-command.js +1 -1
  33. package/dist/commands/parent-segment-command.js +1 -1
  34. package/dist/commands/policy-command.js +1 -1
  35. package/dist/commands/profile-command.js +1 -1
  36. package/dist/commands/profiles-command.js +1 -1
  37. package/dist/commands/query-command.js +1 -1
  38. package/dist/commands/schedule-command.js +1 -1
  39. package/dist/commands/segment-command.js +1 -1
  40. package/dist/commands/segment-create-command.js +1 -1
  41. package/dist/commands/segment-fields-command.js +1 -1
  42. package/dist/commands/segment-pull-command.js +1 -1
  43. package/dist/commands/segment-push-command.js +1 -1
  44. package/dist/commands/segment-update-command.js +1 -1
  45. package/dist/commands/segment-use-command.js +1 -1
  46. package/dist/commands/segment-validate-command.js +1 -1
  47. package/dist/commands/segments.js +1 -1
  48. package/dist/commands/show.js +1 -1
  49. package/dist/commands/status-command.js +1 -1
  50. package/dist/commands/table-deleted.js +1 -1
  51. package/dist/commands/tables.js +1 -1
  52. package/dist/commands/unset-command.js +1 -1
  53. package/dist/commands/upgrade-command.js +1 -1
  54. package/dist/commands/use-command.js +1 -1
  55. package/dist/commands/user-command.js +1 -1
  56. package/dist/commands/work-command.js +1 -1
  57. package/dist/commands/workflow-command.js +1 -1
  58. package/dist/core/auth.js +1 -1
  59. package/dist/core/command-output.js +1 -1
  60. package/dist/core/config.js +1 -1
  61. package/dist/core/connection-cache.js +1 -1
  62. package/dist/core/constants.js +1 -1
  63. package/dist/core/credential-cache.js +1 -1
  64. package/dist/core/global-context.js +1 -1
  65. package/dist/core/keychain.js +1 -1
  66. package/dist/core/oauth-keychain.js +1 -1
  67. package/dist/core/oauth.js +1 -1
  68. package/dist/core/profile.js +1 -1
  69. package/dist/core/project-config.js +1 -1
  70. package/dist/core/session.js +1 -1
  71. package/dist/core/user-cache.js +1 -1
  72. package/dist/core/version.js +1 -1
  73. package/dist/index.js +1 -1
  74. package/dist/mcp/server.js +1 -1
  75. package/dist/mcp/tools/index.js +1 -1
  76. package/dist/mcp/tools/tdx-run.js +1 -1
  77. package/dist/mcp/tools/tdx-search.js +1 -1
  78. package/dist/mcp/tools/work-create-item.js +1 -1
  79. package/dist/mcp/utils.js +1 -1
  80. package/dist/proxy/claude-usage-tracker.js +1 -1
  81. package/dist/proxy/passthrough-server.js +1 -1
  82. package/dist/proxy/sse-usage-parser.js +1 -1
  83. package/dist/sdk/agent/agent-config.js +1 -1
  84. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  85. package/dist/sdk/agent/agent-yaml.js +1 -1
  86. package/dist/sdk/agent/test/evaluator.js +1 -1
  87. package/dist/sdk/agent/test/executor.js +1 -1
  88. package/dist/sdk/agent/test/index.js +1 -1
  89. package/dist/sdk/agent/test/output.js +1 -1
  90. package/dist/sdk/agent/test/parser.js +1 -1
  91. package/dist/sdk/agent/tool-target-registry.js +1 -1
  92. package/dist/sdk/api.js +1 -1
  93. package/dist/sdk/cas/cas-api-client.js +1 -1
  94. package/dist/sdk/cas/cas-audience-yaml.js +1 -1
  95. package/dist/sdk/cas/cas-segment-yaml.js +1 -1
  96. package/dist/sdk/cas/index.js +1 -1
  97. package/dist/sdk/cas/pull-workflow.js +1 -1
  98. package/dist/sdk/cas/push-workflow.js +1 -1
  99. package/dist/sdk/client/cdp-api-client.js +1 -1
  100. package/dist/sdk/client/cdp-api-client.js.map +1 -1
  101. package/dist/sdk/client/delivery-api-client.js +1 -1
  102. package/dist/sdk/client/endpoints.js +1 -1
  103. package/dist/sdk/client/engage-api-client.js +1 -1
  104. package/dist/sdk/client/http-client.js +1 -1
  105. package/dist/sdk/client/llm-api-client.js +1 -1
  106. package/dist/sdk/client/oauth-refresh.js +1 -1
  107. package/dist/sdk/client/rate-limiter.js +1 -1
  108. package/dist/sdk/client/td-api-client.js +1 -1
  109. package/dist/sdk/client/trino-api-client.js +1 -1
  110. package/dist/sdk/client/workflow-client.js +1 -1
  111. package/dist/sdk/connection-validator.js +1 -1
  112. package/dist/sdk/connection.js +1 -1
  113. package/dist/sdk/delivery.js +1 -1
  114. package/dist/sdk/engage/campaign-pull.js +1 -1
  115. package/dist/sdk/engage/campaign-push.js +1 -1
  116. package/dist/sdk/engage/campaign-validator.js +1 -1
  117. package/dist/sdk/engage/campaign-yaml.js +1 -1
  118. package/dist/sdk/engage/template-pull.js +1 -1
  119. package/dist/sdk/engage/template-push.js +1 -1
  120. package/dist/sdk/engage/template-validator.js +1 -1
  121. package/dist/sdk/engage/template-yaml.js +1 -1
  122. package/dist/sdk/engage/types/campaign-def.js +1 -1
  123. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  124. package/dist/sdk/engage/types/template-schema.js +1 -1
  125. package/dist/sdk/engage.js +1 -1
  126. package/dist/sdk/errors.js +1 -1
  127. package/dist/sdk/index.js +1 -1
  128. package/dist/sdk/io/index.js +1 -1
  129. package/dist/sdk/io/node-filesystem.js +1 -1
  130. package/dist/sdk/job.js +1 -1
  131. package/dist/sdk/journey.js +1 -1
  132. package/dist/sdk/llm/chat-cache.js +1 -1
  133. package/dist/sdk/llm/index.js +1 -1
  134. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  135. package/dist/sdk/llm/model-factors.d.ts +8 -4
  136. package/dist/sdk/llm/model-factors.d.ts.map +1 -1
  137. package/dist/sdk/llm/model-factors.js +1 -1
  138. package/dist/sdk/llm/model-factors.js.map +1 -1
  139. package/dist/sdk/llm/user-settings.js +1 -1
  140. package/dist/sdk/personalization.js +1 -1
  141. package/dist/sdk/policy.js +1 -1
  142. package/dist/sdk/query/deleted-table-validation.js +1 -1
  143. package/dist/sdk/query/index.js +1 -1
  144. package/dist/sdk/query/sql-parser.js +1 -1
  145. package/dist/sdk/realtime.js +1 -1
  146. package/dist/sdk/schedule.js +1 -1
  147. package/dist/sdk/segment/child-segment-yaml.d.ts.map +1 -1
  148. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  149. package/dist/sdk/segment/child-segment-yaml.js.map +1 -1
  150. package/dist/sdk/segment/fields-display.js +1 -1
  151. package/dist/sdk/segment/file-discovery.js +1 -1
  152. package/dist/sdk/segment/journey-utils.js +1 -1
  153. package/dist/sdk/segment/journey-validator.js +1 -1
  154. package/dist/sdk/segment/journey-yaml.js +1 -1
  155. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  156. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  157. package/dist/sdk/segment/pull-workflow.js +1 -1
  158. package/dist/sdk/segment/push-recovery.js +1 -1
  159. package/dist/sdk/segment/push-workflow.js +1 -1
  160. package/dist/sdk/segment/resolution-context.js +1 -1
  161. package/dist/sdk/segment/segment-path-parser.js +1 -1
  162. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  163. package/dist/sdk/segment/segment-validator.js +1 -1
  164. package/dist/sdk/segment/segment-validator.js.map +1 -1
  165. package/dist/sdk/segment/target-resolution.js +1 -1
  166. package/dist/sdk/segment/tdx-config.js +1 -1
  167. package/dist/sdk/segment/types/activation-schema.js +1 -1
  168. package/dist/sdk/segment/types/journey-def.js +1 -1
  169. package/dist/sdk/segment/types/journey-schema.js +1 -1
  170. package/dist/sdk/segment/types/segment-def.js +1 -1
  171. package/dist/sdk/segment/types/segment-schema.js +1 -1
  172. package/dist/sdk/segment/validate-files.js +1 -1
  173. package/dist/sdk/segment/yaml-validator.d.ts +1 -1
  174. package/dist/sdk/segment/yaml-validator.d.ts.map +1 -1
  175. package/dist/sdk/segment/yaml-validator.js +1 -1
  176. package/dist/sdk/segment/yaml-validator.js.map +1 -1
  177. package/dist/sdk/segment.js +1 -1
  178. package/dist/sdk/types/cdp.d.ts +4 -3
  179. package/dist/sdk/types/cdp.d.ts.map +1 -1
  180. package/dist/sdk/types/index.js +1 -1
  181. package/dist/sdk/types/progress.js +1 -1
  182. package/dist/sdk/types/workspace.js +1 -1
  183. package/dist/sdk/user.js +1 -1
  184. package/dist/sdk/util/format-detector.js +1 -1
  185. package/dist/sdk/util/formatters.js +1 -1
  186. package/dist/sdk/util/index.js +1 -1
  187. package/dist/sdk/util/paginate.js +1 -1
  188. package/dist/sdk/util/tree-formatter.js +1 -1
  189. package/dist/sdk/workflow/archive-validation.js +1 -1
  190. package/dist/sdk/workflow/clone-workflow.js +1 -1
  191. package/dist/sdk/workflow/index.js +1 -1
  192. package/dist/sdk/workflow/pull-workflow.js +1 -1
  193. package/dist/sdk/workflow/push-workflow.js +1 -1
  194. package/dist/sdk/workflow/task-graph.js +1 -1
  195. package/dist/sdk/workflow/tdx-config.js +1 -1
  196. package/dist/sdk/workflow/workflow-utils.js +1 -1
  197. package/dist/sdk/workspace/access-tracker.js +1 -1
  198. package/dist/sdk/workspace/frontmatter.js +1 -1
  199. package/dist/sdk/workspace/git.js +1 -1
  200. package/dist/sdk/workspace/index.js +1 -1
  201. package/dist/sdk/workspace/templates.js +1 -1
  202. package/dist/sdk/workspace/weekly.js +1 -1
  203. package/dist/sdk/workspace/wikilinks.js +1 -1
  204. package/dist/test-utils/command-runner.js +1 -1
  205. package/dist/test-utils/factories.js +1 -1
  206. package/dist/test-utils/fixtures.js +1 -1
  207. package/dist/test-utils/http-mock.js +1 -1
  208. package/dist/test-utils/index.js +1 -1
  209. package/dist/utils/async.js +1 -1
  210. package/dist/utils/colors.js +1 -1
  211. package/dist/utils/diff.js +1 -1
  212. package/dist/utils/file-permissions.js +1 -1
  213. package/dist/utils/file-reader.js +1 -1
  214. package/dist/utils/github-releases.js +1 -1
  215. package/dist/utils/global-cache.js +1 -1
  216. package/dist/utils/json-loader.js +1 -1
  217. package/dist/utils/local-cache.js +1 -1
  218. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  219. package/dist/utils/logger/formatters/index.js +1 -1
  220. package/dist/utils/logger/handlers/console-handler.js +1 -1
  221. package/dist/utils/logger/handlers/file-handler.js +1 -1
  222. package/dist/utils/logger/handlers/index.js +1 -1
  223. package/dist/utils/logger/handlers/null-handler.js +1 -1
  224. package/dist/utils/logger/index.js +1 -1
  225. package/dist/utils/logger/logger.js +1 -1
  226. package/dist/utils/logger/types.js +1 -1
  227. package/dist/utils/option-validation.js +1 -1
  228. package/dist/utils/process.js +1 -1
  229. package/dist/utils/prompt.js +1 -1
  230. package/dist/utils/spinner.js +1 -1
  231. package/dist/utils/sse-parser.js +1 -1
  232. package/dist/utils/string-utils.js +1 -1
  233. package/dist/utils/table-ref-parser.js +1 -1
  234. package/dist/utils/tdx-logger.js +1 -1
  235. package/dist/utils/version-check.js +1 -1
  236. package/package.json +1 -1
@@ -1 +1 @@
1
- const a40_0x21f12a=a40_0xc62e;(function(_0x1fae10,_0xf862b4){const _0x1387b9=a40_0xc62e,_0x5aa72f=_0x1fae10();while(!![]){try{const _0x457e2b=-parseInt(_0x1387b9(0xb6))/0x1+-parseInt(_0x1387b9(0xcc))/0x2+parseInt(_0x1387b9(0xbe))/0x3*(-parseInt(_0x1387b9(0xd5))/0x4)+parseInt(_0x1387b9(0xf2))/0x5+-parseInt(_0x1387b9(0xb5))/0x6*(parseInt(_0x1387b9(0xdd))/0x7)+parseInt(_0x1387b9(0xc4))/0x8+parseInt(_0x1387b9(0xe5))/0x9;if(_0x457e2b===_0xf862b4)break;else _0x5aa72f['push'](_0x5aa72f['shift']());}catch(_0x47183d){_0x5aa72f['push'](_0x5aa72f['shift']());}}}(a40_0xdc34,0xcb5ce));function a40_0xdc34(){const _0x196725=['\x20changed\x20files','87222qjwILo','1421060VvOgQG','\x20\x20🎯\x20','Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files','\x20journeys','pullSegments','cwd','error','dirname','269769XdoGjn','isNew','repeat','data','\x20versions)','segment','9383632MCdGUE','Aborted.','yes','red','Pulling\x20segments\x20from\x20\x27','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent','Error:\x20','\x0aError:','3178154xGNspg','segment:pull','journeys','green','utf-8','\x0aPull\x20summary\x20for\x20\x27','counts','✔\x20Pulled\x20','parentName','8meCniD','activations','yellow','\x0aChanges\x20to\x20\x27','\x20unchanged\x20files','no_parent','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','setPhase','497Nzbyyy','site','verbose','diff','✔\x20Context\x20set:\x20','No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27','\x27...','targetDir','29556342qaiEvJ','content','\x20\x20Target:\x20','filter','description','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','session','parent_segment','errorCode','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','files','dim','2990460gwTTgU','\x20with\x20','type','\x20files\x20to\x20','cyan','-\x20no\x20files\x20written','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file','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)','✔\x20All\x20files\x20are\x20up\x20to\x20date','\x20=\x20','length','Target\x20resource:\x20','file','\x20new\x20files','journeyVersions','hasChanges','resourceName','\x20segments','helpText','absolutePath'];a40_0xdc34=function(){return _0x196725;};return a40_0xdc34();}import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{saveSessionContext}from'../core/session.js';import a40_0x2f0165 from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';function a40_0xc62e(_0x1585ee,_0x431eaa){_0x1585ee=_0x1585ee-0xac;const _0xdc34d5=a40_0xdc34();let _0xc62e0d=_0xdc34d5[_0x1585ee];return _0xc62e0d;}import a40_0x5842a5 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']=a40_0x21f12a(0xcd);[a40_0x21f12a(0xe9)]=a40_0x21f12a(0xb8);async['execute'](_0x510d76){const _0x38c0b3=a40_0x21f12a,{options:_0x19ec3d,args:_0x5ee9c7,tdx:_0x1001cb}=_0x510d76,_0x3b1762=_0x19ec3d,_0x28e1a5=await resolveTarget({'arg':_0x5ee9c7[0x0],'contextParent':_0x19ec3d['parentSegment'],'cwd':process[_0x38c0b3(0xbb)]()});if(!isSuccessfulResolution(_0x28e1a5))return _0x28e1a5[_0x38c0b3(0xee)]===_0x38c0b3(0xda)?(console[_0x38c0b3(0xbc)](a40_0x2f0165[_0x38c0b3(0xd7)](_0x38c0b3(0xef))),console[_0x38c0b3(0xbc)](_0x38c0b3(0xf9)),console[_0x38c0b3(0xbc)](_0x38c0b3(0xc9)),console['error'](_0x38c0b3(0xf8))):(console[_0x38c0b3(0xbc)](a40_0x2f0165[_0x38c0b3(0xc7)](_0x38c0b3(0xca)+_0x28e1a5['message']+'\x0a')),_0x28e1a5['helpText']&&console['error'](a40_0x2f0165[_0x38c0b3(0xf6)](_0x28e1a5[_0x38c0b3(0xb2)]))),0x1;const _0x2b7234=_0x28e1a5[_0x38c0b3(0xd4)],_0x34267e=_0x28e1a5[_0x38c0b3(0xe4)],_0x2b4c01=_0x28e1a5[_0x38c0b3(0xf4)]===_0x38c0b3(0xac)?_0x28e1a5[_0x38c0b3(0xb0)]:undefined;_0x3b1762['verbose']&&(console[_0x38c0b3(0xbc)]('Site:\x20'+_0x3b1762[_0x38c0b3(0xde)]),console[_0x38c0b3(0xbc)]('Parent\x20segment:\x20'+_0x2b7234),_0x2b4c01&&console[_0x38c0b3(0xbc)](_0x38c0b3(0xfd)+_0x2b4c01));const _0x23932a=await withProgressSpinner(_0x38c0b3(0xc8)+_0x2b7234+_0x38c0b3(0xe3),_0x225985=>_0x1001cb[_0x38c0b3(0xc3)][_0x38c0b3(0xba)](_0x2b7234,{'targetDir':_0x34267e,'targetResourceName':_0x2b4c01,'verbose':_0x3b1762[_0x38c0b3(0xdf)],'progress':{'update':_0x59e2fa=>{const _0x55eb9f=_0x38c0b3;_0x225985[_0x55eb9f(0xdc)](_0x59e2fa),_0x3b1762['verbose']&&console[_0x55eb9f(0xbc)]('\x20\x20'+_0x59e2fa);}}}),{'verbose':_0x3b1762[_0x38c0b3(0xdf)]}),_0x44b738=_0x23932a[_0x38c0b3(0xc1)];if(_0x44b738[_0x38c0b3(0xd2)]['segments']===0x0&&_0x44b738[_0x38c0b3(0xd2)][_0x38c0b3(0xce)]===0x0)return console[_0x38c0b3(0xbc)](a40_0x2f0165[_0x38c0b3(0xd7)](_0x38c0b3(0xe2)+_0x44b738[_0x38c0b3(0xd4)]+'\x27')),0x0;const _0x315dab=_0x44b738[_0x38c0b3(0xf0)][_0x38c0b3(0xe8)](_0x40e189=>_0x40e189[_0x38c0b3(0xbf)]),_0x49028e=_0x44b738[_0x38c0b3(0xf0)][_0x38c0b3(0xe8)](_0x60ae62=>!_0x60ae62['isNew']&&_0x60ae62[_0x38c0b3(0xaf)]),_0x36098b=_0x44b738[_0x38c0b3(0xf0)][_0x38c0b3(0xe8)](_0x5e3002=>!_0x5e3002[_0x38c0b3(0xbf)]&&!_0x5e3002[_0x38c0b3(0xaf)]);console[_0x38c0b3(0xbc)](_0x38c0b3(0xd1)+_0x44b738[_0x38c0b3(0xd4)]+'\x27:'),console[_0x38c0b3(0xbc)](_0x38c0b3(0xb7)+a40_0x2f0165['cyan'](_0x44b738[_0x38c0b3(0xd2)]['segments']+_0x38c0b3(0xb1))+_0x38c0b3(0xf3)+a40_0x2f0165[_0x38c0b3(0xf6)](_0x44b738[_0x38c0b3(0xd2)][_0x38c0b3(0xd6)]+'\x20activations'));if(_0x44b738[_0x38c0b3(0xd2)]['journeys']>0x0){const _0x2b8525=_0x44b738[_0x38c0b3(0xd2)][_0x38c0b3(0xae)]>_0x44b738[_0x38c0b3(0xd2)][_0x38c0b3(0xce)]?'\x20('+_0x44b738['counts'][_0x38c0b3(0xae)]+_0x38c0b3(0xc2):'';console[_0x38c0b3(0xbc)]('\x20\x20🗺️\x20\x20'+a40_0x2f0165['cyan'](_0x44b738[_0x38c0b3(0xd2)][_0x38c0b3(0xce)]+_0x38c0b3(0xb9))+a40_0x2f0165[_0x38c0b3(0xf1)](_0x2b8525));}console['error']('\x20\x20'+a40_0x2f0165['green']('+\x20'+_0x315dab[_0x38c0b3(0xfc)]+_0x38c0b3(0xad))),console[_0x38c0b3(0xbc)]('\x20\x20'+a40_0x2f0165[_0x38c0b3(0xd7)]('~\x20'+_0x49028e[_0x38c0b3(0xfc)]+_0x38c0b3(0xb4))),console[_0x38c0b3(0xbc)]('\x20\x20'+a40_0x2f0165[_0x38c0b3(0xf1)]('=\x20'+_0x36098b[_0x38c0b3(0xfc)]+_0x38c0b3(0xd9))),console['error'](_0x38c0b3(0xe7)+a40_0x2f0165['cyan'](_0x44b738[_0x38c0b3(0xe4)])+'\x0a');if(_0x49028e[_0x38c0b3(0xfc)]>0x0)for(const _0x375d72 of _0x49028e){console[_0x38c0b3(0xbc)](_0x38c0b3(0xd8)+_0x375d72['relativePath']+'\x27:'),console[_0x38c0b3(0xbc)]('─'[_0x38c0b3(0xc0)](0x3c)),console[_0x38c0b3(0xbc)](_0x375d72[_0x38c0b3(0xe0)]),console[_0x38c0b3(0xbc)]('─'[_0x38c0b3(0xc0)](0x3c));}if(_0x3b1762['dryRun'])return console[_0x38c0b3(0xbc)](a40_0x2f0165[_0x38c0b3(0xd7)](_0x38c0b3(0xdb))),0x0;if(_0x315dab[_0x38c0b3(0xfc)]===0x0&&_0x49028e[_0x38c0b3(0xfc)]===0x0)return console[_0x38c0b3(0xbc)](a40_0x2f0165[_0x38c0b3(0xcf)](_0x38c0b3(0xfa))),saveSessionContext({'parent_segment':_0x44b738[_0x38c0b3(0xd4)]},_0x3b1762[_0x38c0b3(0xec)]),console[_0x38c0b3(0xbc)](a40_0x2f0165[_0x38c0b3(0xcf)]('✔\x20Context\x20set:\x20'+a40_0x2f0165[_0x38c0b3(0xf1)]('parent_segment')+_0x38c0b3(0xfb)+a40_0x2f0165['cyan'](_0x44b738[_0x38c0b3(0xd4)]))),0x0;if(!_0x3b1762[_0x38c0b3(0xc6)]){if(!isInteractive())return console[_0x38c0b3(0xbc)](a40_0x2f0165[_0x38c0b3(0xc7)](_0x38c0b3(0xcb)),_0x38c0b3(0xeb)),console[_0x38c0b3(0xbc)](a40_0x2f0165['dim'](_0x38c0b3(0xea))),0x1;const _0x44e059=await confirmKey('Write\x20'+(_0x315dab[_0x38c0b3(0xfc)]+_0x49028e[_0x38c0b3(0xfc)])+'\x20files?');if(!_0x44e059)return console[_0x38c0b3(0xbc)](a40_0x2f0165[_0x38c0b3(0xd7)](_0x38c0b3(0xc5)),_0x38c0b3(0xf7)),0x1;}for(const _0x4dd74d of _0x44b738['files']){if(_0x4dd74d[_0x38c0b3(0xbf)]||_0x4dd74d['hasChanges']){const _0xebc757=a40_0x5842a5[_0x38c0b3(0xbd)](_0x4dd74d[_0x38c0b3(0xb3)]);!existsSync(_0xebc757)&&mkdirSync(_0xebc757,{'recursive':!![]}),writeFileSync(_0x4dd74d['absolutePath'],_0x4dd74d[_0x38c0b3(0xe6)],_0x38c0b3(0xd0));}}return console[_0x38c0b3(0xbc)](a40_0x2f0165[_0x38c0b3(0xcf)](_0x38c0b3(0xd3)+(_0x315dab[_0x38c0b3(0xfc)]+_0x49028e[_0x38c0b3(0xfc)])+_0x38c0b3(0xf5)+_0x44b738[_0x38c0b3(0xe4)])),saveSessionContext({'parent_segment':_0x44b738[_0x38c0b3(0xd4)]},_0x3b1762[_0x38c0b3(0xec)]),console['error'](a40_0x2f0165[_0x38c0b3(0xcf)](_0x38c0b3(0xe1)+a40_0x2f0165[_0x38c0b3(0xf1)](_0x38c0b3(0xed))+'\x20=\x20'+a40_0x2f0165['cyan'](_0x44b738[_0x38c0b3(0xd4)]))),0x0;}}
1
+ const a40_0x3b6a46=a40_0x2fd3;function a40_0x2fd3(_0x56f22b,_0x499d18){_0x56f22b=_0x56f22b-0xc4;const _0x23d122=a40_0x23d1();let _0x2fd312=_0x23d122[_0x56f22b];return _0x2fd312;}(function(_0x1262ae,_0x5865cc){const _0x5c7e81=a40_0x2fd3,_0x39d93c=_0x1262ae();while(!![]){try{const _0xdcef9b=-parseInt(_0x5c7e81(0xc5))/0x1*(-parseInt(_0x5c7e81(0x10e))/0x2)+parseInt(_0x5c7e81(0xd5))/0x3*(-parseInt(_0x5c7e81(0xc4))/0x4)+parseInt(_0x5c7e81(0xf2))/0x5+-parseInt(_0x5c7e81(0x10f))/0x6*(parseInt(_0x5c7e81(0x102))/0x7)+-parseInt(_0x5c7e81(0xca))/0x8+parseInt(_0x5c7e81(0xe9))/0x9+parseInt(_0x5c7e81(0xd6))/0xa;if(_0xdcef9b===_0x5865cc)break;else _0x39d93c['push'](_0x39d93c['shift']());}catch(_0xbe9a54){_0x39d93c['push'](_0x39d93c['shift']());}}}(a40_0x23d1,0x55eb7));import{BaseCommand}from'./command.js';function a40_0x23d1(){const _0x1039c1=['isNew','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','\x20files\x20to\x20','Parent\x20segment:\x20','2221615kwREup','files','\x20=\x20','red','error','\x20changed\x20files','session','absolutePath','segments','\x20\x20🎯\x20','Target\x20resource:\x20','\x20\x20Target:\x20','Write\x20','yes','cyan','\x20new\x20files','42623BxgZLq','journeyVersions','\x20\x20🗺️\x20\x20','helpText','parent_segment','Error:\x20','segment','targetDir','type','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','✔\x20All\x20files\x20are\x20up\x20to\x20date','pullSegments','26oyXovH','642uBDgSE','\x20with\x20','length','168332KuCzEM','5374gUAUZb','file','dryRun','utf-8','description','3291232KSclVv','execute','parentName','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file','\x0aError:','resourceName','Usage:\x20tdx\x20sg\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20(requires\x20context\x20or\x20tdx.json)','\x20files?','segment:pull','\x20journeys','39PwizdU','9392690HxcknB','counts','\x20segments','cwd','data','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent','no_parent','\x20unchanged\x20files','dim','\x20activations','hasChanges','✔\x20Context\x20set:\x20','activations','yellow','setPhase','filter','diff','errorCode','-\x20no\x20files\x20written','4576311vUbJVz','journeys','Site:\x20','verbose','green'];a40_0x23d1=function(){return _0x1039c1;};return a40_0x23d1();}import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{saveSessionContext}from'../core/session.js';import a40_0x202750 from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';import a40_0x43e415 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']=a40_0x3b6a46(0xd3);[a40_0x3b6a46(0xc9)]='Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files';async[a40_0x3b6a46(0xcb)](_0x129d7e){const _0x3d56c5=a40_0x3b6a46,{options:_0x22bf27,args:_0xbe231b,tdx:_0x1077db}=_0x129d7e,_0xbc40ef=_0x22bf27,_0x535ade=await resolveTarget({'arg':_0xbe231b[0x0],'contextParent':_0x22bf27['parentSegment'],'cwd':process[_0x3d56c5(0xd9)]()});if(!isSuccessfulResolution(_0x535ade))return _0x535ade[_0x3d56c5(0xe7)]===_0x3d56c5(0xdc)?(console[_0x3d56c5(0xf6)](a40_0x202750[_0x3d56c5(0xe3)]('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console['error'](_0x3d56c5(0xd1)),console[_0x3d56c5(0xf6)](_0x3d56c5(0xdb)),console[_0x3d56c5(0xf6)](_0x3d56c5(0xce))):(console[_0x3d56c5(0xf6)](a40_0x202750['red'](_0x3d56c5(0x107)+_0x535ade['message']+'\x0a')),_0x535ade['helpText']&&console['error'](a40_0x202750[_0x3d56c5(0x100)](_0x535ade[_0x3d56c5(0x105)]))),0x1;const _0x39adb2=_0x535ade[_0x3d56c5(0xcc)],_0x1d4ac1=_0x535ade[_0x3d56c5(0x109)],_0x2c5b02=_0x535ade[_0x3d56c5(0x10a)]===_0x3d56c5(0xc6)?_0x535ade[_0x3d56c5(0xd0)]:undefined;_0xbc40ef[_0x3d56c5(0xec)]&&(console['error'](_0x3d56c5(0xeb)+_0xbc40ef['site']),console[_0x3d56c5(0xf6)](_0x3d56c5(0xf1)+_0x39adb2),_0x2c5b02&&console['error'](_0x3d56c5(0xfc)+_0x2c5b02));const _0x4120fe=await withProgressSpinner('Pulling\x20segments\x20from\x20\x27'+_0x39adb2+'\x27...',_0x49465b=>_0x1077db[_0x3d56c5(0x108)][_0x3d56c5(0x10d)](_0x39adb2,{'targetDir':_0x1d4ac1,'targetResourceName':_0x2c5b02,'verbose':_0xbc40ef[_0x3d56c5(0xec)],'progress':{'update':_0x5045ee=>{const _0x592081=_0x3d56c5;_0x49465b[_0x592081(0xe4)](_0x5045ee),_0xbc40ef[_0x592081(0xec)]&&console[_0x592081(0xf6)]('\x20\x20'+_0x5045ee);}}}),{'verbose':_0xbc40ef[_0x3d56c5(0xec)]}),_0x1fc416=_0x4120fe[_0x3d56c5(0xda)];if(_0x1fc416[_0x3d56c5(0xd7)][_0x3d56c5(0xfa)]===0x0&&_0x1fc416[_0x3d56c5(0xd7)][_0x3d56c5(0xea)]===0x0)return console['error'](a40_0x202750['yellow']('No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27'+_0x1fc416[_0x3d56c5(0xcc)]+'\x27')),0x0;const _0x4d5640=_0x1fc416[_0x3d56c5(0xf3)][_0x3d56c5(0xe5)](_0x4262c4=>_0x4262c4['isNew']),_0x595b34=_0x1fc416[_0x3d56c5(0xf3)][_0x3d56c5(0xe5)](_0x52a8d9=>!_0x52a8d9[_0x3d56c5(0xee)]&&_0x52a8d9[_0x3d56c5(0xe0)]),_0x27dbbb=_0x1fc416['files'][_0x3d56c5(0xe5)](_0x560c8d=>!_0x560c8d[_0x3d56c5(0xee)]&&!_0x560c8d[_0x3d56c5(0xe0)]);console[_0x3d56c5(0xf6)]('\x0aPull\x20summary\x20for\x20\x27'+_0x1fc416[_0x3d56c5(0xcc)]+'\x27:'),console['error'](_0x3d56c5(0xfb)+a40_0x202750['cyan'](_0x1fc416['counts'][_0x3d56c5(0xfa)]+_0x3d56c5(0xd8))+_0x3d56c5(0x110)+a40_0x202750[_0x3d56c5(0x100)](_0x1fc416[_0x3d56c5(0xd7)][_0x3d56c5(0xe2)]+_0x3d56c5(0xdf)));if(_0x1fc416['counts'][_0x3d56c5(0xea)]>0x0){const _0x4bd90b=_0x1fc416[_0x3d56c5(0xd7)][_0x3d56c5(0x103)]>_0x1fc416['counts'][_0x3d56c5(0xea)]?'\x20('+_0x1fc416['counts'][_0x3d56c5(0x103)]+'\x20versions)':'';console[_0x3d56c5(0xf6)](_0x3d56c5(0x104)+a40_0x202750[_0x3d56c5(0x100)](_0x1fc416['counts'][_0x3d56c5(0xea)]+_0x3d56c5(0xd4))+a40_0x202750[_0x3d56c5(0xde)](_0x4bd90b));}console[_0x3d56c5(0xf6)]('\x20\x20'+a40_0x202750[_0x3d56c5(0xed)]('+\x20'+_0x4d5640[_0x3d56c5(0x111)]+_0x3d56c5(0x101))),console['error']('\x20\x20'+a40_0x202750['yellow']('~\x20'+_0x595b34[_0x3d56c5(0x111)]+_0x3d56c5(0xf7))),console['error']('\x20\x20'+a40_0x202750[_0x3d56c5(0xde)]('=\x20'+_0x27dbbb['length']+_0x3d56c5(0xdd))),console[_0x3d56c5(0xf6)](_0x3d56c5(0xfd)+a40_0x202750[_0x3d56c5(0x100)](_0x1fc416[_0x3d56c5(0x109)])+'\x0a');if(_0x595b34['length']>0x0)for(const _0x597136 of _0x595b34){console['error']('\x0aChanges\x20to\x20\x27'+_0x597136['relativePath']+'\x27:'),console['error']('─'['repeat'](0x3c)),console[_0x3d56c5(0xf6)](_0x597136[_0x3d56c5(0xe6)]),console[_0x3d56c5(0xf6)]('─'['repeat'](0x3c));}if(_0xbc40ef[_0x3d56c5(0xc7)])return console[_0x3d56c5(0xf6)](a40_0x202750[_0x3d56c5(0xe3)](_0x3d56c5(0xef))),0x0;if(_0x4d5640[_0x3d56c5(0x111)]===0x0&&_0x595b34[_0x3d56c5(0x111)]===0x0)return console['error'](a40_0x202750[_0x3d56c5(0xed)](_0x3d56c5(0x10c))),saveSessionContext({'parent_segment':_0x1fc416[_0x3d56c5(0xcc)]},_0xbc40ef[_0x3d56c5(0xf8)]),console['error'](a40_0x202750[_0x3d56c5(0xed)](_0x3d56c5(0xe1)+a40_0x202750[_0x3d56c5(0xde)]('parent_segment')+_0x3d56c5(0xf4)+a40_0x202750[_0x3d56c5(0x100)](_0x1fc416['parentName']))),0x0;if(!_0xbc40ef[_0x3d56c5(0xff)]){if(!isInteractive())return console[_0x3d56c5(0xf6)](a40_0x202750[_0x3d56c5(0xf5)](_0x3d56c5(0xcf)),_0x3d56c5(0x10b)),console[_0x3d56c5(0xf6)](a40_0x202750['dim'](_0x3d56c5(0xcd))),0x1;const _0x58473f=await confirmKey(_0x3d56c5(0xfe)+(_0x4d5640['length']+_0x595b34['length'])+_0x3d56c5(0xd2));if(!_0x58473f)return console[_0x3d56c5(0xf6)](a40_0x202750[_0x3d56c5(0xe3)]('Aborted.'),_0x3d56c5(0xe8)),0x1;}for(const _0x57798e of _0x1fc416[_0x3d56c5(0xf3)]){if(_0x57798e[_0x3d56c5(0xee)]||_0x57798e[_0x3d56c5(0xe0)]){const _0x18b3c2=a40_0x43e415['dirname'](_0x57798e[_0x3d56c5(0xf9)]);!existsSync(_0x18b3c2)&&mkdirSync(_0x18b3c2,{'recursive':!![]}),writeFileSync(_0x57798e[_0x3d56c5(0xf9)],_0x57798e['content'],_0x3d56c5(0xc8));}}return console[_0x3d56c5(0xf6)](a40_0x202750[_0x3d56c5(0xed)]('✔\x20Pulled\x20'+(_0x4d5640[_0x3d56c5(0x111)]+_0x595b34[_0x3d56c5(0x111)])+_0x3d56c5(0xf0)+_0x1fc416['targetDir'])),saveSessionContext({'parent_segment':_0x1fc416[_0x3d56c5(0xcc)]},_0xbc40ef[_0x3d56c5(0xf8)]),console[_0x3d56c5(0xf6)](a40_0x202750[_0x3d56c5(0xed)](_0x3d56c5(0xe1)+a40_0x202750['dim'](_0x3d56c5(0x106))+_0x3d56c5(0xf4)+a40_0x202750[_0x3d56c5(0x100)](_0x1fc416[_0x3d56c5(0xcc)]))),0x0;}}
@@ -1 +1 @@
1
- const a41_0x143ad6=a41_0x13ea;(function(_0x199fb7,_0x25aa00){const _0x197526=a41_0x13ea,_0x5322eb=_0x199fb7();while(!![]){try{const _0x13359b=parseInt(_0x197526(0x149))/0x1*(parseInt(_0x197526(0x155))/0x2)+parseInt(_0x197526(0x125))/0x3+-parseInt(_0x197526(0x134))/0x4+-parseInt(_0x197526(0x180))/0x5+parseInt(_0x197526(0x168))/0x6+-parseInt(_0x197526(0x15f))/0x7+-parseInt(_0x197526(0x179))/0x8;if(_0x13359b===_0x25aa00)break;else _0x5322eb['push'](_0x5322eb['shift']());}catch(_0x198f4a){_0x5322eb['push'](_0x5322eb['shift']());}}}(a41_0x3187,0x63773));import{BaseCommand}from'./command.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{generateDiff,formatDiffWithColors}from'../utils/diff.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{batchAsync}from'../utils/async.js';import{segmentToYamlString,segmentWithActivationsToYaml}from'../sdk/segment/child-segment-yaml.js';import a41_0x12d2ce from'chalk';import{existsSync}from'fs';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{resolveTarget,isSuccessfulResolution,getScopedDetails}from'../sdk/segment/target-resolution.js';function a41_0x3187(){const _0x30bef6=['Error:\x20','yes','filePath','\x0aValidation\x20failed:','journeyBundleName','Error:\x20Directory\x20not\x20found:\x20','✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','518136BptBio','error','journeyBundleId','\x20unchanged','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','segment:push','red','activations','New\x20journey:','join','createdAt','listActivations','\x20\x20Activations:','Resolving\x20parent\x20segment\x20\x27','length','results','map','\x20\x20Journeys:\x20','📁\x20','Folders\x20to\x20create:','folderPath','7463eVxoNl','state','changed','getJourney','\x0a✔\x20Push\x20complete','journeys','description','idToName','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','Source\x20directory:\x20','yellow','90pbCGyq','cyan','\x20changes?','isScoped','toUpdate','Fetching\x20existing\x20data...','\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20','unchanged','Delete\x20journey:','parentSegment','3934042RNWZJV','resolveParentId','deleted','endsWith','connection','nameToType','add','New\x20segment:','segmentFolderId','2817054ppIyls','Preparing\x20journeys...','isNew','getOutputSchemaWithCache','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','/sb/da/esr','segments','\x20to\x20delete','created','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','helpText','\x20\x20Activations:\x20','Parent\x20segment:\x20','targetDir','\x20activations]','relationships','nameToId','3967688lhBOCY','yamlConfig','segment\x20or\x20journey','segment','file','/app/ps/','buildUserMaps','104545KaSIni','toDelete','updatedAt','green','Scoped\x20to\x20folder:\x20','delete','type','journey','Fetching\x20connections\x20for\x20name\x20resolution...','toString','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','existingJourney','execute','errorCode','Error\x20parsing\x20YAML:\x20','parentFolder','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','Push\x20YAML\x20files\x20to\x20Treasure\x20AI\x20as\x20child\x20segments','\x20to\x20update','listFolders','/j/da/je','set','\x20deleted','push','createdSegmentIds','audienceId','\x20\x20🗺️\x20\x20Journeys:','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','scopedFolderPath','data','name','\x20\x20📊\x20Segments:','Push\x20','folders','parent_name','folderId','.yaml','\x20created','\x20folders\x20to\x20create','\x0aError:','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','no_parent','versionNumber','\x20\x20\x20\x20','list','get','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','existingSegment','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','filter','dim','parentName','attributes','toCreate','updated','\x20changed','blue','verbose','repeat','\x20updated','user','diff','paused','message','journeysOnly','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','site','listJourneysWithDetailsFromParentSegment','2431431uMgAle','(Journey\x20will\x20be\x20deleted)','.yml','Site:\x20','journeyId','No\x20','dryRun','/e/'];a41_0x3187=function(){return _0x30bef6;};return a41_0x3187();}import{buildFolderMaps}from'../sdk/segment/resolution-context.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{resolveTDFolderPath,findSegmentsToDelete,findJourneysToDelete,buildSegmentLookupMap,buildSegmentNameToIdMap,buildJourneyBundleLookupMap,parseAndClassifyYamlFiles,validateParsedFiles,formatValidationErrors,extractRootFolderId,buildConnectionMaps,calculatePushStats,prepareSegmentFiles,prepareJourneyFiles,executePushSegments,executePushFolders,executePushSegmentDeletions,executePushJourneys}from'../sdk/segment/push-workflow.js';function a41_0x13ea(_0x1fb77f,_0x465666){_0x1fb77f=_0x1fb77f-0xf1;const _0x31874f=a41_0x3187();let _0x13ea09=_0x31874f[_0x1fb77f];return _0x13ea09;}export class SegmentPushCommand extends BaseCommand{[a41_0x143ad6(0xff)]=a41_0x143ad6(0x139);['description']=a41_0x143ad6(0xf2);async[a41_0x143ad6(0x18c)](_0xcb5486){const _0x56d0fe=a41_0x143ad6,{options:_0x473c6a,args:_0x1072a3,tdx:_0x177ecc}=_0xcb5486,_0x159064=_0x473c6a,_0x53d4a0=await resolveTarget({'arg':_0x1072a3[0x0],'contextParent':_0x473c6a[_0x56d0fe(0x15e)],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x53d4a0))return _0x53d4a0[_0x56d0fe(0x18d)]===_0x56d0fe(0x10a)?(console[_0x56d0fe(0x135)](a41_0x12d2ce['yellow'](_0x56d0fe(0x16c))),console[_0x56d0fe(0x135)](_0x56d0fe(0x151)),console[_0x56d0fe(0x135)](_0x56d0fe(0x171)),console[_0x56d0fe(0x135)]('\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[_0x56d0fe(0x135)](a41_0x12d2ce[_0x56d0fe(0x13a)](_0x56d0fe(0x12d)+_0x53d4a0[_0x56d0fe(0x120)]+'\x0a')),_0x53d4a0[_0x56d0fe(0x172)]&&console[_0x56d0fe(0x135)](a41_0x12d2ce['cyan'](_0x53d4a0[_0x56d0fe(0x172)]))),0x1;if(_0x53d4a0[_0x56d0fe(0x186)]===_0x56d0fe(0x103))return console[_0x56d0fe(0x135)](a41_0x12d2ce[_0x56d0fe(0x13a)](_0x56d0fe(0x132)+_0x53d4a0['targetDir']+'\x0a')),console[_0x56d0fe(0x135)](a41_0x12d2ce['cyan'](_0x56d0fe(0x18a))),0x1;const _0x55ee4b=_0x53d4a0[_0x56d0fe(0x114)],_0x52859c=_0x53d4a0[_0x56d0fe(0x175)],_0x2beceb=_0x53d4a0[_0x56d0fe(0x186)]===_0x56d0fe(0x17d)?_0x53d4a0[_0x56d0fe(0x12f)]:undefined,_0x421299=getScopedDetails(_0x53d4a0),_0x3d009d=_0x421299?.[_0x56d0fe(0x158)]??![],_0x12cf9a=_0x421299?.[_0x56d0fe(0xfd)]??'';if(!existsSync(_0x52859c))return console[_0x56d0fe(0x135)](a41_0x12d2ce[_0x56d0fe(0x13a)](_0x56d0fe(0x132)+_0x52859c+'\x0a')),console[_0x56d0fe(0x135)](a41_0x12d2ce['cyan'](_0x56d0fe(0x18a))),0x1;_0x159064[_0x56d0fe(0x11a)]&&(console[_0x56d0fe(0x135)](_0x56d0fe(0x128)+_0x159064['site']),console[_0x56d0fe(0x135)](_0x56d0fe(0x174)+_0x55ee4b),console[_0x56d0fe(0x135)](_0x56d0fe(0x153)+_0x52859c),_0x3d009d&&console[_0x56d0fe(0x135)](_0x56d0fe(0x184)+_0x12cf9a));const _0x2979ae=await withSpinner(_0x56d0fe(0x141)+_0x55ee4b+'\x27...',()=>_0x177ecc['segment'][_0x56d0fe(0x160)](_0x55ee4b),{'verbose':_0x159064[_0x56d0fe(0x11a)]}),_0x5ee5e1=_0x2979ae[_0x56d0fe(0xfe)],{parentSegmentResult:_0x2a2a4a,segmentsResult:_0x65068f,foldersResult:_0xa1fa83,journeysWithDetailsResult:_0xe8fdda,userMaps:_0x352bce}=await withSpinner(_0x56d0fe(0x15a),async()=>{const _0x31690c=_0x56d0fe,[_0x16d828,_0x11b659,_0x310533,_0x3ea8bb,_0x40a7d2]=await Promise['all']([_0x177ecc[_0x31690c(0x17c)]['getParent'](_0x5ee5e1),_0x177ecc['segment']['listSegments'](_0x5ee5e1),_0x177ecc['segment'][_0x31690c(0xf4)](_0x5ee5e1),_0x177ecc[_0x31690c(0x187)][_0x31690c(0x124)](_0x5ee5e1,{'includeAllVersions':!![]}),_0x177ecc['user'][_0x31690c(0x17f)]()]);return{'parentSegmentResult':_0x16d828,'segmentsResult':_0x11b659,'foldersResult':_0x310533,'journeysWithDetailsResult':_0x3ea8bb,'userMaps':_0x40a7d2};},{'verbose':_0x159064[_0x56d0fe(0x11a)]})['then'](_0xb96c1a=>_0xb96c1a[_0x56d0fe(0xfe)]),_0x429ce0=_0x2a2a4a,_0x56d2c0=extractRootFolderId(_0x429ce0),_0x294ee4=_0x65068f,_0x9d88c1=_0xa1fa83,{journeys:_0x16dd7c,activationStepsById:_0x401991}=_0xe8fdda,_0x251cb7=new Map(_0x16dd7c[_0x56d0fe(0x144)](_0x459458=>[_0x459458['id'],_0x459458])),_0x1fb791=_0x16dd7c[_0x56d0fe(0x144)](_0x18808e=>({'id':_0x18808e['id'],'name':_0x18808e[_0x56d0fe(0x115)]['name'],'journeyBundleName':_0x18808e[_0x56d0fe(0x115)][_0x56d0fe(0x131)]||'','journeyBundleId':_0x18808e['attributes'][_0x56d0fe(0x136)]||'','versionNumber':_0x18808e['attributes'][_0x56d0fe(0x10b)],'description':_0x18808e[_0x56d0fe(0x115)][_0x56d0fe(0x14f)],'state':_0x18808e[_0x56d0fe(0x115)][_0x56d0fe(0x14a)],'paused':_0x18808e[_0x56d0fe(0x115)][_0x56d0fe(0x11f)],'audienceId':_0x18808e[_0x56d0fe(0x115)][_0x56d0fe(0xfa)],'folderId':_0x18808e[_0x56d0fe(0x177)]?.[_0x56d0fe(0x18f)]?.[_0x56d0fe(0xfe)]?.['id'],'createdAt':_0x18808e[_0x56d0fe(0x115)][_0x56d0fe(0x13e)],'updatedAt':_0x18808e[_0x56d0fe(0x115)][_0x56d0fe(0x182)]})),{emailToId:_0x13a086,idToEmail:_0x341e9a}=_0x352bce,_0x55d9a4=await withSpinner(_0x56d0fe(0x188),async()=>{const _0x41dce4=_0x56d0fe,_0x50a3b4=await _0x177ecc[_0x41dce4(0x163)][_0x41dce4(0x10d)]();return buildConnectionMaps(_0x50a3b4);},{'verbose':_0x159064[_0x56d0fe(0x11a)]})['then'](_0x4dcc1f=>_0x4dcc1f[_0x56d0fe(0xfe)]),_0x1209ee=_0x55d9a4[_0x56d0fe(0x178)],_0x3e0115=_0x55d9a4[_0x56d0fe(0x150)],_0xf35023=_0x55d9a4[_0x56d0fe(0x164)],_0xfc926f={'emailToIdMap':_0x13a086,'connectionNameToIdMap':_0x1209ee,'connectionNameToTypeMap':_0xf35023,'getSchema':_0x3b224d=>_0x177ecc[_0x56d0fe(0x163)][_0x56d0fe(0x16b)](_0x3b224d)};let {pathToId:_0x508e8d,idToPath:_0x23c13c}=buildFolderMaps(_0x9d88c1);const _0x529ed4=buildSegmentLookupMap(_0x294ee4,_0x23c13c),_0xa52bb=buildSegmentNameToIdMap(_0x294ee4),_0x4869aa=buildJourneyBundleLookupMap(_0x1fb791,_0x23c13c);let _0x471ea3;if(_0x2beceb){if(!_0x2beceb[_0x56d0fe(0x162)](_0x56d0fe(0x127))&&!_0x2beceb['endsWith'](_0x56d0fe(0x105)))return console[_0x56d0fe(0x135)](a41_0x12d2ce[_0x56d0fe(0x13a)](_0x56d0fe(0x109)+_0x2beceb+'\x0a')),0x1;_0x471ea3=[_0x2beceb];}else _0x471ea3=findYamlFiles(_0x52859c);if(_0x471ea3[_0x56d0fe(0x142)]===0x0)return console[_0x56d0fe(0x135)](a41_0x12d2ce['red'](_0x56d0fe(0x138)+_0x52859c+'\x0a')),console[_0x56d0fe(0x135)](a41_0x12d2ce[_0x56d0fe(0x156)]('Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files')),0x1;let _0x8617e8,_0x2e3c84;try{const _0x53d203=parseAndClassifyYamlFiles(_0x471ea3,_0x52859c,{'skipSegments':_0x159064['journeysOnly']});_0x8617e8=_0x53d203['segments'],_0x2e3c84=_0x53d203[_0x56d0fe(0x14e)];const _0x1bfc42=validateParsedFiles(_0x53d203,_0x52859c);if(_0x1bfc42[_0x56d0fe(0x142)]>0x0)return console[_0x56d0fe(0x135)](a41_0x12d2ce[_0x56d0fe(0x13a)](_0x56d0fe(0x130))),console[_0x56d0fe(0x135)](formatValidationErrors(_0x1bfc42)),console[_0x56d0fe(0x135)](a41_0x12d2ce[_0x56d0fe(0x154)](_0x56d0fe(0x10f))),0x1;}catch(_0x4c7d88){return console[_0x56d0fe(0x135)](a41_0x12d2ce['red'](_0x56d0fe(0x18e)+(_0x4c7d88 instanceof Error?_0x4c7d88[_0x56d0fe(0x120)]:_0x4c7d88))),0x1;}if(_0x8617e8['length']===0x0&&_0x2e3c84[_0x56d0fe(0x142)]===0x0){const _0x378171=_0x159064[_0x56d0fe(0x121)]?_0x56d0fe(0x187):_0x56d0fe(0x17b);return console[_0x56d0fe(0x135)](a41_0x12d2ce['yellow'](_0x56d0fe(0x12a)+_0x378171+_0x56d0fe(0x152))),0x0;}const _0xf2b428=new Map();_0x294ee4['length']>0x0&&!_0x159064[_0x56d0fe(0x121)]&&await withSpinner('Fetching\x20existing\x20activations...',async()=>{await batchAsync(_0x294ee4,async _0xbe3ca=>{const _0x4bc230=a41_0x13ea,_0x234874=await _0x177ecc[_0x4bc230(0x17c)][_0x4bc230(0x13f)](_0x5ee5e1,_0xbe3ca['id']);_0xf2b428[_0x4bc230(0xf6)](_0xbe3ca['id'],_0x234874);});},{'verbose':_0x159064[_0x56d0fe(0x11a)]});const {segmentFiles:_0x4e31e6,foldersToCreate:_0x33aacb}=await prepareSegmentFiles(_0x8617e8,{'segmentByFolderAndName':_0x529ed4,'activationsBySegmentId':_0xf2b428,'folderPathToId':_0x508e8d,'idToEmailMap':_0x341e9a,'connectionIdToNameMap':_0x3e0115},_0xfc926f,_0x3d009d,_0x12cf9a),_0x5f2024=_0x2beceb?[]:findSegmentsToDelete(_0x294ee4,_0x8617e8[_0x56d0fe(0x144)](({yamlConfig:_0x2a23e6,folderPath:_0x4568a8})=>({'yamlConfig':_0x2a23e6,'folderPath':resolveTDFolderPath(_0x4568a8,_0x3d009d,_0x12cf9a)})),_0x23c13c,_0x12cf9a,_0x3d009d),{journeyFiles:_0x41915a,foldersToCreate:_0x230143}=await withProgressSpinner(_0x56d0fe(0x169),async _0x59001c=>prepareJourneyFiles(_0x2e3c84,{'fetchJourney':async _0x422ae2=>_0x177ecc['journey'][_0x56d0fe(0x14c)](_0x422ae2[_0x56d0fe(0x129)]),'journeyBundlesByFolderAndName':_0x4869aa,'folderPathToId':_0x508e8d,'idToEmailMap':_0x341e9a,'connectionIdToNameMap':_0x3e0115,'existingSegments':_0x294ee4,'parentId':_0x5ee5e1,'deps':_0x177ecc,'progress':{'update':_0x230fe8=>{const _0x203012=_0x56d0fe;_0x59001c['setPhase'](_0x230fe8),_0x159064['verbose']&&console[_0x203012(0x135)]('\x20\x20'+_0x230fe8);}},'journeyById':_0x251cb7,'activationStepsById':_0x401991},_0x3d009d,_0x12cf9a),{'verbose':_0x159064[_0x56d0fe(0x11a)]})['then'](_0x4b1792=>_0x4b1792[_0x56d0fe(0xfe)]);for(const _0x3f3b68 of _0x230143){_0x33aacb[_0x56d0fe(0x165)](_0x3f3b68);}const _0xc802=_0x2beceb?[]:findJourneysToDelete(_0x1fb791,_0x2e3c84[_0x56d0fe(0x144)](({yamlConfig:_0x5dd9c8,folderPath:_0x286a25})=>({'yamlConfig':_0x5dd9c8,'folderPath':resolveTDFolderPath(_0x286a25,_0x3d009d,_0x12cf9a)})),_0x23c13c,_0x12cf9a,_0x3d009d),_0x20491a=calculatePushStats(_0x4e31e6,_0x41915a,_0x33aacb,_0x5f2024,_0xc802,!!_0x159064[_0x56d0fe(0x185)],!!_0x159064['journeysOnly']),_0xbcc5bd=_0x20491a[_0x56d0fe(0x16e)]['new'],_0x121e73=_0x20491a[_0x56d0fe(0x16e)][_0x56d0fe(0x14b)],_0x2a7d16=_0x20491a[_0x56d0fe(0x16e)][_0x56d0fe(0x15c)],_0x3c6306=_0x20491a[_0x56d0fe(0x16e)]['toDelete'],_0x4a1ab1=_0x20491a[_0x56d0fe(0x102)][_0x56d0fe(0x116)],_0x2cc77c=_0x20491a[_0x56d0fe(0x14e)]['new'],_0x4feee8=_0x20491a[_0x56d0fe(0x14e)][_0x56d0fe(0x14b)],_0x4a84d0=_0x20491a[_0x56d0fe(0x14e)][_0x56d0fe(0x15c)],_0xeee87b=_0x20491a[_0x56d0fe(0x14e)][_0x56d0fe(0x181)],_0x311fcd=_0x20491a['activations']['all'],_0x2388a9=_0x20491a['activations']['toCreate'],_0xea6a7f=_0x20491a['activations'][_0x56d0fe(0x159)],_0x46f8d0=_0x20491a[_0x56d0fe(0x13b)][_0x56d0fe(0x181)];console[_0x56d0fe(0x135)]('\x0aPush\x20summary\x20for\x20\x27'+_0x55ee4b+'\x27:');_0x4a1ab1[_0x56d0fe(0x142)]>0x0&&console[_0x56d0fe(0x135)]('\x20\x20'+a41_0x12d2ce[_0x56d0fe(0x119)](_0x56d0fe(0x146)+_0x4a1ab1['length']+_0x56d0fe(0x107)));if(!_0x159064[_0x56d0fe(0x121)]){console[_0x56d0fe(0x135)](_0x56d0fe(0x100)),console[_0x56d0fe(0x135)](_0x56d0fe(0x10c)+a41_0x12d2ce[_0x56d0fe(0x183)]('+\x20'+_0xbcc5bd[_0x56d0fe(0x142)]+'\x20new')),console[_0x56d0fe(0x135)]('\x20\x20\x20\x20'+a41_0x12d2ce[_0x56d0fe(0x154)]('~\x20'+_0x121e73[_0x56d0fe(0x142)]+_0x56d0fe(0x118)));if(_0x3c6306[_0x56d0fe(0x142)]>0x0)console['error'](_0x56d0fe(0x10c)+a41_0x12d2ce[_0x56d0fe(0x13a)]('-\x20'+_0x3c6306[_0x56d0fe(0x142)]+_0x56d0fe(0x16f)));else _0x5f2024['length']>0x0&&!_0x159064[_0x56d0fe(0x185)]&&console[_0x56d0fe(0x135)](_0x56d0fe(0x10c)+a41_0x12d2ce[_0x56d0fe(0x113)](_0x5f2024[_0x56d0fe(0x142)]+_0x56d0fe(0x122)));console[_0x56d0fe(0x135)](_0x56d0fe(0x10c)+a41_0x12d2ce[_0x56d0fe(0x113)]('=\x20'+_0x2a7d16[_0x56d0fe(0x142)]+_0x56d0fe(0x137)));}if(_0x41915a[_0x56d0fe(0x142)]>0x0||_0xc802['length']>0x0){console[_0x56d0fe(0x135)](_0x56d0fe(0xfb)),console['error'](_0x56d0fe(0x10c)+a41_0x12d2ce[_0x56d0fe(0x183)]('+\x20'+_0x2cc77c[_0x56d0fe(0x142)]+'\x20new')),console[_0x56d0fe(0x135)](_0x56d0fe(0x10c)+a41_0x12d2ce[_0x56d0fe(0x154)]('~\x20'+_0x4feee8[_0x56d0fe(0x142)]+'\x20changed'));if(_0xeee87b[_0x56d0fe(0x142)]>0x0)console[_0x56d0fe(0x135)](_0x56d0fe(0x10c)+a41_0x12d2ce['red']('-\x20'+_0xeee87b['length']+_0x56d0fe(0x16f)));else _0xc802[_0x56d0fe(0x142)]>0x0&&!_0x159064['delete']&&console[_0x56d0fe(0x135)](_0x56d0fe(0x10c)+a41_0x12d2ce[_0x56d0fe(0x113)](_0xc802['length']+'\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)'));console['error']('\x20\x20\x20\x20'+a41_0x12d2ce[_0x56d0fe(0x113)]('=\x20'+_0x4a84d0[_0x56d0fe(0x142)]+_0x56d0fe(0x137)));}_0x311fcd[_0x56d0fe(0x142)]>0x0&&!_0x159064[_0x56d0fe(0x121)]&&(console[_0x56d0fe(0x135)](''),console[_0x56d0fe(0x135)](_0x56d0fe(0x140)),_0x2388a9[_0x56d0fe(0x142)]>0x0&&console[_0x56d0fe(0x135)](_0x56d0fe(0x10c)+a41_0x12d2ce[_0x56d0fe(0x183)]('+\x20'+_0x2388a9['length']+'\x20to\x20create')),_0xea6a7f['length']>0x0&&console['error'](_0x56d0fe(0x10c)+a41_0x12d2ce['yellow']('~\x20'+_0xea6a7f[_0x56d0fe(0x142)]+_0x56d0fe(0xf3))),_0x46f8d0[_0x56d0fe(0x142)]>0x0&&console[_0x56d0fe(0x135)](_0x56d0fe(0x10c)+a41_0x12d2ce[_0x56d0fe(0x13a)]('-\x20'+_0x46f8d0[_0x56d0fe(0x142)]+'\x20to\x20delete')));console['error']('\x20\x20Source:\x20'+a41_0x12d2ce[_0x56d0fe(0x156)](_0x52859c)+'\x0a');if(_0x4a1ab1[_0x56d0fe(0x142)]>0x0){console['error'](_0x56d0fe(0x147));for(const _0x24150a of _0x4a1ab1){console[_0x56d0fe(0x135)]('\x20\x20'+a41_0x12d2ce['blue']('+')+'\x20'+_0x24150a);}console['error']('');}if(_0xbcc5bd[_0x56d0fe(0x142)]>0x0&&!_0x159064['journeysOnly'])for(const _0x4fedbf of _0xbcc5bd){const _0x5a7a54=_0x4fedbf[_0x56d0fe(0x148)]?_0x4fedbf['folderPath']+'/'+_0x4fedbf['yamlConfig'][_0x56d0fe(0xff)]:_0x4fedbf['yamlConfig'][_0x56d0fe(0xff)],_0x5dc05d=_0x4fedbf[_0x56d0fe(0x17a)][_0x56d0fe(0x13b)]?.[_0x56d0fe(0x142)]||0x0,_0x554a23=_0x5dc05d>0x0?a41_0x12d2ce[_0x56d0fe(0x113)]('\x20['+_0x5dc05d+_0x56d0fe(0x176)):'';console['error']('\x0a'+a41_0x12d2ce[_0x56d0fe(0x183)](_0x56d0fe(0x166))+'\x20'+_0x5a7a54+_0x554a23),console[_0x56d0fe(0x135)]('─'[_0x56d0fe(0x11b)](0x3c)),_0x4fedbf['diff']&&console['error'](_0x4fedbf[_0x56d0fe(0x11e)]),console[_0x56d0fe(0x135)]('─'[_0x56d0fe(0x11b)](0x3c));}if(_0x3c6306[_0x56d0fe(0x142)]>0x0&&!_0x159064[_0x56d0fe(0x121)])for(const _0xdb8d3b of _0x3c6306){const _0x341a30=_0xdb8d3b[_0x56d0fe(0x167)]?_0x23c13c[_0x56d0fe(0x10e)](_0xdb8d3b[_0x56d0fe(0x167)][_0x56d0fe(0x189)]())||'':'',_0x4c2e92=_0x341a30?_0x341a30+'/'+_0xdb8d3b[_0x56d0fe(0xff)]:_0xdb8d3b['name'],_0x366a3d=_0xf2b428[_0x56d0fe(0x10e)](_0xdb8d3b['id'])||[],_0x5583b1=_0x366a3d['length']>0x0?a41_0x12d2ce[_0x56d0fe(0x113)]('\x20['+_0x366a3d[_0x56d0fe(0x142)]+'\x20activations]'):'';console[_0x56d0fe(0x135)]('\x0a'+a41_0x12d2ce[_0x56d0fe(0x13a)]('Delete\x20segment:')+'\x20'+_0x4c2e92+_0x5583b1),console[_0x56d0fe(0x135)]('─'[_0x56d0fe(0x11b)](0x3c));const _0x1a68e5=segmentWithActivationsToYaml(_0xdb8d3b,_0x366a3d,undefined,_0x341e9a,_0x3e0115),_0x398886=segmentToYamlString(_0x1a68e5),_0x5e9aca=generateDiff(_0x398886,'');console[_0x56d0fe(0x135)](formatDiffWithColors(_0x5e9aca)),console['error']('─'[_0x56d0fe(0x11b)](0x3c));}const _0x43a375=_0x4e31e6[_0x56d0fe(0x112)](_0x5bf8e5=>!_0x5bf8e5[_0x56d0fe(0x16a)]&&_0x5bf8e5[_0x56d0fe(0x11e)]);if(_0x43a375[_0x56d0fe(0x142)]>0x0&&!_0x159064['journeysOnly'])for(const _0x1885f6 of _0x43a375){const _0x288e19=_0x1885f6[_0x56d0fe(0x148)]?_0x1885f6[_0x56d0fe(0x148)]+'/'+_0x1885f6[_0x56d0fe(0x17a)][_0x56d0fe(0xff)]:_0x1885f6[_0x56d0fe(0x17a)][_0x56d0fe(0xff)];console[_0x56d0fe(0x135)]('\x0a'+a41_0x12d2ce[_0x56d0fe(0x154)]('Changes\x20to:')+'\x20'+_0x288e19),console[_0x56d0fe(0x135)]('─'[_0x56d0fe(0x11b)](0x3c)),console[_0x56d0fe(0x135)](_0x1885f6[_0x56d0fe(0x11e)]),console[_0x56d0fe(0x135)]('─'[_0x56d0fe(0x11b)](0x3c));}if(_0x2cc77c[_0x56d0fe(0x142)]>0x0)for(const _0x494e82 of _0x2cc77c){const _0x3dfcb7=_0x494e82[_0x56d0fe(0x148)]?_0x494e82[_0x56d0fe(0x148)]+'/'+_0x494e82['yamlConfig'][_0x56d0fe(0xff)]:_0x494e82[_0x56d0fe(0x17a)]['name'];console[_0x56d0fe(0x135)]('\x0a'+a41_0x12d2ce['green'](_0x56d0fe(0x13c))+'\x20'+_0x3dfcb7),console['error']('─'['repeat'](0x3c)),_0x494e82[_0x56d0fe(0x11e)]&&console[_0x56d0fe(0x135)](_0x494e82[_0x56d0fe(0x11e)]),console['error']('─'[_0x56d0fe(0x11b)](0x3c));}const _0x3ce116=_0x41915a[_0x56d0fe(0x112)](_0x5c71f7=>!_0x5c71f7[_0x56d0fe(0x16a)]&&_0x5c71f7[_0x56d0fe(0x11e)]);if(_0x3ce116[_0x56d0fe(0x142)]>0x0)for(const _0xdb9aa1 of _0x3ce116){const _0x37d22a=_0xdb9aa1[_0x56d0fe(0x148)]?_0xdb9aa1[_0x56d0fe(0x148)]+'/'+_0xdb9aa1[_0x56d0fe(0x17a)][_0x56d0fe(0xff)]:_0xdb9aa1['yamlConfig'][_0x56d0fe(0xff)];console[_0x56d0fe(0x135)]('\x0a'+a41_0x12d2ce[_0x56d0fe(0x154)]('Changes\x20to\x20journey:')+'\x20'+_0x37d22a),console[_0x56d0fe(0x135)]('─'[_0x56d0fe(0x11b)](0x3c)),console['error'](_0xdb9aa1['diff']),console[_0x56d0fe(0x135)]('─'[_0x56d0fe(0x11b)](0x3c));}if(_0xeee87b[_0x56d0fe(0x142)]>0x0)for(const _0x4880a7 of _0xeee87b){const _0x45e14d=_0x4880a7[_0x56d0fe(0x104)]?_0x23c13c['get'](_0x4880a7['folderId'])||'':'',_0x30c8af=_0x45e14d?_0x45e14d+'/'+_0x4880a7[_0x56d0fe(0x131)]:_0x4880a7[_0x56d0fe(0x131)];console['error']('\x0a'+a41_0x12d2ce[_0x56d0fe(0x13a)](_0x56d0fe(0x15d))+'\x20'+_0x30c8af),console[_0x56d0fe(0x135)]('─'[_0x56d0fe(0x11b)](0x3c)),console[_0x56d0fe(0x135)](a41_0x12d2ce[_0x56d0fe(0x13a)](_0x56d0fe(0x126))),console['error']('─'['repeat'](0x3c));}if(_0x159064[_0x56d0fe(0x12b)])return console[_0x56d0fe(0x135)](a41_0x12d2ce[_0x56d0fe(0x154)]('\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made')),0x0;const _0x3c5e90=_0x159064[_0x56d0fe(0x121)]?![]:_0xbcc5bd[_0x56d0fe(0x142)]>0x0||_0x121e73['length']>0x0||_0x3c6306[_0x56d0fe(0x142)]>0x0,_0x325bc4=_0x2cc77c['length']>0x0||_0x4feee8['length']>0x0||_0xeee87b['length']>0x0,_0x1cc472=_0x159064[_0x56d0fe(0x121)]?![]:_0x311fcd['length']>0x0,_0x4cb499=_0x4a1ab1[_0x56d0fe(0x142)]>0x0;if(!_0x3c5e90&&!_0x325bc4&&!_0x1cc472&&!_0x4cb499){const _0x2d4092=_0x159064[_0x56d0fe(0x121)]?'✔\x20All\x20journeys\x20are\x20up\x20to\x20date':_0x56d0fe(0x133);console['error'](a41_0x12d2ce[_0x56d0fe(0x183)](_0x2d4092));if(_0x2beceb&&_0x2a7d16['length']===0x1){const _0xe495a8=_0x2a7d16[0x0];if(_0xe495a8[_0x56d0fe(0x110)]?.['id']){const _0x500147=getConsoleNextUrl(_0x159064[_0x56d0fe(0x123)],_0x56d0fe(0x17e)+_0x5ee5e1+_0x56d0fe(0x12c)+_0xe495a8[_0x56d0fe(0x110)]['id']+_0x56d0fe(0x16d));console[_0x56d0fe(0x135)](_0x56d0fe(0x15b)+a41_0x12d2ce[_0x56d0fe(0x156)](_0x500147));}}if(_0x2beceb&&_0x4a84d0['length']===0x1){const _0x4d1dfe=_0x4a84d0[0x0];if(_0x4d1dfe[_0x56d0fe(0x18b)]?.['id']){const _0x27cfb4=getConsoleNextUrl(_0x159064[_0x56d0fe(0x123)],_0x56d0fe(0x17e)+_0x5ee5e1+_0x56d0fe(0x12c)+_0x4d1dfe[_0x56d0fe(0x18b)]['id']+'/j/da/je');console[_0x56d0fe(0x135)]('\x20\x20'+a41_0x12d2ce[_0x56d0fe(0x156)](_0x27cfb4));}}return 0x0;}const _0xb0e0db=_0x159064[_0x56d0fe(0x121)]?_0x2cc77c[_0x56d0fe(0x142)]+_0x4feee8[_0x56d0fe(0x142)]+_0xeee87b[_0x56d0fe(0x142)]+_0x4a1ab1['length']:_0xbcc5bd[_0x56d0fe(0x142)]+_0x121e73[_0x56d0fe(0x142)]+_0x3c6306[_0x56d0fe(0x142)]+_0x2cc77c[_0x56d0fe(0x142)]+_0x4feee8[_0x56d0fe(0x142)]+_0xeee87b[_0x56d0fe(0x142)]+_0x4a1ab1[_0x56d0fe(0x142)]+_0x311fcd[_0x56d0fe(0x142)];if(!_0x159064[_0x56d0fe(0x12e)]&&_0xb0e0db>0x0){if(!isInteractive())return console[_0x56d0fe(0x135)](a41_0x12d2ce[_0x56d0fe(0x13a)](_0x56d0fe(0x108)),_0x56d0fe(0x111)),console['error'](a41_0x12d2ce[_0x56d0fe(0x113)](_0x56d0fe(0xfc))),0x1;const _0x54e4dd=await confirmKey(_0x56d0fe(0x101)+_0xb0e0db+_0x56d0fe(0x157));if(!_0x54e4dd)return console[_0x56d0fe(0x135)](a41_0x12d2ce[_0x56d0fe(0x154)]('Aborted.')),0x1;}const _0x241650={'withProgress':async(_0x192e88,_0x131b05)=>{const _0x3dae20=_0x56d0fe,_0x51563c=await withSpinner(_0x192e88,_0x131b05,{'verbose':_0x159064[_0x3dae20(0x11a)]});return{'data':_0x51563c['data']};},'logInfo':_0xf4ca0f=>console[_0x56d0fe(0x135)](a41_0x12d2ce[_0x56d0fe(0x119)]('✔\x20'+_0xf4ca0f)),'logSuccess':_0x30f607=>console[_0x56d0fe(0x135)](a41_0x12d2ce[_0x56d0fe(0x183)]('✔\x20'+_0x30f607)),'logWarning':_0x531552=>console[_0x56d0fe(0x135)](a41_0x12d2ce[_0x56d0fe(0x154)]('⚠\x20'+_0x531552)),'logDeleted':_0x2a0a09=>console['error'](a41_0x12d2ce[_0x56d0fe(0x13a)]('✔\x20'+_0x2a0a09))},_0x1701b5={'segment':_0x177ecc[_0x56d0fe(0x17c)],'journey':_0x177ecc[_0x56d0fe(0x187)],'user':_0x177ecc[_0x56d0fe(0x11d)],'connection':_0x177ecc['connection']};_0x4a1ab1[_0x56d0fe(0x142)]>0x0&&(_0x508e8d=await executePushFolders(_0x1701b5,_0x4a1ab1,_0x508e8d,{'parentId':_0x5ee5e1},_0x241650));const _0x11c9ec={'rootFolderId':_0x56d2c0,'folderPathToId':_0x508e8d,'folderIdToPath':_0x23c13c,'segmentNameToId':_0xa52bb,'activationsBySegmentId':_0xf2b428,'emailToIdMap':_0x13a086,'idToEmailMap':_0x341e9a,'connectionNameToIdMap':_0x55d9a4[_0x56d0fe(0x178)],'connectionIdToNameMap':_0x55d9a4[_0x56d0fe(0x150)],'connectionNameToTypeMap':_0xf35023},_0x192eb2=await executePushSegments(_0x1701b5,_0x159064[_0x56d0fe(0x121)]?[]:_0x4e31e6,_0x11c9ec,{'parentId':_0x5ee5e1},_0x241650),_0x4622f5=_0x192eb2['created'],_0x1af003=_0x192eb2[_0x56d0fe(0x117)],_0x138c92=_0x192eb2['activations'][_0x56d0fe(0x170)],_0x384f53=_0x192eb2[_0x56d0fe(0x13b)][_0x56d0fe(0x117)],_0x3749a3=_0x192eb2[_0x56d0fe(0x13b)][_0x56d0fe(0x161)];let _0x18fc2c;if(_0x2beceb&&_0x4e31e6[_0x56d0fe(0x142)]===0x1){const _0xd0450e=_0x4e31e6[0x0];_0x18fc2c=_0xd0450e[_0x56d0fe(0x110)]?.['id']??_0x192eb2[_0x56d0fe(0xf9)][_0x56d0fe(0x10e)](_0xd0450e[_0x56d0fe(0x17a)]['name']);}const _0x15917a=await executePushSegmentDeletions(_0x1701b5,_0x159064[_0x56d0fe(0x121)]?[]:_0x3c6306,_0x241650);let _0x412eec=0x0,_0x403e57=0x0,_0x27f310=0x0;const _0x3c282e=new Map(_0xa52bb);for(const [_0x2fc040,_0x200e97]of _0x192eb2['createdSegmentIds']){_0x3c282e[_0x56d0fe(0xf6)](_0x2fc040,_0x200e97);}if(_0x41915a[_0x56d0fe(0x142)]>0x0){const _0x24ea0c={..._0x11c9ec,'segmentNameToId':_0x3c282e,'existingSegments':_0x294ee4,'activationContext':_0xfc926f},_0x4b6b6e=await executePushJourneys(_0x1701b5,_0x41915a,_0x24ea0c,{'parentId':_0x5ee5e1,'rootFolderId':_0x56d2c0,'verbose':_0x159064[_0x56d0fe(0x11a)]},_0x241650);_0x412eec=_0x4b6b6e[_0x56d0fe(0x170)],_0x403e57=_0x4b6b6e[_0x56d0fe(0x117)];if(_0x2beceb&&_0x4b6b6e[_0x56d0fe(0x143)]['length']===0x1){const _0x17ae80=_0x4b6b6e[_0x56d0fe(0x143)][0x0];if(_0x17ae80[_0x56d0fe(0x129)]){const _0xd67215=getConsoleNextUrl(_0x159064[_0x56d0fe(0x123)],_0x56d0fe(0x17e)+_0x5ee5e1+_0x56d0fe(0x12c)+_0x17ae80[_0x56d0fe(0x129)]+_0x56d0fe(0xf5));console['error']('\x20\x20'+a41_0x12d2ce[_0x56d0fe(0x156)](_0xd67215));}}}for(const _0x14f98f of _0xeee87b){console['error'](a41_0x12d2ce[_0x56d0fe(0x154)](_0x56d0fe(0xf1)+_0x14f98f['journeyBundleName'])),_0x27f310++;}const _0x330b75=[];if(_0x4622f5>0x0)_0x330b75[_0x56d0fe(0xf8)](_0x4622f5+_0x56d0fe(0x106));if(_0x1af003>0x0)_0x330b75[_0x56d0fe(0xf8)](_0x1af003+_0x56d0fe(0x11c));if(_0x15917a>0x0)_0x330b75['push'](_0x15917a+_0x56d0fe(0xf7));const _0x5827ca=[];if(_0x412eec>0x0)_0x5827ca['push'](_0x412eec+_0x56d0fe(0x106));if(_0x403e57>0x0)_0x5827ca[_0x56d0fe(0xf8)](_0x403e57+_0x56d0fe(0x11c));if(_0x27f310>0x0)_0x5827ca[_0x56d0fe(0xf8)](_0x27f310+_0x56d0fe(0xf7));const _0x107af1=[];if(_0x138c92>0x0)_0x107af1[_0x56d0fe(0xf8)](_0x138c92+'\x20created');if(_0x384f53>0x0)_0x107af1['push'](_0x384f53+_0x56d0fe(0x11c));if(_0x3749a3>0x0)_0x107af1[_0x56d0fe(0xf8)](_0x3749a3+_0x56d0fe(0xf7));console[_0x56d0fe(0x135)](a41_0x12d2ce['green'](_0x56d0fe(0x14d)));_0x330b75[_0x56d0fe(0x142)]>0x0&&!_0x159064[_0x56d0fe(0x121)]&&console[_0x56d0fe(0x135)]('\x20\x20Segments:\x20'+_0x330b75[_0x56d0fe(0x13d)](',\x20'));_0x5827ca[_0x56d0fe(0x142)]>0x0&&console[_0x56d0fe(0x135)](_0x56d0fe(0x145)+_0x5827ca[_0x56d0fe(0x13d)](',\x20'));_0x107af1['length']>0x0&&!_0x159064[_0x56d0fe(0x121)]&&console[_0x56d0fe(0x135)](_0x56d0fe(0x173)+_0x107af1['join'](',\x20'));if(_0x18fc2c){const _0x28bd49=getConsoleNextUrl(_0x159064['site'],'/app/ps/'+_0x5ee5e1+_0x56d0fe(0x12c)+_0x18fc2c+_0x56d0fe(0x16d));console['error'](_0x56d0fe(0x15b)+a41_0x12d2ce[_0x56d0fe(0x156)](_0x28bd49));}return 0x0;}}
1
+ const a41_0x14ca61=a41_0x5468;(function(_0x5d0c68,_0x5e788d){const _0x579c80=a41_0x5468,_0x52084b=_0x5d0c68();while(!![]){try{const _0x3aca70=parseInt(_0x579c80(0x119))/0x1+parseInt(_0x579c80(0xbc))/0x2*(-parseInt(_0x579c80(0x95))/0x3)+-parseInt(_0x579c80(0xc7))/0x4+-parseInt(_0x579c80(0xcb))/0x5*(-parseInt(_0x579c80(0xf2))/0x6)+parseInt(_0x579c80(0xe3))/0x7+parseInt(_0x579c80(0xe9))/0x8+parseInt(_0x579c80(0xf1))/0x9*(-parseInt(_0x579c80(0x82))/0xa);if(_0x3aca70===_0x5e788d)break;else _0x52084b['push'](_0x52084b['shift']());}catch(_0x457816){_0x52084b['push'](_0x52084b['shift']());}}}(a41_0x8ea5,0x8e7e4));import{BaseCommand}from'./command.js';function a41_0x5468(_0x290d2a,_0xfb1cfd){_0x290d2a=_0x290d2a-0x81;const _0x8ea5a9=a41_0x8ea5();let _0x54687c=_0x8ea5a9[_0x290d2a];return _0x54687c;}import{withSpinner,withProgressSpinner}from'../utils/spinner.js';function a41_0x8ea5(){const _0x3b774e=['380wcQFWe','\x20deleted','segment:push','existingSegment','data','results','existingJourney','filePath','buildUserMaps','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file','error','idToName','\x20to\x20delete','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','segments','map','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','Error\x20parsing\x20YAML:\x20','parentSegment','4842zIAMgr','execute','\x20\x20\x20\x20','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','Delete\x20journey:','isNew','toCreate','getJourney','push','Push\x20YAML\x20files\x20to\x20Treasure\x20AI\x20as\x20child\x20segments','updated','Parent\x20segment:\x20','user','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','\x20to\x20create','segment','created','\x20unchanged','then','/j/da/je','list','attributes','errorCode','listFolders','delete','targetDir','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','Source\x20directory:\x20','folderPath','Changes\x20to:','journeyBundleName','\x20\x20Activations:\x20','updatedAt','filter','parentFolder','Folders\x20to\x20create:','cwd','\x20new','/app/ps/','754AHHeJY','toDelete','Error:\x20Directory\x20not\x20found:\x20','journeysOnly','green','.yaml','Error:\x20','folders','Fetching\x20existing\x20activations...','red','activations','1809452UNnPWX','\x0aPush\x20summary\x20for\x20\x27','journey','Changes\x20to\x20journey:','1055vaxlmg','/sb/da/esr','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','parentName','(Journey\x20will\x20be\x20deleted)','getParent','versionNumber','cyan','listJourneysWithDetailsFromParentSegment','nameToId','description','name','Usage:\x20tdx\x20sg\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20(requires\x20context)','length','helpText','get','diff','No\x20','repeat','.yml','dryRun','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','toUpdate','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','6397797iEiQDi','changed','\x20updated','\x0aError:','folderId','new','5756536QsjwFN','journeyBundleId','segmentFolderId','yes','\x20folders\x20to\x20create','Site:\x20','state','\x20\x20Segments:\x20','375183hbfasZ','25446BUVwik','yamlConfig','unchanged','join','Fetching\x20existing\x20data...','blue','verbose','journeys','audienceId','Preparing\x20journeys...','/e/','no_parent','relationships','Resolving\x20parent\x20segment\x20\x27','site','\x20created','set','endsWith','\x20\x20📊\x20Segments:','message','paused','\x20activations]','resolveParentId','connection','all','dim','\x20changed','\x0a✔\x20Push\x20complete','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','type','journeyId','add','toString','getOutputSchemaWithCache','✔\x20All\x20journeys\x20are\x20up\x20to\x20date','isScoped','yellow','deleted','nameToType','700210WjdeWJ','Fetching\x20connections\x20for\x20name\x20resolution...','\x0aValidation\x20failed:'];a41_0x8ea5=function(){return _0x3b774e;};return a41_0x8ea5();}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 a41_0x403a54 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{[a41_0x14ca61(0xd6)]=a41_0x14ca61(0x84);[a41_0x14ca61(0xd5)]=a41_0x14ca61(0x9e);async[a41_0x14ca61(0x96)](_0x1cc975){const _0x338d19=a41_0x14ca61,{options:_0x58df5f,args:_0x2264b0,tdx:_0xcfaebb}=_0x1cc975,_0x3bf5f8=_0x58df5f,_0x2279c4=await resolveTarget({'arg':_0x2264b0[0x0],'contextParent':_0x58df5f[_0x338d19(0x94)],'cwd':process[_0x338d19(0xb9)]()});if(!isSuccessfulResolution(_0x2279c4))return _0x2279c4[_0x338d19(0xab)]===_0x338d19(0xfd)?(console[_0x338d19(0x8c)](a41_0x403a54[_0x338d19(0x116)](_0x338d19(0x8f))),console[_0x338d19(0x8c)](_0x338d19(0xd7)),console[_0x338d19(0x8c)](_0x338d19(0xe0)),console[_0x338d19(0x8c)](_0x338d19(0x8b))):(console['error'](a41_0x403a54['red'](_0x338d19(0xc2)+_0x2279c4[_0x338d19(0x105)]+'\x0a')),_0x2279c4[_0x338d19(0xd9)]&&console['error'](a41_0x403a54['cyan'](_0x2279c4[_0x338d19(0xd9)]))),0x1;if(_0x2279c4[_0x338d19(0x10f)]==='parent_name')return console[_0x338d19(0x8c)](a41_0x403a54[_0x338d19(0xc5)](_0x338d19(0xbe)+_0x2279c4[_0x338d19(0xae)]+'\x0a')),console[_0x338d19(0x8c)](a41_0x403a54[_0x338d19(0xd2)](_0x338d19(0x92))),0x1;const _0x109c65=_0x2279c4[_0x338d19(0xce)],_0x56ceae=_0x2279c4[_0x338d19(0xae)],_0x3ba8ee=_0x2279c4[_0x338d19(0x10f)]==='file'?_0x2279c4[_0x338d19(0x89)]:undefined,_0xb1476a=getScopedDetails(_0x2279c4),_0x267418=_0xb1476a?.[_0x338d19(0x115)]??![],_0x48c578=_0xb1476a?.['scopedFolderPath']??'';if(!existsSync(_0x56ceae))return console[_0x338d19(0x8c)](a41_0x403a54[_0x338d19(0xc5)](_0x338d19(0xbe)+_0x56ceae+'\x0a')),console[_0x338d19(0x8c)](a41_0x403a54[_0x338d19(0xd2)]('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;_0x3bf5f8[_0x338d19(0xf8)]&&(console[_0x338d19(0x8c)](_0x338d19(0xee)+_0x3bf5f8[_0x338d19(0x100)]),console[_0x338d19(0x8c)](_0x338d19(0xa0)+_0x109c65),console['error'](_0x338d19(0xb0)+_0x56ceae),_0x267418&&console[_0x338d19(0x8c)]('Scoped\x20to\x20folder:\x20'+_0x48c578));const _0x46503d=await withSpinner(_0x338d19(0xff)+_0x109c65+'\x27...',()=>_0xcfaebb[_0x338d19(0xa4)][_0x338d19(0x108)](_0x109c65),{'verbose':_0x3bf5f8[_0x338d19(0xf8)]}),_0x60511c=_0x46503d[_0x338d19(0x86)],{parentSegmentResult:_0x795b52,segmentsResult:_0x4d04e0,foldersResult:_0x5d7c60,journeysWithDetailsResult:_0x2f23a0,userMaps:_0x198ee1}=await withSpinner(_0x338d19(0xf6),async()=>{const _0x293695=_0x338d19,[_0x5a5a62,_0x1e7988,_0x1c008e,_0xe1b2cd,_0x5af9f8]=await Promise[_0x293695(0x10a)]([_0xcfaebb[_0x293695(0xa4)][_0x293695(0xd0)](_0x60511c),_0xcfaebb[_0x293695(0xa4)]['listSegments'](_0x60511c),_0xcfaebb['segment'][_0x293695(0xac)](_0x60511c),_0xcfaebb[_0x293695(0xc9)][_0x293695(0xd3)](_0x60511c,{'includeAllVersions':!![]}),_0xcfaebb[_0x293695(0xa1)][_0x293695(0x8a)]()]);return{'parentSegmentResult':_0x5a5a62,'segmentsResult':_0x1e7988,'foldersResult':_0x1c008e,'journeysWithDetailsResult':_0xe1b2cd,'userMaps':_0x5af9f8};},{'verbose':_0x3bf5f8[_0x338d19(0xf8)]})['then'](_0x53efdd=>_0x53efdd[_0x338d19(0x86)]),_0xf31112=_0x795b52,_0x31e8d7=extractRootFolderId(_0xf31112),_0xf88703=_0x4d04e0,_0x36ac6a=_0x5d7c60,{journeys:_0x25f488,activationStepsById:_0x5d286d}=_0x2f23a0,_0x4b2199=new Map(_0x25f488[_0x338d19(0x91)](_0x1220b9=>[_0x1220b9['id'],_0x1220b9])),_0x2e8281=_0x25f488[_0x338d19(0x91)](_0x4f8c44=>({'id':_0x4f8c44['id'],'name':_0x4f8c44[_0x338d19(0xaa)][_0x338d19(0xd6)],'journeyBundleName':_0x4f8c44['attributes']['journeyBundleName']||'','journeyBundleId':_0x4f8c44[_0x338d19(0xaa)][_0x338d19(0xea)]||'','versionNumber':_0x4f8c44[_0x338d19(0xaa)][_0x338d19(0xd1)],'description':_0x4f8c44[_0x338d19(0xaa)]['description'],'state':_0x4f8c44[_0x338d19(0xaa)][_0x338d19(0xef)],'paused':_0x4f8c44[_0x338d19(0xaa)][_0x338d19(0x106)],'audienceId':_0x4f8c44['attributes'][_0x338d19(0xfa)],'folderId':_0x4f8c44[_0x338d19(0xfe)]?.[_0x338d19(0xb7)]?.[_0x338d19(0x86)]?.['id'],'createdAt':_0x4f8c44[_0x338d19(0xaa)]['createdAt'],'updatedAt':_0x4f8c44[_0x338d19(0xaa)][_0x338d19(0xb5)]})),{emailToId:_0x24965a,idToEmail:_0x4ecd49}=_0x198ee1,_0x22f074=await withSpinner(_0x338d19(0x11a),async()=>{const _0x5bca86=_0x338d19,_0x594c27=await _0xcfaebb[_0x5bca86(0x109)][_0x5bca86(0xa9)]();return buildConnectionMaps(_0x594c27);},{'verbose':_0x3bf5f8[_0x338d19(0xf8)]})[_0x338d19(0xa7)](_0x1b0c08=>_0x1b0c08[_0x338d19(0x86)]),_0xf8a484=_0x22f074[_0x338d19(0xd4)],_0x57f034=_0x22f074[_0x338d19(0x8d)],_0x2eb6be=_0x22f074[_0x338d19(0x118)],_0x33e173={'emailToIdMap':_0x24965a,'connectionNameToIdMap':_0xf8a484,'connectionNameToTypeMap':_0x2eb6be,'getSchema':_0x547750=>_0xcfaebb['connection'][_0x338d19(0x113)](_0x547750)};let {pathToId:_0x42a99e,idToPath:_0x35e68b}=buildFolderMaps(_0x36ac6a);const _0x15cbe2=buildSegmentLookupMap(_0xf88703,_0x35e68b),_0x46da74=buildSegmentNameToIdMap(_0xf88703),_0x417abe=buildJourneyBundleLookupMap(_0x2e8281,_0x35e68b);let _0x2644c6;if(_0x3ba8ee){if(!_0x3ba8ee[_0x338d19(0x103)](_0x338d19(0xde))&&!_0x3ba8ee['endsWith'](_0x338d19(0xc1)))return console[_0x338d19(0x8c)](a41_0x403a54[_0x338d19(0xc5)]('Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20'+_0x3ba8ee+'\x0a')),0x1;_0x2644c6=[_0x3ba8ee];}else _0x2644c6=findYamlFiles(_0x56ceae);if(_0x2644c6['length']===0x0)return console['error'](a41_0x403a54['red'](_0x338d19(0xaf)+_0x56ceae+'\x0a')),console[_0x338d19(0x8c)](a41_0x403a54[_0x338d19(0xd2)](_0x338d19(0x98))),0x1;let _0x37141a,_0x3c78e7;try{const _0x2d0a73=parseAndClassifyYamlFiles(_0x2644c6,_0x56ceae,{'skipSegments':_0x3bf5f8[_0x338d19(0xbf)]});_0x37141a=_0x2d0a73[_0x338d19(0x90)],_0x3c78e7=_0x2d0a73[_0x338d19(0xf9)];const _0x583013=validateParsedFiles(_0x2d0a73,_0x56ceae);if(_0x583013['length']>0x0)return console[_0x338d19(0x8c)](a41_0x403a54[_0x338d19(0xc5)](_0x338d19(0x81))),console['error'](formatValidationErrors(_0x583013)),console[_0x338d19(0x8c)](a41_0x403a54[_0x338d19(0x116)](_0x338d19(0xa2))),0x1;}catch(_0x454885){return console[_0x338d19(0x8c)](a41_0x403a54[_0x338d19(0xc5)](_0x338d19(0x93)+(_0x454885 instanceof Error?_0x454885[_0x338d19(0x105)]:_0x454885))),0x1;}if(_0x37141a[_0x338d19(0xd8)]===0x0&&_0x3c78e7[_0x338d19(0xd8)]===0x0){const _0x1418e9=_0x3bf5f8['journeysOnly']?_0x338d19(0xc9):'segment\x20or\x20journey';return console[_0x338d19(0x8c)](a41_0x403a54[_0x338d19(0x116)](_0x338d19(0xdc)+_0x1418e9+'\x20YAML\x20files\x20found')),0x0;}const _0x37e5fd=new Map();_0xf88703['length']>0x0&&!_0x3bf5f8[_0x338d19(0xbf)]&&await withSpinner(_0x338d19(0xc4),async()=>{await batchAsync(_0xf88703,async _0x5a8605=>{const _0x57168e=a41_0x5468,_0x8357f0=await _0xcfaebb[_0x57168e(0xa4)]['listActivations'](_0x60511c,_0x5a8605['id']);_0x37e5fd[_0x57168e(0x102)](_0x5a8605['id'],_0x8357f0);});},{'verbose':_0x3bf5f8['verbose']});const {segmentFiles:_0x57fd90,foldersToCreate:_0x44f61e}=await prepareSegmentFiles(_0x37141a,{'segmentByFolderAndName':_0x15cbe2,'activationsBySegmentId':_0x37e5fd,'folderPathToId':_0x42a99e,'idToEmailMap':_0x4ecd49,'connectionIdToNameMap':_0x57f034},_0x33e173,_0x267418,_0x48c578),_0x463058=_0x3ba8ee?[]:findSegmentsToDelete(_0xf88703,_0x37141a[_0x338d19(0x91)](({yamlConfig:_0x136dfd,folderPath:_0xd78b02})=>({'yamlConfig':_0x136dfd,'folderPath':resolveTDFolderPath(_0xd78b02,_0x267418,_0x48c578)})),_0x35e68b,_0x48c578,_0x267418),{journeyFiles:_0x47e664,foldersToCreate:_0x40da00}=await withProgressSpinner(_0x338d19(0xfb),async _0x6abad3=>prepareJourneyFiles(_0x3c78e7,{'fetchJourney':async _0x55454e=>_0xcfaebb['journey'][_0x338d19(0x9c)](_0x55454e[_0x338d19(0x110)]),'journeyBundlesByFolderAndName':_0x417abe,'folderPathToId':_0x42a99e,'idToEmailMap':_0x4ecd49,'connectionIdToNameMap':_0x57f034,'existingSegments':_0xf88703,'parentId':_0x60511c,'deps':_0xcfaebb,'progress':{'update':_0x1576d9=>{const _0xf6ce9d=_0x338d19;_0x6abad3['setPhase'](_0x1576d9),_0x3bf5f8['verbose']&&console[_0xf6ce9d(0x8c)]('\x20\x20'+_0x1576d9);}},'journeyById':_0x4b2199,'activationStepsById':_0x5d286d},_0x267418,_0x48c578),{'verbose':_0x3bf5f8[_0x338d19(0xf8)]})[_0x338d19(0xa7)](_0xa3b858=>_0xa3b858['data']);for(const _0x517f54 of _0x40da00){_0x44f61e[_0x338d19(0x111)](_0x517f54);}const _0x54e2a1=_0x3ba8ee?[]:findJourneysToDelete(_0x2e8281,_0x3c78e7[_0x338d19(0x91)](({yamlConfig:_0x16f5fd,folderPath:_0x388728})=>({'yamlConfig':_0x16f5fd,'folderPath':resolveTDFolderPath(_0x388728,_0x267418,_0x48c578)})),_0x35e68b,_0x48c578,_0x267418),_0x838f31=calculatePushStats(_0x57fd90,_0x47e664,_0x44f61e,_0x463058,_0x54e2a1,!!_0x3bf5f8[_0x338d19(0xad)],!!_0x3bf5f8[_0x338d19(0xbf)]),_0xa97ce8=_0x838f31[_0x338d19(0x90)]['new'],_0x71f2c3=_0x838f31['segments']['changed'],_0xaf855a=_0x838f31[_0x338d19(0x90)]['unchanged'],_0xa37a59=_0x838f31[_0x338d19(0x90)]['toDelete'],_0x323d9e=_0x838f31[_0x338d19(0xc3)]['toCreate'],_0x2deb78=_0x838f31[_0x338d19(0xf9)][_0x338d19(0xe8)],_0x24801d=_0x838f31[_0x338d19(0xf9)][_0x338d19(0xe4)],_0x4c1a3a=_0x838f31['journeys'][_0x338d19(0xf4)],_0x10fac7=_0x838f31[_0x338d19(0xf9)][_0x338d19(0xbd)],_0x372b24=_0x838f31[_0x338d19(0xc6)][_0x338d19(0x10a)],_0x4388f6=_0x838f31[_0x338d19(0xc6)][_0x338d19(0x9b)],_0x419292=_0x838f31['activations'][_0x338d19(0xe1)],_0x435056=_0x838f31[_0x338d19(0xc6)]['toDelete'];console[_0x338d19(0x8c)](_0x338d19(0xc8)+_0x109c65+'\x27:');_0x323d9e[_0x338d19(0xd8)]>0x0&&console[_0x338d19(0x8c)]('\x20\x20'+a41_0x403a54[_0x338d19(0xf7)]('📁\x20'+_0x323d9e[_0x338d19(0xd8)]+_0x338d19(0xed)));if(!_0x3bf5f8[_0x338d19(0xbf)]){console['error'](_0x338d19(0x104)),console[_0x338d19(0x8c)](_0x338d19(0x97)+a41_0x403a54[_0x338d19(0xc0)]('+\x20'+_0xa97ce8[_0x338d19(0xd8)]+_0x338d19(0xba))),console[_0x338d19(0x8c)](_0x338d19(0x97)+a41_0x403a54[_0x338d19(0x116)]('~\x20'+_0x71f2c3[_0x338d19(0xd8)]+_0x338d19(0x10c)));if(_0xa37a59[_0x338d19(0xd8)]>0x0)console[_0x338d19(0x8c)](_0x338d19(0x97)+a41_0x403a54[_0x338d19(0xc5)]('-\x20'+_0xa37a59[_0x338d19(0xd8)]+_0x338d19(0x8e)));else _0x463058[_0x338d19(0xd8)]>0x0&&!_0x3bf5f8[_0x338d19(0xad)]&&console['error'](_0x338d19(0x97)+a41_0x403a54['dim'](_0x463058[_0x338d19(0xd8)]+_0x338d19(0x10e)));console[_0x338d19(0x8c)]('\x20\x20\x20\x20'+a41_0x403a54[_0x338d19(0x10b)]('=\x20'+_0xaf855a[_0x338d19(0xd8)]+_0x338d19(0xa6)));}if(_0x47e664[_0x338d19(0xd8)]>0x0||_0x54e2a1[_0x338d19(0xd8)]>0x0){console[_0x338d19(0x8c)]('\x20\x20🗺️\x20\x20Journeys:'),console['error'](_0x338d19(0x97)+a41_0x403a54[_0x338d19(0xc0)]('+\x20'+_0x2deb78['length']+'\x20new')),console[_0x338d19(0x8c)](_0x338d19(0x97)+a41_0x403a54[_0x338d19(0x116)]('~\x20'+_0x24801d[_0x338d19(0xd8)]+_0x338d19(0x10c)));if(_0x10fac7[_0x338d19(0xd8)]>0x0)console[_0x338d19(0x8c)](_0x338d19(0x97)+a41_0x403a54[_0x338d19(0xc5)]('-\x20'+_0x10fac7[_0x338d19(0xd8)]+_0x338d19(0x8e)));else _0x54e2a1[_0x338d19(0xd8)]>0x0&&!_0x3bf5f8['delete']&&console[_0x338d19(0x8c)]('\x20\x20\x20\x20'+a41_0x403a54[_0x338d19(0x10b)](_0x54e2a1[_0x338d19(0xd8)]+_0x338d19(0x10e)));console[_0x338d19(0x8c)](_0x338d19(0x97)+a41_0x403a54['dim']('=\x20'+_0x4c1a3a['length']+'\x20unchanged'));}_0x372b24[_0x338d19(0xd8)]>0x0&&!_0x3bf5f8[_0x338d19(0xbf)]&&(console[_0x338d19(0x8c)](''),console['error']('\x20\x20Activations:'),_0x4388f6['length']>0x0&&console[_0x338d19(0x8c)](_0x338d19(0x97)+a41_0x403a54[_0x338d19(0xc0)]('+\x20'+_0x4388f6[_0x338d19(0xd8)]+_0x338d19(0xa3))),_0x419292['length']>0x0&&console[_0x338d19(0x8c)](_0x338d19(0x97)+a41_0x403a54[_0x338d19(0x116)]('~\x20'+_0x419292[_0x338d19(0xd8)]+'\x20to\x20update')),_0x435056[_0x338d19(0xd8)]>0x0&&console[_0x338d19(0x8c)](_0x338d19(0x97)+a41_0x403a54[_0x338d19(0xc5)]('-\x20'+_0x435056['length']+_0x338d19(0x8e))));console[_0x338d19(0x8c)]('\x20\x20Source:\x20'+a41_0x403a54['cyan'](_0x56ceae)+'\x0a');if(_0x323d9e[_0x338d19(0xd8)]>0x0){console['error'](_0x338d19(0xb8));for(const _0x1acd13 of _0x323d9e){console['error']('\x20\x20'+a41_0x403a54['blue']('+')+'\x20'+_0x1acd13);}console[_0x338d19(0x8c)]('');}if(_0xa97ce8['length']>0x0&&!_0x3bf5f8[_0x338d19(0xbf)])for(const _0x5d734b of _0xa97ce8){const _0x14c36b=_0x5d734b[_0x338d19(0xb1)]?_0x5d734b[_0x338d19(0xb1)]+'/'+_0x5d734b[_0x338d19(0xf3)][_0x338d19(0xd6)]:_0x5d734b[_0x338d19(0xf3)][_0x338d19(0xd6)],_0x2bf307=_0x5d734b['yamlConfig']['activations']?.[_0x338d19(0xd8)]||0x0,_0x5177cf=_0x2bf307>0x0?a41_0x403a54[_0x338d19(0x10b)]('\x20['+_0x2bf307+_0x338d19(0x107)):'';console[_0x338d19(0x8c)]('\x0a'+a41_0x403a54[_0x338d19(0xc0)]('New\x20segment:')+'\x20'+_0x14c36b+_0x5177cf),console['error']('─'[_0x338d19(0xdd)](0x3c)),_0x5d734b[_0x338d19(0xdb)]&&console['error'](_0x5d734b['diff']),console[_0x338d19(0x8c)]('─'[_0x338d19(0xdd)](0x3c));}if(_0xa37a59[_0x338d19(0xd8)]>0x0&&!_0x3bf5f8[_0x338d19(0xbf)])for(const _0x33b0db of _0xa37a59){const _0x33249e=_0x33b0db['segmentFolderId']?_0x35e68b['get'](_0x33b0db[_0x338d19(0xeb)][_0x338d19(0x112)]())||'':'',_0x16f38c=_0x33249e?_0x33249e+'/'+_0x33b0db[_0x338d19(0xd6)]:_0x33b0db[_0x338d19(0xd6)],_0x4c0651=_0x37e5fd[_0x338d19(0xda)](_0x33b0db['id'])||[],_0xaa7fcf=_0x4c0651['length']>0x0?a41_0x403a54[_0x338d19(0x10b)]('\x20['+_0x4c0651[_0x338d19(0xd8)]+_0x338d19(0x107)):'';console[_0x338d19(0x8c)]('\x0a'+a41_0x403a54[_0x338d19(0xc5)]('Delete\x20segment:')+'\x20'+_0x16f38c+_0xaa7fcf),console[_0x338d19(0x8c)]('─'[_0x338d19(0xdd)](0x3c));const _0x27b568=segmentWithActivationsToYaml(_0x33b0db,_0x4c0651,undefined,_0x4ecd49,_0x57f034),_0x2f7b69=segmentToYamlString(_0x27b568),_0x3801bc=generateDiff(_0x2f7b69,'');console[_0x338d19(0x8c)](formatDiffWithColors(_0x3801bc)),console[_0x338d19(0x8c)]('─'[_0x338d19(0xdd)](0x3c));}const _0x18d3f5=_0x57fd90[_0x338d19(0xb6)](_0x272a65=>!_0x272a65[_0x338d19(0x9a)]&&_0x272a65[_0x338d19(0xdb)]);if(_0x18d3f5[_0x338d19(0xd8)]>0x0&&!_0x3bf5f8[_0x338d19(0xbf)])for(const _0x5ca497 of _0x18d3f5){const _0x59a82e=_0x5ca497[_0x338d19(0xb1)]?_0x5ca497[_0x338d19(0xb1)]+'/'+_0x5ca497[_0x338d19(0xf3)][_0x338d19(0xd6)]:_0x5ca497[_0x338d19(0xf3)][_0x338d19(0xd6)];console[_0x338d19(0x8c)]('\x0a'+a41_0x403a54[_0x338d19(0x116)](_0x338d19(0xb2))+'\x20'+_0x59a82e),console[_0x338d19(0x8c)]('─'[_0x338d19(0xdd)](0x3c)),console[_0x338d19(0x8c)](_0x5ca497[_0x338d19(0xdb)]),console['error']('─'[_0x338d19(0xdd)](0x3c));}if(_0x2deb78['length']>0x0)for(const _0x4d0c00 of _0x2deb78){const _0x53fb32=_0x4d0c00[_0x338d19(0xb1)]?_0x4d0c00[_0x338d19(0xb1)]+'/'+_0x4d0c00[_0x338d19(0xf3)][_0x338d19(0xd6)]:_0x4d0c00[_0x338d19(0xf3)][_0x338d19(0xd6)];console['error']('\x0a'+a41_0x403a54[_0x338d19(0xc0)]('New\x20journey:')+'\x20'+_0x53fb32),console[_0x338d19(0x8c)]('─'['repeat'](0x3c)),_0x4d0c00[_0x338d19(0xdb)]&&console['error'](_0x4d0c00['diff']),console[_0x338d19(0x8c)]('─'[_0x338d19(0xdd)](0x3c));}const _0x2b8725=_0x47e664[_0x338d19(0xb6)](_0x16ac38=>!_0x16ac38['isNew']&&_0x16ac38[_0x338d19(0xdb)]);if(_0x2b8725['length']>0x0)for(const _0x3730b3 of _0x2b8725){const _0x1c33ee=_0x3730b3[_0x338d19(0xb1)]?_0x3730b3[_0x338d19(0xb1)]+'/'+_0x3730b3[_0x338d19(0xf3)][_0x338d19(0xd6)]:_0x3730b3[_0x338d19(0xf3)]['name'];console['error']('\x0a'+a41_0x403a54[_0x338d19(0x116)](_0x338d19(0xca))+'\x20'+_0x1c33ee),console[_0x338d19(0x8c)]('─'[_0x338d19(0xdd)](0x3c)),console[_0x338d19(0x8c)](_0x3730b3[_0x338d19(0xdb)]),console[_0x338d19(0x8c)]('─'['repeat'](0x3c));}if(_0x10fac7[_0x338d19(0xd8)]>0x0)for(const _0x56a160 of _0x10fac7){const _0x4e315b=_0x56a160[_0x338d19(0xe7)]?_0x35e68b['get'](_0x56a160[_0x338d19(0xe7)])||'':'',_0x46abce=_0x4e315b?_0x4e315b+'/'+_0x56a160[_0x338d19(0xb3)]:_0x56a160[_0x338d19(0xb3)];console[_0x338d19(0x8c)]('\x0a'+a41_0x403a54[_0x338d19(0xc5)](_0x338d19(0x99))+'\x20'+_0x46abce),console[_0x338d19(0x8c)]('─'[_0x338d19(0xdd)](0x3c)),console['error'](a41_0x403a54[_0x338d19(0xc5)](_0x338d19(0xcf))),console[_0x338d19(0x8c)]('─'['repeat'](0x3c));}if(_0x3bf5f8[_0x338d19(0xdf)])return console['error'](a41_0x403a54['yellow'](_0x338d19(0xe2))),0x0;const _0x2adb42=_0x3bf5f8[_0x338d19(0xbf)]?![]:_0xa97ce8[_0x338d19(0xd8)]>0x0||_0x71f2c3[_0x338d19(0xd8)]>0x0||_0xa37a59[_0x338d19(0xd8)]>0x0,_0x256116=_0x2deb78[_0x338d19(0xd8)]>0x0||_0x24801d[_0x338d19(0xd8)]>0x0||_0x10fac7[_0x338d19(0xd8)]>0x0,_0x9a865b=_0x3bf5f8[_0x338d19(0xbf)]?![]:_0x372b24['length']>0x0,_0x29a387=_0x323d9e[_0x338d19(0xd8)]>0x0;if(!_0x2adb42&&!_0x256116&&!_0x9a865b&&!_0x29a387){const _0x1953e2=_0x3bf5f8[_0x338d19(0xbf)]?_0x338d19(0x114):'✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date';console[_0x338d19(0x8c)](a41_0x403a54[_0x338d19(0xc0)](_0x1953e2));if(_0x3ba8ee&&_0xaf855a['length']===0x1){const _0x204638=_0xaf855a[0x0];if(_0x204638[_0x338d19(0x85)]?.['id']){const _0x2818de=getConsoleNextUrl(_0x3bf5f8[_0x338d19(0x100)],_0x338d19(0xbb)+_0x60511c+_0x338d19(0xfc)+_0x204638[_0x338d19(0x85)]['id']+_0x338d19(0xcc));console[_0x338d19(0x8c)]('\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20'+a41_0x403a54[_0x338d19(0xd2)](_0x2818de));}}if(_0x3ba8ee&&_0x4c1a3a[_0x338d19(0xd8)]===0x1){const _0x29584b=_0x4c1a3a[0x0];if(_0x29584b[_0x338d19(0x88)]?.['id']){const _0x1475d8=getConsoleNextUrl(_0x3bf5f8[_0x338d19(0x100)],_0x338d19(0xbb)+_0x60511c+'/e/'+_0x29584b[_0x338d19(0x88)]['id']+_0x338d19(0xa8));console[_0x338d19(0x8c)]('\x20\x20'+a41_0x403a54[_0x338d19(0xd2)](_0x1475d8));}}return 0x0;}const _0x421232=_0x3bf5f8[_0x338d19(0xbf)]?_0x2deb78[_0x338d19(0xd8)]+_0x24801d[_0x338d19(0xd8)]+_0x10fac7['length']+_0x323d9e[_0x338d19(0xd8)]:_0xa97ce8[_0x338d19(0xd8)]+_0x71f2c3[_0x338d19(0xd8)]+_0xa37a59[_0x338d19(0xd8)]+_0x2deb78[_0x338d19(0xd8)]+_0x24801d['length']+_0x10fac7['length']+_0x323d9e[_0x338d19(0xd8)]+_0x372b24['length'];if(!_0x3bf5f8[_0x338d19(0xec)]&&_0x421232>0x0){if(!isInteractive())return console[_0x338d19(0x8c)](a41_0x403a54['red'](_0x338d19(0xe6)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x338d19(0x8c)](a41_0x403a54[_0x338d19(0x10b)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x16db10=await confirmKey('Push\x20'+_0x421232+'\x20changes?');if(!_0x16db10)return console['error'](a41_0x403a54[_0x338d19(0x116)]('Aborted.')),0x1;}const _0x33956b={'withProgress':async(_0x1b593a,_0x4bba5a)=>{const _0x53fe0e=_0x338d19,_0x2c631d=await withSpinner(_0x1b593a,_0x4bba5a,{'verbose':_0x3bf5f8[_0x53fe0e(0xf8)]});return{'data':_0x2c631d['data']};},'logInfo':_0xf92c74=>console[_0x338d19(0x8c)](a41_0x403a54['blue']('✔\x20'+_0xf92c74)),'logSuccess':_0x1b005d=>console['error'](a41_0x403a54[_0x338d19(0xc0)]('✔\x20'+_0x1b005d)),'logWarning':_0x3d2ec2=>console[_0x338d19(0x8c)](a41_0x403a54[_0x338d19(0x116)]('⚠\x20'+_0x3d2ec2)),'logDeleted':_0x320bba=>console[_0x338d19(0x8c)](a41_0x403a54['red']('✔\x20'+_0x320bba))},_0x40473a={'segment':_0xcfaebb['segment'],'journey':_0xcfaebb[_0x338d19(0xc9)],'user':_0xcfaebb[_0x338d19(0xa1)],'connection':_0xcfaebb[_0x338d19(0x109)]};_0x323d9e[_0x338d19(0xd8)]>0x0&&(_0x42a99e=await executePushFolders(_0x40473a,_0x323d9e,_0x42a99e,{'parentId':_0x60511c},_0x33956b));const _0x11088b={'rootFolderId':_0x31e8d7,'folderPathToId':_0x42a99e,'folderIdToPath':_0x35e68b,'segmentNameToId':_0x46da74,'activationsBySegmentId':_0x37e5fd,'emailToIdMap':_0x24965a,'idToEmailMap':_0x4ecd49,'connectionNameToIdMap':_0x22f074['nameToId'],'connectionIdToNameMap':_0x22f074[_0x338d19(0x8d)],'connectionNameToTypeMap':_0x2eb6be},_0x1ee785=await executePushSegments(_0x40473a,_0x3bf5f8[_0x338d19(0xbf)]?[]:_0x57fd90,_0x11088b,{'parentId':_0x60511c},_0x33956b),_0x52b4ac=_0x1ee785[_0x338d19(0xa5)],_0x148e6c=_0x1ee785['updated'],_0x3a8a19=_0x1ee785[_0x338d19(0xc6)][_0x338d19(0xa5)],_0x11328c=_0x1ee785[_0x338d19(0xc6)][_0x338d19(0x9f)],_0x1c4682=_0x1ee785[_0x338d19(0xc6)][_0x338d19(0x117)];let _0x17571e;if(_0x3ba8ee&&_0x57fd90[_0x338d19(0xd8)]===0x1){const _0x39464a=_0x57fd90[0x0];_0x17571e=_0x39464a[_0x338d19(0x85)]?.['id']??_0x1ee785['createdSegmentIds'][_0x338d19(0xda)](_0x39464a[_0x338d19(0xf3)][_0x338d19(0xd6)]);}const _0x1fd65a=await executePushSegmentDeletions(_0x40473a,_0x3bf5f8[_0x338d19(0xbf)]?[]:_0xa37a59,_0x33956b);let _0x39e6f0=0x0,_0x127afd=0x0,_0x26e77a=0x0;const _0x215422=new Map(_0x46da74);for(const [_0xdc14c4,_0x3133f6]of _0x1ee785['createdSegmentIds']){_0x215422[_0x338d19(0x102)](_0xdc14c4,_0x3133f6);}if(_0x47e664[_0x338d19(0xd8)]>0x0){const _0x5e2c9e={..._0x11088b,'segmentNameToId':_0x215422,'existingSegments':_0xf88703,'activationContext':_0x33e173},_0x5fcb26=await executePushJourneys(_0x40473a,_0x47e664,_0x5e2c9e,{'parentId':_0x60511c,'rootFolderId':_0x31e8d7,'verbose':_0x3bf5f8['verbose']},_0x33956b);_0x39e6f0=_0x5fcb26[_0x338d19(0xa5)],_0x127afd=_0x5fcb26[_0x338d19(0x9f)];if(_0x3ba8ee&&_0x5fcb26[_0x338d19(0x87)][_0x338d19(0xd8)]===0x1){const _0x3ac777=_0x5fcb26[_0x338d19(0x87)][0x0];if(_0x3ac777[_0x338d19(0x110)]){const _0x441f15=getConsoleNextUrl(_0x3bf5f8['site'],_0x338d19(0xbb)+_0x60511c+_0x338d19(0xfc)+_0x3ac777[_0x338d19(0x110)]+'/j/da/je');console[_0x338d19(0x8c)]('\x20\x20'+a41_0x403a54[_0x338d19(0xd2)](_0x441f15));}}}for(const _0x354fb3 of _0x10fac7){console['error'](a41_0x403a54[_0x338d19(0x116)](_0x338d19(0xcd)+_0x354fb3[_0x338d19(0xb3)])),_0x26e77a++;}const _0x31f1d6=[];if(_0x52b4ac>0x0)_0x31f1d6[_0x338d19(0x9d)](_0x52b4ac+_0x338d19(0x101));if(_0x148e6c>0x0)_0x31f1d6[_0x338d19(0x9d)](_0x148e6c+_0x338d19(0xe5));if(_0x1fd65a>0x0)_0x31f1d6[_0x338d19(0x9d)](_0x1fd65a+_0x338d19(0x83));const _0x5ac671=[];if(_0x39e6f0>0x0)_0x5ac671[_0x338d19(0x9d)](_0x39e6f0+'\x20created');if(_0x127afd>0x0)_0x5ac671['push'](_0x127afd+'\x20updated');if(_0x26e77a>0x0)_0x5ac671[_0x338d19(0x9d)](_0x26e77a+_0x338d19(0x83));const _0x1e2d49=[];if(_0x3a8a19>0x0)_0x1e2d49['push'](_0x3a8a19+'\x20created');if(_0x11328c>0x0)_0x1e2d49[_0x338d19(0x9d)](_0x11328c+_0x338d19(0xe5));if(_0x1c4682>0x0)_0x1e2d49[_0x338d19(0x9d)](_0x1c4682+_0x338d19(0x83));console[_0x338d19(0x8c)](a41_0x403a54[_0x338d19(0xc0)](_0x338d19(0x10d)));_0x31f1d6[_0x338d19(0xd8)]>0x0&&!_0x3bf5f8[_0x338d19(0xbf)]&&console[_0x338d19(0x8c)](_0x338d19(0xf0)+_0x31f1d6[_0x338d19(0xf5)](',\x20'));_0x5ac671[_0x338d19(0xd8)]>0x0&&console[_0x338d19(0x8c)]('\x20\x20Journeys:\x20'+_0x5ac671[_0x338d19(0xf5)](',\x20'));_0x1e2d49[_0x338d19(0xd8)]>0x0&&!_0x3bf5f8[_0x338d19(0xbf)]&&console[_0x338d19(0x8c)](_0x338d19(0xb4)+_0x1e2d49['join'](',\x20'));if(_0x17571e){const _0x11a42=getConsoleNextUrl(_0x3bf5f8['site'],_0x338d19(0xbb)+_0x60511c+_0x338d19(0xfc)+_0x17571e+_0x338d19(0xcc));console[_0x338d19(0x8c)]('\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20'+a41_0x403a54[_0x338d19(0xd2)](_0x11a42));}return 0x0;}}
@@ -1 +1 @@
1
- const a42_0x465f8c=a42_0x4041;function a42_0x36f3(){const _0x358e0c=['execute','segment:update','segmentPath','\x27...','Error:\x20Cannot\x20update\x20','✔\x20Updated\x20segment\x20\x27','INTERNAL','18FmBvJq','Examples:','resolvePathToResource','Updating\x20segment\x20\x27','Parent\x20ID:\x20','includes','Resolved\x20relative\x20path\x20to:\x20','1269yoXmRX','2302584cqVUzP','Segment\x20ID:\x20','length','Resolved\x20folder\x20ID:\x20','segment','segmentId','data','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','kind','type','⚠\x20Deprecation\x20warning:\x20`segment\x20update`\x20is\x20deprecated.','verbose','4104276QVPXjX','resolveFolderId','Resolving\x20folder\x20\x27','479945HVGTah','58690PGMCGU','Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]','\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','updateSegmentById','Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]','2ZQifbZ','description','8548749wvXVhP','115209KIecpf','name','Update\x20existing\x20child\x20segment','parentId','2953616YyfGiL','folder','\x20\x20\x20Path:\x20','14WOERXp','error','ruleFile','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a'];a42_0x36f3=function(){return _0x358e0c;};return a42_0x36f3();}(function(_0x547cce,_0x26ac96){const _0x533319=a42_0x4041,_0x3985b4=_0x547cce();while(!![]){try{const _0x519caf=-parseInt(_0x533319(0x10b))/0x1+parseInt(_0x533319(0x108))/0x2*(parseInt(_0x533319(0x125))/0x3)+-parseInt(_0x533319(0xff))/0x4+-parseInt(_0x533319(0x102))/0x5*(-parseInt(_0x533319(0x11d))/0x6)+parseInt(_0x533319(0x112))/0x7*(parseInt(_0x533319(0x10f))/0x8)+parseInt(_0x533319(0x124))/0x9*(-parseInt(_0x533319(0x103))/0xa)+parseInt(_0x533319(0x10a))/0xb;if(_0x519caf===_0x26ac96)break;else _0x3985b4['push'](_0x3985b4['shift']());}catch(_0x301cbc){_0x3985b4['push'](_0x3985b4['shift']());}}}(a42_0x36f3,0x9308b));function a42_0x4041(_0xa4ca1d,_0x3a44e7){_0xa4ca1d=_0xa4ca1d-0xf4;const _0x36f3b2=a42_0x36f3();let _0x40412b=_0x36f3b2[_0xa4ca1d];return _0x40412b;}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{SDKError,ErrorCode}from'../sdk/index.js';import a42_0x19c036 from'chalk';export class SegmentUpdateCommand extends BaseCommand{['name']=a42_0x465f8c(0x117);[a42_0x465f8c(0x109)]=a42_0x465f8c(0x10d);async[a42_0x465f8c(0x116)](_0x53f9a1){const _0x495aba=a42_0x465f8c;console[_0x495aba(0x113)](a42_0x19c036['yellow'](_0x495aba(0xfd))),console[_0x495aba(0x113)](a42_0x19c036['yellow'](_0x495aba(0x115)));const {options:_0x442d67,args:_0x4610de,tdx:_0xebea86}=_0x53f9a1,_0x2f0495=_0x442d67;if(_0x4610de[_0x495aba(0xf5)]===0x0)return console[_0x495aba(0x113)](_0x495aba(0xfa)),console['error'](_0x495aba(0x104)),console['error'](_0x495aba(0x11e)),console[_0x495aba(0x113)]('\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22'),console[_0x495aba(0x113)](_0x495aba(0x105)),0x1;const _0x3e6792=_0x4610de[0x0],_0x2d34a1=_0x442d67[_0x495aba(0x118)];let _0x37c39=_0x3e6792;_0x2d34a1&&!_0x3e6792[_0x495aba(0x122)]('/')&&(_0x37c39=_0x2d34a1+'/'+_0x3e6792,_0x2f0495[_0x495aba(0xfe)]&&console[_0x495aba(0x113)](_0x495aba(0x123)+_0x37c39));const _0x190f29=await withSpinner('Resolving\x20path\x20\x27'+_0x37c39+_0x495aba(0x119),()=>_0xebea86['segment'][_0x495aba(0x11f)](_0x37c39),{'verbose':_0x2f0495[_0x495aba(0xfe)]}),_0x322435=_0x190f29[_0x495aba(0xf9)];_0x2f0495[_0x495aba(0xfe)]&&console[_0x495aba(0x113)]('Resolved\x20type:\x20'+_0x322435[_0x495aba(0xfc)]);if(_0x322435[_0x495aba(0xfc)]!==_0x495aba(0xf7))return console[_0x495aba(0x113)](_0x495aba(0x11a)+_0x322435[_0x495aba(0xfc)]+'.\x20Only\x20child\x20segments\x20can\x20be\x20updated.'),console['error'](_0x495aba(0x107)),0x1;if(!_0x322435[_0x495aba(0xf8)])throw new SDKError(ErrorCode[_0x495aba(0x11c)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x5f5621=_0x322435[_0x495aba(0x10e)],_0x221e25=_0x322435[_0x495aba(0xf8)];_0x2f0495[_0x495aba(0xfe)]&&(console[_0x495aba(0x113)](_0x495aba(0x121)+_0x5f5621),console['error'](_0x495aba(0xf4)+_0x221e25));let _0xda39d2;if(_0x2f0495['folder']){const _0x3de412=_0x2f0495[_0x495aba(0x110)],_0x2dad77=await withSpinner(_0x495aba(0x101)+_0x3de412+_0x495aba(0x119),()=>_0xebea86[_0x495aba(0xf7)][_0x495aba(0x100)](_0x5f5621,_0x3de412),{'verbose':_0x2f0495[_0x495aba(0xfe)]});_0xda39d2=parseInt(_0x2dad77[_0x495aba(0xf9)],0xa),_0x2f0495['verbose']&&console[_0x495aba(0x113)](_0x495aba(0xf6)+_0xda39d2);}const _0x224173=await loadJSONFromOptions(_0x2f0495['rule'],_0x2f0495[_0x495aba(0x114)]),_0x3bcaa6={'name':_0x2f0495[_0x495aba(0x10c)],'description':_0x2f0495['description'],'rule':_0x224173,'kind':_0x2f0495[_0x495aba(0xfb)]!==undefined?parseInt(_0x2f0495[_0x495aba(0xfb)],0xa):undefined,'segmentFolderId':_0xda39d2},_0xca03c4=await withSpinner(_0x495aba(0x120)+_0x322435['segmentName']+_0x495aba(0x119),()=>_0xebea86['segment'][_0x495aba(0x106)](_0x5f5621,_0x221e25,_0x3bcaa6),{'verbose':_0x2f0495[_0x495aba(0xfe)]}),_0x494f54=_0xca03c4[_0x495aba(0xf9)];return console[_0x495aba(0x113)](_0x495aba(0x11b)+_0x494f54[_0x495aba(0x10c)]+'\x27'),_0x37c39!==_0x3e6792&&console[_0x495aba(0x113)](_0x495aba(0x111)+_0x37c39),await handleSDKOutput([_0x494f54],_0x2f0495),0x0;}}
1
+ const a42_0x438ec5=a42_0x2238;(function(_0x568438,_0x569d65){const _0x2026c3=a42_0x2238,_0x56f6fb=_0x568438();while(!![]){try{const _0x1f0d7d=-parseInt(_0x2026c3(0x1cd))/0x1+parseInt(_0x2026c3(0x1d6))/0x2+parseInt(_0x2026c3(0x1de))/0x3+parseInt(_0x2026c3(0x1dc))/0x4*(parseInt(_0x2026c3(0x1ed))/0x5)+-parseInt(_0x2026c3(0x1e2))/0x6*(parseInt(_0x2026c3(0x1d4))/0x7)+parseInt(_0x2026c3(0x1db))/0x8+parseInt(_0x2026c3(0x1ec))/0x9;if(_0x1f0d7d===_0x569d65)break;else _0x56f6fb['push'](_0x56f6fb['shift']());}catch(_0x1ea9a9){_0x56f6fb['push'](_0x56f6fb['shift']());}}}(a42_0x5359,0x37d0f));import{BaseCommand}from'./command.js';function a42_0x5359(){const _0x1d8222=['length','segment','folder','383490gRcHjl','Updating\x20segment\x20\x27','data','segmentName','ruleFile','name','parentId','\x27...','description','segment:update','1115307IuWaGG','45495hFmFXz','\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22','resolvePathToResource','Resolved\x20relative\x20path\x20to:\x20','Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]','Resolving\x20folder\x20\x27','Parent\x20ID:\x20','rule','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','updateSegmentById','Segment\x20ID:\x20','INTERNAL','\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','segmentId','segmentPath','Resolving\x20path\x20\x27','223018vvTsfq','Examples:','kind','includes','yellow','✔\x20Updated\x20segment\x20\x27','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','35IWMmlj','Update\x20existing\x20child\x20segment','562984sifaUe','type','error','verbose','.\x20Only\x20child\x20segments\x20can\x20be\x20updated.','1440480foTgTr','64ITfMCA','Resolved\x20folder\x20ID:\x20','120471GYlvPn'];a42_0x5359=function(){return _0x1d8222;};return a42_0x5359();}import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{SDKError,ErrorCode}from'../sdk/index.js';function a42_0x2238(_0x5df1b3,_0x5dee8d){_0x5df1b3=_0x5df1b3-0x1ca;const _0x53592c=a42_0x5359();let _0x22386d=_0x53592c[_0x5df1b3];return _0x22386d;}import a42_0x3359d3 from'chalk';export class SegmentUpdateCommand extends BaseCommand{[a42_0x438ec5(0x1e7)]=a42_0x438ec5(0x1eb);[a42_0x438ec5(0x1ea)]=a42_0x438ec5(0x1d5);async['execute'](_0x24d347){const _0x45dec7=a42_0x438ec5;console['error'](a42_0x3359d3[_0x45dec7(0x1d1)]('⚠\x20Deprecation\x20warning:\x20`segment\x20update`\x20is\x20deprecated.')),console['error'](a42_0x3359d3['yellow'](_0x45dec7(0x1d3)));const {options:_0x299f17,args:_0x2fa068,tdx:_0x5e8023}=_0x24d347,_0x3b01cc=_0x299f17;if(_0x2fa068[_0x45dec7(0x1df)]===0x0)return console[_0x45dec7(0x1d8)](_0x45dec7(0x1f5)),console[_0x45dec7(0x1d8)](_0x45dec7(0x1f1)),console[_0x45dec7(0x1d8)](_0x45dec7(0x1ce)),console[_0x45dec7(0x1d8)](_0x45dec7(0x1ee)),console['error'](_0x45dec7(0x1f9)),0x1;const _0x4219f5=_0x2fa068[0x0],_0x15d364=_0x299f17[_0x45dec7(0x1cb)];let _0x4e6088=_0x4219f5;_0x15d364&&!_0x4219f5[_0x45dec7(0x1d0)]('/')&&(_0x4e6088=_0x15d364+'/'+_0x4219f5,_0x3b01cc[_0x45dec7(0x1d9)]&&console[_0x45dec7(0x1d8)](_0x45dec7(0x1f0)+_0x4e6088));const _0x499bd2=await withSpinner(_0x45dec7(0x1cc)+_0x4e6088+_0x45dec7(0x1e9),()=>_0x5e8023[_0x45dec7(0x1e0)][_0x45dec7(0x1ef)](_0x4e6088),{'verbose':_0x3b01cc[_0x45dec7(0x1d9)]}),_0x1c7707=_0x499bd2[_0x45dec7(0x1e4)];_0x3b01cc[_0x45dec7(0x1d9)]&&console[_0x45dec7(0x1d8)]('Resolved\x20type:\x20'+_0x1c7707[_0x45dec7(0x1d7)]);if(_0x1c7707[_0x45dec7(0x1d7)]!==_0x45dec7(0x1e0))return console[_0x45dec7(0x1d8)]('Error:\x20Cannot\x20update\x20'+_0x1c7707[_0x45dec7(0x1d7)]+_0x45dec7(0x1da)),console[_0x45dec7(0x1d8)]('Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]'),0x1;if(!_0x1c7707[_0x45dec7(0x1ca)])throw new SDKError(ErrorCode[_0x45dec7(0x1f8)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x5ac470=_0x1c7707[_0x45dec7(0x1e8)],_0xcbe376=_0x1c7707[_0x45dec7(0x1ca)];_0x3b01cc[_0x45dec7(0x1d9)]&&(console[_0x45dec7(0x1d8)](_0x45dec7(0x1f3)+_0x5ac470),console['error'](_0x45dec7(0x1f7)+_0xcbe376));let _0x1a795e;if(_0x3b01cc['folder']){const _0x82f74e=_0x3b01cc[_0x45dec7(0x1e1)],_0x2e73fb=await withSpinner(_0x45dec7(0x1f2)+_0x82f74e+_0x45dec7(0x1e9),()=>_0x5e8023[_0x45dec7(0x1e0)]['resolveFolderId'](_0x5ac470,_0x82f74e),{'verbose':_0x3b01cc['verbose']});_0x1a795e=parseInt(_0x2e73fb[_0x45dec7(0x1e4)],0xa),_0x3b01cc[_0x45dec7(0x1d9)]&&console[_0x45dec7(0x1d8)](_0x45dec7(0x1dd)+_0x1a795e);}const _0x4d98b7=await loadJSONFromOptions(_0x3b01cc[_0x45dec7(0x1f4)],_0x3b01cc[_0x45dec7(0x1e6)]),_0x2846e0={'name':_0x3b01cc[_0x45dec7(0x1e7)],'description':_0x3b01cc[_0x45dec7(0x1ea)],'rule':_0x4d98b7,'kind':_0x3b01cc['kind']!==undefined?parseInt(_0x3b01cc[_0x45dec7(0x1cf)],0xa):undefined,'segmentFolderId':_0x1a795e},_0x42fd8a=await withSpinner(_0x45dec7(0x1e3)+_0x1c7707[_0x45dec7(0x1e5)]+'\x27...',()=>_0x5e8023[_0x45dec7(0x1e0)][_0x45dec7(0x1f6)](_0x5ac470,_0xcbe376,_0x2846e0),{'verbose':_0x3b01cc['verbose']}),_0x30fa8d=_0x42fd8a[_0x45dec7(0x1e4)];return console[_0x45dec7(0x1d8)](_0x45dec7(0x1d2)+_0x30fa8d[_0x45dec7(0x1e7)]+'\x27'),_0x4e6088!==_0x4219f5&&console[_0x45dec7(0x1d8)]('\x20\x20\x20Path:\x20'+_0x4e6088),await handleSDKOutput([_0x30fa8d],_0x3b01cc),0x0;}}
@@ -1 +1 @@
1
- const a43_0x4e3811=a43_0xd220;(function(_0x38bfc3,_0x1e3e91){const _0x40316e=a43_0xd220,_0x3e8b17=_0x38bfc3();while(!![]){try{const _0xc16f89=parseInt(_0x40316e(0x192))/0x1+parseInt(_0x40316e(0x16b))/0x2*(parseInt(_0x40316e(0x199))/0x3)+parseInt(_0x40316e(0x172))/0x4+parseInt(_0x40316e(0x17b))/0x5*(parseInt(_0x40316e(0x177))/0x6)+-parseInt(_0x40316e(0x17e))/0x7*(parseInt(_0x40316e(0x17d))/0x8)+parseInt(_0x40316e(0x196))/0x9*(-parseInt(_0x40316e(0x19d))/0xa)+-parseInt(_0x40316e(0x17a))/0xb;if(_0xc16f89===_0x1e3e91)break;else _0x3e8b17['push'](_0x3e8b17['shift']());}catch(_0x2ab6be){_0x3e8b17['push'](_0x3e8b17['shift']());}}}(a43_0x200e,0xb791d));import{existsSync,statSync}from'fs';import a43_0x2a94eb from'chalk';import{BaseCommand}from'./command.js';import{saveSessionContext}from'../core/session.js';function a43_0xd220(_0x12bc95,_0x28b2da){_0x12bc95=_0x12bc95-0x16a;const _0x200e8e=a43_0x200e();let _0xd22083=_0x200e8e[_0x12bc95];return _0xd22083;}import{withSpinner}from'../utils/spinner.js';import{parsePath,normalizePath}from'../sdk/segment/segment-path-parser.js';import{findTdxConfig}from'../sdk/segment/tdx-config.js';function a43_0x200e(){const _0x5e3d8c=['Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>','92037GnTLrQ','length','folderPath','Resolved\x20relative\x20path\x20to:\x20','50xTZaRW','Resolving\x20path\x20\x27','Resolved\x20path\x20type:\x20','92kNhAVh','red','cyan','parentName','Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.','segmentPath','isDirectory','763872YqwtOK','error','split','green','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22','12DtVhCs','site','✔\x20Context\x20cleared.\x20Back\x20to\x20root.','5049407aOdrPr','3134645CeHlDb','join','5873176BbWOCX','14FGfSio','session','Parent\x20ID:\x20','Set\x20current\x20segment/folder\x20context\x20for\x20navigation','fullPath','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','resolvePathToResource','Use\x20\x22tdx\x20use\x22\x20to\x20see\x20all\x20context\x20parameters','Examples:','segment','\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent','verbose','Error:\x20Path\x20is\x20required\x0a','\x27...','type','segments','Site:\x20','Usage:\x20tdx\x20segment\x20use\x20<path>','execute','dim','613392POmoUT','log','segment:use','Use:\x20tdx\x20segment\x20use\x20','1422396garBxI','✔\x20Context\x20set\x20to:\x20'];a43_0x200e=function(){return _0x5e3d8c;};return a43_0x200e();}export class SegmentUseCommand extends BaseCommand{['name']=a43_0x4e3811(0x194);['description']=a43_0x4e3811(0x181);async[a43_0x4e3811(0x190)](_0x4dd4b1){const _0x5f10e5=a43_0x4e3811,{options:_0xd56029,args:_0x5575cb,tdx:_0x5011a9}=_0x4dd4b1;if(_0x5575cb[_0x5f10e5(0x19a)]===0x0)return console[_0x5f10e5(0x173)](a43_0x2a94eb[_0x5f10e5(0x16c)](_0x5f10e5(0x18a))),console[_0x5f10e5(0x173)](_0x5f10e5(0x18f)),console[_0x5f10e5(0x173)](_0x5f10e5(0x186)),console[_0x5f10e5(0x173)](_0x5f10e5(0x176)),console[_0x5f10e5(0x173)]('\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22'),console[_0x5f10e5(0x173)]('\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context'),console[_0x5f10e5(0x173)](_0x5f10e5(0x188)),0x1;const _0x2420f4=_0x5575cb[0x0],_0xf097d6=_0xd56029[_0x5f10e5(0x17f)];try{if(_0x2420f4==='/')return saveSessionContext({'segment_path':undefined},_0xf097d6),console['log'](a43_0x2a94eb[_0x5f10e5(0x175)](_0x5f10e5(0x179))),0x0;if(existsSync(_0x2420f4)&&statSync(_0x2420f4)[_0x5f10e5(0x171)]()){let _0x4eeb6e;try{_0x4eeb6e=findTdxConfig(_0x2420f4);}catch{return console[_0x5f10e5(0x173)](a43_0x2a94eb['red']('Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20'+_0x2420f4)),console[_0x5f10e5(0x173)](a43_0x2a94eb['cyan'](_0x5f10e5(0x183))),0x1;}const _0x540a28=_0x4eeb6e['config']['parent_segment'];return saveSessionContext({'segment_path':_0x540a28,'parent_segment':_0x540a28},_0xf097d6),console[_0x5f10e5(0x193)](a43_0x2a94eb[_0x5f10e5(0x175)](_0x5f10e5(0x197)+a43_0x2a94eb['cyan'](_0x540a28))),0x0;}const _0x479f7e=_0xd56029[_0x5f10e5(0x170)];let _0x50b703=_0x2420f4;const _0x1917a5=parsePath(_0x2420f4);if(!_0x1917a5['isAbsolute']){if(!_0x479f7e)return console[_0x5f10e5(0x173)](a43_0x2a94eb[_0x5f10e5(0x16c)]('Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.')),console[_0x5f10e5(0x173)](a43_0x2a94eb[_0x5f10e5(0x16d)](_0x5f10e5(0x198))),0x1;if(_0x2420f4==='..'){const _0x3f8965=_0x479f7e[_0x5f10e5(0x174)]('/')['slice'](0x0,-0x1)['join']('/');_0x50b703=_0x3f8965||'/';}else _0x2420f4==='.'?_0x50b703=_0x479f7e:_0x50b703=_0x479f7e+'/'+_0x2420f4;_0xd56029[_0x5f10e5(0x189)]&&console[_0x5f10e5(0x173)](_0x5f10e5(0x19c)+_0x50b703);}if(_0x50b703==='/'||_0x50b703==='')return saveSessionContext({'segment_path':undefined},_0xf097d6),console[_0x5f10e5(0x193)](a43_0x2a94eb[_0x5f10e5(0x175)]('✔\x20Context\x20cleared.\x20Back\x20to\x20root.')),0x0;_0x50b703=normalizePath(_0x50b703);const _0x4a9e06=parsePath(_0x50b703)[_0x5f10e5(0x18d)];if(_0x4a9e06[_0x5f10e5(0x19a)]===0x0)return saveSessionContext({'segment_path':undefined},_0xf097d6),console[_0x5f10e5(0x193)](a43_0x2a94eb['green'](_0x5f10e5(0x179))),0x0;_0xd56029[_0x5f10e5(0x189)]&&(console[_0x5f10e5(0x173)](_0x5f10e5(0x18e)+_0xd56029[_0x5f10e5(0x178)]),console[_0x5f10e5(0x173)]('Target\x20path:\x20'+_0x50b703));const _0xb35431=await withSpinner(_0x5f10e5(0x19e)+_0x50b703+_0x5f10e5(0x18b),()=>_0x5011a9[_0x5f10e5(0x187)][_0x5f10e5(0x184)](_0x50b703),{'verbose':_0xd56029[_0x5f10e5(0x189)]}),_0x5a7432=_0xb35431['data'];_0xd56029[_0x5f10e5(0x189)]&&(console['error'](_0x5f10e5(0x16a)+_0x5a7432[_0x5f10e5(0x18c)]),console[_0x5f10e5(0x173)](_0x5f10e5(0x180)+_0x5a7432['parentId']),_0x5a7432['folderId']&&console[_0x5f10e5(0x173)]('Folder\x20ID:\x20'+_0x5a7432['folderId']));if(_0x5a7432['type']===_0x5f10e5(0x187))return console['error'](a43_0x2a94eb[_0x5f10e5(0x16c)]('Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.')),console['error'](_0x5f10e5(0x16f)),console[_0x5f10e5(0x173)](a43_0x2a94eb[_0x5f10e5(0x16d)](_0x5f10e5(0x195)+_0x5a7432[_0x5f10e5(0x16e)]+(_0x5a7432['folderPath']?'/'+_0x5a7432[_0x5f10e5(0x19b)][_0x5f10e5(0x17c)]('/'):''))),0x1;return saveSessionContext({'segment_path':_0x5a7432[_0x5f10e5(0x182)],'parent_segment':_0x5a7432['parentName']},_0xf097d6),console[_0x5f10e5(0x193)](a43_0x2a94eb[_0x5f10e5(0x175)](_0x5f10e5(0x197)+a43_0x2a94eb[_0x5f10e5(0x16d)](_0x5a7432[_0x5f10e5(0x182)]))),_0xd56029['verbose']&&(console[_0x5f10e5(0x173)](a43_0x2a94eb[_0x5f10e5(0x191)]('Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context')),console['error'](a43_0x2a94eb[_0x5f10e5(0x191)](_0x5f10e5(0x185)))),0x0;}catch(_0x2e1a2e){throw _0x2e1a2e;}}}
1
+ const a43_0x1e5fe8=a43_0xc216;function a43_0xc216(_0x6d523d,_0x51f4c2){_0x6d523d=_0x6d523d-0x1b5;const _0x46c7b6=a43_0x46c7();let _0xc216cc=_0x46c7b6[_0x6d523d];return _0xc216cc;}(function(_0x4b7eb1,_0x15613a){const _0x4a6147=a43_0xc216,_0x373a41=_0x4b7eb1();while(!![]){try{const _0x37cbcc=parseInt(_0x4a6147(0x1c1))/0x1*(parseInt(_0x4a6147(0x1d7))/0x2)+parseInt(_0x4a6147(0x1ce))/0x3*(-parseInt(_0x4a6147(0x1b5))/0x4)+parseInt(_0x4a6147(0x1ed))/0x5+-parseInt(_0x4a6147(0x1e8))/0x6*(-parseInt(_0x4a6147(0x1b9))/0x7)+parseInt(_0x4a6147(0x1c7))/0x8+parseInt(_0x4a6147(0x1cb))/0x9*(parseInt(_0x4a6147(0x1eb))/0xa)+-parseInt(_0x4a6147(0x1ec))/0xb*(parseInt(_0x4a6147(0x1c4))/0xc);if(_0x37cbcc===_0x15613a)break;else _0x373a41['push'](_0x373a41['shift']());}catch(_0x5b260a){_0x373a41['push'](_0x373a41['shift']());}}}(a43_0x46c7,0x9f545));import{existsSync,statSync}from'fs';import a43_0x2f55a6 from'chalk';function a43_0x46c7(){const _0x12ffec=['Use\x20\x22tdx\x20use\x22\x20to\x20see\x20all\x20context\x20parameters','Target\x20path:\x20','106776tVjWrO','\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context','slice','3479480ZUUxBV','Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.','✔\x20Context\x20set\x20to:\x20','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22','109773SfiDCI','parentName','Usage:\x20tdx\x20segment\x20use\x20<path>','31599SshwSG','type','segment','session','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22','\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent','segmentPath','dim','execute','10214KjdyRF','log','cyan','segment:use','Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','join','fullPath','isAbsolute','folderId','green','description','split','Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.','error','Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>','Site:\x20','✔\x20Context\x20cleared.\x20Back\x20to\x20root.','1333842YstPfE','segments','isDirectory','910FmCPKc','3124olxrKc','1701610DItbpO','folderPath','length','Folder\x20ID:\x20','config','Resolved\x20path\x20type:\x20','Resolved\x20relative\x20path\x20to:\x20','68DsrwiI','Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.','name','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','7pyIfob','red','parentId','resolvePathToResource','Examples:','Error:\x20Path\x20is\x20required\x0a','verbose','Resolving\x20path\x20\x27','245lcZsLq'];a43_0x46c7=function(){return _0x12ffec;};return a43_0x46c7();}import{BaseCommand}from'./command.js';import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';import{parsePath,normalizePath}from'../sdk/segment/segment-path-parser.js';import{findTdxConfig}from'../sdk/segment/tdx-config.js';export class SegmentUseCommand extends BaseCommand{[a43_0x1e5fe8(0x1b7)]=a43_0x1e5fe8(0x1da);[a43_0x1e5fe8(0x1e1)]='Set\x20current\x20segment/folder\x20context\x20for\x20navigation';async[a43_0x1e5fe8(0x1d6)](_0x189a4c){const _0x3f98f2=a43_0x1e5fe8,{options:_0x1867e9,args:_0x1cbecc,tdx:_0x33704a}=_0x189a4c;if(_0x1cbecc['length']===0x0)return console[_0x3f98f2(0x1e4)](a43_0x2f55a6[_0x3f98f2(0x1ba)](_0x3f98f2(0x1be))),console[_0x3f98f2(0x1e4)](_0x3f98f2(0x1cd)),console[_0x3f98f2(0x1e4)](_0x3f98f2(0x1bd)),console['error'](_0x3f98f2(0x1ca)),console[_0x3f98f2(0x1e4)](_0x3f98f2(0x1d2)),console['error'](_0x3f98f2(0x1c5)),console['error'](_0x3f98f2(0x1d3)),0x1;const _0x117fba=_0x1cbecc[0x0],_0x1cd632=_0x1867e9[_0x3f98f2(0x1d1)];try{if(_0x117fba==='/')return saveSessionContext({'segment_path':undefined},_0x1cd632),console[_0x3f98f2(0x1d8)](a43_0x2f55a6['green'](_0x3f98f2(0x1e7))),0x0;if(existsSync(_0x117fba)&&statSync(_0x117fba)[_0x3f98f2(0x1ea)]()){let _0x11c2a7;try{_0x11c2a7=findTdxConfig(_0x117fba);}catch{return console['error'](a43_0x2f55a6[_0x3f98f2(0x1ba)](_0x3f98f2(0x1db)+_0x117fba)),console['error'](a43_0x2f55a6[_0x3f98f2(0x1d9)](_0x3f98f2(0x1b8))),0x1;}const _0x217199=_0x11c2a7[_0x3f98f2(0x1f1)]['parent_segment'];return saveSessionContext({'segment_path':_0x217199,'parent_segment':_0x217199},_0x1cd632),console[_0x3f98f2(0x1d8)](a43_0x2f55a6['green'](_0x3f98f2(0x1c9)+a43_0x2f55a6['cyan'](_0x217199))),0x0;}const _0x1a8431=_0x1867e9[_0x3f98f2(0x1d4)];let _0x2ec79d=_0x117fba;const _0x2f706b=parsePath(_0x117fba);if(!_0x2f706b[_0x3f98f2(0x1de)]){if(!_0x1a8431)return console['error'](a43_0x2f55a6['red'](_0x3f98f2(0x1b6))),console[_0x3f98f2(0x1e4)](a43_0x2f55a6[_0x3f98f2(0x1d9)](_0x3f98f2(0x1e5))),0x1;if(_0x117fba==='..'){const _0x5b7c38=_0x1a8431[_0x3f98f2(0x1e2)]('/')[_0x3f98f2(0x1c6)](0x0,-0x1)[_0x3f98f2(0x1dc)]('/');_0x2ec79d=_0x5b7c38||'/';}else _0x117fba==='.'?_0x2ec79d=_0x1a8431:_0x2ec79d=_0x1a8431+'/'+_0x117fba;_0x1867e9['verbose']&&console['error'](_0x3f98f2(0x1f3)+_0x2ec79d);}if(_0x2ec79d==='/'||_0x2ec79d==='')return saveSessionContext({'segment_path':undefined},_0x1cd632),console[_0x3f98f2(0x1d8)](a43_0x2f55a6[_0x3f98f2(0x1e0)](_0x3f98f2(0x1e7))),0x0;_0x2ec79d=normalizePath(_0x2ec79d);const _0x242dcf=parsePath(_0x2ec79d)[_0x3f98f2(0x1e9)];if(_0x242dcf[_0x3f98f2(0x1ef)]===0x0)return saveSessionContext({'segment_path':undefined},_0x1cd632),console[_0x3f98f2(0x1d8)](a43_0x2f55a6[_0x3f98f2(0x1e0)](_0x3f98f2(0x1e7))),0x0;_0x1867e9[_0x3f98f2(0x1bf)]&&(console['error'](_0x3f98f2(0x1e6)+_0x1867e9['site']),console[_0x3f98f2(0x1e4)](_0x3f98f2(0x1c3)+_0x2ec79d));const _0x39e575=await withSpinner(_0x3f98f2(0x1c0)+_0x2ec79d+'\x27...',()=>_0x33704a[_0x3f98f2(0x1d0)][_0x3f98f2(0x1bc)](_0x2ec79d),{'verbose':_0x1867e9[_0x3f98f2(0x1bf)]}),_0x1e387e=_0x39e575['data'];_0x1867e9[_0x3f98f2(0x1bf)]&&(console[_0x3f98f2(0x1e4)](_0x3f98f2(0x1f2)+_0x1e387e[_0x3f98f2(0x1cf)]),console[_0x3f98f2(0x1e4)]('Parent\x20ID:\x20'+_0x1e387e[_0x3f98f2(0x1bb)]),_0x1e387e[_0x3f98f2(0x1df)]&&console['error'](_0x3f98f2(0x1f0)+_0x1e387e[_0x3f98f2(0x1df)]));if(_0x1e387e[_0x3f98f2(0x1cf)]==='segment')return console[_0x3f98f2(0x1e4)](a43_0x2f55a6['red'](_0x3f98f2(0x1c8))),console[_0x3f98f2(0x1e4)](_0x3f98f2(0x1e3)),console['error'](a43_0x2f55a6['cyan']('Use:\x20tdx\x20segment\x20use\x20'+_0x1e387e[_0x3f98f2(0x1cc)]+(_0x1e387e[_0x3f98f2(0x1ee)]?'/'+_0x1e387e[_0x3f98f2(0x1ee)]['join']('/'):''))),0x1;return saveSessionContext({'segment_path':_0x1e387e[_0x3f98f2(0x1dd)],'parent_segment':_0x1e387e[_0x3f98f2(0x1cc)]},_0x1cd632),console[_0x3f98f2(0x1d8)](a43_0x2f55a6[_0x3f98f2(0x1e0)](_0x3f98f2(0x1c9)+a43_0x2f55a6[_0x3f98f2(0x1d9)](_0x1e387e['fullPath']))),_0x1867e9[_0x3f98f2(0x1bf)]&&(console[_0x3f98f2(0x1e4)](a43_0x2f55a6[_0x3f98f2(0x1d5)]('Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context')),console[_0x3f98f2(0x1e4)](a43_0x2f55a6['dim'](_0x3f98f2(0x1c2)))),0x0;}catch(_0x41c86a){throw _0x41c86a;}}}
@@ -1 +1 @@
1
- const a44_0x3254c2=a44_0x2cb6;(function(_0x38f15c,_0x59014d){const _0x2e7d48=a44_0x2cb6,_0x54b2d9=_0x38f15c();while(!![]){try{const _0x43ef9f=parseInt(_0x2e7d48(0x220))/0x1*(-parseInt(_0x2e7d48(0x20d))/0x2)+parseInt(_0x2e7d48(0x1f9))/0x3+-parseInt(_0x2e7d48(0x217))/0x4+-parseInt(_0x2e7d48(0x20b))/0x5*(parseInt(_0x2e7d48(0x221))/0x6)+-parseInt(_0x2e7d48(0x211))/0x7*(-parseInt(_0x2e7d48(0x21c))/0x8)+parseInt(_0x2e7d48(0x213))/0x9*(-parseInt(_0x2e7d48(0x205))/0xa)+parseInt(_0x2e7d48(0x1f2))/0xb;if(_0x43ef9f===_0x59014d)break;else _0x54b2d9['push'](_0x54b2d9['shift']());}catch(_0x4d698d){_0x54b2d9['push'](_0x54b2d9['shift']());}}}(a44_0x176e,0x410cb));import{BaseCommand}from'./command.js';function a44_0x176e(){const _0x12f931=['\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20validate\x20.\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20current\x20directory','8088fAlBHn','):\x20','\x20warning(s)','Usage:\x20tdx\x20sg\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)','112PwUcOv','1732686UbzcGZ','cyan','Error:\x20Directory\x20not\x20found:\x20','parentSegment','\x20warning(s)\x20found','3339666vvTSlf','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','warningCount','dim','✔\x20All\x20','Validation\x20failed:\x20','description','339243XhSBia','validCount','file','.yml','.yaml','\x20valid','cwd','green','endsWith','yellow','\x20file(s)\x20valid','hasErrors','561240hmrEEr','error','execute','valid','log','warnings','5dKlgTC','length','458mOlsWA','type','helpText','errors','3129biPKAm','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','9tFOyHR','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','red','926432HHnnci','errorCode','segment:validate','filePath'];a44_0x176e=function(){return _0x12f931;};return a44_0x176e();}import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';import a44_0x2894d3 from'chalk';function a44_0x2cb6(_0x5873eb,_0x1d8e4c){_0x5873eb=_0x5873eb-0x1ef;const _0x176e59=a44_0x176e();let _0x2cb614=_0x176e59[_0x5873eb];return _0x2cb614;}import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class SegmentValidateCommand extends BaseCommand{['name']=a44_0x3254c2(0x219);[a44_0x3254c2(0x1f8)]='Validate\x20segment\x20and\x20journey\x20YAML\x20files';async[a44_0x3254c2(0x207)](_0x2a3005){const _0x4c0b8a=a44_0x3254c2,{options:_0x5aaa42,args:_0x3f4e33}=_0x2a3005,_0x5c86bf=_0x5aaa42,_0x141ec2=await resolveTarget({'arg':_0x3f4e33[0x0],'contextParent':_0x5aaa42[_0x4c0b8a(0x1f0)],'cwd':process[_0x4c0b8a(0x1ff)]()});if(!isSuccessfulResolution(_0x141ec2))return _0x141ec2[_0x4c0b8a(0x218)]==='no_parent'?(console['error'](a44_0x2894d3[_0x4c0b8a(0x202)](_0x4c0b8a(0x1f3))),console[_0x4c0b8a(0x206)](_0x4c0b8a(0x21f)),console[_0x4c0b8a(0x206)](_0x4c0b8a(0x21b)),console[_0x4c0b8a(0x206)](_0x4c0b8a(0x214))):(console['error'](a44_0x2894d3[_0x4c0b8a(0x216)]('Error:\x20'+_0x141ec2['message']+'\x0a')),_0x141ec2['helpText']&&console[_0x4c0b8a(0x206)](a44_0x2894d3[_0x4c0b8a(0x222)](_0x141ec2[_0x4c0b8a(0x20f)]))),0x1;const _0x336209=_0x141ec2['targetDir'],_0x5d9fbb=_0x141ec2[_0x4c0b8a(0x20e)]===_0x4c0b8a(0x1fb)?_0x141ec2[_0x4c0b8a(0x21a)]:undefined;if(!_0x5d9fbb&&!existsSync(_0x336209))return console[_0x4c0b8a(0x206)](a44_0x2894d3[_0x4c0b8a(0x216)](_0x4c0b8a(0x1ef)+_0x336209+'\x0a')),0x1;let _0x4df04e;if(_0x5d9fbb){if(!_0x5d9fbb[_0x4c0b8a(0x201)](_0x4c0b8a(0x1fc))&&!_0x5d9fbb[_0x4c0b8a(0x201)](_0x4c0b8a(0x1fd)))return console[_0x4c0b8a(0x206)](a44_0x2894d3['red'](_0x4c0b8a(0x212)+_0x5d9fbb+'\x0a')),0x1;_0x4df04e=[_0x5d9fbb];}else _0x4df04e=findYamlFiles(_0x336209);if(_0x4df04e[_0x4c0b8a(0x20c)]===0x0)return console[_0x4c0b8a(0x206)](a44_0x2894d3[_0x4c0b8a(0x216)](_0x4c0b8a(0x215)+_0x336209+'\x0a')),0x1;const _0x5964ff=validateYamlFiles(_0x4df04e,_0x336209),_0x49c60a=calculateSummary(_0x5964ff);for(const _0x5b6255 of _0x5964ff){if(!isValidationResult(_0x5b6255))continue;const {relativePath:_0x2c6d61,source:_0x376612,result:_0x11bcda,fileType:_0x204cee}=_0x5b6255,_0x2d26fb=_0x204cee;if(_0x11bcda[_0x4c0b8a(0x208)]&&_0x11bcda[_0x4c0b8a(0x20a)][_0x4c0b8a(0x20c)]===0x0)_0x5c86bf['verbose']&&console[_0x4c0b8a(0x209)](a44_0x2894d3[_0x4c0b8a(0x200)]('✔\x20'+_0x2c6d61)+a44_0x2894d3[_0x4c0b8a(0x1f5)]('\x20('+_0x2d26fb+')'));else _0x11bcda[_0x4c0b8a(0x208)]?(console[_0x4c0b8a(0x209)](a44_0x2894d3[_0x4c0b8a(0x202)]('⚠\x20'+_0x2c6d61)+a44_0x2894d3[_0x4c0b8a(0x1f5)]('\x20('+_0x2d26fb+_0x4c0b8a(0x21d)+_0x11bcda['warnings'][_0x4c0b8a(0x20c)]+_0x4c0b8a(0x21e))),console[_0x4c0b8a(0x209)](formatValidationResult(_0x11bcda,_0x376612,_0x2c6d61))):(console[_0x4c0b8a(0x209)](a44_0x2894d3['red']('✖\x20'+_0x2c6d61)+a44_0x2894d3['dim']('\x20('+_0x2d26fb+'):\x20'+_0x11bcda[_0x4c0b8a(0x210)][_0x4c0b8a(0x20c)]+'\x20error(s)')),console[_0x4c0b8a(0x209)](formatValidationResult(_0x11bcda,_0x376612,_0x2c6d61)));}return console[_0x4c0b8a(0x209)](''),_0x49c60a[_0x4c0b8a(0x204)]?(console[_0x4c0b8a(0x209)](a44_0x2894d3[_0x4c0b8a(0x216)](_0x4c0b8a(0x1f7)+_0x49c60a['invalidCount']+'\x20file(s)\x20with\x20errors,\x20'+_0x49c60a[_0x4c0b8a(0x1fa)]+_0x4c0b8a(0x1fe))),_0x49c60a[_0x4c0b8a(0x1f4)]>0x0&&console[_0x4c0b8a(0x209)](a44_0x2894d3['yellow'](_0x49c60a[_0x4c0b8a(0x1f4)]+_0x4c0b8a(0x1f1))),0x1):(console[_0x4c0b8a(0x209)](a44_0x2894d3['green'](_0x4c0b8a(0x1f6)+_0x49c60a['validCount']+_0x4c0b8a(0x203))),_0x49c60a[_0x4c0b8a(0x1f4)]>0x0&&console[_0x4c0b8a(0x209)](a44_0x2894d3[_0x4c0b8a(0x202)](_0x49c60a['warningCount']+'\x20warning(s)\x20found')),0x0);}}
1
+ const a44_0x5e7e65=a44_0x3b35;(function(_0x356041,_0xe0b07b){const _0x1efc62=a44_0x3b35,_0x323110=_0x356041();while(!![]){try{const _0x3da0a6=parseInt(_0x1efc62(0x1cb))/0x1+parseInt(_0x1efc62(0x1aa))/0x2+-parseInt(_0x1efc62(0x1c8))/0x3+parseInt(_0x1efc62(0x1a8))/0x4+-parseInt(_0x1efc62(0x1d2))/0x5+parseInt(_0x1efc62(0x1b7))/0x6*(parseInt(_0x1efc62(0x1b5))/0x7)+parseInt(_0x1efc62(0x1ad))/0x8*(-parseInt(_0x1efc62(0x1c9))/0x9);if(_0x3da0a6===_0xe0b07b)break;else _0x323110['push'](_0x323110['shift']());}catch(_0x41b360){_0x323110['push'](_0x323110['shift']());}}}(a44_0x3386,0x8a5c8));import{BaseCommand}from'./command.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';import a44_0x4b1dcd from'chalk';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';function a44_0x3b35(_0x5805a1,_0x440d8c){_0x5805a1=_0x5805a1-0x1a6;const _0x3386a0=a44_0x3386();let _0x3b35c5=_0x3386a0[_0x5805a1];return _0x3b35c5;}function a44_0x3386(){const _0x270253=['8nVYjyQ','.yaml','targetDir','Validate\x20segment\x20and\x20journey\x20YAML\x20files','verbose','cyan','\x20error(s)','\x20valid','131558baSBoC','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20validate\x20.\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20current\x20directory','354pEwphC','):\x20','helpText','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','Error:\x20','red','filePath','valid','errorCode','message','Error:\x20Directory\x20not\x20found:\x20','green','dim','execute','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','\x20file(s)\x20valid','length','1874319qQYBwW','9740511QmBkho','invalidCount','1080514NMeBtn','warningCount','log','.yml','hasErrors','Validation\x20failed:\x20','\x20warning(s)\x20found','4864030YXYLaL','segment:validate','\x20warning(s)','errors','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','yellow','warnings','856844QHRZjB','error','1686030BubZhu','endsWith','validCount'];a44_0x3386=function(){return _0x270253;};return a44_0x3386();}import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class SegmentValidateCommand extends BaseCommand{['name']=a44_0x5e7e65(0x1d3);['description']=a44_0x5e7e65(0x1b0);async[a44_0x5e7e65(0x1c4)](_0x3ed5b1){const _0x1ba9dc=a44_0x5e7e65,{options:_0x15dea4,args:_0x1f4e27}=_0x3ed5b1,_0x29ba87=_0x15dea4,_0xefc5d7=await resolveTarget({'arg':_0x1f4e27[0x0],'contextParent':_0x15dea4['parentSegment'],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0xefc5d7))return _0xefc5d7[_0x1ba9dc(0x1bf)]==='no_parent'?(console[_0x1ba9dc(0x1a9)](a44_0x4b1dcd[_0x1ba9dc(0x1a6)](_0x1ba9dc(0x1ba))),console[_0x1ba9dc(0x1a9)]('Usage:\x20tdx\x20sg\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)'),console[_0x1ba9dc(0x1a9)](_0x1ba9dc(0x1b6)),console['error']('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file')):(console[_0x1ba9dc(0x1a9)](a44_0x4b1dcd[_0x1ba9dc(0x1bc)](_0x1ba9dc(0x1bb)+_0xefc5d7[_0x1ba9dc(0x1c0)]+'\x0a')),_0xefc5d7[_0x1ba9dc(0x1b9)]&&console[_0x1ba9dc(0x1a9)](a44_0x4b1dcd[_0x1ba9dc(0x1b2)](_0xefc5d7[_0x1ba9dc(0x1b9)]))),0x1;const _0x4d994b=_0xefc5d7[_0x1ba9dc(0x1af)],_0x221a8b=_0xefc5d7['type']==='file'?_0xefc5d7[_0x1ba9dc(0x1bd)]:undefined;if(!_0x221a8b&&!existsSync(_0x4d994b))return console['error'](a44_0x4b1dcd[_0x1ba9dc(0x1bc)](_0x1ba9dc(0x1c1)+_0x4d994b+'\x0a')),0x1;let _0x3f5685;if(_0x221a8b){if(!_0x221a8b[_0x1ba9dc(0x1ab)](_0x1ba9dc(0x1ce))&&!_0x221a8b[_0x1ba9dc(0x1ab)](_0x1ba9dc(0x1ae)))return console['error'](a44_0x4b1dcd['red'](_0x1ba9dc(0x1c5)+_0x221a8b+'\x0a')),0x1;_0x3f5685=[_0x221a8b];}else _0x3f5685=findYamlFiles(_0x4d994b);if(_0x3f5685[_0x1ba9dc(0x1c7)]===0x0)return console[_0x1ba9dc(0x1a9)](a44_0x4b1dcd[_0x1ba9dc(0x1bc)](_0x1ba9dc(0x1d6)+_0x4d994b+'\x0a')),0x1;const _0x58f5b8=validateYamlFiles(_0x3f5685,_0x4d994b),_0x51f053=calculateSummary(_0x58f5b8);for(const _0x21b1b0 of _0x58f5b8){if(!isValidationResult(_0x21b1b0))continue;const {relativePath:_0x2923d9,source:_0x5e535f,result:_0x4aae20,fileType:_0x200631}=_0x21b1b0,_0x123994=_0x200631;if(_0x4aae20[_0x1ba9dc(0x1be)]&&_0x4aae20[_0x1ba9dc(0x1a7)]['length']===0x0)_0x29ba87[_0x1ba9dc(0x1b1)]&&console['log'](a44_0x4b1dcd['green']('✔\x20'+_0x2923d9)+a44_0x4b1dcd[_0x1ba9dc(0x1c3)]('\x20('+_0x123994+')'));else _0x4aae20[_0x1ba9dc(0x1be)]?(console[_0x1ba9dc(0x1cd)](a44_0x4b1dcd[_0x1ba9dc(0x1a6)]('⚠\x20'+_0x2923d9)+a44_0x4b1dcd[_0x1ba9dc(0x1c3)]('\x20('+_0x123994+_0x1ba9dc(0x1b8)+_0x4aae20['warnings']['length']+_0x1ba9dc(0x1d4))),console[_0x1ba9dc(0x1cd)](formatValidationResult(_0x4aae20,_0x5e535f,_0x2923d9))):(console['log'](a44_0x4b1dcd[_0x1ba9dc(0x1bc)]('✖\x20'+_0x2923d9)+a44_0x4b1dcd[_0x1ba9dc(0x1c3)]('\x20('+_0x123994+_0x1ba9dc(0x1b8)+_0x4aae20[_0x1ba9dc(0x1d5)]['length']+_0x1ba9dc(0x1b3))),console[_0x1ba9dc(0x1cd)](formatValidationResult(_0x4aae20,_0x5e535f,_0x2923d9)));}return console[_0x1ba9dc(0x1cd)](''),_0x51f053[_0x1ba9dc(0x1cf)]?(console[_0x1ba9dc(0x1cd)](a44_0x4b1dcd[_0x1ba9dc(0x1bc)](_0x1ba9dc(0x1d0)+_0x51f053[_0x1ba9dc(0x1ca)]+'\x20file(s)\x20with\x20errors,\x20'+_0x51f053[_0x1ba9dc(0x1ac)]+_0x1ba9dc(0x1b4))),_0x51f053[_0x1ba9dc(0x1cc)]>0x0&&console[_0x1ba9dc(0x1cd)](a44_0x4b1dcd['yellow'](_0x51f053[_0x1ba9dc(0x1cc)]+_0x1ba9dc(0x1d1))),0x1):(console['log'](a44_0x4b1dcd[_0x1ba9dc(0x1c2)]('✔\x20All\x20'+_0x51f053[_0x1ba9dc(0x1ac)]+_0x1ba9dc(0x1c6))),_0x51f053[_0x1ba9dc(0x1cc)]>0x0&&console[_0x1ba9dc(0x1cd)](a44_0x4b1dcd[_0x1ba9dc(0x1a6)](_0x51f053['warningCount']+_0x1ba9dc(0x1d1))),0x0);}}
@@ -1 +1 @@
1
- const a45_0x217588=a45_0x1764;(function(_0x2f1cdc,_0x4ec026){const _0x576e15=a45_0x1764,_0x495026=_0x2f1cdc();while(!![]){try{const _0x56893e=parseInt(_0x576e15(0xd4))/0x1*(parseInt(_0x576e15(0xd6))/0x2)+parseInt(_0x576e15(0xcd))/0x3*(parseInt(_0x576e15(0xca))/0x4)+-parseInt(_0x576e15(0xdf))/0x5*(-parseInt(_0x576e15(0xd0))/0x6)+-parseInt(_0x576e15(0x10f))/0x7+parseInt(_0x576e15(0xef))/0x8+parseInt(_0x576e15(0xcb))/0x9+-parseInt(_0x576e15(0xdb))/0xa;if(_0x56893e===_0x4ec026)break;else _0x495026['push'](_0x495026['shift']());}catch(_0x2532c4){_0x495026['push'](_0x495026['shift']());}}}(a45_0x1719,0xaec97));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';function a45_0x1719(){const _0xe0a6c=['maxDepth','141849jpTinE','json','name','3850302gdokEA','sort','children','map','274591zCWcER','test','8QfJOyN','site','journey','\x5c$&','No\x20items\x20match\x20pattern:\x20','42625960JMtZUm','format','localeCompare','data','10XdaDhe','\x20journey','segments',']\x20matching\x20\x27','resolvePathToResource','Folder\x20ID:\x20','journeys','Resolving\x20path\x20\x27','journeyBundleName','folders','Error:\x20No\x20parent\x20segment\x20context\x20set.','parentSegment','message','Parent\x20segment\x20context:\x20','segment','recursive','8728808XvkkFK','verbose','\x27...','listUnified','folder','jsonl','replace','✔\x20Found\x20','includes','/j/da','type','\x20folder','log','description','/app/ps/','listWithPattern','error','Resolving\x20parent\x20segment\x20\x27','filter','folderId','\x20segment','List\x20folders\x20and\x20child\x20segments','Site:\x20','Error:\x20','length','Parent\x20ID:\x20',',\x20and\x20','listUnifiedWithJourneys','listRecursive','Set\x20a\x20parent\x20segment\x20context\x20first:','\x20\x20Cause:\x20','parentId','2497502caGhnq','execute','/e/','dim','Listing\x20folders,\x20segments,\x20and\x20journeys...','48ocbOMH','11655126VhONzx'];a45_0x1719=function(){return _0xe0a6c;};return a45_0x1719();}import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{formatFlatList,formatTree}from'../sdk/util/tree-formatter.js';function a45_0x1764(_0x453e8c,_0x34f5d0){_0x453e8c=_0x453e8c-0xc8;const _0x17192e=a45_0x1719();let _0x176464=_0x17192e[_0x453e8c];return _0x176464;}import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import a45_0x2e0979 from'chalk';export class SegmentsCommand extends BaseCommand{['name']=a45_0x217588(0xe1);[a45_0x217588(0xfc)]=a45_0x217588(0x104);async[a45_0x217588(0x110)](_0x2b37a4){const _0x1c0ffc=a45_0x217588,{options:_0x2fcd80,args:_0x538783}=_0x2b37a4,_0x2e7e20=_0x2fcd80[_0x1c0ffc(0xee)],_0x123f42=_0x538783[0x0];try{const _0x326a6b=_0x2fcd80[_0x1c0ffc(0xea)];_0x2fcd80['verbose']&&(console[_0x1c0ffc(0xff)](_0x1c0ffc(0x105)+_0x2fcd80[_0x1c0ffc(0xd7)]),console[_0x1c0ffc(0xff)](_0x1c0ffc(0xec)+(_0x326a6b||'(not\x20set)')),_0x123f42&&console[_0x1c0ffc(0xff)]('Folder/pattern\x20arg:\x20'+_0x123f42),_0x2e7e20&&console[_0x1c0ffc(0xff)]('Recursive\x20mode:\x20enabled'));if(!_0x326a6b)return console['error'](_0x1c0ffc(0xe9)),console[_0x1c0ffc(0xff)](''),console[_0x1c0ffc(0xff)](_0x1c0ffc(0x10c)),console['error']('\x20\x20tdx\x20sg\x20pull\x20\x22My\x20Audience\x22'),console[_0x1c0ffc(0xff)]('\x20\x20tdx\x20sg\x20use\x20\x22My\x20Audience\x22'),console[_0x1c0ffc(0xff)](''),console[_0x1c0ffc(0xff)]('Use\x20tdx\x20ps\x20list\x20to\x20see\x20available\x20parent\x20segments.'),0x1;const _0x2f9907=_0x123f42&&(_0x123f42[_0x1c0ffc(0xf7)]('*')||_0x123f42[_0x1c0ffc(0xf7)]('?'));if(_0x2f9907)return await this[_0x1c0ffc(0xfe)](_0x2b37a4,_0x326a6b,_0x123f42);const _0x390e25=_0x123f42?_0x326a6b+'/'+_0x123f42:_0x326a6b;return _0x2e7e20?await this[_0x1c0ffc(0x10b)](_0x2b37a4,_0x390e25):await this[_0x1c0ffc(0xf2)](_0x2b37a4,_0x390e25);}catch(_0x11db6c){if(_0x11db6c instanceof SDKError)return console[_0x1c0ffc(0xff)](_0x1c0ffc(0x106)+_0x11db6c[_0x1c0ffc(0xeb)]),_0x11db6c['cause']&&console[_0x1c0ffc(0xff)](_0x1c0ffc(0x10d)+_0x11db6c['cause']),0x1;throw _0x11db6c;}}async[a45_0x217588(0xfe)](_0x5a2a19,_0x291bba,_0x34d869){const _0x331c4b=a45_0x217588,{options:_0x2ce075,tdx:_0x15904d}=_0x5a2a19,_0x189a10=await withSpinner(_0x331c4b(0x100)+_0x291bba+_0x331c4b(0xf1),()=>_0x15904d['segment']['resolvePathToResource'](_0x291bba),{'verbose':_0x2ce075[_0x331c4b(0xf0)]}),_0x2797d4=_0x189a10[_0x331c4b(0xde)],_0x43da2e=await withSpinner(_0x331c4b(0xc9),()=>_0x15904d[_0x331c4b(0xed)][_0x331c4b(0x10a)](_0x2797d4['parentId'],_0x2797d4[_0x331c4b(0x102)]),{'verbose':_0x2ce075[_0x331c4b(0xf0)]}),{folders:_0x18bdee,segments:_0x25294e,journeys:_0x54b1b5}=_0x43da2e[_0x331c4b(0xde)],_0x50eeaf=_0x34d869[_0x331c4b(0xf5)](/[.+^${}()|[\]\\]/g,_0x331c4b(0xd9))[_0x331c4b(0xf5)](/\*/g,'.*')[_0x331c4b(0xf5)](/\?/g,'.'),_0x3f6550=new RegExp('^'+_0x50eeaf+'$','i'),_0x12968d=_0x18bdee[_0x331c4b(0x101)](_0x3af4d2=>_0x3f6550['test'](_0x3af4d2[_0x331c4b(0xcf)])),_0x3dea54=_0x25294e[_0x331c4b(0x101)](_0x36f6db=>_0x3f6550['test'](_0x36f6db[_0x331c4b(0xcf)])),_0x3398da=_0x54b1b5[_0x331c4b(0x101)](_0x320090=>_0x3f6550[_0x331c4b(0xd5)](_0x320090[_0x331c4b(0xe7)])),_0x592ebe=_0x12968d[_0x331c4b(0x107)]+_0x3dea54[_0x331c4b(0x107)]+_0x3398da[_0x331c4b(0x107)];console[_0x331c4b(0xff)](_0x331c4b(0xf6)+_0x12968d[_0x331c4b(0x107)]+'\x20folder'+(_0x12968d[_0x331c4b(0x107)]!==0x1?'s':'')+',\x20'+_0x3dea54[_0x331c4b(0x107)]+_0x331c4b(0x103)+(_0x3dea54[_0x331c4b(0x107)]!==0x1?'s':'')+_0x331c4b(0x109)+_0x3398da[_0x331c4b(0x107)]+_0x331c4b(0xe0)+(_0x3398da['length']!==0x1?'s':'')+'\x20matching\x20\x27'+_0x34d869+'\x27');const _0x547320=_0x2b61c8=>{const _0x2c48eb=_0x331c4b;return getConsoleNextUrl(_0x2ce075[_0x2c48eb(0xd7)],_0x2c48eb(0xfd)+_0x2797d4[_0x2c48eb(0x10e)]+'/e/'+_0x2b61c8);},_0x3740f1=_0x2ce075['format']===_0x331c4b(0xce)||_0x2ce075[_0x331c4b(0xdc)]==='jsonl';if(_0x3740f1){const _0x37ea90=[..._0x12968d['map'](_0x18921e=>({..._0x18921e,'type':'folder'})),..._0x3dea54['map'](_0x321d8b=>({..._0x321d8b,'type':_0x331c4b(0xed),'url':_0x547320(_0x321d8b['id'])})),..._0x3398da[_0x331c4b(0xd3)](_0x47c6ce=>({..._0x47c6ce,'name':_0x47c6ce[_0x331c4b(0xe7)],'type':_0x331c4b(0xd8)}))][_0x331c4b(0xd1)]((_0x147d3f,_0x2195ab)=>_0x147d3f[_0x331c4b(0xcf)][_0x331c4b(0xdd)](_0x2195ab['name']));await handleSDKOutput(_0x37ea90,_0x2ce075);}else{if(_0x592ebe===0x0)console[_0x331c4b(0xfb)](_0x331c4b(0xda)+_0x34d869);else{console[_0x331c4b(0xfb)](a45_0x2e0979[_0x331c4b(0xc8)]('['+_0x291bba+_0x331c4b(0xe2)+_0x34d869+'\x27'));const _0x1a18cc=formatFlatList(_0x12968d,_0x3dea54,{'showMetadata':!![],'getSegmentUrl':_0x547320},_0x3398da);console[_0x331c4b(0xfb)](_0x1a18cc);}}return 0x0;}async['listUnified'](_0x538daa,_0x129a47){const _0x104981=a45_0x217588,{options:_0x220f4b,tdx:_0x3ac591}=_0x538daa,_0x8df922=await withSpinner(_0x104981(0xe6)+_0x129a47+_0x104981(0xf1),()=>_0x3ac591['segment']['resolvePathToResource'](_0x129a47),{'verbose':_0x220f4b[_0x104981(0xf0)]}),_0x3dd007=_0x8df922[_0x104981(0xde)];_0x220f4b['verbose']&&(console[_0x104981(0xff)](_0x104981(0x108)+_0x3dd007[_0x104981(0x10e)]),_0x3dd007[_0x104981(0x102)]&&console[_0x104981(0xff)](_0x104981(0xe4)+_0x3dd007[_0x104981(0x102)]));const _0x409c54=await withSpinner('Listing\x20folders,\x20segments,\x20and\x20journeys...',()=>_0x3ac591[_0x104981(0xed)][_0x104981(0x10a)](_0x3dd007[_0x104981(0x10e)],_0x3dd007[_0x104981(0x102)]),{'verbose':_0x220f4b['verbose']}),{folders:_0x5b7dad,segments:_0x3e63db,journeys:_0x5a78c3}=_0x409c54[_0x104981(0xde)],_0x6ae6d7=_0x5b7dad[_0x104981(0x107)]+_0x3e63db[_0x104981(0x107)]+_0x5a78c3['length'];console['error'](_0x104981(0xf6)+_0x5b7dad[_0x104981(0x107)]+'\x20folder'+(_0x5b7dad[_0x104981(0x107)]!==0x1?'s':'')+',\x20'+_0x3e63db['length']+_0x104981(0x103)+(_0x3e63db[_0x104981(0x107)]!==0x1?'s':'')+_0x104981(0x109)+_0x5a78c3[_0x104981(0x107)]+_0x104981(0xe0)+(_0x5a78c3['length']!==0x1?'s':''));const _0x4426e1=_0x2cd77f=>{const _0x47558d=_0x104981;return getConsoleNextUrl(_0x220f4b[_0x47558d(0xd7)],_0x47558d(0xfd)+_0x3dd007['parentId']+_0x47558d(0x111)+_0x2cd77f);},_0x34b4a1=_0x1705f3=>{const _0x4111f4=_0x104981;return getConsoleNextUrl(_0x220f4b[_0x4111f4(0xd7)],_0x4111f4(0xfd)+_0x3dd007[_0x4111f4(0x10e)]+_0x4111f4(0x111)+_0x1705f3+_0x4111f4(0xf8));},_0x4b78d3=_0x220f4b[_0x104981(0xdc)]==='json'||_0x220f4b[_0x104981(0xdc)]==='jsonl';if(_0x4b78d3){const _0x230ffe=[..._0x5b7dad['map'](_0x4cc8f5=>({..._0x4cc8f5,'type':_0x104981(0xf3)})),..._0x3e63db[_0x104981(0xd3)](_0x49997c=>({..._0x49997c,'type':_0x104981(0xed),'url':_0x4426e1(_0x49997c['id'])})),..._0x5a78c3['map'](_0x592126=>({..._0x592126,'name':_0x592126[_0x104981(0xe7)],'type':_0x104981(0xd8),'url':_0x34b4a1(_0x592126['id'])}))][_0x104981(0xd1)]((_0x1f0dbb,_0x1f32bc)=>_0x1f0dbb[_0x104981(0xcf)][_0x104981(0xdd)](_0x1f32bc[_0x104981(0xcf)]));await handleSDKOutput(_0x230ffe,_0x220f4b);}else{if(_0x6ae6d7===0x0)console[_0x104981(0xfb)](a45_0x2e0979['dim']('['+_0x129a47+']')),console[_0x104981(0xfb)]('(empty)');else{console['log'](a45_0x2e0979['dim']('['+_0x129a47+']'));const _0x2ad099=formatFlatList(_0x5b7dad,_0x3e63db,{'showMetadata':!![],'getSegmentUrl':_0x4426e1,'getJourneyUrl':_0x34b4a1},_0x5a78c3);console[_0x104981(0xfb)](_0x2ad099);}}return 0x0;}async['listRecursive'](_0x586338,_0x39ff66){const _0xea1588=a45_0x217588,{options:_0x449163,tdx:_0x58ba33}=_0x586338,_0x97117=await withSpinner(_0xea1588(0xe6)+_0x39ff66+_0xea1588(0xf1),()=>_0x58ba33['segment'][_0xea1588(0xe3)](_0x39ff66),{'verbose':_0x449163[_0xea1588(0xf0)]}),_0x33c63e=_0x97117[_0xea1588(0xde)];_0x449163['verbose']&&(console[_0xea1588(0xff)](_0xea1588(0x108)+_0x33c63e['parentId']),_0x33c63e[_0xea1588(0x102)]&&console['error']('Folder\x20ID:\x20'+_0x33c63e['folderId']));const _0x3bd3ef=_0x449163[_0xea1588(0xcc)]||0xa,_0x3c6dcc=await withSpinner('Building\x20hierarchy\x20tree...',()=>_0x58ba33[_0xea1588(0xed)]['listRecursive'](_0x33c63e[_0xea1588(0x10e)],_0x33c63e[_0xea1588(0x102)],0x0,_0x3bd3ef),{'verbose':_0x449163['verbose']}),_0x5ebfeb=_0x3c6dcc[_0xea1588(0xde)],_0x495bcd=_0x5754fd=>{const _0x16dc7c=_0xea1588;let _0x594d82=0x0,_0x4c3af6=0x0,_0x24da28=0x0;for(const _0x59d301 of _0x5754fd){if(_0x59d301[_0x16dc7c(0xf9)]==='folder')_0x594d82++;else{if(_0x59d301[_0x16dc7c(0xf9)]===_0x16dc7c(0xed))_0x4c3af6++;else{if(_0x59d301[_0x16dc7c(0xf9)]==='journey')_0x24da28++;}}if(_0x59d301[_0x16dc7c(0xd2)]){const _0x94795a=_0x495bcd(_0x59d301[_0x16dc7c(0xd2)]);_0x594d82+=_0x94795a['folders'],_0x4c3af6+=_0x94795a[_0x16dc7c(0xe1)],_0x24da28+=_0x94795a[_0x16dc7c(0xe5)];}}return{'folders':_0x594d82,'segments':_0x4c3af6,'journeys':_0x24da28};},_0x23ddeb=_0x495bcd(_0x5ebfeb);console[_0xea1588(0xff)]('✔\x20Built\x20tree\x20with\x20'+_0x23ddeb[_0xea1588(0xe8)]+_0xea1588(0xfa)+(_0x23ddeb[_0xea1588(0xe8)]!==0x1?'s':'')+',\x20'+_0x23ddeb['segments']+_0xea1588(0x103)+(_0x23ddeb[_0xea1588(0xe1)]!==0x1?'s':'')+_0xea1588(0x109)+_0x23ddeb[_0xea1588(0xe5)]+_0xea1588(0xe0)+(_0x23ddeb[_0xea1588(0xe5)]!==0x1?'s':''));const _0x29e5eb=_0x262bdd=>{const _0x418771=_0xea1588;return getConsoleNextUrl(_0x449163[_0x418771(0xd7)],_0x418771(0xfd)+_0x33c63e[_0x418771(0x10e)]+_0x418771(0x111)+_0x262bdd);},_0x592512=_0x4d0acf=>{const _0x18e173=_0xea1588;return getConsoleNextUrl(_0x449163[_0x18e173(0xd7)],'/app/ps/'+_0x33c63e[_0x18e173(0x10e)]+_0x18e173(0x111)+_0x4d0acf+_0x18e173(0xf8));};if(_0x449163['format']===_0xea1588(0xce)||_0x449163[_0xea1588(0xdc)]===_0xea1588(0xf4))await handleSDKOutput(_0x5ebfeb,_0x449163);else{console[_0xea1588(0xfb)](a45_0x2e0979['dim']('['+_0x39ff66+']'));const _0x918f5=formatTree(_0x5ebfeb,{'showMetadata':!![],'getSegmentUrl':_0x29e5eb,'getJourneyUrl':_0x592512});console[_0xea1588(0xfb)](_0x918f5);}return 0x0;}}
1
+ const a45_0x374368=a45_0x3f88;(function(_0x557c85,_0x34fefc){const _0x37bdd7=a45_0x3f88,_0x2b9d1b=_0x557c85();while(!![]){try{const _0x3e1548=parseInt(_0x37bdd7(0xbb))/0x1+parseInt(_0x37bdd7(0xde))/0x2*(-parseInt(_0x37bdd7(0xe4))/0x3)+parseInt(_0x37bdd7(0xb1))/0x4+-parseInt(_0x37bdd7(0xf4))/0x5*(parseInt(_0x37bdd7(0xda))/0x6)+-parseInt(_0x37bdd7(0xeb))/0x7+-parseInt(_0x37bdd7(0xed))/0x8+parseInt(_0x37bdd7(0xb5))/0x9*(parseInt(_0x37bdd7(0xb7))/0xa);if(_0x3e1548===_0x34fefc)break;else _0x2b9d1b['push'](_0x2b9d1b['shift']());}catch(_0x3d8385){_0x2b9d1b['push'](_0x2b9d1b['shift']());}}}(a45_0x54b5,0x68deb));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';function a45_0x54b5(){const _0x4aa04e=['Folder\x20ID:\x20','2pUxaFH','replace','\x20folder','cause','journey','listRecursive','2122122MaVgtU','Use\x20tdx\x20ps\x20list\x20to\x20see\x20available\x20parent\x20segments.','description','jsonl','folders','listWithPattern','folder','5979792efdEYi','length','3289432nmQCRt','localeCompare','verbose','List\x20folders\x20and\x20child\x20segments','log','site','journeys','10VCudkZ','includes',',\x20and\x20','dim','(not\x20set)','No\x20items\x20match\x20pattern:\x20','data','Building\x20hierarchy\x20tree...','359896Kyjlgp','segments','map','listUnifiedWithJourneys','19334043zxOXcQ','Set\x20a\x20parent\x20segment\x20context\x20first:','10nbHfeM',']\x20matching\x20\x27','\x5c$&','name','340959bRpHWj','maxDepth','Error:\x20No\x20parent\x20segment\x20context\x20set.','/app/ps/','\x20\x20Cause:\x20','Resolving\x20path\x20\x27','/e/','✔\x20Built\x20tree\x20with\x20','sort','Site:\x20','listUnified','parentId','json','Parent\x20segment\x20context:\x20','test','Error:\x20','\x20segment','\x20journey','type','segment','children','Folder/pattern\x20arg:\x20','\x27...','\x20\x20tdx\x20sg\x20use\x20\x22My\x20Audience\x22','Listing\x20folders,\x20segments,\x20and\x20journeys...','filter','resolvePathToResource','/j/da','journeyBundleName','format','✔\x20Found\x20','530412fwwVVk','error','folderId'];a45_0x54b5=function(){return _0x4aa04e;};return a45_0x54b5();}import{withSpinner}from'../utils/spinner.js';import{formatFlatList,formatTree}from'../sdk/util/tree-formatter.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import a45_0x39f889 from'chalk';function a45_0x3f88(_0x25f75f,_0x415558){_0x25f75f=_0x25f75f-0xaf;const _0x54b532=a45_0x54b5();let _0x3f8844=_0x54b532[_0x25f75f];return _0x3f8844;}export class SegmentsCommand extends BaseCommand{[a45_0x374368(0xba)]='segments';[a45_0x374368(0xe6)]=a45_0x374368(0xf0);async['execute'](_0x31176d){const _0x5b9c03=a45_0x374368,{options:_0x53c058,args:_0x1590b8}=_0x31176d,_0x447c65=_0x53c058['recursive'],_0x240b9a=_0x1590b8[0x0];try{const _0x17484f=_0x53c058['parentSegment'];_0x53c058[_0x5b9c03(0xef)]&&(console[_0x5b9c03(0xdb)](_0x5b9c03(0xc4)+_0x53c058[_0x5b9c03(0xf2)]),console[_0x5b9c03(0xdb)](_0x5b9c03(0xc8)+(_0x17484f||_0x5b9c03(0xf8))),_0x240b9a&&console['error'](_0x5b9c03(0xd0)+_0x240b9a),_0x447c65&&console[_0x5b9c03(0xdb)]('Recursive\x20mode:\x20enabled'));if(!_0x17484f)return console[_0x5b9c03(0xdb)](_0x5b9c03(0xbd)),console[_0x5b9c03(0xdb)](''),console[_0x5b9c03(0xdb)](_0x5b9c03(0xb6)),console[_0x5b9c03(0xdb)]('\x20\x20tdx\x20sg\x20pull\x20\x22My\x20Audience\x22'),console[_0x5b9c03(0xdb)](_0x5b9c03(0xd2)),console[_0x5b9c03(0xdb)](''),console[_0x5b9c03(0xdb)](_0x5b9c03(0xe5)),0x1;const _0x528df2=_0x240b9a&&(_0x240b9a[_0x5b9c03(0xf5)]('*')||_0x240b9a[_0x5b9c03(0xf5)]('?'));if(_0x528df2)return await this[_0x5b9c03(0xe9)](_0x31176d,_0x17484f,_0x240b9a);const _0x54b278=_0x240b9a?_0x17484f+'/'+_0x240b9a:_0x17484f;return _0x447c65?await this[_0x5b9c03(0xe3)](_0x31176d,_0x54b278):await this[_0x5b9c03(0xc5)](_0x31176d,_0x54b278);}catch(_0x1752e2){if(_0x1752e2 instanceof SDKError)return console['error'](_0x5b9c03(0xca)+_0x1752e2['message']),_0x1752e2[_0x5b9c03(0xe1)]&&console[_0x5b9c03(0xdb)](_0x5b9c03(0xbf)+_0x1752e2[_0x5b9c03(0xe1)]),0x1;throw _0x1752e2;}}async[a45_0x374368(0xe9)](_0x16b8ef,_0x38d716,_0xb4fbb2){const _0x3872d1=a45_0x374368,{options:_0x3dfb6b,tdx:_0x879183}=_0x16b8ef,_0x45b249=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x38d716+'\x27...',()=>_0x879183[_0x3872d1(0xce)][_0x3872d1(0xd5)](_0x38d716),{'verbose':_0x3dfb6b[_0x3872d1(0xef)]}),_0x4dc054=_0x45b249[_0x3872d1(0xaf)],_0x217c53=await withSpinner(_0x3872d1(0xd3),()=>_0x879183[_0x3872d1(0xce)]['listUnifiedWithJourneys'](_0x4dc054['parentId'],_0x4dc054[_0x3872d1(0xdc)]),{'verbose':_0x3dfb6b[_0x3872d1(0xef)]}),{folders:_0x109dd4,segments:_0x4063eb,journeys:_0x4c628c}=_0x217c53[_0x3872d1(0xaf)],_0x42f723=_0xb4fbb2['replace'](/[.+^${}()|[\]\\]/g,_0x3872d1(0xb9))[_0x3872d1(0xdf)](/\*/g,'.*')[_0x3872d1(0xdf)](/\?/g,'.'),_0x2c85a9=new RegExp('^'+_0x42f723+'$','i'),_0x16150a=_0x109dd4[_0x3872d1(0xd4)](_0x197098=>_0x2c85a9[_0x3872d1(0xc9)](_0x197098[_0x3872d1(0xba)])),_0x20366b=_0x4063eb[_0x3872d1(0xd4)](_0x9db5bf=>_0x2c85a9[_0x3872d1(0xc9)](_0x9db5bf[_0x3872d1(0xba)])),_0x41d808=_0x4c628c[_0x3872d1(0xd4)](_0x4583ed=>_0x2c85a9[_0x3872d1(0xc9)](_0x4583ed[_0x3872d1(0xd7)])),_0x3c4446=_0x16150a['length']+_0x20366b[_0x3872d1(0xec)]+_0x41d808[_0x3872d1(0xec)];console[_0x3872d1(0xdb)](_0x3872d1(0xd9)+_0x16150a['length']+_0x3872d1(0xe0)+(_0x16150a['length']!==0x1?'s':'')+',\x20'+_0x20366b[_0x3872d1(0xec)]+_0x3872d1(0xcb)+(_0x20366b[_0x3872d1(0xec)]!==0x1?'s':'')+_0x3872d1(0xf6)+_0x41d808[_0x3872d1(0xec)]+_0x3872d1(0xcc)+(_0x41d808[_0x3872d1(0xec)]!==0x1?'s':'')+'\x20matching\x20\x27'+_0xb4fbb2+'\x27');const _0x5418ae=_0x53de74=>{const _0x2fa9f7=_0x3872d1;return getConsoleNextUrl(_0x3dfb6b[_0x2fa9f7(0xf2)],_0x2fa9f7(0xbe)+_0x4dc054['parentId']+_0x2fa9f7(0xc1)+_0x53de74);},_0xd7d9b5=_0x3dfb6b[_0x3872d1(0xd8)]===_0x3872d1(0xc7)||_0x3dfb6b[_0x3872d1(0xd8)]===_0x3872d1(0xe7);if(_0xd7d9b5){const _0x43bc0e=[..._0x16150a[_0x3872d1(0xb3)](_0x26058f=>({..._0x26058f,'type':'folder'})),..._0x20366b[_0x3872d1(0xb3)](_0x2afbaf=>({..._0x2afbaf,'type':_0x3872d1(0xce),'url':_0x5418ae(_0x2afbaf['id'])})),..._0x41d808[_0x3872d1(0xb3)](_0x792a77=>({..._0x792a77,'name':_0x792a77['journeyBundleName'],'type':_0x3872d1(0xe2)}))][_0x3872d1(0xc3)]((_0x569ee5,_0xe4bdb)=>_0x569ee5[_0x3872d1(0xba)][_0x3872d1(0xee)](_0xe4bdb['name']));await handleSDKOutput(_0x43bc0e,_0x3dfb6b);}else{if(_0x3c4446===0x0)console[_0x3872d1(0xf1)](_0x3872d1(0xf9)+_0xb4fbb2);else{console[_0x3872d1(0xf1)](a45_0x39f889[_0x3872d1(0xf7)]('['+_0x38d716+_0x3872d1(0xb8)+_0xb4fbb2+'\x27'));const _0x173abb=formatFlatList(_0x16150a,_0x20366b,{'showMetadata':!![],'getSegmentUrl':_0x5418ae},_0x41d808);console['log'](_0x173abb);}}return 0x0;}async[a45_0x374368(0xc5)](_0x4368e,_0x55959f){const _0x36cb43=a45_0x374368,{options:_0x1b5774,tdx:_0x2f0f8d}=_0x4368e,_0x4ccc70=await withSpinner('Resolving\x20path\x20\x27'+_0x55959f+_0x36cb43(0xd1),()=>_0x2f0f8d['segment'][_0x36cb43(0xd5)](_0x55959f),{'verbose':_0x1b5774['verbose']}),_0x5dbece=_0x4ccc70['data'];_0x1b5774[_0x36cb43(0xef)]&&(console['error']('Parent\x20ID:\x20'+_0x5dbece['parentId']),_0x5dbece[_0x36cb43(0xdc)]&&console[_0x36cb43(0xdb)](_0x36cb43(0xdd)+_0x5dbece[_0x36cb43(0xdc)]));const _0x1196df=await withSpinner(_0x36cb43(0xd3),()=>_0x2f0f8d[_0x36cb43(0xce)][_0x36cb43(0xb4)](_0x5dbece[_0x36cb43(0xc6)],_0x5dbece[_0x36cb43(0xdc)]),{'verbose':_0x1b5774[_0x36cb43(0xef)]}),{folders:_0x12dbdf,segments:_0xb4bbb,journeys:_0x1cfb90}=_0x1196df[_0x36cb43(0xaf)],_0x11346d=_0x12dbdf[_0x36cb43(0xec)]+_0xb4bbb[_0x36cb43(0xec)]+_0x1cfb90[_0x36cb43(0xec)];console['error'](_0x36cb43(0xd9)+_0x12dbdf[_0x36cb43(0xec)]+_0x36cb43(0xe0)+(_0x12dbdf['length']!==0x1?'s':'')+',\x20'+_0xb4bbb[_0x36cb43(0xec)]+_0x36cb43(0xcb)+(_0xb4bbb[_0x36cb43(0xec)]!==0x1?'s':'')+',\x20and\x20'+_0x1cfb90['length']+_0x36cb43(0xcc)+(_0x1cfb90[_0x36cb43(0xec)]!==0x1?'s':''));const _0x15e872=_0x3e51aa=>{const _0x5224b0=_0x36cb43;return getConsoleNextUrl(_0x1b5774[_0x5224b0(0xf2)],_0x5224b0(0xbe)+_0x5dbece[_0x5224b0(0xc6)]+_0x5224b0(0xc1)+_0x3e51aa);},_0x1b15cc=_0x88e6c8=>{const _0x18ed62=_0x36cb43;return getConsoleNextUrl(_0x1b5774[_0x18ed62(0xf2)],_0x18ed62(0xbe)+_0x5dbece[_0x18ed62(0xc6)]+_0x18ed62(0xc1)+_0x88e6c8+_0x18ed62(0xd6));},_0x6dca45=_0x1b5774['format']==='json'||_0x1b5774['format']===_0x36cb43(0xe7);if(_0x6dca45){const _0x2f667b=[..._0x12dbdf[_0x36cb43(0xb3)](_0x1ae7fb=>({..._0x1ae7fb,'type':_0x36cb43(0xea)})),..._0xb4bbb['map'](_0x11d3e9=>({..._0x11d3e9,'type':'segment','url':_0x15e872(_0x11d3e9['id'])})),..._0x1cfb90[_0x36cb43(0xb3)](_0x97e74b=>({..._0x97e74b,'name':_0x97e74b[_0x36cb43(0xd7)],'type':'journey','url':_0x1b15cc(_0x97e74b['id'])}))][_0x36cb43(0xc3)]((_0x443953,_0x5ee85a)=>_0x443953[_0x36cb43(0xba)][_0x36cb43(0xee)](_0x5ee85a[_0x36cb43(0xba)]));await handleSDKOutput(_0x2f667b,_0x1b5774);}else{if(_0x11346d===0x0)console[_0x36cb43(0xf1)](a45_0x39f889[_0x36cb43(0xf7)]('['+_0x55959f+']')),console[_0x36cb43(0xf1)]('(empty)');else{console[_0x36cb43(0xf1)](a45_0x39f889[_0x36cb43(0xf7)]('['+_0x55959f+']'));const _0x467ac4=formatFlatList(_0x12dbdf,_0xb4bbb,{'showMetadata':!![],'getSegmentUrl':_0x15e872,'getJourneyUrl':_0x1b15cc},_0x1cfb90);console[_0x36cb43(0xf1)](_0x467ac4);}}return 0x0;}async['listRecursive'](_0x204588,_0x2f3eb3){const _0xe3075c=a45_0x374368,{options:_0x177c0c,tdx:_0x2f8f45}=_0x204588,_0x2ad667=await withSpinner(_0xe3075c(0xc0)+_0x2f3eb3+_0xe3075c(0xd1),()=>_0x2f8f45['segment'][_0xe3075c(0xd5)](_0x2f3eb3),{'verbose':_0x177c0c[_0xe3075c(0xef)]}),_0x4861cb=_0x2ad667[_0xe3075c(0xaf)];_0x177c0c[_0xe3075c(0xef)]&&(console['error']('Parent\x20ID:\x20'+_0x4861cb[_0xe3075c(0xc6)]),_0x4861cb['folderId']&&console[_0xe3075c(0xdb)]('Folder\x20ID:\x20'+_0x4861cb['folderId']));const _0x4b4f99=_0x177c0c[_0xe3075c(0xbc)]||0xa,_0x29d683=await withSpinner(_0xe3075c(0xb0),()=>_0x2f8f45[_0xe3075c(0xce)][_0xe3075c(0xe3)](_0x4861cb[_0xe3075c(0xc6)],_0x4861cb['folderId'],0x0,_0x4b4f99),{'verbose':_0x177c0c[_0xe3075c(0xef)]}),_0x567e10=_0x29d683[_0xe3075c(0xaf)],_0x5b2e4d=_0x458723=>{const _0x98e747=_0xe3075c;let _0x2380f8=0x0,_0x4ceb09=0x0,_0x45aa38=0x0;for(const _0x483af0 of _0x458723){if(_0x483af0[_0x98e747(0xcd)]===_0x98e747(0xea))_0x2380f8++;else{if(_0x483af0[_0x98e747(0xcd)]===_0x98e747(0xce))_0x4ceb09++;else{if(_0x483af0[_0x98e747(0xcd)]===_0x98e747(0xe2))_0x45aa38++;}}if(_0x483af0[_0x98e747(0xcf)]){const _0x4ba37e=_0x5b2e4d(_0x483af0['children']);_0x2380f8+=_0x4ba37e[_0x98e747(0xe8)],_0x4ceb09+=_0x4ba37e['segments'],_0x45aa38+=_0x4ba37e['journeys'];}}return{'folders':_0x2380f8,'segments':_0x4ceb09,'journeys':_0x45aa38};},_0x113aad=_0x5b2e4d(_0x567e10);console[_0xe3075c(0xdb)](_0xe3075c(0xc2)+_0x113aad[_0xe3075c(0xe8)]+_0xe3075c(0xe0)+(_0x113aad[_0xe3075c(0xe8)]!==0x1?'s':'')+',\x20'+_0x113aad[_0xe3075c(0xb2)]+_0xe3075c(0xcb)+(_0x113aad[_0xe3075c(0xb2)]!==0x1?'s':'')+_0xe3075c(0xf6)+_0x113aad[_0xe3075c(0xf3)]+_0xe3075c(0xcc)+(_0x113aad[_0xe3075c(0xf3)]!==0x1?'s':''));const _0x584bc8=_0x3a5bbf=>{const _0x5c0b5b=_0xe3075c;return getConsoleNextUrl(_0x177c0c[_0x5c0b5b(0xf2)],_0x5c0b5b(0xbe)+_0x4861cb[_0x5c0b5b(0xc6)]+_0x5c0b5b(0xc1)+_0x3a5bbf);},_0x4f1f73=_0x5649d9=>{const _0x59337e=_0xe3075c;return getConsoleNextUrl(_0x177c0c[_0x59337e(0xf2)],_0x59337e(0xbe)+_0x4861cb[_0x59337e(0xc6)]+_0x59337e(0xc1)+_0x5649d9+_0x59337e(0xd6));};if(_0x177c0c['format']===_0xe3075c(0xc7)||_0x177c0c[_0xe3075c(0xd8)]===_0xe3075c(0xe7))await handleSDKOutput(_0x567e10,_0x177c0c);else{console[_0xe3075c(0xf1)](a45_0x39f889[_0xe3075c(0xf7)]('['+_0x2f3eb3+']'));const _0x502f99=formatTree(_0x567e10,{'showMetadata':!![],'getSegmentUrl':_0x584bc8,'getJourneyUrl':_0x4f1f73});console[_0xe3075c(0xf1)](_0x502f99);}return 0x0;}}
@@ -1 +1 @@
1
- const a46_0x5e646d=a46_0x1818;function a46_0x2ea3(){const _0xad01ff=['Error:\x20','database','Limit:\x20','show','\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>','length','995370OOMFtb','table','query','10648548nhkMmt','showTable','catalog','141041TYtxhR','\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>','data','22ZnJqOg','8otAiLR','1275463ASnlwY','error','8ICzdJm','Usage:\x20tdx\x20show\x20<database.table>','10053790apSIju','✔\x20Retrieved\x20','Show\x20table\x20contents','Querying\x20','Table:\x20','name','6128940hTSDll','description','1929030bmRXci','cause','args','\x20from\x20','4OKBQCb','Site:\x20','site','Database:\x20','verbose','✔\x20Query\x20successful\x20-\x200\x20rows\x20returned','validate','limit','\x20\x20Cause:\x20','Too\x20many\x20arguments\x0aUsage:\x20tdx\x20show\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>\x0a\x0aRun\x20\x27tdx\x20show\x20--help\x27\x20for\x20more\x20options','Usage:\x20tdx\x20show\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--in\x20<database>\x0a\x0aRun\x20\x27tdx\x20show\x20--help\x27\x20for\x20more\x20options','message'];a46_0x2ea3=function(){return _0xad01ff;};return a46_0x2ea3();}(function(_0x23c6d5,_0x2d756d){const _0x135d76=a46_0x1818,_0x1aeb73=_0x23c6d5();while(!![]){try{const _0x2f0304=parseInt(_0x135d76(0x143))/0x1*(-parseInt(_0x135d76(0x11a))/0x2)+-parseInt(_0x135d76(0x127))/0x3*(parseInt(_0x135d76(0x12b))/0x4)+parseInt(_0x135d76(0x125))/0x5+parseInt(_0x135d76(0x13d))/0x6+-parseInt(_0x135d76(0x11b))/0x7+-parseInt(_0x135d76(0x11d))/0x8*(parseInt(_0x135d76(0x140))/0x9)+parseInt(_0x135d76(0x11f))/0xa*(parseInt(_0x135d76(0x146))/0xb);if(_0x2f0304===_0x2d756d)break;else _0x1aeb73['push'](_0x1aeb73['shift']());}catch(_0x1ee03b){_0x1aeb73['push'](_0x1aeb73['shift']());}}}(a46_0x2ea3,0xca9be));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';import{parseTableReference,validateTableDescribeReference}from'../utils/table-ref-parser.js';import{withSpinner}from'../utils/spinner.js';function a46_0x1818(_0x539f39,_0x551aa1){_0x539f39=_0x539f39-0x11a;const _0x2ea31b=a46_0x2ea3();let _0x18182a=_0x2ea31b[_0x539f39];return _0x18182a;}import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';export class ShowCommand extends BaseCommand{[a46_0x5e646d(0x124)]=a46_0x5e646d(0x13a);[a46_0x5e646d(0x126)]=a46_0x5e646d(0x121);async['execute'](_0x5703c3){return this['showTable'](_0x5703c3);}async[a46_0x5e646d(0x141)](_0x4cf0c4){const _0x4c4cca=a46_0x5e646d,{options:_0x2ec202,args:_0x377812,tdx:_0x161472}=_0x4cf0c4;let _0x388fa2;try{_0x388fa2=parseTableReference(_0x377812[0x0]);const _0x35f69a=_0x2ec202[_0x4c4cca(0x138)];!_0x388fa2[_0x4c4cca(0x138)]&&_0x35f69a&&(_0x388fa2[_0x4c4cca(0x138)]=_0x35f69a);const _0x20573f=validateTableDescribeReference(_0x388fa2);if(_0x20573f)return console[_0x4c4cca(0x11c)](_0x4c4cca(0x137)+_0x20573f),console[_0x4c4cca(0x11c)](_0x4c4cca(0x11e)),console['error'](_0x4c4cca(0x13b)),console[_0x4c4cca(0x11c)](_0x4c4cca(0x144)),0x1;}catch(_0x577659){return console[_0x4c4cca(0x11c)](_0x4c4cca(0x137)+_0x577659[_0x4c4cca(0x136)]),console[_0x4c4cca(0x11c)](_0x4c4cca(0x11e)),console['error']('\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>'),console[_0x4c4cca(0x11c)](_0x4c4cca(0x144)),0x1;}const _0x12b46b=_0x388fa2[_0x4c4cca(0x142)],_0x15d1b7=_0x388fa2[_0x4c4cca(0x138)],_0xbfc45c=_0x388fa2[_0x4c4cca(0x13e)],_0x1ec72c=resolveLimit(_0x2ec202[_0x4c4cca(0x132)],DEFAULT_DISPLAY_LIMIT);try{_0x2ec202['verbose']&&(console['error'](_0x4c4cca(0x12c)+_0x2ec202[_0x4c4cca(0x12d)]),_0x12b46b&&console['error']('Catalog:\x20'+_0x12b46b),console[_0x4c4cca(0x11c)](_0x4c4cca(0x12e)+_0x15d1b7),console[_0x4c4cca(0x11c)](_0x4c4cca(0x123)+_0xbfc45c),console['error'](_0x4c4cca(0x139)+_0x1ec72c));const _0x4ec83b=_0x12b46b?_0x12b46b+'.'+_0x15d1b7+'.'+_0xbfc45c:_0x15d1b7+'.'+_0xbfc45c,_0xda168a=await withSpinner(_0x4c4cca(0x122)+_0x4ec83b+'...',()=>_0x161472[_0x4c4cca(0x13f)][_0x4c4cca(0x141)](_0x15d1b7,_0xbfc45c,_0x1ec72c,_0x12b46b),{'verbose':_0x2ec202[_0x4c4cca(0x12f)]}),_0x37878b=_0xda168a['data'],_0x3b2c96=_0x37878b[_0x4c4cca(0x145)];return _0x3b2c96[_0x4c4cca(0x13c)]===0x0?console[_0x4c4cca(0x11c)](_0x4c4cca(0x130)):console[_0x4c4cca(0x11c)](_0x4c4cca(0x120)+_0x3b2c96[_0x4c4cca(0x13c)]+'\x20row'+(_0x3b2c96['length']!==0x1?'s':'')+_0x4c4cca(0x12a)+_0x4ec83b),await handleSDKOutput(_0x3b2c96,_0x2ec202),0x0;}catch(_0x4108e0){if(_0x4108e0 instanceof SDKError)return console[_0x4c4cca(0x11c)](_0x4c4cca(0x137)+_0x4108e0[_0x4c4cca(0x136)]),_0x4108e0[_0x4c4cca(0x128)]&&console[_0x4c4cca(0x11c)](_0x4c4cca(0x133)+_0x4108e0['cause']),0x1;throw _0x4108e0;}}[a46_0x5e646d(0x131)](_0x4adcb7){const _0x2cde25=a46_0x5e646d;if(_0x4adcb7[_0x2cde25(0x129)][_0x2cde25(0x13c)]===0x0)return _0x2cde25(0x135);if(_0x4adcb7[_0x2cde25(0x129)]['length']>0x1)return _0x2cde25(0x134);return undefined;}}
1
+ const a46_0x155ac3=a46_0x8b59;function a46_0x2254(){const _0x1e3b96=['Catalog:\x20','showTable','9433341oPznrr','verbose','site','Too\x20many\x20arguments\x0aUsage:\x20tdx\x20show\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>\x0a\x0aRun\x20\x27tdx\x20show\x20--help\x27\x20for\x20more\x20options','length','3533202iYSHlu','✔\x20Retrieved\x20','671978KaeVbF','validate','args','5178685sDMJuc','\x20row','name','error','description','\x20from\x20','limit','Usage:\x20tdx\x20show\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--in\x20<database>\x0a\x0aRun\x20\x27tdx\x20show\x20--help\x27\x20for\x20more\x20options','show','message','20kVHxhI','2vzmLMw','Database:\x20','\x20\x20Cause:\x20','catalog','cause','Site:\x20','784923PLEDer','Error:\x20','Limit:\x20','query','database','2103983ExnuQl','8dvbmES','Usage:\x20tdx\x20show\x20<database.table>','\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>','data','Querying\x20','965808OLeDYW'];a46_0x2254=function(){return _0x1e3b96;};return a46_0x2254();}function a46_0x8b59(_0x4c4598,_0x1467bb){_0x4c4598=_0x4c4598-0xcf;const _0x225459=a46_0x2254();let _0x8b59a4=_0x225459[_0x4c4598];return _0x8b59a4;}(function(_0x3baad0,_0xc9caf0){const _0xd7ae57=a46_0x8b59,_0x3763d3=_0x3baad0();while(!![]){try{const _0x37b758=-parseInt(_0xd7ae57(0xee))/0x1+-parseInt(_0xd7ae57(0xd3))/0x2*(-parseInt(_0xd7ae57(0xd9))/0x3)+parseInt(_0xd7ae57(0xe4))/0x4+-parseInt(_0xd7ae57(0xf1))/0x5+-parseInt(_0xd7ae57(0xec))/0x6+-parseInt(_0xd7ae57(0xde))/0x7*(-parseInt(_0xd7ae57(0xdf))/0x8)+parseInt(_0xd7ae57(0xe7))/0x9*(parseInt(_0xd7ae57(0xd2))/0xa);if(_0x37b758===_0xc9caf0)break;else _0x3763d3['push'](_0x3763d3['shift']());}catch(_0x3c7440){_0x3763d3['push'](_0x3763d3['shift']());}}}(a46_0x2254,0x934f2));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';import{parseTableReference,validateTableDescribeReference}from'../utils/table-ref-parser.js';import{withSpinner}from'../utils/spinner.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';export class ShowCommand extends BaseCommand{[a46_0x155ac3(0xf3)]=a46_0x155ac3(0xd0);[a46_0x155ac3(0xf5)]='Show\x20table\x20contents';async['execute'](_0x5d4892){const _0x162656=a46_0x155ac3;return this[_0x162656(0xe6)](_0x5d4892);}async[a46_0x155ac3(0xe6)](_0x1665aa){const _0x16f6cd=a46_0x155ac3,{options:_0x1c6c03,args:_0x501144,tdx:_0x4174a2}=_0x1665aa;let _0x4f02e8;try{_0x4f02e8=parseTableReference(_0x501144[0x0]);const _0x55d815=_0x1c6c03[_0x16f6cd(0xdd)];!_0x4f02e8['database']&&_0x55d815&&(_0x4f02e8['database']=_0x55d815);const _0x43ff6e=validateTableDescribeReference(_0x4f02e8);if(_0x43ff6e)return console[_0x16f6cd(0xf4)]('Error:\x20'+_0x43ff6e),console[_0x16f6cd(0xf4)](_0x16f6cd(0xe0)),console[_0x16f6cd(0xf4)](_0x16f6cd(0xe1)),console[_0x16f6cd(0xf4)]('\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>'),0x1;}catch(_0x6dad0a){return console[_0x16f6cd(0xf4)](_0x16f6cd(0xda)+_0x6dad0a[_0x16f6cd(0xd1)]),console[_0x16f6cd(0xf4)](_0x16f6cd(0xe0)),console[_0x16f6cd(0xf4)](_0x16f6cd(0xe1)),console[_0x16f6cd(0xf4)]('\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>'),0x1;}const _0x55eb7d=_0x4f02e8[_0x16f6cd(0xd6)],_0x57b7e8=_0x4f02e8[_0x16f6cd(0xdd)],_0x6c9910=_0x4f02e8['table'],_0x5788d7=resolveLimit(_0x1c6c03[_0x16f6cd(0xf7)],DEFAULT_DISPLAY_LIMIT);try{_0x1c6c03['verbose']&&(console[_0x16f6cd(0xf4)](_0x16f6cd(0xd8)+_0x1c6c03[_0x16f6cd(0xe9)]),_0x55eb7d&&console[_0x16f6cd(0xf4)](_0x16f6cd(0xe5)+_0x55eb7d),console[_0x16f6cd(0xf4)](_0x16f6cd(0xd4)+_0x57b7e8),console[_0x16f6cd(0xf4)]('Table:\x20'+_0x6c9910),console[_0x16f6cd(0xf4)](_0x16f6cd(0xdb)+_0x5788d7));const _0x4dcd69=_0x55eb7d?_0x55eb7d+'.'+_0x57b7e8+'.'+_0x6c9910:_0x57b7e8+'.'+_0x6c9910,_0x4ff296=await withSpinner(_0x16f6cd(0xe3)+_0x4dcd69+'...',()=>_0x4174a2[_0x16f6cd(0xdc)][_0x16f6cd(0xe6)](_0x57b7e8,_0x6c9910,_0x5788d7,_0x55eb7d),{'verbose':_0x1c6c03[_0x16f6cd(0xe8)]}),_0x21ed21=_0x4ff296[_0x16f6cd(0xe2)],_0xfbb4b3=_0x21ed21[_0x16f6cd(0xe2)];return _0xfbb4b3[_0x16f6cd(0xeb)]===0x0?console[_0x16f6cd(0xf4)]('✔\x20Query\x20successful\x20-\x200\x20rows\x20returned'):console[_0x16f6cd(0xf4)](_0x16f6cd(0xed)+_0xfbb4b3[_0x16f6cd(0xeb)]+_0x16f6cd(0xf2)+(_0xfbb4b3['length']!==0x1?'s':'')+_0x16f6cd(0xf6)+_0x4dcd69),await handleSDKOutput(_0xfbb4b3,_0x1c6c03),0x0;}catch(_0x126549){if(_0x126549 instanceof SDKError)return console[_0x16f6cd(0xf4)](_0x16f6cd(0xda)+_0x126549[_0x16f6cd(0xd1)]),_0x126549[_0x16f6cd(0xd7)]&&console['error'](_0x16f6cd(0xd5)+_0x126549[_0x16f6cd(0xd7)]),0x1;throw _0x126549;}}[a46_0x155ac3(0xef)](_0x3e2853){const _0x8850c4=a46_0x155ac3;if(_0x3e2853['args'][_0x8850c4(0xeb)]===0x0)return _0x8850c4(0xcf);if(_0x3e2853[_0x8850c4(0xf0)][_0x8850c4(0xeb)]>0x1)return _0x8850c4(0xea);return undefined;}}
@@ -1 +1 @@
1
- const a47_0x4bec5e=a47_0x30f2;function a47_0x5ded(){const _0x33cd28=['N/A','No\x20credential\x20found','10976976HeFRUt','account_id','profile','jobs','OAuth','error','first_name','Account\x20ID:','CLI\x20flag','site:\x20','profileSource','red','88OyztXL','env','description','bold','9nSSdIQ','config','dim','Show\x20authentication\x20status\x20and\x20current\x20context','cli','Name:','name','9157360lpKHwp','17238JcJyuw','User:','Read\x20credential\x20from\x20','1120XOcWuD','297205DljaMc','getUserInfo','TDX_PROFILE\x20env','displayWithSources','log','status','email','session','last_name','yellow','site','4803366HmOlpa','✗\x20Validation\x20failed:\x20','cyan','1237028BnJTzm','1313628aoEuxk','green'];a47_0x5ded=function(){return _0x33cd28;};return a47_0x5ded();}(function(_0x34d25c,_0x4f107a){const _0x45399a=a47_0x30f2,_0x513377=_0x34d25c();while(!![]){try{const _0x30632c=parseInt(_0x45399a(0x1e7))/0x1+-parseInt(_0x45399a(0x1e8))/0x2+parseInt(_0x45399a(0x1e4))/0x3+parseInt(_0x45399a(0x1f8))/0x4*(-parseInt(_0x45399a(0x208))/0x5)+parseInt(_0x45399a(0x204))/0x6*(parseInt(_0x45399a(0x207))/0x7)+-parseInt(_0x45399a(0x1ec))/0x8+-parseInt(_0x45399a(0x1fc))/0x9*(-parseInt(_0x45399a(0x203))/0xa);if(_0x30632c===_0x4f107a)break;else _0x513377['push'](_0x513377['shift']());}catch(_0x56303b){_0x513377['push'](_0x513377['shift']());}}}(a47_0x5ded,0xd6180));import{BaseCommand,printAuthError}from'./command.js';import{resolveAPIKeyAsync}from'../core/config.js';function a47_0x30f2(_0xff0a9,_0x18328f){_0xff0a9=_0xff0a9-0x1df;const _0x5dedd5=a47_0x5ded();let _0x30f276=_0x5dedd5[_0xff0a9];return _0x30f276;}import{getOAuthTokens}from'../core/oauth-keychain.js';import{HTTPClientError}from'../sdk/client/http-client.js';import{GlobalContext}from'../core/global-context.js';import a47_0x1af0a0 from'chalk';export class StatusCommand extends BaseCommand{[a47_0x4bec5e(0x202)]=a47_0x4bec5e(0x20d);[a47_0x4bec5e(0x1fa)]=a47_0x4bec5e(0x1ff);async['execute'](_0x34613d){const _0x82023f=a47_0x4bec5e,{options:_0x18c0e1,tdx:_0x1829ad}=_0x34613d,_0x25b712=_0x18c0e1[_0x82023f(0x1e3)],_0x1d136b=new GlobalContext(_0x18c0e1),_0x4e2535=_0x1d136b[_0x82023f(0x1ee)],_0x15286b=_0x1d136b[_0x82023f(0x1f6)],_0x2c3a3b=_0x15286b===_0x82023f(0x200)?_0x82023f(0x1f4):_0x15286b===_0x82023f(0x1e0)?_0x82023f(0x1e0):_0x15286b===_0x82023f(0x1f9)?_0x82023f(0x20a):_0x15286b===_0x82023f(0x1fd)?_0x82023f(0x1fd):null,_0x2bb32e=_0x4e2535?a47_0x1af0a0[_0x82023f(0x1e6)](_0x4e2535):a47_0x1af0a0[_0x82023f(0x1fe)](_0x82023f(0x1ea)),_0x32ce45=_0x2c3a3b?'\x20'+a47_0x1af0a0['dim']('(from\x20'+_0x2c3a3b+')'):'';console[_0x82023f(0x20c)](a47_0x1af0a0['bold']('tdx')+'\x20profile:\x20'+_0x2bb32e+_0x32ce45+'\x20'+a47_0x1af0a0[_0x82023f(0x1fe)]('(')+_0x82023f(0x1f5)+a47_0x1af0a0['cyan'](_0x25b712)+a47_0x1af0a0[_0x82023f(0x1fe)](')'));const _0x495cea=await getOAuthTokens(_0x4e2535);if(_0x495cea)console[_0x82023f(0x20c)]('Credential\x20type:\x20'+a47_0x1af0a0[_0x82023f(0x1e6)](_0x82023f(0x1f0)));else{const _0x521458=await resolveAPIKeyAsync(_0x25b712,_0x4e2535);if(_0x521458){const {source:_0x33d79a,isDeprecated:_0x36ee24}=_0x521458,_0x119f7d=_0x82023f(0x206)+a47_0x1af0a0[_0x82023f(0x1e6)](_0x33d79a);console['log'](_0x36ee24?a47_0x1af0a0[_0x82023f(0x1e2)](_0x119f7d):_0x119f7d);}else console[_0x82023f(0x20c)](a47_0x1af0a0['yellow'](_0x82023f(0x1eb)));}let _0x587057=![];try{const _0x54c003=await _0x1829ad[_0x82023f(0x1ef)][_0x82023f(0x209)]();console[_0x82023f(0x20c)](a47_0x1af0a0[_0x82023f(0x1e9)]('✓\x20Authentication\x20successful\x0a')),console[_0x82023f(0x20c)](a47_0x1af0a0['bold'](_0x82023f(0x205))+'\x20'+a47_0x1af0a0['cyan'](_0x54c003[_0x82023f(0x1df)]));if(_0x54c003[_0x82023f(0x1f2)]||_0x54c003[_0x82023f(0x1e1)]){const _0x35b72c=[_0x54c003[_0x82023f(0x1f2)],_0x54c003[_0x82023f(0x1e1)]]['filter'](Boolean)['join']('\x20');console[_0x82023f(0x20c)](a47_0x1af0a0[_0x82023f(0x1fb)](_0x82023f(0x201))+'\x20'+_0x35b72c);}_0x54c003[_0x82023f(0x1ed)]&&console[_0x82023f(0x20c)](a47_0x1af0a0[_0x82023f(0x1fb)](_0x82023f(0x1f3))+'\x20'+a47_0x1af0a0[_0x82023f(0x1e2)](_0x54c003[_0x82023f(0x1ed)])),_0x587057=!![];}catch(_0x35233b){_0x35233b instanceof HTTPClientError&&_0x35233b['status']===0x191?printAuthError(_0x35233b,!![],_0x4e2535):console[_0x82023f(0x1f1)](a47_0x1af0a0[_0x82023f(0x1f7)](_0x82023f(0x1e5)+(_0x35233b instanceof Error?_0x35233b['message']:String(_0x35233b))));}return console[_0x82023f(0x20c)](),_0x1d136b[_0x82023f(0x20b)](),_0x587057?0x0:0x1;}}
1
+ function a47_0x413c(_0x260386,_0x2c6561){_0x260386=_0x260386-0xf7;const _0x503aea=a47_0x503a();let _0x413cef=_0x503aea[_0x260386];return _0x413cef;}const a47_0x1f5950=a47_0x413c;(function(_0x4dc3fb,_0x48d836){const _0x243a2e=a47_0x413c,_0x4b3e50=_0x4dc3fb();while(!![]){try{const _0x180cc7=-parseInt(_0x243a2e(0x109))/0x1+parseInt(_0x243a2e(0xfc))/0x2+parseInt(_0x243a2e(0x114))/0x3+parseInt(_0x243a2e(0x103))/0x4*(-parseInt(_0x243a2e(0x11b))/0x5)+-parseInt(_0x243a2e(0x100))/0x6*(parseInt(_0x243a2e(0x111))/0x7)+parseInt(_0x243a2e(0x10c))/0x8+-parseInt(_0x243a2e(0x118))/0x9*(parseInt(_0x243a2e(0x112))/0xa);if(_0x180cc7===_0x48d836)break;else _0x4b3e50['push'](_0x4b3e50['shift']());}catch(_0x147627){_0x4b3e50['push'](_0x4b3e50['shift']());}}}(a47_0x503a,0x852f3));import{BaseCommand,printAuthError}from'./command.js';import{resolveAPIKeyAsync}from'../core/config.js';import{getOAuthTokens}from'../core/oauth-keychain.js';import{HTTPClientError}from'../sdk/client/http-client.js';import{GlobalContext}from'../core/global-context.js';function a47_0x503a(){const _0x687a09=['profile','5ildObN','tdx','cyan','error','displayWithSources','session','bold','No\x20credential\x20found','Credential\x20type:\x20','red','N/A','1702534RfSOAO','TDX_PROFILE\x20env','status','log','24wDLnkG','Show\x20authentication\x20status\x20and\x20current\x20context','yellow','2069876SqAUfR','filter','OAuth','site:\x20','description','account_id','475421FyazQY','getUserInfo','dim','5525416gXofAI','cli','name','env','last_name','522718OIHggA','80WuYUnT','first_name','2955543RyaQCY','config','✓\x20Authentication\x20successful\x0a','green','776268sYexTl','User:'];a47_0x503a=function(){return _0x687a09;};return a47_0x503a();}import a47_0x1999ba from'chalk';export class StatusCommand extends BaseCommand{[a47_0x1f5950(0x10e)]=a47_0x1f5950(0xfe);[a47_0x1f5950(0x107)]=a47_0x1f5950(0x101);async['execute'](_0x13426e){const _0x17f400=a47_0x1f5950,{options:_0x44a32,tdx:_0x12bd46}=_0x13426e,_0x27a751=_0x44a32['site'],_0x1b66f8=new GlobalContext(_0x44a32),_0x57301d=_0x1b66f8[_0x17f400(0x11a)],_0x532537=_0x1b66f8['profileSource'],_0x2fa5f8=_0x532537===_0x17f400(0x10d)?'CLI\x20flag':_0x532537===_0x17f400(0x120)?_0x17f400(0x120):_0x532537===_0x17f400(0x10f)?_0x17f400(0xfd):_0x532537==='config'?_0x17f400(0x115):null,_0x3d2f18=_0x57301d?a47_0x1999ba['cyan'](_0x57301d):a47_0x1999ba[_0x17f400(0x10b)](_0x17f400(0xfb)),_0x170ad5=_0x2fa5f8?'\x20'+a47_0x1999ba[_0x17f400(0x10b)]('(from\x20'+_0x2fa5f8+')'):'';console['log'](a47_0x1999ba[_0x17f400(0xf7)](_0x17f400(0x11c))+'\x20profile:\x20'+_0x3d2f18+_0x170ad5+'\x20'+a47_0x1999ba[_0x17f400(0x10b)]('(')+_0x17f400(0x106)+a47_0x1999ba[_0x17f400(0x11d)](_0x27a751)+a47_0x1999ba['dim'](')'));const _0x5184e8=await getOAuthTokens(_0x57301d);if(_0x5184e8)console[_0x17f400(0xff)](_0x17f400(0xf9)+a47_0x1999ba['cyan'](_0x17f400(0x105)));else{const _0x216e00=await resolveAPIKeyAsync(_0x27a751,_0x57301d);if(_0x216e00){const {source:_0x2007ba,isDeprecated:_0x1c34f6}=_0x216e00,_0x4608d2='Read\x20credential\x20from\x20'+a47_0x1999ba['cyan'](_0x2007ba);console[_0x17f400(0xff)](_0x1c34f6?a47_0x1999ba[_0x17f400(0x102)](_0x4608d2):_0x4608d2);}else console[_0x17f400(0xff)](a47_0x1999ba[_0x17f400(0x102)](_0x17f400(0xf8)));}let _0x9e01fe=![];try{const _0x268e1d=await _0x12bd46['jobs'][_0x17f400(0x10a)]();console[_0x17f400(0xff)](a47_0x1999ba[_0x17f400(0x117)](_0x17f400(0x116))),console['log'](a47_0x1999ba[_0x17f400(0xf7)](_0x17f400(0x119))+'\x20'+a47_0x1999ba[_0x17f400(0x11d)](_0x268e1d['email']));if(_0x268e1d[_0x17f400(0x113)]||_0x268e1d['last_name']){const _0x238b4b=[_0x268e1d[_0x17f400(0x113)],_0x268e1d[_0x17f400(0x110)]][_0x17f400(0x104)](Boolean)['join']('\x20');console[_0x17f400(0xff)](a47_0x1999ba[_0x17f400(0xf7)]('Name:')+'\x20'+_0x238b4b);}_0x268e1d[_0x17f400(0x108)]&&console[_0x17f400(0xff)](a47_0x1999ba['bold']('Account\x20ID:')+'\x20'+a47_0x1999ba[_0x17f400(0x102)](_0x268e1d[_0x17f400(0x108)])),_0x9e01fe=!![];}catch(_0xbc0ba0){_0xbc0ba0 instanceof HTTPClientError&&_0xbc0ba0['status']===0x191?printAuthError(_0xbc0ba0,!![],_0x57301d):console[_0x17f400(0x11e)](a47_0x1999ba[_0x17f400(0xfa)]('✗\x20Validation\x20failed:\x20'+(_0xbc0ba0 instanceof Error?_0xbc0ba0['message']:String(_0xbc0ba0))));}return console[_0x17f400(0xff)](),_0x1b66f8[_0x17f400(0x11f)](),_0x9e01fe?0x0:0x1;}}