@treasuredata/tdx 0.29.3 → 0.29.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (248) 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 +1 -0
  5. package/dist/cli.d.ts.map +1 -1
  6. package/dist/cli.js +1 -1
  7. package/dist/cli.js.map +1 -1
  8. package/dist/commands/activations.js +1 -1
  9. package/dist/commands/agent-command.js +1 -1
  10. package/dist/commands/agent-test-command.js +1 -1
  11. package/dist/commands/api-command.js +1 -1
  12. package/dist/commands/auth-command.js +1 -1
  13. package/dist/commands/chat-command.js +1 -1
  14. package/dist/commands/claude-command.d.ts.map +1 -1
  15. package/dist/commands/claude-command.js +1 -1
  16. package/dist/commands/claude-command.js.map +1 -1
  17. package/dist/commands/claude-statusline-command.js +1 -1
  18. package/dist/commands/claude-usage-command.js +1 -1
  19. package/dist/commands/command.js +1 -1
  20. package/dist/commands/connection-command.js +1 -1
  21. package/dist/commands/databases.js +1 -1
  22. package/dist/commands/delivery-command.js +1 -1
  23. package/dist/commands/describe.js +1 -1
  24. package/dist/commands/engage-campaign-pull-command.js +1 -1
  25. package/dist/commands/engage-campaign-push-command.js +1 -1
  26. package/dist/commands/engage-campaign-validate-command.js +1 -1
  27. package/dist/commands/engage-command.js +1 -1
  28. package/dist/commands/engage-command.js.map +1 -1
  29. package/dist/commands/engage-template-pull-command.d.ts +15 -0
  30. package/dist/commands/engage-template-pull-command.d.ts.map +1 -0
  31. package/dist/commands/engage-template-pull-command.js +1 -0
  32. package/dist/commands/engage-template-pull-command.js.map +1 -0
  33. package/dist/commands/engage-template-push-command.d.ts +16 -0
  34. package/dist/commands/engage-template-push-command.d.ts.map +1 -0
  35. package/dist/commands/engage-template-push-command.js +1 -0
  36. package/dist/commands/engage-template-push-command.js.map +1 -0
  37. package/dist/commands/engage-template-validate-command.d.ts +19 -0
  38. package/dist/commands/engage-template-validate-command.d.ts.map +1 -0
  39. package/dist/commands/engage-template-validate-command.js +1 -0
  40. package/dist/commands/engage-template-validate-command.js.map +1 -0
  41. package/dist/commands/job-command.js +1 -1
  42. package/dist/commands/journey-command.js +1 -1
  43. package/dist/commands/journey-validate-command.js +1 -1
  44. package/dist/commands/llm-command.js +1 -1
  45. package/dist/commands/mcp-command.js +1 -1
  46. package/dist/commands/parent-segment-command.js +1 -1
  47. package/dist/commands/profile-command.js +1 -1
  48. package/dist/commands/profiles-command.js +1 -1
  49. package/dist/commands/query-command.d.ts.map +1 -1
  50. package/dist/commands/query-command.js +1 -1
  51. package/dist/commands/query-command.js.map +1 -1
  52. package/dist/commands/schedule-command.js +1 -1
  53. package/dist/commands/segment-command.js +1 -1
  54. package/dist/commands/segment-create-command.js +1 -1
  55. package/dist/commands/segment-fields-command.js +1 -1
  56. package/dist/commands/segment-pull-command.js +1 -1
  57. package/dist/commands/segment-push-command.js +1 -1
  58. package/dist/commands/segment-update-command.js +1 -1
  59. package/dist/commands/segment-use-command.js +1 -1
  60. package/dist/commands/segment-validate-command.js +1 -1
  61. package/dist/commands/segments.js +1 -1
  62. package/dist/commands/show.js +1 -1
  63. package/dist/commands/status-command.js +1 -1
  64. package/dist/commands/tables.js +1 -1
  65. package/dist/commands/unset-command.js +1 -1
  66. package/dist/commands/upgrade-command.js +1 -1
  67. package/dist/commands/use-command.js +1 -1
  68. package/dist/commands/user-command.js +1 -1
  69. package/dist/commands/workflow-command.js +1 -1
  70. package/dist/core/auth.js +1 -1
  71. package/dist/core/command-output.d.ts +6 -0
  72. package/dist/core/command-output.d.ts.map +1 -1
  73. package/dist/core/command-output.js +1 -1
  74. package/dist/core/command-output.js.map +1 -1
  75. package/dist/core/config.js +1 -1
  76. package/dist/core/connection-cache.js +1 -1
  77. package/dist/core/constants.js +1 -1
  78. package/dist/core/credential-cache.js +1 -1
  79. package/dist/core/global-context.js +1 -1
  80. package/dist/core/keychain.js +1 -1
  81. package/dist/core/profile.js +1 -1
  82. package/dist/core/project-config.js +1 -1
  83. package/dist/core/session.js +1 -1
  84. package/dist/core/user-cache.js +1 -1
  85. package/dist/core/version.js +1 -1
  86. package/dist/index.js +1 -1
  87. package/dist/mcp/server.js +1 -1
  88. package/dist/mcp/tools/index.js +1 -1
  89. package/dist/mcp/tools/tdx-run.js +1 -1
  90. package/dist/mcp/tools/tdx-search.js +1 -1
  91. package/dist/mcp/utils.js +1 -1
  92. package/dist/proxy/claude-usage-tracker.js +1 -1
  93. package/dist/proxy/passthrough-server.js +1 -1
  94. package/dist/proxy/sse-usage-parser.js +1 -1
  95. package/dist/sdk/agent/agent-config.js +1 -1
  96. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  97. package/dist/sdk/agent/agent-yaml.js +1 -1
  98. package/dist/sdk/agent/test/evaluator.js +1 -1
  99. package/dist/sdk/agent/test/executor.js +1 -1
  100. package/dist/sdk/agent/test/index.js +1 -1
  101. package/dist/sdk/agent/test/output.js +1 -1
  102. package/dist/sdk/agent/test/parser.js +1 -1
  103. package/dist/sdk/agent/tool-target-registry.js +1 -1
  104. package/dist/sdk/api.js +1 -1
  105. package/dist/sdk/client/cdp-api-client.js +1 -1
  106. package/dist/sdk/client/delivery-api-client.js +1 -1
  107. package/dist/sdk/client/endpoints.d.ts +9 -0
  108. package/dist/sdk/client/endpoints.d.ts.map +1 -1
  109. package/dist/sdk/client/endpoints.js +1 -1
  110. package/dist/sdk/client/endpoints.js.map +1 -1
  111. package/dist/sdk/client/engage-api-client.js +1 -1
  112. package/dist/sdk/client/http-client.js +1 -1
  113. package/dist/sdk/client/llm-api-client.js +1 -1
  114. package/dist/sdk/client/rate-limiter.js +1 -1
  115. package/dist/sdk/client/td-api-client.js +1 -1
  116. package/dist/sdk/client/trino-api-client.js +1 -1
  117. package/dist/sdk/client/workflow-client.js +1 -1
  118. package/dist/sdk/connection-validator.js +1 -1
  119. package/dist/sdk/connection.js +1 -1
  120. package/dist/sdk/delivery.js +1 -1
  121. package/dist/sdk/engage/campaign-pull.js +1 -1
  122. package/dist/sdk/engage/campaign-push.js +1 -1
  123. package/dist/sdk/engage/campaign-validator.js +1 -1
  124. package/dist/sdk/engage/campaign-yaml.js +1 -1
  125. package/dist/sdk/engage/template-pull.d.ts +73 -0
  126. package/dist/sdk/engage/template-pull.d.ts.map +1 -0
  127. package/dist/sdk/engage/template-pull.js +1 -0
  128. package/dist/sdk/engage/template-pull.js.map +1 -0
  129. package/dist/sdk/engage/template-push.d.ts +99 -0
  130. package/dist/sdk/engage/template-push.d.ts.map +1 -0
  131. package/dist/sdk/engage/template-push.js +1 -0
  132. package/dist/sdk/engage/template-push.js.map +1 -0
  133. package/dist/sdk/engage/template-validator.d.ts +18 -0
  134. package/dist/sdk/engage/template-validator.d.ts.map +1 -0
  135. package/dist/sdk/engage/template-validator.js +1 -0
  136. package/dist/sdk/engage/template-validator.js.map +1 -0
  137. package/dist/sdk/engage/template-yaml.d.ts +69 -0
  138. package/dist/sdk/engage/template-yaml.d.ts.map +1 -0
  139. package/dist/sdk/engage/template-yaml.js +1 -0
  140. package/dist/sdk/engage/template-yaml.js.map +1 -0
  141. package/dist/sdk/engage/types/campaign-def.js +1 -1
  142. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  143. package/dist/sdk/engage/types/template-schema.d.ts +33 -0
  144. package/dist/sdk/engage/types/template-schema.d.ts.map +1 -0
  145. package/dist/sdk/engage/types/template-schema.js +1 -0
  146. package/dist/sdk/engage/types/template-schema.js.map +1 -0
  147. package/dist/sdk/engage.d.ts +1 -0
  148. package/dist/sdk/engage.d.ts.map +1 -1
  149. package/dist/sdk/engage.js +1 -1
  150. package/dist/sdk/engage.js.map +1 -1
  151. package/dist/sdk/errors.js +1 -1
  152. package/dist/sdk/index.js +1 -1
  153. package/dist/sdk/io/index.js +1 -1
  154. package/dist/sdk/io/node-filesystem.js +1 -1
  155. package/dist/sdk/job.js +1 -1
  156. package/dist/sdk/journey.js +1 -1
  157. package/dist/sdk/llm/chat-cache.js +1 -1
  158. package/dist/sdk/llm/index.js +1 -1
  159. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  160. package/dist/sdk/llm/model-factors.js +1 -1
  161. package/dist/sdk/personalization.js +1 -1
  162. package/dist/sdk/query/index.js +1 -1
  163. package/dist/sdk/query/sql-parser.js +1 -1
  164. package/dist/sdk/realtime.js +1 -1
  165. package/dist/sdk/schedule.js +1 -1
  166. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  167. package/dist/sdk/segment/fields-display.js +1 -1
  168. package/dist/sdk/segment/file-discovery.js +1 -1
  169. package/dist/sdk/segment/journey-utils.js +1 -1
  170. package/dist/sdk/segment/journey-validator.js +1 -1
  171. package/dist/sdk/segment/journey-yaml.js +1 -1
  172. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  173. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  174. package/dist/sdk/segment/pull-workflow.js +1 -1
  175. package/dist/sdk/segment/push-recovery.js +1 -1
  176. package/dist/sdk/segment/push-workflow.js +1 -1
  177. package/dist/sdk/segment/resolution-context.js +1 -1
  178. package/dist/sdk/segment/segment-path-parser.js +1 -1
  179. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  180. package/dist/sdk/segment/segment-validator.js +1 -1
  181. package/dist/sdk/segment/target-resolution.js +1 -1
  182. package/dist/sdk/segment/tdx-config.js +1 -1
  183. package/dist/sdk/segment/types/activation-schema.js +1 -1
  184. package/dist/sdk/segment/types/journey-def.js +1 -1
  185. package/dist/sdk/segment/types/journey-schema.js +1 -1
  186. package/dist/sdk/segment/types/segment-def.js +1 -1
  187. package/dist/sdk/segment/types/segment-schema.js +1 -1
  188. package/dist/sdk/segment/validate-files.d.ts +6 -1
  189. package/dist/sdk/segment/validate-files.d.ts.map +1 -1
  190. package/dist/sdk/segment/validate-files.js +1 -1
  191. package/dist/sdk/segment/validate-files.js.map +1 -1
  192. package/dist/sdk/segment/yaml-validator.d.ts +1 -1
  193. package/dist/sdk/segment/yaml-validator.d.ts.map +1 -1
  194. package/dist/sdk/segment/yaml-validator.js +1 -1
  195. package/dist/sdk/segment/yaml-validator.js.map +1 -1
  196. package/dist/sdk/segment.js +1 -1
  197. package/dist/sdk/types/engage.d.ts +2 -0
  198. package/dist/sdk/types/engage.d.ts.map +1 -1
  199. package/dist/sdk/types/index.js +1 -1
  200. package/dist/sdk/types/progress.js +1 -1
  201. package/dist/sdk/user.js +1 -1
  202. package/dist/sdk/util/format-detector.js +1 -1
  203. package/dist/sdk/util/formatters.js +1 -1
  204. package/dist/sdk/util/index.js +1 -1
  205. package/dist/sdk/util/tree-formatter.js +1 -1
  206. package/dist/sdk/workflow/archive-validation.js +1 -1
  207. package/dist/sdk/workflow/clone-workflow.js +1 -1
  208. package/dist/sdk/workflow/index.js +1 -1
  209. package/dist/sdk/workflow/pull-workflow.js +1 -1
  210. package/dist/sdk/workflow/push-workflow.js +1 -1
  211. package/dist/sdk/workflow/tdx-config.js +1 -1
  212. package/dist/sdk/workflow/workflow-utils.js +1 -1
  213. package/dist/test-utils/command-runner.js +1 -1
  214. package/dist/test-utils/factories.js +1 -1
  215. package/dist/test-utils/fixtures.js +1 -1
  216. package/dist/test-utils/http-mock.js +1 -1
  217. package/dist/test-utils/index.js +1 -1
  218. package/dist/utils/async.js +1 -1
  219. package/dist/utils/colors.js +1 -1
  220. package/dist/utils/diff.js +1 -1
  221. package/dist/utils/file-permissions.js +1 -1
  222. package/dist/utils/file-reader.js +1 -1
  223. package/dist/utils/github-releases.d.ts +17 -0
  224. package/dist/utils/github-releases.d.ts.map +1 -0
  225. package/dist/utils/github-releases.js +1 -0
  226. package/dist/utils/github-releases.js.map +1 -0
  227. package/dist/utils/global-cache.js +1 -1
  228. package/dist/utils/json-loader.js +1 -1
  229. package/dist/utils/local-cache.js +1 -1
  230. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  231. package/dist/utils/logger/formatters/index.js +1 -1
  232. package/dist/utils/logger/handlers/console-handler.js +1 -1
  233. package/dist/utils/logger/handlers/file-handler.js +1 -1
  234. package/dist/utils/logger/handlers/index.js +1 -1
  235. package/dist/utils/logger/handlers/null-handler.js +1 -1
  236. package/dist/utils/logger/index.js +1 -1
  237. package/dist/utils/logger/logger.js +1 -1
  238. package/dist/utils/logger/types.js +1 -1
  239. package/dist/utils/option-validation.js +1 -1
  240. package/dist/utils/process.js +1 -1
  241. package/dist/utils/prompt.js +1 -1
  242. package/dist/utils/spinner.js +1 -1
  243. package/dist/utils/sse-parser.js +1 -1
  244. package/dist/utils/string-utils.js +1 -1
  245. package/dist/utils/table-ref-parser.js +1 -1
  246. package/dist/utils/tdx-logger.js +1 -1
  247. package/dist/utils/version-check.js +1 -1
  248. package/package.json +1 -1
@@ -1 +1 @@
1
- const a35_0x40a4b7=a35_0x50e2;function a35_0x50e2(_0x380bbf,_0x1b1a95){_0x380bbf=_0x380bbf-0x75;const _0x28fdea=a35_0x28fd();let _0x50e2e1=_0x28fdea[_0x380bbf];return _0x50e2e1;}(function(_0xc9fb2d,_0x153543){const _0x517eb4=a35_0x50e2,_0x2b310e=_0xc9fb2d();while(!![]){try{const _0x5e7eaa=parseInt(_0x517eb4(0xb6))/0x1+parseInt(_0x517eb4(0xcf))/0x2*(parseInt(_0x517eb4(0x75))/0x3)+-parseInt(_0x517eb4(0xe3))/0x4+parseInt(_0x517eb4(0x104))/0x5+-parseInt(_0x517eb4(0xf7))/0x6*(parseInt(_0x517eb4(0xcb))/0x7)+parseInt(_0x517eb4(0xbe))/0x8+-parseInt(_0x517eb4(0xf9))/0x9;if(_0x5e7eaa===_0x153543)break;else _0x2b310e['push'](_0x2b310e['shift']());}catch(_0x839a34){_0x2b310e['push'](_0x2b310e['shift']());}}}(a35_0x28fd,0x38735));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 a35_0x9322fb from'chalk';import{existsSync}from'fs';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{resolveTarget,isSuccessfulResolution,getScopedDetails}from'../sdk/segment/target-resolution.js';import{buildFolderMaps}from'../sdk/segment/resolution-context.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{resolveTDFolderPath,findSegmentsToDelete,findJourneysToDelete,buildSegmentLookupMap,buildSegmentNameToIdMap,buildJourneyBundleLookupMap,parseAndClassifyYamlFiles,validateParsedFiles,formatValidationErrors,extractRootFolderId,buildConnectionMaps,calculatePushStats,prepareSegmentFiles,prepareJourneyFiles,executePushSegments,executePushFolders,executePushSegmentDeletions,executePushJourneys}from'../sdk/segment/push-workflow.js';export class SegmentPushCommand extends BaseCommand{[a35_0x40a4b7(0xde)]=a35_0x40a4b7(0xb5);['description']='Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments';async['execute'](_0x3d8a75){const _0x4b6a53=a35_0x40a4b7,{options:_0x565b27,args:_0x3612f2,tdx:_0x27090d}=_0x3d8a75,_0x47ec94=_0x565b27,_0x4c6922=await resolveTarget({'arg':_0x3612f2[0x0],'contextParent':_0x565b27[_0x4b6a53(0xd6)],'cwd':process[_0x4b6a53(0xeb)]()});if(!isSuccessfulResolution(_0x4c6922))return _0x4c6922[_0x4b6a53(0xf2)]===_0x4b6a53(0xc9)?(console[_0x4b6a53(0xbf)](a35_0x9322fb[_0x4b6a53(0x8b)](_0x4b6a53(0xca))),console['error'](_0x4b6a53(0x9e)),console[_0x4b6a53(0xbf)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent'),console[_0x4b6a53(0xbf)](_0x4b6a53(0xaa))):(console[_0x4b6a53(0xbf)](a35_0x9322fb[_0x4b6a53(0x77)](_0x4b6a53(0xa6)+_0x4c6922[_0x4b6a53(0xab)]+'\x0a')),_0x4c6922[_0x4b6a53(0xae)]&&console[_0x4b6a53(0xbf)](a35_0x9322fb[_0x4b6a53(0xe6)](_0x4c6922[_0x4b6a53(0xae)]))),0x1;if(_0x4c6922[_0x4b6a53(0xd8)]===_0x4b6a53(0xd9))return console[_0x4b6a53(0xbf)](a35_0x9322fb[_0x4b6a53(0x77)]('Error:\x20Directory\x20not\x20found:\x20'+_0x4c6922[_0x4b6a53(0xa1)]+'\x0a')),console[_0x4b6a53(0xbf)](a35_0x9322fb[_0x4b6a53(0xe6)](_0x4b6a53(0xfa))),0x1;const _0x5185ba=_0x4c6922[_0x4b6a53(0xe9)],_0x25fb78=_0x4c6922[_0x4b6a53(0xa1)],_0x20991c=_0x4c6922['type']===_0x4b6a53(0xee)?_0x4c6922[_0x4b6a53(0x100)]:undefined,_0xb03f2b=getScopedDetails(_0x4c6922),_0x4e6063=_0xb03f2b?.[_0x4b6a53(0xd5)]??![],_0x3a847d=_0xb03f2b?.[_0x4b6a53(0xf8)]??'';if(!existsSync(_0x25fb78))return console[_0x4b6a53(0xbf)](a35_0x9322fb[_0x4b6a53(0x77)](_0x4b6a53(0xaf)+_0x25fb78+'\x0a')),console[_0x4b6a53(0xbf)](a35_0x9322fb['cyan'](_0x4b6a53(0xfa))),0x1;_0x47ec94[_0x4b6a53(0x98)]&&(console[_0x4b6a53(0xbf)](_0x4b6a53(0xe2)+_0x47ec94[_0x4b6a53(0x81)]),console[_0x4b6a53(0xbf)](_0x4b6a53(0xb0)+_0x5185ba),console[_0x4b6a53(0xbf)]('Source\x20directory:\x20'+_0x25fb78),_0x4e6063&&console[_0x4b6a53(0xbf)](_0x4b6a53(0xc3)+_0x3a847d));const _0x2a1b7a=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x5185ba+_0x4b6a53(0x93),()=>_0x27090d[_0x4b6a53(0xc6)][_0x4b6a53(0xac)](_0x5185ba),{'verbose':_0x47ec94['verbose']}),_0xa9efd6=_0x2a1b7a[_0x4b6a53(0x91)],{parentSegmentResult:_0x183aae,segmentsResult:_0x2897e1,foldersResult:_0x155405,journeysWithDetailsResult:_0x3bf855,userMaps:_0x21df76}=await withSpinner(_0x4b6a53(0xf3),async()=>{const _0x4361e0=_0x4b6a53,[_0x2537b1,_0x21f2b8,_0x1d06d8,_0x21f2cf,_0x203161]=await Promise[_0x4361e0(0xbd)]([_0x27090d[_0x4361e0(0xc6)][_0x4361e0(0x96)](_0xa9efd6),_0x27090d[_0x4361e0(0xc6)]['listSegments'](_0xa9efd6),_0x27090d[_0x4361e0(0xc6)][_0x4361e0(0xf0)](_0xa9efd6),_0x27090d[_0x4361e0(0xc7)][_0x4361e0(0xa8)](_0xa9efd6,{'includeAllVersions':!![]}),_0x27090d['user']['buildUserMaps']()]);return{'parentSegmentResult':_0x2537b1,'segmentsResult':_0x21f2b8,'foldersResult':_0x1d06d8,'journeysWithDetailsResult':_0x21f2cf,'userMaps':_0x203161};},{'verbose':_0x47ec94[_0x4b6a53(0x98)]})[_0x4b6a53(0xc8)](_0x11dd87=>_0x11dd87[_0x4b6a53(0x91)]),_0x1a4570=_0x183aae,_0x3eb23b=extractRootFolderId(_0x1a4570),_0x102cd5=_0x2897e1,_0x4c0187=_0x155405,{journeys:_0x1d9c31,activationStepsById:_0x3b2d39}=_0x3bf855,_0x5eff8a=new Map(_0x1d9c31[_0x4b6a53(0xdc)](_0x12b9ed=>[_0x12b9ed['id'],_0x12b9ed])),_0x5018a1=_0x1d9c31['map'](_0x435418=>({'id':_0x435418['id'],'name':_0x435418[_0x4b6a53(0x87)]['name'],'journeyBundleName':_0x435418[_0x4b6a53(0x87)][_0x4b6a53(0x95)]||'','journeyBundleId':_0x435418[_0x4b6a53(0x87)]['journeyBundleId']||'','versionNumber':_0x435418[_0x4b6a53(0x87)]['versionNumber'],'description':_0x435418[_0x4b6a53(0x87)]['description'],'state':_0x435418[_0x4b6a53(0x87)][_0x4b6a53(0x9d)],'paused':_0x435418[_0x4b6a53(0x87)][_0x4b6a53(0xc0)],'audienceId':_0x435418['attributes'][_0x4b6a53(0x79)],'folderId':_0x435418[_0x4b6a53(0xcc)]?.['parentFolder']?.[_0x4b6a53(0x91)]?.['id'],'createdAt':_0x435418[_0x4b6a53(0x87)][_0x4b6a53(0x94)],'updatedAt':_0x435418[_0x4b6a53(0x87)][_0x4b6a53(0xe1)]})),{emailToId:_0x59ea11,idToEmail:_0x3357ef}=_0x21df76,_0x354f56=await withSpinner(_0x4b6a53(0xf5),async()=>{const _0x2f5c40=_0x4b6a53,_0x1c46a6=await _0x27090d[_0x2f5c40(0x9b)][_0x2f5c40(0xdd)]();return buildConnectionMaps(_0x1c46a6);},{'verbose':_0x47ec94[_0x4b6a53(0x98)]})[_0x4b6a53(0xc8)](_0x21d4f2=>_0x21d4f2[_0x4b6a53(0x91)]),_0x47a44d=_0x354f56[_0x4b6a53(0xa3)],_0x351d8d=_0x354f56[_0x4b6a53(0x105)],_0x4289d3=_0x354f56[_0x4b6a53(0xbc)],_0x192463={'emailToIdMap':_0x59ea11,'connectionNameToIdMap':_0x47a44d,'connectionNameToTypeMap':_0x4289d3,'getSchema':_0xa6d587=>_0x27090d[_0x4b6a53(0x9b)]['getOutputSchemaWithCache'](_0xa6d587)};let {pathToId:_0x6cff36,idToPath:_0x3957af}=buildFolderMaps(_0x4c0187);const _0x3cba0c=buildSegmentLookupMap(_0x102cd5,_0x3957af),_0x2380f8=buildSegmentNameToIdMap(_0x102cd5),_0x2446bf=buildJourneyBundleLookupMap(_0x5018a1,_0x3957af);let _0x184634;if(_0x20991c){if(!_0x20991c[_0x4b6a53(0xa9)]('.yml')&&!_0x20991c[_0x4b6a53(0xa9)](_0x4b6a53(0x7d)))return console[_0x4b6a53(0xbf)](a35_0x9322fb[_0x4b6a53(0x77)](_0x4b6a53(0xfc)+_0x20991c+'\x0a')),0x1;_0x184634=[_0x20991c];}else _0x184634=findYamlFiles(_0x25fb78);if(_0x184634[_0x4b6a53(0x84)]===0x0)return console[_0x4b6a53(0xbf)](a35_0x9322fb[_0x4b6a53(0x77)](_0x4b6a53(0xdb)+_0x25fb78+'\x0a')),console['error'](a35_0x9322fb['cyan']('Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files')),0x1;let _0x55376c,_0x31c0c4;try{const _0x3c6507=parseAndClassifyYamlFiles(_0x184634,_0x25fb78,{'skipSegments':_0x47ec94[_0x4b6a53(0xec)]});_0x55376c=_0x3c6507[_0x4b6a53(0xa7)],_0x31c0c4=_0x3c6507[_0x4b6a53(0x86)];const _0x1bd9ab=validateParsedFiles(_0x3c6507,_0x25fb78);if(_0x1bd9ab[_0x4b6a53(0x84)]>0x0)return console['error'](a35_0x9322fb[_0x4b6a53(0x77)]('\x0aValidation\x20failed:')),console[_0x4b6a53(0xbf)](formatValidationErrors(_0x1bd9ab)),console[_0x4b6a53(0xbf)](a35_0x9322fb[_0x4b6a53(0x8b)](_0x4b6a53(0xf4))),0x1;}catch(_0x270a5e){return console[_0x4b6a53(0xbf)](a35_0x9322fb[_0x4b6a53(0x77)](_0x4b6a53(0xd7)+(_0x270a5e instanceof Error?_0x270a5e['message']:_0x270a5e))),0x1;}if(_0x55376c[_0x4b6a53(0x84)]===0x0&&_0x31c0c4['length']===0x0){const _0x327e2b=_0x47ec94[_0x4b6a53(0xec)]?_0x4b6a53(0xc7):_0x4b6a53(0xb9);return console[_0x4b6a53(0xbf)](a35_0x9322fb[_0x4b6a53(0x8b)](_0x4b6a53(0xa0)+_0x327e2b+_0x4b6a53(0x8a))),0x0;}const _0xe5ae74=new Map();_0x102cd5[_0x4b6a53(0x84)]>0x0&&!_0x47ec94[_0x4b6a53(0xec)]&&await withSpinner(_0x4b6a53(0x80),async()=>{await batchAsync(_0x102cd5,async _0x3a8fec=>{const _0x14c002=a35_0x50e2,_0x501904=await _0x27090d['segment'][_0x14c002(0xe5)](_0xa9efd6,_0x3a8fec['id']);_0xe5ae74['set'](_0x3a8fec['id'],_0x501904);});},{'verbose':_0x47ec94['verbose']});const {segmentFiles:_0x960be4,foldersToCreate:_0x556398}=await prepareSegmentFiles(_0x55376c,{'segmentByFolderAndName':_0x3cba0c,'activationsBySegmentId':_0xe5ae74,'folderPathToId':_0x6cff36,'idToEmailMap':_0x3357ef,'connectionIdToNameMap':_0x351d8d},_0x192463,_0x4e6063,_0x3a847d),_0x3cc7a1=_0x20991c?[]:findSegmentsToDelete(_0x102cd5,_0x55376c['map'](({yamlConfig:_0x121170,folderPath:_0x593496})=>({'yamlConfig':_0x121170,'folderPath':resolveTDFolderPath(_0x593496,_0x4e6063,_0x3a847d)})),_0x3957af,_0x3a847d,_0x4e6063),{journeyFiles:_0x3767db,foldersToCreate:_0x4854c7}=await withProgressSpinner('Preparing\x20journeys...',async _0x3e2236=>prepareJourneyFiles(_0x31c0c4,{'fetchJourney':async _0x529094=>_0x27090d[_0x4b6a53(0xc7)]['getJourney'](_0x529094['journeyId']),'journeyBundlesByFolderAndName':_0x2446bf,'folderPathToId':_0x6cff36,'idToEmailMap':_0x3357ef,'connectionIdToNameMap':_0x351d8d,'existingSegments':_0x102cd5,'parentId':_0xa9efd6,'deps':_0x27090d,'progress':{'update':_0x1b81cc=>{const _0x1097b6=_0x4b6a53;_0x3e2236[_0x1097b6(0x88)](_0x1b81cc),_0x47ec94[_0x1097b6(0x98)]&&console[_0x1097b6(0xbf)]('\x20\x20'+_0x1b81cc);}},'journeyById':_0x5eff8a,'activationStepsById':_0x3b2d39},_0x4e6063,_0x3a847d),{'verbose':_0x47ec94[_0x4b6a53(0x98)]})['then'](_0x574e4c=>_0x574e4c[_0x4b6a53(0x91)]);for(const _0x5eb079 of _0x4854c7){_0x556398[_0x4b6a53(0xe0)](_0x5eb079);}const _0x59aada=_0x20991c?[]:findJourneysToDelete(_0x5018a1,_0x31c0c4['map'](({yamlConfig:_0x1f1b1d,folderPath:_0x3683cc})=>({'yamlConfig':_0x1f1b1d,'folderPath':resolveTDFolderPath(_0x3683cc,_0x4e6063,_0x3a847d)})),_0x3957af,_0x3a847d,_0x4e6063),_0x6493ce=calculatePushStats(_0x960be4,_0x3767db,_0x556398,_0x3cc7a1,_0x59aada,!!_0x47ec94[_0x4b6a53(0xd2)],!!_0x47ec94[_0x4b6a53(0xec)]),_0x2502e9=_0x6493ce[_0x4b6a53(0xa7)]['new'],_0x355cb4=_0x6493ce['segments']['changed'],_0x51e347=_0x6493ce[_0x4b6a53(0xa7)]['unchanged'],_0x4ddc06=_0x6493ce['segments']['toDelete'],_0x382a59=_0x6493ce['folders']['toCreate'],_0x491c08=_0x6493ce[_0x4b6a53(0x86)]['new'],_0x4190b8=_0x6493ce['journeys']['changed'],_0x2a8e16=_0x6493ce[_0x4b6a53(0x86)]['unchanged'],_0x7c2e8e=_0x6493ce[_0x4b6a53(0x86)]['toDelete'],_0x288a94=_0x6493ce[_0x4b6a53(0xed)][_0x4b6a53(0xbd)],_0x4fdacf=_0x6493ce['activations'][_0x4b6a53(0x90)],_0x7b8a38=_0x6493ce[_0x4b6a53(0xed)][_0x4b6a53(0xce)],_0x50309=_0x6493ce['activations']['toDelete'];console[_0x4b6a53(0xbf)](_0x4b6a53(0xa5)+_0x5185ba+'\x27:');_0x382a59[_0x4b6a53(0x84)]>0x0&&console['error']('\x20\x20'+a35_0x9322fb[_0x4b6a53(0xa4)](_0x4b6a53(0xad)+_0x382a59[_0x4b6a53(0x84)]+'\x20folders\x20to\x20create'));if(!_0x47ec94['journeysOnly']){console[_0x4b6a53(0xbf)]('\x20\x20📊\x20Segments:'),console[_0x4b6a53(0xbf)](_0x4b6a53(0x82)+a35_0x9322fb['green']('+\x20'+_0x2502e9['length']+_0x4b6a53(0xb3))),console[_0x4b6a53(0xbf)](_0x4b6a53(0x82)+a35_0x9322fb[_0x4b6a53(0x8b)]('~\x20'+_0x355cb4[_0x4b6a53(0x84)]+_0x4b6a53(0xf1)));if(_0x4ddc06[_0x4b6a53(0x84)]>0x0)console[_0x4b6a53(0xbf)]('\x20\x20\x20\x20'+a35_0x9322fb[_0x4b6a53(0x77)]('-\x20'+_0x4ddc06[_0x4b6a53(0x84)]+_0x4b6a53(0xea)));else _0x3cc7a1['length']>0x0&&!_0x47ec94[_0x4b6a53(0xd2)]&&console[_0x4b6a53(0xbf)](_0x4b6a53(0x82)+a35_0x9322fb[_0x4b6a53(0xc4)](_0x3cc7a1['length']+'\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)'));console[_0x4b6a53(0xbf)](_0x4b6a53(0x82)+a35_0x9322fb['dim']('=\x20'+_0x51e347[_0x4b6a53(0x84)]+'\x20unchanged'));}if(_0x3767db[_0x4b6a53(0x84)]>0x0||_0x59aada[_0x4b6a53(0x84)]>0x0){console[_0x4b6a53(0xbf)]('\x20\x20🗺️\x20\x20Journeys:'),console[_0x4b6a53(0xbf)](_0x4b6a53(0x82)+a35_0x9322fb[_0x4b6a53(0x99)]('+\x20'+_0x491c08[_0x4b6a53(0x84)]+_0x4b6a53(0xb3))),console['error'](_0x4b6a53(0x82)+a35_0x9322fb[_0x4b6a53(0x8b)]('~\x20'+_0x4190b8[_0x4b6a53(0x84)]+'\x20changed'));if(_0x7c2e8e['length']>0x0)console[_0x4b6a53(0xbf)]('\x20\x20\x20\x20'+a35_0x9322fb['red']('-\x20'+_0x7c2e8e[_0x4b6a53(0x84)]+_0x4b6a53(0xea)));else _0x59aada['length']>0x0&&!_0x47ec94[_0x4b6a53(0xd2)]&&console[_0x4b6a53(0xbf)](_0x4b6a53(0x82)+a35_0x9322fb['dim'](_0x59aada[_0x4b6a53(0x84)]+'\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)'));console['error'](_0x4b6a53(0x82)+a35_0x9322fb[_0x4b6a53(0xc4)]('=\x20'+_0x2a8e16['length']+_0x4b6a53(0x7c)));}_0x288a94[_0x4b6a53(0x84)]>0x0&&!_0x47ec94[_0x4b6a53(0xec)]&&(console[_0x4b6a53(0xbf)](''),console['error'](_0x4b6a53(0x9c)),_0x4fdacf[_0x4b6a53(0x84)]>0x0&&console[_0x4b6a53(0xbf)](_0x4b6a53(0x82)+a35_0x9322fb[_0x4b6a53(0x99)]('+\x20'+_0x4fdacf[_0x4b6a53(0x84)]+_0x4b6a53(0x7a))),_0x7b8a38['length']>0x0&&console[_0x4b6a53(0xbf)](_0x4b6a53(0x82)+a35_0x9322fb[_0x4b6a53(0x8b)]('~\x20'+_0x7b8a38['length']+_0x4b6a53(0xb4))),_0x50309[_0x4b6a53(0x84)]>0x0&&console['error']('\x20\x20\x20\x20'+a35_0x9322fb[_0x4b6a53(0x77)]('-\x20'+_0x50309['length']+_0x4b6a53(0xea))));console[_0x4b6a53(0xbf)](_0x4b6a53(0xb1)+a35_0x9322fb['cyan'](_0x25fb78)+'\x0a');if(_0x382a59['length']>0x0){console[_0x4b6a53(0xbf)](_0x4b6a53(0xba));for(const _0x252cc0 of _0x382a59){console[_0x4b6a53(0xbf)]('\x20\x20'+a35_0x9322fb[_0x4b6a53(0xa4)]('+')+'\x20'+_0x252cc0);}console[_0x4b6a53(0xbf)]('');}if(_0x2502e9[_0x4b6a53(0x84)]>0x0&&!_0x47ec94[_0x4b6a53(0xec)])for(const _0x29769d of _0x2502e9){const _0x393c6a=_0x29769d[_0x4b6a53(0x103)]?_0x29769d['folderPath']+'/'+_0x29769d['yamlConfig']['name']:_0x29769d[_0x4b6a53(0x8e)][_0x4b6a53(0xde)],_0x3c2b7c=_0x29769d[_0x4b6a53(0x8e)]['activations']?.[_0x4b6a53(0x84)]||0x0,_0x9a7925=_0x3c2b7c>0x0?a35_0x9322fb['dim']('\x20['+_0x3c2b7c+_0x4b6a53(0xfe)):'';console[_0x4b6a53(0xbf)]('\x0a'+a35_0x9322fb[_0x4b6a53(0x99)](_0x4b6a53(0xe7))+'\x20'+_0x393c6a+_0x9a7925),console['error']('─'[_0x4b6a53(0xd0)](0x3c)),_0x29769d[_0x4b6a53(0x85)]&&console[_0x4b6a53(0xbf)](_0x29769d[_0x4b6a53(0x85)]),console['error']('─'[_0x4b6a53(0xd0)](0x3c));}if(_0x4ddc06['length']>0x0&&!_0x47ec94['journeysOnly'])for(const _0x4405d4 of _0x4ddc06){const _0x5b296e=_0x4405d4['segmentFolderId']?_0x3957af[_0x4b6a53(0x76)](_0x4405d4[_0x4b6a53(0x9f)]['toString']())||'':'',_0x26e557=_0x5b296e?_0x5b296e+'/'+_0x4405d4[_0x4b6a53(0xde)]:_0x4405d4[_0x4b6a53(0xde)],_0x8633a0=_0xe5ae74[_0x4b6a53(0x76)](_0x4405d4['id'])||[],_0x5df35e=_0x8633a0[_0x4b6a53(0x84)]>0x0?a35_0x9322fb[_0x4b6a53(0xc4)]('\x20['+_0x8633a0['length']+_0x4b6a53(0xfe)):'';console[_0x4b6a53(0xbf)]('\x0a'+a35_0x9322fb['red'](_0x4b6a53(0xc1))+'\x20'+_0x26e557+_0x5df35e),console[_0x4b6a53(0xbf)]('─'[_0x4b6a53(0xd0)](0x3c));const _0x5d9728=segmentWithActivationsToYaml(_0x4405d4,_0x8633a0,undefined,_0x3357ef,_0x351d8d),_0x9fd1d6=segmentToYamlString(_0x5d9728),_0x18c558=generateDiff(_0x9fd1d6,'');console[_0x4b6a53(0xbf)](formatDiffWithColors(_0x18c558)),console[_0x4b6a53(0xbf)]('─'[_0x4b6a53(0xd0)](0x3c));}const _0x552efc=_0x960be4['filter'](_0x4160a8=>!_0x4160a8[_0x4b6a53(0x83)]&&_0x4160a8[_0x4b6a53(0x85)]);if(_0x552efc[_0x4b6a53(0x84)]>0x0&&!_0x47ec94['journeysOnly'])for(const _0x456309 of _0x552efc){const _0x3e7182=_0x456309[_0x4b6a53(0x103)]?_0x456309[_0x4b6a53(0x103)]+'/'+_0x456309[_0x4b6a53(0x8e)][_0x4b6a53(0xde)]:_0x456309[_0x4b6a53(0x8e)][_0x4b6a53(0xde)];console['error']('\x0a'+a35_0x9322fb['yellow'](_0x4b6a53(0xb8))+'\x20'+_0x3e7182),console[_0x4b6a53(0xbf)]('─'[_0x4b6a53(0xd0)](0x3c)),console[_0x4b6a53(0xbf)](_0x456309[_0x4b6a53(0x85)]),console['error']('─'['repeat'](0x3c));}if(_0x491c08['length']>0x0)for(const _0x40c32c of _0x491c08){const _0x1df0b4=_0x40c32c[_0x4b6a53(0x103)]?_0x40c32c['folderPath']+'/'+_0x40c32c[_0x4b6a53(0x8e)][_0x4b6a53(0xde)]:_0x40c32c['yamlConfig'][_0x4b6a53(0xde)];console['error']('\x0a'+a35_0x9322fb['green'](_0x4b6a53(0x8c))+'\x20'+_0x1df0b4),console[_0x4b6a53(0xbf)]('─'['repeat'](0x3c)),_0x40c32c['diff']&&console['error'](_0x40c32c[_0x4b6a53(0x85)]),console[_0x4b6a53(0xbf)]('─'['repeat'](0x3c));}const _0x2013c7=_0x3767db[_0x4b6a53(0x8d)](_0x4b85b3=>!_0x4b85b3[_0x4b6a53(0x83)]&&_0x4b85b3['diff']);if(_0x2013c7[_0x4b6a53(0x84)]>0x0)for(const _0x5bcb0a of _0x2013c7){const _0x1c5a8e=_0x5bcb0a[_0x4b6a53(0x103)]?_0x5bcb0a[_0x4b6a53(0x103)]+'/'+_0x5bcb0a[_0x4b6a53(0x8e)]['name']:_0x5bcb0a['yamlConfig'][_0x4b6a53(0xde)];console['error']('\x0a'+a35_0x9322fb[_0x4b6a53(0x8b)]('Changes\x20to\x20journey:')+'\x20'+_0x1c5a8e),console['error']('─'[_0x4b6a53(0xd0)](0x3c)),console['error'](_0x5bcb0a['diff']),console[_0x4b6a53(0xbf)]('─'['repeat'](0x3c));}if(_0x7c2e8e[_0x4b6a53(0x84)]>0x0)for(const _0x119520 of _0x7c2e8e){const _0x28a2dd=_0x119520[_0x4b6a53(0xc5)]?_0x3957af[_0x4b6a53(0x76)](_0x119520['folderId'])||'':'',_0x3f6604=_0x28a2dd?_0x28a2dd+'/'+_0x119520['journeyBundleName']:_0x119520[_0x4b6a53(0x95)];console[_0x4b6a53(0xbf)]('\x0a'+a35_0x9322fb['red'](_0x4b6a53(0xff))+'\x20'+_0x3f6604),console[_0x4b6a53(0xbf)]('─'[_0x4b6a53(0xd0)](0x3c)),console[_0x4b6a53(0xbf)](a35_0x9322fb['red']('(Journey\x20will\x20be\x20deleted)')),console[_0x4b6a53(0xbf)]('─'['repeat'](0x3c));}if(_0x47ec94[_0x4b6a53(0xd4)])return console[_0x4b6a53(0xbf)](a35_0x9322fb[_0x4b6a53(0x8b)]('\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made')),0x0;const _0x587f4a=_0x47ec94['journeysOnly']?![]:_0x2502e9[_0x4b6a53(0x84)]>0x0||_0x355cb4[_0x4b6a53(0x84)]>0x0||_0x4ddc06[_0x4b6a53(0x84)]>0x0,_0x23d002=_0x491c08[_0x4b6a53(0x84)]>0x0||_0x4190b8[_0x4b6a53(0x84)]>0x0||_0x7c2e8e[_0x4b6a53(0x84)]>0x0,_0x362255=_0x47ec94[_0x4b6a53(0xec)]?![]:_0x288a94[_0x4b6a53(0x84)]>0x0,_0x4486ec=_0x382a59[_0x4b6a53(0x84)]>0x0;if(!_0x587f4a&&!_0x23d002&&!_0x362255&&!_0x4486ec){const _0x1b1925=_0x47ec94[_0x4b6a53(0xec)]?_0x4b6a53(0x7b):_0x4b6a53(0x78);console['error'](a35_0x9322fb['green'](_0x1b1925));if(_0x20991c&&_0x51e347[_0x4b6a53(0x84)]===0x1){const _0x167d5d=_0x51e347[0x0];if(_0x167d5d[_0x4b6a53(0x97)]?.['id']){const _0x5f167e=getConsoleNextUrl(_0x47ec94[_0x4b6a53(0x81)],_0x4b6a53(0xda)+_0xa9efd6+_0x4b6a53(0xf6)+_0x167d5d[_0x4b6a53(0x97)]['id']+_0x4b6a53(0xd1));console['error'](_0x4b6a53(0x92)+a35_0x9322fb['cyan'](_0x5f167e));}}if(_0x20991c&&_0x2a8e16[_0x4b6a53(0x84)]===0x1){const _0x10806b=_0x2a8e16[0x0];if(_0x10806b[_0x4b6a53(0xfd)]?.['id']){const _0x982544=getConsoleNextUrl(_0x47ec94[_0x4b6a53(0x81)],_0x4b6a53(0xda)+_0xa9efd6+_0x4b6a53(0xf6)+_0x10806b[_0x4b6a53(0xfd)]['id']+_0x4b6a53(0xe8));console[_0x4b6a53(0xbf)]('\x20\x20'+a35_0x9322fb[_0x4b6a53(0xe6)](_0x982544));}}return 0x0;}const _0x102bb1=_0x47ec94[_0x4b6a53(0xec)]?_0x491c08[_0x4b6a53(0x84)]+_0x4190b8[_0x4b6a53(0x84)]+_0x7c2e8e[_0x4b6a53(0x84)]+_0x382a59[_0x4b6a53(0x84)]:_0x2502e9['length']+_0x355cb4[_0x4b6a53(0x84)]+_0x4ddc06[_0x4b6a53(0x84)]+_0x491c08[_0x4b6a53(0x84)]+_0x4190b8['length']+_0x7c2e8e[_0x4b6a53(0x84)]+_0x382a59[_0x4b6a53(0x84)]+_0x288a94['length'];if(!_0x47ec94[_0x4b6a53(0x7e)]&&_0x102bb1>0x0){if(!isInteractive())return console[_0x4b6a53(0xbf)](a35_0x9322fb[_0x4b6a53(0x77)](_0x4b6a53(0x89)),_0x4b6a53(0xa2)),console['error'](a35_0x9322fb[_0x4b6a53(0xc4)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x4efd5c=await confirmKey(_0x4b6a53(0xbb)+_0x102bb1+_0x4b6a53(0x8f));if(!_0x4efd5c)return console[_0x4b6a53(0xbf)](a35_0x9322fb[_0x4b6a53(0x8b)](_0x4b6a53(0xdf))),0x1;}const _0x1df97d={'withProgress':async(_0x181f33,_0x4d8cd6)=>{const _0x5521b5=_0x4b6a53,_0x5c341f=await withSpinner(_0x181f33,_0x4d8cd6,{'verbose':_0x47ec94[_0x5521b5(0x98)]});return{'data':_0x5c341f[_0x5521b5(0x91)]};},'logInfo':_0x53b6be=>console['error'](a35_0x9322fb['blue']('✔\x20'+_0x53b6be)),'logSuccess':_0x2f7fff=>console[_0x4b6a53(0xbf)](a35_0x9322fb[_0x4b6a53(0x99)]('✔\x20'+_0x2f7fff)),'logWarning':_0x4c54fb=>console['error'](a35_0x9322fb[_0x4b6a53(0x8b)]('⚠\x20'+_0x4c54fb)),'logDeleted':_0x31d134=>console['error'](a35_0x9322fb[_0x4b6a53(0x77)]('✔\x20'+_0x31d134))},_0x3e17c6={'segment':_0x27090d[_0x4b6a53(0xc6)],'journey':_0x27090d[_0x4b6a53(0xc7)],'user':_0x27090d[_0x4b6a53(0x9a)],'connection':_0x27090d[_0x4b6a53(0x9b)]};_0x382a59[_0x4b6a53(0x84)]>0x0&&(_0x6cff36=await executePushFolders(_0x3e17c6,_0x382a59,_0x6cff36,{'parentId':_0xa9efd6},_0x1df97d));const _0x30fd0b={'rootFolderId':_0x3eb23b,'folderPathToId':_0x6cff36,'folderIdToPath':_0x3957af,'segmentNameToId':_0x2380f8,'activationsBySegmentId':_0xe5ae74,'emailToIdMap':_0x59ea11,'idToEmailMap':_0x3357ef,'connectionNameToIdMap':_0x354f56[_0x4b6a53(0xa3)],'connectionIdToNameMap':_0x354f56[_0x4b6a53(0x105)],'connectionNameToTypeMap':_0x4289d3},_0x461475=await executePushSegments(_0x3e17c6,_0x47ec94[_0x4b6a53(0xec)]?[]:_0x960be4,_0x30fd0b,{'parentId':_0xa9efd6},_0x1df97d),_0x39b45b=_0x461475[_0x4b6a53(0xc2)],_0x3500bb=_0x461475[_0x4b6a53(0xfb)],_0x4b9696=_0x461475[_0x4b6a53(0xed)][_0x4b6a53(0xc2)],_0x195449=_0x461475[_0x4b6a53(0xed)][_0x4b6a53(0xfb)],_0x225d40=_0x461475['activations']['deleted'];let _0x41e145;if(_0x20991c&&_0x960be4[_0x4b6a53(0x84)]===0x1){const _0x25ab05=_0x960be4[0x0];_0x41e145=_0x25ab05[_0x4b6a53(0x97)]?.['id']??_0x461475['createdSegmentIds'][_0x4b6a53(0x76)](_0x25ab05[_0x4b6a53(0x8e)][_0x4b6a53(0xde)]);}const _0x20bec7=await executePushSegmentDeletions(_0x3e17c6,_0x47ec94[_0x4b6a53(0xec)]?[]:_0x4ddc06,_0x1df97d);let _0x483658=0x0,_0x401dc6=0x0,_0x44d1c9=0x0;const _0x984091=new Map(_0x2380f8);for(const [_0x554439,_0x38b3aa]of _0x461475['createdSegmentIds']){_0x984091[_0x4b6a53(0xd3)](_0x554439,_0x38b3aa);}if(_0x3767db[_0x4b6a53(0x84)]>0x0){const _0x52efb3={..._0x30fd0b,'segmentNameToId':_0x984091,'existingSegments':_0x102cd5,'activationContext':_0x192463},_0x42789e=await executePushJourneys(_0x3e17c6,_0x3767db,_0x52efb3,{'parentId':_0xa9efd6,'rootFolderId':_0x3eb23b,'verbose':_0x47ec94['verbose']},_0x1df97d);_0x483658=_0x42789e['created'],_0x401dc6=_0x42789e[_0x4b6a53(0xfb)];if(_0x20991c&&_0x42789e[_0x4b6a53(0x101)][_0x4b6a53(0x84)]===0x1){const _0x5d5341=_0x42789e[_0x4b6a53(0x101)][0x0];if(_0x5d5341[_0x4b6a53(0xef)]){const _0x37cb5b=getConsoleNextUrl(_0x47ec94['site'],_0x4b6a53(0xda)+_0xa9efd6+'/e/'+_0x5d5341[_0x4b6a53(0xef)]+'/j/da/je');console[_0x4b6a53(0xbf)]('\x20\x20'+a35_0x9322fb[_0x4b6a53(0xe6)](_0x37cb5b));}}}for(const _0x3ead10 of _0x7c2e8e){console[_0x4b6a53(0xbf)](a35_0x9322fb[_0x4b6a53(0x8b)]('⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20'+_0x3ead10['journeyBundleName'])),_0x44d1c9++;}const _0x4ba9f3=[];if(_0x39b45b>0x0)_0x4ba9f3['push'](_0x39b45b+_0x4b6a53(0xb2));if(_0x3500bb>0x0)_0x4ba9f3['push'](_0x3500bb+'\x20updated');if(_0x20bec7>0x0)_0x4ba9f3[_0x4b6a53(0x7f)](_0x20bec7+_0x4b6a53(0xcd));const _0x4c5137=[];if(_0x483658>0x0)_0x4c5137[_0x4b6a53(0x7f)](_0x483658+'\x20created');if(_0x401dc6>0x0)_0x4c5137[_0x4b6a53(0x7f)](_0x401dc6+'\x20updated');if(_0x44d1c9>0x0)_0x4c5137['push'](_0x44d1c9+_0x4b6a53(0xcd));const _0x367ef7=[];if(_0x4b9696>0x0)_0x367ef7[_0x4b6a53(0x7f)](_0x4b9696+_0x4b6a53(0xb2));if(_0x195449>0x0)_0x367ef7['push'](_0x195449+'\x20updated');if(_0x225d40>0x0)_0x367ef7['push'](_0x225d40+_0x4b6a53(0xcd));console[_0x4b6a53(0xbf)](a35_0x9322fb['green'](_0x4b6a53(0xb7)));_0x4ba9f3[_0x4b6a53(0x84)]>0x0&&!_0x47ec94[_0x4b6a53(0xec)]&&console[_0x4b6a53(0xbf)]('\x20\x20Segments:\x20'+_0x4ba9f3[_0x4b6a53(0xe4)](',\x20'));_0x4c5137['length']>0x0&&console[_0x4b6a53(0xbf)]('\x20\x20Journeys:\x20'+_0x4c5137['join'](',\x20'));_0x367ef7[_0x4b6a53(0x84)]>0x0&&!_0x47ec94[_0x4b6a53(0xec)]&&console['error'](_0x4b6a53(0x102)+_0x367ef7['join'](',\x20'));if(_0x41e145){const _0xa0dcdf=getConsoleNextUrl(_0x47ec94[_0x4b6a53(0x81)],_0x4b6a53(0xda)+_0xa9efd6+'/e/'+_0x41e145+'/sb/da/esr');console[_0x4b6a53(0xbf)](_0x4b6a53(0x92)+a35_0x9322fb[_0x4b6a53(0xe6)](_0xa0dcdf));}return 0x0;}}function a35_0x28fd(){const _0x5b2110=['/sb/da/esr','delete','set','dryRun','isScoped','parentSegment','Error\x20parsing\x20YAML:\x20','type','parent_name','/app/ps/','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','map','list','name','Aborted.','add','updatedAt','Site:\x20','782976GHuCsf','join','listActivations','cyan','New\x20segment:','/j/da/je','parentName','\x20to\x20delete','cwd','journeysOnly','activations','file','journeyId','listFolders','\x20changed','errorCode','Fetching\x20existing\x20data...','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','Fetching\x20connections\x20for\x20name\x20resolution...','/e/','102126RWoogo','scopedFolderPath','4026861LWfiLe','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','updated','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','existingJourney','\x20activations]','Delete\x20journey:','filePath','results','\x20\x20Activations:\x20','folderPath','2121255wmbNMk','idToName','1071834IeuiHz','get','red','✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','audienceId','\x20to\x20create','✔\x20All\x20journeys\x20are\x20up\x20to\x20date','\x20unchanged','.yaml','yes','push','Fetching\x20existing\x20activations...','site','\x20\x20\x20\x20','isNew','length','diff','journeys','attributes','setPhase','\x0aError:','\x20YAML\x20files\x20found','yellow','New\x20journey:','filter','yamlConfig','\x20changes?','toCreate','data','\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20','\x27...','createdAt','journeyBundleName','getParent','existingSegment','verbose','green','user','connection','\x20\x20Activations:','state','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)','segmentFolderId','No\x20','targetDir','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','nameToId','blue','\x0aPush\x20summary\x20for\x20\x27','Error:\x20','segments','listJourneysWithDetailsFromParentSegment','endsWith','\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','resolveParentId','📁\x20','helpText','Error:\x20Directory\x20not\x20found:\x20','Parent\x20segment:\x20','\x20\x20Source:\x20','\x20created','\x20new','\x20to\x20update','segment:push','9134uoIkCo','\x0a✔\x20Push\x20complete','Changes\x20to:','segment\x20or\x20journey','Folders\x20to\x20create:','Push\x20','nameToType','all','2984704cuJvGB','error','paused','Delete\x20segment:','created','Scoped\x20to\x20folder:\x20','dim','folderId','segment','journey','then','no_parent','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','119yiwqGh','relationships','\x20deleted','toUpdate','2InaJko','repeat'];a35_0x28fd=function(){return _0x5b2110;};return a35_0x28fd();}
1
+ const a38_0x239142=a38_0x16e0;function a38_0x594b(){const _0xa1661b=['\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','all','Changes\x20to\x20journey:','yamlConfig','Error:\x20','versionNumber','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','execute','parentName','paused','Aborted.','verbose','list','errorCode','getParent','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','\x0aPush\x20summary\x20for\x20\x27','16131204tbXTVU','(Journey\x20will\x20be\x20deleted)','set','Push\x20','\x20activations]','Site:\x20','171778jCLfqD','add','length','unchanged','Scoped\x20to\x20folder:\x20','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','61135kcLJGR','createdAt','1533lKtMox','\x20updated','Folders\x20to\x20create:','cyan','user','nameToId','scopedFolderPath','folderPath','/app/ps/','createdSegmentIds','targetDir','getOutputSchemaWithCache','3181338wVSRNu','segment:push','No\x20','type','data','deleted','\x20\x20\x20\x20','filePath','journeyId','parent_name','updated','/e/','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','green','existingSegment','listSegments','journeyBundleId','helpText','buildUserMaps','Error:\x20Directory\x20not\x20found:\x20','push','listActivations','description','/j/da/je','\x20\x20Journeys:\x20','results','New\x20segment:','\x20deleted','error','\x20created','dim','diff','\x20\x20Activations:','folders','endsWith','New\x20journey:','\x20YAML\x20files\x20found','delete','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file','name','\x20unchanged','nameToType','\x20folders\x20to\x20create','segment','resolveParentId','journey','toString','then','\x20\x20Source:\x20','message','folderId','get','existingJourney','Fetching\x20existing\x20data...','segment\x20or\x20journey','Source\x20directory:\x20','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','\x0aError:','64dHpxab','relationships','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','.yml','yes','parentFolder','.yaml','yellow','\x20\x20📊\x20Segments:','toDelete','blue','updatedAt','changed','journeyBundleName','toCreate','1477128qHLkNx','\x20to\x20create','toUpdate','\x0a✔\x20Push\x20complete','site','connection','\x20to\x20delete','listFolders','427210DGEEww','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','\x20\x20Activations:\x20','isScoped','attributes','\x27...','filter','new','map','created','isNew','\x20changed','repeat','cwd','/sb/da/esr','Preparing\x20journeys...','Parent\x20segment:\x20','journeys','join','Delete\x20journey:','\x0aValidation\x20failed:','file','📁\x20','state','Fetching\x20existing\x20activations...','\x20\x20Segments:\x20','activations','\x20new','journeysOnly','Changes\x20to:','segments','✔\x20All\x20journeys\x20are\x20up\x20to\x20date','red','5752fqVgjm'];a38_0x594b=function(){return _0xa1661b;};return a38_0x594b();}(function(_0x5575aa,_0x6fe335){const _0x2db214=a38_0x16e0,_0x326ec2=_0x5575aa();while(!![]){try{const _0x198bbf=parseInt(_0x2db214(0x14b))/0x1+-parseInt(_0x2db214(0x111))/0x2+-parseInt(_0x2db214(0x15f))/0x3+-parseInt(_0x2db214(0x199))/0x4*(parseInt(_0x2db214(0x151))/0x5)+parseInt(_0x2db214(0x1a8))/0x6+parseInt(_0x2db214(0x153))/0x7*(-parseInt(_0x2db214(0x132))/0x8)+parseInt(_0x2db214(0x145))/0x9;if(_0x198bbf===_0x6fe335)break;else _0x326ec2['push'](_0x326ec2['shift']());}catch(_0x7e29c6){_0x326ec2['push'](_0x326ec2['shift']());}}}(a38_0x594b,0x8e60a));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';function a38_0x16e0(_0x116a9c,_0x2c6450){_0x116a9c=_0x116a9c-0x111;const _0x594bf5=a38_0x594b();let _0x16e069=_0x594bf5[_0x116a9c];return _0x16e069;}import a38_0x3720b4 from'chalk';import{existsSync}from'fs';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{resolveTarget,isSuccessfulResolution,getScopedDetails}from'../sdk/segment/target-resolution.js';import{buildFolderMaps}from'../sdk/segment/resolution-context.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{resolveTDFolderPath,findSegmentsToDelete,findJourneysToDelete,buildSegmentLookupMap,buildSegmentNameToIdMap,buildJourneyBundleLookupMap,parseAndClassifyYamlFiles,validateParsedFiles,formatValidationErrors,extractRootFolderId,buildConnectionMaps,calculatePushStats,prepareSegmentFiles,prepareJourneyFiles,executePushSegments,executePushFolders,executePushSegmentDeletions,executePushJourneys}from'../sdk/segment/push-workflow.js';export class SegmentPushCommand extends BaseCommand{[a38_0x239142(0x186)]=a38_0x239142(0x160);[a38_0x239142(0x175)]=a38_0x239142(0x150);async[a38_0x239142(0x13b)](_0x4f2437){const _0xcbc256=a38_0x239142,{options:_0x82bd,args:_0x5e0b5b,tdx:_0x3540e5}=_0x4f2437,_0x12d6ac=_0x82bd,_0x23f714=await resolveTarget({'arg':_0x5e0b5b[0x0],'contextParent':_0x82bd['parentSegment'],'cwd':process[_0xcbc256(0x11e)]()});if(!isSuccessfulResolution(_0x23f714))return _0x23f714[_0xcbc256(0x141)]==='no_parent'?(console['error'](a38_0x3720b4[_0xcbc256(0x1a0)](_0xcbc256(0x197))),console[_0xcbc256(0x17b)]('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[_0xcbc256(0x17b)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent'),console['error'](_0xcbc256(0x185))):(console[_0xcbc256(0x17b)](a38_0x3720b4['red'](_0xcbc256(0x138)+_0x23f714['message']+'\x0a')),_0x23f714[_0xcbc256(0x170)]&&console['error'](a38_0x3720b4['cyan'](_0x23f714['helpText']))),0x1;if(_0x23f714[_0xcbc256(0x162)]===_0xcbc256(0x168))return console['error'](a38_0x3720b4['red'](_0xcbc256(0x172)+_0x23f714[_0xcbc256(0x15d)]+'\x0a')),console['error'](a38_0x3720b4['cyan'](_0xcbc256(0x19b))),0x1;const _0x46f34f=_0x23f714[_0xcbc256(0x13c)],_0xe6f6c0=_0x23f714[_0xcbc256(0x15d)],_0x279b40=_0x23f714[_0xcbc256(0x162)]===_0xcbc256(0x126)?_0x23f714[_0xcbc256(0x166)]:undefined,_0x2b403b=getScopedDetails(_0x23f714),_0x29bae6=_0x2b403b?.[_0xcbc256(0x114)]??![],_0x3bfcb1=_0x2b403b?.[_0xcbc256(0x159)]??'';if(!existsSync(_0xe6f6c0))return console[_0xcbc256(0x17b)](a38_0x3720b4[_0xcbc256(0x131)](_0xcbc256(0x172)+_0xe6f6c0+'\x0a')),console['error'](a38_0x3720b4[_0xcbc256(0x156)]('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;_0x12d6ac[_0xcbc256(0x13f)]&&(console[_0xcbc256(0x17b)](_0xcbc256(0x14a)+_0x12d6ac[_0xcbc256(0x1ac)]),console['error'](_0xcbc256(0x121)+_0x46f34f),console['error'](_0xcbc256(0x196)+_0xe6f6c0),_0x29bae6&&console[_0xcbc256(0x17b)](_0xcbc256(0x14f)+_0x3bfcb1));const _0x3c118a=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x46f34f+_0xcbc256(0x116),()=>_0x3540e5[_0xcbc256(0x18a)][_0xcbc256(0x18b)](_0x46f34f),{'verbose':_0x12d6ac[_0xcbc256(0x13f)]}),_0x3d000f=_0x3c118a[_0xcbc256(0x163)],{parentSegmentResult:_0x6260a1,segmentsResult:_0x4c8834,foldersResult:_0xfef64,journeysWithDetailsResult:_0x5c441b,userMaps:_0x3eba9c}=await withSpinner(_0xcbc256(0x194),async()=>{const _0x1ba303=_0xcbc256,[_0x3f5a8a,_0x13e91e,_0x28f046,_0x1169ee,_0x34a5c3]=await Promise[_0x1ba303(0x135)]([_0x3540e5['segment'][_0x1ba303(0x142)](_0x3d000f),_0x3540e5[_0x1ba303(0x18a)][_0x1ba303(0x16e)](_0x3d000f),_0x3540e5[_0x1ba303(0x18a)][_0x1ba303(0x1af)](_0x3d000f),_0x3540e5['journey']['listJourneysWithDetailsFromParentSegment'](_0x3d000f,{'includeAllVersions':!![]}),_0x3540e5[_0x1ba303(0x157)][_0x1ba303(0x171)]()]);return{'parentSegmentResult':_0x3f5a8a,'segmentsResult':_0x13e91e,'foldersResult':_0x28f046,'journeysWithDetailsResult':_0x1169ee,'userMaps':_0x34a5c3};},{'verbose':_0x12d6ac[_0xcbc256(0x13f)]})[_0xcbc256(0x18e)](_0x26ce3c=>_0x26ce3c['data']),_0x19555c=_0x6260a1,_0x4d986d=extractRootFolderId(_0x19555c),_0x59c294=_0x4c8834,_0x4d29ca=_0xfef64,{journeys:_0x3d4fd6,activationStepsById:_0x4004ed}=_0x5c441b,_0x381d89=new Map(_0x3d4fd6[_0xcbc256(0x119)](_0x27c32a=>[_0x27c32a['id'],_0x27c32a])),_0x28ab85=_0x3d4fd6[_0xcbc256(0x119)](_0x6c80c9=>({'id':_0x6c80c9['id'],'name':_0x6c80c9[_0xcbc256(0x115)][_0xcbc256(0x186)],'journeyBundleName':_0x6c80c9[_0xcbc256(0x115)][_0xcbc256(0x1a6)]||'','journeyBundleId':_0x6c80c9[_0xcbc256(0x115)][_0xcbc256(0x16f)]||'','versionNumber':_0x6c80c9[_0xcbc256(0x115)][_0xcbc256(0x139)],'description':_0x6c80c9[_0xcbc256(0x115)]['description'],'state':_0x6c80c9['attributes'][_0xcbc256(0x128)],'paused':_0x6c80c9[_0xcbc256(0x115)][_0xcbc256(0x13d)],'audienceId':_0x6c80c9['attributes']['audienceId'],'folderId':_0x6c80c9[_0xcbc256(0x19a)]?.[_0xcbc256(0x19e)]?.['data']?.['id'],'createdAt':_0x6c80c9[_0xcbc256(0x115)][_0xcbc256(0x152)],'updatedAt':_0x6c80c9['attributes'][_0xcbc256(0x1a4)]})),{emailToId:_0x796f45,idToEmail:_0x47023a}=_0x3eba9c,_0x3ddf82=await withSpinner('Fetching\x20connections\x20for\x20name\x20resolution...',async()=>{const _0x954788=_0xcbc256,_0x23c309=await _0x3540e5[_0x954788(0x1ad)][_0x954788(0x140)]();return buildConnectionMaps(_0x23c309);},{'verbose':_0x12d6ac[_0xcbc256(0x13f)]})[_0xcbc256(0x18e)](_0x22a14e=>_0x22a14e[_0xcbc256(0x163)]),_0x26e088=_0x3ddf82[_0xcbc256(0x158)],_0x4799d9=_0x3ddf82['idToName'],_0x369485=_0x3ddf82[_0xcbc256(0x188)],_0x12769e={'emailToIdMap':_0x796f45,'connectionNameToIdMap':_0x26e088,'connectionNameToTypeMap':_0x369485,'getSchema':_0x2cd96a=>_0x3540e5[_0xcbc256(0x1ad)][_0xcbc256(0x15e)](_0x2cd96a)};let {pathToId:_0x42cbd3,idToPath:_0x401729}=buildFolderMaps(_0x4d29ca);const _0x3481a5=buildSegmentLookupMap(_0x59c294,_0x401729),_0x50a22c=buildSegmentNameToIdMap(_0x59c294),_0x1fce00=buildJourneyBundleLookupMap(_0x28ab85,_0x401729);let _0x5bdfa4;if(_0x279b40){if(!_0x279b40[_0xcbc256(0x181)](_0xcbc256(0x19c))&&!_0x279b40[_0xcbc256(0x181)](_0xcbc256(0x19f)))return console[_0xcbc256(0x17b)](a38_0x3720b4['red']('Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20'+_0x279b40+'\x0a')),0x1;_0x5bdfa4=[_0x279b40];}else _0x5bdfa4=findYamlFiles(_0xe6f6c0);if(_0x5bdfa4[_0xcbc256(0x14d)]===0x0)return console[_0xcbc256(0x17b)](a38_0x3720b4[_0xcbc256(0x131)]('Error:\x20No\x20YAML\x20files\x20found\x20in\x20'+_0xe6f6c0+'\x0a')),console[_0xcbc256(0x17b)](a38_0x3720b4['cyan']('Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files')),0x1;let _0x150bdb,_0x569e43;try{const _0x4862fb=parseAndClassifyYamlFiles(_0x5bdfa4,_0xe6f6c0,{'skipSegments':_0x12d6ac['journeysOnly']});_0x150bdb=_0x4862fb[_0xcbc256(0x12f)],_0x569e43=_0x4862fb['journeys'];const _0x4e016c=validateParsedFiles(_0x4862fb,_0xe6f6c0);if(_0x4e016c['length']>0x0)return console[_0xcbc256(0x17b)](a38_0x3720b4[_0xcbc256(0x131)](_0xcbc256(0x125))),console['error'](formatValidationErrors(_0x4e016c)),console[_0xcbc256(0x17b)](a38_0x3720b4['yellow'](_0xcbc256(0x112))),0x1;}catch(_0x3fc0f5){return console[_0xcbc256(0x17b)](a38_0x3720b4[_0xcbc256(0x131)]('Error\x20parsing\x20YAML:\x20'+(_0x3fc0f5 instanceof Error?_0x3fc0f5[_0xcbc256(0x190)]:_0x3fc0f5))),0x1;}if(_0x150bdb[_0xcbc256(0x14d)]===0x0&&_0x569e43[_0xcbc256(0x14d)]===0x0){const _0x2b3074=_0x12d6ac[_0xcbc256(0x12d)]?_0xcbc256(0x18c):_0xcbc256(0x195);return console[_0xcbc256(0x17b)](a38_0x3720b4[_0xcbc256(0x1a0)](_0xcbc256(0x161)+_0x2b3074+_0xcbc256(0x183))),0x0;}const _0x54d8cd=new Map();_0x59c294['length']>0x0&&!_0x12d6ac[_0xcbc256(0x12d)]&&await withSpinner(_0xcbc256(0x129),async()=>{await batchAsync(_0x59c294,async _0x1a7205=>{const _0x4a1298=a38_0x16e0,_0x18940a=await _0x3540e5[_0x4a1298(0x18a)][_0x4a1298(0x174)](_0x3d000f,_0x1a7205['id']);_0x54d8cd[_0x4a1298(0x147)](_0x1a7205['id'],_0x18940a);});},{'verbose':_0x12d6ac[_0xcbc256(0x13f)]});const {segmentFiles:_0x2eb352,foldersToCreate:_0x4c5405}=await prepareSegmentFiles(_0x150bdb,{'segmentByFolderAndName':_0x3481a5,'activationsBySegmentId':_0x54d8cd,'folderPathToId':_0x42cbd3,'idToEmailMap':_0x47023a,'connectionIdToNameMap':_0x4799d9},_0x12769e,_0x29bae6,_0x3bfcb1),_0xc44524=_0x279b40?[]:findSegmentsToDelete(_0x59c294,_0x150bdb[_0xcbc256(0x119)](({yamlConfig:_0x5bb06b,folderPath:_0x28bedd})=>({'yamlConfig':_0x5bb06b,'folderPath':resolveTDFolderPath(_0x28bedd,_0x29bae6,_0x3bfcb1)})),_0x401729,_0x3bfcb1,_0x29bae6),{journeyFiles:_0x5a2eaf,foldersToCreate:_0x2e318b}=await withProgressSpinner(_0xcbc256(0x120),async _0x1dee8a=>prepareJourneyFiles(_0x569e43,{'fetchJourney':async _0x4c5754=>_0x3540e5[_0xcbc256(0x18c)]['getJourney'](_0x4c5754['journeyId']),'journeyBundlesByFolderAndName':_0x1fce00,'folderPathToId':_0x42cbd3,'idToEmailMap':_0x47023a,'connectionIdToNameMap':_0x4799d9,'existingSegments':_0x59c294,'parentId':_0x3d000f,'deps':_0x3540e5,'progress':{'update':_0x28dc00=>{const _0x377eb1=_0xcbc256;_0x1dee8a['setPhase'](_0x28dc00),_0x12d6ac[_0x377eb1(0x13f)]&&console[_0x377eb1(0x17b)]('\x20\x20'+_0x28dc00);}},'journeyById':_0x381d89,'activationStepsById':_0x4004ed},_0x29bae6,_0x3bfcb1),{'verbose':_0x12d6ac['verbose']})[_0xcbc256(0x18e)](_0x287f52=>_0x287f52[_0xcbc256(0x163)]);for(const _0x2c4e3a of _0x2e318b){_0x4c5405[_0xcbc256(0x14c)](_0x2c4e3a);}const _0x26f089=_0x279b40?[]:findJourneysToDelete(_0x28ab85,_0x569e43[_0xcbc256(0x119)](({yamlConfig:_0x41e822,folderPath:_0x4668e7})=>({'yamlConfig':_0x41e822,'folderPath':resolveTDFolderPath(_0x4668e7,_0x29bae6,_0x3bfcb1)})),_0x401729,_0x3bfcb1,_0x29bae6),_0x219c01=calculatePushStats(_0x2eb352,_0x5a2eaf,_0x4c5405,_0xc44524,_0x26f089,!!_0x12d6ac[_0xcbc256(0x184)],!!_0x12d6ac[_0xcbc256(0x12d)]),_0x2d077a=_0x219c01[_0xcbc256(0x12f)][_0xcbc256(0x118)],_0x48814e=_0x219c01['segments'][_0xcbc256(0x1a5)],_0x259322=_0x219c01[_0xcbc256(0x12f)][_0xcbc256(0x14e)],_0x9deba2=_0x219c01[_0xcbc256(0x12f)][_0xcbc256(0x1a2)],_0x4c0066=_0x219c01[_0xcbc256(0x180)][_0xcbc256(0x1a7)],_0x583b13=_0x219c01[_0xcbc256(0x122)][_0xcbc256(0x118)],_0x204e67=_0x219c01[_0xcbc256(0x122)][_0xcbc256(0x1a5)],_0x5b7be8=_0x219c01[_0xcbc256(0x122)][_0xcbc256(0x14e)],_0x51eb79=_0x219c01[_0xcbc256(0x122)][_0xcbc256(0x1a2)],_0x47fa5a=_0x219c01['activations'][_0xcbc256(0x135)],_0x139541=_0x219c01[_0xcbc256(0x12b)][_0xcbc256(0x1a7)],_0xdae0aa=_0x219c01[_0xcbc256(0x12b)][_0xcbc256(0x1aa)],_0x140af3=_0x219c01['activations'][_0xcbc256(0x1a2)];console['error'](_0xcbc256(0x144)+_0x46f34f+'\x27:');_0x4c0066[_0xcbc256(0x14d)]>0x0&&console[_0xcbc256(0x17b)]('\x20\x20'+a38_0x3720b4[_0xcbc256(0x1a3)](_0xcbc256(0x127)+_0x4c0066[_0xcbc256(0x14d)]+_0xcbc256(0x189)));if(!_0x12d6ac[_0xcbc256(0x12d)]){console['error'](_0xcbc256(0x1a1)),console[_0xcbc256(0x17b)](_0xcbc256(0x165)+a38_0x3720b4[_0xcbc256(0x16c)]('+\x20'+_0x2d077a[_0xcbc256(0x14d)]+_0xcbc256(0x12c))),console['error'](_0xcbc256(0x165)+a38_0x3720b4[_0xcbc256(0x1a0)]('~\x20'+_0x48814e[_0xcbc256(0x14d)]+_0xcbc256(0x11c)));if(_0x9deba2['length']>0x0)console['error'](_0xcbc256(0x165)+a38_0x3720b4['red']('-\x20'+_0x9deba2[_0xcbc256(0x14d)]+_0xcbc256(0x1ae)));else _0xc44524[_0xcbc256(0x14d)]>0x0&&!_0x12d6ac[_0xcbc256(0x184)]&&console[_0xcbc256(0x17b)](_0xcbc256(0x165)+a38_0x3720b4[_0xcbc256(0x17d)](_0xc44524[_0xcbc256(0x14d)]+_0xcbc256(0x143)));console['error'](_0xcbc256(0x165)+a38_0x3720b4['dim']('=\x20'+_0x259322['length']+_0xcbc256(0x187)));}if(_0x5a2eaf[_0xcbc256(0x14d)]>0x0||_0x26f089[_0xcbc256(0x14d)]>0x0){console[_0xcbc256(0x17b)]('\x20\x20🗺️\x20\x20Journeys:'),console[_0xcbc256(0x17b)](_0xcbc256(0x165)+a38_0x3720b4[_0xcbc256(0x16c)]('+\x20'+_0x583b13[_0xcbc256(0x14d)]+_0xcbc256(0x12c))),console[_0xcbc256(0x17b)](_0xcbc256(0x165)+a38_0x3720b4[_0xcbc256(0x1a0)]('~\x20'+_0x204e67[_0xcbc256(0x14d)]+_0xcbc256(0x11c)));if(_0x51eb79[_0xcbc256(0x14d)]>0x0)console['error'](_0xcbc256(0x165)+a38_0x3720b4[_0xcbc256(0x131)]('-\x20'+_0x51eb79[_0xcbc256(0x14d)]+_0xcbc256(0x1ae)));else _0x26f089['length']>0x0&&!_0x12d6ac['delete']&&console[_0xcbc256(0x17b)]('\x20\x20\x20\x20'+a38_0x3720b4[_0xcbc256(0x17d)](_0x26f089[_0xcbc256(0x14d)]+_0xcbc256(0x143)));console[_0xcbc256(0x17b)]('\x20\x20\x20\x20'+a38_0x3720b4[_0xcbc256(0x17d)]('=\x20'+_0x5b7be8['length']+_0xcbc256(0x187)));}_0x47fa5a[_0xcbc256(0x14d)]>0x0&&!_0x12d6ac[_0xcbc256(0x12d)]&&(console[_0xcbc256(0x17b)](''),console['error'](_0xcbc256(0x17f)),_0x139541[_0xcbc256(0x14d)]>0x0&&console[_0xcbc256(0x17b)](_0xcbc256(0x165)+a38_0x3720b4[_0xcbc256(0x16c)]('+\x20'+_0x139541[_0xcbc256(0x14d)]+_0xcbc256(0x1a9))),_0xdae0aa['length']>0x0&&console[_0xcbc256(0x17b)](_0xcbc256(0x165)+a38_0x3720b4[_0xcbc256(0x1a0)]('~\x20'+_0xdae0aa[_0xcbc256(0x14d)]+'\x20to\x20update')),_0x140af3[_0xcbc256(0x14d)]>0x0&&console['error'](_0xcbc256(0x165)+a38_0x3720b4['red']('-\x20'+_0x140af3[_0xcbc256(0x14d)]+'\x20to\x20delete')));console[_0xcbc256(0x17b)](_0xcbc256(0x18f)+a38_0x3720b4['cyan'](_0xe6f6c0)+'\x0a');if(_0x4c0066[_0xcbc256(0x14d)]>0x0){console['error'](_0xcbc256(0x155));for(const _0x279e87 of _0x4c0066){console[_0xcbc256(0x17b)]('\x20\x20'+a38_0x3720b4['blue']('+')+'\x20'+_0x279e87);}console[_0xcbc256(0x17b)]('');}if(_0x2d077a['length']>0x0&&!_0x12d6ac[_0xcbc256(0x12d)])for(const _0x1456b4 of _0x2d077a){const _0x1eccce=_0x1456b4[_0xcbc256(0x15a)]?_0x1456b4['folderPath']+'/'+_0x1456b4[_0xcbc256(0x137)][_0xcbc256(0x186)]:_0x1456b4[_0xcbc256(0x137)]['name'],_0x37d853=_0x1456b4[_0xcbc256(0x137)][_0xcbc256(0x12b)]?.[_0xcbc256(0x14d)]||0x0,_0x2d828e=_0x37d853>0x0?a38_0x3720b4[_0xcbc256(0x17d)]('\x20['+_0x37d853+'\x20activations]'):'';console[_0xcbc256(0x17b)]('\x0a'+a38_0x3720b4['green'](_0xcbc256(0x179))+'\x20'+_0x1eccce+_0x2d828e),console['error']('─'['repeat'](0x3c)),_0x1456b4[_0xcbc256(0x17e)]&&console[_0xcbc256(0x17b)](_0x1456b4[_0xcbc256(0x17e)]),console[_0xcbc256(0x17b)]('─'['repeat'](0x3c));}if(_0x9deba2['length']>0x0&&!_0x12d6ac[_0xcbc256(0x12d)])for(const _0x2cad96 of _0x9deba2){const _0x2898d4=_0x2cad96['segmentFolderId']?_0x401729[_0xcbc256(0x192)](_0x2cad96['segmentFolderId'][_0xcbc256(0x18d)]())||'':'',_0x8a2633=_0x2898d4?_0x2898d4+'/'+_0x2cad96[_0xcbc256(0x186)]:_0x2cad96[_0xcbc256(0x186)],_0x38cbaf=_0x54d8cd['get'](_0x2cad96['id'])||[],_0xcff4eb=_0x38cbaf['length']>0x0?a38_0x3720b4[_0xcbc256(0x17d)]('\x20['+_0x38cbaf[_0xcbc256(0x14d)]+_0xcbc256(0x149)):'';console[_0xcbc256(0x17b)]('\x0a'+a38_0x3720b4[_0xcbc256(0x131)]('Delete\x20segment:')+'\x20'+_0x8a2633+_0xcff4eb),console[_0xcbc256(0x17b)]('─'['repeat'](0x3c));const _0x3e988e=segmentWithActivationsToYaml(_0x2cad96,_0x38cbaf,undefined,_0x47023a,_0x4799d9),_0xb1fafe=segmentToYamlString(_0x3e988e),_0x309768=generateDiff(_0xb1fafe,'');console[_0xcbc256(0x17b)](formatDiffWithColors(_0x309768)),console[_0xcbc256(0x17b)]('─'[_0xcbc256(0x11d)](0x3c));}const _0x3ddcf5=_0x2eb352[_0xcbc256(0x117)](_0x4689bb=>!_0x4689bb[_0xcbc256(0x11b)]&&_0x4689bb['diff']);if(_0x3ddcf5[_0xcbc256(0x14d)]>0x0&&!_0x12d6ac[_0xcbc256(0x12d)])for(const _0x2cf6e4 of _0x3ddcf5){const _0x5d694d=_0x2cf6e4[_0xcbc256(0x15a)]?_0x2cf6e4['folderPath']+'/'+_0x2cf6e4['yamlConfig'][_0xcbc256(0x186)]:_0x2cf6e4[_0xcbc256(0x137)][_0xcbc256(0x186)];console[_0xcbc256(0x17b)]('\x0a'+a38_0x3720b4[_0xcbc256(0x1a0)](_0xcbc256(0x12e))+'\x20'+_0x5d694d),console[_0xcbc256(0x17b)]('─'['repeat'](0x3c)),console[_0xcbc256(0x17b)](_0x2cf6e4[_0xcbc256(0x17e)]),console[_0xcbc256(0x17b)]('─'['repeat'](0x3c));}if(_0x583b13['length']>0x0)for(const _0x519b9f of _0x583b13){const _0x3f8948=_0x519b9f[_0xcbc256(0x15a)]?_0x519b9f[_0xcbc256(0x15a)]+'/'+_0x519b9f[_0xcbc256(0x137)]['name']:_0x519b9f[_0xcbc256(0x137)][_0xcbc256(0x186)];console[_0xcbc256(0x17b)]('\x0a'+a38_0x3720b4[_0xcbc256(0x16c)](_0xcbc256(0x182))+'\x20'+_0x3f8948),console[_0xcbc256(0x17b)]('─'[_0xcbc256(0x11d)](0x3c)),_0x519b9f[_0xcbc256(0x17e)]&&console[_0xcbc256(0x17b)](_0x519b9f[_0xcbc256(0x17e)]),console[_0xcbc256(0x17b)]('─'['repeat'](0x3c));}const _0x2a2c3c=_0x5a2eaf[_0xcbc256(0x117)](_0x1141d9=>!_0x1141d9[_0xcbc256(0x11b)]&&_0x1141d9[_0xcbc256(0x17e)]);if(_0x2a2c3c[_0xcbc256(0x14d)]>0x0)for(const _0x398330 of _0x2a2c3c){const _0x26d577=_0x398330[_0xcbc256(0x15a)]?_0x398330[_0xcbc256(0x15a)]+'/'+_0x398330[_0xcbc256(0x137)][_0xcbc256(0x186)]:_0x398330[_0xcbc256(0x137)][_0xcbc256(0x186)];console[_0xcbc256(0x17b)]('\x0a'+a38_0x3720b4[_0xcbc256(0x1a0)](_0xcbc256(0x136))+'\x20'+_0x26d577),console[_0xcbc256(0x17b)]('─'[_0xcbc256(0x11d)](0x3c)),console[_0xcbc256(0x17b)](_0x398330['diff']),console['error']('─'[_0xcbc256(0x11d)](0x3c));}if(_0x51eb79['length']>0x0)for(const _0x1f4ed1 of _0x51eb79){const _0x4d8237=_0x1f4ed1[_0xcbc256(0x191)]?_0x401729[_0xcbc256(0x192)](_0x1f4ed1[_0xcbc256(0x191)])||'':'',_0x355469=_0x4d8237?_0x4d8237+'/'+_0x1f4ed1['journeyBundleName']:_0x1f4ed1[_0xcbc256(0x1a6)];console[_0xcbc256(0x17b)]('\x0a'+a38_0x3720b4[_0xcbc256(0x131)](_0xcbc256(0x124))+'\x20'+_0x355469),console[_0xcbc256(0x17b)]('─'['repeat'](0x3c)),console[_0xcbc256(0x17b)](a38_0x3720b4[_0xcbc256(0x131)](_0xcbc256(0x146))),console['error']('─'[_0xcbc256(0x11d)](0x3c));}if(_0x12d6ac['dryRun'])return console[_0xcbc256(0x17b)](a38_0x3720b4[_0xcbc256(0x1a0)](_0xcbc256(0x13a))),0x0;const _0x216983=_0x12d6ac[_0xcbc256(0x12d)]?![]:_0x2d077a[_0xcbc256(0x14d)]>0x0||_0x48814e[_0xcbc256(0x14d)]>0x0||_0x9deba2[_0xcbc256(0x14d)]>0x0,_0x40a80a=_0x583b13[_0xcbc256(0x14d)]>0x0||_0x204e67[_0xcbc256(0x14d)]>0x0||_0x51eb79[_0xcbc256(0x14d)]>0x0,_0xdf2966=_0x12d6ac[_0xcbc256(0x12d)]?![]:_0x47fa5a[_0xcbc256(0x14d)]>0x0,_0x44a479=_0x4c0066[_0xcbc256(0x14d)]>0x0;if(!_0x216983&&!_0x40a80a&&!_0xdf2966&&!_0x44a479){const _0x3054d0=_0x12d6ac['journeysOnly']?_0xcbc256(0x130):'✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date';console[_0xcbc256(0x17b)](a38_0x3720b4[_0xcbc256(0x16c)](_0x3054d0));if(_0x279b40&&_0x259322[_0xcbc256(0x14d)]===0x1){const _0xafca52=_0x259322[0x0];if(_0xafca52[_0xcbc256(0x16d)]?.['id']){const _0x512bcd=getConsoleNextUrl(_0x12d6ac[_0xcbc256(0x1ac)],'/app/ps/'+_0x3d000f+_0xcbc256(0x16a)+_0xafca52[_0xcbc256(0x16d)]['id']+_0xcbc256(0x11f));console[_0xcbc256(0x17b)](_0xcbc256(0x133)+a38_0x3720b4['cyan'](_0x512bcd));}}if(_0x279b40&&_0x5b7be8[_0xcbc256(0x14d)]===0x1){const _0x466c6e=_0x5b7be8[0x0];if(_0x466c6e[_0xcbc256(0x193)]?.['id']){const _0x46fe53=getConsoleNextUrl(_0x12d6ac[_0xcbc256(0x1ac)],_0xcbc256(0x15b)+_0x3d000f+_0xcbc256(0x16a)+_0x466c6e[_0xcbc256(0x193)]['id']+_0xcbc256(0x176));console[_0xcbc256(0x17b)]('\x20\x20'+a38_0x3720b4[_0xcbc256(0x156)](_0x46fe53));}}return 0x0;}const _0x21c839=_0x12d6ac['journeysOnly']?_0x583b13[_0xcbc256(0x14d)]+_0x204e67['length']+_0x51eb79['length']+_0x4c0066[_0xcbc256(0x14d)]:_0x2d077a['length']+_0x48814e[_0xcbc256(0x14d)]+_0x9deba2[_0xcbc256(0x14d)]+_0x583b13[_0xcbc256(0x14d)]+_0x204e67[_0xcbc256(0x14d)]+_0x51eb79[_0xcbc256(0x14d)]+_0x4c0066[_0xcbc256(0x14d)]+_0x47fa5a[_0xcbc256(0x14d)];if(!_0x12d6ac[_0xcbc256(0x19d)]&&_0x21c839>0x0){if(!isInteractive())return console['error'](a38_0x3720b4[_0xcbc256(0x131)](_0xcbc256(0x198)),_0xcbc256(0x16b)),console[_0xcbc256(0x17b)](a38_0x3720b4['dim']('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x29b092=await confirmKey(_0xcbc256(0x148)+_0x21c839+'\x20changes?');if(!_0x29b092)return console[_0xcbc256(0x17b)](a38_0x3720b4[_0xcbc256(0x1a0)](_0xcbc256(0x13e))),0x1;}const _0x292027={'withProgress':async(_0xbbaf89,_0x517a44)=>{const _0x2737fc=_0xcbc256,_0x32480b=await withSpinner(_0xbbaf89,_0x517a44,{'verbose':_0x12d6ac[_0x2737fc(0x13f)]});return{'data':_0x32480b[_0x2737fc(0x163)]};},'logInfo':_0x343edb=>console[_0xcbc256(0x17b)](a38_0x3720b4[_0xcbc256(0x1a3)]('✔\x20'+_0x343edb)),'logSuccess':_0x15f235=>console[_0xcbc256(0x17b)](a38_0x3720b4['green']('✔\x20'+_0x15f235)),'logWarning':_0x28c89c=>console[_0xcbc256(0x17b)](a38_0x3720b4['yellow']('⚠\x20'+_0x28c89c)),'logDeleted':_0x2881c6=>console[_0xcbc256(0x17b)](a38_0x3720b4[_0xcbc256(0x131)]('✔\x20'+_0x2881c6))},_0x3f4753={'segment':_0x3540e5[_0xcbc256(0x18a)],'journey':_0x3540e5[_0xcbc256(0x18c)],'user':_0x3540e5[_0xcbc256(0x157)],'connection':_0x3540e5[_0xcbc256(0x1ad)]};_0x4c0066[_0xcbc256(0x14d)]>0x0&&(_0x42cbd3=await executePushFolders(_0x3f4753,_0x4c0066,_0x42cbd3,{'parentId':_0x3d000f},_0x292027));const _0x573702={'rootFolderId':_0x4d986d,'folderPathToId':_0x42cbd3,'folderIdToPath':_0x401729,'segmentNameToId':_0x50a22c,'activationsBySegmentId':_0x54d8cd,'emailToIdMap':_0x796f45,'idToEmailMap':_0x47023a,'connectionNameToIdMap':_0x3ddf82[_0xcbc256(0x158)],'connectionIdToNameMap':_0x3ddf82['idToName'],'connectionNameToTypeMap':_0x369485},_0x28f395=await executePushSegments(_0x3f4753,_0x12d6ac[_0xcbc256(0x12d)]?[]:_0x2eb352,_0x573702,{'parentId':_0x3d000f},_0x292027),_0x54ec70=_0x28f395[_0xcbc256(0x11a)],_0xca965b=_0x28f395[_0xcbc256(0x169)],_0x1c03b8=_0x28f395['activations'][_0xcbc256(0x11a)],_0x13c9a9=_0x28f395[_0xcbc256(0x12b)][_0xcbc256(0x169)],_0x55859b=_0x28f395[_0xcbc256(0x12b)][_0xcbc256(0x164)];let _0xaf3cd3;if(_0x279b40&&_0x2eb352[_0xcbc256(0x14d)]===0x1){const _0x1b2834=_0x2eb352[0x0];_0xaf3cd3=_0x1b2834[_0xcbc256(0x16d)]?.['id']??_0x28f395['createdSegmentIds']['get'](_0x1b2834[_0xcbc256(0x137)][_0xcbc256(0x186)]);}const _0x2dac5d=await executePushSegmentDeletions(_0x3f4753,_0x12d6ac['journeysOnly']?[]:_0x9deba2,_0x292027);let _0x2ab2c4=0x0,_0x260067=0x0,_0x303f23=0x0;const _0x18aa05=new Map(_0x50a22c);for(const [_0x159f5f,_0x941039]of _0x28f395[_0xcbc256(0x15c)]){_0x18aa05['set'](_0x159f5f,_0x941039);}if(_0x5a2eaf[_0xcbc256(0x14d)]>0x0){const _0x304939={..._0x573702,'segmentNameToId':_0x18aa05,'existingSegments':_0x59c294,'activationContext':_0x12769e},_0x3375a5=await executePushJourneys(_0x3f4753,_0x5a2eaf,_0x304939,{'parentId':_0x3d000f,'rootFolderId':_0x4d986d,'verbose':_0x12d6ac[_0xcbc256(0x13f)]},_0x292027);_0x2ab2c4=_0x3375a5[_0xcbc256(0x11a)],_0x260067=_0x3375a5[_0xcbc256(0x169)];if(_0x279b40&&_0x3375a5[_0xcbc256(0x178)]['length']===0x1){const _0x559390=_0x3375a5[_0xcbc256(0x178)][0x0];if(_0x559390['journeyId']){const _0x385374=getConsoleNextUrl(_0x12d6ac['site'],_0xcbc256(0x15b)+_0x3d000f+_0xcbc256(0x16a)+_0x559390[_0xcbc256(0x167)]+'/j/da/je');console[_0xcbc256(0x17b)]('\x20\x20'+a38_0x3720b4[_0xcbc256(0x156)](_0x385374));}}}for(const _0x153555 of _0x51eb79){console[_0xcbc256(0x17b)](a38_0x3720b4[_0xcbc256(0x1a0)](_0xcbc256(0x134)+_0x153555[_0xcbc256(0x1a6)])),_0x303f23++;}const _0x3d059e=[];if(_0x54ec70>0x0)_0x3d059e['push'](_0x54ec70+'\x20created');if(_0xca965b>0x0)_0x3d059e[_0xcbc256(0x173)](_0xca965b+_0xcbc256(0x154));if(_0x2dac5d>0x0)_0x3d059e[_0xcbc256(0x173)](_0x2dac5d+_0xcbc256(0x17a));const _0x580988=[];if(_0x2ab2c4>0x0)_0x580988[_0xcbc256(0x173)](_0x2ab2c4+_0xcbc256(0x17c));if(_0x260067>0x0)_0x580988[_0xcbc256(0x173)](_0x260067+_0xcbc256(0x154));if(_0x303f23>0x0)_0x580988[_0xcbc256(0x173)](_0x303f23+_0xcbc256(0x17a));const _0x172a8d=[];if(_0x1c03b8>0x0)_0x172a8d['push'](_0x1c03b8+_0xcbc256(0x17c));if(_0x13c9a9>0x0)_0x172a8d[_0xcbc256(0x173)](_0x13c9a9+_0xcbc256(0x154));if(_0x55859b>0x0)_0x172a8d[_0xcbc256(0x173)](_0x55859b+_0xcbc256(0x17a));console[_0xcbc256(0x17b)](a38_0x3720b4['green'](_0xcbc256(0x1ab)));_0x3d059e[_0xcbc256(0x14d)]>0x0&&!_0x12d6ac['journeysOnly']&&console['error'](_0xcbc256(0x12a)+_0x3d059e[_0xcbc256(0x123)](',\x20'));_0x580988[_0xcbc256(0x14d)]>0x0&&console[_0xcbc256(0x17b)](_0xcbc256(0x177)+_0x580988[_0xcbc256(0x123)](',\x20'));_0x172a8d[_0xcbc256(0x14d)]>0x0&&!_0x12d6ac['journeysOnly']&&console[_0xcbc256(0x17b)](_0xcbc256(0x113)+_0x172a8d['join'](',\x20'));if(_0xaf3cd3){const _0x4e6d35=getConsoleNextUrl(_0x12d6ac[_0xcbc256(0x1ac)],_0xcbc256(0x15b)+_0x3d000f+_0xcbc256(0x16a)+_0xaf3cd3+_0xcbc256(0x11f));console[_0xcbc256(0x17b)](_0xcbc256(0x133)+a38_0x3720b4[_0xcbc256(0x156)](_0x4e6d35));}return 0x0;}}
@@ -1 +1 @@
1
- function a36_0x48b9(_0x1c15b8,_0x5bc5e9){_0x1c15b8=_0x1c15b8-0x14a;const _0x3114e7=a36_0x3114();let _0x48b9cd=_0x3114e7[_0x1c15b8];return _0x48b9cd;}const a36_0x3ddd60=a36_0x48b9;(function(_0x3125a1,_0x444368){const _0x21f94b=a36_0x48b9,_0x57a017=_0x3125a1();while(!![]){try{const _0x2e1434=-parseInt(_0x21f94b(0x161))/0x1*(-parseInt(_0x21f94b(0x16f))/0x2)+parseInt(_0x21f94b(0x15e))/0x3+-parseInt(_0x21f94b(0x165))/0x4*(-parseInt(_0x21f94b(0x160))/0x5)+-parseInt(_0x21f94b(0x16a))/0x6*(parseInt(_0x21f94b(0x14a))/0x7)+-parseInt(_0x21f94b(0x162))/0x8*(-parseInt(_0x21f94b(0x173))/0x9)+-parseInt(_0x21f94b(0x156))/0xa+-parseInt(_0x21f94b(0x16d))/0xb;if(_0x2e1434===_0x444368)break;else _0x57a017['push'](_0x57a017['shift']());}catch(_0x81e68d){_0x57a017['push'](_0x57a017['shift']());}}}(a36_0x3114,0xa1e9c));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{SDKError,ErrorCode}from'../sdk/index.js';function a36_0x3114(){const _0x41edd8=['folder','Segment\x20ID:\x20','Error:\x20Cannot\x20update\x20','resolveFolderId','execute','77axTTFI','Resolved\x20type:\x20','parentId','\x27...','yellow','Resolving\x20folder\x20\x27','segmentName','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]','Resolved\x20folder\x20ID:\x20','ruleFile','resolvePathToResource','6328800vGZJCS','name','error','\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','updateSegmentById','Resolving\x20path\x20\x27','\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22','verbose','2732982RMqmoR','data','5faHeFz','570616YSgbtL','481976BdASBi','rule','kind','1574180SoHdJS','Parent\x20ID:\x20','\x20\x20\x20Path:\x20','Resolved\x20relative\x20path\x20to:\x20','segmentId','410418xMoaqH','description','segment','6708427PrAQMk','Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]','2nuhguf','.\x20Only\x20child\x20segments\x20can\x20be\x20updated.','type','Segment\x20ID\x20missing\x20from\x20resolved\x20path','117HBUepY','Updating\x20segment\x20\x27','includes','segment:update'];a36_0x3114=function(){return _0x41edd8;};return a36_0x3114();}import a36_0x503e3a from'chalk';export class SegmentUpdateCommand extends BaseCommand{[a36_0x3ddd60(0x157)]=a36_0x3ddd60(0x176);[a36_0x3ddd60(0x16b)]='Update\x20existing\x20child\x20segment';async[a36_0x3ddd60(0x17b)](_0x21d153){const _0x1e31e7=a36_0x3ddd60;console['error'](a36_0x503e3a[_0x1e31e7(0x14e)]('⚠\x20Deprecation\x20warning:\x20`segment\x20update`\x20is\x20deprecated.')),console[_0x1e31e7(0x158)](a36_0x503e3a['yellow'](_0x1e31e7(0x151)));const {options:_0x21bb65,args:_0x1b13ba,tdx:_0x18d3a4}=_0x21d153,_0x2c0665=_0x21bb65;if(_0x1b13ba['length']===0x0)return console[_0x1e31e7(0x158)]('Error:\x20Segment\x20path\x20or\x20name\x20is\x20required'),console[_0x1e31e7(0x158)](_0x1e31e7(0x16e)),console[_0x1e31e7(0x158)]('Examples:'),console[_0x1e31e7(0x158)](_0x1e31e7(0x15c)),console[_0x1e31e7(0x158)](_0x1e31e7(0x159)),0x1;const _0x29d4a5=_0x1b13ba[0x0],_0x5cb427=_0x21bb65['segmentPath'];let _0x42b948=_0x29d4a5;_0x5cb427&&!_0x29d4a5[_0x1e31e7(0x175)]('/')&&(_0x42b948=_0x5cb427+'/'+_0x29d4a5,_0x2c0665[_0x1e31e7(0x15d)]&&console[_0x1e31e7(0x158)](_0x1e31e7(0x168)+_0x42b948));const _0x4ffba3=await withSpinner(_0x1e31e7(0x15b)+_0x42b948+_0x1e31e7(0x14d),()=>_0x18d3a4['segment'][_0x1e31e7(0x155)](_0x42b948),{'verbose':_0x2c0665[_0x1e31e7(0x15d)]}),_0x39c5b7=_0x4ffba3['data'];_0x2c0665[_0x1e31e7(0x15d)]&&console[_0x1e31e7(0x158)](_0x1e31e7(0x14b)+_0x39c5b7[_0x1e31e7(0x171)]);if(_0x39c5b7[_0x1e31e7(0x171)]!=='segment')return console[_0x1e31e7(0x158)](_0x1e31e7(0x179)+_0x39c5b7[_0x1e31e7(0x171)]+_0x1e31e7(0x170)),console[_0x1e31e7(0x158)](_0x1e31e7(0x152)),0x1;if(!_0x39c5b7[_0x1e31e7(0x169)])throw new SDKError(ErrorCode['INTERNAL'],_0x1e31e7(0x172));const _0x4a6c65=_0x39c5b7[_0x1e31e7(0x14c)],_0x17d2be=_0x39c5b7[_0x1e31e7(0x169)];_0x2c0665[_0x1e31e7(0x15d)]&&(console[_0x1e31e7(0x158)](_0x1e31e7(0x166)+_0x4a6c65),console['error'](_0x1e31e7(0x178)+_0x17d2be));let _0x46bb90;if(_0x2c0665[_0x1e31e7(0x177)]){const _0x554c99=_0x2c0665[_0x1e31e7(0x177)],_0x916f28=await withSpinner(_0x1e31e7(0x14f)+_0x554c99+_0x1e31e7(0x14d),()=>_0x18d3a4[_0x1e31e7(0x16c)][_0x1e31e7(0x17a)](_0x4a6c65,_0x554c99),{'verbose':_0x2c0665[_0x1e31e7(0x15d)]});_0x46bb90=parseInt(_0x916f28[_0x1e31e7(0x15f)],0xa),_0x2c0665[_0x1e31e7(0x15d)]&&console['error'](_0x1e31e7(0x153)+_0x46bb90);}const _0x454d85=await loadJSONFromOptions(_0x2c0665[_0x1e31e7(0x163)],_0x2c0665[_0x1e31e7(0x154)]),_0x44d93f={'name':_0x2c0665[_0x1e31e7(0x157)],'description':_0x2c0665[_0x1e31e7(0x16b)],'rule':_0x454d85,'kind':_0x2c0665[_0x1e31e7(0x164)]!==undefined?parseInt(_0x2c0665[_0x1e31e7(0x164)],0xa):undefined,'segmentFolderId':_0x46bb90},_0x11682a=await withSpinner(_0x1e31e7(0x174)+_0x39c5b7[_0x1e31e7(0x150)]+_0x1e31e7(0x14d),()=>_0x18d3a4[_0x1e31e7(0x16c)][_0x1e31e7(0x15a)](_0x4a6c65,_0x17d2be,_0x44d93f),{'verbose':_0x2c0665[_0x1e31e7(0x15d)]}),_0x2c5c68=_0x11682a['data'];return console[_0x1e31e7(0x158)]('✔\x20Updated\x20segment\x20\x27'+_0x2c5c68[_0x1e31e7(0x157)]+'\x27'),_0x42b948!==_0x29d4a5&&console[_0x1e31e7(0x158)](_0x1e31e7(0x167)+_0x42b948),await handleSDKOutput([_0x2c5c68],_0x2c0665),0x0;}}
1
+ const a39_0x4a7c8e=a39_0x3394;(function(_0x5517b4,_0x42eb36){const _0x328897=a39_0x3394,_0x30aa46=_0x5517b4();while(!![]){try{const _0x53639b=parseInt(_0x328897(0x140))/0x1+parseInt(_0x328897(0x11e))/0x2*(parseInt(_0x328897(0x121))/0x3)+-parseInt(_0x328897(0x147))/0x4+parseInt(_0x328897(0x120))/0x5+parseInt(_0x328897(0x122))/0x6+parseInt(_0x328897(0x142))/0x7+-parseInt(_0x328897(0x135))/0x8;if(_0x53639b===_0x42eb36)break;else _0x30aa46['push'](_0x30aa46['shift']());}catch(_0x23fd1d){_0x30aa46['push'](_0x30aa46['shift']());}}}(a39_0x37d8,0x8e4fd));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';function a39_0x37d8(){const _0x42fc75=['\x20\x20\x20Path:\x20','data','\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22','Resolving\x20path\x20\x27','segmentPath','type','\x27...','775315sKmpAa','folder','2368471RQwxes','Examples:','updateSegmentById','Segment\x20ID:\x20','name','3064488PKeIGC','error','Segment\x20ID\x20missing\x20from\x20resolved\x20path','1394JIbjMk','segment:update','5589645ZniHjR','2076ldXNal','5537988apOYTf','yellow','length','verbose','Parent\x20ID:\x20','segmentId','Resolved\x20relative\x20path\x20to:\x20','Resolved\x20type:\x20','Resolving\x20folder\x20\x27','kind','.\x20Only\x20child\x20segments\x20can\x20be\x20updated.','description','resolveFolderId','resolvePathToResource','segment','✔\x20Updated\x20segment\x20\x27','parentId','Updating\x20segment\x20\x27','includes','18303104xrxqUM','Error:\x20Cannot\x20update\x20','segmentName','Update\x20existing\x20child\x20segment'];a39_0x37d8=function(){return _0x42fc75;};return a39_0x37d8();}import{loadJSONFromOptions}from'../utils/json-loader.js';function a39_0x3394(_0x37b2a7,_0x860c5){_0x37b2a7=_0x37b2a7-0x11e;const _0x37d8f7=a39_0x37d8();let _0x339425=_0x37d8f7[_0x37b2a7];return _0x339425;}import{SDKError,ErrorCode}from'../sdk/index.js';import a39_0x1d6732 from'chalk';export class SegmentUpdateCommand extends BaseCommand{[a39_0x4a7c8e(0x146)]=a39_0x4a7c8e(0x11f);[a39_0x4a7c8e(0x12d)]=a39_0x4a7c8e(0x138);async['execute'](_0x5759ef){const _0x524586=a39_0x4a7c8e;console[_0x524586(0x148)](a39_0x1d6732[_0x524586(0x123)]('⚠\x20Deprecation\x20warning:\x20`segment\x20update`\x20is\x20deprecated.')),console[_0x524586(0x148)](a39_0x1d6732[_0x524586(0x123)]('\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a'));const {options:_0x1b6807,args:_0x5101fc,tdx:_0x2a4a16}=_0x5759ef,_0x5442e8=_0x1b6807;if(_0x5101fc[_0x524586(0x124)]===0x0)return console[_0x524586(0x148)]('Error:\x20Segment\x20path\x20or\x20name\x20is\x20required'),console[_0x524586(0x148)]('Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]'),console['error'](_0x524586(0x143)),console[_0x524586(0x148)](_0x524586(0x13b)),console[_0x524586(0x148)]('\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context'),0x1;const _0x9ddcf9=_0x5101fc[0x0],_0x163a25=_0x1b6807[_0x524586(0x13d)];let _0x51c258=_0x9ddcf9;_0x163a25&&!_0x9ddcf9[_0x524586(0x134)]('/')&&(_0x51c258=_0x163a25+'/'+_0x9ddcf9,_0x5442e8['verbose']&&console[_0x524586(0x148)](_0x524586(0x128)+_0x51c258));const _0x1bf7d6=await withSpinner(_0x524586(0x13c)+_0x51c258+'\x27...',()=>_0x2a4a16['segment'][_0x524586(0x12f)](_0x51c258),{'verbose':_0x5442e8[_0x524586(0x125)]}),_0x8d134b=_0x1bf7d6[_0x524586(0x13a)];_0x5442e8[_0x524586(0x125)]&&console['error'](_0x524586(0x129)+_0x8d134b[_0x524586(0x13e)]);if(_0x8d134b['type']!=='segment')return console['error'](_0x524586(0x136)+_0x8d134b['type']+_0x524586(0x12c)),console[_0x524586(0x148)]('Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]'),0x1;if(!_0x8d134b['segmentId'])throw new SDKError(ErrorCode['INTERNAL'],_0x524586(0x149));const _0x1a0e44=_0x8d134b[_0x524586(0x132)],_0x1d6a61=_0x8d134b[_0x524586(0x127)];_0x5442e8[_0x524586(0x125)]&&(console[_0x524586(0x148)](_0x524586(0x126)+_0x1a0e44),console[_0x524586(0x148)](_0x524586(0x145)+_0x1d6a61));let _0x5821a2;if(_0x5442e8[_0x524586(0x141)]){const _0x1bbc2f=_0x5442e8['folder'],_0x5544de=await withSpinner(_0x524586(0x12a)+_0x1bbc2f+_0x524586(0x13f),()=>_0x2a4a16[_0x524586(0x130)][_0x524586(0x12e)](_0x1a0e44,_0x1bbc2f),{'verbose':_0x5442e8[_0x524586(0x125)]});_0x5821a2=parseInt(_0x5544de[_0x524586(0x13a)],0xa),_0x5442e8[_0x524586(0x125)]&&console['error']('Resolved\x20folder\x20ID:\x20'+_0x5821a2);}const _0x44d687=await loadJSONFromOptions(_0x5442e8['rule'],_0x5442e8['ruleFile']),_0x9ab6bc={'name':_0x5442e8[_0x524586(0x146)],'description':_0x5442e8[_0x524586(0x12d)],'rule':_0x44d687,'kind':_0x5442e8[_0x524586(0x12b)]!==undefined?parseInt(_0x5442e8[_0x524586(0x12b)],0xa):undefined,'segmentFolderId':_0x5821a2},_0x15ff68=await withSpinner(_0x524586(0x133)+_0x8d134b[_0x524586(0x137)]+_0x524586(0x13f),()=>_0x2a4a16[_0x524586(0x130)][_0x524586(0x144)](_0x1a0e44,_0x1d6a61,_0x9ab6bc),{'verbose':_0x5442e8['verbose']}),_0x177e5e=_0x15ff68[_0x524586(0x13a)];return console[_0x524586(0x148)](_0x524586(0x131)+_0x177e5e[_0x524586(0x146)]+'\x27'),_0x51c258!==_0x9ddcf9&&console['error'](_0x524586(0x139)+_0x51c258),await handleSDKOutput([_0x177e5e],_0x5442e8),0x0;}}
@@ -1 +1 @@
1
- const a37_0x406f77=a37_0x5d92;(function(_0x5c200f,_0x552357){const _0x51a337=a37_0x5d92,_0x3bbd04=_0x5c200f();while(!![]){try{const _0x43042d=-parseInt(_0x51a337(0x204))/0x1+parseInt(_0x51a337(0x1f2))/0x2+parseInt(_0x51a337(0x1e1))/0x3+parseInt(_0x51a337(0x1ea))/0x4+parseInt(_0x51a337(0x1f0))/0x5*(-parseInt(_0x51a337(0x20e))/0x6)+-parseInt(_0x51a337(0x1f7))/0x7+parseInt(_0x51a337(0x1f3))/0x8*(parseInt(_0x51a337(0x1f5))/0x9);if(_0x43042d===_0x552357)break;else _0x3bbd04['push'](_0x3bbd04['shift']());}catch(_0xa5b033){_0x3bbd04['push'](_0x3bbd04['shift']());}}}(a37_0x1bfe,0x33c4b));import{existsSync,statSync}from'fs';import a37_0x54f5e3 from'chalk';import{BaseCommand}from'./command.js';function a37_0x1bfe(){const _0x10e21e=['execute','folderPath','Folder\x20ID:\x20','1585bpBcUC','split','329028ZRCgDm','8VUDRCV','Set\x20current\x20segment/folder\x20context\x20for\x20navigation','4406121YYxfaR','Resolved\x20path\x20type:\x20','2500876kxQPhb','parent_segment','segment:use','folderId','red','parentId','green','✔\x20Context\x20cleared.\x20Back\x20to\x20root.','cyan','join','isDirectory','type','error','25382xlBaFw','Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.','log','fullPath','verbose','segment','Examples:','✔\x20Context\x20set\x20to:\x20','Usage:\x20tdx\x20segment\x20use\x20<path>','\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent','5520yLrEWF','parentName','Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>','Parent\x20ID:\x20','name','description','dim','620727JcIWck','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22','site','Resolving\x20path\x20\x27','length','Use\x20\x22tdx\x20use\x22\x20to\x20see\x20all\x20context\x20parameters','\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context','Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.','session','101364LXVtwV','Site:\x20','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure'];a37_0x1bfe=function(){return _0x10e21e;};return a37_0x1bfe();}import{saveSessionContext}from'../core/session.js';function a37_0x5d92(_0x2bf434,_0x1d5860){_0x2bf434=_0x2bf434-0x1e0;const _0x1bfe18=a37_0x1bfe();let _0x5d921a=_0x1bfe18[_0x2bf434];return _0x5d921a;}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{[a37_0x406f77(0x212)]=a37_0x406f77(0x1f9);[a37_0x406f77(0x213)]=a37_0x406f77(0x1f4);async[a37_0x406f77(0x1ed)](_0x4e21bb){const _0x16ece7=a37_0x406f77,{options:_0x184448,args:_0x5c3550,tdx:_0x267702}=_0x4e21bb;if(_0x5c3550[_0x16ece7(0x1e5)]===0x0)return console[_0x16ece7(0x203)](a37_0x54f5e3[_0x16ece7(0x1fb)]('Error:\x20Path\x20is\x20required\x0a')),console[_0x16ece7(0x203)](_0x16ece7(0x20c)),console['error'](_0x16ece7(0x20a)),console[_0x16ece7(0x203)](_0x16ece7(0x1e2)),console[_0x16ece7(0x203)]('\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22'),console[_0x16ece7(0x203)](_0x16ece7(0x1e7)),console[_0x16ece7(0x203)](_0x16ece7(0x20d)),0x1;const _0x339698=_0x5c3550[0x0],_0x226036=_0x184448[_0x16ece7(0x1e9)];try{if(_0x339698==='/')return saveSessionContext({'segment_path':undefined},_0x226036),console[_0x16ece7(0x206)](a37_0x54f5e3['green'](_0x16ece7(0x1fe))),0x0;if(existsSync(_0x339698)&&statSync(_0x339698)[_0x16ece7(0x201)]()){let _0x57b880;try{_0x57b880=findTdxConfig(_0x339698);}catch{return console[_0x16ece7(0x203)](a37_0x54f5e3[_0x16ece7(0x1fb)]('Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20'+_0x339698)),console[_0x16ece7(0x203)](a37_0x54f5e3[_0x16ece7(0x1ff)](_0x16ece7(0x1ec))),0x1;}const _0x188f94=_0x57b880['config'][_0x16ece7(0x1f8)];return saveSessionContext({'segment_path':_0x188f94,'parent_segment':_0x188f94},_0x226036),console[_0x16ece7(0x206)](a37_0x54f5e3[_0x16ece7(0x1fd)]('✔\x20Context\x20set\x20to:\x20'+a37_0x54f5e3['cyan'](_0x188f94))),0x0;}const _0x168b33=_0x184448['segmentPath'];let _0x2fb2f5=_0x339698;const _0x680cea=parsePath(_0x339698);if(!_0x680cea['isAbsolute']){if(!_0x168b33)return console[_0x16ece7(0x203)](a37_0x54f5e3['red']('Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.')),console[_0x16ece7(0x203)](a37_0x54f5e3[_0x16ece7(0x1ff)](_0x16ece7(0x210))),0x1;if(_0x339698==='..'){const _0x2967e1=_0x168b33[_0x16ece7(0x1f1)]('/')['slice'](0x0,-0x1)[_0x16ece7(0x200)]('/');_0x2fb2f5=_0x2967e1||'/';}else _0x339698==='.'?_0x2fb2f5=_0x168b33:_0x2fb2f5=_0x168b33+'/'+_0x339698;_0x184448[_0x16ece7(0x208)]&&console['error']('Resolved\x20relative\x20path\x20to:\x20'+_0x2fb2f5);}if(_0x2fb2f5==='/'||_0x2fb2f5==='')return saveSessionContext({'segment_path':undefined},_0x226036),console[_0x16ece7(0x206)](a37_0x54f5e3[_0x16ece7(0x1fd)](_0x16ece7(0x1fe))),0x0;_0x2fb2f5=normalizePath(_0x2fb2f5);const _0x5304bf=parsePath(_0x2fb2f5)['segments'];if(_0x5304bf[_0x16ece7(0x1e5)]===0x0)return saveSessionContext({'segment_path':undefined},_0x226036),console[_0x16ece7(0x206)](a37_0x54f5e3[_0x16ece7(0x1fd)](_0x16ece7(0x1fe))),0x0;_0x184448[_0x16ece7(0x208)]&&(console[_0x16ece7(0x203)](_0x16ece7(0x1eb)+_0x184448[_0x16ece7(0x1e3)]),console[_0x16ece7(0x203)]('Target\x20path:\x20'+_0x2fb2f5));const _0x108854=await withSpinner(_0x16ece7(0x1e4)+_0x2fb2f5+'\x27...',()=>_0x267702[_0x16ece7(0x209)]['resolvePathToResource'](_0x2fb2f5),{'verbose':_0x184448[_0x16ece7(0x208)]}),_0x891f79=_0x108854['data'];_0x184448[_0x16ece7(0x208)]&&(console[_0x16ece7(0x203)](_0x16ece7(0x1f6)+_0x891f79[_0x16ece7(0x202)]),console[_0x16ece7(0x203)](_0x16ece7(0x211)+_0x891f79[_0x16ece7(0x1fc)]),_0x891f79[_0x16ece7(0x1fa)]&&console[_0x16ece7(0x203)](_0x16ece7(0x1ef)+_0x891f79['folderId']));if(_0x891f79[_0x16ece7(0x202)]==='segment')return console[_0x16ece7(0x203)](a37_0x54f5e3[_0x16ece7(0x1fb)](_0x16ece7(0x205))),console[_0x16ece7(0x203)](_0x16ece7(0x1e8)),console[_0x16ece7(0x203)](a37_0x54f5e3[_0x16ece7(0x1ff)]('Use:\x20tdx\x20segment\x20use\x20'+_0x891f79[_0x16ece7(0x20f)]+(_0x891f79[_0x16ece7(0x1ee)]?'/'+_0x891f79[_0x16ece7(0x1ee)][_0x16ece7(0x200)]('/'):''))),0x1;return saveSessionContext({'segment_path':_0x891f79[_0x16ece7(0x207)],'parent_segment':_0x891f79['parentName']},_0x226036),console[_0x16ece7(0x206)](a37_0x54f5e3[_0x16ece7(0x1fd)](_0x16ece7(0x20b)+a37_0x54f5e3[_0x16ece7(0x1ff)](_0x891f79['fullPath']))),_0x184448[_0x16ece7(0x208)]&&(console['error'](a37_0x54f5e3[_0x16ece7(0x1e0)]('Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context')),console[_0x16ece7(0x203)](a37_0x54f5e3[_0x16ece7(0x1e0)](_0x16ece7(0x1e6)))),0x0;}catch(_0x53ad5a){throw _0x53ad5a;}}}
1
+ const a40_0x21624c=a40_0x5681;(function(_0x513755,_0x288509){const _0x498687=a40_0x5681,_0x11dbc5=_0x513755();while(!![]){try{const _0x1492b1=-parseInt(_0x498687(0xa0))/0x1+parseInt(_0x498687(0x9c))/0x2+-parseInt(_0x498687(0xa4))/0x3+parseInt(_0x498687(0x90))/0x4*(parseInt(_0x498687(0xb4))/0x5)+parseInt(_0x498687(0x9e))/0x6*(-parseInt(_0x498687(0x83))/0x7)+-parseInt(_0x498687(0x98))/0x8*(-parseInt(_0x498687(0x87))/0x9)+parseInt(_0x498687(0x89))/0xa*(parseInt(_0x498687(0xa6))/0xb);if(_0x1492b1===_0x288509)break;else _0x11dbc5['push'](_0x11dbc5['shift']());}catch(_0x5f59b9){_0x11dbc5['push'](_0x11dbc5['shift']());}}}(a40_0x1191,0x8cf27));import{existsSync,statSync}from'fs';import a40_0x2bd740 from'chalk';import{BaseCommand}from'./command.js';import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';function a40_0x5681(_0xa54126,_0x58b778){_0xa54126=_0xa54126-0x80;const _0x11916e=a40_0x1191();let _0x5681c9=_0x11916e[_0xa54126];return _0x5681c9;}import{parsePath,normalizePath}from'../sdk/segment/segment-path-parser.js';import{findTdxConfig}from'../sdk/segment/tdx-config.js';function a40_0x1191(){const _0x3f7937=['verbose','66ZPTSYH','log','parentName','session','green','Usage:\x20tdx\x20segment\x20use\x20<path>','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22','parent_segment','\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent','Use:\x20tdx\x20segment\x20use\x20','Use\x20\x22tdx\x20use\x22\x20to\x20see\x20all\x20context\x20parameters','error','✔\x20Context\x20cleared.\x20Back\x20to\x20root.','site','405sLelbU','✔\x20Context\x20set\x20to:\x20','type','Error:\x20Path\x20is\x20required\x0a','Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.','Resolving\x20path\x20\x27','isAbsolute','Set\x20current\x20segment/folder\x20context\x20for\x20navigation','cyan','21ryTtxF','isDirectory','Resolved\x20path\x20type:\x20','red','90esBwBo','segment','538790PxqruV','Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context','length','\x27...','segmentPath','resolvePathToResource','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','5148ZWNZGd','dim','Resolved\x20relative\x20path\x20to:\x20','Site:\x20','Target\x20path:\x20','slice','folderId','Folder\x20ID:\x20','840544sUTfQR','Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.','Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.','data','1226846XgaVRR','\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context','919668WAVGUm','Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>','498850gkpNlv','config','segment:use','fullPath','1666863oqShqJ'];a40_0x1191=function(){return _0x3f7937;};return a40_0x1191();}export class SegmentUseCommand extends BaseCommand{['name']=a40_0x21624c(0xa2);['description']=a40_0x21624c(0x81);async['execute'](_0x294c4d){const _0xada91b=a40_0x21624c,{options:_0x39cec6,args:_0x23c2bb,tdx:_0x33f60a}=_0x294c4d;if(_0x23c2bb['length']===0x0)return console[_0xada91b(0xb1)](a40_0x2bd740['red'](_0xada91b(0xb7))),console[_0xada91b(0xb1)](_0xada91b(0xab)),console['error']('Examples:'),console['error']('\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22'),console[_0xada91b(0xb1)](_0xada91b(0xac)),console[_0xada91b(0xb1)](_0xada91b(0x9d)),console['error'](_0xada91b(0xae)),0x1;const _0x695c49=_0x23c2bb[0x0],_0x3bd096=_0x39cec6[_0xada91b(0xa9)];try{if(_0x695c49==='/')return saveSessionContext({'segment_path':undefined},_0x3bd096),console[_0xada91b(0xa7)](a40_0x2bd740[_0xada91b(0xaa)](_0xada91b(0xb2))),0x0;if(existsSync(_0x695c49)&&statSync(_0x695c49)[_0xada91b(0x84)]()){let _0x4f1430;try{_0x4f1430=findTdxConfig(_0x695c49);}catch{return console[_0xada91b(0xb1)](a40_0x2bd740[_0xada91b(0x86)]('Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20'+_0x695c49)),console['error'](a40_0x2bd740[_0xada91b(0x82)](_0xada91b(0x8f))),0x1;}const _0x5a068d=_0x4f1430[_0xada91b(0xa1)][_0xada91b(0xad)];return saveSessionContext({'segment_path':_0x5a068d,'parent_segment':_0x5a068d},_0x3bd096),console[_0xada91b(0xa7)](a40_0x2bd740[_0xada91b(0xaa)](_0xada91b(0xb5)+a40_0x2bd740[_0xada91b(0x82)](_0x5a068d))),0x0;}const _0x1ce57c=_0x39cec6[_0xada91b(0x8d)];let _0x1f3a9f=_0x695c49;const _0x7f2b96=parsePath(_0x695c49);if(!_0x7f2b96[_0xada91b(0x80)]){if(!_0x1ce57c)return console[_0xada91b(0xb1)](a40_0x2bd740[_0xada91b(0x86)](_0xada91b(0x9a))),console[_0xada91b(0xb1)](a40_0x2bd740[_0xada91b(0x82)](_0xada91b(0x9f))),0x1;if(_0x695c49==='..'){const _0x4b60be=_0x1ce57c['split']('/')[_0xada91b(0x95)](0x0,-0x1)['join']('/');_0x1f3a9f=_0x4b60be||'/';}else _0x695c49==='.'?_0x1f3a9f=_0x1ce57c:_0x1f3a9f=_0x1ce57c+'/'+_0x695c49;_0x39cec6[_0xada91b(0xa5)]&&console['error'](_0xada91b(0x92)+_0x1f3a9f);}if(_0x1f3a9f==='/'||_0x1f3a9f==='')return saveSessionContext({'segment_path':undefined},_0x3bd096),console['log'](a40_0x2bd740[_0xada91b(0xaa)](_0xada91b(0xb2))),0x0;_0x1f3a9f=normalizePath(_0x1f3a9f);const _0x1f20eb=parsePath(_0x1f3a9f)['segments'];if(_0x1f20eb[_0xada91b(0x8b)]===0x0)return saveSessionContext({'segment_path':undefined},_0x3bd096),console['log'](a40_0x2bd740[_0xada91b(0xaa)]('✔\x20Context\x20cleared.\x20Back\x20to\x20root.')),0x0;_0x39cec6[_0xada91b(0xa5)]&&(console['error'](_0xada91b(0x93)+_0x39cec6[_0xada91b(0xb3)]),console['error'](_0xada91b(0x94)+_0x1f3a9f));const _0x152720=await withSpinner(_0xada91b(0xb9)+_0x1f3a9f+_0xada91b(0x8c),()=>_0x33f60a[_0xada91b(0x88)][_0xada91b(0x8e)](_0x1f3a9f),{'verbose':_0x39cec6[_0xada91b(0xa5)]}),_0x41cdc2=_0x152720[_0xada91b(0x9b)];_0x39cec6[_0xada91b(0xa5)]&&(console[_0xada91b(0xb1)](_0xada91b(0x85)+_0x41cdc2[_0xada91b(0xb6)]),console[_0xada91b(0xb1)]('Parent\x20ID:\x20'+_0x41cdc2['parentId']),_0x41cdc2[_0xada91b(0x96)]&&console[_0xada91b(0xb1)](_0xada91b(0x97)+_0x41cdc2[_0xada91b(0x96)]));if(_0x41cdc2[_0xada91b(0xb6)]==='segment')return console[_0xada91b(0xb1)](a40_0x2bd740[_0xada91b(0x86)](_0xada91b(0x99))),console[_0xada91b(0xb1)](_0xada91b(0xb8)),console[_0xada91b(0xb1)](a40_0x2bd740[_0xada91b(0x82)](_0xada91b(0xaf)+_0x41cdc2[_0xada91b(0xa8)]+(_0x41cdc2['folderPath']?'/'+_0x41cdc2['folderPath']['join']('/'):''))),0x1;return saveSessionContext({'segment_path':_0x41cdc2[_0xada91b(0xa3)],'parent_segment':_0x41cdc2['parentName']},_0x3bd096),console['log'](a40_0x2bd740[_0xada91b(0xaa)](_0xada91b(0xb5)+a40_0x2bd740[_0xada91b(0x82)](_0x41cdc2[_0xada91b(0xa3)]))),_0x39cec6['verbose']&&(console[_0xada91b(0xb1)](a40_0x2bd740[_0xada91b(0x91)](_0xada91b(0x8a))),console[_0xada91b(0xb1)](a40_0x2bd740[_0xada91b(0x91)](_0xada91b(0xb0)))),0x0;}catch(_0x12ad1e){throw _0x12ad1e;}}}
@@ -1 +1 @@
1
- function a38_0x4eb8(_0x57665e,_0x1de2ff){_0x57665e=_0x57665e-0x186;const _0x1ad7ed=a38_0x1ad7();let _0x4eb8d0=_0x1ad7ed[_0x57665e];return _0x4eb8d0;}const a38_0x48c7c4=a38_0x4eb8;(function(_0x380f65,_0x257ad5){const _0x14c4ac=a38_0x4eb8,_0x3ad840=_0x380f65();while(!![]){try{const _0x3ec582=-parseInt(_0x14c4ac(0x1ab))/0x1+parseInt(_0x14c4ac(0x19e))/0x2+-parseInt(_0x14c4ac(0x199))/0x3*(parseInt(_0x14c4ac(0x197))/0x4)+-parseInt(_0x14c4ac(0x18d))/0x5+parseInt(_0x14c4ac(0x1aa))/0x6+-parseInt(_0x14c4ac(0x1b2))/0x7*(parseInt(_0x14c4ac(0x18e))/0x8)+-parseInt(_0x14c4ac(0x1a8))/0x9*(-parseInt(_0x14c4ac(0x192))/0xa);if(_0x3ec582===_0x257ad5)break;else _0x3ad840['push'](_0x3ad840['shift']());}catch(_0x50b1b3){_0x3ad840['push'](_0x3ad840['shift']());}}}(a38_0x1ad7,0xd3e2e));import{BaseCommand}from'./command.js';function a38_0x1ad7(){const _0x1bd78e=['5580234VEPSFN','1270411oldwHH','\x20valid','yellow','green','endsWith','description','segment:validate','78379olOYrq','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','length','name','\x20file(s)\x20valid','dim','Error:\x20Directory\x20not\x20found:\x20','\x20warning(s)\x20found','.yaml','hasErrors','\x20error(s)','errors','log','verbose','type','validCount','.yml','message','5640855qiCLuY','1168aSCjIU','Validate\x20segment\x20and\x20journey\x20YAML\x20files','errorCode','red','10xjMHgu','warningCount','file','no_parent','helpText','11008HEglmd','execute','786bTRCpZ','\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','warnings','filePath','parentSegment','2816004otTfpi','✔\x20All\x20','):\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file','error','cyan','\x20file(s)\x20with\x20errors,\x20','Error:\x20','Validation\x20failed:\x20','cwd','29557917JqXGYJ','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20'];a38_0x1ad7=function(){return _0x1bd78e;};return a38_0x1ad7();}import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';import a38_0x359872 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{[a38_0x48c7c4(0x1b6)]=a38_0x48c7c4(0x1b1);[a38_0x48c7c4(0x1b0)]=a38_0x48c7c4(0x18f);async[a38_0x48c7c4(0x198)](_0x330971){const _0x25e171=a38_0x48c7c4,{options:_0x18654a,args:_0x39ea0a}=_0x330971,_0x240fc8=_0x18654a,_0x112f9d=await resolveTarget({'arg':_0x39ea0a[0x0],'contextParent':_0x18654a[_0x25e171(0x19d)],'cwd':process[_0x25e171(0x1a7)]()});if(!isSuccessfulResolution(_0x112f9d))return _0x112f9d[_0x25e171(0x190)]===_0x25e171(0x195)?(console['error'](a38_0x359872['yellow'](_0x25e171(0x1b3))),console[_0x25e171(0x1a2)]('Usage:\x20tdx\x20sg\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)'),console[_0x25e171(0x1a2)](_0x25e171(0x19a)),console[_0x25e171(0x1a2)](_0x25e171(0x1a1))):(console['error'](a38_0x359872['red'](_0x25e171(0x1a5)+_0x112f9d[_0x25e171(0x18c)]+'\x0a')),_0x112f9d[_0x25e171(0x196)]&&console[_0x25e171(0x1a2)](a38_0x359872[_0x25e171(0x1a3)](_0x112f9d[_0x25e171(0x196)]))),0x1;const _0x207c3a=_0x112f9d['targetDir'],_0x299c2a=_0x112f9d[_0x25e171(0x189)]===_0x25e171(0x194)?_0x112f9d[_0x25e171(0x19c)]:undefined;if(!_0x299c2a&&!existsSync(_0x207c3a))return console[_0x25e171(0x1a2)](a38_0x359872[_0x25e171(0x191)](_0x25e171(0x1b9)+_0x207c3a+'\x0a')),0x1;let _0x57808b;if(_0x299c2a){if(!_0x299c2a['endsWith'](_0x25e171(0x18b))&&!_0x299c2a[_0x25e171(0x1af)](_0x25e171(0x1bb)))return console[_0x25e171(0x1a2)](a38_0x359872[_0x25e171(0x191)](_0x25e171(0x1a9)+_0x299c2a+'\x0a')),0x1;_0x57808b=[_0x299c2a];}else _0x57808b=findYamlFiles(_0x207c3a);if(_0x57808b[_0x25e171(0x1b5)]===0x0)return console[_0x25e171(0x1a2)](a38_0x359872[_0x25e171(0x191)](_0x25e171(0x1b4)+_0x207c3a+'\x0a')),0x1;const _0x270039=validateYamlFiles(_0x57808b,_0x207c3a),_0xa6b56f=calculateSummary(_0x270039);for(const _0x2784d5 of _0x270039){if(!isValidationResult(_0x2784d5))continue;const {relativePath:_0x47b3ae,source:_0x9967a3,result:_0x26eb4f,fileType:_0x3343e5}=_0x2784d5,_0x91154=_0x3343e5;if(_0x26eb4f['valid']&&_0x26eb4f[_0x25e171(0x19b)][_0x25e171(0x1b5)]===0x0)_0x240fc8[_0x25e171(0x188)]&&console['log'](a38_0x359872[_0x25e171(0x1ae)]('✔\x20'+_0x47b3ae)+a38_0x359872['dim']('\x20('+_0x91154+')'));else _0x26eb4f['valid']?(console['log'](a38_0x359872[_0x25e171(0x1ad)]('⚠\x20'+_0x47b3ae)+a38_0x359872['dim']('\x20('+_0x91154+_0x25e171(0x1a0)+_0x26eb4f[_0x25e171(0x19b)][_0x25e171(0x1b5)]+'\x20warning(s)')),console[_0x25e171(0x187)](formatValidationResult(_0x26eb4f,_0x9967a3,_0x47b3ae))):(console[_0x25e171(0x187)](a38_0x359872[_0x25e171(0x191)]('✖\x20'+_0x47b3ae)+a38_0x359872[_0x25e171(0x1b8)]('\x20('+_0x91154+_0x25e171(0x1a0)+_0x26eb4f[_0x25e171(0x186)]['length']+_0x25e171(0x1bd))),console['log'](formatValidationResult(_0x26eb4f,_0x9967a3,_0x47b3ae)));}return console[_0x25e171(0x187)](''),_0xa6b56f[_0x25e171(0x1bc)]?(console[_0x25e171(0x187)](a38_0x359872[_0x25e171(0x191)](_0x25e171(0x1a6)+_0xa6b56f['invalidCount']+_0x25e171(0x1a4)+_0xa6b56f[_0x25e171(0x18a)]+_0x25e171(0x1ac))),_0xa6b56f[_0x25e171(0x193)]>0x0&&console[_0x25e171(0x187)](a38_0x359872[_0x25e171(0x1ad)](_0xa6b56f[_0x25e171(0x193)]+_0x25e171(0x1ba))),0x1):(console[_0x25e171(0x187)](a38_0x359872['green'](_0x25e171(0x19f)+_0xa6b56f[_0x25e171(0x18a)]+_0x25e171(0x1b7))),_0xa6b56f[_0x25e171(0x193)]>0x0&&console['log'](a38_0x359872[_0x25e171(0x1ad)](_0xa6b56f[_0x25e171(0x193)]+_0x25e171(0x1ba))),0x0);}}
1
+ const a41_0x3160fe=a41_0x4f37;(function(_0x4b59dc,_0x38337d){const _0x1fabc=a41_0x4f37,_0x17345f=_0x4b59dc();while(!![]){try{const _0x5bcfad=parseInt(_0x1fabc(0x191))/0x1*(parseInt(_0x1fabc(0x1c1))/0x2)+parseInt(_0x1fabc(0x1aa))/0x3*(parseInt(_0x1fabc(0x19f))/0x4)+parseInt(_0x1fabc(0x1bc))/0x5*(-parseInt(_0x1fabc(0x1b9))/0x6)+-parseInt(_0x1fabc(0x1ac))/0x7+-parseInt(_0x1fabc(0x1af))/0x8+parseInt(_0x1fabc(0x1a1))/0x9*(-parseInt(_0x1fabc(0x194))/0xa)+parseInt(_0x1fabc(0x1ae))/0xb;if(_0x5bcfad===_0x38337d)break;else _0x17345f['push'](_0x17345f['shift']());}catch(_0x2a8c3d){_0x17345f['push'](_0x17345f['shift']());}}}(a41_0x21b3,0x7341b));import{BaseCommand}from'./command.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';function a41_0x4f37(_0x187f4a,_0x204a15){_0x187f4a=_0x187f4a-0x190;const _0x21b3ae=a41_0x21b3();let _0x4f37fd=_0x21b3ae[_0x187f4a];return _0x4f37fd;}import{existsSync}from'fs';import a41_0x3aa6b3 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{[a41_0x3160fe(0x1a6)]='segment:validate';[a41_0x3160fe(0x1b6)]=a41_0x3160fe(0x193);async[a41_0x3160fe(0x195)](_0x244a2f){const _0x3c2106=a41_0x3160fe,{options:_0x591c27,args:_0xfcd7ae}=_0x244a2f,_0x19f3fe=_0x591c27,_0x3f35b5=await resolveTarget({'arg':_0xfcd7ae[0x0],'contextParent':_0x591c27[_0x3c2106(0x19d)],'cwd':process[_0x3c2106(0x19a)]()});if(!isSuccessfulResolution(_0x3f35b5))return _0x3f35b5['errorCode']===_0x3c2106(0x1a8)?(console[_0x3c2106(0x1b7)](a41_0x3aa6b3[_0x3c2106(0x19c)](_0x3c2106(0x1a2))),console['error'](_0x3c2106(0x1c0)),console[_0x3c2106(0x1b7)](_0x3c2106(0x19b)),console[_0x3c2106(0x1b7)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file')):(console[_0x3c2106(0x1b7)](a41_0x3aa6b3[_0x3c2106(0x1bd)](_0x3c2106(0x199)+_0x3f35b5['message']+'\x0a')),_0x3f35b5[_0x3c2106(0x198)]&&console['error'](a41_0x3aa6b3[_0x3c2106(0x197)](_0x3f35b5[_0x3c2106(0x198)]))),0x1;const _0x2715c7=_0x3f35b5[_0x3c2106(0x190)],_0x8c2956=_0x3f35b5[_0x3c2106(0x1a0)]===_0x3c2106(0x192)?_0x3f35b5['filePath']:undefined;if(!_0x8c2956&&!existsSync(_0x2715c7))return console['error'](a41_0x3aa6b3['red'](_0x3c2106(0x1a9)+_0x2715c7+'\x0a')),0x1;let _0x3a429e;if(_0x8c2956){if(!_0x8c2956[_0x3c2106(0x1b3)]('.yml')&&!_0x8c2956[_0x3c2106(0x1b3)](_0x3c2106(0x196)))return console[_0x3c2106(0x1b7)](a41_0x3aa6b3[_0x3c2106(0x1bd)]('Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20'+_0x8c2956+'\x0a')),0x1;_0x3a429e=[_0x8c2956];}else _0x3a429e=findYamlFiles(_0x2715c7);if(_0x3a429e['length']===0x0)return console[_0x3c2106(0x1b7)](a41_0x3aa6b3[_0x3c2106(0x1bd)]('Error:\x20No\x20YAML\x20files\x20found\x20in\x20'+_0x2715c7+'\x0a')),0x1;const _0x56ebaf=validateYamlFiles(_0x3a429e,_0x2715c7),_0x403747=calculateSummary(_0x56ebaf);for(const _0x5ec5cb of _0x56ebaf){if(!isValidationResult(_0x5ec5cb))continue;const {relativePath:_0x1ad3d3,source:_0x4162a6,result:_0x19e194,fileType:_0x345b4e}=_0x5ec5cb,_0x242669=_0x345b4e;if(_0x19e194[_0x3c2106(0x19e)]&&_0x19e194[_0x3c2106(0x1b0)][_0x3c2106(0x1ad)]===0x0)_0x19f3fe[_0x3c2106(0x1be)]&&console[_0x3c2106(0x1a4)](a41_0x3aa6b3[_0x3c2106(0x1b2)]('✔\x20'+_0x1ad3d3)+a41_0x3aa6b3[_0x3c2106(0x1ab)]('\x20('+_0x242669+')'));else _0x19e194['valid']?(console[_0x3c2106(0x1a4)](a41_0x3aa6b3[_0x3c2106(0x19c)]('⚠\x20'+_0x1ad3d3)+a41_0x3aa6b3[_0x3c2106(0x1ab)]('\x20('+_0x242669+_0x3c2106(0x1bf)+_0x19e194[_0x3c2106(0x1b0)][_0x3c2106(0x1ad)]+_0x3c2106(0x1b1))),console[_0x3c2106(0x1a4)](formatValidationResult(_0x19e194,_0x4162a6,_0x1ad3d3))):(console[_0x3c2106(0x1a4)](a41_0x3aa6b3[_0x3c2106(0x1bd)]('✖\x20'+_0x1ad3d3)+a41_0x3aa6b3[_0x3c2106(0x1ab)]('\x20('+_0x242669+_0x3c2106(0x1bf)+_0x19e194[_0x3c2106(0x1a5)][_0x3c2106(0x1ad)]+_0x3c2106(0x1ba))),console['log'](formatValidationResult(_0x19e194,_0x4162a6,_0x1ad3d3)));}return console[_0x3c2106(0x1a4)](''),_0x403747['hasErrors']?(console['log'](a41_0x3aa6b3[_0x3c2106(0x1bd)]('Validation\x20failed:\x20'+_0x403747['invalidCount']+_0x3c2106(0x1b8)+_0x403747[_0x3c2106(0x1a7)]+_0x3c2106(0x1b5))),_0x403747[_0x3c2106(0x1bb)]>0x0&&console[_0x3c2106(0x1a4)](a41_0x3aa6b3[_0x3c2106(0x19c)](_0x403747[_0x3c2106(0x1bb)]+'\x20warning(s)\x20found')),0x1):(console['log'](a41_0x3aa6b3['green']('✔\x20All\x20'+_0x403747['validCount']+_0x3c2106(0x1a3))),_0x403747[_0x3c2106(0x1bb)]>0x0&&console['log'](a41_0x3aa6b3[_0x3c2106(0x19c)](_0x403747[_0x3c2106(0x1bb)]+_0x3c2106(0x1b4))),0x0);}}function a41_0x21b3(){const _0x1fdadf=['targetDir','47569DKeOSr','file','Validate\x20segment\x20and\x20journey\x20YAML\x20files','1045340dRBVvm','execute','.yaml','cyan','helpText','Error:\x20','cwd','\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','yellow','parentSegment','valid','69604NiPOKM','type','45PPVsNF','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','\x20file(s)\x20valid','log','errors','name','validCount','no_parent','Error:\x20Directory\x20not\x20found:\x20','15hIdJlF','dim','2819768cbgtNN','length','23799270scrwlQ','1577376XlkWlz','warnings','\x20warning(s)','green','endsWith','\x20warning(s)\x20found','\x20valid','description','error','\x20file(s)\x20with\x20errors,\x20','618PBwUrM','\x20error(s)','warningCount','34145fhhGKB','red','verbose','):\x20','Usage:\x20tdx\x20sg\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)','2OXVHhy'];a41_0x21b3=function(){return _0x1fdadf;};return a41_0x21b3();}
@@ -1 +1 @@
1
- const a39_0xfd3be5=a39_0x543a;(function(_0x125abd,_0x1e68d2){const _0x151595=a39_0x543a,_0x78ee4d=_0x125abd();while(!![]){try{const _0xf0faf1=-parseInt(_0x151595(0x142))/0x1*(-parseInt(_0x151595(0x177))/0x2)+-parseInt(_0x151595(0x134))/0x3+-parseInt(_0x151595(0x14b))/0x4+parseInt(_0x151595(0x16a))/0x5+parseInt(_0x151595(0x143))/0x6*(parseInt(_0x151595(0x140))/0x7)+parseInt(_0x151595(0x151))/0x8+parseInt(_0x151595(0x16b))/0x9;if(_0xf0faf1===_0x1e68d2)break;else _0x78ee4d['push'](_0x78ee4d['shift']());}catch(_0x39f61d){_0x78ee4d['push'](_0x78ee4d['shift']());}}}(a39_0x4c84,0x852ec));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{formatFlatList,formatTree}from'../sdk/util/tree-formatter.js';function a39_0x543a(_0x394706,_0x42f28e){_0x394706=_0x394706-0x134;const _0x4c8405=a39_0x4c84();let _0x543a84=_0x4c8405[_0x394706];return _0x543a84;}import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import a39_0x12c1be from'chalk';function a39_0x4c84(){const _0x46804d=['\x5c$&','308168lBZYmM','No\x20items\x20match\x20pattern:\x20','\x20\x20tdx\x20sg\x20use\x20\x22My\x20Audience\x22','verbose','\x20journey','listRecursive','107832kurVXT','Set\x20a\x20parent\x20segment\x20context\x20first:','resolvePathToResource','Folder\x20ID:\x20','listUnified',',\x20and\x20','Error:\x20No\x20parent\x20segment\x20context\x20set.',']\x20matching\x20\x27','\x20\x20tdx\x20sg\x20pull\x20\x22My\x20Audience\x22','✔\x20Built\x20tree\x20with\x20','parentId','segment','folder','listUnifiedWithJourneys','recursive','\x20segment','Parent\x20ID:\x20','journeyBundleName','includes','(not\x20set)','(empty)','Resolving\x20path\x20\x27','jsonl','journey','Site:\x20','3737280cJvVLi','1929006pHnqVW','maxDepth','children','data','sort','/j/da','Recursive\x20mode:\x20enabled','message','json','✔\x20Found\x20','\x27...','Resolving\x20parent\x20segment\x20\x27','2HCcvJj','length','name','segments','filter','log','cause','\x20\x20Cause:\x20','dim','/app/ps/','Listing\x20folders,\x20segments,\x20and\x20journeys...','parentSegment','Folder/pattern\x20arg:\x20','Error:\x20','site','2550048bxrJfE','error','test','listWithPattern','journeys','map','folderId','List\x20folders\x20and\x20child\x20segments','replace','folders','type','Building\x20hierarchy\x20tree...','39298qAhMin','/e/','295201WdRogt','216rjlhnx','description','localeCompare','\x20folder','\x20matching\x20\x27','format','Parent\x20segment\x20context:\x20'];a39_0x4c84=function(){return _0x46804d;};return a39_0x4c84();}export class SegmentsCommand extends BaseCommand{[a39_0xfd3be5(0x179)]=a39_0xfd3be5(0x17a);[a39_0xfd3be5(0x144)]=a39_0xfd3be5(0x13b);async['execute'](_0x2cdaea){const _0x1ab918=a39_0xfd3be5,{options:_0x1ed788,args:_0x1b05d6}=_0x2cdaea,_0xef1212=_0x1ed788[_0x1ab918(0x15f)],_0x2e3df0=_0x1b05d6[0x0];try{const _0xf8cace=_0x1ed788[_0x1ab918(0x182)];_0x1ed788[_0x1ab918(0x14e)]&&(console[_0x1ab918(0x135)](_0x1ab918(0x169)+_0x1ed788[_0x1ab918(0x185)]),console[_0x1ab918(0x135)](_0x1ab918(0x149)+(_0xf8cace||_0x1ab918(0x164))),_0x2e3df0&&console['error'](_0x1ab918(0x183)+_0x2e3df0),_0xef1212&&console['error'](_0x1ab918(0x171)));if(!_0xf8cace)return console[_0x1ab918(0x135)](_0x1ab918(0x157)),console['error'](''),console[_0x1ab918(0x135)](_0x1ab918(0x152)),console['error'](_0x1ab918(0x159)),console['error'](_0x1ab918(0x14d)),console[_0x1ab918(0x135)](''),console[_0x1ab918(0x135)]('Use\x20tdx\x20ps\x20list\x20to\x20see\x20available\x20parent\x20segments.'),0x1;const _0x1300ab=_0x2e3df0&&(_0x2e3df0[_0x1ab918(0x163)]('*')||_0x2e3df0[_0x1ab918(0x163)]('?'));if(_0x1300ab)return await this[_0x1ab918(0x137)](_0x2cdaea,_0xf8cace,_0x2e3df0);const _0x208bb3=_0x2e3df0?_0xf8cace+'/'+_0x2e3df0:_0xf8cace;return _0xef1212?await this[_0x1ab918(0x150)](_0x2cdaea,_0x208bb3):await this[_0x1ab918(0x155)](_0x2cdaea,_0x208bb3);}catch(_0x1d2642){if(_0x1d2642 instanceof SDKError)return console[_0x1ab918(0x135)](_0x1ab918(0x184)+_0x1d2642[_0x1ab918(0x172)]),_0x1d2642[_0x1ab918(0x17d)]&&console['error'](_0x1ab918(0x17e)+_0x1d2642[_0x1ab918(0x17d)]),0x1;throw _0x1d2642;}}async['listWithPattern'](_0x38f0eb,_0x4ee93f,_0x27c88f){const _0x37e416=a39_0xfd3be5,{options:_0x23c1ca,tdx:_0xf51515}=_0x38f0eb,_0x140e1e=await withSpinner(_0x37e416(0x176)+_0x4ee93f+'\x27...',()=>_0xf51515[_0x37e416(0x15c)]['resolvePathToResource'](_0x4ee93f),{'verbose':_0x23c1ca[_0x37e416(0x14e)]}),_0x29b58f=_0x140e1e[_0x37e416(0x16e)],_0x268ee9=await withSpinner(_0x37e416(0x181),()=>_0xf51515['segment'][_0x37e416(0x15e)](_0x29b58f[_0x37e416(0x15b)],_0x29b58f[_0x37e416(0x13a)]),{'verbose':_0x23c1ca['verbose']}),{folders:_0xa73959,segments:_0xfacc91,journeys:_0x3bf58b}=_0x268ee9[_0x37e416(0x16e)],_0x30af82=_0x27c88f[_0x37e416(0x13c)](/[.+^${}()|[\]\\]/g,_0x37e416(0x14a))[_0x37e416(0x13c)](/\*/g,'.*')[_0x37e416(0x13c)](/\?/g,'.'),_0x5529b1=new RegExp('^'+_0x30af82+'$','i'),_0x49e1f6=_0xa73959[_0x37e416(0x17b)](_0x3b1cde=>_0x5529b1[_0x37e416(0x136)](_0x3b1cde[_0x37e416(0x179)])),_0x2e4a0a=_0xfacc91['filter'](_0x2b18c5=>_0x5529b1[_0x37e416(0x136)](_0x2b18c5[_0x37e416(0x179)])),_0x4d70ed=_0x3bf58b[_0x37e416(0x17b)](_0x1bb4c5=>_0x5529b1['test'](_0x1bb4c5[_0x37e416(0x162)])),_0x4251a4=_0x49e1f6[_0x37e416(0x178)]+_0x2e4a0a[_0x37e416(0x178)]+_0x4d70ed[_0x37e416(0x178)];console['error'](_0x37e416(0x174)+_0x49e1f6[_0x37e416(0x178)]+_0x37e416(0x146)+(_0x49e1f6[_0x37e416(0x178)]!==0x1?'s':'')+',\x20'+_0x2e4a0a[_0x37e416(0x178)]+_0x37e416(0x160)+(_0x2e4a0a[_0x37e416(0x178)]!==0x1?'s':'')+_0x37e416(0x156)+_0x4d70ed[_0x37e416(0x178)]+_0x37e416(0x14f)+(_0x4d70ed[_0x37e416(0x178)]!==0x1?'s':'')+_0x37e416(0x147)+_0x27c88f+'\x27');const _0x57b059=_0x1d5ba7=>{const _0x4554ee=_0x37e416;return getConsoleNextUrl(_0x23c1ca[_0x4554ee(0x185)],_0x4554ee(0x180)+_0x29b58f[_0x4554ee(0x15b)]+_0x4554ee(0x141)+_0x1d5ba7);},_0x4d245f=_0x23c1ca[_0x37e416(0x148)]===_0x37e416(0x173)||_0x23c1ca[_0x37e416(0x148)]===_0x37e416(0x167);if(_0x4d245f){const _0x21022c=[..._0x49e1f6[_0x37e416(0x139)](_0xf10517=>({..._0xf10517,'type':_0x37e416(0x15d)})),..._0x2e4a0a['map'](_0x1a04de=>({..._0x1a04de,'type':_0x37e416(0x15c),'url':_0x57b059(_0x1a04de['id'])})),..._0x4d70ed[_0x37e416(0x139)](_0x5c6ed0=>({..._0x5c6ed0,'name':_0x5c6ed0[_0x37e416(0x162)],'type':_0x37e416(0x168)}))][_0x37e416(0x16f)]((_0x54d6eb,_0xdf279d)=>_0x54d6eb['name']['localeCompare'](_0xdf279d['name']));await handleSDKOutput(_0x21022c,_0x23c1ca);}else{if(_0x4251a4===0x0)console[_0x37e416(0x17c)](_0x37e416(0x14c)+_0x27c88f);else{console[_0x37e416(0x17c)](a39_0x12c1be['dim']('['+_0x4ee93f+_0x37e416(0x158)+_0x27c88f+'\x27'));const _0x53324f=formatFlatList(_0x49e1f6,_0x2e4a0a,{'showMetadata':!![],'getSegmentUrl':_0x57b059},_0x4d70ed);console[_0x37e416(0x17c)](_0x53324f);}}return 0x0;}async['listUnified'](_0x37c9c5,_0x5c7b03){const _0x4a641b=a39_0xfd3be5,{options:_0xb3d833,tdx:_0x3e5385}=_0x37c9c5,_0x461179=await withSpinner(_0x4a641b(0x166)+_0x5c7b03+_0x4a641b(0x175),()=>_0x3e5385['segment'][_0x4a641b(0x153)](_0x5c7b03),{'verbose':_0xb3d833['verbose']}),_0xd00924=_0x461179[_0x4a641b(0x16e)];_0xb3d833['verbose']&&(console['error'](_0x4a641b(0x161)+_0xd00924['parentId']),_0xd00924[_0x4a641b(0x13a)]&&console[_0x4a641b(0x135)]('Folder\x20ID:\x20'+_0xd00924[_0x4a641b(0x13a)]));const _0x3819a6=await withSpinner(_0x4a641b(0x181),()=>_0x3e5385[_0x4a641b(0x15c)][_0x4a641b(0x15e)](_0xd00924[_0x4a641b(0x15b)],_0xd00924['folderId']),{'verbose':_0xb3d833[_0x4a641b(0x14e)]}),{folders:_0x7369cc,segments:_0x324023,journeys:_0x454900}=_0x3819a6[_0x4a641b(0x16e)],_0x296a9a=_0x7369cc[_0x4a641b(0x178)]+_0x324023['length']+_0x454900[_0x4a641b(0x178)];console[_0x4a641b(0x135)]('✔\x20Found\x20'+_0x7369cc[_0x4a641b(0x178)]+_0x4a641b(0x146)+(_0x7369cc[_0x4a641b(0x178)]!==0x1?'s':'')+',\x20'+_0x324023['length']+_0x4a641b(0x160)+(_0x324023['length']!==0x1?'s':'')+_0x4a641b(0x156)+_0x454900[_0x4a641b(0x178)]+'\x20journey'+(_0x454900[_0x4a641b(0x178)]!==0x1?'s':''));const _0x1779c3=_0x4c8c5d=>{const _0x3c75c4=_0x4a641b;return getConsoleNextUrl(_0xb3d833[_0x3c75c4(0x185)],_0x3c75c4(0x180)+_0xd00924[_0x3c75c4(0x15b)]+'/e/'+_0x4c8c5d);},_0x493630=_0x5d4c81=>{const _0x13d04a=_0x4a641b;return getConsoleNextUrl(_0xb3d833[_0x13d04a(0x185)],_0x13d04a(0x180)+_0xd00924[_0x13d04a(0x15b)]+_0x13d04a(0x141)+_0x5d4c81+_0x13d04a(0x170));},_0x2330ae=_0xb3d833[_0x4a641b(0x148)]===_0x4a641b(0x173)||_0xb3d833[_0x4a641b(0x148)]===_0x4a641b(0x167);if(_0x2330ae){const _0x2927b0=[..._0x7369cc['map'](_0x489f48=>({..._0x489f48,'type':'folder'})),..._0x324023[_0x4a641b(0x139)](_0x39ccaf=>({..._0x39ccaf,'type':_0x4a641b(0x15c),'url':_0x1779c3(_0x39ccaf['id'])})),..._0x454900[_0x4a641b(0x139)](_0x1f2479=>({..._0x1f2479,'name':_0x1f2479[_0x4a641b(0x162)],'type':_0x4a641b(0x168),'url':_0x493630(_0x1f2479['id'])}))][_0x4a641b(0x16f)]((_0x32ae86,_0x286695)=>_0x32ae86[_0x4a641b(0x179)][_0x4a641b(0x145)](_0x286695[_0x4a641b(0x179)]));await handleSDKOutput(_0x2927b0,_0xb3d833);}else{if(_0x296a9a===0x0)console['log'](a39_0x12c1be[_0x4a641b(0x17f)]('['+_0x5c7b03+']')),console[_0x4a641b(0x17c)](_0x4a641b(0x165));else{console[_0x4a641b(0x17c)](a39_0x12c1be[_0x4a641b(0x17f)]('['+_0x5c7b03+']'));const _0x3e5a06=formatFlatList(_0x7369cc,_0x324023,{'showMetadata':!![],'getSegmentUrl':_0x1779c3,'getJourneyUrl':_0x493630},_0x454900);console[_0x4a641b(0x17c)](_0x3e5a06);}}return 0x0;}async[a39_0xfd3be5(0x150)](_0x4b3ab9,_0x317c55){const _0x59d5af=a39_0xfd3be5,{options:_0x5dfacc,tdx:_0x58962e}=_0x4b3ab9,_0x5482ae=await withSpinner('Resolving\x20path\x20\x27'+_0x317c55+_0x59d5af(0x175),()=>_0x58962e[_0x59d5af(0x15c)][_0x59d5af(0x153)](_0x317c55),{'verbose':_0x5dfacc[_0x59d5af(0x14e)]}),_0x49f902=_0x5482ae[_0x59d5af(0x16e)];_0x5dfacc[_0x59d5af(0x14e)]&&(console[_0x59d5af(0x135)](_0x59d5af(0x161)+_0x49f902[_0x59d5af(0x15b)]),_0x49f902[_0x59d5af(0x13a)]&&console[_0x59d5af(0x135)](_0x59d5af(0x154)+_0x49f902['folderId']));const _0xfff20b=_0x5dfacc[_0x59d5af(0x16c)]||0xa,_0x4e5ad5=await withSpinner(_0x59d5af(0x13f),()=>_0x58962e['segment'][_0x59d5af(0x150)](_0x49f902['parentId'],_0x49f902[_0x59d5af(0x13a)],0x0,_0xfff20b),{'verbose':_0x5dfacc[_0x59d5af(0x14e)]}),_0x2d764c=_0x4e5ad5[_0x59d5af(0x16e)],_0x46e442=_0x2370b2=>{const _0x21d2bc=_0x59d5af;let _0x56238a=0x0,_0x5a93f2=0x0,_0x51bd5c=0x0;for(const _0x66b0a1 of _0x2370b2){if(_0x66b0a1[_0x21d2bc(0x13e)]===_0x21d2bc(0x15d))_0x56238a++;else{if(_0x66b0a1[_0x21d2bc(0x13e)]===_0x21d2bc(0x15c))_0x5a93f2++;else{if(_0x66b0a1['type']===_0x21d2bc(0x168))_0x51bd5c++;}}if(_0x66b0a1[_0x21d2bc(0x16d)]){const _0x4c1564=_0x46e442(_0x66b0a1['children']);_0x56238a+=_0x4c1564[_0x21d2bc(0x13d)],_0x5a93f2+=_0x4c1564[_0x21d2bc(0x17a)],_0x51bd5c+=_0x4c1564[_0x21d2bc(0x138)];}}return{'folders':_0x56238a,'segments':_0x5a93f2,'journeys':_0x51bd5c};},_0xfce487=_0x46e442(_0x2d764c);console['error'](_0x59d5af(0x15a)+_0xfce487[_0x59d5af(0x13d)]+'\x20folder'+(_0xfce487['folders']!==0x1?'s':'')+',\x20'+_0xfce487[_0x59d5af(0x17a)]+_0x59d5af(0x160)+(_0xfce487[_0x59d5af(0x17a)]!==0x1?'s':'')+_0x59d5af(0x156)+_0xfce487[_0x59d5af(0x138)]+_0x59d5af(0x14f)+(_0xfce487['journeys']!==0x1?'s':''));const _0x4f45fe=_0x138ce0=>{const _0x3b997d=_0x59d5af;return getConsoleNextUrl(_0x5dfacc[_0x3b997d(0x185)],'/app/ps/'+_0x49f902[_0x3b997d(0x15b)]+_0x3b997d(0x141)+_0x138ce0);},_0x1771f6=_0x16914f=>{const _0x16b735=_0x59d5af;return getConsoleNextUrl(_0x5dfacc[_0x16b735(0x185)],'/app/ps/'+_0x49f902[_0x16b735(0x15b)]+_0x16b735(0x141)+_0x16914f+_0x16b735(0x170));};if(_0x5dfacc[_0x59d5af(0x148)]===_0x59d5af(0x173)||_0x5dfacc['format']===_0x59d5af(0x167))await handleSDKOutput(_0x2d764c,_0x5dfacc);else{console[_0x59d5af(0x17c)](a39_0x12c1be['dim']('['+_0x317c55+']'));const _0x4faa66=formatTree(_0x2d764c,{'showMetadata':!![],'getSegmentUrl':_0x4f45fe,'getJourneyUrl':_0x1771f6});console[_0x59d5af(0x17c)](_0x4faa66);}return 0x0;}}
1
+ const a42_0x1f22f1=a42_0x4824;(function(_0xbdc72f,_0x586159){const _0x21cf01=a42_0x4824,_0x138df6=_0xbdc72f();while(!![]){try{const _0x3d1154=parseInt(_0x21cf01(0x127))/0x1*(parseInt(_0x21cf01(0x11a))/0x2)+parseInt(_0x21cf01(0x10d))/0x3*(parseInt(_0x21cf01(0x137))/0x4)+parseInt(_0x21cf01(0x13d))/0x5+-parseInt(_0x21cf01(0x110))/0x6*(-parseInt(_0x21cf01(0x138))/0x7)+parseInt(_0x21cf01(0x139))/0x8+-parseInt(_0x21cf01(0x13e))/0x9+-parseInt(_0x21cf01(0x13b))/0xa*(parseInt(_0x21cf01(0x116))/0xb);if(_0x3d1154===_0x586159)break;else _0x138df6['push'](_0x138df6['shift']());}catch(_0x42ff67){_0x138df6['push'](_0x138df6['shift']());}}}(a42_0x4d31,0x30c8f));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';function a42_0x4d31(){const _0x127136=['3942580MrPWmF',',\x20and\x20','358005ZVohKb','3225600oMnDfI','verbose','(empty)','List\x20folders\x20and\x20child\x20segments','folders','error','\x20journey','name','\x20segment','journeyBundleName','\x27...','data','\x5c$&','Resolving\x20path\x20\x27','\x20matching\x20\x27','cause','maxDepth','listWithPattern','description','Parent\x20ID:\x20','site','replace','parentSegment','listRecursive','/e/','localeCompare','Error:\x20No\x20parent\x20segment\x20context\x20set.','filter','✔\x20Found\x20','24798qqjCAh','segment','Listing\x20folders,\x20segments,\x20and\x20journeys...','6vmtlJW','segments',']\x20matching\x20\x27','\x20\x20Cause:\x20','map','\x20\x20tdx\x20sg\x20pull\x20\x22My\x20Audience\x22','11sHXYAh','folderId','parentId','journey','10576YBrGdP','folder','listUnified','No\x20items\x20match\x20pattern:\x20','Folder/pattern\x20arg:\x20','format','Error:\x20','jsonl','length','includes','type','recursive','children','13azXXBK','\x20folder','listUnifiedWithJourneys','journeys','/app/ps/','resolvePathToResource','Recursive\x20mode:\x20enabled','dim','sort','test','log','json','(not\x20set)','\x20\x20tdx\x20sg\x20use\x20\x22My\x20Audience\x22','Parent\x20segment\x20context:\x20','/j/da','164nWcheT','2687769oDikYv','714104LqJbcJ','Folder\x20ID:\x20'];a42_0x4d31=function(){return _0x127136;};return a42_0x4d31();}import{handleSDKOutput}from'../core/command-output.js';function a42_0x4824(_0x285392,_0x532243){_0x285392=_0x285392-0x10c;const _0x4d3142=a42_0x4d31();let _0x48240e=_0x4d3142[_0x285392];return _0x48240e;}import{withSpinner}from'../utils/spinner.js';import{formatFlatList,formatTree}from'../sdk/util/tree-formatter.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import a42_0x261c25 from'chalk';export class SegmentsCommand extends BaseCommand{[a42_0x1f22f1(0x145)]=a42_0x1f22f1(0x111);[a42_0x1f22f1(0x150)]=a42_0x1f22f1(0x141);async['execute'](_0x4be98a){const _0x51ce12=a42_0x1f22f1,{options:_0x54937f,args:_0x563896}=_0x4be98a,_0x243431=_0x54937f[_0x51ce12(0x125)],_0x5488c6=_0x563896[0x0];try{const _0x26488d=_0x54937f[_0x51ce12(0x154)];_0x54937f[_0x51ce12(0x13f)]&&(console[_0x51ce12(0x143)]('Site:\x20'+_0x54937f[_0x51ce12(0x152)]),console['error'](_0x51ce12(0x135)+(_0x26488d||_0x51ce12(0x133))),_0x5488c6&&console[_0x51ce12(0x143)](_0x51ce12(0x11e)+_0x5488c6),_0x243431&&console[_0x51ce12(0x143)](_0x51ce12(0x12d)));if(!_0x26488d)return console['error'](_0x51ce12(0x158)),console['error'](''),console[_0x51ce12(0x143)]('Set\x20a\x20parent\x20segment\x20context\x20first:'),console['error'](_0x51ce12(0x115)),console['error'](_0x51ce12(0x134)),console['error'](''),console[_0x51ce12(0x143)]('Use\x20tdx\x20ps\x20list\x20to\x20see\x20available\x20parent\x20segments.'),0x1;const _0x1819bd=_0x5488c6&&(_0x5488c6['includes']('*')||_0x5488c6[_0x51ce12(0x123)]('?'));if(_0x1819bd)return await this[_0x51ce12(0x14f)](_0x4be98a,_0x26488d,_0x5488c6);const _0x32fc74=_0x5488c6?_0x26488d+'/'+_0x5488c6:_0x26488d;return _0x243431?await this[_0x51ce12(0x155)](_0x4be98a,_0x32fc74):await this[_0x51ce12(0x11c)](_0x4be98a,_0x32fc74);}catch(_0x18866a){if(_0x18866a instanceof SDKError)return console[_0x51ce12(0x143)](_0x51ce12(0x120)+_0x18866a['message']),_0x18866a[_0x51ce12(0x14d)]&&console['error'](_0x51ce12(0x113)+_0x18866a['cause']),0x1;throw _0x18866a;}}async[a42_0x1f22f1(0x14f)](_0x2f6aee,_0x246ba1,_0x4fd9c6){const _0x9614a1=a42_0x1f22f1,{options:_0x325e3f,tdx:_0x39798f}=_0x2f6aee,_0xbe7584=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x246ba1+_0x9614a1(0x148),()=>_0x39798f[_0x9614a1(0x10e)][_0x9614a1(0x12c)](_0x246ba1),{'verbose':_0x325e3f[_0x9614a1(0x13f)]}),_0x17d478=_0xbe7584[_0x9614a1(0x149)],_0x300be6=await withSpinner(_0x9614a1(0x10f),()=>_0x39798f[_0x9614a1(0x10e)]['listUnifiedWithJourneys'](_0x17d478['parentId'],_0x17d478[_0x9614a1(0x117)]),{'verbose':_0x325e3f[_0x9614a1(0x13f)]}),{folders:_0x1c62a5,segments:_0xff9d4b,journeys:_0x59500f}=_0x300be6[_0x9614a1(0x149)],_0x234959=_0x4fd9c6[_0x9614a1(0x153)](/[.+^${}()|[\]\\]/g,_0x9614a1(0x14a))[_0x9614a1(0x153)](/\*/g,'.*')[_0x9614a1(0x153)](/\?/g,'.'),_0x42a8a8=new RegExp('^'+_0x234959+'$','i'),_0x325b3b=_0x1c62a5[_0x9614a1(0x159)](_0x44964a=>_0x42a8a8[_0x9614a1(0x130)](_0x44964a[_0x9614a1(0x145)])),_0x325054=_0xff9d4b['filter'](_0x183bd3=>_0x42a8a8[_0x9614a1(0x130)](_0x183bd3[_0x9614a1(0x145)])),_0x2f2e4a=_0x59500f[_0x9614a1(0x159)](_0x1f1e6f=>_0x42a8a8[_0x9614a1(0x130)](_0x1f1e6f[_0x9614a1(0x147)])),_0xf8e668=_0x325b3b[_0x9614a1(0x122)]+_0x325054[_0x9614a1(0x122)]+_0x2f2e4a[_0x9614a1(0x122)];console[_0x9614a1(0x143)]('✔\x20Found\x20'+_0x325b3b['length']+_0x9614a1(0x128)+(_0x325b3b[_0x9614a1(0x122)]!==0x1?'s':'')+',\x20'+_0x325054[_0x9614a1(0x122)]+'\x20segment'+(_0x325054[_0x9614a1(0x122)]!==0x1?'s':'')+',\x20and\x20'+_0x2f2e4a[_0x9614a1(0x122)]+'\x20journey'+(_0x2f2e4a[_0x9614a1(0x122)]!==0x1?'s':'')+_0x9614a1(0x14c)+_0x4fd9c6+'\x27');const _0x59849d=_0x3ff940=>{const _0x36d24e=_0x9614a1;return getConsoleNextUrl(_0x325e3f[_0x36d24e(0x152)],_0x36d24e(0x12b)+_0x17d478['parentId']+_0x36d24e(0x156)+_0x3ff940);},_0x2e954b=_0x325e3f['format']===_0x9614a1(0x132)||_0x325e3f['format']===_0x9614a1(0x121);if(_0x2e954b){const _0x3504d0=[..._0x325b3b['map'](_0x3658bc=>({..._0x3658bc,'type':_0x9614a1(0x11b)})),..._0x325054['map'](_0xc41679=>({..._0xc41679,'type':_0x9614a1(0x10e),'url':_0x59849d(_0xc41679['id'])})),..._0x2f2e4a[_0x9614a1(0x114)](_0x11a421=>({..._0x11a421,'name':_0x11a421[_0x9614a1(0x147)],'type':_0x9614a1(0x119)}))][_0x9614a1(0x12f)]((_0x260ff8,_0x4c0224)=>_0x260ff8[_0x9614a1(0x145)][_0x9614a1(0x157)](_0x4c0224[_0x9614a1(0x145)]));await handleSDKOutput(_0x3504d0,_0x325e3f);}else{if(_0xf8e668===0x0)console['log'](_0x9614a1(0x11d)+_0x4fd9c6);else{console['log'](a42_0x261c25[_0x9614a1(0x12e)]('['+_0x246ba1+_0x9614a1(0x112)+_0x4fd9c6+'\x27'));const _0x4d7a6f=formatFlatList(_0x325b3b,_0x325054,{'showMetadata':!![],'getSegmentUrl':_0x59849d},_0x2f2e4a);console['log'](_0x4d7a6f);}}return 0x0;}async[a42_0x1f22f1(0x11c)](_0x253c71,_0x7cce9c){const _0xaed6a4=a42_0x1f22f1,{options:_0x3c67f5,tdx:_0x3f9e23}=_0x253c71,_0x1186b6=await withSpinner(_0xaed6a4(0x14b)+_0x7cce9c+_0xaed6a4(0x148),()=>_0x3f9e23[_0xaed6a4(0x10e)][_0xaed6a4(0x12c)](_0x7cce9c),{'verbose':_0x3c67f5[_0xaed6a4(0x13f)]}),_0x3eabed=_0x1186b6['data'];_0x3c67f5[_0xaed6a4(0x13f)]&&(console[_0xaed6a4(0x143)](_0xaed6a4(0x151)+_0x3eabed['parentId']),_0x3eabed['folderId']&&console[_0xaed6a4(0x143)](_0xaed6a4(0x13a)+_0x3eabed[_0xaed6a4(0x117)]));const _0x3f96ea=await withSpinner(_0xaed6a4(0x10f),()=>_0x3f9e23[_0xaed6a4(0x10e)][_0xaed6a4(0x129)](_0x3eabed['parentId'],_0x3eabed[_0xaed6a4(0x117)]),{'verbose':_0x3c67f5[_0xaed6a4(0x13f)]}),{folders:_0x3bd8f7,segments:_0x2c41c0,journeys:_0x2a2cb6}=_0x3f96ea[_0xaed6a4(0x149)],_0x3e475e=_0x3bd8f7[_0xaed6a4(0x122)]+_0x2c41c0[_0xaed6a4(0x122)]+_0x2a2cb6[_0xaed6a4(0x122)];console[_0xaed6a4(0x143)](_0xaed6a4(0x10c)+_0x3bd8f7['length']+_0xaed6a4(0x128)+(_0x3bd8f7[_0xaed6a4(0x122)]!==0x1?'s':'')+',\x20'+_0x2c41c0[_0xaed6a4(0x122)]+_0xaed6a4(0x146)+(_0x2c41c0['length']!==0x1?'s':'')+',\x20and\x20'+_0x2a2cb6[_0xaed6a4(0x122)]+_0xaed6a4(0x144)+(_0x2a2cb6[_0xaed6a4(0x122)]!==0x1?'s':''));const _0x2a21e0=_0x8a954c=>{const _0x1149be=_0xaed6a4;return getConsoleNextUrl(_0x3c67f5[_0x1149be(0x152)],'/app/ps/'+_0x3eabed['parentId']+_0x1149be(0x156)+_0x8a954c);},_0x35acbb=_0x281af3=>{const _0x36e1ad=_0xaed6a4;return getConsoleNextUrl(_0x3c67f5['site'],_0x36e1ad(0x12b)+_0x3eabed[_0x36e1ad(0x118)]+'/e/'+_0x281af3+_0x36e1ad(0x136));},_0x8fb9fc=_0x3c67f5[_0xaed6a4(0x11f)]===_0xaed6a4(0x132)||_0x3c67f5[_0xaed6a4(0x11f)]===_0xaed6a4(0x121);if(_0x8fb9fc){const _0x54f576=[..._0x3bd8f7['map'](_0x57622f=>({..._0x57622f,'type':_0xaed6a4(0x11b)})),..._0x2c41c0[_0xaed6a4(0x114)](_0x3e7925=>({..._0x3e7925,'type':_0xaed6a4(0x10e),'url':_0x2a21e0(_0x3e7925['id'])})),..._0x2a2cb6[_0xaed6a4(0x114)](_0x483862=>({..._0x483862,'name':_0x483862['journeyBundleName'],'type':_0xaed6a4(0x119),'url':_0x35acbb(_0x483862['id'])}))]['sort']((_0x430285,_0x118c3f)=>_0x430285[_0xaed6a4(0x145)][_0xaed6a4(0x157)](_0x118c3f[_0xaed6a4(0x145)]));await handleSDKOutput(_0x54f576,_0x3c67f5);}else{if(_0x3e475e===0x0)console['log'](a42_0x261c25[_0xaed6a4(0x12e)]('['+_0x7cce9c+']')),console[_0xaed6a4(0x131)](_0xaed6a4(0x140));else{console[_0xaed6a4(0x131)](a42_0x261c25[_0xaed6a4(0x12e)]('['+_0x7cce9c+']'));const _0x2a0bbe=formatFlatList(_0x3bd8f7,_0x2c41c0,{'showMetadata':!![],'getSegmentUrl':_0x2a21e0,'getJourneyUrl':_0x35acbb},_0x2a2cb6);console['log'](_0x2a0bbe);}}return 0x0;}async['listRecursive'](_0x3c31ca,_0x619aaa){const _0x2b9062=a42_0x1f22f1,{options:_0x1edf92,tdx:_0x1df1cb}=_0x3c31ca,_0x248b93=await withSpinner('Resolving\x20path\x20\x27'+_0x619aaa+_0x2b9062(0x148),()=>_0x1df1cb[_0x2b9062(0x10e)]['resolvePathToResource'](_0x619aaa),{'verbose':_0x1edf92[_0x2b9062(0x13f)]}),_0xe48556=_0x248b93[_0x2b9062(0x149)];_0x1edf92[_0x2b9062(0x13f)]&&(console[_0x2b9062(0x143)](_0x2b9062(0x151)+_0xe48556[_0x2b9062(0x118)]),_0xe48556['folderId']&&console[_0x2b9062(0x143)](_0x2b9062(0x13a)+_0xe48556['folderId']));const _0xc725e=_0x1edf92[_0x2b9062(0x14e)]||0xa,_0x46a20a=await withSpinner('Building\x20hierarchy\x20tree...',()=>_0x1df1cb[_0x2b9062(0x10e)][_0x2b9062(0x155)](_0xe48556[_0x2b9062(0x118)],_0xe48556['folderId'],0x0,_0xc725e),{'verbose':_0x1edf92[_0x2b9062(0x13f)]}),_0x30b69d=_0x46a20a[_0x2b9062(0x149)],_0x52f824=_0x57487c=>{const _0x9baf8=_0x2b9062;let _0x32aedf=0x0,_0x329c9b=0x0,_0x314c83=0x0;for(const _0x1927de of _0x57487c){if(_0x1927de[_0x9baf8(0x124)]===_0x9baf8(0x11b))_0x32aedf++;else{if(_0x1927de[_0x9baf8(0x124)]===_0x9baf8(0x10e))_0x329c9b++;else{if(_0x1927de[_0x9baf8(0x124)]===_0x9baf8(0x119))_0x314c83++;}}if(_0x1927de[_0x9baf8(0x126)]){const _0xb1768c=_0x52f824(_0x1927de['children']);_0x32aedf+=_0xb1768c[_0x9baf8(0x142)],_0x329c9b+=_0xb1768c['segments'],_0x314c83+=_0xb1768c['journeys'];}}return{'folders':_0x32aedf,'segments':_0x329c9b,'journeys':_0x314c83};},_0x4c1c74=_0x52f824(_0x30b69d);console['error']('✔\x20Built\x20tree\x20with\x20'+_0x4c1c74[_0x2b9062(0x142)]+_0x2b9062(0x128)+(_0x4c1c74[_0x2b9062(0x142)]!==0x1?'s':'')+',\x20'+_0x4c1c74[_0x2b9062(0x111)]+_0x2b9062(0x146)+(_0x4c1c74[_0x2b9062(0x111)]!==0x1?'s':'')+_0x2b9062(0x13c)+_0x4c1c74[_0x2b9062(0x12a)]+_0x2b9062(0x144)+(_0x4c1c74['journeys']!==0x1?'s':''));const _0x15ff91=_0x213e99=>{const _0x4f9ae9=_0x2b9062;return getConsoleNextUrl(_0x1edf92['site'],_0x4f9ae9(0x12b)+_0xe48556[_0x4f9ae9(0x118)]+_0x4f9ae9(0x156)+_0x213e99);},_0x333168=_0x5229e6=>{const _0x1357f1=_0x2b9062;return getConsoleNextUrl(_0x1edf92[_0x1357f1(0x152)],_0x1357f1(0x12b)+_0xe48556[_0x1357f1(0x118)]+'/e/'+_0x5229e6+_0x1357f1(0x136));};if(_0x1edf92[_0x2b9062(0x11f)]===_0x2b9062(0x132)||_0x1edf92['format']==='jsonl')await handleSDKOutput(_0x30b69d,_0x1edf92);else{console['log'](a42_0x261c25['dim']('['+_0x619aaa+']'));const _0xfd8b1c=formatTree(_0x30b69d,{'showMetadata':!![],'getSegmentUrl':_0x15ff91,'getJourneyUrl':_0x333168});console[_0x2b9062(0x131)](_0xfd8b1c);}return 0x0;}}
@@ -1 +1 @@
1
- const a40_0x456a4f=a40_0x4b9f;(function(_0x5dc3a3,_0x1677a9){const _0x38a6e8=a40_0x4b9f,_0x51223d=_0x5dc3a3();while(!![]){try{const _0x20c806=-parseInt(_0x38a6e8(0x115))/0x1*(-parseInt(_0x38a6e8(0x129))/0x2)+-parseInt(_0x38a6e8(0x107))/0x3*(-parseInt(_0x38a6e8(0x119))/0x4)+parseInt(_0x38a6e8(0x116))/0x5+-parseInt(_0x38a6e8(0x105))/0x6+parseInt(_0x38a6e8(0x10a))/0x7+-parseInt(_0x38a6e8(0x104))/0x8*(-parseInt(_0x38a6e8(0x120))/0x9)+-parseInt(_0x38a6e8(0x102))/0xa;if(_0x20c806===_0x1677a9)break;else _0x51223d['push'](_0x51223d['shift']());}catch(_0x5b0186){_0x51223d['push'](_0x51223d['shift']());}}}(a40_0x5597,0x5a7ce));import{BaseCommand}from'./command.js';function a40_0x4b9f(_0x5b42bc,_0x36a1d1){_0x5b42bc=_0x5b42bc-0x102;const _0x559745=a40_0x5597();let _0x4b9f76=_0x559745[_0x5b42bc];return _0x4b9f76;}import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';import{parseTableReference,validateTableDescribeReference}from'../utils/table-ref-parser.js';import{withSpinner}from'../utils/spinner.js';function a40_0x5597(){const _0x344388=['data','database','verbose','\x20row','args','\x20from\x20','limit','validate','73ieIjGt','2041290dWnjze','query','Too\x20many\x20arguments\x0aUsage:\x20tdx\x20show\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>\x0a\x0aRun\x20\x27tdx\x20show\x20--help\x27\x20for\x20more\x20options','4nWekkh','Limit:\x20','error','execute','table','Querying\x20','show','18iZuihI','Site:\x20','length','Show\x20table\x20contents','name','cause','Catalog:\x20','Error:\x20','\x20\x20Cause:\x20','13142XSSJZT','Table:\x20','message','6657990mPJTzF','\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>','64048rzWlwZ','1351296RIWavt','showTable','334284gSfMWS','Usage:\x20tdx\x20show\x20<database.table>','✔\x20Retrieved\x20','1723904gafUrd','✔\x20Query\x20successful\x20-\x200\x20rows\x20returned','site'];a40_0x5597=function(){return _0x344388;};return a40_0x5597();}import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';export class ShowCommand extends BaseCommand{[a40_0x456a4f(0x124)]=a40_0x456a4f(0x11f);['description']=a40_0x456a4f(0x123);async[a40_0x456a4f(0x11c)](_0x3a572b){return this['showTable'](_0x3a572b);}async[a40_0x456a4f(0x106)](_0x2167a1){const _0x3d7c26=a40_0x456a4f,{options:_0x511bf0,args:_0x1bc1bf,tdx:_0x14649d}=_0x2167a1;let _0x37a0ee;try{_0x37a0ee=parseTableReference(_0x1bc1bf[0x0]);const _0x49d8c3=_0x511bf0[_0x3d7c26(0x10e)];!_0x37a0ee[_0x3d7c26(0x10e)]&&_0x49d8c3&&(_0x37a0ee[_0x3d7c26(0x10e)]=_0x49d8c3);const _0xbea5c=validateTableDescribeReference(_0x37a0ee);if(_0xbea5c)return console[_0x3d7c26(0x11b)](_0x3d7c26(0x127)+_0xbea5c),console[_0x3d7c26(0x11b)]('Usage:\x20tdx\x20show\x20<database.table>'),console['error']('\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>'),console['error']('\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>'),0x1;}catch(_0x599060){return console[_0x3d7c26(0x11b)](_0x3d7c26(0x127)+_0x599060[_0x3d7c26(0x12b)]),console[_0x3d7c26(0x11b)](_0x3d7c26(0x108)),console['error'](_0x3d7c26(0x103)),console[_0x3d7c26(0x11b)]('\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>'),0x1;}const _0x17d7cb=_0x37a0ee['catalog'],_0x25da84=_0x37a0ee['database'],_0x51b622=_0x37a0ee[_0x3d7c26(0x11d)],_0x41ed0b=resolveLimit(_0x511bf0[_0x3d7c26(0x113)],DEFAULT_DISPLAY_LIMIT);try{_0x511bf0[_0x3d7c26(0x10f)]&&(console[_0x3d7c26(0x11b)](_0x3d7c26(0x121)+_0x511bf0[_0x3d7c26(0x10c)]),_0x17d7cb&&console[_0x3d7c26(0x11b)](_0x3d7c26(0x126)+_0x17d7cb),console[_0x3d7c26(0x11b)]('Database:\x20'+_0x25da84),console[_0x3d7c26(0x11b)](_0x3d7c26(0x12a)+_0x51b622),console['error'](_0x3d7c26(0x11a)+_0x41ed0b));const _0x140b86=_0x17d7cb?_0x17d7cb+'.'+_0x25da84+'.'+_0x51b622:_0x25da84+'.'+_0x51b622,_0x5a22cf=await withSpinner(_0x3d7c26(0x11e)+_0x140b86+'...',()=>_0x14649d[_0x3d7c26(0x117)]['showTable'](_0x25da84,_0x51b622,_0x41ed0b,_0x17d7cb),{'verbose':_0x511bf0[_0x3d7c26(0x10f)]}),_0xd9c8ea=_0x5a22cf['data'],_0x1cd347=_0xd9c8ea[_0x3d7c26(0x10d)];return _0x1cd347[_0x3d7c26(0x122)]===0x0?console[_0x3d7c26(0x11b)](_0x3d7c26(0x10b)):console[_0x3d7c26(0x11b)](_0x3d7c26(0x109)+_0x1cd347[_0x3d7c26(0x122)]+_0x3d7c26(0x110)+(_0x1cd347[_0x3d7c26(0x122)]!==0x1?'s':'')+_0x3d7c26(0x112)+_0x140b86),await handleSDKOutput(_0x1cd347,_0x511bf0),0x0;}catch(_0x11f0db){if(_0x11f0db instanceof SDKError)return console[_0x3d7c26(0x11b)](_0x3d7c26(0x127)+_0x11f0db[_0x3d7c26(0x12b)]),_0x11f0db[_0x3d7c26(0x125)]&&console[_0x3d7c26(0x11b)](_0x3d7c26(0x128)+_0x11f0db['cause']),0x1;throw _0x11f0db;}}[a40_0x456a4f(0x114)](_0xe0ff56){const _0x106704=a40_0x456a4f;if(_0xe0ff56[_0x106704(0x111)]['length']===0x0)return'Usage:\x20tdx\x20show\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--in\x20<database>\x0a\x0aRun\x20\x27tdx\x20show\x20--help\x27\x20for\x20more\x20options';if(_0xe0ff56[_0x106704(0x111)][_0x106704(0x122)]>0x1)return _0x106704(0x118);return undefined;}}
1
+ const a43_0x4bd40c=a43_0x3245;function a43_0x3245(_0x3e13ee,_0xfd3d01){_0x3e13ee=_0x3e13ee-0x11e;const _0x4184e1=a43_0x4184();let _0x324596=_0x4184e1[_0x3e13ee];return _0x324596;}(function(_0x4c8df3,_0x3a5521){const _0x5112ed=a43_0x3245,_0x32cb0d=_0x4c8df3();while(!![]){try{const _0x15ec9d=-parseInt(_0x5112ed(0x146))/0x1+-parseInt(_0x5112ed(0x148))/0x2*(-parseInt(_0x5112ed(0x144))/0x3)+-parseInt(_0x5112ed(0x135))/0x4*(-parseInt(_0x5112ed(0x127))/0x5)+parseInt(_0x5112ed(0x12d))/0x6+parseInt(_0x5112ed(0x122))/0x7*(-parseInt(_0x5112ed(0x121))/0x8)+-parseInt(_0x5112ed(0x12f))/0x9+-parseInt(_0x5112ed(0x12b))/0xa*(-parseInt(_0x5112ed(0x140))/0xb);if(_0x15ec9d===_0x3a5521)break;else _0x32cb0d['push'](_0x32cb0d['shift']());}catch(_0x4b32cd){_0x32cb0d['push'](_0x32cb0d['shift']());}}}(a43_0x4184,0xd77b6));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';import{parseTableReference,validateTableDescribeReference}from'../utils/table-ref-parser.js';function a43_0x4184(){const _0x2d19dc=['1538770lPfPmH','\x20from\x20','4724844eBhQPl','message','15668136AyzMvr','args','data','error','table','\x20\x20Cause:\x20','24UPRFYL','cause','\x20\x20\x20or:\x20tdx\x20show\x20<catalog.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','Catalog:\x20','site','catalog','Querying\x20','Table:\x20','Usage:\x20tdx\x20show\x20<database.table>','query','209ZdRNlc','\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>','length','database','66153lGodue','name','1635056tDJOVe','verbose','14sNOQPT','Database:\x20','Limit:\x20','showTable','8KDWeOG','8966314mKTGwk','Error:\x20','Show\x20table\x20contents','Site:\x20','Usage:\x20tdx\x20show\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--in\x20<database>\x0a\x0aRun\x20\x27tdx\x20show\x20--help\x27\x20for\x20more\x20options','1394985ILhuUx','show','limit','\x20row'];a43_0x4184=function(){return _0x2d19dc;};return a43_0x4184();}import{withSpinner}from'../utils/spinner.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';export class ShowCommand extends BaseCommand{[a43_0x4bd40c(0x145)]=a43_0x4bd40c(0x128);['description']=a43_0x4bd40c(0x124);async['execute'](_0x43d9ca){const _0x5d21d8=a43_0x4bd40c;return this[_0x5d21d8(0x120)](_0x43d9ca);}async['showTable'](_0x53975d){const _0x47c1ac=a43_0x4bd40c,{options:_0x5aa9b4,args:_0x546030,tdx:_0x220283}=_0x53975d;let _0x3872e3;try{_0x3872e3=parseTableReference(_0x546030[0x0]);const _0x460c69=_0x5aa9b4[_0x47c1ac(0x143)];!_0x3872e3['database']&&_0x460c69&&(_0x3872e3[_0x47c1ac(0x143)]=_0x460c69);const _0x3eea2f=validateTableDescribeReference(_0x3872e3);if(_0x3eea2f)return console[_0x47c1ac(0x132)](_0x47c1ac(0x123)+_0x3eea2f),console['error'](_0x47c1ac(0x13e)),console[_0x47c1ac(0x132)](_0x47c1ac(0x137)),console['error'](_0x47c1ac(0x141)),0x1;}catch(_0x4cdcb9){return console['error']('Error:\x20'+_0x4cdcb9[_0x47c1ac(0x12e)]),console[_0x47c1ac(0x132)]('Usage:\x20tdx\x20show\x20<database.table>'),console['error'](_0x47c1ac(0x137)),console['error'](_0x47c1ac(0x141)),0x1;}const _0x5de877=_0x3872e3[_0x47c1ac(0x13b)],_0x19fa66=_0x3872e3[_0x47c1ac(0x143)],_0x3b671e=_0x3872e3[_0x47c1ac(0x133)],_0x488d41=resolveLimit(_0x5aa9b4[_0x47c1ac(0x129)],DEFAULT_DISPLAY_LIMIT);try{_0x5aa9b4[_0x47c1ac(0x147)]&&(console['error'](_0x47c1ac(0x125)+_0x5aa9b4[_0x47c1ac(0x13a)]),_0x5de877&&console['error'](_0x47c1ac(0x139)+_0x5de877),console[_0x47c1ac(0x132)](_0x47c1ac(0x11e)+_0x19fa66),console[_0x47c1ac(0x132)](_0x47c1ac(0x13d)+_0x3b671e),console['error'](_0x47c1ac(0x11f)+_0x488d41));const _0x1814ac=_0x5de877?_0x5de877+'.'+_0x19fa66+'.'+_0x3b671e:_0x19fa66+'.'+_0x3b671e,_0x279161=await withSpinner(_0x47c1ac(0x13c)+_0x1814ac+'...',()=>_0x220283[_0x47c1ac(0x13f)]['showTable'](_0x19fa66,_0x3b671e,_0x488d41,_0x5de877),{'verbose':_0x5aa9b4[_0x47c1ac(0x147)]}),_0x5e6f43=_0x279161['data'],_0x185a70=_0x5e6f43[_0x47c1ac(0x131)];return _0x185a70[_0x47c1ac(0x142)]===0x0?console[_0x47c1ac(0x132)]('✔\x20Query\x20successful\x20-\x200\x20rows\x20returned'):console[_0x47c1ac(0x132)]('✔\x20Retrieved\x20'+_0x185a70[_0x47c1ac(0x142)]+_0x47c1ac(0x12a)+(_0x185a70[_0x47c1ac(0x142)]!==0x1?'s':'')+_0x47c1ac(0x12c)+_0x1814ac),await handleSDKOutput(_0x185a70,_0x5aa9b4),0x0;}catch(_0x259ecd){if(_0x259ecd instanceof SDKError)return console[_0x47c1ac(0x132)](_0x47c1ac(0x123)+_0x259ecd[_0x47c1ac(0x12e)]),_0x259ecd['cause']&&console[_0x47c1ac(0x132)](_0x47c1ac(0x134)+_0x259ecd[_0x47c1ac(0x136)]),0x1;throw _0x259ecd;}}['validate'](_0x4f391d){const _0x5187e2=a43_0x4bd40c;if(_0x4f391d[_0x5187e2(0x130)][_0x5187e2(0x142)]===0x0)return _0x5187e2(0x126);if(_0x4f391d[_0x5187e2(0x130)][_0x5187e2(0x142)]>0x1)return _0x5187e2(0x138);return undefined;}}
@@ -1 +1 @@
1
- const a41_0x295c51=a41_0x2121;(function(_0x54f80b,_0x99438){const _0x23dc3e=a41_0x2121,_0x530ec1=_0x54f80b();while(!![]){try{const _0x81ca46=parseInt(_0x23dc3e(0x194))/0x1+-parseInt(_0x23dc3e(0x199))/0x2*(-parseInt(_0x23dc3e(0x184))/0x3)+parseInt(_0x23dc3e(0x178))/0x4+parseInt(_0x23dc3e(0x19f))/0x5+parseInt(_0x23dc3e(0x17d))/0x6+-parseInt(_0x23dc3e(0x17c))/0x7+parseInt(_0x23dc3e(0x19c))/0x8*(-parseInt(_0x23dc3e(0x186))/0x9);if(_0x81ca46===_0x99438)break;else _0x530ec1['push'](_0x530ec1['shift']());}catch(_0x8b54c7){_0x530ec1['push'](_0x530ec1['shift']());}}}(a41_0x2623,0xc9995));import{BaseCommand,printAuthError}from'./command.js';import{resolveAPIKeyAsync}from'../core/config.js';import{HTTPClientError}from'../sdk/client/http-client.js';import{GlobalContext}from'../core/global-context.js';import a41_0x560b6d from'chalk';function a41_0x2623(){const _0x3ad243=['4562772dALUIG','N/A','jobs','profileSource','error','last_name','displayWithSources','6921yxAqBA','email','9eSJTSk','yellow','join','account_id','(from\x20','cli','env','cyan','bold','Name:','name','dim','session','getUserInfo','61163mXClhW','site:\x20','config','Account\x20ID:','✓\x20Authentication\x20successful\x0a','1282PqXoig','filter','log','22504528AvpBnY','TDX_PROFILE\x20env','description','5106965RPmFXa','status','Read\x20credential\x20from\x20','green','execute','tdx','4160496waFoOp','\x20profile:\x20','site','red','5061798WMTrIP'];a41_0x2623=function(){return _0x3ad243;};return a41_0x2623();}function a41_0x2121(_0x9751e1,_0x397b09){_0x9751e1=_0x9751e1-0x174;const _0x262352=a41_0x2623();let _0x212133=_0x262352[_0x9751e1];return _0x212133;}export class StatusCommand extends BaseCommand{[a41_0x295c51(0x190)]=a41_0x295c51(0x1a0);[a41_0x295c51(0x19e)]='Show\x20authentication\x20status\x20and\x20current\x20context';async[a41_0x295c51(0x176)](_0xaad79e){const _0x38498a=a41_0x295c51,{options:_0x16050b,tdx:_0x540b59}=_0xaad79e,_0x41f79f=_0x16050b[_0x38498a(0x17a)],_0x5db4e8=new GlobalContext(_0x16050b),_0x364649=_0x5db4e8['profile'],_0x2ee57b=_0x5db4e8[_0x38498a(0x180)],_0x5b18b0=_0x2ee57b===_0x38498a(0x18b)?'CLI\x20flag':_0x2ee57b===_0x38498a(0x192)?'session':_0x2ee57b===_0x38498a(0x18c)?_0x38498a(0x19d):_0x2ee57b===_0x38498a(0x196)?_0x38498a(0x196):null,_0x23907e=_0x364649?a41_0x560b6d['cyan'](_0x364649):a41_0x560b6d[_0x38498a(0x191)](_0x38498a(0x17e)),_0x429d7b=_0x5b18b0?'\x20'+a41_0x560b6d[_0x38498a(0x191)](_0x38498a(0x18a)+_0x5b18b0+')'):'';console[_0x38498a(0x19b)](a41_0x560b6d[_0x38498a(0x18e)](_0x38498a(0x177))+_0x38498a(0x179)+_0x23907e+_0x429d7b+'\x20'+a41_0x560b6d[_0x38498a(0x191)]('(')+_0x38498a(0x195)+a41_0x560b6d[_0x38498a(0x18d)](_0x41f79f)+a41_0x560b6d[_0x38498a(0x191)](')'));const _0x5a4ca9=await resolveAPIKeyAsync(_0x41f79f,_0x364649);if(_0x5a4ca9){const {source:_0x411621,isDeprecated:_0x1c38ce}=_0x5a4ca9,_0x570033=_0x38498a(0x174)+a41_0x560b6d['cyan'](_0x411621);console[_0x38498a(0x19b)](_0x1c38ce?a41_0x560b6d['yellow'](_0x570033):_0x570033);}else console[_0x38498a(0x19b)](a41_0x560b6d[_0x38498a(0x187)]('No\x20credential\x20found'));let _0x3d34d3=![];try{const _0x5eac5e=await _0x540b59[_0x38498a(0x17f)][_0x38498a(0x193)]();console[_0x38498a(0x19b)](a41_0x560b6d[_0x38498a(0x175)](_0x38498a(0x198))),console['log'](a41_0x560b6d[_0x38498a(0x18e)]('User:')+'\x20'+a41_0x560b6d[_0x38498a(0x18d)](_0x5eac5e[_0x38498a(0x185)]));if(_0x5eac5e['first_name']||_0x5eac5e['last_name']){const _0xc3b77c=[_0x5eac5e['first_name'],_0x5eac5e[_0x38498a(0x182)]][_0x38498a(0x19a)](Boolean)[_0x38498a(0x188)]('\x20');console[_0x38498a(0x19b)](a41_0x560b6d[_0x38498a(0x18e)](_0x38498a(0x18f))+'\x20'+_0xc3b77c);}_0x5eac5e[_0x38498a(0x189)]&&console[_0x38498a(0x19b)](a41_0x560b6d[_0x38498a(0x18e)](_0x38498a(0x197))+'\x20'+a41_0x560b6d['yellow'](_0x5eac5e[_0x38498a(0x189)])),_0x3d34d3=!![];}catch(_0x49eb93){_0x49eb93 instanceof HTTPClientError&&_0x49eb93[_0x38498a(0x1a0)]===0x191?printAuthError(_0x49eb93,!![],_0x364649):console[_0x38498a(0x181)](a41_0x560b6d[_0x38498a(0x17b)]('✗\x20Validation\x20failed:\x20'+(_0x49eb93 instanceof Error?_0x49eb93['message']:String(_0x49eb93))));}return console[_0x38498a(0x19b)](),_0x5db4e8[_0x38498a(0x183)](),_0x3d34d3?0x0:0x1;}}
1
+ function a44_0x3690(_0x21818d,_0xed0411){_0x21818d=_0x21818d-0x1c3;const _0x4e9a47=a44_0x4e9a();let _0x3690f3=_0x4e9a47[_0x21818d];return _0x3690f3;}const a44_0x28535d=a44_0x3690;function a44_0x4e9a(){const _0xd966fb=['922430MqhwLo','cyan','account_id','last_name','config','6cDlsAu','filter','bold','dim','jobs','cli','2226824PPIuJv','(from\x20','Show\x20authentication\x20status\x20and\x20current\x20context','1664649HraNMk','1020963NtQRhu','displayWithSources','green','status','join','7ZMlhMJ','error','756089ZLjFHt','profileSource','execute','33rCGZvo','5219796XxyDNv','yellow','description','✓\x20Authentication\x20successful\x0a','log','tdx','4dXRdPP','Name:','User:','first_name','4620970NbTxsG','session','site','Read\x20credential\x20from\x20','email'];a44_0x4e9a=function(){return _0xd966fb;};return a44_0x4e9a();}(function(_0x32efcf,_0x49888c){const _0xed6349=a44_0x3690,_0x2927d4=_0x32efcf();while(!![]){try{const _0x481c5b=parseInt(_0xed6349(0x1dc))/0x1+-parseInt(_0xed6349(0x1cb))/0x2*(parseInt(_0xed6349(0x1d5))/0x3)+-parseInt(_0xed6349(0x1e6))/0x4*(-parseInt(_0xed6349(0x1c6))/0x5)+-parseInt(_0xed6349(0x1e0))/0x6+-parseInt(_0xed6349(0x1da))/0x7*(-parseInt(_0xed6349(0x1d1))/0x8)+-parseInt(_0xed6349(0x1d4))/0x9+parseInt(_0xed6349(0x1ea))/0xa*(parseInt(_0xed6349(0x1df))/0xb);if(_0x481c5b===_0x49888c)break;else _0x2927d4['push'](_0x2927d4['shift']());}catch(_0x4835e8){_0x2927d4['push'](_0x2927d4['shift']());}}}(a44_0x4e9a,0x813b1));import{BaseCommand,printAuthError}from'./command.js';import{resolveAPIKeyAsync}from'../core/config.js';import{HTTPClientError}from'../sdk/client/http-client.js';import{GlobalContext}from'../core/global-context.js';import a44_0x23d251 from'chalk';export class StatusCommand extends BaseCommand{['name']=a44_0x28535d(0x1d8);[a44_0x28535d(0x1e2)]=a44_0x28535d(0x1d3);async[a44_0x28535d(0x1de)](_0x42d78d){const _0x3d0974=a44_0x28535d,{options:_0xb454cb,tdx:_0x5211c7}=_0x42d78d,_0xfc2cd=_0xb454cb[_0x3d0974(0x1c3)],_0x167b64=new GlobalContext(_0xb454cb),_0x3f83db=_0x167b64['profile'],_0x1873a1=_0x167b64[_0x3d0974(0x1dd)],_0x3c41dc=_0x1873a1===_0x3d0974(0x1d0)?'CLI\x20flag':_0x1873a1===_0x3d0974(0x1eb)?_0x3d0974(0x1eb):_0x1873a1==='env'?'TDX_PROFILE\x20env':_0x1873a1===_0x3d0974(0x1ca)?_0x3d0974(0x1ca):null,_0x1ff554=_0x3f83db?a44_0x23d251[_0x3d0974(0x1c7)](_0x3f83db):a44_0x23d251['dim']('N/A'),_0x14c9c2=_0x3c41dc?'\x20'+a44_0x23d251['dim'](_0x3d0974(0x1d2)+_0x3c41dc+')'):'';console['log'](a44_0x23d251['bold'](_0x3d0974(0x1e5))+'\x20profile:\x20'+_0x1ff554+_0x14c9c2+'\x20'+a44_0x23d251[_0x3d0974(0x1ce)]('(')+'site:\x20'+a44_0x23d251[_0x3d0974(0x1c7)](_0xfc2cd)+a44_0x23d251[_0x3d0974(0x1ce)](')'));const _0x28ce40=await resolveAPIKeyAsync(_0xfc2cd,_0x3f83db);if(_0x28ce40){const {source:_0x507969,isDeprecated:_0x374f8c}=_0x28ce40,_0x4b63ca=_0x3d0974(0x1c4)+a44_0x23d251[_0x3d0974(0x1c7)](_0x507969);console[_0x3d0974(0x1e4)](_0x374f8c?a44_0x23d251['yellow'](_0x4b63ca):_0x4b63ca);}else console[_0x3d0974(0x1e4)](a44_0x23d251[_0x3d0974(0x1e1)]('No\x20credential\x20found'));let _0x49d431=![];try{const _0x38bb7c=await _0x5211c7[_0x3d0974(0x1cf)]['getUserInfo']();console[_0x3d0974(0x1e4)](a44_0x23d251[_0x3d0974(0x1d7)](_0x3d0974(0x1e3))),console[_0x3d0974(0x1e4)](a44_0x23d251[_0x3d0974(0x1cd)](_0x3d0974(0x1e8))+'\x20'+a44_0x23d251[_0x3d0974(0x1c7)](_0x38bb7c[_0x3d0974(0x1c5)]));if(_0x38bb7c[_0x3d0974(0x1e9)]||_0x38bb7c[_0x3d0974(0x1c9)]){const _0x257f60=[_0x38bb7c[_0x3d0974(0x1e9)],_0x38bb7c[_0x3d0974(0x1c9)]][_0x3d0974(0x1cc)](Boolean)[_0x3d0974(0x1d9)]('\x20');console[_0x3d0974(0x1e4)](a44_0x23d251['bold'](_0x3d0974(0x1e7))+'\x20'+_0x257f60);}_0x38bb7c['account_id']&&console[_0x3d0974(0x1e4)](a44_0x23d251[_0x3d0974(0x1cd)]('Account\x20ID:')+'\x20'+a44_0x23d251[_0x3d0974(0x1e1)](_0x38bb7c[_0x3d0974(0x1c8)])),_0x49d431=!![];}catch(_0x3541f3){_0x3541f3 instanceof HTTPClientError&&_0x3541f3[_0x3d0974(0x1d8)]===0x191?printAuthError(_0x3541f3,!![],_0x3f83db):console[_0x3d0974(0x1db)](a44_0x23d251['red']('✗\x20Validation\x20failed:\x20'+(_0x3541f3 instanceof Error?_0x3541f3['message']:String(_0x3541f3))));}return console[_0x3d0974(0x1e4)](),_0x167b64[_0x3d0974(0x1d6)](),_0x49d431?0x0:0x1;}}
@@ -1 +1 @@
1
- function a42_0x12c9(_0x24463c,_0x1be642){_0x24463c=_0x24463c-0x1d1;const _0x744f2e=a42_0x744f();let _0x12c97f=_0x744f2e[_0x24463c];return _0x12c97f;}const a42_0x330bf5=a42_0x12c9;(function(_0xff6d62,_0x38c79b){const _0x54b3b9=a42_0x12c9,_0x5accd7=_0xff6d62();while(!![]){try{const _0x53c19f=parseInt(_0x54b3b9(0x1e1))/0x1+-parseInt(_0x54b3b9(0x1fc))/0x2*(parseInt(_0x54b3b9(0x1dc))/0x3)+parseInt(_0x54b3b9(0x1f2))/0x4*(-parseInt(_0x54b3b9(0x1f7))/0x5)+parseInt(_0x54b3b9(0x1e9))/0x6+parseInt(_0x54b3b9(0x1d3))/0x7+-parseInt(_0x54b3b9(0x1f6))/0x8*(-parseInt(_0x54b3b9(0x1d9))/0x9)+-parseInt(_0x54b3b9(0x1ff))/0xa;if(_0x53c19f===_0x38c79b)break;else _0x5accd7['push'](_0x5accd7['shift']());}catch(_0x2b9e46){_0x5accd7['push'](_0x5accd7['shift']());}}}(a42_0x744f,0x8470d));function a42_0x744f(){const _0x4ef450=['\x27\x20is\x20ambiguous.','includes','database','data','\x27\x20may\x20not\x20exist\x20or\x20contains\x20no\x20tables','Site:\x20','2255526SdpRku','verbose','error','✔\x20Found\x20','length','name','limit','Database\x20\x27','Error:\x20','3472772vtIRSc','Or\x20use\x20--in\x20flag:','\x20\x20tdx\x20tables\x20\x22mydb.*\x22\x20\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb','Listing\x20tables...','2111352ccYUYm','5MqMjGN','\x20\x20Or:\x20\x20tdx\x20tables\x20--database\x20','table','query','List\x20tables\x20in\x20a\x20database','104782zqbQGl','listTables','Note:\x20\x27','5511690RoYuUk','Table\x20pattern:\x20','Database:\x20all','\x20table','6942460XUiCXk','site','\x27\x20without\x20wildcards\x20would\x20search\x20for\x20tables\x20named\x20\x27','✖\x20No\x20tables\x20found','\x20\x20tdx\x20tables\x20--in\x20mydb\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb','Error:\x20Pattern\x20\x27','9zjXfwG','\x20\x20Use:\x20tdx\x20tables\x20\x22','\x20\x20tdx\x20tables\x20users\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20across\x20all\x20databases','9UFnXpe','Did\x20you\x20mean\x20to\x20list\x20all\x20tables\x20from\x20database\x20\x27','validate','Database:\x20','message','487392pUViqW','\x20\x20Cause:\x20'];a42_0x744f=function(){return _0x4ef450;};return a42_0x744f();}import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';import{parseTableReference}from'../utils/table-ref-parser.js';import{DEFAULT_LISTING_LIMIT,resolveLimit}from'../core/constants.js';import{withSpinner}from'../utils/spinner.js';export class TablesCommand extends BaseCommand{[a42_0x330bf5(0x1ee)]='tables';['description']=a42_0x330bf5(0x1fb);async['execute'](_0x5d8fce){const _0x49ec89=a42_0x330bf5,{options:_0x15f95f,args:_0x53adc5,tdx:_0x2bc133}=_0x5d8fce;let _0x188d77;if(_0x53adc5[_0x49ec89(0x1ed)]===0x0)_0x188d77={'database':undefined,'table':undefined,'original':''};else{if(_0x53adc5[_0x49ec89(0x1ed)]===0x1)try{_0x188d77=parseTableReference(_0x53adc5[0x0]);if(_0x188d77[_0x49ec89(0x1f9)]&&!_0x188d77[_0x49ec89(0x1e5)]&&!_0x188d77[_0x49ec89(0x1f9)][_0x49ec89(0x1e4)]('*')&&!_0x188d77[_0x49ec89(0x1f9)][_0x49ec89(0x1e4)]('?'))return console[_0x49ec89(0x1eb)](_0x49ec89(0x1d8)+_0x53adc5[0x0]+_0x49ec89(0x1e3)),console['error'](_0x49ec89(0x1dd)+_0x188d77[_0x49ec89(0x1f9)]+'\x27?'),console[_0x49ec89(0x1eb)](_0x49ec89(0x1da)+_0x188d77[_0x49ec89(0x1f9)]+'.*\x22'),console[_0x49ec89(0x1eb)]('\x20\x20Or:\x20\x20tdx\x20tables\x20--in\x20'+_0x188d77[_0x49ec89(0x1f9)]),console['error'](_0x49ec89(0x1f8)+_0x188d77[_0x49ec89(0x1f9)]),console['error'](''),console[_0x49ec89(0x1eb)](_0x49ec89(0x1fe)+_0x53adc5[0x0]+_0x49ec89(0x1d5)+_0x188d77['table']+'\x27\x20across\x20all\x20databases.'),0x1;}catch(_0x162891){return console[_0x49ec89(0x1eb)](_0x49ec89(0x1f1)+_0x162891[_0x49ec89(0x1e0)]),0x1;}else return console[_0x49ec89(0x1eb)]('Error:\x20Too\x20many\x20arguments.\x20Use\x20single\x20argument:'),console['error'](_0x49ec89(0x1db)),console[_0x49ec89(0x1eb)](_0x49ec89(0x1f4)),console[_0x49ec89(0x1eb)]('\x20\x20tdx\x20tables\x20\x22mydb.users\x22\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20in\x20database\x20mydb'),console['error']('\x20\x20tdx\x20tables\x20\x22*.user*\x22\x20\x20\x20\x20\x20\x20\x20->\x20tables\x20matching\x20user*\x20across\x20databases'),console[_0x49ec89(0x1eb)](_0x49ec89(0x1f3)),console['error'](_0x49ec89(0x1d7)),0x1;}const _0x1b39cb=_0x15f95f[_0x49ec89(0x1e5)];!_0x188d77[_0x49ec89(0x1e5)]&&_0x1b39cb&&(_0x188d77['database']=_0x1b39cb);try{const _0x5ba909=_0x41453f=>_0x41453f&&(_0x41453f[_0x49ec89(0x1e4)]('*')||_0x41453f[_0x49ec89(0x1e4)]('?')),_0x510f85=_0x5ba909(_0x188d77[_0x49ec89(0x1e5)]);_0x15f95f[_0x49ec89(0x1ea)]&&(console['error'](_0x49ec89(0x1e8)+_0x15f95f[_0x49ec89(0x1d4)]),_0x188d77[_0x49ec89(0x1e5)]?_0x510f85?console[_0x49ec89(0x1eb)]('Database\x20pattern:\x20'+_0x188d77[_0x49ec89(0x1e5)]):console['error'](_0x49ec89(0x1df)+_0x188d77[_0x49ec89(0x1e5)]):console[_0x49ec89(0x1eb)](_0x49ec89(0x1d1)),_0x188d77[_0x49ec89(0x1f9)]&&console['error'](_0x49ec89(0x200)+_0x188d77[_0x49ec89(0x1f9)]));const _0x44ac0e=_0x188d77[_0x49ec89(0x1e5)]&&!_0x510f85?_0x188d77[_0x49ec89(0x1e5)]:undefined,_0x49f90c=_0x510f85?_0x188d77['database']:undefined,_0x78ed5a=_0x188d77[_0x49ec89(0x1f9)],_0x8d6b48=resolveLimit(_0x15f95f[_0x49ec89(0x1ef)],DEFAULT_LISTING_LIMIT),_0x501eae=await withSpinner(_0x49ec89(0x1f5),()=>_0x2bc133[_0x49ec89(0x1fa)][_0x49ec89(0x1fd)](_0x44ac0e,_0x78ed5a,_0x49f90c,_0x8d6b48),{'verbose':_0x15f95f[_0x49ec89(0x1ea)]}),_0x35462c=_0x501eae[_0x49ec89(0x1e6)];if(_0x35462c[_0x49ec89(0x1ed)]===0x0&&_0x188d77[_0x49ec89(0x1e5)]&&!_0x510f85)return console[_0x49ec89(0x1eb)](_0x49ec89(0x1d6)),console[_0x49ec89(0x1eb)](_0x49ec89(0x1f0)+_0x188d77[_0x49ec89(0x1e5)]+_0x49ec89(0x1e7)),0x1;return console[_0x49ec89(0x1eb)](_0x49ec89(0x1ec)+_0x35462c[_0x49ec89(0x1ed)]+_0x49ec89(0x1d2)+(_0x35462c[_0x49ec89(0x1ed)]!==0x1?'s':'')),await handleSDKOutput(_0x35462c,{..._0x15f95f,'limit':_0x8d6b48}),0x0;}catch(_0x50d4bd){if(_0x50d4bd instanceof SDKError)return console[_0x49ec89(0x1eb)](_0x49ec89(0x1f1)+_0x50d4bd[_0x49ec89(0x1e0)]),_0x50d4bd['cause']&&console['error'](_0x49ec89(0x1e2)+_0x50d4bd['cause']),0x1;throw _0x50d4bd;}}[a42_0x330bf5(0x1de)](_0x1cafc0){return undefined;}}
1
+ const a45_0x5d14d4=a45_0x2bf0;function a45_0x2bf0(_0x13a65f,_0x18ca85){_0x13a65f=_0x13a65f-0x170;const _0x3d402f=a45_0x3d40();let _0x2bf0f3=_0x3d402f[_0x13a65f];return _0x2bf0f3;}function a45_0x3d40(){const _0x520ebd=['Error:\x20','Note:\x20\x27','\x20table','\x20\x20Use:\x20tdx\x20tables\x20\x22','\x20\x20tdx\x20tables\x20\x22mydb.users\x22\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20in\x20database\x20mydb','Table\x20pattern:\x20','error','\x20\x20Or:\x20\x20tdx\x20tables\x20--in\x20','site','1460210eGDLZY','✖\x20No\x20tables\x20found','limit','Did\x20you\x20mean\x20to\x20list\x20all\x20tables\x20from\x20database\x20\x27','length','message','9229577tIiqZH','verbose','9PrJmAR','Or\x20use\x20--in\x20flag:','description','\x20\x20Cause:\x20','253QiJfSM','2849032TNNSqc','table','Error:\x20Pattern\x20\x27','278946rrjzxh','tables','Site:\x20','\x27\x20across\x20all\x20databases.','312864TPwhbP','cause','name','database','query','List\x20tables\x20in\x20a\x20database','4234206vtROGF','\x27\x20is\x20ambiguous.','\x20\x20tdx\x20tables\x20users\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20across\x20all\x20databases','1025535WDUjCX','includes','\x20\x20Or:\x20\x20tdx\x20tables\x20--database\x20','18cUvpFy','listTables','validate','Error:\x20Too\x20many\x20arguments.\x20Use\x20single\x20argument:','18OaSGZJ','Database\x20pattern:\x20'];a45_0x3d40=function(){return _0x520ebd;};return a45_0x3d40();}(function(_0x397598,_0x509203){const _0x22c59b=a45_0x2bf0,_0x14d3ac=_0x397598();while(!![]){try{const _0x5cd574=-parseInt(_0x22c59b(0x17d))/0x1*(parseInt(_0x22c59b(0x185))/0x2)+parseInt(_0x22c59b(0x18f))/0x3+-parseInt(_0x22c59b(0x189))/0x4+-parseInt(_0x22c59b(0x192))/0x5*(parseInt(_0x22c59b(0x195))/0x6)+-parseInt(_0x22c59b(0x17b))/0x7+parseInt(_0x22c59b(0x182))/0x8*(-parseInt(_0x22c59b(0x199))/0x9)+parseInt(_0x22c59b(0x175))/0xa*(parseInt(_0x22c59b(0x181))/0xb);if(_0x5cd574===_0x509203)break;else _0x14d3ac['push'](_0x14d3ac['shift']());}catch(_0x44a3de){_0x14d3ac['push'](_0x14d3ac['shift']());}}}(a45_0x3d40,0xc0f32));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';import{parseTableReference}from'../utils/table-ref-parser.js';import{DEFAULT_LISTING_LIMIT,resolveLimit}from'../core/constants.js';import{withSpinner}from'../utils/spinner.js';export class TablesCommand extends BaseCommand{[a45_0x5d14d4(0x18b)]=a45_0x5d14d4(0x186);[a45_0x5d14d4(0x17f)]=a45_0x5d14d4(0x18e);async['execute'](_0x1ececa){const _0xbdb12d=a45_0x5d14d4,{options:_0x811b94,args:_0x2d7c2e,tdx:_0x490b5d}=_0x1ececa;let _0x4cd77c;if(_0x2d7c2e[_0xbdb12d(0x179)]===0x0)_0x4cd77c={'database':undefined,'table':undefined,'original':''};else{if(_0x2d7c2e[_0xbdb12d(0x179)]===0x1)try{_0x4cd77c=parseTableReference(_0x2d7c2e[0x0]);if(_0x4cd77c['table']&&!_0x4cd77c[_0xbdb12d(0x18c)]&&!_0x4cd77c[_0xbdb12d(0x183)][_0xbdb12d(0x193)]('*')&&!_0x4cd77c[_0xbdb12d(0x183)][_0xbdb12d(0x193)]('?'))return console['error'](_0xbdb12d(0x184)+_0x2d7c2e[0x0]+_0xbdb12d(0x190)),console[_0xbdb12d(0x172)](_0xbdb12d(0x178)+_0x4cd77c[_0xbdb12d(0x183)]+'\x27?'),console[_0xbdb12d(0x172)](_0xbdb12d(0x19e)+_0x4cd77c['table']+'.*\x22'),console[_0xbdb12d(0x172)](_0xbdb12d(0x173)+_0x4cd77c[_0xbdb12d(0x183)]),console[_0xbdb12d(0x172)](_0xbdb12d(0x194)+_0x4cd77c[_0xbdb12d(0x183)]),console['error'](''),console[_0xbdb12d(0x172)](_0xbdb12d(0x19c)+_0x2d7c2e[0x0]+'\x27\x20without\x20wildcards\x20would\x20search\x20for\x20tables\x20named\x20\x27'+_0x4cd77c[_0xbdb12d(0x183)]+_0xbdb12d(0x188)),0x1;}catch(_0x8180aa){return console[_0xbdb12d(0x172)]('Error:\x20'+_0x8180aa[_0xbdb12d(0x17a)]),0x1;}else return console[_0xbdb12d(0x172)](_0xbdb12d(0x198)),console[_0xbdb12d(0x172)](_0xbdb12d(0x191)),console[_0xbdb12d(0x172)]('\x20\x20tdx\x20tables\x20\x22mydb.*\x22\x20\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb'),console[_0xbdb12d(0x172)](_0xbdb12d(0x170)),console[_0xbdb12d(0x172)]('\x20\x20tdx\x20tables\x20\x22*.user*\x22\x20\x20\x20\x20\x20\x20\x20->\x20tables\x20matching\x20user*\x20across\x20databases'),console[_0xbdb12d(0x172)](_0xbdb12d(0x17e)),console[_0xbdb12d(0x172)]('\x20\x20tdx\x20tables\x20--in\x20mydb\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb'),0x1;}const _0x4714ea=_0x811b94[_0xbdb12d(0x18c)];!_0x4cd77c[_0xbdb12d(0x18c)]&&_0x4714ea&&(_0x4cd77c[_0xbdb12d(0x18c)]=_0x4714ea);try{const _0x47bd2a=_0x44eb3b=>_0x44eb3b&&(_0x44eb3b['includes']('*')||_0x44eb3b[_0xbdb12d(0x193)]('?')),_0x4a249e=_0x47bd2a(_0x4cd77c['database']);_0x811b94['verbose']&&(console[_0xbdb12d(0x172)](_0xbdb12d(0x187)+_0x811b94[_0xbdb12d(0x174)]),_0x4cd77c[_0xbdb12d(0x18c)]?_0x4a249e?console[_0xbdb12d(0x172)](_0xbdb12d(0x19a)+_0x4cd77c[_0xbdb12d(0x18c)]):console['error']('Database:\x20'+_0x4cd77c[_0xbdb12d(0x18c)]):console[_0xbdb12d(0x172)]('Database:\x20all'),_0x4cd77c[_0xbdb12d(0x183)]&&console[_0xbdb12d(0x172)](_0xbdb12d(0x171)+_0x4cd77c['table']));const _0x2f91ee=_0x4cd77c['database']&&!_0x4a249e?_0x4cd77c[_0xbdb12d(0x18c)]:undefined,_0x5441d8=_0x4a249e?_0x4cd77c[_0xbdb12d(0x18c)]:undefined,_0x3c9b73=_0x4cd77c[_0xbdb12d(0x183)],_0x101a59=resolveLimit(_0x811b94[_0xbdb12d(0x177)],DEFAULT_LISTING_LIMIT),_0xdbb0a0=await withSpinner('Listing\x20tables...',()=>_0x490b5d[_0xbdb12d(0x18d)][_0xbdb12d(0x196)](_0x2f91ee,_0x3c9b73,_0x5441d8,_0x101a59),{'verbose':_0x811b94[_0xbdb12d(0x17c)]}),_0x5ad759=_0xdbb0a0['data'];if(_0x5ad759[_0xbdb12d(0x179)]===0x0&&_0x4cd77c[_0xbdb12d(0x18c)]&&!_0x4a249e)return console[_0xbdb12d(0x172)](_0xbdb12d(0x176)),console['error']('Database\x20\x27'+_0x4cd77c[_0xbdb12d(0x18c)]+'\x27\x20may\x20not\x20exist\x20or\x20contains\x20no\x20tables'),0x1;return console[_0xbdb12d(0x172)]('✔\x20Found\x20'+_0x5ad759[_0xbdb12d(0x179)]+_0xbdb12d(0x19d)+(_0x5ad759[_0xbdb12d(0x179)]!==0x1?'s':'')),await handleSDKOutput(_0x5ad759,{..._0x811b94,'limit':_0x101a59}),0x0;}catch(_0x427cff){if(_0x427cff instanceof SDKError)return console[_0xbdb12d(0x172)](_0xbdb12d(0x19b)+_0x427cff[_0xbdb12d(0x17a)]),_0x427cff[_0xbdb12d(0x18a)]&&console[_0xbdb12d(0x172)](_0xbdb12d(0x180)+_0x427cff[_0xbdb12d(0x18a)]),0x1;throw _0x427cff;}}[a45_0x5d14d4(0x197)](_0x19449a){return undefined;}}
@@ -1 +1 @@
1
- const a43_0x23c946=a43_0x548b;(function(_0x568f0b,_0x172ef6){const _0x26cf70=a43_0x548b,_0x30aa9e=_0x568f0b();while(!![]){try{const _0x3f9233=parseInt(_0x26cf70(0xae))/0x1+-parseInt(_0x26cf70(0xb8))/0x2*(-parseInt(_0x26cf70(0xb6))/0x3)+-parseInt(_0x26cf70(0x9f))/0x4*(-parseInt(_0x26cf70(0x9a))/0x5)+parseInt(_0x26cf70(0xa1))/0x6+-parseInt(_0x26cf70(0xa3))/0x7*(-parseInt(_0x26cf70(0x94))/0x8)+parseInt(_0x26cf70(0xba))/0x9*(parseInt(_0x26cf70(0x99))/0xa)+-parseInt(_0x26cf70(0x96))/0xb;if(_0x3f9233===_0x172ef6)break;else _0x30aa9e['push'](_0x30aa9e['shift']());}catch(_0x15c17b){_0x30aa9e['push'](_0x30aa9e['shift']());}}}(a43_0x124a,0xc1392));import{BaseCommand}from'./command.js';function a43_0x548b(_0x4b7086,_0x2236c2){_0x4b7086=_0x4b7086-0x92;const _0x124a68=a43_0x124a();let _0x548b4d=_0x124a68[_0x4b7086];return _0x548b4d;}import{getSessionID,cleanExpiredSessions,clearSessionContextField}from'../core/session.js';import{clearDefaultSiteFromUserConfig,clearActiveProfileFromUserConfig}from'../core/profile.js';import{getConfigDir}from'../core/config.js';import a43_0x2582be from'chalk';import*as a43_0x309d77 from'node:path';function a43_0x124a(){const _0x5092f4=['name','Error:\x20','agent','tdx.json','dim','2221904yWiokt','Clear\x20session-level\x20or\x20default\x20context\x20values','32915245BvhoSk','\x0aRun\x20\x27tdx\x20unset\x20--help\x27\x20for\x20more\x20options','.\x20Must\x20be\x20one\x20of:\x20','40CvTkGf','385yXorhe','default','cleared','Session\x20','engage_workspace','3688LKVkaf','\x20\x20\x20\x20\x20\x20\x20tdx\x20unset\x20--default\x20<resource>\x20\x20#\x20Clear\x20default\x20from\x20config\x0a','3671052QulaVP','description','7jjECDj','profile','Usage:\x20tdx\x20unset\x20<resource>\x0a','Default\x20profile\x20','\x0aResources:\x20site,\x20database,\x20parent_segment,\x20llm_project,\x20agent,\x20profile,\x20engage_workspace\x0a','join','log','parent_segment','(session:\x20','error','Default\x20site\x20','1068687eBNnYN','llm_project','llm_agent','--default\x20can\x20only\x20be\x20used\x20with\x20\x27site\x27\x20or\x20\x27profile\x27.\x20Other\x20resources\x20are\x20session-level\x20only.','includes','session','execute','green','733506KlMxxU','\x0aUpdated:\x20','12UmtliR','length','646794exiglZ','site'];a43_0x124a=function(){return _0x5092f4;};return a43_0x124a();}export class UnsetCommand extends BaseCommand{[a43_0x23c946(0xbc)]='unset';[a43_0x23c946(0xa2)]=a43_0x23c946(0x95);['validate'](_0x51d664){const _0x164a1e=a43_0x23c946,{args:_0x47166e,options:_0x4a682e}=_0x51d664,_0x5681f1=_0x4a682e[_0x164a1e(0x9b)];if(_0x47166e[_0x164a1e(0xb9)]===0x0)return _0x164a1e(0xa5)+_0x164a1e(0xa0)+_0x164a1e(0xa7)+_0x164a1e(0x97);const _0x54f18c=_0x47166e[0x0],_0x967fdb=[_0x164a1e(0xbb),'database',_0x164a1e(0xaa),_0x164a1e(0xaf),_0x164a1e(0xbe),'profile','engage_workspace'];if(!_0x967fdb[_0x164a1e(0xb2)](_0x54f18c))return'Invalid\x20resource:\x20'+_0x54f18c+_0x164a1e(0x98)+_0x967fdb[_0x164a1e(0xa8)](',\x20');if(_0x5681f1&&_0x54f18c!==_0x164a1e(0xbb)&&_0x54f18c!==_0x164a1e(0xa4))return _0x164a1e(0xb1);return undefined;}async[a43_0x23c946(0xb4)](_0x41f6f1){const _0x40a6b4=a43_0x23c946,{args:_0x5e4771,options:_0x48515e}=_0x41f6f1,_0x745491=_0x48515e[_0x40a6b4(0x9b)];cleanExpiredSessions();try{const _0x34508e=_0x5e4771[0x0],_0x41aee9=a43_0x309d77['join'](getConfigDir(),_0x40a6b4(0x92));if(_0x745491){if(_0x34508e==='site')return clearDefaultSiteFromUserConfig(),console['log'](_0x40a6b4(0xad)+a43_0x2582be[_0x40a6b4(0xb5)](_0x40a6b4(0x9c))),console[_0x40a6b4(0xa9)](a43_0x2582be['dim'](_0x40a6b4(0xb7)+_0x41aee9)),0x0;if(_0x34508e===_0x40a6b4(0xa4))return clearActiveProfileFromUserConfig(),console['log'](_0x40a6b4(0xa6)+a43_0x2582be[_0x40a6b4(0xb5)](_0x40a6b4(0x9c))),console['log'](a43_0x2582be[_0x40a6b4(0x93)]('\x0aUpdated:\x20'+_0x41aee9)),0x0;}const _0x96999=getSessionID(_0x48515e[_0x40a6b4(0xb3)]),_0xf0857c={'site':_0x40a6b4(0xbb),'database':'database','parent_segment':'parent_segment','llm_project':_0x40a6b4(0xaf),'agent':_0x40a6b4(0xb0),'profile':'profile','engage_workspace':_0x40a6b4(0x9e)},_0x14ea5f=_0xf0857c[_0x34508e];return _0x14ea5f&&(clearSessionContextField(_0x14ea5f,_0x48515e[_0x40a6b4(0xb3)]),console[_0x40a6b4(0xa9)](_0x40a6b4(0x9d)+_0x34508e+'\x20'+a43_0x2582be[_0x40a6b4(0xb5)]('cleared')+'\x20'+a43_0x2582be['dim'](_0x40a6b4(0xab)+_0x96999+')'))),0x0;}catch(_0x104146){return _0x104146 instanceof Error&&console[_0x40a6b4(0xac)](_0x40a6b4(0xbd)+_0x104146['message']),0x1;}}}
1
+ const a46_0x5d86dd=a46_0x56d4;(function(_0x374003,_0x1cbceb){const _0x590301=a46_0x56d4,_0x61bb91=_0x374003();while(!![]){try{const _0x9a00b2=parseInt(_0x590301(0xba))/0x1*(-parseInt(_0x590301(0xad))/0x2)+parseInt(_0x590301(0xc8))/0x3*(-parseInt(_0x590301(0xc0))/0x4)+parseInt(_0x590301(0xb3))/0x5+parseInt(_0x590301(0xc3))/0x6+parseInt(_0x590301(0xab))/0x7+-parseInt(_0x590301(0xbe))/0x8+-parseInt(_0x590301(0xc5))/0x9;if(_0x9a00b2===_0x1cbceb)break;else _0x61bb91['push'](_0x61bb91['shift']());}catch(_0x2a3848){_0x61bb91['push'](_0x61bb91['shift']());}}}(a46_0x16b2,0xcd69c));function a46_0x16b2(){const _0x494f8e=['Default\x20profile\x20','68DmEGmd','unset','join','7088820iXUFsI','site','4752288TZStoL','engage_workspace','parent_segment','71505LNfkju','llm_agent','Invalid\x20resource:\x20','includes','Session\x20','log','\x0aUpdated:\x20','execute','llm_project','\x20\x20\x20\x20\x20\x20\x20tdx\x20unset\x20--default\x20<resource>\x20\x20#\x20Clear\x20default\x20from\x20config\x0a','Error:\x20','Default\x20site\x20','profile','session','description','6060523hHsGHd','Clear\x20session-level\x20or\x20default\x20context\x20values','2bnqAZi','length','dim','message','\x0aRun\x20\x27tdx\x20unset\x20--help\x27\x20for\x20more\x20options','.\x20Must\x20be\x20one\x20of:\x20','1796265QhxljN','Usage:\x20tdx\x20unset\x20<resource>\x0a','--default\x20can\x20only\x20be\x20used\x20with\x20\x27site\x27\x20or\x20\x27profile\x27.\x20Other\x20resources\x20are\x20session-level\x20only.','name','agent','default','cleared','279332fvtSyM','green','tdx.json','database','2820648CDwaJH'];a46_0x16b2=function(){return _0x494f8e;};return a46_0x16b2();}import{BaseCommand}from'./command.js';import{getSessionID,cleanExpiredSessions,clearSessionContextField}from'../core/session.js';function a46_0x56d4(_0x2ba84f,_0x82ea84){_0x2ba84f=_0x2ba84f-0xa9;const _0x16b20d=a46_0x16b2();let _0x56d4bb=_0x16b20d[_0x2ba84f];return _0x56d4bb;}import{clearDefaultSiteFromUserConfig,clearActiveProfileFromUserConfig}from'../core/profile.js';import{getConfigDir}from'../core/config.js';import a46_0xfa2623 from'chalk';import*as a46_0xc16766 from'node:path';export class UnsetCommand extends BaseCommand{[a46_0x5d86dd(0xb6)]=a46_0x5d86dd(0xc1);[a46_0x5d86dd(0xaa)]=a46_0x5d86dd(0xac);['validate'](_0x24e41b){const _0x139aa6=a46_0x5d86dd,{args:_0x208501,options:_0x493e36}=_0x24e41b,_0x914ddd=_0x493e36['default'];if(_0x208501[_0x139aa6(0xae)]===0x0)return _0x139aa6(0xb4)+_0x139aa6(0xd1)+'\x0aResources:\x20site,\x20database,\x20parent_segment,\x20llm_project,\x20agent,\x20profile,\x20engage_workspace\x0a'+_0x139aa6(0xb1);const _0x1919c8=_0x208501[0x0],_0x1f03e8=['site',_0x139aa6(0xbd),_0x139aa6(0xc7),_0x139aa6(0xd0),_0x139aa6(0xb7),'profile',_0x139aa6(0xc6)];if(!_0x1f03e8[_0x139aa6(0xcb)](_0x1919c8))return _0x139aa6(0xca)+_0x1919c8+_0x139aa6(0xb2)+_0x1f03e8[_0x139aa6(0xc2)](',\x20');if(_0x914ddd&&_0x1919c8!==_0x139aa6(0xc4)&&_0x1919c8!==_0x139aa6(0xd4))return _0x139aa6(0xb5);return undefined;}async[a46_0x5d86dd(0xcf)](_0x1fbbf4){const _0x35c1b2=a46_0x5d86dd,{args:_0x2ad548,options:_0x2031f0}=_0x1fbbf4,_0x36807c=_0x2031f0[_0x35c1b2(0xb8)];cleanExpiredSessions();try{const _0x36934a=_0x2ad548[0x0],_0x5401b3=a46_0xc16766[_0x35c1b2(0xc2)](getConfigDir(),_0x35c1b2(0xbc));if(_0x36807c){if(_0x36934a===_0x35c1b2(0xc4))return clearDefaultSiteFromUserConfig(),console['log'](_0x35c1b2(0xd3)+a46_0xfa2623['green'](_0x35c1b2(0xb9))),console[_0x35c1b2(0xcd)](a46_0xfa2623[_0x35c1b2(0xaf)](_0x35c1b2(0xce)+_0x5401b3)),0x0;if(_0x36934a===_0x35c1b2(0xd4))return clearActiveProfileFromUserConfig(),console[_0x35c1b2(0xcd)](_0x35c1b2(0xbf)+a46_0xfa2623[_0x35c1b2(0xbb)]('cleared')),console[_0x35c1b2(0xcd)](a46_0xfa2623[_0x35c1b2(0xaf)](_0x35c1b2(0xce)+_0x5401b3)),0x0;}const _0x1ec41f=getSessionID(_0x2031f0[_0x35c1b2(0xa9)]),_0x4c6828={'site':_0x35c1b2(0xc4),'database':_0x35c1b2(0xbd),'parent_segment':'parent_segment','llm_project':_0x35c1b2(0xd0),'agent':_0x35c1b2(0xc9),'profile':_0x35c1b2(0xd4),'engage_workspace':'engage_workspace'},_0x3f7688=_0x4c6828[_0x36934a];return _0x3f7688&&(clearSessionContextField(_0x3f7688,_0x2031f0[_0x35c1b2(0xa9)]),console['log'](_0x35c1b2(0xcc)+_0x36934a+'\x20'+a46_0xfa2623[_0x35c1b2(0xbb)](_0x35c1b2(0xb9))+'\x20'+a46_0xfa2623[_0x35c1b2(0xaf)]('(session:\x20'+_0x1ec41f+')'))),0x0;}catch(_0x315f1c){return _0x315f1c instanceof Error&&console['error'](_0x35c1b2(0xd2)+_0x315f1c[_0x35c1b2(0xb0)]),0x1;}}}