@treasuredata/tdx 2026.4.11 → 2026.4.12

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 (232) 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.d.ts +1 -0
  68. package/dist/core/profile.d.ts.map +1 -1
  69. package/dist/core/profile.js +1 -1
  70. package/dist/core/profile.js.map +1 -1
  71. package/dist/core/project-config.js +1 -1
  72. package/dist/core/session.js +1 -1
  73. package/dist/core/user-cache.js +1 -1
  74. package/dist/core/version.js +1 -1
  75. package/dist/index.js +1 -1
  76. package/dist/mcp/server.js +1 -1
  77. package/dist/mcp/tools/index.js +1 -1
  78. package/dist/mcp/tools/tdx-run.js +1 -1
  79. package/dist/mcp/tools/tdx-search.js +1 -1
  80. package/dist/mcp/tools/work-create-item.js +1 -1
  81. package/dist/mcp/utils.js +1 -1
  82. package/dist/proxy/claude-usage-tracker.js +1 -1
  83. package/dist/proxy/passthrough-server.js +1 -1
  84. package/dist/proxy/sse-usage-parser.js +1 -1
  85. package/dist/sdk/agent/agent-config.js +1 -1
  86. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  87. package/dist/sdk/agent/agent-yaml.js +1 -1
  88. package/dist/sdk/agent/test/evaluator.js +1 -1
  89. package/dist/sdk/agent/test/executor.js +1 -1
  90. package/dist/sdk/agent/test/index.js +1 -1
  91. package/dist/sdk/agent/test/output.js +1 -1
  92. package/dist/sdk/agent/test/parser.js +1 -1
  93. package/dist/sdk/agent/tool-target-registry.js +1 -1
  94. package/dist/sdk/api.js +1 -1
  95. package/dist/sdk/cas/cas-api-client.js +1 -1
  96. package/dist/sdk/cas/cas-audience-yaml.js +1 -1
  97. package/dist/sdk/cas/cas-segment-yaml.js +1 -1
  98. package/dist/sdk/cas/index.js +1 -1
  99. package/dist/sdk/cas/pull-workflow.js +1 -1
  100. package/dist/sdk/cas/push-workflow.js +1 -1
  101. package/dist/sdk/client/cdp-api-client.js +1 -1
  102. package/dist/sdk/client/delivery-api-client.js +1 -1
  103. package/dist/sdk/client/endpoints.js +1 -1
  104. package/dist/sdk/client/engage-api-client.js +1 -1
  105. package/dist/sdk/client/http-client.js +1 -1
  106. package/dist/sdk/client/llm-api-client.js +1 -1
  107. package/dist/sdk/client/oauth-refresh.js +1 -1
  108. package/dist/sdk/client/rate-limiter.js +1 -1
  109. package/dist/sdk/client/td-api-client.js +1 -1
  110. package/dist/sdk/client/trino-api-client.js +1 -1
  111. package/dist/sdk/client/workflow-client.js +1 -1
  112. package/dist/sdk/connection-validator.js +1 -1
  113. package/dist/sdk/connection.js +1 -1
  114. package/dist/sdk/delivery.js +1 -1
  115. package/dist/sdk/engage/campaign-pull.js +1 -1
  116. package/dist/sdk/engage/campaign-push.js +1 -1
  117. package/dist/sdk/engage/campaign-validator.js +1 -1
  118. package/dist/sdk/engage/campaign-yaml.js +1 -1
  119. package/dist/sdk/engage/template-pull.js +1 -1
  120. package/dist/sdk/engage/template-push.js +1 -1
  121. package/dist/sdk/engage/template-validator.js +1 -1
  122. package/dist/sdk/engage/template-yaml.js +1 -1
  123. package/dist/sdk/engage/types/campaign-def.js +1 -1
  124. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  125. package/dist/sdk/engage/types/template-schema.js +1 -1
  126. package/dist/sdk/engage.js +1 -1
  127. package/dist/sdk/errors.js +1 -1
  128. package/dist/sdk/index.js +1 -1
  129. package/dist/sdk/io/index.js +1 -1
  130. package/dist/sdk/io/node-filesystem.js +1 -1
  131. package/dist/sdk/job.js +1 -1
  132. package/dist/sdk/journey.d.ts +6 -0
  133. package/dist/sdk/journey.d.ts.map +1 -1
  134. package/dist/sdk/journey.js +1 -1
  135. package/dist/sdk/journey.js.map +1 -1
  136. package/dist/sdk/llm/chat-cache.js +1 -1
  137. package/dist/sdk/llm/index.js +1 -1
  138. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  139. package/dist/sdk/llm/model-factors.js +1 -1
  140. package/dist/sdk/personalization.js +1 -1
  141. package/dist/sdk/policy.js +1 -1
  142. package/dist/sdk/query/index.js +1 -1
  143. package/dist/sdk/query/sql-parser.js +1 -1
  144. package/dist/sdk/realtime.js +1 -1
  145. package/dist/sdk/schedule.js +1 -1
  146. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  147. package/dist/sdk/segment/fields-display.js +1 -1
  148. package/dist/sdk/segment/file-discovery.js +1 -1
  149. package/dist/sdk/segment/journey-utils.js +1 -1
  150. package/dist/sdk/segment/journey-validator.js +1 -1
  151. package/dist/sdk/segment/journey-yaml.js +1 -1
  152. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  153. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  154. package/dist/sdk/segment/pull-workflow.js +1 -1
  155. package/dist/sdk/segment/push-recovery.js +1 -1
  156. package/dist/sdk/segment/push-workflow.js +1 -1
  157. package/dist/sdk/segment/resolution-context.js +1 -1
  158. package/dist/sdk/segment/segment-path-parser.js +1 -1
  159. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  160. package/dist/sdk/segment/segment-validator.js +1 -1
  161. package/dist/sdk/segment/target-resolution.js +1 -1
  162. package/dist/sdk/segment/tdx-config.js +1 -1
  163. package/dist/sdk/segment/types/activation-schema.js +1 -1
  164. package/dist/sdk/segment/types/journey-def.js +1 -1
  165. package/dist/sdk/segment/types/journey-schema.js +1 -1
  166. package/dist/sdk/segment/types/segment-def.js +1 -1
  167. package/dist/sdk/segment/types/segment-schema.js +1 -1
  168. package/dist/sdk/segment/validate-files.js +1 -1
  169. package/dist/sdk/segment/yaml-validator.js +1 -1
  170. package/dist/sdk/segment.js +1 -1
  171. package/dist/sdk/types/index.js +1 -1
  172. package/dist/sdk/types/progress.js +1 -1
  173. package/dist/sdk/types/workspace.d.ts +2 -0
  174. package/dist/sdk/types/workspace.d.ts.map +1 -1
  175. package/dist/sdk/types/workspace.js +1 -1
  176. package/dist/sdk/user.js +1 -1
  177. package/dist/sdk/util/format-detector.js +1 -1
  178. package/dist/sdk/util/formatters.js +1 -1
  179. package/dist/sdk/util/index.js +1 -1
  180. package/dist/sdk/util/paginate.js +1 -1
  181. package/dist/sdk/util/tree-formatter.js +1 -1
  182. package/dist/sdk/workflow/archive-validation.js +1 -1
  183. package/dist/sdk/workflow/clone-workflow.js +1 -1
  184. package/dist/sdk/workflow/index.js +1 -1
  185. package/dist/sdk/workflow/pull-workflow.js +1 -1
  186. package/dist/sdk/workflow/push-workflow.js +1 -1
  187. package/dist/sdk/workflow/tdx-config.js +1 -1
  188. package/dist/sdk/workflow/workflow-utils.js +1 -1
  189. package/dist/sdk/workspace/access-tracker.js +1 -1
  190. package/dist/sdk/workspace/frontmatter.js +1 -1
  191. package/dist/sdk/workspace/git.js +1 -1
  192. package/dist/sdk/workspace/index.d.ts.map +1 -1
  193. package/dist/sdk/workspace/index.js +1 -1
  194. package/dist/sdk/workspace/index.js.map +1 -1
  195. package/dist/sdk/workspace/templates.d.ts.map +1 -1
  196. package/dist/sdk/workspace/templates.js +1 -1
  197. package/dist/sdk/workspace/templates.js.map +1 -1
  198. package/dist/sdk/workspace/weekly.js +1 -1
  199. package/dist/sdk/workspace/wikilinks.js +1 -1
  200. package/dist/test-utils/command-runner.js +1 -1
  201. package/dist/test-utils/factories.js +1 -1
  202. package/dist/test-utils/fixtures.js +1 -1
  203. package/dist/test-utils/http-mock.js +1 -1
  204. package/dist/test-utils/index.js +1 -1
  205. package/dist/utils/async.js +1 -1
  206. package/dist/utils/colors.js +1 -1
  207. package/dist/utils/diff.js +1 -1
  208. package/dist/utils/file-permissions.js +1 -1
  209. package/dist/utils/file-reader.js +1 -1
  210. package/dist/utils/github-releases.js +1 -1
  211. package/dist/utils/global-cache.js +1 -1
  212. package/dist/utils/json-loader.js +1 -1
  213. package/dist/utils/local-cache.js +1 -1
  214. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  215. package/dist/utils/logger/formatters/index.js +1 -1
  216. package/dist/utils/logger/handlers/console-handler.js +1 -1
  217. package/dist/utils/logger/handlers/file-handler.js +1 -1
  218. package/dist/utils/logger/handlers/index.js +1 -1
  219. package/dist/utils/logger/handlers/null-handler.js +1 -1
  220. package/dist/utils/logger/index.js +1 -1
  221. package/dist/utils/logger/logger.js +1 -1
  222. package/dist/utils/logger/types.js +1 -1
  223. package/dist/utils/option-validation.js +1 -1
  224. package/dist/utils/process.js +1 -1
  225. package/dist/utils/prompt.js +1 -1
  226. package/dist/utils/spinner.js +1 -1
  227. package/dist/utils/sse-parser.js +1 -1
  228. package/dist/utils/string-utils.js +1 -1
  229. package/dist/utils/table-ref-parser.js +1 -1
  230. package/dist/utils/tdx-logger.js +1 -1
  231. package/dist/utils/version-check.js +1 -1
  232. package/package.json +1 -1
@@ -1 +1 @@
1
- const a40_0x3d9a7e=a40_0x1e85;function a40_0xfc32(){const _0x450377=['segment:pull','red','dim','journeyVersions','478985KwfhDP','11484552EfZmFD','data','16aAVcJF','-\x20no\x20files\x20written','relativePath','cyan','name','content','absolutePath','isNew','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','counts','Aborted.','parent_segment','files','error','29015aPTXba','segments','\x20changed\x20files','302508Cvasbv','yellow','journeys','9NAkcvW','parentName','dryRun','dirname','\x20versions)','description','filter','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent','No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27','resourceName','\x0aError:','✔\x20All\x20files\x20are\x20up\x20to\x20date','file','repeat','helpText','11uZYYRe','utf-8','\x20\x20🎯\x20','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','type','Pulling\x20segments\x20from\x20\x27','\x20files\x20to\x20','parentSegment','6721030LbZZFN','verbose','286506lKpPkU','✔\x20Context\x20set:\x20','diff','Error:\x20','segment','errorCode','green','\x20segments','576714FOWlwL','Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files','setPhase','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)','\x20unchanged\x20files','length','cwd','no_parent','yes','\x20with\x20','✔\x20Pulled\x20','\x20journeys','targetDir','\x20files?','pullSegments','\x20\x20Target:\x20','Site:\x20','session','104LhnGVS','\x20=\x20','site','hasChanges','65LQCuhB'];a40_0xfc32=function(){return _0x450377;};return a40_0xfc32();}(function(_0xf4a518,_0x54f8b5){const _0x561b8c=a40_0x1e85,_0x6d3e08=_0xf4a518();while(!![]){try{const _0x49fed1=parseInt(_0x561b8c(0x1fc))/0x1+parseInt(_0x561b8c(0x1d9))/0x2+-parseInt(_0x561b8c(0x1e1))/0x3*(-parseInt(_0x561b8c(0x1ff))/0x4)+-parseInt(_0x561b8c(0x1f7))/0x5*(parseInt(_0x561b8c(0x210))/0x6)+-parseInt(_0x561b8c(0x20d))/0x7*(parseInt(_0x561b8c(0x1f3))/0x8)+parseInt(_0x561b8c(0x213))/0x9*(parseInt(_0x561b8c(0x1d7))/0xa)+parseInt(_0x561b8c(0x1cf))/0xb*(-parseInt(_0x561b8c(0x1fd))/0xc);if(_0x49fed1===_0x54f8b5)break;else _0x6d3e08['push'](_0x6d3e08['shift']());}catch(_0x13e8dc){_0x6d3e08['push'](_0x6d3e08['shift']());}}}(a40_0xfc32,0x60e80));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{saveSessionContext}from'../core/session.js';function a40_0x1e85(_0x2ae6ef,_0x3d7391){_0x2ae6ef=_0x2ae6ef-0x1c5;const _0xfc3276=a40_0xfc32();let _0x1e8522=_0xfc3276[_0x2ae6ef];return _0x1e8522;}import a40_0x2e7528 from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';import a40_0x52efa5 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{[a40_0x3d9a7e(0x203)]=a40_0x3d9a7e(0x1f8);[a40_0x3d9a7e(0x1c5)]=a40_0x3d9a7e(0x1e2);async['execute'](_0x1fdd92){const _0x23ee08=a40_0x3d9a7e,{options:_0x5af5cd,args:_0x58adee,tdx:_0x243af7}=_0x1fdd92,_0x43dbf8=_0x5af5cd,_0xb81fc9=await resolveTarget({'arg':_0x58adee[0x0],'contextParent':_0x5af5cd[_0x23ee08(0x1d6)],'cwd':process[_0x23ee08(0x1e7)]()});if(!isSuccessfulResolution(_0xb81fc9))return _0xb81fc9[_0x23ee08(0x1de)]===_0x23ee08(0x1e8)?(console[_0x23ee08(0x20c)](a40_0x2e7528['yellow']('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console['error'](_0x23ee08(0x1e4)),console['error'](_0x23ee08(0x1c7)),console['error']('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file')):(console['error'](a40_0x2e7528['red'](_0x23ee08(0x1dc)+_0xb81fc9['message']+'\x0a')),_0xb81fc9[_0x23ee08(0x1ce)]&&console[_0x23ee08(0x20c)](a40_0x2e7528[_0x23ee08(0x202)](_0xb81fc9[_0x23ee08(0x1ce)]))),0x1;const _0x392f19=_0xb81fc9[_0x23ee08(0x214)],_0x4fd702=_0xb81fc9['targetDir'],_0x15fa4b=_0xb81fc9[_0x23ee08(0x1d3)]===_0x23ee08(0x1cc)?_0xb81fc9[_0x23ee08(0x1c9)]:undefined;_0x43dbf8[_0x23ee08(0x1d8)]&&(console[_0x23ee08(0x20c)](_0x23ee08(0x1f1)+_0x43dbf8[_0x23ee08(0x1f5)]),console[_0x23ee08(0x20c)]('Parent\x20segment:\x20'+_0x392f19),_0x15fa4b&&console[_0x23ee08(0x20c)]('Target\x20resource:\x20'+_0x15fa4b));const _0x554a32=await withProgressSpinner(_0x23ee08(0x1d4)+_0x392f19+'\x27...',_0x24551a=>_0x243af7[_0x23ee08(0x1dd)][_0x23ee08(0x1ef)](_0x392f19,{'targetDir':_0x4fd702,'targetResourceName':_0x15fa4b,'verbose':_0x43dbf8[_0x23ee08(0x1d8)],'progress':{'update':_0xd47b56=>{const _0x473fb4=_0x23ee08;_0x24551a[_0x473fb4(0x1e3)](_0xd47b56),_0x43dbf8[_0x473fb4(0x1d8)]&&console['error']('\x20\x20'+_0xd47b56);}}}),{'verbose':_0x43dbf8[_0x23ee08(0x1d8)]}),_0x5f743b=_0x554a32[_0x23ee08(0x1fe)];if(_0x5f743b[_0x23ee08(0x208)][_0x23ee08(0x20e)]===0x0&&_0x5f743b['counts'][_0x23ee08(0x212)]===0x0)return console[_0x23ee08(0x20c)](a40_0x2e7528['yellow'](_0x23ee08(0x1c8)+_0x5f743b[_0x23ee08(0x214)]+'\x27')),0x0;const _0x4507a7=_0x5f743b[_0x23ee08(0x20b)]['filter'](_0x18d51d=>_0x18d51d[_0x23ee08(0x206)]),_0x52241b=_0x5f743b[_0x23ee08(0x20b)]['filter'](_0x740745=>!_0x740745[_0x23ee08(0x206)]&&_0x740745[_0x23ee08(0x1f6)]),_0x40634a=_0x5f743b[_0x23ee08(0x20b)][_0x23ee08(0x1c6)](_0x5cf3ff=>!_0x5cf3ff['isNew']&&!_0x5cf3ff[_0x23ee08(0x1f6)]);console[_0x23ee08(0x20c)]('\x0aPull\x20summary\x20for\x20\x27'+_0x5f743b[_0x23ee08(0x214)]+'\x27:'),console[_0x23ee08(0x20c)](_0x23ee08(0x1d1)+a40_0x2e7528[_0x23ee08(0x202)](_0x5f743b[_0x23ee08(0x208)][_0x23ee08(0x20e)]+_0x23ee08(0x1e0))+_0x23ee08(0x1ea)+a40_0x2e7528[_0x23ee08(0x202)](_0x5f743b[_0x23ee08(0x208)]['activations']+'\x20activations'));if(_0x5f743b['counts']['journeys']>0x0){const _0x2b5546=_0x5f743b[_0x23ee08(0x208)][_0x23ee08(0x1fb)]>_0x5f743b[_0x23ee08(0x208)][_0x23ee08(0x212)]?'\x20('+_0x5f743b[_0x23ee08(0x208)][_0x23ee08(0x1fb)]+_0x23ee08(0x217):'';console[_0x23ee08(0x20c)]('\x20\x20🗺️\x20\x20'+a40_0x2e7528[_0x23ee08(0x202)](_0x5f743b['counts'][_0x23ee08(0x212)]+_0x23ee08(0x1ec))+a40_0x2e7528[_0x23ee08(0x1fa)](_0x2b5546));}console['error']('\x20\x20'+a40_0x2e7528[_0x23ee08(0x1df)]('+\x20'+_0x4507a7[_0x23ee08(0x1e6)]+'\x20new\x20files')),console['error']('\x20\x20'+a40_0x2e7528['yellow']('~\x20'+_0x52241b[_0x23ee08(0x1e6)]+_0x23ee08(0x20f))),console[_0x23ee08(0x20c)]('\x20\x20'+a40_0x2e7528['dim']('=\x20'+_0x40634a['length']+_0x23ee08(0x1e5))),console['error'](_0x23ee08(0x1f0)+a40_0x2e7528[_0x23ee08(0x202)](_0x5f743b[_0x23ee08(0x1ed)])+'\x0a');if(_0x52241b[_0x23ee08(0x1e6)]>0x0)for(const _0x850f2f of _0x52241b){console[_0x23ee08(0x20c)]('\x0aChanges\x20to\x20\x27'+_0x850f2f[_0x23ee08(0x201)]+'\x27:'),console[_0x23ee08(0x20c)]('─'[_0x23ee08(0x1cd)](0x3c)),console['error'](_0x850f2f[_0x23ee08(0x1db)]),console['error']('─'[_0x23ee08(0x1cd)](0x3c));}if(_0x43dbf8[_0x23ee08(0x215)])return console[_0x23ee08(0x20c)](a40_0x2e7528['yellow']('\x0a[Dry\x20run]\x20No\x20files\x20were\x20written')),0x0;if(_0x4507a7[_0x23ee08(0x1e6)]===0x0&&_0x52241b[_0x23ee08(0x1e6)]===0x0)return console[_0x23ee08(0x20c)](a40_0x2e7528[_0x23ee08(0x1df)](_0x23ee08(0x1cb))),saveSessionContext({'parent_segment':_0x5f743b['parentName']},_0x43dbf8['session']),console['error'](a40_0x2e7528[_0x23ee08(0x1df)](_0x23ee08(0x1da)+a40_0x2e7528[_0x23ee08(0x1fa)](_0x23ee08(0x20a))+_0x23ee08(0x1f4)+a40_0x2e7528[_0x23ee08(0x202)](_0x5f743b[_0x23ee08(0x214)]))),0x0;if(!_0x43dbf8[_0x23ee08(0x1e9)]){if(!isInteractive())return console[_0x23ee08(0x20c)](a40_0x2e7528[_0x23ee08(0x1f9)](_0x23ee08(0x1ca)),_0x23ee08(0x1d2)),console[_0x23ee08(0x20c)](a40_0x2e7528[_0x23ee08(0x1fa)](_0x23ee08(0x207))),0x1;const _0x120bd2=await confirmKey('Write\x20'+(_0x4507a7[_0x23ee08(0x1e6)]+_0x52241b[_0x23ee08(0x1e6)])+_0x23ee08(0x1ee));if(!_0x120bd2)return console['error'](a40_0x2e7528[_0x23ee08(0x211)](_0x23ee08(0x209)),_0x23ee08(0x200)),0x1;}for(const _0x13ac17 of _0x5f743b['files']){if(_0x13ac17[_0x23ee08(0x206)]||_0x13ac17[_0x23ee08(0x1f6)]){const _0x258822=a40_0x52efa5[_0x23ee08(0x216)](_0x13ac17[_0x23ee08(0x205)]);!existsSync(_0x258822)&&mkdirSync(_0x258822,{'recursive':!![]}),writeFileSync(_0x13ac17[_0x23ee08(0x205)],_0x13ac17[_0x23ee08(0x204)],_0x23ee08(0x1d0));}}return console[_0x23ee08(0x20c)](a40_0x2e7528[_0x23ee08(0x1df)](_0x23ee08(0x1eb)+(_0x4507a7[_0x23ee08(0x1e6)]+_0x52241b[_0x23ee08(0x1e6)])+_0x23ee08(0x1d5)+_0x5f743b[_0x23ee08(0x1ed)])),saveSessionContext({'parent_segment':_0x5f743b['parentName']},_0x43dbf8[_0x23ee08(0x1f2)]),console[_0x23ee08(0x20c)](a40_0x2e7528[_0x23ee08(0x1df)](_0x23ee08(0x1da)+a40_0x2e7528[_0x23ee08(0x1fa)]('parent_segment')+'\x20=\x20'+a40_0x2e7528[_0x23ee08(0x202)](_0x5f743b['parentName']))),0x0;}}
1
+ const a40_0x13ccb2=a40_0x4fec;(function(_0x4903e6,_0x14d376){const _0x5542a7=a40_0x4fec,_0x280b45=_0x4903e6();while(!![]){try{const _0x34ebb9=parseInt(_0x5542a7(0xcf))/0x1*(parseInt(_0x5542a7(0xe8))/0x2)+parseInt(_0x5542a7(0xaf))/0x3*(parseInt(_0x5542a7(0xca))/0x4)+parseInt(_0x5542a7(0xae))/0x5*(-parseInt(_0x5542a7(0xe5))/0x6)+-parseInt(_0x5542a7(0xd8))/0x7*(-parseInt(_0x5542a7(0xee))/0x8)+parseInt(_0x5542a7(0xd9))/0x9+parseInt(_0x5542a7(0xb8))/0xa+-parseInt(_0x5542a7(0xb1))/0xb;if(_0x34ebb9===_0x14d376)break;else _0x280b45['push'](_0x280b45['shift']());}catch(_0x26fe68){_0x280b45['push'](_0x280b45['shift']());}}}(a40_0x2396,0x273ce));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';function a40_0x2396(){const _0xa451ca=['no_parent','execute','length','isNew','parentSegment','file','filter','journeys','995064qFtesT','\x20activations','files','2RattEN','yellow','content','segment:pull','\x0aError:','parentName','2390448IRbQaT','parent_segment','counts','hasChanges','\x20changed\x20files','data','\x20versions)','error','\x20files\x20to\x20','✔\x20Context\x20set:\x20','Target\x20resource:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent','-\x20no\x20files\x20written','segments','journeyVersions','repeat','5wxWQSU','9FzazJr','red','5081725fkCDty','cyan','\x20=\x20','yes','\x20unchanged\x20files','segment','pullSegments','540020bUgYFd','setPhase','green','\x27...','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','errorCode','Aborted.','Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files','Pulling\x20segments\x20from\x20\x27','helpText','site','message','\x20journeys','\x20with\x20','\x0aPull\x20summary\x20for\x20\x27','\x20\x20🎯\x20','relativePath','✔\x20Pulled\x20','297324PDMaND','verbose','cwd','\x20new\x20files','type','159437aKAcvR','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','\x20segments','\x20files?','targetDir','\x0aChanges\x20to\x20\x27','\x20\x20🗺️\x20\x20','Site:\x20','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','7cwUlRQ','479691AeDZYX','\x20\x20Target:\x20','dim','absolutePath'];a40_0x2396=function(){return _0xa451ca;};return a40_0x2396();}import{confirmKey,isInteractive}from'../utils/prompt.js';import{saveSessionContext}from'../core/session.js';import a40_0x494e3e from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';import a40_0x27d48c from'path';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';export{buildFolderIdToPathMap as buildFolderPathMap}from'../sdk/segment/resolution-context.js';function a40_0x4fec(_0x1a57eb,_0xd24e73){_0x1a57eb=_0x1a57eb-0xab;const _0x239663=a40_0x2396();let _0x4fec32=_0x239663[_0x1a57eb];return _0x4fec32;}export class SegmentPullCommand extends BaseCommand{['name']=a40_0x13ccb2(0xeb);['description']=a40_0x13ccb2(0xbf);async[a40_0x13ccb2(0xde)](_0x5e3999){const _0x1e9e18=a40_0x13ccb2,{options:_0x1a87f7,args:_0x392260,tdx:_0x2db320}=_0x5e3999,_0x1d9cd2=_0x1a87f7,_0x4a49b0=await resolveTarget({'arg':_0x392260[0x0],'contextParent':_0x1a87f7[_0x1e9e18(0xe1)],'cwd':process[_0x1e9e18(0xcc)]()});if(!isSuccessfulResolution(_0x4a49b0))return _0x4a49b0[_0x1e9e18(0xbd)]===_0x1e9e18(0xdd)?(console[_0x1e9e18(0xf5)](a40_0x494e3e[_0x1e9e18(0xe9)](_0x1e9e18(0xd0))),console[_0x1e9e18(0xf5)]('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'](_0x1e9e18(0xf9)),console[_0x1e9e18(0xf5)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file')):(console['error'](a40_0x494e3e[_0x1e9e18(0xb0)]('Error:\x20'+_0x4a49b0[_0x1e9e18(0xc3)]+'\x0a')),_0x4a49b0[_0x1e9e18(0xc1)]&&console[_0x1e9e18(0xf5)](a40_0x494e3e[_0x1e9e18(0xb2)](_0x4a49b0['helpText']))),0x1;const _0x556cc5=_0x4a49b0[_0x1e9e18(0xed)],_0x3086a4=_0x4a49b0[_0x1e9e18(0xd3)],_0x3be90b=_0x4a49b0[_0x1e9e18(0xce)]===_0x1e9e18(0xe2)?_0x4a49b0['resourceName']:undefined;_0x1d9cd2[_0x1e9e18(0xcb)]&&(console['error'](_0x1e9e18(0xd6)+_0x1d9cd2[_0x1e9e18(0xc2)]),console[_0x1e9e18(0xf5)]('Parent\x20segment:\x20'+_0x556cc5),_0x3be90b&&console[_0x1e9e18(0xf5)](_0x1e9e18(0xf8)+_0x3be90b));const _0x1a42cb=await withProgressSpinner(_0x1e9e18(0xc0)+_0x556cc5+_0x1e9e18(0xbb),_0x422a5b=>_0x2db320[_0x1e9e18(0xb6)][_0x1e9e18(0xb7)](_0x556cc5,{'targetDir':_0x3086a4,'targetResourceName':_0x3be90b,'verbose':_0x1d9cd2[_0x1e9e18(0xcb)],'progress':{'update':_0x5b17b8=>{const _0x10dccf=_0x1e9e18;_0x422a5b[_0x10dccf(0xb9)](_0x5b17b8),_0x1d9cd2[_0x10dccf(0xcb)]&&console[_0x10dccf(0xf5)]('\x20\x20'+_0x5b17b8);}}}),{'verbose':_0x1d9cd2[_0x1e9e18(0xcb)]}),_0x381eb5=_0x1a42cb[_0x1e9e18(0xf3)];if(_0x381eb5['counts']['segments']===0x0&&_0x381eb5[_0x1e9e18(0xf0)][_0x1e9e18(0xe4)]===0x0)return console[_0x1e9e18(0xf5)](a40_0x494e3e['yellow']('No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27'+_0x381eb5[_0x1e9e18(0xed)]+'\x27')),0x0;const _0xc5c776=_0x381eb5[_0x1e9e18(0xe7)][_0x1e9e18(0xe3)](_0x17f794=>_0x17f794[_0x1e9e18(0xe0)]),_0x276864=_0x381eb5[_0x1e9e18(0xe7)][_0x1e9e18(0xe3)](_0x57382a=>!_0x57382a[_0x1e9e18(0xe0)]&&_0x57382a[_0x1e9e18(0xf1)]),_0x229db8=_0x381eb5[_0x1e9e18(0xe7)]['filter'](_0x2608fc=>!_0x2608fc['isNew']&&!_0x2608fc[_0x1e9e18(0xf1)]);console[_0x1e9e18(0xf5)](_0x1e9e18(0xc6)+_0x381eb5['parentName']+'\x27:'),console[_0x1e9e18(0xf5)](_0x1e9e18(0xc7)+a40_0x494e3e[_0x1e9e18(0xb2)](_0x381eb5[_0x1e9e18(0xf0)][_0x1e9e18(0xab)]+_0x1e9e18(0xd1))+_0x1e9e18(0xc5)+a40_0x494e3e['cyan'](_0x381eb5[_0x1e9e18(0xf0)]['activations']+_0x1e9e18(0xe6)));if(_0x381eb5['counts'][_0x1e9e18(0xe4)]>0x0){const _0x143c11=_0x381eb5[_0x1e9e18(0xf0)][_0x1e9e18(0xac)]>_0x381eb5[_0x1e9e18(0xf0)][_0x1e9e18(0xe4)]?'\x20('+_0x381eb5[_0x1e9e18(0xf0)]['journeyVersions']+_0x1e9e18(0xf4):'';console[_0x1e9e18(0xf5)](_0x1e9e18(0xd5)+a40_0x494e3e['cyan'](_0x381eb5['counts'][_0x1e9e18(0xe4)]+_0x1e9e18(0xc4))+a40_0x494e3e[_0x1e9e18(0xdb)](_0x143c11));}console[_0x1e9e18(0xf5)]('\x20\x20'+a40_0x494e3e[_0x1e9e18(0xba)]('+\x20'+_0xc5c776[_0x1e9e18(0xdf)]+_0x1e9e18(0xcd))),console['error']('\x20\x20'+a40_0x494e3e[_0x1e9e18(0xe9)]('~\x20'+_0x276864[_0x1e9e18(0xdf)]+_0x1e9e18(0xf2))),console[_0x1e9e18(0xf5)]('\x20\x20'+a40_0x494e3e[_0x1e9e18(0xdb)]('=\x20'+_0x229db8[_0x1e9e18(0xdf)]+_0x1e9e18(0xb5))),console[_0x1e9e18(0xf5)](_0x1e9e18(0xda)+a40_0x494e3e[_0x1e9e18(0xb2)](_0x381eb5[_0x1e9e18(0xd3)])+'\x0a');if(_0x276864[_0x1e9e18(0xdf)]>0x0)for(const _0x345d17 of _0x276864){console[_0x1e9e18(0xf5)](_0x1e9e18(0xd4)+_0x345d17[_0x1e9e18(0xc8)]+'\x27:'),console[_0x1e9e18(0xf5)]('─'[_0x1e9e18(0xad)](0x3c)),console['error'](_0x345d17['diff']),console[_0x1e9e18(0xf5)]('─'[_0x1e9e18(0xad)](0x3c));}if(_0x1d9cd2['dryRun'])return console[_0x1e9e18(0xf5)](a40_0x494e3e[_0x1e9e18(0xe9)](_0x1e9e18(0xd7))),0x0;if(_0xc5c776[_0x1e9e18(0xdf)]===0x0&&_0x276864[_0x1e9e18(0xdf)]===0x0)return console['error'](a40_0x494e3e[_0x1e9e18(0xba)]('✔\x20All\x20files\x20are\x20up\x20to\x20date')),saveSessionContext({'parent_segment':_0x381eb5['parentName']},_0x1d9cd2['session']),console[_0x1e9e18(0xf5)](a40_0x494e3e[_0x1e9e18(0xba)](_0x1e9e18(0xf7)+a40_0x494e3e[_0x1e9e18(0xdb)]('parent_segment')+_0x1e9e18(0xb3)+a40_0x494e3e[_0x1e9e18(0xb2)](_0x381eb5[_0x1e9e18(0xed)]))),0x0;if(!_0x1d9cd2[_0x1e9e18(0xb4)]){if(!isInteractive())return console[_0x1e9e18(0xf5)](a40_0x494e3e[_0x1e9e18(0xb0)](_0x1e9e18(0xec)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x1e9e18(0xf5)](a40_0x494e3e[_0x1e9e18(0xdb)](_0x1e9e18(0xbc))),0x1;const _0x484aee=await confirmKey('Write\x20'+(_0xc5c776['length']+_0x276864[_0x1e9e18(0xdf)])+_0x1e9e18(0xd2));if(!_0x484aee)return console[_0x1e9e18(0xf5)](a40_0x494e3e[_0x1e9e18(0xe9)](_0x1e9e18(0xbe)),_0x1e9e18(0xfa)),0x1;}for(const _0x431bcf of _0x381eb5[_0x1e9e18(0xe7)]){if(_0x431bcf[_0x1e9e18(0xe0)]||_0x431bcf[_0x1e9e18(0xf1)]){const _0x5e0539=a40_0x27d48c['dirname'](_0x431bcf[_0x1e9e18(0xdc)]);!existsSync(_0x5e0539)&&mkdirSync(_0x5e0539,{'recursive':!![]}),writeFileSync(_0x431bcf[_0x1e9e18(0xdc)],_0x431bcf[_0x1e9e18(0xea)],'utf-8');}}return console[_0x1e9e18(0xf5)](a40_0x494e3e['green'](_0x1e9e18(0xc9)+(_0xc5c776['length']+_0x276864[_0x1e9e18(0xdf)])+_0x1e9e18(0xf6)+_0x381eb5[_0x1e9e18(0xd3)])),saveSessionContext({'parent_segment':_0x381eb5['parentName']},_0x1d9cd2['session']),console['error'](a40_0x494e3e['green'](_0x1e9e18(0xf7)+a40_0x494e3e[_0x1e9e18(0xdb)](_0x1e9e18(0xef))+_0x1e9e18(0xb3)+a40_0x494e3e[_0x1e9e18(0xb2)](_0x381eb5[_0x1e9e18(0xed)]))),0x0;}}
@@ -1 +1 @@
1
- const a41_0x440e00=a41_0x253b;(function(_0x1e8856,_0x215f51){const _0x38d19e=a41_0x253b,_0x4ad1e2=_0x1e8856();while(!![]){try{const _0x30ddc3=-parseInt(_0x38d19e(0x1c9))/0x1*(parseInt(_0x38d19e(0x18b))/0x2)+-parseInt(_0x38d19e(0x17e))/0x3+-parseInt(_0x38d19e(0x14a))/0x4*(parseInt(_0x38d19e(0x1c4))/0x5)+-parseInt(_0x38d19e(0x1de))/0x6+parseInt(_0x38d19e(0x1d2))/0x7+parseInt(_0x38d19e(0x196))/0x8+parseInt(_0x38d19e(0x1a6))/0x9*(parseInt(_0x38d19e(0x1c6))/0xa);if(_0x30ddc3===_0x215f51)break;else _0x4ad1e2['push'](_0x4ad1e2['shift']());}catch(_0x1f7e89){_0x4ad1e2['push'](_0x4ad1e2['shift']());}}}(a41_0x2167,0xdc21c));import{BaseCommand}from'./command.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{generateDiff,formatDiffWithColors}from'../utils/diff.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{batchAsync}from'../utils/async.js';import{segmentToYamlString,segmentWithActivationsToYaml}from'../sdk/segment/child-segment-yaml.js';import a41_0x5ab31b 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_0x440e00(0x1c5)]=a41_0x440e00(0x1c2);[a41_0x440e00(0x19e)]=a41_0x440e00(0x19d);async['execute'](_0x1c69e0){const _0x5e5a87=a41_0x440e00,{options:_0x1d0c13,args:_0x105b2a,tdx:_0x489360}=_0x1c69e0,_0x5a5bb6=_0x1d0c13,_0x20fd04=await resolveTarget({'arg':_0x105b2a[0x0],'contextParent':_0x1d0c13[_0x5e5a87(0x187)],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x20fd04))return _0x20fd04[_0x5e5a87(0x1d1)]===_0x5e5a87(0x1a4)?(console[_0x5e5a87(0x198)](a41_0x5ab31b[_0x5e5a87(0x1d9)](_0x5e5a87(0x1a9))),console[_0x5e5a87(0x198)]('Usage:\x20tdx\x20sg\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20(requires\x20context)'),console[_0x5e5a87(0x198)](_0x5e5a87(0x1cd)),console[_0x5e5a87(0x198)]('\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[_0x5e5a87(0x198)](a41_0x5ab31b[_0x5e5a87(0x161)](_0x5e5a87(0x1cc)+_0x20fd04['message']+'\x0a')),_0x20fd04[_0x5e5a87(0x180)]&&console[_0x5e5a87(0x198)](a41_0x5ab31b[_0x5e5a87(0x164)](_0x20fd04[_0x5e5a87(0x180)]))),0x1;if(_0x20fd04[_0x5e5a87(0x179)]===_0x5e5a87(0x176))return console[_0x5e5a87(0x198)](a41_0x5ab31b[_0x5e5a87(0x161)](_0x5e5a87(0x18c)+_0x20fd04[_0x5e5a87(0x1c7)]+'\x0a')),console[_0x5e5a87(0x198)](a41_0x5ab31b['cyan'](_0x5e5a87(0x152))),0x1;const _0x477d3c=_0x20fd04[_0x5e5a87(0x1a0)],_0x3cc1b2=_0x20fd04[_0x5e5a87(0x1c7)],_0x4d0621=_0x20fd04[_0x5e5a87(0x179)]===_0x5e5a87(0x1e5)?_0x20fd04[_0x5e5a87(0x151)]:undefined,_0x245809=getScopedDetails(_0x20fd04),_0x2652f2=_0x245809?.[_0x5e5a87(0x15a)]??![],_0x1ffe0e=_0x245809?.[_0x5e5a87(0x170)]??'';if(!existsSync(_0x3cc1b2))return console[_0x5e5a87(0x198)](a41_0x5ab31b['red']('Error:\x20Directory\x20not\x20found:\x20'+_0x3cc1b2+'\x0a')),console[_0x5e5a87(0x198)](a41_0x5ab31b[_0x5e5a87(0x164)]('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;_0x5a5bb6[_0x5e5a87(0x1b4)]&&(console['error'](_0x5e5a87(0x18d)+_0x5a5bb6[_0x5e5a87(0x16b)]),console[_0x5e5a87(0x198)](_0x5e5a87(0x192)+_0x477d3c),console[_0x5e5a87(0x198)]('Source\x20directory:\x20'+_0x3cc1b2),_0x2652f2&&console['error'](_0x5e5a87(0x14c)+_0x1ffe0e));const _0x20c776=await withSpinner(_0x5e5a87(0x1e1)+_0x477d3c+_0x5e5a87(0x186),()=>_0x489360[_0x5e5a87(0x1d4)]['resolveParentId'](_0x477d3c),{'verbose':_0x5a5bb6[_0x5e5a87(0x1b4)]}),_0x39f0f6=_0x20c776[_0x5e5a87(0x14d)],{parentSegmentResult:_0x2455ab,segmentsResult:_0x597ab0,foldersResult:_0x5f3af5,journeysWithDetailsResult:_0x379ba6,userMaps:_0xf20d1c}=await withSpinner(_0x5e5a87(0x154),async()=>{const _0x427a3b=_0x5e5a87,[_0x48caca,_0x294078,_0x51a3be,_0x5461ef,_0x49298b]=await Promise['all']([_0x489360[_0x427a3b(0x1d4)][_0x427a3b(0x167)](_0x39f0f6),_0x489360[_0x427a3b(0x1d4)][_0x427a3b(0x194)](_0x39f0f6),_0x489360[_0x427a3b(0x1d4)][_0x427a3b(0x19c)](_0x39f0f6),_0x489360[_0x427a3b(0x157)][_0x427a3b(0x185)](_0x39f0f6,{'includeAllVersions':!![]}),_0x489360['user'][_0x427a3b(0x1bb)]()]);return{'parentSegmentResult':_0x48caca,'segmentsResult':_0x294078,'foldersResult':_0x51a3be,'journeysWithDetailsResult':_0x5461ef,'userMaps':_0x49298b};},{'verbose':_0x5a5bb6['verbose']})[_0x5e5a87(0x1bd)](_0x1eeef9=>_0x1eeef9[_0x5e5a87(0x14d)]),_0x3f6a4c=_0x2455ab,_0x45ef60=extractRootFolderId(_0x3f6a4c),_0x4f3e28=_0x597ab0,_0x2906f7=_0x5f3af5,{journeys:_0x2dc08e,activationStepsById:_0x4e4d3a}=_0x379ba6,_0x5a8d58=new Map(_0x2dc08e[_0x5e5a87(0x1d6)](_0x3974c2=>[_0x3974c2['id'],_0x3974c2])),_0x12261f=_0x2dc08e['map'](_0x33dc75=>({'id':_0x33dc75['id'],'name':_0x33dc75[_0x5e5a87(0x15e)][_0x5e5a87(0x1c5)],'journeyBundleName':_0x33dc75[_0x5e5a87(0x15e)]['journeyBundleName']||'','journeyBundleId':_0x33dc75[_0x5e5a87(0x15e)][_0x5e5a87(0x14e)]||'','versionNumber':_0x33dc75[_0x5e5a87(0x15e)][_0x5e5a87(0x17b)],'description':_0x33dc75[_0x5e5a87(0x15e)][_0x5e5a87(0x19e)],'state':_0x33dc75[_0x5e5a87(0x15e)][_0x5e5a87(0x18f)],'paused':_0x33dc75[_0x5e5a87(0x15e)][_0x5e5a87(0x1bf)],'audienceId':_0x33dc75[_0x5e5a87(0x15e)]['audienceId'],'folderId':_0x33dc75['relationships']?.[_0x5e5a87(0x168)]?.[_0x5e5a87(0x14d)]?.['id'],'createdAt':_0x33dc75[_0x5e5a87(0x15e)][_0x5e5a87(0x166)],'updatedAt':_0x33dc75[_0x5e5a87(0x15e)][_0x5e5a87(0x1b1)]})),{emailToId:_0x4f33f7,idToEmail:_0x4a0140}=_0xf20d1c,_0x408c89=await withSpinner(_0x5e5a87(0x1b6),async()=>{const _0x3aedc9=_0x5e5a87,_0x55cfa2=await _0x489360[_0x3aedc9(0x17c)]['list']();return buildConnectionMaps(_0x55cfa2);},{'verbose':_0x5a5bb6[_0x5e5a87(0x1b4)]})[_0x5e5a87(0x1bd)](_0x37f15e=>_0x37f15e['data']),_0x14a64c=_0x408c89[_0x5e5a87(0x15f)],_0x232454=_0x408c89[_0x5e5a87(0x1aa)],_0x1f508c=_0x408c89[_0x5e5a87(0x162)],_0x44e27a={'emailToIdMap':_0x4f33f7,'connectionNameToIdMap':_0x14a64c,'connectionNameToTypeMap':_0x1f508c,'getSchema':_0x508ec8=>_0x489360['connection'][_0x5e5a87(0x1af)](_0x508ec8)};let {pathToId:_0x2a3878,idToPath:_0x55aaf3}=buildFolderMaps(_0x2906f7);const _0xeb6686=buildSegmentLookupMap(_0x4f3e28,_0x55aaf3),_0x3cf204=buildSegmentNameToIdMap(_0x4f3e28),_0x472b52=buildJourneyBundleLookupMap(_0x12261f,_0x55aaf3);let _0x34aa75;if(_0x4d0621){if(!_0x4d0621['endsWith'](_0x5e5a87(0x1ad))&&!_0x4d0621[_0x5e5a87(0x1a2)](_0x5e5a87(0x197)))return console['error'](a41_0x5ab31b[_0x5e5a87(0x161)](_0x5e5a87(0x165)+_0x4d0621+'\x0a')),0x1;_0x34aa75=[_0x4d0621];}else _0x34aa75=findYamlFiles(_0x3cc1b2);if(_0x34aa75[_0x5e5a87(0x174)]===0x0)return console[_0x5e5a87(0x198)](a41_0x5ab31b[_0x5e5a87(0x161)](_0x5e5a87(0x1ae)+_0x3cc1b2+'\x0a')),console[_0x5e5a87(0x198)](a41_0x5ab31b[_0x5e5a87(0x164)](_0x5e5a87(0x1ab))),0x1;let _0x4e6cf7,_0x14420c;try{const _0x66a24c=parseAndClassifyYamlFiles(_0x34aa75,_0x3cc1b2,{'skipSegments':_0x5a5bb6[_0x5e5a87(0x199)]});_0x4e6cf7=_0x66a24c[_0x5e5a87(0x1a8)],_0x14420c=_0x66a24c['journeys'];const _0x56fb74=validateParsedFiles(_0x66a24c,_0x3cc1b2);if(_0x56fb74[_0x5e5a87(0x174)]>0x0)return console[_0x5e5a87(0x198)](a41_0x5ab31b[_0x5e5a87(0x161)](_0x5e5a87(0x1d5))),console[_0x5e5a87(0x198)](formatValidationErrors(_0x56fb74)),console[_0x5e5a87(0x198)](a41_0x5ab31b[_0x5e5a87(0x1d9)](_0x5e5a87(0x163))),0x1;}catch(_0x23e850){return console[_0x5e5a87(0x198)](a41_0x5ab31b[_0x5e5a87(0x161)](_0x5e5a87(0x159)+(_0x23e850 instanceof Error?_0x23e850[_0x5e5a87(0x195)]:_0x23e850))),0x1;}if(_0x4e6cf7[_0x5e5a87(0x174)]===0x0&&_0x14420c[_0x5e5a87(0x174)]===0x0){const _0x1f4766=_0x5a5bb6[_0x5e5a87(0x199)]?_0x5e5a87(0x157):_0x5e5a87(0x1b7);return console['error'](a41_0x5ab31b[_0x5e5a87(0x1d9)]('No\x20'+_0x1f4766+_0x5e5a87(0x16a))),0x0;}const _0x2c441f=new Map();_0x4f3e28[_0x5e5a87(0x174)]>0x0&&!_0x5a5bb6['journeysOnly']&&await withSpinner(_0x5e5a87(0x1d8),async()=>{await batchAsync(_0x4f3e28,async _0x37918f=>{const _0x563144=a41_0x253b,_0x2b2db6=await _0x489360['segment'][_0x563144(0x183)](_0x39f0f6,_0x37918f['id']);_0x2c441f['set'](_0x37918f['id'],_0x2b2db6);});},{'verbose':_0x5a5bb6[_0x5e5a87(0x1b4)]});const {segmentFiles:_0x3fd98,foldersToCreate:_0x117201}=await prepareSegmentFiles(_0x4e6cf7,{'segmentByFolderAndName':_0xeb6686,'activationsBySegmentId':_0x2c441f,'folderPathToId':_0x2a3878,'idToEmailMap':_0x4a0140,'connectionIdToNameMap':_0x232454},_0x44e27a,_0x2652f2,_0x1ffe0e),_0x2c047e=_0x4d0621?[]:findSegmentsToDelete(_0x4f3e28,_0x4e6cf7[_0x5e5a87(0x1d6)](({yamlConfig:_0x3dd6bc,folderPath:_0x310d30})=>({'yamlConfig':_0x3dd6bc,'folderPath':resolveTDFolderPath(_0x310d30,_0x2652f2,_0x1ffe0e)})),_0x55aaf3,_0x1ffe0e,_0x2652f2),{journeyFiles:_0x1f59f6,foldersToCreate:_0x58859f}=await withProgressSpinner('Preparing\x20journeys...',async _0x13c904=>prepareJourneyFiles(_0x14420c,{'fetchJourney':async _0x158e5a=>_0x489360[_0x5e5a87(0x157)]['getJourney'](_0x158e5a[_0x5e5a87(0x1a7)]),'journeyBundlesByFolderAndName':_0x472b52,'folderPathToId':_0x2a3878,'idToEmailMap':_0x4a0140,'connectionIdToNameMap':_0x232454,'existingSegments':_0x4f3e28,'parentId':_0x39f0f6,'deps':_0x489360,'progress':{'update':_0x199563=>{const _0x49d2a4=_0x5e5a87;_0x13c904[_0x49d2a4(0x19f)](_0x199563),_0x5a5bb6[_0x49d2a4(0x1b4)]&&console[_0x49d2a4(0x198)]('\x20\x20'+_0x199563);}},'journeyById':_0x5a8d58,'activationStepsById':_0x4e4d3a},_0x2652f2,_0x1ffe0e),{'verbose':_0x5a5bb6['verbose']})[_0x5e5a87(0x1bd)](_0x4a65b7=>_0x4a65b7[_0x5e5a87(0x14d)]);for(const _0x41b31d of _0x58859f){_0x117201[_0x5e5a87(0x193)](_0x41b31d);}const _0x8ac13d=_0x4d0621?[]:findJourneysToDelete(_0x12261f,_0x14420c[_0x5e5a87(0x1d6)](({yamlConfig:_0x3fd55c,folderPath:_0x41ea11})=>({'yamlConfig':_0x3fd55c,'folderPath':resolveTDFolderPath(_0x41ea11,_0x2652f2,_0x1ffe0e)})),_0x55aaf3,_0x1ffe0e,_0x2652f2),_0x241571=calculatePushStats(_0x3fd98,_0x1f59f6,_0x117201,_0x2c047e,_0x8ac13d,!!_0x5a5bb6[_0x5e5a87(0x1d0)],!!_0x5a5bb6[_0x5e5a87(0x199)]),_0x7399e1=_0x241571[_0x5e5a87(0x1a8)]['new'],_0x2e6ec7=_0x241571[_0x5e5a87(0x1a8)][_0x5e5a87(0x1e4)],_0xe79137=_0x241571[_0x5e5a87(0x1a8)]['unchanged'],_0x556800=_0x241571[_0x5e5a87(0x1a8)]['toDelete'],_0x9ed557=_0x241571['folders'][_0x5e5a87(0x1b5)],_0x1b2480=_0x241571[_0x5e5a87(0x1e2)][_0x5e5a87(0x1b2)],_0x2f9d5b=_0x241571['journeys'][_0x5e5a87(0x1e4)],_0x2d0197=_0x241571[_0x5e5a87(0x1e2)][_0x5e5a87(0x171)],_0x26fd1e=_0x241571['journeys'][_0x5e5a87(0x16d)],_0x3712d5=_0x241571[_0x5e5a87(0x160)][_0x5e5a87(0x1cb)],_0x3a217f=_0x241571['activations'][_0x5e5a87(0x1b5)],_0x357286=_0x241571['activations'][_0x5e5a87(0x155)],_0x5407e0=_0x241571['activations']['toDelete'];console['error'](_0x5e5a87(0x18e)+_0x477d3c+'\x27:');_0x9ed557[_0x5e5a87(0x174)]>0x0&&console[_0x5e5a87(0x198)]('\x20\x20'+a41_0x5ab31b[_0x5e5a87(0x172)]('📁\x20'+_0x9ed557['length']+_0x5e5a87(0x1da)));if(!_0x5a5bb6[_0x5e5a87(0x199)]){console['error']('\x20\x20📊\x20Segments:'),console[_0x5e5a87(0x198)](_0x5e5a87(0x1d3)+a41_0x5ab31b[_0x5e5a87(0x184)]('+\x20'+_0x7399e1['length']+_0x5e5a87(0x1d7))),console[_0x5e5a87(0x198)]('\x20\x20\x20\x20'+a41_0x5ab31b['yellow']('~\x20'+_0x2e6ec7[_0x5e5a87(0x174)]+'\x20changed'));if(_0x556800[_0x5e5a87(0x174)]>0x0)console[_0x5e5a87(0x198)](_0x5e5a87(0x1d3)+a41_0x5ab31b[_0x5e5a87(0x161)]('-\x20'+_0x556800[_0x5e5a87(0x174)]+_0x5e5a87(0x153)));else _0x2c047e[_0x5e5a87(0x174)]>0x0&&!_0x5a5bb6['delete']&&console[_0x5e5a87(0x198)](_0x5e5a87(0x1d3)+a41_0x5ab31b['dim'](_0x2c047e[_0x5e5a87(0x174)]+'\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)'));console[_0x5e5a87(0x198)](_0x5e5a87(0x1d3)+a41_0x5ab31b['dim']('=\x20'+_0xe79137['length']+_0x5e5a87(0x15c)));}if(_0x1f59f6['length']>0x0||_0x8ac13d[_0x5e5a87(0x174)]>0x0){console['error'](_0x5e5a87(0x1ce)),console[_0x5e5a87(0x198)](_0x5e5a87(0x1d3)+a41_0x5ab31b['green']('+\x20'+_0x1b2480['length']+'\x20new')),console[_0x5e5a87(0x198)]('\x20\x20\x20\x20'+a41_0x5ab31b[_0x5e5a87(0x1d9)]('~\x20'+_0x2f9d5b[_0x5e5a87(0x174)]+'\x20changed'));if(_0x26fd1e[_0x5e5a87(0x174)]>0x0)console[_0x5e5a87(0x198)](_0x5e5a87(0x1d3)+a41_0x5ab31b[_0x5e5a87(0x161)]('-\x20'+_0x26fd1e[_0x5e5a87(0x174)]+'\x20to\x20delete'));else _0x8ac13d[_0x5e5a87(0x174)]>0x0&&!_0x5a5bb6['delete']&&console['error'](_0x5e5a87(0x1d3)+a41_0x5ab31b['dim'](_0x8ac13d['length']+'\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)'));console[_0x5e5a87(0x198)](_0x5e5a87(0x1d3)+a41_0x5ab31b[_0x5e5a87(0x1b8)]('=\x20'+_0x2d0197[_0x5e5a87(0x174)]+_0x5e5a87(0x15c)));}_0x3712d5[_0x5e5a87(0x174)]>0x0&&!_0x5a5bb6['journeysOnly']&&(console[_0x5e5a87(0x198)](''),console['error'](_0x5e5a87(0x190)),_0x3a217f[_0x5e5a87(0x174)]>0x0&&console[_0x5e5a87(0x198)]('\x20\x20\x20\x20'+a41_0x5ab31b[_0x5e5a87(0x184)]('+\x20'+_0x3a217f['length']+_0x5e5a87(0x18a))),_0x357286[_0x5e5a87(0x174)]>0x0&&console['error'](_0x5e5a87(0x1d3)+a41_0x5ab31b[_0x5e5a87(0x1d9)]('~\x20'+_0x357286[_0x5e5a87(0x174)]+'\x20to\x20update')),_0x5407e0['length']>0x0&&console[_0x5e5a87(0x198)](_0x5e5a87(0x1d3)+a41_0x5ab31b['red']('-\x20'+_0x5407e0[_0x5e5a87(0x174)]+_0x5e5a87(0x153))));console[_0x5e5a87(0x198)]('\x20\x20Source:\x20'+a41_0x5ab31b['cyan'](_0x3cc1b2)+'\x0a');if(_0x9ed557[_0x5e5a87(0x174)]>0x0){console['error'](_0x5e5a87(0x17a));for(const _0x507c56 of _0x9ed557){console['error']('\x20\x20'+a41_0x5ab31b[_0x5e5a87(0x172)]('+')+'\x20'+_0x507c56);}console[_0x5e5a87(0x198)]('');}if(_0x7399e1[_0x5e5a87(0x174)]>0x0&&!_0x5a5bb6[_0x5e5a87(0x199)])for(const _0x246dc3 of _0x7399e1){const _0x356091=_0x246dc3[_0x5e5a87(0x16c)]?_0x246dc3[_0x5e5a87(0x16c)]+'/'+_0x246dc3[_0x5e5a87(0x1e0)]['name']:_0x246dc3[_0x5e5a87(0x1e0)][_0x5e5a87(0x1c5)],_0x45432b=_0x246dc3['yamlConfig'][_0x5e5a87(0x160)]?.[_0x5e5a87(0x174)]||0x0,_0x2d05c1=_0x45432b>0x0?a41_0x5ab31b[_0x5e5a87(0x1b8)]('\x20['+_0x45432b+_0x5e5a87(0x173)):'';console[_0x5e5a87(0x198)]('\x0a'+a41_0x5ab31b[_0x5e5a87(0x184)](_0x5e5a87(0x17d))+'\x20'+_0x356091+_0x2d05c1),console['error']('─'['repeat'](0x3c)),_0x246dc3[_0x5e5a87(0x182)]&&console['error'](_0x246dc3[_0x5e5a87(0x182)]),console['error']('─'[_0x5e5a87(0x1b9)](0x3c));}if(_0x556800[_0x5e5a87(0x174)]>0x0&&!_0x5a5bb6[_0x5e5a87(0x199)])for(const _0x394398 of _0x556800){const _0x27fcda=_0x394398['segmentFolderId']?_0x55aaf3[_0x5e5a87(0x1cf)](_0x394398[_0x5e5a87(0x14b)][_0x5e5a87(0x19a)]())||'':'',_0x3e184c=_0x27fcda?_0x27fcda+'/'+_0x394398[_0x5e5a87(0x1c5)]:_0x394398[_0x5e5a87(0x1c5)],_0x5a976c=_0x2c441f['get'](_0x394398['id'])||[],_0x3d6348=_0x5a976c[_0x5e5a87(0x174)]>0x0?a41_0x5ab31b[_0x5e5a87(0x1b8)]('\x20['+_0x5a976c[_0x5e5a87(0x174)]+_0x5e5a87(0x173)):'';console[_0x5e5a87(0x198)]('\x0a'+a41_0x5ab31b[_0x5e5a87(0x161)](_0x5e5a87(0x1df))+'\x20'+_0x3e184c+_0x3d6348),console[_0x5e5a87(0x198)]('─'[_0x5e5a87(0x1b9)](0x3c));const _0x61d97d=segmentWithActivationsToYaml(_0x394398,_0x5a976c,undefined,_0x4a0140,_0x232454),_0x5eb0db=segmentToYamlString(_0x61d97d),_0x42607a=generateDiff(_0x5eb0db,'');console[_0x5e5a87(0x198)](formatDiffWithColors(_0x42607a)),console[_0x5e5a87(0x198)]('─'[_0x5e5a87(0x1b9)](0x3c));}const _0x27d41b=_0x3fd98[_0x5e5a87(0x17f)](_0x49cf03=>!_0x49cf03[_0x5e5a87(0x1dd)]&&_0x49cf03[_0x5e5a87(0x182)]);if(_0x27d41b[_0x5e5a87(0x174)]>0x0&&!_0x5a5bb6[_0x5e5a87(0x199)])for(const _0x4d976d of _0x27d41b){const _0xffa247=_0x4d976d[_0x5e5a87(0x16c)]?_0x4d976d[_0x5e5a87(0x16c)]+'/'+_0x4d976d[_0x5e5a87(0x1e0)][_0x5e5a87(0x1c5)]:_0x4d976d[_0x5e5a87(0x1e0)]['name'];console[_0x5e5a87(0x198)]('\x0a'+a41_0x5ab31b[_0x5e5a87(0x1d9)](_0x5e5a87(0x169))+'\x20'+_0xffa247),console[_0x5e5a87(0x198)]('─'['repeat'](0x3c)),console[_0x5e5a87(0x198)](_0x4d976d['diff']),console[_0x5e5a87(0x198)]('─'[_0x5e5a87(0x1b9)](0x3c));}if(_0x1b2480[_0x5e5a87(0x174)]>0x0)for(const _0x304a82 of _0x1b2480){const _0x117bba=_0x304a82[_0x5e5a87(0x16c)]?_0x304a82[_0x5e5a87(0x16c)]+'/'+_0x304a82['yamlConfig'][_0x5e5a87(0x1c5)]:_0x304a82['yamlConfig'][_0x5e5a87(0x1c5)];console[_0x5e5a87(0x198)]('\x0a'+a41_0x5ab31b['green'](_0x5e5a87(0x181))+'\x20'+_0x117bba),console[_0x5e5a87(0x198)]('─'[_0x5e5a87(0x1b9)](0x3c)),_0x304a82[_0x5e5a87(0x182)]&&console[_0x5e5a87(0x198)](_0x304a82['diff']),console[_0x5e5a87(0x198)]('─'[_0x5e5a87(0x1b9)](0x3c));}const _0xe5a8cc=_0x1f59f6[_0x5e5a87(0x17f)](_0x3e1dfb=>!_0x3e1dfb[_0x5e5a87(0x1dd)]&&_0x3e1dfb[_0x5e5a87(0x182)]);if(_0xe5a8cc['length']>0x0)for(const _0x44c6aa of _0xe5a8cc){const _0x41f2da=_0x44c6aa[_0x5e5a87(0x16c)]?_0x44c6aa[_0x5e5a87(0x16c)]+'/'+_0x44c6aa[_0x5e5a87(0x1e0)][_0x5e5a87(0x1c5)]:_0x44c6aa['yamlConfig'][_0x5e5a87(0x1c5)];console[_0x5e5a87(0x198)]('\x0a'+a41_0x5ab31b[_0x5e5a87(0x1d9)]('Changes\x20to\x20journey:')+'\x20'+_0x41f2da),console[_0x5e5a87(0x198)]('─'[_0x5e5a87(0x1b9)](0x3c)),console['error'](_0x44c6aa[_0x5e5a87(0x182)]),console['error']('─'[_0x5e5a87(0x1b9)](0x3c));}if(_0x26fd1e[_0x5e5a87(0x174)]>0x0)for(const _0x392995 of _0x26fd1e){const _0x1f8f0d=_0x392995[_0x5e5a87(0x189)]?_0x55aaf3[_0x5e5a87(0x1cf)](_0x392995[_0x5e5a87(0x189)])||'':'',_0x5a0dbd=_0x1f8f0d?_0x1f8f0d+'/'+_0x392995[_0x5e5a87(0x1c8)]:_0x392995[_0x5e5a87(0x1c8)];console[_0x5e5a87(0x198)]('\x0a'+a41_0x5ab31b['red']('Delete\x20journey:')+'\x20'+_0x5a0dbd),console[_0x5e5a87(0x198)]('─'['repeat'](0x3c)),console[_0x5e5a87(0x198)](a41_0x5ab31b[_0x5e5a87(0x161)](_0x5e5a87(0x1c3))),console[_0x5e5a87(0x198)]('─'[_0x5e5a87(0x1b9)](0x3c));}if(_0x5a5bb6[_0x5e5a87(0x1a1)])return console['error'](a41_0x5ab31b['yellow']('\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made')),0x0;const _0x354898=_0x5a5bb6[_0x5e5a87(0x199)]?![]:_0x7399e1['length']>0x0||_0x2e6ec7[_0x5e5a87(0x174)]>0x0||_0x556800[_0x5e5a87(0x174)]>0x0,_0x12fbcc=_0x1b2480[_0x5e5a87(0x174)]>0x0||_0x2f9d5b[_0x5e5a87(0x174)]>0x0||_0x26fd1e[_0x5e5a87(0x174)]>0x0,_0x357b36=_0x5a5bb6[_0x5e5a87(0x199)]?![]:_0x3712d5[_0x5e5a87(0x174)]>0x0,_0x262a66=_0x9ed557['length']>0x0;if(!_0x354898&&!_0x12fbcc&&!_0x357b36&&!_0x262a66){const _0x1ec3d0=_0x5a5bb6[_0x5e5a87(0x199)]?'✔\x20All\x20journeys\x20are\x20up\x20to\x20date':_0x5e5a87(0x178);console[_0x5e5a87(0x198)](a41_0x5ab31b[_0x5e5a87(0x184)](_0x1ec3d0));if(_0x4d0621&&_0xe79137[_0x5e5a87(0x174)]===0x1){const _0xec9816=_0xe79137[0x0];if(_0xec9816[_0x5e5a87(0x156)]?.['id']){const _0x19aa10=getConsoleNextUrl(_0x5a5bb6[_0x5e5a87(0x16b)],_0x5e5a87(0x158)+_0x39f0f6+_0x5e5a87(0x1e3)+_0xec9816[_0x5e5a87(0x156)]['id']+'/sb/da/esr');console['error'](_0x5e5a87(0x191)+a41_0x5ab31b[_0x5e5a87(0x164)](_0x19aa10));}}if(_0x4d0621&&_0x2d0197[_0x5e5a87(0x174)]===0x1){const _0x833dec=_0x2d0197[0x0];if(_0x833dec[_0x5e5a87(0x1ca)]?.['id']){const _0x351e20=getConsoleNextUrl(_0x5a5bb6[_0x5e5a87(0x16b)],_0x5e5a87(0x158)+_0x39f0f6+_0x5e5a87(0x1e3)+_0x833dec['existingJourney']['id']+_0x5e5a87(0x14f));console['error']('\x20\x20'+a41_0x5ab31b[_0x5e5a87(0x164)](_0x351e20));}}return 0x0;}const _0x96f39f=_0x5a5bb6[_0x5e5a87(0x199)]?_0x1b2480[_0x5e5a87(0x174)]+_0x2f9d5b[_0x5e5a87(0x174)]+_0x26fd1e['length']+_0x9ed557[_0x5e5a87(0x174)]:_0x7399e1['length']+_0x2e6ec7['length']+_0x556800[_0x5e5a87(0x174)]+_0x1b2480[_0x5e5a87(0x174)]+_0x2f9d5b[_0x5e5a87(0x174)]+_0x26fd1e[_0x5e5a87(0x174)]+_0x9ed557[_0x5e5a87(0x174)]+_0x3712d5['length'];if(!_0x5a5bb6[_0x5e5a87(0x1a5)]&&_0x96f39f>0x0){if(!isInteractive())return console['error'](a41_0x5ab31b[_0x5e5a87(0x161)](_0x5e5a87(0x1c0)),_0x5e5a87(0x1ac)),console[_0x5e5a87(0x198)](a41_0x5ab31b[_0x5e5a87(0x1b8)](_0x5e5a87(0x1a3))),0x1;const _0x4fb671=await confirmKey(_0x5e5a87(0x1b3)+_0x96f39f+_0x5e5a87(0x1b0));if(!_0x4fb671)return console['error'](a41_0x5ab31b[_0x5e5a87(0x1d9)](_0x5e5a87(0x15b))),0x1;}const _0x4a0bdb={'withProgress':async(_0x72fbf5,_0x5d7074)=>{const _0x27d358=_0x5e5a87,_0x322186=await withSpinner(_0x72fbf5,_0x5d7074,{'verbose':_0x5a5bb6['verbose']});return{'data':_0x322186[_0x27d358(0x14d)]};},'logInfo':_0x37e5a3=>console[_0x5e5a87(0x198)](a41_0x5ab31b[_0x5e5a87(0x172)]('✔\x20'+_0x37e5a3)),'logSuccess':_0x1c20f9=>console[_0x5e5a87(0x198)](a41_0x5ab31b['green']('✔\x20'+_0x1c20f9)),'logWarning':_0x2d8257=>console[_0x5e5a87(0x198)](a41_0x5ab31b[_0x5e5a87(0x1d9)]('⚠\x20'+_0x2d8257)),'logDeleted':_0x1dc49c=>console['error'](a41_0x5ab31b['red']('✔\x20'+_0x1dc49c))},_0x38b465={'segment':_0x489360[_0x5e5a87(0x1d4)],'journey':_0x489360[_0x5e5a87(0x157)],'user':_0x489360[_0x5e5a87(0x175)],'connection':_0x489360[_0x5e5a87(0x17c)]};_0x9ed557[_0x5e5a87(0x174)]>0x0&&(_0x2a3878=await executePushFolders(_0x38b465,_0x9ed557,_0x2a3878,{'parentId':_0x39f0f6},_0x4a0bdb));const _0x29f299={'rootFolderId':_0x45ef60,'folderPathToId':_0x2a3878,'folderIdToPath':_0x55aaf3,'segmentNameToId':_0x3cf204,'activationsBySegmentId':_0x2c441f,'emailToIdMap':_0x4f33f7,'idToEmailMap':_0x4a0140,'connectionNameToIdMap':_0x408c89[_0x5e5a87(0x15f)],'connectionIdToNameMap':_0x408c89[_0x5e5a87(0x1aa)],'connectionNameToTypeMap':_0x1f508c},_0x21c671=await executePushSegments(_0x38b465,_0x5a5bb6['journeysOnly']?[]:_0x3fd98,_0x29f299,{'parentId':_0x39f0f6},_0x4a0bdb),_0x40ef92=_0x21c671['created'],_0x4e5e84=_0x21c671[_0x5e5a87(0x150)],_0x483e33=_0x21c671[_0x5e5a87(0x160)][_0x5e5a87(0x1c1)],_0x58c9c9=_0x21c671[_0x5e5a87(0x160)][_0x5e5a87(0x150)],_0x380707=_0x21c671[_0x5e5a87(0x160)][_0x5e5a87(0x16f)];let _0x5860d3;if(_0x4d0621&&_0x3fd98[_0x5e5a87(0x174)]===0x1){const _0x18b555=_0x3fd98[0x0];_0x5860d3=_0x18b555[_0x5e5a87(0x156)]?.['id']??_0x21c671[_0x5e5a87(0x1bc)]['get'](_0x18b555['yamlConfig'][_0x5e5a87(0x1c5)]);}const _0x557219=await executePushSegmentDeletions(_0x38b465,_0x5a5bb6[_0x5e5a87(0x199)]?[]:_0x556800,_0x4a0bdb);let _0x3111dc=0x0,_0x422f66=0x0,_0x29a234=0x0;const _0x45cb2c=new Map(_0x3cf204);for(const [_0x3cd7f9,_0x38f14b]of _0x21c671[_0x5e5a87(0x1bc)]){_0x45cb2c['set'](_0x3cd7f9,_0x38f14b);}if(_0x1f59f6[_0x5e5a87(0x174)]>0x0){const _0x3cec78={..._0x29f299,'segmentNameToId':_0x45cb2c,'existingSegments':_0x4f3e28,'activationContext':_0x44e27a},_0x4229af=await executePushJourneys(_0x38b465,_0x1f59f6,_0x3cec78,{'parentId':_0x39f0f6,'rootFolderId':_0x45ef60,'verbose':_0x5a5bb6['verbose']},_0x4a0bdb);_0x3111dc=_0x4229af[_0x5e5a87(0x1c1)],_0x422f66=_0x4229af['updated'];if(_0x4d0621&&_0x4229af[_0x5e5a87(0x19b)][_0x5e5a87(0x174)]===0x1){const _0x266515=_0x4229af['results'][0x0];if(_0x266515[_0x5e5a87(0x1a7)]){const _0x34efc8=getConsoleNextUrl(_0x5a5bb6[_0x5e5a87(0x16b)],_0x5e5a87(0x158)+_0x39f0f6+'/e/'+_0x266515[_0x5e5a87(0x1a7)]+_0x5e5a87(0x14f));console['error']('\x20\x20'+a41_0x5ab31b['cyan'](_0x34efc8));}}}for(const _0x2e1ff3 of _0x26fd1e){console[_0x5e5a87(0x198)](a41_0x5ab31b['yellow'](_0x5e5a87(0x188)+_0x2e1ff3['journeyBundleName'])),_0x29a234++;}const _0x89e5cf=[];if(_0x40ef92>0x0)_0x89e5cf[_0x5e5a87(0x1dc)](_0x40ef92+_0x5e5a87(0x15d));if(_0x4e5e84>0x0)_0x89e5cf['push'](_0x4e5e84+'\x20updated');if(_0x557219>0x0)_0x89e5cf['push'](_0x557219+_0x5e5a87(0x1be));const _0x5d5e80=[];if(_0x3111dc>0x0)_0x5d5e80['push'](_0x3111dc+_0x5e5a87(0x15d));if(_0x422f66>0x0)_0x5d5e80[_0x5e5a87(0x1dc)](_0x422f66+_0x5e5a87(0x1db));if(_0x29a234>0x0)_0x5d5e80[_0x5e5a87(0x1dc)](_0x29a234+_0x5e5a87(0x1be));const _0x559158=[];if(_0x483e33>0x0)_0x559158[_0x5e5a87(0x1dc)](_0x483e33+'\x20created');if(_0x58c9c9>0x0)_0x559158['push'](_0x58c9c9+'\x20updated');if(_0x380707>0x0)_0x559158[_0x5e5a87(0x1dc)](_0x380707+_0x5e5a87(0x1be));console['error'](a41_0x5ab31b[_0x5e5a87(0x184)]('\x0a✔\x20Push\x20complete'));_0x89e5cf[_0x5e5a87(0x174)]>0x0&&!_0x5a5bb6[_0x5e5a87(0x199)]&&console[_0x5e5a87(0x198)]('\x20\x20Segments:\x20'+_0x89e5cf['join'](',\x20'));_0x5d5e80[_0x5e5a87(0x174)]>0x0&&console[_0x5e5a87(0x198)](_0x5e5a87(0x16e)+_0x5d5e80[_0x5e5a87(0x177)](',\x20'));_0x559158[_0x5e5a87(0x174)]>0x0&&!_0x5a5bb6[_0x5e5a87(0x199)]&&console[_0x5e5a87(0x198)](_0x5e5a87(0x1ba)+_0x559158[_0x5e5a87(0x177)](',\x20'));if(_0x5860d3){const _0x2576bf=getConsoleNextUrl(_0x5a5bb6[_0x5e5a87(0x16b)],'/app/ps/'+_0x39f0f6+_0x5e5a87(0x1e3)+_0x5860d3+'/sb/da/esr');console['error'](_0x5e5a87(0x191)+a41_0x5ab31b['cyan'](_0x2576bf));}return 0x0;}}function a41_0x253b(_0x44e3bc,_0x16aa3d){_0x44e3bc=_0x44e3bc-0x14a;const _0x216753=a41_0x2167();let _0x253b96=_0x216753[_0x44e3bc];return _0x253b96;}function a41_0x2167(){const _0x4bfff7=['14343448rCZCZl','.yaml','error','journeysOnly','toString','results','listFolders','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','description','setPhase','parentName','dryRun','endsWith','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','no_parent','yes','18197325QSkLHj','journeyId','segments','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','idToName','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','.yml','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','getOutputSchemaWithCache','\x20changes?','updatedAt','new','Push\x20','verbose','toCreate','Fetching\x20connections\x20for\x20name\x20resolution...','segment\x20or\x20journey','dim','repeat','\x20\x20Activations:\x20','buildUserMaps','createdSegmentIds','then','\x20deleted','paused','\x0aError:','created','segment:push','(Journey\x20will\x20be\x20deleted)','619210eCNjUr','name','10aDRTkc','targetDir','journeyBundleName','509699NyMFSj','existingJourney','all','Error:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','\x20\x20🗺️\x20\x20Journeys:','get','delete','errorCode','5360236JTnPrj','\x20\x20\x20\x20','segment','\x0aValidation\x20failed:','map','\x20new','Fetching\x20existing\x20activations...','yellow','\x20folders\x20to\x20create','\x20updated','push','isNew','8547642FRYVGu','Delete\x20segment:','yamlConfig','Resolving\x20parent\x20segment\x20\x27','journeys','/e/','changed','file','4OFzDwv','segmentFolderId','Scoped\x20to\x20folder:\x20','data','journeyBundleId','/j/da/je','updated','filePath','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','\x20to\x20delete','Fetching\x20existing\x20data...','toUpdate','existingSegment','journey','/app/ps/','Error\x20parsing\x20YAML:\x20','isScoped','Aborted.','\x20unchanged','\x20created','attributes','nameToId','activations','red','nameToType','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','cyan','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','createdAt','getParent','parentFolder','Changes\x20to:','\x20YAML\x20files\x20found','site','folderPath','toDelete','\x20\x20Journeys:\x20','deleted','scopedFolderPath','unchanged','blue','\x20activations]','length','user','parent_name','join','✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','type','Folders\x20to\x20create:','versionNumber','connection','New\x20segment:','1804194iXxzeX','filter','helpText','New\x20journey:','diff','listActivations','green','listJourneysWithDetailsFromParentSegment','\x27...','parentSegment','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','folderId','\x20to\x20create','6ehNYpy','Error:\x20Directory\x20not\x20found:\x20','Site:\x20','\x0aPush\x20summary\x20for\x20\x27','state','\x20\x20Activations:','\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20','Parent\x20segment:\x20','add','listSegments','message'];a41_0x2167=function(){return _0x4bfff7;};return a41_0x2167();}
1
+ const a41_0x5c1e39=a41_0x2522;(function(_0x49525d,_0x4e09c7){const _0x1bc755=a41_0x2522,_0x25d60c=_0x49525d();while(!![]){try{const _0x14e78d=parseInt(_0x1bc755(0x17f))/0x1+-parseInt(_0x1bc755(0x205))/0x2*(parseInt(_0x1bc755(0x16d))/0x3)+-parseInt(_0x1bc755(0x212))/0x4*(parseInt(_0x1bc755(0x20c))/0x5)+parseInt(_0x1bc755(0x1fc))/0x6*(-parseInt(_0x1bc755(0x1ca))/0x7)+-parseInt(_0x1bc755(0x19d))/0x8*(-parseInt(_0x1bc755(0x1cd))/0x9)+parseInt(_0x1bc755(0x19a))/0xa+-parseInt(_0x1bc755(0x19e))/0xb*(parseInt(_0x1bc755(0x1c4))/0xc);if(_0x14e78d===_0x4e09c7)break;else _0x25d60c['push'](_0x25d60c['shift']());}catch(_0x244f55){_0x25d60c['push'](_0x25d60c['shift']());}}}(a41_0x4f22,0x2e20e));import{BaseCommand}from'./command.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{generateDiff,formatDiffWithColors}from'../utils/diff.js';function a41_0x2522(_0x107496,_0x21772f){_0x107496=_0x107496-0x16d;const _0x4f2224=a41_0x4f22();let _0x2522a3=_0x4f2224[_0x107496];return _0x2522a3;}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_0x520b0c from'chalk';import{existsSync}from'fs';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{resolveTarget,isSuccessfulResolution,getScopedDetails}from'../sdk/segment/target-resolution.js';function a41_0x4f22(){const _0x102084=['\x20\x20Activations:\x20','✔\x20All\x20journeys\x20are\x20up\x20to\x20date','No\x20','message','unchanged','4wstoZI','\x20to\x20delete','results','map','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','type','list','10VlEvSC','created','✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','Delete\x20journey:','\x20to\x20create','\x20to\x20update','191064Ritpxw','65028GhNnNN','no_parent','red','segments','dryRun','verbose','idToName','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','journeyBundleName','folderId','connection','\x20new','New\x20segment:','\x20changed','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)','\x20updated','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','getOutputSchemaWithCache','358986xvtUHT','Aborted.','repeat','/sb/da/esr','delete','resolveParentId','Error\x20parsing\x20YAML:\x20','\x20\x20📊\x20Segments:','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','state','yamlConfig','parentName','diff','Error:\x20','\x20\x20\x20\x20','isScoped','\x20YAML\x20files\x20found','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','parent_name','toUpdate','targetDir','scopedFolderPath','parentFolder','\x20created','site','updated','Delete\x20segment:','194260qgnPjo','nameToId','existingSegment','384GuWzwi','11JeEWjO','activations','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','/e/','createdSegmentIds','folderPath','user','.yaml','listFolders','existingJourney','New\x20journey:','all','listSegments','journeyId','helpText','setPhase','\x20activations]','then','join','journey','Preparing\x20journeys...','/j/da/je','\x20\x20Source:\x20','/app/ps/','\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20','description','Changes\x20to\x20journey:','dim','changed','isNew','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','toDelete','yes','yellow','endsWith','buildUserMaps','\x0aPush\x20summary\x20for\x20\x27','journeysOnly','984636OCsXYi','\x20\x20🗺️\x20\x20Journeys:','set','getParent','\x20unchanged','execute','306579tPlgQS','segmentFolderId','segment\x20or\x20journey','14112idNseX','\x20deleted','segment:push','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','parentSegment','push','Source\x20directory:\x20','\x0aValidation\x20failed:','listJourneysWithDetailsFromParentSegment','updatedAt','Resolving\x20parent\x20segment\x20\x27','green','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','error','attributes','length','(Journey\x20will\x20be\x20deleted)','\x0aError:','data','Parent\x20segment:\x20','Site:\x20','file','Scoped\x20to\x20folder:\x20','Folders\x20to\x20create:','Fetching\x20connections\x20for\x20name\x20resolution...','listActivations','toString','deleted','segment','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','new','\x27...','name','folders','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file','toCreate','Fetching\x20existing\x20data...','journeys','cwd','get','\x0a✔\x20Push\x20complete','paused','cyan','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','Error:\x20Directory\x20not\x20found:\x20','Fetching\x20existing\x20activations...','blue','6qURqqS','add','Changes\x20to:','audienceId'];a41_0x4f22=function(){return _0x102084;};return a41_0x4f22();}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_0x5c1e39(0x1ed)]=a41_0x5c1e39(0x1cf);[a41_0x5c1e39(0x1b7)]=a41_0x5c1e39(0x1d9);async[a41_0x5c1e39(0x1c9)](_0x31463a){const _0x12c16c=a41_0x5c1e39,{options:_0x156039,args:_0x329fa4,tdx:_0x242946}=_0x31463a,_0x3c0b61=_0x156039,_0x85000a=await resolveTarget({'arg':_0x329fa4[0x0],'contextParent':_0x156039[_0x12c16c(0x1d1)],'cwd':process[_0x12c16c(0x1f3)]()});if(!isSuccessfulResolution(_0x85000a))return _0x85000a['errorCode']===_0x12c16c(0x16e)?(console[_0x12c16c(0x1da)](a41_0x520b0c[_0x12c16c(0x1bf)]('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console[_0x12c16c(0x1da)](_0x12c16c(0x17b)),console[_0x12c16c(0x1da)](_0x12c16c(0x1d0)),console['error'](_0x12c16c(0x1ef))):(console['error'](a41_0x520b0c[_0x12c16c(0x16f)](_0x12c16c(0x18c)+_0x85000a[_0x12c16c(0x203)]+'\x0a')),_0x85000a[_0x12c16c(0x1ac)]&&console[_0x12c16c(0x1da)](a41_0x520b0c[_0x12c16c(0x1f7)](_0x85000a[_0x12c16c(0x1ac)]))),0x1;if(_0x85000a[_0x12c16c(0x20a)]===_0x12c16c(0x191))return console['error'](a41_0x520b0c[_0x12c16c(0x16f)](_0x12c16c(0x1f9)+_0x85000a[_0x12c16c(0x193)]+'\x0a')),console[_0x12c16c(0x1da)](a41_0x520b0c[_0x12c16c(0x1f7)](_0x12c16c(0x209))),0x1;const _0x17384e=_0x85000a[_0x12c16c(0x18a)],_0x4d0afe=_0x85000a[_0x12c16c(0x193)],_0x1c1441=_0x85000a[_0x12c16c(0x20a)]===_0x12c16c(0x1e2)?_0x85000a['filePath']:undefined,_0x2f6af0=getScopedDetails(_0x85000a),_0x16e459=_0x2f6af0?.[_0x12c16c(0x18e)]??![],_0x42bbde=_0x2f6af0?.[_0x12c16c(0x194)]??'';if(!existsSync(_0x4d0afe))return console['error'](a41_0x520b0c[_0x12c16c(0x16f)](_0x12c16c(0x1f9)+_0x4d0afe+'\x0a')),console[_0x12c16c(0x1da)](a41_0x520b0c['cyan']('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;_0x3c0b61['verbose']&&(console['error'](_0x12c16c(0x1e1)+_0x3c0b61[_0x12c16c(0x197)]),console[_0x12c16c(0x1da)](_0x12c16c(0x1e0)+_0x17384e),console[_0x12c16c(0x1da)](_0x12c16c(0x1d3)+_0x4d0afe),_0x16e459&&console[_0x12c16c(0x1da)](_0x12c16c(0x1e3)+_0x42bbde));const _0x43df30=await withSpinner(_0x12c16c(0x1d7)+_0x17384e+_0x12c16c(0x1ec),()=>_0x242946[_0x12c16c(0x1e9)][_0x12c16c(0x184)](_0x17384e),{'verbose':_0x3c0b61[_0x12c16c(0x172)]}),_0x5e4a86=_0x43df30[_0x12c16c(0x1df)],{parentSegmentResult:_0x19cbdf,segmentsResult:_0x275fce,foldersResult:_0x4b6cae,journeysWithDetailsResult:_0x46fd62,userMaps:_0x5cd9c5}=await withSpinner(_0x12c16c(0x1f1),async()=>{const _0x29ba14=_0x12c16c,[_0x34803b,_0x7adb3b,_0x268acb,_0x449cc1,_0x5e3df4]=await Promise[_0x29ba14(0x1a9)]([_0x242946[_0x29ba14(0x1e9)][_0x29ba14(0x1c7)](_0x5e4a86),_0x242946['segment'][_0x29ba14(0x1aa)](_0x5e4a86),_0x242946['segment'][_0x29ba14(0x1a6)](_0x5e4a86),_0x242946[_0x29ba14(0x1b1)][_0x29ba14(0x1d5)](_0x5e4a86,{'includeAllVersions':!![]}),_0x242946['user'][_0x29ba14(0x1c1)]()]);return{'parentSegmentResult':_0x34803b,'segmentsResult':_0x7adb3b,'foldersResult':_0x268acb,'journeysWithDetailsResult':_0x449cc1,'userMaps':_0x5e3df4};},{'verbose':_0x3c0b61[_0x12c16c(0x172)]})['then'](_0x110f13=>_0x110f13[_0x12c16c(0x1df)]),_0x44c6f8=_0x19cbdf,_0x429d29=extractRootFolderId(_0x44c6f8),_0x31e4cc=_0x275fce,_0x264a13=_0x4b6cae,{journeys:_0x45991d,activationStepsById:_0x92b039}=_0x46fd62,_0xd4102c=new Map(_0x45991d[_0x12c16c(0x208)](_0x566103=>[_0x566103['id'],_0x566103])),_0x285bfc=_0x45991d[_0x12c16c(0x208)](_0x142e32=>({'id':_0x142e32['id'],'name':_0x142e32['attributes'][_0x12c16c(0x1ed)],'journeyBundleName':_0x142e32[_0x12c16c(0x1db)][_0x12c16c(0x175)]||'','journeyBundleId':_0x142e32[_0x12c16c(0x1db)]['journeyBundleId']||'','versionNumber':_0x142e32[_0x12c16c(0x1db)]['versionNumber'],'description':_0x142e32[_0x12c16c(0x1db)][_0x12c16c(0x1b7)],'state':_0x142e32[_0x12c16c(0x1db)][_0x12c16c(0x188)],'paused':_0x142e32[_0x12c16c(0x1db)][_0x12c16c(0x1f6)],'audienceId':_0x142e32[_0x12c16c(0x1db)][_0x12c16c(0x1ff)],'folderId':_0x142e32['relationships']?.[_0x12c16c(0x195)]?.[_0x12c16c(0x1df)]?.['id'],'createdAt':_0x142e32[_0x12c16c(0x1db)]['createdAt'],'updatedAt':_0x142e32[_0x12c16c(0x1db)][_0x12c16c(0x1d6)]})),{emailToId:_0x243ccf,idToEmail:_0x3a3d39}=_0x5cd9c5,_0x299c6c=await withSpinner(_0x12c16c(0x1e5),async()=>{const _0x49201f=_0x12c16c,_0x45ac94=await _0x242946[_0x49201f(0x177)][_0x49201f(0x20b)]();return buildConnectionMaps(_0x45ac94);},{'verbose':_0x3c0b61[_0x12c16c(0x172)]})[_0x12c16c(0x1af)](_0x469a74=>_0x469a74['data']),_0x14882d=_0x299c6c['nameToId'],_0x4a12c5=_0x299c6c[_0x12c16c(0x173)],_0x376967=_0x299c6c['nameToType'],_0x536c7a={'emailToIdMap':_0x243ccf,'connectionNameToIdMap':_0x14882d,'connectionNameToTypeMap':_0x376967,'getSchema':_0x797aa=>_0x242946[_0x12c16c(0x177)][_0x12c16c(0x17e)](_0x797aa)};let {pathToId:_0x351ae4,idToPath:_0x20102c}=buildFolderMaps(_0x264a13);const _0x3bbe67=buildSegmentLookupMap(_0x31e4cc,_0x20102c),_0x343767=buildSegmentNameToIdMap(_0x31e4cc),_0xdee0fd=buildJourneyBundleLookupMap(_0x285bfc,_0x20102c);let _0x589f50;if(_0x1c1441){if(!_0x1c1441[_0x12c16c(0x1c0)]('.yml')&&!_0x1c1441[_0x12c16c(0x1c0)](_0x12c16c(0x1a5)))return console[_0x12c16c(0x1da)](a41_0x520b0c[_0x12c16c(0x16f)]('Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20'+_0x1c1441+'\x0a')),0x1;_0x589f50=[_0x1c1441];}else _0x589f50=findYamlFiles(_0x4d0afe);if(_0x589f50['length']===0x0)return console['error'](a41_0x520b0c['red'](_0x12c16c(0x17d)+_0x4d0afe+'\x0a')),console[_0x12c16c(0x1da)](a41_0x520b0c[_0x12c16c(0x1f7)](_0x12c16c(0x190))),0x1;let _0x3d97f4,_0x12d174;try{const _0x143eec=parseAndClassifyYamlFiles(_0x589f50,_0x4d0afe,{'skipSegments':_0x3c0b61[_0x12c16c(0x1c3)]});_0x3d97f4=_0x143eec['segments'],_0x12d174=_0x143eec[_0x12c16c(0x1f2)];const _0x34e878=validateParsedFiles(_0x143eec,_0x4d0afe);if(_0x34e878[_0x12c16c(0x1dc)]>0x0)return console[_0x12c16c(0x1da)](a41_0x520b0c[_0x12c16c(0x16f)](_0x12c16c(0x1d4))),console[_0x12c16c(0x1da)](formatValidationErrors(_0x34e878)),console[_0x12c16c(0x1da)](a41_0x520b0c[_0x12c16c(0x1bf)](_0x12c16c(0x174))),0x1;}catch(_0x5bf0f8){return console[_0x12c16c(0x1da)](a41_0x520b0c[_0x12c16c(0x16f)](_0x12c16c(0x185)+(_0x5bf0f8 instanceof Error?_0x5bf0f8['message']:_0x5bf0f8))),0x1;}if(_0x3d97f4[_0x12c16c(0x1dc)]===0x0&&_0x12d174['length']===0x0){const _0x7e2438=_0x3c0b61[_0x12c16c(0x1c3)]?_0x12c16c(0x1b1):_0x12c16c(0x1cc);return console[_0x12c16c(0x1da)](a41_0x520b0c[_0x12c16c(0x1bf)](_0x12c16c(0x202)+_0x7e2438+_0x12c16c(0x18f))),0x0;}const _0x1db030=new Map();_0x31e4cc['length']>0x0&&!_0x3c0b61['journeysOnly']&&await withSpinner(_0x12c16c(0x1fa),async()=>{await batchAsync(_0x31e4cc,async _0x3a7de5=>{const _0x3b19c3=a41_0x2522,_0x5a845f=await _0x242946[_0x3b19c3(0x1e9)][_0x3b19c3(0x1e6)](_0x5e4a86,_0x3a7de5['id']);_0x1db030[_0x3b19c3(0x1c6)](_0x3a7de5['id'],_0x5a845f);});},{'verbose':_0x3c0b61[_0x12c16c(0x172)]});const {segmentFiles:_0xc90404,foldersToCreate:_0x149597}=await prepareSegmentFiles(_0x3d97f4,{'segmentByFolderAndName':_0x3bbe67,'activationsBySegmentId':_0x1db030,'folderPathToId':_0x351ae4,'idToEmailMap':_0x3a3d39,'connectionIdToNameMap':_0x4a12c5},_0x536c7a,_0x16e459,_0x42bbde),_0x11a3a7=_0x1c1441?[]:findSegmentsToDelete(_0x31e4cc,_0x3d97f4[_0x12c16c(0x208)](({yamlConfig:_0x39eae2,folderPath:_0x42109e})=>({'yamlConfig':_0x39eae2,'folderPath':resolveTDFolderPath(_0x42109e,_0x16e459,_0x42bbde)})),_0x20102c,_0x42bbde,_0x16e459),{journeyFiles:_0x6b5901,foldersToCreate:_0x276e9c}=await withProgressSpinner(_0x12c16c(0x1b2),async _0xe68b13=>prepareJourneyFiles(_0x12d174,{'fetchJourney':async _0x18d5c9=>_0x242946[_0x12c16c(0x1b1)]['getJourney'](_0x18d5c9[_0x12c16c(0x1ab)]),'journeyBundlesByFolderAndName':_0xdee0fd,'folderPathToId':_0x351ae4,'idToEmailMap':_0x3a3d39,'connectionIdToNameMap':_0x4a12c5,'existingSegments':_0x31e4cc,'parentId':_0x5e4a86,'deps':_0x242946,'progress':{'update':_0x5849ff=>{const _0x20ec2d=_0x12c16c;_0xe68b13[_0x20ec2d(0x1ad)](_0x5849ff),_0x3c0b61['verbose']&&console[_0x20ec2d(0x1da)]('\x20\x20'+_0x5849ff);}},'journeyById':_0xd4102c,'activationStepsById':_0x92b039},_0x16e459,_0x42bbde),{'verbose':_0x3c0b61['verbose']})[_0x12c16c(0x1af)](_0xc00c45=>_0xc00c45['data']);for(const _0x1afaca of _0x276e9c){_0x149597[_0x12c16c(0x1fd)](_0x1afaca);}const _0x37cfd9=_0x1c1441?[]:findJourneysToDelete(_0x285bfc,_0x12d174[_0x12c16c(0x208)](({yamlConfig:_0x1c4ff1,folderPath:_0x5cb1af})=>({'yamlConfig':_0x1c4ff1,'folderPath':resolveTDFolderPath(_0x5cb1af,_0x16e459,_0x42bbde)})),_0x20102c,_0x42bbde,_0x16e459),_0x2300b2=calculatePushStats(_0xc90404,_0x6b5901,_0x149597,_0x11a3a7,_0x37cfd9,!!_0x3c0b61[_0x12c16c(0x183)],!!_0x3c0b61['journeysOnly']),_0x419a38=_0x2300b2[_0x12c16c(0x170)][_0x12c16c(0x1eb)],_0x58b830=_0x2300b2['segments']['changed'],_0x4015b3=_0x2300b2[_0x12c16c(0x170)]['unchanged'],_0x2aea5c=_0x2300b2[_0x12c16c(0x170)][_0x12c16c(0x1bd)],_0x537f19=_0x2300b2[_0x12c16c(0x1ee)][_0x12c16c(0x1f0)],_0x24e526=_0x2300b2[_0x12c16c(0x1f2)][_0x12c16c(0x1eb)],_0x142280=_0x2300b2[_0x12c16c(0x1f2)][_0x12c16c(0x1ba)],_0x475e69=_0x2300b2[_0x12c16c(0x1f2)][_0x12c16c(0x204)],_0x5cfe6b=_0x2300b2[_0x12c16c(0x1f2)][_0x12c16c(0x1bd)],_0x30500f=_0x2300b2[_0x12c16c(0x19f)][_0x12c16c(0x1a9)],_0x46e332=_0x2300b2[_0x12c16c(0x19f)]['toCreate'],_0x1ce0cb=_0x2300b2[_0x12c16c(0x19f)][_0x12c16c(0x192)],_0x1a1d0c=_0x2300b2[_0x12c16c(0x19f)][_0x12c16c(0x1bd)];console[_0x12c16c(0x1da)](_0x12c16c(0x1c2)+_0x17384e+'\x27:');_0x537f19[_0x12c16c(0x1dc)]>0x0&&console[_0x12c16c(0x1da)]('\x20\x20'+a41_0x520b0c[_0x12c16c(0x1fb)]('📁\x20'+_0x537f19['length']+'\x20folders\x20to\x20create'));if(!_0x3c0b61['journeysOnly']){console[_0x12c16c(0x1da)](_0x12c16c(0x186)),console['error'](_0x12c16c(0x18d)+a41_0x520b0c[_0x12c16c(0x1d8)]('+\x20'+_0x419a38[_0x12c16c(0x1dc)]+_0x12c16c(0x178))),console[_0x12c16c(0x1da)]('\x20\x20\x20\x20'+a41_0x520b0c[_0x12c16c(0x1bf)]('~\x20'+_0x58b830[_0x12c16c(0x1dc)]+_0x12c16c(0x17a)));if(_0x2aea5c['length']>0x0)console['error'](_0x12c16c(0x18d)+a41_0x520b0c[_0x12c16c(0x16f)]('-\x20'+_0x2aea5c[_0x12c16c(0x1dc)]+_0x12c16c(0x206)));else _0x11a3a7[_0x12c16c(0x1dc)]>0x0&&!_0x3c0b61[_0x12c16c(0x183)]&&console[_0x12c16c(0x1da)](_0x12c16c(0x18d)+a41_0x520b0c['dim'](_0x11a3a7['length']+_0x12c16c(0x1bc)));console['error'](_0x12c16c(0x18d)+a41_0x520b0c[_0x12c16c(0x1b9)]('=\x20'+_0x4015b3['length']+'\x20unchanged'));}if(_0x6b5901[_0x12c16c(0x1dc)]>0x0||_0x37cfd9[_0x12c16c(0x1dc)]>0x0){console[_0x12c16c(0x1da)](_0x12c16c(0x1c5)),console['error'](_0x12c16c(0x18d)+a41_0x520b0c['green']('+\x20'+_0x24e526[_0x12c16c(0x1dc)]+'\x20new')),console[_0x12c16c(0x1da)](_0x12c16c(0x18d)+a41_0x520b0c[_0x12c16c(0x1bf)]('~\x20'+_0x142280['length']+_0x12c16c(0x17a)));if(_0x5cfe6b[_0x12c16c(0x1dc)]>0x0)console[_0x12c16c(0x1da)](_0x12c16c(0x18d)+a41_0x520b0c['red']('-\x20'+_0x5cfe6b[_0x12c16c(0x1dc)]+_0x12c16c(0x206)));else _0x37cfd9[_0x12c16c(0x1dc)]>0x0&&!_0x3c0b61['delete']&&console[_0x12c16c(0x1da)]('\x20\x20\x20\x20'+a41_0x520b0c[_0x12c16c(0x1b9)](_0x37cfd9[_0x12c16c(0x1dc)]+_0x12c16c(0x1bc)));console[_0x12c16c(0x1da)](_0x12c16c(0x18d)+a41_0x520b0c[_0x12c16c(0x1b9)]('=\x20'+_0x475e69[_0x12c16c(0x1dc)]+_0x12c16c(0x1c8)));}_0x30500f['length']>0x0&&!_0x3c0b61[_0x12c16c(0x1c3)]&&(console[_0x12c16c(0x1da)](''),console[_0x12c16c(0x1da)]('\x20\x20Activations:'),_0x46e332[_0x12c16c(0x1dc)]>0x0&&console[_0x12c16c(0x1da)](_0x12c16c(0x18d)+a41_0x520b0c[_0x12c16c(0x1d8)]('+\x20'+_0x46e332[_0x12c16c(0x1dc)]+_0x12c16c(0x210))),_0x1ce0cb[_0x12c16c(0x1dc)]>0x0&&console['error'](_0x12c16c(0x18d)+a41_0x520b0c['yellow']('~\x20'+_0x1ce0cb[_0x12c16c(0x1dc)]+_0x12c16c(0x211))),_0x1a1d0c[_0x12c16c(0x1dc)]>0x0&&console[_0x12c16c(0x1da)](_0x12c16c(0x18d)+a41_0x520b0c['red']('-\x20'+_0x1a1d0c[_0x12c16c(0x1dc)]+_0x12c16c(0x206))));console[_0x12c16c(0x1da)](_0x12c16c(0x1b4)+a41_0x520b0c[_0x12c16c(0x1f7)](_0x4d0afe)+'\x0a');if(_0x537f19[_0x12c16c(0x1dc)]>0x0){console[_0x12c16c(0x1da)](_0x12c16c(0x1e4));for(const _0x1259c0 of _0x537f19){console[_0x12c16c(0x1da)]('\x20\x20'+a41_0x520b0c[_0x12c16c(0x1fb)]('+')+'\x20'+_0x1259c0);}console[_0x12c16c(0x1da)]('');}if(_0x419a38[_0x12c16c(0x1dc)]>0x0&&!_0x3c0b61[_0x12c16c(0x1c3)])for(const _0x548ea1 of _0x419a38){const _0x2aa0d2=_0x548ea1[_0x12c16c(0x1a3)]?_0x548ea1[_0x12c16c(0x1a3)]+'/'+_0x548ea1[_0x12c16c(0x189)][_0x12c16c(0x1ed)]:_0x548ea1[_0x12c16c(0x189)]['name'],_0x29033e=_0x548ea1[_0x12c16c(0x189)]['activations']?.[_0x12c16c(0x1dc)]||0x0,_0x154196=_0x29033e>0x0?a41_0x520b0c[_0x12c16c(0x1b9)]('\x20['+_0x29033e+_0x12c16c(0x1ae)):'';console['error']('\x0a'+a41_0x520b0c['green'](_0x12c16c(0x179))+'\x20'+_0x2aa0d2+_0x154196),console['error']('─'[_0x12c16c(0x181)](0x3c)),_0x548ea1[_0x12c16c(0x18b)]&&console[_0x12c16c(0x1da)](_0x548ea1[_0x12c16c(0x18b)]),console[_0x12c16c(0x1da)]('─'[_0x12c16c(0x181)](0x3c));}if(_0x2aea5c[_0x12c16c(0x1dc)]>0x0&&!_0x3c0b61[_0x12c16c(0x1c3)])for(const _0xd76162 of _0x2aea5c){const _0x10d100=_0xd76162[_0x12c16c(0x1cb)]?_0x20102c[_0x12c16c(0x1f4)](_0xd76162[_0x12c16c(0x1cb)][_0x12c16c(0x1e7)]())||'':'',_0x4c7aa5=_0x10d100?_0x10d100+'/'+_0xd76162[_0x12c16c(0x1ed)]:_0xd76162[_0x12c16c(0x1ed)],_0x5224b9=_0x1db030[_0x12c16c(0x1f4)](_0xd76162['id'])||[],_0x2a0dac=_0x5224b9[_0x12c16c(0x1dc)]>0x0?a41_0x520b0c['dim']('\x20['+_0x5224b9[_0x12c16c(0x1dc)]+_0x12c16c(0x1ae)):'';console['error']('\x0a'+a41_0x520b0c[_0x12c16c(0x16f)](_0x12c16c(0x199))+'\x20'+_0x4c7aa5+_0x2a0dac),console[_0x12c16c(0x1da)]('─'[_0x12c16c(0x181)](0x3c));const _0x4bceaf=segmentWithActivationsToYaml(_0xd76162,_0x5224b9,undefined,_0x3a3d39,_0x4a12c5),_0x280d72=segmentToYamlString(_0x4bceaf),_0x2163b2=generateDiff(_0x280d72,'');console['error'](formatDiffWithColors(_0x2163b2)),console[_0x12c16c(0x1da)]('─'[_0x12c16c(0x181)](0x3c));}const _0x364d3c=_0xc90404['filter'](_0x33808c=>!_0x33808c[_0x12c16c(0x1bb)]&&_0x33808c[_0x12c16c(0x18b)]);if(_0x364d3c[_0x12c16c(0x1dc)]>0x0&&!_0x3c0b61['journeysOnly'])for(const _0x1739c3 of _0x364d3c){const _0x10f220=_0x1739c3['folderPath']?_0x1739c3['folderPath']+'/'+_0x1739c3[_0x12c16c(0x189)][_0x12c16c(0x1ed)]:_0x1739c3['yamlConfig'][_0x12c16c(0x1ed)];console[_0x12c16c(0x1da)]('\x0a'+a41_0x520b0c[_0x12c16c(0x1bf)](_0x12c16c(0x1fe))+'\x20'+_0x10f220),console[_0x12c16c(0x1da)]('─'[_0x12c16c(0x181)](0x3c)),console[_0x12c16c(0x1da)](_0x1739c3[_0x12c16c(0x18b)]),console[_0x12c16c(0x1da)]('─'[_0x12c16c(0x181)](0x3c));}if(_0x24e526[_0x12c16c(0x1dc)]>0x0)for(const _0x4f7ad4 of _0x24e526){const _0xea66fc=_0x4f7ad4[_0x12c16c(0x1a3)]?_0x4f7ad4[_0x12c16c(0x1a3)]+'/'+_0x4f7ad4[_0x12c16c(0x189)][_0x12c16c(0x1ed)]:_0x4f7ad4[_0x12c16c(0x189)][_0x12c16c(0x1ed)];console['error']('\x0a'+a41_0x520b0c[_0x12c16c(0x1d8)](_0x12c16c(0x1a8))+'\x20'+_0xea66fc),console[_0x12c16c(0x1da)]('─'['repeat'](0x3c)),_0x4f7ad4[_0x12c16c(0x18b)]&&console[_0x12c16c(0x1da)](_0x4f7ad4['diff']),console[_0x12c16c(0x1da)]('─'[_0x12c16c(0x181)](0x3c));}const _0x47baa9=_0x6b5901['filter'](_0x323d72=>!_0x323d72[_0x12c16c(0x1bb)]&&_0x323d72[_0x12c16c(0x18b)]);if(_0x47baa9[_0x12c16c(0x1dc)]>0x0)for(const _0x378aaf of _0x47baa9){const _0x5672be=_0x378aaf[_0x12c16c(0x1a3)]?_0x378aaf[_0x12c16c(0x1a3)]+'/'+_0x378aaf[_0x12c16c(0x189)][_0x12c16c(0x1ed)]:_0x378aaf[_0x12c16c(0x189)][_0x12c16c(0x1ed)];console['error']('\x0a'+a41_0x520b0c['yellow'](_0x12c16c(0x1b8))+'\x20'+_0x5672be),console[_0x12c16c(0x1da)]('─'[_0x12c16c(0x181)](0x3c)),console[_0x12c16c(0x1da)](_0x378aaf[_0x12c16c(0x18b)]),console['error']('─'[_0x12c16c(0x181)](0x3c));}if(_0x5cfe6b[_0x12c16c(0x1dc)]>0x0)for(const _0x48a4bc of _0x5cfe6b){const _0x1ba6fb=_0x48a4bc[_0x12c16c(0x176)]?_0x20102c[_0x12c16c(0x1f4)](_0x48a4bc['folderId'])||'':'',_0x525602=_0x1ba6fb?_0x1ba6fb+'/'+_0x48a4bc[_0x12c16c(0x175)]:_0x48a4bc[_0x12c16c(0x175)];console['error']('\x0a'+a41_0x520b0c[_0x12c16c(0x16f)](_0x12c16c(0x20f))+'\x20'+_0x525602),console['error']('─'[_0x12c16c(0x181)](0x3c)),console['error'](a41_0x520b0c[_0x12c16c(0x16f)](_0x12c16c(0x1dd))),console[_0x12c16c(0x1da)]('─'[_0x12c16c(0x181)](0x3c));}if(_0x3c0b61[_0x12c16c(0x171)])return console[_0x12c16c(0x1da)](a41_0x520b0c[_0x12c16c(0x1bf)](_0x12c16c(0x1f8))),0x0;const _0x5274a7=_0x3c0b61[_0x12c16c(0x1c3)]?![]:_0x419a38[_0x12c16c(0x1dc)]>0x0||_0x58b830[_0x12c16c(0x1dc)]>0x0||_0x2aea5c['length']>0x0,_0x1c1322=_0x24e526[_0x12c16c(0x1dc)]>0x0||_0x142280['length']>0x0||_0x5cfe6b['length']>0x0,_0x2b71c6=_0x3c0b61[_0x12c16c(0x1c3)]?![]:_0x30500f[_0x12c16c(0x1dc)]>0x0,_0xd87fca=_0x537f19[_0x12c16c(0x1dc)]>0x0;if(!_0x5274a7&&!_0x1c1322&&!_0x2b71c6&&!_0xd87fca){const _0x428120=_0x3c0b61[_0x12c16c(0x1c3)]?_0x12c16c(0x201):_0x12c16c(0x20e);console[_0x12c16c(0x1da)](a41_0x520b0c[_0x12c16c(0x1d8)](_0x428120));if(_0x1c1441&&_0x4015b3[_0x12c16c(0x1dc)]===0x1){const _0x3643a7=_0x4015b3[0x0];if(_0x3643a7[_0x12c16c(0x19c)]?.['id']){const _0x4f3479=getConsoleNextUrl(_0x3c0b61[_0x12c16c(0x197)],_0x12c16c(0x1b5)+_0x5e4a86+_0x12c16c(0x1a1)+_0x3643a7[_0x12c16c(0x19c)]['id']+_0x12c16c(0x182));console[_0x12c16c(0x1da)](_0x12c16c(0x1b6)+a41_0x520b0c[_0x12c16c(0x1f7)](_0x4f3479));}}if(_0x1c1441&&_0x475e69[_0x12c16c(0x1dc)]===0x1){const _0x625342=_0x475e69[0x0];if(_0x625342[_0x12c16c(0x1a7)]?.['id']){const _0x463daf=getConsoleNextUrl(_0x3c0b61[_0x12c16c(0x197)],_0x12c16c(0x1b5)+_0x5e4a86+_0x12c16c(0x1a1)+_0x625342[_0x12c16c(0x1a7)]['id']+_0x12c16c(0x1b3));console[_0x12c16c(0x1da)]('\x20\x20'+a41_0x520b0c['cyan'](_0x463daf));}}return 0x0;}const _0x596c4f=_0x3c0b61[_0x12c16c(0x1c3)]?_0x24e526['length']+_0x142280[_0x12c16c(0x1dc)]+_0x5cfe6b[_0x12c16c(0x1dc)]+_0x537f19[_0x12c16c(0x1dc)]:_0x419a38[_0x12c16c(0x1dc)]+_0x58b830[_0x12c16c(0x1dc)]+_0x2aea5c[_0x12c16c(0x1dc)]+_0x24e526['length']+_0x142280[_0x12c16c(0x1dc)]+_0x5cfe6b[_0x12c16c(0x1dc)]+_0x537f19[_0x12c16c(0x1dc)]+_0x30500f[_0x12c16c(0x1dc)];if(!_0x3c0b61[_0x12c16c(0x1be)]&&_0x596c4f>0x0){if(!isInteractive())return console[_0x12c16c(0x1da)](a41_0x520b0c[_0x12c16c(0x16f)](_0x12c16c(0x1de)),_0x12c16c(0x1ea)),console[_0x12c16c(0x1da)](a41_0x520b0c[_0x12c16c(0x1b9)](_0x12c16c(0x1a0))),0x1;const _0x4b9c5a=await confirmKey('Push\x20'+_0x596c4f+'\x20changes?');if(!_0x4b9c5a)return console[_0x12c16c(0x1da)](a41_0x520b0c[_0x12c16c(0x1bf)](_0x12c16c(0x180))),0x1;}const _0x205360={'withProgress':async(_0x347441,_0x1d327e)=>{const _0x4f16e=_0x12c16c,_0x3bdda3=await withSpinner(_0x347441,_0x1d327e,{'verbose':_0x3c0b61[_0x4f16e(0x172)]});return{'data':_0x3bdda3[_0x4f16e(0x1df)]};},'logInfo':_0x6265f4=>console['error'](a41_0x520b0c[_0x12c16c(0x1fb)]('✔\x20'+_0x6265f4)),'logSuccess':_0x556391=>console[_0x12c16c(0x1da)](a41_0x520b0c[_0x12c16c(0x1d8)]('✔\x20'+_0x556391)),'logWarning':_0x495ffd=>console[_0x12c16c(0x1da)](a41_0x520b0c[_0x12c16c(0x1bf)]('⚠\x20'+_0x495ffd)),'logDeleted':_0x3fec25=>console[_0x12c16c(0x1da)](a41_0x520b0c[_0x12c16c(0x16f)]('✔\x20'+_0x3fec25))},_0x23f93a={'segment':_0x242946[_0x12c16c(0x1e9)],'journey':_0x242946[_0x12c16c(0x1b1)],'user':_0x242946[_0x12c16c(0x1a4)],'connection':_0x242946['connection']};_0x537f19['length']>0x0&&(_0x351ae4=await executePushFolders(_0x23f93a,_0x537f19,_0x351ae4,{'parentId':_0x5e4a86},_0x205360));const _0x50d9e3={'rootFolderId':_0x429d29,'folderPathToId':_0x351ae4,'folderIdToPath':_0x20102c,'segmentNameToId':_0x343767,'activationsBySegmentId':_0x1db030,'emailToIdMap':_0x243ccf,'idToEmailMap':_0x3a3d39,'connectionNameToIdMap':_0x299c6c[_0x12c16c(0x19b)],'connectionIdToNameMap':_0x299c6c['idToName'],'connectionNameToTypeMap':_0x376967},_0x470939=await executePushSegments(_0x23f93a,_0x3c0b61[_0x12c16c(0x1c3)]?[]:_0xc90404,_0x50d9e3,{'parentId':_0x5e4a86},_0x205360),_0x3e9f7e=_0x470939[_0x12c16c(0x20d)],_0x145e84=_0x470939[_0x12c16c(0x198)],_0x4fa6f5=_0x470939[_0x12c16c(0x19f)]['created'],_0x4bf6d7=_0x470939[_0x12c16c(0x19f)][_0x12c16c(0x198)],_0x58ee5c=_0x470939[_0x12c16c(0x19f)][_0x12c16c(0x1e8)];let _0x365296;if(_0x1c1441&&_0xc90404['length']===0x1){const _0x152962=_0xc90404[0x0];_0x365296=_0x152962[_0x12c16c(0x19c)]?.['id']??_0x470939[_0x12c16c(0x1a2)][_0x12c16c(0x1f4)](_0x152962[_0x12c16c(0x189)]['name']);}const _0x52914f=await executePushSegmentDeletions(_0x23f93a,_0x3c0b61[_0x12c16c(0x1c3)]?[]:_0x2aea5c,_0x205360);let _0x5c7cc2=0x0,_0x110590=0x0,_0x3677a4=0x0;const _0x4c1300=new Map(_0x343767);for(const [_0x2075d0,_0x41d00d]of _0x470939[_0x12c16c(0x1a2)]){_0x4c1300[_0x12c16c(0x1c6)](_0x2075d0,_0x41d00d);}if(_0x6b5901[_0x12c16c(0x1dc)]>0x0){const _0x262688={..._0x50d9e3,'segmentNameToId':_0x4c1300,'existingSegments':_0x31e4cc,'activationContext':_0x536c7a},_0x47c8b3=await executePushJourneys(_0x23f93a,_0x6b5901,_0x262688,{'parentId':_0x5e4a86,'rootFolderId':_0x429d29,'verbose':_0x3c0b61['verbose']},_0x205360);_0x5c7cc2=_0x47c8b3[_0x12c16c(0x20d)],_0x110590=_0x47c8b3[_0x12c16c(0x198)];if(_0x1c1441&&_0x47c8b3['results'][_0x12c16c(0x1dc)]===0x1){const _0x24bc33=_0x47c8b3[_0x12c16c(0x207)][0x0];if(_0x24bc33[_0x12c16c(0x1ab)]){const _0x4f7617=getConsoleNextUrl(_0x3c0b61[_0x12c16c(0x197)],_0x12c16c(0x1b5)+_0x5e4a86+'/e/'+_0x24bc33[_0x12c16c(0x1ab)]+_0x12c16c(0x1b3));console[_0x12c16c(0x1da)]('\x20\x20'+a41_0x520b0c['cyan'](_0x4f7617));}}}for(const _0x309ac3 of _0x5cfe6b){console[_0x12c16c(0x1da)](a41_0x520b0c['yellow'](_0x12c16c(0x187)+_0x309ac3[_0x12c16c(0x175)])),_0x3677a4++;}const _0x309d87=[];if(_0x3e9f7e>0x0)_0x309d87[_0x12c16c(0x1d2)](_0x3e9f7e+_0x12c16c(0x196));if(_0x145e84>0x0)_0x309d87[_0x12c16c(0x1d2)](_0x145e84+_0x12c16c(0x17c));if(_0x52914f>0x0)_0x309d87['push'](_0x52914f+'\x20deleted');const _0x5bc7d8=[];if(_0x5c7cc2>0x0)_0x5bc7d8[_0x12c16c(0x1d2)](_0x5c7cc2+_0x12c16c(0x196));if(_0x110590>0x0)_0x5bc7d8[_0x12c16c(0x1d2)](_0x110590+_0x12c16c(0x17c));if(_0x3677a4>0x0)_0x5bc7d8[_0x12c16c(0x1d2)](_0x3677a4+_0x12c16c(0x1ce));const _0x1cb9e4=[];if(_0x4fa6f5>0x0)_0x1cb9e4['push'](_0x4fa6f5+_0x12c16c(0x196));if(_0x4bf6d7>0x0)_0x1cb9e4[_0x12c16c(0x1d2)](_0x4bf6d7+_0x12c16c(0x17c));if(_0x58ee5c>0x0)_0x1cb9e4[_0x12c16c(0x1d2)](_0x58ee5c+_0x12c16c(0x1ce));console[_0x12c16c(0x1da)](a41_0x520b0c['green'](_0x12c16c(0x1f5)));_0x309d87[_0x12c16c(0x1dc)]>0x0&&!_0x3c0b61['journeysOnly']&&console[_0x12c16c(0x1da)]('\x20\x20Segments:\x20'+_0x309d87[_0x12c16c(0x1b0)](',\x20'));_0x5bc7d8[_0x12c16c(0x1dc)]>0x0&&console['error']('\x20\x20Journeys:\x20'+_0x5bc7d8['join'](',\x20'));_0x1cb9e4[_0x12c16c(0x1dc)]>0x0&&!_0x3c0b61[_0x12c16c(0x1c3)]&&console[_0x12c16c(0x1da)](_0x12c16c(0x200)+_0x1cb9e4[_0x12c16c(0x1b0)](',\x20'));if(_0x365296){const _0x2d77b7=getConsoleNextUrl(_0x3c0b61[_0x12c16c(0x197)],'/app/ps/'+_0x5e4a86+_0x12c16c(0x1a1)+_0x365296+_0x12c16c(0x182));console['error'](_0x12c16c(0x1b6)+a41_0x520b0c[_0x12c16c(0x1f7)](_0x2d77b7));}return 0x0;}}
@@ -1 +1 @@
1
- const a42_0x4bf941=a42_0x2ead;function a42_0x2ead(_0x4d1faf,_0x58a07d){_0x4d1faf=_0x4d1faf-0xab;const _0x58b76c=a42_0x58b7();let _0x2ead19=_0x58b76c[_0x4d1faf];return _0x2ead19;}function a42_0x58b7(){const _0x37536b=['type','segment','updateSegmentById','yellow','62587QynrAG','name','\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','error','segmentId','.\x20Only\x20child\x20segments\x20can\x20be\x20updated.','237127oNihAQ','963qXFnpr','verbose','2135010CLHerX','Error:\x20Cannot\x20update\x20','Examples:','Segment\x20ID\x20missing\x20from\x20resolved\x20path','data','684krrzXj','\x27...','execute','resolveFolderId','1656024QtZszO','704oOEGhr','includes','ruleFile','44190OGwXui','Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]','kind','Update\x20existing\x20child\x20segment','segmentPath','⚠\x20Deprecation\x20warning:\x20`segment\x20update`\x20is\x20deprecated.','3254180SYvHyN','Resolved\x20folder\x20ID:\x20','397109TpcluU','2aiKfAv','Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]','Resolving\x20path\x20\x27','parentId','4DihEgk','Updating\x20segment\x20\x27','resolvePathToResource','rule','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','Parent\x20ID:\x20','Resolving\x20folder\x20\x27','\x20\x20\x20Path:\x20'];a42_0x58b7=function(){return _0x37536b;};return a42_0x58b7();}(function(_0x1860ab,_0x1f954b){const _0x26654d=a42_0x2ead,_0x5b4a6c=_0x1860ab();while(!![]){try{const _0x44300a=-parseInt(_0x26654d(0xb6))/0x1*(-parseInt(_0x26654d(0xb7))/0x2)+-parseInt(_0x26654d(0xd0))/0x3+-parseInt(_0x26654d(0xbb))/0x4*(-parseInt(_0x26654d(0xb4))/0x5)+parseInt(_0x26654d(0xd9))/0x6+-parseInt(_0x26654d(0xc7))/0x7*(parseInt(_0x26654d(0xab))/0x8)+-parseInt(_0x26654d(0xce))/0x9*(parseInt(_0x26654d(0xae))/0xa)+parseInt(_0x26654d(0xcd))/0xb*(parseInt(_0x26654d(0xd5))/0xc);if(_0x44300a===_0x1f954b)break;else _0x5b4a6c['push'](_0x5b4a6c['shift']());}catch(_0x1052bd){_0x5b4a6c['push'](_0x5b4a6c['shift']());}}}(a42_0x58b7,0x8df0b));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{SDKError,ErrorCode}from'../sdk/index.js';import a42_0x5d0fcc from'chalk';export class SegmentUpdateCommand extends BaseCommand{[a42_0x4bf941(0xc8)]='segment:update';['description']=a42_0x4bf941(0xb1);async[a42_0x4bf941(0xd7)](_0x148b37){const _0x34a054=a42_0x4bf941;console['error'](a42_0x5d0fcc[_0x34a054(0xc6)](_0x34a054(0xb3))),console[_0x34a054(0xca)](a42_0x5d0fcc[_0x34a054(0xc6)](_0x34a054(0xbf)));const {options:_0x33a545,args:_0x4134c5,tdx:_0x10a3a7}=_0x148b37,_0x2cbaaa=_0x33a545;if(_0x4134c5['length']===0x0)return console['error']('Error:\x20Segment\x20path\x20or\x20name\x20is\x20required'),console[_0x34a054(0xca)](_0x34a054(0xaf)),console[_0x34a054(0xca)](_0x34a054(0xd2)),console[_0x34a054(0xca)]('\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22'),console[_0x34a054(0xca)](_0x34a054(0xc9)),0x1;const _0x1c3d2d=_0x4134c5[0x0],_0x1056d4=_0x33a545[_0x34a054(0xb2)];let _0x37b520=_0x1c3d2d;_0x1056d4&&!_0x1c3d2d[_0x34a054(0xac)]('/')&&(_0x37b520=_0x1056d4+'/'+_0x1c3d2d,_0x2cbaaa['verbose']&&console[_0x34a054(0xca)]('Resolved\x20relative\x20path\x20to:\x20'+_0x37b520));const _0x15bc6e=await withSpinner(_0x34a054(0xb9)+_0x37b520+_0x34a054(0xd6),()=>_0x10a3a7[_0x34a054(0xc4)][_0x34a054(0xbd)](_0x37b520),{'verbose':_0x2cbaaa[_0x34a054(0xcf)]}),_0x5f41f3=_0x15bc6e[_0x34a054(0xd4)];_0x2cbaaa['verbose']&&console['error']('Resolved\x20type:\x20'+_0x5f41f3['type']);if(_0x5f41f3['type']!==_0x34a054(0xc4))return console[_0x34a054(0xca)](_0x34a054(0xd1)+_0x5f41f3[_0x34a054(0xc3)]+_0x34a054(0xcc)),console[_0x34a054(0xca)](_0x34a054(0xb8)),0x1;if(!_0x5f41f3[_0x34a054(0xcb)])throw new SDKError(ErrorCode['INTERNAL'],_0x34a054(0xd3));const _0x49e737=_0x5f41f3[_0x34a054(0xba)],_0x453ea4=_0x5f41f3[_0x34a054(0xcb)];_0x2cbaaa[_0x34a054(0xcf)]&&(console[_0x34a054(0xca)](_0x34a054(0xc0)+_0x49e737),console[_0x34a054(0xca)]('Segment\x20ID:\x20'+_0x453ea4));let _0x32ee19;if(_0x2cbaaa['folder']){const _0x49d4d8=_0x2cbaaa['folder'],_0x102c71=await withSpinner(_0x34a054(0xc1)+_0x49d4d8+_0x34a054(0xd6),()=>_0x10a3a7[_0x34a054(0xc4)][_0x34a054(0xd8)](_0x49e737,_0x49d4d8),{'verbose':_0x2cbaaa[_0x34a054(0xcf)]});_0x32ee19=parseInt(_0x102c71['data'],0xa),_0x2cbaaa['verbose']&&console['error'](_0x34a054(0xb5)+_0x32ee19);}const _0x220198=await loadJSONFromOptions(_0x2cbaaa[_0x34a054(0xbe)],_0x2cbaaa[_0x34a054(0xad)]),_0x1176ed={'name':_0x2cbaaa['name'],'description':_0x2cbaaa['description'],'rule':_0x220198,'kind':_0x2cbaaa[_0x34a054(0xb0)]!==undefined?parseInt(_0x2cbaaa[_0x34a054(0xb0)],0xa):undefined,'segmentFolderId':_0x32ee19},_0x36bccc=await withSpinner(_0x34a054(0xbc)+_0x5f41f3['segmentName']+_0x34a054(0xd6),()=>_0x10a3a7['segment'][_0x34a054(0xc5)](_0x49e737,_0x453ea4,_0x1176ed),{'verbose':_0x2cbaaa[_0x34a054(0xcf)]}),_0x34949c=_0x36bccc[_0x34a054(0xd4)];return console[_0x34a054(0xca)]('✔\x20Updated\x20segment\x20\x27'+_0x34949c[_0x34a054(0xc8)]+'\x27'),_0x37b520!==_0x1c3d2d&&console[_0x34a054(0xca)](_0x34a054(0xc2)+_0x37b520),await handleSDKOutput([_0x34949c],_0x2cbaaa),0x0;}}
1
+ const a42_0x53ae96=a42_0x3f73;(function(_0xbc3a08,_0x13f935){const _0x59fbe8=a42_0x3f73,_0x5df94e=_0xbc3a08();while(!![]){try{const _0x1cbadc=-parseInt(_0x59fbe8(0x97))/0x1*(parseInt(_0x59fbe8(0x8e))/0x2)+parseInt(_0x59fbe8(0x84))/0x3+-parseInt(_0x59fbe8(0x88))/0x4*(parseInt(_0x59fbe8(0x7b))/0x5)+parseInt(_0x59fbe8(0x74))/0x6*(parseInt(_0x59fbe8(0x8b))/0x7)+-parseInt(_0x59fbe8(0x81))/0x8+parseInt(_0x59fbe8(0x70))/0x9+parseInt(_0x59fbe8(0x90))/0xa;if(_0x1cbadc===_0x13f935)break;else _0x5df94e['push'](_0x5df94e['shift']());}catch(_0x3969fd){_0x5df94e['push'](_0x5df94e['shift']());}}}(a42_0x4667,0xbd251));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';function a42_0x3f73(_0x15203a,_0x1ad293){_0x15203a=_0x15203a-0x68;const _0x4667d3=a42_0x4667();let _0x3f734f=_0x4667d3[_0x15203a];return _0x3f734f;}import{loadJSONFromOptions}from'../utils/json-loader.js';import{SDKError,ErrorCode}from'../sdk/index.js';function a42_0x4667(){const _0x57a916=['Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]','Resolving\x20path\x20\x27','updateSegmentById','6674YKuVSk','ruleFile','\x20\x20\x20Path:\x20','Resolving\x20folder\x20\x27','rule','Updating\x20segment\x20\x27','Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]','length','description','segment','9428544Tdfpem','\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','type','18ViDhPM','Segment\x20ID\x20missing\x20from\x20resolved\x20path','⚠\x20Deprecation\x20warning:\x20`segment\x20update`\x20is\x20deprecated.','error','kind','INTERNAL','segmentPath','184080TiElLD','resolveFolderId','Resolved\x20type:\x20','Error:\x20Cannot\x20update\x20','Segment\x20ID:\x20','execute','3657232WxPUYs','✔\x20Updated\x20segment\x20\x27','includes','4038063EQfrjb','segment:update','Resolved\x20relative\x20path\x20to:\x20','\x27...','124OgyDZK','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','Examples:','2249926TfNcAN','verbose','folder','298qYRqxx','name','97220xujDJk','data','resolvePathToResource','segmentId'];a42_0x4667=function(){return _0x57a916;};return a42_0x4667();}import a42_0x21cf4f from'chalk';export class SegmentUpdateCommand extends BaseCommand{[a42_0x53ae96(0x8f)]=a42_0x53ae96(0x85);[a42_0x53ae96(0x6e)]='Update\x20existing\x20child\x20segment';async[a42_0x53ae96(0x80)](_0x33ba26){const _0x177286=a42_0x53ae96;console['error'](a42_0x21cf4f['yellow'](_0x177286(0x76))),console[_0x177286(0x77)](a42_0x21cf4f['yellow'](_0x177286(0x89)));const {options:_0x5d1224,args:_0x296c30,tdx:_0x43d0a1}=_0x33ba26,_0x34c4ac=_0x5d1224;if(_0x296c30[_0x177286(0x6d)]===0x0)return console[_0x177286(0x77)](_0x177286(0x72)),console[_0x177286(0x77)](_0x177286(0x6c)),console[_0x177286(0x77)](_0x177286(0x8a)),console[_0x177286(0x77)](_0x177286(0x71)),console[_0x177286(0x77)]('\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context'),0x1;const _0x59868e=_0x296c30[0x0],_0x330d23=_0x5d1224[_0x177286(0x7a)];let _0x315411=_0x59868e;_0x330d23&&!_0x59868e[_0x177286(0x83)]('/')&&(_0x315411=_0x330d23+'/'+_0x59868e,_0x34c4ac[_0x177286(0x8c)]&&console['error'](_0x177286(0x86)+_0x315411));const _0x5218d2=await withSpinner(_0x177286(0x95)+_0x315411+_0x177286(0x87),()=>_0x43d0a1[_0x177286(0x6f)][_0x177286(0x92)](_0x315411),{'verbose':_0x34c4ac[_0x177286(0x8c)]}),_0x1c240a=_0x5218d2['data'];_0x34c4ac[_0x177286(0x8c)]&&console['error'](_0x177286(0x7d)+_0x1c240a[_0x177286(0x73)]);if(_0x1c240a['type']!=='segment')return console['error'](_0x177286(0x7e)+_0x1c240a[_0x177286(0x73)]+'.\x20Only\x20child\x20segments\x20can\x20be\x20updated.'),console[_0x177286(0x77)](_0x177286(0x94)),0x1;if(!_0x1c240a[_0x177286(0x93)])throw new SDKError(ErrorCode[_0x177286(0x79)],_0x177286(0x75));const _0x517eb7=_0x1c240a['parentId'],_0xa55fdb=_0x1c240a['segmentId'];_0x34c4ac[_0x177286(0x8c)]&&(console['error']('Parent\x20ID:\x20'+_0x517eb7),console[_0x177286(0x77)](_0x177286(0x7f)+_0xa55fdb));let _0x5c825d;if(_0x34c4ac[_0x177286(0x8d)]){const _0x2ceb06=_0x34c4ac[_0x177286(0x8d)],_0x23941e=await withSpinner(_0x177286(0x69)+_0x2ceb06+_0x177286(0x87),()=>_0x43d0a1[_0x177286(0x6f)][_0x177286(0x7c)](_0x517eb7,_0x2ceb06),{'verbose':_0x34c4ac[_0x177286(0x8c)]});_0x5c825d=parseInt(_0x23941e[_0x177286(0x91)],0xa),_0x34c4ac[_0x177286(0x8c)]&&console['error']('Resolved\x20folder\x20ID:\x20'+_0x5c825d);}const _0x21dc6f=await loadJSONFromOptions(_0x34c4ac[_0x177286(0x6a)],_0x34c4ac[_0x177286(0x98)]),_0x462da6={'name':_0x34c4ac[_0x177286(0x8f)],'description':_0x34c4ac[_0x177286(0x6e)],'rule':_0x21dc6f,'kind':_0x34c4ac[_0x177286(0x78)]!==undefined?parseInt(_0x34c4ac[_0x177286(0x78)],0xa):undefined,'segmentFolderId':_0x5c825d},_0x56af79=await withSpinner(_0x177286(0x6b)+_0x1c240a['segmentName']+_0x177286(0x87),()=>_0x43d0a1[_0x177286(0x6f)][_0x177286(0x96)](_0x517eb7,_0xa55fdb,_0x462da6),{'verbose':_0x34c4ac['verbose']}),_0x449098=_0x56af79[_0x177286(0x91)];return console['error'](_0x177286(0x82)+_0x449098[_0x177286(0x8f)]+'\x27'),_0x315411!==_0x59868e&&console[_0x177286(0x77)](_0x177286(0x68)+_0x315411),await handleSDKOutput([_0x449098],_0x34c4ac),0x0;}}
@@ -1 +1 @@
1
- const a43_0x494119=a43_0x29b6;function a43_0x29b6(_0x56bda0,_0x2aa151){_0x56bda0=_0x56bda0-0x192;const _0x2fb86d=a43_0x2fb8();let _0x29b637=_0x2fb86d[_0x56bda0];return _0x29b637;}(function(_0x13af76,_0x4328ff){const _0x5b7b90=a43_0x29b6,_0x4ec1a7=_0x13af76();while(!![]){try{const _0x13e945=-parseInt(_0x5b7b90(0x1b1))/0x1*(parseInt(_0x5b7b90(0x1b9))/0x2)+parseInt(_0x5b7b90(0x1bf))/0x3*(parseInt(_0x5b7b90(0x19b))/0x4)+-parseInt(_0x5b7b90(0x1ba))/0x5+-parseInt(_0x5b7b90(0x1ad))/0x6*(-parseInt(_0x5b7b90(0x199))/0x7)+parseInt(_0x5b7b90(0x1c5))/0x8*(parseInt(_0x5b7b90(0x1c7))/0x9)+-parseInt(_0x5b7b90(0x1bd))/0xa+-parseInt(_0x5b7b90(0x1a8))/0xb*(-parseInt(_0x5b7b90(0x1ab))/0xc);if(_0x13e945===_0x4328ff)break;else _0x4ec1a7['push'](_0x4ec1a7['shift']());}catch(_0x1f2af6){_0x4ec1a7['push'](_0x4ec1a7['shift']());}}}(a43_0x2fb8,0xe0162));import{existsSync,statSync}from'fs';function a43_0x2fb8(){const _0x17aec1=['error','type','folderPath','dim','\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','✔\x20Context\x20set\x20to:\x20','isAbsolute','Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','Use\x20\x22tdx\x20use\x22\x20to\x20see\x20all\x20context\x20parameters','66QoAmPI','Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.','Examples:','2665692sUbJvg','\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context','6jWqrHC','parentId','Error:\x20Path\x20is\x20required\x0a','Resolved\x20relative\x20path\x20to:\x20','759mcLoIt','session','Parent\x20ID:\x20','verbose','✔\x20Context\x20cleared.\x20Back\x20to\x20root.','Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.','fullPath','Set\x20current\x20segment/folder\x20context\x20for\x20navigation','1810ApABoq','3515510BViBty','folderId','cyan','8586320IOoCcK','green','2095473IwfQtI','resolvePathToResource','config','site','parentName','join','3299208lcoDfi','segment','9tefGpU','name','execute','description','\x27...','segmentPath','slice','segment:use','red','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22','Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.','log','split','parent_segment','Resolving\x20path\x20\x27','5059243imEKjH','Resolved\x20path\x20type:\x20','4RXIvZv','Usage:\x20tdx\x20segment\x20use\x20<path>','length'];a43_0x2fb8=function(){return _0x17aec1;};return a43_0x2fb8();}import a43_0x2d0b15 from'chalk';import{BaseCommand}from'./command.js';import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';import{parsePath,normalizePath}from'../sdk/segment/segment-path-parser.js';import{findTdxConfig}from'../sdk/segment/tdx-config.js';export class SegmentUseCommand extends BaseCommand{[a43_0x494119(0x1c8)]=a43_0x494119(0x1ce);[a43_0x494119(0x1ca)]=a43_0x494119(0x1b8);async[a43_0x494119(0x1c9)](_0x380a4d){const _0xd2939f=a43_0x494119,{options:_0x12e000,args:_0x205da8,tdx:_0x2903e3}=_0x380a4d;if(_0x205da8[_0xd2939f(0x19d)]===0x0)return console[_0xd2939f(0x19e)](a43_0x2d0b15[_0xd2939f(0x192)](_0xd2939f(0x1af))),console['error'](_0xd2939f(0x19c)),console['error'](_0xd2939f(0x1aa)),console[_0xd2939f(0x19e)]('\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22'),console['error'](_0xd2939f(0x193)),console[_0xd2939f(0x19e)](_0xd2939f(0x1ac)),console['error'](_0xd2939f(0x1a2)),0x1;const _0x331927=_0x205da8[0x0],_0x759e0=_0x12e000[_0xd2939f(0x1b2)];try{if(_0x331927==='/')return saveSessionContext({'segment_path':undefined},_0x759e0),console[_0xd2939f(0x195)](a43_0x2d0b15[_0xd2939f(0x1be)](_0xd2939f(0x1b5))),0x0;if(existsSync(_0x331927)&&statSync(_0x331927)['isDirectory']()){let _0x46639e;try{_0x46639e=findTdxConfig(_0x331927);}catch{return console[_0xd2939f(0x19e)](a43_0x2d0b15['red'](_0xd2939f(0x1a6)+_0x331927)),console[_0xd2939f(0x19e)](a43_0x2d0b15['cyan'](_0xd2939f(0x1a3))),0x1;}const _0x7e31de=_0x46639e[_0xd2939f(0x1c1)][_0xd2939f(0x197)];return saveSessionContext({'segment_path':_0x7e31de,'parent_segment':_0x7e31de},_0x759e0),console[_0xd2939f(0x195)](a43_0x2d0b15['green']('✔\x20Context\x20set\x20to:\x20'+a43_0x2d0b15[_0xd2939f(0x1bc)](_0x7e31de))),0x0;}const _0x3ee307=_0x12e000[_0xd2939f(0x1cc)];let _0x4d8f51=_0x331927;const _0x1b32ef=parsePath(_0x331927);if(!_0x1b32ef[_0xd2939f(0x1a5)]){if(!_0x3ee307)return console[_0xd2939f(0x19e)](a43_0x2d0b15[_0xd2939f(0x192)](_0xd2939f(0x1b6))),console[_0xd2939f(0x19e)](a43_0x2d0b15['cyan']('Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>')),0x1;if(_0x331927==='..'){const _0x37aef3=_0x3ee307[_0xd2939f(0x196)]('/')[_0xd2939f(0x1cd)](0x0,-0x1)[_0xd2939f(0x1c4)]('/');_0x4d8f51=_0x37aef3||'/';}else _0x331927==='.'?_0x4d8f51=_0x3ee307:_0x4d8f51=_0x3ee307+'/'+_0x331927;_0x12e000['verbose']&&console[_0xd2939f(0x19e)](_0xd2939f(0x1b0)+_0x4d8f51);}if(_0x4d8f51==='/'||_0x4d8f51==='')return saveSessionContext({'segment_path':undefined},_0x759e0),console['log'](a43_0x2d0b15['green'](_0xd2939f(0x1b5))),0x0;_0x4d8f51=normalizePath(_0x4d8f51);const _0x55b0b1=parsePath(_0x4d8f51)['segments'];if(_0x55b0b1['length']===0x0)return saveSessionContext({'segment_path':undefined},_0x759e0),console[_0xd2939f(0x195)](a43_0x2d0b15[_0xd2939f(0x1be)](_0xd2939f(0x1b5))),0x0;_0x12e000[_0xd2939f(0x1b4)]&&(console[_0xd2939f(0x19e)]('Site:\x20'+_0x12e000[_0xd2939f(0x1c2)]),console['error']('Target\x20path:\x20'+_0x4d8f51));const _0x147928=await withSpinner(_0xd2939f(0x198)+_0x4d8f51+_0xd2939f(0x1cb),()=>_0x2903e3[_0xd2939f(0x1c6)][_0xd2939f(0x1c0)](_0x4d8f51),{'verbose':_0x12e000[_0xd2939f(0x1b4)]}),_0x586982=_0x147928['data'];_0x12e000[_0xd2939f(0x1b4)]&&(console[_0xd2939f(0x19e)](_0xd2939f(0x19a)+_0x586982[_0xd2939f(0x19f)]),console[_0xd2939f(0x19e)](_0xd2939f(0x1b3)+_0x586982[_0xd2939f(0x1ae)]),_0x586982[_0xd2939f(0x1bb)]&&console[_0xd2939f(0x19e)]('Folder\x20ID:\x20'+_0x586982['folderId']));if(_0x586982['type']===_0xd2939f(0x1c6))return console[_0xd2939f(0x19e)](a43_0x2d0b15[_0xd2939f(0x192)](_0xd2939f(0x194))),console[_0xd2939f(0x19e)](_0xd2939f(0x1a9)),console[_0xd2939f(0x19e)](a43_0x2d0b15[_0xd2939f(0x1bc)]('Use:\x20tdx\x20segment\x20use\x20'+_0x586982['parentName']+(_0x586982['folderPath']?'/'+_0x586982[_0xd2939f(0x1a0)]['join']('/'):''))),0x1;return saveSessionContext({'segment_path':_0x586982[_0xd2939f(0x1b7)],'parent_segment':_0x586982[_0xd2939f(0x1c3)]},_0x759e0),console[_0xd2939f(0x195)](a43_0x2d0b15['green'](_0xd2939f(0x1a4)+a43_0x2d0b15[_0xd2939f(0x1bc)](_0x586982[_0xd2939f(0x1b7)]))),_0x12e000[_0xd2939f(0x1b4)]&&(console[_0xd2939f(0x19e)](a43_0x2d0b15['dim']('Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context')),console[_0xd2939f(0x19e)](a43_0x2d0b15[_0xd2939f(0x1a1)](_0xd2939f(0x1a7)))),0x0;}catch(_0x122537){throw _0x122537;}}}
1
+ const a43_0x54d526=a43_0xf161;(function(_0x425b49,_0x352954){const _0x58dcb7=a43_0xf161,_0x3c4fbc=_0x425b49();while(!![]){try{const _0x50b19e=parseInt(_0x58dcb7(0x1b2))/0x1+parseInt(_0x58dcb7(0x1a3))/0x2+parseInt(_0x58dcb7(0x1ba))/0x3+parseInt(_0x58dcb7(0x1a7))/0x4+-parseInt(_0x58dcb7(0x1cd))/0x5*(parseInt(_0x58dcb7(0x1be))/0x6)+-parseInt(_0x58dcb7(0x1a6))/0x7+parseInt(_0x58dcb7(0x1c2))/0x8;if(_0x50b19e===_0x352954)break;else _0x3c4fbc['push'](_0x3c4fbc['shift']());}catch(_0x29021f){_0x3c4fbc['push'](_0x3c4fbc['shift']());}}}(a43_0xac79,0x45690));function a43_0xac79(){const _0x42b185=['181771mKgQgC','parentName','isDirectory','folderPath','segments','execute','folderId','description','424482lQYnib','Resolved\x20relative\x20path\x20to:\x20','log','Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.','1272ZDpAYb','Parent\x20ID:\x20','dim','Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>','159904dAgwFt','segment','Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context','Use:\x20tdx\x20segment\x20use\x20','parentId','Resolving\x20path\x20\x27','Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','Set\x20current\x20segment/folder\x20context\x20for\x20navigation','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22','fullPath','error','7055JPusTf','cyan','length','type','green','✔\x20Context\x20set\x20to:\x20','data','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22','parent_segment','872132ziCFOW','split','red','3093860tZemEM','984388DXPYSE','isAbsolute','Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.','✔\x20Context\x20cleared.\x20Back\x20to\x20root.','segment:use','config','segmentPath','join','Site:\x20','verbose','Error:\x20Path\x20is\x20required\x0a'];a43_0xac79=function(){return _0x42b185;};return a43_0xac79();}import{existsSync,statSync}from'fs';import a43_0x599093 from'chalk';import{BaseCommand}from'./command.js';import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';import{parsePath,normalizePath}from'../sdk/segment/segment-path-parser.js';import{findTdxConfig}from'../sdk/segment/tdx-config.js';function a43_0xf161(_0x35be0f,_0x1ca05a){_0x35be0f=_0x35be0f-0x1a3;const _0xac7999=a43_0xac79();let _0xf16137=_0xac7999[_0x35be0f];return _0xf16137;}export class SegmentUseCommand extends BaseCommand{['name']=a43_0x54d526(0x1ab);[a43_0x54d526(0x1b9)]=a43_0x54d526(0x1c9);async[a43_0x54d526(0x1b7)](_0xabc026){const _0x144e89=a43_0x54d526,{options:_0x4a0225,args:_0x272a32,tdx:_0x44dde8}=_0xabc026;if(_0x272a32[_0x144e89(0x1cf)]===0x0)return console['error'](a43_0x599093['red'](_0x144e89(0x1b1))),console[_0x144e89(0x1cc)]('Usage:\x20tdx\x20segment\x20use\x20<path>'),console[_0x144e89(0x1cc)]('Examples:'),console[_0x144e89(0x1cc)](_0x144e89(0x1ca)),console[_0x144e89(0x1cc)](_0x144e89(0x1d4)),console[_0x144e89(0x1cc)]('\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context'),console[_0x144e89(0x1cc)]('\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 _0x454bcd=_0x272a32[0x0],_0x2ec9ad=_0x4a0225['session'];try{if(_0x454bcd==='/')return saveSessionContext({'segment_path':undefined},_0x2ec9ad),console[_0x144e89(0x1bc)](a43_0x599093[_0x144e89(0x1d1)]('✔\x20Context\x20cleared.\x20Back\x20to\x20root.')),0x0;if(existsSync(_0x454bcd)&&statSync(_0x454bcd)[_0x144e89(0x1b4)]()){let _0x50520b;try{_0x50520b=findTdxConfig(_0x454bcd);}catch{return console['error'](a43_0x599093['red'](_0x144e89(0x1c8)+_0x454bcd)),console['error'](a43_0x599093['cyan']('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;}const _0x24181a=_0x50520b[_0x144e89(0x1ac)][_0x144e89(0x1d5)];return saveSessionContext({'segment_path':_0x24181a,'parent_segment':_0x24181a},_0x2ec9ad),console[_0x144e89(0x1bc)](a43_0x599093['green'](_0x144e89(0x1d2)+a43_0x599093[_0x144e89(0x1ce)](_0x24181a))),0x0;}const _0x583c83=_0x4a0225[_0x144e89(0x1ad)];let _0x475497=_0x454bcd;const _0x5c580b=parsePath(_0x454bcd);if(!_0x5c580b[_0x144e89(0x1a8)]){if(!_0x583c83)return console[_0x144e89(0x1cc)](a43_0x599093[_0x144e89(0x1a5)]('Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.')),console['error'](a43_0x599093['cyan'](_0x144e89(0x1c1))),0x1;if(_0x454bcd==='..'){const _0x7181c3=_0x583c83[_0x144e89(0x1a4)]('/')['slice'](0x0,-0x1)[_0x144e89(0x1ae)]('/');_0x475497=_0x7181c3||'/';}else _0x454bcd==='.'?_0x475497=_0x583c83:_0x475497=_0x583c83+'/'+_0x454bcd;_0x4a0225[_0x144e89(0x1b0)]&&console[_0x144e89(0x1cc)](_0x144e89(0x1bb)+_0x475497);}if(_0x475497==='/'||_0x475497==='')return saveSessionContext({'segment_path':undefined},_0x2ec9ad),console[_0x144e89(0x1bc)](a43_0x599093[_0x144e89(0x1d1)](_0x144e89(0x1aa))),0x0;_0x475497=normalizePath(_0x475497);const _0xe4b082=parsePath(_0x475497)[_0x144e89(0x1b6)];if(_0xe4b082[_0x144e89(0x1cf)]===0x0)return saveSessionContext({'segment_path':undefined},_0x2ec9ad),console['log'](a43_0x599093[_0x144e89(0x1d1)](_0x144e89(0x1aa))),0x0;_0x4a0225['verbose']&&(console[_0x144e89(0x1cc)](_0x144e89(0x1af)+_0x4a0225['site']),console['error']('Target\x20path:\x20'+_0x475497));const _0x4e08b1=await withSpinner(_0x144e89(0x1c7)+_0x475497+'\x27...',()=>_0x44dde8[_0x144e89(0x1c3)]['resolvePathToResource'](_0x475497),{'verbose':_0x4a0225[_0x144e89(0x1b0)]}),_0x1fc742=_0x4e08b1[_0x144e89(0x1d3)];_0x4a0225[_0x144e89(0x1b0)]&&(console['error']('Resolved\x20path\x20type:\x20'+_0x1fc742['type']),console[_0x144e89(0x1cc)](_0x144e89(0x1bf)+_0x1fc742[_0x144e89(0x1c6)]),_0x1fc742[_0x144e89(0x1b8)]&&console[_0x144e89(0x1cc)]('Folder\x20ID:\x20'+_0x1fc742['folderId']));if(_0x1fc742[_0x144e89(0x1d0)]===_0x144e89(0x1c3))return console['error'](a43_0x599093[_0x144e89(0x1a5)](_0x144e89(0x1a9))),console['error'](_0x144e89(0x1bd)),console[_0x144e89(0x1cc)](a43_0x599093[_0x144e89(0x1ce)](_0x144e89(0x1c5)+_0x1fc742[_0x144e89(0x1b3)]+(_0x1fc742[_0x144e89(0x1b5)]?'/'+_0x1fc742[_0x144e89(0x1b5)]['join']('/'):''))),0x1;return saveSessionContext({'segment_path':_0x1fc742['fullPath'],'parent_segment':_0x1fc742[_0x144e89(0x1b3)]},_0x2ec9ad),console['log'](a43_0x599093[_0x144e89(0x1d1)]('✔\x20Context\x20set\x20to:\x20'+a43_0x599093[_0x144e89(0x1ce)](_0x1fc742[_0x144e89(0x1cb)]))),_0x4a0225[_0x144e89(0x1b0)]&&(console[_0x144e89(0x1cc)](a43_0x599093[_0x144e89(0x1c0)](_0x144e89(0x1c4))),console[_0x144e89(0x1cc)](a43_0x599093[_0x144e89(0x1c0)]('Use\x20\x22tdx\x20use\x22\x20to\x20see\x20all\x20context\x20parameters'))),0x0;}catch(_0x41d777){throw _0x41d777;}}}
@@ -1 +1 @@
1
- const a44_0x5313d0=a44_0x5696;function a44_0x5696(_0x1d0d46,_0x29eea9){_0x1d0d46=_0x1d0d46-0xcb;const _0xdb03eb=a44_0xdb03();let _0x5696b9=_0xdb03eb[_0x1d0d46];return _0x5696b9;}(function(_0xfdbba,_0x491ed8){const _0x1fe414=a44_0x5696,_0x7dcbab=_0xfdbba();while(!![]){try{const _0x54b1ea=parseInt(_0x1fe414(0xdb))/0x1*(parseInt(_0x1fe414(0xf5))/0x2)+parseInt(_0x1fe414(0xe6))/0x3+parseInt(_0x1fe414(0xf3))/0x4+parseInt(_0x1fe414(0xf6))/0x5+parseInt(_0x1fe414(0xd1))/0x6*(parseInt(_0x1fe414(0xe8))/0x7)+parseInt(_0x1fe414(0xd0))/0x8+-parseInt(_0x1fe414(0xcd))/0x9*(parseInt(_0x1fe414(0xcb))/0xa);if(_0x54b1ea===_0x491ed8)break;else _0x7dcbab['push'](_0x7dcbab['shift']());}catch(_0xe31f76){_0x7dcbab['push'](_0x7dcbab['shift']());}}}(a44_0xdb03,0xcb4db));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_0x361e49 from'chalk';function a44_0xdb03(){const _0x59dda0=['dim','valid','\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','\x20warning(s)','invalidCount','targetDir','red','helpText','3242169REUcCR','log','13699UmlaNn','type','validCount','errors','\x20file(s)\x20with\x20errors,\x20','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','endsWith','description','\x20warning(s)\x20found','parentSegment','length','17644YQBVOG','Error:\x20Directory\x20not\x20found:\x20','224522CmWgmy','1364020MPcaqJ','Error:\x20','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','no_parent','cwd','):\x20','.yml','40423730parLjU','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','9gVuvOj','verbose','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file','12479864FMLxRh','1182ZPJInZ','\x20file(s)\x20valid','execute','errorCode','yellow','\x20error(s)','hasErrors','✔\x20All\x20','Validate\x20segment\x20and\x20journey\x20YAML\x20files','error','14eVtgAU','green','warningCount'];a44_0xdb03=function(){return _0x59dda0;};return a44_0xdb03();}import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class SegmentValidateCommand extends BaseCommand{['name']='segment:validate';[a44_0x5313d0(0xef)]=a44_0x5313d0(0xd9);async[a44_0x5313d0(0xd3)](_0x1a12bd){const _0x17a610=a44_0x5313d0,{options:_0x569ae1,args:_0x3cd317}=_0x1a12bd,_0x299564=_0x569ae1,_0x1822cb=await resolveTarget({'arg':_0x3cd317[0x0],'contextParent':_0x569ae1[_0x17a610(0xf1)],'cwd':process[_0x17a610(0xfa)]()});if(!isSuccessfulResolution(_0x1822cb))return _0x1822cb[_0x17a610(0xd4)]===_0x17a610(0xf9)?(console[_0x17a610(0xda)](a44_0x361e49['yellow'](_0x17a610(0xcc))),console[_0x17a610(0xda)]('Usage:\x20tdx\x20sg\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)'),console[_0x17a610(0xda)](_0x17a610(0xe0)),console[_0x17a610(0xda)](_0x17a610(0xcf))):(console['error'](a44_0x361e49['red'](_0x17a610(0xf7)+_0x1822cb['message']+'\x0a')),_0x1822cb[_0x17a610(0xe5)]&&console['error'](a44_0x361e49['cyan'](_0x1822cb[_0x17a610(0xe5)]))),0x1;const _0x29d22d=_0x1822cb[_0x17a610(0xe3)],_0x3287be=_0x1822cb[_0x17a610(0xe9)]==='file'?_0x1822cb['filePath']:undefined;if(!_0x3287be&&!existsSync(_0x29d22d))return console[_0x17a610(0xda)](a44_0x361e49[_0x17a610(0xe4)](_0x17a610(0xf4)+_0x29d22d+'\x0a')),0x1;let _0x452d27;if(_0x3287be){if(!_0x3287be[_0x17a610(0xee)](_0x17a610(0xfc))&&!_0x3287be[_0x17a610(0xee)]('.yaml'))return console[_0x17a610(0xda)](a44_0x361e49[_0x17a610(0xe4)](_0x17a610(0xf8)+_0x3287be+'\x0a')),0x1;_0x452d27=[_0x3287be];}else _0x452d27=findYamlFiles(_0x29d22d);if(_0x452d27[_0x17a610(0xf2)]===0x0)return console['error'](a44_0x361e49['red'](_0x17a610(0xed)+_0x29d22d+'\x0a')),0x1;const _0x3ae51f=validateYamlFiles(_0x452d27,_0x29d22d),_0x4a7068=calculateSummary(_0x3ae51f);for(const _0x2f470d of _0x3ae51f){if(!isValidationResult(_0x2f470d))continue;const {relativePath:_0x37db14,source:_0x242867,result:_0x43bbcd,fileType:_0x14df74}=_0x2f470d,_0x925f1f=_0x14df74;if(_0x43bbcd['valid']&&_0x43bbcd['warnings'][_0x17a610(0xf2)]===0x0)_0x299564[_0x17a610(0xce)]&&console[_0x17a610(0xe7)](a44_0x361e49[_0x17a610(0xdc)]('✔\x20'+_0x37db14)+a44_0x361e49[_0x17a610(0xde)]('\x20('+_0x925f1f+')'));else _0x43bbcd[_0x17a610(0xdf)]?(console[_0x17a610(0xe7)](a44_0x361e49[_0x17a610(0xd5)]('⚠\x20'+_0x37db14)+a44_0x361e49['dim']('\x20('+_0x925f1f+_0x17a610(0xfb)+_0x43bbcd['warnings']['length']+_0x17a610(0xe1))),console[_0x17a610(0xe7)](formatValidationResult(_0x43bbcd,_0x242867,_0x37db14))):(console[_0x17a610(0xe7)](a44_0x361e49[_0x17a610(0xe4)]('✖\x20'+_0x37db14)+a44_0x361e49['dim']('\x20('+_0x925f1f+_0x17a610(0xfb)+_0x43bbcd[_0x17a610(0xeb)][_0x17a610(0xf2)]+_0x17a610(0xd6))),console[_0x17a610(0xe7)](formatValidationResult(_0x43bbcd,_0x242867,_0x37db14)));}return console[_0x17a610(0xe7)](''),_0x4a7068[_0x17a610(0xd7)]?(console['log'](a44_0x361e49[_0x17a610(0xe4)]('Validation\x20failed:\x20'+_0x4a7068[_0x17a610(0xe2)]+_0x17a610(0xec)+_0x4a7068[_0x17a610(0xea)]+'\x20valid')),_0x4a7068[_0x17a610(0xdd)]>0x0&&console[_0x17a610(0xe7)](a44_0x361e49[_0x17a610(0xd5)](_0x4a7068[_0x17a610(0xdd)]+_0x17a610(0xf0))),0x1):(console['log'](a44_0x361e49['green'](_0x17a610(0xd8)+_0x4a7068['validCount']+_0x17a610(0xd2))),_0x4a7068[_0x17a610(0xdd)]>0x0&&console['log'](a44_0x361e49[_0x17a610(0xd5)](_0x4a7068[_0x17a610(0xdd)]+_0x17a610(0xf0))),0x0);}}
1
+ const a44_0x5b2a34=a44_0x9343;(function(_0x3468fc,_0x48cc00){const _0x36745d=a44_0x9343,_0x450a5c=_0x3468fc();while(!![]){try{const _0x194d7a=-parseInt(_0x36745d(0x10b))/0x1+-parseInt(_0x36745d(0x10d))/0x2+-parseInt(_0x36745d(0x11b))/0x3*(parseInt(_0x36745d(0x115))/0x4)+-parseInt(_0x36745d(0x10c))/0x5*(parseInt(_0x36745d(0x108))/0x6)+parseInt(_0x36745d(0xfe))/0x7*(-parseInt(_0x36745d(0x105))/0x8)+parseInt(_0x36745d(0xef))/0x9+parseInt(_0x36745d(0x10a))/0xa;if(_0x194d7a===_0x48cc00)break;else _0x450a5c['push'](_0x450a5c['shift']());}catch(_0x33069e){_0x450a5c['push'](_0x450a5c['shift']());}}}(a44_0x4b0a,0x37f42));import{BaseCommand}from'./command.js';function a44_0x4b0a(){const _0x322ef8=['12361030aGELvJ','127035LQMOSI','898320IHMfto','341664zeRbWw','error','cyan','errors','length','name','helpText','warnings','172xVCNMN','yellow','✔\x20All\x20','validCount','message','):\x20','30639jGiNdB','warningCount','endsWith','Error:\x20Directory\x20not\x20found:\x20','\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','2993571MZNaQA','segment:validate','\x20file(s)\x20valid','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file','red','\x20warning(s)\x20found','Error:\x20','targetDir','\x20valid','dim','parentSegment','file','Usage:\x20tdx\x20sg\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)','filePath','\x20file(s)\x20with\x20errors,\x20','26194FjwejZ','valid','green','Validation\x20failed:\x20','log','.yml','hasErrors','904GblNLs','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','type','6dHDWKC','\x20warning(s)'];a44_0x4b0a=function(){return _0x322ef8;};return a44_0x4b0a();}function a44_0x9343(_0x3532dd,_0x34eeec){_0x3532dd=_0x3532dd-0xee;const _0x4b0ae5=a44_0x4b0a();let _0x9343b5=_0x4b0ae5[_0x3532dd];return _0x9343b5;}import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';import a44_0x4bf690 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_0x5b2a34(0x112)]=a44_0x5b2a34(0xf0);['description']='Validate\x20segment\x20and\x20journey\x20YAML\x20files';async['execute'](_0x33585e){const _0x57e060=a44_0x5b2a34,{options:_0x27f16e,args:_0x494870}=_0x33585e,_0x100de6=_0x27f16e,_0x12642d=await resolveTarget({'arg':_0x494870[0x0],'contextParent':_0x27f16e[_0x57e060(0xf9)],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x12642d))return _0x12642d['errorCode']==='no_parent'?(console[_0x57e060(0x10e)](a44_0x4bf690['yellow']('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console[_0x57e060(0x10e)](_0x57e060(0xfb)),console[_0x57e060(0x10e)](_0x57e060(0xee)),console[_0x57e060(0x10e)](_0x57e060(0xf2))):(console[_0x57e060(0x10e)](a44_0x4bf690['red'](_0x57e060(0xf5)+_0x12642d[_0x57e060(0x119)]+'\x0a')),_0x12642d[_0x57e060(0x113)]&&console[_0x57e060(0x10e)](a44_0x4bf690[_0x57e060(0x10f)](_0x12642d[_0x57e060(0x113)]))),0x1;const _0xaa0035=_0x12642d[_0x57e060(0xf6)],_0x4e60e8=_0x12642d[_0x57e060(0x107)]===_0x57e060(0xfa)?_0x12642d[_0x57e060(0xfc)]:undefined;if(!_0x4e60e8&&!existsSync(_0xaa0035))return console[_0x57e060(0x10e)](a44_0x4bf690[_0x57e060(0xf3)](_0x57e060(0x11e)+_0xaa0035+'\x0a')),0x1;let _0x1120c4;if(_0x4e60e8){if(!_0x4e60e8[_0x57e060(0x11d)](_0x57e060(0x103))&&!_0x4e60e8['endsWith']('.yaml'))return console['error'](a44_0x4bf690['red']('Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20'+_0x4e60e8+'\x0a')),0x1;_0x1120c4=[_0x4e60e8];}else _0x1120c4=findYamlFiles(_0xaa0035);if(_0x1120c4[_0x57e060(0x111)]===0x0)return console[_0x57e060(0x10e)](a44_0x4bf690[_0x57e060(0xf3)](_0x57e060(0x106)+_0xaa0035+'\x0a')),0x1;const _0x3e3cd9=validateYamlFiles(_0x1120c4,_0xaa0035),_0x2c9d63=calculateSummary(_0x3e3cd9);for(const _0x23d72f of _0x3e3cd9){if(!isValidationResult(_0x23d72f))continue;const {relativePath:_0x46dd34,source:_0x1dd108,result:_0x3be959,fileType:_0x403c95}=_0x23d72f,_0x2f628b=_0x403c95;if(_0x3be959[_0x57e060(0xff)]&&_0x3be959[_0x57e060(0x114)][_0x57e060(0x111)]===0x0)_0x100de6['verbose']&&console[_0x57e060(0x102)](a44_0x4bf690[_0x57e060(0x100)]('✔\x20'+_0x46dd34)+a44_0x4bf690[_0x57e060(0xf8)]('\x20('+_0x2f628b+')'));else _0x3be959['valid']?(console['log'](a44_0x4bf690[_0x57e060(0x116)]('⚠\x20'+_0x46dd34)+a44_0x4bf690[_0x57e060(0xf8)]('\x20('+_0x2f628b+_0x57e060(0x11a)+_0x3be959['warnings']['length']+_0x57e060(0x109))),console['log'](formatValidationResult(_0x3be959,_0x1dd108,_0x46dd34))):(console['log'](a44_0x4bf690[_0x57e060(0xf3)]('✖\x20'+_0x46dd34)+a44_0x4bf690['dim']('\x20('+_0x2f628b+_0x57e060(0x11a)+_0x3be959[_0x57e060(0x110)]['length']+'\x20error(s)')),console[_0x57e060(0x102)](formatValidationResult(_0x3be959,_0x1dd108,_0x46dd34)));}return console[_0x57e060(0x102)](''),_0x2c9d63[_0x57e060(0x104)]?(console['log'](a44_0x4bf690[_0x57e060(0xf3)](_0x57e060(0x101)+_0x2c9d63['invalidCount']+_0x57e060(0xfd)+_0x2c9d63['validCount']+_0x57e060(0xf7))),_0x2c9d63[_0x57e060(0x11c)]>0x0&&console['log'](a44_0x4bf690[_0x57e060(0x116)](_0x2c9d63['warningCount']+_0x57e060(0xf4))),0x1):(console[_0x57e060(0x102)](a44_0x4bf690[_0x57e060(0x100)](_0x57e060(0x117)+_0x2c9d63[_0x57e060(0x118)]+_0x57e060(0xf1))),_0x2c9d63[_0x57e060(0x11c)]>0x0&&console[_0x57e060(0x102)](a44_0x4bf690[_0x57e060(0x116)](_0x2c9d63[_0x57e060(0x11c)]+_0x57e060(0xf4))),0x0);}}
@@ -1 +1 @@
1
- const a45_0x51bea9=a45_0x2bfd;(function(_0x1e088f,_0x427cce){const _0x269d3c=a45_0x2bfd,_0x1a074f=_0x1e088f();while(!![]){try{const _0x4234d6=-parseInt(_0x269d3c(0x167))/0x1*(-parseInt(_0x269d3c(0x1a2))/0x2)+-parseInt(_0x269d3c(0x189))/0x3+-parseInt(_0x269d3c(0x159))/0x4*(-parseInt(_0x269d3c(0x164))/0x5)+parseInt(_0x269d3c(0x17a))/0x6*(parseInt(_0x269d3c(0x19a))/0x7)+-parseInt(_0x269d3c(0x18c))/0x8+-parseInt(_0x269d3c(0x176))/0x9*(-parseInt(_0x269d3c(0x175))/0xa)+parseInt(_0x269d3c(0x19e))/0xb*(-parseInt(_0x269d3c(0x16d))/0xc);if(_0x4234d6===_0x427cce)break;else _0x1a074f['push'](_0x1a074f['shift']());}catch(_0x399148){_0x1a074f['push'](_0x1a074f['shift']());}}}(a45_0x59cb,0xa4bd0));function a45_0x59cb(){const _0x1fe61a=['\x5c$&','24AwALCr','parentId','\x20folder','log','journeyBundleName','Listing\x20folders,\x20segments,\x20and\x20journeys...','Parent\x20ID:\x20','name','46490kzjeoP','1773XbygOH','List\x20folders\x20and\x20child\x20segments','execute','✔\x20Built\x20tree\x20with\x20','2394888JQOIvr','\x20journey','Recursive\x20mode:\x20enabled','Folder/pattern\x20arg:\x20','listRecursive','folder','\x20\x20tdx\x20sg\x20pull\x20\x22My\x20Audience\x22',']\x20matching\x20\x27','folderId','segments','journeys','cause','data','\x20segment','sort','4041186UUutGv','jsonl','Use\x20tdx\x20ps\x20list\x20to\x20see\x20available\x20parent\x20segments.','10572456OcFLJW','type','folders','json','\x20\x20Cause:\x20','/e/','resolvePathToResource','listWithPattern','Resolving\x20path\x20\x27','/app/ps/','filter','\x20\x20tdx\x20sg\x20use\x20\x22My\x20Audience\x22','format','\x20matching\x20\x27','21VPvBsK','map','\x27...','Set\x20a\x20parent\x20segment\x20context\x20first:','3562163kYRvBd','segment','listUnified','localeCompare','1307604KCJbDB','dim','listUnifiedWithJourneys','/j/da','2447908MAReqP','journey','recursive',',\x20and\x20','length','Error:\x20No\x20parent\x20segment\x20context\x20set.','Resolving\x20parent\x20segment\x20\x27','description','site','error','Building\x20hierarchy\x20tree...','10NTTpaR','replace','✔\x20Found\x20','1ocjqwJ','parentSegment','(empty)','children','verbose'];a45_0x59cb=function(){return _0x1fe61a;};return a45_0x59cb();}import{BaseCommand}from'./command.js';function a45_0x2bfd(_0x900ba2,_0x329407){_0x900ba2=_0x900ba2-0x157;const _0x59cb03=a45_0x59cb();let _0x2bfd72=_0x59cb03[_0x900ba2];return _0x2bfd72;}import{SDKError}from'../sdk/index.js';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_0x3aaa93 from'chalk';export class SegmentsCommand extends BaseCommand{['name']=a45_0x51bea9(0x183);[a45_0x51bea9(0x160)]=a45_0x51bea9(0x177);async[a45_0x51bea9(0x178)](_0x2055c6){const _0x40f70f=a45_0x51bea9,{options:_0x198ac5,args:_0x2ff838}=_0x2055c6,_0x1be0e1=_0x198ac5[_0x40f70f(0x15b)],_0x34c20b=_0x2ff838[0x0];try{const _0x26d7cb=_0x198ac5[_0x40f70f(0x168)];_0x198ac5[_0x40f70f(0x16b)]&&(console[_0x40f70f(0x162)]('Site:\x20'+_0x198ac5[_0x40f70f(0x161)]),console[_0x40f70f(0x162)]('Parent\x20segment\x20context:\x20'+(_0x26d7cb||'(not\x20set)')),_0x34c20b&&console[_0x40f70f(0x162)](_0x40f70f(0x17d)+_0x34c20b),_0x1be0e1&&console['error'](_0x40f70f(0x17c)));if(!_0x26d7cb)return console[_0x40f70f(0x162)](_0x40f70f(0x15e)),console[_0x40f70f(0x162)](''),console['error'](_0x40f70f(0x19d)),console[_0x40f70f(0x162)](_0x40f70f(0x180)),console[_0x40f70f(0x162)](_0x40f70f(0x197)),console[_0x40f70f(0x162)](''),console[_0x40f70f(0x162)](_0x40f70f(0x18b)),0x1;const _0x45f123=_0x34c20b&&(_0x34c20b['includes']('*')||_0x34c20b['includes']('?'));if(_0x45f123)return await this['listWithPattern'](_0x2055c6,_0x26d7cb,_0x34c20b);const _0xaac500=_0x34c20b?_0x26d7cb+'/'+_0x34c20b:_0x26d7cb;return _0x1be0e1?await this['listRecursive'](_0x2055c6,_0xaac500):await this[_0x40f70f(0x1a0)](_0x2055c6,_0xaac500);}catch(_0x39828c){if(_0x39828c instanceof SDKError)return console[_0x40f70f(0x162)]('Error:\x20'+_0x39828c['message']),_0x39828c['cause']&&console['error'](_0x40f70f(0x190)+_0x39828c[_0x40f70f(0x185)]),0x1;throw _0x39828c;}}async[a45_0x51bea9(0x193)](_0x1c385a,_0x5d33af,_0x57429e){const _0x52d3a9=a45_0x51bea9,{options:_0x5122d2,tdx:_0x295a93}=_0x1c385a,_0x15a3e9=await withSpinner(_0x52d3a9(0x15f)+_0x5d33af+_0x52d3a9(0x19c),()=>_0x295a93[_0x52d3a9(0x19f)][_0x52d3a9(0x192)](_0x5d33af),{'verbose':_0x5122d2[_0x52d3a9(0x16b)]}),_0x17f0f1=_0x15a3e9[_0x52d3a9(0x186)],_0x16a21f=await withSpinner(_0x52d3a9(0x172),()=>_0x295a93[_0x52d3a9(0x19f)][_0x52d3a9(0x157)](_0x17f0f1[_0x52d3a9(0x16e)],_0x17f0f1['folderId']),{'verbose':_0x5122d2[_0x52d3a9(0x16b)]}),{folders:_0x4a5a59,segments:_0x5a7d19,journeys:_0x48f0a2}=_0x16a21f[_0x52d3a9(0x186)],_0x13fa60=_0x57429e[_0x52d3a9(0x165)](/[.+^${}()|[\]\\]/g,_0x52d3a9(0x16c))[_0x52d3a9(0x165)](/\*/g,'.*')[_0x52d3a9(0x165)](/\?/g,'.'),_0x1e4645=new RegExp('^'+_0x13fa60+'$','i'),_0x1dc50a=_0x4a5a59['filter'](_0x300621=>_0x1e4645['test'](_0x300621[_0x52d3a9(0x174)])),_0x57fd2a=_0x5a7d19[_0x52d3a9(0x196)](_0x4971d5=>_0x1e4645['test'](_0x4971d5['name'])),_0x589ae1=_0x48f0a2[_0x52d3a9(0x196)](_0x2e502c=>_0x1e4645['test'](_0x2e502c['journeyBundleName'])),_0x2597c3=_0x1dc50a[_0x52d3a9(0x15d)]+_0x57fd2a[_0x52d3a9(0x15d)]+_0x589ae1[_0x52d3a9(0x15d)];console['error'](_0x52d3a9(0x166)+_0x1dc50a[_0x52d3a9(0x15d)]+_0x52d3a9(0x16f)+(_0x1dc50a[_0x52d3a9(0x15d)]!==0x1?'s':'')+',\x20'+_0x57fd2a[_0x52d3a9(0x15d)]+_0x52d3a9(0x187)+(_0x57fd2a[_0x52d3a9(0x15d)]!==0x1?'s':'')+_0x52d3a9(0x15c)+_0x589ae1[_0x52d3a9(0x15d)]+'\x20journey'+(_0x589ae1[_0x52d3a9(0x15d)]!==0x1?'s':'')+_0x52d3a9(0x199)+_0x57429e+'\x27');const _0x569c05=_0x95525b=>{const _0x13d10c=_0x52d3a9;return getConsoleNextUrl(_0x5122d2[_0x13d10c(0x161)],_0x13d10c(0x195)+_0x17f0f1[_0x13d10c(0x16e)]+_0x13d10c(0x191)+_0x95525b);},_0x56f57e=_0x5122d2['format']===_0x52d3a9(0x18f)||_0x5122d2[_0x52d3a9(0x198)]===_0x52d3a9(0x18a);if(_0x56f57e){const _0x12db68=[..._0x1dc50a[_0x52d3a9(0x19b)](_0x25613c=>({..._0x25613c,'type':'folder'})),..._0x57fd2a['map'](_0x1b5cbb=>({..._0x1b5cbb,'type':_0x52d3a9(0x19f),'url':_0x569c05(_0x1b5cbb['id'])})),..._0x589ae1['map'](_0xd217a7=>({..._0xd217a7,'name':_0xd217a7[_0x52d3a9(0x171)],'type':_0x52d3a9(0x15a)}))]['sort']((_0x117670,_0x3c32f9)=>_0x117670[_0x52d3a9(0x174)][_0x52d3a9(0x1a1)](_0x3c32f9[_0x52d3a9(0x174)]));await handleSDKOutput(_0x12db68,_0x5122d2);}else{if(_0x2597c3===0x0)console[_0x52d3a9(0x170)]('No\x20items\x20match\x20pattern:\x20'+_0x57429e);else{console[_0x52d3a9(0x170)](a45_0x3aaa93[_0x52d3a9(0x1a3)]('['+_0x5d33af+_0x52d3a9(0x181)+_0x57429e+'\x27'));const _0x1bdec0=formatFlatList(_0x1dc50a,_0x57fd2a,{'showMetadata':!![],'getSegmentUrl':_0x569c05},_0x589ae1);console['log'](_0x1bdec0);}}return 0x0;}async['listUnified'](_0x50cf9b,_0x5d5cb3){const _0x52414d=a45_0x51bea9,{options:_0x54b47c,tdx:_0x1371da}=_0x50cf9b,_0x319c19=await withSpinner(_0x52414d(0x194)+_0x5d5cb3+_0x52414d(0x19c),()=>_0x1371da[_0x52414d(0x19f)]['resolvePathToResource'](_0x5d5cb3),{'verbose':_0x54b47c[_0x52414d(0x16b)]}),_0x16174a=_0x319c19[_0x52414d(0x186)];_0x54b47c['verbose']&&(console[_0x52414d(0x162)]('Parent\x20ID:\x20'+_0x16174a[_0x52414d(0x16e)]),_0x16174a[_0x52414d(0x182)]&&console[_0x52414d(0x162)]('Folder\x20ID:\x20'+_0x16174a['folderId']));const _0x53d0e8=await withSpinner(_0x52414d(0x172),()=>_0x1371da[_0x52414d(0x19f)][_0x52414d(0x157)](_0x16174a[_0x52414d(0x16e)],_0x16174a[_0x52414d(0x182)]),{'verbose':_0x54b47c['verbose']}),{folders:_0x1b1248,segments:_0x430137,journeys:_0xf3401f}=_0x53d0e8['data'],_0x3729a4=_0x1b1248['length']+_0x430137[_0x52414d(0x15d)]+_0xf3401f[_0x52414d(0x15d)];console[_0x52414d(0x162)](_0x52414d(0x166)+_0x1b1248['length']+_0x52414d(0x16f)+(_0x1b1248['length']!==0x1?'s':'')+',\x20'+_0x430137[_0x52414d(0x15d)]+_0x52414d(0x187)+(_0x430137[_0x52414d(0x15d)]!==0x1?'s':'')+',\x20and\x20'+_0xf3401f[_0x52414d(0x15d)]+_0x52414d(0x17b)+(_0xf3401f['length']!==0x1?'s':''));const _0x4ad104=_0x41ab3b=>{const _0x2f5988=_0x52414d;return getConsoleNextUrl(_0x54b47c[_0x2f5988(0x161)],_0x2f5988(0x195)+_0x16174a[_0x2f5988(0x16e)]+_0x2f5988(0x191)+_0x41ab3b);},_0x18d3ec=_0x5374d2=>{const _0x546073=_0x52414d;return getConsoleNextUrl(_0x54b47c[_0x546073(0x161)],_0x546073(0x195)+_0x16174a[_0x546073(0x16e)]+_0x546073(0x191)+_0x5374d2+_0x546073(0x158));},_0x1656af=_0x54b47c[_0x52414d(0x198)]===_0x52414d(0x18f)||_0x54b47c[_0x52414d(0x198)]==='jsonl';if(_0x1656af){const _0x10a95b=[..._0x1b1248[_0x52414d(0x19b)](_0xd54611=>({..._0xd54611,'type':_0x52414d(0x17f)})),..._0x430137[_0x52414d(0x19b)](_0x593c3a=>({..._0x593c3a,'type':_0x52414d(0x19f),'url':_0x4ad104(_0x593c3a['id'])})),..._0xf3401f[_0x52414d(0x19b)](_0x319ac0=>({..._0x319ac0,'name':_0x319ac0[_0x52414d(0x171)],'type':_0x52414d(0x15a),'url':_0x18d3ec(_0x319ac0['id'])}))][_0x52414d(0x188)]((_0x2a2c59,_0x2f33ee)=>_0x2a2c59['name'][_0x52414d(0x1a1)](_0x2f33ee[_0x52414d(0x174)]));await handleSDKOutput(_0x10a95b,_0x54b47c);}else{if(_0x3729a4===0x0)console[_0x52414d(0x170)](a45_0x3aaa93[_0x52414d(0x1a3)]('['+_0x5d5cb3+']')),console['log'](_0x52414d(0x169));else{console[_0x52414d(0x170)](a45_0x3aaa93[_0x52414d(0x1a3)]('['+_0x5d5cb3+']'));const _0x232451=formatFlatList(_0x1b1248,_0x430137,{'showMetadata':!![],'getSegmentUrl':_0x4ad104,'getJourneyUrl':_0x18d3ec},_0xf3401f);console['log'](_0x232451);}}return 0x0;}async[a45_0x51bea9(0x17e)](_0x23fcb5,_0x28f286){const _0x5bea99=a45_0x51bea9,{options:_0x177bc7,tdx:_0xf4289b}=_0x23fcb5,_0x5d1403=await withSpinner(_0x5bea99(0x194)+_0x28f286+_0x5bea99(0x19c),()=>_0xf4289b['segment'][_0x5bea99(0x192)](_0x28f286),{'verbose':_0x177bc7[_0x5bea99(0x16b)]}),_0x3a0653=_0x5d1403[_0x5bea99(0x186)];_0x177bc7[_0x5bea99(0x16b)]&&(console[_0x5bea99(0x162)](_0x5bea99(0x173)+_0x3a0653['parentId']),_0x3a0653['folderId']&&console[_0x5bea99(0x162)]('Folder\x20ID:\x20'+_0x3a0653[_0x5bea99(0x182)]));const _0x7cff63=_0x177bc7['maxDepth']||0xa,_0x36a29b=await withSpinner(_0x5bea99(0x163),()=>_0xf4289b[_0x5bea99(0x19f)][_0x5bea99(0x17e)](_0x3a0653[_0x5bea99(0x16e)],_0x3a0653[_0x5bea99(0x182)],0x0,_0x7cff63),{'verbose':_0x177bc7[_0x5bea99(0x16b)]}),_0x5a1fd0=_0x36a29b[_0x5bea99(0x186)],_0x29cda6=_0x5c3b48=>{const _0x3d671c=_0x5bea99;let _0x53fbd1=0x0,_0x164aae=0x0,_0x4b98eb=0x0;for(const _0x4780a5 of _0x5c3b48){if(_0x4780a5[_0x3d671c(0x18d)]===_0x3d671c(0x17f))_0x53fbd1++;else{if(_0x4780a5[_0x3d671c(0x18d)]==='segment')_0x164aae++;else{if(_0x4780a5[_0x3d671c(0x18d)]===_0x3d671c(0x15a))_0x4b98eb++;}}if(_0x4780a5[_0x3d671c(0x16a)]){const _0x3ab6cb=_0x29cda6(_0x4780a5[_0x3d671c(0x16a)]);_0x53fbd1+=_0x3ab6cb['folders'],_0x164aae+=_0x3ab6cb[_0x3d671c(0x183)],_0x4b98eb+=_0x3ab6cb[_0x3d671c(0x184)];}}return{'folders':_0x53fbd1,'segments':_0x164aae,'journeys':_0x4b98eb};},_0x283fc4=_0x29cda6(_0x5a1fd0);console[_0x5bea99(0x162)](_0x5bea99(0x179)+_0x283fc4['folders']+_0x5bea99(0x16f)+(_0x283fc4[_0x5bea99(0x18e)]!==0x1?'s':'')+',\x20'+_0x283fc4['segments']+_0x5bea99(0x187)+(_0x283fc4[_0x5bea99(0x183)]!==0x1?'s':'')+_0x5bea99(0x15c)+_0x283fc4[_0x5bea99(0x184)]+_0x5bea99(0x17b)+(_0x283fc4['journeys']!==0x1?'s':''));const _0x31175e=_0x48d44d=>{const _0x3aadaf=_0x5bea99;return getConsoleNextUrl(_0x177bc7['site'],_0x3aadaf(0x195)+_0x3a0653[_0x3aadaf(0x16e)]+_0x3aadaf(0x191)+_0x48d44d);},_0x1bfd4d=_0x33f56d=>{const _0x134233=_0x5bea99;return getConsoleNextUrl(_0x177bc7[_0x134233(0x161)],_0x134233(0x195)+_0x3a0653[_0x134233(0x16e)]+_0x134233(0x191)+_0x33f56d+'/j/da');};if(_0x177bc7[_0x5bea99(0x198)]===_0x5bea99(0x18f)||_0x177bc7['format']===_0x5bea99(0x18a))await handleSDKOutput(_0x5a1fd0,_0x177bc7);else{console[_0x5bea99(0x170)](a45_0x3aaa93[_0x5bea99(0x1a3)]('['+_0x28f286+']'));const _0x1700c6=formatTree(_0x5a1fd0,{'showMetadata':!![],'getSegmentUrl':_0x31175e,'getJourneyUrl':_0x1bfd4d});console['log'](_0x1700c6);}return 0x0;}}
1
+ const a45_0x221655=a45_0x73c3;function a45_0x3edc(){const _0x2da613=['\x20folder','json','data','message','listUnifiedWithJourneys','Folder\x20ID:\x20','8076580pgkBra','List\x20folders\x20and\x20child\x20segments','description','\x20\x20tdx\x20sg\x20pull\x20\x22My\x20Audience\x22','1MQIyug','sort','Resolving\x20parent\x20segment\x20\x27','6ZfSbEQ','map','Error:\x20No\x20parent\x20segment\x20context\x20set.','✔\x20Built\x20tree\x20with\x20','log','\x27...','children','replace','240zwoybU','Resolving\x20path\x20\x27','2407294smLcGj','length','parentId','60JbZexk','segments','Listing\x20folders,\x20segments,\x20and\x20journeys...','recursive','type','parentSegment','folderId','journeyBundleName','Building\x20hierarchy\x20tree...','name','folder','includes','filter','listWithPattern','folders','\x20matching\x20\x27',',\x20and\x20','jsonl','3084714keoiAY','✔\x20Found\x20','(not\x20set)','localeCompare','\x5c$&','Set\x20a\x20parent\x20segment\x20context\x20first:','Site:\x20','\x20segment','472900qlfWFJ','/app/ps/','Error:\x20','Parent\x20ID:\x20','test','resolvePathToResource','verbose','437022ubNUuj','/j/da','19271043YQCEBk','\x20\x20tdx\x20sg\x20use\x20\x22My\x20Audience\x22','journeys','/e/','No\x20items\x20match\x20pattern:\x20','error','site','listUnified','maxDepth',']\x20matching\x20\x27','journey','dim','5043794XODpqn','listRecursive','format','Folder/pattern\x20arg:\x20','(empty)','segment','\x20\x20Cause:\x20','cause','\x20journey'];a45_0x3edc=function(){return _0x2da613;};return a45_0x3edc();}(function(_0x5b7af5,_0x3a9bf1){const _0xadd9f3=a45_0x73c3,_0x1f2fc2=_0x5b7af5();while(!![]){try{const _0x2bd0ce=-parseInt(_0xadd9f3(0x161))/0x1*(parseInt(_0xadd9f3(0x11c))/0x2)+parseInt(_0xadd9f3(0x131))/0x3+-parseInt(_0xadd9f3(0x139))/0x4*(-parseInt(_0xadd9f3(0x11f))/0x5)+-parseInt(_0xadd9f3(0x164))/0x6*(-parseInt(_0xadd9f3(0x14e))/0x7)+-parseInt(_0xadd9f3(0x11a))/0x8*(-parseInt(_0xadd9f3(0x140))/0x9)+-parseInt(_0xadd9f3(0x15d))/0xa+-parseInt(_0xadd9f3(0x142))/0xb;if(_0x2bd0ce===_0x3a9bf1)break;else _0x1f2fc2['push'](_0x1f2fc2['shift']());}catch(_0x1af1a1){_0x1f2fc2['push'](_0x1f2fc2['shift']());}}}(a45_0x3edc,0xd234a));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{formatFlatList,formatTree}from'../sdk/util/tree-formatter.js';function a45_0x73c3(_0x6eb9ec,_0x590f9e){_0x6eb9ec=_0x6eb9ec-0x117;const _0x3edc0f=a45_0x3edc();let _0x73c3bc=_0x3edc0f[_0x6eb9ec];return _0x73c3bc;}import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import a45_0xed71c6 from'chalk';export class SegmentsCommand extends BaseCommand{[a45_0x221655(0x128)]=a45_0x221655(0x120);[a45_0x221655(0x15f)]=a45_0x221655(0x15e);async['execute'](_0x21f6fe){const _0x28eda6=a45_0x221655,{options:_0x4d62df,args:_0x27d4b7}=_0x21f6fe,_0x46b693=_0x4d62df[_0x28eda6(0x122)],_0x202471=_0x27d4b7[0x0];try{const _0x5e7743=_0x4d62df[_0x28eda6(0x124)];_0x4d62df[_0x28eda6(0x13f)]&&(console['error'](_0x28eda6(0x137)+_0x4d62df['site']),console['error']('Parent\x20segment\x20context:\x20'+(_0x5e7743||_0x28eda6(0x133))),_0x202471&&console[_0x28eda6(0x147)](_0x28eda6(0x151)+_0x202471),_0x46b693&&console[_0x28eda6(0x147)]('Recursive\x20mode:\x20enabled'));if(!_0x5e7743)return console[_0x28eda6(0x147)](_0x28eda6(0x166)),console[_0x28eda6(0x147)](''),console[_0x28eda6(0x147)](_0x28eda6(0x136)),console[_0x28eda6(0x147)](_0x28eda6(0x160)),console[_0x28eda6(0x147)](_0x28eda6(0x143)),console['error'](''),console[_0x28eda6(0x147)]('Use\x20tdx\x20ps\x20list\x20to\x20see\x20available\x20parent\x20segments.'),0x1;const _0x3958e1=_0x202471&&(_0x202471[_0x28eda6(0x12a)]('*')||_0x202471[_0x28eda6(0x12a)]('?'));if(_0x3958e1)return await this[_0x28eda6(0x12c)](_0x21f6fe,_0x5e7743,_0x202471);const _0x312e3d=_0x202471?_0x5e7743+'/'+_0x202471:_0x5e7743;return _0x46b693?await this[_0x28eda6(0x14f)](_0x21f6fe,_0x312e3d):await this[_0x28eda6(0x149)](_0x21f6fe,_0x312e3d);}catch(_0x3db925){if(_0x3db925 instanceof SDKError)return console[_0x28eda6(0x147)](_0x28eda6(0x13b)+_0x3db925[_0x28eda6(0x15a)]),_0x3db925[_0x28eda6(0x155)]&&console[_0x28eda6(0x147)](_0x28eda6(0x154)+_0x3db925[_0x28eda6(0x155)]),0x1;throw _0x3db925;}}async[a45_0x221655(0x12c)](_0xf12295,_0x3904bb,_0x58f346){const _0x2feb07=a45_0x221655,{options:_0x22dcd1,tdx:_0x15b8fe}=_0xf12295,_0x14ddb4=await withSpinner(_0x2feb07(0x163)+_0x3904bb+_0x2feb07(0x117),()=>_0x15b8fe['segment'][_0x2feb07(0x13e)](_0x3904bb),{'verbose':_0x22dcd1[_0x2feb07(0x13f)]}),_0x1e96c2=_0x14ddb4[_0x2feb07(0x159)],_0xedce58=await withSpinner('Listing\x20folders,\x20segments,\x20and\x20journeys...',()=>_0x15b8fe[_0x2feb07(0x153)][_0x2feb07(0x15b)](_0x1e96c2['parentId'],_0x1e96c2[_0x2feb07(0x125)]),{'verbose':_0x22dcd1[_0x2feb07(0x13f)]}),{folders:_0xdf6afc,segments:_0x292e7e,journeys:_0x7544c9}=_0xedce58[_0x2feb07(0x159)],_0x3e8a46=_0x58f346[_0x2feb07(0x119)](/[.+^${}()|[\]\\]/g,_0x2feb07(0x135))[_0x2feb07(0x119)](/\*/g,'.*')[_0x2feb07(0x119)](/\?/g,'.'),_0x184ca4=new RegExp('^'+_0x3e8a46+'$','i'),_0x33c6d4=_0xdf6afc[_0x2feb07(0x12b)](_0x42f613=>_0x184ca4[_0x2feb07(0x13d)](_0x42f613[_0x2feb07(0x128)])),_0x5bce52=_0x292e7e[_0x2feb07(0x12b)](_0x1c6740=>_0x184ca4[_0x2feb07(0x13d)](_0x1c6740['name'])),_0x574dbd=_0x7544c9[_0x2feb07(0x12b)](_0x1fa603=>_0x184ca4['test'](_0x1fa603[_0x2feb07(0x126)])),_0x4a96de=_0x33c6d4[_0x2feb07(0x11d)]+_0x5bce52[_0x2feb07(0x11d)]+_0x574dbd[_0x2feb07(0x11d)];console[_0x2feb07(0x147)]('✔\x20Found\x20'+_0x33c6d4['length']+_0x2feb07(0x157)+(_0x33c6d4[_0x2feb07(0x11d)]!==0x1?'s':'')+',\x20'+_0x5bce52['length']+_0x2feb07(0x138)+(_0x5bce52[_0x2feb07(0x11d)]!==0x1?'s':'')+_0x2feb07(0x12f)+_0x574dbd[_0x2feb07(0x11d)]+_0x2feb07(0x156)+(_0x574dbd[_0x2feb07(0x11d)]!==0x1?'s':'')+_0x2feb07(0x12e)+_0x58f346+'\x27');const _0x2c134b=_0x1c558d=>{const _0x360bb1=_0x2feb07;return getConsoleNextUrl(_0x22dcd1[_0x360bb1(0x148)],_0x360bb1(0x13a)+_0x1e96c2[_0x360bb1(0x11e)]+_0x360bb1(0x145)+_0x1c558d);},_0x474711=_0x22dcd1[_0x2feb07(0x150)]==='json'||_0x22dcd1[_0x2feb07(0x150)]==='jsonl';if(_0x474711){const _0x38d14b=[..._0x33c6d4['map'](_0x25f228=>({..._0x25f228,'type':_0x2feb07(0x129)})),..._0x5bce52[_0x2feb07(0x165)](_0x4f62f8=>({..._0x4f62f8,'type':'segment','url':_0x2c134b(_0x4f62f8['id'])})),..._0x574dbd[_0x2feb07(0x165)](_0x4d3756=>({..._0x4d3756,'name':_0x4d3756['journeyBundleName'],'type':_0x2feb07(0x14c)}))][_0x2feb07(0x162)]((_0x4ec56e,_0x4a32df)=>_0x4ec56e[_0x2feb07(0x128)][_0x2feb07(0x134)](_0x4a32df[_0x2feb07(0x128)]));await handleSDKOutput(_0x38d14b,_0x22dcd1);}else{if(_0x4a96de===0x0)console[_0x2feb07(0x168)](_0x2feb07(0x146)+_0x58f346);else{console[_0x2feb07(0x168)](a45_0xed71c6[_0x2feb07(0x14d)]('['+_0x3904bb+_0x2feb07(0x14b)+_0x58f346+'\x27'));const _0x2c9e7c=formatFlatList(_0x33c6d4,_0x5bce52,{'showMetadata':!![],'getSegmentUrl':_0x2c134b},_0x574dbd);console[_0x2feb07(0x168)](_0x2c9e7c);}}return 0x0;}async['listUnified'](_0x22c923,_0x15722b){const _0x5dccf0=a45_0x221655,{options:_0x46843a,tdx:_0x2903fe}=_0x22c923,_0x3178e6=await withSpinner(_0x5dccf0(0x11b)+_0x15722b+_0x5dccf0(0x117),()=>_0x2903fe['segment'][_0x5dccf0(0x13e)](_0x15722b),{'verbose':_0x46843a[_0x5dccf0(0x13f)]}),_0x11389d=_0x3178e6['data'];_0x46843a[_0x5dccf0(0x13f)]&&(console[_0x5dccf0(0x147)](_0x5dccf0(0x13c)+_0x11389d[_0x5dccf0(0x11e)]),_0x11389d[_0x5dccf0(0x125)]&&console[_0x5dccf0(0x147)](_0x5dccf0(0x15c)+_0x11389d[_0x5dccf0(0x125)]));const _0x586156=await withSpinner(_0x5dccf0(0x121),()=>_0x2903fe[_0x5dccf0(0x153)][_0x5dccf0(0x15b)](_0x11389d[_0x5dccf0(0x11e)],_0x11389d[_0x5dccf0(0x125)]),{'verbose':_0x46843a['verbose']}),{folders:_0x33004a,segments:_0x50bdbe,journeys:_0x13ce21}=_0x586156['data'],_0x15db1f=_0x33004a[_0x5dccf0(0x11d)]+_0x50bdbe[_0x5dccf0(0x11d)]+_0x13ce21[_0x5dccf0(0x11d)];console['error'](_0x5dccf0(0x132)+_0x33004a[_0x5dccf0(0x11d)]+'\x20folder'+(_0x33004a[_0x5dccf0(0x11d)]!==0x1?'s':'')+',\x20'+_0x50bdbe[_0x5dccf0(0x11d)]+'\x20segment'+(_0x50bdbe[_0x5dccf0(0x11d)]!==0x1?'s':'')+_0x5dccf0(0x12f)+_0x13ce21[_0x5dccf0(0x11d)]+_0x5dccf0(0x156)+(_0x13ce21[_0x5dccf0(0x11d)]!==0x1?'s':''));const _0x3d1753=_0x1bbe79=>{const _0x49428f=_0x5dccf0;return getConsoleNextUrl(_0x46843a[_0x49428f(0x148)],_0x49428f(0x13a)+_0x11389d[_0x49428f(0x11e)]+_0x49428f(0x145)+_0x1bbe79);},_0x338668=_0x59612e=>{const _0x570dab=_0x5dccf0;return getConsoleNextUrl(_0x46843a['site'],'/app/ps/'+_0x11389d['parentId']+_0x570dab(0x145)+_0x59612e+_0x570dab(0x141));},_0x5714ed=_0x46843a[_0x5dccf0(0x150)]==='json'||_0x46843a['format']==='jsonl';if(_0x5714ed){const _0x17e076=[..._0x33004a[_0x5dccf0(0x165)](_0x1da627=>({..._0x1da627,'type':'folder'})),..._0x50bdbe['map'](_0x5ae7fe=>({..._0x5ae7fe,'type':_0x5dccf0(0x153),'url':_0x3d1753(_0x5ae7fe['id'])})),..._0x13ce21['map'](_0x2dc0da=>({..._0x2dc0da,'name':_0x2dc0da['journeyBundleName'],'type':'journey','url':_0x338668(_0x2dc0da['id'])}))][_0x5dccf0(0x162)]((_0x580df4,_0x2036ac)=>_0x580df4[_0x5dccf0(0x128)]['localeCompare'](_0x2036ac['name']));await handleSDKOutput(_0x17e076,_0x46843a);}else{if(_0x15db1f===0x0)console[_0x5dccf0(0x168)](a45_0xed71c6[_0x5dccf0(0x14d)]('['+_0x15722b+']')),console[_0x5dccf0(0x168)](_0x5dccf0(0x152));else{console['log'](a45_0xed71c6[_0x5dccf0(0x14d)]('['+_0x15722b+']'));const _0x3f08cd=formatFlatList(_0x33004a,_0x50bdbe,{'showMetadata':!![],'getSegmentUrl':_0x3d1753,'getJourneyUrl':_0x338668},_0x13ce21);console[_0x5dccf0(0x168)](_0x3f08cd);}}return 0x0;}async[a45_0x221655(0x14f)](_0x3fbcb5,_0x251777){const _0x204baf=a45_0x221655,{options:_0xbc6979,tdx:_0xfaf786}=_0x3fbcb5,_0x325094=await withSpinner('Resolving\x20path\x20\x27'+_0x251777+_0x204baf(0x117),()=>_0xfaf786[_0x204baf(0x153)][_0x204baf(0x13e)](_0x251777),{'verbose':_0xbc6979[_0x204baf(0x13f)]}),_0x6735c5=_0x325094[_0x204baf(0x159)];_0xbc6979[_0x204baf(0x13f)]&&(console['error'](_0x204baf(0x13c)+_0x6735c5[_0x204baf(0x11e)]),_0x6735c5[_0x204baf(0x125)]&&console[_0x204baf(0x147)](_0x204baf(0x15c)+_0x6735c5[_0x204baf(0x125)]));const _0x6fdf56=_0xbc6979[_0x204baf(0x14a)]||0xa,_0x18bc0c=await withSpinner(_0x204baf(0x127),()=>_0xfaf786['segment'][_0x204baf(0x14f)](_0x6735c5['parentId'],_0x6735c5[_0x204baf(0x125)],0x0,_0x6fdf56),{'verbose':_0xbc6979['verbose']}),_0x137358=_0x18bc0c[_0x204baf(0x159)],_0x365d0e=_0x7de102=>{const _0x222b48=_0x204baf;let _0x47879f=0x0,_0x2bc4a3=0x0,_0x394c9c=0x0;for(const _0x4147b1 of _0x7de102){if(_0x4147b1[_0x222b48(0x123)]===_0x222b48(0x129))_0x47879f++;else{if(_0x4147b1[_0x222b48(0x123)]===_0x222b48(0x153))_0x2bc4a3++;else{if(_0x4147b1[_0x222b48(0x123)]===_0x222b48(0x14c))_0x394c9c++;}}if(_0x4147b1[_0x222b48(0x118)]){const _0x106f2a=_0x365d0e(_0x4147b1[_0x222b48(0x118)]);_0x47879f+=_0x106f2a['folders'],_0x2bc4a3+=_0x106f2a[_0x222b48(0x120)],_0x394c9c+=_0x106f2a[_0x222b48(0x144)];}}return{'folders':_0x47879f,'segments':_0x2bc4a3,'journeys':_0x394c9c};},_0x294b72=_0x365d0e(_0x137358);console[_0x204baf(0x147)](_0x204baf(0x167)+_0x294b72[_0x204baf(0x12d)]+_0x204baf(0x157)+(_0x294b72['folders']!==0x1?'s':'')+',\x20'+_0x294b72['segments']+'\x20segment'+(_0x294b72[_0x204baf(0x120)]!==0x1?'s':'')+_0x204baf(0x12f)+_0x294b72[_0x204baf(0x144)]+'\x20journey'+(_0x294b72['journeys']!==0x1?'s':''));const _0x5d3e4c=_0x2962fe=>{const _0x4c218b=_0x204baf;return getConsoleNextUrl(_0xbc6979[_0x4c218b(0x148)],'/app/ps/'+_0x6735c5[_0x4c218b(0x11e)]+_0x4c218b(0x145)+_0x2962fe);},_0x1b001c=_0x3acd9f=>{const _0x25279d=_0x204baf;return getConsoleNextUrl(_0xbc6979[_0x25279d(0x148)],'/app/ps/'+_0x6735c5['parentId']+_0x25279d(0x145)+_0x3acd9f+_0x25279d(0x141));};if(_0xbc6979['format']===_0x204baf(0x158)||_0xbc6979[_0x204baf(0x150)]===_0x204baf(0x130))await handleSDKOutput(_0x137358,_0xbc6979);else{console[_0x204baf(0x168)](a45_0xed71c6['dim']('['+_0x251777+']'));const _0x37b2f6=formatTree(_0x137358,{'showMetadata':!![],'getSegmentUrl':_0x5d3e4c,'getJourneyUrl':_0x1b001c});console['log'](_0x37b2f6);}return 0x0;}}
@@ -1 +1 @@
1
- function a46_0x5605(){const _0x503949=['cause','limit','Limit:\x20','10myyVYx','Usage:\x20tdx\x20show\x20<database.table>','query','Table:\x20','15BGSOkK','Error:\x20','831255ckyEsb','12tXoOjR','\x20from\x20','104388OXhZYw','length','1317452XrEYBW','error','Catalog:\x20','name','\x20row','436784bfEoUL','\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>','showTable','Site:\x20','args','table','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','8ZBUiMN','\x20\x20Cause:\x20','\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>','verbose','site','database','description','✔\x20Query\x20successful\x20-\x200\x20rows\x20returned','5681574KNcIkh','data','message','Querying\x20','782418LzKGsT','19776207fiGmgn'];a46_0x5605=function(){return _0x503949;};return a46_0x5605();}const a46_0x104d6f=a46_0x3fd3;(function(_0x4ef22f,_0x471e40){const _0x1dc7a1=a46_0x3fd3,_0x22084a=_0x4ef22f();while(!![]){try{const _0x40c199=parseInt(_0x1dc7a1(0x125))/0x1+-parseInt(_0x1dc7a1(0x127))/0x2+parseInt(_0x1dc7a1(0x122))/0x3+parseInt(_0x1dc7a1(0x103))/0x4*(-parseInt(_0x1dc7a1(0x120))/0x5)+-parseInt(_0x1dc7a1(0x123))/0x6*(parseInt(_0x1dc7a1(0x117))/0x7)+parseInt(_0x1dc7a1(0x10b))/0x8*(-parseInt(_0x1dc7a1(0x113))/0x9)+-parseInt(_0x1dc7a1(0x11c))/0xa*(-parseInt(_0x1dc7a1(0x118))/0xb);if(_0x40c199===_0x471e40)break;else _0x22084a['push'](_0x22084a['shift']());}catch(_0x5182ba){_0x22084a['push'](_0x22084a['shift']());}}}(a46_0x5605,0x528f2));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';function a46_0x3fd3(_0x14e2a8,_0x2c4dc0){_0x14e2a8=_0x14e2a8-0x103;const _0x560541=a46_0x5605();let _0x3fd3b1=_0x560541[_0x14e2a8];return _0x3fd3b1;}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_0x104d6f(0x12a)]='show';[a46_0x104d6f(0x111)]='Show\x20table\x20contents';async['execute'](_0x4fd272){const _0x323ed8=a46_0x104d6f;return this[_0x323ed8(0x105)](_0x4fd272);}async[a46_0x104d6f(0x105)](_0x57462a){const _0x36a1ac=a46_0x104d6f,{options:_0x59cd86,args:_0x337be6,tdx:_0x2d74d5}=_0x57462a;let _0x3c1803;try{_0x3c1803=parseTableReference(_0x337be6[0x0]);const _0x528c55=_0x59cd86[_0x36a1ac(0x110)];!_0x3c1803[_0x36a1ac(0x110)]&&_0x528c55&&(_0x3c1803['database']=_0x528c55);const _0x10cb5b=validateTableDescribeReference(_0x3c1803);if(_0x10cb5b)return console[_0x36a1ac(0x128)](_0x36a1ac(0x121)+_0x10cb5b),console['error'](_0x36a1ac(0x11d)),console[_0x36a1ac(0x128)](_0x36a1ac(0x10d)),console[_0x36a1ac(0x128)](_0x36a1ac(0x104)),0x1;}catch(_0x5e3d29){return console[_0x36a1ac(0x128)](_0x36a1ac(0x121)+_0x5e3d29[_0x36a1ac(0x115)]),console['error'](_0x36a1ac(0x11d)),console[_0x36a1ac(0x128)](_0x36a1ac(0x10d)),console[_0x36a1ac(0x128)](_0x36a1ac(0x104)),0x1;}const _0x42d120=_0x3c1803[_0x36a1ac(0x10a)],_0x568e02=_0x3c1803[_0x36a1ac(0x110)],_0x290a3e=_0x3c1803[_0x36a1ac(0x108)],_0x21be6a=resolveLimit(_0x59cd86[_0x36a1ac(0x11a)],DEFAULT_DISPLAY_LIMIT);try{_0x59cd86[_0x36a1ac(0x10e)]&&(console[_0x36a1ac(0x128)](_0x36a1ac(0x106)+_0x59cd86[_0x36a1ac(0x10f)]),_0x42d120&&console[_0x36a1ac(0x128)](_0x36a1ac(0x129)+_0x42d120),console[_0x36a1ac(0x128)]('Database:\x20'+_0x568e02),console[_0x36a1ac(0x128)](_0x36a1ac(0x11f)+_0x290a3e),console['error'](_0x36a1ac(0x11b)+_0x21be6a));const _0x154a6b=_0x42d120?_0x42d120+'.'+_0x568e02+'.'+_0x290a3e:_0x568e02+'.'+_0x290a3e,_0x209d85=await withSpinner(_0x36a1ac(0x116)+_0x154a6b+'...',()=>_0x2d74d5[_0x36a1ac(0x11e)]['showTable'](_0x568e02,_0x290a3e,_0x21be6a,_0x42d120),{'verbose':_0x59cd86[_0x36a1ac(0x10e)]}),_0x206ca0=_0x209d85['data'],_0x1985f6=_0x206ca0[_0x36a1ac(0x114)];return _0x1985f6[_0x36a1ac(0x126)]===0x0?console[_0x36a1ac(0x128)](_0x36a1ac(0x112)):console[_0x36a1ac(0x128)]('✔\x20Retrieved\x20'+_0x1985f6[_0x36a1ac(0x126)]+_0x36a1ac(0x12b)+(_0x1985f6[_0x36a1ac(0x126)]!==0x1?'s':'')+_0x36a1ac(0x124)+_0x154a6b),await handleSDKOutput(_0x1985f6,_0x59cd86),0x0;}catch(_0x535f35){if(_0x535f35 instanceof SDKError)return console[_0x36a1ac(0x128)](_0x36a1ac(0x121)+_0x535f35[_0x36a1ac(0x115)]),_0x535f35[_0x36a1ac(0x119)]&&console['error'](_0x36a1ac(0x10c)+_0x535f35[_0x36a1ac(0x119)]),0x1;throw _0x535f35;}}['validate'](_0x1467ba){const _0x1d8ddd=a46_0x104d6f;if(_0x1467ba[_0x1d8ddd(0x107)][_0x1d8ddd(0x126)]===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(_0x1467ba[_0x1d8ddd(0x107)][_0x1d8ddd(0x126)]>0x1)return _0x1d8ddd(0x109);return undefined;}}
1
+ const a46_0x2d03df=a46_0x5739;(function(_0xf8a91c,_0x394156){const _0x3532d8=a46_0x5739,_0x272510=_0xf8a91c();while(!![]){try{const _0x41b263=-parseInt(_0x3532d8(0x17a))/0x1+-parseInt(_0x3532d8(0x16f))/0x2*(parseInt(_0x3532d8(0x171))/0x3)+parseInt(_0x3532d8(0x160))/0x4*(parseInt(_0x3532d8(0x17b))/0x5)+-parseInt(_0x3532d8(0x182))/0x6+-parseInt(_0x3532d8(0x16d))/0x7*(-parseInt(_0x3532d8(0x17d))/0x8)+-parseInt(_0x3532d8(0x15d))/0x9*(-parseInt(_0x3532d8(0x169))/0xa)+-parseInt(_0x3532d8(0x165))/0xb*(-parseInt(_0x3532d8(0x170))/0xc);if(_0x41b263===_0x394156)break;else _0x272510['push'](_0x272510['shift']());}catch(_0x54b509){_0x272510['push'](_0x272510['shift']());}}}(a46_0x5a2b,0x41a6d));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';function a46_0x5739(_0x40abae,_0x51b06e){_0x40abae=_0x40abae-0x15b;const _0x5a2b5b=a46_0x5a2b();let _0x57392e=_0x5a2b5b[_0x40abae];return _0x57392e;}function a46_0x5a2b(){const _0x1873e7=['execute','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','641993SLzoxj','\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>','showTable','Site:\x20','1156040MbEpvs','limit','verbose','length','2051749mOkrdS','Show\x20table\x20contents','760642vybmfk','228xwoWnI','3ufQEgj','Usage:\x20tdx\x20show\x20<database.table>','data','validate','\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>','database','Querying\x20','✔\x20Retrieved\x20','✔\x20Query\x20successful\x20-\x200\x20rows\x20returned','463764qNmSHs','260DKRLJa','\x20from\x20','8LAIIpO','error','cause','description','catalog','2586180fPKQdw','Table:\x20','Database:\x20','Limit:\x20','site','9DxpAhW','table','\x20\x20Cause:\x20','2032CrNpAd','message','query'];a46_0x5a2b=function(){return _0x1873e7;};return a46_0x5a2b();}export class ShowCommand extends BaseCommand{['name']='show';[a46_0x2d03df(0x180)]=a46_0x2d03df(0x16e);async[a46_0x2d03df(0x163)](_0xc93d90){const _0x3bc29d=a46_0x2d03df;return this[_0x3bc29d(0x167)](_0xc93d90);}async['showTable'](_0x35cb80){const _0x4e414b=a46_0x2d03df,{options:_0x36685a,args:_0xec38cc,tdx:_0x7c0fb6}=_0x35cb80;let _0x29d8aa;try{_0x29d8aa=parseTableReference(_0xec38cc[0x0]);const _0x2d94eb=_0x36685a[_0x4e414b(0x176)];!_0x29d8aa[_0x4e414b(0x176)]&&_0x2d94eb&&(_0x29d8aa[_0x4e414b(0x176)]=_0x2d94eb);const _0x4eb095=validateTableDescribeReference(_0x29d8aa);if(_0x4eb095)return console['error']('Error:\x20'+_0x4eb095),console['error'](_0x4e414b(0x172)),console[_0x4e414b(0x17e)]('\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>'),console[_0x4e414b(0x17e)]('\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>'),0x1;}catch(_0x200297){return console[_0x4e414b(0x17e)]('Error:\x20'+_0x200297[_0x4e414b(0x161)]),console[_0x4e414b(0x17e)](_0x4e414b(0x172)),console[_0x4e414b(0x17e)](_0x4e414b(0x166)),console[_0x4e414b(0x17e)](_0x4e414b(0x175)),0x1;}const _0x1b5984=_0x29d8aa[_0x4e414b(0x181)],_0x8afcb9=_0x29d8aa['database'],_0x3343d5=_0x29d8aa[_0x4e414b(0x15e)],_0x3a5085=resolveLimit(_0x36685a[_0x4e414b(0x16a)],DEFAULT_DISPLAY_LIMIT);try{_0x36685a[_0x4e414b(0x16b)]&&(console[_0x4e414b(0x17e)](_0x4e414b(0x168)+_0x36685a[_0x4e414b(0x15c)]),_0x1b5984&&console['error']('Catalog:\x20'+_0x1b5984),console[_0x4e414b(0x17e)](_0x4e414b(0x184)+_0x8afcb9),console[_0x4e414b(0x17e)](_0x4e414b(0x183)+_0x3343d5),console[_0x4e414b(0x17e)](_0x4e414b(0x15b)+_0x3a5085));const _0x190032=_0x1b5984?_0x1b5984+'.'+_0x8afcb9+'.'+_0x3343d5:_0x8afcb9+'.'+_0x3343d5,_0x205e98=await withSpinner(_0x4e414b(0x177)+_0x190032+'...',()=>_0x7c0fb6[_0x4e414b(0x162)][_0x4e414b(0x167)](_0x8afcb9,_0x3343d5,_0x3a5085,_0x1b5984),{'verbose':_0x36685a[_0x4e414b(0x16b)]}),_0x5e6a7f=_0x205e98[_0x4e414b(0x173)],_0x1129aa=_0x5e6a7f[_0x4e414b(0x173)];return _0x1129aa[_0x4e414b(0x16c)]===0x0?console[_0x4e414b(0x17e)](_0x4e414b(0x179)):console[_0x4e414b(0x17e)](_0x4e414b(0x178)+_0x1129aa[_0x4e414b(0x16c)]+'\x20row'+(_0x1129aa[_0x4e414b(0x16c)]!==0x1?'s':'')+_0x4e414b(0x17c)+_0x190032),await handleSDKOutput(_0x1129aa,_0x36685a),0x0;}catch(_0x2c2772){if(_0x2c2772 instanceof SDKError)return console['error']('Error:\x20'+_0x2c2772[_0x4e414b(0x161)]),_0x2c2772['cause']&&console[_0x4e414b(0x17e)](_0x4e414b(0x15f)+_0x2c2772[_0x4e414b(0x17f)]),0x1;throw _0x2c2772;}}[a46_0x2d03df(0x174)](_0x2a9dea){const _0x31b736=a46_0x2d03df;if(_0x2a9dea['args'][_0x31b736(0x16c)]===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(_0x2a9dea['args'][_0x31b736(0x16c)]>0x1)return _0x31b736(0x164);return undefined;}}
@@ -1 +1 @@
1
- function a47_0x2006(){const _0x41c1f9=['OAuth','env','red','737087BJmDJG','No\x20credential\x20found','email','tdx','execute','N/A','status','cli','error','session','first_name','account_id','config','2873044TVXPPy','cyan','filter','6oYpnph','site:\x20','5775360tjsfdf','CLI\x20flag','Name:','699640XSTUxV','yellow','bold','Read\x20credential\x20from\x20','✓\x20Authentication\x20successful\x0a','Show\x20authentication\x20status\x20and\x20current\x20context','name','User:','359679cwiSjA','log','1533850jnYWOb','jobs','(from\x20','✗\x20Validation\x20failed:\x20','last_name','green','profile','1985795AkMRPV','dim','join','displayWithSources','Account\x20ID:'];a47_0x2006=function(){return _0x41c1f9;};return a47_0x2006();}const a47_0x1867fa=a47_0xf300;(function(_0x36f7cc,_0x31f338){const _0x39d690=a47_0xf300,_0x3625fb=_0x36f7cc();while(!![]){try{const _0x15da8f=parseInt(_0x39d690(0x1da))/0x1+-parseInt(_0x39d690(0x1ea))/0x2*(parseInt(_0x39d690(0x1c9))/0x3)+-parseInt(_0x39d690(0x1e7))/0x4+-parseInt(_0x39d690(0x1cb))/0x5+parseInt(_0x39d690(0x1ec))/0x6+parseInt(_0x39d690(0x1d2))/0x7+-parseInt(_0x39d690(0x1c1))/0x8;if(_0x15da8f===_0x31f338)break;else _0x3625fb['push'](_0x3625fb['shift']());}catch(_0x816ca6){_0x3625fb['push'](_0x3625fb['shift']());}}}(a47_0x2006,0x7ccbf));import{BaseCommand,printAuthError}from'./command.js';import{resolveAPIKeyAsync}from'../core/config.js';import{getOAuthTokens}from'../core/oauth-keychain.js';function a47_0xf300(_0x1876c7,_0x2c1a6b){_0x1876c7=_0x1876c7-0x1bf;const _0x200602=a47_0x2006();let _0xf3008f=_0x200602[_0x1876c7];return _0xf3008f;}import{HTTPClientError}from'../sdk/client/http-client.js';import{GlobalContext}from'../core/global-context.js';import a47_0x5b17df from'chalk';export class StatusCommand extends BaseCommand{[a47_0x1867fa(0x1c7)]=a47_0x1867fa(0x1e0);['description']=a47_0x1867fa(0x1c6);async[a47_0x1867fa(0x1de)](_0x2a1c19){const _0x3d61c0=a47_0x1867fa,{options:_0x357513,tdx:_0x2d9638}=_0x2a1c19,_0x16b6ec=_0x357513['site'],_0x4991f9=new GlobalContext(_0x357513),_0x5bd165=_0x4991f9[_0x3d61c0(0x1d1)],_0x348372=_0x4991f9['profileSource'],_0x14314e=_0x348372===_0x3d61c0(0x1e1)?_0x3d61c0(0x1bf):_0x348372===_0x3d61c0(0x1e3)?'session':_0x348372===_0x3d61c0(0x1d8)?'TDX_PROFILE\x20env':_0x348372==='config'?_0x3d61c0(0x1e6):null,_0x2245c5=_0x5bd165?a47_0x5b17df[_0x3d61c0(0x1e8)](_0x5bd165):a47_0x5b17df[_0x3d61c0(0x1d3)](_0x3d61c0(0x1df)),_0x1849f5=_0x14314e?'\x20'+a47_0x5b17df['dim'](_0x3d61c0(0x1cd)+_0x14314e+')'):'';console['log'](a47_0x5b17df['bold'](_0x3d61c0(0x1dd))+'\x20profile:\x20'+_0x2245c5+_0x1849f5+'\x20'+a47_0x5b17df[_0x3d61c0(0x1d3)]('(')+_0x3d61c0(0x1eb)+a47_0x5b17df[_0x3d61c0(0x1e8)](_0x16b6ec)+a47_0x5b17df[_0x3d61c0(0x1d3)](')'));const _0x5a98c1=await getOAuthTokens(_0x5bd165);if(_0x5a98c1)console[_0x3d61c0(0x1ca)]('Credential\x20type:\x20'+a47_0x5b17df['cyan'](_0x3d61c0(0x1d7)));else{const _0x32e292=await resolveAPIKeyAsync(_0x16b6ec,_0x5bd165);if(_0x32e292){const {source:_0xc83337,isDeprecated:_0x45938a}=_0x32e292,_0x332513=_0x3d61c0(0x1c4)+a47_0x5b17df[_0x3d61c0(0x1e8)](_0xc83337);console[_0x3d61c0(0x1ca)](_0x45938a?a47_0x5b17df['yellow'](_0x332513):_0x332513);}else console[_0x3d61c0(0x1ca)](a47_0x5b17df[_0x3d61c0(0x1c2)](_0x3d61c0(0x1db)));}let _0xc41a25=![];try{const _0x4bb505=await _0x2d9638[_0x3d61c0(0x1cc)]['getUserInfo']();console[_0x3d61c0(0x1ca)](a47_0x5b17df[_0x3d61c0(0x1d0)](_0x3d61c0(0x1c5))),console['log'](a47_0x5b17df[_0x3d61c0(0x1c3)](_0x3d61c0(0x1c8))+'\x20'+a47_0x5b17df[_0x3d61c0(0x1e8)](_0x4bb505[_0x3d61c0(0x1dc)]));if(_0x4bb505[_0x3d61c0(0x1e4)]||_0x4bb505['last_name']){const _0x2ee6f5=[_0x4bb505['first_name'],_0x4bb505[_0x3d61c0(0x1cf)]][_0x3d61c0(0x1e9)](Boolean)[_0x3d61c0(0x1d4)]('\x20');console[_0x3d61c0(0x1ca)](a47_0x5b17df[_0x3d61c0(0x1c3)](_0x3d61c0(0x1c0))+'\x20'+_0x2ee6f5);}_0x4bb505[_0x3d61c0(0x1e5)]&&console[_0x3d61c0(0x1ca)](a47_0x5b17df[_0x3d61c0(0x1c3)](_0x3d61c0(0x1d6))+'\x20'+a47_0x5b17df[_0x3d61c0(0x1c2)](_0x4bb505[_0x3d61c0(0x1e5)])),_0xc41a25=!![];}catch(_0x330bfd){_0x330bfd instanceof HTTPClientError&&_0x330bfd[_0x3d61c0(0x1e0)]===0x191?printAuthError(_0x330bfd,!![],_0x5bd165):console[_0x3d61c0(0x1e2)](a47_0x5b17df[_0x3d61c0(0x1d9)](_0x3d61c0(0x1ce)+(_0x330bfd instanceof Error?_0x330bfd['message']:String(_0x330bfd))));}return console[_0x3d61c0(0x1ca)](),_0x4991f9[_0x3d61c0(0x1d5)](),_0xc41a25?0x0:0x1;}}
1
+ const a47_0x551d4f=a47_0x3367;(function(_0x462d5f,_0x203514){const _0x32b37c=a47_0x3367,_0x501e2c=_0x462d5f();while(!![]){try{const _0x388644=-parseInt(_0x32b37c(0xca))/0x1+parseInt(_0x32b37c(0xa9))/0x2*(-parseInt(_0x32b37c(0xc6))/0x3)+-parseInt(_0x32b37c(0xac))/0x4*(parseInt(_0x32b37c(0xc0))/0x5)+parseInt(_0x32b37c(0xd0))/0x6+parseInt(_0x32b37c(0xd2))/0x7*(parseInt(_0x32b37c(0xbf))/0x8)+-parseInt(_0x32b37c(0xcf))/0x9+parseInt(_0x32b37c(0xc2))/0xa*(parseInt(_0x32b37c(0xd7))/0xb);if(_0x388644===_0x203514)break;else _0x501e2c['push'](_0x501e2c['shift']());}catch(_0x319936){_0x501e2c['push'](_0x501e2c['shift']());}}}(a47_0x2711,0x6a82c));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_0x2711(){const _0x39b62e=['cyan','21923MWGKRs','1626334GjDJRc','config','message','16umJhkB','red','first_name','Credential\x20type:\x20','last_name','env','Name:','error','tdx','status','filter','site','Read\x20credential\x20from\x20','execute','N/A','site:\x20','email','yellow','session','8PNuWiQ','478585WnLvlp','getUserInfo','6460zFsixM','jobs','(from\x20','\x20profile:\x20','3ZgHbDj','OAuth','bold','log','187660yaANTy','cli','CLI\x20flag','✓\x20Authentication\x20successful\x0a','green','41301tLGERj','458922BiLXHj','dim','3224109CPVhuJ','Account\x20ID:','No\x20credential\x20found','name'];a47_0x2711=function(){return _0x39b62e;};return a47_0x2711();}import{GlobalContext}from'../core/global-context.js';import a47_0x55b93f from'chalk';function a47_0x3367(_0x659202,_0x9d2de7){_0x659202=_0x659202-0xa9;const _0x27110a=a47_0x2711();let _0x33673b=_0x27110a[_0x659202];return _0x33673b;}export class StatusCommand extends BaseCommand{[a47_0x551d4f(0xd5)]=a47_0x551d4f(0xb5);['description']='Show\x20authentication\x20status\x20and\x20current\x20context';async[a47_0x551d4f(0xb9)](_0x1640f8){const _0x3bcd6b=a47_0x551d4f,{options:_0x28495c,tdx:_0xabac11}=_0x1640f8,_0x1f4cb7=_0x28495c[_0x3bcd6b(0xb7)],_0x5e32ce=new GlobalContext(_0x28495c),_0x44340f=_0x5e32ce['profile'],_0xda2304=_0x5e32ce['profileSource'],_0x3f90a5=_0xda2304===_0x3bcd6b(0xcb)?_0x3bcd6b(0xcc):_0xda2304==='session'?_0x3bcd6b(0xbe):_0xda2304===_0x3bcd6b(0xb1)?'TDX_PROFILE\x20env':_0xda2304===_0x3bcd6b(0xaa)?'config':null,_0x56c546=_0x44340f?a47_0x55b93f[_0x3bcd6b(0xd6)](_0x44340f):a47_0x55b93f['dim'](_0x3bcd6b(0xba)),_0x3dcb3c=_0x3f90a5?'\x20'+a47_0x55b93f[_0x3bcd6b(0xd1)](_0x3bcd6b(0xc4)+_0x3f90a5+')'):'';console[_0x3bcd6b(0xc9)](a47_0x55b93f[_0x3bcd6b(0xc8)](_0x3bcd6b(0xb4))+_0x3bcd6b(0xc5)+_0x56c546+_0x3dcb3c+'\x20'+a47_0x55b93f[_0x3bcd6b(0xd1)]('(')+_0x3bcd6b(0xbb)+a47_0x55b93f[_0x3bcd6b(0xd6)](_0x1f4cb7)+a47_0x55b93f[_0x3bcd6b(0xd1)](')'));const _0x4e90e2=await getOAuthTokens(_0x44340f);if(_0x4e90e2)console[_0x3bcd6b(0xc9)](_0x3bcd6b(0xaf)+a47_0x55b93f['cyan'](_0x3bcd6b(0xc7)));else{const _0x6f50f9=await resolveAPIKeyAsync(_0x1f4cb7,_0x44340f);if(_0x6f50f9){const {source:_0x298d81,isDeprecated:_0x1fbcb7}=_0x6f50f9,_0x584792=_0x3bcd6b(0xb8)+a47_0x55b93f['cyan'](_0x298d81);console[_0x3bcd6b(0xc9)](_0x1fbcb7?a47_0x55b93f[_0x3bcd6b(0xbd)](_0x584792):_0x584792);}else console[_0x3bcd6b(0xc9)](a47_0x55b93f['yellow'](_0x3bcd6b(0xd4)));}let _0x3cba11=![];try{const _0x354117=await _0xabac11[_0x3bcd6b(0xc3)][_0x3bcd6b(0xc1)]();console['log'](a47_0x55b93f[_0x3bcd6b(0xce)](_0x3bcd6b(0xcd))),console[_0x3bcd6b(0xc9)](a47_0x55b93f['bold']('User:')+'\x20'+a47_0x55b93f['cyan'](_0x354117[_0x3bcd6b(0xbc)]));if(_0x354117[_0x3bcd6b(0xae)]||_0x354117['last_name']){const _0x34dbb3=[_0x354117[_0x3bcd6b(0xae)],_0x354117[_0x3bcd6b(0xb0)]][_0x3bcd6b(0xb6)](Boolean)['join']('\x20');console['log'](a47_0x55b93f[_0x3bcd6b(0xc8)](_0x3bcd6b(0xb2))+'\x20'+_0x34dbb3);}_0x354117['account_id']&&console['log'](a47_0x55b93f[_0x3bcd6b(0xc8)](_0x3bcd6b(0xd3))+'\x20'+a47_0x55b93f[_0x3bcd6b(0xbd)](_0x354117['account_id'])),_0x3cba11=!![];}catch(_0x104361){_0x104361 instanceof HTTPClientError&&_0x104361[_0x3bcd6b(0xb5)]===0x191?printAuthError(_0x104361,!![],_0x44340f):console[_0x3bcd6b(0xb3)](a47_0x55b93f[_0x3bcd6b(0xad)]('✗\x20Validation\x20failed:\x20'+(_0x104361 instanceof Error?_0x104361[_0x3bcd6b(0xab)]:String(_0x104361))));}return console[_0x3bcd6b(0xc9)](),_0x5e32ce['displayWithSources'](),_0x3cba11?0x0:0x1;}}