@treasuredata/tdx 2026.6.3 → 2026.6.4

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 (234) 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.js +1 -1
  9. package/dist/commands/agent-test-command.js +1 -1
  10. package/dist/commands/api-command.js +1 -1
  11. package/dist/commands/auth-command.js +1 -1
  12. package/dist/commands/cas-command.js +1 -1
  13. package/dist/commands/cas-segment-command.js +1 -1
  14. package/dist/commands/chat-command.js +1 -1
  15. package/dist/commands/claude-command.js +1 -1
  16. package/dist/commands/claude-statusline-command.js +1 -1
  17. package/dist/commands/claude-usage-command.js +1 -1
  18. package/dist/commands/command.js +1 -1
  19. package/dist/commands/connection-command.js +1 -1
  20. package/dist/commands/databases.js +1 -1
  21. package/dist/commands/delivery-command.js +1 -1
  22. package/dist/commands/describe.js +1 -1
  23. package/dist/commands/engage-campaign-pull-command.js +1 -1
  24. package/dist/commands/engage-campaign-push-command.js +1 -1
  25. package/dist/commands/engage-campaign-validate-command.js +1 -1
  26. package/dist/commands/engage-command.js +1 -1
  27. package/dist/commands/engage-template-pull-command.js +1 -1
  28. package/dist/commands/engage-template-push-command.js +1 -1
  29. package/dist/commands/engage-template-validate-command.js +1 -1
  30. package/dist/commands/job-command.js +1 -1
  31. package/dist/commands/journey-command.js +1 -1
  32. package/dist/commands/journey-validate-command.js +1 -1
  33. package/dist/commands/llm-command.js +1 -1
  34. package/dist/commands/mcp-command.js +1 -1
  35. package/dist/commands/parent-segment-command.js +1 -1
  36. package/dist/commands/policy-command.js +1 -1
  37. package/dist/commands/profile-command.js +1 -1
  38. package/dist/commands/profiles-command.js +1 -1
  39. package/dist/commands/query-command.js +1 -1
  40. package/dist/commands/schedule-command.js +1 -1
  41. package/dist/commands/segment-command.js +1 -1
  42. package/dist/commands/segment-create-command.js +1 -1
  43. package/dist/commands/segment-fields-command.js +1 -1
  44. package/dist/commands/segment-pull-command.js +1 -1
  45. package/dist/commands/segment-push-command.js +1 -1
  46. package/dist/commands/segment-update-command.js +1 -1
  47. package/dist/commands/segment-use-command.js +1 -1
  48. package/dist/commands/segment-validate-command.js +1 -1
  49. package/dist/commands/segments.js +1 -1
  50. package/dist/commands/show.js +1 -1
  51. package/dist/commands/status-command.js +1 -1
  52. package/dist/commands/table-deleted.js +1 -1
  53. package/dist/commands/tables.js +1 -1
  54. package/dist/commands/unset-command.js +1 -1
  55. package/dist/commands/upgrade-command.js +1 -1
  56. package/dist/commands/use-command.js +1 -1
  57. package/dist/commands/user-command.js +1 -1
  58. package/dist/commands/work-command.js +1 -1
  59. package/dist/commands/workflow-command.js +1 -1
  60. package/dist/core/auth.js +1 -1
  61. package/dist/core/command-output.js +1 -1
  62. package/dist/core/config.d.ts +14 -0
  63. package/dist/core/config.d.ts.map +1 -1
  64. package/dist/core/config.js +1 -1
  65. package/dist/core/config.js.map +1 -1
  66. package/dist/core/connection-cache.js +1 -1
  67. package/dist/core/constants.js +1 -1
  68. package/dist/core/credential-cache.js +1 -1
  69. package/dist/core/global-context.js +1 -1
  70. package/dist/core/keychain.js +1 -1
  71. package/dist/core/oauth-keychain.js +1 -1
  72. package/dist/core/oauth.js +1 -1
  73. package/dist/core/profile.js +1 -1
  74. package/dist/core/project-config.d.ts +1 -0
  75. package/dist/core/project-config.d.ts.map +1 -1
  76. package/dist/core/project-config.js +1 -1
  77. package/dist/core/project-config.js.map +1 -1
  78. package/dist/core/session.js +1 -1
  79. package/dist/core/user-cache.js +1 -1
  80. package/dist/core/version.js +1 -1
  81. package/dist/index.js +1 -1
  82. package/dist/mcp/server.js +1 -1
  83. package/dist/mcp/tools/index.js +1 -1
  84. package/dist/mcp/tools/tdx-run.js +1 -1
  85. package/dist/mcp/tools/tdx-search.d.ts.map +1 -1
  86. package/dist/mcp/tools/tdx-search.js +1 -1
  87. package/dist/mcp/tools/tdx-search.js.map +1 -1
  88. package/dist/mcp/tools/work-create-item.js +1 -1
  89. package/dist/mcp/utils.js +1 -1
  90. package/dist/proxy/claude-usage-tracker.js +1 -1
  91. package/dist/proxy/passthrough-server.js +1 -1
  92. package/dist/proxy/sse-usage-parser.js +1 -1
  93. package/dist/sdk/agent/agent-config.js +1 -1
  94. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  95. package/dist/sdk/agent/agent-yaml.js +1 -1
  96. package/dist/sdk/agent/test/evaluator.js +1 -1
  97. package/dist/sdk/agent/test/executor.js +1 -1
  98. package/dist/sdk/agent/test/index.js +1 -1
  99. package/dist/sdk/agent/test/output.js +1 -1
  100. package/dist/sdk/agent/test/parser.js +1 -1
  101. package/dist/sdk/agent/tool-target-registry.js +1 -1
  102. package/dist/sdk/api.js +1 -1
  103. package/dist/sdk/cas/cas-api-client.js +1 -1
  104. package/dist/sdk/cas/cas-audience-yaml.js +1 -1
  105. package/dist/sdk/cas/cas-segment-yaml.js +1 -1
  106. package/dist/sdk/cas/index.js +1 -1
  107. package/dist/sdk/cas/pull-workflow.js +1 -1
  108. package/dist/sdk/cas/push-workflow.js +1 -1
  109. package/dist/sdk/client/cdp-api-client.js +1 -1
  110. package/dist/sdk/client/delivery-api-client.js +1 -1
  111. package/dist/sdk/client/endpoints.js +1 -1
  112. package/dist/sdk/client/engage-api-client.js +1 -1
  113. package/dist/sdk/client/http-client.js +1 -1
  114. package/dist/sdk/client/llm-api-client.js +1 -1
  115. package/dist/sdk/client/oauth-refresh.js +1 -1
  116. package/dist/sdk/client/rate-limiter.js +1 -1
  117. package/dist/sdk/client/td-api-client.js +1 -1
  118. package/dist/sdk/client/trino-api-client.js +1 -1
  119. package/dist/sdk/client/workflow-client.js +1 -1
  120. package/dist/sdk/connection-validator.js +1 -1
  121. package/dist/sdk/connection.js +1 -1
  122. package/dist/sdk/delivery.js +1 -1
  123. package/dist/sdk/engage/campaign-pull.js +1 -1
  124. package/dist/sdk/engage/campaign-push.js +1 -1
  125. package/dist/sdk/engage/campaign-validator.js +1 -1
  126. package/dist/sdk/engage/campaign-yaml.js +1 -1
  127. package/dist/sdk/engage/template-pull.js +1 -1
  128. package/dist/sdk/engage/template-push.js +1 -1
  129. package/dist/sdk/engage/template-validator.js +1 -1
  130. package/dist/sdk/engage/template-yaml.js +1 -1
  131. package/dist/sdk/engage/types/campaign-def.js +1 -1
  132. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  133. package/dist/sdk/engage/types/template-schema.js +1 -1
  134. package/dist/sdk/engage.js +1 -1
  135. package/dist/sdk/errors.js +1 -1
  136. package/dist/sdk/index.js +1 -1
  137. package/dist/sdk/io/index.js +1 -1
  138. package/dist/sdk/io/node-filesystem.js +1 -1
  139. package/dist/sdk/job.js +1 -1
  140. package/dist/sdk/journey.js +1 -1
  141. package/dist/sdk/llm/chat-cache.js +1 -1
  142. package/dist/sdk/llm/index.js +1 -1
  143. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  144. package/dist/sdk/llm/model-factors.js +1 -1
  145. package/dist/sdk/llm/user-settings.js +1 -1
  146. package/dist/sdk/personalization.js +1 -1
  147. package/dist/sdk/policy.js +1 -1
  148. package/dist/sdk/query/deleted-table-validation.js +1 -1
  149. package/dist/sdk/query/index.js +1 -1
  150. package/dist/sdk/query/sql-parser.js +1 -1
  151. package/dist/sdk/realtime.js +1 -1
  152. package/dist/sdk/schedule.js +1 -1
  153. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  154. package/dist/sdk/segment/fields-display.js +1 -1
  155. package/dist/sdk/segment/file-discovery.js +1 -1
  156. package/dist/sdk/segment/journey-utils.js +1 -1
  157. package/dist/sdk/segment/journey-validator.js +1 -1
  158. package/dist/sdk/segment/journey-yaml.js +1 -1
  159. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  160. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  161. package/dist/sdk/segment/pull-workflow.js +1 -1
  162. package/dist/sdk/segment/push-recovery.js +1 -1
  163. package/dist/sdk/segment/push-workflow.js +1 -1
  164. package/dist/sdk/segment/resolution-context.js +1 -1
  165. package/dist/sdk/segment/segment-path-parser.js +1 -1
  166. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  167. package/dist/sdk/segment/segment-validator.js +1 -1
  168. package/dist/sdk/segment/target-resolution.js +1 -1
  169. package/dist/sdk/segment/tdx-config.js +1 -1
  170. package/dist/sdk/segment/types/activation-schema.js +1 -1
  171. package/dist/sdk/segment/types/journey-def.js +1 -1
  172. package/dist/sdk/segment/types/journey-schema.js +1 -1
  173. package/dist/sdk/segment/types/segment-def.js +1 -1
  174. package/dist/sdk/segment/types/segment-schema.js +1 -1
  175. package/dist/sdk/segment/validate-files.js +1 -1
  176. package/dist/sdk/segment/yaml-validator.js +1 -1
  177. package/dist/sdk/segment.js +1 -1
  178. package/dist/sdk/types/index.js +1 -1
  179. package/dist/sdk/types/progress.js +1 -1
  180. package/dist/sdk/types/workspace.js +1 -1
  181. package/dist/sdk/user.js +1 -1
  182. package/dist/sdk/util/format-detector.js +1 -1
  183. package/dist/sdk/util/formatters.js +1 -1
  184. package/dist/sdk/util/index.js +1 -1
  185. package/dist/sdk/util/paginate.js +1 -1
  186. package/dist/sdk/util/tree-formatter.js +1 -1
  187. package/dist/sdk/workflow/archive-validation.js +1 -1
  188. package/dist/sdk/workflow/clone-workflow.js +1 -1
  189. package/dist/sdk/workflow/index.js +1 -1
  190. package/dist/sdk/workflow/pull-workflow.js +1 -1
  191. package/dist/sdk/workflow/push-workflow.js +1 -1
  192. package/dist/sdk/workflow/task-graph.js +1 -1
  193. package/dist/sdk/workflow/tdx-config.js +1 -1
  194. package/dist/sdk/workflow/workflow-utils.js +1 -1
  195. package/dist/sdk/workspace/access-tracker.js +1 -1
  196. package/dist/sdk/workspace/frontmatter.js +1 -1
  197. package/dist/sdk/workspace/git.js +1 -1
  198. package/dist/sdk/workspace/index.js +1 -1
  199. package/dist/sdk/workspace/templates.js +1 -1
  200. package/dist/sdk/workspace/weekly.js +1 -1
  201. package/dist/sdk/workspace/wikilinks.js +1 -1
  202. package/dist/test-utils/command-runner.js +1 -1
  203. package/dist/test-utils/factories.js +1 -1
  204. package/dist/test-utils/fixtures.js +1 -1
  205. package/dist/test-utils/http-mock.js +1 -1
  206. package/dist/test-utils/index.js +1 -1
  207. package/dist/utils/async.js +1 -1
  208. package/dist/utils/colors.js +1 -1
  209. package/dist/utils/diff.js +1 -1
  210. package/dist/utils/file-permissions.js +1 -1
  211. package/dist/utils/file-reader.js +1 -1
  212. package/dist/utils/github-releases.js +1 -1
  213. package/dist/utils/global-cache.js +1 -1
  214. package/dist/utils/json-loader.js +1 -1
  215. package/dist/utils/local-cache.js +1 -1
  216. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  217. package/dist/utils/logger/formatters/index.js +1 -1
  218. package/dist/utils/logger/handlers/console-handler.js +1 -1
  219. package/dist/utils/logger/handlers/file-handler.js +1 -1
  220. package/dist/utils/logger/handlers/index.js +1 -1
  221. package/dist/utils/logger/handlers/null-handler.js +1 -1
  222. package/dist/utils/logger/index.js +1 -1
  223. package/dist/utils/logger/logger.js +1 -1
  224. package/dist/utils/logger/types.js +1 -1
  225. package/dist/utils/option-validation.js +1 -1
  226. package/dist/utils/process.js +1 -1
  227. package/dist/utils/prompt.js +1 -1
  228. package/dist/utils/spinner.js +1 -1
  229. package/dist/utils/sse-parser.js +1 -1
  230. package/dist/utils/string-utils.js +1 -1
  231. package/dist/utils/table-ref-parser.js +1 -1
  232. package/dist/utils/tdx-logger.js +1 -1
  233. package/dist/utils/version-check.js +1 -1
  234. package/package.json +1 -1
@@ -1 +1 @@
1
- const a39_0x1aab3f=a39_0x58ef;(function(_0x7dee2d,_0x1bd2ee){const _0x1f9672=a39_0x58ef,_0x3c233d=_0x7dee2d();while(!![]){try{const _0x468dcd=parseInt(_0x1f9672(0x10b))/0x1+-parseInt(_0x1f9672(0x116))/0x2*(parseInt(_0x1f9672(0x105))/0x3)+-parseInt(_0x1f9672(0x11e))/0x4*(parseInt(_0x1f9672(0x120))/0x5)+-parseInt(_0x1f9672(0x107))/0x6+-parseInt(_0x1f9672(0x104))/0x7*(-parseInt(_0x1f9672(0x114))/0x8)+parseInt(_0x1f9672(0x10e))/0x9*(parseInt(_0x1f9672(0x106))/0xa)+parseInt(_0x1f9672(0x10c))/0xb;if(_0x468dcd===_0x1bd2ee)break;else _0x3c233d['push'](_0x3c233d['shift']());}catch(_0x27b189){_0x3c233d['push'](_0x3c233d['shift']());}}}(a39_0x9361,0x3c40f));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';function a39_0x58ef(_0x40252a,_0x42825e){_0x40252a=_0x40252a-0x103;const _0x93616e=a39_0x9361();let _0x58ef6b=_0x93616e[_0x40252a];return _0x58ef6b;}function a39_0x9361(){const _0x23a24a=['Listing\x20fields\x20for\x20\x27','324UJIrBO','Parent\x20segment:\x20','error','name','execute','verbose','312ilNSNu','Error:\x20Parent\x20segment\x20name\x20is\x20required','18wEihns','length','parentSegment','listFields','segment','Usage:\x20tdx\x20segment\x20fields\x20<parent_name>','\x20field','data','20ndTJCm','description','460100yGyDen','jsonl','26621KbHzja','101259HXSIiZ','61060ErnQCe','2860026azNnHI','site','Site:\x20','\x27...','64936aFgOcu','11597058birIBE'];a39_0x9361=function(){return _0x23a24a;};return a39_0x9361();}import{displayFieldsHumanReadable}from'../sdk/segment/fields-display.js';export class SegmentFieldsCommand extends BaseCommand{[a39_0x1aab3f(0x111)]='segment:fields';[a39_0x1aab3f(0x11f)]='List\x20available\x20fields\x20for\x20segmentation';async[a39_0x1aab3f(0x112)](_0x14573e){const _0x1cb83f=a39_0x1aab3f,{options:_0x79707c,args:_0x55d8c9,tdx:_0x474a66}=_0x14573e,_0x1c387a=_0x55d8c9[0x0]||_0x79707c[_0x1cb83f(0x118)];if(!_0x1c387a)return console[_0x1cb83f(0x110)](_0x1cb83f(0x115)),console[_0x1cb83f(0x110)](_0x1cb83f(0x11b)),console['error']('\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>'),0x1;_0x79707c[_0x1cb83f(0x113)]&&(console[_0x1cb83f(0x110)](_0x1cb83f(0x109)+_0x79707c[_0x1cb83f(0x108)]),console['error'](_0x1cb83f(0x10f)+_0x1c387a));const _0x19a078=await withSpinner(_0x1cb83f(0x10d)+_0x1c387a+_0x1cb83f(0x10a),()=>_0x474a66[_0x1cb83f(0x11a)][_0x1cb83f(0x119)](_0x1c387a),{'verbose':_0x79707c[_0x1cb83f(0x113)]}),_0x13fa11=_0x19a078[_0x1cb83f(0x11d)];console[_0x1cb83f(0x110)]('✔\x20Found\x20'+_0x13fa11['length']+_0x1cb83f(0x11c)+(_0x13fa11[_0x1cb83f(0x117)]!==0x1?'s':''));if(_0x79707c['json']||_0x79707c[_0x1cb83f(0x103)])return await handleSDKOutput(_0x13fa11,_0x79707c),0x0;return displayFieldsHumanReadable(_0x13fa11,_0x1c387a),0x0;}}
1
+ const a39_0x2bade0=a39_0x33f2;(function(_0x4ce14f,_0x4b58b9){const _0x59d635=a39_0x33f2,_0x3e4cd2=_0x4ce14f();while(!![]){try{const _0x3efde5=parseInt(_0x59d635(0x184))/0x1*(parseInt(_0x59d635(0x187))/0x2)+-parseInt(_0x59d635(0x172))/0x3+parseInt(_0x59d635(0x178))/0x4*(parseInt(_0x59d635(0x16e))/0x5)+-parseInt(_0x59d635(0x16c))/0x6+-parseInt(_0x59d635(0x186))/0x7*(parseInt(_0x59d635(0x185))/0x8)+-parseInt(_0x59d635(0x16d))/0x9+parseInt(_0x59d635(0x170))/0xa;if(_0x3efde5===_0x4b58b9)break;else _0x3e4cd2['push'](_0x3e4cd2['shift']());}catch(_0x15f664){_0x3e4cd2['push'](_0x3e4cd2['shift']());}}}(a39_0x41df,0x330ff));function a39_0x33f2(_0x5aa5f9,_0x26f656){_0x5aa5f9=_0x5aa5f9-0x16c;const _0x41df02=a39_0x41df();let _0x33f29a=_0x41df02[_0x5aa5f9];return _0x33f29a;}import{BaseCommand}from'./command.js';function a39_0x41df(){const _0x444b4c=['365412WvLToa','346860RNYwng','4150RazoEe','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','1431260iFgIzm','segment:fields','281223zHJJAm','List\x20available\x20fields\x20for\x20segmentation','Parent\x20segment:\x20','Site:\x20','Listing\x20fields\x20for\x20\x27','parentSegment','1496thwBHL','error','length','json','listFields','segment','\x20field','verbose','description','name','data','\x27...','67yErZmi','8sJSOlJ','2401917DaieKe','8714tbsPCI','Usage:\x20tdx\x20segment\x20fields\x20<parent_name>','Error:\x20Parent\x20segment\x20name\x20is\x20required','site','✔\x20Found\x20'];a39_0x41df=function(){return _0x444b4c;};return a39_0x41df();}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{[a39_0x2bade0(0x181)]=a39_0x2bade0(0x171);[a39_0x2bade0(0x180)]=a39_0x2bade0(0x173);async['execute'](_0x1a3268){const _0x2e639a=a39_0x2bade0,{options:_0x5b369f,args:_0x1af08f,tdx:_0xc68279}=_0x1a3268,_0x59736c=_0x1af08f[0x0]||_0x5b369f[_0x2e639a(0x177)];if(!_0x59736c)return console['error'](_0x2e639a(0x189)),console[_0x2e639a(0x179)](_0x2e639a(0x188)),console[_0x2e639a(0x179)](_0x2e639a(0x16f)),0x1;_0x5b369f['verbose']&&(console[_0x2e639a(0x179)](_0x2e639a(0x175)+_0x5b369f[_0x2e639a(0x18a)]),console[_0x2e639a(0x179)](_0x2e639a(0x174)+_0x59736c));const _0x46351c=await withSpinner(_0x2e639a(0x176)+_0x59736c+_0x2e639a(0x183),()=>_0xc68279[_0x2e639a(0x17d)][_0x2e639a(0x17c)](_0x59736c),{'verbose':_0x5b369f[_0x2e639a(0x17f)]}),_0xeb3a6=_0x46351c[_0x2e639a(0x182)];console[_0x2e639a(0x179)](_0x2e639a(0x18b)+_0xeb3a6[_0x2e639a(0x17a)]+_0x2e639a(0x17e)+(_0xeb3a6[_0x2e639a(0x17a)]!==0x1?'s':''));if(_0x5b369f[_0x2e639a(0x17b)]||_0x5b369f['jsonl'])return await handleSDKOutput(_0xeb3a6,_0x5b369f),0x0;return displayFieldsHumanReadable(_0xeb3a6,_0x59736c),0x0;}}
@@ -1 +1 @@
1
- const a40_0x28f4c6=a40_0x5c6f;(function(_0x3feb58,_0x138234){const _0x339704=a40_0x5c6f,_0x57abc8=_0x3feb58();while(!![]){try{const _0x4ea70c=-parseInt(_0x339704(0x172))/0x1*(-parseInt(_0x339704(0x142))/0x2)+-parseInt(_0x339704(0x13a))/0x3+-parseInt(_0x339704(0x12e))/0x4+-parseInt(_0x339704(0x153))/0x5*(parseInt(_0x339704(0x159))/0x6)+-parseInt(_0x339704(0x16a))/0x7+-parseInt(_0x339704(0x14d))/0x8*(parseInt(_0x339704(0x147))/0x9)+parseInt(_0x339704(0x151))/0xa;if(_0x4ea70c===_0x138234)break;else _0x57abc8['push'](_0x57abc8['shift']());}catch(_0x5a5c90){_0x57abc8['push'](_0x57abc8['shift']());}}}(a40_0x4fed,0x311fd));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_0x57eed1 from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';import a40_0x496a99 from'path';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';export{buildFolderIdToPathMap as buildFolderPathMap}from'../sdk/segment/resolution-context.js';function a40_0x5c6f(_0x562f30,_0x5ad2b2){_0x562f30=_0x562f30-0x12c;const _0x4fed0a=a40_0x4fed();let _0x5c6f27=_0x4fed0a[_0x562f30];return _0x5c6f27;}export class SegmentPullCommand extends BaseCommand{[a40_0x28f4c6(0x14e)]=a40_0x28f4c6(0x138);['description']='Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files';async[a40_0x28f4c6(0x16c)](_0x180dc7){const _0x1e52ac=a40_0x28f4c6,{options:_0x10378b,args:_0x4ffc24,tdx:_0x205f97}=_0x180dc7,_0x239f1d=_0x10378b,_0x4d8fe6=await resolveTarget({'arg':_0x4ffc24[0x0],'contextParent':_0x10378b[_0x1e52ac(0x163)],'cwd':process[_0x1e52ac(0x14f)]()});if(!isSuccessfulResolution(_0x4d8fe6))return _0x4d8fe6[_0x1e52ac(0x16b)]===_0x1e52ac(0x148)?(console[_0x1e52ac(0x157)](a40_0x57eed1[_0x1e52ac(0x145)](_0x1e52ac(0x17b))),console[_0x1e52ac(0x157)](_0x1e52ac(0x15a)),console[_0x1e52ac(0x157)](_0x1e52ac(0x156)),console[_0x1e52ac(0x157)](_0x1e52ac(0x158))):(console[_0x1e52ac(0x157)](a40_0x57eed1['red']('Error:\x20'+_0x4d8fe6[_0x1e52ac(0x13f)]+'\x0a')),_0x4d8fe6[_0x1e52ac(0x155)]&&console[_0x1e52ac(0x157)](a40_0x57eed1['cyan'](_0x4d8fe6[_0x1e52ac(0x155)]))),0x1;const _0x5dc365=_0x4d8fe6[_0x1e52ac(0x173)],_0x4c9258=_0x4d8fe6[_0x1e52ac(0x161)],_0x309171=_0x4d8fe6[_0x1e52ac(0x134)]===_0x1e52ac(0x16d)?_0x4d8fe6[_0x1e52ac(0x168)]:undefined;_0x239f1d[_0x1e52ac(0x137)]&&(console[_0x1e52ac(0x157)](_0x1e52ac(0x146)+_0x239f1d[_0x1e52ac(0x16e)]),console[_0x1e52ac(0x157)]('Parent\x20segment:\x20'+_0x5dc365),_0x309171&&console[_0x1e52ac(0x157)](_0x1e52ac(0x139)+_0x309171));const _0x31dea2=await withProgressSpinner(_0x1e52ac(0x133)+_0x5dc365+'\x27...',_0x52fdbb=>_0x205f97[_0x1e52ac(0x17c)][_0x1e52ac(0x141)](_0x5dc365,{'targetDir':_0x4c9258,'targetResourceName':_0x309171,'verbose':_0x239f1d[_0x1e52ac(0x137)],'progress':{'update':_0x1108c6=>{const _0x3f16d2=_0x1e52ac;_0x52fdbb[_0x3f16d2(0x140)](_0x1108c6),_0x239f1d[_0x3f16d2(0x137)]&&console[_0x3f16d2(0x157)]('\x20\x20'+_0x1108c6);}}}),{'verbose':_0x239f1d[_0x1e52ac(0x137)]}),_0x2d4610=_0x31dea2[_0x1e52ac(0x165)];if(_0x2d4610[_0x1e52ac(0x17d)][_0x1e52ac(0x12f)]===0x0&&_0x2d4610[_0x1e52ac(0x17d)]['journeys']===0x0)return console[_0x1e52ac(0x157)](a40_0x57eed1['yellow']('No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27'+_0x2d4610[_0x1e52ac(0x173)]+'\x27')),0x0;const _0x10f69e=_0x2d4610['files'][_0x1e52ac(0x13d)](_0x31c8a2=>_0x31c8a2[_0x1e52ac(0x167)]),_0x40d163=_0x2d4610[_0x1e52ac(0x15d)][_0x1e52ac(0x13d)](_0x45ba4d=>!_0x45ba4d[_0x1e52ac(0x167)]&&_0x45ba4d[_0x1e52ac(0x176)]),_0x1d3784=_0x2d4610[_0x1e52ac(0x15d)][_0x1e52ac(0x13d)](_0x4fd7a4=>!_0x4fd7a4[_0x1e52ac(0x167)]&&!_0x4fd7a4[_0x1e52ac(0x176)]);console[_0x1e52ac(0x157)](_0x1e52ac(0x15b)+_0x2d4610[_0x1e52ac(0x173)]+'\x27:'),console[_0x1e52ac(0x157)]('\x20\x20🎯\x20'+a40_0x57eed1[_0x1e52ac(0x132)](_0x2d4610[_0x1e52ac(0x17d)][_0x1e52ac(0x12f)]+_0x1e52ac(0x130))+_0x1e52ac(0x135)+a40_0x57eed1[_0x1e52ac(0x132)](_0x2d4610['counts'][_0x1e52ac(0x162)]+_0x1e52ac(0x154)));if(_0x2d4610[_0x1e52ac(0x17d)][_0x1e52ac(0x175)]>0x0){const _0x1d9695=_0x2d4610[_0x1e52ac(0x17d)][_0x1e52ac(0x166)]>_0x2d4610[_0x1e52ac(0x17d)]['journeys']?'\x20('+_0x2d4610['counts'][_0x1e52ac(0x166)]+_0x1e52ac(0x152):'';console[_0x1e52ac(0x157)](_0x1e52ac(0x13e)+a40_0x57eed1[_0x1e52ac(0x132)](_0x2d4610['counts']['journeys']+_0x1e52ac(0x14a))+a40_0x57eed1[_0x1e52ac(0x15c)](_0x1d9695));}console[_0x1e52ac(0x157)]('\x20\x20'+a40_0x57eed1[_0x1e52ac(0x12d)]('+\x20'+_0x10f69e[_0x1e52ac(0x15e)]+_0x1e52ac(0x131))),console[_0x1e52ac(0x157)]('\x20\x20'+a40_0x57eed1['yellow']('~\x20'+_0x40d163[_0x1e52ac(0x15e)]+'\x20changed\x20files')),console['error']('\x20\x20'+a40_0x57eed1[_0x1e52ac(0x15c)]('=\x20'+_0x1d3784['length']+'\x20unchanged\x20files')),console[_0x1e52ac(0x157)]('\x20\x20Target:\x20'+a40_0x57eed1[_0x1e52ac(0x132)](_0x2d4610['targetDir'])+'\x0a');if(_0x40d163[_0x1e52ac(0x15e)]>0x0)for(const _0x4a22c7 of _0x40d163){console[_0x1e52ac(0x157)](_0x1e52ac(0x160)+_0x4a22c7[_0x1e52ac(0x13c)]+'\x27:'),console[_0x1e52ac(0x157)]('─'[_0x1e52ac(0x17a)](0x3c)),console['error'](_0x4a22c7['diff']),console[_0x1e52ac(0x157)]('─'[_0x1e52ac(0x17a)](0x3c));}if(_0x239f1d[_0x1e52ac(0x150)])return console['error'](a40_0x57eed1['yellow'](_0x1e52ac(0x178))),0x0;if(_0x10f69e[_0x1e52ac(0x15e)]===0x0&&_0x40d163[_0x1e52ac(0x15e)]===0x0)return console['error'](a40_0x57eed1['green'](_0x1e52ac(0x149))),saveSessionContext({'parent_segment':_0x2d4610[_0x1e52ac(0x173)]},_0x239f1d[_0x1e52ac(0x15f)]),console[_0x1e52ac(0x157)](a40_0x57eed1[_0x1e52ac(0x12d)](_0x1e52ac(0x16f)+a40_0x57eed1[_0x1e52ac(0x15c)](_0x1e52ac(0x177))+'\x20=\x20'+a40_0x57eed1[_0x1e52ac(0x132)](_0x2d4610[_0x1e52ac(0x173)]))),0x0;if(!_0x239f1d[_0x1e52ac(0x170)]){if(!isInteractive())return console[_0x1e52ac(0x157)](a40_0x57eed1[_0x1e52ac(0x179)](_0x1e52ac(0x14c)),_0x1e52ac(0x171)),console[_0x1e52ac(0x157)](a40_0x57eed1[_0x1e52ac(0x15c)](_0x1e52ac(0x169))),0x1;const _0x2a055d=await confirmKey('Write\x20'+(_0x10f69e[_0x1e52ac(0x15e)]+_0x40d163[_0x1e52ac(0x15e)])+_0x1e52ac(0x17e));if(!_0x2a055d)return console[_0x1e52ac(0x157)](a40_0x57eed1[_0x1e52ac(0x145)](_0x1e52ac(0x13b)),_0x1e52ac(0x14b)),0x1;}for(const _0x2064a7 of _0x2d4610[_0x1e52ac(0x15d)]){if(_0x2064a7[_0x1e52ac(0x167)]||_0x2064a7[_0x1e52ac(0x176)]){const _0x418d36=a40_0x496a99[_0x1e52ac(0x144)](_0x2064a7['absolutePath']);!existsSync(_0x418d36)&&mkdirSync(_0x418d36,{'recursive':!![]}),writeFileSync(_0x2064a7[_0x1e52ac(0x143)],_0x2064a7[_0x1e52ac(0x164)],'utf-8');}}return console[_0x1e52ac(0x157)](a40_0x57eed1[_0x1e52ac(0x12d)](_0x1e52ac(0x174)+(_0x10f69e[_0x1e52ac(0x15e)]+_0x40d163[_0x1e52ac(0x15e)])+_0x1e52ac(0x12c)+_0x2d4610[_0x1e52ac(0x161)])),saveSessionContext({'parent_segment':_0x2d4610[_0x1e52ac(0x173)]},_0x239f1d[_0x1e52ac(0x15f)]),console[_0x1e52ac(0x157)](a40_0x57eed1[_0x1e52ac(0x12d)]('✔\x20Context\x20set:\x20'+a40_0x57eed1['dim'](_0x1e52ac(0x177))+_0x1e52ac(0x136)+a40_0x57eed1[_0x1e52ac(0x132)](_0x2d4610[_0x1e52ac(0x173)]))),0x0;}}function a40_0x4fed(){const _0x49c918=['counts','\x20files?','\x20files\x20to\x20','green','933428uZGmrU','segments','\x20segments','\x20new\x20files','cyan','Pulling\x20segments\x20from\x20\x27','type','\x20with\x20','\x20=\x20','verbose','segment:pull','Target\x20resource:\x20','184635IlPSDa','Aborted.','relativePath','filter','\x20\x20🗺️\x20\x20','message','setPhase','pullSegments','14QcQinr','absolutePath','dirname','yellow','Site:\x20','1251GZCzzt','no_parent','✔\x20All\x20files\x20are\x20up\x20to\x20date','\x20journeys','-\x20no\x20files\x20written','\x0aError:','7928RXhVNQ','name','cwd','dryRun','6641660HrnngI','\x20versions)','800LCvvqA','\x20activations','helpText','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent','error','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file','3252NbDiRd','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)','\x0aPull\x20summary\x20for\x20\x27','dim','files','length','session','\x0aChanges\x20to\x20\x27','targetDir','activations','parentSegment','content','data','journeyVersions','isNew','resourceName','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','2236913uzLlgF','errorCode','execute','file','site','✔\x20Context\x20set:\x20','yes','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','53711bddutl','parentName','✔\x20Pulled\x20','journeys','hasChanges','parent_segment','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','red','repeat','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','segment'];a40_0x4fed=function(){return _0x49c918;};return a40_0x4fed();}
1
+ const a40_0x5232c0=a40_0x59e5;(function(_0x423bc7,_0x1f4f03){const _0x6c3a9e=a40_0x59e5,_0x4aebc1=_0x423bc7();while(!![]){try{const _0x3b434d=parseInt(_0x6c3a9e(0x9b))/0x1*(-parseInt(_0x6c3a9e(0xbc))/0x2)+parseInt(_0x6c3a9e(0x76))/0x3*(-parseInt(_0x6c3a9e(0x73))/0x4)+-parseInt(_0x6c3a9e(0x94))/0x5+-parseInt(_0x6c3a9e(0x91))/0x6*(parseInt(_0x6c3a9e(0x82))/0x7)+-parseInt(_0x6c3a9e(0xb0))/0x8+parseInt(_0x6c3a9e(0xb2))/0x9+-parseInt(_0x6c3a9e(0x7d))/0xa*(-parseInt(_0x6c3a9e(0xaa))/0xb);if(_0x3b434d===_0x1f4f03)break;else _0x4aebc1['push'](_0x4aebc1['shift']());}catch(_0x562f18){_0x4aebc1['push'](_0x4aebc1['shift']());}}}(a40_0x514f,0xd68b9));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';function a40_0x514f(){const _0x4a57c3=['type','session','hasChanges','repeat','6658280hVIFxt','content','10258677MnkWtf','message','\x20\x20🎯\x20','diff','pullSegments','site','dim','\x20files?','parentSegment','segments','35122QWJKPC','errorCode','\x20=\x20','✔\x20Context\x20set:\x20','filter','utf-8','36BGLnFf','verbose','isNew','402447QgBXqt','\x20unchanged\x20files','file','Pulling\x20segments\x20from\x20\x27','setPhase','segment:pull','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','107340IjrbeF','journeys','\x20segments','\x20with\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent','7NoyUBi','cwd','yellow','parent_segment','files','yes','Parent\x20segment:\x20','name','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file','\x0aError:','\x20new\x20files','resourceName','Aborted.','red','helpText','8286384JlvQAi','description','parentName','3646095tRRSDC','cyan','Error:\x20','activations','\x20changed\x20files','length','targetDir','53QBOzot','journeyVersions','dirname','error','green','dryRun','\x20activations','✔\x20Pulled\x20','absolutePath','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)','\x20\x20Target:\x20','Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files','No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27','Target\x20resource:\x20','counts','4939MuQLKc','Site:\x20'];a40_0x514f=function(){return _0x4a57c3;};return a40_0x514f();}import{saveSessionContext}from'../core/session.js';import a40_0x50447e from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';import a40_0x4fd33b from'path';function a40_0x59e5(_0x8ad4fc,_0x5d830e){_0x8ad4fc=_0x8ad4fc-0x72;const _0x514f66=a40_0x514f();let _0x59e5e8=_0x514f66[_0x8ad4fc];return _0x59e5e8;}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_0x5232c0(0x89)]=a40_0x5232c0(0x7b);[a40_0x5232c0(0x92)]=a40_0x5232c0(0xa6);async['execute'](_0x346328){const _0x2fac19=a40_0x5232c0,{options:_0x3e1a9a,args:_0xde05ec,tdx:_0x487c82}=_0x346328,_0x3b9407=_0x3e1a9a,_0x5046e5=await resolveTarget({'arg':_0xde05ec[0x0],'contextParent':_0x3e1a9a[_0x2fac19(0xba)],'cwd':process[_0x2fac19(0x83)]()});if(!isSuccessfulResolution(_0x5046e5))return _0x5046e5[_0x2fac19(0xbd)]==='no_parent'?(console['error'](a40_0x50447e[_0x2fac19(0x84)](_0x2fac19(0x7c))),console[_0x2fac19(0x9e)](_0x2fac19(0xa4)),console[_0x2fac19(0x9e)](_0x2fac19(0x81)),console[_0x2fac19(0x9e)](_0x2fac19(0x8a))):(console[_0x2fac19(0x9e)](a40_0x50447e['red'](_0x2fac19(0x96)+_0x5046e5[_0x2fac19(0xb3)]+'\x0a')),_0x5046e5[_0x2fac19(0x90)]&&console['error'](a40_0x50447e['cyan'](_0x5046e5[_0x2fac19(0x90)]))),0x1;const _0x48eee1=_0x5046e5[_0x2fac19(0x93)],_0x1065d4=_0x5046e5['targetDir'],_0x29a24a=_0x5046e5[_0x2fac19(0xac)]===_0x2fac19(0x78)?_0x5046e5[_0x2fac19(0x8d)]:undefined;_0x3b9407[_0x2fac19(0x74)]&&(console[_0x2fac19(0x9e)](_0x2fac19(0xab)+_0x3b9407[_0x2fac19(0xb7)]),console[_0x2fac19(0x9e)](_0x2fac19(0x88)+_0x48eee1),_0x29a24a&&console[_0x2fac19(0x9e)](_0x2fac19(0xa8)+_0x29a24a));const _0x232f55=await withProgressSpinner(_0x2fac19(0x79)+_0x48eee1+'\x27...',_0x3a9efa=>_0x487c82['segment'][_0x2fac19(0xb6)](_0x48eee1,{'targetDir':_0x1065d4,'targetResourceName':_0x29a24a,'verbose':_0x3b9407[_0x2fac19(0x74)],'progress':{'update':_0x116eba=>{const _0x45c40a=_0x2fac19;_0x3a9efa[_0x45c40a(0x7a)](_0x116eba),_0x3b9407['verbose']&&console[_0x45c40a(0x9e)]('\x20\x20'+_0x116eba);}}}),{'verbose':_0x3b9407['verbose']}),_0x3868a4=_0x232f55['data'];if(_0x3868a4[_0x2fac19(0xa9)][_0x2fac19(0xbb)]===0x0&&_0x3868a4[_0x2fac19(0xa9)][_0x2fac19(0x7e)]===0x0)return console[_0x2fac19(0x9e)](a40_0x50447e[_0x2fac19(0x84)](_0x2fac19(0xa7)+_0x3868a4[_0x2fac19(0x93)]+'\x27')),0x0;const _0x329d11=_0x3868a4[_0x2fac19(0x86)][_0x2fac19(0xc0)](_0x207429=>_0x207429[_0x2fac19(0x75)]),_0x54f9b8=_0x3868a4[_0x2fac19(0x86)][_0x2fac19(0xc0)](_0x586124=>!_0x586124['isNew']&&_0x586124[_0x2fac19(0xae)]),_0x30d83b=_0x3868a4['files'][_0x2fac19(0xc0)](_0x3de524=>!_0x3de524['isNew']&&!_0x3de524[_0x2fac19(0xae)]);console[_0x2fac19(0x9e)]('\x0aPull\x20summary\x20for\x20\x27'+_0x3868a4[_0x2fac19(0x93)]+'\x27:'),console[_0x2fac19(0x9e)](_0x2fac19(0xb4)+a40_0x50447e[_0x2fac19(0x95)](_0x3868a4[_0x2fac19(0xa9)]['segments']+_0x2fac19(0x7f))+_0x2fac19(0x80)+a40_0x50447e['cyan'](_0x3868a4['counts'][_0x2fac19(0x97)]+_0x2fac19(0xa1)));if(_0x3868a4[_0x2fac19(0xa9)][_0x2fac19(0x7e)]>0x0){const _0x4ce454=_0x3868a4[_0x2fac19(0xa9)][_0x2fac19(0x9c)]>_0x3868a4[_0x2fac19(0xa9)][_0x2fac19(0x7e)]?'\x20('+_0x3868a4[_0x2fac19(0xa9)][_0x2fac19(0x9c)]+'\x20versions)':'';console[_0x2fac19(0x9e)]('\x20\x20🗺️\x20\x20'+a40_0x50447e[_0x2fac19(0x95)](_0x3868a4[_0x2fac19(0xa9)]['journeys']+'\x20journeys')+a40_0x50447e[_0x2fac19(0xb8)](_0x4ce454));}console[_0x2fac19(0x9e)]('\x20\x20'+a40_0x50447e[_0x2fac19(0x9f)]('+\x20'+_0x329d11[_0x2fac19(0x99)]+_0x2fac19(0x8c))),console[_0x2fac19(0x9e)]('\x20\x20'+a40_0x50447e[_0x2fac19(0x84)]('~\x20'+_0x54f9b8[_0x2fac19(0x99)]+_0x2fac19(0x98))),console[_0x2fac19(0x9e)]('\x20\x20'+a40_0x50447e['dim']('=\x20'+_0x30d83b[_0x2fac19(0x99)]+_0x2fac19(0x77))),console[_0x2fac19(0x9e)](_0x2fac19(0xa5)+a40_0x50447e[_0x2fac19(0x95)](_0x3868a4[_0x2fac19(0x9a)])+'\x0a');if(_0x54f9b8[_0x2fac19(0x99)]>0x0)for(const _0x1526ff of _0x54f9b8){console[_0x2fac19(0x9e)]('\x0aChanges\x20to\x20\x27'+_0x1526ff['relativePath']+'\x27:'),console[_0x2fac19(0x9e)]('─'[_0x2fac19(0xaf)](0x3c)),console['error'](_0x1526ff[_0x2fac19(0xb5)]),console[_0x2fac19(0x9e)]('─'[_0x2fac19(0xaf)](0x3c));}if(_0x3b9407[_0x2fac19(0xa0)])return console[_0x2fac19(0x9e)](a40_0x50447e[_0x2fac19(0x84)]('\x0a[Dry\x20run]\x20No\x20files\x20were\x20written')),0x0;if(_0x329d11[_0x2fac19(0x99)]===0x0&&_0x54f9b8[_0x2fac19(0x99)]===0x0)return console[_0x2fac19(0x9e)](a40_0x50447e['green']('✔\x20All\x20files\x20are\x20up\x20to\x20date')),saveSessionContext({'parent_segment':_0x3868a4[_0x2fac19(0x93)]},_0x3b9407['session']),console['error'](a40_0x50447e[_0x2fac19(0x9f)](_0x2fac19(0xbf)+a40_0x50447e[_0x2fac19(0xb8)](_0x2fac19(0x85))+_0x2fac19(0xbe)+a40_0x50447e[_0x2fac19(0x95)](_0x3868a4[_0x2fac19(0x93)]))),0x0;if(!_0x3b9407[_0x2fac19(0x87)]){if(!isInteractive())return console[_0x2fac19(0x9e)](a40_0x50447e[_0x2fac19(0x8f)](_0x2fac19(0x8b)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x2fac19(0x9e)](a40_0x50447e[_0x2fac19(0xb8)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x544b2c=await confirmKey('Write\x20'+(_0x329d11[_0x2fac19(0x99)]+_0x54f9b8[_0x2fac19(0x99)])+_0x2fac19(0xb9));if(!_0x544b2c)return console[_0x2fac19(0x9e)](a40_0x50447e[_0x2fac19(0x84)](_0x2fac19(0x8e)),'-\x20no\x20files\x20written'),0x1;}for(const _0x393502 of _0x3868a4[_0x2fac19(0x86)]){if(_0x393502[_0x2fac19(0x75)]||_0x393502['hasChanges']){const _0x458412=a40_0x4fd33b[_0x2fac19(0x9d)](_0x393502[_0x2fac19(0xa3)]);!existsSync(_0x458412)&&mkdirSync(_0x458412,{'recursive':!![]}),writeFileSync(_0x393502['absolutePath'],_0x393502[_0x2fac19(0xb1)],_0x2fac19(0x72));}}return console[_0x2fac19(0x9e)](a40_0x50447e[_0x2fac19(0x9f)](_0x2fac19(0xa2)+(_0x329d11[_0x2fac19(0x99)]+_0x54f9b8['length'])+'\x20files\x20to\x20'+_0x3868a4[_0x2fac19(0x9a)])),saveSessionContext({'parent_segment':_0x3868a4[_0x2fac19(0x93)]},_0x3b9407[_0x2fac19(0xad)]),console[_0x2fac19(0x9e)](a40_0x50447e[_0x2fac19(0x9f)](_0x2fac19(0xbf)+a40_0x50447e['dim'](_0x2fac19(0x85))+_0x2fac19(0xbe)+a40_0x50447e[_0x2fac19(0x95)](_0x3868a4[_0x2fac19(0x93)]))),0x0;}}
@@ -1 +1 @@
1
- const a41_0x2630ef=a41_0x3235;(function(_0x30f908,_0x5eb8e7){const _0x1c0fa8=a41_0x3235,_0x2741db=_0x30f908();while(!![]){try{const _0x32b353=parseInt(_0x1c0fa8(0x204))/0x1*(-parseInt(_0x1c0fa8(0x1f9))/0x2)+parseInt(_0x1c0fa8(0x1af))/0x3*(parseInt(_0x1c0fa8(0x1fa))/0x4)+parseInt(_0x1c0fa8(0x1ae))/0x5*(parseInt(_0x1c0fa8(0x1ad))/0x6)+parseInt(_0x1c0fa8(0x1d7))/0x7+-parseInt(_0x1c0fa8(0x220))/0x8+-parseInt(_0x1c0fa8(0x22b))/0x9*(-parseInt(_0x1c0fa8(0x1b0))/0xa)+-parseInt(_0x1c0fa8(0x1b7))/0xb;if(_0x32b353===_0x5eb8e7)break;else _0x2741db['push'](_0x2741db['shift']());}catch(_0x219806){_0x2741db['push'](_0x2741db['shift']());}}}(a41_0x5499,0x21a75));import{BaseCommand}from'./command.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';function a41_0x5499(){const _0x1cf227=['createdAt','message','updatedAt','unchanged','journeyBundleName','versionNumber','1167039bSWZDN','user','join','repeat','parentSegment','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','paused','dim','diff','map','Error\x20parsing\x20YAML:\x20','delete','\x27...','then','\x20deleted','parentFolder','\x20\x20Source:\x20','red','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','existingJourney','filePath','toDelete','New\x20segment:','activations','blue','journeys','site','dryRun','toCreate','yamlConfig','\x20\x20Activations:\x20','/e/','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)','scopedFolderPath','helpText','✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','errorCode','20766pKRIvn','385QgRHLu','26085ttHXiK','20zszqiO','segments','data','folders','cwd','\x20unchanged','updated','421542emNIBY','yes','error','file','Parent\x20segment:\x20','\x0aError:','.yaml','\x20to\x20update','length','state','Aborted.','folderPath','getOutputSchemaWithCache','journey','parentName','\x20to\x20create','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','\x20\x20🗺️\x20\x20Journeys:','getJourney','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','type','execute','no_parent','No\x20','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','journeysOnly','name','\x20to\x20delete','nameToId','\x20YAML\x20files\x20found','green','Error:\x20Directory\x20not\x20found:\x20','148596ZLraSD','nameToType','\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20','toUpdate','\x0aValidation\x20failed:','New\x20journey:','\x20\x20Segments:\x20','\x20new','getParent','(Journey\x20will\x20be\x20deleted)','Fetching\x20existing\x20data...','Delete\x20journey:','listActivations','Scoped\x20to\x20folder:\x20','\x0aPush\x20summary\x20for\x20\x27','results','setPhase','/app/ps/','yellow','filter','Source\x20directory:\x20','add','buildUserMaps','resolveParentId','created','/sb/da/esr','\x20activations]','targetDir','\x20changed','audienceId','\x20\x20\x20\x20','list','existingSegment','\x20created','2DXxNPo','4bXTHRz','\x20\x20Journeys:\x20','listSegments','Push\x20','segmentFolderId','folderId','deleted','toString','listFolders','endsWith','119057PFigyE','\x0a✔\x20Push\x20complete','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','attributes','changed','all','isScoped','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','Changes\x20to\x20journey:','\x20changes?','journeyId','cyan','set','📁\x20','\x20folders\x20to\x20create','connection','.yml','segment','\x20updated','push','verbose','✔\x20All\x20journeys\x20are\x20up\x20to\x20date','idToName','get','Site:\x20','parent_name','Changes\x20to:','2084304IxhHix','/j/da/je','Preparing\x20journeys...','segment\x20or\x20journey','createdSegmentIds'];a41_0x5499=function(){return _0x1cf227;};return a41_0x5499();}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_0x4b7560 from'chalk';import{existsSync}from'fs';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';function a41_0x3235(_0x116129,_0x319a2c){_0x116129=_0x116129-0x1a3;const _0x54994e=a41_0x5499();let _0x3235ca=_0x54994e[_0x116129];return _0x3235ca;}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_0x2630ef(0x1d1)]='segment:push';['description']='Push\x20YAML\x20files\x20to\x20Treasure\x20AI\x20as\x20child\x20segments';async[a41_0x2630ef(0x1cc)](_0x17b97d){const _0x144808=a41_0x2630ef,{options:_0x522c50,args:_0x5cc4d1,tdx:_0x5c4431}=_0x17b97d,_0x469508=_0x522c50,_0x3e9e1b=await resolveTarget({'arg':_0x5cc4d1[0x0],'contextParent':_0x522c50[_0x144808(0x22f)],'cwd':process[_0x144808(0x1b4)]()});if(!isSuccessfulResolution(_0x3e9e1b))return _0x3e9e1b[_0x144808(0x1ac)]===_0x144808(0x1cd)?(console[_0x144808(0x1b9)](a41_0x4b7560[_0x144808(0x1e9)]('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console[_0x144808(0x1b9)](_0x144808(0x1a8)),console[_0x144808(0x1b9)](_0x144808(0x1c7)),console[_0x144808(0x1b9)]('\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[_0x144808(0x1b9)](a41_0x4b7560[_0x144808(0x23c)]('Error:\x20'+_0x3e9e1b[_0x144808(0x226)]+'\x0a')),_0x3e9e1b[_0x144808(0x1aa)]&&console[_0x144808(0x1b9)](a41_0x4b7560[_0x144808(0x210)](_0x3e9e1b[_0x144808(0x1aa)]))),0x1;if(_0x3e9e1b[_0x144808(0x1cb)]===_0x144808(0x21e))return console[_0x144808(0x1b9)](a41_0x4b7560[_0x144808(0x23c)](_0x144808(0x1d6)+_0x3e9e1b[_0x144808(0x1f2)]+'\x0a')),console[_0x144808(0x1b9)](a41_0x4b7560['cyan'](_0x144808(0x20b))),0x1;const _0x5884fe=_0x3e9e1b[_0x144808(0x1c5)],_0x2df33b=_0x3e9e1b['targetDir'],_0x5f027c=_0x3e9e1b[_0x144808(0x1cb)]===_0x144808(0x1ba)?_0x3e9e1b[_0x144808(0x23f)]:undefined,_0x13f9bb=getScopedDetails(_0x3e9e1b),_0x4d88b6=_0x13f9bb?.[_0x144808(0x20a)]??![],_0x4b6be3=_0x13f9bb?.[_0x144808(0x1a9)]??'';if(!existsSync(_0x2df33b))return console[_0x144808(0x1b9)](a41_0x4b7560['red'](_0x144808(0x1d6)+_0x2df33b+'\x0a')),console[_0x144808(0x1b9)](a41_0x4b7560[_0x144808(0x210)](_0x144808(0x20b))),0x1;_0x469508[_0x144808(0x219)]&&(console['error'](_0x144808(0x21d)+_0x469508[_0x144808(0x245)]),console[_0x144808(0x1b9)](_0x144808(0x1bb)+_0x5884fe),console[_0x144808(0x1b9)](_0x144808(0x1eb)+_0x2df33b),_0x4d88b6&&console[_0x144808(0x1b9)](_0x144808(0x1e4)+_0x4b6be3));const _0x45f302=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x5884fe+_0x144808(0x237),()=>_0x5c4431['segment'][_0x144808(0x1ee)](_0x5884fe),{'verbose':_0x469508[_0x144808(0x219)]}),_0x264fc1=_0x45f302[_0x144808(0x1b2)],{parentSegmentResult:_0xc305d6,segmentsResult:_0x2a9979,foldersResult:_0x57f9c6,journeysWithDetailsResult:_0x155b06,userMaps:_0x253ef3}=await withSpinner(_0x144808(0x1e1),async()=>{const _0x3d7cac=_0x144808,[_0x124fd5,_0x59fa18,_0x1eead2,_0x59fc3c,_0x4a8877]=await Promise[_0x3d7cac(0x209)]([_0x5c4431[_0x3d7cac(0x216)][_0x3d7cac(0x1df)](_0x264fc1),_0x5c4431['segment'][_0x3d7cac(0x1fc)](_0x264fc1),_0x5c4431[_0x3d7cac(0x216)][_0x3d7cac(0x202)](_0x264fc1),_0x5c4431[_0x3d7cac(0x1c4)]['listJourneysWithDetailsFromParentSegment'](_0x264fc1,{'includeAllVersions':!![]}),_0x5c4431[_0x3d7cac(0x22c)][_0x3d7cac(0x1ed)]()]);return{'parentSegmentResult':_0x124fd5,'segmentsResult':_0x59fa18,'foldersResult':_0x1eead2,'journeysWithDetailsResult':_0x59fc3c,'userMaps':_0x4a8877};},{'verbose':_0x469508['verbose']})[_0x144808(0x238)](_0xb0b2e4=>_0xb0b2e4[_0x144808(0x1b2)]),_0x435baa=_0xc305d6,_0x21950f=extractRootFolderId(_0x435baa),_0x29c75e=_0x2a9979,_0x236e02=_0x57f9c6,{journeys:_0x4a5015,activationStepsById:_0x30454d}=_0x155b06,_0x515f15=new Map(_0x4a5015[_0x144808(0x234)](_0x2c3de8=>[_0x2c3de8['id'],_0x2c3de8])),_0x3f1f1c=_0x4a5015['map'](_0x4b6879=>({'id':_0x4b6879['id'],'name':_0x4b6879['attributes']['name'],'journeyBundleName':_0x4b6879[_0x144808(0x207)][_0x144808(0x229)]||'','journeyBundleId':_0x4b6879[_0x144808(0x207)]['journeyBundleId']||'','versionNumber':_0x4b6879[_0x144808(0x207)][_0x144808(0x22a)],'description':_0x4b6879[_0x144808(0x207)]['description'],'state':_0x4b6879[_0x144808(0x207)][_0x144808(0x1c0)],'paused':_0x4b6879[_0x144808(0x207)][_0x144808(0x231)],'audienceId':_0x4b6879[_0x144808(0x207)][_0x144808(0x1f4)],'folderId':_0x4b6879['relationships']?.[_0x144808(0x23a)]?.[_0x144808(0x1b2)]?.['id'],'createdAt':_0x4b6879['attributes'][_0x144808(0x225)],'updatedAt':_0x4b6879[_0x144808(0x207)][_0x144808(0x227)]})),{emailToId:_0x3bd6f4,idToEmail:_0x49e3bf}=_0x253ef3,_0x5b1faa=await withSpinner('Fetching\x20connections\x20for\x20name\x20resolution...',async()=>{const _0x292bf1=_0x144808,_0x4cd2de=await _0x5c4431[_0x292bf1(0x214)][_0x292bf1(0x1f6)]();return buildConnectionMaps(_0x4cd2de);},{'verbose':_0x469508[_0x144808(0x219)]})[_0x144808(0x238)](_0xedc400=>_0xedc400['data']),_0x3a33b3=_0x5b1faa['nameToId'],_0x7e06f9=_0x5b1faa['idToName'],_0x4b20ef=_0x5b1faa[_0x144808(0x1d8)],_0x119efc={'emailToIdMap':_0x3bd6f4,'connectionNameToIdMap':_0x3a33b3,'connectionNameToTypeMap':_0x4b20ef,'getSchema':_0x59cbf9=>_0x5c4431[_0x144808(0x214)][_0x144808(0x1c3)](_0x59cbf9)};let {pathToId:_0x23f319,idToPath:_0x256f45}=buildFolderMaps(_0x236e02);const _0x944acb=buildSegmentLookupMap(_0x29c75e,_0x256f45),_0x5c20c8=buildSegmentNameToIdMap(_0x29c75e),_0x3dde10=buildJourneyBundleLookupMap(_0x3f1f1c,_0x256f45);let _0x4bdbf9;if(_0x5f027c){if(!_0x5f027c['endsWith'](_0x144808(0x215))&&!_0x5f027c[_0x144808(0x203)](_0x144808(0x1bd)))return console[_0x144808(0x1b9)](a41_0x4b7560[_0x144808(0x23c)](_0x144808(0x1ca)+_0x5f027c+'\x0a')),0x1;_0x4bdbf9=[_0x5f027c];}else _0x4bdbf9=findYamlFiles(_0x2df33b);if(_0x4bdbf9['length']===0x0)return console[_0x144808(0x1b9)](a41_0x4b7560[_0x144808(0x23c)](_0x144808(0x1cf)+_0x2df33b+'\x0a')),console[_0x144808(0x1b9)](a41_0x4b7560[_0x144808(0x210)](_0x144808(0x20c))),0x1;let _0x5e9883,_0x2a4686;try{const _0xdc56e6=parseAndClassifyYamlFiles(_0x4bdbf9,_0x2df33b,{'skipSegments':_0x469508[_0x144808(0x1d0)]});_0x5e9883=_0xdc56e6[_0x144808(0x1b1)],_0x2a4686=_0xdc56e6['journeys'];const _0x9b09a7=validateParsedFiles(_0xdc56e6,_0x2df33b);if(_0x9b09a7[_0x144808(0x1bf)]>0x0)return console[_0x144808(0x1b9)](a41_0x4b7560[_0x144808(0x23c)](_0x144808(0x1db))),console[_0x144808(0x1b9)](formatValidationErrors(_0x9b09a7)),console[_0x144808(0x1b9)](a41_0x4b7560[_0x144808(0x1e9)]('\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.')),0x1;}catch(_0x412b6e){return console['error'](a41_0x4b7560[_0x144808(0x23c)](_0x144808(0x235)+(_0x412b6e instanceof Error?_0x412b6e[_0x144808(0x226)]:_0x412b6e))),0x1;}if(_0x5e9883[_0x144808(0x1bf)]===0x0&&_0x2a4686[_0x144808(0x1bf)]===0x0){const _0x5e2907=_0x469508[_0x144808(0x1d0)]?_0x144808(0x1c4):_0x144808(0x223);return console[_0x144808(0x1b9)](a41_0x4b7560[_0x144808(0x1e9)](_0x144808(0x1ce)+_0x5e2907+_0x144808(0x1d4))),0x0;}const _0x273936=new Map();_0x29c75e['length']>0x0&&!_0x469508[_0x144808(0x1d0)]&&await withSpinner('Fetching\x20existing\x20activations...',async()=>{await batchAsync(_0x29c75e,async _0x22a28e=>{const _0x5b25df=a41_0x3235,_0x49df5d=await _0x5c4431[_0x5b25df(0x216)][_0x5b25df(0x1e3)](_0x264fc1,_0x22a28e['id']);_0x273936[_0x5b25df(0x211)](_0x22a28e['id'],_0x49df5d);});},{'verbose':_0x469508[_0x144808(0x219)]});const {segmentFiles:_0x340ed0,foldersToCreate:_0x226f7d}=await prepareSegmentFiles(_0x5e9883,{'segmentByFolderAndName':_0x944acb,'activationsBySegmentId':_0x273936,'folderPathToId':_0x23f319,'idToEmailMap':_0x49e3bf,'connectionIdToNameMap':_0x7e06f9},_0x119efc,_0x4d88b6,_0x4b6be3),_0x573fd6=_0x5f027c?[]:findSegmentsToDelete(_0x29c75e,_0x5e9883['map'](({yamlConfig:_0x35fc82,folderPath:_0x4bbfe5})=>({'yamlConfig':_0x35fc82,'folderPath':resolveTDFolderPath(_0x4bbfe5,_0x4d88b6,_0x4b6be3)})),_0x256f45,_0x4b6be3,_0x4d88b6),{journeyFiles:_0x3d479e,foldersToCreate:_0x29b433}=await withProgressSpinner(_0x144808(0x222),async _0x5fd03b=>prepareJourneyFiles(_0x2a4686,{'fetchJourney':async _0x5a7df6=>_0x5c4431[_0x144808(0x1c4)][_0x144808(0x1c9)](_0x5a7df6['journeyId']),'journeyBundlesByFolderAndName':_0x3dde10,'folderPathToId':_0x23f319,'idToEmailMap':_0x49e3bf,'connectionIdToNameMap':_0x7e06f9,'existingSegments':_0x29c75e,'parentId':_0x264fc1,'deps':_0x5c4431,'progress':{'update':_0x5957ae=>{const _0x53c1cb=_0x144808;_0x5fd03b[_0x53c1cb(0x1e7)](_0x5957ae),_0x469508[_0x53c1cb(0x219)]&&console[_0x53c1cb(0x1b9)]('\x20\x20'+_0x5957ae);}},'journeyById':_0x515f15,'activationStepsById':_0x30454d},_0x4d88b6,_0x4b6be3),{'verbose':_0x469508[_0x144808(0x219)]})[_0x144808(0x238)](_0x5e7205=>_0x5e7205[_0x144808(0x1b2)]);for(const _0x483cb3 of _0x29b433){_0x226f7d[_0x144808(0x1ec)](_0x483cb3);}const _0x649983=_0x5f027c?[]:findJourneysToDelete(_0x3f1f1c,_0x2a4686[_0x144808(0x234)](({yamlConfig:_0xa81275,folderPath:_0x302c28})=>({'yamlConfig':_0xa81275,'folderPath':resolveTDFolderPath(_0x302c28,_0x4d88b6,_0x4b6be3)})),_0x256f45,_0x4b6be3,_0x4d88b6),_0x1b2efd=calculatePushStats(_0x340ed0,_0x3d479e,_0x226f7d,_0x573fd6,_0x649983,!!_0x469508[_0x144808(0x236)],!!_0x469508['journeysOnly']),_0x1be47c=_0x1b2efd['segments']['new'],_0x4d6736=_0x1b2efd['segments'][_0x144808(0x208)],_0x156988=_0x1b2efd[_0x144808(0x1b1)]['unchanged'],_0x4bc49e=_0x1b2efd[_0x144808(0x1b1)]['toDelete'],_0x3f3ec3=_0x1b2efd[_0x144808(0x1b3)][_0x144808(0x1a4)],_0x5144ff=_0x1b2efd[_0x144808(0x244)]['new'],_0x5aa412=_0x1b2efd[_0x144808(0x244)][_0x144808(0x208)],_0x247e6f=_0x1b2efd['journeys'][_0x144808(0x228)],_0x3c83d3=_0x1b2efd[_0x144808(0x244)][_0x144808(0x240)],_0x992d89=_0x1b2efd[_0x144808(0x242)][_0x144808(0x209)],_0x1c337e=_0x1b2efd['activations'][_0x144808(0x1a4)],_0x22668a=_0x1b2efd[_0x144808(0x242)][_0x144808(0x1da)],_0x495c97=_0x1b2efd[_0x144808(0x242)]['toDelete'];console[_0x144808(0x1b9)](_0x144808(0x1e5)+_0x5884fe+'\x27:');_0x3f3ec3[_0x144808(0x1bf)]>0x0&&console[_0x144808(0x1b9)]('\x20\x20'+a41_0x4b7560[_0x144808(0x243)](_0x144808(0x212)+_0x3f3ec3[_0x144808(0x1bf)]+_0x144808(0x213)));if(!_0x469508['journeysOnly']){console[_0x144808(0x1b9)]('\x20\x20📊\x20Segments:'),console[_0x144808(0x1b9)](_0x144808(0x1f5)+a41_0x4b7560[_0x144808(0x1d5)]('+\x20'+_0x1be47c['length']+_0x144808(0x1de))),console[_0x144808(0x1b9)]('\x20\x20\x20\x20'+a41_0x4b7560[_0x144808(0x1e9)]('~\x20'+_0x4d6736[_0x144808(0x1bf)]+'\x20changed'));if(_0x4bc49e[_0x144808(0x1bf)]>0x0)console[_0x144808(0x1b9)](_0x144808(0x1f5)+a41_0x4b7560[_0x144808(0x23c)]('-\x20'+_0x4bc49e['length']+_0x144808(0x1d2)));else _0x573fd6[_0x144808(0x1bf)]>0x0&&!_0x469508['delete']&&console[_0x144808(0x1b9)](_0x144808(0x1f5)+a41_0x4b7560[_0x144808(0x232)](_0x573fd6['length']+'\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)'));console[_0x144808(0x1b9)](_0x144808(0x1f5)+a41_0x4b7560[_0x144808(0x232)]('=\x20'+_0x156988[_0x144808(0x1bf)]+_0x144808(0x1b5)));}if(_0x3d479e[_0x144808(0x1bf)]>0x0||_0x649983['length']>0x0){console[_0x144808(0x1b9)](_0x144808(0x1c8)),console[_0x144808(0x1b9)](_0x144808(0x1f5)+a41_0x4b7560['green']('+\x20'+_0x5144ff[_0x144808(0x1bf)]+_0x144808(0x1de))),console['error'](_0x144808(0x1f5)+a41_0x4b7560[_0x144808(0x1e9)]('~\x20'+_0x5aa412[_0x144808(0x1bf)]+_0x144808(0x1f3)));if(_0x3c83d3[_0x144808(0x1bf)]>0x0)console[_0x144808(0x1b9)]('\x20\x20\x20\x20'+a41_0x4b7560[_0x144808(0x23c)]('-\x20'+_0x3c83d3[_0x144808(0x1bf)]+_0x144808(0x1d2)));else _0x649983[_0x144808(0x1bf)]>0x0&&!_0x469508[_0x144808(0x236)]&&console[_0x144808(0x1b9)](_0x144808(0x1f5)+a41_0x4b7560[_0x144808(0x232)](_0x649983['length']+_0x144808(0x230)));console['error']('\x20\x20\x20\x20'+a41_0x4b7560[_0x144808(0x232)]('=\x20'+_0x247e6f[_0x144808(0x1bf)]+_0x144808(0x1b5)));}_0x992d89[_0x144808(0x1bf)]>0x0&&!_0x469508[_0x144808(0x1d0)]&&(console['error'](''),console['error']('\x20\x20Activations:'),_0x1c337e['length']>0x0&&console['error'](_0x144808(0x1f5)+a41_0x4b7560[_0x144808(0x1d5)]('+\x20'+_0x1c337e[_0x144808(0x1bf)]+_0x144808(0x1c6))),_0x22668a[_0x144808(0x1bf)]>0x0&&console['error'](_0x144808(0x1f5)+a41_0x4b7560['yellow']('~\x20'+_0x22668a[_0x144808(0x1bf)]+_0x144808(0x1be))),_0x495c97[_0x144808(0x1bf)]>0x0&&console[_0x144808(0x1b9)](_0x144808(0x1f5)+a41_0x4b7560[_0x144808(0x23c)]('-\x20'+_0x495c97[_0x144808(0x1bf)]+_0x144808(0x1d2))));console['error'](_0x144808(0x23b)+a41_0x4b7560[_0x144808(0x210)](_0x2df33b)+'\x0a');if(_0x3f3ec3[_0x144808(0x1bf)]>0x0){console[_0x144808(0x1b9)]('Folders\x20to\x20create:');for(const _0x2efc21 of _0x3f3ec3){console[_0x144808(0x1b9)]('\x20\x20'+a41_0x4b7560[_0x144808(0x243)]('+')+'\x20'+_0x2efc21);}console['error']('');}if(_0x1be47c['length']>0x0&&!_0x469508['journeysOnly'])for(const _0x324fe5 of _0x1be47c){const _0x3b9d4d=_0x324fe5[_0x144808(0x1c2)]?_0x324fe5['folderPath']+'/'+_0x324fe5['yamlConfig'][_0x144808(0x1d1)]:_0x324fe5[_0x144808(0x1a5)]['name'],_0x3696f7=_0x324fe5[_0x144808(0x1a5)][_0x144808(0x242)]?.['length']||0x0,_0x1fbe44=_0x3696f7>0x0?a41_0x4b7560[_0x144808(0x232)]('\x20['+_0x3696f7+_0x144808(0x1f1)):'';console['error']('\x0a'+a41_0x4b7560[_0x144808(0x1d5)](_0x144808(0x241))+'\x20'+_0x3b9d4d+_0x1fbe44),console['error']('─'[_0x144808(0x22e)](0x3c)),_0x324fe5['diff']&&console[_0x144808(0x1b9)](_0x324fe5['diff']),console['error']('─'[_0x144808(0x22e)](0x3c));}if(_0x4bc49e['length']>0x0&&!_0x469508[_0x144808(0x1d0)])for(const _0x273f73 of _0x4bc49e){const _0x4e3536=_0x273f73[_0x144808(0x1fe)]?_0x256f45[_0x144808(0x21c)](_0x273f73[_0x144808(0x1fe)][_0x144808(0x201)]())||'':'',_0x52c258=_0x4e3536?_0x4e3536+'/'+_0x273f73[_0x144808(0x1d1)]:_0x273f73['name'],_0x5cbfa6=_0x273936[_0x144808(0x21c)](_0x273f73['id'])||[],_0x1256e9=_0x5cbfa6[_0x144808(0x1bf)]>0x0?a41_0x4b7560[_0x144808(0x232)]('\x20['+_0x5cbfa6[_0x144808(0x1bf)]+_0x144808(0x1f1)):'';console[_0x144808(0x1b9)]('\x0a'+a41_0x4b7560[_0x144808(0x23c)]('Delete\x20segment:')+'\x20'+_0x52c258+_0x1256e9),console[_0x144808(0x1b9)]('─'[_0x144808(0x22e)](0x3c));const _0x2ba42=segmentWithActivationsToYaml(_0x273f73,_0x5cbfa6,undefined,_0x49e3bf,_0x7e06f9),_0x35a955=segmentToYamlString(_0x2ba42),_0x3bb2f8=generateDiff(_0x35a955,'');console['error'](formatDiffWithColors(_0x3bb2f8)),console[_0x144808(0x1b9)]('─'[_0x144808(0x22e)](0x3c));}const _0x3f9090=_0x340ed0[_0x144808(0x1ea)](_0x132677=>!_0x132677['isNew']&&_0x132677['diff']);if(_0x3f9090[_0x144808(0x1bf)]>0x0&&!_0x469508[_0x144808(0x1d0)])for(const _0x1b8ef5 of _0x3f9090){const _0x517609=_0x1b8ef5[_0x144808(0x1c2)]?_0x1b8ef5['folderPath']+'/'+_0x1b8ef5[_0x144808(0x1a5)][_0x144808(0x1d1)]:_0x1b8ef5[_0x144808(0x1a5)][_0x144808(0x1d1)];console[_0x144808(0x1b9)]('\x0a'+a41_0x4b7560[_0x144808(0x1e9)](_0x144808(0x21f))+'\x20'+_0x517609),console[_0x144808(0x1b9)]('─'[_0x144808(0x22e)](0x3c)),console[_0x144808(0x1b9)](_0x1b8ef5[_0x144808(0x233)]),console[_0x144808(0x1b9)]('─'[_0x144808(0x22e)](0x3c));}if(_0x5144ff[_0x144808(0x1bf)]>0x0)for(const _0x2eb8da of _0x5144ff){const _0x1b30ad=_0x2eb8da[_0x144808(0x1c2)]?_0x2eb8da[_0x144808(0x1c2)]+'/'+_0x2eb8da['yamlConfig']['name']:_0x2eb8da['yamlConfig']['name'];console['error']('\x0a'+a41_0x4b7560[_0x144808(0x1d5)](_0x144808(0x1dc))+'\x20'+_0x1b30ad),console[_0x144808(0x1b9)]('─'['repeat'](0x3c)),_0x2eb8da['diff']&&console['error'](_0x2eb8da[_0x144808(0x233)]),console[_0x144808(0x1b9)]('─'[_0x144808(0x22e)](0x3c));}const _0xc32dcf=_0x3d479e['filter'](_0x5e6e72=>!_0x5e6e72['isNew']&&_0x5e6e72['diff']);if(_0xc32dcf[_0x144808(0x1bf)]>0x0)for(const _0x31f793 of _0xc32dcf){const _0x2d277a=_0x31f793[_0x144808(0x1c2)]?_0x31f793[_0x144808(0x1c2)]+'/'+_0x31f793['yamlConfig'][_0x144808(0x1d1)]:_0x31f793[_0x144808(0x1a5)][_0x144808(0x1d1)];console[_0x144808(0x1b9)]('\x0a'+a41_0x4b7560['yellow'](_0x144808(0x20d))+'\x20'+_0x2d277a),console[_0x144808(0x1b9)]('─'[_0x144808(0x22e)](0x3c)),console[_0x144808(0x1b9)](_0x31f793[_0x144808(0x233)]),console['error']('─'[_0x144808(0x22e)](0x3c));}if(_0x3c83d3[_0x144808(0x1bf)]>0x0)for(const _0x34532c of _0x3c83d3){const _0x1ef5e9=_0x34532c[_0x144808(0x1ff)]?_0x256f45[_0x144808(0x21c)](_0x34532c[_0x144808(0x1ff)])||'':'',_0x2eb171=_0x1ef5e9?_0x1ef5e9+'/'+_0x34532c[_0x144808(0x229)]:_0x34532c[_0x144808(0x229)];console[_0x144808(0x1b9)]('\x0a'+a41_0x4b7560[_0x144808(0x23c)](_0x144808(0x1e2))+'\x20'+_0x2eb171),console[_0x144808(0x1b9)]('─'[_0x144808(0x22e)](0x3c)),console['error'](a41_0x4b7560['red'](_0x144808(0x1e0))),console['error']('─'['repeat'](0x3c));}if(_0x469508[_0x144808(0x1a3)])return console[_0x144808(0x1b9)](a41_0x4b7560[_0x144808(0x1e9)]('\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made')),0x0;const _0x3cabb3=_0x469508['journeysOnly']?![]:_0x1be47c[_0x144808(0x1bf)]>0x0||_0x4d6736[_0x144808(0x1bf)]>0x0||_0x4bc49e['length']>0x0,_0x509b75=_0x5144ff[_0x144808(0x1bf)]>0x0||_0x5aa412[_0x144808(0x1bf)]>0x0||_0x3c83d3[_0x144808(0x1bf)]>0x0,_0x20c356=_0x469508[_0x144808(0x1d0)]?![]:_0x992d89[_0x144808(0x1bf)]>0x0,_0x4d5a4e=_0x3f3ec3[_0x144808(0x1bf)]>0x0;if(!_0x3cabb3&&!_0x509b75&&!_0x20c356&&!_0x4d5a4e){const _0x1dff4c=_0x469508[_0x144808(0x1d0)]?_0x144808(0x21a):_0x144808(0x1ab);console[_0x144808(0x1b9)](a41_0x4b7560[_0x144808(0x1d5)](_0x1dff4c));if(_0x5f027c&&_0x156988['length']===0x1){const _0x3c88b5=_0x156988[0x0];if(_0x3c88b5['existingSegment']?.['id']){const _0x2716ed=getConsoleNextUrl(_0x469508[_0x144808(0x245)],_0x144808(0x1e8)+_0x264fc1+_0x144808(0x1a7)+_0x3c88b5[_0x144808(0x1f7)]['id']+_0x144808(0x1f0));console[_0x144808(0x1b9)](_0x144808(0x1d9)+a41_0x4b7560[_0x144808(0x210)](_0x2716ed));}}if(_0x5f027c&&_0x247e6f[_0x144808(0x1bf)]===0x1){const _0xbb7903=_0x247e6f[0x0];if(_0xbb7903[_0x144808(0x23e)]?.['id']){const _0x5eda8a=getConsoleNextUrl(_0x469508[_0x144808(0x245)],_0x144808(0x1e8)+_0x264fc1+_0x144808(0x1a7)+_0xbb7903[_0x144808(0x23e)]['id']+_0x144808(0x221));console['error']('\x20\x20'+a41_0x4b7560[_0x144808(0x210)](_0x5eda8a));}}return 0x0;}const _0x539ce6=_0x469508['journeysOnly']?_0x5144ff[_0x144808(0x1bf)]+_0x5aa412[_0x144808(0x1bf)]+_0x3c83d3[_0x144808(0x1bf)]+_0x3f3ec3[_0x144808(0x1bf)]:_0x1be47c[_0x144808(0x1bf)]+_0x4d6736[_0x144808(0x1bf)]+_0x4bc49e['length']+_0x5144ff[_0x144808(0x1bf)]+_0x5aa412[_0x144808(0x1bf)]+_0x3c83d3[_0x144808(0x1bf)]+_0x3f3ec3[_0x144808(0x1bf)]+_0x992d89[_0x144808(0x1bf)];if(!_0x469508[_0x144808(0x1b8)]&&_0x539ce6>0x0){if(!isInteractive())return console['error'](a41_0x4b7560['red'](_0x144808(0x1bc)),_0x144808(0x23d)),console[_0x144808(0x1b9)](a41_0x4b7560['dim'](_0x144808(0x206))),0x1;const _0x1b9c60=await confirmKey(_0x144808(0x1fd)+_0x539ce6+_0x144808(0x20e));if(!_0x1b9c60)return console['error'](a41_0x4b7560[_0x144808(0x1e9)](_0x144808(0x1c1))),0x1;}const _0x949536={'withProgress':async(_0xd54edd,_0x1cb92f)=>{const _0x27367b=_0x144808,_0x5837ad=await withSpinner(_0xd54edd,_0x1cb92f,{'verbose':_0x469508[_0x27367b(0x219)]});return{'data':_0x5837ad['data']};},'logInfo':_0x280074=>console[_0x144808(0x1b9)](a41_0x4b7560['blue']('✔\x20'+_0x280074)),'logSuccess':_0x463d24=>console[_0x144808(0x1b9)](a41_0x4b7560['green']('✔\x20'+_0x463d24)),'logWarning':_0x595a30=>console[_0x144808(0x1b9)](a41_0x4b7560[_0x144808(0x1e9)]('⚠\x20'+_0x595a30)),'logDeleted':_0x3c4c58=>console[_0x144808(0x1b9)](a41_0x4b7560[_0x144808(0x23c)]('✔\x20'+_0x3c4c58))},_0x105ecb={'segment':_0x5c4431['segment'],'journey':_0x5c4431[_0x144808(0x1c4)],'user':_0x5c4431[_0x144808(0x22c)],'connection':_0x5c4431[_0x144808(0x214)]};_0x3f3ec3[_0x144808(0x1bf)]>0x0&&(_0x23f319=await executePushFolders(_0x105ecb,_0x3f3ec3,_0x23f319,{'parentId':_0x264fc1},_0x949536));const _0x3366d5={'rootFolderId':_0x21950f,'folderPathToId':_0x23f319,'folderIdToPath':_0x256f45,'segmentNameToId':_0x5c20c8,'activationsBySegmentId':_0x273936,'emailToIdMap':_0x3bd6f4,'idToEmailMap':_0x49e3bf,'connectionNameToIdMap':_0x5b1faa[_0x144808(0x1d3)],'connectionIdToNameMap':_0x5b1faa[_0x144808(0x21b)],'connectionNameToTypeMap':_0x4b20ef},_0x5b239e=await executePushSegments(_0x105ecb,_0x469508['journeysOnly']?[]:_0x340ed0,_0x3366d5,{'parentId':_0x264fc1},_0x949536),_0x296be5=_0x5b239e[_0x144808(0x1ef)],_0x80fb31=_0x5b239e[_0x144808(0x1b6)],_0x5b1325=_0x5b239e[_0x144808(0x242)][_0x144808(0x1ef)],_0x2dc384=_0x5b239e[_0x144808(0x242)][_0x144808(0x1b6)],_0x51bb9f=_0x5b239e[_0x144808(0x242)][_0x144808(0x200)];let _0xc30d24;if(_0x5f027c&&_0x340ed0[_0x144808(0x1bf)]===0x1){const _0x1628eb=_0x340ed0[0x0];_0xc30d24=_0x1628eb[_0x144808(0x1f7)]?.['id']??_0x5b239e[_0x144808(0x224)][_0x144808(0x21c)](_0x1628eb[_0x144808(0x1a5)][_0x144808(0x1d1)]);}const _0x4c8045=await executePushSegmentDeletions(_0x105ecb,_0x469508[_0x144808(0x1d0)]?[]:_0x4bc49e,_0x949536);let _0x506be7=0x0,_0x2eed54=0x0,_0x54f69d=0x0;const _0x583eef=new Map(_0x5c20c8);for(const [_0x404fbd,_0x40f5e0]of _0x5b239e[_0x144808(0x224)]){_0x583eef[_0x144808(0x211)](_0x404fbd,_0x40f5e0);}if(_0x3d479e[_0x144808(0x1bf)]>0x0){const _0x458b1d={..._0x3366d5,'segmentNameToId':_0x583eef,'existingSegments':_0x29c75e,'activationContext':_0x119efc},_0x29ad9b=await executePushJourneys(_0x105ecb,_0x3d479e,_0x458b1d,{'parentId':_0x264fc1,'rootFolderId':_0x21950f,'verbose':_0x469508[_0x144808(0x219)]},_0x949536);_0x506be7=_0x29ad9b[_0x144808(0x1ef)],_0x2eed54=_0x29ad9b[_0x144808(0x1b6)];if(_0x5f027c&&_0x29ad9b[_0x144808(0x1e6)][_0x144808(0x1bf)]===0x1){const _0x548e71=_0x29ad9b['results'][0x0];if(_0x548e71['journeyId']){const _0x2a5cea=getConsoleNextUrl(_0x469508['site'],_0x144808(0x1e8)+_0x264fc1+_0x144808(0x1a7)+_0x548e71[_0x144808(0x20f)]+_0x144808(0x221));console['error']('\x20\x20'+a41_0x4b7560[_0x144808(0x210)](_0x2a5cea));}}}for(const _0x134a4a of _0x3c83d3){console['error'](a41_0x4b7560[_0x144808(0x1e9)]('⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20'+_0x134a4a[_0x144808(0x229)])),_0x54f69d++;}const _0x111fac=[];if(_0x296be5>0x0)_0x111fac['push'](_0x296be5+_0x144808(0x1f8));if(_0x80fb31>0x0)_0x111fac[_0x144808(0x218)](_0x80fb31+_0x144808(0x217));if(_0x4c8045>0x0)_0x111fac[_0x144808(0x218)](_0x4c8045+_0x144808(0x239));const _0x3d08c6=[];if(_0x506be7>0x0)_0x3d08c6[_0x144808(0x218)](_0x506be7+_0x144808(0x1f8));if(_0x2eed54>0x0)_0x3d08c6['push'](_0x2eed54+_0x144808(0x217));if(_0x54f69d>0x0)_0x3d08c6['push'](_0x54f69d+_0x144808(0x239));const _0x43b77e=[];if(_0x5b1325>0x0)_0x43b77e[_0x144808(0x218)](_0x5b1325+'\x20created');if(_0x2dc384>0x0)_0x43b77e[_0x144808(0x218)](_0x2dc384+'\x20updated');if(_0x51bb9f>0x0)_0x43b77e[_0x144808(0x218)](_0x51bb9f+_0x144808(0x239));console['error'](a41_0x4b7560['green'](_0x144808(0x205)));_0x111fac['length']>0x0&&!_0x469508[_0x144808(0x1d0)]&&console['error'](_0x144808(0x1dd)+_0x111fac[_0x144808(0x22d)](',\x20'));_0x3d08c6[_0x144808(0x1bf)]>0x0&&console[_0x144808(0x1b9)](_0x144808(0x1fb)+_0x3d08c6['join'](',\x20'));_0x43b77e[_0x144808(0x1bf)]>0x0&&!_0x469508[_0x144808(0x1d0)]&&console['error'](_0x144808(0x1a6)+_0x43b77e[_0x144808(0x22d)](',\x20'));if(_0xc30d24){const _0x5c80f5=getConsoleNextUrl(_0x469508[_0x144808(0x245)],_0x144808(0x1e8)+_0x264fc1+_0x144808(0x1a7)+_0xc30d24+_0x144808(0x1f0));console[_0x144808(0x1b9)]('\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20'+a41_0x4b7560[_0x144808(0x210)](_0x5c80f5));}return 0x0;}}
1
+ const a41_0x4006d9=a41_0x5665;(function(_0x4ff949,_0x246253){const _0xbeb494=a41_0x5665,_0x23d080=_0x4ff949();while(!![]){try{const _0x2aeaac=-parseInt(_0xbeb494(0x158))/0x1*(-parseInt(_0xbeb494(0x130))/0x2)+-parseInt(_0xbeb494(0x1a4))/0x3*(-parseInt(_0xbeb494(0x1a1))/0x4)+parseInt(_0xbeb494(0x12b))/0x5+parseInt(_0xbeb494(0x118))/0x6+-parseInt(_0xbeb494(0x184))/0x7*(-parseInt(_0xbeb494(0x175))/0x8)+parseInt(_0xbeb494(0x110))/0x9+parseInt(_0xbeb494(0x1a9))/0xa*(-parseInt(_0xbeb494(0x17e))/0xb);if(_0x2aeaac===_0x246253)break;else _0x23d080['push'](_0x23d080['shift']());}catch(_0xfde52d){_0x23d080['push'](_0x23d080['shift']());}}}(a41_0x1ba2,0x31a3b));import{BaseCommand}from'./command.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{generateDiff,formatDiffWithColors}from'../utils/diff.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{batchAsync}from'../utils/async.js';import{segmentToYamlString,segmentWithActivationsToYaml}from'../sdk/segment/child-segment-yaml.js';import a41_0x3470a8 from'chalk';import{existsSync}from'fs';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';function a41_0x5665(_0x210039,_0x299e20){_0x210039=_0x210039-0x110;const _0x1ba295=a41_0x1ba2();let _0x5665a2=_0x1ba295[_0x210039];return _0x5665a2;}import{resolveTarget,isSuccessfulResolution,getScopedDetails}from'../sdk/segment/target-resolution.js';import{buildFolderMaps}from'../sdk/segment/resolution-context.js';function a41_0x1ba2(){const _0x1f67d5=['\x20\x20Journeys:\x20','\x20updated','get','Preparing\x20journeys...','📁\x20','\x20new','journeysOnly','red','parentFolder','Push\x20','dryRun','set','getParent','Parent\x20segment:\x20','segment\x20or\x20journey','1273255gkLIhM','toUpdate','cyan','user','targetDir','7034GjZhfO','description','segments','errorCode','verbose','.yaml','join','\x0a✔\x20Push\x20complete','idToName','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','/e/','audienceId','resolveParentId','folderId','New\x20segment:','\x27...','\x0aError:','activations','existingJourney','updated','attributes','toDelete','nameToId','state','✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','\x20\x20Activations:\x20','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','filter','\x20\x20🗺️\x20\x20Journeys:','Error\x20parsing\x20YAML:\x20','deleted','Scoped\x20to\x20folder:\x20','listJourneysWithDetailsFromParentSegment','toCreate','diff','paused','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','Fetching\x20existing\x20activations...','parentSegment','\x20created','84skQsvf','folderPath','journeyId','error','.yml','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','\x20\x20Segments:\x20','Delete\x20segment:','\x20\x20Source:\x20','then','\x20folders\x20to\x20create','push','segmentFolderId','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','Fetching\x20connections\x20for\x20name\x20resolution...','parent_name','new','\x20changes?','endsWith','blue','versionNumber','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','parentName','relationships','/j/da/je','\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20','cwd','map','152wBfMZt','listSegments','No\x20','createdAt','segment','Folders\x20to\x20create:','dim','repeat','/app/ps/','99GGuJsd','\x20to\x20create','\x20to\x20delete','Source\x20directory:\x20','\x20activations]','toString','55048mYJaAd','New\x20journey:','\x20deleted','yellow','data','journeys','file','green','unchanged','isNew','delete','length','results','\x0aPush\x20summary\x20for\x20\x27','changed','getOutputSchemaWithCache','Site:\x20','Delete\x20journey:','Changes\x20to:','connection','buildUserMaps','\x20YAML\x20files\x20found','\x20unchanged','listActivations','setPhase','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','name','yamlConfig','segment:push','483004TLBTnT','add','yes','3rgkGYl','\x20\x20Activations:','no_parent','\x20changed','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','1142540SEjYgN','helpText','created','existingSegment','journeyBundleName','journey','/sb/da/esr','site','\x20to\x20update','isScoped','Aborted.','\x20\x20\x20\x20','2835810wCIbmo','Changes\x20to\x20journey:','Error:\x20','journeyBundleId','Error:\x20Directory\x20not\x20found:\x20','Resolving\x20parent\x20segment\x20\x27','\x0aValidation\x20failed:','Fetching\x20existing\x20data...','577638fndyUE','type','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file','message'];a41_0x1ba2=function(){return _0x1f67d5;};return a41_0x1ba2();}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_0x4006d9(0x19e)]=a41_0x4006d9(0x1a0);[a41_0x4006d9(0x131)]='Push\x20YAML\x20files\x20to\x20Treasure\x20AI\x20as\x20child\x20segments';async['execute'](_0x446b28){const _0x1ac95d=a41_0x4006d9,{options:_0x14c3dc,args:_0x9dd923,tdx:_0x16a00d}=_0x446b28,_0x49e1ca=_0x14c3dc,_0x26b9cd=await resolveTarget({'arg':_0x9dd923[0x0],'contextParent':_0x14c3dc[_0x1ac95d(0x156)],'cwd':process[_0x1ac95d(0x173)]()});if(!isSuccessfulResolution(_0x26b9cd))return _0x26b9cd[_0x1ac95d(0x133)]===_0x1ac95d(0x1a6)?(console[_0x1ac95d(0x15b)](a41_0x3470a8['yellow'](_0x1ac95d(0x139))),console['error']('Usage:\x20tdx\x20sg\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20(requires\x20context)'),console['error'](_0x1ac95d(0x15d)),console[_0x1ac95d(0x15b)](_0x1ac95d(0x11a))):(console[_0x1ac95d(0x15b)](a41_0x3470a8[_0x1ac95d(0x123)](_0x1ac95d(0x112)+_0x26b9cd[_0x1ac95d(0x11b)]+'\x0a')),_0x26b9cd[_0x1ac95d(0x1aa)]&&console['error'](a41_0x3470a8[_0x1ac95d(0x12d)](_0x26b9cd['helpText']))),0x1;if(_0x26b9cd[_0x1ac95d(0x119)]===_0x1ac95d(0x168))return console['error'](a41_0x3470a8[_0x1ac95d(0x123)](_0x1ac95d(0x114)+_0x26b9cd['targetDir']+'\x0a')),console[_0x1ac95d(0x15b)](a41_0x3470a8[_0x1ac95d(0x12d)](_0x1ac95d(0x16e))),0x1;const _0x27e4bd=_0x26b9cd[_0x1ac95d(0x16f)],_0x1c89ee=_0x26b9cd[_0x1ac95d(0x12f)],_0x4d0ac0=_0x26b9cd[_0x1ac95d(0x119)]===_0x1ac95d(0x18a)?_0x26b9cd['filePath']:undefined,_0xf96087=getScopedDetails(_0x26b9cd),_0x1efbb6=_0xf96087?.[_0x1ac95d(0x1b2)]??![],_0x31cea9=_0xf96087?.['scopedFolderPath']??'';if(!existsSync(_0x1c89ee))return console[_0x1ac95d(0x15b)](a41_0x3470a8[_0x1ac95d(0x123)](_0x1ac95d(0x114)+_0x1c89ee+'\x0a')),console[_0x1ac95d(0x15b)](a41_0x3470a8[_0x1ac95d(0x12d)]('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;_0x49e1ca[_0x1ac95d(0x134)]&&(console['error'](_0x1ac95d(0x194)+_0x49e1ca[_0x1ac95d(0x1b0)]),console[_0x1ac95d(0x15b)](_0x1ac95d(0x129)+_0x27e4bd),console[_0x1ac95d(0x15b)](_0x1ac95d(0x181)+_0x1c89ee),_0x1efbb6&&console[_0x1ac95d(0x15b)](_0x1ac95d(0x14f)+_0x31cea9));const _0xdb8cd9=await withSpinner(_0x1ac95d(0x115)+_0x27e4bd+_0x1ac95d(0x13f),()=>_0x16a00d[_0x1ac95d(0x179)][_0x1ac95d(0x13c)](_0x27e4bd),{'verbose':_0x49e1ca[_0x1ac95d(0x134)]}),_0x223c7c=_0xdb8cd9['data'],{parentSegmentResult:_0x3ca3f8,segmentsResult:_0x9d0651,foldersResult:_0x4d6fd7,journeysWithDetailsResult:_0x48cb40,userMaps:_0x1b25d3}=await withSpinner(_0x1ac95d(0x117),async()=>{const _0x3b7cb2=_0x1ac95d,[_0x41b328,_0x25c05b,_0x2f590e,_0x39bcd7,_0x8850b5]=await Promise['all']([_0x16a00d[_0x3b7cb2(0x179)][_0x3b7cb2(0x128)](_0x223c7c),_0x16a00d[_0x3b7cb2(0x179)][_0x3b7cb2(0x176)](_0x223c7c),_0x16a00d[_0x3b7cb2(0x179)]['listFolders'](_0x223c7c),_0x16a00d[_0x3b7cb2(0x1ae)][_0x3b7cb2(0x150)](_0x223c7c,{'includeAllVersions':!![]}),_0x16a00d['user'][_0x3b7cb2(0x198)]()]);return{'parentSegmentResult':_0x41b328,'segmentsResult':_0x25c05b,'foldersResult':_0x2f590e,'journeysWithDetailsResult':_0x39bcd7,'userMaps':_0x8850b5};},{'verbose':_0x49e1ca['verbose']})[_0x1ac95d(0x162)](_0x52980d=>_0x52980d[_0x1ac95d(0x188)]),_0x3ea1ca=_0x3ca3f8,_0x5ce4d7=extractRootFolderId(_0x3ea1ca),_0xe5c80e=_0x9d0651,_0x5c5204=_0x4d6fd7,{journeys:_0x26e3db,activationStepsById:_0x3e843f}=_0x48cb40,_0x3ac5ce=new Map(_0x26e3db[_0x1ac95d(0x174)](_0x44df4a=>[_0x44df4a['id'],_0x44df4a])),_0x4b74c5=_0x26e3db[_0x1ac95d(0x174)](_0x2fdf27=>({'id':_0x2fdf27['id'],'name':_0x2fdf27[_0x1ac95d(0x144)][_0x1ac95d(0x19e)],'journeyBundleName':_0x2fdf27[_0x1ac95d(0x144)][_0x1ac95d(0x1ad)]||'','journeyBundleId':_0x2fdf27[_0x1ac95d(0x144)][_0x1ac95d(0x113)]||'','versionNumber':_0x2fdf27[_0x1ac95d(0x144)][_0x1ac95d(0x16d)],'description':_0x2fdf27[_0x1ac95d(0x144)]['description'],'state':_0x2fdf27[_0x1ac95d(0x144)][_0x1ac95d(0x147)],'paused':_0x2fdf27[_0x1ac95d(0x144)][_0x1ac95d(0x153)],'audienceId':_0x2fdf27[_0x1ac95d(0x144)][_0x1ac95d(0x13b)],'folderId':_0x2fdf27[_0x1ac95d(0x170)]?.[_0x1ac95d(0x124)]?.['data']?.['id'],'createdAt':_0x2fdf27[_0x1ac95d(0x144)][_0x1ac95d(0x178)],'updatedAt':_0x2fdf27[_0x1ac95d(0x144)]['updatedAt']})),{emailToId:_0x1eddf0,idToEmail:_0x521209}=_0x1b25d3,_0x5e7aed=await withSpinner(_0x1ac95d(0x167),async()=>{const _0x2abafc=_0x1ac95d,_0x137ef1=await _0x16a00d[_0x2abafc(0x197)]['list']();return buildConnectionMaps(_0x137ef1);},{'verbose':_0x49e1ca[_0x1ac95d(0x134)]})[_0x1ac95d(0x162)](_0xde3089=>_0xde3089[_0x1ac95d(0x188)]),_0x15f161=_0x5e7aed[_0x1ac95d(0x146)],_0x5c16a1=_0x5e7aed[_0x1ac95d(0x138)],_0x49fcd9=_0x5e7aed['nameToType'],_0x3ec0d3={'emailToIdMap':_0x1eddf0,'connectionNameToIdMap':_0x15f161,'connectionNameToTypeMap':_0x49fcd9,'getSchema':_0x5397f9=>_0x16a00d[_0x1ac95d(0x197)][_0x1ac95d(0x193)](_0x5397f9)};let {pathToId:_0x360467,idToPath:_0x524c0c}=buildFolderMaps(_0x5c5204);const _0x48da95=buildSegmentLookupMap(_0xe5c80e,_0x524c0c),_0x170c59=buildSegmentNameToIdMap(_0xe5c80e),_0x17866d=buildJourneyBundleLookupMap(_0x4b74c5,_0x524c0c);let _0x3d3a76;if(_0x4d0ac0){if(!_0x4d0ac0['endsWith'](_0x1ac95d(0x15c))&&!_0x4d0ac0[_0x1ac95d(0x16b)](_0x1ac95d(0x135)))return console[_0x1ac95d(0x15b)](a41_0x3470a8['red'](_0x1ac95d(0x19d)+_0x4d0ac0+'\x0a')),0x1;_0x3d3a76=[_0x4d0ac0];}else _0x3d3a76=findYamlFiles(_0x1c89ee);if(_0x3d3a76['length']===0x0)return console['error'](a41_0x3470a8[_0x1ac95d(0x123)]('Error:\x20No\x20YAML\x20files\x20found\x20in\x20'+_0x1c89ee+'\x0a')),console[_0x1ac95d(0x15b)](a41_0x3470a8[_0x1ac95d(0x12d)]('Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files')),0x1;let _0xbdfa32,_0x18af2b;try{const _0x34d6d6=parseAndClassifyYamlFiles(_0x3d3a76,_0x1c89ee,{'skipSegments':_0x49e1ca[_0x1ac95d(0x122)]});_0xbdfa32=_0x34d6d6[_0x1ac95d(0x132)],_0x18af2b=_0x34d6d6['journeys'];const _0x20e3ba=validateParsedFiles(_0x34d6d6,_0x1c89ee);if(_0x20e3ba[_0x1ac95d(0x18f)]>0x0)return console['error'](a41_0x3470a8[_0x1ac95d(0x123)](_0x1ac95d(0x116))),console[_0x1ac95d(0x15b)](formatValidationErrors(_0x20e3ba)),console[_0x1ac95d(0x15b)](a41_0x3470a8[_0x1ac95d(0x187)](_0x1ac95d(0x1a8))),0x1;}catch(_0xc241c4){return console[_0x1ac95d(0x15b)](a41_0x3470a8[_0x1ac95d(0x123)](_0x1ac95d(0x14d)+(_0xc241c4 instanceof Error?_0xc241c4[_0x1ac95d(0x11b)]:_0xc241c4))),0x1;}if(_0xbdfa32[_0x1ac95d(0x18f)]===0x0&&_0x18af2b[_0x1ac95d(0x18f)]===0x0){const _0x378fa4=_0x49e1ca[_0x1ac95d(0x122)]?_0x1ac95d(0x1ae):_0x1ac95d(0x12a);return console[_0x1ac95d(0x15b)](a41_0x3470a8[_0x1ac95d(0x187)](_0x1ac95d(0x177)+_0x378fa4+_0x1ac95d(0x199))),0x0;}const _0x3a70d4=new Map();_0xe5c80e[_0x1ac95d(0x18f)]>0x0&&!_0x49e1ca[_0x1ac95d(0x122)]&&await withSpinner(_0x1ac95d(0x155),async()=>{await batchAsync(_0xe5c80e,async _0x10ee2f=>{const _0x34821f=a41_0x5665,_0x486d2c=await _0x16a00d['segment'][_0x34821f(0x19b)](_0x223c7c,_0x10ee2f['id']);_0x3a70d4[_0x34821f(0x127)](_0x10ee2f['id'],_0x486d2c);});},{'verbose':_0x49e1ca['verbose']});const {segmentFiles:_0x1cd1b9,foldersToCreate:_0x4cbbaf}=await prepareSegmentFiles(_0xbdfa32,{'segmentByFolderAndName':_0x48da95,'activationsBySegmentId':_0x3a70d4,'folderPathToId':_0x360467,'idToEmailMap':_0x521209,'connectionIdToNameMap':_0x5c16a1},_0x3ec0d3,_0x1efbb6,_0x31cea9),_0x3e4970=_0x4d0ac0?[]:findSegmentsToDelete(_0xe5c80e,_0xbdfa32[_0x1ac95d(0x174)](({yamlConfig:_0x2e43a1,folderPath:_0x30ff23})=>({'yamlConfig':_0x2e43a1,'folderPath':resolveTDFolderPath(_0x30ff23,_0x1efbb6,_0x31cea9)})),_0x524c0c,_0x31cea9,_0x1efbb6),{journeyFiles:_0x236435,foldersToCreate:_0x971416}=await withProgressSpinner(_0x1ac95d(0x11f),async _0x1eb12e=>prepareJourneyFiles(_0x18af2b,{'fetchJourney':async _0x148bb6=>_0x16a00d[_0x1ac95d(0x1ae)]['getJourney'](_0x148bb6[_0x1ac95d(0x15a)]),'journeyBundlesByFolderAndName':_0x17866d,'folderPathToId':_0x360467,'idToEmailMap':_0x521209,'connectionIdToNameMap':_0x5c16a1,'existingSegments':_0xe5c80e,'parentId':_0x223c7c,'deps':_0x16a00d,'progress':{'update':_0x59ca74=>{const _0x3aa4e3=_0x1ac95d;_0x1eb12e[_0x3aa4e3(0x19c)](_0x59ca74),_0x49e1ca[_0x3aa4e3(0x134)]&&console[_0x3aa4e3(0x15b)]('\x20\x20'+_0x59ca74);}},'journeyById':_0x3ac5ce,'activationStepsById':_0x3e843f},_0x1efbb6,_0x31cea9),{'verbose':_0x49e1ca[_0x1ac95d(0x134)]})[_0x1ac95d(0x162)](_0x5b42dc=>_0x5b42dc[_0x1ac95d(0x188)]);for(const _0x4e6374 of _0x971416){_0x4cbbaf[_0x1ac95d(0x1a2)](_0x4e6374);}const _0xb9d238=_0x4d0ac0?[]:findJourneysToDelete(_0x4b74c5,_0x18af2b[_0x1ac95d(0x174)](({yamlConfig:_0x19bcd5,folderPath:_0x1e46fa})=>({'yamlConfig':_0x19bcd5,'folderPath':resolveTDFolderPath(_0x1e46fa,_0x1efbb6,_0x31cea9)})),_0x524c0c,_0x31cea9,_0x1efbb6),_0x2ad043=calculatePushStats(_0x1cd1b9,_0x236435,_0x4cbbaf,_0x3e4970,_0xb9d238,!!_0x49e1ca[_0x1ac95d(0x18e)],!!_0x49e1ca[_0x1ac95d(0x122)]),_0x3ed2cc=_0x2ad043[_0x1ac95d(0x132)][_0x1ac95d(0x169)],_0x1a7022=_0x2ad043[_0x1ac95d(0x132)][_0x1ac95d(0x192)],_0x332573=_0x2ad043[_0x1ac95d(0x132)][_0x1ac95d(0x18c)],_0x5e86d0=_0x2ad043[_0x1ac95d(0x132)][_0x1ac95d(0x145)],_0x17382e=_0x2ad043['folders'][_0x1ac95d(0x151)],_0x2aac97=_0x2ad043['journeys'][_0x1ac95d(0x169)],_0x259416=_0x2ad043[_0x1ac95d(0x189)][_0x1ac95d(0x192)],_0x301ed4=_0x2ad043[_0x1ac95d(0x189)][_0x1ac95d(0x18c)],_0x28e9c5=_0x2ad043['journeys'][_0x1ac95d(0x145)],_0x321029=_0x2ad043[_0x1ac95d(0x141)]['all'],_0x34c892=_0x2ad043['activations']['toCreate'],_0x74fbd3=_0x2ad043['activations'][_0x1ac95d(0x12c)],_0x44052c=_0x2ad043['activations'][_0x1ac95d(0x145)];console[_0x1ac95d(0x15b)](_0x1ac95d(0x191)+_0x27e4bd+'\x27:');_0x17382e[_0x1ac95d(0x18f)]>0x0&&console[_0x1ac95d(0x15b)]('\x20\x20'+a41_0x3470a8[_0x1ac95d(0x16c)](_0x1ac95d(0x120)+_0x17382e[_0x1ac95d(0x18f)]+_0x1ac95d(0x163)));if(!_0x49e1ca[_0x1ac95d(0x122)]){console[_0x1ac95d(0x15b)]('\x20\x20📊\x20Segments:'),console['error'](_0x1ac95d(0x1b4)+a41_0x3470a8[_0x1ac95d(0x18b)]('+\x20'+_0x3ed2cc[_0x1ac95d(0x18f)]+_0x1ac95d(0x121))),console[_0x1ac95d(0x15b)]('\x20\x20\x20\x20'+a41_0x3470a8[_0x1ac95d(0x187)]('~\x20'+_0x1a7022[_0x1ac95d(0x18f)]+_0x1ac95d(0x1a7)));if(_0x5e86d0[_0x1ac95d(0x18f)]>0x0)console[_0x1ac95d(0x15b)](_0x1ac95d(0x1b4)+a41_0x3470a8[_0x1ac95d(0x123)]('-\x20'+_0x5e86d0['length']+_0x1ac95d(0x180)));else _0x3e4970[_0x1ac95d(0x18f)]>0x0&&!_0x49e1ca[_0x1ac95d(0x18e)]&&console[_0x1ac95d(0x15b)](_0x1ac95d(0x1b4)+a41_0x3470a8[_0x1ac95d(0x17b)](_0x3e4970[_0x1ac95d(0x18f)]+_0x1ac95d(0x166)));console[_0x1ac95d(0x15b)](_0x1ac95d(0x1b4)+a41_0x3470a8['dim']('=\x20'+_0x332573[_0x1ac95d(0x18f)]+_0x1ac95d(0x19a)));}if(_0x236435[_0x1ac95d(0x18f)]>0x0||_0xb9d238[_0x1ac95d(0x18f)]>0x0){console[_0x1ac95d(0x15b)](_0x1ac95d(0x14c)),console['error']('\x20\x20\x20\x20'+a41_0x3470a8[_0x1ac95d(0x18b)]('+\x20'+_0x2aac97[_0x1ac95d(0x18f)]+_0x1ac95d(0x121))),console[_0x1ac95d(0x15b)](_0x1ac95d(0x1b4)+a41_0x3470a8[_0x1ac95d(0x187)]('~\x20'+_0x259416[_0x1ac95d(0x18f)]+_0x1ac95d(0x1a7)));if(_0x28e9c5[_0x1ac95d(0x18f)]>0x0)console[_0x1ac95d(0x15b)](_0x1ac95d(0x1b4)+a41_0x3470a8['red']('-\x20'+_0x28e9c5[_0x1ac95d(0x18f)]+'\x20to\x20delete'));else _0xb9d238['length']>0x0&&!_0x49e1ca[_0x1ac95d(0x18e)]&&console[_0x1ac95d(0x15b)](_0x1ac95d(0x1b4)+a41_0x3470a8['dim'](_0xb9d238[_0x1ac95d(0x18f)]+_0x1ac95d(0x166)));console[_0x1ac95d(0x15b)](_0x1ac95d(0x1b4)+a41_0x3470a8[_0x1ac95d(0x17b)]('=\x20'+_0x301ed4['length']+_0x1ac95d(0x19a)));}_0x321029[_0x1ac95d(0x18f)]>0x0&&!_0x49e1ca[_0x1ac95d(0x122)]&&(console[_0x1ac95d(0x15b)](''),console[_0x1ac95d(0x15b)](_0x1ac95d(0x1a5)),_0x34c892['length']>0x0&&console[_0x1ac95d(0x15b)](_0x1ac95d(0x1b4)+a41_0x3470a8[_0x1ac95d(0x18b)]('+\x20'+_0x34c892['length']+_0x1ac95d(0x17f))),_0x74fbd3[_0x1ac95d(0x18f)]>0x0&&console[_0x1ac95d(0x15b)]('\x20\x20\x20\x20'+a41_0x3470a8[_0x1ac95d(0x187)]('~\x20'+_0x74fbd3[_0x1ac95d(0x18f)]+_0x1ac95d(0x1b1))),_0x44052c[_0x1ac95d(0x18f)]>0x0&&console[_0x1ac95d(0x15b)](_0x1ac95d(0x1b4)+a41_0x3470a8['red']('-\x20'+_0x44052c[_0x1ac95d(0x18f)]+'\x20to\x20delete')));console[_0x1ac95d(0x15b)](_0x1ac95d(0x161)+a41_0x3470a8[_0x1ac95d(0x12d)](_0x1c89ee)+'\x0a');if(_0x17382e[_0x1ac95d(0x18f)]>0x0){console[_0x1ac95d(0x15b)](_0x1ac95d(0x17a));for(const _0x505e2d of _0x17382e){console[_0x1ac95d(0x15b)]('\x20\x20'+a41_0x3470a8['blue']('+')+'\x20'+_0x505e2d);}console[_0x1ac95d(0x15b)]('');}if(_0x3ed2cc[_0x1ac95d(0x18f)]>0x0&&!_0x49e1ca[_0x1ac95d(0x122)])for(const _0x3510e7 of _0x3ed2cc){const _0x50493c=_0x3510e7[_0x1ac95d(0x159)]?_0x3510e7[_0x1ac95d(0x159)]+'/'+_0x3510e7['yamlConfig'][_0x1ac95d(0x19e)]:_0x3510e7[_0x1ac95d(0x19f)][_0x1ac95d(0x19e)],_0x1c295e=_0x3510e7[_0x1ac95d(0x19f)][_0x1ac95d(0x141)]?.[_0x1ac95d(0x18f)]||0x0,_0x55596f=_0x1c295e>0x0?a41_0x3470a8['dim']('\x20['+_0x1c295e+_0x1ac95d(0x182)):'';console[_0x1ac95d(0x15b)]('\x0a'+a41_0x3470a8['green'](_0x1ac95d(0x13e))+'\x20'+_0x50493c+_0x55596f),console[_0x1ac95d(0x15b)]('─'[_0x1ac95d(0x17c)](0x3c)),_0x3510e7['diff']&&console[_0x1ac95d(0x15b)](_0x3510e7[_0x1ac95d(0x152)]),console[_0x1ac95d(0x15b)]('─'[_0x1ac95d(0x17c)](0x3c));}if(_0x5e86d0[_0x1ac95d(0x18f)]>0x0&&!_0x49e1ca['journeysOnly'])for(const _0x5846d9 of _0x5e86d0){const _0x29f6d7=_0x5846d9['segmentFolderId']?_0x524c0c['get'](_0x5846d9[_0x1ac95d(0x165)][_0x1ac95d(0x183)]())||'':'',_0x499aab=_0x29f6d7?_0x29f6d7+'/'+_0x5846d9['name']:_0x5846d9[_0x1ac95d(0x19e)],_0x1da189=_0x3a70d4['get'](_0x5846d9['id'])||[],_0x2c4e87=_0x1da189['length']>0x0?a41_0x3470a8['dim']('\x20['+_0x1da189[_0x1ac95d(0x18f)]+'\x20activations]'):'';console['error']('\x0a'+a41_0x3470a8[_0x1ac95d(0x123)](_0x1ac95d(0x160))+'\x20'+_0x499aab+_0x2c4e87),console[_0x1ac95d(0x15b)]('─'[_0x1ac95d(0x17c)](0x3c));const _0x436abb=segmentWithActivationsToYaml(_0x5846d9,_0x1da189,undefined,_0x521209,_0x5c16a1),_0x2d7dab=segmentToYamlString(_0x436abb),_0x1966f4=generateDiff(_0x2d7dab,'');console[_0x1ac95d(0x15b)](formatDiffWithColors(_0x1966f4)),console[_0x1ac95d(0x15b)]('─'[_0x1ac95d(0x17c)](0x3c));}const _0x3a4278=_0x1cd1b9[_0x1ac95d(0x14b)](_0x5927db=>!_0x5927db[_0x1ac95d(0x18d)]&&_0x5927db['diff']);if(_0x3a4278[_0x1ac95d(0x18f)]>0x0&&!_0x49e1ca[_0x1ac95d(0x122)])for(const _0x1f0aa9 of _0x3a4278){const _0x4ccb92=_0x1f0aa9[_0x1ac95d(0x159)]?_0x1f0aa9[_0x1ac95d(0x159)]+'/'+_0x1f0aa9['yamlConfig']['name']:_0x1f0aa9['yamlConfig'][_0x1ac95d(0x19e)];console[_0x1ac95d(0x15b)]('\x0a'+a41_0x3470a8[_0x1ac95d(0x187)](_0x1ac95d(0x196))+'\x20'+_0x4ccb92),console[_0x1ac95d(0x15b)]('─'[_0x1ac95d(0x17c)](0x3c)),console[_0x1ac95d(0x15b)](_0x1f0aa9[_0x1ac95d(0x152)]),console[_0x1ac95d(0x15b)]('─'[_0x1ac95d(0x17c)](0x3c));}if(_0x2aac97['length']>0x0)for(const _0x4f5bca of _0x2aac97){const _0x1ddcda=_0x4f5bca['folderPath']?_0x4f5bca[_0x1ac95d(0x159)]+'/'+_0x4f5bca[_0x1ac95d(0x19f)][_0x1ac95d(0x19e)]:_0x4f5bca[_0x1ac95d(0x19f)]['name'];console[_0x1ac95d(0x15b)]('\x0a'+a41_0x3470a8['green'](_0x1ac95d(0x185))+'\x20'+_0x1ddcda),console[_0x1ac95d(0x15b)]('─'[_0x1ac95d(0x17c)](0x3c)),_0x4f5bca[_0x1ac95d(0x152)]&&console['error'](_0x4f5bca[_0x1ac95d(0x152)]),console[_0x1ac95d(0x15b)]('─'['repeat'](0x3c));}const _0x30112e=_0x236435[_0x1ac95d(0x14b)](_0x473096=>!_0x473096[_0x1ac95d(0x18d)]&&_0x473096['diff']);if(_0x30112e['length']>0x0)for(const _0xdbf33 of _0x30112e){const _0x283354=_0xdbf33['folderPath']?_0xdbf33['folderPath']+'/'+_0xdbf33[_0x1ac95d(0x19f)]['name']:_0xdbf33['yamlConfig']['name'];console['error']('\x0a'+a41_0x3470a8[_0x1ac95d(0x187)](_0x1ac95d(0x111))+'\x20'+_0x283354),console[_0x1ac95d(0x15b)]('─'['repeat'](0x3c)),console[_0x1ac95d(0x15b)](_0xdbf33[_0x1ac95d(0x152)]),console[_0x1ac95d(0x15b)]('─'[_0x1ac95d(0x17c)](0x3c));}if(_0x28e9c5[_0x1ac95d(0x18f)]>0x0)for(const _0x3df046 of _0x28e9c5){const _0x3d6789=_0x3df046[_0x1ac95d(0x13d)]?_0x524c0c[_0x1ac95d(0x11e)](_0x3df046[_0x1ac95d(0x13d)])||'':'',_0x384709=_0x3d6789?_0x3d6789+'/'+_0x3df046['journeyBundleName']:_0x3df046[_0x1ac95d(0x1ad)];console[_0x1ac95d(0x15b)]('\x0a'+a41_0x3470a8[_0x1ac95d(0x123)](_0x1ac95d(0x195))+'\x20'+_0x384709),console[_0x1ac95d(0x15b)]('─'['repeat'](0x3c)),console[_0x1ac95d(0x15b)](a41_0x3470a8[_0x1ac95d(0x123)]('(Journey\x20will\x20be\x20deleted)')),console[_0x1ac95d(0x15b)]('─'[_0x1ac95d(0x17c)](0x3c));}if(_0x49e1ca[_0x1ac95d(0x126)])return console[_0x1ac95d(0x15b)](a41_0x3470a8[_0x1ac95d(0x187)](_0x1ac95d(0x15e))),0x0;const _0x22a8a2=_0x49e1ca[_0x1ac95d(0x122)]?![]:_0x3ed2cc[_0x1ac95d(0x18f)]>0x0||_0x1a7022[_0x1ac95d(0x18f)]>0x0||_0x5e86d0['length']>0x0,_0x5b9963=_0x2aac97[_0x1ac95d(0x18f)]>0x0||_0x259416[_0x1ac95d(0x18f)]>0x0||_0x28e9c5[_0x1ac95d(0x18f)]>0x0,_0x55f047=_0x49e1ca['journeysOnly']?![]:_0x321029[_0x1ac95d(0x18f)]>0x0,_0x2a3c5b=_0x17382e[_0x1ac95d(0x18f)]>0x0;if(!_0x22a8a2&&!_0x5b9963&&!_0x55f047&&!_0x2a3c5b){const _0x1e9b60=_0x49e1ca[_0x1ac95d(0x122)]?'✔\x20All\x20journeys\x20are\x20up\x20to\x20date':_0x1ac95d(0x148);console[_0x1ac95d(0x15b)](a41_0x3470a8['green'](_0x1e9b60));if(_0x4d0ac0&&_0x332573[_0x1ac95d(0x18f)]===0x1){const _0x480953=_0x332573[0x0];if(_0x480953[_0x1ac95d(0x1ac)]?.['id']){const _0x221cf8=getConsoleNextUrl(_0x49e1ca['site'],'/app/ps/'+_0x223c7c+_0x1ac95d(0x13a)+_0x480953[_0x1ac95d(0x1ac)]['id']+'/sb/da/esr');console[_0x1ac95d(0x15b)](_0x1ac95d(0x172)+a41_0x3470a8[_0x1ac95d(0x12d)](_0x221cf8));}}if(_0x4d0ac0&&_0x301ed4['length']===0x1){const _0x573cd7=_0x301ed4[0x0];if(_0x573cd7[_0x1ac95d(0x142)]?.['id']){const _0x557953=getConsoleNextUrl(_0x49e1ca[_0x1ac95d(0x1b0)],_0x1ac95d(0x17d)+_0x223c7c+_0x1ac95d(0x13a)+_0x573cd7[_0x1ac95d(0x142)]['id']+_0x1ac95d(0x171));console['error']('\x20\x20'+a41_0x3470a8['cyan'](_0x557953));}}return 0x0;}const _0x1d8cf7=_0x49e1ca[_0x1ac95d(0x122)]?_0x2aac97[_0x1ac95d(0x18f)]+_0x259416[_0x1ac95d(0x18f)]+_0x28e9c5[_0x1ac95d(0x18f)]+_0x17382e['length']:_0x3ed2cc['length']+_0x1a7022[_0x1ac95d(0x18f)]+_0x5e86d0[_0x1ac95d(0x18f)]+_0x2aac97[_0x1ac95d(0x18f)]+_0x259416[_0x1ac95d(0x18f)]+_0x28e9c5[_0x1ac95d(0x18f)]+_0x17382e['length']+_0x321029[_0x1ac95d(0x18f)];if(!_0x49e1ca[_0x1ac95d(0x1a3)]&&_0x1d8cf7>0x0){if(!isInteractive())return console['error'](a41_0x3470a8[_0x1ac95d(0x123)](_0x1ac95d(0x140)),_0x1ac95d(0x154)),console[_0x1ac95d(0x15b)](a41_0x3470a8['dim']('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x423c5f=await confirmKey(_0x1ac95d(0x125)+_0x1d8cf7+_0x1ac95d(0x16a));if(!_0x423c5f)return console['error'](a41_0x3470a8[_0x1ac95d(0x187)](_0x1ac95d(0x1b3))),0x1;}const _0x28c544={'withProgress':async(_0x3e23c8,_0x20f61b)=>{const _0x37dd42=_0x1ac95d,_0x66e4e=await withSpinner(_0x3e23c8,_0x20f61b,{'verbose':_0x49e1ca[_0x37dd42(0x134)]});return{'data':_0x66e4e[_0x37dd42(0x188)]};},'logInfo':_0xa8489e=>console[_0x1ac95d(0x15b)](a41_0x3470a8[_0x1ac95d(0x16c)]('✔\x20'+_0xa8489e)),'logSuccess':_0x2ac05d=>console['error'](a41_0x3470a8[_0x1ac95d(0x18b)]('✔\x20'+_0x2ac05d)),'logWarning':_0x552a39=>console[_0x1ac95d(0x15b)](a41_0x3470a8['yellow']('⚠\x20'+_0x552a39)),'logDeleted':_0x191ef8=>console[_0x1ac95d(0x15b)](a41_0x3470a8['red']('✔\x20'+_0x191ef8))},_0x292373={'segment':_0x16a00d['segment'],'journey':_0x16a00d[_0x1ac95d(0x1ae)],'user':_0x16a00d[_0x1ac95d(0x12e)],'connection':_0x16a00d[_0x1ac95d(0x197)]};_0x17382e[_0x1ac95d(0x18f)]>0x0&&(_0x360467=await executePushFolders(_0x292373,_0x17382e,_0x360467,{'parentId':_0x223c7c},_0x28c544));const _0x10d2a4={'rootFolderId':_0x5ce4d7,'folderPathToId':_0x360467,'folderIdToPath':_0x524c0c,'segmentNameToId':_0x170c59,'activationsBySegmentId':_0x3a70d4,'emailToIdMap':_0x1eddf0,'idToEmailMap':_0x521209,'connectionNameToIdMap':_0x5e7aed['nameToId'],'connectionIdToNameMap':_0x5e7aed['idToName'],'connectionNameToTypeMap':_0x49fcd9},_0x547b88=await executePushSegments(_0x292373,_0x49e1ca[_0x1ac95d(0x122)]?[]:_0x1cd1b9,_0x10d2a4,{'parentId':_0x223c7c},_0x28c544),_0x5e0e6a=_0x547b88['created'],_0x25c936=_0x547b88[_0x1ac95d(0x143)],_0x31f13d=_0x547b88[_0x1ac95d(0x141)][_0x1ac95d(0x1ab)],_0x1a1e35=_0x547b88[_0x1ac95d(0x141)][_0x1ac95d(0x143)],_0x2778f3=_0x547b88['activations'][_0x1ac95d(0x14e)];let _0x1ecab8;if(_0x4d0ac0&&_0x1cd1b9[_0x1ac95d(0x18f)]===0x1){const _0x3c4978=_0x1cd1b9[0x0];_0x1ecab8=_0x3c4978[_0x1ac95d(0x1ac)]?.['id']??_0x547b88['createdSegmentIds'][_0x1ac95d(0x11e)](_0x3c4978['yamlConfig'][_0x1ac95d(0x19e)]);}const _0x1108ba=await executePushSegmentDeletions(_0x292373,_0x49e1ca[_0x1ac95d(0x122)]?[]:_0x5e86d0,_0x28c544);let _0x44fe5c=0x0,_0x4bcd1f=0x0,_0x1beff1=0x0;const _0x41bfbe=new Map(_0x170c59);for(const [_0x39e899,_0x3d93f2]of _0x547b88['createdSegmentIds']){_0x41bfbe['set'](_0x39e899,_0x3d93f2);}if(_0x236435[_0x1ac95d(0x18f)]>0x0){const _0x165b31={..._0x10d2a4,'segmentNameToId':_0x41bfbe,'existingSegments':_0xe5c80e,'activationContext':_0x3ec0d3},_0x982489=await executePushJourneys(_0x292373,_0x236435,_0x165b31,{'parentId':_0x223c7c,'rootFolderId':_0x5ce4d7,'verbose':_0x49e1ca[_0x1ac95d(0x134)]},_0x28c544);_0x44fe5c=_0x982489[_0x1ac95d(0x1ab)],_0x4bcd1f=_0x982489[_0x1ac95d(0x143)];if(_0x4d0ac0&&_0x982489['results']['length']===0x1){const _0x46192e=_0x982489[_0x1ac95d(0x190)][0x0];if(_0x46192e[_0x1ac95d(0x15a)]){const _0x1ecd4e=getConsoleNextUrl(_0x49e1ca[_0x1ac95d(0x1b0)],_0x1ac95d(0x17d)+_0x223c7c+'/e/'+_0x46192e[_0x1ac95d(0x15a)]+'/j/da/je');console[_0x1ac95d(0x15b)]('\x20\x20'+a41_0x3470a8['cyan'](_0x1ecd4e));}}}for(const _0x48b3f6 of _0x28e9c5){console[_0x1ac95d(0x15b)](a41_0x3470a8[_0x1ac95d(0x187)](_0x1ac95d(0x14a)+_0x48b3f6[_0x1ac95d(0x1ad)])),_0x1beff1++;}const _0x153d7e=[];if(_0x5e0e6a>0x0)_0x153d7e[_0x1ac95d(0x164)](_0x5e0e6a+_0x1ac95d(0x157));if(_0x25c936>0x0)_0x153d7e[_0x1ac95d(0x164)](_0x25c936+_0x1ac95d(0x11d));if(_0x1108ba>0x0)_0x153d7e[_0x1ac95d(0x164)](_0x1108ba+'\x20deleted');const _0x31b7e3=[];if(_0x44fe5c>0x0)_0x31b7e3['push'](_0x44fe5c+_0x1ac95d(0x157));if(_0x4bcd1f>0x0)_0x31b7e3[_0x1ac95d(0x164)](_0x4bcd1f+_0x1ac95d(0x11d));if(_0x1beff1>0x0)_0x31b7e3[_0x1ac95d(0x164)](_0x1beff1+_0x1ac95d(0x186));const _0xf6f984=[];if(_0x31f13d>0x0)_0xf6f984['push'](_0x31f13d+_0x1ac95d(0x157));if(_0x1a1e35>0x0)_0xf6f984[_0x1ac95d(0x164)](_0x1a1e35+_0x1ac95d(0x11d));if(_0x2778f3>0x0)_0xf6f984['push'](_0x2778f3+_0x1ac95d(0x186));console['error'](a41_0x3470a8[_0x1ac95d(0x18b)](_0x1ac95d(0x137)));_0x153d7e[_0x1ac95d(0x18f)]>0x0&&!_0x49e1ca['journeysOnly']&&console[_0x1ac95d(0x15b)](_0x1ac95d(0x15f)+_0x153d7e['join'](',\x20'));_0x31b7e3['length']>0x0&&console[_0x1ac95d(0x15b)](_0x1ac95d(0x11c)+_0x31b7e3['join'](',\x20'));_0xf6f984[_0x1ac95d(0x18f)]>0x0&&!_0x49e1ca[_0x1ac95d(0x122)]&&console[_0x1ac95d(0x15b)](_0x1ac95d(0x149)+_0xf6f984[_0x1ac95d(0x136)](',\x20'));if(_0x1ecab8){const _0x336118=getConsoleNextUrl(_0x49e1ca[_0x1ac95d(0x1b0)],_0x1ac95d(0x17d)+_0x223c7c+'/e/'+_0x1ecab8+_0x1ac95d(0x1af));console[_0x1ac95d(0x15b)](_0x1ac95d(0x172)+a41_0x3470a8[_0x1ac95d(0x12d)](_0x336118));}return 0x0;}}
@@ -1 +1 @@
1
- function a42_0x10a8(_0xb651ad,_0x36dcdd){_0xb651ad=_0xb651ad-0x1b6;const _0x55e3f2=a42_0x55e3();let _0x10a832=_0x55e3f2[_0xb651ad];return _0x10a832;}const a42_0x1991b5=a42_0x10a8;(function(_0x1f21f5,_0x3d3481){const _0x315fd1=a42_0x10a8,_0x35b4f6=_0x1f21f5();while(!![]){try{const _0x2d1dcd=-parseInt(_0x315fd1(0x1db))/0x1+parseInt(_0x315fd1(0x1d2))/0x2*(-parseInt(_0x315fd1(0x1c4))/0x3)+parseInt(_0x315fd1(0x1be))/0x4*(parseInt(_0x315fd1(0x1e1))/0x5)+parseInt(_0x315fd1(0x1ca))/0x6*(-parseInt(_0x315fd1(0x1bc))/0x7)+-parseInt(_0x315fd1(0x1d3))/0x8+-parseInt(_0x315fd1(0x1d5))/0x9+-parseInt(_0x315fd1(0x1d4))/0xa*(-parseInt(_0x315fd1(0x1cf))/0xb);if(_0x2d1dcd===_0x3d3481)break;else _0x35b4f6['push'](_0x35b4f6['shift']());}catch(_0x360a6b){_0x35b4f6['push'](_0x35b4f6['shift']());}}}(a42_0x55e3,0x9a2b1));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';function a42_0x55e3(){const _0xbf17b8=['description','includes','segmentPath','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','length','1024191BgKEwR','folder','resolvePathToResource','Resolved\x20type:\x20','error','Resolving\x20path\x20\x27','3938905BBvAlV','Update\x20existing\x20child\x20segment','rule','type','\x27...','data','Resolved\x20folder\x20ID:\x20','yellow','Examples:','name','verbose','INTERNAL','\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','Segment\x20ID\x20missing\x20from\x20resolved\x20path','segment:update','7BjbEBh','segmentId','4tdZfjH','execute','Segment\x20ID:\x20','Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]','Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]','.\x20Only\x20child\x20segments\x20can\x20be\x20updated.','3YZLpGJ','✔\x20Updated\x20segment\x20\x27','Updating\x20segment\x20\x27','segment','kind','Resolving\x20folder\x20\x27','1002678JEuErK','Parent\x20ID:\x20','Error:\x20Cannot\x20update\x20','segmentName','Resolved\x20relative\x20path\x20to:\x20','220DXTMqE','resolveFolderId','parentId','760546aSgJRc','5511824PFrcwX','1494060chylnO','7954857wVfHVS'];a42_0x55e3=function(){return _0xbf17b8;};return a42_0x55e3();}import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{SDKError,ErrorCode}from'../sdk/index.js';import a42_0x5cb2a8 from'chalk';export class SegmentUpdateCommand extends BaseCommand{[a42_0x1991b5(0x1b6)]=a42_0x1991b5(0x1bb);['description']=a42_0x1991b5(0x1e2);async[a42_0x1991b5(0x1bf)](_0x45072e){const _0x24958e=a42_0x1991b5;console[_0x24958e(0x1df)](a42_0x5cb2a8[_0x24958e(0x1e8)]('⚠\x20Deprecation\x20warning:\x20`segment\x20update`\x20is\x20deprecated.')),console[_0x24958e(0x1df)](a42_0x5cb2a8[_0x24958e(0x1e8)](_0x24958e(0x1d9)));const {options:_0x15f896,args:_0x3eaca8,tdx:_0x674465}=_0x45072e,_0x179956=_0x15f896;if(_0x3eaca8[_0x24958e(0x1da)]===0x0)return console[_0x24958e(0x1df)]('Error:\x20Segment\x20path\x20or\x20name\x20is\x20required'),console['error'](_0x24958e(0x1c2)),console[_0x24958e(0x1df)](_0x24958e(0x1e9)),console[_0x24958e(0x1df)]('\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22'),console[_0x24958e(0x1df)](_0x24958e(0x1b9)),0x1;const _0x3dbd9c=_0x3eaca8[0x0],_0xf9965d=_0x15f896[_0x24958e(0x1d8)];let _0x3e5ac2=_0x3dbd9c;_0xf9965d&&!_0x3dbd9c[_0x24958e(0x1d7)]('/')&&(_0x3e5ac2=_0xf9965d+'/'+_0x3dbd9c,_0x179956[_0x24958e(0x1b7)]&&console['error'](_0x24958e(0x1ce)+_0x3e5ac2));const _0x5e67ea=await withSpinner(_0x24958e(0x1e0)+_0x3e5ac2+_0x24958e(0x1e5),()=>_0x674465[_0x24958e(0x1c7)][_0x24958e(0x1dd)](_0x3e5ac2),{'verbose':_0x179956[_0x24958e(0x1b7)]}),_0x156756=_0x5e67ea[_0x24958e(0x1e6)];_0x179956[_0x24958e(0x1b7)]&&console[_0x24958e(0x1df)](_0x24958e(0x1de)+_0x156756[_0x24958e(0x1e4)]);if(_0x156756[_0x24958e(0x1e4)]!==_0x24958e(0x1c7))return console['error'](_0x24958e(0x1cc)+_0x156756['type']+_0x24958e(0x1c3)),console[_0x24958e(0x1df)](_0x24958e(0x1c1)),0x1;if(!_0x156756['segmentId'])throw new SDKError(ErrorCode[_0x24958e(0x1b8)],_0x24958e(0x1ba));const _0x41a1c6=_0x156756[_0x24958e(0x1d1)],_0x54bbed=_0x156756[_0x24958e(0x1bd)];_0x179956['verbose']&&(console[_0x24958e(0x1df)](_0x24958e(0x1cb)+_0x41a1c6),console[_0x24958e(0x1df)](_0x24958e(0x1c0)+_0x54bbed));let _0x13f904;if(_0x179956['folder']){const _0x1cf34a=_0x179956[_0x24958e(0x1dc)],_0x426875=await withSpinner(_0x24958e(0x1c9)+_0x1cf34a+_0x24958e(0x1e5),()=>_0x674465[_0x24958e(0x1c7)][_0x24958e(0x1d0)](_0x41a1c6,_0x1cf34a),{'verbose':_0x179956[_0x24958e(0x1b7)]});_0x13f904=parseInt(_0x426875[_0x24958e(0x1e6)],0xa),_0x179956['verbose']&&console[_0x24958e(0x1df)](_0x24958e(0x1e7)+_0x13f904);}const _0x2961ee=await loadJSONFromOptions(_0x179956[_0x24958e(0x1e3)],_0x179956['ruleFile']),_0x4b0f2d={'name':_0x179956[_0x24958e(0x1b6)],'description':_0x179956[_0x24958e(0x1d6)],'rule':_0x2961ee,'kind':_0x179956[_0x24958e(0x1c8)]!==undefined?parseInt(_0x179956['kind'],0xa):undefined,'segmentFolderId':_0x13f904},_0x45b0ea=await withSpinner(_0x24958e(0x1c6)+_0x156756[_0x24958e(0x1cd)]+_0x24958e(0x1e5),()=>_0x674465[_0x24958e(0x1c7)]['updateSegmentById'](_0x41a1c6,_0x54bbed,_0x4b0f2d),{'verbose':_0x179956[_0x24958e(0x1b7)]}),_0x5ae55a=_0x45b0ea[_0x24958e(0x1e6)];return console[_0x24958e(0x1df)](_0x24958e(0x1c5)+_0x5ae55a[_0x24958e(0x1b6)]+'\x27'),_0x3e5ac2!==_0x3dbd9c&&console[_0x24958e(0x1df)]('\x20\x20\x20Path:\x20'+_0x3e5ac2),await handleSDKOutput([_0x5ae55a],_0x179956),0x0;}}
1
+ const a42_0x12e31b=a42_0xd8ff;(function(_0x19b171,_0x2251e9){const _0x1774c9=a42_0xd8ff,_0x27b1ea=_0x19b171();while(!![]){try{const _0x357f9a=-parseInt(_0x1774c9(0x180))/0x1*(-parseInt(_0x1774c9(0x17e))/0x2)+-parseInt(_0x1774c9(0x184))/0x3*(-parseInt(_0x1774c9(0x16a))/0x4)+parseInt(_0x1774c9(0x177))/0x5+-parseInt(_0x1774c9(0x185))/0x6+-parseInt(_0x1774c9(0x16d))/0x7*(parseInt(_0x1774c9(0x181))/0x8)+-parseInt(_0x1774c9(0x191))/0x9+parseInt(_0x1774c9(0x17d))/0xa;if(_0x357f9a===_0x2251e9)break;else _0x27b1ea['push'](_0x27b1ea['shift']());}catch(_0x1e72c0){_0x27b1ea['push'](_0x27b1ea['shift']());}}}(a42_0x19ad,0xbe922));import{BaseCommand}from'./command.js';function a42_0x19ad(){const _0x3b4ff4=['segment:update','Resolved\x20relative\x20path\x20to:\x20','\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22','.\x20Only\x20child\x20segments\x20can\x20be\x20updated.','data','segmentId','folder','segmentName','895625KGIsdt','Segment\x20ID:\x20','Examples:','length','name','type','26449080VgiHdH','2360686SBSYit','⚠\x20Deprecation\x20warning:\x20`segment\x20update`\x20is\x20deprecated.','1XTjOLU','8dWvEXF','\x27...','Segment\x20ID\x20missing\x20from\x20resolved\x20path','11157uijOMu','9329790GiJALK','\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','Resolving\x20path\x20\x27','ruleFile','resolvePathToResource','error','Resolving\x20folder\x20\x27','INTERNAL','execute','Updating\x20segment\x20\x27','resolveFolderId','updateSegmentById','4890519JILIcH','\x20\x20\x20Path:\x20','✔\x20Updated\x20segment\x20\x27','segmentPath','kind','verbose','description','segment','384QvzwWY','Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]','Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]','10377262btIOXj','Resolved\x20folder\x20ID:\x20'];a42_0x19ad=function(){return _0x3b4ff4;};return a42_0x19ad();}import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';function a42_0xd8ff(_0x458a59,_0x111af8){_0x458a59=_0x458a59-0x164;const _0x19adb5=a42_0x19ad();let _0xd8ff50=_0x19adb5[_0x458a59];return _0xd8ff50;}import{loadJSONFromOptions}from'../utils/json-loader.js';import{SDKError,ErrorCode}from'../sdk/index.js';import a42_0x74ac4c from'chalk';export class SegmentUpdateCommand extends BaseCommand{[a42_0x12e31b(0x17b)]=a42_0x12e31b(0x16f);[a42_0x12e31b(0x168)]='Update\x20existing\x20child\x20segment';async[a42_0x12e31b(0x18d)](_0x136ab6){const _0x49af1b=a42_0x12e31b;console[_0x49af1b(0x18a)](a42_0x74ac4c['yellow'](_0x49af1b(0x17f))),console[_0x49af1b(0x18a)](a42_0x74ac4c['yellow']('\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a'));const {options:_0x9939d3,args:_0x460f46,tdx:_0x31a394}=_0x136ab6,_0x311f48=_0x9939d3;if(_0x460f46[_0x49af1b(0x17a)]===0x0)return console[_0x49af1b(0x18a)]('Error:\x20Segment\x20path\x20or\x20name\x20is\x20required'),console[_0x49af1b(0x18a)](_0x49af1b(0x16c)),console[_0x49af1b(0x18a)](_0x49af1b(0x179)),console[_0x49af1b(0x18a)](_0x49af1b(0x171)),console['error'](_0x49af1b(0x186)),0x1;const _0x39ff5a=_0x460f46[0x0],_0x104a0d=_0x9939d3[_0x49af1b(0x165)];let _0x423043=_0x39ff5a;_0x104a0d&&!_0x39ff5a['includes']('/')&&(_0x423043=_0x104a0d+'/'+_0x39ff5a,_0x311f48[_0x49af1b(0x167)]&&console[_0x49af1b(0x18a)](_0x49af1b(0x170)+_0x423043));const _0x27d065=await withSpinner(_0x49af1b(0x187)+_0x423043+_0x49af1b(0x182),()=>_0x31a394[_0x49af1b(0x169)][_0x49af1b(0x189)](_0x423043),{'verbose':_0x311f48[_0x49af1b(0x167)]}),_0x1e44c8=_0x27d065[_0x49af1b(0x173)];_0x311f48['verbose']&&console[_0x49af1b(0x18a)]('Resolved\x20type:\x20'+_0x1e44c8[_0x49af1b(0x17c)]);if(_0x1e44c8[_0x49af1b(0x17c)]!=='segment')return console['error']('Error:\x20Cannot\x20update\x20'+_0x1e44c8[_0x49af1b(0x17c)]+_0x49af1b(0x172)),console[_0x49af1b(0x18a)](_0x49af1b(0x16b)),0x1;if(!_0x1e44c8[_0x49af1b(0x174)])throw new SDKError(ErrorCode[_0x49af1b(0x18c)],_0x49af1b(0x183));const _0x5b7991=_0x1e44c8['parentId'],_0xb0066b=_0x1e44c8[_0x49af1b(0x174)];_0x311f48[_0x49af1b(0x167)]&&(console[_0x49af1b(0x18a)]('Parent\x20ID:\x20'+_0x5b7991),console['error'](_0x49af1b(0x178)+_0xb0066b));let _0x46a0f0;if(_0x311f48[_0x49af1b(0x175)]){const _0x3828af=_0x311f48[_0x49af1b(0x175)],_0x496c15=await withSpinner(_0x49af1b(0x18b)+_0x3828af+_0x49af1b(0x182),()=>_0x31a394[_0x49af1b(0x169)][_0x49af1b(0x18f)](_0x5b7991,_0x3828af),{'verbose':_0x311f48[_0x49af1b(0x167)]});_0x46a0f0=parseInt(_0x496c15[_0x49af1b(0x173)],0xa),_0x311f48[_0x49af1b(0x167)]&&console['error'](_0x49af1b(0x16e)+_0x46a0f0);}const _0xca438b=await loadJSONFromOptions(_0x311f48['rule'],_0x311f48[_0x49af1b(0x188)]),_0x452f17={'name':_0x311f48[_0x49af1b(0x17b)],'description':_0x311f48[_0x49af1b(0x168)],'rule':_0xca438b,'kind':_0x311f48[_0x49af1b(0x166)]!==undefined?parseInt(_0x311f48[_0x49af1b(0x166)],0xa):undefined,'segmentFolderId':_0x46a0f0},_0x3fad3b=await withSpinner(_0x49af1b(0x18e)+_0x1e44c8[_0x49af1b(0x176)]+'\x27...',()=>_0x31a394['segment'][_0x49af1b(0x190)](_0x5b7991,_0xb0066b,_0x452f17),{'verbose':_0x311f48['verbose']}),_0x2e9e93=_0x3fad3b[_0x49af1b(0x173)];return console[_0x49af1b(0x18a)](_0x49af1b(0x164)+_0x2e9e93['name']+'\x27'),_0x423043!==_0x39ff5a&&console[_0x49af1b(0x18a)](_0x49af1b(0x192)+_0x423043),await handleSDKOutput([_0x2e9e93],_0x311f48),0x0;}}
@@ -1 +1 @@
1
- const a43_0x4a532f=a43_0x52a5;(function(_0x4203ab,_0x14047a){const _0x4fd53f=a43_0x52a5,_0x276d42=_0x4203ab();while(!![]){try{const _0x76e369=-parseInt(_0x4fd53f(0x16d))/0x1*(-parseInt(_0x4fd53f(0x190))/0x2)+-parseInt(_0x4fd53f(0x197))/0x3*(-parseInt(_0x4fd53f(0x182))/0x4)+-parseInt(_0x4fd53f(0x1a0))/0x5*(parseInt(_0x4fd53f(0x18e))/0x6)+parseInt(_0x4fd53f(0x16f))/0x7*(parseInt(_0x4fd53f(0x19a))/0x8)+parseInt(_0x4fd53f(0x183))/0x9+parseInt(_0x4fd53f(0x18d))/0xa+-parseInt(_0x4fd53f(0x196))/0xb;if(_0x76e369===_0x14047a)break;else _0x276d42['push'](_0x276d42['shift']());}catch(_0x38ed12){_0x276d42['push'](_0x276d42['shift']());}}}(a43_0x4edb,0x7be09));import{existsSync,statSync}from'fs';import a43_0x2c181a from'chalk';import{BaseCommand}from'./command.js';function a43_0x4edb(){const _0x7819f1=['folderPath','segment:use','isDirectory','11128557uizBpI','6eCjcZR','Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','segment','381496vTVrnc','split','type','Set\x20current\x20segment/folder\x20context\x20for\x20navigation','Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.','execute','1825cHuaOV','verbose','red','dim','Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.','data','Error:\x20Path\x20is\x20required\x0a','Usage:\x20tdx\x20segment\x20use\x20<path>','join','129VxFCaw','parentId','133MjlQeg','Use:\x20tdx\x20segment\x20use\x20','site','✔\x20Context\x20cleared.\x20Back\x20to\x20root.','length','description','Parent\x20ID:\x20','cyan','segments','Resolving\x20path\x20\x27','parentName','Folder\x20ID:\x20','segmentPath','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','✔\x20Context\x20set\x20to:\x20','log','Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>','\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context','Resolved\x20path\x20type:\x20','1238992XYyhKv','3329352DZxgVE','\x27...','name','parent_segment','session','green','error','folderId','Use\x20\x22tdx\x20use\x22\x20to\x20see\x20all\x20context\x20parameters','isAbsolute','1302430vMecUJ','13602VmeMAT','Target\x20path:\x20','4974VORzHL','fullPath','Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.'];a43_0x4edb=function(){return _0x7819f1;};return a43_0x4edb();}import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';import{parsePath,normalizePath}from'../sdk/segment/segment-path-parser.js';function a43_0x52a5(_0x312d8f,_0x2abdcd){_0x312d8f=_0x312d8f-0x165;const _0x4edb57=a43_0x4edb();let _0x52a58f=_0x4edb57[_0x312d8f];return _0x52a58f;}import{findTdxConfig}from'../sdk/segment/tdx-config.js';export class SegmentUseCommand extends BaseCommand{[a43_0x4a532f(0x185)]=a43_0x4a532f(0x194);[a43_0x4a532f(0x174)]=a43_0x4a532f(0x19d);async[a43_0x4a532f(0x19f)](_0x2a2f83){const _0x50b999=a43_0x4a532f,{options:_0x5281ed,args:_0x43b5f9,tdx:_0x37dc4a}=_0x2a2f83;if(_0x43b5f9[_0x50b999(0x173)]===0x0)return console['error'](a43_0x2c181a[_0x50b999(0x166)](_0x50b999(0x16a))),console['error'](_0x50b999(0x16b)),console['error']('Examples:'),console['error']('\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22'),console['error']('\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22'),console[_0x50b999(0x189)](_0x50b999(0x180)),console['error']('\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 _0x1dd5a2=_0x43b5f9[0x0],_0x2b0f36=_0x5281ed[_0x50b999(0x187)];try{if(_0x1dd5a2==='/')return saveSessionContext({'segment_path':undefined},_0x2b0f36),console[_0x50b999(0x17e)](a43_0x2c181a['green'](_0x50b999(0x172))),0x0;if(existsSync(_0x1dd5a2)&&statSync(_0x1dd5a2)[_0x50b999(0x195)]()){let _0x3be864;try{_0x3be864=findTdxConfig(_0x1dd5a2);}catch{return console[_0x50b999(0x189)](a43_0x2c181a[_0x50b999(0x166)](_0x50b999(0x198)+_0x1dd5a2)),console[_0x50b999(0x189)](a43_0x2c181a[_0x50b999(0x176)](_0x50b999(0x17c))),0x1;}const _0x5972e6=_0x3be864['config'][_0x50b999(0x186)];return saveSessionContext({'segment_path':_0x5972e6,'parent_segment':_0x5972e6},_0x2b0f36),console[_0x50b999(0x17e)](a43_0x2c181a['green'](_0x50b999(0x17d)+a43_0x2c181a['cyan'](_0x5972e6))),0x0;}const _0x52db98=_0x5281ed[_0x50b999(0x17b)];let _0x56691a=_0x1dd5a2;const _0x298e83=parsePath(_0x1dd5a2);if(!_0x298e83[_0x50b999(0x18c)]){if(!_0x52db98)return console[_0x50b999(0x189)](a43_0x2c181a[_0x50b999(0x166)](_0x50b999(0x19e))),console[_0x50b999(0x189)](a43_0x2c181a[_0x50b999(0x176)](_0x50b999(0x17f))),0x1;if(_0x1dd5a2==='..'){const _0x22a4e9=_0x52db98[_0x50b999(0x19b)]('/')['slice'](0x0,-0x1)['join']('/');_0x56691a=_0x22a4e9||'/';}else _0x1dd5a2==='.'?_0x56691a=_0x52db98:_0x56691a=_0x52db98+'/'+_0x1dd5a2;_0x5281ed['verbose']&&console[_0x50b999(0x189)]('Resolved\x20relative\x20path\x20to:\x20'+_0x56691a);}if(_0x56691a==='/'||_0x56691a==='')return saveSessionContext({'segment_path':undefined},_0x2b0f36),console[_0x50b999(0x17e)](a43_0x2c181a[_0x50b999(0x188)]('✔\x20Context\x20cleared.\x20Back\x20to\x20root.')),0x0;_0x56691a=normalizePath(_0x56691a);const _0x355a6a=parsePath(_0x56691a)[_0x50b999(0x177)];if(_0x355a6a[_0x50b999(0x173)]===0x0)return saveSessionContext({'segment_path':undefined},_0x2b0f36),console[_0x50b999(0x17e)](a43_0x2c181a[_0x50b999(0x188)]('✔\x20Context\x20cleared.\x20Back\x20to\x20root.')),0x0;_0x5281ed[_0x50b999(0x165)]&&(console[_0x50b999(0x189)]('Site:\x20'+_0x5281ed[_0x50b999(0x171)]),console['error'](_0x50b999(0x18f)+_0x56691a));const _0x4f446e=await withSpinner(_0x50b999(0x178)+_0x56691a+_0x50b999(0x184),()=>_0x37dc4a['segment']['resolvePathToResource'](_0x56691a),{'verbose':_0x5281ed[_0x50b999(0x165)]}),_0x456915=_0x4f446e[_0x50b999(0x169)];_0x5281ed['verbose']&&(console['error'](_0x50b999(0x181)+_0x456915['type']),console[_0x50b999(0x189)](_0x50b999(0x175)+_0x456915[_0x50b999(0x16e)]),_0x456915[_0x50b999(0x18a)]&&console[_0x50b999(0x189)](_0x50b999(0x17a)+_0x456915[_0x50b999(0x18a)]));if(_0x456915[_0x50b999(0x19c)]===_0x50b999(0x199))return console[_0x50b999(0x189)](a43_0x2c181a[_0x50b999(0x166)](_0x50b999(0x192))),console[_0x50b999(0x189)](_0x50b999(0x168)),console[_0x50b999(0x189)](a43_0x2c181a[_0x50b999(0x176)](_0x50b999(0x170)+_0x456915[_0x50b999(0x179)]+(_0x456915['folderPath']?'/'+_0x456915[_0x50b999(0x193)][_0x50b999(0x16c)]('/'):''))),0x1;return saveSessionContext({'segment_path':_0x456915[_0x50b999(0x191)],'parent_segment':_0x456915[_0x50b999(0x179)]},_0x2b0f36),console[_0x50b999(0x17e)](a43_0x2c181a[_0x50b999(0x188)](_0x50b999(0x17d)+a43_0x2c181a['cyan'](_0x456915[_0x50b999(0x191)]))),_0x5281ed['verbose']&&(console['error'](a43_0x2c181a['dim']('Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context')),console[_0x50b999(0x189)](a43_0x2c181a[_0x50b999(0x167)](_0x50b999(0x18b)))),0x0;}catch(_0x398b34){throw _0x398b34;}}}
1
+ function a43_0x585d(){const _0x32d59d=['Examples:','Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context','session','3245530xeOQZn','Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>','join','error','cyan','Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','verbose','Usage:\x20tdx\x20segment\x20use\x20<path>','segment:use','Parent\x20ID:\x20','config','2202798bjhzmO','1694525YKmxBL','Folder\x20ID:\x20','Resolved\x20path\x20type:\x20','split','1556084Hfpnea','Resolved\x20relative\x20path\x20to:\x20','✔\x20Context\x20set\x20to:\x20','5912QoSGoD','128UNwYBt','type','parentName','Resolving\x20path\x20\x27','\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22','Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.','log','1479mSMgMr','✔\x20Context\x20cleared.\x20Back\x20to\x20root.','resolvePathToResource','red','525096hPtden','segments','isDirectory','segment','Error:\x20Path\x20is\x20required\x0a','Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.','folderId','\x27...','parentId','dim','green','Use\x20\x22tdx\x20use\x22\x20to\x20see\x20all\x20context\x20parameters','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','10359migXWY','segmentPath','length','fullPath','Site:\x20'];a43_0x585d=function(){return _0x32d59d;};return a43_0x585d();}const a43_0x290428=a43_0x1810;function a43_0x1810(_0x235a57,_0x52495d){_0x235a57=_0x235a57-0x1e6;const _0x585d32=a43_0x585d();let _0x181022=_0x585d32[_0x235a57];return _0x181022;}(function(_0x3338a2,_0x1f67c2){const _0x2beb10=a43_0x1810,_0x2c7a6a=_0x3338a2();while(!![]){try{const _0x347bd7=-parseInt(_0x2beb10(0x1f6))/0x1+parseInt(_0x2beb10(0x1ea))/0x2*(-parseInt(_0x2beb10(0x1f2))/0x3)+-parseInt(_0x2beb10(0x1e6))/0x4+parseInt(_0x2beb10(0x20b))/0x5+-parseInt(_0x2beb10(0x216))/0x6+parseInt(_0x2beb10(0x217))/0x7+-parseInt(_0x2beb10(0x1e9))/0x8*(-parseInt(_0x2beb10(0x203))/0x9);if(_0x347bd7===_0x1f67c2)break;else _0x2c7a6a['push'](_0x2c7a6a['shift']());}catch(_0x394bad){_0x2c7a6a['push'](_0x2c7a6a['shift']());}}}(a43_0x585d,0x68ba8));import{existsSync,statSync}from'fs';import a43_0x1ec8c2 from'chalk';import{BaseCommand}from'./command.js';import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';import{parsePath,normalizePath}from'../sdk/segment/segment-path-parser.js';import{findTdxConfig}from'../sdk/segment/tdx-config.js';export class SegmentUseCommand extends BaseCommand{['name']=a43_0x290428(0x213);['description']='Set\x20current\x20segment/folder\x20context\x20for\x20navigation';async['execute'](_0x2ba27f){const _0x466a8a=a43_0x290428,{options:_0x34eda1,args:_0x1d8f77,tdx:_0x59e146}=_0x2ba27f;if(_0x1d8f77[_0x466a8a(0x205)]===0x0)return console['error'](a43_0x1ec8c2['red'](_0x466a8a(0x1fa))),console['error'](_0x466a8a(0x212)),console[_0x466a8a(0x20e)](_0x466a8a(0x208)),console[_0x466a8a(0x20e)](_0x466a8a(0x1ef)),console['error']('\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22'),console['error'](_0x466a8a(0x1ee)),console['error']('\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 _0x4ad1e9=_0x1d8f77[0x0],_0x8164e=_0x34eda1[_0x466a8a(0x20a)];try{if(_0x4ad1e9==='/')return saveSessionContext({'segment_path':undefined},_0x8164e),console[_0x466a8a(0x1f1)](a43_0x1ec8c2[_0x466a8a(0x200)](_0x466a8a(0x1f3))),0x0;if(existsSync(_0x4ad1e9)&&statSync(_0x4ad1e9)[_0x466a8a(0x1f8)]()){let _0x721d6a;try{_0x721d6a=findTdxConfig(_0x4ad1e9);}catch{return console[_0x466a8a(0x20e)](a43_0x1ec8c2[_0x466a8a(0x1f5)](_0x466a8a(0x210)+_0x4ad1e9)),console[_0x466a8a(0x20e)](a43_0x1ec8c2[_0x466a8a(0x20f)](_0x466a8a(0x202))),0x1;}const _0x4f6dee=_0x721d6a[_0x466a8a(0x215)]['parent_segment'];return saveSessionContext({'segment_path':_0x4f6dee,'parent_segment':_0x4f6dee},_0x8164e),console[_0x466a8a(0x1f1)](a43_0x1ec8c2[_0x466a8a(0x200)](_0x466a8a(0x1e8)+a43_0x1ec8c2[_0x466a8a(0x20f)](_0x4f6dee))),0x0;}const _0x2be047=_0x34eda1[_0x466a8a(0x204)];let _0x4038fa=_0x4ad1e9;const _0x36ad52=parsePath(_0x4ad1e9);if(!_0x36ad52['isAbsolute']){if(!_0x2be047)return console[_0x466a8a(0x20e)](a43_0x1ec8c2[_0x466a8a(0x1f5)]('Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.')),console[_0x466a8a(0x20e)](a43_0x1ec8c2['cyan'](_0x466a8a(0x20c))),0x1;if(_0x4ad1e9==='..'){const _0x330dec=_0x2be047[_0x466a8a(0x21a)]('/')['slice'](0x0,-0x1)[_0x466a8a(0x20d)]('/');_0x4038fa=_0x330dec||'/';}else _0x4ad1e9==='.'?_0x4038fa=_0x2be047:_0x4038fa=_0x2be047+'/'+_0x4ad1e9;_0x34eda1['verbose']&&console[_0x466a8a(0x20e)](_0x466a8a(0x1e7)+_0x4038fa);}if(_0x4038fa==='/'||_0x4038fa==='')return saveSessionContext({'segment_path':undefined},_0x8164e),console[_0x466a8a(0x1f1)](a43_0x1ec8c2[_0x466a8a(0x200)](_0x466a8a(0x1f3))),0x0;_0x4038fa=normalizePath(_0x4038fa);const _0x3ede01=parsePath(_0x4038fa)[_0x466a8a(0x1f7)];if(_0x3ede01[_0x466a8a(0x205)]===0x0)return saveSessionContext({'segment_path':undefined},_0x8164e),console[_0x466a8a(0x1f1)](a43_0x1ec8c2[_0x466a8a(0x200)](_0x466a8a(0x1f3))),0x0;_0x34eda1[_0x466a8a(0x211)]&&(console[_0x466a8a(0x20e)](_0x466a8a(0x207)+_0x34eda1['site']),console[_0x466a8a(0x20e)]('Target\x20path:\x20'+_0x4038fa));const _0x40907e=await withSpinner(_0x466a8a(0x1ed)+_0x4038fa+_0x466a8a(0x1fd),()=>_0x59e146[_0x466a8a(0x1f9)][_0x466a8a(0x1f4)](_0x4038fa),{'verbose':_0x34eda1['verbose']}),_0x47833f=_0x40907e['data'];_0x34eda1[_0x466a8a(0x211)]&&(console[_0x466a8a(0x20e)](_0x466a8a(0x219)+_0x47833f[_0x466a8a(0x1eb)]),console[_0x466a8a(0x20e)](_0x466a8a(0x214)+_0x47833f[_0x466a8a(0x1fe)]),_0x47833f[_0x466a8a(0x1fc)]&&console[_0x466a8a(0x20e)](_0x466a8a(0x218)+_0x47833f[_0x466a8a(0x1fc)]));if(_0x47833f[_0x466a8a(0x1eb)]===_0x466a8a(0x1f9))return console[_0x466a8a(0x20e)](a43_0x1ec8c2[_0x466a8a(0x1f5)](_0x466a8a(0x1f0))),console[_0x466a8a(0x20e)](_0x466a8a(0x1fb)),console['error'](a43_0x1ec8c2[_0x466a8a(0x20f)]('Use:\x20tdx\x20segment\x20use\x20'+_0x47833f[_0x466a8a(0x1ec)]+(_0x47833f['folderPath']?'/'+_0x47833f['folderPath'][_0x466a8a(0x20d)]('/'):''))),0x1;return saveSessionContext({'segment_path':_0x47833f[_0x466a8a(0x206)],'parent_segment':_0x47833f[_0x466a8a(0x1ec)]},_0x8164e),console[_0x466a8a(0x1f1)](a43_0x1ec8c2['green'](_0x466a8a(0x1e8)+a43_0x1ec8c2['cyan'](_0x47833f[_0x466a8a(0x206)]))),_0x34eda1[_0x466a8a(0x211)]&&(console[_0x466a8a(0x20e)](a43_0x1ec8c2[_0x466a8a(0x1ff)](_0x466a8a(0x209))),console[_0x466a8a(0x20e)](a43_0x1ec8c2[_0x466a8a(0x1ff)](_0x466a8a(0x201)))),0x0;}catch(_0x161169){throw _0x161169;}}}
@@ -1 +1 @@
1
- function a44_0x2e69(_0x2dd4f0,_0x2ad33c){_0x2dd4f0=_0x2dd4f0-0x193;const _0x28b425=a44_0x28b4();let _0x2e698a=_0x28b425[_0x2dd4f0];return _0x2e698a;}const a44_0x10405c=a44_0x2e69;(function(_0x259295,_0x598b2a){const _0x15afda=a44_0x2e69,_0x3a30c2=_0x259295();while(!![]){try{const _0x1aa554=-parseInt(_0x15afda(0x1ac))/0x1+parseInt(_0x15afda(0x1a1))/0x2+parseInt(_0x15afda(0x1c2))/0x3*(-parseInt(_0x15afda(0x198))/0x4)+parseInt(_0x15afda(0x197))/0x5+parseInt(_0x15afda(0x19d))/0x6+parseInt(_0x15afda(0x193))/0x7+parseInt(_0x15afda(0x1be))/0x8*(-parseInt(_0x15afda(0x1bd))/0x9);if(_0x1aa554===_0x598b2a)break;else _0x3a30c2['push'](_0x3a30c2['shift']());}catch(_0x492193){_0x3a30c2['push'](_0x3a30c2['shift']());}}}(a44_0x28b4,0x858ab));import{BaseCommand}from'./command.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';function a44_0x28b4(){const _0x49cefe=['execute','endsWith','cwd','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file','name','Validate\x20segment\x20and\x20journey\x20YAML\x20files','\x20file(s)\x20valid','red','cyan','):\x20','invalidCount','yellow','hasErrors','1720323fzlbrw','16ItASlb','errorCode','warningCount','length','7017rtUbjl','segment:validate','errors','Usage:\x20tdx\x20sg\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)','272580dpaFHV','dim','log','\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','3364835EPtVrh','1588KCsubA','Validation\x20failed:\x20','description','\x20warning(s)\x20found','.yaml','5886120JkFQXQ','✔\x20All\x20','targetDir','\x20warning(s)','1997094QgEETz','\x20valid','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','error','valid','Error:\x20Directory\x20not\x20found:\x20','green','warnings','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','helpText','\x20file(s)\x20with\x20errors,\x20','833610IKHbir','parentSegment','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','validCount'];a44_0x28b4=function(){return _0x49cefe;};return a44_0x28b4();}import{existsSync}from'fs';import a44_0x5c5671 from'chalk';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class SegmentValidateCommand extends BaseCommand{[a44_0x10405c(0x1b4)]=a44_0x10405c(0x1c3);[a44_0x10405c(0x19a)]=a44_0x10405c(0x1b5);async[a44_0x10405c(0x1b0)](_0x53c464){const _0x26e8dc=a44_0x10405c,{options:_0x17f9af,args:_0x3c0424}=_0x53c464,_0x17d251=_0x17f9af,_0x1709d9=await resolveTarget({'arg':_0x3c0424[0x0],'contextParent':_0x17f9af[_0x26e8dc(0x1ad)],'cwd':process[_0x26e8dc(0x1b2)]()});if(!isSuccessfulResolution(_0x1709d9))return _0x1709d9[_0x26e8dc(0x1bf)]==='no_parent'?(console['error'](a44_0x5c5671[_0x26e8dc(0x1bb)](_0x26e8dc(0x1a3))),console['error'](_0x26e8dc(0x1c5)),console[_0x26e8dc(0x1a4)](_0x26e8dc(0x196)),console[_0x26e8dc(0x1a4)](_0x26e8dc(0x1b3))):(console[_0x26e8dc(0x1a4)](a44_0x5c5671[_0x26e8dc(0x1b7)]('Error:\x20'+_0x1709d9['message']+'\x0a')),_0x1709d9[_0x26e8dc(0x1aa)]&&console[_0x26e8dc(0x1a4)](a44_0x5c5671[_0x26e8dc(0x1b8)](_0x1709d9[_0x26e8dc(0x1aa)]))),0x1;const _0x54d991=_0x1709d9[_0x26e8dc(0x19f)],_0x106855=_0x1709d9['type']==='file'?_0x1709d9['filePath']:undefined;if(!_0x106855&&!existsSync(_0x54d991))return console[_0x26e8dc(0x1a4)](a44_0x5c5671[_0x26e8dc(0x1b7)](_0x26e8dc(0x1a6)+_0x54d991+'\x0a')),0x1;let _0x5e1df8;if(_0x106855){if(!_0x106855[_0x26e8dc(0x1b1)]('.yml')&&!_0x106855[_0x26e8dc(0x1b1)](_0x26e8dc(0x19c)))return console[_0x26e8dc(0x1a4)](a44_0x5c5671[_0x26e8dc(0x1b7)](_0x26e8dc(0x1a9)+_0x106855+'\x0a')),0x1;_0x5e1df8=[_0x106855];}else _0x5e1df8=findYamlFiles(_0x54d991);if(_0x5e1df8['length']===0x0)return console['error'](a44_0x5c5671[_0x26e8dc(0x1b7)](_0x26e8dc(0x1ae)+_0x54d991+'\x0a')),0x1;const _0x33307c=validateYamlFiles(_0x5e1df8,_0x54d991),_0x45dff1=calculateSummary(_0x33307c);for(const _0x4870ba of _0x33307c){if(!isValidationResult(_0x4870ba))continue;const {relativePath:_0x2c7608,source:_0x4b1834,result:_0x261c3b,fileType:_0x2e67d6}=_0x4870ba,_0x417600=_0x2e67d6;if(_0x261c3b['valid']&&_0x261c3b[_0x26e8dc(0x1a8)][_0x26e8dc(0x1c1)]===0x0)_0x17d251['verbose']&&console['log'](a44_0x5c5671[_0x26e8dc(0x1a7)]('✔\x20'+_0x2c7608)+a44_0x5c5671[_0x26e8dc(0x194)]('\x20('+_0x417600+')'));else _0x261c3b[_0x26e8dc(0x1a5)]?(console['log'](a44_0x5c5671[_0x26e8dc(0x1bb)]('⚠\x20'+_0x2c7608)+a44_0x5c5671[_0x26e8dc(0x194)]('\x20('+_0x417600+_0x26e8dc(0x1b9)+_0x261c3b[_0x26e8dc(0x1a8)]['length']+_0x26e8dc(0x1a0))),console[_0x26e8dc(0x195)](formatValidationResult(_0x261c3b,_0x4b1834,_0x2c7608))):(console[_0x26e8dc(0x195)](a44_0x5c5671[_0x26e8dc(0x1b7)]('✖\x20'+_0x2c7608)+a44_0x5c5671[_0x26e8dc(0x194)]('\x20('+_0x417600+_0x26e8dc(0x1b9)+_0x261c3b[_0x26e8dc(0x1c4)][_0x26e8dc(0x1c1)]+'\x20error(s)')),console[_0x26e8dc(0x195)](formatValidationResult(_0x261c3b,_0x4b1834,_0x2c7608)));}return console[_0x26e8dc(0x195)](''),_0x45dff1[_0x26e8dc(0x1bc)]?(console[_0x26e8dc(0x195)](a44_0x5c5671[_0x26e8dc(0x1b7)](_0x26e8dc(0x199)+_0x45dff1[_0x26e8dc(0x1ba)]+_0x26e8dc(0x1ab)+_0x45dff1[_0x26e8dc(0x1af)]+_0x26e8dc(0x1a2))),_0x45dff1[_0x26e8dc(0x1c0)]>0x0&&console['log'](a44_0x5c5671[_0x26e8dc(0x1bb)](_0x45dff1[_0x26e8dc(0x1c0)]+_0x26e8dc(0x19b))),0x1):(console[_0x26e8dc(0x195)](a44_0x5c5671[_0x26e8dc(0x1a7)](_0x26e8dc(0x19e)+_0x45dff1[_0x26e8dc(0x1af)]+_0x26e8dc(0x1b6))),_0x45dff1[_0x26e8dc(0x1c0)]>0x0&&console[_0x26e8dc(0x195)](a44_0x5c5671['yellow'](_0x45dff1[_0x26e8dc(0x1c0)]+_0x26e8dc(0x19b))),0x0);}}
1
+ const a44_0x13a3d0=a44_0x2561;function a44_0x2561(_0x183b46,_0x1d541){_0x183b46=_0x183b46-0x107;const _0x496cf9=a44_0x496c();let _0x2561c4=_0x496cf9[_0x183b46];return _0x2561c4;}(function(_0x1d2186,_0x591d37){const _0x570160=a44_0x2561,_0x1dd5b4=_0x1d2186();while(!![]){try{const _0x3c6dd8=-parseInt(_0x570160(0x11d))/0x1*(parseInt(_0x570160(0x126))/0x2)+parseInt(_0x570160(0x10d))/0x3+parseInt(_0x570160(0x11c))/0x4+parseInt(_0x570160(0x10a))/0x5*(parseInt(_0x570160(0x109))/0x6)+parseInt(_0x570160(0x10e))/0x7*(parseInt(_0x570160(0x136))/0x8)+parseInt(_0x570160(0x122))/0x9*(-parseInt(_0x570160(0x12e))/0xa)+parseInt(_0x570160(0x112))/0xb*(-parseInt(_0x570160(0x12b))/0xc);if(_0x3c6dd8===_0x591d37)break;else _0x1dd5b4['push'](_0x1dd5b4['shift']());}catch(_0x2fbb01){_0x1dd5b4['push'](_0x1dd5b4['shift']());}}}(a44_0x496c,0xf32c5));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_0x2cd2c5 from'chalk';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class SegmentValidateCommand extends BaseCommand{[a44_0x13a3d0(0x139)]=a44_0x13a3d0(0x12a);[a44_0x13a3d0(0x124)]='Validate\x20segment\x20and\x20journey\x20YAML\x20files';async['execute'](_0x15f149){const _0x40ca9f=a44_0x13a3d0,{options:_0x10b61c,args:_0x3752d1}=_0x15f149,_0x15e0ec=_0x10b61c,_0x1329ec=await resolveTarget({'arg':_0x3752d1[0x0],'contextParent':_0x10b61c[_0x40ca9f(0x11e)],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x1329ec))return _0x1329ec[_0x40ca9f(0x10c)]===_0x40ca9f(0x115)?(console[_0x40ca9f(0x137)](a44_0x2cd2c5[_0x40ca9f(0x13b)](_0x40ca9f(0x108))),console['error'](_0x40ca9f(0x107)),console[_0x40ca9f(0x137)](_0x40ca9f(0x13c)),console[_0x40ca9f(0x137)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file')):(console['error'](a44_0x2cd2c5[_0x40ca9f(0x111)]('Error:\x20'+_0x1329ec[_0x40ca9f(0x130)]+'\x0a')),_0x1329ec[_0x40ca9f(0x123)]&&console['error'](a44_0x2cd2c5[_0x40ca9f(0x114)](_0x1329ec[_0x40ca9f(0x123)]))),0x1;const _0x2a696d=_0x1329ec[_0x40ca9f(0x13d)],_0x5a2c5c=_0x1329ec[_0x40ca9f(0x135)]===_0x40ca9f(0x132)?_0x1329ec[_0x40ca9f(0x118)]:undefined;if(!_0x5a2c5c&&!existsSync(_0x2a696d))return console[_0x40ca9f(0x137)](a44_0x2cd2c5[_0x40ca9f(0x111)](_0x40ca9f(0x119)+_0x2a696d+'\x0a')),0x1;let _0x34d392;if(_0x5a2c5c){if(!_0x5a2c5c['endsWith'](_0x40ca9f(0x10f))&&!_0x5a2c5c[_0x40ca9f(0x12d)](_0x40ca9f(0x11a)))return console[_0x40ca9f(0x137)](a44_0x2cd2c5[_0x40ca9f(0x111)](_0x40ca9f(0x138)+_0x5a2c5c+'\x0a')),0x1;_0x34d392=[_0x5a2c5c];}else _0x34d392=findYamlFiles(_0x2a696d);if(_0x34d392[_0x40ca9f(0x131)]===0x0)return console[_0x40ca9f(0x137)](a44_0x2cd2c5['red'](_0x40ca9f(0x128)+_0x2a696d+'\x0a')),0x1;const _0x50fb4e=validateYamlFiles(_0x34d392,_0x2a696d),_0x4cc397=calculateSummary(_0x50fb4e);for(const _0x3583e3 of _0x50fb4e){if(!isValidationResult(_0x3583e3))continue;const {relativePath:_0x320cc8,source:_0x873cdf,result:_0x227125,fileType:_0x102fd2}=_0x3583e3,_0x596832=_0x102fd2;if(_0x227125[_0x40ca9f(0x13a)]&&_0x227125[_0x40ca9f(0x134)][_0x40ca9f(0x131)]===0x0)_0x15e0ec[_0x40ca9f(0x133)]&&console[_0x40ca9f(0x11b)](a44_0x2cd2c5[_0x40ca9f(0x10b)]('✔\x20'+_0x320cc8)+a44_0x2cd2c5[_0x40ca9f(0x110)]('\x20('+_0x596832+')'));else _0x227125[_0x40ca9f(0x13a)]?(console[_0x40ca9f(0x11b)](a44_0x2cd2c5['yellow']('⚠\x20'+_0x320cc8)+a44_0x2cd2c5['dim']('\x20('+_0x596832+_0x40ca9f(0x11f)+_0x227125[_0x40ca9f(0x134)][_0x40ca9f(0x131)]+'\x20warning(s)')),console[_0x40ca9f(0x11b)](formatValidationResult(_0x227125,_0x873cdf,_0x320cc8))):(console[_0x40ca9f(0x11b)](a44_0x2cd2c5[_0x40ca9f(0x111)]('✖\x20'+_0x320cc8)+a44_0x2cd2c5['dim']('\x20('+_0x596832+'):\x20'+_0x227125[_0x40ca9f(0x129)]['length']+_0x40ca9f(0x121))),console[_0x40ca9f(0x11b)](formatValidationResult(_0x227125,_0x873cdf,_0x320cc8)));}return console[_0x40ca9f(0x11b)](''),_0x4cc397[_0x40ca9f(0x12f)]?(console[_0x40ca9f(0x11b)](a44_0x2cd2c5['red'](_0x40ca9f(0x125)+_0x4cc397['invalidCount']+_0x40ca9f(0x127)+_0x4cc397['validCount']+_0x40ca9f(0x113))),_0x4cc397[_0x40ca9f(0x117)]>0x0&&console[_0x40ca9f(0x11b)](a44_0x2cd2c5[_0x40ca9f(0x13b)](_0x4cc397[_0x40ca9f(0x117)]+_0x40ca9f(0x116))),0x1):(console['log'](a44_0x2cd2c5[_0x40ca9f(0x10b)](_0x40ca9f(0x120)+_0x4cc397[_0x40ca9f(0x12c)]+'\x20file(s)\x20valid')),_0x4cc397[_0x40ca9f(0x117)]>0x0&&console[_0x40ca9f(0x11b)](a44_0x2cd2c5['yellow'](_0x4cc397[_0x40ca9f(0x117)]+_0x40ca9f(0x116))),0x0);}}function a44_0x496c(){const _0x633c9c=['filePath','Error:\x20Directory\x20not\x20found:\x20','.yaml','log','4845936Qqvfoq','31666earPzh','parentSegment','):\x20','✔\x20All\x20','\x20error(s)','6448185jbeCQO','helpText','description','Validation\x20failed:\x20','52bjbmoy','\x20file(s)\x20with\x20errors,\x20','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','errors','segment:validate','24DZqxcM','validCount','endsWith','10DSTYMD','hasErrors','message','length','file','verbose','warnings','type','8IvNhLc','error','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','name','valid','yellow','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20validate\x20.\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20current\x20directory','targetDir','Usage:\x20tdx\x20sg\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','4476kUXMoQ','12335dGtoEb','green','errorCode','1387755NAoAuf','4366187GEdDco','.yml','dim','red','8813057EuAwNI','\x20valid','cyan','no_parent','\x20warning(s)\x20found','warningCount'];a44_0x496c=function(){return _0x633c9c;};return a44_0x496c();}
@@ -1 +1 @@
1
- const a45_0x422d4e=a45_0x315f;(function(_0x3531d6,_0x2f35b3){const _0x168562=a45_0x315f,_0x43821e=_0x3531d6();while(!![]){try{const _0x2c4abe=-parseInt(_0x168562(0xbd))/0x1+-parseInt(_0x168562(0xab))/0x2+-parseInt(_0x168562(0xe9))/0x3+parseInt(_0x168562(0xbe))/0x4*(-parseInt(_0x168562(0xb8))/0x5)+-parseInt(_0x168562(0xd3))/0x6+parseInt(_0x168562(0xeb))/0x7+parseInt(_0x168562(0xb6))/0x8;if(_0x2c4abe===_0x2f35b3)break;else _0x43821e['push'](_0x43821e['shift']());}catch(_0x2dfa63){_0x43821e['push'](_0x43821e['shift']());}}}(a45_0x1367,0x919d1));function a45_0x315f(_0xe586bc,_0x56aa2f){_0xe586bc=_0xe586bc-0x9d;const _0x1367fe=a45_0x1367();let _0x315f11=_0x1367fe[_0xe586bc];return _0x315f11;}function a45_0x1367(){const _0xe124f2=['Resolving\x20path\x20\x27','parentId','21092680rhUQoB','Set\x20a\x20parent\x20segment\x20context\x20first:','20xsGLWt','✔\x20Built\x20tree\x20with\x20','log','jsonl','data','746535zuszkc','103808gXpcoe','Error:\x20','verbose','listRecursive','Resolving\x20parent\x20segment\x20\x27','Listing\x20folders,\x20segments,\x20and\x20journeys...','\x20folder','\x20matching\x20\x27','\x20journey','type','name','\x20\x20tdx\x20sg\x20pull\x20\x22My\x20Audience\x22','parentSegment','format','error','\x27...','No\x20items\x20match\x20pattern:\x20','folderId','Parent\x20ID:\x20','cause','sort','1029828rCGIju','journeys','site','length','journey','listWithPattern','✔\x20Found\x20','dim','includes','execute','Site:\x20','/j/da','Recursive\x20mode:\x20enabled','Folder/pattern\x20arg:\x20','\x20segment','description','test','map','(empty)','folders',',\x20and\x20','\x5c$&','1357626EfQzDn','json','778575rhgoAp','listUnified','folder','listUnifiedWithJourneys','(not\x20set)','message','segment','filter','segments','journeyBundleName','List\x20folders\x20and\x20child\x20segments','Parent\x20segment\x20context:\x20','replace','resolvePathToResource','/app/ps/','maxDepth','1353708XwQChR','Building\x20hierarchy\x20tree...','/e/','localeCompare',']\x20matching\x20\x27','Folder\x20ID:\x20','Use\x20tdx\x20ps\x20list\x20to\x20see\x20available\x20parent\x20segments.','children','Error:\x20No\x20parent\x20segment\x20context\x20set.'];a45_0x1367=function(){return _0xe124f2;};return a45_0x1367();}import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{formatFlatList,formatTree}from'../sdk/util/tree-formatter.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import a45_0xcbdf15 from'chalk';export class SegmentsCommand extends BaseCommand{[a45_0x422d4e(0xc8)]=a45_0x422d4e(0xa3);[a45_0x422d4e(0xe2)]=a45_0x422d4e(0xa5);async[a45_0x422d4e(0xdc)](_0x3da091){const _0x213ef0=a45_0x422d4e,{options:_0x26e652,args:_0x1006d3}=_0x3da091,_0x119ff5=_0x26e652['recursive'],_0x12901a=_0x1006d3[0x0];try{const _0x27dc46=_0x26e652[_0x213ef0(0xca)];_0x26e652[_0x213ef0(0xc0)]&&(console[_0x213ef0(0xcc)](_0x213ef0(0xdd)+_0x26e652[_0x213ef0(0xd5)]),console[_0x213ef0(0xcc)](_0x213ef0(0xa6)+(_0x27dc46||_0x213ef0(0x9f))),_0x12901a&&console[_0x213ef0(0xcc)](_0x213ef0(0xe0)+_0x12901a),_0x119ff5&&console['error'](_0x213ef0(0xdf)));if(!_0x27dc46)return console['error'](_0x213ef0(0xb3)),console['error'](''),console[_0x213ef0(0xcc)](_0x213ef0(0xb7)),console[_0x213ef0(0xcc)](_0x213ef0(0xc9)),console[_0x213ef0(0xcc)]('\x20\x20tdx\x20sg\x20use\x20\x22My\x20Audience\x22'),console['error'](''),console[_0x213ef0(0xcc)](_0x213ef0(0xb1)),0x1;const _0x26cf26=_0x12901a&&(_0x12901a[_0x213ef0(0xdb)]('*')||_0x12901a['includes']('?'));if(_0x26cf26)return await this[_0x213ef0(0xd8)](_0x3da091,_0x27dc46,_0x12901a);const _0x4aabcb=_0x12901a?_0x27dc46+'/'+_0x12901a:_0x27dc46;return _0x119ff5?await this['listRecursive'](_0x3da091,_0x4aabcb):await this['listUnified'](_0x3da091,_0x4aabcb);}catch(_0x635513){if(_0x635513 instanceof SDKError)return console[_0x213ef0(0xcc)](_0x213ef0(0xbf)+_0x635513[_0x213ef0(0xa0)]),_0x635513[_0x213ef0(0xd1)]&&console[_0x213ef0(0xcc)]('\x20\x20Cause:\x20'+_0x635513[_0x213ef0(0xd1)]),0x1;throw _0x635513;}}async[a45_0x422d4e(0xd8)](_0x10a5e6,_0x4b8917,_0x38c286){const _0x477137=a45_0x422d4e,{options:_0x4f9e97,tdx:_0x302904}=_0x10a5e6,_0x2e4e79=await withSpinner(_0x477137(0xc2)+_0x4b8917+_0x477137(0xcd),()=>_0x302904[_0x477137(0xa1)][_0x477137(0xa8)](_0x4b8917),{'verbose':_0x4f9e97[_0x477137(0xc0)]}),_0x32712e=_0x2e4e79[_0x477137(0xbc)],_0x392e6a=await withSpinner('Listing\x20folders,\x20segments,\x20and\x20journeys...',()=>_0x302904[_0x477137(0xa1)]['listUnifiedWithJourneys'](_0x32712e[_0x477137(0xb5)],_0x32712e[_0x477137(0xcf)]),{'verbose':_0x4f9e97['verbose']}),{folders:_0x2ec527,segments:_0x238009,journeys:_0xf98f7d}=_0x392e6a[_0x477137(0xbc)],_0x8b2f22=_0x38c286['replace'](/[.+^${}()|[\]\\]/g,_0x477137(0xe8))[_0x477137(0xa7)](/\*/g,'.*')['replace'](/\?/g,'.'),_0x1a35a9=new RegExp('^'+_0x8b2f22+'$','i'),_0x390099=_0x2ec527[_0x477137(0xa2)](_0x2a2604=>_0x1a35a9[_0x477137(0xe3)](_0x2a2604[_0x477137(0xc8)])),_0xdc28ee=_0x238009['filter'](_0x107382=>_0x1a35a9[_0x477137(0xe3)](_0x107382[_0x477137(0xc8)])),_0x2bf0e5=_0xf98f7d[_0x477137(0xa2)](_0x3aabaf=>_0x1a35a9[_0x477137(0xe3)](_0x3aabaf[_0x477137(0xa4)])),_0x1e9361=_0x390099['length']+_0xdc28ee[_0x477137(0xd6)]+_0x2bf0e5[_0x477137(0xd6)];console[_0x477137(0xcc)](_0x477137(0xd9)+_0x390099['length']+_0x477137(0xc4)+(_0x390099[_0x477137(0xd6)]!==0x1?'s':'')+',\x20'+_0xdc28ee['length']+'\x20segment'+(_0xdc28ee[_0x477137(0xd6)]!==0x1?'s':'')+_0x477137(0xe7)+_0x2bf0e5[_0x477137(0xd6)]+_0x477137(0xc6)+(_0x2bf0e5[_0x477137(0xd6)]!==0x1?'s':'')+_0x477137(0xc5)+_0x38c286+'\x27');const _0xf61831=_0xfd18d5=>{const _0x309b71=_0x477137;return getConsoleNextUrl(_0x4f9e97[_0x309b71(0xd5)],_0x309b71(0xa9)+_0x32712e['parentId']+'/e/'+_0xfd18d5);},_0x50063b=_0x4f9e97['format']===_0x477137(0xea)||_0x4f9e97[_0x477137(0xcb)]===_0x477137(0xbb);if(_0x50063b){const _0x23b081=[..._0x390099[_0x477137(0xe4)](_0x420f5=>({..._0x420f5,'type':'folder'})),..._0xdc28ee[_0x477137(0xe4)](_0x3d8952=>({..._0x3d8952,'type':_0x477137(0xa1),'url':_0xf61831(_0x3d8952['id'])})),..._0x2bf0e5[_0x477137(0xe4)](_0xdbf276=>({..._0xdbf276,'name':_0xdbf276[_0x477137(0xa4)],'type':'journey'}))][_0x477137(0xd2)]((_0x34429d,_0x117e3e)=>_0x34429d[_0x477137(0xc8)]['localeCompare'](_0x117e3e['name']));await handleSDKOutput(_0x23b081,_0x4f9e97);}else{if(_0x1e9361===0x0)console['log'](_0x477137(0xce)+_0x38c286);else{console[_0x477137(0xba)](a45_0xcbdf15[_0x477137(0xda)]('['+_0x4b8917+_0x477137(0xaf)+_0x38c286+'\x27'));const _0x282ac6=formatFlatList(_0x390099,_0xdc28ee,{'showMetadata':!![],'getSegmentUrl':_0xf61831},_0x2bf0e5);console[_0x477137(0xba)](_0x282ac6);}}return 0x0;}async[a45_0x422d4e(0xec)](_0x10488d,_0x543482){const _0x1d7a7d=a45_0x422d4e,{options:_0x469930,tdx:_0x4a96bc}=_0x10488d,_0x105621=await withSpinner(_0x1d7a7d(0xb4)+_0x543482+'\x27...',()=>_0x4a96bc[_0x1d7a7d(0xa1)][_0x1d7a7d(0xa8)](_0x543482),{'verbose':_0x469930[_0x1d7a7d(0xc0)]}),_0x480e3f=_0x105621[_0x1d7a7d(0xbc)];_0x469930['verbose']&&(console[_0x1d7a7d(0xcc)](_0x1d7a7d(0xd0)+_0x480e3f[_0x1d7a7d(0xb5)]),_0x480e3f[_0x1d7a7d(0xcf)]&&console[_0x1d7a7d(0xcc)]('Folder\x20ID:\x20'+_0x480e3f[_0x1d7a7d(0xcf)]));const _0x112234=await withSpinner(_0x1d7a7d(0xc3),()=>_0x4a96bc[_0x1d7a7d(0xa1)][_0x1d7a7d(0x9e)](_0x480e3f[_0x1d7a7d(0xb5)],_0x480e3f[_0x1d7a7d(0xcf)]),{'verbose':_0x469930['verbose']}),{folders:_0x4e6fd8,segments:_0xfd36ae,journeys:_0xd6a53}=_0x112234['data'],_0x26e18a=_0x4e6fd8[_0x1d7a7d(0xd6)]+_0xfd36ae[_0x1d7a7d(0xd6)]+_0xd6a53['length'];console[_0x1d7a7d(0xcc)]('✔\x20Found\x20'+_0x4e6fd8[_0x1d7a7d(0xd6)]+_0x1d7a7d(0xc4)+(_0x4e6fd8[_0x1d7a7d(0xd6)]!==0x1?'s':'')+',\x20'+_0xfd36ae[_0x1d7a7d(0xd6)]+_0x1d7a7d(0xe1)+(_0xfd36ae[_0x1d7a7d(0xd6)]!==0x1?'s':'')+_0x1d7a7d(0xe7)+_0xd6a53['length']+_0x1d7a7d(0xc6)+(_0xd6a53['length']!==0x1?'s':''));const _0x58df67=_0x394631=>{const _0x20fb47=_0x1d7a7d;return getConsoleNextUrl(_0x469930['site'],'/app/ps/'+_0x480e3f['parentId']+_0x20fb47(0xad)+_0x394631);},_0x349f8a=_0x235f7b=>{const _0x2fb4da=_0x1d7a7d;return getConsoleNextUrl(_0x469930[_0x2fb4da(0xd5)],_0x2fb4da(0xa9)+_0x480e3f[_0x2fb4da(0xb5)]+_0x2fb4da(0xad)+_0x235f7b+_0x2fb4da(0xde));},_0x1af93a=_0x469930[_0x1d7a7d(0xcb)]===_0x1d7a7d(0xea)||_0x469930['format']==='jsonl';if(_0x1af93a){const _0x25c9c9=[..._0x4e6fd8[_0x1d7a7d(0xe4)](_0x3054e9=>({..._0x3054e9,'type':_0x1d7a7d(0x9d)})),..._0xfd36ae[_0x1d7a7d(0xe4)](_0x328734=>({..._0x328734,'type':_0x1d7a7d(0xa1),'url':_0x58df67(_0x328734['id'])})),..._0xd6a53[_0x1d7a7d(0xe4)](_0x5ba83f=>({..._0x5ba83f,'name':_0x5ba83f[_0x1d7a7d(0xa4)],'type':_0x1d7a7d(0xd7),'url':_0x349f8a(_0x5ba83f['id'])}))][_0x1d7a7d(0xd2)]((_0x1ef257,_0x27da7e)=>_0x1ef257[_0x1d7a7d(0xc8)][_0x1d7a7d(0xae)](_0x27da7e[_0x1d7a7d(0xc8)]));await handleSDKOutput(_0x25c9c9,_0x469930);}else{if(_0x26e18a===0x0)console[_0x1d7a7d(0xba)](a45_0xcbdf15['dim']('['+_0x543482+']')),console[_0x1d7a7d(0xba)](_0x1d7a7d(0xe5));else{console[_0x1d7a7d(0xba)](a45_0xcbdf15[_0x1d7a7d(0xda)]('['+_0x543482+']'));const _0x221ad1=formatFlatList(_0x4e6fd8,_0xfd36ae,{'showMetadata':!![],'getSegmentUrl':_0x58df67,'getJourneyUrl':_0x349f8a},_0xd6a53);console['log'](_0x221ad1);}}return 0x0;}async[a45_0x422d4e(0xc1)](_0x61b9d4,_0xf40c49){const _0x414716=a45_0x422d4e,{options:_0x324177,tdx:_0x1dce0a}=_0x61b9d4,_0x54f1bb=await withSpinner('Resolving\x20path\x20\x27'+_0xf40c49+'\x27...',()=>_0x1dce0a['segment']['resolvePathToResource'](_0xf40c49),{'verbose':_0x324177[_0x414716(0xc0)]}),_0x30a1f8=_0x54f1bb['data'];_0x324177[_0x414716(0xc0)]&&(console['error'](_0x414716(0xd0)+_0x30a1f8[_0x414716(0xb5)]),_0x30a1f8[_0x414716(0xcf)]&&console[_0x414716(0xcc)](_0x414716(0xb0)+_0x30a1f8['folderId']));const _0x1cf352=_0x324177[_0x414716(0xaa)]||0xa,_0x280d4b=await withSpinner(_0x414716(0xac),()=>_0x1dce0a[_0x414716(0xa1)][_0x414716(0xc1)](_0x30a1f8[_0x414716(0xb5)],_0x30a1f8['folderId'],0x0,_0x1cf352),{'verbose':_0x324177['verbose']}),_0x44186b=_0x280d4b[_0x414716(0xbc)],_0x452e0c=_0x4eceeb=>{const _0x322182=_0x414716;let _0x19dc16=0x0,_0x20fa1f=0x0,_0x1ddb5e=0x0;for(const _0x39c364 of _0x4eceeb){if(_0x39c364[_0x322182(0xc7)]===_0x322182(0x9d))_0x19dc16++;else{if(_0x39c364[_0x322182(0xc7)]===_0x322182(0xa1))_0x20fa1f++;else{if(_0x39c364[_0x322182(0xc7)]===_0x322182(0xd7))_0x1ddb5e++;}}if(_0x39c364[_0x322182(0xb2)]){const _0x3059fc=_0x452e0c(_0x39c364[_0x322182(0xb2)]);_0x19dc16+=_0x3059fc[_0x322182(0xe6)],_0x20fa1f+=_0x3059fc[_0x322182(0xa3)],_0x1ddb5e+=_0x3059fc[_0x322182(0xd4)];}}return{'folders':_0x19dc16,'segments':_0x20fa1f,'journeys':_0x1ddb5e};},_0xc21de5=_0x452e0c(_0x44186b);console[_0x414716(0xcc)](_0x414716(0xb9)+_0xc21de5['folders']+_0x414716(0xc4)+(_0xc21de5[_0x414716(0xe6)]!==0x1?'s':'')+',\x20'+_0xc21de5[_0x414716(0xa3)]+_0x414716(0xe1)+(_0xc21de5['segments']!==0x1?'s':'')+_0x414716(0xe7)+_0xc21de5[_0x414716(0xd4)]+'\x20journey'+(_0xc21de5['journeys']!==0x1?'s':''));const _0x3b04c3=_0x275a27=>{const _0x3386c5=_0x414716;return getConsoleNextUrl(_0x324177[_0x3386c5(0xd5)],_0x3386c5(0xa9)+_0x30a1f8[_0x3386c5(0xb5)]+'/e/'+_0x275a27);},_0x23b5b7=_0xe62707=>{const _0x250dad=_0x414716;return getConsoleNextUrl(_0x324177[_0x250dad(0xd5)],'/app/ps/'+_0x30a1f8['parentId']+'/e/'+_0xe62707+_0x250dad(0xde));};if(_0x324177[_0x414716(0xcb)]==='json'||_0x324177[_0x414716(0xcb)]===_0x414716(0xbb))await handleSDKOutput(_0x44186b,_0x324177);else{console[_0x414716(0xba)](a45_0xcbdf15[_0x414716(0xda)]('['+_0xf40c49+']'));const _0x2c5097=formatTree(_0x44186b,{'showMetadata':!![],'getSegmentUrl':_0x3b04c3,'getJourneyUrl':_0x23b5b7});console[_0x414716(0xba)](_0x2c5097);}return 0x0;}}
1
+ const a45_0x5bf4e4=a45_0x30b5;(function(_0xe8f782,_0x1ffb35){const _0x5f280a=a45_0x30b5,_0x376508=_0xe8f782();while(!![]){try{const _0x4cb9af=-parseInt(_0x5f280a(0x147))/0x1+-parseInt(_0x5f280a(0x15d))/0x2+-parseInt(_0x5f280a(0x173))/0x3*(-parseInt(_0x5f280a(0x17a))/0x4)+parseInt(_0x5f280a(0x144))/0x5+parseInt(_0x5f280a(0x174))/0x6+-parseInt(_0x5f280a(0x159))/0x7*(-parseInt(_0x5f280a(0x14a))/0x8)+-parseInt(_0x5f280a(0x161))/0x9;if(_0x4cb9af===_0x1ffb35)break;else _0x376508['push'](_0x376508['shift']());}catch(_0x298968){_0x376508['push'](_0x376508['shift']());}}}(a45_0x5447,0x83bbe));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';function a45_0x5447(){const _0x4876fa=['type','Site:\x20','listWithPattern','Use\x20tdx\x20ps\x20list\x20to\x20see\x20available\x20parent\x20segments.','journeys',']\x20matching\x20\x27','\x20folder','\x5c$&','format','\x27...','filter','parentId','parentSegment','List\x20folders\x20and\x20child\x20segments','3138HosiDb','4925556ynKhjY','/app/ps/','listUnified','length','✔\x20Found\x20','\x20\x20Cause:\x20','3644knEQNv','✔\x20Built\x20tree\x20with\x20','map','data','Resolving\x20path\x20\x27','Error:\x20','jsonl','verbose','message','Listing\x20folders,\x20segments,\x20and\x20journeys...','listUnifiedWithJourneys','\x20\x20tdx\x20sg\x20pull\x20\x22My\x20Audience\x22','segments','folder','Folder\x20ID:\x20','dim','folders','5220490WGWuIY','resolvePathToResource','Parent\x20ID:\x20','809772ZsbFXv','error','journeyBundleName','168naZsNV','segment','includes','name','log','\x20journey','json','listRecursive','replace','localeCompare','\x20segment','journey','test','(empty)','site','345275ukLVVz',',\x20and\x20','Building\x20hierarchy\x20tree...','Recursive\x20mode:\x20enabled','1743054NxzVKg','/e/','folderId','Set\x20a\x20parent\x20segment\x20context\x20first:','14695866NOLarz','children','cause','/j/da'];a45_0x5447=function(){return _0x4876fa;};return a45_0x5447();}import{withSpinner}from'../utils/spinner.js';function a45_0x30b5(_0x5751dc,_0x4e7448){_0x5751dc=_0x5751dc-0x13d;const _0x544785=a45_0x5447();let _0x30b512=_0x544785[_0x5751dc];return _0x30b512;}import{formatFlatList,formatTree}from'../sdk/util/tree-formatter.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import a45_0x53c0a0 from'chalk';export class SegmentsCommand extends BaseCommand{['name']=a45_0x5bf4e4(0x13f);['description']=a45_0x5bf4e4(0x172);async['execute'](_0x1c5cc8){const _0x2c8b40=a45_0x5bf4e4,{options:_0x2e47a8,args:_0x1afa6d}=_0x1c5cc8,_0x4ed428=_0x2e47a8['recursive'],_0x404eab=_0x1afa6d[0x0];try{const _0x50ced8=_0x2e47a8[_0x2c8b40(0x171)];_0x2e47a8[_0x2c8b40(0x181)]&&(console['error'](_0x2c8b40(0x166)+_0x2e47a8[_0x2c8b40(0x158)]),console[_0x2c8b40(0x148)]('Parent\x20segment\x20context:\x20'+(_0x50ced8||'(not\x20set)')),_0x404eab&&console[_0x2c8b40(0x148)]('Folder/pattern\x20arg:\x20'+_0x404eab),_0x4ed428&&console[_0x2c8b40(0x148)](_0x2c8b40(0x15c)));if(!_0x50ced8)return console[_0x2c8b40(0x148)]('Error:\x20No\x20parent\x20segment\x20context\x20set.'),console['error'](''),console['error'](_0x2c8b40(0x160)),console[_0x2c8b40(0x148)](_0x2c8b40(0x13e)),console[_0x2c8b40(0x148)]('\x20\x20tdx\x20sg\x20use\x20\x22My\x20Audience\x22'),console['error'](''),console[_0x2c8b40(0x148)](_0x2c8b40(0x168)),0x1;const _0x17a9c9=_0x404eab&&(_0x404eab[_0x2c8b40(0x14c)]('*')||_0x404eab[_0x2c8b40(0x14c)]('?'));if(_0x17a9c9)return await this[_0x2c8b40(0x167)](_0x1c5cc8,_0x50ced8,_0x404eab);const _0x14881b=_0x404eab?_0x50ced8+'/'+_0x404eab:_0x50ced8;return _0x4ed428?await this['listRecursive'](_0x1c5cc8,_0x14881b):await this[_0x2c8b40(0x176)](_0x1c5cc8,_0x14881b);}catch(_0x6ceb53){if(_0x6ceb53 instanceof SDKError)return console[_0x2c8b40(0x148)](_0x2c8b40(0x17f)+_0x6ceb53[_0x2c8b40(0x182)]),_0x6ceb53[_0x2c8b40(0x163)]&&console['error'](_0x2c8b40(0x179)+_0x6ceb53[_0x2c8b40(0x163)]),0x1;throw _0x6ceb53;}}async[a45_0x5bf4e4(0x167)](_0x4ff988,_0x5b77d2,_0x3d7076){const _0x1b7127=a45_0x5bf4e4,{options:_0x4c7293,tdx:_0x446b17}=_0x4ff988,_0x269a3c=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x5b77d2+_0x1b7127(0x16e),()=>_0x446b17[_0x1b7127(0x14b)]['resolvePathToResource'](_0x5b77d2),{'verbose':_0x4c7293[_0x1b7127(0x181)]}),_0x45b69f=_0x269a3c[_0x1b7127(0x17d)],_0x43282f=await withSpinner(_0x1b7127(0x183),()=>_0x446b17[_0x1b7127(0x14b)][_0x1b7127(0x13d)](_0x45b69f['parentId'],_0x45b69f[_0x1b7127(0x15f)]),{'verbose':_0x4c7293['verbose']}),{folders:_0x55e363,segments:_0x3402a1,journeys:_0x57192f}=_0x43282f[_0x1b7127(0x17d)],_0x30e044=_0x3d7076[_0x1b7127(0x152)](/[.+^${}()|[\]\\]/g,_0x1b7127(0x16c))['replace'](/\*/g,'.*')[_0x1b7127(0x152)](/\?/g,'.'),_0x5813be=new RegExp('^'+_0x30e044+'$','i'),_0x549ebc=_0x55e363[_0x1b7127(0x16f)](_0x2692ab=>_0x5813be[_0x1b7127(0x156)](_0x2692ab[_0x1b7127(0x14d)])),_0x4a39d8=_0x3402a1['filter'](_0x352729=>_0x5813be[_0x1b7127(0x156)](_0x352729[_0x1b7127(0x14d)])),_0x21990e=_0x57192f[_0x1b7127(0x16f)](_0x96ff04=>_0x5813be[_0x1b7127(0x156)](_0x96ff04[_0x1b7127(0x149)])),_0x2a49ec=_0x549ebc[_0x1b7127(0x177)]+_0x4a39d8[_0x1b7127(0x177)]+_0x21990e[_0x1b7127(0x177)];console[_0x1b7127(0x148)]('✔\x20Found\x20'+_0x549ebc[_0x1b7127(0x177)]+'\x20folder'+(_0x549ebc[_0x1b7127(0x177)]!==0x1?'s':'')+',\x20'+_0x4a39d8[_0x1b7127(0x177)]+_0x1b7127(0x154)+(_0x4a39d8[_0x1b7127(0x177)]!==0x1?'s':'')+_0x1b7127(0x15a)+_0x21990e[_0x1b7127(0x177)]+_0x1b7127(0x14f)+(_0x21990e[_0x1b7127(0x177)]!==0x1?'s':'')+'\x20matching\x20\x27'+_0x3d7076+'\x27');const _0xf40d23=_0x22346f=>{const _0x5d5f0b=_0x1b7127;return getConsoleNextUrl(_0x4c7293['site'],'/app/ps/'+_0x45b69f[_0x5d5f0b(0x170)]+'/e/'+_0x22346f);},_0x3b4517=_0x4c7293['format']===_0x1b7127(0x150)||_0x4c7293[_0x1b7127(0x16d)]==='jsonl';if(_0x3b4517){const _0x176714=[..._0x549ebc[_0x1b7127(0x17c)](_0x23200e=>({..._0x23200e,'type':_0x1b7127(0x140)})),..._0x4a39d8['map'](_0x298001=>({..._0x298001,'type':_0x1b7127(0x14b),'url':_0xf40d23(_0x298001['id'])})),..._0x21990e[_0x1b7127(0x17c)](_0x3fdc30=>({..._0x3fdc30,'name':_0x3fdc30['journeyBundleName'],'type':'journey'}))]['sort']((_0x34a11b,_0x955f80)=>_0x34a11b[_0x1b7127(0x14d)]['localeCompare'](_0x955f80[_0x1b7127(0x14d)]));await handleSDKOutput(_0x176714,_0x4c7293);}else{if(_0x2a49ec===0x0)console[_0x1b7127(0x14e)]('No\x20items\x20match\x20pattern:\x20'+_0x3d7076);else{console[_0x1b7127(0x14e)](a45_0x53c0a0[_0x1b7127(0x142)]('['+_0x5b77d2+_0x1b7127(0x16a)+_0x3d7076+'\x27'));const _0xb877fc=formatFlatList(_0x549ebc,_0x4a39d8,{'showMetadata':!![],'getSegmentUrl':_0xf40d23},_0x21990e);console[_0x1b7127(0x14e)](_0xb877fc);}}return 0x0;}async[a45_0x5bf4e4(0x176)](_0x19b8b4,_0x43df9c){const _0x17cd0c=a45_0x5bf4e4,{options:_0x43c403,tdx:_0x90470c}=_0x19b8b4,_0x10d63d=await withSpinner(_0x17cd0c(0x17e)+_0x43df9c+_0x17cd0c(0x16e),()=>_0x90470c[_0x17cd0c(0x14b)][_0x17cd0c(0x145)](_0x43df9c),{'verbose':_0x43c403['verbose']}),_0x2cdff9=_0x10d63d[_0x17cd0c(0x17d)];_0x43c403['verbose']&&(console[_0x17cd0c(0x148)](_0x17cd0c(0x146)+_0x2cdff9[_0x17cd0c(0x170)]),_0x2cdff9[_0x17cd0c(0x15f)]&&console[_0x17cd0c(0x148)](_0x17cd0c(0x141)+_0x2cdff9['folderId']));const _0x1abe83=await withSpinner(_0x17cd0c(0x183),()=>_0x90470c[_0x17cd0c(0x14b)][_0x17cd0c(0x13d)](_0x2cdff9[_0x17cd0c(0x170)],_0x2cdff9[_0x17cd0c(0x15f)]),{'verbose':_0x43c403[_0x17cd0c(0x181)]}),{folders:_0x39c368,segments:_0x3efd25,journeys:_0x2c93be}=_0x1abe83['data'],_0x4462e0=_0x39c368[_0x17cd0c(0x177)]+_0x3efd25[_0x17cd0c(0x177)]+_0x2c93be[_0x17cd0c(0x177)];console[_0x17cd0c(0x148)](_0x17cd0c(0x178)+_0x39c368[_0x17cd0c(0x177)]+'\x20folder'+(_0x39c368['length']!==0x1?'s':'')+',\x20'+_0x3efd25[_0x17cd0c(0x177)]+_0x17cd0c(0x154)+(_0x3efd25[_0x17cd0c(0x177)]!==0x1?'s':'')+_0x17cd0c(0x15a)+_0x2c93be[_0x17cd0c(0x177)]+'\x20journey'+(_0x2c93be[_0x17cd0c(0x177)]!==0x1?'s':''));const _0x11bab2=_0x175151=>{const _0x253f82=_0x17cd0c;return getConsoleNextUrl(_0x43c403['site'],_0x253f82(0x175)+_0x2cdff9[_0x253f82(0x170)]+_0x253f82(0x15e)+_0x175151);},_0x24e167=_0x440f32=>{const _0x42d18f=_0x17cd0c;return getConsoleNextUrl(_0x43c403[_0x42d18f(0x158)],_0x42d18f(0x175)+_0x2cdff9[_0x42d18f(0x170)]+_0x42d18f(0x15e)+_0x440f32+_0x42d18f(0x164));},_0xc1994e=_0x43c403['format']==='json'||_0x43c403['format']===_0x17cd0c(0x180);if(_0xc1994e){const _0x220267=[..._0x39c368[_0x17cd0c(0x17c)](_0x2c95af=>({..._0x2c95af,'type':_0x17cd0c(0x140)})),..._0x3efd25['map'](_0xdae5b9=>({..._0xdae5b9,'type':_0x17cd0c(0x14b),'url':_0x11bab2(_0xdae5b9['id'])})),..._0x2c93be[_0x17cd0c(0x17c)](_0x2787df=>({..._0x2787df,'name':_0x2787df[_0x17cd0c(0x149)],'type':_0x17cd0c(0x155),'url':_0x24e167(_0x2787df['id'])}))]['sort']((_0x1c6f1a,_0x538def)=>_0x1c6f1a[_0x17cd0c(0x14d)][_0x17cd0c(0x153)](_0x538def['name']));await handleSDKOutput(_0x220267,_0x43c403);}else{if(_0x4462e0===0x0)console[_0x17cd0c(0x14e)](a45_0x53c0a0[_0x17cd0c(0x142)]('['+_0x43df9c+']')),console[_0x17cd0c(0x14e)](_0x17cd0c(0x157));else{console[_0x17cd0c(0x14e)](a45_0x53c0a0[_0x17cd0c(0x142)]('['+_0x43df9c+']'));const _0x433f4e=formatFlatList(_0x39c368,_0x3efd25,{'showMetadata':!![],'getSegmentUrl':_0x11bab2,'getJourneyUrl':_0x24e167},_0x2c93be);console[_0x17cd0c(0x14e)](_0x433f4e);}}return 0x0;}async['listRecursive'](_0x548922,_0x496d7a){const _0x5bafea=a45_0x5bf4e4,{options:_0x3bf6e5,tdx:_0x4b8ced}=_0x548922,_0x5a6424=await withSpinner(_0x5bafea(0x17e)+_0x496d7a+_0x5bafea(0x16e),()=>_0x4b8ced['segment']['resolvePathToResource'](_0x496d7a),{'verbose':_0x3bf6e5[_0x5bafea(0x181)]}),_0x1458f5=_0x5a6424[_0x5bafea(0x17d)];_0x3bf6e5[_0x5bafea(0x181)]&&(console[_0x5bafea(0x148)](_0x5bafea(0x146)+_0x1458f5[_0x5bafea(0x170)]),_0x1458f5[_0x5bafea(0x15f)]&&console[_0x5bafea(0x148)](_0x5bafea(0x141)+_0x1458f5[_0x5bafea(0x15f)]));const _0x50b0fe=_0x3bf6e5['maxDepth']||0xa,_0x581bca=await withSpinner(_0x5bafea(0x15b),()=>_0x4b8ced['segment'][_0x5bafea(0x151)](_0x1458f5[_0x5bafea(0x170)],_0x1458f5['folderId'],0x0,_0x50b0fe),{'verbose':_0x3bf6e5[_0x5bafea(0x181)]}),_0x78a260=_0x581bca[_0x5bafea(0x17d)],_0x428356=_0x4d2703=>{const _0x48bd7c=_0x5bafea;let _0x35468b=0x0,_0xfa021c=0x0,_0x313757=0x0;for(const _0x109542 of _0x4d2703){if(_0x109542['type']===_0x48bd7c(0x140))_0x35468b++;else{if(_0x109542[_0x48bd7c(0x165)]===_0x48bd7c(0x14b))_0xfa021c++;else{if(_0x109542[_0x48bd7c(0x165)]==='journey')_0x313757++;}}if(_0x109542[_0x48bd7c(0x162)]){const _0x1209a3=_0x428356(_0x109542[_0x48bd7c(0x162)]);_0x35468b+=_0x1209a3[_0x48bd7c(0x143)],_0xfa021c+=_0x1209a3[_0x48bd7c(0x13f)],_0x313757+=_0x1209a3[_0x48bd7c(0x169)];}}return{'folders':_0x35468b,'segments':_0xfa021c,'journeys':_0x313757};},_0x303eb4=_0x428356(_0x78a260);console['error'](_0x5bafea(0x17b)+_0x303eb4['folders']+_0x5bafea(0x16b)+(_0x303eb4[_0x5bafea(0x143)]!==0x1?'s':'')+',\x20'+_0x303eb4[_0x5bafea(0x13f)]+_0x5bafea(0x154)+(_0x303eb4[_0x5bafea(0x13f)]!==0x1?'s':'')+_0x5bafea(0x15a)+_0x303eb4[_0x5bafea(0x169)]+'\x20journey'+(_0x303eb4[_0x5bafea(0x169)]!==0x1?'s':''));const _0x52262e=_0x3580a7=>{const _0x2a67d8=_0x5bafea;return getConsoleNextUrl(_0x3bf6e5[_0x2a67d8(0x158)],_0x2a67d8(0x175)+_0x1458f5['parentId']+_0x2a67d8(0x15e)+_0x3580a7);},_0x3690e0=_0xd333cd=>{const _0x2e074c=_0x5bafea;return getConsoleNextUrl(_0x3bf6e5[_0x2e074c(0x158)],_0x2e074c(0x175)+_0x1458f5[_0x2e074c(0x170)]+'/e/'+_0xd333cd+'/j/da');};if(_0x3bf6e5[_0x5bafea(0x16d)]===_0x5bafea(0x150)||_0x3bf6e5['format']===_0x5bafea(0x180))await handleSDKOutput(_0x78a260,_0x3bf6e5);else{console[_0x5bafea(0x14e)](a45_0x53c0a0[_0x5bafea(0x142)]('['+_0x496d7a+']'));const _0x4bfa52=formatTree(_0x78a260,{'showMetadata':!![],'getSegmentUrl':_0x52262e,'getJourneyUrl':_0x3690e0});console[_0x5bafea(0x14e)](_0x4bfa52);}return 0x0;}}
@@ -1 +1 @@
1
- function a46_0x3ef5(_0x111d0e,_0x18cc2a){_0x111d0e=_0x111d0e-0x13f;const _0x298708=a46_0x2987();let _0x3ef5cc=_0x298708[_0x111d0e];return _0x3ef5cc;}const a46_0x22d128=a46_0x3ef5;(function(_0x22cf56,_0x5a3277){const _0x4566f2=a46_0x3ef5,_0x41b806=_0x22cf56();while(!![]){try{const _0x1b371c=-parseInt(_0x4566f2(0x15f))/0x1+-parseInt(_0x4566f2(0x145))/0x2*(-parseInt(_0x4566f2(0x167))/0x3)+-parseInt(_0x4566f2(0x14e))/0x4+-parseInt(_0x4566f2(0x144))/0x5*(parseInt(_0x4566f2(0x150))/0x6)+parseInt(_0x4566f2(0x168))/0x7*(parseInt(_0x4566f2(0x143))/0x8)+parseInt(_0x4566f2(0x15c))/0x9*(-parseInt(_0x4566f2(0x158))/0xa)+parseInt(_0x4566f2(0x169))/0xb;if(_0x1b371c===_0x5a3277)break;else _0x41b806['push'](_0x41b806['shift']());}catch(_0x2562c6){_0x41b806['push'](_0x41b806['shift']());}}}(a46_0x2987,0x394fc));function a46_0x2987(){const _0x37e9f5=['Querying\x20','10mGBWoR','cause','\x20row','data','2217627TdpCuh','limit','query','142718FGdwPi','Usage:\x20tdx\x20show\x20<database.table>','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','Database:\x20','Site:\x20','✔\x20Query\x20successful\x20-\x200\x20rows\x20returned','\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>','message','66mNLlLp','7NvgcSm','2100428anFcKZ','validate','name','Error:\x20','...','2949712yoMhWQ','64805yyPHmD','7936McVZuS','catalog','length','database','execute','show','Table:\x20','verbose','showTable','40512ynObUG','\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>','6peaDVP','args','Usage:\x20tdx\x20show\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--in\x20<database>\x0a\x0aRun\x20\x27tdx\x20show\x20--help\x27\x20for\x20more\x20options','table','Show\x20table\x20contents','description','error'];a46_0x2987=function(){return _0x37e9f5;};return a46_0x2987();}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_0x22d128(0x140)]=a46_0x22d128(0x14a);[a46_0x22d128(0x155)]=a46_0x22d128(0x154);async[a46_0x22d128(0x149)](_0x2f61ea){const _0x2c6c99=a46_0x22d128;return this[_0x2c6c99(0x14d)](_0x2f61ea);}async[a46_0x22d128(0x14d)](_0x38fc8f){const _0x178bdc=a46_0x22d128,{options:_0x45650f,args:_0xab2ef7,tdx:_0x59dc37}=_0x38fc8f;let _0x4d67b4;try{_0x4d67b4=parseTableReference(_0xab2ef7[0x0]);const _0x424cbd=_0x45650f[_0x178bdc(0x148)];!_0x4d67b4[_0x178bdc(0x148)]&&_0x424cbd&&(_0x4d67b4['database']=_0x424cbd);const _0x204a9c=validateTableDescribeReference(_0x4d67b4);if(_0x204a9c)return console[_0x178bdc(0x156)](_0x178bdc(0x141)+_0x204a9c),console[_0x178bdc(0x156)](_0x178bdc(0x160)),console[_0x178bdc(0x156)](_0x178bdc(0x14f)),console[_0x178bdc(0x156)](_0x178bdc(0x165)),0x1;}catch(_0x3e9900){return console[_0x178bdc(0x156)](_0x178bdc(0x141)+_0x3e9900[_0x178bdc(0x166)]),console['error']('Usage:\x20tdx\x20show\x20<database.table>'),console['error'](_0x178bdc(0x14f)),console[_0x178bdc(0x156)](_0x178bdc(0x165)),0x1;}const _0xd17a10=_0x4d67b4[_0x178bdc(0x146)],_0x488fd0=_0x4d67b4[_0x178bdc(0x148)],_0x53db89=_0x4d67b4[_0x178bdc(0x153)],_0x116ecb=resolveLimit(_0x45650f[_0x178bdc(0x15d)],DEFAULT_DISPLAY_LIMIT);try{_0x45650f['verbose']&&(console[_0x178bdc(0x156)](_0x178bdc(0x163)+_0x45650f['site']),_0xd17a10&&console['error']('Catalog:\x20'+_0xd17a10),console[_0x178bdc(0x156)](_0x178bdc(0x162)+_0x488fd0),console[_0x178bdc(0x156)](_0x178bdc(0x14b)+_0x53db89),console['error']('Limit:\x20'+_0x116ecb));const _0x25b04f=_0xd17a10?_0xd17a10+'.'+_0x488fd0+'.'+_0x53db89:_0x488fd0+'.'+_0x53db89,_0x39f748=await withSpinner(_0x178bdc(0x157)+_0x25b04f+_0x178bdc(0x142),()=>_0x59dc37[_0x178bdc(0x15e)][_0x178bdc(0x14d)](_0x488fd0,_0x53db89,_0x116ecb,_0xd17a10),{'verbose':_0x45650f[_0x178bdc(0x14c)]}),_0x48275d=_0x39f748[_0x178bdc(0x15b)],_0x5b919e=_0x48275d[_0x178bdc(0x15b)];return _0x5b919e[_0x178bdc(0x147)]===0x0?console[_0x178bdc(0x156)](_0x178bdc(0x164)):console[_0x178bdc(0x156)]('✔\x20Retrieved\x20'+_0x5b919e[_0x178bdc(0x147)]+_0x178bdc(0x15a)+(_0x5b919e[_0x178bdc(0x147)]!==0x1?'s':'')+'\x20from\x20'+_0x25b04f),await handleSDKOutput(_0x5b919e,_0x45650f),0x0;}catch(_0x2d3307){if(_0x2d3307 instanceof SDKError)return console[_0x178bdc(0x156)](_0x178bdc(0x141)+_0x2d3307[_0x178bdc(0x166)]),_0x2d3307[_0x178bdc(0x159)]&&console[_0x178bdc(0x156)]('\x20\x20Cause:\x20'+_0x2d3307['cause']),0x1;throw _0x2d3307;}}[a46_0x22d128(0x13f)](_0x2f8d94){const _0x129ffb=a46_0x22d128;if(_0x2f8d94['args'][_0x129ffb(0x147)]===0x0)return _0x129ffb(0x152);if(_0x2f8d94[_0x129ffb(0x151)][_0x129ffb(0x147)]>0x1)return _0x129ffb(0x161);return undefined;}}
1
+ const a46_0x2fcbcd=a46_0x1af3;(function(_0x71bc4c,_0x3dc812){const _0x4584cf=a46_0x1af3,_0x319417=_0x71bc4c();while(!![]){try{const _0x332093=-parseInt(_0x4584cf(0xf6))/0x1+-parseInt(_0x4584cf(0x10a))/0x2+parseInt(_0x4584cf(0x110))/0x3+parseInt(_0x4584cf(0x10f))/0x4+parseInt(_0x4584cf(0xf1))/0x5*(parseInt(_0x4584cf(0xeb))/0x6)+parseInt(_0x4584cf(0x108))/0x7*(parseInt(_0x4584cf(0xfb))/0x8)+-parseInt(_0x4584cf(0xfa))/0x9*(parseInt(_0x4584cf(0x10c))/0xa);if(_0x332093===_0x3dc812)break;else _0x319417['push'](_0x319417['shift']());}catch(_0x43f764){_0x319417['push'](_0x319417['shift']());}}}(a46_0x57ed,0x97bb2));import{BaseCommand}from'./command.js';function a46_0x57ed(){const _0x255d91=['\x20row','\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>','name','error','limit','Catalog:\x20','\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>','cause','\x20from\x20','Too\x20many\x20arguments\x0aUsage:\x20tdx\x20show\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>\x0a\x0aRun\x20\x27tdx\x20show\x20--help\x27\x20for\x20more\x20options','query','verbose','525dREoMX','showTable','2199112LWIjBH','length','1700uuKmTN','site','database','4594264mXPEAh','2359869zayGsF','12216mjuvBd','Usage:\x20tdx\x20show\x20<database.table>','Querying\x20','data','table','Show\x20table\x20contents','335BnEcvs','catalog','args','✔\x20Query\x20successful\x20-\x200\x20rows\x20returned','Table:\x20','220190oiiwjG','Error:\x20','message','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','7803xeTaBa','1816nGgDQr'];a46_0x57ed=function(){return _0x255d91;};return a46_0x57ed();}import{SDKError}from'../sdk/index.js';function a46_0x1af3(_0x384019,_0xd67038){_0x384019=_0x384019-0xeb;const _0x57edbf=a46_0x57ed();let _0x1af388=_0x57edbf[_0x384019];return _0x1af388;}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_0x2fcbcd(0xfe)]='show';['description']=a46_0x2fcbcd(0xf0);async['execute'](_0x21e939){return this['showTable'](_0x21e939);}async['showTable'](_0x4f297d){const _0x4bb0ba=a46_0x2fcbcd,{options:_0x4f90d3,args:_0x2b6137,tdx:_0x29750c}=_0x4f297d;let _0x31f128;try{_0x31f128=parseTableReference(_0x2b6137[0x0]);const _0x17029e=_0x4f90d3['database'];!_0x31f128[_0x4bb0ba(0x10e)]&&_0x17029e&&(_0x31f128[_0x4bb0ba(0x10e)]=_0x17029e);const _0x57bfbe=validateTableDescribeReference(_0x31f128);if(_0x57bfbe)return console[_0x4bb0ba(0xff)]('Error:\x20'+_0x57bfbe),console[_0x4bb0ba(0xff)](_0x4bb0ba(0xec)),console[_0x4bb0ba(0xff)](_0x4bb0ba(0xfd)),console[_0x4bb0ba(0xff)](_0x4bb0ba(0x102)),0x1;}catch(_0x28d8cf){return console[_0x4bb0ba(0xff)](_0x4bb0ba(0xf7)+_0x28d8cf[_0x4bb0ba(0xf8)]),console[_0x4bb0ba(0xff)](_0x4bb0ba(0xec)),console[_0x4bb0ba(0xff)](_0x4bb0ba(0xfd)),console[_0x4bb0ba(0xff)](_0x4bb0ba(0x102)),0x1;}const _0x2e60bb=_0x31f128[_0x4bb0ba(0xf2)],_0x5c71cc=_0x31f128['database'],_0x2a3f63=_0x31f128[_0x4bb0ba(0xef)],_0x5a911f=resolveLimit(_0x4f90d3[_0x4bb0ba(0x100)],DEFAULT_DISPLAY_LIMIT);try{_0x4f90d3['verbose']&&(console[_0x4bb0ba(0xff)]('Site:\x20'+_0x4f90d3[_0x4bb0ba(0x10d)]),_0x2e60bb&&console[_0x4bb0ba(0xff)](_0x4bb0ba(0x101)+_0x2e60bb),console[_0x4bb0ba(0xff)]('Database:\x20'+_0x5c71cc),console[_0x4bb0ba(0xff)](_0x4bb0ba(0xf5)+_0x2a3f63),console[_0x4bb0ba(0xff)]('Limit:\x20'+_0x5a911f));const _0x29df00=_0x2e60bb?_0x2e60bb+'.'+_0x5c71cc+'.'+_0x2a3f63:_0x5c71cc+'.'+_0x2a3f63,_0x23a25a=await withSpinner(_0x4bb0ba(0xed)+_0x29df00+'...',()=>_0x29750c[_0x4bb0ba(0x106)][_0x4bb0ba(0x109)](_0x5c71cc,_0x2a3f63,_0x5a911f,_0x2e60bb),{'verbose':_0x4f90d3[_0x4bb0ba(0x107)]}),_0x18a608=_0x23a25a['data'],_0x47c082=_0x18a608[_0x4bb0ba(0xee)];return _0x47c082[_0x4bb0ba(0x10b)]===0x0?console[_0x4bb0ba(0xff)](_0x4bb0ba(0xf4)):console[_0x4bb0ba(0xff)]('✔\x20Retrieved\x20'+_0x47c082[_0x4bb0ba(0x10b)]+_0x4bb0ba(0xfc)+(_0x47c082[_0x4bb0ba(0x10b)]!==0x1?'s':'')+_0x4bb0ba(0x104)+_0x29df00),await handleSDKOutput(_0x47c082,_0x4f90d3),0x0;}catch(_0x4f7a32){if(_0x4f7a32 instanceof SDKError)return console[_0x4bb0ba(0xff)]('Error:\x20'+_0x4f7a32[_0x4bb0ba(0xf8)]),_0x4f7a32[_0x4bb0ba(0x103)]&&console['error']('\x20\x20Cause:\x20'+_0x4f7a32['cause']),0x1;throw _0x4f7a32;}}['validate'](_0x13c6fd){const _0x11f06a=a46_0x2fcbcd;if(_0x13c6fd[_0x11f06a(0xf3)][_0x11f06a(0x10b)]===0x0)return _0x11f06a(0xf9);if(_0x13c6fd['args']['length']>0x1)return _0x11f06a(0x105);return undefined;}}
@@ -1 +1 @@
1
- function a47_0x5c16(){const _0x433548=['env','2403176NwMyYt','profileSource','email','N/A','join','description','User:','site:\x20','profile','status','displayWithSources','last_name','Credential\x20type:\x20','yellow','green','config','2267736ySdIAl','TDX_PROFILE\x20env','getUserInfo','filter','574584CneyfY','Account\x20ID:','905DTOVsa','name','bold','CLI\x20flag','15163776mpWmBg','message','(from\x20','jobs','session','cli','tdx','dim','Read\x20credential\x20from\x20','3000305JgzLLu','3580IMemjT','first_name','cyan','5891767iPQUsY','log','✗\x20Validation\x20failed:\x20','\x20profile:\x20'];a47_0x5c16=function(){return _0x433548;};return a47_0x5c16();}const a47_0xa52181=a47_0x3ee2;(function(_0x6677aa,_0x174885){const _0xde3dc1=a47_0x3ee2,_0x19d19c=_0x6677aa();while(!![]){try{const _0x1be13a=parseInt(_0xde3dc1(0xa0))/0x1*(parseInt(_0xde3dc1(0xae))/0x2)+-parseInt(_0xde3dc1(0xc6))/0x3+parseInt(_0xde3dc1(0xb6))/0x4+parseInt(_0xde3dc1(0xad))/0x5+-parseInt(_0xde3dc1(0x9e))/0x6+parseInt(_0xde3dc1(0xb1))/0x7+-parseInt(_0xde3dc1(0xa4))/0x8;if(_0x1be13a===_0x174885)break;else _0x19d19c['push'](_0x19d19c['shift']());}catch(_0x1dca5d){_0x19d19c['push'](_0x19d19c['shift']());}}}(a47_0x5c16,0xdf78a));import{BaseCommand,printAuthError}from'./command.js';import{resolveAPIKeyAsync}from'../core/config.js';function a47_0x3ee2(_0x455048,_0x1ac0d3){_0x455048=_0x455048-0x9b;const _0x5c16d1=a47_0x5c16();let _0x3ee2bc=_0x5c16d1[_0x455048];return _0x3ee2bc;}import{getOAuthTokens}from'../core/oauth-keychain.js';import{HTTPClientError}from'../sdk/client/http-client.js';import{GlobalContext}from'../core/global-context.js';import a47_0x3441f5 from'chalk';export class StatusCommand extends BaseCommand{[a47_0xa52181(0xa1)]='status';[a47_0xa52181(0xbb)]='Show\x20authentication\x20status\x20and\x20current\x20context';async['execute'](_0x232a79){const _0x1e5ee7=a47_0xa52181,{options:_0x3def89,tdx:_0xc329e6}=_0x232a79,_0x2a004e=_0x3def89['site'],_0xd744cb=new GlobalContext(_0x3def89),_0x4a0bd0=_0xd744cb[_0x1e5ee7(0xbe)],_0x76df3d=_0xd744cb[_0x1e5ee7(0xb7)],_0x1f36bc=_0x76df3d===_0x1e5ee7(0xa9)?_0x1e5ee7(0xa3):_0x76df3d===_0x1e5ee7(0xa8)?_0x1e5ee7(0xa8):_0x76df3d===_0x1e5ee7(0xb5)?_0x1e5ee7(0x9b):_0x76df3d===_0x1e5ee7(0xc5)?_0x1e5ee7(0xc5):null,_0x41f56d=_0x4a0bd0?a47_0x3441f5[_0x1e5ee7(0xb0)](_0x4a0bd0):a47_0x3441f5[_0x1e5ee7(0xab)](_0x1e5ee7(0xb9)),_0x29aa51=_0x1f36bc?'\x20'+a47_0x3441f5[_0x1e5ee7(0xab)](_0x1e5ee7(0xa6)+_0x1f36bc+')'):'';console['log'](a47_0x3441f5[_0x1e5ee7(0xa2)](_0x1e5ee7(0xaa))+_0x1e5ee7(0xb4)+_0x41f56d+_0x29aa51+'\x20'+a47_0x3441f5['dim']('(')+_0x1e5ee7(0xbd)+a47_0x3441f5[_0x1e5ee7(0xb0)](_0x2a004e)+a47_0x3441f5[_0x1e5ee7(0xab)](')'));const _0x581af6=await getOAuthTokens(_0x4a0bd0);if(_0x581af6)console[_0x1e5ee7(0xb2)](_0x1e5ee7(0xc2)+a47_0x3441f5[_0x1e5ee7(0xb0)]('OAuth'));else{const _0x57410f=await resolveAPIKeyAsync(_0x2a004e,_0x4a0bd0);if(_0x57410f){const {source:_0x3fdf9a,isDeprecated:_0x45d043}=_0x57410f,_0x2ccd35=_0x1e5ee7(0xac)+a47_0x3441f5[_0x1e5ee7(0xb0)](_0x3fdf9a);console['log'](_0x45d043?a47_0x3441f5[_0x1e5ee7(0xc3)](_0x2ccd35):_0x2ccd35);}else console[_0x1e5ee7(0xb2)](a47_0x3441f5['yellow']('No\x20credential\x20found'));}let _0x428485=![];try{const _0x5d8a30=await _0xc329e6[_0x1e5ee7(0xa7)][_0x1e5ee7(0x9c)]();console[_0x1e5ee7(0xb2)](a47_0x3441f5[_0x1e5ee7(0xc4)]('✓\x20Authentication\x20successful\x0a')),console[_0x1e5ee7(0xb2)](a47_0x3441f5[_0x1e5ee7(0xa2)](_0x1e5ee7(0xbc))+'\x20'+a47_0x3441f5['cyan'](_0x5d8a30[_0x1e5ee7(0xb8)]));if(_0x5d8a30[_0x1e5ee7(0xaf)]||_0x5d8a30['last_name']){const _0x4a61d5=[_0x5d8a30[_0x1e5ee7(0xaf)],_0x5d8a30[_0x1e5ee7(0xc1)]][_0x1e5ee7(0x9d)](Boolean)[_0x1e5ee7(0xba)]('\x20');console['log'](a47_0x3441f5[_0x1e5ee7(0xa2)]('Name:')+'\x20'+_0x4a61d5);}_0x5d8a30['account_id']&&console['log'](a47_0x3441f5[_0x1e5ee7(0xa2)](_0x1e5ee7(0x9f))+'\x20'+a47_0x3441f5[_0x1e5ee7(0xc3)](_0x5d8a30['account_id'])),_0x428485=!![];}catch(_0x1b0c54){_0x1b0c54 instanceof HTTPClientError&&_0x1b0c54[_0x1e5ee7(0xbf)]===0x191?printAuthError(_0x1b0c54,!![],_0x4a0bd0):console['error'](a47_0x3441f5['red'](_0x1e5ee7(0xb3)+(_0x1b0c54 instanceof Error?_0x1b0c54[_0x1e5ee7(0xa5)]:String(_0x1b0c54))));}return console[_0x1e5ee7(0xb2)](),_0xd744cb[_0x1e5ee7(0xc0)](),_0x428485?0x0:0x1;}}
1
+ const a47_0x3e3bc3=a47_0x4249;function a47_0x4249(_0x1418c8,_0x22ded2){_0x1418c8=_0x1418c8-0x1f3;const _0x3fb7a6=a47_0x3fb7();let _0x424936=_0x3fb7a6[_0x1418c8];return _0x424936;}(function(_0x4bd367,_0x48d88e){const _0x30d219=a47_0x4249,_0x3ecc35=_0x4bd367();while(!![]){try{const _0x1087bd=parseInt(_0x30d219(0x219))/0x1+parseInt(_0x30d219(0x1fc))/0x2*(-parseInt(_0x30d219(0x206))/0x3)+parseInt(_0x30d219(0x1fa))/0x4+parseInt(_0x30d219(0x205))/0x5+parseInt(_0x30d219(0x21e))/0x6+-parseInt(_0x30d219(0x214))/0x7+-parseInt(_0x30d219(0x217))/0x8*(-parseInt(_0x30d219(0x212))/0x9);if(_0x1087bd===_0x48d88e)break;else _0x3ecc35['push'](_0x3ecc35['shift']());}catch(_0x2a2f11){_0x3ecc35['push'](_0x3ecc35['shift']());}}}(a47_0x3fb7,0xdeb8d));import{BaseCommand,printAuthError}from'./command.js';import{resolveAPIKeyAsync}from'../core/config.js';import{getOAuthTokens}from'../core/oauth-keychain.js';import{HTTPClientError}from'../sdk/client/http-client.js';import{GlobalContext}from'../core/global-context.js';function a47_0x3fb7(){const _0x1ce450=['execute','1307632NazSTW','session','191974QqrdzA','site:\x20','User:','account_id','tdx','error','first_name','profile','\x20profile:\x20','2589820dnSscC','39pyuwrE','jobs','message','red','cyan','getUserInfo','TDX_PROFILE\x20env','cli','green','dim','last_name','OAuth','2763gyOnPi','yellow','9017883GdgSzv','site','status','12680phOftU','displayWithSources','1597341xfBpdY','Name:','Show\x20authentication\x20status\x20and\x20current\x20context','email','N/A','3117366uvPvQu','✗\x20Validation\x20failed:\x20','bold','CLI\x20flag','log','config','Account\x20ID:','✓\x20Authentication\x20successful\x0a'];a47_0x3fb7=function(){return _0x1ce450;};return a47_0x3fb7();}import a47_0xa37b4b from'chalk';export class StatusCommand extends BaseCommand{['name']='status';['description']=a47_0x3e3bc3(0x21b);async[a47_0x3e3bc3(0x1f9)](_0x470568){const _0x5e67dc=a47_0x3e3bc3,{options:_0x58763,tdx:_0x44aebb}=_0x470568,_0x5460a6=_0x58763[_0x5e67dc(0x215)],_0x4b8612=new GlobalContext(_0x58763),_0x58ad65=_0x4b8612[_0x5e67dc(0x203)],_0x1044ae=_0x4b8612['profileSource'],_0x4fae34=_0x1044ae===_0x5e67dc(0x20d)?_0x5e67dc(0x1f4):_0x1044ae==='session'?_0x5e67dc(0x1fb):_0x1044ae==='env'?_0x5e67dc(0x20c):_0x1044ae===_0x5e67dc(0x1f6)?_0x5e67dc(0x1f6):null,_0x4375a5=_0x58ad65?a47_0xa37b4b[_0x5e67dc(0x20a)](_0x58ad65):a47_0xa37b4b['dim'](_0x5e67dc(0x21d)),_0x101141=_0x4fae34?'\x20'+a47_0xa37b4b[_0x5e67dc(0x20f)]('(from\x20'+_0x4fae34+')'):'';console[_0x5e67dc(0x1f5)](a47_0xa37b4b['bold'](_0x5e67dc(0x200))+_0x5e67dc(0x204)+_0x4375a5+_0x101141+'\x20'+a47_0xa37b4b[_0x5e67dc(0x20f)]('(')+_0x5e67dc(0x1fd)+a47_0xa37b4b[_0x5e67dc(0x20a)](_0x5460a6)+a47_0xa37b4b[_0x5e67dc(0x20f)](')'));const _0x154731=await getOAuthTokens(_0x58ad65);if(_0x154731)console[_0x5e67dc(0x1f5)]('Credential\x20type:\x20'+a47_0xa37b4b['cyan'](_0x5e67dc(0x211)));else{const _0x200e02=await resolveAPIKeyAsync(_0x5460a6,_0x58ad65);if(_0x200e02){const {source:_0x98479a,isDeprecated:_0xa1a75c}=_0x200e02,_0x115196='Read\x20credential\x20from\x20'+a47_0xa37b4b[_0x5e67dc(0x20a)](_0x98479a);console[_0x5e67dc(0x1f5)](_0xa1a75c?a47_0xa37b4b['yellow'](_0x115196):_0x115196);}else console[_0x5e67dc(0x1f5)](a47_0xa37b4b[_0x5e67dc(0x213)]('No\x20credential\x20found'));}let _0x23f328=![];try{const _0x50126d=await _0x44aebb[_0x5e67dc(0x207)][_0x5e67dc(0x20b)]();console[_0x5e67dc(0x1f5)](a47_0xa37b4b[_0x5e67dc(0x20e)](_0x5e67dc(0x1f8))),console['log'](a47_0xa37b4b[_0x5e67dc(0x1f3)](_0x5e67dc(0x1fe))+'\x20'+a47_0xa37b4b[_0x5e67dc(0x20a)](_0x50126d[_0x5e67dc(0x21c)]));if(_0x50126d[_0x5e67dc(0x202)]||_0x50126d[_0x5e67dc(0x210)]){const _0xe53fac=[_0x50126d[_0x5e67dc(0x202)],_0x50126d[_0x5e67dc(0x210)]]['filter'](Boolean)['join']('\x20');console[_0x5e67dc(0x1f5)](a47_0xa37b4b[_0x5e67dc(0x1f3)](_0x5e67dc(0x21a))+'\x20'+_0xe53fac);}_0x50126d['account_id']&&console[_0x5e67dc(0x1f5)](a47_0xa37b4b[_0x5e67dc(0x1f3)](_0x5e67dc(0x1f7))+'\x20'+a47_0xa37b4b['yellow'](_0x50126d[_0x5e67dc(0x1ff)])),_0x23f328=!![];}catch(_0x27ed66){_0x27ed66 instanceof HTTPClientError&&_0x27ed66[_0x5e67dc(0x216)]===0x191?printAuthError(_0x27ed66,!![],_0x58ad65):console[_0x5e67dc(0x201)](a47_0xa37b4b[_0x5e67dc(0x209)](_0x5e67dc(0x21f)+(_0x27ed66 instanceof Error?_0x27ed66[_0x5e67dc(0x208)]:String(_0x27ed66))));}return console['log'](),_0x4b8612[_0x5e67dc(0x218)](),_0x23f328?0x0:0x1;}}