@treasuredata/tdx 2026.4.3 → 2026.4.5

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 (231) 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.d.ts +2 -0
  168. package/dist/sdk/types/workspace.d.ts.map +1 -1
  169. package/dist/sdk/types/workspace.js +1 -1
  170. package/dist/sdk/user.js +1 -1
  171. package/dist/sdk/util/format-detector.js +1 -1
  172. package/dist/sdk/util/formatters.js +1 -1
  173. package/dist/sdk/util/index.js +1 -1
  174. package/dist/sdk/util/paginate.js +1 -1
  175. package/dist/sdk/util/tree-formatter.js +1 -1
  176. package/dist/sdk/workflow/archive-validation.js +1 -1
  177. package/dist/sdk/workflow/clone-workflow.js +1 -1
  178. package/dist/sdk/workflow/index.js +1 -1
  179. package/dist/sdk/workflow/pull-workflow.js +1 -1
  180. package/dist/sdk/workflow/push-workflow.js +1 -1
  181. package/dist/sdk/workflow/tdx-config.js +1 -1
  182. package/dist/sdk/workflow/workflow-utils.js +1 -1
  183. package/dist/sdk/workspace/access-tracker.d.ts +5 -0
  184. package/dist/sdk/workspace/access-tracker.d.ts.map +1 -0
  185. package/dist/sdk/workspace/access-tracker.js +1 -0
  186. package/dist/sdk/workspace/access-tracker.js.map +1 -0
  187. package/dist/sdk/workspace/frontmatter.js +1 -1
  188. package/dist/sdk/workspace/git.d.ts +1 -1
  189. package/dist/sdk/workspace/git.d.ts.map +1 -1
  190. package/dist/sdk/workspace/git.js +1 -1
  191. package/dist/sdk/workspace/git.js.map +1 -1
  192. package/dist/sdk/workspace/index.d.ts +8 -0
  193. package/dist/sdk/workspace/index.d.ts.map +1 -1
  194. package/dist/sdk/workspace/index.js +1 -1
  195. package/dist/sdk/workspace/index.js.map +1 -1
  196. package/dist/sdk/workspace/templates.js +1 -1
  197. package/dist/sdk/workspace/weekly.js +1 -1
  198. package/dist/sdk/workspace/wikilinks.js +1 -1
  199. package/dist/test-utils/command-runner.js +1 -1
  200. package/dist/test-utils/factories.js +1 -1
  201. package/dist/test-utils/fixtures.js +1 -1
  202. package/dist/test-utils/http-mock.js +1 -1
  203. package/dist/test-utils/index.js +1 -1
  204. package/dist/utils/async.js +1 -1
  205. package/dist/utils/colors.js +1 -1
  206. package/dist/utils/diff.js +1 -1
  207. package/dist/utils/file-permissions.js +1 -1
  208. package/dist/utils/file-reader.js +1 -1
  209. package/dist/utils/github-releases.js +1 -1
  210. package/dist/utils/global-cache.js +1 -1
  211. package/dist/utils/json-loader.js +1 -1
  212. package/dist/utils/local-cache.js +1 -1
  213. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  214. package/dist/utils/logger/formatters/index.js +1 -1
  215. package/dist/utils/logger/handlers/console-handler.js +1 -1
  216. package/dist/utils/logger/handlers/file-handler.js +1 -1
  217. package/dist/utils/logger/handlers/index.js +1 -1
  218. package/dist/utils/logger/handlers/null-handler.js +1 -1
  219. package/dist/utils/logger/index.js +1 -1
  220. package/dist/utils/logger/logger.js +1 -1
  221. package/dist/utils/logger/types.js +1 -1
  222. package/dist/utils/option-validation.js +1 -1
  223. package/dist/utils/process.js +1 -1
  224. package/dist/utils/prompt.js +1 -1
  225. package/dist/utils/spinner.js +1 -1
  226. package/dist/utils/sse-parser.js +1 -1
  227. package/dist/utils/string-utils.js +1 -1
  228. package/dist/utils/table-ref-parser.js +1 -1
  229. package/dist/utils/tdx-logger.js +1 -1
  230. package/dist/utils/version-check.js +1 -1
  231. package/package.json +1 -1
@@ -1 +1 @@
1
- const a40_0x216a9c=a40_0x8411;(function(_0x2edd88,_0x471360){const _0x3f2877=a40_0x8411,_0x31b24d=_0x2edd88();while(!![]){try{const _0x21f9a7=-parseInt(_0x3f2877(0x153))/0x1+parseInt(_0x3f2877(0x144))/0x2*(parseInt(_0x3f2877(0x124))/0x3)+parseInt(_0x3f2877(0x150))/0x4+-parseInt(_0x3f2877(0x162))/0x5+parseInt(_0x3f2877(0x166))/0x6+-parseInt(_0x3f2877(0x143))/0x7*(-parseInt(_0x3f2877(0x136))/0x8)+parseInt(_0x3f2877(0x154))/0x9*(-parseInt(_0x3f2877(0x14d))/0xa);if(_0x21f9a7===_0x471360)break;else _0x31b24d['push'](_0x31b24d['shift']());}catch(_0x4c1fde){_0x31b24d['push'](_0x31b24d['shift']());}}}(a40_0x1433,0x507fb));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{saveSessionContext}from'../core/session.js';function a40_0x8411(_0x4cba0c,_0x25a172){_0x4cba0c=_0x4cba0c-0x11d;const _0x1433b0=a40_0x1433();let _0x8411f9=_0x1433b0[_0x4cba0c];return _0x8411f9;}function a40_0x1433(){const _0x57a1f0=['2yreUPI','Pulling\x20segments\x20from\x20\x27','cyan','journeyVersions','parentSegment','Write\x20','✔\x20Context\x20set:\x20','red','\x20segments','81570DRCsDl','\x0aChanges\x20to\x20\x27','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','2050448PdapXa','repeat','relativePath','386557VgedWx','864trxKTC','counts','\x20files?','length','yes','\x20=\x20','data','\x20\x20Target:\x20','Error:\x20','\x20activations','yellow','No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27','segment:pull','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','3232875YcUHKV','hasChanges','setPhase','helpText','3567648kPXiqZ','\x20\x20🎯\x20','site','no_parent','\x20unchanged\x20files','resourceName','green','verbose','1804488pEXaxZ','dim','content','\x20\x20🗺️\x20\x20','filter','segment','execute','✔\x20Pulled\x20','Parent\x20segment:\x20','parentName','cwd','isNew','targetDir','description','\x20versions)','dirname','\x0aError:','journeys','129544GaekfF','absolutePath','Aborted.','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)','-\x20no\x20files\x20written','Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files','error','files','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent','parent_segment','✔\x20All\x20files\x20are\x20up\x20to\x20date','segments','type','189fhGIWr'];a40_0x1433=function(){return _0x57a1f0;};return a40_0x1433();}import a40_0x13b6b7 from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';import a40_0x58cb76 from'path';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';export{buildFolderIdToPathMap as buildFolderPathMap}from'../sdk/segment/resolution-context.js';export class SegmentPullCommand extends BaseCommand{['name']=a40_0x216a9c(0x160);[a40_0x216a9c(0x131)]=a40_0x216a9c(0x13b);async[a40_0x216a9c(0x12a)](_0x46af7a){const _0xc86474=a40_0x216a9c,{options:_0x2086e7,args:_0x8afb60,tdx:_0x3bef46}=_0x46af7a,_0x27708b=_0x2086e7,_0x5c570e=await resolveTarget({'arg':_0x8afb60[0x0],'contextParent':_0x2086e7[_0xc86474(0x148)],'cwd':process[_0xc86474(0x12e)]()});if(!isSuccessfulResolution(_0x5c570e))return _0x5c570e['errorCode']===_0xc86474(0x11f)?(console[_0xc86474(0x13c)](a40_0x13b6b7[_0xc86474(0x15e)]('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console[_0xc86474(0x13c)](_0xc86474(0x139)),console[_0xc86474(0x13c)](_0xc86474(0x13e)),console['error']('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file')):(console[_0xc86474(0x13c)](a40_0x13b6b7['red'](_0xc86474(0x15c)+_0x5c570e['message']+'\x0a')),_0x5c570e[_0xc86474(0x165)]&&console[_0xc86474(0x13c)](a40_0x13b6b7[_0xc86474(0x146)](_0x5c570e[_0xc86474(0x165)]))),0x1;const _0x2ff73b=_0x5c570e[_0xc86474(0x12d)],_0x1e3c50=_0x5c570e[_0xc86474(0x130)],_0x23a134=_0x5c570e[_0xc86474(0x142)]==='file'?_0x5c570e[_0xc86474(0x121)]:undefined;_0x27708b[_0xc86474(0x123)]&&(console[_0xc86474(0x13c)]('Site:\x20'+_0x27708b[_0xc86474(0x11e)]),console[_0xc86474(0x13c)](_0xc86474(0x12c)+_0x2ff73b),_0x23a134&&console[_0xc86474(0x13c)]('Target\x20resource:\x20'+_0x23a134));const _0x51f448=await withProgressSpinner(_0xc86474(0x145)+_0x2ff73b+'\x27...',_0x164523=>_0x3bef46[_0xc86474(0x129)]['pullSegments'](_0x2ff73b,{'targetDir':_0x1e3c50,'targetResourceName':_0x23a134,'verbose':_0x27708b[_0xc86474(0x123)],'progress':{'update':_0x3720ea=>{const _0x1b95ad=_0xc86474;_0x164523[_0x1b95ad(0x164)](_0x3720ea),_0x27708b['verbose']&&console[_0x1b95ad(0x13c)]('\x20\x20'+_0x3720ea);}}}),{'verbose':_0x27708b[_0xc86474(0x123)]}),_0xe60194=_0x51f448[_0xc86474(0x15a)];if(_0xe60194[_0xc86474(0x155)][_0xc86474(0x141)]===0x0&&_0xe60194['counts'][_0xc86474(0x135)]===0x0)return console[_0xc86474(0x13c)](a40_0x13b6b7[_0xc86474(0x15e)](_0xc86474(0x15f)+_0xe60194[_0xc86474(0x12d)]+'\x27')),0x0;const _0x24c81d=_0xe60194[_0xc86474(0x13d)]['filter'](_0x5b8309=>_0x5b8309[_0xc86474(0x12f)]),_0x340f38=_0xe60194[_0xc86474(0x13d)][_0xc86474(0x128)](_0x2b9de3=>!_0x2b9de3[_0xc86474(0x12f)]&&_0x2b9de3['hasChanges']),_0x2c332f=_0xe60194['files'][_0xc86474(0x128)](_0x49aebf=>!_0x49aebf[_0xc86474(0x12f)]&&!_0x49aebf[_0xc86474(0x163)]);console[_0xc86474(0x13c)]('\x0aPull\x20summary\x20for\x20\x27'+_0xe60194['parentName']+'\x27:'),console[_0xc86474(0x13c)](_0xc86474(0x11d)+a40_0x13b6b7[_0xc86474(0x146)](_0xe60194[_0xc86474(0x155)][_0xc86474(0x141)]+_0xc86474(0x14c))+'\x20with\x20'+a40_0x13b6b7[_0xc86474(0x146)](_0xe60194[_0xc86474(0x155)]['activations']+_0xc86474(0x15d)));if(_0xe60194['counts'][_0xc86474(0x135)]>0x0){const _0x472a04=_0xe60194[_0xc86474(0x155)][_0xc86474(0x147)]>_0xe60194[_0xc86474(0x155)][_0xc86474(0x135)]?'\x20('+_0xe60194[_0xc86474(0x155)]['journeyVersions']+_0xc86474(0x132):'';console[_0xc86474(0x13c)](_0xc86474(0x127)+a40_0x13b6b7[_0xc86474(0x146)](_0xe60194['counts'][_0xc86474(0x135)]+'\x20journeys')+a40_0x13b6b7[_0xc86474(0x125)](_0x472a04));}console[_0xc86474(0x13c)]('\x20\x20'+a40_0x13b6b7['green']('+\x20'+_0x24c81d['length']+'\x20new\x20files')),console['error']('\x20\x20'+a40_0x13b6b7[_0xc86474(0x15e)]('~\x20'+_0x340f38[_0xc86474(0x157)]+'\x20changed\x20files')),console[_0xc86474(0x13c)]('\x20\x20'+a40_0x13b6b7[_0xc86474(0x125)]('=\x20'+_0x2c332f[_0xc86474(0x157)]+_0xc86474(0x120))),console[_0xc86474(0x13c)](_0xc86474(0x15b)+a40_0x13b6b7[_0xc86474(0x146)](_0xe60194['targetDir'])+'\x0a');if(_0x340f38[_0xc86474(0x157)]>0x0)for(const _0x13a29a of _0x340f38){console['error'](_0xc86474(0x14e)+_0x13a29a[_0xc86474(0x152)]+'\x27:'),console[_0xc86474(0x13c)]('─'[_0xc86474(0x151)](0x3c)),console[_0xc86474(0x13c)](_0x13a29a['diff']),console[_0xc86474(0x13c)]('─'[_0xc86474(0x151)](0x3c));}if(_0x27708b['dryRun'])return console[_0xc86474(0x13c)](a40_0x13b6b7['yellow'](_0xc86474(0x161))),0x0;if(_0x24c81d[_0xc86474(0x157)]===0x0&&_0x340f38[_0xc86474(0x157)]===0x0)return console[_0xc86474(0x13c)](a40_0x13b6b7[_0xc86474(0x122)](_0xc86474(0x140))),saveSessionContext({'parent_segment':_0xe60194[_0xc86474(0x12d)]},_0x27708b['session']),console[_0xc86474(0x13c)](a40_0x13b6b7[_0xc86474(0x122)](_0xc86474(0x14a)+a40_0x13b6b7[_0xc86474(0x125)](_0xc86474(0x13f))+'\x20=\x20'+a40_0x13b6b7[_0xc86474(0x146)](_0xe60194[_0xc86474(0x12d)]))),0x0;if(!_0x27708b[_0xc86474(0x158)]){if(!isInteractive())return console['error'](a40_0x13b6b7[_0xc86474(0x14b)](_0xc86474(0x134)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0xc86474(0x13c)](a40_0x13b6b7[_0xc86474(0x125)](_0xc86474(0x14f))),0x1;const _0x15d3d0=await confirmKey(_0xc86474(0x149)+(_0x24c81d[_0xc86474(0x157)]+_0x340f38[_0xc86474(0x157)])+_0xc86474(0x156));if(!_0x15d3d0)return console[_0xc86474(0x13c)](a40_0x13b6b7[_0xc86474(0x15e)](_0xc86474(0x138)),_0xc86474(0x13a)),0x1;}for(const _0x4b831f of _0xe60194[_0xc86474(0x13d)]){if(_0x4b831f[_0xc86474(0x12f)]||_0x4b831f[_0xc86474(0x163)]){const _0x103bb2=a40_0x58cb76[_0xc86474(0x133)](_0x4b831f['absolutePath']);!existsSync(_0x103bb2)&&mkdirSync(_0x103bb2,{'recursive':!![]}),writeFileSync(_0x4b831f[_0xc86474(0x137)],_0x4b831f[_0xc86474(0x126)],'utf-8');}}return console[_0xc86474(0x13c)](a40_0x13b6b7['green'](_0xc86474(0x12b)+(_0x24c81d['length']+_0x340f38[_0xc86474(0x157)])+'\x20files\x20to\x20'+_0xe60194[_0xc86474(0x130)])),saveSessionContext({'parent_segment':_0xe60194[_0xc86474(0x12d)]},_0x27708b['session']),console[_0xc86474(0x13c)](a40_0x13b6b7[_0xc86474(0x122)](_0xc86474(0x14a)+a40_0x13b6b7[_0xc86474(0x125)]('parent_segment')+_0xc86474(0x159)+a40_0x13b6b7[_0xc86474(0x146)](_0xe60194[_0xc86474(0x12d)]))),0x0;}}
1
+ const a40_0x454dcb=a40_0x53e1;(function(_0x306df8,_0x890643){const _0x4bf28a=a40_0x53e1,_0x3117f6=_0x306df8();while(!![]){try{const _0x3778e0=parseInt(_0x4bf28a(0x1c6))/0x1*(-parseInt(_0x4bf28a(0x1f5))/0x2)+-parseInt(_0x4bf28a(0x1df))/0x3*(parseInt(_0x4bf28a(0x1ef))/0x4)+-parseInt(_0x4bf28a(0x1cc))/0x5*(-parseInt(_0x4bf28a(0x1c4))/0x6)+parseInt(_0x4bf28a(0x1e3))/0x7*(-parseInt(_0x4bf28a(0x1dd))/0x8)+-parseInt(_0x4bf28a(0x1c2))/0x9+-parseInt(_0x4bf28a(0x1ca))/0xa*(-parseInt(_0x4bf28a(0x1da))/0xb)+parseInt(_0x4bf28a(0x1f8))/0xc;if(_0x3778e0===_0x890643)break;else _0x3117f6['push'](_0x3117f6['shift']());}catch(_0x5070d2){_0x3117f6['push'](_0x3117f6['shift']());}}}(a40_0x513b,0x68e6a));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{saveSessionContext}from'../core/session.js';import a40_0x2761ce from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';import a40_0x27bd1a from'path';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';function a40_0x53e1(_0x127374,_0x43999c){_0x127374=_0x127374-0x1bd;const _0x513bce=a40_0x513b();let _0x53e149=_0x513bce[_0x127374];return _0x53e149;}export{buildFolderIdToPathMap as buildFolderPathMap}from'../sdk/segment/resolution-context.js';export class SegmentPullCommand extends BaseCommand{[a40_0x454dcb(0x1f2)]=a40_0x454dcb(0x1c9);['description']='Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files';async[a40_0x454dcb(0x205)](_0xa18c4e){const _0xfc9541=a40_0x454dcb,{options:_0x252fed,args:_0x1b8abd,tdx:_0x53b3e6}=_0xa18c4e,_0xe394a4=_0x252fed,_0x296230=await resolveTarget({'arg':_0x1b8abd[0x0],'contextParent':_0x252fed['parentSegment'],'cwd':process[_0xfc9541(0x1fd)]()});if(!isSuccessfulResolution(_0x296230))return _0x296230[_0xfc9541(0x1e7)]==='no_parent'?(console[_0xfc9541(0x1d3)](a40_0x2761ce[_0xfc9541(0x1e0)](_0xfc9541(0x1f7))),console[_0xfc9541(0x1d3)](_0xfc9541(0x1ee)),console[_0xfc9541(0x1d3)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent'),console[_0xfc9541(0x1d3)](_0xfc9541(0x1d5))):(console[_0xfc9541(0x1d3)](a40_0x2761ce[_0xfc9541(0x1e2)](_0xfc9541(0x201)+_0x296230['message']+'\x0a')),_0x296230[_0xfc9541(0x209)]&&console[_0xfc9541(0x1d3)](a40_0x2761ce[_0xfc9541(0x1ff)](_0x296230[_0xfc9541(0x209)]))),0x1;const _0x396100=_0x296230['parentName'],_0x1ad6de=_0x296230[_0xfc9541(0x1fa)],_0x32dd8f=_0x296230[_0xfc9541(0x1c8)]===_0xfc9541(0x1ed)?_0x296230[_0xfc9541(0x206)]:undefined;_0xe394a4[_0xfc9541(0x1eb)]&&(console['error'](_0xfc9541(0x1e1)+_0xe394a4[_0xfc9541(0x1ce)]),console['error']('Parent\x20segment:\x20'+_0x396100),_0x32dd8f&&console[_0xfc9541(0x1d3)]('Target\x20resource:\x20'+_0x32dd8f));const _0x2b4d2e=await withProgressSpinner(_0xfc9541(0x1fb)+_0x396100+_0xfc9541(0x1e9),_0x10a5cc=>_0x53b3e6[_0xfc9541(0x1db)][_0xfc9541(0x1f4)](_0x396100,{'targetDir':_0x1ad6de,'targetResourceName':_0x32dd8f,'verbose':_0xe394a4[_0xfc9541(0x1eb)],'progress':{'update':_0x1a24a3=>{const _0x3fd2cf=_0xfc9541;_0x10a5cc[_0x3fd2cf(0x1d1)](_0x1a24a3),_0xe394a4['verbose']&&console[_0x3fd2cf(0x1d3)]('\x20\x20'+_0x1a24a3);}}}),{'verbose':_0xe394a4[_0xfc9541(0x1eb)]}),_0x1c8f42=_0x2b4d2e[_0xfc9541(0x1be)];if(_0x1c8f42['counts'][_0xfc9541(0x1c0)]===0x0&&_0x1c8f42[_0xfc9541(0x1d2)][_0xfc9541(0x1d0)]===0x0)return console[_0xfc9541(0x1d3)](a40_0x2761ce['yellow']('No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27'+_0x1c8f42[_0xfc9541(0x200)]+'\x27')),0x0;const _0x4374be=_0x1c8f42[_0xfc9541(0x204)]['filter'](_0x48797b=>_0x48797b[_0xfc9541(0x1fc)]),_0x4253c0=_0x1c8f42['files'][_0xfc9541(0x1cd)](_0x259b49=>!_0x259b49['isNew']&&_0x259b49['hasChanges']),_0x443877=_0x1c8f42[_0xfc9541(0x204)][_0xfc9541(0x1cd)](_0x1f2281=>!_0x1f2281['isNew']&&!_0x1f2281[_0xfc9541(0x1f0)]);console['error']('\x0aPull\x20summary\x20for\x20\x27'+_0x1c8f42[_0xfc9541(0x200)]+'\x27:'),console['error'](_0xfc9541(0x207)+a40_0x2761ce[_0xfc9541(0x1ff)](_0x1c8f42['counts'][_0xfc9541(0x1c0)]+'\x20segments')+'\x20with\x20'+a40_0x2761ce[_0xfc9541(0x1ff)](_0x1c8f42[_0xfc9541(0x1d2)][_0xfc9541(0x1c7)]+_0xfc9541(0x1bf)));if(_0x1c8f42[_0xfc9541(0x1d2)][_0xfc9541(0x1d0)]>0x0){const _0x4f4f06=_0x1c8f42[_0xfc9541(0x1d2)]['journeyVersions']>_0x1c8f42[_0xfc9541(0x1d2)]['journeys']?'\x20('+_0x1c8f42[_0xfc9541(0x1d2)]['journeyVersions']+_0xfc9541(0x1fe):'';console['error'](_0xfc9541(0x1cb)+a40_0x2761ce['cyan'](_0x1c8f42['counts'][_0xfc9541(0x1d0)]+_0xfc9541(0x1bd))+a40_0x2761ce[_0xfc9541(0x1e6)](_0x4f4f06));}console[_0xfc9541(0x1d3)]('\x20\x20'+a40_0x2761ce[_0xfc9541(0x1d8)]('+\x20'+_0x4374be[_0xfc9541(0x1f6)]+'\x20new\x20files')),console[_0xfc9541(0x1d3)]('\x20\x20'+a40_0x2761ce[_0xfc9541(0x1e0)]('~\x20'+_0x4253c0[_0xfc9541(0x1f6)]+'\x20changed\x20files')),console['error']('\x20\x20'+a40_0x2761ce[_0xfc9541(0x1e6)]('=\x20'+_0x443877[_0xfc9541(0x1f6)]+_0xfc9541(0x1f9))),console[_0xfc9541(0x1d3)]('\x20\x20Target:\x20'+a40_0x2761ce['cyan'](_0x1c8f42[_0xfc9541(0x1fa)])+'\x0a');if(_0x4253c0['length']>0x0)for(const _0x26a230 of _0x4253c0){console['error']('\x0aChanges\x20to\x20\x27'+_0x26a230[_0xfc9541(0x1de)]+'\x27:'),console[_0xfc9541(0x1d3)]('─'[_0xfc9541(0x203)](0x3c)),console[_0xfc9541(0x1d3)](_0x26a230['diff']),console[_0xfc9541(0x1d3)]('─'[_0xfc9541(0x203)](0x3c));}if(_0xe394a4[_0xfc9541(0x1ec)])return console['error'](a40_0x2761ce[_0xfc9541(0x1e0)](_0xfc9541(0x1cf))),0x0;if(_0x4374be['length']===0x0&&_0x4253c0[_0xfc9541(0x1f6)]===0x0)return console[_0xfc9541(0x1d3)](a40_0x2761ce[_0xfc9541(0x1d8)](_0xfc9541(0x1d9))),saveSessionContext({'parent_segment':_0x1c8f42['parentName']},_0xe394a4['session']),console[_0xfc9541(0x1d3)](a40_0x2761ce[_0xfc9541(0x1d8)](_0xfc9541(0x1ea)+a40_0x2761ce['dim'](_0xfc9541(0x1d6))+_0xfc9541(0x1d4)+a40_0x2761ce['cyan'](_0x1c8f42[_0xfc9541(0x200)]))),0x0;if(!_0xe394a4[_0xfc9541(0x1f3)]){if(!isInteractive())return console[_0xfc9541(0x1d3)](a40_0x2761ce['red'](_0xfc9541(0x1c5)),_0xfc9541(0x202)),console[_0xfc9541(0x1d3)](a40_0x2761ce[_0xfc9541(0x1e6)](_0xfc9541(0x1d7))),0x1;const _0x178fd7=await confirmKey(_0xfc9541(0x1c1)+(_0x4374be[_0xfc9541(0x1f6)]+_0x4253c0[_0xfc9541(0x1f6)])+_0xfc9541(0x1c3));if(!_0x178fd7)return console[_0xfc9541(0x1d3)](a40_0x2761ce[_0xfc9541(0x1e0)](_0xfc9541(0x1e4)),'-\x20no\x20files\x20written'),0x1;}for(const _0x52b9ad of _0x1c8f42['files']){if(_0x52b9ad[_0xfc9541(0x1fc)]||_0x52b9ad[_0xfc9541(0x1f0)]){const _0x3209d1=a40_0x27bd1a['dirname'](_0x52b9ad[_0xfc9541(0x1e8)]);!existsSync(_0x3209d1)&&mkdirSync(_0x3209d1,{'recursive':!![]}),writeFileSync(_0x52b9ad[_0xfc9541(0x1e8)],_0x52b9ad[_0xfc9541(0x1dc)],_0xfc9541(0x208));}}return console['error'](a40_0x2761ce['green']('✔\x20Pulled\x20'+(_0x4374be['length']+_0x4253c0[_0xfc9541(0x1f6)])+_0xfc9541(0x1e5)+_0x1c8f42[_0xfc9541(0x1fa)])),saveSessionContext({'parent_segment':_0x1c8f42['parentName']},_0xe394a4[_0xfc9541(0x1f1)]),console[_0xfc9541(0x1d3)](a40_0x2761ce[_0xfc9541(0x1d8)]('✔\x20Context\x20set:\x20'+a40_0x2761ce['dim']('parent_segment')+_0xfc9541(0x1d4)+a40_0x2761ce['cyan'](_0x1c8f42['parentName']))),0x0;}}function a40_0x513b(){const _0x39f22c=['\x20files\x20to\x20','dim','errorCode','absolutePath','\x27...','✔\x20Context\x20set:\x20','verbose','dryRun','file','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)','483588YuYnRV','hasChanges','session','name','yes','pullSegments','2KBsIlS','length','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','14853888kTICSW','\x20unchanged\x20files','targetDir','Pulling\x20segments\x20from\x20\x27','isNew','cwd','\x20versions)','cyan','parentName','Error:\x20','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','repeat','files','execute','resourceName','\x20\x20🎯\x20','utf-8','helpText','\x20journeys','data','\x20activations','segments','Write\x20','2509191ucuLHA','\x20files?','1443738eBTtVI','\x0aError:','479485KhXILe','activations','type','segment:pull','10UsremE','\x20\x20🗺️\x20\x20','5pLFRHt','filter','site','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','journeys','setPhase','counts','error','\x20=\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file','parent_segment','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','green','✔\x20All\x20files\x20are\x20up\x20to\x20date','7326517ArESRp','segment','content','2128cwcSwP','relativePath','18DaTCZT','yellow','Site:\x20','red','6083BZKrlD','Aborted.'];a40_0x513b=function(){return _0x39f22c;};return a40_0x513b();}
@@ -1 +1 @@
1
- const a41_0x5a04ba=a41_0x4181;(function(_0x40507e,_0x1acbfa){const _0x2f49d0=a41_0x4181,_0x5d0c9b=_0x40507e();while(!![]){try{const _0x19557d=parseInt(_0x2f49d0(0x24c))/0x1*(parseInt(_0x2f49d0(0x242))/0x2)+parseInt(_0x2f49d0(0x27b))/0x3+parseInt(_0x2f49d0(0x24f))/0x4+parseInt(_0x2f49d0(0x234))/0x5*(parseInt(_0x2f49d0(0x244))/0x6)+parseInt(_0x2f49d0(0x1f2))/0x7*(parseInt(_0x2f49d0(0x266))/0x8)+-parseInt(_0x2f49d0(0x230))/0x9+-parseInt(_0x2f49d0(0x25d))/0xa;if(_0x19557d===_0x1acbfa)break;else _0x5d0c9b['push'](_0x5d0c9b['shift']());}catch(_0x2b4979){_0x5d0c9b['push'](_0x5d0c9b['shift']());}}}(a41_0x3607,0xc3e67));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_0x312bbc from'chalk';function a41_0x4181(_0x30aa56,_0x27ada7){_0x30aa56=_0x30aa56-0x1e6;const _0x3607db=a41_0x3607();let _0x41819b=_0x3607db[_0x30aa56];return _0x41819b;}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_0x3607(){const _0x2c130d=['/j/da/je','error','Scoped\x20to\x20folder:\x20','Delete\x20journey:','\x20created','targetDir','1438CCdDyU','attributes','786rghthq','cwd','helpText','\x20deleted','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','toCreate','\x20\x20Activations:','2045xpLRwC','\x0a✔\x20Push\x20complete','getJourney','4083100KEwKUs','Fetching\x20existing\x20activations...','dim','data','results','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','\x0aValidation\x20failed:','yamlConfig','folders','resolveParentId','then','join','errorCode','25221340RPYrFw','segment','Aborted.','nameToType','message','get','user','updated','\x20\x20🗺️\x20\x20Journeys:','968DBuAKX','execute','nameToId','journeysOnly','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','yellow','\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20','connection','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','existingSegment','verbose','map','Changes\x20to\x20journey:','deleted','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','push','parentSegment','journeyBundleName','getParent','journeys','\x20\x20\x20\x20','75864pAKYfz','Folders\x20to\x20create:','\x20YAML\x20files\x20found','all','getOutputSchemaWithCache','Fetching\x20connections\x20for\x20name\x20resolution...','repeat','journeyId','type','segments','diff','listActivations','\x20\x20📊\x20Segments:','listSegments','toDelete','no_parent','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','29421TNIzwb','activations','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','\x20\x20Source:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','idToName','state','createdSegmentIds','listFolders','journey','Push\x20','Preparing\x20journeys...','updatedAt','\x20\x20Segments:\x20','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','\x20changed','unchanged','green','parent_name','\x20to\x20update','\x20folders\x20to\x20create','cyan','set','length','\x20unchanged','Error:\x20','segment:push','/e/','list','new','/app/ps/','folderId','dryRun','\x20activations]','created','red','\x20to\x20create','segmentFolderId','existingJourney','/sb/da/esr','delete','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','description','parentName','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','versionNumber','Resolving\x20parent\x20segment\x20\x27','blue','filePath','file','\x20\x20Activations:\x20','createdAt','scopedFolderPath','setPhase','Error\x20parsing\x20YAML:\x20','\x20\x20Journeys:\x20','Delete\x20segment:','\x20new','endsWith','name','isNew','10831806CFFTzo','audienceId','Source\x20directory:\x20','Parent\x20segment:\x20','57370wGHpgr','.yml','📁\x20','segment\x20or\x20journey','New\x20journey:','folderPath','site','(Journey\x20will\x20be\x20deleted)'];a41_0x3607=function(){return _0x2c130d;};return a41_0x3607();}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_0x5a04ba(0x22e)]=a41_0x5a04ba(0x20d);[a41_0x5a04ba(0x21d)]=a41_0x5a04ba(0x26e);async[a41_0x5a04ba(0x267)](_0x510bf4){const _0x31b908=a41_0x5a04ba,{options:_0x66abf7,args:_0x34fc92,tdx:_0x45a644}=_0x510bf4,_0x153d82=_0x66abf7,_0x35fb5f=await resolveTarget({'arg':_0x34fc92[0x0],'contextParent':_0x66abf7[_0x31b908(0x276)],'cwd':process[_0x31b908(0x245)]()});if(!isSuccessfulResolution(_0x35fb5f))return _0x35fb5f[_0x31b908(0x25c)]===_0x31b908(0x1f0)?(console['error'](a41_0x312bbc[_0x31b908(0x26b)](_0x31b908(0x1f7))),console[_0x31b908(0x23d)](_0x31b908(0x254)),console['error'](_0x31b908(0x1f6)),console[_0x31b908(0x23d)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file')):(console['error'](a41_0x312bbc[_0x31b908(0x216)](_0x31b908(0x20c)+_0x35fb5f[_0x31b908(0x261)]+'\x0a')),_0x35fb5f[_0x31b908(0x246)]&&console[_0x31b908(0x23d)](a41_0x312bbc[_0x31b908(0x208)](_0x35fb5f['helpText']))),0x1;if(_0x35fb5f[_0x31b908(0x1e9)]===_0x31b908(0x205))return console['error'](a41_0x312bbc[_0x31b908(0x216)]('Error:\x20Directory\x20not\x20found:\x20'+_0x35fb5f[_0x31b908(0x241)]+'\x0a')),console[_0x31b908(0x23d)](a41_0x312bbc['cyan']('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;const _0xbc7b86=_0x35fb5f[_0x31b908(0x21e)],_0x3ad6bc=_0x35fb5f[_0x31b908(0x241)],_0x380a36=_0x35fb5f[_0x31b908(0x1e9)]===_0x31b908(0x224)?_0x35fb5f[_0x31b908(0x223)]:undefined,_0x2426b3=getScopedDetails(_0x35fb5f),_0xec9d0a=_0x2426b3?.['isScoped']??![],_0xbfa53b=_0x2426b3?.[_0x31b908(0x227)]??'';if(!existsSync(_0x3ad6bc))return console['error'](a41_0x312bbc['red']('Error:\x20Directory\x20not\x20found:\x20'+_0x3ad6bc+'\x0a')),console['error'](a41_0x312bbc[_0x31b908(0x208)](_0x31b908(0x201))),0x1;_0x153d82[_0x31b908(0x270)]&&(console[_0x31b908(0x23d)]('Site:\x20'+_0x153d82['site']),console[_0x31b908(0x23d)](_0x31b908(0x233)+_0xbc7b86),console[_0x31b908(0x23d)](_0x31b908(0x232)+_0x3ad6bc),_0xec9d0a&&console[_0x31b908(0x23d)](_0x31b908(0x23e)+_0xbfa53b));const _0x298f36=await withSpinner(_0x31b908(0x221)+_0xbc7b86+'\x27...',()=>_0x45a644[_0x31b908(0x25e)][_0x31b908(0x259)](_0xbc7b86),{'verbose':_0x153d82[_0x31b908(0x270)]}),_0x2fcce1=_0x298f36[_0x31b908(0x252)],{parentSegmentResult:_0x42f11f,segmentsResult:_0x554f02,foldersResult:_0x5cc2a7,journeysWithDetailsResult:_0x48305e,userMaps:_0x1709d9}=await withSpinner('Fetching\x20existing\x20data...',async()=>{const _0x471af3=_0x31b908,[_0x3119fe,_0x124103,_0x255b5c,_0xaa10ad,_0x57e146]=await Promise[_0x471af3(0x27e)]([_0x45a644[_0x471af3(0x25e)][_0x471af3(0x278)](_0x2fcce1),_0x45a644[_0x471af3(0x25e)][_0x471af3(0x1ee)](_0x2fcce1),_0x45a644[_0x471af3(0x25e)][_0x471af3(0x1fb)](_0x2fcce1),_0x45a644[_0x471af3(0x1fc)]['listJourneysWithDetailsFromParentSegment'](_0x2fcce1,{'includeAllVersions':!![]}),_0x45a644[_0x471af3(0x263)]['buildUserMaps']()]);return{'parentSegmentResult':_0x3119fe,'segmentsResult':_0x124103,'foldersResult':_0x255b5c,'journeysWithDetailsResult':_0xaa10ad,'userMaps':_0x57e146};},{'verbose':_0x153d82[_0x31b908(0x270)]})['then'](_0xfd927c=>_0xfd927c[_0x31b908(0x252)]),_0x14c082=_0x42f11f,_0x11324e=extractRootFolderId(_0x14c082),_0x59a0c0=_0x554f02,_0x1a56be=_0x5cc2a7,{journeys:_0x5613c1,activationStepsById:_0x582868}=_0x48305e,_0x4cf829=new Map(_0x5613c1['map'](_0x2559ae=>[_0x2559ae['id'],_0x2559ae])),_0x59d854=_0x5613c1[_0x31b908(0x271)](_0x610c9f=>({'id':_0x610c9f['id'],'name':_0x610c9f[_0x31b908(0x243)][_0x31b908(0x22e)],'journeyBundleName':_0x610c9f[_0x31b908(0x243)][_0x31b908(0x277)]||'','journeyBundleId':_0x610c9f[_0x31b908(0x243)]['journeyBundleId']||'','versionNumber':_0x610c9f['attributes'][_0x31b908(0x220)],'description':_0x610c9f[_0x31b908(0x243)][_0x31b908(0x21d)],'state':_0x610c9f[_0x31b908(0x243)][_0x31b908(0x1f9)],'paused':_0x610c9f[_0x31b908(0x243)]['paused'],'audienceId':_0x610c9f['attributes'][_0x31b908(0x231)],'folderId':_0x610c9f['relationships']?.['parentFolder']?.[_0x31b908(0x252)]?.['id'],'createdAt':_0x610c9f['attributes'][_0x31b908(0x226)],'updatedAt':_0x610c9f[_0x31b908(0x243)][_0x31b908(0x1ff)]})),{emailToId:_0x1dac79,idToEmail:_0x4c14fc}=_0x1709d9,_0x18b796=await withSpinner(_0x31b908(0x1e6),async()=>{const _0x5e054b=_0x31b908,_0x519c72=await _0x45a644[_0x5e054b(0x26d)][_0x5e054b(0x20f)]();return buildConnectionMaps(_0x519c72);},{'verbose':_0x153d82[_0x31b908(0x270)]})[_0x31b908(0x25a)](_0x4764c3=>_0x4764c3[_0x31b908(0x252)]),_0x2f2a5a=_0x18b796[_0x31b908(0x268)],_0x2e58f9=_0x18b796['idToName'],_0x2d0048=_0x18b796[_0x31b908(0x260)],_0x8b0117={'emailToIdMap':_0x1dac79,'connectionNameToIdMap':_0x2f2a5a,'connectionNameToTypeMap':_0x2d0048,'getSchema':_0x2e2a9e=>_0x45a644[_0x31b908(0x26d)][_0x31b908(0x27f)](_0x2e2a9e)};let {pathToId:_0x30579b,idToPath:_0x5db280}=buildFolderMaps(_0x1a56be);const _0x350dd4=buildSegmentLookupMap(_0x59a0c0,_0x5db280),_0xf5cc2e=buildSegmentNameToIdMap(_0x59a0c0),_0xca5fa=buildJourneyBundleLookupMap(_0x59d854,_0x5db280);let _0x2b0cb7;if(_0x380a36){if(!_0x380a36['endsWith'](_0x31b908(0x235))&&!_0x380a36[_0x31b908(0x22d)]('.yaml'))return console[_0x31b908(0x23d)](a41_0x312bbc[_0x31b908(0x216)](_0x31b908(0x274)+_0x380a36+'\x0a')),0x1;_0x2b0cb7=[_0x380a36];}else _0x2b0cb7=findYamlFiles(_0x3ad6bc);if(_0x2b0cb7['length']===0x0)return console[_0x31b908(0x23d)](a41_0x312bbc['red'](_0x31b908(0x1f1)+_0x3ad6bc+'\x0a')),console[_0x31b908(0x23d)](a41_0x312bbc['cyan'](_0x31b908(0x21c))),0x1;let _0x3a8858,_0x2bb3ff;try{const _0x25044d=parseAndClassifyYamlFiles(_0x2b0cb7,_0x3ad6bc,{'skipSegments':_0x153d82['journeysOnly']});_0x3a8858=_0x25044d[_0x31b908(0x1ea)],_0x2bb3ff=_0x25044d[_0x31b908(0x279)];const _0xa25bce=validateParsedFiles(_0x25044d,_0x3ad6bc);if(_0xa25bce[_0x31b908(0x20a)]>0x0)return console[_0x31b908(0x23d)](a41_0x312bbc['red'](_0x31b908(0x256))),console[_0x31b908(0x23d)](formatValidationErrors(_0xa25bce)),console[_0x31b908(0x23d)](a41_0x312bbc[_0x31b908(0x26b)](_0x31b908(0x21f))),0x1;}catch(_0x48dad4){return console[_0x31b908(0x23d)](a41_0x312bbc['red'](_0x31b908(0x229)+(_0x48dad4 instanceof Error?_0x48dad4[_0x31b908(0x261)]:_0x48dad4))),0x1;}if(_0x3a8858[_0x31b908(0x20a)]===0x0&&_0x2bb3ff['length']===0x0){const _0x30ac7f=_0x153d82[_0x31b908(0x269)]?_0x31b908(0x1fc):_0x31b908(0x237);return console[_0x31b908(0x23d)](a41_0x312bbc['yellow']('No\x20'+_0x30ac7f+_0x31b908(0x27d))),0x0;}const _0x33e2e7=new Map();_0x59a0c0[_0x31b908(0x20a)]>0x0&&!_0x153d82[_0x31b908(0x269)]&&await withSpinner(_0x31b908(0x250),async()=>{await batchAsync(_0x59a0c0,async _0x581256=>{const _0x11922b=a41_0x4181,_0x4a8847=await _0x45a644[_0x11922b(0x25e)][_0x11922b(0x1ec)](_0x2fcce1,_0x581256['id']);_0x33e2e7[_0x11922b(0x209)](_0x581256['id'],_0x4a8847);});},{'verbose':_0x153d82[_0x31b908(0x270)]});const {segmentFiles:_0x1e806c,foldersToCreate:_0x4e9edf}=await prepareSegmentFiles(_0x3a8858,{'segmentByFolderAndName':_0x350dd4,'activationsBySegmentId':_0x33e2e7,'folderPathToId':_0x30579b,'idToEmailMap':_0x4c14fc,'connectionIdToNameMap':_0x2e58f9},_0x8b0117,_0xec9d0a,_0xbfa53b),_0x167bf6=_0x380a36?[]:findSegmentsToDelete(_0x59a0c0,_0x3a8858[_0x31b908(0x271)](({yamlConfig:_0x1bdebb,folderPath:_0x1c1e89})=>({'yamlConfig':_0x1bdebb,'folderPath':resolveTDFolderPath(_0x1c1e89,_0xec9d0a,_0xbfa53b)})),_0x5db280,_0xbfa53b,_0xec9d0a),{journeyFiles:_0x19a6f2,foldersToCreate:_0x1b4a1a}=await withProgressSpinner(_0x31b908(0x1fe),async _0x4d85e3=>prepareJourneyFiles(_0x2bb3ff,{'fetchJourney':async _0x416538=>_0x45a644[_0x31b908(0x1fc)][_0x31b908(0x24e)](_0x416538[_0x31b908(0x1e8)]),'journeyBundlesByFolderAndName':_0xca5fa,'folderPathToId':_0x30579b,'idToEmailMap':_0x4c14fc,'connectionIdToNameMap':_0x2e58f9,'existingSegments':_0x59a0c0,'parentId':_0x2fcce1,'deps':_0x45a644,'progress':{'update':_0x56fd88=>{const _0x5de819=_0x31b908;_0x4d85e3[_0x5de819(0x228)](_0x56fd88),_0x153d82[_0x5de819(0x270)]&&console[_0x5de819(0x23d)]('\x20\x20'+_0x56fd88);}},'journeyById':_0x4cf829,'activationStepsById':_0x582868},_0xec9d0a,_0xbfa53b),{'verbose':_0x153d82[_0x31b908(0x270)]})[_0x31b908(0x25a)](_0x547201=>_0x547201[_0x31b908(0x252)]);for(const _0x1b201b of _0x1b4a1a){_0x4e9edf['add'](_0x1b201b);}const _0xffe984=_0x380a36?[]:findJourneysToDelete(_0x59d854,_0x2bb3ff[_0x31b908(0x271)](({yamlConfig:_0x70a84b,folderPath:_0x3f2d48})=>({'yamlConfig':_0x70a84b,'folderPath':resolveTDFolderPath(_0x3f2d48,_0xec9d0a,_0xbfa53b)})),_0x5db280,_0xbfa53b,_0xec9d0a),_0x4b8b5e=calculatePushStats(_0x1e806c,_0x19a6f2,_0x4e9edf,_0x167bf6,_0xffe984,!!_0x153d82[_0x31b908(0x21b)],!!_0x153d82['journeysOnly']),_0x4ab084=_0x4b8b5e['segments'][_0x31b908(0x210)],_0x43ea71=_0x4b8b5e[_0x31b908(0x1ea)]['changed'],_0x4b721c=_0x4b8b5e[_0x31b908(0x1ea)][_0x31b908(0x203)],_0x363cbf=_0x4b8b5e[_0x31b908(0x1ea)][_0x31b908(0x1ef)],_0x52e8dc=_0x4b8b5e[_0x31b908(0x258)][_0x31b908(0x24a)],_0xc3cf4=_0x4b8b5e['journeys'][_0x31b908(0x210)],_0xf7295b=_0x4b8b5e[_0x31b908(0x279)]['changed'],_0xf445ad=_0x4b8b5e[_0x31b908(0x279)][_0x31b908(0x203)],_0x41ae0b=_0x4b8b5e[_0x31b908(0x279)][_0x31b908(0x1ef)],_0x428bdb=_0x4b8b5e[_0x31b908(0x1f3)][_0x31b908(0x27e)],_0x285724=_0x4b8b5e[_0x31b908(0x1f3)][_0x31b908(0x24a)],_0x35ca90=_0x4b8b5e[_0x31b908(0x1f3)]['toUpdate'],_0x4ae339=_0x4b8b5e['activations'][_0x31b908(0x1ef)];console[_0x31b908(0x23d)]('\x0aPush\x20summary\x20for\x20\x27'+_0xbc7b86+'\x27:');_0x52e8dc[_0x31b908(0x20a)]>0x0&&console[_0x31b908(0x23d)]('\x20\x20'+a41_0x312bbc[_0x31b908(0x222)](_0x31b908(0x236)+_0x52e8dc['length']+_0x31b908(0x207)));if(!_0x153d82[_0x31b908(0x269)]){console[_0x31b908(0x23d)](_0x31b908(0x1ed)),console['error'](_0x31b908(0x27a)+a41_0x312bbc[_0x31b908(0x204)]('+\x20'+_0x4ab084[_0x31b908(0x20a)]+_0x31b908(0x22c))),console['error']('\x20\x20\x20\x20'+a41_0x312bbc[_0x31b908(0x26b)]('~\x20'+_0x43ea71[_0x31b908(0x20a)]+_0x31b908(0x202)));if(_0x363cbf[_0x31b908(0x20a)]>0x0)console['error']('\x20\x20\x20\x20'+a41_0x312bbc[_0x31b908(0x216)]('-\x20'+_0x363cbf[_0x31b908(0x20a)]+'\x20to\x20delete'));else _0x167bf6[_0x31b908(0x20a)]>0x0&&!_0x153d82[_0x31b908(0x21b)]&&console[_0x31b908(0x23d)](_0x31b908(0x27a)+a41_0x312bbc[_0x31b908(0x251)](_0x167bf6[_0x31b908(0x20a)]+_0x31b908(0x1f4)));console[_0x31b908(0x23d)](_0x31b908(0x27a)+a41_0x312bbc['dim']('=\x20'+_0x4b721c[_0x31b908(0x20a)]+'\x20unchanged'));}if(_0x19a6f2[_0x31b908(0x20a)]>0x0||_0xffe984[_0x31b908(0x20a)]>0x0){console[_0x31b908(0x23d)](_0x31b908(0x265)),console[_0x31b908(0x23d)](_0x31b908(0x27a)+a41_0x312bbc[_0x31b908(0x204)]('+\x20'+_0xc3cf4[_0x31b908(0x20a)]+_0x31b908(0x22c))),console[_0x31b908(0x23d)](_0x31b908(0x27a)+a41_0x312bbc[_0x31b908(0x26b)]('~\x20'+_0xf7295b[_0x31b908(0x20a)]+_0x31b908(0x202)));if(_0x41ae0b['length']>0x0)console[_0x31b908(0x23d)](_0x31b908(0x27a)+a41_0x312bbc['red']('-\x20'+_0x41ae0b[_0x31b908(0x20a)]+'\x20to\x20delete'));else _0xffe984['length']>0x0&&!_0x153d82[_0x31b908(0x21b)]&&console[_0x31b908(0x23d)]('\x20\x20\x20\x20'+a41_0x312bbc[_0x31b908(0x251)](_0xffe984[_0x31b908(0x20a)]+'\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)'));console['error'](_0x31b908(0x27a)+a41_0x312bbc[_0x31b908(0x251)]('=\x20'+_0xf445ad[_0x31b908(0x20a)]+_0x31b908(0x20b)));}_0x428bdb['length']>0x0&&!_0x153d82[_0x31b908(0x269)]&&(console[_0x31b908(0x23d)](''),console['error'](_0x31b908(0x24b)),_0x285724[_0x31b908(0x20a)]>0x0&&console[_0x31b908(0x23d)]('\x20\x20\x20\x20'+a41_0x312bbc['green']('+\x20'+_0x285724[_0x31b908(0x20a)]+_0x31b908(0x217))),_0x35ca90[_0x31b908(0x20a)]>0x0&&console['error'](_0x31b908(0x27a)+a41_0x312bbc[_0x31b908(0x26b)]('~\x20'+_0x35ca90[_0x31b908(0x20a)]+_0x31b908(0x206))),_0x4ae339[_0x31b908(0x20a)]>0x0&&console[_0x31b908(0x23d)]('\x20\x20\x20\x20'+a41_0x312bbc['red']('-\x20'+_0x4ae339[_0x31b908(0x20a)]+'\x20to\x20delete')));console[_0x31b908(0x23d)](_0x31b908(0x1f5)+a41_0x312bbc[_0x31b908(0x208)](_0x3ad6bc)+'\x0a');if(_0x52e8dc[_0x31b908(0x20a)]>0x0){console[_0x31b908(0x23d)](_0x31b908(0x27c));for(const _0x1d3153 of _0x52e8dc){console[_0x31b908(0x23d)]('\x20\x20'+a41_0x312bbc['blue']('+')+'\x20'+_0x1d3153);}console['error']('');}if(_0x4ab084[_0x31b908(0x20a)]>0x0&&!_0x153d82[_0x31b908(0x269)])for(const _0x4f16ee of _0x4ab084){const _0x8d7f62=_0x4f16ee['folderPath']?_0x4f16ee[_0x31b908(0x239)]+'/'+_0x4f16ee[_0x31b908(0x257)]['name']:_0x4f16ee['yamlConfig']['name'],_0x292383=_0x4f16ee[_0x31b908(0x257)]['activations']?.[_0x31b908(0x20a)]||0x0,_0x5c2038=_0x292383>0x0?a41_0x312bbc[_0x31b908(0x251)]('\x20['+_0x292383+_0x31b908(0x214)):'';console[_0x31b908(0x23d)]('\x0a'+a41_0x312bbc['green']('New\x20segment:')+'\x20'+_0x8d7f62+_0x5c2038),console[_0x31b908(0x23d)]('─'[_0x31b908(0x1e7)](0x3c)),_0x4f16ee[_0x31b908(0x1eb)]&&console[_0x31b908(0x23d)](_0x4f16ee[_0x31b908(0x1eb)]),console['error']('─'[_0x31b908(0x1e7)](0x3c));}if(_0x363cbf[_0x31b908(0x20a)]>0x0&&!_0x153d82['journeysOnly'])for(const _0x2b5c02 of _0x363cbf){const _0x110f50=_0x2b5c02[_0x31b908(0x218)]?_0x5db280[_0x31b908(0x262)](_0x2b5c02[_0x31b908(0x218)]['toString']())||'':'',_0x14a3ab=_0x110f50?_0x110f50+'/'+_0x2b5c02[_0x31b908(0x22e)]:_0x2b5c02['name'],_0xa8a079=_0x33e2e7[_0x31b908(0x262)](_0x2b5c02['id'])||[],_0x27b89d=_0xa8a079[_0x31b908(0x20a)]>0x0?a41_0x312bbc[_0x31b908(0x251)]('\x20['+_0xa8a079[_0x31b908(0x20a)]+_0x31b908(0x214)):'';console['error']('\x0a'+a41_0x312bbc['red'](_0x31b908(0x22b))+'\x20'+_0x14a3ab+_0x27b89d),console[_0x31b908(0x23d)]('─'[_0x31b908(0x1e7)](0x3c));const _0x33e446=segmentWithActivationsToYaml(_0x2b5c02,_0xa8a079,undefined,_0x4c14fc,_0x2e58f9),_0x2ba379=segmentToYamlString(_0x33e446),_0x4a9ef1=generateDiff(_0x2ba379,'');console[_0x31b908(0x23d)](formatDiffWithColors(_0x4a9ef1)),console[_0x31b908(0x23d)]('─'[_0x31b908(0x1e7)](0x3c));}const _0x158f95=_0x1e806c['filter'](_0x45a9e9=>!_0x45a9e9[_0x31b908(0x22f)]&&_0x45a9e9['diff']);if(_0x158f95[_0x31b908(0x20a)]>0x0&&!_0x153d82[_0x31b908(0x269)])for(const _0x36ff85 of _0x158f95){const _0x28772e=_0x36ff85[_0x31b908(0x239)]?_0x36ff85['folderPath']+'/'+_0x36ff85[_0x31b908(0x257)]['name']:_0x36ff85['yamlConfig'][_0x31b908(0x22e)];console['error']('\x0a'+a41_0x312bbc[_0x31b908(0x26b)]('Changes\x20to:')+'\x20'+_0x28772e),console[_0x31b908(0x23d)]('─'[_0x31b908(0x1e7)](0x3c)),console['error'](_0x36ff85[_0x31b908(0x1eb)]),console[_0x31b908(0x23d)]('─'[_0x31b908(0x1e7)](0x3c));}if(_0xc3cf4[_0x31b908(0x20a)]>0x0)for(const _0x54ac35 of _0xc3cf4){const _0x4412f6=_0x54ac35[_0x31b908(0x239)]?_0x54ac35[_0x31b908(0x239)]+'/'+_0x54ac35[_0x31b908(0x257)][_0x31b908(0x22e)]:_0x54ac35[_0x31b908(0x257)][_0x31b908(0x22e)];console[_0x31b908(0x23d)]('\x0a'+a41_0x312bbc[_0x31b908(0x204)](_0x31b908(0x238))+'\x20'+_0x4412f6),console[_0x31b908(0x23d)]('─'[_0x31b908(0x1e7)](0x3c)),_0x54ac35[_0x31b908(0x1eb)]&&console[_0x31b908(0x23d)](_0x54ac35[_0x31b908(0x1eb)]),console[_0x31b908(0x23d)]('─'[_0x31b908(0x1e7)](0x3c));}const _0xdc9fb0=_0x19a6f2['filter'](_0x4938f7=>!_0x4938f7['isNew']&&_0x4938f7[_0x31b908(0x1eb)]);if(_0xdc9fb0[_0x31b908(0x20a)]>0x0)for(const _0x33e14d of _0xdc9fb0){const _0x1fa0f9=_0x33e14d[_0x31b908(0x239)]?_0x33e14d[_0x31b908(0x239)]+'/'+_0x33e14d[_0x31b908(0x257)][_0x31b908(0x22e)]:_0x33e14d[_0x31b908(0x257)][_0x31b908(0x22e)];console[_0x31b908(0x23d)]('\x0a'+a41_0x312bbc['yellow'](_0x31b908(0x272))+'\x20'+_0x1fa0f9),console['error']('─'['repeat'](0x3c)),console[_0x31b908(0x23d)](_0x33e14d[_0x31b908(0x1eb)]),console[_0x31b908(0x23d)]('─'['repeat'](0x3c));}if(_0x41ae0b[_0x31b908(0x20a)]>0x0)for(const _0x407ebf of _0x41ae0b){const _0x28f11d=_0x407ebf[_0x31b908(0x212)]?_0x5db280['get'](_0x407ebf[_0x31b908(0x212)])||'':'',_0xca2db2=_0x28f11d?_0x28f11d+'/'+_0x407ebf[_0x31b908(0x277)]:_0x407ebf[_0x31b908(0x277)];console[_0x31b908(0x23d)]('\x0a'+a41_0x312bbc['red'](_0x31b908(0x23f))+'\x20'+_0xca2db2),console[_0x31b908(0x23d)]('─'[_0x31b908(0x1e7)](0x3c)),console['error'](a41_0x312bbc[_0x31b908(0x216)](_0x31b908(0x23b))),console[_0x31b908(0x23d)]('─'[_0x31b908(0x1e7)](0x3c));}if(_0x153d82[_0x31b908(0x213)])return console[_0x31b908(0x23d)](a41_0x312bbc[_0x31b908(0x26b)](_0x31b908(0x249))),0x0;const _0x1a06e6=_0x153d82['journeysOnly']?![]:_0x4ab084['length']>0x0||_0x43ea71[_0x31b908(0x20a)]>0x0||_0x363cbf[_0x31b908(0x20a)]>0x0,_0x58679a=_0xc3cf4[_0x31b908(0x20a)]>0x0||_0xf7295b[_0x31b908(0x20a)]>0x0||_0x41ae0b[_0x31b908(0x20a)]>0x0,_0xbefc7f=_0x153d82['journeysOnly']?![]:_0x428bdb[_0x31b908(0x20a)]>0x0,_0x263bc2=_0x52e8dc[_0x31b908(0x20a)]>0x0;if(!_0x1a06e6&&!_0x58679a&&!_0xbefc7f&&!_0x263bc2){const _0x358fea=_0x153d82[_0x31b908(0x269)]?'✔\x20All\x20journeys\x20are\x20up\x20to\x20date':'✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date';console['error'](a41_0x312bbc[_0x31b908(0x204)](_0x358fea));if(_0x380a36&&_0x4b721c[_0x31b908(0x20a)]===0x1){const _0x329864=_0x4b721c[0x0];if(_0x329864['existingSegment']?.['id']){const _0x28543a=getConsoleNextUrl(_0x153d82[_0x31b908(0x23a)],_0x31b908(0x211)+_0x2fcce1+_0x31b908(0x20e)+_0x329864[_0x31b908(0x26f)]['id']+_0x31b908(0x21a));console[_0x31b908(0x23d)]('\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20'+a41_0x312bbc[_0x31b908(0x208)](_0x28543a));}}if(_0x380a36&&_0xf445ad[_0x31b908(0x20a)]===0x1){const _0x1899d7=_0xf445ad[0x0];if(_0x1899d7[_0x31b908(0x219)]?.['id']){const _0x3b87a6=getConsoleNextUrl(_0x153d82['site'],_0x31b908(0x211)+_0x2fcce1+_0x31b908(0x20e)+_0x1899d7[_0x31b908(0x219)]['id']+_0x31b908(0x23c));console[_0x31b908(0x23d)]('\x20\x20'+a41_0x312bbc[_0x31b908(0x208)](_0x3b87a6));}}return 0x0;}const _0x1ab30c=_0x153d82[_0x31b908(0x269)]?_0xc3cf4[_0x31b908(0x20a)]+_0xf7295b[_0x31b908(0x20a)]+_0x41ae0b['length']+_0x52e8dc[_0x31b908(0x20a)]:_0x4ab084[_0x31b908(0x20a)]+_0x43ea71[_0x31b908(0x20a)]+_0x363cbf['length']+_0xc3cf4[_0x31b908(0x20a)]+_0xf7295b[_0x31b908(0x20a)]+_0x41ae0b['length']+_0x52e8dc['length']+_0x428bdb[_0x31b908(0x20a)];if(!_0x153d82['yes']&&_0x1ab30c>0x0){if(!isInteractive())return console['error'](a41_0x312bbc['red']('\x0aError:'),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x31b908(0x23d)](a41_0x312bbc[_0x31b908(0x251)](_0x31b908(0x26a))),0x1;const _0x375a06=await confirmKey(_0x31b908(0x1fd)+_0x1ab30c+'\x20changes?');if(!_0x375a06)return console[_0x31b908(0x23d)](a41_0x312bbc['yellow'](_0x31b908(0x25f))),0x1;}const _0x482143={'withProgress':async(_0x1df80d,_0x20c7d9)=>{const _0x58c1d8=_0x31b908,_0x553a56=await withSpinner(_0x1df80d,_0x20c7d9,{'verbose':_0x153d82[_0x58c1d8(0x270)]});return{'data':_0x553a56[_0x58c1d8(0x252)]};},'logInfo':_0x33f31f=>console['error'](a41_0x312bbc[_0x31b908(0x222)]('✔\x20'+_0x33f31f)),'logSuccess':_0x4d174=>console['error'](a41_0x312bbc[_0x31b908(0x204)]('✔\x20'+_0x4d174)),'logWarning':_0x39852b=>console[_0x31b908(0x23d)](a41_0x312bbc[_0x31b908(0x26b)]('⚠\x20'+_0x39852b)),'logDeleted':_0x1ef5e5=>console[_0x31b908(0x23d)](a41_0x312bbc['red']('✔\x20'+_0x1ef5e5))},_0x111ae1={'segment':_0x45a644[_0x31b908(0x25e)],'journey':_0x45a644[_0x31b908(0x1fc)],'user':_0x45a644[_0x31b908(0x263)],'connection':_0x45a644[_0x31b908(0x26d)]};_0x52e8dc[_0x31b908(0x20a)]>0x0&&(_0x30579b=await executePushFolders(_0x111ae1,_0x52e8dc,_0x30579b,{'parentId':_0x2fcce1},_0x482143));const _0x58ee85={'rootFolderId':_0x11324e,'folderPathToId':_0x30579b,'folderIdToPath':_0x5db280,'segmentNameToId':_0xf5cc2e,'activationsBySegmentId':_0x33e2e7,'emailToIdMap':_0x1dac79,'idToEmailMap':_0x4c14fc,'connectionNameToIdMap':_0x18b796[_0x31b908(0x268)],'connectionIdToNameMap':_0x18b796[_0x31b908(0x1f8)],'connectionNameToTypeMap':_0x2d0048},_0x25f1ba=await executePushSegments(_0x111ae1,_0x153d82[_0x31b908(0x269)]?[]:_0x1e806c,_0x58ee85,{'parentId':_0x2fcce1},_0x482143),_0x2a5d02=_0x25f1ba[_0x31b908(0x215)],_0x58e8ac=_0x25f1ba[_0x31b908(0x264)],_0xf19a93=_0x25f1ba[_0x31b908(0x1f3)][_0x31b908(0x215)],_0x402a0e=_0x25f1ba[_0x31b908(0x1f3)][_0x31b908(0x264)],_0x7ecbbb=_0x25f1ba[_0x31b908(0x1f3)][_0x31b908(0x273)];let _0x91529;if(_0x380a36&&_0x1e806c[_0x31b908(0x20a)]===0x1){const _0x5566cf=_0x1e806c[0x0];_0x91529=_0x5566cf[_0x31b908(0x26f)]?.['id']??_0x25f1ba[_0x31b908(0x1fa)]['get'](_0x5566cf[_0x31b908(0x257)]['name']);}const _0x364f19=await executePushSegmentDeletions(_0x111ae1,_0x153d82['journeysOnly']?[]:_0x363cbf,_0x482143);let _0x4eb5e5=0x0,_0x27441f=0x0,_0x5342f9=0x0;const _0xc9bd16=new Map(_0xf5cc2e);for(const [_0x586320,_0x349480]of _0x25f1ba[_0x31b908(0x1fa)]){_0xc9bd16[_0x31b908(0x209)](_0x586320,_0x349480);}if(_0x19a6f2[_0x31b908(0x20a)]>0x0){const _0x275948={..._0x58ee85,'segmentNameToId':_0xc9bd16,'existingSegments':_0x59a0c0,'activationContext':_0x8b0117},_0x4c9704=await executePushJourneys(_0x111ae1,_0x19a6f2,_0x275948,{'parentId':_0x2fcce1,'rootFolderId':_0x11324e,'verbose':_0x153d82[_0x31b908(0x270)]},_0x482143);_0x4eb5e5=_0x4c9704[_0x31b908(0x215)],_0x27441f=_0x4c9704[_0x31b908(0x264)];if(_0x380a36&&_0x4c9704[_0x31b908(0x253)][_0x31b908(0x20a)]===0x1){const _0x4f7050=_0x4c9704['results'][0x0];if(_0x4f7050[_0x31b908(0x1e8)]){const _0x4d3855=getConsoleNextUrl(_0x153d82['site'],'/app/ps/'+_0x2fcce1+_0x31b908(0x20e)+_0x4f7050[_0x31b908(0x1e8)]+_0x31b908(0x23c));console[_0x31b908(0x23d)]('\x20\x20'+a41_0x312bbc[_0x31b908(0x208)](_0x4d3855));}}}for(const _0x38f734 of _0x41ae0b){console['error'](a41_0x312bbc[_0x31b908(0x26b)](_0x31b908(0x248)+_0x38f734[_0x31b908(0x277)])),_0x5342f9++;}const _0x9212f2=[];if(_0x2a5d02>0x0)_0x9212f2['push'](_0x2a5d02+_0x31b908(0x240));if(_0x58e8ac>0x0)_0x9212f2[_0x31b908(0x275)](_0x58e8ac+_0x31b908(0x255));if(_0x364f19>0x0)_0x9212f2['push'](_0x364f19+'\x20deleted');const _0x568e81=[];if(_0x4eb5e5>0x0)_0x568e81['push'](_0x4eb5e5+'\x20created');if(_0x27441f>0x0)_0x568e81[_0x31b908(0x275)](_0x27441f+_0x31b908(0x255));if(_0x5342f9>0x0)_0x568e81[_0x31b908(0x275)](_0x5342f9+_0x31b908(0x247));const _0x3cda17=[];if(_0xf19a93>0x0)_0x3cda17[_0x31b908(0x275)](_0xf19a93+_0x31b908(0x240));if(_0x402a0e>0x0)_0x3cda17[_0x31b908(0x275)](_0x402a0e+_0x31b908(0x255));if(_0x7ecbbb>0x0)_0x3cda17[_0x31b908(0x275)](_0x7ecbbb+'\x20deleted');console['error'](a41_0x312bbc[_0x31b908(0x204)](_0x31b908(0x24d)));_0x9212f2['length']>0x0&&!_0x153d82[_0x31b908(0x269)]&&console[_0x31b908(0x23d)](_0x31b908(0x200)+_0x9212f2[_0x31b908(0x25b)](',\x20'));_0x568e81[_0x31b908(0x20a)]>0x0&&console[_0x31b908(0x23d)](_0x31b908(0x22a)+_0x568e81[_0x31b908(0x25b)](',\x20'));_0x3cda17[_0x31b908(0x20a)]>0x0&&!_0x153d82[_0x31b908(0x269)]&&console[_0x31b908(0x23d)](_0x31b908(0x225)+_0x3cda17['join'](',\x20'));if(_0x91529){const _0xfc3fe0=getConsoleNextUrl(_0x153d82[_0x31b908(0x23a)],_0x31b908(0x211)+_0x2fcce1+_0x31b908(0x20e)+_0x91529+'/sb/da/esr');console['error'](_0x31b908(0x26c)+a41_0x312bbc['cyan'](_0xfc3fe0));}return 0x0;}}
1
+ function a41_0x1c44(){const _0x1cdc76=['Delete\x20journey:','created','238937ZXfDOl','name','createdAt','list','push','nameToType','\x0aPush\x20summary\x20for\x20\x27','toCreate','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','updated','Error\x20parsing\x20YAML:\x20','getJourney','20MgDNtY','paused','dim','relationships','✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','Source\x20directory:\x20','existingJourney','folderId','/e/','\x0a✔\x20Push\x20complete','createdSegmentIds','\x20unchanged','resolveParentId','📁\x20','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','Scoped\x20to\x20folder:\x20','\x20YAML\x20files\x20found','\x20\x20\x20\x20','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','versionNumber','\x0aValidation\x20failed:','folderPath','736169pMamar','5925OcKtXm','no_parent','journey','\x20updated','segment:push','activations','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','\x20\x20Activations:','/sb/da/esr','description','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','unchanged','idToName','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','red','length','yes','join','\x20folders\x20to\x20create','dryRun','\x20to\x20create','\x27...','cyan','folders','(Journey\x20will\x20be\x20deleted)','/app/ps/','768GneyTr','existingSegment','parentFolder','Parent\x20segment:\x20','data','Changes\x20to\x20journey:','\x20activations]','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20','No\x20','diff','isScoped','errorCode','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)','user','toDelete','delete','set','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','site','.yml','audienceId','journeys','green','segmentFolderId','targetDir','filter','new','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','repeat','listJourneysWithDetailsFromParentSegment','1936701uePLDf','Fetching\x20existing\x20data...','\x20\x20Journeys:\x20','Delete\x20segment:','Resolving\x20parent\x20segment\x20\x27','\x20created','/j/da/je','verbose','changed','\x20changed','then','toString','yellow','isNew','\x20\x20🗺️\x20\x20Journeys:','2qvRFnp','journeyBundleId','Error:\x20','Site:\x20','\x0aError:','segment','toUpdate','journeyId','275368bSZwgs','message','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file','get','cwd','journeyBundleName','\x20new','440202KHPMQr','\x20deleted','yamlConfig','\x20\x20Activations:\x20','helpText','155898BQoGun','Fetching\x20connections\x20for\x20name\x20resolution...','file','journeysOnly','nameToId','parentName','blue','endsWith','attributes','connection','New\x20segment:','segments','updatedAt','add','getOutputSchemaWithCache','listSegments','type','all','parentSegment','deleted','.yaml','execute','✔\x20All\x20journeys\x20are\x20up\x20to\x20date','\x20changes?','error','parent_name','map','results'];a41_0x1c44=function(){return _0x1cdc76;};return a41_0x1c44();}const a41_0x371069=a41_0x13ea;(function(_0x2f96b5,_0x59c424){const _0x594831=a41_0x13ea,_0x16a64a=_0x2f96b5();while(!![]){try{const _0x27cedd=-parseInt(_0x594831(0x196))/0x1*(parseInt(_0x594831(0x164))/0x2)+-parseInt(_0x594831(0x173))/0x3+-parseInt(_0x594831(0x136))/0x4*(-parseInt(_0x594831(0x11c))/0x5)+-parseInt(_0x594831(0x178))/0x6+-parseInt(_0x594831(0x11b))/0x7+parseInt(_0x594831(0x16c))/0x8+-parseInt(_0x594831(0x155))/0x9*(-parseInt(_0x594831(0x104))/0xa);if(_0x27cedd===_0x59c424)break;else _0x16a64a['push'](_0x16a64a['shift']());}catch(_0x107fe3){_0x16a64a['push'](_0x16a64a['shift']());}}}(a41_0x1c44,0x2ad8a));import{BaseCommand}from'./command.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{generateDiff,formatDiffWithColors}from'../utils/diff.js';function a41_0x13ea(_0x5420f7,_0x205ba2){_0x5420f7=_0x5420f7-0x103;const _0x1c44a9=a41_0x1c44();let _0x13ea35=_0x1c44a9[_0x5420f7];return _0x13ea35;}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_0x1da7e8 from'chalk';import{existsSync}from'fs';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{resolveTarget,isSuccessfulResolution,getScopedDetails}from'../sdk/segment/target-resolution.js';import{buildFolderMaps}from'../sdk/segment/resolution-context.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{resolveTDFolderPath,findSegmentsToDelete,findJourneysToDelete,buildSegmentLookupMap,buildSegmentNameToIdMap,buildJourneyBundleLookupMap,parseAndClassifyYamlFiles,validateParsedFiles,formatValidationErrors,extractRootFolderId,buildConnectionMaps,calculatePushStats,prepareSegmentFiles,prepareJourneyFiles,executePushSegments,executePushFolders,executePushSegmentDeletions,executePushJourneys}from'../sdk/segment/push-workflow.js';export class SegmentPushCommand extends BaseCommand{[a41_0x371069(0x197)]=a41_0x371069(0x120);[a41_0x371069(0x125)]='Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments';async[a41_0x371069(0x18d)](_0x26d6ca){const _0x4d8171=a41_0x371069,{options:_0x6a884f,args:_0x84b618,tdx:_0xdb3b32}=_0x26d6ca,_0x16110a=_0x6a884f,_0x2c0b25=await resolveTarget({'arg':_0x84b618[0x0],'contextParent':_0x6a884f[_0x4d8171(0x18a)],'cwd':process[_0x4d8171(0x170)]()});if(!isSuccessfulResolution(_0x2c0b25))return _0x2c0b25[_0x4d8171(0x142)]===_0x4d8171(0x11d)?(console[_0x4d8171(0x190)](a41_0x1da7e8[_0x4d8171(0x161)](_0x4d8171(0x13d))),console['error'](_0x4d8171(0x143)),console[_0x4d8171(0x190)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent'),console[_0x4d8171(0x190)](_0x4d8171(0x16e))):(console[_0x4d8171(0x190)](a41_0x1da7e8[_0x4d8171(0x12a)](_0x4d8171(0x166)+_0x2c0b25[_0x4d8171(0x16d)]+'\x0a')),_0x2c0b25[_0x4d8171(0x177)]&&console[_0x4d8171(0x190)](a41_0x1da7e8[_0x4d8171(0x132)](_0x2c0b25['helpText']))),0x1;if(_0x2c0b25[_0x4d8171(0x188)]===_0x4d8171(0x191))return console[_0x4d8171(0x190)](a41_0x1da7e8[_0x4d8171(0x12a)]('Error:\x20Directory\x20not\x20found:\x20'+_0x2c0b25[_0x4d8171(0x14f)]+'\x0a')),console['error'](a41_0x1da7e8[_0x4d8171(0x132)](_0x4d8171(0x126))),0x1;const _0x35937d=_0x2c0b25[_0x4d8171(0x17d)],_0x238d59=_0x2c0b25[_0x4d8171(0x14f)],_0x285a8a=_0x2c0b25[_0x4d8171(0x188)]===_0x4d8171(0x17a)?_0x2c0b25['filePath']:undefined,_0x16f0a2=getScopedDetails(_0x2c0b25),_0x4ce003=_0x16f0a2?.[_0x4d8171(0x141)]??![],_0x53fd84=_0x16f0a2?.['scopedFolderPath']??'';if(!existsSync(_0x238d59))return console[_0x4d8171(0x190)](a41_0x1da7e8[_0x4d8171(0x12a)]('Error:\x20Directory\x20not\x20found:\x20'+_0x238d59+'\x0a')),console[_0x4d8171(0x190)](a41_0x1da7e8['cyan'](_0x4d8171(0x126))),0x1;_0x16110a[_0x4d8171(0x15c)]&&(console[_0x4d8171(0x190)](_0x4d8171(0x167)+_0x16110a[_0x4d8171(0x149)]),console[_0x4d8171(0x190)](_0x4d8171(0x139)+_0x35937d),console['error'](_0x4d8171(0x109)+_0x238d59),_0x4ce003&&console[_0x4d8171(0x190)](_0x4d8171(0x114)+_0x53fd84));const _0x2e65ea=await withSpinner(_0x4d8171(0x159)+_0x35937d+_0x4d8171(0x131),()=>_0xdb3b32[_0x4d8171(0x169)][_0x4d8171(0x110)](_0x35937d),{'verbose':_0x16110a['verbose']}),_0x4e0472=_0x2e65ea[_0x4d8171(0x13a)],{parentSegmentResult:_0x583fdf,segmentsResult:_0xd0c3ff,foldersResult:_0x147ee9,journeysWithDetailsResult:_0x183c45,userMaps:_0x40c8cc}=await withSpinner(_0x4d8171(0x156),async()=>{const _0x80a251=_0x4d8171,[_0x4ff010,_0x5238db,_0x5011eb,_0x3d0ca8,_0x4d3e29]=await Promise[_0x80a251(0x189)]([_0xdb3b32[_0x80a251(0x169)]['getParent'](_0x4e0472),_0xdb3b32['segment'][_0x80a251(0x187)](_0x4e0472),_0xdb3b32[_0x80a251(0x169)]['listFolders'](_0x4e0472),_0xdb3b32['journey'][_0x80a251(0x154)](_0x4e0472,{'includeAllVersions':!![]}),_0xdb3b32[_0x80a251(0x144)]['buildUserMaps']()]);return{'parentSegmentResult':_0x4ff010,'segmentsResult':_0x5238db,'foldersResult':_0x5011eb,'journeysWithDetailsResult':_0x3d0ca8,'userMaps':_0x4d3e29};},{'verbose':_0x16110a[_0x4d8171(0x15c)]})[_0x4d8171(0x15f)](_0x906c2e=>_0x906c2e[_0x4d8171(0x13a)]),_0x1cd807=_0x583fdf,_0x47327f=extractRootFolderId(_0x1cd807),_0x59fa00=_0xd0c3ff,_0x5da345=_0x147ee9,{journeys:_0x118ad9,activationStepsById:_0x5b9fbd}=_0x183c45,_0x4473a4=new Map(_0x118ad9[_0x4d8171(0x192)](_0xe328df=>[_0xe328df['id'],_0xe328df])),_0x20f990=_0x118ad9[_0x4d8171(0x192)](_0x12860b=>({'id':_0x12860b['id'],'name':_0x12860b[_0x4d8171(0x180)]['name'],'journeyBundleName':_0x12860b['attributes'][_0x4d8171(0x171)]||'','journeyBundleId':_0x12860b['attributes'][_0x4d8171(0x165)]||'','versionNumber':_0x12860b[_0x4d8171(0x180)][_0x4d8171(0x118)],'description':_0x12860b['attributes'][_0x4d8171(0x125)],'state':_0x12860b[_0x4d8171(0x180)]['state'],'paused':_0x12860b['attributes'][_0x4d8171(0x105)],'audienceId':_0x12860b[_0x4d8171(0x180)][_0x4d8171(0x14b)],'folderId':_0x12860b[_0x4d8171(0x107)]?.[_0x4d8171(0x138)]?.[_0x4d8171(0x13a)]?.['id'],'createdAt':_0x12860b[_0x4d8171(0x180)][_0x4d8171(0x198)],'updatedAt':_0x12860b[_0x4d8171(0x180)][_0x4d8171(0x184)]})),{emailToId:_0x2bf6cb,idToEmail:_0xbe1ec1}=_0x40c8cc,_0x4b8781=await withSpinner(_0x4d8171(0x179),async()=>{const _0x3d0e89=_0x4d8171,_0x2a8464=await _0xdb3b32[_0x3d0e89(0x181)][_0x3d0e89(0x199)]();return buildConnectionMaps(_0x2a8464);},{'verbose':_0x16110a['verbose']})['then'](_0x1c94b1=>_0x1c94b1[_0x4d8171(0x13a)]),_0x27d7cd=_0x4b8781[_0x4d8171(0x17c)],_0x3f5de4=_0x4b8781[_0x4d8171(0x128)],_0x2e66c5=_0x4b8781[_0x4d8171(0x19b)],_0x529bd6={'emailToIdMap':_0x2bf6cb,'connectionNameToIdMap':_0x27d7cd,'connectionNameToTypeMap':_0x2e66c5,'getSchema':_0x548b3b=>_0xdb3b32[_0x4d8171(0x181)][_0x4d8171(0x186)](_0x548b3b)};let {pathToId:_0x4dd412,idToPath:_0x543bd4}=buildFolderMaps(_0x5da345);const _0x1541c2=buildSegmentLookupMap(_0x59fa00,_0x543bd4),_0x54808d=buildSegmentNameToIdMap(_0x59fa00),_0x2ff4e1=buildJourneyBundleLookupMap(_0x20f990,_0x543bd4);let _0x5ae342;if(_0x285a8a){if(!_0x285a8a[_0x4d8171(0x17f)](_0x4d8171(0x14a))&&!_0x285a8a['endsWith'](_0x4d8171(0x18c)))return console[_0x4d8171(0x190)](a41_0x1da7e8['red']('Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20'+_0x285a8a+'\x0a')),0x1;_0x5ae342=[_0x285a8a];}else _0x5ae342=findYamlFiles(_0x238d59);if(_0x5ae342[_0x4d8171(0x12b)]===0x0)return console[_0x4d8171(0x190)](a41_0x1da7e8[_0x4d8171(0x12a)](_0x4d8171(0x148)+_0x238d59+'\x0a')),console[_0x4d8171(0x190)](a41_0x1da7e8[_0x4d8171(0x132)](_0x4d8171(0x152))),0x1;let _0x1554f0,_0x25ba01;try{const _0x612795=parseAndClassifyYamlFiles(_0x5ae342,_0x238d59,{'skipSegments':_0x16110a[_0x4d8171(0x17b)]});_0x1554f0=_0x612795[_0x4d8171(0x183)],_0x25ba01=_0x612795['journeys'];const _0x595a9f=validateParsedFiles(_0x612795,_0x238d59);if(_0x595a9f[_0x4d8171(0x12b)]>0x0)return console[_0x4d8171(0x190)](a41_0x1da7e8[_0x4d8171(0x12a)](_0x4d8171(0x119))),console[_0x4d8171(0x190)](formatValidationErrors(_0x595a9f)),console['error'](a41_0x1da7e8[_0x4d8171(0x161)](_0x4d8171(0x117))),0x1;}catch(_0x44d9e2){return console['error'](a41_0x1da7e8[_0x4d8171(0x12a)](_0x4d8171(0x1a0)+(_0x44d9e2 instanceof Error?_0x44d9e2[_0x4d8171(0x16d)]:_0x44d9e2))),0x1;}if(_0x1554f0[_0x4d8171(0x12b)]===0x0&&_0x25ba01[_0x4d8171(0x12b)]===0x0){const _0x2cf847=_0x16110a[_0x4d8171(0x17b)]?'journey':'segment\x20or\x20journey';return console[_0x4d8171(0x190)](a41_0x1da7e8[_0x4d8171(0x161)](_0x4d8171(0x13f)+_0x2cf847+_0x4d8171(0x115))),0x0;}const _0x577ef2=new Map();_0x59fa00[_0x4d8171(0x12b)]>0x0&&!_0x16110a[_0x4d8171(0x17b)]&&await withSpinner('Fetching\x20existing\x20activations...',async()=>{await batchAsync(_0x59fa00,async _0x3dd863=>{const _0x6957ab=a41_0x13ea,_0x3fb20b=await _0xdb3b32['segment']['listActivations'](_0x4e0472,_0x3dd863['id']);_0x577ef2[_0x6957ab(0x147)](_0x3dd863['id'],_0x3fb20b);});},{'verbose':_0x16110a[_0x4d8171(0x15c)]});const {segmentFiles:_0xf0b64a,foldersToCreate:_0x3f4451}=await prepareSegmentFiles(_0x1554f0,{'segmentByFolderAndName':_0x1541c2,'activationsBySegmentId':_0x577ef2,'folderPathToId':_0x4dd412,'idToEmailMap':_0xbe1ec1,'connectionIdToNameMap':_0x3f5de4},_0x529bd6,_0x4ce003,_0x53fd84),_0x466cc7=_0x285a8a?[]:findSegmentsToDelete(_0x59fa00,_0x1554f0[_0x4d8171(0x192)](({yamlConfig:_0x81f9dd,folderPath:_0x1d5715})=>({'yamlConfig':_0x81f9dd,'folderPath':resolveTDFolderPath(_0x1d5715,_0x4ce003,_0x53fd84)})),_0x543bd4,_0x53fd84,_0x4ce003),{journeyFiles:_0x34e40e,foldersToCreate:_0x2bfbc9}=await withProgressSpinner('Preparing\x20journeys...',async _0x5b9470=>prepareJourneyFiles(_0x25ba01,{'fetchJourney':async _0x246f73=>_0xdb3b32[_0x4d8171(0x11e)][_0x4d8171(0x103)](_0x246f73['journeyId']),'journeyBundlesByFolderAndName':_0x2ff4e1,'folderPathToId':_0x4dd412,'idToEmailMap':_0xbe1ec1,'connectionIdToNameMap':_0x3f5de4,'existingSegments':_0x59fa00,'parentId':_0x4e0472,'deps':_0xdb3b32,'progress':{'update':_0x11f677=>{const _0x55567=_0x4d8171;_0x5b9470['setPhase'](_0x11f677),_0x16110a['verbose']&&console[_0x55567(0x190)]('\x20\x20'+_0x11f677);}},'journeyById':_0x4473a4,'activationStepsById':_0x5b9fbd},_0x4ce003,_0x53fd84),{'verbose':_0x16110a[_0x4d8171(0x15c)]})['then'](_0x4e3da5=>_0x4e3da5[_0x4d8171(0x13a)]);for(const _0x13e688 of _0x2bfbc9){_0x3f4451[_0x4d8171(0x185)](_0x13e688);}const _0x44980c=_0x285a8a?[]:findJourneysToDelete(_0x20f990,_0x25ba01['map'](({yamlConfig:_0x1c491c,folderPath:_0x5929d1})=>({'yamlConfig':_0x1c491c,'folderPath':resolveTDFolderPath(_0x5929d1,_0x4ce003,_0x53fd84)})),_0x543bd4,_0x53fd84,_0x4ce003),_0x68701b=calculatePushStats(_0xf0b64a,_0x34e40e,_0x3f4451,_0x466cc7,_0x44980c,!!_0x16110a[_0x4d8171(0x146)],!!_0x16110a[_0x4d8171(0x17b)]),_0x41b29d=_0x68701b[_0x4d8171(0x183)]['new'],_0x1d0c5c=_0x68701b[_0x4d8171(0x183)][_0x4d8171(0x15d)],_0x1946c4=_0x68701b[_0x4d8171(0x183)][_0x4d8171(0x127)],_0x57a1a1=_0x68701b[_0x4d8171(0x183)][_0x4d8171(0x145)],_0x3a0096=_0x68701b[_0x4d8171(0x133)][_0x4d8171(0x19d)],_0x1e0c3a=_0x68701b[_0x4d8171(0x14c)][_0x4d8171(0x151)],_0x2f8712=_0x68701b[_0x4d8171(0x14c)][_0x4d8171(0x15d)],_0x1b338b=_0x68701b[_0x4d8171(0x14c)][_0x4d8171(0x127)],_0x148519=_0x68701b['journeys']['toDelete'],_0xe41cf=_0x68701b[_0x4d8171(0x121)][_0x4d8171(0x189)],_0x4410c4=_0x68701b[_0x4d8171(0x121)][_0x4d8171(0x19d)],_0x5baec2=_0x68701b['activations'][_0x4d8171(0x16a)],_0x561196=_0x68701b[_0x4d8171(0x121)][_0x4d8171(0x145)];console[_0x4d8171(0x190)](_0x4d8171(0x19c)+_0x35937d+'\x27:');_0x3a0096['length']>0x0&&console[_0x4d8171(0x190)]('\x20\x20'+a41_0x1da7e8['blue'](_0x4d8171(0x111)+_0x3a0096[_0x4d8171(0x12b)]+_0x4d8171(0x12e)));if(!_0x16110a[_0x4d8171(0x17b)]){console['error']('\x20\x20📊\x20Segments:'),console[_0x4d8171(0x190)](_0x4d8171(0x116)+a41_0x1da7e8[_0x4d8171(0x14d)]('+\x20'+_0x41b29d[_0x4d8171(0x12b)]+'\x20new')),console[_0x4d8171(0x190)](_0x4d8171(0x116)+a41_0x1da7e8['yellow']('~\x20'+_0x1d0c5c['length']+_0x4d8171(0x15e)));if(_0x57a1a1[_0x4d8171(0x12b)]>0x0)console[_0x4d8171(0x190)]('\x20\x20\x20\x20'+a41_0x1da7e8[_0x4d8171(0x12a)]('-\x20'+_0x57a1a1[_0x4d8171(0x12b)]+'\x20to\x20delete'));else _0x466cc7['length']>0x0&&!_0x16110a[_0x4d8171(0x146)]&&console[_0x4d8171(0x190)]('\x20\x20\x20\x20'+a41_0x1da7e8['dim'](_0x466cc7['length']+'\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)'));console[_0x4d8171(0x190)](_0x4d8171(0x116)+a41_0x1da7e8[_0x4d8171(0x106)]('=\x20'+_0x1946c4[_0x4d8171(0x12b)]+'\x20unchanged'));}if(_0x34e40e[_0x4d8171(0x12b)]>0x0||_0x44980c[_0x4d8171(0x12b)]>0x0){console[_0x4d8171(0x190)](_0x4d8171(0x163)),console[_0x4d8171(0x190)](_0x4d8171(0x116)+a41_0x1da7e8[_0x4d8171(0x14d)]('+\x20'+_0x1e0c3a['length']+_0x4d8171(0x172))),console[_0x4d8171(0x190)](_0x4d8171(0x116)+a41_0x1da7e8[_0x4d8171(0x161)]('~\x20'+_0x2f8712[_0x4d8171(0x12b)]+_0x4d8171(0x15e)));if(_0x148519[_0x4d8171(0x12b)]>0x0)console['error']('\x20\x20\x20\x20'+a41_0x1da7e8[_0x4d8171(0x12a)]('-\x20'+_0x148519[_0x4d8171(0x12b)]+'\x20to\x20delete'));else _0x44980c['length']>0x0&&!_0x16110a['delete']&&console[_0x4d8171(0x190)](_0x4d8171(0x116)+a41_0x1da7e8['dim'](_0x44980c[_0x4d8171(0x12b)]+_0x4d8171(0x112)));console[_0x4d8171(0x190)](_0x4d8171(0x116)+a41_0x1da7e8[_0x4d8171(0x106)]('=\x20'+_0x1b338b[_0x4d8171(0x12b)]+_0x4d8171(0x10f)));}_0xe41cf['length']>0x0&&!_0x16110a[_0x4d8171(0x17b)]&&(console[_0x4d8171(0x190)](''),console[_0x4d8171(0x190)](_0x4d8171(0x123)),_0x4410c4['length']>0x0&&console[_0x4d8171(0x190)]('\x20\x20\x20\x20'+a41_0x1da7e8['green']('+\x20'+_0x4410c4[_0x4d8171(0x12b)]+_0x4d8171(0x130))),_0x5baec2['length']>0x0&&console[_0x4d8171(0x190)](_0x4d8171(0x116)+a41_0x1da7e8[_0x4d8171(0x161)]('~\x20'+_0x5baec2['length']+'\x20to\x20update')),_0x561196[_0x4d8171(0x12b)]>0x0&&console[_0x4d8171(0x190)](_0x4d8171(0x116)+a41_0x1da7e8[_0x4d8171(0x12a)]('-\x20'+_0x561196[_0x4d8171(0x12b)]+'\x20to\x20delete')));console[_0x4d8171(0x190)]('\x20\x20Source:\x20'+a41_0x1da7e8['cyan'](_0x238d59)+'\x0a');if(_0x3a0096[_0x4d8171(0x12b)]>0x0){console[_0x4d8171(0x190)]('Folders\x20to\x20create:');for(const _0x3e070f of _0x3a0096){console[_0x4d8171(0x190)]('\x20\x20'+a41_0x1da7e8[_0x4d8171(0x17e)]('+')+'\x20'+_0x3e070f);}console[_0x4d8171(0x190)]('');}if(_0x41b29d[_0x4d8171(0x12b)]>0x0&&!_0x16110a['journeysOnly'])for(const _0xdca793 of _0x41b29d){const _0x1954c3=_0xdca793['folderPath']?_0xdca793[_0x4d8171(0x11a)]+'/'+_0xdca793['yamlConfig']['name']:_0xdca793['yamlConfig'][_0x4d8171(0x197)],_0x1b79b3=_0xdca793[_0x4d8171(0x175)][_0x4d8171(0x121)]?.['length']||0x0,_0x222a21=_0x1b79b3>0x0?a41_0x1da7e8[_0x4d8171(0x106)]('\x20['+_0x1b79b3+_0x4d8171(0x13c)):'';console['error']('\x0a'+a41_0x1da7e8['green'](_0x4d8171(0x182))+'\x20'+_0x1954c3+_0x222a21),console[_0x4d8171(0x190)]('─'[_0x4d8171(0x153)](0x3c)),_0xdca793[_0x4d8171(0x140)]&&console[_0x4d8171(0x190)](_0xdca793['diff']),console[_0x4d8171(0x190)]('─'[_0x4d8171(0x153)](0x3c));}if(_0x57a1a1[_0x4d8171(0x12b)]>0x0&&!_0x16110a['journeysOnly'])for(const _0x3832a6 of _0x57a1a1){const _0x3dc917=_0x3832a6[_0x4d8171(0x14e)]?_0x543bd4[_0x4d8171(0x16f)](_0x3832a6[_0x4d8171(0x14e)][_0x4d8171(0x160)]())||'':'',_0x100256=_0x3dc917?_0x3dc917+'/'+_0x3832a6['name']:_0x3832a6[_0x4d8171(0x197)],_0x4581c8=_0x577ef2[_0x4d8171(0x16f)](_0x3832a6['id'])||[],_0x4b3465=_0x4581c8[_0x4d8171(0x12b)]>0x0?a41_0x1da7e8[_0x4d8171(0x106)]('\x20['+_0x4581c8['length']+'\x20activations]'):'';console[_0x4d8171(0x190)]('\x0a'+a41_0x1da7e8['red'](_0x4d8171(0x158))+'\x20'+_0x100256+_0x4b3465),console['error']('─'['repeat'](0x3c));const _0x45e9d5=segmentWithActivationsToYaml(_0x3832a6,_0x4581c8,undefined,_0xbe1ec1,_0x3f5de4),_0x391ce5=segmentToYamlString(_0x45e9d5),_0x455aad=generateDiff(_0x391ce5,'');console['error'](formatDiffWithColors(_0x455aad)),console['error']('─'[_0x4d8171(0x153)](0x3c));}const _0x1a5b2e=_0xf0b64a[_0x4d8171(0x150)](_0x37920e=>!_0x37920e[_0x4d8171(0x162)]&&_0x37920e[_0x4d8171(0x140)]);if(_0x1a5b2e['length']>0x0&&!_0x16110a[_0x4d8171(0x17b)])for(const _0x4650ab of _0x1a5b2e){const _0x3882fb=_0x4650ab[_0x4d8171(0x11a)]?_0x4650ab[_0x4d8171(0x11a)]+'/'+_0x4650ab[_0x4d8171(0x175)][_0x4d8171(0x197)]:_0x4650ab[_0x4d8171(0x175)]['name'];console[_0x4d8171(0x190)]('\x0a'+a41_0x1da7e8[_0x4d8171(0x161)]('Changes\x20to:')+'\x20'+_0x3882fb),console[_0x4d8171(0x190)]('─'[_0x4d8171(0x153)](0x3c)),console[_0x4d8171(0x190)](_0x4650ab[_0x4d8171(0x140)]),console[_0x4d8171(0x190)]('─'[_0x4d8171(0x153)](0x3c));}if(_0x1e0c3a[_0x4d8171(0x12b)]>0x0)for(const _0x47dd6a of _0x1e0c3a){const _0x251266=_0x47dd6a['folderPath']?_0x47dd6a[_0x4d8171(0x11a)]+'/'+_0x47dd6a[_0x4d8171(0x175)][_0x4d8171(0x197)]:_0x47dd6a['yamlConfig'][_0x4d8171(0x197)];console[_0x4d8171(0x190)]('\x0a'+a41_0x1da7e8['green']('New\x20journey:')+'\x20'+_0x251266),console[_0x4d8171(0x190)]('─'['repeat'](0x3c)),_0x47dd6a[_0x4d8171(0x140)]&&console[_0x4d8171(0x190)](_0x47dd6a[_0x4d8171(0x140)]),console['error']('─'[_0x4d8171(0x153)](0x3c));}const _0x23e719=_0x34e40e[_0x4d8171(0x150)](_0x28de9e=>!_0x28de9e[_0x4d8171(0x162)]&&_0x28de9e['diff']);if(_0x23e719[_0x4d8171(0x12b)]>0x0)for(const _0x2a0be6 of _0x23e719){const _0xb620f5=_0x2a0be6[_0x4d8171(0x11a)]?_0x2a0be6['folderPath']+'/'+_0x2a0be6[_0x4d8171(0x175)][_0x4d8171(0x197)]:_0x2a0be6[_0x4d8171(0x175)][_0x4d8171(0x197)];console[_0x4d8171(0x190)]('\x0a'+a41_0x1da7e8[_0x4d8171(0x161)](_0x4d8171(0x13b))+'\x20'+_0xb620f5),console[_0x4d8171(0x190)]('─'[_0x4d8171(0x153)](0x3c)),console[_0x4d8171(0x190)](_0x2a0be6[_0x4d8171(0x140)]),console['error']('─'[_0x4d8171(0x153)](0x3c));}if(_0x148519[_0x4d8171(0x12b)]>0x0)for(const _0x34358d of _0x148519){const _0x4e6b33=_0x34358d[_0x4d8171(0x10b)]?_0x543bd4[_0x4d8171(0x16f)](_0x34358d['folderId'])||'':'',_0x29da38=_0x4e6b33?_0x4e6b33+'/'+_0x34358d[_0x4d8171(0x171)]:_0x34358d[_0x4d8171(0x171)];console[_0x4d8171(0x190)]('\x0a'+a41_0x1da7e8['red'](_0x4d8171(0x194))+'\x20'+_0x29da38),console['error']('─'[_0x4d8171(0x153)](0x3c)),console[_0x4d8171(0x190)](a41_0x1da7e8[_0x4d8171(0x12a)](_0x4d8171(0x134))),console[_0x4d8171(0x190)]('─'[_0x4d8171(0x153)](0x3c));}if(_0x16110a[_0x4d8171(0x12f)])return console[_0x4d8171(0x190)](a41_0x1da7e8['yellow'](_0x4d8171(0x122))),0x0;const _0xadf3f1=_0x16110a[_0x4d8171(0x17b)]?![]:_0x41b29d[_0x4d8171(0x12b)]>0x0||_0x1d0c5c[_0x4d8171(0x12b)]>0x0||_0x57a1a1[_0x4d8171(0x12b)]>0x0,_0x26cb96=_0x1e0c3a[_0x4d8171(0x12b)]>0x0||_0x2f8712[_0x4d8171(0x12b)]>0x0||_0x148519[_0x4d8171(0x12b)]>0x0,_0x3f9e86=_0x16110a['journeysOnly']?![]:_0xe41cf['length']>0x0,_0x3c78cd=_0x3a0096[_0x4d8171(0x12b)]>0x0;if(!_0xadf3f1&&!_0x26cb96&&!_0x3f9e86&&!_0x3c78cd){const _0x4dbc7a=_0x16110a['journeysOnly']?_0x4d8171(0x18e):_0x4d8171(0x108);console[_0x4d8171(0x190)](a41_0x1da7e8[_0x4d8171(0x14d)](_0x4dbc7a));if(_0x285a8a&&_0x1946c4['length']===0x1){const _0x381dd3=_0x1946c4[0x0];if(_0x381dd3['existingSegment']?.['id']){const _0x5574fd=getConsoleNextUrl(_0x16110a[_0x4d8171(0x149)],_0x4d8171(0x135)+_0x4e0472+'/e/'+_0x381dd3[_0x4d8171(0x137)]['id']+_0x4d8171(0x124));console[_0x4d8171(0x190)](_0x4d8171(0x13e)+a41_0x1da7e8['cyan'](_0x5574fd));}}if(_0x285a8a&&_0x1b338b[_0x4d8171(0x12b)]===0x1){const _0xf0e02b=_0x1b338b[0x0];if(_0xf0e02b[_0x4d8171(0x10a)]?.['id']){const _0x31c5f1=getConsoleNextUrl(_0x16110a['site'],'/app/ps/'+_0x4e0472+'/e/'+_0xf0e02b[_0x4d8171(0x10a)]['id']+_0x4d8171(0x15b));console[_0x4d8171(0x190)]('\x20\x20'+a41_0x1da7e8[_0x4d8171(0x132)](_0x31c5f1));}}return 0x0;}const _0x5d3072=_0x16110a['journeysOnly']?_0x1e0c3a[_0x4d8171(0x12b)]+_0x2f8712[_0x4d8171(0x12b)]+_0x148519[_0x4d8171(0x12b)]+_0x3a0096['length']:_0x41b29d['length']+_0x1d0c5c[_0x4d8171(0x12b)]+_0x57a1a1['length']+_0x1e0c3a[_0x4d8171(0x12b)]+_0x2f8712[_0x4d8171(0x12b)]+_0x148519['length']+_0x3a0096[_0x4d8171(0x12b)]+_0xe41cf[_0x4d8171(0x12b)];if(!_0x16110a[_0x4d8171(0x12c)]&&_0x5d3072>0x0){if(!isInteractive())return console[_0x4d8171(0x190)](a41_0x1da7e8['red'](_0x4d8171(0x168)),_0x4d8171(0x19e)),console['error'](a41_0x1da7e8[_0x4d8171(0x106)](_0x4d8171(0x129))),0x1;const _0x231aa6=await confirmKey('Push\x20'+_0x5d3072+_0x4d8171(0x18f));if(!_0x231aa6)return console[_0x4d8171(0x190)](a41_0x1da7e8['yellow']('Aborted.')),0x1;}const _0x1c36b8={'withProgress':async(_0x170272,_0x56ee8b)=>{const _0x5aef60=_0x4d8171,_0x562130=await withSpinner(_0x170272,_0x56ee8b,{'verbose':_0x16110a[_0x5aef60(0x15c)]});return{'data':_0x562130[_0x5aef60(0x13a)]};},'logInfo':_0x1b95ba=>console[_0x4d8171(0x190)](a41_0x1da7e8[_0x4d8171(0x17e)]('✔\x20'+_0x1b95ba)),'logSuccess':_0x44af60=>console[_0x4d8171(0x190)](a41_0x1da7e8[_0x4d8171(0x14d)]('✔\x20'+_0x44af60)),'logWarning':_0xbad3cd=>console[_0x4d8171(0x190)](a41_0x1da7e8[_0x4d8171(0x161)]('⚠\x20'+_0xbad3cd)),'logDeleted':_0xfc9df8=>console[_0x4d8171(0x190)](a41_0x1da7e8[_0x4d8171(0x12a)]('✔\x20'+_0xfc9df8))},_0x97db95={'segment':_0xdb3b32[_0x4d8171(0x169)],'journey':_0xdb3b32[_0x4d8171(0x11e)],'user':_0xdb3b32[_0x4d8171(0x144)],'connection':_0xdb3b32[_0x4d8171(0x181)]};_0x3a0096['length']>0x0&&(_0x4dd412=await executePushFolders(_0x97db95,_0x3a0096,_0x4dd412,{'parentId':_0x4e0472},_0x1c36b8));const _0x4d14fd={'rootFolderId':_0x47327f,'folderPathToId':_0x4dd412,'folderIdToPath':_0x543bd4,'segmentNameToId':_0x54808d,'activationsBySegmentId':_0x577ef2,'emailToIdMap':_0x2bf6cb,'idToEmailMap':_0xbe1ec1,'connectionNameToIdMap':_0x4b8781[_0x4d8171(0x17c)],'connectionIdToNameMap':_0x4b8781[_0x4d8171(0x128)],'connectionNameToTypeMap':_0x2e66c5},_0x4282d7=await executePushSegments(_0x97db95,_0x16110a['journeysOnly']?[]:_0xf0b64a,_0x4d14fd,{'parentId':_0x4e0472},_0x1c36b8),_0xe33271=_0x4282d7[_0x4d8171(0x195)],_0x40814f=_0x4282d7['updated'],_0x17a993=_0x4282d7['activations'][_0x4d8171(0x195)],_0x591f6a=_0x4282d7[_0x4d8171(0x121)][_0x4d8171(0x19f)],_0x309bf3=_0x4282d7[_0x4d8171(0x121)][_0x4d8171(0x18b)];let _0x44cc9f;if(_0x285a8a&&_0xf0b64a[_0x4d8171(0x12b)]===0x1){const _0x26eaa1=_0xf0b64a[0x0];_0x44cc9f=_0x26eaa1['existingSegment']?.['id']??_0x4282d7[_0x4d8171(0x10e)][_0x4d8171(0x16f)](_0x26eaa1[_0x4d8171(0x175)][_0x4d8171(0x197)]);}const _0x3f11da=await executePushSegmentDeletions(_0x97db95,_0x16110a['journeysOnly']?[]:_0x57a1a1,_0x1c36b8);let _0x181640=0x0,_0x52d691=0x0,_0x294e1e=0x0;const _0x3b20c8=new Map(_0x54808d);for(const [_0x3ff585,_0x5f42a8]of _0x4282d7[_0x4d8171(0x10e)]){_0x3b20c8[_0x4d8171(0x147)](_0x3ff585,_0x5f42a8);}if(_0x34e40e[_0x4d8171(0x12b)]>0x0){const _0x1d0943={..._0x4d14fd,'segmentNameToId':_0x3b20c8,'existingSegments':_0x59fa00,'activationContext':_0x529bd6},_0x508487=await executePushJourneys(_0x97db95,_0x34e40e,_0x1d0943,{'parentId':_0x4e0472,'rootFolderId':_0x47327f,'verbose':_0x16110a[_0x4d8171(0x15c)]},_0x1c36b8);_0x181640=_0x508487[_0x4d8171(0x195)],_0x52d691=_0x508487[_0x4d8171(0x19f)];if(_0x285a8a&&_0x508487[_0x4d8171(0x193)][_0x4d8171(0x12b)]===0x1){const _0x16bb89=_0x508487[_0x4d8171(0x193)][0x0];if(_0x16bb89[_0x4d8171(0x16b)]){const _0x2c836f=getConsoleNextUrl(_0x16110a[_0x4d8171(0x149)],_0x4d8171(0x135)+_0x4e0472+_0x4d8171(0x10c)+_0x16bb89[_0x4d8171(0x16b)]+_0x4d8171(0x15b));console[_0x4d8171(0x190)]('\x20\x20'+a41_0x1da7e8[_0x4d8171(0x132)](_0x2c836f));}}}for(const _0x56d68e of _0x148519){console['error'](a41_0x1da7e8[_0x4d8171(0x161)](_0x4d8171(0x113)+_0x56d68e[_0x4d8171(0x171)])),_0x294e1e++;}const _0x43079e=[];if(_0xe33271>0x0)_0x43079e['push'](_0xe33271+_0x4d8171(0x15a));if(_0x40814f>0x0)_0x43079e[_0x4d8171(0x19a)](_0x40814f+_0x4d8171(0x11f));if(_0x3f11da>0x0)_0x43079e[_0x4d8171(0x19a)](_0x3f11da+_0x4d8171(0x174));const _0xe71a12=[];if(_0x181640>0x0)_0xe71a12['push'](_0x181640+_0x4d8171(0x15a));if(_0x52d691>0x0)_0xe71a12[_0x4d8171(0x19a)](_0x52d691+_0x4d8171(0x11f));if(_0x294e1e>0x0)_0xe71a12[_0x4d8171(0x19a)](_0x294e1e+_0x4d8171(0x174));const _0x37b13a=[];if(_0x17a993>0x0)_0x37b13a[_0x4d8171(0x19a)](_0x17a993+_0x4d8171(0x15a));if(_0x591f6a>0x0)_0x37b13a[_0x4d8171(0x19a)](_0x591f6a+_0x4d8171(0x11f));if(_0x309bf3>0x0)_0x37b13a['push'](_0x309bf3+_0x4d8171(0x174));console[_0x4d8171(0x190)](a41_0x1da7e8[_0x4d8171(0x14d)](_0x4d8171(0x10d)));_0x43079e['length']>0x0&&!_0x16110a[_0x4d8171(0x17b)]&&console[_0x4d8171(0x190)]('\x20\x20Segments:\x20'+_0x43079e[_0x4d8171(0x12d)](',\x20'));_0xe71a12[_0x4d8171(0x12b)]>0x0&&console[_0x4d8171(0x190)](_0x4d8171(0x157)+_0xe71a12[_0x4d8171(0x12d)](',\x20'));_0x37b13a['length']>0x0&&!_0x16110a[_0x4d8171(0x17b)]&&console[_0x4d8171(0x190)](_0x4d8171(0x176)+_0x37b13a['join'](',\x20'));if(_0x44cc9f){const _0x18abd8=getConsoleNextUrl(_0x16110a[_0x4d8171(0x149)],'/app/ps/'+_0x4e0472+_0x4d8171(0x10c)+_0x44cc9f+_0x4d8171(0x124));console['error']('\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20'+a41_0x1da7e8[_0x4d8171(0x132)](_0x18abd8));}return 0x0;}}
@@ -1 +1 @@
1
- const a42_0x2569fc=a42_0x20ac;(function(_0x4588d2,_0x4daa0f){const _0x4722c8=a42_0x20ac,_0x215df8=_0x4588d2();while(!![]){try{const _0x161acc=parseInt(_0x4722c8(0x1a2))/0x1+parseInt(_0x4722c8(0x19d))/0x2+parseInt(_0x4722c8(0x1a4))/0x3+-parseInt(_0x4722c8(0x180))/0x4+-parseInt(_0x4722c8(0x195))/0x5+parseInt(_0x4722c8(0x183))/0x6*(parseInt(_0x4722c8(0x1a6))/0x7)+parseInt(_0x4722c8(0x185))/0x8;if(_0x161acc===_0x4daa0f)break;else _0x215df8['push'](_0x215df8['shift']());}catch(_0x1f8a7c){_0x215df8['push'](_0x215df8['shift']());}}}(a42_0x478f,0xdd67f));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';function a42_0x478f(){const _0x37a8bc=['Resolved\x20folder\x20ID:\x20','158169pgwsqz','Segment\x20ID:\x20','3015019jUvoZd','.\x20Only\x20child\x20segments\x20can\x20be\x20updated.','data','707184GoaNuV','description','Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]','6LsNEZR','⚠\x20Deprecation\x20warning:\x20`segment\x20update`\x20is\x20deprecated.','13481520zqcuWE','\x20\x20\x20Path:\x20','segment:update','verbose','Resolving\x20folder\x20\x27','Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]','name','folder','Resolving\x20path\x20\x27','resolvePathToResource','Parent\x20ID:\x20','segmentName','kind','Updating\x20segment\x20\x27','segment','length','8474315RyrRrB','✔\x20Updated\x20segment\x20\x27','\x27...','ruleFile','error','\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22','yellow','segmentId','364682CuUmxm','includes','resolveFolderId','type','Error:\x20Cannot\x20update\x20','427567vMQPVR'];a42_0x478f=function(){return _0x37a8bc;};return a42_0x478f();}function a42_0x20ac(_0x25a43d,_0x2be93d){_0x25a43d=_0x25a43d-0x17e;const _0x478f15=a42_0x478f();let _0x20acf0=_0x478f15[_0x25a43d];return _0x20acf0;}import{SDKError,ErrorCode}from'../sdk/index.js';import a42_0x1092d7 from'chalk';export class SegmentUpdateCommand extends BaseCommand{[a42_0x2569fc(0x18b)]=a42_0x2569fc(0x187);[a42_0x2569fc(0x181)]='Update\x20existing\x20child\x20segment';async['execute'](_0x15b202){const _0x4e4ca1=a42_0x2569fc;console['error'](a42_0x1092d7[_0x4e4ca1(0x19b)](_0x4e4ca1(0x184))),console[_0x4e4ca1(0x199)](a42_0x1092d7['yellow']('\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a'));const {options:_0x218aa2,args:_0x3d820b,tdx:_0x257c18}=_0x15b202,_0x52f10f=_0x218aa2;if(_0x3d820b[_0x4e4ca1(0x194)]===0x0)return console[_0x4e4ca1(0x199)]('Error:\x20Segment\x20path\x20or\x20name\x20is\x20required'),console[_0x4e4ca1(0x199)](_0x4e4ca1(0x182)),console['error']('Examples:'),console[_0x4e4ca1(0x199)](_0x4e4ca1(0x19a)),console[_0x4e4ca1(0x199)]('\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context'),0x1;const _0x5d3959=_0x3d820b[0x0],_0xc1cffc=_0x218aa2['segmentPath'];let _0x456c8d=_0x5d3959;_0xc1cffc&&!_0x5d3959[_0x4e4ca1(0x19e)]('/')&&(_0x456c8d=_0xc1cffc+'/'+_0x5d3959,_0x52f10f[_0x4e4ca1(0x188)]&&console['error']('Resolved\x20relative\x20path\x20to:\x20'+_0x456c8d));const _0x5bf97b=await withSpinner(_0x4e4ca1(0x18d)+_0x456c8d+_0x4e4ca1(0x197),()=>_0x257c18[_0x4e4ca1(0x193)][_0x4e4ca1(0x18e)](_0x456c8d),{'verbose':_0x52f10f[_0x4e4ca1(0x188)]}),_0x13438e=_0x5bf97b[_0x4e4ca1(0x17f)];_0x52f10f['verbose']&&console[_0x4e4ca1(0x199)]('Resolved\x20type:\x20'+_0x13438e[_0x4e4ca1(0x1a0)]);if(_0x13438e[_0x4e4ca1(0x1a0)]!==_0x4e4ca1(0x193))return console[_0x4e4ca1(0x199)](_0x4e4ca1(0x1a1)+_0x13438e[_0x4e4ca1(0x1a0)]+_0x4e4ca1(0x17e)),console['error'](_0x4e4ca1(0x18a)),0x1;if(!_0x13438e[_0x4e4ca1(0x19c)])throw new SDKError(ErrorCode['INTERNAL'],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x589211=_0x13438e['parentId'],_0x3ec256=_0x13438e[_0x4e4ca1(0x19c)];_0x52f10f[_0x4e4ca1(0x188)]&&(console['error'](_0x4e4ca1(0x18f)+_0x589211),console[_0x4e4ca1(0x199)](_0x4e4ca1(0x1a5)+_0x3ec256));let _0x415ac1;if(_0x52f10f['folder']){const _0x5d61b8=_0x52f10f[_0x4e4ca1(0x18c)],_0x1a1aff=await withSpinner(_0x4e4ca1(0x189)+_0x5d61b8+_0x4e4ca1(0x197),()=>_0x257c18['segment'][_0x4e4ca1(0x19f)](_0x589211,_0x5d61b8),{'verbose':_0x52f10f[_0x4e4ca1(0x188)]});_0x415ac1=parseInt(_0x1a1aff[_0x4e4ca1(0x17f)],0xa),_0x52f10f[_0x4e4ca1(0x188)]&&console[_0x4e4ca1(0x199)](_0x4e4ca1(0x1a3)+_0x415ac1);}const _0x709138=await loadJSONFromOptions(_0x52f10f['rule'],_0x52f10f[_0x4e4ca1(0x198)]),_0x3975d5={'name':_0x52f10f[_0x4e4ca1(0x18b)],'description':_0x52f10f[_0x4e4ca1(0x181)],'rule':_0x709138,'kind':_0x52f10f[_0x4e4ca1(0x191)]!==undefined?parseInt(_0x52f10f[_0x4e4ca1(0x191)],0xa):undefined,'segmentFolderId':_0x415ac1},_0x561b7a=await withSpinner(_0x4e4ca1(0x192)+_0x13438e[_0x4e4ca1(0x190)]+'\x27...',()=>_0x257c18[_0x4e4ca1(0x193)]['updateSegmentById'](_0x589211,_0x3ec256,_0x3975d5),{'verbose':_0x52f10f['verbose']}),_0x3bc6fa=_0x561b7a[_0x4e4ca1(0x17f)];return console[_0x4e4ca1(0x199)](_0x4e4ca1(0x196)+_0x3bc6fa[_0x4e4ca1(0x18b)]+'\x27'),_0x456c8d!==_0x5d3959&&console['error'](_0x4e4ca1(0x186)+_0x456c8d),await handleSDKOutput([_0x3bc6fa],_0x52f10f),0x0;}}
1
+ function a42_0x6119(){const _0x4e5b53=['628693ZccvOr','Resolved\x20type:\x20','\x27...','description','Parent\x20ID:\x20','name','segmentId','7433625YetBcE','Segment\x20ID:\x20','Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]','852928mlPYZk','INTERNAL','Resolved\x20relative\x20path\x20to:\x20','segmentName','rule','segment','updateSegmentById','678498vMGwfY','.\x20Only\x20child\x20segments\x20can\x20be\x20updated.','segmentPath','6290912gZgtco','\x20\x20\x20Path:\x20','ruleFile','Examples:','\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','28uZBgMJ','type','4kGxINO','resolveFolderId','Resolved\x20folder\x20ID:\x20','12299427vFdCsh','yellow','Resolving\x20path\x20\x27','275TIxLuA','1757830Ecphpn','error','verbose','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','kind','data','✔\x20Updated\x20segment\x20\x27','21aPdXDW','Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]','folder','⚠\x20Deprecation\x20warning:\x20`segment\x20update`\x20is\x20deprecated.','Updating\x20segment\x20\x27','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required'];a42_0x6119=function(){return _0x4e5b53;};return a42_0x6119();}const a42_0x4a91aa=a42_0x16e9;(function(_0x5c4a5f,_0xb9128f){const _0x1bfa85=a42_0x16e9,_0x505964=_0x5c4a5f();while(!![]){try{const _0x5496f9=parseInt(_0x1bfa85(0x19f))/0x1*(parseInt(_0x1bfa85(0x18b))/0x2)+-parseInt(_0x1bfa85(0x199))/0x3*(-parseInt(_0x1bfa85(0x1a9))/0x4)+parseInt(_0x1bfa85(0x1a6))/0x5+-parseInt(_0x1bfa85(0x1b0))/0x6*(-parseInt(_0x1bfa85(0x189))/0x7)+-parseInt(_0x1bfa85(0x184))/0x8+parseInt(_0x1bfa85(0x18e))/0x9+parseInt(_0x1bfa85(0x192))/0xa*(-parseInt(_0x1bfa85(0x191))/0xb);if(_0x5496f9===_0xb9128f)break;else _0x505964['push'](_0x505964['shift']());}catch(_0x26144a){_0x505964['push'](_0x505964['shift']());}}}(a42_0x6119,0xd58eb));function a42_0x16e9(_0x1b2660,_0x537a16){_0x1b2660=_0x1b2660-0x184;const _0x6119f4=a42_0x6119();let _0x16e965=_0x6119f4[_0x1b2660];return _0x16e965;}import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{SDKError,ErrorCode}from'../sdk/index.js';import a42_0x270418 from'chalk';export class SegmentUpdateCommand extends BaseCommand{[a42_0x4a91aa(0x1a4)]='segment:update';[a42_0x4a91aa(0x1a2)]='Update\x20existing\x20child\x20segment';async['execute'](_0x4e3251){const _0x4ff58d=a42_0x4a91aa;console[_0x4ff58d(0x193)](a42_0x270418[_0x4ff58d(0x18f)](_0x4ff58d(0x19c))),console[_0x4ff58d(0x193)](a42_0x270418[_0x4ff58d(0x18f)](_0x4ff58d(0x195)));const {options:_0x5f590a,args:_0x49de0b,tdx:_0x2127d5}=_0x4e3251,_0x4d0934=_0x5f590a;if(_0x49de0b['length']===0x0)return console[_0x4ff58d(0x193)](_0x4ff58d(0x19e)),console[_0x4ff58d(0x193)](_0x4ff58d(0x1a8)),console[_0x4ff58d(0x193)](_0x4ff58d(0x187)),console['error']('\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22'),console[_0x4ff58d(0x193)](_0x4ff58d(0x188)),0x1;const _0x5dec78=_0x49de0b[0x0],_0x495d03=_0x5f590a[_0x4ff58d(0x1b2)];let _0x248f24=_0x5dec78;_0x495d03&&!_0x5dec78['includes']('/')&&(_0x248f24=_0x495d03+'/'+_0x5dec78,_0x4d0934[_0x4ff58d(0x194)]&&console['error'](_0x4ff58d(0x1ab)+_0x248f24));const _0x79d675=await withSpinner(_0x4ff58d(0x190)+_0x248f24+_0x4ff58d(0x1a1),()=>_0x2127d5[_0x4ff58d(0x1ae)]['resolvePathToResource'](_0x248f24),{'verbose':_0x4d0934[_0x4ff58d(0x194)]}),_0x33f8ec=_0x79d675[_0x4ff58d(0x197)];_0x4d0934[_0x4ff58d(0x194)]&&console['error'](_0x4ff58d(0x1a0)+_0x33f8ec['type']);if(_0x33f8ec['type']!=='segment')return console[_0x4ff58d(0x193)]('Error:\x20Cannot\x20update\x20'+_0x33f8ec[_0x4ff58d(0x18a)]+_0x4ff58d(0x1b1)),console[_0x4ff58d(0x193)](_0x4ff58d(0x19a)),0x1;if(!_0x33f8ec[_0x4ff58d(0x1a5)])throw new SDKError(ErrorCode[_0x4ff58d(0x1aa)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x3b6043=_0x33f8ec['parentId'],_0x245af3=_0x33f8ec[_0x4ff58d(0x1a5)];_0x4d0934['verbose']&&(console[_0x4ff58d(0x193)](_0x4ff58d(0x1a3)+_0x3b6043),console[_0x4ff58d(0x193)](_0x4ff58d(0x1a7)+_0x245af3));let _0x2683dc;if(_0x4d0934[_0x4ff58d(0x19b)]){const _0xb98b3a=_0x4d0934[_0x4ff58d(0x19b)],_0x390cfe=await withSpinner('Resolving\x20folder\x20\x27'+_0xb98b3a+_0x4ff58d(0x1a1),()=>_0x2127d5['segment'][_0x4ff58d(0x18c)](_0x3b6043,_0xb98b3a),{'verbose':_0x4d0934[_0x4ff58d(0x194)]});_0x2683dc=parseInt(_0x390cfe[_0x4ff58d(0x197)],0xa),_0x4d0934[_0x4ff58d(0x194)]&&console[_0x4ff58d(0x193)](_0x4ff58d(0x18d)+_0x2683dc);}const _0x5ad0f0=await loadJSONFromOptions(_0x4d0934[_0x4ff58d(0x1ad)],_0x4d0934[_0x4ff58d(0x186)]),_0x171078={'name':_0x4d0934[_0x4ff58d(0x1a4)],'description':_0x4d0934[_0x4ff58d(0x1a2)],'rule':_0x5ad0f0,'kind':_0x4d0934[_0x4ff58d(0x196)]!==undefined?parseInt(_0x4d0934[_0x4ff58d(0x196)],0xa):undefined,'segmentFolderId':_0x2683dc},_0x1b90f4=await withSpinner(_0x4ff58d(0x19d)+_0x33f8ec[_0x4ff58d(0x1ac)]+_0x4ff58d(0x1a1),()=>_0x2127d5[_0x4ff58d(0x1ae)][_0x4ff58d(0x1af)](_0x3b6043,_0x245af3,_0x171078),{'verbose':_0x4d0934[_0x4ff58d(0x194)]}),_0x4b49fa=_0x1b90f4[_0x4ff58d(0x197)];return console[_0x4ff58d(0x193)](_0x4ff58d(0x198)+_0x4b49fa[_0x4ff58d(0x1a4)]+'\x27'),_0x248f24!==_0x5dec78&&console[_0x4ff58d(0x193)](_0x4ff58d(0x185)+_0x248f24),await handleSDKOutput([_0x4b49fa],_0x4d0934),0x0;}}
@@ -1 +1 @@
1
- const a43_0x19157f=a43_0x46d2;(function(_0x4df819,_0x13191f){const _0x39f1db=a43_0x46d2,_0x433201=_0x4df819();while(!![]){try{const _0x987abd=parseInt(_0x39f1db(0x109))/0x1*(-parseInt(_0x39f1db(0x116))/0x2)+parseInt(_0x39f1db(0xf9))/0x3*(parseInt(_0x39f1db(0xf8))/0x4)+-parseInt(_0x39f1db(0x105))/0x5+-parseInt(_0x39f1db(0xfb))/0x6*(parseInt(_0x39f1db(0x100))/0x7)+-parseInt(_0x39f1db(0xfc))/0x8+-parseInt(_0x39f1db(0xe1))/0x9*(-parseInt(_0x39f1db(0xf2))/0xa)+parseInt(_0x39f1db(0x103))/0xb*(parseInt(_0x39f1db(0xe6))/0xc);if(_0x987abd===_0x13191f)break;else _0x433201['push'](_0x433201['shift']());}catch(_0xd12e24){_0x433201['push'](_0x433201['shift']());}}}(a43_0x2e68,0xec32e));import{existsSync,statSync}from'fs';function a43_0x46d2(_0x231beb,_0x48e373){_0x231beb=_0x231beb-0xdc;const _0x2e684b=a43_0x2e68();let _0x46d2a4=_0x2e684b[_0x231beb];return _0x46d2a4;}import a43_0x75867c 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{['name']=a43_0x19157f(0xeb);[a43_0x19157f(0x114)]=a43_0x19157f(0xe8);async[a43_0x19157f(0x110)](_0x160043){const _0x4d5dee=a43_0x19157f,{options:_0x35f157,args:_0x312db1,tdx:_0x2edf80}=_0x160043;if(_0x312db1[_0x4d5dee(0xdd)]===0x0)return console[_0x4d5dee(0xe2)](a43_0x75867c[_0x4d5dee(0xf0)](_0x4d5dee(0x102))),console['error']('Usage:\x20tdx\x20segment\x20use\x20<path>'),console[_0x4d5dee(0xe2)](_0x4d5dee(0xe3)),console[_0x4d5dee(0xe2)](_0x4d5dee(0xfd)),console['error'](_0x4d5dee(0xed)),console[_0x4d5dee(0xe2)](_0x4d5dee(0xde)),console[_0x4d5dee(0xe2)](_0x4d5dee(0x108)),0x1;const _0x3ac5a9=_0x312db1[0x0],_0x29d4a2=_0x35f157[_0x4d5dee(0xf4)];try{if(_0x3ac5a9==='/')return saveSessionContext({'segment_path':undefined},_0x29d4a2),console[_0x4d5dee(0x107)](a43_0x75867c[_0x4d5dee(0xf7)]('✔\x20Context\x20cleared.\x20Back\x20to\x20root.')),0x0;if(existsSync(_0x3ac5a9)&&statSync(_0x3ac5a9)[_0x4d5dee(0xe5)]()){let _0xf1857f;try{_0xf1857f=findTdxConfig(_0x3ac5a9);}catch{return console[_0x4d5dee(0xe2)](a43_0x75867c[_0x4d5dee(0xf0)](_0x4d5dee(0xe9)+_0x3ac5a9)),console[_0x4d5dee(0xe2)](a43_0x75867c[_0x4d5dee(0x111)]('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;}const _0x47441d=_0xf1857f['config'][_0x4d5dee(0xe7)];return saveSessionContext({'segment_path':_0x47441d,'parent_segment':_0x47441d},_0x29d4a2),console['log'](a43_0x75867c[_0x4d5dee(0xf7)]('✔\x20Context\x20set\x20to:\x20'+a43_0x75867c[_0x4d5dee(0x111)](_0x47441d))),0x0;}const _0x376539=_0x35f157[_0x4d5dee(0xfa)];let _0x5004db=_0x3ac5a9;const _0x477cf1=parsePath(_0x3ac5a9);if(!_0x477cf1[_0x4d5dee(0xef)]){if(!_0x376539)return console[_0x4d5dee(0xe2)](a43_0x75867c[_0x4d5dee(0xf0)](_0x4d5dee(0xe0))),console['error'](a43_0x75867c['cyan'](_0x4d5dee(0x10b))),0x1;if(_0x3ac5a9==='..'){const _0x3abd62=_0x376539['split']('/')[_0x4d5dee(0xdc)](0x0,-0x1)[_0x4d5dee(0x115)]('/');_0x5004db=_0x3abd62||'/';}else _0x3ac5a9==='.'?_0x5004db=_0x376539:_0x5004db=_0x376539+'/'+_0x3ac5a9;_0x35f157[_0x4d5dee(0xff)]&&console[_0x4d5dee(0xe2)](_0x4d5dee(0xf5)+_0x5004db);}if(_0x5004db==='/'||_0x5004db==='')return saveSessionContext({'segment_path':undefined},_0x29d4a2),console[_0x4d5dee(0x107)](a43_0x75867c[_0x4d5dee(0xf7)](_0x4d5dee(0xdf))),0x0;_0x5004db=normalizePath(_0x5004db);const _0x2a30e9=parsePath(_0x5004db)[_0x4d5dee(0xf1)];if(_0x2a30e9[_0x4d5dee(0xdd)]===0x0)return saveSessionContext({'segment_path':undefined},_0x29d4a2),console['log'](a43_0x75867c['green'](_0x4d5dee(0xdf))),0x0;_0x35f157[_0x4d5dee(0xff)]&&(console[_0x4d5dee(0xe2)](_0x4d5dee(0x10a)+_0x35f157[_0x4d5dee(0x10c)]),console['error'](_0x4d5dee(0x113)+_0x5004db));const _0x56ffcd=await withSpinner('Resolving\x20path\x20\x27'+_0x5004db+'\x27...',()=>_0x2edf80['segment'][_0x4d5dee(0x101)](_0x5004db),{'verbose':_0x35f157[_0x4d5dee(0xff)]}),_0x527aab=_0x56ffcd[_0x4d5dee(0xf6)];_0x35f157['verbose']&&(console[_0x4d5dee(0xe2)](_0x4d5dee(0xec)+_0x527aab[_0x4d5dee(0x104)]),console['error']('Parent\x20ID:\x20'+_0x527aab[_0x4d5dee(0x117)]),_0x527aab[_0x4d5dee(0xe4)]&&console[_0x4d5dee(0xe2)](_0x4d5dee(0x10d)+_0x527aab[_0x4d5dee(0xe4)]));if(_0x527aab[_0x4d5dee(0x104)]==='segment')return console[_0x4d5dee(0xe2)](a43_0x75867c['red'](_0x4d5dee(0x106))),console[_0x4d5dee(0xe2)](_0x4d5dee(0xf3)),console[_0x4d5dee(0xe2)](a43_0x75867c['cyan'](_0x4d5dee(0x112)+_0x527aab[_0x4d5dee(0xfe)]+(_0x527aab[_0x4d5dee(0xee)]?'/'+_0x527aab[_0x4d5dee(0xee)][_0x4d5dee(0x115)]('/'):''))),0x1;return saveSessionContext({'segment_path':_0x527aab[_0x4d5dee(0x10f)],'parent_segment':_0x527aab[_0x4d5dee(0xfe)]},_0x29d4a2),console[_0x4d5dee(0x107)](a43_0x75867c[_0x4d5dee(0xf7)](_0x4d5dee(0x10e)+a43_0x75867c[_0x4d5dee(0x111)](_0x527aab[_0x4d5dee(0x10f)]))),_0x35f157[_0x4d5dee(0xff)]&&(console['error'](a43_0x75867c[_0x4d5dee(0xea)]('Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context')),console['error'](a43_0x75867c[_0x4d5dee(0xea)]('Use\x20\x22tdx\x20use\x22\x20to\x20see\x20all\x20context\x20parameters'))),0x0;}catch(_0x1243fa){throw _0x1243fa;}}}function a43_0x2e68(){const _0x583cc8=['session','Resolved\x20relative\x20path\x20to:\x20','data','green','112448dCgfSa','24Jsqllq','segmentPath','18RJgDor','13013832WnNZQR','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22','parentName','verbose','2914331VLpiaN','resolvePathToResource','Error:\x20Path\x20is\x20required\x0a','25011019PGgyac','type','1272860vmkHdk','Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.','log','\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent','1646659GGLVhg','Site:\x20','Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>','site','Folder\x20ID:\x20','✔\x20Context\x20set\x20to:\x20','fullPath','execute','cyan','Use:\x20tdx\x20segment\x20use\x20','Target\x20path:\x20','description','join','2FkWAPu','parentId','slice','length','\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context','✔\x20Context\x20cleared.\x20Back\x20to\x20root.','Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.','8973RfURsZ','error','Examples:','folderId','isDirectory','24brmgNu','parent_segment','Set\x20current\x20segment/folder\x20context\x20for\x20navigation','Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','dim','segment:use','Resolved\x20path\x20type:\x20','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22','folderPath','isAbsolute','red','segments','9750wSFTDP','Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.'];a43_0x2e68=function(){return _0x583cc8;};return a43_0x2e68();}
1
+ const a43_0xe04106=a43_0x4059;(function(_0x4b06cf,_0x2503ca){const _0x4bf7ea=a43_0x4059,_0x623cef=_0x4b06cf();while(!![]){try{const _0x4ab515=parseInt(_0x4bf7ea(0x1fa))/0x1*(-parseInt(_0x4bf7ea(0x208))/0x2)+parseInt(_0x4bf7ea(0x1ee))/0x3*(-parseInt(_0x4bf7ea(0x1fb))/0x4)+parseInt(_0x4bf7ea(0x209))/0x5*(parseInt(_0x4bf7ea(0x1dc))/0x6)+-parseInt(_0x4bf7ea(0x20b))/0x7*(parseInt(_0x4bf7ea(0x1f6))/0x8)+parseInt(_0x4bf7ea(0x20d))/0x9+parseInt(_0x4bf7ea(0x1d7))/0xa*(-parseInt(_0x4bf7ea(0x1f5))/0xb)+parseInt(_0x4bf7ea(0x1d8))/0xc;if(_0x4ab515===_0x2503ca)break;else _0x623cef['push'](_0x623cef['shift']());}catch(_0x259435){_0x623cef['push'](_0x623cef['shift']());}}}(a43_0x13c4,0xb6bfe));import{existsSync,statSync}from'fs';import a43_0xfe8d48 from'chalk';function a43_0x13c4(){const _0x5af57f=['name','verbose','length','fullPath','Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.','Target\x20path:\x20','config','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','261djaqLF','Examples:','execute','segments','data','type','✔\x20Context\x20cleared.\x20Back\x20to\x20root.','22jYOQfo','24FBPaur','folderPath','parentId','\x27...','1372218CGeRrs','6908TPhPsQ','site','\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22','dim','slice','green','Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context','Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.','join','Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','Use\x20\x22tdx\x20use\x22\x20to\x20see\x20all\x20context\x20parameters','2FXfmWK','6867605tibczo','Resolved\x20path\x20type:\x20','2802590QMxfcX','Folder\x20ID:\x20','2004669MBspmf','description','✔\x20Context\x20set\x20to:\x20','error','4211790YPFQCo','32618580rquFFH','session','Set\x20current\x20segment/folder\x20context\x20for\x20navigation','segment:use','6RUlcfZ','Use:\x20tdx\x20segment\x20use\x20','cyan','parent_segment','segment','isAbsolute','\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent','segmentPath','red','log'];a43_0x13c4=function(){return _0x5af57f;};return a43_0x13c4();}import{BaseCommand}from'./command.js';function a43_0x4059(_0x16dd5f,_0x3dbdd2){_0x16dd5f=_0x16dd5f-0x1d6;const _0x13c44c=a43_0x13c4();let _0x4059a6=_0x13c44c[_0x16dd5f];return _0x4059a6;}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_0xe04106(0x1e6)]=a43_0xe04106(0x1db);[a43_0xe04106(0x20e)]=a43_0xe04106(0x1da);async[a43_0xe04106(0x1f0)](_0x5f209f){const _0x280d2c=a43_0xe04106,{options:_0x46258c,args:_0x2f81c0,tdx:_0x502a4a}=_0x5f209f;if(_0x2f81c0['length']===0x0)return console['error'](a43_0xfe8d48['red']('Error:\x20Path\x20is\x20required\x0a')),console[_0x280d2c(0x1d6)]('Usage:\x20tdx\x20segment\x20use\x20<path>'),console['error'](_0x280d2c(0x1ef)),console[_0x280d2c(0x1d6)](_0x280d2c(0x1ff)),console[_0x280d2c(0x1d6)](_0x280d2c(0x1fe)),console[_0x280d2c(0x1d6)](_0x280d2c(0x1fd)),console['error'](_0x280d2c(0x1e2)),0x1;const _0x4670e0=_0x2f81c0[0x0],_0x4d42d9=_0x46258c[_0x280d2c(0x1d9)];try{if(_0x4670e0==='/')return saveSessionContext({'segment_path':undefined},_0x4d42d9),console['log'](a43_0xfe8d48[_0x280d2c(0x202)](_0x280d2c(0x1f4))),0x0;if(existsSync(_0x4670e0)&&statSync(_0x4670e0)['isDirectory']()){let _0x5c6e83;try{_0x5c6e83=findTdxConfig(_0x4670e0);}catch{return console['error'](a43_0xfe8d48[_0x280d2c(0x1e4)](_0x280d2c(0x206)+_0x4670e0)),console[_0x280d2c(0x1d6)](a43_0xfe8d48[_0x280d2c(0x1de)](_0x280d2c(0x1ed))),0x1;}const _0x9a4454=_0x5c6e83[_0x280d2c(0x1ec)][_0x280d2c(0x1df)];return saveSessionContext({'segment_path':_0x9a4454,'parent_segment':_0x9a4454},_0x4d42d9),console[_0x280d2c(0x1e5)](a43_0xfe8d48['green'](_0x280d2c(0x20f)+a43_0xfe8d48[_0x280d2c(0x1de)](_0x9a4454))),0x0;}const _0x2ecf92=_0x46258c[_0x280d2c(0x1e3)];let _0x40b927=_0x4670e0;const _0x10fc45=parsePath(_0x4670e0);if(!_0x10fc45[_0x280d2c(0x1e1)]){if(!_0x2ecf92)return console[_0x280d2c(0x1d6)](a43_0xfe8d48[_0x280d2c(0x1e4)](_0x280d2c(0x1ea))),console[_0x280d2c(0x1d6)](a43_0xfe8d48[_0x280d2c(0x1de)]('Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>')),0x1;if(_0x4670e0==='..'){const _0xe0ae33=_0x2ecf92['split']('/')[_0x280d2c(0x201)](0x0,-0x1)[_0x280d2c(0x205)]('/');_0x40b927=_0xe0ae33||'/';}else _0x4670e0==='.'?_0x40b927=_0x2ecf92:_0x40b927=_0x2ecf92+'/'+_0x4670e0;_0x46258c[_0x280d2c(0x1e7)]&&console['error']('Resolved\x20relative\x20path\x20to:\x20'+_0x40b927);}if(_0x40b927==='/'||_0x40b927==='')return saveSessionContext({'segment_path':undefined},_0x4d42d9),console[_0x280d2c(0x1e5)](a43_0xfe8d48[_0x280d2c(0x202)](_0x280d2c(0x1f4))),0x0;_0x40b927=normalizePath(_0x40b927);const _0x33ac66=parsePath(_0x40b927)[_0x280d2c(0x1f1)];if(_0x33ac66[_0x280d2c(0x1e8)]===0x0)return saveSessionContext({'segment_path':undefined},_0x4d42d9),console['log'](a43_0xfe8d48[_0x280d2c(0x202)](_0x280d2c(0x1f4))),0x0;_0x46258c[_0x280d2c(0x1e7)]&&(console[_0x280d2c(0x1d6)]('Site:\x20'+_0x46258c[_0x280d2c(0x1fc)]),console[_0x280d2c(0x1d6)](_0x280d2c(0x1eb)+_0x40b927));const _0x1206fd=await withSpinner('Resolving\x20path\x20\x27'+_0x40b927+_0x280d2c(0x1f9),()=>_0x502a4a['segment']['resolvePathToResource'](_0x40b927),{'verbose':_0x46258c['verbose']}),_0x240d3c=_0x1206fd[_0x280d2c(0x1f2)];_0x46258c['verbose']&&(console[_0x280d2c(0x1d6)](_0x280d2c(0x20a)+_0x240d3c[_0x280d2c(0x1f3)]),console['error']('Parent\x20ID:\x20'+_0x240d3c[_0x280d2c(0x1f8)]),_0x240d3c['folderId']&&console[_0x280d2c(0x1d6)](_0x280d2c(0x20c)+_0x240d3c['folderId']));if(_0x240d3c[_0x280d2c(0x1f3)]===_0x280d2c(0x1e0))return console[_0x280d2c(0x1d6)](a43_0xfe8d48['red']('Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.')),console[_0x280d2c(0x1d6)](_0x280d2c(0x204)),console['error'](a43_0xfe8d48[_0x280d2c(0x1de)](_0x280d2c(0x1dd)+_0x240d3c['parentName']+(_0x240d3c[_0x280d2c(0x1f7)]?'/'+_0x240d3c[_0x280d2c(0x1f7)][_0x280d2c(0x205)]('/'):''))),0x1;return saveSessionContext({'segment_path':_0x240d3c[_0x280d2c(0x1e9)],'parent_segment':_0x240d3c['parentName']},_0x4d42d9),console['log'](a43_0xfe8d48[_0x280d2c(0x202)]('✔\x20Context\x20set\x20to:\x20'+a43_0xfe8d48[_0x280d2c(0x1de)](_0x240d3c[_0x280d2c(0x1e9)]))),_0x46258c['verbose']&&(console['error'](a43_0xfe8d48['dim'](_0x280d2c(0x203))),console[_0x280d2c(0x1d6)](a43_0xfe8d48[_0x280d2c(0x200)](_0x280d2c(0x207)))),0x0;}catch(_0x3f8c38){throw _0x3f8c38;}}}
@@ -1 +1 @@
1
- function a44_0x69cf(){const _0x3c32ea=['8BwILNM','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','\x20error(s)','type','red','\x20warning(s)','endsWith','Validation\x20failed:\x20','cyan','verbose','\x20warning(s)\x20found','parentSegment','3697612vWZtip','Error:\x20','cwd','segment:validate','errors','dim','914907poLHxH','1Mbegsz','2152260nWlXzC','message','hasErrors','no_parent','):\x20','3620czZnIW','helpText','warnings','yellow','green','4923LxMSJd','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','name','file','valid','Validate\x20segment\x20and\x20journey\x20YAML\x20files','5TztLKT','\x20file(s)\x20with\x20errors,\x20','warningCount','.yaml','validCount','592590LDZcPO','4922220upagpO','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file','Error:\x20No\x20YAML\x20files\x20found\x20in\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','\x20valid','execute','1364524mQnaYq','filePath','description','length','log','error'];a44_0x69cf=function(){return _0x3c32ea;};return a44_0x69cf();}const a44_0x5dbc96=a44_0xd173;(function(_0x1547f0,_0x26e19b){const _0x3ef62e=a44_0xd173,_0x2e1540=_0x1547f0();while(!![]){try{const _0x113b89=parseInt(_0x3ef62e(0x171))/0x1*(-parseInt(_0x3ef62e(0x151))/0x2)+parseInt(_0x3ef62e(0x170))/0x3+-parseInt(_0x3ef62e(0x16a))/0x4*(parseInt(_0x3ef62e(0x14c))/0x5)+parseInt(_0x3ef62e(0x152))/0x6+-parseInt(_0x3ef62e(0x158))/0x7*(-parseInt(_0x3ef62e(0x15e))/0x8)+parseInt(_0x3ef62e(0x146))/0x9*(parseInt(_0x3ef62e(0x177))/0xa)+parseInt(_0x3ef62e(0x172))/0xb;if(_0x113b89===_0x26e19b)break;else _0x2e1540['push'](_0x2e1540['shift']());}catch(_0x172dbe){_0x2e1540['push'](_0x2e1540['shift']());}}}(a44_0x69cf,0x786bf));import{BaseCommand}from'./command.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';function a44_0xd173(_0x36256f,_0xc8ed11){_0x36256f=_0x36256f-0x146;const _0x69cfce=a44_0x69cf();let _0xd173dc=_0x69cfce[_0x36256f];return _0xd173dc;}import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';import a44_0x43a4e0 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_0x5dbc96(0x148)]=a44_0x5dbc96(0x16d);[a44_0x5dbc96(0x15a)]=a44_0x5dbc96(0x14b);async[a44_0x5dbc96(0x157)](_0x523aee){const _0x229934=a44_0x5dbc96,{options:_0x115af6,args:_0x3f7844}=_0x523aee,_0x328b83=_0x115af6,_0x2e72f1=await resolveTarget({'arg':_0x3f7844[0x0],'contextParent':_0x115af6[_0x229934(0x169)],'cwd':process[_0x229934(0x16c)]()});if(!isSuccessfulResolution(_0x2e72f1))return _0x2e72f1['errorCode']===_0x229934(0x175)?(console['error'](a44_0x43a4e0[_0x229934(0x17a)](_0x229934(0x15f))),console[_0x229934(0x15d)]('Usage:\x20tdx\x20sg\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)'),console[_0x229934(0x15d)](_0x229934(0x155)),console[_0x229934(0x15d)](_0x229934(0x153))):(console[_0x229934(0x15d)](a44_0x43a4e0[_0x229934(0x162)](_0x229934(0x16b)+_0x2e72f1[_0x229934(0x173)]+'\x0a')),_0x2e72f1[_0x229934(0x178)]&&console[_0x229934(0x15d)](a44_0x43a4e0[_0x229934(0x166)](_0x2e72f1['helpText']))),0x1;const _0x42606f=_0x2e72f1['targetDir'],_0x467015=_0x2e72f1[_0x229934(0x161)]===_0x229934(0x149)?_0x2e72f1[_0x229934(0x159)]:undefined;if(!_0x467015&&!existsSync(_0x42606f))return console[_0x229934(0x15d)](a44_0x43a4e0[_0x229934(0x162)]('Error:\x20Directory\x20not\x20found:\x20'+_0x42606f+'\x0a')),0x1;let _0x3ef347;if(_0x467015){if(!_0x467015[_0x229934(0x164)]('.yml')&&!_0x467015['endsWith'](_0x229934(0x14f)))return console[_0x229934(0x15d)](a44_0x43a4e0[_0x229934(0x162)](_0x229934(0x147)+_0x467015+'\x0a')),0x1;_0x3ef347=[_0x467015];}else _0x3ef347=findYamlFiles(_0x42606f);if(_0x3ef347['length']===0x0)return console[_0x229934(0x15d)](a44_0x43a4e0[_0x229934(0x162)](_0x229934(0x154)+_0x42606f+'\x0a')),0x1;const _0x4dcee5=validateYamlFiles(_0x3ef347,_0x42606f),_0x421302=calculateSummary(_0x4dcee5);for(const _0x44d533 of _0x4dcee5){if(!isValidationResult(_0x44d533))continue;const {relativePath:_0x491c7f,source:_0x252f27,result:_0x35e515,fileType:_0x1ef52e}=_0x44d533,_0x3ccf34=_0x1ef52e;if(_0x35e515['valid']&&_0x35e515[_0x229934(0x179)][_0x229934(0x15b)]===0x0)_0x328b83[_0x229934(0x167)]&&console['log'](a44_0x43a4e0[_0x229934(0x17b)]('✔\x20'+_0x491c7f)+a44_0x43a4e0[_0x229934(0x16f)]('\x20('+_0x3ccf34+')'));else _0x35e515[_0x229934(0x14a)]?(console[_0x229934(0x15c)](a44_0x43a4e0[_0x229934(0x17a)]('⚠\x20'+_0x491c7f)+a44_0x43a4e0[_0x229934(0x16f)]('\x20('+_0x3ccf34+_0x229934(0x176)+_0x35e515[_0x229934(0x179)][_0x229934(0x15b)]+_0x229934(0x163))),console[_0x229934(0x15c)](formatValidationResult(_0x35e515,_0x252f27,_0x491c7f))):(console[_0x229934(0x15c)](a44_0x43a4e0[_0x229934(0x162)]('✖\x20'+_0x491c7f)+a44_0x43a4e0[_0x229934(0x16f)]('\x20('+_0x3ccf34+_0x229934(0x176)+_0x35e515[_0x229934(0x16e)][_0x229934(0x15b)]+_0x229934(0x160))),console[_0x229934(0x15c)](formatValidationResult(_0x35e515,_0x252f27,_0x491c7f)));}return console[_0x229934(0x15c)](''),_0x421302[_0x229934(0x174)]?(console[_0x229934(0x15c)](a44_0x43a4e0[_0x229934(0x162)](_0x229934(0x165)+_0x421302['invalidCount']+_0x229934(0x14d)+_0x421302[_0x229934(0x150)]+_0x229934(0x156))),_0x421302[_0x229934(0x14e)]>0x0&&console[_0x229934(0x15c)](a44_0x43a4e0[_0x229934(0x17a)](_0x421302[_0x229934(0x14e)]+_0x229934(0x168))),0x1):(console[_0x229934(0x15c)](a44_0x43a4e0[_0x229934(0x17b)]('✔\x20All\x20'+_0x421302[_0x229934(0x150)]+'\x20file(s)\x20valid')),_0x421302[_0x229934(0x14e)]>0x0&&console[_0x229934(0x15c)](a44_0x43a4e0[_0x229934(0x17a)](_0x421302[_0x229934(0x14e)]+_0x229934(0x168))),0x0);}}
1
+ const a44_0x4afc6e=a44_0x3fd5;(function(_0x51367c,_0x1ff64a){const _0x45cb0c=a44_0x3fd5,_0xa7d346=_0x51367c();while(!![]){try{const _0x1623cb=-parseInt(_0x45cb0c(0x1b5))/0x1*(parseInt(_0x45cb0c(0x1c9))/0x2)+parseInt(_0x45cb0c(0x1bd))/0x3+-parseInt(_0x45cb0c(0x1ba))/0x4*(-parseInt(_0x45cb0c(0x1a1))/0x5)+parseInt(_0x45cb0c(0x1a9))/0x6+parseInt(_0x45cb0c(0x1c7))/0x7+-parseInt(_0x45cb0c(0x1a2))/0x8+-parseInt(_0x45cb0c(0x1aa))/0x9;if(_0x1623cb===_0x1ff64a)break;else _0xa7d346['push'](_0xa7d346['shift']());}catch(_0x47907b){_0xa7d346['push'](_0xa7d346['shift']());}}}(a44_0x397c,0x3dcfa));import{BaseCommand}from'./command.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';function a44_0x397c(){const _0x32dbc2=['Usage:\x20tdx\x20sg\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)','5HSivSB','1932840qRxeDk','.yml','red','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','valid','name','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','914676cMcnYo','3115908ZNXvSm','filePath','Validate\x20segment\x20and\x20journey\x20YAML\x20files','\x20error(s)','warningCount','message','helpText','green','\x20warning(s)','yellow','verbose','2333XYeCUV','hasErrors','error','type','.yaml','838076jhJmuA','✔\x20All\x20','\x20file(s)\x20with\x20errors,\x20','531795FGYwLF','dim','endsWith','Error:\x20','no_parent','errorCode','file','):\x20','warnings','Error:\x20Directory\x20not\x20found:\x20','3108546GFuvvm','length','122fYHyXg','invalidCount','\x20valid','\x20warning(s)\x20found','\x20file(s)\x20valid','cwd','log'];a44_0x397c=function(){return _0x32dbc2;};return a44_0x397c();}import{findYamlFiles}from'../sdk/segment/file-discovery.js';function a44_0x3fd5(_0x5df766,_0x26ce11){_0x5df766=_0x5df766-0x19a;const _0x397c8b=a44_0x397c();let _0x3fd54c=_0x397c8b[_0x5df766];return _0x3fd54c;}import{existsSync}from'fs';import a44_0x5c1c37 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_0x4afc6e(0x1a7)]='segment:validate';['description']=a44_0x4afc6e(0x1ac);async['execute'](_0x1f70bf){const _0x2d6fda=a44_0x4afc6e,{options:_0x231eff,args:_0x54f423}=_0x1f70bf,_0x3bf603=_0x231eff,_0x2403fb=await resolveTarget({'arg':_0x54f423[0x0],'contextParent':_0x231eff['parentSegment'],'cwd':process[_0x2d6fda(0x19e)]()});if(!isSuccessfulResolution(_0x2403fb))return _0x2403fb[_0x2d6fda(0x1c2)]===_0x2d6fda(0x1c1)?(console[_0x2d6fda(0x1b7)](a44_0x5c1c37[_0x2d6fda(0x1b3)](_0x2d6fda(0x1a8))),console['error'](_0x2d6fda(0x1a0)),console['error']('\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'),console[_0x2d6fda(0x1b7)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file')):(console[_0x2d6fda(0x1b7)](a44_0x5c1c37['red'](_0x2d6fda(0x1c0)+_0x2403fb[_0x2d6fda(0x1af)]+'\x0a')),_0x2403fb[_0x2d6fda(0x1b0)]&&console[_0x2d6fda(0x1b7)](a44_0x5c1c37['cyan'](_0x2403fb[_0x2d6fda(0x1b0)]))),0x1;const _0x3385e4=_0x2403fb['targetDir'],_0x2e658c=_0x2403fb[_0x2d6fda(0x1b8)]===_0x2d6fda(0x1c3)?_0x2403fb[_0x2d6fda(0x1ab)]:undefined;if(!_0x2e658c&&!existsSync(_0x3385e4))return console[_0x2d6fda(0x1b7)](a44_0x5c1c37[_0x2d6fda(0x1a4)](_0x2d6fda(0x1c6)+_0x3385e4+'\x0a')),0x1;let _0x1b5e31;if(_0x2e658c){if(!_0x2e658c[_0x2d6fda(0x1bf)](_0x2d6fda(0x1a3))&&!_0x2e658c['endsWith'](_0x2d6fda(0x1b9)))return console[_0x2d6fda(0x1b7)](a44_0x5c1c37[_0x2d6fda(0x1a4)]('Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20'+_0x2e658c+'\x0a')),0x1;_0x1b5e31=[_0x2e658c];}else _0x1b5e31=findYamlFiles(_0x3385e4);if(_0x1b5e31[_0x2d6fda(0x1c8)]===0x0)return console[_0x2d6fda(0x1b7)](a44_0x5c1c37[_0x2d6fda(0x1a4)](_0x2d6fda(0x1a5)+_0x3385e4+'\x0a')),0x1;const _0x46afa6=validateYamlFiles(_0x1b5e31,_0x3385e4),_0x576d14=calculateSummary(_0x46afa6);for(const _0x1b77f6 of _0x46afa6){if(!isValidationResult(_0x1b77f6))continue;const {relativePath:_0x5b3cbb,source:_0x4c658b,result:_0x6c5eda,fileType:_0x14d386}=_0x1b77f6,_0x28686f=_0x14d386;if(_0x6c5eda['valid']&&_0x6c5eda[_0x2d6fda(0x1c5)][_0x2d6fda(0x1c8)]===0x0)_0x3bf603[_0x2d6fda(0x1b4)]&&console[_0x2d6fda(0x19f)](a44_0x5c1c37['green']('✔\x20'+_0x5b3cbb)+a44_0x5c1c37[_0x2d6fda(0x1be)]('\x20('+_0x28686f+')'));else _0x6c5eda[_0x2d6fda(0x1a6)]?(console[_0x2d6fda(0x19f)](a44_0x5c1c37[_0x2d6fda(0x1b3)]('⚠\x20'+_0x5b3cbb)+a44_0x5c1c37['dim']('\x20('+_0x28686f+_0x2d6fda(0x1c4)+_0x6c5eda[_0x2d6fda(0x1c5)][_0x2d6fda(0x1c8)]+_0x2d6fda(0x1b2))),console['log'](formatValidationResult(_0x6c5eda,_0x4c658b,_0x5b3cbb))):(console[_0x2d6fda(0x19f)](a44_0x5c1c37[_0x2d6fda(0x1a4)]('✖\x20'+_0x5b3cbb)+a44_0x5c1c37[_0x2d6fda(0x1be)]('\x20('+_0x28686f+_0x2d6fda(0x1c4)+_0x6c5eda['errors'][_0x2d6fda(0x1c8)]+_0x2d6fda(0x1ad))),console[_0x2d6fda(0x19f)](formatValidationResult(_0x6c5eda,_0x4c658b,_0x5b3cbb)));}return console[_0x2d6fda(0x19f)](''),_0x576d14[_0x2d6fda(0x1b6)]?(console[_0x2d6fda(0x19f)](a44_0x5c1c37[_0x2d6fda(0x1a4)]('Validation\x20failed:\x20'+_0x576d14[_0x2d6fda(0x19a)]+_0x2d6fda(0x1bc)+_0x576d14['validCount']+_0x2d6fda(0x19b))),_0x576d14['warningCount']>0x0&&console[_0x2d6fda(0x19f)](a44_0x5c1c37[_0x2d6fda(0x1b3)](_0x576d14[_0x2d6fda(0x1ae)]+_0x2d6fda(0x19c))),0x1):(console[_0x2d6fda(0x19f)](a44_0x5c1c37[_0x2d6fda(0x1b1)](_0x2d6fda(0x1bb)+_0x576d14['validCount']+_0x2d6fda(0x19d))),_0x576d14['warningCount']>0x0&&console['log'](a44_0x5c1c37['yellow'](_0x576d14[_0x2d6fda(0x1ae)]+'\x20warning(s)\x20found')),0x0);}}
@@ -1 +1 @@
1
- const a45_0x2edce0=a45_0x1f77;(function(_0x5b3715,_0x44e569){const _0x34bbb8=a45_0x1f77,_0x14b291=_0x5b3715();while(!![]){try{const _0x1d750b=-parseInt(_0x34bbb8(0x15b))/0x1*(parseInt(_0x34bbb8(0x164))/0x2)+parseInt(_0x34bbb8(0x148))/0x3+-parseInt(_0x34bbb8(0x172))/0x4*(-parseInt(_0x34bbb8(0x173))/0x5)+-parseInt(_0x34bbb8(0x135))/0x6+parseInt(_0x34bbb8(0x16f))/0x7+parseInt(_0x34bbb8(0x15a))/0x8+-parseInt(_0x34bbb8(0x16a))/0x9*(parseInt(_0x34bbb8(0x139))/0xa);if(_0x1d750b===_0x44e569)break;else _0x14b291['push'](_0x14b291['shift']());}catch(_0x51e9c3){_0x14b291['push'](_0x14b291['shift']());}}}(a45_0x4882,0xb4356));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';function a45_0x1f77(_0x11b684,_0x4cdf72){_0x11b684=_0x11b684-0x128;const _0x488284=a45_0x4882();let _0x1f771e=_0x488284[_0x11b684];return _0x1f771e;}import{withSpinner}from'../utils/spinner.js';function a45_0x4882(){const _0x21376a=['length','cause','journeys','includes','List\x20folders\x20and\x20child\x20segments','\x20\x20tdx\x20sg\x20pull\x20\x22My\x20Audience\x22','sort','folder','listUnifiedWithJourneys','11516248hLIaAo','146035UfHcYo','✔\x20Found\x20','(empty)','/e/','jsonl','listUnified','Recursive\x20mode:\x20enabled','\x20matching\x20\x27','parentSegment','6XVmVGG','/app/ps/','✔\x20Built\x20tree\x20with\x20','journey','filter','segment','15507ZWXsPo','dim','maxDepth','segments','type','9272242rIlVZV','description','folders','5310424XUDRic','5qATaZu','(not\x20set)','verbose','Error:\x20','json','Listing\x20folders,\x20segments,\x20and\x20journeys...','site','name','data','\x20journey','listRecursive','parentId','\x20segment','Parent\x20ID:\x20','6523380nSgkrf','/j/da','Resolving\x20path\x20\x27','map','11770ioJaPH','Error:\x20No\x20parent\x20segment\x20context\x20set.','log','journeyBundleName','Resolving\x20parent\x20segment\x20\x27','execute','children','localeCompare','No\x20items\x20match\x20pattern:\x20','recursive','folderId','\x20\x20tdx\x20sg\x20use\x20\x22My\x20Audience\x22','\x5c$&','\x27...','format','599091JGqTzj',',\x20and\x20','message','Set\x20a\x20parent\x20segment\x20context\x20first:','error','\x20folder','listWithPattern','replace','test'];a45_0x4882=function(){return _0x21376a;};return a45_0x4882();}import{formatFlatList,formatTree}from'../sdk/util/tree-formatter.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import a45_0x497d03 from'chalk';export class SegmentsCommand extends BaseCommand{[a45_0x2edce0(0x12e)]=a45_0x2edce0(0x16d);[a45_0x2edce0(0x170)]=a45_0x2edce0(0x155);async[a45_0x2edce0(0x13e)](_0x1bf25e){const _0x555765=a45_0x2edce0,{options:_0x25e98f,args:_0x2a8863}=_0x1bf25e,_0x42470d=_0x25e98f[_0x555765(0x142)],_0x2dffd1=_0x2a8863[0x0];try{const _0x47d585=_0x25e98f[_0x555765(0x163)];_0x25e98f[_0x555765(0x129)]&&(console['error']('Site:\x20'+_0x25e98f[_0x555765(0x12d)]),console[_0x555765(0x14c)]('Parent\x20segment\x20context:\x20'+(_0x47d585||_0x555765(0x128))),_0x2dffd1&&console[_0x555765(0x14c)]('Folder/pattern\x20arg:\x20'+_0x2dffd1),_0x42470d&&console[_0x555765(0x14c)](_0x555765(0x161)));if(!_0x47d585)return console[_0x555765(0x14c)](_0x555765(0x13a)),console['error'](''),console[_0x555765(0x14c)](_0x555765(0x14b)),console[_0x555765(0x14c)](_0x555765(0x156)),console['error'](_0x555765(0x144)),console[_0x555765(0x14c)](''),console[_0x555765(0x14c)]('Use\x20tdx\x20ps\x20list\x20to\x20see\x20available\x20parent\x20segments.'),0x1;const _0x43e005=_0x2dffd1&&(_0x2dffd1['includes']('*')||_0x2dffd1[_0x555765(0x154)]('?'));if(_0x43e005)return await this[_0x555765(0x14e)](_0x1bf25e,_0x47d585,_0x2dffd1);const _0x10544c=_0x2dffd1?_0x47d585+'/'+_0x2dffd1:_0x47d585;return _0x42470d?await this[_0x555765(0x131)](_0x1bf25e,_0x10544c):await this[_0x555765(0x160)](_0x1bf25e,_0x10544c);}catch(_0x1f34c0){if(_0x1f34c0 instanceof SDKError)return console[_0x555765(0x14c)](_0x555765(0x12a)+_0x1f34c0[_0x555765(0x14a)]),_0x1f34c0[_0x555765(0x152)]&&console[_0x555765(0x14c)]('\x20\x20Cause:\x20'+_0x1f34c0[_0x555765(0x152)]),0x1;throw _0x1f34c0;}}async['listWithPattern'](_0x191254,_0x1003fe,_0x495794){const _0x41bf69=a45_0x2edce0,{options:_0xcbae1,tdx:_0x453cf6}=_0x191254,_0x440a6e=await withSpinner(_0x41bf69(0x13d)+_0x1003fe+'\x27...',()=>_0x453cf6[_0x41bf69(0x169)]['resolvePathToResource'](_0x1003fe),{'verbose':_0xcbae1[_0x41bf69(0x129)]}),_0x77dd99=_0x440a6e[_0x41bf69(0x12f)],_0x3e2dc1=await withSpinner('Listing\x20folders,\x20segments,\x20and\x20journeys...',()=>_0x453cf6[_0x41bf69(0x169)][_0x41bf69(0x159)](_0x77dd99[_0x41bf69(0x132)],_0x77dd99['folderId']),{'verbose':_0xcbae1[_0x41bf69(0x129)]}),{folders:_0xbfdca5,segments:_0x11dfc9,journeys:_0x46b98d}=_0x3e2dc1[_0x41bf69(0x12f)],_0x45890b=_0x495794['replace'](/[.+^${}()|[\]\\]/g,_0x41bf69(0x145))[_0x41bf69(0x14f)](/\*/g,'.*')[_0x41bf69(0x14f)](/\?/g,'.'),_0x3b416d=new RegExp('^'+_0x45890b+'$','i'),_0x39b4eb=_0xbfdca5[_0x41bf69(0x168)](_0x2102bb=>_0x3b416d['test'](_0x2102bb['name'])),_0x30c4a4=_0x11dfc9['filter'](_0x451f29=>_0x3b416d[_0x41bf69(0x150)](_0x451f29[_0x41bf69(0x12e)])),_0x328952=_0x46b98d[_0x41bf69(0x168)](_0x5098e=>_0x3b416d[_0x41bf69(0x150)](_0x5098e[_0x41bf69(0x13c)])),_0x3fc49e=_0x39b4eb[_0x41bf69(0x151)]+_0x30c4a4['length']+_0x328952['length'];console['error'](_0x41bf69(0x15c)+_0x39b4eb['length']+'\x20folder'+(_0x39b4eb[_0x41bf69(0x151)]!==0x1?'s':'')+',\x20'+_0x30c4a4[_0x41bf69(0x151)]+_0x41bf69(0x133)+(_0x30c4a4[_0x41bf69(0x151)]!==0x1?'s':'')+',\x20and\x20'+_0x328952['length']+_0x41bf69(0x130)+(_0x328952[_0x41bf69(0x151)]!==0x1?'s':'')+_0x41bf69(0x162)+_0x495794+'\x27');const _0x3181b1=_0x3ebd00=>{const _0x515c3a=_0x41bf69;return getConsoleNextUrl(_0xcbae1[_0x515c3a(0x12d)],_0x515c3a(0x165)+_0x77dd99[_0x515c3a(0x132)]+_0x515c3a(0x15e)+_0x3ebd00);},_0x4c40d5=_0xcbae1[_0x41bf69(0x147)]===_0x41bf69(0x12b)||_0xcbae1[_0x41bf69(0x147)]===_0x41bf69(0x15f);if(_0x4c40d5){const _0x202826=[..._0x39b4eb['map'](_0x2e5e53=>({..._0x2e5e53,'type':_0x41bf69(0x158)})),..._0x30c4a4['map'](_0x160540=>({..._0x160540,'type':_0x41bf69(0x169),'url':_0x3181b1(_0x160540['id'])})),..._0x328952['map'](_0x5359a2=>({..._0x5359a2,'name':_0x5359a2[_0x41bf69(0x13c)],'type':_0x41bf69(0x167)}))][_0x41bf69(0x157)]((_0x43e589,_0x4467f9)=>_0x43e589['name'][_0x41bf69(0x140)](_0x4467f9[_0x41bf69(0x12e)]));await handleSDKOutput(_0x202826,_0xcbae1);}else{if(_0x3fc49e===0x0)console[_0x41bf69(0x13b)](_0x41bf69(0x141)+_0x495794);else{console[_0x41bf69(0x13b)](a45_0x497d03['dim']('['+_0x1003fe+']\x20matching\x20\x27'+_0x495794+'\x27'));const _0x1f18bb=formatFlatList(_0x39b4eb,_0x30c4a4,{'showMetadata':!![],'getSegmentUrl':_0x3181b1},_0x328952);console[_0x41bf69(0x13b)](_0x1f18bb);}}return 0x0;}async['listUnified'](_0x4e3380,_0x37683e){const _0x33eac0=a45_0x2edce0,{options:_0x3fc02d,tdx:_0x3540d9}=_0x4e3380,_0x223b7e=await withSpinner(_0x33eac0(0x137)+_0x37683e+_0x33eac0(0x146),()=>_0x3540d9[_0x33eac0(0x169)]['resolvePathToResource'](_0x37683e),{'verbose':_0x3fc02d[_0x33eac0(0x129)]}),_0x52900e=_0x223b7e[_0x33eac0(0x12f)];_0x3fc02d[_0x33eac0(0x129)]&&(console['error'](_0x33eac0(0x134)+_0x52900e['parentId']),_0x52900e[_0x33eac0(0x143)]&&console[_0x33eac0(0x14c)]('Folder\x20ID:\x20'+_0x52900e[_0x33eac0(0x143)]));const _0x2826c2=await withSpinner(_0x33eac0(0x12c),()=>_0x3540d9[_0x33eac0(0x169)][_0x33eac0(0x159)](_0x52900e[_0x33eac0(0x132)],_0x52900e[_0x33eac0(0x143)]),{'verbose':_0x3fc02d['verbose']}),{folders:_0xd4f66,segments:_0x28e4a2,journeys:_0x1fbaff}=_0x2826c2[_0x33eac0(0x12f)],_0x56aeb5=_0xd4f66[_0x33eac0(0x151)]+_0x28e4a2[_0x33eac0(0x151)]+_0x1fbaff[_0x33eac0(0x151)];console[_0x33eac0(0x14c)](_0x33eac0(0x15c)+_0xd4f66[_0x33eac0(0x151)]+_0x33eac0(0x14d)+(_0xd4f66[_0x33eac0(0x151)]!==0x1?'s':'')+',\x20'+_0x28e4a2[_0x33eac0(0x151)]+'\x20segment'+(_0x28e4a2['length']!==0x1?'s':'')+_0x33eac0(0x149)+_0x1fbaff[_0x33eac0(0x151)]+_0x33eac0(0x130)+(_0x1fbaff[_0x33eac0(0x151)]!==0x1?'s':''));const _0x49c9a8=_0x2fcbe8=>{const _0x563e08=_0x33eac0;return getConsoleNextUrl(_0x3fc02d[_0x563e08(0x12d)],_0x563e08(0x165)+_0x52900e[_0x563e08(0x132)]+'/e/'+_0x2fcbe8);},_0x3cb4f9=_0xd4bde4=>{const _0x1841d1=_0x33eac0;return getConsoleNextUrl(_0x3fc02d[_0x1841d1(0x12d)],'/app/ps/'+_0x52900e[_0x1841d1(0x132)]+'/e/'+_0xd4bde4+_0x1841d1(0x136));},_0x52effc=_0x3fc02d[_0x33eac0(0x147)]===_0x33eac0(0x12b)||_0x3fc02d['format']===_0x33eac0(0x15f);if(_0x52effc){const _0x378061=[..._0xd4f66['map'](_0x3e7409=>({..._0x3e7409,'type':_0x33eac0(0x158)})),..._0x28e4a2[_0x33eac0(0x138)](_0x115d45=>({..._0x115d45,'type':_0x33eac0(0x169),'url':_0x49c9a8(_0x115d45['id'])})),..._0x1fbaff[_0x33eac0(0x138)](_0x501021=>({..._0x501021,'name':_0x501021[_0x33eac0(0x13c)],'type':_0x33eac0(0x167),'url':_0x3cb4f9(_0x501021['id'])}))][_0x33eac0(0x157)]((_0x1d5604,_0x4aafd2)=>_0x1d5604['name'][_0x33eac0(0x140)](_0x4aafd2['name']));await handleSDKOutput(_0x378061,_0x3fc02d);}else{if(_0x56aeb5===0x0)console[_0x33eac0(0x13b)](a45_0x497d03[_0x33eac0(0x16b)]('['+_0x37683e+']')),console[_0x33eac0(0x13b)](_0x33eac0(0x15d));else{console[_0x33eac0(0x13b)](a45_0x497d03[_0x33eac0(0x16b)]('['+_0x37683e+']'));const _0x261ef6=formatFlatList(_0xd4f66,_0x28e4a2,{'showMetadata':!![],'getSegmentUrl':_0x49c9a8,'getJourneyUrl':_0x3cb4f9},_0x1fbaff);console['log'](_0x261ef6);}}return 0x0;}async[a45_0x2edce0(0x131)](_0x3e3ce9,_0x122e19){const _0x517d8e=a45_0x2edce0,{options:_0x381305,tdx:_0x4e3099}=_0x3e3ce9,_0x277ea4=await withSpinner(_0x517d8e(0x137)+_0x122e19+_0x517d8e(0x146),()=>_0x4e3099[_0x517d8e(0x169)]['resolvePathToResource'](_0x122e19),{'verbose':_0x381305[_0x517d8e(0x129)]}),_0x598548=_0x277ea4['data'];_0x381305[_0x517d8e(0x129)]&&(console[_0x517d8e(0x14c)]('Parent\x20ID:\x20'+_0x598548[_0x517d8e(0x132)]),_0x598548['folderId']&&console['error']('Folder\x20ID:\x20'+_0x598548[_0x517d8e(0x143)]));const _0x4fb8d3=_0x381305[_0x517d8e(0x16c)]||0xa,_0x49552c=await withSpinner('Building\x20hierarchy\x20tree...',()=>_0x4e3099[_0x517d8e(0x169)][_0x517d8e(0x131)](_0x598548[_0x517d8e(0x132)],_0x598548[_0x517d8e(0x143)],0x0,_0x4fb8d3),{'verbose':_0x381305[_0x517d8e(0x129)]}),_0x56c318=_0x49552c[_0x517d8e(0x12f)],_0x44ab88=_0x99f82a=>{const _0x5d4cc2=_0x517d8e;let _0x451f2=0x0,_0x3ff7a5=0x0,_0x5711af=0x0;for(const _0x2f6edb of _0x99f82a){if(_0x2f6edb[_0x5d4cc2(0x16e)]===_0x5d4cc2(0x158))_0x451f2++;else{if(_0x2f6edb[_0x5d4cc2(0x16e)]===_0x5d4cc2(0x169))_0x3ff7a5++;else{if(_0x2f6edb['type']==='journey')_0x5711af++;}}if(_0x2f6edb[_0x5d4cc2(0x13f)]){const _0x430621=_0x44ab88(_0x2f6edb[_0x5d4cc2(0x13f)]);_0x451f2+=_0x430621[_0x5d4cc2(0x171)],_0x3ff7a5+=_0x430621[_0x5d4cc2(0x16d)],_0x5711af+=_0x430621['journeys'];}}return{'folders':_0x451f2,'segments':_0x3ff7a5,'journeys':_0x5711af};},_0x2f77ed=_0x44ab88(_0x56c318);console[_0x517d8e(0x14c)](_0x517d8e(0x166)+_0x2f77ed[_0x517d8e(0x171)]+_0x517d8e(0x14d)+(_0x2f77ed['folders']!==0x1?'s':'')+',\x20'+_0x2f77ed[_0x517d8e(0x16d)]+'\x20segment'+(_0x2f77ed[_0x517d8e(0x16d)]!==0x1?'s':'')+_0x517d8e(0x149)+_0x2f77ed[_0x517d8e(0x153)]+_0x517d8e(0x130)+(_0x2f77ed[_0x517d8e(0x153)]!==0x1?'s':''));const _0x2c6bd5=_0x586e81=>{const _0x263c90=_0x517d8e;return getConsoleNextUrl(_0x381305[_0x263c90(0x12d)],_0x263c90(0x165)+_0x598548[_0x263c90(0x132)]+_0x263c90(0x15e)+_0x586e81);},_0x488844=_0x302a6a=>{const _0x308de3=_0x517d8e;return getConsoleNextUrl(_0x381305[_0x308de3(0x12d)],'/app/ps/'+_0x598548[_0x308de3(0x132)]+_0x308de3(0x15e)+_0x302a6a+_0x308de3(0x136));};if(_0x381305[_0x517d8e(0x147)]===_0x517d8e(0x12b)||_0x381305['format']===_0x517d8e(0x15f))await handleSDKOutput(_0x56c318,_0x381305);else{console[_0x517d8e(0x13b)](a45_0x497d03[_0x517d8e(0x16b)]('['+_0x122e19+']'));const _0x29a042=formatTree(_0x56c318,{'showMetadata':!![],'getSegmentUrl':_0x2c6bd5,'getJourneyUrl':_0x488844});console[_0x517d8e(0x13b)](_0x29a042);}return 0x0;}}
1
+ const a45_0x115dd3=a45_0x49b4;(function(_0xcdefcf,_0x41f562){const _0x50f879=a45_0x49b4,_0x259b15=_0xcdefcf();while(!![]){try{const _0x8dcef2=parseInt(_0x50f879(0x20c))/0x1*(parseInt(_0x50f879(0x22d))/0x2)+-parseInt(_0x50f879(0x226))/0x3*(-parseInt(_0x50f879(0x229))/0x4)+parseInt(_0x50f879(0x1fb))/0x5+parseInt(_0x50f879(0x217))/0x6*(-parseInt(_0x50f879(0x1ed))/0x7)+parseInt(_0x50f879(0x1f1))/0x8*(parseInt(_0x50f879(0x200))/0x9)+parseInt(_0x50f879(0x1fe))/0xa+-parseInt(_0x50f879(0x20d))/0xb;if(_0x8dcef2===_0x41f562)break;else _0x259b15['push'](_0x259b15['shift']());}catch(_0x269359){_0x259b15['push'](_0x259b15['shift']());}}}(a45_0x227f,0x38019));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';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';function a45_0x227f(){const _0x3656e3=['✔\x20Built\x20tree\x20with\x20','test','\x20segment','folders','filter','1104845HKaEnR','No\x20items\x20match\x20pattern:\x20','error','1973460qFOMJL','List\x20folders\x20and\x20child\x20segments','330741VfVelp','Parent\x20ID:\x20','parentSegment','\x20matching\x20\x27','execute','(not\x20set)','segments','verbose',',\x20and\x20','/e/','map','Resolving\x20path\x20\x27','102457wUODCB','5848986vHJvFp','journey','includes','maxDepth','cause','Parent\x20segment\x20context:\x20','\x27...','✔\x20Found\x20','\x20folder','dim','6gYwylE','replace','format','/j/da','type','localeCompare','Folder\x20ID:\x20','jsonl','resolvePathToResource','parentId','name','site',']\x20matching\x20\x27','listUnifiedWithJourneys','/app/ps/','191067UZXSBY','\x20\x20Cause:\x20','Recursive\x20mode:\x20enabled','4aRRbON','\x20journey','message','journeyBundleName','6HtIpNr','log','json','\x20\x20tdx\x20sg\x20use\x20\x22My\x20Audience\x22','data','Set\x20a\x20parent\x20segment\x20context\x20first:','folder','journeys','children','listWithPattern','(empty)','folderId','Folder/pattern\x20arg:\x20','3027409KFIikc','listRecursive','sort','Listing\x20folders,\x20segments,\x20and\x20journeys...','88TosjsO','segment','length','Resolving\x20parent\x20segment\x20\x27','listUnified'];a45_0x227f=function(){return _0x3656e3;};return a45_0x227f();}function a45_0x49b4(_0x4d27d0,_0x1bba9a){_0x4d27d0=_0x4d27d0-0x1e9;const _0x227fbd=a45_0x227f();let _0x49b410=_0x227fbd[_0x4d27d0];return _0x49b410;}import a45_0x5590f4 from'chalk';export class SegmentsCommand extends BaseCommand{[a45_0x115dd3(0x221)]='segments';['description']=a45_0x115dd3(0x1ff);async[a45_0x115dd3(0x204)](_0x45ea5c){const _0x323c34=a45_0x115dd3,{options:_0x344c6d,args:_0x4d8696}=_0x45ea5c,_0x305b3c=_0x344c6d['recursive'],_0x1dffb1=_0x4d8696[0x0];try{const _0x2b5f4e=_0x344c6d[_0x323c34(0x202)];_0x344c6d['verbose']&&(console[_0x323c34(0x1fd)]('Site:\x20'+_0x344c6d[_0x323c34(0x222)]),console[_0x323c34(0x1fd)](_0x323c34(0x212)+(_0x2b5f4e||_0x323c34(0x205))),_0x1dffb1&&console[_0x323c34(0x1fd)](_0x323c34(0x1ec)+_0x1dffb1),_0x305b3c&&console[_0x323c34(0x1fd)](_0x323c34(0x228)));if(!_0x2b5f4e)return console[_0x323c34(0x1fd)]('Error:\x20No\x20parent\x20segment\x20context\x20set.'),console[_0x323c34(0x1fd)](''),console[_0x323c34(0x1fd)](_0x323c34(0x232)),console[_0x323c34(0x1fd)]('\x20\x20tdx\x20sg\x20pull\x20\x22My\x20Audience\x22'),console[_0x323c34(0x1fd)](_0x323c34(0x230)),console[_0x323c34(0x1fd)](''),console[_0x323c34(0x1fd)]('Use\x20tdx\x20ps\x20list\x20to\x20see\x20available\x20parent\x20segments.'),0x1;const _0x38c748=_0x1dffb1&&(_0x1dffb1[_0x323c34(0x20f)]('*')||_0x1dffb1[_0x323c34(0x20f)]('?'));if(_0x38c748)return await this['listWithPattern'](_0x45ea5c,_0x2b5f4e,_0x1dffb1);const _0x46bd19=_0x1dffb1?_0x2b5f4e+'/'+_0x1dffb1:_0x2b5f4e;return _0x305b3c?await this[_0x323c34(0x1ee)](_0x45ea5c,_0x46bd19):await this['listUnified'](_0x45ea5c,_0x46bd19);}catch(_0x3d00dd){if(_0x3d00dd instanceof SDKError)return console['error']('Error:\x20'+_0x3d00dd[_0x323c34(0x22b)]),_0x3d00dd[_0x323c34(0x211)]&&console[_0x323c34(0x1fd)](_0x323c34(0x227)+_0x3d00dd['cause']),0x1;throw _0x3d00dd;}}async[a45_0x115dd3(0x1e9)](_0x2d9f8e,_0x45b26a,_0x10fd8b){const _0x274231=a45_0x115dd3,{options:_0x433911,tdx:_0x51e580}=_0x2d9f8e,_0x11dc97=await withSpinner(_0x274231(0x1f4)+_0x45b26a+_0x274231(0x213),()=>_0x51e580[_0x274231(0x1f2)][_0x274231(0x21f)](_0x45b26a),{'verbose':_0x433911[_0x274231(0x207)]}),_0x40bfba=_0x11dc97[_0x274231(0x231)],_0x5abf23=await withSpinner(_0x274231(0x1f0),()=>_0x51e580['segment'][_0x274231(0x224)](_0x40bfba[_0x274231(0x220)],_0x40bfba[_0x274231(0x1eb)]),{'verbose':_0x433911['verbose']}),{folders:_0x23409a,segments:_0x1a37d3,journeys:_0x25ea82}=_0x5abf23['data'],_0x2e5827=_0x10fd8b[_0x274231(0x218)](/[.+^${}()|[\]\\]/g,'\x5c$&')['replace'](/\*/g,'.*')[_0x274231(0x218)](/\?/g,'.'),_0x5c73f6=new RegExp('^'+_0x2e5827+'$','i'),_0x13e56b=_0x23409a[_0x274231(0x1fa)](_0x3e1270=>_0x5c73f6[_0x274231(0x1f7)](_0x3e1270[_0x274231(0x221)])),_0x1ff421=_0x1a37d3[_0x274231(0x1fa)](_0x3db123=>_0x5c73f6[_0x274231(0x1f7)](_0x3db123[_0x274231(0x221)])),_0x28622b=_0x25ea82[_0x274231(0x1fa)](_0x5f06a5=>_0x5c73f6[_0x274231(0x1f7)](_0x5f06a5[_0x274231(0x22c)])),_0x2dff1c=_0x13e56b[_0x274231(0x1f3)]+_0x1ff421['length']+_0x28622b['length'];console[_0x274231(0x1fd)]('✔\x20Found\x20'+_0x13e56b[_0x274231(0x1f3)]+_0x274231(0x215)+(_0x13e56b['length']!==0x1?'s':'')+',\x20'+_0x1ff421[_0x274231(0x1f3)]+_0x274231(0x1f8)+(_0x1ff421['length']!==0x1?'s':'')+',\x20and\x20'+_0x28622b['length']+'\x20journey'+(_0x28622b[_0x274231(0x1f3)]!==0x1?'s':'')+_0x274231(0x203)+_0x10fd8b+'\x27');const _0x363b61=_0x36840c=>{const _0x384cb8=_0x274231;return getConsoleNextUrl(_0x433911[_0x384cb8(0x222)],_0x384cb8(0x225)+_0x40bfba['parentId']+_0x384cb8(0x209)+_0x36840c);},_0x369cd9=_0x433911[_0x274231(0x219)]===_0x274231(0x22f)||_0x433911[_0x274231(0x219)]===_0x274231(0x21e);if(_0x369cd9){const _0x4e2458=[..._0x13e56b[_0x274231(0x20a)](_0x4d7099=>({..._0x4d7099,'type':'folder'})),..._0x1ff421[_0x274231(0x20a)](_0x403aa3=>({..._0x403aa3,'type':_0x274231(0x1f2),'url':_0x363b61(_0x403aa3['id'])})),..._0x28622b[_0x274231(0x20a)](_0x5b03d1=>({..._0x5b03d1,'name':_0x5b03d1[_0x274231(0x22c)],'type':_0x274231(0x20e)}))][_0x274231(0x1ef)]((_0x13fcfa,_0x504d2b)=>_0x13fcfa['name'][_0x274231(0x21c)](_0x504d2b['name']));await handleSDKOutput(_0x4e2458,_0x433911);}else{if(_0x2dff1c===0x0)console[_0x274231(0x22e)](_0x274231(0x1fc)+_0x10fd8b);else{console[_0x274231(0x22e)](a45_0x5590f4[_0x274231(0x216)]('['+_0x45b26a+_0x274231(0x223)+_0x10fd8b+'\x27'));const _0x5170a3=formatFlatList(_0x13e56b,_0x1ff421,{'showMetadata':!![],'getSegmentUrl':_0x363b61},_0x28622b);console[_0x274231(0x22e)](_0x5170a3);}}return 0x0;}async[a45_0x115dd3(0x1f5)](_0x1f7978,_0x4cee64){const _0x66b39e=a45_0x115dd3,{options:_0x8634f8,tdx:_0x5002ac}=_0x1f7978,_0x3a1ba5=await withSpinner(_0x66b39e(0x20b)+_0x4cee64+_0x66b39e(0x213),()=>_0x5002ac[_0x66b39e(0x1f2)][_0x66b39e(0x21f)](_0x4cee64),{'verbose':_0x8634f8[_0x66b39e(0x207)]}),_0x439189=_0x3a1ba5[_0x66b39e(0x231)];_0x8634f8[_0x66b39e(0x207)]&&(console['error'](_0x66b39e(0x201)+_0x439189['parentId']),_0x439189[_0x66b39e(0x1eb)]&&console[_0x66b39e(0x1fd)](_0x66b39e(0x21d)+_0x439189['folderId']));const _0x552ef9=await withSpinner(_0x66b39e(0x1f0),()=>_0x5002ac[_0x66b39e(0x1f2)]['listUnifiedWithJourneys'](_0x439189[_0x66b39e(0x220)],_0x439189[_0x66b39e(0x1eb)]),{'verbose':_0x8634f8[_0x66b39e(0x207)]}),{folders:_0x3c3c16,segments:_0x325b3a,journeys:_0x2eb20f}=_0x552ef9[_0x66b39e(0x231)],_0x35984f=_0x3c3c16[_0x66b39e(0x1f3)]+_0x325b3a[_0x66b39e(0x1f3)]+_0x2eb20f['length'];console[_0x66b39e(0x1fd)](_0x66b39e(0x214)+_0x3c3c16[_0x66b39e(0x1f3)]+_0x66b39e(0x215)+(_0x3c3c16[_0x66b39e(0x1f3)]!==0x1?'s':'')+',\x20'+_0x325b3a['length']+_0x66b39e(0x1f8)+(_0x325b3a[_0x66b39e(0x1f3)]!==0x1?'s':'')+_0x66b39e(0x208)+_0x2eb20f[_0x66b39e(0x1f3)]+_0x66b39e(0x22a)+(_0x2eb20f['length']!==0x1?'s':''));const _0x29978b=_0x54069f=>{const _0x1eaa89=_0x66b39e;return getConsoleNextUrl(_0x8634f8[_0x1eaa89(0x222)],'/app/ps/'+_0x439189[_0x1eaa89(0x220)]+'/e/'+_0x54069f);},_0x13ab1c=_0x4faca0=>{const _0x38e7a6=_0x66b39e;return getConsoleNextUrl(_0x8634f8[_0x38e7a6(0x222)],_0x38e7a6(0x225)+_0x439189[_0x38e7a6(0x220)]+_0x38e7a6(0x209)+_0x4faca0+_0x38e7a6(0x21a));},_0xd87523=_0x8634f8['format']===_0x66b39e(0x22f)||_0x8634f8[_0x66b39e(0x219)]===_0x66b39e(0x21e);if(_0xd87523){const _0x2c5e0d=[..._0x3c3c16[_0x66b39e(0x20a)](_0x49f6e1=>({..._0x49f6e1,'type':'folder'})),..._0x325b3a[_0x66b39e(0x20a)](_0x4287a7=>({..._0x4287a7,'type':_0x66b39e(0x1f2),'url':_0x29978b(_0x4287a7['id'])})),..._0x2eb20f[_0x66b39e(0x20a)](_0x5837fc=>({..._0x5837fc,'name':_0x5837fc[_0x66b39e(0x22c)],'type':_0x66b39e(0x20e),'url':_0x13ab1c(_0x5837fc['id'])}))][_0x66b39e(0x1ef)]((_0x260bbb,_0x1febf5)=>_0x260bbb['name']['localeCompare'](_0x1febf5['name']));await handleSDKOutput(_0x2c5e0d,_0x8634f8);}else{if(_0x35984f===0x0)console['log'](a45_0x5590f4['dim']('['+_0x4cee64+']')),console[_0x66b39e(0x22e)](_0x66b39e(0x1ea));else{console[_0x66b39e(0x22e)](a45_0x5590f4[_0x66b39e(0x216)]('['+_0x4cee64+']'));const _0x37f574=formatFlatList(_0x3c3c16,_0x325b3a,{'showMetadata':!![],'getSegmentUrl':_0x29978b,'getJourneyUrl':_0x13ab1c},_0x2eb20f);console['log'](_0x37f574);}}return 0x0;}async['listRecursive'](_0x20adc2,_0x40449d){const _0x23737f=a45_0x115dd3,{options:_0x5867e5,tdx:_0x406259}=_0x20adc2,_0xfe077a=await withSpinner(_0x23737f(0x20b)+_0x40449d+_0x23737f(0x213),()=>_0x406259['segment'][_0x23737f(0x21f)](_0x40449d),{'verbose':_0x5867e5[_0x23737f(0x207)]}),_0x1a0e23=_0xfe077a['data'];_0x5867e5[_0x23737f(0x207)]&&(console[_0x23737f(0x1fd)](_0x23737f(0x201)+_0x1a0e23[_0x23737f(0x220)]),_0x1a0e23[_0x23737f(0x1eb)]&&console[_0x23737f(0x1fd)](_0x23737f(0x21d)+_0x1a0e23['folderId']));const _0x240efd=_0x5867e5[_0x23737f(0x210)]||0xa,_0x33c5f1=await withSpinner('Building\x20hierarchy\x20tree...',()=>_0x406259['segment'][_0x23737f(0x1ee)](_0x1a0e23['parentId'],_0x1a0e23['folderId'],0x0,_0x240efd),{'verbose':_0x5867e5['verbose']}),_0x33204c=_0x33c5f1[_0x23737f(0x231)],_0x57e15c=_0x24d9f9=>{const _0x54755f=_0x23737f;let _0x3103a7=0x0,_0x2106b5=0x0,_0x15dc05=0x0;for(const _0x3e8ce8 of _0x24d9f9){if(_0x3e8ce8[_0x54755f(0x21b)]===_0x54755f(0x233))_0x3103a7++;else{if(_0x3e8ce8[_0x54755f(0x21b)]==='segment')_0x2106b5++;else{if(_0x3e8ce8[_0x54755f(0x21b)]==='journey')_0x15dc05++;}}if(_0x3e8ce8[_0x54755f(0x235)]){const _0x15d987=_0x57e15c(_0x3e8ce8[_0x54755f(0x235)]);_0x3103a7+=_0x15d987['folders'],_0x2106b5+=_0x15d987['segments'],_0x15dc05+=_0x15d987[_0x54755f(0x234)];}}return{'folders':_0x3103a7,'segments':_0x2106b5,'journeys':_0x15dc05};},_0x1b619f=_0x57e15c(_0x33204c);console[_0x23737f(0x1fd)](_0x23737f(0x1f6)+_0x1b619f[_0x23737f(0x1f9)]+_0x23737f(0x215)+(_0x1b619f['folders']!==0x1?'s':'')+',\x20'+_0x1b619f[_0x23737f(0x206)]+'\x20segment'+(_0x1b619f['segments']!==0x1?'s':'')+',\x20and\x20'+_0x1b619f[_0x23737f(0x234)]+_0x23737f(0x22a)+(_0x1b619f[_0x23737f(0x234)]!==0x1?'s':''));const _0x4d0df4=_0x27e0fd=>{const _0x2f1b32=_0x23737f;return getConsoleNextUrl(_0x5867e5[_0x2f1b32(0x222)],_0x2f1b32(0x225)+_0x1a0e23[_0x2f1b32(0x220)]+_0x2f1b32(0x209)+_0x27e0fd);},_0x1fd8da=_0x2afda1=>{const _0x26e2e7=_0x23737f;return getConsoleNextUrl(_0x5867e5[_0x26e2e7(0x222)],_0x26e2e7(0x225)+_0x1a0e23['parentId']+_0x26e2e7(0x209)+_0x2afda1+_0x26e2e7(0x21a));};if(_0x5867e5[_0x23737f(0x219)]===_0x23737f(0x22f)||_0x5867e5['format']===_0x23737f(0x21e))await handleSDKOutput(_0x33204c,_0x5867e5);else{console['log'](a45_0x5590f4[_0x23737f(0x216)]('['+_0x40449d+']'));const _0x420af2=formatTree(_0x33204c,{'showMetadata':!![],'getSegmentUrl':_0x4d0df4,'getJourneyUrl':_0x1fd8da});console[_0x23737f(0x22e)](_0x420af2);}return 0x0;}}
@@ -1 +1 @@
1
- const a46_0x3f54fb=a46_0x3927;(function(_0x342e09,_0x3212be){const _0x4b6a8b=a46_0x3927,_0x5443a8=_0x342e09();while(!![]){try{const _0x51e212=parseInt(_0x4b6a8b(0xd2))/0x1*(parseInt(_0x4b6a8b(0xd7))/0x2)+-parseInt(_0x4b6a8b(0xe1))/0x3*(-parseInt(_0x4b6a8b(0xf2))/0x4)+parseInt(_0x4b6a8b(0xeb))/0x5*(-parseInt(_0x4b6a8b(0xdc))/0x6)+-parseInt(_0x4b6a8b(0xd1))/0x7*(-parseInt(_0x4b6a8b(0xe2))/0x8)+-parseInt(_0x4b6a8b(0xf7))/0x9*(-parseInt(_0x4b6a8b(0xe6))/0xa)+-parseInt(_0x4b6a8b(0xd6))/0xb+-parseInt(_0x4b6a8b(0xe4))/0xc;if(_0x51e212===_0x3212be)break;else _0x5443a8['push'](_0x5443a8['shift']());}catch(_0x9b21d4){_0x5443a8['push'](_0x5443a8['shift']());}}}(a46_0xfc20,0x8c4be));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';function a46_0xfc20(){const _0x2893f2=['20PTsMZa','data','args','Querying\x20','Show\x20table\x20contents','Usage:\x20tdx\x20show\x20<database.table>','verbose','19512qxgTIB','Site:\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','show','cause','9nElwrJ','\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>','35077JtUEFQ','175382WrZICf','\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>','catalog','execute','6659697xKffNg','2AIbmCR','\x20row','table','Limit:\x20','showTable','216126bEsdBx','length','✔\x20Query\x20successful\x20-\x200\x20rows\x20returned','message','query','174Tolwvk','656wrHeMJ','description','2993592XoXlpo','Error:\x20','7044230CBtmTd','name','error','database','\x20from\x20'];a46_0xfc20=function(){return _0x2893f2;};return a46_0xfc20();}import{parseTableReference,validateTableDescribeReference}from'../utils/table-ref-parser.js';function a46_0x3927(_0x46aed4,_0x425462){_0x46aed4=_0x46aed4-0xd0;const _0xfc205c=a46_0xfc20();let _0x3927dd=_0xfc205c[_0x46aed4];return _0x3927dd;}import{withSpinner}from'../utils/spinner.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';export class ShowCommand extends BaseCommand{[a46_0x3f54fb(0xe7)]=a46_0x3f54fb(0xf5);[a46_0x3f54fb(0xe3)]=a46_0x3f54fb(0xef);async[a46_0x3f54fb(0xd5)](_0x11711c){return this['showTable'](_0x11711c);}async[a46_0x3f54fb(0xdb)](_0x2d9e4e){const _0x1dd2b9=a46_0x3f54fb,{options:_0x14e526,args:_0x4bf67c,tdx:_0x1e615b}=_0x2d9e4e;let _0x501ab0;try{_0x501ab0=parseTableReference(_0x4bf67c[0x0]);const _0x12dd31=_0x14e526['database'];!_0x501ab0['database']&&_0x12dd31&&(_0x501ab0[_0x1dd2b9(0xe9)]=_0x12dd31);const _0x52d05a=validateTableDescribeReference(_0x501ab0);if(_0x52d05a)return console[_0x1dd2b9(0xe8)](_0x1dd2b9(0xe5)+_0x52d05a),console[_0x1dd2b9(0xe8)](_0x1dd2b9(0xf0)),console[_0x1dd2b9(0xe8)]('\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>'),console[_0x1dd2b9(0xe8)](_0x1dd2b9(0xd3)),0x1;}catch(_0x5a2d79){return console[_0x1dd2b9(0xe8)](_0x1dd2b9(0xe5)+_0x5a2d79[_0x1dd2b9(0xdf)]),console[_0x1dd2b9(0xe8)]('Usage:\x20tdx\x20show\x20<database.table>'),console[_0x1dd2b9(0xe8)](_0x1dd2b9(0xd0)),console['error'](_0x1dd2b9(0xd3)),0x1;}const _0x3860ad=_0x501ab0[_0x1dd2b9(0xd4)],_0x2a2558=_0x501ab0[_0x1dd2b9(0xe9)],_0x47a570=_0x501ab0[_0x1dd2b9(0xd9)],_0x1dbe3e=resolveLimit(_0x14e526['limit'],DEFAULT_DISPLAY_LIMIT);try{_0x14e526['verbose']&&(console[_0x1dd2b9(0xe8)](_0x1dd2b9(0xf3)+_0x14e526['site']),_0x3860ad&&console[_0x1dd2b9(0xe8)]('Catalog:\x20'+_0x3860ad),console['error']('Database:\x20'+_0x2a2558),console[_0x1dd2b9(0xe8)]('Table:\x20'+_0x47a570),console[_0x1dd2b9(0xe8)](_0x1dd2b9(0xda)+_0x1dbe3e));const _0x763cbd=_0x3860ad?_0x3860ad+'.'+_0x2a2558+'.'+_0x47a570:_0x2a2558+'.'+_0x47a570,_0x4d5841=await withSpinner(_0x1dd2b9(0xee)+_0x763cbd+'...',()=>_0x1e615b[_0x1dd2b9(0xe0)][_0x1dd2b9(0xdb)](_0x2a2558,_0x47a570,_0x1dbe3e,_0x3860ad),{'verbose':_0x14e526[_0x1dd2b9(0xf1)]}),_0x5b1b6e=_0x4d5841['data'],_0xab265f=_0x5b1b6e[_0x1dd2b9(0xec)];return _0xab265f[_0x1dd2b9(0xdd)]===0x0?console[_0x1dd2b9(0xe8)](_0x1dd2b9(0xde)):console[_0x1dd2b9(0xe8)]('✔\x20Retrieved\x20'+_0xab265f['length']+_0x1dd2b9(0xd8)+(_0xab265f['length']!==0x1?'s':'')+_0x1dd2b9(0xea)+_0x763cbd),await handleSDKOutput(_0xab265f,_0x14e526),0x0;}catch(_0x22df27){if(_0x22df27 instanceof SDKError)return console[_0x1dd2b9(0xe8)](_0x1dd2b9(0xe5)+_0x22df27['message']),_0x22df27[_0x1dd2b9(0xf6)]&&console[_0x1dd2b9(0xe8)]('\x20\x20Cause:\x20'+_0x22df27[_0x1dd2b9(0xf6)]),0x1;throw _0x22df27;}}['validate'](_0x1b6a7f){const _0x18aa29=a46_0x3f54fb;if(_0x1b6a7f[_0x18aa29(0xed)][_0x18aa29(0xdd)]===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(_0x1b6a7f[_0x18aa29(0xed)]['length']>0x1)return _0x18aa29(0xf4);return undefined;}}
1
+ function a46_0x1a11(_0x13efea,_0xb98f05){_0x13efea=_0x13efea-0x1f1;const _0x486f60=a46_0x486f();let _0x1a1105=_0x486f60[_0x13efea];return _0x1a1105;}const a46_0x29de96=a46_0x1a11;(function(_0x213814,_0x4b330d){const _0x25fdb2=a46_0x1a11,_0x31eecb=_0x213814();while(!![]){try{const _0x5735da=parseInt(_0x25fdb2(0x1f5))/0x1+-parseInt(_0x25fdb2(0x1f2))/0x2+parseInt(_0x25fdb2(0x1f3))/0x3*(-parseInt(_0x25fdb2(0x212))/0x4)+-parseInt(_0x25fdb2(0x1fc))/0x5+parseInt(_0x25fdb2(0x207))/0x6*(-parseInt(_0x25fdb2(0x200))/0x7)+-parseInt(_0x25fdb2(0x216))/0x8*(parseInt(_0x25fdb2(0x203))/0x9)+parseInt(_0x25fdb2(0x20a))/0xa*(parseInt(_0x25fdb2(0x214))/0xb);if(_0x5735da===_0x4b330d)break;else _0x31eecb['push'](_0x31eecb['shift']());}catch(_0x5a25cd){_0x31eecb['push'](_0x31eecb['shift']());}}}(a46_0x486f,0x19fa5));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';import{parseTableReference,validateTableDescribeReference}from'../utils/table-ref-parser.js';import{withSpinner}from'../utils/spinner.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';export class ShowCommand extends BaseCommand{[a46_0x29de96(0x1f1)]=a46_0x29de96(0x1fd);[a46_0x29de96(0x1fa)]=a46_0x29de96(0x208);async[a46_0x29de96(0x1f7)](_0x1bc7da){return this['showTable'](_0x1bc7da);}async[a46_0x29de96(0x1f8)](_0x141be9){const _0x46c2a4=a46_0x29de96,{options:_0x4128a2,args:_0xef14b,tdx:_0x2c23c1}=_0x141be9;let _0x35ce18;try{_0x35ce18=parseTableReference(_0xef14b[0x0]);const _0x5ed40d=_0x4128a2[_0x46c2a4(0x1f4)];!_0x35ce18[_0x46c2a4(0x1f4)]&&_0x5ed40d&&(_0x35ce18[_0x46c2a4(0x1f4)]=_0x5ed40d);const _0x2aad0a=validateTableDescribeReference(_0x35ce18);if(_0x2aad0a)return console[_0x46c2a4(0x1ff)]('Error:\x20'+_0x2aad0a),console[_0x46c2a4(0x1ff)](_0x46c2a4(0x20e)),console[_0x46c2a4(0x1ff)]('\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>'),console[_0x46c2a4(0x1ff)](_0x46c2a4(0x1fb)),0x1;}catch(_0x1abca4){return console[_0x46c2a4(0x1ff)](_0x46c2a4(0x206)+_0x1abca4['message']),console[_0x46c2a4(0x1ff)](_0x46c2a4(0x20e)),console['error'](_0x46c2a4(0x204)),console[_0x46c2a4(0x1ff)](_0x46c2a4(0x1fb)),0x1;}const _0x54ddc5=_0x35ce18[_0x46c2a4(0x202)],_0x2da9f4=_0x35ce18['database'],_0xb8f3d8=_0x35ce18[_0x46c2a4(0x215)],_0x1df07f=resolveLimit(_0x4128a2['limit'],DEFAULT_DISPLAY_LIMIT);try{_0x4128a2['verbose']&&(console[_0x46c2a4(0x1ff)]('Site:\x20'+_0x4128a2['site']),_0x54ddc5&&console[_0x46c2a4(0x1ff)]('Catalog:\x20'+_0x54ddc5),console[_0x46c2a4(0x1ff)](_0x46c2a4(0x201)+_0x2da9f4),console['error'](_0x46c2a4(0x209)+_0xb8f3d8),console[_0x46c2a4(0x1ff)]('Limit:\x20'+_0x1df07f));const _0x2aec89=_0x54ddc5?_0x54ddc5+'.'+_0x2da9f4+'.'+_0xb8f3d8:_0x2da9f4+'.'+_0xb8f3d8,_0x5a0409=await withSpinner('Querying\x20'+_0x2aec89+_0x46c2a4(0x20c),()=>_0x2c23c1[_0x46c2a4(0x217)][_0x46c2a4(0x1f8)](_0x2da9f4,_0xb8f3d8,_0x1df07f,_0x54ddc5),{'verbose':_0x4128a2[_0x46c2a4(0x20d)]}),_0x5b8e68=_0x5a0409[_0x46c2a4(0x211)],_0x2f73fe=_0x5b8e68[_0x46c2a4(0x211)];return _0x2f73fe[_0x46c2a4(0x1f9)]===0x0?console['error']('✔\x20Query\x20successful\x20-\x200\x20rows\x20returned'):console[_0x46c2a4(0x1ff)](_0x46c2a4(0x213)+_0x2f73fe['length']+_0x46c2a4(0x205)+(_0x2f73fe[_0x46c2a4(0x1f9)]!==0x1?'s':'')+'\x20from\x20'+_0x2aec89),await handleSDKOutput(_0x2f73fe,_0x4128a2),0x0;}catch(_0x5a6f7b){if(_0x5a6f7b instanceof SDKError)return console[_0x46c2a4(0x1ff)]('Error:\x20'+_0x5a6f7b[_0x46c2a4(0x20b)]),_0x5a6f7b[_0x46c2a4(0x1f6)]&&console[_0x46c2a4(0x1ff)]('\x20\x20Cause:\x20'+_0x5a6f7b['cause']),0x1;throw _0x5a6f7b;}}[a46_0x29de96(0x1fe)](_0x41225f){const _0xdaf245=a46_0x29de96;if(_0x41225f['args']['length']===0x0)return _0xdaf245(0x210);if(_0x41225f[_0xdaf245(0x20f)][_0xdaf245(0x1f9)]>0x1)return _0xdaf245(0x218);return undefined;}}function a46_0x486f(){const _0x5efd39=['1239oYFnMy','database','31799ZEScdD','cause','execute','showTable','length','description','\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>','145485lhAbLx','show','validate','error','7iANkjN','Database:\x20','catalog','23823USDhBx','\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>','\x20row','Error:\x20','9642fatgzY','Show\x20table\x20contents','Table:\x20','2050PyXafD','message','...','verbose','Usage:\x20tdx\x20show\x20<database.table>','args','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','data','404jEOzNl','✔\x20Retrieved\x20','13519VnPDuN','table','8XbmUKA','query','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','name','204550kIbXip'];a46_0x486f=function(){return _0x5efd39;};return a46_0x486f();}
@@ -1 +1 @@
1
- function a47_0x2c5a(_0x363c59,_0x57f353){_0x363c59=_0x363c59-0xd3;const _0x5e2662=a47_0x5e26();let _0x2c5a2f=_0x5e2662[_0x363c59];return _0x2c5a2f;}const a47_0x59b906=a47_0x2c5a;(function(_0x5b540b,_0x3bd7c7){const _0x4686a9=a47_0x2c5a,_0x138bad=_0x5b540b();while(!![]){try{const _0x2ea623=-parseInt(_0x4686a9(0xd3))/0x1+parseInt(_0x4686a9(0xf2))/0x2*(-parseInt(_0x4686a9(0xd9))/0x3)+parseInt(_0x4686a9(0xef))/0x4*(parseInt(_0x4686a9(0xe1))/0x5)+parseInt(_0x4686a9(0xe8))/0x6+parseInt(_0x4686a9(0xd7))/0x7+parseInt(_0x4686a9(0xfb))/0x8+-parseInt(_0x4686a9(0xf6))/0x9;if(_0x2ea623===_0x3bd7c7)break;else _0x138bad['push'](_0x138bad['shift']());}catch(_0x379578){_0x138bad['push'](_0x138bad['shift']());}}}(a47_0x5e26,0x2b4bb));import{BaseCommand,printAuthError}from'./command.js';import{resolveAPIKeyAsync}from'../core/config.js';function a47_0x5e26(){const _0x5ae75d=['log','jobs','site:\x20','status','234442pBGDbc','account_id','error','✗\x20Validation\x20failed:\x20','659134fRKVqU','Account\x20ID:','357387KpTtvh','getUserInfo','TDX_PROFILE\x20env','Read\x20credential\x20from\x20','OAuth','config','env','\x20profile:\x20','50oqSzQG','message','profile','N/A','filter','cyan','bold','310860BAfJDQ','No\x20credential\x20found','yellow','Show\x20authentication\x20status\x20and\x20current\x20context','execute','site','✓\x20Authentication\x20successful\x0a','129308SOjRFu','description','Credential\x20type:\x20','4BjDyCw','dim','session','User:','828720kkFVtO','green','first_name','email','last_name','2183016ipZVbQ','CLI\x20flag'];a47_0x5e26=function(){return _0x5ae75d;};return a47_0x5e26();}import{getOAuthTokens}from'../core/oauth-keychain.js';import{HTTPClientError}from'../sdk/client/http-client.js';import{GlobalContext}from'../core/global-context.js';import a47_0x140b56 from'chalk';export class StatusCommand extends BaseCommand{['name']=a47_0x59b906(0x100);[a47_0x59b906(0xf0)]=a47_0x59b906(0xeb);async[a47_0x59b906(0xec)](_0x27b689){const _0x1ee425=a47_0x59b906,{options:_0x174a2f,tdx:_0xc1a069}=_0x27b689,_0x41ed68=_0x174a2f[_0x1ee425(0xed)],_0x411420=new GlobalContext(_0x174a2f),_0x22a626=_0x411420[_0x1ee425(0xe3)],_0x12a79e=_0x411420['profileSource'],_0x207b08=_0x12a79e==='cli'?_0x1ee425(0xfc):_0x12a79e===_0x1ee425(0xf4)?_0x1ee425(0xf4):_0x12a79e===_0x1ee425(0xdf)?_0x1ee425(0xdb):_0x12a79e===_0x1ee425(0xde)?_0x1ee425(0xde):null,_0x3739d4=_0x22a626?a47_0x140b56[_0x1ee425(0xe6)](_0x22a626):a47_0x140b56[_0x1ee425(0xf3)](_0x1ee425(0xe4)),_0x59598c=_0x207b08?'\x20'+a47_0x140b56[_0x1ee425(0xf3)]('(from\x20'+_0x207b08+')'):'';console[_0x1ee425(0xfd)](a47_0x140b56[_0x1ee425(0xe7)]('tdx')+_0x1ee425(0xe0)+_0x3739d4+_0x59598c+'\x20'+a47_0x140b56['dim']('(')+_0x1ee425(0xff)+a47_0x140b56[_0x1ee425(0xe6)](_0x41ed68)+a47_0x140b56[_0x1ee425(0xf3)](')'));const _0x453a5a=await getOAuthTokens(_0x22a626);if(_0x453a5a)console[_0x1ee425(0xfd)](_0x1ee425(0xf1)+a47_0x140b56[_0x1ee425(0xe6)](_0x1ee425(0xdd)));else{const _0x222251=await resolveAPIKeyAsync(_0x41ed68,_0x22a626);if(_0x222251){const {source:_0x49bb23,isDeprecated:_0x5c5340}=_0x222251,_0x48ad47=_0x1ee425(0xdc)+a47_0x140b56[_0x1ee425(0xe6)](_0x49bb23);console['log'](_0x5c5340?a47_0x140b56[_0x1ee425(0xea)](_0x48ad47):_0x48ad47);}else console[_0x1ee425(0xfd)](a47_0x140b56[_0x1ee425(0xea)](_0x1ee425(0xe9)));}let _0xbfd20b=![];try{const _0x329d56=await _0xc1a069[_0x1ee425(0xfe)][_0x1ee425(0xda)]();console[_0x1ee425(0xfd)](a47_0x140b56[_0x1ee425(0xf7)](_0x1ee425(0xee))),console[_0x1ee425(0xfd)](a47_0x140b56[_0x1ee425(0xe7)](_0x1ee425(0xf5))+'\x20'+a47_0x140b56[_0x1ee425(0xe6)](_0x329d56[_0x1ee425(0xf9)]));if(_0x329d56['first_name']||_0x329d56['last_name']){const _0x5b6e22=[_0x329d56[_0x1ee425(0xf8)],_0x329d56[_0x1ee425(0xfa)]][_0x1ee425(0xe5)](Boolean)['join']('\x20');console['log'](a47_0x140b56['bold']('Name:')+'\x20'+_0x5b6e22);}_0x329d56[_0x1ee425(0xd4)]&&console[_0x1ee425(0xfd)](a47_0x140b56[_0x1ee425(0xe7)](_0x1ee425(0xd8))+'\x20'+a47_0x140b56[_0x1ee425(0xea)](_0x329d56[_0x1ee425(0xd4)])),_0xbfd20b=!![];}catch(_0x84169b){_0x84169b instanceof HTTPClientError&&_0x84169b[_0x1ee425(0x100)]===0x191?printAuthError(_0x84169b,!![],_0x22a626):console[_0x1ee425(0xd5)](a47_0x140b56['red'](_0x1ee425(0xd6)+(_0x84169b instanceof Error?_0x84169b[_0x1ee425(0xe2)]:String(_0x84169b))));}return console[_0x1ee425(0xfd)](),_0x411420['displayWithSources'](),_0xbfd20b?0x0:0x1;}}
1
+ const a47_0x2a7e33=a47_0x3ff0;(function(_0x85ad07,_0xb5cbe0){const _0x5cfcc6=a47_0x3ff0,_0x5b7343=_0x85ad07();while(!![]){try{const _0x36752d=-parseInt(_0x5cfcc6(0xce))/0x1*(-parseInt(_0x5cfcc6(0xeb))/0x2)+parseInt(_0x5cfcc6(0xcd))/0x3+-parseInt(_0x5cfcc6(0xc4))/0x4*(parseInt(_0x5cfcc6(0xd4))/0x5)+parseInt(_0x5cfcc6(0xe9))/0x6*(parseInt(_0x5cfcc6(0xe7))/0x7)+parseInt(_0x5cfcc6(0xc9))/0x8*(parseInt(_0x5cfcc6(0xdc))/0x9)+-parseInt(_0x5cfcc6(0xdb))/0xa+-parseInt(_0x5cfcc6(0xe8))/0xb;if(_0x36752d===_0xb5cbe0)break;else _0x5b7343['push'](_0x5b7343['shift']());}catch(_0x36885c){_0x5b7343['push'](_0x5b7343['shift']());}}}(a47_0x6ac3,0xb8381));import{BaseCommand,printAuthError}from'./command.js';import{resolveAPIKeyAsync}from'../core/config.js';function a47_0x3ff0(_0x348837,_0x41b150){_0x348837=_0x348837-0xc2;const _0x6ac3f0=a47_0x6ac3();let _0x3ff08d=_0x6ac3f0[_0x348837];return _0x3ff08d;}import{getOAuthTokens}from'../core/oauth-keychain.js';import{HTTPClientError}from'../sdk/client/http-client.js';import{GlobalContext}from'../core/global-context.js';import a47_0x297ac9 from'chalk';export class StatusCommand extends BaseCommand{['name']=a47_0x2a7e33(0xc6);[a47_0x2a7e33(0xca)]=a47_0x2a7e33(0xc8);async[a47_0x2a7e33(0xe2)](_0x508bb8){const _0x2d79cc=a47_0x2a7e33,{options:_0x1d529d,tdx:_0x5b960b}=_0x508bb8,_0xed0ea6=_0x1d529d['site'],_0x42b7c2=new GlobalContext(_0x1d529d),_0x2a1831=_0x42b7c2['profile'],_0x338ac8=_0x42b7c2['profileSource'],_0x4ab062=_0x338ac8==='cli'?_0x2d79cc(0xe6):_0x338ac8===_0x2d79cc(0xc5)?_0x2d79cc(0xc5):_0x338ac8==='env'?'TDX_PROFILE\x20env':_0x338ac8==='config'?_0x2d79cc(0xd6):null,_0x57ea11=_0x2a1831?a47_0x297ac9[_0x2d79cc(0xdf)](_0x2a1831):a47_0x297ac9[_0x2d79cc(0xd0)](_0x2d79cc(0xc3)),_0x3e6526=_0x4ab062?'\x20'+a47_0x297ac9['dim'](_0x2d79cc(0xea)+_0x4ab062+')'):'';console['log'](a47_0x297ac9[_0x2d79cc(0xd1)]('tdx')+'\x20profile:\x20'+_0x57ea11+_0x3e6526+'\x20'+a47_0x297ac9[_0x2d79cc(0xd0)]('(')+_0x2d79cc(0xd8)+a47_0x297ac9[_0x2d79cc(0xdf)](_0xed0ea6)+a47_0x297ac9[_0x2d79cc(0xd0)](')'));const _0x2e2653=await getOAuthTokens(_0x2a1831);if(_0x2e2653)console[_0x2d79cc(0xd7)]('Credential\x20type:\x20'+a47_0x297ac9[_0x2d79cc(0xdf)]('OAuth'));else{const _0x54d18=await resolveAPIKeyAsync(_0xed0ea6,_0x2a1831);if(_0x54d18){const {source:_0x3ae5b0,isDeprecated:_0x49998a}=_0x54d18,_0x10e789=_0x2d79cc(0xcb)+a47_0x297ac9[_0x2d79cc(0xdf)](_0x3ae5b0);console['log'](_0x49998a?a47_0x297ac9[_0x2d79cc(0xcc)](_0x10e789):_0x10e789);}else console[_0x2d79cc(0xd7)](a47_0x297ac9[_0x2d79cc(0xcc)]('No\x20credential\x20found'));}let _0x2d4c10=![];try{const _0x2e9e97=await _0x5b960b[_0x2d79cc(0xd5)][_0x2d79cc(0xde)]();console[_0x2d79cc(0xd7)](a47_0x297ac9['green'](_0x2d79cc(0xe3))),console['log'](a47_0x297ac9['bold']('User:')+'\x20'+a47_0x297ac9['cyan'](_0x2e9e97[_0x2d79cc(0xe5)]));if(_0x2e9e97[_0x2d79cc(0xda)]||_0x2e9e97[_0x2d79cc(0xc7)]){const _0x2aa3df=[_0x2e9e97[_0x2d79cc(0xda)],_0x2e9e97[_0x2d79cc(0xc7)]][_0x2d79cc(0xcf)](Boolean)[_0x2d79cc(0xc2)]('\x20');console['log'](a47_0x297ac9[_0x2d79cc(0xd1)](_0x2d79cc(0xd3))+'\x20'+_0x2aa3df);}_0x2e9e97[_0x2d79cc(0xe4)]&&console[_0x2d79cc(0xd7)](a47_0x297ac9[_0x2d79cc(0xd1)](_0x2d79cc(0xd2))+'\x20'+a47_0x297ac9[_0x2d79cc(0xcc)](_0x2e9e97['account_id'])),_0x2d4c10=!![];}catch(_0x1e07de){_0x1e07de instanceof HTTPClientError&&_0x1e07de[_0x2d79cc(0xc6)]===0x191?printAuthError(_0x1e07de,!![],_0x2a1831):console[_0x2d79cc(0xe1)](a47_0x297ac9[_0x2d79cc(0xd9)](_0x2d79cc(0xe0)+(_0x1e07de instanceof Error?_0x1e07de[_0x2d79cc(0xdd)]:String(_0x1e07de))));}return console[_0x2d79cc(0xd7)](),_0x42b7c2['displayWithSources'](),_0x2d4c10?0x0:0x1;}}function a47_0x6ac3(){const _0x14ec30=['status','last_name','Show\x20authentication\x20status\x20and\x20current\x20context','11082072eiIkxZ','description','Read\x20credential\x20from\x20','yellow','4168935gMMznW','53dXPiPR','filter','dim','bold','Account\x20ID:','Name:','111115gNPAra','jobs','config','log','site:\x20','red','first_name','4814930HtMvja','9qdHDpu','message','getUserInfo','cyan','✗\x20Validation\x20failed:\x20','error','execute','✓\x20Authentication\x20successful\x0a','account_id','email','CLI\x20flag','14fklmQj','28694138IJXbKj','3793830fOMoea','(from\x20','35414BRMdFz','join','N/A','204piXphl','session'];a47_0x6ac3=function(){return _0x14ec30;};return a47_0x6ac3();}