@treasuredata/tdx 2026.4.12 → 2026.4.13

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 (220) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.js +1 -1
  5. package/dist/commands/activations.js +1 -1
  6. package/dist/commands/agent-command.js +1 -1
  7. package/dist/commands/agent-test-command.js +1 -1
  8. package/dist/commands/api-command.js +1 -1
  9. package/dist/commands/auth-command.js +1 -1
  10. package/dist/commands/cas-command.js +1 -1
  11. package/dist/commands/cas-segment-command.js +1 -1
  12. package/dist/commands/chat-command.js +1 -1
  13. package/dist/commands/claude-command.js +1 -1
  14. package/dist/commands/claude-statusline-command.js +1 -1
  15. package/dist/commands/claude-usage-command.js +1 -1
  16. package/dist/commands/command.js +1 -1
  17. package/dist/commands/connection-command.js +1 -1
  18. package/dist/commands/databases.js +1 -1
  19. package/dist/commands/delivery-command.js +1 -1
  20. package/dist/commands/describe.js +1 -1
  21. package/dist/commands/engage-campaign-pull-command.js +1 -1
  22. package/dist/commands/engage-campaign-push-command.js +1 -1
  23. package/dist/commands/engage-campaign-validate-command.js +1 -1
  24. package/dist/commands/engage-command.js +1 -1
  25. package/dist/commands/engage-template-pull-command.js +1 -1
  26. package/dist/commands/engage-template-push-command.js +1 -1
  27. package/dist/commands/engage-template-validate-command.js +1 -1
  28. package/dist/commands/job-command.js +1 -1
  29. package/dist/commands/journey-command.js +1 -1
  30. package/dist/commands/journey-validate-command.js +1 -1
  31. package/dist/commands/llm-command.js +1 -1
  32. package/dist/commands/mcp-command.js +1 -1
  33. package/dist/commands/parent-segment-command.js +1 -1
  34. package/dist/commands/policy-command.js +1 -1
  35. package/dist/commands/profile-command.js +1 -1
  36. package/dist/commands/profiles-command.js +1 -1
  37. package/dist/commands/query-command.js +1 -1
  38. package/dist/commands/schedule-command.js +1 -1
  39. package/dist/commands/segment-command.js +1 -1
  40. package/dist/commands/segment-create-command.js +1 -1
  41. package/dist/commands/segment-fields-command.js +1 -1
  42. package/dist/commands/segment-pull-command.js +1 -1
  43. package/dist/commands/segment-push-command.js +1 -1
  44. package/dist/commands/segment-update-command.js +1 -1
  45. package/dist/commands/segment-use-command.js +1 -1
  46. package/dist/commands/segment-validate-command.js +1 -1
  47. package/dist/commands/segments.js +1 -1
  48. package/dist/commands/show.js +1 -1
  49. package/dist/commands/status-command.js +1 -1
  50. package/dist/commands/tables.js +1 -1
  51. package/dist/commands/unset-command.js +1 -1
  52. package/dist/commands/upgrade-command.js +1 -1
  53. package/dist/commands/use-command.js +1 -1
  54. package/dist/commands/user-command.js +1 -1
  55. package/dist/commands/work-command.js +1 -1
  56. package/dist/commands/workflow-command.js +1 -1
  57. package/dist/core/auth.js +1 -1
  58. package/dist/core/command-output.js +1 -1
  59. package/dist/core/config.js +1 -1
  60. package/dist/core/connection-cache.js +1 -1
  61. package/dist/core/constants.js +1 -1
  62. package/dist/core/credential-cache.js +1 -1
  63. package/dist/core/global-context.js +1 -1
  64. package/dist/core/keychain.js +1 -1
  65. package/dist/core/oauth-keychain.js +1 -1
  66. package/dist/core/oauth.js +1 -1
  67. package/dist/core/profile.js +1 -1
  68. package/dist/core/project-config.js +1 -1
  69. package/dist/core/session.js +1 -1
  70. package/dist/core/user-cache.js +1 -1
  71. package/dist/core/version.js +1 -1
  72. package/dist/index.js +1 -1
  73. package/dist/mcp/server.js +1 -1
  74. package/dist/mcp/tools/index.js +1 -1
  75. package/dist/mcp/tools/tdx-run.js +1 -1
  76. package/dist/mcp/tools/tdx-search.js +1 -1
  77. package/dist/mcp/tools/work-create-item.js +1 -1
  78. package/dist/mcp/utils.js +1 -1
  79. package/dist/proxy/claude-usage-tracker.js +1 -1
  80. package/dist/proxy/passthrough-server.js +1 -1
  81. package/dist/proxy/sse-usage-parser.js +1 -1
  82. package/dist/sdk/agent/agent-config.js +1 -1
  83. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  84. package/dist/sdk/agent/agent-yaml.js +1 -1
  85. package/dist/sdk/agent/test/evaluator.js +1 -1
  86. package/dist/sdk/agent/test/executor.js +1 -1
  87. package/dist/sdk/agent/test/index.js +1 -1
  88. package/dist/sdk/agent/test/output.js +1 -1
  89. package/dist/sdk/agent/test/parser.js +1 -1
  90. package/dist/sdk/agent/tool-target-registry.js +1 -1
  91. package/dist/sdk/api.js +1 -1
  92. package/dist/sdk/cas/cas-api-client.js +1 -1
  93. package/dist/sdk/cas/cas-audience-yaml.js +1 -1
  94. package/dist/sdk/cas/cas-segment-yaml.js +1 -1
  95. package/dist/sdk/cas/index.js +1 -1
  96. package/dist/sdk/cas/pull-workflow.js +1 -1
  97. package/dist/sdk/cas/push-workflow.js +1 -1
  98. package/dist/sdk/client/cdp-api-client.js +1 -1
  99. package/dist/sdk/client/delivery-api-client.js +1 -1
  100. package/dist/sdk/client/endpoints.js +1 -1
  101. package/dist/sdk/client/engage-api-client.js +1 -1
  102. package/dist/sdk/client/http-client.js +1 -1
  103. package/dist/sdk/client/llm-api-client.js +1 -1
  104. package/dist/sdk/client/oauth-refresh.js +1 -1
  105. package/dist/sdk/client/rate-limiter.js +1 -1
  106. package/dist/sdk/client/td-api-client.js +1 -1
  107. package/dist/sdk/client/trino-api-client.js +1 -1
  108. package/dist/sdk/client/workflow-client.js +1 -1
  109. package/dist/sdk/connection-validator.js +1 -1
  110. package/dist/sdk/connection.js +1 -1
  111. package/dist/sdk/delivery.js +1 -1
  112. package/dist/sdk/engage/campaign-pull.js +1 -1
  113. package/dist/sdk/engage/campaign-push.js +1 -1
  114. package/dist/sdk/engage/campaign-validator.js +1 -1
  115. package/dist/sdk/engage/campaign-yaml.js +1 -1
  116. package/dist/sdk/engage/template-pull.js +1 -1
  117. package/dist/sdk/engage/template-push.js +1 -1
  118. package/dist/sdk/engage/template-validator.js +1 -1
  119. package/dist/sdk/engage/template-yaml.js +1 -1
  120. package/dist/sdk/engage/types/campaign-def.js +1 -1
  121. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  122. package/dist/sdk/engage/types/template-schema.js +1 -1
  123. package/dist/sdk/engage.js +1 -1
  124. package/dist/sdk/errors.js +1 -1
  125. package/dist/sdk/index.js +1 -1
  126. package/dist/sdk/io/index.js +1 -1
  127. package/dist/sdk/io/node-filesystem.js +1 -1
  128. package/dist/sdk/job.js +1 -1
  129. package/dist/sdk/journey.js +1 -1
  130. package/dist/sdk/llm/chat-cache.js +1 -1
  131. package/dist/sdk/llm/index.js +1 -1
  132. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  133. package/dist/sdk/llm/model-factors.js +1 -1
  134. package/dist/sdk/personalization.js +1 -1
  135. package/dist/sdk/policy.js +1 -1
  136. package/dist/sdk/query/index.js +1 -1
  137. package/dist/sdk/query/sql-parser.js +1 -1
  138. package/dist/sdk/realtime.js +1 -1
  139. package/dist/sdk/schedule.js +1 -1
  140. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  141. package/dist/sdk/segment/fields-display.js +1 -1
  142. package/dist/sdk/segment/file-discovery.js +1 -1
  143. package/dist/sdk/segment/journey-utils.js +1 -1
  144. package/dist/sdk/segment/journey-validator.js +1 -1
  145. package/dist/sdk/segment/journey-yaml.js +1 -1
  146. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  147. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  148. package/dist/sdk/segment/pull-workflow.js +1 -1
  149. package/dist/sdk/segment/push-recovery.js +1 -1
  150. package/dist/sdk/segment/push-workflow.js +1 -1
  151. package/dist/sdk/segment/resolution-context.js +1 -1
  152. package/dist/sdk/segment/segment-path-parser.js +1 -1
  153. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  154. package/dist/sdk/segment/segment-validator.js +1 -1
  155. package/dist/sdk/segment/target-resolution.js +1 -1
  156. package/dist/sdk/segment/tdx-config.js +1 -1
  157. package/dist/sdk/segment/types/activation-schema.js +1 -1
  158. package/dist/sdk/segment/types/journey-def.js +1 -1
  159. package/dist/sdk/segment/types/journey-schema.js +1 -1
  160. package/dist/sdk/segment/types/segment-def.js +1 -1
  161. package/dist/sdk/segment/types/segment-schema.js +1 -1
  162. package/dist/sdk/segment/validate-files.js +1 -1
  163. package/dist/sdk/segment/yaml-validator.js +1 -1
  164. package/dist/sdk/segment.js +1 -1
  165. package/dist/sdk/types/index.js +1 -1
  166. package/dist/sdk/types/progress.js +1 -1
  167. package/dist/sdk/types/workspace.js +1 -1
  168. package/dist/sdk/user.js +1 -1
  169. package/dist/sdk/util/format-detector.js +1 -1
  170. package/dist/sdk/util/formatters.js +1 -1
  171. package/dist/sdk/util/index.js +1 -1
  172. package/dist/sdk/util/paginate.js +1 -1
  173. package/dist/sdk/util/tree-formatter.js +1 -1
  174. package/dist/sdk/workflow/archive-validation.js +1 -1
  175. package/dist/sdk/workflow/clone-workflow.js +1 -1
  176. package/dist/sdk/workflow/index.js +1 -1
  177. package/dist/sdk/workflow/pull-workflow.js +1 -1
  178. package/dist/sdk/workflow/push-workflow.js +1 -1
  179. package/dist/sdk/workflow/tdx-config.js +1 -1
  180. package/dist/sdk/workflow/workflow-utils.js +1 -1
  181. package/dist/sdk/workspace/access-tracker.js +1 -1
  182. package/dist/sdk/workspace/frontmatter.js +1 -1
  183. package/dist/sdk/workspace/git.js +1 -1
  184. package/dist/sdk/workspace/index.js +1 -1
  185. package/dist/sdk/workspace/templates.js +1 -1
  186. package/dist/sdk/workspace/weekly.js +1 -1
  187. package/dist/sdk/workspace/wikilinks.js +1 -1
  188. package/dist/test-utils/command-runner.js +1 -1
  189. package/dist/test-utils/factories.js +1 -1
  190. package/dist/test-utils/fixtures.js +1 -1
  191. package/dist/test-utils/http-mock.js +1 -1
  192. package/dist/test-utils/index.js +1 -1
  193. package/dist/utils/async.js +1 -1
  194. package/dist/utils/colors.js +1 -1
  195. package/dist/utils/diff.js +1 -1
  196. package/dist/utils/file-permissions.js +1 -1
  197. package/dist/utils/file-reader.js +1 -1
  198. package/dist/utils/github-releases.js +1 -1
  199. package/dist/utils/global-cache.js +1 -1
  200. package/dist/utils/json-loader.js +1 -1
  201. package/dist/utils/local-cache.js +1 -1
  202. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  203. package/dist/utils/logger/formatters/index.js +1 -1
  204. package/dist/utils/logger/handlers/console-handler.js +1 -1
  205. package/dist/utils/logger/handlers/file-handler.js +1 -1
  206. package/dist/utils/logger/handlers/index.js +1 -1
  207. package/dist/utils/logger/handlers/null-handler.js +1 -1
  208. package/dist/utils/logger/index.js +1 -1
  209. package/dist/utils/logger/logger.js +1 -1
  210. package/dist/utils/logger/types.js +1 -1
  211. package/dist/utils/option-validation.js +1 -1
  212. package/dist/utils/process.js +1 -1
  213. package/dist/utils/prompt.js +1 -1
  214. package/dist/utils/spinner.js +1 -1
  215. package/dist/utils/sse-parser.js +1 -1
  216. package/dist/utils/string-utils.js +1 -1
  217. package/dist/utils/table-ref-parser.js +1 -1
  218. package/dist/utils/tdx-logger.js +1 -1
  219. package/dist/utils/version-check.js +1 -1
  220. package/package.json +1 -1
@@ -1 +1 @@
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
+ const a40_0x333da9=a40_0x1728;(function(_0x37bf97,_0x375045){const _0x4df663=a40_0x1728,_0x3bbc37=_0x37bf97();while(!![]){try{const _0x48a5c1=-parseInt(_0x4df663(0x20d))/0x1*(parseInt(_0x4df663(0x228))/0x2)+parseInt(_0x4df663(0x202))/0x3*(-parseInt(_0x4df663(0x22c))/0x4)+-parseInt(_0x4df663(0x203))/0x5*(-parseInt(_0x4df663(0x21a))/0x6)+-parseInt(_0x4df663(0x229))/0x7+parseInt(_0x4df663(0x1fb))/0x8*(parseInt(_0x4df663(0x233))/0x9)+parseInt(_0x4df663(0x21e))/0xa*(parseInt(_0x4df663(0x1f6))/0xb)+parseInt(_0x4df663(0x22f))/0xc;if(_0x48a5c1===_0x375045)break;else _0x3bbc37['push'](_0x3bbc37['shift']());}catch(_0x57fe90){_0x3bbc37['push'](_0x3bbc37['shift']());}}}(a40_0x28f3,0x23809));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';function a40_0x28f3(){const _0x63b61d=['content','3540oyBfPh','segment','red','\x20files?','\x20journeys','dirname','file','dim','\x20activations','✔\x20All\x20files\x20are\x20up\x20to\x20date','387554GKihCL','197617EgkiOs','yes','name','12ROLVTo','cyan','length','2543592AfYxxm','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file','relativePath','description','357183xOdsHR','Aborted.','Write\x20','segment:pull','resourceName','pullSegments','isNew','Usage:\x20tdx\x20sg\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20(requires\x20context\x20or\x20tdx.json)','counts','targetDir','session','\x20new\x20files','\x20\x20Target:\x20','\x20changed\x20files','files','\x20\x20🗺️\x20\x20','activations','dryRun','filter','absolutePath','\x20segments','utf-8','\x0aPull\x20summary\x20for\x20\x27','\x20versions)','1969wGMtPD','\x20files\x20to\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent','✔\x20Pulled\x20','journeys','24TuNUMw','green','\x20\x20🎯\x20','Parent\x20segment:\x20','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','\x0aError:','diff','53373muwCui','25XuVcIn','parent_segment','cwd','yellow','parentSegment','error','journeyVersions','verbose','segments','message','1dhjDan','\x20with\x20','parentName','setPhase','Site:\x20','site','\x0aChanges\x20to\x20\x27','Error:\x20','repeat','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','✔\x20Context\x20set:\x20','\x20=\x20','No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27','31686lRwNFi','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','hasChanges'];a40_0x28f3=function(){return _0x63b61d;};return a40_0x28f3();}import{saveSessionContext}from'../core/session.js';import a40_0x5a2802 from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';import a40_0x4c4c47 from'path';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';function a40_0x1728(_0x364f22,_0x385705){_0x364f22=_0x364f22-0x1eb;const _0x28f363=a40_0x28f3();let _0x1728ee=_0x28f363[_0x364f22];return _0x1728ee;}export{buildFolderIdToPathMap as buildFolderPathMap}from'../sdk/segment/resolution-context.js';export class SegmentPullCommand extends BaseCommand{[a40_0x333da9(0x22b)]=a40_0x333da9(0x236);[a40_0x333da9(0x232)]='Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files';async['execute'](_0x18e98c){const _0x286b04=a40_0x333da9,{options:_0x5660ef,args:_0x6bf97b,tdx:_0x3613ec}=_0x18e98c,_0xd65c4c=_0x5660ef,_0x20fe38=await resolveTarget({'arg':_0x6bf97b[0x0],'contextParent':_0x5660ef[_0x286b04(0x207)],'cwd':process[_0x286b04(0x205)]()});if(!isSuccessfulResolution(_0x20fe38))return _0x20fe38['errorCode']==='no_parent'?(console[_0x286b04(0x208)](a40_0x5a2802['yellow'](_0x286b04(0x216))),console[_0x286b04(0x208)](_0x286b04(0x23a)),console['error'](_0x286b04(0x1f8)),console[_0x286b04(0x208)](_0x286b04(0x230))):(console[_0x286b04(0x208)](a40_0x5a2802[_0x286b04(0x220)](_0x286b04(0x214)+_0x20fe38[_0x286b04(0x20c)]+'\x0a')),_0x20fe38['helpText']&&console['error'](a40_0x5a2802['cyan'](_0x20fe38['helpText']))),0x1;const _0x3ff448=_0x20fe38[_0x286b04(0x20f)],_0x500e75=_0x20fe38[_0x286b04(0x23c)],_0x4e48c3=_0x20fe38['type']===_0x286b04(0x224)?_0x20fe38[_0x286b04(0x237)]:undefined;_0xd65c4c['verbose']&&(console[_0x286b04(0x208)](_0x286b04(0x211)+_0xd65c4c[_0x286b04(0x212)]),console[_0x286b04(0x208)](_0x286b04(0x1fe)+_0x3ff448),_0x4e48c3&&console[_0x286b04(0x208)]('Target\x20resource:\x20'+_0x4e48c3));const _0x55a105=await withProgressSpinner('Pulling\x20segments\x20from\x20\x27'+_0x3ff448+'\x27...',_0x46e2b6=>_0x3613ec[_0x286b04(0x21f)][_0x286b04(0x238)](_0x3ff448,{'targetDir':_0x500e75,'targetResourceName':_0x4e48c3,'verbose':_0xd65c4c['verbose'],'progress':{'update':_0x3e67ac=>{const _0x3a9e05=_0x286b04;_0x46e2b6[_0x3a9e05(0x210)](_0x3e67ac),_0xd65c4c[_0x3a9e05(0x20a)]&&console['error']('\x20\x20'+_0x3e67ac);}}}),{'verbose':_0xd65c4c[_0x286b04(0x20a)]}),_0x585ae8=_0x55a105['data'];if(_0x585ae8[_0x286b04(0x23b)][_0x286b04(0x20b)]===0x0&&_0x585ae8[_0x286b04(0x23b)][_0x286b04(0x1fa)]===0x0)return console[_0x286b04(0x208)](a40_0x5a2802[_0x286b04(0x206)](_0x286b04(0x219)+_0x585ae8['parentName']+'\x27')),0x0;const _0x29d1ac=_0x585ae8[_0x286b04(0x1ec)]['filter'](_0x3d69ba=>_0x3d69ba[_0x286b04(0x239)]),_0x522885=_0x585ae8[_0x286b04(0x1ec)]['filter'](_0x87c82c=>!_0x87c82c[_0x286b04(0x239)]&&_0x87c82c[_0x286b04(0x21c)]),_0x2c9206=_0x585ae8[_0x286b04(0x1ec)][_0x286b04(0x1f0)](_0x4c3fcb=>!_0x4c3fcb['isNew']&&!_0x4c3fcb[_0x286b04(0x21c)]);console[_0x286b04(0x208)](_0x286b04(0x1f4)+_0x585ae8[_0x286b04(0x20f)]+'\x27:'),console[_0x286b04(0x208)](_0x286b04(0x1fd)+a40_0x5a2802[_0x286b04(0x22d)](_0x585ae8['counts']['segments']+_0x286b04(0x1f2))+_0x286b04(0x20e)+a40_0x5a2802[_0x286b04(0x22d)](_0x585ae8['counts'][_0x286b04(0x1ee)]+_0x286b04(0x226)));if(_0x585ae8[_0x286b04(0x23b)][_0x286b04(0x1fa)]>0x0){const _0x560ca4=_0x585ae8[_0x286b04(0x23b)][_0x286b04(0x209)]>_0x585ae8['counts'][_0x286b04(0x1fa)]?'\x20('+_0x585ae8[_0x286b04(0x23b)][_0x286b04(0x209)]+_0x286b04(0x1f5):'';console[_0x286b04(0x208)](_0x286b04(0x1ed)+a40_0x5a2802[_0x286b04(0x22d)](_0x585ae8['counts'][_0x286b04(0x1fa)]+_0x286b04(0x222))+a40_0x5a2802['dim'](_0x560ca4));}console['error']('\x20\x20'+a40_0x5a2802[_0x286b04(0x1fc)]('+\x20'+_0x29d1ac[_0x286b04(0x22e)]+_0x286b04(0x23e))),console['error']('\x20\x20'+a40_0x5a2802[_0x286b04(0x206)]('~\x20'+_0x522885['length']+_0x286b04(0x1eb))),console['error']('\x20\x20'+a40_0x5a2802[_0x286b04(0x225)]('=\x20'+_0x2c9206['length']+'\x20unchanged\x20files')),console[_0x286b04(0x208)](_0x286b04(0x23f)+a40_0x5a2802['cyan'](_0x585ae8[_0x286b04(0x23c)])+'\x0a');if(_0x522885[_0x286b04(0x22e)]>0x0)for(const _0x49d2b5 of _0x522885){console[_0x286b04(0x208)](_0x286b04(0x213)+_0x49d2b5[_0x286b04(0x231)]+'\x27:'),console[_0x286b04(0x208)]('─'[_0x286b04(0x215)](0x3c)),console[_0x286b04(0x208)](_0x49d2b5[_0x286b04(0x201)]),console['error']('─'[_0x286b04(0x215)](0x3c));}if(_0xd65c4c[_0x286b04(0x1ef)])return console[_0x286b04(0x208)](a40_0x5a2802[_0x286b04(0x206)](_0x286b04(0x1ff))),0x0;if(_0x29d1ac[_0x286b04(0x22e)]===0x0&&_0x522885[_0x286b04(0x22e)]===0x0)return console[_0x286b04(0x208)](a40_0x5a2802[_0x286b04(0x1fc)](_0x286b04(0x227))),saveSessionContext({'parent_segment':_0x585ae8[_0x286b04(0x20f)]},_0xd65c4c[_0x286b04(0x23d)]),console['error'](a40_0x5a2802[_0x286b04(0x1fc)]('✔\x20Context\x20set:\x20'+a40_0x5a2802[_0x286b04(0x225)]('parent_segment')+_0x286b04(0x218)+a40_0x5a2802['cyan'](_0x585ae8[_0x286b04(0x20f)]))),0x0;if(!_0xd65c4c[_0x286b04(0x22a)]){if(!isInteractive())return console[_0x286b04(0x208)](a40_0x5a2802[_0x286b04(0x220)](_0x286b04(0x200)),_0x286b04(0x21b)),console['error'](a40_0x5a2802[_0x286b04(0x225)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x21dff3=await confirmKey(_0x286b04(0x235)+(_0x29d1ac[_0x286b04(0x22e)]+_0x522885[_0x286b04(0x22e)])+_0x286b04(0x221));if(!_0x21dff3)return console[_0x286b04(0x208)](a40_0x5a2802[_0x286b04(0x206)](_0x286b04(0x234)),'-\x20no\x20files\x20written'),0x1;}for(const _0xe65676 of _0x585ae8[_0x286b04(0x1ec)]){if(_0xe65676['isNew']||_0xe65676[_0x286b04(0x21c)]){const _0x331a00=a40_0x4c4c47[_0x286b04(0x223)](_0xe65676[_0x286b04(0x1f1)]);!existsSync(_0x331a00)&&mkdirSync(_0x331a00,{'recursive':!![]}),writeFileSync(_0xe65676[_0x286b04(0x1f1)],_0xe65676[_0x286b04(0x21d)],_0x286b04(0x1f3));}}return console[_0x286b04(0x208)](a40_0x5a2802[_0x286b04(0x1fc)](_0x286b04(0x1f9)+(_0x29d1ac[_0x286b04(0x22e)]+_0x522885['length'])+_0x286b04(0x1f7)+_0x585ae8['targetDir'])),saveSessionContext({'parent_segment':_0x585ae8[_0x286b04(0x20f)]},_0xd65c4c[_0x286b04(0x23d)]),console[_0x286b04(0x208)](a40_0x5a2802['green'](_0x286b04(0x217)+a40_0x5a2802[_0x286b04(0x225)](_0x286b04(0x204))+_0x286b04(0x218)+a40_0x5a2802[_0x286b04(0x22d)](_0x585ae8[_0x286b04(0x20f)]))),0x0;}}
@@ -1 +1 @@
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
+ const a41_0xbfb39f=a41_0x5f1a;(function(_0x2a7efb,_0xcb6e72){const _0x2b2b17=a41_0x5f1a,_0x2cfcac=_0x2a7efb();while(!![]){try{const _0x21d991=parseInt(_0x2b2b17(0x28d))/0x1+parseInt(_0x2b2b17(0x246))/0x2*(-parseInt(_0x2b2b17(0x241))/0x3)+-parseInt(_0x2b2b17(0x1fe))/0x4*(parseInt(_0x2b2b17(0x21c))/0x5)+-parseInt(_0x2b2b17(0x289))/0x6+-parseInt(_0x2b2b17(0x27f))/0x7*(-parseInt(_0x2b2b17(0x248))/0x8)+parseInt(_0x2b2b17(0x208))/0x9*(parseInt(_0x2b2b17(0x285))/0xa)+-parseInt(_0x2b2b17(0x268))/0xb*(-parseInt(_0x2b2b17(0x259))/0xc);if(_0x21d991===_0xcb6e72)break;else _0x2cfcac['push'](_0x2cfcac['shift']());}catch(_0xd18b13){_0x2cfcac['push'](_0x2cfcac['shift']());}}}(a41_0x34db,0xccd0c));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_0x25444a from'chalk';import{existsSync}from'fs';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{resolveTarget,isSuccessfulResolution,getScopedDetails}from'../sdk/segment/target-resolution.js';import{buildFolderMaps}from'../sdk/segment/resolution-context.js';function a41_0x5f1a(_0xeedf96,_0x162072){_0xeedf96=_0xeedf96-0x1ef;const _0x34db41=a41_0x34db();let _0x5f1a5f=_0x34db41[_0xeedf96];return _0x5f1a5f;}import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{resolveTDFolderPath,findSegmentsToDelete,findJourneysToDelete,buildSegmentLookupMap,buildSegmentNameToIdMap,buildJourneyBundleLookupMap,parseAndClassifyYamlFiles,validateParsedFiles,formatValidationErrors,extractRootFolderId,buildConnectionMaps,calculatePushStats,prepareSegmentFiles,prepareJourneyFiles,executePushSegments,executePushFolders,executePushSegmentDeletions,executePushJourneys}from'../sdk/segment/push-workflow.js';function a41_0x34db(){const _0x1916b1=['red','\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20','New\x20journey:','\x20\x20📊\x20Segments:','\x20YAML\x20files\x20found','error','name','push','96nfJgdN','parent_name','Resolving\x20parent\x20segment\x20\x27','buildUserMaps','nameToId','createdSegmentIds','relationships','\x20changed','\x20\x20\x20\x20','\x20\x20Segments:\x20','folderPath','state','activations','segment\x20or\x20journey','targetDir','2327149ADyjBP','user','created','listJourneysWithDetailsFromParentSegment','parentFolder','toString','folderId','createdAt','folders','yamlConfig','list','results','Preparing\x20journeys...','journeyId','\x20\x20Journeys:\x20','cyan','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','versionNumber','\x20changes?','message','Changes\x20to:','Delete\x20journey:','toCreate','4959619wOOUFY','journeyBundleId','verbose','changed','\x20\x20Source:\x20','/e/','90pYoGHW','deleted','\x0aError:','filePath','7956996MDUWUd','\x0aValidation\x20failed:','existingSegment','/sb/da/esr','257355tExZsE','data','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','map','toUpdate','\x20folders\x20to\x20create','get','parentName','paused','.yml','Parent\x20segment:\x20','toDelete','No\x20','endsWith','\x20updated','filter','dryRun','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file','287748yRWtKo','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','\x0a✔\x20Push\x20complete','segment:push','then','no_parent','updatedAt','add','green','description','984078ilhYYq','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','site','isNew','new','setPhase','Scoped\x20to\x20folder:\x20','attributes','connection','Fetching\x20connections\x20for\x20name\x20resolution...','Folders\x20to\x20create:','\x20to\x20create','\x20\x20🗺️\x20\x20Journeys:','\x20deleted','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','/j/da/je','New\x20segment:','execute','📁\x20','file','55Whshrr','join','\x20unchanged','(Journey\x20will\x20be\x20deleted)','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','listSegments','✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','unchanged','yellow','\x20\x20Activations:\x20','getJourney','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','delete','journeys','\x20to\x20delete','dim','length','/app/ps/','journeysOnly','existingJourney','\x20activations]','listFolders','getParent','type','errorCode','all','Aborted.','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','diff','Delete\x20segment:','updated','segments','set','\x20new','\x20\x20Activations:','segmentFolderId','nameToType','15OBNEFO','\x20created','Source\x20directory:\x20','repeat','blue','274410tAZhdC','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','8QHuvyX','journey','Changes\x20to\x20journey:','\x27...','\x0aPush\x20summary\x20for\x20\x27','idToName','segment','journeyBundleName','✔\x20All\x20journeys\x20are\x20up\x20to\x20date'];a41_0x34db=function(){return _0x1916b1;};return a41_0x34db();}export class SegmentPushCommand extends BaseCommand{[a41_0xbfb39f(0x257)]=a41_0xbfb39f(0x201);[a41_0xbfb39f(0x207)]='Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments';async[a41_0xbfb39f(0x219)](_0x28e5d8){const _0x3c1579=a41_0xbfb39f,{options:_0x4f19dd,args:_0x45bb1d,tdx:_0x146132}=_0x28e5d8,_0x13944b=_0x4f19dd,_0xd6d004=await resolveTarget({'arg':_0x45bb1d[0x0],'contextParent':_0x4f19dd['parentSegment'],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0xd6d004))return _0xd6d004[_0x3c1579(0x234)]===_0x3c1579(0x203)?(console[_0x3c1579(0x256)](a41_0x25444a[_0x3c1579(0x224)]('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console[_0x3c1579(0x256)]('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[_0x3c1579(0x256)](_0x3c1579(0x227)),console[_0x3c1579(0x256)](_0x3c1579(0x1fd))):(console['error'](a41_0x25444a[_0x3c1579(0x251)]('Error:\x20'+_0xd6d004[_0x3c1579(0x27b)]+'\x0a')),_0xd6d004['helpText']&&console[_0x3c1579(0x256)](a41_0x25444a[_0x3c1579(0x277)](_0xd6d004['helpText']))),0x1;if(_0xd6d004[_0x3c1579(0x233)]===_0x3c1579(0x25a))return console[_0x3c1579(0x256)](a41_0x25444a[_0x3c1579(0x251)]('Error:\x20Directory\x20not\x20found:\x20'+_0xd6d004[_0x3c1579(0x267)]+'\x0a')),console['error'](a41_0x25444a[_0x3c1579(0x277)](_0x3c1579(0x28f))),0x1;const _0x4506f1=_0xd6d004[_0x3c1579(0x1f3)],_0x7e8f60=_0xd6d004[_0x3c1579(0x267)],_0x1c5623=_0xd6d004['type']===_0x3c1579(0x21b)?_0xd6d004[_0x3c1579(0x288)]:undefined,_0x1bd13d=getScopedDetails(_0xd6d004),_0x209e84=_0x1bd13d?.['isScoped']??![],_0x1242eb=_0x1bd13d?.['scopedFolderPath']??'';if(!existsSync(_0x7e8f60))return console[_0x3c1579(0x256)](a41_0x25444a[_0x3c1579(0x251)]('Error:\x20Directory\x20not\x20found:\x20'+_0x7e8f60+'\x0a')),console[_0x3c1579(0x256)](a41_0x25444a[_0x3c1579(0x277)]('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;_0x13944b[_0x3c1579(0x281)]&&(console[_0x3c1579(0x256)]('Site:\x20'+_0x13944b['site']),console[_0x3c1579(0x256)](_0x3c1579(0x1f6)+_0x4506f1),console['error'](_0x3c1579(0x243)+_0x7e8f60),_0x209e84&&console['error'](_0x3c1579(0x20e)+_0x1242eb));const _0x5292d7=await withSpinner(_0x3c1579(0x25b)+_0x4506f1+_0x3c1579(0x24b),()=>_0x146132['segment']['resolveParentId'](_0x4506f1),{'verbose':_0x13944b['verbose']}),_0x41990a=_0x5292d7['data'],{parentSegmentResult:_0x48470a,segmentsResult:_0x21b1fe,foldersResult:_0x1a6f3a,journeysWithDetailsResult:_0x37d6ba,userMaps:_0x2c62ac}=await withSpinner('Fetching\x20existing\x20data...',async()=>{const _0x35d735=_0x3c1579,[_0x11c16a,_0x3c2e0b,_0x43c0d2,_0x249db5,_0x5453c6]=await Promise[_0x35d735(0x235)]([_0x146132[_0x35d735(0x24e)][_0x35d735(0x232)](_0x41990a),_0x146132[_0x35d735(0x24e)][_0x35d735(0x221)](_0x41990a),_0x146132[_0x35d735(0x24e)][_0x35d735(0x231)](_0x41990a),_0x146132[_0x35d735(0x249)][_0x35d735(0x26b)](_0x41990a,{'includeAllVersions':!![]}),_0x146132['user'][_0x35d735(0x25c)]()]);return{'parentSegmentResult':_0x11c16a,'segmentsResult':_0x3c2e0b,'foldersResult':_0x43c0d2,'journeysWithDetailsResult':_0x249db5,'userMaps':_0x5453c6};},{'verbose':_0x13944b['verbose']})[_0x3c1579(0x202)](_0x5d44b1=>_0x5d44b1[_0x3c1579(0x28e)]),_0x354137=_0x48470a,_0x3ddc61=extractRootFolderId(_0x354137),_0x36dce2=_0x21b1fe,_0x1bd7af=_0x1a6f3a,{journeys:_0x4277f4,activationStepsById:_0x15c8ae}=_0x37d6ba,_0x18258a=new Map(_0x4277f4[_0x3c1579(0x1ef)](_0x9a7493=>[_0x9a7493['id'],_0x9a7493])),_0x1434c5=_0x4277f4['map'](_0x291d2d=>({'id':_0x291d2d['id'],'name':_0x291d2d[_0x3c1579(0x20f)]['name'],'journeyBundleName':_0x291d2d[_0x3c1579(0x20f)][_0x3c1579(0x24f)]||'','journeyBundleId':_0x291d2d[_0x3c1579(0x20f)][_0x3c1579(0x280)]||'','versionNumber':_0x291d2d[_0x3c1579(0x20f)][_0x3c1579(0x279)],'description':_0x291d2d[_0x3c1579(0x20f)][_0x3c1579(0x207)],'state':_0x291d2d[_0x3c1579(0x20f)][_0x3c1579(0x264)],'paused':_0x291d2d[_0x3c1579(0x20f)][_0x3c1579(0x1f4)],'audienceId':_0x291d2d[_0x3c1579(0x20f)]['audienceId'],'folderId':_0x291d2d[_0x3c1579(0x25f)]?.[_0x3c1579(0x26c)]?.['data']?.['id'],'createdAt':_0x291d2d['attributes'][_0x3c1579(0x26f)],'updatedAt':_0x291d2d[_0x3c1579(0x20f)][_0x3c1579(0x204)]})),{emailToId:_0x4e0850,idToEmail:_0x513eae}=_0x2c62ac,_0x4a29b0=await withSpinner(_0x3c1579(0x211),async()=>{const _0x30d396=_0x3c1579,_0x45da79=await _0x146132['connection'][_0x30d396(0x272)]();return buildConnectionMaps(_0x45da79);},{'verbose':_0x13944b[_0x3c1579(0x281)]})[_0x3c1579(0x202)](_0x5acf1f=>_0x5acf1f[_0x3c1579(0x28e)]),_0x85212f=_0x4a29b0['nameToId'],_0x3bb562=_0x4a29b0[_0x3c1579(0x24d)],_0x475d6a=_0x4a29b0[_0x3c1579(0x240)],_0x2fb0c5={'emailToIdMap':_0x4e0850,'connectionNameToIdMap':_0x85212f,'connectionNameToTypeMap':_0x475d6a,'getSchema':_0x515e3e=>_0x146132[_0x3c1579(0x210)]['getOutputSchemaWithCache'](_0x515e3e)};let {pathToId:_0x2671c3,idToPath:_0x1af09c}=buildFolderMaps(_0x1bd7af);const _0x35c145=buildSegmentLookupMap(_0x36dce2,_0x1af09c),_0x551ed5=buildSegmentNameToIdMap(_0x36dce2),_0x3cf54d=buildJourneyBundleLookupMap(_0x1434c5,_0x1af09c);let _0x32757c;if(_0x1c5623){if(!_0x1c5623[_0x3c1579(0x1f9)](_0x3c1579(0x1f5))&&!_0x1c5623[_0x3c1579(0x1f9)]('.yaml'))return console[_0x3c1579(0x256)](a41_0x25444a[_0x3c1579(0x251)](_0x3c1579(0x209)+_0x1c5623+'\x0a')),0x1;_0x32757c=[_0x1c5623];}else _0x32757c=findYamlFiles(_0x7e8f60);if(_0x32757c[_0x3c1579(0x22c)]===0x0)return console[_0x3c1579(0x256)](a41_0x25444a[_0x3c1579(0x251)](_0x3c1579(0x278)+_0x7e8f60+'\x0a')),console['error'](a41_0x25444a['cyan'](_0x3c1579(0x237))),0x1;let _0x384973,_0x30adcc;try{const _0x87f6d9=parseAndClassifyYamlFiles(_0x32757c,_0x7e8f60,{'skipSegments':_0x13944b[_0x3c1579(0x22e)]});_0x384973=_0x87f6d9['segments'],_0x30adcc=_0x87f6d9['journeys'];const _0x5867b9=validateParsedFiles(_0x87f6d9,_0x7e8f60);if(_0x5867b9[_0x3c1579(0x22c)]>0x0)return console[_0x3c1579(0x256)](a41_0x25444a[_0x3c1579(0x251)](_0x3c1579(0x28a))),console[_0x3c1579(0x256)](formatValidationErrors(_0x5867b9)),console[_0x3c1579(0x256)](a41_0x25444a[_0x3c1579(0x224)]('\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.')),0x1;}catch(_0x5f82ba){return console[_0x3c1579(0x256)](a41_0x25444a['red']('Error\x20parsing\x20YAML:\x20'+(_0x5f82ba instanceof Error?_0x5f82ba['message']:_0x5f82ba))),0x1;}if(_0x384973[_0x3c1579(0x22c)]===0x0&&_0x30adcc[_0x3c1579(0x22c)]===0x0){const _0x12a1f2=_0x13944b['journeysOnly']?_0x3c1579(0x249):_0x3c1579(0x266);return console['error'](a41_0x25444a[_0x3c1579(0x224)](_0x3c1579(0x1f8)+_0x12a1f2+_0x3c1579(0x255))),0x0;}const _0x23273a=new Map();_0x36dce2[_0x3c1579(0x22c)]>0x0&&!_0x13944b[_0x3c1579(0x22e)]&&await withSpinner('Fetching\x20existing\x20activations...',async()=>{await batchAsync(_0x36dce2,async _0x4d2165=>{const _0x56bd32=a41_0x5f1a,_0x3f2278=await _0x146132[_0x56bd32(0x24e)]['listActivations'](_0x41990a,_0x4d2165['id']);_0x23273a['set'](_0x4d2165['id'],_0x3f2278);});},{'verbose':_0x13944b[_0x3c1579(0x281)]});const {segmentFiles:_0x2f5798,foldersToCreate:_0x2d73e0}=await prepareSegmentFiles(_0x384973,{'segmentByFolderAndName':_0x35c145,'activationsBySegmentId':_0x23273a,'folderPathToId':_0x2671c3,'idToEmailMap':_0x513eae,'connectionIdToNameMap':_0x3bb562},_0x2fb0c5,_0x209e84,_0x1242eb),_0x10e982=_0x1c5623?[]:findSegmentsToDelete(_0x36dce2,_0x384973[_0x3c1579(0x1ef)](({yamlConfig:_0x34d39a,folderPath:_0x1a8526})=>({'yamlConfig':_0x34d39a,'folderPath':resolveTDFolderPath(_0x1a8526,_0x209e84,_0x1242eb)})),_0x1af09c,_0x1242eb,_0x209e84),{journeyFiles:_0x247893,foldersToCreate:_0x58c79e}=await withProgressSpinner(_0x3c1579(0x274),async _0x5dabe1=>prepareJourneyFiles(_0x30adcc,{'fetchJourney':async _0x3ab3a5=>_0x146132[_0x3c1579(0x249)][_0x3c1579(0x226)](_0x3ab3a5[_0x3c1579(0x275)]),'journeyBundlesByFolderAndName':_0x3cf54d,'folderPathToId':_0x2671c3,'idToEmailMap':_0x513eae,'connectionIdToNameMap':_0x3bb562,'existingSegments':_0x36dce2,'parentId':_0x41990a,'deps':_0x146132,'progress':{'update':_0x10c65b=>{const _0x35fd00=_0x3c1579;_0x5dabe1[_0x35fd00(0x20d)](_0x10c65b),_0x13944b[_0x35fd00(0x281)]&&console[_0x35fd00(0x256)]('\x20\x20'+_0x10c65b);}},'journeyById':_0x18258a,'activationStepsById':_0x15c8ae},_0x209e84,_0x1242eb),{'verbose':_0x13944b[_0x3c1579(0x281)]})[_0x3c1579(0x202)](_0x3520a9=>_0x3520a9[_0x3c1579(0x28e)]);for(const _0x5cb9a3 of _0x58c79e){_0x2d73e0[_0x3c1579(0x205)](_0x5cb9a3);}const _0x5e98bc=_0x1c5623?[]:findJourneysToDelete(_0x1434c5,_0x30adcc[_0x3c1579(0x1ef)](({yamlConfig:_0x2e5091,folderPath:_0x6a1b42})=>({'yamlConfig':_0x2e5091,'folderPath':resolveTDFolderPath(_0x6a1b42,_0x209e84,_0x1242eb)})),_0x1af09c,_0x1242eb,_0x209e84),_0x5d7dc4=calculatePushStats(_0x2f5798,_0x247893,_0x2d73e0,_0x10e982,_0x5e98bc,!!_0x13944b[_0x3c1579(0x228)],!!_0x13944b[_0x3c1579(0x22e)]),_0x53f150=_0x5d7dc4[_0x3c1579(0x23b)][_0x3c1579(0x20c)],_0x424343=_0x5d7dc4[_0x3c1579(0x23b)][_0x3c1579(0x282)],_0x158215=_0x5d7dc4[_0x3c1579(0x23b)]['unchanged'],_0x21e577=_0x5d7dc4['segments']['toDelete'],_0x5576b2=_0x5d7dc4[_0x3c1579(0x270)][_0x3c1579(0x27e)],_0x23096a=_0x5d7dc4[_0x3c1579(0x229)][_0x3c1579(0x20c)],_0x1241e2=_0x5d7dc4['journeys']['changed'],_0x267aff=_0x5d7dc4[_0x3c1579(0x229)][_0x3c1579(0x223)],_0x22bca9=_0x5d7dc4[_0x3c1579(0x229)][_0x3c1579(0x1f7)],_0x7f77c9=_0x5d7dc4[_0x3c1579(0x265)][_0x3c1579(0x235)],_0x2ece6e=_0x5d7dc4[_0x3c1579(0x265)][_0x3c1579(0x27e)],_0x2166a0=_0x5d7dc4[_0x3c1579(0x265)][_0x3c1579(0x1f0)],_0x3537dd=_0x5d7dc4[_0x3c1579(0x265)][_0x3c1579(0x1f7)];console['error'](_0x3c1579(0x24c)+_0x4506f1+'\x27:');_0x5576b2[_0x3c1579(0x22c)]>0x0&&console['error']('\x20\x20'+a41_0x25444a['blue'](_0x3c1579(0x21a)+_0x5576b2[_0x3c1579(0x22c)]+_0x3c1579(0x1f1)));if(!_0x13944b['journeysOnly']){console['error'](_0x3c1579(0x254)),console['error']('\x20\x20\x20\x20'+a41_0x25444a[_0x3c1579(0x206)]('+\x20'+_0x53f150[_0x3c1579(0x22c)]+_0x3c1579(0x23d))),console[_0x3c1579(0x256)](_0x3c1579(0x261)+a41_0x25444a['yellow']('~\x20'+_0x424343[_0x3c1579(0x22c)]+_0x3c1579(0x260)));if(_0x21e577[_0x3c1579(0x22c)]>0x0)console[_0x3c1579(0x256)]('\x20\x20\x20\x20'+a41_0x25444a[_0x3c1579(0x251)]('-\x20'+_0x21e577[_0x3c1579(0x22c)]+'\x20to\x20delete'));else _0x10e982[_0x3c1579(0x22c)]>0x0&&!_0x13944b[_0x3c1579(0x228)]&&console[_0x3c1579(0x256)](_0x3c1579(0x261)+a41_0x25444a['dim'](_0x10e982[_0x3c1579(0x22c)]+'\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)'));console[_0x3c1579(0x256)](_0x3c1579(0x261)+a41_0x25444a[_0x3c1579(0x22b)]('=\x20'+_0x158215[_0x3c1579(0x22c)]+_0x3c1579(0x21e)));}if(_0x247893[_0x3c1579(0x22c)]>0x0||_0x5e98bc['length']>0x0){console[_0x3c1579(0x256)](_0x3c1579(0x214)),console[_0x3c1579(0x256)](_0x3c1579(0x261)+a41_0x25444a['green']('+\x20'+_0x23096a[_0x3c1579(0x22c)]+'\x20new')),console['error'](_0x3c1579(0x261)+a41_0x25444a['yellow']('~\x20'+_0x1241e2['length']+'\x20changed'));if(_0x22bca9[_0x3c1579(0x22c)]>0x0)console[_0x3c1579(0x256)](_0x3c1579(0x261)+a41_0x25444a[_0x3c1579(0x251)]('-\x20'+_0x22bca9[_0x3c1579(0x22c)]+_0x3c1579(0x22a)));else _0x5e98bc['length']>0x0&&!_0x13944b[_0x3c1579(0x228)]&&console[_0x3c1579(0x256)]('\x20\x20\x20\x20'+a41_0x25444a[_0x3c1579(0x22b)](_0x5e98bc[_0x3c1579(0x22c)]+'\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)'));console['error'](_0x3c1579(0x261)+a41_0x25444a[_0x3c1579(0x22b)]('=\x20'+_0x267aff[_0x3c1579(0x22c)]+'\x20unchanged'));}_0x7f77c9[_0x3c1579(0x22c)]>0x0&&!_0x13944b[_0x3c1579(0x22e)]&&(console[_0x3c1579(0x256)](''),console[_0x3c1579(0x256)](_0x3c1579(0x23e)),_0x2ece6e[_0x3c1579(0x22c)]>0x0&&console[_0x3c1579(0x256)](_0x3c1579(0x261)+a41_0x25444a[_0x3c1579(0x206)]('+\x20'+_0x2ece6e[_0x3c1579(0x22c)]+_0x3c1579(0x213))),_0x2166a0['length']>0x0&&console[_0x3c1579(0x256)](_0x3c1579(0x261)+a41_0x25444a['yellow']('~\x20'+_0x2166a0['length']+'\x20to\x20update')),_0x3537dd[_0x3c1579(0x22c)]>0x0&&console[_0x3c1579(0x256)](_0x3c1579(0x261)+a41_0x25444a[_0x3c1579(0x251)]('-\x20'+_0x3537dd[_0x3c1579(0x22c)]+_0x3c1579(0x22a))));console[_0x3c1579(0x256)](_0x3c1579(0x283)+a41_0x25444a['cyan'](_0x7e8f60)+'\x0a');if(_0x5576b2[_0x3c1579(0x22c)]>0x0){console[_0x3c1579(0x256)](_0x3c1579(0x212));for(const _0x399974 of _0x5576b2){console['error']('\x20\x20'+a41_0x25444a[_0x3c1579(0x245)]('+')+'\x20'+_0x399974);}console['error']('');}if(_0x53f150[_0x3c1579(0x22c)]>0x0&&!_0x13944b[_0x3c1579(0x22e)])for(const _0x1943c5 of _0x53f150){const _0x10c21f=_0x1943c5[_0x3c1579(0x263)]?_0x1943c5[_0x3c1579(0x263)]+'/'+_0x1943c5[_0x3c1579(0x271)][_0x3c1579(0x257)]:_0x1943c5[_0x3c1579(0x271)][_0x3c1579(0x257)],_0x6837a5=_0x1943c5[_0x3c1579(0x271)][_0x3c1579(0x265)]?.[_0x3c1579(0x22c)]||0x0,_0x330653=_0x6837a5>0x0?a41_0x25444a[_0x3c1579(0x22b)]('\x20['+_0x6837a5+_0x3c1579(0x230)):'';console[_0x3c1579(0x256)]('\x0a'+a41_0x25444a[_0x3c1579(0x206)](_0x3c1579(0x218))+'\x20'+_0x10c21f+_0x330653),console[_0x3c1579(0x256)]('─'[_0x3c1579(0x244)](0x3c)),_0x1943c5['diff']&&console[_0x3c1579(0x256)](_0x1943c5[_0x3c1579(0x238)]),console[_0x3c1579(0x256)]('─'['repeat'](0x3c));}if(_0x21e577[_0x3c1579(0x22c)]>0x0&&!_0x13944b[_0x3c1579(0x22e)])for(const _0x3cc312 of _0x21e577){const _0x1546e2=_0x3cc312[_0x3c1579(0x23f)]?_0x1af09c[_0x3c1579(0x1f2)](_0x3cc312[_0x3c1579(0x23f)][_0x3c1579(0x26d)]())||'':'',_0xc37551=_0x1546e2?_0x1546e2+'/'+_0x3cc312[_0x3c1579(0x257)]:_0x3cc312[_0x3c1579(0x257)],_0x9b5088=_0x23273a[_0x3c1579(0x1f2)](_0x3cc312['id'])||[],_0x4b6555=_0x9b5088['length']>0x0?a41_0x25444a['dim']('\x20['+_0x9b5088[_0x3c1579(0x22c)]+_0x3c1579(0x230)):'';console[_0x3c1579(0x256)]('\x0a'+a41_0x25444a[_0x3c1579(0x251)](_0x3c1579(0x239))+'\x20'+_0xc37551+_0x4b6555),console['error']('─'['repeat'](0x3c));const _0x20d7dd=segmentWithActivationsToYaml(_0x3cc312,_0x9b5088,undefined,_0x513eae,_0x3bb562),_0x3dbdc0=segmentToYamlString(_0x20d7dd),_0x20c8ce=generateDiff(_0x3dbdc0,'');console['error'](formatDiffWithColors(_0x20c8ce)),console[_0x3c1579(0x256)]('─'[_0x3c1579(0x244)](0x3c));}const _0x5da5a2=_0x2f5798[_0x3c1579(0x1fb)](_0x59bf81=>!_0x59bf81[_0x3c1579(0x20b)]&&_0x59bf81[_0x3c1579(0x238)]);if(_0x5da5a2['length']>0x0&&!_0x13944b[_0x3c1579(0x22e)])for(const _0x5a44ab of _0x5da5a2){const _0x2928f1=_0x5a44ab['folderPath']?_0x5a44ab[_0x3c1579(0x263)]+'/'+_0x5a44ab[_0x3c1579(0x271)][_0x3c1579(0x257)]:_0x5a44ab['yamlConfig'][_0x3c1579(0x257)];console['error']('\x0a'+a41_0x25444a[_0x3c1579(0x224)](_0x3c1579(0x27c))+'\x20'+_0x2928f1),console[_0x3c1579(0x256)]('─'[_0x3c1579(0x244)](0x3c)),console[_0x3c1579(0x256)](_0x5a44ab['diff']),console[_0x3c1579(0x256)]('─'[_0x3c1579(0x244)](0x3c));}if(_0x23096a[_0x3c1579(0x22c)]>0x0)for(const _0x2f42f1 of _0x23096a){const _0x4077ec=_0x2f42f1[_0x3c1579(0x263)]?_0x2f42f1[_0x3c1579(0x263)]+'/'+_0x2f42f1[_0x3c1579(0x271)][_0x3c1579(0x257)]:_0x2f42f1['yamlConfig'][_0x3c1579(0x257)];console[_0x3c1579(0x256)]('\x0a'+a41_0x25444a['green'](_0x3c1579(0x253))+'\x20'+_0x4077ec),console['error']('─'[_0x3c1579(0x244)](0x3c)),_0x2f42f1[_0x3c1579(0x238)]&&console[_0x3c1579(0x256)](_0x2f42f1[_0x3c1579(0x238)]),console[_0x3c1579(0x256)]('─'[_0x3c1579(0x244)](0x3c));}const _0x3c96ea=_0x247893[_0x3c1579(0x1fb)](_0x3fedec=>!_0x3fedec[_0x3c1579(0x20b)]&&_0x3fedec[_0x3c1579(0x238)]);if(_0x3c96ea[_0x3c1579(0x22c)]>0x0)for(const _0x599b14 of _0x3c96ea){const _0x1fb293=_0x599b14[_0x3c1579(0x263)]?_0x599b14[_0x3c1579(0x263)]+'/'+_0x599b14[_0x3c1579(0x271)][_0x3c1579(0x257)]:_0x599b14['yamlConfig'][_0x3c1579(0x257)];console['error']('\x0a'+a41_0x25444a[_0x3c1579(0x224)](_0x3c1579(0x24a))+'\x20'+_0x1fb293),console['error']('─'[_0x3c1579(0x244)](0x3c)),console[_0x3c1579(0x256)](_0x599b14['diff']),console[_0x3c1579(0x256)]('─'[_0x3c1579(0x244)](0x3c));}if(_0x22bca9[_0x3c1579(0x22c)]>0x0)for(const _0x1ae800 of _0x22bca9){const _0x336481=_0x1ae800[_0x3c1579(0x26e)]?_0x1af09c[_0x3c1579(0x1f2)](_0x1ae800['folderId'])||'':'',_0x437e68=_0x336481?_0x336481+'/'+_0x1ae800[_0x3c1579(0x24f)]:_0x1ae800['journeyBundleName'];console[_0x3c1579(0x256)]('\x0a'+a41_0x25444a[_0x3c1579(0x251)](_0x3c1579(0x27d))+'\x20'+_0x437e68),console['error']('─'[_0x3c1579(0x244)](0x3c)),console[_0x3c1579(0x256)](a41_0x25444a[_0x3c1579(0x251)](_0x3c1579(0x21f))),console['error']('─'[_0x3c1579(0x244)](0x3c));}if(_0x13944b[_0x3c1579(0x1fc)])return console[_0x3c1579(0x256)](a41_0x25444a[_0x3c1579(0x224)](_0x3c1579(0x216))),0x0;const _0xc4574f=_0x13944b[_0x3c1579(0x22e)]?![]:_0x53f150[_0x3c1579(0x22c)]>0x0||_0x424343[_0x3c1579(0x22c)]>0x0||_0x21e577[_0x3c1579(0x22c)]>0x0,_0x4009b3=_0x23096a['length']>0x0||_0x1241e2[_0x3c1579(0x22c)]>0x0||_0x22bca9[_0x3c1579(0x22c)]>0x0,_0x3fd9cb=_0x13944b[_0x3c1579(0x22e)]?![]:_0x7f77c9['length']>0x0,_0x216c1a=_0x5576b2[_0x3c1579(0x22c)]>0x0;if(!_0xc4574f&&!_0x4009b3&&!_0x3fd9cb&&!_0x216c1a){const _0xd7048f=_0x13944b[_0x3c1579(0x22e)]?_0x3c1579(0x250):_0x3c1579(0x222);console['error'](a41_0x25444a[_0x3c1579(0x206)](_0xd7048f));if(_0x1c5623&&_0x158215[_0x3c1579(0x22c)]===0x1){const _0x4fd206=_0x158215[0x0];if(_0x4fd206[_0x3c1579(0x28b)]?.['id']){const _0x3fb930=getConsoleNextUrl(_0x13944b[_0x3c1579(0x20a)],_0x3c1579(0x22d)+_0x41990a+_0x3c1579(0x284)+_0x4fd206[_0x3c1579(0x28b)]['id']+'/sb/da/esr');console[_0x3c1579(0x256)](_0x3c1579(0x252)+a41_0x25444a[_0x3c1579(0x277)](_0x3fb930));}}if(_0x1c5623&&_0x267aff['length']===0x1){const _0x13a092=_0x267aff[0x0];if(_0x13a092[_0x3c1579(0x22f)]?.['id']){const _0x4bb712=getConsoleNextUrl(_0x13944b[_0x3c1579(0x20a)],_0x3c1579(0x22d)+_0x41990a+_0x3c1579(0x284)+_0x13a092[_0x3c1579(0x22f)]['id']+'/j/da/je');console[_0x3c1579(0x256)]('\x20\x20'+a41_0x25444a[_0x3c1579(0x277)](_0x4bb712));}}return 0x0;}const _0x5d3bfe=_0x13944b[_0x3c1579(0x22e)]?_0x23096a[_0x3c1579(0x22c)]+_0x1241e2[_0x3c1579(0x22c)]+_0x22bca9[_0x3c1579(0x22c)]+_0x5576b2['length']:_0x53f150['length']+_0x424343[_0x3c1579(0x22c)]+_0x21e577[_0x3c1579(0x22c)]+_0x23096a[_0x3c1579(0x22c)]+_0x1241e2[_0x3c1579(0x22c)]+_0x22bca9[_0x3c1579(0x22c)]+_0x5576b2[_0x3c1579(0x22c)]+_0x7f77c9[_0x3c1579(0x22c)];if(!_0x13944b['yes']&&_0x5d3bfe>0x0){if(!isInteractive())return console[_0x3c1579(0x256)](a41_0x25444a[_0x3c1579(0x251)](_0x3c1579(0x287)),_0x3c1579(0x1ff)),console[_0x3c1579(0x256)](a41_0x25444a[_0x3c1579(0x22b)](_0x3c1579(0x220))),0x1;const _0x3a6724=await confirmKey('Push\x20'+_0x5d3bfe+_0x3c1579(0x27a));if(!_0x3a6724)return console['error'](a41_0x25444a['yellow'](_0x3c1579(0x236))),0x1;}const _0x4f6b64={'withProgress':async(_0x8c3678,_0x2025e1)=>{const _0x2352ac=_0x3c1579,_0x195707=await withSpinner(_0x8c3678,_0x2025e1,{'verbose':_0x13944b[_0x2352ac(0x281)]});return{'data':_0x195707[_0x2352ac(0x28e)]};},'logInfo':_0x481d91=>console['error'](a41_0x25444a[_0x3c1579(0x245)]('✔\x20'+_0x481d91)),'logSuccess':_0xf57d3f=>console[_0x3c1579(0x256)](a41_0x25444a[_0x3c1579(0x206)]('✔\x20'+_0xf57d3f)),'logWarning':_0x525f97=>console[_0x3c1579(0x256)](a41_0x25444a[_0x3c1579(0x224)]('⚠\x20'+_0x525f97)),'logDeleted':_0x19f547=>console['error'](a41_0x25444a[_0x3c1579(0x251)]('✔\x20'+_0x19f547))},_0x514791={'segment':_0x146132[_0x3c1579(0x24e)],'journey':_0x146132[_0x3c1579(0x249)],'user':_0x146132[_0x3c1579(0x269)],'connection':_0x146132[_0x3c1579(0x210)]};_0x5576b2[_0x3c1579(0x22c)]>0x0&&(_0x2671c3=await executePushFolders(_0x514791,_0x5576b2,_0x2671c3,{'parentId':_0x41990a},_0x4f6b64));const _0x29ad08={'rootFolderId':_0x3ddc61,'folderPathToId':_0x2671c3,'folderIdToPath':_0x1af09c,'segmentNameToId':_0x551ed5,'activationsBySegmentId':_0x23273a,'emailToIdMap':_0x4e0850,'idToEmailMap':_0x513eae,'connectionNameToIdMap':_0x4a29b0[_0x3c1579(0x25d)],'connectionIdToNameMap':_0x4a29b0[_0x3c1579(0x24d)],'connectionNameToTypeMap':_0x475d6a},_0x17fd3f=await executePushSegments(_0x514791,_0x13944b[_0x3c1579(0x22e)]?[]:_0x2f5798,_0x29ad08,{'parentId':_0x41990a},_0x4f6b64),_0x534099=_0x17fd3f['created'],_0x46e8b2=_0x17fd3f[_0x3c1579(0x23a)],_0x5057f5=_0x17fd3f[_0x3c1579(0x265)][_0x3c1579(0x26a)],_0x1134af=_0x17fd3f[_0x3c1579(0x265)][_0x3c1579(0x23a)],_0x144d7e=_0x17fd3f[_0x3c1579(0x265)][_0x3c1579(0x286)];let _0x4eb7d9;if(_0x1c5623&&_0x2f5798[_0x3c1579(0x22c)]===0x1){const _0x45a49d=_0x2f5798[0x0];_0x4eb7d9=_0x45a49d['existingSegment']?.['id']??_0x17fd3f[_0x3c1579(0x25e)][_0x3c1579(0x1f2)](_0x45a49d['yamlConfig'][_0x3c1579(0x257)]);}const _0x32160f=await executePushSegmentDeletions(_0x514791,_0x13944b[_0x3c1579(0x22e)]?[]:_0x21e577,_0x4f6b64);let _0x26be9f=0x0,_0x1ae5bd=0x0,_0x577646=0x0;const _0x4a939b=new Map(_0x551ed5);for(const [_0xbf59ac,_0x1ff7eb]of _0x17fd3f['createdSegmentIds']){_0x4a939b[_0x3c1579(0x23c)](_0xbf59ac,_0x1ff7eb);}if(_0x247893['length']>0x0){const _0x1fd559={..._0x29ad08,'segmentNameToId':_0x4a939b,'existingSegments':_0x36dce2,'activationContext':_0x2fb0c5},_0x45018b=await executePushJourneys(_0x514791,_0x247893,_0x1fd559,{'parentId':_0x41990a,'rootFolderId':_0x3ddc61,'verbose':_0x13944b[_0x3c1579(0x281)]},_0x4f6b64);_0x26be9f=_0x45018b[_0x3c1579(0x26a)],_0x1ae5bd=_0x45018b[_0x3c1579(0x23a)];if(_0x1c5623&&_0x45018b[_0x3c1579(0x273)]['length']===0x1){const _0x2a2a92=_0x45018b[_0x3c1579(0x273)][0x0];if(_0x2a2a92['journeyId']){const _0x30cd44=getConsoleNextUrl(_0x13944b['site'],'/app/ps/'+_0x41990a+_0x3c1579(0x284)+_0x2a2a92[_0x3c1579(0x275)]+_0x3c1579(0x217));console[_0x3c1579(0x256)]('\x20\x20'+a41_0x25444a[_0x3c1579(0x277)](_0x30cd44));}}}for(const _0x1598e5 of _0x22bca9){console[_0x3c1579(0x256)](a41_0x25444a['yellow'](_0x3c1579(0x247)+_0x1598e5['journeyBundleName'])),_0x577646++;}const _0x169633=[];if(_0x534099>0x0)_0x169633[_0x3c1579(0x258)](_0x534099+'\x20created');if(_0x46e8b2>0x0)_0x169633['push'](_0x46e8b2+_0x3c1579(0x1fa));if(_0x32160f>0x0)_0x169633[_0x3c1579(0x258)](_0x32160f+_0x3c1579(0x215));const _0x54d8f1=[];if(_0x26be9f>0x0)_0x54d8f1[_0x3c1579(0x258)](_0x26be9f+'\x20created');if(_0x1ae5bd>0x0)_0x54d8f1[_0x3c1579(0x258)](_0x1ae5bd+'\x20updated');if(_0x577646>0x0)_0x54d8f1['push'](_0x577646+_0x3c1579(0x215));const _0xa43179=[];if(_0x5057f5>0x0)_0xa43179[_0x3c1579(0x258)](_0x5057f5+_0x3c1579(0x242));if(_0x1134af>0x0)_0xa43179['push'](_0x1134af+_0x3c1579(0x1fa));if(_0x144d7e>0x0)_0xa43179[_0x3c1579(0x258)](_0x144d7e+_0x3c1579(0x215));console[_0x3c1579(0x256)](a41_0x25444a[_0x3c1579(0x206)](_0x3c1579(0x200)));_0x169633['length']>0x0&&!_0x13944b[_0x3c1579(0x22e)]&&console['error'](_0x3c1579(0x262)+_0x169633['join'](',\x20'));_0x54d8f1['length']>0x0&&console[_0x3c1579(0x256)](_0x3c1579(0x276)+_0x54d8f1[_0x3c1579(0x21d)](',\x20'));_0xa43179['length']>0x0&&!_0x13944b[_0x3c1579(0x22e)]&&console[_0x3c1579(0x256)](_0x3c1579(0x225)+_0xa43179[_0x3c1579(0x21d)](',\x20'));if(_0x4eb7d9){const _0x46a80e=getConsoleNextUrl(_0x13944b[_0x3c1579(0x20a)],_0x3c1579(0x22d)+_0x41990a+_0x3c1579(0x284)+_0x4eb7d9+_0x3c1579(0x28c));console[_0x3c1579(0x256)](_0x3c1579(0x252)+a41_0x25444a[_0x3c1579(0x277)](_0x46a80e));}return 0x0;}}
@@ -1 +1 @@
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
+ const a42_0x1b421a=a42_0x5446;(function(_0x4d0448,_0x4f1b1d){const _0x29e384=a42_0x5446,_0x56b249=_0x4d0448();while(!![]){try{const _0x306692=parseInt(_0x29e384(0x1e9))/0x1+parseInt(_0x29e384(0x208))/0x2+parseInt(_0x29e384(0x20a))/0x3+parseInt(_0x29e384(0x1ef))/0x4+-parseInt(_0x29e384(0x1fb))/0x5*(-parseInt(_0x29e384(0x201))/0x6)+-parseInt(_0x29e384(0x1eb))/0x7+-parseInt(_0x29e384(0x1fc))/0x8;if(_0x306692===_0x4f1b1d)break;else _0x56b249['push'](_0x56b249['shift']());}catch(_0x1a5705){_0x56b249['push'](_0x56b249['shift']());}}}(a42_0x3159,0xe1188));function a42_0x5446(_0x41a0ae,_0x51dfab){_0x41a0ae=_0x41a0ae-0x1de;const _0x315956=a42_0x3159();let _0x54468f=_0x315956[_0x41a0ae];return _0x54468f;}import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';function a42_0x3159(){const _0x3a6bbb=['\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','5135504SAeWAK','data','execute','length','updateSegmentById','name','segmentId','segmentPath','Parent\x20ID:\x20','Resolved\x20type:\x20','Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]','Resolving\x20folder\x20\x27','396005IqiENr','33438816LkFpbT','Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]','Update\x20existing\x20child\x20segment','kind','parentId','96YwoUCT','\x27...','verbose','segment','Resolving\x20path\x20\x27','resolveFolderId','rule','3587510cMxOUb','yellow','1085865QUiThM','resolvePathToResource','\x20\x20\x20Path:\x20','Resolved\x20folder\x20ID:\x20','Examples:','Error:\x20Cannot\x20update\x20','✔\x20Updated\x20segment\x20\x27','error','Segment\x20ID:\x20','INTERNAL','folder','type','Updating\x20segment\x20\x27','segment:update','description','Segment\x20ID\x20missing\x20from\x20resolved\x20path','1363538jCESYF','Resolved\x20relative\x20path\x20to:\x20','6779472Wzhupg','\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','⚠\x20Deprecation\x20warning:\x20`segment\x20update`\x20is\x20deprecated.'];a42_0x3159=function(){return _0x3a6bbb;};return a42_0x3159();}import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{SDKError,ErrorCode}from'../sdk/index.js';import a42_0x20c7e4 from'chalk';export class SegmentUpdateCommand extends BaseCommand{[a42_0x1b421a(0x1f4)]=a42_0x1b421a(0x1e6);[a42_0x1b421a(0x1e7)]=a42_0x1b421a(0x1fe);async[a42_0x1b421a(0x1f1)](_0x2176a2){const _0xb24afd=a42_0x1b421a;console[_0xb24afd(0x1e0)](a42_0x20c7e4['yellow'](_0xb24afd(0x1ed))),console[_0xb24afd(0x1e0)](a42_0x20c7e4[_0xb24afd(0x209)](_0xb24afd(0x1ee)));const {options:_0x4dc042,args:_0x3eb17d,tdx:_0x1cf5be}=_0x2176a2,_0xb669c4=_0x4dc042;if(_0x3eb17d[_0xb24afd(0x1f2)]===0x0)return console['error']('Error:\x20Segment\x20path\x20or\x20name\x20is\x20required'),console[_0xb24afd(0x1e0)](_0xb24afd(0x1fd)),console['error'](_0xb24afd(0x20e)),console[_0xb24afd(0x1e0)]('\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22'),console['error'](_0xb24afd(0x1ec)),0x1;const _0x4c9f6b=_0x3eb17d[0x0],_0x2d29da=_0x4dc042[_0xb24afd(0x1f6)];let _0x20fac2=_0x4c9f6b;_0x2d29da&&!_0x4c9f6b['includes']('/')&&(_0x20fac2=_0x2d29da+'/'+_0x4c9f6b,_0xb669c4[_0xb24afd(0x203)]&&console[_0xb24afd(0x1e0)](_0xb24afd(0x1ea)+_0x20fac2));const _0x411ee8=await withSpinner(_0xb24afd(0x205)+_0x20fac2+'\x27...',()=>_0x1cf5be[_0xb24afd(0x204)][_0xb24afd(0x20b)](_0x20fac2),{'verbose':_0xb669c4[_0xb24afd(0x203)]}),_0x21c57d=_0x411ee8[_0xb24afd(0x1f0)];_0xb669c4[_0xb24afd(0x203)]&&console[_0xb24afd(0x1e0)](_0xb24afd(0x1f8)+_0x21c57d[_0xb24afd(0x1e4)]);if(_0x21c57d[_0xb24afd(0x1e4)]!==_0xb24afd(0x204))return console[_0xb24afd(0x1e0)](_0xb24afd(0x1de)+_0x21c57d['type']+'.\x20Only\x20child\x20segments\x20can\x20be\x20updated.'),console[_0xb24afd(0x1e0)](_0xb24afd(0x1f9)),0x1;if(!_0x21c57d['segmentId'])throw new SDKError(ErrorCode[_0xb24afd(0x1e2)],_0xb24afd(0x1e8));const _0xdb1230=_0x21c57d[_0xb24afd(0x200)],_0x22f91e=_0x21c57d[_0xb24afd(0x1f5)];_0xb669c4[_0xb24afd(0x203)]&&(console['error'](_0xb24afd(0x1f7)+_0xdb1230),console[_0xb24afd(0x1e0)](_0xb24afd(0x1e1)+_0x22f91e));let _0x2cba55;if(_0xb669c4[_0xb24afd(0x1e3)]){const _0x208347=_0xb669c4['folder'],_0xa347c7=await withSpinner(_0xb24afd(0x1fa)+_0x208347+_0xb24afd(0x202),()=>_0x1cf5be[_0xb24afd(0x204)][_0xb24afd(0x206)](_0xdb1230,_0x208347),{'verbose':_0xb669c4[_0xb24afd(0x203)]});_0x2cba55=parseInt(_0xa347c7['data'],0xa),_0xb669c4['verbose']&&console[_0xb24afd(0x1e0)](_0xb24afd(0x20d)+_0x2cba55);}const _0x189a26=await loadJSONFromOptions(_0xb669c4[_0xb24afd(0x207)],_0xb669c4['ruleFile']),_0x2f7fc9={'name':_0xb669c4[_0xb24afd(0x1f4)],'description':_0xb669c4[_0xb24afd(0x1e7)],'rule':_0x189a26,'kind':_0xb669c4[_0xb24afd(0x1ff)]!==undefined?parseInt(_0xb669c4[_0xb24afd(0x1ff)],0xa):undefined,'segmentFolderId':_0x2cba55},_0xf95669=await withSpinner(_0xb24afd(0x1e5)+_0x21c57d['segmentName']+'\x27...',()=>_0x1cf5be['segment'][_0xb24afd(0x1f3)](_0xdb1230,_0x22f91e,_0x2f7fc9),{'verbose':_0xb669c4[_0xb24afd(0x203)]}),_0x42c8b1=_0xf95669[_0xb24afd(0x1f0)];return console[_0xb24afd(0x1e0)](_0xb24afd(0x1df)+_0x42c8b1[_0xb24afd(0x1f4)]+'\x27'),_0x20fac2!==_0x4c9f6b&&console[_0xb24afd(0x1e0)](_0xb24afd(0x20c)+_0x20fac2),await handleSDKOutput([_0x42c8b1],_0xb669c4),0x0;}}
@@ -1 +1 @@
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
+ const a43_0x46b63e=a43_0x222d;(function(_0x35e799,_0x432e4e){const _0x4cc528=a43_0x222d,_0x4d0099=_0x35e799();while(!![]){try{const _0x30f496=parseInt(_0x4cc528(0x1c0))/0x1*(parseInt(_0x4cc528(0x1e2))/0x2)+-parseInt(_0x4cc528(0x1ef))/0x3*(parseInt(_0x4cc528(0x1c5))/0x4)+-parseInt(_0x4cc528(0x1d0))/0x5*(parseInt(_0x4cc528(0x1c9))/0x6)+-parseInt(_0x4cc528(0x1bd))/0x7+parseInt(_0x4cc528(0x1e7))/0x8*(parseInt(_0x4cc528(0x1ec))/0x9)+parseInt(_0x4cc528(0x1e1))/0xa*(-parseInt(_0x4cc528(0x1e6))/0xb)+-parseInt(_0x4cc528(0x1be))/0xc*(-parseInt(_0x4cc528(0x1e0))/0xd);if(_0x30f496===_0x432e4e)break;else _0x4d0099['push'](_0x4d0099['shift']());}catch(_0x2498d4){_0x4d0099['push'](_0x4d0099['shift']());}}}(a43_0x3cb5,0x3e8f5));function a43_0x3cb5(){const _0x1afff1=['Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','resolvePathToResource','Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>','Resolved\x20relative\x20path\x20to:\x20','name','Target\x20path:\x20','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22','\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent','✔\x20Context\x20set\x20to:\x20','11731252BCHQiK','419690KjVFhU','8eeJjbu','\x27...','folderPath','Error:\x20Path\x20is\x20required\x0a','55HNlgDI','8rlHcmy','Examples:','split','log','segments','983340JAuWAt','segmentPath','green','120ajQtlJ','✔\x20Context\x20cleared.\x20Back\x20to\x20root.','Resolving\x20path\x20\x27','segment','Usage:\x20tdx\x20segment\x20use\x20<path>','site','verbose','2331350fVyfCP','12cfnYAX','red','107031oLoFIu','parentName','type','fullPath','Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.','12980lOpxdt','Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.','235776ObtcTX','data','folderId','Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.','isDirectory','description','join','65ShBhNC','dim','cyan','Site:\x20','parent_segment','Use\x20\x22tdx\x20use\x22\x20to\x20see\x20all\x20context\x20parameters','error'];a43_0x3cb5=function(){return _0x1afff1;};return a43_0x3cb5();}function a43_0x222d(_0x555f34,_0x2c2ea2){_0x555f34=_0x555f34-0x1bd;const _0x3cb5c3=a43_0x3cb5();let _0x222dcf=_0x3cb5c3[_0x555f34];return _0x222dcf;}import{existsSync,statSync}from'fs';import a43_0x598117 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_0x46b63e(0x1db)]='segment:use';[a43_0x46b63e(0x1ce)]='Set\x20current\x20segment/folder\x20context\x20for\x20navigation';async['execute'](_0x353a9c){const _0x354a1e=a43_0x46b63e,{options:_0x964d58,args:_0x466272,tdx:_0x444839}=_0x353a9c;if(_0x466272['length']===0x0)return console[_0x354a1e(0x1d6)](a43_0x598117[_0x354a1e(0x1bf)](_0x354a1e(0x1e5))),console[_0x354a1e(0x1d6)](_0x354a1e(0x1f3)),console[_0x354a1e(0x1d6)](_0x354a1e(0x1e8)),console['error']('\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22'),console[_0x354a1e(0x1d6)](_0x354a1e(0x1dd)),console[_0x354a1e(0x1d6)]('\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context'),console['error'](_0x354a1e(0x1de)),0x1;const _0x49c04d=_0x466272[0x0],_0x1226c9=_0x964d58['session'];try{if(_0x49c04d==='/')return saveSessionContext({'segment_path':undefined},_0x1226c9),console[_0x354a1e(0x1ea)](a43_0x598117[_0x354a1e(0x1ee)](_0x354a1e(0x1f0))),0x0;if(existsSync(_0x49c04d)&&statSync(_0x49c04d)[_0x354a1e(0x1cd)]()){let _0x3af6a0;try{_0x3af6a0=findTdxConfig(_0x49c04d);}catch{return console['error'](a43_0x598117['red'](_0x354a1e(0x1d7)+_0x49c04d)),console[_0x354a1e(0x1d6)](a43_0x598117[_0x354a1e(0x1d2)](_0x354a1e(0x1c7))),0x1;}const _0x5261ef=_0x3af6a0['config'][_0x354a1e(0x1d4)];return saveSessionContext({'segment_path':_0x5261ef,'parent_segment':_0x5261ef},_0x1226c9),console['log'](a43_0x598117['green'](_0x354a1e(0x1df)+a43_0x598117['cyan'](_0x5261ef))),0x0;}const _0xea6b6c=_0x964d58[_0x354a1e(0x1ed)];let _0x229183=_0x49c04d;const _0x17aefd=parsePath(_0x49c04d);if(!_0x17aefd['isAbsolute']){if(!_0xea6b6c)return console['error'](a43_0x598117[_0x354a1e(0x1bf)](_0x354a1e(0x1cc))),console[_0x354a1e(0x1d6)](a43_0x598117[_0x354a1e(0x1d2)](_0x354a1e(0x1d9))),0x1;if(_0x49c04d==='..'){const _0x211724=_0xea6b6c[_0x354a1e(0x1e9)]('/')['slice'](0x0,-0x1)[_0x354a1e(0x1cf)]('/');_0x229183=_0x211724||'/';}else _0x49c04d==='.'?_0x229183=_0xea6b6c:_0x229183=_0xea6b6c+'/'+_0x49c04d;_0x964d58[_0x354a1e(0x1f5)]&&console['error'](_0x354a1e(0x1da)+_0x229183);}if(_0x229183==='/'||_0x229183==='')return saveSessionContext({'segment_path':undefined},_0x1226c9),console[_0x354a1e(0x1ea)](a43_0x598117[_0x354a1e(0x1ee)](_0x354a1e(0x1f0))),0x0;_0x229183=normalizePath(_0x229183);const _0x492fff=parsePath(_0x229183)[_0x354a1e(0x1eb)];if(_0x492fff['length']===0x0)return saveSessionContext({'segment_path':undefined},_0x1226c9),console['log'](a43_0x598117['green'](_0x354a1e(0x1f0))),0x0;_0x964d58['verbose']&&(console[_0x354a1e(0x1d6)](_0x354a1e(0x1d3)+_0x964d58[_0x354a1e(0x1f4)]),console[_0x354a1e(0x1d6)](_0x354a1e(0x1dc)+_0x229183));const _0x218866=await withSpinner(_0x354a1e(0x1f1)+_0x229183+_0x354a1e(0x1e3),()=>_0x444839[_0x354a1e(0x1f2)][_0x354a1e(0x1d8)](_0x229183),{'verbose':_0x964d58['verbose']}),_0x54102f=_0x218866[_0x354a1e(0x1ca)];_0x964d58['verbose']&&(console[_0x354a1e(0x1d6)]('Resolved\x20path\x20type:\x20'+_0x54102f[_0x354a1e(0x1c2)]),console['error']('Parent\x20ID:\x20'+_0x54102f['parentId']),_0x54102f[_0x354a1e(0x1cb)]&&console[_0x354a1e(0x1d6)]('Folder\x20ID:\x20'+_0x54102f['folderId']));if(_0x54102f[_0x354a1e(0x1c2)]==='segment')return console[_0x354a1e(0x1d6)](a43_0x598117[_0x354a1e(0x1bf)](_0x354a1e(0x1c4))),console[_0x354a1e(0x1d6)](_0x354a1e(0x1c8)),console['error'](a43_0x598117['cyan']('Use:\x20tdx\x20segment\x20use\x20'+_0x54102f[_0x354a1e(0x1c1)]+(_0x54102f[_0x354a1e(0x1e4)]?'/'+_0x54102f[_0x354a1e(0x1e4)][_0x354a1e(0x1cf)]('/'):''))),0x1;return saveSessionContext({'segment_path':_0x54102f['fullPath'],'parent_segment':_0x54102f[_0x354a1e(0x1c1)]},_0x1226c9),console['log'](a43_0x598117['green']('✔\x20Context\x20set\x20to:\x20'+a43_0x598117['cyan'](_0x54102f[_0x354a1e(0x1c3)]))),_0x964d58[_0x354a1e(0x1f5)]&&(console[_0x354a1e(0x1d6)](a43_0x598117[_0x354a1e(0x1d1)](_0x354a1e(0x1c6))),console[_0x354a1e(0x1d6)](a43_0x598117[_0x354a1e(0x1d1)](_0x354a1e(0x1d5)))),0x0;}catch(_0x53654f){throw _0x53654f;}}}
@@ -1 +1 @@
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
+ const a44_0x567a22=a44_0x103c;(function(_0x11aaaa,_0x18da82){const _0x5ac44f=a44_0x103c,_0x5ef7e0=_0x11aaaa();while(!![]){try{const _0x4ebc3a=-parseInt(_0x5ac44f(0x11a))/0x1*(-parseInt(_0x5ac44f(0x112))/0x2)+parseInt(_0x5ac44f(0x125))/0x3+-parseInt(_0x5ac44f(0x127))/0x4*(parseInt(_0x5ac44f(0x11b))/0x5)+parseInt(_0x5ac44f(0x128))/0x6*(parseInt(_0x5ac44f(0x120))/0x7)+-parseInt(_0x5ac44f(0x141))/0x8+parseInt(_0x5ac44f(0x140))/0x9*(parseInt(_0x5ac44f(0x124))/0xa)+parseInt(_0x5ac44f(0x13b))/0xb;if(_0x4ebc3a===_0x18da82)break;else _0x5ef7e0['push'](_0x5ef7e0['shift']());}catch(_0x356796){_0x5ef7e0['push'](_0x5ef7e0['shift']());}}}(a44_0x5676,0xcbf67));import{BaseCommand}from'./command.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';function a44_0x103c(_0x21f389,_0x467b97){_0x21f389=_0x21f389-0x111;const _0x56761c=a44_0x5676();let _0x103c14=_0x56761c[_0x21f389];return _0x103c14;}function a44_0x5676(){const _0x31480a=['Error:\x20','7KRwfee','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file','description','Error:\x20Directory\x20not\x20found:\x20','590UrTfWB','1097337oXnrEB','length','36ridUoP','4646946YNPobj','\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','):\x20','\x20warning(s)\x20found','Validate\x20segment\x20and\x20journey\x20YAML\x20files','cyan','✔\x20All\x20','yellow','parentSegment','hasErrors','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','\x20file(s)\x20valid','\x20file(s)\x20with\x20errors,\x20','segment:validate','targetDir','cwd','Usage:\x20tdx\x20sg\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)','verbose','16588165nBHoas','\x20valid','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','execute','helpText','98658rCkday','11349504lZdEgO','warnings','name','red','green','type','2Cqkcaz','endsWith','validCount','\x20error(s)','invalidCount','.yaml','error','valid','80737EJjaTX','623145dvlZdw','warningCount','log','dim'];a44_0x5676=function(){return _0x31480a;};return a44_0x5676();}import{existsSync}from'fs';import a44_0xf8322d 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_0x567a22(0x143)]=a44_0x567a22(0x136);[a44_0x567a22(0x122)]=a44_0x567a22(0x12c);async[a44_0x567a22(0x13e)](_0x17584c){const _0x2f04dc=a44_0x567a22,{options:_0x508e90,args:_0x2229de}=_0x17584c,_0x538981=_0x508e90,_0x167514=await resolveTarget({'arg':_0x2229de[0x0],'contextParent':_0x508e90[_0x2f04dc(0x130)],'cwd':process[_0x2f04dc(0x138)]()});if(!isSuccessfulResolution(_0x167514))return _0x167514['errorCode']==='no_parent'?(console['error'](a44_0xf8322d[_0x2f04dc(0x12f)](_0x2f04dc(0x132))),console[_0x2f04dc(0x118)](_0x2f04dc(0x139)),console['error'](_0x2f04dc(0x129)),console[_0x2f04dc(0x118)](_0x2f04dc(0x121))):(console[_0x2f04dc(0x118)](a44_0xf8322d[_0x2f04dc(0x144)](_0x2f04dc(0x11f)+_0x167514['message']+'\x0a')),_0x167514['helpText']&&console[_0x2f04dc(0x118)](a44_0xf8322d[_0x2f04dc(0x12d)](_0x167514[_0x2f04dc(0x13f)]))),0x1;const _0x8dc242=_0x167514[_0x2f04dc(0x137)],_0x19ea15=_0x167514[_0x2f04dc(0x111)]==='file'?_0x167514['filePath']:undefined;if(!_0x19ea15&&!existsSync(_0x8dc242))return console[_0x2f04dc(0x118)](a44_0xf8322d[_0x2f04dc(0x144)](_0x2f04dc(0x123)+_0x8dc242+'\x0a')),0x1;let _0x3574c2;if(_0x19ea15){if(!_0x19ea15[_0x2f04dc(0x113)]('.yml')&&!_0x19ea15['endsWith'](_0x2f04dc(0x117)))return console[_0x2f04dc(0x118)](a44_0xf8322d[_0x2f04dc(0x144)](_0x2f04dc(0x13d)+_0x19ea15+'\x0a')),0x1;_0x3574c2=[_0x19ea15];}else _0x3574c2=findYamlFiles(_0x8dc242);if(_0x3574c2[_0x2f04dc(0x126)]===0x0)return console[_0x2f04dc(0x118)](a44_0xf8322d[_0x2f04dc(0x144)](_0x2f04dc(0x133)+_0x8dc242+'\x0a')),0x1;const _0x59ec84=validateYamlFiles(_0x3574c2,_0x8dc242),_0xc497c4=calculateSummary(_0x59ec84);for(const _0x8213fc of _0x59ec84){if(!isValidationResult(_0x8213fc))continue;const {relativePath:_0x15febc,source:_0x228edb,result:_0x22736f,fileType:_0x56aa18}=_0x8213fc,_0x4758cc=_0x56aa18;if(_0x22736f[_0x2f04dc(0x119)]&&_0x22736f[_0x2f04dc(0x142)][_0x2f04dc(0x126)]===0x0)_0x538981[_0x2f04dc(0x13a)]&&console['log'](a44_0xf8322d[_0x2f04dc(0x145)]('✔\x20'+_0x15febc)+a44_0xf8322d['dim']('\x20('+_0x4758cc+')'));else _0x22736f[_0x2f04dc(0x119)]?(console[_0x2f04dc(0x11d)](a44_0xf8322d[_0x2f04dc(0x12f)]('⚠\x20'+_0x15febc)+a44_0xf8322d[_0x2f04dc(0x11e)]('\x20('+_0x4758cc+_0x2f04dc(0x12a)+_0x22736f[_0x2f04dc(0x142)]['length']+'\x20warning(s)')),console[_0x2f04dc(0x11d)](formatValidationResult(_0x22736f,_0x228edb,_0x15febc))):(console[_0x2f04dc(0x11d)](a44_0xf8322d[_0x2f04dc(0x144)]('✖\x20'+_0x15febc)+a44_0xf8322d[_0x2f04dc(0x11e)]('\x20('+_0x4758cc+_0x2f04dc(0x12a)+_0x22736f['errors'][_0x2f04dc(0x126)]+_0x2f04dc(0x115))),console['log'](formatValidationResult(_0x22736f,_0x228edb,_0x15febc)));}return console['log'](''),_0xc497c4[_0x2f04dc(0x131)]?(console['log'](a44_0xf8322d['red']('Validation\x20failed:\x20'+_0xc497c4[_0x2f04dc(0x116)]+_0x2f04dc(0x135)+_0xc497c4[_0x2f04dc(0x114)]+_0x2f04dc(0x13c))),_0xc497c4['warningCount']>0x0&&console[_0x2f04dc(0x11d)](a44_0xf8322d['yellow'](_0xc497c4['warningCount']+_0x2f04dc(0x12b))),0x1):(console[_0x2f04dc(0x11d)](a44_0xf8322d[_0x2f04dc(0x145)](_0x2f04dc(0x12e)+_0xc497c4['validCount']+_0x2f04dc(0x134))),_0xc497c4[_0x2f04dc(0x11c)]>0x0&&console[_0x2f04dc(0x11d)](a44_0xf8322d['yellow'](_0xc497c4[_0x2f04dc(0x11c)]+_0x2f04dc(0x12b))),0x0);}}
@@ -1 +1 @@
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
+ const a45_0x5e01bf=a45_0x3e9c;(function(_0x2d3ec6,_0x4e043c){const _0x4e771d=a45_0x3e9c,_0xa9275e=_0x2d3ec6();while(!![]){try{const _0x244551=-parseInt(_0x4e771d(0x147))/0x1*(parseInt(_0x4e771d(0x15d))/0x2)+-parseInt(_0x4e771d(0x140))/0x3*(parseInt(_0x4e771d(0x167))/0x4)+-parseInt(_0x4e771d(0x146))/0x5*(-parseInt(_0x4e771d(0x132))/0x6)+-parseInt(_0x4e771d(0x172))/0x7+-parseInt(_0x4e771d(0x13d))/0x8*(-parseInt(_0x4e771d(0x14f))/0x9)+parseInt(_0x4e771d(0x159))/0xa*(-parseInt(_0x4e771d(0x13a))/0xb)+parseInt(_0x4e771d(0x15b))/0xc;if(_0x244551===_0x4e043c)break;else _0xa9275e['push'](_0xa9275e['shift']());}catch(_0x488090){_0xa9275e['push'](_0xa9275e['shift']());}}}(a45_0x1f29,0x9aa26));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';function a45_0x3e9c(_0x189e6b,_0x1e6a2f){_0x189e6b=_0x189e6b-0x12b;const _0x1f2925=a45_0x1f29();let _0x3e9c71=_0x1f2925[_0x189e6b];return _0x3e9c71;}import{handleSDKOutput}from'../core/command-output.js';function a45_0x1f29(){const _0xce543d=['length','22YGQEGA','map','jsonl','737544MFbHqc','\x27...','dim','369813MMpQaQ','listUnifiedWithJourneys','segments','\x20\x20Cause:\x20','\x20folder','sort','30lmVmOw','3309AjSTDL','format','maxDepth','folderId','listRecursive','includes','resolvePathToResource','name','99ydGhnC','\x20\x20tdx\x20sg\x20pull\x20\x22My\x20Audience\x22','replace','\x20\x20tdx\x20sg\x20use\x20\x22My\x20Audience\x22','\x5c$&','localeCompare','journey','Parent\x20ID:\x20','✔\x20Found\x20','folder','2081530ByLmYB','/app/ps/','6219900gKzZRv','Resolving\x20path\x20\x27','276nFTUrW','Parent\x20segment\x20context:\x20','Recursive\x20mode:\x20enabled','type','journeys','execute','cause','Building\x20hierarchy\x20tree...','message','\x20journey','32aEhrlI','description','(empty)','Resolving\x20parent\x20segment\x20\x27',',\x20and\x20','site','List\x20folders\x20and\x20child\x20segments','parentId',']\x20matching\x20\x27','parentSegment','verbose','1064014gsIios','Folder\x20ID:\x20','folders','\x20matching\x20\x27','Site:\x20','test','No\x20items\x20match\x20pattern:\x20','json','children','recursive','Set\x20a\x20parent\x20segment\x20context\x20first:','Listing\x20folders,\x20segments,\x20and\x20journeys...','\x20segment','log','/j/da','error','listUnified','listWithPattern','1112052ruiwFY','data','segment','filter','journeyBundleName','/e/','Folder/pattern\x20arg:\x20'];a45_0x1f29=function(){return _0xce543d;};return a45_0x1f29();}import{withSpinner}from'../utils/spinner.js';import{formatFlatList,formatTree}from'../sdk/util/tree-formatter.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import a45_0x12945b from'chalk';export class SegmentsCommand extends BaseCommand{[a45_0x5e01bf(0x14e)]=a45_0x5e01bf(0x142);[a45_0x5e01bf(0x168)]=a45_0x5e01bf(0x16d);async[a45_0x5e01bf(0x162)](_0x3faf12){const _0x5d5d42=a45_0x5e01bf,{options:_0x3e62f9,args:_0x3edeb7}=_0x3faf12,_0x2af59e=_0x3e62f9[_0x5d5d42(0x17b)],_0x382903=_0x3edeb7[0x0];try{const _0xa1ee36=_0x3e62f9[_0x5d5d42(0x170)];_0x3e62f9[_0x5d5d42(0x171)]&&(console['error'](_0x5d5d42(0x176)+_0x3e62f9[_0x5d5d42(0x16c)]),console[_0x5d5d42(0x12f)](_0x5d5d42(0x15e)+(_0xa1ee36||'(not\x20set)')),_0x382903&&console[_0x5d5d42(0x12f)](_0x5d5d42(0x138)+_0x382903),_0x2af59e&&console['error'](_0x5d5d42(0x15f)));if(!_0xa1ee36)return console['error']('Error:\x20No\x20parent\x20segment\x20context\x20set.'),console[_0x5d5d42(0x12f)](''),console[_0x5d5d42(0x12f)](_0x5d5d42(0x17c)),console[_0x5d5d42(0x12f)](_0x5d5d42(0x150)),console[_0x5d5d42(0x12f)](_0x5d5d42(0x152)),console[_0x5d5d42(0x12f)](''),console[_0x5d5d42(0x12f)]('Use\x20tdx\x20ps\x20list\x20to\x20see\x20available\x20parent\x20segments.'),0x1;const _0x55b744=_0x382903&&(_0x382903[_0x5d5d42(0x14c)]('*')||_0x382903['includes']('?'));if(_0x55b744)return await this[_0x5d5d42(0x131)](_0x3faf12,_0xa1ee36,_0x382903);const _0x36a96d=_0x382903?_0xa1ee36+'/'+_0x382903:_0xa1ee36;return _0x2af59e?await this[_0x5d5d42(0x14b)](_0x3faf12,_0x36a96d):await this[_0x5d5d42(0x130)](_0x3faf12,_0x36a96d);}catch(_0x85e16){if(_0x85e16 instanceof SDKError)return console[_0x5d5d42(0x12f)]('Error:\x20'+_0x85e16[_0x5d5d42(0x165)]),_0x85e16[_0x5d5d42(0x163)]&&console[_0x5d5d42(0x12f)](_0x5d5d42(0x143)+_0x85e16[_0x5d5d42(0x163)]),0x1;throw _0x85e16;}}async[a45_0x5e01bf(0x131)](_0x5c890d,_0x3703e4,_0x59ec4a){const _0x432be9=a45_0x5e01bf,{options:_0x5703d5,tdx:_0x5d3434}=_0x5c890d,_0x3ca8c9=await withSpinner(_0x432be9(0x16a)+_0x3703e4+_0x432be9(0x13e),()=>_0x5d3434[_0x432be9(0x134)][_0x432be9(0x14d)](_0x3703e4),{'verbose':_0x5703d5['verbose']}),_0x2e7646=_0x3ca8c9['data'],_0x24586d=await withSpinner('Listing\x20folders,\x20segments,\x20and\x20journeys...',()=>_0x5d3434[_0x432be9(0x134)][_0x432be9(0x141)](_0x2e7646[_0x432be9(0x16e)],_0x2e7646[_0x432be9(0x14a)]),{'verbose':_0x5703d5[_0x432be9(0x171)]}),{folders:_0x413ed4,segments:_0x566d1d,journeys:_0x4d4548}=_0x24586d[_0x432be9(0x133)],_0x29a30b=_0x59ec4a['replace'](/[.+^${}()|[\]\\]/g,_0x432be9(0x153))[_0x432be9(0x151)](/\*/g,'.*')[_0x432be9(0x151)](/\?/g,'.'),_0x45e8eb=new RegExp('^'+_0x29a30b+'$','i'),_0x10b833=_0x413ed4[_0x432be9(0x135)](_0x47cfc7=>_0x45e8eb['test'](_0x47cfc7[_0x432be9(0x14e)])),_0x193e20=_0x566d1d[_0x432be9(0x135)](_0x17afcf=>_0x45e8eb['test'](_0x17afcf[_0x432be9(0x14e)])),_0x510935=_0x4d4548['filter'](_0x16e204=>_0x45e8eb[_0x432be9(0x177)](_0x16e204[_0x432be9(0x136)])),_0xafad9e=_0x10b833[_0x432be9(0x139)]+_0x193e20[_0x432be9(0x139)]+_0x510935['length'];console[_0x432be9(0x12f)](_0x432be9(0x157)+_0x10b833[_0x432be9(0x139)]+_0x432be9(0x144)+(_0x10b833[_0x432be9(0x139)]!==0x1?'s':'')+',\x20'+_0x193e20[_0x432be9(0x139)]+_0x432be9(0x12c)+(_0x193e20[_0x432be9(0x139)]!==0x1?'s':'')+_0x432be9(0x16b)+_0x510935[_0x432be9(0x139)]+_0x432be9(0x166)+(_0x510935['length']!==0x1?'s':'')+_0x432be9(0x175)+_0x59ec4a+'\x27');const _0x1be8b2=_0x54420a=>{const _0x533dd=_0x432be9;return getConsoleNextUrl(_0x5703d5['site'],_0x533dd(0x15a)+_0x2e7646['parentId']+_0x533dd(0x137)+_0x54420a);},_0x2c5bda=_0x5703d5[_0x432be9(0x148)]===_0x432be9(0x179)||_0x5703d5[_0x432be9(0x148)]==='jsonl';if(_0x2c5bda){const _0x58ce22=[..._0x10b833['map'](_0x5b5022=>({..._0x5b5022,'type':'folder'})),..._0x193e20[_0x432be9(0x13b)](_0x3d3867=>({..._0x3d3867,'type':'segment','url':_0x1be8b2(_0x3d3867['id'])})),..._0x510935['map'](_0x1924d7=>({..._0x1924d7,'name':_0x1924d7[_0x432be9(0x136)],'type':_0x432be9(0x155)}))][_0x432be9(0x145)]((_0x43909d,_0x51e085)=>_0x43909d['name'][_0x432be9(0x154)](_0x51e085['name']));await handleSDKOutput(_0x58ce22,_0x5703d5);}else{if(_0xafad9e===0x0)console[_0x432be9(0x12d)](_0x432be9(0x178)+_0x59ec4a);else{console[_0x432be9(0x12d)](a45_0x12945b['dim']('['+_0x3703e4+_0x432be9(0x16f)+_0x59ec4a+'\x27'));const _0xbca2e3=formatFlatList(_0x10b833,_0x193e20,{'showMetadata':!![],'getSegmentUrl':_0x1be8b2},_0x510935);console[_0x432be9(0x12d)](_0xbca2e3);}}return 0x0;}async['listUnified'](_0xec7962,_0x2fb781){const _0x4ae0e1=a45_0x5e01bf,{options:_0x186edf,tdx:_0x26f750}=_0xec7962,_0x582a6b=await withSpinner(_0x4ae0e1(0x15c)+_0x2fb781+'\x27...',()=>_0x26f750[_0x4ae0e1(0x134)]['resolvePathToResource'](_0x2fb781),{'verbose':_0x186edf[_0x4ae0e1(0x171)]}),_0x21c135=_0x582a6b[_0x4ae0e1(0x133)];_0x186edf[_0x4ae0e1(0x171)]&&(console['error']('Parent\x20ID:\x20'+_0x21c135[_0x4ae0e1(0x16e)]),_0x21c135[_0x4ae0e1(0x14a)]&&console[_0x4ae0e1(0x12f)](_0x4ae0e1(0x173)+_0x21c135[_0x4ae0e1(0x14a)]));const _0x16f232=await withSpinner(_0x4ae0e1(0x12b),()=>_0x26f750['segment']['listUnifiedWithJourneys'](_0x21c135[_0x4ae0e1(0x16e)],_0x21c135[_0x4ae0e1(0x14a)]),{'verbose':_0x186edf['verbose']}),{folders:_0x28fb61,segments:_0x5d913a,journeys:_0x5c3eb3}=_0x16f232['data'],_0x437aee=_0x28fb61[_0x4ae0e1(0x139)]+_0x5d913a[_0x4ae0e1(0x139)]+_0x5c3eb3[_0x4ae0e1(0x139)];console[_0x4ae0e1(0x12f)](_0x4ae0e1(0x157)+_0x28fb61[_0x4ae0e1(0x139)]+'\x20folder'+(_0x28fb61[_0x4ae0e1(0x139)]!==0x1?'s':'')+',\x20'+_0x5d913a[_0x4ae0e1(0x139)]+'\x20segment'+(_0x5d913a[_0x4ae0e1(0x139)]!==0x1?'s':'')+_0x4ae0e1(0x16b)+_0x5c3eb3[_0x4ae0e1(0x139)]+'\x20journey'+(_0x5c3eb3[_0x4ae0e1(0x139)]!==0x1?'s':''));const _0xc4d826=_0x31401a=>{const _0x2704af=_0x4ae0e1;return getConsoleNextUrl(_0x186edf[_0x2704af(0x16c)],_0x2704af(0x15a)+_0x21c135[_0x2704af(0x16e)]+_0x2704af(0x137)+_0x31401a);},_0x1920c8=_0x48fca=>{const _0x50c100=_0x4ae0e1;return getConsoleNextUrl(_0x186edf[_0x50c100(0x16c)],_0x50c100(0x15a)+_0x21c135[_0x50c100(0x16e)]+'/e/'+_0x48fca+'/j/da');},_0x3a6d50=_0x186edf[_0x4ae0e1(0x148)]==='json'||_0x186edf['format']===_0x4ae0e1(0x13c);if(_0x3a6d50){const _0x1ba92a=[..._0x28fb61[_0x4ae0e1(0x13b)](_0x553d1a=>({..._0x553d1a,'type':_0x4ae0e1(0x158)})),..._0x5d913a[_0x4ae0e1(0x13b)](_0x5de0d3=>({..._0x5de0d3,'type':'segment','url':_0xc4d826(_0x5de0d3['id'])})),..._0x5c3eb3[_0x4ae0e1(0x13b)](_0x2d872f=>({..._0x2d872f,'name':_0x2d872f[_0x4ae0e1(0x136)],'type':_0x4ae0e1(0x155),'url':_0x1920c8(_0x2d872f['id'])}))][_0x4ae0e1(0x145)]((_0x19c6f2,_0x4d4d84)=>_0x19c6f2[_0x4ae0e1(0x14e)][_0x4ae0e1(0x154)](_0x4d4d84[_0x4ae0e1(0x14e)]));await handleSDKOutput(_0x1ba92a,_0x186edf);}else{if(_0x437aee===0x0)console[_0x4ae0e1(0x12d)](a45_0x12945b[_0x4ae0e1(0x13f)]('['+_0x2fb781+']')),console[_0x4ae0e1(0x12d)](_0x4ae0e1(0x169));else{console['log'](a45_0x12945b['dim']('['+_0x2fb781+']'));const _0x2f546d=formatFlatList(_0x28fb61,_0x5d913a,{'showMetadata':!![],'getSegmentUrl':_0xc4d826,'getJourneyUrl':_0x1920c8},_0x5c3eb3);console[_0x4ae0e1(0x12d)](_0x2f546d);}}return 0x0;}async[a45_0x5e01bf(0x14b)](_0x23ef89,_0x4bbb4e){const _0x5940e3=a45_0x5e01bf,{options:_0x446dda,tdx:_0x496874}=_0x23ef89,_0x3f9cda=await withSpinner(_0x5940e3(0x15c)+_0x4bbb4e+'\x27...',()=>_0x496874[_0x5940e3(0x134)][_0x5940e3(0x14d)](_0x4bbb4e),{'verbose':_0x446dda[_0x5940e3(0x171)]}),_0x226b5b=_0x3f9cda[_0x5940e3(0x133)];_0x446dda[_0x5940e3(0x171)]&&(console[_0x5940e3(0x12f)](_0x5940e3(0x156)+_0x226b5b[_0x5940e3(0x16e)]),_0x226b5b[_0x5940e3(0x14a)]&&console[_0x5940e3(0x12f)](_0x5940e3(0x173)+_0x226b5b[_0x5940e3(0x14a)]));const _0x1af085=_0x446dda[_0x5940e3(0x149)]||0xa,_0x5c9d3e=await withSpinner(_0x5940e3(0x164),()=>_0x496874[_0x5940e3(0x134)][_0x5940e3(0x14b)](_0x226b5b[_0x5940e3(0x16e)],_0x226b5b['folderId'],0x0,_0x1af085),{'verbose':_0x446dda[_0x5940e3(0x171)]}),_0x4a1ece=_0x5c9d3e[_0x5940e3(0x133)],_0x1b381f=_0x7b7d40=>{const _0x177a87=_0x5940e3;let _0x449c23=0x0,_0x39f841=0x0,_0x23de77=0x0;for(const _0x4b8c98 of _0x7b7d40){if(_0x4b8c98[_0x177a87(0x160)]===_0x177a87(0x158))_0x449c23++;else{if(_0x4b8c98[_0x177a87(0x160)]===_0x177a87(0x134))_0x39f841++;else{if(_0x4b8c98[_0x177a87(0x160)]===_0x177a87(0x155))_0x23de77++;}}if(_0x4b8c98[_0x177a87(0x17a)]){const _0x54a8ab=_0x1b381f(_0x4b8c98[_0x177a87(0x17a)]);_0x449c23+=_0x54a8ab['folders'],_0x39f841+=_0x54a8ab['segments'],_0x23de77+=_0x54a8ab[_0x177a87(0x161)];}}return{'folders':_0x449c23,'segments':_0x39f841,'journeys':_0x23de77};},_0x4a5592=_0x1b381f(_0x4a1ece);console[_0x5940e3(0x12f)]('✔\x20Built\x20tree\x20with\x20'+_0x4a5592[_0x5940e3(0x174)]+'\x20folder'+(_0x4a5592[_0x5940e3(0x174)]!==0x1?'s':'')+',\x20'+_0x4a5592[_0x5940e3(0x142)]+_0x5940e3(0x12c)+(_0x4a5592[_0x5940e3(0x142)]!==0x1?'s':'')+',\x20and\x20'+_0x4a5592[_0x5940e3(0x161)]+_0x5940e3(0x166)+(_0x4a5592['journeys']!==0x1?'s':''));const _0x2fc16e=_0xcf3bf=>{const _0x465402=_0x5940e3;return getConsoleNextUrl(_0x446dda['site'],'/app/ps/'+_0x226b5b['parentId']+_0x465402(0x137)+_0xcf3bf);},_0x45489b=_0x4a96e9=>{const _0xfe3b1=_0x5940e3;return getConsoleNextUrl(_0x446dda[_0xfe3b1(0x16c)],_0xfe3b1(0x15a)+_0x226b5b[_0xfe3b1(0x16e)]+_0xfe3b1(0x137)+_0x4a96e9+_0xfe3b1(0x12e));};if(_0x446dda[_0x5940e3(0x148)]==='json'||_0x446dda['format']==='jsonl')await handleSDKOutput(_0x4a1ece,_0x446dda);else{console[_0x5940e3(0x12d)](a45_0x12945b[_0x5940e3(0x13f)]('['+_0x4bbb4e+']'));const _0x498265=formatTree(_0x4a1ece,{'showMetadata':!![],'getSegmentUrl':_0x2fc16e,'getJourneyUrl':_0x45489b});console['log'](_0x498265);}return 0x0;}}
@@ -1 +1 @@
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
+ const a46_0xdaa14a=a46_0x4191;(function(_0x2e0dac,_0x113af8){const _0x1b8515=a46_0x4191,_0xb08c14=_0x2e0dac();while(!![]){try{const _0x2904cf=-parseInt(_0x1b8515(0x125))/0x1*(parseInt(_0x1b8515(0x124))/0x2)+-parseInt(_0x1b8515(0x123))/0x3+parseInt(_0x1b8515(0x11e))/0x4+-parseInt(_0x1b8515(0x12c))/0x5+-parseInt(_0x1b8515(0x13a))/0x6*(parseInt(_0x1b8515(0x116))/0x7)+parseInt(_0x1b8515(0x12b))/0x8*(parseInt(_0x1b8515(0x135))/0x9)+parseInt(_0x1b8515(0x11f))/0xa*(parseInt(_0x1b8515(0x120))/0xb);if(_0x2904cf===_0x113af8)break;else _0xb08c14['push'](_0xb08c14['shift']());}catch(_0x14f528){_0xb08c14['push'](_0xb08c14['shift']());}}}(a46_0x2e7f,0xc3591));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';import{parseTableReference,validateTableDescribeReference}from'../utils/table-ref-parser.js';import{withSpinner}from'../utils/spinner.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';export class ShowCommand extends BaseCommand{['name']=a46_0xdaa14a(0x133);['description']=a46_0xdaa14a(0x138);async[a46_0xdaa14a(0x136)](_0x40ca37){const _0x312ee5=a46_0xdaa14a;return this[_0x312ee5(0x130)](_0x40ca37);}async['showTable'](_0x3a0ecc){const _0x213d9a=a46_0xdaa14a,{options:_0x2716c6,args:_0x1098c4,tdx:_0x25c2ab}=_0x3a0ecc;let _0x52139c;try{_0x52139c=parseTableReference(_0x1098c4[0x0]);const _0x3ef8c1=_0x2716c6[_0x213d9a(0x131)];!_0x52139c[_0x213d9a(0x131)]&&_0x3ef8c1&&(_0x52139c[_0x213d9a(0x131)]=_0x3ef8c1);const _0x1ffe99=validateTableDescribeReference(_0x52139c);if(_0x1ffe99)return console['error'](_0x213d9a(0x126)+_0x1ffe99),console['error'](_0x213d9a(0x119)),console['error'](_0x213d9a(0x11a)),console[_0x213d9a(0x13b)](_0x213d9a(0x117)),0x1;}catch(_0x4e52f7){return console[_0x213d9a(0x13b)](_0x213d9a(0x126)+_0x4e52f7[_0x213d9a(0x11c)]),console['error'](_0x213d9a(0x119)),console[_0x213d9a(0x13b)]('\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>'),console[_0x213d9a(0x13b)](_0x213d9a(0x117)),0x1;}const _0x5985b7=_0x52139c['catalog'],_0x555cc5=_0x52139c[_0x213d9a(0x131)],_0x3feb55=_0x52139c['table'],_0x37dc87=resolveLimit(_0x2716c6['limit'],DEFAULT_DISPLAY_LIMIT);try{_0x2716c6[_0x213d9a(0x11d)]&&(console[_0x213d9a(0x13b)]('Site:\x20'+_0x2716c6['site']),_0x5985b7&&console[_0x213d9a(0x13b)]('Catalog:\x20'+_0x5985b7),console[_0x213d9a(0x13b)](_0x213d9a(0x12a)+_0x555cc5),console[_0x213d9a(0x13b)](_0x213d9a(0x12d)+_0x3feb55),console['error']('Limit:\x20'+_0x37dc87));const _0x21f013=_0x5985b7?_0x5985b7+'.'+_0x555cc5+'.'+_0x3feb55:_0x555cc5+'.'+_0x3feb55,_0x128801=await withSpinner(_0x213d9a(0x129)+_0x21f013+_0x213d9a(0x139),()=>_0x25c2ab[_0x213d9a(0x132)][_0x213d9a(0x130)](_0x555cc5,_0x3feb55,_0x37dc87,_0x5985b7),{'verbose':_0x2716c6['verbose']}),_0xbab44a=_0x128801['data'],_0x160508=_0xbab44a[_0x213d9a(0x121)];return _0x160508[_0x213d9a(0x134)]===0x0?console['error'](_0x213d9a(0x11b)):console[_0x213d9a(0x13b)](_0x213d9a(0x137)+_0x160508[_0x213d9a(0x134)]+_0x213d9a(0x128)+(_0x160508[_0x213d9a(0x134)]!==0x1?'s':'')+_0x213d9a(0x118)+_0x21f013),await handleSDKOutput(_0x160508,_0x2716c6),0x0;}catch(_0x46a7dc){if(_0x46a7dc instanceof SDKError)return console['error']('Error:\x20'+_0x46a7dc['message']),_0x46a7dc[_0x213d9a(0x127)]&&console[_0x213d9a(0x13b)]('\x20\x20Cause:\x20'+_0x46a7dc[_0x213d9a(0x127)]),0x1;throw _0x46a7dc;}}['validate'](_0x430143){const _0x2db49c=a46_0xdaa14a;if(_0x430143[_0x2db49c(0x122)][_0x2db49c(0x134)]===0x0)return _0x2db49c(0x12f);if(_0x430143[_0x2db49c(0x122)][_0x2db49c(0x134)]>0x1)return _0x2db49c(0x12e);return undefined;}}function a46_0x4191(_0x10c9e8,_0x3a2833){_0x10c9e8=_0x10c9e8-0x116;const _0x2e7f81=a46_0x2e7f();let _0x4191f1=_0x2e7f81[_0x10c9e8];return _0x4191f1;}function a46_0x2e7f(){const _0x58e49b=['show','length','1293264adDyHe','execute','✔\x20Retrieved\x20','Show\x20table\x20contents','...','27558KHkzTj','error','1323pZwTpk','\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>','\x20from\x20','Usage:\x20tdx\x20show\x20<database.table>','\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>','✔\x20Query\x20successful\x20-\x200\x20rows\x20returned','message','verbose','712556Eppfxu','20880380qIWmtP','11GelYhD','data','args','4070085XHPNdN','36bNzaEB','14983xePoUg','Error:\x20','cause','\x20row','Querying\x20','Database:\x20','64jeNtZI','605670CEiMcV','Table:\x20','Too\x20many\x20arguments\x0aUsage:\x20tdx\x20show\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>\x0a\x0aRun\x20\x27tdx\x20show\x20--help\x27\x20for\x20more\x20options','Usage:\x20tdx\x20show\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--in\x20<database>\x0a\x0aRun\x20\x27tdx\x20show\x20--help\x27\x20for\x20more\x20options','showTable','database','query'];a46_0x2e7f=function(){return _0x58e49b;};return a46_0x2e7f();}
@@ -1 +1 @@
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;}}
1
+ const a47_0x188c88=a47_0x517f;(function(_0x341a54,_0x40610b){const _0x6f4d0b=a47_0x517f,_0x27ef79=_0x341a54();while(!![]){try{const _0x4e299c=parseInt(_0x6f4d0b(0x149))/0x1*(-parseInt(_0x6f4d0b(0x169))/0x2)+parseInt(_0x6f4d0b(0x148))/0x3+-parseInt(_0x6f4d0b(0x14f))/0x4*(parseInt(_0x6f4d0b(0x171))/0x5)+-parseInt(_0x6f4d0b(0x160))/0x6*(parseInt(_0x6f4d0b(0x15e))/0x7)+parseInt(_0x6f4d0b(0x158))/0x8+-parseInt(_0x6f4d0b(0x15f))/0x9+parseInt(_0x6f4d0b(0x154))/0xa*(parseInt(_0x6f4d0b(0x168))/0xb);if(_0x4e299c===_0x40610b)break;else _0x27ef79['push'](_0x27ef79['shift']());}catch(_0x51d8c3){_0x27ef79['push'](_0x27ef79['shift']());}}}(a47_0x58cd,0x187d5));import{BaseCommand,printAuthError}from'./command.js';import{resolveAPIKeyAsync}from'../core/config.js';import{getOAuthTokens}from'../core/oauth-keychain.js';import{HTTPClientError}from'../sdk/client/http-client.js';import{GlobalContext}from'../core/global-context.js';function a47_0x517f(_0x361f6c,_0x57c761){_0x361f6c=_0x361f6c-0x148;const _0x58cd2d=a47_0x58cd();let _0x517f05=_0x58cd2d[_0x361f6c];return _0x517f05;}import a47_0x2d5812 from'chalk';function a47_0x58cd(){const _0x2b9a0e=['dim','jobs','log','N/A','OAuth','Show\x20authentication\x20status\x20and\x20current\x20context','969425baZXYP','message','env','status','✗\x20Validation\x20failed:\x20','95274WKMYYI','13AknoyH','Credential\x20type:\x20','getUserInfo','config','cyan','No\x20credential\x20found','4MUYSug','execute','Name:','profile','profileSource','7190IwszPU','join','site:\x20','email','1390472zwXaon','session','bold','description','Read\x20credential\x20from\x20','Account\x20ID:','3731Iwjosn','524079HVXNeh','30vrPLut','yellow','account_id','last_name','error','CLI\x20flag','\x20profile:\x20','cli','3245hMhjEY','9628BLXAtW','first_name'];a47_0x58cd=function(){return _0x2b9a0e;};return a47_0x58cd();}export class StatusCommand extends BaseCommand{['name']=a47_0x188c88(0x174);[a47_0x188c88(0x15b)]=a47_0x188c88(0x170);async[a47_0x188c88(0x150)](_0x266478){const _0x2420f2=a47_0x188c88,{options:_0x3dea59,tdx:_0x169d64}=_0x266478,_0x4f3bfa=_0x3dea59['site'],_0x42edc4=new GlobalContext(_0x3dea59),_0x5a202a=_0x42edc4[_0x2420f2(0x152)],_0x15adc3=_0x42edc4[_0x2420f2(0x153)],_0x1562d1=_0x15adc3===_0x2420f2(0x167)?_0x2420f2(0x165):_0x15adc3===_0x2420f2(0x159)?_0x2420f2(0x159):_0x15adc3===_0x2420f2(0x173)?'TDX_PROFILE\x20env':_0x15adc3===_0x2420f2(0x14c)?_0x2420f2(0x14c):null,_0x302178=_0x5a202a?a47_0x2d5812[_0x2420f2(0x14d)](_0x5a202a):a47_0x2d5812['dim'](_0x2420f2(0x16e)),_0x5a9374=_0x1562d1?'\x20'+a47_0x2d5812[_0x2420f2(0x16b)]('(from\x20'+_0x1562d1+')'):'';console[_0x2420f2(0x16d)](a47_0x2d5812[_0x2420f2(0x15a)]('tdx')+_0x2420f2(0x166)+_0x302178+_0x5a9374+'\x20'+a47_0x2d5812[_0x2420f2(0x16b)]('(')+_0x2420f2(0x156)+a47_0x2d5812[_0x2420f2(0x14d)](_0x4f3bfa)+a47_0x2d5812[_0x2420f2(0x16b)](')'));const _0x496ba5=await getOAuthTokens(_0x5a202a);if(_0x496ba5)console['log'](_0x2420f2(0x14a)+a47_0x2d5812[_0x2420f2(0x14d)](_0x2420f2(0x16f)));else{const _0x5c3e65=await resolveAPIKeyAsync(_0x4f3bfa,_0x5a202a);if(_0x5c3e65){const {source:_0x255684,isDeprecated:_0x4bfc4f}=_0x5c3e65,_0x1090a5=_0x2420f2(0x15c)+a47_0x2d5812[_0x2420f2(0x14d)](_0x255684);console[_0x2420f2(0x16d)](_0x4bfc4f?a47_0x2d5812[_0x2420f2(0x161)](_0x1090a5):_0x1090a5);}else console[_0x2420f2(0x16d)](a47_0x2d5812[_0x2420f2(0x161)](_0x2420f2(0x14e)));}let _0x34cad3=![];try{const _0x4b0a92=await _0x169d64[_0x2420f2(0x16c)][_0x2420f2(0x14b)]();console[_0x2420f2(0x16d)](a47_0x2d5812['green']('✓\x20Authentication\x20successful\x0a')),console[_0x2420f2(0x16d)](a47_0x2d5812[_0x2420f2(0x15a)]('User:')+'\x20'+a47_0x2d5812['cyan'](_0x4b0a92[_0x2420f2(0x157)]));if(_0x4b0a92[_0x2420f2(0x16a)]||_0x4b0a92[_0x2420f2(0x163)]){const _0x31bb2b=[_0x4b0a92['first_name'],_0x4b0a92[_0x2420f2(0x163)]]['filter'](Boolean)[_0x2420f2(0x155)]('\x20');console['log'](a47_0x2d5812[_0x2420f2(0x15a)](_0x2420f2(0x151))+'\x20'+_0x31bb2b);}_0x4b0a92[_0x2420f2(0x162)]&&console[_0x2420f2(0x16d)](a47_0x2d5812['bold'](_0x2420f2(0x15d))+'\x20'+a47_0x2d5812[_0x2420f2(0x161)](_0x4b0a92['account_id'])),_0x34cad3=!![];}catch(_0x10ec95){_0x10ec95 instanceof HTTPClientError&&_0x10ec95[_0x2420f2(0x174)]===0x191?printAuthError(_0x10ec95,!![],_0x5a202a):console[_0x2420f2(0x164)](a47_0x2d5812['red'](_0x2420f2(0x175)+(_0x10ec95 instanceof Error?_0x10ec95[_0x2420f2(0x172)]:String(_0x10ec95))));}return console[_0x2420f2(0x16d)](),_0x42edc4['displayWithSources'](),_0x34cad3?0x0:0x1;}}