@treasuredata/tdx 2026.4.14 → 2026.4.16

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 (221) hide show
  1. package/README.md +1 -1
  2. package/dist/bin.js +1 -1
  3. package/dist/build-info.json +3 -3
  4. package/dist/cli-categories.js +1 -1
  5. package/dist/cli.js +1 -1
  6. package/dist/commands/activations.js +1 -1
  7. package/dist/commands/agent-command.js +1 -1
  8. package/dist/commands/agent-test-command.js +1 -1
  9. package/dist/commands/api-command.js +1 -1
  10. package/dist/commands/auth-command.js +1 -1
  11. package/dist/commands/cas-command.js +1 -1
  12. package/dist/commands/cas-segment-command.js +1 -1
  13. package/dist/commands/chat-command.js +1 -1
  14. package/dist/commands/claude-command.js +1 -1
  15. package/dist/commands/claude-statusline-command.js +1 -1
  16. package/dist/commands/claude-usage-command.js +1 -1
  17. package/dist/commands/command.js +1 -1
  18. package/dist/commands/connection-command.js +1 -1
  19. package/dist/commands/databases.js +1 -1
  20. package/dist/commands/delivery-command.js +1 -1
  21. package/dist/commands/describe.js +1 -1
  22. package/dist/commands/engage-campaign-pull-command.js +1 -1
  23. package/dist/commands/engage-campaign-push-command.js +1 -1
  24. package/dist/commands/engage-campaign-validate-command.js +1 -1
  25. package/dist/commands/engage-command.js +1 -1
  26. package/dist/commands/engage-template-pull-command.js +1 -1
  27. package/dist/commands/engage-template-push-command.js +1 -1
  28. package/dist/commands/engage-template-validate-command.js +1 -1
  29. package/dist/commands/job-command.js +1 -1
  30. package/dist/commands/journey-command.js +1 -1
  31. package/dist/commands/journey-validate-command.js +1 -1
  32. package/dist/commands/llm-command.js +1 -1
  33. package/dist/commands/mcp-command.js +1 -1
  34. package/dist/commands/parent-segment-command.js +1 -1
  35. package/dist/commands/policy-command.js +1 -1
  36. package/dist/commands/profile-command.js +1 -1
  37. package/dist/commands/profiles-command.js +1 -1
  38. package/dist/commands/query-command.js +1 -1
  39. package/dist/commands/schedule-command.js +1 -1
  40. package/dist/commands/segment-command.js +1 -1
  41. package/dist/commands/segment-create-command.js +1 -1
  42. package/dist/commands/segment-fields-command.js +1 -1
  43. package/dist/commands/segment-pull-command.js +1 -1
  44. package/dist/commands/segment-push-command.js +1 -1
  45. package/dist/commands/segment-update-command.js +1 -1
  46. package/dist/commands/segment-use-command.js +1 -1
  47. package/dist/commands/segment-validate-command.js +1 -1
  48. package/dist/commands/segments.js +1 -1
  49. package/dist/commands/show.js +1 -1
  50. package/dist/commands/status-command.js +1 -1
  51. package/dist/commands/tables.js +1 -1
  52. package/dist/commands/unset-command.js +1 -1
  53. package/dist/commands/upgrade-command.js +1 -1
  54. package/dist/commands/use-command.js +1 -1
  55. package/dist/commands/user-command.js +1 -1
  56. package/dist/commands/work-command.js +1 -1
  57. package/dist/commands/workflow-command.js +1 -1
  58. package/dist/core/auth.js +1 -1
  59. package/dist/core/command-output.js +1 -1
  60. package/dist/core/config.js +1 -1
  61. package/dist/core/connection-cache.js +1 -1
  62. package/dist/core/constants.js +1 -1
  63. package/dist/core/credential-cache.js +1 -1
  64. package/dist/core/global-context.js +1 -1
  65. package/dist/core/keychain.js +1 -1
  66. package/dist/core/oauth-keychain.js +1 -1
  67. package/dist/core/oauth.js +1 -1
  68. package/dist/core/profile.js +1 -1
  69. package/dist/core/project-config.js +1 -1
  70. package/dist/core/session.js +1 -1
  71. package/dist/core/user-cache.js +1 -1
  72. package/dist/core/version.js +1 -1
  73. package/dist/index.js +1 -1
  74. package/dist/mcp/server.js +1 -1
  75. package/dist/mcp/tools/index.js +1 -1
  76. package/dist/mcp/tools/tdx-run.js +1 -1
  77. package/dist/mcp/tools/tdx-search.js +1 -1
  78. package/dist/mcp/tools/work-create-item.js +1 -1
  79. package/dist/mcp/utils.js +1 -1
  80. package/dist/proxy/claude-usage-tracker.js +1 -1
  81. package/dist/proxy/passthrough-server.js +1 -1
  82. package/dist/proxy/sse-usage-parser.js +1 -1
  83. package/dist/sdk/agent/agent-config.js +1 -1
  84. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  85. package/dist/sdk/agent/agent-yaml.js +1 -1
  86. package/dist/sdk/agent/test/evaluator.js +1 -1
  87. package/dist/sdk/agent/test/executor.js +1 -1
  88. package/dist/sdk/agent/test/index.js +1 -1
  89. package/dist/sdk/agent/test/output.js +1 -1
  90. package/dist/sdk/agent/test/parser.js +1 -1
  91. package/dist/sdk/agent/tool-target-registry.js +1 -1
  92. package/dist/sdk/api.js +1 -1
  93. package/dist/sdk/cas/cas-api-client.js +1 -1
  94. package/dist/sdk/cas/cas-audience-yaml.js +1 -1
  95. package/dist/sdk/cas/cas-segment-yaml.js +1 -1
  96. package/dist/sdk/cas/index.js +1 -1
  97. package/dist/sdk/cas/pull-workflow.js +1 -1
  98. package/dist/sdk/cas/push-workflow.js +1 -1
  99. package/dist/sdk/client/cdp-api-client.js +1 -1
  100. package/dist/sdk/client/delivery-api-client.js +1 -1
  101. package/dist/sdk/client/endpoints.js +1 -1
  102. package/dist/sdk/client/engage-api-client.js +1 -1
  103. package/dist/sdk/client/http-client.js +1 -1
  104. package/dist/sdk/client/llm-api-client.js +1 -1
  105. package/dist/sdk/client/oauth-refresh.js +1 -1
  106. package/dist/sdk/client/rate-limiter.js +1 -1
  107. package/dist/sdk/client/td-api-client.js +1 -1
  108. package/dist/sdk/client/trino-api-client.js +1 -1
  109. package/dist/sdk/client/workflow-client.js +1 -1
  110. package/dist/sdk/connection-validator.js +1 -1
  111. package/dist/sdk/connection.js +1 -1
  112. package/dist/sdk/delivery.js +1 -1
  113. package/dist/sdk/engage/campaign-pull.js +1 -1
  114. package/dist/sdk/engage/campaign-push.js +1 -1
  115. package/dist/sdk/engage/campaign-validator.js +1 -1
  116. package/dist/sdk/engage/campaign-yaml.js +1 -1
  117. package/dist/sdk/engage/template-pull.js +1 -1
  118. package/dist/sdk/engage/template-push.js +1 -1
  119. package/dist/sdk/engage/template-validator.js +1 -1
  120. package/dist/sdk/engage/template-yaml.js +1 -1
  121. package/dist/sdk/engage/types/campaign-def.js +1 -1
  122. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  123. package/dist/sdk/engage/types/template-schema.js +1 -1
  124. package/dist/sdk/engage.js +1 -1
  125. package/dist/sdk/errors.js +1 -1
  126. package/dist/sdk/index.js +1 -1
  127. package/dist/sdk/io/index.js +1 -1
  128. package/dist/sdk/io/node-filesystem.js +1 -1
  129. package/dist/sdk/job.js +1 -1
  130. package/dist/sdk/journey.js +1 -1
  131. package/dist/sdk/llm/chat-cache.js +1 -1
  132. package/dist/sdk/llm/index.js +1 -1
  133. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  134. package/dist/sdk/llm/model-factors.js +1 -1
  135. package/dist/sdk/personalization.js +1 -1
  136. package/dist/sdk/policy.js +1 -1
  137. package/dist/sdk/query/index.js +1 -1
  138. package/dist/sdk/query/sql-parser.js +1 -1
  139. package/dist/sdk/realtime.js +1 -1
  140. package/dist/sdk/schedule.js +1 -1
  141. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  142. package/dist/sdk/segment/fields-display.js +1 -1
  143. package/dist/sdk/segment/file-discovery.js +1 -1
  144. package/dist/sdk/segment/journey-utils.js +1 -1
  145. package/dist/sdk/segment/journey-validator.js +1 -1
  146. package/dist/sdk/segment/journey-yaml.js +1 -1
  147. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  148. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  149. package/dist/sdk/segment/pull-workflow.js +1 -1
  150. package/dist/sdk/segment/push-recovery.js +1 -1
  151. package/dist/sdk/segment/push-workflow.js +1 -1
  152. package/dist/sdk/segment/resolution-context.js +1 -1
  153. package/dist/sdk/segment/segment-path-parser.js +1 -1
  154. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  155. package/dist/sdk/segment/segment-validator.js +1 -1
  156. package/dist/sdk/segment/target-resolution.js +1 -1
  157. package/dist/sdk/segment/tdx-config.js +1 -1
  158. package/dist/sdk/segment/types/activation-schema.js +1 -1
  159. package/dist/sdk/segment/types/journey-def.js +1 -1
  160. package/dist/sdk/segment/types/journey-schema.js +1 -1
  161. package/dist/sdk/segment/types/segment-def.js +1 -1
  162. package/dist/sdk/segment/types/segment-schema.js +1 -1
  163. package/dist/sdk/segment/validate-files.js +1 -1
  164. package/dist/sdk/segment/yaml-validator.js +1 -1
  165. package/dist/sdk/segment.js +1 -1
  166. package/dist/sdk/types/index.js +1 -1
  167. package/dist/sdk/types/progress.js +1 -1
  168. package/dist/sdk/types/workspace.js +1 -1
  169. package/dist/sdk/user.js +1 -1
  170. package/dist/sdk/util/format-detector.js +1 -1
  171. package/dist/sdk/util/formatters.js +1 -1
  172. package/dist/sdk/util/index.js +1 -1
  173. package/dist/sdk/util/paginate.js +1 -1
  174. package/dist/sdk/util/tree-formatter.js +1 -1
  175. package/dist/sdk/workflow/archive-validation.js +1 -1
  176. package/dist/sdk/workflow/clone-workflow.js +1 -1
  177. package/dist/sdk/workflow/index.js +1 -1
  178. package/dist/sdk/workflow/pull-workflow.js +1 -1
  179. package/dist/sdk/workflow/push-workflow.js +1 -1
  180. package/dist/sdk/workflow/tdx-config.js +1 -1
  181. package/dist/sdk/workflow/workflow-utils.js +1 -1
  182. package/dist/sdk/workspace/access-tracker.js +1 -1
  183. package/dist/sdk/workspace/frontmatter.js +1 -1
  184. package/dist/sdk/workspace/git.js +1 -1
  185. package/dist/sdk/workspace/index.js +1 -1
  186. package/dist/sdk/workspace/templates.js +1 -1
  187. package/dist/sdk/workspace/weekly.js +1 -1
  188. package/dist/sdk/workspace/wikilinks.js +1 -1
  189. package/dist/test-utils/command-runner.js +1 -1
  190. package/dist/test-utils/factories.js +1 -1
  191. package/dist/test-utils/fixtures.js +1 -1
  192. package/dist/test-utils/http-mock.js +1 -1
  193. package/dist/test-utils/index.js +1 -1
  194. package/dist/utils/async.js +1 -1
  195. package/dist/utils/colors.js +1 -1
  196. package/dist/utils/diff.js +1 -1
  197. package/dist/utils/file-permissions.js +1 -1
  198. package/dist/utils/file-reader.js +1 -1
  199. package/dist/utils/github-releases.js +1 -1
  200. package/dist/utils/global-cache.js +1 -1
  201. package/dist/utils/json-loader.js +1 -1
  202. package/dist/utils/local-cache.js +1 -1
  203. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  204. package/dist/utils/logger/formatters/index.js +1 -1
  205. package/dist/utils/logger/handlers/console-handler.js +1 -1
  206. package/dist/utils/logger/handlers/file-handler.js +1 -1
  207. package/dist/utils/logger/handlers/index.js +1 -1
  208. package/dist/utils/logger/handlers/null-handler.js +1 -1
  209. package/dist/utils/logger/index.js +1 -1
  210. package/dist/utils/logger/logger.js +1 -1
  211. package/dist/utils/logger/types.js +1 -1
  212. package/dist/utils/option-validation.js +1 -1
  213. package/dist/utils/process.js +1 -1
  214. package/dist/utils/prompt.js +1 -1
  215. package/dist/utils/spinner.js +1 -1
  216. package/dist/utils/sse-parser.js +1 -1
  217. package/dist/utils/string-utils.js +1 -1
  218. package/dist/utils/table-ref-parser.js +1 -1
  219. package/dist/utils/tdx-logger.js +1 -1
  220. package/dist/utils/version-check.js +1 -1
  221. package/package.json +30 -12
@@ -1 +1 @@
1
- const a40_0xa5699a=a40_0x35b8;function a40_0x35b8(_0x1d4bcc,_0x5d0382){_0x1d4bcc=_0x1d4bcc-0x160;const _0x15d905=a40_0x15d9();let _0x35b87a=_0x15d905[_0x1d4bcc];return _0x35b87a;}(function(_0x1a82b6,_0x8680ed){const _0x323c2c=a40_0x35b8,_0x17c60d=_0x1a82b6();while(!![]){try{const _0x2c6bf1=-parseInt(_0x323c2c(0x1a3))/0x1+parseInt(_0x323c2c(0x1a8))/0x2+-parseInt(_0x323c2c(0x190))/0x3+parseInt(_0x323c2c(0x19a))/0x4+-parseInt(_0x323c2c(0x19e))/0x5+parseInt(_0x323c2c(0x1ad))/0x6*(-parseInt(_0x323c2c(0x18c))/0x7)+-parseInt(_0x323c2c(0x16f))/0x8*(-parseInt(_0x323c2c(0x181))/0x9);if(_0x2c6bf1===_0x8680ed)break;else _0x17c60d['push'](_0x17c60d['shift']());}catch(_0x2d288e){_0x17c60d['push'](_0x17c60d['shift']());}}}(a40_0x15d9,0x95050));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_0x219c53 from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';function a40_0x15d9(){const _0x25b4a1=['journeys','\x20versions)','repeat','\x20\x20🎯\x20','Aborted.','\x20journeys','No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27','activations','\x20activations','1460168EHSnrD','parent_segment','name','Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files','1411525lryTqJ','type','message','✔\x20Pulled\x20','-\x20no\x20files\x20written','486349iTpAOc','Target\x20resource:\x20','counts','execute','errorCode','1433184OfATYG','\x20files\x20to\x20','error','targetDir','yellow','393900uvXyDK','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','\x20segments','\x0aChanges\x20to\x20\x27','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','parentName','\x27...','journeyVersions','✔\x20Context\x20set:\x20','dryRun','\x0aError:','description','\x20changed\x20files','filter','\x20with\x20','red','8532296FJOHeB','setPhase','cyan','\x20\x20Target:\x20','Usage:\x20tdx\x20sg\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20(requires\x20context\x20or\x20tdx.json)','diff','parentSegment','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','green','length','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file','helpText','dim','verbose','\x20\x20🗺️\x20\x20','Pulling\x20segments\x20from\x20\x27','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent','Write\x20','18IJMLEa','\x0aPull\x20summary\x20for\x20\x27','hasChanges','content','session','files','✔\x20All\x20files\x20are\x20up\x20to\x20date','dirname','resourceName','segment','segments','112nBHirx','Parent\x20segment:\x20','isNew','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','2355810fvvkvw'];a40_0x15d9=function(){return _0x25b4a1;};return a40_0x15d9();}import a40_0x155586 from'path';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';export{buildFolderIdToPathMap as buildFolderPathMap}from'../sdk/segment/resolution-context.js';export class SegmentPullCommand extends BaseCommand{[a40_0xa5699a(0x19c)]='segment:pull';[a40_0xa5699a(0x16a)]=a40_0xa5699a(0x19d);async[a40_0xa5699a(0x1a6)](_0x3bf037){const _0x3faaa6=a40_0xa5699a,{options:_0x5d840f,args:_0x51638c,tdx:_0x4993df}=_0x3bf037,_0x51270e=_0x5d840f,_0x1d9aed=await resolveTarget({'arg':_0x51638c[0x0],'contextParent':_0x5d840f[_0x3faaa6(0x175)],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x1d9aed))return _0x1d9aed[_0x3faaa6(0x1a7)]==='no_parent'?(console[_0x3faaa6(0x1aa)](a40_0x219c53[_0x3faaa6(0x1ac)](_0x3faaa6(0x163))),console[_0x3faaa6(0x1aa)](_0x3faaa6(0x173)),console[_0x3faaa6(0x1aa)](_0x3faaa6(0x17f)),console[_0x3faaa6(0x1aa)](_0x3faaa6(0x179))):(console['error'](a40_0x219c53[_0x3faaa6(0x16e)]('Error:\x20'+_0x1d9aed[_0x3faaa6(0x1a0)]+'\x0a')),_0x1d9aed[_0x3faaa6(0x17a)]&&console['error'](a40_0x219c53[_0x3faaa6(0x171)](_0x1d9aed[_0x3faaa6(0x17a)]))),0x1;const _0x382eb0=_0x1d9aed[_0x3faaa6(0x164)],_0x3d7997=_0x1d9aed[_0x3faaa6(0x1ab)],_0x244e55=_0x1d9aed[_0x3faaa6(0x19f)]==='file'?_0x1d9aed[_0x3faaa6(0x189)]:undefined;_0x51270e[_0x3faaa6(0x17c)]&&(console[_0x3faaa6(0x1aa)]('Site:\x20'+_0x51270e['site']),console[_0x3faaa6(0x1aa)](_0x3faaa6(0x18d)+_0x382eb0),_0x244e55&&console[_0x3faaa6(0x1aa)](_0x3faaa6(0x1a4)+_0x244e55));const _0x1679da=await withProgressSpinner(_0x3faaa6(0x17e)+_0x382eb0+_0x3faaa6(0x165),_0xb23d32=>_0x4993df[_0x3faaa6(0x18a)]['pullSegments'](_0x382eb0,{'targetDir':_0x3d7997,'targetResourceName':_0x244e55,'verbose':_0x51270e[_0x3faaa6(0x17c)],'progress':{'update':_0x3a6603=>{const _0x55a851=_0x3faaa6;_0xb23d32[_0x55a851(0x170)](_0x3a6603),_0x51270e[_0x55a851(0x17c)]&&console['error']('\x20\x20'+_0x3a6603);}}}),{'verbose':_0x51270e['verbose']}),_0x10190b=_0x1679da['data'];if(_0x10190b['counts'][_0x3faaa6(0x18b)]===0x0&&_0x10190b[_0x3faaa6(0x1a5)][_0x3faaa6(0x191)]===0x0)return console['error'](a40_0x219c53['yellow'](_0x3faaa6(0x197)+_0x10190b[_0x3faaa6(0x164)]+'\x27')),0x0;const _0x125fbf=_0x10190b['files'][_0x3faaa6(0x16c)](_0x2fc9e4=>_0x2fc9e4[_0x3faaa6(0x18e)]),_0x35eb13=_0x10190b[_0x3faaa6(0x186)][_0x3faaa6(0x16c)](_0x18ee6b=>!_0x18ee6b[_0x3faaa6(0x18e)]&&_0x18ee6b['hasChanges']),_0x40b15e=_0x10190b[_0x3faaa6(0x186)][_0x3faaa6(0x16c)](_0x551192=>!_0x551192[_0x3faaa6(0x18e)]&&!_0x551192[_0x3faaa6(0x183)]);console['error'](_0x3faaa6(0x182)+_0x10190b[_0x3faaa6(0x164)]+'\x27:'),console[_0x3faaa6(0x1aa)](_0x3faaa6(0x194)+a40_0x219c53[_0x3faaa6(0x171)](_0x10190b[_0x3faaa6(0x1a5)][_0x3faaa6(0x18b)]+_0x3faaa6(0x161))+_0x3faaa6(0x16d)+a40_0x219c53[_0x3faaa6(0x171)](_0x10190b[_0x3faaa6(0x1a5)][_0x3faaa6(0x198)]+_0x3faaa6(0x199)));if(_0x10190b['counts'][_0x3faaa6(0x191)]>0x0){const _0x1058d5=_0x10190b[_0x3faaa6(0x1a5)][_0x3faaa6(0x166)]>_0x10190b[_0x3faaa6(0x1a5)]['journeys']?'\x20('+_0x10190b['counts']['journeyVersions']+_0x3faaa6(0x192):'';console[_0x3faaa6(0x1aa)](_0x3faaa6(0x17d)+a40_0x219c53['cyan'](_0x10190b[_0x3faaa6(0x1a5)][_0x3faaa6(0x191)]+_0x3faaa6(0x196))+a40_0x219c53[_0x3faaa6(0x17b)](_0x1058d5));}console[_0x3faaa6(0x1aa)]('\x20\x20'+a40_0x219c53[_0x3faaa6(0x177)]('+\x20'+_0x125fbf[_0x3faaa6(0x178)]+'\x20new\x20files')),console['error']('\x20\x20'+a40_0x219c53[_0x3faaa6(0x1ac)]('~\x20'+_0x35eb13['length']+_0x3faaa6(0x16b))),console[_0x3faaa6(0x1aa)]('\x20\x20'+a40_0x219c53[_0x3faaa6(0x17b)]('=\x20'+_0x40b15e[_0x3faaa6(0x178)]+'\x20unchanged\x20files')),console[_0x3faaa6(0x1aa)](_0x3faaa6(0x172)+a40_0x219c53[_0x3faaa6(0x171)](_0x10190b[_0x3faaa6(0x1ab)])+'\x0a');if(_0x35eb13[_0x3faaa6(0x178)]>0x0)for(const _0x348c40 of _0x35eb13){console[_0x3faaa6(0x1aa)](_0x3faaa6(0x162)+_0x348c40['relativePath']+'\x27:'),console[_0x3faaa6(0x1aa)]('─'['repeat'](0x3c)),console['error'](_0x348c40[_0x3faaa6(0x174)]),console[_0x3faaa6(0x1aa)]('─'[_0x3faaa6(0x193)](0x3c));}if(_0x51270e[_0x3faaa6(0x168)])return console[_0x3faaa6(0x1aa)](a40_0x219c53['yellow'](_0x3faaa6(0x176))),0x0;if(_0x125fbf[_0x3faaa6(0x178)]===0x0&&_0x35eb13[_0x3faaa6(0x178)]===0x0)return console[_0x3faaa6(0x1aa)](a40_0x219c53['green'](_0x3faaa6(0x187))),saveSessionContext({'parent_segment':_0x10190b[_0x3faaa6(0x164)]},_0x51270e[_0x3faaa6(0x185)]),console[_0x3faaa6(0x1aa)](a40_0x219c53['green']('✔\x20Context\x20set:\x20'+a40_0x219c53[_0x3faaa6(0x17b)](_0x3faaa6(0x19b))+'\x20=\x20'+a40_0x219c53[_0x3faaa6(0x171)](_0x10190b[_0x3faaa6(0x164)]))),0x0;if(!_0x51270e['yes']){if(!isInteractive())return console[_0x3faaa6(0x1aa)](a40_0x219c53[_0x3faaa6(0x16e)](_0x3faaa6(0x169)),_0x3faaa6(0x160)),console[_0x3faaa6(0x1aa)](a40_0x219c53['dim'](_0x3faaa6(0x18f))),0x1;const _0x374b79=await confirmKey(_0x3faaa6(0x180)+(_0x125fbf[_0x3faaa6(0x178)]+_0x35eb13[_0x3faaa6(0x178)])+'\x20files?');if(!_0x374b79)return console[_0x3faaa6(0x1aa)](a40_0x219c53[_0x3faaa6(0x1ac)](_0x3faaa6(0x195)),_0x3faaa6(0x1a2)),0x1;}for(const _0x1c4833 of _0x10190b[_0x3faaa6(0x186)]){if(_0x1c4833[_0x3faaa6(0x18e)]||_0x1c4833['hasChanges']){const _0x540a96=a40_0x155586[_0x3faaa6(0x188)](_0x1c4833['absolutePath']);!existsSync(_0x540a96)&&mkdirSync(_0x540a96,{'recursive':!![]}),writeFileSync(_0x1c4833['absolutePath'],_0x1c4833[_0x3faaa6(0x184)],'utf-8');}}return console['error'](a40_0x219c53['green'](_0x3faaa6(0x1a1)+(_0x125fbf[_0x3faaa6(0x178)]+_0x35eb13[_0x3faaa6(0x178)])+_0x3faaa6(0x1a9)+_0x10190b[_0x3faaa6(0x1ab)])),saveSessionContext({'parent_segment':_0x10190b[_0x3faaa6(0x164)]},_0x51270e[_0x3faaa6(0x185)]),console[_0x3faaa6(0x1aa)](a40_0x219c53['green'](_0x3faaa6(0x167)+a40_0x219c53['dim']('parent_segment')+'\x20=\x20'+a40_0x219c53['cyan'](_0x10190b['parentName']))),0x0;}}
1
+ const a40_0x399312=a40_0x5186;(function(_0x58a744,_0x22fccf){const _0x21889a=a40_0x5186,_0x5c6716=_0x58a744();while(!![]){try{const _0x56c5ef=parseInt(_0x21889a(0xf5))/0x1+-parseInt(_0x21889a(0x11d))/0x2*(parseInt(_0x21889a(0x118))/0x3)+parseInt(_0x21889a(0x106))/0x4*(-parseInt(_0x21889a(0x103))/0x5)+parseInt(_0x21889a(0x121))/0x6*(parseInt(_0x21889a(0x11f))/0x7)+parseInt(_0x21889a(0x135))/0x8*(-parseInt(_0x21889a(0x124))/0x9)+parseInt(_0x21889a(0xec))/0xa*(parseInt(_0x21889a(0x129))/0xb)+parseInt(_0x21889a(0x12d))/0xc;if(_0x56c5ef===_0x22fccf)break;else _0x5c6716['push'](_0x5c6716['shift']());}catch(_0x30ad86){_0x5c6716['push'](_0x5c6716['shift']());}}}(a40_0x91ff,0xde9f0));import{BaseCommand}from'./command.js';function a40_0x5186(_0x36c921,_0xd35949){_0x36c921=_0x36c921-0xe8;const _0x91ffc1=a40_0x91ff();let _0x51867a=_0x91ffc1[_0x36c921];return _0x51867a;}import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';function a40_0x91ff(){const _0x3916a1=['\x20unchanged\x20files','✔\x20Context\x20set:\x20','4488DKkXEW','\x0aError:','journeys','files','27976488iDJdXS','Parent\x20segment:\x20','counts','hasChanges','filter','cwd','parent_segment','no_parent','43776diCrQC','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','✔\x20All\x20files\x20are\x20up\x20to\x20date','dirname','\x20new\x20files','session','description','helpText','relativePath','22140oIjGxc','error','journeyVersions','cyan','\x20\x20🎯\x20','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','segment','\x20journeys','✔\x20Pulled\x20','34069ANbeIJ','segment:pull','parentSegment','\x20segments','Aborted.','Site:\x20','resourceName','yes','length','\x27...','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent','yellow','pullSegments','verbose','3770dHhxDC','content','targetDir','7204qPfiHz','parentName','\x0aPull\x20summary\x20for\x20\x27','errorCode','isNew','message','segments','\x20files?','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','\x0aChanges\x20to\x20\x27','file','absolutePath','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','diff','dim','Write\x20','red','\x20=\x20','4728189IMBsUG','type','repeat','green','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file','2KLFTTg','-\x20no\x20files\x20written','49zabpuG','utf-8','846444oRoYYE','\x20versions)','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)','675YeLAOM','\x20with\x20','\x20\x20🗺️\x20\x20'];a40_0x91ff=function(){return _0x3916a1;};return a40_0x91ff();}import{saveSessionContext}from'../core/session.js';import a40_0x208dcd from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';import a40_0x303894 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_0x399312(0xf6);[a40_0x399312(0xe9)]='Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files';async['execute'](_0x3378c9){const _0x12776e=a40_0x399312,{options:_0x3cef4e,args:_0x4e551a,tdx:_0x280b7a}=_0x3378c9,_0x47d876=_0x3cef4e,_0x5d7076=await resolveTarget({'arg':_0x4e551a[0x0],'contextParent':_0x3cef4e[_0x12776e(0xf7)],'cwd':process[_0x12776e(0x132)]()});if(!isSuccessfulResolution(_0x5d7076))return _0x5d7076[_0x12776e(0x109)]===_0x12776e(0x134)?(console['error'](a40_0x208dcd['yellow'](_0x12776e(0x136))),console[_0x12776e(0xed)](_0x12776e(0x123)),console[_0x12776e(0xed)](_0x12776e(0xff)),console[_0x12776e(0xed)](_0x12776e(0x11c))):(console[_0x12776e(0xed)](a40_0x208dcd[_0x12776e(0x116)]('Error:\x20'+_0x5d7076[_0x12776e(0x10b)]+'\x0a')),_0x5d7076[_0x12776e(0xea)]&&console[_0x12776e(0xed)](a40_0x208dcd[_0x12776e(0xef)](_0x5d7076[_0x12776e(0xea)]))),0x1;const _0x11535f=_0x5d7076[_0x12776e(0x107)],_0x467f9a=_0x5d7076[_0x12776e(0x105)],_0x5751a9=_0x5d7076[_0x12776e(0x119)]===_0x12776e(0x110)?_0x5d7076[_0x12776e(0xfb)]:undefined;_0x47d876[_0x12776e(0x102)]&&(console[_0x12776e(0xed)](_0x12776e(0xfa)+_0x47d876['site']),console[_0x12776e(0xed)](_0x12776e(0x12e)+_0x11535f),_0x5751a9&&console[_0x12776e(0xed)]('Target\x20resource:\x20'+_0x5751a9));const _0x12d520=await withProgressSpinner('Pulling\x20segments\x20from\x20\x27'+_0x11535f+_0x12776e(0xfe),_0x52ec61=>_0x280b7a[_0x12776e(0xf2)][_0x12776e(0x101)](_0x11535f,{'targetDir':_0x467f9a,'targetResourceName':_0x5751a9,'verbose':_0x47d876['verbose'],'progress':{'update':_0x1f4cd5=>{const _0x381aa6=_0x12776e;_0x52ec61['setPhase'](_0x1f4cd5),_0x47d876[_0x381aa6(0x102)]&&console[_0x381aa6(0xed)]('\x20\x20'+_0x1f4cd5);}}}),{'verbose':_0x47d876[_0x12776e(0x102)]}),_0x5dd71a=_0x12d520['data'];if(_0x5dd71a[_0x12776e(0x12f)][_0x12776e(0x10c)]===0x0&&_0x5dd71a[_0x12776e(0x12f)][_0x12776e(0x12b)]===0x0)return console[_0x12776e(0xed)](a40_0x208dcd[_0x12776e(0x100)]('No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27'+_0x5dd71a[_0x12776e(0x107)]+'\x27')),0x0;const _0x5656a0=_0x5dd71a[_0x12776e(0x12c)]['filter'](_0x4a25ad=>_0x4a25ad[_0x12776e(0x10a)]),_0x4065d2=_0x5dd71a['files']['filter'](_0x2a5978=>!_0x2a5978[_0x12776e(0x10a)]&&_0x2a5978[_0x12776e(0x130)]),_0x85494f=_0x5dd71a[_0x12776e(0x12c)][_0x12776e(0x131)](_0x3cdaee=>!_0x3cdaee[_0x12776e(0x10a)]&&!_0x3cdaee[_0x12776e(0x130)]);console[_0x12776e(0xed)](_0x12776e(0x108)+_0x5dd71a['parentName']+'\x27:'),console['error'](_0x12776e(0xf0)+a40_0x208dcd[_0x12776e(0xef)](_0x5dd71a[_0x12776e(0x12f)]['segments']+_0x12776e(0xf8))+_0x12776e(0x125)+a40_0x208dcd[_0x12776e(0xef)](_0x5dd71a[_0x12776e(0x12f)]['activations']+'\x20activations'));if(_0x5dd71a[_0x12776e(0x12f)][_0x12776e(0x12b)]>0x0){const _0x170347=_0x5dd71a[_0x12776e(0x12f)][_0x12776e(0xee)]>_0x5dd71a[_0x12776e(0x12f)]['journeys']?'\x20('+_0x5dd71a[_0x12776e(0x12f)]['journeyVersions']+_0x12776e(0x122):'';console[_0x12776e(0xed)](_0x12776e(0x126)+a40_0x208dcd[_0x12776e(0xef)](_0x5dd71a[_0x12776e(0x12f)][_0x12776e(0x12b)]+_0x12776e(0xf3))+a40_0x208dcd[_0x12776e(0x114)](_0x170347));}console[_0x12776e(0xed)]('\x20\x20'+a40_0x208dcd[_0x12776e(0x11b)]('+\x20'+_0x5656a0[_0x12776e(0xfd)]+_0x12776e(0x139))),console['error']('\x20\x20'+a40_0x208dcd['yellow']('~\x20'+_0x4065d2[_0x12776e(0xfd)]+'\x20changed\x20files')),console['error']('\x20\x20'+a40_0x208dcd[_0x12776e(0x114)]('=\x20'+_0x85494f['length']+_0x12776e(0x127))),console[_0x12776e(0xed)]('\x20\x20Target:\x20'+a40_0x208dcd[_0x12776e(0xef)](_0x5dd71a['targetDir'])+'\x0a');if(_0x4065d2['length']>0x0)for(const _0x7031ef of _0x4065d2){console[_0x12776e(0xed)](_0x12776e(0x10f)+_0x7031ef[_0x12776e(0xeb)]+'\x27:'),console[_0x12776e(0xed)]('─'[_0x12776e(0x11a)](0x3c)),console['error'](_0x7031ef[_0x12776e(0x113)]),console[_0x12776e(0xed)]('─'[_0x12776e(0x11a)](0x3c));}if(_0x47d876['dryRun'])return console[_0x12776e(0xed)](a40_0x208dcd['yellow'](_0x12776e(0x10e))),0x0;if(_0x5656a0[_0x12776e(0xfd)]===0x0&&_0x4065d2[_0x12776e(0xfd)]===0x0)return console['error'](a40_0x208dcd['green'](_0x12776e(0x137))),saveSessionContext({'parent_segment':_0x5dd71a['parentName']},_0x47d876[_0x12776e(0xe8)]),console[_0x12776e(0xed)](a40_0x208dcd[_0x12776e(0x11b)](_0x12776e(0x128)+a40_0x208dcd[_0x12776e(0x114)](_0x12776e(0x133))+_0x12776e(0x117)+a40_0x208dcd[_0x12776e(0xef)](_0x5dd71a[_0x12776e(0x107)]))),0x0;if(!_0x47d876[_0x12776e(0xfc)]){if(!isInteractive())return console[_0x12776e(0xed)](a40_0x208dcd[_0x12776e(0x116)](_0x12776e(0x12a)),_0x12776e(0x112)),console['error'](a40_0x208dcd[_0x12776e(0x114)](_0x12776e(0xf1))),0x1;const _0x413916=await confirmKey(_0x12776e(0x115)+(_0x5656a0['length']+_0x4065d2[_0x12776e(0xfd)])+_0x12776e(0x10d));if(!_0x413916)return console[_0x12776e(0xed)](a40_0x208dcd['yellow'](_0x12776e(0xf9)),_0x12776e(0x11e)),0x1;}for(const _0x1f15f7 of _0x5dd71a[_0x12776e(0x12c)]){if(_0x1f15f7[_0x12776e(0x10a)]||_0x1f15f7[_0x12776e(0x130)]){const _0x23d2bf=a40_0x303894[_0x12776e(0x138)](_0x1f15f7[_0x12776e(0x111)]);!existsSync(_0x23d2bf)&&mkdirSync(_0x23d2bf,{'recursive':!![]}),writeFileSync(_0x1f15f7['absolutePath'],_0x1f15f7[_0x12776e(0x104)],_0x12776e(0x120));}}return console[_0x12776e(0xed)](a40_0x208dcd[_0x12776e(0x11b)](_0x12776e(0xf4)+(_0x5656a0[_0x12776e(0xfd)]+_0x4065d2['length'])+'\x20files\x20to\x20'+_0x5dd71a[_0x12776e(0x105)])),saveSessionContext({'parent_segment':_0x5dd71a['parentName']},_0x47d876[_0x12776e(0xe8)]),console[_0x12776e(0xed)](a40_0x208dcd[_0x12776e(0x11b)]('✔\x20Context\x20set:\x20'+a40_0x208dcd[_0x12776e(0x114)](_0x12776e(0x133))+_0x12776e(0x117)+a40_0x208dcd['cyan'](_0x5dd71a['parentName']))),0x0;}}
@@ -1 +1 @@
1
- const a41_0x4491ab=a41_0x4e8e;(function(_0x291a87,_0x231c4c){const _0xff7f1f=a41_0x4e8e,_0x3498a8=_0x291a87();while(!![]){try{const _0x2fc4a9=-parseInt(_0xff7f1f(0x20f))/0x1+-parseInt(_0xff7f1f(0x223))/0x2*(parseInt(_0xff7f1f(0x1df))/0x3)+parseInt(_0xff7f1f(0x258))/0x4+-parseInt(_0xff7f1f(0x1d9))/0x5*(-parseInt(_0xff7f1f(0x227))/0x6)+parseInt(_0xff7f1f(0x232))/0x7+parseInt(_0xff7f1f(0x256))/0x8+-parseInt(_0xff7f1f(0x1e0))/0x9;if(_0x2fc4a9===_0x231c4c)break;else _0x3498a8['push'](_0x3498a8['shift']());}catch(_0x106baa){_0x3498a8['push'](_0x3498a8['shift']());}}}(a41_0x463c,0x76dd0));import{BaseCommand}from'./command.js';function a41_0x463c(){const _0x5599cc=['Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','created','folderId','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','Scoped\x20to\x20folder:\x20','endsWith','filter','data','description','Error:\x20','targetDir','\x20created','parentSegment','\x20changed','Resolving\x20parent\x20segment\x20\x27','yamlConfig','attributes','existingSegment','journeysOnly','journeyBundleName','/e/','createdSegmentIds','repeat','add','get','Changes\x20to\x20journey:','deleted','journeys','parentFolder','.yaml','419312tCYrZc','diff','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','segment:push','folderPath','connection','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','unchanged','/app/ps/','📁\x20','execute','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','toUpdate','list','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','all','then','Fetching\x20existing\x20activations...','Folders\x20to\x20create:','existingJourney','6316LgnUqz','\x20deleted','Error:\x20Directory\x20not\x20found:\x20','dryRun','102DzeMEv','new','name','/j/da/je','segments','\x20updated','Fetching\x20existing\x20data...','versionNumber','toDelete','segment','audienceId','4693857OuLWtE','folders','site','user','listActivations','idToName','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','activations','\x0aValidation\x20failed:','(Journey\x20will\x20be\x20deleted)','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','.yml','\x0a✔\x20Push\x20complete','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','delete','listJourneysWithDetailsFromParentSegment','\x20to\x20update','journeyId','getOutputSchemaWithCache','nameToType','set','state','\x20\x20\x20\x20','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','\x20to\x20delete','Aborted.','\x20new','journeyBundleId','red','yellow','\x20YAML\x20files\x20found','error','New\x20segment:','type','nameToId','toCreate','724984KWCOkH','Delete\x20segment:','1708620FPBOyh','map','cyan','/sb/da/esr','segmentFolderId','updated','changed','setPhase','push','✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','Parent\x20segment:\x20','join','file','createdAt','green','Changes\x20to:','Push\x20','errorCode','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','message','\x20\x20Activations:','parent_name','dim','109415lRcTLO','isScoped','✔\x20All\x20journeys\x20are\x20up\x20to\x20date','length','\x20\x20Activations:\x20','paused','420vtNhlc','1908396guZvtf','\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20','getJourney','\x20\x20📊\x20Segments:','\x20unchanged','resolveParentId','blue','verbose','filePath','helpText','relationships','Site:\x20','isNew','journey','toString','listSegments','listFolders'];a41_0x463c=function(){return _0x5599cc;};return a41_0x463c();}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_0x46fc59 from'chalk';function a41_0x4e8e(_0x40459b,_0x4e5d4c){_0x40459b=_0x40459b-0x1d3;const _0x463cb0=a41_0x463c();let _0x4e8e2b=_0x463cb0[_0x40459b];return _0x4e8e2b;}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_0x4491ab(0x229)]=a41_0x4491ab(0x212);[a41_0x4491ab(0x1f9)]=a41_0x4491ab(0x1f4);async[a41_0x4491ab(0x219)](_0x11fb34){const _0x28cbf7=a41_0x4491ab,{options:_0x11a60e,args:_0x1e6f4e,tdx:_0x5bef7a}=_0x11fb34,_0x9b0375=_0x11a60e,_0x4716a4=await resolveTarget({'arg':_0x1e6f4e[0x0],'contextParent':_0x11a60e[_0x28cbf7(0x1fd)],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x4716a4))return _0x4716a4[_0x28cbf7(0x1d3)]==='no_parent'?(console[_0x28cbf7(0x251)](a41_0x46fc59['yellow'](_0x28cbf7(0x215))),console[_0x28cbf7(0x251)]('Usage:\x20tdx\x20sg\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20(requires\x20context)'),console['error'](_0x28cbf7(0x23c)),console['error']('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file')):(console[_0x28cbf7(0x251)](a41_0x46fc59['red'](_0x28cbf7(0x1fa)+_0x4716a4[_0x28cbf7(0x1d5)]+'\x0a')),_0x4716a4[_0x28cbf7(0x1e9)]&&console[_0x28cbf7(0x251)](a41_0x46fc59[_0x28cbf7(0x25a)](_0x4716a4['helpText']))),0x1;if(_0x4716a4[_0x28cbf7(0x253)]===_0x28cbf7(0x1d7))return console[_0x28cbf7(0x251)](a41_0x46fc59[_0x28cbf7(0x24e)](_0x28cbf7(0x225)+_0x4716a4['targetDir']+'\x0a')),console['error'](a41_0x46fc59[_0x28cbf7(0x25a)]('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;const _0x3c5720=_0x4716a4['parentName'],_0x47f69a=_0x4716a4[_0x28cbf7(0x1fb)],_0x4f2ac1=_0x4716a4[_0x28cbf7(0x253)]===_0x28cbf7(0x264)?_0x4716a4[_0x28cbf7(0x1e8)]:undefined,_0x1f3325=getScopedDetails(_0x4716a4),_0x2212c8=_0x1f3325?.[_0x28cbf7(0x1da)]??![],_0x598ad2=_0x1f3325?.['scopedFolderPath']??'';if(!existsSync(_0x47f69a))return console[_0x28cbf7(0x251)](a41_0x46fc59[_0x28cbf7(0x24e)](_0x28cbf7(0x225)+_0x47f69a+'\x0a')),console[_0x28cbf7(0x251)](a41_0x46fc59[_0x28cbf7(0x25a)]('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;_0x9b0375['verbose']&&(console[_0x28cbf7(0x251)](_0x28cbf7(0x1eb)+_0x9b0375[_0x28cbf7(0x234)]),console[_0x28cbf7(0x251)](_0x28cbf7(0x262)+_0x3c5720),console['error']('Source\x20directory:\x20'+_0x47f69a),_0x2212c8&&console[_0x28cbf7(0x251)](_0x28cbf7(0x1f5)+_0x598ad2));const _0x36b955=await withSpinner(_0x28cbf7(0x1ff)+_0x3c5720+'\x27...',()=>_0x5bef7a[_0x28cbf7(0x230)][_0x28cbf7(0x1e5)](_0x3c5720),{'verbose':_0x9b0375[_0x28cbf7(0x1e7)]}),_0x5d7710=_0x36b955[_0x28cbf7(0x1f8)],{parentSegmentResult:_0x51c51a,segmentsResult:_0x3d98d6,foldersResult:_0x2fdc22,journeysWithDetailsResult:_0x269078,userMaps:_0x363391}=await withSpinner(_0x28cbf7(0x22d),async()=>{const _0x5f4329=_0x28cbf7,[_0x48842c,_0x26bb24,_0x167697,_0x1aa8bb,_0x267c3a]=await Promise[_0x5f4329(0x21e)]([_0x5bef7a[_0x5f4329(0x230)]['getParent'](_0x5d7710),_0x5bef7a[_0x5f4329(0x230)][_0x5f4329(0x1ef)](_0x5d7710),_0x5bef7a['segment'][_0x5f4329(0x1f0)](_0x5d7710),_0x5bef7a[_0x5f4329(0x1ed)][_0x5f4329(0x241)](_0x5d7710,{'includeAllVersions':!![]}),_0x5bef7a[_0x5f4329(0x235)]['buildUserMaps']()]);return{'parentSegmentResult':_0x48842c,'segmentsResult':_0x26bb24,'foldersResult':_0x167697,'journeysWithDetailsResult':_0x1aa8bb,'userMaps':_0x267c3a};},{'verbose':_0x9b0375[_0x28cbf7(0x1e7)]})[_0x28cbf7(0x21f)](_0xa59d34=>_0xa59d34['data']),_0x37364c=_0x51c51a,_0x14713b=extractRootFolderId(_0x37364c),_0x1f9237=_0x3d98d6,_0x2605b2=_0x2fdc22,{journeys:_0x3e33af,activationStepsById:_0x1d7141}=_0x269078,_0x492ea1=new Map(_0x3e33af[_0x28cbf7(0x259)](_0x2d4a78=>[_0x2d4a78['id'],_0x2d4a78])),_0xb13528=_0x3e33af[_0x28cbf7(0x259)](_0x1e0ea2=>({'id':_0x1e0ea2['id'],'name':_0x1e0ea2['attributes'][_0x28cbf7(0x229)],'journeyBundleName':_0x1e0ea2[_0x28cbf7(0x201)][_0x28cbf7(0x204)]||'','journeyBundleId':_0x1e0ea2[_0x28cbf7(0x201)][_0x28cbf7(0x24d)]||'','versionNumber':_0x1e0ea2['attributes'][_0x28cbf7(0x22e)],'description':_0x1e0ea2[_0x28cbf7(0x201)]['description'],'state':_0x1e0ea2[_0x28cbf7(0x201)][_0x28cbf7(0x247)],'paused':_0x1e0ea2['attributes'][_0x28cbf7(0x1de)],'audienceId':_0x1e0ea2['attributes'][_0x28cbf7(0x231)],'folderId':_0x1e0ea2[_0x28cbf7(0x1ea)]?.[_0x28cbf7(0x20d)]?.[_0x28cbf7(0x1f8)]?.['id'],'createdAt':_0x1e0ea2[_0x28cbf7(0x201)][_0x28cbf7(0x265)],'updatedAt':_0x1e0ea2[_0x28cbf7(0x201)]['updatedAt']})),{emailToId:_0x25283b,idToEmail:_0x319809}=_0x363391,_0x2ebb65=await withSpinner('Fetching\x20connections\x20for\x20name\x20resolution...',async()=>{const _0x2e89da=_0x28cbf7,_0x4f56cc=await _0x5bef7a[_0x2e89da(0x214)][_0x2e89da(0x21c)]();return buildConnectionMaps(_0x4f56cc);},{'verbose':_0x9b0375[_0x28cbf7(0x1e7)]})[_0x28cbf7(0x21f)](_0x457ac9=>_0x457ac9['data']),_0x5d865f=_0x2ebb65[_0x28cbf7(0x254)],_0x3297ed=_0x2ebb65[_0x28cbf7(0x237)],_0x2c82a1=_0x2ebb65[_0x28cbf7(0x245)],_0x17c935={'emailToIdMap':_0x25283b,'connectionNameToIdMap':_0x5d865f,'connectionNameToTypeMap':_0x2c82a1,'getSchema':_0x42cff5=>_0x5bef7a['connection'][_0x28cbf7(0x244)](_0x42cff5)};let {pathToId:_0x396ab7,idToPath:_0x40a74e}=buildFolderMaps(_0x2605b2);const _0x50aac2=buildSegmentLookupMap(_0x1f9237,_0x40a74e),_0x1b9240=buildSegmentNameToIdMap(_0x1f9237),_0x1ac331=buildJourneyBundleLookupMap(_0xb13528,_0x40a74e);let _0x413e3d;if(_0x4f2ac1){if(!_0x4f2ac1[_0x28cbf7(0x1f6)](_0x28cbf7(0x23d))&&!_0x4f2ac1[_0x28cbf7(0x1f6)](_0x28cbf7(0x20e)))return console['error'](a41_0x46fc59[_0x28cbf7(0x24e)](_0x28cbf7(0x249)+_0x4f2ac1+'\x0a')),0x1;_0x413e3d=[_0x4f2ac1];}else _0x413e3d=findYamlFiles(_0x47f69a);if(_0x413e3d[_0x28cbf7(0x1dc)]===0x0)return console[_0x28cbf7(0x251)](a41_0x46fc59[_0x28cbf7(0x24e)](_0x28cbf7(0x1d4)+_0x47f69a+'\x0a')),console[_0x28cbf7(0x251)](a41_0x46fc59[_0x28cbf7(0x25a)](_0x28cbf7(0x1f1))),0x1;let _0x15291f,_0x58d7e1;try{const _0x1c1e7f=parseAndClassifyYamlFiles(_0x413e3d,_0x47f69a,{'skipSegments':_0x9b0375[_0x28cbf7(0x203)]});_0x15291f=_0x1c1e7f['segments'],_0x58d7e1=_0x1c1e7f[_0x28cbf7(0x20c)];const _0x36cf59=validateParsedFiles(_0x1c1e7f,_0x47f69a);if(_0x36cf59[_0x28cbf7(0x1dc)]>0x0)return console[_0x28cbf7(0x251)](a41_0x46fc59['red'](_0x28cbf7(0x23a))),console['error'](formatValidationErrors(_0x36cf59)),console['error'](a41_0x46fc59[_0x28cbf7(0x24f)](_0x28cbf7(0x238))),0x1;}catch(_0x25b821){return console[_0x28cbf7(0x251)](a41_0x46fc59[_0x28cbf7(0x24e)]('Error\x20parsing\x20YAML:\x20'+(_0x25b821 instanceof Error?_0x25b821['message']:_0x25b821))),0x1;}if(_0x15291f[_0x28cbf7(0x1dc)]===0x0&&_0x58d7e1[_0x28cbf7(0x1dc)]===0x0){const _0x3344d2=_0x9b0375[_0x28cbf7(0x203)]?_0x28cbf7(0x1ed):'segment\x20or\x20journey';return console[_0x28cbf7(0x251)](a41_0x46fc59[_0x28cbf7(0x24f)]('No\x20'+_0x3344d2+_0x28cbf7(0x250))),0x0;}const _0x3b15c5=new Map();_0x1f9237[_0x28cbf7(0x1dc)]>0x0&&!_0x9b0375['journeysOnly']&&await withSpinner(_0x28cbf7(0x220),async()=>{await batchAsync(_0x1f9237,async _0x4e513d=>{const _0x154ec9=a41_0x4e8e,_0x23e492=await _0x5bef7a[_0x154ec9(0x230)][_0x154ec9(0x236)](_0x5d7710,_0x4e513d['id']);_0x3b15c5['set'](_0x4e513d['id'],_0x23e492);});},{'verbose':_0x9b0375[_0x28cbf7(0x1e7)]});const {segmentFiles:_0x12c4d9,foldersToCreate:_0x4d8d54}=await prepareSegmentFiles(_0x15291f,{'segmentByFolderAndName':_0x50aac2,'activationsBySegmentId':_0x3b15c5,'folderPathToId':_0x396ab7,'idToEmailMap':_0x319809,'connectionIdToNameMap':_0x3297ed},_0x17c935,_0x2212c8,_0x598ad2),_0x3cead4=_0x4f2ac1?[]:findSegmentsToDelete(_0x1f9237,_0x15291f[_0x28cbf7(0x259)](({yamlConfig:_0x3ca79e,folderPath:_0x1f606a})=>({'yamlConfig':_0x3ca79e,'folderPath':resolveTDFolderPath(_0x1f606a,_0x2212c8,_0x598ad2)})),_0x40a74e,_0x598ad2,_0x2212c8),{journeyFiles:_0x30c7fa,foldersToCreate:_0xd6a7d7}=await withProgressSpinner('Preparing\x20journeys...',async _0x1e13a4=>prepareJourneyFiles(_0x58d7e1,{'fetchJourney':async _0x9a7b68=>_0x5bef7a['journey'][_0x28cbf7(0x1e2)](_0x9a7b68[_0x28cbf7(0x243)]),'journeyBundlesByFolderAndName':_0x1ac331,'folderPathToId':_0x396ab7,'idToEmailMap':_0x319809,'connectionIdToNameMap':_0x3297ed,'existingSegments':_0x1f9237,'parentId':_0x5d7710,'deps':_0x5bef7a,'progress':{'update':_0x3bd06a=>{const _0x214f70=_0x28cbf7;_0x1e13a4[_0x214f70(0x25f)](_0x3bd06a),_0x9b0375['verbose']&&console[_0x214f70(0x251)]('\x20\x20'+_0x3bd06a);}},'journeyById':_0x492ea1,'activationStepsById':_0x1d7141},_0x2212c8,_0x598ad2),{'verbose':_0x9b0375[_0x28cbf7(0x1e7)]})[_0x28cbf7(0x21f)](_0x4b267b=>_0x4b267b[_0x28cbf7(0x1f8)]);for(const _0x4bc622 of _0xd6a7d7){_0x4d8d54[_0x28cbf7(0x208)](_0x4bc622);}const _0x52f2fd=_0x4f2ac1?[]:findJourneysToDelete(_0xb13528,_0x58d7e1[_0x28cbf7(0x259)](({yamlConfig:_0x535217,folderPath:_0x1b336e})=>({'yamlConfig':_0x535217,'folderPath':resolveTDFolderPath(_0x1b336e,_0x2212c8,_0x598ad2)})),_0x40a74e,_0x598ad2,_0x2212c8),_0x208ab4=calculatePushStats(_0x12c4d9,_0x30c7fa,_0x4d8d54,_0x3cead4,_0x52f2fd,!!_0x9b0375[_0x28cbf7(0x240)],!!_0x9b0375[_0x28cbf7(0x203)]),_0x41be80=_0x208ab4[_0x28cbf7(0x22b)][_0x28cbf7(0x228)],_0x20e116=_0x208ab4['segments'][_0x28cbf7(0x25e)],_0x2fc568=_0x208ab4[_0x28cbf7(0x22b)]['unchanged'],_0x3a5f30=_0x208ab4[_0x28cbf7(0x22b)][_0x28cbf7(0x22f)],_0x371043=_0x208ab4[_0x28cbf7(0x233)][_0x28cbf7(0x255)],_0x3a8bd7=_0x208ab4['journeys']['new'],_0x1d1325=_0x208ab4[_0x28cbf7(0x20c)][_0x28cbf7(0x25e)],_0x3791bd=_0x208ab4[_0x28cbf7(0x20c)][_0x28cbf7(0x216)],_0x5206be=_0x208ab4[_0x28cbf7(0x20c)][_0x28cbf7(0x22f)],_0x5af43f=_0x208ab4[_0x28cbf7(0x239)][_0x28cbf7(0x21e)],_0x4378a2=_0x208ab4['activations'][_0x28cbf7(0x255)],_0x30f667=_0x208ab4[_0x28cbf7(0x239)][_0x28cbf7(0x21b)],_0x52a4e3=_0x208ab4[_0x28cbf7(0x239)][_0x28cbf7(0x22f)];console[_0x28cbf7(0x251)]('\x0aPush\x20summary\x20for\x20\x27'+_0x3c5720+'\x27:');_0x371043[_0x28cbf7(0x1dc)]>0x0&&console['error']('\x20\x20'+a41_0x46fc59[_0x28cbf7(0x1e6)](_0x28cbf7(0x218)+_0x371043[_0x28cbf7(0x1dc)]+'\x20folders\x20to\x20create'));if(!_0x9b0375['journeysOnly']){console[_0x28cbf7(0x251)](_0x28cbf7(0x1e3)),console[_0x28cbf7(0x251)](_0x28cbf7(0x248)+a41_0x46fc59[_0x28cbf7(0x266)]('+\x20'+_0x41be80[_0x28cbf7(0x1dc)]+'\x20new')),console['error'](_0x28cbf7(0x248)+a41_0x46fc59[_0x28cbf7(0x24f)]('~\x20'+_0x20e116[_0x28cbf7(0x1dc)]+_0x28cbf7(0x1fe)));if(_0x3a5f30[_0x28cbf7(0x1dc)]>0x0)console[_0x28cbf7(0x251)](_0x28cbf7(0x248)+a41_0x46fc59[_0x28cbf7(0x24e)]('-\x20'+_0x3a5f30[_0x28cbf7(0x1dc)]+_0x28cbf7(0x24a)));else _0x3cead4['length']>0x0&&!_0x9b0375[_0x28cbf7(0x240)]&&console[_0x28cbf7(0x251)]('\x20\x20\x20\x20'+a41_0x46fc59['dim'](_0x3cead4[_0x28cbf7(0x1dc)]+_0x28cbf7(0x211)));console[_0x28cbf7(0x251)]('\x20\x20\x20\x20'+a41_0x46fc59[_0x28cbf7(0x1d8)]('=\x20'+_0x2fc568[_0x28cbf7(0x1dc)]+_0x28cbf7(0x1e4)));}if(_0x30c7fa['length']>0x0||_0x52f2fd[_0x28cbf7(0x1dc)]>0x0){console[_0x28cbf7(0x251)]('\x20\x20🗺️\x20\x20Journeys:'),console[_0x28cbf7(0x251)](_0x28cbf7(0x248)+a41_0x46fc59[_0x28cbf7(0x266)]('+\x20'+_0x3a8bd7[_0x28cbf7(0x1dc)]+_0x28cbf7(0x24c))),console[_0x28cbf7(0x251)](_0x28cbf7(0x248)+a41_0x46fc59[_0x28cbf7(0x24f)]('~\x20'+_0x1d1325[_0x28cbf7(0x1dc)]+_0x28cbf7(0x1fe)));if(_0x5206be[_0x28cbf7(0x1dc)]>0x0)console['error'](_0x28cbf7(0x248)+a41_0x46fc59[_0x28cbf7(0x24e)]('-\x20'+_0x5206be['length']+_0x28cbf7(0x24a)));else _0x52f2fd[_0x28cbf7(0x1dc)]>0x0&&!_0x9b0375[_0x28cbf7(0x240)]&&console[_0x28cbf7(0x251)](_0x28cbf7(0x248)+a41_0x46fc59[_0x28cbf7(0x1d8)](_0x52f2fd[_0x28cbf7(0x1dc)]+_0x28cbf7(0x211)));console[_0x28cbf7(0x251)](_0x28cbf7(0x248)+a41_0x46fc59['dim']('=\x20'+_0x3791bd[_0x28cbf7(0x1dc)]+_0x28cbf7(0x1e4)));}_0x5af43f[_0x28cbf7(0x1dc)]>0x0&&!_0x9b0375[_0x28cbf7(0x203)]&&(console[_0x28cbf7(0x251)](''),console[_0x28cbf7(0x251)](_0x28cbf7(0x1d6)),_0x4378a2[_0x28cbf7(0x1dc)]>0x0&&console[_0x28cbf7(0x251)](_0x28cbf7(0x248)+a41_0x46fc59['green']('+\x20'+_0x4378a2[_0x28cbf7(0x1dc)]+'\x20to\x20create')),_0x30f667['length']>0x0&&console[_0x28cbf7(0x251)]('\x20\x20\x20\x20'+a41_0x46fc59['yellow']('~\x20'+_0x30f667['length']+_0x28cbf7(0x242))),_0x52a4e3[_0x28cbf7(0x1dc)]>0x0&&console[_0x28cbf7(0x251)](_0x28cbf7(0x248)+a41_0x46fc59['red']('-\x20'+_0x52a4e3[_0x28cbf7(0x1dc)]+_0x28cbf7(0x24a))));console[_0x28cbf7(0x251)]('\x20\x20Source:\x20'+a41_0x46fc59[_0x28cbf7(0x25a)](_0x47f69a)+'\x0a');if(_0x371043['length']>0x0){console[_0x28cbf7(0x251)](_0x28cbf7(0x221));for(const _0x5e629f of _0x371043){console[_0x28cbf7(0x251)]('\x20\x20'+a41_0x46fc59['blue']('+')+'\x20'+_0x5e629f);}console['error']('');}if(_0x41be80[_0x28cbf7(0x1dc)]>0x0&&!_0x9b0375[_0x28cbf7(0x203)])for(const _0x67edc6 of _0x41be80){const _0x36ae6e=_0x67edc6['folderPath']?_0x67edc6[_0x28cbf7(0x213)]+'/'+_0x67edc6[_0x28cbf7(0x200)][_0x28cbf7(0x229)]:_0x67edc6['yamlConfig'][_0x28cbf7(0x229)],_0x36ff8e=_0x67edc6[_0x28cbf7(0x200)]['activations']?.[_0x28cbf7(0x1dc)]||0x0,_0x48f1d0=_0x36ff8e>0x0?a41_0x46fc59['dim']('\x20['+_0x36ff8e+'\x20activations]'):'';console[_0x28cbf7(0x251)]('\x0a'+a41_0x46fc59[_0x28cbf7(0x266)](_0x28cbf7(0x252))+'\x20'+_0x36ae6e+_0x48f1d0),console[_0x28cbf7(0x251)]('─'[_0x28cbf7(0x207)](0x3c)),_0x67edc6['diff']&&console[_0x28cbf7(0x251)](_0x67edc6[_0x28cbf7(0x210)]),console['error']('─'[_0x28cbf7(0x207)](0x3c));}if(_0x3a5f30[_0x28cbf7(0x1dc)]>0x0&&!_0x9b0375[_0x28cbf7(0x203)])for(const _0x4ae1eb of _0x3a5f30){const _0x4746a0=_0x4ae1eb[_0x28cbf7(0x25c)]?_0x40a74e[_0x28cbf7(0x209)](_0x4ae1eb[_0x28cbf7(0x25c)][_0x28cbf7(0x1ee)]())||'':'',_0x51b994=_0x4746a0?_0x4746a0+'/'+_0x4ae1eb[_0x28cbf7(0x229)]:_0x4ae1eb[_0x28cbf7(0x229)],_0x381d7f=_0x3b15c5['get'](_0x4ae1eb['id'])||[],_0x47f2c8=_0x381d7f[_0x28cbf7(0x1dc)]>0x0?a41_0x46fc59[_0x28cbf7(0x1d8)]('\x20['+_0x381d7f[_0x28cbf7(0x1dc)]+'\x20activations]'):'';console[_0x28cbf7(0x251)]('\x0a'+a41_0x46fc59['red'](_0x28cbf7(0x257))+'\x20'+_0x51b994+_0x47f2c8),console['error']('─'['repeat'](0x3c));const _0x55f2ea=segmentWithActivationsToYaml(_0x4ae1eb,_0x381d7f,undefined,_0x319809,_0x3297ed),_0x3b9b2a=segmentToYamlString(_0x55f2ea),_0x1632e0=generateDiff(_0x3b9b2a,'');console[_0x28cbf7(0x251)](formatDiffWithColors(_0x1632e0)),console[_0x28cbf7(0x251)]('─'['repeat'](0x3c));}const _0x31ab96=_0x12c4d9[_0x28cbf7(0x1f7)](_0xd3541b=>!_0xd3541b[_0x28cbf7(0x1ec)]&&_0xd3541b[_0x28cbf7(0x210)]);if(_0x31ab96[_0x28cbf7(0x1dc)]>0x0&&!_0x9b0375[_0x28cbf7(0x203)])for(const _0x5c2ff3 of _0x31ab96){const _0x4835bc=_0x5c2ff3['folderPath']?_0x5c2ff3['folderPath']+'/'+_0x5c2ff3[_0x28cbf7(0x200)][_0x28cbf7(0x229)]:_0x5c2ff3[_0x28cbf7(0x200)]['name'];console['error']('\x0a'+a41_0x46fc59['yellow'](_0x28cbf7(0x267))+'\x20'+_0x4835bc),console[_0x28cbf7(0x251)]('─'[_0x28cbf7(0x207)](0x3c)),console[_0x28cbf7(0x251)](_0x5c2ff3[_0x28cbf7(0x210)]),console[_0x28cbf7(0x251)]('─'[_0x28cbf7(0x207)](0x3c));}if(_0x3a8bd7['length']>0x0)for(const _0x372b6b of _0x3a8bd7){const _0xc40da0=_0x372b6b['folderPath']?_0x372b6b['folderPath']+'/'+_0x372b6b['yamlConfig'][_0x28cbf7(0x229)]:_0x372b6b[_0x28cbf7(0x200)][_0x28cbf7(0x229)];console[_0x28cbf7(0x251)]('\x0a'+a41_0x46fc59[_0x28cbf7(0x266)]('New\x20journey:')+'\x20'+_0xc40da0),console[_0x28cbf7(0x251)]('─'[_0x28cbf7(0x207)](0x3c)),_0x372b6b['diff']&&console['error'](_0x372b6b[_0x28cbf7(0x210)]),console[_0x28cbf7(0x251)]('─'[_0x28cbf7(0x207)](0x3c));}const _0x40e96f=_0x30c7fa[_0x28cbf7(0x1f7)](_0xc16820=>!_0xc16820[_0x28cbf7(0x1ec)]&&_0xc16820[_0x28cbf7(0x210)]);if(_0x40e96f['length']>0x0)for(const _0x3a0cc4 of _0x40e96f){const _0x21d327=_0x3a0cc4['folderPath']?_0x3a0cc4['folderPath']+'/'+_0x3a0cc4['yamlConfig'][_0x28cbf7(0x229)]:_0x3a0cc4['yamlConfig'][_0x28cbf7(0x229)];console[_0x28cbf7(0x251)]('\x0a'+a41_0x46fc59['yellow'](_0x28cbf7(0x20a))+'\x20'+_0x21d327),console[_0x28cbf7(0x251)]('─'['repeat'](0x3c)),console[_0x28cbf7(0x251)](_0x3a0cc4[_0x28cbf7(0x210)]),console[_0x28cbf7(0x251)]('─'[_0x28cbf7(0x207)](0x3c));}if(_0x5206be[_0x28cbf7(0x1dc)]>0x0)for(const _0x5ba162 of _0x5206be){const _0x562369=_0x5ba162[_0x28cbf7(0x1f3)]?_0x40a74e[_0x28cbf7(0x209)](_0x5ba162['folderId'])||'':'',_0x187bf4=_0x562369?_0x562369+'/'+_0x5ba162[_0x28cbf7(0x204)]:_0x5ba162[_0x28cbf7(0x204)];console['error']('\x0a'+a41_0x46fc59[_0x28cbf7(0x24e)]('Delete\x20journey:')+'\x20'+_0x187bf4),console[_0x28cbf7(0x251)]('─'['repeat'](0x3c)),console[_0x28cbf7(0x251)](a41_0x46fc59[_0x28cbf7(0x24e)](_0x28cbf7(0x23b))),console[_0x28cbf7(0x251)]('─'[_0x28cbf7(0x207)](0x3c));}if(_0x9b0375[_0x28cbf7(0x226)])return console['error'](a41_0x46fc59[_0x28cbf7(0x24f)](_0x28cbf7(0x23f))),0x0;const _0x2a2ebe=_0x9b0375[_0x28cbf7(0x203)]?![]:_0x41be80['length']>0x0||_0x20e116['length']>0x0||_0x3a5f30[_0x28cbf7(0x1dc)]>0x0,_0x284f3f=_0x3a8bd7[_0x28cbf7(0x1dc)]>0x0||_0x1d1325[_0x28cbf7(0x1dc)]>0x0||_0x5206be[_0x28cbf7(0x1dc)]>0x0,_0x436c8a=_0x9b0375[_0x28cbf7(0x203)]?![]:_0x5af43f[_0x28cbf7(0x1dc)]>0x0,_0x22eea1=_0x371043['length']>0x0;if(!_0x2a2ebe&&!_0x284f3f&&!_0x436c8a&&!_0x22eea1){const _0x49c41e=_0x9b0375[_0x28cbf7(0x203)]?_0x28cbf7(0x1db):_0x28cbf7(0x261);console[_0x28cbf7(0x251)](a41_0x46fc59[_0x28cbf7(0x266)](_0x49c41e));if(_0x4f2ac1&&_0x2fc568[_0x28cbf7(0x1dc)]===0x1){const _0x2e720e=_0x2fc568[0x0];if(_0x2e720e['existingSegment']?.['id']){const _0x2b130f=getConsoleNextUrl(_0x9b0375['site'],_0x28cbf7(0x217)+_0x5d7710+_0x28cbf7(0x205)+_0x2e720e[_0x28cbf7(0x202)]['id']+_0x28cbf7(0x25b));console['error'](_0x28cbf7(0x1e1)+a41_0x46fc59[_0x28cbf7(0x25a)](_0x2b130f));}}if(_0x4f2ac1&&_0x3791bd[_0x28cbf7(0x1dc)]===0x1){const _0x15a964=_0x3791bd[0x0];if(_0x15a964['existingJourney']?.['id']){const _0x461e29=getConsoleNextUrl(_0x9b0375['site'],_0x28cbf7(0x217)+_0x5d7710+'/e/'+_0x15a964[_0x28cbf7(0x222)]['id']+_0x28cbf7(0x22a));console['error']('\x20\x20'+a41_0x46fc59[_0x28cbf7(0x25a)](_0x461e29));}}return 0x0;}const _0x4ad48d=_0x9b0375[_0x28cbf7(0x203)]?_0x3a8bd7['length']+_0x1d1325['length']+_0x5206be['length']+_0x371043[_0x28cbf7(0x1dc)]:_0x41be80['length']+_0x20e116[_0x28cbf7(0x1dc)]+_0x3a5f30[_0x28cbf7(0x1dc)]+_0x3a8bd7['length']+_0x1d1325[_0x28cbf7(0x1dc)]+_0x5206be[_0x28cbf7(0x1dc)]+_0x371043[_0x28cbf7(0x1dc)]+_0x5af43f[_0x28cbf7(0x1dc)];if(!_0x9b0375['yes']&&_0x4ad48d>0x0){if(!isInteractive())return console[_0x28cbf7(0x251)](a41_0x46fc59['red']('\x0aError:'),_0x28cbf7(0x21d)),console[_0x28cbf7(0x251)](a41_0x46fc59['dim']('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0xefd14b=await confirmKey(_0x28cbf7(0x268)+_0x4ad48d+'\x20changes?');if(!_0xefd14b)return console[_0x28cbf7(0x251)](a41_0x46fc59['yellow'](_0x28cbf7(0x24b))),0x1;}const _0x2739a7={'withProgress':async(_0x5542e4,_0x16c4f5)=>{const _0x28d435=_0x28cbf7,_0x21c531=await withSpinner(_0x5542e4,_0x16c4f5,{'verbose':_0x9b0375[_0x28d435(0x1e7)]});return{'data':_0x21c531[_0x28d435(0x1f8)]};},'logInfo':_0x3454ea=>console[_0x28cbf7(0x251)](a41_0x46fc59[_0x28cbf7(0x1e6)]('✔\x20'+_0x3454ea)),'logSuccess':_0x5129ab=>console[_0x28cbf7(0x251)](a41_0x46fc59['green']('✔\x20'+_0x5129ab)),'logWarning':_0x2994b7=>console[_0x28cbf7(0x251)](a41_0x46fc59[_0x28cbf7(0x24f)]('⚠\x20'+_0x2994b7)),'logDeleted':_0x410ea9=>console['error'](a41_0x46fc59[_0x28cbf7(0x24e)]('✔\x20'+_0x410ea9))},_0x4bb8a4={'segment':_0x5bef7a[_0x28cbf7(0x230)],'journey':_0x5bef7a[_0x28cbf7(0x1ed)],'user':_0x5bef7a['user'],'connection':_0x5bef7a[_0x28cbf7(0x214)]};_0x371043[_0x28cbf7(0x1dc)]>0x0&&(_0x396ab7=await executePushFolders(_0x4bb8a4,_0x371043,_0x396ab7,{'parentId':_0x5d7710},_0x2739a7));const _0x2a3633={'rootFolderId':_0x14713b,'folderPathToId':_0x396ab7,'folderIdToPath':_0x40a74e,'segmentNameToId':_0x1b9240,'activationsBySegmentId':_0x3b15c5,'emailToIdMap':_0x25283b,'idToEmailMap':_0x319809,'connectionNameToIdMap':_0x2ebb65[_0x28cbf7(0x254)],'connectionIdToNameMap':_0x2ebb65[_0x28cbf7(0x237)],'connectionNameToTypeMap':_0x2c82a1},_0x8d4c52=await executePushSegments(_0x4bb8a4,_0x9b0375[_0x28cbf7(0x203)]?[]:_0x12c4d9,_0x2a3633,{'parentId':_0x5d7710},_0x2739a7),_0xaf272d=_0x8d4c52[_0x28cbf7(0x1f2)],_0x406a49=_0x8d4c52['updated'],_0x5f5b0a=_0x8d4c52[_0x28cbf7(0x239)][_0x28cbf7(0x1f2)],_0x5324b2=_0x8d4c52['activations'][_0x28cbf7(0x25d)],_0x948af9=_0x8d4c52[_0x28cbf7(0x239)][_0x28cbf7(0x20b)];let _0x52af73;if(_0x4f2ac1&&_0x12c4d9['length']===0x1){const _0x5c45f1=_0x12c4d9[0x0];_0x52af73=_0x5c45f1[_0x28cbf7(0x202)]?.['id']??_0x8d4c52[_0x28cbf7(0x206)][_0x28cbf7(0x209)](_0x5c45f1[_0x28cbf7(0x200)][_0x28cbf7(0x229)]);}const _0x293764=await executePushSegmentDeletions(_0x4bb8a4,_0x9b0375[_0x28cbf7(0x203)]?[]:_0x3a5f30,_0x2739a7);let _0x3d2aa7=0x0,_0x35fbcb=0x0,_0x5b7a35=0x0;const _0x45a119=new Map(_0x1b9240);for(const [_0x281e66,_0x15dc8c]of _0x8d4c52[_0x28cbf7(0x206)]){_0x45a119[_0x28cbf7(0x246)](_0x281e66,_0x15dc8c);}if(_0x30c7fa[_0x28cbf7(0x1dc)]>0x0){const _0x52b251={..._0x2a3633,'segmentNameToId':_0x45a119,'existingSegments':_0x1f9237,'activationContext':_0x17c935},_0x434fc8=await executePushJourneys(_0x4bb8a4,_0x30c7fa,_0x52b251,{'parentId':_0x5d7710,'rootFolderId':_0x14713b,'verbose':_0x9b0375[_0x28cbf7(0x1e7)]},_0x2739a7);_0x3d2aa7=_0x434fc8['created'],_0x35fbcb=_0x434fc8[_0x28cbf7(0x25d)];if(_0x4f2ac1&&_0x434fc8['results'][_0x28cbf7(0x1dc)]===0x1){const _0x41d325=_0x434fc8['results'][0x0];if(_0x41d325['journeyId']){const _0x1709da=getConsoleNextUrl(_0x9b0375['site'],_0x28cbf7(0x217)+_0x5d7710+_0x28cbf7(0x205)+_0x41d325[_0x28cbf7(0x243)]+_0x28cbf7(0x22a));console[_0x28cbf7(0x251)]('\x20\x20'+a41_0x46fc59[_0x28cbf7(0x25a)](_0x1709da));}}}for(const _0x5b714c of _0x5206be){console[_0x28cbf7(0x251)](a41_0x46fc59[_0x28cbf7(0x24f)](_0x28cbf7(0x21a)+_0x5b714c[_0x28cbf7(0x204)])),_0x5b7a35++;}const _0x6d4f84=[];if(_0xaf272d>0x0)_0x6d4f84['push'](_0xaf272d+_0x28cbf7(0x1fc));if(_0x406a49>0x0)_0x6d4f84[_0x28cbf7(0x260)](_0x406a49+_0x28cbf7(0x22c));if(_0x293764>0x0)_0x6d4f84[_0x28cbf7(0x260)](_0x293764+_0x28cbf7(0x224));const _0xc8eb61=[];if(_0x3d2aa7>0x0)_0xc8eb61[_0x28cbf7(0x260)](_0x3d2aa7+_0x28cbf7(0x1fc));if(_0x35fbcb>0x0)_0xc8eb61[_0x28cbf7(0x260)](_0x35fbcb+_0x28cbf7(0x22c));if(_0x5b7a35>0x0)_0xc8eb61[_0x28cbf7(0x260)](_0x5b7a35+_0x28cbf7(0x224));const _0x177ea2=[];if(_0x5f5b0a>0x0)_0x177ea2[_0x28cbf7(0x260)](_0x5f5b0a+'\x20created');if(_0x5324b2>0x0)_0x177ea2[_0x28cbf7(0x260)](_0x5324b2+'\x20updated');if(_0x948af9>0x0)_0x177ea2[_0x28cbf7(0x260)](_0x948af9+_0x28cbf7(0x224));console[_0x28cbf7(0x251)](a41_0x46fc59[_0x28cbf7(0x266)](_0x28cbf7(0x23e)));_0x6d4f84['length']>0x0&&!_0x9b0375[_0x28cbf7(0x203)]&&console['error']('\x20\x20Segments:\x20'+_0x6d4f84[_0x28cbf7(0x263)](',\x20'));_0xc8eb61[_0x28cbf7(0x1dc)]>0x0&&console[_0x28cbf7(0x251)]('\x20\x20Journeys:\x20'+_0xc8eb61[_0x28cbf7(0x263)](',\x20'));_0x177ea2[_0x28cbf7(0x1dc)]>0x0&&!_0x9b0375['journeysOnly']&&console['error'](_0x28cbf7(0x1dd)+_0x177ea2['join'](',\x20'));if(_0x52af73){const _0x112add=getConsoleNextUrl(_0x9b0375[_0x28cbf7(0x234)],_0x28cbf7(0x217)+_0x5d7710+_0x28cbf7(0x205)+_0x52af73+_0x28cbf7(0x25b));console[_0x28cbf7(0x251)](_0x28cbf7(0x1e1)+a41_0x46fc59[_0x28cbf7(0x25a)](_0x112add));}return 0x0;}}
1
+ const a41_0x263525=a41_0x1be6;(function(_0xcf9baa,_0x325d3f){const _0x4c07e5=a41_0x1be6,_0x4a6bc6=_0xcf9baa();while(!![]){try{const _0x4ac89a=parseInt(_0x4c07e5(0x143))/0x1+parseInt(_0x4c07e5(0x111))/0x2+-parseInt(_0x4c07e5(0x125))/0x3+parseInt(_0x4c07e5(0x146))/0x4+-parseInt(_0x4c07e5(0x184))/0x5*(-parseInt(_0x4c07e5(0x161))/0x6)+-parseInt(_0x4c07e5(0x149))/0x7*(-parseInt(_0x4c07e5(0x127))/0x8)+-parseInt(_0x4c07e5(0xf1))/0x9;if(_0x4ac89a===_0x325d3f)break;else _0x4a6bc6['push'](_0x4a6bc6['shift']());}catch(_0x2bf69b){_0x4a6bc6['push'](_0x4a6bc6['shift']());}}}(a41_0x18f8,0x19eac));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';function a41_0x18f8(){const _0x145b29=['Fetching\x20connections\x20for\x20name\x20resolution...','Site:\x20','journeysOnly','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','verbose','add','229611LBESLo','description','2224JbGFRl','join','Scoped\x20to\x20folder:\x20','new','journeyBundleId','all','filePath','name','green','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','filter','created','yamlConfig','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','parentSegment','idToName','\x20unchanged','list','resolveParentId','createdSegmentIds','toDelete','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','Resolving\x20parent\x20segment\x20\x27','\x20created','/sb/da/esr','listFolders','toUpdate','\x20\x20Activations:','166295JYpTYo','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)','listActivations','475316sdYKTC','audienceId','\x0aError:','4718URNDJe','\x20\x20🗺️\x20\x20Journeys:','diff','attributes','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','segment:push','\x20changes?','map','New\x20segment:','message','scopedFolderPath','Source\x20directory:\x20','red','blue','errorCode','isNew','getParent','\x20\x20\x20\x20','endsWith','existingSegment','folders','cyan','Changes\x20to:','Delete\x20journey:','12972cRlfoD','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','Error:\x20Directory\x20not\x20found:\x20','data','parentFolder','length','listSegments','site','journeyBundleName','set','nameToId','updatedAt','\x0a✔\x20Push\x20complete','state','📁\x20','\x20new','versionNumber','createdAt','execute','type','repeat','activations','Folders\x20to\x20create:','user','no_parent','\x20\x20Segments:\x20','/app/ps/','/e/','journeys','results','parent_name','\x0aPush\x20summary\x20for\x20\x27','helpText','targetDir','then','430FBUAmh','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','toCreate','\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20','\x20changed','segmentFolderId','getJourney','existingJourney','get','\x20activations]','4731453kozgiu','push','segment','No\x20','segments','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','\x20deleted','Parent\x20segment:\x20','Delete\x20segment:','journey','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','yellow','(Journey\x20will\x20be\x20deleted)','\x20\x20Source:\x20','folderPath','\x20folders\x20to\x20create','getOutputSchemaWithCache','setPhase','✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','/j/da/je','isScoped','\x20to\x20delete','delete','dim','changed','Changes\x20to\x20journey:','Error:\x20','Fetching\x20existing\x20activations...','nameToType','✔\x20All\x20journeys\x20are\x20up\x20to\x20date','folderId','99964gFJmzJ','\x20\x20Activations:\x20','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','\x20\x20Journeys:\x20','journeyId','Error\x20parsing\x20YAML:\x20','relationships','\x20updated','toString','unchanged','error','\x20to\x20create','updated','\x27...'];a41_0x18f8=function(){return _0x145b29;};return a41_0x18f8();}import{batchAsync}from'../utils/async.js';import{segmentToYamlString,segmentWithActivationsToYaml}from'../sdk/segment/child-segment-yaml.js';import a41_0x5d3ea3 from'chalk';import{existsSync}from'fs';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{resolveTarget,isSuccessfulResolution,getScopedDetails}from'../sdk/segment/target-resolution.js';import{buildFolderMaps}from'../sdk/segment/resolution-context.js';function a41_0x1be6(_0x22176c,_0x3eacc1){_0x22176c=_0x22176c-0xec;const _0x18f8c9=a41_0x18f8();let _0x1be6d2=_0x18f8c9[_0x22176c];return _0x1be6d2;}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_0x263525(0x12e)]=a41_0x263525(0x14e);['description']=a41_0x263525(0x122);async[a41_0x263525(0x173)](_0x199588){const _0x5c3b52=a41_0x263525,{options:_0x108be5,args:_0xab8d0e,tdx:_0x5885a9}=_0x199588,_0x11fc33=_0x108be5,_0x595536=await resolveTarget({'arg':_0xab8d0e[0x0],'contextParent':_0x108be5[_0x5c3b52(0x135)],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x595536))return _0x595536[_0x5c3b52(0x157)]===_0x5c3b52(0x179)?(console[_0x5c3b52(0x11b)](a41_0x5d3ea3[_0x5c3b52(0xfd)](_0x5c3b52(0xf7))),console['error'](_0x5c3b52(0x144)),console[_0x5c3b52(0x11b)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent'),console[_0x5c3b52(0x11b)]('\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_0x5d3ea3[_0x5c3b52(0x155)](_0x5c3b52(0x10c)+_0x595536[_0x5c3b52(0x152)]+'\x0a')),_0x595536[_0x5c3b52(0x181)]&&console[_0x5c3b52(0x11b)](a41_0x5d3ea3[_0x5c3b52(0x15e)](_0x595536[_0x5c3b52(0x181)]))),0x1;if(_0x595536[_0x5c3b52(0x174)]===_0x5c3b52(0x17f))return console[_0x5c3b52(0x11b)](a41_0x5d3ea3[_0x5c3b52(0x155)]('Error:\x20Directory\x20not\x20found:\x20'+_0x595536[_0x5c3b52(0x182)]+'\x0a')),console['error'](a41_0x5d3ea3[_0x5c3b52(0x15e)](_0x5c3b52(0x13c))),0x1;const _0x18b692=_0x595536['parentName'],_0x13feeb=_0x595536['targetDir'],_0x28cdf0=_0x595536[_0x5c3b52(0x174)]==='file'?_0x595536[_0x5c3b52(0x12d)]:undefined,_0x222d3d=getScopedDetails(_0x595536),_0x471423=_0x222d3d?.[_0x5c3b52(0x106)]??![],_0x26e3d8=_0x222d3d?.[_0x5c3b52(0x153)]??'';if(!existsSync(_0x13feeb))return console[_0x5c3b52(0x11b)](a41_0x5d3ea3[_0x5c3b52(0x155)](_0x5c3b52(0x163)+_0x13feeb+'\x0a')),console[_0x5c3b52(0x11b)](a41_0x5d3ea3[_0x5c3b52(0x15e)](_0x5c3b52(0x13c))),0x1;_0x11fc33[_0x5c3b52(0x123)]&&(console['error'](_0x5c3b52(0x120)+_0x11fc33[_0x5c3b52(0x168)]),console[_0x5c3b52(0x11b)](_0x5c3b52(0xf9)+_0x18b692),console[_0x5c3b52(0x11b)](_0x5c3b52(0x154)+_0x13feeb),_0x471423&&console[_0x5c3b52(0x11b)](_0x5c3b52(0x129)+_0x26e3d8));const _0x190aa5=await withSpinner(_0x5c3b52(0x13d)+_0x18b692+_0x5c3b52(0x11e),()=>_0x5885a9['segment'][_0x5c3b52(0x139)](_0x18b692),{'verbose':_0x11fc33[_0x5c3b52(0x123)]}),_0x1c4957=_0x190aa5[_0x5c3b52(0x164)],{parentSegmentResult:_0x2b26cb,segmentsResult:_0x4c33fc,foldersResult:_0x3869d2,journeysWithDetailsResult:_0x3f1466,userMaps:_0x552c4a}=await withSpinner('Fetching\x20existing\x20data...',async()=>{const _0x46098f=_0x5c3b52,[_0x5c8e77,_0x2cdcb5,_0x54cb12,_0x1bf066,_0x4b4ec8]=await Promise[_0x46098f(0x12c)]([_0x5885a9[_0x46098f(0xf3)][_0x46098f(0x159)](_0x1c4957),_0x5885a9[_0x46098f(0xf3)][_0x46098f(0x167)](_0x1c4957),_0x5885a9[_0x46098f(0xf3)][_0x46098f(0x140)](_0x1c4957),_0x5885a9[_0x46098f(0xfb)]['listJourneysWithDetailsFromParentSegment'](_0x1c4957,{'includeAllVersions':!![]}),_0x5885a9['user']['buildUserMaps']()]);return{'parentSegmentResult':_0x5c8e77,'segmentsResult':_0x2cdcb5,'foldersResult':_0x54cb12,'journeysWithDetailsResult':_0x1bf066,'userMaps':_0x4b4ec8};},{'verbose':_0x11fc33[_0x5c3b52(0x123)]})[_0x5c3b52(0x183)](_0x615413=>_0x615413['data']),_0xf96e17=_0x2b26cb,_0x4bd8f0=extractRootFolderId(_0xf96e17),_0x301d8f=_0x4c33fc,_0x1183e2=_0x3869d2,{journeys:_0x3b9214,activationStepsById:_0x45af02}=_0x3f1466,_0x392ee9=new Map(_0x3b9214[_0x5c3b52(0x150)](_0x311c31=>[_0x311c31['id'],_0x311c31])),_0x27abcc=_0x3b9214['map'](_0x3503d2=>({'id':_0x3503d2['id'],'name':_0x3503d2[_0x5c3b52(0x14c)]['name'],'journeyBundleName':_0x3503d2[_0x5c3b52(0x14c)][_0x5c3b52(0x169)]||'','journeyBundleId':_0x3503d2[_0x5c3b52(0x14c)][_0x5c3b52(0x12b)]||'','versionNumber':_0x3503d2['attributes'][_0x5c3b52(0x171)],'description':_0x3503d2[_0x5c3b52(0x14c)][_0x5c3b52(0x126)],'state':_0x3503d2[_0x5c3b52(0x14c)][_0x5c3b52(0x16e)],'paused':_0x3503d2[_0x5c3b52(0x14c)]['paused'],'audienceId':_0x3503d2[_0x5c3b52(0x14c)][_0x5c3b52(0x147)],'folderId':_0x3503d2[_0x5c3b52(0x117)]?.[_0x5c3b52(0x165)]?.[_0x5c3b52(0x164)]?.['id'],'createdAt':_0x3503d2['attributes'][_0x5c3b52(0x172)],'updatedAt':_0x3503d2[_0x5c3b52(0x14c)][_0x5c3b52(0x16c)]})),{emailToId:_0x4729f1,idToEmail:_0x154aea}=_0x552c4a,_0x36a945=await withSpinner(_0x5c3b52(0x11f),async()=>{const _0x580f5f=_0x5c3b52,_0x4699bd=await _0x5885a9['connection'][_0x580f5f(0x138)]();return buildConnectionMaps(_0x4699bd);},{'verbose':_0x11fc33[_0x5c3b52(0x123)]})['then'](_0x1ee170=>_0x1ee170[_0x5c3b52(0x164)]),_0x464936=_0x36a945[_0x5c3b52(0x16b)],_0x284116=_0x36a945['idToName'],_0x3d6f19=_0x36a945[_0x5c3b52(0x10e)],_0x1fe579={'emailToIdMap':_0x4729f1,'connectionNameToIdMap':_0x464936,'connectionNameToTypeMap':_0x3d6f19,'getSchema':_0x3e7d27=>_0x5885a9['connection'][_0x5c3b52(0x102)](_0x3e7d27)};let {pathToId:_0x291dad,idToPath:_0x1aab53}=buildFolderMaps(_0x1183e2);const _0x3ee905=buildSegmentLookupMap(_0x301d8f,_0x1aab53),_0x3bcce0=buildSegmentNameToIdMap(_0x301d8f),_0x40e4ba=buildJourneyBundleLookupMap(_0x27abcc,_0x1aab53);let _0x30b92d;if(_0x28cdf0){if(!_0x28cdf0[_0x5c3b52(0x15b)]('.yml')&&!_0x28cdf0['endsWith']('.yaml'))return console[_0x5c3b52(0x11b)](a41_0x5d3ea3[_0x5c3b52(0x155)](_0x5c3b52(0x14d)+_0x28cdf0+'\x0a')),0x1;_0x30b92d=[_0x28cdf0];}else _0x30b92d=findYamlFiles(_0x13feeb);if(_0x30b92d[_0x5c3b52(0x166)]===0x0)return console['error'](a41_0x5d3ea3[_0x5c3b52(0x155)](_0x5c3b52(0xfc)+_0x13feeb+'\x0a')),console[_0x5c3b52(0x11b)](a41_0x5d3ea3['cyan'](_0x5c3b52(0x113))),0x1;let _0x2a6bb7,_0x5c517b;try{const _0x2d165b=parseAndClassifyYamlFiles(_0x30b92d,_0x13feeb,{'skipSegments':_0x11fc33[_0x5c3b52(0x121)]});_0x2a6bb7=_0x2d165b[_0x5c3b52(0xf5)],_0x5c517b=_0x2d165b[_0x5c3b52(0x17d)];const _0xa2a83c=validateParsedFiles(_0x2d165b,_0x13feeb);if(_0xa2a83c['length']>0x0)return console[_0x5c3b52(0x11b)](a41_0x5d3ea3[_0x5c3b52(0x155)]('\x0aValidation\x20failed:')),console[_0x5c3b52(0x11b)](formatValidationErrors(_0xa2a83c)),console[_0x5c3b52(0x11b)](a41_0x5d3ea3[_0x5c3b52(0xfd)](_0x5c3b52(0xf6))),0x1;}catch(_0x59505d){return console[_0x5c3b52(0x11b)](a41_0x5d3ea3[_0x5c3b52(0x155)](_0x5c3b52(0x116)+(_0x59505d instanceof Error?_0x59505d[_0x5c3b52(0x152)]:_0x59505d))),0x1;}if(_0x2a6bb7['length']===0x0&&_0x5c517b[_0x5c3b52(0x166)]===0x0){const _0x3203d8=_0x11fc33['journeysOnly']?_0x5c3b52(0xfb):'segment\x20or\x20journey';return console[_0x5c3b52(0x11b)](a41_0x5d3ea3[_0x5c3b52(0xfd)](_0x5c3b52(0xf4)+_0x3203d8+'\x20YAML\x20files\x20found')),0x0;}const _0x43c393=new Map();_0x301d8f[_0x5c3b52(0x166)]>0x0&&!_0x11fc33['journeysOnly']&&await withSpinner(_0x5c3b52(0x10d),async()=>{await batchAsync(_0x301d8f,async _0x574756=>{const _0x34cc43=a41_0x1be6,_0x2695fc=await _0x5885a9[_0x34cc43(0xf3)][_0x34cc43(0x145)](_0x1c4957,_0x574756['id']);_0x43c393[_0x34cc43(0x16a)](_0x574756['id'],_0x2695fc);});},{'verbose':_0x11fc33[_0x5c3b52(0x123)]});const {segmentFiles:_0x40f4b7,foldersToCreate:_0x32f96b}=await prepareSegmentFiles(_0x2a6bb7,{'segmentByFolderAndName':_0x3ee905,'activationsBySegmentId':_0x43c393,'folderPathToId':_0x291dad,'idToEmailMap':_0x154aea,'connectionIdToNameMap':_0x284116},_0x1fe579,_0x471423,_0x26e3d8),_0x4b90a3=_0x28cdf0?[]:findSegmentsToDelete(_0x301d8f,_0x2a6bb7[_0x5c3b52(0x150)](({yamlConfig:_0x149c08,folderPath:_0x320735})=>({'yamlConfig':_0x149c08,'folderPath':resolveTDFolderPath(_0x320735,_0x471423,_0x26e3d8)})),_0x1aab53,_0x26e3d8,_0x471423),{journeyFiles:_0x1baac3,foldersToCreate:_0x334b9a}=await withProgressSpinner('Preparing\x20journeys...',async _0x39e1f7=>prepareJourneyFiles(_0x5c517b,{'fetchJourney':async _0x34f47d=>_0x5885a9['journey'][_0x5c3b52(0xed)](_0x34f47d[_0x5c3b52(0x115)]),'journeyBundlesByFolderAndName':_0x40e4ba,'folderPathToId':_0x291dad,'idToEmailMap':_0x154aea,'connectionIdToNameMap':_0x284116,'existingSegments':_0x301d8f,'parentId':_0x1c4957,'deps':_0x5885a9,'progress':{'update':_0x14ad0e=>{const _0x4d18af=_0x5c3b52;_0x39e1f7[_0x4d18af(0x103)](_0x14ad0e),_0x11fc33[_0x4d18af(0x123)]&&console[_0x4d18af(0x11b)]('\x20\x20'+_0x14ad0e);}},'journeyById':_0x392ee9,'activationStepsById':_0x45af02},_0x471423,_0x26e3d8),{'verbose':_0x11fc33[_0x5c3b52(0x123)]})[_0x5c3b52(0x183)](_0x305f45=>_0x305f45[_0x5c3b52(0x164)]);for(const _0x21df85 of _0x334b9a){_0x32f96b[_0x5c3b52(0x124)](_0x21df85);}const _0x15b934=_0x28cdf0?[]:findJourneysToDelete(_0x27abcc,_0x5c517b['map'](({yamlConfig:_0x598ba6,folderPath:_0x5b4ca1})=>({'yamlConfig':_0x598ba6,'folderPath':resolveTDFolderPath(_0x5b4ca1,_0x471423,_0x26e3d8)})),_0x1aab53,_0x26e3d8,_0x471423),_0x5a7aa0=calculatePushStats(_0x40f4b7,_0x1baac3,_0x32f96b,_0x4b90a3,_0x15b934,!!_0x11fc33[_0x5c3b52(0x108)],!!_0x11fc33['journeysOnly']),_0x22c071=_0x5a7aa0[_0x5c3b52(0xf5)][_0x5c3b52(0x12a)],_0x33dde5=_0x5a7aa0['segments'][_0x5c3b52(0x10a)],_0x1a9c3e=_0x5a7aa0[_0x5c3b52(0xf5)]['unchanged'],_0x243bda=_0x5a7aa0[_0x5c3b52(0xf5)][_0x5c3b52(0x13b)],_0x30bf32=_0x5a7aa0[_0x5c3b52(0x15d)]['toCreate'],_0x59b2cf=_0x5a7aa0[_0x5c3b52(0x17d)][_0x5c3b52(0x12a)],_0x44bd35=_0x5a7aa0[_0x5c3b52(0x17d)]['changed'],_0x52f71a=_0x5a7aa0[_0x5c3b52(0x17d)][_0x5c3b52(0x11a)],_0xd87840=_0x5a7aa0['journeys']['toDelete'],_0x50268f=_0x5a7aa0['activations'][_0x5c3b52(0x12c)],_0x58b745=_0x5a7aa0['activations'][_0x5c3b52(0x186)],_0x2ae1c0=_0x5a7aa0[_0x5c3b52(0x176)][_0x5c3b52(0x141)],_0x26ff5d=_0x5a7aa0[_0x5c3b52(0x176)][_0x5c3b52(0x13b)];console[_0x5c3b52(0x11b)](_0x5c3b52(0x180)+_0x18b692+'\x27:');_0x30bf32[_0x5c3b52(0x166)]>0x0&&console[_0x5c3b52(0x11b)]('\x20\x20'+a41_0x5d3ea3[_0x5c3b52(0x156)](_0x5c3b52(0x16f)+_0x30bf32[_0x5c3b52(0x166)]+_0x5c3b52(0x101)));if(!_0x11fc33[_0x5c3b52(0x121)]){console[_0x5c3b52(0x11b)]('\x20\x20📊\x20Segments:'),console[_0x5c3b52(0x11b)](_0x5c3b52(0x15a)+a41_0x5d3ea3[_0x5c3b52(0x12f)]('+\x20'+_0x22c071[_0x5c3b52(0x166)]+_0x5c3b52(0x170))),console['error']('\x20\x20\x20\x20'+a41_0x5d3ea3[_0x5c3b52(0xfd)]('~\x20'+_0x33dde5['length']+'\x20changed'));if(_0x243bda[_0x5c3b52(0x166)]>0x0)console[_0x5c3b52(0x11b)](_0x5c3b52(0x15a)+a41_0x5d3ea3[_0x5c3b52(0x155)]('-\x20'+_0x243bda[_0x5c3b52(0x166)]+_0x5c3b52(0x107)));else _0x4b90a3[_0x5c3b52(0x166)]>0x0&&!_0x11fc33[_0x5c3b52(0x108)]&&console['error'](_0x5c3b52(0x15a)+a41_0x5d3ea3[_0x5c3b52(0x109)](_0x4b90a3[_0x5c3b52(0x166)]+_0x5c3b52(0x185)));console[_0x5c3b52(0x11b)](_0x5c3b52(0x15a)+a41_0x5d3ea3['dim']('=\x20'+_0x1a9c3e[_0x5c3b52(0x166)]+_0x5c3b52(0x137)));}if(_0x1baac3[_0x5c3b52(0x166)]>0x0||_0x15b934['length']>0x0){console['error'](_0x5c3b52(0x14a)),console[_0x5c3b52(0x11b)](_0x5c3b52(0x15a)+a41_0x5d3ea3[_0x5c3b52(0x12f)]('+\x20'+_0x59b2cf[_0x5c3b52(0x166)]+_0x5c3b52(0x170))),console[_0x5c3b52(0x11b)](_0x5c3b52(0x15a)+a41_0x5d3ea3[_0x5c3b52(0xfd)]('~\x20'+_0x44bd35[_0x5c3b52(0x166)]+_0x5c3b52(0x188)));if(_0xd87840[_0x5c3b52(0x166)]>0x0)console[_0x5c3b52(0x11b)](_0x5c3b52(0x15a)+a41_0x5d3ea3['red']('-\x20'+_0xd87840['length']+_0x5c3b52(0x107)));else _0x15b934[_0x5c3b52(0x166)]>0x0&&!_0x11fc33[_0x5c3b52(0x108)]&&console[_0x5c3b52(0x11b)](_0x5c3b52(0x15a)+a41_0x5d3ea3[_0x5c3b52(0x109)](_0x15b934[_0x5c3b52(0x166)]+_0x5c3b52(0x185)));console[_0x5c3b52(0x11b)]('\x20\x20\x20\x20'+a41_0x5d3ea3[_0x5c3b52(0x109)]('=\x20'+_0x52f71a['length']+'\x20unchanged'));}_0x50268f[_0x5c3b52(0x166)]>0x0&&!_0x11fc33['journeysOnly']&&(console[_0x5c3b52(0x11b)](''),console[_0x5c3b52(0x11b)](_0x5c3b52(0x142)),_0x58b745[_0x5c3b52(0x166)]>0x0&&console['error'](_0x5c3b52(0x15a)+a41_0x5d3ea3[_0x5c3b52(0x12f)]('+\x20'+_0x58b745[_0x5c3b52(0x166)]+_0x5c3b52(0x11c))),_0x2ae1c0[_0x5c3b52(0x166)]>0x0&&console[_0x5c3b52(0x11b)](_0x5c3b52(0x15a)+a41_0x5d3ea3['yellow']('~\x20'+_0x2ae1c0[_0x5c3b52(0x166)]+'\x20to\x20update')),_0x26ff5d[_0x5c3b52(0x166)]>0x0&&console[_0x5c3b52(0x11b)](_0x5c3b52(0x15a)+a41_0x5d3ea3[_0x5c3b52(0x155)]('-\x20'+_0x26ff5d[_0x5c3b52(0x166)]+_0x5c3b52(0x107))));console[_0x5c3b52(0x11b)](_0x5c3b52(0xff)+a41_0x5d3ea3[_0x5c3b52(0x15e)](_0x13feeb)+'\x0a');if(_0x30bf32[_0x5c3b52(0x166)]>0x0){console['error'](_0x5c3b52(0x177));for(const _0x71a539 of _0x30bf32){console[_0x5c3b52(0x11b)]('\x20\x20'+a41_0x5d3ea3[_0x5c3b52(0x156)]('+')+'\x20'+_0x71a539);}console[_0x5c3b52(0x11b)]('');}if(_0x22c071[_0x5c3b52(0x166)]>0x0&&!_0x11fc33['journeysOnly'])for(const _0x1b5b3e of _0x22c071){const _0x3bff8e=_0x1b5b3e[_0x5c3b52(0x100)]?_0x1b5b3e[_0x5c3b52(0x100)]+'/'+_0x1b5b3e[_0x5c3b52(0x133)][_0x5c3b52(0x12e)]:_0x1b5b3e[_0x5c3b52(0x133)][_0x5c3b52(0x12e)],_0x230be0=_0x1b5b3e[_0x5c3b52(0x133)][_0x5c3b52(0x176)]?.[_0x5c3b52(0x166)]||0x0,_0x1a1ae5=_0x230be0>0x0?a41_0x5d3ea3[_0x5c3b52(0x109)]('\x20['+_0x230be0+'\x20activations]'):'';console[_0x5c3b52(0x11b)]('\x0a'+a41_0x5d3ea3[_0x5c3b52(0x12f)](_0x5c3b52(0x151))+'\x20'+_0x3bff8e+_0x1a1ae5),console[_0x5c3b52(0x11b)]('─'[_0x5c3b52(0x175)](0x3c)),_0x1b5b3e[_0x5c3b52(0x14b)]&&console[_0x5c3b52(0x11b)](_0x1b5b3e[_0x5c3b52(0x14b)]),console[_0x5c3b52(0x11b)]('─'['repeat'](0x3c));}if(_0x243bda[_0x5c3b52(0x166)]>0x0&&!_0x11fc33[_0x5c3b52(0x121)])for(const _0x2ae467 of _0x243bda){const _0x54e759=_0x2ae467[_0x5c3b52(0xec)]?_0x1aab53['get'](_0x2ae467[_0x5c3b52(0xec)][_0x5c3b52(0x119)]())||'':'',_0x693c7=_0x54e759?_0x54e759+'/'+_0x2ae467[_0x5c3b52(0x12e)]:_0x2ae467[_0x5c3b52(0x12e)],_0x389005=_0x43c393[_0x5c3b52(0xef)](_0x2ae467['id'])||[],_0x5ef8be=_0x389005[_0x5c3b52(0x166)]>0x0?a41_0x5d3ea3[_0x5c3b52(0x109)]('\x20['+_0x389005['length']+_0x5c3b52(0xf0)):'';console[_0x5c3b52(0x11b)]('\x0a'+a41_0x5d3ea3[_0x5c3b52(0x155)](_0x5c3b52(0xfa))+'\x20'+_0x693c7+_0x5ef8be),console[_0x5c3b52(0x11b)]('─'[_0x5c3b52(0x175)](0x3c));const _0x242614=segmentWithActivationsToYaml(_0x2ae467,_0x389005,undefined,_0x154aea,_0x284116),_0x475fd7=segmentToYamlString(_0x242614),_0x37071d=generateDiff(_0x475fd7,'');console[_0x5c3b52(0x11b)](formatDiffWithColors(_0x37071d)),console[_0x5c3b52(0x11b)]('─'[_0x5c3b52(0x175)](0x3c));}const _0x792b48=_0x40f4b7[_0x5c3b52(0x131)](_0x5561ee=>!_0x5561ee[_0x5c3b52(0x158)]&&_0x5561ee[_0x5c3b52(0x14b)]);if(_0x792b48[_0x5c3b52(0x166)]>0x0&&!_0x11fc33['journeysOnly'])for(const _0x2e7229 of _0x792b48){const _0x5d6cb5=_0x2e7229[_0x5c3b52(0x100)]?_0x2e7229[_0x5c3b52(0x100)]+'/'+_0x2e7229[_0x5c3b52(0x133)][_0x5c3b52(0x12e)]:_0x2e7229[_0x5c3b52(0x133)][_0x5c3b52(0x12e)];console[_0x5c3b52(0x11b)]('\x0a'+a41_0x5d3ea3[_0x5c3b52(0xfd)](_0x5c3b52(0x15f))+'\x20'+_0x5d6cb5),console[_0x5c3b52(0x11b)]('─'[_0x5c3b52(0x175)](0x3c)),console[_0x5c3b52(0x11b)](_0x2e7229['diff']),console['error']('─'['repeat'](0x3c));}if(_0x59b2cf[_0x5c3b52(0x166)]>0x0)for(const _0x1a4d84 of _0x59b2cf){const _0x44224f=_0x1a4d84[_0x5c3b52(0x100)]?_0x1a4d84[_0x5c3b52(0x100)]+'/'+_0x1a4d84['yamlConfig']['name']:_0x1a4d84[_0x5c3b52(0x133)][_0x5c3b52(0x12e)];console[_0x5c3b52(0x11b)]('\x0a'+a41_0x5d3ea3['green']('New\x20journey:')+'\x20'+_0x44224f),console['error']('─'['repeat'](0x3c)),_0x1a4d84[_0x5c3b52(0x14b)]&&console['error'](_0x1a4d84[_0x5c3b52(0x14b)]),console[_0x5c3b52(0x11b)]('─'[_0x5c3b52(0x175)](0x3c));}const _0x1e6cf5=_0x1baac3[_0x5c3b52(0x131)](_0x1ea40d=>!_0x1ea40d['isNew']&&_0x1ea40d[_0x5c3b52(0x14b)]);if(_0x1e6cf5['length']>0x0)for(const _0xc49036 of _0x1e6cf5){const _0x9f8879=_0xc49036[_0x5c3b52(0x100)]?_0xc49036[_0x5c3b52(0x100)]+'/'+_0xc49036[_0x5c3b52(0x133)]['name']:_0xc49036[_0x5c3b52(0x133)]['name'];console['error']('\x0a'+a41_0x5d3ea3[_0x5c3b52(0xfd)](_0x5c3b52(0x10b))+'\x20'+_0x9f8879),console[_0x5c3b52(0x11b)]('─'[_0x5c3b52(0x175)](0x3c)),console[_0x5c3b52(0x11b)](_0xc49036[_0x5c3b52(0x14b)]),console['error']('─'[_0x5c3b52(0x175)](0x3c));}if(_0xd87840['length']>0x0)for(const _0x4a69d1 of _0xd87840){const _0x30963a=_0x4a69d1[_0x5c3b52(0x110)]?_0x1aab53[_0x5c3b52(0xef)](_0x4a69d1[_0x5c3b52(0x110)])||'':'',_0x439a18=_0x30963a?_0x30963a+'/'+_0x4a69d1[_0x5c3b52(0x169)]:_0x4a69d1['journeyBundleName'];console['error']('\x0a'+a41_0x5d3ea3['red'](_0x5c3b52(0x160))+'\x20'+_0x439a18),console[_0x5c3b52(0x11b)]('─'[_0x5c3b52(0x175)](0x3c)),console[_0x5c3b52(0x11b)](a41_0x5d3ea3['red'](_0x5c3b52(0xfe))),console[_0x5c3b52(0x11b)]('─'['repeat'](0x3c));}if(_0x11fc33['dryRun'])return console[_0x5c3b52(0x11b)](a41_0x5d3ea3['yellow']('\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made')),0x0;const _0x1c690c=_0x11fc33['journeysOnly']?![]:_0x22c071[_0x5c3b52(0x166)]>0x0||_0x33dde5[_0x5c3b52(0x166)]>0x0||_0x243bda[_0x5c3b52(0x166)]>0x0,_0x35fef9=_0x59b2cf[_0x5c3b52(0x166)]>0x0||_0x44bd35[_0x5c3b52(0x166)]>0x0||_0xd87840[_0x5c3b52(0x166)]>0x0,_0x581bcd=_0x11fc33['journeysOnly']?![]:_0x50268f[_0x5c3b52(0x166)]>0x0,_0x40e71d=_0x30bf32[_0x5c3b52(0x166)]>0x0;if(!_0x1c690c&&!_0x35fef9&&!_0x581bcd&&!_0x40e71d){const _0x48c4de=_0x11fc33[_0x5c3b52(0x121)]?_0x5c3b52(0x10f):_0x5c3b52(0x104);console[_0x5c3b52(0x11b)](a41_0x5d3ea3[_0x5c3b52(0x12f)](_0x48c4de));if(_0x28cdf0&&_0x1a9c3e['length']===0x1){const _0x4e6872=_0x1a9c3e[0x0];if(_0x4e6872[_0x5c3b52(0x15c)]?.['id']){const _0x220a36=getConsoleNextUrl(_0x11fc33['site'],_0x5c3b52(0x17b)+_0x1c4957+_0x5c3b52(0x17c)+_0x4e6872[_0x5c3b52(0x15c)]['id']+'/sb/da/esr');console[_0x5c3b52(0x11b)](_0x5c3b52(0x187)+a41_0x5d3ea3[_0x5c3b52(0x15e)](_0x220a36));}}if(_0x28cdf0&&_0x52f71a[_0x5c3b52(0x166)]===0x1){const _0x580ba9=_0x52f71a[0x0];if(_0x580ba9[_0x5c3b52(0xee)]?.['id']){const _0x3a5f5b=getConsoleNextUrl(_0x11fc33[_0x5c3b52(0x168)],'/app/ps/'+_0x1c4957+_0x5c3b52(0x17c)+_0x580ba9[_0x5c3b52(0xee)]['id']+_0x5c3b52(0x105));console[_0x5c3b52(0x11b)]('\x20\x20'+a41_0x5d3ea3[_0x5c3b52(0x15e)](_0x3a5f5b));}}return 0x0;}const _0x3b9fc3=_0x11fc33[_0x5c3b52(0x121)]?_0x59b2cf[_0x5c3b52(0x166)]+_0x44bd35[_0x5c3b52(0x166)]+_0xd87840[_0x5c3b52(0x166)]+_0x30bf32[_0x5c3b52(0x166)]:_0x22c071[_0x5c3b52(0x166)]+_0x33dde5[_0x5c3b52(0x166)]+_0x243bda[_0x5c3b52(0x166)]+_0x59b2cf[_0x5c3b52(0x166)]+_0x44bd35['length']+_0xd87840[_0x5c3b52(0x166)]+_0x30bf32[_0x5c3b52(0x166)]+_0x50268f['length'];if(!_0x11fc33['yes']&&_0x3b9fc3>0x0){if(!isInteractive())return console[_0x5c3b52(0x11b)](a41_0x5d3ea3[_0x5c3b52(0x155)](_0x5c3b52(0x148)),_0x5c3b52(0x130)),console[_0x5c3b52(0x11b)](a41_0x5d3ea3['dim'](_0x5c3b52(0x162))),0x1;const _0x446b44=await confirmKey('Push\x20'+_0x3b9fc3+_0x5c3b52(0x14f));if(!_0x446b44)return console[_0x5c3b52(0x11b)](a41_0x5d3ea3['yellow']('Aborted.')),0x1;}const _0x57c78f={'withProgress':async(_0x49bbc3,_0x3ee478)=>{const _0x2748da=_0x5c3b52,_0x2808a7=await withSpinner(_0x49bbc3,_0x3ee478,{'verbose':_0x11fc33[_0x2748da(0x123)]});return{'data':_0x2808a7[_0x2748da(0x164)]};},'logInfo':_0x3cfbc1=>console['error'](a41_0x5d3ea3[_0x5c3b52(0x156)]('✔\x20'+_0x3cfbc1)),'logSuccess':_0x40e68e=>console[_0x5c3b52(0x11b)](a41_0x5d3ea3[_0x5c3b52(0x12f)]('✔\x20'+_0x40e68e)),'logWarning':_0x5d49c4=>console[_0x5c3b52(0x11b)](a41_0x5d3ea3[_0x5c3b52(0xfd)]('⚠\x20'+_0x5d49c4)),'logDeleted':_0x92dfdc=>console['error'](a41_0x5d3ea3[_0x5c3b52(0x155)]('✔\x20'+_0x92dfdc))},_0x29489b={'segment':_0x5885a9[_0x5c3b52(0xf3)],'journey':_0x5885a9[_0x5c3b52(0xfb)],'user':_0x5885a9[_0x5c3b52(0x178)],'connection':_0x5885a9['connection']};_0x30bf32[_0x5c3b52(0x166)]>0x0&&(_0x291dad=await executePushFolders(_0x29489b,_0x30bf32,_0x291dad,{'parentId':_0x1c4957},_0x57c78f));const _0x58694c={'rootFolderId':_0x4bd8f0,'folderPathToId':_0x291dad,'folderIdToPath':_0x1aab53,'segmentNameToId':_0x3bcce0,'activationsBySegmentId':_0x43c393,'emailToIdMap':_0x4729f1,'idToEmailMap':_0x154aea,'connectionNameToIdMap':_0x36a945[_0x5c3b52(0x16b)],'connectionIdToNameMap':_0x36a945[_0x5c3b52(0x136)],'connectionNameToTypeMap':_0x3d6f19},_0xe23928=await executePushSegments(_0x29489b,_0x11fc33[_0x5c3b52(0x121)]?[]:_0x40f4b7,_0x58694c,{'parentId':_0x1c4957},_0x57c78f),_0x3e07c3=_0xe23928[_0x5c3b52(0x132)],_0x5539f6=_0xe23928['updated'],_0x1feb17=_0xe23928[_0x5c3b52(0x176)]['created'],_0x5e98dc=_0xe23928[_0x5c3b52(0x176)][_0x5c3b52(0x11d)],_0x3508f8=_0xe23928[_0x5c3b52(0x176)]['deleted'];let _0x7b2a4f;if(_0x28cdf0&&_0x40f4b7[_0x5c3b52(0x166)]===0x1){const _0x4bc7b5=_0x40f4b7[0x0];_0x7b2a4f=_0x4bc7b5[_0x5c3b52(0x15c)]?.['id']??_0xe23928[_0x5c3b52(0x13a)][_0x5c3b52(0xef)](_0x4bc7b5[_0x5c3b52(0x133)]['name']);}const _0x110998=await executePushSegmentDeletions(_0x29489b,_0x11fc33['journeysOnly']?[]:_0x243bda,_0x57c78f);let _0xa7cc9e=0x0,_0x3a4fa4=0x0,_0x411035=0x0;const _0x1f7b94=new Map(_0x3bcce0);for(const [_0x4bcd8b,_0x4adec0]of _0xe23928[_0x5c3b52(0x13a)]){_0x1f7b94[_0x5c3b52(0x16a)](_0x4bcd8b,_0x4adec0);}if(_0x1baac3[_0x5c3b52(0x166)]>0x0){const _0x145995={..._0x58694c,'segmentNameToId':_0x1f7b94,'existingSegments':_0x301d8f,'activationContext':_0x1fe579},_0x5785bd=await executePushJourneys(_0x29489b,_0x1baac3,_0x145995,{'parentId':_0x1c4957,'rootFolderId':_0x4bd8f0,'verbose':_0x11fc33[_0x5c3b52(0x123)]},_0x57c78f);_0xa7cc9e=_0x5785bd['created'],_0x3a4fa4=_0x5785bd[_0x5c3b52(0x11d)];if(_0x28cdf0&&_0x5785bd[_0x5c3b52(0x17e)][_0x5c3b52(0x166)]===0x1){const _0x4eaec1=_0x5785bd['results'][0x0];if(_0x4eaec1[_0x5c3b52(0x115)]){const _0x866b63=getConsoleNextUrl(_0x11fc33[_0x5c3b52(0x168)],'/app/ps/'+_0x1c4957+_0x5c3b52(0x17c)+_0x4eaec1[_0x5c3b52(0x115)]+_0x5c3b52(0x105));console['error']('\x20\x20'+a41_0x5d3ea3[_0x5c3b52(0x15e)](_0x866b63));}}}for(const _0x28a73f of _0xd87840){console['error'](a41_0x5d3ea3[_0x5c3b52(0xfd)](_0x5c3b52(0x134)+_0x28a73f[_0x5c3b52(0x169)])),_0x411035++;}const _0x4cc74b=[];if(_0x3e07c3>0x0)_0x4cc74b[_0x5c3b52(0xf2)](_0x3e07c3+_0x5c3b52(0x13e));if(_0x5539f6>0x0)_0x4cc74b[_0x5c3b52(0xf2)](_0x5539f6+_0x5c3b52(0x118));if(_0x110998>0x0)_0x4cc74b[_0x5c3b52(0xf2)](_0x110998+_0x5c3b52(0xf8));const _0xd50048=[];if(_0xa7cc9e>0x0)_0xd50048[_0x5c3b52(0xf2)](_0xa7cc9e+'\x20created');if(_0x3a4fa4>0x0)_0xd50048[_0x5c3b52(0xf2)](_0x3a4fa4+_0x5c3b52(0x118));if(_0x411035>0x0)_0xd50048[_0x5c3b52(0xf2)](_0x411035+_0x5c3b52(0xf8));const _0x41722e=[];if(_0x1feb17>0x0)_0x41722e[_0x5c3b52(0xf2)](_0x1feb17+_0x5c3b52(0x13e));if(_0x5e98dc>0x0)_0x41722e[_0x5c3b52(0xf2)](_0x5e98dc+_0x5c3b52(0x118));if(_0x3508f8>0x0)_0x41722e['push'](_0x3508f8+_0x5c3b52(0xf8));console[_0x5c3b52(0x11b)](a41_0x5d3ea3[_0x5c3b52(0x12f)](_0x5c3b52(0x16d)));_0x4cc74b['length']>0x0&&!_0x11fc33[_0x5c3b52(0x121)]&&console['error'](_0x5c3b52(0x17a)+_0x4cc74b[_0x5c3b52(0x128)](',\x20'));_0xd50048[_0x5c3b52(0x166)]>0x0&&console['error'](_0x5c3b52(0x114)+_0xd50048[_0x5c3b52(0x128)](',\x20'));_0x41722e['length']>0x0&&!_0x11fc33['journeysOnly']&&console[_0x5c3b52(0x11b)](_0x5c3b52(0x112)+_0x41722e[_0x5c3b52(0x128)](',\x20'));if(_0x7b2a4f){const _0x5a15f4=getConsoleNextUrl(_0x11fc33[_0x5c3b52(0x168)],'/app/ps/'+_0x1c4957+_0x5c3b52(0x17c)+_0x7b2a4f+_0x5c3b52(0x13f));console['error'](_0x5c3b52(0x187)+a41_0x5d3ea3[_0x5c3b52(0x15e)](_0x5a15f4));}return 0x0;}}
@@ -1 +1 @@
1
- const a42_0x3cc1c0=a42_0x8ca3;(function(_0xfab12e,_0x1edd47){const _0x290243=a42_0x8ca3,_0x5f1012=_0xfab12e();while(!![]){try{const _0x220292=-parseInt(_0x290243(0x1cc))/0x1*(parseInt(_0x290243(0x1ad))/0x2)+-parseInt(_0x290243(0x1c5))/0x3+parseInt(_0x290243(0x1ac))/0x4*(parseInt(_0x290243(0x1d6))/0x5)+parseInt(_0x290243(0x1c0))/0x6*(-parseInt(_0x290243(0x1d3))/0x7)+parseInt(_0x290243(0x1bc))/0x8*(-parseInt(_0x290243(0x1d7))/0x9)+-parseInt(_0x290243(0x1bb))/0xa+parseInt(_0x290243(0x1cf))/0xb;if(_0x220292===_0x1edd47)break;else _0x5f1012['push'](_0x5f1012['shift']());}catch(_0x1b7c14){_0x5f1012['push'](_0x5f1012['shift']());}}}(a42_0x48f8,0xda8f2));function a42_0x48f8(){const _0x285fc6=['\x20\x20\x20Path:\x20','61360585GrmbCb','name','\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22','resolveFolderId','21UeGOSR','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','description','80MUaeah','48771TkCrap','\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','rule','170792xpGeoW','19736aMjvFU','Resolving\x20folder\x20\x27','parentId','segmentName','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','folder','Resolved\x20relative\x20path\x20to:\x20','Segment\x20ID:\x20','kind','.\x20Only\x20child\x20segments\x20can\x20be\x20updated.','verbose','Resolved\x20folder\x20ID:\x20','includes','⚠\x20Deprecation\x20warning:\x20`segment\x20update`\x20is\x20deprecated.','16534410AIszlO','2128EsnCFj','Examples:','Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]','\x27...','1206438pjteDp','✔\x20Updated\x20segment\x20\x27','segment:update','type','resolvePathToResource','2458269kJheUm','Parent\x20ID:\x20','data','error','yellow','Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]','Resolving\x20path\x20\x27','86DsMFOa','segment'];a42_0x48f8=function(){return _0x285fc6;};return a42_0x48f8();}function a42_0x8ca3(_0x2b14bb,_0x3fd89c){_0x2b14bb=_0x2b14bb-0x1ac;const _0x48f89c=a42_0x48f8();let _0x8ca3bb=_0x48f89c[_0x2b14bb];return _0x8ca3bb;}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_0xb71434 from'chalk';export class SegmentUpdateCommand extends BaseCommand{[a42_0x3cc1c0(0x1d0)]=a42_0x3cc1c0(0x1c2);[a42_0x3cc1c0(0x1d5)]='Update\x20existing\x20child\x20segment';async['execute'](_0x1dbb07){const _0x42ac7c=a42_0x3cc1c0;console[_0x42ac7c(0x1c8)](a42_0xb71434[_0x42ac7c(0x1c9)](_0x42ac7c(0x1ba))),console['error'](a42_0xb71434[_0x42ac7c(0x1c9)](_0x42ac7c(0x1d4)));const {options:_0x678954,args:_0x1153e2,tdx:_0x457422}=_0x1dbb07,_0x2522ce=_0x678954;if(_0x1153e2['length']===0x0)return console[_0x42ac7c(0x1c8)](_0x42ac7c(0x1b1)),console[_0x42ac7c(0x1c8)](_0x42ac7c(0x1be)),console[_0x42ac7c(0x1c8)](_0x42ac7c(0x1bd)),console[_0x42ac7c(0x1c8)](_0x42ac7c(0x1d1)),console[_0x42ac7c(0x1c8)](_0x42ac7c(0x1d8)),0x1;const _0x4380a6=_0x1153e2[0x0],_0x5c2bf6=_0x678954['segmentPath'];let _0x1ae354=_0x4380a6;_0x5c2bf6&&!_0x4380a6[_0x42ac7c(0x1b9)]('/')&&(_0x1ae354=_0x5c2bf6+'/'+_0x4380a6,_0x2522ce[_0x42ac7c(0x1b7)]&&console[_0x42ac7c(0x1c8)](_0x42ac7c(0x1b3)+_0x1ae354));const _0x211db9=await withSpinner(_0x42ac7c(0x1cb)+_0x1ae354+_0x42ac7c(0x1bf),()=>_0x457422[_0x42ac7c(0x1cd)][_0x42ac7c(0x1c4)](_0x1ae354),{'verbose':_0x2522ce[_0x42ac7c(0x1b7)]}),_0x973a85=_0x211db9[_0x42ac7c(0x1c7)];_0x2522ce[_0x42ac7c(0x1b7)]&&console[_0x42ac7c(0x1c8)]('Resolved\x20type:\x20'+_0x973a85['type']);if(_0x973a85[_0x42ac7c(0x1c3)]!=='segment')return console[_0x42ac7c(0x1c8)]('Error:\x20Cannot\x20update\x20'+_0x973a85[_0x42ac7c(0x1c3)]+_0x42ac7c(0x1b6)),console[_0x42ac7c(0x1c8)](_0x42ac7c(0x1ca)),0x1;if(!_0x973a85['segmentId'])throw new SDKError(ErrorCode['INTERNAL'],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x4145d0=_0x973a85[_0x42ac7c(0x1af)],_0x458c20=_0x973a85['segmentId'];_0x2522ce['verbose']&&(console[_0x42ac7c(0x1c8)](_0x42ac7c(0x1c6)+_0x4145d0),console['error'](_0x42ac7c(0x1b4)+_0x458c20));let _0x5f1a1b;if(_0x2522ce[_0x42ac7c(0x1b2)]){const _0x540b0d=_0x2522ce['folder'],_0x4801cb=await withSpinner(_0x42ac7c(0x1ae)+_0x540b0d+_0x42ac7c(0x1bf),()=>_0x457422[_0x42ac7c(0x1cd)][_0x42ac7c(0x1d2)](_0x4145d0,_0x540b0d),{'verbose':_0x2522ce[_0x42ac7c(0x1b7)]});_0x5f1a1b=parseInt(_0x4801cb[_0x42ac7c(0x1c7)],0xa),_0x2522ce['verbose']&&console[_0x42ac7c(0x1c8)](_0x42ac7c(0x1b8)+_0x5f1a1b);}const _0x2c1d4a=await loadJSONFromOptions(_0x2522ce[_0x42ac7c(0x1d9)],_0x2522ce['ruleFile']),_0x4ce54b={'name':_0x2522ce[_0x42ac7c(0x1d0)],'description':_0x2522ce[_0x42ac7c(0x1d5)],'rule':_0x2c1d4a,'kind':_0x2522ce[_0x42ac7c(0x1b5)]!==undefined?parseInt(_0x2522ce['kind'],0xa):undefined,'segmentFolderId':_0x5f1a1b},_0x3a3f37=await withSpinner('Updating\x20segment\x20\x27'+_0x973a85[_0x42ac7c(0x1b0)]+_0x42ac7c(0x1bf),()=>_0x457422[_0x42ac7c(0x1cd)]['updateSegmentById'](_0x4145d0,_0x458c20,_0x4ce54b),{'verbose':_0x2522ce[_0x42ac7c(0x1b7)]}),_0x42eea0=_0x3a3f37[_0x42ac7c(0x1c7)];return console['error'](_0x42ac7c(0x1c1)+_0x42eea0[_0x42ac7c(0x1d0)]+'\x27'),_0x1ae354!==_0x4380a6&&console[_0x42ac7c(0x1c8)](_0x42ac7c(0x1ce)+_0x1ae354),await handleSDKOutput([_0x42eea0],_0x2522ce),0x0;}}
1
+ const a42_0x54f4a3=a42_0x28b2;(function(_0x2284c1,_0x2c7e68){const _0x2ed59c=a42_0x28b2,_0x252016=_0x2284c1();while(!![]){try{const _0x2d6ed7=parseInt(_0x2ed59c(0x1ea))/0x1*(parseInt(_0x2ed59c(0x1f0))/0x2)+parseInt(_0x2ed59c(0x1f1))/0x3+-parseInt(_0x2ed59c(0x1ed))/0x4+-parseInt(_0x2ed59c(0x1f7))/0x5*(parseInt(_0x2ed59c(0x1e3))/0x6)+-parseInt(_0x2ed59c(0x1c9))/0x7+parseInt(_0x2ed59c(0x1f3))/0x8*(-parseInt(_0x2ed59c(0x1de))/0x9)+-parseInt(_0x2ed59c(0x1d7))/0xa*(-parseInt(_0x2ed59c(0x1d1))/0xb);if(_0x2d6ed7===_0x2c7e68)break;else _0x252016['push'](_0x252016['shift']());}catch(_0x6772e9){_0x252016['push'](_0x252016['shift']());}}}(a42_0x31c7,0xf046a));import{BaseCommand}from'./command.js';function a42_0x28b2(_0x3c9826,_0x5342ea){_0x3c9826=_0x3c9826-0x1c6;const _0x31c7b1=a42_0x31c7();let _0x28b26b=_0x31c7b1[_0x3c9826];return _0x28b26b;}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_0x28f56b from'chalk';function a42_0x31c7(){const _0x2cd0e6=['13315617gzzrIE','Segment\x20ID\x20missing\x20from\x20resolved\x20path','⚠\x20Deprecation\x20warning:\x20`segment\x20update`\x20is\x20deprecated.','Segment\x20ID:\x20','type','segmentId','Examples:','\x20\x20\x20Path:\x20','99TKVfBH','Parent\x20ID:\x20','name','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','Resolving\x20folder\x20\x27','yellow','5173400bMWiuZ','resolvePathToResource','Updating\x20segment\x20\x27','execute','Error:\x20Cannot\x20update\x20','Resolved\x20relative\x20path\x20to:\x20','resolveFolderId','9QSYVao','description','includes','\x27...','rule','1671006aivNgr','kind','folder','segment','segment:update','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22','1IgXqkO','ruleFile','Resolving\x20path\x20\x27','2428860IxZScf','error','.\x20Only\x20child\x20segments\x20can\x20be\x20updated.','550166CnjbLk','4055169AtdYYt','Resolved\x20folder\x20ID:\x20','15629976PrVXMK','length','verbose','data','15cAvQyg','Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]','\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','✔\x20Updated\x20segment\x20\x27'];a42_0x31c7=function(){return _0x2cd0e6;};return a42_0x31c7();}export class SegmentUpdateCommand extends BaseCommand{['name']=a42_0x54f4a3(0x1e7);[a42_0x54f4a3(0x1df)]='Update\x20existing\x20child\x20segment';async[a42_0x54f4a3(0x1da)](_0x303db8){const _0x4f9131=a42_0x54f4a3;console['error'](a42_0x28f56b['yellow'](_0x4f9131(0x1cb))),console['error'](a42_0x28f56b[_0x4f9131(0x1d6)](_0x4f9131(0x1d4)));const {options:_0x399503,args:_0xa172e5,tdx:_0x17a250}=_0x303db8,_0x2deab7=_0x399503;if(_0xa172e5[_0x4f9131(0x1f4)]===0x0)return console[_0x4f9131(0x1ee)](_0x4f9131(0x1e8)),console[_0x4f9131(0x1ee)]('Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]'),console[_0x4f9131(0x1ee)](_0x4f9131(0x1cf)),console[_0x4f9131(0x1ee)](_0x4f9131(0x1e9)),console[_0x4f9131(0x1ee)](_0x4f9131(0x1c7)),0x1;const _0x550726=_0xa172e5[0x0],_0x56219e=_0x399503['segmentPath'];let _0x59e817=_0x550726;_0x56219e&&!_0x550726[_0x4f9131(0x1e0)]('/')&&(_0x59e817=_0x56219e+'/'+_0x550726,_0x2deab7[_0x4f9131(0x1f5)]&&console[_0x4f9131(0x1ee)](_0x4f9131(0x1dc)+_0x59e817));const _0x6aae3c=await withSpinner(_0x4f9131(0x1ec)+_0x59e817+_0x4f9131(0x1e1),()=>_0x17a250[_0x4f9131(0x1e6)][_0x4f9131(0x1d8)](_0x59e817),{'verbose':_0x2deab7[_0x4f9131(0x1f5)]}),_0x4a0e19=_0x6aae3c[_0x4f9131(0x1f6)];_0x2deab7[_0x4f9131(0x1f5)]&&console[_0x4f9131(0x1ee)]('Resolved\x20type:\x20'+_0x4a0e19['type']);if(_0x4a0e19[_0x4f9131(0x1cd)]!=='segment')return console[_0x4f9131(0x1ee)](_0x4f9131(0x1db)+_0x4a0e19[_0x4f9131(0x1cd)]+_0x4f9131(0x1ef)),console[_0x4f9131(0x1ee)](_0x4f9131(0x1c6)),0x1;if(!_0x4a0e19[_0x4f9131(0x1ce)])throw new SDKError(ErrorCode['INTERNAL'],_0x4f9131(0x1ca));const _0x137fca=_0x4a0e19['parentId'],_0x13b7ab=_0x4a0e19[_0x4f9131(0x1ce)];_0x2deab7[_0x4f9131(0x1f5)]&&(console[_0x4f9131(0x1ee)](_0x4f9131(0x1d2)+_0x137fca),console[_0x4f9131(0x1ee)](_0x4f9131(0x1cc)+_0x13b7ab));let _0x1bdc7f;if(_0x2deab7[_0x4f9131(0x1e5)]){const _0x27487b=_0x2deab7[_0x4f9131(0x1e5)],_0x2236a3=await withSpinner(_0x4f9131(0x1d5)+_0x27487b+_0x4f9131(0x1e1),()=>_0x17a250[_0x4f9131(0x1e6)][_0x4f9131(0x1dd)](_0x137fca,_0x27487b),{'verbose':_0x2deab7[_0x4f9131(0x1f5)]});_0x1bdc7f=parseInt(_0x2236a3['data'],0xa),_0x2deab7[_0x4f9131(0x1f5)]&&console[_0x4f9131(0x1ee)](_0x4f9131(0x1f2)+_0x1bdc7f);}const _0x57ea0f=await loadJSONFromOptions(_0x2deab7[_0x4f9131(0x1e2)],_0x2deab7[_0x4f9131(0x1eb)]),_0x35aa94={'name':_0x2deab7[_0x4f9131(0x1d3)],'description':_0x2deab7[_0x4f9131(0x1df)],'rule':_0x57ea0f,'kind':_0x2deab7[_0x4f9131(0x1e4)]!==undefined?parseInt(_0x2deab7['kind'],0xa):undefined,'segmentFolderId':_0x1bdc7f},_0x4bb205=await withSpinner(_0x4f9131(0x1d9)+_0x4a0e19['segmentName']+'\x27...',()=>_0x17a250[_0x4f9131(0x1e6)]['updateSegmentById'](_0x137fca,_0x13b7ab,_0x35aa94),{'verbose':_0x2deab7['verbose']}),_0x4a8a3f=_0x4bb205[_0x4f9131(0x1f6)];return console[_0x4f9131(0x1ee)](_0x4f9131(0x1c8)+_0x4a8a3f[_0x4f9131(0x1d3)]+'\x27'),_0x59e817!==_0x550726&&console[_0x4f9131(0x1ee)](_0x4f9131(0x1d0)+_0x59e817),await handleSDKOutput([_0x4a8a3f],_0x2deab7),0x0;}}
@@ -1 +1 @@
1
- const a43_0x53103e=a43_0x36d6;(function(_0x55fe25,_0x1ff374){const _0x19439d=a43_0x36d6,_0x476133=_0x55fe25();while(!![]){try{const _0x50669f=parseInt(_0x19439d(0x212))/0x1+parseInt(_0x19439d(0x20e))/0x2+parseInt(_0x19439d(0x220))/0x3+parseInt(_0x19439d(0x223))/0x4+parseInt(_0x19439d(0x21a))/0x5*(-parseInt(_0x19439d(0x20f))/0x6)+parseInt(_0x19439d(0x22c))/0x7*(-parseInt(_0x19439d(0x1f8))/0x8)+-parseInt(_0x19439d(0x200))/0x9*(-parseInt(_0x19439d(0x202))/0xa);if(_0x50669f===_0x1ff374)break;else _0x476133['push'](_0x476133['shift']());}catch(_0x150d1e){_0x476133['push'](_0x476133['shift']());}}}(a43_0x3b01,0x8ea45));import{existsSync,statSync}from'fs';import a43_0x1ff959 from'chalk';import{BaseCommand}from'./command.js';import{saveSessionContext}from'../core/session.js';function a43_0x36d6(_0x39073f,_0x127b92){_0x39073f=_0x39073f-0x1f3;const _0x3b01b7=a43_0x3b01();let _0x36d6a0=_0x3b01b7[_0x39073f];return _0x36d6a0;}import{withSpinner}from'../utils/spinner.js';import{parsePath,normalizePath}from'../sdk/segment/segment-path-parser.js';function a43_0x3b01(){const _0x54bd09=['\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22','Examples:','type','7XBTXQw','Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context','execute','parent_segment','Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','Resolved\x20relative\x20path\x20to:\x20','fullPath','description','parentName','✔\x20Context\x20set\x20to:\x20','Site:\x20','3500896uQESXn','Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>','Target\x20path:\x20','error','\x27...','site','join','green','45JcFhwW','dim','1605790bgEGCd','cyan','verbose','name','Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.','split','segmentPath','Resolving\x20path\x20\x27','session','length','Use:\x20tdx\x20segment\x20use\x20','segment:use','3128GJlVGw','3147510UgNoKs','segment','Set\x20current\x20segment/folder\x20context\x20for\x20navigation','96658plVyYO','parentId','isAbsolute','data','log','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','\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..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent','5XWKLwK','Error:\x20Path\x20is\x20required\x0a','folderPath','Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.','✔\x20Context\x20cleared.\x20Back\x20to\x20root.','Usage:\x20tdx\x20segment\x20use\x20<path>','144978vtchne','slice','folderId','2388060eyEIXC','Use\x20\x22tdx\x20use\x22\x20to\x20see\x20all\x20context\x20parameters','isDirectory','red','segments'];a43_0x3b01=function(){return _0x54bd09;};return a43_0x3b01();}import{findTdxConfig}from'../sdk/segment/tdx-config.js';export class SegmentUseCommand extends BaseCommand{[a43_0x53103e(0x205)]=a43_0x53103e(0x20d);[a43_0x53103e(0x1f4)]=a43_0x53103e(0x211);async[a43_0x53103e(0x22e)](_0x2f09c1){const _0x50319c=a43_0x53103e,{options:_0x5bf790,args:_0x5d7690,tdx:_0x4bf7c7}=_0x2f09c1;if(_0x5d7690['length']===0x0)return console['error'](a43_0x1ff959[_0x50319c(0x226)](_0x50319c(0x21b))),console[_0x50319c(0x1fb)](_0x50319c(0x21f)),console[_0x50319c(0x1fb)](_0x50319c(0x22a)),console[_0x50319c(0x1fb)](_0x50319c(0x229)),console['error'](_0x50319c(0x228)),console[_0x50319c(0x1fb)](_0x50319c(0x218)),console['error'](_0x50319c(0x219)),0x1;const _0x51113c=_0x5d7690[0x0],_0x11573e=_0x5bf790[_0x50319c(0x20a)];try{if(_0x51113c==='/')return saveSessionContext({'segment_path':undefined},_0x11573e),console[_0x50319c(0x216)](a43_0x1ff959['green']('✔\x20Context\x20cleared.\x20Back\x20to\x20root.')),0x0;if(existsSync(_0x51113c)&&statSync(_0x51113c)[_0x50319c(0x225)]()){let _0x565da0;try{_0x565da0=findTdxConfig(_0x51113c);}catch{return console['error'](a43_0x1ff959[_0x50319c(0x226)](_0x50319c(0x230)+_0x51113c)),console['error'](a43_0x1ff959['cyan'](_0x50319c(0x217))),0x1;}const _0x471371=_0x565da0['config'][_0x50319c(0x22f)];return saveSessionContext({'segment_path':_0x471371,'parent_segment':_0x471371},_0x11573e),console['log'](a43_0x1ff959[_0x50319c(0x1ff)](_0x50319c(0x1f6)+a43_0x1ff959[_0x50319c(0x203)](_0x471371))),0x0;}const _0x1e1628=_0x5bf790[_0x50319c(0x208)];let _0x5c68c6=_0x51113c;const _0x118078=parsePath(_0x51113c);if(!_0x118078[_0x50319c(0x214)]){if(!_0x1e1628)return console[_0x50319c(0x1fb)](a43_0x1ff959[_0x50319c(0x226)]('Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.')),console[_0x50319c(0x1fb)](a43_0x1ff959[_0x50319c(0x203)](_0x50319c(0x1f9))),0x1;if(_0x51113c==='..'){const _0x1fc4fc=_0x1e1628[_0x50319c(0x207)]('/')[_0x50319c(0x221)](0x0,-0x1)[_0x50319c(0x1fe)]('/');_0x5c68c6=_0x1fc4fc||'/';}else _0x51113c==='.'?_0x5c68c6=_0x1e1628:_0x5c68c6=_0x1e1628+'/'+_0x51113c;_0x5bf790['verbose']&&console[_0x50319c(0x1fb)](_0x50319c(0x231)+_0x5c68c6);}if(_0x5c68c6==='/'||_0x5c68c6==='')return saveSessionContext({'segment_path':undefined},_0x11573e),console['log'](a43_0x1ff959[_0x50319c(0x1ff)](_0x50319c(0x21e))),0x0;_0x5c68c6=normalizePath(_0x5c68c6);const _0x572f5e=parsePath(_0x5c68c6)[_0x50319c(0x227)];if(_0x572f5e[_0x50319c(0x20b)]===0x0)return saveSessionContext({'segment_path':undefined},_0x11573e),console['log'](a43_0x1ff959[_0x50319c(0x1ff)](_0x50319c(0x21e))),0x0;_0x5bf790['verbose']&&(console[_0x50319c(0x1fb)](_0x50319c(0x1f7)+_0x5bf790[_0x50319c(0x1fd)]),console['error'](_0x50319c(0x1fa)+_0x5c68c6));const _0x30286d=await withSpinner(_0x50319c(0x209)+_0x5c68c6+_0x50319c(0x1fc),()=>_0x4bf7c7[_0x50319c(0x210)]['resolvePathToResource'](_0x5c68c6),{'verbose':_0x5bf790[_0x50319c(0x204)]}),_0xdc53c7=_0x30286d[_0x50319c(0x215)];_0x5bf790[_0x50319c(0x204)]&&(console['error']('Resolved\x20path\x20type:\x20'+_0xdc53c7['type']),console[_0x50319c(0x1fb)]('Parent\x20ID:\x20'+_0xdc53c7[_0x50319c(0x213)]),_0xdc53c7[_0x50319c(0x222)]&&console['error']('Folder\x20ID:\x20'+_0xdc53c7[_0x50319c(0x222)]));if(_0xdc53c7[_0x50319c(0x22b)]===_0x50319c(0x210))return console[_0x50319c(0x1fb)](a43_0x1ff959[_0x50319c(0x226)](_0x50319c(0x21d))),console[_0x50319c(0x1fb)](_0x50319c(0x206)),console[_0x50319c(0x1fb)](a43_0x1ff959[_0x50319c(0x203)](_0x50319c(0x20c)+_0xdc53c7[_0x50319c(0x1f5)]+(_0xdc53c7[_0x50319c(0x21c)]?'/'+_0xdc53c7['folderPath'][_0x50319c(0x1fe)]('/'):''))),0x1;return saveSessionContext({'segment_path':_0xdc53c7[_0x50319c(0x1f3)],'parent_segment':_0xdc53c7['parentName']},_0x11573e),console[_0x50319c(0x216)](a43_0x1ff959[_0x50319c(0x1ff)](_0x50319c(0x1f6)+a43_0x1ff959['cyan'](_0xdc53c7[_0x50319c(0x1f3)]))),_0x5bf790[_0x50319c(0x204)]&&(console[_0x50319c(0x1fb)](a43_0x1ff959[_0x50319c(0x201)](_0x50319c(0x22d))),console[_0x50319c(0x1fb)](a43_0x1ff959[_0x50319c(0x201)](_0x50319c(0x224)))),0x0;}catch(_0x3e693d){throw _0x3e693d;}}}
1
+ const a43_0x21e73f=a43_0x28b0;(function(_0x3926f5,_0x5d5d3d){const _0x279552=a43_0x28b0,_0x3bbb34=_0x3926f5();while(!![]){try{const _0x5ebd57=parseInt(_0x279552(0x11a))/0x1+parseInt(_0x279552(0x114))/0x2+parseInt(_0x279552(0xe3))/0x3+parseInt(_0x279552(0x104))/0x4*(parseInt(_0x279552(0x11b))/0x5)+parseInt(_0x279552(0x113))/0x6*(parseInt(_0x279552(0x111))/0x7)+-parseInt(_0x279552(0x105))/0x8*(-parseInt(_0x279552(0xf6))/0x9)+-parseInt(_0x279552(0x107))/0xa;if(_0x5ebd57===_0x5d5d3d)break;else _0x3bbb34['push'](_0x3bbb34['shift']());}catch(_0x5b01a1){_0x3bbb34['push'](_0x3bbb34['shift']());}}}(a43_0x3b1d,0xb2e0c));import{existsSync,statSync}from'fs';import a43_0x3d61c9 from'chalk';import{BaseCommand}from'./command.js';function a43_0x28b0(_0x513d29,_0x930101){_0x513d29=_0x513d29-0xe3;const _0x3b1d94=a43_0x3b1d();let _0x28b0e7=_0x3b1d94[_0x513d29];return _0x28b0e7;}import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';import{parsePath,normalizePath}from'../sdk/segment/segment-path-parser.js';function a43_0x3b1d(){const _0x282f40=['703773UKBgLf','join','18XVJwPs','2645576GCMSuU','length','Resolving\x20path\x20\x27','segments','dim','resolvePathToResource','992397zPrrpo','2715310CrtNed','log','2898228sOxWrA','slice','type','split','\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent','folderPath','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22','folderId','parent_segment','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','isDirectory','Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>','parentName','cyan','Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','parentId','data','Use\x20\x22tdx\x20use\x22\x20to\x20see\x20all\x20context\x20parameters','session','9800550PxVBrL','name','fullPath','Error:\x20Path\x20is\x20required\x0a','Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context','Set\x20current\x20segment/folder\x20context\x20for\x20navigation','\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context','Usage:\x20tdx\x20segment\x20use\x20<path>','Resolved\x20relative\x20path\x20to:\x20','red','green','error','Resolved\x20path\x20type:\x20','Examples:','8XKqkDd','8AQKhJx','Site:\x20','50252680iljgMp','segment','Folder\x20ID:\x20','✔\x20Context\x20cleared.\x20Back\x20to\x20root.','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22','✔\x20Context\x20set\x20to:\x20','execute','verbose','site','Target\x20path:\x20'];a43_0x3b1d=function(){return _0x282f40;};return a43_0x3b1d();}import{findTdxConfig}from'../sdk/segment/tdx-config.js';export class SegmentUseCommand extends BaseCommand{[a43_0x21e73f(0xf7)]='segment:use';['description']=a43_0x21e73f(0xfb);async[a43_0x21e73f(0x10d)](_0x1567a5){const _0x2dccc0=a43_0x21e73f,{options:_0x276b63,args:_0x1d3ebd,tdx:_0x4a3e77}=_0x1567a5;if(_0x1d3ebd[_0x2dccc0(0x115)]===0x0)return console['error'](a43_0x3d61c9[_0x2dccc0(0xff)](_0x2dccc0(0xf9))),console[_0x2dccc0(0x101)](_0x2dccc0(0xfd)),console[_0x2dccc0(0x101)](_0x2dccc0(0x103)),console[_0x2dccc0(0x101)](_0x2dccc0(0xe9)),console[_0x2dccc0(0x101)](_0x2dccc0(0x10b)),console[_0x2dccc0(0x101)](_0x2dccc0(0xfc)),console['error'](_0x2dccc0(0xe7)),0x1;const _0x4df313=_0x1d3ebd[0x0],_0x2ff9ec=_0x276b63[_0x2dccc0(0xf5)];try{if(_0x4df313==='/')return saveSessionContext({'segment_path':undefined},_0x2ff9ec),console[_0x2dccc0(0x11c)](a43_0x3d61c9['green'](_0x2dccc0(0x10a))),0x0;if(existsSync(_0x4df313)&&statSync(_0x4df313)[_0x2dccc0(0xed)]()){let _0x1ab9c8;try{_0x1ab9c8=findTdxConfig(_0x4df313);}catch{return console[_0x2dccc0(0x101)](a43_0x3d61c9[_0x2dccc0(0xff)](_0x2dccc0(0xf1)+_0x4df313)),console['error'](a43_0x3d61c9[_0x2dccc0(0xf0)](_0x2dccc0(0xec))),0x1;}const _0x1afc8b=_0x1ab9c8['config'][_0x2dccc0(0xeb)];return saveSessionContext({'segment_path':_0x1afc8b,'parent_segment':_0x1afc8b},_0x2ff9ec),console[_0x2dccc0(0x11c)](a43_0x3d61c9[_0x2dccc0(0x100)]('✔\x20Context\x20set\x20to:\x20'+a43_0x3d61c9[_0x2dccc0(0xf0)](_0x1afc8b))),0x0;}const _0x17d2fa=_0x276b63['segmentPath'];let _0x47e213=_0x4df313;const _0x26d36c=parsePath(_0x4df313);if(!_0x26d36c['isAbsolute']){if(!_0x17d2fa)return console[_0x2dccc0(0x101)](a43_0x3d61c9[_0x2dccc0(0xff)]('Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.')),console[_0x2dccc0(0x101)](a43_0x3d61c9[_0x2dccc0(0xf0)](_0x2dccc0(0xee))),0x1;if(_0x4df313==='..'){const _0xbd16bf=_0x17d2fa[_0x2dccc0(0xe6)]('/')[_0x2dccc0(0xe4)](0x0,-0x1)[_0x2dccc0(0x112)]('/');_0x47e213=_0xbd16bf||'/';}else _0x4df313==='.'?_0x47e213=_0x17d2fa:_0x47e213=_0x17d2fa+'/'+_0x4df313;_0x276b63['verbose']&&console[_0x2dccc0(0x101)](_0x2dccc0(0xfe)+_0x47e213);}if(_0x47e213==='/'||_0x47e213==='')return saveSessionContext({'segment_path':undefined},_0x2ff9ec),console[_0x2dccc0(0x11c)](a43_0x3d61c9[_0x2dccc0(0x100)](_0x2dccc0(0x10a))),0x0;_0x47e213=normalizePath(_0x47e213);const _0x341f00=parsePath(_0x47e213)[_0x2dccc0(0x117)];if(_0x341f00[_0x2dccc0(0x115)]===0x0)return saveSessionContext({'segment_path':undefined},_0x2ff9ec),console[_0x2dccc0(0x11c)](a43_0x3d61c9[_0x2dccc0(0x100)](_0x2dccc0(0x10a))),0x0;_0x276b63[_0x2dccc0(0x10e)]&&(console['error'](_0x2dccc0(0x106)+_0x276b63[_0x2dccc0(0x10f)]),console[_0x2dccc0(0x101)](_0x2dccc0(0x110)+_0x47e213));const _0x21df59=await withSpinner(_0x2dccc0(0x116)+_0x47e213+'\x27...',()=>_0x4a3e77['segment'][_0x2dccc0(0x119)](_0x47e213),{'verbose':_0x276b63[_0x2dccc0(0x10e)]}),_0x236789=_0x21df59[_0x2dccc0(0xf3)];_0x276b63[_0x2dccc0(0x10e)]&&(console[_0x2dccc0(0x101)](_0x2dccc0(0x102)+_0x236789[_0x2dccc0(0xe5)]),console['error']('Parent\x20ID:\x20'+_0x236789[_0x2dccc0(0xf2)]),_0x236789['folderId']&&console[_0x2dccc0(0x101)](_0x2dccc0(0x109)+_0x236789[_0x2dccc0(0xea)]));if(_0x236789[_0x2dccc0(0xe5)]===_0x2dccc0(0x108))return console[_0x2dccc0(0x101)](a43_0x3d61c9[_0x2dccc0(0xff)]('Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.')),console[_0x2dccc0(0x101)]('Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.'),console[_0x2dccc0(0x101)](a43_0x3d61c9[_0x2dccc0(0xf0)]('Use:\x20tdx\x20segment\x20use\x20'+_0x236789[_0x2dccc0(0xef)]+(_0x236789[_0x2dccc0(0xe8)]?'/'+_0x236789[_0x2dccc0(0xe8)]['join']('/'):''))),0x1;return saveSessionContext({'segment_path':_0x236789[_0x2dccc0(0xf8)],'parent_segment':_0x236789[_0x2dccc0(0xef)]},_0x2ff9ec),console[_0x2dccc0(0x11c)](a43_0x3d61c9[_0x2dccc0(0x100)](_0x2dccc0(0x10c)+a43_0x3d61c9['cyan'](_0x236789[_0x2dccc0(0xf8)]))),_0x276b63['verbose']&&(console[_0x2dccc0(0x101)](a43_0x3d61c9['dim'](_0x2dccc0(0xfa))),console['error'](a43_0x3d61c9[_0x2dccc0(0x118)](_0x2dccc0(0xf4)))),0x0;}catch(_0x4a873a){throw _0x4a873a;}}}
@@ -1 +1 @@
1
- const a44_0x5adbae=a44_0x29ca;(function(_0x839bbd,_0x4c445f){const _0x5179c0=a44_0x29ca,_0x5dbe92=_0x839bbd();while(!![]){try{const _0xcb9aea=-parseInt(_0x5179c0(0x95))/0x1*(parseInt(_0x5179c0(0x8d))/0x2)+parseInt(_0x5179c0(0x89))/0x3+parseInt(_0x5179c0(0x72))/0x4*(parseInt(_0x5179c0(0x9c))/0x5)+parseInt(_0x5179c0(0x85))/0x6+parseInt(_0x5179c0(0x90))/0x7+-parseInt(_0x5179c0(0x93))/0x8+-parseInt(_0x5179c0(0x71))/0x9;if(_0xcb9aea===_0x4c445f)break;else _0x5dbe92['push'](_0x5dbe92['shift']());}catch(_0x2948b0){_0x5dbe92['push'](_0x5dbe92['shift']());}}}(a44_0x15b5,0x61518));function a44_0x29ca(_0x4dde57,_0x4f3f62){_0x4dde57=_0x4dde57-0x6a;const _0x15b51f=a44_0x15b5();let _0x29ca05=_0x15b51f[_0x4dde57];return _0x29ca05;}import{BaseCommand}from'./command.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';function a44_0x15b5(){const _0x5d330a=['warningCount','Validation\x20failed:\x20','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','cyan','Validate\x20segment\x20and\x20journey\x20YAML\x20files','10551429cnEPrq','40DtTkzQ','log','warnings','invalidCount','\x20warning(s)\x20found','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','\x20error(s)','endsWith','no_parent','filePath','file','Error:\x20Directory\x20not\x20found:\x20','yellow','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20validate\x20.\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20current\x20directory','verbose','\x20valid','cwd','Error:\x20','\x20file(s)\x20valid','4196964JzUDOf','execute','helpText','validCount','1215291TugUZF','message','error','.yaml','2IwhrfR','name','length','3450118XWceDB','hasErrors','valid','3112856NDQeUx','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','259321DdWSDa','green','.yml','\x20file(s)\x20with\x20errors,\x20','\x20warning(s)','dim','errorCode','310980aXaAkz','type','segment:validate','):\x20','red'];a44_0x15b5=function(){return _0x5d330a;};return a44_0x15b5();}import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';import a44_0xe6f513 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_0x5adbae(0x8e)]=a44_0x5adbae(0x9e);['description']=a44_0x5adbae(0x70);async[a44_0x5adbae(0x86)](_0x4bccb3){const _0x227946=a44_0x5adbae,{options:_0x43356d,args:_0x3c92dc}=_0x4bccb3,_0x44aff3=_0x43356d,_0x4b04cc=await resolveTarget({'arg':_0x3c92dc[0x0],'contextParent':_0x43356d['parentSegment'],'cwd':process[_0x227946(0x82)]()});if(!isSuccessfulResolution(_0x4b04cc))return _0x4b04cc[_0x227946(0x9b)]===_0x227946(0x7a)?(console['error'](a44_0xe6f513[_0x227946(0x7e)](_0x227946(0x77))),console[_0x227946(0x8b)]('Usage:\x20tdx\x20sg\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)'),console[_0x227946(0x8b)](_0x227946(0x7f)),console[_0x227946(0x8b)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file')):(console['error'](a44_0xe6f513[_0x227946(0x6b)](_0x227946(0x83)+_0x4b04cc[_0x227946(0x8a)]+'\x0a')),_0x4b04cc[_0x227946(0x87)]&&console[_0x227946(0x8b)](a44_0xe6f513[_0x227946(0x6f)](_0x4b04cc[_0x227946(0x87)]))),0x1;const _0xccabbe=_0x4b04cc['targetDir'],_0x3d3e5f=_0x4b04cc[_0x227946(0x9d)]===_0x227946(0x7c)?_0x4b04cc[_0x227946(0x7b)]:undefined;if(!_0x3d3e5f&&!existsSync(_0xccabbe))return console['error'](a44_0xe6f513[_0x227946(0x6b)](_0x227946(0x7d)+_0xccabbe+'\x0a')),0x1;let _0x25f279;if(_0x3d3e5f){if(!_0x3d3e5f[_0x227946(0x79)](_0x227946(0x97))&&!_0x3d3e5f[_0x227946(0x79)](_0x227946(0x8c)))return console['error'](a44_0xe6f513[_0x227946(0x6b)](_0x227946(0x94)+_0x3d3e5f+'\x0a')),0x1;_0x25f279=[_0x3d3e5f];}else _0x25f279=findYamlFiles(_0xccabbe);if(_0x25f279[_0x227946(0x8f)]===0x0)return console[_0x227946(0x8b)](a44_0xe6f513['red'](_0x227946(0x6e)+_0xccabbe+'\x0a')),0x1;const _0x5f20b4=validateYamlFiles(_0x25f279,_0xccabbe),_0x300cfc=calculateSummary(_0x5f20b4);for(const _0x4ccfc6 of _0x5f20b4){if(!isValidationResult(_0x4ccfc6))continue;const {relativePath:_0x3440c6,source:_0x170269,result:_0x325181,fileType:_0x2ace35}=_0x4ccfc6,_0x44f434=_0x2ace35;if(_0x325181[_0x227946(0x92)]&&_0x325181['warnings'][_0x227946(0x8f)]===0x0)_0x44aff3[_0x227946(0x80)]&&console['log'](a44_0xe6f513['green']('✔\x20'+_0x3440c6)+a44_0xe6f513[_0x227946(0x9a)]('\x20('+_0x44f434+')'));else _0x325181['valid']?(console['log'](a44_0xe6f513['yellow']('⚠\x20'+_0x3440c6)+a44_0xe6f513[_0x227946(0x9a)]('\x20('+_0x44f434+'):\x20'+_0x325181[_0x227946(0x74)][_0x227946(0x8f)]+_0x227946(0x99))),console[_0x227946(0x73)](formatValidationResult(_0x325181,_0x170269,_0x3440c6))):(console[_0x227946(0x73)](a44_0xe6f513[_0x227946(0x6b)]('✖\x20'+_0x3440c6)+a44_0xe6f513[_0x227946(0x9a)]('\x20('+_0x44f434+_0x227946(0x6a)+_0x325181['errors'][_0x227946(0x8f)]+_0x227946(0x78))),console['log'](formatValidationResult(_0x325181,_0x170269,_0x3440c6)));}return console[_0x227946(0x73)](''),_0x300cfc[_0x227946(0x91)]?(console['log'](a44_0xe6f513[_0x227946(0x6b)](_0x227946(0x6d)+_0x300cfc[_0x227946(0x75)]+_0x227946(0x98)+_0x300cfc[_0x227946(0x88)]+_0x227946(0x81))),_0x300cfc[_0x227946(0x6c)]>0x0&&console[_0x227946(0x73)](a44_0xe6f513['yellow'](_0x300cfc[_0x227946(0x6c)]+_0x227946(0x76))),0x1):(console[_0x227946(0x73)](a44_0xe6f513[_0x227946(0x96)]('✔\x20All\x20'+_0x300cfc['validCount']+_0x227946(0x84))),_0x300cfc[_0x227946(0x6c)]>0x0&&console[_0x227946(0x73)](a44_0xe6f513[_0x227946(0x7e)](_0x300cfc['warningCount']+_0x227946(0x76))),0x0);}}
1
+ const a44_0x2a0751=a44_0x3beb;function a44_0x3beb(_0x27c8b7,_0x3fbd5e){_0x27c8b7=_0x27c8b7-0x9e;const _0x367e22=a44_0x367e();let _0x3beb55=_0x367e22[_0x27c8b7];return _0x3beb55;}(function(_0x4fa8c6,_0x22eb70){const _0x3ffe5f=a44_0x3beb,_0x1d731f=_0x4fa8c6();while(!![]){try{const _0x24228f=parseInt(_0x3ffe5f(0xd2))/0x1*(parseInt(_0x3ffe5f(0xae))/0x2)+-parseInt(_0x3ffe5f(0xd5))/0x3+-parseInt(_0x3ffe5f(0xb9))/0x4*(-parseInt(_0x3ffe5f(0xce))/0x5)+-parseInt(_0x3ffe5f(0xc3))/0x6+-parseInt(_0x3ffe5f(0xa8))/0x7+parseInt(_0x3ffe5f(0xc8))/0x8*(parseInt(_0x3ffe5f(0xaa))/0x9)+parseInt(_0x3ffe5f(0xd3))/0xa*(parseInt(_0x3ffe5f(0xc2))/0xb);if(_0x24228f===_0x22eb70)break;else _0x1d731f['push'](_0x1d731f['shift']());}catch(_0x308a08){_0x1d731f['push'](_0x1d731f['shift']());}}}(a44_0x367e,0xbaac7));import{BaseCommand}from'./command.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';function a44_0x367e(){const _0x7f3fff=['Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','\x20valid','name','yellow','endsWith','cwd','length','1661LrwGwc','6269748ktoREy','file','warningCount','error','type','6421200zACnhV','\x20error(s)','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20validate\x20.\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20current\x20directory','\x20warning(s)','red','✔\x20All\x20','8795nAZkEj','warnings','validCount','segment:validate','72139JToCwm','29010NNWtcE','description','915501oaZZVe','no_parent','parentSegment','helpText','green','errorCode','):\x20','valid','Error:\x20Directory\x20not\x20found:\x20','.yaml','\x20warning(s)\x20found','7403781jjfnfY','verbose','9EHsKVP','hasErrors','log','Usage:\x20tdx\x20sg\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)','34EbFFpP','targetDir','Validate\x20segment\x20and\x20journey\x20YAML\x20files','invalidCount','\x20file(s)\x20with\x20errors,\x20','\x20file(s)\x20valid','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','cyan','execute','dim','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','1604lWnsfa','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file'];a44_0x367e=function(){return _0x7f3fff;};return a44_0x367e();}import a44_0x29d6ba 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_0x2a0751(0xbd)]=a44_0x2a0751(0xd1);[a44_0x2a0751(0xd4)]=a44_0x2a0751(0xb0);async[a44_0x2a0751(0xb6)](_0x34bdbe){const _0x3bb89a=a44_0x2a0751,{options:_0x44f504,args:_0x2f94ec}=_0x34bdbe,_0x5f3d7c=_0x44f504,_0xc29e4b=await resolveTarget({'arg':_0x2f94ec[0x0],'contextParent':_0x44f504[_0x3bb89a(0x9f)],'cwd':process[_0x3bb89a(0xc0)]()});if(!isSuccessfulResolution(_0xc29e4b))return _0xc29e4b[_0x3bb89a(0xa2)]===_0x3bb89a(0x9e)?(console['error'](a44_0x29d6ba[_0x3bb89a(0xbe)](_0x3bb89a(0xb8))),console[_0x3bb89a(0xc6)](_0x3bb89a(0xad)),console[_0x3bb89a(0xc6)](_0x3bb89a(0xca)),console[_0x3bb89a(0xc6)](_0x3bb89a(0xba))):(console[_0x3bb89a(0xc6)](a44_0x29d6ba[_0x3bb89a(0xcc)]('Error:\x20'+_0xc29e4b['message']+'\x0a')),_0xc29e4b[_0x3bb89a(0xa0)]&&console[_0x3bb89a(0xc6)](a44_0x29d6ba[_0x3bb89a(0xb5)](_0xc29e4b[_0x3bb89a(0xa0)]))),0x1;const _0x1be2cf=_0xc29e4b[_0x3bb89a(0xaf)],_0x492f1a=_0xc29e4b[_0x3bb89a(0xc7)]===_0x3bb89a(0xc4)?_0xc29e4b['filePath']:undefined;if(!_0x492f1a&&!existsSync(_0x1be2cf))return console[_0x3bb89a(0xc6)](a44_0x29d6ba[_0x3bb89a(0xcc)](_0x3bb89a(0xa5)+_0x1be2cf+'\x0a')),0x1;let _0x262b40;if(_0x492f1a){if(!_0x492f1a['endsWith']('.yml')&&!_0x492f1a[_0x3bb89a(0xbf)](_0x3bb89a(0xa6)))return console[_0x3bb89a(0xc6)](a44_0x29d6ba[_0x3bb89a(0xcc)](_0x3bb89a(0xbb)+_0x492f1a+'\x0a')),0x1;_0x262b40=[_0x492f1a];}else _0x262b40=findYamlFiles(_0x1be2cf);if(_0x262b40[_0x3bb89a(0xc1)]===0x0)return console[_0x3bb89a(0xc6)](a44_0x29d6ba[_0x3bb89a(0xcc)](_0x3bb89a(0xb4)+_0x1be2cf+'\x0a')),0x1;const _0x607edd=validateYamlFiles(_0x262b40,_0x1be2cf),_0x43ac59=calculateSummary(_0x607edd);for(const _0x49a823 of _0x607edd){if(!isValidationResult(_0x49a823))continue;const {relativePath:_0x31745e,source:_0x54f066,result:_0x5812cc,fileType:_0x5636cb}=_0x49a823,_0x19dad7=_0x5636cb;if(_0x5812cc[_0x3bb89a(0xa4)]&&_0x5812cc[_0x3bb89a(0xcf)][_0x3bb89a(0xc1)]===0x0)_0x5f3d7c[_0x3bb89a(0xa9)]&&console[_0x3bb89a(0xac)](a44_0x29d6ba[_0x3bb89a(0xa1)]('✔\x20'+_0x31745e)+a44_0x29d6ba['dim']('\x20('+_0x19dad7+')'));else _0x5812cc['valid']?(console[_0x3bb89a(0xac)](a44_0x29d6ba[_0x3bb89a(0xbe)]('⚠\x20'+_0x31745e)+a44_0x29d6ba[_0x3bb89a(0xb7)]('\x20('+_0x19dad7+_0x3bb89a(0xa3)+_0x5812cc[_0x3bb89a(0xcf)]['length']+_0x3bb89a(0xcb))),console[_0x3bb89a(0xac)](formatValidationResult(_0x5812cc,_0x54f066,_0x31745e))):(console[_0x3bb89a(0xac)](a44_0x29d6ba[_0x3bb89a(0xcc)]('✖\x20'+_0x31745e)+a44_0x29d6ba[_0x3bb89a(0xb7)]('\x20('+_0x19dad7+'):\x20'+_0x5812cc['errors'][_0x3bb89a(0xc1)]+_0x3bb89a(0xc9))),console[_0x3bb89a(0xac)](formatValidationResult(_0x5812cc,_0x54f066,_0x31745e)));}return console[_0x3bb89a(0xac)](''),_0x43ac59[_0x3bb89a(0xab)]?(console[_0x3bb89a(0xac)](a44_0x29d6ba['red']('Validation\x20failed:\x20'+_0x43ac59[_0x3bb89a(0xb1)]+_0x3bb89a(0xb2)+_0x43ac59[_0x3bb89a(0xd0)]+_0x3bb89a(0xbc))),_0x43ac59[_0x3bb89a(0xc5)]>0x0&&console['log'](a44_0x29d6ba[_0x3bb89a(0xbe)](_0x43ac59['warningCount']+_0x3bb89a(0xa7))),0x1):(console['log'](a44_0x29d6ba[_0x3bb89a(0xa1)](_0x3bb89a(0xcd)+_0x43ac59[_0x3bb89a(0xd0)]+_0x3bb89a(0xb3))),_0x43ac59['warningCount']>0x0&&console[_0x3bb89a(0xac)](a44_0x29d6ba[_0x3bb89a(0xbe)](_0x43ac59[_0x3bb89a(0xc5)]+'\x20warning(s)\x20found')),0x0);}}
@@ -1 +1 @@
1
- const a45_0x4260e1=a45_0x475c;function a45_0x475c(_0x5a94a9,_0x4a756a){_0x5a94a9=_0x5a94a9-0x176;const _0x5df7c5=a45_0x5df7();let _0x475c49=_0x5df7c5[_0x5a94a9];return _0x475c49;}(function(_0x19abf9,_0x4b8625){const _0x4a8948=a45_0x475c,_0x43d3a3=_0x19abf9();while(!![]){try{const _0x51811b=-parseInt(_0x4a8948(0x17f))/0x1+-parseInt(_0x4a8948(0x1a6))/0x2+-parseInt(_0x4a8948(0x18f))/0x3+-parseInt(_0x4a8948(0x1b3))/0x4+parseInt(_0x4a8948(0x183))/0x5*(-parseInt(_0x4a8948(0x1ac))/0x6)+parseInt(_0x4a8948(0x1a1))/0x7*(-parseInt(_0x4a8948(0x199))/0x8)+parseInt(_0x4a8948(0x184))/0x9;if(_0x51811b===_0x4b8625)break;else _0x43d3a3['push'](_0x43d3a3['shift']());}catch(_0x2469d8){_0x43d3a3['push'](_0x43d3a3['shift']());}}}(a45_0x5df7,0xb3f5a));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';function a45_0x5df7(){const _0x522168=['test','\x20segment','log','Use\x20tdx\x20ps\x20list\x20to\x20see\x20available\x20parent\x20segments.','verbose','12sJixVb','resolvePathToResource','(empty)','format','replace','Site:\x20','/j/da','2551356DEoZqZ','\x5c$&','listUnified','folders','Parent\x20segment\x20context:\x20','localeCompare','jsonl','cause','journey','✔\x20Found\x20',']\x20matching\x20\x27','/e/','name','✔\x20Built\x20tree\x20with\x20','\x20folder','Folder\x20ID:\x20','children','includes','map','parentSegment','parentId','data','Parent\x20ID:\x20','Building\x20hierarchy\x20tree...','Resolving\x20path\x20\x27','/app/ps/','88284BtUGMt','length','type','\x20\x20tdx\x20sg\x20use\x20\x22My\x20Audience\x22','1424355RhPYbR','32988267LNchKC',',\x20and\x20','journeys','maxDepth','journeyBundleName','Resolving\x20parent\x20segment\x20\x27','dim','listUnifiedWithJourneys','Error:\x20No\x20parent\x20segment\x20context\x20set.','listWithPattern','Folder/pattern\x20arg:\x20','3128493IgHDhO','error','Listing\x20folders,\x20segments,\x20and\x20journeys...','\x20\x20tdx\x20sg\x20pull\x20\x22My\x20Audience\x22','\x20matching\x20\x27','\x20journey','listRecursive','No\x20items\x20match\x20pattern:\x20','filter','folderId','26120FVdCRV','sort','segment','Error:\x20','folder','Set\x20a\x20parent\x20segment\x20context\x20first:','execute','segments','889rrKOaC','json','(not\x20set)','site','description','349796RyrNXc'];a45_0x5df7=function(){return _0x522168;};return a45_0x5df7();}import{formatFlatList,formatTree}from'../sdk/util/tree-formatter.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import a45_0xf41dc from'chalk';export class SegmentsCommand extends BaseCommand{[a45_0x4260e1(0x1bf)]=a45_0x4260e1(0x1a0);[a45_0x4260e1(0x1a5)]='List\x20folders\x20and\x20child\x20segments';async[a45_0x4260e1(0x19f)](_0x51e3c6){const _0x1c05be=a45_0x4260e1,{options:_0xfc9645,args:_0xd755ad}=_0x51e3c6,_0xf2b28=_0xfc9645['recursive'],_0x53ff25=_0xd755ad[0x0];try{const _0x13b6c2=_0xfc9645[_0x1c05be(0x178)];_0xfc9645[_0x1c05be(0x1ab)]&&(console[_0x1c05be(0x190)](_0x1c05be(0x1b1)+_0xfc9645[_0x1c05be(0x1a4)]),console['error'](_0x1c05be(0x1b7)+(_0x13b6c2||_0x1c05be(0x1a3))),_0x53ff25&&console[_0x1c05be(0x190)](_0x1c05be(0x18e)+_0x53ff25),_0xf2b28&&console[_0x1c05be(0x190)]('Recursive\x20mode:\x20enabled'));if(!_0x13b6c2)return console['error'](_0x1c05be(0x18c)),console['error'](''),console['error'](_0x1c05be(0x19e)),console['error'](_0x1c05be(0x192)),console[_0x1c05be(0x190)](_0x1c05be(0x182)),console['error'](''),console['error'](_0x1c05be(0x1aa)),0x1;const _0x48fdb5=_0x53ff25&&(_0x53ff25[_0x1c05be(0x176)]('*')||_0x53ff25[_0x1c05be(0x176)]('?'));if(_0x48fdb5)return await this[_0x1c05be(0x18d)](_0x51e3c6,_0x13b6c2,_0x53ff25);const _0x1e268e=_0x53ff25?_0x13b6c2+'/'+_0x53ff25:_0x13b6c2;return _0xf2b28?await this[_0x1c05be(0x195)](_0x51e3c6,_0x1e268e):await this[_0x1c05be(0x1b5)](_0x51e3c6,_0x1e268e);}catch(_0x559cc5){if(_0x559cc5 instanceof SDKError)return console[_0x1c05be(0x190)](_0x1c05be(0x19c)+_0x559cc5['message']),_0x559cc5[_0x1c05be(0x1ba)]&&console['error']('\x20\x20Cause:\x20'+_0x559cc5['cause']),0x1;throw _0x559cc5;}}async[a45_0x4260e1(0x18d)](_0x479723,_0x5a61fc,_0x39f317){const _0x57cab3=a45_0x4260e1,{options:_0x534d7a,tdx:_0x3eade2}=_0x479723,_0x19d73e=await withSpinner(_0x57cab3(0x189)+_0x5a61fc+'\x27...',()=>_0x3eade2['segment'][_0x57cab3(0x1ad)](_0x5a61fc),{'verbose':_0x534d7a[_0x57cab3(0x1ab)]}),_0x541872=_0x19d73e[_0x57cab3(0x17a)],_0x930372=await withSpinner(_0x57cab3(0x191),()=>_0x3eade2['segment']['listUnifiedWithJourneys'](_0x541872[_0x57cab3(0x179)],_0x541872[_0x57cab3(0x198)]),{'verbose':_0x534d7a[_0x57cab3(0x1ab)]}),{folders:_0x41fb53,segments:_0x2ea04e,journeys:_0x1f3bb6}=_0x930372['data'],_0x19df27=_0x39f317[_0x57cab3(0x1b0)](/[.+^${}()|[\]\\]/g,_0x57cab3(0x1b4))[_0x57cab3(0x1b0)](/\*/g,'.*')['replace'](/\?/g,'.'),_0x504bee=new RegExp('^'+_0x19df27+'$','i'),_0x1ae581=_0x41fb53[_0x57cab3(0x197)](_0x2a5314=>_0x504bee['test'](_0x2a5314[_0x57cab3(0x1bf)])),_0x46116b=_0x2ea04e[_0x57cab3(0x197)](_0x13bc91=>_0x504bee[_0x57cab3(0x1a7)](_0x13bc91[_0x57cab3(0x1bf)])),_0xe2a6ce=_0x1f3bb6[_0x57cab3(0x197)](_0x36b2f4=>_0x504bee[_0x57cab3(0x1a7)](_0x36b2f4['journeyBundleName'])),_0x566236=_0x1ae581[_0x57cab3(0x180)]+_0x46116b['length']+_0xe2a6ce['length'];console[_0x57cab3(0x190)](_0x57cab3(0x1bc)+_0x1ae581['length']+_0x57cab3(0x1c1)+(_0x1ae581[_0x57cab3(0x180)]!==0x1?'s':'')+',\x20'+_0x46116b[_0x57cab3(0x180)]+_0x57cab3(0x1a8)+(_0x46116b[_0x57cab3(0x180)]!==0x1?'s':'')+_0x57cab3(0x185)+_0xe2a6ce[_0x57cab3(0x180)]+'\x20journey'+(_0xe2a6ce[_0x57cab3(0x180)]!==0x1?'s':'')+_0x57cab3(0x193)+_0x39f317+'\x27');const _0x2de856=_0x576c3e=>{const _0x28753b=_0x57cab3;return getConsoleNextUrl(_0x534d7a[_0x28753b(0x1a4)],'/app/ps/'+_0x541872['parentId']+_0x28753b(0x1be)+_0x576c3e);},_0x2d983d=_0x534d7a['format']===_0x57cab3(0x1a2)||_0x534d7a[_0x57cab3(0x1af)]===_0x57cab3(0x1b9);if(_0x2d983d){const _0x128687=[..._0x1ae581['map'](_0x3c64b3=>({..._0x3c64b3,'type':_0x57cab3(0x19d)})),..._0x46116b[_0x57cab3(0x177)](_0x39d8b3=>({..._0x39d8b3,'type':_0x57cab3(0x19b),'url':_0x2de856(_0x39d8b3['id'])})),..._0xe2a6ce[_0x57cab3(0x177)](_0x50d672=>({..._0x50d672,'name':_0x50d672[_0x57cab3(0x188)],'type':_0x57cab3(0x1bb)}))]['sort']((_0x4998ed,_0x2a14b7)=>_0x4998ed['name']['localeCompare'](_0x2a14b7[_0x57cab3(0x1bf)]));await handleSDKOutput(_0x128687,_0x534d7a);}else{if(_0x566236===0x0)console[_0x57cab3(0x1a9)](_0x57cab3(0x196)+_0x39f317);else{console[_0x57cab3(0x1a9)](a45_0xf41dc[_0x57cab3(0x18a)]('['+_0x5a61fc+_0x57cab3(0x1bd)+_0x39f317+'\x27'));const _0x4b7193=formatFlatList(_0x1ae581,_0x46116b,{'showMetadata':!![],'getSegmentUrl':_0x2de856},_0xe2a6ce);console[_0x57cab3(0x1a9)](_0x4b7193);}}return 0x0;}async[a45_0x4260e1(0x1b5)](_0x5f8c7d,_0x120a6c){const _0x105330=a45_0x4260e1,{options:_0x2457c1,tdx:_0x5a7e3d}=_0x5f8c7d,_0x50d4b3=await withSpinner(_0x105330(0x17d)+_0x120a6c+'\x27...',()=>_0x5a7e3d[_0x105330(0x19b)][_0x105330(0x1ad)](_0x120a6c),{'verbose':_0x2457c1[_0x105330(0x1ab)]}),_0x54fc03=_0x50d4b3['data'];_0x2457c1[_0x105330(0x1ab)]&&(console[_0x105330(0x190)]('Parent\x20ID:\x20'+_0x54fc03[_0x105330(0x179)]),_0x54fc03['folderId']&&console[_0x105330(0x190)](_0x105330(0x1c2)+_0x54fc03[_0x105330(0x198)]));const _0x6792e8=await withSpinner(_0x105330(0x191),()=>_0x5a7e3d[_0x105330(0x19b)][_0x105330(0x18b)](_0x54fc03[_0x105330(0x179)],_0x54fc03['folderId']),{'verbose':_0x2457c1[_0x105330(0x1ab)]}),{folders:_0x430da9,segments:_0x213b9c,journeys:_0x2744e5}=_0x6792e8[_0x105330(0x17a)],_0x21cd4f=_0x430da9[_0x105330(0x180)]+_0x213b9c[_0x105330(0x180)]+_0x2744e5['length'];console[_0x105330(0x190)]('✔\x20Found\x20'+_0x430da9[_0x105330(0x180)]+_0x105330(0x1c1)+(_0x430da9['length']!==0x1?'s':'')+',\x20'+_0x213b9c[_0x105330(0x180)]+_0x105330(0x1a8)+(_0x213b9c[_0x105330(0x180)]!==0x1?'s':'')+',\x20and\x20'+_0x2744e5[_0x105330(0x180)]+_0x105330(0x194)+(_0x2744e5[_0x105330(0x180)]!==0x1?'s':''));const _0x4660a4=_0x227f04=>{const _0x18426e=_0x105330;return getConsoleNextUrl(_0x2457c1[_0x18426e(0x1a4)],_0x18426e(0x17e)+_0x54fc03[_0x18426e(0x179)]+_0x18426e(0x1be)+_0x227f04);},_0x468564=_0x414541=>{const _0x8fd2ce=_0x105330;return getConsoleNextUrl(_0x2457c1['site'],_0x8fd2ce(0x17e)+_0x54fc03[_0x8fd2ce(0x179)]+_0x8fd2ce(0x1be)+_0x414541+_0x8fd2ce(0x1b2));},_0x169ec0=_0x2457c1[_0x105330(0x1af)]==='json'||_0x2457c1[_0x105330(0x1af)]==='jsonl';if(_0x169ec0){const _0x19a784=[..._0x430da9['map'](_0x337af9=>({..._0x337af9,'type':_0x105330(0x19d)})),..._0x213b9c[_0x105330(0x177)](_0x54f164=>({..._0x54f164,'type':_0x105330(0x19b),'url':_0x4660a4(_0x54f164['id'])})),..._0x2744e5[_0x105330(0x177)](_0x4b3931=>({..._0x4b3931,'name':_0x4b3931[_0x105330(0x188)],'type':_0x105330(0x1bb),'url':_0x468564(_0x4b3931['id'])}))][_0x105330(0x19a)]((_0x5c243c,_0x367ca8)=>_0x5c243c[_0x105330(0x1bf)][_0x105330(0x1b8)](_0x367ca8[_0x105330(0x1bf)]));await handleSDKOutput(_0x19a784,_0x2457c1);}else{if(_0x21cd4f===0x0)console['log'](a45_0xf41dc[_0x105330(0x18a)]('['+_0x120a6c+']')),console[_0x105330(0x1a9)](_0x105330(0x1ae));else{console[_0x105330(0x1a9)](a45_0xf41dc['dim']('['+_0x120a6c+']'));const _0x50cfb1=formatFlatList(_0x430da9,_0x213b9c,{'showMetadata':!![],'getSegmentUrl':_0x4660a4,'getJourneyUrl':_0x468564},_0x2744e5);console['log'](_0x50cfb1);}}return 0x0;}async['listRecursive'](_0x4b75bf,_0xe8304){const _0x3df135=a45_0x4260e1,{options:_0x379e49,tdx:_0x2ffc5f}=_0x4b75bf,_0x489542=await withSpinner('Resolving\x20path\x20\x27'+_0xe8304+'\x27...',()=>_0x2ffc5f['segment'][_0x3df135(0x1ad)](_0xe8304),{'verbose':_0x379e49[_0x3df135(0x1ab)]}),_0x326e5f=_0x489542[_0x3df135(0x17a)];_0x379e49[_0x3df135(0x1ab)]&&(console[_0x3df135(0x190)](_0x3df135(0x17b)+_0x326e5f[_0x3df135(0x179)]),_0x326e5f[_0x3df135(0x198)]&&console[_0x3df135(0x190)](_0x3df135(0x1c2)+_0x326e5f[_0x3df135(0x198)]));const _0x4ca61a=_0x379e49[_0x3df135(0x187)]||0xa,_0x27fe8e=await withSpinner(_0x3df135(0x17c),()=>_0x2ffc5f[_0x3df135(0x19b)][_0x3df135(0x195)](_0x326e5f[_0x3df135(0x179)],_0x326e5f[_0x3df135(0x198)],0x0,_0x4ca61a),{'verbose':_0x379e49['verbose']}),_0x1374ee=_0x27fe8e[_0x3df135(0x17a)],_0x538281=_0x44a4d6=>{const _0x44441f=_0x3df135;let _0x27bd12=0x0,_0x38af74=0x0,_0xae25b1=0x0;for(const _0x1067d8 of _0x44a4d6){if(_0x1067d8[_0x44441f(0x181)]==='folder')_0x27bd12++;else{if(_0x1067d8[_0x44441f(0x181)]===_0x44441f(0x19b))_0x38af74++;else{if(_0x1067d8[_0x44441f(0x181)]===_0x44441f(0x1bb))_0xae25b1++;}}if(_0x1067d8[_0x44441f(0x1c3)]){const _0x17816b=_0x538281(_0x1067d8['children']);_0x27bd12+=_0x17816b[_0x44441f(0x1b6)],_0x38af74+=_0x17816b[_0x44441f(0x1a0)],_0xae25b1+=_0x17816b[_0x44441f(0x186)];}}return{'folders':_0x27bd12,'segments':_0x38af74,'journeys':_0xae25b1};},_0x3c1591=_0x538281(_0x1374ee);console[_0x3df135(0x190)](_0x3df135(0x1c0)+_0x3c1591[_0x3df135(0x1b6)]+_0x3df135(0x1c1)+(_0x3c1591['folders']!==0x1?'s':'')+',\x20'+_0x3c1591[_0x3df135(0x1a0)]+'\x20segment'+(_0x3c1591['segments']!==0x1?'s':'')+_0x3df135(0x185)+_0x3c1591['journeys']+_0x3df135(0x194)+(_0x3c1591[_0x3df135(0x186)]!==0x1?'s':''));const _0x33ecbd=_0x45f0f1=>{const _0x245fb9=_0x3df135;return getConsoleNextUrl(_0x379e49[_0x245fb9(0x1a4)],_0x245fb9(0x17e)+_0x326e5f['parentId']+_0x245fb9(0x1be)+_0x45f0f1);},_0x219a61=_0x40f863=>{const _0x369ccf=_0x3df135;return getConsoleNextUrl(_0x379e49[_0x369ccf(0x1a4)],'/app/ps/'+_0x326e5f[_0x369ccf(0x179)]+_0x369ccf(0x1be)+_0x40f863+_0x369ccf(0x1b2));};if(_0x379e49[_0x3df135(0x1af)]===_0x3df135(0x1a2)||_0x379e49[_0x3df135(0x1af)]===_0x3df135(0x1b9))await handleSDKOutput(_0x1374ee,_0x379e49);else{console['log'](a45_0xf41dc[_0x3df135(0x18a)]('['+_0xe8304+']'));const _0x44c084=formatTree(_0x1374ee,{'showMetadata':!![],'getSegmentUrl':_0x33ecbd,'getJourneyUrl':_0x219a61});console[_0x3df135(0x1a9)](_0x44c084);}return 0x0;}}
1
+ const a45_0x1ba5ee=a45_0x4224;(function(_0x22a23a,_0x273d34){const _0x3fe538=a45_0x4224,_0x2a99b2=_0x22a23a();while(!![]){try{const _0x1ff945=parseInt(_0x3fe538(0x118))/0x1*(parseInt(_0x3fe538(0x111))/0x2)+-parseInt(_0x3fe538(0x105))/0x3+-parseInt(_0x3fe538(0x12b))/0x4+parseInt(_0x3fe538(0x10a))/0x5+-parseInt(_0x3fe538(0x10d))/0x6+parseInt(_0x3fe538(0x10f))/0x7*(-parseInt(_0x3fe538(0x109))/0x8)+parseInt(_0x3fe538(0x110))/0x9*(parseInt(_0x3fe538(0x129))/0xa);if(_0x1ff945===_0x273d34)break;else _0x2a99b2['push'](_0x2a99b2['shift']());}catch(_0x3fc06a){_0x2a99b2['push'](_0x2a99b2['shift']());}}}(a45_0x2344,0x9fcce));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';function a45_0x4224(_0x93a702,_0x1c7a57){_0x93a702=_0x93a702-0x103;const _0x234446=a45_0x2344();let _0x4224d0=_0x234446[_0x93a702];return _0x4224d0;}import{formatFlatList,formatTree}from'../sdk/util/tree-formatter.js';function a45_0x2344(){const _0x4219aa=['listUnifiedWithJourneys','name','parentId','Listing\x20folders,\x20segments,\x20and\x20journeys...','/app/ps/','format','/j/da','recursive','maxDepth','journeys','\x20folder','journey','Resolving\x20parent\x20segment\x20\x27','json','Set\x20a\x20parent\x20segment\x20context\x20first:','8748310oEFVoE','data','3066472UdElon','folderId','segments',',\x20and\x20','folders','No\x20items\x20match\x20pattern:\x20','folder','List\x20folders\x20and\x20child\x20segments','Error:\x20','listRecursive','description','message','map','jsonl','includes','parentSegment','\x20journey','✔\x20Built\x20tree\x20with\x20','dim','\x20segment','resolvePathToResource','(empty)','\x27...','\x20\x20Cause:\x20','listWithPattern',']\x20matching\x20\x27','Resolving\x20path\x20\x27','Parent\x20segment\x20context:\x20','segment','\x20\x20tdx\x20sg\x20pull\x20\x22My\x20Audience\x22','✔\x20Found\x20','Parent\x20ID:\x20','log','verbose','cause','length','821619cQHXzc','site','replace','journeyBundleName','632wpzunK','4805230rxIsUr','Use\x20tdx\x20ps\x20list\x20to\x20see\x20available\x20parent\x20segments.','listUnified','1532010RiTbnf','test','96614ozHkhq','18oZUIhk','12AmACrD','Folder\x20ID:\x20','error','/e/','type','filter','children','55003XklAPd','sort'];a45_0x2344=function(){return _0x4219aa;};return a45_0x2344();}import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import a45_0x3ffe80 from'chalk';export class SegmentsCommand extends BaseCommand{[a45_0x1ba5ee(0x11b)]=a45_0x1ba5ee(0x12d);[a45_0x1ba5ee(0x135)]=a45_0x1ba5ee(0x132);async['execute'](_0x1ef75c){const _0x34c85e=a45_0x1ba5ee,{options:_0x364b58,args:_0xacc024}=_0x1ef75c,_0x10689d=_0x364b58[_0x34c85e(0x121)],_0x30cda1=_0xacc024[0x0];try{const _0x20de14=_0x364b58[_0x34c85e(0x13a)];_0x364b58['verbose']&&(console[_0x34c85e(0x113)]('Site:\x20'+_0x364b58[_0x34c85e(0x106)]),console[_0x34c85e(0x113)](_0x34c85e(0x146)+(_0x20de14||'(not\x20set)')),_0x30cda1&&console[_0x34c85e(0x113)]('Folder/pattern\x20arg:\x20'+_0x30cda1),_0x10689d&&console[_0x34c85e(0x113)]('Recursive\x20mode:\x20enabled'));if(!_0x20de14)return console[_0x34c85e(0x113)]('Error:\x20No\x20parent\x20segment\x20context\x20set.'),console[_0x34c85e(0x113)](''),console[_0x34c85e(0x113)](_0x34c85e(0x128)),console[_0x34c85e(0x113)](_0x34c85e(0x148)),console[_0x34c85e(0x113)]('\x20\x20tdx\x20sg\x20use\x20\x22My\x20Audience\x22'),console[_0x34c85e(0x113)](''),console['error'](_0x34c85e(0x10b)),0x1;const _0x107ca5=_0x30cda1&&(_0x30cda1[_0x34c85e(0x139)]('*')||_0x30cda1[_0x34c85e(0x139)]('?'));if(_0x107ca5)return await this[_0x34c85e(0x143)](_0x1ef75c,_0x20de14,_0x30cda1);const _0x4870aa=_0x30cda1?_0x20de14+'/'+_0x30cda1:_0x20de14;return _0x10689d?await this[_0x34c85e(0x134)](_0x1ef75c,_0x4870aa):await this[_0x34c85e(0x10c)](_0x1ef75c,_0x4870aa);}catch(_0x3d9ca6){if(_0x3d9ca6 instanceof SDKError)return console[_0x34c85e(0x113)](_0x34c85e(0x133)+_0x3d9ca6[_0x34c85e(0x136)]),_0x3d9ca6[_0x34c85e(0x103)]&&console['error'](_0x34c85e(0x142)+_0x3d9ca6[_0x34c85e(0x103)]),0x1;throw _0x3d9ca6;}}async[a45_0x1ba5ee(0x143)](_0xaac24,_0x461361,_0xa90f3d){const _0x495fe8=a45_0x1ba5ee,{options:_0x27e9bd,tdx:_0x4ae0b2}=_0xaac24,_0x1ba0a1=await withSpinner(_0x495fe8(0x126)+_0x461361+_0x495fe8(0x141),()=>_0x4ae0b2['segment']['resolvePathToResource'](_0x461361),{'verbose':_0x27e9bd[_0x495fe8(0x14c)]}),_0x576f5d=_0x1ba0a1['data'],_0x54e475=await withSpinner(_0x495fe8(0x11d),()=>_0x4ae0b2[_0x495fe8(0x147)][_0x495fe8(0x11a)](_0x576f5d[_0x495fe8(0x11c)],_0x576f5d[_0x495fe8(0x12c)]),{'verbose':_0x27e9bd[_0x495fe8(0x14c)]}),{folders:_0x24e852,segments:_0x51116d,journeys:_0xdaca63}=_0x54e475[_0x495fe8(0x12a)],_0x5191ce=_0xa90f3d[_0x495fe8(0x107)](/[.+^${}()|[\]\\]/g,'\x5c$&')[_0x495fe8(0x107)](/\*/g,'.*')['replace'](/\?/g,'.'),_0x377476=new RegExp('^'+_0x5191ce+'$','i'),_0x4f7737=_0x24e852[_0x495fe8(0x116)](_0x37dead=>_0x377476['test'](_0x37dead['name'])),_0x316ec6=_0x51116d[_0x495fe8(0x116)](_0x1d7892=>_0x377476[_0x495fe8(0x10e)](_0x1d7892['name'])),_0x4d34c5=_0xdaca63[_0x495fe8(0x116)](_0x2a28f7=>_0x377476[_0x495fe8(0x10e)](_0x2a28f7[_0x495fe8(0x108)])),_0x2f44e=_0x4f7737['length']+_0x316ec6['length']+_0x4d34c5[_0x495fe8(0x104)];console[_0x495fe8(0x113)](_0x495fe8(0x149)+_0x4f7737[_0x495fe8(0x104)]+_0x495fe8(0x124)+(_0x4f7737[_0x495fe8(0x104)]!==0x1?'s':'')+',\x20'+_0x316ec6[_0x495fe8(0x104)]+_0x495fe8(0x13e)+(_0x316ec6[_0x495fe8(0x104)]!==0x1?'s':'')+_0x495fe8(0x12e)+_0x4d34c5[_0x495fe8(0x104)]+_0x495fe8(0x13b)+(_0x4d34c5['length']!==0x1?'s':'')+'\x20matching\x20\x27'+_0xa90f3d+'\x27');const _0x22c7b6=_0x3c0f9b=>{const _0x3df283=_0x495fe8;return getConsoleNextUrl(_0x27e9bd[_0x3df283(0x106)],_0x3df283(0x11e)+_0x576f5d[_0x3df283(0x11c)]+_0x3df283(0x114)+_0x3c0f9b);},_0x1e6697=_0x27e9bd[_0x495fe8(0x11f)]===_0x495fe8(0x127)||_0x27e9bd[_0x495fe8(0x11f)]===_0x495fe8(0x138);if(_0x1e6697){const _0x58dde5=[..._0x4f7737[_0x495fe8(0x137)](_0x3f7155=>({..._0x3f7155,'type':_0x495fe8(0x131)})),..._0x316ec6[_0x495fe8(0x137)](_0x256c99=>({..._0x256c99,'type':_0x495fe8(0x147),'url':_0x22c7b6(_0x256c99['id'])})),..._0x4d34c5[_0x495fe8(0x137)](_0x1d6eff=>({..._0x1d6eff,'name':_0x1d6eff['journeyBundleName'],'type':'journey'}))][_0x495fe8(0x119)]((_0x2d82b0,_0x15db03)=>_0x2d82b0['name']['localeCompare'](_0x15db03[_0x495fe8(0x11b)]));await handleSDKOutput(_0x58dde5,_0x27e9bd);}else{if(_0x2f44e===0x0)console['log'](_0x495fe8(0x130)+_0xa90f3d);else{console[_0x495fe8(0x14b)](a45_0x3ffe80[_0x495fe8(0x13d)]('['+_0x461361+_0x495fe8(0x144)+_0xa90f3d+'\x27'));const _0x237b45=formatFlatList(_0x4f7737,_0x316ec6,{'showMetadata':!![],'getSegmentUrl':_0x22c7b6},_0x4d34c5);console[_0x495fe8(0x14b)](_0x237b45);}}return 0x0;}async[a45_0x1ba5ee(0x10c)](_0x496667,_0x322a44){const _0x30c629=a45_0x1ba5ee,{options:_0x193459,tdx:_0x37c264}=_0x496667,_0x64cc7=await withSpinner(_0x30c629(0x145)+_0x322a44+_0x30c629(0x141),()=>_0x37c264[_0x30c629(0x147)][_0x30c629(0x13f)](_0x322a44),{'verbose':_0x193459[_0x30c629(0x14c)]}),_0x3a1223=_0x64cc7[_0x30c629(0x12a)];_0x193459['verbose']&&(console['error']('Parent\x20ID:\x20'+_0x3a1223[_0x30c629(0x11c)]),_0x3a1223[_0x30c629(0x12c)]&&console[_0x30c629(0x113)](_0x30c629(0x112)+_0x3a1223['folderId']));const _0xedfb14=await withSpinner(_0x30c629(0x11d),()=>_0x37c264[_0x30c629(0x147)][_0x30c629(0x11a)](_0x3a1223[_0x30c629(0x11c)],_0x3a1223[_0x30c629(0x12c)]),{'verbose':_0x193459[_0x30c629(0x14c)]}),{folders:_0x419165,segments:_0x261f99,journeys:_0xc86898}=_0xedfb14[_0x30c629(0x12a)],_0x141457=_0x419165[_0x30c629(0x104)]+_0x261f99[_0x30c629(0x104)]+_0xc86898['length'];console[_0x30c629(0x113)]('✔\x20Found\x20'+_0x419165[_0x30c629(0x104)]+_0x30c629(0x124)+(_0x419165['length']!==0x1?'s':'')+',\x20'+_0x261f99[_0x30c629(0x104)]+_0x30c629(0x13e)+(_0x261f99['length']!==0x1?'s':'')+',\x20and\x20'+_0xc86898[_0x30c629(0x104)]+_0x30c629(0x13b)+(_0xc86898[_0x30c629(0x104)]!==0x1?'s':''));const _0xedaabc=_0x8a2b59=>{const _0x5a46d4=_0x30c629;return getConsoleNextUrl(_0x193459[_0x5a46d4(0x106)],_0x5a46d4(0x11e)+_0x3a1223[_0x5a46d4(0x11c)]+_0x5a46d4(0x114)+_0x8a2b59);},_0x10be80=_0x2ad1e3=>{const _0x3c6bff=_0x30c629;return getConsoleNextUrl(_0x193459[_0x3c6bff(0x106)],_0x3c6bff(0x11e)+_0x3a1223[_0x3c6bff(0x11c)]+_0x3c6bff(0x114)+_0x2ad1e3+_0x3c6bff(0x120));},_0x5621bd=_0x193459[_0x30c629(0x11f)]===_0x30c629(0x127)||_0x193459[_0x30c629(0x11f)]===_0x30c629(0x138);if(_0x5621bd){const _0x18dc08=[..._0x419165[_0x30c629(0x137)](_0x424e2c=>({..._0x424e2c,'type':'folder'})),..._0x261f99[_0x30c629(0x137)](_0x51fb92=>({..._0x51fb92,'type':'segment','url':_0xedaabc(_0x51fb92['id'])})),..._0xc86898['map'](_0x4cc16c=>({..._0x4cc16c,'name':_0x4cc16c[_0x30c629(0x108)],'type':'journey','url':_0x10be80(_0x4cc16c['id'])}))][_0x30c629(0x119)]((_0x59e82d,_0x435dd8)=>_0x59e82d[_0x30c629(0x11b)]['localeCompare'](_0x435dd8['name']));await handleSDKOutput(_0x18dc08,_0x193459);}else{if(_0x141457===0x0)console[_0x30c629(0x14b)](a45_0x3ffe80[_0x30c629(0x13d)]('['+_0x322a44+']')),console['log'](_0x30c629(0x140));else{console[_0x30c629(0x14b)](a45_0x3ffe80[_0x30c629(0x13d)]('['+_0x322a44+']'));const _0x3e5a8b=formatFlatList(_0x419165,_0x261f99,{'showMetadata':!![],'getSegmentUrl':_0xedaabc,'getJourneyUrl':_0x10be80},_0xc86898);console[_0x30c629(0x14b)](_0x3e5a8b);}}return 0x0;}async[a45_0x1ba5ee(0x134)](_0x4e8a55,_0x38d536){const _0x38765c=a45_0x1ba5ee,{options:_0x25492b,tdx:_0xb7f589}=_0x4e8a55,_0x34565f=await withSpinner(_0x38765c(0x145)+_0x38d536+_0x38765c(0x141),()=>_0xb7f589[_0x38765c(0x147)][_0x38765c(0x13f)](_0x38d536),{'verbose':_0x25492b[_0x38765c(0x14c)]}),_0x3885dd=_0x34565f[_0x38765c(0x12a)];_0x25492b[_0x38765c(0x14c)]&&(console[_0x38765c(0x113)](_0x38765c(0x14a)+_0x3885dd['parentId']),_0x3885dd[_0x38765c(0x12c)]&&console[_0x38765c(0x113)](_0x38765c(0x112)+_0x3885dd['folderId']));const _0x31ed06=_0x25492b[_0x38765c(0x122)]||0xa,_0x2accd0=await withSpinner('Building\x20hierarchy\x20tree...',()=>_0xb7f589[_0x38765c(0x147)]['listRecursive'](_0x3885dd[_0x38765c(0x11c)],_0x3885dd[_0x38765c(0x12c)],0x0,_0x31ed06),{'verbose':_0x25492b['verbose']}),_0x508fe1=_0x2accd0[_0x38765c(0x12a)],_0x1a110e=_0x335084=>{const _0x1937bf=_0x38765c;let _0x4ed60b=0x0,_0x10fcd8=0x0,_0xa866d3=0x0;for(const _0x4a4097 of _0x335084){if(_0x4a4097['type']==='folder')_0x4ed60b++;else{if(_0x4a4097['type']===_0x1937bf(0x147))_0x10fcd8++;else{if(_0x4a4097[_0x1937bf(0x115)]===_0x1937bf(0x125))_0xa866d3++;}}if(_0x4a4097[_0x1937bf(0x117)]){const _0x14ae79=_0x1a110e(_0x4a4097[_0x1937bf(0x117)]);_0x4ed60b+=_0x14ae79[_0x1937bf(0x12f)],_0x10fcd8+=_0x14ae79[_0x1937bf(0x12d)],_0xa866d3+=_0x14ae79[_0x1937bf(0x123)];}}return{'folders':_0x4ed60b,'segments':_0x10fcd8,'journeys':_0xa866d3};},_0x3d0fa5=_0x1a110e(_0x508fe1);console[_0x38765c(0x113)](_0x38765c(0x13c)+_0x3d0fa5['folders']+_0x38765c(0x124)+(_0x3d0fa5[_0x38765c(0x12f)]!==0x1?'s':'')+',\x20'+_0x3d0fa5[_0x38765c(0x12d)]+_0x38765c(0x13e)+(_0x3d0fa5[_0x38765c(0x12d)]!==0x1?'s':'')+_0x38765c(0x12e)+_0x3d0fa5[_0x38765c(0x123)]+_0x38765c(0x13b)+(_0x3d0fa5[_0x38765c(0x123)]!==0x1?'s':''));const _0x10d9c2=_0x2c657b=>{const _0x37c339=_0x38765c;return getConsoleNextUrl(_0x25492b['site'],_0x37c339(0x11e)+_0x3885dd[_0x37c339(0x11c)]+_0x37c339(0x114)+_0x2c657b);},_0x202597=_0x31464a=>{const _0x13a2bc=_0x38765c;return getConsoleNextUrl(_0x25492b[_0x13a2bc(0x106)],_0x13a2bc(0x11e)+_0x3885dd[_0x13a2bc(0x11c)]+_0x13a2bc(0x114)+_0x31464a+_0x13a2bc(0x120));};if(_0x25492b[_0x38765c(0x11f)]==='json'||_0x25492b[_0x38765c(0x11f)]===_0x38765c(0x138))await handleSDKOutput(_0x508fe1,_0x25492b);else{console[_0x38765c(0x14b)](a45_0x3ffe80[_0x38765c(0x13d)]('['+_0x38d536+']'));const _0x2d5a7e=formatTree(_0x508fe1,{'showMetadata':!![],'getSegmentUrl':_0x10d9c2,'getJourneyUrl':_0x202597});console[_0x38765c(0x14b)](_0x2d5a7e);}return 0x0;}}
@@ -1 +1 @@
1
- const a46_0x22bc79=a46_0x51a1;function a46_0x4cc7(){const _0x3173ad=['4378864RSdYPu','Limit:\x20','463931ZqsHex','validate','verbose','description','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','\x20\x20Cause:\x20','112FcrVSb','Catalog:\x20','Querying\x20','table','showTable','error','Site:\x20','cause','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','1215mxDGCg','query','3126966dZGjRB','4084MBpubF','catalog','2002672hunfsm','data','limit','...','192699LQhCDp','length','\x20row','✔\x20Retrieved\x20','Show\x20table\x20contents','args','2373855fYrrMn','Table:\x20','site','show','database','message','Usage:\x20tdx\x20show\x20<database.table>','Database:\x20','\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>'];a46_0x4cc7=function(){return _0x3173ad;};return a46_0x4cc7();}(function(_0x1bcf06,_0xa6f4d8){const _0x3add99=a46_0x51a1,_0x5ec34a=_0x1bcf06();while(!![]){try{const _0x27751b=parseInt(_0x3add99(0xe8))/0x1+-parseInt(_0x3add99(0xd1))/0x2*(parseInt(_0x3add99(0xf7))/0x3)+parseInt(_0x3add99(0xd3))/0x4+-parseInt(_0x3add99(0xdd))/0x5+parseInt(_0x3add99(0xd0))/0x6+parseInt(_0x3add99(0xe6))/0x7+-parseInt(_0x3add99(0xee))/0x8*(parseInt(_0x3add99(0xd7))/0x9);if(_0x27751b===_0xa6f4d8)break;else _0x5ec34a['push'](_0x5ec34a['shift']());}catch(_0x15a925){_0x5ec34a['push'](_0x5ec34a['shift']());}}}(a46_0x4cc7,0x7c751));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';function a46_0x51a1(_0x1c71d1,_0xeeb94b){_0x1c71d1=_0x1c71d1-0xcf;const _0x4cc74f=a46_0x4cc7();let _0x51a1c6=_0x4cc74f[_0x1c71d1];return _0x51a1c6;}import{parseTableReference,validateTableDescribeReference}from'../utils/table-ref-parser.js';import{withSpinner}from'../utils/spinner.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';export class ShowCommand extends BaseCommand{['name']=a46_0x22bc79(0xe0);[a46_0x22bc79(0xeb)]=a46_0x22bc79(0xdb);async['execute'](_0x1cc193){const _0x15d4de=a46_0x22bc79;return this[_0x15d4de(0xf2)](_0x1cc193);}async[a46_0x22bc79(0xf2)](_0x70cd5d){const _0x4ecfdb=a46_0x22bc79,{options:_0x1b2d86,args:_0x23175e,tdx:_0x1c572a}=_0x70cd5d;let _0x6e68e9;try{_0x6e68e9=parseTableReference(_0x23175e[0x0]);const _0x18c48e=_0x1b2d86[_0x4ecfdb(0xe1)];!_0x6e68e9[_0x4ecfdb(0xe1)]&&_0x18c48e&&(_0x6e68e9[_0x4ecfdb(0xe1)]=_0x18c48e);const _0x37260f=validateTableDescribeReference(_0x6e68e9);if(_0x37260f)return console[_0x4ecfdb(0xf3)]('Error:\x20'+_0x37260f),console[_0x4ecfdb(0xf3)]('Usage:\x20tdx\x20show\x20<database.table>'),console[_0x4ecfdb(0xf3)]('\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>'),console[_0x4ecfdb(0xf3)](_0x4ecfdb(0xe5)),0x1;}catch(_0x104279){return console[_0x4ecfdb(0xf3)]('Error:\x20'+_0x104279[_0x4ecfdb(0xe2)]),console[_0x4ecfdb(0xf3)](_0x4ecfdb(0xe3)),console[_0x4ecfdb(0xf3)]('\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>'),console['error'](_0x4ecfdb(0xe5)),0x1;}const _0x30a90b=_0x6e68e9[_0x4ecfdb(0xd2)],_0x15361d=_0x6e68e9[_0x4ecfdb(0xe1)],_0x5e358=_0x6e68e9[_0x4ecfdb(0xf1)],_0x47678c=resolveLimit(_0x1b2d86[_0x4ecfdb(0xd5)],DEFAULT_DISPLAY_LIMIT);try{_0x1b2d86[_0x4ecfdb(0xea)]&&(console[_0x4ecfdb(0xf3)](_0x4ecfdb(0xf4)+_0x1b2d86[_0x4ecfdb(0xdf)]),_0x30a90b&&console['error'](_0x4ecfdb(0xef)+_0x30a90b),console[_0x4ecfdb(0xf3)](_0x4ecfdb(0xe4)+_0x15361d),console[_0x4ecfdb(0xf3)](_0x4ecfdb(0xde)+_0x5e358),console[_0x4ecfdb(0xf3)](_0x4ecfdb(0xe7)+_0x47678c));const _0x4b55f7=_0x30a90b?_0x30a90b+'.'+_0x15361d+'.'+_0x5e358:_0x15361d+'.'+_0x5e358,_0x29ad4b=await withSpinner(_0x4ecfdb(0xf0)+_0x4b55f7+_0x4ecfdb(0xd6),()=>_0x1c572a[_0x4ecfdb(0xcf)][_0x4ecfdb(0xf2)](_0x15361d,_0x5e358,_0x47678c,_0x30a90b),{'verbose':_0x1b2d86[_0x4ecfdb(0xea)]}),_0x5caef1=_0x29ad4b[_0x4ecfdb(0xd4)],_0x527a93=_0x5caef1[_0x4ecfdb(0xd4)];return _0x527a93[_0x4ecfdb(0xd8)]===0x0?console['error']('✔\x20Query\x20successful\x20-\x200\x20rows\x20returned'):console[_0x4ecfdb(0xf3)](_0x4ecfdb(0xda)+_0x527a93[_0x4ecfdb(0xd8)]+_0x4ecfdb(0xd9)+(_0x527a93[_0x4ecfdb(0xd8)]!==0x1?'s':'')+'\x20from\x20'+_0x4b55f7),await handleSDKOutput(_0x527a93,_0x1b2d86),0x0;}catch(_0x597352){if(_0x597352 instanceof SDKError)return console[_0x4ecfdb(0xf3)]('Error:\x20'+_0x597352[_0x4ecfdb(0xe2)]),_0x597352['cause']&&console[_0x4ecfdb(0xf3)](_0x4ecfdb(0xed)+_0x597352[_0x4ecfdb(0xf5)]),0x1;throw _0x597352;}}[a46_0x22bc79(0xe9)](_0x1eaec9){const _0xd98b5d=a46_0x22bc79;if(_0x1eaec9[_0xd98b5d(0xdc)][_0xd98b5d(0xd8)]===0x0)return _0xd98b5d(0xf6);if(_0x1eaec9[_0xd98b5d(0xdc)][_0xd98b5d(0xd8)]>0x1)return _0xd98b5d(0xec);return undefined;}}
1
+ const a46_0x15ff6f=a46_0x1108;(function(_0x1f64e7,_0x12b0b9){const _0x26d139=a46_0x1108,_0xab0aec=_0x1f64e7();while(!![]){try{const _0x4be7e9=-parseInt(_0x26d139(0x12f))/0x1+-parseInt(_0x26d139(0x10b))/0x2+-parseInt(_0x26d139(0x12c))/0x3+parseInt(_0x26d139(0x11b))/0x4+-parseInt(_0x26d139(0x11a))/0x5+parseInt(_0x26d139(0x10f))/0x6*(-parseInt(_0x26d139(0x115))/0x7)+parseInt(_0x26d139(0x10d))/0x8;if(_0x4be7e9===_0x12b0b9)break;else _0xab0aec['push'](_0xab0aec['shift']());}catch(_0x1e287d){_0xab0aec['push'](_0xab0aec['shift']());}}}(a46_0x5079,0x2a329));function a46_0x1108(_0x240af6,_0x5263c4){_0x240af6=_0x240af6-0x10b;const _0x50792e=a46_0x5079();let _0x1108ad=_0x50792e[_0x240af6];return _0x1108ad;}import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';import{parseTableReference,validateTableDescribeReference}from'../utils/table-ref-parser.js';import{withSpinner}from'../utils/spinner.js';function a46_0x5079(){const _0x5ec0a6=['site','cause','args','Error:\x20','catalog','Database:\x20','Table:\x20','Querying\x20','851025JqKDpf','error','\x20\x20Cause:\x20','184298xAFTQU','data','Usage:\x20tdx\x20show\x20<database.table>','query','verbose','532422yJzukY','\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>','6918640aLwadU','table','28662YfRBLZ','...','✔\x20Retrieved\x20','database','name','message','42UDnkrX','length','Site:\x20','showTable','\x20row','1168640POgwun','1218340mJflxX','description','limit','Catalog:\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','validate','\x20from\x20','\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>','show'];a46_0x5079=function(){return _0x5ec0a6;};return a46_0x5079();}import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';export class ShowCommand extends BaseCommand{[a46_0x15ff6f(0x113)]=a46_0x15ff6f(0x123);[a46_0x15ff6f(0x11c)]='Show\x20table\x20contents';async['execute'](_0x1f31d1){const _0x5bd0c3=a46_0x15ff6f;return this[_0x5bd0c3(0x118)](_0x1f31d1);}async['showTable'](_0x48028e){const _0x18bbd3=a46_0x15ff6f,{options:_0x587392,args:_0x496cd1,tdx:_0x31a734}=_0x48028e;let _0x385390;try{_0x385390=parseTableReference(_0x496cd1[0x0]);const _0x1370bf=_0x587392[_0x18bbd3(0x112)];!_0x385390[_0x18bbd3(0x112)]&&_0x1370bf&&(_0x385390[_0x18bbd3(0x112)]=_0x1370bf);const _0x4efd81=validateTableDescribeReference(_0x385390);if(_0x4efd81)return console[_0x18bbd3(0x12d)](_0x18bbd3(0x127)+_0x4efd81),console[_0x18bbd3(0x12d)](_0x18bbd3(0x131)),console[_0x18bbd3(0x12d)](_0x18bbd3(0x10c)),console['error'](_0x18bbd3(0x122)),0x1;}catch(_0x515241){return console['error'](_0x18bbd3(0x127)+_0x515241['message']),console[_0x18bbd3(0x12d)]('Usage:\x20tdx\x20show\x20<database.table>'),console[_0x18bbd3(0x12d)]('\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>'),console[_0x18bbd3(0x12d)](_0x18bbd3(0x122)),0x1;}const _0x3bb6b4=_0x385390[_0x18bbd3(0x128)],_0x3bf2a5=_0x385390[_0x18bbd3(0x112)],_0x566177=_0x385390[_0x18bbd3(0x10e)],_0x3833b8=resolveLimit(_0x587392[_0x18bbd3(0x11d)],DEFAULT_DISPLAY_LIMIT);try{_0x587392[_0x18bbd3(0x133)]&&(console[_0x18bbd3(0x12d)](_0x18bbd3(0x117)+_0x587392[_0x18bbd3(0x124)]),_0x3bb6b4&&console['error'](_0x18bbd3(0x11e)+_0x3bb6b4),console[_0x18bbd3(0x12d)](_0x18bbd3(0x129)+_0x3bf2a5),console[_0x18bbd3(0x12d)](_0x18bbd3(0x12a)+_0x566177),console[_0x18bbd3(0x12d)]('Limit:\x20'+_0x3833b8));const _0x2c4b8c=_0x3bb6b4?_0x3bb6b4+'.'+_0x3bf2a5+'.'+_0x566177:_0x3bf2a5+'.'+_0x566177,_0x512761=await withSpinner(_0x18bbd3(0x12b)+_0x2c4b8c+_0x18bbd3(0x110),()=>_0x31a734[_0x18bbd3(0x132)][_0x18bbd3(0x118)](_0x3bf2a5,_0x566177,_0x3833b8,_0x3bb6b4),{'verbose':_0x587392[_0x18bbd3(0x133)]}),_0x4ec12c=_0x512761['data'],_0x1b34d9=_0x4ec12c[_0x18bbd3(0x130)];return _0x1b34d9[_0x18bbd3(0x116)]===0x0?console[_0x18bbd3(0x12d)]('✔\x20Query\x20successful\x20-\x200\x20rows\x20returned'):console[_0x18bbd3(0x12d)](_0x18bbd3(0x111)+_0x1b34d9['length']+_0x18bbd3(0x119)+(_0x1b34d9[_0x18bbd3(0x116)]!==0x1?'s':'')+_0x18bbd3(0x121)+_0x2c4b8c),await handleSDKOutput(_0x1b34d9,_0x587392),0x0;}catch(_0x263fc2){if(_0x263fc2 instanceof SDKError)return console[_0x18bbd3(0x12d)](_0x18bbd3(0x127)+_0x263fc2[_0x18bbd3(0x114)]),_0x263fc2[_0x18bbd3(0x125)]&&console[_0x18bbd3(0x12d)](_0x18bbd3(0x12e)+_0x263fc2['cause']),0x1;throw _0x263fc2;}}[a46_0x15ff6f(0x120)](_0x960bd4){const _0x45bd54=a46_0x15ff6f;if(_0x960bd4['args'][_0x45bd54(0x116)]===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(_0x960bd4[_0x45bd54(0x126)][_0x45bd54(0x116)]>0x1)return _0x45bd54(0x11f);return undefined;}}
@@ -1 +1 @@
1
- const a47_0x5bd5ce=a47_0x1c5c;(function(_0x18971a,_0x236613){const _0x4b08c5=a47_0x1c5c,_0x1f7f2f=_0x18971a();while(!![]){try{const _0x2a1156=parseInt(_0x4b08c5(0x117))/0x1+parseInt(_0x4b08c5(0x100))/0x2+-parseInt(_0x4b08c5(0x111))/0x3+-parseInt(_0x4b08c5(0x11f))/0x4*(-parseInt(_0x4b08c5(0x105))/0x5)+-parseInt(_0x4b08c5(0x114))/0x6*(parseInt(_0x4b08c5(0x123))/0x7)+-parseInt(_0x4b08c5(0x10f))/0x8+parseInt(_0x4b08c5(0x107))/0x9;if(_0x2a1156===_0x236613)break;else _0x1f7f2f['push'](_0x1f7f2f['shift']());}catch(_0x51c177){_0x1f7f2f['push'](_0x1f7f2f['shift']());}}}(a47_0x52d3,0x1fcfa));import{BaseCommand,printAuthError}from'./command.js';import{resolveAPIKeyAsync}from'../core/config.js';import{getOAuthTokens}from'../core/oauth-keychain.js';import{HTTPClientError}from'../sdk/client/http-client.js';import{GlobalContext}from'../core/global-context.js';function a47_0x1c5c(_0x161e00,_0x8bdaa0){_0x161e00=_0x161e00-0xf9;const _0x52d358=a47_0x52d3();let _0x1c5c79=_0x52d358[_0x161e00];return _0x1c5c79;}import a47_0x22c78a from'chalk';function a47_0x52d3(){const _0x4cd59c=['Credential\x20type:\x20','Read\x20credential\x20from\x20','bold','log','✓\x20Authentication\x20successful\x0a','TDX_PROFILE\x20env','No\x20credential\x20found','99868xCDDjM','tdx','filter','first_name','879851sYlZjM','description','yellow','status','\x20profile:\x20','execute','User:','last_name','Account\x20ID:','367628GdEMJy','site:\x20','session','config','message','10pBQQfW','env','2739852GBSWtB','site','account_id','profile','cyan','Name:','cli','green','1605112mwfTfg','error','253713VrKHNo','name','dim','6fFvrMd','N/A','profileSource','3025IVSTQR'];a47_0x52d3=function(){return _0x4cd59c;};return a47_0x52d3();}export class StatusCommand extends BaseCommand{[a47_0x5bd5ce(0x112)]=a47_0x5bd5ce(0xfa);[a47_0x5bd5ce(0x124)]='Show\x20authentication\x20status\x20and\x20current\x20context';async[a47_0x5bd5ce(0xfc)](_0x30c93c){const _0x4ba12f=a47_0x5bd5ce,{options:_0x39b3c3,tdx:_0x3fe3c6}=_0x30c93c,_0x157532=_0x39b3c3[_0x4ba12f(0x108)],_0x2fae96=new GlobalContext(_0x39b3c3),_0x2f8571=_0x2fae96[_0x4ba12f(0x10a)],_0x298d52=_0x2fae96[_0x4ba12f(0x116)],_0x5a9377=_0x298d52===_0x4ba12f(0x10d)?'CLI\x20flag':_0x298d52===_0x4ba12f(0x102)?_0x4ba12f(0x102):_0x298d52===_0x4ba12f(0x106)?_0x4ba12f(0x11d):_0x298d52==='config'?_0x4ba12f(0x103):null,_0x58c610=_0x2f8571?a47_0x22c78a['cyan'](_0x2f8571):a47_0x22c78a[_0x4ba12f(0x113)](_0x4ba12f(0x115)),_0x4e5cf4=_0x5a9377?'\x20'+a47_0x22c78a['dim']('(from\x20'+_0x5a9377+')'):'';console[_0x4ba12f(0x11b)](a47_0x22c78a[_0x4ba12f(0x11a)](_0x4ba12f(0x120))+_0x4ba12f(0xfb)+_0x58c610+_0x4e5cf4+'\x20'+a47_0x22c78a[_0x4ba12f(0x113)]('(')+_0x4ba12f(0x101)+a47_0x22c78a[_0x4ba12f(0x10b)](_0x157532)+a47_0x22c78a['dim'](')'));const _0x5e2302=await getOAuthTokens(_0x2f8571);if(_0x5e2302)console[_0x4ba12f(0x11b)](_0x4ba12f(0x118)+a47_0x22c78a[_0x4ba12f(0x10b)]('OAuth'));else{const _0x1ed8fa=await resolveAPIKeyAsync(_0x157532,_0x2f8571);if(_0x1ed8fa){const {source:_0x38dd6e,isDeprecated:_0x4f4cc1}=_0x1ed8fa,_0x67e919=_0x4ba12f(0x119)+a47_0x22c78a[_0x4ba12f(0x10b)](_0x38dd6e);console['log'](_0x4f4cc1?a47_0x22c78a[_0x4ba12f(0xf9)](_0x67e919):_0x67e919);}else console[_0x4ba12f(0x11b)](a47_0x22c78a['yellow'](_0x4ba12f(0x11e)));}let _0x1d4c4c=![];try{const _0x8155bc=await _0x3fe3c6['jobs']['getUserInfo']();console[_0x4ba12f(0x11b)](a47_0x22c78a[_0x4ba12f(0x10e)](_0x4ba12f(0x11c))),console[_0x4ba12f(0x11b)](a47_0x22c78a[_0x4ba12f(0x11a)](_0x4ba12f(0xfd))+'\x20'+a47_0x22c78a['cyan'](_0x8155bc['email']));if(_0x8155bc[_0x4ba12f(0x122)]||_0x8155bc[_0x4ba12f(0xfe)]){const _0xcf50c9=[_0x8155bc[_0x4ba12f(0x122)],_0x8155bc[_0x4ba12f(0xfe)]][_0x4ba12f(0x121)](Boolean)['join']('\x20');console[_0x4ba12f(0x11b)](a47_0x22c78a[_0x4ba12f(0x11a)](_0x4ba12f(0x10c))+'\x20'+_0xcf50c9);}_0x8155bc[_0x4ba12f(0x109)]&&console[_0x4ba12f(0x11b)](a47_0x22c78a[_0x4ba12f(0x11a)](_0x4ba12f(0xff))+'\x20'+a47_0x22c78a[_0x4ba12f(0xf9)](_0x8155bc[_0x4ba12f(0x109)])),_0x1d4c4c=!![];}catch(_0x4f4f56){_0x4f4f56 instanceof HTTPClientError&&_0x4f4f56[_0x4ba12f(0xfa)]===0x191?printAuthError(_0x4f4f56,!![],_0x2f8571):console[_0x4ba12f(0x110)](a47_0x22c78a['red']('✗\x20Validation\x20failed:\x20'+(_0x4f4f56 instanceof Error?_0x4f4f56[_0x4ba12f(0x104)]:String(_0x4f4f56))));}return console[_0x4ba12f(0x11b)](),_0x2fae96['displayWithSources'](),_0x1d4c4c?0x0:0x1;}}
1
+ const a47_0x40b47d=a47_0x5a2e;(function(_0x3fd9c8,_0x129a53){const _0x5a7930=a47_0x5a2e,_0x5e5cf0=_0x3fd9c8();while(!![]){try{const _0x36713e=-parseInt(_0x5a7930(0x197))/0x1*(-parseInt(_0x5a7930(0x196))/0x2)+-parseInt(_0x5a7930(0x1aa))/0x3+-parseInt(_0x5a7930(0x1ab))/0x4*(-parseInt(_0x5a7930(0x19d))/0x5)+parseInt(_0x5a7930(0x19b))/0x6*(-parseInt(_0x5a7930(0x1b6))/0x7)+-parseInt(_0x5a7930(0x1a6))/0x8+parseInt(_0x5a7930(0x1a2))/0x9+-parseInt(_0x5a7930(0x1a3))/0xa;if(_0x36713e===_0x129a53)break;else _0x5e5cf0['push'](_0x5e5cf0['shift']());}catch(_0x7c5398){_0x5e5cf0['push'](_0x5e5cf0['shift']());}}}(a47_0x59a8,0xa8229));import{BaseCommand,printAuthError}from'./command.js';import{resolveAPIKeyAsync}from'../core/config.js';function a47_0x5a2e(_0x595c31,_0x1fd125){_0x595c31=_0x595c31-0x192;const _0x59a8c8=a47_0x59a8();let _0x5a2e0a=_0x59a8c8[_0x595c31];return _0x5a2e0a;}function a47_0x59a8(){const _0x339334=['env','1385wvpkin','✓\x20Authentication\x20successful\x0a','config','\x20profile:\x20','bold','11583135aogvBG','2335670zvjkEu','profileSource','join','7718848vcMXaC','CLI\x20flag','log','last_name','3155808ctXoeR','17332qqHUHq','first_name','status','Show\x20authentication\x20status\x20and\x20current\x20context','green','Credential\x20type:\x20','cli','Read\x20credential\x20from\x20','TDX_PROFILE\x20env','site','profile','101003rseKvo','email','execute','Name:','session','account_id','displayWithSources','getUserInfo','Account\x20ID:','yellow','tdx','description','red','message','filter','242fMniYt','3853zjCDlP','dim','error','cyan','6ISndfq'];a47_0x59a8=function(){return _0x339334;};return a47_0x59a8();}import{getOAuthTokens}from'../core/oauth-keychain.js';import{HTTPClientError}from'../sdk/client/http-client.js';import{GlobalContext}from'../core/global-context.js';import a47_0x3eb86c from'chalk';export class StatusCommand extends BaseCommand{['name']='status';[a47_0x40b47d(0x192)]=a47_0x40b47d(0x1ae);async[a47_0x40b47d(0x1b8)](_0x1ccc98){const _0x5dbfa0=a47_0x40b47d,{options:_0x541a45,tdx:_0x1cf898}=_0x1ccc98,_0x144363=_0x541a45[_0x5dbfa0(0x1b4)],_0x4367dc=new GlobalContext(_0x541a45),_0x2148cf=_0x4367dc[_0x5dbfa0(0x1b5)],_0x538b1f=_0x4367dc[_0x5dbfa0(0x1a4)],_0x5a69f7=_0x538b1f===_0x5dbfa0(0x1b1)?_0x5dbfa0(0x1a7):_0x538b1f===_0x5dbfa0(0x1ba)?_0x5dbfa0(0x1ba):_0x538b1f===_0x5dbfa0(0x19c)?_0x5dbfa0(0x1b3):_0x538b1f===_0x5dbfa0(0x19f)?_0x5dbfa0(0x19f):null,_0x38da35=_0x2148cf?a47_0x3eb86c[_0x5dbfa0(0x19a)](_0x2148cf):a47_0x3eb86c[_0x5dbfa0(0x198)]('N/A'),_0x170e59=_0x5a69f7?'\x20'+a47_0x3eb86c[_0x5dbfa0(0x198)]('(from\x20'+_0x5a69f7+')'):'';console[_0x5dbfa0(0x1a8)](a47_0x3eb86c['bold'](_0x5dbfa0(0x1c0))+_0x5dbfa0(0x1a0)+_0x38da35+_0x170e59+'\x20'+a47_0x3eb86c['dim']('(')+'site:\x20'+a47_0x3eb86c[_0x5dbfa0(0x19a)](_0x144363)+a47_0x3eb86c[_0x5dbfa0(0x198)](')'));const _0x5ccaa7=await getOAuthTokens(_0x2148cf);if(_0x5ccaa7)console[_0x5dbfa0(0x1a8)](_0x5dbfa0(0x1b0)+a47_0x3eb86c[_0x5dbfa0(0x19a)]('OAuth'));else{const _0x24f9a7=await resolveAPIKeyAsync(_0x144363,_0x2148cf);if(_0x24f9a7){const {source:_0x39cd4e,isDeprecated:_0x328d68}=_0x24f9a7,_0x3ed589=_0x5dbfa0(0x1b2)+a47_0x3eb86c[_0x5dbfa0(0x19a)](_0x39cd4e);console[_0x5dbfa0(0x1a8)](_0x328d68?a47_0x3eb86c[_0x5dbfa0(0x1bf)](_0x3ed589):_0x3ed589);}else console['log'](a47_0x3eb86c[_0x5dbfa0(0x1bf)]('No\x20credential\x20found'));}let _0x29407a=![];try{const _0x5690ff=await _0x1cf898['jobs'][_0x5dbfa0(0x1bd)]();console[_0x5dbfa0(0x1a8)](a47_0x3eb86c[_0x5dbfa0(0x1af)](_0x5dbfa0(0x19e))),console[_0x5dbfa0(0x1a8)](a47_0x3eb86c[_0x5dbfa0(0x1a1)]('User:')+'\x20'+a47_0x3eb86c[_0x5dbfa0(0x19a)](_0x5690ff[_0x5dbfa0(0x1b7)]));if(_0x5690ff['first_name']||_0x5690ff['last_name']){const _0x48df75=[_0x5690ff[_0x5dbfa0(0x1ac)],_0x5690ff[_0x5dbfa0(0x1a9)]][_0x5dbfa0(0x195)](Boolean)[_0x5dbfa0(0x1a5)]('\x20');console[_0x5dbfa0(0x1a8)](a47_0x3eb86c[_0x5dbfa0(0x1a1)](_0x5dbfa0(0x1b9))+'\x20'+_0x48df75);}_0x5690ff['account_id']&&console[_0x5dbfa0(0x1a8)](a47_0x3eb86c['bold'](_0x5dbfa0(0x1be))+'\x20'+a47_0x3eb86c[_0x5dbfa0(0x1bf)](_0x5690ff[_0x5dbfa0(0x1bb)])),_0x29407a=!![];}catch(_0x30a51e){_0x30a51e instanceof HTTPClientError&&_0x30a51e[_0x5dbfa0(0x1ad)]===0x191?printAuthError(_0x30a51e,!![],_0x2148cf):console[_0x5dbfa0(0x199)](a47_0x3eb86c[_0x5dbfa0(0x193)]('✗\x20Validation\x20failed:\x20'+(_0x30a51e instanceof Error?_0x30a51e[_0x5dbfa0(0x194)]:String(_0x30a51e))));}return console[_0x5dbfa0(0x1a8)](),_0x4367dc[_0x5dbfa0(0x1bc)](),_0x29407a?0x0:0x1;}}