@treasuredata/tdx 2026.4.8 → 2026.4.10

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 (237) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.js +1 -1
  5. package/dist/commands/activations.js +1 -1
  6. package/dist/commands/agent-command.js +1 -1
  7. package/dist/commands/agent-test-command.js +1 -1
  8. package/dist/commands/api-command.js +1 -1
  9. package/dist/commands/auth-command.js +1 -1
  10. package/dist/commands/cas-command.js +1 -1
  11. package/dist/commands/cas-segment-command.js +1 -1
  12. package/dist/commands/chat-command.js +1 -1
  13. package/dist/commands/claude-command.d.ts.map +1 -1
  14. package/dist/commands/claude-command.js +1 -1
  15. package/dist/commands/claude-command.js.map +1 -1
  16. package/dist/commands/claude-statusline-command.js +1 -1
  17. package/dist/commands/claude-usage-command.js +1 -1
  18. package/dist/commands/command.js +1 -1
  19. package/dist/commands/connection-command.js +1 -1
  20. package/dist/commands/databases.js +1 -1
  21. package/dist/commands/delivery-command.js +1 -1
  22. package/dist/commands/describe.js +1 -1
  23. package/dist/commands/engage-campaign-pull-command.js +1 -1
  24. package/dist/commands/engage-campaign-push-command.js +1 -1
  25. package/dist/commands/engage-campaign-validate-command.js +1 -1
  26. package/dist/commands/engage-command.js +1 -1
  27. package/dist/commands/engage-template-pull-command.js +1 -1
  28. package/dist/commands/engage-template-push-command.js +1 -1
  29. package/dist/commands/engage-template-validate-command.js +1 -1
  30. package/dist/commands/job-command.js +1 -1
  31. package/dist/commands/journey-command.js +1 -1
  32. package/dist/commands/journey-validate-command.js +1 -1
  33. package/dist/commands/llm-command.js +1 -1
  34. package/dist/commands/mcp-command.js +1 -1
  35. package/dist/commands/parent-segment-command.js +1 -1
  36. package/dist/commands/policy-command.js +1 -1
  37. package/dist/commands/profile-command.js +1 -1
  38. package/dist/commands/profiles-command.js +1 -1
  39. package/dist/commands/query-command.js +1 -1
  40. package/dist/commands/schedule-command.js +1 -1
  41. package/dist/commands/segment-command.js +1 -1
  42. package/dist/commands/segment-create-command.js +1 -1
  43. package/dist/commands/segment-fields-command.js +1 -1
  44. package/dist/commands/segment-pull-command.js +1 -1
  45. package/dist/commands/segment-push-command.js +1 -1
  46. package/dist/commands/segment-update-command.js +1 -1
  47. package/dist/commands/segment-use-command.js +1 -1
  48. package/dist/commands/segment-validate-command.js +1 -1
  49. package/dist/commands/segments.js +1 -1
  50. package/dist/commands/show.js +1 -1
  51. package/dist/commands/status-command.js +1 -1
  52. package/dist/commands/tables.js +1 -1
  53. package/dist/commands/unset-command.js +1 -1
  54. package/dist/commands/upgrade-command.js +1 -1
  55. package/dist/commands/use-command.js +1 -1
  56. package/dist/commands/user-command.js +1 -1
  57. package/dist/commands/work-command.js +1 -1
  58. package/dist/commands/workflow-command.js +1 -1
  59. package/dist/core/auth.js +1 -1
  60. package/dist/core/command-output.js +1 -1
  61. package/dist/core/config.js +1 -1
  62. package/dist/core/connection-cache.js +1 -1
  63. package/dist/core/constants.js +1 -1
  64. package/dist/core/credential-cache.js +1 -1
  65. package/dist/core/global-context.js +1 -1
  66. package/dist/core/keychain.js +1 -1
  67. package/dist/core/oauth-keychain.js +1 -1
  68. package/dist/core/oauth.js +1 -1
  69. package/dist/core/profile.js +1 -1
  70. package/dist/core/project-config.js +1 -1
  71. package/dist/core/session.js +1 -1
  72. package/dist/core/user-cache.js +1 -1
  73. package/dist/core/version.js +1 -1
  74. package/dist/index.js +1 -1
  75. package/dist/mcp/server.js +1 -1
  76. package/dist/mcp/tools/index.js +1 -1
  77. package/dist/mcp/tools/tdx-run.js +1 -1
  78. package/dist/mcp/tools/tdx-search.js +1 -1
  79. package/dist/mcp/tools/work-create-item.js +1 -1
  80. package/dist/mcp/utils.js +1 -1
  81. package/dist/proxy/claude-usage-tracker.js +1 -1
  82. package/dist/proxy/passthrough-server.js +1 -1
  83. package/dist/proxy/sse-usage-parser.js +1 -1
  84. package/dist/sdk/agent/agent-config.js +1 -1
  85. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  86. package/dist/sdk/agent/agent-yaml.js +1 -1
  87. package/dist/sdk/agent/test/evaluator.js +1 -1
  88. package/dist/sdk/agent/test/executor.js +1 -1
  89. package/dist/sdk/agent/test/index.js +1 -1
  90. package/dist/sdk/agent/test/output.js +1 -1
  91. package/dist/sdk/agent/test/parser.js +1 -1
  92. package/dist/sdk/agent/tool-target-registry.js +1 -1
  93. package/dist/sdk/api.js +1 -1
  94. package/dist/sdk/cas/cas-api-client.js +1 -1
  95. package/dist/sdk/cas/cas-audience-yaml.js +1 -1
  96. package/dist/sdk/cas/cas-segment-yaml.js +1 -1
  97. package/dist/sdk/cas/index.js +1 -1
  98. package/dist/sdk/cas/pull-workflow.js +1 -1
  99. package/dist/sdk/cas/push-workflow.js +1 -1
  100. package/dist/sdk/client/cdp-api-client.js +1 -1
  101. package/dist/sdk/client/delivery-api-client.js +1 -1
  102. package/dist/sdk/client/endpoints.js +1 -1
  103. package/dist/sdk/client/engage-api-client.js +1 -1
  104. package/dist/sdk/client/http-client.js +1 -1
  105. package/dist/sdk/client/llm-api-client.js +1 -1
  106. package/dist/sdk/client/oauth-refresh.js +1 -1
  107. package/dist/sdk/client/rate-limiter.js +1 -1
  108. package/dist/sdk/client/td-api-client.js +1 -1
  109. package/dist/sdk/client/trino-api-client.js +1 -1
  110. package/dist/sdk/client/workflow-client.js +1 -1
  111. package/dist/sdk/connection-validator.js +1 -1
  112. package/dist/sdk/connection.js +1 -1
  113. package/dist/sdk/delivery.js +1 -1
  114. package/dist/sdk/engage/campaign-pull.js +1 -1
  115. package/dist/sdk/engage/campaign-push.js +1 -1
  116. package/dist/sdk/engage/campaign-validator.js +1 -1
  117. package/dist/sdk/engage/campaign-yaml.js +1 -1
  118. package/dist/sdk/engage/template-pull.js +1 -1
  119. package/dist/sdk/engage/template-push.js +1 -1
  120. package/dist/sdk/engage/template-validator.js +1 -1
  121. package/dist/sdk/engage/template-yaml.js +1 -1
  122. package/dist/sdk/engage/types/campaign-def.js +1 -1
  123. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  124. package/dist/sdk/engage/types/template-schema.js +1 -1
  125. package/dist/sdk/engage.js +1 -1
  126. package/dist/sdk/errors.js +1 -1
  127. package/dist/sdk/index.js +1 -1
  128. package/dist/sdk/io/index.js +1 -1
  129. package/dist/sdk/io/node-filesystem.js +1 -1
  130. package/dist/sdk/job.js +1 -1
  131. package/dist/sdk/journey.js +1 -1
  132. package/dist/sdk/llm/chat-cache.js +1 -1
  133. package/dist/sdk/llm/index.js +1 -1
  134. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  135. package/dist/sdk/llm/model-factors.js +1 -1
  136. package/dist/sdk/personalization.js +1 -1
  137. package/dist/sdk/policy.js +1 -1
  138. package/dist/sdk/query/index.js +1 -1
  139. package/dist/sdk/query/sql-parser.js +1 -1
  140. package/dist/sdk/realtime.js +1 -1
  141. package/dist/sdk/schedule.js +1 -1
  142. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  143. package/dist/sdk/segment/fields-display.js +1 -1
  144. package/dist/sdk/segment/file-discovery.js +1 -1
  145. package/dist/sdk/segment/journey-utils.js +1 -1
  146. package/dist/sdk/segment/journey-validator.js +1 -1
  147. package/dist/sdk/segment/journey-yaml.js +1 -1
  148. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  149. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  150. package/dist/sdk/segment/pull-workflow.js +1 -1
  151. package/dist/sdk/segment/push-recovery.js +1 -1
  152. package/dist/sdk/segment/push-workflow.js +1 -1
  153. package/dist/sdk/segment/resolution-context.js +1 -1
  154. package/dist/sdk/segment/segment-path-parser.js +1 -1
  155. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  156. package/dist/sdk/segment/segment-validator.js +1 -1
  157. package/dist/sdk/segment/target-resolution.js +1 -1
  158. package/dist/sdk/segment/tdx-config.js +1 -1
  159. package/dist/sdk/segment/types/activation-schema.js +1 -1
  160. package/dist/sdk/segment/types/journey-def.js +1 -1
  161. package/dist/sdk/segment/types/journey-schema.js +1 -1
  162. package/dist/sdk/segment/types/segment-def.js +1 -1
  163. package/dist/sdk/segment/types/segment-schema.js +1 -1
  164. package/dist/sdk/segment/validate-files.js +1 -1
  165. package/dist/sdk/segment/yaml-validator.js +1 -1
  166. package/dist/sdk/segment.js +1 -1
  167. package/dist/sdk/types/index.js +1 -1
  168. package/dist/sdk/types/progress.js +1 -1
  169. package/dist/sdk/types/workspace.js +1 -1
  170. package/dist/sdk/user.js +1 -1
  171. package/dist/sdk/util/format-detector.js +1 -1
  172. package/dist/sdk/util/formatters.js +1 -1
  173. package/dist/sdk/util/index.js +1 -1
  174. package/dist/sdk/util/paginate.js +1 -1
  175. package/dist/sdk/util/tree-formatter.js +1 -1
  176. package/dist/sdk/workflow/archive-validation.js +1 -1
  177. package/dist/sdk/workflow/clone-workflow.js +1 -1
  178. package/dist/sdk/workflow/index.js +1 -1
  179. package/dist/sdk/workflow/pull-workflow.js +1 -1
  180. package/dist/sdk/workflow/push-workflow.js +1 -1
  181. package/dist/sdk/workflow/tdx-config.js +1 -1
  182. package/dist/sdk/workflow/workflow-utils.js +1 -1
  183. package/dist/sdk/workspace/access-tracker.d.ts +2 -0
  184. package/dist/sdk/workspace/access-tracker.d.ts.map +1 -1
  185. package/dist/sdk/workspace/access-tracker.js +1 -1
  186. package/dist/sdk/workspace/access-tracker.js.map +1 -1
  187. package/dist/sdk/workspace/frontmatter.js +1 -1
  188. package/dist/sdk/workspace/git.d.ts +52 -0
  189. package/dist/sdk/workspace/git.d.ts.map +1 -1
  190. package/dist/sdk/workspace/git.js +1 -1
  191. package/dist/sdk/workspace/git.js.map +1 -1
  192. package/dist/sdk/workspace/index.d.ts +16 -0
  193. package/dist/sdk/workspace/index.d.ts.map +1 -1
  194. package/dist/sdk/workspace/index.js +1 -1
  195. package/dist/sdk/workspace/index.js.map +1 -1
  196. package/dist/sdk/workspace/templates.js +1 -1
  197. package/dist/sdk/workspace/weekly.js +1 -1
  198. package/dist/sdk/workspace/wikilinks.js +1 -1
  199. package/dist/test-utils/command-runner.js +1 -1
  200. package/dist/test-utils/factories.js +1 -1
  201. package/dist/test-utils/fixtures.js +1 -1
  202. package/dist/test-utils/http-mock.js +1 -1
  203. package/dist/test-utils/index.js +1 -1
  204. package/dist/utils/async.js +1 -1
  205. package/dist/utils/colors.js +1 -1
  206. package/dist/utils/diff.js +1 -1
  207. package/dist/utils/file-permissions.js +1 -1
  208. package/dist/utils/file-reader.js +1 -1
  209. package/dist/utils/github-releases.js +1 -1
  210. package/dist/utils/global-cache.js +1 -1
  211. package/dist/utils/json-loader.js +1 -1
  212. package/dist/utils/local-cache.js +1 -1
  213. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  214. package/dist/utils/logger/formatters/index.js +1 -1
  215. package/dist/utils/logger/handlers/console-handler.js +1 -1
  216. package/dist/utils/logger/handlers/file-handler.js +1 -1
  217. package/dist/utils/logger/handlers/index.js +1 -1
  218. package/dist/utils/logger/handlers/null-handler.js +1 -1
  219. package/dist/utils/logger/index.js +1 -1
  220. package/dist/utils/logger/logger.js +1 -1
  221. package/dist/utils/logger/types.js +1 -1
  222. package/dist/utils/option-validation.js +1 -1
  223. package/dist/utils/process.d.ts +3 -0
  224. package/dist/utils/process.d.ts.map +1 -1
  225. package/dist/utils/process.js +1 -1
  226. package/dist/utils/process.js.map +1 -1
  227. package/dist/utils/prompt.js +1 -1
  228. package/dist/utils/spinner.js +1 -1
  229. package/dist/utils/sse-parser.js +1 -1
  230. package/dist/utils/string-utils.js +1 -1
  231. package/dist/utils/table-ref-parser.js +1 -1
  232. package/dist/utils/tdx-logger.js +1 -1
  233. package/dist/utils/version-check.d.ts +10 -2
  234. package/dist/utils/version-check.d.ts.map +1 -1
  235. package/dist/utils/version-check.js +1 -1
  236. package/dist/utils/version-check.js.map +1 -1
  237. package/package.json +2 -1
@@ -1 +1 @@
1
- const a40_0x3db562=a40_0x39f0;(function(_0x669e52,_0x576c6c){const _0x33bc13=a40_0x39f0,_0x4a315b=_0x669e52();while(!![]){try{const _0x4f5198=-parseInt(_0x33bc13(0xdd))/0x1*(parseInt(_0x33bc13(0xe1))/0x2)+parseInt(_0x33bc13(0x92))/0x3+parseInt(_0x33bc13(0xb9))/0x4*(parseInt(_0x33bc13(0xe4))/0x5)+parseInt(_0x33bc13(0xa9))/0x6+-parseInt(_0x33bc13(0xb4))/0x7+parseInt(_0x33bc13(0xbf))/0x8*(parseInt(_0x33bc13(0xd2))/0x9)+parseInt(_0x33bc13(0xaa))/0xa*(-parseInt(_0x33bc13(0x99))/0xb);if(_0x4f5198===_0x576c6c)break;else _0x4a315b['push'](_0x4a315b['shift']());}catch(_0x1d36d7){_0x4a315b['push'](_0x4a315b['shift']());}}}(a40_0x374e,0xeaedc));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_0xcd0ada from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';import a40_0x5bbcf2 from'path';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';function a40_0x39f0(_0x37be7a,_0x59e0bc){_0x37be7a=_0x37be7a-0x92;const _0x374ee6=a40_0x374e();let _0x39f04a=_0x374ee6[_0x37be7a];return _0x39f04a;}export{buildFolderIdToPathMap as buildFolderPathMap}from'../sdk/segment/resolution-context.js';function a40_0x374e(){const _0x3b3ede=['Site:\x20','pullSegments','\x20files\x20to\x20','\x0aChanges\x20to\x20\x27','\x20files?','error','Error:\x20','dim','red','9bUZJZH','parentSegment','\x20=\x20','✔\x20All\x20files\x20are\x20up\x20to\x20date','\x20\x20Target:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file','site','Aborted.','absolutePath','\x20new\x20files','content','1KJTskN','segment:pull','hasChanges','✔\x20Pulled\x20','3683242yvlSdj','verbose','dirname','1670bSKjBH','name','description','Parent\x20segment:\x20','1962021GsoPQV','session','\x0aError:','\x20versions)','repeat','length','relativePath','1353GzeqMs','\x20\x20🗺️\x20\x20','journeyVersions','yellow','yes','parentName','segment','activations','file','message','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)','helpText','diff','targetDir','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent','segments','9284604PLpVpQ','56590ZvfJiL','filter','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','\x20segments','\x20unchanged\x20files','✔\x20Context\x20set:\x20','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','no_parent','Target\x20resource:\x20','isNew','13451214Relckb','green','data','\x20with\x20','parent_segment','15948GMpSyS','\x20activations','cwd','counts','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','journeys','15107592Ryffnz','\x20changed\x20files','\x27...','Write\x20','cyan','resourceName','files','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','-\x20no\x20files\x20written','\x20journeys'];a40_0x374e=function(){return _0x3b3ede;};return a40_0x374e();}export class SegmentPullCommand extends BaseCommand{[a40_0x3db562(0xe5)]=a40_0x3db562(0xde);[a40_0x3db562(0xe6)]='Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files';async['execute'](_0x59d7d3){const _0x224b1e=a40_0x3db562,{options:_0x1df6df,args:_0x32d273,tdx:_0x5d2e1b}=_0x59d7d3,_0x222765=_0x1df6df,_0x19f662=await resolveTarget({'arg':_0x32d273[0x0],'contextParent':_0x1df6df[_0x224b1e(0xd3)],'cwd':process[_0x224b1e(0xbb)]()});if(!isSuccessfulResolution(_0x19f662))return _0x19f662['errorCode']===_0x224b1e(0xb1)?(console[_0x224b1e(0xce)](a40_0xcd0ada['yellow'](_0x224b1e(0xbd))),console[_0x224b1e(0xce)](_0x224b1e(0xa3)),console['error'](_0x224b1e(0xa7)),console[_0x224b1e(0xce)](_0x224b1e(0xd7))):(console[_0x224b1e(0xce)](a40_0xcd0ada[_0x224b1e(0xd1)](_0x224b1e(0xcf)+_0x19f662[_0x224b1e(0xa2)]+'\x0a')),_0x19f662[_0x224b1e(0xa4)]&&console[_0x224b1e(0xce)](a40_0xcd0ada[_0x224b1e(0xc3)](_0x19f662[_0x224b1e(0xa4)]))),0x1;const _0x51e88d=_0x19f662[_0x224b1e(0x9e)],_0x2c401e=_0x19f662[_0x224b1e(0xa6)],_0x28b3ee=_0x19f662['type']===_0x224b1e(0xa1)?_0x19f662[_0x224b1e(0xc4)]:undefined;_0x222765[_0x224b1e(0xe2)]&&(console['error'](_0x224b1e(0xc9)+_0x222765[_0x224b1e(0xd8)]),console['error'](_0x224b1e(0xe7)+_0x51e88d),_0x28b3ee&&console[_0x224b1e(0xce)](_0x224b1e(0xb2)+_0x28b3ee));const _0x329126=await withProgressSpinner('Pulling\x20segments\x20from\x20\x27'+_0x51e88d+_0x224b1e(0xc1),_0x3106a2=>_0x5d2e1b[_0x224b1e(0x9f)][_0x224b1e(0xca)](_0x51e88d,{'targetDir':_0x2c401e,'targetResourceName':_0x28b3ee,'verbose':_0x222765[_0x224b1e(0xe2)],'progress':{'update':_0x406659=>{const _0x39e63e=_0x224b1e;_0x3106a2['setPhase'](_0x406659),_0x222765[_0x39e63e(0xe2)]&&console[_0x39e63e(0xce)]('\x20\x20'+_0x406659);}}}),{'verbose':_0x222765[_0x224b1e(0xe2)]}),_0xef8e6d=_0x329126[_0x224b1e(0xb6)];if(_0xef8e6d[_0x224b1e(0xbc)][_0x224b1e(0xa8)]===0x0&&_0xef8e6d[_0x224b1e(0xbc)][_0x224b1e(0xbe)]===0x0)return console['error'](a40_0xcd0ada[_0x224b1e(0x9c)]('No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27'+_0xef8e6d[_0x224b1e(0x9e)]+'\x27')),0x0;const _0x39df11=_0xef8e6d[_0x224b1e(0xc5)]['filter'](_0x4fe248=>_0x4fe248[_0x224b1e(0xb3)]),_0x2ce984=_0xef8e6d[_0x224b1e(0xc5)][_0x224b1e(0xab)](_0x45944d=>!_0x45944d['isNew']&&_0x45944d[_0x224b1e(0xdf)]),_0xe093d9=_0xef8e6d[_0x224b1e(0xc5)][_0x224b1e(0xab)](_0x10c22f=>!_0x10c22f[_0x224b1e(0xb3)]&&!_0x10c22f[_0x224b1e(0xdf)]);console[_0x224b1e(0xce)]('\x0aPull\x20summary\x20for\x20\x27'+_0xef8e6d['parentName']+'\x27:'),console[_0x224b1e(0xce)]('\x20\x20🎯\x20'+a40_0xcd0ada[_0x224b1e(0xc3)](_0xef8e6d[_0x224b1e(0xbc)]['segments']+_0x224b1e(0xad))+_0x224b1e(0xb7)+a40_0xcd0ada[_0x224b1e(0xc3)](_0xef8e6d[_0x224b1e(0xbc)][_0x224b1e(0xa0)]+_0x224b1e(0xba)));if(_0xef8e6d[_0x224b1e(0xbc)][_0x224b1e(0xbe)]>0x0){const _0x4887aa=_0xef8e6d[_0x224b1e(0xbc)][_0x224b1e(0x9b)]>_0xef8e6d[_0x224b1e(0xbc)][_0x224b1e(0xbe)]?'\x20('+_0xef8e6d[_0x224b1e(0xbc)][_0x224b1e(0x9b)]+_0x224b1e(0x95):'';console[_0x224b1e(0xce)](_0x224b1e(0x9a)+a40_0xcd0ada[_0x224b1e(0xc3)](_0xef8e6d[_0x224b1e(0xbc)][_0x224b1e(0xbe)]+_0x224b1e(0xc8))+a40_0xcd0ada[_0x224b1e(0xd0)](_0x4887aa));}console['error']('\x20\x20'+a40_0xcd0ada[_0x224b1e(0xb5)]('+\x20'+_0x39df11['length']+_0x224b1e(0xdb))),console[_0x224b1e(0xce)]('\x20\x20'+a40_0xcd0ada[_0x224b1e(0x9c)]('~\x20'+_0x2ce984['length']+_0x224b1e(0xc0))),console[_0x224b1e(0xce)]('\x20\x20'+a40_0xcd0ada[_0x224b1e(0xd0)]('=\x20'+_0xe093d9[_0x224b1e(0x97)]+_0x224b1e(0xae))),console[_0x224b1e(0xce)](_0x224b1e(0xd6)+a40_0xcd0ada[_0x224b1e(0xc3)](_0xef8e6d[_0x224b1e(0xa6)])+'\x0a');if(_0x2ce984[_0x224b1e(0x97)]>0x0)for(const _0x583fd2 of _0x2ce984){console[_0x224b1e(0xce)](_0x224b1e(0xcc)+_0x583fd2[_0x224b1e(0x98)]+'\x27:'),console['error']('─'['repeat'](0x3c)),console['error'](_0x583fd2[_0x224b1e(0xa5)]),console[_0x224b1e(0xce)]('─'[_0x224b1e(0x96)](0x3c));}if(_0x222765['dryRun'])return console['error'](a40_0xcd0ada[_0x224b1e(0x9c)](_0x224b1e(0xc6))),0x0;if(_0x39df11[_0x224b1e(0x97)]===0x0&&_0x2ce984[_0x224b1e(0x97)]===0x0)return console[_0x224b1e(0xce)](a40_0xcd0ada[_0x224b1e(0xb5)](_0x224b1e(0xd5))),saveSessionContext({'parent_segment':_0xef8e6d[_0x224b1e(0x9e)]},_0x222765[_0x224b1e(0x93)]),console['error'](a40_0xcd0ada[_0x224b1e(0xb5)]('✔\x20Context\x20set:\x20'+a40_0xcd0ada['dim'](_0x224b1e(0xb8))+_0x224b1e(0xd4)+a40_0xcd0ada[_0x224b1e(0xc3)](_0xef8e6d[_0x224b1e(0x9e)]))),0x0;if(!_0x222765[_0x224b1e(0x9d)]){if(!isInteractive())return console[_0x224b1e(0xce)](a40_0xcd0ada[_0x224b1e(0xd1)](_0x224b1e(0x94)),_0x224b1e(0xac)),console[_0x224b1e(0xce)](a40_0xcd0ada[_0x224b1e(0xd0)](_0x224b1e(0xb0))),0x1;const _0x4ad345=await confirmKey(_0x224b1e(0xc2)+(_0x39df11['length']+_0x2ce984[_0x224b1e(0x97)])+_0x224b1e(0xcd));if(!_0x4ad345)return console[_0x224b1e(0xce)](a40_0xcd0ada['yellow'](_0x224b1e(0xd9)),_0x224b1e(0xc7)),0x1;}for(const _0x4d5464 of _0xef8e6d[_0x224b1e(0xc5)]){if(_0x4d5464['isNew']||_0x4d5464[_0x224b1e(0xdf)]){const _0x52bde0=a40_0x5bbcf2[_0x224b1e(0xe3)](_0x4d5464[_0x224b1e(0xda)]);!existsSync(_0x52bde0)&&mkdirSync(_0x52bde0,{'recursive':!![]}),writeFileSync(_0x4d5464[_0x224b1e(0xda)],_0x4d5464[_0x224b1e(0xdc)],'utf-8');}}return console['error'](a40_0xcd0ada[_0x224b1e(0xb5)](_0x224b1e(0xe0)+(_0x39df11[_0x224b1e(0x97)]+_0x2ce984[_0x224b1e(0x97)])+_0x224b1e(0xcb)+_0xef8e6d[_0x224b1e(0xa6)])),saveSessionContext({'parent_segment':_0xef8e6d[_0x224b1e(0x9e)]},_0x222765[_0x224b1e(0x93)]),console[_0x224b1e(0xce)](a40_0xcd0ada[_0x224b1e(0xb5)](_0x224b1e(0xaf)+a40_0xcd0ada[_0x224b1e(0xd0)](_0x224b1e(0xb8))+_0x224b1e(0xd4)+a40_0xcd0ada[_0x224b1e(0xc3)](_0xef8e6d['parentName']))),0x0;}}
1
+ const a40_0x35e323=a40_0x567a;(function(_0x28a86c,_0x43178f){const _0x3344b0=a40_0x567a,_0x9f279d=_0x28a86c();while(!![]){try{const _0x2386d3=-parseInt(_0x3344b0(0x98))/0x1+parseInt(_0x3344b0(0x83))/0x2*(parseInt(_0x3344b0(0xb5))/0x3)+-parseInt(_0x3344b0(0x8a))/0x4+-parseInt(_0x3344b0(0xcb))/0x5*(parseInt(_0x3344b0(0xc8))/0x6)+-parseInt(_0x3344b0(0x99))/0x7+parseInt(_0x3344b0(0x82))/0x8+parseInt(_0x3344b0(0x93))/0x9;if(_0x2386d3===_0x43178f)break;else _0x9f279d['push'](_0x9f279d['shift']());}catch(_0x287016){_0x9f279d['push'](_0x9f279d['shift']());}}}(a40_0x9614,0x85daf));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{saveSessionContext}from'../core/session.js';function a40_0x567a(_0x34d9d3,_0x29b8e8){_0x34d9d3=_0x34d9d3-0x80;const _0x96140f=a40_0x9614();let _0x567ac5=_0x96140f[_0x34d9d3];return _0x567ac5;}function a40_0x9614(){const _0x1c3c67=['description','diff','helpText','execute','no_parent','setPhase','6ITLoqZ','dim','content','\x20\x20Target:\x20','resourceName','journeyVersions','data','errorCode','Pulling\x20segments\x20from\x20\x27','✔\x20All\x20files\x20are\x20up\x20to\x20date','hasChanges','error','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file','parentName','segment:pull','\x20\x20🗺️\x20\x20','yellow','Aborted.','30DDGtaU','length','✔\x20Context\x20set:\x20','627620cSWyQd','\x0aChanges\x20to\x20\x27','files','3812296dwPANS','1003804onaDfD','\x20files\x20to\x20','Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files','Site:\x20','session','dryRun','Error:\x20','2061624RIveQT','verbose','counts','\x20with\x20','\x0aError:','✔\x20Pulled\x20','segment','segments','repeat','8651754gVHWDz','name','isNew','Write\x20','\x20\x20🎯\x20','251052tDxALX','3495086pRgywb','\x27...','red','utf-8','targetDir','cyan','dirname','\x20journeys','parentSegment','relativePath','journeys','yes','absolutePath','Parent\x20segment:\x20','-\x20no\x20files\x20written','parent_segment','\x0aPull\x20summary\x20for\x20\x27','\x20versions)','\x20=\x20','activations','filter','green'];a40_0x9614=function(){return _0x1c3c67;};return a40_0x9614();}import a40_0x3c4656 from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';import a40_0x1cab3d 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_0x35e323(0x94)]=a40_0x35e323(0xc4);[a40_0x35e323(0xaf)]=a40_0x35e323(0x85);async[a40_0x35e323(0xb2)](_0x3d0417){const _0x101aac=a40_0x35e323,{options:_0x157a76,args:_0xee46ba,tdx:_0x38ff67}=_0x3d0417,_0x497ab6=_0x157a76,_0xc2f810=await resolveTarget({'arg':_0xee46ba[0x0],'contextParent':_0x157a76[_0x101aac(0xa1)],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0xc2f810))return _0xc2f810[_0x101aac(0xbc)]===_0x101aac(0xb3)?(console['error'](a40_0x3c4656[_0x101aac(0xc6)]('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console['error']('Usage:\x20tdx\x20sg\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20(requires\x20context\x20or\x20tdx.json)'),console[_0x101aac(0xc0)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent'),console[_0x101aac(0xc0)](_0x101aac(0xc2))):(console['error'](a40_0x3c4656[_0x101aac(0x9b)](_0x101aac(0x89)+_0xc2f810['message']+'\x0a')),_0xc2f810[_0x101aac(0xb1)]&&console[_0x101aac(0xc0)](a40_0x3c4656[_0x101aac(0x9e)](_0xc2f810[_0x101aac(0xb1)]))),0x1;const _0x303d5c=_0xc2f810[_0x101aac(0xc3)],_0xe096b9=_0xc2f810[_0x101aac(0x9d)],_0x2c215a=_0xc2f810['type']==='file'?_0xc2f810[_0x101aac(0xb9)]:undefined;_0x497ab6[_0x101aac(0x8b)]&&(console[_0x101aac(0xc0)](_0x101aac(0x86)+_0x497ab6['site']),console[_0x101aac(0xc0)](_0x101aac(0xa6)+_0x303d5c),_0x2c215a&&console[_0x101aac(0xc0)]('Target\x20resource:\x20'+_0x2c215a));const _0x496553=await withProgressSpinner(_0x101aac(0xbd)+_0x303d5c+_0x101aac(0x9a),_0x5cf7aa=>_0x38ff67[_0x101aac(0x90)]['pullSegments'](_0x303d5c,{'targetDir':_0xe096b9,'targetResourceName':_0x2c215a,'verbose':_0x497ab6[_0x101aac(0x8b)],'progress':{'update':_0x1e69fb=>{const _0x45f7f6=_0x101aac;_0x5cf7aa[_0x45f7f6(0xb4)](_0x1e69fb),_0x497ab6[_0x45f7f6(0x8b)]&&console[_0x45f7f6(0xc0)]('\x20\x20'+_0x1e69fb);}}}),{'verbose':_0x497ab6[_0x101aac(0x8b)]}),_0x994607=_0x496553[_0x101aac(0xbb)];if(_0x994607['counts'][_0x101aac(0x91)]===0x0&&_0x994607[_0x101aac(0x8c)][_0x101aac(0xa3)]===0x0)return console[_0x101aac(0xc0)](a40_0x3c4656['yellow']('No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27'+_0x994607['parentName']+'\x27')),0x0;const _0x24b72b=_0x994607[_0x101aac(0x81)][_0x101aac(0xad)](_0x4b73ad=>_0x4b73ad[_0x101aac(0x95)]),_0x30b389=_0x994607[_0x101aac(0x81)][_0x101aac(0xad)](_0x409b62=>!_0x409b62[_0x101aac(0x95)]&&_0x409b62[_0x101aac(0xbf)]),_0x37b0e9=_0x994607[_0x101aac(0x81)][_0x101aac(0xad)](_0x5d04c6=>!_0x5d04c6[_0x101aac(0x95)]&&!_0x5d04c6[_0x101aac(0xbf)]);console[_0x101aac(0xc0)](_0x101aac(0xa9)+_0x994607[_0x101aac(0xc3)]+'\x27:'),console[_0x101aac(0xc0)](_0x101aac(0x97)+a40_0x3c4656[_0x101aac(0x9e)](_0x994607[_0x101aac(0x8c)]['segments']+'\x20segments')+_0x101aac(0x8d)+a40_0x3c4656[_0x101aac(0x9e)](_0x994607['counts'][_0x101aac(0xac)]+'\x20activations'));if(_0x994607[_0x101aac(0x8c)][_0x101aac(0xa3)]>0x0){const _0xa48857=_0x994607[_0x101aac(0x8c)]['journeyVersions']>_0x994607[_0x101aac(0x8c)]['journeys']?'\x20('+_0x994607['counts'][_0x101aac(0xba)]+_0x101aac(0xaa):'';console[_0x101aac(0xc0)](_0x101aac(0xc5)+a40_0x3c4656['cyan'](_0x994607['counts'][_0x101aac(0xa3)]+_0x101aac(0xa0))+a40_0x3c4656[_0x101aac(0xb6)](_0xa48857));}console[_0x101aac(0xc0)]('\x20\x20'+a40_0x3c4656[_0x101aac(0xae)]('+\x20'+_0x24b72b[_0x101aac(0xc9)]+'\x20new\x20files')),console['error']('\x20\x20'+a40_0x3c4656[_0x101aac(0xc6)]('~\x20'+_0x30b389[_0x101aac(0xc9)]+'\x20changed\x20files')),console[_0x101aac(0xc0)]('\x20\x20'+a40_0x3c4656['dim']('=\x20'+_0x37b0e9[_0x101aac(0xc9)]+'\x20unchanged\x20files')),console[_0x101aac(0xc0)](_0x101aac(0xb8)+a40_0x3c4656[_0x101aac(0x9e)](_0x994607['targetDir'])+'\x0a');if(_0x30b389[_0x101aac(0xc9)]>0x0)for(const _0x1fef37 of _0x30b389){console['error'](_0x101aac(0x80)+_0x1fef37[_0x101aac(0xa2)]+'\x27:'),console[_0x101aac(0xc0)]('─'[_0x101aac(0x92)](0x3c)),console[_0x101aac(0xc0)](_0x1fef37[_0x101aac(0xb0)]),console[_0x101aac(0xc0)]('─'['repeat'](0x3c));}if(_0x497ab6[_0x101aac(0x88)])return console[_0x101aac(0xc0)](a40_0x3c4656[_0x101aac(0xc6)]('\x0a[Dry\x20run]\x20No\x20files\x20were\x20written')),0x0;if(_0x24b72b[_0x101aac(0xc9)]===0x0&&_0x30b389[_0x101aac(0xc9)]===0x0)return console[_0x101aac(0xc0)](a40_0x3c4656['green'](_0x101aac(0xbe))),saveSessionContext({'parent_segment':_0x994607[_0x101aac(0xc3)]},_0x497ab6[_0x101aac(0x87)]),console[_0x101aac(0xc0)](a40_0x3c4656[_0x101aac(0xae)](_0x101aac(0xca)+a40_0x3c4656[_0x101aac(0xb6)](_0x101aac(0xa8))+_0x101aac(0xab)+a40_0x3c4656[_0x101aac(0x9e)](_0x994607[_0x101aac(0xc3)]))),0x0;if(!_0x497ab6[_0x101aac(0xa4)]){if(!isInteractive())return console[_0x101aac(0xc0)](a40_0x3c4656['red'](_0x101aac(0x8e)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x101aac(0xc0)](a40_0x3c4656[_0x101aac(0xb6)](_0x101aac(0xc1))),0x1;const _0xb48a04=await confirmKey(_0x101aac(0x96)+(_0x24b72b[_0x101aac(0xc9)]+_0x30b389[_0x101aac(0xc9)])+'\x20files?');if(!_0xb48a04)return console['error'](a40_0x3c4656[_0x101aac(0xc6)](_0x101aac(0xc7)),_0x101aac(0xa7)),0x1;}for(const _0x447807 of _0x994607[_0x101aac(0x81)]){if(_0x447807['isNew']||_0x447807[_0x101aac(0xbf)]){const _0x406df8=a40_0x1cab3d[_0x101aac(0x9f)](_0x447807[_0x101aac(0xa5)]);!existsSync(_0x406df8)&&mkdirSync(_0x406df8,{'recursive':!![]}),writeFileSync(_0x447807[_0x101aac(0xa5)],_0x447807[_0x101aac(0xb7)],_0x101aac(0x9c));}}return console[_0x101aac(0xc0)](a40_0x3c4656[_0x101aac(0xae)](_0x101aac(0x8f)+(_0x24b72b['length']+_0x30b389[_0x101aac(0xc9)])+_0x101aac(0x84)+_0x994607[_0x101aac(0x9d)])),saveSessionContext({'parent_segment':_0x994607[_0x101aac(0xc3)]},_0x497ab6[_0x101aac(0x87)]),console[_0x101aac(0xc0)](a40_0x3c4656[_0x101aac(0xae)]('✔\x20Context\x20set:\x20'+a40_0x3c4656[_0x101aac(0xb6)](_0x101aac(0xa8))+_0x101aac(0xab)+a40_0x3c4656[_0x101aac(0x9e)](_0x994607[_0x101aac(0xc3)]))),0x0;}}
@@ -1 +1 @@
1
- const a41_0x2408bd=a41_0x3e83;(function(_0x334c63,_0x126ed1){const _0x3b1c5d=a41_0x3e83,_0x2d4033=_0x334c63();while(!![]){try{const _0x4ff3be=-parseInt(_0x3b1c5d(0x17f))/0x1*(-parseInt(_0x3b1c5d(0x13b))/0x2)+-parseInt(_0x3b1c5d(0x164))/0x3+parseInt(_0x3b1c5d(0x155))/0x4+parseInt(_0x3b1c5d(0x148))/0x5+-parseInt(_0x3b1c5d(0x1bf))/0x6+parseInt(_0x3b1c5d(0x14f))/0x7+parseInt(_0x3b1c5d(0x16d))/0x8*(-parseInt(_0x3b1c5d(0x14a))/0x9);if(_0x4ff3be===_0x126ed1)break;else _0x2d4033['push'](_0x2d4033['shift']());}catch(_0x326a70){_0x2d4033['push'](_0x2d4033['shift']());}}}(a41_0x448b,0x9694d));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_0x448b(){const _0x21fe30=['map','\x20to\x20create','red','Fetching\x20connections\x20for\x20name\x20resolution...','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file','createdAt','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','green','\x20to\x20delete','✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','file','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','\x20\x20Activations:','1313970UUprsd','Preparing\x20journeys...','listSegments','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','/sb/da/esr','results','changed','.yml','/e/','8sFeDTL','filePath','Changes\x20to:','journeys','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','push','📁\x20','name','Aborted.','all','\x20changed','site','attributes','description','Delete\x20journey:','length','listActivations','\x0aError:','304279gKLDGV','\x20deleted','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','Fetching\x20existing\x20activations...','buildUserMaps','segmentFolderId','toUpdate','setPhase','\x20\x20Source:\x20','Resolving\x20parent\x20segment\x20\x27','isNew','getJourney','\x20changes?','\x27...','diff','getOutputSchemaWithCache','yellow','No\x20','\x20created','filter','journey','delete','parent_name','helpText','\x20\x20📊\x20Segments:','join','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','data','Site:\x20','unchanged','relationships','Fetching\x20existing\x20data...','journeyId','endsWith','\x20to\x20update','state','scopedFolderPath','list','created','\x0aPush\x20summary\x20for\x20\x27','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','segment\x20or\x20journey','journeysOnly','then','\x20\x20\x20\x20','dryRun','toCreate','journeyBundleId','connection','repeat','Source\x20directory:\x20','/j/da/je','paused','parentFolder','createdSegmentIds','yamlConfig','segment:push','activations','versionNumber','Error:\x20Directory\x20not\x20found:\x20','error','segment','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20','6297174GhcRML','blue','/app/ps/','getParent','updated','get','\x20new','\x0a✔\x20Push\x20complete','\x20unchanged','updatedAt','idToName','type','verbose','message','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','\x20updated','\x20activations]','\x20\x20Segments:\x20','New\x20journey:','Parent\x20segment:\x20','nameToType','targetDir','nameToId','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','dim','2bKaARW','add','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','folderPath','Error\x20parsing\x20YAML:\x20','existingJourney','user','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','Folders\x20to\x20create:','Changes\x20to\x20journey:','set','cyan','\x20\x20Journeys:\x20','5483090ouJinY','deleted','5118273ywLMri','existingSegment','journeyBundleName','segments','errorCode','3278177flqLme','Push\x20','toDelete','listJourneysWithDetailsFromParentSegment','audienceId','folderId','3215156HsuIID','\x20YAML\x20files\x20found'];a41_0x448b=function(){return _0x21fe30;};return a41_0x448b();}import{batchAsync}from'../utils/async.js';import{segmentToYamlString,segmentWithActivationsToYaml}from'../sdk/segment/child-segment-yaml.js';import a41_0x46066a 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_0x3e83(_0x357c84,_0x315580){_0x357c84=_0x357c84-0x125;const _0x448b39=a41_0x448b();let _0x3e83fd=_0x448b39[_0x357c84];return _0x3e83fd;}import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{resolveTDFolderPath,findSegmentsToDelete,findJourneysToDelete,buildSegmentLookupMap,buildSegmentNameToIdMap,buildJourneyBundleLookupMap,parseAndClassifyYamlFiles,validateParsedFiles,formatValidationErrors,extractRootFolderId,buildConnectionMaps,calculatePushStats,prepareSegmentFiles,prepareJourneyFiles,executePushSegments,executePushFolders,executePushSegmentDeletions,executePushJourneys}from'../sdk/segment/push-workflow.js';export class SegmentPushCommand extends BaseCommand{['name']=a41_0x2408bd(0x1b7);[a41_0x2408bd(0x17a)]='Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments';async['execute'](_0xfc5549){const _0x24219b=a41_0x2408bd,{options:_0x5d7fe9,args:_0x3a1cf7,tdx:_0x44512e}=_0xfc5549,_0x5a9c2e=_0x5d7fe9,_0x5d296c=await resolveTarget({'arg':_0x3a1cf7[0x0],'contextParent':_0x5d7fe9['parentSegment'],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x5d296c))return _0x5d296c[_0x24219b(0x14e)]==='no_parent'?(console[_0x24219b(0x1bb)](a41_0x46066a[_0x24219b(0x18f)](_0x24219b(0x181))),console[_0x24219b(0x1bb)]('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[_0x24219b(0x1bb)](_0x24219b(0x199)),console[_0x24219b(0x1bb)](_0x24219b(0x15b))):(console[_0x24219b(0x1bb)](a41_0x46066a[_0x24219b(0x159)]('Error:\x20'+_0x5d296c[_0x24219b(0x12f)]+'\x0a')),_0x5d296c[_0x24219b(0x196)]&&console[_0x24219b(0x1bb)](a41_0x46066a['cyan'](_0x5d296c[_0x24219b(0x196)]))),0x1;if(_0x5d296c[_0x24219b(0x12d)]===_0x24219b(0x195))return console['error'](a41_0x46066a['red'](_0x24219b(0x1ba)+_0x5d296c[_0x24219b(0x137)]+'\x0a')),console[_0x24219b(0x1bb)](a41_0x46066a[_0x24219b(0x146)](_0x24219b(0x162))),0x1;const _0x834f20=_0x5d296c['parentName'],_0x38fb90=_0x5d296c[_0x24219b(0x137)],_0x22ee5f=_0x5d296c[_0x24219b(0x12d)]===_0x24219b(0x161)?_0x5d296c[_0x24219b(0x16e)]:undefined,_0x4b8e5d=getScopedDetails(_0x5d296c),_0x4a4f0e=_0x4b8e5d?.['isScoped']??![],_0x59187d=_0x4b8e5d?.[_0x24219b(0x1a3)]??'';if(!existsSync(_0x38fb90))return console[_0x24219b(0x1bb)](a41_0x46066a[_0x24219b(0x159)](_0x24219b(0x1ba)+_0x38fb90+'\x0a')),console[_0x24219b(0x1bb)](a41_0x46066a[_0x24219b(0x146)](_0x24219b(0x162))),0x1;_0x5a9c2e[_0x24219b(0x12e)]&&(console[_0x24219b(0x1bb)](_0x24219b(0x19b)+_0x5a9c2e[_0x24219b(0x178)]),console[_0x24219b(0x1bb)](_0x24219b(0x135)+_0x834f20),console['error'](_0x24219b(0x1b1)+_0x38fb90),_0x4a4f0e&&console['error']('Scoped\x20to\x20folder:\x20'+_0x59187d));const _0x4c7f65=await withSpinner(_0x24219b(0x188)+_0x834f20+_0x24219b(0x18c),()=>_0x44512e[_0x24219b(0x1bc)]['resolveParentId'](_0x834f20),{'verbose':_0x5a9c2e[_0x24219b(0x12e)]}),_0x6ca344=_0x4c7f65[_0x24219b(0x19a)],{parentSegmentResult:_0x398205,segmentsResult:_0x166cb4,foldersResult:_0x152881,journeysWithDetailsResult:_0xec01b9,userMaps:_0x5b050b}=await withSpinner(_0x24219b(0x19e),async()=>{const _0x5bc078=_0x24219b,[_0x5b6661,_0x261cd3,_0x3b5406,_0x34336f,_0x31068c]=await Promise[_0x5bc078(0x176)]([_0x44512e[_0x5bc078(0x1bc)][_0x5bc078(0x125)](_0x6ca344),_0x44512e[_0x5bc078(0x1bc)][_0x5bc078(0x166)](_0x6ca344),_0x44512e[_0x5bc078(0x1bc)]['listFolders'](_0x6ca344),_0x44512e[_0x5bc078(0x193)][_0x5bc078(0x152)](_0x6ca344,{'includeAllVersions':!![]}),_0x44512e[_0x5bc078(0x141)][_0x5bc078(0x183)]()]);return{'parentSegmentResult':_0x5b6661,'segmentsResult':_0x261cd3,'foldersResult':_0x3b5406,'journeysWithDetailsResult':_0x34336f,'userMaps':_0x31068c};},{'verbose':_0x5a9c2e[_0x24219b(0x12e)]})[_0x24219b(0x1aa)](_0x425eb5=>_0x425eb5[_0x24219b(0x19a)]),_0x39113f=_0x398205,_0x1ac8ff=extractRootFolderId(_0x39113f),_0x455aa9=_0x166cb4,_0x425941=_0x152881,{journeys:_0x36d05a,activationStepsById:_0x38dbf8}=_0xec01b9,_0xce8491=new Map(_0x36d05a[_0x24219b(0x157)](_0x87aeaa=>[_0x87aeaa['id'],_0x87aeaa])),_0x3ab3fa=_0x36d05a['map'](_0x1375ac=>({'id':_0x1375ac['id'],'name':_0x1375ac[_0x24219b(0x179)]['name'],'journeyBundleName':_0x1375ac[_0x24219b(0x179)][_0x24219b(0x14c)]||'','journeyBundleId':_0x1375ac[_0x24219b(0x179)][_0x24219b(0x1ae)]||'','versionNumber':_0x1375ac['attributes'][_0x24219b(0x1b9)],'description':_0x1375ac[_0x24219b(0x179)][_0x24219b(0x17a)],'state':_0x1375ac[_0x24219b(0x179)][_0x24219b(0x1a2)],'paused':_0x1375ac[_0x24219b(0x179)][_0x24219b(0x1b3)],'audienceId':_0x1375ac[_0x24219b(0x179)][_0x24219b(0x153)],'folderId':_0x1375ac[_0x24219b(0x19d)]?.[_0x24219b(0x1b4)]?.['data']?.['id'],'createdAt':_0x1375ac['attributes'][_0x24219b(0x15c)],'updatedAt':_0x1375ac[_0x24219b(0x179)][_0x24219b(0x12b)]})),{emailToId:_0xaae62d,idToEmail:_0x2ccfbe}=_0x5b050b,_0x1ba944=await withSpinner(_0x24219b(0x15a),async()=>{const _0x4ed796=_0x24219b,_0xe3f1e8=await _0x44512e[_0x4ed796(0x1af)][_0x4ed796(0x1a4)]();return buildConnectionMaps(_0xe3f1e8);},{'verbose':_0x5a9c2e['verbose']})[_0x24219b(0x1aa)](_0x3b66dc=>_0x3b66dc['data']),_0x197f63=_0x1ba944[_0x24219b(0x138)],_0x38fa08=_0x1ba944[_0x24219b(0x12c)],_0x4cd206=_0x1ba944[_0x24219b(0x136)],_0x2516bc={'emailToIdMap':_0xaae62d,'connectionNameToIdMap':_0x197f63,'connectionNameToTypeMap':_0x4cd206,'getSchema':_0x575ce7=>_0x44512e[_0x24219b(0x1af)][_0x24219b(0x18e)](_0x575ce7)};let {pathToId:_0x2a4cb7,idToPath:_0x413306}=buildFolderMaps(_0x425941);const _0x4273d5=buildSegmentLookupMap(_0x455aa9,_0x413306),_0x2c5e40=buildSegmentNameToIdMap(_0x455aa9),_0x15a78b=buildJourneyBundleLookupMap(_0x3ab3fa,_0x413306);let _0x1317a2;if(_0x22ee5f){if(!_0x22ee5f[_0x24219b(0x1a0)](_0x24219b(0x16b))&&!_0x22ee5f[_0x24219b(0x1a0)]('.yaml'))return console['error'](a41_0x46066a['red'](_0x24219b(0x167)+_0x22ee5f+'\x0a')),0x1;_0x1317a2=[_0x22ee5f];}else _0x1317a2=findYamlFiles(_0x38fb90);if(_0x1317a2[_0x24219b(0x17c)]===0x0)return console[_0x24219b(0x1bb)](a41_0x46066a[_0x24219b(0x159)](_0x24219b(0x171)+_0x38fb90+'\x0a')),console[_0x24219b(0x1bb)](a41_0x46066a[_0x24219b(0x146)](_0x24219b(0x1bd))),0x1;let _0xe3bacd,_0x55e101;try{const _0xc8ea77=parseAndClassifyYamlFiles(_0x1317a2,_0x38fb90,{'skipSegments':_0x5a9c2e['journeysOnly']});_0xe3bacd=_0xc8ea77[_0x24219b(0x14d)],_0x55e101=_0xc8ea77[_0x24219b(0x170)];const _0x20b832=validateParsedFiles(_0xc8ea77,_0x38fb90);if(_0x20b832['length']>0x0)return console[_0x24219b(0x1bb)](a41_0x46066a[_0x24219b(0x159)]('\x0aValidation\x20failed:')),console['error'](formatValidationErrors(_0x20b832)),console['error'](a41_0x46066a[_0x24219b(0x18f)](_0x24219b(0x1a7))),0x1;}catch(_0x278a1b){return console[_0x24219b(0x1bb)](a41_0x46066a[_0x24219b(0x159)](_0x24219b(0x13f)+(_0x278a1b instanceof Error?_0x278a1b['message']:_0x278a1b))),0x1;}if(_0xe3bacd['length']===0x0&&_0x55e101[_0x24219b(0x17c)]===0x0){const _0x2653b8=_0x5a9c2e[_0x24219b(0x1a9)]?_0x24219b(0x193):_0x24219b(0x1a8);return console[_0x24219b(0x1bb)](a41_0x46066a[_0x24219b(0x18f)](_0x24219b(0x190)+_0x2653b8+_0x24219b(0x156))),0x0;}const _0x42af00=new Map();_0x455aa9[_0x24219b(0x17c)]>0x0&&!_0x5a9c2e[_0x24219b(0x1a9)]&&await withSpinner(_0x24219b(0x182),async()=>{await batchAsync(_0x455aa9,async _0x45da42=>{const _0x7ebb1a=a41_0x3e83,_0x4297c1=await _0x44512e[_0x7ebb1a(0x1bc)][_0x7ebb1a(0x17d)](_0x6ca344,_0x45da42['id']);_0x42af00[_0x7ebb1a(0x145)](_0x45da42['id'],_0x4297c1);});},{'verbose':_0x5a9c2e[_0x24219b(0x12e)]});const {segmentFiles:_0x4438d2,foldersToCreate:_0x54659c}=await prepareSegmentFiles(_0xe3bacd,{'segmentByFolderAndName':_0x4273d5,'activationsBySegmentId':_0x42af00,'folderPathToId':_0x2a4cb7,'idToEmailMap':_0x2ccfbe,'connectionIdToNameMap':_0x38fa08},_0x2516bc,_0x4a4f0e,_0x59187d),_0x53716f=_0x22ee5f?[]:findSegmentsToDelete(_0x455aa9,_0xe3bacd['map'](({yamlConfig:_0x14575c,folderPath:_0x42fe68})=>({'yamlConfig':_0x14575c,'folderPath':resolveTDFolderPath(_0x42fe68,_0x4a4f0e,_0x59187d)})),_0x413306,_0x59187d,_0x4a4f0e),{journeyFiles:_0x1e7b16,foldersToCreate:_0x57f494}=await withProgressSpinner(_0x24219b(0x165),async _0x2997f1=>prepareJourneyFiles(_0x55e101,{'fetchJourney':async _0x52aa8a=>_0x44512e[_0x24219b(0x193)][_0x24219b(0x18a)](_0x52aa8a[_0x24219b(0x19f)]),'journeyBundlesByFolderAndName':_0x15a78b,'folderPathToId':_0x2a4cb7,'idToEmailMap':_0x2ccfbe,'connectionIdToNameMap':_0x38fa08,'existingSegments':_0x455aa9,'parentId':_0x6ca344,'deps':_0x44512e,'progress':{'update':_0x350ce3=>{const _0x5165fb=_0x24219b;_0x2997f1[_0x5165fb(0x186)](_0x350ce3),_0x5a9c2e[_0x5165fb(0x12e)]&&console[_0x5165fb(0x1bb)]('\x20\x20'+_0x350ce3);}},'journeyById':_0xce8491,'activationStepsById':_0x38dbf8},_0x4a4f0e,_0x59187d),{'verbose':_0x5a9c2e[_0x24219b(0x12e)]})['then'](_0x579029=>_0x579029['data']);for(const _0x4017f5 of _0x57f494){_0x54659c[_0x24219b(0x13c)](_0x4017f5);}const _0x36fa46=_0x22ee5f?[]:findJourneysToDelete(_0x3ab3fa,_0x55e101['map'](({yamlConfig:_0x33a405,folderPath:_0x3eaf33})=>({'yamlConfig':_0x33a405,'folderPath':resolveTDFolderPath(_0x3eaf33,_0x4a4f0e,_0x59187d)})),_0x413306,_0x59187d,_0x4a4f0e),_0x496e74=calculatePushStats(_0x4438d2,_0x1e7b16,_0x54659c,_0x53716f,_0x36fa46,!!_0x5a9c2e['delete'],!!_0x5a9c2e[_0x24219b(0x1a9)]),_0x24a90a=_0x496e74[_0x24219b(0x14d)]['new'],_0x26217b=_0x496e74[_0x24219b(0x14d)]['changed'],_0x36a627=_0x496e74[_0x24219b(0x14d)][_0x24219b(0x19c)],_0x32c551=_0x496e74[_0x24219b(0x14d)][_0x24219b(0x151)],_0x276a3b=_0x496e74['folders'][_0x24219b(0x1ad)],_0x14438c=_0x496e74[_0x24219b(0x170)]['new'],_0x3645c9=_0x496e74[_0x24219b(0x170)][_0x24219b(0x16a)],_0x3fffa4=_0x496e74[_0x24219b(0x170)][_0x24219b(0x19c)],_0x129404=_0x496e74[_0x24219b(0x170)][_0x24219b(0x151)],_0x5d5d1a=_0x496e74[_0x24219b(0x1b8)][_0x24219b(0x176)],_0x4e0b8c=_0x496e74[_0x24219b(0x1b8)][_0x24219b(0x1ad)],_0x4cd435=_0x496e74[_0x24219b(0x1b8)][_0x24219b(0x185)],_0x225009=_0x496e74['activations'][_0x24219b(0x151)];console[_0x24219b(0x1bb)](_0x24219b(0x1a6)+_0x834f20+'\x27:');_0x276a3b[_0x24219b(0x17c)]>0x0&&console[_0x24219b(0x1bb)]('\x20\x20'+a41_0x46066a[_0x24219b(0x1c0)](_0x24219b(0x173)+_0x276a3b[_0x24219b(0x17c)]+'\x20folders\x20to\x20create'));if(!_0x5a9c2e[_0x24219b(0x1a9)]){console['error'](_0x24219b(0x197)),console[_0x24219b(0x1bb)](_0x24219b(0x1ab)+a41_0x46066a[_0x24219b(0x15e)]('+\x20'+_0x24a90a[_0x24219b(0x17c)]+_0x24219b(0x128))),console[_0x24219b(0x1bb)](_0x24219b(0x1ab)+a41_0x46066a['yellow']('~\x20'+_0x26217b[_0x24219b(0x17c)]+_0x24219b(0x177)));if(_0x32c551['length']>0x0)console['error'](_0x24219b(0x1ab)+a41_0x46066a[_0x24219b(0x159)]('-\x20'+_0x32c551[_0x24219b(0x17c)]+'\x20to\x20delete'));else _0x53716f[_0x24219b(0x17c)]>0x0&&!_0x5a9c2e[_0x24219b(0x194)]&&console[_0x24219b(0x1bb)]('\x20\x20\x20\x20'+a41_0x46066a[_0x24219b(0x13a)](_0x53716f['length']+_0x24219b(0x13d)));console['error'](_0x24219b(0x1ab)+a41_0x46066a['dim']('=\x20'+_0x36a627['length']+_0x24219b(0x12a)));}if(_0x1e7b16[_0x24219b(0x17c)]>0x0||_0x36fa46[_0x24219b(0x17c)]>0x0){console['error']('\x20\x20🗺️\x20\x20Journeys:'),console['error'](_0x24219b(0x1ab)+a41_0x46066a[_0x24219b(0x15e)]('+\x20'+_0x14438c[_0x24219b(0x17c)]+_0x24219b(0x128))),console['error']('\x20\x20\x20\x20'+a41_0x46066a[_0x24219b(0x18f)]('~\x20'+_0x3645c9[_0x24219b(0x17c)]+'\x20changed'));if(_0x129404[_0x24219b(0x17c)]>0x0)console['error'](_0x24219b(0x1ab)+a41_0x46066a[_0x24219b(0x159)]('-\x20'+_0x129404[_0x24219b(0x17c)]+_0x24219b(0x15f)));else _0x36fa46[_0x24219b(0x17c)]>0x0&&!_0x5a9c2e[_0x24219b(0x194)]&&console['error'](_0x24219b(0x1ab)+a41_0x46066a[_0x24219b(0x13a)](_0x36fa46[_0x24219b(0x17c)]+_0x24219b(0x13d)));console[_0x24219b(0x1bb)]('\x20\x20\x20\x20'+a41_0x46066a[_0x24219b(0x13a)]('=\x20'+_0x3fffa4['length']+'\x20unchanged'));}_0x5d5d1a['length']>0x0&&!_0x5a9c2e[_0x24219b(0x1a9)]&&(console['error'](''),console[_0x24219b(0x1bb)](_0x24219b(0x163)),_0x4e0b8c[_0x24219b(0x17c)]>0x0&&console[_0x24219b(0x1bb)](_0x24219b(0x1ab)+a41_0x46066a[_0x24219b(0x15e)]('+\x20'+_0x4e0b8c[_0x24219b(0x17c)]+_0x24219b(0x158))),_0x4cd435[_0x24219b(0x17c)]>0x0&&console[_0x24219b(0x1bb)]('\x20\x20\x20\x20'+a41_0x46066a['yellow']('~\x20'+_0x4cd435[_0x24219b(0x17c)]+_0x24219b(0x1a1))),_0x225009[_0x24219b(0x17c)]>0x0&&console['error']('\x20\x20\x20\x20'+a41_0x46066a[_0x24219b(0x159)]('-\x20'+_0x225009[_0x24219b(0x17c)]+_0x24219b(0x15f))));console[_0x24219b(0x1bb)](_0x24219b(0x187)+a41_0x46066a[_0x24219b(0x146)](_0x38fb90)+'\x0a');if(_0x276a3b[_0x24219b(0x17c)]>0x0){console['error'](_0x24219b(0x143));for(const _0x281c9b of _0x276a3b){console[_0x24219b(0x1bb)]('\x20\x20'+a41_0x46066a[_0x24219b(0x1c0)]('+')+'\x20'+_0x281c9b);}console[_0x24219b(0x1bb)]('');}if(_0x24a90a['length']>0x0&&!_0x5a9c2e['journeysOnly'])for(const _0x1e4272 of _0x24a90a){const _0x2c1683=_0x1e4272['folderPath']?_0x1e4272[_0x24219b(0x13e)]+'/'+_0x1e4272['yamlConfig'][_0x24219b(0x174)]:_0x1e4272[_0x24219b(0x1b6)][_0x24219b(0x174)],_0x4b1b42=_0x1e4272['yamlConfig']['activations']?.[_0x24219b(0x17c)]||0x0,_0x14c2d0=_0x4b1b42>0x0?a41_0x46066a[_0x24219b(0x13a)]('\x20['+_0x4b1b42+_0x24219b(0x132)):'';console[_0x24219b(0x1bb)]('\x0a'+a41_0x46066a[_0x24219b(0x15e)]('New\x20segment:')+'\x20'+_0x2c1683+_0x14c2d0),console[_0x24219b(0x1bb)]('─'['repeat'](0x3c)),_0x1e4272[_0x24219b(0x18d)]&&console[_0x24219b(0x1bb)](_0x1e4272[_0x24219b(0x18d)]),console[_0x24219b(0x1bb)]('─'[_0x24219b(0x1b0)](0x3c));}if(_0x32c551[_0x24219b(0x17c)]>0x0&&!_0x5a9c2e[_0x24219b(0x1a9)])for(const _0x3ffbc8 of _0x32c551){const _0x1c1fa0=_0x3ffbc8[_0x24219b(0x184)]?_0x413306[_0x24219b(0x127)](_0x3ffbc8[_0x24219b(0x184)]['toString']())||'':'',_0x53f23a=_0x1c1fa0?_0x1c1fa0+'/'+_0x3ffbc8['name']:_0x3ffbc8[_0x24219b(0x174)],_0x389d8f=_0x42af00[_0x24219b(0x127)](_0x3ffbc8['id'])||[],_0x2473b5=_0x389d8f[_0x24219b(0x17c)]>0x0?a41_0x46066a['dim']('\x20['+_0x389d8f['length']+_0x24219b(0x132)):'';console['error']('\x0a'+a41_0x46066a[_0x24219b(0x159)]('Delete\x20segment:')+'\x20'+_0x53f23a+_0x2473b5),console[_0x24219b(0x1bb)]('─'[_0x24219b(0x1b0)](0x3c));const _0xf8d4e5=segmentWithActivationsToYaml(_0x3ffbc8,_0x389d8f,undefined,_0x2ccfbe,_0x38fa08),_0x29dbc0=segmentToYamlString(_0xf8d4e5),_0x5a2c0a=generateDiff(_0x29dbc0,'');console[_0x24219b(0x1bb)](formatDiffWithColors(_0x5a2c0a)),console[_0x24219b(0x1bb)]('─'[_0x24219b(0x1b0)](0x3c));}const _0x1adf3b=_0x4438d2[_0x24219b(0x192)](_0x28497a=>!_0x28497a[_0x24219b(0x189)]&&_0x28497a[_0x24219b(0x18d)]);if(_0x1adf3b['length']>0x0&&!_0x5a9c2e[_0x24219b(0x1a9)])for(const _0x11a274 of _0x1adf3b){const _0x551dc5=_0x11a274[_0x24219b(0x13e)]?_0x11a274[_0x24219b(0x13e)]+'/'+_0x11a274['yamlConfig'][_0x24219b(0x174)]:_0x11a274[_0x24219b(0x1b6)]['name'];console[_0x24219b(0x1bb)]('\x0a'+a41_0x46066a['yellow'](_0x24219b(0x16f))+'\x20'+_0x551dc5),console[_0x24219b(0x1bb)]('─'[_0x24219b(0x1b0)](0x3c)),console[_0x24219b(0x1bb)](_0x11a274[_0x24219b(0x18d)]),console[_0x24219b(0x1bb)]('─'[_0x24219b(0x1b0)](0x3c));}if(_0x14438c[_0x24219b(0x17c)]>0x0)for(const _0x14da87 of _0x14438c){const _0x17b345=_0x14da87[_0x24219b(0x13e)]?_0x14da87[_0x24219b(0x13e)]+'/'+_0x14da87[_0x24219b(0x1b6)][_0x24219b(0x174)]:_0x14da87[_0x24219b(0x1b6)][_0x24219b(0x174)];console[_0x24219b(0x1bb)]('\x0a'+a41_0x46066a[_0x24219b(0x15e)](_0x24219b(0x134))+'\x20'+_0x17b345),console[_0x24219b(0x1bb)]('─'[_0x24219b(0x1b0)](0x3c)),_0x14da87['diff']&&console['error'](_0x14da87[_0x24219b(0x18d)]),console['error']('─'['repeat'](0x3c));}const _0x2e582a=_0x1e7b16['filter'](_0x3c87cb=>!_0x3c87cb[_0x24219b(0x189)]&&_0x3c87cb[_0x24219b(0x18d)]);if(_0x2e582a[_0x24219b(0x17c)]>0x0)for(const _0x631c15 of _0x2e582a){const _0xeb1456=_0x631c15[_0x24219b(0x13e)]?_0x631c15[_0x24219b(0x13e)]+'/'+_0x631c15[_0x24219b(0x1b6)][_0x24219b(0x174)]:_0x631c15[_0x24219b(0x1b6)]['name'];console[_0x24219b(0x1bb)]('\x0a'+a41_0x46066a[_0x24219b(0x18f)](_0x24219b(0x144))+'\x20'+_0xeb1456),console[_0x24219b(0x1bb)]('─'[_0x24219b(0x1b0)](0x3c)),console['error'](_0x631c15[_0x24219b(0x18d)]),console[_0x24219b(0x1bb)]('─'[_0x24219b(0x1b0)](0x3c));}if(_0x129404['length']>0x0)for(const _0x2f3aa0 of _0x129404){const _0x1326eb=_0x2f3aa0['folderId']?_0x413306['get'](_0x2f3aa0[_0x24219b(0x154)])||'':'',_0x3378f4=_0x1326eb?_0x1326eb+'/'+_0x2f3aa0['journeyBundleName']:_0x2f3aa0[_0x24219b(0x14c)];console[_0x24219b(0x1bb)]('\x0a'+a41_0x46066a['red'](_0x24219b(0x17b))+'\x20'+_0x3378f4),console[_0x24219b(0x1bb)]('─'['repeat'](0x3c)),console[_0x24219b(0x1bb)](a41_0x46066a[_0x24219b(0x159)]('(Journey\x20will\x20be\x20deleted)')),console[_0x24219b(0x1bb)]('─'[_0x24219b(0x1b0)](0x3c));}if(_0x5a9c2e[_0x24219b(0x1ac)])return console[_0x24219b(0x1bb)](a41_0x46066a[_0x24219b(0x18f)](_0x24219b(0x130))),0x0;const _0x4e1a90=_0x5a9c2e[_0x24219b(0x1a9)]?![]:_0x24a90a[_0x24219b(0x17c)]>0x0||_0x26217b[_0x24219b(0x17c)]>0x0||_0x32c551[_0x24219b(0x17c)]>0x0,_0xdc96d3=_0x14438c[_0x24219b(0x17c)]>0x0||_0x3645c9[_0x24219b(0x17c)]>0x0||_0x129404[_0x24219b(0x17c)]>0x0,_0x250fb4=_0x5a9c2e[_0x24219b(0x1a9)]?![]:_0x5d5d1a['length']>0x0,_0x519ed3=_0x276a3b[_0x24219b(0x17c)]>0x0;if(!_0x4e1a90&&!_0xdc96d3&&!_0x250fb4&&!_0x519ed3){const _0x5470c9=_0x5a9c2e[_0x24219b(0x1a9)]?'✔\x20All\x20journeys\x20are\x20up\x20to\x20date':_0x24219b(0x160);console['error'](a41_0x46066a['green'](_0x5470c9));if(_0x22ee5f&&_0x36a627[_0x24219b(0x17c)]===0x1){const _0x4747cc=_0x36a627[0x0];if(_0x4747cc['existingSegment']?.['id']){const _0x5a7c78=getConsoleNextUrl(_0x5a9c2e[_0x24219b(0x178)],_0x24219b(0x1c1)+_0x6ca344+_0x24219b(0x16c)+_0x4747cc[_0x24219b(0x14b)]['id']+'/sb/da/esr');console[_0x24219b(0x1bb)](_0x24219b(0x1be)+a41_0x46066a[_0x24219b(0x146)](_0x5a7c78));}}if(_0x22ee5f&&_0x3fffa4[_0x24219b(0x17c)]===0x1){const _0x5b47b7=_0x3fffa4[0x0];if(_0x5b47b7[_0x24219b(0x140)]?.['id']){const _0x1bf2d9=getConsoleNextUrl(_0x5a9c2e[_0x24219b(0x178)],_0x24219b(0x1c1)+_0x6ca344+_0x24219b(0x16c)+_0x5b47b7['existingJourney']['id']+'/j/da/je');console[_0x24219b(0x1bb)]('\x20\x20'+a41_0x46066a['cyan'](_0x1bf2d9));}}return 0x0;}const _0x290aab=_0x5a9c2e[_0x24219b(0x1a9)]?_0x14438c[_0x24219b(0x17c)]+_0x3645c9[_0x24219b(0x17c)]+_0x129404[_0x24219b(0x17c)]+_0x276a3b['length']:_0x24a90a['length']+_0x26217b[_0x24219b(0x17c)]+_0x32c551[_0x24219b(0x17c)]+_0x14438c[_0x24219b(0x17c)]+_0x3645c9['length']+_0x129404['length']+_0x276a3b['length']+_0x5d5d1a[_0x24219b(0x17c)];if(!_0x5a9c2e['yes']&&_0x290aab>0x0){if(!isInteractive())return console[_0x24219b(0x1bb)](a41_0x46066a['red'](_0x24219b(0x17e)),_0x24219b(0x15d)),console[_0x24219b(0x1bb)](a41_0x46066a[_0x24219b(0x13a)](_0x24219b(0x142))),0x1;const _0x11c173=await confirmKey(_0x24219b(0x150)+_0x290aab+_0x24219b(0x18b));if(!_0x11c173)return console[_0x24219b(0x1bb)](a41_0x46066a[_0x24219b(0x18f)](_0x24219b(0x175))),0x1;}const _0x442822={'withProgress':async(_0x48be0a,_0x31085d)=>{const _0x57c190=_0x24219b,_0x27913=await withSpinner(_0x48be0a,_0x31085d,{'verbose':_0x5a9c2e[_0x57c190(0x12e)]});return{'data':_0x27913['data']};},'logInfo':_0x1a38af=>console[_0x24219b(0x1bb)](a41_0x46066a['blue']('✔\x20'+_0x1a38af)),'logSuccess':_0x5a8839=>console[_0x24219b(0x1bb)](a41_0x46066a[_0x24219b(0x15e)]('✔\x20'+_0x5a8839)),'logWarning':_0x3a1318=>console[_0x24219b(0x1bb)](a41_0x46066a[_0x24219b(0x18f)]('⚠\x20'+_0x3a1318)),'logDeleted':_0x4ebbd6=>console['error'](a41_0x46066a['red']('✔\x20'+_0x4ebbd6))},_0x558628={'segment':_0x44512e[_0x24219b(0x1bc)],'journey':_0x44512e[_0x24219b(0x193)],'user':_0x44512e[_0x24219b(0x141)],'connection':_0x44512e[_0x24219b(0x1af)]};_0x276a3b[_0x24219b(0x17c)]>0x0&&(_0x2a4cb7=await executePushFolders(_0x558628,_0x276a3b,_0x2a4cb7,{'parentId':_0x6ca344},_0x442822));const _0x2e8956={'rootFolderId':_0x1ac8ff,'folderPathToId':_0x2a4cb7,'folderIdToPath':_0x413306,'segmentNameToId':_0x2c5e40,'activationsBySegmentId':_0x42af00,'emailToIdMap':_0xaae62d,'idToEmailMap':_0x2ccfbe,'connectionNameToIdMap':_0x1ba944[_0x24219b(0x138)],'connectionIdToNameMap':_0x1ba944['idToName'],'connectionNameToTypeMap':_0x4cd206},_0x654cad=await executePushSegments(_0x558628,_0x5a9c2e[_0x24219b(0x1a9)]?[]:_0x4438d2,_0x2e8956,{'parentId':_0x6ca344},_0x442822),_0x544037=_0x654cad[_0x24219b(0x1a5)],_0x227356=_0x654cad['updated'],_0x247181=_0x654cad[_0x24219b(0x1b8)][_0x24219b(0x1a5)],_0x11c4c5=_0x654cad[_0x24219b(0x1b8)][_0x24219b(0x126)],_0x417688=_0x654cad['activations'][_0x24219b(0x149)];let _0x542b6c;if(_0x22ee5f&&_0x4438d2[_0x24219b(0x17c)]===0x1){const _0x492152=_0x4438d2[0x0];_0x542b6c=_0x492152[_0x24219b(0x14b)]?.['id']??_0x654cad[_0x24219b(0x1b5)]['get'](_0x492152[_0x24219b(0x1b6)][_0x24219b(0x174)]);}const _0x2ab788=await executePushSegmentDeletions(_0x558628,_0x5a9c2e[_0x24219b(0x1a9)]?[]:_0x32c551,_0x442822);let _0x1a2d04=0x0,_0x49180f=0x0,_0x1a77cd=0x0;const _0x4c10ad=new Map(_0x2c5e40);for(const [_0x205aa9,_0x4937ff]of _0x654cad['createdSegmentIds']){_0x4c10ad[_0x24219b(0x145)](_0x205aa9,_0x4937ff);}if(_0x1e7b16[_0x24219b(0x17c)]>0x0){const _0x520223={..._0x2e8956,'segmentNameToId':_0x4c10ad,'existingSegments':_0x455aa9,'activationContext':_0x2516bc},_0x112da3=await executePushJourneys(_0x558628,_0x1e7b16,_0x520223,{'parentId':_0x6ca344,'rootFolderId':_0x1ac8ff,'verbose':_0x5a9c2e[_0x24219b(0x12e)]},_0x442822);_0x1a2d04=_0x112da3[_0x24219b(0x1a5)],_0x49180f=_0x112da3[_0x24219b(0x126)];if(_0x22ee5f&&_0x112da3[_0x24219b(0x169)]['length']===0x1){const _0x4b82eb=_0x112da3[_0x24219b(0x169)][0x0];if(_0x4b82eb[_0x24219b(0x19f)]){const _0x53d5b0=getConsoleNextUrl(_0x5a9c2e['site'],_0x24219b(0x1c1)+_0x6ca344+'/e/'+_0x4b82eb[_0x24219b(0x19f)]+_0x24219b(0x1b2));console[_0x24219b(0x1bb)]('\x20\x20'+a41_0x46066a[_0x24219b(0x146)](_0x53d5b0));}}}for(const _0x58c0d2 of _0x129404){console[_0x24219b(0x1bb)](a41_0x46066a[_0x24219b(0x18f)](_0x24219b(0x139)+_0x58c0d2[_0x24219b(0x14c)])),_0x1a77cd++;}const _0x447e69=[];if(_0x544037>0x0)_0x447e69[_0x24219b(0x172)](_0x544037+'\x20created');if(_0x227356>0x0)_0x447e69[_0x24219b(0x172)](_0x227356+_0x24219b(0x131));if(_0x2ab788>0x0)_0x447e69[_0x24219b(0x172)](_0x2ab788+_0x24219b(0x180));const _0x33ac9f=[];if(_0x1a2d04>0x0)_0x33ac9f['push'](_0x1a2d04+_0x24219b(0x191));if(_0x49180f>0x0)_0x33ac9f[_0x24219b(0x172)](_0x49180f+_0x24219b(0x131));if(_0x1a77cd>0x0)_0x33ac9f[_0x24219b(0x172)](_0x1a77cd+_0x24219b(0x180));const _0x15d411=[];if(_0x247181>0x0)_0x15d411[_0x24219b(0x172)](_0x247181+_0x24219b(0x191));if(_0x11c4c5>0x0)_0x15d411[_0x24219b(0x172)](_0x11c4c5+_0x24219b(0x131));if(_0x417688>0x0)_0x15d411[_0x24219b(0x172)](_0x417688+_0x24219b(0x180));console['error'](a41_0x46066a['green'](_0x24219b(0x129)));_0x447e69[_0x24219b(0x17c)]>0x0&&!_0x5a9c2e[_0x24219b(0x1a9)]&&console['error'](_0x24219b(0x133)+_0x447e69[_0x24219b(0x198)](',\x20'));_0x33ac9f[_0x24219b(0x17c)]>0x0&&console['error'](_0x24219b(0x147)+_0x33ac9f[_0x24219b(0x198)](',\x20'));_0x15d411[_0x24219b(0x17c)]>0x0&&!_0x5a9c2e[_0x24219b(0x1a9)]&&console['error']('\x20\x20Activations:\x20'+_0x15d411[_0x24219b(0x198)](',\x20'));if(_0x542b6c){const _0xf384bd=getConsoleNextUrl(_0x5a9c2e['site'],'/app/ps/'+_0x6ca344+_0x24219b(0x16c)+_0x542b6c+_0x24219b(0x168));console[_0x24219b(0x1bb)]('\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20'+a41_0x46066a[_0x24219b(0x146)](_0xf384bd));}return 0x0;}}
1
+ const a41_0x11c750=a41_0x1604;(function(_0x4d7958,_0xf117d4){const _0x51aaf5=a41_0x1604,_0x3c0337=_0x4d7958();while(!![]){try{const _0x43a514=-parseInt(_0x51aaf5(0xd2))/0x1*(-parseInt(_0x51aaf5(0xef))/0x2)+parseInt(_0x51aaf5(0xb8))/0x3+parseInt(_0x51aaf5(0x10d))/0x4*(parseInt(_0x51aaf5(0xf8))/0x5)+-parseInt(_0x51aaf5(0xcf))/0x6*(-parseInt(_0x51aaf5(0xdc))/0x7)+parseInt(_0x51aaf5(0x77))/0x8*(-parseInt(_0x51aaf5(0xed))/0x9)+parseInt(_0x51aaf5(0xc4))/0xa+-parseInt(_0x51aaf5(0xce))/0xb*(parseInt(_0x51aaf5(0x7c))/0xc);if(_0x43a514===_0xf117d4)break;else _0x3c0337['push'](_0x3c0337['shift']());}catch(_0x13288a){_0x3c0337['push'](_0x3c0337['shift']());}}}(a41_0x3e10,0xb0dfb));import{BaseCommand}from'./command.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{generateDiff,formatDiffWithColors}from'../utils/diff.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{batchAsync}from'../utils/async.js';import{segmentToYamlString,segmentWithActivationsToYaml}from'../sdk/segment/child-segment-yaml.js';import a41_0x409a3b 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_0x3e10(){const _0xc9067d=['⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','Resolving\x20parent\x20segment\x20\x27','scopedFolderPath','/e/','\x20activations]','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','\x20\x20Activations:','\x20updated','1375JcPlsZ','6gJqhzz','type','yellow','6VsfWyE','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','add','folders','push','cyan','Error\x20parsing\x20YAML:\x20','user','Delete\x20journey:','\x20\x20Segments:\x20','269871cKGYRC','\x20\x20📊\x20Segments:','results','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','delete','folderPath','dryRun','\x0aError:','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','/j/da/je','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','\x20\x20Journeys:\x20','segment','updatedAt','setPhase','Scoped\x20to\x20folder:\x20','Fetching\x20existing\x20data...','18ffsnHu','Changes\x20to\x20journey:','397238eslgId','blue','name','/app/ps/','list','red','verbose','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','parent_name','20fwjMiV','\x20\x20Source:\x20','\x20YAML\x20files\x20found','\x20to\x20create','data','green','getJourney','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','diff','\x20unchanged','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','journeys','Fetching\x20connections\x20for\x20name\x20resolution...','createdSegmentIds','message','Parent\x20segment:\x20','existingSegment','Error:\x20','yamlConfig','targetDir','file','1142828Quqgpy','\x20created','Push\x20','✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','helpText','journeysOnly','no_parent','parentName','set','660184fhtZAB','connection','getOutputSchemaWithCache','activations','description','281772FueUNw','Source\x20directory:\x20','\x20deleted','paused','.yaml','dim','map','segmentFolderId','createdAt','isNew','\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20','listJourneysWithDetailsFromParentSegment','📁\x20','Delete\x20segment:','listActivations','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','\x20folders\x20to\x20create','(Journey\x20will\x20be\x20deleted)','segment:push','toDelete','relationships','new','Folders\x20to\x20create:','journeyBundleName','toUpdate','updated','existingJourney','journeyId','nameToType','filePath','Error:\x20Directory\x20not\x20found:\x20','parentSegment','filter','\x20\x20\x20\x20','execute','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','toString','changed','\x20new','deleted','parentFolder','get','then','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','Changes\x20to:','repeat','join','No\x20','.yml','site','\x0aValidation\x20failed:','cwd','\x20changed','created','\x0aPush\x20summary\x20for\x20\x27','\x20to\x20delete','isScoped','length','segments','New\x20segment:','3934227TzIaKD','attributes','unchanged','error','journey','\x20\x20🗺️\x20\x20Journeys:','nameToId','endsWith','resolveParentId','versionNumber','Aborted.','Preparing\x20journeys...','1401420ZLYGbR','Fetching\x20existing\x20activations...'];a41_0x3e10=function(){return _0xc9067d;};return a41_0x3e10();}import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{resolveTDFolderPath,findSegmentsToDelete,findJourneysToDelete,buildSegmentLookupMap,buildSegmentNameToIdMap,buildJourneyBundleLookupMap,parseAndClassifyYamlFiles,validateParsedFiles,formatValidationErrors,extractRootFolderId,buildConnectionMaps,calculatePushStats,prepareSegmentFiles,prepareJourneyFiles,executePushSegments,executePushFolders,executePushSegmentDeletions,executePushJourneys}from'../sdk/segment/push-workflow.js';function a41_0x1604(_0x2db875,_0x5890d8){_0x2db875=_0x2db875-0x75;const _0x3e10d0=a41_0x3e10();let _0x1604cd=_0x3e10d0[_0x2db875];return _0x1604cd;}export class SegmentPushCommand extends BaseCommand{[a41_0x11c750(0xf1)]=a41_0x11c750(0x8e);[a41_0x11c750(0x7b)]=a41_0x11c750(0xe4);async[a41_0x11c750(0x9e)](_0xd1d369){const _0x21f187=a41_0x11c750,{options:_0x2b0f43,args:_0x49ec45,tdx:_0x1fcfd8}=_0xd1d369,_0x3e8406=_0x2b0f43,_0x45e230=await resolveTarget({'arg':_0x49ec45[0x0],'contextParent':_0x2b0f43[_0x21f187(0x9b)],'cwd':process[_0x21f187(0xaf)]()});if(!isSuccessfulResolution(_0x45e230))return _0x45e230['errorCode']===_0x21f187(0x113)?(console['error'](a41_0x409a3b[_0x21f187(0xd1)](_0x21f187(0xcb))),console[_0x21f187(0xbb)]('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'](_0x21f187(0x8b)),console[_0x21f187(0xbb)]('\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[_0x21f187(0xbb)](a41_0x409a3b[_0x21f187(0xf4)](_0x21f187(0x109)+_0x45e230[_0x21f187(0x106)]+'\x0a')),_0x45e230[_0x21f187(0x111)]&&console[_0x21f187(0xbb)](a41_0x409a3b['cyan'](_0x45e230[_0x21f187(0x111)]))),0x1;if(_0x45e230[_0x21f187(0xd0)]===_0x21f187(0xf7))return console[_0x21f187(0xbb)](a41_0x409a3b['red'](_0x21f187(0x9a)+_0x45e230[_0x21f187(0x10b)]+'\x0a')),console[_0x21f187(0xbb)](a41_0x409a3b[_0x21f187(0xd7)](_0x21f187(0xa7))),0x1;const _0x50e828=_0x45e230[_0x21f187(0x75)],_0x1d274c=_0x45e230[_0x21f187(0x10b)],_0x6f8809=_0x45e230[_0x21f187(0xd0)]===_0x21f187(0x10c)?_0x45e230[_0x21f187(0x99)]:undefined,_0xe28f78=getScopedDetails(_0x45e230),_0x32c5b8=_0xe28f78?.[_0x21f187(0xb4)]??![],_0x413d1b=_0xe28f78?.[_0x21f187(0xc8)]??'';if(!existsSync(_0x1d274c))return console[_0x21f187(0xbb)](a41_0x409a3b[_0x21f187(0xf4)](_0x21f187(0x9a)+_0x1d274c+'\x0a')),console['error'](a41_0x409a3b[_0x21f187(0xd7)](_0x21f187(0xa7))),0x1;_0x3e8406[_0x21f187(0xf5)]&&(console[_0x21f187(0xbb)]('Site:\x20'+_0x3e8406[_0x21f187(0xad)]),console[_0x21f187(0xbb)](_0x21f187(0x107)+_0x50e828),console['error'](_0x21f187(0x7d)+_0x1d274c),_0x32c5b8&&console[_0x21f187(0xbb)](_0x21f187(0xeb)+_0x413d1b));const _0x4e9782=await withSpinner(_0x21f187(0xc7)+_0x50e828+'\x27...',()=>_0x1fcfd8[_0x21f187(0xe8)][_0x21f187(0xc0)](_0x50e828),{'verbose':_0x3e8406[_0x21f187(0xf5)]}),_0x552421=_0x4e9782['data'],{parentSegmentResult:_0x261228,segmentsResult:_0x909c84,foldersResult:_0x3bde4d,journeysWithDetailsResult:_0x2a6a67,userMaps:_0x401aca}=await withSpinner(_0x21f187(0xec),async()=>{const _0x6820d9=_0x21f187,[_0x2adb3b,_0x5ad769,_0x3069ca,_0x4626c0,_0x40e7f3]=await Promise['all']([_0x1fcfd8[_0x6820d9(0xe8)]['getParent'](_0x552421),_0x1fcfd8[_0x6820d9(0xe8)]['listSegments'](_0x552421),_0x1fcfd8[_0x6820d9(0xe8)]['listFolders'](_0x552421),_0x1fcfd8[_0x6820d9(0xbc)][_0x6820d9(0x87)](_0x552421,{'includeAllVersions':!![]}),_0x1fcfd8[_0x6820d9(0xd9)]['buildUserMaps']()]);return{'parentSegmentResult':_0x2adb3b,'segmentsResult':_0x5ad769,'foldersResult':_0x3069ca,'journeysWithDetailsResult':_0x4626c0,'userMaps':_0x40e7f3};},{'verbose':_0x3e8406[_0x21f187(0xf5)]})[_0x21f187(0xa6)](_0x1bca52=>_0x1bca52['data']),_0x5acc68=_0x261228,_0x63f345=extractRootFolderId(_0x5acc68),_0x50c0e5=_0x909c84,_0x461481=_0x3bde4d,{journeys:_0x1644a6,activationStepsById:_0x264605}=_0x2a6a67,_0x508802=new Map(_0x1644a6[_0x21f187(0x82)](_0x326d1f=>[_0x326d1f['id'],_0x326d1f])),_0x49391f=_0x1644a6[_0x21f187(0x82)](_0x552521=>({'id':_0x552521['id'],'name':_0x552521[_0x21f187(0xb9)][_0x21f187(0xf1)],'journeyBundleName':_0x552521['attributes'][_0x21f187(0x93)]||'','journeyBundleId':_0x552521[_0x21f187(0xb9)]['journeyBundleId']||'','versionNumber':_0x552521[_0x21f187(0xb9)][_0x21f187(0xc1)],'description':_0x552521[_0x21f187(0xb9)][_0x21f187(0x7b)],'state':_0x552521[_0x21f187(0xb9)]['state'],'paused':_0x552521[_0x21f187(0xb9)][_0x21f187(0x7f)],'audienceId':_0x552521[_0x21f187(0xb9)]['audienceId'],'folderId':_0x552521[_0x21f187(0x90)]?.[_0x21f187(0xa4)]?.['data']?.['id'],'createdAt':_0x552521[_0x21f187(0xb9)][_0x21f187(0x84)],'updatedAt':_0x552521[_0x21f187(0xb9)][_0x21f187(0xe9)]})),{emailToId:_0x37f1b9,idToEmail:_0x3b2e50}=_0x401aca,_0x1097e5=await withSpinner(_0x21f187(0x104),async()=>{const _0x5e8dd8=_0x21f187,_0x1c3804=await _0x1fcfd8[_0x5e8dd8(0x78)][_0x5e8dd8(0xf3)]();return buildConnectionMaps(_0x1c3804);},{'verbose':_0x3e8406['verbose']})[_0x21f187(0xa6)](_0x3ebd92=>_0x3ebd92['data']),_0x4392b2=_0x1097e5[_0x21f187(0xbe)],_0x1361e8=_0x1097e5['idToName'],_0x3888fa=_0x1097e5[_0x21f187(0x98)],_0x259121={'emailToIdMap':_0x37f1b9,'connectionNameToIdMap':_0x4392b2,'connectionNameToTypeMap':_0x3888fa,'getSchema':_0x58fa36=>_0x1fcfd8[_0x21f187(0x78)][_0x21f187(0x79)](_0x58fa36)};let {pathToId:_0x3936d7,idToPath:_0x37fcc2}=buildFolderMaps(_0x461481);const _0x76623f=buildSegmentLookupMap(_0x50c0e5,_0x37fcc2),_0xd0080a=buildSegmentNameToIdMap(_0x50c0e5),_0xcdde04=buildJourneyBundleLookupMap(_0x49391f,_0x37fcc2);let _0x2017fc;if(_0x6f8809){if(!_0x6f8809['endsWith'](_0x21f187(0xac))&&!_0x6f8809[_0x21f187(0xbf)](_0x21f187(0x80)))return console[_0x21f187(0xbb)](a41_0x409a3b[_0x21f187(0xf4)]('Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20'+_0x6f8809+'\x0a')),0x1;_0x2017fc=[_0x6f8809];}else _0x2017fc=findYamlFiles(_0x1d274c);if(_0x2017fc[_0x21f187(0xb5)]===0x0)return console['error'](a41_0x409a3b[_0x21f187(0xf4)](_0x21f187(0xff)+_0x1d274c+'\x0a')),console[_0x21f187(0xbb)](a41_0x409a3b['cyan'](_0x21f187(0xf6))),0x1;let _0xbf8fac,_0x450dda;try{const _0x42d30b=parseAndClassifyYamlFiles(_0x2017fc,_0x1d274c,{'skipSegments':_0x3e8406[_0x21f187(0x112)]});_0xbf8fac=_0x42d30b[_0x21f187(0xb6)],_0x450dda=_0x42d30b[_0x21f187(0x103)];const _0x295bb5=validateParsedFiles(_0x42d30b,_0x1d274c);if(_0x295bb5[_0x21f187(0xb5)]>0x0)return console[_0x21f187(0xbb)](a41_0x409a3b['red'](_0x21f187(0xae))),console[_0x21f187(0xbb)](formatValidationErrors(_0x295bb5)),console[_0x21f187(0xbb)](a41_0x409a3b[_0x21f187(0xd1)](_0x21f187(0xd3))),0x1;}catch(_0x5488b1){return console[_0x21f187(0xbb)](a41_0x409a3b[_0x21f187(0xf4)](_0x21f187(0xd8)+(_0x5488b1 instanceof Error?_0x5488b1[_0x21f187(0x106)]:_0x5488b1))),0x1;}if(_0xbf8fac[_0x21f187(0xb5)]===0x0&&_0x450dda[_0x21f187(0xb5)]===0x0){const _0x5ac3c9=_0x3e8406[_0x21f187(0x112)]?_0x21f187(0xbc):'segment\x20or\x20journey';return console[_0x21f187(0xbb)](a41_0x409a3b['yellow'](_0x21f187(0xab)+_0x5ac3c9+_0x21f187(0xfa))),0x0;}const _0x8b9ab7=new Map();_0x50c0e5[_0x21f187(0xb5)]>0x0&&!_0x3e8406[_0x21f187(0x112)]&&await withSpinner(_0x21f187(0xc5),async()=>{await batchAsync(_0x50c0e5,async _0x17f4ef=>{const _0x3c2278=a41_0x1604,_0x5df7fa=await _0x1fcfd8[_0x3c2278(0xe8)][_0x3c2278(0x8a)](_0x552421,_0x17f4ef['id']);_0x8b9ab7[_0x3c2278(0x76)](_0x17f4ef['id'],_0x5df7fa);});},{'verbose':_0x3e8406[_0x21f187(0xf5)]});const {segmentFiles:_0xcf4a08,foldersToCreate:_0x2870a6}=await prepareSegmentFiles(_0xbf8fac,{'segmentByFolderAndName':_0x76623f,'activationsBySegmentId':_0x8b9ab7,'folderPathToId':_0x3936d7,'idToEmailMap':_0x3b2e50,'connectionIdToNameMap':_0x1361e8},_0x259121,_0x32c5b8,_0x413d1b),_0x555acf=_0x6f8809?[]:findSegmentsToDelete(_0x50c0e5,_0xbf8fac[_0x21f187(0x82)](({yamlConfig:_0x3f1503,folderPath:_0x3b4aa3})=>({'yamlConfig':_0x3f1503,'folderPath':resolveTDFolderPath(_0x3b4aa3,_0x32c5b8,_0x413d1b)})),_0x37fcc2,_0x413d1b,_0x32c5b8),{journeyFiles:_0x1d2a39,foldersToCreate:_0x524ae9}=await withProgressSpinner(_0x21f187(0xc3),async _0x3c6635=>prepareJourneyFiles(_0x450dda,{'fetchJourney':async _0x50e5f9=>_0x1fcfd8[_0x21f187(0xbc)][_0x21f187(0xfe)](_0x50e5f9[_0x21f187(0x97)]),'journeyBundlesByFolderAndName':_0xcdde04,'folderPathToId':_0x3936d7,'idToEmailMap':_0x3b2e50,'connectionIdToNameMap':_0x1361e8,'existingSegments':_0x50c0e5,'parentId':_0x552421,'deps':_0x1fcfd8,'progress':{'update':_0x2851e6=>{const _0x151020=_0x21f187;_0x3c6635[_0x151020(0xea)](_0x2851e6),_0x3e8406[_0x151020(0xf5)]&&console[_0x151020(0xbb)]('\x20\x20'+_0x2851e6);}},'journeyById':_0x508802,'activationStepsById':_0x264605},_0x32c5b8,_0x413d1b),{'verbose':_0x3e8406[_0x21f187(0xf5)]})[_0x21f187(0xa6)](_0x9b9018=>_0x9b9018[_0x21f187(0xfc)]);for(const _0x1c71ef of _0x524ae9){_0x2870a6[_0x21f187(0xd4)](_0x1c71ef);}const _0x4bf4dd=_0x6f8809?[]:findJourneysToDelete(_0x49391f,_0x450dda['map'](({yamlConfig:_0x5240aa,folderPath:_0x6e91c8})=>({'yamlConfig':_0x5240aa,'folderPath':resolveTDFolderPath(_0x6e91c8,_0x32c5b8,_0x413d1b)})),_0x37fcc2,_0x413d1b,_0x32c5b8),_0x14c039=calculatePushStats(_0xcf4a08,_0x1d2a39,_0x2870a6,_0x555acf,_0x4bf4dd,!!_0x3e8406[_0x21f187(0xe0)],!!_0x3e8406[_0x21f187(0x112)]),_0x3985f9=_0x14c039[_0x21f187(0xb6)]['new'],_0x12fbd7=_0x14c039[_0x21f187(0xb6)][_0x21f187(0xa1)],_0x4b0e6f=_0x14c039[_0x21f187(0xb6)][_0x21f187(0xba)],_0x3a72bc=_0x14c039[_0x21f187(0xb6)]['toDelete'],_0x3b94a2=_0x14c039[_0x21f187(0xd5)]['toCreate'],_0x3d9c77=_0x14c039[_0x21f187(0x103)][_0x21f187(0x91)],_0x428a9a=_0x14c039[_0x21f187(0x103)]['changed'],_0x3b4339=_0x14c039[_0x21f187(0x103)][_0x21f187(0xba)],_0xe6058=_0x14c039[_0x21f187(0x103)][_0x21f187(0x8f)],_0x529914=_0x14c039[_0x21f187(0x7a)]['all'],_0x18f996=_0x14c039[_0x21f187(0x7a)]['toCreate'],_0x123b65=_0x14c039['activations'][_0x21f187(0x94)],_0x5c3e04=_0x14c039[_0x21f187(0x7a)][_0x21f187(0x8f)];console[_0x21f187(0xbb)](_0x21f187(0xb2)+_0x50e828+'\x27:');_0x3b94a2[_0x21f187(0xb5)]>0x0&&console['error']('\x20\x20'+a41_0x409a3b['blue'](_0x21f187(0x88)+_0x3b94a2['length']+_0x21f187(0x8c)));if(!_0x3e8406[_0x21f187(0x112)]){console[_0x21f187(0xbb)](_0x21f187(0xdd)),console[_0x21f187(0xbb)](_0x21f187(0x9d)+a41_0x409a3b[_0x21f187(0xfd)]('+\x20'+_0x3985f9[_0x21f187(0xb5)]+_0x21f187(0xa2))),console[_0x21f187(0xbb)](_0x21f187(0x9d)+a41_0x409a3b[_0x21f187(0xd1)]('~\x20'+_0x12fbd7['length']+_0x21f187(0xb0)));if(_0x3a72bc[_0x21f187(0xb5)]>0x0)console[_0x21f187(0xbb)]('\x20\x20\x20\x20'+a41_0x409a3b[_0x21f187(0xf4)]('-\x20'+_0x3a72bc[_0x21f187(0xb5)]+'\x20to\x20delete'));else _0x555acf['length']>0x0&&!_0x3e8406[_0x21f187(0xe0)]&&console[_0x21f187(0xbb)]('\x20\x20\x20\x20'+a41_0x409a3b['dim'](_0x555acf['length']+_0x21f187(0xe6)));console[_0x21f187(0xbb)]('\x20\x20\x20\x20'+a41_0x409a3b[_0x21f187(0x81)]('=\x20'+_0x4b0e6f[_0x21f187(0xb5)]+_0x21f187(0x101)));}if(_0x1d2a39['length']>0x0||_0x4bf4dd[_0x21f187(0xb5)]>0x0){console['error'](_0x21f187(0xbd)),console['error'](_0x21f187(0x9d)+a41_0x409a3b['green']('+\x20'+_0x3d9c77[_0x21f187(0xb5)]+'\x20new')),console[_0x21f187(0xbb)]('\x20\x20\x20\x20'+a41_0x409a3b[_0x21f187(0xd1)]('~\x20'+_0x428a9a['length']+'\x20changed'));if(_0xe6058[_0x21f187(0xb5)]>0x0)console[_0x21f187(0xbb)](_0x21f187(0x9d)+a41_0x409a3b[_0x21f187(0xf4)]('-\x20'+_0xe6058[_0x21f187(0xb5)]+_0x21f187(0xb3)));else _0x4bf4dd[_0x21f187(0xb5)]>0x0&&!_0x3e8406[_0x21f187(0xe0)]&&console[_0x21f187(0xbb)](_0x21f187(0x9d)+a41_0x409a3b[_0x21f187(0x81)](_0x4bf4dd[_0x21f187(0xb5)]+_0x21f187(0xe6)));console['error'](_0x21f187(0x9d)+a41_0x409a3b[_0x21f187(0x81)]('=\x20'+_0x3b4339[_0x21f187(0xb5)]+_0x21f187(0x101)));}_0x529914[_0x21f187(0xb5)]>0x0&&!_0x3e8406['journeysOnly']&&(console[_0x21f187(0xbb)](''),console['error'](_0x21f187(0xcc)),_0x18f996[_0x21f187(0xb5)]>0x0&&console['error'](_0x21f187(0x9d)+a41_0x409a3b[_0x21f187(0xfd)]('+\x20'+_0x18f996['length']+_0x21f187(0xfb))),_0x123b65['length']>0x0&&console[_0x21f187(0xbb)](_0x21f187(0x9d)+a41_0x409a3b[_0x21f187(0xd1)]('~\x20'+_0x123b65[_0x21f187(0xb5)]+'\x20to\x20update')),_0x5c3e04[_0x21f187(0xb5)]>0x0&&console[_0x21f187(0xbb)]('\x20\x20\x20\x20'+a41_0x409a3b[_0x21f187(0xf4)]('-\x20'+_0x5c3e04[_0x21f187(0xb5)]+_0x21f187(0xb3))));console[_0x21f187(0xbb)](_0x21f187(0xf9)+a41_0x409a3b[_0x21f187(0xd7)](_0x1d274c)+'\x0a');if(_0x3b94a2[_0x21f187(0xb5)]>0x0){console[_0x21f187(0xbb)](_0x21f187(0x92));for(const _0x232d7c of _0x3b94a2){console['error']('\x20\x20'+a41_0x409a3b['blue']('+')+'\x20'+_0x232d7c);}console[_0x21f187(0xbb)]('');}if(_0x3985f9[_0x21f187(0xb5)]>0x0&&!_0x3e8406['journeysOnly'])for(const _0x3c74f6 of _0x3985f9){const _0x44b2d6=_0x3c74f6[_0x21f187(0xe1)]?_0x3c74f6[_0x21f187(0xe1)]+'/'+_0x3c74f6[_0x21f187(0x10a)][_0x21f187(0xf1)]:_0x3c74f6[_0x21f187(0x10a)][_0x21f187(0xf1)],_0x3b218a=_0x3c74f6[_0x21f187(0x10a)][_0x21f187(0x7a)]?.[_0x21f187(0xb5)]||0x0,_0x1a9d7b=_0x3b218a>0x0?a41_0x409a3b['dim']('\x20['+_0x3b218a+_0x21f187(0xca)):'';console['error']('\x0a'+a41_0x409a3b[_0x21f187(0xfd)](_0x21f187(0xb7))+'\x20'+_0x44b2d6+_0x1a9d7b),console[_0x21f187(0xbb)]('─'['repeat'](0x3c)),_0x3c74f6['diff']&&console['error'](_0x3c74f6[_0x21f187(0x100)]),console[_0x21f187(0xbb)]('─'[_0x21f187(0xa9)](0x3c));}if(_0x3a72bc[_0x21f187(0xb5)]>0x0&&!_0x3e8406[_0x21f187(0x112)])for(const _0x584ace of _0x3a72bc){const _0x1089a6=_0x584ace[_0x21f187(0x83)]?_0x37fcc2['get'](_0x584ace[_0x21f187(0x83)][_0x21f187(0xa0)]())||'':'',_0x32040b=_0x1089a6?_0x1089a6+'/'+_0x584ace['name']:_0x584ace[_0x21f187(0xf1)],_0x732ae4=_0x8b9ab7[_0x21f187(0xa5)](_0x584ace['id'])||[],_0x1749f1=_0x732ae4[_0x21f187(0xb5)]>0x0?a41_0x409a3b['dim']('\x20['+_0x732ae4[_0x21f187(0xb5)]+_0x21f187(0xca)):'';console[_0x21f187(0xbb)]('\x0a'+a41_0x409a3b['red'](_0x21f187(0x89))+'\x20'+_0x32040b+_0x1749f1),console[_0x21f187(0xbb)]('─'[_0x21f187(0xa9)](0x3c));const _0x15b789=segmentWithActivationsToYaml(_0x584ace,_0x732ae4,undefined,_0x3b2e50,_0x1361e8),_0x3587f7=segmentToYamlString(_0x15b789),_0x470269=generateDiff(_0x3587f7,'');console[_0x21f187(0xbb)](formatDiffWithColors(_0x470269)),console['error']('─'[_0x21f187(0xa9)](0x3c));}const _0x2c710e=_0xcf4a08[_0x21f187(0x9c)](_0x35538e=>!_0x35538e[_0x21f187(0x85)]&&_0x35538e[_0x21f187(0x100)]);if(_0x2c710e[_0x21f187(0xb5)]>0x0&&!_0x3e8406[_0x21f187(0x112)])for(const _0x5cc286 of _0x2c710e){const _0x3d9803=_0x5cc286[_0x21f187(0xe1)]?_0x5cc286['folderPath']+'/'+_0x5cc286[_0x21f187(0x10a)][_0x21f187(0xf1)]:_0x5cc286[_0x21f187(0x10a)][_0x21f187(0xf1)];console[_0x21f187(0xbb)]('\x0a'+a41_0x409a3b[_0x21f187(0xd1)](_0x21f187(0xa8))+'\x20'+_0x3d9803),console[_0x21f187(0xbb)]('─'[_0x21f187(0xa9)](0x3c)),console[_0x21f187(0xbb)](_0x5cc286[_0x21f187(0x100)]),console[_0x21f187(0xbb)]('─'[_0x21f187(0xa9)](0x3c));}if(_0x3d9c77['length']>0x0)for(const _0x299420 of _0x3d9c77){const _0x3b725c=_0x299420[_0x21f187(0xe1)]?_0x299420[_0x21f187(0xe1)]+'/'+_0x299420['yamlConfig'][_0x21f187(0xf1)]:_0x299420['yamlConfig'][_0x21f187(0xf1)];console[_0x21f187(0xbb)]('\x0a'+a41_0x409a3b[_0x21f187(0xfd)]('New\x20journey:')+'\x20'+_0x3b725c),console['error']('─'[_0x21f187(0xa9)](0x3c)),_0x299420[_0x21f187(0x100)]&&console[_0x21f187(0xbb)](_0x299420[_0x21f187(0x100)]),console['error']('─'[_0x21f187(0xa9)](0x3c));}const _0x32a8ea=_0x1d2a39[_0x21f187(0x9c)](_0x255b3c=>!_0x255b3c[_0x21f187(0x85)]&&_0x255b3c[_0x21f187(0x100)]);if(_0x32a8ea[_0x21f187(0xb5)]>0x0)for(const _0x338300 of _0x32a8ea){const _0x37077f=_0x338300[_0x21f187(0xe1)]?_0x338300[_0x21f187(0xe1)]+'/'+_0x338300[_0x21f187(0x10a)][_0x21f187(0xf1)]:_0x338300['yamlConfig'][_0x21f187(0xf1)];console[_0x21f187(0xbb)]('\x0a'+a41_0x409a3b[_0x21f187(0xd1)](_0x21f187(0xee))+'\x20'+_0x37077f),console[_0x21f187(0xbb)]('─'['repeat'](0x3c)),console[_0x21f187(0xbb)](_0x338300['diff']),console[_0x21f187(0xbb)]('─'[_0x21f187(0xa9)](0x3c));}if(_0xe6058[_0x21f187(0xb5)]>0x0)for(const _0x3befb4 of _0xe6058){const _0x598233=_0x3befb4['folderId']?_0x37fcc2[_0x21f187(0xa5)](_0x3befb4['folderId'])||'':'',_0x2f196a=_0x598233?_0x598233+'/'+_0x3befb4[_0x21f187(0x93)]:_0x3befb4[_0x21f187(0x93)];console[_0x21f187(0xbb)]('\x0a'+a41_0x409a3b[_0x21f187(0xf4)](_0x21f187(0xda))+'\x20'+_0x2f196a),console['error']('─'[_0x21f187(0xa9)](0x3c)),console[_0x21f187(0xbb)](a41_0x409a3b['red'](_0x21f187(0x8d))),console[_0x21f187(0xbb)]('─'['repeat'](0x3c));}if(_0x3e8406[_0x21f187(0xe2)])return console[_0x21f187(0xbb)](a41_0x409a3b[_0x21f187(0xd1)](_0x21f187(0x102))),0x0;const _0x28ecc4=_0x3e8406[_0x21f187(0x112)]?![]:_0x3985f9['length']>0x0||_0x12fbd7[_0x21f187(0xb5)]>0x0||_0x3a72bc[_0x21f187(0xb5)]>0x0,_0x178886=_0x3d9c77[_0x21f187(0xb5)]>0x0||_0x428a9a['length']>0x0||_0xe6058['length']>0x0,_0x28a50b=_0x3e8406[_0x21f187(0x112)]?![]:_0x529914['length']>0x0,_0x473ba3=_0x3b94a2[_0x21f187(0xb5)]>0x0;if(!_0x28ecc4&&!_0x178886&&!_0x28a50b&&!_0x473ba3){const _0x5a7c1e=_0x3e8406[_0x21f187(0x112)]?'✔\x20All\x20journeys\x20are\x20up\x20to\x20date':_0x21f187(0x110);console['error'](a41_0x409a3b[_0x21f187(0xfd)](_0x5a7c1e));if(_0x6f8809&&_0x4b0e6f['length']===0x1){const _0x1eb594=_0x4b0e6f[0x0];if(_0x1eb594[_0x21f187(0x108)]?.['id']){const _0x477415=getConsoleNextUrl(_0x3e8406['site'],_0x21f187(0xf2)+_0x552421+'/e/'+_0x1eb594[_0x21f187(0x108)]['id']+'/sb/da/esr');console['error'](_0x21f187(0x86)+a41_0x409a3b['cyan'](_0x477415));}}if(_0x6f8809&&_0x3b4339['length']===0x1){const _0x164926=_0x3b4339[0x0];if(_0x164926[_0x21f187(0x96)]?.['id']){const _0x27fda4=getConsoleNextUrl(_0x3e8406['site'],'/app/ps/'+_0x552421+_0x21f187(0xc9)+_0x164926[_0x21f187(0x96)]['id']+_0x21f187(0xe5));console[_0x21f187(0xbb)]('\x20\x20'+a41_0x409a3b['cyan'](_0x27fda4));}}return 0x0;}const _0x5c741a=_0x3e8406['journeysOnly']?_0x3d9c77[_0x21f187(0xb5)]+_0x428a9a[_0x21f187(0xb5)]+_0xe6058[_0x21f187(0xb5)]+_0x3b94a2[_0x21f187(0xb5)]:_0x3985f9[_0x21f187(0xb5)]+_0x12fbd7['length']+_0x3a72bc['length']+_0x3d9c77[_0x21f187(0xb5)]+_0x428a9a[_0x21f187(0xb5)]+_0xe6058['length']+_0x3b94a2[_0x21f187(0xb5)]+_0x529914['length'];if(!_0x3e8406['yes']&&_0x5c741a>0x0){if(!isInteractive())return console['error'](a41_0x409a3b['red'](_0x21f187(0xe3)),_0x21f187(0x9f)),console[_0x21f187(0xbb)](a41_0x409a3b[_0x21f187(0x81)](_0x21f187(0xdf))),0x1;const _0x1c1ea2=await confirmKey(_0x21f187(0x10f)+_0x5c741a+'\x20changes?');if(!_0x1c1ea2)return console[_0x21f187(0xbb)](a41_0x409a3b[_0x21f187(0xd1)](_0x21f187(0xc2))),0x1;}const _0x54af5b={'withProgress':async(_0x1c0916,_0x37a470)=>{const _0x40c91a=_0x21f187,_0x4051ed=await withSpinner(_0x1c0916,_0x37a470,{'verbose':_0x3e8406[_0x40c91a(0xf5)]});return{'data':_0x4051ed['data']};},'logInfo':_0x322a09=>console[_0x21f187(0xbb)](a41_0x409a3b[_0x21f187(0xf0)]('✔\x20'+_0x322a09)),'logSuccess':_0x5109a8=>console['error'](a41_0x409a3b[_0x21f187(0xfd)]('✔\x20'+_0x5109a8)),'logWarning':_0x514d0e=>console[_0x21f187(0xbb)](a41_0x409a3b['yellow']('⚠\x20'+_0x514d0e)),'logDeleted':_0x1539cb=>console[_0x21f187(0xbb)](a41_0x409a3b['red']('✔\x20'+_0x1539cb))},_0x45b0aa={'segment':_0x1fcfd8['segment'],'journey':_0x1fcfd8['journey'],'user':_0x1fcfd8['user'],'connection':_0x1fcfd8[_0x21f187(0x78)]};_0x3b94a2[_0x21f187(0xb5)]>0x0&&(_0x3936d7=await executePushFolders(_0x45b0aa,_0x3b94a2,_0x3936d7,{'parentId':_0x552421},_0x54af5b));const _0x1259d7={'rootFolderId':_0x63f345,'folderPathToId':_0x3936d7,'folderIdToPath':_0x37fcc2,'segmentNameToId':_0xd0080a,'activationsBySegmentId':_0x8b9ab7,'emailToIdMap':_0x37f1b9,'idToEmailMap':_0x3b2e50,'connectionNameToIdMap':_0x1097e5[_0x21f187(0xbe)],'connectionIdToNameMap':_0x1097e5['idToName'],'connectionNameToTypeMap':_0x3888fa},_0x35a3fb=await executePushSegments(_0x45b0aa,_0x3e8406['journeysOnly']?[]:_0xcf4a08,_0x1259d7,{'parentId':_0x552421},_0x54af5b),_0x22a77f=_0x35a3fb[_0x21f187(0xb1)],_0x21fbaf=_0x35a3fb[_0x21f187(0x95)],_0x24968a=_0x35a3fb[_0x21f187(0x7a)][_0x21f187(0xb1)],_0x46dd96=_0x35a3fb[_0x21f187(0x7a)][_0x21f187(0x95)],_0x1cd1b5=_0x35a3fb[_0x21f187(0x7a)][_0x21f187(0xa3)];let _0x1f1ab3;if(_0x6f8809&&_0xcf4a08[_0x21f187(0xb5)]===0x1){const _0x3d7cc5=_0xcf4a08[0x0];_0x1f1ab3=_0x3d7cc5[_0x21f187(0x108)]?.['id']??_0x35a3fb[_0x21f187(0x105)][_0x21f187(0xa5)](_0x3d7cc5[_0x21f187(0x10a)][_0x21f187(0xf1)]);}const _0x2d03f2=await executePushSegmentDeletions(_0x45b0aa,_0x3e8406[_0x21f187(0x112)]?[]:_0x3a72bc,_0x54af5b);let _0x4d4b5d=0x0,_0x37561c=0x0,_0x42937c=0x0;const _0x1e223e=new Map(_0xd0080a);for(const [_0x546d5f,_0x28b1e8]of _0x35a3fb[_0x21f187(0x105)]){_0x1e223e[_0x21f187(0x76)](_0x546d5f,_0x28b1e8);}if(_0x1d2a39[_0x21f187(0xb5)]>0x0){const _0x27ec5f={..._0x1259d7,'segmentNameToId':_0x1e223e,'existingSegments':_0x50c0e5,'activationContext':_0x259121},_0x5d0b54=await executePushJourneys(_0x45b0aa,_0x1d2a39,_0x27ec5f,{'parentId':_0x552421,'rootFolderId':_0x63f345,'verbose':_0x3e8406[_0x21f187(0xf5)]},_0x54af5b);_0x4d4b5d=_0x5d0b54[_0x21f187(0xb1)],_0x37561c=_0x5d0b54[_0x21f187(0x95)];if(_0x6f8809&&_0x5d0b54['results']['length']===0x1){const _0x4b2c96=_0x5d0b54[_0x21f187(0xde)][0x0];if(_0x4b2c96[_0x21f187(0x97)]){const _0x2d911a=getConsoleNextUrl(_0x3e8406[_0x21f187(0xad)],_0x21f187(0xf2)+_0x552421+_0x21f187(0xc9)+_0x4b2c96['journeyId']+_0x21f187(0xe5));console[_0x21f187(0xbb)]('\x20\x20'+a41_0x409a3b[_0x21f187(0xd7)](_0x2d911a));}}}for(const _0x41db65 of _0xe6058){console[_0x21f187(0xbb)](a41_0x409a3b['yellow'](_0x21f187(0xc6)+_0x41db65[_0x21f187(0x93)])),_0x42937c++;}const _0x239f2b=[];if(_0x22a77f>0x0)_0x239f2b[_0x21f187(0xd6)](_0x22a77f+_0x21f187(0x10e));if(_0x21fbaf>0x0)_0x239f2b[_0x21f187(0xd6)](_0x21fbaf+_0x21f187(0xcd));if(_0x2d03f2>0x0)_0x239f2b[_0x21f187(0xd6)](_0x2d03f2+_0x21f187(0x7e));const _0x686006=[];if(_0x4d4b5d>0x0)_0x686006[_0x21f187(0xd6)](_0x4d4b5d+_0x21f187(0x10e));if(_0x37561c>0x0)_0x686006[_0x21f187(0xd6)](_0x37561c+_0x21f187(0xcd));if(_0x42937c>0x0)_0x686006[_0x21f187(0xd6)](_0x42937c+'\x20deleted');const _0x50f46b=[];if(_0x24968a>0x0)_0x50f46b[_0x21f187(0xd6)](_0x24968a+'\x20created');if(_0x46dd96>0x0)_0x50f46b[_0x21f187(0xd6)](_0x46dd96+_0x21f187(0xcd));if(_0x1cd1b5>0x0)_0x50f46b['push'](_0x1cd1b5+'\x20deleted');console[_0x21f187(0xbb)](a41_0x409a3b['green']('\x0a✔\x20Push\x20complete'));_0x239f2b[_0x21f187(0xb5)]>0x0&&!_0x3e8406[_0x21f187(0x112)]&&console[_0x21f187(0xbb)](_0x21f187(0xdb)+_0x239f2b['join'](',\x20'));_0x686006[_0x21f187(0xb5)]>0x0&&console['error'](_0x21f187(0xe7)+_0x686006['join'](',\x20'));_0x50f46b['length']>0x0&&!_0x3e8406[_0x21f187(0x112)]&&console[_0x21f187(0xbb)]('\x20\x20Activations:\x20'+_0x50f46b[_0x21f187(0xaa)](',\x20'));if(_0x1f1ab3){const _0x2fd692=getConsoleNextUrl(_0x3e8406[_0x21f187(0xad)],'/app/ps/'+_0x552421+'/e/'+_0x1f1ab3+'/sb/da/esr');console[_0x21f187(0xbb)](_0x21f187(0x86)+a41_0x409a3b[_0x21f187(0xd7)](_0x2fd692));}return 0x0;}}
@@ -1 +1 @@
1
- const a42_0x31fb92=a42_0x25d6;function a42_0x25d6(_0x33644f,_0x112564){_0x33644f=_0x33644f-0x171;const _0x15e632=a42_0x15e6();let _0x25d619=_0x15e632[_0x33644f];return _0x25d619;}(function(_0xc3f5ac,_0xab1058){const _0x1b7b5d=a42_0x25d6,_0x3b489a=_0xc3f5ac();while(!![]){try{const _0x5b1e73=-parseInt(_0x1b7b5d(0x18e))/0x1*(-parseInt(_0x1b7b5d(0x179))/0x2)+parseInt(_0x1b7b5d(0x1a2))/0x3*(-parseInt(_0x1b7b5d(0x177))/0x4)+parseInt(_0x1b7b5d(0x186))/0x5*(-parseInt(_0x1b7b5d(0x18d))/0x6)+parseInt(_0x1b7b5d(0x176))/0x7*(-parseInt(_0x1b7b5d(0x19a))/0x8)+-parseInt(_0x1b7b5d(0x197))/0x9+-parseInt(_0x1b7b5d(0x18c))/0xa+-parseInt(_0x1b7b5d(0x189))/0xb*(-parseInt(_0x1b7b5d(0x174))/0xc);if(_0x5b1e73===_0xab1058)break;else _0x3b489a['push'](_0x3b489a['shift']());}catch(_0x27a908){_0x3b489a['push'](_0x3b489a['shift']());}}}(a42_0x15e6,0xd7a1f));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_0x4d0aa8 from'chalk';export class SegmentUpdateCommand extends BaseCommand{[a42_0x31fb92(0x171)]=a42_0x31fb92(0x19b);[a42_0x31fb92(0x19c)]=a42_0x31fb92(0x173);async['execute'](_0xeff9d){const _0x397946=a42_0x31fb92;console[_0x397946(0x175)](a42_0x4d0aa8[_0x397946(0x19f)](_0x397946(0x180))),console[_0x397946(0x175)](a42_0x4d0aa8[_0x397946(0x19f)](_0x397946(0x185)));const {options:_0x373c4f,args:_0x32474e,tdx:_0x13b7aa}=_0xeff9d,_0x349faa=_0x373c4f;if(_0x32474e[_0x397946(0x17a)]===0x0)return console['error']('Error:\x20Segment\x20path\x20or\x20name\x20is\x20required'),console[_0x397946(0x175)](_0x397946(0x187)),console[_0x397946(0x175)](_0x397946(0x1a0)),console[_0x397946(0x175)](_0x397946(0x172)),console['error'](_0x397946(0x178)),0x1;const _0x2edb02=_0x32474e[0x0],_0x4d7b81=_0x373c4f[_0x397946(0x18b)];let _0xcf89ce=_0x2edb02;_0x4d7b81&&!_0x2edb02[_0x397946(0x17b)]('/')&&(_0xcf89ce=_0x4d7b81+'/'+_0x2edb02,_0x349faa[_0x397946(0x194)]&&console[_0x397946(0x175)]('Resolved\x20relative\x20path\x20to:\x20'+_0xcf89ce));const _0xb560ab=await withSpinner(_0x397946(0x183)+_0xcf89ce+'\x27...',()=>_0x13b7aa[_0x397946(0x198)][_0x397946(0x188)](_0xcf89ce),{'verbose':_0x349faa[_0x397946(0x194)]}),_0x5f38d0=_0xb560ab[_0x397946(0x18f)];_0x349faa[_0x397946(0x194)]&&console['error'](_0x397946(0x196)+_0x5f38d0[_0x397946(0x17e)]);if(_0x5f38d0[_0x397946(0x17e)]!==_0x397946(0x198))return console[_0x397946(0x175)](_0x397946(0x17c)+_0x5f38d0[_0x397946(0x17e)]+'.\x20Only\x20child\x20segments\x20can\x20be\x20updated.'),console[_0x397946(0x175)](_0x397946(0x190)),0x1;if(!_0x5f38d0[_0x397946(0x195)])throw new SDKError(ErrorCode[_0x397946(0x17f)],_0x397946(0x184));const _0x5688a3=_0x5f38d0[_0x397946(0x18a)],_0x418d72=_0x5f38d0['segmentId'];_0x349faa[_0x397946(0x194)]&&(console[_0x397946(0x175)]('Parent\x20ID:\x20'+_0x5688a3),console['error'](_0x397946(0x182)+_0x418d72));let _0x27777f;if(_0x349faa[_0x397946(0x17d)]){const _0x3ef869=_0x349faa[_0x397946(0x17d)],_0x328333=await withSpinner(_0x397946(0x199)+_0x3ef869+_0x397946(0x193),()=>_0x13b7aa['segment']['resolveFolderId'](_0x5688a3,_0x3ef869),{'verbose':_0x349faa[_0x397946(0x194)]});_0x27777f=parseInt(_0x328333[_0x397946(0x18f)],0xa),_0x349faa['verbose']&&console[_0x397946(0x175)](_0x397946(0x19d)+_0x27777f);}const _0x433c6d=await loadJSONFromOptions(_0x349faa['rule'],_0x349faa[_0x397946(0x1a1)]),_0x395458={'name':_0x349faa[_0x397946(0x171)],'description':_0x349faa[_0x397946(0x19c)],'rule':_0x433c6d,'kind':_0x349faa[_0x397946(0x181)]!==undefined?parseInt(_0x349faa['kind'],0xa):undefined,'segmentFolderId':_0x27777f},_0x3a1270=await withSpinner(_0x397946(0x192)+_0x5f38d0[_0x397946(0x19e)]+_0x397946(0x193),()=>_0x13b7aa[_0x397946(0x198)]['updateSegmentById'](_0x5688a3,_0x418d72,_0x395458),{'verbose':_0x349faa[_0x397946(0x194)]}),_0x4a5c2d=_0x3a1270[_0x397946(0x18f)];return console['error']('✔\x20Updated\x20segment\x20\x27'+_0x4a5c2d[_0x397946(0x171)]+'\x27'),_0xcf89ce!==_0x2edb02&&console[_0x397946(0x175)](_0x397946(0x191)+_0xcf89ce),await handleSDKOutput([_0x4a5c2d],_0x349faa),0x0;}}function a42_0x15e6(){const _0x2f07fd=['Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]','\x20\x20\x20Path:\x20','Updating\x20segment\x20\x27','\x27...','verbose','segmentId','Resolved\x20type:\x20','3237813uwunwC','segment','Resolving\x20folder\x20\x27','1400CrbNjY','segment:update','description','Resolved\x20folder\x20ID:\x20','segmentName','yellow','Examples:','ruleFile','2008038tEbUUt','name','\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22','Update\x20existing\x20child\x20segment','12qvyrJb','error','57988ArErot','4lMzCCj','\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','686330DQnDHg','length','includes','Error:\x20Cannot\x20update\x20','folder','type','INTERNAL','⚠\x20Deprecation\x20warning:\x20`segment\x20update`\x20is\x20deprecated.','kind','Segment\x20ID:\x20','Resolving\x20path\x20\x27','Segment\x20ID\x20missing\x20from\x20resolved\x20path','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','828460RuzgCV','Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]','resolvePathToResource','36437159StVKgG','parentId','segmentPath','1279080srWLFh','6CeAIiO','1YpBmPA','data'];a42_0x15e6=function(){return _0x2f07fd;};return a42_0x15e6();}
1
+ const a42_0x1b0ab3=a42_0x1127;(function(_0x5386a5,_0x396891){const _0x2f43d0=a42_0x1127,_0x55df4b=_0x5386a5();while(!![]){try{const _0xbb52a9=-parseInt(_0x2f43d0(0x1bc))/0x1*(-parseInt(_0x2f43d0(0x1d3))/0x2)+-parseInt(_0x2f43d0(0x1e4))/0x3*(-parseInt(_0x2f43d0(0x1bb))/0x4)+parseInt(_0x2f43d0(0x1d4))/0x5+parseInt(_0x2f43d0(0x1bf))/0x6*(parseInt(_0x2f43d0(0x1d5))/0x7)+parseInt(_0x2f43d0(0x1dc))/0x8*(-parseInt(_0x2f43d0(0x1c7))/0x9)+parseInt(_0x2f43d0(0x1d1))/0xa*(-parseInt(_0x2f43d0(0x1c1))/0xb)+-parseInt(_0x2f43d0(0x1dd))/0xc;if(_0xbb52a9===_0x396891)break;else _0x55df4b['push'](_0x55df4b['shift']());}catch(_0x28295c){_0x55df4b['push'](_0x55df4b['shift']());}}}(a42_0x11ad,0xd01cb));import{BaseCommand}from'./command.js';function a42_0x11ad(){const _0x1bcdc9=['Error:\x20Cannot\x20update\x20','Examples:','✔\x20Updated\x20segment\x20\x27','18xUXWbg','description','Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]','segmentId','segment:update','⚠\x20Deprecation\x20warning:\x20`segment\x20update`\x20is\x20deprecated.','INTERNAL','\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22','type','Segment\x20ID:\x20','4470eRUvLk','\x27...','10wPesvx','3787755IpPzaI','35cZBlqu','ruleFile','Resolved\x20relative\x20path\x20to:\x20','\x20\x20\x20Path:\x20','updateSegmentById','includes','resolvePathToResource','4853864llVtgD','23741076eBtJgp','Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]','resolveFolderId','Segment\x20ID\x20missing\x20from\x20resolved\x20path','segmentPath','folder','name','1472301gHzvaj','Resolved\x20type:\x20','segment','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','Updating\x20segment\x20\x27','execute','length','error','Update\x20existing\x20child\x20segment','\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','yellow','data','kind','.\x20Only\x20child\x20segments\x20can\x20be\x20updated.','verbose','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','12sFjGzz','291372FHnBIu','rule','Resolving\x20path\x20\x27','2013114FaJnjV','segmentName','32483qudoJe','parentId','Resolving\x20folder\x20\x27'];a42_0x11ad=function(){return _0x1bcdc9;};return a42_0x11ad();}import{handleSDKOutput}from'../core/command-output.js';function a42_0x1127(_0x4bb16e,_0x1552c8){_0x4bb16e=_0x4bb16e-0x1ae;const _0x11ad42=a42_0x11ad();let _0x11275f=_0x11ad42[_0x4bb16e];return _0x11275f;}import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{SDKError,ErrorCode}from'../sdk/index.js';import a42_0x4925d7 from'chalk';export class SegmentUpdateCommand extends BaseCommand{[a42_0x1b0ab3(0x1e3)]=a42_0x1b0ab3(0x1cb);[a42_0x1b0ab3(0x1c8)]=a42_0x1b0ab3(0x1b3);async[a42_0x1b0ab3(0x1b0)](_0x9da67a){const _0x5c5675=a42_0x1b0ab3;console[_0x5c5675(0x1b2)](a42_0x4925d7[_0x5c5675(0x1b5)](_0x5c5675(0x1cc))),console[_0x5c5675(0x1b2)](a42_0x4925d7[_0x5c5675(0x1b5)](_0x5c5675(0x1ba)));const {options:_0x440d55,args:_0x24c8de,tdx:_0x5c31b0}=_0x9da67a,_0x2378cc=_0x440d55;if(_0x24c8de[_0x5c5675(0x1b1)]===0x0)return console['error'](_0x5c5675(0x1ae)),console['error'](_0x5c5675(0x1c9)),console[_0x5c5675(0x1b2)](_0x5c5675(0x1c5)),console[_0x5c5675(0x1b2)](_0x5c5675(0x1ce)),console[_0x5c5675(0x1b2)](_0x5c5675(0x1b4)),0x1;const _0x4c4ec1=_0x24c8de[0x0],_0x3bbb20=_0x440d55[_0x5c5675(0x1e1)];let _0x1cce89=_0x4c4ec1;_0x3bbb20&&!_0x4c4ec1[_0x5c5675(0x1da)]('/')&&(_0x1cce89=_0x3bbb20+'/'+_0x4c4ec1,_0x2378cc[_0x5c5675(0x1b9)]&&console[_0x5c5675(0x1b2)](_0x5c5675(0x1d7)+_0x1cce89));const _0x782712=await withSpinner(_0x5c5675(0x1be)+_0x1cce89+_0x5c5675(0x1d2),()=>_0x5c31b0[_0x5c5675(0x1e6)][_0x5c5675(0x1db)](_0x1cce89),{'verbose':_0x2378cc['verbose']}),_0x1143f7=_0x782712[_0x5c5675(0x1b6)];_0x2378cc[_0x5c5675(0x1b9)]&&console[_0x5c5675(0x1b2)](_0x5c5675(0x1e5)+_0x1143f7['type']);if(_0x1143f7[_0x5c5675(0x1cf)]!=='segment')return console[_0x5c5675(0x1b2)](_0x5c5675(0x1c4)+_0x1143f7[_0x5c5675(0x1cf)]+_0x5c5675(0x1b8)),console[_0x5c5675(0x1b2)](_0x5c5675(0x1de)),0x1;if(!_0x1143f7[_0x5c5675(0x1ca)])throw new SDKError(ErrorCode[_0x5c5675(0x1cd)],_0x5c5675(0x1e0));const _0x35236d=_0x1143f7[_0x5c5675(0x1c2)],_0x787692=_0x1143f7[_0x5c5675(0x1ca)];_0x2378cc[_0x5c5675(0x1b9)]&&(console[_0x5c5675(0x1b2)]('Parent\x20ID:\x20'+_0x35236d),console[_0x5c5675(0x1b2)](_0x5c5675(0x1d0)+_0x787692));let _0x5b61e5;if(_0x2378cc[_0x5c5675(0x1e2)]){const _0x617604=_0x2378cc[_0x5c5675(0x1e2)],_0x28b5f3=await withSpinner(_0x5c5675(0x1c3)+_0x617604+_0x5c5675(0x1d2),()=>_0x5c31b0['segment'][_0x5c5675(0x1df)](_0x35236d,_0x617604),{'verbose':_0x2378cc[_0x5c5675(0x1b9)]});_0x5b61e5=parseInt(_0x28b5f3[_0x5c5675(0x1b6)],0xa),_0x2378cc[_0x5c5675(0x1b9)]&&console['error']('Resolved\x20folder\x20ID:\x20'+_0x5b61e5);}const _0x430319=await loadJSONFromOptions(_0x2378cc[_0x5c5675(0x1bd)],_0x2378cc[_0x5c5675(0x1d6)]),_0x42f96e={'name':_0x2378cc[_0x5c5675(0x1e3)],'description':_0x2378cc[_0x5c5675(0x1c8)],'rule':_0x430319,'kind':_0x2378cc[_0x5c5675(0x1b7)]!==undefined?parseInt(_0x2378cc[_0x5c5675(0x1b7)],0xa):undefined,'segmentFolderId':_0x5b61e5},_0x5768a5=await withSpinner(_0x5c5675(0x1af)+_0x1143f7[_0x5c5675(0x1c0)]+_0x5c5675(0x1d2),()=>_0x5c31b0['segment'][_0x5c5675(0x1d9)](_0x35236d,_0x787692,_0x42f96e),{'verbose':_0x2378cc[_0x5c5675(0x1b9)]}),_0x1ae080=_0x5768a5[_0x5c5675(0x1b6)];return console[_0x5c5675(0x1b2)](_0x5c5675(0x1c6)+_0x1ae080[_0x5c5675(0x1e3)]+'\x27'),_0x1cce89!==_0x4c4ec1&&console['error'](_0x5c5675(0x1d8)+_0x1cce89),await handleSDKOutput([_0x1ae080],_0x2378cc),0x0;}}
@@ -1 +1 @@
1
- const a43_0x5e4d34=a43_0xfbf7;(function(_0x41f4d7,_0x55974d){const _0x562f3a=a43_0xfbf7,_0xcc57c9=_0x41f4d7();while(!![]){try{const _0x1a56e0=parseInt(_0x562f3a(0xe1))/0x1*(parseInt(_0x562f3a(0x10c))/0x2)+-parseInt(_0x562f3a(0xf0))/0x3+parseInt(_0x562f3a(0x10f))/0x4+parseInt(_0x562f3a(0xe9))/0x5*(-parseInt(_0x562f3a(0xee))/0x6)+parseInt(_0x562f3a(0x10d))/0x7*(-parseInt(_0x562f3a(0xff))/0x8)+parseInt(_0x562f3a(0x102))/0x9+-parseInt(_0x562f3a(0x100))/0xa*(parseInt(_0x562f3a(0xf1))/0xb);if(_0x1a56e0===_0x55974d)break;else _0xcc57c9['push'](_0xcc57c9['shift']());}catch(_0x339613){_0xcc57c9['push'](_0xcc57c9['shift']());}}}(a43_0x5c26,0x52ca7));import{existsSync,statSync}from'fs';import a43_0x35692c from'chalk';function a43_0xfbf7(_0x2462e1,_0x4b2519){_0x2462e1=_0x2462e1-0xd7;const _0x5c2697=a43_0x5c26();let _0xfbf7b5=_0x5c2697[_0x2462e1];return _0xfbf7b5;}import{BaseCommand}from'./command.js';import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';import{parsePath,normalizePath}from'../sdk/segment/segment-path-parser.js';import{findTdxConfig}from'../sdk/segment/tdx-config.js';export class SegmentUseCommand extends BaseCommand{[a43_0x5e4d34(0xf9)]='segment:use';[a43_0x5e4d34(0xe6)]=a43_0x5e4d34(0xdf);async[a43_0x5e4d34(0xe0)](_0x370c9d){const _0x3adfa1=a43_0x5e4d34,{options:_0x434c31,args:_0x274263,tdx:_0x54d869}=_0x370c9d;if(_0x274263[_0x3adfa1(0xd8)]===0x0)return console[_0x3adfa1(0xf2)](a43_0x35692c[_0x3adfa1(0xf5)](_0x3adfa1(0xfe))),console[_0x3adfa1(0xf2)]('Usage:\x20tdx\x20segment\x20use\x20<path>'),console[_0x3adfa1(0xf2)](_0x3adfa1(0xec)),console['error'](_0x3adfa1(0x10e)),console['error']('\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22'),console[_0x3adfa1(0xf2)](_0x3adfa1(0x10a)),console['error'](_0x3adfa1(0xe7)),0x1;const _0x26d59e=_0x274263[0x0],_0x368df1=_0x434c31[_0x3adfa1(0xda)];try{if(_0x26d59e==='/')return saveSessionContext({'segment_path':undefined},_0x368df1),console['log'](a43_0x35692c['green'](_0x3adfa1(0xe8))),0x0;if(existsSync(_0x26d59e)&&statSync(_0x26d59e)['isDirectory']()){let _0x201cae;try{_0x201cae=findTdxConfig(_0x26d59e);}catch{return console[_0x3adfa1(0xf2)](a43_0x35692c[_0x3adfa1(0xf5)](_0x3adfa1(0xe2)+_0x26d59e)),console['error'](a43_0x35692c[_0x3adfa1(0xe3)](_0x3adfa1(0xea))),0x1;}const _0x2abadd=_0x201cae[_0x3adfa1(0xd9)][_0x3adfa1(0x106)];return saveSessionContext({'segment_path':_0x2abadd,'parent_segment':_0x2abadd},_0x368df1),console[_0x3adfa1(0x104)](a43_0x35692c[_0x3adfa1(0xe5)](_0x3adfa1(0xeb)+a43_0x35692c[_0x3adfa1(0xe3)](_0x2abadd))),0x0;}const _0x463f04=_0x434c31[_0x3adfa1(0xef)];let _0x286bee=_0x26d59e;const _0x1803b1=parsePath(_0x26d59e);if(!_0x1803b1[_0x3adfa1(0xf4)]){if(!_0x463f04)return console[_0x3adfa1(0xf2)](a43_0x35692c[_0x3adfa1(0xf5)]('Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.')),console['error'](a43_0x35692c[_0x3adfa1(0xe3)](_0x3adfa1(0x101))),0x1;if(_0x26d59e==='..'){const _0xcc72e7=_0x463f04[_0x3adfa1(0x110)]('/')['slice'](0x0,-0x1)[_0x3adfa1(0xf7)]('/');_0x286bee=_0xcc72e7||'/';}else _0x26d59e==='.'?_0x286bee=_0x463f04:_0x286bee=_0x463f04+'/'+_0x26d59e;_0x434c31['verbose']&&console[_0x3adfa1(0xf2)](_0x3adfa1(0x109)+_0x286bee);}if(_0x286bee==='/'||_0x286bee==='')return saveSessionContext({'segment_path':undefined},_0x368df1),console[_0x3adfa1(0x104)](a43_0x35692c['green'](_0x3adfa1(0xe8))),0x0;_0x286bee=normalizePath(_0x286bee);const _0x27bb35=parsePath(_0x286bee)[_0x3adfa1(0xde)];if(_0x27bb35[_0x3adfa1(0xd8)]===0x0)return saveSessionContext({'segment_path':undefined},_0x368df1),console[_0x3adfa1(0x104)](a43_0x35692c[_0x3adfa1(0xe5)](_0x3adfa1(0xe8))),0x0;_0x434c31[_0x3adfa1(0xe4)]&&(console[_0x3adfa1(0xf2)](_0x3adfa1(0x111)+_0x434c31[_0x3adfa1(0x103)]),console[_0x3adfa1(0xf2)](_0x3adfa1(0xfc)+_0x286bee));const _0x5b76e3=await withSpinner(_0x3adfa1(0xdd)+_0x286bee+_0x3adfa1(0xf6),()=>_0x54d869[_0x3adfa1(0xd7)][_0x3adfa1(0x107)](_0x286bee),{'verbose':_0x434c31[_0x3adfa1(0xe4)]}),_0x5c23bf=_0x5b76e3[_0x3adfa1(0xfd)];_0x434c31[_0x3adfa1(0xe4)]&&(console[_0x3adfa1(0xf2)](_0x3adfa1(0x108)+_0x5c23bf[_0x3adfa1(0x105)]),console['error']('Parent\x20ID:\x20'+_0x5c23bf[_0x3adfa1(0x10b)]),_0x5c23bf[_0x3adfa1(0xed)]&&console[_0x3adfa1(0xf2)](_0x3adfa1(0xdb)+_0x5c23bf[_0x3adfa1(0xed)]));if(_0x5c23bf[_0x3adfa1(0x105)]===_0x3adfa1(0xd7))return console[_0x3adfa1(0xf2)](a43_0x35692c[_0x3adfa1(0xf5)]('Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.')),console['error'](_0x3adfa1(0xfa)),console[_0x3adfa1(0xf2)](a43_0x35692c[_0x3adfa1(0xe3)]('Use:\x20tdx\x20segment\x20use\x20'+_0x5c23bf['parentName']+(_0x5c23bf[_0x3adfa1(0xdc)]?'/'+_0x5c23bf[_0x3adfa1(0xdc)]['join']('/'):''))),0x1;return saveSessionContext({'segment_path':_0x5c23bf[_0x3adfa1(0xfb)],'parent_segment':_0x5c23bf['parentName']},_0x368df1),console[_0x3adfa1(0x104)](a43_0x35692c[_0x3adfa1(0xe5)](_0x3adfa1(0xeb)+a43_0x35692c[_0x3adfa1(0xe3)](_0x5c23bf['fullPath']))),_0x434c31[_0x3adfa1(0xe4)]&&(console[_0x3adfa1(0xf2)](a43_0x35692c[_0x3adfa1(0xf8)]('Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context')),console['error'](a43_0x35692c[_0x3adfa1(0xf8)](_0x3adfa1(0xf3)))),0x0;}catch(_0xe75669){throw _0xe75669;}}}function a43_0x5c26(){const _0x3484c1=['3817121xIfsXK','error','Use\x20\x22tdx\x20use\x22\x20to\x20see\x20all\x20context\x20parameters','isAbsolute','red','\x27...','join','dim','name','Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.','fullPath','Target\x20path:\x20','data','Error:\x20Path\x20is\x20required\x0a','1464VDyKUo','10rPklxf','Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>','5330817BaIMpP','site','log','type','parent_segment','resolvePathToResource','Resolved\x20path\x20type:\x20','Resolved\x20relative\x20path\x20to:\x20','\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context','parentId','228ONOtwH','23583bKtqsK','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22','2024252gWcZxA','split','Site:\x20','segment','length','config','session','Folder\x20ID:\x20','folderPath','Resolving\x20path\x20\x27','segments','Set\x20current\x20segment/folder\x20context\x20for\x20navigation','execute','5657Fotjhf','Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','cyan','verbose','green','description','\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent','✔\x20Context\x20cleared.\x20Back\x20to\x20root.','205xeSrDv','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','✔\x20Context\x20set\x20to:\x20','Examples:','folderId','15450hvFccq','segmentPath','1005150IgNvMi'];a43_0x5c26=function(){return _0x3484c1;};return a43_0x5c26();}
1
+ const a43_0x1eb773=a43_0x4fc4;(function(_0x3f2abf,_0x2454b9){const _0x27ed6e=a43_0x4fc4,_0x5bdffe=_0x3f2abf();while(!![]){try{const _0x363026=parseInt(_0x27ed6e(0x121))/0x1*(parseInt(_0x27ed6e(0x134))/0x2)+parseInt(_0x27ed6e(0x138))/0x3*(parseInt(_0x27ed6e(0x107))/0x4)+-parseInt(_0x27ed6e(0x12e))/0x5*(parseInt(_0x27ed6e(0x12c))/0x6)+parseInt(_0x27ed6e(0x108))/0x7*(-parseInt(_0x27ed6e(0x118))/0x8)+parseInt(_0x27ed6e(0x12a))/0x9*(-parseInt(_0x27ed6e(0x11b))/0xa)+-parseInt(_0x27ed6e(0x119))/0xb*(parseInt(_0x27ed6e(0x102))/0xc)+parseInt(_0x27ed6e(0x110))/0xd;if(_0x363026===_0x2454b9)break;else _0x5bdffe['push'](_0x5bdffe['shift']());}catch(_0x58e7ca){_0x5bdffe['push'](_0x5bdffe['shift']());}}}(a43_0x2543,0x5e487));import{existsSync,statSync}from'fs';import a43_0x17eaa4 from'chalk';import{BaseCommand}from'./command.js';import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';function a43_0x2543(){const _0x23a8ba=['2082311OgFtKG','isAbsolute','589010YkPoef','folderId','data','segment','fullPath','log','1XsoVfV','verbose','Target\x20path:\x20','Site:\x20','segments','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22','length','folderPath','config','54XSMfKp','Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.','12iCzghX','Folder\x20ID:\x20','130415lUExdw','Resolved\x20path\x20type:\x20','Resolved\x20relative\x20path\x20to:\x20','Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.','Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context','parentName','1006524mCJLVQ','green','dim','Set\x20current\x20segment/folder\x20context\x20for\x20navigation','2631iMBGew','parent_segment','resolvePathToResource','48jhdehk','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22','isDirectory','Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.','Parent\x20ID:\x20','2728kWcmpw','3843EtRJaC','✔\x20Context\x20cleared.\x20Back\x20to\x20root.','segmentPath','error','name','site','✔\x20Context\x20set\x20to:\x20','Examples:','8894626uXRMJG','execute','split','\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context','slice','join','cyan','red','3448ctJLGB'];a43_0x2543=function(){return _0x23a8ba;};return a43_0x2543();}import{parsePath,normalizePath}from'../sdk/segment/segment-path-parser.js';import{findTdxConfig}from'../sdk/segment/tdx-config.js';function a43_0x4fc4(_0x2cc35b,_0x262ed3){_0x2cc35b=_0x2cc35b-0x101;const _0x2543e9=a43_0x2543();let _0x4fc485=_0x2543e9[_0x2cc35b];return _0x4fc485;}export class SegmentUseCommand extends BaseCommand{[a43_0x1eb773(0x10c)]='segment:use';['description']=a43_0x1eb773(0x137);async[a43_0x1eb773(0x111)](_0x1e2992){const _0x3a7f23=a43_0x1eb773,{options:_0x50e946,args:_0x11eb7d,tdx:_0x1ef584}=_0x1e2992;if(_0x11eb7d[_0x3a7f23(0x127)]===0x0)return console[_0x3a7f23(0x10b)](a43_0x17eaa4['red']('Error:\x20Path\x20is\x20required\x0a')),console['error']('Usage:\x20tdx\x20segment\x20use\x20<path>'),console[_0x3a7f23(0x10b)](_0x3a7f23(0x10f)),console[_0x3a7f23(0x10b)](_0x3a7f23(0x126)),console[_0x3a7f23(0x10b)](_0x3a7f23(0x103)),console[_0x3a7f23(0x10b)](_0x3a7f23(0x113)),console[_0x3a7f23(0x10b)]('\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent'),0x1;const _0x4e7972=_0x11eb7d[0x0],_0x208b02=_0x50e946['session'];try{if(_0x4e7972==='/')return saveSessionContext({'segment_path':undefined},_0x208b02),console[_0x3a7f23(0x120)](a43_0x17eaa4[_0x3a7f23(0x135)]('✔\x20Context\x20cleared.\x20Back\x20to\x20root.')),0x0;if(existsSync(_0x4e7972)&&statSync(_0x4e7972)[_0x3a7f23(0x104)]()){let _0x5a22b5;try{_0x5a22b5=findTdxConfig(_0x4e7972);}catch{return console[_0x3a7f23(0x10b)](a43_0x17eaa4[_0x3a7f23(0x117)]('Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20'+_0x4e7972)),console[_0x3a7f23(0x10b)](a43_0x17eaa4['cyan']('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;}const _0x17312d=_0x5a22b5[_0x3a7f23(0x129)][_0x3a7f23(0x139)];return saveSessionContext({'segment_path':_0x17312d,'parent_segment':_0x17312d},_0x208b02),console['log'](a43_0x17eaa4[_0x3a7f23(0x135)](_0x3a7f23(0x10e)+a43_0x17eaa4['cyan'](_0x17312d))),0x0;}const _0x4066d3=_0x50e946[_0x3a7f23(0x10a)];let _0x5c0dc9=_0x4e7972;const _0x22008d=parsePath(_0x4e7972);if(!_0x22008d[_0x3a7f23(0x11a)]){if(!_0x4066d3)return console[_0x3a7f23(0x10b)](a43_0x17eaa4[_0x3a7f23(0x117)](_0x3a7f23(0x12b))),console['error'](a43_0x17eaa4[_0x3a7f23(0x116)]('Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>')),0x1;if(_0x4e7972==='..'){const _0x2797f2=_0x4066d3[_0x3a7f23(0x112)]('/')[_0x3a7f23(0x114)](0x0,-0x1)[_0x3a7f23(0x115)]('/');_0x5c0dc9=_0x2797f2||'/';}else _0x4e7972==='.'?_0x5c0dc9=_0x4066d3:_0x5c0dc9=_0x4066d3+'/'+_0x4e7972;_0x50e946[_0x3a7f23(0x122)]&&console[_0x3a7f23(0x10b)](_0x3a7f23(0x130)+_0x5c0dc9);}if(_0x5c0dc9==='/'||_0x5c0dc9==='')return saveSessionContext({'segment_path':undefined},_0x208b02),console[_0x3a7f23(0x120)](a43_0x17eaa4['green'](_0x3a7f23(0x109))),0x0;_0x5c0dc9=normalizePath(_0x5c0dc9);const _0x3622e3=parsePath(_0x5c0dc9)[_0x3a7f23(0x125)];if(_0x3622e3[_0x3a7f23(0x127)]===0x0)return saveSessionContext({'segment_path':undefined},_0x208b02),console[_0x3a7f23(0x120)](a43_0x17eaa4[_0x3a7f23(0x135)](_0x3a7f23(0x109))),0x0;_0x50e946['verbose']&&(console[_0x3a7f23(0x10b)](_0x3a7f23(0x124)+_0x50e946[_0x3a7f23(0x10d)]),console[_0x3a7f23(0x10b)](_0x3a7f23(0x123)+_0x5c0dc9));const _0x1396b9=await withSpinner('Resolving\x20path\x20\x27'+_0x5c0dc9+'\x27...',()=>_0x1ef584['segment'][_0x3a7f23(0x101)](_0x5c0dc9),{'verbose':_0x50e946[_0x3a7f23(0x122)]}),_0x298497=_0x1396b9[_0x3a7f23(0x11d)];_0x50e946[_0x3a7f23(0x122)]&&(console[_0x3a7f23(0x10b)](_0x3a7f23(0x12f)+_0x298497['type']),console['error'](_0x3a7f23(0x106)+_0x298497['parentId']),_0x298497[_0x3a7f23(0x11c)]&&console[_0x3a7f23(0x10b)](_0x3a7f23(0x12d)+_0x298497['folderId']));if(_0x298497['type']===_0x3a7f23(0x11e))return console['error'](a43_0x17eaa4[_0x3a7f23(0x117)](_0x3a7f23(0x105))),console[_0x3a7f23(0x10b)](_0x3a7f23(0x131)),console[_0x3a7f23(0x10b)](a43_0x17eaa4[_0x3a7f23(0x116)]('Use:\x20tdx\x20segment\x20use\x20'+_0x298497['parentName']+(_0x298497['folderPath']?'/'+_0x298497[_0x3a7f23(0x128)][_0x3a7f23(0x115)]('/'):''))),0x1;return saveSessionContext({'segment_path':_0x298497[_0x3a7f23(0x11f)],'parent_segment':_0x298497[_0x3a7f23(0x133)]},_0x208b02),console[_0x3a7f23(0x120)](a43_0x17eaa4[_0x3a7f23(0x135)](_0x3a7f23(0x10e)+a43_0x17eaa4[_0x3a7f23(0x116)](_0x298497[_0x3a7f23(0x11f)]))),_0x50e946[_0x3a7f23(0x122)]&&(console[_0x3a7f23(0x10b)](a43_0x17eaa4[_0x3a7f23(0x136)](_0x3a7f23(0x132))),console[_0x3a7f23(0x10b)](a43_0x17eaa4['dim']('Use\x20\x22tdx\x20use\x22\x20to\x20see\x20all\x20context\x20parameters'))),0x0;}catch(_0x1cbd4e){throw _0x1cbd4e;}}}
@@ -1 +1 @@
1
- const a44_0x2ffd19=a44_0x337b;(function(_0x539243,_0x4b416f){const _0x17d5c9=a44_0x337b,_0x527419=_0x539243();while(!![]){try{const _0xdb875c=parseInt(_0x17d5c9(0x207))/0x1*(parseInt(_0x17d5c9(0x209))/0x2)+parseInt(_0x17d5c9(0x1ef))/0x3*(-parseInt(_0x17d5c9(0x1e8))/0x4)+-parseInt(_0x17d5c9(0x1e9))/0x5+parseInt(_0x17d5c9(0x1ff))/0x6+-parseInt(_0x17d5c9(0x1fb))/0x7+-parseInt(_0x17d5c9(0x21a))/0x8*(-parseInt(_0x17d5c9(0x210))/0x9)+-parseInt(_0x17d5c9(0x202))/0xa*(-parseInt(_0x17d5c9(0x1f5))/0xb);if(_0xdb875c===_0x4b416f)break;else _0x527419['push'](_0x527419['shift']());}catch(_0x30c1a7){_0x527419['push'](_0x527419['shift']());}}}(a44_0x1cc7,0x49449));import{BaseCommand}from'./command.js';function a44_0x337b(_0x43c7eb,_0x278eb7){_0x43c7eb=_0x43c7eb-0x1e7;const _0x1cc700=a44_0x1cc7();let _0x337b79=_0x1cc700[_0x43c7eb];return _0x337b79;}import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';import a44_0x42519d from'chalk';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';function a44_0x1cc7(){const _0x271cce=['\x20valid','Error:\x20Directory\x20not\x20found:\x20','1985683ZenhRw','no_parent','Error:\x20','hasErrors','1568484hNHQCQ','cwd','segment:validate','1011610NwYNqr','warnings','green','Validation\x20failed:\x20','\x20warning(s)\x20found','152183ZdjUvw','valid','2Hkyqqs','file','warningCount','type','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file','\x20file(s)\x20with\x20errors,\x20','message','3717KgFoaM','length','errorCode','error','invalidCount','\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','log','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','yellow','endsWith','9336JBOsdU','targetDir','\x20error(s)','✔\x20All\x20','execute','40568IhoMvN','1454960mZXTSA','description','dim','helpText','errors','):\x20','66tIQzNM','validCount','Validate\x20segment\x20and\x20journey\x20YAML\x20files','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','\x20warning(s)','red','22jzipPP','cyan','parentSegment','verbose'];a44_0x1cc7=function(){return _0x271cce;};return a44_0x1cc7();}import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class SegmentValidateCommand extends BaseCommand{['name']=a44_0x2ffd19(0x201);[a44_0x2ffd19(0x1ea)]=a44_0x2ffd19(0x1f1);async[a44_0x2ffd19(0x1e7)](_0x5c0130){const _0x3e7d85=a44_0x2ffd19,{options:_0x8da403,args:_0x4bfc73}=_0x5c0130,_0x2c093d=_0x8da403,_0x10a45e=await resolveTarget({'arg':_0x4bfc73[0x0],'contextParent':_0x8da403[_0x3e7d85(0x1f7)],'cwd':process[_0x3e7d85(0x200)]()});if(!isSuccessfulResolution(_0x10a45e))return _0x10a45e[_0x3e7d85(0x212)]===_0x3e7d85(0x1fc)?(console[_0x3e7d85(0x213)](a44_0x42519d[_0x3e7d85(0x218)](_0x3e7d85(0x1f2))),console['error']('Usage:\x20tdx\x20sg\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)'),console[_0x3e7d85(0x213)](_0x3e7d85(0x215)),console[_0x3e7d85(0x213)](_0x3e7d85(0x20d))):(console['error'](a44_0x42519d[_0x3e7d85(0x1f4)](_0x3e7d85(0x1fd)+_0x10a45e[_0x3e7d85(0x20f)]+'\x0a')),_0x10a45e[_0x3e7d85(0x1ec)]&&console[_0x3e7d85(0x213)](a44_0x42519d[_0x3e7d85(0x1f6)](_0x10a45e[_0x3e7d85(0x1ec)]))),0x1;const _0x1fd3f7=_0x10a45e[_0x3e7d85(0x21b)],_0x5073b8=_0x10a45e[_0x3e7d85(0x20c)]===_0x3e7d85(0x20a)?_0x10a45e['filePath']:undefined;if(!_0x5073b8&&!existsSync(_0x1fd3f7))return console['error'](a44_0x42519d[_0x3e7d85(0x1f4)](_0x3e7d85(0x1fa)+_0x1fd3f7+'\x0a')),0x1;let _0x2a72ab;if(_0x5073b8){if(!_0x5073b8[_0x3e7d85(0x219)]('.yml')&&!_0x5073b8[_0x3e7d85(0x219)]('.yaml'))return console['error'](a44_0x42519d[_0x3e7d85(0x1f4)]('Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20'+_0x5073b8+'\x0a')),0x1;_0x2a72ab=[_0x5073b8];}else _0x2a72ab=findYamlFiles(_0x1fd3f7);if(_0x2a72ab[_0x3e7d85(0x211)]===0x0)return console[_0x3e7d85(0x213)](a44_0x42519d[_0x3e7d85(0x1f4)](_0x3e7d85(0x217)+_0x1fd3f7+'\x0a')),0x1;const _0x14fe11=validateYamlFiles(_0x2a72ab,_0x1fd3f7),_0x2a9f3c=calculateSummary(_0x14fe11);for(const _0xd13da2 of _0x14fe11){if(!isValidationResult(_0xd13da2))continue;const {relativePath:_0x3e4724,source:_0x14d326,result:_0x4c6c01,fileType:_0x1b5117}=_0xd13da2,_0x5dd593=_0x1b5117;if(_0x4c6c01['valid']&&_0x4c6c01[_0x3e7d85(0x203)]['length']===0x0)_0x2c093d[_0x3e7d85(0x1f8)]&&console[_0x3e7d85(0x216)](a44_0x42519d['green']('✔\x20'+_0x3e4724)+a44_0x42519d[_0x3e7d85(0x1eb)]('\x20('+_0x5dd593+')'));else _0x4c6c01[_0x3e7d85(0x208)]?(console['log'](a44_0x42519d[_0x3e7d85(0x218)]('⚠\x20'+_0x3e4724)+a44_0x42519d[_0x3e7d85(0x1eb)]('\x20('+_0x5dd593+_0x3e7d85(0x1ee)+_0x4c6c01[_0x3e7d85(0x203)][_0x3e7d85(0x211)]+_0x3e7d85(0x1f3))),console[_0x3e7d85(0x216)](formatValidationResult(_0x4c6c01,_0x14d326,_0x3e4724))):(console[_0x3e7d85(0x216)](a44_0x42519d['red']('✖\x20'+_0x3e4724)+a44_0x42519d[_0x3e7d85(0x1eb)]('\x20('+_0x5dd593+_0x3e7d85(0x1ee)+_0x4c6c01[_0x3e7d85(0x1ed)]['length']+_0x3e7d85(0x21c))),console[_0x3e7d85(0x216)](formatValidationResult(_0x4c6c01,_0x14d326,_0x3e4724)));}return console[_0x3e7d85(0x216)](''),_0x2a9f3c[_0x3e7d85(0x1fe)]?(console['log'](a44_0x42519d[_0x3e7d85(0x1f4)](_0x3e7d85(0x205)+_0x2a9f3c[_0x3e7d85(0x214)]+_0x3e7d85(0x20e)+_0x2a9f3c['validCount']+_0x3e7d85(0x1f9))),_0x2a9f3c[_0x3e7d85(0x20b)]>0x0&&console['log'](a44_0x42519d['yellow'](_0x2a9f3c[_0x3e7d85(0x20b)]+_0x3e7d85(0x206))),0x1):(console['log'](a44_0x42519d[_0x3e7d85(0x204)](_0x3e7d85(0x21d)+_0x2a9f3c[_0x3e7d85(0x1f0)]+'\x20file(s)\x20valid')),_0x2a9f3c[_0x3e7d85(0x20b)]>0x0&&console['log'](a44_0x42519d['yellow'](_0x2a9f3c[_0x3e7d85(0x20b)]+_0x3e7d85(0x206))),0x0);}}
1
+ const a44_0x1997dc=a44_0x46b8;(function(_0x1a287c,_0x485df3){const _0x49a5d4=a44_0x46b8,_0x3b391d=_0x1a287c();while(!![]){try{const _0x50858f=-parseInt(_0x49a5d4(0x10f))/0x1+parseInt(_0x49a5d4(0x118))/0x2*(-parseInt(_0x49a5d4(0x112))/0x3)+parseInt(_0x49a5d4(0x110))/0x4+parseInt(_0x49a5d4(0x10e))/0x5*(-parseInt(_0x49a5d4(0x121))/0x6)+parseInt(_0x49a5d4(0x12d))/0x7+-parseInt(_0x49a5d4(0x122))/0x8*(-parseInt(_0x49a5d4(0x125))/0x9)+-parseInt(_0x49a5d4(0x11d))/0xa;if(_0x50858f===_0x485df3)break;else _0x3b391d['push'](_0x3b391d['shift']());}catch(_0x5c0e13){_0x3b391d['push'](_0x3b391d['shift']());}}}(a44_0x33ab,0x576fb));import{BaseCommand}from'./command.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';import a44_0x5211c7 from'chalk';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';function a44_0x33ab(){const _0x306717=['\x20error(s)','2797753xxKvMM','dim','\x20valid','\x20file(s)\x20with\x20errors,\x20','yellow','cyan','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','\x20warning(s)','✔\x20All\x20','hasErrors','message','red','name','filePath','Usage:\x20tdx\x20sg\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)','warningCount','no_parent','length','20UuDpEm','58557coBIhj','1784960LMviwo','\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','11277Pvidzo','valid','log','endsWith','file','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file','76zOwExV','error','description','Validate\x20segment\x20and\x20journey\x20YAML\x20files','errorCode','2378770qVbJKw','execute','green','\x20warning(s)\x20found','409914jQqlcU','24WzOXFG','):\x20','warnings','674316MrcVUe','validCount','cwd','helpText','Validation\x20failed:\x20','parentSegment','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a'];a44_0x33ab=function(){return _0x306717;};return a44_0x33ab();}import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';function a44_0x46b8(_0x554ca5,_0x5c1977){_0x554ca5=_0x554ca5-0x101;const _0x33ab20=a44_0x33ab();let _0x46b822=_0x33ab20[_0x554ca5];return _0x46b822;}export class SegmentValidateCommand extends BaseCommand{[a44_0x1997dc(0x108)]='segment:validate';[a44_0x1997dc(0x11a)]=a44_0x1997dc(0x11b);async[a44_0x1997dc(0x11e)](_0x275d8c){const _0x26f86f=a44_0x1997dc,{options:_0x3e1518,args:_0x137eb5}=_0x275d8c,_0x3c0e92=_0x3e1518,_0xf3175c=await resolveTarget({'arg':_0x137eb5[0x0],'contextParent':_0x3e1518[_0x26f86f(0x12a)],'cwd':process[_0x26f86f(0x127)]()});if(!isSuccessfulResolution(_0xf3175c))return _0xf3175c[_0x26f86f(0x11c)]===_0x26f86f(0x10c)?(console[_0x26f86f(0x119)](a44_0x5211c7['yellow'](_0x26f86f(0x12b))),console[_0x26f86f(0x119)](_0x26f86f(0x10a)),console['error'](_0x26f86f(0x111)),console['error'](_0x26f86f(0x117))):(console[_0x26f86f(0x119)](a44_0x5211c7[_0x26f86f(0x107)]('Error:\x20'+_0xf3175c[_0x26f86f(0x106)]+'\x0a')),_0xf3175c[_0x26f86f(0x128)]&&console[_0x26f86f(0x119)](a44_0x5211c7[_0x26f86f(0x101)](_0xf3175c[_0x26f86f(0x128)]))),0x1;const _0x190f4b=_0xf3175c['targetDir'],_0x25d3cb=_0xf3175c['type']===_0x26f86f(0x116)?_0xf3175c[_0x26f86f(0x109)]:undefined;if(!_0x25d3cb&&!existsSync(_0x190f4b))return console[_0x26f86f(0x119)](a44_0x5211c7[_0x26f86f(0x107)]('Error:\x20Directory\x20not\x20found:\x20'+_0x190f4b+'\x0a')),0x1;let _0x2b9392;if(_0x25d3cb){if(!_0x25d3cb['endsWith']('.yml')&&!_0x25d3cb[_0x26f86f(0x115)]('.yaml'))return console['error'](a44_0x5211c7[_0x26f86f(0x107)](_0x26f86f(0x102)+_0x25d3cb+'\x0a')),0x1;_0x2b9392=[_0x25d3cb];}else _0x2b9392=findYamlFiles(_0x190f4b);if(_0x2b9392[_0x26f86f(0x10d)]===0x0)return console['error'](a44_0x5211c7[_0x26f86f(0x107)]('Error:\x20No\x20YAML\x20files\x20found\x20in\x20'+_0x190f4b+'\x0a')),0x1;const _0x5db7d8=validateYamlFiles(_0x2b9392,_0x190f4b),_0x3293de=calculateSummary(_0x5db7d8);for(const _0x4c5fea of _0x5db7d8){if(!isValidationResult(_0x4c5fea))continue;const {relativePath:_0x4193b8,source:_0x38cbfd,result:_0x3d827a,fileType:_0x14441d}=_0x4c5fea,_0x30099f=_0x14441d;if(_0x3d827a[_0x26f86f(0x113)]&&_0x3d827a[_0x26f86f(0x124)][_0x26f86f(0x10d)]===0x0)_0x3c0e92['verbose']&&console[_0x26f86f(0x114)](a44_0x5211c7[_0x26f86f(0x11f)]('✔\x20'+_0x4193b8)+a44_0x5211c7[_0x26f86f(0x12e)]('\x20('+_0x30099f+')'));else _0x3d827a[_0x26f86f(0x113)]?(console[_0x26f86f(0x114)](a44_0x5211c7[_0x26f86f(0x131)]('⚠\x20'+_0x4193b8)+a44_0x5211c7[_0x26f86f(0x12e)]('\x20('+_0x30099f+_0x26f86f(0x123)+_0x3d827a[_0x26f86f(0x124)]['length']+_0x26f86f(0x103))),console[_0x26f86f(0x114)](formatValidationResult(_0x3d827a,_0x38cbfd,_0x4193b8))):(console[_0x26f86f(0x114)](a44_0x5211c7[_0x26f86f(0x107)]('✖\x20'+_0x4193b8)+a44_0x5211c7[_0x26f86f(0x12e)]('\x20('+_0x30099f+_0x26f86f(0x123)+_0x3d827a['errors'][_0x26f86f(0x10d)]+_0x26f86f(0x12c))),console[_0x26f86f(0x114)](formatValidationResult(_0x3d827a,_0x38cbfd,_0x4193b8)));}return console[_0x26f86f(0x114)](''),_0x3293de[_0x26f86f(0x105)]?(console[_0x26f86f(0x114)](a44_0x5211c7['red'](_0x26f86f(0x129)+_0x3293de['invalidCount']+_0x26f86f(0x130)+_0x3293de[_0x26f86f(0x126)]+_0x26f86f(0x12f))),_0x3293de[_0x26f86f(0x10b)]>0x0&&console['log'](a44_0x5211c7['yellow'](_0x3293de['warningCount']+'\x20warning(s)\x20found')),0x1):(console[_0x26f86f(0x114)](a44_0x5211c7['green'](_0x26f86f(0x104)+_0x3293de['validCount']+'\x20file(s)\x20valid')),_0x3293de[_0x26f86f(0x10b)]>0x0&&console[_0x26f86f(0x114)](a44_0x5211c7['yellow'](_0x3293de[_0x26f86f(0x10b)]+_0x26f86f(0x120))),0x0);}}
@@ -1 +1 @@
1
- const a45_0x123d56=a45_0x1f52;(function(_0x34a8fc,_0x290f3d){const _0x30ea3f=a45_0x1f52,_0x1e71c1=_0x34a8fc();while(!![]){try{const _0x200702=-parseInt(_0x30ea3f(0x10b))/0x1*(-parseInt(_0x30ea3f(0x12e))/0x2)+parseInt(_0x30ea3f(0x115))/0x3+-parseInt(_0x30ea3f(0xfa))/0x4+parseInt(_0x30ea3f(0x134))/0x5*(-parseInt(_0x30ea3f(0x105))/0x6)+parseInt(_0x30ea3f(0x12a))/0x7*(parseInt(_0x30ea3f(0x140))/0x8)+-parseInt(_0x30ea3f(0x137))/0x9+parseInt(_0x30ea3f(0x122))/0xa;if(_0x200702===_0x290f3d)break;else _0x1e71c1['push'](_0x1e71c1['shift']());}catch(_0x59ce17){_0x1e71c1['push'](_0x1e71c1['shift']());}}}(a45_0x5b34,0x9e68c));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';function a45_0x1f52(_0x2fa69c,_0x57fec0){_0x2fa69c=_0x2fa69c-0xf5;const _0x5b3449=a45_0x5b34();let _0x1f52b3=_0x5b3449[_0x2fa69c];return _0x1f52b3;}import{withSpinner}from'../utils/spinner.js';import{formatFlatList,formatTree}from'../sdk/util/tree-formatter.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import a45_0x19e04e from'chalk';export class SegmentsCommand extends BaseCommand{[a45_0x123d56(0x136)]=a45_0x123d56(0x10d);[a45_0x123d56(0x111)]=a45_0x123d56(0x117);async[a45_0x123d56(0x11c)](_0x1c9569){const _0x369665=a45_0x123d56,{options:_0x9923b6,args:_0x265c09}=_0x1c9569,_0x2735af=_0x9923b6[_0x369665(0x133)],_0x2ee778=_0x265c09[0x0];try{const _0x379789=_0x9923b6[_0x369665(0x124)];_0x9923b6[_0x369665(0x142)]&&(console[_0x369665(0x125)](_0x369665(0x116)+_0x9923b6[_0x369665(0x130)]),console[_0x369665(0x125)]('Parent\x20segment\x20context:\x20'+(_0x379789||'(not\x20set)')),_0x2ee778&&console[_0x369665(0x125)](_0x369665(0x127)+_0x2ee778),_0x2735af&&console[_0x369665(0x125)](_0x369665(0xf7)));if(!_0x379789)return console[_0x369665(0x125)](_0x369665(0x11d)),console['error'](''),console[_0x369665(0x125)](_0x369665(0x113)),console['error'](_0x369665(0x11a)),console[_0x369665(0x125)]('\x20\x20tdx\x20sg\x20use\x20\x22My\x20Audience\x22'),console[_0x369665(0x125)](''),console[_0x369665(0x125)](_0x369665(0x108)),0x1;const _0x4722a0=_0x2ee778&&(_0x2ee778[_0x369665(0x13a)]('*')||_0x2ee778[_0x369665(0x13a)]('?'));if(_0x4722a0)return await this['listWithPattern'](_0x1c9569,_0x379789,_0x2ee778);const _0x1f9ed1=_0x2ee778?_0x379789+'/'+_0x2ee778:_0x379789;return _0x2735af?await this[_0x369665(0x13f)](_0x1c9569,_0x1f9ed1):await this['listUnified'](_0x1c9569,_0x1f9ed1);}catch(_0x125b15){if(_0x125b15 instanceof SDKError)return console[_0x369665(0x125)]('Error:\x20'+_0x125b15[_0x369665(0x120)]),_0x125b15[_0x369665(0x102)]&&console['error'](_0x369665(0x11b)+_0x125b15['cause']),0x1;throw _0x125b15;}}async[a45_0x123d56(0x139)](_0x20145c,_0x5974de,_0x4b6e5b){const _0x5cf6f4=a45_0x123d56,{options:_0x2b7f55,tdx:_0x40fb82}=_0x20145c,_0x261823=await withSpinner(_0x5cf6f4(0xf6)+_0x5974de+_0x5cf6f4(0xf5),()=>_0x40fb82['segment'][_0x5cf6f4(0x10e)](_0x5974de),{'verbose':_0x2b7f55['verbose']}),_0x57abbb=_0x261823['data'],_0x4b9aa1=await withSpinner(_0x5cf6f4(0x132),()=>_0x40fb82['segment'][_0x5cf6f4(0x129)](_0x57abbb[_0x5cf6f4(0x107)],_0x57abbb[_0x5cf6f4(0x141)]),{'verbose':_0x2b7f55[_0x5cf6f4(0x142)]}),{folders:_0x5a702f,segments:_0x4b3afb,journeys:_0x2ffe29}=_0x4b9aa1[_0x5cf6f4(0x10c)],_0x200468=_0x4b6e5b['replace'](/[.+^${}()|[\]\\]/g,'\x5c$&')[_0x5cf6f4(0x110)](/\*/g,'.*')[_0x5cf6f4(0x110)](/\?/g,'.'),_0x51ace4=new RegExp('^'+_0x200468+'$','i'),_0x3f4985=_0x5a702f[_0x5cf6f4(0x101)](_0x63c650=>_0x51ace4[_0x5cf6f4(0x103)](_0x63c650['name'])),_0x2ec416=_0x4b3afb['filter'](_0x27a695=>_0x51ace4[_0x5cf6f4(0x103)](_0x27a695[_0x5cf6f4(0x136)])),_0x53247f=_0x2ffe29[_0x5cf6f4(0x101)](_0x150319=>_0x51ace4['test'](_0x150319[_0x5cf6f4(0x126)])),_0x4d7ba0=_0x3f4985['length']+_0x2ec416[_0x5cf6f4(0x13d)]+_0x53247f[_0x5cf6f4(0x13d)];console['error'](_0x5cf6f4(0x131)+_0x3f4985[_0x5cf6f4(0x13d)]+_0x5cf6f4(0x109)+(_0x3f4985['length']!==0x1?'s':'')+',\x20'+_0x2ec416[_0x5cf6f4(0x13d)]+_0x5cf6f4(0x138)+(_0x2ec416[_0x5cf6f4(0x13d)]!==0x1?'s':'')+_0x5cf6f4(0x118)+_0x53247f[_0x5cf6f4(0x13d)]+_0x5cf6f4(0x10a)+(_0x53247f[_0x5cf6f4(0x13d)]!==0x1?'s':'')+_0x5cf6f4(0x114)+_0x4b6e5b+'\x27');const _0x5e7448=_0x555b91=>{const _0x391c03=_0x5cf6f4;return getConsoleNextUrl(_0x2b7f55[_0x391c03(0x130)],_0x391c03(0x13b)+_0x57abbb[_0x391c03(0x107)]+_0x391c03(0xfd)+_0x555b91);},_0x5c1a7b=_0x2b7f55['format']===_0x5cf6f4(0xfb)||_0x2b7f55[_0x5cf6f4(0xfc)]===_0x5cf6f4(0x119);if(_0x5c1a7b){const _0x228aa9=[..._0x3f4985['map'](_0x29f6b2=>({..._0x29f6b2,'type':'folder'})),..._0x2ec416['map'](_0x3fe012=>({..._0x3fe012,'type':_0x5cf6f4(0x12f),'url':_0x5e7448(_0x3fe012['id'])})),..._0x53247f[_0x5cf6f4(0xf9)](_0x2849b3=>({..._0x2849b3,'name':_0x2849b3[_0x5cf6f4(0x126)],'type':'journey'}))][_0x5cf6f4(0x100)]((_0x478d71,_0x5d40ba)=>_0x478d71['name'][_0x5cf6f4(0xf8)](_0x5d40ba[_0x5cf6f4(0x136)]));await handleSDKOutput(_0x228aa9,_0x2b7f55);}else{if(_0x4d7ba0===0x0)console['log'](_0x5cf6f4(0x10f)+_0x4b6e5b);else{console['log'](a45_0x19e04e['dim']('['+_0x5974de+']\x20matching\x20\x27'+_0x4b6e5b+'\x27'));const _0x2cb780=formatFlatList(_0x3f4985,_0x2ec416,{'showMetadata':!![],'getSegmentUrl':_0x5e7448},_0x53247f);console['log'](_0x2cb780);}}return 0x0;}async['listUnified'](_0x30700b,_0x4b4a8e){const _0x2aa6fd=a45_0x123d56,{options:_0x43566b,tdx:_0x311175}=_0x30700b,_0x56c79d=await withSpinner(_0x2aa6fd(0x106)+_0x4b4a8e+_0x2aa6fd(0xf5),()=>_0x311175['segment'][_0x2aa6fd(0x10e)](_0x4b4a8e),{'verbose':_0x43566b[_0x2aa6fd(0x142)]}),_0xa65219=_0x56c79d[_0x2aa6fd(0x10c)];_0x43566b[_0x2aa6fd(0x142)]&&(console[_0x2aa6fd(0x125)](_0x2aa6fd(0x12c)+_0xa65219['parentId']),_0xa65219[_0x2aa6fd(0x141)]&&console['error'](_0x2aa6fd(0x128)+_0xa65219[_0x2aa6fd(0x141)]));const _0x5308fe=await withSpinner('Listing\x20folders,\x20segments,\x20and\x20journeys...',()=>_0x311175[_0x2aa6fd(0x12f)]['listUnifiedWithJourneys'](_0xa65219[_0x2aa6fd(0x107)],_0xa65219[_0x2aa6fd(0x141)]),{'verbose':_0x43566b[_0x2aa6fd(0x142)]}),{folders:_0x304d93,segments:_0xd6d1c1,journeys:_0x81c846}=_0x5308fe[_0x2aa6fd(0x10c)],_0x50d2f6=_0x304d93[_0x2aa6fd(0x13d)]+_0xd6d1c1[_0x2aa6fd(0x13d)]+_0x81c846[_0x2aa6fd(0x13d)];console['error']('✔\x20Found\x20'+_0x304d93[_0x2aa6fd(0x13d)]+'\x20folder'+(_0x304d93[_0x2aa6fd(0x13d)]!==0x1?'s':'')+',\x20'+_0xd6d1c1[_0x2aa6fd(0x13d)]+_0x2aa6fd(0x138)+(_0xd6d1c1[_0x2aa6fd(0x13d)]!==0x1?'s':'')+_0x2aa6fd(0x118)+_0x81c846[_0x2aa6fd(0x13d)]+_0x2aa6fd(0x10a)+(_0x81c846[_0x2aa6fd(0x13d)]!==0x1?'s':''));const _0x571732=_0x107863=>{const _0x47ba4a=_0x2aa6fd;return getConsoleNextUrl(_0x43566b['site'],_0x47ba4a(0x13b)+_0xa65219[_0x47ba4a(0x107)]+_0x47ba4a(0xfd)+_0x107863);},_0x26092d=_0x255111=>{const _0x5a3709=_0x2aa6fd;return getConsoleNextUrl(_0x43566b[_0x5a3709(0x130)],_0x5a3709(0x13b)+_0xa65219[_0x5a3709(0x107)]+_0x5a3709(0xfd)+_0x255111+_0x5a3709(0x11e));},_0x3250ad=_0x43566b[_0x2aa6fd(0xfc)]===_0x2aa6fd(0xfb)||_0x43566b[_0x2aa6fd(0xfc)]===_0x2aa6fd(0x119);if(_0x3250ad){const _0x1097e2=[..._0x304d93[_0x2aa6fd(0xf9)](_0x2e8393=>({..._0x2e8393,'type':_0x2aa6fd(0x13c)})),..._0xd6d1c1[_0x2aa6fd(0xf9)](_0xf9943d=>({..._0xf9943d,'type':_0x2aa6fd(0x12f),'url':_0x571732(_0xf9943d['id'])})),..._0x81c846[_0x2aa6fd(0xf9)](_0x2409c4=>({..._0x2409c4,'name':_0x2409c4[_0x2aa6fd(0x126)],'type':_0x2aa6fd(0x13e),'url':_0x26092d(_0x2409c4['id'])}))][_0x2aa6fd(0x100)]((_0x1a97ba,_0x9d05fc)=>_0x1a97ba[_0x2aa6fd(0x136)][_0x2aa6fd(0xf8)](_0x9d05fc[_0x2aa6fd(0x136)]));await handleSDKOutput(_0x1097e2,_0x43566b);}else{if(_0x50d2f6===0x0)console['log'](a45_0x19e04e[_0x2aa6fd(0xff)]('['+_0x4b4a8e+']')),console['log'](_0x2aa6fd(0x12d));else{console['log'](a45_0x19e04e[_0x2aa6fd(0xff)]('['+_0x4b4a8e+']'));const _0x6e78d9=formatFlatList(_0x304d93,_0xd6d1c1,{'showMetadata':!![],'getSegmentUrl':_0x571732,'getJourneyUrl':_0x26092d},_0x81c846);console[_0x2aa6fd(0xfe)](_0x6e78d9);}}return 0x0;}async['listRecursive'](_0x1f6900,_0x49d428){const _0x388b18=a45_0x123d56,{options:_0x349126,tdx:_0xb9cae7}=_0x1f6900,_0x3fc9a1=await withSpinner('Resolving\x20path\x20\x27'+_0x49d428+_0x388b18(0xf5),()=>_0xb9cae7[_0x388b18(0x12f)][_0x388b18(0x10e)](_0x49d428),{'verbose':_0x349126[_0x388b18(0x142)]}),_0x93f4f5=_0x3fc9a1[_0x388b18(0x10c)];_0x349126[_0x388b18(0x142)]&&(console['error'](_0x388b18(0x12c)+_0x93f4f5['parentId']),_0x93f4f5[_0x388b18(0x141)]&&console[_0x388b18(0x125)](_0x388b18(0x128)+_0x93f4f5[_0x388b18(0x141)]));const _0x3fec96=_0x349126[_0x388b18(0x135)]||0xa,_0x366f88=await withSpinner(_0x388b18(0x104),()=>_0xb9cae7[_0x388b18(0x12f)][_0x388b18(0x13f)](_0x93f4f5['parentId'],_0x93f4f5[_0x388b18(0x141)],0x0,_0x3fec96),{'verbose':_0x349126['verbose']}),_0x3c801e=_0x366f88[_0x388b18(0x10c)],_0x214a7c=_0x2a39c5=>{const _0x209fb6=_0x388b18;let _0x1e132d=0x0,_0x14a1f7=0x0,_0x4c29a6=0x0;for(const _0x348271 of _0x2a39c5){if(_0x348271['type']===_0x209fb6(0x13c))_0x1e132d++;else{if(_0x348271[_0x209fb6(0x12b)]===_0x209fb6(0x12f))_0x14a1f7++;else{if(_0x348271[_0x209fb6(0x12b)]==='journey')_0x4c29a6++;}}if(_0x348271[_0x209fb6(0x123)]){const _0x46182d=_0x214a7c(_0x348271[_0x209fb6(0x123)]);_0x1e132d+=_0x46182d[_0x209fb6(0x121)],_0x14a1f7+=_0x46182d[_0x209fb6(0x10d)],_0x4c29a6+=_0x46182d[_0x209fb6(0x112)];}}return{'folders':_0x1e132d,'segments':_0x14a1f7,'journeys':_0x4c29a6};},_0x5debc1=_0x214a7c(_0x3c801e);console[_0x388b18(0x125)](_0x388b18(0x11f)+_0x5debc1[_0x388b18(0x121)]+_0x388b18(0x109)+(_0x5debc1['folders']!==0x1?'s':'')+',\x20'+_0x5debc1[_0x388b18(0x10d)]+'\x20segment'+(_0x5debc1[_0x388b18(0x10d)]!==0x1?'s':'')+',\x20and\x20'+_0x5debc1[_0x388b18(0x112)]+'\x20journey'+(_0x5debc1[_0x388b18(0x112)]!==0x1?'s':''));const _0x37defd=_0x49407c=>{const _0x30409f=_0x388b18;return getConsoleNextUrl(_0x349126[_0x30409f(0x130)],'/app/ps/'+_0x93f4f5[_0x30409f(0x107)]+_0x30409f(0xfd)+_0x49407c);},_0x12e86c=_0x4dce8e=>{const _0x31eea8=_0x388b18;return getConsoleNextUrl(_0x349126[_0x31eea8(0x130)],_0x31eea8(0x13b)+_0x93f4f5[_0x31eea8(0x107)]+_0x31eea8(0xfd)+_0x4dce8e+_0x31eea8(0x11e));};if(_0x349126[_0x388b18(0xfc)]===_0x388b18(0xfb)||_0x349126[_0x388b18(0xfc)]===_0x388b18(0x119))await handleSDKOutput(_0x3c801e,_0x349126);else{console[_0x388b18(0xfe)](a45_0x19e04e[_0x388b18(0xff)]('['+_0x49d428+']'));const _0x31f631=formatTree(_0x3c801e,{'showMetadata':!![],'getSegmentUrl':_0x37defd,'getJourneyUrl':_0x12e86c});console['log'](_0x31f631);}return 0x0;}}function a45_0x5b34(){const _0x3a44b6=['/e/','log','dim','sort','filter','cause','test','Building\x20hierarchy\x20tree...','3014652EqBqii','Resolving\x20path\x20\x27','parentId','Use\x20tdx\x20ps\x20list\x20to\x20see\x20available\x20parent\x20segments.','\x20folder','\x20journey','7efjfsy','data','segments','resolvePathToResource','No\x20items\x20match\x20pattern:\x20','replace','description','journeys','Set\x20a\x20parent\x20segment\x20context\x20first:','\x20matching\x20\x27','1167522WQrDtS','Site:\x20','List\x20folders\x20and\x20child\x20segments',',\x20and\x20','jsonl','\x20\x20tdx\x20sg\x20pull\x20\x22My\x20Audience\x22','\x20\x20Cause:\x20','execute','Error:\x20No\x20parent\x20segment\x20context\x20set.','/j/da','✔\x20Built\x20tree\x20with\x20','message','folders','15405550xGHZtR','children','parentSegment','error','journeyBundleName','Folder/pattern\x20arg:\x20','Folder\x20ID:\x20','listUnifiedWithJourneys','7XWcAvI','type','Parent\x20ID:\x20','(empty)','239284VoDAmf','segment','site','✔\x20Found\x20','Listing\x20folders,\x20segments,\x20and\x20journeys...','recursive','5DvQpzI','maxDepth','name','4768245WLolvE','\x20segment','listWithPattern','includes','/app/ps/','folder','length','journey','listRecursive','99496APQsqG','folderId','verbose','\x27...','Resolving\x20parent\x20segment\x20\x27','Recursive\x20mode:\x20enabled','localeCompare','map','4394276XIASDG','json','format'];a45_0x5b34=function(){return _0x3a44b6;};return a45_0x5b34();}
1
+ const a45_0x140fa6=a45_0x3bb7;(function(_0x2b8bd8,_0x54e066){const _0x31d734=a45_0x3bb7,_0x51d144=_0x2b8bd8();while(!![]){try{const _0x3bafbb=-parseInt(_0x31d734(0x168))/0x1+parseInt(_0x31d734(0x151))/0x2*(-parseInt(_0x31d734(0x16d))/0x3)+-parseInt(_0x31d734(0x166))/0x4+parseInt(_0x31d734(0x152))/0x5+parseInt(_0x31d734(0x146))/0x6*(parseInt(_0x31d734(0x17f))/0x7)+parseInt(_0x31d734(0x14e))/0x8+-parseInt(_0x31d734(0x16f))/0x9*(-parseInt(_0x31d734(0x174))/0xa);if(_0x3bafbb===_0x54e066)break;else _0x51d144['push'](_0x51d144['shift']());}catch(_0x590422){_0x51d144['push'](_0x51d144['shift']());}}}(a45_0x17f0,0x28f81));function a45_0x3bb7(_0x131ca0,_0x46642a){_0x131ca0=_0x131ca0-0x138;const _0x17f0d1=a45_0x17f0();let _0x3bb720=_0x17f0d1[_0x131ca0];return _0x3bb720;}import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{formatFlatList,formatTree}from'../sdk/util/tree-formatter.js';function a45_0x17f0(){const _0x134768=['folderId','Use\x20tdx\x20ps\x20list\x20to\x20see\x20available\x20parent\x20segments.','execute','\x20journey','✔\x20Found\x20','\x20\x20tdx\x20sg\x20use\x20\x22My\x20Audience\x22','cause','message','maxDepth','description','children','Building\x20hierarchy\x20tree...','1029424dJjkcv','\x20segment','78960RsPbSs','name','segment','listUnified','replace','3GuuMEM','Parent\x20ID:\x20','30879ybpjRH','Site:\x20','Recursive\x20mode:\x20enabled','Resolving\x20path\x20\x27','sort','290zbFlOi','Error:\x20No\x20parent\x20segment\x20context\x20set.','(not\x20set)','includes','listUnifiedWithJourneys','(empty)','log','folders','Listing\x20folders,\x20segments,\x20and\x20journeys...','map','Folder\x20ID:\x20','847nKekqZ','resolvePathToResource','\x20folder','journeys','format','site','json','segments','/e/','/app/ps/','length','filter','✔\x20Built\x20tree\x20with\x20','/j/da','verbose','dim','listRecursive','Parent\x20segment\x20context:\x20','9582bkzTAd','\x27...','Folder/pattern\x20arg:\x20','parentId','type','data','No\x20items\x20match\x20pattern:\x20','\x20\x20tdx\x20sg\x20pull\x20\x22My\x20Audience\x22','1763776AFDoLZ','folder',',\x20and\x20','624458RuvdYf','1515730eCfqSN','recursive','Set\x20a\x20parent\x20segment\x20context\x20first:','journey','test','listWithPattern','journeyBundleName','error'];a45_0x17f0=function(){return _0x134768;};return a45_0x17f0();}import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import a45_0x256012 from'chalk';export class SegmentsCommand extends BaseCommand{[a45_0x140fa6(0x169)]=a45_0x140fa6(0x13b);[a45_0x140fa6(0x163)]='List\x20folders\x20and\x20child\x20segments';async[a45_0x140fa6(0x15c)](_0x25cfe2){const _0x15b3a1=a45_0x140fa6,{options:_0x3437fe,args:_0x4f7e05}=_0x25cfe2,_0x41519c=_0x3437fe[_0x15b3a1(0x153)],_0x1f91fa=_0x4f7e05[0x0];try{const _0x224955=_0x3437fe['parentSegment'];_0x3437fe[_0x15b3a1(0x142)]&&(console[_0x15b3a1(0x159)](_0x15b3a1(0x170)+_0x3437fe[_0x15b3a1(0x139)]),console[_0x15b3a1(0x159)](_0x15b3a1(0x145)+(_0x224955||_0x15b3a1(0x176))),_0x1f91fa&&console[_0x15b3a1(0x159)](_0x15b3a1(0x148)+_0x1f91fa),_0x41519c&&console['error'](_0x15b3a1(0x171)));if(!_0x224955)return console[_0x15b3a1(0x159)](_0x15b3a1(0x175)),console['error'](''),console[_0x15b3a1(0x159)](_0x15b3a1(0x154)),console[_0x15b3a1(0x159)](_0x15b3a1(0x14d)),console[_0x15b3a1(0x159)](_0x15b3a1(0x15f)),console['error'](''),console[_0x15b3a1(0x159)](_0x15b3a1(0x15b)),0x1;const _0x340338=_0x1f91fa&&(_0x1f91fa[_0x15b3a1(0x177)]('*')||_0x1f91fa['includes']('?'));if(_0x340338)return await this[_0x15b3a1(0x157)](_0x25cfe2,_0x224955,_0x1f91fa);const _0x40382a=_0x1f91fa?_0x224955+'/'+_0x1f91fa:_0x224955;return _0x41519c?await this[_0x15b3a1(0x144)](_0x25cfe2,_0x40382a):await this[_0x15b3a1(0x16b)](_0x25cfe2,_0x40382a);}catch(_0x379763){if(_0x379763 instanceof SDKError)return console['error']('Error:\x20'+_0x379763[_0x15b3a1(0x161)]),_0x379763[_0x15b3a1(0x160)]&&console['error']('\x20\x20Cause:\x20'+_0x379763[_0x15b3a1(0x160)]),0x1;throw _0x379763;}}async['listWithPattern'](_0x8daf79,_0x515064,_0x4f5dbf){const _0x1d3c66=a45_0x140fa6,{options:_0x1c0553,tdx:_0x3062da}=_0x8daf79,_0xa1aabd=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x515064+_0x1d3c66(0x147),()=>_0x3062da[_0x1d3c66(0x16a)][_0x1d3c66(0x180)](_0x515064),{'verbose':_0x1c0553[_0x1d3c66(0x142)]}),_0x431c3d=_0xa1aabd[_0x1d3c66(0x14b)],_0x2e031f=await withSpinner(_0x1d3c66(0x17c),()=>_0x3062da[_0x1d3c66(0x16a)][_0x1d3c66(0x178)](_0x431c3d['parentId'],_0x431c3d['folderId']),{'verbose':_0x1c0553['verbose']}),{folders:_0x2a3d97,segments:_0x2c88ff,journeys:_0x4d4ea1}=_0x2e031f[_0x1d3c66(0x14b)],_0x2897bb=_0x4f5dbf[_0x1d3c66(0x16c)](/[.+^${}()|[\]\\]/g,'\x5c$&')[_0x1d3c66(0x16c)](/\*/g,'.*')['replace'](/\?/g,'.'),_0x3aa96d=new RegExp('^'+_0x2897bb+'$','i'),_0x1fab05=_0x2a3d97[_0x1d3c66(0x13f)](_0x219fc7=>_0x3aa96d[_0x1d3c66(0x156)](_0x219fc7[_0x1d3c66(0x169)])),_0x375565=_0x2c88ff[_0x1d3c66(0x13f)](_0x1d6dcc=>_0x3aa96d[_0x1d3c66(0x156)](_0x1d6dcc[_0x1d3c66(0x169)])),_0x17ffa9=_0x4d4ea1[_0x1d3c66(0x13f)](_0x24110f=>_0x3aa96d[_0x1d3c66(0x156)](_0x24110f['journeyBundleName'])),_0x731867=_0x1fab05[_0x1d3c66(0x13e)]+_0x375565[_0x1d3c66(0x13e)]+_0x17ffa9[_0x1d3c66(0x13e)];console[_0x1d3c66(0x159)]('✔\x20Found\x20'+_0x1fab05[_0x1d3c66(0x13e)]+_0x1d3c66(0x181)+(_0x1fab05[_0x1d3c66(0x13e)]!==0x1?'s':'')+',\x20'+_0x375565[_0x1d3c66(0x13e)]+'\x20segment'+(_0x375565[_0x1d3c66(0x13e)]!==0x1?'s':'')+_0x1d3c66(0x150)+_0x17ffa9[_0x1d3c66(0x13e)]+_0x1d3c66(0x15d)+(_0x17ffa9[_0x1d3c66(0x13e)]!==0x1?'s':'')+'\x20matching\x20\x27'+_0x4f5dbf+'\x27');const _0x1b1637=_0xd03c9c=>{const _0x1c61a1=_0x1d3c66;return getConsoleNextUrl(_0x1c0553['site'],_0x1c61a1(0x13d)+_0x431c3d[_0x1c61a1(0x149)]+'/e/'+_0xd03c9c);},_0x41ac91=_0x1c0553[_0x1d3c66(0x138)]===_0x1d3c66(0x13a)||_0x1c0553['format']==='jsonl';if(_0x41ac91){const _0x11075b=[..._0x1fab05[_0x1d3c66(0x17d)](_0x5627ec=>({..._0x5627ec,'type':_0x1d3c66(0x14f)})),..._0x375565[_0x1d3c66(0x17d)](_0x1340d7=>({..._0x1340d7,'type':'segment','url':_0x1b1637(_0x1340d7['id'])})),..._0x17ffa9[_0x1d3c66(0x17d)](_0x324592=>({..._0x324592,'name':_0x324592[_0x1d3c66(0x158)],'type':_0x1d3c66(0x155)}))][_0x1d3c66(0x173)]((_0x3872d4,_0x5f1673)=>_0x3872d4[_0x1d3c66(0x169)]['localeCompare'](_0x5f1673[_0x1d3c66(0x169)]));await handleSDKOutput(_0x11075b,_0x1c0553);}else{if(_0x731867===0x0)console[_0x1d3c66(0x17a)](_0x1d3c66(0x14c)+_0x4f5dbf);else{console[_0x1d3c66(0x17a)](a45_0x256012[_0x1d3c66(0x143)]('['+_0x515064+']\x20matching\x20\x27'+_0x4f5dbf+'\x27'));const _0x25ce89=formatFlatList(_0x1fab05,_0x375565,{'showMetadata':!![],'getSegmentUrl':_0x1b1637},_0x17ffa9);console[_0x1d3c66(0x17a)](_0x25ce89);}}return 0x0;}async['listUnified'](_0x51b493,_0x13dc1e){const _0x27e8f4=a45_0x140fa6,{options:_0x457a59,tdx:_0x220550}=_0x51b493,_0x2c3070=await withSpinner(_0x27e8f4(0x172)+_0x13dc1e+_0x27e8f4(0x147),()=>_0x220550[_0x27e8f4(0x16a)][_0x27e8f4(0x180)](_0x13dc1e),{'verbose':_0x457a59['verbose']}),_0x52b10a=_0x2c3070[_0x27e8f4(0x14b)];_0x457a59[_0x27e8f4(0x142)]&&(console[_0x27e8f4(0x159)](_0x27e8f4(0x16e)+_0x52b10a[_0x27e8f4(0x149)]),_0x52b10a[_0x27e8f4(0x15a)]&&console[_0x27e8f4(0x159)](_0x27e8f4(0x17e)+_0x52b10a[_0x27e8f4(0x15a)]));const _0x292b97=await withSpinner(_0x27e8f4(0x17c),()=>_0x220550[_0x27e8f4(0x16a)]['listUnifiedWithJourneys'](_0x52b10a['parentId'],_0x52b10a['folderId']),{'verbose':_0x457a59[_0x27e8f4(0x142)]}),{folders:_0x29bccf,segments:_0x2d679b,journeys:_0x147273}=_0x292b97['data'],_0x1fcaa5=_0x29bccf[_0x27e8f4(0x13e)]+_0x2d679b[_0x27e8f4(0x13e)]+_0x147273[_0x27e8f4(0x13e)];console['error'](_0x27e8f4(0x15e)+_0x29bccf[_0x27e8f4(0x13e)]+_0x27e8f4(0x181)+(_0x29bccf[_0x27e8f4(0x13e)]!==0x1?'s':'')+',\x20'+_0x2d679b[_0x27e8f4(0x13e)]+_0x27e8f4(0x167)+(_0x2d679b['length']!==0x1?'s':'')+',\x20and\x20'+_0x147273[_0x27e8f4(0x13e)]+_0x27e8f4(0x15d)+(_0x147273['length']!==0x1?'s':''));const _0x5ce1cf=_0x364e47=>{const _0x3d3692=_0x27e8f4;return getConsoleNextUrl(_0x457a59[_0x3d3692(0x139)],'/app/ps/'+_0x52b10a[_0x3d3692(0x149)]+_0x3d3692(0x13c)+_0x364e47);},_0x3c82a3=_0x59f84b=>{const _0xe8db0d=_0x27e8f4;return getConsoleNextUrl(_0x457a59['site'],'/app/ps/'+_0x52b10a[_0xe8db0d(0x149)]+_0xe8db0d(0x13c)+_0x59f84b+'/j/da');},_0x2fdb93=_0x457a59['format']==='json'||_0x457a59[_0x27e8f4(0x138)]==='jsonl';if(_0x2fdb93){const _0x4eb76b=[..._0x29bccf[_0x27e8f4(0x17d)](_0x1011d7=>({..._0x1011d7,'type':_0x27e8f4(0x14f)})),..._0x2d679b['map'](_0x1abefe=>({..._0x1abefe,'type':_0x27e8f4(0x16a),'url':_0x5ce1cf(_0x1abefe['id'])})),..._0x147273['map'](_0x2873f5=>({..._0x2873f5,'name':_0x2873f5[_0x27e8f4(0x158)],'type':_0x27e8f4(0x155),'url':_0x3c82a3(_0x2873f5['id'])}))]['sort']((_0x4ee8dc,_0x489886)=>_0x4ee8dc['name']['localeCompare'](_0x489886['name']));await handleSDKOutput(_0x4eb76b,_0x457a59);}else{if(_0x1fcaa5===0x0)console[_0x27e8f4(0x17a)](a45_0x256012[_0x27e8f4(0x143)]('['+_0x13dc1e+']')),console[_0x27e8f4(0x17a)](_0x27e8f4(0x179));else{console[_0x27e8f4(0x17a)](a45_0x256012[_0x27e8f4(0x143)]('['+_0x13dc1e+']'));const _0x70b032=formatFlatList(_0x29bccf,_0x2d679b,{'showMetadata':!![],'getSegmentUrl':_0x5ce1cf,'getJourneyUrl':_0x3c82a3},_0x147273);console[_0x27e8f4(0x17a)](_0x70b032);}}return 0x0;}async['listRecursive'](_0x24f932,_0x1a2231){const _0x144461=a45_0x140fa6,{options:_0x542479,tdx:_0x2857c8}=_0x24f932,_0x1633da=await withSpinner(_0x144461(0x172)+_0x1a2231+_0x144461(0x147),()=>_0x2857c8['segment'][_0x144461(0x180)](_0x1a2231),{'verbose':_0x542479[_0x144461(0x142)]}),_0x2d12eb=_0x1633da[_0x144461(0x14b)];_0x542479[_0x144461(0x142)]&&(console[_0x144461(0x159)](_0x144461(0x16e)+_0x2d12eb[_0x144461(0x149)]),_0x2d12eb[_0x144461(0x15a)]&&console[_0x144461(0x159)](_0x144461(0x17e)+_0x2d12eb[_0x144461(0x15a)]));const _0x13aa3b=_0x542479[_0x144461(0x162)]||0xa,_0x4787af=await withSpinner(_0x144461(0x165),()=>_0x2857c8[_0x144461(0x16a)][_0x144461(0x144)](_0x2d12eb['parentId'],_0x2d12eb[_0x144461(0x15a)],0x0,_0x13aa3b),{'verbose':_0x542479[_0x144461(0x142)]}),_0x4db16a=_0x4787af[_0x144461(0x14b)],_0x511d58=_0x88f2a1=>{const _0x1e47f3=_0x144461;let _0xe04818=0x0,_0x38a609=0x0,_0x5600f5=0x0;for(const _0x4071c7 of _0x88f2a1){if(_0x4071c7[_0x1e47f3(0x14a)]===_0x1e47f3(0x14f))_0xe04818++;else{if(_0x4071c7[_0x1e47f3(0x14a)]===_0x1e47f3(0x16a))_0x38a609++;else{if(_0x4071c7[_0x1e47f3(0x14a)]==='journey')_0x5600f5++;}}if(_0x4071c7[_0x1e47f3(0x164)]){const _0x405746=_0x511d58(_0x4071c7[_0x1e47f3(0x164)]);_0xe04818+=_0x405746[_0x1e47f3(0x17b)],_0x38a609+=_0x405746['segments'],_0x5600f5+=_0x405746[_0x1e47f3(0x182)];}}return{'folders':_0xe04818,'segments':_0x38a609,'journeys':_0x5600f5};},_0x55c2a9=_0x511d58(_0x4db16a);console[_0x144461(0x159)](_0x144461(0x140)+_0x55c2a9[_0x144461(0x17b)]+_0x144461(0x181)+(_0x55c2a9[_0x144461(0x17b)]!==0x1?'s':'')+',\x20'+_0x55c2a9[_0x144461(0x13b)]+'\x20segment'+(_0x55c2a9[_0x144461(0x13b)]!==0x1?'s':'')+_0x144461(0x150)+_0x55c2a9['journeys']+_0x144461(0x15d)+(_0x55c2a9['journeys']!==0x1?'s':''));const _0x5f14ea=_0x34217c=>{const _0x39422e=_0x144461;return getConsoleNextUrl(_0x542479[_0x39422e(0x139)],'/app/ps/'+_0x2d12eb[_0x39422e(0x149)]+_0x39422e(0x13c)+_0x34217c);},_0x55e46f=_0x18b20e=>{const _0x3b1891=_0x144461;return getConsoleNextUrl(_0x542479[_0x3b1891(0x139)],'/app/ps/'+_0x2d12eb['parentId']+_0x3b1891(0x13c)+_0x18b20e+_0x3b1891(0x141));};if(_0x542479[_0x144461(0x138)]==='json'||_0x542479[_0x144461(0x138)]==='jsonl')await handleSDKOutput(_0x4db16a,_0x542479);else{console['log'](a45_0x256012[_0x144461(0x143)]('['+_0x1a2231+']'));const _0xf4192d=formatTree(_0x4db16a,{'showMetadata':!![],'getSegmentUrl':_0x5f14ea,'getJourneyUrl':_0x55e46f});console[_0x144461(0x17a)](_0xf4192d);}return 0x0;}}
@@ -1 +1 @@
1
- const a46_0x1acfd1=a46_0x1cca;function a46_0x1cca(_0x18b438,_0x4e167e){_0x18b438=_0x18b438-0x99;const _0x2247f2=a46_0x2247();let _0x1cca2c=_0x2247f2[_0x18b438];return _0x1cca2c;}(function(_0x37d351,_0x24ddd5){const _0x3800da=a46_0x1cca,_0x153ca2=_0x37d351();while(!![]){try{const _0xd1e0d4=parseInt(_0x3800da(0xa3))/0x1+-parseInt(_0x3800da(0x9f))/0x2+-parseInt(_0x3800da(0xb8))/0x3+parseInt(_0x3800da(0xab))/0x4*(parseInt(_0x3800da(0xc0))/0x5)+parseInt(_0x3800da(0xb7))/0x6*(-parseInt(_0x3800da(0xbc))/0x7)+-parseInt(_0x3800da(0xba))/0x8*(parseInt(_0x3800da(0xb0))/0x9)+parseInt(_0x3800da(0xa1))/0xa;if(_0xd1e0d4===_0x24ddd5)break;else _0x153ca2['push'](_0x153ca2['shift']());}catch(_0x234985){_0x153ca2['push'](_0x153ca2['shift']());}}}(a46_0x2247,0x271a5));function a46_0x2247(){const _0x5274b3=['Catalog:\x20','\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>','Show\x20table\x20contents','142824HpYyFa','Site:\x20','7834790awTHkh','limit','67755nCZKUe','Usage:\x20tdx\x20show\x20<database.table>','query','Database:\x20','Limit:\x20','\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>','✔\x20Query\x20successful\x20-\x200\x20rows\x20returned','showTable','9524iMwaYY','verbose','\x20row','error','message','54801hGEdXK','...','database','show','\x20from\x20','description','catalog','138hbISjl','621564HLyKvW','site','416vMCTnp','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','45836pnjsJS','\x20\x20Cause:\x20','data','✔\x20Retrieved\x20','115BKdqoI','cause','length','Error:\x20','Table:\x20'];a46_0x2247=function(){return _0x5274b3;};return a46_0x2247();}import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';import{parseTableReference,validateTableDescribeReference}from'../utils/table-ref-parser.js';import{withSpinner}from'../utils/spinner.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';export class ShowCommand extends BaseCommand{['name']=a46_0x1acfd1(0xb3);[a46_0x1acfd1(0xb5)]=a46_0x1acfd1(0x9e);async['execute'](_0x4f7987){const _0x57dceb=a46_0x1acfd1;return this[_0x57dceb(0xaa)](_0x4f7987);}async[a46_0x1acfd1(0xaa)](_0x5cbe51){const _0xb80df8=a46_0x1acfd1,{options:_0x38d991,args:_0x4565db,tdx:_0x47cdb1}=_0x5cbe51;let _0xb5ea4a;try{_0xb5ea4a=parseTableReference(_0x4565db[0x0]);const _0x3f7455=_0x38d991[_0xb80df8(0xb2)];!_0xb5ea4a[_0xb80df8(0xb2)]&&_0x3f7455&&(_0xb5ea4a[_0xb80df8(0xb2)]=_0x3f7455);const _0x2c97e6=validateTableDescribeReference(_0xb5ea4a);if(_0x2c97e6)return console[_0xb80df8(0xae)](_0xb80df8(0x9a)+_0x2c97e6),console[_0xb80df8(0xae)](_0xb80df8(0xa4)),console[_0xb80df8(0xae)](_0xb80df8(0x9d)),console[_0xb80df8(0xae)](_0xb80df8(0xa8)),0x1;}catch(_0x390f25){return console[_0xb80df8(0xae)](_0xb80df8(0x9a)+_0x390f25[_0xb80df8(0xaf)]),console[_0xb80df8(0xae)]('Usage:\x20tdx\x20show\x20<database.table>'),console['error'](_0xb80df8(0x9d)),console[_0xb80df8(0xae)](_0xb80df8(0xa8)),0x1;}const _0x1bf84e=_0xb5ea4a[_0xb80df8(0xb6)],_0x4c7140=_0xb5ea4a[_0xb80df8(0xb2)],_0x474e0a=_0xb5ea4a['table'],_0x2f58f5=resolveLimit(_0x38d991[_0xb80df8(0xa2)],DEFAULT_DISPLAY_LIMIT);try{_0x38d991[_0xb80df8(0xac)]&&(console[_0xb80df8(0xae)](_0xb80df8(0xa0)+_0x38d991[_0xb80df8(0xb9)]),_0x1bf84e&&console[_0xb80df8(0xae)](_0xb80df8(0x9c)+_0x1bf84e),console['error'](_0xb80df8(0xa6)+_0x4c7140),console[_0xb80df8(0xae)](_0xb80df8(0x9b)+_0x474e0a),console[_0xb80df8(0xae)](_0xb80df8(0xa7)+_0x2f58f5));const _0x11e8ad=_0x1bf84e?_0x1bf84e+'.'+_0x4c7140+'.'+_0x474e0a:_0x4c7140+'.'+_0x474e0a,_0x33b528=await withSpinner('Querying\x20'+_0x11e8ad+_0xb80df8(0xb1),()=>_0x47cdb1[_0xb80df8(0xa5)][_0xb80df8(0xaa)](_0x4c7140,_0x474e0a,_0x2f58f5,_0x1bf84e),{'verbose':_0x38d991[_0xb80df8(0xac)]}),_0x3bacb6=_0x33b528[_0xb80df8(0xbe)],_0x4e17af=_0x3bacb6[_0xb80df8(0xbe)];return _0x4e17af[_0xb80df8(0x99)]===0x0?console['error'](_0xb80df8(0xa9)):console['error'](_0xb80df8(0xbf)+_0x4e17af[_0xb80df8(0x99)]+_0xb80df8(0xad)+(_0x4e17af[_0xb80df8(0x99)]!==0x1?'s':'')+_0xb80df8(0xb4)+_0x11e8ad),await handleSDKOutput(_0x4e17af,_0x38d991),0x0;}catch(_0xe2ed97){if(_0xe2ed97 instanceof SDKError)return console[_0xb80df8(0xae)](_0xb80df8(0x9a)+_0xe2ed97[_0xb80df8(0xaf)]),_0xe2ed97[_0xb80df8(0xc1)]&&console['error'](_0xb80df8(0xbd)+_0xe2ed97[_0xb80df8(0xc1)]),0x1;throw _0xe2ed97;}}['validate'](_0x44f89a){const _0x56bb50=a46_0x1acfd1;if(_0x44f89a['args'][_0x56bb50(0x99)]===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(_0x44f89a['args']['length']>0x1)return _0x56bb50(0xbb);return undefined;}}
1
+ const a46_0xe76c57=a46_0x3b54;function a46_0x3b54(_0x18ff50,_0x7277e5){_0x18ff50=_0x18ff50-0x17f;const _0xfee99=a46_0xfee9();let _0x3b5449=_0xfee99[_0x18ff50];return _0x3b5449;}(function(_0x3a617f,_0x471c39){const _0x2f2410=a46_0x3b54,_0x3ad4b2=_0x3a617f();while(!![]){try{const _0x55273a=parseInt(_0x2f2410(0x18b))/0x1*(parseInt(_0x2f2410(0x19f))/0x2)+parseInt(_0x2f2410(0x1a9))/0x3+parseInt(_0x2f2410(0x1a5))/0x4+-parseInt(_0x2f2410(0x189))/0x5*(parseInt(_0x2f2410(0x194))/0x6)+-parseInt(_0x2f2410(0x185))/0x7*(parseInt(_0x2f2410(0x1a4))/0x8)+parseInt(_0x2f2410(0x192))/0x9+parseInt(_0x2f2410(0x18a))/0xa*(-parseInt(_0x2f2410(0x19d))/0xb);if(_0x55273a===_0x471c39)break;else _0x3ad4b2['push'](_0x3ad4b2['shift']());}catch(_0x4a4658){_0x3ad4b2['push'](_0x3ad4b2['shift']());}}}(a46_0xfee9,0x821f2));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';function a46_0xfee9(){const _0x25f970=['length','232055sxiGDz','80TihdDp','73651dJoKVb','\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>','cause','Querying\x20','execute','site','Limit:\x20','2178000cIJvCp','table','66YixJAK','Site:\x20','limit','Usage:\x20tdx\x20show\x20<database.table>','\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>','Error:\x20','data','\x20from\x20','query','1055208QEZtCM','catalog','18TvVBBg','✔\x20Query\x20successful\x20-\x200\x20rows\x20returned','Catalog:\x20','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','...','59528HSvKwL','2034164cThabq','verbose','\x20row','args','2844471olfnGC','error','message','Database:\x20','validate','✔\x20Retrieved\x20','database','showTable','518mHnZdS','Show\x20table\x20contents','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'];a46_0xfee9=function(){return _0x25f970;};return a46_0xfee9();}import{withSpinner}from'../utils/spinner.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';export class ShowCommand extends BaseCommand{['name']='show';['description']=a46_0xe76c57(0x186);async[a46_0xe76c57(0x18f)](_0x55f542){const _0x511829=a46_0xe76c57;return this[_0x511829(0x184)](_0x55f542);}async[a46_0xe76c57(0x184)](_0xb82357){const _0x2d2fe0=a46_0xe76c57,{options:_0x526ce5,args:_0x817f42,tdx:_0xc25c7f}=_0xb82357;let _0x20d40a;try{_0x20d40a=parseTableReference(_0x817f42[0x0]);const _0x44001c=_0x526ce5[_0x2d2fe0(0x183)];!_0x20d40a[_0x2d2fe0(0x183)]&&_0x44001c&&(_0x20d40a[_0x2d2fe0(0x183)]=_0x44001c);const _0x2bc329=validateTableDescribeReference(_0x20d40a);if(_0x2bc329)return console[_0x2d2fe0(0x1aa)](_0x2d2fe0(0x199)+_0x2bc329),console[_0x2d2fe0(0x1aa)]('Usage:\x20tdx\x20show\x20<database.table>'),console[_0x2d2fe0(0x1aa)](_0x2d2fe0(0x198)),console[_0x2d2fe0(0x1aa)](_0x2d2fe0(0x18c)),0x1;}catch(_0x1da6da){return console[_0x2d2fe0(0x1aa)](_0x2d2fe0(0x199)+_0x1da6da[_0x2d2fe0(0x17f)]),console[_0x2d2fe0(0x1aa)](_0x2d2fe0(0x197)),console['error'](_0x2d2fe0(0x198)),console[_0x2d2fe0(0x1aa)](_0x2d2fe0(0x18c)),0x1;}const _0x2f4e4c=_0x20d40a[_0x2d2fe0(0x19e)],_0x8c8131=_0x20d40a[_0x2d2fe0(0x183)],_0x4abfe4=_0x20d40a[_0x2d2fe0(0x193)],_0x2b6b1b=resolveLimit(_0x526ce5[_0x2d2fe0(0x196)],DEFAULT_DISPLAY_LIMIT);try{_0x526ce5[_0x2d2fe0(0x1a6)]&&(console['error'](_0x2d2fe0(0x195)+_0x526ce5[_0x2d2fe0(0x190)]),_0x2f4e4c&&console[_0x2d2fe0(0x1aa)](_0x2d2fe0(0x1a1)+_0x2f4e4c),console['error'](_0x2d2fe0(0x180)+_0x8c8131),console['error']('Table:\x20'+_0x4abfe4),console[_0x2d2fe0(0x1aa)](_0x2d2fe0(0x191)+_0x2b6b1b));const _0x1cde05=_0x2f4e4c?_0x2f4e4c+'.'+_0x8c8131+'.'+_0x4abfe4:_0x8c8131+'.'+_0x4abfe4,_0x3e7c42=await withSpinner(_0x2d2fe0(0x18e)+_0x1cde05+_0x2d2fe0(0x1a3),()=>_0xc25c7f[_0x2d2fe0(0x19c)][_0x2d2fe0(0x184)](_0x8c8131,_0x4abfe4,_0x2b6b1b,_0x2f4e4c),{'verbose':_0x526ce5['verbose']}),_0x594199=_0x3e7c42[_0x2d2fe0(0x19a)],_0x2fbc51=_0x594199[_0x2d2fe0(0x19a)];return _0x2fbc51[_0x2d2fe0(0x188)]===0x0?console[_0x2d2fe0(0x1aa)](_0x2d2fe0(0x1a0)):console[_0x2d2fe0(0x1aa)](_0x2d2fe0(0x182)+_0x2fbc51['length']+_0x2d2fe0(0x1a7)+(_0x2fbc51[_0x2d2fe0(0x188)]!==0x1?'s':'')+_0x2d2fe0(0x19b)+_0x1cde05),await handleSDKOutput(_0x2fbc51,_0x526ce5),0x0;}catch(_0x3ee88d){if(_0x3ee88d instanceof SDKError)return console[_0x2d2fe0(0x1aa)](_0x2d2fe0(0x199)+_0x3ee88d[_0x2d2fe0(0x17f)]),_0x3ee88d[_0x2d2fe0(0x18d)]&&console[_0x2d2fe0(0x1aa)]('\x20\x20Cause:\x20'+_0x3ee88d[_0x2d2fe0(0x18d)]),0x1;throw _0x3ee88d;}}[a46_0xe76c57(0x181)](_0x5bbedb){const _0x39be51=a46_0xe76c57;if(_0x5bbedb[_0x39be51(0x1a8)][_0x39be51(0x188)]===0x0)return _0x39be51(0x1a2);if(_0x5bbedb['args'][_0x39be51(0x188)]>0x1)return _0x39be51(0x187);return undefined;}}
@@ -1 +1 @@
1
- const a47_0x3bc3a7=a47_0xe797;(function(_0x583cbf,_0x5ca7ec){const _0x56d39c=a47_0xe797,_0x2d91ab=_0x583cbf();while(!![]){try{const _0x378748=parseInt(_0x56d39c(0x96))/0x1*(-parseInt(_0x56d39c(0xae))/0x2)+-parseInt(_0x56d39c(0x98))/0x3+parseInt(_0x56d39c(0x85))/0x4+-parseInt(_0x56d39c(0x86))/0x5*(-parseInt(_0x56d39c(0x91))/0x6)+parseInt(_0x56d39c(0xb2))/0x7*(-parseInt(_0x56d39c(0xab))/0x8)+-parseInt(_0x56d39c(0x8f))/0x9*(-parseInt(_0x56d39c(0xaf))/0xa)+parseInt(_0x56d39c(0xad))/0xb*(parseInt(_0x56d39c(0xa9))/0xc);if(_0x378748===_0x5ca7ec)break;else _0x2d91ab['push'](_0x2d91ab['shift']());}catch(_0x2b6116){_0x2d91ab['push'](_0x2d91ab['shift']());}}}(a47_0x2ba3,0x8a2c8));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_0xe797(_0x77d54c,_0x31863c){_0x77d54c=_0x77d54c-0x82;const _0x2ba3d8=a47_0x2ba3();let _0xe797b9=_0x2ba3d8[_0x77d54c];return _0xe797b9;}import a47_0x27acdc from'chalk';function a47_0x2ba3(){const _0xa71fa7=['5ZdsIpm','Name:','tdx','OAuth','cli','getUserInfo','email','User:','name','639kuGqsH','green','1621614DJvOil','account_id','jobs','config','Credential\x20type:\x20','926poklXo','filter','3198528ohTQeo','log','yellow','status','error','bold','dim','CLI\x20flag','env','red','first_name','last_name','cyan','Show\x20authentication\x20status\x20and\x20current\x20context','message','description','(from\x20','12204408hNcyYu','profileSource','6208792aQBNLo','site','11sjYNrb','732pDAQgy','70970GZPJdW','N/A','\x20profile:\x20','7ykrCxG','session','join','displayWithSources','3823844oXinAf'];a47_0x2ba3=function(){return _0xa71fa7;};return a47_0x2ba3();}export class StatusCommand extends BaseCommand{[a47_0x3bc3a7(0x8e)]='status';[a47_0x3bc3a7(0xa7)]=a47_0x3bc3a7(0xa5);async['execute'](_0x504644){const _0x84a42b=a47_0x3bc3a7,{options:_0x1cb9c2,tdx:_0x53efdb}=_0x504644,_0x41fb04=_0x1cb9c2[_0x84a42b(0xac)],_0xbedc40=new GlobalContext(_0x1cb9c2),_0x2c4f3f=_0xbedc40['profile'],_0xdd2980=_0xbedc40[_0x84a42b(0xaa)],_0x5369e9=_0xdd2980===_0x84a42b(0x8a)?_0x84a42b(0x9f):_0xdd2980===_0x84a42b(0x82)?_0x84a42b(0x82):_0xdd2980===_0x84a42b(0xa0)?'TDX_PROFILE\x20env':_0xdd2980===_0x84a42b(0x94)?_0x84a42b(0x94):null,_0x3871d5=_0x2c4f3f?a47_0x27acdc[_0x84a42b(0xa4)](_0x2c4f3f):a47_0x27acdc[_0x84a42b(0x9e)](_0x84a42b(0xb0)),_0x491553=_0x5369e9?'\x20'+a47_0x27acdc['dim'](_0x84a42b(0xa8)+_0x5369e9+')'):'';console[_0x84a42b(0x99)](a47_0x27acdc[_0x84a42b(0x9d)](_0x84a42b(0x88))+_0x84a42b(0xb1)+_0x3871d5+_0x491553+'\x20'+a47_0x27acdc[_0x84a42b(0x9e)]('(')+'site:\x20'+a47_0x27acdc[_0x84a42b(0xa4)](_0x41fb04)+a47_0x27acdc[_0x84a42b(0x9e)](')'));const _0x2f08f5=await getOAuthTokens(_0x2c4f3f);if(_0x2f08f5)console['log'](_0x84a42b(0x95)+a47_0x27acdc[_0x84a42b(0xa4)](_0x84a42b(0x89)));else{const _0x460040=await resolveAPIKeyAsync(_0x41fb04,_0x2c4f3f);if(_0x460040){const {source:_0x1538de,isDeprecated:_0x89d66c}=_0x460040,_0x589dcc='Read\x20credential\x20from\x20'+a47_0x27acdc[_0x84a42b(0xa4)](_0x1538de);console[_0x84a42b(0x99)](_0x89d66c?a47_0x27acdc['yellow'](_0x589dcc):_0x589dcc);}else console[_0x84a42b(0x99)](a47_0x27acdc['yellow']('No\x20credential\x20found'));}let _0x18f1e3=![];try{const _0x5c8a8c=await _0x53efdb[_0x84a42b(0x93)][_0x84a42b(0x8b)]();console[_0x84a42b(0x99)](a47_0x27acdc[_0x84a42b(0x90)]('✓\x20Authentication\x20successful\x0a')),console[_0x84a42b(0x99)](a47_0x27acdc[_0x84a42b(0x9d)](_0x84a42b(0x8d))+'\x20'+a47_0x27acdc[_0x84a42b(0xa4)](_0x5c8a8c[_0x84a42b(0x8c)]));if(_0x5c8a8c[_0x84a42b(0xa2)]||_0x5c8a8c['last_name']){const _0x15a508=[_0x5c8a8c['first_name'],_0x5c8a8c[_0x84a42b(0xa3)]][_0x84a42b(0x97)](Boolean)[_0x84a42b(0x83)]('\x20');console[_0x84a42b(0x99)](a47_0x27acdc['bold'](_0x84a42b(0x87))+'\x20'+_0x15a508);}_0x5c8a8c[_0x84a42b(0x92)]&&console[_0x84a42b(0x99)](a47_0x27acdc[_0x84a42b(0x9d)]('Account\x20ID:')+'\x20'+a47_0x27acdc[_0x84a42b(0x9a)](_0x5c8a8c[_0x84a42b(0x92)])),_0x18f1e3=!![];}catch(_0xc407c2){_0xc407c2 instanceof HTTPClientError&&_0xc407c2[_0x84a42b(0x9b)]===0x191?printAuthError(_0xc407c2,!![],_0x2c4f3f):console[_0x84a42b(0x9c)](a47_0x27acdc[_0x84a42b(0xa1)]('✗\x20Validation\x20failed:\x20'+(_0xc407c2 instanceof Error?_0xc407c2[_0x84a42b(0xa6)]:String(_0xc407c2))));}return console['log'](),_0xbedc40[_0x84a42b(0x84)](),_0x18f1e3?0x0:0x1;}}
1
+ const a47_0x2d37ce=a47_0x21c9;function a47_0x21c9(_0x4adfa2,_0x47732e){_0x4adfa2=_0x4adfa2-0x96;const _0x2c906b=a47_0x2c90();let _0x21c91a=_0x2c906b[_0x4adfa2];return _0x21c91a;}(function(_0x16a8be,_0x51333e){const _0x517eec=a47_0x21c9,_0x1f30c2=_0x16a8be();while(!![]){try{const _0x540c5d=parseInt(_0x517eec(0x9e))/0x1+parseInt(_0x517eec(0xad))/0x2*(parseInt(_0x517eec(0xa0))/0x3)+-parseInt(_0x517eec(0xa7))/0x4*(-parseInt(_0x517eec(0xbc))/0x5)+parseInt(_0x517eec(0xa3))/0x6+parseInt(_0x517eec(0xba))/0x7+parseInt(_0x517eec(0x9d))/0x8*(parseInt(_0x517eec(0xbd))/0x9)+-parseInt(_0x517eec(0xaa))/0xa;if(_0x540c5d===_0x51333e)break;else _0x1f30c2['push'](_0x1f30c2['shift']());}catch(_0x1374e4){_0x1f30c2['push'](_0x1f30c2['shift']());}}}(a47_0x2c90,0xe602e));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';import a47_0x242580 from'chalk';export class StatusCommand extends BaseCommand{[a47_0x2d37ce(0xb3)]=a47_0x2d37ce(0x98);['description']=a47_0x2d37ce(0xa9);async[a47_0x2d37ce(0xbe)](_0x10f34f){const _0x38966d=a47_0x2d37ce,{options:_0x12eb20,tdx:_0x1e0397}=_0x10f34f,_0x1fe7c7=_0x12eb20[_0x38966d(0xc3)],_0x12edc1=new GlobalContext(_0x12eb20),_0x26ca05=_0x12edc1[_0x38966d(0xb6)],_0x3fa51f=_0x12edc1[_0x38966d(0x9b)],_0x37c798=_0x3fa51f===_0x38966d(0xb7)?_0x38966d(0xa2):_0x3fa51f==='session'?_0x38966d(0xbb):_0x3fa51f==='env'?_0x38966d(0x9c):_0x3fa51f===_0x38966d(0xac)?_0x38966d(0xac):null,_0x453627=_0x26ca05?a47_0x242580[_0x38966d(0xb9)](_0x26ca05):a47_0x242580[_0x38966d(0xb1)](_0x38966d(0xc2)),_0x37f71a=_0x37c798?'\x20'+a47_0x242580[_0x38966d(0xb1)](_0x38966d(0x9a)+_0x37c798+')'):'';console[_0x38966d(0x9f)](a47_0x242580[_0x38966d(0x99)](_0x38966d(0xc5))+_0x38966d(0xc6)+_0x453627+_0x37f71a+'\x20'+a47_0x242580[_0x38966d(0xb1)]('(')+'site:\x20'+a47_0x242580['cyan'](_0x1fe7c7)+a47_0x242580[_0x38966d(0xb1)](')'));const _0x128e09=await getOAuthTokens(_0x26ca05);if(_0x128e09)console[_0x38966d(0x9f)](_0x38966d(0xb4)+a47_0x242580[_0x38966d(0xb9)](_0x38966d(0xb0)));else{const _0x1523c4=await resolveAPIKeyAsync(_0x1fe7c7,_0x26ca05);if(_0x1523c4){const {source:_0x34b373,isDeprecated:_0x119af5}=_0x1523c4,_0x44945d=_0x38966d(0xa6)+a47_0x242580[_0x38966d(0xb9)](_0x34b373);console['log'](_0x119af5?a47_0x242580['yellow'](_0x44945d):_0x44945d);}else console[_0x38966d(0x9f)](a47_0x242580['yellow'](_0x38966d(0xa1)));}let _0x5d0565=![];try{const _0x26712c=await _0x1e0397['jobs'][_0x38966d(0xc1)]();console[_0x38966d(0x9f)](a47_0x242580[_0x38966d(0xc0)](_0x38966d(0xa8))),console[_0x38966d(0x9f)](a47_0x242580[_0x38966d(0x99)](_0x38966d(0xaf))+'\x20'+a47_0x242580['cyan'](_0x26712c[_0x38966d(0xab)]));if(_0x26712c[_0x38966d(0xb5)]||_0x26712c[_0x38966d(0xa5)]){const _0xb429fd=[_0x26712c['first_name'],_0x26712c[_0x38966d(0xa5)]][_0x38966d(0xc7)](Boolean)[_0x38966d(0xb2)]('\x20');console[_0x38966d(0x9f)](a47_0x242580[_0x38966d(0x99)](_0x38966d(0xc8))+'\x20'+_0xb429fd);}_0x26712c[_0x38966d(0xbf)]&&console[_0x38966d(0x9f)](a47_0x242580[_0x38966d(0x99)](_0x38966d(0x96))+'\x20'+a47_0x242580[_0x38966d(0xb8)](_0x26712c['account_id'])),_0x5d0565=!![];}catch(_0x4fd31c){_0x4fd31c instanceof HTTPClientError&&_0x4fd31c[_0x38966d(0x98)]===0x191?printAuthError(_0x4fd31c,!![],_0x26ca05):console[_0x38966d(0x97)](a47_0x242580[_0x38966d(0xae)](_0x38966d(0xa4)+(_0x4fd31c instanceof Error?_0x4fd31c['message']:String(_0x4fd31c))));}return console['log'](),_0x12edc1[_0x38966d(0xc4)](),_0x5d0565?0x0:0x1;}}function a47_0x2c90(){const _0x3a02bc=['red','User:','OAuth','dim','join','name','Credential\x20type:\x20','first_name','profile','cli','yellow','cyan','7375242NmiPdy','session','2907145qlmFii','18mXsZaJ','execute','account_id','green','getUserInfo','N/A','site','displayWithSources','tdx','\x20profile:\x20','filter','Name:','Account\x20ID:','error','status','bold','(from\x20','profileSource','TDX_PROFILE\x20env','7038664ExKngl','677375otCpKP','log','51tMqDjB','No\x20credential\x20found','CLI\x20flag','3792192faVkPl','✗\x20Validation\x20failed:\x20','last_name','Read\x20credential\x20from\x20','4WyZLCl','✓\x20Authentication\x20successful\x0a','Show\x20authentication\x20status\x20and\x20current\x20context','41039030EExQOY','email','config','40226OVPxNT'];a47_0x2c90=function(){return _0x3a02bc;};return a47_0x2c90();}