@treasuredata/tdx 2026.4.0 → 2026.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (219) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.js +1 -1
  5. package/dist/commands/activations.js +1 -1
  6. package/dist/commands/agent-command.js +1 -1
  7. package/dist/commands/agent-test-command.js +1 -1
  8. package/dist/commands/api-command.js +1 -1
  9. package/dist/commands/auth-command.js +1 -1
  10. package/dist/commands/cas-command.js +1 -1
  11. package/dist/commands/cas-segment-command.js +1 -1
  12. package/dist/commands/chat-command.js +1 -1
  13. package/dist/commands/claude-command.js +1 -1
  14. package/dist/commands/claude-statusline-command.js +1 -1
  15. package/dist/commands/claude-usage-command.js +1 -1
  16. package/dist/commands/command.js +1 -1
  17. package/dist/commands/connection-command.js +1 -1
  18. package/dist/commands/databases.js +1 -1
  19. package/dist/commands/delivery-command.js +1 -1
  20. package/dist/commands/describe.js +1 -1
  21. package/dist/commands/engage-campaign-pull-command.js +1 -1
  22. package/dist/commands/engage-campaign-push-command.js +1 -1
  23. package/dist/commands/engage-campaign-validate-command.js +1 -1
  24. package/dist/commands/engage-command.js +1 -1
  25. package/dist/commands/engage-template-pull-command.js +1 -1
  26. package/dist/commands/engage-template-push-command.js +1 -1
  27. package/dist/commands/engage-template-validate-command.js +1 -1
  28. package/dist/commands/job-command.js +1 -1
  29. package/dist/commands/journey-command.js +1 -1
  30. package/dist/commands/journey-validate-command.js +1 -1
  31. package/dist/commands/llm-command.js +1 -1
  32. package/dist/commands/mcp-command.js +1 -1
  33. package/dist/commands/parent-segment-command.js +1 -1
  34. package/dist/commands/policy-command.js +1 -1
  35. package/dist/commands/profile-command.js +1 -1
  36. package/dist/commands/profiles-command.js +1 -1
  37. package/dist/commands/query-command.js +1 -1
  38. package/dist/commands/schedule-command.js +1 -1
  39. package/dist/commands/segment-command.js +1 -1
  40. package/dist/commands/segment-create-command.js +1 -1
  41. package/dist/commands/segment-fields-command.js +1 -1
  42. package/dist/commands/segment-pull-command.js +1 -1
  43. package/dist/commands/segment-push-command.js +1 -1
  44. package/dist/commands/segment-update-command.js +1 -1
  45. package/dist/commands/segment-use-command.js +1 -1
  46. package/dist/commands/segment-validate-command.js +1 -1
  47. package/dist/commands/segments.js +1 -1
  48. package/dist/commands/show.js +1 -1
  49. package/dist/commands/status-command.js +1 -1
  50. package/dist/commands/tables.js +1 -1
  51. package/dist/commands/unset-command.js +1 -1
  52. package/dist/commands/upgrade-command.js +1 -1
  53. package/dist/commands/use-command.js +1 -1
  54. package/dist/commands/user-command.js +1 -1
  55. package/dist/commands/work-command.js +1 -1
  56. package/dist/commands/workflow-command.js +1 -1
  57. package/dist/core/auth.js +1 -1
  58. package/dist/core/command-output.js +1 -1
  59. package/dist/core/config.js +1 -1
  60. package/dist/core/connection-cache.js +1 -1
  61. package/dist/core/constants.js +1 -1
  62. package/dist/core/credential-cache.js +1 -1
  63. package/dist/core/global-context.js +1 -1
  64. package/dist/core/keychain.js +1 -1
  65. package/dist/core/oauth-keychain.js +1 -1
  66. package/dist/core/oauth.js +1 -1
  67. package/dist/core/profile.js +1 -1
  68. package/dist/core/project-config.js +1 -1
  69. package/dist/core/session.js +1 -1
  70. package/dist/core/user-cache.js +1 -1
  71. package/dist/core/version.js +1 -1
  72. package/dist/index.js +1 -1
  73. package/dist/mcp/server.js +1 -1
  74. package/dist/mcp/tools/index.js +1 -1
  75. package/dist/mcp/tools/tdx-run.js +1 -1
  76. package/dist/mcp/tools/tdx-search.js +1 -1
  77. package/dist/mcp/tools/work-create-item.js +1 -1
  78. package/dist/mcp/utils.js +1 -1
  79. package/dist/proxy/claude-usage-tracker.js +1 -1
  80. package/dist/proxy/passthrough-server.js +1 -1
  81. package/dist/proxy/sse-usage-parser.js +1 -1
  82. package/dist/sdk/agent/agent-config.js +1 -1
  83. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  84. package/dist/sdk/agent/agent-yaml.js +1 -1
  85. package/dist/sdk/agent/test/evaluator.js +1 -1
  86. package/dist/sdk/agent/test/executor.js +1 -1
  87. package/dist/sdk/agent/test/index.js +1 -1
  88. package/dist/sdk/agent/test/output.js +1 -1
  89. package/dist/sdk/agent/test/parser.js +1 -1
  90. package/dist/sdk/agent/tool-target-registry.js +1 -1
  91. package/dist/sdk/api.js +1 -1
  92. package/dist/sdk/cas/cas-api-client.js +1 -1
  93. package/dist/sdk/cas/cas-audience-yaml.js +1 -1
  94. package/dist/sdk/cas/cas-segment-yaml.js +1 -1
  95. package/dist/sdk/cas/index.js +1 -1
  96. package/dist/sdk/cas/pull-workflow.js +1 -1
  97. package/dist/sdk/cas/push-workflow.js +1 -1
  98. package/dist/sdk/client/cdp-api-client.js +1 -1
  99. package/dist/sdk/client/delivery-api-client.js +1 -1
  100. package/dist/sdk/client/endpoints.js +1 -1
  101. package/dist/sdk/client/engage-api-client.js +1 -1
  102. package/dist/sdk/client/http-client.js +1 -1
  103. package/dist/sdk/client/llm-api-client.js +1 -1
  104. package/dist/sdk/client/oauth-refresh.js +1 -1
  105. package/dist/sdk/client/rate-limiter.js +1 -1
  106. package/dist/sdk/client/td-api-client.js +1 -1
  107. package/dist/sdk/client/trino-api-client.js +1 -1
  108. package/dist/sdk/client/workflow-client.js +1 -1
  109. package/dist/sdk/connection-validator.js +1 -1
  110. package/dist/sdk/connection.js +1 -1
  111. package/dist/sdk/delivery.js +1 -1
  112. package/dist/sdk/engage/campaign-pull.js +1 -1
  113. package/dist/sdk/engage/campaign-push.js +1 -1
  114. package/dist/sdk/engage/campaign-validator.js +1 -1
  115. package/dist/sdk/engage/campaign-yaml.js +1 -1
  116. package/dist/sdk/engage/template-pull.js +1 -1
  117. package/dist/sdk/engage/template-push.js +1 -1
  118. package/dist/sdk/engage/template-validator.js +1 -1
  119. package/dist/sdk/engage/template-yaml.js +1 -1
  120. package/dist/sdk/engage/types/campaign-def.js +1 -1
  121. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  122. package/dist/sdk/engage/types/template-schema.js +1 -1
  123. package/dist/sdk/engage.js +1 -1
  124. package/dist/sdk/errors.js +1 -1
  125. package/dist/sdk/index.js +1 -1
  126. package/dist/sdk/io/index.js +1 -1
  127. package/dist/sdk/io/node-filesystem.js +1 -1
  128. package/dist/sdk/job.js +1 -1
  129. package/dist/sdk/journey.js +1 -1
  130. package/dist/sdk/llm/chat-cache.js +1 -1
  131. package/dist/sdk/llm/index.js +1 -1
  132. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  133. package/dist/sdk/llm/model-factors.js +1 -1
  134. package/dist/sdk/personalization.js +1 -1
  135. package/dist/sdk/policy.js +1 -1
  136. package/dist/sdk/query/index.js +1 -1
  137. package/dist/sdk/query/sql-parser.js +1 -1
  138. package/dist/sdk/realtime.js +1 -1
  139. package/dist/sdk/schedule.js +1 -1
  140. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  141. package/dist/sdk/segment/fields-display.js +1 -1
  142. package/dist/sdk/segment/file-discovery.js +1 -1
  143. package/dist/sdk/segment/journey-utils.js +1 -1
  144. package/dist/sdk/segment/journey-validator.js +1 -1
  145. package/dist/sdk/segment/journey-yaml.js +1 -1
  146. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  147. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  148. package/dist/sdk/segment/pull-workflow.js +1 -1
  149. package/dist/sdk/segment/push-recovery.js +1 -1
  150. package/dist/sdk/segment/push-workflow.js +1 -1
  151. package/dist/sdk/segment/resolution-context.js +1 -1
  152. package/dist/sdk/segment/segment-path-parser.js +1 -1
  153. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  154. package/dist/sdk/segment/segment-validator.js +1 -1
  155. package/dist/sdk/segment/target-resolution.js +1 -1
  156. package/dist/sdk/segment/tdx-config.js +1 -1
  157. package/dist/sdk/segment/types/activation-schema.js +1 -1
  158. package/dist/sdk/segment/types/journey-def.js +1 -1
  159. package/dist/sdk/segment/types/journey-schema.js +1 -1
  160. package/dist/sdk/segment/types/segment-def.js +1 -1
  161. package/dist/sdk/segment/types/segment-schema.js +1 -1
  162. package/dist/sdk/segment/validate-files.js +1 -1
  163. package/dist/sdk/segment/yaml-validator.js +1 -1
  164. package/dist/sdk/segment.js +1 -1
  165. package/dist/sdk/types/index.js +1 -1
  166. package/dist/sdk/types/progress.js +1 -1
  167. package/dist/sdk/types/workspace.js +1 -1
  168. package/dist/sdk/user.js +1 -1
  169. package/dist/sdk/util/format-detector.js +1 -1
  170. package/dist/sdk/util/formatters.js +1 -1
  171. package/dist/sdk/util/index.js +1 -1
  172. package/dist/sdk/util/paginate.js +1 -1
  173. package/dist/sdk/util/tree-formatter.js +1 -1
  174. package/dist/sdk/workflow/archive-validation.js +1 -1
  175. package/dist/sdk/workflow/clone-workflow.js +1 -1
  176. package/dist/sdk/workflow/index.js +1 -1
  177. package/dist/sdk/workflow/pull-workflow.js +1 -1
  178. package/dist/sdk/workflow/push-workflow.js +1 -1
  179. package/dist/sdk/workflow/tdx-config.js +1 -1
  180. package/dist/sdk/workflow/workflow-utils.js +1 -1
  181. package/dist/sdk/workspace/frontmatter.js +1 -1
  182. package/dist/sdk/workspace/git.js +1 -1
  183. package/dist/sdk/workspace/index.js +1 -1
  184. package/dist/sdk/workspace/templates.js +1 -1
  185. package/dist/sdk/workspace/weekly.js +1 -1
  186. package/dist/sdk/workspace/wikilinks.js +1 -1
  187. package/dist/test-utils/command-runner.js +1 -1
  188. package/dist/test-utils/factories.js +1 -1
  189. package/dist/test-utils/fixtures.js +1 -1
  190. package/dist/test-utils/http-mock.js +1 -1
  191. package/dist/test-utils/index.js +1 -1
  192. package/dist/utils/async.js +1 -1
  193. package/dist/utils/colors.js +1 -1
  194. package/dist/utils/diff.js +1 -1
  195. package/dist/utils/file-permissions.js +1 -1
  196. package/dist/utils/file-reader.js +1 -1
  197. package/dist/utils/github-releases.js +1 -1
  198. package/dist/utils/global-cache.js +1 -1
  199. package/dist/utils/json-loader.js +1 -1
  200. package/dist/utils/local-cache.js +1 -1
  201. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  202. package/dist/utils/logger/formatters/index.js +1 -1
  203. package/dist/utils/logger/handlers/console-handler.js +1 -1
  204. package/dist/utils/logger/handlers/file-handler.js +1 -1
  205. package/dist/utils/logger/handlers/index.js +1 -1
  206. package/dist/utils/logger/handlers/null-handler.js +1 -1
  207. package/dist/utils/logger/index.js +1 -1
  208. package/dist/utils/logger/logger.js +1 -1
  209. package/dist/utils/logger/types.js +1 -1
  210. package/dist/utils/option-validation.js +1 -1
  211. package/dist/utils/process.js +1 -1
  212. package/dist/utils/prompt.js +1 -1
  213. package/dist/utils/spinner.js +1 -1
  214. package/dist/utils/sse-parser.js +1 -1
  215. package/dist/utils/string-utils.js +1 -1
  216. package/dist/utils/table-ref-parser.js +1 -1
  217. package/dist/utils/tdx-logger.js +1 -1
  218. package/dist/utils/version-check.js +1 -1
  219. package/package.json +1 -1
@@ -1 +1 @@
1
- const a40_0x516ce0=a40_0x3e95;(function(_0x4ce5df,_0x192e81){const _0x1644f9=a40_0x3e95,_0x41ec3e=_0x4ce5df();while(!![]){try{const _0x30ab78=parseInt(_0x1644f9(0xc9))/0x1+parseInt(_0x1644f9(0xbb))/0x2+parseInt(_0x1644f9(0xda))/0x3+parseInt(_0x1644f9(0xc4))/0x4*(parseInt(_0x1644f9(0xcb))/0x5)+-parseInt(_0x1644f9(0xc0))/0x6*(-parseInt(_0x1644f9(0xb6))/0x7)+parseInt(_0x1644f9(0xb5))/0x8*(parseInt(_0x1644f9(0xca))/0x9)+-parseInt(_0x1644f9(0xc2))/0xa*(parseInt(_0x1644f9(0xef))/0xb);if(_0x30ab78===_0x192e81)break;else _0x41ec3e['push'](_0x41ec3e['shift']());}catch(_0x2c1caa){_0x41ec3e['push'](_0x41ec3e['shift']());}}}(a40_0x59e6,0xef52f));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';function a40_0x59e6(){const _0x3bb8f1=['site','808692PUISuF','\x20unchanged\x20files','Error:\x20','journeyVersions','session','1806119MXzgaw','2583VnwAbt','5xkGDLu','content','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','setPhase','green','parent_segment','\x20versions)','Aborted.','\x20\x20🗺️\x20\x20','cyan','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent','length','No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27','diff','filter','3991908JUNWmF','✔\x20Pulled\x20','hasChanges','segments','\x20changed\x20files','segment:pull','message','✔\x20Context\x20set:\x20','parentName','yellow','\x20files?','cwd','dirname','verbose','journeys','Site:\x20','Target\x20resource:\x20','relativePath','data','execute','\x20files\x20to\x20','11420244MCgVtG','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)','counts','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file','resourceName','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','✔\x20All\x20files\x20are\x20up\x20to\x20date','\x20\x20🎯\x20','\x20new\x20files','targetDir','\x20journeys','files','Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files','\x0aPull\x20summary\x20for\x20\x27','Parent\x20segment:\x20','\x0aChanges\x20to\x20\x27','\x20\x20Target:\x20','error','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','dryRun','Pulling\x20segments\x20from\x20\x27','isNew','description','absolutePath','15112wIwrMx','238WCsGcN','no_parent','Write\x20','\x20=\x20','dim','484296HYrusQ','pullSegments','file','repeat','errorCode','178212iNgDVB','red','40kctUda'];a40_0x59e6=function(){return _0x3bb8f1;};return a40_0x59e6();}import{saveSessionContext}from'../core/session.js';function a40_0x3e95(_0x420e09,_0x32986c){_0x420e09=_0x420e09-0x9e;const _0x59e632=a40_0x59e6();let _0x3e95f7=_0x59e632[_0x420e09];return _0x3e95f7;}import a40_0x411928 from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';import a40_0x1dd15a from'path';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';export{buildFolderIdToPathMap as buildFolderPathMap}from'../sdk/segment/resolution-context.js';export class SegmentPullCommand extends BaseCommand{['name']=a40_0x516ce0(0xdf);[a40_0x516ce0(0xb3)]=a40_0x516ce0(0xa9);async[a40_0x516ce0(0xed)](_0xf05e9a){const _0xe1423c=a40_0x516ce0,{options:_0x18a751,args:_0x49c9c0,tdx:_0x3ba5f8}=_0xf05e9a,_0x59a484=_0x18a751,_0x2c56f7=await resolveTarget({'arg':_0x49c9c0[0x0],'contextParent':_0x18a751['parentSegment'],'cwd':process[_0xe1423c(0xe5)]()});if(!isSuccessfulResolution(_0x2c56f7))return _0x2c56f7[_0xe1423c(0xbf)]===_0xe1423c(0xb7)?(console['error'](a40_0x411928[_0xe1423c(0xe3)]('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console[_0xe1423c(0xae)](_0xe1423c(0x9e)),console[_0xe1423c(0xae)](_0xe1423c(0xd5)),console[_0xe1423c(0xae)](_0xe1423c(0xa0))):(console[_0xe1423c(0xae)](a40_0x411928[_0xe1423c(0xc1)](_0xe1423c(0xc6)+_0x2c56f7[_0xe1423c(0xe0)]+'\x0a')),_0x2c56f7['helpText']&&console[_0xe1423c(0xae)](a40_0x411928[_0xe1423c(0xd4)](_0x2c56f7['helpText']))),0x1;const _0x2cc7c1=_0x2c56f7[_0xe1423c(0xe2)],_0x30c48c=_0x2c56f7[_0xe1423c(0xa6)],_0x21dbd7=_0x2c56f7['type']===_0xe1423c(0xbd)?_0x2c56f7[_0xe1423c(0xa1)]:undefined;_0x59a484[_0xe1423c(0xe7)]&&(console[_0xe1423c(0xae)](_0xe1423c(0xe9)+_0x59a484[_0xe1423c(0xc3)]),console[_0xe1423c(0xae)](_0xe1423c(0xab)+_0x2cc7c1),_0x21dbd7&&console['error'](_0xe1423c(0xea)+_0x21dbd7));const _0x43076f=await withProgressSpinner(_0xe1423c(0xb1)+_0x2cc7c1+'\x27...',_0x2b157f=>_0x3ba5f8['segment'][_0xe1423c(0xbc)](_0x2cc7c1,{'targetDir':_0x30c48c,'targetResourceName':_0x21dbd7,'verbose':_0x59a484['verbose'],'progress':{'update':_0x10b004=>{const _0x258fb8=_0xe1423c;_0x2b157f[_0x258fb8(0xce)](_0x10b004),_0x59a484[_0x258fb8(0xe7)]&&console[_0x258fb8(0xae)]('\x20\x20'+_0x10b004);}}}),{'verbose':_0x59a484[_0xe1423c(0xe7)]}),_0x449387=_0x43076f[_0xe1423c(0xec)];if(_0x449387[_0xe1423c(0x9f)][_0xe1423c(0xdd)]===0x0&&_0x449387[_0xe1423c(0x9f)]['journeys']===0x0)return console[_0xe1423c(0xae)](a40_0x411928[_0xe1423c(0xe3)](_0xe1423c(0xd7)+_0x449387[_0xe1423c(0xe2)]+'\x27')),0x0;const _0x4840aa=_0x449387[_0xe1423c(0xa8)]['filter'](_0x3d1039=>_0x3d1039['isNew']),_0x39ce7d=_0x449387[_0xe1423c(0xa8)][_0xe1423c(0xd9)](_0x3e9591=>!_0x3e9591[_0xe1423c(0xb2)]&&_0x3e9591[_0xe1423c(0xdc)]),_0x294b78=_0x449387[_0xe1423c(0xa8)][_0xe1423c(0xd9)](_0x44b515=>!_0x44b515[_0xe1423c(0xb2)]&&!_0x44b515['hasChanges']);console[_0xe1423c(0xae)](_0xe1423c(0xaa)+_0x449387['parentName']+'\x27:'),console['error'](_0xe1423c(0xa4)+a40_0x411928['cyan'](_0x449387[_0xe1423c(0x9f)][_0xe1423c(0xdd)]+'\x20segments')+'\x20with\x20'+a40_0x411928[_0xe1423c(0xd4)](_0x449387[_0xe1423c(0x9f)]['activations']+'\x20activations'));if(_0x449387[_0xe1423c(0x9f)][_0xe1423c(0xe8)]>0x0){const _0x5b597a=_0x449387[_0xe1423c(0x9f)][_0xe1423c(0xc7)]>_0x449387[_0xe1423c(0x9f)][_0xe1423c(0xe8)]?'\x20('+_0x449387[_0xe1423c(0x9f)]['journeyVersions']+_0xe1423c(0xd1):'';console[_0xe1423c(0xae)](_0xe1423c(0xd3)+a40_0x411928[_0xe1423c(0xd4)](_0x449387[_0xe1423c(0x9f)][_0xe1423c(0xe8)]+_0xe1423c(0xa7))+a40_0x411928['dim'](_0x5b597a));}console[_0xe1423c(0xae)]('\x20\x20'+a40_0x411928[_0xe1423c(0xcf)]('+\x20'+_0x4840aa[_0xe1423c(0xd6)]+_0xe1423c(0xa5))),console[_0xe1423c(0xae)]('\x20\x20'+a40_0x411928[_0xe1423c(0xe3)]('~\x20'+_0x39ce7d['length']+_0xe1423c(0xde))),console['error']('\x20\x20'+a40_0x411928[_0xe1423c(0xba)]('=\x20'+_0x294b78[_0xe1423c(0xd6)]+_0xe1423c(0xc5))),console[_0xe1423c(0xae)](_0xe1423c(0xad)+a40_0x411928[_0xe1423c(0xd4)](_0x449387[_0xe1423c(0xa6)])+'\x0a');if(_0x39ce7d[_0xe1423c(0xd6)]>0x0)for(const _0x2b0317 of _0x39ce7d){console[_0xe1423c(0xae)](_0xe1423c(0xac)+_0x2b0317[_0xe1423c(0xeb)]+'\x27:'),console['error']('─'[_0xe1423c(0xbe)](0x3c)),console[_0xe1423c(0xae)](_0x2b0317[_0xe1423c(0xd8)]),console['error']('─'[_0xe1423c(0xbe)](0x3c));}if(_0x59a484[_0xe1423c(0xb0)])return console[_0xe1423c(0xae)](a40_0x411928[_0xe1423c(0xe3)](_0xe1423c(0xcd))),0x0;if(_0x4840aa[_0xe1423c(0xd6)]===0x0&&_0x39ce7d[_0xe1423c(0xd6)]===0x0)return console[_0xe1423c(0xae)](a40_0x411928[_0xe1423c(0xcf)](_0xe1423c(0xa3))),saveSessionContext({'parent_segment':_0x449387[_0xe1423c(0xe2)]},_0x59a484[_0xe1423c(0xc8)]),console['error'](a40_0x411928[_0xe1423c(0xcf)](_0xe1423c(0xe1)+a40_0x411928[_0xe1423c(0xba)]('parent_segment')+_0xe1423c(0xb9)+a40_0x411928[_0xe1423c(0xd4)](_0x449387[_0xe1423c(0xe2)]))),0x0;if(!_0x59a484['yes']){if(!isInteractive())return console[_0xe1423c(0xae)](a40_0x411928['red']('\x0aError:'),_0xe1423c(0xaf)),console['error'](a40_0x411928[_0xe1423c(0xba)](_0xe1423c(0xa2))),0x1;const _0x2e6940=await confirmKey(_0xe1423c(0xb8)+(_0x4840aa['length']+_0x39ce7d[_0xe1423c(0xd6)])+_0xe1423c(0xe4));if(!_0x2e6940)return console[_0xe1423c(0xae)](a40_0x411928[_0xe1423c(0xe3)](_0xe1423c(0xd2)),'-\x20no\x20files\x20written'),0x1;}for(const _0x2280f3 of _0x449387['files']){if(_0x2280f3['isNew']||_0x2280f3['hasChanges']){const _0x52cd1a=a40_0x1dd15a[_0xe1423c(0xe6)](_0x2280f3['absolutePath']);!existsSync(_0x52cd1a)&&mkdirSync(_0x52cd1a,{'recursive':!![]}),writeFileSync(_0x2280f3[_0xe1423c(0xb4)],_0x2280f3[_0xe1423c(0xcc)],'utf-8');}}return console[_0xe1423c(0xae)](a40_0x411928[_0xe1423c(0xcf)](_0xe1423c(0xdb)+(_0x4840aa[_0xe1423c(0xd6)]+_0x39ce7d[_0xe1423c(0xd6)])+_0xe1423c(0xee)+_0x449387['targetDir'])),saveSessionContext({'parent_segment':_0x449387[_0xe1423c(0xe2)]},_0x59a484[_0xe1423c(0xc8)]),console['error'](a40_0x411928[_0xe1423c(0xcf)](_0xe1423c(0xe1)+a40_0x411928['dim'](_0xe1423c(0xd0))+_0xe1423c(0xb9)+a40_0x411928[_0xe1423c(0xd4)](_0x449387[_0xe1423c(0xe2)]))),0x0;}}
1
+ const a40_0x5ce9ed=a40_0x4d33;(function(_0x350543,_0x45b80f){const _0x191aa4=a40_0x4d33,_0x4bf2fd=_0x350543();while(!![]){try{const _0x118949=parseInt(_0x191aa4(0xf4))/0x1*(-parseInt(_0x191aa4(0xb9))/0x2)+parseInt(_0x191aa4(0xec))/0x3+parseInt(_0x191aa4(0xe1))/0x4+parseInt(_0x191aa4(0xc6))/0x5*(parseInt(_0x191aa4(0xd0))/0x6)+-parseInt(_0x191aa4(0xda))/0x7*(parseInt(_0x191aa4(0xbb))/0x8)+-parseInt(_0x191aa4(0xcf))/0x9+-parseInt(_0x191aa4(0xd8))/0xa;if(_0x118949===_0x45b80f)break;else _0x4bf2fd['push'](_0x4bf2fd['shift']());}catch(_0x1216ca){_0x4bf2fd['push'](_0x4bf2fd['shift']());}}}(a40_0x396e,0xe9b4f));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{saveSessionContext}from'../core/session.js';import a40_0x75a1c from'chalk';function a40_0x4d33(_0x12546e,_0x157a3c){_0x12546e=_0x12546e-0xaa;const _0x396e51=a40_0x396e();let _0x4d3336=_0x396e51[_0x12546e];return _0x4d3336;}import{existsSync,mkdirSync,writeFileSync}from'fs';import a40_0x4c0cd0 from'path';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';export{buildFolderIdToPathMap as buildFolderPathMap}from'../sdk/segment/resolution-context.js';function a40_0x396e(){const _0x54afbf=['895806MWtJUc','isNew','✔\x20Context\x20set:\x20','-\x20no\x20files\x20written','diff','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','session','red','164543zvjXQw','resourceName','\x20files\x20to\x20','segments','file','execute','green','errorCode','Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files','pullSegments','Target\x20resource:\x20','\x20files?','Pulling\x20segments\x20from\x20\x27','cyan','✔\x20All\x20files\x20are\x20up\x20to\x20date','parent_segment','4pjGUeA','\x0aError:','16joDvCe','\x20\x20🎯\x20','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','segment:pull','relativePath','absolutePath','journeyVersions','segment','\x0aPull\x20summary\x20for\x20\x27','cwd','Write\x20','4235cwcTAZ','type','\x20activations','\x20=\x20','Site:\x20','files','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file','counts','data','3494835agNwrL','7914HPzMaA','error','\x27...','name','yellow','length','Error:\x20','hasChanges','10584920HpiwJB','\x20unchanged\x20files','1619961wAsrZq','\x20\x20🗺️\x20\x20','journeys','repeat','parentName','Parent\x20segment:\x20','filter','7120828uAiSpw','targetDir','activations','dim','parentSegment','helpText','setPhase','\x20\x20Target:\x20','✔\x20Pulled\x20','description','verbose'];a40_0x396e=function(){return _0x54afbf;};return a40_0x396e();}export class SegmentPullCommand extends BaseCommand{[a40_0x5ce9ed(0xd3)]=a40_0x5ce9ed(0xbe);[a40_0x5ce9ed(0xea)]=a40_0x5ce9ed(0xb1);async[a40_0x5ce9ed(0xae)](_0x68ebad){const _0x52810a=a40_0x5ce9ed,{options:_0x321709,args:_0x1268ad,tdx:_0xf0ff64}=_0x68ebad,_0x121e1e=_0x321709,_0x511c3a=await resolveTarget({'arg':_0x1268ad[0x0],'contextParent':_0x321709[_0x52810a(0xe5)],'cwd':process[_0x52810a(0xc4)]()});if(!isSuccessfulResolution(_0x511c3a))return _0x511c3a[_0x52810a(0xb0)]==='no_parent'?(console[_0x52810a(0xd1)](a40_0x75a1c[_0x52810a(0xd4)](_0x52810a(0xbd))),console['error']('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)'),console['error']('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent'),console[_0x52810a(0xd1)](_0x52810a(0xcc))):(console[_0x52810a(0xd1)](a40_0x75a1c[_0x52810a(0xf3)](_0x52810a(0xd6)+_0x511c3a['message']+'\x0a')),_0x511c3a[_0x52810a(0xe6)]&&console[_0x52810a(0xd1)](a40_0x75a1c[_0x52810a(0xb6)](_0x511c3a[_0x52810a(0xe6)]))),0x1;const _0x31d79d=_0x511c3a[_0x52810a(0xde)],_0x4db5a8=_0x511c3a[_0x52810a(0xe2)],_0x22cea8=_0x511c3a[_0x52810a(0xc7)]===_0x52810a(0xad)?_0x511c3a[_0x52810a(0xaa)]:undefined;_0x121e1e[_0x52810a(0xeb)]&&(console['error'](_0x52810a(0xca)+_0x121e1e['site']),console[_0x52810a(0xd1)](_0x52810a(0xdf)+_0x31d79d),_0x22cea8&&console[_0x52810a(0xd1)](_0x52810a(0xb3)+_0x22cea8));const _0xc7b4e3=await withProgressSpinner(_0x52810a(0xb5)+_0x31d79d+_0x52810a(0xd2),_0x9482b8=>_0xf0ff64[_0x52810a(0xc2)][_0x52810a(0xb2)](_0x31d79d,{'targetDir':_0x4db5a8,'targetResourceName':_0x22cea8,'verbose':_0x121e1e[_0x52810a(0xeb)],'progress':{'update':_0xfddea9=>{const _0x384a93=_0x52810a;_0x9482b8[_0x384a93(0xe7)](_0xfddea9),_0x121e1e[_0x384a93(0xeb)]&&console['error']('\x20\x20'+_0xfddea9);}}}),{'verbose':_0x121e1e[_0x52810a(0xeb)]}),_0x51a293=_0xc7b4e3[_0x52810a(0xce)];if(_0x51a293[_0x52810a(0xcd)][_0x52810a(0xac)]===0x0&&_0x51a293[_0x52810a(0xcd)][_0x52810a(0xdc)]===0x0)return console[_0x52810a(0xd1)](a40_0x75a1c[_0x52810a(0xd4)]('No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27'+_0x51a293['parentName']+'\x27')),0x0;const _0xb1b4b=_0x51a293[_0x52810a(0xcb)][_0x52810a(0xe0)](_0x347093=>_0x347093['isNew']),_0x54ada5=_0x51a293[_0x52810a(0xcb)][_0x52810a(0xe0)](_0x1381c1=>!_0x1381c1[_0x52810a(0xed)]&&_0x1381c1['hasChanges']),_0x1cc767=_0x51a293[_0x52810a(0xcb)]['filter'](_0x39fe9a=>!_0x39fe9a['isNew']&&!_0x39fe9a[_0x52810a(0xd7)]);console[_0x52810a(0xd1)](_0x52810a(0xc3)+_0x51a293[_0x52810a(0xde)]+'\x27:'),console[_0x52810a(0xd1)](_0x52810a(0xbc)+a40_0x75a1c[_0x52810a(0xb6)](_0x51a293['counts'][_0x52810a(0xac)]+'\x20segments')+'\x20with\x20'+a40_0x75a1c[_0x52810a(0xb6)](_0x51a293['counts'][_0x52810a(0xe3)]+_0x52810a(0xc8)));if(_0x51a293[_0x52810a(0xcd)][_0x52810a(0xdc)]>0x0){const _0x2dc83a=_0x51a293[_0x52810a(0xcd)]['journeyVersions']>_0x51a293[_0x52810a(0xcd)][_0x52810a(0xdc)]?'\x20('+_0x51a293[_0x52810a(0xcd)][_0x52810a(0xc1)]+'\x20versions)':'';console[_0x52810a(0xd1)](_0x52810a(0xdb)+a40_0x75a1c['cyan'](_0x51a293[_0x52810a(0xcd)]['journeys']+'\x20journeys')+a40_0x75a1c[_0x52810a(0xe4)](_0x2dc83a));}console[_0x52810a(0xd1)]('\x20\x20'+a40_0x75a1c[_0x52810a(0xaf)]('+\x20'+_0xb1b4b['length']+'\x20new\x20files')),console[_0x52810a(0xd1)]('\x20\x20'+a40_0x75a1c[_0x52810a(0xd4)]('~\x20'+_0x54ada5[_0x52810a(0xd5)]+'\x20changed\x20files')),console[_0x52810a(0xd1)]('\x20\x20'+a40_0x75a1c[_0x52810a(0xe4)]('=\x20'+_0x1cc767['length']+_0x52810a(0xd9))),console[_0x52810a(0xd1)](_0x52810a(0xe8)+a40_0x75a1c['cyan'](_0x51a293[_0x52810a(0xe2)])+'\x0a');if(_0x54ada5['length']>0x0)for(const _0x2c3e59 of _0x54ada5){console['error']('\x0aChanges\x20to\x20\x27'+_0x2c3e59[_0x52810a(0xbf)]+'\x27:'),console['error']('─'[_0x52810a(0xdd)](0x3c)),console[_0x52810a(0xd1)](_0x2c3e59[_0x52810a(0xf0)]),console[_0x52810a(0xd1)]('─'[_0x52810a(0xdd)](0x3c));}if(_0x121e1e['dryRun'])return console[_0x52810a(0xd1)](a40_0x75a1c[_0x52810a(0xd4)]('\x0a[Dry\x20run]\x20No\x20files\x20were\x20written')),0x0;if(_0xb1b4b[_0x52810a(0xd5)]===0x0&&_0x54ada5[_0x52810a(0xd5)]===0x0)return console[_0x52810a(0xd1)](a40_0x75a1c[_0x52810a(0xaf)](_0x52810a(0xb7))),saveSessionContext({'parent_segment':_0x51a293['parentName']},_0x121e1e[_0x52810a(0xf2)]),console['error'](a40_0x75a1c[_0x52810a(0xaf)](_0x52810a(0xee)+a40_0x75a1c[_0x52810a(0xe4)](_0x52810a(0xb8))+_0x52810a(0xc9)+a40_0x75a1c[_0x52810a(0xb6)](_0x51a293[_0x52810a(0xde)]))),0x0;if(!_0x121e1e['yes']){if(!isInteractive())return console[_0x52810a(0xd1)](a40_0x75a1c[_0x52810a(0xf3)](_0x52810a(0xba)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x52810a(0xd1)](a40_0x75a1c[_0x52810a(0xe4)](_0x52810a(0xf1))),0x1;const _0x175b08=await confirmKey(_0x52810a(0xc5)+(_0xb1b4b[_0x52810a(0xd5)]+_0x54ada5['length'])+_0x52810a(0xb4));if(!_0x175b08)return console[_0x52810a(0xd1)](a40_0x75a1c[_0x52810a(0xd4)]('Aborted.'),_0x52810a(0xef)),0x1;}for(const _0x2ea031 of _0x51a293[_0x52810a(0xcb)]){if(_0x2ea031[_0x52810a(0xed)]||_0x2ea031['hasChanges']){const _0x3aa610=a40_0x4c0cd0['dirname'](_0x2ea031[_0x52810a(0xc0)]);!existsSync(_0x3aa610)&&mkdirSync(_0x3aa610,{'recursive':!![]}),writeFileSync(_0x2ea031[_0x52810a(0xc0)],_0x2ea031['content'],'utf-8');}}return console['error'](a40_0x75a1c[_0x52810a(0xaf)](_0x52810a(0xe9)+(_0xb1b4b[_0x52810a(0xd5)]+_0x54ada5['length'])+_0x52810a(0xab)+_0x51a293[_0x52810a(0xe2)])),saveSessionContext({'parent_segment':_0x51a293['parentName']},_0x121e1e[_0x52810a(0xf2)]),console[_0x52810a(0xd1)](a40_0x75a1c['green'](_0x52810a(0xee)+a40_0x75a1c[_0x52810a(0xe4)](_0x52810a(0xb8))+_0x52810a(0xc9)+a40_0x75a1c[_0x52810a(0xb6)](_0x51a293[_0x52810a(0xde)]))),0x0;}}
@@ -1 +1 @@
1
- const a41_0x2113d0=a41_0x1bb7;(function(_0x2227ac,_0x161aef){const _0xda5a38=a41_0x1bb7,_0x136377=_0x2227ac();while(!![]){try{const _0x518df9=-parseInt(_0xda5a38(0x210))/0x1+parseInt(_0xda5a38(0x1a3))/0x2+-parseInt(_0xda5a38(0x1c2))/0x3+-parseInt(_0xda5a38(0x1f0))/0x4+parseInt(_0xda5a38(0x230))/0x5+parseInt(_0xda5a38(0x202))/0x6+parseInt(_0xda5a38(0x1ba))/0x7*(parseInt(_0xda5a38(0x22b))/0x8);if(_0x518df9===_0x161aef)break;else _0x136377['push'](_0x136377['shift']());}catch(_0x2d65ca){_0x136377['push'](_0x136377['shift']());}}}(a41_0x55c1,0x87d6a));import{BaseCommand}from'./command.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{generateDiff,formatDiffWithColors}from'../utils/diff.js';function a41_0x1bb7(_0x3b7cc1,_0x5a83ec){_0x3b7cc1=_0x3b7cc1-0x19c;const _0x55c1e6=a41_0x55c1();let _0x1bb742=_0x55c1e6[_0x3b7cc1];return _0x1bb742;}import{confirmKey,isInteractive}from'../utils/prompt.js';function a41_0x55c1(){const _0x601eb5=['\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20','repeat','yamlConfig','green','\x20\x20Journeys:\x20','Site:\x20','.yaml','createdSegmentIds','diff','helpText','journeysOnly','results','description','state','/e/','verbose','\x0aError:','\x20updated','parentSegment','\x20\x20Activations:\x20','name','connection','existingSegment','2707368uEviNT','buildUserMaps','✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','segmentFolderId','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','Error:\x20','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','parentFolder','targetDir','getOutputSchemaWithCache','user','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','yellow','journeyBundleName','Parent\x20segment:\x20','blue','\x20YAML\x20files\x20found','journeys','41958hGzIpx','\x20\x20Activations:','/sb/da/esr','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','getJourney','segments','errorCode','\x20\x20📊\x20Segments:','add','new','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','scopedFolderPath','\x20new','732371TJhmwY','updated','folderPath','listFolders','folders','Delete\x20segment:','relationships','endsWith','Scoped\x20to\x20folder:\x20','activations','changed','yes','length','Preparing\x20journeys...','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','isScoped','Fetching\x20connections\x20for\x20name\x20resolution...','Resolving\x20parent\x20segment\x20\x27','\x20deleted','journey','set','attributes','\x20created','folderId','dim','toString','journeyId','8rZVKXc','site','listSegments','data','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','1307505HlpQJi','Push\x20','cwd','no_parent','push','\x20\x20🗺️\x20\x20Journeys:','(Journey\x20will\x20be\x20deleted)','execute','map','\x20to\x20delete','nameToType','dryRun','\x20unchanged','Error\x20parsing\x20YAML:\x20','627728vGsWGt','\x20activations]','get','\x20changed','Delete\x20journey:','/app/ps/','file','Error:\x20Directory\x20not\x20found:\x20','Source\x20directory:\x20','segment','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','delete','resolveParentId','error','unchanged','then','created','✔\x20All\x20journeys\x20are\x20up\x20to\x20date','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','parentName','No\x20','toUpdate','idToName','17100377ugOvxQ','all','isNew','📁\x20','\x20\x20Segments:\x20','/j/da/je','createdAt','\x20to\x20update','3178986oLoDJw','listActivations','versionNumber','.yml','\x20\x20\x20\x20','nameToId','filter','toDelete','cyan','\x0aValidation\x20failed:','type','journeyBundleId','existingJourney','red','New\x20segment:','\x20\x20Source:\x20','toCreate','Changes\x20to:','\x0aPush\x20summary\x20for\x20\x27','setPhase','join','message','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)'];a41_0x55c1=function(){return _0x601eb5;};return a41_0x55c1();}import{batchAsync}from'../utils/async.js';import{segmentToYamlString,segmentWithActivationsToYaml}from'../sdk/segment/child-segment-yaml.js';import a41_0x3c0870 from'chalk';import{existsSync}from'fs';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{resolveTarget,isSuccessfulResolution,getScopedDetails}from'../sdk/segment/target-resolution.js';import{buildFolderMaps}from'../sdk/segment/resolution-context.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{resolveTDFolderPath,findSegmentsToDelete,findJourneysToDelete,buildSegmentLookupMap,buildSegmentNameToIdMap,buildJourneyBundleLookupMap,parseAndClassifyYamlFiles,validateParsedFiles,formatValidationErrors,extractRootFolderId,buildConnectionMaps,calculatePushStats,prepareSegmentFiles,prepareJourneyFiles,executePushSegments,executePushFolders,executePushSegmentDeletions,executePushJourneys}from'../sdk/segment/push-workflow.js';export class SegmentPushCommand extends BaseCommand{[a41_0x2113d0(0x1ed)]='segment:push';['description']=a41_0x2113d0(0x206);async[a41_0x2113d0(0x19c)](_0x2b4381){const _0x2fdcdd=a41_0x2113d0,{options:_0x3e303f,args:_0x3eee6c,tdx:_0xde47f9}=_0x2b4381,_0x4568ee=_0x3e303f,_0xe26f9c=await resolveTarget({'arg':_0x3eee6c[0x0],'contextParent':_0x3e303f[_0x2fdcdd(0x1eb)],'cwd':process[_0x2fdcdd(0x232)]()});if(!isSuccessfulResolution(_0xe26f9c))return _0xe26f9c[_0x2fdcdd(0x209)]===_0x2fdcdd(0x233)?(console[_0x2fdcdd(0x1b0)](a41_0x3c0870[_0x2fdcdd(0x1fc)]('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console[_0x2fdcdd(0x1b0)](_0x2fdcdd(0x1d8)),console[_0x2fdcdd(0x1b0)](_0x2fdcdd(0x205)),console[_0x2fdcdd(0x1b0)]('\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[_0x2fdcdd(0x1b0)](a41_0x3c0870[_0x2fdcdd(0x1cf)](_0x2fdcdd(0x1f5)+_0xe26f9c[_0x2fdcdd(0x1d7)]+'\x0a')),_0xe26f9c[_0x2fdcdd(0x1e2)]&&console['error'](a41_0x3c0870[_0x2fdcdd(0x1ca)](_0xe26f9c[_0x2fdcdd(0x1e2)]))),0x1;if(_0xe26f9c['type']==='parent_name')return console[_0x2fdcdd(0x1b0)](a41_0x3c0870[_0x2fdcdd(0x1cf)](_0x2fdcdd(0x1aa)+_0xe26f9c[_0x2fdcdd(0x1f8)]+'\x0a')),console[_0x2fdcdd(0x1b0)](a41_0x3c0870[_0x2fdcdd(0x1ca)]('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;const _0x3e427d=_0xe26f9c[_0x2fdcdd(0x1b6)],_0x181a8c=_0xe26f9c[_0x2fdcdd(0x1f8)],_0x52a5bc=_0xe26f9c[_0x2fdcdd(0x1cc)]===_0x2fdcdd(0x1a9)?_0xe26f9c['filePath']:undefined,_0x52067b=getScopedDetails(_0xe26f9c),_0x36ab31=_0x52067b?.[_0x2fdcdd(0x21f)]??![],_0x4aabb7=_0x52067b?.[_0x2fdcdd(0x20e)]??'';if(!existsSync(_0x181a8c))return console[_0x2fdcdd(0x1b0)](a41_0x3c0870['red'](_0x2fdcdd(0x1aa)+_0x181a8c+'\x0a')),console[_0x2fdcdd(0x1b0)](a41_0x3c0870[_0x2fdcdd(0x1ca)](_0x2fdcdd(0x1f4))),0x1;_0x4568ee['verbose']&&(console[_0x2fdcdd(0x1b0)](_0x2fdcdd(0x1de)+_0x4568ee[_0x2fdcdd(0x22c)]),console['error'](_0x2fdcdd(0x1fe)+_0x3e427d),console[_0x2fdcdd(0x1b0)](_0x2fdcdd(0x1ab)+_0x181a8c),_0x36ab31&&console[_0x2fdcdd(0x1b0)](_0x2fdcdd(0x218)+_0x4aabb7));const _0x3eacfe=await withSpinner(_0x2fdcdd(0x221)+_0x3e427d+'\x27...',()=>_0xde47f9[_0x2fdcdd(0x1ac)][_0x2fdcdd(0x1af)](_0x3e427d),{'verbose':_0x4568ee['verbose']}),_0x2d0d43=_0x3eacfe[_0x2fdcdd(0x22e)],{parentSegmentResult:_0x257650,segmentsResult:_0x53019e,foldersResult:_0x349822,journeysWithDetailsResult:_0x26524,userMaps:_0x17085c}=await withSpinner('Fetching\x20existing\x20data...',async()=>{const _0x4dd7e2=_0x2fdcdd,[_0x55d698,_0x30484c,_0x420a1b,_0x136aae,_0x50ff8c]=await Promise[_0x4dd7e2(0x1bb)]([_0xde47f9[_0x4dd7e2(0x1ac)]['getParent'](_0x2d0d43),_0xde47f9['segment'][_0x4dd7e2(0x22d)](_0x2d0d43),_0xde47f9[_0x4dd7e2(0x1ac)][_0x4dd7e2(0x213)](_0x2d0d43),_0xde47f9[_0x4dd7e2(0x223)]['listJourneysWithDetailsFromParentSegment'](_0x2d0d43,{'includeAllVersions':!![]}),_0xde47f9[_0x4dd7e2(0x1fa)][_0x4dd7e2(0x1f1)]()]);return{'parentSegmentResult':_0x55d698,'segmentsResult':_0x30484c,'foldersResult':_0x420a1b,'journeysWithDetailsResult':_0x136aae,'userMaps':_0x50ff8c};},{'verbose':_0x4568ee['verbose']})[_0x2fdcdd(0x1b2)](_0x3e222f=>_0x3e222f[_0x2fdcdd(0x22e)]),_0x4c0350=_0x257650,_0x5aa42b=extractRootFolderId(_0x4c0350),_0x3d0f9b=_0x53019e,_0x41a058=_0x349822,{journeys:_0x2b036f,activationStepsById:_0x43ce93}=_0x26524,_0x4b9cb4=new Map(_0x2b036f[_0x2fdcdd(0x19d)](_0x165abc=>[_0x165abc['id'],_0x165abc])),_0x425332=_0x2b036f['map'](_0x3c1f47=>({'id':_0x3c1f47['id'],'name':_0x3c1f47['attributes']['name'],'journeyBundleName':_0x3c1f47[_0x2fdcdd(0x225)]['journeyBundleName']||'','journeyBundleId':_0x3c1f47['attributes'][_0x2fdcdd(0x1cd)]||'','versionNumber':_0x3c1f47[_0x2fdcdd(0x225)][_0x2fdcdd(0x1c4)],'description':_0x3c1f47[_0x2fdcdd(0x225)][_0x2fdcdd(0x1e5)],'state':_0x3c1f47['attributes'][_0x2fdcdd(0x1e6)],'paused':_0x3c1f47['attributes']['paused'],'audienceId':_0x3c1f47[_0x2fdcdd(0x225)]['audienceId'],'folderId':_0x3c1f47[_0x2fdcdd(0x216)]?.[_0x2fdcdd(0x1f7)]?.['data']?.['id'],'createdAt':_0x3c1f47['attributes'][_0x2fdcdd(0x1c0)],'updatedAt':_0x3c1f47[_0x2fdcdd(0x225)]['updatedAt']})),{emailToId:_0x227d47,idToEmail:_0x30578d}=_0x17085c,_0xc669c2=await withSpinner(_0x2fdcdd(0x220),async()=>{const _0x39f3fb=_0x2fdcdd,_0x4c240d=await _0xde47f9[_0x39f3fb(0x1ee)]['list']();return buildConnectionMaps(_0x4c240d);},{'verbose':_0x4568ee[_0x2fdcdd(0x1e8)]})[_0x2fdcdd(0x1b2)](_0x39fb5e=>_0x39fb5e[_0x2fdcdd(0x22e)]),_0x35d378=_0xc669c2[_0x2fdcdd(0x1c7)],_0x2a32b4=_0xc669c2[_0x2fdcdd(0x1b9)],_0x2d141b=_0xc669c2[_0x2fdcdd(0x19f)],_0x463033={'emailToIdMap':_0x227d47,'connectionNameToIdMap':_0x35d378,'connectionNameToTypeMap':_0x2d141b,'getSchema':_0x2398d9=>_0xde47f9['connection'][_0x2fdcdd(0x1f9)](_0x2398d9)};let {pathToId:_0x100ada,idToPath:_0x1a277}=buildFolderMaps(_0x41a058);const _0x3d340c=buildSegmentLookupMap(_0x3d0f9b,_0x1a277),_0x536a8d=buildSegmentNameToIdMap(_0x3d0f9b),_0xa895b0=buildJourneyBundleLookupMap(_0x425332,_0x1a277);let _0x31fa72;if(_0x52a5bc){if(!_0x52a5bc[_0x2fdcdd(0x217)](_0x2fdcdd(0x1c5))&&!_0x52a5bc[_0x2fdcdd(0x217)](_0x2fdcdd(0x1df)))return console[_0x2fdcdd(0x1b0)](a41_0x3c0870[_0x2fdcdd(0x1cf)](_0x2fdcdd(0x21e)+_0x52a5bc+'\x0a')),0x1;_0x31fa72=[_0x52a5bc];}else _0x31fa72=findYamlFiles(_0x181a8c);if(_0x31fa72[_0x2fdcdd(0x21c)]===0x0)return console[_0x2fdcdd(0x1b0)](a41_0x3c0870[_0x2fdcdd(0x1cf)]('Error:\x20No\x20YAML\x20files\x20found\x20in\x20'+_0x181a8c+'\x0a')),console['error'](a41_0x3c0870[_0x2fdcdd(0x1ca)](_0x2fdcdd(0x22f))),0x1;let _0x565687,_0x2866bb;try{const _0x5a7256=parseAndClassifyYamlFiles(_0x31fa72,_0x181a8c,{'skipSegments':_0x4568ee[_0x2fdcdd(0x1e3)]});_0x565687=_0x5a7256[_0x2fdcdd(0x208)],_0x2866bb=_0x5a7256[_0x2fdcdd(0x201)];const _0x1f9d3e=validateParsedFiles(_0x5a7256,_0x181a8c);if(_0x1f9d3e[_0x2fdcdd(0x21c)]>0x0)return console[_0x2fdcdd(0x1b0)](a41_0x3c0870[_0x2fdcdd(0x1cf)](_0x2fdcdd(0x1cb))),console[_0x2fdcdd(0x1b0)](formatValidationErrors(_0x1f9d3e)),console[_0x2fdcdd(0x1b0)](a41_0x3c0870[_0x2fdcdd(0x1fc)](_0x2fdcdd(0x20d))),0x1;}catch(_0x548873){return console['error'](a41_0x3c0870['red'](_0x2fdcdd(0x1a2)+(_0x548873 instanceof Error?_0x548873[_0x2fdcdd(0x1d7)]:_0x548873))),0x1;}if(_0x565687[_0x2fdcdd(0x21c)]===0x0&&_0x2866bb[_0x2fdcdd(0x21c)]===0x0){const _0x2d342b=_0x4568ee[_0x2fdcdd(0x1e3)]?_0x2fdcdd(0x223):'segment\x20or\x20journey';return console[_0x2fdcdd(0x1b0)](a41_0x3c0870[_0x2fdcdd(0x1fc)](_0x2fdcdd(0x1b7)+_0x2d342b+_0x2fdcdd(0x200))),0x0;}const _0xbe184f=new Map();_0x3d0f9b['length']>0x0&&!_0x4568ee[_0x2fdcdd(0x1e3)]&&await withSpinner('Fetching\x20existing\x20activations...',async()=>{await batchAsync(_0x3d0f9b,async _0x194dc5=>{const _0x4411d6=a41_0x1bb7,_0x5a8eda=await _0xde47f9[_0x4411d6(0x1ac)][_0x4411d6(0x1c3)](_0x2d0d43,_0x194dc5['id']);_0xbe184f[_0x4411d6(0x224)](_0x194dc5['id'],_0x5a8eda);});},{'verbose':_0x4568ee[_0x2fdcdd(0x1e8)]});const {segmentFiles:_0x1f0b0a,foldersToCreate:_0x22ef8a}=await prepareSegmentFiles(_0x565687,{'segmentByFolderAndName':_0x3d340c,'activationsBySegmentId':_0xbe184f,'folderPathToId':_0x100ada,'idToEmailMap':_0x30578d,'connectionIdToNameMap':_0x2a32b4},_0x463033,_0x36ab31,_0x4aabb7),_0x545edc=_0x52a5bc?[]:findSegmentsToDelete(_0x3d0f9b,_0x565687[_0x2fdcdd(0x19d)](({yamlConfig:_0x305035,folderPath:_0x6f6c0})=>({'yamlConfig':_0x305035,'folderPath':resolveTDFolderPath(_0x6f6c0,_0x36ab31,_0x4aabb7)})),_0x1a277,_0x4aabb7,_0x36ab31),{journeyFiles:_0x496128,foldersToCreate:_0x29f890}=await withProgressSpinner(_0x2fdcdd(0x21d),async _0x2ebcff=>prepareJourneyFiles(_0x2866bb,{'fetchJourney':async _0x44684d=>_0xde47f9[_0x2fdcdd(0x223)][_0x2fdcdd(0x207)](_0x44684d[_0x2fdcdd(0x22a)]),'journeyBundlesByFolderAndName':_0xa895b0,'folderPathToId':_0x100ada,'idToEmailMap':_0x30578d,'connectionIdToNameMap':_0x2a32b4,'existingSegments':_0x3d0f9b,'parentId':_0x2d0d43,'deps':_0xde47f9,'progress':{'update':_0x1e9eb9=>{const _0x271f59=_0x2fdcdd;_0x2ebcff[_0x271f59(0x1d5)](_0x1e9eb9),_0x4568ee['verbose']&&console[_0x271f59(0x1b0)]('\x20\x20'+_0x1e9eb9);}},'journeyById':_0x4b9cb4,'activationStepsById':_0x43ce93},_0x36ab31,_0x4aabb7),{'verbose':_0x4568ee[_0x2fdcdd(0x1e8)]})[_0x2fdcdd(0x1b2)](_0x890e62=>_0x890e62[_0x2fdcdd(0x22e)]);for(const _0x456961 of _0x29f890){_0x22ef8a[_0x2fdcdd(0x20b)](_0x456961);}const _0x52fb48=_0x52a5bc?[]:findJourneysToDelete(_0x425332,_0x2866bb[_0x2fdcdd(0x19d)](({yamlConfig:_0x193b03,folderPath:_0xfe90ef})=>({'yamlConfig':_0x193b03,'folderPath':resolveTDFolderPath(_0xfe90ef,_0x36ab31,_0x4aabb7)})),_0x1a277,_0x4aabb7,_0x36ab31),_0xb6ada9=calculatePushStats(_0x1f0b0a,_0x496128,_0x22ef8a,_0x545edc,_0x52fb48,!!_0x4568ee['delete'],!!_0x4568ee[_0x2fdcdd(0x1e3)]),_0x2af78b=_0xb6ada9[_0x2fdcdd(0x208)][_0x2fdcdd(0x20c)],_0x270719=_0xb6ada9[_0x2fdcdd(0x208)][_0x2fdcdd(0x21a)],_0x1d5d2e=_0xb6ada9[_0x2fdcdd(0x208)][_0x2fdcdd(0x1b1)],_0x3b71af=_0xb6ada9['segments'][_0x2fdcdd(0x1c9)],_0x27bed1=_0xb6ada9[_0x2fdcdd(0x214)]['toCreate'],_0x2c02d5=_0xb6ada9[_0x2fdcdd(0x201)][_0x2fdcdd(0x20c)],_0x3f9ec6=_0xb6ada9[_0x2fdcdd(0x201)][_0x2fdcdd(0x21a)],_0x143a16=_0xb6ada9[_0x2fdcdd(0x201)][_0x2fdcdd(0x1b1)],_0x159e05=_0xb6ada9[_0x2fdcdd(0x201)][_0x2fdcdd(0x1c9)],_0x2cdc3e=_0xb6ada9[_0x2fdcdd(0x219)][_0x2fdcdd(0x1bb)],_0x222f28=_0xb6ada9['activations'][_0x2fdcdd(0x1d2)],_0x346675=_0xb6ada9[_0x2fdcdd(0x219)][_0x2fdcdd(0x1b8)],_0x4d24db=_0xb6ada9['activations'][_0x2fdcdd(0x1c9)];console[_0x2fdcdd(0x1b0)](_0x2fdcdd(0x1d4)+_0x3e427d+'\x27:');_0x27bed1[_0x2fdcdd(0x21c)]>0x0&&console[_0x2fdcdd(0x1b0)]('\x20\x20'+a41_0x3c0870['blue'](_0x2fdcdd(0x1bd)+_0x27bed1['length']+'\x20folders\x20to\x20create'));if(!_0x4568ee[_0x2fdcdd(0x1e3)]){console['error'](_0x2fdcdd(0x20a)),console['error'](_0x2fdcdd(0x1c6)+a41_0x3c0870[_0x2fdcdd(0x1dc)]('+\x20'+_0x2af78b[_0x2fdcdd(0x21c)]+_0x2fdcdd(0x20f))),console[_0x2fdcdd(0x1b0)](_0x2fdcdd(0x1c6)+a41_0x3c0870['yellow']('~\x20'+_0x270719[_0x2fdcdd(0x21c)]+_0x2fdcdd(0x1a6)));if(_0x3b71af[_0x2fdcdd(0x21c)]>0x0)console[_0x2fdcdd(0x1b0)](_0x2fdcdd(0x1c6)+a41_0x3c0870[_0x2fdcdd(0x1cf)]('-\x20'+_0x3b71af['length']+'\x20to\x20delete'));else _0x545edc[_0x2fdcdd(0x21c)]>0x0&&!_0x4568ee[_0x2fdcdd(0x1ae)]&&console[_0x2fdcdd(0x1b0)](_0x2fdcdd(0x1c6)+a41_0x3c0870[_0x2fdcdd(0x228)](_0x545edc['length']+_0x2fdcdd(0x1fb)));console['error'](_0x2fdcdd(0x1c6)+a41_0x3c0870['dim']('=\x20'+_0x1d5d2e[_0x2fdcdd(0x21c)]+_0x2fdcdd(0x1a1)));}if(_0x496128[_0x2fdcdd(0x21c)]>0x0||_0x52fb48[_0x2fdcdd(0x21c)]>0x0){console[_0x2fdcdd(0x1b0)](_0x2fdcdd(0x235)),console[_0x2fdcdd(0x1b0)]('\x20\x20\x20\x20'+a41_0x3c0870[_0x2fdcdd(0x1dc)]('+\x20'+_0x2c02d5['length']+_0x2fdcdd(0x20f))),console[_0x2fdcdd(0x1b0)]('\x20\x20\x20\x20'+a41_0x3c0870[_0x2fdcdd(0x1fc)]('~\x20'+_0x3f9ec6['length']+_0x2fdcdd(0x1a6)));if(_0x159e05[_0x2fdcdd(0x21c)]>0x0)console['error'](_0x2fdcdd(0x1c6)+a41_0x3c0870['red']('-\x20'+_0x159e05[_0x2fdcdd(0x21c)]+'\x20to\x20delete'));else _0x52fb48[_0x2fdcdd(0x21c)]>0x0&&!_0x4568ee['delete']&&console[_0x2fdcdd(0x1b0)](_0x2fdcdd(0x1c6)+a41_0x3c0870['dim'](_0x52fb48[_0x2fdcdd(0x21c)]+_0x2fdcdd(0x1fb)));console[_0x2fdcdd(0x1b0)]('\x20\x20\x20\x20'+a41_0x3c0870[_0x2fdcdd(0x228)]('=\x20'+_0x143a16[_0x2fdcdd(0x21c)]+_0x2fdcdd(0x1a1)));}_0x2cdc3e[_0x2fdcdd(0x21c)]>0x0&&!_0x4568ee[_0x2fdcdd(0x1e3)]&&(console[_0x2fdcdd(0x1b0)](''),console[_0x2fdcdd(0x1b0)](_0x2fdcdd(0x203)),_0x222f28[_0x2fdcdd(0x21c)]>0x0&&console['error']('\x20\x20\x20\x20'+a41_0x3c0870['green']('+\x20'+_0x222f28['length']+'\x20to\x20create')),_0x346675['length']>0x0&&console[_0x2fdcdd(0x1b0)](_0x2fdcdd(0x1c6)+a41_0x3c0870[_0x2fdcdd(0x1fc)]('~\x20'+_0x346675[_0x2fdcdd(0x21c)]+_0x2fdcdd(0x1c1))),_0x4d24db['length']>0x0&&console[_0x2fdcdd(0x1b0)](_0x2fdcdd(0x1c6)+a41_0x3c0870[_0x2fdcdd(0x1cf)]('-\x20'+_0x4d24db[_0x2fdcdd(0x21c)]+_0x2fdcdd(0x19e))));console[_0x2fdcdd(0x1b0)](_0x2fdcdd(0x1d1)+a41_0x3c0870[_0x2fdcdd(0x1ca)](_0x181a8c)+'\x0a');if(_0x27bed1[_0x2fdcdd(0x21c)]>0x0){console['error']('Folders\x20to\x20create:');for(const _0x2bc638 of _0x27bed1){console[_0x2fdcdd(0x1b0)]('\x20\x20'+a41_0x3c0870['blue']('+')+'\x20'+_0x2bc638);}console['error']('');}if(_0x2af78b['length']>0x0&&!_0x4568ee[_0x2fdcdd(0x1e3)])for(const _0x407b31 of _0x2af78b){const _0x546874=_0x407b31[_0x2fdcdd(0x212)]?_0x407b31[_0x2fdcdd(0x212)]+'/'+_0x407b31['yamlConfig'][_0x2fdcdd(0x1ed)]:_0x407b31[_0x2fdcdd(0x1db)]['name'],_0x23701e=_0x407b31[_0x2fdcdd(0x1db)]['activations']?.['length']||0x0,_0x3ee3aa=_0x23701e>0x0?a41_0x3c0870[_0x2fdcdd(0x228)]('\x20['+_0x23701e+_0x2fdcdd(0x1a4)):'';console[_0x2fdcdd(0x1b0)]('\x0a'+a41_0x3c0870[_0x2fdcdd(0x1dc)](_0x2fdcdd(0x1d0))+'\x20'+_0x546874+_0x3ee3aa),console[_0x2fdcdd(0x1b0)]('─'[_0x2fdcdd(0x1da)](0x3c)),_0x407b31[_0x2fdcdd(0x1e1)]&&console[_0x2fdcdd(0x1b0)](_0x407b31[_0x2fdcdd(0x1e1)]),console['error']('─'[_0x2fdcdd(0x1da)](0x3c));}if(_0x3b71af[_0x2fdcdd(0x21c)]>0x0&&!_0x4568ee['journeysOnly'])for(const _0x5a9480 of _0x3b71af){const _0x889eb1=_0x5a9480[_0x2fdcdd(0x1f3)]?_0x1a277['get'](_0x5a9480[_0x2fdcdd(0x1f3)][_0x2fdcdd(0x229)]())||'':'',_0x586e25=_0x889eb1?_0x889eb1+'/'+_0x5a9480[_0x2fdcdd(0x1ed)]:_0x5a9480[_0x2fdcdd(0x1ed)],_0x410a41=_0xbe184f[_0x2fdcdd(0x1a5)](_0x5a9480['id'])||[],_0x15c26e=_0x410a41[_0x2fdcdd(0x21c)]>0x0?a41_0x3c0870[_0x2fdcdd(0x228)]('\x20['+_0x410a41[_0x2fdcdd(0x21c)]+_0x2fdcdd(0x1a4)):'';console[_0x2fdcdd(0x1b0)]('\x0a'+a41_0x3c0870[_0x2fdcdd(0x1cf)](_0x2fdcdd(0x215))+'\x20'+_0x586e25+_0x15c26e),console[_0x2fdcdd(0x1b0)]('─'[_0x2fdcdd(0x1da)](0x3c));const _0x351f53=segmentWithActivationsToYaml(_0x5a9480,_0x410a41,undefined,_0x30578d,_0x2a32b4),_0xc63160=segmentToYamlString(_0x351f53),_0x50bcad=generateDiff(_0xc63160,'');console['error'](formatDiffWithColors(_0x50bcad)),console[_0x2fdcdd(0x1b0)]('─'[_0x2fdcdd(0x1da)](0x3c));}const _0xa600c5=_0x1f0b0a[_0x2fdcdd(0x1c8)](_0x50bcb9=>!_0x50bcb9[_0x2fdcdd(0x1bc)]&&_0x50bcb9[_0x2fdcdd(0x1e1)]);if(_0xa600c5['length']>0x0&&!_0x4568ee[_0x2fdcdd(0x1e3)])for(const _0x2588a7 of _0xa600c5){const _0x25d09=_0x2588a7[_0x2fdcdd(0x212)]?_0x2588a7[_0x2fdcdd(0x212)]+'/'+_0x2588a7['yamlConfig'][_0x2fdcdd(0x1ed)]:_0x2588a7[_0x2fdcdd(0x1db)][_0x2fdcdd(0x1ed)];console[_0x2fdcdd(0x1b0)]('\x0a'+a41_0x3c0870[_0x2fdcdd(0x1fc)](_0x2fdcdd(0x1d3))+'\x20'+_0x25d09),console[_0x2fdcdd(0x1b0)]('─'['repeat'](0x3c)),console['error'](_0x2588a7[_0x2fdcdd(0x1e1)]),console[_0x2fdcdd(0x1b0)]('─'['repeat'](0x3c));}if(_0x2c02d5[_0x2fdcdd(0x21c)]>0x0)for(const _0x9c816a of _0x2c02d5){const _0x4ba837=_0x9c816a['folderPath']?_0x9c816a[_0x2fdcdd(0x212)]+'/'+_0x9c816a[_0x2fdcdd(0x1db)]['name']:_0x9c816a[_0x2fdcdd(0x1db)][_0x2fdcdd(0x1ed)];console['error']('\x0a'+a41_0x3c0870[_0x2fdcdd(0x1dc)]('New\x20journey:')+'\x20'+_0x4ba837),console[_0x2fdcdd(0x1b0)]('─'['repeat'](0x3c)),_0x9c816a[_0x2fdcdd(0x1e1)]&&console['error'](_0x9c816a[_0x2fdcdd(0x1e1)]),console[_0x2fdcdd(0x1b0)]('─'[_0x2fdcdd(0x1da)](0x3c));}const _0x36890f=_0x496128[_0x2fdcdd(0x1c8)](_0x5e9686=>!_0x5e9686[_0x2fdcdd(0x1bc)]&&_0x5e9686['diff']);if(_0x36890f[_0x2fdcdd(0x21c)]>0x0)for(const _0x3abb1a of _0x36890f){const _0x193b06=_0x3abb1a[_0x2fdcdd(0x212)]?_0x3abb1a[_0x2fdcdd(0x212)]+'/'+_0x3abb1a[_0x2fdcdd(0x1db)][_0x2fdcdd(0x1ed)]:_0x3abb1a[_0x2fdcdd(0x1db)][_0x2fdcdd(0x1ed)];console['error']('\x0a'+a41_0x3c0870[_0x2fdcdd(0x1fc)]('Changes\x20to\x20journey:')+'\x20'+_0x193b06),console[_0x2fdcdd(0x1b0)]('─'['repeat'](0x3c)),console[_0x2fdcdd(0x1b0)](_0x3abb1a['diff']),console[_0x2fdcdd(0x1b0)]('─'[_0x2fdcdd(0x1da)](0x3c));}if(_0x159e05[_0x2fdcdd(0x21c)]>0x0)for(const _0x3e4430 of _0x159e05){const _0x22c140=_0x3e4430[_0x2fdcdd(0x227)]?_0x1a277['get'](_0x3e4430['folderId'])||'':'',_0x4b6234=_0x22c140?_0x22c140+'/'+_0x3e4430['journeyBundleName']:_0x3e4430[_0x2fdcdd(0x1fd)];console[_0x2fdcdd(0x1b0)]('\x0a'+a41_0x3c0870[_0x2fdcdd(0x1cf)](_0x2fdcdd(0x1a7))+'\x20'+_0x4b6234),console[_0x2fdcdd(0x1b0)]('─'['repeat'](0x3c)),console[_0x2fdcdd(0x1b0)](a41_0x3c0870[_0x2fdcdd(0x1cf)](_0x2fdcdd(0x236))),console[_0x2fdcdd(0x1b0)]('─'[_0x2fdcdd(0x1da)](0x3c));}if(_0x4568ee[_0x2fdcdd(0x1a0)])return console[_0x2fdcdd(0x1b0)](a41_0x3c0870['yellow'](_0x2fdcdd(0x1b5))),0x0;const _0xc911d1=_0x4568ee[_0x2fdcdd(0x1e3)]?![]:_0x2af78b['length']>0x0||_0x270719[_0x2fdcdd(0x21c)]>0x0||_0x3b71af[_0x2fdcdd(0x21c)]>0x0,_0x2635bd=_0x2c02d5[_0x2fdcdd(0x21c)]>0x0||_0x3f9ec6['length']>0x0||_0x159e05[_0x2fdcdd(0x21c)]>0x0,_0x4e3f0e=_0x4568ee[_0x2fdcdd(0x1e3)]?![]:_0x2cdc3e[_0x2fdcdd(0x21c)]>0x0,_0x5751c5=_0x27bed1['length']>0x0;if(!_0xc911d1&&!_0x2635bd&&!_0x4e3f0e&&!_0x5751c5){const _0x4d889b=_0x4568ee[_0x2fdcdd(0x1e3)]?_0x2fdcdd(0x1b4):_0x2fdcdd(0x1f2);console['error'](a41_0x3c0870[_0x2fdcdd(0x1dc)](_0x4d889b));if(_0x52a5bc&&_0x1d5d2e[_0x2fdcdd(0x21c)]===0x1){const _0x1dffd3=_0x1d5d2e[0x0];if(_0x1dffd3[_0x2fdcdd(0x1ef)]?.['id']){const _0x56e6a6=getConsoleNextUrl(_0x4568ee['site'],_0x2fdcdd(0x1a8)+_0x2d0d43+_0x2fdcdd(0x1e7)+_0x1dffd3[_0x2fdcdd(0x1ef)]['id']+_0x2fdcdd(0x204));console[_0x2fdcdd(0x1b0)](_0x2fdcdd(0x1d9)+a41_0x3c0870[_0x2fdcdd(0x1ca)](_0x56e6a6));}}if(_0x52a5bc&&_0x143a16[_0x2fdcdd(0x21c)]===0x1){const _0x2b9638=_0x143a16[0x0];if(_0x2b9638['existingJourney']?.['id']){const _0x19d28f=getConsoleNextUrl(_0x4568ee[_0x2fdcdd(0x22c)],'/app/ps/'+_0x2d0d43+_0x2fdcdd(0x1e7)+_0x2b9638[_0x2fdcdd(0x1ce)]['id']+_0x2fdcdd(0x1bf));console['error']('\x20\x20'+a41_0x3c0870[_0x2fdcdd(0x1ca)](_0x19d28f));}}return 0x0;}const _0x40a379=_0x4568ee[_0x2fdcdd(0x1e3)]?_0x2c02d5[_0x2fdcdd(0x21c)]+_0x3f9ec6[_0x2fdcdd(0x21c)]+_0x159e05[_0x2fdcdd(0x21c)]+_0x27bed1['length']:_0x2af78b[_0x2fdcdd(0x21c)]+_0x270719[_0x2fdcdd(0x21c)]+_0x3b71af[_0x2fdcdd(0x21c)]+_0x2c02d5[_0x2fdcdd(0x21c)]+_0x3f9ec6[_0x2fdcdd(0x21c)]+_0x159e05[_0x2fdcdd(0x21c)]+_0x27bed1[_0x2fdcdd(0x21c)]+_0x2cdc3e[_0x2fdcdd(0x21c)];if(!_0x4568ee[_0x2fdcdd(0x21b)]&&_0x40a379>0x0){if(!isInteractive())return console['error'](a41_0x3c0870[_0x2fdcdd(0x1cf)](_0x2fdcdd(0x1e9)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x2fdcdd(0x1b0)](a41_0x3c0870[_0x2fdcdd(0x228)](_0x2fdcdd(0x1ad))),0x1;const _0x589e75=await confirmKey(_0x2fdcdd(0x231)+_0x40a379+'\x20changes?');if(!_0x589e75)return console[_0x2fdcdd(0x1b0)](a41_0x3c0870[_0x2fdcdd(0x1fc)]('Aborted.')),0x1;}const _0x577ed0={'withProgress':async(_0x10ed57,_0x5c0b3b)=>{const _0x59a509=_0x2fdcdd,_0x4dec17=await withSpinner(_0x10ed57,_0x5c0b3b,{'verbose':_0x4568ee['verbose']});return{'data':_0x4dec17[_0x59a509(0x22e)]};},'logInfo':_0x5ceeb8=>console[_0x2fdcdd(0x1b0)](a41_0x3c0870[_0x2fdcdd(0x1ff)]('✔\x20'+_0x5ceeb8)),'logSuccess':_0x6a7030=>console[_0x2fdcdd(0x1b0)](a41_0x3c0870[_0x2fdcdd(0x1dc)]('✔\x20'+_0x6a7030)),'logWarning':_0x359244=>console['error'](a41_0x3c0870[_0x2fdcdd(0x1fc)]('⚠\x20'+_0x359244)),'logDeleted':_0x2c8aa1=>console[_0x2fdcdd(0x1b0)](a41_0x3c0870[_0x2fdcdd(0x1cf)]('✔\x20'+_0x2c8aa1))},_0x56eaa3={'segment':_0xde47f9[_0x2fdcdd(0x1ac)],'journey':_0xde47f9[_0x2fdcdd(0x223)],'user':_0xde47f9[_0x2fdcdd(0x1fa)],'connection':_0xde47f9[_0x2fdcdd(0x1ee)]};_0x27bed1[_0x2fdcdd(0x21c)]>0x0&&(_0x100ada=await executePushFolders(_0x56eaa3,_0x27bed1,_0x100ada,{'parentId':_0x2d0d43},_0x577ed0));const _0x28f8b3={'rootFolderId':_0x5aa42b,'folderPathToId':_0x100ada,'folderIdToPath':_0x1a277,'segmentNameToId':_0x536a8d,'activationsBySegmentId':_0xbe184f,'emailToIdMap':_0x227d47,'idToEmailMap':_0x30578d,'connectionNameToIdMap':_0xc669c2[_0x2fdcdd(0x1c7)],'connectionIdToNameMap':_0xc669c2[_0x2fdcdd(0x1b9)],'connectionNameToTypeMap':_0x2d141b},_0x46924d=await executePushSegments(_0x56eaa3,_0x4568ee[_0x2fdcdd(0x1e3)]?[]:_0x1f0b0a,_0x28f8b3,{'parentId':_0x2d0d43},_0x577ed0),_0x482fbb=_0x46924d['created'],_0x5ab9e6=_0x46924d[_0x2fdcdd(0x211)],_0x408032=_0x46924d[_0x2fdcdd(0x219)][_0x2fdcdd(0x1b3)],_0x383a58=_0x46924d['activations'][_0x2fdcdd(0x211)],_0x5e5ed3=_0x46924d['activations']['deleted'];let _0x2f7d99;if(_0x52a5bc&&_0x1f0b0a[_0x2fdcdd(0x21c)]===0x1){const _0x2a19c5=_0x1f0b0a[0x0];_0x2f7d99=_0x2a19c5[_0x2fdcdd(0x1ef)]?.['id']??_0x46924d[_0x2fdcdd(0x1e0)][_0x2fdcdd(0x1a5)](_0x2a19c5[_0x2fdcdd(0x1db)][_0x2fdcdd(0x1ed)]);}const _0x1a3232=await executePushSegmentDeletions(_0x56eaa3,_0x4568ee['journeysOnly']?[]:_0x3b71af,_0x577ed0);let _0x49d08a=0x0,_0xc79b65=0x0,_0x8376a2=0x0;const _0x48bf85=new Map(_0x536a8d);for(const [_0x25f11e,_0x2ce99c]of _0x46924d['createdSegmentIds']){_0x48bf85[_0x2fdcdd(0x224)](_0x25f11e,_0x2ce99c);}if(_0x496128[_0x2fdcdd(0x21c)]>0x0){const _0x57b1c9={..._0x28f8b3,'segmentNameToId':_0x48bf85,'existingSegments':_0x3d0f9b,'activationContext':_0x463033},_0x5b6ba1=await executePushJourneys(_0x56eaa3,_0x496128,_0x57b1c9,{'parentId':_0x2d0d43,'rootFolderId':_0x5aa42b,'verbose':_0x4568ee[_0x2fdcdd(0x1e8)]},_0x577ed0);_0x49d08a=_0x5b6ba1[_0x2fdcdd(0x1b3)],_0xc79b65=_0x5b6ba1[_0x2fdcdd(0x211)];if(_0x52a5bc&&_0x5b6ba1[_0x2fdcdd(0x1e4)][_0x2fdcdd(0x21c)]===0x1){const _0x45fccc=_0x5b6ba1[_0x2fdcdd(0x1e4)][0x0];if(_0x45fccc[_0x2fdcdd(0x22a)]){const _0x1304f0=getConsoleNextUrl(_0x4568ee[_0x2fdcdd(0x22c)],_0x2fdcdd(0x1a8)+_0x2d0d43+'/e/'+_0x45fccc[_0x2fdcdd(0x22a)]+_0x2fdcdd(0x1bf));console['error']('\x20\x20'+a41_0x3c0870[_0x2fdcdd(0x1ca)](_0x1304f0));}}}for(const _0x5820f5 of _0x159e05){console[_0x2fdcdd(0x1b0)](a41_0x3c0870[_0x2fdcdd(0x1fc)](_0x2fdcdd(0x1f6)+_0x5820f5[_0x2fdcdd(0x1fd)])),_0x8376a2++;}const _0x36b0b9=[];if(_0x482fbb>0x0)_0x36b0b9['push'](_0x482fbb+_0x2fdcdd(0x226));if(_0x5ab9e6>0x0)_0x36b0b9[_0x2fdcdd(0x234)](_0x5ab9e6+_0x2fdcdd(0x1ea));if(_0x1a3232>0x0)_0x36b0b9[_0x2fdcdd(0x234)](_0x1a3232+_0x2fdcdd(0x222));const _0x3ec167=[];if(_0x49d08a>0x0)_0x3ec167[_0x2fdcdd(0x234)](_0x49d08a+_0x2fdcdd(0x226));if(_0xc79b65>0x0)_0x3ec167['push'](_0xc79b65+_0x2fdcdd(0x1ea));if(_0x8376a2>0x0)_0x3ec167['push'](_0x8376a2+_0x2fdcdd(0x222));const _0x13eee8=[];if(_0x408032>0x0)_0x13eee8[_0x2fdcdd(0x234)](_0x408032+_0x2fdcdd(0x226));if(_0x383a58>0x0)_0x13eee8['push'](_0x383a58+_0x2fdcdd(0x1ea));if(_0x5e5ed3>0x0)_0x13eee8[_0x2fdcdd(0x234)](_0x5e5ed3+_0x2fdcdd(0x222));console['error'](a41_0x3c0870[_0x2fdcdd(0x1dc)]('\x0a✔\x20Push\x20complete'));_0x36b0b9[_0x2fdcdd(0x21c)]>0x0&&!_0x4568ee[_0x2fdcdd(0x1e3)]&&console['error'](_0x2fdcdd(0x1be)+_0x36b0b9[_0x2fdcdd(0x1d6)](',\x20'));_0x3ec167['length']>0x0&&console['error'](_0x2fdcdd(0x1dd)+_0x3ec167[_0x2fdcdd(0x1d6)](',\x20'));_0x13eee8[_0x2fdcdd(0x21c)]>0x0&&!_0x4568ee[_0x2fdcdd(0x1e3)]&&console['error'](_0x2fdcdd(0x1ec)+_0x13eee8[_0x2fdcdd(0x1d6)](',\x20'));if(_0x2f7d99){const _0x336dc1=getConsoleNextUrl(_0x4568ee['site'],'/app/ps/'+_0x2d0d43+_0x2fdcdd(0x1e7)+_0x2f7d99+_0x2fdcdd(0x204));console['error'](_0x2fdcdd(0x1d9)+a41_0x3c0870[_0x2fdcdd(0x1ca)](_0x336dc1));}return 0x0;}}
1
+ const a41_0x2bf1f0=a41_0x9b13;(function(_0xb6870b,_0x68c12c){const _0xdef7ee=a41_0x9b13,_0x193c35=_0xb6870b();while(!![]){try{const _0x1dcfa2=parseInt(_0xdef7ee(0x21c))/0x1+-parseInt(_0xdef7ee(0x23c))/0x2*(parseInt(_0xdef7ee(0x21a))/0x3)+-parseInt(_0xdef7ee(0x21d))/0x4*(parseInt(_0xdef7ee(0x219))/0x5)+parseInt(_0xdef7ee(0x1f3))/0x6+-parseInt(_0xdef7ee(0x212))/0x7+parseInt(_0xdef7ee(0x22c))/0x8+-parseInt(_0xdef7ee(0x24e))/0x9*(-parseInt(_0xdef7ee(0x1ef))/0xa);if(_0x1dcfa2===_0x68c12c)break;else _0x193c35['push'](_0x193c35['shift']());}catch(_0x4bab8a){_0x193c35['push'](_0x193c35['shift']());}}}(a41_0x215f,0x77924));import{BaseCommand}from'./command.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{generateDiff,formatDiffWithColors}from'../utils/diff.js';function a41_0x9b13(_0x34b677,_0x2be213){_0x34b677=_0x34b677-0x1cd;const _0x215fd5=a41_0x215f();let _0x9b13a1=_0x215fd5[_0x34b677];return _0x9b13a1;}function a41_0x215f(){const _0x2f8aaa=['toString','description','Delete\x20journey:','\x20deleted','connection','cwd','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','results','file','\x20folders\x20to\x20create','helpText','set','toDelete','targetDir','\x20updated','paused','Push\x20','Error:\x20Directory\x20not\x20found:\x20','Fetching\x20existing\x20data...','folderId','(Journey\x20will\x20be\x20deleted)','createdAt','activations','segments','\x20to\x20create','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file','\x20\x20Activations:','verbose','attributes','Delete\x20segment:','yes','data','\x20changed','blue','Fetching\x20existing\x20activations...','message','deleted','\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20','journeyBundleName','existingJourney','\x0aPush\x20summary\x20for\x20\x27','name','journeysOnly','resolveParentId','idToName','New\x20segment:','Preparing\x20journeys...','length','\x0aValidation\x20failed:','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','isScoped','parentSegment','3391090dnEhjA','red','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','updatedAt','2248794FvosJM','\x20\x20Activations:\x20','getJourney','dim','cyan','listSegments','createdSegmentIds','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)','Resolving\x20parent\x20segment\x20\x27','\x20\x20\x20\x20','push','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','versionNumber','\x20activations]','/sb/da/esr','repeat','listActivations','Error\x20parsing\x20YAML:\x20','listFolders','\x20\x20Journeys:\x20','\x20\x20📊\x20Segments:','updated','add','journeys','created','get','\x20new','then','✔\x20All\x20journeys\x20are\x20up\x20to\x20date','\x20to\x20delete','journey','331247boSIkg','buildUserMaps','folders','endsWith','nameToId','yamlConfig','changed','1845EiMmZb','57bGuUok','new','604169fahryf','10456InLmWd','\x0a✔\x20Push\x20complete','parentName','✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','user','journeyId','listJourneysWithDetailsFromParentSegment','segment','No\x20','yellow','\x20changes?','error','\x20\x20Segments:\x20','segment:push','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','2267832vApCPq','\x20YAML\x20files\x20found','toCreate','\x20unchanged','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','green','filePath','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','Scoped\x20to\x20folder:\x20','scopedFolderPath','nameToType','setPhase','Site:\x20','errorCode','46212LjFWeU','diff','parent_name','type','\x20created','\x27...','site','.yml','unchanged','join','Parent\x20segment:\x20','segmentFolderId','map','existingSegment','folderPath','/j/da/je','/e/','/app/ps/','18rxXGnz','Changes\x20to:','delete','filter','Changes\x20to\x20journey:','Aborted.','isNew','\x20to\x20update','parentFolder','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation'];a41_0x215f=function(){return _0x2f8aaa;};return a41_0x215f();}import{confirmKey,isInteractive}from'../utils/prompt.js';import{batchAsync}from'../utils/async.js';import{segmentToYamlString,segmentWithActivationsToYaml}from'../sdk/segment/child-segment-yaml.js';import a41_0xe61ac6 from'chalk';import{existsSync}from'fs';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{resolveTarget,isSuccessfulResolution,getScopedDetails}from'../sdk/segment/target-resolution.js';import{buildFolderMaps}from'../sdk/segment/resolution-context.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{resolveTDFolderPath,findSegmentsToDelete,findJourneysToDelete,buildSegmentLookupMap,buildSegmentNameToIdMap,buildJourneyBundleLookupMap,parseAndClassifyYamlFiles,validateParsedFiles,formatValidationErrors,extractRootFolderId,buildConnectionMaps,calculatePushStats,prepareSegmentFiles,prepareJourneyFiles,executePushSegments,executePushFolders,executePushSegmentDeletions,executePushJourneys}from'../sdk/segment/push-workflow.js';export class SegmentPushCommand extends BaseCommand{['name']=a41_0x2bf1f0(0x22a);[a41_0x2bf1f0(0x259)]='Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments';async['execute'](_0x66b6f){const _0x11b212=a41_0x2bf1f0,{options:_0x1ae472,args:_0x4959d4,tdx:_0x3d5ab1}=_0x66b6f,_0x19d478=_0x1ae472,_0x35331e=await resolveTarget({'arg':_0x4959d4[0x0],'contextParent':_0x1ae472[_0x11b212(0x1ee)],'cwd':process[_0x11b212(0x25d)]()});if(!isSuccessfulResolution(_0x35331e))return _0x35331e[_0x11b212(0x23b)]==='no_parent'?(console[_0x11b212(0x228)](a41_0xe61ac6[_0x11b212(0x226)](_0x11b212(0x233))),console[_0x11b212(0x228)](_0x11b212(0x1fa)),console['error'](_0x11b212(0x1ec)),console[_0x11b212(0x228)](_0x11b212(0x1d4))):(console['error'](a41_0xe61ac6[_0x11b212(0x1f0)]('Error:\x20'+_0x35331e['message']+'\x0a')),_0x35331e[_0x11b212(0x262)]&&console['error'](a41_0xe61ac6[_0x11b212(0x1f7)](_0x35331e[_0x11b212(0x262)]))),0x1;if(_0x35331e[_0x11b212(0x23f)]===_0x11b212(0x23e))return console[_0x11b212(0x228)](a41_0xe61ac6[_0x11b212(0x1f0)](_0x11b212(0x269)+_0x35331e[_0x11b212(0x265)]+'\x0a')),console['error'](a41_0xe61ac6[_0x11b212(0x1f7)](_0x11b212(0x230))),0x1;const _0x4e7b90=_0x35331e[_0x11b212(0x21f)],_0x43f514=_0x35331e[_0x11b212(0x265)],_0x78a2f6=_0x35331e[_0x11b212(0x23f)]===_0x11b212(0x260)?_0x35331e[_0x11b212(0x232)]:undefined,_0x332847=getScopedDetails(_0x35331e),_0x59c3f4=_0x332847?.[_0x11b212(0x1ed)]??![],_0x4d49d3=_0x332847?.[_0x11b212(0x237)]??'';if(!existsSync(_0x43f514))return console[_0x11b212(0x228)](a41_0xe61ac6[_0x11b212(0x1f0)]('Error:\x20Directory\x20not\x20found:\x20'+_0x43f514+'\x0a')),console[_0x11b212(0x228)](a41_0xe61ac6['cyan'](_0x11b212(0x230))),0x1;_0x19d478['verbose']&&(console[_0x11b212(0x228)](_0x11b212(0x23a)+_0x19d478[_0x11b212(0x242)]),console[_0x11b212(0x228)](_0x11b212(0x246)+_0x4e7b90),console[_0x11b212(0x228)]('Source\x20directory:\x20'+_0x43f514),_0x59c3f4&&console[_0x11b212(0x228)](_0x11b212(0x236)+_0x4d49d3));const _0x16df36=await withSpinner(_0x11b212(0x1fb)+_0x4e7b90+_0x11b212(0x241),()=>_0x3d5ab1[_0x11b212(0x224)][_0x11b212(0x1e6)](_0x4e7b90),{'verbose':_0x19d478[_0x11b212(0x1d6)]}),_0x5eb67e=_0x16df36[_0x11b212(0x1da)],{parentSegmentResult:_0x42bbcd,segmentsResult:_0x431fe4,foldersResult:_0x11c28d,journeysWithDetailsResult:_0x2162d1,userMaps:_0x34cecc}=await withSpinner(_0x11b212(0x1cd),async()=>{const _0x1efc49=_0x11b212,[_0x44d7cc,_0x585d17,_0x4ef32a,_0x2fd50f,_0x15799e]=await Promise['all']([_0x3d5ab1[_0x1efc49(0x224)]['getParent'](_0x5eb67e),_0x3d5ab1[_0x1efc49(0x224)][_0x1efc49(0x1f8)](_0x5eb67e),_0x3d5ab1[_0x1efc49(0x224)][_0x1efc49(0x205)](_0x5eb67e),_0x3d5ab1[_0x1efc49(0x211)][_0x1efc49(0x223)](_0x5eb67e,{'includeAllVersions':!![]}),_0x3d5ab1[_0x1efc49(0x221)][_0x1efc49(0x213)]()]);return{'parentSegmentResult':_0x44d7cc,'segmentsResult':_0x585d17,'foldersResult':_0x4ef32a,'journeysWithDetailsResult':_0x2fd50f,'userMaps':_0x15799e};},{'verbose':_0x19d478['verbose']})[_0x11b212(0x20e)](_0x13b0f9=>_0x13b0f9['data']),_0x27ad36=_0x42bbcd,_0x42c2e3=extractRootFolderId(_0x27ad36),_0x2081fd=_0x431fe4,_0x56f22b=_0x11c28d,{journeys:_0x5bb552,activationStepsById:_0x14696d}=_0x2162d1,_0xbab5d1=new Map(_0x5bb552[_0x11b212(0x248)](_0xc2d4e8=>[_0xc2d4e8['id'],_0xc2d4e8])),_0x41d133=_0x5bb552[_0x11b212(0x248)](_0x471b73=>({'id':_0x471b73['id'],'name':_0x471b73[_0x11b212(0x1d7)][_0x11b212(0x1e4)],'journeyBundleName':_0x471b73[_0x11b212(0x1d7)][_0x11b212(0x1e1)]||'','journeyBundleId':_0x471b73[_0x11b212(0x1d7)]['journeyBundleId']||'','versionNumber':_0x471b73[_0x11b212(0x1d7)][_0x11b212(0x1ff)],'description':_0x471b73['attributes'][_0x11b212(0x259)],'state':_0x471b73[_0x11b212(0x1d7)]['state'],'paused':_0x471b73[_0x11b212(0x1d7)][_0x11b212(0x267)],'audienceId':_0x471b73['attributes']['audienceId'],'folderId':_0x471b73['relationships']?.[_0x11b212(0x256)]?.['data']?.['id'],'createdAt':_0x471b73['attributes'][_0x11b212(0x1d0)],'updatedAt':_0x471b73[_0x11b212(0x1d7)][_0x11b212(0x1f2)]})),{emailToId:_0x40f02e,idToEmail:_0x3b1c13}=_0x34cecc,_0x28c5a2=await withSpinner('Fetching\x20connections\x20for\x20name\x20resolution...',async()=>{const _0x295f46=await _0x3d5ab1['connection']['list']();return buildConnectionMaps(_0x295f46);},{'verbose':_0x19d478[_0x11b212(0x1d6)]})[_0x11b212(0x20e)](_0x5e8b94=>_0x5e8b94[_0x11b212(0x1da)]),_0x1a6388=_0x28c5a2['nameToId'],_0xa03d94=_0x28c5a2[_0x11b212(0x1e7)],_0x3864fe=_0x28c5a2[_0x11b212(0x238)],_0x5569ec={'emailToIdMap':_0x40f02e,'connectionNameToIdMap':_0x1a6388,'connectionNameToTypeMap':_0x3864fe,'getSchema':_0x3f8b8f=>_0x3d5ab1['connection']['getOutputSchemaWithCache'](_0x3f8b8f)};let {pathToId:_0x3a6971,idToPath:_0x3ea79b}=buildFolderMaps(_0x56f22b);const _0x382154=buildSegmentLookupMap(_0x2081fd,_0x3ea79b),_0x20c5c2=buildSegmentNameToIdMap(_0x2081fd),_0x454e01=buildJourneyBundleLookupMap(_0x41d133,_0x3ea79b);let _0x1d080e;if(_0x78a2f6){if(!_0x78a2f6[_0x11b212(0x215)](_0x11b212(0x243))&&!_0x78a2f6[_0x11b212(0x215)]('.yaml'))return console[_0x11b212(0x228)](a41_0xe61ac6[_0x11b212(0x1f0)]('Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20'+_0x78a2f6+'\x0a')),0x1;_0x1d080e=[_0x78a2f6];}else _0x1d080e=findYamlFiles(_0x43f514);if(_0x1d080e[_0x11b212(0x1ea)]===0x0)return console[_0x11b212(0x228)](a41_0xe61ac6[_0x11b212(0x1f0)](_0x11b212(0x234)+_0x43f514+'\x0a')),console[_0x11b212(0x228)](a41_0xe61ac6['cyan'](_0x11b212(0x22b))),0x1;let _0x33b024,_0x1466e1;try{const _0x172d88=parseAndClassifyYamlFiles(_0x1d080e,_0x43f514,{'skipSegments':_0x19d478[_0x11b212(0x1e5)]});_0x33b024=_0x172d88['segments'],_0x1466e1=_0x172d88[_0x11b212(0x20a)];const _0x5d100a=validateParsedFiles(_0x172d88,_0x43f514);if(_0x5d100a[_0x11b212(0x1ea)]>0x0)return console['error'](a41_0xe61ac6[_0x11b212(0x1f0)](_0x11b212(0x1eb))),console[_0x11b212(0x228)](formatValidationErrors(_0x5d100a)),console[_0x11b212(0x228)](a41_0xe61ac6['yellow']('\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.')),0x1;}catch(_0x1aa99b){return console['error'](a41_0xe61ac6[_0x11b212(0x1f0)](_0x11b212(0x204)+(_0x1aa99b instanceof Error?_0x1aa99b[_0x11b212(0x1de)]:_0x1aa99b))),0x1;}if(_0x33b024[_0x11b212(0x1ea)]===0x0&&_0x1466e1[_0x11b212(0x1ea)]===0x0){const _0x58d881=_0x19d478[_0x11b212(0x1e5)]?'journey':'segment\x20or\x20journey';return console[_0x11b212(0x228)](a41_0xe61ac6[_0x11b212(0x226)](_0x11b212(0x225)+_0x58d881+_0x11b212(0x22d))),0x0;}const _0x3fb7d2=new Map();_0x2081fd[_0x11b212(0x1ea)]>0x0&&!_0x19d478[_0x11b212(0x1e5)]&&await withSpinner(_0x11b212(0x1dd),async()=>{await batchAsync(_0x2081fd,async _0x1720e2=>{const _0x2269bd=a41_0x9b13,_0x1c23dc=await _0x3d5ab1['segment'][_0x2269bd(0x203)](_0x5eb67e,_0x1720e2['id']);_0x3fb7d2[_0x2269bd(0x263)](_0x1720e2['id'],_0x1c23dc);});},{'verbose':_0x19d478[_0x11b212(0x1d6)]});const {segmentFiles:_0x365ebf,foldersToCreate:_0x581401}=await prepareSegmentFiles(_0x33b024,{'segmentByFolderAndName':_0x382154,'activationsBySegmentId':_0x3fb7d2,'folderPathToId':_0x3a6971,'idToEmailMap':_0x3b1c13,'connectionIdToNameMap':_0xa03d94},_0x5569ec,_0x59c3f4,_0x4d49d3),_0x328160=_0x78a2f6?[]:findSegmentsToDelete(_0x2081fd,_0x33b024[_0x11b212(0x248)](({yamlConfig:_0x3c2fd6,folderPath:_0xc2ab36})=>({'yamlConfig':_0x3c2fd6,'folderPath':resolveTDFolderPath(_0xc2ab36,_0x59c3f4,_0x4d49d3)})),_0x3ea79b,_0x4d49d3,_0x59c3f4),{journeyFiles:_0x41b9e9,foldersToCreate:_0x4a113e}=await withProgressSpinner(_0x11b212(0x1e9),async _0x4db079=>prepareJourneyFiles(_0x1466e1,{'fetchJourney':async _0x2ca216=>_0x3d5ab1[_0x11b212(0x211)][_0x11b212(0x1f5)](_0x2ca216[_0x11b212(0x222)]),'journeyBundlesByFolderAndName':_0x454e01,'folderPathToId':_0x3a6971,'idToEmailMap':_0x3b1c13,'connectionIdToNameMap':_0xa03d94,'existingSegments':_0x2081fd,'parentId':_0x5eb67e,'deps':_0x3d5ab1,'progress':{'update':_0x3ea971=>{const _0x2bb8f9=_0x11b212;_0x4db079[_0x2bb8f9(0x239)](_0x3ea971),_0x19d478[_0x2bb8f9(0x1d6)]&&console[_0x2bb8f9(0x228)]('\x20\x20'+_0x3ea971);}},'journeyById':_0xbab5d1,'activationStepsById':_0x14696d},_0x59c3f4,_0x4d49d3),{'verbose':_0x19d478['verbose']})[_0x11b212(0x20e)](_0x921d88=>_0x921d88[_0x11b212(0x1da)]);for(const _0x4a026a of _0x4a113e){_0x581401[_0x11b212(0x209)](_0x4a026a);}const _0x1dce7e=_0x78a2f6?[]:findJourneysToDelete(_0x41d133,_0x1466e1[_0x11b212(0x248)](({yamlConfig:_0x4ac27b,folderPath:_0x15219e})=>({'yamlConfig':_0x4ac27b,'folderPath':resolveTDFolderPath(_0x15219e,_0x59c3f4,_0x4d49d3)})),_0x3ea79b,_0x4d49d3,_0x59c3f4),_0x224e7e=calculatePushStats(_0x365ebf,_0x41b9e9,_0x581401,_0x328160,_0x1dce7e,!!_0x19d478[_0x11b212(0x250)],!!_0x19d478[_0x11b212(0x1e5)]),_0x305878=_0x224e7e[_0x11b212(0x1d2)][_0x11b212(0x21b)],_0x23094b=_0x224e7e[_0x11b212(0x1d2)][_0x11b212(0x218)],_0xd33fcf=_0x224e7e[_0x11b212(0x1d2)][_0x11b212(0x244)],_0x569e3b=_0x224e7e[_0x11b212(0x1d2)][_0x11b212(0x264)],_0x57cfc3=_0x224e7e[_0x11b212(0x214)][_0x11b212(0x22e)],_0x3ef134=_0x224e7e[_0x11b212(0x20a)]['new'],_0x26c94a=_0x224e7e['journeys'][_0x11b212(0x218)],_0x1b0449=_0x224e7e['journeys'][_0x11b212(0x244)],_0x52d244=_0x224e7e[_0x11b212(0x20a)]['toDelete'],_0x3cd5c3=_0x224e7e[_0x11b212(0x1d1)]['all'],_0x52f024=_0x224e7e['activations'][_0x11b212(0x22e)],_0x28edd8=_0x224e7e[_0x11b212(0x1d1)]['toUpdate'],_0x23d954=_0x224e7e[_0x11b212(0x1d1)][_0x11b212(0x264)];console[_0x11b212(0x228)](_0x11b212(0x1e3)+_0x4e7b90+'\x27:');_0x57cfc3[_0x11b212(0x1ea)]>0x0&&console[_0x11b212(0x228)]('\x20\x20'+a41_0xe61ac6[_0x11b212(0x1dc)]('📁\x20'+_0x57cfc3[_0x11b212(0x1ea)]+_0x11b212(0x261)));if(!_0x19d478[_0x11b212(0x1e5)]){console[_0x11b212(0x228)](_0x11b212(0x207)),console[_0x11b212(0x228)](_0x11b212(0x1fc)+a41_0xe61ac6[_0x11b212(0x231)]('+\x20'+_0x305878[_0x11b212(0x1ea)]+'\x20new')),console[_0x11b212(0x228)](_0x11b212(0x1fc)+a41_0xe61ac6[_0x11b212(0x226)]('~\x20'+_0x23094b[_0x11b212(0x1ea)]+_0x11b212(0x1db)));if(_0x569e3b['length']>0x0)console[_0x11b212(0x228)](_0x11b212(0x1fc)+a41_0xe61ac6[_0x11b212(0x1f0)]('-\x20'+_0x569e3b[_0x11b212(0x1ea)]+'\x20to\x20delete'));else _0x328160[_0x11b212(0x1ea)]>0x0&&!_0x19d478[_0x11b212(0x250)]&&console[_0x11b212(0x228)](_0x11b212(0x1fc)+a41_0xe61ac6[_0x11b212(0x1f6)](_0x328160[_0x11b212(0x1ea)]+_0x11b212(0x1fe)));console[_0x11b212(0x228)]('\x20\x20\x20\x20'+a41_0xe61ac6[_0x11b212(0x1f6)]('=\x20'+_0xd33fcf[_0x11b212(0x1ea)]+_0x11b212(0x22f)));}if(_0x41b9e9[_0x11b212(0x1ea)]>0x0||_0x1dce7e[_0x11b212(0x1ea)]>0x0){console[_0x11b212(0x228)]('\x20\x20🗺️\x20\x20Journeys:'),console[_0x11b212(0x228)]('\x20\x20\x20\x20'+a41_0xe61ac6[_0x11b212(0x231)]('+\x20'+_0x3ef134[_0x11b212(0x1ea)]+_0x11b212(0x20d))),console[_0x11b212(0x228)](_0x11b212(0x1fc)+a41_0xe61ac6[_0x11b212(0x226)]('~\x20'+_0x26c94a[_0x11b212(0x1ea)]+_0x11b212(0x1db)));if(_0x52d244[_0x11b212(0x1ea)]>0x0)console[_0x11b212(0x228)](_0x11b212(0x1fc)+a41_0xe61ac6[_0x11b212(0x1f0)]('-\x20'+_0x52d244[_0x11b212(0x1ea)]+_0x11b212(0x210)));else _0x1dce7e[_0x11b212(0x1ea)]>0x0&&!_0x19d478['delete']&&console['error']('\x20\x20\x20\x20'+a41_0xe61ac6[_0x11b212(0x1f6)](_0x1dce7e[_0x11b212(0x1ea)]+_0x11b212(0x1fe)));console[_0x11b212(0x228)](_0x11b212(0x1fc)+a41_0xe61ac6[_0x11b212(0x1f6)]('=\x20'+_0x1b0449[_0x11b212(0x1ea)]+_0x11b212(0x22f)));}_0x3cd5c3[_0x11b212(0x1ea)]>0x0&&!_0x19d478[_0x11b212(0x1e5)]&&(console[_0x11b212(0x228)](''),console[_0x11b212(0x228)](_0x11b212(0x1d5)),_0x52f024[_0x11b212(0x1ea)]>0x0&&console[_0x11b212(0x228)]('\x20\x20\x20\x20'+a41_0xe61ac6[_0x11b212(0x231)]('+\x20'+_0x52f024[_0x11b212(0x1ea)]+_0x11b212(0x1d3))),_0x28edd8['length']>0x0&&console[_0x11b212(0x228)]('\x20\x20\x20\x20'+a41_0xe61ac6[_0x11b212(0x226)]('~\x20'+_0x28edd8[_0x11b212(0x1ea)]+_0x11b212(0x255))),_0x23d954[_0x11b212(0x1ea)]>0x0&&console[_0x11b212(0x228)](_0x11b212(0x1fc)+a41_0xe61ac6[_0x11b212(0x1f0)]('-\x20'+_0x23d954['length']+'\x20to\x20delete')));console[_0x11b212(0x228)]('\x20\x20Source:\x20'+a41_0xe61ac6[_0x11b212(0x1f7)](_0x43f514)+'\x0a');if(_0x57cfc3['length']>0x0){console[_0x11b212(0x228)]('Folders\x20to\x20create:');for(const _0x3c4fbc of _0x57cfc3){console[_0x11b212(0x228)]('\x20\x20'+a41_0xe61ac6['blue']('+')+'\x20'+_0x3c4fbc);}console[_0x11b212(0x228)]('');}if(_0x305878[_0x11b212(0x1ea)]>0x0&&!_0x19d478[_0x11b212(0x1e5)])for(const _0x2db000 of _0x305878){const _0x29750e=_0x2db000[_0x11b212(0x24a)]?_0x2db000[_0x11b212(0x24a)]+'/'+_0x2db000['yamlConfig'][_0x11b212(0x1e4)]:_0x2db000[_0x11b212(0x217)][_0x11b212(0x1e4)],_0x157bad=_0x2db000[_0x11b212(0x217)][_0x11b212(0x1d1)]?.[_0x11b212(0x1ea)]||0x0,_0xd47183=_0x157bad>0x0?a41_0xe61ac6[_0x11b212(0x1f6)]('\x20['+_0x157bad+_0x11b212(0x200)):'';console[_0x11b212(0x228)]('\x0a'+a41_0xe61ac6['green'](_0x11b212(0x1e8))+'\x20'+_0x29750e+_0xd47183),console[_0x11b212(0x228)]('─'[_0x11b212(0x202)](0x3c)),_0x2db000[_0x11b212(0x23d)]&&console[_0x11b212(0x228)](_0x2db000[_0x11b212(0x23d)]),console[_0x11b212(0x228)]('─'[_0x11b212(0x202)](0x3c));}if(_0x569e3b[_0x11b212(0x1ea)]>0x0&&!_0x19d478['journeysOnly'])for(const _0x237d2f of _0x569e3b){const _0x288e29=_0x237d2f[_0x11b212(0x247)]?_0x3ea79b[_0x11b212(0x20c)](_0x237d2f[_0x11b212(0x247)][_0x11b212(0x258)]())||'':'',_0x2cbe97=_0x288e29?_0x288e29+'/'+_0x237d2f[_0x11b212(0x1e4)]:_0x237d2f[_0x11b212(0x1e4)],_0x21a5df=_0x3fb7d2['get'](_0x237d2f['id'])||[],_0x37026c=_0x21a5df[_0x11b212(0x1ea)]>0x0?a41_0xe61ac6[_0x11b212(0x1f6)]('\x20['+_0x21a5df['length']+_0x11b212(0x200)):'';console[_0x11b212(0x228)]('\x0a'+a41_0xe61ac6[_0x11b212(0x1f0)](_0x11b212(0x1d8))+'\x20'+_0x2cbe97+_0x37026c),console[_0x11b212(0x228)]('─'[_0x11b212(0x202)](0x3c));const _0x19dd9c=segmentWithActivationsToYaml(_0x237d2f,_0x21a5df,undefined,_0x3b1c13,_0xa03d94),_0x547a30=segmentToYamlString(_0x19dd9c),_0x3624d9=generateDiff(_0x547a30,'');console['error'](formatDiffWithColors(_0x3624d9)),console['error']('─'[_0x11b212(0x202)](0x3c));}const _0x12fc95=_0x365ebf[_0x11b212(0x251)](_0x36bed2=>!_0x36bed2[_0x11b212(0x254)]&&_0x36bed2[_0x11b212(0x23d)]);if(_0x12fc95[_0x11b212(0x1ea)]>0x0&&!_0x19d478[_0x11b212(0x1e5)])for(const _0x42ffd5 of _0x12fc95){const _0x4e09e7=_0x42ffd5[_0x11b212(0x24a)]?_0x42ffd5['folderPath']+'/'+_0x42ffd5[_0x11b212(0x217)][_0x11b212(0x1e4)]:_0x42ffd5['yamlConfig'][_0x11b212(0x1e4)];console['error']('\x0a'+a41_0xe61ac6['yellow'](_0x11b212(0x24f))+'\x20'+_0x4e09e7),console[_0x11b212(0x228)]('─'['repeat'](0x3c)),console[_0x11b212(0x228)](_0x42ffd5[_0x11b212(0x23d)]),console['error']('─'['repeat'](0x3c));}if(_0x3ef134['length']>0x0)for(const _0x4b4704 of _0x3ef134){const _0x2b7359=_0x4b4704[_0x11b212(0x24a)]?_0x4b4704[_0x11b212(0x24a)]+'/'+_0x4b4704[_0x11b212(0x217)][_0x11b212(0x1e4)]:_0x4b4704[_0x11b212(0x217)][_0x11b212(0x1e4)];console[_0x11b212(0x228)]('\x0a'+a41_0xe61ac6[_0x11b212(0x231)]('New\x20journey:')+'\x20'+_0x2b7359),console['error']('─'[_0x11b212(0x202)](0x3c)),_0x4b4704['diff']&&console[_0x11b212(0x228)](_0x4b4704[_0x11b212(0x23d)]),console[_0x11b212(0x228)]('─'[_0x11b212(0x202)](0x3c));}const _0x3d7e07=_0x41b9e9[_0x11b212(0x251)](_0x5636f0=>!_0x5636f0[_0x11b212(0x254)]&&_0x5636f0[_0x11b212(0x23d)]);if(_0x3d7e07[_0x11b212(0x1ea)]>0x0)for(const _0x3cd5be of _0x3d7e07){const _0x17260f=_0x3cd5be[_0x11b212(0x24a)]?_0x3cd5be[_0x11b212(0x24a)]+'/'+_0x3cd5be[_0x11b212(0x217)][_0x11b212(0x1e4)]:_0x3cd5be['yamlConfig'][_0x11b212(0x1e4)];console[_0x11b212(0x228)]('\x0a'+a41_0xe61ac6[_0x11b212(0x226)](_0x11b212(0x252))+'\x20'+_0x17260f),console[_0x11b212(0x228)]('─'[_0x11b212(0x202)](0x3c)),console[_0x11b212(0x228)](_0x3cd5be[_0x11b212(0x23d)]),console['error']('─'[_0x11b212(0x202)](0x3c));}if(_0x52d244['length']>0x0)for(const _0x35a094 of _0x52d244){const _0x1f50ce=_0x35a094[_0x11b212(0x1ce)]?_0x3ea79b[_0x11b212(0x20c)](_0x35a094[_0x11b212(0x1ce)])||'':'',_0x3313cc=_0x1f50ce?_0x1f50ce+'/'+_0x35a094['journeyBundleName']:_0x35a094[_0x11b212(0x1e1)];console[_0x11b212(0x228)]('\x0a'+a41_0xe61ac6[_0x11b212(0x1f0)](_0x11b212(0x25a))+'\x20'+_0x3313cc),console[_0x11b212(0x228)]('─'[_0x11b212(0x202)](0x3c)),console[_0x11b212(0x228)](a41_0xe61ac6[_0x11b212(0x1f0)](_0x11b212(0x1cf))),console[_0x11b212(0x228)]('─'[_0x11b212(0x202)](0x3c));}if(_0x19d478['dryRun'])return console[_0x11b212(0x228)](a41_0xe61ac6[_0x11b212(0x226)](_0x11b212(0x235))),0x0;const _0x571579=_0x19d478[_0x11b212(0x1e5)]?![]:_0x305878[_0x11b212(0x1ea)]>0x0||_0x23094b[_0x11b212(0x1ea)]>0x0||_0x569e3b[_0x11b212(0x1ea)]>0x0,_0x56303a=_0x3ef134[_0x11b212(0x1ea)]>0x0||_0x26c94a[_0x11b212(0x1ea)]>0x0||_0x52d244[_0x11b212(0x1ea)]>0x0,_0x2932e2=_0x19d478[_0x11b212(0x1e5)]?![]:_0x3cd5c3['length']>0x0,_0x2fc146=_0x57cfc3[_0x11b212(0x1ea)]>0x0;if(!_0x571579&&!_0x56303a&&!_0x2932e2&&!_0x2fc146){const _0x3fbed6=_0x19d478[_0x11b212(0x1e5)]?_0x11b212(0x20f):_0x11b212(0x220);console[_0x11b212(0x228)](a41_0xe61ac6[_0x11b212(0x231)](_0x3fbed6));if(_0x78a2f6&&_0xd33fcf['length']===0x1){const _0x1976c2=_0xd33fcf[0x0];if(_0x1976c2[_0x11b212(0x249)]?.['id']){const _0x235f2d=getConsoleNextUrl(_0x19d478['site'],_0x11b212(0x24d)+_0x5eb67e+_0x11b212(0x24c)+_0x1976c2[_0x11b212(0x249)]['id']+'/sb/da/esr');console[_0x11b212(0x228)]('\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20'+a41_0xe61ac6[_0x11b212(0x1f7)](_0x235f2d));}}if(_0x78a2f6&&_0x1b0449[_0x11b212(0x1ea)]===0x1){const _0x3da427=_0x1b0449[0x0];if(_0x3da427[_0x11b212(0x1e2)]?.['id']){const _0x2eb902=getConsoleNextUrl(_0x19d478[_0x11b212(0x242)],_0x11b212(0x24d)+_0x5eb67e+_0x11b212(0x24c)+_0x3da427[_0x11b212(0x1e2)]['id']+_0x11b212(0x24b));console[_0x11b212(0x228)]('\x20\x20'+a41_0xe61ac6[_0x11b212(0x1f7)](_0x2eb902));}}return 0x0;}const _0x551fa0=_0x19d478[_0x11b212(0x1e5)]?_0x3ef134[_0x11b212(0x1ea)]+_0x26c94a['length']+_0x52d244[_0x11b212(0x1ea)]+_0x57cfc3[_0x11b212(0x1ea)]:_0x305878['length']+_0x23094b[_0x11b212(0x1ea)]+_0x569e3b[_0x11b212(0x1ea)]+_0x3ef134['length']+_0x26c94a[_0x11b212(0x1ea)]+_0x52d244[_0x11b212(0x1ea)]+_0x57cfc3[_0x11b212(0x1ea)]+_0x3cd5c3[_0x11b212(0x1ea)];if(!_0x19d478[_0x11b212(0x1d9)]&&_0x551fa0>0x0){if(!isInteractive())return console['error'](a41_0xe61ac6[_0x11b212(0x1f0)]('\x0aError:'),_0x11b212(0x25e)),console['error'](a41_0xe61ac6[_0x11b212(0x1f6)](_0x11b212(0x257))),0x1;const _0x68ef98=await confirmKey(_0x11b212(0x268)+_0x551fa0+_0x11b212(0x227));if(!_0x68ef98)return console['error'](a41_0xe61ac6[_0x11b212(0x226)](_0x11b212(0x253))),0x1;}const _0x35c478={'withProgress':async(_0x461758,_0x233f3d)=>{const _0x176659=_0x11b212,_0x143353=await withSpinner(_0x461758,_0x233f3d,{'verbose':_0x19d478[_0x176659(0x1d6)]});return{'data':_0x143353['data']};},'logInfo':_0x3dfbcf=>console[_0x11b212(0x228)](a41_0xe61ac6[_0x11b212(0x1dc)]('✔\x20'+_0x3dfbcf)),'logSuccess':_0x2e090d=>console[_0x11b212(0x228)](a41_0xe61ac6[_0x11b212(0x231)]('✔\x20'+_0x2e090d)),'logWarning':_0x3742a0=>console[_0x11b212(0x228)](a41_0xe61ac6[_0x11b212(0x226)]('⚠\x20'+_0x3742a0)),'logDeleted':_0x1d65d8=>console[_0x11b212(0x228)](a41_0xe61ac6[_0x11b212(0x1f0)]('✔\x20'+_0x1d65d8))},_0x3ffbec={'segment':_0x3d5ab1[_0x11b212(0x224)],'journey':_0x3d5ab1[_0x11b212(0x211)],'user':_0x3d5ab1[_0x11b212(0x221)],'connection':_0x3d5ab1[_0x11b212(0x25c)]};_0x57cfc3[_0x11b212(0x1ea)]>0x0&&(_0x3a6971=await executePushFolders(_0x3ffbec,_0x57cfc3,_0x3a6971,{'parentId':_0x5eb67e},_0x35c478));const _0x432a27={'rootFolderId':_0x42c2e3,'folderPathToId':_0x3a6971,'folderIdToPath':_0x3ea79b,'segmentNameToId':_0x20c5c2,'activationsBySegmentId':_0x3fb7d2,'emailToIdMap':_0x40f02e,'idToEmailMap':_0x3b1c13,'connectionNameToIdMap':_0x28c5a2[_0x11b212(0x216)],'connectionIdToNameMap':_0x28c5a2[_0x11b212(0x1e7)],'connectionNameToTypeMap':_0x3864fe},_0x2c6902=await executePushSegments(_0x3ffbec,_0x19d478[_0x11b212(0x1e5)]?[]:_0x365ebf,_0x432a27,{'parentId':_0x5eb67e},_0x35c478),_0x1bb03a=_0x2c6902['created'],_0x241caa=_0x2c6902[_0x11b212(0x208)],_0x238b86=_0x2c6902[_0x11b212(0x1d1)][_0x11b212(0x20b)],_0x1b0ccb=_0x2c6902[_0x11b212(0x1d1)][_0x11b212(0x208)],_0xf77fa9=_0x2c6902['activations'][_0x11b212(0x1df)];let _0x5be936;if(_0x78a2f6&&_0x365ebf[_0x11b212(0x1ea)]===0x1){const _0x41ea5f=_0x365ebf[0x0];_0x5be936=_0x41ea5f['existingSegment']?.['id']??_0x2c6902[_0x11b212(0x1f9)]['get'](_0x41ea5f['yamlConfig']['name']);}const _0xcbb653=await executePushSegmentDeletions(_0x3ffbec,_0x19d478['journeysOnly']?[]:_0x569e3b,_0x35c478);let _0x166469=0x0,_0x4f9e61=0x0,_0x3c84f9=0x0;const _0x4623e7=new Map(_0x20c5c2);for(const [_0x1826a3,_0x10ccae]of _0x2c6902['createdSegmentIds']){_0x4623e7['set'](_0x1826a3,_0x10ccae);}if(_0x41b9e9[_0x11b212(0x1ea)]>0x0){const _0x4a31ce={..._0x432a27,'segmentNameToId':_0x4623e7,'existingSegments':_0x2081fd,'activationContext':_0x5569ec},_0x330282=await executePushJourneys(_0x3ffbec,_0x41b9e9,_0x4a31ce,{'parentId':_0x5eb67e,'rootFolderId':_0x42c2e3,'verbose':_0x19d478[_0x11b212(0x1d6)]},_0x35c478);_0x166469=_0x330282[_0x11b212(0x20b)],_0x4f9e61=_0x330282[_0x11b212(0x208)];if(_0x78a2f6&&_0x330282['results'][_0x11b212(0x1ea)]===0x1){const _0x2789f1=_0x330282[_0x11b212(0x25f)][0x0];if(_0x2789f1[_0x11b212(0x222)]){const _0x45ba0e=getConsoleNextUrl(_0x19d478[_0x11b212(0x242)],_0x11b212(0x24d)+_0x5eb67e+_0x11b212(0x24c)+_0x2789f1['journeyId']+_0x11b212(0x24b));console[_0x11b212(0x228)]('\x20\x20'+a41_0xe61ac6['cyan'](_0x45ba0e));}}}for(const _0x5b4914 of _0x52d244){console[_0x11b212(0x228)](a41_0xe61ac6[_0x11b212(0x226)](_0x11b212(0x1f1)+_0x5b4914['journeyBundleName'])),_0x3c84f9++;}const _0x132009=[];if(_0x1bb03a>0x0)_0x132009[_0x11b212(0x1fd)](_0x1bb03a+'\x20created');if(_0x241caa>0x0)_0x132009[_0x11b212(0x1fd)](_0x241caa+_0x11b212(0x266));if(_0xcbb653>0x0)_0x132009[_0x11b212(0x1fd)](_0xcbb653+_0x11b212(0x25b));const _0x1fa76e=[];if(_0x166469>0x0)_0x1fa76e[_0x11b212(0x1fd)](_0x166469+'\x20created');if(_0x4f9e61>0x0)_0x1fa76e[_0x11b212(0x1fd)](_0x4f9e61+_0x11b212(0x266));if(_0x3c84f9>0x0)_0x1fa76e['push'](_0x3c84f9+_0x11b212(0x25b));const _0x142ddd=[];if(_0x238b86>0x0)_0x142ddd['push'](_0x238b86+_0x11b212(0x240));if(_0x1b0ccb>0x0)_0x142ddd[_0x11b212(0x1fd)](_0x1b0ccb+_0x11b212(0x266));if(_0xf77fa9>0x0)_0x142ddd[_0x11b212(0x1fd)](_0xf77fa9+_0x11b212(0x25b));console[_0x11b212(0x228)](a41_0xe61ac6[_0x11b212(0x231)](_0x11b212(0x21e)));_0x132009['length']>0x0&&!_0x19d478[_0x11b212(0x1e5)]&&console[_0x11b212(0x228)](_0x11b212(0x229)+_0x132009[_0x11b212(0x245)](',\x20'));_0x1fa76e[_0x11b212(0x1ea)]>0x0&&console['error'](_0x11b212(0x206)+_0x1fa76e[_0x11b212(0x245)](',\x20'));_0x142ddd[_0x11b212(0x1ea)]>0x0&&!_0x19d478['journeysOnly']&&console[_0x11b212(0x228)](_0x11b212(0x1f4)+_0x142ddd[_0x11b212(0x245)](',\x20'));if(_0x5be936){const _0x4dfebb=getConsoleNextUrl(_0x19d478[_0x11b212(0x242)],_0x11b212(0x24d)+_0x5eb67e+_0x11b212(0x24c)+_0x5be936+_0x11b212(0x201));console[_0x11b212(0x228)](_0x11b212(0x1e0)+a41_0xe61ac6[_0x11b212(0x1f7)](_0x4dfebb));}return 0x0;}}
@@ -1 +1 @@
1
- const a42_0x29b388=a42_0x16e5;(function(_0x456d20,_0x20cc35){const _0x2a8610=a42_0x16e5,_0x3b8088=_0x456d20();while(!![]){try{const _0x586790=-parseInt(_0x2a8610(0x1d1))/0x1*(parseInt(_0x2a8610(0x1ae))/0x2)+parseInt(_0x2a8610(0x1b0))/0x3*(parseInt(_0x2a8610(0x1c3))/0x4)+-parseInt(_0x2a8610(0x1cc))/0x5*(parseInt(_0x2a8610(0x1b4))/0x6)+parseInt(_0x2a8610(0x1dd))/0x7*(-parseInt(_0x2a8610(0x1bd))/0x8)+-parseInt(_0x2a8610(0x1be))/0x9+-parseInt(_0x2a8610(0x1c8))/0xa+-parseInt(_0x2a8610(0x1bc))/0xb*(-parseInt(_0x2a8610(0x1c9))/0xc);if(_0x586790===_0x20cc35)break;else _0x3b8088['push'](_0x3b8088['shift']());}catch(_0x3bc66f){_0x3b8088['push'](_0x3b8088['shift']());}}}(a42_0x1fb7,0x223c0));import{BaseCommand}from'./command.js';function a42_0x1fb7(){const _0x3d2a3f=['\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','segmentName','\x20\x20\x20Path:\x20','name','segment:update','kind','1881uMpTzV','395056gHgeil','1377243NaxMcM','type','✔\x20Updated\x20segment\x20\x27','rule','⚠\x20Deprecation\x20warning:\x20`segment\x20update`\x20is\x20deprecated.','442352RKPlXT','\x27...','resolvePathToResource','Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','283230DIfrsG','32556XhdbHJ','execute','Segment\x20ID:\x20','90vUPrrU','Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]','length','segment','includes','15087lXhOUO','parentId','segmentPath','.\x20Only\x20child\x20segments\x20can\x20be\x20updated.','Error:\x20Cannot\x20update\x20','Resolving\x20path\x20\x27','updateSegmentById','Resolving\x20folder\x20\x27','yellow','verbose','description','folder','14qWJxMe','resolveFolderId','2MvxvNz','data','3ohCXfQ','Resolved\x20relative\x20path\x20to:\x20','error','Resolved\x20folder\x20ID:\x20','46362wVdOXB','Update\x20existing\x20child\x20segment'];a42_0x1fb7=function(){return _0x3d2a3f;};return a42_0x1fb7();}import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';function a42_0x16e5(_0x3f2bb8,_0x16fe81){_0x3f2bb8=_0x3f2bb8-0x1ad;const _0x1fb7db=a42_0x1fb7();let _0x16e5e0=_0x1fb7db[_0x3f2bb8];return _0x16e5e0;}import{loadJSONFromOptions}from'../utils/json-loader.js';import{SDKError,ErrorCode}from'../sdk/index.js';import a42_0x39c6dc from'chalk';export class SegmentUpdateCommand extends BaseCommand{[a42_0x29b388(0x1b9)]=a42_0x29b388(0x1ba);[a42_0x29b388(0x1db)]=a42_0x29b388(0x1b5);async[a42_0x29b388(0x1ca)](_0x9bb459){const _0x5d47db=a42_0x29b388;console['error'](a42_0x39c6dc[_0x5d47db(0x1d9)](_0x5d47db(0x1c2))),console[_0x5d47db(0x1b2)](a42_0x39c6dc[_0x5d47db(0x1d9)]('\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a'));const {options:_0x49e879,args:_0x42e523,tdx:_0x28a078}=_0x9bb459,_0x471f16=_0x49e879;if(_0x42e523[_0x5d47db(0x1ce)]===0x0)return console['error'](_0x5d47db(0x1c7)),console[_0x5d47db(0x1b2)](_0x5d47db(0x1c6)),console[_0x5d47db(0x1b2)]('Examples:'),console['error']('\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22'),console['error'](_0x5d47db(0x1b6)),0x1;const _0x3b3f80=_0x42e523[0x0],_0x279024=_0x49e879[_0x5d47db(0x1d3)];let _0x408085=_0x3b3f80;_0x279024&&!_0x3b3f80[_0x5d47db(0x1d0)]('/')&&(_0x408085=_0x279024+'/'+_0x3b3f80,_0x471f16[_0x5d47db(0x1da)]&&console[_0x5d47db(0x1b2)](_0x5d47db(0x1b1)+_0x408085));const _0x59b4bf=await withSpinner(_0x5d47db(0x1d6)+_0x408085+'\x27...',()=>_0x28a078['segment'][_0x5d47db(0x1c5)](_0x408085),{'verbose':_0x471f16[_0x5d47db(0x1da)]}),_0x4835d2=_0x59b4bf[_0x5d47db(0x1af)];_0x471f16[_0x5d47db(0x1da)]&&console[_0x5d47db(0x1b2)]('Resolved\x20type:\x20'+_0x4835d2[_0x5d47db(0x1bf)]);if(_0x4835d2['type']!==_0x5d47db(0x1cf))return console['error'](_0x5d47db(0x1d5)+_0x4835d2[_0x5d47db(0x1bf)]+_0x5d47db(0x1d4)),console[_0x5d47db(0x1b2)](_0x5d47db(0x1cd)),0x1;if(!_0x4835d2['segmentId'])throw new SDKError(ErrorCode['INTERNAL'],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x3b78be=_0x4835d2[_0x5d47db(0x1d2)],_0x36d8fb=_0x4835d2['segmentId'];_0x471f16[_0x5d47db(0x1da)]&&(console['error']('Parent\x20ID:\x20'+_0x3b78be),console[_0x5d47db(0x1b2)](_0x5d47db(0x1cb)+_0x36d8fb));let _0x35a2b6;if(_0x471f16[_0x5d47db(0x1dc)]){const _0x5cc0dd=_0x471f16[_0x5d47db(0x1dc)],_0x959054=await withSpinner(_0x5d47db(0x1d8)+_0x5cc0dd+_0x5d47db(0x1c4),()=>_0x28a078[_0x5d47db(0x1cf)][_0x5d47db(0x1ad)](_0x3b78be,_0x5cc0dd),{'verbose':_0x471f16['verbose']});_0x35a2b6=parseInt(_0x959054[_0x5d47db(0x1af)],0xa),_0x471f16[_0x5d47db(0x1da)]&&console[_0x5d47db(0x1b2)](_0x5d47db(0x1b3)+_0x35a2b6);}const _0x529770=await loadJSONFromOptions(_0x471f16[_0x5d47db(0x1c1)],_0x471f16['ruleFile']),_0x2e36aa={'name':_0x471f16[_0x5d47db(0x1b9)],'description':_0x471f16[_0x5d47db(0x1db)],'rule':_0x529770,'kind':_0x471f16[_0x5d47db(0x1bb)]!==undefined?parseInt(_0x471f16[_0x5d47db(0x1bb)],0xa):undefined,'segmentFolderId':_0x35a2b6},_0xc89cfd=await withSpinner('Updating\x20segment\x20\x27'+_0x4835d2[_0x5d47db(0x1b7)]+_0x5d47db(0x1c4),()=>_0x28a078[_0x5d47db(0x1cf)][_0x5d47db(0x1d7)](_0x3b78be,_0x36d8fb,_0x2e36aa),{'verbose':_0x471f16[_0x5d47db(0x1da)]}),_0x845a41=_0xc89cfd[_0x5d47db(0x1af)];return console[_0x5d47db(0x1b2)](_0x5d47db(0x1c0)+_0x845a41[_0x5d47db(0x1b9)]+'\x27'),_0x408085!==_0x3b3f80&&console[_0x5d47db(0x1b2)](_0x5d47db(0x1b8)+_0x408085),await handleSDKOutput([_0x845a41],_0x471f16),0x0;}}
1
+ const a42_0x13387b=a42_0x37a2;function a42_0x37a2(_0x43728,_0x35d0e1){_0x43728=_0x43728-0x7a;const _0xb270c=a42_0xb270();let _0x37a299=_0xb270c[_0x43728];return _0x37a299;}(function(_0x56d866,_0x46f37a){const _0x4774fd=a42_0x37a2,_0x592447=_0x56d866();while(!![]){try{const _0x5eda4a=-parseInt(_0x4774fd(0x8c))/0x1*(parseInt(_0x4774fd(0x82))/0x2)+-parseInt(_0x4774fd(0x96))/0x3+parseInt(_0x4774fd(0x95))/0x4*(parseInt(_0x4774fd(0x7a))/0x5)+parseInt(_0x4774fd(0x89))/0x6+parseInt(_0x4774fd(0xa4))/0x7*(parseInt(_0x4774fd(0x9f))/0x8)+parseInt(_0x4774fd(0x7e))/0x9+parseInt(_0x4774fd(0xa3))/0xa*(-parseInt(_0x4774fd(0xa2))/0xb);if(_0x5eda4a===_0x46f37a)break;else _0x592447['push'](_0x592447['shift']());}catch(_0x3420ba){_0x592447['push'](_0x592447['shift']());}}}(a42_0xb270,0x34116));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';function a42_0xb270(){const _0x17ee0a=['10KhKBzq','14vVoNon','Resolved\x20folder\x20ID:\x20','INTERNAL','156790Uqteab','folder','Update\x20existing\x20child\x20segment','segment','2730546RhkpAQ','length','Resolving\x20folder\x20\x27','segmentId','128812ntQdCx','segmentPath','verbose','includes','Resolved\x20relative\x20path\x20to:\x20','Error:\x20Cannot\x20update\x20','yellow','2050620uSTill','Resolved\x20type:\x20','error','2moOiby','Segment\x20ID:\x20','⚠\x20Deprecation\x20warning:\x20`segment\x20update`\x20is\x20deprecated.','\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22','description','resolvePathToResource','\x27...','data','type','32bXQCQP','1166001TNfEYy','segment:update','parentId','Parent\x20ID:\x20','name','ruleFile','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]','.\x20Only\x20child\x20segments\x20can\x20be\x20updated.','494552DuKJPL','Examples:','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','3178087lcurcW'];a42_0xb270=function(){return _0x17ee0a;};return a42_0xb270();}import{loadJSONFromOptions}from'../utils/json-loader.js';import{SDKError,ErrorCode}from'../sdk/index.js';import a42_0x37b0fb from'chalk';export class SegmentUpdateCommand extends BaseCommand{[a42_0x13387b(0x9a)]=a42_0x13387b(0x97);[a42_0x13387b(0x90)]=a42_0x13387b(0x7c);async['execute'](_0xe2cf27){const _0x3a5508=a42_0x13387b;console[_0x3a5508(0x8b)](a42_0x37b0fb['yellow'](_0x3a5508(0x8e))),console[_0x3a5508(0x8b)](a42_0x37b0fb[_0x3a5508(0x88)](_0x3a5508(0xa1)));const {options:_0x42a990,args:_0x390f51,tdx:_0xa1f5b2}=_0xe2cf27,_0x289cdd=_0x42a990;if(_0x390f51[_0x3a5508(0x7f)]===0x0)return console[_0x3a5508(0x8b)](_0x3a5508(0x9c)),console[_0x3a5508(0x8b)](_0x3a5508(0x9d)),console[_0x3a5508(0x8b)](_0x3a5508(0xa0)),console['error'](_0x3a5508(0x8f)),console[_0x3a5508(0x8b)]('\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context'),0x1;const _0x3003d9=_0x390f51[0x0],_0x2f0001=_0x42a990[_0x3a5508(0x83)];let _0x24147b=_0x3003d9;_0x2f0001&&!_0x3003d9[_0x3a5508(0x85)]('/')&&(_0x24147b=_0x2f0001+'/'+_0x3003d9,_0x289cdd[_0x3a5508(0x84)]&&console[_0x3a5508(0x8b)](_0x3a5508(0x86)+_0x24147b));const _0x1f214e=await withSpinner('Resolving\x20path\x20\x27'+_0x24147b+_0x3a5508(0x92),()=>_0xa1f5b2['segment'][_0x3a5508(0x91)](_0x24147b),{'verbose':_0x289cdd[_0x3a5508(0x84)]}),_0x38464a=_0x1f214e['data'];_0x289cdd[_0x3a5508(0x84)]&&console[_0x3a5508(0x8b)](_0x3a5508(0x8a)+_0x38464a[_0x3a5508(0x94)]);if(_0x38464a['type']!==_0x3a5508(0x7d))return console['error'](_0x3a5508(0x87)+_0x38464a[_0x3a5508(0x94)]+_0x3a5508(0x9e)),console['error']('Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]'),0x1;if(!_0x38464a['segmentId'])throw new SDKError(ErrorCode[_0x3a5508(0xa6)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x4d447a=_0x38464a[_0x3a5508(0x98)],_0x46e220=_0x38464a[_0x3a5508(0x81)];_0x289cdd[_0x3a5508(0x84)]&&(console[_0x3a5508(0x8b)](_0x3a5508(0x99)+_0x4d447a),console[_0x3a5508(0x8b)](_0x3a5508(0x8d)+_0x46e220));let _0x306d6b;if(_0x289cdd['folder']){const _0x5e5b81=_0x289cdd[_0x3a5508(0x7b)],_0x5cf2bb=await withSpinner(_0x3a5508(0x80)+_0x5e5b81+'\x27...',()=>_0xa1f5b2['segment']['resolveFolderId'](_0x4d447a,_0x5e5b81),{'verbose':_0x289cdd[_0x3a5508(0x84)]});_0x306d6b=parseInt(_0x5cf2bb[_0x3a5508(0x93)],0xa),_0x289cdd[_0x3a5508(0x84)]&&console[_0x3a5508(0x8b)](_0x3a5508(0xa5)+_0x306d6b);}const _0x42292f=await loadJSONFromOptions(_0x289cdd['rule'],_0x289cdd[_0x3a5508(0x9b)]),_0xbb437f={'name':_0x289cdd[_0x3a5508(0x9a)],'description':_0x289cdd[_0x3a5508(0x90)],'rule':_0x42292f,'kind':_0x289cdd['kind']!==undefined?parseInt(_0x289cdd['kind'],0xa):undefined,'segmentFolderId':_0x306d6b},_0x19ae6c=await withSpinner('Updating\x20segment\x20\x27'+_0x38464a['segmentName']+_0x3a5508(0x92),()=>_0xa1f5b2[_0x3a5508(0x7d)]['updateSegmentById'](_0x4d447a,_0x46e220,_0xbb437f),{'verbose':_0x289cdd[_0x3a5508(0x84)]}),_0x13c21f=_0x19ae6c['data'];return console[_0x3a5508(0x8b)]('✔\x20Updated\x20segment\x20\x27'+_0x13c21f[_0x3a5508(0x9a)]+'\x27'),_0x24147b!==_0x3003d9&&console[_0x3a5508(0x8b)]('\x20\x20\x20Path:\x20'+_0x24147b),await handleSDKOutput([_0x13c21f],_0x289cdd),0x0;}}
@@ -1 +1 @@
1
- const a43_0x5a2010=a43_0x12d0;(function(_0x28cfb6,_0xa71b51){const _0x1edb85=a43_0x12d0,_0x5a3f49=_0x28cfb6();while(!![]){try{const _0x2be353=-parseInt(_0x1edb85(0x109))/0x1*(parseInt(_0x1edb85(0x118))/0x2)+parseInt(_0x1edb85(0x102))/0x3*(parseInt(_0x1edb85(0x10a))/0x4)+parseInt(_0x1edb85(0x112))/0x5+-parseInt(_0x1edb85(0xf9))/0x6*(parseInt(_0x1edb85(0x111))/0x7)+parseInt(_0x1edb85(0x121))/0x8+-parseInt(_0x1edb85(0xfd))/0x9*(-parseInt(_0x1edb85(0x11b))/0xa)+-parseInt(_0x1edb85(0x10b))/0xb*(parseInt(_0x1edb85(0xf5))/0xc);if(_0x2be353===_0xa71b51)break;else _0x5a3f49['push'](_0x5a3f49['shift']());}catch(_0x21b800){_0x5a3f49['push'](_0x5a3f49['shift']());}}}(a43_0x2a67,0x508c7));import{existsSync,statSync}from'fs';import a43_0x4d2995 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';function a43_0x12d0(_0x11ff17,_0x5d4041){_0x11ff17=_0x11ff17-0xf0;const _0x2a6734=a43_0x2a67();let _0x12d0d8=_0x2a6734[_0x11ff17];return _0x12d0d8;}import{findTdxConfig}from'../sdk/segment/tdx-config.js';export class SegmentUseCommand extends BaseCommand{[a43_0x5a2010(0xfa)]=a43_0x5a2010(0x113);['description']='Set\x20current\x20segment/folder\x20context\x20for\x20navigation';async[a43_0x5a2010(0x116)](_0x325f4c){const _0xd77f7=a43_0x5a2010,{options:_0xf81386,args:_0x2dde6a,tdx:_0x82e20}=_0x325f4c;if(_0x2dde6a[_0xd77f7(0x10e)]===0x0)return console[_0xd77f7(0x115)](a43_0x4d2995[_0xd77f7(0x10f)](_0xd77f7(0xf6))),console['error'](_0xd77f7(0x114)),console[_0xd77f7(0x115)](_0xd77f7(0xf3)),console[_0xd77f7(0x115)]('\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22'),console[_0xd77f7(0x115)]('\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22'),console['error']('\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context'),console[_0xd77f7(0x115)]('\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent'),0x1;const _0x45fb7c=_0x2dde6a[0x0],_0x2d2257=_0xf81386[_0xd77f7(0xf0)];try{if(_0x45fb7c==='/')return saveSessionContext({'segment_path':undefined},_0x2d2257),console['log'](a43_0x4d2995[_0xd77f7(0x11e)](_0xd77f7(0xf8))),0x0;if(existsSync(_0x45fb7c)&&statSync(_0x45fb7c)[_0xd77f7(0x11a)]()){let _0x2e8961;try{_0x2e8961=findTdxConfig(_0x45fb7c);}catch{return console[_0xd77f7(0x115)](a43_0x4d2995[_0xd77f7(0x10f)](_0xd77f7(0x123)+_0x45fb7c)),console[_0xd77f7(0x115)](a43_0x4d2995[_0xd77f7(0xfe)]('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;}const _0x29c6=_0x2e8961['config'][_0xd77f7(0x105)];return saveSessionContext({'segment_path':_0x29c6,'parent_segment':_0x29c6},_0x2d2257),console[_0xd77f7(0xfb)](a43_0x4d2995['green'](_0xd77f7(0x11d)+a43_0x4d2995[_0xd77f7(0xfe)](_0x29c6))),0x0;}const _0x4c31a7=_0xf81386[_0xd77f7(0x107)];let _0x155fa1=_0x45fb7c;const _0x26f093=parsePath(_0x45fb7c);if(!_0x26f093[_0xd77f7(0x11f)]){if(!_0x4c31a7)return console[_0xd77f7(0x115)](a43_0x4d2995[_0xd77f7(0x10f)](_0xd77f7(0x100))),console['error'](a43_0x4d2995[_0xd77f7(0xfe)](_0xd77f7(0x103))),0x1;if(_0x45fb7c==='..'){const _0x478b09=_0x4c31a7['split']('/')['slice'](0x0,-0x1)[_0xd77f7(0xf7)]('/');_0x155fa1=_0x478b09||'/';}else _0x45fb7c==='.'?_0x155fa1=_0x4c31a7:_0x155fa1=_0x4c31a7+'/'+_0x45fb7c;_0xf81386[_0xd77f7(0x108)]&&console[_0xd77f7(0x115)]('Resolved\x20relative\x20path\x20to:\x20'+_0x155fa1);}if(_0x155fa1==='/'||_0x155fa1==='')return saveSessionContext({'segment_path':undefined},_0x2d2257),console[_0xd77f7(0xfb)](a43_0x4d2995[_0xd77f7(0x11e)](_0xd77f7(0xf8))),0x0;_0x155fa1=normalizePath(_0x155fa1);const _0x4b14c6=parsePath(_0x155fa1)[_0xd77f7(0xf1)];if(_0x4b14c6[_0xd77f7(0x10e)]===0x0)return saveSessionContext({'segment_path':undefined},_0x2d2257),console['log'](a43_0x4d2995[_0xd77f7(0x11e)](_0xd77f7(0xf8))),0x0;_0xf81386[_0xd77f7(0x108)]&&(console[_0xd77f7(0x115)]('Site:\x20'+_0xf81386[_0xd77f7(0xf4)]),console[_0xd77f7(0x115)]('Target\x20path:\x20'+_0x155fa1));const _0x1d234e=await withSpinner(_0xd77f7(0xf2)+_0x155fa1+'\x27...',()=>_0x82e20['segment'][_0xd77f7(0x110)](_0x155fa1),{'verbose':_0xf81386['verbose']}),_0x5d1e50=_0x1d234e['data'];_0xf81386[_0xd77f7(0x108)]&&(console['error']('Resolved\x20path\x20type:\x20'+_0x5d1e50['type']),console['error']('Parent\x20ID:\x20'+_0x5d1e50[_0xd77f7(0x10c)]),_0x5d1e50[_0xd77f7(0x117)]&&console['error'](_0xd77f7(0x122)+_0x5d1e50[_0xd77f7(0x117)]));if(_0x5d1e50[_0xd77f7(0xff)]==='segment')return console['error'](a43_0x4d2995[_0xd77f7(0x10f)](_0xd77f7(0x106))),console['error'](_0xd77f7(0x10d)),console[_0xd77f7(0x115)](a43_0x4d2995['cyan'](_0xd77f7(0x101)+_0x5d1e50['parentName']+(_0x5d1e50['folderPath']?'/'+_0x5d1e50[_0xd77f7(0x124)]['join']('/'):''))),0x1;return saveSessionContext({'segment_path':_0x5d1e50['fullPath'],'parent_segment':_0x5d1e50[_0xd77f7(0x11c)]},_0x2d2257),console[_0xd77f7(0xfb)](a43_0x4d2995[_0xd77f7(0x11e)](_0xd77f7(0x11d)+a43_0x4d2995[_0xd77f7(0xfe)](_0x5d1e50[_0xd77f7(0x119)]))),_0xf81386[_0xd77f7(0x108)]&&(console[_0xd77f7(0x115)](a43_0x4d2995['dim'](_0xd77f7(0x104))),console['error'](a43_0x4d2995[_0xd77f7(0x120)](_0xd77f7(0xfc)))),0x0;}catch(_0x2e7b8d){throw _0x2e7b8d;}}}function a43_0x2a67(){const _0x212836=['parentName','✔\x20Context\x20set\x20to:\x20','green','isAbsolute','dim','2328000xWoymL','Folder\x20ID:\x20','Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','folderPath','session','segments','Resolving\x20path\x20\x27','Examples:','site','1032612ZUXnsl','Error:\x20Path\x20is\x20required\x0a','join','✔\x20Context\x20cleared.\x20Back\x20to\x20root.','129252vIMoHH','name','log','Use\x20\x22tdx\x20use\x22\x20to\x20see\x20all\x20context\x20parameters','9DwXWQS','cyan','type','Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.','Use:\x20tdx\x20segment\x20use\x20','6biMZUF','Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>','Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context','parent_segment','Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.','segmentPath','verbose','243008wyENlT','1089828eqppHB','121PlIqim','parentId','Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.','length','red','resolvePathToResource','70vySSBx','1858440EqFoua','segment:use','Usage:\x20tdx\x20segment\x20use\x20<path>','error','execute','folderId','2iMjCeh','fullPath','isDirectory','5273140RXISbU'];a43_0x2a67=function(){return _0x212836;};return a43_0x2a67();}
1
+ const a43_0x4cf736=a43_0x2b84;function a43_0x768d(){const _0x5af4c1=['Examples:','Target\x20path:\x20','parent_segment','Use\x20\x22tdx\x20use\x22\x20to\x20see\x20all\x20context\x20parameters','isAbsolute','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','1557259YMZORX','green','resolvePathToResource','Site:\x20','Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','40DRrQDX','site','segment:use','Parent\x20ID:\x20','Usage:\x20tdx\x20segment\x20use\x20<path>','description','32sVVzeh','length','Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>','16588728WxIMWW','log','execute','fullPath','Set\x20current\x20segment/folder\x20context\x20for\x20navigation','folderPath','red','session','join','Resolving\x20path\x20\x27','error','Use:\x20tdx\x20segment\x20use\x20','type','✔\x20Context\x20cleared.\x20Back\x20to\x20root.','7672343ZqQqLk','folderId','243770pKFGjV','verbose','Folder\x20ID:\x20','parentName','Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.','data','✔\x20Context\x20set\x20to:\x20','config','6pEqzFx','1431531UKYUYB','slice','isDirectory','segments','\x27...','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22','cyan','Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context','277MeYbCb','parentId','34792VRsylc','537Jwkome','segment','Resolved\x20path\x20type:\x20','dim','1478pSHKnF'];a43_0x768d=function(){return _0x5af4c1;};return a43_0x768d();}(function(_0x22ff69,_0x2ab77e){const _0x554b7c=a43_0x2b84,_0x49f486=_0x22ff69();while(!![]){try{const _0x22c34f=parseInt(_0x554b7c(0x1a9))/0x1*(parseInt(_0x554b7c(0x1b0))/0x2)+parseInt(_0x554b7c(0x1ac))/0x3*(parseInt(_0x554b7c(0x1ab))/0x4)+-parseInt(_0x554b7c(0x1d5))/0x5+parseInt(_0x554b7c(0x1dd))/0x6*(-parseInt(_0x554b7c(0x1d3))/0x7)+parseInt(_0x554b7c(0x1c2))/0x8*(-parseInt(_0x554b7c(0x1de))/0x9)+parseInt(_0x554b7c(0x1bc))/0xa*(-parseInt(_0x554b7c(0x1b7))/0xb)+parseInt(_0x554b7c(0x1c5))/0xc;if(_0x22c34f===_0x2ab77e)break;else _0x49f486['push'](_0x49f486['shift']());}catch(_0x57f4ea){_0x49f486['push'](_0x49f486['shift']());}}}(a43_0x768d,0xc2834));import{existsSync,statSync}from'fs';import a43_0x57f399 from'chalk';function a43_0x2b84(_0x91351c,_0x5ecd2c){_0x91351c=_0x91351c-0x1a2;const _0x768d20=a43_0x768d();let _0x2b841e=_0x768d20[_0x91351c];return _0x2b841e;}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{['name']=a43_0x4cf736(0x1be);[a43_0x4cf736(0x1c1)]=a43_0x4cf736(0x1c9);async[a43_0x4cf736(0x1c7)](_0x455111){const _0x18f4d2=a43_0x4cf736,{options:_0x341ad4,args:_0x5e56a8,tdx:_0x111bb1}=_0x455111;if(_0x5e56a8['length']===0x0)return console[_0x18f4d2(0x1cf)](a43_0x57f399[_0x18f4d2(0x1cb)]('Error:\x20Path\x20is\x20required\x0a')),console[_0x18f4d2(0x1cf)](_0x18f4d2(0x1c0)),console['error'](_0x18f4d2(0x1b1)),console[_0x18f4d2(0x1cf)](_0x18f4d2(0x1a6)),console[_0x18f4d2(0x1cf)](_0x18f4d2(0x1a5)),console['error']('\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context'),console[_0x18f4d2(0x1cf)]('\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent'),0x1;const _0x3acecc=_0x5e56a8[0x0],_0x151cb4=_0x341ad4[_0x18f4d2(0x1cc)];try{if(_0x3acecc==='/')return saveSessionContext({'segment_path':undefined},_0x151cb4),console[_0x18f4d2(0x1c6)](a43_0x57f399[_0x18f4d2(0x1b8)](_0x18f4d2(0x1d2))),0x0;if(existsSync(_0x3acecc)&&statSync(_0x3acecc)[_0x18f4d2(0x1a2)]()){let _0x4e79f2;try{_0x4e79f2=findTdxConfig(_0x3acecc);}catch{return console['error'](a43_0x57f399[_0x18f4d2(0x1cb)](_0x18f4d2(0x1bb)+_0x3acecc)),console[_0x18f4d2(0x1cf)](a43_0x57f399[_0x18f4d2(0x1a7)](_0x18f4d2(0x1b6))),0x1;}const _0x13e697=_0x4e79f2[_0x18f4d2(0x1dc)][_0x18f4d2(0x1b3)];return saveSessionContext({'segment_path':_0x13e697,'parent_segment':_0x13e697},_0x151cb4),console['log'](a43_0x57f399['green'](_0x18f4d2(0x1db)+a43_0x57f399['cyan'](_0x13e697))),0x0;}const _0x51b33f=_0x341ad4['segmentPath'];let _0x2f613a=_0x3acecc;const _0x18ebfe=parsePath(_0x3acecc);if(!_0x18ebfe[_0x18f4d2(0x1b5)]){if(!_0x51b33f)return console[_0x18f4d2(0x1cf)](a43_0x57f399[_0x18f4d2(0x1cb)]('Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.')),console[_0x18f4d2(0x1cf)](a43_0x57f399[_0x18f4d2(0x1a7)](_0x18f4d2(0x1c4))),0x1;if(_0x3acecc==='..'){const _0xe21ea5=_0x51b33f['split']('/')[_0x18f4d2(0x1df)](0x0,-0x1)[_0x18f4d2(0x1cd)]('/');_0x2f613a=_0xe21ea5||'/';}else _0x3acecc==='.'?_0x2f613a=_0x51b33f:_0x2f613a=_0x51b33f+'/'+_0x3acecc;_0x341ad4[_0x18f4d2(0x1d6)]&&console[_0x18f4d2(0x1cf)]('Resolved\x20relative\x20path\x20to:\x20'+_0x2f613a);}if(_0x2f613a==='/'||_0x2f613a==='')return saveSessionContext({'segment_path':undefined},_0x151cb4),console[_0x18f4d2(0x1c6)](a43_0x57f399[_0x18f4d2(0x1b8)](_0x18f4d2(0x1d2))),0x0;_0x2f613a=normalizePath(_0x2f613a);const _0x5c98a5=parsePath(_0x2f613a)[_0x18f4d2(0x1a3)];if(_0x5c98a5[_0x18f4d2(0x1c3)]===0x0)return saveSessionContext({'segment_path':undefined},_0x151cb4),console[_0x18f4d2(0x1c6)](a43_0x57f399[_0x18f4d2(0x1b8)](_0x18f4d2(0x1d2))),0x0;_0x341ad4[_0x18f4d2(0x1d6)]&&(console[_0x18f4d2(0x1cf)](_0x18f4d2(0x1ba)+_0x341ad4[_0x18f4d2(0x1bd)]),console[_0x18f4d2(0x1cf)](_0x18f4d2(0x1b2)+_0x2f613a));const _0x599124=await withSpinner(_0x18f4d2(0x1ce)+_0x2f613a+_0x18f4d2(0x1a4),()=>_0x111bb1[_0x18f4d2(0x1ad)][_0x18f4d2(0x1b9)](_0x2f613a),{'verbose':_0x341ad4['verbose']}),_0x2420fe=_0x599124[_0x18f4d2(0x1da)];_0x341ad4[_0x18f4d2(0x1d6)]&&(console['error'](_0x18f4d2(0x1ae)+_0x2420fe[_0x18f4d2(0x1d1)]),console['error'](_0x18f4d2(0x1bf)+_0x2420fe[_0x18f4d2(0x1aa)]),_0x2420fe[_0x18f4d2(0x1d4)]&&console[_0x18f4d2(0x1cf)](_0x18f4d2(0x1d7)+_0x2420fe[_0x18f4d2(0x1d4)]));if(_0x2420fe[_0x18f4d2(0x1d1)]===_0x18f4d2(0x1ad))return console[_0x18f4d2(0x1cf)](a43_0x57f399[_0x18f4d2(0x1cb)](_0x18f4d2(0x1d9))),console[_0x18f4d2(0x1cf)]('Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.'),console[_0x18f4d2(0x1cf)](a43_0x57f399[_0x18f4d2(0x1a7)](_0x18f4d2(0x1d0)+_0x2420fe['parentName']+(_0x2420fe[_0x18f4d2(0x1ca)]?'/'+_0x2420fe['folderPath'][_0x18f4d2(0x1cd)]('/'):''))),0x1;return saveSessionContext({'segment_path':_0x2420fe['fullPath'],'parent_segment':_0x2420fe[_0x18f4d2(0x1d8)]},_0x151cb4),console['log'](a43_0x57f399[_0x18f4d2(0x1b8)]('✔\x20Context\x20set\x20to:\x20'+a43_0x57f399[_0x18f4d2(0x1a7)](_0x2420fe[_0x18f4d2(0x1c8)]))),_0x341ad4[_0x18f4d2(0x1d6)]&&(console[_0x18f4d2(0x1cf)](a43_0x57f399[_0x18f4d2(0x1af)](_0x18f4d2(0x1a8))),console['error'](a43_0x57f399[_0x18f4d2(0x1af)](_0x18f4d2(0x1b4)))),0x0;}catch(_0x1d4859){throw _0x1d4859;}}}
@@ -1 +1 @@
1
- const a44_0x5cbd9=a44_0x258b;(function(_0x4b363b,_0x30c447){const _0x1f4344=a44_0x258b,_0x5b96af=_0x4b363b();while(!![]){try{const _0x2c9de2=-parseInt(_0x1f4344(0x1a2))/0x1+-parseInt(_0x1f4344(0x193))/0x2*(parseInt(_0x1f4344(0x180))/0x3)+parseInt(_0x1f4344(0x1a8))/0x4*(parseInt(_0x1f4344(0x17b))/0x5)+-parseInt(_0x1f4344(0x17c))/0x6*(parseInt(_0x1f4344(0x196))/0x7)+-parseInt(_0x1f4344(0x184))/0x8+parseInt(_0x1f4344(0x187))/0x9*(parseInt(_0x1f4344(0x192))/0xa)+parseInt(_0x1f4344(0x195))/0xb;if(_0x2c9de2===_0x30c447)break;else _0x5b96af['push'](_0x5b96af['shift']());}catch(_0x14954e){_0x5b96af['push'](_0x5b96af['shift']());}}}(a44_0x282e,0xdd635));function a44_0x258b(_0x1aac20,_0x499fff){_0x1aac20=_0x1aac20-0x175;const _0x282e11=a44_0x282e();let _0x258bf5=_0x282e11[_0x1aac20];return _0x258bf5;}import{BaseCommand}from'./command.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';import a44_0x55bce3 from'chalk';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';function a44_0x282e(){const _0x2749f0=['Usage:\x20tdx\x20sg\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)','description','\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','Validate\x20segment\x20and\x20journey\x20YAML\x20files','440165IjAeZA','warnings','hasErrors','length','parentSegment','Error:\x20','299796ZGbtFg','file','errors','\x20file(s)\x20with\x20errors,\x20','errorCode','\x20error(s)','red','dim','85EdLWGo','1385994UsnGtZ','.yaml','\x20warning(s)','targetDir','12081pDUzQo','Error:\x20Directory\x20not\x20found:\x20','\x20warning(s)\x20found','error','5902040vlLZJy','verbose','✔\x20All\x20','9UyRLsU','.yml','execute','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','validCount','valid','no_parent','yellow','\x20valid','cyan','message','11514820dDYLvt','524LxCLch','helpText','12938002SwiXoL','14lczxRp','warningCount','):\x20','segment:validate','type','log','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a'];a44_0x282e=function(){return _0x2749f0;};return a44_0x282e();}import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class SegmentValidateCommand extends BaseCommand{['name']=a44_0x5cbd9(0x199);[a44_0x5cbd9(0x19e)]=a44_0x5cbd9(0x1a1);async[a44_0x5cbd9(0x189)](_0x129afa){const _0x397831=a44_0x5cbd9,{options:_0x17a0c9,args:_0x17f048}=_0x129afa,_0x172ff7=_0x17a0c9,_0x316bb9=await resolveTarget({'arg':_0x17f048[0x0],'contextParent':_0x17a0c9[_0x397831(0x1a6)],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x316bb9))return _0x316bb9[_0x397831(0x177)]===_0x397831(0x18d)?(console[_0x397831(0x183)](a44_0x55bce3['yellow'](_0x397831(0x19c))),console[_0x397831(0x183)](_0x397831(0x19d)),console[_0x397831(0x183)](_0x397831(0x19f)),console[_0x397831(0x183)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file')):(console['error'](a44_0x55bce3['red'](_0x397831(0x1a7)+_0x316bb9[_0x397831(0x191)]+'\x0a')),_0x316bb9[_0x397831(0x194)]&&console['error'](a44_0x55bce3[_0x397831(0x190)](_0x316bb9[_0x397831(0x194)]))),0x1;const _0x3cf665=_0x316bb9[_0x397831(0x17f)],_0x4e6490=_0x316bb9[_0x397831(0x19a)]===_0x397831(0x1a9)?_0x316bb9['filePath']:undefined;if(!_0x4e6490&&!existsSync(_0x3cf665))return console[_0x397831(0x183)](a44_0x55bce3[_0x397831(0x179)](_0x397831(0x181)+_0x3cf665+'\x0a')),0x1;let _0x5e6051;if(_0x4e6490){if(!_0x4e6490['endsWith'](_0x397831(0x188))&&!_0x4e6490['endsWith'](_0x397831(0x17d)))return console[_0x397831(0x183)](a44_0x55bce3[_0x397831(0x179)](_0x397831(0x1a0)+_0x4e6490+'\x0a')),0x1;_0x5e6051=[_0x4e6490];}else _0x5e6051=findYamlFiles(_0x3cf665);if(_0x5e6051[_0x397831(0x1a5)]===0x0)return console['error'](a44_0x55bce3[_0x397831(0x179)](_0x397831(0x18a)+_0x3cf665+'\x0a')),0x1;const _0x5d706b=validateYamlFiles(_0x5e6051,_0x3cf665),_0x576b05=calculateSummary(_0x5d706b);for(const _0x19c419 of _0x5d706b){if(!isValidationResult(_0x19c419))continue;const {relativePath:_0xf2bc79,source:_0x5331f1,result:_0x1a6ad4,fileType:_0x4266cd}=_0x19c419,_0x326fcf=_0x4266cd;if(_0x1a6ad4[_0x397831(0x18c)]&&_0x1a6ad4[_0x397831(0x1a3)]['length']===0x0)_0x172ff7[_0x397831(0x185)]&&console['log'](a44_0x55bce3['green']('✔\x20'+_0xf2bc79)+a44_0x55bce3[_0x397831(0x17a)]('\x20('+_0x326fcf+')'));else _0x1a6ad4['valid']?(console[_0x397831(0x19b)](a44_0x55bce3[_0x397831(0x18e)]('⚠\x20'+_0xf2bc79)+a44_0x55bce3[_0x397831(0x17a)]('\x20('+_0x326fcf+'):\x20'+_0x1a6ad4[_0x397831(0x1a3)]['length']+_0x397831(0x17e))),console[_0x397831(0x19b)](formatValidationResult(_0x1a6ad4,_0x5331f1,_0xf2bc79))):(console[_0x397831(0x19b)](a44_0x55bce3[_0x397831(0x179)]('✖\x20'+_0xf2bc79)+a44_0x55bce3['dim']('\x20('+_0x326fcf+_0x397831(0x198)+_0x1a6ad4[_0x397831(0x175)][_0x397831(0x1a5)]+_0x397831(0x178))),console['log'](formatValidationResult(_0x1a6ad4,_0x5331f1,_0xf2bc79)));}return console[_0x397831(0x19b)](''),_0x576b05[_0x397831(0x1a4)]?(console[_0x397831(0x19b)](a44_0x55bce3[_0x397831(0x179)]('Validation\x20failed:\x20'+_0x576b05['invalidCount']+_0x397831(0x176)+_0x576b05[_0x397831(0x18b)]+_0x397831(0x18f))),_0x576b05[_0x397831(0x197)]>0x0&&console[_0x397831(0x19b)](a44_0x55bce3[_0x397831(0x18e)](_0x576b05['warningCount']+'\x20warning(s)\x20found')),0x1):(console[_0x397831(0x19b)](a44_0x55bce3['green'](_0x397831(0x186)+_0x576b05['validCount']+'\x20file(s)\x20valid')),_0x576b05[_0x397831(0x197)]>0x0&&console[_0x397831(0x19b)](a44_0x55bce3['yellow'](_0x576b05[_0x397831(0x197)]+_0x397831(0x182))),0x0);}}
1
+ const a44_0x1500cc=a44_0x59c9;(function(_0x5af2df,_0x266ed6){const _0x545e47=a44_0x59c9,_0x2a14e4=_0x5af2df();while(!![]){try{const _0x2712b5=parseInt(_0x545e47(0x1cf))/0x1*(-parseInt(_0x545e47(0x1c7))/0x2)+-parseInt(_0x545e47(0x1d3))/0x3*(parseInt(_0x545e47(0x1f9))/0x4)+-parseInt(_0x545e47(0x1d9))/0x5+-parseInt(_0x545e47(0x1da))/0x6*(-parseInt(_0x545e47(0x1e1))/0x7)+-parseInt(_0x545e47(0x1f3))/0x8+-parseInt(_0x545e47(0x1dd))/0x9*(parseInt(_0x545e47(0x1f5))/0xa)+parseInt(_0x545e47(0x1e7))/0xb;if(_0x2712b5===_0x266ed6)break;else _0x2a14e4['push'](_0x2a14e4['shift']());}catch(_0x4af3c4){_0x2a14e4['push'](_0x2a14e4['shift']());}}}(a44_0x2160,0x4c423));import{BaseCommand}from'./command.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';function a44_0x59c9(_0xb20847,_0x7a969a){_0xb20847=_0xb20847-0x1c5;const _0x2160cf=a44_0x2160();let _0x59c912=_0x2160cf[_0xb20847];return _0x59c912;}function a44_0x2160(){const _0x30c271=['Usage:\x20tdx\x20sg\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)','red','invalidCount','no_parent','83229aVjBQn','endsWith','Error:\x20Directory\x20not\x20found:\x20','.yaml','800430iiQApi','error','Validation\x20failed:\x20','dim','Error:\x20','filePath','2129960SVmKwf','150UfchKU','log','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','189cmRmdB','description','\x20valid','length','61229vGuqcD','\x20file(s)\x20with\x20errors,\x20','errorCode','\x20error(s)','cwd','warnings','21421092tJmDZg','):\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file','\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','errors','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','name','warningCount','parentSegment','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','verbose','cyan','3614632YuwgnJ','message','131330buHkfV','helpText','✔\x20All\x20','green','8NFcxol','yellow','validCount','\x20file(s)\x20valid','4tqMAkL','\x20warning(s)\x20found','valid','execute'];a44_0x2160=function(){return _0x30c271;};return a44_0x2160();}import{existsSync}from'fs';import a44_0x4ed451 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{[a44_0x1500cc(0x1ed)]='segment:validate';[a44_0x1500cc(0x1de)]='Validate\x20segment\x20and\x20journey\x20YAML\x20files';async[a44_0x1500cc(0x1ca)](_0x50be53){const _0x4b5416=a44_0x1500cc,{options:_0x3c7e90,args:_0xf717f4}=_0x50be53,_0x28f23a=_0x3c7e90,_0xf1497d=await resolveTarget({'arg':_0xf717f4[0x0],'contextParent':_0x3c7e90[_0x4b5416(0x1ef)],'cwd':process[_0x4b5416(0x1e5)]()});if(!isSuccessfulResolution(_0xf1497d))return _0xf1497d[_0x4b5416(0x1e3)]===_0x4b5416(0x1ce)?(console[_0x4b5416(0x1d4)](a44_0x4ed451[_0x4b5416(0x1fa)](_0x4b5416(0x1ec))),console[_0x4b5416(0x1d4)](_0x4b5416(0x1cb)),console[_0x4b5416(0x1d4)](_0x4b5416(0x1ea)),console[_0x4b5416(0x1d4)](_0x4b5416(0x1e9))):(console[_0x4b5416(0x1d4)](a44_0x4ed451[_0x4b5416(0x1cc)](_0x4b5416(0x1d7)+_0xf1497d[_0x4b5416(0x1f4)]+'\x0a')),_0xf1497d[_0x4b5416(0x1f6)]&&console[_0x4b5416(0x1d4)](a44_0x4ed451[_0x4b5416(0x1f2)](_0xf1497d[_0x4b5416(0x1f6)]))),0x1;const _0x5db9c9=_0xf1497d['targetDir'],_0x2aa65d=_0xf1497d['type']==='file'?_0xf1497d[_0x4b5416(0x1d8)]:undefined;if(!_0x2aa65d&&!existsSync(_0x5db9c9))return console['error'](a44_0x4ed451['red'](_0x4b5416(0x1d1)+_0x5db9c9+'\x0a')),0x1;let _0x144fa8;if(_0x2aa65d){if(!_0x2aa65d[_0x4b5416(0x1d0)]('.yml')&&!_0x2aa65d[_0x4b5416(0x1d0)](_0x4b5416(0x1d2)))return console['error'](a44_0x4ed451[_0x4b5416(0x1cc)](_0x4b5416(0x1dc)+_0x2aa65d+'\x0a')),0x1;_0x144fa8=[_0x2aa65d];}else _0x144fa8=findYamlFiles(_0x5db9c9);if(_0x144fa8[_0x4b5416(0x1e0)]===0x0)return console[_0x4b5416(0x1d4)](a44_0x4ed451[_0x4b5416(0x1cc)](_0x4b5416(0x1f0)+_0x5db9c9+'\x0a')),0x1;const _0x2088f6=validateYamlFiles(_0x144fa8,_0x5db9c9),_0x45946b=calculateSummary(_0x2088f6);for(const _0x44ee61 of _0x2088f6){if(!isValidationResult(_0x44ee61))continue;const {relativePath:_0x31df0f,source:_0x2f247a,result:_0x333ee8,fileType:_0x5f2afb}=_0x44ee61,_0x59e344=_0x5f2afb;if(_0x333ee8['valid']&&_0x333ee8[_0x4b5416(0x1e6)][_0x4b5416(0x1e0)]===0x0)_0x28f23a[_0x4b5416(0x1f1)]&&console['log'](a44_0x4ed451[_0x4b5416(0x1f8)]('✔\x20'+_0x31df0f)+a44_0x4ed451[_0x4b5416(0x1d6)]('\x20('+_0x59e344+')'));else _0x333ee8[_0x4b5416(0x1c9)]?(console[_0x4b5416(0x1db)](a44_0x4ed451[_0x4b5416(0x1fa)]('⚠\x20'+_0x31df0f)+a44_0x4ed451[_0x4b5416(0x1d6)]('\x20('+_0x59e344+'):\x20'+_0x333ee8[_0x4b5416(0x1e6)][_0x4b5416(0x1e0)]+'\x20warning(s)')),console[_0x4b5416(0x1db)](formatValidationResult(_0x333ee8,_0x2f247a,_0x31df0f))):(console[_0x4b5416(0x1db)](a44_0x4ed451[_0x4b5416(0x1cc)]('✖\x20'+_0x31df0f)+a44_0x4ed451['dim']('\x20('+_0x59e344+_0x4b5416(0x1e8)+_0x333ee8[_0x4b5416(0x1eb)][_0x4b5416(0x1e0)]+_0x4b5416(0x1e4))),console[_0x4b5416(0x1db)](formatValidationResult(_0x333ee8,_0x2f247a,_0x31df0f)));}return console[_0x4b5416(0x1db)](''),_0x45946b['hasErrors']?(console[_0x4b5416(0x1db)](a44_0x4ed451[_0x4b5416(0x1cc)](_0x4b5416(0x1d5)+_0x45946b[_0x4b5416(0x1cd)]+_0x4b5416(0x1e2)+_0x45946b[_0x4b5416(0x1c5)]+_0x4b5416(0x1df))),_0x45946b[_0x4b5416(0x1ee)]>0x0&&console['log'](a44_0x4ed451[_0x4b5416(0x1fa)](_0x45946b[_0x4b5416(0x1ee)]+'\x20warning(s)\x20found')),0x1):(console[_0x4b5416(0x1db)](a44_0x4ed451[_0x4b5416(0x1f8)](_0x4b5416(0x1f7)+_0x45946b['validCount']+_0x4b5416(0x1c6))),_0x45946b[_0x4b5416(0x1ee)]>0x0&&console[_0x4b5416(0x1db)](a44_0x4ed451[_0x4b5416(0x1fa)](_0x45946b[_0x4b5416(0x1ee)]+_0x4b5416(0x1c8))),0x0);}}
@@ -1 +1 @@
1
- const a45_0x1d8d1c=a45_0xfe13;(function(_0x320738,_0x44e74d){const _0x1a4e99=a45_0xfe13,_0x2e330e=_0x320738();while(!![]){try{const _0x154651=-parseInt(_0x1a4e99(0x135))/0x1+-parseInt(_0x1a4e99(0x14e))/0x2*(-parseInt(_0x1a4e99(0x149))/0x3)+parseInt(_0x1a4e99(0x137))/0x4+-parseInt(_0x1a4e99(0x150))/0x5+parseInt(_0x1a4e99(0x118))/0x6*(parseInt(_0x1a4e99(0x11d))/0x7)+parseInt(_0x1a4e99(0x13a))/0x8+-parseInt(_0x1a4e99(0x129))/0x9;if(_0x154651===_0x44e74d)break;else _0x2e330e['push'](_0x2e330e['shift']());}catch(_0x14d1a4){_0x2e330e['push'](_0x2e330e['shift']());}}}(a45_0x3d8f,0x94765));import{BaseCommand}from'./command.js';function a45_0xfe13(_0x64cc9a,_0x711561){_0x64cc9a=_0x64cc9a-0x10d;const _0x3d8fc2=a45_0x3d8f();let _0xfe13ec=_0x3d8fc2[_0x64cc9a];return _0xfe13ec;}import{SDKError}from'../sdk/index.js';function a45_0x3d8f(){const _0x2f2698=['21GRgTQJ','(not\x20set)','filter','listUnifiedWithJourneys','map','description','replace','Recursive\x20mode:\x20enabled','\x20journey','\x20segment','/app/ps/','List\x20folders\x20and\x20child\x20segments','17371539QaTBYp','Resolving\x20parent\x20segment\x20\x27','/j/da','includes','Site:\x20','Building\x20hierarchy\x20tree...','type','listUnified','segments','/e/','\x5c$&','Folder\x20ID:\x20','68357mYFFCs','No\x20items\x20match\x20pattern:\x20','3905704ZYJpmt','localeCompare','dim','7619408nHDMmp','Resolving\x20path\x20\x27','\x20folder','verbose',',\x20and\x20','jsonl','listWithPattern','maxDepth','\x20\x20Cause:\x20','listRecursive','parentId','folder','log','data','journeyBundleName','3mSmyOE','\x27...','journey','sort','(empty)','154262ArQoYQ','segment','1250590BbQDsh','json','✔\x20Found\x20','format','message','test','folderId','name','site','folders','error','children','✔\x20Built\x20tree\x20with\x20','Listing\x20folders,\x20segments,\x20and\x20journeys...','1701528JwAnPB','Parent\x20ID:\x20','length','resolvePathToResource','journeys'];a45_0x3d8f=function(){return _0x2f2698;};return a45_0x3d8f();}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 a45_0x5d8d68 from'chalk';export class SegmentsCommand extends BaseCommand{[a45_0x1d8d1c(0x111)]=a45_0x1d8d1c(0x131);[a45_0x1d8d1c(0x122)]=a45_0x1d8d1c(0x128);async['execute'](_0x277340){const _0x289c46=a45_0x1d8d1c,{options:_0x5862b2,args:_0x9dc6b9}=_0x277340,_0x539ada=_0x5862b2['recursive'],_0x9ed6fb=_0x9dc6b9[0x0];try{const _0x147fe1=_0x5862b2['parentSegment'];_0x5862b2[_0x289c46(0x13d)]&&(console[_0x289c46(0x114)](_0x289c46(0x12d)+_0x5862b2[_0x289c46(0x112)]),console['error']('Parent\x20segment\x20context:\x20'+(_0x147fe1||_0x289c46(0x11e))),_0x9ed6fb&&console[_0x289c46(0x114)]('Folder/pattern\x20arg:\x20'+_0x9ed6fb),_0x539ada&&console[_0x289c46(0x114)](_0x289c46(0x124)));if(!_0x147fe1)return console['error']('Error:\x20No\x20parent\x20segment\x20context\x20set.'),console[_0x289c46(0x114)](''),console[_0x289c46(0x114)]('Set\x20a\x20parent\x20segment\x20context\x20first:'),console[_0x289c46(0x114)]('\x20\x20tdx\x20sg\x20pull\x20\x22My\x20Audience\x22'),console[_0x289c46(0x114)]('\x20\x20tdx\x20sg\x20use\x20\x22My\x20Audience\x22'),console[_0x289c46(0x114)](''),console[_0x289c46(0x114)]('Use\x20tdx\x20ps\x20list\x20to\x20see\x20available\x20parent\x20segments.'),0x1;const _0x5f5c9d=_0x9ed6fb&&(_0x9ed6fb[_0x289c46(0x12c)]('*')||_0x9ed6fb[_0x289c46(0x12c)]('?'));if(_0x5f5c9d)return await this['listWithPattern'](_0x277340,_0x147fe1,_0x9ed6fb);const _0xfd2922=_0x9ed6fb?_0x147fe1+'/'+_0x9ed6fb:_0x147fe1;return _0x539ada?await this[_0x289c46(0x143)](_0x277340,_0xfd2922):await this[_0x289c46(0x130)](_0x277340,_0xfd2922);}catch(_0x57b508){if(_0x57b508 instanceof SDKError)return console[_0x289c46(0x114)]('Error:\x20'+_0x57b508[_0x289c46(0x10e)]),_0x57b508['cause']&&console[_0x289c46(0x114)](_0x289c46(0x142)+_0x57b508['cause']),0x1;throw _0x57b508;}}async[a45_0x1d8d1c(0x140)](_0x1b1920,_0x4a4c73,_0x297ec4){const _0x29946a=a45_0x1d8d1c,{options:_0x366690,tdx:_0x40c460}=_0x1b1920,_0x19bfc6=await withSpinner(_0x29946a(0x12a)+_0x4a4c73+'\x27...',()=>_0x40c460[_0x29946a(0x14f)][_0x29946a(0x11b)](_0x4a4c73),{'verbose':_0x366690['verbose']}),_0x57b352=_0x19bfc6[_0x29946a(0x147)],_0x4eeef4=await withSpinner(_0x29946a(0x117),()=>_0x40c460[_0x29946a(0x14f)][_0x29946a(0x120)](_0x57b352[_0x29946a(0x144)],_0x57b352['folderId']),{'verbose':_0x366690[_0x29946a(0x13d)]}),{folders:_0x3a860b,segments:_0x59e3c7,journeys:_0x20ffef}=_0x4eeef4[_0x29946a(0x147)],_0x2af81c=_0x297ec4['replace'](/[.+^${}()|[\]\\]/g,_0x29946a(0x133))[_0x29946a(0x123)](/\*/g,'.*')[_0x29946a(0x123)](/\?/g,'.'),_0x1c5b41=new RegExp('^'+_0x2af81c+'$','i'),_0x1cd0a2=_0x3a860b['filter'](_0x8ded09=>_0x1c5b41['test'](_0x8ded09[_0x29946a(0x111)])),_0x2a3ff5=_0x59e3c7[_0x29946a(0x11f)](_0x24a71a=>_0x1c5b41['test'](_0x24a71a['name'])),_0x344cf6=_0x20ffef[_0x29946a(0x11f)](_0x26e1d7=>_0x1c5b41[_0x29946a(0x10f)](_0x26e1d7[_0x29946a(0x148)])),_0x24c766=_0x1cd0a2[_0x29946a(0x11a)]+_0x2a3ff5[_0x29946a(0x11a)]+_0x344cf6['length'];console[_0x29946a(0x114)]('✔\x20Found\x20'+_0x1cd0a2[_0x29946a(0x11a)]+_0x29946a(0x13c)+(_0x1cd0a2['length']!==0x1?'s':'')+',\x20'+_0x2a3ff5[_0x29946a(0x11a)]+'\x20segment'+(_0x2a3ff5[_0x29946a(0x11a)]!==0x1?'s':'')+_0x29946a(0x13e)+_0x344cf6[_0x29946a(0x11a)]+_0x29946a(0x125)+(_0x344cf6[_0x29946a(0x11a)]!==0x1?'s':'')+'\x20matching\x20\x27'+_0x297ec4+'\x27');const _0x4da676=_0x2c4491=>{const _0x263db1=_0x29946a;return getConsoleNextUrl(_0x366690[_0x263db1(0x112)],_0x263db1(0x127)+_0x57b352[_0x263db1(0x144)]+'/e/'+_0x2c4491);},_0x16e768=_0x366690[_0x29946a(0x10d)]==='json'||_0x366690[_0x29946a(0x10d)]===_0x29946a(0x13f);if(_0x16e768){const _0x2d422a=[..._0x1cd0a2['map'](_0xefdf72=>({..._0xefdf72,'type':'folder'})),..._0x2a3ff5[_0x29946a(0x121)](_0xb03aff=>({..._0xb03aff,'type':_0x29946a(0x14f),'url':_0x4da676(_0xb03aff['id'])})),..._0x344cf6['map'](_0x2f83a8=>({..._0x2f83a8,'name':_0x2f83a8[_0x29946a(0x148)],'type':_0x29946a(0x14b)}))][_0x29946a(0x14c)]((_0x275346,_0x7da763)=>_0x275346[_0x29946a(0x111)]['localeCompare'](_0x7da763[_0x29946a(0x111)]));await handleSDKOutput(_0x2d422a,_0x366690);}else{if(_0x24c766===0x0)console[_0x29946a(0x146)](_0x29946a(0x136)+_0x297ec4);else{console[_0x29946a(0x146)](a45_0x5d8d68[_0x29946a(0x139)]('['+_0x4a4c73+']\x20matching\x20\x27'+_0x297ec4+'\x27'));const _0x5de5cd=formatFlatList(_0x1cd0a2,_0x2a3ff5,{'showMetadata':!![],'getSegmentUrl':_0x4da676},_0x344cf6);console[_0x29946a(0x146)](_0x5de5cd);}}return 0x0;}async[a45_0x1d8d1c(0x130)](_0x32037c,_0x53be97){const _0x520f3a=a45_0x1d8d1c,{options:_0x3c7c36,tdx:_0x5004b0}=_0x32037c,_0x43fc00=await withSpinner('Resolving\x20path\x20\x27'+_0x53be97+_0x520f3a(0x14a),()=>_0x5004b0[_0x520f3a(0x14f)]['resolvePathToResource'](_0x53be97),{'verbose':_0x3c7c36[_0x520f3a(0x13d)]}),_0x4cd06b=_0x43fc00[_0x520f3a(0x147)];_0x3c7c36[_0x520f3a(0x13d)]&&(console['error'](_0x520f3a(0x119)+_0x4cd06b['parentId']),_0x4cd06b[_0x520f3a(0x110)]&&console['error'](_0x520f3a(0x134)+_0x4cd06b[_0x520f3a(0x110)]));const _0x17b07e=await withSpinner(_0x520f3a(0x117),()=>_0x5004b0[_0x520f3a(0x14f)]['listUnifiedWithJourneys'](_0x4cd06b[_0x520f3a(0x144)],_0x4cd06b[_0x520f3a(0x110)]),{'verbose':_0x3c7c36['verbose']}),{folders:_0x1cbabe,segments:_0x5f5db1,journeys:_0x1b6941}=_0x17b07e['data'],_0x2f085b=_0x1cbabe[_0x520f3a(0x11a)]+_0x5f5db1[_0x520f3a(0x11a)]+_0x1b6941[_0x520f3a(0x11a)];console[_0x520f3a(0x114)](_0x520f3a(0x152)+_0x1cbabe[_0x520f3a(0x11a)]+'\x20folder'+(_0x1cbabe['length']!==0x1?'s':'')+',\x20'+_0x5f5db1[_0x520f3a(0x11a)]+'\x20segment'+(_0x5f5db1['length']!==0x1?'s':'')+_0x520f3a(0x13e)+_0x1b6941[_0x520f3a(0x11a)]+'\x20journey'+(_0x1b6941[_0x520f3a(0x11a)]!==0x1?'s':''));const _0x510917=_0x7eb7d7=>{const _0x416308=_0x520f3a;return getConsoleNextUrl(_0x3c7c36[_0x416308(0x112)],'/app/ps/'+_0x4cd06b[_0x416308(0x144)]+_0x416308(0x132)+_0x7eb7d7);},_0xae829d=_0x3ee0c6=>{const _0x41d4bd=_0x520f3a;return getConsoleNextUrl(_0x3c7c36[_0x41d4bd(0x112)],'/app/ps/'+_0x4cd06b['parentId']+_0x41d4bd(0x132)+_0x3ee0c6+_0x41d4bd(0x12b));},_0x2b36e4=_0x3c7c36[_0x520f3a(0x10d)]===_0x520f3a(0x151)||_0x3c7c36[_0x520f3a(0x10d)]==='jsonl';if(_0x2b36e4){const _0x4f665e=[..._0x1cbabe[_0x520f3a(0x121)](_0x5727eb=>({..._0x5727eb,'type':'folder'})),..._0x5f5db1['map'](_0x3ed6bd=>({..._0x3ed6bd,'type':_0x520f3a(0x14f),'url':_0x510917(_0x3ed6bd['id'])})),..._0x1b6941['map'](_0x151228=>({..._0x151228,'name':_0x151228[_0x520f3a(0x148)],'type':_0x520f3a(0x14b),'url':_0xae829d(_0x151228['id'])}))]['sort']((_0x49b580,_0x3db975)=>_0x49b580['name'][_0x520f3a(0x138)](_0x3db975[_0x520f3a(0x111)]));await handleSDKOutput(_0x4f665e,_0x3c7c36);}else{if(_0x2f085b===0x0)console[_0x520f3a(0x146)](a45_0x5d8d68[_0x520f3a(0x139)]('['+_0x53be97+']')),console[_0x520f3a(0x146)](_0x520f3a(0x14d));else{console[_0x520f3a(0x146)](a45_0x5d8d68[_0x520f3a(0x139)]('['+_0x53be97+']'));const _0x51e750=formatFlatList(_0x1cbabe,_0x5f5db1,{'showMetadata':!![],'getSegmentUrl':_0x510917,'getJourneyUrl':_0xae829d},_0x1b6941);console['log'](_0x51e750);}}return 0x0;}async[a45_0x1d8d1c(0x143)](_0x573427,_0x43cca5){const _0x4ab1ec=a45_0x1d8d1c,{options:_0x4acc4c,tdx:_0x54f512}=_0x573427,_0x3868ae=await withSpinner(_0x4ab1ec(0x13b)+_0x43cca5+_0x4ab1ec(0x14a),()=>_0x54f512['segment']['resolvePathToResource'](_0x43cca5),{'verbose':_0x4acc4c[_0x4ab1ec(0x13d)]}),_0x41479d=_0x3868ae[_0x4ab1ec(0x147)];_0x4acc4c[_0x4ab1ec(0x13d)]&&(console['error'](_0x4ab1ec(0x119)+_0x41479d['parentId']),_0x41479d['folderId']&&console['error'](_0x4ab1ec(0x134)+_0x41479d[_0x4ab1ec(0x110)]));const _0x4232bb=_0x4acc4c[_0x4ab1ec(0x141)]||0xa,_0x4d6ca6=await withSpinner(_0x4ab1ec(0x12e),()=>_0x54f512[_0x4ab1ec(0x14f)][_0x4ab1ec(0x143)](_0x41479d['parentId'],_0x41479d[_0x4ab1ec(0x110)],0x0,_0x4232bb),{'verbose':_0x4acc4c[_0x4ab1ec(0x13d)]}),_0x25a4c9=_0x4d6ca6['data'],_0x5ec367=_0x2d050e=>{const _0x2a8013=_0x4ab1ec;let _0x3d4a06=0x0,_0x3ae748=0x0,_0x470efe=0x0;for(const _0x3450dc of _0x2d050e){if(_0x3450dc['type']===_0x2a8013(0x145))_0x3d4a06++;else{if(_0x3450dc[_0x2a8013(0x12f)]===_0x2a8013(0x14f))_0x3ae748++;else{if(_0x3450dc[_0x2a8013(0x12f)]===_0x2a8013(0x14b))_0x470efe++;}}if(_0x3450dc[_0x2a8013(0x115)]){const _0x176ab2=_0x5ec367(_0x3450dc['children']);_0x3d4a06+=_0x176ab2['folders'],_0x3ae748+=_0x176ab2['segments'],_0x470efe+=_0x176ab2['journeys'];}}return{'folders':_0x3d4a06,'segments':_0x3ae748,'journeys':_0x470efe};},_0x483f56=_0x5ec367(_0x25a4c9);console[_0x4ab1ec(0x114)](_0x4ab1ec(0x116)+_0x483f56['folders']+_0x4ab1ec(0x13c)+(_0x483f56[_0x4ab1ec(0x113)]!==0x1?'s':'')+',\x20'+_0x483f56[_0x4ab1ec(0x131)]+_0x4ab1ec(0x126)+(_0x483f56[_0x4ab1ec(0x131)]!==0x1?'s':'')+_0x4ab1ec(0x13e)+_0x483f56[_0x4ab1ec(0x11c)]+_0x4ab1ec(0x125)+(_0x483f56['journeys']!==0x1?'s':''));const _0x202967=_0x39dad3=>{const _0x1ed341=_0x4ab1ec;return getConsoleNextUrl(_0x4acc4c['site'],_0x1ed341(0x127)+_0x41479d[_0x1ed341(0x144)]+_0x1ed341(0x132)+_0x39dad3);},_0x9fc6c5=_0x8673b3=>{const _0x8a6eb2=_0x4ab1ec;return getConsoleNextUrl(_0x4acc4c[_0x8a6eb2(0x112)],_0x8a6eb2(0x127)+_0x41479d[_0x8a6eb2(0x144)]+_0x8a6eb2(0x132)+_0x8673b3+_0x8a6eb2(0x12b));};if(_0x4acc4c['format']===_0x4ab1ec(0x151)||_0x4acc4c[_0x4ab1ec(0x10d)]===_0x4ab1ec(0x13f))await handleSDKOutput(_0x25a4c9,_0x4acc4c);else{console[_0x4ab1ec(0x146)](a45_0x5d8d68[_0x4ab1ec(0x139)]('['+_0x43cca5+']'));const _0x37d504=formatTree(_0x25a4c9,{'showMetadata':!![],'getSegmentUrl':_0x202967,'getJourneyUrl':_0x9fc6c5});console[_0x4ab1ec(0x146)](_0x37d504);}return 0x0;}}
1
+ const a45_0x19ac6c=a45_0x54c6;(function(_0x518fa9,_0x44b13e){const _0x171c7b=a45_0x54c6,_0x2188a6=_0x518fa9();while(!![]){try{const _0x41355b=-parseInt(_0x171c7b(0xeb))/0x1+parseInt(_0x171c7b(0x115))/0x2+-parseInt(_0x171c7b(0x103))/0x3*(parseInt(_0x171c7b(0x10d))/0x4)+-parseInt(_0x171c7b(0x107))/0x5*(-parseInt(_0x171c7b(0x108))/0x6)+parseInt(_0x171c7b(0xea))/0x7*(parseInt(_0x171c7b(0xd2))/0x8)+-parseInt(_0x171c7b(0xfe))/0x9*(parseInt(_0x171c7b(0xf2))/0xa)+parseInt(_0x171c7b(0x11c))/0xb;if(_0x41355b===_0x44b13e)break;else _0x2188a6['push'](_0x2188a6['shift']());}catch(_0x1e58f5){_0x2188a6['push'](_0x2188a6['shift']());}}}(a45_0x164b,0xa62bc));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';function a45_0x54c6(_0x54d0e0,_0x27854c){_0x54d0e0=_0x54d0e0-0xd2;const _0x164ba6=a45_0x164b();let _0x54c61e=_0x164ba6[_0x54d0e0];return _0x54c61e;}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';function a45_0x164b(){const _0x50667f=['site','4395296FvCFli','resolvePathToResource','/j/da','log','folder','journeyBundleName','folders','filter','1779816BmqhWz','format','listUnified','children','json','✔\x20Built\x20tree\x20with\x20','type','11578303BUfiRl','journeys','listRecursive','maxDepth','/app/ps/','Set\x20a\x20parent\x20segment\x20context\x20first:','1488FyitiG','map','execute','(not\x20set)','\x5c$&','error','(empty)','Resolving\x20path\x20\x27','Building\x20hierarchy\x20tree...','Resolving\x20parent\x20segment\x20\x27','journey','cause','List\x20folders\x20and\x20child\x20segments','listWithPattern','name','\x20\x20tdx\x20sg\x20use\x20\x22My\x20Audience\x22','Parent\x20ID:\x20','message','folderId','test','recursive','\x20\x20tdx\x20sg\x20pull\x20\x22My\x20Audience\x22','Listing\x20folders,\x20segments,\x20and\x20journeys...','Parent\x20segment\x20context:\x20','4186aeAfyQ','649722NGmWBz','Site:\x20','✔\x20Found\x20','replace','\x20journey',',\x20and\x20','\x20folder','30jBlHDw','No\x20items\x20match\x20pattern:\x20','verbose','localeCompare','includes','sort','\x20matching\x20\x27','segment','\x27...','listUnifiedWithJourneys','parentId','parentSegment','531774QVYvLr','data','Error:\x20','jsonl','Folder\x20ID:\x20','3BctgLZ','dim','\x20segment','/e/','5wHkdNq','3316386DzxbxK','length','Use\x20tdx\x20ps\x20list\x20to\x20see\x20available\x20parent\x20segments.','segments'];a45_0x164b=function(){return _0x50667f;};return a45_0x164b();}import a45_0x41ce2e from'chalk';export class SegmentsCommand extends BaseCommand{['name']='segments';['description']=a45_0x19ac6c(0xde);async[a45_0x19ac6c(0xd4)](_0x3ccad7){const _0x46f52a=a45_0x19ac6c,{options:_0x51354a,args:_0x3f5b04}=_0x3ccad7,_0x40482b=_0x51354a[_0x46f52a(0xe6)],_0x298335=_0x3f5b04[0x0];try{const _0x7fc644=_0x51354a[_0x46f52a(0xfd)];_0x51354a[_0x46f52a(0xf4)]&&(console[_0x46f52a(0xd7)](_0x46f52a(0xec)+_0x51354a[_0x46f52a(0x10c)]),console[_0x46f52a(0xd7)](_0x46f52a(0xe9)+(_0x7fc644||_0x46f52a(0xd5))),_0x298335&&console[_0x46f52a(0xd7)]('Folder/pattern\x20arg:\x20'+_0x298335),_0x40482b&&console[_0x46f52a(0xd7)]('Recursive\x20mode:\x20enabled'));if(!_0x7fc644)return console['error']('Error:\x20No\x20parent\x20segment\x20context\x20set.'),console[_0x46f52a(0xd7)](''),console[_0x46f52a(0xd7)](_0x46f52a(0x121)),console[_0x46f52a(0xd7)](_0x46f52a(0xe7)),console[_0x46f52a(0xd7)](_0x46f52a(0xe1)),console[_0x46f52a(0xd7)](''),console[_0x46f52a(0xd7)](_0x46f52a(0x10a)),0x1;const _0xcd4af0=_0x298335&&(_0x298335[_0x46f52a(0xf6)]('*')||_0x298335[_0x46f52a(0xf6)]('?'));if(_0xcd4af0)return await this[_0x46f52a(0xdf)](_0x3ccad7,_0x7fc644,_0x298335);const _0x583f1f=_0x298335?_0x7fc644+'/'+_0x298335:_0x7fc644;return _0x40482b?await this[_0x46f52a(0x11e)](_0x3ccad7,_0x583f1f):await this[_0x46f52a(0x117)](_0x3ccad7,_0x583f1f);}catch(_0xf41aee){if(_0xf41aee instanceof SDKError)return console[_0x46f52a(0xd7)](_0x46f52a(0x100)+_0xf41aee[_0x46f52a(0xe3)]),_0xf41aee[_0x46f52a(0xdd)]&&console[_0x46f52a(0xd7)]('\x20\x20Cause:\x20'+_0xf41aee[_0x46f52a(0xdd)]),0x1;throw _0xf41aee;}}async[a45_0x19ac6c(0xdf)](_0x1a1e5f,_0x358619,_0x173a9c){const _0x44c19d=a45_0x19ac6c,{options:_0x25ec8a,tdx:_0x5f4a73}=_0x1a1e5f,_0xef88ca=await withSpinner(_0x44c19d(0xdb)+_0x358619+_0x44c19d(0xfa),()=>_0x5f4a73[_0x44c19d(0xf9)][_0x44c19d(0x10e)](_0x358619),{'verbose':_0x25ec8a[_0x44c19d(0xf4)]}),_0x143ffc=_0xef88ca[_0x44c19d(0xff)],_0x2a9782=await withSpinner('Listing\x20folders,\x20segments,\x20and\x20journeys...',()=>_0x5f4a73[_0x44c19d(0xf9)][_0x44c19d(0xfb)](_0x143ffc[_0x44c19d(0xfc)],_0x143ffc['folderId']),{'verbose':_0x25ec8a[_0x44c19d(0xf4)]}),{folders:_0x428436,segments:_0x55cfb3,journeys:_0x28bdba}=_0x2a9782[_0x44c19d(0xff)],_0xe902e2=_0x173a9c[_0x44c19d(0xee)](/[.+^${}()|[\]\\]/g,_0x44c19d(0xd6))['replace'](/\*/g,'.*')[_0x44c19d(0xee)](/\?/g,'.'),_0x2e3066=new RegExp('^'+_0xe902e2+'$','i'),_0x1b8a1f=_0x428436[_0x44c19d(0x114)](_0x335341=>_0x2e3066[_0x44c19d(0xe5)](_0x335341[_0x44c19d(0xe0)])),_0x5937=_0x55cfb3[_0x44c19d(0x114)](_0x35c6f3=>_0x2e3066[_0x44c19d(0xe5)](_0x35c6f3[_0x44c19d(0xe0)])),_0x461f4c=_0x28bdba[_0x44c19d(0x114)](_0x3650ef=>_0x2e3066[_0x44c19d(0xe5)](_0x3650ef[_0x44c19d(0x112)])),_0x311156=_0x1b8a1f['length']+_0x5937[_0x44c19d(0x109)]+_0x461f4c[_0x44c19d(0x109)];console['error']('✔\x20Found\x20'+_0x1b8a1f['length']+'\x20folder'+(_0x1b8a1f[_0x44c19d(0x109)]!==0x1?'s':'')+',\x20'+_0x5937['length']+_0x44c19d(0x105)+(_0x5937['length']!==0x1?'s':'')+_0x44c19d(0xf0)+_0x461f4c[_0x44c19d(0x109)]+_0x44c19d(0xef)+(_0x461f4c[_0x44c19d(0x109)]!==0x1?'s':'')+_0x44c19d(0xf8)+_0x173a9c+'\x27');const _0x244f16=_0xf6a778=>{const _0x4510ee=_0x44c19d;return getConsoleNextUrl(_0x25ec8a[_0x4510ee(0x10c)],'/app/ps/'+_0x143ffc[_0x4510ee(0xfc)]+_0x4510ee(0x106)+_0xf6a778);},_0x36e050=_0x25ec8a['format']===_0x44c19d(0x119)||_0x25ec8a['format']===_0x44c19d(0x101);if(_0x36e050){const _0x28bedd=[..._0x1b8a1f['map'](_0x2da042=>({..._0x2da042,'type':_0x44c19d(0x111)})),..._0x5937[_0x44c19d(0xd3)](_0x8e6d75=>({..._0x8e6d75,'type':'segment','url':_0x244f16(_0x8e6d75['id'])})),..._0x461f4c[_0x44c19d(0xd3)](_0x2a4360=>({..._0x2a4360,'name':_0x2a4360[_0x44c19d(0x112)],'type':_0x44c19d(0xdc)}))][_0x44c19d(0xf7)]((_0x10a9ea,_0x42cf77)=>_0x10a9ea['name']['localeCompare'](_0x42cf77['name']));await handleSDKOutput(_0x28bedd,_0x25ec8a);}else{if(_0x311156===0x0)console[_0x44c19d(0x110)](_0x44c19d(0xf3)+_0x173a9c);else{console['log'](a45_0x41ce2e[_0x44c19d(0x104)]('['+_0x358619+']\x20matching\x20\x27'+_0x173a9c+'\x27'));const _0x2ead5d=formatFlatList(_0x1b8a1f,_0x5937,{'showMetadata':!![],'getSegmentUrl':_0x244f16},_0x461f4c);console[_0x44c19d(0x110)](_0x2ead5d);}}return 0x0;}async[a45_0x19ac6c(0x117)](_0x522b1e,_0x2564d6){const _0x49fc5d=a45_0x19ac6c,{options:_0x48d86a,tdx:_0x15bcd8}=_0x522b1e,_0x960d5f=await withSpinner(_0x49fc5d(0xd9)+_0x2564d6+_0x49fc5d(0xfa),()=>_0x15bcd8[_0x49fc5d(0xf9)][_0x49fc5d(0x10e)](_0x2564d6),{'verbose':_0x48d86a[_0x49fc5d(0xf4)]}),_0x97dc54=_0x960d5f[_0x49fc5d(0xff)];_0x48d86a['verbose']&&(console[_0x49fc5d(0xd7)](_0x49fc5d(0xe2)+_0x97dc54['parentId']),_0x97dc54[_0x49fc5d(0xe4)]&&console[_0x49fc5d(0xd7)](_0x49fc5d(0x102)+_0x97dc54[_0x49fc5d(0xe4)]));const _0x5a5569=await withSpinner(_0x49fc5d(0xe8),()=>_0x15bcd8[_0x49fc5d(0xf9)][_0x49fc5d(0xfb)](_0x97dc54['parentId'],_0x97dc54['folderId']),{'verbose':_0x48d86a[_0x49fc5d(0xf4)]}),{folders:_0x50bfe9,segments:_0xccd7d5,journeys:_0x566461}=_0x5a5569[_0x49fc5d(0xff)],_0x279241=_0x50bfe9[_0x49fc5d(0x109)]+_0xccd7d5[_0x49fc5d(0x109)]+_0x566461[_0x49fc5d(0x109)];console['error'](_0x49fc5d(0xed)+_0x50bfe9[_0x49fc5d(0x109)]+'\x20folder'+(_0x50bfe9[_0x49fc5d(0x109)]!==0x1?'s':'')+',\x20'+_0xccd7d5['length']+_0x49fc5d(0x105)+(_0xccd7d5[_0x49fc5d(0x109)]!==0x1?'s':'')+_0x49fc5d(0xf0)+_0x566461[_0x49fc5d(0x109)]+'\x20journey'+(_0x566461[_0x49fc5d(0x109)]!==0x1?'s':''));const _0x5eafe7=_0xcded01=>{const _0x244cd7=_0x49fc5d;return getConsoleNextUrl(_0x48d86a[_0x244cd7(0x10c)],'/app/ps/'+_0x97dc54[_0x244cd7(0xfc)]+_0x244cd7(0x106)+_0xcded01);},_0x449db7=_0xbe9a88=>{const _0x26d73d=_0x49fc5d;return getConsoleNextUrl(_0x48d86a['site'],_0x26d73d(0x120)+_0x97dc54[_0x26d73d(0xfc)]+_0x26d73d(0x106)+_0xbe9a88+_0x26d73d(0x10f));},_0x5436ec=_0x48d86a[_0x49fc5d(0x116)]==='json'||_0x48d86a['format']==='jsonl';if(_0x5436ec){const _0x10d6d2=[..._0x50bfe9[_0x49fc5d(0xd3)](_0x24735e=>({..._0x24735e,'type':'folder'})),..._0xccd7d5[_0x49fc5d(0xd3)](_0x207d5f=>({..._0x207d5f,'type':'segment','url':_0x5eafe7(_0x207d5f['id'])})),..._0x566461[_0x49fc5d(0xd3)](_0x5794e2=>({..._0x5794e2,'name':_0x5794e2['journeyBundleName'],'type':_0x49fc5d(0xdc),'url':_0x449db7(_0x5794e2['id'])}))][_0x49fc5d(0xf7)]((_0x578aa9,_0x47d9d5)=>_0x578aa9[_0x49fc5d(0xe0)][_0x49fc5d(0xf5)](_0x47d9d5[_0x49fc5d(0xe0)]));await handleSDKOutput(_0x10d6d2,_0x48d86a);}else{if(_0x279241===0x0)console['log'](a45_0x41ce2e['dim']('['+_0x2564d6+']')),console['log'](_0x49fc5d(0xd8));else{console['log'](a45_0x41ce2e[_0x49fc5d(0x104)]('['+_0x2564d6+']'));const _0x474b9d=formatFlatList(_0x50bfe9,_0xccd7d5,{'showMetadata':!![],'getSegmentUrl':_0x5eafe7,'getJourneyUrl':_0x449db7},_0x566461);console[_0x49fc5d(0x110)](_0x474b9d);}}return 0x0;}async[a45_0x19ac6c(0x11e)](_0x12d27d,_0x5da05a){const _0x312b44=a45_0x19ac6c,{options:_0x1bb9ae,tdx:_0x14c651}=_0x12d27d,_0x11d68e=await withSpinner(_0x312b44(0xd9)+_0x5da05a+'\x27...',()=>_0x14c651['segment'][_0x312b44(0x10e)](_0x5da05a),{'verbose':_0x1bb9ae[_0x312b44(0xf4)]}),_0x537cc5=_0x11d68e[_0x312b44(0xff)];_0x1bb9ae[_0x312b44(0xf4)]&&(console['error']('Parent\x20ID:\x20'+_0x537cc5[_0x312b44(0xfc)]),_0x537cc5[_0x312b44(0xe4)]&&console[_0x312b44(0xd7)]('Folder\x20ID:\x20'+_0x537cc5[_0x312b44(0xe4)]));const _0x530a01=_0x1bb9ae[_0x312b44(0x11f)]||0xa,_0x535c02=await withSpinner(_0x312b44(0xda),()=>_0x14c651[_0x312b44(0xf9)][_0x312b44(0x11e)](_0x537cc5[_0x312b44(0xfc)],_0x537cc5[_0x312b44(0xe4)],0x0,_0x530a01),{'verbose':_0x1bb9ae[_0x312b44(0xf4)]}),_0x42d3a0=_0x535c02[_0x312b44(0xff)],_0x4d9c38=_0x305f33=>{const _0x1ca879=_0x312b44;let _0x2910ec=0x0,_0x3220ad=0x0,_0xad2a94=0x0;for(const _0x2b5731 of _0x305f33){if(_0x2b5731[_0x1ca879(0x11b)]===_0x1ca879(0x111))_0x2910ec++;else{if(_0x2b5731['type']===_0x1ca879(0xf9))_0x3220ad++;else{if(_0x2b5731[_0x1ca879(0x11b)]===_0x1ca879(0xdc))_0xad2a94++;}}if(_0x2b5731[_0x1ca879(0x118)]){const _0x5aafc8=_0x4d9c38(_0x2b5731[_0x1ca879(0x118)]);_0x2910ec+=_0x5aafc8[_0x1ca879(0x113)],_0x3220ad+=_0x5aafc8['segments'],_0xad2a94+=_0x5aafc8[_0x1ca879(0x11d)];}}return{'folders':_0x2910ec,'segments':_0x3220ad,'journeys':_0xad2a94};},_0x37e57a=_0x4d9c38(_0x42d3a0);console[_0x312b44(0xd7)](_0x312b44(0x11a)+_0x37e57a[_0x312b44(0x113)]+_0x312b44(0xf1)+(_0x37e57a[_0x312b44(0x113)]!==0x1?'s':'')+',\x20'+_0x37e57a['segments']+'\x20segment'+(_0x37e57a[_0x312b44(0x10b)]!==0x1?'s':'')+',\x20and\x20'+_0x37e57a[_0x312b44(0x11d)]+'\x20journey'+(_0x37e57a[_0x312b44(0x11d)]!==0x1?'s':''));const _0x40dcfd=_0x22e4f5=>{const _0x28d99b=_0x312b44;return getConsoleNextUrl(_0x1bb9ae[_0x28d99b(0x10c)],_0x28d99b(0x120)+_0x537cc5[_0x28d99b(0xfc)]+_0x28d99b(0x106)+_0x22e4f5);},_0xac9482=_0x1a3de6=>{const _0x30c1d1=_0x312b44;return getConsoleNextUrl(_0x1bb9ae[_0x30c1d1(0x10c)],_0x30c1d1(0x120)+_0x537cc5['parentId']+'/e/'+_0x1a3de6+_0x30c1d1(0x10f));};if(_0x1bb9ae[_0x312b44(0x116)]===_0x312b44(0x119)||_0x1bb9ae[_0x312b44(0x116)]===_0x312b44(0x101))await handleSDKOutput(_0x42d3a0,_0x1bb9ae);else{console[_0x312b44(0x110)](a45_0x41ce2e[_0x312b44(0x104)]('['+_0x5da05a+']'));const _0x658af5=formatTree(_0x42d3a0,{'showMetadata':!![],'getSegmentUrl':_0x40dcfd,'getJourneyUrl':_0xac9482});console[_0x312b44(0x110)](_0x658af5);}return 0x0;}}
@@ -1 +1 @@
1
- const a46_0x4bbb7d=a46_0x3554;(function(_0x5b0eae,_0x1d65c2){const _0x53b4de=a46_0x3554,_0x18785d=_0x5b0eae();while(!![]){try{const _0x14f7e6=parseInt(_0x53b4de(0x1f4))/0x1+parseInt(_0x53b4de(0x1e4))/0x2+parseInt(_0x53b4de(0x1f6))/0x3*(-parseInt(_0x53b4de(0x1df))/0x4)+parseInt(_0x53b4de(0x1dd))/0x5*(-parseInt(_0x53b4de(0x1da))/0x6)+parseInt(_0x53b4de(0x1fd))/0x7*(parseInt(_0x53b4de(0x1d8))/0x8)+-parseInt(_0x53b4de(0x1f8))/0x9+-parseInt(_0x53b4de(0x1e5))/0xa;if(_0x14f7e6===_0x1d65c2)break;else _0x18785d['push'](_0x18785d['shift']());}catch(_0x2f0a9c){_0x18785d['push'](_0x18785d['shift']());}}}(a46_0x4542,0xbaedb));function a46_0x3554(_0x12355d,_0x5258ea){_0x12355d=_0x12355d-0x1d7;const _0x4542d0=a46_0x4542();let _0x35549f=_0x4542d0[_0x12355d];return _0x35549f;}import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';import{parseTableReference,validateTableDescribeReference}from'../utils/table-ref-parser.js';import{withSpinner}from'../utils/spinner.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';export class ShowCommand extends BaseCommand{['name']=a46_0x4bbb7d(0x1ff);[a46_0x4bbb7d(0x1e6)]='Show\x20table\x20contents';async[a46_0x4bbb7d(0x1d9)](_0x316273){const _0xefa8d6=a46_0x4bbb7d;return this[_0xefa8d6(0x1d7)](_0x316273);}async[a46_0x4bbb7d(0x1d7)](_0xbfd1e1){const _0xa807d2=a46_0x4bbb7d,{options:_0xe08325,args:_0x48cfcb,tdx:_0x4a64de}=_0xbfd1e1;let _0x420869;try{_0x420869=parseTableReference(_0x48cfcb[0x0]);const _0x55584a=_0xe08325[_0xa807d2(0x1ed)];!_0x420869[_0xa807d2(0x1ed)]&&_0x55584a&&(_0x420869[_0xa807d2(0x1ed)]=_0x55584a);const _0xe2c931=validateTableDescribeReference(_0x420869);if(_0xe2c931)return console[_0xa807d2(0x1f5)](_0xa807d2(0x1eb)+_0xe2c931),console[_0xa807d2(0x1f5)](_0xa807d2(0x1fb)),console['error'](_0xa807d2(0x1fe)),console[_0xa807d2(0x1f5)]('\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>'),0x1;}catch(_0x3d559a){return console[_0xa807d2(0x1f5)](_0xa807d2(0x1eb)+_0x3d559a[_0xa807d2(0x1f9)]),console['error']('Usage:\x20tdx\x20show\x20<database.table>'),console['error']('\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>'),console[_0xa807d2(0x1f5)]('\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>'),0x1;}const _0x85ca28=_0x420869[_0xa807d2(0x1f3)],_0x2c5096=_0x420869['database'],_0x17c44a=_0x420869[_0xa807d2(0x1e9)],_0xfaf376=resolveLimit(_0xe08325[_0xa807d2(0x1f2)],DEFAULT_DISPLAY_LIMIT);try{_0xe08325[_0xa807d2(0x1f7)]&&(console['error'](_0xa807d2(0x1f0)+_0xe08325[_0xa807d2(0x1ee)]),_0x85ca28&&console['error'](_0xa807d2(0x1dc)+_0x85ca28),console[_0xa807d2(0x1f5)](_0xa807d2(0x1f1)+_0x2c5096),console[_0xa807d2(0x1f5)](_0xa807d2(0x1fa)+_0x17c44a),console[_0xa807d2(0x1f5)](_0xa807d2(0x1ea)+_0xfaf376));const _0x2c94a8=_0x85ca28?_0x85ca28+'.'+_0x2c5096+'.'+_0x17c44a:_0x2c5096+'.'+_0x17c44a,_0x4b567e=await withSpinner(_0xa807d2(0x1e0)+_0x2c94a8+_0xa807d2(0x1e3),()=>_0x4a64de[_0xa807d2(0x1de)][_0xa807d2(0x1d7)](_0x2c5096,_0x17c44a,_0xfaf376,_0x85ca28),{'verbose':_0xe08325['verbose']}),_0x1e7cae=_0x4b567e[_0xa807d2(0x1e1)],_0x52e068=_0x1e7cae[_0xa807d2(0x1e1)];return _0x52e068[_0xa807d2(0x1e7)]===0x0?console[_0xa807d2(0x1f5)](_0xa807d2(0x1e8)):console[_0xa807d2(0x1f5)](_0xa807d2(0x1e2)+_0x52e068[_0xa807d2(0x1e7)]+'\x20row'+(_0x52e068[_0xa807d2(0x1e7)]!==0x1?'s':'')+_0xa807d2(0x1ef)+_0x2c94a8),await handleSDKOutput(_0x52e068,_0xe08325),0x0;}catch(_0x2e0a22){if(_0x2e0a22 instanceof SDKError)return console['error'](_0xa807d2(0x1eb)+_0x2e0a22[_0xa807d2(0x1f9)]),_0x2e0a22['cause']&&console[_0xa807d2(0x1f5)](_0xa807d2(0x1ec)+_0x2e0a22['cause']),0x1;throw _0x2e0a22;}}['validate'](_0x155bb4){const _0x41fd01=a46_0x4bbb7d;if(_0x155bb4[_0x41fd01(0x1fc)][_0x41fd01(0x1e7)]===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(_0x155bb4[_0x41fd01(0x1fc)][_0x41fd01(0x1e7)]>0x1)return _0x41fd01(0x1db);return undefined;}}function a46_0x4542(){const _0xaf41ee=['Limit:\x20','Error:\x20','\x20\x20Cause:\x20','database','site','\x20from\x20','Site:\x20','Database:\x20','limit','catalog','1450845avrAwH','error','202956WKzJcz','verbose','10232010kBRnEu','message','Table:\x20','Usage:\x20tdx\x20show\x20<database.table>','args','511532kuhAat','\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>','show','showTable','16QktTrw','execute','2254254oEJwAe','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','Catalog:\x20','5FRijyv','query','8hBsodZ','Querying\x20','data','✔\x20Retrieved\x20','...','1871378CdCvJC','1191240FYNCjK','description','length','✔\x20Query\x20successful\x20-\x200\x20rows\x20returned','table'];a46_0x4542=function(){return _0xaf41ee;};return a46_0x4542();}
1
+ function a46_0x36d5(){const _0x241e03=['args','\x20\x20Cause:\x20','4914734mKjGMY','✔\x20Retrieved\x20','description','Catalog:\x20','Site:\x20','Usage:\x20tdx\x20show\x20<database.table>','length','2013920JZeceN','verbose','showTable','data','\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>','site','27SPtbcy','cause','176651mLMyUR','\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>','✔\x20Query\x20successful\x20-\x200\x20rows\x20returned','...','Limit:\x20','database','message','error','150450pzegDK','2057391mZmyTM','50504jcWSHx','validate','\x20from\x20','Error:\x20','6OgdHLP','catalog','execute','query','Querying\x20','Database:\x20','Table:\x20','show','24YlqrmP','name','1827030sIrtIm','9oMtsEi','\x20row','36oFlRdp','table'];a46_0x36d5=function(){return _0x241e03;};return a46_0x36d5();}const a46_0x41454f=a46_0x32ae;(function(_0x5d1a35,_0x2bff71){const _0x9090ff=a46_0x32ae,_0x6d7c4e=_0x5d1a35();while(!![]){try{const _0xf4b6cb=-parseInt(_0x9090ff(0x174))/0x1*(parseInt(_0x9090ff(0x182))/0x2)+parseInt(_0x9090ff(0x172))/0x3*(-parseInt(_0x9090ff(0x17e))/0x4)+-parseInt(_0x9090ff(0x17c))/0x5*(parseInt(_0x9090ff(0x18f))/0x6)+parseInt(_0x9090ff(0x17d))/0x7+-parseInt(_0x9090ff(0x16c))/0x8+parseInt(_0x9090ff(0x18d))/0x9*(parseInt(_0x9090ff(0x18c))/0xa)+-parseInt(_0x9090ff(0x193))/0xb*(-parseInt(_0x9090ff(0x18a))/0xc);if(_0xf4b6cb===_0x2bff71)break;else _0x6d7c4e['push'](_0x6d7c4e['shift']());}catch(_0x4151ba){_0x6d7c4e['push'](_0x6d7c4e['shift']());}}}(a46_0x36d5,0x47dc1));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';function a46_0x32ae(_0x14d55d,_0x1a03dc){_0x14d55d=_0x14d55d-0x166;const _0x36d52c=a46_0x36d5();let _0x32ae19=_0x36d52c[_0x14d55d];return _0x32ae19;}import{handleSDKOutput}from'../core/command-output.js';import{parseTableReference,validateTableDescribeReference}from'../utils/table-ref-parser.js';import{withSpinner}from'../utils/spinner.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';export class ShowCommand extends BaseCommand{[a46_0x41454f(0x18b)]=a46_0x41454f(0x189);[a46_0x41454f(0x167)]='Show\x20table\x20contents';async[a46_0x41454f(0x184)](_0x1ae5e0){return this['showTable'](_0x1ae5e0);}async[a46_0x41454f(0x16e)](_0x103132){const _0x37130e=a46_0x41454f,{options:_0x13b915,args:_0x14f230,tdx:_0x3075c4}=_0x103132;let _0x4d9a62;try{_0x4d9a62=parseTableReference(_0x14f230[0x0]);const _0x4fca16=_0x13b915[_0x37130e(0x179)];!_0x4d9a62[_0x37130e(0x179)]&&_0x4fca16&&(_0x4d9a62[_0x37130e(0x179)]=_0x4fca16);const _0x52f10c=validateTableDescribeReference(_0x4d9a62);if(_0x52f10c)return console[_0x37130e(0x17b)]('Error:\x20'+_0x52f10c),console[_0x37130e(0x17b)](_0x37130e(0x16a)),console[_0x37130e(0x17b)](_0x37130e(0x170)),console[_0x37130e(0x17b)](_0x37130e(0x175)),0x1;}catch(_0x4f312e){return console[_0x37130e(0x17b)](_0x37130e(0x181)+_0x4f312e[_0x37130e(0x17a)]),console[_0x37130e(0x17b)](_0x37130e(0x16a)),console['error']('\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>'),console[_0x37130e(0x17b)](_0x37130e(0x175)),0x1;}const _0x834882=_0x4d9a62[_0x37130e(0x183)],_0x40a5c8=_0x4d9a62[_0x37130e(0x179)],_0x5bc9a=_0x4d9a62[_0x37130e(0x190)],_0x4ea3b9=resolveLimit(_0x13b915['limit'],DEFAULT_DISPLAY_LIMIT);try{_0x13b915[_0x37130e(0x16d)]&&(console['error'](_0x37130e(0x169)+_0x13b915[_0x37130e(0x171)]),_0x834882&&console[_0x37130e(0x17b)](_0x37130e(0x168)+_0x834882),console['error'](_0x37130e(0x187)+_0x40a5c8),console['error'](_0x37130e(0x188)+_0x5bc9a),console[_0x37130e(0x17b)](_0x37130e(0x178)+_0x4ea3b9));const _0x59145b=_0x834882?_0x834882+'.'+_0x40a5c8+'.'+_0x5bc9a:_0x40a5c8+'.'+_0x5bc9a,_0x1b439c=await withSpinner(_0x37130e(0x186)+_0x59145b+_0x37130e(0x177),()=>_0x3075c4[_0x37130e(0x185)][_0x37130e(0x16e)](_0x40a5c8,_0x5bc9a,_0x4ea3b9,_0x834882),{'verbose':_0x13b915[_0x37130e(0x16d)]}),_0x251b7a=_0x1b439c[_0x37130e(0x16f)],_0x2f8800=_0x251b7a['data'];return _0x2f8800[_0x37130e(0x16b)]===0x0?console[_0x37130e(0x17b)](_0x37130e(0x176)):console[_0x37130e(0x17b)](_0x37130e(0x166)+_0x2f8800[_0x37130e(0x16b)]+_0x37130e(0x18e)+(_0x2f8800[_0x37130e(0x16b)]!==0x1?'s':'')+_0x37130e(0x180)+_0x59145b),await handleSDKOutput(_0x2f8800,_0x13b915),0x0;}catch(_0x574d6c){if(_0x574d6c instanceof SDKError)return console[_0x37130e(0x17b)]('Error:\x20'+_0x574d6c['message']),_0x574d6c[_0x37130e(0x173)]&&console[_0x37130e(0x17b)](_0x37130e(0x192)+_0x574d6c[_0x37130e(0x173)]),0x1;throw _0x574d6c;}}[a46_0x41454f(0x17f)](_0x7ce766){const _0x3bc39b=a46_0x41454f;if(_0x7ce766['args'][_0x3bc39b(0x16b)]===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(_0x7ce766[_0x3bc39b(0x191)][_0x3bc39b(0x16b)]>0x1)return'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';return undefined;}}
@@ -1 +1 @@
1
- const a47_0xbe5982=a47_0x283a;(function(_0x2432bf,_0x1d2fa9){const _0x312ba4=a47_0x283a,_0x22a72a=_0x2432bf();while(!![]){try{const _0x2feb4e=parseInt(_0x312ba4(0x1a5))/0x1+-parseInt(_0x312ba4(0x1cd))/0x2*(-parseInt(_0x312ba4(0x1bd))/0x3)+-parseInt(_0x312ba4(0x1be))/0x4*(parseInt(_0x312ba4(0x1c3))/0x5)+-parseInt(_0x312ba4(0x1b0))/0x6*(parseInt(_0x312ba4(0x1b8))/0x7)+parseInt(_0x312ba4(0x1c6))/0x8*(-parseInt(_0x312ba4(0x1aa))/0x9)+parseInt(_0x312ba4(0x1cc))/0xa*(-parseInt(_0x312ba4(0x1cb))/0xb)+parseInt(_0x312ba4(0x1d0))/0xc*(parseInt(_0x312ba4(0x1b9))/0xd);if(_0x2feb4e===_0x1d2fa9)break;else _0x22a72a['push'](_0x22a72a['shift']());}catch(_0x39670c){_0x22a72a['push'](_0x22a72a['shift']());}}}(a47_0x1e7f,0x3745d));import{BaseCommand,printAuthError}from'./command.js';import{resolveAPIKeyAsync}from'../core/config.js';import{getOAuthTokens}from'../core/oauth-keychain.js';import{HTTPClientError}from'../sdk/client/http-client.js';function a47_0x1e7f(){const _0x3a4d84=['OAuth','email','N/A','session','907355CwrwTn','CLI\x20flag','yellow','2385512acxklM','site','first_name','account_id','env','11sIYEVs','1800620jmRsWp','14vjAUMu','description','name','60soKqIu','✗\x20Validation\x20failed:\x20','log','execute','cyan','filter','dim','green','status','profileSource','87174TBoWtO','Account\x20ID:','last_name','join','\x20profile:\x20','9okgfPj','No\x20credential\x20found','User:','getUserInfo','Show\x20authentication\x20status\x20and\x20current\x20context','Read\x20credential\x20from\x20','930018ftkFIq','cli','(from\x20','site:\x20','message','error','red','jobs','7KGNuyy','2202122TshTPb','tdx','bold','profile','123621OyNvTk','8ojONQU'];a47_0x1e7f=function(){return _0x3a4d84;};return a47_0x1e7f();}function a47_0x283a(_0x43aeb1,_0x3aaa2e){_0x43aeb1=_0x43aeb1-0x19f;const _0x1e7fbb=a47_0x1e7f();let _0x283ac7=_0x1e7fbb[_0x43aeb1];return _0x283ac7;}import{GlobalContext}from'../core/global-context.js';import a47_0x21bc7c from'chalk';export class StatusCommand extends BaseCommand{[a47_0xbe5982(0x1cf)]=a47_0xbe5982(0x1a3);[a47_0xbe5982(0x1ce)]=a47_0xbe5982(0x1ae);async[a47_0xbe5982(0x1d3)](_0x24bc47){const _0x1083af=a47_0xbe5982,{options:_0x1293a1,tdx:_0x238704}=_0x24bc47,_0x685537=_0x1293a1[_0x1083af(0x1c7)],_0x2beb30=new GlobalContext(_0x1293a1),_0x592216=_0x2beb30[_0x1083af(0x1bc)],_0x28fc77=_0x2beb30[_0x1083af(0x1a4)],_0x3ba875=_0x28fc77===_0x1083af(0x1b1)?_0x1083af(0x1c4):_0x28fc77===_0x1083af(0x1c2)?'session':_0x28fc77===_0x1083af(0x1ca)?'TDX_PROFILE\x20env':_0x28fc77==='config'?'config':null,_0xf5119a=_0x592216?a47_0x21bc7c[_0x1083af(0x19f)](_0x592216):a47_0x21bc7c[_0x1083af(0x1a1)](_0x1083af(0x1c1)),_0x4e3b57=_0x3ba875?'\x20'+a47_0x21bc7c[_0x1083af(0x1a1)](_0x1083af(0x1b2)+_0x3ba875+')'):'';console[_0x1083af(0x1d2)](a47_0x21bc7c['bold'](_0x1083af(0x1ba))+_0x1083af(0x1a9)+_0xf5119a+_0x4e3b57+'\x20'+a47_0x21bc7c[_0x1083af(0x1a1)]('(')+_0x1083af(0x1b3)+a47_0x21bc7c[_0x1083af(0x19f)](_0x685537)+a47_0x21bc7c[_0x1083af(0x1a1)](')'));const _0x4cfd43=await getOAuthTokens(_0x592216);if(_0x4cfd43)console[_0x1083af(0x1d2)]('Credential\x20type:\x20'+a47_0x21bc7c[_0x1083af(0x19f)](_0x1083af(0x1bf)));else{const _0x1e4247=await resolveAPIKeyAsync(_0x685537,_0x592216);if(_0x1e4247){const {source:_0x132877,isDeprecated:_0x375663}=_0x1e4247,_0x5bc6cf=_0x1083af(0x1af)+a47_0x21bc7c[_0x1083af(0x19f)](_0x132877);console[_0x1083af(0x1d2)](_0x375663?a47_0x21bc7c[_0x1083af(0x1c5)](_0x5bc6cf):_0x5bc6cf);}else console[_0x1083af(0x1d2)](a47_0x21bc7c[_0x1083af(0x1c5)](_0x1083af(0x1ab)));}let _0x3c1109=![];try{const _0x40fe67=await _0x238704[_0x1083af(0x1b7)][_0x1083af(0x1ad)]();console[_0x1083af(0x1d2)](a47_0x21bc7c[_0x1083af(0x1a2)]('✓\x20Authentication\x20successful\x0a')),console['log'](a47_0x21bc7c[_0x1083af(0x1bb)](_0x1083af(0x1ac))+'\x20'+a47_0x21bc7c[_0x1083af(0x19f)](_0x40fe67[_0x1083af(0x1c0)]));if(_0x40fe67[_0x1083af(0x1c8)]||_0x40fe67[_0x1083af(0x1a7)]){const _0x49ec84=[_0x40fe67[_0x1083af(0x1c8)],_0x40fe67[_0x1083af(0x1a7)]][_0x1083af(0x1a0)](Boolean)[_0x1083af(0x1a8)]('\x20');console[_0x1083af(0x1d2)](a47_0x21bc7c['bold']('Name:')+'\x20'+_0x49ec84);}_0x40fe67[_0x1083af(0x1c9)]&&console[_0x1083af(0x1d2)](a47_0x21bc7c['bold'](_0x1083af(0x1a6))+'\x20'+a47_0x21bc7c[_0x1083af(0x1c5)](_0x40fe67[_0x1083af(0x1c9)])),_0x3c1109=!![];}catch(_0x3b0075){_0x3b0075 instanceof HTTPClientError&&_0x3b0075[_0x1083af(0x1a3)]===0x191?printAuthError(_0x3b0075,!![],_0x592216):console[_0x1083af(0x1b5)](a47_0x21bc7c[_0x1083af(0x1b6)](_0x1083af(0x1d1)+(_0x3b0075 instanceof Error?_0x3b0075[_0x1083af(0x1b4)]:String(_0x3b0075))));}return console['log'](),_0x2beb30['displayWithSources'](),_0x3c1109?0x0:0x1;}}
1
+ function a47_0x32d3(){const _0xbcb22b=['profile','bold','config','tdx','log','User:','filter','1850904tnpuhI','email','(from\x20','Credential\x20type:\x20','jobs','message','account_id','Name:','green','session','description','execute','profileSource','getUserInfo','4oigzei','N/A','site','first_name','1795473zmOvCR','last_name','Account\x20ID:','join','CLI\x20flag','1420895yfzsNQ','dim','yellow','1411879BCBsrW','status','1299504qimoZL','OAuth','Show\x20authentication\x20status\x20and\x20current\x20context','TDX_PROFILE\x20env','✗\x20Validation\x20failed:\x20','405366bpUDbl','site:\x20','182mlCDUU','cyan','3779eIDrvC'];a47_0x32d3=function(){return _0xbcb22b;};return a47_0x32d3();}const a47_0x207f8b=a47_0x4c71;(function(_0x4045e4,_0xb0a26a){const _0x286539=a47_0x4c71,_0xc52860=_0x4045e4();while(!![]){try{const _0xde2944=parseInt(_0x286539(0x13b))/0x1*(-parseInt(_0x286539(0x139))/0x2)+parseInt(_0x286539(0x137))/0x3+parseInt(_0x286539(0x124))/0x4*(parseInt(_0x286539(0x12d))/0x5)+parseInt(_0x286539(0x143))/0x6+-parseInt(_0x286539(0x130))/0x7+-parseInt(_0x286539(0x132))/0x8+parseInt(_0x286539(0x128))/0x9;if(_0xde2944===_0xb0a26a)break;else _0xc52860['push'](_0xc52860['shift']());}catch(_0x434932){_0xc52860['push'](_0xc52860['shift']());}}}(a47_0x32d3,0x3587a));import{BaseCommand,printAuthError}from'./command.js';function a47_0x4c71(_0x463b78,_0x47a2dc){_0x463b78=_0x463b78-0x117;const _0x32d38a=a47_0x32d3();let _0x4c71ef=_0x32d38a[_0x463b78];return _0x4c71ef;}import{resolveAPIKeyAsync}from'../core/config.js';import{getOAuthTokens}from'../core/oauth-keychain.js';import{HTTPClientError}from'../sdk/client/http-client.js';import{GlobalContext}from'../core/global-context.js';import a47_0x42a08d from'chalk';export class StatusCommand extends BaseCommand{['name']=a47_0x207f8b(0x131);[a47_0x207f8b(0x120)]=a47_0x207f8b(0x134);async[a47_0x207f8b(0x121)](_0x23d950){const _0x151113=a47_0x207f8b,{options:_0x306fc4,tdx:_0x2d01fc}=_0x23d950,_0x192e7d=_0x306fc4[_0x151113(0x126)],_0x1f678a=new GlobalContext(_0x306fc4),_0x27c9da=_0x1f678a[_0x151113(0x13c)],_0x2df265=_0x1f678a[_0x151113(0x122)],_0x34f58f=_0x2df265==='cli'?_0x151113(0x12c):_0x2df265===_0x151113(0x11f)?_0x151113(0x11f):_0x2df265==='env'?_0x151113(0x135):_0x2df265===_0x151113(0x13e)?_0x151113(0x13e):null,_0x39d5be=_0x27c9da?a47_0x42a08d[_0x151113(0x13a)](_0x27c9da):a47_0x42a08d[_0x151113(0x12e)](_0x151113(0x125)),_0x2f9ba7=_0x34f58f?'\x20'+a47_0x42a08d['dim'](_0x151113(0x118)+_0x34f58f+')'):'';console['log'](a47_0x42a08d[_0x151113(0x13d)](_0x151113(0x13f))+'\x20profile:\x20'+_0x39d5be+_0x2f9ba7+'\x20'+a47_0x42a08d[_0x151113(0x12e)]('(')+_0x151113(0x138)+a47_0x42a08d[_0x151113(0x13a)](_0x192e7d)+a47_0x42a08d[_0x151113(0x12e)](')'));const _0x526883=await getOAuthTokens(_0x27c9da);if(_0x526883)console[_0x151113(0x140)](_0x151113(0x119)+a47_0x42a08d['cyan'](_0x151113(0x133)));else{const _0x298856=await resolveAPIKeyAsync(_0x192e7d,_0x27c9da);if(_0x298856){const {source:_0x46d98a,isDeprecated:_0x2f133b}=_0x298856,_0x16567='Read\x20credential\x20from\x20'+a47_0x42a08d[_0x151113(0x13a)](_0x46d98a);console[_0x151113(0x140)](_0x2f133b?a47_0x42a08d['yellow'](_0x16567):_0x16567);}else console[_0x151113(0x140)](a47_0x42a08d[_0x151113(0x12f)]('No\x20credential\x20found'));}let _0x202725=![];try{const _0x3b1291=await _0x2d01fc[_0x151113(0x11a)][_0x151113(0x123)]();console['log'](a47_0x42a08d[_0x151113(0x11e)]('✓\x20Authentication\x20successful\x0a')),console[_0x151113(0x140)](a47_0x42a08d['bold'](_0x151113(0x141))+'\x20'+a47_0x42a08d[_0x151113(0x13a)](_0x3b1291[_0x151113(0x117)]));if(_0x3b1291[_0x151113(0x127)]||_0x3b1291[_0x151113(0x129)]){const _0x5417ba=[_0x3b1291['first_name'],_0x3b1291[_0x151113(0x129)]][_0x151113(0x142)](Boolean)[_0x151113(0x12b)]('\x20');console[_0x151113(0x140)](a47_0x42a08d[_0x151113(0x13d)](_0x151113(0x11d))+'\x20'+_0x5417ba);}_0x3b1291['account_id']&&console[_0x151113(0x140)](a47_0x42a08d[_0x151113(0x13d)](_0x151113(0x12a))+'\x20'+a47_0x42a08d[_0x151113(0x12f)](_0x3b1291[_0x151113(0x11c)])),_0x202725=!![];}catch(_0x34bdf5){_0x34bdf5 instanceof HTTPClientError&&_0x34bdf5['status']===0x191?printAuthError(_0x34bdf5,!![],_0x27c9da):console['error'](a47_0x42a08d['red'](_0x151113(0x136)+(_0x34bdf5 instanceof Error?_0x34bdf5[_0x151113(0x11b)]:String(_0x34bdf5))));}return console['log'](),_0x1f678a['displayWithSources'](),_0x202725?0x0:0x1;}}