@treasuredata/tdx 2026.3.20 → 2026.3.21

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 (223) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.d.ts +1 -1
  4. package/dist/cli-categories.js +1 -1
  5. package/dist/cli-categories.js.map +1 -1
  6. package/dist/cli.d.ts.map +1 -1
  7. package/dist/cli.js +1 -1
  8. package/dist/cli.js.map +1 -1
  9. package/dist/commands/activations.js +1 -1
  10. package/dist/commands/agent-command.js +1 -1
  11. package/dist/commands/agent-test-command.js +1 -1
  12. package/dist/commands/api-command.js +1 -1
  13. package/dist/commands/auth-command.js +1 -1
  14. package/dist/commands/auth-login-command.js +1 -1
  15. package/dist/commands/chat-command.js +1 -1
  16. package/dist/commands/claude-command.js +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-template-pull-command.js +1 -1
  29. package/dist/commands/engage-template-push-command.js +1 -1
  30. package/dist/commands/engage-template-validate-command.js +1 -1
  31. package/dist/commands/job-command.js +1 -1
  32. package/dist/commands/journey-command.js +1 -1
  33. package/dist/commands/journey-validate-command.js +1 -1
  34. package/dist/commands/llm-command.js +1 -1
  35. package/dist/commands/mcp-command.js +1 -1
  36. package/dist/commands/parent-segment-command.js +1 -1
  37. package/dist/commands/policy-command.d.ts +33 -0
  38. package/dist/commands/policy-command.d.ts.map +1 -0
  39. package/dist/commands/policy-command.js +1 -0
  40. package/dist/commands/policy-command.js.map +1 -0
  41. package/dist/commands/profile-command.js +1 -1
  42. package/dist/commands/profiles-command.js +1 -1
  43. package/dist/commands/query-command.js +1 -1
  44. package/dist/commands/schedule-command.js +1 -1
  45. package/dist/commands/segment-command.js +1 -1
  46. package/dist/commands/segment-create-command.js +1 -1
  47. package/dist/commands/segment-fields-command.js +1 -1
  48. package/dist/commands/segment-pull-command.js +1 -1
  49. package/dist/commands/segment-push-command.js +1 -1
  50. package/dist/commands/segment-update-command.js +1 -1
  51. package/dist/commands/segment-use-command.js +1 -1
  52. package/dist/commands/segment-validate-command.js +1 -1
  53. package/dist/commands/segments.js +1 -1
  54. package/dist/commands/show.js +1 -1
  55. package/dist/commands/status-command.js +1 -1
  56. package/dist/commands/tables.js +1 -1
  57. package/dist/commands/unset-command.js +1 -1
  58. package/dist/commands/upgrade-command.js +1 -1
  59. package/dist/commands/use-command.js +1 -1
  60. package/dist/commands/user-command.js +1 -1
  61. package/dist/commands/workflow-command.js +1 -1
  62. package/dist/core/auth.js +1 -1
  63. package/dist/core/command-output.js +1 -1
  64. package/dist/core/config.js +1 -1
  65. package/dist/core/connection-cache.js +1 -1
  66. package/dist/core/constants.js +1 -1
  67. package/dist/core/credential-cache.js +1 -1
  68. package/dist/core/global-context.js +1 -1
  69. package/dist/core/keychain.js +1 -1
  70. package/dist/core/oauth-keychain.js +1 -1
  71. package/dist/core/oauth.js +1 -1
  72. package/dist/core/profile.js +1 -1
  73. package/dist/core/project-config.js +1 -1
  74. package/dist/core/session.js +1 -1
  75. package/dist/core/user-cache.js +1 -1
  76. package/dist/core/version.js +1 -1
  77. package/dist/index.js +1 -1
  78. package/dist/mcp/server.js +1 -1
  79. package/dist/mcp/tools/index.js +1 -1
  80. package/dist/mcp/tools/tdx-run.js +1 -1
  81. package/dist/mcp/tools/tdx-search.js +1 -1
  82. package/dist/mcp/utils.js +1 -1
  83. package/dist/proxy/claude-usage-tracker.js +1 -1
  84. package/dist/proxy/passthrough-server.js +1 -1
  85. package/dist/proxy/sse-usage-parser.js +1 -1
  86. package/dist/sdk/agent/agent-config.js +1 -1
  87. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  88. package/dist/sdk/agent/agent-yaml.js +1 -1
  89. package/dist/sdk/agent/test/evaluator.js +1 -1
  90. package/dist/sdk/agent/test/executor.js +1 -1
  91. package/dist/sdk/agent/test/index.js +1 -1
  92. package/dist/sdk/agent/test/output.js +1 -1
  93. package/dist/sdk/agent/test/parser.js +1 -1
  94. package/dist/sdk/agent/tool-target-registry.js +1 -1
  95. package/dist/sdk/api.js +1 -1
  96. package/dist/sdk/client/cdp-api-client.js +1 -1
  97. package/dist/sdk/client/delivery-api-client.js +1 -1
  98. package/dist/sdk/client/endpoints.js +1 -1
  99. package/dist/sdk/client/engage-api-client.js +1 -1
  100. package/dist/sdk/client/http-client.js +1 -1
  101. package/dist/sdk/client/llm-api-client.js +1 -1
  102. package/dist/sdk/client/oauth-refresh.js +1 -1
  103. package/dist/sdk/client/rate-limiter.js +1 -1
  104. package/dist/sdk/client/td-api-client.js +1 -1
  105. package/dist/sdk/client/trino-api-client.js +1 -1
  106. package/dist/sdk/client/workflow-client.js +1 -1
  107. package/dist/sdk/connection-validator.js +1 -1
  108. package/dist/sdk/connection.js +1 -1
  109. package/dist/sdk/delivery.js +1 -1
  110. package/dist/sdk/engage/campaign-pull.js +1 -1
  111. package/dist/sdk/engage/campaign-push.js +1 -1
  112. package/dist/sdk/engage/campaign-validator.js +1 -1
  113. package/dist/sdk/engage/campaign-yaml.js +1 -1
  114. package/dist/sdk/engage/template-pull.js +1 -1
  115. package/dist/sdk/engage/template-push.js +1 -1
  116. package/dist/sdk/engage/template-validator.js +1 -1
  117. package/dist/sdk/engage/template-yaml.js +1 -1
  118. package/dist/sdk/engage/types/campaign-def.js +1 -1
  119. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  120. package/dist/sdk/engage/types/template-schema.js +1 -1
  121. package/dist/sdk/engage.js +1 -1
  122. package/dist/sdk/errors.js +1 -1
  123. package/dist/sdk/index.d.ts +7 -0
  124. package/dist/sdk/index.d.ts.map +1 -1
  125. package/dist/sdk/index.js +1 -1
  126. package/dist/sdk/index.js.map +1 -1
  127. package/dist/sdk/io/index.js +1 -1
  128. package/dist/sdk/io/node-filesystem.js +1 -1
  129. package/dist/sdk/job.js +1 -1
  130. package/dist/sdk/journey.js +1 -1
  131. package/dist/sdk/llm/chat-cache.js +1 -1
  132. package/dist/sdk/llm/index.js +1 -1
  133. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  134. package/dist/sdk/llm/model-factors.js +1 -1
  135. package/dist/sdk/personalization.js +1 -1
  136. package/dist/sdk/policy.d.ts +41 -0
  137. package/dist/sdk/policy.d.ts.map +1 -0
  138. package/dist/sdk/policy.js +1 -0
  139. package/dist/sdk/policy.js.map +1 -0
  140. package/dist/sdk/query/index.js +1 -1
  141. package/dist/sdk/query/sql-parser.js +1 -1
  142. package/dist/sdk/realtime.js +1 -1
  143. package/dist/sdk/schedule.js +1 -1
  144. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  145. package/dist/sdk/segment/fields-display.js +1 -1
  146. package/dist/sdk/segment/file-discovery.js +1 -1
  147. package/dist/sdk/segment/journey-utils.js +1 -1
  148. package/dist/sdk/segment/journey-validator.js +1 -1
  149. package/dist/sdk/segment/journey-yaml.js +1 -1
  150. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  151. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  152. package/dist/sdk/segment/pull-workflow.js +1 -1
  153. package/dist/sdk/segment/push-recovery.js +1 -1
  154. package/dist/sdk/segment/push-workflow.js +1 -1
  155. package/dist/sdk/segment/resolution-context.js +1 -1
  156. package/dist/sdk/segment/segment-path-parser.js +1 -1
  157. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  158. package/dist/sdk/segment/segment-validator.js +1 -1
  159. package/dist/sdk/segment/target-resolution.js +1 -1
  160. package/dist/sdk/segment/tdx-config.js +1 -1
  161. package/dist/sdk/segment/types/activation-schema.js +1 -1
  162. package/dist/sdk/segment/types/journey-def.js +1 -1
  163. package/dist/sdk/segment/types/journey-schema.js +1 -1
  164. package/dist/sdk/segment/types/segment-def.js +1 -1
  165. package/dist/sdk/segment/types/segment-schema.js +1 -1
  166. package/dist/sdk/segment/validate-files.js +1 -1
  167. package/dist/sdk/segment/yaml-validator.js +1 -1
  168. package/dist/sdk/segment.js +1 -1
  169. package/dist/sdk/types/index.d.ts +1 -0
  170. package/dist/sdk/types/index.d.ts.map +1 -1
  171. package/dist/sdk/types/index.js +1 -1
  172. package/dist/sdk/types/index.js.map +1 -1
  173. package/dist/sdk/types/policy.d.ts +58 -0
  174. package/dist/sdk/types/policy.d.ts.map +1 -0
  175. package/dist/sdk/types/policy.js +1 -0
  176. package/dist/sdk/types/policy.js.map +1 -0
  177. package/dist/sdk/types/progress.js +1 -1
  178. package/dist/sdk/user.js +1 -1
  179. package/dist/sdk/util/format-detector.js +1 -1
  180. package/dist/sdk/util/formatters.js +1 -1
  181. package/dist/sdk/util/index.js +1 -1
  182. package/dist/sdk/util/paginate.js +1 -1
  183. package/dist/sdk/util/tree-formatter.js +1 -1
  184. package/dist/sdk/workflow/archive-validation.js +1 -1
  185. package/dist/sdk/workflow/clone-workflow.js +1 -1
  186. package/dist/sdk/workflow/index.js +1 -1
  187. package/dist/sdk/workflow/pull-workflow.js +1 -1
  188. package/dist/sdk/workflow/push-workflow.js +1 -1
  189. package/dist/sdk/workflow/tdx-config.js +1 -1
  190. package/dist/sdk/workflow/workflow-utils.js +1 -1
  191. package/dist/test-utils/command-runner.js +1 -1
  192. package/dist/test-utils/factories.js +1 -1
  193. package/dist/test-utils/fixtures.js +1 -1
  194. package/dist/test-utils/http-mock.js +1 -1
  195. package/dist/test-utils/index.js +1 -1
  196. package/dist/utils/async.js +1 -1
  197. package/dist/utils/colors.js +1 -1
  198. package/dist/utils/diff.js +1 -1
  199. package/dist/utils/file-permissions.js +1 -1
  200. package/dist/utils/file-reader.js +1 -1
  201. package/dist/utils/github-releases.js +1 -1
  202. package/dist/utils/global-cache.js +1 -1
  203. package/dist/utils/json-loader.js +1 -1
  204. package/dist/utils/local-cache.js +1 -1
  205. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  206. package/dist/utils/logger/formatters/index.js +1 -1
  207. package/dist/utils/logger/handlers/console-handler.js +1 -1
  208. package/dist/utils/logger/handlers/file-handler.js +1 -1
  209. package/dist/utils/logger/handlers/index.js +1 -1
  210. package/dist/utils/logger/handlers/null-handler.js +1 -1
  211. package/dist/utils/logger/index.js +1 -1
  212. package/dist/utils/logger/logger.js +1 -1
  213. package/dist/utils/logger/types.js +1 -1
  214. package/dist/utils/option-validation.js +1 -1
  215. package/dist/utils/process.js +1 -1
  216. package/dist/utils/prompt.js +1 -1
  217. package/dist/utils/spinner.js +1 -1
  218. package/dist/utils/sse-parser.js +1 -1
  219. package/dist/utils/string-utils.js +1 -1
  220. package/dist/utils/table-ref-parser.js +1 -1
  221. package/dist/utils/tdx-logger.js +1 -1
  222. package/dist/utils/version-check.js +1 -1
  223. package/package.json +1 -1
@@ -1 +1 @@
1
- const a39_0x407809=a39_0xcbab;function a39_0xcbab(_0x475088,_0xbc354a){_0x475088=_0x475088-0x19c;const _0x17c9e4=a39_0x17c9();let _0xcbab37=_0x17c9e4[_0x475088];return _0xcbab37;}(function(_0x299faf,_0x4acb0b){const _0x38196b=a39_0xcbab,_0x981383=_0x299faf();while(!![]){try{const _0x98edba=-parseInt(_0x38196b(0x1c0))/0x1*(parseInt(_0x38196b(0x1c9))/0x2)+parseInt(_0x38196b(0x1ba))/0x3*(-parseInt(_0x38196b(0x1f8))/0x4)+-parseInt(_0x38196b(0x1d6))/0x5+-parseInt(_0x38196b(0x1cf))/0x6+-parseInt(_0x38196b(0x1ee))/0x7+-parseInt(_0x38196b(0x1df))/0x8*(-parseInt(_0x38196b(0x1d9))/0x9)+parseInt(_0x38196b(0x235))/0xa;if(_0x98edba===_0x4acb0b)break;else _0x981383['push'](_0x981383['shift']());}catch(_0x179efc){_0x981383['push'](_0x981383['shift']());}}}(a39_0x17c9,0x5c3b2));import{BaseCommand}from'./command.js';function a39_0x17c9(){const _0x48fe92=['toDelete','push','attributes','\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20','Resolving\x20parent\x20segment\x20\x27','Delete\x20journey:','folderId','Error\x20parsing\x20YAML:\x20','Parent\x20segment:\x20','(Journey\x20will\x20be\x20deleted)','repeat','journey','Scoped\x20to\x20folder:\x20','\x20\x20🗺️\x20\x20Journeys:','New\x20segment:','segment\x20or\x20journey','no_parent','.yml','3TcWhaP','segmentFolderId','segments','\x20changed','segment','\x27...','7047gBwfqd','\x20folders\x20to\x20create','results','/e/','relationships','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','\x20to\x20update','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','26VmbGel','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','dryRun','existingSegment','\x20changes?','Site:\x20','147642JhdFqY','parentName','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','Fetching\x20connections\x20for\x20name\x20resolution...','journeys','diff','segment:push','3008050CrWOsI','yes','cyan','171tswzht','green','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','connection','new','nameToType','33032NjFzoA','targetDir','verbose','listActivations','Changes\x20to:','parentSegment','journeyBundleName','\x20YAML\x20files\x20found','\x20updated','join','execute','error','site','blue','/app/ps/','1495592sRJMda','user','\x0a✔\x20Push\x20complete','state','buildUserMaps','\x20created','createdAt','Fetching\x20existing\x20activations...','journeysOnly','folderPath','2678964MeuNJs','isNew','\x20to\x20delete','length','nameToId','Changes\x20to\x20journey:','getOutputSchemaWithCache','created','isScoped','toCreate','file','cwd','\x20\x20Segments:\x20','changed','type','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','endsWith','\x20deleted','updated','scopedFolderPath','\x20\x20\x20\x20','journeyId','toUpdate','getJourney','versionNumber','message','data','red','Delete\x20segment:','idToName','\x20\x20Source:\x20','\x20unchanged','existingJourney','list','\x20activations]','deleted','set','setPhase','Fetching\x20existing\x20data...','\x20\x20📊\x20Segments:','folders','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','name','all','\x0aPush\x20summary\x20for\x20\x27','helpText','journeyBundleId','activations','listSegments','map','yamlConfig','audienceId','\x20new','listJourneysWithDetailsFromParentSegment','description','Preparing\x20journeys...','/sb/da/esr','createdSegmentIds','/j/da/je','Error:\x20Directory\x20not\x20found:\x20','19005520hpgQdl','Push\x20','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','resolveParentId','errorCode','parent_name','New\x20journey:','\x20\x20Activations:\x20','\x0aValidation\x20failed:','.yaml','delete','📁\x20','yellow','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','✔\x20All\x20journeys\x20are\x20up\x20to\x20date','paused','dim','then','updatedAt','get'];a39_0x17c9=function(){return _0x48fe92;};return a39_0x17c9();}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 a39_0x320717 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{[a39_0x407809(0x223)]=a39_0x407809(0x1d5);['description']=a39_0x407809(0x1c7);async[a39_0x407809(0x1e9)](_0x53718f){const _0xe57bcf=a39_0x407809,{options:_0x49774f,args:_0x34c195,tdx:_0x46419}=_0x53718f,_0x565639=_0x49774f,_0x59ff7a=await resolveTarget({'arg':_0x34c195[0x0],'contextParent':_0x49774f[_0xe57bcf(0x1e4)],'cwd':process[_0xe57bcf(0x203)]()});if(!isSuccessfulResolution(_0x59ff7a))return _0x59ff7a[_0xe57bcf(0x239)]===_0xe57bcf(0x1b8)?(console[_0xe57bcf(0x1ea)](a39_0x320717[_0xe57bcf(0x1a0)](_0xe57bcf(0x237))),console[_0xe57bcf(0x1ea)]('Usage:\x20tdx\x20sg\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20(requires\x20context)'),console['error'](_0xe57bcf(0x1c5)),console[_0xe57bcf(0x1ea)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file')):(console[_0xe57bcf(0x1ea)](a39_0x320717[_0xe57bcf(0x214)]('Error:\x20'+_0x59ff7a['message']+'\x0a')),_0x59ff7a[_0xe57bcf(0x226)]&&console['error'](a39_0x320717[_0xe57bcf(0x1d8)](_0x59ff7a[_0xe57bcf(0x226)]))),0x1;if(_0x59ff7a[_0xe57bcf(0x206)]===_0xe57bcf(0x23a))return console[_0xe57bcf(0x1ea)](a39_0x320717[_0xe57bcf(0x214)](_0xe57bcf(0x234)+_0x59ff7a[_0xe57bcf(0x1e0)]+'\x0a')),console[_0xe57bcf(0x1ea)](a39_0x320717['cyan'](_0xe57bcf(0x207))),0x1;const _0x4c47ff=_0x59ff7a[_0xe57bcf(0x1d0)],_0x46313f=_0x59ff7a[_0xe57bcf(0x1e0)],_0x268dc2=_0x59ff7a['type']===_0xe57bcf(0x202)?_0x59ff7a['filePath']:undefined,_0x310d9a=getScopedDetails(_0x59ff7a),_0x3bf1e7=_0x310d9a?.[_0xe57bcf(0x200)]??![],_0x2af325=_0x310d9a?.[_0xe57bcf(0x20c)]??'';if(!existsSync(_0x46313f))return console[_0xe57bcf(0x1ea)](a39_0x320717[_0xe57bcf(0x214)](_0xe57bcf(0x234)+_0x46313f+'\x0a')),console[_0xe57bcf(0x1ea)](a39_0x320717[_0xe57bcf(0x1d8)](_0xe57bcf(0x207))),0x1;_0x565639[_0xe57bcf(0x1e1)]&&(console[_0xe57bcf(0x1ea)](_0xe57bcf(0x1ce)+_0x565639['site']),console[_0xe57bcf(0x1ea)](_0xe57bcf(0x1b0)+_0x4c47ff),console[_0xe57bcf(0x1ea)]('Source\x20directory:\x20'+_0x46313f),_0x3bf1e7&&console[_0xe57bcf(0x1ea)](_0xe57bcf(0x1b4)+_0x2af325));const _0x3fdcd7=await withSpinner(_0xe57bcf(0x1ac)+_0x4c47ff+_0xe57bcf(0x1bf),()=>_0x46419[_0xe57bcf(0x1be)][_0xe57bcf(0x238)](_0x4c47ff),{'verbose':_0x565639['verbose']}),_0x45d092=_0x3fdcd7[_0xe57bcf(0x213)],{parentSegmentResult:_0x73cc84,segmentsResult:_0x443d07,foldersResult:_0x21cab3,journeysWithDetailsResult:_0x366ba0,userMaps:_0x3fd701}=await withSpinner(_0xe57bcf(0x21f),async()=>{const _0x312a2d=_0xe57bcf,[_0x41af3e,_0x435b4d,_0x9205a9,_0x19ea9f,_0x3fc8f3]=await Promise[_0x312a2d(0x224)]([_0x46419[_0x312a2d(0x1be)]['getParent'](_0x45d092),_0x46419[_0x312a2d(0x1be)][_0x312a2d(0x229)](_0x45d092),_0x46419[_0x312a2d(0x1be)]['listFolders'](_0x45d092),_0x46419[_0x312a2d(0x1b3)][_0x312a2d(0x22e)](_0x45d092,{'includeAllVersions':!![]}),_0x46419[_0x312a2d(0x1ef)][_0x312a2d(0x1f2)]()]);return{'parentSegmentResult':_0x41af3e,'segmentsResult':_0x435b4d,'foldersResult':_0x9205a9,'journeysWithDetailsResult':_0x19ea9f,'userMaps':_0x3fc8f3};},{'verbose':_0x565639[_0xe57bcf(0x1e1)]})['then'](_0xe3df22=>_0xe3df22[_0xe57bcf(0x213)]),_0x2de7f2=_0x73cc84,_0x1a7416=extractRootFolderId(_0x2de7f2),_0x3e79e8=_0x443d07,_0x5c896b=_0x21cab3,{journeys:_0x42a06f,activationStepsById:_0x3887f2}=_0x366ba0,_0x2e240f=new Map(_0x42a06f['map'](_0x5086e5=>[_0x5086e5['id'],_0x5086e5])),_0x2e4f42=_0x42a06f[_0xe57bcf(0x22a)](_0x29046d=>({'id':_0x29046d['id'],'name':_0x29046d[_0xe57bcf(0x1aa)]['name'],'journeyBundleName':_0x29046d[_0xe57bcf(0x1aa)][_0xe57bcf(0x1e5)]||'','journeyBundleId':_0x29046d[_0xe57bcf(0x1aa)][_0xe57bcf(0x227)]||'','versionNumber':_0x29046d[_0xe57bcf(0x1aa)][_0xe57bcf(0x211)],'description':_0x29046d['attributes'][_0xe57bcf(0x22f)],'state':_0x29046d[_0xe57bcf(0x1aa)][_0xe57bcf(0x1f1)],'paused':_0x29046d['attributes'][_0xe57bcf(0x1a3)],'audienceId':_0x29046d['attributes'][_0xe57bcf(0x22c)],'folderId':_0x29046d[_0xe57bcf(0x1c4)]?.['parentFolder']?.[_0xe57bcf(0x213)]?.['id'],'createdAt':_0x29046d[_0xe57bcf(0x1aa)][_0xe57bcf(0x1f4)],'updatedAt':_0x29046d[_0xe57bcf(0x1aa)][_0xe57bcf(0x1a6)]})),{emailToId:_0x104eb4,idToEmail:_0x5a9b61}=_0x3fd701,_0xa9a82f=await withSpinner(_0xe57bcf(0x1d2),async()=>{const _0x38af27=_0xe57bcf,_0x4af08c=await _0x46419[_0x38af27(0x1dc)][_0x38af27(0x21a)]();return buildConnectionMaps(_0x4af08c);},{'verbose':_0x565639[_0xe57bcf(0x1e1)]})[_0xe57bcf(0x1a5)](_0x37ab40=>_0x37ab40[_0xe57bcf(0x213)]),_0x4e3582=_0xa9a82f['nameToId'],_0x818ea6=_0xa9a82f[_0xe57bcf(0x216)],_0x5d85a5=_0xa9a82f[_0xe57bcf(0x1de)],_0x33affa={'emailToIdMap':_0x104eb4,'connectionNameToIdMap':_0x4e3582,'connectionNameToTypeMap':_0x5d85a5,'getSchema':_0x230650=>_0x46419[_0xe57bcf(0x1dc)][_0xe57bcf(0x1fe)](_0x230650)};let {pathToId:_0x5e96ef,idToPath:_0x5ac8d8}=buildFolderMaps(_0x5c896b);const _0xea3b79=buildSegmentLookupMap(_0x3e79e8,_0x5ac8d8),_0x1157f7=buildSegmentNameToIdMap(_0x3e79e8),_0x3b887a=buildJourneyBundleLookupMap(_0x2e4f42,_0x5ac8d8);let _0x5e7bca;if(_0x268dc2){if(!_0x268dc2[_0xe57bcf(0x209)](_0xe57bcf(0x1b9))&&!_0x268dc2[_0xe57bcf(0x209)](_0xe57bcf(0x19d)))return console[_0xe57bcf(0x1ea)](a39_0x320717[_0xe57bcf(0x214)](_0xe57bcf(0x1ca)+_0x268dc2+'\x0a')),0x1;_0x5e7bca=[_0x268dc2];}else _0x5e7bca=findYamlFiles(_0x46313f);if(_0x5e7bca[_0xe57bcf(0x1fb)]===0x0)return console[_0xe57bcf(0x1ea)](a39_0x320717['red'](_0xe57bcf(0x1d1)+_0x46313f+'\x0a')),console[_0xe57bcf(0x1ea)](a39_0x320717[_0xe57bcf(0x1d8)]('Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files')),0x1;let _0x41c3f2,_0x16fffe;try{const _0x243eb7=parseAndClassifyYamlFiles(_0x5e7bca,_0x46313f,{'skipSegments':_0x565639[_0xe57bcf(0x1f6)]});_0x41c3f2=_0x243eb7[_0xe57bcf(0x1bc)],_0x16fffe=_0x243eb7[_0xe57bcf(0x1d3)];const _0x20c9ef=validateParsedFiles(_0x243eb7,_0x46313f);if(_0x20c9ef[_0xe57bcf(0x1fb)]>0x0)return console[_0xe57bcf(0x1ea)](a39_0x320717['red'](_0xe57bcf(0x19c))),console[_0xe57bcf(0x1ea)](formatValidationErrors(_0x20c9ef)),console[_0xe57bcf(0x1ea)](a39_0x320717[_0xe57bcf(0x1a0)](_0xe57bcf(0x1db))),0x1;}catch(_0x4c81b6){return console[_0xe57bcf(0x1ea)](a39_0x320717[_0xe57bcf(0x214)](_0xe57bcf(0x1af)+(_0x4c81b6 instanceof Error?_0x4c81b6[_0xe57bcf(0x212)]:_0x4c81b6))),0x1;}if(_0x41c3f2[_0xe57bcf(0x1fb)]===0x0&&_0x16fffe[_0xe57bcf(0x1fb)]===0x0){const _0x5f241b=_0x565639[_0xe57bcf(0x1f6)]?'journey':_0xe57bcf(0x1b7);return console['error'](a39_0x320717[_0xe57bcf(0x1a0)]('No\x20'+_0x5f241b+_0xe57bcf(0x1e6))),0x0;}const _0x9a66d2=new Map();_0x3e79e8[_0xe57bcf(0x1fb)]>0x0&&!_0x565639[_0xe57bcf(0x1f6)]&&await withSpinner(_0xe57bcf(0x1f5),async()=>{await batchAsync(_0x3e79e8,async _0x231104=>{const _0x51dd39=a39_0xcbab,_0x3d7e7d=await _0x46419['segment'][_0x51dd39(0x1e2)](_0x45d092,_0x231104['id']);_0x9a66d2['set'](_0x231104['id'],_0x3d7e7d);});},{'verbose':_0x565639[_0xe57bcf(0x1e1)]});const {segmentFiles:_0x10b2e0,foldersToCreate:_0x57defc}=await prepareSegmentFiles(_0x41c3f2,{'segmentByFolderAndName':_0xea3b79,'activationsBySegmentId':_0x9a66d2,'folderPathToId':_0x5e96ef,'idToEmailMap':_0x5a9b61,'connectionIdToNameMap':_0x818ea6},_0x33affa,_0x3bf1e7,_0x2af325),_0x30f092=_0x268dc2?[]:findSegmentsToDelete(_0x3e79e8,_0x41c3f2[_0xe57bcf(0x22a)](({yamlConfig:_0x218c32,folderPath:_0x5e04bf})=>({'yamlConfig':_0x218c32,'folderPath':resolveTDFolderPath(_0x5e04bf,_0x3bf1e7,_0x2af325)})),_0x5ac8d8,_0x2af325,_0x3bf1e7),{journeyFiles:_0x41e325,foldersToCreate:_0x1b3994}=await withProgressSpinner(_0xe57bcf(0x230),async _0x4bdfbf=>prepareJourneyFiles(_0x16fffe,{'fetchJourney':async _0x3696eb=>_0x46419[_0xe57bcf(0x1b3)][_0xe57bcf(0x210)](_0x3696eb[_0xe57bcf(0x20e)]),'journeyBundlesByFolderAndName':_0x3b887a,'folderPathToId':_0x5e96ef,'idToEmailMap':_0x5a9b61,'connectionIdToNameMap':_0x818ea6,'existingSegments':_0x3e79e8,'parentId':_0x45d092,'deps':_0x46419,'progress':{'update':_0x13950b=>{const _0x6c338d=_0xe57bcf;_0x4bdfbf[_0x6c338d(0x21e)](_0x13950b),_0x565639[_0x6c338d(0x1e1)]&&console[_0x6c338d(0x1ea)]('\x20\x20'+_0x13950b);}},'journeyById':_0x2e240f,'activationStepsById':_0x3887f2},_0x3bf1e7,_0x2af325),{'verbose':_0x565639[_0xe57bcf(0x1e1)]})[_0xe57bcf(0x1a5)](_0x300ba1=>_0x300ba1[_0xe57bcf(0x213)]);for(const _0x4b0af7 of _0x1b3994){_0x57defc['add'](_0x4b0af7);}const _0x3d3fa1=_0x268dc2?[]:findJourneysToDelete(_0x2e4f42,_0x16fffe[_0xe57bcf(0x22a)](({yamlConfig:_0x5984f2,folderPath:_0x38ac33})=>({'yamlConfig':_0x5984f2,'folderPath':resolveTDFolderPath(_0x38ac33,_0x3bf1e7,_0x2af325)})),_0x5ac8d8,_0x2af325,_0x3bf1e7),_0xfd06fd=calculatePushStats(_0x10b2e0,_0x41e325,_0x57defc,_0x30f092,_0x3d3fa1,!!_0x565639[_0xe57bcf(0x19e)],!!_0x565639[_0xe57bcf(0x1f6)]),_0x292cbe=_0xfd06fd['segments'][_0xe57bcf(0x1dd)],_0x5ebd28=_0xfd06fd[_0xe57bcf(0x1bc)][_0xe57bcf(0x205)],_0x58fc29=_0xfd06fd[_0xe57bcf(0x1bc)]['unchanged'],_0xf94c0b=_0xfd06fd[_0xe57bcf(0x1bc)][_0xe57bcf(0x1a8)],_0x25d0f2=_0xfd06fd[_0xe57bcf(0x221)][_0xe57bcf(0x201)],_0x250d7b=_0xfd06fd[_0xe57bcf(0x1d3)][_0xe57bcf(0x1dd)],_0x3e15d3=_0xfd06fd[_0xe57bcf(0x1d3)]['changed'],_0x550c81=_0xfd06fd[_0xe57bcf(0x1d3)]['unchanged'],_0x18b3bc=_0xfd06fd[_0xe57bcf(0x1d3)][_0xe57bcf(0x1a8)],_0x58a7ec=_0xfd06fd[_0xe57bcf(0x228)][_0xe57bcf(0x224)],_0x554f41=_0xfd06fd['activations']['toCreate'],_0x4fca37=_0xfd06fd[_0xe57bcf(0x228)][_0xe57bcf(0x20f)],_0x57c0ba=_0xfd06fd[_0xe57bcf(0x228)][_0xe57bcf(0x1a8)];console[_0xe57bcf(0x1ea)](_0xe57bcf(0x225)+_0x4c47ff+'\x27:');_0x25d0f2['length']>0x0&&console['error']('\x20\x20'+a39_0x320717[_0xe57bcf(0x1ec)](_0xe57bcf(0x19f)+_0x25d0f2[_0xe57bcf(0x1fb)]+_0xe57bcf(0x1c1)));if(!_0x565639[_0xe57bcf(0x1f6)]){console[_0xe57bcf(0x1ea)](_0xe57bcf(0x220)),console[_0xe57bcf(0x1ea)](_0xe57bcf(0x20d)+a39_0x320717[_0xe57bcf(0x1da)]('+\x20'+_0x292cbe['length']+_0xe57bcf(0x22d))),console['error'](_0xe57bcf(0x20d)+a39_0x320717[_0xe57bcf(0x1a0)]('~\x20'+_0x5ebd28['length']+'\x20changed'));if(_0xf94c0b['length']>0x0)console[_0xe57bcf(0x1ea)](_0xe57bcf(0x20d)+a39_0x320717[_0xe57bcf(0x214)]('-\x20'+_0xf94c0b[_0xe57bcf(0x1fb)]+'\x20to\x20delete'));else _0x30f092[_0xe57bcf(0x1fb)]>0x0&&!_0x565639['delete']&&console[_0xe57bcf(0x1ea)]('\x20\x20\x20\x20'+a39_0x320717[_0xe57bcf(0x1a4)](_0x30f092[_0xe57bcf(0x1fb)]+'\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)'));console[_0xe57bcf(0x1ea)](_0xe57bcf(0x20d)+a39_0x320717['dim']('=\x20'+_0x58fc29[_0xe57bcf(0x1fb)]+_0xe57bcf(0x218)));}if(_0x41e325['length']>0x0||_0x3d3fa1[_0xe57bcf(0x1fb)]>0x0){console[_0xe57bcf(0x1ea)](_0xe57bcf(0x1b5)),console[_0xe57bcf(0x1ea)](_0xe57bcf(0x20d)+a39_0x320717['green']('+\x20'+_0x250d7b[_0xe57bcf(0x1fb)]+_0xe57bcf(0x22d))),console[_0xe57bcf(0x1ea)](_0xe57bcf(0x20d)+a39_0x320717[_0xe57bcf(0x1a0)]('~\x20'+_0x3e15d3[_0xe57bcf(0x1fb)]+_0xe57bcf(0x1bd)));if(_0x18b3bc[_0xe57bcf(0x1fb)]>0x0)console['error'](_0xe57bcf(0x20d)+a39_0x320717[_0xe57bcf(0x214)]('-\x20'+_0x18b3bc[_0xe57bcf(0x1fb)]+'\x20to\x20delete'));else _0x3d3fa1['length']>0x0&&!_0x565639[_0xe57bcf(0x19e)]&&console[_0xe57bcf(0x1ea)](_0xe57bcf(0x20d)+a39_0x320717[_0xe57bcf(0x1a4)](_0x3d3fa1[_0xe57bcf(0x1fb)]+_0xe57bcf(0x1a1)));console[_0xe57bcf(0x1ea)](_0xe57bcf(0x20d)+a39_0x320717[_0xe57bcf(0x1a4)]('=\x20'+_0x550c81['length']+_0xe57bcf(0x218)));}_0x58a7ec['length']>0x0&&!_0x565639['journeysOnly']&&(console[_0xe57bcf(0x1ea)](''),console['error']('\x20\x20Activations:'),_0x554f41[_0xe57bcf(0x1fb)]>0x0&&console[_0xe57bcf(0x1ea)](_0xe57bcf(0x20d)+a39_0x320717[_0xe57bcf(0x1da)]('+\x20'+_0x554f41['length']+'\x20to\x20create')),_0x4fca37['length']>0x0&&console['error'](_0xe57bcf(0x20d)+a39_0x320717['yellow']('~\x20'+_0x4fca37[_0xe57bcf(0x1fb)]+_0xe57bcf(0x1c6))),_0x57c0ba['length']>0x0&&console[_0xe57bcf(0x1ea)]('\x20\x20\x20\x20'+a39_0x320717[_0xe57bcf(0x214)]('-\x20'+_0x57c0ba[_0xe57bcf(0x1fb)]+_0xe57bcf(0x1fa))));console['error'](_0xe57bcf(0x217)+a39_0x320717[_0xe57bcf(0x1d8)](_0x46313f)+'\x0a');if(_0x25d0f2[_0xe57bcf(0x1fb)]>0x0){console[_0xe57bcf(0x1ea)]('Folders\x20to\x20create:');for(const _0x11c217 of _0x25d0f2){console[_0xe57bcf(0x1ea)]('\x20\x20'+a39_0x320717[_0xe57bcf(0x1ec)]('+')+'\x20'+_0x11c217);}console[_0xe57bcf(0x1ea)]('');}if(_0x292cbe['length']>0x0&&!_0x565639[_0xe57bcf(0x1f6)])for(const _0x38578e of _0x292cbe){const _0x403589=_0x38578e[_0xe57bcf(0x1f7)]?_0x38578e[_0xe57bcf(0x1f7)]+'/'+_0x38578e[_0xe57bcf(0x22b)][_0xe57bcf(0x223)]:_0x38578e[_0xe57bcf(0x22b)]['name'],_0x5afa43=_0x38578e[_0xe57bcf(0x22b)][_0xe57bcf(0x228)]?.['length']||0x0,_0x22c922=_0x5afa43>0x0?a39_0x320717['dim']('\x20['+_0x5afa43+_0xe57bcf(0x21b)):'';console[_0xe57bcf(0x1ea)]('\x0a'+a39_0x320717[_0xe57bcf(0x1da)](_0xe57bcf(0x1b6))+'\x20'+_0x403589+_0x22c922),console[_0xe57bcf(0x1ea)]('─'[_0xe57bcf(0x1b2)](0x3c)),_0x38578e[_0xe57bcf(0x1d4)]&&console['error'](_0x38578e[_0xe57bcf(0x1d4)]),console['error']('─'[_0xe57bcf(0x1b2)](0x3c));}if(_0xf94c0b['length']>0x0&&!_0x565639[_0xe57bcf(0x1f6)])for(const _0x2b036e of _0xf94c0b){const _0x9436e6=_0x2b036e['segmentFolderId']?_0x5ac8d8['get'](_0x2b036e[_0xe57bcf(0x1bb)]['toString']())||'':'',_0x2e5d12=_0x9436e6?_0x9436e6+'/'+_0x2b036e[_0xe57bcf(0x223)]:_0x2b036e[_0xe57bcf(0x223)],_0x1cec9a=_0x9a66d2[_0xe57bcf(0x1a7)](_0x2b036e['id'])||[],_0x120618=_0x1cec9a['length']>0x0?a39_0x320717[_0xe57bcf(0x1a4)]('\x20['+_0x1cec9a['length']+_0xe57bcf(0x21b)):'';console[_0xe57bcf(0x1ea)]('\x0a'+a39_0x320717[_0xe57bcf(0x214)](_0xe57bcf(0x215))+'\x20'+_0x2e5d12+_0x120618),console['error']('─'[_0xe57bcf(0x1b2)](0x3c));const _0x20ad6a=segmentWithActivationsToYaml(_0x2b036e,_0x1cec9a,undefined,_0x5a9b61,_0x818ea6),_0x34ee9d=segmentToYamlString(_0x20ad6a),_0x24b763=generateDiff(_0x34ee9d,'');console[_0xe57bcf(0x1ea)](formatDiffWithColors(_0x24b763)),console[_0xe57bcf(0x1ea)]('─'[_0xe57bcf(0x1b2)](0x3c));}const _0x2acfcb=_0x10b2e0['filter'](_0x5d0879=>!_0x5d0879[_0xe57bcf(0x1f9)]&&_0x5d0879['diff']);if(_0x2acfcb[_0xe57bcf(0x1fb)]>0x0&&!_0x565639[_0xe57bcf(0x1f6)])for(const _0x444c85 of _0x2acfcb){const _0x16a1e7=_0x444c85[_0xe57bcf(0x1f7)]?_0x444c85[_0xe57bcf(0x1f7)]+'/'+_0x444c85[_0xe57bcf(0x22b)]['name']:_0x444c85[_0xe57bcf(0x22b)][_0xe57bcf(0x223)];console['error']('\x0a'+a39_0x320717['yellow'](_0xe57bcf(0x1e3))+'\x20'+_0x16a1e7),console['error']('─'[_0xe57bcf(0x1b2)](0x3c)),console[_0xe57bcf(0x1ea)](_0x444c85[_0xe57bcf(0x1d4)]),console[_0xe57bcf(0x1ea)]('─'[_0xe57bcf(0x1b2)](0x3c));}if(_0x250d7b[_0xe57bcf(0x1fb)]>0x0)for(const _0x5281d1 of _0x250d7b){const _0x2c56cc=_0x5281d1[_0xe57bcf(0x1f7)]?_0x5281d1[_0xe57bcf(0x1f7)]+'/'+_0x5281d1[_0xe57bcf(0x22b)][_0xe57bcf(0x223)]:_0x5281d1['yamlConfig'][_0xe57bcf(0x223)];console[_0xe57bcf(0x1ea)]('\x0a'+a39_0x320717['green'](_0xe57bcf(0x23b))+'\x20'+_0x2c56cc),console['error']('─'[_0xe57bcf(0x1b2)](0x3c)),_0x5281d1['diff']&&console[_0xe57bcf(0x1ea)](_0x5281d1['diff']),console[_0xe57bcf(0x1ea)]('─'[_0xe57bcf(0x1b2)](0x3c));}const _0x2e8188=_0x41e325['filter'](_0x1291dc=>!_0x1291dc['isNew']&&_0x1291dc[_0xe57bcf(0x1d4)]);if(_0x2e8188[_0xe57bcf(0x1fb)]>0x0)for(const _0x15dea2 of _0x2e8188){const _0x24bc4a=_0x15dea2[_0xe57bcf(0x1f7)]?_0x15dea2[_0xe57bcf(0x1f7)]+'/'+_0x15dea2[_0xe57bcf(0x22b)][_0xe57bcf(0x223)]:_0x15dea2[_0xe57bcf(0x22b)][_0xe57bcf(0x223)];console[_0xe57bcf(0x1ea)]('\x0a'+a39_0x320717[_0xe57bcf(0x1a0)](_0xe57bcf(0x1fd))+'\x20'+_0x24bc4a),console[_0xe57bcf(0x1ea)]('─'[_0xe57bcf(0x1b2)](0x3c)),console[_0xe57bcf(0x1ea)](_0x15dea2[_0xe57bcf(0x1d4)]),console[_0xe57bcf(0x1ea)]('─'['repeat'](0x3c));}if(_0x18b3bc[_0xe57bcf(0x1fb)]>0x0)for(const _0x106b7b of _0x18b3bc){const _0x388095=_0x106b7b[_0xe57bcf(0x1ae)]?_0x5ac8d8[_0xe57bcf(0x1a7)](_0x106b7b[_0xe57bcf(0x1ae)])||'':'',_0x3d1f00=_0x388095?_0x388095+'/'+_0x106b7b[_0xe57bcf(0x1e5)]:_0x106b7b[_0xe57bcf(0x1e5)];console[_0xe57bcf(0x1ea)]('\x0a'+a39_0x320717[_0xe57bcf(0x214)](_0xe57bcf(0x1ad))+'\x20'+_0x3d1f00),console[_0xe57bcf(0x1ea)]('─'['repeat'](0x3c)),console[_0xe57bcf(0x1ea)](a39_0x320717[_0xe57bcf(0x214)](_0xe57bcf(0x1b1))),console[_0xe57bcf(0x1ea)]('─'[_0xe57bcf(0x1b2)](0x3c));}if(_0x565639[_0xe57bcf(0x1cb)])return console[_0xe57bcf(0x1ea)](a39_0x320717[_0xe57bcf(0x1a0)](_0xe57bcf(0x222))),0x0;const _0x2a1de3=_0x565639[_0xe57bcf(0x1f6)]?![]:_0x292cbe[_0xe57bcf(0x1fb)]>0x0||_0x5ebd28[_0xe57bcf(0x1fb)]>0x0||_0xf94c0b[_0xe57bcf(0x1fb)]>0x0,_0x340381=_0x250d7b[_0xe57bcf(0x1fb)]>0x0||_0x3e15d3[_0xe57bcf(0x1fb)]>0x0||_0x18b3bc[_0xe57bcf(0x1fb)]>0x0,_0xad1e67=_0x565639[_0xe57bcf(0x1f6)]?![]:_0x58a7ec[_0xe57bcf(0x1fb)]>0x0,_0x2419c9=_0x25d0f2['length']>0x0;if(!_0x2a1de3&&!_0x340381&&!_0xad1e67&&!_0x2419c9){const _0x33d990=_0x565639[_0xe57bcf(0x1f6)]?_0xe57bcf(0x1a2):'✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date';console[_0xe57bcf(0x1ea)](a39_0x320717[_0xe57bcf(0x1da)](_0x33d990));if(_0x268dc2&&_0x58fc29['length']===0x1){const _0x4f4319=_0x58fc29[0x0];if(_0x4f4319[_0xe57bcf(0x1cc)]?.['id']){const _0x26203e=getConsoleNextUrl(_0x565639[_0xe57bcf(0x1eb)],_0xe57bcf(0x1ed)+_0x45d092+_0xe57bcf(0x1c3)+_0x4f4319[_0xe57bcf(0x1cc)]['id']+_0xe57bcf(0x231));console[_0xe57bcf(0x1ea)](_0xe57bcf(0x1ab)+a39_0x320717[_0xe57bcf(0x1d8)](_0x26203e));}}if(_0x268dc2&&_0x550c81[_0xe57bcf(0x1fb)]===0x1){const _0x36dca7=_0x550c81[0x0];if(_0x36dca7[_0xe57bcf(0x219)]?.['id']){const _0x3aa730=getConsoleNextUrl(_0x565639[_0xe57bcf(0x1eb)],'/app/ps/'+_0x45d092+_0xe57bcf(0x1c3)+_0x36dca7[_0xe57bcf(0x219)]['id']+'/j/da/je');console[_0xe57bcf(0x1ea)]('\x20\x20'+a39_0x320717[_0xe57bcf(0x1d8)](_0x3aa730));}}return 0x0;}const _0x645e2e=_0x565639[_0xe57bcf(0x1f6)]?_0x250d7b[_0xe57bcf(0x1fb)]+_0x3e15d3[_0xe57bcf(0x1fb)]+_0x18b3bc[_0xe57bcf(0x1fb)]+_0x25d0f2[_0xe57bcf(0x1fb)]:_0x292cbe[_0xe57bcf(0x1fb)]+_0x5ebd28[_0xe57bcf(0x1fb)]+_0xf94c0b[_0xe57bcf(0x1fb)]+_0x250d7b[_0xe57bcf(0x1fb)]+_0x3e15d3[_0xe57bcf(0x1fb)]+_0x18b3bc['length']+_0x25d0f2[_0xe57bcf(0x1fb)]+_0x58a7ec[_0xe57bcf(0x1fb)];if(!_0x565639[_0xe57bcf(0x1d7)]&&_0x645e2e>0x0){if(!isInteractive())return console[_0xe57bcf(0x1ea)](a39_0x320717[_0xe57bcf(0x214)]('\x0aError:'),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0xe57bcf(0x1ea)](a39_0x320717[_0xe57bcf(0x1a4)](_0xe57bcf(0x208))),0x1;const _0x26298d=await confirmKey(_0xe57bcf(0x236)+_0x645e2e+_0xe57bcf(0x1cd));if(!_0x26298d)return console[_0xe57bcf(0x1ea)](a39_0x320717[_0xe57bcf(0x1a0)]('Aborted.')),0x1;}const _0x4b75fe={'withProgress':async(_0x31a580,_0x1eeb10)=>{const _0x314942=_0xe57bcf,_0x1bb4bb=await withSpinner(_0x31a580,_0x1eeb10,{'verbose':_0x565639['verbose']});return{'data':_0x1bb4bb[_0x314942(0x213)]};},'logInfo':_0x5d28c3=>console[_0xe57bcf(0x1ea)](a39_0x320717[_0xe57bcf(0x1ec)]('✔\x20'+_0x5d28c3)),'logSuccess':_0x48b87b=>console[_0xe57bcf(0x1ea)](a39_0x320717['green']('✔\x20'+_0x48b87b)),'logWarning':_0x169020=>console[_0xe57bcf(0x1ea)](a39_0x320717['yellow']('⚠\x20'+_0x169020)),'logDeleted':_0x113156=>console['error'](a39_0x320717[_0xe57bcf(0x214)]('✔\x20'+_0x113156))},_0x2468f9={'segment':_0x46419['segment'],'journey':_0x46419[_0xe57bcf(0x1b3)],'user':_0x46419[_0xe57bcf(0x1ef)],'connection':_0x46419[_0xe57bcf(0x1dc)]};_0x25d0f2[_0xe57bcf(0x1fb)]>0x0&&(_0x5e96ef=await executePushFolders(_0x2468f9,_0x25d0f2,_0x5e96ef,{'parentId':_0x45d092},_0x4b75fe));const _0x4a63eb={'rootFolderId':_0x1a7416,'folderPathToId':_0x5e96ef,'folderIdToPath':_0x5ac8d8,'segmentNameToId':_0x1157f7,'activationsBySegmentId':_0x9a66d2,'emailToIdMap':_0x104eb4,'idToEmailMap':_0x5a9b61,'connectionNameToIdMap':_0xa9a82f[_0xe57bcf(0x1fc)],'connectionIdToNameMap':_0xa9a82f[_0xe57bcf(0x216)],'connectionNameToTypeMap':_0x5d85a5},_0x2a1e9d=await executePushSegments(_0x2468f9,_0x565639[_0xe57bcf(0x1f6)]?[]:_0x10b2e0,_0x4a63eb,{'parentId':_0x45d092},_0x4b75fe),_0x3ff1f1=_0x2a1e9d[_0xe57bcf(0x1ff)],_0x314e91=_0x2a1e9d[_0xe57bcf(0x20b)],_0x58cc3c=_0x2a1e9d[_0xe57bcf(0x228)][_0xe57bcf(0x1ff)],_0xba49fe=_0x2a1e9d['activations']['updated'],_0x205433=_0x2a1e9d[_0xe57bcf(0x228)][_0xe57bcf(0x21c)];let _0x5a1adf;if(_0x268dc2&&_0x10b2e0[_0xe57bcf(0x1fb)]===0x1){const _0x5d4f0d=_0x10b2e0[0x0];_0x5a1adf=_0x5d4f0d[_0xe57bcf(0x1cc)]?.['id']??_0x2a1e9d[_0xe57bcf(0x232)]['get'](_0x5d4f0d['yamlConfig'][_0xe57bcf(0x223)]);}const _0x15ea72=await executePushSegmentDeletions(_0x2468f9,_0x565639[_0xe57bcf(0x1f6)]?[]:_0xf94c0b,_0x4b75fe);let _0x40e9cd=0x0,_0xf54358=0x0,_0x24cc24=0x0;const _0x224435=new Map(_0x1157f7);for(const [_0x4e6a46,_0x1429be]of _0x2a1e9d['createdSegmentIds']){_0x224435[_0xe57bcf(0x21d)](_0x4e6a46,_0x1429be);}if(_0x41e325['length']>0x0){const _0x1e143f={..._0x4a63eb,'segmentNameToId':_0x224435,'existingSegments':_0x3e79e8,'activationContext':_0x33affa},_0x37b452=await executePushJourneys(_0x2468f9,_0x41e325,_0x1e143f,{'parentId':_0x45d092,'rootFolderId':_0x1a7416,'verbose':_0x565639[_0xe57bcf(0x1e1)]},_0x4b75fe);_0x40e9cd=_0x37b452[_0xe57bcf(0x1ff)],_0xf54358=_0x37b452[_0xe57bcf(0x20b)];if(_0x268dc2&&_0x37b452[_0xe57bcf(0x1c2)][_0xe57bcf(0x1fb)]===0x1){const _0x4b8bd8=_0x37b452[_0xe57bcf(0x1c2)][0x0];if(_0x4b8bd8['journeyId']){const _0x135770=getConsoleNextUrl(_0x565639[_0xe57bcf(0x1eb)],_0xe57bcf(0x1ed)+_0x45d092+_0xe57bcf(0x1c3)+_0x4b8bd8[_0xe57bcf(0x20e)]+_0xe57bcf(0x233));console[_0xe57bcf(0x1ea)]('\x20\x20'+a39_0x320717[_0xe57bcf(0x1d8)](_0x135770));}}}for(const _0x548baa of _0x18b3bc){console['error'](a39_0x320717[_0xe57bcf(0x1a0)](_0xe57bcf(0x1c8)+_0x548baa[_0xe57bcf(0x1e5)])),_0x24cc24++;}const _0x4f6adc=[];if(_0x3ff1f1>0x0)_0x4f6adc[_0xe57bcf(0x1a9)](_0x3ff1f1+_0xe57bcf(0x1f3));if(_0x314e91>0x0)_0x4f6adc[_0xe57bcf(0x1a9)](_0x314e91+'\x20updated');if(_0x15ea72>0x0)_0x4f6adc[_0xe57bcf(0x1a9)](_0x15ea72+_0xe57bcf(0x20a));const _0x35e08e=[];if(_0x40e9cd>0x0)_0x35e08e[_0xe57bcf(0x1a9)](_0x40e9cd+'\x20created');if(_0xf54358>0x0)_0x35e08e[_0xe57bcf(0x1a9)](_0xf54358+_0xe57bcf(0x1e7));if(_0x24cc24>0x0)_0x35e08e[_0xe57bcf(0x1a9)](_0x24cc24+'\x20deleted');const _0x43769f=[];if(_0x58cc3c>0x0)_0x43769f[_0xe57bcf(0x1a9)](_0x58cc3c+_0xe57bcf(0x1f3));if(_0xba49fe>0x0)_0x43769f[_0xe57bcf(0x1a9)](_0xba49fe+_0xe57bcf(0x1e7));if(_0x205433>0x0)_0x43769f['push'](_0x205433+'\x20deleted');console[_0xe57bcf(0x1ea)](a39_0x320717[_0xe57bcf(0x1da)](_0xe57bcf(0x1f0)));_0x4f6adc[_0xe57bcf(0x1fb)]>0x0&&!_0x565639[_0xe57bcf(0x1f6)]&&console[_0xe57bcf(0x1ea)](_0xe57bcf(0x204)+_0x4f6adc['join'](',\x20'));_0x35e08e[_0xe57bcf(0x1fb)]>0x0&&console['error']('\x20\x20Journeys:\x20'+_0x35e08e[_0xe57bcf(0x1e8)](',\x20'));_0x43769f[_0xe57bcf(0x1fb)]>0x0&&!_0x565639[_0xe57bcf(0x1f6)]&&console['error'](_0xe57bcf(0x23c)+_0x43769f[_0xe57bcf(0x1e8)](',\x20'));if(_0x5a1adf){const _0x5ac147=getConsoleNextUrl(_0x565639[_0xe57bcf(0x1eb)],_0xe57bcf(0x1ed)+_0x45d092+_0xe57bcf(0x1c3)+_0x5a1adf+_0xe57bcf(0x231));console[_0xe57bcf(0x1ea)](_0xe57bcf(0x1ab)+a39_0x320717['cyan'](_0x5ac147));}return 0x0;}}
1
+ function a40_0x59a8(_0x4ff6a2,_0x6f166b){_0x4ff6a2=_0x4ff6a2-0x93;const _0x23f33b=a40_0x23f3();let _0x59a8d6=_0x23f33b[_0x4ff6a2];return _0x59a8d6;}const a40_0x21410e=a40_0x59a8;(function(_0x4ef3fc,_0x17d9e9){const _0x16280e=a40_0x59a8,_0x1e6eb5=_0x4ef3fc();while(!![]){try{const _0x4f265c=-parseInt(_0x16280e(0xab))/0x1+-parseInt(_0x16280e(0x93))/0x2*(-parseInt(_0x16280e(0xaf))/0x3)+-parseInt(_0x16280e(0xc8))/0x4*(-parseInt(_0x16280e(0xb3))/0x5)+-parseInt(_0x16280e(0xb6))/0x6*(parseInt(_0x16280e(0xfa))/0x7)+-parseInt(_0x16280e(0x96))/0x8+-parseInt(_0x16280e(0xaa))/0x9+parseInt(_0x16280e(0x103))/0xa;if(_0x4f265c===_0x17d9e9)break;else _0x1e6eb5['push'](_0x1e6eb5['shift']());}catch(_0x469f86){_0x1e6eb5['push'](_0x1e6eb5['shift']());}}}(a40_0x23f3,0x4a3ec));function a40_0x23f3(){const _0x3f99d6=['\x20updated','targetDir','\x20\x20\x20\x20','updatedAt','listFolders','endsWith','dim','Error:\x20Directory\x20not\x20found:\x20','nameToId','existingJourney','7zDxylY','then','/sb/da/esr','\x20\x20🗺️\x20\x20Journeys:','Delete\x20segment:','description','yes','site','createdAt','5955840cwqqtP','length','Error:\x20','\x20folders\x20to\x20create','\x20created','Error\x20parsing\x20YAML:\x20','✔\x20All\x20journeys\x20are\x20up\x20to\x20date','\x20to\x20delete','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','\x20\x20Activations:','journeyId','yamlConfig','Fetching\x20existing\x20activations...','.yaml','Aborted.','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','diff','\x20changed','journeyBundleId','Delete\x20journey:','updated','map','/j/da/je','idToName','attributes','unchanged','new','getJourney','New\x20segment:','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','changed','journeys','yellow','buildUserMaps','.yml','connection','Push\x20','message','307654GezMhS','\x20new','\x20to\x20create','2217128JJPngn','\x27...','no_parent','deleted','createdSegmentIds','\x20\x20Journeys:\x20','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','all','folders','No\x20','errorCode','push','repeat','(Journey\x20will\x20be\x20deleted)','\x20\x20Source:\x20','created','resolveParentId','existingSegment','journeyBundleName','folderPath','1012824tkvUxO','88882bumcxu','cyan','folderId','Source\x20directory:\x20','3GliVSg','verbose','parentFolder','\x20deleted','1141575TTIeDk','journey','listJourneysWithDetailsFromParentSegment','1170354YEMUMH','\x20unchanged','listActivations','\x20activations]','toUpdate','delete','data','error','Usage:\x20tdx\x20sg\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20(requires\x20context)','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','/app/ps/','green','get','segmentFolderId','📁\x20','segment','✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','/e/','4BlWjrB','results','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file','isScoped','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','relationships','\x20changes?','journeysOnly','filter','add','parent_name','segments','Parent\x20segment:\x20','\x0aValidation\x20failed:','activations','listSegments','red','\x0a✔\x20Push\x20complete','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','scopedFolderPath','isNew','type','blue','\x20to\x20update','join','versionNumber','toDelete','\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','nameToType','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','\x20\x20Segments:\x20','segment:push','state','audienceId','toCreate','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','name','Changes\x20to\x20journey:','cwd'];a40_0x23f3=function(){return _0x3f99d6;};return a40_0x23f3();}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 a40_0x42b37b 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{[a40_0x21410e(0xed)]=a40_0x21410e(0xe8);[a40_0x21410e(0xff)]=a40_0x21410e(0xbf);async['execute'](_0x334835){const _0x3e280b=a40_0x21410e,{options:_0x1a52a2,args:_0x396f91,tdx:_0x3e26a8}=_0x334835,_0x18a54b=_0x1a52a2,_0x190eba=await resolveTarget({'arg':_0x396f91[0x0],'contextParent':_0x1a52a2['parentSegment'],'cwd':process[_0x3e280b(0xef)]()});if(!isSuccessfulResolution(_0x190eba))return _0x190eba[_0x3e280b(0xa0)]===_0x3e280b(0x98)?(console[_0x3e280b(0xbd)](a40_0x42b37b[_0x3e280b(0x123)](_0x3e280b(0xe6))),console[_0x3e280b(0xbd)](_0x3e280b(0xbe)),console['error']('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent'),console[_0x3e280b(0xbd)](_0x3e280b(0xca))):(console[_0x3e280b(0xbd)](a40_0x42b37b['red'](_0x3e280b(0x105)+_0x190eba[_0x3e280b(0x128)]+'\x0a')),_0x190eba['helpText']&&console['error'](a40_0x42b37b[_0x3e280b(0xac)](_0x190eba['helpText']))),0x1;if(_0x190eba[_0x3e280b(0xdd)]===_0x3e280b(0xd2))return console[_0x3e280b(0xbd)](a40_0x42b37b[_0x3e280b(0xd8)](_0x3e280b(0xf7)+_0x190eba[_0x3e280b(0xf1)]+'\x0a')),console[_0x3e280b(0xbd)](a40_0x42b37b['cyan'](_0x3e280b(0xda))),0x1;const _0x333dcc=_0x190eba['parentName'],_0x26e1b0=_0x190eba[_0x3e280b(0xf1)],_0xe300c5=_0x190eba[_0x3e280b(0xdd)]==='file'?_0x190eba['filePath']:undefined,_0x15e024=getScopedDetails(_0x190eba),_0x5a2937=_0x15e024?.[_0x3e280b(0xcb)]??![],_0x5c51e1=_0x15e024?.[_0x3e280b(0xdb)]??'';if(!existsSync(_0x26e1b0))return console[_0x3e280b(0xbd)](a40_0x42b37b[_0x3e280b(0xd8)](_0x3e280b(0xf7)+_0x26e1b0+'\x0a')),console[_0x3e280b(0xbd)](a40_0x42b37b['cyan'](_0x3e280b(0xda))),0x1;_0x18a54b['verbose']&&(console[_0x3e280b(0xbd)]('Site:\x20'+_0x18a54b[_0x3e280b(0x101)]),console[_0x3e280b(0xbd)](_0x3e280b(0xd4)+_0x333dcc),console[_0x3e280b(0xbd)](_0x3e280b(0xae)+_0x26e1b0),_0x5a2937&&console[_0x3e280b(0xbd)]('Scoped\x20to\x20folder:\x20'+_0x5c51e1));const _0x1850fc=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x333dcc+_0x3e280b(0x97),()=>_0x3e26a8[_0x3e280b(0xc5)][_0x3e280b(0xa6)](_0x333dcc),{'verbose':_0x18a54b[_0x3e280b(0xb0)]}),_0xabeba1=_0x1850fc['data'],{parentSegmentResult:_0x2bd815,segmentsResult:_0x4cd52f,foldersResult:_0x249770,journeysWithDetailsResult:_0x1f220b,userMaps:_0x39854a}=await withSpinner('Fetching\x20existing\x20data...',async()=>{const _0x50007c=_0x3e280b,[_0x459303,_0x55a5f2,_0x34e9ff,_0x3950f0,_0xf2d304]=await Promise[_0x50007c(0x9d)]([_0x3e26a8[_0x50007c(0xc5)]['getParent'](_0xabeba1),_0x3e26a8[_0x50007c(0xc5)][_0x50007c(0xd7)](_0xabeba1),_0x3e26a8[_0x50007c(0xc5)][_0x50007c(0xf4)](_0xabeba1),_0x3e26a8[_0x50007c(0xb4)][_0x50007c(0xb5)](_0xabeba1,{'includeAllVersions':!![]}),_0x3e26a8['user'][_0x50007c(0x124)]()]);return{'parentSegmentResult':_0x459303,'segmentsResult':_0x55a5f2,'foldersResult':_0x34e9ff,'journeysWithDetailsResult':_0x3950f0,'userMaps':_0xf2d304};},{'verbose':_0x18a54b[_0x3e280b(0xb0)]})['then'](_0x1c399c=>_0x1c399c['data']),_0x20dc6a=_0x2bd815,_0x14fb4a=extractRootFolderId(_0x20dc6a),_0x42572a=_0x4cd52f,_0x4390ca=_0x249770,{journeys:_0x1f69c5,activationStepsById:_0x56e9c1}=_0x1f220b,_0x39c9e6=new Map(_0x1f69c5['map'](_0xaa6443=>[_0xaa6443['id'],_0xaa6443])),_0x4b330c=_0x1f69c5[_0x3e280b(0x118)](_0x53510a=>({'id':_0x53510a['id'],'name':_0x53510a[_0x3e280b(0x11b)][_0x3e280b(0xed)],'journeyBundleName':_0x53510a[_0x3e280b(0x11b)][_0x3e280b(0xa8)]||'','journeyBundleId':_0x53510a[_0x3e280b(0x11b)][_0x3e280b(0x115)]||'','versionNumber':_0x53510a[_0x3e280b(0x11b)][_0x3e280b(0xe1)],'description':_0x53510a[_0x3e280b(0x11b)][_0x3e280b(0xff)],'state':_0x53510a[_0x3e280b(0x11b)][_0x3e280b(0xe9)],'paused':_0x53510a[_0x3e280b(0x11b)]['paused'],'audienceId':_0x53510a[_0x3e280b(0x11b)][_0x3e280b(0xea)],'folderId':_0x53510a[_0x3e280b(0xcd)]?.[_0x3e280b(0xb1)]?.['data']?.['id'],'createdAt':_0x53510a['attributes'][_0x3e280b(0x102)],'updatedAt':_0x53510a[_0x3e280b(0x11b)][_0x3e280b(0xf3)]})),{emailToId:_0x25e733,idToEmail:_0x4526fc}=_0x39854a,_0x583204=await withSpinner('Fetching\x20connections\x20for\x20name\x20resolution...',async()=>{const _0x1a6f03=await _0x3e26a8['connection']['list']();return buildConnectionMaps(_0x1a6f03);},{'verbose':_0x18a54b['verbose']})[_0x3e280b(0xfb)](_0x969001=>_0x969001[_0x3e280b(0xbc)]),_0x36b3ff=_0x583204[_0x3e280b(0xf8)],_0x34509b=_0x583204[_0x3e280b(0x11a)],_0xe4f2b3=_0x583204[_0x3e280b(0xe5)],_0x20aa86={'emailToIdMap':_0x25e733,'connectionNameToIdMap':_0x36b3ff,'connectionNameToTypeMap':_0xe4f2b3,'getSchema':_0x2175d0=>_0x3e26a8[_0x3e280b(0x126)]['getOutputSchemaWithCache'](_0x2175d0)};let {pathToId:_0x527680,idToPath:_0x56b7dd}=buildFolderMaps(_0x4390ca);const _0x2aadbd=buildSegmentLookupMap(_0x42572a,_0x56b7dd),_0x4de06e=buildSegmentNameToIdMap(_0x42572a),_0x1ce5e8=buildJourneyBundleLookupMap(_0x4b330c,_0x56b7dd);let _0x2b85f2;if(_0xe300c5){if(!_0xe300c5[_0x3e280b(0xf5)](_0x3e280b(0x125))&&!_0xe300c5['endsWith'](_0x3e280b(0x110)))return console['error'](a40_0x42b37b[_0x3e280b(0xd8)](_0x3e280b(0xec)+_0xe300c5+'\x0a')),0x1;_0x2b85f2=[_0xe300c5];}else _0x2b85f2=findYamlFiles(_0x26e1b0);if(_0x2b85f2[_0x3e280b(0x104)]===0x0)return console[_0x3e280b(0xbd)](a40_0x42b37b[_0x3e280b(0xd8)](_0x3e280b(0x112)+_0x26e1b0+'\x0a')),console[_0x3e280b(0xbd)](a40_0x42b37b[_0x3e280b(0xac)]('Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files')),0x1;let _0x18819a,_0x529246;try{const _0xf3fe76=parseAndClassifyYamlFiles(_0x2b85f2,_0x26e1b0,{'skipSegments':_0x18a54b['journeysOnly']});_0x18819a=_0xf3fe76[_0x3e280b(0xd3)],_0x529246=_0xf3fe76[_0x3e280b(0x122)];const _0x170726=validateParsedFiles(_0xf3fe76,_0x26e1b0);if(_0x170726[_0x3e280b(0x104)]>0x0)return console[_0x3e280b(0xbd)](a40_0x42b37b[_0x3e280b(0xd8)](_0x3e280b(0xd5))),console[_0x3e280b(0xbd)](formatValidationErrors(_0x170726)),console['error'](a40_0x42b37b[_0x3e280b(0x123)]('\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.')),0x1;}catch(_0x42493d){return console[_0x3e280b(0xbd)](a40_0x42b37b[_0x3e280b(0xd8)](_0x3e280b(0x108)+(_0x42493d instanceof Error?_0x42493d['message']:_0x42493d))),0x1;}if(_0x18819a[_0x3e280b(0x104)]===0x0&&_0x529246[_0x3e280b(0x104)]===0x0){const _0x5de9b5=_0x18a54b[_0x3e280b(0xcf)]?_0x3e280b(0xb4):'segment\x20or\x20journey';return console['error'](a40_0x42b37b[_0x3e280b(0x123)](_0x3e280b(0x9f)+_0x5de9b5+'\x20YAML\x20files\x20found')),0x0;}const _0x2f6c91=new Map();_0x42572a[_0x3e280b(0x104)]>0x0&&!_0x18a54b['journeysOnly']&&await withSpinner(_0x3e280b(0x10f),async()=>{await batchAsync(_0x42572a,async _0x3f8886=>{const _0x219746=a40_0x59a8,_0x20ddee=await _0x3e26a8[_0x219746(0xc5)][_0x219746(0xb8)](_0xabeba1,_0x3f8886['id']);_0x2f6c91['set'](_0x3f8886['id'],_0x20ddee);});},{'verbose':_0x18a54b[_0x3e280b(0xb0)]});const {segmentFiles:_0x3d5808,foldersToCreate:_0x408aab}=await prepareSegmentFiles(_0x18819a,{'segmentByFolderAndName':_0x2aadbd,'activationsBySegmentId':_0x2f6c91,'folderPathToId':_0x527680,'idToEmailMap':_0x4526fc,'connectionIdToNameMap':_0x34509b},_0x20aa86,_0x5a2937,_0x5c51e1),_0x32d974=_0xe300c5?[]:findSegmentsToDelete(_0x42572a,_0x18819a[_0x3e280b(0x118)](({yamlConfig:_0x30226b,folderPath:_0x5b114e})=>({'yamlConfig':_0x30226b,'folderPath':resolveTDFolderPath(_0x5b114e,_0x5a2937,_0x5c51e1)})),_0x56b7dd,_0x5c51e1,_0x5a2937),{journeyFiles:_0xc86c28,foldersToCreate:_0x4494aa}=await withProgressSpinner('Preparing\x20journeys...',async _0x5b4483=>prepareJourneyFiles(_0x529246,{'fetchJourney':async _0x4fe715=>_0x3e26a8[_0x3e280b(0xb4)][_0x3e280b(0x11e)](_0x4fe715[_0x3e280b(0x10d)]),'journeyBundlesByFolderAndName':_0x1ce5e8,'folderPathToId':_0x527680,'idToEmailMap':_0x4526fc,'connectionIdToNameMap':_0x34509b,'existingSegments':_0x42572a,'parentId':_0xabeba1,'deps':_0x3e26a8,'progress':{'update':_0x1611cb=>{const _0x18c6a5=_0x3e280b;_0x5b4483['setPhase'](_0x1611cb),_0x18a54b[_0x18c6a5(0xb0)]&&console[_0x18c6a5(0xbd)]('\x20\x20'+_0x1611cb);}},'journeyById':_0x39c9e6,'activationStepsById':_0x56e9c1},_0x5a2937,_0x5c51e1),{'verbose':_0x18a54b[_0x3e280b(0xb0)]})[_0x3e280b(0xfb)](_0x4c77b2=>_0x4c77b2[_0x3e280b(0xbc)]);for(const _0x34f255 of _0x4494aa){_0x408aab[_0x3e280b(0xd1)](_0x34f255);}const _0x32878e=_0xe300c5?[]:findJourneysToDelete(_0x4b330c,_0x529246['map'](({yamlConfig:_0x4c1097,folderPath:_0x24b681})=>({'yamlConfig':_0x4c1097,'folderPath':resolveTDFolderPath(_0x24b681,_0x5a2937,_0x5c51e1)})),_0x56b7dd,_0x5c51e1,_0x5a2937),_0x250b4b=calculatePushStats(_0x3d5808,_0xc86c28,_0x408aab,_0x32d974,_0x32878e,!!_0x18a54b[_0x3e280b(0xbb)],!!_0x18a54b[_0x3e280b(0xcf)]),_0x5cd162=_0x250b4b[_0x3e280b(0xd3)][_0x3e280b(0x11d)],_0x276557=_0x250b4b['segments'][_0x3e280b(0x121)],_0x31c56a=_0x250b4b[_0x3e280b(0xd3)][_0x3e280b(0x11c)],_0x40f922=_0x250b4b[_0x3e280b(0xd3)][_0x3e280b(0xe2)],_0x2b3da6=_0x250b4b[_0x3e280b(0x9e)]['toCreate'],_0x374a12=_0x250b4b[_0x3e280b(0x122)][_0x3e280b(0x11d)],_0x1b4494=_0x250b4b[_0x3e280b(0x122)]['changed'],_0x955b78=_0x250b4b[_0x3e280b(0x122)]['unchanged'],_0x298a47=_0x250b4b['journeys'][_0x3e280b(0xe2)],_0x4338a5=_0x250b4b[_0x3e280b(0xd6)]['all'],_0x418257=_0x250b4b[_0x3e280b(0xd6)][_0x3e280b(0xeb)],_0x21beb1=_0x250b4b[_0x3e280b(0xd6)][_0x3e280b(0xba)],_0x2738b9=_0x250b4b[_0x3e280b(0xd6)][_0x3e280b(0xe2)];console['error']('\x0aPush\x20summary\x20for\x20\x27'+_0x333dcc+'\x27:');_0x2b3da6[_0x3e280b(0x104)]>0x0&&console['error']('\x20\x20'+a40_0x42b37b[_0x3e280b(0xde)](_0x3e280b(0xc4)+_0x2b3da6[_0x3e280b(0x104)]+_0x3e280b(0x106)));if(!_0x18a54b[_0x3e280b(0xcf)]){console[_0x3e280b(0xbd)]('\x20\x20📊\x20Segments:'),console['error'](_0x3e280b(0xf2)+a40_0x42b37b['green']('+\x20'+_0x5cd162[_0x3e280b(0x104)]+'\x20new')),console[_0x3e280b(0xbd)](_0x3e280b(0xf2)+a40_0x42b37b['yellow']('~\x20'+_0x276557[_0x3e280b(0x104)]+_0x3e280b(0x114)));if(_0x40f922[_0x3e280b(0x104)]>0x0)console[_0x3e280b(0xbd)](_0x3e280b(0xf2)+a40_0x42b37b[_0x3e280b(0xd8)]('-\x20'+_0x40f922[_0x3e280b(0x104)]+_0x3e280b(0x10a)));else _0x32d974[_0x3e280b(0x104)]>0x0&&!_0x18a54b[_0x3e280b(0xbb)]&&console[_0x3e280b(0xbd)](_0x3e280b(0xf2)+a40_0x42b37b['dim'](_0x32d974[_0x3e280b(0x104)]+_0x3e280b(0xe4)));console[_0x3e280b(0xbd)](_0x3e280b(0xf2)+a40_0x42b37b[_0x3e280b(0xf6)]('=\x20'+_0x31c56a[_0x3e280b(0x104)]+_0x3e280b(0xb7)));}if(_0xc86c28[_0x3e280b(0x104)]>0x0||_0x32878e[_0x3e280b(0x104)]>0x0){console['error'](_0x3e280b(0xfd)),console[_0x3e280b(0xbd)]('\x20\x20\x20\x20'+a40_0x42b37b['green']('+\x20'+_0x374a12[_0x3e280b(0x104)]+_0x3e280b(0x94))),console[_0x3e280b(0xbd)](_0x3e280b(0xf2)+a40_0x42b37b[_0x3e280b(0x123)]('~\x20'+_0x1b4494['length']+'\x20changed'));if(_0x298a47[_0x3e280b(0x104)]>0x0)console[_0x3e280b(0xbd)](_0x3e280b(0xf2)+a40_0x42b37b[_0x3e280b(0xd8)]('-\x20'+_0x298a47[_0x3e280b(0x104)]+_0x3e280b(0x10a)));else _0x32878e[_0x3e280b(0x104)]>0x0&&!_0x18a54b[_0x3e280b(0xbb)]&&console[_0x3e280b(0xbd)](_0x3e280b(0xf2)+a40_0x42b37b[_0x3e280b(0xf6)](_0x32878e['length']+'\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)'));console[_0x3e280b(0xbd)](_0x3e280b(0xf2)+a40_0x42b37b[_0x3e280b(0xf6)]('=\x20'+_0x955b78[_0x3e280b(0x104)]+_0x3e280b(0xb7)));}_0x4338a5['length']>0x0&&!_0x18a54b[_0x3e280b(0xcf)]&&(console[_0x3e280b(0xbd)](''),console[_0x3e280b(0xbd)](_0x3e280b(0x10c)),_0x418257[_0x3e280b(0x104)]>0x0&&console[_0x3e280b(0xbd)]('\x20\x20\x20\x20'+a40_0x42b37b[_0x3e280b(0xc1)]('+\x20'+_0x418257[_0x3e280b(0x104)]+_0x3e280b(0x95))),_0x21beb1[_0x3e280b(0x104)]>0x0&&console['error'](_0x3e280b(0xf2)+a40_0x42b37b['yellow']('~\x20'+_0x21beb1[_0x3e280b(0x104)]+_0x3e280b(0xdf))),_0x2738b9[_0x3e280b(0x104)]>0x0&&console[_0x3e280b(0xbd)](_0x3e280b(0xf2)+a40_0x42b37b[_0x3e280b(0xd8)]('-\x20'+_0x2738b9[_0x3e280b(0x104)]+_0x3e280b(0x10a))));console[_0x3e280b(0xbd)](_0x3e280b(0xa4)+a40_0x42b37b[_0x3e280b(0xac)](_0x26e1b0)+'\x0a');if(_0x2b3da6[_0x3e280b(0x104)]>0x0){console['error']('Folders\x20to\x20create:');for(const _0x14c034 of _0x2b3da6){console['error']('\x20\x20'+a40_0x42b37b[_0x3e280b(0xde)]('+')+'\x20'+_0x14c034);}console[_0x3e280b(0xbd)]('');}if(_0x5cd162[_0x3e280b(0x104)]>0x0&&!_0x18a54b[_0x3e280b(0xcf)])for(const _0x2dfcbd of _0x5cd162){const _0xa5bf42=_0x2dfcbd['folderPath']?_0x2dfcbd[_0x3e280b(0xa9)]+'/'+_0x2dfcbd[_0x3e280b(0x10e)][_0x3e280b(0xed)]:_0x2dfcbd[_0x3e280b(0x10e)]['name'],_0xda182c=_0x2dfcbd['yamlConfig'][_0x3e280b(0xd6)]?.[_0x3e280b(0x104)]||0x0,_0x2bf026=_0xda182c>0x0?a40_0x42b37b[_0x3e280b(0xf6)]('\x20['+_0xda182c+_0x3e280b(0xb9)):'';console[_0x3e280b(0xbd)]('\x0a'+a40_0x42b37b[_0x3e280b(0xc1)](_0x3e280b(0x11f))+'\x20'+_0xa5bf42+_0x2bf026),console[_0x3e280b(0xbd)]('─'['repeat'](0x3c)),_0x2dfcbd[_0x3e280b(0x113)]&&console['error'](_0x2dfcbd[_0x3e280b(0x113)]),console[_0x3e280b(0xbd)]('─'['repeat'](0x3c));}if(_0x40f922[_0x3e280b(0x104)]>0x0&&!_0x18a54b[_0x3e280b(0xcf)])for(const _0x15687d of _0x40f922){const _0x2d6b50=_0x15687d[_0x3e280b(0xc3)]?_0x56b7dd[_0x3e280b(0xc2)](_0x15687d[_0x3e280b(0xc3)]['toString']())||'':'',_0x5234be=_0x2d6b50?_0x2d6b50+'/'+_0x15687d['name']:_0x15687d[_0x3e280b(0xed)],_0x500c5c=_0x2f6c91[_0x3e280b(0xc2)](_0x15687d['id'])||[],_0x842aba=_0x500c5c['length']>0x0?a40_0x42b37b[_0x3e280b(0xf6)]('\x20['+_0x500c5c[_0x3e280b(0x104)]+_0x3e280b(0xb9)):'';console['error']('\x0a'+a40_0x42b37b['red'](_0x3e280b(0xfe))+'\x20'+_0x5234be+_0x842aba),console[_0x3e280b(0xbd)]('─'['repeat'](0x3c));const _0x592046=segmentWithActivationsToYaml(_0x15687d,_0x500c5c,undefined,_0x4526fc,_0x34509b),_0x3f3c66=segmentToYamlString(_0x592046),_0x534337=generateDiff(_0x3f3c66,'');console[_0x3e280b(0xbd)](formatDiffWithColors(_0x534337)),console[_0x3e280b(0xbd)]('─'['repeat'](0x3c));}const _0x2e5ccd=_0x3d5808[_0x3e280b(0xd0)](_0x5922c9=>!_0x5922c9[_0x3e280b(0xdc)]&&_0x5922c9[_0x3e280b(0x113)]);if(_0x2e5ccd[_0x3e280b(0x104)]>0x0&&!_0x18a54b[_0x3e280b(0xcf)])for(const _0x45c199 of _0x2e5ccd){const _0x31aa7b=_0x45c199[_0x3e280b(0xa9)]?_0x45c199[_0x3e280b(0xa9)]+'/'+_0x45c199['yamlConfig']['name']:_0x45c199[_0x3e280b(0x10e)][_0x3e280b(0xed)];console[_0x3e280b(0xbd)]('\x0a'+a40_0x42b37b[_0x3e280b(0x123)]('Changes\x20to:')+'\x20'+_0x31aa7b),console[_0x3e280b(0xbd)]('─'['repeat'](0x3c)),console[_0x3e280b(0xbd)](_0x45c199[_0x3e280b(0x113)]),console[_0x3e280b(0xbd)]('─'[_0x3e280b(0xa2)](0x3c));}if(_0x374a12[_0x3e280b(0x104)]>0x0)for(const _0x4e3f45 of _0x374a12){const _0x13e95a=_0x4e3f45['folderPath']?_0x4e3f45[_0x3e280b(0xa9)]+'/'+_0x4e3f45['yamlConfig'][_0x3e280b(0xed)]:_0x4e3f45[_0x3e280b(0x10e)][_0x3e280b(0xed)];console[_0x3e280b(0xbd)]('\x0a'+a40_0x42b37b[_0x3e280b(0xc1)]('New\x20journey:')+'\x20'+_0x13e95a),console[_0x3e280b(0xbd)]('─'[_0x3e280b(0xa2)](0x3c)),_0x4e3f45[_0x3e280b(0x113)]&&console[_0x3e280b(0xbd)](_0x4e3f45['diff']),console[_0x3e280b(0xbd)]('─'[_0x3e280b(0xa2)](0x3c));}const _0x491a82=_0xc86c28[_0x3e280b(0xd0)](_0x3acfb5=>!_0x3acfb5[_0x3e280b(0xdc)]&&_0x3acfb5[_0x3e280b(0x113)]);if(_0x491a82[_0x3e280b(0x104)]>0x0)for(const _0x1028de of _0x491a82){const _0x1b2062=_0x1028de['folderPath']?_0x1028de[_0x3e280b(0xa9)]+'/'+_0x1028de[_0x3e280b(0x10e)][_0x3e280b(0xed)]:_0x1028de[_0x3e280b(0x10e)][_0x3e280b(0xed)];console[_0x3e280b(0xbd)]('\x0a'+a40_0x42b37b[_0x3e280b(0x123)](_0x3e280b(0xee))+'\x20'+_0x1b2062),console['error']('─'['repeat'](0x3c)),console[_0x3e280b(0xbd)](_0x1028de[_0x3e280b(0x113)]),console[_0x3e280b(0xbd)]('─'[_0x3e280b(0xa2)](0x3c));}if(_0x298a47[_0x3e280b(0x104)]>0x0)for(const _0x15d347 of _0x298a47){const _0x16dc38=_0x15d347['folderId']?_0x56b7dd[_0x3e280b(0xc2)](_0x15d347[_0x3e280b(0xad)])||'':'',_0x14aa75=_0x16dc38?_0x16dc38+'/'+_0x15d347[_0x3e280b(0xa8)]:_0x15d347[_0x3e280b(0xa8)];console[_0x3e280b(0xbd)]('\x0a'+a40_0x42b37b[_0x3e280b(0xd8)](_0x3e280b(0x116))+'\x20'+_0x14aa75),console[_0x3e280b(0xbd)]('─'[_0x3e280b(0xa2)](0x3c)),console['error'](a40_0x42b37b['red'](_0x3e280b(0xa3))),console[_0x3e280b(0xbd)]('─'[_0x3e280b(0xa2)](0x3c));}if(_0x18a54b['dryRun'])return console[_0x3e280b(0xbd)](a40_0x42b37b[_0x3e280b(0x123)](_0x3e280b(0x120))),0x0;const _0x280224=_0x18a54b['journeysOnly']?![]:_0x5cd162[_0x3e280b(0x104)]>0x0||_0x276557[_0x3e280b(0x104)]>0x0||_0x40f922[_0x3e280b(0x104)]>0x0,_0x5cdebf=_0x374a12[_0x3e280b(0x104)]>0x0||_0x1b4494['length']>0x0||_0x298a47[_0x3e280b(0x104)]>0x0,_0x3d6620=_0x18a54b['journeysOnly']?![]:_0x4338a5[_0x3e280b(0x104)]>0x0,_0x3abd57=_0x2b3da6[_0x3e280b(0x104)]>0x0;if(!_0x280224&&!_0x5cdebf&&!_0x3d6620&&!_0x3abd57){const _0x144022=_0x18a54b[_0x3e280b(0xcf)]?_0x3e280b(0x109):_0x3e280b(0xc6);console['error'](a40_0x42b37b[_0x3e280b(0xc1)](_0x144022));if(_0xe300c5&&_0x31c56a[_0x3e280b(0x104)]===0x1){const _0x12f55a=_0x31c56a[0x0];if(_0x12f55a[_0x3e280b(0xa7)]?.['id']){const _0x19a289=getConsoleNextUrl(_0x18a54b['site'],'/app/ps/'+_0xabeba1+_0x3e280b(0xc7)+_0x12f55a['existingSegment']['id']+_0x3e280b(0xfc));console[_0x3e280b(0xbd)](_0x3e280b(0xe3)+a40_0x42b37b[_0x3e280b(0xac)](_0x19a289));}}if(_0xe300c5&&_0x955b78[_0x3e280b(0x104)]===0x1){const _0x2b8c2f=_0x955b78[0x0];if(_0x2b8c2f['existingJourney']?.['id']){const _0x2ed402=getConsoleNextUrl(_0x18a54b[_0x3e280b(0x101)],_0x3e280b(0xc0)+_0xabeba1+_0x3e280b(0xc7)+_0x2b8c2f[_0x3e280b(0xf9)]['id']+_0x3e280b(0x119));console[_0x3e280b(0xbd)]('\x20\x20'+a40_0x42b37b[_0x3e280b(0xac)](_0x2ed402));}}return 0x0;}const _0x4f24cf=_0x18a54b[_0x3e280b(0xcf)]?_0x374a12[_0x3e280b(0x104)]+_0x1b4494[_0x3e280b(0x104)]+_0x298a47[_0x3e280b(0x104)]+_0x2b3da6[_0x3e280b(0x104)]:_0x5cd162['length']+_0x276557[_0x3e280b(0x104)]+_0x40f922[_0x3e280b(0x104)]+_0x374a12[_0x3e280b(0x104)]+_0x1b4494[_0x3e280b(0x104)]+_0x298a47[_0x3e280b(0x104)]+_0x2b3da6[_0x3e280b(0x104)]+_0x4338a5[_0x3e280b(0x104)];if(!_0x18a54b[_0x3e280b(0x100)]&&_0x4f24cf>0x0){if(!isInteractive())return console['error'](a40_0x42b37b[_0x3e280b(0xd8)]('\x0aError:'),_0x3e280b(0xcc)),console['error'](a40_0x42b37b['dim'](_0x3e280b(0x9c))),0x1;const _0x34bc53=await confirmKey(_0x3e280b(0x127)+_0x4f24cf+_0x3e280b(0xce));if(!_0x34bc53)return console[_0x3e280b(0xbd)](a40_0x42b37b['yellow'](_0x3e280b(0x111))),0x1;}const _0x1eee75={'withProgress':async(_0x20600e,_0x4218ca)=>{const _0x335b8a=_0x3e280b,_0x2c6947=await withSpinner(_0x20600e,_0x4218ca,{'verbose':_0x18a54b['verbose']});return{'data':_0x2c6947[_0x335b8a(0xbc)]};},'logInfo':_0x3bcc90=>console[_0x3e280b(0xbd)](a40_0x42b37b[_0x3e280b(0xde)]('✔\x20'+_0x3bcc90)),'logSuccess':_0x586dde=>console[_0x3e280b(0xbd)](a40_0x42b37b[_0x3e280b(0xc1)]('✔\x20'+_0x586dde)),'logWarning':_0x14b7d9=>console[_0x3e280b(0xbd)](a40_0x42b37b[_0x3e280b(0x123)]('⚠\x20'+_0x14b7d9)),'logDeleted':_0x154dba=>console[_0x3e280b(0xbd)](a40_0x42b37b[_0x3e280b(0xd8)]('✔\x20'+_0x154dba))},_0x31d785={'segment':_0x3e26a8['segment'],'journey':_0x3e26a8[_0x3e280b(0xb4)],'user':_0x3e26a8['user'],'connection':_0x3e26a8[_0x3e280b(0x126)]};_0x2b3da6[_0x3e280b(0x104)]>0x0&&(_0x527680=await executePushFolders(_0x31d785,_0x2b3da6,_0x527680,{'parentId':_0xabeba1},_0x1eee75));const _0x409237={'rootFolderId':_0x14fb4a,'folderPathToId':_0x527680,'folderIdToPath':_0x56b7dd,'segmentNameToId':_0x4de06e,'activationsBySegmentId':_0x2f6c91,'emailToIdMap':_0x25e733,'idToEmailMap':_0x4526fc,'connectionNameToIdMap':_0x583204[_0x3e280b(0xf8)],'connectionIdToNameMap':_0x583204[_0x3e280b(0x11a)],'connectionNameToTypeMap':_0xe4f2b3},_0x5cbd0d=await executePushSegments(_0x31d785,_0x18a54b[_0x3e280b(0xcf)]?[]:_0x3d5808,_0x409237,{'parentId':_0xabeba1},_0x1eee75),_0x49cddc=_0x5cbd0d[_0x3e280b(0xa5)],_0x851a81=_0x5cbd0d['updated'],_0x1a4f27=_0x5cbd0d[_0x3e280b(0xd6)][_0x3e280b(0xa5)],_0x833be1=_0x5cbd0d[_0x3e280b(0xd6)][_0x3e280b(0x117)],_0x28d4e2=_0x5cbd0d['activations'][_0x3e280b(0x99)];let _0x496602;if(_0xe300c5&&_0x3d5808[_0x3e280b(0x104)]===0x1){const _0x52429d=_0x3d5808[0x0];_0x496602=_0x52429d['existingSegment']?.['id']??_0x5cbd0d[_0x3e280b(0x9a)][_0x3e280b(0xc2)](_0x52429d['yamlConfig'][_0x3e280b(0xed)]);}const _0x34946c=await executePushSegmentDeletions(_0x31d785,_0x18a54b['journeysOnly']?[]:_0x40f922,_0x1eee75);let _0x1a5a0d=0x0,_0x3ca7c0=0x0,_0x684ea1=0x0;const _0x1f48a6=new Map(_0x4de06e);for(const [_0x1bc5cc,_0x50e6b5]of _0x5cbd0d[_0x3e280b(0x9a)]){_0x1f48a6['set'](_0x1bc5cc,_0x50e6b5);}if(_0xc86c28[_0x3e280b(0x104)]>0x0){const _0x5d8076={..._0x409237,'segmentNameToId':_0x1f48a6,'existingSegments':_0x42572a,'activationContext':_0x20aa86},_0x5e8313=await executePushJourneys(_0x31d785,_0xc86c28,_0x5d8076,{'parentId':_0xabeba1,'rootFolderId':_0x14fb4a,'verbose':_0x18a54b[_0x3e280b(0xb0)]},_0x1eee75);_0x1a5a0d=_0x5e8313['created'],_0x3ca7c0=_0x5e8313[_0x3e280b(0x117)];if(_0xe300c5&&_0x5e8313[_0x3e280b(0xc9)][_0x3e280b(0x104)]===0x1){const _0x141697=_0x5e8313[_0x3e280b(0xc9)][0x0];if(_0x141697['journeyId']){const _0x1dbdf1=getConsoleNextUrl(_0x18a54b[_0x3e280b(0x101)],'/app/ps/'+_0xabeba1+_0x3e280b(0xc7)+_0x141697['journeyId']+'/j/da/je');console[_0x3e280b(0xbd)]('\x20\x20'+a40_0x42b37b['cyan'](_0x1dbdf1));}}}for(const _0x46f2d6 of _0x298a47){console[_0x3e280b(0xbd)](a40_0x42b37b[_0x3e280b(0x123)](_0x3e280b(0x10b)+_0x46f2d6[_0x3e280b(0xa8)])),_0x684ea1++;}const _0x4b5bef=[];if(_0x49cddc>0x0)_0x4b5bef[_0x3e280b(0xa1)](_0x49cddc+_0x3e280b(0x107));if(_0x851a81>0x0)_0x4b5bef[_0x3e280b(0xa1)](_0x851a81+_0x3e280b(0xf0));if(_0x34946c>0x0)_0x4b5bef[_0x3e280b(0xa1)](_0x34946c+_0x3e280b(0xb2));const _0x296db4=[];if(_0x1a5a0d>0x0)_0x296db4['push'](_0x1a5a0d+_0x3e280b(0x107));if(_0x3ca7c0>0x0)_0x296db4[_0x3e280b(0xa1)](_0x3ca7c0+'\x20updated');if(_0x684ea1>0x0)_0x296db4['push'](_0x684ea1+'\x20deleted');const _0x19a609=[];if(_0x1a4f27>0x0)_0x19a609[_0x3e280b(0xa1)](_0x1a4f27+_0x3e280b(0x107));if(_0x833be1>0x0)_0x19a609[_0x3e280b(0xa1)](_0x833be1+'\x20updated');if(_0x28d4e2>0x0)_0x19a609[_0x3e280b(0xa1)](_0x28d4e2+_0x3e280b(0xb2));console[_0x3e280b(0xbd)](a40_0x42b37b[_0x3e280b(0xc1)](_0x3e280b(0xd9)));_0x4b5bef[_0x3e280b(0x104)]>0x0&&!_0x18a54b['journeysOnly']&&console[_0x3e280b(0xbd)](_0x3e280b(0xe7)+_0x4b5bef[_0x3e280b(0xe0)](',\x20'));_0x296db4[_0x3e280b(0x104)]>0x0&&console['error'](_0x3e280b(0x9b)+_0x296db4[_0x3e280b(0xe0)](',\x20'));_0x19a609['length']>0x0&&!_0x18a54b['journeysOnly']&&console[_0x3e280b(0xbd)]('\x20\x20Activations:\x20'+_0x19a609[_0x3e280b(0xe0)](',\x20'));if(_0x496602){const _0x5cd0ec=getConsoleNextUrl(_0x18a54b[_0x3e280b(0x101)],_0x3e280b(0xc0)+_0xabeba1+_0x3e280b(0xc7)+_0x496602+'/sb/da/esr');console['error'](_0x3e280b(0xe3)+a40_0x42b37b[_0x3e280b(0xac)](_0x5cd0ec));}return 0x0;}}
@@ -1 +1 @@
1
- function a40_0x46a3(){const _0x1cb135=['Resolved\x20relative\x20path\x20to:\x20','\x27...','yellow','type','1463FKZlTZ','data','Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]','resolveFolderId','INTERNAL','11168PBzXkG','kind','Update\x20existing\x20child\x20segment','segmentName','\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22','246880yQTyDx','\x20\x20\x20Path:\x20','name','description','verbose','segmentId','Error:\x20Cannot\x20update\x20','length','12164wsylLu','Resolving\x20path\x20\x27','3Vgmqyb','updateSegmentById','Resolved\x20folder\x20ID:\x20','parentId','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','Resolved\x20type:\x20','1286880zyaiHI','Segment\x20ID:\x20','⚠\x20Deprecation\x20warning:\x20`segment\x20update`\x20is\x20deprecated.','1161802qxWtYR','rule','segment:update','5311782fFPewj','segment','1200517qYbsyF','5131zmauBL','570qnsYWX','error','\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','folder','Parent\x20ID:\x20','Examples:','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required'];a40_0x46a3=function(){return _0x1cb135;};return a40_0x46a3();}function a40_0x302e(_0x568b0b,_0x5dd899){_0x568b0b=_0x568b0b-0x80;const _0x46a3ce=a40_0x46a3();let _0x302e54=_0x46a3ce[_0x568b0b];return _0x302e54;}const a40_0x55fd99=a40_0x302e;(function(_0x121700,_0x5e4f9f){const _0x9a8f71=a40_0x302e,_0x43bdf2=_0x121700();while(!![]){try{const _0x2c551d=parseInt(_0x9a8f71(0xad))/0x1+parseInt(_0x9a8f71(0xa8))/0x2*(parseInt(_0x9a8f71(0x9f))/0x3)+parseInt(_0x9a8f71(0x9d))/0x4*(parseInt(_0x9a8f71(0x80))/0x5)+parseInt(_0x9a8f71(0xa5))/0x6+parseInt(_0x9a8f71(0xae))/0x7*(parseInt(_0x9a8f71(0x90))/0x8)+parseInt(_0x9a8f71(0xab))/0x9+-parseInt(_0x9a8f71(0x95))/0xa*(parseInt(_0x9a8f71(0x8b))/0xb);if(_0x2c551d===_0x5e4f9f)break;else _0x43bdf2['push'](_0x43bdf2['shift']());}catch(_0x1990a8){_0x43bdf2['push'](_0x43bdf2['shift']());}}}(a40_0x46a3,0xa4316));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{SDKError,ErrorCode}from'../sdk/index.js';import a40_0x3a58aa from'chalk';export class SegmentUpdateCommand extends BaseCommand{[a40_0x55fd99(0x97)]=a40_0x55fd99(0xaa);['description']=a40_0x55fd99(0x92);async['execute'](_0x5c07cc){const _0x347d51=a40_0x55fd99;console[_0x347d51(0x81)](a40_0x3a58aa[_0x347d51(0x89)](_0x347d51(0xa7))),console[_0x347d51(0x81)](a40_0x3a58aa[_0x347d51(0x89)](_0x347d51(0xa3)));const {options:_0x1e7fc0,args:_0x1b767b,tdx:_0x157cb3}=_0x5c07cc,_0x2b815a=_0x1e7fc0;if(_0x1b767b[_0x347d51(0x9c)]===0x0)return console[_0x347d51(0x81)](_0x347d51(0x86)),console[_0x347d51(0x81)](_0x347d51(0x8d)),console['error'](_0x347d51(0x85)),console[_0x347d51(0x81)](_0x347d51(0x94)),console[_0x347d51(0x81)](_0x347d51(0x82)),0x1;const _0x3baa13=_0x1b767b[0x0],_0x549c4f=_0x1e7fc0['segmentPath'];let _0x3bdf02=_0x3baa13;_0x549c4f&&!_0x3baa13['includes']('/')&&(_0x3bdf02=_0x549c4f+'/'+_0x3baa13,_0x2b815a[_0x347d51(0x99)]&&console[_0x347d51(0x81)](_0x347d51(0x87)+_0x3bdf02));const _0x1a3983=await withSpinner(_0x347d51(0x9e)+_0x3bdf02+_0x347d51(0x88),()=>_0x157cb3[_0x347d51(0xac)]['resolvePathToResource'](_0x3bdf02),{'verbose':_0x2b815a[_0x347d51(0x99)]}),_0x189d1b=_0x1a3983[_0x347d51(0x8c)];_0x2b815a[_0x347d51(0x99)]&&console[_0x347d51(0x81)](_0x347d51(0xa4)+_0x189d1b[_0x347d51(0x8a)]);if(_0x189d1b[_0x347d51(0x8a)]!==_0x347d51(0xac))return console[_0x347d51(0x81)](_0x347d51(0x9b)+_0x189d1b[_0x347d51(0x8a)]+'.\x20Only\x20child\x20segments\x20can\x20be\x20updated.'),console['error']('Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]'),0x1;if(!_0x189d1b[_0x347d51(0x9a)])throw new SDKError(ErrorCode[_0x347d51(0x8f)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x2246de=_0x189d1b[_0x347d51(0xa2)],_0x83f11f=_0x189d1b[_0x347d51(0x9a)];_0x2b815a['verbose']&&(console[_0x347d51(0x81)](_0x347d51(0x84)+_0x2246de),console[_0x347d51(0x81)](_0x347d51(0xa6)+_0x83f11f));let _0x16cecc;if(_0x2b815a['folder']){const _0x2b92fe=_0x2b815a[_0x347d51(0x83)],_0x5d4c80=await withSpinner('Resolving\x20folder\x20\x27'+_0x2b92fe+_0x347d51(0x88),()=>_0x157cb3[_0x347d51(0xac)][_0x347d51(0x8e)](_0x2246de,_0x2b92fe),{'verbose':_0x2b815a[_0x347d51(0x99)]});_0x16cecc=parseInt(_0x5d4c80[_0x347d51(0x8c)],0xa),_0x2b815a[_0x347d51(0x99)]&&console[_0x347d51(0x81)](_0x347d51(0xa1)+_0x16cecc);}const _0xb0f6cf=await loadJSONFromOptions(_0x2b815a[_0x347d51(0xa9)],_0x2b815a['ruleFile']),_0x57e9cc={'name':_0x2b815a[_0x347d51(0x97)],'description':_0x2b815a[_0x347d51(0x98)],'rule':_0xb0f6cf,'kind':_0x2b815a['kind']!==undefined?parseInt(_0x2b815a[_0x347d51(0x91)],0xa):undefined,'segmentFolderId':_0x16cecc},_0x5d4972=await withSpinner('Updating\x20segment\x20\x27'+_0x189d1b[_0x347d51(0x93)]+_0x347d51(0x88),()=>_0x157cb3[_0x347d51(0xac)][_0x347d51(0xa0)](_0x2246de,_0x83f11f,_0x57e9cc),{'verbose':_0x2b815a[_0x347d51(0x99)]}),_0x5ab696=_0x5d4972[_0x347d51(0x8c)];return console[_0x347d51(0x81)]('✔\x20Updated\x20segment\x20\x27'+_0x5ab696[_0x347d51(0x97)]+'\x27'),_0x3bdf02!==_0x3baa13&&console[_0x347d51(0x81)](_0x347d51(0x96)+_0x3bdf02),await handleSDKOutput([_0x5ab696],_0x2b815a),0x0;}}
1
+ function a41_0x2cd6(_0x26dbf5,_0x5f4c5c){_0x26dbf5=_0x26dbf5-0x1f2;const _0x46a359=a41_0x46a3();let _0x2cd6d3=_0x46a359[_0x26dbf5];return _0x2cd6d3;}const a41_0xaabfa5=a41_0x2cd6;(function(_0x503b9c,_0x23f688){const _0x168a4f=a41_0x2cd6,_0x11db31=_0x503b9c();while(!![]){try{const _0x572f11=-parseInt(_0x168a4f(0x1fe))/0x1+-parseInt(_0x168a4f(0x206))/0x2*(parseInt(_0x168a4f(0x202))/0x3)+parseInt(_0x168a4f(0x217))/0x4+parseInt(_0x168a4f(0x1f9))/0x5+-parseInt(_0x168a4f(0x20e))/0x6+-parseInt(_0x168a4f(0x1f7))/0x7*(-parseInt(_0x168a4f(0x1fc))/0x8)+parseInt(_0x168a4f(0x20a))/0x9;if(_0x572f11===_0x23f688)break;else _0x11db31['push'](_0x11db31['shift']());}catch(_0x3878bd){_0x11db31['push'](_0x11db31['shift']());}}}(a41_0x46a3,0x8f67e));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';function a41_0x46a3(){const _0x5eab08=['Error:\x20Cannot\x20update\x20','1149376EbGfuu','updateSegmentById','\x20\x20\x20Path:\x20','Resolving\x20folder\x20\x27','309HLsAqB','name','Resolving\x20path\x20\x27','segment:update','15590XUHlPh','Examples:','⚠\x20Deprecation\x20warning:\x20`segment\x20update`\x20is\x20deprecated.','Segment\x20ID:\x20','9619308rFQPwJ','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','rule','Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]','2891658HphJIx','Resolved\x20type:\x20','segment','Update\x20existing\x20child\x20segment','yellow','Segment\x20ID\x20missing\x20from\x20resolved\x20path','✔\x20Updated\x20segment\x20\x27','resolveFolderId','Updating\x20segment\x20\x27','2489376piAVNT','resolvePathToResource','Parent\x20ID:\x20','Resolved\x20relative\x20path\x20to:\x20','Resolved\x20folder\x20ID:\x20','verbose','type','description','segmentId','\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22','INTERNAL','execute','Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]','\x27...','error','folder','7vRTmCP','segmentPath','3183700jnfeQe','data','parentId','5549584kbBzpc'];a41_0x46a3=function(){return _0x5eab08;};return a41_0x46a3();}import{SDKError,ErrorCode}from'../sdk/index.js';import a41_0x39646e from'chalk';export class SegmentUpdateCommand extends BaseCommand{[a41_0xaabfa5(0x203)]=a41_0xaabfa5(0x205);[a41_0xaabfa5(0x21e)]=a41_0xaabfa5(0x211);async[a41_0xaabfa5(0x1f2)](_0x237358){const _0x31490b=a41_0xaabfa5;console['error'](a41_0x39646e[_0x31490b(0x212)](_0x31490b(0x208))),console[_0x31490b(0x1f5)](a41_0x39646e[_0x31490b(0x212)]('\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a'));const {options:_0x5868bd,args:_0x2be33c,tdx:_0x1833e1}=_0x237358,_0x422691=_0x5868bd;if(_0x2be33c['length']===0x0)return console[_0x31490b(0x1f5)](_0x31490b(0x20b)),console['error'](_0x31490b(0x1f3)),console['error'](_0x31490b(0x207)),console[_0x31490b(0x1f5)](_0x31490b(0x220)),console[_0x31490b(0x1f5)]('\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context'),0x1;const _0xff7373=_0x2be33c[0x0],_0x391d30=_0x5868bd[_0x31490b(0x1f8)];let _0x25196b=_0xff7373;_0x391d30&&!_0xff7373['includes']('/')&&(_0x25196b=_0x391d30+'/'+_0xff7373,_0x422691[_0x31490b(0x21c)]&&console[_0x31490b(0x1f5)](_0x31490b(0x21a)+_0x25196b));const _0x1e4c23=await withSpinner(_0x31490b(0x204)+_0x25196b+_0x31490b(0x1f4),()=>_0x1833e1['segment'][_0x31490b(0x218)](_0x25196b),{'verbose':_0x422691[_0x31490b(0x21c)]}),_0x37b119=_0x1e4c23[_0x31490b(0x1fa)];_0x422691['verbose']&&console['error'](_0x31490b(0x20f)+_0x37b119[_0x31490b(0x21d)]);if(_0x37b119[_0x31490b(0x21d)]!==_0x31490b(0x210))return console[_0x31490b(0x1f5)](_0x31490b(0x1fd)+_0x37b119[_0x31490b(0x21d)]+'.\x20Only\x20child\x20segments\x20can\x20be\x20updated.'),console['error'](_0x31490b(0x20d)),0x1;if(!_0x37b119[_0x31490b(0x21f)])throw new SDKError(ErrorCode[_0x31490b(0x221)],_0x31490b(0x213));const _0x5c912f=_0x37b119[_0x31490b(0x1fb)],_0x3c723f=_0x37b119['segmentId'];_0x422691['verbose']&&(console[_0x31490b(0x1f5)](_0x31490b(0x219)+_0x5c912f),console[_0x31490b(0x1f5)](_0x31490b(0x209)+_0x3c723f));let _0x11b09b;if(_0x422691[_0x31490b(0x1f6)]){const _0x44a105=_0x422691[_0x31490b(0x1f6)],_0x4f06fb=await withSpinner(_0x31490b(0x201)+_0x44a105+_0x31490b(0x1f4),()=>_0x1833e1[_0x31490b(0x210)][_0x31490b(0x215)](_0x5c912f,_0x44a105),{'verbose':_0x422691[_0x31490b(0x21c)]});_0x11b09b=parseInt(_0x4f06fb[_0x31490b(0x1fa)],0xa),_0x422691[_0x31490b(0x21c)]&&console[_0x31490b(0x1f5)](_0x31490b(0x21b)+_0x11b09b);}const _0x2ec086=await loadJSONFromOptions(_0x422691[_0x31490b(0x20c)],_0x422691['ruleFile']),_0x2e42cc={'name':_0x422691[_0x31490b(0x203)],'description':_0x422691['description'],'rule':_0x2ec086,'kind':_0x422691['kind']!==undefined?parseInt(_0x422691['kind'],0xa):undefined,'segmentFolderId':_0x11b09b},_0x4e1a16=await withSpinner(_0x31490b(0x216)+_0x37b119['segmentName']+_0x31490b(0x1f4),()=>_0x1833e1[_0x31490b(0x210)][_0x31490b(0x1ff)](_0x5c912f,_0x3c723f,_0x2e42cc),{'verbose':_0x422691[_0x31490b(0x21c)]}),_0x35bba2=_0x4e1a16[_0x31490b(0x1fa)];return console[_0x31490b(0x1f5)](_0x31490b(0x214)+_0x35bba2[_0x31490b(0x203)]+'\x27'),_0x25196b!==_0xff7373&&console[_0x31490b(0x1f5)](_0x31490b(0x200)+_0x25196b),await handleSDKOutput([_0x35bba2],_0x422691),0x0;}}
@@ -1 +1 @@
1
- const a41_0x28861d=a41_0x4b98;function a41_0x251a(){const _0x3c8831=['\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22','isAbsolute','segments','split','execute','parentId','folderPath','parentName','152343hzAoZn','folderId','data','type','segment','Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','Examples:','2132NZweif','error','slice','3458574mfJpMI','fullPath','cyan','segment:use','red','Use\x20\x22tdx\x20use\x22\x20to\x20see\x20all\x20context\x20parameters','Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context','Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.','Target\x20path:\x20','Site:\x20','session','dim','11152810HPaiYC','green','\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context','isDirectory','Resolved\x20relative\x20path\x20to:\x20','5361208trHfjo','309323POzJYO','Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>','resolvePathToResource','join','Resolving\x20path\x20\x27','Folder\x20ID:\x20','Error:\x20Path\x20is\x20required\x0a','2995lSZXdR','\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent','site','log','8hBbEdH','Set\x20current\x20segment/folder\x20context\x20for\x20navigation','Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.','verbose','name','description','9oiEZfX','✔\x20Context\x20cleared.\x20Back\x20to\x20root.','Resolved\x20path\x20type:\x20','1934226vZDoBA','segmentPath','Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.','\x27...'];a41_0x251a=function(){return _0x3c8831;};return a41_0x251a();}(function(_0x492d62,_0xa570d3){const _0xaf7043=a41_0x4b98,_0x50a9f9=_0x492d62();while(!![]){try{const _0x25598e=-parseInt(_0xaf7043(0x77))/0x1+-parseInt(_0xaf7043(0x82))/0x2*(parseInt(_0xaf7043(0x97))/0x3)+parseInt(_0xaf7043(0x9e))/0x4*(parseInt(_0xaf7043(0x7e))/0x5)+-parseInt(_0xaf7043(0x8b))/0x6+parseInt(_0xaf7043(0xa1))/0x7+-parseInt(_0xaf7043(0x76))/0x8*(parseInt(_0xaf7043(0x88))/0x9)+parseInt(_0xaf7043(0x71))/0xa;if(_0x25598e===_0xa570d3)break;else _0x50a9f9['push'](_0x50a9f9['shift']());}catch(_0x43e30f){_0x50a9f9['push'](_0x50a9f9['shift']());}}}(a41_0x251a,0x676ed));function a41_0x4b98(_0x3fc556,_0x52d75a){_0x3fc556=_0x3fc556-0x67;const _0x251ab0=a41_0x251a();let _0x4b984b=_0x251ab0[_0x3fc556];return _0x4b984b;}import{existsSync,statSync}from'fs';import a41_0x24aef8 from'chalk';import{BaseCommand}from'./command.js';import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';import{parsePath,normalizePath}from'../sdk/segment/segment-path-parser.js';import{findTdxConfig}from'../sdk/segment/tdx-config.js';export class SegmentUseCommand extends BaseCommand{[a41_0x28861d(0x86)]=a41_0x28861d(0x68);[a41_0x28861d(0x87)]=a41_0x28861d(0x83);async[a41_0x28861d(0x93)](_0x255d3a){const _0x2132d1=a41_0x28861d,{options:_0x5e6c0a,args:_0x235576,tdx:_0x508c3f}=_0x255d3a;if(_0x235576['length']===0x0)return console[_0x2132d1(0x9f)](a41_0x24aef8[_0x2132d1(0x69)](_0x2132d1(0x7d))),console[_0x2132d1(0x9f)]('Usage:\x20tdx\x20segment\x20use\x20<path>'),console[_0x2132d1(0x9f)](_0x2132d1(0x9d)),console['error']('\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22'),console[_0x2132d1(0x9f)](_0x2132d1(0x8f)),console[_0x2132d1(0x9f)](_0x2132d1(0x73)),console[_0x2132d1(0x9f)](_0x2132d1(0x7f)),0x1;const _0x59149b=_0x235576[0x0],_0x41a650=_0x5e6c0a[_0x2132d1(0x6f)];try{if(_0x59149b==='/')return saveSessionContext({'segment_path':undefined},_0x41a650),console[_0x2132d1(0x81)](a41_0x24aef8[_0x2132d1(0x72)](_0x2132d1(0x89))),0x0;if(existsSync(_0x59149b)&&statSync(_0x59149b)[_0x2132d1(0x74)]()){let _0x1485aa;try{_0x1485aa=findTdxConfig(_0x59149b);}catch{return console['error'](a41_0x24aef8['red'](_0x2132d1(0x9c)+_0x59149b)),console[_0x2132d1(0x9f)](a41_0x24aef8[_0x2132d1(0x67)]('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;}const _0x5c1610=_0x1485aa['config']['parent_segment'];return saveSessionContext({'segment_path':_0x5c1610,'parent_segment':_0x5c1610},_0x41a650),console[_0x2132d1(0x81)](a41_0x24aef8[_0x2132d1(0x72)]('✔\x20Context\x20set\x20to:\x20'+a41_0x24aef8[_0x2132d1(0x67)](_0x5c1610))),0x0;}const _0x1a11dd=_0x5e6c0a[_0x2132d1(0x8c)];let _0x255c6d=_0x59149b;const _0x2c9147=parsePath(_0x59149b);if(!_0x2c9147[_0x2132d1(0x90)]){if(!_0x1a11dd)return console[_0x2132d1(0x9f)](a41_0x24aef8[_0x2132d1(0x69)](_0x2132d1(0x8d))),console[_0x2132d1(0x9f)](a41_0x24aef8[_0x2132d1(0x67)](_0x2132d1(0x78))),0x1;if(_0x59149b==='..'){const _0x5de617=_0x1a11dd[_0x2132d1(0x92)]('/')[_0x2132d1(0xa0)](0x0,-0x1)[_0x2132d1(0x7a)]('/');_0x255c6d=_0x5de617||'/';}else _0x59149b==='.'?_0x255c6d=_0x1a11dd:_0x255c6d=_0x1a11dd+'/'+_0x59149b;_0x5e6c0a[_0x2132d1(0x85)]&&console[_0x2132d1(0x9f)](_0x2132d1(0x75)+_0x255c6d);}if(_0x255c6d==='/'||_0x255c6d==='')return saveSessionContext({'segment_path':undefined},_0x41a650),console[_0x2132d1(0x81)](a41_0x24aef8[_0x2132d1(0x72)]('✔\x20Context\x20cleared.\x20Back\x20to\x20root.')),0x0;_0x255c6d=normalizePath(_0x255c6d);const _0x167a64=parsePath(_0x255c6d)[_0x2132d1(0x91)];if(_0x167a64['length']===0x0)return saveSessionContext({'segment_path':undefined},_0x41a650),console[_0x2132d1(0x81)](a41_0x24aef8['green'](_0x2132d1(0x89))),0x0;_0x5e6c0a['verbose']&&(console[_0x2132d1(0x9f)](_0x2132d1(0x6e)+_0x5e6c0a[_0x2132d1(0x80)]),console[_0x2132d1(0x9f)](_0x2132d1(0x6d)+_0x255c6d));const _0x2c09f2=await withSpinner(_0x2132d1(0x7b)+_0x255c6d+_0x2132d1(0x8e),()=>_0x508c3f[_0x2132d1(0x9b)][_0x2132d1(0x79)](_0x255c6d),{'verbose':_0x5e6c0a[_0x2132d1(0x85)]}),_0x11d7f2=_0x2c09f2[_0x2132d1(0x99)];_0x5e6c0a[_0x2132d1(0x85)]&&(console['error'](_0x2132d1(0x8a)+_0x11d7f2['type']),console['error']('Parent\x20ID:\x20'+_0x11d7f2[_0x2132d1(0x94)]),_0x11d7f2[_0x2132d1(0x98)]&&console[_0x2132d1(0x9f)](_0x2132d1(0x7c)+_0x11d7f2[_0x2132d1(0x98)]));if(_0x11d7f2[_0x2132d1(0x9a)]===_0x2132d1(0x9b))return console[_0x2132d1(0x9f)](a41_0x24aef8[_0x2132d1(0x69)](_0x2132d1(0x6c))),console[_0x2132d1(0x9f)](_0x2132d1(0x84)),console[_0x2132d1(0x9f)](a41_0x24aef8['cyan']('Use:\x20tdx\x20segment\x20use\x20'+_0x11d7f2[_0x2132d1(0x96)]+(_0x11d7f2[_0x2132d1(0x95)]?'/'+_0x11d7f2[_0x2132d1(0x95)][_0x2132d1(0x7a)]('/'):''))),0x1;return saveSessionContext({'segment_path':_0x11d7f2['fullPath'],'parent_segment':_0x11d7f2[_0x2132d1(0x96)]},_0x41a650),console['log'](a41_0x24aef8['green']('✔\x20Context\x20set\x20to:\x20'+a41_0x24aef8['cyan'](_0x11d7f2[_0x2132d1(0xa2)]))),_0x5e6c0a[_0x2132d1(0x85)]&&(console[_0x2132d1(0x9f)](a41_0x24aef8['dim'](_0x2132d1(0x6b))),console[_0x2132d1(0x9f)](a41_0x24aef8[_0x2132d1(0x70)](_0x2132d1(0x6a)))),0x0;}catch(_0x1db4f1){throw _0x1db4f1;}}}
1
+ const a42_0x2f1db1=a42_0x1f71;(function(_0x48b5a9,_0x516720){const _0x56a647=a42_0x1f71,_0x512786=_0x48b5a9();while(!![]){try{const _0x42eb23=parseInt(_0x56a647(0x123))/0x1*(parseInt(_0x56a647(0x13f))/0x2)+-parseInt(_0x56a647(0x11f))/0x3*(parseInt(_0x56a647(0x122))/0x4)+-parseInt(_0x56a647(0x130))/0x5*(-parseInt(_0x56a647(0x115))/0x6)+-parseInt(_0x56a647(0x117))/0x7*(-parseInt(_0x56a647(0x12e))/0x8)+parseInt(_0x56a647(0x118))/0x9+-parseInt(_0x56a647(0x116))/0xa+parseInt(_0x56a647(0x119))/0xb;if(_0x42eb23===_0x516720)break;else _0x512786['push'](_0x512786['shift']());}catch(_0x5a0f35){_0x512786['push'](_0x512786['shift']());}}}(a42_0xe9ae,0x34c9e));import{existsSync,statSync}from'fs';import a42_0x2bff5f from'chalk';function a42_0xe9ae(){const _0x41f5e9=['Use:\x20tdx\x20segment\x20use\x20','125YwHfoa','description','✔\x20Context\x20cleared.\x20Back\x20to\x20root.','error','red','segment:use','Set\x20current\x20segment/folder\x20context\x20for\x20navigation','log','Parent\x20ID:\x20','Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.','Target\x20path:\x20','type','\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context','site','✔\x20Context\x20set\x20to:\x20','84zqYJHM','green','Examples:','\x27...','Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.','name','Resolved\x20path\x20type:\x20','segments','dim','join','Folder\x20ID:\x20','Use\x20\x22tdx\x20use\x22\x20to\x20see\x20all\x20context\x20parameters','folderPath','execute','fullPath','parentId','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22','Site:\x20','85926LaFIlE','2319500PyAqtQ','56889jNksrI','386127KITTse','1411806AOmyRR','length','isDirectory','folderId','data','session','42YfYIAu','isAbsolute','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22','64992IgvxIJ','2fYYFdt','parentName','Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.','parent_segment','segment','resolvePathToResource','Error:\x20Path\x20is\x20required\x0a','verbose','Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','cyan','slice','144ptsACg'];a42_0xe9ae=function(){return _0x41f5e9;};return a42_0xe9ae();}import{BaseCommand}from'./command.js';import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';import{parsePath,normalizePath}from'../sdk/segment/segment-path-parser.js';import{findTdxConfig}from'../sdk/segment/tdx-config.js';function a42_0x1f71(_0x5cf08d,_0x2155c9){_0x5cf08d=_0x5cf08d-0x10a;const _0xe9ae3a=a42_0xe9ae();let _0x1f7148=_0xe9ae3a[_0x5cf08d];return _0x1f7148;}export class SegmentUseCommand extends BaseCommand{[a42_0x2f1db1(0x144)]=a42_0x2f1db1(0x135);[a42_0x2f1db1(0x131)]=a42_0x2f1db1(0x136);async[a42_0x2f1db1(0x110)](_0x4f1a19){const _0x2cea5e=a42_0x2f1db1,{options:_0x280d6a,args:_0x1bf14c,tdx:_0xedd455}=_0x4f1a19;if(_0x1bf14c[_0x2cea5e(0x11a)]===0x0)return console[_0x2cea5e(0x133)](a42_0x2bff5f[_0x2cea5e(0x134)](_0x2cea5e(0x129))),console[_0x2cea5e(0x133)]('Usage:\x20tdx\x20segment\x20use\x20<path>'),console[_0x2cea5e(0x133)](_0x2cea5e(0x141)),console['error'](_0x2cea5e(0x113)),console[_0x2cea5e(0x133)](_0x2cea5e(0x121)),console[_0x2cea5e(0x133)](_0x2cea5e(0x13c)),console[_0x2cea5e(0x133)]('\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent'),0x1;const _0x362517=_0x1bf14c[0x0],_0x2090fa=_0x280d6a[_0x2cea5e(0x11e)];try{if(_0x362517==='/')return saveSessionContext({'segment_path':undefined},_0x2090fa),console['log'](a42_0x2bff5f[_0x2cea5e(0x140)](_0x2cea5e(0x132))),0x0;if(existsSync(_0x362517)&&statSync(_0x362517)[_0x2cea5e(0x11b)]()){let _0x2bcd9e;try{_0x2bcd9e=findTdxConfig(_0x362517);}catch{return console[_0x2cea5e(0x133)](a42_0x2bff5f[_0x2cea5e(0x134)](_0x2cea5e(0x12b)+_0x362517)),console['error'](a42_0x2bff5f[_0x2cea5e(0x12c)]('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;}const _0xc2cd75=_0x2bcd9e['config'][_0x2cea5e(0x126)];return saveSessionContext({'segment_path':_0xc2cd75,'parent_segment':_0xc2cd75},_0x2090fa),console[_0x2cea5e(0x137)](a42_0x2bff5f[_0x2cea5e(0x140)](_0x2cea5e(0x13e)+a42_0x2bff5f[_0x2cea5e(0x12c)](_0xc2cd75))),0x0;}const _0x209a3f=_0x280d6a['segmentPath'];let _0x42e255=_0x362517;const _0x1a2344=parsePath(_0x362517);if(!_0x1a2344[_0x2cea5e(0x120)]){if(!_0x209a3f)return console[_0x2cea5e(0x133)](a42_0x2bff5f[_0x2cea5e(0x134)](_0x2cea5e(0x125))),console[_0x2cea5e(0x133)](a42_0x2bff5f[_0x2cea5e(0x12c)]('Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>')),0x1;if(_0x362517==='..'){const _0x222999=_0x209a3f['split']('/')[_0x2cea5e(0x12d)](0x0,-0x1)[_0x2cea5e(0x10c)]('/');_0x42e255=_0x222999||'/';}else _0x362517==='.'?_0x42e255=_0x209a3f:_0x42e255=_0x209a3f+'/'+_0x362517;_0x280d6a['verbose']&&console[_0x2cea5e(0x133)]('Resolved\x20relative\x20path\x20to:\x20'+_0x42e255);}if(_0x42e255==='/'||_0x42e255==='')return saveSessionContext({'segment_path':undefined},_0x2090fa),console['log'](a42_0x2bff5f['green']('✔\x20Context\x20cleared.\x20Back\x20to\x20root.')),0x0;_0x42e255=normalizePath(_0x42e255);const _0xa91a1=parsePath(_0x42e255)[_0x2cea5e(0x10a)];if(_0xa91a1['length']===0x0)return saveSessionContext({'segment_path':undefined},_0x2090fa),console[_0x2cea5e(0x137)](a42_0x2bff5f[_0x2cea5e(0x140)]('✔\x20Context\x20cleared.\x20Back\x20to\x20root.')),0x0;_0x280d6a[_0x2cea5e(0x12a)]&&(console[_0x2cea5e(0x133)](_0x2cea5e(0x114)+_0x280d6a[_0x2cea5e(0x13d)]),console['error'](_0x2cea5e(0x13a)+_0x42e255));const _0x16df15=await withSpinner('Resolving\x20path\x20\x27'+_0x42e255+_0x2cea5e(0x142),()=>_0xedd455[_0x2cea5e(0x127)][_0x2cea5e(0x128)](_0x42e255),{'verbose':_0x280d6a[_0x2cea5e(0x12a)]}),_0x33a515=_0x16df15[_0x2cea5e(0x11d)];_0x280d6a[_0x2cea5e(0x12a)]&&(console['error'](_0x2cea5e(0x145)+_0x33a515[_0x2cea5e(0x13b)]),console[_0x2cea5e(0x133)](_0x2cea5e(0x138)+_0x33a515[_0x2cea5e(0x112)]),_0x33a515[_0x2cea5e(0x11c)]&&console[_0x2cea5e(0x133)](_0x2cea5e(0x10d)+_0x33a515[_0x2cea5e(0x11c)]));if(_0x33a515[_0x2cea5e(0x13b)]==='segment')return console[_0x2cea5e(0x133)](a42_0x2bff5f['red'](_0x2cea5e(0x139))),console[_0x2cea5e(0x133)](_0x2cea5e(0x143)),console[_0x2cea5e(0x133)](a42_0x2bff5f[_0x2cea5e(0x12c)](_0x2cea5e(0x12f)+_0x33a515[_0x2cea5e(0x124)]+(_0x33a515[_0x2cea5e(0x10f)]?'/'+_0x33a515[_0x2cea5e(0x10f)][_0x2cea5e(0x10c)]('/'):''))),0x1;return saveSessionContext({'segment_path':_0x33a515['fullPath'],'parent_segment':_0x33a515[_0x2cea5e(0x124)]},_0x2090fa),console[_0x2cea5e(0x137)](a42_0x2bff5f[_0x2cea5e(0x140)](_0x2cea5e(0x13e)+a42_0x2bff5f['cyan'](_0x33a515[_0x2cea5e(0x111)]))),_0x280d6a[_0x2cea5e(0x12a)]&&(console['error'](a42_0x2bff5f[_0x2cea5e(0x10b)]('Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context')),console[_0x2cea5e(0x133)](a42_0x2bff5f[_0x2cea5e(0x10b)](_0x2cea5e(0x10e)))),0x0;}catch(_0x1a9cc0){throw _0x1a9cc0;}}}
@@ -1 +1 @@
1
- const a42_0x1dfb6c=a42_0x4224;(function(_0x29fc72,_0x555daf){const _0x39d02e=a42_0x4224,_0x1c95c9=_0x29fc72();while(!![]){try{const _0x2a3634=parseInt(_0x39d02e(0x17b))/0x1*(parseInt(_0x39d02e(0x185))/0x2)+-parseInt(_0x39d02e(0x155))/0x3+parseInt(_0x39d02e(0x17d))/0x4*(parseInt(_0x39d02e(0x15b))/0x5)+-parseInt(_0x39d02e(0x16a))/0x6*(parseInt(_0x39d02e(0x167))/0x7)+parseInt(_0x39d02e(0x184))/0x8*(parseInt(_0x39d02e(0x18a))/0x9)+parseInt(_0x39d02e(0x17a))/0xa+-parseInt(_0x39d02e(0x180))/0xb;if(_0x2a3634===_0x555daf)break;else _0x1c95c9['push'](_0x1c95c9['shift']());}catch(_0x5cc850){_0x1c95c9['push'](_0x1c95c9['shift']());}}}(a42_0x4edf,0x39c45));import{BaseCommand}from'./command.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';function a42_0x4edf(){const _0xaf921d=['filePath','red','hasErrors','Usage:\x20tdx\x20sg\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)','invalidCount','.yaml','type','execute','\x20warning(s)','\x20error(s)','green','1786950JWCepe','424530Gyllrn','yellow','4bSLeud','parentSegment','helpText','2379872NsWCkG','):\x20','no_parent','targetDir','857768VcNrrS','2SeyHhy','valid','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','warnings','cyan','9iROFGe','Validate\x20segment\x20and\x20journey\x20YAML\x20files','659535ZIJzlZ','\x20valid','errorCode','endsWith','dim','Error:\x20','1963050kiOzMz','message','length','file','Validation\x20failed:\x20','error','log','.yml','cwd','✔\x20All\x20','errors','segment:validate','14NKuvEe','name','\x20warning(s)\x20found','1290738mukJfc','validCount','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','verbose','warningCount'];a42_0x4edf=function(){return _0xaf921d;};return a42_0x4edf();}import{findYamlFiles}from'../sdk/segment/file-discovery.js';function a42_0x4224(_0x2e9299,_0x2a2b6a){_0x2e9299=_0x2e9299-0x154;const _0x4edf85=a42_0x4edf();let _0x422469=_0x4edf85[_0x2e9299];return _0x422469;}import{existsSync}from'fs';import a42_0x1aab21 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{[a42_0x1dfb6c(0x168)]=a42_0x1dfb6c(0x166);['description']=a42_0x1dfb6c(0x154);async[a42_0x1dfb6c(0x176)](_0x820b34){const _0x3b19fb=a42_0x1dfb6c,{options:_0x45c2f6,args:_0x5c81dc}=_0x820b34,_0x1e84f7=_0x45c2f6,_0x35f295=await resolveTarget({'arg':_0x5c81dc[0x0],'contextParent':_0x45c2f6[_0x3b19fb(0x17e)],'cwd':process[_0x3b19fb(0x163)]()});if(!isSuccessfulResolution(_0x35f295))return _0x35f295[_0x3b19fb(0x157)]===_0x3b19fb(0x182)?(console[_0x3b19fb(0x160)](a42_0x1aab21[_0x3b19fb(0x17c)]('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console[_0x3b19fb(0x160)](_0x3b19fb(0x172)),console[_0x3b19fb(0x160)]('\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'),console[_0x3b19fb(0x160)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file')):(console['error'](a42_0x1aab21[_0x3b19fb(0x170)](_0x3b19fb(0x15a)+_0x35f295[_0x3b19fb(0x15c)]+'\x0a')),_0x35f295[_0x3b19fb(0x17f)]&&console[_0x3b19fb(0x160)](a42_0x1aab21[_0x3b19fb(0x189)](_0x35f295[_0x3b19fb(0x17f)]))),0x1;const _0x2ea5a9=_0x35f295[_0x3b19fb(0x183)],_0x4d60e3=_0x35f295[_0x3b19fb(0x175)]===_0x3b19fb(0x15e)?_0x35f295[_0x3b19fb(0x16f)]:undefined;if(!_0x4d60e3&&!existsSync(_0x2ea5a9))return console['error'](a42_0x1aab21[_0x3b19fb(0x170)]('Error:\x20Directory\x20not\x20found:\x20'+_0x2ea5a9+'\x0a')),0x1;let _0x4b74dd;if(_0x4d60e3){if(!_0x4d60e3['endsWith'](_0x3b19fb(0x162))&&!_0x4d60e3[_0x3b19fb(0x158)](_0x3b19fb(0x174)))return console['error'](a42_0x1aab21['red'](_0x3b19fb(0x187)+_0x4d60e3+'\x0a')),0x1;_0x4b74dd=[_0x4d60e3];}else _0x4b74dd=findYamlFiles(_0x2ea5a9);if(_0x4b74dd['length']===0x0)return console[_0x3b19fb(0x160)](a42_0x1aab21[_0x3b19fb(0x170)](_0x3b19fb(0x16c)+_0x2ea5a9+'\x0a')),0x1;const _0x3e42aa=validateYamlFiles(_0x4b74dd,_0x2ea5a9),_0x54ed9f=calculateSummary(_0x3e42aa);for(const _0x5f3496 of _0x3e42aa){if(!isValidationResult(_0x5f3496))continue;const {relativePath:_0x3c513a,source:_0x1a99e6,result:_0xdf625c,fileType:_0x4b8965}=_0x5f3496,_0x3e1f4b=_0x4b8965;if(_0xdf625c[_0x3b19fb(0x186)]&&_0xdf625c[_0x3b19fb(0x188)][_0x3b19fb(0x15d)]===0x0)_0x1e84f7[_0x3b19fb(0x16d)]&&console[_0x3b19fb(0x161)](a42_0x1aab21[_0x3b19fb(0x179)]('✔\x20'+_0x3c513a)+a42_0x1aab21[_0x3b19fb(0x159)]('\x20('+_0x3e1f4b+')'));else _0xdf625c[_0x3b19fb(0x186)]?(console[_0x3b19fb(0x161)](a42_0x1aab21[_0x3b19fb(0x17c)]('⚠\x20'+_0x3c513a)+a42_0x1aab21[_0x3b19fb(0x159)]('\x20('+_0x3e1f4b+_0x3b19fb(0x181)+_0xdf625c[_0x3b19fb(0x188)][_0x3b19fb(0x15d)]+_0x3b19fb(0x177))),console[_0x3b19fb(0x161)](formatValidationResult(_0xdf625c,_0x1a99e6,_0x3c513a))):(console[_0x3b19fb(0x161)](a42_0x1aab21[_0x3b19fb(0x170)]('✖\x20'+_0x3c513a)+a42_0x1aab21[_0x3b19fb(0x159)]('\x20('+_0x3e1f4b+_0x3b19fb(0x181)+_0xdf625c[_0x3b19fb(0x165)]['length']+_0x3b19fb(0x178))),console[_0x3b19fb(0x161)](formatValidationResult(_0xdf625c,_0x1a99e6,_0x3c513a)));}return console[_0x3b19fb(0x161)](''),_0x54ed9f[_0x3b19fb(0x171)]?(console['log'](a42_0x1aab21[_0x3b19fb(0x170)](_0x3b19fb(0x15f)+_0x54ed9f[_0x3b19fb(0x173)]+'\x20file(s)\x20with\x20errors,\x20'+_0x54ed9f[_0x3b19fb(0x16b)]+_0x3b19fb(0x156))),_0x54ed9f['warningCount']>0x0&&console[_0x3b19fb(0x161)](a42_0x1aab21[_0x3b19fb(0x17c)](_0x54ed9f[_0x3b19fb(0x16e)]+_0x3b19fb(0x169))),0x1):(console[_0x3b19fb(0x161)](a42_0x1aab21[_0x3b19fb(0x179)](_0x3b19fb(0x164)+_0x54ed9f[_0x3b19fb(0x16b)]+'\x20file(s)\x20valid')),_0x54ed9f[_0x3b19fb(0x16e)]>0x0&&console[_0x3b19fb(0x161)](a42_0x1aab21['yellow'](_0x54ed9f['warningCount']+'\x20warning(s)\x20found')),0x0);}}
1
+ const a43_0xcf5805=a43_0x2abb;(function(_0x5937a2,_0x621a9d){const _0x38449b=a43_0x2abb,_0x1c40c1=_0x5937a2();while(!![]){try{const _0x255cff=-parseInt(_0x38449b(0x1c2))/0x1*(parseInt(_0x38449b(0x1ab))/0x2)+parseInt(_0x38449b(0x1bc))/0x3+parseInt(_0x38449b(0x1d2))/0x4+parseInt(_0x38449b(0x1d0))/0x5*(parseInt(_0x38449b(0x1d6))/0x6)+-parseInt(_0x38449b(0x1b5))/0x7+parseInt(_0x38449b(0x1af))/0x8*(-parseInt(_0x38449b(0x1ba))/0x9)+parseInt(_0x38449b(0x1d5))/0xa;if(_0x255cff===_0x621a9d)break;else _0x1c40c1['push'](_0x1c40c1['shift']());}catch(_0x2992ed){_0x1c40c1['push'](_0x1c40c1['shift']());}}}(a43_0x2d7d,0xac34b));import{BaseCommand}from'./command.js';function a43_0x2abb(_0x5b9507,_0x10f1a9){_0x5b9507=_0x5b9507-0x1a5;const _0x2d7d2e=a43_0x2d7d();let _0x2abbeb=_0x2d7d2e[_0x5b9507];return _0x2abbeb;}import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';import a43_0x53e3e2 from'chalk';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';function a43_0x2d7d(){const _0x40fb3f=['Error:\x20No\x20YAML\x20files\x20found\x20in\x20','parentSegment','segment:validate','11079xgKarU','\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','708873jamTjZ','Validate\x20segment\x20and\x20journey\x20YAML\x20files','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','warnings','cwd','message','42DqUkDB','endsWith','cyan','valid','error','helpText','errorCode','.yaml','description','dim','no_parent','length','.yml','\x20warning(s)\x20found','236095WERxLo','Usage:\x20tdx\x20sg\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)','1236944kZjrfW','execute','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','3188070MUkIxJ','162baommk','filePath','Error:\x20Directory\x20not\x20found:\x20','Validation\x20failed:\x20','red','\x20warning(s)','validCount','errors','8110jnudRf','verbose','):\x20','green','3744PYqmwX','\x20error(s)','file','warningCount','\x20file(s)\x20with\x20errors,\x20','yellow','4812318dDCpJy','log'];a43_0x2d7d=function(){return _0x40fb3f;};return a43_0x2d7d();}export class SegmentValidateCommand extends BaseCommand{['name']=a43_0xcf5805(0x1b9);[a43_0xcf5805(0x1ca)]=a43_0xcf5805(0x1bd);async[a43_0xcf5805(0x1d3)](_0x3ed81d){const _0x5f52b8=a43_0xcf5805,{options:_0x3eaa4c,args:_0x22e644}=_0x3ed81d,_0x139e72=_0x3eaa4c,_0x181a9f=await resolveTarget({'arg':_0x22e644[0x0],'contextParent':_0x3eaa4c[_0x5f52b8(0x1b8)],'cwd':process[_0x5f52b8(0x1c0)]()});if(!isSuccessfulResolution(_0x181a9f))return _0x181a9f[_0x5f52b8(0x1c8)]===_0x5f52b8(0x1cc)?(console[_0x5f52b8(0x1c6)](a43_0x53e3e2[_0x5f52b8(0x1b4)](_0x5f52b8(0x1be))),console[_0x5f52b8(0x1c6)](_0x5f52b8(0x1d1)),console[_0x5f52b8(0x1c6)](_0x5f52b8(0x1bb)),console[_0x5f52b8(0x1c6)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file')):(console[_0x5f52b8(0x1c6)](a43_0x53e3e2[_0x5f52b8(0x1a7)]('Error:\x20'+_0x181a9f[_0x5f52b8(0x1c1)]+'\x0a')),_0x181a9f['helpText']&&console[_0x5f52b8(0x1c6)](a43_0x53e3e2[_0x5f52b8(0x1c4)](_0x181a9f[_0x5f52b8(0x1c7)]))),0x1;const _0x4d6483=_0x181a9f['targetDir'],_0x1f0aff=_0x181a9f['type']===_0x5f52b8(0x1b1)?_0x181a9f[_0x5f52b8(0x1d7)]:undefined;if(!_0x1f0aff&&!existsSync(_0x4d6483))return console[_0x5f52b8(0x1c6)](a43_0x53e3e2['red'](_0x5f52b8(0x1a5)+_0x4d6483+'\x0a')),0x1;let _0x18dd25;if(_0x1f0aff){if(!_0x1f0aff[_0x5f52b8(0x1c3)](_0x5f52b8(0x1ce))&&!_0x1f0aff[_0x5f52b8(0x1c3)](_0x5f52b8(0x1c9)))return console['error'](a43_0x53e3e2[_0x5f52b8(0x1a7)](_0x5f52b8(0x1d4)+_0x1f0aff+'\x0a')),0x1;_0x18dd25=[_0x1f0aff];}else _0x18dd25=findYamlFiles(_0x4d6483);if(_0x18dd25['length']===0x0)return console[_0x5f52b8(0x1c6)](a43_0x53e3e2[_0x5f52b8(0x1a7)](_0x5f52b8(0x1b7)+_0x4d6483+'\x0a')),0x1;const _0x1ddf11=validateYamlFiles(_0x18dd25,_0x4d6483),_0x167f94=calculateSummary(_0x1ddf11);for(const _0x53eba7 of _0x1ddf11){if(!isValidationResult(_0x53eba7))continue;const {relativePath:_0x1d8d01,source:_0x580a46,result:_0x191127,fileType:_0x5ef755}=_0x53eba7,_0x50578=_0x5ef755;if(_0x191127['valid']&&_0x191127[_0x5f52b8(0x1bf)]['length']===0x0)_0x139e72[_0x5f52b8(0x1ac)]&&console[_0x5f52b8(0x1b6)](a43_0x53e3e2[_0x5f52b8(0x1ae)]('✔\x20'+_0x1d8d01)+a43_0x53e3e2['dim']('\x20('+_0x50578+')'));else _0x191127[_0x5f52b8(0x1c5)]?(console[_0x5f52b8(0x1b6)](a43_0x53e3e2[_0x5f52b8(0x1b4)]('⚠\x20'+_0x1d8d01)+a43_0x53e3e2['dim']('\x20('+_0x50578+_0x5f52b8(0x1ad)+_0x191127[_0x5f52b8(0x1bf)][_0x5f52b8(0x1cd)]+_0x5f52b8(0x1a8))),console[_0x5f52b8(0x1b6)](formatValidationResult(_0x191127,_0x580a46,_0x1d8d01))):(console[_0x5f52b8(0x1b6)](a43_0x53e3e2['red']('✖\x20'+_0x1d8d01)+a43_0x53e3e2[_0x5f52b8(0x1cb)]('\x20('+_0x50578+_0x5f52b8(0x1ad)+_0x191127[_0x5f52b8(0x1aa)][_0x5f52b8(0x1cd)]+_0x5f52b8(0x1b0))),console['log'](formatValidationResult(_0x191127,_0x580a46,_0x1d8d01)));}return console[_0x5f52b8(0x1b6)](''),_0x167f94['hasErrors']?(console[_0x5f52b8(0x1b6)](a43_0x53e3e2[_0x5f52b8(0x1a7)](_0x5f52b8(0x1a6)+_0x167f94['invalidCount']+_0x5f52b8(0x1b3)+_0x167f94[_0x5f52b8(0x1a9)]+'\x20valid')),_0x167f94[_0x5f52b8(0x1b2)]>0x0&&console['log'](a43_0x53e3e2[_0x5f52b8(0x1b4)](_0x167f94[_0x5f52b8(0x1b2)]+_0x5f52b8(0x1cf))),0x1):(console[_0x5f52b8(0x1b6)](a43_0x53e3e2['green']('✔\x20All\x20'+_0x167f94['validCount']+'\x20file(s)\x20valid')),_0x167f94[_0x5f52b8(0x1b2)]>0x0&&console['log'](a43_0x53e3e2[_0x5f52b8(0x1b4)](_0x167f94['warningCount']+_0x5f52b8(0x1cf))),0x0);}}
@@ -1 +1 @@
1
- const a43_0x3b508=a43_0x1643;(function(_0x3d7c12,_0x4c77e3){const _0x285831=a43_0x1643,_0x2d19a5=_0x3d7c12();while(!![]){try{const _0x485332=-parseInt(_0x285831(0x117))/0x1+-parseInt(_0x285831(0x118))/0x2+-parseInt(_0x285831(0x130))/0x3*(parseInt(_0x285831(0x127))/0x4)+-parseInt(_0x285831(0x104))/0x5+parseInt(_0x285831(0x11c))/0x6*(-parseInt(_0x285831(0x143))/0x7)+-parseInt(_0x285831(0x124))/0x8+parseInt(_0x285831(0x105))/0x9*(parseInt(_0x285831(0x14b))/0xa);if(_0x485332===_0x4c77e3)break;else _0x2d19a5['push'](_0x2d19a5['shift']());}catch(_0x568d46){_0x2d19a5['push'](_0x2d19a5['shift']());}}}(a43_0x2abe,0x80f7d));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';function a43_0x1643(_0x20502c,_0x505463){_0x20502c=_0x20502c-0x102;const _0x2abeb0=a43_0x2abe();let _0x16434b=_0x2abeb0[_0x20502c];return _0x16434b;}import{withSpinner}from'../utils/spinner.js';function a43_0x2abe(){const _0x356121=['/j/da','Folder\x20ID:\x20','Site:\x20','dim','maxDepth','children','map','3220776BGylGA','length','No\x20items\x20match\x20pattern:\x20','8lgDrsT','Resolving\x20path\x20\x27','Folder/pattern\x20arg:\x20','\x20matching\x20\x27','segments','cause',',\x20and\x20','(not\x20set)','filter','1159941yOdokT','replace','error','listRecursive','journeyBundleName','Set\x20a\x20parent\x20segment\x20context\x20first:','List\x20folders\x20and\x20child\x20segments','message','sort','\x20\x20tdx\x20sg\x20use\x20\x22My\x20Audience\x22','/app/ps/','Recursive\x20mode:\x20enabled','log','\x20\x20Cause:\x20','Listing\x20folders,\x20segments,\x20and\x20journeys...','jsonl','folders','Error:\x20No\x20parent\x20segment\x20context\x20set.','\x27...','7XsXhxd','localeCompare','name','recursive','parentSegment','site','Parent\x20segment\x20context:\x20','execute','110duSYcm','Building\x20hierarchy\x20tree...','parentId','/e/','description','\x20segment','listWithPattern','includes','listUnifiedWithJourneys','journeys','3059810DNkcrg','2906991eFlMKa','\x20journey','journey','(empty)','Error:\x20','\x20folder','verbose','\x5c$&','Parent\x20ID:\x20','data','type','folderId','✔\x20Built\x20tree\x20with\x20','test','format',']\x20matching\x20\x27','segment','folder','426015osxZAh','979818rAWHYc','listUnified','\x20\x20tdx\x20sg\x20pull\x20\x22My\x20Audience\x22','resolvePathToResource','1925754onrLxa'];a43_0x2abe=function(){return _0x356121;};return a43_0x2abe();}import{formatFlatList,formatTree}from'../sdk/util/tree-formatter.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import a43_0x3826f4 from'chalk';export class SegmentsCommand extends BaseCommand{[a43_0x3b508(0x145)]=a43_0x3b508(0x12b);[a43_0x3b508(0x14f)]=a43_0x3b508(0x136);async[a43_0x3b508(0x14a)](_0x35ca68){const _0x16ce90=a43_0x3b508,{options:_0x5b983c,args:_0x128ab9}=_0x35ca68,_0x22a42f=_0x5b983c[_0x16ce90(0x146)],_0x68b1c5=_0x128ab9[0x0];try{const _0x143985=_0x5b983c[_0x16ce90(0x147)];_0x5b983c[_0x16ce90(0x10b)]&&(console[_0x16ce90(0x132)](_0x16ce90(0x11f)+_0x5b983c['site']),console['error'](_0x16ce90(0x149)+(_0x143985||_0x16ce90(0x12e))),_0x68b1c5&&console[_0x16ce90(0x132)](_0x16ce90(0x129)+_0x68b1c5),_0x22a42f&&console['error'](_0x16ce90(0x13b)));if(!_0x143985)return console[_0x16ce90(0x132)](_0x16ce90(0x141)),console[_0x16ce90(0x132)](''),console[_0x16ce90(0x132)](_0x16ce90(0x135)),console[_0x16ce90(0x132)](_0x16ce90(0x11a)),console[_0x16ce90(0x132)](_0x16ce90(0x139)),console[_0x16ce90(0x132)](''),console[_0x16ce90(0x132)]('Use\x20tdx\x20ps\x20list\x20to\x20see\x20available\x20parent\x20segments.'),0x1;const _0x4c64e8=_0x68b1c5&&(_0x68b1c5[_0x16ce90(0x152)]('*')||_0x68b1c5[_0x16ce90(0x152)]('?'));if(_0x4c64e8)return await this[_0x16ce90(0x151)](_0x35ca68,_0x143985,_0x68b1c5);const _0x279ef0=_0x68b1c5?_0x143985+'/'+_0x68b1c5:_0x143985;return _0x22a42f?await this[_0x16ce90(0x133)](_0x35ca68,_0x279ef0):await this[_0x16ce90(0x119)](_0x35ca68,_0x279ef0);}catch(_0x1305fb){if(_0x1305fb instanceof SDKError)return console[_0x16ce90(0x132)](_0x16ce90(0x109)+_0x1305fb[_0x16ce90(0x137)]),_0x1305fb[_0x16ce90(0x12c)]&&console['error'](_0x16ce90(0x13d)+_0x1305fb[_0x16ce90(0x12c)]),0x1;throw _0x1305fb;}}async[a43_0x3b508(0x151)](_0x2842bf,_0x461fb1,_0x3aea21){const _0x144ab0=a43_0x3b508,{options:_0x66cc03,tdx:_0x63c162}=_0x2842bf,_0x4c57e1=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x461fb1+_0x144ab0(0x142),()=>_0x63c162['segment'][_0x144ab0(0x11b)](_0x461fb1),{'verbose':_0x66cc03[_0x144ab0(0x10b)]}),_0x5ab779=_0x4c57e1['data'],_0x499dfb=await withSpinner(_0x144ab0(0x13e),()=>_0x63c162[_0x144ab0(0x115)][_0x144ab0(0x102)](_0x5ab779[_0x144ab0(0x14d)],_0x5ab779[_0x144ab0(0x110)]),{'verbose':_0x66cc03[_0x144ab0(0x10b)]}),{folders:_0x4f6ff2,segments:_0x4c099f,journeys:_0x24db71}=_0x499dfb['data'],_0x1b977c=_0x3aea21[_0x144ab0(0x131)](/[.+^${}()|[\]\\]/g,_0x144ab0(0x10c))[_0x144ab0(0x131)](/\*/g,'.*')['replace'](/\?/g,'.'),_0x3fd7ac=new RegExp('^'+_0x1b977c+'$','i'),_0x44f4d8=_0x4f6ff2[_0x144ab0(0x12f)](_0x4d92ea=>_0x3fd7ac[_0x144ab0(0x112)](_0x4d92ea[_0x144ab0(0x145)])),_0x10352c=_0x4c099f['filter'](_0x575366=>_0x3fd7ac[_0x144ab0(0x112)](_0x575366[_0x144ab0(0x145)])),_0x35ff57=_0x24db71['filter'](_0x2446d9=>_0x3fd7ac[_0x144ab0(0x112)](_0x2446d9[_0x144ab0(0x134)])),_0xa499b4=_0x44f4d8[_0x144ab0(0x125)]+_0x10352c[_0x144ab0(0x125)]+_0x35ff57[_0x144ab0(0x125)];console[_0x144ab0(0x132)]('✔\x20Found\x20'+_0x44f4d8[_0x144ab0(0x125)]+'\x20folder'+(_0x44f4d8['length']!==0x1?'s':'')+',\x20'+_0x10352c[_0x144ab0(0x125)]+_0x144ab0(0x150)+(_0x10352c[_0x144ab0(0x125)]!==0x1?'s':'')+_0x144ab0(0x12d)+_0x35ff57[_0x144ab0(0x125)]+'\x20journey'+(_0x35ff57['length']!==0x1?'s':'')+_0x144ab0(0x12a)+_0x3aea21+'\x27');const _0x20bd4e=_0x48ab66=>{const _0x3a3c22=_0x144ab0;return getConsoleNextUrl(_0x66cc03[_0x3a3c22(0x148)],_0x3a3c22(0x13a)+_0x5ab779[_0x3a3c22(0x14d)]+'/e/'+_0x48ab66);},_0x3de353=_0x66cc03[_0x144ab0(0x113)]==='json'||_0x66cc03[_0x144ab0(0x113)]===_0x144ab0(0x13f);if(_0x3de353){const _0x2c0607=[..._0x44f4d8[_0x144ab0(0x123)](_0x4dc4e1=>({..._0x4dc4e1,'type':_0x144ab0(0x116)})),..._0x10352c[_0x144ab0(0x123)](_0xb7cae8=>({..._0xb7cae8,'type':_0x144ab0(0x115),'url':_0x20bd4e(_0xb7cae8['id'])})),..._0x35ff57['map'](_0x45532a=>({..._0x45532a,'name':_0x45532a['journeyBundleName'],'type':_0x144ab0(0x107)}))]['sort']((_0x321546,_0x522339)=>_0x321546['name'][_0x144ab0(0x144)](_0x522339[_0x144ab0(0x145)]));await handleSDKOutput(_0x2c0607,_0x66cc03);}else{if(_0xa499b4===0x0)console['log'](_0x144ab0(0x126)+_0x3aea21);else{console[_0x144ab0(0x13c)](a43_0x3826f4[_0x144ab0(0x120)]('['+_0x461fb1+_0x144ab0(0x114)+_0x3aea21+'\x27'));const _0x2f2f70=formatFlatList(_0x44f4d8,_0x10352c,{'showMetadata':!![],'getSegmentUrl':_0x20bd4e},_0x35ff57);console['log'](_0x2f2f70);}}return 0x0;}async[a43_0x3b508(0x119)](_0x428b55,_0x4b5014){const _0x41ac6d=a43_0x3b508,{options:_0x196e72,tdx:_0x2b3a4a}=_0x428b55,_0x587f80=await withSpinner('Resolving\x20path\x20\x27'+_0x4b5014+_0x41ac6d(0x142),()=>_0x2b3a4a[_0x41ac6d(0x115)][_0x41ac6d(0x11b)](_0x4b5014),{'verbose':_0x196e72[_0x41ac6d(0x10b)]}),_0x195d46=_0x587f80[_0x41ac6d(0x10e)];_0x196e72['verbose']&&(console[_0x41ac6d(0x132)](_0x41ac6d(0x10d)+_0x195d46[_0x41ac6d(0x14d)]),_0x195d46['folderId']&&console[_0x41ac6d(0x132)](_0x41ac6d(0x11e)+_0x195d46['folderId']));const _0x1aee6e=await withSpinner(_0x41ac6d(0x13e),()=>_0x2b3a4a[_0x41ac6d(0x115)][_0x41ac6d(0x102)](_0x195d46[_0x41ac6d(0x14d)],_0x195d46[_0x41ac6d(0x110)]),{'verbose':_0x196e72[_0x41ac6d(0x10b)]}),{folders:_0x41bc1f,segments:_0x42f6fc,journeys:_0x4b8b38}=_0x1aee6e[_0x41ac6d(0x10e)],_0x24d042=_0x41bc1f[_0x41ac6d(0x125)]+_0x42f6fc[_0x41ac6d(0x125)]+_0x4b8b38[_0x41ac6d(0x125)];console[_0x41ac6d(0x132)]('✔\x20Found\x20'+_0x41bc1f[_0x41ac6d(0x125)]+_0x41ac6d(0x10a)+(_0x41bc1f[_0x41ac6d(0x125)]!==0x1?'s':'')+',\x20'+_0x42f6fc[_0x41ac6d(0x125)]+'\x20segment'+(_0x42f6fc[_0x41ac6d(0x125)]!==0x1?'s':'')+_0x41ac6d(0x12d)+_0x4b8b38['length']+_0x41ac6d(0x106)+(_0x4b8b38[_0x41ac6d(0x125)]!==0x1?'s':''));const _0x442a22=_0x33184e=>{const _0x2ad470=_0x41ac6d;return getConsoleNextUrl(_0x196e72[_0x2ad470(0x148)],_0x2ad470(0x13a)+_0x195d46[_0x2ad470(0x14d)]+_0x2ad470(0x14e)+_0x33184e);},_0x1285d9=_0x148b75=>{const _0x49e421=_0x41ac6d;return getConsoleNextUrl(_0x196e72[_0x49e421(0x148)],_0x49e421(0x13a)+_0x195d46[_0x49e421(0x14d)]+_0x49e421(0x14e)+_0x148b75+'/j/da');},_0x4bfa2c=_0x196e72[_0x41ac6d(0x113)]==='json'||_0x196e72[_0x41ac6d(0x113)]===_0x41ac6d(0x13f);if(_0x4bfa2c){const _0x7abd78=[..._0x41bc1f['map'](_0x5a612c=>({..._0x5a612c,'type':_0x41ac6d(0x116)})),..._0x42f6fc[_0x41ac6d(0x123)](_0x259493=>({..._0x259493,'type':_0x41ac6d(0x115),'url':_0x442a22(_0x259493['id'])})),..._0x4b8b38['map'](_0x1f4549=>({..._0x1f4549,'name':_0x1f4549[_0x41ac6d(0x134)],'type':_0x41ac6d(0x107),'url':_0x1285d9(_0x1f4549['id'])}))][_0x41ac6d(0x138)]((_0x517cd6,_0x453a55)=>_0x517cd6[_0x41ac6d(0x145)][_0x41ac6d(0x144)](_0x453a55[_0x41ac6d(0x145)]));await handleSDKOutput(_0x7abd78,_0x196e72);}else{if(_0x24d042===0x0)console[_0x41ac6d(0x13c)](a43_0x3826f4[_0x41ac6d(0x120)]('['+_0x4b5014+']')),console[_0x41ac6d(0x13c)](_0x41ac6d(0x108));else{console[_0x41ac6d(0x13c)](a43_0x3826f4[_0x41ac6d(0x120)]('['+_0x4b5014+']'));const _0x895eef=formatFlatList(_0x41bc1f,_0x42f6fc,{'showMetadata':!![],'getSegmentUrl':_0x442a22,'getJourneyUrl':_0x1285d9},_0x4b8b38);console['log'](_0x895eef);}}return 0x0;}async[a43_0x3b508(0x133)](_0x1e93c1,_0x36f1eb){const _0x4a5cc5=a43_0x3b508,{options:_0x58a167,tdx:_0x3a467f}=_0x1e93c1,_0x2a32df=await withSpinner(_0x4a5cc5(0x128)+_0x36f1eb+_0x4a5cc5(0x142),()=>_0x3a467f[_0x4a5cc5(0x115)][_0x4a5cc5(0x11b)](_0x36f1eb),{'verbose':_0x58a167[_0x4a5cc5(0x10b)]}),_0x246d95=_0x2a32df[_0x4a5cc5(0x10e)];_0x58a167[_0x4a5cc5(0x10b)]&&(console[_0x4a5cc5(0x132)](_0x4a5cc5(0x10d)+_0x246d95[_0x4a5cc5(0x14d)]),_0x246d95[_0x4a5cc5(0x110)]&&console[_0x4a5cc5(0x132)](_0x4a5cc5(0x11e)+_0x246d95[_0x4a5cc5(0x110)]));const _0x4bae36=_0x58a167[_0x4a5cc5(0x121)]||0xa,_0x231da3=await withSpinner(_0x4a5cc5(0x14c),()=>_0x3a467f['segment'][_0x4a5cc5(0x133)](_0x246d95['parentId'],_0x246d95['folderId'],0x0,_0x4bae36),{'verbose':_0x58a167[_0x4a5cc5(0x10b)]}),_0x26e1b7=_0x231da3[_0x4a5cc5(0x10e)],_0x4cf8bc=_0x7d4225=>{const _0x53c86f=_0x4a5cc5;let _0x306448=0x0,_0x2a71e1=0x0,_0x16ee12=0x0;for(const _0x3cbd0a of _0x7d4225){if(_0x3cbd0a[_0x53c86f(0x10f)]===_0x53c86f(0x116))_0x306448++;else{if(_0x3cbd0a['type']==='segment')_0x2a71e1++;else{if(_0x3cbd0a[_0x53c86f(0x10f)]===_0x53c86f(0x107))_0x16ee12++;}}if(_0x3cbd0a[_0x53c86f(0x122)]){const _0x34f1aa=_0x4cf8bc(_0x3cbd0a['children']);_0x306448+=_0x34f1aa[_0x53c86f(0x140)],_0x2a71e1+=_0x34f1aa['segments'],_0x16ee12+=_0x34f1aa[_0x53c86f(0x103)];}}return{'folders':_0x306448,'segments':_0x2a71e1,'journeys':_0x16ee12};},_0x890247=_0x4cf8bc(_0x26e1b7);console[_0x4a5cc5(0x132)](_0x4a5cc5(0x111)+_0x890247[_0x4a5cc5(0x140)]+_0x4a5cc5(0x10a)+(_0x890247[_0x4a5cc5(0x140)]!==0x1?'s':'')+',\x20'+_0x890247[_0x4a5cc5(0x12b)]+_0x4a5cc5(0x150)+(_0x890247[_0x4a5cc5(0x12b)]!==0x1?'s':'')+_0x4a5cc5(0x12d)+_0x890247[_0x4a5cc5(0x103)]+_0x4a5cc5(0x106)+(_0x890247[_0x4a5cc5(0x103)]!==0x1?'s':''));const _0x20cf47=_0x488525=>{const _0x3d95d1=_0x4a5cc5;return getConsoleNextUrl(_0x58a167[_0x3d95d1(0x148)],_0x3d95d1(0x13a)+_0x246d95[_0x3d95d1(0x14d)]+_0x3d95d1(0x14e)+_0x488525);},_0x5dfa66=_0x3b6ab7=>{const _0x578849=_0x4a5cc5;return getConsoleNextUrl(_0x58a167[_0x578849(0x148)],_0x578849(0x13a)+_0x246d95[_0x578849(0x14d)]+'/e/'+_0x3b6ab7+_0x578849(0x11d));};if(_0x58a167[_0x4a5cc5(0x113)]==='json'||_0x58a167[_0x4a5cc5(0x113)]===_0x4a5cc5(0x13f))await handleSDKOutput(_0x26e1b7,_0x58a167);else{console['log'](a43_0x3826f4[_0x4a5cc5(0x120)]('['+_0x36f1eb+']'));const _0x398a56=formatTree(_0x26e1b7,{'showMetadata':!![],'getSegmentUrl':_0x20cf47,'getJourneyUrl':_0x5dfa66});console['log'](_0x398a56);}return 0x0;}}
1
+ const a44_0x233c5b=a44_0x4ebf;(function(_0x28af77,_0x4cb372){const _0x45196d=a44_0x4ebf,_0x5a65a6=_0x28af77();while(!![]){try{const _0x5bec08=-parseInt(_0x45196d(0x12c))/0x1+-parseInt(_0x45196d(0x123))/0x2+parseInt(_0x45196d(0x15b))/0x3*(-parseInt(_0x45196d(0x13b))/0x4)+-parseInt(_0x45196d(0x14b))/0x5*(parseInt(_0x45196d(0x168))/0x6)+-parseInt(_0x45196d(0x165))/0x7+parseInt(_0x45196d(0x158))/0x8*(parseInt(_0x45196d(0x14d))/0x9)+-parseInt(_0x45196d(0x127))/0xa*(-parseInt(_0x45196d(0x169))/0xb);if(_0x5bec08===_0x4cb372)break;else _0x5a65a6['push'](_0x5a65a6['shift']());}catch(_0x501dd2){_0x5a65a6['push'](_0x5a65a6['shift']());}}}(a44_0x34b2,0x93640));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';function a44_0x4ebf(_0x5e6401,_0x538c87){_0x5e6401=_0x5e6401-0x120;const _0x34b2dc=a44_0x34b2();let _0x4ebf2a=_0x34b2dc[_0x5e6401];return _0x4ebf2a;}import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{formatFlatList,formatTree}from'../sdk/util/tree-formatter.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import a44_0x4bbc06 from'chalk';export class SegmentsCommand extends BaseCommand{[a44_0x233c5b(0x142)]='segments';[a44_0x233c5b(0x129)]='List\x20folders\x20and\x20child\x20segments';async[a44_0x233c5b(0x155)](_0x3a9761){const _0x5586c5=a44_0x233c5b,{options:_0x4c0f7a,args:_0x2340bf}=_0x3a9761,_0x2c72e6=_0x4c0f7a[_0x5586c5(0x12b)],_0x33a565=_0x2340bf[0x0];try{const _0x4ccc36=_0x4c0f7a['parentSegment'];_0x4c0f7a[_0x5586c5(0x162)]&&(console['error'](_0x5586c5(0x154)+_0x4c0f7a[_0x5586c5(0x149)]),console[_0x5586c5(0x15d)]('Parent\x20segment\x20context:\x20'+(_0x4ccc36||'(not\x20set)')),_0x33a565&&console['error'](_0x5586c5(0x157)+_0x33a565),_0x2c72e6&&console[_0x5586c5(0x15d)]('Recursive\x20mode:\x20enabled'));if(!_0x4ccc36)return console[_0x5586c5(0x15d)]('Error:\x20No\x20parent\x20segment\x20context\x20set.'),console['error'](''),console[_0x5586c5(0x15d)](_0x5586c5(0x133)),console[_0x5586c5(0x15d)](_0x5586c5(0x14c)),console[_0x5586c5(0x15d)](_0x5586c5(0x148)),console[_0x5586c5(0x15d)](''),console[_0x5586c5(0x15d)](_0x5586c5(0x156)),0x1;const _0x3a4750=_0x33a565&&(_0x33a565['includes']('*')||_0x33a565[_0x5586c5(0x126)]('?'));if(_0x3a4750)return await this['listWithPattern'](_0x3a9761,_0x4ccc36,_0x33a565);const _0x53a07b=_0x33a565?_0x4ccc36+'/'+_0x33a565:_0x4ccc36;return _0x2c72e6?await this['listRecursive'](_0x3a9761,_0x53a07b):await this[_0x5586c5(0x137)](_0x3a9761,_0x53a07b);}catch(_0x35dfb9){if(_0x35dfb9 instanceof SDKError)return console[_0x5586c5(0x15d)](_0x5586c5(0x163)+_0x35dfb9[_0x5586c5(0x145)]),_0x35dfb9[_0x5586c5(0x141)]&&console['error'](_0x5586c5(0x132)+_0x35dfb9[_0x5586c5(0x141)]),0x1;throw _0x35dfb9;}}async[a44_0x233c5b(0x159)](_0x1f7b82,_0x4fba4f,_0x1b703b){const _0x4df989=a44_0x233c5b,{options:_0x28328f,tdx:_0x2693a7}=_0x1f7b82,_0x2b4a0e=await withSpinner(_0x4df989(0x161)+_0x4fba4f+_0x4df989(0x12f),()=>_0x2693a7[_0x4df989(0x15f)][_0x4df989(0x13a)](_0x4fba4f),{'verbose':_0x28328f[_0x4df989(0x162)]}),_0xee706c=_0x2b4a0e[_0x4df989(0x15e)],_0x40c6d6=await withSpinner(_0x4df989(0x120),()=>_0x2693a7[_0x4df989(0x15f)][_0x4df989(0x139)](_0xee706c['parentId'],_0xee706c[_0x4df989(0x135)]),{'verbose':_0x28328f[_0x4df989(0x162)]}),{folders:_0x44890c,segments:_0x98b871,journeys:_0x530c64}=_0x40c6d6[_0x4df989(0x15e)],_0xbe2a3c=_0x1b703b[_0x4df989(0x138)](/[.+^${}()|[\]\\]/g,_0x4df989(0x151))[_0x4df989(0x138)](/\*/g,'.*')[_0x4df989(0x138)](/\?/g,'.'),_0x5a053c=new RegExp('^'+_0xbe2a3c+'$','i'),_0x35a7b0=_0x44890c[_0x4df989(0x140)](_0x3f84a1=>_0x5a053c[_0x4df989(0x15c)](_0x3f84a1[_0x4df989(0x142)])),_0x4f8a7a=_0x98b871[_0x4df989(0x140)](_0x4963ec=>_0x5a053c[_0x4df989(0x15c)](_0x4963ec[_0x4df989(0x142)])),_0x126db9=_0x530c64['filter'](_0x4d51db=>_0x5a053c['test'](_0x4d51db['journeyBundleName'])),_0x535386=_0x35a7b0[_0x4df989(0x167)]+_0x4f8a7a[_0x4df989(0x167)]+_0x126db9[_0x4df989(0x167)];console[_0x4df989(0x15d)]('✔\x20Found\x20'+_0x35a7b0['length']+'\x20folder'+(_0x35a7b0[_0x4df989(0x167)]!==0x1?'s':'')+',\x20'+_0x4f8a7a[_0x4df989(0x167)]+_0x4df989(0x147)+(_0x4f8a7a['length']!==0x1?'s':'')+_0x4df989(0x13f)+_0x126db9[_0x4df989(0x167)]+'\x20journey'+(_0x126db9[_0x4df989(0x167)]!==0x1?'s':'')+_0x4df989(0x14a)+_0x1b703b+'\x27');const _0x2de61c=_0x2539f4=>{const _0x3af36b=_0x4df989;return getConsoleNextUrl(_0x28328f[_0x3af36b(0x149)],_0x3af36b(0x12a)+_0xee706c[_0x3af36b(0x134)]+_0x3af36b(0x124)+_0x2539f4);},_0x29e332=_0x28328f['format']===_0x4df989(0x146)||_0x28328f[_0x4df989(0x121)]===_0x4df989(0x153);if(_0x29e332){const _0x4db901=[..._0x35a7b0[_0x4df989(0x14f)](_0x3bb47a=>({..._0x3bb47a,'type':_0x4df989(0x136)})),..._0x4f8a7a[_0x4df989(0x14f)](_0x11151f=>({..._0x11151f,'type':_0x4df989(0x15f),'url':_0x2de61c(_0x11151f['id'])})),..._0x126db9['map'](_0x12a89c=>({..._0x12a89c,'name':_0x12a89c['journeyBundleName'],'type':'journey'}))]['sort']((_0x1d4136,_0x5aba7d)=>_0x1d4136['name'][_0x4df989(0x130)](_0x5aba7d[_0x4df989(0x142)]));await handleSDKOutput(_0x4db901,_0x28328f);}else{if(_0x535386===0x0)console[_0x4df989(0x13e)](_0x4df989(0x125)+_0x1b703b);else{console['log'](a44_0x4bbc06[_0x4df989(0x152)]('['+_0x4fba4f+']\x20matching\x20\x27'+_0x1b703b+'\x27'));const _0x4775a7=formatFlatList(_0x35a7b0,_0x4f8a7a,{'showMetadata':!![],'getSegmentUrl':_0x2de61c},_0x126db9);console[_0x4df989(0x13e)](_0x4775a7);}}return 0x0;}async[a44_0x233c5b(0x137)](_0x5dc058,_0xbaa1cb){const _0x841b5f=a44_0x233c5b,{options:_0x2692d0,tdx:_0x2906a1}=_0x5dc058,_0x40c123=await withSpinner(_0x841b5f(0x150)+_0xbaa1cb+_0x841b5f(0x12f),()=>_0x2906a1['segment'][_0x841b5f(0x13a)](_0xbaa1cb),{'verbose':_0x2692d0[_0x841b5f(0x162)]}),_0x2a9b3b=_0x40c123[_0x841b5f(0x15e)];_0x2692d0[_0x841b5f(0x162)]&&(console[_0x841b5f(0x15d)]('Parent\x20ID:\x20'+_0x2a9b3b[_0x841b5f(0x134)]),_0x2a9b3b[_0x841b5f(0x135)]&&console[_0x841b5f(0x15d)](_0x841b5f(0x12e)+_0x2a9b3b[_0x841b5f(0x135)]));const _0xc58971=await withSpinner('Listing\x20folders,\x20segments,\x20and\x20journeys...',()=>_0x2906a1[_0x841b5f(0x15f)][_0x841b5f(0x139)](_0x2a9b3b[_0x841b5f(0x134)],_0x2a9b3b[_0x841b5f(0x135)]),{'verbose':_0x2692d0[_0x841b5f(0x162)]}),{folders:_0x44fbc5,segments:_0x1fa32f,journeys:_0x5a7a73}=_0xc58971[_0x841b5f(0x15e)],_0x44b4ba=_0x44fbc5[_0x841b5f(0x167)]+_0x1fa32f['length']+_0x5a7a73[_0x841b5f(0x167)];console[_0x841b5f(0x15d)]('✔\x20Found\x20'+_0x44fbc5[_0x841b5f(0x167)]+_0x841b5f(0x160)+(_0x44fbc5[_0x841b5f(0x167)]!==0x1?'s':'')+',\x20'+_0x1fa32f[_0x841b5f(0x167)]+'\x20segment'+(_0x1fa32f[_0x841b5f(0x167)]!==0x1?'s':'')+_0x841b5f(0x13f)+_0x5a7a73[_0x841b5f(0x167)]+_0x841b5f(0x128)+(_0x5a7a73['length']!==0x1?'s':''));const _0x2731e4=_0xe0ebbc=>{const _0x19c1f6=_0x841b5f;return getConsoleNextUrl(_0x2692d0['site'],_0x19c1f6(0x12a)+_0x2a9b3b['parentId']+_0x19c1f6(0x124)+_0xe0ebbc);},_0x5033e=_0x220b88=>{const _0x3703aa=_0x841b5f;return getConsoleNextUrl(_0x2692d0[_0x3703aa(0x149)],_0x3703aa(0x12a)+_0x2a9b3b['parentId']+_0x3703aa(0x124)+_0x220b88+_0x3703aa(0x143));},_0x4c68b0=_0x2692d0[_0x841b5f(0x121)]===_0x841b5f(0x146)||_0x2692d0[_0x841b5f(0x121)]===_0x841b5f(0x153);if(_0x4c68b0){const _0x587df7=[..._0x44fbc5['map'](_0x4a0352=>({..._0x4a0352,'type':_0x841b5f(0x136)})),..._0x1fa32f[_0x841b5f(0x14f)](_0x3c734=>({..._0x3c734,'type':'segment','url':_0x2731e4(_0x3c734['id'])})),..._0x5a7a73['map'](_0x98436f=>({..._0x98436f,'name':_0x98436f['journeyBundleName'],'type':_0x841b5f(0x13d),'url':_0x5033e(_0x98436f['id'])}))]['sort']((_0x485022,_0x2cb531)=>_0x485022[_0x841b5f(0x142)][_0x841b5f(0x130)](_0x2cb531[_0x841b5f(0x142)]));await handleSDKOutput(_0x587df7,_0x2692d0);}else{if(_0x44b4ba===0x0)console[_0x841b5f(0x13e)](a44_0x4bbc06[_0x841b5f(0x152)]('['+_0xbaa1cb+']')),console[_0x841b5f(0x13e)](_0x841b5f(0x16a));else{console[_0x841b5f(0x13e)](a44_0x4bbc06[_0x841b5f(0x152)]('['+_0xbaa1cb+']'));const _0xe3bea6=formatFlatList(_0x44fbc5,_0x1fa32f,{'showMetadata':!![],'getSegmentUrl':_0x2731e4,'getJourneyUrl':_0x5033e},_0x5a7a73);console[_0x841b5f(0x13e)](_0xe3bea6);}}return 0x0;}async[a44_0x233c5b(0x131)](_0x309bb0,_0x3af9e2){const _0x118c98=a44_0x233c5b,{options:_0x5a3929,tdx:_0x2368d9}=_0x309bb0,_0xa576b6=await withSpinner('Resolving\x20path\x20\x27'+_0x3af9e2+_0x118c98(0x12f),()=>_0x2368d9[_0x118c98(0x15f)]['resolvePathToResource'](_0x3af9e2),{'verbose':_0x5a3929[_0x118c98(0x162)]}),_0x328ac5=_0xa576b6[_0x118c98(0x15e)];_0x5a3929['verbose']&&(console[_0x118c98(0x15d)](_0x118c98(0x122)+_0x328ac5[_0x118c98(0x134)]),_0x328ac5[_0x118c98(0x135)]&&console[_0x118c98(0x15d)](_0x118c98(0x12e)+_0x328ac5[_0x118c98(0x135)]));const _0x3dd486=_0x5a3929[_0x118c98(0x15a)]||0xa,_0x1be34a=await withSpinner('Building\x20hierarchy\x20tree...',()=>_0x2368d9[_0x118c98(0x15f)][_0x118c98(0x131)](_0x328ac5[_0x118c98(0x134)],_0x328ac5['folderId'],0x0,_0x3dd486),{'verbose':_0x5a3929['verbose']}),_0x48e74e=_0x1be34a[_0x118c98(0x15e)],_0x3b233b=_0x83bd05=>{const _0x7b08b5=_0x118c98;let _0x1bca2b=0x0,_0x5f5050=0x0,_0x2e7ddc=0x0;for(const _0x42fbea of _0x83bd05){if(_0x42fbea[_0x7b08b5(0x12d)]===_0x7b08b5(0x136))_0x1bca2b++;else{if(_0x42fbea[_0x7b08b5(0x12d)]==='segment')_0x5f5050++;else{if(_0x42fbea[_0x7b08b5(0x12d)]===_0x7b08b5(0x13d))_0x2e7ddc++;}}if(_0x42fbea[_0x7b08b5(0x166)]){const _0x3e134c=_0x3b233b(_0x42fbea[_0x7b08b5(0x166)]);_0x1bca2b+=_0x3e134c[_0x7b08b5(0x164)],_0x5f5050+=_0x3e134c[_0x7b08b5(0x13c)],_0x2e7ddc+=_0x3e134c['journeys'];}}return{'folders':_0x1bca2b,'segments':_0x5f5050,'journeys':_0x2e7ddc};},_0x83a309=_0x3b233b(_0x48e74e);console[_0x118c98(0x15d)](_0x118c98(0x144)+_0x83a309['folders']+_0x118c98(0x160)+(_0x83a309[_0x118c98(0x164)]!==0x1?'s':'')+',\x20'+_0x83a309[_0x118c98(0x13c)]+_0x118c98(0x147)+(_0x83a309[_0x118c98(0x13c)]!==0x1?'s':'')+_0x118c98(0x13f)+_0x83a309[_0x118c98(0x14e)]+_0x118c98(0x128)+(_0x83a309[_0x118c98(0x14e)]!==0x1?'s':''));const _0x312cd5=_0x2b4a27=>{const _0x16bde8=_0x118c98;return getConsoleNextUrl(_0x5a3929['site'],_0x16bde8(0x12a)+_0x328ac5[_0x16bde8(0x134)]+_0x16bde8(0x124)+_0x2b4a27);},_0x5d2032=_0x15b818=>{const _0x229492=_0x118c98;return getConsoleNextUrl(_0x5a3929['site'],_0x229492(0x12a)+_0x328ac5['parentId']+_0x229492(0x124)+_0x15b818+_0x229492(0x143));};if(_0x5a3929[_0x118c98(0x121)]===_0x118c98(0x146)||_0x5a3929[_0x118c98(0x121)]===_0x118c98(0x153))await handleSDKOutput(_0x48e74e,_0x5a3929);else{console[_0x118c98(0x13e)](a44_0x4bbc06[_0x118c98(0x152)]('['+_0x3af9e2+']'));const _0xc512d3=formatTree(_0x48e74e,{'showMetadata':!![],'getSegmentUrl':_0x312cd5,'getJourneyUrl':_0x5d2032});console['log'](_0xc512d3);}return 0x0;}}function a44_0x34b2(){const _0x29f810=['site','\x20matching\x20\x27','44430BxYWTV','\x20\x20tdx\x20sg\x20pull\x20\x22My\x20Audience\x22','1962693kTuaXk','journeys','map','Resolving\x20path\x20\x27','\x5c$&','dim','jsonl','Site:\x20','execute','Use\x20tdx\x20ps\x20list\x20to\x20see\x20available\x20parent\x20segments.','Folder/pattern\x20arg:\x20','8jHQLgG','listWithPattern','maxDepth','597aCewkF','test','error','data','segment','\x20folder','Resolving\x20parent\x20segment\x20\x27','verbose','Error:\x20','folders','2265039ijUoiL','children','length','30hLtPAG','1110153UnLdel','(empty)','Listing\x20folders,\x20segments,\x20and\x20journeys...','format','Parent\x20ID:\x20','744416xgEJYa','/e/','No\x20items\x20match\x20pattern:\x20','includes','210PYnDtU','\x20journey','description','/app/ps/','recursive','303202UYDHYX','type','Folder\x20ID:\x20','\x27...','localeCompare','listRecursive','\x20\x20Cause:\x20','Set\x20a\x20parent\x20segment\x20context\x20first:','parentId','folderId','folder','listUnified','replace','listUnifiedWithJourneys','resolvePathToResource','13876ahJRuv','segments','journey','log',',\x20and\x20','filter','cause','name','/j/da','✔\x20Built\x20tree\x20with\x20','message','json','\x20segment','\x20\x20tdx\x20sg\x20use\x20\x22My\x20Audience\x22'];a44_0x34b2=function(){return _0x29f810;};return a44_0x34b2();}
@@ -1 +1 @@
1
- const a44_0x57b848=a44_0x597d;(function(_0x89d8b1,_0x3b20ef){const _0x42cb83=a44_0x597d,_0x5ca496=_0x89d8b1();while(!![]){try{const _0x1fa3f0=-parseInt(_0x42cb83(0x1ba))/0x1+parseInt(_0x42cb83(0x1a6))/0x2*(-parseInt(_0x42cb83(0x19a))/0x3)+parseInt(_0x42cb83(0x1bd))/0x4*(-parseInt(_0x42cb83(0x1c0))/0x5)+-parseInt(_0x42cb83(0x1a1))/0x6+-parseInt(_0x42cb83(0x1b4))/0x7+parseInt(_0x42cb83(0x19b))/0x8*(parseInt(_0x42cb83(0x1a3))/0x9)+parseInt(_0x42cb83(0x1ae))/0xa;if(_0x1fa3f0===_0x3b20ef)break;else _0x5ca496['push'](_0x5ca496['shift']());}catch(_0x2a6d80){_0x5ca496['push'](_0x5ca496['shift']());}}}(a44_0x1a34,0xcc288));function a44_0x1a34(){const _0x538f54=['\x20\x20Cause:\x20','2673282zWUJMM','data','297ZEmOuc','✔\x20Query\x20successful\x20-\x200\x20rows\x20returned','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','3009794axqZAz','\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>','Site:\x20','site','✔\x20Retrieved\x20','verbose','\x20row','\x20from\x20','61001960WLNEkJ','showTable','length','args','limit','database','4539059NmhNJN','Limit:\x20','Database:\x20','Usage:\x20tdx\x20show\x20<database.table>','cause','validate','1650750HdXVNL','name','Error:\x20','24BZmPOd','execute','Querying\x20','1270895EpyTIy','table','Catalog:\x20','\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>','description','3bTjAPf','123816UbTqSe','...','error','query','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'];a44_0x1a34=function(){return _0x538f54;};return a44_0x1a34();}import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';function a44_0x597d(_0x7a72f0,_0xbde5ed){_0x7a72f0=_0x7a72f0-0x19a;const _0x1a347a=a44_0x1a34();let _0x597da3=_0x1a347a[_0x7a72f0];return _0x597da3;}import{handleSDKOutput}from'../core/command-output.js';import{parseTableReference,validateTableDescribeReference}from'../utils/table-ref-parser.js';import{withSpinner}from'../utils/spinner.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';export class ShowCommand extends BaseCommand{[a44_0x57b848(0x1bb)]='show';[a44_0x57b848(0x1c4)]='Show\x20table\x20contents';async[a44_0x57b848(0x1be)](_0x124e58){return this['showTable'](_0x124e58);}async[a44_0x57b848(0x1af)](_0x545d9f){const _0xdd031=a44_0x57b848,{options:_0x50b4f9,args:_0x441057,tdx:_0x57eb32}=_0x545d9f;let _0x56ddea;try{_0x56ddea=parseTableReference(_0x441057[0x0]);const _0x44db8b=_0x50b4f9['database'];!_0x56ddea['database']&&_0x44db8b&&(_0x56ddea[_0xdd031(0x1b3)]=_0x44db8b);const _0x21d45a=validateTableDescribeReference(_0x56ddea);if(_0x21d45a)return console[_0xdd031(0x19d)](_0xdd031(0x1bc)+_0x21d45a),console[_0xdd031(0x19d)](_0xdd031(0x1b7)),console[_0xdd031(0x19d)](_0xdd031(0x1a7)),console[_0xdd031(0x19d)]('\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>'),0x1;}catch(_0x55d849){return console[_0xdd031(0x19d)](_0xdd031(0x1bc)+_0x55d849['message']),console[_0xdd031(0x19d)](_0xdd031(0x1b7)),console[_0xdd031(0x19d)](_0xdd031(0x1a7)),console['error'](_0xdd031(0x1c3)),0x1;}const _0x1ecceb=_0x56ddea['catalog'],_0x532d58=_0x56ddea[_0xdd031(0x1b3)],_0x5b465c=_0x56ddea[_0xdd031(0x1c1)],_0x5ca10b=resolveLimit(_0x50b4f9[_0xdd031(0x1b2)],DEFAULT_DISPLAY_LIMIT);try{_0x50b4f9[_0xdd031(0x1ab)]&&(console[_0xdd031(0x19d)](_0xdd031(0x1a8)+_0x50b4f9[_0xdd031(0x1a9)]),_0x1ecceb&&console[_0xdd031(0x19d)](_0xdd031(0x1c2)+_0x1ecceb),console[_0xdd031(0x19d)](_0xdd031(0x1b6)+_0x532d58),console[_0xdd031(0x19d)]('Table:\x20'+_0x5b465c),console[_0xdd031(0x19d)](_0xdd031(0x1b5)+_0x5ca10b));const _0x4dd7b9=_0x1ecceb?_0x1ecceb+'.'+_0x532d58+'.'+_0x5b465c:_0x532d58+'.'+_0x5b465c,_0x182884=await withSpinner(_0xdd031(0x1bf)+_0x4dd7b9+_0xdd031(0x19c),()=>_0x57eb32[_0xdd031(0x19e)][_0xdd031(0x1af)](_0x532d58,_0x5b465c,_0x5ca10b,_0x1ecceb),{'verbose':_0x50b4f9['verbose']}),_0x5ca9f8=_0x182884[_0xdd031(0x1a2)],_0x585056=_0x5ca9f8[_0xdd031(0x1a2)];return _0x585056['length']===0x0?console['error'](_0xdd031(0x1a4)):console[_0xdd031(0x19d)](_0xdd031(0x1aa)+_0x585056[_0xdd031(0x1b0)]+_0xdd031(0x1ac)+(_0x585056[_0xdd031(0x1b0)]!==0x1?'s':'')+_0xdd031(0x1ad)+_0x4dd7b9),await handleSDKOutput(_0x585056,_0x50b4f9),0x0;}catch(_0x20de22){if(_0x20de22 instanceof SDKError)return console[_0xdd031(0x19d)](_0xdd031(0x1bc)+_0x20de22['message']),_0x20de22[_0xdd031(0x1b8)]&&console['error'](_0xdd031(0x1a0)+_0x20de22[_0xdd031(0x1b8)]),0x1;throw _0x20de22;}}[a44_0x57b848(0x1b9)](_0x430985){const _0x16f397=a44_0x57b848;if(_0x430985[_0x16f397(0x1b1)][_0x16f397(0x1b0)]===0x0)return _0x16f397(0x19f);if(_0x430985[_0x16f397(0x1b1)][_0x16f397(0x1b0)]>0x1)return _0x16f397(0x1a5);return undefined;}}
1
+ const a45_0x1594d3=a45_0x40b3;(function(_0x3d9859,_0x5613c3){const _0x311e3c=a45_0x40b3,_0x234aad=_0x3d9859();while(!![]){try{const _0xc776d2=parseInt(_0x311e3c(0x1f0))/0x1+-parseInt(_0x311e3c(0x1dd))/0x2+parseInt(_0x311e3c(0x1ed))/0x3*(parseInt(_0x311e3c(0x1d7))/0x4)+parseInt(_0x311e3c(0x1e7))/0x5*(-parseInt(_0x311e3c(0x1d3))/0x6)+parseInt(_0x311e3c(0x1d0))/0x7+-parseInt(_0x311e3c(0x1cf))/0x8+-parseInt(_0x311e3c(0x1ef))/0x9*(-parseInt(_0x311e3c(0x1cb))/0xa);if(_0xc776d2===_0x5613c3)break;else _0x234aad['push'](_0x234aad['shift']());}catch(_0x175427){_0x234aad['push'](_0x234aad['shift']());}}}(a45_0x13e9,0xa4ffe));function a45_0x40b3(_0x51c5b1,_0x3194ba){_0x51c5b1=_0x51c5b1-0x1ca;const _0x13e94a=a45_0x13e9();let _0x40b324=_0x13e94a[_0x51c5b1];return _0x40b324;}import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';function a45_0x13e9(){const _0x2dd2c1=['2426136MUEtaK','6001877GSVIBD','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','6811782gwgoVh','showTable','data','Database:\x20','4tukXhs','validate','message','...','description','name','791746GAMOLR','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','\x20from\x20','\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>','show','error','Catalog:\x20','Error:\x20','✔\x20Query\x20successful\x20-\x200\x20rows\x20returned','Usage:\x20tdx\x20show\x20<database.table>','5goAmxh','args','table','Limit:\x20','catalog','limit','556761AcDXEB','length','9OqPdcf','1086914pSoBXi','Show\x20table\x20contents','database','site','✔\x20Retrieved\x20','cause','3803630tVnuqz','verbose','Querying\x20','\x20row'];a45_0x13e9=function(){return _0x2dd2c1;};return a45_0x13e9();}import{handleSDKOutput}from'../core/command-output.js';import{parseTableReference,validateTableDescribeReference}from'../utils/table-ref-parser.js';import{withSpinner}from'../utils/spinner.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';export class ShowCommand extends BaseCommand{[a45_0x1594d3(0x1dc)]=a45_0x1594d3(0x1e1);[a45_0x1594d3(0x1db)]=a45_0x1594d3(0x1f1);async['execute'](_0x237f89){const _0x43cfa9=a45_0x1594d3;return this[_0x43cfa9(0x1d4)](_0x237f89);}async[a45_0x1594d3(0x1d4)](_0xf54458){const _0x1e8825=a45_0x1594d3,{options:_0x1dfa44,args:_0xfd3d5a,tdx:_0xa6d8df}=_0xf54458;let _0x332f9e;try{_0x332f9e=parseTableReference(_0xfd3d5a[0x0]);const _0x3660a0=_0x1dfa44['database'];!_0x332f9e['database']&&_0x3660a0&&(_0x332f9e[_0x1e8825(0x1f2)]=_0x3660a0);const _0x1b46fa=validateTableDescribeReference(_0x332f9e);if(_0x1b46fa)return console[_0x1e8825(0x1e2)](_0x1e8825(0x1e4)+_0x1b46fa),console[_0x1e8825(0x1e2)](_0x1e8825(0x1e6)),console[_0x1e8825(0x1e2)]('\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>'),console[_0x1e8825(0x1e2)](_0x1e8825(0x1e0)),0x1;}catch(_0x4229bc){return console['error']('Error:\x20'+_0x4229bc['message']),console[_0x1e8825(0x1e2)](_0x1e8825(0x1e6)),console[_0x1e8825(0x1e2)]('\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>'),console[_0x1e8825(0x1e2)]('\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>'),0x1;}const _0x447378=_0x332f9e[_0x1e8825(0x1eb)],_0x209520=_0x332f9e[_0x1e8825(0x1f2)],_0x28a740=_0x332f9e[_0x1e8825(0x1e9)],_0x12d650=resolveLimit(_0x1dfa44[_0x1e8825(0x1ec)],DEFAULT_DISPLAY_LIMIT);try{_0x1dfa44[_0x1e8825(0x1cc)]&&(console[_0x1e8825(0x1e2)]('Site:\x20'+_0x1dfa44[_0x1e8825(0x1f3)]),_0x447378&&console[_0x1e8825(0x1e2)](_0x1e8825(0x1e3)+_0x447378),console[_0x1e8825(0x1e2)](_0x1e8825(0x1d6)+_0x209520),console[_0x1e8825(0x1e2)]('Table:\x20'+_0x28a740),console[_0x1e8825(0x1e2)](_0x1e8825(0x1ea)+_0x12d650));const _0x90f0a6=_0x447378?_0x447378+'.'+_0x209520+'.'+_0x28a740:_0x209520+'.'+_0x28a740,_0x4aa3da=await withSpinner(_0x1e8825(0x1cd)+_0x90f0a6+_0x1e8825(0x1da),()=>_0xa6d8df[_0x1e8825(0x1d1)][_0x1e8825(0x1d4)](_0x209520,_0x28a740,_0x12d650,_0x447378),{'verbose':_0x1dfa44[_0x1e8825(0x1cc)]}),_0x7efd0f=_0x4aa3da[_0x1e8825(0x1d5)],_0xf4a9a0=_0x7efd0f['data'];return _0xf4a9a0['length']===0x0?console[_0x1e8825(0x1e2)](_0x1e8825(0x1e5)):console[_0x1e8825(0x1e2)](_0x1e8825(0x1f4)+_0xf4a9a0[_0x1e8825(0x1ee)]+_0x1e8825(0x1ce)+(_0xf4a9a0[_0x1e8825(0x1ee)]!==0x1?'s':'')+_0x1e8825(0x1df)+_0x90f0a6),await handleSDKOutput(_0xf4a9a0,_0x1dfa44),0x0;}catch(_0x4006b9){if(_0x4006b9 instanceof SDKError)return console[_0x1e8825(0x1e2)]('Error:\x20'+_0x4006b9[_0x1e8825(0x1d9)]),_0x4006b9[_0x1e8825(0x1ca)]&&console[_0x1e8825(0x1e2)]('\x20\x20Cause:\x20'+_0x4006b9[_0x1e8825(0x1ca)]),0x1;throw _0x4006b9;}}[a45_0x1594d3(0x1d8)](_0x6caf75){const _0x4f31af=a45_0x1594d3;if(_0x6caf75[_0x4f31af(0x1e8)]['length']===0x0)return _0x4f31af(0x1de);if(_0x6caf75['args']['length']>0x1)return _0x4f31af(0x1d2);return undefined;}}
@@ -1 +1 @@
1
- const a45_0x5cd667=a45_0x54b6;(function(_0x514c18,_0x5794e1){const _0x580e75=a45_0x54b6,_0x243e17=_0x514c18();while(!![]){try{const _0x112e1f=-parseInt(_0x580e75(0xa8))/0x1*(-parseInt(_0x580e75(0xc7))/0x2)+parseInt(_0x580e75(0xb6))/0x3+-parseInt(_0x580e75(0xc3))/0x4*(parseInt(_0x580e75(0xd1))/0x5)+-parseInt(_0x580e75(0xcb))/0x6+-parseInt(_0x580e75(0xc1))/0x7*(parseInt(_0x580e75(0xd8))/0x8)+-parseInt(_0x580e75(0xb7))/0x9+parseInt(_0x580e75(0xce))/0xa;if(_0x112e1f===_0x5794e1)break;else _0x243e17['push'](_0x243e17['shift']());}catch(_0x5d14ad){_0x243e17['push'](_0x243e17['shift']());}}}(a45_0x4e0f,0x5bf5f));import{BaseCommand,printAuthError}from'./command.js';import{resolveAPIKeyAsync}from'../core/config.js';import{getOAuthTokens}from'../core/oauth-keychain.js';import{HTTPClientError}from'../sdk/client/http-client.js';function a45_0x54b6(_0x1a4d2d,_0x5d8468){_0x1a4d2d=_0x1a4d2d-0xa5;const _0x4e0fc3=a45_0x4e0f();let _0x54b6fd=_0x4e0fc3[_0x1a4d2d];return _0x54b6fd;}import{GlobalContext}from'../core/global-context.js';import a45_0xc67129 from'chalk';function a45_0x4e0f(){const _0x5d6c24=['getUserInfo','env','\x20profile:\x20','35LRRHpu','jobs','944236heYkjl','profileSource','Name:','displayWithSources','834630ybrUnN','filter','Credential\x20type:\x20','bold','1595688pPIDnP','cli','No\x20credential\x20found','11606140Kjwzgp','Read\x20credential\x20from\x20','name','10FljiRQ','(from\x20','site:\x20','execute','red','tdx','last_name','153776NNGUwe','message','email','description','1uDfdXr','CLI\x20flag','N/A','error','config','first_name','yellow','cyan','green','Show\x20authentication\x20status\x20and\x20current\x20context','✓\x20Authentication\x20successful\x0a','✗\x20Validation\x20failed:\x20','join','account_id','445146gaqsnk','4639176OzrnQK','profile','log','OAuth','site','Account\x20ID:','dim'];a45_0x4e0f=function(){return _0x5d6c24;};return a45_0x4e0f();}export class StatusCommand extends BaseCommand{[a45_0x5cd667(0xd0)]='status';[a45_0x5cd667(0xa7)]=a45_0x5cd667(0xb1);async[a45_0x5cd667(0xd4)](_0x327cf8){const _0x41771e=a45_0x5cd667,{options:_0x3b72c3,tdx:_0x4fb141}=_0x327cf8,_0x233109=_0x3b72c3[_0x41771e(0xbb)],_0x1db1b0=new GlobalContext(_0x3b72c3),_0x36e020=_0x1db1b0[_0x41771e(0xb8)],_0x403047=_0x1db1b0[_0x41771e(0xc4)],_0x4f2ca4=_0x403047===_0x41771e(0xcc)?_0x41771e(0xa9):_0x403047==='session'?'session':_0x403047===_0x41771e(0xbf)?'TDX_PROFILE\x20env':_0x403047===_0x41771e(0xac)?_0x41771e(0xac):null,_0xca07fc=_0x36e020?a45_0xc67129[_0x41771e(0xaf)](_0x36e020):a45_0xc67129[_0x41771e(0xbd)](_0x41771e(0xaa)),_0x3be454=_0x4f2ca4?'\x20'+a45_0xc67129['dim'](_0x41771e(0xd2)+_0x4f2ca4+')'):'';console[_0x41771e(0xb9)](a45_0xc67129['bold'](_0x41771e(0xd6))+_0x41771e(0xc0)+_0xca07fc+_0x3be454+'\x20'+a45_0xc67129['dim']('(')+_0x41771e(0xd3)+a45_0xc67129[_0x41771e(0xaf)](_0x233109)+a45_0xc67129['dim'](')'));const _0x2a8102=await getOAuthTokens(_0x36e020);if(_0x2a8102)console[_0x41771e(0xb9)](_0x41771e(0xc9)+a45_0xc67129[_0x41771e(0xaf)](_0x41771e(0xba)));else{const _0x2db8a9=await resolveAPIKeyAsync(_0x233109,_0x36e020);if(_0x2db8a9){const {source:_0x45130a,isDeprecated:_0x5e6c45}=_0x2db8a9,_0x29e732=_0x41771e(0xcf)+a45_0xc67129['cyan'](_0x45130a);console[_0x41771e(0xb9)](_0x5e6c45?a45_0xc67129[_0x41771e(0xae)](_0x29e732):_0x29e732);}else console[_0x41771e(0xb9)](a45_0xc67129[_0x41771e(0xae)](_0x41771e(0xcd)));}let _0x217e07=![];try{const _0x138b60=await _0x4fb141[_0x41771e(0xc2)][_0x41771e(0xbe)]();console[_0x41771e(0xb9)](a45_0xc67129[_0x41771e(0xb0)](_0x41771e(0xb2))),console[_0x41771e(0xb9)](a45_0xc67129[_0x41771e(0xca)]('User:')+'\x20'+a45_0xc67129['cyan'](_0x138b60[_0x41771e(0xa6)]));if(_0x138b60[_0x41771e(0xad)]||_0x138b60[_0x41771e(0xd7)]){const _0x4d717a=[_0x138b60[_0x41771e(0xad)],_0x138b60['last_name']][_0x41771e(0xc8)](Boolean)[_0x41771e(0xb4)]('\x20');console[_0x41771e(0xb9)](a45_0xc67129[_0x41771e(0xca)](_0x41771e(0xc5))+'\x20'+_0x4d717a);}_0x138b60[_0x41771e(0xb5)]&&console['log'](a45_0xc67129['bold'](_0x41771e(0xbc))+'\x20'+a45_0xc67129[_0x41771e(0xae)](_0x138b60['account_id'])),_0x217e07=!![];}catch(_0x469908){_0x469908 instanceof HTTPClientError&&_0x469908['status']===0x191?printAuthError(_0x469908,!![],_0x36e020):console[_0x41771e(0xab)](a45_0xc67129[_0x41771e(0xd5)](_0x41771e(0xb3)+(_0x469908 instanceof Error?_0x469908[_0x41771e(0xa5)]:String(_0x469908))));}return console[_0x41771e(0xb9)](),_0x1db1b0[_0x41771e(0xc6)](),_0x217e07?0x0:0x1;}}
1
+ function a46_0x3d0d(){const _0x2ae87b=['Show\x20authentication\x20status\x20and\x20current\x20context','Name:','No\x20credential\x20found','\x20profile:\x20','green','first_name','✓\x20Authentication\x20successful\x0a','User:','37vfAkzT','yellow','756GynuBM','70666gARHCI','210072TIlYsF','29089313aRPPDG','Account\x20ID:','44XgsWZO','description','223959XKFqAN','red','N/A','1633311LJQeZL','cyan','8797090xgiVfk','session','site','filter','site:\x20','email','last_name','error','profileSource','tdx','account_id','jobs','name','OAuth','CLI\x20flag','message','bold','96968vbarLC','execute','config','displayWithSources','log','170GfSZiv','status','dim'];a46_0x3d0d=function(){return _0x2ae87b;};return a46_0x3d0d();}function a46_0x2b41(_0x516483,_0x910547){_0x516483=_0x516483-0xe2;const _0x3d0d79=a46_0x3d0d();let _0x2b41dd=_0x3d0d79[_0x516483];return _0x2b41dd;}const a46_0xa2f9a9=a46_0x2b41;(function(_0x33be34,_0x440b26){const _0x48d4f2=a46_0x2b41,_0x33431a=_0x33be34();while(!![]){try{const _0x28dc6b=-parseInt(_0x48d4f2(0xe7))/0x1*(parseInt(_0x48d4f2(0xea))/0x2)+-parseInt(_0x48d4f2(0xf0))/0x3*(-parseInt(_0x48d4f2(0xee))/0x4)+parseInt(_0x48d4f2(0x10b))/0x5*(-parseInt(_0x48d4f2(0xeb))/0x6)+parseInt(_0x48d4f2(0xe9))/0x7*(-parseInt(_0x48d4f2(0x106))/0x8)+parseInt(_0x48d4f2(0xf3))/0x9+parseInt(_0x48d4f2(0xf5))/0xa+parseInt(_0x48d4f2(0xec))/0xb;if(_0x28dc6b===_0x440b26)break;else _0x33431a['push'](_0x33431a['shift']());}catch(_0x2e44b2){_0x33431a['push'](_0x33431a['shift']());}}}(a46_0x3d0d,0xafcb9));import{BaseCommand,printAuthError}from'./command.js';import{resolveAPIKeyAsync}from'../core/config.js';import{getOAuthTokens}from'../core/oauth-keychain.js';import{HTTPClientError}from'../sdk/client/http-client.js';import{GlobalContext}from'../core/global-context.js';import a46_0x21427e from'chalk';export class StatusCommand extends BaseCommand{[a46_0xa2f9a9(0x101)]=a46_0xa2f9a9(0x10c);[a46_0xa2f9a9(0xef)]=a46_0xa2f9a9(0x10e);async[a46_0xa2f9a9(0x107)](_0x4eb362){const _0x62fb0f=a46_0xa2f9a9,{options:_0x3dcc15,tdx:_0x1e2519}=_0x4eb362,_0x3752c9=_0x3dcc15[_0x62fb0f(0xf7)],_0x4251c0=new GlobalContext(_0x3dcc15),_0x199bee=_0x4251c0['profile'],_0x5d082f=_0x4251c0[_0x62fb0f(0xfd)],_0x138801=_0x5d082f==='cli'?_0x62fb0f(0x103):_0x5d082f==='session'?_0x62fb0f(0xf6):_0x5d082f==='env'?'TDX_PROFILE\x20env':_0x5d082f===_0x62fb0f(0x108)?'config':null,_0x2919d0=_0x199bee?a46_0x21427e[_0x62fb0f(0xf4)](_0x199bee):a46_0x21427e[_0x62fb0f(0x10d)](_0x62fb0f(0xf2)),_0x36b247=_0x138801?'\x20'+a46_0x21427e[_0x62fb0f(0x10d)]('(from\x20'+_0x138801+')'):'';console[_0x62fb0f(0x10a)](a46_0x21427e[_0x62fb0f(0x105)](_0x62fb0f(0xfe))+_0x62fb0f(0xe2)+_0x2919d0+_0x36b247+'\x20'+a46_0x21427e[_0x62fb0f(0x10d)]('(')+_0x62fb0f(0xf9)+a46_0x21427e['cyan'](_0x3752c9)+a46_0x21427e[_0x62fb0f(0x10d)](')'));const _0x174f04=await getOAuthTokens(_0x199bee);if(_0x174f04)console[_0x62fb0f(0x10a)]('Credential\x20type:\x20'+a46_0x21427e[_0x62fb0f(0xf4)](_0x62fb0f(0x102)));else{const _0x120965=await resolveAPIKeyAsync(_0x3752c9,_0x199bee);if(_0x120965){const {source:_0x1a56fe,isDeprecated:_0x4ecf8f}=_0x120965,_0x2bd7ac='Read\x20credential\x20from\x20'+a46_0x21427e[_0x62fb0f(0xf4)](_0x1a56fe);console[_0x62fb0f(0x10a)](_0x4ecf8f?a46_0x21427e[_0x62fb0f(0xe8)](_0x2bd7ac):_0x2bd7ac);}else console[_0x62fb0f(0x10a)](a46_0x21427e[_0x62fb0f(0xe8)](_0x62fb0f(0x110)));}let _0x5a56e1=![];try{const _0x231f4f=await _0x1e2519[_0x62fb0f(0x100)]['getUserInfo']();console[_0x62fb0f(0x10a)](a46_0x21427e[_0x62fb0f(0xe3)](_0x62fb0f(0xe5))),console['log'](a46_0x21427e[_0x62fb0f(0x105)](_0x62fb0f(0xe6))+'\x20'+a46_0x21427e[_0x62fb0f(0xf4)](_0x231f4f[_0x62fb0f(0xfa)]));if(_0x231f4f['first_name']||_0x231f4f[_0x62fb0f(0xfb)]){const _0x4c65a7=[_0x231f4f[_0x62fb0f(0xe4)],_0x231f4f[_0x62fb0f(0xfb)]][_0x62fb0f(0xf8)](Boolean)['join']('\x20');console['log'](a46_0x21427e[_0x62fb0f(0x105)](_0x62fb0f(0x10f))+'\x20'+_0x4c65a7);}_0x231f4f[_0x62fb0f(0xff)]&&console[_0x62fb0f(0x10a)](a46_0x21427e[_0x62fb0f(0x105)](_0x62fb0f(0xed))+'\x20'+a46_0x21427e['yellow'](_0x231f4f[_0x62fb0f(0xff)])),_0x5a56e1=!![];}catch(_0x691e82){_0x691e82 instanceof HTTPClientError&&_0x691e82[_0x62fb0f(0x10c)]===0x191?printAuthError(_0x691e82,!![],_0x199bee):console[_0x62fb0f(0xfc)](a46_0x21427e[_0x62fb0f(0xf1)]('✗\x20Validation\x20failed:\x20'+(_0x691e82 instanceof Error?_0x691e82[_0x62fb0f(0x104)]:String(_0x691e82))));}return console[_0x62fb0f(0x10a)](),_0x4251c0[_0x62fb0f(0x109)](),_0x5a56e1?0x0:0x1;}}
@@ -1 +1 @@
1
- const a46_0x26214=a46_0x295b;(function(_0x12a58a,_0xb33fd7){const _0x26530f=a46_0x295b,_0xbc7d13=_0x12a58a();while(!![]){try{const _0x1a5931=parseInt(_0x26530f(0xc5))/0x1*(-parseInt(_0x26530f(0xcf))/0x2)+-parseInt(_0x26530f(0xce))/0x3+-parseInt(_0x26530f(0xda))/0x4*(-parseInt(_0x26530f(0xe2))/0x5)+-parseInt(_0x26530f(0xc4))/0x6*(parseInt(_0x26530f(0xde))/0x7)+parseInt(_0x26530f(0xd6))/0x8*(-parseInt(_0x26530f(0xc6))/0x9)+parseInt(_0x26530f(0xe0))/0xa+parseInt(_0x26530f(0xbe))/0xb;if(_0x1a5931===_0xb33fd7)break;else _0xbc7d13['push'](_0xbc7d13['shift']());}catch(_0xc62f87){_0xbc7d13['push'](_0xbc7d13['shift']());}}}(a46_0x4fb7,0x473ed));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput,isStructuredFormat}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';function a46_0x4fb7(){const _0x4463c1=['\x20\x20tdx\x20tables\x20users\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20across\x20all\x20databases','683811ZqIhFY','2mBYWji','✔\x20Found\x20','📋\x20','\x20\x20Or:\x20\x20tdx\x20tables\x20--in\x20','Did\x20you\x20mean\x20to\x20list\x20all\x20tables\x20from\x20database\x20\x27','✖\x20No\x20tables\x20found','includes','8aGrQRB','query','database','verbose','751864lUMGHR','cause','\x20\x20Use:\x20tdx\x20tables\x20\x22','\x20\x20tdx\x20tables\x20\x22mydb.*\x22\x20\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb','2737819vbIANf','Or\x20use\x20--in\x20flag:','711150QUFsBA','database_name','15qkcnlP','Table\x20pattern:\x20','\x20\x20tdx\x20tables\x20--in\x20mydb\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb','log','\x27\x20without\x20wildcards\x20would\x20search\x20for\x20tables\x20named\x20\x27','message','length','Error:\x20','\x27\x20is\x20ambiguous.','Error:\x20Pattern\x20\x27','table','name','11376112COnpVF','Error:\x20Too\x20many\x20arguments.\x20Use\x20single\x20argument:','site','Database:\x20','error','List\x20tables\x20in\x20a\x20database','6yLjXXH','427609qddbRy','2976489TSqqgi','\x27\x20may\x20not\x20exist\x20or\x20contains\x20no\x20tables','validate','Site:\x20','\x20\x20Cause:\x20','data','Note:\x20\x27'];a46_0x4fb7=function(){return _0x4463c1;};return a46_0x4fb7();}function a46_0x295b(_0x15fd64,_0x117d7b){_0x15fd64=_0x15fd64-0xbb;const _0x4fb791=a46_0x4fb7();let _0x295b0a=_0x4fb791[_0x15fd64];return _0x295b0a;}export class TablesCommand extends BaseCommand{[a46_0x26214(0xbd)]='tables';['description']=a46_0x26214(0xc3);async['execute'](_0x35b77e){const _0x4886cb=a46_0x26214,{options:_0x5231d9,args:_0x45e610,tdx:_0x84efce}=_0x35b77e;let _0x44eba6;if(_0x45e610['length']===0x0)_0x44eba6={'database':undefined,'table':undefined,'original':''};else{if(_0x45e610['length']===0x1)try{_0x44eba6=parseTableReference(_0x45e610[0x0]);if(_0x44eba6[_0x4886cb(0xbc)]&&!_0x44eba6[_0x4886cb(0xd8)]&&!_0x44eba6[_0x4886cb(0xbc)][_0x4886cb(0xd5)]('*')&&!_0x44eba6[_0x4886cb(0xbc)]['includes']('?'))return console[_0x4886cb(0xc2)](_0x4886cb(0xbb)+_0x45e610[0x0]+_0x4886cb(0xea)),console[_0x4886cb(0xc2)](_0x4886cb(0xd3)+_0x44eba6[_0x4886cb(0xbc)]+'\x27?'),console[_0x4886cb(0xc2)](_0x4886cb(0xdc)+_0x44eba6[_0x4886cb(0xbc)]+'.*\x22'),console[_0x4886cb(0xc2)](_0x4886cb(0xd2)+_0x44eba6['table']),console[_0x4886cb(0xc2)]('\x20\x20Or:\x20\x20tdx\x20tables\x20--database\x20'+_0x44eba6[_0x4886cb(0xbc)]),console[_0x4886cb(0xc2)](''),console[_0x4886cb(0xc2)](_0x4886cb(0xcc)+_0x45e610[0x0]+_0x4886cb(0xe6)+_0x44eba6['table']+'\x27\x20across\x20all\x20databases.'),0x1;}catch(_0x1026ba){return console['error'](_0x4886cb(0xe9)+_0x1026ba[_0x4886cb(0xe7)]),0x1;}else return console[_0x4886cb(0xc2)](_0x4886cb(0xbf)),console[_0x4886cb(0xc2)](_0x4886cb(0xcd)),console[_0x4886cb(0xc2)](_0x4886cb(0xdd)),console[_0x4886cb(0xc2)]('\x20\x20tdx\x20tables\x20\x22mydb.users\x22\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20in\x20database\x20mydb'),console[_0x4886cb(0xc2)]('\x20\x20tdx\x20tables\x20\x22*.user*\x22\x20\x20\x20\x20\x20\x20\x20->\x20tables\x20matching\x20user*\x20across\x20databases'),console['error'](_0x4886cb(0xdf)),console[_0x4886cb(0xc2)](_0x4886cb(0xe4)),0x1;}const _0x1fe060=_0x5231d9[_0x4886cb(0xd8)];!_0x44eba6[_0x4886cb(0xd8)]&&_0x1fe060&&(_0x44eba6[_0x4886cb(0xd8)]=_0x1fe060);try{const _0x557fd5=_0x25f561=>_0x25f561&&(_0x25f561[_0x4886cb(0xd5)]('*')||_0x25f561['includes']('?')),_0x267e21=_0x557fd5(_0x44eba6[_0x4886cb(0xd8)]);_0x5231d9['verbose']&&(console[_0x4886cb(0xc2)](_0x4886cb(0xc9)+_0x5231d9[_0x4886cb(0xc0)]),_0x44eba6[_0x4886cb(0xd8)]?_0x267e21?console['error']('Database\x20pattern:\x20'+_0x44eba6['database']):console[_0x4886cb(0xc2)](_0x4886cb(0xc1)+_0x44eba6[_0x4886cb(0xd8)]):console['error']('Database:\x20all'),_0x44eba6[_0x4886cb(0xbc)]&&console[_0x4886cb(0xc2)](_0x4886cb(0xe3)+_0x44eba6[_0x4886cb(0xbc)]));const _0x47fd7e=_0x44eba6[_0x4886cb(0xd8)]&&!_0x267e21?_0x44eba6['database']:undefined,_0x24681e=_0x267e21?_0x44eba6['database']:undefined,_0x447543=_0x44eba6[_0x4886cb(0xbc)],_0xd5b927=resolveLimit(_0x5231d9['limit'],DEFAULT_LISTING_LIMIT),_0x3c7ea3=await withSpinner('Listing\x20tables...',()=>_0x84efce[_0x4886cb(0xd7)]['listTables'](_0x47fd7e,_0x447543,_0x24681e,_0xd5b927),{'verbose':_0x5231d9[_0x4886cb(0xd9)]}),_0x50352f=_0x3c7ea3[_0x4886cb(0xcb)];if(_0x50352f[_0x4886cb(0xe8)]===0x0&&_0x44eba6[_0x4886cb(0xd8)]&&!_0x267e21)return console['error'](_0x4886cb(0xd4)),console[_0x4886cb(0xc2)]('Database\x20\x27'+_0x44eba6[_0x4886cb(0xd8)]+_0x4886cb(0xc7)),0x1;console[_0x4886cb(0xc2)](_0x4886cb(0xd0)+_0x50352f[_0x4886cb(0xe8)]+'\x20table'+(_0x50352f[_0x4886cb(0xe8)]!==0x1?'s':''));if(isStructuredFormat(_0x5231d9))await handleSDKOutput(_0x50352f,{..._0x5231d9,'limit':_0xd5b927});else for(const _0x132148 of _0x50352f){const _0x1132ce=_0x132148[_0x4886cb(0xe1)]?_0x132148['database_name']+'.':'';console[_0x4886cb(0xe5)](_0x4886cb(0xd1)+_0x1132ce+_0x132148['table_name']);}return 0x0;}catch(_0x5214ef){if(_0x5214ef instanceof SDKError)return console['error'](_0x4886cb(0xe9)+_0x5214ef[_0x4886cb(0xe7)]),_0x5214ef['cause']&&console['error'](_0x4886cb(0xca)+_0x5214ef[_0x4886cb(0xdb)]),0x1;throw _0x5214ef;}}[a46_0x26214(0xc8)](_0x30a58f){return undefined;}}
1
+ const a47_0x1f3661=a47_0x10f8;(function(_0x3b5668,_0x13d404){const _0x5752ff=a47_0x10f8,_0x698aca=_0x3b5668();while(!![]){try{const _0x33bdc1=-parseInt(_0x5752ff(0x131))/0x1*(-parseInt(_0x5752ff(0x12a))/0x2)+-parseInt(_0x5752ff(0x123))/0x3*(parseInt(_0x5752ff(0x12e))/0x4)+-parseInt(_0x5752ff(0x12b))/0x5*(-parseInt(_0x5752ff(0x119))/0x6)+parseInt(_0x5752ff(0x140))/0x7*(-parseInt(_0x5752ff(0x126))/0x8)+-parseInt(_0x5752ff(0x118))/0x9*(parseInt(_0x5752ff(0x12f))/0xa)+-parseInt(_0x5752ff(0x133))/0xb+parseInt(_0x5752ff(0x124))/0xc;if(_0x33bdc1===_0x13d404)break;else _0x698aca['push'](_0x698aca['shift']());}catch(_0x3f20ac){_0x698aca['push'](_0x698aca['shift']());}}}(a47_0x2545,0xdc4c1));import{BaseCommand}from'./command.js';function a47_0x10f8(_0x56b502,_0x497ac2){_0x56b502=_0x56b502-0x114;const _0x2545ac=a47_0x2545();let _0x10f810=_0x2545ac[_0x56b502];return _0x10f810;}import{SDKError}from'../sdk/index.js';import{handleSDKOutput,isStructuredFormat}from'../core/command-output.js';import{parseTableReference}from'../utils/table-ref-parser.js';import{DEFAULT_LISTING_LIMIT,resolveLimit}from'../core/constants.js';function a47_0x2545(){const _0x54f783=['✔\x20Found\x20','\x27\x20may\x20not\x20exist\x20or\x20contains\x20no\x20tables','table_name','3419213JzVZtg','\x20\x20tdx\x20tables\x20\x22mydb.users\x22\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20in\x20database\x20mydb','📋\x20','name','verbose','tables','\x27\x20is\x20ambiguous.','\x20\x20Or:\x20\x20tdx\x20tables\x20--database\x20','Listing\x20tables...','Database\x20\x27','Error:\x20Too\x20many\x20arguments.\x20Use\x20single\x20argument:','\x20\x20Use:\x20tdx\x20tables\x20\x22','Database\x20pattern:\x20','Site:\x20','includes','6597uoDqem','30WxoXmM','\x20\x20tdx\x20tables\x20\x22*.user*\x22\x20\x20\x20\x20\x20\x20\x20->\x20tables\x20matching\x20user*\x20across\x20databases','message','limit','database_name','length','List\x20tables\x20in\x20a\x20database','Error:\x20Pattern\x20\x27','validate','Note:\x20\x27','212781mCPBMe','6580152wrsJYZ','\x20\x20Or:\x20\x20tdx\x20tables\x20--in\x20','8wHMwMY','log','listTables','Database:\x20','2ICdLIK','704605oxeMCk','site','\x20\x20tdx\x20tables\x20users\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20across\x20all\x20databases','4ZYvTjF','4830iAYdYa','cause','1695677FMWvef','Or\x20use\x20--in\x20flag:','12461526hjuYPI','data','\x20\x20tdx\x20tables\x20\x22mydb.*\x22\x20\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb','Error:\x20','execute','error','✖\x20No\x20tables\x20found','database','Database:\x20all','table'];a47_0x2545=function(){return _0x54f783;};return a47_0x2545();}import{withSpinner}from'../utils/spinner.js';export class TablesCommand extends BaseCommand{[a47_0x1f3661(0x143)]=a47_0x1f3661(0x145);['description']=a47_0x1f3661(0x11f);async[a47_0x1f3661(0x137)](_0x14ae15){const _0x5a8dde=a47_0x1f3661,{options:_0x3ca55f,args:_0x21de64,tdx:_0xa046db}=_0x14ae15;let _0x4942a8;if(_0x21de64[_0x5a8dde(0x11e)]===0x0)_0x4942a8={'database':undefined,'table':undefined,'original':''};else{if(_0x21de64['length']===0x1)try{_0x4942a8=parseTableReference(_0x21de64[0x0]);if(_0x4942a8['table']&&!_0x4942a8[_0x5a8dde(0x13a)]&&!_0x4942a8['table'][_0x5a8dde(0x117)]('*')&&!_0x4942a8['table'][_0x5a8dde(0x117)]('?'))return console[_0x5a8dde(0x138)](_0x5a8dde(0x120)+_0x21de64[0x0]+_0x5a8dde(0x146)),console['error']('Did\x20you\x20mean\x20to\x20list\x20all\x20tables\x20from\x20database\x20\x27'+_0x4942a8[_0x5a8dde(0x13c)]+'\x27?'),console[_0x5a8dde(0x138)](_0x5a8dde(0x114)+_0x4942a8[_0x5a8dde(0x13c)]+'.*\x22'),console[_0x5a8dde(0x138)](_0x5a8dde(0x125)+_0x4942a8[_0x5a8dde(0x13c)]),console[_0x5a8dde(0x138)](_0x5a8dde(0x147)+_0x4942a8[_0x5a8dde(0x13c)]),console[_0x5a8dde(0x138)](''),console['error'](_0x5a8dde(0x122)+_0x21de64[0x0]+'\x27\x20without\x20wildcards\x20would\x20search\x20for\x20tables\x20named\x20\x27'+_0x4942a8[_0x5a8dde(0x13c)]+'\x27\x20across\x20all\x20databases.'),0x1;}catch(_0x414723){return console[_0x5a8dde(0x138)](_0x5a8dde(0x136)+_0x414723[_0x5a8dde(0x11b)]),0x1;}else return console[_0x5a8dde(0x138)](_0x5a8dde(0x14a)),console[_0x5a8dde(0x138)](_0x5a8dde(0x12d)),console[_0x5a8dde(0x138)](_0x5a8dde(0x135)),console[_0x5a8dde(0x138)](_0x5a8dde(0x141)),console['error'](_0x5a8dde(0x11a)),console[_0x5a8dde(0x138)](_0x5a8dde(0x132)),console['error']('\x20\x20tdx\x20tables\x20--in\x20mydb\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb'),0x1;}const _0x2586db=_0x3ca55f[_0x5a8dde(0x13a)];!_0x4942a8[_0x5a8dde(0x13a)]&&_0x2586db&&(_0x4942a8[_0x5a8dde(0x13a)]=_0x2586db);try{const _0x36d20d=_0x2c853f=>_0x2c853f&&(_0x2c853f[_0x5a8dde(0x117)]('*')||_0x2c853f[_0x5a8dde(0x117)]('?')),_0x212980=_0x36d20d(_0x4942a8['database']);_0x3ca55f[_0x5a8dde(0x144)]&&(console[_0x5a8dde(0x138)](_0x5a8dde(0x116)+_0x3ca55f[_0x5a8dde(0x12c)]),_0x4942a8['database']?_0x212980?console[_0x5a8dde(0x138)](_0x5a8dde(0x115)+_0x4942a8[_0x5a8dde(0x13a)]):console['error'](_0x5a8dde(0x129)+_0x4942a8['database']):console[_0x5a8dde(0x138)](_0x5a8dde(0x13b)),_0x4942a8[_0x5a8dde(0x13c)]&&console[_0x5a8dde(0x138)]('Table\x20pattern:\x20'+_0x4942a8[_0x5a8dde(0x13c)]));const _0x10c38e=_0x4942a8[_0x5a8dde(0x13a)]&&!_0x212980?_0x4942a8[_0x5a8dde(0x13a)]:undefined,_0x1518a6=_0x212980?_0x4942a8['database']:undefined,_0x1a5346=_0x4942a8[_0x5a8dde(0x13c)],_0x15d7aa=resolveLimit(_0x3ca55f[_0x5a8dde(0x11c)],DEFAULT_LISTING_LIMIT),_0x30c2c7=await withSpinner(_0x5a8dde(0x148),()=>_0xa046db['query'][_0x5a8dde(0x128)](_0x10c38e,_0x1a5346,_0x1518a6,_0x15d7aa),{'verbose':_0x3ca55f[_0x5a8dde(0x144)]}),_0xdd9547=_0x30c2c7[_0x5a8dde(0x134)];if(_0xdd9547[_0x5a8dde(0x11e)]===0x0&&_0x4942a8[_0x5a8dde(0x13a)]&&!_0x212980)return console[_0x5a8dde(0x138)](_0x5a8dde(0x139)),console[_0x5a8dde(0x138)](_0x5a8dde(0x149)+_0x4942a8[_0x5a8dde(0x13a)]+_0x5a8dde(0x13e)),0x1;console[_0x5a8dde(0x138)](_0x5a8dde(0x13d)+_0xdd9547[_0x5a8dde(0x11e)]+'\x20table'+(_0xdd9547['length']!==0x1?'s':''));if(isStructuredFormat(_0x3ca55f))await handleSDKOutput(_0xdd9547,{..._0x3ca55f,'limit':_0x15d7aa});else for(const _0x37acc2 of _0xdd9547){const _0x2559e5=_0x37acc2[_0x5a8dde(0x11d)]?_0x37acc2[_0x5a8dde(0x11d)]+'.':'';console[_0x5a8dde(0x127)](_0x5a8dde(0x142)+_0x2559e5+_0x37acc2[_0x5a8dde(0x13f)]);}return 0x0;}catch(_0x2b307c){if(_0x2b307c instanceof SDKError)return console['error'](_0x5a8dde(0x136)+_0x2b307c['message']),_0x2b307c[_0x5a8dde(0x130)]&&console[_0x5a8dde(0x138)]('\x20\x20Cause:\x20'+_0x2b307c[_0x5a8dde(0x130)]),0x1;throw _0x2b307c;}}[a47_0x1f3661(0x121)](_0x5fc05b){return undefined;}}
@@ -1 +1 @@
1
- const a47_0x305139=a47_0x342f;function a47_0x342f(_0x3e7b2e,_0x48a1f1){_0x3e7b2e=_0x3e7b2e-0x143;const _0x13c987=a47_0x13c9();let _0x342f53=_0x13c987[_0x3e7b2e];return _0x342f53;}(function(_0x3f4b70,_0x45ab72){const _0x2ba95d=a47_0x342f,_0x1a6ee1=_0x3f4b70();while(!![]){try{const _0xc7e85d=-parseInt(_0x2ba95d(0x15d))/0x1+-parseInt(_0x2ba95d(0x14a))/0x2*(-parseInt(_0x2ba95d(0x15f))/0x3)+-parseInt(_0x2ba95d(0x164))/0x4+parseInt(_0x2ba95d(0x14e))/0x5*(-parseInt(_0x2ba95d(0x160))/0x6)+parseInt(_0x2ba95d(0x14d))/0x7*(parseInt(_0x2ba95d(0x143))/0x8)+-parseInt(_0x2ba95d(0x15b))/0x9+parseInt(_0x2ba95d(0x16b))/0xa*(parseInt(_0x2ba95d(0x15a))/0xb);if(_0xc7e85d===_0x45ab72)break;else _0x1a6ee1['push'](_0x1a6ee1['shift']());}catch(_0x427521){_0x1a6ee1['push'](_0x1a6ee1['shift']());}}}(a47_0x13c9,0xbec2d));function a47_0x13c9(){const _0x5c3f5c=['cleared','3458703cRhYrn','6qeNANh','site','default','database','5243268OsgbvV','message','profile','description','includes','Clear\x20session-level\x20or\x20default\x20context\x20values','parent_segment','9550Gitsrj','log','352wyjsxQ','Default\x20site\x20','join','agent','(session:\x20','llm_project','green','2XAshGG','unset','dim','179963dhcwpG','6551870mWYGEx','\x0aUpdated:\x20','session','Error:\x20','engage_workspace','Session\x20','llm_agent','\x0aResources:\x20site,\x20database,\x20parent_segment,\x20llm_project,\x20agent,\x20profile,\x20engage_workspace\x0a','execute','Default\x20profile\x20','Invalid\x20resource:\x20','--default\x20can\x20only\x20be\x20used\x20with\x20\x27site\x27\x20or\x20\x27profile\x27.\x20Other\x20resources\x20are\x20session-level\x20only.','30899hYhcBh','2206215ABAeHG','name','1319009EWkhDk'];a47_0x13c9=function(){return _0x5c3f5c;};return a47_0x13c9();}import{BaseCommand}from'./command.js';import{getSessionID,cleanExpiredSessions,clearSessionContextField}from'../core/session.js';import{clearDefaultSiteFromUserConfig,clearActiveProfileFromUserConfig}from'../core/profile.js';import{getConfigDir}from'../core/config.js';import a47_0x3b3ed8 from'chalk';import*as a47_0x529fd2 from'node:path';export class UnsetCommand extends BaseCommand{[a47_0x305139(0x15c)]=a47_0x305139(0x14b);[a47_0x305139(0x167)]=a47_0x305139(0x169);['validate'](_0x3e7f98){const _0x22c6c6=a47_0x305139,{args:_0x4442e7,options:_0x22ebcd}=_0x3e7f98,_0x482a53=_0x22ebcd[_0x22c6c6(0x162)];if(_0x4442e7['length']===0x0)return'Usage:\x20tdx\x20unset\x20<resource>\x0a'+'\x20\x20\x20\x20\x20\x20\x20tdx\x20unset\x20--default\x20<resource>\x20\x20#\x20Clear\x20default\x20from\x20config\x0a'+_0x22c6c6(0x155)+'\x0aRun\x20\x27tdx\x20unset\x20--help\x27\x20for\x20more\x20options';const _0x295a14=_0x4442e7[0x0],_0x1b3d81=['site',_0x22c6c6(0x163),_0x22c6c6(0x16a),'llm_project',_0x22c6c6(0x146),_0x22c6c6(0x166),_0x22c6c6(0x152)];if(!_0x1b3d81[_0x22c6c6(0x168)](_0x295a14))return _0x22c6c6(0x158)+_0x295a14+'.\x20Must\x20be\x20one\x20of:\x20'+_0x1b3d81[_0x22c6c6(0x145)](',\x20');if(_0x482a53&&_0x295a14!==_0x22c6c6(0x161)&&_0x295a14!=='profile')return _0x22c6c6(0x159);return undefined;}async[a47_0x305139(0x156)](_0x594906){const _0x358906=a47_0x305139,{args:_0x59595c,options:_0x36d3be}=_0x594906,_0x201cbb=_0x36d3be[_0x358906(0x162)];cleanExpiredSessions();try{const _0x3c86aa=_0x59595c[0x0],_0x46d60c=a47_0x529fd2[_0x358906(0x145)](getConfigDir(),'tdx.json');if(_0x201cbb){if(_0x3c86aa===_0x358906(0x161))return clearDefaultSiteFromUserConfig(),console['log'](_0x358906(0x144)+a47_0x3b3ed8[_0x358906(0x149)](_0x358906(0x15e))),console[_0x358906(0x16c)](a47_0x3b3ed8[_0x358906(0x14c)](_0x358906(0x14f)+_0x46d60c)),0x0;if(_0x3c86aa===_0x358906(0x166))return clearActiveProfileFromUserConfig(),console[_0x358906(0x16c)](_0x358906(0x157)+a47_0x3b3ed8[_0x358906(0x149)](_0x358906(0x15e))),console[_0x358906(0x16c)](a47_0x3b3ed8[_0x358906(0x14c)](_0x358906(0x14f)+_0x46d60c)),0x0;}const _0x1f4c10=getSessionID(_0x36d3be[_0x358906(0x150)]),_0x5c5255={'site':_0x358906(0x161),'database':_0x358906(0x163),'parent_segment':_0x358906(0x16a),'llm_project':_0x358906(0x148),'agent':_0x358906(0x154),'profile':_0x358906(0x166),'engage_workspace':_0x358906(0x152)},_0x30a38c=_0x5c5255[_0x3c86aa];return _0x30a38c&&(clearSessionContextField(_0x30a38c,_0x36d3be[_0x358906(0x150)]),console['log'](_0x358906(0x153)+_0x3c86aa+'\x20'+a47_0x3b3ed8[_0x358906(0x149)](_0x358906(0x15e))+'\x20'+a47_0x3b3ed8['dim'](_0x358906(0x147)+_0x1f4c10+')'))),0x0;}catch(_0x53ca29){return _0x53ca29 instanceof Error&&console['error'](_0x358906(0x151)+_0x53ca29[_0x358906(0x165)]),0x1;}}}
1
+ const a48_0x540354=a48_0x3640;(function(_0x14295e,_0x2bc583){const _0xe51099=a48_0x3640,_0x517aca=_0x14295e();while(!![]){try{const _0x55c2ea=parseInt(_0xe51099(0xd1))/0x1*(parseInt(_0xe51099(0xb6))/0x2)+-parseInt(_0xe51099(0xd2))/0x3*(-parseInt(_0xe51099(0xcb))/0x4)+parseInt(_0xe51099(0xb8))/0x5+parseInt(_0xe51099(0xc6))/0x6*(-parseInt(_0xe51099(0xd8))/0x7)+parseInt(_0xe51099(0xc4))/0x8*(parseInt(_0xe51099(0xca))/0x9)+parseInt(_0xe51099(0xd6))/0xa*(parseInt(_0xe51099(0xb3))/0xb)+-parseInt(_0xe51099(0xce))/0xc;if(_0x55c2ea===_0x2bc583)break;else _0x517aca['push'](_0x517aca['shift']());}catch(_0x1cd342){_0x517aca['push'](_0x517aca['shift']());}}}(a48_0x5ba7,0x958e5));import{BaseCommand}from'./command.js';import{getSessionID,cleanExpiredSessions,clearSessionContextField}from'../core/session.js';function a48_0x3640(_0x15a817,_0x1c28e9){_0x15a817=_0x15a817-0xac;const _0x5ba7ad=a48_0x5ba7();let _0x364092=_0x5ba7ad[_0x15a817];return _0x364092;}function a48_0x5ba7(){const _0x3cd7cb=['Clear\x20session-level\x20or\x20default\x20context\x20values','\x0aUpdated:\x20','dim','10782bVuEMD','8iwpvzn','default','execute','19042080cNHbqx','tdx.json','unset','1uXrRmA','529212TDYALI','error','cleared','Session\x20','373130ZazzeY','description','5768TmbicW','green','Invalid\x20resource:\x20','join','length','session','(session:\x20','--default\x20can\x20only\x20be\x20used\x20with\x20\x27site\x27\x20or\x20\x27profile\x27.\x20Other\x20resources\x20are\x20session-level\x20only.','parent_segment','341QsMAFY','profile','engage_workspace','662666ucTJHR','log','2546455WQOlJK','llm_project','\x20\x20\x20\x20\x20\x20\x20tdx\x20unset\x20--default\x20<resource>\x20\x20#\x20Clear\x20default\x20from\x20config\x0a','Default\x20site\x20','Usage:\x20tdx\x20unset\x20<resource>\x0a','database','name','Default\x20profile\x20','site','\x0aRun\x20\x27tdx\x20unset\x20--help\x27\x20for\x20more\x20options','agent','validate','2152NfjClr','Error:\x20','3444pdwkDY'];a48_0x5ba7=function(){return _0x3cd7cb;};return a48_0x5ba7();}import{clearDefaultSiteFromUserConfig,clearActiveProfileFromUserConfig}from'../core/profile.js';import{getConfigDir}from'../core/config.js';import a48_0x4d1e11 from'chalk';import*as a48_0x5663af from'node:path';export class UnsetCommand extends BaseCommand{[a48_0x540354(0xbe)]=a48_0x540354(0xd0);[a48_0x540354(0xd7)]=a48_0x540354(0xc7);[a48_0x540354(0xc3)](_0x31a711){const _0x5b5f9b=a48_0x540354,{args:_0x142137,options:_0xd906dd}=_0x31a711,_0x2293cf=_0xd906dd['default'];if(_0x142137[_0x5b5f9b(0xae)]===0x0)return _0x5b5f9b(0xbc)+_0x5b5f9b(0xba)+'\x0aResources:\x20site,\x20database,\x20parent_segment,\x20llm_project,\x20agent,\x20profile,\x20engage_workspace\x0a'+_0x5b5f9b(0xc1);const _0x1b286c=_0x142137[0x0],_0x3770af=[_0x5b5f9b(0xc0),_0x5b5f9b(0xbd),_0x5b5f9b(0xb2),_0x5b5f9b(0xb9),_0x5b5f9b(0xc2),'profile',_0x5b5f9b(0xb5)];if(!_0x3770af['includes'](_0x1b286c))return _0x5b5f9b(0xac)+_0x1b286c+'.\x20Must\x20be\x20one\x20of:\x20'+_0x3770af[_0x5b5f9b(0xad)](',\x20');if(_0x2293cf&&_0x1b286c!==_0x5b5f9b(0xc0)&&_0x1b286c!=='profile')return _0x5b5f9b(0xb1);return undefined;}async[a48_0x540354(0xcd)](_0x18060b){const _0x4feec9=a48_0x540354,{args:_0x163095,options:_0x325151}=_0x18060b,_0x395f52=_0x325151[_0x4feec9(0xcc)];cleanExpiredSessions();try{const _0x386922=_0x163095[0x0],_0x3b3722=a48_0x5663af[_0x4feec9(0xad)](getConfigDir(),_0x4feec9(0xcf));if(_0x395f52){if(_0x386922===_0x4feec9(0xc0))return clearDefaultSiteFromUserConfig(),console[_0x4feec9(0xb7)](_0x4feec9(0xbb)+a48_0x4d1e11[_0x4feec9(0xd9)]('cleared')),console[_0x4feec9(0xb7)](a48_0x4d1e11[_0x4feec9(0xc9)](_0x4feec9(0xc8)+_0x3b3722)),0x0;if(_0x386922===_0x4feec9(0xb4))return clearActiveProfileFromUserConfig(),console[_0x4feec9(0xb7)](_0x4feec9(0xbf)+a48_0x4d1e11[_0x4feec9(0xd9)](_0x4feec9(0xd4))),console['log'](a48_0x4d1e11['dim']('\x0aUpdated:\x20'+_0x3b3722)),0x0;}const _0x264cf0=getSessionID(_0x325151[_0x4feec9(0xaf)]),_0x22de95={'site':_0x4feec9(0xc0),'database':_0x4feec9(0xbd),'parent_segment':_0x4feec9(0xb2),'llm_project':_0x4feec9(0xb9),'agent':'llm_agent','profile':_0x4feec9(0xb4),'engage_workspace':_0x4feec9(0xb5)},_0x526bba=_0x22de95[_0x386922];return _0x526bba&&(clearSessionContextField(_0x526bba,_0x325151[_0x4feec9(0xaf)]),console[_0x4feec9(0xb7)](_0x4feec9(0xd5)+_0x386922+'\x20'+a48_0x4d1e11[_0x4feec9(0xd9)](_0x4feec9(0xd4))+'\x20'+a48_0x4d1e11['dim'](_0x4feec9(0xb0)+_0x264cf0+')'))),0x0;}catch(_0xa2aa66){return _0xa2aa66 instanceof Error&&console[_0x4feec9(0xd3)](_0x4feec9(0xc5)+_0xa2aa66['message']),0x1;}}}