@treasuredata/tdx 2026.3.54 → 2026.4.0

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 (260) 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.d.ts.map +1 -1
  5. package/dist/cli.js +1 -1
  6. package/dist/cli.js.map +1 -1
  7. package/dist/commands/activations.js +1 -1
  8. package/dist/commands/agent-command.d.ts.map +1 -1
  9. package/dist/commands/agent-command.js +1 -1
  10. package/dist/commands/agent-command.js.map +1 -1
  11. package/dist/commands/agent-test-command.js +1 -1
  12. package/dist/commands/api-command.js +1 -1
  13. package/dist/commands/auth-command.js +1 -1
  14. package/dist/commands/cas-command.js +1 -1
  15. package/dist/commands/cas-segment-command.js +1 -1
  16. package/dist/commands/chat-command.js +1 -1
  17. package/dist/commands/claude-command.js +1 -1
  18. package/dist/commands/claude-statusline-command.js +1 -1
  19. package/dist/commands/claude-usage-command.js +1 -1
  20. package/dist/commands/command.js +1 -1
  21. package/dist/commands/connection-command.js +1 -1
  22. package/dist/commands/databases.js +1 -1
  23. package/dist/commands/delivery-command.js +1 -1
  24. package/dist/commands/describe.js +1 -1
  25. package/dist/commands/engage-campaign-pull-command.js +1 -1
  26. package/dist/commands/engage-campaign-push-command.js +1 -1
  27. package/dist/commands/engage-campaign-validate-command.js +1 -1
  28. package/dist/commands/engage-command.js +1 -1
  29. package/dist/commands/engage-template-pull-command.js +1 -1
  30. package/dist/commands/engage-template-push-command.js +1 -1
  31. package/dist/commands/engage-template-validate-command.js +1 -1
  32. package/dist/commands/job-command.js +1 -1
  33. package/dist/commands/journey-command.js +1 -1
  34. package/dist/commands/journey-validate-command.js +1 -1
  35. package/dist/commands/llm-command.js +1 -1
  36. package/dist/commands/mcp-command.js +1 -1
  37. package/dist/commands/parent-segment-command.js +1 -1
  38. package/dist/commands/policy-command.js +1 -1
  39. package/dist/commands/profile-command.js +1 -1
  40. package/dist/commands/profiles-command.js +1 -1
  41. package/dist/commands/query-command.js +1 -1
  42. package/dist/commands/schedule-command.js +1 -1
  43. package/dist/commands/segment-command.js +1 -1
  44. package/dist/commands/segment-create-command.js +1 -1
  45. package/dist/commands/segment-fields-command.js +1 -1
  46. package/dist/commands/segment-pull-command.js +1 -1
  47. package/dist/commands/segment-push-command.js +1 -1
  48. package/dist/commands/segment-update-command.js +1 -1
  49. package/dist/commands/segment-use-command.js +1 -1
  50. package/dist/commands/segment-validate-command.js +1 -1
  51. package/dist/commands/segments.js +1 -1
  52. package/dist/commands/show.js +1 -1
  53. package/dist/commands/status-command.js +1 -1
  54. package/dist/commands/tables.js +1 -1
  55. package/dist/commands/unset-command.js +1 -1
  56. package/dist/commands/upgrade-command.js +1 -1
  57. package/dist/commands/use-command.js +1 -1
  58. package/dist/commands/user-command.js +1 -1
  59. package/dist/commands/work-command.js +1 -1
  60. package/dist/commands/workflow-command.d.ts +27 -0
  61. package/dist/commands/workflow-command.d.ts.map +1 -1
  62. package/dist/commands/workflow-command.js +1 -1
  63. package/dist/commands/workflow-command.js.map +1 -1
  64. package/dist/core/auth.js +1 -1
  65. package/dist/core/command-output.js +1 -1
  66. package/dist/core/config.js +1 -1
  67. package/dist/core/connection-cache.js +1 -1
  68. package/dist/core/constants.js +1 -1
  69. package/dist/core/credential-cache.js +1 -1
  70. package/dist/core/global-context.js +1 -1
  71. package/dist/core/keychain.js +1 -1
  72. package/dist/core/oauth-keychain.js +1 -1
  73. package/dist/core/oauth.js +1 -1
  74. package/dist/core/profile.js +1 -1
  75. package/dist/core/project-config.js +1 -1
  76. package/dist/core/session.js +1 -1
  77. package/dist/core/user-cache.js +1 -1
  78. package/dist/core/version.js +1 -1
  79. package/dist/index.js +1 -1
  80. package/dist/mcp/server.js +1 -1
  81. package/dist/mcp/tools/index.js +1 -1
  82. package/dist/mcp/tools/tdx-run.js +1 -1
  83. package/dist/mcp/tools/tdx-search.js +1 -1
  84. package/dist/mcp/tools/work-create-item.js +1 -1
  85. package/dist/mcp/utils.js +1 -1
  86. package/dist/proxy/claude-usage-tracker.js +1 -1
  87. package/dist/proxy/passthrough-server.js +1 -1
  88. package/dist/proxy/sse-usage-parser.js +1 -1
  89. package/dist/sdk/agent/agent-config.d.ts +10 -0
  90. package/dist/sdk/agent/agent-config.d.ts.map +1 -1
  91. package/dist/sdk/agent/agent-config.js +1 -1
  92. package/dist/sdk/agent/agent-config.js.map +1 -1
  93. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  94. package/dist/sdk/agent/agent-yaml.d.ts +61 -3
  95. package/dist/sdk/agent/agent-yaml.d.ts.map +1 -1
  96. package/dist/sdk/agent/agent-yaml.js +1 -1
  97. package/dist/sdk/agent/agent-yaml.js.map +1 -1
  98. package/dist/sdk/agent/test/evaluator.js +1 -1
  99. package/dist/sdk/agent/test/executor.js +1 -1
  100. package/dist/sdk/agent/test/index.js +1 -1
  101. package/dist/sdk/agent/test/output.js +1 -1
  102. package/dist/sdk/agent/test/parser.js +1 -1
  103. package/dist/sdk/agent/tool-target-registry.js +1 -1
  104. package/dist/sdk/agent/types/agent-def.d.ts +43 -0
  105. package/dist/sdk/agent/types/agent-def.d.ts.map +1 -1
  106. package/dist/sdk/api.js +1 -1
  107. package/dist/sdk/cas/cas-api-client.js +1 -1
  108. package/dist/sdk/cas/cas-audience-yaml.js +1 -1
  109. package/dist/sdk/cas/cas-segment-yaml.js +1 -1
  110. package/dist/sdk/cas/index.js +1 -1
  111. package/dist/sdk/cas/pull-workflow.js +1 -1
  112. package/dist/sdk/cas/push-workflow.js +1 -1
  113. package/dist/sdk/client/cdp-api-client.js +1 -1
  114. package/dist/sdk/client/delivery-api-client.js +1 -1
  115. package/dist/sdk/client/endpoints.js +1 -1
  116. package/dist/sdk/client/engage-api-client.js +1 -1
  117. package/dist/sdk/client/http-client.js +1 -1
  118. package/dist/sdk/client/llm-api-client.d.ts +73 -1
  119. package/dist/sdk/client/llm-api-client.d.ts.map +1 -1
  120. package/dist/sdk/client/llm-api-client.js +1 -1
  121. package/dist/sdk/client/llm-api-client.js.map +1 -1
  122. package/dist/sdk/client/oauth-refresh.js +1 -1
  123. package/dist/sdk/client/rate-limiter.js +1 -1
  124. package/dist/sdk/client/td-api-client.js +1 -1
  125. package/dist/sdk/client/trino-api-client.js +1 -1
  126. package/dist/sdk/client/workflow-client.d.ts +28 -1
  127. package/dist/sdk/client/workflow-client.d.ts.map +1 -1
  128. package/dist/sdk/client/workflow-client.js +1 -1
  129. package/dist/sdk/client/workflow-client.js.map +1 -1
  130. package/dist/sdk/connection-validator.js +1 -1
  131. package/dist/sdk/connection.js +1 -1
  132. package/dist/sdk/delivery.js +1 -1
  133. package/dist/sdk/engage/campaign-pull.js +1 -1
  134. package/dist/sdk/engage/campaign-push.js +1 -1
  135. package/dist/sdk/engage/campaign-validator.js +1 -1
  136. package/dist/sdk/engage/campaign-yaml.js +1 -1
  137. package/dist/sdk/engage/template-pull.js +1 -1
  138. package/dist/sdk/engage/template-push.js +1 -1
  139. package/dist/sdk/engage/template-validator.js +1 -1
  140. package/dist/sdk/engage/template-yaml.js +1 -1
  141. package/dist/sdk/engage/types/campaign-def.js +1 -1
  142. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  143. package/dist/sdk/engage/types/template-schema.js +1 -1
  144. package/dist/sdk/engage.js +1 -1
  145. package/dist/sdk/errors.js +1 -1
  146. package/dist/sdk/index.js +1 -1
  147. package/dist/sdk/io/index.js +1 -1
  148. package/dist/sdk/io/node-filesystem.js +1 -1
  149. package/dist/sdk/job.js +1 -1
  150. package/dist/sdk/journey.js +1 -1
  151. package/dist/sdk/llm/chat-cache.js +1 -1
  152. package/dist/sdk/llm/index.d.ts.map +1 -1
  153. package/dist/sdk/llm/index.js +1 -1
  154. package/dist/sdk/llm/index.js.map +1 -1
  155. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  156. package/dist/sdk/llm/model-factors.js +1 -1
  157. package/dist/sdk/personalization.js +1 -1
  158. package/dist/sdk/policy.js +1 -1
  159. package/dist/sdk/query/index.js +1 -1
  160. package/dist/sdk/query/sql-parser.js +1 -1
  161. package/dist/sdk/realtime.js +1 -1
  162. package/dist/sdk/schedule.js +1 -1
  163. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  164. package/dist/sdk/segment/fields-display.js +1 -1
  165. package/dist/sdk/segment/file-discovery.d.ts.map +1 -1
  166. package/dist/sdk/segment/file-discovery.js +1 -1
  167. package/dist/sdk/segment/file-discovery.js.map +1 -1
  168. package/dist/sdk/segment/journey-utils.js +1 -1
  169. package/dist/sdk/segment/journey-validator.js +1 -1
  170. package/dist/sdk/segment/journey-yaml.js +1 -1
  171. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  172. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  173. package/dist/sdk/segment/pull-workflow.js +1 -1
  174. package/dist/sdk/segment/push-recovery.js +1 -1
  175. package/dist/sdk/segment/push-workflow.d.ts.map +1 -1
  176. package/dist/sdk/segment/push-workflow.js +1 -1
  177. package/dist/sdk/segment/push-workflow.js.map +1 -1
  178. package/dist/sdk/segment/resolution-context.js +1 -1
  179. package/dist/sdk/segment/segment-path-parser.js +1 -1
  180. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  181. package/dist/sdk/segment/segment-validator.js +1 -1
  182. package/dist/sdk/segment/target-resolution.js +1 -1
  183. package/dist/sdk/segment/tdx-config.js +1 -1
  184. package/dist/sdk/segment/types/activation-schema.js +1 -1
  185. package/dist/sdk/segment/types/journey-def.js +1 -1
  186. package/dist/sdk/segment/types/journey-schema.js +1 -1
  187. package/dist/sdk/segment/types/segment-def.js +1 -1
  188. package/dist/sdk/segment/types/segment-schema.js +1 -1
  189. package/dist/sdk/segment/validate-files.js +1 -1
  190. package/dist/sdk/segment/yaml-validator.js +1 -1
  191. package/dist/sdk/segment.js +1 -1
  192. package/dist/sdk/types/index.d.ts +2 -2
  193. package/dist/sdk/types/index.d.ts.map +1 -1
  194. package/dist/sdk/types/index.js +1 -1
  195. package/dist/sdk/types/index.js.map +1 -1
  196. package/dist/sdk/types/llm.d.ts +158 -0
  197. package/dist/sdk/types/llm.d.ts.map +1 -1
  198. package/dist/sdk/types/progress.js +1 -1
  199. package/dist/sdk/types/workflow.d.ts +26 -0
  200. package/dist/sdk/types/workflow.d.ts.map +1 -1
  201. package/dist/sdk/types/workspace.js +1 -1
  202. package/dist/sdk/user.js +1 -1
  203. package/dist/sdk/util/format-detector.js +1 -1
  204. package/dist/sdk/util/formatters.js +1 -1
  205. package/dist/sdk/util/index.js +1 -1
  206. package/dist/sdk/util/paginate.js +1 -1
  207. package/dist/sdk/util/tree-formatter.js +1 -1
  208. package/dist/sdk/workflow/archive-validation.js +1 -1
  209. package/dist/sdk/workflow/clone-workflow.js +1 -1
  210. package/dist/sdk/workflow/index.d.ts +22 -0
  211. package/dist/sdk/workflow/index.d.ts.map +1 -1
  212. package/dist/sdk/workflow/index.js +1 -1
  213. package/dist/sdk/workflow/index.js.map +1 -1
  214. package/dist/sdk/workflow/pull-workflow.js +1 -1
  215. package/dist/sdk/workflow/push-workflow.js +1 -1
  216. package/dist/sdk/workflow/tdx-config.js +1 -1
  217. package/dist/sdk/workflow/workflow-utils.js +1 -1
  218. package/dist/sdk/workspace/frontmatter.js +1 -1
  219. package/dist/sdk/workspace/git.js +1 -1
  220. package/dist/sdk/workspace/index.d.ts.map +1 -1
  221. package/dist/sdk/workspace/index.js +1 -1
  222. package/dist/sdk/workspace/index.js.map +1 -1
  223. package/dist/sdk/workspace/templates.js +1 -1
  224. package/dist/sdk/workspace/weekly.js +1 -1
  225. package/dist/sdk/workspace/wikilinks.js +1 -1
  226. package/dist/test-utils/command-runner.js +1 -1
  227. package/dist/test-utils/factories.js +1 -1
  228. package/dist/test-utils/fixtures.js +1 -1
  229. package/dist/test-utils/http-mock.js +1 -1
  230. package/dist/test-utils/index.js +1 -1
  231. package/dist/utils/async.js +1 -1
  232. package/dist/utils/colors.js +1 -1
  233. package/dist/utils/diff.js +1 -1
  234. package/dist/utils/file-permissions.js +1 -1
  235. package/dist/utils/file-reader.js +1 -1
  236. package/dist/utils/github-releases.js +1 -1
  237. package/dist/utils/global-cache.js +1 -1
  238. package/dist/utils/json-loader.js +1 -1
  239. package/dist/utils/local-cache.js +1 -1
  240. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  241. package/dist/utils/logger/formatters/index.js +1 -1
  242. package/dist/utils/logger/handlers/console-handler.js +1 -1
  243. package/dist/utils/logger/handlers/file-handler.js +1 -1
  244. package/dist/utils/logger/handlers/index.js +1 -1
  245. package/dist/utils/logger/handlers/null-handler.js +1 -1
  246. package/dist/utils/logger/index.js +1 -1
  247. package/dist/utils/logger/logger.js +1 -1
  248. package/dist/utils/logger/types.js +1 -1
  249. package/dist/utils/option-validation.js +1 -1
  250. package/dist/utils/process.d.ts.map +1 -1
  251. package/dist/utils/process.js +1 -1
  252. package/dist/utils/process.js.map +1 -1
  253. package/dist/utils/prompt.js +1 -1
  254. package/dist/utils/spinner.js +1 -1
  255. package/dist/utils/sse-parser.js +1 -1
  256. package/dist/utils/string-utils.js +1 -1
  257. package/dist/utils/table-ref-parser.js +1 -1
  258. package/dist/utils/tdx-logger.js +1 -1
  259. package/dist/utils/version-check.js +1 -1
  260. package/package.json +2 -2
@@ -1 +1 @@
1
- function a39_0x68f9(_0xc19b5d,_0x378111){_0xc19b5d=_0xc19b5d-0x180;const _0x444f6b=a39_0x444f();let _0x68f91=_0x444f6b[_0xc19b5d];return _0x68f91;}function a39_0x444f(){const _0x2a771d=['verbose','\x27...','Listing\x20fields\x20for\x20\x27','4764950mIuyuz','description','parentSegment','132YsNAia','length','List\x20available\x20fields\x20for\x20segmentation','2DOEofE','execute','3129090jEodzR','6808srCKIq','site','Error:\x20Parent\x20segment\x20name\x20is\x20required','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','46115nopcBb','listFields','Parent\x20segment:\x20','Usage:\x20tdx\x20segment\x20fields\x20<parent_name>','error','152187XWIdMd','738qEjTTN','Site:\x20','676448jqSnhO','json','2100366duzaku','segment','✔\x20Found\x20'];a39_0x444f=function(){return _0x2a771d;};return a39_0x444f();}const a39_0x5d0a6e=a39_0x68f9;(function(_0x5d1d36,_0x21ab74){const _0x278de0=a39_0x68f9,_0x13e4e9=_0x5d1d36();while(!![]){try{const _0x258079=parseInt(_0x278de0(0x194))/0x1*(parseInt(_0x278de0(0x18d))/0x2)+parseInt(_0x278de0(0x181))/0x3+-parseInt(_0x278de0(0x19c))/0x4+-parseInt(_0x278de0(0x187))/0x5+parseInt(_0x278de0(0x18a))/0x6*(parseInt(_0x278de0(0x199))/0x7)+-parseInt(_0x278de0(0x190))/0x8*(-parseInt(_0x278de0(0x19a))/0x9)+parseInt(_0x278de0(0x18f))/0xa;if(_0x258079===_0x21ab74)break;else _0x13e4e9['push'](_0x13e4e9['shift']());}catch(_0x42651c){_0x13e4e9['push'](_0x13e4e9['shift']());}}}(a39_0x444f,0x76708));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{displayFieldsHumanReadable}from'../sdk/segment/fields-display.js';export class SegmentFieldsCommand extends BaseCommand{['name']='segment:fields';[a39_0x5d0a6e(0x188)]=a39_0x5d0a6e(0x18c);async[a39_0x5d0a6e(0x18e)](_0x33dbdc){const _0x2ac323=a39_0x5d0a6e,{options:_0x39c6fe,args:_0xf7a17f,tdx:_0x3f6169}=_0x33dbdc,_0x289ca4=_0xf7a17f[0x0]||_0x39c6fe[_0x2ac323(0x189)];if(!_0x289ca4)return console[_0x2ac323(0x198)](_0x2ac323(0x192)),console[_0x2ac323(0x198)](_0x2ac323(0x197)),console[_0x2ac323(0x198)](_0x2ac323(0x193)),0x1;_0x39c6fe[_0x2ac323(0x184)]&&(console['error'](_0x2ac323(0x19b)+_0x39c6fe[_0x2ac323(0x191)]),console['error'](_0x2ac323(0x196)+_0x289ca4));const _0xf21f1a=await withSpinner(_0x2ac323(0x186)+_0x289ca4+_0x2ac323(0x185),()=>_0x3f6169[_0x2ac323(0x182)][_0x2ac323(0x195)](_0x289ca4),{'verbose':_0x39c6fe[_0x2ac323(0x184)]}),_0x4710b4=_0xf21f1a['data'];console[_0x2ac323(0x198)](_0x2ac323(0x183)+_0x4710b4[_0x2ac323(0x18b)]+'\x20field'+(_0x4710b4[_0x2ac323(0x18b)]!==0x1?'s':''));if(_0x39c6fe[_0x2ac323(0x180)]||_0x39c6fe['jsonl'])return await handleSDKOutput(_0x4710b4,_0x39c6fe),0x0;return displayFieldsHumanReadable(_0x4710b4,_0x289ca4),0x0;}}
1
+ const a39_0x1c95d5=a39_0x4149;function a39_0x235f(){const _0xd03d8c=['length','7rmzRNL','18imwANF','6099072VIpLiP','listFields','\x20field','json','2324320VZLoIt','verbose','name','segment','84povBGv','parentSegment','1315929vVdQcf','Error:\x20Parent\x20segment\x20name\x20is\x20required','2wpLjtB','1872957cXMNQj','Listing\x20fields\x20for\x20\x27','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','2127900oADKUw','Site:\x20','List\x20available\x20fields\x20for\x20segmentation','execute','error','✔\x20Found\x20','3648510QkCAxP','segment:fields','jsonl','Parent\x20segment:\x20','2269201MyRKzH','4aIiMoC','site'];a39_0x235f=function(){return _0xd03d8c;};return a39_0x235f();}(function(_0xe298fe,_0x177037){const _0x58ccdc=a39_0x4149,_0x531e7d=_0xe298fe();while(!![]){try{const _0x1356e5=parseInt(_0x58ccdc(0xe1))/0x1*(-parseInt(_0x58ccdc(0xe3))/0x2)+-parseInt(_0x58ccdc(0xe4))/0x3*(parseInt(_0x58ccdc(0xf2))/0x4)+-parseInt(_0x58ccdc(0xfb))/0x5+-parseInt(_0x58ccdc(0xe7))/0x6*(-parseInt(_0x58ccdc(0xf5))/0x7)+parseInt(_0x58ccdc(0xf7))/0x8+-parseInt(_0x58ccdc(0xf6))/0x9*(-parseInt(_0x58ccdc(0xed))/0xa)+parseInt(_0x58ccdc(0xf1))/0xb*(parseInt(_0x58ccdc(0xdf))/0xc);if(_0x1356e5===_0x177037)break;else _0x531e7d['push'](_0x531e7d['shift']());}catch(_0x1587a4){_0x531e7d['push'](_0x531e7d['shift']());}}}(a39_0x235f,0xd839d));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';function a39_0x4149(_0x299683,_0x4fd732){_0x299683=_0x299683-0xdf;const _0x235f27=a39_0x235f();let _0x4149b9=_0x235f27[_0x299683];return _0x4149b9;}import{displayFieldsHumanReadable}from'../sdk/segment/fields-display.js';export class SegmentFieldsCommand extends BaseCommand{[a39_0x1c95d5(0xfd)]=a39_0x1c95d5(0xee);['description']=a39_0x1c95d5(0xe9);async[a39_0x1c95d5(0xea)](_0x467f5a){const _0x5ca95e=a39_0x1c95d5,{options:_0x4c2b3d,args:_0x4ba79e,tdx:_0x4c462d}=_0x467f5a,_0x3768ed=_0x4ba79e[0x0]||_0x4c2b3d[_0x5ca95e(0xe0)];if(!_0x3768ed)return console[_0x5ca95e(0xeb)](_0x5ca95e(0xe2)),console['error']('Usage:\x20tdx\x20segment\x20fields\x20<parent_name>'),console[_0x5ca95e(0xeb)](_0x5ca95e(0xe6)),0x1;_0x4c2b3d[_0x5ca95e(0xfc)]&&(console['error'](_0x5ca95e(0xe8)+_0x4c2b3d[_0x5ca95e(0xf3)]),console[_0x5ca95e(0xeb)](_0x5ca95e(0xf0)+_0x3768ed));const _0x2c420e=await withSpinner(_0x5ca95e(0xe5)+_0x3768ed+'\x27...',()=>_0x4c462d[_0x5ca95e(0xfe)][_0x5ca95e(0xf8)](_0x3768ed),{'verbose':_0x4c2b3d[_0x5ca95e(0xfc)]}),_0x39c755=_0x2c420e['data'];console[_0x5ca95e(0xeb)](_0x5ca95e(0xec)+_0x39c755[_0x5ca95e(0xf4)]+_0x5ca95e(0xf9)+(_0x39c755['length']!==0x1?'s':''));if(_0x4c2b3d[_0x5ca95e(0xfa)]||_0x4c2b3d[_0x5ca95e(0xef)])return await handleSDKOutput(_0x39c755,_0x4c2b3d),0x0;return displayFieldsHumanReadable(_0x39c755,_0x3768ed),0x0;}}
@@ -1 +1 @@
1
- const a40_0x2c598d=a40_0x92c3;(function(_0x17439e,_0x15cd5f){const _0x30ff5a=a40_0x92c3,_0x520b89=_0x17439e();while(!![]){try{const _0x51da08=parseInt(_0x30ff5a(0xd0))/0x1*(-parseInt(_0x30ff5a(0xd3))/0x2)+-parseInt(_0x30ff5a(0xcc))/0x3+-parseInt(_0x30ff5a(0xb9))/0x4*(-parseInt(_0x30ff5a(0xbc))/0x5)+parseInt(_0x30ff5a(0xdf))/0x6+-parseInt(_0x30ff5a(0xab))/0x7+-parseInt(_0x30ff5a(0xd2))/0x8+-parseInt(_0x30ff5a(0x96))/0x9*(-parseInt(_0x30ff5a(0x99))/0xa);if(_0x51da08===_0x15cd5f)break;else _0x520b89['push'](_0x520b89['shift']());}catch(_0x566af6){_0x520b89['push'](_0x520b89['shift']());}}}(a40_0x34eb,0x3c418));function a40_0x92c3(_0x10887c,_0x4d7c9c){_0x10887c=_0x10887c-0x95;const _0x34eb21=a40_0x34eb();let _0x92c3a8=_0x34eb21[_0x10887c];return _0x92c3a8;}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_0x32bcfc from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';function a40_0x34eb(){const _0x34dd6e=['site','hasChanges','Pulling\x20segments\x20from\x20\x27','counts','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','cwd','cyan','\x20=\x20','message','yes','segment','description','Site:\x20','no_parent','dryRun','1107666XDLfPq','Target\x20resource:\x20','\x20activations','journeys','targetDir','journeyVersions','isNew','parent_segment','filter','length','Error:\x20','\x20with\x20','Usage:\x20tdx\x20sg\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20(requires\x20context\x20or\x20tdx.json)','\x20files\x20to\x20','4gqmhQl','parentName','dim','2365815MlsIos','\x0aChanges\x20to\x20\x27','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','relativePath','content','absolutePath','\x27...','\x20files?','\x20unchanged\x20files','\x0aError:','errorCode','session','error','helpText','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','\x20\x20🎯\x20','1227672rtTKGy','utf-8','-\x20no\x20files\x20written','segment:pull','1667oxCvno','dirname','1185256gkwrDA','134exGmST','✔\x20Context\x20set:\x20','pullSegments','\x20segments','green','parentSegment','red','files','\x20changed\x20files','Write\x20','name','\x20\x20🗺️\x20\x20','967278RBbFkR','resourceName','segments','type','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file','Aborted.','repeat','2268abPEfu','verbose','\x20versions)','17450QegIOJ','yellow','Parent\x20segment:\x20'];a40_0x34eb=function(){return _0x34dd6e;};return a40_0x34eb();}import a40_0x27f258 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_0x2c598d(0xdd)]=a40_0x2c598d(0xcf);[a40_0x2c598d(0xa7)]='Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files';async['execute'](_0x36c8db){const _0x254e92=a40_0x2c598d,{options:_0x35ee56,args:_0x4f06ca,tdx:_0x493309}=_0x36c8db,_0x50a978=_0x35ee56,_0x7d851=await resolveTarget({'arg':_0x4f06ca[0x0],'contextParent':_0x35ee56[_0x254e92(0xd8)],'cwd':process[_0x254e92(0xa1)]()});if(!isSuccessfulResolution(_0x7d851))return _0x7d851[_0x254e92(0xc6)]===_0x254e92(0xa9)?(console[_0x254e92(0xc8)](a40_0x32bcfc[_0x254e92(0x9a)](_0x254e92(0xbe))),console[_0x254e92(0xc8)](_0x254e92(0xb7)),console[_0x254e92(0xc8)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent'),console[_0x254e92(0xc8)](_0x254e92(0xe3))):(console[_0x254e92(0xc8)](a40_0x32bcfc[_0x254e92(0xd9)](_0x254e92(0xb5)+_0x7d851[_0x254e92(0xa4)]+'\x0a')),_0x7d851['helpText']&&console[_0x254e92(0xc8)](a40_0x32bcfc[_0x254e92(0xa2)](_0x7d851[_0x254e92(0xc9)]))),0x1;const _0x77b0c=_0x7d851[_0x254e92(0xba)],_0x4e7bc8=_0x7d851[_0x254e92(0xaf)],_0x5be467=_0x7d851[_0x254e92(0xe2)]==='file'?_0x7d851[_0x254e92(0xe0)]:undefined;_0x50a978[_0x254e92(0x97)]&&(console[_0x254e92(0xc8)](_0x254e92(0xa8)+_0x50a978[_0x254e92(0x9c)]),console['error'](_0x254e92(0x9b)+_0x77b0c),_0x5be467&&console[_0x254e92(0xc8)](_0x254e92(0xac)+_0x5be467));const _0x19737f=await withProgressSpinner(_0x254e92(0x9e)+_0x77b0c+_0x254e92(0xc2),_0xc66e9a=>_0x493309[_0x254e92(0xa6)][_0x254e92(0xd5)](_0x77b0c,{'targetDir':_0x4e7bc8,'targetResourceName':_0x5be467,'verbose':_0x50a978[_0x254e92(0x97)],'progress':{'update':_0x10809d=>{const _0x6c58ab=_0x254e92;_0xc66e9a['setPhase'](_0x10809d),_0x50a978[_0x6c58ab(0x97)]&&console['error']('\x20\x20'+_0x10809d);}}}),{'verbose':_0x50a978[_0x254e92(0x97)]}),_0x5f829b=_0x19737f['data'];if(_0x5f829b['counts'][_0x254e92(0xe1)]===0x0&&_0x5f829b[_0x254e92(0x9f)][_0x254e92(0xae)]===0x0)return console[_0x254e92(0xc8)](a40_0x32bcfc[_0x254e92(0x9a)]('No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27'+_0x5f829b['parentName']+'\x27')),0x0;const _0x3a6e33=_0x5f829b[_0x254e92(0xda)]['filter'](_0x3babce=>_0x3babce[_0x254e92(0xb1)]),_0x207a70=_0x5f829b[_0x254e92(0xda)][_0x254e92(0xb3)](_0x55987c=>!_0x55987c[_0x254e92(0xb1)]&&_0x55987c['hasChanges']),_0x5070cd=_0x5f829b[_0x254e92(0xda)][_0x254e92(0xb3)](_0x45f25c=>!_0x45f25c[_0x254e92(0xb1)]&&!_0x45f25c[_0x254e92(0x9d)]);console[_0x254e92(0xc8)]('\x0aPull\x20summary\x20for\x20\x27'+_0x5f829b[_0x254e92(0xba)]+'\x27:'),console[_0x254e92(0xc8)](_0x254e92(0xcb)+a40_0x32bcfc[_0x254e92(0xa2)](_0x5f829b[_0x254e92(0x9f)][_0x254e92(0xe1)]+_0x254e92(0xd6))+_0x254e92(0xb6)+a40_0x32bcfc[_0x254e92(0xa2)](_0x5f829b[_0x254e92(0x9f)]['activations']+_0x254e92(0xad)));if(_0x5f829b['counts']['journeys']>0x0){const _0x73fa55=_0x5f829b[_0x254e92(0x9f)]['journeyVersions']>_0x5f829b[_0x254e92(0x9f)][_0x254e92(0xae)]?'\x20('+_0x5f829b[_0x254e92(0x9f)][_0x254e92(0xb0)]+_0x254e92(0x98):'';console[_0x254e92(0xc8)](_0x254e92(0xde)+a40_0x32bcfc[_0x254e92(0xa2)](_0x5f829b[_0x254e92(0x9f)][_0x254e92(0xae)]+'\x20journeys')+a40_0x32bcfc['dim'](_0x73fa55));}console[_0x254e92(0xc8)]('\x20\x20'+a40_0x32bcfc['green']('+\x20'+_0x3a6e33[_0x254e92(0xb4)]+'\x20new\x20files')),console['error']('\x20\x20'+a40_0x32bcfc[_0x254e92(0x9a)]('~\x20'+_0x207a70['length']+_0x254e92(0xdb))),console[_0x254e92(0xc8)]('\x20\x20'+a40_0x32bcfc[_0x254e92(0xbb)]('=\x20'+_0x5070cd[_0x254e92(0xb4)]+_0x254e92(0xc4))),console[_0x254e92(0xc8)]('\x20\x20Target:\x20'+a40_0x32bcfc[_0x254e92(0xa2)](_0x5f829b['targetDir'])+'\x0a');if(_0x207a70['length']>0x0)for(const _0x16f075 of _0x207a70){console['error'](_0x254e92(0xbd)+_0x16f075[_0x254e92(0xbf)]+'\x27:'),console[_0x254e92(0xc8)]('─'['repeat'](0x3c)),console['error'](_0x16f075['diff']),console[_0x254e92(0xc8)]('─'[_0x254e92(0x95)](0x3c));}if(_0x50a978[_0x254e92(0xaa)])return console[_0x254e92(0xc8)](a40_0x32bcfc['yellow']('\x0a[Dry\x20run]\x20No\x20files\x20were\x20written')),0x0;if(_0x3a6e33[_0x254e92(0xb4)]===0x0&&_0x207a70[_0x254e92(0xb4)]===0x0)return console[_0x254e92(0xc8)](a40_0x32bcfc[_0x254e92(0xd7)]('✔\x20All\x20files\x20are\x20up\x20to\x20date')),saveSessionContext({'parent_segment':_0x5f829b['parentName']},_0x50a978[_0x254e92(0xc7)]),console[_0x254e92(0xc8)](a40_0x32bcfc[_0x254e92(0xd7)](_0x254e92(0xd4)+a40_0x32bcfc['dim'](_0x254e92(0xb2))+'\x20=\x20'+a40_0x32bcfc[_0x254e92(0xa2)](_0x5f829b[_0x254e92(0xba)]))),0x0;if(!_0x50a978[_0x254e92(0xa5)]){if(!isInteractive())return console[_0x254e92(0xc8)](a40_0x32bcfc[_0x254e92(0xd9)](_0x254e92(0xc5)),_0x254e92(0xca)),console[_0x254e92(0xc8)](a40_0x32bcfc[_0x254e92(0xbb)](_0x254e92(0xa0))),0x1;const _0x6527da=await confirmKey(_0x254e92(0xdc)+(_0x3a6e33[_0x254e92(0xb4)]+_0x207a70[_0x254e92(0xb4)])+_0x254e92(0xc3));if(!_0x6527da)return console['error'](a40_0x32bcfc[_0x254e92(0x9a)](_0x254e92(0xe4)),_0x254e92(0xce)),0x1;}for(const _0x4c4691 of _0x5f829b[_0x254e92(0xda)]){if(_0x4c4691[_0x254e92(0xb1)]||_0x4c4691['hasChanges']){const _0x28b2cd=a40_0x27f258[_0x254e92(0xd1)](_0x4c4691[_0x254e92(0xc1)]);!existsSync(_0x28b2cd)&&mkdirSync(_0x28b2cd,{'recursive':!![]}),writeFileSync(_0x4c4691[_0x254e92(0xc1)],_0x4c4691[_0x254e92(0xc0)],_0x254e92(0xcd));}}return console[_0x254e92(0xc8)](a40_0x32bcfc['green']('✔\x20Pulled\x20'+(_0x3a6e33[_0x254e92(0xb4)]+_0x207a70[_0x254e92(0xb4)])+_0x254e92(0xb8)+_0x5f829b[_0x254e92(0xaf)])),saveSessionContext({'parent_segment':_0x5f829b[_0x254e92(0xba)]},_0x50a978[_0x254e92(0xc7)]),console[_0x254e92(0xc8)](a40_0x32bcfc[_0x254e92(0xd7)]('✔\x20Context\x20set:\x20'+a40_0x32bcfc['dim'](_0x254e92(0xb2))+_0x254e92(0xa3)+a40_0x32bcfc[_0x254e92(0xa2)](_0x5f829b['parentName']))),0x0;}}
1
+ const a40_0x516ce0=a40_0x3e95;(function(_0x4ce5df,_0x192e81){const _0x1644f9=a40_0x3e95,_0x41ec3e=_0x4ce5df();while(!![]){try{const _0x30ab78=parseInt(_0x1644f9(0xc9))/0x1+parseInt(_0x1644f9(0xbb))/0x2+parseInt(_0x1644f9(0xda))/0x3+parseInt(_0x1644f9(0xc4))/0x4*(parseInt(_0x1644f9(0xcb))/0x5)+-parseInt(_0x1644f9(0xc0))/0x6*(-parseInt(_0x1644f9(0xb6))/0x7)+parseInt(_0x1644f9(0xb5))/0x8*(parseInt(_0x1644f9(0xca))/0x9)+-parseInt(_0x1644f9(0xc2))/0xa*(parseInt(_0x1644f9(0xef))/0xb);if(_0x30ab78===_0x192e81)break;else _0x41ec3e['push'](_0x41ec3e['shift']());}catch(_0x2c1caa){_0x41ec3e['push'](_0x41ec3e['shift']());}}}(a40_0x59e6,0xef52f));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';function a40_0x59e6(){const _0x3bb8f1=['site','808692PUISuF','\x20unchanged\x20files','Error:\x20','journeyVersions','session','1806119MXzgaw','2583VnwAbt','5xkGDLu','content','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','setPhase','green','parent_segment','\x20versions)','Aborted.','\x20\x20🗺️\x20\x20','cyan','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent','length','No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27','diff','filter','3991908JUNWmF','✔\x20Pulled\x20','hasChanges','segments','\x20changed\x20files','segment:pull','message','✔\x20Context\x20set:\x20','parentName','yellow','\x20files?','cwd','dirname','verbose','journeys','Site:\x20','Target\x20resource:\x20','relativePath','data','execute','\x20files\x20to\x20','11420244MCgVtG','Usage:\x20tdx\x20sg\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20(requires\x20context\x20or\x20tdx.json)','counts','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file','resourceName','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','✔\x20All\x20files\x20are\x20up\x20to\x20date','\x20\x20🎯\x20','\x20new\x20files','targetDir','\x20journeys','files','Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files','\x0aPull\x20summary\x20for\x20\x27','Parent\x20segment:\x20','\x0aChanges\x20to\x20\x27','\x20\x20Target:\x20','error','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','dryRun','Pulling\x20segments\x20from\x20\x27','isNew','description','absolutePath','15112wIwrMx','238WCsGcN','no_parent','Write\x20','\x20=\x20','dim','484296HYrusQ','pullSegments','file','repeat','errorCode','178212iNgDVB','red','40kctUda'];a40_0x59e6=function(){return _0x3bb8f1;};return a40_0x59e6();}import{saveSessionContext}from'../core/session.js';function a40_0x3e95(_0x420e09,_0x32986c){_0x420e09=_0x420e09-0x9e;const _0x59e632=a40_0x59e6();let _0x3e95f7=_0x59e632[_0x420e09];return _0x3e95f7;}import a40_0x411928 from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';import a40_0x1dd15a from'path';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';export{buildFolderIdToPathMap as buildFolderPathMap}from'../sdk/segment/resolution-context.js';export class SegmentPullCommand extends BaseCommand{['name']=a40_0x516ce0(0xdf);[a40_0x516ce0(0xb3)]=a40_0x516ce0(0xa9);async[a40_0x516ce0(0xed)](_0xf05e9a){const _0xe1423c=a40_0x516ce0,{options:_0x18a751,args:_0x49c9c0,tdx:_0x3ba5f8}=_0xf05e9a,_0x59a484=_0x18a751,_0x2c56f7=await resolveTarget({'arg':_0x49c9c0[0x0],'contextParent':_0x18a751['parentSegment'],'cwd':process[_0xe1423c(0xe5)]()});if(!isSuccessfulResolution(_0x2c56f7))return _0x2c56f7[_0xe1423c(0xbf)]===_0xe1423c(0xb7)?(console['error'](a40_0x411928[_0xe1423c(0xe3)]('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console[_0xe1423c(0xae)](_0xe1423c(0x9e)),console[_0xe1423c(0xae)](_0xe1423c(0xd5)),console[_0xe1423c(0xae)](_0xe1423c(0xa0))):(console[_0xe1423c(0xae)](a40_0x411928[_0xe1423c(0xc1)](_0xe1423c(0xc6)+_0x2c56f7[_0xe1423c(0xe0)]+'\x0a')),_0x2c56f7['helpText']&&console[_0xe1423c(0xae)](a40_0x411928[_0xe1423c(0xd4)](_0x2c56f7['helpText']))),0x1;const _0x2cc7c1=_0x2c56f7[_0xe1423c(0xe2)],_0x30c48c=_0x2c56f7[_0xe1423c(0xa6)],_0x21dbd7=_0x2c56f7['type']===_0xe1423c(0xbd)?_0x2c56f7[_0xe1423c(0xa1)]:undefined;_0x59a484[_0xe1423c(0xe7)]&&(console[_0xe1423c(0xae)](_0xe1423c(0xe9)+_0x59a484[_0xe1423c(0xc3)]),console[_0xe1423c(0xae)](_0xe1423c(0xab)+_0x2cc7c1),_0x21dbd7&&console['error'](_0xe1423c(0xea)+_0x21dbd7));const _0x43076f=await withProgressSpinner(_0xe1423c(0xb1)+_0x2cc7c1+'\x27...',_0x2b157f=>_0x3ba5f8['segment'][_0xe1423c(0xbc)](_0x2cc7c1,{'targetDir':_0x30c48c,'targetResourceName':_0x21dbd7,'verbose':_0x59a484['verbose'],'progress':{'update':_0x10b004=>{const _0x258fb8=_0xe1423c;_0x2b157f[_0x258fb8(0xce)](_0x10b004),_0x59a484[_0x258fb8(0xe7)]&&console[_0x258fb8(0xae)]('\x20\x20'+_0x10b004);}}}),{'verbose':_0x59a484[_0xe1423c(0xe7)]}),_0x449387=_0x43076f[_0xe1423c(0xec)];if(_0x449387[_0xe1423c(0x9f)][_0xe1423c(0xdd)]===0x0&&_0x449387[_0xe1423c(0x9f)]['journeys']===0x0)return console[_0xe1423c(0xae)](a40_0x411928[_0xe1423c(0xe3)](_0xe1423c(0xd7)+_0x449387[_0xe1423c(0xe2)]+'\x27')),0x0;const _0x4840aa=_0x449387[_0xe1423c(0xa8)]['filter'](_0x3d1039=>_0x3d1039['isNew']),_0x39ce7d=_0x449387[_0xe1423c(0xa8)][_0xe1423c(0xd9)](_0x3e9591=>!_0x3e9591[_0xe1423c(0xb2)]&&_0x3e9591[_0xe1423c(0xdc)]),_0x294b78=_0x449387[_0xe1423c(0xa8)][_0xe1423c(0xd9)](_0x44b515=>!_0x44b515[_0xe1423c(0xb2)]&&!_0x44b515['hasChanges']);console[_0xe1423c(0xae)](_0xe1423c(0xaa)+_0x449387['parentName']+'\x27:'),console['error'](_0xe1423c(0xa4)+a40_0x411928['cyan'](_0x449387[_0xe1423c(0x9f)][_0xe1423c(0xdd)]+'\x20segments')+'\x20with\x20'+a40_0x411928[_0xe1423c(0xd4)](_0x449387[_0xe1423c(0x9f)]['activations']+'\x20activations'));if(_0x449387[_0xe1423c(0x9f)][_0xe1423c(0xe8)]>0x0){const _0x5b597a=_0x449387[_0xe1423c(0x9f)][_0xe1423c(0xc7)]>_0x449387[_0xe1423c(0x9f)][_0xe1423c(0xe8)]?'\x20('+_0x449387[_0xe1423c(0x9f)]['journeyVersions']+_0xe1423c(0xd1):'';console[_0xe1423c(0xae)](_0xe1423c(0xd3)+a40_0x411928[_0xe1423c(0xd4)](_0x449387[_0xe1423c(0x9f)][_0xe1423c(0xe8)]+_0xe1423c(0xa7))+a40_0x411928['dim'](_0x5b597a));}console[_0xe1423c(0xae)]('\x20\x20'+a40_0x411928[_0xe1423c(0xcf)]('+\x20'+_0x4840aa[_0xe1423c(0xd6)]+_0xe1423c(0xa5))),console[_0xe1423c(0xae)]('\x20\x20'+a40_0x411928[_0xe1423c(0xe3)]('~\x20'+_0x39ce7d['length']+_0xe1423c(0xde))),console['error']('\x20\x20'+a40_0x411928[_0xe1423c(0xba)]('=\x20'+_0x294b78[_0xe1423c(0xd6)]+_0xe1423c(0xc5))),console[_0xe1423c(0xae)](_0xe1423c(0xad)+a40_0x411928[_0xe1423c(0xd4)](_0x449387[_0xe1423c(0xa6)])+'\x0a');if(_0x39ce7d[_0xe1423c(0xd6)]>0x0)for(const _0x2b0317 of _0x39ce7d){console[_0xe1423c(0xae)](_0xe1423c(0xac)+_0x2b0317[_0xe1423c(0xeb)]+'\x27:'),console['error']('─'[_0xe1423c(0xbe)](0x3c)),console[_0xe1423c(0xae)](_0x2b0317[_0xe1423c(0xd8)]),console['error']('─'[_0xe1423c(0xbe)](0x3c));}if(_0x59a484[_0xe1423c(0xb0)])return console[_0xe1423c(0xae)](a40_0x411928[_0xe1423c(0xe3)](_0xe1423c(0xcd))),0x0;if(_0x4840aa[_0xe1423c(0xd6)]===0x0&&_0x39ce7d[_0xe1423c(0xd6)]===0x0)return console[_0xe1423c(0xae)](a40_0x411928[_0xe1423c(0xcf)](_0xe1423c(0xa3))),saveSessionContext({'parent_segment':_0x449387[_0xe1423c(0xe2)]},_0x59a484[_0xe1423c(0xc8)]),console['error'](a40_0x411928[_0xe1423c(0xcf)](_0xe1423c(0xe1)+a40_0x411928[_0xe1423c(0xba)]('parent_segment')+_0xe1423c(0xb9)+a40_0x411928[_0xe1423c(0xd4)](_0x449387[_0xe1423c(0xe2)]))),0x0;if(!_0x59a484['yes']){if(!isInteractive())return console[_0xe1423c(0xae)](a40_0x411928['red']('\x0aError:'),_0xe1423c(0xaf)),console['error'](a40_0x411928[_0xe1423c(0xba)](_0xe1423c(0xa2))),0x1;const _0x2e6940=await confirmKey(_0xe1423c(0xb8)+(_0x4840aa['length']+_0x39ce7d[_0xe1423c(0xd6)])+_0xe1423c(0xe4));if(!_0x2e6940)return console[_0xe1423c(0xae)](a40_0x411928[_0xe1423c(0xe3)](_0xe1423c(0xd2)),'-\x20no\x20files\x20written'),0x1;}for(const _0x2280f3 of _0x449387['files']){if(_0x2280f3['isNew']||_0x2280f3['hasChanges']){const _0x52cd1a=a40_0x1dd15a[_0xe1423c(0xe6)](_0x2280f3['absolutePath']);!existsSync(_0x52cd1a)&&mkdirSync(_0x52cd1a,{'recursive':!![]}),writeFileSync(_0x2280f3[_0xe1423c(0xb4)],_0x2280f3[_0xe1423c(0xcc)],'utf-8');}}return console[_0xe1423c(0xae)](a40_0x411928[_0xe1423c(0xcf)](_0xe1423c(0xdb)+(_0x4840aa[_0xe1423c(0xd6)]+_0x39ce7d[_0xe1423c(0xd6)])+_0xe1423c(0xee)+_0x449387['targetDir'])),saveSessionContext({'parent_segment':_0x449387[_0xe1423c(0xe2)]},_0x59a484[_0xe1423c(0xc8)]),console['error'](a40_0x411928[_0xe1423c(0xcf)](_0xe1423c(0xe1)+a40_0x411928['dim'](_0xe1423c(0xd0))+_0xe1423c(0xb9)+a40_0x411928[_0xe1423c(0xd4)](_0x449387[_0xe1423c(0xe2)]))),0x0;}}
@@ -1 +1 @@
1
- const a41_0x170762=a41_0x2eed;(function(_0x17ad70,_0x4a4666){const _0x3f949e=a41_0x2eed,_0x2ebe0d=_0x17ad70();while(!![]){try{const _0x17d36d=-parseInt(_0x3f949e(0xf4))/0x1*(parseInt(_0x3f949e(0x10e))/0x2)+parseInt(_0x3f949e(0x128))/0x3+parseInt(_0x3f949e(0x10d))/0x4*(parseInt(_0x3f949e(0x142))/0x5)+parseInt(_0x3f949e(0xb4))/0x6*(parseInt(_0x3f949e(0xe3))/0x7)+parseInt(_0x3f949e(0xa9))/0x8+-parseInt(_0x3f949e(0x143))/0x9*(-parseInt(_0x3f949e(0xc0))/0xa)+parseInt(_0x3f949e(0xfb))/0xb*(-parseInt(_0x3f949e(0xb3))/0xc);if(_0x17d36d===_0x4a4666)break;else _0x2ebe0d['push'](_0x2ebe0d['shift']());}catch(_0x28e535){_0x2ebe0d['push'](_0x2ebe0d['shift']());}}}(a41_0x468e,0x68f06));import{BaseCommand}from'./command.js';function a41_0x468e(){const _0x411737=['push','relationships','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','2450095bcYpPi','1187271vlHoqx','journeyId','\x0aPush\x20summary\x20for\x20\x27','/e/','idToName','journeyBundleId','Fetching\x20existing\x20activations...','4817640lXtIVW','endsWith','results','join','filter','listJourneysWithDetailsFromParentSegment','\x20unchanged','listActivations','Push\x20','listSegments','2691012NQHPaV','1428378bSHGXD','\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20','\x20folders\x20to\x20create','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','journeysOnly','Error:\x20Directory\x20not\x20found:\x20','\x20changed','toDelete','Fetching\x20existing\x20data...','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file','changed','connection','20VOTUSZ','Changes\x20to\x20journey:','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','New\x20journey:','versionNumber','Parent\x20segment:\x20','activations','file','unchanged','\x20to\x20delete','\x20deleted','\x20\x20🗺️\x20\x20Journeys:','\x20\x20\x20\x20','/app/ps/','execute','user','\x20\x20Source:\x20','\x20YAML\x20files\x20found','parentSegment','toUpdate','audienceId','created','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','\x20\x20Activations:','\x20new','journeyBundleName','createdSegmentIds','\x20updated','isNew','Error:\x20','segments','\x20to\x20create','new','state','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','7VoproR','description','dryRun','journeys','cwd','\x20to\x20update','type','scopedFolderPath','segment:push','list','createdAt','journey','\x20\x20📊\x20Segments:','folderId','toString','Source\x20directory:\x20','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','1754iQXxRw','site','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','📁\x20','red','get','\x0a✔\x20Push\x20complete','77yYsqKO','Site:\x20','attributes','set','Aborted.','✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','existingSegment','yellow','resolveParentId','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)','length','errorCode','\x20created','nameToId','Delete\x20journey:','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','\x0aError:','/j/da/je','4wAocUN','58gADUFX','\x0aValidation\x20failed:','\x20activations]','name','folders','getOutputSchemaWithCache','helpText','no_parent','\x20\x20Journeys:\x20','\x27...','all','data','error','dim','green','yamlConfig','delete','segmentFolderId','buildUserMaps','cyan','Delete\x20segment:','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','updatedAt','updated','Folders\x20to\x20create:','blue','1368984EEQXlJ','folderPath','verbose','map','targetDir','repeat','then','Resolving\x20parent\x20segment\x20\x27','/sb/da/esr','add','.yaml','(Journey\x20will\x20be\x20deleted)','diff','\x20changes?','Changes\x20to:','parentName','segment','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','toCreate','existingJourney','✔\x20All\x20journeys\x20are\x20up\x20to\x20date','New\x20segment:','segment\x20or\x20journey'];a41_0x468e=function(){return _0x411737;};return a41_0x468e();}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_0xa86921 from'chalk';import{existsSync}from'fs';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{resolveTarget,isSuccessfulResolution,getScopedDetails}from'../sdk/segment/target-resolution.js';import{buildFolderMaps}from'../sdk/segment/resolution-context.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';function a41_0x2eed(_0x1ac48a,_0x4e40e1){_0x1ac48a=_0x1ac48a-0xa4;const _0x468e9f=a41_0x468e();let _0x2eeda8=_0x468e9f[_0x1ac48a];return _0x2eeda8;}import{resolveTDFolderPath,findSegmentsToDelete,findJourneysToDelete,buildSegmentLookupMap,buildSegmentNameToIdMap,buildJourneyBundleLookupMap,parseAndClassifyYamlFiles,validateParsedFiles,formatValidationErrors,extractRootFolderId,buildConnectionMaps,calculatePushStats,prepareSegmentFiles,prepareJourneyFiles,executePushSegments,executePushFolders,executePushSegmentDeletions,executePushJourneys}from'../sdk/segment/push-workflow.js';export class SegmentPushCommand extends BaseCommand{[a41_0x170762(0x111)]=a41_0x170762(0xeb);[a41_0x170762(0xe4)]='Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments';async[a41_0x170762(0xce)](_0x3faa59){const _0x20a92e=a41_0x170762,{options:_0x39ce9b,args:_0x5c9165,tdx:_0x39f2a3}=_0x3faa59,_0x2576a5=_0x39ce9b,_0x1c29f7=await resolveTarget({'arg':_0x5c9165[0x0],'contextParent':_0x39ce9b[_0x20a92e(0xd2)],'cwd':process[_0x20a92e(0xe7)]()});if(!isSuccessfulResolution(_0x1c29f7))return _0x1c29f7[_0x20a92e(0x106)]===_0x20a92e(0x115)?(console[_0x20a92e(0x11a)](a41_0xa86921[_0x20a92e(0x102)](_0x20a92e(0x139))),console[_0x20a92e(0x11a)](_0x20a92e(0x104)),console[_0x20a92e(0x11a)](_0x20a92e(0xf6)),console[_0x20a92e(0x11a)](_0x20a92e(0xbd))):(console[_0x20a92e(0x11a)](a41_0xa86921[_0x20a92e(0xf8)](_0x20a92e(0xdd)+_0x1c29f7['message']+'\x0a')),_0x1c29f7[_0x20a92e(0x114)]&&console['error'](a41_0xa86921['cyan'](_0x1c29f7[_0x20a92e(0x114)]))),0x1;if(_0x1c29f7[_0x20a92e(0xe9)]==='parent_name')return console[_0x20a92e(0x11a)](a41_0xa86921['red'](_0x20a92e(0xb9)+_0x1c29f7[_0x20a92e(0x12c)]+'\x0a')),console[_0x20a92e(0x11a)](a41_0xa86921[_0x20a92e(0x121)](_0x20a92e(0xd6))),0x1;const _0x15a6f6=_0x1c29f7[_0x20a92e(0x137)],_0x50a937=_0x1c29f7[_0x20a92e(0x12c)],_0x129a18=_0x1c29f7[_0x20a92e(0xe9)]===_0x20a92e(0xc7)?_0x1c29f7['filePath']:undefined,_0x2f6244=getScopedDetails(_0x1c29f7),_0x36669d=_0x2f6244?.['isScoped']??![],_0x5d4707=_0x2f6244?.[_0x20a92e(0xea)]??'';if(!existsSync(_0x50a937))return console['error'](a41_0xa86921['red'](_0x20a92e(0xb9)+_0x50a937+'\x0a')),console[_0x20a92e(0x11a)](a41_0xa86921[_0x20a92e(0x121)](_0x20a92e(0xd6))),0x1;_0x2576a5[_0x20a92e(0x12a)]&&(console[_0x20a92e(0x11a)](_0x20a92e(0xfc)+_0x2576a5[_0x20a92e(0xf5)]),console[_0x20a92e(0x11a)](_0x20a92e(0xc5)+_0x15a6f6),console[_0x20a92e(0x11a)](_0x20a92e(0xf2)+_0x50a937),_0x36669d&&console[_0x20a92e(0x11a)]('Scoped\x20to\x20folder:\x20'+_0x5d4707));const _0x596f9e=await withSpinner(_0x20a92e(0x12f)+_0x15a6f6+_0x20a92e(0x117),()=>_0x39f2a3[_0x20a92e(0x138)][_0x20a92e(0x103)](_0x15a6f6),{'verbose':_0x2576a5[_0x20a92e(0x12a)]}),_0x34f929=_0x596f9e['data'],{parentSegmentResult:_0x3ad18a,segmentsResult:_0xe3296d,foldersResult:_0x1a0964,journeysWithDetailsResult:_0x10a5c3,userMaps:_0x2b753f}=await withSpinner(_0x20a92e(0xbc),async()=>{const _0xde39e3=_0x20a92e,[_0x40b907,_0x339163,_0x3899a7,_0x43fbb6,_0xf59843]=await Promise['all']([_0x39f2a3[_0xde39e3(0x138)]['getParent'](_0x34f929),_0x39f2a3[_0xde39e3(0x138)][_0xde39e3(0xb2)](_0x34f929),_0x39f2a3['segment']['listFolders'](_0x34f929),_0x39f2a3['journey'][_0xde39e3(0xae)](_0x34f929,{'includeAllVersions':!![]}),_0x39f2a3[_0xde39e3(0xcf)][_0xde39e3(0x120)]()]);return{'parentSegmentResult':_0x40b907,'segmentsResult':_0x339163,'foldersResult':_0x3899a7,'journeysWithDetailsResult':_0x43fbb6,'userMaps':_0xf59843};},{'verbose':_0x2576a5['verbose']})[_0x20a92e(0x12e)](_0x1ce3d0=>_0x1ce3d0[_0x20a92e(0x119)]),_0x48ec0c=_0x3ad18a,_0x248db2=extractRootFolderId(_0x48ec0c),_0x24213c=_0xe3296d,_0x20c0ba=_0x1a0964,{journeys:_0x30ceb0,activationStepsById:_0x4fc117}=_0x10a5c3,_0x23f5fe=new Map(_0x30ceb0[_0x20a92e(0x12b)](_0x2ee12e=>[_0x2ee12e['id'],_0x2ee12e])),_0x4ab426=_0x30ceb0[_0x20a92e(0x12b)](_0x35f043=>({'id':_0x35f043['id'],'name':_0x35f043[_0x20a92e(0xfd)][_0x20a92e(0x111)],'journeyBundleName':_0x35f043[_0x20a92e(0xfd)][_0x20a92e(0xd9)]||'','journeyBundleId':_0x35f043['attributes'][_0x20a92e(0xa7)]||'','versionNumber':_0x35f043[_0x20a92e(0xfd)][_0x20a92e(0xc4)],'description':_0x35f043[_0x20a92e(0xfd)][_0x20a92e(0xe4)],'state':_0x35f043[_0x20a92e(0xfd)][_0x20a92e(0xe1)],'paused':_0x35f043['attributes']['paused'],'audienceId':_0x35f043[_0x20a92e(0xfd)][_0x20a92e(0xd4)],'folderId':_0x35f043[_0x20a92e(0x140)]?.['parentFolder']?.[_0x20a92e(0x119)]?.['id'],'createdAt':_0x35f043[_0x20a92e(0xfd)][_0x20a92e(0xed)],'updatedAt':_0x35f043[_0x20a92e(0xfd)][_0x20a92e(0x124)]})),{emailToId:_0x3083a7,idToEmail:_0x59e9bd}=_0x2b753f,_0x539783=await withSpinner('Fetching\x20connections\x20for\x20name\x20resolution...',async()=>{const _0x2714a2=_0x20a92e,_0x302b2e=await _0x39f2a3['connection'][_0x2714a2(0xec)]();return buildConnectionMaps(_0x302b2e);},{'verbose':_0x2576a5['verbose']})[_0x20a92e(0x12e)](_0x4010db=>_0x4010db[_0x20a92e(0x119)]),_0x1b6863=_0x539783[_0x20a92e(0x108)],_0xe05861=_0x539783[_0x20a92e(0xa6)],_0x23e937=_0x539783['nameToType'],_0x2313a0={'emailToIdMap':_0x3083a7,'connectionNameToIdMap':_0x1b6863,'connectionNameToTypeMap':_0x23e937,'getSchema':_0x1cbcc0=>_0x39f2a3[_0x20a92e(0xbf)][_0x20a92e(0x113)](_0x1cbcc0)};let {pathToId:_0x2106fd,idToPath:_0x42645e}=buildFolderMaps(_0x20c0ba);const _0x26323a=buildSegmentLookupMap(_0x24213c,_0x42645e),_0xcc8bdc=buildSegmentNameToIdMap(_0x24213c),_0x2ea2d5=buildJourneyBundleLookupMap(_0x4ab426,_0x42645e);let _0x3fa807;if(_0x129a18){if(!_0x129a18['endsWith']('.yml')&&!_0x129a18[_0x20a92e(0xaa)](_0x20a92e(0x132)))return console['error'](a41_0xa86921[_0x20a92e(0xf8)](_0x20a92e(0xf3)+_0x129a18+'\x0a')),0x1;_0x3fa807=[_0x129a18];}else _0x3fa807=findYamlFiles(_0x50a937);if(_0x3fa807[_0x20a92e(0x105)]===0x0)return console[_0x20a92e(0x11a)](a41_0xa86921[_0x20a92e(0xf8)](_0x20a92e(0xe2)+_0x50a937+'\x0a')),console[_0x20a92e(0x11a)](a41_0xa86921[_0x20a92e(0x121)](_0x20a92e(0x141))),0x1;let _0x370788,_0x113645;try{const _0x1e4be1=parseAndClassifyYamlFiles(_0x3fa807,_0x50a937,{'skipSegments':_0x2576a5['journeysOnly']});_0x370788=_0x1e4be1['segments'],_0x113645=_0x1e4be1['journeys'];const _0x50607e=validateParsedFiles(_0x1e4be1,_0x50a937);if(_0x50607e[_0x20a92e(0x105)]>0x0)return console[_0x20a92e(0x11a)](a41_0xa86921[_0x20a92e(0xf8)](_0x20a92e(0x10f))),console['error'](formatValidationErrors(_0x50607e)),console['error'](a41_0xa86921[_0x20a92e(0x102)](_0x20a92e(0xb7))),0x1;}catch(_0x2f8ffc){return console['error'](a41_0xa86921['red']('Error\x20parsing\x20YAML:\x20'+(_0x2f8ffc instanceof Error?_0x2f8ffc['message']:_0x2f8ffc))),0x1;}if(_0x370788[_0x20a92e(0x105)]===0x0&&_0x113645[_0x20a92e(0x105)]===0x0){const _0x59e356=_0x2576a5[_0x20a92e(0xb8)]?_0x20a92e(0xee):_0x20a92e(0x13e);return console[_0x20a92e(0x11a)](a41_0xa86921[_0x20a92e(0x102)]('No\x20'+_0x59e356+_0x20a92e(0xd1))),0x0;}const _0x25a117=new Map();_0x24213c[_0x20a92e(0x105)]>0x0&&!_0x2576a5['journeysOnly']&&await withSpinner(_0x20a92e(0xa8),async()=>{await batchAsync(_0x24213c,async _0x5b2ad6=>{const _0x3adce8=a41_0x2eed,_0x54d73a=await _0x39f2a3[_0x3adce8(0x138)][_0x3adce8(0xb0)](_0x34f929,_0x5b2ad6['id']);_0x25a117[_0x3adce8(0xfe)](_0x5b2ad6['id'],_0x54d73a);});},{'verbose':_0x2576a5['verbose']});const {segmentFiles:_0x498294,foldersToCreate:_0x563a7b}=await prepareSegmentFiles(_0x370788,{'segmentByFolderAndName':_0x26323a,'activationsBySegmentId':_0x25a117,'folderPathToId':_0x2106fd,'idToEmailMap':_0x59e9bd,'connectionIdToNameMap':_0xe05861},_0x2313a0,_0x36669d,_0x5d4707),_0x531c69=_0x129a18?[]:findSegmentsToDelete(_0x24213c,_0x370788['map'](({yamlConfig:_0x372192,folderPath:_0x31eea2})=>({'yamlConfig':_0x372192,'folderPath':resolveTDFolderPath(_0x31eea2,_0x36669d,_0x5d4707)})),_0x42645e,_0x5d4707,_0x36669d),{journeyFiles:_0x536b95,foldersToCreate:_0x20d331}=await withProgressSpinner('Preparing\x20journeys...',async _0x4a7346=>prepareJourneyFiles(_0x113645,{'fetchJourney':async _0x1aeb15=>_0x39f2a3[_0x20a92e(0xee)]['getJourney'](_0x1aeb15['journeyId']),'journeyBundlesByFolderAndName':_0x2ea2d5,'folderPathToId':_0x2106fd,'idToEmailMap':_0x59e9bd,'connectionIdToNameMap':_0xe05861,'existingSegments':_0x24213c,'parentId':_0x34f929,'deps':_0x39f2a3,'progress':{'update':_0x4c3d00=>{const _0x1d6319=_0x20a92e;_0x4a7346['setPhase'](_0x4c3d00),_0x2576a5[_0x1d6319(0x12a)]&&console[_0x1d6319(0x11a)]('\x20\x20'+_0x4c3d00);}},'journeyById':_0x23f5fe,'activationStepsById':_0x4fc117},_0x36669d,_0x5d4707),{'verbose':_0x2576a5['verbose']})['then'](_0x57e10e=>_0x57e10e['data']);for(const _0x5b11f6 of _0x20d331){_0x563a7b[_0x20a92e(0x131)](_0x5b11f6);}const _0x1e3f06=_0x129a18?[]:findJourneysToDelete(_0x4ab426,_0x113645['map'](({yamlConfig:_0x551aca,folderPath:_0xa26c83})=>({'yamlConfig':_0x551aca,'folderPath':resolveTDFolderPath(_0xa26c83,_0x36669d,_0x5d4707)})),_0x42645e,_0x5d4707,_0x36669d),_0x250e6d=calculatePushStats(_0x498294,_0x536b95,_0x563a7b,_0x531c69,_0x1e3f06,!!_0x2576a5[_0x20a92e(0x11e)],!!_0x2576a5[_0x20a92e(0xb8)]),_0x4eb888=_0x250e6d[_0x20a92e(0xde)][_0x20a92e(0xe0)],_0x4f61b8=_0x250e6d[_0x20a92e(0xde)]['changed'],_0x5ac259=_0x250e6d['segments'][_0x20a92e(0xc8)],_0x2ef162=_0x250e6d[_0x20a92e(0xde)][_0x20a92e(0xbb)],_0x3e9013=_0x250e6d[_0x20a92e(0x112)][_0x20a92e(0x13a)],_0x27991c=_0x250e6d['journeys']['new'],_0x41e018=_0x250e6d[_0x20a92e(0xe6)][_0x20a92e(0xbe)],_0x1ff910=_0x250e6d[_0x20a92e(0xe6)][_0x20a92e(0xc8)],_0x219779=_0x250e6d[_0x20a92e(0xe6)]['toDelete'],_0x2d0552=_0x250e6d[_0x20a92e(0xc6)][_0x20a92e(0x118)],_0x421161=_0x250e6d[_0x20a92e(0xc6)][_0x20a92e(0x13a)],_0x4541d4=_0x250e6d[_0x20a92e(0xc6)][_0x20a92e(0xd3)],_0x28eb54=_0x250e6d['activations'][_0x20a92e(0xbb)];console['error'](_0x20a92e(0xa4)+_0x15a6f6+'\x27:');_0x3e9013[_0x20a92e(0x105)]>0x0&&console[_0x20a92e(0x11a)]('\x20\x20'+a41_0xa86921[_0x20a92e(0x127)](_0x20a92e(0xf7)+_0x3e9013[_0x20a92e(0x105)]+_0x20a92e(0xb6)));if(!_0x2576a5['journeysOnly']){console[_0x20a92e(0x11a)](_0x20a92e(0xef)),console['error']('\x20\x20\x20\x20'+a41_0xa86921[_0x20a92e(0x11c)]('+\x20'+_0x4eb888['length']+_0x20a92e(0xd8))),console[_0x20a92e(0x11a)](_0x20a92e(0xcc)+a41_0xa86921[_0x20a92e(0x102)]('~\x20'+_0x4f61b8[_0x20a92e(0x105)]+_0x20a92e(0xba)));if(_0x2ef162['length']>0x0)console[_0x20a92e(0x11a)](_0x20a92e(0xcc)+a41_0xa86921[_0x20a92e(0xf8)]('-\x20'+_0x2ef162[_0x20a92e(0x105)]+'\x20to\x20delete'));else _0x531c69[_0x20a92e(0x105)]>0x0&&!_0x2576a5[_0x20a92e(0x11e)]&&console[_0x20a92e(0x11a)](_0x20a92e(0xcc)+a41_0xa86921[_0x20a92e(0x11b)](_0x531c69[_0x20a92e(0x105)]+_0x20a92e(0x10a)));console[_0x20a92e(0x11a)]('\x20\x20\x20\x20'+a41_0xa86921[_0x20a92e(0x11b)]('=\x20'+_0x5ac259[_0x20a92e(0x105)]+'\x20unchanged'));}if(_0x536b95[_0x20a92e(0x105)]>0x0||_0x1e3f06[_0x20a92e(0x105)]>0x0){console['error'](_0x20a92e(0xcb)),console[_0x20a92e(0x11a)](_0x20a92e(0xcc)+a41_0xa86921[_0x20a92e(0x11c)]('+\x20'+_0x27991c['length']+_0x20a92e(0xd8))),console[_0x20a92e(0x11a)](_0x20a92e(0xcc)+a41_0xa86921[_0x20a92e(0x102)]('~\x20'+_0x41e018[_0x20a92e(0x105)]+_0x20a92e(0xba)));if(_0x219779[_0x20a92e(0x105)]>0x0)console[_0x20a92e(0x11a)](_0x20a92e(0xcc)+a41_0xa86921[_0x20a92e(0xf8)]('-\x20'+_0x219779[_0x20a92e(0x105)]+_0x20a92e(0xc9)));else _0x1e3f06[_0x20a92e(0x105)]>0x0&&!_0x2576a5[_0x20a92e(0x11e)]&&console[_0x20a92e(0x11a)]('\x20\x20\x20\x20'+a41_0xa86921[_0x20a92e(0x11b)](_0x1e3f06['length']+_0x20a92e(0x10a)));console[_0x20a92e(0x11a)](_0x20a92e(0xcc)+a41_0xa86921[_0x20a92e(0x11b)]('=\x20'+_0x1ff910[_0x20a92e(0x105)]+_0x20a92e(0xaf)));}_0x2d0552['length']>0x0&&!_0x2576a5[_0x20a92e(0xb8)]&&(console['error'](''),console[_0x20a92e(0x11a)](_0x20a92e(0xd7)),_0x421161[_0x20a92e(0x105)]>0x0&&console['error'](_0x20a92e(0xcc)+a41_0xa86921['green']('+\x20'+_0x421161[_0x20a92e(0x105)]+_0x20a92e(0xdf))),_0x4541d4['length']>0x0&&console[_0x20a92e(0x11a)]('\x20\x20\x20\x20'+a41_0xa86921[_0x20a92e(0x102)]('~\x20'+_0x4541d4['length']+_0x20a92e(0xe8))),_0x28eb54['length']>0x0&&console[_0x20a92e(0x11a)](_0x20a92e(0xcc)+a41_0xa86921['red']('-\x20'+_0x28eb54['length']+_0x20a92e(0xc9))));console[_0x20a92e(0x11a)](_0x20a92e(0xd0)+a41_0xa86921['cyan'](_0x50a937)+'\x0a');if(_0x3e9013[_0x20a92e(0x105)]>0x0){console[_0x20a92e(0x11a)](_0x20a92e(0x126));for(const _0x2763b0 of _0x3e9013){console[_0x20a92e(0x11a)]('\x20\x20'+a41_0xa86921['blue']('+')+'\x20'+_0x2763b0);}console[_0x20a92e(0x11a)]('');}if(_0x4eb888['length']>0x0&&!_0x2576a5['journeysOnly'])for(const _0x4553b6 of _0x4eb888){const _0x89ce2c=_0x4553b6[_0x20a92e(0x129)]?_0x4553b6[_0x20a92e(0x129)]+'/'+_0x4553b6[_0x20a92e(0x11d)][_0x20a92e(0x111)]:_0x4553b6[_0x20a92e(0x11d)][_0x20a92e(0x111)],_0x46e979=_0x4553b6[_0x20a92e(0x11d)][_0x20a92e(0xc6)]?.[_0x20a92e(0x105)]||0x0,_0x140bbf=_0x46e979>0x0?a41_0xa86921['dim']('\x20['+_0x46e979+_0x20a92e(0x110)):'';console['error']('\x0a'+a41_0xa86921['green'](_0x20a92e(0x13d))+'\x20'+_0x89ce2c+_0x140bbf),console[_0x20a92e(0x11a)]('─'[_0x20a92e(0x12d)](0x3c)),_0x4553b6[_0x20a92e(0x134)]&&console['error'](_0x4553b6[_0x20a92e(0x134)]),console[_0x20a92e(0x11a)]('─'[_0x20a92e(0x12d)](0x3c));}if(_0x2ef162[_0x20a92e(0x105)]>0x0&&!_0x2576a5[_0x20a92e(0xb8)])for(const _0x50f483 of _0x2ef162){const _0x3d301e=_0x50f483['segmentFolderId']?_0x42645e[_0x20a92e(0xf9)](_0x50f483[_0x20a92e(0x11f)][_0x20a92e(0xf1)]())||'':'',_0x5077e8=_0x3d301e?_0x3d301e+'/'+_0x50f483[_0x20a92e(0x111)]:_0x50f483[_0x20a92e(0x111)],_0x173f81=_0x25a117[_0x20a92e(0xf9)](_0x50f483['id'])||[],_0x3931cb=_0x173f81[_0x20a92e(0x105)]>0x0?a41_0xa86921[_0x20a92e(0x11b)]('\x20['+_0x173f81[_0x20a92e(0x105)]+_0x20a92e(0x110)):'';console[_0x20a92e(0x11a)]('\x0a'+a41_0xa86921[_0x20a92e(0xf8)](_0x20a92e(0x122))+'\x20'+_0x5077e8+_0x3931cb),console[_0x20a92e(0x11a)]('─'['repeat'](0x3c));const _0x34544c=segmentWithActivationsToYaml(_0x50f483,_0x173f81,undefined,_0x59e9bd,_0xe05861),_0x598b51=segmentToYamlString(_0x34544c),_0x2870c7=generateDiff(_0x598b51,'');console[_0x20a92e(0x11a)](formatDiffWithColors(_0x2870c7)),console['error']('─'['repeat'](0x3c));}const _0x3360d3=_0x498294['filter'](_0x2270ae=>!_0x2270ae[_0x20a92e(0xdc)]&&_0x2270ae[_0x20a92e(0x134)]);if(_0x3360d3[_0x20a92e(0x105)]>0x0&&!_0x2576a5['journeysOnly'])for(const _0x95fc22 of _0x3360d3){const _0x289b7c=_0x95fc22[_0x20a92e(0x129)]?_0x95fc22[_0x20a92e(0x129)]+'/'+_0x95fc22[_0x20a92e(0x11d)]['name']:_0x95fc22[_0x20a92e(0x11d)]['name'];console[_0x20a92e(0x11a)]('\x0a'+a41_0xa86921['yellow'](_0x20a92e(0x136))+'\x20'+_0x289b7c),console['error']('─'['repeat'](0x3c)),console[_0x20a92e(0x11a)](_0x95fc22['diff']),console[_0x20a92e(0x11a)]('─'[_0x20a92e(0x12d)](0x3c));}if(_0x27991c[_0x20a92e(0x105)]>0x0)for(const _0xdae3e6 of _0x27991c){const _0x2b07d9=_0xdae3e6[_0x20a92e(0x129)]?_0xdae3e6[_0x20a92e(0x129)]+'/'+_0xdae3e6[_0x20a92e(0x11d)][_0x20a92e(0x111)]:_0xdae3e6[_0x20a92e(0x11d)][_0x20a92e(0x111)];console[_0x20a92e(0x11a)]('\x0a'+a41_0xa86921[_0x20a92e(0x11c)](_0x20a92e(0xc3))+'\x20'+_0x2b07d9),console[_0x20a92e(0x11a)]('─'[_0x20a92e(0x12d)](0x3c)),_0xdae3e6['diff']&&console['error'](_0xdae3e6[_0x20a92e(0x134)]),console[_0x20a92e(0x11a)]('─'[_0x20a92e(0x12d)](0x3c));}const _0x323283=_0x536b95[_0x20a92e(0xad)](_0x5bd983=>!_0x5bd983[_0x20a92e(0xdc)]&&_0x5bd983['diff']);if(_0x323283[_0x20a92e(0x105)]>0x0)for(const _0x4e9dcd of _0x323283){const _0x94d0cf=_0x4e9dcd[_0x20a92e(0x129)]?_0x4e9dcd[_0x20a92e(0x129)]+'/'+_0x4e9dcd['yamlConfig'][_0x20a92e(0x111)]:_0x4e9dcd[_0x20a92e(0x11d)][_0x20a92e(0x111)];console[_0x20a92e(0x11a)]('\x0a'+a41_0xa86921[_0x20a92e(0x102)](_0x20a92e(0xc1))+'\x20'+_0x94d0cf),console[_0x20a92e(0x11a)]('─'[_0x20a92e(0x12d)](0x3c)),console[_0x20a92e(0x11a)](_0x4e9dcd[_0x20a92e(0x134)]),console['error']('─'[_0x20a92e(0x12d)](0x3c));}if(_0x219779[_0x20a92e(0x105)]>0x0)for(const _0x4c93dc of _0x219779){const _0x5ba159=_0x4c93dc[_0x20a92e(0xf0)]?_0x42645e[_0x20a92e(0xf9)](_0x4c93dc[_0x20a92e(0xf0)])||'':'',_0x3c2c56=_0x5ba159?_0x5ba159+'/'+_0x4c93dc[_0x20a92e(0xd9)]:_0x4c93dc[_0x20a92e(0xd9)];console[_0x20a92e(0x11a)]('\x0a'+a41_0xa86921[_0x20a92e(0xf8)](_0x20a92e(0x109))+'\x20'+_0x3c2c56),console[_0x20a92e(0x11a)]('─'[_0x20a92e(0x12d)](0x3c)),console[_0x20a92e(0x11a)](a41_0xa86921[_0x20a92e(0xf8)](_0x20a92e(0x133))),console[_0x20a92e(0x11a)]('─'[_0x20a92e(0x12d)](0x3c));}if(_0x2576a5[_0x20a92e(0xe5)])return console[_0x20a92e(0x11a)](a41_0xa86921[_0x20a92e(0x102)]('\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made')),0x0;const _0x37ea67=_0x2576a5[_0x20a92e(0xb8)]?![]:_0x4eb888[_0x20a92e(0x105)]>0x0||_0x4f61b8[_0x20a92e(0x105)]>0x0||_0x2ef162[_0x20a92e(0x105)]>0x0,_0x51b26b=_0x27991c['length']>0x0||_0x41e018[_0x20a92e(0x105)]>0x0||_0x219779[_0x20a92e(0x105)]>0x0,_0x5c383b=_0x2576a5['journeysOnly']?![]:_0x2d0552['length']>0x0,_0x2d17c7=_0x3e9013['length']>0x0;if(!_0x37ea67&&!_0x51b26b&&!_0x5c383b&&!_0x2d17c7){const _0x200c71=_0x2576a5[_0x20a92e(0xb8)]?_0x20a92e(0x13c):_0x20a92e(0x100);console[_0x20a92e(0x11a)](a41_0xa86921[_0x20a92e(0x11c)](_0x200c71));if(_0x129a18&&_0x5ac259[_0x20a92e(0x105)]===0x1){const _0x4b9e62=_0x5ac259[0x0];if(_0x4b9e62[_0x20a92e(0x101)]?.['id']){const _0x43dbb0=getConsoleNextUrl(_0x2576a5['site'],_0x20a92e(0xcd)+_0x34f929+'/e/'+_0x4b9e62['existingSegment']['id']+_0x20a92e(0x130));console[_0x20a92e(0x11a)]('\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20'+a41_0xa86921['cyan'](_0x43dbb0));}}if(_0x129a18&&_0x1ff910[_0x20a92e(0x105)]===0x1){const _0x59e499=_0x1ff910[0x0];if(_0x59e499['existingJourney']?.['id']){const _0x2b1caa=getConsoleNextUrl(_0x2576a5[_0x20a92e(0xf5)],_0x20a92e(0xcd)+_0x34f929+_0x20a92e(0xa5)+_0x59e499[_0x20a92e(0x13b)]['id']+_0x20a92e(0x10c));console[_0x20a92e(0x11a)]('\x20\x20'+a41_0xa86921[_0x20a92e(0x121)](_0x2b1caa));}}return 0x0;}const _0x43c25f=_0x2576a5[_0x20a92e(0xb8)]?_0x27991c[_0x20a92e(0x105)]+_0x41e018[_0x20a92e(0x105)]+_0x219779['length']+_0x3e9013['length']:_0x4eb888[_0x20a92e(0x105)]+_0x4f61b8[_0x20a92e(0x105)]+_0x2ef162['length']+_0x27991c[_0x20a92e(0x105)]+_0x41e018[_0x20a92e(0x105)]+_0x219779['length']+_0x3e9013[_0x20a92e(0x105)]+_0x2d0552[_0x20a92e(0x105)];if(!_0x2576a5['yes']&&_0x43c25f>0x0){if(!isInteractive())return console['error'](a41_0xa86921['red'](_0x20a92e(0x10b)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x20a92e(0x11a)](a41_0xa86921[_0x20a92e(0x11b)](_0x20a92e(0x123))),0x1;const _0x163781=await confirmKey(_0x20a92e(0xb1)+_0x43c25f+_0x20a92e(0x135));if(!_0x163781)return console[_0x20a92e(0x11a)](a41_0xa86921[_0x20a92e(0x102)](_0x20a92e(0xff))),0x1;}const _0x3042a1={'withProgress':async(_0x575414,_0x104579)=>{const _0x3a7a0d=_0x20a92e,_0x4ad2c9=await withSpinner(_0x575414,_0x104579,{'verbose':_0x2576a5[_0x3a7a0d(0x12a)]});return{'data':_0x4ad2c9[_0x3a7a0d(0x119)]};},'logInfo':_0x198a3e=>console[_0x20a92e(0x11a)](a41_0xa86921['blue']('✔\x20'+_0x198a3e)),'logSuccess':_0x2434e0=>console[_0x20a92e(0x11a)](a41_0xa86921[_0x20a92e(0x11c)]('✔\x20'+_0x2434e0)),'logWarning':_0x41be2c=>console[_0x20a92e(0x11a)](a41_0xa86921[_0x20a92e(0x102)]('⚠\x20'+_0x41be2c)),'logDeleted':_0x40d52e=>console['error'](a41_0xa86921[_0x20a92e(0xf8)]('✔\x20'+_0x40d52e))},_0x2b2946={'segment':_0x39f2a3[_0x20a92e(0x138)],'journey':_0x39f2a3[_0x20a92e(0xee)],'user':_0x39f2a3[_0x20a92e(0xcf)],'connection':_0x39f2a3[_0x20a92e(0xbf)]};_0x3e9013['length']>0x0&&(_0x2106fd=await executePushFolders(_0x2b2946,_0x3e9013,_0x2106fd,{'parentId':_0x34f929},_0x3042a1));const _0xc8ad08={'rootFolderId':_0x248db2,'folderPathToId':_0x2106fd,'folderIdToPath':_0x42645e,'segmentNameToId':_0xcc8bdc,'activationsBySegmentId':_0x25a117,'emailToIdMap':_0x3083a7,'idToEmailMap':_0x59e9bd,'connectionNameToIdMap':_0x539783['nameToId'],'connectionIdToNameMap':_0x539783[_0x20a92e(0xa6)],'connectionNameToTypeMap':_0x23e937},_0x350293=await executePushSegments(_0x2b2946,_0x2576a5[_0x20a92e(0xb8)]?[]:_0x498294,_0xc8ad08,{'parentId':_0x34f929},_0x3042a1),_0x2223ab=_0x350293[_0x20a92e(0xd5)],_0x144669=_0x350293[_0x20a92e(0x125)],_0x486754=_0x350293['activations'][_0x20a92e(0xd5)],_0x13497a=_0x350293[_0x20a92e(0xc6)][_0x20a92e(0x125)],_0x417f33=_0x350293[_0x20a92e(0xc6)]['deleted'];let _0x57ea65;if(_0x129a18&&_0x498294[_0x20a92e(0x105)]===0x1){const _0x4b4bce=_0x498294[0x0];_0x57ea65=_0x4b4bce[_0x20a92e(0x101)]?.['id']??_0x350293['createdSegmentIds'][_0x20a92e(0xf9)](_0x4b4bce['yamlConfig'][_0x20a92e(0x111)]);}const _0x144df3=await executePushSegmentDeletions(_0x2b2946,_0x2576a5[_0x20a92e(0xb8)]?[]:_0x2ef162,_0x3042a1);let _0xa060cb=0x0,_0x5ec5a5=0x0,_0x552882=0x0;const _0x5da5e2=new Map(_0xcc8bdc);for(const [_0x4d61be,_0x401fcc]of _0x350293[_0x20a92e(0xda)]){_0x5da5e2[_0x20a92e(0xfe)](_0x4d61be,_0x401fcc);}if(_0x536b95['length']>0x0){const _0x19ff28={..._0xc8ad08,'segmentNameToId':_0x5da5e2,'existingSegments':_0x24213c,'activationContext':_0x2313a0},_0x23c2d0=await executePushJourneys(_0x2b2946,_0x536b95,_0x19ff28,{'parentId':_0x34f929,'rootFolderId':_0x248db2,'verbose':_0x2576a5[_0x20a92e(0x12a)]},_0x3042a1);_0xa060cb=_0x23c2d0['created'],_0x5ec5a5=_0x23c2d0[_0x20a92e(0x125)];if(_0x129a18&&_0x23c2d0[_0x20a92e(0xab)][_0x20a92e(0x105)]===0x1){const _0x40e500=_0x23c2d0[_0x20a92e(0xab)][0x0];if(_0x40e500[_0x20a92e(0x144)]){const _0x2f6dce=getConsoleNextUrl(_0x2576a5[_0x20a92e(0xf5)],_0x20a92e(0xcd)+_0x34f929+'/e/'+_0x40e500[_0x20a92e(0x144)]+_0x20a92e(0x10c));console[_0x20a92e(0x11a)]('\x20\x20'+a41_0xa86921[_0x20a92e(0x121)](_0x2f6dce));}}}for(const _0x2d8284 of _0x219779){console['error'](a41_0xa86921[_0x20a92e(0x102)](_0x20a92e(0xc2)+_0x2d8284[_0x20a92e(0xd9)])),_0x552882++;}const _0x31ec9a=[];if(_0x2223ab>0x0)_0x31ec9a[_0x20a92e(0x13f)](_0x2223ab+_0x20a92e(0x107));if(_0x144669>0x0)_0x31ec9a[_0x20a92e(0x13f)](_0x144669+_0x20a92e(0xdb));if(_0x144df3>0x0)_0x31ec9a[_0x20a92e(0x13f)](_0x144df3+'\x20deleted');const _0x3c8a43=[];if(_0xa060cb>0x0)_0x3c8a43[_0x20a92e(0x13f)](_0xa060cb+_0x20a92e(0x107));if(_0x5ec5a5>0x0)_0x3c8a43[_0x20a92e(0x13f)](_0x5ec5a5+'\x20updated');if(_0x552882>0x0)_0x3c8a43['push'](_0x552882+_0x20a92e(0xca));const _0x5b94d=[];if(_0x486754>0x0)_0x5b94d[_0x20a92e(0x13f)](_0x486754+_0x20a92e(0x107));if(_0x13497a>0x0)_0x5b94d[_0x20a92e(0x13f)](_0x13497a+'\x20updated');if(_0x417f33>0x0)_0x5b94d[_0x20a92e(0x13f)](_0x417f33+_0x20a92e(0xca));console['error'](a41_0xa86921[_0x20a92e(0x11c)](_0x20a92e(0xfa)));_0x31ec9a[_0x20a92e(0x105)]>0x0&&!_0x2576a5['journeysOnly']&&console[_0x20a92e(0x11a)]('\x20\x20Segments:\x20'+_0x31ec9a[_0x20a92e(0xac)](',\x20'));_0x3c8a43[_0x20a92e(0x105)]>0x0&&console['error'](_0x20a92e(0x116)+_0x3c8a43['join'](',\x20'));_0x5b94d[_0x20a92e(0x105)]>0x0&&!_0x2576a5[_0x20a92e(0xb8)]&&console[_0x20a92e(0x11a)]('\x20\x20Activations:\x20'+_0x5b94d[_0x20a92e(0xac)](',\x20'));if(_0x57ea65){const _0x1bfff0=getConsoleNextUrl(_0x2576a5[_0x20a92e(0xf5)],_0x20a92e(0xcd)+_0x34f929+_0x20a92e(0xa5)+_0x57ea65+_0x20a92e(0x130));console[_0x20a92e(0x11a)](_0x20a92e(0xb5)+a41_0xa86921[_0x20a92e(0x121)](_0x1bfff0));}return 0x0;}}
1
+ const a41_0x2113d0=a41_0x1bb7;(function(_0x2227ac,_0x161aef){const _0xda5a38=a41_0x1bb7,_0x136377=_0x2227ac();while(!![]){try{const _0x518df9=-parseInt(_0xda5a38(0x210))/0x1+parseInt(_0xda5a38(0x1a3))/0x2+-parseInt(_0xda5a38(0x1c2))/0x3+-parseInt(_0xda5a38(0x1f0))/0x4+parseInt(_0xda5a38(0x230))/0x5+parseInt(_0xda5a38(0x202))/0x6+parseInt(_0xda5a38(0x1ba))/0x7*(parseInt(_0xda5a38(0x22b))/0x8);if(_0x518df9===_0x161aef)break;else _0x136377['push'](_0x136377['shift']());}catch(_0x2d65ca){_0x136377['push'](_0x136377['shift']());}}}(a41_0x55c1,0x87d6a));import{BaseCommand}from'./command.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{generateDiff,formatDiffWithColors}from'../utils/diff.js';function a41_0x1bb7(_0x3b7cc1,_0x5a83ec){_0x3b7cc1=_0x3b7cc1-0x19c;const _0x55c1e6=a41_0x55c1();let _0x1bb742=_0x55c1e6[_0x3b7cc1];return _0x1bb742;}import{confirmKey,isInteractive}from'../utils/prompt.js';function a41_0x55c1(){const _0x601eb5=['\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20','repeat','yamlConfig','green','\x20\x20Journeys:\x20','Site:\x20','.yaml','createdSegmentIds','diff','helpText','journeysOnly','results','description','state','/e/','verbose','\x0aError:','\x20updated','parentSegment','\x20\x20Activations:\x20','name','connection','existingSegment','2707368uEviNT','buildUserMaps','✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','segmentFolderId','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','Error:\x20','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','parentFolder','targetDir','getOutputSchemaWithCache','user','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','yellow','journeyBundleName','Parent\x20segment:\x20','blue','\x20YAML\x20files\x20found','journeys','41958hGzIpx','\x20\x20Activations:','/sb/da/esr','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','getJourney','segments','errorCode','\x20\x20📊\x20Segments:','add','new','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','scopedFolderPath','\x20new','732371TJhmwY','updated','folderPath','listFolders','folders','Delete\x20segment:','relationships','endsWith','Scoped\x20to\x20folder:\x20','activations','changed','yes','length','Preparing\x20journeys...','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','isScoped','Fetching\x20connections\x20for\x20name\x20resolution...','Resolving\x20parent\x20segment\x20\x27','\x20deleted','journey','set','attributes','\x20created','folderId','dim','toString','journeyId','8rZVKXc','site','listSegments','data','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','1307505HlpQJi','Push\x20','cwd','no_parent','push','\x20\x20🗺️\x20\x20Journeys:','(Journey\x20will\x20be\x20deleted)','execute','map','\x20to\x20delete','nameToType','dryRun','\x20unchanged','Error\x20parsing\x20YAML:\x20','627728vGsWGt','\x20activations]','get','\x20changed','Delete\x20journey:','/app/ps/','file','Error:\x20Directory\x20not\x20found:\x20','Source\x20directory:\x20','segment','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','delete','resolveParentId','error','unchanged','then','created','✔\x20All\x20journeys\x20are\x20up\x20to\x20date','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','parentName','No\x20','toUpdate','idToName','17100377ugOvxQ','all','isNew','📁\x20','\x20\x20Segments:\x20','/j/da/je','createdAt','\x20to\x20update','3178986oLoDJw','listActivations','versionNumber','.yml','\x20\x20\x20\x20','nameToId','filter','toDelete','cyan','\x0aValidation\x20failed:','type','journeyBundleId','existingJourney','red','New\x20segment:','\x20\x20Source:\x20','toCreate','Changes\x20to:','\x0aPush\x20summary\x20for\x20\x27','setPhase','join','message','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)'];a41_0x55c1=function(){return _0x601eb5;};return a41_0x55c1();}import{batchAsync}from'../utils/async.js';import{segmentToYamlString,segmentWithActivationsToYaml}from'../sdk/segment/child-segment-yaml.js';import a41_0x3c0870 from'chalk';import{existsSync}from'fs';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{resolveTarget,isSuccessfulResolution,getScopedDetails}from'../sdk/segment/target-resolution.js';import{buildFolderMaps}from'../sdk/segment/resolution-context.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{resolveTDFolderPath,findSegmentsToDelete,findJourneysToDelete,buildSegmentLookupMap,buildSegmentNameToIdMap,buildJourneyBundleLookupMap,parseAndClassifyYamlFiles,validateParsedFiles,formatValidationErrors,extractRootFolderId,buildConnectionMaps,calculatePushStats,prepareSegmentFiles,prepareJourneyFiles,executePushSegments,executePushFolders,executePushSegmentDeletions,executePushJourneys}from'../sdk/segment/push-workflow.js';export class SegmentPushCommand extends BaseCommand{[a41_0x2113d0(0x1ed)]='segment:push';['description']=a41_0x2113d0(0x206);async[a41_0x2113d0(0x19c)](_0x2b4381){const _0x2fdcdd=a41_0x2113d0,{options:_0x3e303f,args:_0x3eee6c,tdx:_0xde47f9}=_0x2b4381,_0x4568ee=_0x3e303f,_0xe26f9c=await resolveTarget({'arg':_0x3eee6c[0x0],'contextParent':_0x3e303f[_0x2fdcdd(0x1eb)],'cwd':process[_0x2fdcdd(0x232)]()});if(!isSuccessfulResolution(_0xe26f9c))return _0xe26f9c[_0x2fdcdd(0x209)]===_0x2fdcdd(0x233)?(console[_0x2fdcdd(0x1b0)](a41_0x3c0870[_0x2fdcdd(0x1fc)]('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console[_0x2fdcdd(0x1b0)](_0x2fdcdd(0x1d8)),console[_0x2fdcdd(0x1b0)](_0x2fdcdd(0x205)),console[_0x2fdcdd(0x1b0)]('\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[_0x2fdcdd(0x1b0)](a41_0x3c0870[_0x2fdcdd(0x1cf)](_0x2fdcdd(0x1f5)+_0xe26f9c[_0x2fdcdd(0x1d7)]+'\x0a')),_0xe26f9c[_0x2fdcdd(0x1e2)]&&console['error'](a41_0x3c0870[_0x2fdcdd(0x1ca)](_0xe26f9c[_0x2fdcdd(0x1e2)]))),0x1;if(_0xe26f9c['type']==='parent_name')return console[_0x2fdcdd(0x1b0)](a41_0x3c0870[_0x2fdcdd(0x1cf)](_0x2fdcdd(0x1aa)+_0xe26f9c[_0x2fdcdd(0x1f8)]+'\x0a')),console[_0x2fdcdd(0x1b0)](a41_0x3c0870[_0x2fdcdd(0x1ca)]('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;const _0x3e427d=_0xe26f9c[_0x2fdcdd(0x1b6)],_0x181a8c=_0xe26f9c[_0x2fdcdd(0x1f8)],_0x52a5bc=_0xe26f9c[_0x2fdcdd(0x1cc)]===_0x2fdcdd(0x1a9)?_0xe26f9c['filePath']:undefined,_0x52067b=getScopedDetails(_0xe26f9c),_0x36ab31=_0x52067b?.[_0x2fdcdd(0x21f)]??![],_0x4aabb7=_0x52067b?.[_0x2fdcdd(0x20e)]??'';if(!existsSync(_0x181a8c))return console[_0x2fdcdd(0x1b0)](a41_0x3c0870['red'](_0x2fdcdd(0x1aa)+_0x181a8c+'\x0a')),console[_0x2fdcdd(0x1b0)](a41_0x3c0870[_0x2fdcdd(0x1ca)](_0x2fdcdd(0x1f4))),0x1;_0x4568ee['verbose']&&(console[_0x2fdcdd(0x1b0)](_0x2fdcdd(0x1de)+_0x4568ee[_0x2fdcdd(0x22c)]),console['error'](_0x2fdcdd(0x1fe)+_0x3e427d),console[_0x2fdcdd(0x1b0)](_0x2fdcdd(0x1ab)+_0x181a8c),_0x36ab31&&console[_0x2fdcdd(0x1b0)](_0x2fdcdd(0x218)+_0x4aabb7));const _0x3eacfe=await withSpinner(_0x2fdcdd(0x221)+_0x3e427d+'\x27...',()=>_0xde47f9[_0x2fdcdd(0x1ac)][_0x2fdcdd(0x1af)](_0x3e427d),{'verbose':_0x4568ee['verbose']}),_0x2d0d43=_0x3eacfe[_0x2fdcdd(0x22e)],{parentSegmentResult:_0x257650,segmentsResult:_0x53019e,foldersResult:_0x349822,journeysWithDetailsResult:_0x26524,userMaps:_0x17085c}=await withSpinner('Fetching\x20existing\x20data...',async()=>{const _0x4dd7e2=_0x2fdcdd,[_0x55d698,_0x30484c,_0x420a1b,_0x136aae,_0x50ff8c]=await Promise[_0x4dd7e2(0x1bb)]([_0xde47f9[_0x4dd7e2(0x1ac)]['getParent'](_0x2d0d43),_0xde47f9['segment'][_0x4dd7e2(0x22d)](_0x2d0d43),_0xde47f9[_0x4dd7e2(0x1ac)][_0x4dd7e2(0x213)](_0x2d0d43),_0xde47f9[_0x4dd7e2(0x223)]['listJourneysWithDetailsFromParentSegment'](_0x2d0d43,{'includeAllVersions':!![]}),_0xde47f9[_0x4dd7e2(0x1fa)][_0x4dd7e2(0x1f1)]()]);return{'parentSegmentResult':_0x55d698,'segmentsResult':_0x30484c,'foldersResult':_0x420a1b,'journeysWithDetailsResult':_0x136aae,'userMaps':_0x50ff8c};},{'verbose':_0x4568ee['verbose']})[_0x2fdcdd(0x1b2)](_0x3e222f=>_0x3e222f[_0x2fdcdd(0x22e)]),_0x4c0350=_0x257650,_0x5aa42b=extractRootFolderId(_0x4c0350),_0x3d0f9b=_0x53019e,_0x41a058=_0x349822,{journeys:_0x2b036f,activationStepsById:_0x43ce93}=_0x26524,_0x4b9cb4=new Map(_0x2b036f[_0x2fdcdd(0x19d)](_0x165abc=>[_0x165abc['id'],_0x165abc])),_0x425332=_0x2b036f['map'](_0x3c1f47=>({'id':_0x3c1f47['id'],'name':_0x3c1f47['attributes']['name'],'journeyBundleName':_0x3c1f47[_0x2fdcdd(0x225)]['journeyBundleName']||'','journeyBundleId':_0x3c1f47['attributes'][_0x2fdcdd(0x1cd)]||'','versionNumber':_0x3c1f47[_0x2fdcdd(0x225)][_0x2fdcdd(0x1c4)],'description':_0x3c1f47[_0x2fdcdd(0x225)][_0x2fdcdd(0x1e5)],'state':_0x3c1f47['attributes'][_0x2fdcdd(0x1e6)],'paused':_0x3c1f47['attributes']['paused'],'audienceId':_0x3c1f47[_0x2fdcdd(0x225)]['audienceId'],'folderId':_0x3c1f47[_0x2fdcdd(0x216)]?.[_0x2fdcdd(0x1f7)]?.['data']?.['id'],'createdAt':_0x3c1f47['attributes'][_0x2fdcdd(0x1c0)],'updatedAt':_0x3c1f47[_0x2fdcdd(0x225)]['updatedAt']})),{emailToId:_0x227d47,idToEmail:_0x30578d}=_0x17085c,_0xc669c2=await withSpinner(_0x2fdcdd(0x220),async()=>{const _0x39f3fb=_0x2fdcdd,_0x4c240d=await _0xde47f9[_0x39f3fb(0x1ee)]['list']();return buildConnectionMaps(_0x4c240d);},{'verbose':_0x4568ee[_0x2fdcdd(0x1e8)]})[_0x2fdcdd(0x1b2)](_0x39fb5e=>_0x39fb5e[_0x2fdcdd(0x22e)]),_0x35d378=_0xc669c2[_0x2fdcdd(0x1c7)],_0x2a32b4=_0xc669c2[_0x2fdcdd(0x1b9)],_0x2d141b=_0xc669c2[_0x2fdcdd(0x19f)],_0x463033={'emailToIdMap':_0x227d47,'connectionNameToIdMap':_0x35d378,'connectionNameToTypeMap':_0x2d141b,'getSchema':_0x2398d9=>_0xde47f9['connection'][_0x2fdcdd(0x1f9)](_0x2398d9)};let {pathToId:_0x100ada,idToPath:_0x1a277}=buildFolderMaps(_0x41a058);const _0x3d340c=buildSegmentLookupMap(_0x3d0f9b,_0x1a277),_0x536a8d=buildSegmentNameToIdMap(_0x3d0f9b),_0xa895b0=buildJourneyBundleLookupMap(_0x425332,_0x1a277);let _0x31fa72;if(_0x52a5bc){if(!_0x52a5bc[_0x2fdcdd(0x217)](_0x2fdcdd(0x1c5))&&!_0x52a5bc[_0x2fdcdd(0x217)](_0x2fdcdd(0x1df)))return console[_0x2fdcdd(0x1b0)](a41_0x3c0870[_0x2fdcdd(0x1cf)](_0x2fdcdd(0x21e)+_0x52a5bc+'\x0a')),0x1;_0x31fa72=[_0x52a5bc];}else _0x31fa72=findYamlFiles(_0x181a8c);if(_0x31fa72[_0x2fdcdd(0x21c)]===0x0)return console[_0x2fdcdd(0x1b0)](a41_0x3c0870[_0x2fdcdd(0x1cf)]('Error:\x20No\x20YAML\x20files\x20found\x20in\x20'+_0x181a8c+'\x0a')),console['error'](a41_0x3c0870[_0x2fdcdd(0x1ca)](_0x2fdcdd(0x22f))),0x1;let _0x565687,_0x2866bb;try{const _0x5a7256=parseAndClassifyYamlFiles(_0x31fa72,_0x181a8c,{'skipSegments':_0x4568ee[_0x2fdcdd(0x1e3)]});_0x565687=_0x5a7256[_0x2fdcdd(0x208)],_0x2866bb=_0x5a7256[_0x2fdcdd(0x201)];const _0x1f9d3e=validateParsedFiles(_0x5a7256,_0x181a8c);if(_0x1f9d3e[_0x2fdcdd(0x21c)]>0x0)return console[_0x2fdcdd(0x1b0)](a41_0x3c0870[_0x2fdcdd(0x1cf)](_0x2fdcdd(0x1cb))),console[_0x2fdcdd(0x1b0)](formatValidationErrors(_0x1f9d3e)),console[_0x2fdcdd(0x1b0)](a41_0x3c0870[_0x2fdcdd(0x1fc)](_0x2fdcdd(0x20d))),0x1;}catch(_0x548873){return console['error'](a41_0x3c0870['red'](_0x2fdcdd(0x1a2)+(_0x548873 instanceof Error?_0x548873[_0x2fdcdd(0x1d7)]:_0x548873))),0x1;}if(_0x565687[_0x2fdcdd(0x21c)]===0x0&&_0x2866bb[_0x2fdcdd(0x21c)]===0x0){const _0x2d342b=_0x4568ee[_0x2fdcdd(0x1e3)]?_0x2fdcdd(0x223):'segment\x20or\x20journey';return console[_0x2fdcdd(0x1b0)](a41_0x3c0870[_0x2fdcdd(0x1fc)](_0x2fdcdd(0x1b7)+_0x2d342b+_0x2fdcdd(0x200))),0x0;}const _0xbe184f=new Map();_0x3d0f9b['length']>0x0&&!_0x4568ee[_0x2fdcdd(0x1e3)]&&await withSpinner('Fetching\x20existing\x20activations...',async()=>{await batchAsync(_0x3d0f9b,async _0x194dc5=>{const _0x4411d6=a41_0x1bb7,_0x5a8eda=await _0xde47f9[_0x4411d6(0x1ac)][_0x4411d6(0x1c3)](_0x2d0d43,_0x194dc5['id']);_0xbe184f[_0x4411d6(0x224)](_0x194dc5['id'],_0x5a8eda);});},{'verbose':_0x4568ee[_0x2fdcdd(0x1e8)]});const {segmentFiles:_0x1f0b0a,foldersToCreate:_0x22ef8a}=await prepareSegmentFiles(_0x565687,{'segmentByFolderAndName':_0x3d340c,'activationsBySegmentId':_0xbe184f,'folderPathToId':_0x100ada,'idToEmailMap':_0x30578d,'connectionIdToNameMap':_0x2a32b4},_0x463033,_0x36ab31,_0x4aabb7),_0x545edc=_0x52a5bc?[]:findSegmentsToDelete(_0x3d0f9b,_0x565687[_0x2fdcdd(0x19d)](({yamlConfig:_0x305035,folderPath:_0x6f6c0})=>({'yamlConfig':_0x305035,'folderPath':resolveTDFolderPath(_0x6f6c0,_0x36ab31,_0x4aabb7)})),_0x1a277,_0x4aabb7,_0x36ab31),{journeyFiles:_0x496128,foldersToCreate:_0x29f890}=await withProgressSpinner(_0x2fdcdd(0x21d),async _0x2ebcff=>prepareJourneyFiles(_0x2866bb,{'fetchJourney':async _0x44684d=>_0xde47f9[_0x2fdcdd(0x223)][_0x2fdcdd(0x207)](_0x44684d[_0x2fdcdd(0x22a)]),'journeyBundlesByFolderAndName':_0xa895b0,'folderPathToId':_0x100ada,'idToEmailMap':_0x30578d,'connectionIdToNameMap':_0x2a32b4,'existingSegments':_0x3d0f9b,'parentId':_0x2d0d43,'deps':_0xde47f9,'progress':{'update':_0x1e9eb9=>{const _0x271f59=_0x2fdcdd;_0x2ebcff[_0x271f59(0x1d5)](_0x1e9eb9),_0x4568ee['verbose']&&console[_0x271f59(0x1b0)]('\x20\x20'+_0x1e9eb9);}},'journeyById':_0x4b9cb4,'activationStepsById':_0x43ce93},_0x36ab31,_0x4aabb7),{'verbose':_0x4568ee[_0x2fdcdd(0x1e8)]})[_0x2fdcdd(0x1b2)](_0x890e62=>_0x890e62[_0x2fdcdd(0x22e)]);for(const _0x456961 of _0x29f890){_0x22ef8a[_0x2fdcdd(0x20b)](_0x456961);}const _0x52fb48=_0x52a5bc?[]:findJourneysToDelete(_0x425332,_0x2866bb[_0x2fdcdd(0x19d)](({yamlConfig:_0x193b03,folderPath:_0xfe90ef})=>({'yamlConfig':_0x193b03,'folderPath':resolveTDFolderPath(_0xfe90ef,_0x36ab31,_0x4aabb7)})),_0x1a277,_0x4aabb7,_0x36ab31),_0xb6ada9=calculatePushStats(_0x1f0b0a,_0x496128,_0x22ef8a,_0x545edc,_0x52fb48,!!_0x4568ee['delete'],!!_0x4568ee[_0x2fdcdd(0x1e3)]),_0x2af78b=_0xb6ada9[_0x2fdcdd(0x208)][_0x2fdcdd(0x20c)],_0x270719=_0xb6ada9[_0x2fdcdd(0x208)][_0x2fdcdd(0x21a)],_0x1d5d2e=_0xb6ada9[_0x2fdcdd(0x208)][_0x2fdcdd(0x1b1)],_0x3b71af=_0xb6ada9['segments'][_0x2fdcdd(0x1c9)],_0x27bed1=_0xb6ada9[_0x2fdcdd(0x214)]['toCreate'],_0x2c02d5=_0xb6ada9[_0x2fdcdd(0x201)][_0x2fdcdd(0x20c)],_0x3f9ec6=_0xb6ada9[_0x2fdcdd(0x201)][_0x2fdcdd(0x21a)],_0x143a16=_0xb6ada9[_0x2fdcdd(0x201)][_0x2fdcdd(0x1b1)],_0x159e05=_0xb6ada9[_0x2fdcdd(0x201)][_0x2fdcdd(0x1c9)],_0x2cdc3e=_0xb6ada9[_0x2fdcdd(0x219)][_0x2fdcdd(0x1bb)],_0x222f28=_0xb6ada9['activations'][_0x2fdcdd(0x1d2)],_0x346675=_0xb6ada9[_0x2fdcdd(0x219)][_0x2fdcdd(0x1b8)],_0x4d24db=_0xb6ada9['activations'][_0x2fdcdd(0x1c9)];console[_0x2fdcdd(0x1b0)](_0x2fdcdd(0x1d4)+_0x3e427d+'\x27:');_0x27bed1[_0x2fdcdd(0x21c)]>0x0&&console[_0x2fdcdd(0x1b0)]('\x20\x20'+a41_0x3c0870['blue'](_0x2fdcdd(0x1bd)+_0x27bed1['length']+'\x20folders\x20to\x20create'));if(!_0x4568ee[_0x2fdcdd(0x1e3)]){console['error'](_0x2fdcdd(0x20a)),console['error'](_0x2fdcdd(0x1c6)+a41_0x3c0870[_0x2fdcdd(0x1dc)]('+\x20'+_0x2af78b[_0x2fdcdd(0x21c)]+_0x2fdcdd(0x20f))),console[_0x2fdcdd(0x1b0)](_0x2fdcdd(0x1c6)+a41_0x3c0870['yellow']('~\x20'+_0x270719[_0x2fdcdd(0x21c)]+_0x2fdcdd(0x1a6)));if(_0x3b71af[_0x2fdcdd(0x21c)]>0x0)console[_0x2fdcdd(0x1b0)](_0x2fdcdd(0x1c6)+a41_0x3c0870[_0x2fdcdd(0x1cf)]('-\x20'+_0x3b71af['length']+'\x20to\x20delete'));else _0x545edc[_0x2fdcdd(0x21c)]>0x0&&!_0x4568ee[_0x2fdcdd(0x1ae)]&&console[_0x2fdcdd(0x1b0)](_0x2fdcdd(0x1c6)+a41_0x3c0870[_0x2fdcdd(0x228)](_0x545edc['length']+_0x2fdcdd(0x1fb)));console['error'](_0x2fdcdd(0x1c6)+a41_0x3c0870['dim']('=\x20'+_0x1d5d2e[_0x2fdcdd(0x21c)]+_0x2fdcdd(0x1a1)));}if(_0x496128[_0x2fdcdd(0x21c)]>0x0||_0x52fb48[_0x2fdcdd(0x21c)]>0x0){console[_0x2fdcdd(0x1b0)](_0x2fdcdd(0x235)),console[_0x2fdcdd(0x1b0)]('\x20\x20\x20\x20'+a41_0x3c0870[_0x2fdcdd(0x1dc)]('+\x20'+_0x2c02d5['length']+_0x2fdcdd(0x20f))),console[_0x2fdcdd(0x1b0)]('\x20\x20\x20\x20'+a41_0x3c0870[_0x2fdcdd(0x1fc)]('~\x20'+_0x3f9ec6['length']+_0x2fdcdd(0x1a6)));if(_0x159e05[_0x2fdcdd(0x21c)]>0x0)console['error'](_0x2fdcdd(0x1c6)+a41_0x3c0870['red']('-\x20'+_0x159e05[_0x2fdcdd(0x21c)]+'\x20to\x20delete'));else _0x52fb48[_0x2fdcdd(0x21c)]>0x0&&!_0x4568ee['delete']&&console[_0x2fdcdd(0x1b0)](_0x2fdcdd(0x1c6)+a41_0x3c0870['dim'](_0x52fb48[_0x2fdcdd(0x21c)]+_0x2fdcdd(0x1fb)));console[_0x2fdcdd(0x1b0)]('\x20\x20\x20\x20'+a41_0x3c0870[_0x2fdcdd(0x228)]('=\x20'+_0x143a16[_0x2fdcdd(0x21c)]+_0x2fdcdd(0x1a1)));}_0x2cdc3e[_0x2fdcdd(0x21c)]>0x0&&!_0x4568ee[_0x2fdcdd(0x1e3)]&&(console[_0x2fdcdd(0x1b0)](''),console[_0x2fdcdd(0x1b0)](_0x2fdcdd(0x203)),_0x222f28[_0x2fdcdd(0x21c)]>0x0&&console['error']('\x20\x20\x20\x20'+a41_0x3c0870['green']('+\x20'+_0x222f28['length']+'\x20to\x20create')),_0x346675['length']>0x0&&console[_0x2fdcdd(0x1b0)](_0x2fdcdd(0x1c6)+a41_0x3c0870[_0x2fdcdd(0x1fc)]('~\x20'+_0x346675[_0x2fdcdd(0x21c)]+_0x2fdcdd(0x1c1))),_0x4d24db['length']>0x0&&console[_0x2fdcdd(0x1b0)](_0x2fdcdd(0x1c6)+a41_0x3c0870[_0x2fdcdd(0x1cf)]('-\x20'+_0x4d24db[_0x2fdcdd(0x21c)]+_0x2fdcdd(0x19e))));console[_0x2fdcdd(0x1b0)](_0x2fdcdd(0x1d1)+a41_0x3c0870[_0x2fdcdd(0x1ca)](_0x181a8c)+'\x0a');if(_0x27bed1[_0x2fdcdd(0x21c)]>0x0){console['error']('Folders\x20to\x20create:');for(const _0x2bc638 of _0x27bed1){console[_0x2fdcdd(0x1b0)]('\x20\x20'+a41_0x3c0870['blue']('+')+'\x20'+_0x2bc638);}console['error']('');}if(_0x2af78b['length']>0x0&&!_0x4568ee[_0x2fdcdd(0x1e3)])for(const _0x407b31 of _0x2af78b){const _0x546874=_0x407b31[_0x2fdcdd(0x212)]?_0x407b31[_0x2fdcdd(0x212)]+'/'+_0x407b31['yamlConfig'][_0x2fdcdd(0x1ed)]:_0x407b31[_0x2fdcdd(0x1db)]['name'],_0x23701e=_0x407b31[_0x2fdcdd(0x1db)]['activations']?.['length']||0x0,_0x3ee3aa=_0x23701e>0x0?a41_0x3c0870[_0x2fdcdd(0x228)]('\x20['+_0x23701e+_0x2fdcdd(0x1a4)):'';console[_0x2fdcdd(0x1b0)]('\x0a'+a41_0x3c0870[_0x2fdcdd(0x1dc)](_0x2fdcdd(0x1d0))+'\x20'+_0x546874+_0x3ee3aa),console[_0x2fdcdd(0x1b0)]('─'[_0x2fdcdd(0x1da)](0x3c)),_0x407b31[_0x2fdcdd(0x1e1)]&&console[_0x2fdcdd(0x1b0)](_0x407b31[_0x2fdcdd(0x1e1)]),console['error']('─'[_0x2fdcdd(0x1da)](0x3c));}if(_0x3b71af[_0x2fdcdd(0x21c)]>0x0&&!_0x4568ee['journeysOnly'])for(const _0x5a9480 of _0x3b71af){const _0x889eb1=_0x5a9480[_0x2fdcdd(0x1f3)]?_0x1a277['get'](_0x5a9480[_0x2fdcdd(0x1f3)][_0x2fdcdd(0x229)]())||'':'',_0x586e25=_0x889eb1?_0x889eb1+'/'+_0x5a9480[_0x2fdcdd(0x1ed)]:_0x5a9480[_0x2fdcdd(0x1ed)],_0x410a41=_0xbe184f[_0x2fdcdd(0x1a5)](_0x5a9480['id'])||[],_0x15c26e=_0x410a41[_0x2fdcdd(0x21c)]>0x0?a41_0x3c0870[_0x2fdcdd(0x228)]('\x20['+_0x410a41[_0x2fdcdd(0x21c)]+_0x2fdcdd(0x1a4)):'';console[_0x2fdcdd(0x1b0)]('\x0a'+a41_0x3c0870[_0x2fdcdd(0x1cf)](_0x2fdcdd(0x215))+'\x20'+_0x586e25+_0x15c26e),console[_0x2fdcdd(0x1b0)]('─'[_0x2fdcdd(0x1da)](0x3c));const _0x351f53=segmentWithActivationsToYaml(_0x5a9480,_0x410a41,undefined,_0x30578d,_0x2a32b4),_0xc63160=segmentToYamlString(_0x351f53),_0x50bcad=generateDiff(_0xc63160,'');console['error'](formatDiffWithColors(_0x50bcad)),console[_0x2fdcdd(0x1b0)]('─'[_0x2fdcdd(0x1da)](0x3c));}const _0xa600c5=_0x1f0b0a[_0x2fdcdd(0x1c8)](_0x50bcb9=>!_0x50bcb9[_0x2fdcdd(0x1bc)]&&_0x50bcb9[_0x2fdcdd(0x1e1)]);if(_0xa600c5['length']>0x0&&!_0x4568ee[_0x2fdcdd(0x1e3)])for(const _0x2588a7 of _0xa600c5){const _0x25d09=_0x2588a7[_0x2fdcdd(0x212)]?_0x2588a7[_0x2fdcdd(0x212)]+'/'+_0x2588a7['yamlConfig'][_0x2fdcdd(0x1ed)]:_0x2588a7[_0x2fdcdd(0x1db)][_0x2fdcdd(0x1ed)];console[_0x2fdcdd(0x1b0)]('\x0a'+a41_0x3c0870[_0x2fdcdd(0x1fc)](_0x2fdcdd(0x1d3))+'\x20'+_0x25d09),console[_0x2fdcdd(0x1b0)]('─'['repeat'](0x3c)),console['error'](_0x2588a7[_0x2fdcdd(0x1e1)]),console[_0x2fdcdd(0x1b0)]('─'['repeat'](0x3c));}if(_0x2c02d5[_0x2fdcdd(0x21c)]>0x0)for(const _0x9c816a of _0x2c02d5){const _0x4ba837=_0x9c816a['folderPath']?_0x9c816a[_0x2fdcdd(0x212)]+'/'+_0x9c816a[_0x2fdcdd(0x1db)]['name']:_0x9c816a[_0x2fdcdd(0x1db)][_0x2fdcdd(0x1ed)];console['error']('\x0a'+a41_0x3c0870[_0x2fdcdd(0x1dc)]('New\x20journey:')+'\x20'+_0x4ba837),console[_0x2fdcdd(0x1b0)]('─'['repeat'](0x3c)),_0x9c816a[_0x2fdcdd(0x1e1)]&&console['error'](_0x9c816a[_0x2fdcdd(0x1e1)]),console[_0x2fdcdd(0x1b0)]('─'[_0x2fdcdd(0x1da)](0x3c));}const _0x36890f=_0x496128[_0x2fdcdd(0x1c8)](_0x5e9686=>!_0x5e9686[_0x2fdcdd(0x1bc)]&&_0x5e9686['diff']);if(_0x36890f[_0x2fdcdd(0x21c)]>0x0)for(const _0x3abb1a of _0x36890f){const _0x193b06=_0x3abb1a[_0x2fdcdd(0x212)]?_0x3abb1a[_0x2fdcdd(0x212)]+'/'+_0x3abb1a[_0x2fdcdd(0x1db)][_0x2fdcdd(0x1ed)]:_0x3abb1a[_0x2fdcdd(0x1db)][_0x2fdcdd(0x1ed)];console['error']('\x0a'+a41_0x3c0870[_0x2fdcdd(0x1fc)]('Changes\x20to\x20journey:')+'\x20'+_0x193b06),console[_0x2fdcdd(0x1b0)]('─'['repeat'](0x3c)),console[_0x2fdcdd(0x1b0)](_0x3abb1a['diff']),console[_0x2fdcdd(0x1b0)]('─'[_0x2fdcdd(0x1da)](0x3c));}if(_0x159e05[_0x2fdcdd(0x21c)]>0x0)for(const _0x3e4430 of _0x159e05){const _0x22c140=_0x3e4430[_0x2fdcdd(0x227)]?_0x1a277['get'](_0x3e4430['folderId'])||'':'',_0x4b6234=_0x22c140?_0x22c140+'/'+_0x3e4430['journeyBundleName']:_0x3e4430[_0x2fdcdd(0x1fd)];console[_0x2fdcdd(0x1b0)]('\x0a'+a41_0x3c0870[_0x2fdcdd(0x1cf)](_0x2fdcdd(0x1a7))+'\x20'+_0x4b6234),console[_0x2fdcdd(0x1b0)]('─'['repeat'](0x3c)),console[_0x2fdcdd(0x1b0)](a41_0x3c0870[_0x2fdcdd(0x1cf)](_0x2fdcdd(0x236))),console[_0x2fdcdd(0x1b0)]('─'[_0x2fdcdd(0x1da)](0x3c));}if(_0x4568ee[_0x2fdcdd(0x1a0)])return console[_0x2fdcdd(0x1b0)](a41_0x3c0870['yellow'](_0x2fdcdd(0x1b5))),0x0;const _0xc911d1=_0x4568ee[_0x2fdcdd(0x1e3)]?![]:_0x2af78b['length']>0x0||_0x270719[_0x2fdcdd(0x21c)]>0x0||_0x3b71af[_0x2fdcdd(0x21c)]>0x0,_0x2635bd=_0x2c02d5[_0x2fdcdd(0x21c)]>0x0||_0x3f9ec6['length']>0x0||_0x159e05[_0x2fdcdd(0x21c)]>0x0,_0x4e3f0e=_0x4568ee[_0x2fdcdd(0x1e3)]?![]:_0x2cdc3e[_0x2fdcdd(0x21c)]>0x0,_0x5751c5=_0x27bed1['length']>0x0;if(!_0xc911d1&&!_0x2635bd&&!_0x4e3f0e&&!_0x5751c5){const _0x4d889b=_0x4568ee[_0x2fdcdd(0x1e3)]?_0x2fdcdd(0x1b4):_0x2fdcdd(0x1f2);console['error'](a41_0x3c0870[_0x2fdcdd(0x1dc)](_0x4d889b));if(_0x52a5bc&&_0x1d5d2e[_0x2fdcdd(0x21c)]===0x1){const _0x1dffd3=_0x1d5d2e[0x0];if(_0x1dffd3[_0x2fdcdd(0x1ef)]?.['id']){const _0x56e6a6=getConsoleNextUrl(_0x4568ee['site'],_0x2fdcdd(0x1a8)+_0x2d0d43+_0x2fdcdd(0x1e7)+_0x1dffd3[_0x2fdcdd(0x1ef)]['id']+_0x2fdcdd(0x204));console[_0x2fdcdd(0x1b0)](_0x2fdcdd(0x1d9)+a41_0x3c0870[_0x2fdcdd(0x1ca)](_0x56e6a6));}}if(_0x52a5bc&&_0x143a16[_0x2fdcdd(0x21c)]===0x1){const _0x2b9638=_0x143a16[0x0];if(_0x2b9638['existingJourney']?.['id']){const _0x19d28f=getConsoleNextUrl(_0x4568ee[_0x2fdcdd(0x22c)],'/app/ps/'+_0x2d0d43+_0x2fdcdd(0x1e7)+_0x2b9638[_0x2fdcdd(0x1ce)]['id']+_0x2fdcdd(0x1bf));console['error']('\x20\x20'+a41_0x3c0870[_0x2fdcdd(0x1ca)](_0x19d28f));}}return 0x0;}const _0x40a379=_0x4568ee[_0x2fdcdd(0x1e3)]?_0x2c02d5[_0x2fdcdd(0x21c)]+_0x3f9ec6[_0x2fdcdd(0x21c)]+_0x159e05[_0x2fdcdd(0x21c)]+_0x27bed1['length']:_0x2af78b[_0x2fdcdd(0x21c)]+_0x270719[_0x2fdcdd(0x21c)]+_0x3b71af[_0x2fdcdd(0x21c)]+_0x2c02d5[_0x2fdcdd(0x21c)]+_0x3f9ec6[_0x2fdcdd(0x21c)]+_0x159e05[_0x2fdcdd(0x21c)]+_0x27bed1[_0x2fdcdd(0x21c)]+_0x2cdc3e[_0x2fdcdd(0x21c)];if(!_0x4568ee[_0x2fdcdd(0x21b)]&&_0x40a379>0x0){if(!isInteractive())return console['error'](a41_0x3c0870[_0x2fdcdd(0x1cf)](_0x2fdcdd(0x1e9)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x2fdcdd(0x1b0)](a41_0x3c0870[_0x2fdcdd(0x228)](_0x2fdcdd(0x1ad))),0x1;const _0x589e75=await confirmKey(_0x2fdcdd(0x231)+_0x40a379+'\x20changes?');if(!_0x589e75)return console[_0x2fdcdd(0x1b0)](a41_0x3c0870[_0x2fdcdd(0x1fc)]('Aborted.')),0x1;}const _0x577ed0={'withProgress':async(_0x10ed57,_0x5c0b3b)=>{const _0x59a509=_0x2fdcdd,_0x4dec17=await withSpinner(_0x10ed57,_0x5c0b3b,{'verbose':_0x4568ee['verbose']});return{'data':_0x4dec17[_0x59a509(0x22e)]};},'logInfo':_0x5ceeb8=>console[_0x2fdcdd(0x1b0)](a41_0x3c0870[_0x2fdcdd(0x1ff)]('✔\x20'+_0x5ceeb8)),'logSuccess':_0x6a7030=>console[_0x2fdcdd(0x1b0)](a41_0x3c0870[_0x2fdcdd(0x1dc)]('✔\x20'+_0x6a7030)),'logWarning':_0x359244=>console['error'](a41_0x3c0870[_0x2fdcdd(0x1fc)]('⚠\x20'+_0x359244)),'logDeleted':_0x2c8aa1=>console[_0x2fdcdd(0x1b0)](a41_0x3c0870[_0x2fdcdd(0x1cf)]('✔\x20'+_0x2c8aa1))},_0x56eaa3={'segment':_0xde47f9[_0x2fdcdd(0x1ac)],'journey':_0xde47f9[_0x2fdcdd(0x223)],'user':_0xde47f9[_0x2fdcdd(0x1fa)],'connection':_0xde47f9[_0x2fdcdd(0x1ee)]};_0x27bed1[_0x2fdcdd(0x21c)]>0x0&&(_0x100ada=await executePushFolders(_0x56eaa3,_0x27bed1,_0x100ada,{'parentId':_0x2d0d43},_0x577ed0));const _0x28f8b3={'rootFolderId':_0x5aa42b,'folderPathToId':_0x100ada,'folderIdToPath':_0x1a277,'segmentNameToId':_0x536a8d,'activationsBySegmentId':_0xbe184f,'emailToIdMap':_0x227d47,'idToEmailMap':_0x30578d,'connectionNameToIdMap':_0xc669c2[_0x2fdcdd(0x1c7)],'connectionIdToNameMap':_0xc669c2[_0x2fdcdd(0x1b9)],'connectionNameToTypeMap':_0x2d141b},_0x46924d=await executePushSegments(_0x56eaa3,_0x4568ee[_0x2fdcdd(0x1e3)]?[]:_0x1f0b0a,_0x28f8b3,{'parentId':_0x2d0d43},_0x577ed0),_0x482fbb=_0x46924d['created'],_0x5ab9e6=_0x46924d[_0x2fdcdd(0x211)],_0x408032=_0x46924d[_0x2fdcdd(0x219)][_0x2fdcdd(0x1b3)],_0x383a58=_0x46924d['activations'][_0x2fdcdd(0x211)],_0x5e5ed3=_0x46924d['activations']['deleted'];let _0x2f7d99;if(_0x52a5bc&&_0x1f0b0a[_0x2fdcdd(0x21c)]===0x1){const _0x2a19c5=_0x1f0b0a[0x0];_0x2f7d99=_0x2a19c5[_0x2fdcdd(0x1ef)]?.['id']??_0x46924d[_0x2fdcdd(0x1e0)][_0x2fdcdd(0x1a5)](_0x2a19c5[_0x2fdcdd(0x1db)][_0x2fdcdd(0x1ed)]);}const _0x1a3232=await executePushSegmentDeletions(_0x56eaa3,_0x4568ee['journeysOnly']?[]:_0x3b71af,_0x577ed0);let _0x49d08a=0x0,_0xc79b65=0x0,_0x8376a2=0x0;const _0x48bf85=new Map(_0x536a8d);for(const [_0x25f11e,_0x2ce99c]of _0x46924d['createdSegmentIds']){_0x48bf85[_0x2fdcdd(0x224)](_0x25f11e,_0x2ce99c);}if(_0x496128[_0x2fdcdd(0x21c)]>0x0){const _0x57b1c9={..._0x28f8b3,'segmentNameToId':_0x48bf85,'existingSegments':_0x3d0f9b,'activationContext':_0x463033},_0x5b6ba1=await executePushJourneys(_0x56eaa3,_0x496128,_0x57b1c9,{'parentId':_0x2d0d43,'rootFolderId':_0x5aa42b,'verbose':_0x4568ee[_0x2fdcdd(0x1e8)]},_0x577ed0);_0x49d08a=_0x5b6ba1[_0x2fdcdd(0x1b3)],_0xc79b65=_0x5b6ba1[_0x2fdcdd(0x211)];if(_0x52a5bc&&_0x5b6ba1[_0x2fdcdd(0x1e4)][_0x2fdcdd(0x21c)]===0x1){const _0x45fccc=_0x5b6ba1[_0x2fdcdd(0x1e4)][0x0];if(_0x45fccc[_0x2fdcdd(0x22a)]){const _0x1304f0=getConsoleNextUrl(_0x4568ee[_0x2fdcdd(0x22c)],_0x2fdcdd(0x1a8)+_0x2d0d43+'/e/'+_0x45fccc[_0x2fdcdd(0x22a)]+_0x2fdcdd(0x1bf));console['error']('\x20\x20'+a41_0x3c0870[_0x2fdcdd(0x1ca)](_0x1304f0));}}}for(const _0x5820f5 of _0x159e05){console[_0x2fdcdd(0x1b0)](a41_0x3c0870[_0x2fdcdd(0x1fc)](_0x2fdcdd(0x1f6)+_0x5820f5[_0x2fdcdd(0x1fd)])),_0x8376a2++;}const _0x36b0b9=[];if(_0x482fbb>0x0)_0x36b0b9['push'](_0x482fbb+_0x2fdcdd(0x226));if(_0x5ab9e6>0x0)_0x36b0b9[_0x2fdcdd(0x234)](_0x5ab9e6+_0x2fdcdd(0x1ea));if(_0x1a3232>0x0)_0x36b0b9[_0x2fdcdd(0x234)](_0x1a3232+_0x2fdcdd(0x222));const _0x3ec167=[];if(_0x49d08a>0x0)_0x3ec167[_0x2fdcdd(0x234)](_0x49d08a+_0x2fdcdd(0x226));if(_0xc79b65>0x0)_0x3ec167['push'](_0xc79b65+_0x2fdcdd(0x1ea));if(_0x8376a2>0x0)_0x3ec167['push'](_0x8376a2+_0x2fdcdd(0x222));const _0x13eee8=[];if(_0x408032>0x0)_0x13eee8[_0x2fdcdd(0x234)](_0x408032+_0x2fdcdd(0x226));if(_0x383a58>0x0)_0x13eee8['push'](_0x383a58+_0x2fdcdd(0x1ea));if(_0x5e5ed3>0x0)_0x13eee8[_0x2fdcdd(0x234)](_0x5e5ed3+_0x2fdcdd(0x222));console['error'](a41_0x3c0870[_0x2fdcdd(0x1dc)]('\x0a✔\x20Push\x20complete'));_0x36b0b9[_0x2fdcdd(0x21c)]>0x0&&!_0x4568ee[_0x2fdcdd(0x1e3)]&&console['error'](_0x2fdcdd(0x1be)+_0x36b0b9[_0x2fdcdd(0x1d6)](',\x20'));_0x3ec167['length']>0x0&&console['error'](_0x2fdcdd(0x1dd)+_0x3ec167[_0x2fdcdd(0x1d6)](',\x20'));_0x13eee8[_0x2fdcdd(0x21c)]>0x0&&!_0x4568ee[_0x2fdcdd(0x1e3)]&&console['error'](_0x2fdcdd(0x1ec)+_0x13eee8[_0x2fdcdd(0x1d6)](',\x20'));if(_0x2f7d99){const _0x336dc1=getConsoleNextUrl(_0x4568ee['site'],'/app/ps/'+_0x2d0d43+_0x2fdcdd(0x1e7)+_0x2f7d99+_0x2fdcdd(0x204));console['error'](_0x2fdcdd(0x1d9)+a41_0x3c0870[_0x2fdcdd(0x1ca)](_0x336dc1));}return 0x0;}}
@@ -1 +1 @@
1
- const a42_0x205eca=a42_0xde6f;(function(_0x554ecc,_0x798ab3){const _0x2b1155=a42_0xde6f,_0x5d7e98=_0x554ecc();while(!![]){try{const _0xcdd25b=parseInt(_0x2b1155(0x8d))/0x1+-parseInt(_0x2b1155(0xab))/0x2+parseInt(_0x2b1155(0xa4))/0x3*(-parseInt(_0x2b1155(0x93))/0x4)+-parseInt(_0x2b1155(0xa6))/0x5+parseInt(_0x2b1155(0x98))/0x6+parseInt(_0x2b1155(0xa2))/0x7+parseInt(_0x2b1155(0x8f))/0x8;if(_0xcdd25b===_0x798ab3)break;else _0x5d7e98['push'](_0x5d7e98['shift']());}catch(_0x538c86){_0x5d7e98['push'](_0x5d7e98['shift']());}}}(a42_0x4956,0xc6036));function a42_0xde6f(_0x3a869d,_0x39dafe){_0x3a869d=_0x3a869d-0x89;const _0x4956ed=a42_0x4956();let _0xde6fb3=_0x4956ed[_0x3a869d];return _0xde6fb3;}import{BaseCommand}from'./command.js';function a42_0x4956(){const _0x4a7a49=['Examples:','name','segment:update','1247386nnpGsO','Resolved\x20folder\x20ID:\x20','15832760Qtmyny','ruleFile','rule','verbose','68SVjaEO','\x27...','parentId','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','Updating\x20segment\x20\x27','1392690uUBwkx','⚠\x20Deprecation\x20warning:\x20`segment\x20update`\x20is\x20deprecated.','segmentId','Resolving\x20path\x20\x27','Segment\x20ID:\x20','updateSegmentById','segmentPath','error','.\x20Only\x20child\x20segments\x20can\x20be\x20updated.','\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','2027725YgNGGm','type','227049PqQfvs','segment','3708380znHogn','✔\x20Updated\x20segment\x20\x27','Resolving\x20folder\x20\x27','Parent\x20ID:\x20','folder','1817844UtYWtO','kind','data','yellow','Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]'];a42_0x4956=function(){return _0x4a7a49;};return a42_0x4956();}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_0x241bfe from'chalk';export class SegmentUpdateCommand extends BaseCommand{[a42_0x205eca(0x8b)]=a42_0x205eca(0x8c);['description']='Update\x20existing\x20child\x20segment';async['execute'](_0x44fb41){const _0x119ad3=a42_0x205eca;console[_0x119ad3(0x9f)](a42_0x241bfe[_0x119ad3(0xae)](_0x119ad3(0x99))),console['error'](a42_0x241bfe[_0x119ad3(0xae)](_0x119ad3(0x96)));const {options:_0x14e5d2,args:_0x4148ae,tdx:_0x490651}=_0x44fb41,_0x12ff4b=_0x14e5d2;if(_0x4148ae['length']===0x0)return console[_0x119ad3(0x9f)]('Error:\x20Segment\x20path\x20or\x20name\x20is\x20required'),console[_0x119ad3(0x9f)](_0x119ad3(0x89)),console[_0x119ad3(0x9f)](_0x119ad3(0x8a)),console['error']('\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22'),console[_0x119ad3(0x9f)](_0x119ad3(0xa1)),0x1;const _0x4eb43f=_0x4148ae[0x0],_0x5ece2e=_0x14e5d2[_0x119ad3(0x9e)];let _0x16571a=_0x4eb43f;_0x5ece2e&&!_0x4eb43f['includes']('/')&&(_0x16571a=_0x5ece2e+'/'+_0x4eb43f,_0x12ff4b[_0x119ad3(0x92)]&&console[_0x119ad3(0x9f)]('Resolved\x20relative\x20path\x20to:\x20'+_0x16571a));const _0x163544=await withSpinner(_0x119ad3(0x9b)+_0x16571a+_0x119ad3(0x94),()=>_0x490651[_0x119ad3(0xa5)]['resolvePathToResource'](_0x16571a),{'verbose':_0x12ff4b[_0x119ad3(0x92)]}),_0x2fdb55=_0x163544['data'];_0x12ff4b[_0x119ad3(0x92)]&&console['error']('Resolved\x20type:\x20'+_0x2fdb55['type']);if(_0x2fdb55[_0x119ad3(0xa3)]!==_0x119ad3(0xa5))return console[_0x119ad3(0x9f)]('Error:\x20Cannot\x20update\x20'+_0x2fdb55[_0x119ad3(0xa3)]+_0x119ad3(0xa0)),console[_0x119ad3(0x9f)]('Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]'),0x1;if(!_0x2fdb55[_0x119ad3(0x9a)])throw new SDKError(ErrorCode['INTERNAL'],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x170bef=_0x2fdb55[_0x119ad3(0x95)],_0x3eb2b2=_0x2fdb55[_0x119ad3(0x9a)];_0x12ff4b['verbose']&&(console[_0x119ad3(0x9f)](_0x119ad3(0xa9)+_0x170bef),console[_0x119ad3(0x9f)](_0x119ad3(0x9c)+_0x3eb2b2));let _0x4147d3;if(_0x12ff4b[_0x119ad3(0xaa)]){const _0x51c2d6=_0x12ff4b[_0x119ad3(0xaa)],_0x11b438=await withSpinner(_0x119ad3(0xa8)+_0x51c2d6+'\x27...',()=>_0x490651['segment']['resolveFolderId'](_0x170bef,_0x51c2d6),{'verbose':_0x12ff4b[_0x119ad3(0x92)]});_0x4147d3=parseInt(_0x11b438[_0x119ad3(0xad)],0xa),_0x12ff4b[_0x119ad3(0x92)]&&console[_0x119ad3(0x9f)](_0x119ad3(0x8e)+_0x4147d3);}const _0x5efabf=await loadJSONFromOptions(_0x12ff4b[_0x119ad3(0x91)],_0x12ff4b[_0x119ad3(0x90)]),_0x456133={'name':_0x12ff4b[_0x119ad3(0x8b)],'description':_0x12ff4b['description'],'rule':_0x5efabf,'kind':_0x12ff4b[_0x119ad3(0xac)]!==undefined?parseInt(_0x12ff4b['kind'],0xa):undefined,'segmentFolderId':_0x4147d3},_0x58a2d3=await withSpinner(_0x119ad3(0x97)+_0x2fdb55['segmentName']+_0x119ad3(0x94),()=>_0x490651[_0x119ad3(0xa5)][_0x119ad3(0x9d)](_0x170bef,_0x3eb2b2,_0x456133),{'verbose':_0x12ff4b[_0x119ad3(0x92)]}),_0x21678e=_0x58a2d3['data'];return console[_0x119ad3(0x9f)](_0x119ad3(0xa7)+_0x21678e[_0x119ad3(0x8b)]+'\x27'),_0x16571a!==_0x4eb43f&&console[_0x119ad3(0x9f)]('\x20\x20\x20Path:\x20'+_0x16571a),await handleSDKOutput([_0x21678e],_0x12ff4b),0x0;}}
1
+ const a42_0x29b388=a42_0x16e5;(function(_0x456d20,_0x20cc35){const _0x2a8610=a42_0x16e5,_0x3b8088=_0x456d20();while(!![]){try{const _0x586790=-parseInt(_0x2a8610(0x1d1))/0x1*(parseInt(_0x2a8610(0x1ae))/0x2)+parseInt(_0x2a8610(0x1b0))/0x3*(parseInt(_0x2a8610(0x1c3))/0x4)+-parseInt(_0x2a8610(0x1cc))/0x5*(parseInt(_0x2a8610(0x1b4))/0x6)+parseInt(_0x2a8610(0x1dd))/0x7*(-parseInt(_0x2a8610(0x1bd))/0x8)+-parseInt(_0x2a8610(0x1be))/0x9+-parseInt(_0x2a8610(0x1c8))/0xa+-parseInt(_0x2a8610(0x1bc))/0xb*(-parseInt(_0x2a8610(0x1c9))/0xc);if(_0x586790===_0x20cc35)break;else _0x3b8088['push'](_0x3b8088['shift']());}catch(_0x3bc66f){_0x3b8088['push'](_0x3b8088['shift']());}}}(a42_0x1fb7,0x223c0));import{BaseCommand}from'./command.js';function a42_0x1fb7(){const _0x3d2a3f=['\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','segmentName','\x20\x20\x20Path:\x20','name','segment:update','kind','1881uMpTzV','395056gHgeil','1377243NaxMcM','type','✔\x20Updated\x20segment\x20\x27','rule','⚠\x20Deprecation\x20warning:\x20`segment\x20update`\x20is\x20deprecated.','442352RKPlXT','\x27...','resolvePathToResource','Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','283230DIfrsG','32556XhdbHJ','execute','Segment\x20ID:\x20','90vUPrrU','Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]','length','segment','includes','15087lXhOUO','parentId','segmentPath','.\x20Only\x20child\x20segments\x20can\x20be\x20updated.','Error:\x20Cannot\x20update\x20','Resolving\x20path\x20\x27','updateSegmentById','Resolving\x20folder\x20\x27','yellow','verbose','description','folder','14qWJxMe','resolveFolderId','2MvxvNz','data','3ohCXfQ','Resolved\x20relative\x20path\x20to:\x20','error','Resolved\x20folder\x20ID:\x20','46362wVdOXB','Update\x20existing\x20child\x20segment'];a42_0x1fb7=function(){return _0x3d2a3f;};return a42_0x1fb7();}import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';function a42_0x16e5(_0x3f2bb8,_0x16fe81){_0x3f2bb8=_0x3f2bb8-0x1ad;const _0x1fb7db=a42_0x1fb7();let _0x16e5e0=_0x1fb7db[_0x3f2bb8];return _0x16e5e0;}import{loadJSONFromOptions}from'../utils/json-loader.js';import{SDKError,ErrorCode}from'../sdk/index.js';import a42_0x39c6dc from'chalk';export class SegmentUpdateCommand extends BaseCommand{[a42_0x29b388(0x1b9)]=a42_0x29b388(0x1ba);[a42_0x29b388(0x1db)]=a42_0x29b388(0x1b5);async[a42_0x29b388(0x1ca)](_0x9bb459){const _0x5d47db=a42_0x29b388;console['error'](a42_0x39c6dc[_0x5d47db(0x1d9)](_0x5d47db(0x1c2))),console[_0x5d47db(0x1b2)](a42_0x39c6dc[_0x5d47db(0x1d9)]('\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a'));const {options:_0x49e879,args:_0x42e523,tdx:_0x28a078}=_0x9bb459,_0x471f16=_0x49e879;if(_0x42e523[_0x5d47db(0x1ce)]===0x0)return console['error'](_0x5d47db(0x1c7)),console[_0x5d47db(0x1b2)](_0x5d47db(0x1c6)),console[_0x5d47db(0x1b2)]('Examples:'),console['error']('\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22'),console['error'](_0x5d47db(0x1b6)),0x1;const _0x3b3f80=_0x42e523[0x0],_0x279024=_0x49e879[_0x5d47db(0x1d3)];let _0x408085=_0x3b3f80;_0x279024&&!_0x3b3f80[_0x5d47db(0x1d0)]('/')&&(_0x408085=_0x279024+'/'+_0x3b3f80,_0x471f16[_0x5d47db(0x1da)]&&console[_0x5d47db(0x1b2)](_0x5d47db(0x1b1)+_0x408085));const _0x59b4bf=await withSpinner(_0x5d47db(0x1d6)+_0x408085+'\x27...',()=>_0x28a078['segment'][_0x5d47db(0x1c5)](_0x408085),{'verbose':_0x471f16[_0x5d47db(0x1da)]}),_0x4835d2=_0x59b4bf[_0x5d47db(0x1af)];_0x471f16[_0x5d47db(0x1da)]&&console[_0x5d47db(0x1b2)]('Resolved\x20type:\x20'+_0x4835d2[_0x5d47db(0x1bf)]);if(_0x4835d2['type']!==_0x5d47db(0x1cf))return console['error'](_0x5d47db(0x1d5)+_0x4835d2[_0x5d47db(0x1bf)]+_0x5d47db(0x1d4)),console[_0x5d47db(0x1b2)](_0x5d47db(0x1cd)),0x1;if(!_0x4835d2['segmentId'])throw new SDKError(ErrorCode['INTERNAL'],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x3b78be=_0x4835d2[_0x5d47db(0x1d2)],_0x36d8fb=_0x4835d2['segmentId'];_0x471f16[_0x5d47db(0x1da)]&&(console['error']('Parent\x20ID:\x20'+_0x3b78be),console[_0x5d47db(0x1b2)](_0x5d47db(0x1cb)+_0x36d8fb));let _0x35a2b6;if(_0x471f16[_0x5d47db(0x1dc)]){const _0x5cc0dd=_0x471f16[_0x5d47db(0x1dc)],_0x959054=await withSpinner(_0x5d47db(0x1d8)+_0x5cc0dd+_0x5d47db(0x1c4),()=>_0x28a078[_0x5d47db(0x1cf)][_0x5d47db(0x1ad)](_0x3b78be,_0x5cc0dd),{'verbose':_0x471f16['verbose']});_0x35a2b6=parseInt(_0x959054[_0x5d47db(0x1af)],0xa),_0x471f16[_0x5d47db(0x1da)]&&console[_0x5d47db(0x1b2)](_0x5d47db(0x1b3)+_0x35a2b6);}const _0x529770=await loadJSONFromOptions(_0x471f16[_0x5d47db(0x1c1)],_0x471f16['ruleFile']),_0x2e36aa={'name':_0x471f16[_0x5d47db(0x1b9)],'description':_0x471f16[_0x5d47db(0x1db)],'rule':_0x529770,'kind':_0x471f16[_0x5d47db(0x1bb)]!==undefined?parseInt(_0x471f16[_0x5d47db(0x1bb)],0xa):undefined,'segmentFolderId':_0x35a2b6},_0xc89cfd=await withSpinner('Updating\x20segment\x20\x27'+_0x4835d2[_0x5d47db(0x1b7)]+_0x5d47db(0x1c4),()=>_0x28a078[_0x5d47db(0x1cf)][_0x5d47db(0x1d7)](_0x3b78be,_0x36d8fb,_0x2e36aa),{'verbose':_0x471f16[_0x5d47db(0x1da)]}),_0x845a41=_0xc89cfd[_0x5d47db(0x1af)];return console[_0x5d47db(0x1b2)](_0x5d47db(0x1c0)+_0x845a41[_0x5d47db(0x1b9)]+'\x27'),_0x408085!==_0x3b3f80&&console[_0x5d47db(0x1b2)](_0x5d47db(0x1b8)+_0x408085),await handleSDKOutput([_0x845a41],_0x471f16),0x0;}}
@@ -1 +1 @@
1
- const a43_0x494c31=a43_0xd14b;(function(_0x5c7990,_0x75dea4){const _0x2430a9=a43_0xd14b,_0x2b3a19=_0x5c7990();while(!![]){try{const _0x4d0f40=-parseInt(_0x2430a9(0x1b1))/0x1+parseInt(_0x2430a9(0x1c4))/0x2+parseInt(_0x2430a9(0x1d5))/0x3+parseInt(_0x2430a9(0x1d9))/0x4+-parseInt(_0x2430a9(0x1c8))/0x5*(parseInt(_0x2430a9(0x1d1))/0x6)+-parseInt(_0x2430a9(0x1d0))/0x7*(parseInt(_0x2430a9(0x1e4))/0x8)+parseInt(_0x2430a9(0x1d4))/0x9*(parseInt(_0x2430a9(0x1b2))/0xa);if(_0x4d0f40===_0x75dea4)break;else _0x2b3a19['push'](_0x2b3a19['shift']());}catch(_0xf2577e){_0x2b3a19['push'](_0x2b3a19['shift']());}}}(a43_0x16a3,0x83fcd));import{existsSync,statSync}from'fs';import a43_0x4df3e4 from'chalk';import{BaseCommand}from'./command.js';function a43_0x16a3(){const _0x345317=['\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent','data','error','segments','length','fullPath','green','Resolved\x20path\x20type:\x20','1659414tPwEgE','segment','✔\x20Context\x20cleared.\x20Back\x20to\x20root.','Parent\x20ID:\x20','819310IZYcRb','Use:\x20tdx\x20segment\x20use\x20','\x27...','segment:use','Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22','resolvePathToResource','red','16163Wmhnop','6YUPHcL','Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context','execute','398448iTRTBf','1197783xSndcF','config','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22','Set\x20current\x20segment/folder\x20context\x20for\x20navigation','4696lbiTjt','parent_segment','cyan','Error:\x20Path\x20is\x20required\x0a','Resolved\x20relative\x20path\x20to:\x20','session','type','Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.','folderId','segmentPath','log','2088vNqypJ','name','Folder\x20ID:\x20','Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.','dim','folderPath','277186pkTUAt','80iYvvXP','isDirectory','site','✔\x20Context\x20set\x20to:\x20','description','parentId','verbose','Use\x20\x22tdx\x20use\x22\x20to\x20see\x20all\x20context\x20parameters','join','Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.'];a43_0x16a3=function(){return _0x345317;};return a43_0x16a3();}import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';function a43_0xd14b(_0x10a003,_0x423847){_0x10a003=_0x10a003-0x1af;const _0x16a317=a43_0x16a3();let _0xd14b77=_0x16a317[_0x10a003];return _0xd14b77;}import{parsePath,normalizePath}from'../sdk/segment/segment-path-parser.js';import{findTdxConfig}from'../sdk/segment/tdx-config.js';export class SegmentUseCommand extends BaseCommand{[a43_0x494c31(0x1e5)]=a43_0x494c31(0x1cb);[a43_0x494c31(0x1b6)]=a43_0x494c31(0x1d8);async[a43_0x494c31(0x1d3)](_0x917ca6){const _0x50f00f=a43_0x494c31,{options:_0x19dc14,args:_0x1a444e,tdx:_0x4cb46c}=_0x917ca6;if(_0x1a444e[_0x50f00f(0x1c0)]===0x0)return console[_0x50f00f(0x1be)](a43_0x4df3e4[_0x50f00f(0x1cf)](_0x50f00f(0x1dc))),console[_0x50f00f(0x1be)]('Usage:\x20tdx\x20segment\x20use\x20<path>'),console[_0x50f00f(0x1be)]('Examples:'),console[_0x50f00f(0x1be)](_0x50f00f(0x1cd)),console[_0x50f00f(0x1be)](_0x50f00f(0x1d7)),console[_0x50f00f(0x1be)]('\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context'),console['error'](_0x50f00f(0x1bc)),0x1;const _0x37261d=_0x1a444e[0x0],_0x3544c8=_0x19dc14[_0x50f00f(0x1de)];try{if(_0x37261d==='/')return saveSessionContext({'segment_path':undefined},_0x3544c8),console[_0x50f00f(0x1e3)](a43_0x4df3e4[_0x50f00f(0x1c2)](_0x50f00f(0x1c6))),0x0;if(existsSync(_0x37261d)&&statSync(_0x37261d)[_0x50f00f(0x1b3)]()){let _0x53f28e;try{_0x53f28e=findTdxConfig(_0x37261d);}catch{return console[_0x50f00f(0x1be)](a43_0x4df3e4['red'](_0x50f00f(0x1cc)+_0x37261d)),console[_0x50f00f(0x1be)](a43_0x4df3e4[_0x50f00f(0x1db)]('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;}const _0x3aba8a=_0x53f28e[_0x50f00f(0x1d6)][_0x50f00f(0x1da)];return saveSessionContext({'segment_path':_0x3aba8a,'parent_segment':_0x3aba8a},_0x3544c8),console[_0x50f00f(0x1e3)](a43_0x4df3e4[_0x50f00f(0x1c2)](_0x50f00f(0x1b5)+a43_0x4df3e4[_0x50f00f(0x1db)](_0x3aba8a))),0x0;}const _0x54b263=_0x19dc14[_0x50f00f(0x1e2)];let _0x1b2edd=_0x37261d;const _0x18e856=parsePath(_0x37261d);if(!_0x18e856['isAbsolute']){if(!_0x54b263)return console[_0x50f00f(0x1be)](a43_0x4df3e4[_0x50f00f(0x1cf)](_0x50f00f(0x1e0))),console[_0x50f00f(0x1be)](a43_0x4df3e4['cyan']('Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>')),0x1;if(_0x37261d==='..'){const _0x483566=_0x54b263['split']('/')['slice'](0x0,-0x1)['join']('/');_0x1b2edd=_0x483566||'/';}else _0x37261d==='.'?_0x1b2edd=_0x54b263:_0x1b2edd=_0x54b263+'/'+_0x37261d;_0x19dc14['verbose']&&console[_0x50f00f(0x1be)](_0x50f00f(0x1dd)+_0x1b2edd);}if(_0x1b2edd==='/'||_0x1b2edd==='')return saveSessionContext({'segment_path':undefined},_0x3544c8),console['log'](a43_0x4df3e4[_0x50f00f(0x1c2)](_0x50f00f(0x1c6))),0x0;_0x1b2edd=normalizePath(_0x1b2edd);const _0x46f017=parsePath(_0x1b2edd)[_0x50f00f(0x1bf)];if(_0x46f017[_0x50f00f(0x1c0)]===0x0)return saveSessionContext({'segment_path':undefined},_0x3544c8),console[_0x50f00f(0x1e3)](a43_0x4df3e4[_0x50f00f(0x1c2)](_0x50f00f(0x1c6))),0x0;_0x19dc14[_0x50f00f(0x1b8)]&&(console[_0x50f00f(0x1be)]('Site:\x20'+_0x19dc14[_0x50f00f(0x1b4)]),console[_0x50f00f(0x1be)]('Target\x20path:\x20'+_0x1b2edd));const _0x3bf3a4=await withSpinner('Resolving\x20path\x20\x27'+_0x1b2edd+_0x50f00f(0x1ca),()=>_0x4cb46c[_0x50f00f(0x1c5)][_0x50f00f(0x1ce)](_0x1b2edd),{'verbose':_0x19dc14[_0x50f00f(0x1b8)]}),_0x43c2f9=_0x3bf3a4[_0x50f00f(0x1bd)];_0x19dc14[_0x50f00f(0x1b8)]&&(console['error'](_0x50f00f(0x1c3)+_0x43c2f9[_0x50f00f(0x1df)]),console['error'](_0x50f00f(0x1c7)+_0x43c2f9[_0x50f00f(0x1b7)]),_0x43c2f9[_0x50f00f(0x1e1)]&&console['error'](_0x50f00f(0x1e6)+_0x43c2f9['folderId']));if(_0x43c2f9[_0x50f00f(0x1df)]===_0x50f00f(0x1c5))return console[_0x50f00f(0x1be)](a43_0x4df3e4[_0x50f00f(0x1cf)](_0x50f00f(0x1bb))),console[_0x50f00f(0x1be)](_0x50f00f(0x1e7)),console[_0x50f00f(0x1be)](a43_0x4df3e4['cyan'](_0x50f00f(0x1c9)+_0x43c2f9['parentName']+(_0x43c2f9[_0x50f00f(0x1b0)]?'/'+_0x43c2f9['folderPath'][_0x50f00f(0x1ba)]('/'):''))),0x1;return saveSessionContext({'segment_path':_0x43c2f9['fullPath'],'parent_segment':_0x43c2f9['parentName']},_0x3544c8),console[_0x50f00f(0x1e3)](a43_0x4df3e4['green'](_0x50f00f(0x1b5)+a43_0x4df3e4[_0x50f00f(0x1db)](_0x43c2f9[_0x50f00f(0x1c1)]))),_0x19dc14[_0x50f00f(0x1b8)]&&(console['error'](a43_0x4df3e4[_0x50f00f(0x1af)](_0x50f00f(0x1d2))),console[_0x50f00f(0x1be)](a43_0x4df3e4[_0x50f00f(0x1af)](_0x50f00f(0x1b9)))),0x0;}catch(_0x2026ac){throw _0x2026ac;}}}
1
+ const a43_0x5a2010=a43_0x12d0;(function(_0x28cfb6,_0xa71b51){const _0x1edb85=a43_0x12d0,_0x5a3f49=_0x28cfb6();while(!![]){try{const _0x2be353=-parseInt(_0x1edb85(0x109))/0x1*(parseInt(_0x1edb85(0x118))/0x2)+parseInt(_0x1edb85(0x102))/0x3*(parseInt(_0x1edb85(0x10a))/0x4)+parseInt(_0x1edb85(0x112))/0x5+-parseInt(_0x1edb85(0xf9))/0x6*(parseInt(_0x1edb85(0x111))/0x7)+parseInt(_0x1edb85(0x121))/0x8+-parseInt(_0x1edb85(0xfd))/0x9*(-parseInt(_0x1edb85(0x11b))/0xa)+-parseInt(_0x1edb85(0x10b))/0xb*(parseInt(_0x1edb85(0xf5))/0xc);if(_0x2be353===_0xa71b51)break;else _0x5a3f49['push'](_0x5a3f49['shift']());}catch(_0x21b800){_0x5a3f49['push'](_0x5a3f49['shift']());}}}(a43_0x2a67,0x508c7));import{existsSync,statSync}from'fs';import a43_0x4d2995 from'chalk';import{BaseCommand}from'./command.js';import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';import{parsePath,normalizePath}from'../sdk/segment/segment-path-parser.js';function a43_0x12d0(_0x11ff17,_0x5d4041){_0x11ff17=_0x11ff17-0xf0;const _0x2a6734=a43_0x2a67();let _0x12d0d8=_0x2a6734[_0x11ff17];return _0x12d0d8;}import{findTdxConfig}from'../sdk/segment/tdx-config.js';export class SegmentUseCommand extends BaseCommand{[a43_0x5a2010(0xfa)]=a43_0x5a2010(0x113);['description']='Set\x20current\x20segment/folder\x20context\x20for\x20navigation';async[a43_0x5a2010(0x116)](_0x325f4c){const _0xd77f7=a43_0x5a2010,{options:_0xf81386,args:_0x2dde6a,tdx:_0x82e20}=_0x325f4c;if(_0x2dde6a[_0xd77f7(0x10e)]===0x0)return console[_0xd77f7(0x115)](a43_0x4d2995[_0xd77f7(0x10f)](_0xd77f7(0xf6))),console['error'](_0xd77f7(0x114)),console[_0xd77f7(0x115)](_0xd77f7(0xf3)),console[_0xd77f7(0x115)]('\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22'),console[_0xd77f7(0x115)]('\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22'),console['error']('\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context'),console[_0xd77f7(0x115)]('\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 _0x45fb7c=_0x2dde6a[0x0],_0x2d2257=_0xf81386[_0xd77f7(0xf0)];try{if(_0x45fb7c==='/')return saveSessionContext({'segment_path':undefined},_0x2d2257),console['log'](a43_0x4d2995[_0xd77f7(0x11e)](_0xd77f7(0xf8))),0x0;if(existsSync(_0x45fb7c)&&statSync(_0x45fb7c)[_0xd77f7(0x11a)]()){let _0x2e8961;try{_0x2e8961=findTdxConfig(_0x45fb7c);}catch{return console[_0xd77f7(0x115)](a43_0x4d2995[_0xd77f7(0x10f)](_0xd77f7(0x123)+_0x45fb7c)),console[_0xd77f7(0x115)](a43_0x4d2995[_0xd77f7(0xfe)]('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;}const _0x29c6=_0x2e8961['config'][_0xd77f7(0x105)];return saveSessionContext({'segment_path':_0x29c6,'parent_segment':_0x29c6},_0x2d2257),console[_0xd77f7(0xfb)](a43_0x4d2995['green'](_0xd77f7(0x11d)+a43_0x4d2995[_0xd77f7(0xfe)](_0x29c6))),0x0;}const _0x4c31a7=_0xf81386[_0xd77f7(0x107)];let _0x155fa1=_0x45fb7c;const _0x26f093=parsePath(_0x45fb7c);if(!_0x26f093[_0xd77f7(0x11f)]){if(!_0x4c31a7)return console[_0xd77f7(0x115)](a43_0x4d2995[_0xd77f7(0x10f)](_0xd77f7(0x100))),console['error'](a43_0x4d2995[_0xd77f7(0xfe)](_0xd77f7(0x103))),0x1;if(_0x45fb7c==='..'){const _0x478b09=_0x4c31a7['split']('/')['slice'](0x0,-0x1)[_0xd77f7(0xf7)]('/');_0x155fa1=_0x478b09||'/';}else _0x45fb7c==='.'?_0x155fa1=_0x4c31a7:_0x155fa1=_0x4c31a7+'/'+_0x45fb7c;_0xf81386[_0xd77f7(0x108)]&&console[_0xd77f7(0x115)]('Resolved\x20relative\x20path\x20to:\x20'+_0x155fa1);}if(_0x155fa1==='/'||_0x155fa1==='')return saveSessionContext({'segment_path':undefined},_0x2d2257),console[_0xd77f7(0xfb)](a43_0x4d2995[_0xd77f7(0x11e)](_0xd77f7(0xf8))),0x0;_0x155fa1=normalizePath(_0x155fa1);const _0x4b14c6=parsePath(_0x155fa1)[_0xd77f7(0xf1)];if(_0x4b14c6[_0xd77f7(0x10e)]===0x0)return saveSessionContext({'segment_path':undefined},_0x2d2257),console['log'](a43_0x4d2995[_0xd77f7(0x11e)](_0xd77f7(0xf8))),0x0;_0xf81386[_0xd77f7(0x108)]&&(console[_0xd77f7(0x115)]('Site:\x20'+_0xf81386[_0xd77f7(0xf4)]),console[_0xd77f7(0x115)]('Target\x20path:\x20'+_0x155fa1));const _0x1d234e=await withSpinner(_0xd77f7(0xf2)+_0x155fa1+'\x27...',()=>_0x82e20['segment'][_0xd77f7(0x110)](_0x155fa1),{'verbose':_0xf81386['verbose']}),_0x5d1e50=_0x1d234e['data'];_0xf81386[_0xd77f7(0x108)]&&(console['error']('Resolved\x20path\x20type:\x20'+_0x5d1e50['type']),console['error']('Parent\x20ID:\x20'+_0x5d1e50[_0xd77f7(0x10c)]),_0x5d1e50[_0xd77f7(0x117)]&&console['error'](_0xd77f7(0x122)+_0x5d1e50[_0xd77f7(0x117)]));if(_0x5d1e50[_0xd77f7(0xff)]==='segment')return console['error'](a43_0x4d2995[_0xd77f7(0x10f)](_0xd77f7(0x106))),console['error'](_0xd77f7(0x10d)),console[_0xd77f7(0x115)](a43_0x4d2995['cyan'](_0xd77f7(0x101)+_0x5d1e50['parentName']+(_0x5d1e50['folderPath']?'/'+_0x5d1e50[_0xd77f7(0x124)]['join']('/'):''))),0x1;return saveSessionContext({'segment_path':_0x5d1e50['fullPath'],'parent_segment':_0x5d1e50[_0xd77f7(0x11c)]},_0x2d2257),console[_0xd77f7(0xfb)](a43_0x4d2995[_0xd77f7(0x11e)](_0xd77f7(0x11d)+a43_0x4d2995[_0xd77f7(0xfe)](_0x5d1e50[_0xd77f7(0x119)]))),_0xf81386[_0xd77f7(0x108)]&&(console[_0xd77f7(0x115)](a43_0x4d2995['dim'](_0xd77f7(0x104))),console['error'](a43_0x4d2995[_0xd77f7(0x120)](_0xd77f7(0xfc)))),0x0;}catch(_0x2e7b8d){throw _0x2e7b8d;}}}function a43_0x2a67(){const _0x212836=['parentName','✔\x20Context\x20set\x20to:\x20','green','isAbsolute','dim','2328000xWoymL','Folder\x20ID:\x20','Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','folderPath','session','segments','Resolving\x20path\x20\x27','Examples:','site','1032612ZUXnsl','Error:\x20Path\x20is\x20required\x0a','join','✔\x20Context\x20cleared.\x20Back\x20to\x20root.','129252vIMoHH','name','log','Use\x20\x22tdx\x20use\x22\x20to\x20see\x20all\x20context\x20parameters','9DwXWQS','cyan','type','Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.','Use:\x20tdx\x20segment\x20use\x20','6biMZUF','Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>','Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context','parent_segment','Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.','segmentPath','verbose','243008wyENlT','1089828eqppHB','121PlIqim','parentId','Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.','length','red','resolvePathToResource','70vySSBx','1858440EqFoua','segment:use','Usage:\x20tdx\x20segment\x20use\x20<path>','error','execute','folderId','2iMjCeh','fullPath','isDirectory','5273140RXISbU'];a43_0x2a67=function(){return _0x212836;};return a43_0x2a67();}
@@ -1 +1 @@
1
- function a44_0x20bd(){const _0x3a504f=['segment:validate','65838OInSBJ','targetDir','validCount','\x20valid','\x20warning(s)','warnings','green','message','invalidCount','409149SAszzl','error','1246864ukGRMT','90CXFElr','dim','Error:\x20Directory\x20not\x20found:\x20','79649ReTmAV','60KLcdTb','\x20error(s)','156166lGGnov','✔\x20All\x20','1277549plJNuZ','description','endsWith','):\x20','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','Error:\x20','parentSegment','no_parent','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','errors','verbose','warningCount','execute','type','3PsezSI','\x20file(s)\x20with\x20errors,\x20','valid','length','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20validate\x20.\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20current\x20directory','filePath','620988PNHyZR','yellow','name','red','Validation\x20failed:\x20','hasErrors','log','\x20warning(s)\x20found','helpText','\x20file(s)\x20valid','Usage:\x20tdx\x20sg\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)'];a44_0x20bd=function(){return _0x3a504f;};return a44_0x20bd();}const a44_0x277851=a44_0x103a;(function(_0x265242,_0x3d81d2){const _0x153bca=a44_0x103a,_0x4ade1b=_0x265242();while(!![]){try{const _0x3bb22e=parseInt(_0x153bca(0x71))/0x1+parseInt(_0x153bca(0x74))/0x2+-parseInt(_0x153bca(0x84))/0x3*(-parseInt(_0x153bca(0x8b))/0x4)+-parseInt(_0x153bca(0x72))/0x5*(parseInt(_0x153bca(0x97))/0x6)+parseInt(_0x153bca(0x76))/0x7+parseInt(_0x153bca(0x6d))/0x8+parseInt(_0x153bca(0xa0))/0x9*(-parseInt(_0x153bca(0x6e))/0xa);if(_0x3bb22e===_0x3d81d2)break;else _0x4ade1b['push'](_0x4ade1b['shift']());}catch(_0x3be28a){_0x4ade1b['push'](_0x4ade1b['shift']());}}}(a44_0x20bd,0x1afb7));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_0x9b688e from'chalk';function a44_0x103a(_0x144576,_0x19d7a3){_0x144576=_0x144576-0x6d;const _0x20bd22=a44_0x20bd();let _0x103a57=_0x20bd22[_0x144576];return _0x103a57;}import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class SegmentValidateCommand extends BaseCommand{[a44_0x277851(0x8d)]=a44_0x277851(0x96);[a44_0x277851(0x77)]='Validate\x20segment\x20and\x20journey\x20YAML\x20files';async[a44_0x277851(0x82)](_0x22b2fa){const _0xaf3697=a44_0x277851,{options:_0x46b753,args:_0xec6c89}=_0x22b2fa,_0x177d8a=_0x46b753,_0x5933a7=await resolveTarget({'arg':_0xec6c89[0x0],'contextParent':_0x46b753[_0xaf3697(0x7c)],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x5933a7))return _0x5933a7['errorCode']===_0xaf3697(0x7d)?(console['error'](a44_0x9b688e[_0xaf3697(0x8c)](_0xaf3697(0x7e))),console[_0xaf3697(0xa1)](_0xaf3697(0x95)),console[_0xaf3697(0xa1)](_0xaf3697(0x89)),console[_0xaf3697(0xa1)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file')):(console[_0xaf3697(0xa1)](a44_0x9b688e[_0xaf3697(0x8e)](_0xaf3697(0x7b)+_0x5933a7[_0xaf3697(0x9e)]+'\x0a')),_0x5933a7[_0xaf3697(0x93)]&&console['error'](a44_0x9b688e['cyan'](_0x5933a7[_0xaf3697(0x93)]))),0x1;const _0x3350aa=_0x5933a7[_0xaf3697(0x98)],_0x5b4aed=_0x5933a7[_0xaf3697(0x83)]==='file'?_0x5933a7[_0xaf3697(0x8a)]:undefined;if(!_0x5b4aed&&!existsSync(_0x3350aa))return console[_0xaf3697(0xa1)](a44_0x9b688e['red'](_0xaf3697(0x70)+_0x3350aa+'\x0a')),0x1;let _0x15b66a;if(_0x5b4aed){if(!_0x5b4aed[_0xaf3697(0x78)]('.yml')&&!_0x5b4aed[_0xaf3697(0x78)]('.yaml'))return console[_0xaf3697(0xa1)](a44_0x9b688e[_0xaf3697(0x8e)](_0xaf3697(0x88)+_0x5b4aed+'\x0a')),0x1;_0x15b66a=[_0x5b4aed];}else _0x15b66a=findYamlFiles(_0x3350aa);if(_0x15b66a[_0xaf3697(0x87)]===0x0)return console[_0xaf3697(0xa1)](a44_0x9b688e[_0xaf3697(0x8e)](_0xaf3697(0x7a)+_0x3350aa+'\x0a')),0x1;const _0x5409b3=validateYamlFiles(_0x15b66a,_0x3350aa),_0x1efe6d=calculateSummary(_0x5409b3);for(const _0x470060 of _0x5409b3){if(!isValidationResult(_0x470060))continue;const {relativePath:_0x44ef0d,source:_0x31bb2f,result:_0x41deb7,fileType:_0x23131f}=_0x470060,_0x1c310c=_0x23131f;if(_0x41deb7[_0xaf3697(0x86)]&&_0x41deb7['warnings']['length']===0x0)_0x177d8a[_0xaf3697(0x80)]&&console[_0xaf3697(0x91)](a44_0x9b688e[_0xaf3697(0x9d)]('✔\x20'+_0x44ef0d)+a44_0x9b688e[_0xaf3697(0x6f)]('\x20('+_0x1c310c+')'));else _0x41deb7[_0xaf3697(0x86)]?(console[_0xaf3697(0x91)](a44_0x9b688e[_0xaf3697(0x8c)]('⚠\x20'+_0x44ef0d)+a44_0x9b688e[_0xaf3697(0x6f)]('\x20('+_0x1c310c+_0xaf3697(0x79)+_0x41deb7[_0xaf3697(0x9c)][_0xaf3697(0x87)]+_0xaf3697(0x9b))),console[_0xaf3697(0x91)](formatValidationResult(_0x41deb7,_0x31bb2f,_0x44ef0d))):(console[_0xaf3697(0x91)](a44_0x9b688e[_0xaf3697(0x8e)]('✖\x20'+_0x44ef0d)+a44_0x9b688e[_0xaf3697(0x6f)]('\x20('+_0x1c310c+'):\x20'+_0x41deb7[_0xaf3697(0x7f)][_0xaf3697(0x87)]+_0xaf3697(0x73))),console['log'](formatValidationResult(_0x41deb7,_0x31bb2f,_0x44ef0d)));}return console[_0xaf3697(0x91)](''),_0x1efe6d[_0xaf3697(0x90)]?(console['log'](a44_0x9b688e[_0xaf3697(0x8e)](_0xaf3697(0x8f)+_0x1efe6d[_0xaf3697(0x9f)]+_0xaf3697(0x85)+_0x1efe6d[_0xaf3697(0x99)]+_0xaf3697(0x9a))),_0x1efe6d[_0xaf3697(0x81)]>0x0&&console['log'](a44_0x9b688e[_0xaf3697(0x8c)](_0x1efe6d[_0xaf3697(0x81)]+_0xaf3697(0x92))),0x1):(console[_0xaf3697(0x91)](a44_0x9b688e[_0xaf3697(0x9d)](_0xaf3697(0x75)+_0x1efe6d['validCount']+_0xaf3697(0x94))),_0x1efe6d[_0xaf3697(0x81)]>0x0&&console[_0xaf3697(0x91)](a44_0x9b688e[_0xaf3697(0x8c)](_0x1efe6d[_0xaf3697(0x81)]+'\x20warning(s)\x20found')),0x0);}}
1
+ const a44_0x5cbd9=a44_0x258b;(function(_0x4b363b,_0x30c447){const _0x1f4344=a44_0x258b,_0x5b96af=_0x4b363b();while(!![]){try{const _0x2c9de2=-parseInt(_0x1f4344(0x1a2))/0x1+-parseInt(_0x1f4344(0x193))/0x2*(parseInt(_0x1f4344(0x180))/0x3)+parseInt(_0x1f4344(0x1a8))/0x4*(parseInt(_0x1f4344(0x17b))/0x5)+-parseInt(_0x1f4344(0x17c))/0x6*(parseInt(_0x1f4344(0x196))/0x7)+-parseInt(_0x1f4344(0x184))/0x8+parseInt(_0x1f4344(0x187))/0x9*(parseInt(_0x1f4344(0x192))/0xa)+parseInt(_0x1f4344(0x195))/0xb;if(_0x2c9de2===_0x30c447)break;else _0x5b96af['push'](_0x5b96af['shift']());}catch(_0x14954e){_0x5b96af['push'](_0x5b96af['shift']());}}}(a44_0x282e,0xdd635));function a44_0x258b(_0x1aac20,_0x499fff){_0x1aac20=_0x1aac20-0x175;const _0x282e11=a44_0x282e();let _0x258bf5=_0x282e11[_0x1aac20];return _0x258bf5;}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_0x55bce3 from'chalk';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';function a44_0x282e(){const _0x2749f0=['Usage:\x20tdx\x20sg\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)','description','\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','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','Validate\x20segment\x20and\x20journey\x20YAML\x20files','440165IjAeZA','warnings','hasErrors','length','parentSegment','Error:\x20','299796ZGbtFg','file','errors','\x20file(s)\x20with\x20errors,\x20','errorCode','\x20error(s)','red','dim','85EdLWGo','1385994UsnGtZ','.yaml','\x20warning(s)','targetDir','12081pDUzQo','Error:\x20Directory\x20not\x20found:\x20','\x20warning(s)\x20found','error','5902040vlLZJy','verbose','✔\x20All\x20','9UyRLsU','.yml','execute','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','validCount','valid','no_parent','yellow','\x20valid','cyan','message','11514820dDYLvt','524LxCLch','helpText','12938002SwiXoL','14lczxRp','warningCount','):\x20','segment:validate','type','log','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a'];a44_0x282e=function(){return _0x2749f0;};return a44_0x282e();}import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class SegmentValidateCommand extends BaseCommand{['name']=a44_0x5cbd9(0x199);[a44_0x5cbd9(0x19e)]=a44_0x5cbd9(0x1a1);async[a44_0x5cbd9(0x189)](_0x129afa){const _0x397831=a44_0x5cbd9,{options:_0x17a0c9,args:_0x17f048}=_0x129afa,_0x172ff7=_0x17a0c9,_0x316bb9=await resolveTarget({'arg':_0x17f048[0x0],'contextParent':_0x17a0c9[_0x397831(0x1a6)],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x316bb9))return _0x316bb9[_0x397831(0x177)]===_0x397831(0x18d)?(console[_0x397831(0x183)](a44_0x55bce3['yellow'](_0x397831(0x19c))),console[_0x397831(0x183)](_0x397831(0x19d)),console[_0x397831(0x183)](_0x397831(0x19f)),console[_0x397831(0x183)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file')):(console['error'](a44_0x55bce3['red'](_0x397831(0x1a7)+_0x316bb9[_0x397831(0x191)]+'\x0a')),_0x316bb9[_0x397831(0x194)]&&console['error'](a44_0x55bce3[_0x397831(0x190)](_0x316bb9[_0x397831(0x194)]))),0x1;const _0x3cf665=_0x316bb9[_0x397831(0x17f)],_0x4e6490=_0x316bb9[_0x397831(0x19a)]===_0x397831(0x1a9)?_0x316bb9['filePath']:undefined;if(!_0x4e6490&&!existsSync(_0x3cf665))return console[_0x397831(0x183)](a44_0x55bce3[_0x397831(0x179)](_0x397831(0x181)+_0x3cf665+'\x0a')),0x1;let _0x5e6051;if(_0x4e6490){if(!_0x4e6490['endsWith'](_0x397831(0x188))&&!_0x4e6490['endsWith'](_0x397831(0x17d)))return console[_0x397831(0x183)](a44_0x55bce3[_0x397831(0x179)](_0x397831(0x1a0)+_0x4e6490+'\x0a')),0x1;_0x5e6051=[_0x4e6490];}else _0x5e6051=findYamlFiles(_0x3cf665);if(_0x5e6051[_0x397831(0x1a5)]===0x0)return console['error'](a44_0x55bce3[_0x397831(0x179)](_0x397831(0x18a)+_0x3cf665+'\x0a')),0x1;const _0x5d706b=validateYamlFiles(_0x5e6051,_0x3cf665),_0x576b05=calculateSummary(_0x5d706b);for(const _0x19c419 of _0x5d706b){if(!isValidationResult(_0x19c419))continue;const {relativePath:_0xf2bc79,source:_0x5331f1,result:_0x1a6ad4,fileType:_0x4266cd}=_0x19c419,_0x326fcf=_0x4266cd;if(_0x1a6ad4[_0x397831(0x18c)]&&_0x1a6ad4[_0x397831(0x1a3)]['length']===0x0)_0x172ff7[_0x397831(0x185)]&&console['log'](a44_0x55bce3['green']('✔\x20'+_0xf2bc79)+a44_0x55bce3[_0x397831(0x17a)]('\x20('+_0x326fcf+')'));else _0x1a6ad4['valid']?(console[_0x397831(0x19b)](a44_0x55bce3[_0x397831(0x18e)]('⚠\x20'+_0xf2bc79)+a44_0x55bce3[_0x397831(0x17a)]('\x20('+_0x326fcf+'):\x20'+_0x1a6ad4[_0x397831(0x1a3)]['length']+_0x397831(0x17e))),console[_0x397831(0x19b)](formatValidationResult(_0x1a6ad4,_0x5331f1,_0xf2bc79))):(console[_0x397831(0x19b)](a44_0x55bce3[_0x397831(0x179)]('✖\x20'+_0xf2bc79)+a44_0x55bce3['dim']('\x20('+_0x326fcf+_0x397831(0x198)+_0x1a6ad4[_0x397831(0x175)][_0x397831(0x1a5)]+_0x397831(0x178))),console['log'](formatValidationResult(_0x1a6ad4,_0x5331f1,_0xf2bc79)));}return console[_0x397831(0x19b)](''),_0x576b05[_0x397831(0x1a4)]?(console[_0x397831(0x19b)](a44_0x55bce3[_0x397831(0x179)]('Validation\x20failed:\x20'+_0x576b05['invalidCount']+_0x397831(0x176)+_0x576b05[_0x397831(0x18b)]+_0x397831(0x18f))),_0x576b05[_0x397831(0x197)]>0x0&&console[_0x397831(0x19b)](a44_0x55bce3[_0x397831(0x18e)](_0x576b05['warningCount']+'\x20warning(s)\x20found')),0x1):(console[_0x397831(0x19b)](a44_0x55bce3['green'](_0x397831(0x186)+_0x576b05['validCount']+'\x20file(s)\x20valid')),_0x576b05[_0x397831(0x197)]>0x0&&console[_0x397831(0x19b)](a44_0x55bce3['yellow'](_0x576b05[_0x397831(0x197)]+_0x397831(0x182))),0x0);}}
@@ -1 +1 @@
1
- function a45_0x2797(){const _0x344c0d=['Use\x20tdx\x20ps\x20list\x20to\x20see\x20available\x20parent\x20segments.','journeyBundleName','log','error','9931042dvepXq','folders','segments','map','200365IwUiCI','parentId','Error:\x20','List\x20folders\x20and\x20child\x20segments','Resolving\x20parent\x20segment\x20\x27','sort','\x20\x20tdx\x20sg\x20use\x20\x22My\x20Audience\x22','4250350EFBOHD','\x20matching\x20\x27','verbose','format','\x27...','execute','\x20journey','87446XhmJDf','1WaBmXA','description','44uoeZdq','dim','\x20\x20Cause:\x20','1134ofqbAx','/app/ps/','message','\x20folder','parentSegment','maxDepth','1290303zgybiu','type','resolvePathToResource','replace','/j/da','name','data','listUnifiedWithJourneys','segment','cause','757539xeapks','filter','includes','journeys','test','folderId','jsonl','/e/','children','Parent\x20ID:\x20','site','Listing\x20folders,\x20segments,\x20and\x20journeys...','Site:\x20','No\x20items\x20match\x20pattern:\x20','listWithPattern','listRecursive','Set\x20a\x20parent\x20segment\x20context\x20first:','length','Folder\x20ID:\x20','\x20\x20tdx\x20sg\x20pull\x20\x22My\x20Audience\x22','(empty)','Error:\x20No\x20parent\x20segment\x20context\x20set.','Parent\x20segment\x20context:\x20',',\x20and\x20','48OwTPaq','localeCompare','recursive','\x5c$&','Resolving\x20path\x20\x27','\x20segment','folder','24339hYAtKi','journey'];a45_0x2797=function(){return _0x344c0d;};return a45_0x2797();}const a45_0x5da4d1=a45_0x51b5;(function(_0xc63862,_0x3e89ba){const _0x188be6=a45_0x51b5,_0x546e81=_0xc63862();while(!![]){try{const _0x4de41e=parseInt(_0x188be6(0xfc))/0x1*(parseInt(_0x188be6(0xfb))/0x2)+-parseInt(_0x188be6(0x107))/0x3+parseInt(_0x188be6(0xfe))/0x4*(-parseInt(_0x188be6(0xed))/0x5)+-parseInt(_0x188be6(0x101))/0x6*(parseInt(_0x188be6(0xe3))/0x7)+-parseInt(_0x188be6(0xdc))/0x8*(-parseInt(_0x188be6(0x111))/0x9)+parseInt(_0x188be6(0xf4))/0xa+parseInt(_0x188be6(0xe9))/0xb;if(_0x4de41e===_0x3e89ba)break;else _0x546e81['push'](_0x546e81['shift']());}catch(_0x232f7d){_0x546e81['push'](_0x546e81['shift']());}}}(a45_0x2797,0x55185));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_0x51b5(_0x927eb5,_0x1d0bb3){_0x927eb5=_0x927eb5-0xc6;const _0x279736=a45_0x2797();let _0x51b54d=_0x279736[_0x927eb5];return _0x51b54d;}import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import a45_0x5f581b from'chalk';export class SegmentsCommand extends BaseCommand{['name']=a45_0x5da4d1(0xeb);[a45_0x5da4d1(0xfd)]=a45_0x5da4d1(0xf0);async[a45_0x5da4d1(0xf9)](_0x12ba9d){const _0x3d5ce6=a45_0x5da4d1,{options:_0x574af9,args:_0x3bfd21}=_0x12ba9d,_0x20379b=_0x574af9[_0x3d5ce6(0xde)],_0x11193e=_0x3bfd21[0x0];try{const _0x343504=_0x574af9[_0x3d5ce6(0x105)];_0x574af9['verbose']&&(console[_0x3d5ce6(0xe8)](_0x3d5ce6(0xd0)+_0x574af9[_0x3d5ce6(0xce)]),console[_0x3d5ce6(0xe8)](_0x3d5ce6(0xda)+(_0x343504||'(not\x20set)')),_0x11193e&&console[_0x3d5ce6(0xe8)]('Folder/pattern\x20arg:\x20'+_0x11193e),_0x20379b&&console[_0x3d5ce6(0xe8)]('Recursive\x20mode:\x20enabled'));if(!_0x343504)return console[_0x3d5ce6(0xe8)](_0x3d5ce6(0xd9)),console['error'](''),console[_0x3d5ce6(0xe8)](_0x3d5ce6(0xd4)),console[_0x3d5ce6(0xe8)](_0x3d5ce6(0xd7)),console[_0x3d5ce6(0xe8)](_0x3d5ce6(0xf3)),console[_0x3d5ce6(0xe8)](''),console[_0x3d5ce6(0xe8)](_0x3d5ce6(0xe5)),0x1;const _0x4b2cb7=_0x11193e&&(_0x11193e['includes']('*')||_0x11193e[_0x3d5ce6(0xc6)]('?'));if(_0x4b2cb7)return await this['listWithPattern'](_0x12ba9d,_0x343504,_0x11193e);const _0x1101e7=_0x11193e?_0x343504+'/'+_0x11193e:_0x343504;return _0x20379b?await this['listRecursive'](_0x12ba9d,_0x1101e7):await this['listUnified'](_0x12ba9d,_0x1101e7);}catch(_0xe1f19f){if(_0xe1f19f instanceof SDKError)return console[_0x3d5ce6(0xe8)](_0x3d5ce6(0xef)+_0xe1f19f[_0x3d5ce6(0x103)]),_0xe1f19f[_0x3d5ce6(0x110)]&&console['error'](_0x3d5ce6(0x100)+_0xe1f19f['cause']),0x1;throw _0xe1f19f;}}async[a45_0x5da4d1(0xd2)](_0x2376b0,_0x1ec5c4,_0x3e8906){const _0x4cb282=a45_0x5da4d1,{options:_0x4ec1b3,tdx:_0x3661c5}=_0x2376b0,_0x345562=await withSpinner(_0x4cb282(0xf1)+_0x1ec5c4+_0x4cb282(0xf8),()=>_0x3661c5[_0x4cb282(0x10f)][_0x4cb282(0x109)](_0x1ec5c4),{'verbose':_0x4ec1b3[_0x4cb282(0xf6)]}),_0xdef1b0=_0x345562['data'],_0x8c2066=await withSpinner(_0x4cb282(0xcf),()=>_0x3661c5['segment'][_0x4cb282(0x10e)](_0xdef1b0[_0x4cb282(0xee)],_0xdef1b0[_0x4cb282(0xc9)]),{'verbose':_0x4ec1b3[_0x4cb282(0xf6)]}),{folders:_0x423e0e,segments:_0x435a4d,journeys:_0x365cd1}=_0x8c2066[_0x4cb282(0x10d)],_0x1b6a8d=_0x3e8906[_0x4cb282(0x10a)](/[.+^${}()|[\]\\]/g,_0x4cb282(0xdf))[_0x4cb282(0x10a)](/\*/g,'.*')['replace'](/\?/g,'.'),_0x1a8574=new RegExp('^'+_0x1b6a8d+'$','i'),_0x23b2a3=_0x423e0e[_0x4cb282(0x112)](_0x5cb112=>_0x1a8574[_0x4cb282(0xc8)](_0x5cb112[_0x4cb282(0x10c)])),_0x475d88=_0x435a4d['filter'](_0x141ed4=>_0x1a8574['test'](_0x141ed4[_0x4cb282(0x10c)])),_0x465e26=_0x365cd1[_0x4cb282(0x112)](_0x53d0b3=>_0x1a8574[_0x4cb282(0xc8)](_0x53d0b3[_0x4cb282(0xe6)])),_0x14a368=_0x23b2a3[_0x4cb282(0xd5)]+_0x475d88[_0x4cb282(0xd5)]+_0x465e26[_0x4cb282(0xd5)];console[_0x4cb282(0xe8)]('✔\x20Found\x20'+_0x23b2a3[_0x4cb282(0xd5)]+_0x4cb282(0x104)+(_0x23b2a3['length']!==0x1?'s':'')+',\x20'+_0x475d88[_0x4cb282(0xd5)]+_0x4cb282(0xe1)+(_0x475d88[_0x4cb282(0xd5)]!==0x1?'s':'')+',\x20and\x20'+_0x465e26[_0x4cb282(0xd5)]+_0x4cb282(0xfa)+(_0x465e26[_0x4cb282(0xd5)]!==0x1?'s':'')+_0x4cb282(0xf5)+_0x3e8906+'\x27');const _0x22e239=_0x1ee6f3=>{const _0xb449bd=_0x4cb282;return getConsoleNextUrl(_0x4ec1b3[_0xb449bd(0xce)],_0xb449bd(0x102)+_0xdef1b0['parentId']+_0xb449bd(0xcb)+_0x1ee6f3);},_0x152ef7=_0x4ec1b3[_0x4cb282(0xf7)]==='json'||_0x4ec1b3['format']===_0x4cb282(0xca);if(_0x152ef7){const _0x49f66f=[..._0x23b2a3[_0x4cb282(0xec)](_0x102696=>({..._0x102696,'type':_0x4cb282(0xe2)})),..._0x475d88['map'](_0x3cdd76=>({..._0x3cdd76,'type':_0x4cb282(0x10f),'url':_0x22e239(_0x3cdd76['id'])})),..._0x465e26[_0x4cb282(0xec)](_0x2df27a=>({..._0x2df27a,'name':_0x2df27a['journeyBundleName'],'type':'journey'}))][_0x4cb282(0xf2)]((_0x31c035,_0x2627cc)=>_0x31c035['name'][_0x4cb282(0xdd)](_0x2627cc['name']));await handleSDKOutput(_0x49f66f,_0x4ec1b3);}else{if(_0x14a368===0x0)console['log'](_0x4cb282(0xd1)+_0x3e8906);else{console[_0x4cb282(0xe7)](a45_0x5f581b[_0x4cb282(0xff)]('['+_0x1ec5c4+']\x20matching\x20\x27'+_0x3e8906+'\x27'));const _0x42a887=formatFlatList(_0x23b2a3,_0x475d88,{'showMetadata':!![],'getSegmentUrl':_0x22e239},_0x465e26);console[_0x4cb282(0xe7)](_0x42a887);}}return 0x0;}async['listUnified'](_0xb3517c,_0x6d8b71){const _0x21f8c1=a45_0x5da4d1,{options:_0xf6df8,tdx:_0x1e68f4}=_0xb3517c,_0x34458d=await withSpinner(_0x21f8c1(0xe0)+_0x6d8b71+'\x27...',()=>_0x1e68f4[_0x21f8c1(0x10f)][_0x21f8c1(0x109)](_0x6d8b71),{'verbose':_0xf6df8[_0x21f8c1(0xf6)]}),_0x5cc985=_0x34458d[_0x21f8c1(0x10d)];_0xf6df8[_0x21f8c1(0xf6)]&&(console[_0x21f8c1(0xe8)](_0x21f8c1(0xcd)+_0x5cc985[_0x21f8c1(0xee)]),_0x5cc985[_0x21f8c1(0xc9)]&&console['error'](_0x21f8c1(0xd6)+_0x5cc985[_0x21f8c1(0xc9)]));const _0x49a1b8=await withSpinner(_0x21f8c1(0xcf),()=>_0x1e68f4[_0x21f8c1(0x10f)]['listUnifiedWithJourneys'](_0x5cc985[_0x21f8c1(0xee)],_0x5cc985[_0x21f8c1(0xc9)]),{'verbose':_0xf6df8['verbose']}),{folders:_0x2bbf7e,segments:_0xdb18d9,journeys:_0x5e0ade}=_0x49a1b8[_0x21f8c1(0x10d)],_0x117cde=_0x2bbf7e['length']+_0xdb18d9[_0x21f8c1(0xd5)]+_0x5e0ade[_0x21f8c1(0xd5)];console[_0x21f8c1(0xe8)]('✔\x20Found\x20'+_0x2bbf7e[_0x21f8c1(0xd5)]+_0x21f8c1(0x104)+(_0x2bbf7e[_0x21f8c1(0xd5)]!==0x1?'s':'')+',\x20'+_0xdb18d9[_0x21f8c1(0xd5)]+_0x21f8c1(0xe1)+(_0xdb18d9[_0x21f8c1(0xd5)]!==0x1?'s':'')+',\x20and\x20'+_0x5e0ade[_0x21f8c1(0xd5)]+'\x20journey'+(_0x5e0ade['length']!==0x1?'s':''));const _0xa27661=_0x1229ea=>{const _0x6cbf72=_0x21f8c1;return getConsoleNextUrl(_0xf6df8[_0x6cbf72(0xce)],_0x6cbf72(0x102)+_0x5cc985['parentId']+'/e/'+_0x1229ea);},_0x5e68b0=_0x51e87c=>{const _0x310b1a=_0x21f8c1;return getConsoleNextUrl(_0xf6df8[_0x310b1a(0xce)],_0x310b1a(0x102)+_0x5cc985['parentId']+_0x310b1a(0xcb)+_0x51e87c+_0x310b1a(0x10b));},_0x1231f8=_0xf6df8[_0x21f8c1(0xf7)]==='json'||_0xf6df8[_0x21f8c1(0xf7)]===_0x21f8c1(0xca);if(_0x1231f8){const _0x1e6e32=[..._0x2bbf7e[_0x21f8c1(0xec)](_0x39af67=>({..._0x39af67,'type':_0x21f8c1(0xe2)})),..._0xdb18d9[_0x21f8c1(0xec)](_0x9151a6=>({..._0x9151a6,'type':_0x21f8c1(0x10f),'url':_0xa27661(_0x9151a6['id'])})),..._0x5e0ade[_0x21f8c1(0xec)](_0x5ee7b6=>({..._0x5ee7b6,'name':_0x5ee7b6[_0x21f8c1(0xe6)],'type':_0x21f8c1(0xe4),'url':_0x5e68b0(_0x5ee7b6['id'])}))][_0x21f8c1(0xf2)]((_0x127e2e,_0x4854e0)=>_0x127e2e[_0x21f8c1(0x10c)][_0x21f8c1(0xdd)](_0x4854e0[_0x21f8c1(0x10c)]));await handleSDKOutput(_0x1e6e32,_0xf6df8);}else{if(_0x117cde===0x0)console[_0x21f8c1(0xe7)](a45_0x5f581b['dim']('['+_0x6d8b71+']')),console['log'](_0x21f8c1(0xd8));else{console[_0x21f8c1(0xe7)](a45_0x5f581b['dim']('['+_0x6d8b71+']'));const _0x4fb2b0=formatFlatList(_0x2bbf7e,_0xdb18d9,{'showMetadata':!![],'getSegmentUrl':_0xa27661,'getJourneyUrl':_0x5e68b0},_0x5e0ade);console[_0x21f8c1(0xe7)](_0x4fb2b0);}}return 0x0;}async[a45_0x5da4d1(0xd3)](_0x4c6232,_0x4bf438){const _0x263e59=a45_0x5da4d1,{options:_0x479649,tdx:_0x570f9a}=_0x4c6232,_0x324636=await withSpinner('Resolving\x20path\x20\x27'+_0x4bf438+_0x263e59(0xf8),()=>_0x570f9a[_0x263e59(0x10f)][_0x263e59(0x109)](_0x4bf438),{'verbose':_0x479649[_0x263e59(0xf6)]}),_0x5540f4=_0x324636[_0x263e59(0x10d)];_0x479649[_0x263e59(0xf6)]&&(console[_0x263e59(0xe8)]('Parent\x20ID:\x20'+_0x5540f4[_0x263e59(0xee)]),_0x5540f4[_0x263e59(0xc9)]&&console['error']('Folder\x20ID:\x20'+_0x5540f4[_0x263e59(0xc9)]));const _0x3f08aa=_0x479649[_0x263e59(0x106)]||0xa,_0x2b41f4=await withSpinner('Building\x20hierarchy\x20tree...',()=>_0x570f9a[_0x263e59(0x10f)][_0x263e59(0xd3)](_0x5540f4['parentId'],_0x5540f4[_0x263e59(0xc9)],0x0,_0x3f08aa),{'verbose':_0x479649[_0x263e59(0xf6)]}),_0x7bf69a=_0x2b41f4[_0x263e59(0x10d)],_0x467be9=_0x58aae7=>{const _0x154847=_0x263e59;let _0x533516=0x0,_0x7fe01d=0x0,_0x4916cd=0x0;for(const _0x3b3c04 of _0x58aae7){if(_0x3b3c04[_0x154847(0x108)]===_0x154847(0xe2))_0x533516++;else{if(_0x3b3c04['type']===_0x154847(0x10f))_0x7fe01d++;else{if(_0x3b3c04['type']===_0x154847(0xe4))_0x4916cd++;}}if(_0x3b3c04['children']){const _0x29574a=_0x467be9(_0x3b3c04[_0x154847(0xcc)]);_0x533516+=_0x29574a['folders'],_0x7fe01d+=_0x29574a[_0x154847(0xeb)],_0x4916cd+=_0x29574a[_0x154847(0xc7)];}}return{'folders':_0x533516,'segments':_0x7fe01d,'journeys':_0x4916cd};},_0x41f728=_0x467be9(_0x7bf69a);console[_0x263e59(0xe8)]('✔\x20Built\x20tree\x20with\x20'+_0x41f728[_0x263e59(0xea)]+'\x20folder'+(_0x41f728['folders']!==0x1?'s':'')+',\x20'+_0x41f728['segments']+'\x20segment'+(_0x41f728[_0x263e59(0xeb)]!==0x1?'s':'')+_0x263e59(0xdb)+_0x41f728[_0x263e59(0xc7)]+'\x20journey'+(_0x41f728[_0x263e59(0xc7)]!==0x1?'s':''));const _0x244dd0=_0x5d37b7=>{const _0x452343=_0x263e59;return getConsoleNextUrl(_0x479649[_0x452343(0xce)],_0x452343(0x102)+_0x5540f4['parentId']+_0x452343(0xcb)+_0x5d37b7);},_0x1883fc=_0x3ad74a=>{const _0x38d8ff=_0x263e59;return getConsoleNextUrl(_0x479649['site'],_0x38d8ff(0x102)+_0x5540f4[_0x38d8ff(0xee)]+_0x38d8ff(0xcb)+_0x3ad74a+'/j/da');};if(_0x479649['format']==='json'||_0x479649[_0x263e59(0xf7)]===_0x263e59(0xca))await handleSDKOutput(_0x7bf69a,_0x479649);else{console[_0x263e59(0xe7)](a45_0x5f581b[_0x263e59(0xff)]('['+_0x4bf438+']'));const _0x399965=formatTree(_0x7bf69a,{'showMetadata':!![],'getSegmentUrl':_0x244dd0,'getJourneyUrl':_0x1883fc});console[_0x263e59(0xe7)](_0x399965);}return 0x0;}}
1
+ const a45_0x1d8d1c=a45_0xfe13;(function(_0x320738,_0x44e74d){const _0x1a4e99=a45_0xfe13,_0x2e330e=_0x320738();while(!![]){try{const _0x154651=-parseInt(_0x1a4e99(0x135))/0x1+-parseInt(_0x1a4e99(0x14e))/0x2*(-parseInt(_0x1a4e99(0x149))/0x3)+parseInt(_0x1a4e99(0x137))/0x4+-parseInt(_0x1a4e99(0x150))/0x5+parseInt(_0x1a4e99(0x118))/0x6*(parseInt(_0x1a4e99(0x11d))/0x7)+parseInt(_0x1a4e99(0x13a))/0x8+-parseInt(_0x1a4e99(0x129))/0x9;if(_0x154651===_0x44e74d)break;else _0x2e330e['push'](_0x2e330e['shift']());}catch(_0x14d1a4){_0x2e330e['push'](_0x2e330e['shift']());}}}(a45_0x3d8f,0x94765));import{BaseCommand}from'./command.js';function a45_0xfe13(_0x64cc9a,_0x711561){_0x64cc9a=_0x64cc9a-0x10d;const _0x3d8fc2=a45_0x3d8f();let _0xfe13ec=_0x3d8fc2[_0x64cc9a];return _0xfe13ec;}import{SDKError}from'../sdk/index.js';function a45_0x3d8f(){const _0x2f2698=['21GRgTQJ','(not\x20set)','filter','listUnifiedWithJourneys','map','description','replace','Recursive\x20mode:\x20enabled','\x20journey','\x20segment','/app/ps/','List\x20folders\x20and\x20child\x20segments','17371539QaTBYp','Resolving\x20parent\x20segment\x20\x27','/j/da','includes','Site:\x20','Building\x20hierarchy\x20tree...','type','listUnified','segments','/e/','\x5c$&','Folder\x20ID:\x20','68357mYFFCs','No\x20items\x20match\x20pattern:\x20','3905704ZYJpmt','localeCompare','dim','7619408nHDMmp','Resolving\x20path\x20\x27','\x20folder','verbose',',\x20and\x20','jsonl','listWithPattern','maxDepth','\x20\x20Cause:\x20','listRecursive','parentId','folder','log','data','journeyBundleName','3mSmyOE','\x27...','journey','sort','(empty)','154262ArQoYQ','segment','1250590BbQDsh','json','✔\x20Found\x20','format','message','test','folderId','name','site','folders','error','children','✔\x20Built\x20tree\x20with\x20','Listing\x20folders,\x20segments,\x20and\x20journeys...','1701528JwAnPB','Parent\x20ID:\x20','length','resolvePathToResource','journeys'];a45_0x3d8f=function(){return _0x2f2698;};return a45_0x3d8f();}import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{formatFlatList,formatTree}from'../sdk/util/tree-formatter.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import a45_0x5d8d68 from'chalk';export class SegmentsCommand extends BaseCommand{[a45_0x1d8d1c(0x111)]=a45_0x1d8d1c(0x131);[a45_0x1d8d1c(0x122)]=a45_0x1d8d1c(0x128);async['execute'](_0x277340){const _0x289c46=a45_0x1d8d1c,{options:_0x5862b2,args:_0x9dc6b9}=_0x277340,_0x539ada=_0x5862b2['recursive'],_0x9ed6fb=_0x9dc6b9[0x0];try{const _0x147fe1=_0x5862b2['parentSegment'];_0x5862b2[_0x289c46(0x13d)]&&(console[_0x289c46(0x114)](_0x289c46(0x12d)+_0x5862b2[_0x289c46(0x112)]),console['error']('Parent\x20segment\x20context:\x20'+(_0x147fe1||_0x289c46(0x11e))),_0x9ed6fb&&console[_0x289c46(0x114)]('Folder/pattern\x20arg:\x20'+_0x9ed6fb),_0x539ada&&console[_0x289c46(0x114)](_0x289c46(0x124)));if(!_0x147fe1)return console['error']('Error:\x20No\x20parent\x20segment\x20context\x20set.'),console[_0x289c46(0x114)](''),console[_0x289c46(0x114)]('Set\x20a\x20parent\x20segment\x20context\x20first:'),console[_0x289c46(0x114)]('\x20\x20tdx\x20sg\x20pull\x20\x22My\x20Audience\x22'),console[_0x289c46(0x114)]('\x20\x20tdx\x20sg\x20use\x20\x22My\x20Audience\x22'),console[_0x289c46(0x114)](''),console[_0x289c46(0x114)]('Use\x20tdx\x20ps\x20list\x20to\x20see\x20available\x20parent\x20segments.'),0x1;const _0x5f5c9d=_0x9ed6fb&&(_0x9ed6fb[_0x289c46(0x12c)]('*')||_0x9ed6fb[_0x289c46(0x12c)]('?'));if(_0x5f5c9d)return await this['listWithPattern'](_0x277340,_0x147fe1,_0x9ed6fb);const _0xfd2922=_0x9ed6fb?_0x147fe1+'/'+_0x9ed6fb:_0x147fe1;return _0x539ada?await this[_0x289c46(0x143)](_0x277340,_0xfd2922):await this[_0x289c46(0x130)](_0x277340,_0xfd2922);}catch(_0x57b508){if(_0x57b508 instanceof SDKError)return console[_0x289c46(0x114)]('Error:\x20'+_0x57b508[_0x289c46(0x10e)]),_0x57b508['cause']&&console[_0x289c46(0x114)](_0x289c46(0x142)+_0x57b508['cause']),0x1;throw _0x57b508;}}async[a45_0x1d8d1c(0x140)](_0x1b1920,_0x4a4c73,_0x297ec4){const _0x29946a=a45_0x1d8d1c,{options:_0x366690,tdx:_0x40c460}=_0x1b1920,_0x19bfc6=await withSpinner(_0x29946a(0x12a)+_0x4a4c73+'\x27...',()=>_0x40c460[_0x29946a(0x14f)][_0x29946a(0x11b)](_0x4a4c73),{'verbose':_0x366690['verbose']}),_0x57b352=_0x19bfc6[_0x29946a(0x147)],_0x4eeef4=await withSpinner(_0x29946a(0x117),()=>_0x40c460[_0x29946a(0x14f)][_0x29946a(0x120)](_0x57b352[_0x29946a(0x144)],_0x57b352['folderId']),{'verbose':_0x366690[_0x29946a(0x13d)]}),{folders:_0x3a860b,segments:_0x59e3c7,journeys:_0x20ffef}=_0x4eeef4[_0x29946a(0x147)],_0x2af81c=_0x297ec4['replace'](/[.+^${}()|[\]\\]/g,_0x29946a(0x133))[_0x29946a(0x123)](/\*/g,'.*')[_0x29946a(0x123)](/\?/g,'.'),_0x1c5b41=new RegExp('^'+_0x2af81c+'$','i'),_0x1cd0a2=_0x3a860b['filter'](_0x8ded09=>_0x1c5b41['test'](_0x8ded09[_0x29946a(0x111)])),_0x2a3ff5=_0x59e3c7[_0x29946a(0x11f)](_0x24a71a=>_0x1c5b41['test'](_0x24a71a['name'])),_0x344cf6=_0x20ffef[_0x29946a(0x11f)](_0x26e1d7=>_0x1c5b41[_0x29946a(0x10f)](_0x26e1d7[_0x29946a(0x148)])),_0x24c766=_0x1cd0a2[_0x29946a(0x11a)]+_0x2a3ff5[_0x29946a(0x11a)]+_0x344cf6['length'];console[_0x29946a(0x114)]('✔\x20Found\x20'+_0x1cd0a2[_0x29946a(0x11a)]+_0x29946a(0x13c)+(_0x1cd0a2['length']!==0x1?'s':'')+',\x20'+_0x2a3ff5[_0x29946a(0x11a)]+'\x20segment'+(_0x2a3ff5[_0x29946a(0x11a)]!==0x1?'s':'')+_0x29946a(0x13e)+_0x344cf6[_0x29946a(0x11a)]+_0x29946a(0x125)+(_0x344cf6[_0x29946a(0x11a)]!==0x1?'s':'')+'\x20matching\x20\x27'+_0x297ec4+'\x27');const _0x4da676=_0x2c4491=>{const _0x263db1=_0x29946a;return getConsoleNextUrl(_0x366690[_0x263db1(0x112)],_0x263db1(0x127)+_0x57b352[_0x263db1(0x144)]+'/e/'+_0x2c4491);},_0x16e768=_0x366690[_0x29946a(0x10d)]==='json'||_0x366690[_0x29946a(0x10d)]===_0x29946a(0x13f);if(_0x16e768){const _0x2d422a=[..._0x1cd0a2['map'](_0xefdf72=>({..._0xefdf72,'type':'folder'})),..._0x2a3ff5[_0x29946a(0x121)](_0xb03aff=>({..._0xb03aff,'type':_0x29946a(0x14f),'url':_0x4da676(_0xb03aff['id'])})),..._0x344cf6['map'](_0x2f83a8=>({..._0x2f83a8,'name':_0x2f83a8[_0x29946a(0x148)],'type':_0x29946a(0x14b)}))][_0x29946a(0x14c)]((_0x275346,_0x7da763)=>_0x275346[_0x29946a(0x111)]['localeCompare'](_0x7da763[_0x29946a(0x111)]));await handleSDKOutput(_0x2d422a,_0x366690);}else{if(_0x24c766===0x0)console[_0x29946a(0x146)](_0x29946a(0x136)+_0x297ec4);else{console[_0x29946a(0x146)](a45_0x5d8d68[_0x29946a(0x139)]('['+_0x4a4c73+']\x20matching\x20\x27'+_0x297ec4+'\x27'));const _0x5de5cd=formatFlatList(_0x1cd0a2,_0x2a3ff5,{'showMetadata':!![],'getSegmentUrl':_0x4da676},_0x344cf6);console[_0x29946a(0x146)](_0x5de5cd);}}return 0x0;}async[a45_0x1d8d1c(0x130)](_0x32037c,_0x53be97){const _0x520f3a=a45_0x1d8d1c,{options:_0x3c7c36,tdx:_0x5004b0}=_0x32037c,_0x43fc00=await withSpinner('Resolving\x20path\x20\x27'+_0x53be97+_0x520f3a(0x14a),()=>_0x5004b0[_0x520f3a(0x14f)]['resolvePathToResource'](_0x53be97),{'verbose':_0x3c7c36[_0x520f3a(0x13d)]}),_0x4cd06b=_0x43fc00[_0x520f3a(0x147)];_0x3c7c36[_0x520f3a(0x13d)]&&(console['error'](_0x520f3a(0x119)+_0x4cd06b['parentId']),_0x4cd06b[_0x520f3a(0x110)]&&console['error'](_0x520f3a(0x134)+_0x4cd06b[_0x520f3a(0x110)]));const _0x17b07e=await withSpinner(_0x520f3a(0x117),()=>_0x5004b0[_0x520f3a(0x14f)]['listUnifiedWithJourneys'](_0x4cd06b[_0x520f3a(0x144)],_0x4cd06b[_0x520f3a(0x110)]),{'verbose':_0x3c7c36['verbose']}),{folders:_0x1cbabe,segments:_0x5f5db1,journeys:_0x1b6941}=_0x17b07e['data'],_0x2f085b=_0x1cbabe[_0x520f3a(0x11a)]+_0x5f5db1[_0x520f3a(0x11a)]+_0x1b6941[_0x520f3a(0x11a)];console[_0x520f3a(0x114)](_0x520f3a(0x152)+_0x1cbabe[_0x520f3a(0x11a)]+'\x20folder'+(_0x1cbabe['length']!==0x1?'s':'')+',\x20'+_0x5f5db1[_0x520f3a(0x11a)]+'\x20segment'+(_0x5f5db1['length']!==0x1?'s':'')+_0x520f3a(0x13e)+_0x1b6941[_0x520f3a(0x11a)]+'\x20journey'+(_0x1b6941[_0x520f3a(0x11a)]!==0x1?'s':''));const _0x510917=_0x7eb7d7=>{const _0x416308=_0x520f3a;return getConsoleNextUrl(_0x3c7c36[_0x416308(0x112)],'/app/ps/'+_0x4cd06b[_0x416308(0x144)]+_0x416308(0x132)+_0x7eb7d7);},_0xae829d=_0x3ee0c6=>{const _0x41d4bd=_0x520f3a;return getConsoleNextUrl(_0x3c7c36[_0x41d4bd(0x112)],'/app/ps/'+_0x4cd06b['parentId']+_0x41d4bd(0x132)+_0x3ee0c6+_0x41d4bd(0x12b));},_0x2b36e4=_0x3c7c36[_0x520f3a(0x10d)]===_0x520f3a(0x151)||_0x3c7c36[_0x520f3a(0x10d)]==='jsonl';if(_0x2b36e4){const _0x4f665e=[..._0x1cbabe[_0x520f3a(0x121)](_0x5727eb=>({..._0x5727eb,'type':'folder'})),..._0x5f5db1['map'](_0x3ed6bd=>({..._0x3ed6bd,'type':_0x520f3a(0x14f),'url':_0x510917(_0x3ed6bd['id'])})),..._0x1b6941['map'](_0x151228=>({..._0x151228,'name':_0x151228[_0x520f3a(0x148)],'type':_0x520f3a(0x14b),'url':_0xae829d(_0x151228['id'])}))]['sort']((_0x49b580,_0x3db975)=>_0x49b580['name'][_0x520f3a(0x138)](_0x3db975[_0x520f3a(0x111)]));await handleSDKOutput(_0x4f665e,_0x3c7c36);}else{if(_0x2f085b===0x0)console[_0x520f3a(0x146)](a45_0x5d8d68[_0x520f3a(0x139)]('['+_0x53be97+']')),console[_0x520f3a(0x146)](_0x520f3a(0x14d));else{console[_0x520f3a(0x146)](a45_0x5d8d68[_0x520f3a(0x139)]('['+_0x53be97+']'));const _0x51e750=formatFlatList(_0x1cbabe,_0x5f5db1,{'showMetadata':!![],'getSegmentUrl':_0x510917,'getJourneyUrl':_0xae829d},_0x1b6941);console['log'](_0x51e750);}}return 0x0;}async[a45_0x1d8d1c(0x143)](_0x573427,_0x43cca5){const _0x4ab1ec=a45_0x1d8d1c,{options:_0x4acc4c,tdx:_0x54f512}=_0x573427,_0x3868ae=await withSpinner(_0x4ab1ec(0x13b)+_0x43cca5+_0x4ab1ec(0x14a),()=>_0x54f512['segment']['resolvePathToResource'](_0x43cca5),{'verbose':_0x4acc4c[_0x4ab1ec(0x13d)]}),_0x41479d=_0x3868ae[_0x4ab1ec(0x147)];_0x4acc4c[_0x4ab1ec(0x13d)]&&(console['error'](_0x4ab1ec(0x119)+_0x41479d['parentId']),_0x41479d['folderId']&&console['error'](_0x4ab1ec(0x134)+_0x41479d[_0x4ab1ec(0x110)]));const _0x4232bb=_0x4acc4c[_0x4ab1ec(0x141)]||0xa,_0x4d6ca6=await withSpinner(_0x4ab1ec(0x12e),()=>_0x54f512[_0x4ab1ec(0x14f)][_0x4ab1ec(0x143)](_0x41479d['parentId'],_0x41479d[_0x4ab1ec(0x110)],0x0,_0x4232bb),{'verbose':_0x4acc4c[_0x4ab1ec(0x13d)]}),_0x25a4c9=_0x4d6ca6['data'],_0x5ec367=_0x2d050e=>{const _0x2a8013=_0x4ab1ec;let _0x3d4a06=0x0,_0x3ae748=0x0,_0x470efe=0x0;for(const _0x3450dc of _0x2d050e){if(_0x3450dc['type']===_0x2a8013(0x145))_0x3d4a06++;else{if(_0x3450dc[_0x2a8013(0x12f)]===_0x2a8013(0x14f))_0x3ae748++;else{if(_0x3450dc[_0x2a8013(0x12f)]===_0x2a8013(0x14b))_0x470efe++;}}if(_0x3450dc[_0x2a8013(0x115)]){const _0x176ab2=_0x5ec367(_0x3450dc['children']);_0x3d4a06+=_0x176ab2['folders'],_0x3ae748+=_0x176ab2['segments'],_0x470efe+=_0x176ab2['journeys'];}}return{'folders':_0x3d4a06,'segments':_0x3ae748,'journeys':_0x470efe};},_0x483f56=_0x5ec367(_0x25a4c9);console[_0x4ab1ec(0x114)](_0x4ab1ec(0x116)+_0x483f56['folders']+_0x4ab1ec(0x13c)+(_0x483f56[_0x4ab1ec(0x113)]!==0x1?'s':'')+',\x20'+_0x483f56[_0x4ab1ec(0x131)]+_0x4ab1ec(0x126)+(_0x483f56[_0x4ab1ec(0x131)]!==0x1?'s':'')+_0x4ab1ec(0x13e)+_0x483f56[_0x4ab1ec(0x11c)]+_0x4ab1ec(0x125)+(_0x483f56['journeys']!==0x1?'s':''));const _0x202967=_0x39dad3=>{const _0x1ed341=_0x4ab1ec;return getConsoleNextUrl(_0x4acc4c['site'],_0x1ed341(0x127)+_0x41479d[_0x1ed341(0x144)]+_0x1ed341(0x132)+_0x39dad3);},_0x9fc6c5=_0x8673b3=>{const _0x8a6eb2=_0x4ab1ec;return getConsoleNextUrl(_0x4acc4c[_0x8a6eb2(0x112)],_0x8a6eb2(0x127)+_0x41479d[_0x8a6eb2(0x144)]+_0x8a6eb2(0x132)+_0x8673b3+_0x8a6eb2(0x12b));};if(_0x4acc4c['format']===_0x4ab1ec(0x151)||_0x4acc4c[_0x4ab1ec(0x10d)]===_0x4ab1ec(0x13f))await handleSDKOutput(_0x25a4c9,_0x4acc4c);else{console[_0x4ab1ec(0x146)](a45_0x5d8d68[_0x4ab1ec(0x139)]('['+_0x43cca5+']'));const _0x37d504=formatTree(_0x25a4c9,{'showMetadata':!![],'getSegmentUrl':_0x202967,'getJourneyUrl':_0x9fc6c5});console[_0x4ab1ec(0x146)](_0x37d504);}return 0x0;}}
@@ -1 +1 @@
1
- const a46_0x43fdb5=a46_0x5072;function a46_0x5072(_0xa7c9f2,_0x3f31b8){_0xa7c9f2=_0xa7c9f2-0xda;const _0x5cdf30=a46_0x5cdf();let _0x5072ff=_0x5cdf30[_0xa7c9f2];return _0x5072ff;}(function(_0x568bda,_0x1ed4e5){const _0x1a4b1a=a46_0x5072,_0x16bdf1=_0x568bda();while(!![]){try{const _0x20700c=-parseInt(_0x1a4b1a(0xe4))/0x1+parseInt(_0x1a4b1a(0xf8))/0x2*(-parseInt(_0x1a4b1a(0xdd))/0x3)+parseInt(_0x1a4b1a(0xdf))/0x4*(parseInt(_0x1a4b1a(0xf1))/0x5)+parseInt(_0x1a4b1a(0xe2))/0x6+-parseInt(_0x1a4b1a(0xfe))/0x7+-parseInt(_0x1a4b1a(0xe6))/0x8*(-parseInt(_0x1a4b1a(0xe9))/0x9)+-parseInt(_0x1a4b1a(0xf6))/0xa;if(_0x20700c===_0x1ed4e5)break;else _0x16bdf1['push'](_0x16bdf1['shift']());}catch(_0x327ec7){_0x16bdf1['push'](_0x16bdf1['shift']());}}}(a46_0x5cdf,0x37aa1));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';import{parseTableReference,validateTableDescribeReference}from'../utils/table-ref-parser.js';import{withSpinner}from'../utils/spinner.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';export class ShowCommand extends BaseCommand{[a46_0x43fdb5(0xf0)]=a46_0x43fdb5(0xda);[a46_0x43fdb5(0xff)]=a46_0x43fdb5(0xdc);async[a46_0x43fdb5(0xef)](_0x4d2814){const _0x4574fe=a46_0x43fdb5;return this[_0x4574fe(0x102)](_0x4d2814);}async[a46_0x43fdb5(0x102)](_0x4598a6){const _0x547c36=a46_0x43fdb5,{options:_0x1b1879,args:_0x2bc746,tdx:_0x12e51f}=_0x4598a6;let _0x5a5a77;try{_0x5a5a77=parseTableReference(_0x2bc746[0x0]);const _0x60438a=_0x1b1879['database'];!_0x5a5a77[_0x547c36(0xea)]&&_0x60438a&&(_0x5a5a77[_0x547c36(0xea)]=_0x60438a);const _0x39c370=validateTableDescribeReference(_0x5a5a77);if(_0x39c370)return console[_0x547c36(0xec)](_0x547c36(0xed)+_0x39c370),console[_0x547c36(0xec)](_0x547c36(0xdb)),console[_0x547c36(0xec)]('\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>'),console['error'](_0x547c36(0xe0)),0x1;}catch(_0xc0d029){return console[_0x547c36(0xec)](_0x547c36(0xed)+_0xc0d029[_0x547c36(0xfc)]),console[_0x547c36(0xec)]('Usage:\x20tdx\x20show\x20<database.table>'),console[_0x547c36(0xec)]('\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>'),console[_0x547c36(0xec)](_0x547c36(0xe0)),0x1;}const _0x32f6a2=_0x5a5a77[_0x547c36(0xe7)],_0x4caf9c=_0x5a5a77[_0x547c36(0xea)],_0x325821=_0x5a5a77[_0x547c36(0xf2)],_0x214ebf=resolveLimit(_0x1b1879[_0x547c36(0xde)],DEFAULT_DISPLAY_LIMIT);try{_0x1b1879[_0x547c36(0xfd)]&&(console['error']('Site:\x20'+_0x1b1879['site']),_0x32f6a2&&console[_0x547c36(0xec)]('Catalog:\x20'+_0x32f6a2),console['error']('Database:\x20'+_0x4caf9c),console[_0x547c36(0xec)](_0x547c36(0xeb)+_0x325821),console[_0x547c36(0xec)](_0x547c36(0xee)+_0x214ebf));const _0x23bdfa=_0x32f6a2?_0x32f6a2+'.'+_0x4caf9c+'.'+_0x325821:_0x4caf9c+'.'+_0x325821,_0x10309f=await withSpinner(_0x547c36(0x101)+_0x23bdfa+_0x547c36(0xfa),()=>_0x12e51f[_0x547c36(0xe8)][_0x547c36(0x102)](_0x4caf9c,_0x325821,_0x214ebf,_0x32f6a2),{'verbose':_0x1b1879[_0x547c36(0xfd)]}),_0x830495=_0x10309f[_0x547c36(0xf3)],_0x534d05=_0x830495[_0x547c36(0xf3)];return _0x534d05['length']===0x0?console[_0x547c36(0xec)](_0x547c36(0xe1)):console[_0x547c36(0xec)](_0x547c36(0xf7)+_0x534d05[_0x547c36(0xe5)]+_0x547c36(0x100)+(_0x534d05[_0x547c36(0xe5)]!==0x1?'s':'')+_0x547c36(0xfb)+_0x23bdfa),await handleSDKOutput(_0x534d05,_0x1b1879),0x0;}catch(_0x2d7d7a){if(_0x2d7d7a instanceof SDKError)return console[_0x547c36(0xec)](_0x547c36(0xed)+_0x2d7d7a[_0x547c36(0xfc)]),_0x2d7d7a[_0x547c36(0xf4)]&&console[_0x547c36(0xec)]('\x20\x20Cause:\x20'+_0x2d7d7a['cause']),0x1;throw _0x2d7d7a;}}[a46_0x43fdb5(0xf5)](_0x578fc6){const _0x4ccf8c=a46_0x43fdb5;if(_0x578fc6[_0x4ccf8c(0xe3)][_0x4ccf8c(0xe5)]===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(_0x578fc6['args']['length']>0x1)return _0x4ccf8c(0xf9);return undefined;}}function a46_0x5cdf(){const _0x31cbe1=['16rBIxUA','catalog','query','1531377wvFfQY','database','Table:\x20','error','Error:\x20','Limit:\x20','execute','name','367860htyGRZ','table','data','cause','validate','2813900FxvawP','✔\x20Retrieved\x20','2IRRjDP','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','...','\x20from\x20','message','verbose','2623509ElUMyD','description','\x20row','Querying\x20','showTable','show','Usage:\x20tdx\x20show\x20<database.table>','Show\x20table\x20contents','2868aemxTZ','limit','24KYyogw','\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>','✔\x20Query\x20successful\x20-\x200\x20rows\x20returned','1844544yZplec','args','204028PXTHgo','length'];a46_0x5cdf=function(){return _0x31cbe1;};return a46_0x5cdf();}
1
+ const a46_0x4bbb7d=a46_0x3554;(function(_0x5b0eae,_0x1d65c2){const _0x53b4de=a46_0x3554,_0x18785d=_0x5b0eae();while(!![]){try{const _0x14f7e6=parseInt(_0x53b4de(0x1f4))/0x1+parseInt(_0x53b4de(0x1e4))/0x2+parseInt(_0x53b4de(0x1f6))/0x3*(-parseInt(_0x53b4de(0x1df))/0x4)+parseInt(_0x53b4de(0x1dd))/0x5*(-parseInt(_0x53b4de(0x1da))/0x6)+parseInt(_0x53b4de(0x1fd))/0x7*(parseInt(_0x53b4de(0x1d8))/0x8)+-parseInt(_0x53b4de(0x1f8))/0x9+-parseInt(_0x53b4de(0x1e5))/0xa;if(_0x14f7e6===_0x1d65c2)break;else _0x18785d['push'](_0x18785d['shift']());}catch(_0x2f0a9c){_0x18785d['push'](_0x18785d['shift']());}}}(a46_0x4542,0xbaedb));function a46_0x3554(_0x12355d,_0x5258ea){_0x12355d=_0x12355d-0x1d7;const _0x4542d0=a46_0x4542();let _0x35549f=_0x4542d0[_0x12355d];return _0x35549f;}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_0x4bbb7d(0x1ff);[a46_0x4bbb7d(0x1e6)]='Show\x20table\x20contents';async[a46_0x4bbb7d(0x1d9)](_0x316273){const _0xefa8d6=a46_0x4bbb7d;return this[_0xefa8d6(0x1d7)](_0x316273);}async[a46_0x4bbb7d(0x1d7)](_0xbfd1e1){const _0xa807d2=a46_0x4bbb7d,{options:_0xe08325,args:_0x48cfcb,tdx:_0x4a64de}=_0xbfd1e1;let _0x420869;try{_0x420869=parseTableReference(_0x48cfcb[0x0]);const _0x55584a=_0xe08325[_0xa807d2(0x1ed)];!_0x420869[_0xa807d2(0x1ed)]&&_0x55584a&&(_0x420869[_0xa807d2(0x1ed)]=_0x55584a);const _0xe2c931=validateTableDescribeReference(_0x420869);if(_0xe2c931)return console[_0xa807d2(0x1f5)](_0xa807d2(0x1eb)+_0xe2c931),console[_0xa807d2(0x1f5)](_0xa807d2(0x1fb)),console['error'](_0xa807d2(0x1fe)),console[_0xa807d2(0x1f5)]('\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>'),0x1;}catch(_0x3d559a){return console[_0xa807d2(0x1f5)](_0xa807d2(0x1eb)+_0x3d559a[_0xa807d2(0x1f9)]),console['error']('Usage:\x20tdx\x20show\x20<database.table>'),console['error']('\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>'),console[_0xa807d2(0x1f5)]('\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>'),0x1;}const _0x85ca28=_0x420869[_0xa807d2(0x1f3)],_0x2c5096=_0x420869['database'],_0x17c44a=_0x420869[_0xa807d2(0x1e9)],_0xfaf376=resolveLimit(_0xe08325[_0xa807d2(0x1f2)],DEFAULT_DISPLAY_LIMIT);try{_0xe08325[_0xa807d2(0x1f7)]&&(console['error'](_0xa807d2(0x1f0)+_0xe08325[_0xa807d2(0x1ee)]),_0x85ca28&&console['error'](_0xa807d2(0x1dc)+_0x85ca28),console[_0xa807d2(0x1f5)](_0xa807d2(0x1f1)+_0x2c5096),console[_0xa807d2(0x1f5)](_0xa807d2(0x1fa)+_0x17c44a),console[_0xa807d2(0x1f5)](_0xa807d2(0x1ea)+_0xfaf376));const _0x2c94a8=_0x85ca28?_0x85ca28+'.'+_0x2c5096+'.'+_0x17c44a:_0x2c5096+'.'+_0x17c44a,_0x4b567e=await withSpinner(_0xa807d2(0x1e0)+_0x2c94a8+_0xa807d2(0x1e3),()=>_0x4a64de[_0xa807d2(0x1de)][_0xa807d2(0x1d7)](_0x2c5096,_0x17c44a,_0xfaf376,_0x85ca28),{'verbose':_0xe08325['verbose']}),_0x1e7cae=_0x4b567e[_0xa807d2(0x1e1)],_0x52e068=_0x1e7cae[_0xa807d2(0x1e1)];return _0x52e068[_0xa807d2(0x1e7)]===0x0?console[_0xa807d2(0x1f5)](_0xa807d2(0x1e8)):console[_0xa807d2(0x1f5)](_0xa807d2(0x1e2)+_0x52e068[_0xa807d2(0x1e7)]+'\x20row'+(_0x52e068[_0xa807d2(0x1e7)]!==0x1?'s':'')+_0xa807d2(0x1ef)+_0x2c94a8),await handleSDKOutput(_0x52e068,_0xe08325),0x0;}catch(_0x2e0a22){if(_0x2e0a22 instanceof SDKError)return console['error'](_0xa807d2(0x1eb)+_0x2e0a22[_0xa807d2(0x1f9)]),_0x2e0a22['cause']&&console[_0xa807d2(0x1f5)](_0xa807d2(0x1ec)+_0x2e0a22['cause']),0x1;throw _0x2e0a22;}}['validate'](_0x155bb4){const _0x41fd01=a46_0x4bbb7d;if(_0x155bb4[_0x41fd01(0x1fc)][_0x41fd01(0x1e7)]===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(_0x155bb4[_0x41fd01(0x1fc)][_0x41fd01(0x1e7)]>0x1)return _0x41fd01(0x1db);return undefined;}}function a46_0x4542(){const _0xaf41ee=['Limit:\x20','Error:\x20','\x20\x20Cause:\x20','database','site','\x20from\x20','Site:\x20','Database:\x20','limit','catalog','1450845avrAwH','error','202956WKzJcz','verbose','10232010kBRnEu','message','Table:\x20','Usage:\x20tdx\x20show\x20<database.table>','args','511532kuhAat','\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>','show','showTable','16QktTrw','execute','2254254oEJwAe','Too\x20many\x20arguments\x0aUsage:\x20tdx\x20show\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>\x0a\x0aRun\x20\x27tdx\x20show\x20--help\x27\x20for\x20more\x20options','Catalog:\x20','5FRijyv','query','8hBsodZ','Querying\x20','data','✔\x20Retrieved\x20','...','1871378CdCvJC','1191240FYNCjK','description','length','✔\x20Query\x20successful\x20-\x200\x20rows\x20returned','table'];a46_0x4542=function(){return _0xaf41ee;};return a46_0x4542();}
@@ -1 +1 @@
1
- const a47_0x162d2a=a47_0x3760;(function(_0x34c0a1,_0x2c79ee){const _0x375538=a47_0x3760,_0x3afdbd=_0x34c0a1();while(!![]){try{const _0x3a8ea5=-parseInt(_0x375538(0xcb))/0x1*(-parseInt(_0x375538(0xdf))/0x2)+parseInt(_0x375538(0xd5))/0x3*(-parseInt(_0x375538(0xd7))/0x4)+-parseInt(_0x375538(0xd0))/0x5+parseInt(_0x375538(0xe3))/0x6*(parseInt(_0x375538(0xbc))/0x7)+-parseInt(_0x375538(0xdb))/0x8+-parseInt(_0x375538(0xce))/0x9+parseInt(_0x375538(0xe1))/0xa;if(_0x3a8ea5===_0x2c79ee)break;else _0x3afdbd['push'](_0x3afdbd['shift']());}catch(_0x738ceb){_0x3afdbd['push'](_0x3afdbd['shift']());}}}(a47_0x3154,0x615be));import{BaseCommand,printAuthError}from'./command.js';import{resolveAPIKeyAsync}from'../core/config.js';import{getOAuthTokens}from'../core/oauth-keychain.js';function a47_0x3760(_0x186ca3,_0x1a4e20){_0x186ca3=_0x186ca3-0xba;const _0x3154ed=a47_0x3154();let _0x376016=_0x3154ed[_0x186ca3];return _0x376016;}import{HTTPClientError}from'../sdk/client/http-client.js';import{GlobalContext}from'../core/global-context.js';import a47_0x41d1df from'chalk';function a47_0x3154(){const _0x33a2d0=['✓\x20Authentication\x20successful\x0a','session','green','Credential\x20type:\x20','status','No\x20credential\x20found','✗\x20Validation\x20failed:\x20','profileSource','getUserInfo','dim','profile','(from\x20','32866XBBPhg','Show\x20authentication\x20status\x20and\x20current\x20context','Name:','2253987GwmOrh','displayWithSources','1269430krRdrB','site:\x20','account_id','yellow','description','2397erAHWG','jobs','3852ZIWXSW','bold','filter','env','5393328WugEzP','message','cyan','last_name','26BmeNBc','name','17736670DrVpFw','Account\x20ID:','2118boRbKR','join','Read\x20credential\x20from\x20','User:','red','N/A','config','first_name','log','2891DfqCNR','CLI\x20flag','TDX_PROFILE\x20env'];a47_0x3154=function(){return _0x33a2d0;};return a47_0x3154();}export class StatusCommand extends BaseCommand{[a47_0x162d2a(0xe0)]=a47_0x162d2a(0xc3);[a47_0x162d2a(0xd4)]=a47_0x162d2a(0xcc);async['execute'](_0x33e1e4){const _0x2843ac=a47_0x162d2a,{options:_0x4db0aa,tdx:_0x364895}=_0x33e1e4,_0x73bcf2=_0x4db0aa['site'],_0x1480ae=new GlobalContext(_0x4db0aa),_0x4e55c0=_0x1480ae[_0x2843ac(0xc9)],_0xfb66f2=_0x1480ae[_0x2843ac(0xc6)],_0x5e59ae=_0xfb66f2==='cli'?_0x2843ac(0xbd):_0xfb66f2==='session'?_0x2843ac(0xc0):_0xfb66f2===_0x2843ac(0xda)?_0x2843ac(0xbe):_0xfb66f2===_0x2843ac(0xe9)?_0x2843ac(0xe9):null,_0x5be315=_0x4e55c0?a47_0x41d1df[_0x2843ac(0xdd)](_0x4e55c0):a47_0x41d1df[_0x2843ac(0xc8)](_0x2843ac(0xe8)),_0x26a1b1=_0x5e59ae?'\x20'+a47_0x41d1df[_0x2843ac(0xc8)](_0x2843ac(0xca)+_0x5e59ae+')'):'';console[_0x2843ac(0xbb)](a47_0x41d1df[_0x2843ac(0xd8)]('tdx')+'\x20profile:\x20'+_0x5be315+_0x26a1b1+'\x20'+a47_0x41d1df[_0x2843ac(0xc8)]('(')+_0x2843ac(0xd1)+a47_0x41d1df['cyan'](_0x73bcf2)+a47_0x41d1df[_0x2843ac(0xc8)](')'));const _0x321116=await getOAuthTokens(_0x4e55c0);if(_0x321116)console[_0x2843ac(0xbb)](_0x2843ac(0xc2)+a47_0x41d1df[_0x2843ac(0xdd)]('OAuth'));else{const _0x1cbd60=await resolveAPIKeyAsync(_0x73bcf2,_0x4e55c0);if(_0x1cbd60){const {source:_0x50b4e7,isDeprecated:_0x1d87fe}=_0x1cbd60,_0x1e3506=_0x2843ac(0xe5)+a47_0x41d1df[_0x2843ac(0xdd)](_0x50b4e7);console[_0x2843ac(0xbb)](_0x1d87fe?a47_0x41d1df[_0x2843ac(0xd3)](_0x1e3506):_0x1e3506);}else console[_0x2843ac(0xbb)](a47_0x41d1df['yellow'](_0x2843ac(0xc4)));}let _0x54315f=![];try{const _0x4f1f44=await _0x364895[_0x2843ac(0xd6)][_0x2843ac(0xc7)]();console['log'](a47_0x41d1df[_0x2843ac(0xc1)](_0x2843ac(0xbf))),console[_0x2843ac(0xbb)](a47_0x41d1df[_0x2843ac(0xd8)](_0x2843ac(0xe6))+'\x20'+a47_0x41d1df[_0x2843ac(0xdd)](_0x4f1f44['email']));if(_0x4f1f44[_0x2843ac(0xba)]||_0x4f1f44[_0x2843ac(0xde)]){const _0x33a457=[_0x4f1f44['first_name'],_0x4f1f44[_0x2843ac(0xde)]][_0x2843ac(0xd9)](Boolean)[_0x2843ac(0xe4)]('\x20');console['log'](a47_0x41d1df['bold'](_0x2843ac(0xcd))+'\x20'+_0x33a457);}_0x4f1f44[_0x2843ac(0xd2)]&&console[_0x2843ac(0xbb)](a47_0x41d1df[_0x2843ac(0xd8)](_0x2843ac(0xe2))+'\x20'+a47_0x41d1df[_0x2843ac(0xd3)](_0x4f1f44[_0x2843ac(0xd2)])),_0x54315f=!![];}catch(_0x739716){_0x739716 instanceof HTTPClientError&&_0x739716[_0x2843ac(0xc3)]===0x191?printAuthError(_0x739716,!![],_0x4e55c0):console['error'](a47_0x41d1df[_0x2843ac(0xe7)](_0x2843ac(0xc5)+(_0x739716 instanceof Error?_0x739716[_0x2843ac(0xdc)]:String(_0x739716))));}return console[_0x2843ac(0xbb)](),_0x1480ae[_0x2843ac(0xcf)](),_0x54315f?0x0:0x1;}}
1
+ const a47_0xbe5982=a47_0x283a;(function(_0x2432bf,_0x1d2fa9){const _0x312ba4=a47_0x283a,_0x22a72a=_0x2432bf();while(!![]){try{const _0x2feb4e=parseInt(_0x312ba4(0x1a5))/0x1+-parseInt(_0x312ba4(0x1cd))/0x2*(-parseInt(_0x312ba4(0x1bd))/0x3)+-parseInt(_0x312ba4(0x1be))/0x4*(parseInt(_0x312ba4(0x1c3))/0x5)+-parseInt(_0x312ba4(0x1b0))/0x6*(parseInt(_0x312ba4(0x1b8))/0x7)+parseInt(_0x312ba4(0x1c6))/0x8*(-parseInt(_0x312ba4(0x1aa))/0x9)+parseInt(_0x312ba4(0x1cc))/0xa*(-parseInt(_0x312ba4(0x1cb))/0xb)+parseInt(_0x312ba4(0x1d0))/0xc*(parseInt(_0x312ba4(0x1b9))/0xd);if(_0x2feb4e===_0x1d2fa9)break;else _0x22a72a['push'](_0x22a72a['shift']());}catch(_0x39670c){_0x22a72a['push'](_0x22a72a['shift']());}}}(a47_0x1e7f,0x3745d));import{BaseCommand,printAuthError}from'./command.js';import{resolveAPIKeyAsync}from'../core/config.js';import{getOAuthTokens}from'../core/oauth-keychain.js';import{HTTPClientError}from'../sdk/client/http-client.js';function a47_0x1e7f(){const _0x3a4d84=['OAuth','email','N/A','session','907355CwrwTn','CLI\x20flag','yellow','2385512acxklM','site','first_name','account_id','env','11sIYEVs','1800620jmRsWp','14vjAUMu','description','name','60soKqIu','✗\x20Validation\x20failed:\x20','log','execute','cyan','filter','dim','green','status','profileSource','87174TBoWtO','Account\x20ID:','last_name','join','\x20profile:\x20','9okgfPj','No\x20credential\x20found','User:','getUserInfo','Show\x20authentication\x20status\x20and\x20current\x20context','Read\x20credential\x20from\x20','930018ftkFIq','cli','(from\x20','site:\x20','message','error','red','jobs','7KGNuyy','2202122TshTPb','tdx','bold','profile','123621OyNvTk','8ojONQU'];a47_0x1e7f=function(){return _0x3a4d84;};return a47_0x1e7f();}function a47_0x283a(_0x43aeb1,_0x3aaa2e){_0x43aeb1=_0x43aeb1-0x19f;const _0x1e7fbb=a47_0x1e7f();let _0x283ac7=_0x1e7fbb[_0x43aeb1];return _0x283ac7;}import{GlobalContext}from'../core/global-context.js';import a47_0x21bc7c from'chalk';export class StatusCommand extends BaseCommand{[a47_0xbe5982(0x1cf)]=a47_0xbe5982(0x1a3);[a47_0xbe5982(0x1ce)]=a47_0xbe5982(0x1ae);async[a47_0xbe5982(0x1d3)](_0x24bc47){const _0x1083af=a47_0xbe5982,{options:_0x1293a1,tdx:_0x238704}=_0x24bc47,_0x685537=_0x1293a1[_0x1083af(0x1c7)],_0x2beb30=new GlobalContext(_0x1293a1),_0x592216=_0x2beb30[_0x1083af(0x1bc)],_0x28fc77=_0x2beb30[_0x1083af(0x1a4)],_0x3ba875=_0x28fc77===_0x1083af(0x1b1)?_0x1083af(0x1c4):_0x28fc77===_0x1083af(0x1c2)?'session':_0x28fc77===_0x1083af(0x1ca)?'TDX_PROFILE\x20env':_0x28fc77==='config'?'config':null,_0xf5119a=_0x592216?a47_0x21bc7c[_0x1083af(0x19f)](_0x592216):a47_0x21bc7c[_0x1083af(0x1a1)](_0x1083af(0x1c1)),_0x4e3b57=_0x3ba875?'\x20'+a47_0x21bc7c[_0x1083af(0x1a1)](_0x1083af(0x1b2)+_0x3ba875+')'):'';console[_0x1083af(0x1d2)](a47_0x21bc7c['bold'](_0x1083af(0x1ba))+_0x1083af(0x1a9)+_0xf5119a+_0x4e3b57+'\x20'+a47_0x21bc7c[_0x1083af(0x1a1)]('(')+_0x1083af(0x1b3)+a47_0x21bc7c[_0x1083af(0x19f)](_0x685537)+a47_0x21bc7c[_0x1083af(0x1a1)](')'));const _0x4cfd43=await getOAuthTokens(_0x592216);if(_0x4cfd43)console[_0x1083af(0x1d2)]('Credential\x20type:\x20'+a47_0x21bc7c[_0x1083af(0x19f)](_0x1083af(0x1bf)));else{const _0x1e4247=await resolveAPIKeyAsync(_0x685537,_0x592216);if(_0x1e4247){const {source:_0x132877,isDeprecated:_0x375663}=_0x1e4247,_0x5bc6cf=_0x1083af(0x1af)+a47_0x21bc7c[_0x1083af(0x19f)](_0x132877);console[_0x1083af(0x1d2)](_0x375663?a47_0x21bc7c[_0x1083af(0x1c5)](_0x5bc6cf):_0x5bc6cf);}else console[_0x1083af(0x1d2)](a47_0x21bc7c[_0x1083af(0x1c5)](_0x1083af(0x1ab)));}let _0x3c1109=![];try{const _0x40fe67=await _0x238704[_0x1083af(0x1b7)][_0x1083af(0x1ad)]();console[_0x1083af(0x1d2)](a47_0x21bc7c[_0x1083af(0x1a2)]('✓\x20Authentication\x20successful\x0a')),console['log'](a47_0x21bc7c[_0x1083af(0x1bb)](_0x1083af(0x1ac))+'\x20'+a47_0x21bc7c[_0x1083af(0x19f)](_0x40fe67[_0x1083af(0x1c0)]));if(_0x40fe67[_0x1083af(0x1c8)]||_0x40fe67[_0x1083af(0x1a7)]){const _0x49ec84=[_0x40fe67[_0x1083af(0x1c8)],_0x40fe67[_0x1083af(0x1a7)]][_0x1083af(0x1a0)](Boolean)[_0x1083af(0x1a8)]('\x20');console[_0x1083af(0x1d2)](a47_0x21bc7c['bold']('Name:')+'\x20'+_0x49ec84);}_0x40fe67[_0x1083af(0x1c9)]&&console[_0x1083af(0x1d2)](a47_0x21bc7c['bold'](_0x1083af(0x1a6))+'\x20'+a47_0x21bc7c[_0x1083af(0x1c5)](_0x40fe67[_0x1083af(0x1c9)])),_0x3c1109=!![];}catch(_0x3b0075){_0x3b0075 instanceof HTTPClientError&&_0x3b0075[_0x1083af(0x1a3)]===0x191?printAuthError(_0x3b0075,!![],_0x592216):console[_0x1083af(0x1b5)](a47_0x21bc7c[_0x1083af(0x1b6)](_0x1083af(0x1d1)+(_0x3b0075 instanceof Error?_0x3b0075[_0x1083af(0x1b4)]:String(_0x3b0075))));}return console['log'](),_0x2beb30['displayWithSources'](),_0x3c1109?0x0:0x1;}}