@treasuredata/tdx 2026.3.29 → 2026.3.30

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 (203) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.js +1 -1
  5. package/dist/commands/activations.js +1 -1
  6. package/dist/commands/agent-command.js +1 -1
  7. package/dist/commands/agent-test-command.js +1 -1
  8. package/dist/commands/api-command.js +1 -1
  9. package/dist/commands/auth-command.js +1 -1
  10. package/dist/commands/auth-login-command.js +1 -1
  11. package/dist/commands/chat-command.js +1 -1
  12. package/dist/commands/claude-command.js +1 -1
  13. package/dist/commands/claude-statusline-command.js +1 -1
  14. package/dist/commands/claude-usage-command.js +1 -1
  15. package/dist/commands/command.js +1 -1
  16. package/dist/commands/connection-command.js +1 -1
  17. package/dist/commands/databases.js +1 -1
  18. package/dist/commands/delivery-command.js +1 -1
  19. package/dist/commands/describe.js +1 -1
  20. package/dist/commands/engage-campaign-pull-command.js +1 -1
  21. package/dist/commands/engage-campaign-push-command.js +1 -1
  22. package/dist/commands/engage-campaign-validate-command.js +1 -1
  23. package/dist/commands/engage-command.js +1 -1
  24. package/dist/commands/engage-template-pull-command.js +1 -1
  25. package/dist/commands/engage-template-push-command.js +1 -1
  26. package/dist/commands/engage-template-validate-command.js +1 -1
  27. package/dist/commands/job-command.js +1 -1
  28. package/dist/commands/journey-command.js +1 -1
  29. package/dist/commands/journey-validate-command.js +1 -1
  30. package/dist/commands/llm-command.js +1 -1
  31. package/dist/commands/mcp-command.js +1 -1
  32. package/dist/commands/parent-segment-command.js +1 -1
  33. package/dist/commands/policy-command.js +1 -1
  34. package/dist/commands/profile-command.js +1 -1
  35. package/dist/commands/profiles-command.js +1 -1
  36. package/dist/commands/query-command.js +1 -1
  37. package/dist/commands/schedule-command.js +1 -1
  38. package/dist/commands/segment-command.js +1 -1
  39. package/dist/commands/segment-create-command.js +1 -1
  40. package/dist/commands/segment-fields-command.js +1 -1
  41. package/dist/commands/segment-pull-command.js +1 -1
  42. package/dist/commands/segment-push-command.js +1 -1
  43. package/dist/commands/segment-update-command.js +1 -1
  44. package/dist/commands/segment-use-command.js +1 -1
  45. package/dist/commands/segment-validate-command.js +1 -1
  46. package/dist/commands/segments.js +1 -1
  47. package/dist/commands/show.js +1 -1
  48. package/dist/commands/status-command.js +1 -1
  49. package/dist/commands/tables.js +1 -1
  50. package/dist/commands/unset-command.js +1 -1
  51. package/dist/commands/upgrade-command.js +1 -1
  52. package/dist/commands/use-command.js +1 -1
  53. package/dist/commands/user-command.js +1 -1
  54. package/dist/commands/workflow-command.js +1 -1
  55. package/dist/core/auth.js +1 -1
  56. package/dist/core/command-output.js +1 -1
  57. package/dist/core/config.js +1 -1
  58. package/dist/core/connection-cache.js +1 -1
  59. package/dist/core/constants.js +1 -1
  60. package/dist/core/credential-cache.js +1 -1
  61. package/dist/core/global-context.js +1 -1
  62. package/dist/core/keychain.js +1 -1
  63. package/dist/core/oauth-keychain.js +1 -1
  64. package/dist/core/oauth.js +1 -1
  65. package/dist/core/profile.js +1 -1
  66. package/dist/core/project-config.js +1 -1
  67. package/dist/core/session.js +1 -1
  68. package/dist/core/user-cache.js +1 -1
  69. package/dist/core/version.js +1 -1
  70. package/dist/index.js +1 -1
  71. package/dist/mcp/server.js +1 -1
  72. package/dist/mcp/tools/index.js +1 -1
  73. package/dist/mcp/tools/tdx-run.js +1 -1
  74. package/dist/mcp/tools/tdx-search.js +1 -1
  75. package/dist/mcp/utils.js +1 -1
  76. package/dist/proxy/claude-usage-tracker.js +1 -1
  77. package/dist/proxy/passthrough-server.js +1 -1
  78. package/dist/proxy/sse-usage-parser.js +1 -1
  79. package/dist/sdk/agent/agent-config.js +1 -1
  80. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  81. package/dist/sdk/agent/agent-yaml.js +1 -1
  82. package/dist/sdk/agent/test/evaluator.js +1 -1
  83. package/dist/sdk/agent/test/executor.js +1 -1
  84. package/dist/sdk/agent/test/index.js +1 -1
  85. package/dist/sdk/agent/test/output.js +1 -1
  86. package/dist/sdk/agent/test/parser.js +1 -1
  87. package/dist/sdk/agent/tool-target-registry.js +1 -1
  88. package/dist/sdk/api.js +1 -1
  89. package/dist/sdk/client/cdp-api-client.js +1 -1
  90. package/dist/sdk/client/delivery-api-client.js +1 -1
  91. package/dist/sdk/client/endpoints.js +1 -1
  92. package/dist/sdk/client/engage-api-client.js +1 -1
  93. package/dist/sdk/client/http-client.js +1 -1
  94. package/dist/sdk/client/llm-api-client.js +1 -1
  95. package/dist/sdk/client/oauth-refresh.js +1 -1
  96. package/dist/sdk/client/rate-limiter.js +1 -1
  97. package/dist/sdk/client/td-api-client.js +1 -1
  98. package/dist/sdk/client/trino-api-client.js +1 -1
  99. package/dist/sdk/client/workflow-client.js +1 -1
  100. package/dist/sdk/connection-validator.js +1 -1
  101. package/dist/sdk/connection.js +1 -1
  102. package/dist/sdk/delivery.js +1 -1
  103. package/dist/sdk/engage/campaign-pull.js +1 -1
  104. package/dist/sdk/engage/campaign-push.js +1 -1
  105. package/dist/sdk/engage/campaign-validator.js +1 -1
  106. package/dist/sdk/engage/campaign-yaml.js +1 -1
  107. package/dist/sdk/engage/template-pull.js +1 -1
  108. package/dist/sdk/engage/template-push.js +1 -1
  109. package/dist/sdk/engage/template-validator.js +1 -1
  110. package/dist/sdk/engage/template-yaml.js +1 -1
  111. package/dist/sdk/engage/types/campaign-def.js +1 -1
  112. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  113. package/dist/sdk/engage/types/template-schema.js +1 -1
  114. package/dist/sdk/engage.js +1 -1
  115. package/dist/sdk/errors.js +1 -1
  116. package/dist/sdk/index.js +1 -1
  117. package/dist/sdk/io/index.js +1 -1
  118. package/dist/sdk/io/node-filesystem.js +1 -1
  119. package/dist/sdk/job.js +1 -1
  120. package/dist/sdk/journey.js +1 -1
  121. package/dist/sdk/llm/chat-cache.js +1 -1
  122. package/dist/sdk/llm/index.js +1 -1
  123. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  124. package/dist/sdk/llm/model-factors.js +1 -1
  125. package/dist/sdk/personalization.js +1 -1
  126. package/dist/sdk/policy.js +1 -1
  127. package/dist/sdk/query/index.js +1 -1
  128. package/dist/sdk/query/sql-parser.js +1 -1
  129. package/dist/sdk/realtime.js +1 -1
  130. package/dist/sdk/schedule.js +1 -1
  131. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  132. package/dist/sdk/segment/fields-display.js +1 -1
  133. package/dist/sdk/segment/file-discovery.js +1 -1
  134. package/dist/sdk/segment/journey-utils.js +1 -1
  135. package/dist/sdk/segment/journey-validator.js +1 -1
  136. package/dist/sdk/segment/journey-yaml.js +1 -1
  137. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  138. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  139. package/dist/sdk/segment/pull-workflow.js +1 -1
  140. package/dist/sdk/segment/push-recovery.js +1 -1
  141. package/dist/sdk/segment/push-workflow.js +1 -1
  142. package/dist/sdk/segment/resolution-context.js +1 -1
  143. package/dist/sdk/segment/segment-path-parser.js +1 -1
  144. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  145. package/dist/sdk/segment/segment-validator.js +1 -1
  146. package/dist/sdk/segment/target-resolution.js +1 -1
  147. package/dist/sdk/segment/tdx-config.js +1 -1
  148. package/dist/sdk/segment/types/activation-schema.js +1 -1
  149. package/dist/sdk/segment/types/journey-def.js +1 -1
  150. package/dist/sdk/segment/types/journey-schema.js +1 -1
  151. package/dist/sdk/segment/types/segment-def.js +1 -1
  152. package/dist/sdk/segment/types/segment-schema.js +1 -1
  153. package/dist/sdk/segment/validate-files.js +1 -1
  154. package/dist/sdk/segment/yaml-validator.js +1 -1
  155. package/dist/sdk/segment.js +1 -1
  156. package/dist/sdk/types/index.js +1 -1
  157. package/dist/sdk/types/progress.js +1 -1
  158. package/dist/sdk/user.js +1 -1
  159. package/dist/sdk/util/format-detector.js +1 -1
  160. package/dist/sdk/util/formatters.js +1 -1
  161. package/dist/sdk/util/index.js +1 -1
  162. package/dist/sdk/util/paginate.js +1 -1
  163. package/dist/sdk/util/tree-formatter.js +1 -1
  164. package/dist/sdk/workflow/archive-validation.js +1 -1
  165. package/dist/sdk/workflow/clone-workflow.js +1 -1
  166. package/dist/sdk/workflow/index.js +1 -1
  167. package/dist/sdk/workflow/pull-workflow.js +1 -1
  168. package/dist/sdk/workflow/push-workflow.js +1 -1
  169. package/dist/sdk/workflow/tdx-config.js +1 -1
  170. package/dist/sdk/workflow/workflow-utils.js +1 -1
  171. package/dist/test-utils/command-runner.js +1 -1
  172. package/dist/test-utils/factories.js +1 -1
  173. package/dist/test-utils/fixtures.js +1 -1
  174. package/dist/test-utils/http-mock.js +1 -1
  175. package/dist/test-utils/index.js +1 -1
  176. package/dist/utils/async.js +1 -1
  177. package/dist/utils/colors.js +1 -1
  178. package/dist/utils/diff.js +1 -1
  179. package/dist/utils/file-permissions.js +1 -1
  180. package/dist/utils/file-reader.js +1 -1
  181. package/dist/utils/github-releases.js +1 -1
  182. package/dist/utils/global-cache.js +1 -1
  183. package/dist/utils/json-loader.js +1 -1
  184. package/dist/utils/local-cache.js +1 -1
  185. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  186. package/dist/utils/logger/formatters/index.js +1 -1
  187. package/dist/utils/logger/handlers/console-handler.js +1 -1
  188. package/dist/utils/logger/handlers/file-handler.js +1 -1
  189. package/dist/utils/logger/handlers/index.js +1 -1
  190. package/dist/utils/logger/handlers/null-handler.js +1 -1
  191. package/dist/utils/logger/index.js +1 -1
  192. package/dist/utils/logger/logger.js +1 -1
  193. package/dist/utils/logger/types.js +1 -1
  194. package/dist/utils/option-validation.js +1 -1
  195. package/dist/utils/process.js +1 -1
  196. package/dist/utils/prompt.js +1 -1
  197. package/dist/utils/spinner.js +1 -1
  198. package/dist/utils/sse-parser.js +1 -1
  199. package/dist/utils/string-utils.js +1 -1
  200. package/dist/utils/table-ref-parser.js +1 -1
  201. package/dist/utils/tdx-logger.js +1 -1
  202. package/dist/utils/version-check.js +1 -1
  203. package/package.json +1 -1
@@ -1 +1 @@
1
- const a39_0x1d3919=a39_0x6443;(function(_0x39c4ab,_0x35996f){const _0x3adc40=a39_0x6443,_0x3c3a02=_0x39c4ab();while(!![]){try{const _0x1526d4=parseInt(_0x3adc40(0x108))/0x1+parseInt(_0x3adc40(0x12a))/0x2+-parseInt(_0x3adc40(0x117))/0x3*(parseInt(_0x3adc40(0x119))/0x4)+-parseInt(_0x3adc40(0x104))/0x5*(parseInt(_0x3adc40(0x135))/0x6)+-parseInt(_0x3adc40(0x101))/0x7+parseInt(_0x3adc40(0x130))/0x8+-parseInt(_0x3adc40(0x120))/0x9;if(_0x1526d4===_0x35996f)break;else _0x3c3a02['push'](_0x3c3a02['shift']());}catch(_0x3ed14b){_0x3c3a02['push'](_0x3c3a02['shift']());}}}(a39_0x3086,0x7de05));function a39_0x3086(){const _0x3e1221=['error','helpText','\x20unchanged\x20files','relativePath','\x20files\x20to\x20','✔\x20Context\x20set:\x20','yes','counts','✔\x20All\x20files\x20are\x20up\x20to\x20date','errorCode','utf-8','name','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','-\x20no\x20files\x20written','45kFkiOK','segment','152696iQPfNn','targetDir','session','repeat','filter','\x20\x20🗺️\x20\x20','Write\x20','294813cvIexH','parentSegment','Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files','description','Aborted.','yellow','parent_segment','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent','journeys','activations','1331882ITpiKX','absolutePath','\x20files?','journeyVersions','site','hasChanges','7992176rGRJcR','pullSegments','\x20new\x20files','\x0aPull\x20summary\x20for\x20\x27','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','366054BmIXKd','green','files','Pulling\x20segments\x20from\x20\x27','isNew','content','\x20with\x20','segments','red','No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27','resourceName','\x20=\x20','Usage:\x20tdx\x20sg\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20(requires\x20context\x20or\x20tdx.json)','✔\x20Pulled\x20','\x20segments','\x20\x20Target:\x20','message','parentName','\x20changed\x20files','Error:\x20','length','execute','Site:\x20','cyan','dim','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','7037044aDRFLf','diff','verbose','5HVsgId','no_parent','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file','522294lzlJmb'];a39_0x3086=function(){return _0x3e1221;};return a39_0x3086();}import{BaseCommand}from'./command.js';function a39_0x6443(_0x4a1d77,_0x2db33b){_0x4a1d77=_0x4a1d77-0xfb;const _0x3086a4=a39_0x3086();let _0x644372=_0x3086a4[_0x4a1d77];return _0x644372;}import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{saveSessionContext}from'../core/session.js';import a39_0x598b3e from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';import a39_0x73862e 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{[a39_0x1d3919(0x114)]='segment:pull';[a39_0x1d3919(0x123)]=a39_0x1d3919(0x122);async[a39_0x1d3919(0xfc)](_0x55aa1c){const _0xcfb361=a39_0x1d3919,{options:_0x3c6448,args:_0x1459d7,tdx:_0x52f4ee}=_0x55aa1c,_0xad67bd=_0x3c6448,_0x495aa1=await resolveTarget({'arg':_0x1459d7[0x0],'contextParent':_0x3c6448[_0xcfb361(0x121)],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x495aa1))return _0x495aa1[_0xcfb361(0x112)]===_0xcfb361(0x105)?(console[_0xcfb361(0x109)](a39_0x598b3e['yellow'](_0xcfb361(0x106))),console[_0xcfb361(0x109)](_0xcfb361(0x141)),console['error'](_0xcfb361(0x127)),console['error'](_0xcfb361(0x107))):(console[_0xcfb361(0x109)](a39_0x598b3e[_0xcfb361(0x13d)](_0xcfb361(0x148)+_0x495aa1[_0xcfb361(0x145)]+'\x0a')),_0x495aa1[_0xcfb361(0x10a)]&&console['error'](a39_0x598b3e[_0xcfb361(0xfe)](_0x495aa1[_0xcfb361(0x10a)]))),0x1;const _0x32a4a0=_0x495aa1[_0xcfb361(0x146)],_0xe0fe5e=_0x495aa1[_0xcfb361(0x11a)],_0x30c553=_0x495aa1['type']==='file'?_0x495aa1[_0xcfb361(0x13f)]:undefined;_0xad67bd[_0xcfb361(0x103)]&&(console[_0xcfb361(0x109)](_0xcfb361(0xfd)+_0xad67bd[_0xcfb361(0x12e)]),console[_0xcfb361(0x109)]('Parent\x20segment:\x20'+_0x32a4a0),_0x30c553&&console[_0xcfb361(0x109)]('Target\x20resource:\x20'+_0x30c553));const _0x2c59b7=await withProgressSpinner(_0xcfb361(0x138)+_0x32a4a0+'\x27...',_0x578e2c=>_0x52f4ee[_0xcfb361(0x118)][_0xcfb361(0x131)](_0x32a4a0,{'targetDir':_0xe0fe5e,'targetResourceName':_0x30c553,'verbose':_0xad67bd['verbose'],'progress':{'update':_0x10652b=>{const _0x32e856=_0xcfb361;_0x578e2c['setPhase'](_0x10652b),_0xad67bd[_0x32e856(0x103)]&&console['error']('\x20\x20'+_0x10652b);}}}),{'verbose':_0xad67bd[_0xcfb361(0x103)]}),_0x36fdce=_0x2c59b7['data'];if(_0x36fdce[_0xcfb361(0x110)][_0xcfb361(0x13c)]===0x0&&_0x36fdce[_0xcfb361(0x110)][_0xcfb361(0x128)]===0x0)return console[_0xcfb361(0x109)](a39_0x598b3e[_0xcfb361(0x125)](_0xcfb361(0x13e)+_0x36fdce[_0xcfb361(0x146)]+'\x27')),0x0;const _0x335f2e=_0x36fdce['files']['filter'](_0x2e638a=>_0x2e638a['isNew']),_0x4bf40c=_0x36fdce['files'][_0xcfb361(0x11d)](_0x106f4c=>!_0x106f4c[_0xcfb361(0x139)]&&_0x106f4c[_0xcfb361(0x12f)]),_0x2a342d=_0x36fdce['files'][_0xcfb361(0x11d)](_0x4b5f07=>!_0x4b5f07[_0xcfb361(0x139)]&&!_0x4b5f07['hasChanges']);console[_0xcfb361(0x109)](_0xcfb361(0x133)+_0x36fdce[_0xcfb361(0x146)]+'\x27:'),console['error']('\x20\x20🎯\x20'+a39_0x598b3e['cyan'](_0x36fdce[_0xcfb361(0x110)][_0xcfb361(0x13c)]+_0xcfb361(0x143))+_0xcfb361(0x13b)+a39_0x598b3e[_0xcfb361(0xfe)](_0x36fdce[_0xcfb361(0x110)][_0xcfb361(0x129)]+'\x20activations'));if(_0x36fdce[_0xcfb361(0x110)][_0xcfb361(0x128)]>0x0){const _0x514a1d=_0x36fdce[_0xcfb361(0x110)][_0xcfb361(0x12d)]>_0x36fdce['counts'][_0xcfb361(0x128)]?'\x20('+_0x36fdce[_0xcfb361(0x110)][_0xcfb361(0x12d)]+'\x20versions)':'';console[_0xcfb361(0x109)](_0xcfb361(0x11e)+a39_0x598b3e[_0xcfb361(0xfe)](_0x36fdce[_0xcfb361(0x110)][_0xcfb361(0x128)]+'\x20journeys')+a39_0x598b3e[_0xcfb361(0xff)](_0x514a1d));}console['error']('\x20\x20'+a39_0x598b3e['green']('+\x20'+_0x335f2e[_0xcfb361(0xfb)]+_0xcfb361(0x132))),console[_0xcfb361(0x109)]('\x20\x20'+a39_0x598b3e[_0xcfb361(0x125)]('~\x20'+_0x4bf40c[_0xcfb361(0xfb)]+_0xcfb361(0x147))),console[_0xcfb361(0x109)]('\x20\x20'+a39_0x598b3e['dim']('=\x20'+_0x2a342d[_0xcfb361(0xfb)]+_0xcfb361(0x10b))),console[_0xcfb361(0x109)](_0xcfb361(0x144)+a39_0x598b3e['cyan'](_0x36fdce['targetDir'])+'\x0a');if(_0x4bf40c[_0xcfb361(0xfb)]>0x0)for(const _0x576b00 of _0x4bf40c){console[_0xcfb361(0x109)]('\x0aChanges\x20to\x20\x27'+_0x576b00[_0xcfb361(0x10c)]+'\x27:'),console[_0xcfb361(0x109)]('─'[_0xcfb361(0x11c)](0x3c)),console['error'](_0x576b00[_0xcfb361(0x102)]),console[_0xcfb361(0x109)]('─'['repeat'](0x3c));}if(_0xad67bd['dryRun'])return console[_0xcfb361(0x109)](a39_0x598b3e[_0xcfb361(0x125)](_0xcfb361(0x134))),0x0;if(_0x335f2e[_0xcfb361(0xfb)]===0x0&&_0x4bf40c['length']===0x0)return console[_0xcfb361(0x109)](a39_0x598b3e[_0xcfb361(0x136)](_0xcfb361(0x111))),saveSessionContext({'parent_segment':_0x36fdce[_0xcfb361(0x146)]},_0xad67bd[_0xcfb361(0x11b)]),console['error'](a39_0x598b3e[_0xcfb361(0x136)]('✔\x20Context\x20set:\x20'+a39_0x598b3e[_0xcfb361(0xff)](_0xcfb361(0x126))+_0xcfb361(0x140)+a39_0x598b3e[_0xcfb361(0xfe)](_0x36fdce[_0xcfb361(0x146)]))),0x0;if(!_0xad67bd[_0xcfb361(0x10f)]){if(!isInteractive())return console[_0xcfb361(0x109)](a39_0x598b3e[_0xcfb361(0x13d)]('\x0aError:'),_0xcfb361(0x100)),console[_0xcfb361(0x109)](a39_0x598b3e['dim'](_0xcfb361(0x115))),0x1;const _0x46ee57=await confirmKey(_0xcfb361(0x11f)+(_0x335f2e[_0xcfb361(0xfb)]+_0x4bf40c[_0xcfb361(0xfb)])+_0xcfb361(0x12c));if(!_0x46ee57)return console[_0xcfb361(0x109)](a39_0x598b3e['yellow'](_0xcfb361(0x124)),_0xcfb361(0x116)),0x1;}for(const _0x3a241e of _0x36fdce[_0xcfb361(0x137)]){if(_0x3a241e[_0xcfb361(0x139)]||_0x3a241e['hasChanges']){const _0x5df194=a39_0x73862e['dirname'](_0x3a241e['absolutePath']);!existsSync(_0x5df194)&&mkdirSync(_0x5df194,{'recursive':!![]}),writeFileSync(_0x3a241e[_0xcfb361(0x12b)],_0x3a241e[_0xcfb361(0x13a)],_0xcfb361(0x113));}}return console[_0xcfb361(0x109)](a39_0x598b3e[_0xcfb361(0x136)](_0xcfb361(0x142)+(_0x335f2e['length']+_0x4bf40c[_0xcfb361(0xfb)])+_0xcfb361(0x10d)+_0x36fdce[_0xcfb361(0x11a)])),saveSessionContext({'parent_segment':_0x36fdce[_0xcfb361(0x146)]},_0xad67bd[_0xcfb361(0x11b)]),console['error'](a39_0x598b3e[_0xcfb361(0x136)](_0xcfb361(0x10e)+a39_0x598b3e[_0xcfb361(0xff)]('parent_segment')+_0xcfb361(0x140)+a39_0x598b3e[_0xcfb361(0xfe)](_0x36fdce[_0xcfb361(0x146)]))),0x0;}}
1
+ const a39_0x334ee0=a39_0x3891;(function(_0x18b918,_0x394685){const _0x4d00bc=a39_0x3891,_0x2f8c3a=_0x18b918();while(!![]){try{const _0x3870ae=-parseInt(_0x4d00bc(0x12e))/0x1+parseInt(_0x4d00bc(0x131))/0x2*(-parseInt(_0x4d00bc(0x15c))/0x3)+-parseInt(_0x4d00bc(0x141))/0x4*(parseInt(_0x4d00bc(0x153))/0x5)+parseInt(_0x4d00bc(0x146))/0x6*(parseInt(_0x4d00bc(0x13d))/0x7)+parseInt(_0x4d00bc(0x148))/0x8*(parseInt(_0x4d00bc(0x11f))/0x9)+-parseInt(_0x4d00bc(0x140))/0xa*(-parseInt(_0x4d00bc(0x13f))/0xb)+-parseInt(_0x4d00bc(0x14f))/0xc*(-parseInt(_0x4d00bc(0x112))/0xd);if(_0x3870ae===_0x394685)break;else _0x2f8c3a['push'](_0x2f8c3a['shift']());}catch(_0x184a40){_0x2f8c3a['push'](_0x2f8c3a['shift']());}}}(a39_0x4557,0x1e29f));function a39_0x4557(){const _0x44cbb7=['13445UXswZv','errorCode','parentName','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file','journeys','pullSegments','resourceName','helpText','\x20with\x20','3NGSMaq','session','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)','execute','\x0aChanges\x20to\x20\x27','segment:pull','error','dirname','setPhase','cwd','13TSZAPX','\x20\x20🎯\x20','-\x20no\x20files\x20written','file','parentSegment','✔\x20All\x20files\x20are\x20up\x20to\x20date','name','segments','verbose','No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27','\x20unchanged\x20files','\x20=\x20','dim','9NfSGYu','Parent\x20segment:\x20','\x20files?','\x20activations','data','journeyVersions','activations','hasChanges','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','red','files','parent_segment','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','\x20\x20Target:\x20','dryRun','73291YgHMPd','filter','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','168326ACQidS','cyan','green','\x20\x20🗺️\x20\x20','absolutePath','\x0aError:','site','Pulling\x20segments\x20from\x20\x27','message','isNew','utf-8','relativePath','301882RKpluf','\x20new\x20files','1881QBqFUD','2990rwfFvW','168COksbM','Error:\x20','yes','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent','\x20segments','6TpCyqp','description','1635416BSKNzu','targetDir','Target\x20resource:\x20','type','yellow','counts','\x0aPull\x20summary\x20for\x20\x27','1143132zoMjnu','segment','repeat','length'];a39_0x4557=function(){return _0x44cbb7;};return a39_0x4557();}function a39_0x3891(_0x277103,_0xd0dea9){_0x277103=_0x277103-0x111;const _0x455798=a39_0x4557();let _0x3891c1=_0x455798[_0x277103];return _0x3891c1;}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 a39_0x1bb356 from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';import a39_0x5462f5 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{[a39_0x334ee0(0x118)]=a39_0x334ee0(0x161);[a39_0x334ee0(0x147)]='Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files';async[a39_0x334ee0(0x15f)](_0x330ddf){const _0x3d4508=a39_0x334ee0,{options:_0x436fb5,args:_0x3e1063,tdx:_0x34df4a}=_0x330ddf,_0xe5be=_0x436fb5,_0x953599=await resolveTarget({'arg':_0x3e1063[0x0],'contextParent':_0x436fb5[_0x3d4508(0x116)],'cwd':process[_0x3d4508(0x111)]()});if(!isSuccessfulResolution(_0x953599))return _0x953599[_0x3d4508(0x154)]==='no_parent'?(console[_0x3d4508(0x162)](a39_0x1bb356['yellow'](_0x3d4508(0x127))),console['error'](_0x3d4508(0x15e)),console[_0x3d4508(0x162)](_0x3d4508(0x144)),console['error'](_0x3d4508(0x156))):(console['error'](a39_0x1bb356[_0x3d4508(0x128)](_0x3d4508(0x142)+_0x953599[_0x3d4508(0x139)]+'\x0a')),_0x953599[_0x3d4508(0x15a)]&&console[_0x3d4508(0x162)](a39_0x1bb356[_0x3d4508(0x132)](_0x953599[_0x3d4508(0x15a)]))),0x1;const _0x379e10=_0x953599[_0x3d4508(0x155)],_0x12ccaf=_0x953599[_0x3d4508(0x149)],_0x308426=_0x953599[_0x3d4508(0x14b)]===_0x3d4508(0x115)?_0x953599[_0x3d4508(0x159)]:undefined;_0xe5be[_0x3d4508(0x11a)]&&(console[_0x3d4508(0x162)]('Site:\x20'+_0xe5be[_0x3d4508(0x137)]),console['error'](_0x3d4508(0x120)+_0x379e10),_0x308426&&console[_0x3d4508(0x162)](_0x3d4508(0x14a)+_0x308426));const _0x1567d1=await withProgressSpinner(_0x3d4508(0x138)+_0x379e10+'\x27...',_0x396c85=>_0x34df4a[_0x3d4508(0x150)][_0x3d4508(0x158)](_0x379e10,{'targetDir':_0x12ccaf,'targetResourceName':_0x308426,'verbose':_0xe5be[_0x3d4508(0x11a)],'progress':{'update':_0x903cb9=>{const _0x2ccb60=_0x3d4508;_0x396c85[_0x2ccb60(0x164)](_0x903cb9),_0xe5be[_0x2ccb60(0x11a)]&&console[_0x2ccb60(0x162)]('\x20\x20'+_0x903cb9);}}}),{'verbose':_0xe5be[_0x3d4508(0x11a)]}),_0x5bd5a8=_0x1567d1[_0x3d4508(0x123)];if(_0x5bd5a8[_0x3d4508(0x14d)][_0x3d4508(0x119)]===0x0&&_0x5bd5a8[_0x3d4508(0x14d)]['journeys']===0x0)return console[_0x3d4508(0x162)](a39_0x1bb356[_0x3d4508(0x14c)](_0x3d4508(0x11b)+_0x5bd5a8['parentName']+'\x27')),0x0;const _0x217ac3=_0x5bd5a8[_0x3d4508(0x129)][_0x3d4508(0x12f)](_0x5e5280=>_0x5e5280[_0x3d4508(0x13a)]),_0x2400d6=_0x5bd5a8[_0x3d4508(0x129)][_0x3d4508(0x12f)](_0x43e25f=>!_0x43e25f[_0x3d4508(0x13a)]&&_0x43e25f['hasChanges']),_0x14b305=_0x5bd5a8[_0x3d4508(0x129)][_0x3d4508(0x12f)](_0x3d5db8=>!_0x3d5db8[_0x3d4508(0x13a)]&&!_0x3d5db8[_0x3d4508(0x126)]);console[_0x3d4508(0x162)](_0x3d4508(0x14e)+_0x5bd5a8[_0x3d4508(0x155)]+'\x27:'),console[_0x3d4508(0x162)](_0x3d4508(0x113)+a39_0x1bb356[_0x3d4508(0x132)](_0x5bd5a8[_0x3d4508(0x14d)][_0x3d4508(0x119)]+_0x3d4508(0x145))+_0x3d4508(0x15b)+a39_0x1bb356[_0x3d4508(0x132)](_0x5bd5a8[_0x3d4508(0x14d)][_0x3d4508(0x125)]+_0x3d4508(0x122)));if(_0x5bd5a8[_0x3d4508(0x14d)][_0x3d4508(0x157)]>0x0){const _0x39ab8c=_0x5bd5a8['counts']['journeyVersions']>_0x5bd5a8[_0x3d4508(0x14d)][_0x3d4508(0x157)]?'\x20('+_0x5bd5a8[_0x3d4508(0x14d)][_0x3d4508(0x124)]+'\x20versions)':'';console[_0x3d4508(0x162)](_0x3d4508(0x134)+a39_0x1bb356[_0x3d4508(0x132)](_0x5bd5a8[_0x3d4508(0x14d)][_0x3d4508(0x157)]+'\x20journeys')+a39_0x1bb356['dim'](_0x39ab8c));}console['error']('\x20\x20'+a39_0x1bb356['green']('+\x20'+_0x217ac3[_0x3d4508(0x152)]+_0x3d4508(0x13e))),console[_0x3d4508(0x162)]('\x20\x20'+a39_0x1bb356[_0x3d4508(0x14c)]('~\x20'+_0x2400d6[_0x3d4508(0x152)]+'\x20changed\x20files')),console[_0x3d4508(0x162)]('\x20\x20'+a39_0x1bb356[_0x3d4508(0x11e)]('=\x20'+_0x14b305[_0x3d4508(0x152)]+_0x3d4508(0x11c))),console[_0x3d4508(0x162)](_0x3d4508(0x12c)+a39_0x1bb356[_0x3d4508(0x132)](_0x5bd5a8[_0x3d4508(0x149)])+'\x0a');if(_0x2400d6[_0x3d4508(0x152)]>0x0)for(const _0x4b8513 of _0x2400d6){console[_0x3d4508(0x162)](_0x3d4508(0x160)+_0x4b8513[_0x3d4508(0x13c)]+'\x27:'),console[_0x3d4508(0x162)]('─'[_0x3d4508(0x151)](0x3c)),console['error'](_0x4b8513['diff']),console[_0x3d4508(0x162)]('─'['repeat'](0x3c));}if(_0xe5be[_0x3d4508(0x12d)])return console[_0x3d4508(0x162)](a39_0x1bb356['yellow']('\x0a[Dry\x20run]\x20No\x20files\x20were\x20written')),0x0;if(_0x217ac3[_0x3d4508(0x152)]===0x0&&_0x2400d6[_0x3d4508(0x152)]===0x0)return console[_0x3d4508(0x162)](a39_0x1bb356[_0x3d4508(0x133)](_0x3d4508(0x117))),saveSessionContext({'parent_segment':_0x5bd5a8['parentName']},_0xe5be[_0x3d4508(0x15d)]),console['error'](a39_0x1bb356[_0x3d4508(0x133)]('✔\x20Context\x20set:\x20'+a39_0x1bb356[_0x3d4508(0x11e)]('parent_segment')+_0x3d4508(0x11d)+a39_0x1bb356[_0x3d4508(0x132)](_0x5bd5a8['parentName']))),0x0;if(!_0xe5be[_0x3d4508(0x143)]){if(!isInteractive())return console['error'](a39_0x1bb356['red'](_0x3d4508(0x136)),_0x3d4508(0x130)),console[_0x3d4508(0x162)](a39_0x1bb356[_0x3d4508(0x11e)](_0x3d4508(0x12b))),0x1;const _0x5680e0=await confirmKey('Write\x20'+(_0x217ac3[_0x3d4508(0x152)]+_0x2400d6[_0x3d4508(0x152)])+_0x3d4508(0x121));if(!_0x5680e0)return console[_0x3d4508(0x162)](a39_0x1bb356[_0x3d4508(0x14c)]('Aborted.'),_0x3d4508(0x114)),0x1;}for(const _0x7bfb88 of _0x5bd5a8[_0x3d4508(0x129)]){if(_0x7bfb88[_0x3d4508(0x13a)]||_0x7bfb88[_0x3d4508(0x126)]){const _0x417541=a39_0x5462f5[_0x3d4508(0x163)](_0x7bfb88[_0x3d4508(0x135)]);!existsSync(_0x417541)&&mkdirSync(_0x417541,{'recursive':!![]}),writeFileSync(_0x7bfb88['absolutePath'],_0x7bfb88['content'],_0x3d4508(0x13b));}}return console[_0x3d4508(0x162)](a39_0x1bb356[_0x3d4508(0x133)]('✔\x20Pulled\x20'+(_0x217ac3[_0x3d4508(0x152)]+_0x2400d6[_0x3d4508(0x152)])+'\x20files\x20to\x20'+_0x5bd5a8[_0x3d4508(0x149)])),saveSessionContext({'parent_segment':_0x5bd5a8[_0x3d4508(0x155)]},_0xe5be['session']),console[_0x3d4508(0x162)](a39_0x1bb356[_0x3d4508(0x133)]('✔\x20Context\x20set:\x20'+a39_0x1bb356[_0x3d4508(0x11e)](_0x3d4508(0x12a))+_0x3d4508(0x11d)+a39_0x1bb356['cyan'](_0x5bd5a8[_0x3d4508(0x155)]))),0x0;}}
@@ -1 +1 @@
1
- const a40_0x3b97bb=a40_0x584d;(function(_0x1407de,_0x47e359){const _0x3d104e=a40_0x584d,_0x2c8169=_0x1407de();while(!![]){try{const _0x12564c=parseInt(_0x3d104e(0xe4))/0x1+-parseInt(_0x3d104e(0x135))/0x2+parseInt(_0x3d104e(0xf7))/0x3*(parseInt(_0x3d104e(0x11d))/0x4)+-parseInt(_0x3d104e(0x12c))/0x5+parseInt(_0x3d104e(0xf0))/0x6+-parseInt(_0x3d104e(0xf2))/0x7+parseInt(_0x3d104e(0x120))/0x8;if(_0x12564c===_0x47e359)break;else _0x2c8169['push'](_0x2c8169['shift']());}catch(_0x470c30){_0x2c8169['push'](_0x2c8169['shift']());}}}(a40_0x372c,0xda6c7));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 a40_0x1cabe2 from'chalk';import{existsSync}from'fs';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';function a40_0x584d(_0xd35120,_0x7289d5){_0xd35120=_0xd35120-0xcf;const _0x372c64=a40_0x372c();let _0x584d5b=_0x372c64[_0xd35120];return _0x584d5b;}function a40_0x372c(){const _0x35243d=['parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','changed','toDelete','toUpdate','audienceId','results','Error:\x20Directory\x20not\x20found:\x20','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','relationships','\x20new','green','Error\x20parsing\x20YAML:\x20','segment','dim','map','\x20deleted','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','new','delete','toCreate','/e/','cwd','set','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','blue','add','existingJourney','no_parent','Fetching\x20existing\x20data...','/sb/da/esr','\x20unchanged','error','journeyBundleName','Parent\x20segment:\x20','message','New\x20journey:','journeyBundleId','Folders\x20to\x20create:','targetDir','folderPath','existingSegment','updatedAt','39000mhoJZq','yamlConfig','connection','idToName','diff','buildUserMaps','\x0aError:','filter','\x20\x20🗺️\x20\x20Journeys:','unchanged','state','journeys','5146014HAUjCw','repeat','12098051uywWNX','\x0aPush\x20summary\x20for\x20\x27','parent_name','file','segment:push','57ajzAih','errorCode','\x27...','parentSegment','helpText','\x0aValidation\x20failed:','user','\x20\x20Segments:\x20','\x0a✔\x20Push\x20complete','listSegments','\x20\x20Source:\x20','yellow','endsWith','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','.yaml','\x20created','getParent','segments','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','activations','resolveParentId','nameToType','Changes\x20to\x20journey:','(Journey\x20will\x20be\x20deleted)','description','listJourneysWithDetailsFromParentSegment','join','site','nameToId','\x20\x20Journeys:\x20','cyan','\x20to\x20update','segmentFolderId','\x20changes?','\x20activations]','get','createdSegmentIds','folders','97772eQwsdV','/j/da/je','Error:\x20','20072520obVAEf','journey','parentFolder','scopedFolderPath','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','yes','push','\x20to\x20create','updated','createdAt','created','Aborted.','2742920SNVlhV','Preparing\x20journeys...','\x20to\x20delete','deleted','getOutputSchemaWithCache','red','folderId','execute','list','1397222CYiCNs','\x20changed','journeyId','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','\x20\x20Activations:\x20','journeysOnly','\x20\x20\x20\x20','\x20YAML\x20files\x20found','listActivations','\x20updated','Fetching\x20connections\x20for\x20name\x20resolution...','length','data','then','isNew','Push\x20','Delete\x20segment:','parentName','all','attributes','paused','verbose','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','type','\x20\x20📊\x20Segments:','Site:\x20','\x20folders\x20to\x20create','\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20','name','/app/ps/','isScoped'];a40_0x372c=function(){return _0x35243d;};return a40_0x372c();}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{['name']=a40_0x3b97bb(0xf6);['description']=a40_0x3b97bb(0x165);async[a40_0x3b97bb(0x133)](_0x513747){const _0x2c20f0=a40_0x3b97bb,{options:_0x3d184b,args:_0x4d5483,tdx:_0x557ce8}=_0x513747,_0x4d607b=_0x3d184b,_0x3827b2=await resolveTarget({'arg':_0x4d5483[0x0],'contextParent':_0x3d184b[_0x2c20f0(0xfa)],'cwd':process[_0x2c20f0(0xcf)]()});if(!isSuccessfulResolution(_0x3827b2))return _0x3827b2[_0x2c20f0(0xf8)]===_0x2c20f0(0xd5)?(console['error'](a40_0x1cabe2['yellow'](_0x2c20f0(0x154))),console[_0x2c20f0(0xd9)]('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)'),console[_0x2c20f0(0xd9)](_0x2c20f0(0x138)),console['error']('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file')):(console[_0x2c20f0(0xd9)](a40_0x1cabe2[_0x2c20f0(0x131)](_0x2c20f0(0x11f)+_0x3827b2[_0x2c20f0(0xdc)]+'\x0a')),_0x3827b2[_0x2c20f0(0xfb)]&&console[_0x2c20f0(0xd9)](a40_0x1cabe2[_0x2c20f0(0x115)](_0x3827b2[_0x2c20f0(0xfb)]))),0x1;if(_0x3827b2['type']===_0x2c20f0(0xf4))return console['error'](a40_0x1cabe2[_0x2c20f0(0x131)]('Error:\x20Directory\x20not\x20found:\x20'+_0x3827b2[_0x2c20f0(0xe0)]+'\x0a')),console['error'](a40_0x1cabe2[_0x2c20f0(0x115)]('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;const _0x335dd5=_0x3827b2[_0x2c20f0(0x146)],_0x2b94e8=_0x3827b2[_0x2c20f0(0xe0)],_0x95b67=_0x3827b2[_0x2c20f0(0x14c)]===_0x2c20f0(0xf5)?_0x3827b2['filePath']:undefined,_0x4f2b7e=getScopedDetails(_0x3827b2),_0x32d3e3=_0x4f2b7e?.[_0x2c20f0(0x153)]??![],_0x43daab=_0x4f2b7e?.[_0x2c20f0(0x123)]??'';if(!existsSync(_0x2b94e8))return console[_0x2c20f0(0xd9)](a40_0x1cabe2['red'](_0x2c20f0(0x15a)+_0x2b94e8+'\x0a')),console[_0x2c20f0(0xd9)](a40_0x1cabe2[_0x2c20f0(0x115)](_0x2c20f0(0x164))),0x1;_0x4d607b[_0x2c20f0(0x14a)]&&(console[_0x2c20f0(0xd9)](_0x2c20f0(0x14e)+_0x4d607b[_0x2c20f0(0x112)]),console[_0x2c20f0(0xd9)](_0x2c20f0(0xdb)+_0x335dd5),console[_0x2c20f0(0xd9)]('Source\x20directory:\x20'+_0x2b94e8),_0x32d3e3&&console[_0x2c20f0(0xd9)]('Scoped\x20to\x20folder:\x20'+_0x43daab));const _0x299193=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x335dd5+_0x2c20f0(0xf9),()=>_0x557ce8[_0x2c20f0(0x160)][_0x2c20f0(0x10b)](_0x335dd5),{'verbose':_0x4d607b[_0x2c20f0(0x14a)]}),_0x6b9fa3=_0x299193[_0x2c20f0(0x141)],{parentSegmentResult:_0x3f8deb,segmentsResult:_0x2e177a,foldersResult:_0x46a74e,journeysWithDetailsResult:_0x346ae3,userMaps:_0x16a605}=await withSpinner(_0x2c20f0(0xd6),async()=>{const _0x29515b=_0x2c20f0,[_0x3ad3b2,_0x57d81d,_0x3fa835,_0x76e4c4,_0x4de838]=await Promise[_0x29515b(0x147)]([_0x557ce8['segment'][_0x29515b(0x107)](_0x6b9fa3),_0x557ce8[_0x29515b(0x160)][_0x29515b(0x100)](_0x6b9fa3),_0x557ce8['segment']['listFolders'](_0x6b9fa3),_0x557ce8[_0x29515b(0x121)][_0x29515b(0x110)](_0x6b9fa3,{'includeAllVersions':!![]}),_0x557ce8[_0x29515b(0xfd)][_0x29515b(0xe9)]()]);return{'parentSegmentResult':_0x3ad3b2,'segmentsResult':_0x57d81d,'foldersResult':_0x3fa835,'journeysWithDetailsResult':_0x76e4c4,'userMaps':_0x4de838};},{'verbose':_0x4d607b[_0x2c20f0(0x14a)]})[_0x2c20f0(0x142)](_0x2749d9=>_0x2749d9[_0x2c20f0(0x141)]),_0x5c89a6=_0x3f8deb,_0x3fe99f=extractRootFolderId(_0x5c89a6),_0xd8603b=_0x2e177a,_0xacb869=_0x46a74e,{journeys:_0x4a2607,activationStepsById:_0x3c442e}=_0x346ae3,_0x2a9881=new Map(_0x4a2607[_0x2c20f0(0x162)](_0x4211a0=>[_0x4211a0['id'],_0x4211a0])),_0x338716=_0x4a2607[_0x2c20f0(0x162)](_0x46b423=>({'id':_0x46b423['id'],'name':_0x46b423[_0x2c20f0(0x148)][_0x2c20f0(0x151)],'journeyBundleName':_0x46b423[_0x2c20f0(0x148)][_0x2c20f0(0xda)]||'','journeyBundleId':_0x46b423[_0x2c20f0(0x148)][_0x2c20f0(0xde)]||'','versionNumber':_0x46b423[_0x2c20f0(0x148)]['versionNumber'],'description':_0x46b423['attributes'][_0x2c20f0(0x10f)],'state':_0x46b423[_0x2c20f0(0x148)][_0x2c20f0(0xee)],'paused':_0x46b423[_0x2c20f0(0x148)][_0x2c20f0(0x149)],'audienceId':_0x46b423[_0x2c20f0(0x148)][_0x2c20f0(0x158)],'folderId':_0x46b423[_0x2c20f0(0x15c)]?.[_0x2c20f0(0x122)]?.[_0x2c20f0(0x141)]?.['id'],'createdAt':_0x46b423[_0x2c20f0(0x148)][_0x2c20f0(0x129)],'updatedAt':_0x46b423[_0x2c20f0(0x148)][_0x2c20f0(0xe3)]})),{emailToId:_0x51ee8a,idToEmail:_0x1222e0}=_0x16a605,_0x90856c=await withSpinner(_0x2c20f0(0x13f),async()=>{const _0x9c1b9=_0x2c20f0,_0x36178d=await _0x557ce8[_0x9c1b9(0xe6)][_0x9c1b9(0x134)]();return buildConnectionMaps(_0x36178d);},{'verbose':_0x4d607b[_0x2c20f0(0x14a)]})['then'](_0x447858=>_0x447858[_0x2c20f0(0x141)]),_0x2fb347=_0x90856c[_0x2c20f0(0x113)],_0x1fc89c=_0x90856c['idToName'],_0xc8bf87=_0x90856c[_0x2c20f0(0x10c)],_0x2f8d94={'emailToIdMap':_0x51ee8a,'connectionNameToIdMap':_0x2fb347,'connectionNameToTypeMap':_0xc8bf87,'getSchema':_0x4fc605=>_0x557ce8['connection'][_0x2c20f0(0x130)](_0x4fc605)};let {pathToId:_0x5d7bd6,idToPath:_0x19d30f}=buildFolderMaps(_0xacb869);const _0x31e17f=buildSegmentLookupMap(_0xd8603b,_0x19d30f),_0x404b25=buildSegmentNameToIdMap(_0xd8603b),_0x4c77e7=buildJourneyBundleLookupMap(_0x338716,_0x19d30f);let _0x2054bd;if(_0x95b67){if(!_0x95b67[_0x2c20f0(0x103)]('.yml')&&!_0x95b67['endsWith'](_0x2c20f0(0x105)))return console['error'](a40_0x1cabe2['red']('Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20'+_0x95b67+'\x0a')),0x1;_0x2054bd=[_0x95b67];}else _0x2054bd=findYamlFiles(_0x2b94e8);if(_0x2054bd[_0x2c20f0(0x140)]===0x0)return console[_0x2c20f0(0xd9)](a40_0x1cabe2[_0x2c20f0(0x131)](_0x2c20f0(0x15b)+_0x2b94e8+'\x0a')),console['error'](a40_0x1cabe2['cyan'](_0x2c20f0(0x109))),0x1;let _0x33a480,_0x737ea9;try{const _0x1e9c01=parseAndClassifyYamlFiles(_0x2054bd,_0x2b94e8,{'skipSegments':_0x4d607b[_0x2c20f0(0x13a)]});_0x33a480=_0x1e9c01[_0x2c20f0(0x108)],_0x737ea9=_0x1e9c01['journeys'];const _0x5c4eb2=validateParsedFiles(_0x1e9c01,_0x2b94e8);if(_0x5c4eb2[_0x2c20f0(0x140)]>0x0)return console[_0x2c20f0(0xd9)](a40_0x1cabe2[_0x2c20f0(0x131)](_0x2c20f0(0xfc))),console[_0x2c20f0(0xd9)](formatValidationErrors(_0x5c4eb2)),console[_0x2c20f0(0xd9)](a40_0x1cabe2[_0x2c20f0(0x102)](_0x2c20f0(0x104))),0x1;}catch(_0x232b63){return console[_0x2c20f0(0xd9)](a40_0x1cabe2['red'](_0x2c20f0(0x15f)+(_0x232b63 instanceof Error?_0x232b63['message']:_0x232b63))),0x1;}if(_0x33a480[_0x2c20f0(0x140)]===0x0&&_0x737ea9[_0x2c20f0(0x140)]===0x0){const _0x202f35=_0x4d607b[_0x2c20f0(0x13a)]?'journey':'segment\x20or\x20journey';return console['error'](a40_0x1cabe2[_0x2c20f0(0x102)]('No\x20'+_0x202f35+_0x2c20f0(0x13c))),0x0;}const _0x4a946d=new Map();_0xd8603b[_0x2c20f0(0x140)]>0x0&&!_0x4d607b[_0x2c20f0(0x13a)]&&await withSpinner('Fetching\x20existing\x20activations...',async()=>{await batchAsync(_0xd8603b,async _0xdd39ac=>{const _0x444696=a40_0x584d,_0x5e0c0a=await _0x557ce8[_0x444696(0x160)][_0x444696(0x13d)](_0x6b9fa3,_0xdd39ac['id']);_0x4a946d[_0x444696(0xd0)](_0xdd39ac['id'],_0x5e0c0a);});},{'verbose':_0x4d607b['verbose']});const {segmentFiles:_0x56f87b,foldersToCreate:_0x29d74a}=await prepareSegmentFiles(_0x33a480,{'segmentByFolderAndName':_0x31e17f,'activationsBySegmentId':_0x4a946d,'folderPathToId':_0x5d7bd6,'idToEmailMap':_0x1222e0,'connectionIdToNameMap':_0x1fc89c},_0x2f8d94,_0x32d3e3,_0x43daab),_0x57572b=_0x95b67?[]:findSegmentsToDelete(_0xd8603b,_0x33a480[_0x2c20f0(0x162)](({yamlConfig:_0x4cb676,folderPath:_0xab26c6})=>({'yamlConfig':_0x4cb676,'folderPath':resolveTDFolderPath(_0xab26c6,_0x32d3e3,_0x43daab)})),_0x19d30f,_0x43daab,_0x32d3e3),{journeyFiles:_0x5a0e7e,foldersToCreate:_0x58cb15}=await withProgressSpinner(_0x2c20f0(0x12d),async _0x4e6499=>prepareJourneyFiles(_0x737ea9,{'fetchJourney':async _0x2df6ff=>_0x557ce8[_0x2c20f0(0x121)]['getJourney'](_0x2df6ff[_0x2c20f0(0x137)]),'journeyBundlesByFolderAndName':_0x4c77e7,'folderPathToId':_0x5d7bd6,'idToEmailMap':_0x1222e0,'connectionIdToNameMap':_0x1fc89c,'existingSegments':_0xd8603b,'parentId':_0x6b9fa3,'deps':_0x557ce8,'progress':{'update':_0x3545e6=>{const _0x556ea3=_0x2c20f0;_0x4e6499['setPhase'](_0x3545e6),_0x4d607b[_0x556ea3(0x14a)]&&console['error']('\x20\x20'+_0x3545e6);}},'journeyById':_0x2a9881,'activationStepsById':_0x3c442e},_0x32d3e3,_0x43daab),{'verbose':_0x4d607b['verbose']})[_0x2c20f0(0x142)](_0x2d2eb5=>_0x2d2eb5[_0x2c20f0(0x141)]);for(const _0x245067 of _0x58cb15){_0x29d74a[_0x2c20f0(0xd3)](_0x245067);}const _0x49426a=_0x95b67?[]:findJourneysToDelete(_0x338716,_0x737ea9['map'](({yamlConfig:_0x122f9b,folderPath:_0x5c2015})=>({'yamlConfig':_0x122f9b,'folderPath':resolveTDFolderPath(_0x5c2015,_0x32d3e3,_0x43daab)})),_0x19d30f,_0x43daab,_0x32d3e3),_0x11badf=calculatePushStats(_0x56f87b,_0x5a0e7e,_0x29d74a,_0x57572b,_0x49426a,!!_0x4d607b[_0x2c20f0(0x167)],!!_0x4d607b[_0x2c20f0(0x13a)]),_0x5464ca=_0x11badf['segments'][_0x2c20f0(0x166)],_0x2ed1c1=_0x11badf[_0x2c20f0(0x108)][_0x2c20f0(0x155)],_0x4e3810=_0x11badf[_0x2c20f0(0x108)][_0x2c20f0(0xed)],_0x514386=_0x11badf[_0x2c20f0(0x108)][_0x2c20f0(0x156)],_0x5f40d5=_0x11badf[_0x2c20f0(0x11c)][_0x2c20f0(0x168)],_0x1317ca=_0x11badf['journeys']['new'],_0x1746c7=_0x11badf[_0x2c20f0(0xef)][_0x2c20f0(0x155)],_0x535e6d=_0x11badf['journeys']['unchanged'],_0xc2afb1=_0x11badf[_0x2c20f0(0xef)][_0x2c20f0(0x156)],_0x17899c=_0x11badf[_0x2c20f0(0x10a)][_0x2c20f0(0x147)],_0x52c734=_0x11badf[_0x2c20f0(0x10a)]['toCreate'],_0x430467=_0x11badf['activations'][_0x2c20f0(0x157)],_0x21fc15=_0x11badf[_0x2c20f0(0x10a)]['toDelete'];console[_0x2c20f0(0xd9)](_0x2c20f0(0xf3)+_0x335dd5+'\x27:');_0x5f40d5[_0x2c20f0(0x140)]>0x0&&console[_0x2c20f0(0xd9)]('\x20\x20'+a40_0x1cabe2[_0x2c20f0(0xd2)]('📁\x20'+_0x5f40d5['length']+_0x2c20f0(0x14f)));if(!_0x4d607b[_0x2c20f0(0x13a)]){console[_0x2c20f0(0xd9)](_0x2c20f0(0x14d)),console[_0x2c20f0(0xd9)](_0x2c20f0(0x13b)+a40_0x1cabe2[_0x2c20f0(0x15e)]('+\x20'+_0x5464ca[_0x2c20f0(0x140)]+_0x2c20f0(0x15d))),console[_0x2c20f0(0xd9)](_0x2c20f0(0x13b)+a40_0x1cabe2['yellow']('~\x20'+_0x2ed1c1[_0x2c20f0(0x140)]+_0x2c20f0(0x136)));if(_0x514386[_0x2c20f0(0x140)]>0x0)console['error']('\x20\x20\x20\x20'+a40_0x1cabe2[_0x2c20f0(0x131)]('-\x20'+_0x514386['length']+_0x2c20f0(0x12e)));else _0x57572b['length']>0x0&&!_0x4d607b[_0x2c20f0(0x167)]&&console[_0x2c20f0(0xd9)]('\x20\x20\x20\x20'+a40_0x1cabe2['dim'](_0x57572b[_0x2c20f0(0x140)]+_0x2c20f0(0x14b)));console[_0x2c20f0(0xd9)](_0x2c20f0(0x13b)+a40_0x1cabe2[_0x2c20f0(0x161)]('=\x20'+_0x4e3810[_0x2c20f0(0x140)]+_0x2c20f0(0xd8)));}if(_0x5a0e7e[_0x2c20f0(0x140)]>0x0||_0x49426a[_0x2c20f0(0x140)]>0x0){console[_0x2c20f0(0xd9)](_0x2c20f0(0xec)),console[_0x2c20f0(0xd9)]('\x20\x20\x20\x20'+a40_0x1cabe2[_0x2c20f0(0x15e)]('+\x20'+_0x1317ca['length']+_0x2c20f0(0x15d))),console[_0x2c20f0(0xd9)]('\x20\x20\x20\x20'+a40_0x1cabe2[_0x2c20f0(0x102)]('~\x20'+_0x1746c7[_0x2c20f0(0x140)]+_0x2c20f0(0x136)));if(_0xc2afb1[_0x2c20f0(0x140)]>0x0)console[_0x2c20f0(0xd9)](_0x2c20f0(0x13b)+a40_0x1cabe2['red']('-\x20'+_0xc2afb1[_0x2c20f0(0x140)]+_0x2c20f0(0x12e)));else _0x49426a[_0x2c20f0(0x140)]>0x0&&!_0x4d607b[_0x2c20f0(0x167)]&&console[_0x2c20f0(0xd9)](_0x2c20f0(0x13b)+a40_0x1cabe2[_0x2c20f0(0x161)](_0x49426a['length']+'\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)'));console[_0x2c20f0(0xd9)](_0x2c20f0(0x13b)+a40_0x1cabe2[_0x2c20f0(0x161)]('=\x20'+_0x535e6d['length']+'\x20unchanged'));}_0x17899c['length']>0x0&&!_0x4d607b[_0x2c20f0(0x13a)]&&(console[_0x2c20f0(0xd9)](''),console[_0x2c20f0(0xd9)]('\x20\x20Activations:'),_0x52c734[_0x2c20f0(0x140)]>0x0&&console[_0x2c20f0(0xd9)](_0x2c20f0(0x13b)+a40_0x1cabe2[_0x2c20f0(0x15e)]('+\x20'+_0x52c734[_0x2c20f0(0x140)]+_0x2c20f0(0x127))),_0x430467[_0x2c20f0(0x140)]>0x0&&console[_0x2c20f0(0xd9)](_0x2c20f0(0x13b)+a40_0x1cabe2[_0x2c20f0(0x102)]('~\x20'+_0x430467['length']+_0x2c20f0(0x116))),_0x21fc15[_0x2c20f0(0x140)]>0x0&&console[_0x2c20f0(0xd9)](_0x2c20f0(0x13b)+a40_0x1cabe2['red']('-\x20'+_0x21fc15['length']+'\x20to\x20delete')));console[_0x2c20f0(0xd9)](_0x2c20f0(0x101)+a40_0x1cabe2[_0x2c20f0(0x115)](_0x2b94e8)+'\x0a');if(_0x5f40d5[_0x2c20f0(0x140)]>0x0){console[_0x2c20f0(0xd9)](_0x2c20f0(0xdf));for(const _0x515901 of _0x5f40d5){console[_0x2c20f0(0xd9)]('\x20\x20'+a40_0x1cabe2[_0x2c20f0(0xd2)]('+')+'\x20'+_0x515901);}console[_0x2c20f0(0xd9)]('');}if(_0x5464ca[_0x2c20f0(0x140)]>0x0&&!_0x4d607b[_0x2c20f0(0x13a)])for(const _0x3cce1f of _0x5464ca){const _0x131dc6=_0x3cce1f[_0x2c20f0(0xe1)]?_0x3cce1f[_0x2c20f0(0xe1)]+'/'+_0x3cce1f['yamlConfig'][_0x2c20f0(0x151)]:_0x3cce1f[_0x2c20f0(0xe5)][_0x2c20f0(0x151)],_0xa490c7=_0x3cce1f['yamlConfig'][_0x2c20f0(0x10a)]?.['length']||0x0,_0x9dad62=_0xa490c7>0x0?a40_0x1cabe2[_0x2c20f0(0x161)]('\x20['+_0xa490c7+_0x2c20f0(0x119)):'';console[_0x2c20f0(0xd9)]('\x0a'+a40_0x1cabe2[_0x2c20f0(0x15e)]('New\x20segment:')+'\x20'+_0x131dc6+_0x9dad62),console['error']('─'[_0x2c20f0(0xf1)](0x3c)),_0x3cce1f[_0x2c20f0(0xe8)]&&console[_0x2c20f0(0xd9)](_0x3cce1f[_0x2c20f0(0xe8)]),console[_0x2c20f0(0xd9)]('─'[_0x2c20f0(0xf1)](0x3c));}if(_0x514386['length']>0x0&&!_0x4d607b[_0x2c20f0(0x13a)])for(const _0x1be2dd of _0x514386){const _0x280dfd=_0x1be2dd[_0x2c20f0(0x117)]?_0x19d30f['get'](_0x1be2dd[_0x2c20f0(0x117)]['toString']())||'':'',_0x20a17e=_0x280dfd?_0x280dfd+'/'+_0x1be2dd[_0x2c20f0(0x151)]:_0x1be2dd[_0x2c20f0(0x151)],_0x503bcc=_0x4a946d['get'](_0x1be2dd['id'])||[],_0xaec7e0=_0x503bcc[_0x2c20f0(0x140)]>0x0?a40_0x1cabe2[_0x2c20f0(0x161)]('\x20['+_0x503bcc[_0x2c20f0(0x140)]+_0x2c20f0(0x119)):'';console['error']('\x0a'+a40_0x1cabe2[_0x2c20f0(0x131)](_0x2c20f0(0x145))+'\x20'+_0x20a17e+_0xaec7e0),console[_0x2c20f0(0xd9)]('─'['repeat'](0x3c));const _0xfb52e0=segmentWithActivationsToYaml(_0x1be2dd,_0x503bcc,undefined,_0x1222e0,_0x1fc89c),_0x4b4758=segmentToYamlString(_0xfb52e0),_0x5c87a0=generateDiff(_0x4b4758,'');console['error'](formatDiffWithColors(_0x5c87a0)),console[_0x2c20f0(0xd9)]('─'[_0x2c20f0(0xf1)](0x3c));}const _0x291217=_0x56f87b['filter'](_0x40ac13=>!_0x40ac13['isNew']&&_0x40ac13['diff']);if(_0x291217[_0x2c20f0(0x140)]>0x0&&!_0x4d607b[_0x2c20f0(0x13a)])for(const _0x347406 of _0x291217){const _0x2e5807=_0x347406[_0x2c20f0(0xe1)]?_0x347406[_0x2c20f0(0xe1)]+'/'+_0x347406[_0x2c20f0(0xe5)][_0x2c20f0(0x151)]:_0x347406[_0x2c20f0(0xe5)][_0x2c20f0(0x151)];console[_0x2c20f0(0xd9)]('\x0a'+a40_0x1cabe2[_0x2c20f0(0x102)]('Changes\x20to:')+'\x20'+_0x2e5807),console['error']('─'[_0x2c20f0(0xf1)](0x3c)),console['error'](_0x347406[_0x2c20f0(0xe8)]),console[_0x2c20f0(0xd9)]('─'[_0x2c20f0(0xf1)](0x3c));}if(_0x1317ca['length']>0x0)for(const _0x1ea88c of _0x1317ca){const _0x148248=_0x1ea88c[_0x2c20f0(0xe1)]?_0x1ea88c[_0x2c20f0(0xe1)]+'/'+_0x1ea88c[_0x2c20f0(0xe5)][_0x2c20f0(0x151)]:_0x1ea88c[_0x2c20f0(0xe5)][_0x2c20f0(0x151)];console[_0x2c20f0(0xd9)]('\x0a'+a40_0x1cabe2[_0x2c20f0(0x15e)](_0x2c20f0(0xdd))+'\x20'+_0x148248),console[_0x2c20f0(0xd9)]('─'['repeat'](0x3c)),_0x1ea88c[_0x2c20f0(0xe8)]&&console[_0x2c20f0(0xd9)](_0x1ea88c[_0x2c20f0(0xe8)]),console[_0x2c20f0(0xd9)]('─'['repeat'](0x3c));}const _0x217155=_0x5a0e7e[_0x2c20f0(0xeb)](_0x256433=>!_0x256433[_0x2c20f0(0x143)]&&_0x256433['diff']);if(_0x217155['length']>0x0)for(const _0x460f7a of _0x217155){const _0xad1910=_0x460f7a[_0x2c20f0(0xe1)]?_0x460f7a[_0x2c20f0(0xe1)]+'/'+_0x460f7a['yamlConfig'][_0x2c20f0(0x151)]:_0x460f7a[_0x2c20f0(0xe5)][_0x2c20f0(0x151)];console[_0x2c20f0(0xd9)]('\x0a'+a40_0x1cabe2[_0x2c20f0(0x102)](_0x2c20f0(0x10d))+'\x20'+_0xad1910),console[_0x2c20f0(0xd9)]('─'[_0x2c20f0(0xf1)](0x3c)),console[_0x2c20f0(0xd9)](_0x460f7a[_0x2c20f0(0xe8)]),console['error']('─'[_0x2c20f0(0xf1)](0x3c));}if(_0xc2afb1[_0x2c20f0(0x140)]>0x0)for(const _0x2ab87b of _0xc2afb1){const _0x2e1b0c=_0x2ab87b[_0x2c20f0(0x132)]?_0x19d30f[_0x2c20f0(0x11a)](_0x2ab87b[_0x2c20f0(0x132)])||'':'',_0x5a3ab9=_0x2e1b0c?_0x2e1b0c+'/'+_0x2ab87b[_0x2c20f0(0xda)]:_0x2ab87b['journeyBundleName'];console[_0x2c20f0(0xd9)]('\x0a'+a40_0x1cabe2[_0x2c20f0(0x131)]('Delete\x20journey:')+'\x20'+_0x5a3ab9),console[_0x2c20f0(0xd9)]('─'[_0x2c20f0(0xf1)](0x3c)),console[_0x2c20f0(0xd9)](a40_0x1cabe2[_0x2c20f0(0x131)](_0x2c20f0(0x10e))),console[_0x2c20f0(0xd9)]('─'[_0x2c20f0(0xf1)](0x3c));}if(_0x4d607b['dryRun'])return console[_0x2c20f0(0xd9)](a40_0x1cabe2[_0x2c20f0(0x102)](_0x2c20f0(0x124))),0x0;const _0x5561cd=_0x4d607b[_0x2c20f0(0x13a)]?![]:_0x5464ca[_0x2c20f0(0x140)]>0x0||_0x2ed1c1[_0x2c20f0(0x140)]>0x0||_0x514386[_0x2c20f0(0x140)]>0x0,_0x10bcbe=_0x1317ca[_0x2c20f0(0x140)]>0x0||_0x1746c7[_0x2c20f0(0x140)]>0x0||_0xc2afb1[_0x2c20f0(0x140)]>0x0,_0x3403b2=_0x4d607b[_0x2c20f0(0x13a)]?![]:_0x17899c[_0x2c20f0(0x140)]>0x0,_0x2a483e=_0x5f40d5['length']>0x0;if(!_0x5561cd&&!_0x10bcbe&&!_0x3403b2&&!_0x2a483e){const _0x3a95a8=_0x4d607b['journeysOnly']?'✔\x20All\x20journeys\x20are\x20up\x20to\x20date':'✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date';console['error'](a40_0x1cabe2[_0x2c20f0(0x15e)](_0x3a95a8));if(_0x95b67&&_0x4e3810['length']===0x1){const _0x3359ed=_0x4e3810[0x0];if(_0x3359ed[_0x2c20f0(0xe2)]?.['id']){const _0xf2fab3=getConsoleNextUrl(_0x4d607b['site'],_0x2c20f0(0x152)+_0x6b9fa3+_0x2c20f0(0x169)+_0x3359ed[_0x2c20f0(0xe2)]['id']+_0x2c20f0(0xd7));console[_0x2c20f0(0xd9)]('\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20'+a40_0x1cabe2[_0x2c20f0(0x115)](_0xf2fab3));}}if(_0x95b67&&_0x535e6d[_0x2c20f0(0x140)]===0x1){const _0x29e05d=_0x535e6d[0x0];if(_0x29e05d[_0x2c20f0(0xd4)]?.['id']){const _0x57536=getConsoleNextUrl(_0x4d607b[_0x2c20f0(0x112)],_0x2c20f0(0x152)+_0x6b9fa3+_0x2c20f0(0x169)+_0x29e05d['existingJourney']['id']+'/j/da/je');console['error']('\x20\x20'+a40_0x1cabe2[_0x2c20f0(0x115)](_0x57536));}}return 0x0;}const _0x547fe5=_0x4d607b[_0x2c20f0(0x13a)]?_0x1317ca['length']+_0x1746c7[_0x2c20f0(0x140)]+_0xc2afb1[_0x2c20f0(0x140)]+_0x5f40d5[_0x2c20f0(0x140)]:_0x5464ca['length']+_0x2ed1c1[_0x2c20f0(0x140)]+_0x514386[_0x2c20f0(0x140)]+_0x1317ca[_0x2c20f0(0x140)]+_0x1746c7[_0x2c20f0(0x140)]+_0xc2afb1['length']+_0x5f40d5['length']+_0x17899c[_0x2c20f0(0x140)];if(!_0x4d607b[_0x2c20f0(0x125)]&&_0x547fe5>0x0){if(!isInteractive())return console[_0x2c20f0(0xd9)](a40_0x1cabe2[_0x2c20f0(0x131)](_0x2c20f0(0xea)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x2c20f0(0xd9)](a40_0x1cabe2[_0x2c20f0(0x161)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x126226=await confirmKey(_0x2c20f0(0x144)+_0x547fe5+_0x2c20f0(0x118));if(!_0x126226)return console[_0x2c20f0(0xd9)](a40_0x1cabe2['yellow'](_0x2c20f0(0x12b))),0x1;}const _0x5bd8cf={'withProgress':async(_0x5673f0,_0x4144a8)=>{const _0x8ef56a=_0x2c20f0,_0x527061=await withSpinner(_0x5673f0,_0x4144a8,{'verbose':_0x4d607b[_0x8ef56a(0x14a)]});return{'data':_0x527061[_0x8ef56a(0x141)]};},'logInfo':_0x1d0880=>console['error'](a40_0x1cabe2[_0x2c20f0(0xd2)]('✔\x20'+_0x1d0880)),'logSuccess':_0x4cd96f=>console[_0x2c20f0(0xd9)](a40_0x1cabe2[_0x2c20f0(0x15e)]('✔\x20'+_0x4cd96f)),'logWarning':_0x417c95=>console[_0x2c20f0(0xd9)](a40_0x1cabe2[_0x2c20f0(0x102)]('⚠\x20'+_0x417c95)),'logDeleted':_0x55558e=>console['error'](a40_0x1cabe2['red']('✔\x20'+_0x55558e))},_0x213d42={'segment':_0x557ce8[_0x2c20f0(0x160)],'journey':_0x557ce8[_0x2c20f0(0x121)],'user':_0x557ce8[_0x2c20f0(0xfd)],'connection':_0x557ce8[_0x2c20f0(0xe6)]};_0x5f40d5[_0x2c20f0(0x140)]>0x0&&(_0x5d7bd6=await executePushFolders(_0x213d42,_0x5f40d5,_0x5d7bd6,{'parentId':_0x6b9fa3},_0x5bd8cf));const _0x176383={'rootFolderId':_0x3fe99f,'folderPathToId':_0x5d7bd6,'folderIdToPath':_0x19d30f,'segmentNameToId':_0x404b25,'activationsBySegmentId':_0x4a946d,'emailToIdMap':_0x51ee8a,'idToEmailMap':_0x1222e0,'connectionNameToIdMap':_0x90856c[_0x2c20f0(0x113)],'connectionIdToNameMap':_0x90856c[_0x2c20f0(0xe7)],'connectionNameToTypeMap':_0xc8bf87},_0x53ee3f=await executePushSegments(_0x213d42,_0x4d607b[_0x2c20f0(0x13a)]?[]:_0x56f87b,_0x176383,{'parentId':_0x6b9fa3},_0x5bd8cf),_0x4c4c2b=_0x53ee3f['created'],_0x49d1d1=_0x53ee3f[_0x2c20f0(0x128)],_0x2fec04=_0x53ee3f[_0x2c20f0(0x10a)][_0x2c20f0(0x12a)],_0x378f4e=_0x53ee3f[_0x2c20f0(0x10a)][_0x2c20f0(0x128)],_0x4864f3=_0x53ee3f[_0x2c20f0(0x10a)][_0x2c20f0(0x12f)];let _0x578660;if(_0x95b67&&_0x56f87b[_0x2c20f0(0x140)]===0x1){const _0x2a3979=_0x56f87b[0x0];_0x578660=_0x2a3979['existingSegment']?.['id']??_0x53ee3f[_0x2c20f0(0x11b)][_0x2c20f0(0x11a)](_0x2a3979[_0x2c20f0(0xe5)][_0x2c20f0(0x151)]);}const _0x5d1557=await executePushSegmentDeletions(_0x213d42,_0x4d607b['journeysOnly']?[]:_0x514386,_0x5bd8cf);let _0x386ff8=0x0,_0x6e9767=0x0,_0x6a0dea=0x0;const _0x4707e4=new Map(_0x404b25);for(const [_0xf293f2,_0xc6f516]of _0x53ee3f[_0x2c20f0(0x11b)]){_0x4707e4['set'](_0xf293f2,_0xc6f516);}if(_0x5a0e7e['length']>0x0){const _0x3c3ada={..._0x176383,'segmentNameToId':_0x4707e4,'existingSegments':_0xd8603b,'activationContext':_0x2f8d94},_0x16390f=await executePushJourneys(_0x213d42,_0x5a0e7e,_0x3c3ada,{'parentId':_0x6b9fa3,'rootFolderId':_0x3fe99f,'verbose':_0x4d607b[_0x2c20f0(0x14a)]},_0x5bd8cf);_0x386ff8=_0x16390f['created'],_0x6e9767=_0x16390f[_0x2c20f0(0x128)];if(_0x95b67&&_0x16390f[_0x2c20f0(0x159)]['length']===0x1){const _0x578fde=_0x16390f[_0x2c20f0(0x159)][0x0];if(_0x578fde[_0x2c20f0(0x137)]){const _0x3082e9=getConsoleNextUrl(_0x4d607b[_0x2c20f0(0x112)],_0x2c20f0(0x152)+_0x6b9fa3+_0x2c20f0(0x169)+_0x578fde['journeyId']+_0x2c20f0(0x11e));console[_0x2c20f0(0xd9)]('\x20\x20'+a40_0x1cabe2[_0x2c20f0(0x115)](_0x3082e9));}}}for(const _0x191f4e of _0xc2afb1){console[_0x2c20f0(0xd9)](a40_0x1cabe2[_0x2c20f0(0x102)](_0x2c20f0(0xd1)+_0x191f4e['journeyBundleName'])),_0x6a0dea++;}const _0x506def=[];if(_0x4c4c2b>0x0)_0x506def[_0x2c20f0(0x126)](_0x4c4c2b+_0x2c20f0(0x106));if(_0x49d1d1>0x0)_0x506def[_0x2c20f0(0x126)](_0x49d1d1+_0x2c20f0(0x13e));if(_0x5d1557>0x0)_0x506def[_0x2c20f0(0x126)](_0x5d1557+_0x2c20f0(0x163));const _0x4a6f1d=[];if(_0x386ff8>0x0)_0x4a6f1d[_0x2c20f0(0x126)](_0x386ff8+'\x20created');if(_0x6e9767>0x0)_0x4a6f1d[_0x2c20f0(0x126)](_0x6e9767+_0x2c20f0(0x13e));if(_0x6a0dea>0x0)_0x4a6f1d[_0x2c20f0(0x126)](_0x6a0dea+_0x2c20f0(0x163));const _0x5c9566=[];if(_0x2fec04>0x0)_0x5c9566[_0x2c20f0(0x126)](_0x2fec04+_0x2c20f0(0x106));if(_0x378f4e>0x0)_0x5c9566[_0x2c20f0(0x126)](_0x378f4e+'\x20updated');if(_0x4864f3>0x0)_0x5c9566[_0x2c20f0(0x126)](_0x4864f3+'\x20deleted');console[_0x2c20f0(0xd9)](a40_0x1cabe2[_0x2c20f0(0x15e)](_0x2c20f0(0xff)));_0x506def[_0x2c20f0(0x140)]>0x0&&!_0x4d607b[_0x2c20f0(0x13a)]&&console[_0x2c20f0(0xd9)](_0x2c20f0(0xfe)+_0x506def[_0x2c20f0(0x111)](',\x20'));_0x4a6f1d[_0x2c20f0(0x140)]>0x0&&console['error'](_0x2c20f0(0x114)+_0x4a6f1d['join'](',\x20'));_0x5c9566[_0x2c20f0(0x140)]>0x0&&!_0x4d607b['journeysOnly']&&console[_0x2c20f0(0xd9)](_0x2c20f0(0x139)+_0x5c9566[_0x2c20f0(0x111)](',\x20'));if(_0x578660){const _0x480274=getConsoleNextUrl(_0x4d607b['site'],'/app/ps/'+_0x6b9fa3+_0x2c20f0(0x169)+_0x578660+_0x2c20f0(0xd7));console[_0x2c20f0(0xd9)](_0x2c20f0(0x150)+a40_0x1cabe2['cyan'](_0x480274));}return 0x0;}}
1
+ const a40_0x2857f2=a40_0xfbd0;(function(_0x5dc286,_0x35d7cd){const _0x22f038=a40_0xfbd0,_0x454609=_0x5dc286();while(!![]){try{const _0x48e34a=parseInt(_0x22f038(0x12a))/0x1*(-parseInt(_0x22f038(0x127))/0x2)+-parseInt(_0x22f038(0xdc))/0x3*(-parseInt(_0x22f038(0x125))/0x4)+parseInt(_0x22f038(0x102))/0x5+-parseInt(_0x22f038(0xd7))/0x6+-parseInt(_0x22f038(0x150))/0x7+-parseInt(_0x22f038(0x10b))/0x8*(-parseInt(_0x22f038(0xef))/0x9)+parseInt(_0x22f038(0xd5))/0xa;if(_0x48e34a===_0x35d7cd)break;else _0x454609['push'](_0x454609['shift']());}catch(_0x4b87b7){_0x454609['push'](_0x454609['shift']());}}}(a40_0x4334,0xd38fb));import{BaseCommand}from'./command.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{generateDiff,formatDiffWithColors}from'../utils/diff.js';function a40_0xfbd0(_0x197405,_0xc17ae2){_0x197405=_0x197405-0xb1;const _0x433479=a40_0x4334();let _0xfbd0bf=_0x433479[_0x197405];return _0xfbd0bf;}import{confirmKey,isInteractive}from'../utils/prompt.js';import{batchAsync}from'../utils/async.js';import{segmentToYamlString,segmentWithActivationsToYaml}from'../sdk/segment/child-segment-yaml.js';import a40_0x496244 from'chalk';import{existsSync}from'fs';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{resolveTarget,isSuccessfulResolution,getScopedDetails}from'../sdk/segment/target-resolution.js';import{buildFolderMaps}from'../sdk/segment/resolution-context.js';function a40_0x4334(){const _0x3960ed=['\x20new','\x0aValidation\x20failed:','Fetching\x20existing\x20activations...','\x20\x20Segments:\x20','listJourneysWithDetailsFromParentSegment','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','/e/','Delete\x20journey:','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file','endsWith','\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20','setPhase','isScoped','\x20unchanged','Changes\x20to\x20journey:','\x20\x20Activations:\x20','segments','\x20\x20Source:\x20','Site:\x20','2199480LMoOji','updated','3942360NmVPfU','results','data','filter','listFolders','1509xemStO','\x20to\x20update','Changes\x20to:','helpText','folderId','cwd','getOutputSchemaWithCache','connection','.yml','paused','dim','add','\x20activations]','Scoped\x20to\x20folder:\x20','No\x20','listActivations','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','audienceId','diff','675vZpjqy','folderPath','updatedAt','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','journeyId','get','Error\x20parsing\x20YAML:\x20','segmentFolderId','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','existingSegment','journeysOnly','toString','journey','Error:\x20Directory\x20not\x20found:\x20','join','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)','\x0a✔\x20Push\x20complete','createdSegmentIds','Preparing\x20journeys...','1766305UFMKXa','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','description','push','blue','targetDir','nameToType','createdAt','153272cZndZQ','map','journeyBundleName','type','\x20\x20Journeys:\x20','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','new','Fetching\x20connections\x20for\x20name\x20resolution...','all','list','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','/j/da/je','listSegments','\x0aPush\x20summary\x20for\x20\x27','resolveParentId','Error:\x20','getParent','nameToId','toCreate','Aborted.','Resolving\x20parent\x20segment\x20\x27','relationships','\x20created','site','journeyBundleId','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','11404EBcWFL','state','4ZsuTQq','error','filePath','705571wAZvqO','created','set','journeys','Parent\x20segment:\x20','toDelete','idToName','then','name','isNew','deleted','folders','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','cyan','✔\x20All\x20journeys\x20are\x20up\x20to\x20date','changed','segment\x20or\x20journey','attributes','/app/ps/','\x20deleted','\x27...','activations','message','red','New\x20segment:','parent_name','parentName','yamlConfig','delete','Fetching\x20existing\x20data...','segment','📁\x20','Delete\x20segment:','no_parent','\x20to\x20delete','/sb/da/esr','user','parentSegment','3566010zoChqh','\x20changed','(Journey\x20will\x20be\x20deleted)','\x20updated','green','.yaml','\x20\x20📊\x20Segments:','execute','Source\x20directory:\x20','yellow','\x20\x20\x20\x20','yes','file','segment:push','\x20to\x20create','length','verbose','repeat'];a40_0x4334=function(){return _0x3960ed;};return a40_0x4334();}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{['name']=a40_0x2857f2(0xbd);[a40_0x2857f2(0x105)]='Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments';async[a40_0x2857f2(0xb7)](_0x527b11){const _0x24317d=a40_0x2857f2,{options:_0x46841b,args:_0x46849f,tdx:_0x16c5fa}=_0x527b11,_0x424bf4=_0x46841b,_0x556fa1=await resolveTarget({'arg':_0x46849f[0x0],'contextParent':_0x46841b[_0x24317d(0x14f)],'cwd':process[_0x24317d(0xe1)]()});if(!isSuccessfulResolution(_0x556fa1))return _0x556fa1['errorCode']===_0x24317d(0x14b)?(console[_0x24317d(0x128)](a40_0x496244['yellow'](_0x24317d(0xc7))),console[_0x24317d(0x128)](_0x24317d(0xfe)),console[_0x24317d(0x128)](_0x24317d(0x115)),console[_0x24317d(0x128)](_0x24317d(0xca))):(console['error'](a40_0x496244[_0x24317d(0x141)](_0x24317d(0x11a)+_0x556fa1[_0x24317d(0x140)]+'\x0a')),_0x556fa1['helpText']&&console[_0x24317d(0x128)](a40_0x496244['cyan'](_0x556fa1[_0x24317d(0xdf)]))),0x1;if(_0x556fa1['type']===_0x24317d(0x143))return console['error'](a40_0x496244[_0x24317d(0x141)](_0x24317d(0xfc)+_0x556fa1[_0x24317d(0x108)]+'\x0a')),console[_0x24317d(0x128)](a40_0x496244['cyan'](_0x24317d(0xec))),0x1;const _0x31e9f5=_0x556fa1[_0x24317d(0x144)],_0x5851a1=_0x556fa1[_0x24317d(0x108)],_0xfc151e=_0x556fa1[_0x24317d(0x10e)]===_0x24317d(0xbc)?_0x556fa1[_0x24317d(0x129)]:undefined,_0x4e5021=getScopedDetails(_0x556fa1),_0x28bf70=_0x4e5021?.[_0x24317d(0xce)]??![],_0x2d4ab9=_0x4e5021?.['scopedFolderPath']??'';if(!existsSync(_0x5851a1))return console[_0x24317d(0x128)](a40_0x496244[_0x24317d(0x141)]('Error:\x20Directory\x20not\x20found:\x20'+_0x5851a1+'\x0a')),console[_0x24317d(0x128)](a40_0x496244[_0x24317d(0x137)]('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;_0x424bf4[_0x24317d(0xc0)]&&(console[_0x24317d(0x128)](_0x24317d(0xd4)+_0x424bf4['site']),console[_0x24317d(0x128)](_0x24317d(0x12e)+_0x31e9f5),console[_0x24317d(0x128)](_0x24317d(0xb8)+_0x5851a1),_0x28bf70&&console['error'](_0x24317d(0xe9)+_0x2d4ab9));const _0xb3f228=await withSpinner(_0x24317d(0x11f)+_0x31e9f5+_0x24317d(0x13e),()=>_0x16c5fa[_0x24317d(0x148)][_0x24317d(0x119)](_0x31e9f5),{'verbose':_0x424bf4[_0x24317d(0xc0)]}),_0x374140=_0xb3f228[_0x24317d(0xd9)],{parentSegmentResult:_0x14661c,segmentsResult:_0x12319c,foldersResult:_0x20de62,journeysWithDetailsResult:_0x4f9c23,userMaps:_0x44703a}=await withSpinner(_0x24317d(0x147),async()=>{const _0xa1b7b4=_0x24317d,[_0x5370ae,_0x32019a,_0x24f896,_0x4f1301,_0x4b0700]=await Promise[_0xa1b7b4(0x113)]([_0x16c5fa['segment'][_0xa1b7b4(0x11b)](_0x374140),_0x16c5fa[_0xa1b7b4(0x148)][_0xa1b7b4(0x117)](_0x374140),_0x16c5fa['segment'][_0xa1b7b4(0xdb)](_0x374140),_0x16c5fa['journey'][_0xa1b7b4(0xc6)](_0x374140,{'includeAllVersions':!![]}),_0x16c5fa[_0xa1b7b4(0x14e)]['buildUserMaps']()]);return{'parentSegmentResult':_0x5370ae,'segmentsResult':_0x32019a,'foldersResult':_0x24f896,'journeysWithDetailsResult':_0x4f1301,'userMaps':_0x4b0700};},{'verbose':_0x424bf4[_0x24317d(0xc0)]})[_0x24317d(0x131)](_0x346b55=>_0x346b55[_0x24317d(0xd9)]),_0x3682e3=_0x14661c,_0x17d807=extractRootFolderId(_0x3682e3),_0x136dcb=_0x12319c,_0x11af83=_0x20de62,{journeys:_0x379a2e,activationStepsById:_0xbae728}=_0x4f9c23,_0xce8e74=new Map(_0x379a2e[_0x24317d(0x10c)](_0x5887e7=>[_0x5887e7['id'],_0x5887e7])),_0x49c908=_0x379a2e[_0x24317d(0x10c)](_0x107ac5=>({'id':_0x107ac5['id'],'name':_0x107ac5[_0x24317d(0x13b)][_0x24317d(0x132)],'journeyBundleName':_0x107ac5[_0x24317d(0x13b)][_0x24317d(0x10d)]||'','journeyBundleId':_0x107ac5[_0x24317d(0x13b)][_0x24317d(0x123)]||'','versionNumber':_0x107ac5[_0x24317d(0x13b)]['versionNumber'],'description':_0x107ac5[_0x24317d(0x13b)]['description'],'state':_0x107ac5['attributes'][_0x24317d(0x126)],'paused':_0x107ac5[_0x24317d(0x13b)][_0x24317d(0xe5)],'audienceId':_0x107ac5[_0x24317d(0x13b)][_0x24317d(0xed)],'folderId':_0x107ac5[_0x24317d(0x120)]?.['parentFolder']?.[_0x24317d(0xd9)]?.['id'],'createdAt':_0x107ac5['attributes'][_0x24317d(0x10a)],'updatedAt':_0x107ac5['attributes'][_0x24317d(0xf1)]})),{emailToId:_0x1abb49,idToEmail:_0x35243e}=_0x44703a,_0x3d9fc7=await withSpinner(_0x24317d(0x112),async()=>{const _0x11d5d3=_0x24317d,_0x5cdf39=await _0x16c5fa[_0x11d5d3(0xe3)][_0x11d5d3(0x114)]();return buildConnectionMaps(_0x5cdf39);},{'verbose':_0x424bf4[_0x24317d(0xc0)]})[_0x24317d(0x131)](_0xb07d0f=>_0xb07d0f[_0x24317d(0xd9)]),_0x446844=_0x3d9fc7[_0x24317d(0x11c)],_0x190c96=_0x3d9fc7[_0x24317d(0x130)],_0x2e18cb=_0x3d9fc7[_0x24317d(0x109)],_0x5f3324={'emailToIdMap':_0x1abb49,'connectionNameToIdMap':_0x446844,'connectionNameToTypeMap':_0x2e18cb,'getSchema':_0x11a0d4=>_0x16c5fa[_0x24317d(0xe3)][_0x24317d(0xe2)](_0x11a0d4)};let {pathToId:_0xc80322,idToPath:_0x56a9f3}=buildFolderMaps(_0x11af83);const _0x18933b=buildSegmentLookupMap(_0x136dcb,_0x56a9f3),_0x2b2d2e=buildSegmentNameToIdMap(_0x136dcb),_0x3e57da=buildJourneyBundleLookupMap(_0x49c908,_0x56a9f3);let _0x29ba03;if(_0xfc151e){if(!_0xfc151e[_0x24317d(0xcb)](_0x24317d(0xe4))&&!_0xfc151e[_0x24317d(0xcb)](_0x24317d(0xb5)))return console[_0x24317d(0x128)](a40_0x496244[_0x24317d(0x141)](_0x24317d(0x103)+_0xfc151e+'\x0a')),0x1;_0x29ba03=[_0xfc151e];}else _0x29ba03=findYamlFiles(_0x5851a1);if(_0x29ba03['length']===0x0)return console[_0x24317d(0x128)](a40_0x496244[_0x24317d(0x141)]('Error:\x20No\x20YAML\x20files\x20found\x20in\x20'+_0x5851a1+'\x0a')),console[_0x24317d(0x128)](a40_0x496244[_0x24317d(0x137)](_0x24317d(0x136))),0x1;let _0x2e1036,_0x2e8576;try{const _0x142899=parseAndClassifyYamlFiles(_0x29ba03,_0x5851a1,{'skipSegments':_0x424bf4[_0x24317d(0xf9)]});_0x2e1036=_0x142899[_0x24317d(0xd2)],_0x2e8576=_0x142899[_0x24317d(0x12d)];const _0x1a8063=validateParsedFiles(_0x142899,_0x5851a1);if(_0x1a8063[_0x24317d(0xbf)]>0x0)return console[_0x24317d(0x128)](a40_0x496244[_0x24317d(0x141)](_0x24317d(0xc3))),console[_0x24317d(0x128)](formatValidationErrors(_0x1a8063)),console['error'](a40_0x496244['yellow']('\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.')),0x1;}catch(_0x4973ea){return console['error'](a40_0x496244[_0x24317d(0x141)](_0x24317d(0xf5)+(_0x4973ea instanceof Error?_0x4973ea[_0x24317d(0x140)]:_0x4973ea))),0x1;}if(_0x2e1036[_0x24317d(0xbf)]===0x0&&_0x2e8576[_0x24317d(0xbf)]===0x0){const _0x45da8c=_0x424bf4['journeysOnly']?_0x24317d(0xfb):_0x24317d(0x13a);return console['error'](a40_0x496244['yellow'](_0x24317d(0xea)+_0x45da8c+'\x20YAML\x20files\x20found')),0x0;}const _0x162c3f=new Map();_0x136dcb[_0x24317d(0xbf)]>0x0&&!_0x424bf4[_0x24317d(0xf9)]&&await withSpinner(_0x24317d(0xc4),async()=>{await batchAsync(_0x136dcb,async _0x42eb26=>{const _0x43647b=a40_0xfbd0,_0x32b70f=await _0x16c5fa['segment'][_0x43647b(0xeb)](_0x374140,_0x42eb26['id']);_0x162c3f[_0x43647b(0x12c)](_0x42eb26['id'],_0x32b70f);});},{'verbose':_0x424bf4['verbose']});const {segmentFiles:_0x3fca31,foldersToCreate:_0x489752}=await prepareSegmentFiles(_0x2e1036,{'segmentByFolderAndName':_0x18933b,'activationsBySegmentId':_0x162c3f,'folderPathToId':_0xc80322,'idToEmailMap':_0x35243e,'connectionIdToNameMap':_0x190c96},_0x5f3324,_0x28bf70,_0x2d4ab9),_0x1df83b=_0xfc151e?[]:findSegmentsToDelete(_0x136dcb,_0x2e1036[_0x24317d(0x10c)](({yamlConfig:_0x24eb5f,folderPath:_0x99ed7d})=>({'yamlConfig':_0x24eb5f,'folderPath':resolveTDFolderPath(_0x99ed7d,_0x28bf70,_0x2d4ab9)})),_0x56a9f3,_0x2d4ab9,_0x28bf70),{journeyFiles:_0x24eca1,foldersToCreate:_0x2954fa}=await withProgressSpinner(_0x24317d(0x101),async _0x271085=>prepareJourneyFiles(_0x2e8576,{'fetchJourney':async _0x1fbec7=>_0x16c5fa['journey']['getJourney'](_0x1fbec7[_0x24317d(0xf3)]),'journeyBundlesByFolderAndName':_0x3e57da,'folderPathToId':_0xc80322,'idToEmailMap':_0x35243e,'connectionIdToNameMap':_0x190c96,'existingSegments':_0x136dcb,'parentId':_0x374140,'deps':_0x16c5fa,'progress':{'update':_0x28e51e=>{const _0x31f147=_0x24317d;_0x271085[_0x31f147(0xcd)](_0x28e51e),_0x424bf4[_0x31f147(0xc0)]&&console[_0x31f147(0x128)]('\x20\x20'+_0x28e51e);}},'journeyById':_0xce8e74,'activationStepsById':_0xbae728},_0x28bf70,_0x2d4ab9),{'verbose':_0x424bf4['verbose']})[_0x24317d(0x131)](_0x24628b=>_0x24628b[_0x24317d(0xd9)]);for(const _0x3e456c of _0x2954fa){_0x489752[_0x24317d(0xe7)](_0x3e456c);}const _0x5bc3fc=_0xfc151e?[]:findJourneysToDelete(_0x49c908,_0x2e8576['map'](({yamlConfig:_0x511454,folderPath:_0x3d83c2})=>({'yamlConfig':_0x511454,'folderPath':resolveTDFolderPath(_0x3d83c2,_0x28bf70,_0x2d4ab9)})),_0x56a9f3,_0x2d4ab9,_0x28bf70),_0x4124c4=calculatePushStats(_0x3fca31,_0x24eca1,_0x489752,_0x1df83b,_0x5bc3fc,!!_0x424bf4[_0x24317d(0x146)],!!_0x424bf4['journeysOnly']),_0x28f3d2=_0x4124c4[_0x24317d(0xd2)][_0x24317d(0x111)],_0x1d2c4b=_0x4124c4['segments'][_0x24317d(0x139)],_0x1cca2d=_0x4124c4['segments']['unchanged'],_0x55478f=_0x4124c4[_0x24317d(0xd2)][_0x24317d(0x12f)],_0x43f626=_0x4124c4[_0x24317d(0x135)][_0x24317d(0x11d)],_0x21dc6e=_0x4124c4['journeys']['new'],_0x218031=_0x4124c4[_0x24317d(0x12d)]['changed'],_0x96751d=_0x4124c4[_0x24317d(0x12d)]['unchanged'],_0x262e49=_0x4124c4[_0x24317d(0x12d)][_0x24317d(0x12f)],_0x222761=_0x4124c4[_0x24317d(0x13f)][_0x24317d(0x113)],_0x53c526=_0x4124c4[_0x24317d(0x13f)][_0x24317d(0x11d)],_0x3c5a3a=_0x4124c4[_0x24317d(0x13f)]['toUpdate'],_0x9af05=_0x4124c4[_0x24317d(0x13f)][_0x24317d(0x12f)];console[_0x24317d(0x128)](_0x24317d(0x118)+_0x31e9f5+'\x27:');_0x43f626['length']>0x0&&console[_0x24317d(0x128)]('\x20\x20'+a40_0x496244[_0x24317d(0x107)](_0x24317d(0x149)+_0x43f626[_0x24317d(0xbf)]+'\x20folders\x20to\x20create'));if(!_0x424bf4[_0x24317d(0xf9)]){console['error'](_0x24317d(0xb6)),console[_0x24317d(0x128)](_0x24317d(0xba)+a40_0x496244['green']('+\x20'+_0x28f3d2[_0x24317d(0xbf)]+_0x24317d(0xc2))),console[_0x24317d(0x128)](_0x24317d(0xba)+a40_0x496244[_0x24317d(0xb9)]('~\x20'+_0x1d2c4b[_0x24317d(0xbf)]+_0x24317d(0xb1)));if(_0x55478f['length']>0x0)console[_0x24317d(0x128)](_0x24317d(0xba)+a40_0x496244[_0x24317d(0x141)]('-\x20'+_0x55478f[_0x24317d(0xbf)]+_0x24317d(0x14c)));else _0x1df83b[_0x24317d(0xbf)]>0x0&&!_0x424bf4[_0x24317d(0x146)]&&console[_0x24317d(0x128)](_0x24317d(0xba)+a40_0x496244[_0x24317d(0xe6)](_0x1df83b[_0x24317d(0xbf)]+'\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)'));console[_0x24317d(0x128)](_0x24317d(0xba)+a40_0x496244[_0x24317d(0xe6)]('=\x20'+_0x1cca2d['length']+_0x24317d(0xcf)));}if(_0x24eca1[_0x24317d(0xbf)]>0x0||_0x5bc3fc[_0x24317d(0xbf)]>0x0){console[_0x24317d(0x128)]('\x20\x20🗺️\x20\x20Journeys:'),console[_0x24317d(0x128)](_0x24317d(0xba)+a40_0x496244[_0x24317d(0xb4)]('+\x20'+_0x21dc6e[_0x24317d(0xbf)]+_0x24317d(0xc2))),console[_0x24317d(0x128)]('\x20\x20\x20\x20'+a40_0x496244['yellow']('~\x20'+_0x218031[_0x24317d(0xbf)]+_0x24317d(0xb1)));if(_0x262e49[_0x24317d(0xbf)]>0x0)console[_0x24317d(0x128)]('\x20\x20\x20\x20'+a40_0x496244[_0x24317d(0x141)]('-\x20'+_0x262e49[_0x24317d(0xbf)]+_0x24317d(0x14c)));else _0x5bc3fc['length']>0x0&&!_0x424bf4[_0x24317d(0x146)]&&console[_0x24317d(0x128)](_0x24317d(0xba)+a40_0x496244['dim'](_0x5bc3fc['length']+_0x24317d(0x124)));console[_0x24317d(0x128)](_0x24317d(0xba)+a40_0x496244[_0x24317d(0xe6)]('=\x20'+_0x96751d[_0x24317d(0xbf)]+_0x24317d(0xcf)));}_0x222761[_0x24317d(0xbf)]>0x0&&!_0x424bf4[_0x24317d(0xf9)]&&(console['error'](''),console[_0x24317d(0x128)]('\x20\x20Activations:'),_0x53c526[_0x24317d(0xbf)]>0x0&&console['error'](_0x24317d(0xba)+a40_0x496244[_0x24317d(0xb4)]('+\x20'+_0x53c526[_0x24317d(0xbf)]+_0x24317d(0xbe))),_0x3c5a3a[_0x24317d(0xbf)]>0x0&&console['error'](_0x24317d(0xba)+a40_0x496244['yellow']('~\x20'+_0x3c5a3a[_0x24317d(0xbf)]+_0x24317d(0xdd))),_0x9af05['length']>0x0&&console[_0x24317d(0x128)](_0x24317d(0xba)+a40_0x496244[_0x24317d(0x141)]('-\x20'+_0x9af05[_0x24317d(0xbf)]+_0x24317d(0x14c))));console['error'](_0x24317d(0xd3)+a40_0x496244[_0x24317d(0x137)](_0x5851a1)+'\x0a');if(_0x43f626[_0x24317d(0xbf)]>0x0){console[_0x24317d(0x128)]('Folders\x20to\x20create:');for(const _0x56674a of _0x43f626){console['error']('\x20\x20'+a40_0x496244['blue']('+')+'\x20'+_0x56674a);}console[_0x24317d(0x128)]('');}if(_0x28f3d2[_0x24317d(0xbf)]>0x0&&!_0x424bf4['journeysOnly'])for(const _0x3e0c31 of _0x28f3d2){const _0x4e9572=_0x3e0c31[_0x24317d(0xf0)]?_0x3e0c31[_0x24317d(0xf0)]+'/'+_0x3e0c31[_0x24317d(0x145)][_0x24317d(0x132)]:_0x3e0c31['yamlConfig'][_0x24317d(0x132)],_0x4c66f4=_0x3e0c31[_0x24317d(0x145)][_0x24317d(0x13f)]?.[_0x24317d(0xbf)]||0x0,_0x4e77ea=_0x4c66f4>0x0?a40_0x496244[_0x24317d(0xe6)]('\x20['+_0x4c66f4+'\x20activations]'):'';console[_0x24317d(0x128)]('\x0a'+a40_0x496244[_0x24317d(0xb4)](_0x24317d(0x142))+'\x20'+_0x4e9572+_0x4e77ea),console[_0x24317d(0x128)]('─'['repeat'](0x3c)),_0x3e0c31['diff']&&console[_0x24317d(0x128)](_0x3e0c31[_0x24317d(0xee)]),console[_0x24317d(0x128)]('─'[_0x24317d(0xc1)](0x3c));}if(_0x55478f[_0x24317d(0xbf)]>0x0&&!_0x424bf4[_0x24317d(0xf9)])for(const _0x2ac60b of _0x55478f){const _0x4165a=_0x2ac60b['segmentFolderId']?_0x56a9f3[_0x24317d(0xf4)](_0x2ac60b[_0x24317d(0xf6)][_0x24317d(0xfa)]())||'':'',_0x295eea=_0x4165a?_0x4165a+'/'+_0x2ac60b[_0x24317d(0x132)]:_0x2ac60b[_0x24317d(0x132)],_0x118c39=_0x162c3f[_0x24317d(0xf4)](_0x2ac60b['id'])||[],_0x247de2=_0x118c39[_0x24317d(0xbf)]>0x0?a40_0x496244['dim']('\x20['+_0x118c39[_0x24317d(0xbf)]+_0x24317d(0xe8)):'';console[_0x24317d(0x128)]('\x0a'+a40_0x496244['red'](_0x24317d(0x14a))+'\x20'+_0x295eea+_0x247de2),console[_0x24317d(0x128)]('─'[_0x24317d(0xc1)](0x3c));const _0x276081=segmentWithActivationsToYaml(_0x2ac60b,_0x118c39,undefined,_0x35243e,_0x190c96),_0x5baad5=segmentToYamlString(_0x276081),_0x5362ba=generateDiff(_0x5baad5,'');console[_0x24317d(0x128)](formatDiffWithColors(_0x5362ba)),console['error']('─'[_0x24317d(0xc1)](0x3c));}const _0x1c490f=_0x3fca31[_0x24317d(0xda)](_0x3c3709=>!_0x3c3709[_0x24317d(0x133)]&&_0x3c3709[_0x24317d(0xee)]);if(_0x1c490f[_0x24317d(0xbf)]>0x0&&!_0x424bf4[_0x24317d(0xf9)])for(const _0x489a56 of _0x1c490f){const _0x4b7ee6=_0x489a56[_0x24317d(0xf0)]?_0x489a56[_0x24317d(0xf0)]+'/'+_0x489a56[_0x24317d(0x145)][_0x24317d(0x132)]:_0x489a56[_0x24317d(0x145)][_0x24317d(0x132)];console[_0x24317d(0x128)]('\x0a'+a40_0x496244['yellow'](_0x24317d(0xde))+'\x20'+_0x4b7ee6),console[_0x24317d(0x128)]('─'[_0x24317d(0xc1)](0x3c)),console[_0x24317d(0x128)](_0x489a56[_0x24317d(0xee)]),console['error']('─'[_0x24317d(0xc1)](0x3c));}if(_0x21dc6e[_0x24317d(0xbf)]>0x0)for(const _0xe2c71 of _0x21dc6e){const _0x2d11dd=_0xe2c71[_0x24317d(0xf0)]?_0xe2c71[_0x24317d(0xf0)]+'/'+_0xe2c71[_0x24317d(0x145)][_0x24317d(0x132)]:_0xe2c71[_0x24317d(0x145)][_0x24317d(0x132)];console['error']('\x0a'+a40_0x496244[_0x24317d(0xb4)]('New\x20journey:')+'\x20'+_0x2d11dd),console[_0x24317d(0x128)]('─'['repeat'](0x3c)),_0xe2c71[_0x24317d(0xee)]&&console[_0x24317d(0x128)](_0xe2c71[_0x24317d(0xee)]),console[_0x24317d(0x128)]('─'['repeat'](0x3c));}const _0x458140=_0x24eca1[_0x24317d(0xda)](_0x4b9b2d=>!_0x4b9b2d['isNew']&&_0x4b9b2d[_0x24317d(0xee)]);if(_0x458140[_0x24317d(0xbf)]>0x0)for(const _0x28e296 of _0x458140){const _0x1d1c11=_0x28e296[_0x24317d(0xf0)]?_0x28e296[_0x24317d(0xf0)]+'/'+_0x28e296[_0x24317d(0x145)][_0x24317d(0x132)]:_0x28e296[_0x24317d(0x145)][_0x24317d(0x132)];console[_0x24317d(0x128)]('\x0a'+a40_0x496244[_0x24317d(0xb9)](_0x24317d(0xd0))+'\x20'+_0x1d1c11),console[_0x24317d(0x128)]('─'['repeat'](0x3c)),console['error'](_0x28e296[_0x24317d(0xee)]),console['error']('─'['repeat'](0x3c));}if(_0x262e49[_0x24317d(0xbf)]>0x0)for(const _0x2c31ec of _0x262e49){const _0x1a1c14=_0x2c31ec['folderId']?_0x56a9f3[_0x24317d(0xf4)](_0x2c31ec[_0x24317d(0xe0)])||'':'',_0x445819=_0x1a1c14?_0x1a1c14+'/'+_0x2c31ec[_0x24317d(0x10d)]:_0x2c31ec[_0x24317d(0x10d)];console['error']('\x0a'+a40_0x496244[_0x24317d(0x141)](_0x24317d(0xc9))+'\x20'+_0x445819),console[_0x24317d(0x128)]('─'[_0x24317d(0xc1)](0x3c)),console[_0x24317d(0x128)](a40_0x496244[_0x24317d(0x141)](_0x24317d(0xb2))),console[_0x24317d(0x128)]('─'[_0x24317d(0xc1)](0x3c));}if(_0x424bf4['dryRun'])return console[_0x24317d(0x128)](a40_0x496244[_0x24317d(0xb9)](_0x24317d(0x110))),0x0;const _0x5a776e=_0x424bf4['journeysOnly']?![]:_0x28f3d2[_0x24317d(0xbf)]>0x0||_0x1d2c4b[_0x24317d(0xbf)]>0x0||_0x55478f[_0x24317d(0xbf)]>0x0,_0x581038=_0x21dc6e[_0x24317d(0xbf)]>0x0||_0x218031['length']>0x0||_0x262e49[_0x24317d(0xbf)]>0x0,_0x39e873=_0x424bf4[_0x24317d(0xf9)]?![]:_0x222761[_0x24317d(0xbf)]>0x0,_0x380e6d=_0x43f626[_0x24317d(0xbf)]>0x0;if(!_0x5a776e&&!_0x581038&&!_0x39e873&&!_0x380e6d){const _0x2e8d74=_0x424bf4['journeysOnly']?_0x24317d(0x138):_0x24317d(0x104);console[_0x24317d(0x128)](a40_0x496244[_0x24317d(0xb4)](_0x2e8d74));if(_0xfc151e&&_0x1cca2d['length']===0x1){const _0x222164=_0x1cca2d[0x0];if(_0x222164[_0x24317d(0xf8)]?.['id']){const _0x75bc61=getConsoleNextUrl(_0x424bf4[_0x24317d(0x122)],_0x24317d(0x13c)+_0x374140+_0x24317d(0xc8)+_0x222164[_0x24317d(0xf8)]['id']+_0x24317d(0x14d));console[_0x24317d(0x128)](_0x24317d(0xcc)+a40_0x496244[_0x24317d(0x137)](_0x75bc61));}}if(_0xfc151e&&_0x96751d[_0x24317d(0xbf)]===0x1){const _0x33b2f6=_0x96751d[0x0];if(_0x33b2f6['existingJourney']?.['id']){const _0x358f19=getConsoleNextUrl(_0x424bf4[_0x24317d(0x122)],_0x24317d(0x13c)+_0x374140+'/e/'+_0x33b2f6['existingJourney']['id']+_0x24317d(0x116));console['error']('\x20\x20'+a40_0x496244['cyan'](_0x358f19));}}return 0x0;}const _0x5adb2f=_0x424bf4['journeysOnly']?_0x21dc6e[_0x24317d(0xbf)]+_0x218031[_0x24317d(0xbf)]+_0x262e49[_0x24317d(0xbf)]+_0x43f626[_0x24317d(0xbf)]:_0x28f3d2[_0x24317d(0xbf)]+_0x1d2c4b[_0x24317d(0xbf)]+_0x55478f[_0x24317d(0xbf)]+_0x21dc6e[_0x24317d(0xbf)]+_0x218031['length']+_0x262e49['length']+_0x43f626[_0x24317d(0xbf)]+_0x222761[_0x24317d(0xbf)];if(!_0x424bf4[_0x24317d(0xbb)]&&_0x5adb2f>0x0){if(!isInteractive())return console[_0x24317d(0x128)](a40_0x496244[_0x24317d(0x141)]('\x0aError:'),_0x24317d(0xf7)),console[_0x24317d(0x128)](a40_0x496244['dim'](_0x24317d(0xf2))),0x1;const _0x37a1e2=await confirmKey('Push\x20'+_0x5adb2f+'\x20changes?');if(!_0x37a1e2)return console['error'](a40_0x496244[_0x24317d(0xb9)](_0x24317d(0x11e))),0x1;}const _0x1fd5d2={'withProgress':async(_0x21ef18,_0x97480e)=>{const _0x17e5d4=_0x24317d,_0x55f9a6=await withSpinner(_0x21ef18,_0x97480e,{'verbose':_0x424bf4['verbose']});return{'data':_0x55f9a6[_0x17e5d4(0xd9)]};},'logInfo':_0x27ee44=>console[_0x24317d(0x128)](a40_0x496244[_0x24317d(0x107)]('✔\x20'+_0x27ee44)),'logSuccess':_0x422dd0=>console[_0x24317d(0x128)](a40_0x496244[_0x24317d(0xb4)]('✔\x20'+_0x422dd0)),'logWarning':_0x310cc3=>console[_0x24317d(0x128)](a40_0x496244[_0x24317d(0xb9)]('⚠\x20'+_0x310cc3)),'logDeleted':_0x2c81a9=>console[_0x24317d(0x128)](a40_0x496244[_0x24317d(0x141)]('✔\x20'+_0x2c81a9))},_0x5ebca0={'segment':_0x16c5fa['segment'],'journey':_0x16c5fa['journey'],'user':_0x16c5fa['user'],'connection':_0x16c5fa[_0x24317d(0xe3)]};_0x43f626[_0x24317d(0xbf)]>0x0&&(_0xc80322=await executePushFolders(_0x5ebca0,_0x43f626,_0xc80322,{'parentId':_0x374140},_0x1fd5d2));const _0x38d0e7={'rootFolderId':_0x17d807,'folderPathToId':_0xc80322,'folderIdToPath':_0x56a9f3,'segmentNameToId':_0x2b2d2e,'activationsBySegmentId':_0x162c3f,'emailToIdMap':_0x1abb49,'idToEmailMap':_0x35243e,'connectionNameToIdMap':_0x3d9fc7[_0x24317d(0x11c)],'connectionIdToNameMap':_0x3d9fc7['idToName'],'connectionNameToTypeMap':_0x2e18cb},_0x5bdd9d=await executePushSegments(_0x5ebca0,_0x424bf4[_0x24317d(0xf9)]?[]:_0x3fca31,_0x38d0e7,{'parentId':_0x374140},_0x1fd5d2),_0x1de30a=_0x5bdd9d[_0x24317d(0x12b)],_0x21bafb=_0x5bdd9d[_0x24317d(0xd6)],_0x465ab6=_0x5bdd9d[_0x24317d(0x13f)][_0x24317d(0x12b)],_0x2cb3da=_0x5bdd9d[_0x24317d(0x13f)][_0x24317d(0xd6)],_0x3b143c=_0x5bdd9d[_0x24317d(0x13f)][_0x24317d(0x134)];let _0x5bb822;if(_0xfc151e&&_0x3fca31[_0x24317d(0xbf)]===0x1){const _0x3b611b=_0x3fca31[0x0];_0x5bb822=_0x3b611b['existingSegment']?.['id']??_0x5bdd9d[_0x24317d(0x100)][_0x24317d(0xf4)](_0x3b611b['yamlConfig'][_0x24317d(0x132)]);}const _0x18bbf2=await executePushSegmentDeletions(_0x5ebca0,_0x424bf4[_0x24317d(0xf9)]?[]:_0x55478f,_0x1fd5d2);let _0x109ebe=0x0,_0x467067=0x0,_0x5db0cc=0x0;const _0x47118e=new Map(_0x2b2d2e);for(const [_0x3ca3d3,_0x23e160]of _0x5bdd9d[_0x24317d(0x100)]){_0x47118e[_0x24317d(0x12c)](_0x3ca3d3,_0x23e160);}if(_0x24eca1[_0x24317d(0xbf)]>0x0){const _0xaf0d91={..._0x38d0e7,'segmentNameToId':_0x47118e,'existingSegments':_0x136dcb,'activationContext':_0x5f3324},_0x4d968b=await executePushJourneys(_0x5ebca0,_0x24eca1,_0xaf0d91,{'parentId':_0x374140,'rootFolderId':_0x17d807,'verbose':_0x424bf4[_0x24317d(0xc0)]},_0x1fd5d2);_0x109ebe=_0x4d968b[_0x24317d(0x12b)],_0x467067=_0x4d968b['updated'];if(_0xfc151e&&_0x4d968b[_0x24317d(0xd8)][_0x24317d(0xbf)]===0x1){const _0x5609f6=_0x4d968b[_0x24317d(0xd8)][0x0];if(_0x5609f6[_0x24317d(0xf3)]){const _0x14fff4=getConsoleNextUrl(_0x424bf4['site'],'/app/ps/'+_0x374140+'/e/'+_0x5609f6['journeyId']+'/j/da/je');console[_0x24317d(0x128)]('\x20\x20'+a40_0x496244[_0x24317d(0x137)](_0x14fff4));}}}for(const _0x31f6d6 of _0x262e49){console[_0x24317d(0x128)](a40_0x496244[_0x24317d(0xb9)]('⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20'+_0x31f6d6[_0x24317d(0x10d)])),_0x5db0cc++;}const _0x23188f=[];if(_0x1de30a>0x0)_0x23188f[_0x24317d(0x106)](_0x1de30a+_0x24317d(0x121));if(_0x21bafb>0x0)_0x23188f[_0x24317d(0x106)](_0x21bafb+_0x24317d(0xb3));if(_0x18bbf2>0x0)_0x23188f['push'](_0x18bbf2+_0x24317d(0x13d));const _0x1679f5=[];if(_0x109ebe>0x0)_0x1679f5[_0x24317d(0x106)](_0x109ebe+_0x24317d(0x121));if(_0x467067>0x0)_0x1679f5[_0x24317d(0x106)](_0x467067+_0x24317d(0xb3));if(_0x5db0cc>0x0)_0x1679f5['push'](_0x5db0cc+_0x24317d(0x13d));const _0x53f0f6=[];if(_0x465ab6>0x0)_0x53f0f6[_0x24317d(0x106)](_0x465ab6+_0x24317d(0x121));if(_0x2cb3da>0x0)_0x53f0f6[_0x24317d(0x106)](_0x2cb3da+_0x24317d(0xb3));if(_0x3b143c>0x0)_0x53f0f6[_0x24317d(0x106)](_0x3b143c+_0x24317d(0x13d));console[_0x24317d(0x128)](a40_0x496244[_0x24317d(0xb4)](_0x24317d(0xff)));_0x23188f[_0x24317d(0xbf)]>0x0&&!_0x424bf4[_0x24317d(0xf9)]&&console[_0x24317d(0x128)](_0x24317d(0xc5)+_0x23188f[_0x24317d(0xfd)](',\x20'));_0x1679f5[_0x24317d(0xbf)]>0x0&&console['error'](_0x24317d(0x10f)+_0x1679f5[_0x24317d(0xfd)](',\x20'));_0x53f0f6[_0x24317d(0xbf)]>0x0&&!_0x424bf4[_0x24317d(0xf9)]&&console[_0x24317d(0x128)](_0x24317d(0xd1)+_0x53f0f6[_0x24317d(0xfd)](',\x20'));if(_0x5bb822){const _0x564d21=getConsoleNextUrl(_0x424bf4['site'],_0x24317d(0x13c)+_0x374140+_0x24317d(0xc8)+_0x5bb822+_0x24317d(0x14d));console[_0x24317d(0x128)](_0x24317d(0xcc)+a40_0x496244[_0x24317d(0x137)](_0x564d21));}return 0x0;}}
@@ -1 +1 @@
1
- const a41_0x1e950f=a41_0x4150;(function(_0xe1c97c,_0x447b1a){const _0x5359b0=a41_0x4150,_0x2da91c=_0xe1c97c();while(!![]){try{const _0x585eb4=parseInt(_0x5359b0(0xae))/0x1+-parseInt(_0x5359b0(0xba))/0x2*(parseInt(_0x5359b0(0xc5))/0x3)+-parseInt(_0x5359b0(0xaa))/0x4*(-parseInt(_0x5359b0(0xad))/0x5)+parseInt(_0x5359b0(0xc9))/0x6+-parseInt(_0x5359b0(0xbd))/0x7+-parseInt(_0x5359b0(0xd4))/0x8+-parseInt(_0x5359b0(0xb1))/0x9*(-parseInt(_0x5359b0(0xa9))/0xa);if(_0x585eb4===_0x447b1a)break;else _0x2da91c['push'](_0x2da91c['shift']());}catch(_0x31352d){_0x2da91c['push'](_0x2da91c['shift']());}}}(a41_0x3e62,0x66f42));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';function a41_0x3e62(){const _0x2dd5af=['execute','3dHBkVv','Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]','Updating\x20segment\x20\x27','error','569634cVcDzX','Parent\x20ID:\x20','Update\x20existing\x20child\x20segment','resolveFolderId','Resolved\x20type:\x20','⚠\x20Deprecation\x20warning:\x20`segment\x20update`\x20is\x20deprecated.','name','length','\x27...','segmentName','segment','5126320aMcMXi','segment:update','updateSegmentById','Segment\x20ID\x20missing\x20from\x20resolved\x20path','segmentPath','segmentId','.\x20Only\x20child\x20segments\x20can\x20be\x20updated.','includes','570enxOGH','2733796RxZZLl','Resolved\x20relative\x20path\x20to:\x20','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','5tAJLhQ','801503BYzWCQ','yellow','Resolved\x20folder\x20ID:\x20','87336SkdFUq','\x20\x20\x20Path:\x20','\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22','INTERNAL','folder','type','verbose','Segment\x20ID:\x20','rule','1360434TvUdXK','\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','Error:\x20Cannot\x20update\x20','2732198aoYabS','data','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','description','parentId','kind','resolvePathToResource'];a41_0x3e62=function(){return _0x2dd5af;};return a41_0x3e62();}import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{SDKError,ErrorCode}from'../sdk/index.js';function a41_0x4150(_0x323f68,_0x565e60){_0x323f68=_0x323f68-0xa3;const _0x3e627e=a41_0x3e62();let _0x415030=_0x3e627e[_0x323f68];return _0x415030;}import a41_0x3eef94 from'chalk';export class SegmentUpdateCommand extends BaseCommand{[a41_0x1e950f(0xcf)]=a41_0x1e950f(0xd5);['description']=a41_0x1e950f(0xcb);async[a41_0x1e950f(0xc4)](_0x6be908){const _0x370fbb=a41_0x1e950f;console[_0x370fbb(0xc8)](a41_0x3eef94[_0x370fbb(0xaf)](_0x370fbb(0xce))),console['error'](a41_0x3eef94[_0x370fbb(0xaf)](_0x370fbb(0xac)));const {options:_0x4591ba,args:_0x45738e,tdx:_0x1db3eb}=_0x6be908,_0xc8d3fb=_0x4591ba;if(_0x45738e[_0x370fbb(0xd0)]===0x0)return console['error'](_0x370fbb(0xbf)),console[_0x370fbb(0xc8)]('Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]'),console[_0x370fbb(0xc8)]('Examples:'),console[_0x370fbb(0xc8)](_0x370fbb(0xb3)),console[_0x370fbb(0xc8)](_0x370fbb(0xbb)),0x1;const _0x1fc43b=_0x45738e[0x0],_0x4be62c=_0x4591ba[_0x370fbb(0xa5)];let _0x3a2a38=_0x1fc43b;_0x4be62c&&!_0x1fc43b[_0x370fbb(0xa8)]('/')&&(_0x3a2a38=_0x4be62c+'/'+_0x1fc43b,_0xc8d3fb[_0x370fbb(0xb7)]&&console[_0x370fbb(0xc8)](_0x370fbb(0xab)+_0x3a2a38));const _0x4239ac=await withSpinner('Resolving\x20path\x20\x27'+_0x3a2a38+_0x370fbb(0xd1),()=>_0x1db3eb[_0x370fbb(0xd3)][_0x370fbb(0xc3)](_0x3a2a38),{'verbose':_0xc8d3fb[_0x370fbb(0xb7)]}),_0x532a30=_0x4239ac[_0x370fbb(0xbe)];_0xc8d3fb[_0x370fbb(0xb7)]&&console[_0x370fbb(0xc8)](_0x370fbb(0xcd)+_0x532a30[_0x370fbb(0xb6)]);if(_0x532a30[_0x370fbb(0xb6)]!==_0x370fbb(0xd3))return console[_0x370fbb(0xc8)](_0x370fbb(0xbc)+_0x532a30['type']+_0x370fbb(0xa7)),console[_0x370fbb(0xc8)](_0x370fbb(0xc6)),0x1;if(!_0x532a30[_0x370fbb(0xa6)])throw new SDKError(ErrorCode[_0x370fbb(0xb4)],_0x370fbb(0xa4));const _0x199f8d=_0x532a30[_0x370fbb(0xc1)],_0x23d539=_0x532a30['segmentId'];_0xc8d3fb['verbose']&&(console[_0x370fbb(0xc8)](_0x370fbb(0xca)+_0x199f8d),console[_0x370fbb(0xc8)](_0x370fbb(0xb8)+_0x23d539));let _0x229beb;if(_0xc8d3fb[_0x370fbb(0xb5)]){const _0xf235f1=_0xc8d3fb[_0x370fbb(0xb5)],_0x2a8ecf=await withSpinner('Resolving\x20folder\x20\x27'+_0xf235f1+_0x370fbb(0xd1),()=>_0x1db3eb[_0x370fbb(0xd3)][_0x370fbb(0xcc)](_0x199f8d,_0xf235f1),{'verbose':_0xc8d3fb[_0x370fbb(0xb7)]});_0x229beb=parseInt(_0x2a8ecf[_0x370fbb(0xbe)],0xa),_0xc8d3fb['verbose']&&console[_0x370fbb(0xc8)](_0x370fbb(0xb0)+_0x229beb);}const _0x4652f6=await loadJSONFromOptions(_0xc8d3fb[_0x370fbb(0xb9)],_0xc8d3fb['ruleFile']),_0x449714={'name':_0xc8d3fb[_0x370fbb(0xcf)],'description':_0xc8d3fb[_0x370fbb(0xc0)],'rule':_0x4652f6,'kind':_0xc8d3fb[_0x370fbb(0xc2)]!==undefined?parseInt(_0xc8d3fb[_0x370fbb(0xc2)],0xa):undefined,'segmentFolderId':_0x229beb},_0x15ed78=await withSpinner(_0x370fbb(0xc7)+_0x532a30[_0x370fbb(0xd2)]+_0x370fbb(0xd1),()=>_0x1db3eb['segment'][_0x370fbb(0xa3)](_0x199f8d,_0x23d539,_0x449714),{'verbose':_0xc8d3fb['verbose']}),_0x3bbf58=_0x15ed78[_0x370fbb(0xbe)];return console[_0x370fbb(0xc8)]('✔\x20Updated\x20segment\x20\x27'+_0x3bbf58['name']+'\x27'),_0x3a2a38!==_0x1fc43b&&console[_0x370fbb(0xc8)](_0x370fbb(0xb2)+_0x3a2a38),await handleSDKOutput([_0x3bbf58],_0xc8d3fb),0x0;}}
1
+ const a41_0x309198=a41_0x49bc;(function(_0x138032,_0xb839c9){const _0x204a36=a41_0x49bc,_0x5ff6b7=_0x138032();while(!![]){try{const _0x46dc71=parseInt(_0x204a36(0x18a))/0x1+-parseInt(_0x204a36(0x190))/0x2*(parseInt(_0x204a36(0x19a))/0x3)+-parseInt(_0x204a36(0x19d))/0x4*(parseInt(_0x204a36(0x194))/0x5)+parseInt(_0x204a36(0x1a4))/0x6+parseInt(_0x204a36(0x1b0))/0x7+-parseInt(_0x204a36(0x197))/0x8+parseInt(_0x204a36(0x1b1))/0x9*(parseInt(_0x204a36(0x1a0))/0xa);if(_0x46dc71===_0xb839c9)break;else _0x5ff6b7['push'](_0x5ff6b7['shift']());}catch(_0x49158f){_0x5ff6b7['push'](_0x5ff6b7['shift']());}}}(a41_0x30f9,0xbf08d));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';function a41_0x49bc(_0x31a115,_0x363457){_0x31a115=_0x31a115-0x188;const _0x30f91d=a41_0x30f9();let _0x49bc2d=_0x30f91d[_0x31a115];return _0x49bc2d;}import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{SDKError,ErrorCode}from'../sdk/index.js';function a41_0x30f9(){const _0x3072c9=['\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22','.\x20Only\x20child\x20segments\x20can\x20be\x20updated.','Resolved\x20relative\x20path\x20to:\x20','Examples:','error','data','9541602aKAKoj','1906299xluaKl','Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]','segmentName','name','Resolving\x20path\x20\x27','segmentId','updateSegmentById','verbose','\x27...','segment','\x20\x20\x20Path:\x20','1011519rTvilx','description','folder','kind','parentId','Resolved\x20folder\x20ID:\x20','792QwIVDt','INTERNAL','type','length','49195fnOTft','Segment\x20ID:\x20','execute','5534912VdMnRY','Resolving\x20folder\x20\x27','resolvePathToResource','8961tpafOD','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','Updating\x20segment\x20\x27','612rKWfZX','Update\x20existing\x20child\x20segment','✔\x20Updated\x20segment\x20\x27','20XDaXyi','⚠\x20Deprecation\x20warning:\x20`segment\x20update`\x20is\x20deprecated.','Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]','segmentPath','8185998XQJXod','Parent\x20ID:\x20','yellow','Segment\x20ID\x20missing\x20from\x20resolved\x20path','ruleFile','resolveFolderId'];a41_0x30f9=function(){return _0x3072c9;};return a41_0x30f9();}import a41_0x5cfa58 from'chalk';export class SegmentUpdateCommand extends BaseCommand{[a41_0x309198(0x1b4)]='segment:update';[a41_0x309198(0x18b)]=a41_0x309198(0x19e);async[a41_0x309198(0x196)](_0x20951a){const _0x11067d=a41_0x309198;console[_0x11067d(0x1ae)](a41_0x5cfa58[_0x11067d(0x1a6)](_0x11067d(0x1a1))),console[_0x11067d(0x1ae)](a41_0x5cfa58[_0x11067d(0x1a6)]('\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a'));const {options:_0x183118,args:_0x4b4b3d,tdx:_0x470039}=_0x20951a,_0x5f10b0=_0x183118;if(_0x4b4b3d[_0x11067d(0x193)]===0x0)return console[_0x11067d(0x1ae)](_0x11067d(0x19b)),console[_0x11067d(0x1ae)](_0x11067d(0x1a2)),console[_0x11067d(0x1ae)](_0x11067d(0x1ad)),console[_0x11067d(0x1ae)](_0x11067d(0x1aa)),console[_0x11067d(0x1ae)]('\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context'),0x1;const _0x29d7d9=_0x4b4b3d[0x0],_0x47cc1d=_0x183118[_0x11067d(0x1a3)];let _0x4848cc=_0x29d7d9;_0x47cc1d&&!_0x29d7d9['includes']('/')&&(_0x4848cc=_0x47cc1d+'/'+_0x29d7d9,_0x5f10b0[_0x11067d(0x1b8)]&&console['error'](_0x11067d(0x1ac)+_0x4848cc));const _0x36af2f=await withSpinner(_0x11067d(0x1b5)+_0x4848cc+'\x27...',()=>_0x470039['segment'][_0x11067d(0x199)](_0x4848cc),{'verbose':_0x5f10b0[_0x11067d(0x1b8)]}),_0x281796=_0x36af2f[_0x11067d(0x1af)];_0x5f10b0[_0x11067d(0x1b8)]&&console['error']('Resolved\x20type:\x20'+_0x281796[_0x11067d(0x192)]);if(_0x281796[_0x11067d(0x192)]!==_0x11067d(0x188))return console[_0x11067d(0x1ae)]('Error:\x20Cannot\x20update\x20'+_0x281796['type']+_0x11067d(0x1ab)),console[_0x11067d(0x1ae)](_0x11067d(0x1b2)),0x1;if(!_0x281796[_0x11067d(0x1b6)])throw new SDKError(ErrorCode[_0x11067d(0x191)],_0x11067d(0x1a7));const _0x2d0ec5=_0x281796[_0x11067d(0x18e)],_0x29ec70=_0x281796[_0x11067d(0x1b6)];_0x5f10b0['verbose']&&(console[_0x11067d(0x1ae)](_0x11067d(0x1a5)+_0x2d0ec5),console[_0x11067d(0x1ae)](_0x11067d(0x195)+_0x29ec70));let _0x29e1fb;if(_0x5f10b0[_0x11067d(0x18c)]){const _0x4776a2=_0x5f10b0[_0x11067d(0x18c)],_0x3eb88b=await withSpinner(_0x11067d(0x198)+_0x4776a2+'\x27...',()=>_0x470039['segment'][_0x11067d(0x1a9)](_0x2d0ec5,_0x4776a2),{'verbose':_0x5f10b0['verbose']});_0x29e1fb=parseInt(_0x3eb88b['data'],0xa),_0x5f10b0[_0x11067d(0x1b8)]&&console['error'](_0x11067d(0x18f)+_0x29e1fb);}const _0x3eb38a=await loadJSONFromOptions(_0x5f10b0['rule'],_0x5f10b0[_0x11067d(0x1a8)]),_0x4dcc7b={'name':_0x5f10b0[_0x11067d(0x1b4)],'description':_0x5f10b0[_0x11067d(0x18b)],'rule':_0x3eb38a,'kind':_0x5f10b0[_0x11067d(0x18d)]!==undefined?parseInt(_0x5f10b0['kind'],0xa):undefined,'segmentFolderId':_0x29e1fb},_0x17249b=await withSpinner(_0x11067d(0x19c)+_0x281796[_0x11067d(0x1b3)]+_0x11067d(0x1b9),()=>_0x470039['segment'][_0x11067d(0x1b7)](_0x2d0ec5,_0x29ec70,_0x4dcc7b),{'verbose':_0x5f10b0[_0x11067d(0x1b8)]}),_0x51005b=_0x17249b[_0x11067d(0x1af)];return console[_0x11067d(0x1ae)](_0x11067d(0x19f)+_0x51005b[_0x11067d(0x1b4)]+'\x27'),_0x4848cc!==_0x29d7d9&&console[_0x11067d(0x1ae)](_0x11067d(0x189)+_0x4848cc),await handleSDKOutput([_0x51005b],_0x5f10b0),0x0;}}
@@ -1 +1 @@
1
- const a42_0xbf23c7=a42_0x3577;(function(_0x22c163,_0x565d01){const _0x3e7691=a42_0x3577,_0xbea2a=_0x22c163();while(!![]){try{const _0x1f8c9e=parseInt(_0x3e7691(0x1a7))/0x1+-parseInt(_0x3e7691(0x19a))/0x2+-parseInt(_0x3e7691(0x18d))/0x3*(-parseInt(_0x3e7691(0x19c))/0x4)+parseInt(_0x3e7691(0x1b0))/0x5+-parseInt(_0x3e7691(0x1c1))/0x6+parseInt(_0x3e7691(0x19b))/0x7*(parseInt(_0x3e7691(0x18e))/0x8)+-parseInt(_0x3e7691(0x18f))/0x9*(-parseInt(_0x3e7691(0x1b8))/0xa);if(_0x1f8c9e===_0x565d01)break;else _0xbea2a['push'](_0xbea2a['shift']());}catch(_0x4f736e){_0xbea2a['push'](_0xbea2a['shift']());}}}(a42_0x160a,0x3c513));function a42_0x3577(_0x3b9df7,_0x1f3e16){_0x3b9df7=_0x3b9df7-0x18c;const _0x160a5a=a42_0x160a();let _0x35775d=_0x160a5a[_0x3b9df7];return _0x35775d;}import{existsSync,statSync}from'fs';import a42_0xd13575 from'chalk';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';function a42_0x160a(){const _0x3eae8d=['745112AasYKg','954ijuIfH','green','Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context','Use\x20\x22tdx\x20use\x22\x20to\x20see\x20all\x20context\x20parameters','data','join','\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context','cyan','Use:\x20tdx\x20segment\x20use\x20','name','type','787122BGfMhQ','7hsUSpw','12pZyvXF','Error:\x20Path\x20is\x20required\x0a','segment:use','length','parent_segment','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','log','description','parentId','56218MjKiih','error','Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.','Target\x20path:\x20','resolvePathToResource','slice','✔\x20Context\x20set\x20to:\x20','fullPath','config','340150LSDQGt','Usage:\x20tdx\x20segment\x20use\x20<path>','Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.','site','dim','\x27...','Site:\x20','Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','37330ioeATR','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22','parentName','isAbsolute','Folder\x20ID:\x20','folderPath','Parent\x20ID:\x20','folderId','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22','873552iCQBKX','isDirectory','red','Examples:','Resolved\x20path\x20type:\x20','✔\x20Context\x20cleared.\x20Back\x20to\x20root.','173127TZvKln'];a42_0x160a=function(){return _0x3eae8d;};return a42_0x160a();}export class SegmentUseCommand extends BaseCommand{[a42_0xbf23c7(0x198)]=a42_0xbf23c7(0x19e);[a42_0xbf23c7(0x1a5)]='Set\x20current\x20segment/folder\x20context\x20for\x20navigation';async['execute'](_0x593798){const _0xc1594b=a42_0xbf23c7,{options:_0x2df0d5,args:_0x4f10a1,tdx:_0x52e097}=_0x593798;if(_0x4f10a1[_0xc1594b(0x19f)]===0x0)return console[_0xc1594b(0x1a8)](a42_0xd13575[_0xc1594b(0x1c3)](_0xc1594b(0x19d))),console[_0xc1594b(0x1a8)](_0xc1594b(0x1b1)),console[_0xc1594b(0x1a8)](_0xc1594b(0x1c4)),console[_0xc1594b(0x1a8)](_0xc1594b(0x1b9)),console[_0xc1594b(0x1a8)](_0xc1594b(0x1c0)),console[_0xc1594b(0x1a8)](_0xc1594b(0x195)),console[_0xc1594b(0x1a8)](_0xc1594b(0x1a2)),0x1;const _0x32c4e9=_0x4f10a1[0x0],_0x3f5f72=_0x2df0d5['session'];try{if(_0x32c4e9==='/')return saveSessionContext({'segment_path':undefined},_0x3f5f72),console['log'](a42_0xd13575['green']('✔\x20Context\x20cleared.\x20Back\x20to\x20root.')),0x0;if(existsSync(_0x32c4e9)&&statSync(_0x32c4e9)[_0xc1594b(0x1c2)]()){let _0x4d749d;try{_0x4d749d=findTdxConfig(_0x32c4e9);}catch{return console[_0xc1594b(0x1a8)](a42_0xd13575[_0xc1594b(0x1c3)](_0xc1594b(0x1b7)+_0x32c4e9)),console['error'](a42_0xd13575[_0xc1594b(0x196)]('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;}const _0x454b22=_0x4d749d[_0xc1594b(0x1af)][_0xc1594b(0x1a0)];return saveSessionContext({'segment_path':_0x454b22,'parent_segment':_0x454b22},_0x3f5f72),console[_0xc1594b(0x1a4)](a42_0xd13575['green'](_0xc1594b(0x1ad)+a42_0xd13575[_0xc1594b(0x196)](_0x454b22))),0x0;}const _0x553ecd=_0x2df0d5['segmentPath'];let _0x38b64a=_0x32c4e9;const _0x148f7f=parsePath(_0x32c4e9);if(!_0x148f7f[_0xc1594b(0x1bb)]){if(!_0x553ecd)return console[_0xc1594b(0x1a8)](a42_0xd13575[_0xc1594b(0x1c3)](_0xc1594b(0x1a9))),console[_0xc1594b(0x1a8)](a42_0xd13575[_0xc1594b(0x196)]('Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>')),0x1;if(_0x32c4e9==='..'){const _0x4bf63f=_0x553ecd['split']('/')[_0xc1594b(0x1ac)](0x0,-0x1)[_0xc1594b(0x194)]('/');_0x38b64a=_0x4bf63f||'/';}else _0x32c4e9==='.'?_0x38b64a=_0x553ecd:_0x38b64a=_0x553ecd+'/'+_0x32c4e9;_0x2df0d5[_0xc1594b(0x1a3)]&&console['error']('Resolved\x20relative\x20path\x20to:\x20'+_0x38b64a);}if(_0x38b64a==='/'||_0x38b64a==='')return saveSessionContext({'segment_path':undefined},_0x3f5f72),console[_0xc1594b(0x1a4)](a42_0xd13575[_0xc1594b(0x190)](_0xc1594b(0x18c))),0x0;_0x38b64a=normalizePath(_0x38b64a);const _0x2ea013=parsePath(_0x38b64a)['segments'];if(_0x2ea013['length']===0x0)return saveSessionContext({'segment_path':undefined},_0x3f5f72),console[_0xc1594b(0x1a4)](a42_0xd13575['green'](_0xc1594b(0x18c))),0x0;_0x2df0d5[_0xc1594b(0x1a3)]&&(console['error'](_0xc1594b(0x1b6)+_0x2df0d5[_0xc1594b(0x1b3)]),console[_0xc1594b(0x1a8)](_0xc1594b(0x1aa)+_0x38b64a));const _0x385d52=await withSpinner('Resolving\x20path\x20\x27'+_0x38b64a+_0xc1594b(0x1b5),()=>_0x52e097[_0xc1594b(0x1a1)][_0xc1594b(0x1ab)](_0x38b64a),{'verbose':_0x2df0d5[_0xc1594b(0x1a3)]}),_0x19fcd8=_0x385d52[_0xc1594b(0x193)];_0x2df0d5[_0xc1594b(0x1a3)]&&(console[_0xc1594b(0x1a8)](_0xc1594b(0x1c5)+_0x19fcd8[_0xc1594b(0x199)]),console[_0xc1594b(0x1a8)](_0xc1594b(0x1be)+_0x19fcd8[_0xc1594b(0x1a6)]),_0x19fcd8[_0xc1594b(0x1bf)]&&console[_0xc1594b(0x1a8)](_0xc1594b(0x1bc)+_0x19fcd8['folderId']));if(_0x19fcd8[_0xc1594b(0x199)]==='segment')return console[_0xc1594b(0x1a8)](a42_0xd13575['red']('Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.')),console['error'](_0xc1594b(0x1b2)),console[_0xc1594b(0x1a8)](a42_0xd13575[_0xc1594b(0x196)](_0xc1594b(0x197)+_0x19fcd8[_0xc1594b(0x1ba)]+(_0x19fcd8[_0xc1594b(0x1bd)]?'/'+_0x19fcd8[_0xc1594b(0x1bd)][_0xc1594b(0x194)]('/'):''))),0x1;return saveSessionContext({'segment_path':_0x19fcd8[_0xc1594b(0x1ae)],'parent_segment':_0x19fcd8[_0xc1594b(0x1ba)]},_0x3f5f72),console[_0xc1594b(0x1a4)](a42_0xd13575[_0xc1594b(0x190)](_0xc1594b(0x1ad)+a42_0xd13575[_0xc1594b(0x196)](_0x19fcd8[_0xc1594b(0x1ae)]))),_0x2df0d5[_0xc1594b(0x1a3)]&&(console[_0xc1594b(0x1a8)](a42_0xd13575[_0xc1594b(0x1b4)](_0xc1594b(0x191))),console[_0xc1594b(0x1a8)](a42_0xd13575[_0xc1594b(0x1b4)](_0xc1594b(0x192)))),0x0;}catch(_0x1188b3){throw _0x1188b3;}}}
1
+ const a42_0x2d0708=a42_0x64eb;(function(_0x220979,_0x543c8f){const _0x196aad=a42_0x64eb,_0x2a3dd4=_0x220979();while(!![]){try{const _0x5649ba=parseInt(_0x196aad(0x1ea))/0x1*(parseInt(_0x196aad(0x1f0))/0x2)+-parseInt(_0x196aad(0x202))/0x3*(parseInt(_0x196aad(0x1d2))/0x4)+parseInt(_0x196aad(0x1e8))/0x5+parseInt(_0x196aad(0x1e0))/0x6+-parseInt(_0x196aad(0x1e4))/0x7*(-parseInt(_0x196aad(0x1e6))/0x8)+-parseInt(_0x196aad(0x1f2))/0x9*(-parseInt(_0x196aad(0x1f8))/0xa)+parseInt(_0x196aad(0x1c9))/0xb*(-parseInt(_0x196aad(0x1dc))/0xc);if(_0x5649ba===_0x543c8f)break;else _0x2a3dd4['push'](_0x2a3dd4['shift']());}catch(_0x47bffb){_0x2a3dd4['push'](_0x2a3dd4['shift']());}}}(a42_0x4adf,0xd8ad9));function a42_0x4adf(){const _0x393c49=['error','✔\x20Context\x20cleared.\x20Back\x20to\x20root.','Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.','green','3336kffZKp','red','isAbsolute','Error:\x20Path\x20is\x20required\x0a','826038ovmftM','\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent','Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.','parentId','2027753TVNUNY','Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>','24pXocBv','Use:\x20tdx\x20segment\x20use\x20','373835SCDJAr','parentName','77GFgvqo','dim','Folder\x20ID:\x20','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22','segmentPath','execute','44618SKYEFR','parent_segment','242685NiwFpb','Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context','log','type','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22','Examples:','10OjHWDH','Site:\x20','folderPath','segment','data','verbose','length','Resolved\x20relative\x20path\x20to:\x20','folderId','name','6762qdVgZL','isDirectory','fullPath','segments','Use\x20\x22tdx\x20use\x22\x20to\x20see\x20all\x20context\x20parameters','68596WFWJnb','split','join','description','site','config','cyan','segment:use','✔\x20Context\x20set\x20to:\x20','364EEUshO','Resolving\x20path\x20\x27','Target\x20path:\x20','Set\x20current\x20segment/folder\x20context\x20for\x20navigation','Parent\x20ID:\x20','\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context'];a42_0x4adf=function(){return _0x393c49;};return a42_0x4adf();}function a42_0x64eb(_0x1262f5,_0x177eb7){_0x1262f5=_0x1262f5-0x1c7;const _0x4adf4e=a42_0x4adf();let _0x64eb13=_0x4adf4e[_0x1262f5];return _0x64eb13;}import{existsSync,statSync}from'fs';import a42_0x1bcb5f from'chalk';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{[a42_0x2d0708(0x201)]=a42_0x2d0708(0x1d0);[a42_0x2d0708(0x1cc)]=a42_0x2d0708(0x1d5);async[a42_0x2d0708(0x1ef)](_0x4106e7){const _0x53d5f1=a42_0x2d0708,{options:_0x5b8279,args:_0x4f7bac,tdx:_0x16e8d1}=_0x4106e7;if(_0x4f7bac['length']===0x0)return console['error'](a42_0x1bcb5f['red'](_0x53d5f1(0x1df))),console['error']('Usage:\x20tdx\x20segment\x20use\x20<path>'),console[_0x53d5f1(0x1d8)](_0x53d5f1(0x1f7)),console[_0x53d5f1(0x1d8)](_0x53d5f1(0x1f6)),console[_0x53d5f1(0x1d8)](_0x53d5f1(0x1ed)),console[_0x53d5f1(0x1d8)](_0x53d5f1(0x1d7)),console['error'](_0x53d5f1(0x1e1)),0x1;const _0x2a7514=_0x4f7bac[0x0],_0x91d2e3=_0x5b8279['session'];try{if(_0x2a7514==='/')return saveSessionContext({'segment_path':undefined},_0x91d2e3),console['log'](a42_0x1bcb5f[_0x53d5f1(0x1db)](_0x53d5f1(0x1d9))),0x0;if(existsSync(_0x2a7514)&&statSync(_0x2a7514)[_0x53d5f1(0x203)]()){let _0x3579f6;try{_0x3579f6=findTdxConfig(_0x2a7514);}catch{return console[_0x53d5f1(0x1d8)](a42_0x1bcb5f['red']('Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20'+_0x2a7514)),console[_0x53d5f1(0x1d8)](a42_0x1bcb5f[_0x53d5f1(0x1cf)]('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;}const _0x20fe13=_0x3579f6[_0x53d5f1(0x1ce)][_0x53d5f1(0x1f1)];return saveSessionContext({'segment_path':_0x20fe13,'parent_segment':_0x20fe13},_0x91d2e3),console[_0x53d5f1(0x1f4)](a42_0x1bcb5f['green'](_0x53d5f1(0x1d1)+a42_0x1bcb5f[_0x53d5f1(0x1cf)](_0x20fe13))),0x0;}const _0x252615=_0x5b8279[_0x53d5f1(0x1ee)];let _0x326f88=_0x2a7514;const _0x1ef31e=parsePath(_0x2a7514);if(!_0x1ef31e[_0x53d5f1(0x1de)]){if(!_0x252615)return console[_0x53d5f1(0x1d8)](a42_0x1bcb5f[_0x53d5f1(0x1dd)]('Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.')),console[_0x53d5f1(0x1d8)](a42_0x1bcb5f['cyan'](_0x53d5f1(0x1e5))),0x1;if(_0x2a7514==='..'){const _0x219b4b=_0x252615[_0x53d5f1(0x1ca)]('/')['slice'](0x0,-0x1)[_0x53d5f1(0x1cb)]('/');_0x326f88=_0x219b4b||'/';}else _0x2a7514==='.'?_0x326f88=_0x252615:_0x326f88=_0x252615+'/'+_0x2a7514;_0x5b8279[_0x53d5f1(0x1fd)]&&console[_0x53d5f1(0x1d8)](_0x53d5f1(0x1ff)+_0x326f88);}if(_0x326f88==='/'||_0x326f88==='')return saveSessionContext({'segment_path':undefined},_0x91d2e3),console[_0x53d5f1(0x1f4)](a42_0x1bcb5f[_0x53d5f1(0x1db)](_0x53d5f1(0x1d9))),0x0;_0x326f88=normalizePath(_0x326f88);const _0x273439=parsePath(_0x326f88)[_0x53d5f1(0x1c7)];if(_0x273439[_0x53d5f1(0x1fe)]===0x0)return saveSessionContext({'segment_path':undefined},_0x91d2e3),console['log'](a42_0x1bcb5f[_0x53d5f1(0x1db)](_0x53d5f1(0x1d9))),0x0;_0x5b8279[_0x53d5f1(0x1fd)]&&(console['error'](_0x53d5f1(0x1f9)+_0x5b8279[_0x53d5f1(0x1cd)]),console[_0x53d5f1(0x1d8)](_0x53d5f1(0x1d4)+_0x326f88));const _0x319e55=await withSpinner(_0x53d5f1(0x1d3)+_0x326f88+'\x27...',()=>_0x16e8d1[_0x53d5f1(0x1fb)]['resolvePathToResource'](_0x326f88),{'verbose':_0x5b8279[_0x53d5f1(0x1fd)]}),_0x2234eb=_0x319e55[_0x53d5f1(0x1fc)];_0x5b8279[_0x53d5f1(0x1fd)]&&(console[_0x53d5f1(0x1d8)]('Resolved\x20path\x20type:\x20'+_0x2234eb[_0x53d5f1(0x1f5)]),console['error'](_0x53d5f1(0x1d6)+_0x2234eb[_0x53d5f1(0x1e3)]),_0x2234eb[_0x53d5f1(0x200)]&&console[_0x53d5f1(0x1d8)](_0x53d5f1(0x1ec)+_0x2234eb[_0x53d5f1(0x200)]));if(_0x2234eb[_0x53d5f1(0x1f5)]==='segment')return console[_0x53d5f1(0x1d8)](a42_0x1bcb5f[_0x53d5f1(0x1dd)](_0x53d5f1(0x1da))),console[_0x53d5f1(0x1d8)](_0x53d5f1(0x1e2)),console[_0x53d5f1(0x1d8)](a42_0x1bcb5f[_0x53d5f1(0x1cf)](_0x53d5f1(0x1e7)+_0x2234eb[_0x53d5f1(0x1e9)]+(_0x2234eb[_0x53d5f1(0x1fa)]?'/'+_0x2234eb[_0x53d5f1(0x1fa)][_0x53d5f1(0x1cb)]('/'):''))),0x1;return saveSessionContext({'segment_path':_0x2234eb[_0x53d5f1(0x204)],'parent_segment':_0x2234eb[_0x53d5f1(0x1e9)]},_0x91d2e3),console[_0x53d5f1(0x1f4)](a42_0x1bcb5f[_0x53d5f1(0x1db)](_0x53d5f1(0x1d1)+a42_0x1bcb5f['cyan'](_0x2234eb[_0x53d5f1(0x204)]))),_0x5b8279[_0x53d5f1(0x1fd)]&&(console['error'](a42_0x1bcb5f[_0x53d5f1(0x1eb)](_0x53d5f1(0x1f3))),console['error'](a42_0x1bcb5f[_0x53d5f1(0x1eb)](_0x53d5f1(0x1c8)))),0x0;}catch(_0x23f93a){throw _0x23f93a;}}}
@@ -1 +1 @@
1
- function a43_0x38c3(){const _0xea9f1b=['type','targetDir','helpText','1508885jZKTPt','description','execute','length','warningCount','green','27IATdPM','1566180KfmCzS','1975300jbqIkL','endsWith','703756rmCiBh','\x20warning(s)\x20found','filePath','warnings','red','cyan','\x20file(s)\x20valid','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','2NQkTGW','errors','\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)','Error:\x20Directory\x20not\x20found:\x20','\x20error(s)','18IXbxDU','error','12487080lIAXkt','7FzhfVt','13UACjNA','dim','):\x20','cwd','verbose','Validation\x20failed:\x20','2560568tiBJnD','4DqLuTr','file','parentSegment','2141925iZiJfX','valid','.yaml','log','yellow','\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','validCount','hasErrors','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a'];a43_0x38c3=function(){return _0xea9f1b;};return a43_0x38c3();}const a43_0x3a17bc=a43_0xe950;(function(_0x10285,_0x196475){const _0x35bdde=a43_0xe950,_0x105cb8=_0x10285();while(!![]){try{const _0x54c629=-parseInt(_0x35bdde(0x137))/0x1*(parseInt(_0x35bdde(0x161))/0x2)+parseInt(_0x35bdde(0x14b))/0x3*(-parseInt(_0x35bdde(0x148))/0x4)+parseInt(_0x35bdde(0x157))/0x5*(parseInt(_0x35bdde(0x13d))/0x6)+-parseInt(_0x35bdde(0x140))/0x7*(parseInt(_0x35bdde(0x147))/0x8)+parseInt(_0x35bdde(0x15d))/0x9*(parseInt(_0x35bdde(0x15f))/0xa)+-parseInt(_0x35bdde(0x15e))/0xb+parseInt(_0x35bdde(0x13f))/0xc*(parseInt(_0x35bdde(0x141))/0xd);if(_0x54c629===_0x196475)break;else _0x105cb8['push'](_0x105cb8['shift']());}catch(_0x2b4058){_0x105cb8['push'](_0x105cb8['shift']());}}}(a43_0x38c3,0xa0b99));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';function a43_0xe950(_0x183869,_0x15afc7){_0x183869=_0x183869-0x134;const _0x38c3b3=a43_0x38c3();let _0xe9506b=_0x38c3b3[_0x183869];return _0xe9506b;}import a43_0x4e8ee1 from'chalk';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class SegmentValidateCommand extends BaseCommand{['name']='segment:validate';[a43_0x3a17bc(0x158)]='Validate\x20segment\x20and\x20journey\x20YAML\x20files';async[a43_0x3a17bc(0x159)](_0x357de3){const _0xbebb29=a43_0x3a17bc,{options:_0x4b20b7,args:_0x45a6b2}=_0x357de3,_0xee1e7=_0x4b20b7,_0xd2dc88=await resolveTarget({'arg':_0x45a6b2[0x0],'contextParent':_0x4b20b7[_0xbebb29(0x14a)],'cwd':process[_0xbebb29(0x144)]()});if(!isSuccessfulResolution(_0xd2dc88))return _0xd2dc88['errorCode']==='no_parent'?(console[_0xbebb29(0x13e)](a43_0x4e8ee1[_0xbebb29(0x14f)](_0xbebb29(0x153))),console[_0xbebb29(0x13e)](_0xbebb29(0x13a)),console[_0xbebb29(0x13e)](_0xbebb29(0x150)),console['error']('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file')):(console[_0xbebb29(0x13e)](a43_0x4e8ee1[_0xbebb29(0x165)]('Error:\x20'+_0xd2dc88['message']+'\x0a')),_0xd2dc88[_0xbebb29(0x156)]&&console['error'](a43_0x4e8ee1[_0xbebb29(0x134)](_0xd2dc88[_0xbebb29(0x156)]))),0x1;const _0xd69cdd=_0xd2dc88[_0xbebb29(0x155)],_0x5f4033=_0xd2dc88[_0xbebb29(0x154)]===_0xbebb29(0x149)?_0xd2dc88[_0xbebb29(0x163)]:undefined;if(!_0x5f4033&&!existsSync(_0xd69cdd))return console[_0xbebb29(0x13e)](a43_0x4e8ee1[_0xbebb29(0x165)](_0xbebb29(0x13b)+_0xd69cdd+'\x0a')),0x1;let _0x4d02ef;if(_0x5f4033){if(!_0x5f4033[_0xbebb29(0x160)]('.yml')&&!_0x5f4033[_0xbebb29(0x160)](_0xbebb29(0x14d)))return console[_0xbebb29(0x13e)](a43_0x4e8ee1[_0xbebb29(0x165)](_0xbebb29(0x136)+_0x5f4033+'\x0a')),0x1;_0x4d02ef=[_0x5f4033];}else _0x4d02ef=findYamlFiles(_0xd69cdd);if(_0x4d02ef[_0xbebb29(0x15a)]===0x0)return console[_0xbebb29(0x13e)](a43_0x4e8ee1[_0xbebb29(0x165)]('Error:\x20No\x20YAML\x20files\x20found\x20in\x20'+_0xd69cdd+'\x0a')),0x1;const _0x4bf2ce=validateYamlFiles(_0x4d02ef,_0xd69cdd),_0xefa2cc=calculateSummary(_0x4bf2ce);for(const _0x25af66 of _0x4bf2ce){if(!isValidationResult(_0x25af66))continue;const {relativePath:_0x3b31b3,source:_0x176826,result:_0x736823,fileType:_0x3aea5b}=_0x25af66,_0x55f873=_0x3aea5b;if(_0x736823['valid']&&_0x736823[_0xbebb29(0x164)][_0xbebb29(0x15a)]===0x0)_0xee1e7[_0xbebb29(0x145)]&&console[_0xbebb29(0x14e)](a43_0x4e8ee1['green']('✔\x20'+_0x3b31b3)+a43_0x4e8ee1[_0xbebb29(0x142)]('\x20('+_0x55f873+')'));else _0x736823[_0xbebb29(0x14c)]?(console[_0xbebb29(0x14e)](a43_0x4e8ee1[_0xbebb29(0x14f)]('⚠\x20'+_0x3b31b3)+a43_0x4e8ee1[_0xbebb29(0x142)]('\x20('+_0x55f873+_0xbebb29(0x143)+_0x736823[_0xbebb29(0x164)][_0xbebb29(0x15a)]+_0xbebb29(0x139))),console[_0xbebb29(0x14e)](formatValidationResult(_0x736823,_0x176826,_0x3b31b3))):(console[_0xbebb29(0x14e)](a43_0x4e8ee1[_0xbebb29(0x165)]('✖\x20'+_0x3b31b3)+a43_0x4e8ee1[_0xbebb29(0x142)]('\x20('+_0x55f873+'):\x20'+_0x736823[_0xbebb29(0x138)][_0xbebb29(0x15a)]+_0xbebb29(0x13c))),console[_0xbebb29(0x14e)](formatValidationResult(_0x736823,_0x176826,_0x3b31b3)));}return console['log'](''),_0xefa2cc[_0xbebb29(0x152)]?(console[_0xbebb29(0x14e)](a43_0x4e8ee1[_0xbebb29(0x165)](_0xbebb29(0x146)+_0xefa2cc['invalidCount']+'\x20file(s)\x20with\x20errors,\x20'+_0xefa2cc[_0xbebb29(0x151)]+'\x20valid')),_0xefa2cc['warningCount']>0x0&&console[_0xbebb29(0x14e)](a43_0x4e8ee1[_0xbebb29(0x14f)](_0xefa2cc['warningCount']+_0xbebb29(0x162))),0x1):(console[_0xbebb29(0x14e)](a43_0x4e8ee1[_0xbebb29(0x15c)]('✔\x20All\x20'+_0xefa2cc[_0xbebb29(0x151)]+_0xbebb29(0x135))),_0xefa2cc['warningCount']>0x0&&console[_0xbebb29(0x14e)](a43_0x4e8ee1[_0xbebb29(0x14f)](_0xefa2cc[_0xbebb29(0x15b)]+_0xbebb29(0x162))),0x0);}}
1
+ const a43_0x4f2733=a43_0x2d4b;(function(_0x252a5c,_0x81b677){const _0x448ec3=a43_0x2d4b,_0xefee54=_0x252a5c();while(!![]){try{const _0x5e0175=-parseInt(_0x448ec3(0xd2))/0x1*(parseInt(_0x448ec3(0xd4))/0x2)+parseInt(_0x448ec3(0xeb))/0x3*(parseInt(_0x448ec3(0xe6))/0x4)+parseInt(_0x448ec3(0xd6))/0x5*(parseInt(_0x448ec3(0xf0))/0x6)+parseInt(_0x448ec3(0x103))/0x7*(parseInt(_0x448ec3(0xdf))/0x8)+-parseInt(_0x448ec3(0xf1))/0x9+parseInt(_0x448ec3(0x100))/0xa+-parseInt(_0x448ec3(0xe7))/0xb;if(_0x5e0175===_0x81b677)break;else _0xefee54['push'](_0xefee54['shift']());}catch(_0x3d2e63){_0xefee54['push'](_0xefee54['shift']());}}}(a43_0xa698,0x69204));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 a43_0x5f2b92 from'chalk';function a43_0xa698(){const _0x1f5fe6=['validCount','yellow','warnings','✔\x20All\x20','16AYXtZL','4367044oApTDy','file','.yml','name','432213ztiGON','error','\x20error(s)','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','Usage:\x20tdx\x20sg\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)','21858aHzucw','1650870STrfdC','endsWith','Error:\x20Directory\x20not\x20found:\x20','warningCount','valid','type','\x20valid','targetDir','Error:\x20','dim','):\x20','\x20warning(s)','red','log','length','2148990mLVfJe','\x20file(s)\x20with\x20errors,\x20','no_parent','7THAvTh','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file','.yaml','errors','segment:validate','\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','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','cwd','434831UqJMQb','cyan','2gYkapc','\x20warning(s)\x20found','785YpSviO','hasErrors','execute','description','errorCode','verbose','invalidCount','filePath','helpText','661816okiXmh','Validation\x20failed:\x20','Validate\x20segment\x20and\x20journey\x20YAML\x20files'];a43_0xa698=function(){return _0x1f5fe6;};return a43_0xa698();}import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';function a43_0x2d4b(_0x49235f,_0x249cf1){_0x49235f=_0x49235f-0xd1;const _0xa69816=a43_0xa698();let _0x2d4b23=_0xa69816[_0x49235f];return _0x2d4b23;}export class SegmentValidateCommand extends BaseCommand{[a43_0x4f2733(0xea)]=a43_0x4f2733(0x107);[a43_0x4f2733(0xd9)]=a43_0x4f2733(0xe1);async[a43_0x4f2733(0xd8)](_0x14b0f8){const _0x30c45c=a43_0x4f2733,{options:_0x1670b9,args:_0x19ddbb}=_0x14b0f8,_0x141a48=_0x1670b9,_0x5052af=await resolveTarget({'arg':_0x19ddbb[0x0],'contextParent':_0x1670b9['parentSegment'],'cwd':process[_0x30c45c(0xd1)]()});if(!isSuccessfulResolution(_0x5052af))return _0x5052af[_0x30c45c(0xda)]===_0x30c45c(0x102)?(console[_0x30c45c(0xec)](a43_0x5f2b92[_0x30c45c(0xe3)](_0x30c45c(0xee))),console[_0x30c45c(0xec)](_0x30c45c(0xef)),console[_0x30c45c(0xec)](_0x30c45c(0x108)),console['error'](_0x30c45c(0x104))):(console[_0x30c45c(0xec)](a43_0x5f2b92[_0x30c45c(0xfd)](_0x30c45c(0xf9)+_0x5052af['message']+'\x0a')),_0x5052af['helpText']&&console[_0x30c45c(0xec)](a43_0x5f2b92[_0x30c45c(0xd3)](_0x5052af[_0x30c45c(0xde)]))),0x1;const _0x6c8889=_0x5052af[_0x30c45c(0xf8)],_0x31649c=_0x5052af[_0x30c45c(0xf6)]===_0x30c45c(0xe8)?_0x5052af[_0x30c45c(0xdd)]:undefined;if(!_0x31649c&&!existsSync(_0x6c8889))return console[_0x30c45c(0xec)](a43_0x5f2b92[_0x30c45c(0xfd)](_0x30c45c(0xf3)+_0x6c8889+'\x0a')),0x1;let _0x1b9187;if(_0x31649c){if(!_0x31649c[_0x30c45c(0xf2)](_0x30c45c(0xe9))&&!_0x31649c[_0x30c45c(0xf2)](_0x30c45c(0x105)))return console['error'](a43_0x5f2b92['red'](_0x30c45c(0x109)+_0x31649c+'\x0a')),0x1;_0x1b9187=[_0x31649c];}else _0x1b9187=findYamlFiles(_0x6c8889);if(_0x1b9187[_0x30c45c(0xff)]===0x0)return console['error'](a43_0x5f2b92[_0x30c45c(0xfd)]('Error:\x20No\x20YAML\x20files\x20found\x20in\x20'+_0x6c8889+'\x0a')),0x1;const _0x15a5f1=validateYamlFiles(_0x1b9187,_0x6c8889),_0x303dfd=calculateSummary(_0x15a5f1);for(const _0x4ee456 of _0x15a5f1){if(!isValidationResult(_0x4ee456))continue;const {relativePath:_0x1bdfe5,source:_0xc33190,result:_0x1e9af7,fileType:_0x48b7bb}=_0x4ee456,_0x2f97e9=_0x48b7bb;if(_0x1e9af7[_0x30c45c(0xf5)]&&_0x1e9af7[_0x30c45c(0xe4)][_0x30c45c(0xff)]===0x0)_0x141a48[_0x30c45c(0xdb)]&&console[_0x30c45c(0xfe)](a43_0x5f2b92['green']('✔\x20'+_0x1bdfe5)+a43_0x5f2b92[_0x30c45c(0xfa)]('\x20('+_0x2f97e9+')'));else _0x1e9af7[_0x30c45c(0xf5)]?(console['log'](a43_0x5f2b92[_0x30c45c(0xe3)]('⚠\x20'+_0x1bdfe5)+a43_0x5f2b92[_0x30c45c(0xfa)]('\x20('+_0x2f97e9+_0x30c45c(0xfb)+_0x1e9af7[_0x30c45c(0xe4)][_0x30c45c(0xff)]+_0x30c45c(0xfc))),console['log'](formatValidationResult(_0x1e9af7,_0xc33190,_0x1bdfe5))):(console[_0x30c45c(0xfe)](a43_0x5f2b92['red']('✖\x20'+_0x1bdfe5)+a43_0x5f2b92['dim']('\x20('+_0x2f97e9+'):\x20'+_0x1e9af7[_0x30c45c(0x106)]['length']+_0x30c45c(0xed))),console[_0x30c45c(0xfe)](formatValidationResult(_0x1e9af7,_0xc33190,_0x1bdfe5)));}return console[_0x30c45c(0xfe)](''),_0x303dfd[_0x30c45c(0xd7)]?(console[_0x30c45c(0xfe)](a43_0x5f2b92[_0x30c45c(0xfd)](_0x30c45c(0xe0)+_0x303dfd[_0x30c45c(0xdc)]+_0x30c45c(0x101)+_0x303dfd[_0x30c45c(0xe2)]+_0x30c45c(0xf7))),_0x303dfd[_0x30c45c(0xf4)]>0x0&&console['log'](a43_0x5f2b92['yellow'](_0x303dfd[_0x30c45c(0xf4)]+_0x30c45c(0xd5))),0x1):(console[_0x30c45c(0xfe)](a43_0x5f2b92['green'](_0x30c45c(0xe5)+_0x303dfd['validCount']+'\x20file(s)\x20valid')),_0x303dfd[_0x30c45c(0xf4)]>0x0&&console[_0x30c45c(0xfe)](a43_0x5f2b92[_0x30c45c(0xe3)](_0x303dfd['warningCount']+_0x30c45c(0xd5))),0x0);}}
@@ -1 +1 @@
1
- const a44_0x2f63df=a44_0x546e;function a44_0x5a4d(){const _0x9190cf=['6728HkOzlK','name','Parent\x20ID:\x20','Folder/pattern\x20arg:\x20','/j/da','12593580dTQyzT','parentId','json','\x20\x20tdx\x20sg\x20use\x20\x22My\x20Audience\x22','listRecursive','site','filter','recursive','Use\x20tdx\x20ps\x20list\x20to\x20see\x20available\x20parent\x20segments.','jsonl','✔\x20Built\x20tree\x20with\x20','6003450RcHHfG','length','map',',\x20and\x20','folders','log','replace','journeys','description','parentSegment','localeCompare','data','\x20segment','Folder\x20ID:\x20','Building\x20hierarchy\x20tree...','Resolving\x20parent\x20segment\x20\x27','45jzhyqa','resolvePathToResource','cause','dim','49012cwqMAq','listUnifiedWithJourneys','Resolving\x20path\x20\x27','\x20\x20tdx\x20sg\x20pull\x20\x22My\x20Audience\x22','(empty)','15EmSPZu','\x20\x20Cause:\x20','\x27...','journeyBundleName','Error:\x20','Set\x20a\x20parent\x20segment\x20context\x20first:','\x20journey','\x20matching\x20\x27','/e/','/app/ps/','format','1407wFZnKn','\x5c$&','execute','Listing\x20folders,\x20segments,\x20and\x20journeys...','includes','✔\x20Found\x20','listWithPattern','5597368RYqTAL','folderId','\x20folder','List\x20folders\x20and\x20child\x20segments','journey','segment','verbose','error','test','419947BgxnaV','sort','folder','1697982DUHjYV','segments','listUnified','Site:\x20','type'];a44_0x5a4d=function(){return _0x9190cf;};return a44_0x5a4d();}(function(_0x25ca17,_0x48ce65){const _0x13e258=a44_0x546e,_0x1b7f3c=_0x25ca17();while(!![]){try{const _0x326462=parseInt(_0x13e258(0x1a8))/0x1+parseInt(_0x13e258(0x188))/0x2*(parseInt(_0x13e258(0x184))/0x3)+-parseInt(_0x13e258(0x19f))/0x4+parseInt(_0x13e258(0x18d))/0x5*(parseInt(_0x13e258(0x1ab))/0x6)+parseInt(_0x13e258(0x198))/0x7*(parseInt(_0x13e258(0x1b0))/0x8)+-parseInt(_0x13e258(0x1c0))/0x9+parseInt(_0x13e258(0x1b5))/0xa;if(_0x326462===_0x48ce65)break;else _0x1b7f3c['push'](_0x1b7f3c['shift']());}catch(_0x1eb31d){_0x1b7f3c['push'](_0x1b7f3c['shift']());}}}(a44_0x5a4d,0xf3c87));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';function a44_0x546e(_0x1b8d7d,_0x414dc2){_0x1b8d7d=_0x1b8d7d-0x17a;const _0x5a4d70=a44_0x5a4d();let _0x546ebb=_0x5a4d70[_0x1b8d7d];return _0x546ebb;}import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{formatFlatList,formatTree}from'../sdk/util/tree-formatter.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import a44_0x472268 from'chalk';export class SegmentsCommand extends BaseCommand{[a44_0x2f63df(0x1b1)]=a44_0x2f63df(0x1ac);[a44_0x2f63df(0x17c)]=a44_0x2f63df(0x1a2);async[a44_0x2f63df(0x19a)](_0x24992b){const _0x576751=a44_0x2f63df,{options:_0x37fbc5,args:_0x2e87c3}=_0x24992b,_0x3799c2=_0x37fbc5[_0x576751(0x1bc)],_0x3170d3=_0x2e87c3[0x0];try{const _0x2712ab=_0x37fbc5[_0x576751(0x17d)];_0x37fbc5[_0x576751(0x1a5)]&&(console['error'](_0x576751(0x1ae)+_0x37fbc5[_0x576751(0x1ba)]),console[_0x576751(0x1a6)]('Parent\x20segment\x20context:\x20'+(_0x2712ab||'(not\x20set)')),_0x3170d3&&console[_0x576751(0x1a6)](_0x576751(0x1b3)+_0x3170d3),_0x3799c2&&console[_0x576751(0x1a6)]('Recursive\x20mode:\x20enabled'));if(!_0x2712ab)return console[_0x576751(0x1a6)]('Error:\x20No\x20parent\x20segment\x20context\x20set.'),console['error'](''),console[_0x576751(0x1a6)](_0x576751(0x192)),console[_0x576751(0x1a6)](_0x576751(0x18b)),console[_0x576751(0x1a6)](_0x576751(0x1b8)),console[_0x576751(0x1a6)](''),console['error'](_0x576751(0x1bd)),0x1;const _0x391687=_0x3170d3&&(_0x3170d3[_0x576751(0x19c)]('*')||_0x3170d3[_0x576751(0x19c)]('?'));if(_0x391687)return await this[_0x576751(0x19e)](_0x24992b,_0x2712ab,_0x3170d3);const _0x56bd3f=_0x3170d3?_0x2712ab+'/'+_0x3170d3:_0x2712ab;return _0x3799c2?await this[_0x576751(0x1b9)](_0x24992b,_0x56bd3f):await this['listUnified'](_0x24992b,_0x56bd3f);}catch(_0x326785){if(_0x326785 instanceof SDKError)return console[_0x576751(0x1a6)](_0x576751(0x191)+_0x326785['message']),_0x326785['cause']&&console[_0x576751(0x1a6)](_0x576751(0x18e)+_0x326785[_0x576751(0x186)]),0x1;throw _0x326785;}}async[a44_0x2f63df(0x19e)](_0x56668e,_0xc999c5,_0x11d427){const _0x53e3ad=a44_0x2f63df,{options:_0x5310c5,tdx:_0x132837}=_0x56668e,_0x335dc9=await withSpinner(_0x53e3ad(0x183)+_0xc999c5+_0x53e3ad(0x18f),()=>_0x132837[_0x53e3ad(0x1a4)][_0x53e3ad(0x185)](_0xc999c5),{'verbose':_0x5310c5['verbose']}),_0x5cf793=_0x335dc9[_0x53e3ad(0x17f)],_0x2b4ed0=await withSpinner(_0x53e3ad(0x19b),()=>_0x132837[_0x53e3ad(0x1a4)][_0x53e3ad(0x189)](_0x5cf793[_0x53e3ad(0x1b6)],_0x5cf793['folderId']),{'verbose':_0x5310c5[_0x53e3ad(0x1a5)]}),{folders:_0x30d744,segments:_0x2b7a11,journeys:_0x2ce6dc}=_0x2b4ed0[_0x53e3ad(0x17f)],_0xc6a1e4=_0x11d427[_0x53e3ad(0x17a)](/[.+^${}()|[\]\\]/g,_0x53e3ad(0x199))['replace'](/\*/g,'.*')[_0x53e3ad(0x17a)](/\?/g,'.'),_0x59e030=new RegExp('^'+_0xc6a1e4+'$','i'),_0x4199f9=_0x30d744[_0x53e3ad(0x1bb)](_0x32c596=>_0x59e030[_0x53e3ad(0x1a7)](_0x32c596[_0x53e3ad(0x1b1)])),_0x4164f9=_0x2b7a11['filter'](_0x22806e=>_0x59e030[_0x53e3ad(0x1a7)](_0x22806e[_0x53e3ad(0x1b1)])),_0x7b106e=_0x2ce6dc[_0x53e3ad(0x1bb)](_0x2217d6=>_0x59e030[_0x53e3ad(0x1a7)](_0x2217d6[_0x53e3ad(0x190)])),_0x429837=_0x4199f9['length']+_0x4164f9['length']+_0x7b106e['length'];console[_0x53e3ad(0x1a6)](_0x53e3ad(0x19d)+_0x4199f9[_0x53e3ad(0x1c1)]+_0x53e3ad(0x1a1)+(_0x4199f9[_0x53e3ad(0x1c1)]!==0x1?'s':'')+',\x20'+_0x4164f9['length']+_0x53e3ad(0x180)+(_0x4164f9[_0x53e3ad(0x1c1)]!==0x1?'s':'')+_0x53e3ad(0x1c3)+_0x7b106e[_0x53e3ad(0x1c1)]+_0x53e3ad(0x193)+(_0x7b106e[_0x53e3ad(0x1c1)]!==0x1?'s':'')+_0x53e3ad(0x194)+_0x11d427+'\x27');const _0x3a1b15=_0x419551=>{const _0xfcc89d=_0x53e3ad;return getConsoleNextUrl(_0x5310c5[_0xfcc89d(0x1ba)],_0xfcc89d(0x196)+_0x5cf793[_0xfcc89d(0x1b6)]+'/e/'+_0x419551);},_0x5138bf=_0x5310c5[_0x53e3ad(0x197)]==='json'||_0x5310c5['format']===_0x53e3ad(0x1be);if(_0x5138bf){const _0x9fafe4=[..._0x4199f9[_0x53e3ad(0x1c2)](_0x3aef41=>({..._0x3aef41,'type':'folder'})),..._0x4164f9[_0x53e3ad(0x1c2)](_0x3b3bd9=>({..._0x3b3bd9,'type':_0x53e3ad(0x1a4),'url':_0x3a1b15(_0x3b3bd9['id'])})),..._0x7b106e[_0x53e3ad(0x1c2)](_0x46ed6a=>({..._0x46ed6a,'name':_0x46ed6a[_0x53e3ad(0x190)],'type':_0x53e3ad(0x1a3)}))][_0x53e3ad(0x1a9)]((_0x389625,_0x18c462)=>_0x389625[_0x53e3ad(0x1b1)][_0x53e3ad(0x17e)](_0x18c462[_0x53e3ad(0x1b1)]));await handleSDKOutput(_0x9fafe4,_0x5310c5);}else{if(_0x429837===0x0)console[_0x53e3ad(0x1c5)]('No\x20items\x20match\x20pattern:\x20'+_0x11d427);else{console['log'](a44_0x472268[_0x53e3ad(0x187)]('['+_0xc999c5+']\x20matching\x20\x27'+_0x11d427+'\x27'));const _0x5d8eea=formatFlatList(_0x4199f9,_0x4164f9,{'showMetadata':!![],'getSegmentUrl':_0x3a1b15},_0x7b106e);console[_0x53e3ad(0x1c5)](_0x5d8eea);}}return 0x0;}async[a44_0x2f63df(0x1ad)](_0x562c07,_0x154ffc){const _0x5a9e3f=a44_0x2f63df,{options:_0x81f21,tdx:_0x378fa9}=_0x562c07,_0x5ed308=await withSpinner(_0x5a9e3f(0x18a)+_0x154ffc+_0x5a9e3f(0x18f),()=>_0x378fa9['segment'][_0x5a9e3f(0x185)](_0x154ffc),{'verbose':_0x81f21[_0x5a9e3f(0x1a5)]}),_0xb88fe=_0x5ed308[_0x5a9e3f(0x17f)];_0x81f21['verbose']&&(console[_0x5a9e3f(0x1a6)]('Parent\x20ID:\x20'+_0xb88fe[_0x5a9e3f(0x1b6)]),_0xb88fe['folderId']&&console[_0x5a9e3f(0x1a6)](_0x5a9e3f(0x181)+_0xb88fe[_0x5a9e3f(0x1a0)]));const _0x2c8033=await withSpinner(_0x5a9e3f(0x19b),()=>_0x378fa9[_0x5a9e3f(0x1a4)][_0x5a9e3f(0x189)](_0xb88fe[_0x5a9e3f(0x1b6)],_0xb88fe[_0x5a9e3f(0x1a0)]),{'verbose':_0x81f21[_0x5a9e3f(0x1a5)]}),{folders:_0x733c3b,segments:_0x35ff9d,journeys:_0x94e927}=_0x2c8033[_0x5a9e3f(0x17f)],_0x1c6a6b=_0x733c3b[_0x5a9e3f(0x1c1)]+_0x35ff9d[_0x5a9e3f(0x1c1)]+_0x94e927[_0x5a9e3f(0x1c1)];console[_0x5a9e3f(0x1a6)]('✔\x20Found\x20'+_0x733c3b['length']+'\x20folder'+(_0x733c3b['length']!==0x1?'s':'')+',\x20'+_0x35ff9d[_0x5a9e3f(0x1c1)]+_0x5a9e3f(0x180)+(_0x35ff9d[_0x5a9e3f(0x1c1)]!==0x1?'s':'')+_0x5a9e3f(0x1c3)+_0x94e927[_0x5a9e3f(0x1c1)]+_0x5a9e3f(0x193)+(_0x94e927['length']!==0x1?'s':''));const _0x2a471d=_0x3a7518=>{const _0x5d31a8=_0x5a9e3f;return getConsoleNextUrl(_0x81f21[_0x5d31a8(0x1ba)],'/app/ps/'+_0xb88fe['parentId']+_0x5d31a8(0x195)+_0x3a7518);},_0x5ee202=_0x25c3e7=>{const _0x23a013=_0x5a9e3f;return getConsoleNextUrl(_0x81f21[_0x23a013(0x1ba)],_0x23a013(0x196)+_0xb88fe['parentId']+_0x23a013(0x195)+_0x25c3e7+_0x23a013(0x1b4));},_0x37ae36=_0x81f21[_0x5a9e3f(0x197)]===_0x5a9e3f(0x1b7)||_0x81f21['format']===_0x5a9e3f(0x1be);if(_0x37ae36){const _0x5e7fb3=[..._0x733c3b[_0x5a9e3f(0x1c2)](_0x2e5f3f=>({..._0x2e5f3f,'type':_0x5a9e3f(0x1aa)})),..._0x35ff9d[_0x5a9e3f(0x1c2)](_0x5455e8=>({..._0x5455e8,'type':'segment','url':_0x2a471d(_0x5455e8['id'])})),..._0x94e927['map'](_0x1d81c6=>({..._0x1d81c6,'name':_0x1d81c6['journeyBundleName'],'type':_0x5a9e3f(0x1a3),'url':_0x5ee202(_0x1d81c6['id'])}))][_0x5a9e3f(0x1a9)]((_0x32e26f,_0x3cf037)=>_0x32e26f[_0x5a9e3f(0x1b1)][_0x5a9e3f(0x17e)](_0x3cf037[_0x5a9e3f(0x1b1)]));await handleSDKOutput(_0x5e7fb3,_0x81f21);}else{if(_0x1c6a6b===0x0)console[_0x5a9e3f(0x1c5)](a44_0x472268[_0x5a9e3f(0x187)]('['+_0x154ffc+']')),console['log'](_0x5a9e3f(0x18c));else{console['log'](a44_0x472268[_0x5a9e3f(0x187)]('['+_0x154ffc+']'));const _0x3397d5=formatFlatList(_0x733c3b,_0x35ff9d,{'showMetadata':!![],'getSegmentUrl':_0x2a471d,'getJourneyUrl':_0x5ee202},_0x94e927);console[_0x5a9e3f(0x1c5)](_0x3397d5);}}return 0x0;}async[a44_0x2f63df(0x1b9)](_0x22366a,_0x23f900){const _0x1a3d8f=a44_0x2f63df,{options:_0x128e4f,tdx:_0x46ade4}=_0x22366a,_0x135fef=await withSpinner(_0x1a3d8f(0x18a)+_0x23f900+_0x1a3d8f(0x18f),()=>_0x46ade4[_0x1a3d8f(0x1a4)][_0x1a3d8f(0x185)](_0x23f900),{'verbose':_0x128e4f['verbose']}),_0x978e99=_0x135fef[_0x1a3d8f(0x17f)];_0x128e4f[_0x1a3d8f(0x1a5)]&&(console['error'](_0x1a3d8f(0x1b2)+_0x978e99[_0x1a3d8f(0x1b6)]),_0x978e99[_0x1a3d8f(0x1a0)]&&console[_0x1a3d8f(0x1a6)](_0x1a3d8f(0x181)+_0x978e99[_0x1a3d8f(0x1a0)]));const _0x424e58=_0x128e4f['maxDepth']||0xa,_0x40eec0=await withSpinner(_0x1a3d8f(0x182),()=>_0x46ade4['segment'][_0x1a3d8f(0x1b9)](_0x978e99['parentId'],_0x978e99[_0x1a3d8f(0x1a0)],0x0,_0x424e58),{'verbose':_0x128e4f[_0x1a3d8f(0x1a5)]}),_0x2abce1=_0x40eec0[_0x1a3d8f(0x17f)],_0x50200f=_0x1cb29c=>{const _0x1d91b4=_0x1a3d8f;let _0x16fd9d=0x0,_0x5a28d5=0x0,_0x71ea00=0x0;for(const _0x79adf4 of _0x1cb29c){if(_0x79adf4[_0x1d91b4(0x1af)]===_0x1d91b4(0x1aa))_0x16fd9d++;else{if(_0x79adf4[_0x1d91b4(0x1af)]===_0x1d91b4(0x1a4))_0x5a28d5++;else{if(_0x79adf4[_0x1d91b4(0x1af)]===_0x1d91b4(0x1a3))_0x71ea00++;}}if(_0x79adf4['children']){const _0xeb26a3=_0x50200f(_0x79adf4['children']);_0x16fd9d+=_0xeb26a3['folders'],_0x5a28d5+=_0xeb26a3[_0x1d91b4(0x1ac)],_0x71ea00+=_0xeb26a3[_0x1d91b4(0x17b)];}}return{'folders':_0x16fd9d,'segments':_0x5a28d5,'journeys':_0x71ea00};},_0x4a87c5=_0x50200f(_0x2abce1);console['error'](_0x1a3d8f(0x1bf)+_0x4a87c5['folders']+_0x1a3d8f(0x1a1)+(_0x4a87c5[_0x1a3d8f(0x1c4)]!==0x1?'s':'')+',\x20'+_0x4a87c5[_0x1a3d8f(0x1ac)]+'\x20segment'+(_0x4a87c5['segments']!==0x1?'s':'')+_0x1a3d8f(0x1c3)+_0x4a87c5[_0x1a3d8f(0x17b)]+_0x1a3d8f(0x193)+(_0x4a87c5[_0x1a3d8f(0x17b)]!==0x1?'s':''));const _0x47444c=_0x2ad4e4=>{const _0x1c0b42=_0x1a3d8f;return getConsoleNextUrl(_0x128e4f[_0x1c0b42(0x1ba)],_0x1c0b42(0x196)+_0x978e99[_0x1c0b42(0x1b6)]+_0x1c0b42(0x195)+_0x2ad4e4);},_0x311f0f=_0x4cd430=>{const _0x1124d0=_0x1a3d8f;return getConsoleNextUrl(_0x128e4f[_0x1124d0(0x1ba)],_0x1124d0(0x196)+_0x978e99[_0x1124d0(0x1b6)]+'/e/'+_0x4cd430+'/j/da');};if(_0x128e4f[_0x1a3d8f(0x197)]===_0x1a3d8f(0x1b7)||_0x128e4f[_0x1a3d8f(0x197)]===_0x1a3d8f(0x1be))await handleSDKOutput(_0x2abce1,_0x128e4f);else{console[_0x1a3d8f(0x1c5)](a44_0x472268['dim']('['+_0x23f900+']'));const _0x1c11fd=formatTree(_0x2abce1,{'showMetadata':!![],'getSegmentUrl':_0x47444c,'getJourneyUrl':_0x311f0f});console['log'](_0x1c11fd);}return 0x0;}}
1
+ const a44_0x4ca68f=a44_0x303a;(function(_0x4c3632,_0x191dc9){const _0xcb9b08=a44_0x303a,_0x4c7b99=_0x4c3632();while(!![]){try{const _0x4fbd33=-parseInt(_0xcb9b08(0x17f))/0x1+parseInt(_0xcb9b08(0x199))/0x2*(-parseInt(_0xcb9b08(0x196))/0x3)+-parseInt(_0xcb9b08(0x19c))/0x4+-parseInt(_0xcb9b08(0x1b1))/0x5+parseInt(_0xcb9b08(0x177))/0x6+parseInt(_0xcb9b08(0x1a2))/0x7*(parseInt(_0xcb9b08(0x19d))/0x8)+parseInt(_0xcb9b08(0x189))/0x9;if(_0x4fbd33===_0x191dc9)break;else _0x4c7b99['push'](_0x4c7b99['shift']());}catch(_0x3295ee){_0x4c7b99['push'](_0x4c7b99['shift']());}}}(a44_0x4dea,0x38f20));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';function a44_0x4dea(){const _0xdea195=['verbose','Listing\x20folders,\x20segments,\x20and\x20journeys...','json','filter','\x20\x20tdx\x20sg\x20use\x20\x22My\x20Audience\x22','\x27...','replace','dim',',\x20and\x20','maxDepth','includes','1079424QlsXHE','length','map','site','Resolving\x20path\x20\x27','segments','type','✔\x20Built\x20tree\x20with\x20','107004RWIDyP','(not\x20set)','recursive','Recursive\x20mode:\x20enabled','Resolving\x20parent\x20segment\x20\x27','cause','/e/','Set\x20a\x20parent\x20segment\x20context\x20first:','listUnifiedWithJourneys','List\x20folders\x20and\x20child\x20segments','7653735gQInLr','test','execute','✔\x20Found\x20','/j/da','sort','Building\x20hierarchy\x20tree...','data','\x20matching\x20\x27','journeyBundleName','\x20segment','error','description','7590cFeNyy','Site:\x20','folderId','122nmXRpB','Error:\x20No\x20parent\x20segment\x20context\x20set.','listUnified','1539324wQdwcn','23144yIHLXS','/app/ps/','segment','\x20\x20tdx\x20sg\x20pull\x20\x22My\x20Audience\x22','\x20\x20Cause:\x20','497IfEqYB','journeys','name','\x5c$&','Folder\x20ID:\x20','\x20folder','No\x20items\x20match\x20pattern:\x20','message','Folder/pattern\x20arg:\x20','parentId','\x20journey','journey','localeCompare','Parent\x20segment\x20context:\x20','jsonl','1781545xpFstl','Parent\x20ID:\x20','listRecursive','resolvePathToResource','log','folders','Use\x20tdx\x20ps\x20list\x20to\x20see\x20available\x20parent\x20segments.','listWithPattern','folder','format'];a44_0x4dea=function(){return _0xdea195;};return a44_0x4dea();}import{formatFlatList,formatTree}from'../sdk/util/tree-formatter.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import a44_0x53e548 from'chalk';function a44_0x303a(_0x5a7b63,_0x5deec1){_0x5a7b63=_0x5a7b63-0x175;const _0x4dea53=a44_0x4dea();let _0x303abb=_0x4dea53[_0x5a7b63];return _0x303abb;}export class SegmentsCommand extends BaseCommand{[a44_0x4ca68f(0x1a4)]=a44_0x4ca68f(0x17c);[a44_0x4ca68f(0x195)]=a44_0x4ca68f(0x188);async[a44_0x4ca68f(0x18b)](_0x17d09c){const _0x263739=a44_0x4ca68f,{options:_0x4e3aae,args:_0x939730}=_0x17d09c,_0x484927=_0x4e3aae[_0x263739(0x181)],_0x49f84a=_0x939730[0x0];try{const _0x4f7d83=_0x4e3aae['parentSegment'];_0x4e3aae[_0x263739(0x1bb)]&&(console[_0x263739(0x194)](_0x263739(0x197)+_0x4e3aae[_0x263739(0x17a)]),console[_0x263739(0x194)](_0x263739(0x1af)+(_0x4f7d83||_0x263739(0x180))),_0x49f84a&&console[_0x263739(0x194)](_0x263739(0x1aa)+_0x49f84a),_0x484927&&console[_0x263739(0x194)](_0x263739(0x182)));if(!_0x4f7d83)return console[_0x263739(0x194)](_0x263739(0x19a)),console[_0x263739(0x194)](''),console[_0x263739(0x194)](_0x263739(0x186)),console[_0x263739(0x194)](_0x263739(0x1a0)),console['error'](_0x263739(0x1bf)),console[_0x263739(0x194)](''),console['error'](_0x263739(0x1b7)),0x1;const _0x2cce91=_0x49f84a&&(_0x49f84a[_0x263739(0x176)]('*')||_0x49f84a[_0x263739(0x176)]('?'));if(_0x2cce91)return await this[_0x263739(0x1b8)](_0x17d09c,_0x4f7d83,_0x49f84a);const _0x31320e=_0x49f84a?_0x4f7d83+'/'+_0x49f84a:_0x4f7d83;return _0x484927?await this[_0x263739(0x1b3)](_0x17d09c,_0x31320e):await this[_0x263739(0x19b)](_0x17d09c,_0x31320e);}catch(_0x16924f){if(_0x16924f instanceof SDKError)return console['error']('Error:\x20'+_0x16924f[_0x263739(0x1a9)]),_0x16924f['cause']&&console[_0x263739(0x194)](_0x263739(0x1a1)+_0x16924f[_0x263739(0x184)]),0x1;throw _0x16924f;}}async[a44_0x4ca68f(0x1b8)](_0x167b85,_0x3ca064,_0x4beff8){const _0x369c7b=a44_0x4ca68f,{options:_0x4b3993,tdx:_0x3a27b0}=_0x167b85,_0x24de57=await withSpinner(_0x369c7b(0x183)+_0x3ca064+_0x369c7b(0x1c0),()=>_0x3a27b0[_0x369c7b(0x19f)][_0x369c7b(0x1b4)](_0x3ca064),{'verbose':_0x4b3993[_0x369c7b(0x1bb)]}),_0x122287=_0x24de57['data'],_0x4b4518=await withSpinner(_0x369c7b(0x1bc),()=>_0x3a27b0['segment']['listUnifiedWithJourneys'](_0x122287[_0x369c7b(0x1ab)],_0x122287['folderId']),{'verbose':_0x4b3993[_0x369c7b(0x1bb)]}),{folders:_0x25024b,segments:_0x35878d,journeys:_0x24461a}=_0x4b4518[_0x369c7b(0x190)],_0x226acb=_0x4beff8[_0x369c7b(0x1c1)](/[.+^${}()|[\]\\]/g,_0x369c7b(0x1a5))[_0x369c7b(0x1c1)](/\*/g,'.*')['replace'](/\?/g,'.'),_0x3c69fc=new RegExp('^'+_0x226acb+'$','i'),_0x599664=_0x25024b[_0x369c7b(0x1be)](_0x42e378=>_0x3c69fc['test'](_0x42e378[_0x369c7b(0x1a4)])),_0x43c8e4=_0x35878d[_0x369c7b(0x1be)](_0x5499d6=>_0x3c69fc[_0x369c7b(0x18a)](_0x5499d6[_0x369c7b(0x1a4)])),_0x150e85=_0x24461a['filter'](_0x34ee05=>_0x3c69fc['test'](_0x34ee05[_0x369c7b(0x192)])),_0x42752f=_0x599664[_0x369c7b(0x178)]+_0x43c8e4[_0x369c7b(0x178)]+_0x150e85['length'];console[_0x369c7b(0x194)](_0x369c7b(0x18c)+_0x599664[_0x369c7b(0x178)]+_0x369c7b(0x1a7)+(_0x599664[_0x369c7b(0x178)]!==0x1?'s':'')+',\x20'+_0x43c8e4[_0x369c7b(0x178)]+_0x369c7b(0x193)+(_0x43c8e4[_0x369c7b(0x178)]!==0x1?'s':'')+',\x20and\x20'+_0x150e85['length']+_0x369c7b(0x1ac)+(_0x150e85[_0x369c7b(0x178)]!==0x1?'s':'')+_0x369c7b(0x191)+_0x4beff8+'\x27');const _0x13f4ca=_0x5e0a25=>{const _0x5dc61f=_0x369c7b;return getConsoleNextUrl(_0x4b3993['site'],_0x5dc61f(0x19e)+_0x122287[_0x5dc61f(0x1ab)]+_0x5dc61f(0x185)+_0x5e0a25);},_0x25c8c2=_0x4b3993[_0x369c7b(0x1ba)]==='json'||_0x4b3993['format']===_0x369c7b(0x1b0);if(_0x25c8c2){const _0xa35fe8=[..._0x599664['map'](_0x276193=>({..._0x276193,'type':'folder'})),..._0x43c8e4[_0x369c7b(0x179)](_0x5dcd3d=>({..._0x5dcd3d,'type':_0x369c7b(0x19f),'url':_0x13f4ca(_0x5dcd3d['id'])})),..._0x150e85[_0x369c7b(0x179)](_0xab2c46=>({..._0xab2c46,'name':_0xab2c46['journeyBundleName'],'type':_0x369c7b(0x1ad)}))][_0x369c7b(0x18e)]((_0x118e41,_0x495f8a)=>_0x118e41['name'][_0x369c7b(0x1ae)](_0x495f8a[_0x369c7b(0x1a4)]));await handleSDKOutput(_0xa35fe8,_0x4b3993);}else{if(_0x42752f===0x0)console['log'](_0x369c7b(0x1a8)+_0x4beff8);else{console[_0x369c7b(0x1b5)](a44_0x53e548[_0x369c7b(0x1c2)]('['+_0x3ca064+']\x20matching\x20\x27'+_0x4beff8+'\x27'));const _0xb84aa9=formatFlatList(_0x599664,_0x43c8e4,{'showMetadata':!![],'getSegmentUrl':_0x13f4ca},_0x150e85);console[_0x369c7b(0x1b5)](_0xb84aa9);}}return 0x0;}async[a44_0x4ca68f(0x19b)](_0x2430e1,_0x1939a8){const _0x3c39b5=a44_0x4ca68f,{options:_0x258f21,tdx:_0x2da954}=_0x2430e1,_0x3c3bb2=await withSpinner(_0x3c39b5(0x17b)+_0x1939a8+_0x3c39b5(0x1c0),()=>_0x2da954[_0x3c39b5(0x19f)]['resolvePathToResource'](_0x1939a8),{'verbose':_0x258f21[_0x3c39b5(0x1bb)]}),_0x40cfd3=_0x3c3bb2[_0x3c39b5(0x190)];_0x258f21[_0x3c39b5(0x1bb)]&&(console[_0x3c39b5(0x194)]('Parent\x20ID:\x20'+_0x40cfd3['parentId']),_0x40cfd3[_0x3c39b5(0x198)]&&console['error']('Folder\x20ID:\x20'+_0x40cfd3[_0x3c39b5(0x198)]));const _0x41a7a7=await withSpinner(_0x3c39b5(0x1bc),()=>_0x2da954['segment'][_0x3c39b5(0x187)](_0x40cfd3[_0x3c39b5(0x1ab)],_0x40cfd3[_0x3c39b5(0x198)]),{'verbose':_0x258f21[_0x3c39b5(0x1bb)]}),{folders:_0x564525,segments:_0x379bfb,journeys:_0x24d6ee}=_0x41a7a7[_0x3c39b5(0x190)],_0xb0b300=_0x564525[_0x3c39b5(0x178)]+_0x379bfb[_0x3c39b5(0x178)]+_0x24d6ee[_0x3c39b5(0x178)];console[_0x3c39b5(0x194)](_0x3c39b5(0x18c)+_0x564525[_0x3c39b5(0x178)]+_0x3c39b5(0x1a7)+(_0x564525[_0x3c39b5(0x178)]!==0x1?'s':'')+',\x20'+_0x379bfb['length']+_0x3c39b5(0x193)+(_0x379bfb[_0x3c39b5(0x178)]!==0x1?'s':'')+_0x3c39b5(0x1c3)+_0x24d6ee[_0x3c39b5(0x178)]+'\x20journey'+(_0x24d6ee[_0x3c39b5(0x178)]!==0x1?'s':''));const _0x1b9145=_0x23a028=>{const _0x7b6960=_0x3c39b5;return getConsoleNextUrl(_0x258f21[_0x7b6960(0x17a)],_0x7b6960(0x19e)+_0x40cfd3[_0x7b6960(0x1ab)]+_0x7b6960(0x185)+_0x23a028);},_0x29229e=_0x125b85=>{const _0x4fcc51=_0x3c39b5;return getConsoleNextUrl(_0x258f21[_0x4fcc51(0x17a)],_0x4fcc51(0x19e)+_0x40cfd3[_0x4fcc51(0x1ab)]+'/e/'+_0x125b85+_0x4fcc51(0x18d));},_0x4b4738=_0x258f21['format']===_0x3c39b5(0x1bd)||_0x258f21[_0x3c39b5(0x1ba)]===_0x3c39b5(0x1b0);if(_0x4b4738){const _0x250730=[..._0x564525['map'](_0x3da927=>({..._0x3da927,'type':_0x3c39b5(0x1b9)})),..._0x379bfb['map'](_0x556ee0=>({..._0x556ee0,'type':_0x3c39b5(0x19f),'url':_0x1b9145(_0x556ee0['id'])})),..._0x24d6ee[_0x3c39b5(0x179)](_0x2c5496=>({..._0x2c5496,'name':_0x2c5496['journeyBundleName'],'type':_0x3c39b5(0x1ad),'url':_0x29229e(_0x2c5496['id'])}))][_0x3c39b5(0x18e)]((_0x82a4ca,_0x5819c9)=>_0x82a4ca[_0x3c39b5(0x1a4)][_0x3c39b5(0x1ae)](_0x5819c9[_0x3c39b5(0x1a4)]));await handleSDKOutput(_0x250730,_0x258f21);}else{if(_0xb0b300===0x0)console[_0x3c39b5(0x1b5)](a44_0x53e548[_0x3c39b5(0x1c2)]('['+_0x1939a8+']')),console[_0x3c39b5(0x1b5)]('(empty)');else{console[_0x3c39b5(0x1b5)](a44_0x53e548[_0x3c39b5(0x1c2)]('['+_0x1939a8+']'));const _0x35a89a=formatFlatList(_0x564525,_0x379bfb,{'showMetadata':!![],'getSegmentUrl':_0x1b9145,'getJourneyUrl':_0x29229e},_0x24d6ee);console[_0x3c39b5(0x1b5)](_0x35a89a);}}return 0x0;}async[a44_0x4ca68f(0x1b3)](_0x5edd3d,_0xe90775){const _0x378f2a=a44_0x4ca68f,{options:_0x158c67,tdx:_0x4b557c}=_0x5edd3d,_0xb3d517=await withSpinner(_0x378f2a(0x17b)+_0xe90775+_0x378f2a(0x1c0),()=>_0x4b557c[_0x378f2a(0x19f)][_0x378f2a(0x1b4)](_0xe90775),{'verbose':_0x158c67['verbose']}),_0x58ae15=_0xb3d517[_0x378f2a(0x190)];_0x158c67[_0x378f2a(0x1bb)]&&(console['error'](_0x378f2a(0x1b2)+_0x58ae15['parentId']),_0x58ae15[_0x378f2a(0x198)]&&console[_0x378f2a(0x194)](_0x378f2a(0x1a6)+_0x58ae15[_0x378f2a(0x198)]));const _0x19565f=_0x158c67[_0x378f2a(0x175)]||0xa,_0x516af6=await withSpinner(_0x378f2a(0x18f),()=>_0x4b557c['segment']['listRecursive'](_0x58ae15[_0x378f2a(0x1ab)],_0x58ae15[_0x378f2a(0x198)],0x0,_0x19565f),{'verbose':_0x158c67[_0x378f2a(0x1bb)]}),_0x17bb71=_0x516af6[_0x378f2a(0x190)],_0x1f0d29=_0x142270=>{const _0x285214=_0x378f2a;let _0x384801=0x0,_0x2e08b2=0x0,_0x57690c=0x0;for(const _0x389912 of _0x142270){if(_0x389912[_0x285214(0x17d)]===_0x285214(0x1b9))_0x384801++;else{if(_0x389912[_0x285214(0x17d)]===_0x285214(0x19f))_0x2e08b2++;else{if(_0x389912['type']===_0x285214(0x1ad))_0x57690c++;}}if(_0x389912['children']){const _0x4c0f88=_0x1f0d29(_0x389912['children']);_0x384801+=_0x4c0f88[_0x285214(0x1b6)],_0x2e08b2+=_0x4c0f88['segments'],_0x57690c+=_0x4c0f88[_0x285214(0x1a3)];}}return{'folders':_0x384801,'segments':_0x2e08b2,'journeys':_0x57690c};},_0x4df655=_0x1f0d29(_0x17bb71);console['error'](_0x378f2a(0x17e)+_0x4df655[_0x378f2a(0x1b6)]+_0x378f2a(0x1a7)+(_0x4df655['folders']!==0x1?'s':'')+',\x20'+_0x4df655[_0x378f2a(0x17c)]+_0x378f2a(0x193)+(_0x4df655['segments']!==0x1?'s':'')+_0x378f2a(0x1c3)+_0x4df655[_0x378f2a(0x1a3)]+'\x20journey'+(_0x4df655[_0x378f2a(0x1a3)]!==0x1?'s':''));const _0x4cdccf=_0x10a51c=>{const _0x5a99ae=_0x378f2a;return getConsoleNextUrl(_0x158c67['site'],'/app/ps/'+_0x58ae15['parentId']+_0x5a99ae(0x185)+_0x10a51c);},_0x4a72d9=_0x4d5f81=>{const _0x32cb40=_0x378f2a;return getConsoleNextUrl(_0x158c67[_0x32cb40(0x17a)],'/app/ps/'+_0x58ae15[_0x32cb40(0x1ab)]+_0x32cb40(0x185)+_0x4d5f81+_0x32cb40(0x18d));};if(_0x158c67[_0x378f2a(0x1ba)]==='json'||_0x158c67[_0x378f2a(0x1ba)]==='jsonl')await handleSDKOutput(_0x17bb71,_0x158c67);else{console[_0x378f2a(0x1b5)](a44_0x53e548[_0x378f2a(0x1c2)]('['+_0xe90775+']'));const _0x5e46fe=formatTree(_0x17bb71,{'showMetadata':!![],'getSegmentUrl':_0x4cdccf,'getJourneyUrl':_0x4a72d9});console[_0x378f2a(0x1b5)](_0x5e46fe);}return 0x0;}}
@@ -1 +1 @@
1
- const a45_0x2fdfae=a45_0x1a5b;(function(_0x555aff,_0x29b67a){const _0x32d06a=a45_0x1a5b,_0x4705f5=_0x555aff();while(!![]){try{const _0x1a7a4f=-parseInt(_0x32d06a(0x147))/0x1+parseInt(_0x32d06a(0x13d))/0x2*(parseInt(_0x32d06a(0x13a))/0x3)+parseInt(_0x32d06a(0x12e))/0x4+-parseInt(_0x32d06a(0x124))/0x5*(-parseInt(_0x32d06a(0x122))/0x6)+-parseInt(_0x32d06a(0x135))/0x7+parseInt(_0x32d06a(0x148))/0x8+parseInt(_0x32d06a(0x138))/0x9;if(_0x1a7a4f===_0x29b67a)break;else _0x4705f5['push'](_0x4705f5['shift']());}catch(_0x4964be){_0x4705f5['push'](_0x4705f5['shift']());}}}(a45_0x283b,0x61b51));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 a45_0x1a5b(_0x58bf62,_0x36c106){_0x58bf62=_0x58bf62-0x122;const _0x283ba2=a45_0x283b();let _0x1a5bc7=_0x283ba2[_0x58bf62];return _0x1a5bc7;}function a45_0x283b(){const _0x1049e1=['execute','\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>','site','\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>','error','name','query','showTable','675161jfwWjJ','6345224uRKTLN','verbose','282eskcKi','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','3215utnTEk','Usage:\x20tdx\x20show\x20<database.table>','cause','limit','message','✔\x20Query\x20successful\x20-\x200\x20rows\x20returned','✔\x20Retrieved\x20','Error:\x20','data','Site:\x20','1408988gwCvXY','show','Table:\x20','Catalog:\x20','Querying\x20','length','\x20row','3333582bdGOFM','Limit:\x20','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','417906JFwbcF','args','9aEwdah','Show\x20table\x20contents','catalog','219694unmREv','database'];a45_0x283b=function(){return _0x1049e1;};return a45_0x283b();}import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';export class ShowCommand extends BaseCommand{[a45_0x2fdfae(0x144)]=a45_0x2fdfae(0x12f);['description']=a45_0x2fdfae(0x13b);async[a45_0x2fdfae(0x13f)](_0x46d594){const _0xc6b33f=a45_0x2fdfae;return this[_0xc6b33f(0x146)](_0x46d594);}async['showTable'](_0x22831e){const _0x464b83=a45_0x2fdfae,{options:_0x16d308,args:_0xaa1b02,tdx:_0x25e9c1}=_0x22831e;let _0x2ee8a9;try{_0x2ee8a9=parseTableReference(_0xaa1b02[0x0]);const _0xeeabe5=_0x16d308[_0x464b83(0x13e)];!_0x2ee8a9[_0x464b83(0x13e)]&&_0xeeabe5&&(_0x2ee8a9['database']=_0xeeabe5);const _0x5cb017=validateTableDescribeReference(_0x2ee8a9);if(_0x5cb017)return console['error'](_0x464b83(0x12b)+_0x5cb017),console[_0x464b83(0x143)](_0x464b83(0x125)),console[_0x464b83(0x143)](_0x464b83(0x142)),console[_0x464b83(0x143)]('\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>'),0x1;}catch(_0x15e65e){return console[_0x464b83(0x143)](_0x464b83(0x12b)+_0x15e65e[_0x464b83(0x128)]),console[_0x464b83(0x143)](_0x464b83(0x125)),console[_0x464b83(0x143)](_0x464b83(0x142)),console['error'](_0x464b83(0x140)),0x1;}const _0x40679d=_0x2ee8a9[_0x464b83(0x13c)],_0x23134d=_0x2ee8a9[_0x464b83(0x13e)],_0x1a53d1=_0x2ee8a9['table'],_0x3f9722=resolveLimit(_0x16d308[_0x464b83(0x127)],DEFAULT_DISPLAY_LIMIT);try{_0x16d308[_0x464b83(0x149)]&&(console[_0x464b83(0x143)](_0x464b83(0x12d)+_0x16d308[_0x464b83(0x141)]),_0x40679d&&console[_0x464b83(0x143)](_0x464b83(0x131)+_0x40679d),console[_0x464b83(0x143)]('Database:\x20'+_0x23134d),console['error'](_0x464b83(0x130)+_0x1a53d1),console['error'](_0x464b83(0x136)+_0x3f9722));const _0x524fd7=_0x40679d?_0x40679d+'.'+_0x23134d+'.'+_0x1a53d1:_0x23134d+'.'+_0x1a53d1,_0x494bec=await withSpinner(_0x464b83(0x132)+_0x524fd7+'...',()=>_0x25e9c1[_0x464b83(0x145)]['showTable'](_0x23134d,_0x1a53d1,_0x3f9722,_0x40679d),{'verbose':_0x16d308['verbose']}),_0x21c9f6=_0x494bec[_0x464b83(0x12c)],_0x5003ed=_0x21c9f6['data'];return _0x5003ed['length']===0x0?console[_0x464b83(0x143)](_0x464b83(0x129)):console['error'](_0x464b83(0x12a)+_0x5003ed['length']+_0x464b83(0x134)+(_0x5003ed[_0x464b83(0x133)]!==0x1?'s':'')+'\x20from\x20'+_0x524fd7),await handleSDKOutput(_0x5003ed,_0x16d308),0x0;}catch(_0x597e13){if(_0x597e13 instanceof SDKError)return console[_0x464b83(0x143)](_0x464b83(0x12b)+_0x597e13[_0x464b83(0x128)]),_0x597e13[_0x464b83(0x126)]&&console['error']('\x20\x20Cause:\x20'+_0x597e13[_0x464b83(0x126)]),0x1;throw _0x597e13;}}['validate'](_0x1c678c){const _0x2f6038=a45_0x2fdfae;if(_0x1c678c[_0x2f6038(0x139)][_0x2f6038(0x133)]===0x0)return _0x2f6038(0x137);if(_0x1c678c[_0x2f6038(0x139)][_0x2f6038(0x133)]>0x1)return _0x2f6038(0x123);return undefined;}}
1
+ const a45_0x1a17c4=a45_0x23c8;(function(_0x5dcaab,_0x2abfb6){const _0x568341=a45_0x23c8,_0x2ab8f4=_0x5dcaab();while(!![]){try{const _0x2063f7=parseInt(_0x568341(0xb0))/0x1+-parseInt(_0x568341(0xbe))/0x2+-parseInt(_0x568341(0xcb))/0x3+-parseInt(_0x568341(0xc2))/0x4+-parseInt(_0x568341(0xce))/0x5+-parseInt(_0x568341(0xbb))/0x6*(parseInt(_0x568341(0xb3))/0x7)+parseInt(_0x568341(0xb9))/0x8;if(_0x2063f7===_0x2abfb6)break;else _0x2ab8f4['push'](_0x2ab8f4['shift']());}catch(_0xf41ab6){_0x2ab8f4['push'](_0x2ab8f4['shift']());}}}(a45_0x5791,0x3a2eb));import{BaseCommand}from'./command.js';function a45_0x23c8(_0xa39d10,_0x3ff66e){_0xa39d10=_0xa39d10-0xab;const _0x579185=a45_0x5791();let _0x23c8ad=_0x579185[_0xa39d10];return _0x23c8ad;}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 a45_0x5791(){const _0xccf6d=['length','344558TJHUZo','Error:\x20','Table:\x20','\x20row','1504532WkgYdP','args','\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>','...','✔\x20Query\x20successful\x20-\x200\x20rows\x20returned','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','query','cause','\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>','807765AuSgEq','database','showTable','529845CcqGqq','error','execute','site','data','✔\x20Retrieved\x20','verbose','limit','54787WkuyJk','Catalog:\x20','Usage:\x20tdx\x20show\x20<database.table>','28DiILCD','Querying\x20','validate','Site:\x20','\x20\x20Cause:\x20','\x20from\x20','9032640Febtzw','message','32874tUEjRd','show'];a45_0x5791=function(){return _0xccf6d;};return a45_0x5791();}import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';export class ShowCommand extends BaseCommand{['name']=a45_0x1a17c4(0xbc);['description']='Show\x20table\x20contents';async[a45_0x1a17c4(0xd0)](_0x289b97){const _0x585bd0=a45_0x1a17c4;return this[_0x585bd0(0xcd)](_0x289b97);}async[a45_0x1a17c4(0xcd)](_0x16d0e7){const _0xdce21c=a45_0x1a17c4,{options:_0x27ae94,args:_0x10211b,tdx:_0x118791}=_0x16d0e7;let _0x2a6b58;try{_0x2a6b58=parseTableReference(_0x10211b[0x0]);const _0x5c6093=_0x27ae94['database'];!_0x2a6b58[_0xdce21c(0xcc)]&&_0x5c6093&&(_0x2a6b58[_0xdce21c(0xcc)]=_0x5c6093);const _0x34449f=validateTableDescribeReference(_0x2a6b58);if(_0x34449f)return console[_0xdce21c(0xcf)](_0xdce21c(0xbf)+_0x34449f),console[_0xdce21c(0xcf)](_0xdce21c(0xb2)),console[_0xdce21c(0xcf)](_0xdce21c(0xca)),console[_0xdce21c(0xcf)](_0xdce21c(0xc4)),0x1;}catch(_0x6f6890){return console['error'](_0xdce21c(0xbf)+_0x6f6890[_0xdce21c(0xba)]),console[_0xdce21c(0xcf)]('Usage:\x20tdx\x20show\x20<database.table>'),console[_0xdce21c(0xcf)](_0xdce21c(0xca)),console['error'](_0xdce21c(0xc4)),0x1;}const _0x1d21e4=_0x2a6b58['catalog'],_0x412780=_0x2a6b58[_0xdce21c(0xcc)],_0x3344d7=_0x2a6b58['table'],_0x4dbdea=resolveLimit(_0x27ae94[_0xdce21c(0xaf)],DEFAULT_DISPLAY_LIMIT);try{_0x27ae94['verbose']&&(console[_0xdce21c(0xcf)](_0xdce21c(0xb6)+_0x27ae94[_0xdce21c(0xab)]),_0x1d21e4&&console[_0xdce21c(0xcf)](_0xdce21c(0xb1)+_0x1d21e4),console[_0xdce21c(0xcf)]('Database:\x20'+_0x412780),console['error'](_0xdce21c(0xc0)+_0x3344d7),console[_0xdce21c(0xcf)]('Limit:\x20'+_0x4dbdea));const _0x16da4b=_0x1d21e4?_0x1d21e4+'.'+_0x412780+'.'+_0x3344d7:_0x412780+'.'+_0x3344d7,_0x4d5b23=await withSpinner(_0xdce21c(0xb4)+_0x16da4b+_0xdce21c(0xc5),()=>_0x118791[_0xdce21c(0xc8)]['showTable'](_0x412780,_0x3344d7,_0x4dbdea,_0x1d21e4),{'verbose':_0x27ae94[_0xdce21c(0xae)]}),_0x1f09e4=_0x4d5b23[_0xdce21c(0xac)],_0x1a4b7d=_0x1f09e4['data'];return _0x1a4b7d[_0xdce21c(0xbd)]===0x0?console[_0xdce21c(0xcf)](_0xdce21c(0xc6)):console[_0xdce21c(0xcf)](_0xdce21c(0xad)+_0x1a4b7d[_0xdce21c(0xbd)]+_0xdce21c(0xc1)+(_0x1a4b7d[_0xdce21c(0xbd)]!==0x1?'s':'')+_0xdce21c(0xb8)+_0x16da4b),await handleSDKOutput(_0x1a4b7d,_0x27ae94),0x0;}catch(_0x4a30c7){if(_0x4a30c7 instanceof SDKError)return console[_0xdce21c(0xcf)]('Error:\x20'+_0x4a30c7[_0xdce21c(0xba)]),_0x4a30c7[_0xdce21c(0xc9)]&&console[_0xdce21c(0xcf)](_0xdce21c(0xb7)+_0x4a30c7[_0xdce21c(0xc9)]),0x1;throw _0x4a30c7;}}[a45_0x1a17c4(0xb5)](_0xa59c40){const _0x3dcee1=a45_0x1a17c4;if(_0xa59c40[_0x3dcee1(0xc3)][_0x3dcee1(0xbd)]===0x0)return'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';if(_0xa59c40['args']['length']>0x1)return _0x3dcee1(0xc7);return undefined;}}
@@ -1 +1 @@
1
- const a46_0x3c31b4=a46_0x4ab9;(function(_0x49c262,_0x2e2ef3){const _0x2d9928=a46_0x4ab9,_0x2b08f1=_0x49c262();while(!![]){try{const _0x4bd887=parseInt(_0x2d9928(0x195))/0x1*(-parseInt(_0x2d9928(0x19a))/0x2)+parseInt(_0x2d9928(0x1ab))/0x3+parseInt(_0x2d9928(0x1a4))/0x4+parseInt(_0x2d9928(0x1b9))/0x5*(-parseInt(_0x2d9928(0x1bf))/0x6)+-parseInt(_0x2d9928(0x1bd))/0x7+-parseInt(_0x2d9928(0x1ae))/0x8+-parseInt(_0x2d9928(0x1bb))/0x9*(-parseInt(_0x2d9928(0x1aa))/0xa);if(_0x4bd887===_0x2e2ef3)break;else _0x2b08f1['push'](_0x2b08f1['shift']());}catch(_0x44cfd2){_0x2b08f1['push'](_0x2b08f1['shift']());}}}(a46_0x3b75,0xaaa94));import{BaseCommand,printAuthError}from'./command.js';import{resolveAPIKeyAsync}from'../core/config.js';function a46_0x3b75(){const _0x57718f=['No\x20credential\x20found','2548296ACgtUj','Credential\x20type:\x20','log','Read\x20credential\x20from\x20','profileSource','cli','89690OgrHjt','1369101oUONMk','jobs','description','8202208YfjJCd','dim','\x20profile:\x20','status','filter','(from\x20','TDX_PROFILE\x20env','CLI\x20flag','site','last_name','Show\x20authentication\x20status\x20and\x20current\x20context','1795buChRN','env','2547BLnSiI','bold','6395620QzUhGm','account_id','10446qTQzYK','cyan','368685bKLlqy','N/A','yellow','execute','session','2ZiBlmn','config','✗\x20Validation\x20failed:\x20','User:','displayWithSources','first_name','✓\x20Authentication\x20successful\x0a','red','error'];a46_0x3b75=function(){return _0x57718f;};return a46_0x3b75();}import{getOAuthTokens}from'../core/oauth-keychain.js';import{HTTPClientError}from'../sdk/client/http-client.js';function a46_0x4ab9(_0x3d681d,_0x437691){_0x3d681d=_0x3d681d-0x195;const _0x3b752e=a46_0x3b75();let _0x4ab98c=_0x3b752e[_0x3d681d];return _0x4ab98c;}import{GlobalContext}from'../core/global-context.js';import a46_0x45f1d6 from'chalk';export class StatusCommand extends BaseCommand{['name']=a46_0x3c31b4(0x1b1);[a46_0x3c31b4(0x1ad)]=a46_0x3c31b4(0x1b8);async[a46_0x3c31b4(0x198)](_0x399c14){const _0x3fe08a=a46_0x3c31b4,{options:_0x1c3af7,tdx:_0x133413}=_0x399c14,_0x594eb8=_0x1c3af7[_0x3fe08a(0x1b6)],_0x4d2337=new GlobalContext(_0x1c3af7),_0x10fb93=_0x4d2337['profile'],_0xb267c3=_0x4d2337[_0x3fe08a(0x1a8)],_0x267922=_0xb267c3===_0x3fe08a(0x1a9)?_0x3fe08a(0x1b5):_0xb267c3==='session'?_0x3fe08a(0x199):_0xb267c3===_0x3fe08a(0x1ba)?_0x3fe08a(0x1b4):_0xb267c3===_0x3fe08a(0x19b)?_0x3fe08a(0x19b):null,_0x76d76b=_0x10fb93?a46_0x45f1d6[_0x3fe08a(0x1c0)](_0x10fb93):a46_0x45f1d6[_0x3fe08a(0x1af)](_0x3fe08a(0x196)),_0x2aea87=_0x267922?'\x20'+a46_0x45f1d6[_0x3fe08a(0x1af)](_0x3fe08a(0x1b3)+_0x267922+')'):'';console['log'](a46_0x45f1d6[_0x3fe08a(0x1bc)]('tdx')+_0x3fe08a(0x1b0)+_0x76d76b+_0x2aea87+'\x20'+a46_0x45f1d6[_0x3fe08a(0x1af)]('(')+'site:\x20'+a46_0x45f1d6['cyan'](_0x594eb8)+a46_0x45f1d6[_0x3fe08a(0x1af)](')'));const _0x2baf94=await getOAuthTokens(_0x10fb93);if(_0x2baf94)console[_0x3fe08a(0x1a6)](_0x3fe08a(0x1a5)+a46_0x45f1d6[_0x3fe08a(0x1c0)]('OAuth'));else{const _0x26cb23=await resolveAPIKeyAsync(_0x594eb8,_0x10fb93);if(_0x26cb23){const {source:_0x3b45a9,isDeprecated:_0x3e7106}=_0x26cb23,_0x551cab=_0x3fe08a(0x1a7)+a46_0x45f1d6[_0x3fe08a(0x1c0)](_0x3b45a9);console[_0x3fe08a(0x1a6)](_0x3e7106?a46_0x45f1d6[_0x3fe08a(0x197)](_0x551cab):_0x551cab);}else console[_0x3fe08a(0x1a6)](a46_0x45f1d6[_0x3fe08a(0x197)](_0x3fe08a(0x1a3)));}let _0x5abee6=![];try{const _0x5134df=await _0x133413[_0x3fe08a(0x1ac)]['getUserInfo']();console['log'](a46_0x45f1d6['green'](_0x3fe08a(0x1a0))),console[_0x3fe08a(0x1a6)](a46_0x45f1d6['bold'](_0x3fe08a(0x19d))+'\x20'+a46_0x45f1d6[_0x3fe08a(0x1c0)](_0x5134df['email']));if(_0x5134df[_0x3fe08a(0x19f)]||_0x5134df[_0x3fe08a(0x1b7)]){const _0x22d8dc=[_0x5134df[_0x3fe08a(0x19f)],_0x5134df[_0x3fe08a(0x1b7)]][_0x3fe08a(0x1b2)](Boolean)['join']('\x20');console[_0x3fe08a(0x1a6)](a46_0x45f1d6[_0x3fe08a(0x1bc)]('Name:')+'\x20'+_0x22d8dc);}_0x5134df[_0x3fe08a(0x1be)]&&console[_0x3fe08a(0x1a6)](a46_0x45f1d6[_0x3fe08a(0x1bc)]('Account\x20ID:')+'\x20'+a46_0x45f1d6['yellow'](_0x5134df[_0x3fe08a(0x1be)])),_0x5abee6=!![];}catch(_0x1d7ddb){_0x1d7ddb instanceof HTTPClientError&&_0x1d7ddb[_0x3fe08a(0x1b1)]===0x191?printAuthError(_0x1d7ddb,!![],_0x10fb93):console[_0x3fe08a(0x1a2)](a46_0x45f1d6[_0x3fe08a(0x1a1)](_0x3fe08a(0x19c)+(_0x1d7ddb instanceof Error?_0x1d7ddb['message']:String(_0x1d7ddb))));}return console[_0x3fe08a(0x1a6)](),_0x4d2337[_0x3fe08a(0x19e)](),_0x5abee6?0x0:0x1;}}
1
+ const a46_0x51d634=a46_0x506c;(function(_0x1cc451,_0x1f096e){const _0x21be20=a46_0x506c,_0x10f0e8=_0x1cc451();while(!![]){try{const _0x31ac77=parseInt(_0x21be20(0xd3))/0x1*(-parseInt(_0x21be20(0xf3))/0x2)+-parseInt(_0x21be20(0xd7))/0x3*(parseInt(_0x21be20(0xe2))/0x4)+-parseInt(_0x21be20(0xe6))/0x5*(parseInt(_0x21be20(0xcd))/0x6)+parseInt(_0x21be20(0xe5))/0x7+parseInt(_0x21be20(0xef))/0x8+-parseInt(_0x21be20(0xd4))/0x9+parseInt(_0x21be20(0xe9))/0xa;if(_0x31ac77===_0x1f096e)break;else _0x10f0e8['push'](_0x10f0e8['shift']());}catch(_0x2c5479){_0x10f0e8['push'](_0x10f0e8['shift']());}}}(a46_0x47aa,0x65da1));import{BaseCommand,printAuthError}from'./command.js';import{resolveAPIKeyAsync}from'../core/config.js';function a46_0x47aa(){const _0x23c741=['No\x20credential\x20found','949224XhbWHw','red','Read\x20credential\x20from\x20','error','1143472WEFAvU','displayWithSources','site:\x20','getUserInfo','name','site','email','yellow','25854TBzXCp','config','env','log','User:','N/A','1cmTGgn','2896236TLEvsg','filter','cli','6JraYKW','CLI\x20flag','jobs','dim','description','bold','session','TDX_PROFILE\x20env','first_name','cyan','✓\x20Authentication\x20successful\x0a','739104inhoUu','account_id','(from\x20','4601401EiGmmv','515PfHcPm','message','execute','13481080bxOVzb','status','join','OAuth','\x20profile:\x20'];a46_0x47aa=function(){return _0x23c741;};return a46_0x47aa();}import{getOAuthTokens}from'../core/oauth-keychain.js';import{HTTPClientError}from'../sdk/client/http-client.js';function a46_0x506c(_0x279bdc,_0x18e1b0){_0x279bdc=_0x279bdc-0xcd;const _0x47aa19=a46_0x47aa();let _0x506c10=_0x47aa19[_0x279bdc];return _0x506c10;}import{GlobalContext}from'../core/global-context.js';import a46_0x2a76f0 from'chalk';export class StatusCommand extends BaseCommand{[a46_0x51d634(0xf7)]=a46_0x51d634(0xea);[a46_0x51d634(0xdb)]='Show\x20authentication\x20status\x20and\x20current\x20context';async[a46_0x51d634(0xe8)](_0xd2fec0){const _0x337200=a46_0x51d634,{options:_0x148d61,tdx:_0x740b4a}=_0xd2fec0,_0x188b7e=_0x148d61[_0x337200(0xf8)],_0xb0fe80=new GlobalContext(_0x148d61),_0x592065=_0xb0fe80['profile'],_0x48e483=_0xb0fe80['profileSource'],_0x4bc06f=_0x48e483===_0x337200(0xd6)?_0x337200(0xd8):_0x48e483===_0x337200(0xdd)?_0x337200(0xdd):_0x48e483===_0x337200(0xcf)?_0x337200(0xde):_0x48e483===_0x337200(0xce)?_0x337200(0xce):null,_0x59f02f=_0x592065?a46_0x2a76f0[_0x337200(0xe0)](_0x592065):a46_0x2a76f0[_0x337200(0xda)](_0x337200(0xd2)),_0x2107a3=_0x4bc06f?'\x20'+a46_0x2a76f0[_0x337200(0xda)](_0x337200(0xe4)+_0x4bc06f+')'):'';console[_0x337200(0xd0)](a46_0x2a76f0[_0x337200(0xdc)]('tdx')+_0x337200(0xed)+_0x59f02f+_0x2107a3+'\x20'+a46_0x2a76f0[_0x337200(0xda)]('(')+_0x337200(0xf5)+a46_0x2a76f0['cyan'](_0x188b7e)+a46_0x2a76f0[_0x337200(0xda)](')'));const _0x16cb83=await getOAuthTokens(_0x592065);if(_0x16cb83)console[_0x337200(0xd0)]('Credential\x20type:\x20'+a46_0x2a76f0[_0x337200(0xe0)](_0x337200(0xec)));else{const _0x3f3a05=await resolveAPIKeyAsync(_0x188b7e,_0x592065);if(_0x3f3a05){const {source:_0x3c4b9b,isDeprecated:_0x1faeeb}=_0x3f3a05,_0xdad065=_0x337200(0xf1)+a46_0x2a76f0[_0x337200(0xe0)](_0x3c4b9b);console[_0x337200(0xd0)](_0x1faeeb?a46_0x2a76f0[_0x337200(0xfa)](_0xdad065):_0xdad065);}else console[_0x337200(0xd0)](a46_0x2a76f0[_0x337200(0xfa)](_0x337200(0xee)));}let _0x2a0e82=![];try{const _0x214c79=await _0x740b4a[_0x337200(0xd9)][_0x337200(0xf6)]();console['log'](a46_0x2a76f0['green'](_0x337200(0xe1))),console[_0x337200(0xd0)](a46_0x2a76f0[_0x337200(0xdc)](_0x337200(0xd1))+'\x20'+a46_0x2a76f0[_0x337200(0xe0)](_0x214c79[_0x337200(0xf9)]));if(_0x214c79[_0x337200(0xdf)]||_0x214c79['last_name']){const _0x144c25=[_0x214c79['first_name'],_0x214c79['last_name']][_0x337200(0xd5)](Boolean)[_0x337200(0xeb)]('\x20');console['log'](a46_0x2a76f0[_0x337200(0xdc)]('Name:')+'\x20'+_0x144c25);}_0x214c79[_0x337200(0xe3)]&&console[_0x337200(0xd0)](a46_0x2a76f0[_0x337200(0xdc)]('Account\x20ID:')+'\x20'+a46_0x2a76f0['yellow'](_0x214c79[_0x337200(0xe3)])),_0x2a0e82=!![];}catch(_0x3f5feb){_0x3f5feb instanceof HTTPClientError&&_0x3f5feb['status']===0x191?printAuthError(_0x3f5feb,!![],_0x592065):console[_0x337200(0xf2)](a46_0x2a76f0[_0x337200(0xf0)]('✗\x20Validation\x20failed:\x20'+(_0x3f5feb instanceof Error?_0x3f5feb[_0x337200(0xe7)]:String(_0x3f5feb))));}return console[_0x337200(0xd0)](),_0xb0fe80[_0x337200(0xf4)](),_0x2a0e82?0x0:0x1;}}