@treasuredata/tdx 2026.3.23 → 2026.3.25

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 (203) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.js +1 -1
  5. package/dist/commands/activations.js +1 -1
  6. package/dist/commands/agent-command.js +1 -1
  7. package/dist/commands/agent-test-command.js +1 -1
  8. package/dist/commands/api-command.js +1 -1
  9. package/dist/commands/auth-command.js +1 -1
  10. package/dist/commands/auth-login-command.js +1 -1
  11. package/dist/commands/chat-command.js +1 -1
  12. package/dist/commands/claude-command.js +1 -1
  13. package/dist/commands/claude-statusline-command.js +1 -1
  14. package/dist/commands/claude-usage-command.js +1 -1
  15. package/dist/commands/command.js +1 -1
  16. package/dist/commands/connection-command.js +1 -1
  17. package/dist/commands/databases.js +1 -1
  18. package/dist/commands/delivery-command.js +1 -1
  19. package/dist/commands/describe.js +1 -1
  20. package/dist/commands/engage-campaign-pull-command.js +1 -1
  21. package/dist/commands/engage-campaign-push-command.js +1 -1
  22. package/dist/commands/engage-campaign-validate-command.js +1 -1
  23. package/dist/commands/engage-command.js +1 -1
  24. package/dist/commands/engage-template-pull-command.js +1 -1
  25. package/dist/commands/engage-template-push-command.js +1 -1
  26. package/dist/commands/engage-template-validate-command.js +1 -1
  27. package/dist/commands/job-command.js +1 -1
  28. package/dist/commands/journey-command.js +1 -1
  29. package/dist/commands/journey-validate-command.js +1 -1
  30. package/dist/commands/llm-command.js +1 -1
  31. package/dist/commands/mcp-command.js +1 -1
  32. package/dist/commands/parent-segment-command.js +1 -1
  33. package/dist/commands/policy-command.js +1 -1
  34. package/dist/commands/profile-command.js +1 -1
  35. package/dist/commands/profiles-command.js +1 -1
  36. package/dist/commands/query-command.js +1 -1
  37. package/dist/commands/schedule-command.js +1 -1
  38. package/dist/commands/segment-command.js +1 -1
  39. package/dist/commands/segment-create-command.js +1 -1
  40. package/dist/commands/segment-fields-command.js +1 -1
  41. package/dist/commands/segment-pull-command.js +1 -1
  42. package/dist/commands/segment-push-command.js +1 -1
  43. package/dist/commands/segment-update-command.js +1 -1
  44. package/dist/commands/segment-use-command.js +1 -1
  45. package/dist/commands/segment-validate-command.js +1 -1
  46. package/dist/commands/segments.js +1 -1
  47. package/dist/commands/show.js +1 -1
  48. package/dist/commands/status-command.js +1 -1
  49. package/dist/commands/tables.js +1 -1
  50. package/dist/commands/unset-command.js +1 -1
  51. package/dist/commands/upgrade-command.js +1 -1
  52. package/dist/commands/use-command.js +1 -1
  53. package/dist/commands/user-command.js +1 -1
  54. package/dist/commands/workflow-command.js +1 -1
  55. package/dist/core/auth.js +1 -1
  56. package/dist/core/command-output.js +1 -1
  57. package/dist/core/config.js +1 -1
  58. package/dist/core/connection-cache.js +1 -1
  59. package/dist/core/constants.js +1 -1
  60. package/dist/core/credential-cache.js +1 -1
  61. package/dist/core/global-context.js +1 -1
  62. package/dist/core/keychain.js +1 -1
  63. package/dist/core/oauth-keychain.js +1 -1
  64. package/dist/core/oauth.js +1 -1
  65. package/dist/core/profile.js +1 -1
  66. package/dist/core/project-config.js +1 -1
  67. package/dist/core/session.js +1 -1
  68. package/dist/core/user-cache.js +1 -1
  69. package/dist/core/version.js +1 -1
  70. package/dist/index.js +1 -1
  71. package/dist/mcp/server.js +1 -1
  72. package/dist/mcp/tools/index.js +1 -1
  73. package/dist/mcp/tools/tdx-run.js +1 -1
  74. package/dist/mcp/tools/tdx-search.js +1 -1
  75. package/dist/mcp/utils.js +1 -1
  76. package/dist/proxy/claude-usage-tracker.js +1 -1
  77. package/dist/proxy/passthrough-server.js +1 -1
  78. package/dist/proxy/sse-usage-parser.js +1 -1
  79. package/dist/sdk/agent/agent-config.js +1 -1
  80. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  81. package/dist/sdk/agent/agent-yaml.js +1 -1
  82. package/dist/sdk/agent/test/evaluator.js +1 -1
  83. package/dist/sdk/agent/test/executor.js +1 -1
  84. package/dist/sdk/agent/test/index.js +1 -1
  85. package/dist/sdk/agent/test/output.js +1 -1
  86. package/dist/sdk/agent/test/parser.js +1 -1
  87. package/dist/sdk/agent/tool-target-registry.js +1 -1
  88. package/dist/sdk/api.js +1 -1
  89. package/dist/sdk/client/cdp-api-client.js +1 -1
  90. package/dist/sdk/client/delivery-api-client.js +1 -1
  91. package/dist/sdk/client/endpoints.js +1 -1
  92. package/dist/sdk/client/engage-api-client.js +1 -1
  93. package/dist/sdk/client/http-client.js +1 -1
  94. package/dist/sdk/client/llm-api-client.js +1 -1
  95. package/dist/sdk/client/oauth-refresh.js +1 -1
  96. package/dist/sdk/client/rate-limiter.js +1 -1
  97. package/dist/sdk/client/td-api-client.js +1 -1
  98. package/dist/sdk/client/trino-api-client.js +1 -1
  99. package/dist/sdk/client/workflow-client.js +1 -1
  100. package/dist/sdk/connection-validator.js +1 -1
  101. package/dist/sdk/connection.js +1 -1
  102. package/dist/sdk/delivery.js +1 -1
  103. package/dist/sdk/engage/campaign-pull.js +1 -1
  104. package/dist/sdk/engage/campaign-push.js +1 -1
  105. package/dist/sdk/engage/campaign-validator.js +1 -1
  106. package/dist/sdk/engage/campaign-yaml.js +1 -1
  107. package/dist/sdk/engage/template-pull.js +1 -1
  108. package/dist/sdk/engage/template-push.js +1 -1
  109. package/dist/sdk/engage/template-validator.js +1 -1
  110. package/dist/sdk/engage/template-yaml.js +1 -1
  111. package/dist/sdk/engage/types/campaign-def.js +1 -1
  112. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  113. package/dist/sdk/engage/types/template-schema.js +1 -1
  114. package/dist/sdk/engage.js +1 -1
  115. package/dist/sdk/errors.js +1 -1
  116. package/dist/sdk/index.js +1 -1
  117. package/dist/sdk/io/index.js +1 -1
  118. package/dist/sdk/io/node-filesystem.js +1 -1
  119. package/dist/sdk/job.js +1 -1
  120. package/dist/sdk/journey.js +1 -1
  121. package/dist/sdk/llm/chat-cache.js +1 -1
  122. package/dist/sdk/llm/index.js +1 -1
  123. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  124. package/dist/sdk/llm/model-factors.js +1 -1
  125. package/dist/sdk/personalization.js +1 -1
  126. package/dist/sdk/policy.js +1 -1
  127. package/dist/sdk/query/index.js +1 -1
  128. package/dist/sdk/query/sql-parser.js +1 -1
  129. package/dist/sdk/realtime.js +1 -1
  130. package/dist/sdk/schedule.js +1 -1
  131. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  132. package/dist/sdk/segment/fields-display.js +1 -1
  133. package/dist/sdk/segment/file-discovery.js +1 -1
  134. package/dist/sdk/segment/journey-utils.js +1 -1
  135. package/dist/sdk/segment/journey-validator.js +1 -1
  136. package/dist/sdk/segment/journey-yaml.js +1 -1
  137. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  138. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  139. package/dist/sdk/segment/pull-workflow.js +1 -1
  140. package/dist/sdk/segment/push-recovery.js +1 -1
  141. package/dist/sdk/segment/push-workflow.js +1 -1
  142. package/dist/sdk/segment/resolution-context.js +1 -1
  143. package/dist/sdk/segment/segment-path-parser.js +1 -1
  144. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  145. package/dist/sdk/segment/segment-validator.js +1 -1
  146. package/dist/sdk/segment/target-resolution.js +1 -1
  147. package/dist/sdk/segment/tdx-config.js +1 -1
  148. package/dist/sdk/segment/types/activation-schema.js +1 -1
  149. package/dist/sdk/segment/types/journey-def.js +1 -1
  150. package/dist/sdk/segment/types/journey-schema.js +1 -1
  151. package/dist/sdk/segment/types/segment-def.js +1 -1
  152. package/dist/sdk/segment/types/segment-schema.js +1 -1
  153. package/dist/sdk/segment/validate-files.js +1 -1
  154. package/dist/sdk/segment/yaml-validator.js +1 -1
  155. package/dist/sdk/segment.js +1 -1
  156. package/dist/sdk/types/index.js +1 -1
  157. package/dist/sdk/types/progress.js +1 -1
  158. package/dist/sdk/user.js +1 -1
  159. package/dist/sdk/util/format-detector.js +1 -1
  160. package/dist/sdk/util/formatters.js +1 -1
  161. package/dist/sdk/util/index.js +1 -1
  162. package/dist/sdk/util/paginate.js +1 -1
  163. package/dist/sdk/util/tree-formatter.js +1 -1
  164. package/dist/sdk/workflow/archive-validation.js +1 -1
  165. package/dist/sdk/workflow/clone-workflow.js +1 -1
  166. package/dist/sdk/workflow/index.js +1 -1
  167. package/dist/sdk/workflow/pull-workflow.js +1 -1
  168. package/dist/sdk/workflow/push-workflow.js +1 -1
  169. package/dist/sdk/workflow/tdx-config.js +1 -1
  170. package/dist/sdk/workflow/workflow-utils.js +1 -1
  171. package/dist/test-utils/command-runner.js +1 -1
  172. package/dist/test-utils/factories.js +1 -1
  173. package/dist/test-utils/fixtures.js +1 -1
  174. package/dist/test-utils/http-mock.js +1 -1
  175. package/dist/test-utils/index.js +1 -1
  176. package/dist/utils/async.js +1 -1
  177. package/dist/utils/colors.js +1 -1
  178. package/dist/utils/diff.js +1 -1
  179. package/dist/utils/file-permissions.js +1 -1
  180. package/dist/utils/file-reader.js +1 -1
  181. package/dist/utils/github-releases.js +1 -1
  182. package/dist/utils/global-cache.js +1 -1
  183. package/dist/utils/json-loader.js +1 -1
  184. package/dist/utils/local-cache.js +1 -1
  185. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  186. package/dist/utils/logger/formatters/index.js +1 -1
  187. package/dist/utils/logger/handlers/console-handler.js +1 -1
  188. package/dist/utils/logger/handlers/file-handler.js +1 -1
  189. package/dist/utils/logger/handlers/index.js +1 -1
  190. package/dist/utils/logger/handlers/null-handler.js +1 -1
  191. package/dist/utils/logger/index.js +1 -1
  192. package/dist/utils/logger/logger.js +1 -1
  193. package/dist/utils/logger/types.js +1 -1
  194. package/dist/utils/option-validation.js +1 -1
  195. package/dist/utils/process.js +1 -1
  196. package/dist/utils/prompt.js +1 -1
  197. package/dist/utils/spinner.js +1 -1
  198. package/dist/utils/sse-parser.js +1 -1
  199. package/dist/utils/string-utils.js +1 -1
  200. package/dist/utils/table-ref-parser.js +1 -1
  201. package/dist/utils/tdx-logger.js +1 -1
  202. package/dist/utils/version-check.js +1 -1
  203. package/package.json +1 -1
@@ -1 +1 @@
1
- const a40_0x2fcf53=a40_0x2f90;(function(_0x1ad24d,_0x4f4cfa){const _0x7c60c9=a40_0x2f90,_0x55f82a=_0x1ad24d();while(!![]){try{const _0x29f987=-parseInt(_0x7c60c9(0xfc))/0x1*(-parseInt(_0x7c60c9(0x12c))/0x2)+-parseInt(_0x7c60c9(0x149))/0x3+parseInt(_0x7c60c9(0x123))/0x4*(-parseInt(_0x7c60c9(0x114))/0x5)+-parseInt(_0x7c60c9(0x155))/0x6*(-parseInt(_0x7c60c9(0xff))/0x7)+-parseInt(_0x7c60c9(0x104))/0x8+parseInt(_0x7c60c9(0x113))/0x9+parseInt(_0x7c60c9(0xe3))/0xa;if(_0x29f987===_0x4f4cfa)break;else _0x55f82a['push'](_0x55f82a['shift']());}catch(_0x1acabc){_0x55f82a['push'](_0x55f82a['shift']());}}}(a40_0x47ec,0x5c3d9));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';function a40_0x2f90(_0x9b1aaf,_0x1adf5d){_0x9b1aaf=_0x9b1aaf-0xd1;const _0x47ec90=a40_0x47ec();let _0x2f90fb=_0x47ec90[_0x9b1aaf];return _0x2f90fb;}import{segmentToYamlString,segmentWithActivationsToYaml}from'../sdk/segment/child-segment-yaml.js';import a40_0x22f913 from'chalk';import{existsSync}from'fs';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{resolveTarget,isSuccessfulResolution,getScopedDetails}from'../sdk/segment/target-resolution.js';function a40_0x47ec(){const _0x5032ca=['endsWith','\x20YAML\x20files\x20found','Delete\x20journey:','data','journeyBundleName','existingJourney','length','then','file','add','1773156jzkHVO','list','Fetching\x20existing\x20data...','message','journeysOnly','description','📁\x20','No\x20','\x20to\x20update','createdSegmentIds','yellow','segment\x20or\x20journey','3846NRVpGU','folderPath','Delete\x20segment:','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','(Journey\x20will\x20be\x20deleted)','\x0aPush\x20summary\x20for\x20\x27','/j/da/je','execute','segments','New\x20segment:','set','no_parent','\x20changed','\x20\x20📊\x20Segments:','toString','filter','idToName','\x20changes?','delete','updatedAt','attributes','segment','\x20created','isNew','cwd','Parent\x20segment:\x20','get','\x20\x20🗺️\x20\x20Journeys:','Fetching\x20connections\x20for\x20name\x20resolution...','site','createdAt','filePath','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','Error:\x20Directory\x20not\x20found:\x20','created','blue','listFolders','Fetching\x20existing\x20activations...','\x20to\x20create','connection','journeys','toUpdate','/e/','\x20new','activations','445150BSClWP','Source\x20directory:\x20','.yml','\x20\x20Segments:\x20','/app/ps/','parentSegment','listSegments','versionNumber','\x27...','\x20\x20\x20\x20','error','Error\x20parsing\x20YAML:\x20','\x20activations]','/sb/da/esr','map','\x0a✔\x20Push\x20complete','buildUserMaps','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','join','diff','yamlConfig','\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20','repeat','\x20\x20Journeys:\x20','getOutputSchemaWithCache','1trdyzQ','updated','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','3878XtqoIN','changed','green','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','3632992CDePkZ','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file','segmentFolderId','\x20deleted','Aborted.','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','existingSegment','verbose','helpText','push','results','\x20\x20Source:\x20','parentName','journey','Preparing\x20journeys...','6483096wOrcJM','280655tgvrIF','segment:push','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','nameToId','unchanged','Changes\x20to:','targetDir','audienceId','type','new','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','\x20updated','nameToType','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\x20','28wBcwCV','all','\x20\x20Activations:','errorCode','Site:\x20','\x0aError:','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','getJourney','\x20to\x20delete','1391874hiahve','isScoped','cyan','journeyBundleId','red','dim','parent_name','toDelete','listActivations','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','journeyId','setPhase','dryRun','getParent','resolveParentId','name','\x20unchanged','parentFolder','toCreate'];a40_0x47ec=function(){return _0x5032ca;};return a40_0x47ec();}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_0x2fcf53(0x13b)]=a40_0x2fcf53(0x115);[a40_0x2fcf53(0x14e)]=a40_0x2fcf53(0xfe);async[a40_0x2fcf53(0x15c)](_0x4f336e){const _0x439ecf=a40_0x2fcf53,{options:_0x25d6a1,args:_0x456591,tdx:_0x285d70}=_0x4f336e,_0x47e7eb=_0x25d6a1,_0x1c0e4c=await resolveTarget({'arg':_0x456591[0x0],'contextParent':_0x25d6a1[_0x439ecf(0xe8)],'cwd':process[_0x439ecf(0x16d)]()});if(!isSuccessfulResolution(_0x1c0e4c))return _0x1c0e4c[_0x439ecf(0x126)]===_0x439ecf(0x160)?(console[_0x439ecf(0xed)](a40_0x22f913['yellow'](_0x439ecf(0x158))),console[_0x439ecf(0xed)](_0x439ecf(0x121)),console[_0x439ecf(0xed)](_0x439ecf(0x129)),console[_0x439ecf(0xed)](_0x439ecf(0x105))):(console[_0x439ecf(0xed)](a40_0x22f913[_0x439ecf(0x130)]('Error:\x20'+_0x1c0e4c[_0x439ecf(0x14c)]+'\x0a')),_0x1c0e4c[_0x439ecf(0x10c)]&&console[_0x439ecf(0xed)](a40_0x22f913[_0x439ecf(0x12e)](_0x1c0e4c[_0x439ecf(0x10c)]))),0x1;if(_0x1c0e4c[_0x439ecf(0x11c)]===_0x439ecf(0x132))return console[_0x439ecf(0xed)](a40_0x22f913[_0x439ecf(0x130)](_0x439ecf(0xd7)+_0x1c0e4c[_0x439ecf(0x11a)]+'\x0a')),console['error'](a40_0x22f913['cyan'](_0x439ecf(0x102))),0x1;const _0x11c47f=_0x1c0e4c[_0x439ecf(0x110)],_0x3c26b9=_0x1c0e4c[_0x439ecf(0x11a)],_0x526070=_0x1c0e4c['type']===_0x439ecf(0x147)?_0x1c0e4c[_0x439ecf(0xd5)]:undefined,_0x101159=getScopedDetails(_0x1c0e4c),_0x56b228=_0x101159?.[_0x439ecf(0x12d)]??![],_0x31b0dd=_0x101159?.['scopedFolderPath']??'';if(!existsSync(_0x3c26b9))return console['error'](a40_0x22f913[_0x439ecf(0x130)](_0x439ecf(0xd7)+_0x3c26b9+'\x0a')),console[_0x439ecf(0xed)](a40_0x22f913['cyan'](_0x439ecf(0x102))),0x1;_0x47e7eb[_0x439ecf(0x10b)]&&(console[_0x439ecf(0xed)](_0x439ecf(0x127)+_0x47e7eb[_0x439ecf(0xd3)]),console[_0x439ecf(0xed)](_0x439ecf(0x16e)+_0x11c47f),console[_0x439ecf(0xed)](_0x439ecf(0xe4)+_0x3c26b9),_0x56b228&&console[_0x439ecf(0xed)]('Scoped\x20to\x20folder:\x20'+_0x31b0dd));const _0xa9de90=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x11c47f+_0x439ecf(0xeb),()=>_0x285d70['segment'][_0x439ecf(0x13a)](_0x11c47f),{'verbose':_0x47e7eb[_0x439ecf(0x10b)]}),_0x42beaf=_0xa9de90[_0x439ecf(0x142)],{parentSegmentResult:_0x58b769,segmentsResult:_0x36a172,foldersResult:_0x250ab5,journeysWithDetailsResult:_0x10d7d2,userMaps:_0x2878a2}=await withSpinner(_0x439ecf(0x14b),async()=>{const _0x2e8ad8=_0x439ecf,[_0x569f8b,_0x3d5c63,_0x32dee9,_0x2f1186,_0x19e130]=await Promise[_0x2e8ad8(0x124)]([_0x285d70['segment'][_0x2e8ad8(0x139)](_0x42beaf),_0x285d70[_0x2e8ad8(0x16a)][_0x2e8ad8(0xe9)](_0x42beaf),_0x285d70[_0x2e8ad8(0x16a)][_0x2e8ad8(0xda)](_0x42beaf),_0x285d70['journey']['listJourneysWithDetailsFromParentSegment'](_0x42beaf,{'includeAllVersions':!![]}),_0x285d70['user'][_0x2e8ad8(0xf3)]()]);return{'parentSegmentResult':_0x569f8b,'segmentsResult':_0x3d5c63,'foldersResult':_0x32dee9,'journeysWithDetailsResult':_0x2f1186,'userMaps':_0x19e130};},{'verbose':_0x47e7eb[_0x439ecf(0x10b)]})[_0x439ecf(0x146)](_0x56af9d=>_0x56af9d[_0x439ecf(0x142)]),_0x39e061=_0x58b769,_0x1590dc=extractRootFolderId(_0x39e061),_0x2806f9=_0x36a172,_0x8fd04=_0x250ab5,{journeys:_0x5ef610,activationStepsById:_0x24f48a}=_0x10d7d2,_0x1afff1=new Map(_0x5ef610[_0x439ecf(0xf1)](_0x230fb7=>[_0x230fb7['id'],_0x230fb7])),_0x2ff95b=_0x5ef610[_0x439ecf(0xf1)](_0x235a04=>({'id':_0x235a04['id'],'name':_0x235a04[_0x439ecf(0x169)][_0x439ecf(0x13b)],'journeyBundleName':_0x235a04[_0x439ecf(0x169)][_0x439ecf(0x143)]||'','journeyBundleId':_0x235a04[_0x439ecf(0x169)][_0x439ecf(0x12f)]||'','versionNumber':_0x235a04[_0x439ecf(0x169)][_0x439ecf(0xea)],'description':_0x235a04['attributes'][_0x439ecf(0x14e)],'state':_0x235a04[_0x439ecf(0x169)]['state'],'paused':_0x235a04['attributes']['paused'],'audienceId':_0x235a04[_0x439ecf(0x169)][_0x439ecf(0x11b)],'folderId':_0x235a04['relationships']?.[_0x439ecf(0x13d)]?.['data']?.['id'],'createdAt':_0x235a04['attributes'][_0x439ecf(0xd4)],'updatedAt':_0x235a04[_0x439ecf(0x169)][_0x439ecf(0x168)]})),{emailToId:_0x58589a,idToEmail:_0x35489e}=_0x2878a2,_0x2f77cf=await withSpinner(_0x439ecf(0xd2),async()=>{const _0x1db542=_0x439ecf,_0x10c130=await _0x285d70[_0x1db542(0xdd)][_0x1db542(0x14a)]();return buildConnectionMaps(_0x10c130);},{'verbose':_0x47e7eb[_0x439ecf(0x10b)]})[_0x439ecf(0x146)](_0x5b2a0a=>_0x5b2a0a[_0x439ecf(0x142)]),_0x2b56e6=_0x2f77cf['nameToId'],_0x5c6adb=_0x2f77cf[_0x439ecf(0x165)],_0x4dddb5=_0x2f77cf[_0x439ecf(0x120)],_0x4509d2={'emailToIdMap':_0x58589a,'connectionNameToIdMap':_0x2b56e6,'connectionNameToTypeMap':_0x4dddb5,'getSchema':_0x1d5e86=>_0x285d70[_0x439ecf(0xdd)][_0x439ecf(0xfb)](_0x1d5e86)};let {pathToId:_0x15f091,idToPath:_0x448c6c}=buildFolderMaps(_0x8fd04);const _0x929823=buildSegmentLookupMap(_0x2806f9,_0x448c6c),_0x199e59=buildSegmentNameToIdMap(_0x2806f9),_0x426542=buildJourneyBundleLookupMap(_0x2ff95b,_0x448c6c);let _0x33dd0e;if(_0x526070){if(!_0x526070[_0x439ecf(0x13f)](_0x439ecf(0xe5))&&!_0x526070['endsWith']('.yaml'))return console[_0x439ecf(0xed)](a40_0x22f913['red']('Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20'+_0x526070+'\x0a')),0x1;_0x33dd0e=[_0x526070];}else _0x33dd0e=findYamlFiles(_0x3c26b9);if(_0x33dd0e[_0x439ecf(0x145)]===0x0)return console[_0x439ecf(0xed)](a40_0x22f913[_0x439ecf(0x130)](_0x439ecf(0x11e)+_0x3c26b9+'\x0a')),console['error'](a40_0x22f913[_0x439ecf(0x12e)]('Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files')),0x1;let _0x2cfbc0,_0x2481fd;try{const _0x5585fb=parseAndClassifyYamlFiles(_0x33dd0e,_0x3c26b9,{'skipSegments':_0x47e7eb[_0x439ecf(0x14d)]});_0x2cfbc0=_0x5585fb[_0x439ecf(0x15d)],_0x2481fd=_0x5585fb['journeys'];const _0x4ec4e2=validateParsedFiles(_0x5585fb,_0x3c26b9);if(_0x4ec4e2[_0x439ecf(0x145)]>0x0)return console[_0x439ecf(0xed)](a40_0x22f913[_0x439ecf(0x130)]('\x0aValidation\x20failed:')),console['error'](formatValidationErrors(_0x4ec4e2)),console[_0x439ecf(0xed)](a40_0x22f913[_0x439ecf(0x153)](_0x439ecf(0x109))),0x1;}catch(_0x17b30c){return console[_0x439ecf(0xed)](a40_0x22f913[_0x439ecf(0x130)](_0x439ecf(0xee)+(_0x17b30c instanceof Error?_0x17b30c[_0x439ecf(0x14c)]:_0x17b30c))),0x1;}if(_0x2cfbc0[_0x439ecf(0x145)]===0x0&&_0x2481fd[_0x439ecf(0x145)]===0x0){const _0x50f1c7=_0x47e7eb[_0x439ecf(0x14d)]?'journey':_0x439ecf(0x154);return console['error'](a40_0x22f913[_0x439ecf(0x153)](_0x439ecf(0x150)+_0x50f1c7+_0x439ecf(0x140))),0x0;}const _0x43ca50=new Map();_0x2806f9[_0x439ecf(0x145)]>0x0&&!_0x47e7eb[_0x439ecf(0x14d)]&&await withSpinner(_0x439ecf(0xdb),async()=>{await batchAsync(_0x2806f9,async _0x4fba7d=>{const _0x43ec7d=a40_0x2f90,_0xe2063d=await _0x285d70[_0x43ec7d(0x16a)][_0x43ec7d(0x134)](_0x42beaf,_0x4fba7d['id']);_0x43ca50['set'](_0x4fba7d['id'],_0xe2063d);});},{'verbose':_0x47e7eb['verbose']});const {segmentFiles:_0x18e5c7,foldersToCreate:_0x14d5a5}=await prepareSegmentFiles(_0x2cfbc0,{'segmentByFolderAndName':_0x929823,'activationsBySegmentId':_0x43ca50,'folderPathToId':_0x15f091,'idToEmailMap':_0x35489e,'connectionIdToNameMap':_0x5c6adb},_0x4509d2,_0x56b228,_0x31b0dd),_0x3ba4c1=_0x526070?[]:findSegmentsToDelete(_0x2806f9,_0x2cfbc0[_0x439ecf(0xf1)](({yamlConfig:_0x3c77e0,folderPath:_0x428414})=>({'yamlConfig':_0x3c77e0,'folderPath':resolveTDFolderPath(_0x428414,_0x56b228,_0x31b0dd)})),_0x448c6c,_0x31b0dd,_0x56b228),{journeyFiles:_0x911338,foldersToCreate:_0xf4ffce}=await withProgressSpinner(_0x439ecf(0x112),async _0x379d4e=>prepareJourneyFiles(_0x2481fd,{'fetchJourney':async _0x15c8a7=>_0x285d70['journey'][_0x439ecf(0x12a)](_0x15c8a7[_0x439ecf(0x136)]),'journeyBundlesByFolderAndName':_0x426542,'folderPathToId':_0x15f091,'idToEmailMap':_0x35489e,'connectionIdToNameMap':_0x5c6adb,'existingSegments':_0x2806f9,'parentId':_0x42beaf,'deps':_0x285d70,'progress':{'update':_0x2ef27e=>{const _0x4e2f80=_0x439ecf;_0x379d4e[_0x4e2f80(0x137)](_0x2ef27e),_0x47e7eb[_0x4e2f80(0x10b)]&&console[_0x4e2f80(0xed)]('\x20\x20'+_0x2ef27e);}},'journeyById':_0x1afff1,'activationStepsById':_0x24f48a},_0x56b228,_0x31b0dd),{'verbose':_0x47e7eb[_0x439ecf(0x10b)]})[_0x439ecf(0x146)](_0x4b4cb6=>_0x4b4cb6[_0x439ecf(0x142)]);for(const _0x3165e4 of _0xf4ffce){_0x14d5a5[_0x439ecf(0x148)](_0x3165e4);}const _0x5f58db=_0x526070?[]:findJourneysToDelete(_0x2ff95b,_0x2481fd[_0x439ecf(0xf1)](({yamlConfig:_0x22b8f4,folderPath:_0x4e67ce})=>({'yamlConfig':_0x22b8f4,'folderPath':resolveTDFolderPath(_0x4e67ce,_0x56b228,_0x31b0dd)})),_0x448c6c,_0x31b0dd,_0x56b228),_0x1cea0b=calculatePushStats(_0x18e5c7,_0x911338,_0x14d5a5,_0x3ba4c1,_0x5f58db,!!_0x47e7eb['delete'],!!_0x47e7eb[_0x439ecf(0x14d)]),_0x1c9ccc=_0x1cea0b[_0x439ecf(0x15d)][_0x439ecf(0x11d)],_0x47ac70=_0x1cea0b['segments']['changed'],_0x4d3c4d=_0x1cea0b['segments'][_0x439ecf(0x118)],_0x265d72=_0x1cea0b['segments'][_0x439ecf(0x133)],_0x19619f=_0x1cea0b['folders'][_0x439ecf(0x13e)],_0x51bf39=_0x1cea0b[_0x439ecf(0xde)][_0x439ecf(0x11d)],_0x193fd4=_0x1cea0b['journeys'][_0x439ecf(0x100)],_0x2290ed=_0x1cea0b[_0x439ecf(0xde)][_0x439ecf(0x118)],_0xc85623=_0x1cea0b[_0x439ecf(0xde)][_0x439ecf(0x133)],_0x1905d3=_0x1cea0b[_0x439ecf(0xe2)]['all'],_0x58fabe=_0x1cea0b[_0x439ecf(0xe2)]['toCreate'],_0x453cf7=_0x1cea0b[_0x439ecf(0xe2)][_0x439ecf(0xdf)],_0x541c7c=_0x1cea0b[_0x439ecf(0xe2)][_0x439ecf(0x133)];console[_0x439ecf(0xed)](_0x439ecf(0x15a)+_0x11c47f+'\x27:');_0x19619f[_0x439ecf(0x145)]>0x0&&console[_0x439ecf(0xed)]('\x20\x20'+a40_0x22f913['blue'](_0x439ecf(0x14f)+_0x19619f['length']+'\x20folders\x20to\x20create'));if(!_0x47e7eb[_0x439ecf(0x14d)]){console['error'](_0x439ecf(0x162)),console[_0x439ecf(0xed)](_0x439ecf(0xec)+a40_0x22f913[_0x439ecf(0x101)]('+\x20'+_0x1c9ccc[_0x439ecf(0x145)]+_0x439ecf(0xe1))),console[_0x439ecf(0xed)](_0x439ecf(0xec)+a40_0x22f913[_0x439ecf(0x153)]('~\x20'+_0x47ac70[_0x439ecf(0x145)]+'\x20changed'));if(_0x265d72['length']>0x0)console[_0x439ecf(0xed)](_0x439ecf(0xec)+a40_0x22f913[_0x439ecf(0x130)]('-\x20'+_0x265d72[_0x439ecf(0x145)]+_0x439ecf(0x12b)));else _0x3ba4c1['length']>0x0&&!_0x47e7eb[_0x439ecf(0x167)]&&console[_0x439ecf(0xed)]('\x20\x20\x20\x20'+a40_0x22f913[_0x439ecf(0x131)](_0x3ba4c1[_0x439ecf(0x145)]+'\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)'));console[_0x439ecf(0xed)](_0x439ecf(0xec)+a40_0x22f913['dim']('=\x20'+_0x4d3c4d[_0x439ecf(0x145)]+_0x439ecf(0x13c)));}if(_0x911338[_0x439ecf(0x145)]>0x0||_0x5f58db[_0x439ecf(0x145)]>0x0){console['error'](_0x439ecf(0xd1)),console[_0x439ecf(0xed)]('\x20\x20\x20\x20'+a40_0x22f913['green']('+\x20'+_0x51bf39[_0x439ecf(0x145)]+_0x439ecf(0xe1))),console['error'](_0x439ecf(0xec)+a40_0x22f913[_0x439ecf(0x153)]('~\x20'+_0x193fd4[_0x439ecf(0x145)]+_0x439ecf(0x161)));if(_0xc85623[_0x439ecf(0x145)]>0x0)console[_0x439ecf(0xed)](_0x439ecf(0xec)+a40_0x22f913[_0x439ecf(0x130)]('-\x20'+_0xc85623['length']+'\x20to\x20delete'));else _0x5f58db['length']>0x0&&!_0x47e7eb[_0x439ecf(0x167)]&&console[_0x439ecf(0xed)]('\x20\x20\x20\x20'+a40_0x22f913[_0x439ecf(0x131)](_0x5f58db[_0x439ecf(0x145)]+_0x439ecf(0xf4)));console[_0x439ecf(0xed)]('\x20\x20\x20\x20'+a40_0x22f913[_0x439ecf(0x131)]('=\x20'+_0x2290ed[_0x439ecf(0x145)]+_0x439ecf(0x13c)));}_0x1905d3[_0x439ecf(0x145)]>0x0&&!_0x47e7eb[_0x439ecf(0x14d)]&&(console[_0x439ecf(0xed)](''),console[_0x439ecf(0xed)](_0x439ecf(0x125)),_0x58fabe[_0x439ecf(0x145)]>0x0&&console['error']('\x20\x20\x20\x20'+a40_0x22f913['green']('+\x20'+_0x58fabe[_0x439ecf(0x145)]+_0x439ecf(0xdc))),_0x453cf7[_0x439ecf(0x145)]>0x0&&console['error'](_0x439ecf(0xec)+a40_0x22f913['yellow']('~\x20'+_0x453cf7['length']+_0x439ecf(0x151))),_0x541c7c[_0x439ecf(0x145)]>0x0&&console[_0x439ecf(0xed)](_0x439ecf(0xec)+a40_0x22f913['red']('-\x20'+_0x541c7c[_0x439ecf(0x145)]+_0x439ecf(0x12b))));console[_0x439ecf(0xed)](_0x439ecf(0x10f)+a40_0x22f913[_0x439ecf(0x12e)](_0x3c26b9)+'\x0a');if(_0x19619f['length']>0x0){console[_0x439ecf(0xed)]('Folders\x20to\x20create:');for(const _0x588c9a of _0x19619f){console[_0x439ecf(0xed)]('\x20\x20'+a40_0x22f913[_0x439ecf(0xd9)]('+')+'\x20'+_0x588c9a);}console[_0x439ecf(0xed)]('');}if(_0x1c9ccc[_0x439ecf(0x145)]>0x0&&!_0x47e7eb[_0x439ecf(0x14d)])for(const _0x20d509 of _0x1c9ccc){const _0x6f7c8=_0x20d509[_0x439ecf(0x156)]?_0x20d509[_0x439ecf(0x156)]+'/'+_0x20d509[_0x439ecf(0xf7)][_0x439ecf(0x13b)]:_0x20d509[_0x439ecf(0xf7)]['name'],_0x4414d3=_0x20d509[_0x439ecf(0xf7)]['activations']?.['length']||0x0,_0x15fb98=_0x4414d3>0x0?a40_0x22f913['dim']('\x20['+_0x4414d3+_0x439ecf(0xef)):'';console[_0x439ecf(0xed)]('\x0a'+a40_0x22f913[_0x439ecf(0x101)](_0x439ecf(0x15e))+'\x20'+_0x6f7c8+_0x15fb98),console[_0x439ecf(0xed)]('─'[_0x439ecf(0xf9)](0x3c)),_0x20d509[_0x439ecf(0xf6)]&&console['error'](_0x20d509[_0x439ecf(0xf6)]),console[_0x439ecf(0xed)]('─'[_0x439ecf(0xf9)](0x3c));}if(_0x265d72['length']>0x0&&!_0x47e7eb['journeysOnly'])for(const _0x416dcc of _0x265d72){const _0x247dc9=_0x416dcc['segmentFolderId']?_0x448c6c['get'](_0x416dcc[_0x439ecf(0x106)][_0x439ecf(0x163)]())||'':'',_0x537e95=_0x247dc9?_0x247dc9+'/'+_0x416dcc[_0x439ecf(0x13b)]:_0x416dcc[_0x439ecf(0x13b)],_0x19f92d=_0x43ca50[_0x439ecf(0x16f)](_0x416dcc['id'])||[],_0x44e9e8=_0x19f92d[_0x439ecf(0x145)]>0x0?a40_0x22f913[_0x439ecf(0x131)]('\x20['+_0x19f92d[_0x439ecf(0x145)]+_0x439ecf(0xef)):'';console['error']('\x0a'+a40_0x22f913[_0x439ecf(0x130)](_0x439ecf(0x157))+'\x20'+_0x537e95+_0x44e9e8),console[_0x439ecf(0xed)]('─'['repeat'](0x3c));const _0x4a7144=segmentWithActivationsToYaml(_0x416dcc,_0x19f92d,undefined,_0x35489e,_0x5c6adb),_0x25f37c=segmentToYamlString(_0x4a7144),_0x28d593=generateDiff(_0x25f37c,'');console[_0x439ecf(0xed)](formatDiffWithColors(_0x28d593)),console['error']('─'['repeat'](0x3c));}const _0x5adcb1=_0x18e5c7[_0x439ecf(0x164)](_0x300ab4=>!_0x300ab4[_0x439ecf(0x16c)]&&_0x300ab4['diff']);if(_0x5adcb1['length']>0x0&&!_0x47e7eb[_0x439ecf(0x14d)])for(const _0x249237 of _0x5adcb1){const _0x457511=_0x249237[_0x439ecf(0x156)]?_0x249237[_0x439ecf(0x156)]+'/'+_0x249237[_0x439ecf(0xf7)][_0x439ecf(0x13b)]:_0x249237[_0x439ecf(0xf7)][_0x439ecf(0x13b)];console[_0x439ecf(0xed)]('\x0a'+a40_0x22f913[_0x439ecf(0x153)](_0x439ecf(0x119))+'\x20'+_0x457511),console[_0x439ecf(0xed)]('─'[_0x439ecf(0xf9)](0x3c)),console[_0x439ecf(0xed)](_0x249237['diff']),console['error']('─'[_0x439ecf(0xf9)](0x3c));}if(_0x51bf39[_0x439ecf(0x145)]>0x0)for(const _0xd83ecb of _0x51bf39){const _0x39d2d1=_0xd83ecb['folderPath']?_0xd83ecb[_0x439ecf(0x156)]+'/'+_0xd83ecb['yamlConfig'][_0x439ecf(0x13b)]:_0xd83ecb[_0x439ecf(0xf7)][_0x439ecf(0x13b)];console[_0x439ecf(0xed)]('\x0a'+a40_0x22f913[_0x439ecf(0x101)]('New\x20journey:')+'\x20'+_0x39d2d1),console[_0x439ecf(0xed)]('─'[_0x439ecf(0xf9)](0x3c)),_0xd83ecb[_0x439ecf(0xf6)]&&console[_0x439ecf(0xed)](_0xd83ecb['diff']),console[_0x439ecf(0xed)]('─'['repeat'](0x3c));}const _0x12110b=_0x911338[_0x439ecf(0x164)](_0x1ae281=>!_0x1ae281[_0x439ecf(0x16c)]&&_0x1ae281[_0x439ecf(0xf6)]);if(_0x12110b[_0x439ecf(0x145)]>0x0)for(const _0x211348 of _0x12110b){const _0x5cc581=_0x211348['folderPath']?_0x211348[_0x439ecf(0x156)]+'/'+_0x211348[_0x439ecf(0xf7)][_0x439ecf(0x13b)]:_0x211348[_0x439ecf(0xf7)][_0x439ecf(0x13b)];console[_0x439ecf(0xed)]('\x0a'+a40_0x22f913[_0x439ecf(0x153)]('Changes\x20to\x20journey:')+'\x20'+_0x5cc581),console[_0x439ecf(0xed)]('─'[_0x439ecf(0xf9)](0x3c)),console[_0x439ecf(0xed)](_0x211348[_0x439ecf(0xf6)]),console['error']('─'[_0x439ecf(0xf9)](0x3c));}if(_0xc85623['length']>0x0)for(const _0xd2af60 of _0xc85623){const _0x30b27f=_0xd2af60['folderId']?_0x448c6c[_0x439ecf(0x16f)](_0xd2af60['folderId'])||'':'',_0x15928d=_0x30b27f?_0x30b27f+'/'+_0xd2af60[_0x439ecf(0x143)]:_0xd2af60[_0x439ecf(0x143)];console[_0x439ecf(0xed)]('\x0a'+a40_0x22f913[_0x439ecf(0x130)](_0x439ecf(0x141))+'\x20'+_0x15928d),console['error']('─'['repeat'](0x3c)),console[_0x439ecf(0xed)](a40_0x22f913[_0x439ecf(0x130)](_0x439ecf(0x159))),console[_0x439ecf(0xed)]('─'[_0x439ecf(0xf9)](0x3c));}if(_0x47e7eb[_0x439ecf(0x138)])return console[_0x439ecf(0xed)](a40_0x22f913[_0x439ecf(0x153)](_0x439ecf(0x116))),0x0;const _0x4eac42=_0x47e7eb['journeysOnly']?![]:_0x1c9ccc[_0x439ecf(0x145)]>0x0||_0x47ac70[_0x439ecf(0x145)]>0x0||_0x265d72[_0x439ecf(0x145)]>0x0,_0xa6da66=_0x51bf39[_0x439ecf(0x145)]>0x0||_0x193fd4['length']>0x0||_0xc85623[_0x439ecf(0x145)]>0x0,_0x124066=_0x47e7eb[_0x439ecf(0x14d)]?![]:_0x1905d3['length']>0x0,_0x3adc7e=_0x19619f[_0x439ecf(0x145)]>0x0;if(!_0x4eac42&&!_0xa6da66&&!_0x124066&&!_0x3adc7e){const _0x5d7b05=_0x47e7eb[_0x439ecf(0x14d)]?'✔\x20All\x20journeys\x20are\x20up\x20to\x20date':_0x439ecf(0x103);console[_0x439ecf(0xed)](a40_0x22f913[_0x439ecf(0x101)](_0x5d7b05));if(_0x526070&&_0x4d3c4d[_0x439ecf(0x145)]===0x1){const _0x3461e1=_0x4d3c4d[0x0];if(_0x3461e1[_0x439ecf(0x10a)]?.['id']){const _0x15c760=getConsoleNextUrl(_0x47e7eb[_0x439ecf(0xd3)],_0x439ecf(0xe7)+_0x42beaf+'/e/'+_0x3461e1['existingSegment']['id']+_0x439ecf(0xf0));console[_0x439ecf(0xed)](_0x439ecf(0xf8)+a40_0x22f913['cyan'](_0x15c760));}}if(_0x526070&&_0x2290ed[_0x439ecf(0x145)]===0x1){const _0x285c24=_0x2290ed[0x0];if(_0x285c24[_0x439ecf(0x144)]?.['id']){const _0x439b9b=getConsoleNextUrl(_0x47e7eb[_0x439ecf(0xd3)],'/app/ps/'+_0x42beaf+_0x439ecf(0xe0)+_0x285c24[_0x439ecf(0x144)]['id']+_0x439ecf(0x15b));console[_0x439ecf(0xed)]('\x20\x20'+a40_0x22f913[_0x439ecf(0x12e)](_0x439b9b));}}return 0x0;}const _0x129d59=_0x47e7eb[_0x439ecf(0x14d)]?_0x51bf39[_0x439ecf(0x145)]+_0x193fd4[_0x439ecf(0x145)]+_0xc85623[_0x439ecf(0x145)]+_0x19619f[_0x439ecf(0x145)]:_0x1c9ccc[_0x439ecf(0x145)]+_0x47ac70[_0x439ecf(0x145)]+_0x265d72[_0x439ecf(0x145)]+_0x51bf39[_0x439ecf(0x145)]+_0x193fd4[_0x439ecf(0x145)]+_0xc85623[_0x439ecf(0x145)]+_0x19619f[_0x439ecf(0x145)]+_0x1905d3[_0x439ecf(0x145)];if(!_0x47e7eb['yes']&&_0x129d59>0x0){if(!isInteractive())return console['error'](a40_0x22f913[_0x439ecf(0x130)](_0x439ecf(0x128)),_0x439ecf(0x135)),console[_0x439ecf(0xed)](a40_0x22f913['dim'](_0x439ecf(0xd6))),0x1;const _0x24f0b5=await confirmKey(_0x439ecf(0x122)+_0x129d59+_0x439ecf(0x166));if(!_0x24f0b5)return console[_0x439ecf(0xed)](a40_0x22f913[_0x439ecf(0x153)](_0x439ecf(0x108))),0x1;}const _0x5b319c={'withProgress':async(_0x4e10f9,_0x5ed626)=>{const _0x283729=_0x439ecf,_0x581190=await withSpinner(_0x4e10f9,_0x5ed626,{'verbose':_0x47e7eb[_0x283729(0x10b)]});return{'data':_0x581190[_0x283729(0x142)]};},'logInfo':_0x26e3ff=>console[_0x439ecf(0xed)](a40_0x22f913[_0x439ecf(0xd9)]('✔\x20'+_0x26e3ff)),'logSuccess':_0xd72eb=>console[_0x439ecf(0xed)](a40_0x22f913[_0x439ecf(0x101)]('✔\x20'+_0xd72eb)),'logWarning':_0x33d676=>console[_0x439ecf(0xed)](a40_0x22f913['yellow']('⚠\x20'+_0x33d676)),'logDeleted':_0xda803c=>console[_0x439ecf(0xed)](a40_0x22f913['red']('✔\x20'+_0xda803c))},_0x36cf71={'segment':_0x285d70[_0x439ecf(0x16a)],'journey':_0x285d70[_0x439ecf(0x111)],'user':_0x285d70['user'],'connection':_0x285d70[_0x439ecf(0xdd)]};_0x19619f['length']>0x0&&(_0x15f091=await executePushFolders(_0x36cf71,_0x19619f,_0x15f091,{'parentId':_0x42beaf},_0x5b319c));const _0x16c425={'rootFolderId':_0x1590dc,'folderPathToId':_0x15f091,'folderIdToPath':_0x448c6c,'segmentNameToId':_0x199e59,'activationsBySegmentId':_0x43ca50,'emailToIdMap':_0x58589a,'idToEmailMap':_0x35489e,'connectionNameToIdMap':_0x2f77cf[_0x439ecf(0x117)],'connectionIdToNameMap':_0x2f77cf[_0x439ecf(0x165)],'connectionNameToTypeMap':_0x4dddb5},_0x3105f3=await executePushSegments(_0x36cf71,_0x47e7eb[_0x439ecf(0x14d)]?[]:_0x18e5c7,_0x16c425,{'parentId':_0x42beaf},_0x5b319c),_0x4aed9c=_0x3105f3[_0x439ecf(0xd8)],_0x911748=_0x3105f3[_0x439ecf(0xfd)],_0x3664ab=_0x3105f3[_0x439ecf(0xe2)][_0x439ecf(0xd8)],_0x380b6b=_0x3105f3['activations'][_0x439ecf(0xfd)],_0x2f693b=_0x3105f3['activations']['deleted'];let _0xa1b0a4;if(_0x526070&&_0x18e5c7[_0x439ecf(0x145)]===0x1){const _0x52da06=_0x18e5c7[0x0];_0xa1b0a4=_0x52da06[_0x439ecf(0x10a)]?.['id']??_0x3105f3[_0x439ecf(0x152)]['get'](_0x52da06['yamlConfig'][_0x439ecf(0x13b)]);}const _0xb98543=await executePushSegmentDeletions(_0x36cf71,_0x47e7eb[_0x439ecf(0x14d)]?[]:_0x265d72,_0x5b319c);let _0x5140e0=0x0,_0x5042ab=0x0,_0x117b33=0x0;const _0x5c5451=new Map(_0x199e59);for(const [_0x4ba2a8,_0x298e33]of _0x3105f3[_0x439ecf(0x152)]){_0x5c5451[_0x439ecf(0x15f)](_0x4ba2a8,_0x298e33);}if(_0x911338[_0x439ecf(0x145)]>0x0){const _0x35596c={..._0x16c425,'segmentNameToId':_0x5c5451,'existingSegments':_0x2806f9,'activationContext':_0x4509d2},_0x144376=await executePushJourneys(_0x36cf71,_0x911338,_0x35596c,{'parentId':_0x42beaf,'rootFolderId':_0x1590dc,'verbose':_0x47e7eb[_0x439ecf(0x10b)]},_0x5b319c);_0x5140e0=_0x144376[_0x439ecf(0xd8)],_0x5042ab=_0x144376[_0x439ecf(0xfd)];if(_0x526070&&_0x144376[_0x439ecf(0x10e)]['length']===0x1){const _0x1cb558=_0x144376[_0x439ecf(0x10e)][0x0];if(_0x1cb558['journeyId']){const _0x30a2fc=getConsoleNextUrl(_0x47e7eb[_0x439ecf(0xd3)],'/app/ps/'+_0x42beaf+_0x439ecf(0xe0)+_0x1cb558[_0x439ecf(0x136)]+'/j/da/je');console[_0x439ecf(0xed)]('\x20\x20'+a40_0x22f913[_0x439ecf(0x12e)](_0x30a2fc));}}}for(const _0x2254e9 of _0xc85623){console[_0x439ecf(0xed)](a40_0x22f913[_0x439ecf(0x153)]('⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20'+_0x2254e9[_0x439ecf(0x143)])),_0x117b33++;}const _0x2c51f7=[];if(_0x4aed9c>0x0)_0x2c51f7[_0x439ecf(0x10d)](_0x4aed9c+_0x439ecf(0x16b));if(_0x911748>0x0)_0x2c51f7[_0x439ecf(0x10d)](_0x911748+'\x20updated');if(_0xb98543>0x0)_0x2c51f7[_0x439ecf(0x10d)](_0xb98543+'\x20deleted');const _0x56e0f7=[];if(_0x5140e0>0x0)_0x56e0f7[_0x439ecf(0x10d)](_0x5140e0+_0x439ecf(0x16b));if(_0x5042ab>0x0)_0x56e0f7[_0x439ecf(0x10d)](_0x5042ab+_0x439ecf(0x11f));if(_0x117b33>0x0)_0x56e0f7[_0x439ecf(0x10d)](_0x117b33+_0x439ecf(0x107));const _0x55e5c8=[];if(_0x3664ab>0x0)_0x55e5c8['push'](_0x3664ab+_0x439ecf(0x16b));if(_0x380b6b>0x0)_0x55e5c8['push'](_0x380b6b+'\x20updated');if(_0x2f693b>0x0)_0x55e5c8[_0x439ecf(0x10d)](_0x2f693b+'\x20deleted');console[_0x439ecf(0xed)](a40_0x22f913['green'](_0x439ecf(0xf2)));_0x2c51f7['length']>0x0&&!_0x47e7eb[_0x439ecf(0x14d)]&&console[_0x439ecf(0xed)](_0x439ecf(0xe6)+_0x2c51f7[_0x439ecf(0xf5)](',\x20'));_0x56e0f7['length']>0x0&&console['error'](_0x439ecf(0xfa)+_0x56e0f7[_0x439ecf(0xf5)](',\x20'));_0x55e5c8['length']>0x0&&!_0x47e7eb[_0x439ecf(0x14d)]&&console[_0x439ecf(0xed)]('\x20\x20Activations:\x20'+_0x55e5c8['join'](',\x20'));if(_0xa1b0a4){const _0x4dfb82=getConsoleNextUrl(_0x47e7eb[_0x439ecf(0xd3)],'/app/ps/'+_0x42beaf+_0x439ecf(0xe0)+_0xa1b0a4+'/sb/da/esr');console[_0x439ecf(0xed)](_0x439ecf(0xf8)+a40_0x22f913[_0x439ecf(0x12e)](_0x4dfb82));}return 0x0;}}
1
+ const a40_0x10856d=a40_0x4eb6;(function(_0x354268,_0x2e4a12){const _0x2cffa3=a40_0x4eb6,_0x5d01d5=_0x354268();while(!![]){try{const _0x1889b9=-parseInt(_0x2cffa3(0x19a))/0x1*(-parseInt(_0x2cffa3(0x16d))/0x2)+-parseInt(_0x2cffa3(0x176))/0x3+-parseInt(_0x2cffa3(0x1ab))/0x4+-parseInt(_0x2cffa3(0x162))/0x5+-parseInt(_0x2cffa3(0x1b1))/0x6+parseInt(_0x2cffa3(0x1a7))/0x7*(-parseInt(_0x2cffa3(0x18c))/0x8)+-parseInt(_0x2cffa3(0x163))/0x9*(-parseInt(_0x2cffa3(0x19d))/0xa);if(_0x1889b9===_0x2e4a12)break;else _0x5d01d5['push'](_0x5d01d5['shift']());}catch(_0x1914ae){_0x5d01d5['push'](_0x5d01d5['shift']());}}}(a40_0x291e,0x45c4b));import{BaseCommand}from'./command.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{generateDiff,formatDiffWithColors}from'../utils/diff.js';import{confirmKey,isInteractive}from'../utils/prompt.js';function a40_0x291e(){const _0x54cc0d=['cyan','journeyBundleName','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','/sb/da/esr','results','\x20\x20Activations:','122430XhqYqt','13410891USBlXN','segments','Fetching\x20connections\x20for\x20name\x20resolution...','Error:\x20','listFolders','toDelete','helpText','setPhase','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','folderPath','20rOWFSg','Fetching\x20existing\x20activations...','verbose','parentName','/j/da/je','\x20to\x20create','filter','/app/ps/','Site:\x20','1328169PWQEgT','Changes\x20to:','push','\x20\x20📊\x20Segments:','add','.yml','Push\x20','segment\x20or\x20journey','dim','message','filePath','all','audienceId','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','Aborted.','isScoped','\x20created','diff','getParent','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','createdSegmentIds','yellow','14192NAvZdi','\x20updated','list','folders','\x27...','journeys','/e/','execute','Error\x20parsing\x20YAML:\x20','yamlConfig','Delete\x20segment:','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','resolveParentId','getOutputSchemaWithCache','659qbVttH','repeat','journeyId','10WBUKPw','\x20to\x20delete','\x0aError:','file','existingSegment','then','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','connection','journeyBundleId','\x20\x20Journeys:\x20','28hTfBIy','red','\x20new','New\x20journey:','1482596iZzcbN','unchanged','green','description','No\x20','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)','2195784TMBIWD','delete','\x20folders\x20to\x20create','idToName','\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20','user','new','\x0aValidation\x20failed:','attributes','\x20to\x20update','folderId','set','toCreate','createdAt','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','updatedAt','updated','segmentFolderId','\x20YAML\x20files\x20found','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','\x20\x20Source:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','\x20deleted','created','blue','\x20unchanged','site','Source\x20directory:\x20','buildUserMaps','journey','name','\x20\x20🗺️\x20\x20Journeys:','data','\x20\x20Segments:\x20','segment','Delete\x20journey:','error','\x20activations]','✔\x20All\x20journeys\x20are\x20up\x20to\x20date','Fetching\x20existing\x20data...','existingJourney','journeysOnly','length','join','\x20\x20\x20\x20','getJourney','relationships','Error:\x20Directory\x20not\x20found:\x20','targetDir','no_parent','Parent\x20segment:\x20','activations','parent_name','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file','map','cwd','nameToType','state','Changes\x20to\x20journey:','get','listActivations','\x20changes?','errorCode','endsWith','Error:\x20No\x20YAML\x20files\x20found\x20in\x20'];a40_0x291e=function(){return _0x54cc0d;};return a40_0x291e();}import{batchAsync}from'../utils/async.js';import{segmentToYamlString,segmentWithActivationsToYaml}from'../sdk/segment/child-segment-yaml.js';import a40_0x46b1d4 from'chalk';import{existsSync}from'fs';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{resolveTarget,isSuccessfulResolution,getScopedDetails}from'../sdk/segment/target-resolution.js';function a40_0x4eb6(_0x35f1c9,_0x2b94df){_0x35f1c9=_0x35f1c9-0x132;const _0x291e41=a40_0x291e();let _0x4eb6f0=_0x291e41[_0x35f1c9];return _0x4eb6f0;}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_0x10856d(0x139)]='segment:push';[a40_0x10856d(0x1ae)]='Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments';async[a40_0x10856d(0x193)](_0x23c6ea){const _0x943831=a40_0x10856d,{options:_0x73d158,args:_0x169425,tdx:_0x1a1291}=_0x23c6ea,_0xca0657=_0x73d158,_0x515e84=await resolveTarget({'arg':_0x169425[0x0],'contextParent':_0x73d158['parentSegment'],'cwd':process[_0x943831(0x152)]()});if(!isSuccessfulResolution(_0x515e84))return _0x515e84[_0x943831(0x159)]===_0x943831(0x14c)?(console[_0x943831(0x13f)](a40_0x46b1d4[_0x943831(0x18b)](_0x943831(0x197))),console['error'](_0x943831(0x1b0)),console[_0x943831(0x13f)](_0x943831(0x1c6)),console['error'](_0x943831(0x150))):(console[_0x943831(0x13f)](a40_0x46b1d4['red'](_0x943831(0x166)+_0x515e84['message']+'\x0a')),_0x515e84[_0x943831(0x169)]&&console[_0x943831(0x13f)](a40_0x46b1d4[_0x943831(0x15c)](_0x515e84[_0x943831(0x169)]))),0x1;if(_0x515e84['type']===_0x943831(0x14f))return console['error'](a40_0x46b1d4[_0x943831(0x1a8)](_0x943831(0x14a)+_0x515e84['targetDir']+'\x0a')),console[_0x943831(0x13f)](a40_0x46b1d4[_0x943831(0x15c)](_0x943831(0x183))),0x1;const _0x502c32=_0x515e84[_0x943831(0x170)],_0xa427ea=_0x515e84[_0x943831(0x14b)],_0x2a311d=_0x515e84['type']===_0x943831(0x1a0)?_0x515e84[_0x943831(0x180)]:undefined,_0x3f0fff=getScopedDetails(_0x515e84),_0x3f7adf=_0x3f0fff?.[_0x943831(0x185)]??![],_0x45186d=_0x3f0fff?.['scopedFolderPath']??'';if(!existsSync(_0xa427ea))return console['error'](a40_0x46b1d4[_0x943831(0x1a8)](_0x943831(0x14a)+_0xa427ea+'\x0a')),console[_0x943831(0x13f)](a40_0x46b1d4[_0x943831(0x15c)](_0x943831(0x183))),0x1;_0xca0657[_0x943831(0x16f)]&&(console[_0x943831(0x13f)](_0x943831(0x175)+_0xca0657[_0x943831(0x135)]),console[_0x943831(0x13f)](_0x943831(0x14d)+_0x502c32),console[_0x943831(0x13f)](_0x943831(0x136)+_0xa427ea),_0x3f7adf&&console[_0x943831(0x13f)]('Scoped\x20to\x20folder:\x20'+_0x45186d));const _0x112f83=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x502c32+_0x943831(0x190),()=>_0x1a1291[_0x943831(0x13d)][_0x943831(0x198)](_0x502c32),{'verbose':_0xca0657[_0x943831(0x16f)]}),_0x189efd=_0x112f83[_0x943831(0x13b)],{parentSegmentResult:_0x4eeac1,segmentsResult:_0x2f53ff,foldersResult:_0x1d6c05,journeysWithDetailsResult:_0x3ee57a,userMaps:_0x1a1177}=await withSpinner(_0x943831(0x142),async()=>{const _0x1af961=_0x943831,[_0x30312a,_0x7e4528,_0x542ae4,_0x28bbc6,_0x444dc8]=await Promise[_0x1af961(0x181)]([_0x1a1291['segment'][_0x1af961(0x188)](_0x189efd),_0x1a1291[_0x1af961(0x13d)]['listSegments'](_0x189efd),_0x1a1291[_0x1af961(0x13d)][_0x1af961(0x167)](_0x189efd),_0x1a1291[_0x1af961(0x138)]['listJourneysWithDetailsFromParentSegment'](_0x189efd,{'includeAllVersions':!![]}),_0x1a1291[_0x1af961(0x1b6)][_0x1af961(0x137)]()]);return{'parentSegmentResult':_0x30312a,'segmentsResult':_0x7e4528,'foldersResult':_0x542ae4,'journeysWithDetailsResult':_0x28bbc6,'userMaps':_0x444dc8};},{'verbose':_0xca0657['verbose']})[_0x943831(0x1a2)](_0x325bed=>_0x325bed[_0x943831(0x13b)]),_0x25605f=_0x4eeac1,_0x49ef83=extractRootFolderId(_0x25605f),_0x5306ec=_0x2f53ff,_0x3b3a0d=_0x1d6c05,{journeys:_0xb738df,activationStepsById:_0x59552e}=_0x3ee57a,_0x4d52d8=new Map(_0xb738df[_0x943831(0x151)](_0x3fd0fc=>[_0x3fd0fc['id'],_0x3fd0fc])),_0x2c9740=_0xb738df[_0x943831(0x151)](_0x49f5fd=>({'id':_0x49f5fd['id'],'name':_0x49f5fd[_0x943831(0x1b9)][_0x943831(0x139)],'journeyBundleName':_0x49f5fd['attributes']['journeyBundleName']||'','journeyBundleId':_0x49f5fd[_0x943831(0x1b9)][_0x943831(0x1a5)]||'','versionNumber':_0x49f5fd['attributes']['versionNumber'],'description':_0x49f5fd[_0x943831(0x1b9)][_0x943831(0x1ae)],'state':_0x49f5fd[_0x943831(0x1b9)][_0x943831(0x154)],'paused':_0x49f5fd[_0x943831(0x1b9)]['paused'],'audienceId':_0x49f5fd[_0x943831(0x1b9)][_0x943831(0x182)],'folderId':_0x49f5fd[_0x943831(0x149)]?.['parentFolder']?.['data']?.['id'],'createdAt':_0x49f5fd[_0x943831(0x1b9)][_0x943831(0x1be)],'updatedAt':_0x49f5fd[_0x943831(0x1b9)][_0x943831(0x1c0)]})),{emailToId:_0x47f032,idToEmail:_0x24ad6c}=_0x1a1177,_0x10cdb6=await withSpinner(_0x943831(0x165),async()=>{const _0x157f9e=_0x943831,_0x5ac270=await _0x1a1291[_0x157f9e(0x1a4)][_0x157f9e(0x18e)]();return buildConnectionMaps(_0x5ac270);},{'verbose':_0xca0657[_0x943831(0x16f)]})[_0x943831(0x1a2)](_0x5aa54d=>_0x5aa54d[_0x943831(0x13b)]),_0x51560a=_0x10cdb6['nameToId'],_0x29311c=_0x10cdb6[_0x943831(0x1b4)],_0x884f7=_0x10cdb6[_0x943831(0x153)],_0x233faf={'emailToIdMap':_0x47f032,'connectionNameToIdMap':_0x51560a,'connectionNameToTypeMap':_0x884f7,'getSchema':_0x5eba2d=>_0x1a1291[_0x943831(0x1a4)][_0x943831(0x199)](_0x5eba2d)};let {pathToId:_0xfa1079,idToPath:_0x4756b9}=buildFolderMaps(_0x3b3a0d);const _0x2a75fc=buildSegmentLookupMap(_0x5306ec,_0x4756b9),_0x1002ac=buildSegmentNameToIdMap(_0x5306ec),_0x5b6f02=buildJourneyBundleLookupMap(_0x2c9740,_0x4756b9);let _0xab2c6;if(_0x2a311d){if(!_0x2a311d[_0x943831(0x15a)](_0x943831(0x17b))&&!_0x2a311d[_0x943831(0x15a)]('.yaml'))return console['error'](a40_0x46b1d4[_0x943831(0x1a8)](_0x943831(0x1a3)+_0x2a311d+'\x0a')),0x1;_0xab2c6=[_0x2a311d];}else _0xab2c6=findYamlFiles(_0xa427ea);if(_0xab2c6['length']===0x0)return console[_0x943831(0x13f)](a40_0x46b1d4[_0x943831(0x1a8)](_0x943831(0x15b)+_0xa427ea+'\x0a')),console[_0x943831(0x13f)](a40_0x46b1d4[_0x943831(0x15c)](_0x943831(0x1c4))),0x1;let _0x31fa64,_0x24eff8;try{const _0x4641d3=parseAndClassifyYamlFiles(_0xab2c6,_0xa427ea,{'skipSegments':_0xca0657[_0x943831(0x144)]});_0x31fa64=_0x4641d3[_0x943831(0x164)],_0x24eff8=_0x4641d3[_0x943831(0x191)];const _0xdf9b70=validateParsedFiles(_0x4641d3,_0xa427ea);if(_0xdf9b70[_0x943831(0x145)]>0x0)return console[_0x943831(0x13f)](a40_0x46b1d4[_0x943831(0x1a8)](_0x943831(0x1b8))),console[_0x943831(0x13f)](formatValidationErrors(_0xdf9b70)),console[_0x943831(0x13f)](a40_0x46b1d4['yellow'](_0x943831(0x15e))),0x1;}catch(_0x1f8be9){return console[_0x943831(0x13f)](a40_0x46b1d4[_0x943831(0x1a8)](_0x943831(0x194)+(_0x1f8be9 instanceof Error?_0x1f8be9[_0x943831(0x17f)]:_0x1f8be9))),0x1;}if(_0x31fa64['length']===0x0&&_0x24eff8[_0x943831(0x145)]===0x0){const _0x3f4a5f=_0xca0657[_0x943831(0x144)]?_0x943831(0x138):_0x943831(0x17d);return console['error'](a40_0x46b1d4[_0x943831(0x18b)](_0x943831(0x1af)+_0x3f4a5f+_0x943831(0x1c3))),0x0;}const _0x3d4888=new Map();_0x5306ec['length']>0x0&&!_0xca0657[_0x943831(0x144)]&&await withSpinner(_0x943831(0x16e),async()=>{await batchAsync(_0x5306ec,async _0x1745d7=>{const _0x379a09=a40_0x4eb6,_0x34b040=await _0x1a1291[_0x379a09(0x13d)][_0x379a09(0x157)](_0x189efd,_0x1745d7['id']);_0x3d4888[_0x379a09(0x1bc)](_0x1745d7['id'],_0x34b040);});},{'verbose':_0xca0657[_0x943831(0x16f)]});const {segmentFiles:_0x55de29,foldersToCreate:_0x145684}=await prepareSegmentFiles(_0x31fa64,{'segmentByFolderAndName':_0x2a75fc,'activationsBySegmentId':_0x3d4888,'folderPathToId':_0xfa1079,'idToEmailMap':_0x24ad6c,'connectionIdToNameMap':_0x29311c},_0x233faf,_0x3f7adf,_0x45186d),_0x580265=_0x2a311d?[]:findSegmentsToDelete(_0x5306ec,_0x31fa64[_0x943831(0x151)](({yamlConfig:_0x5d3156,folderPath:_0x13b4b2})=>({'yamlConfig':_0x5d3156,'folderPath':resolveTDFolderPath(_0x13b4b2,_0x3f7adf,_0x45186d)})),_0x4756b9,_0x45186d,_0x3f7adf),{journeyFiles:_0x48258b,foldersToCreate:_0x159189}=await withProgressSpinner('Preparing\x20journeys...',async _0x2fc4dc=>prepareJourneyFiles(_0x24eff8,{'fetchJourney':async _0x35855e=>_0x1a1291['journey'][_0x943831(0x148)](_0x35855e[_0x943831(0x19c)]),'journeyBundlesByFolderAndName':_0x5b6f02,'folderPathToId':_0xfa1079,'idToEmailMap':_0x24ad6c,'connectionIdToNameMap':_0x29311c,'existingSegments':_0x5306ec,'parentId':_0x189efd,'deps':_0x1a1291,'progress':{'update':_0x483880=>{const _0x2c90d5=_0x943831;_0x2fc4dc[_0x2c90d5(0x16a)](_0x483880),_0xca0657[_0x2c90d5(0x16f)]&&console[_0x2c90d5(0x13f)]('\x20\x20'+_0x483880);}},'journeyById':_0x4d52d8,'activationStepsById':_0x59552e},_0x3f7adf,_0x45186d),{'verbose':_0xca0657[_0x943831(0x16f)]})[_0x943831(0x1a2)](_0x1c44c0=>_0x1c44c0[_0x943831(0x13b)]);for(const _0x260f03 of _0x159189){_0x145684[_0x943831(0x17a)](_0x260f03);}const _0x41d870=_0x2a311d?[]:findJourneysToDelete(_0x2c9740,_0x24eff8[_0x943831(0x151)](({yamlConfig:_0x52e2e6,folderPath:_0x41e885})=>({'yamlConfig':_0x52e2e6,'folderPath':resolveTDFolderPath(_0x41e885,_0x3f7adf,_0x45186d)})),_0x4756b9,_0x45186d,_0x3f7adf),_0x3cb122=calculatePushStats(_0x55de29,_0x48258b,_0x145684,_0x580265,_0x41d870,!!_0xca0657['delete'],!!_0xca0657[_0x943831(0x144)]),_0x3b660e=_0x3cb122[_0x943831(0x164)][_0x943831(0x1b7)],_0xbfa6c4=_0x3cb122[_0x943831(0x164)]['changed'],_0x1b8379=_0x3cb122[_0x943831(0x164)]['unchanged'],_0x10d64f=_0x3cb122[_0x943831(0x164)][_0x943831(0x168)],_0xcce0aa=_0x3cb122[_0x943831(0x18f)][_0x943831(0x1bd)],_0x5091b7=_0x3cb122[_0x943831(0x191)][_0x943831(0x1b7)],_0xb492f9=_0x3cb122[_0x943831(0x191)]['changed'],_0xf6dd6a=_0x3cb122[_0x943831(0x191)][_0x943831(0x1ac)],_0x1690ae=_0x3cb122[_0x943831(0x191)][_0x943831(0x168)],_0x39fe4a=_0x3cb122[_0x943831(0x14e)][_0x943831(0x181)],_0xc422e=_0x3cb122['activations'][_0x943831(0x1bd)],_0x14fa61=_0x3cb122[_0x943831(0x14e)]['toUpdate'],_0x10a15e=_0x3cb122[_0x943831(0x14e)][_0x943831(0x168)];console['error']('\x0aPush\x20summary\x20for\x20\x27'+_0x502c32+'\x27:');_0xcce0aa['length']>0x0&&console[_0x943831(0x13f)]('\x20\x20'+a40_0x46b1d4[_0x943831(0x133)]('📁\x20'+_0xcce0aa[_0x943831(0x145)]+_0x943831(0x1b3)));if(!_0xca0657['journeysOnly']){console['error'](_0x943831(0x179)),console[_0x943831(0x13f)]('\x20\x20\x20\x20'+a40_0x46b1d4['green']('+\x20'+_0x3b660e[_0x943831(0x145)]+_0x943831(0x1a9))),console[_0x943831(0x13f)](_0x943831(0x147)+a40_0x46b1d4[_0x943831(0x18b)]('~\x20'+_0xbfa6c4[_0x943831(0x145)]+'\x20changed'));if(_0x10d64f[_0x943831(0x145)]>0x0)console['error']('\x20\x20\x20\x20'+a40_0x46b1d4[_0x943831(0x1a8)]('-\x20'+_0x10d64f[_0x943831(0x145)]+_0x943831(0x19e)));else _0x580265[_0x943831(0x145)]>0x0&&!_0xca0657[_0x943831(0x1b2)]&&console['error'](_0x943831(0x147)+a40_0x46b1d4[_0x943831(0x17e)](_0x580265[_0x943831(0x145)]+'\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)'));console[_0x943831(0x13f)]('\x20\x20\x20\x20'+a40_0x46b1d4['dim']('=\x20'+_0x1b8379[_0x943831(0x145)]+_0x943831(0x134)));}if(_0x48258b[_0x943831(0x145)]>0x0||_0x41d870['length']>0x0){console[_0x943831(0x13f)](_0x943831(0x13a)),console['error'](_0x943831(0x147)+a40_0x46b1d4[_0x943831(0x1ad)]('+\x20'+_0x5091b7[_0x943831(0x145)]+_0x943831(0x1a9))),console[_0x943831(0x13f)]('\x20\x20\x20\x20'+a40_0x46b1d4[_0x943831(0x18b)]('~\x20'+_0xb492f9[_0x943831(0x145)]+'\x20changed'));if(_0x1690ae['length']>0x0)console[_0x943831(0x13f)](_0x943831(0x147)+a40_0x46b1d4[_0x943831(0x1a8)]('-\x20'+_0x1690ae[_0x943831(0x145)]+_0x943831(0x19e)));else _0x41d870[_0x943831(0x145)]>0x0&&!_0xca0657['delete']&&console[_0x943831(0x13f)](_0x943831(0x147)+a40_0x46b1d4['dim'](_0x41d870['length']+'\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)'));console['error'](_0x943831(0x147)+a40_0x46b1d4['dim']('=\x20'+_0xf6dd6a[_0x943831(0x145)]+'\x20unchanged'));}_0x39fe4a['length']>0x0&&!_0xca0657['journeysOnly']&&(console['error'](''),console['error'](_0x943831(0x161)),_0xc422e['length']>0x0&&console['error'](_0x943831(0x147)+a40_0x46b1d4['green']('+\x20'+_0xc422e[_0x943831(0x145)]+_0x943831(0x172))),_0x14fa61[_0x943831(0x145)]>0x0&&console['error'](_0x943831(0x147)+a40_0x46b1d4[_0x943831(0x18b)]('~\x20'+_0x14fa61['length']+_0x943831(0x1ba))),_0x10a15e[_0x943831(0x145)]>0x0&&console[_0x943831(0x13f)]('\x20\x20\x20\x20'+a40_0x46b1d4['red']('-\x20'+_0x10a15e[_0x943831(0x145)]+_0x943831(0x19e))));console[_0x943831(0x13f)](_0x943831(0x1c5)+a40_0x46b1d4[_0x943831(0x15c)](_0xa427ea)+'\x0a');if(_0xcce0aa[_0x943831(0x145)]>0x0){console[_0x943831(0x13f)]('Folders\x20to\x20create:');for(const _0x4d2172 of _0xcce0aa){console[_0x943831(0x13f)]('\x20\x20'+a40_0x46b1d4[_0x943831(0x133)]('+')+'\x20'+_0x4d2172);}console[_0x943831(0x13f)]('');}if(_0x3b660e[_0x943831(0x145)]>0x0&&!_0xca0657['journeysOnly'])for(const _0x363f12 of _0x3b660e){const _0x7fb19=_0x363f12['folderPath']?_0x363f12[_0x943831(0x16c)]+'/'+_0x363f12[_0x943831(0x195)][_0x943831(0x139)]:_0x363f12[_0x943831(0x195)][_0x943831(0x139)],_0x2503cd=_0x363f12[_0x943831(0x195)][_0x943831(0x14e)]?.['length']||0x0,_0x3a9493=_0x2503cd>0x0?a40_0x46b1d4[_0x943831(0x17e)]('\x20['+_0x2503cd+'\x20activations]'):'';console[_0x943831(0x13f)]('\x0a'+a40_0x46b1d4['green']('New\x20segment:')+'\x20'+_0x7fb19+_0x3a9493),console['error']('─'[_0x943831(0x19b)](0x3c)),_0x363f12[_0x943831(0x187)]&&console['error'](_0x363f12['diff']),console[_0x943831(0x13f)]('─'[_0x943831(0x19b)](0x3c));}if(_0x10d64f['length']>0x0&&!_0xca0657[_0x943831(0x144)])for(const _0x488bff of _0x10d64f){const _0x3f29ad=_0x488bff[_0x943831(0x1c2)]?_0x4756b9[_0x943831(0x156)](_0x488bff[_0x943831(0x1c2)]['toString']())||'':'',_0x5f4e05=_0x3f29ad?_0x3f29ad+'/'+_0x488bff[_0x943831(0x139)]:_0x488bff[_0x943831(0x139)],_0x3313b8=_0x3d4888[_0x943831(0x156)](_0x488bff['id'])||[],_0x3ede45=_0x3313b8[_0x943831(0x145)]>0x0?a40_0x46b1d4['dim']('\x20['+_0x3313b8[_0x943831(0x145)]+_0x943831(0x140)):'';console['error']('\x0a'+a40_0x46b1d4['red'](_0x943831(0x196))+'\x20'+_0x5f4e05+_0x3ede45),console[_0x943831(0x13f)]('─'[_0x943831(0x19b)](0x3c));const _0x2712e8=segmentWithActivationsToYaml(_0x488bff,_0x3313b8,undefined,_0x24ad6c,_0x29311c),_0x4ef740=segmentToYamlString(_0x2712e8),_0x1c0e52=generateDiff(_0x4ef740,'');console[_0x943831(0x13f)](formatDiffWithColors(_0x1c0e52)),console[_0x943831(0x13f)]('─'[_0x943831(0x19b)](0x3c));}const _0x5c3384=_0x55de29[_0x943831(0x173)](_0x10c909=>!_0x10c909['isNew']&&_0x10c909[_0x943831(0x187)]);if(_0x5c3384[_0x943831(0x145)]>0x0&&!_0xca0657['journeysOnly'])for(const _0x33a8a6 of _0x5c3384){const _0x9d6184=_0x33a8a6[_0x943831(0x16c)]?_0x33a8a6['folderPath']+'/'+_0x33a8a6[_0x943831(0x195)]['name']:_0x33a8a6[_0x943831(0x195)][_0x943831(0x139)];console[_0x943831(0x13f)]('\x0a'+a40_0x46b1d4[_0x943831(0x18b)](_0x943831(0x177))+'\x20'+_0x9d6184),console[_0x943831(0x13f)]('─'[_0x943831(0x19b)](0x3c)),console[_0x943831(0x13f)](_0x33a8a6[_0x943831(0x187)]),console['error']('─'['repeat'](0x3c));}if(_0x5091b7[_0x943831(0x145)]>0x0)for(const _0x1f5800 of _0x5091b7){const _0x533694=_0x1f5800[_0x943831(0x16c)]?_0x1f5800[_0x943831(0x16c)]+'/'+_0x1f5800[_0x943831(0x195)][_0x943831(0x139)]:_0x1f5800[_0x943831(0x195)][_0x943831(0x139)];console[_0x943831(0x13f)]('\x0a'+a40_0x46b1d4[_0x943831(0x1ad)](_0x943831(0x1aa))+'\x20'+_0x533694),console[_0x943831(0x13f)]('─'['repeat'](0x3c)),_0x1f5800[_0x943831(0x187)]&&console[_0x943831(0x13f)](_0x1f5800[_0x943831(0x187)]),console['error']('─'[_0x943831(0x19b)](0x3c));}const _0x5284e3=_0x48258b[_0x943831(0x173)](_0x8bac5=>!_0x8bac5['isNew']&&_0x8bac5[_0x943831(0x187)]);if(_0x5284e3['length']>0x0)for(const _0x19578d of _0x5284e3){const _0x4dff01=_0x19578d['folderPath']?_0x19578d[_0x943831(0x16c)]+'/'+_0x19578d['yamlConfig'][_0x943831(0x139)]:_0x19578d[_0x943831(0x195)][_0x943831(0x139)];console[_0x943831(0x13f)]('\x0a'+a40_0x46b1d4[_0x943831(0x18b)](_0x943831(0x155))+'\x20'+_0x4dff01),console['error']('─'[_0x943831(0x19b)](0x3c)),console['error'](_0x19578d[_0x943831(0x187)]),console[_0x943831(0x13f)]('─'[_0x943831(0x19b)](0x3c));}if(_0x1690ae[_0x943831(0x145)]>0x0)for(const _0x440627 of _0x1690ae){const _0x3bffaf=_0x440627[_0x943831(0x1bb)]?_0x4756b9['get'](_0x440627[_0x943831(0x1bb)])||'':'',_0x18be50=_0x3bffaf?_0x3bffaf+'/'+_0x440627['journeyBundleName']:_0x440627[_0x943831(0x15d)];console['error']('\x0a'+a40_0x46b1d4['red'](_0x943831(0x13e))+'\x20'+_0x18be50),console[_0x943831(0x13f)]('─'['repeat'](0x3c)),console[_0x943831(0x13f)](a40_0x46b1d4[_0x943831(0x1a8)]('(Journey\x20will\x20be\x20deleted)')),console[_0x943831(0x13f)]('─'[_0x943831(0x19b)](0x3c));}if(_0xca0657['dryRun'])return console[_0x943831(0x13f)](a40_0x46b1d4[_0x943831(0x18b)](_0x943831(0x1bf))),0x0;const _0x5cc5c8=_0xca0657[_0x943831(0x144)]?![]:_0x3b660e['length']>0x0||_0xbfa6c4[_0x943831(0x145)]>0x0||_0x10d64f[_0x943831(0x145)]>0x0,_0x4a5d53=_0x5091b7[_0x943831(0x145)]>0x0||_0xb492f9[_0x943831(0x145)]>0x0||_0x1690ae[_0x943831(0x145)]>0x0,_0x304bbc=_0xca0657['journeysOnly']?![]:_0x39fe4a[_0x943831(0x145)]>0x0,_0x5ced71=_0xcce0aa['length']>0x0;if(!_0x5cc5c8&&!_0x4a5d53&&!_0x304bbc&&!_0x5ced71){const _0x8497c1=_0xca0657['journeysOnly']?_0x943831(0x141):'✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date';console[_0x943831(0x13f)](a40_0x46b1d4[_0x943831(0x1ad)](_0x8497c1));if(_0x2a311d&&_0x1b8379[_0x943831(0x145)]===0x1){const _0x4d7dea=_0x1b8379[0x0];if(_0x4d7dea[_0x943831(0x1a1)]?.['id']){const _0x915b91=getConsoleNextUrl(_0xca0657['site'],_0x943831(0x174)+_0x189efd+_0x943831(0x192)+_0x4d7dea[_0x943831(0x1a1)]['id']+_0x943831(0x15f));console[_0x943831(0x13f)](_0x943831(0x1b5)+a40_0x46b1d4[_0x943831(0x15c)](_0x915b91));}}if(_0x2a311d&&_0xf6dd6a[_0x943831(0x145)]===0x1){const _0x1535f2=_0xf6dd6a[0x0];if(_0x1535f2[_0x943831(0x143)]?.['id']){const _0x52f67a=getConsoleNextUrl(_0xca0657[_0x943831(0x135)],_0x943831(0x174)+_0x189efd+_0x943831(0x192)+_0x1535f2['existingJourney']['id']+_0x943831(0x171));console[_0x943831(0x13f)]('\x20\x20'+a40_0x46b1d4['cyan'](_0x52f67a));}}return 0x0;}const _0x47b275=_0xca0657['journeysOnly']?_0x5091b7[_0x943831(0x145)]+_0xb492f9[_0x943831(0x145)]+_0x1690ae['length']+_0xcce0aa[_0x943831(0x145)]:_0x3b660e[_0x943831(0x145)]+_0xbfa6c4['length']+_0x10d64f['length']+_0x5091b7['length']+_0xb492f9[_0x943831(0x145)]+_0x1690ae['length']+_0xcce0aa[_0x943831(0x145)]+_0x39fe4a['length'];if(!_0xca0657['yes']&&_0x47b275>0x0){if(!isInteractive())return console[_0x943831(0x13f)](a40_0x46b1d4[_0x943831(0x1a8)](_0x943831(0x19f)),_0x943831(0x189)),console[_0x943831(0x13f)](a40_0x46b1d4[_0x943831(0x17e)](_0x943831(0x16b))),0x1;const _0x48727f=await confirmKey(_0x943831(0x17c)+_0x47b275+_0x943831(0x158));if(!_0x48727f)return console[_0x943831(0x13f)](a40_0x46b1d4[_0x943831(0x18b)](_0x943831(0x184))),0x1;}const _0x2077b5={'withProgress':async(_0x4421f6,_0x490c81)=>{const _0x4b1a80=_0x943831,_0xc58ddd=await withSpinner(_0x4421f6,_0x490c81,{'verbose':_0xca0657[_0x4b1a80(0x16f)]});return{'data':_0xc58ddd[_0x4b1a80(0x13b)]};},'logInfo':_0x2ad473=>console[_0x943831(0x13f)](a40_0x46b1d4[_0x943831(0x133)]('✔\x20'+_0x2ad473)),'logSuccess':_0x126590=>console[_0x943831(0x13f)](a40_0x46b1d4[_0x943831(0x1ad)]('✔\x20'+_0x126590)),'logWarning':_0x5d3ee6=>console[_0x943831(0x13f)](a40_0x46b1d4[_0x943831(0x18b)]('⚠\x20'+_0x5d3ee6)),'logDeleted':_0x305cc1=>console[_0x943831(0x13f)](a40_0x46b1d4[_0x943831(0x1a8)]('✔\x20'+_0x305cc1))},_0x38e4ab={'segment':_0x1a1291[_0x943831(0x13d)],'journey':_0x1a1291['journey'],'user':_0x1a1291[_0x943831(0x1b6)],'connection':_0x1a1291[_0x943831(0x1a4)]};_0xcce0aa[_0x943831(0x145)]>0x0&&(_0xfa1079=await executePushFolders(_0x38e4ab,_0xcce0aa,_0xfa1079,{'parentId':_0x189efd},_0x2077b5));const _0x3552c0={'rootFolderId':_0x49ef83,'folderPathToId':_0xfa1079,'folderIdToPath':_0x4756b9,'segmentNameToId':_0x1002ac,'activationsBySegmentId':_0x3d4888,'emailToIdMap':_0x47f032,'idToEmailMap':_0x24ad6c,'connectionNameToIdMap':_0x10cdb6['nameToId'],'connectionIdToNameMap':_0x10cdb6['idToName'],'connectionNameToTypeMap':_0x884f7},_0x22ab5f=await executePushSegments(_0x38e4ab,_0xca0657[_0x943831(0x144)]?[]:_0x55de29,_0x3552c0,{'parentId':_0x189efd},_0x2077b5),_0x2a829a=_0x22ab5f[_0x943831(0x132)],_0x1a5edf=_0x22ab5f[_0x943831(0x1c1)],_0xb8fa29=_0x22ab5f[_0x943831(0x14e)]['created'],_0x112106=_0x22ab5f[_0x943831(0x14e)][_0x943831(0x1c1)],_0x1aad5d=_0x22ab5f[_0x943831(0x14e)]['deleted'];let _0x476e9f;if(_0x2a311d&&_0x55de29[_0x943831(0x145)]===0x1){const _0x344134=_0x55de29[0x0];_0x476e9f=_0x344134[_0x943831(0x1a1)]?.['id']??_0x22ab5f[_0x943831(0x18a)]['get'](_0x344134[_0x943831(0x195)][_0x943831(0x139)]);}const _0x452126=await executePushSegmentDeletions(_0x38e4ab,_0xca0657[_0x943831(0x144)]?[]:_0x10d64f,_0x2077b5);let _0x2f23d1=0x0,_0x293305=0x0,_0x6a3add=0x0;const _0x4d5bc2=new Map(_0x1002ac);for(const [_0x5a93e7,_0x8abc38]of _0x22ab5f[_0x943831(0x18a)]){_0x4d5bc2['set'](_0x5a93e7,_0x8abc38);}if(_0x48258b[_0x943831(0x145)]>0x0){const _0x99b7c9={..._0x3552c0,'segmentNameToId':_0x4d5bc2,'existingSegments':_0x5306ec,'activationContext':_0x233faf},_0x319260=await executePushJourneys(_0x38e4ab,_0x48258b,_0x99b7c9,{'parentId':_0x189efd,'rootFolderId':_0x49ef83,'verbose':_0xca0657['verbose']},_0x2077b5);_0x2f23d1=_0x319260[_0x943831(0x132)],_0x293305=_0x319260['updated'];if(_0x2a311d&&_0x319260['results'][_0x943831(0x145)]===0x1){const _0x279aca=_0x319260[_0x943831(0x160)][0x0];if(_0x279aca['journeyId']){const _0x97e5b2=getConsoleNextUrl(_0xca0657[_0x943831(0x135)],_0x943831(0x174)+_0x189efd+_0x943831(0x192)+_0x279aca[_0x943831(0x19c)]+_0x943831(0x171));console[_0x943831(0x13f)]('\x20\x20'+a40_0x46b1d4[_0x943831(0x15c)](_0x97e5b2));}}}for(const _0x3678f1 of _0x1690ae){console[_0x943831(0x13f)](a40_0x46b1d4[_0x943831(0x18b)]('⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20'+_0x3678f1[_0x943831(0x15d)])),_0x6a3add++;}const _0x300882=[];if(_0x2a829a>0x0)_0x300882['push'](_0x2a829a+_0x943831(0x186));if(_0x1a5edf>0x0)_0x300882[_0x943831(0x178)](_0x1a5edf+_0x943831(0x18d));if(_0x452126>0x0)_0x300882[_0x943831(0x178)](_0x452126+_0x943831(0x1c7));const _0x2d9a4a=[];if(_0x2f23d1>0x0)_0x2d9a4a[_0x943831(0x178)](_0x2f23d1+_0x943831(0x186));if(_0x293305>0x0)_0x2d9a4a[_0x943831(0x178)](_0x293305+_0x943831(0x18d));if(_0x6a3add>0x0)_0x2d9a4a[_0x943831(0x178)](_0x6a3add+_0x943831(0x1c7));const _0xfcc35a=[];if(_0xb8fa29>0x0)_0xfcc35a[_0x943831(0x178)](_0xb8fa29+_0x943831(0x186));if(_0x112106>0x0)_0xfcc35a[_0x943831(0x178)](_0x112106+_0x943831(0x18d));if(_0x1aad5d>0x0)_0xfcc35a[_0x943831(0x178)](_0x1aad5d+_0x943831(0x1c7));console[_0x943831(0x13f)](a40_0x46b1d4[_0x943831(0x1ad)]('\x0a✔\x20Push\x20complete'));_0x300882['length']>0x0&&!_0xca0657[_0x943831(0x144)]&&console['error'](_0x943831(0x13c)+_0x300882[_0x943831(0x146)](',\x20'));_0x2d9a4a[_0x943831(0x145)]>0x0&&console[_0x943831(0x13f)](_0x943831(0x1a6)+_0x2d9a4a['join'](',\x20'));_0xfcc35a[_0x943831(0x145)]>0x0&&!_0xca0657[_0x943831(0x144)]&&console[_0x943831(0x13f)]('\x20\x20Activations:\x20'+_0xfcc35a[_0x943831(0x146)](',\x20'));if(_0x476e9f){const _0x3d5ce8=getConsoleNextUrl(_0xca0657[_0x943831(0x135)],_0x943831(0x174)+_0x189efd+_0x943831(0x192)+_0x476e9f+_0x943831(0x15f));console[_0x943831(0x13f)](_0x943831(0x1b5)+a40_0x46b1d4['cyan'](_0x3d5ce8));}return 0x0;}}
@@ -1 +1 @@
1
- const a41_0x3121b3=a41_0x38d9;function a41_0x38d9(_0x50210c,_0x2b6985){_0x50210c=_0x50210c-0x159;const _0x17d028=a41_0x17d0();let _0x38d90b=_0x17d028[_0x50210c];return _0x38d90b;}(function(_0x1084d6,_0x5a312a){const _0x4a7ca3=a41_0x38d9,_0xc01ce9=_0x1084d6();while(!![]){try{const _0x1c2ce5=parseInt(_0x4a7ca3(0x15a))/0x1*(parseInt(_0x4a7ca3(0x16f))/0x2)+-parseInt(_0x4a7ca3(0x17f))/0x3+-parseInt(_0x4a7ca3(0x16b))/0x4+parseInt(_0x4a7ca3(0x159))/0x5*(-parseInt(_0x4a7ca3(0x188))/0x6)+parseInt(_0x4a7ca3(0x167))/0x7*(-parseInt(_0x4a7ca3(0x16c))/0x8)+-parseInt(_0x4a7ca3(0x160))/0x9+parseInt(_0x4a7ca3(0x17e))/0xa;if(_0x1c2ce5===_0x5a312a)break;else _0xc01ce9['push'](_0xc01ce9['shift']());}catch(_0xc5cd08){_0xc01ce9['push'](_0xc01ce9['shift']());}}}(a41_0x17d0,0xd8841));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';function a41_0x17d0(){const _0x1f9dc8=['Parent\x20ID:\x20','description','2632482ZqryJo','⚠\x20Deprecation\x20warning:\x20`segment\x20update`\x20is\x20deprecated.','yellow','\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','resolveFolderId','\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22','Resolving\x20folder\x20\x27','796236uQRNUM','type','error','kind','3425612jPZAeo','112javdmu','Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]','parentId','2865686msXLDn','length','Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]','Resolving\x20path\x20\x27','Error:\x20Cannot\x20update\x20','segment','Resolved\x20relative\x20path\x20to:\x20','data','segmentPath','ruleFile','\x27...','Segment\x20ID:\x20','name','folder','✔\x20Updated\x20segment\x20\x27','37977770PISjXu','3642381DZJMtT','segmentId','Update\x20existing\x20child\x20segment','updateSegmentById','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','segmentName','\x20\x20\x20Path:\x20','Segment\x20ID\x20missing\x20from\x20resolved\x20path','INTERNAL','78NlNuKa','149335YNIlZK','1HNCWQQ','rule','verbose','segment:update'];a41_0x17d0=function(){return _0x1f9dc8;};return a41_0x17d0();}import{loadJSONFromOptions}from'../utils/json-loader.js';import{SDKError,ErrorCode}from'../sdk/index.js';import a41_0x42fc26 from'chalk';export class SegmentUpdateCommand extends BaseCommand{[a41_0x3121b3(0x17b)]=a41_0x3121b3(0x15d);['description']=a41_0x3121b3(0x181);async['execute'](_0x95bf80){const _0x5c8484=a41_0x3121b3;console['error'](a41_0x42fc26[_0x5c8484(0x162)](_0x5c8484(0x161))),console[_0x5c8484(0x169)](a41_0x42fc26['yellow']('\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a'));const {options:_0x21dd93,args:_0x201e68,tdx:_0x3ab9f2}=_0x95bf80,_0x3ac0ea=_0x21dd93;if(_0x201e68[_0x5c8484(0x170)]===0x0)return console[_0x5c8484(0x169)](_0x5c8484(0x183)),console[_0x5c8484(0x169)](_0x5c8484(0x171)),console[_0x5c8484(0x169)]('Examples:'),console[_0x5c8484(0x169)](_0x5c8484(0x165)),console['error'](_0x5c8484(0x163)),0x1;const _0x515dbf=_0x201e68[0x0],_0x1326da=_0x21dd93[_0x5c8484(0x177)];let _0x2f5793=_0x515dbf;_0x1326da&&!_0x515dbf['includes']('/')&&(_0x2f5793=_0x1326da+'/'+_0x515dbf,_0x3ac0ea['verbose']&&console[_0x5c8484(0x169)](_0x5c8484(0x175)+_0x2f5793));const _0x2ca757=await withSpinner(_0x5c8484(0x172)+_0x2f5793+_0x5c8484(0x179),()=>_0x3ab9f2[_0x5c8484(0x174)]['resolvePathToResource'](_0x2f5793),{'verbose':_0x3ac0ea['verbose']}),_0x184135=_0x2ca757[_0x5c8484(0x176)];_0x3ac0ea[_0x5c8484(0x15c)]&&console[_0x5c8484(0x169)]('Resolved\x20type:\x20'+_0x184135[_0x5c8484(0x168)]);if(_0x184135['type']!==_0x5c8484(0x174))return console[_0x5c8484(0x169)](_0x5c8484(0x173)+_0x184135['type']+'.\x20Only\x20child\x20segments\x20can\x20be\x20updated.'),console['error'](_0x5c8484(0x16d)),0x1;if(!_0x184135[_0x5c8484(0x180)])throw new SDKError(ErrorCode[_0x5c8484(0x187)],_0x5c8484(0x186));const _0x48c269=_0x184135[_0x5c8484(0x16e)],_0x53cdd2=_0x184135[_0x5c8484(0x180)];_0x3ac0ea[_0x5c8484(0x15c)]&&(console[_0x5c8484(0x169)](_0x5c8484(0x15e)+_0x48c269),console['error'](_0x5c8484(0x17a)+_0x53cdd2));let _0x5b58c1;if(_0x3ac0ea[_0x5c8484(0x17c)]){const _0x411726=_0x3ac0ea['folder'],_0x4f41c0=await withSpinner(_0x5c8484(0x166)+_0x411726+_0x5c8484(0x179),()=>_0x3ab9f2[_0x5c8484(0x174)][_0x5c8484(0x164)](_0x48c269,_0x411726),{'verbose':_0x3ac0ea[_0x5c8484(0x15c)]});_0x5b58c1=parseInt(_0x4f41c0[_0x5c8484(0x176)],0xa),_0x3ac0ea[_0x5c8484(0x15c)]&&console[_0x5c8484(0x169)]('Resolved\x20folder\x20ID:\x20'+_0x5b58c1);}const _0x1ec574=await loadJSONFromOptions(_0x3ac0ea[_0x5c8484(0x15b)],_0x3ac0ea[_0x5c8484(0x178)]),_0x8314a3={'name':_0x3ac0ea[_0x5c8484(0x17b)],'description':_0x3ac0ea[_0x5c8484(0x15f)],'rule':_0x1ec574,'kind':_0x3ac0ea['kind']!==undefined?parseInt(_0x3ac0ea[_0x5c8484(0x16a)],0xa):undefined,'segmentFolderId':_0x5b58c1},_0x16c58f=await withSpinner('Updating\x20segment\x20\x27'+_0x184135[_0x5c8484(0x184)]+_0x5c8484(0x179),()=>_0x3ab9f2['segment'][_0x5c8484(0x182)](_0x48c269,_0x53cdd2,_0x8314a3),{'verbose':_0x3ac0ea[_0x5c8484(0x15c)]}),_0x89a624=_0x16c58f[_0x5c8484(0x176)];return console[_0x5c8484(0x169)](_0x5c8484(0x17d)+_0x89a624[_0x5c8484(0x17b)]+'\x27'),_0x2f5793!==_0x515dbf&&console[_0x5c8484(0x169)](_0x5c8484(0x185)+_0x2f5793),await handleSDKOutput([_0x89a624],_0x3ac0ea),0x0;}}
1
+ const a41_0x393ccf=a41_0x2867;(function(_0x59cee3,_0x2fa900){const _0x2d3472=a41_0x2867,_0x34c4b5=_0x59cee3();while(!![]){try{const _0x4df507=-parseInt(_0x2d3472(0xf8))/0x1*(parseInt(_0x2d3472(0x104))/0x2)+parseInt(_0x2d3472(0x110))/0x3*(-parseInt(_0x2d3472(0x106))/0x4)+-parseInt(_0x2d3472(0xfc))/0x5+-parseInt(_0x2d3472(0x120))/0x6+parseInt(_0x2d3472(0x11a))/0x7*(-parseInt(_0x2d3472(0x10d))/0x8)+-parseInt(_0x2d3472(0xf7))/0x9*(-parseInt(_0x2d3472(0x10e))/0xa)+-parseInt(_0x2d3472(0x112))/0xb*(-parseInt(_0x2d3472(0x109))/0xc);if(_0x4df507===_0x2fa900)break;else _0x34c4b5['push'](_0x34c4b5['shift']());}catch(_0x448e8b){_0x34c4b5['push'](_0x34c4b5['shift']());}}}(a41_0x41a4,0x3e7a3));function a41_0x41a4(){const _0x151b24=['name','segment:update','segment','Parent\x20ID:\x20','description','Segment\x20ID\x20missing\x20from\x20resolved\x20path','segmentPath','7mOmksu','data','INTERNAL','\x27...','Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]','Resolved\x20type:\x20','1844382jSOpLM','⚠\x20Deprecation\x20warning:\x20`segment\x20update`\x20is\x20deprecated.','execute','folder','Update\x20existing\x20child\x20segment','includes','rule','Resolving\x20folder\x20\x27','45qnQesT','7nYdbQJ','kind','Updating\x20segment\x20\x27','yellow','1417510pjfVVy','Resolved\x20relative\x20path\x20to:\x20','verbose','Segment\x20ID:\x20','\x20\x20\x20Path:\x20','\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','Resolved\x20folder\x20ID:\x20','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','120214ltzNhq','.\x20Only\x20child\x20segments\x20can\x20be\x20updated.','7244ycqyWt','type','error','214380ClRUZI','parentId','\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22','✔\x20Updated\x20segment\x20\x27','1375208lxvkCt','610110wXbgMc','ruleFile','222OzUneT','updateSegmentById','781NLbJMi'];a41_0x41a4=function(){return _0x151b24;};return a41_0x41a4();}import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{SDKError,ErrorCode}from'../sdk/index.js';function a41_0x2867(_0x531bfb,_0x590a51){_0x531bfb=_0x531bfb-0xf1;const _0x41a4ef=a41_0x41a4();let _0x286726=_0x41a4ef[_0x531bfb];return _0x286726;}import a41_0x146fc4 from'chalk';export class SegmentUpdateCommand extends BaseCommand{[a41_0x393ccf(0x113)]=a41_0x393ccf(0x114);[a41_0x393ccf(0x117)]=a41_0x393ccf(0xf3);async[a41_0x393ccf(0xf1)](_0x369e18){const _0x5d324d=a41_0x393ccf;console['error'](a41_0x146fc4[_0x5d324d(0xfb)](_0x5d324d(0x121))),console['error'](a41_0x146fc4[_0x5d324d(0xfb)](_0x5d324d(0x103)));const {options:_0x2d57ad,args:_0x68d648,tdx:_0x524216}=_0x369e18,_0x4cee2e=_0x2d57ad;if(_0x68d648['length']===0x0)return console[_0x5d324d(0x108)]('Error:\x20Segment\x20path\x20or\x20name\x20is\x20required'),console[_0x5d324d(0x108)](_0x5d324d(0x11e)),console[_0x5d324d(0x108)]('Examples:'),console[_0x5d324d(0x108)](_0x5d324d(0x10b)),console['error'](_0x5d324d(0x101)),0x1;const _0x54a54a=_0x68d648[0x0],_0x9be270=_0x2d57ad[_0x5d324d(0x119)];let _0x3e608d=_0x54a54a;_0x9be270&&!_0x54a54a[_0x5d324d(0xf4)]('/')&&(_0x3e608d=_0x9be270+'/'+_0x54a54a,_0x4cee2e[_0x5d324d(0xfe)]&&console[_0x5d324d(0x108)](_0x5d324d(0xfd)+_0x3e608d));const _0x1a0e8f=await withSpinner('Resolving\x20path\x20\x27'+_0x3e608d+_0x5d324d(0x11d),()=>_0x524216['segment']['resolvePathToResource'](_0x3e608d),{'verbose':_0x4cee2e[_0x5d324d(0xfe)]}),_0x35d151=_0x1a0e8f['data'];_0x4cee2e['verbose']&&console[_0x5d324d(0x108)](_0x5d324d(0x11f)+_0x35d151[_0x5d324d(0x107)]);if(_0x35d151['type']!==_0x5d324d(0x115))return console[_0x5d324d(0x108)]('Error:\x20Cannot\x20update\x20'+_0x35d151[_0x5d324d(0x107)]+_0x5d324d(0x105)),console[_0x5d324d(0x108)]('Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]'),0x1;if(!_0x35d151['segmentId'])throw new SDKError(ErrorCode[_0x5d324d(0x11c)],_0x5d324d(0x118));const _0x5d791c=_0x35d151[_0x5d324d(0x10a)],_0x30e81e=_0x35d151['segmentId'];_0x4cee2e['verbose']&&(console[_0x5d324d(0x108)](_0x5d324d(0x116)+_0x5d791c),console[_0x5d324d(0x108)](_0x5d324d(0xff)+_0x30e81e));let _0x40d0d9;if(_0x4cee2e[_0x5d324d(0xf2)]){const _0x271b71=_0x4cee2e[_0x5d324d(0xf2)],_0x27526b=await withSpinner(_0x5d324d(0xf6)+_0x271b71+_0x5d324d(0x11d),()=>_0x524216[_0x5d324d(0x115)]['resolveFolderId'](_0x5d791c,_0x271b71),{'verbose':_0x4cee2e[_0x5d324d(0xfe)]});_0x40d0d9=parseInt(_0x27526b[_0x5d324d(0x11b)],0xa),_0x4cee2e[_0x5d324d(0xfe)]&&console[_0x5d324d(0x108)](_0x5d324d(0x102)+_0x40d0d9);}const _0x13a99b=await loadJSONFromOptions(_0x4cee2e[_0x5d324d(0xf5)],_0x4cee2e[_0x5d324d(0x10f)]),_0x5efa93={'name':_0x4cee2e[_0x5d324d(0x113)],'description':_0x4cee2e[_0x5d324d(0x117)],'rule':_0x13a99b,'kind':_0x4cee2e[_0x5d324d(0xf9)]!==undefined?parseInt(_0x4cee2e['kind'],0xa):undefined,'segmentFolderId':_0x40d0d9},_0x577ea8=await withSpinner(_0x5d324d(0xfa)+_0x35d151['segmentName']+_0x5d324d(0x11d),()=>_0x524216[_0x5d324d(0x115)][_0x5d324d(0x111)](_0x5d791c,_0x30e81e,_0x5efa93),{'verbose':_0x4cee2e[_0x5d324d(0xfe)]}),_0x36bd60=_0x577ea8[_0x5d324d(0x11b)];return console[_0x5d324d(0x108)](_0x5d324d(0x10c)+_0x36bd60[_0x5d324d(0x113)]+'\x27'),_0x3e608d!==_0x54a54a&&console['error'](_0x5d324d(0x100)+_0x3e608d),await handleSDKOutput([_0x36bd60],_0x4cee2e),0x0;}}
@@ -1 +1 @@
1
- const a42_0x12e949=a42_0xf5da;(function(_0x7a91ae,_0xba2ff6){const _0x378ca1=a42_0xf5da,_0x1c70f3=_0x7a91ae();while(!![]){try{const _0x29610d=parseInt(_0x378ca1(0x105))/0x1*(-parseInt(_0x378ca1(0x11d))/0x2)+-parseInt(_0x378ca1(0xf4))/0x3*(-parseInt(_0x378ca1(0x116))/0x4)+parseInt(_0x378ca1(0x10a))/0x5*(-parseInt(_0x378ca1(0x122))/0x6)+parseInt(_0x378ca1(0x104))/0x7+-parseInt(_0x378ca1(0x100))/0x8+parseInt(_0x378ca1(0xec))/0x9+parseInt(_0x378ca1(0x109))/0xa;if(_0x29610d===_0xba2ff6)break;else _0x1c70f3['push'](_0x1c70f3['shift']());}catch(_0x2ea0e3){_0x1c70f3['push'](_0x1c70f3['shift']());}}}(a42_0x5abb,0xeaf26));import{existsSync,statSync}from'fs';import a42_0x468baf from'chalk';import{BaseCommand}from'./command.js';import{saveSessionContext}from'../core/session.js';function a42_0x5abb(){const _0x2cf400=['94ZpUQyo','Use\x20\x22tdx\x20use\x22\x20to\x20see\x20all\x20context\x20parameters','log','description','parentId','6PeIuYd','Resolving\x20path\x20\x27','Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context','3089691QzSqgi','✔\x20Context\x20set\x20to:\x20','\x27...','fullPath','green','isDirectory','\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context','Parent\x20ID:\x20','1698906FTQNkN','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22','red','dim','parentName','split','Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.','execute','Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','segments','slice','segment','13695392gwpjiW','✔\x20Context\x20cleared.\x20Back\x20to\x20root.','error','join','11710062rILhgu','2567fpUIis','Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>','folderId','verbose','408100xtnXkw','1973320ECPRGD','Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.','Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.','Usage:\x20tdx\x20segment\x20use\x20<path>','name','resolvePathToResource','Site:\x20','isAbsolute','segment:use','\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent','Examples:','data','8pwipst','Error:\x20Path\x20is\x20required\x0a','Set\x20current\x20segment/folder\x20context\x20for\x20navigation','config','cyan','segmentPath','folderPath'];a42_0x5abb=function(){return _0x2cf400;};return a42_0x5abb();}function a42_0xf5da(_0xf145f7,_0x46b17a){_0xf145f7=_0xf145f7-0xec;const _0x5abb82=a42_0x5abb();let _0xf5da30=_0x5abb82[_0xf145f7];return _0xf5da30;}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{[a42_0x12e949(0x10e)]=a42_0x12e949(0x112);[a42_0x12e949(0x120)]=a42_0x12e949(0x118);async[a42_0x12e949(0xfb)](_0x38125f){const _0x121290=a42_0x12e949,{options:_0x4f4cbf,args:_0x57fe46,tdx:_0x5d6899}=_0x38125f;if(_0x57fe46['length']===0x0)return console[_0x121290(0x102)](a42_0x468baf[_0x121290(0xf6)](_0x121290(0x117))),console[_0x121290(0x102)](_0x121290(0x10d)),console['error'](_0x121290(0x114)),console['error']('\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22'),console['error'](_0x121290(0xf5)),console['error'](_0x121290(0xf2)),console[_0x121290(0x102)](_0x121290(0x113)),0x1;const _0x4b73fb=_0x57fe46[0x0],_0x5b2482=_0x4f4cbf['session'];try{if(_0x4b73fb==='/')return saveSessionContext({'segment_path':undefined},_0x5b2482),console[_0x121290(0x11f)](a42_0x468baf[_0x121290(0xf0)](_0x121290(0x101))),0x0;if(existsSync(_0x4b73fb)&&statSync(_0x4b73fb)[_0x121290(0xf1)]()){let _0x1dca80;try{_0x1dca80=findTdxConfig(_0x4b73fb);}catch{return console[_0x121290(0x102)](a42_0x468baf[_0x121290(0xf6)](_0x121290(0xfc)+_0x4b73fb)),console[_0x121290(0x102)](a42_0x468baf[_0x121290(0x11a)]('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;}const _0x1bbe6b=_0x1dca80[_0x121290(0x119)]['parent_segment'];return saveSessionContext({'segment_path':_0x1bbe6b,'parent_segment':_0x1bbe6b},_0x5b2482),console[_0x121290(0x11f)](a42_0x468baf[_0x121290(0xf0)](_0x121290(0xed)+a42_0x468baf[_0x121290(0x11a)](_0x1bbe6b))),0x0;}const _0x549155=_0x4f4cbf[_0x121290(0x11b)];let _0x2055e2=_0x4b73fb;const _0x156e46=parsePath(_0x4b73fb);if(!_0x156e46[_0x121290(0x111)]){if(!_0x549155)return console[_0x121290(0x102)](a42_0x468baf[_0x121290(0xf6)](_0x121290(0xfa))),console['error'](a42_0x468baf[_0x121290(0x11a)](_0x121290(0x106))),0x1;if(_0x4b73fb==='..'){const _0x1284dc=_0x549155[_0x121290(0xf9)]('/')[_0x121290(0xfe)](0x0,-0x1)[_0x121290(0x103)]('/');_0x2055e2=_0x1284dc||'/';}else _0x4b73fb==='.'?_0x2055e2=_0x549155:_0x2055e2=_0x549155+'/'+_0x4b73fb;_0x4f4cbf['verbose']&&console[_0x121290(0x102)]('Resolved\x20relative\x20path\x20to:\x20'+_0x2055e2);}if(_0x2055e2==='/'||_0x2055e2==='')return saveSessionContext({'segment_path':undefined},_0x5b2482),console[_0x121290(0x11f)](a42_0x468baf[_0x121290(0xf0)]('✔\x20Context\x20cleared.\x20Back\x20to\x20root.')),0x0;_0x2055e2=normalizePath(_0x2055e2);const _0x53be2f=parsePath(_0x2055e2)[_0x121290(0xfd)];if(_0x53be2f['length']===0x0)return saveSessionContext({'segment_path':undefined},_0x5b2482),console[_0x121290(0x11f)](a42_0x468baf[_0x121290(0xf0)](_0x121290(0x101))),0x0;_0x4f4cbf[_0x121290(0x108)]&&(console[_0x121290(0x102)](_0x121290(0x110)+_0x4f4cbf['site']),console[_0x121290(0x102)]('Target\x20path:\x20'+_0x2055e2));const _0x1e5551=await withSpinner(_0x121290(0x123)+_0x2055e2+_0x121290(0xee),()=>_0x5d6899[_0x121290(0xff)][_0x121290(0x10f)](_0x2055e2),{'verbose':_0x4f4cbf[_0x121290(0x108)]}),_0x163f08=_0x1e5551[_0x121290(0x115)];_0x4f4cbf[_0x121290(0x108)]&&(console[_0x121290(0x102)]('Resolved\x20path\x20type:\x20'+_0x163f08['type']),console[_0x121290(0x102)](_0x121290(0xf3)+_0x163f08[_0x121290(0x121)]),_0x163f08[_0x121290(0x107)]&&console[_0x121290(0x102)]('Folder\x20ID:\x20'+_0x163f08[_0x121290(0x107)]));if(_0x163f08['type']===_0x121290(0xff))return console[_0x121290(0x102)](a42_0x468baf['red'](_0x121290(0x10b))),console[_0x121290(0x102)](_0x121290(0x10c)),console[_0x121290(0x102)](a42_0x468baf['cyan']('Use:\x20tdx\x20segment\x20use\x20'+_0x163f08[_0x121290(0xf8)]+(_0x163f08[_0x121290(0x11c)]?'/'+_0x163f08[_0x121290(0x11c)]['join']('/'):''))),0x1;return saveSessionContext({'segment_path':_0x163f08[_0x121290(0xef)],'parent_segment':_0x163f08[_0x121290(0xf8)]},_0x5b2482),console['log'](a42_0x468baf[_0x121290(0xf0)](_0x121290(0xed)+a42_0x468baf[_0x121290(0x11a)](_0x163f08[_0x121290(0xef)]))),_0x4f4cbf['verbose']&&(console[_0x121290(0x102)](a42_0x468baf[_0x121290(0xf7)](_0x121290(0x124))),console[_0x121290(0x102)](a42_0x468baf[_0x121290(0xf7)](_0x121290(0x11e)))),0x0;}catch(_0x18ffc6){throw _0x18ffc6;}}}
1
+ const a42_0x5c3eb3=a42_0x4cbd;(function(_0x4fa0e5,_0x2b3d36){const _0x429300=a42_0x4cbd,_0x2cb84e=_0x4fa0e5();while(!![]){try{const _0xa30a1f=parseInt(_0x429300(0x182))/0x1*(-parseInt(_0x429300(0x167))/0x2)+parseInt(_0x429300(0x158))/0x3*(parseInt(_0x429300(0x14d))/0x4)+-parseInt(_0x429300(0x180))/0x5*(-parseInt(_0x429300(0x173))/0x6)+-parseInt(_0x429300(0x176))/0x7*(parseInt(_0x429300(0x160))/0x8)+parseInt(_0x429300(0x161))/0x9*(-parseInt(_0x429300(0x170))/0xa)+parseInt(_0x429300(0x166))/0xb+parseInt(_0x429300(0x178))/0xc*(parseInt(_0x429300(0x152))/0xd);if(_0xa30a1f===_0x2b3d36)break;else _0x2cb84e['push'](_0x2cb84e['shift']());}catch(_0x2d714d){_0x2cb84e['push'](_0x2cb84e['shift']());}}}(a42_0x1c1a,0xa4ffc));import{existsSync,statSync}from'fs';import a42_0x881e7d from'chalk';import{BaseCommand}from'./command.js';import{saveSessionContext}from'../core/session.js';function a42_0x1c1a(){const _0x574fb1=['✔\x20Context\x20cleared.\x20Back\x20to\x20root.','830halswD','segment','red','6762GmjFgu','resolvePathToResource','join','1851241UCmwUM','Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.','8668392AlSmKt','Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','green','Resolved\x20path\x20type:\x20','Resolving\x20path\x20\x27','split','description','1575OXsdiL','Resolved\x20relative\x20path\x20to:\x20','6197eYLHry','Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.','isDirectory','segments','Target\x20path:\x20','Usage:\x20tdx\x20segment\x20use\x20<path>','parentId','13556QJpQfI','Examples:','folderId','✔\x20Context\x20set\x20to:\x20','name','13dyrGCl','Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','execute','isAbsolute','folderPath','Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>','648ICdAFL','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22','dim','type','Use\x20\x22tdx\x20use\x22\x20to\x20see\x20all\x20context\x20parameters','parentName','error','cyan','32jsdzsU','44802PQpKpu','fullPath','verbose','slice','log','7733990tjPYXc','118bwdKfh','Use:\x20tdx\x20segment\x20use\x20','parent_segment','\x27...','segmentPath','config','length','\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent'];a42_0x1c1a=function(){return _0x574fb1;};return a42_0x1c1a();}import{withSpinner}from'../utils/spinner.js';import{parsePath,normalizePath}from'../sdk/segment/segment-path-parser.js';function a42_0x4cbd(_0x3fdcc6,_0x274b0f){_0x3fdcc6=_0x3fdcc6-0x14c;const _0x1c1aea=a42_0x1c1a();let _0x4cbddd=_0x1c1aea[_0x3fdcc6];return _0x4cbddd;}import{findTdxConfig}from'../sdk/segment/tdx-config.js';export class SegmentUseCommand extends BaseCommand{[a42_0x5c3eb3(0x151)]='segment:use';[a42_0x5c3eb3(0x17f)]='Set\x20current\x20segment/folder\x20context\x20for\x20navigation';async[a42_0x5c3eb3(0x154)](_0x3e70b6){const _0x24e6b8=a42_0x5c3eb3,{options:_0x4b2c68,args:_0x427822,tdx:_0x152a95}=_0x3e70b6;if(_0x427822[_0x24e6b8(0x16d)]===0x0)return console[_0x24e6b8(0x15e)](a42_0x881e7d[_0x24e6b8(0x172)]('Error:\x20Path\x20is\x20required\x0a')),console[_0x24e6b8(0x15e)](_0x24e6b8(0x187)),console[_0x24e6b8(0x15e)](_0x24e6b8(0x14e)),console[_0x24e6b8(0x15e)]('\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22'),console[_0x24e6b8(0x15e)](_0x24e6b8(0x159)),console[_0x24e6b8(0x15e)]('\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context'),console['error'](_0x24e6b8(0x16e)),0x1;const _0x1fdc48=_0x427822[0x0],_0x4572ab=_0x4b2c68['session'];try{if(_0x1fdc48==='/')return saveSessionContext({'segment_path':undefined},_0x4572ab),console[_0x24e6b8(0x165)](a42_0x881e7d['green'](_0x24e6b8(0x16f))),0x0;if(existsSync(_0x1fdc48)&&statSync(_0x1fdc48)[_0x24e6b8(0x184)]()){let _0x4804a1;try{_0x4804a1=findTdxConfig(_0x1fdc48);}catch{return console[_0x24e6b8(0x15e)](a42_0x881e7d[_0x24e6b8(0x172)](_0x24e6b8(0x153)+_0x1fdc48)),console['error'](a42_0x881e7d[_0x24e6b8(0x15f)](_0x24e6b8(0x17a))),0x1;}const _0x35843e=_0x4804a1[_0x24e6b8(0x16c)][_0x24e6b8(0x169)];return saveSessionContext({'segment_path':_0x35843e,'parent_segment':_0x35843e},_0x4572ab),console[_0x24e6b8(0x165)](a42_0x881e7d['green'](_0x24e6b8(0x150)+a42_0x881e7d[_0x24e6b8(0x15f)](_0x35843e))),0x0;}const _0x359431=_0x4b2c68[_0x24e6b8(0x16b)];let _0x54704a=_0x1fdc48;const _0x1d6675=parsePath(_0x1fdc48);if(!_0x1d6675[_0x24e6b8(0x155)]){if(!_0x359431)return console[_0x24e6b8(0x15e)](a42_0x881e7d['red'](_0x24e6b8(0x183))),console[_0x24e6b8(0x15e)](a42_0x881e7d[_0x24e6b8(0x15f)](_0x24e6b8(0x157))),0x1;if(_0x1fdc48==='..'){const _0x4fc14c=_0x359431[_0x24e6b8(0x17e)]('/')[_0x24e6b8(0x164)](0x0,-0x1)[_0x24e6b8(0x175)]('/');_0x54704a=_0x4fc14c||'/';}else _0x1fdc48==='.'?_0x54704a=_0x359431:_0x54704a=_0x359431+'/'+_0x1fdc48;_0x4b2c68['verbose']&&console[_0x24e6b8(0x15e)](_0x24e6b8(0x181)+_0x54704a);}if(_0x54704a==='/'||_0x54704a==='')return saveSessionContext({'segment_path':undefined},_0x4572ab),console[_0x24e6b8(0x165)](a42_0x881e7d[_0x24e6b8(0x17b)]('✔\x20Context\x20cleared.\x20Back\x20to\x20root.')),0x0;_0x54704a=normalizePath(_0x54704a);const _0x7b6db=parsePath(_0x54704a)[_0x24e6b8(0x185)];if(_0x7b6db[_0x24e6b8(0x16d)]===0x0)return saveSessionContext({'segment_path':undefined},_0x4572ab),console[_0x24e6b8(0x165)](a42_0x881e7d[_0x24e6b8(0x17b)]('✔\x20Context\x20cleared.\x20Back\x20to\x20root.')),0x0;_0x4b2c68[_0x24e6b8(0x163)]&&(console[_0x24e6b8(0x15e)]('Site:\x20'+_0x4b2c68['site']),console[_0x24e6b8(0x15e)](_0x24e6b8(0x186)+_0x54704a));const _0x43b1ee=await withSpinner(_0x24e6b8(0x17d)+_0x54704a+_0x24e6b8(0x16a),()=>_0x152a95[_0x24e6b8(0x171)][_0x24e6b8(0x174)](_0x54704a),{'verbose':_0x4b2c68['verbose']}),_0x55e5ed=_0x43b1ee['data'];_0x4b2c68[_0x24e6b8(0x163)]&&(console[_0x24e6b8(0x15e)](_0x24e6b8(0x17c)+_0x55e5ed[_0x24e6b8(0x15b)]),console[_0x24e6b8(0x15e)]('Parent\x20ID:\x20'+_0x55e5ed[_0x24e6b8(0x14c)]),_0x55e5ed[_0x24e6b8(0x14f)]&&console['error']('Folder\x20ID:\x20'+_0x55e5ed[_0x24e6b8(0x14f)]));if(_0x55e5ed[_0x24e6b8(0x15b)]===_0x24e6b8(0x171))return console[_0x24e6b8(0x15e)](a42_0x881e7d[_0x24e6b8(0x172)](_0x24e6b8(0x179))),console['error'](_0x24e6b8(0x177)),console[_0x24e6b8(0x15e)](a42_0x881e7d[_0x24e6b8(0x15f)](_0x24e6b8(0x168)+_0x55e5ed[_0x24e6b8(0x15d)]+(_0x55e5ed[_0x24e6b8(0x156)]?'/'+_0x55e5ed['folderPath'][_0x24e6b8(0x175)]('/'):''))),0x1;return saveSessionContext({'segment_path':_0x55e5ed[_0x24e6b8(0x162)],'parent_segment':_0x55e5ed[_0x24e6b8(0x15d)]},_0x4572ab),console[_0x24e6b8(0x165)](a42_0x881e7d[_0x24e6b8(0x17b)](_0x24e6b8(0x150)+a42_0x881e7d['cyan'](_0x55e5ed['fullPath']))),_0x4b2c68['verbose']&&(console[_0x24e6b8(0x15e)](a42_0x881e7d[_0x24e6b8(0x15a)]('Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context')),console['error'](a42_0x881e7d[_0x24e6b8(0x15a)](_0x24e6b8(0x15c)))),0x0;}catch(_0x461202){throw _0x461202;}}}
@@ -1 +1 @@
1
- const a43_0xf43d81=a43_0xdbf6;(function(_0x12c131,_0x4df28d){const _0x392852=a43_0xdbf6,_0x5c7a35=_0x12c131();while(!![]){try{const _0x24ba10=parseInt(_0x392852(0xc3))/0x1+parseInt(_0x392852(0xd4))/0x2*(-parseInt(_0x392852(0xc6))/0x3)+-parseInt(_0x392852(0xe1))/0x4*(-parseInt(_0x392852(0xdd))/0x5)+parseInt(_0x392852(0xbd))/0x6+parseInt(_0x392852(0xcc))/0x7*(-parseInt(_0x392852(0xba))/0x8)+parseInt(_0x392852(0xcb))/0x9*(parseInt(_0x392852(0xd8))/0xa)+-parseInt(_0x392852(0xe0))/0xb;if(_0x24ba10===_0x4df28d)break;else _0x5c7a35['push'](_0x5c7a35['shift']());}catch(_0x1da512){_0x5c7a35['push'](_0x5c7a35['shift']());}}}(a43_0x5b91,0x3c865));import{BaseCommand}from'./command.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';function a43_0x5b91(){const _0x210a2f=['warningCount','endsWith','\x20warning(s)\x20found','5142qYrHsb','validCount','log','red','21670XPnzqi','warnings','green','\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','\x20file(s)\x20with\x20errors,\x20','1704155bZWHZd','message','name','1012957VmffJE','4GrouAx','.yml','filePath','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','Error:\x20','error','\x20warning(s)','1240arGXCt','dim','yellow','935574GZIGRs','targetDir','):\x20','segment:validate','execute','verbose','210553pvbKup','file','invalidCount','123vTZNng','valid','helpText','\x20valid','description','333nSmuez','15449ubVnWC','Validate\x20segment\x20and\x20journey\x20YAML\x20files','no_parent','length','hasErrors'];a43_0x5b91=function(){return _0x210a2f;};return a43_0x5b91();}import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';import a43_0x108e2c from'chalk';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';function a43_0xdbf6(_0x308879,_0x1a709a){_0x308879=_0x308879-0xba;const _0x5b91c3=a43_0x5b91();let _0xdbf64a=_0x5b91c3[_0x308879];return _0xdbf64a;}export class SegmentValidateCommand extends BaseCommand{[a43_0xf43d81(0xdf)]=a43_0xf43d81(0xc0);[a43_0xf43d81(0xca)]=a43_0xf43d81(0xcd);async[a43_0xf43d81(0xc1)](_0x7a5a32){const _0x1cedd2=a43_0xf43d81,{options:_0x417142,args:_0x50283d}=_0x7a5a32,_0x1f302e=_0x417142,_0x46cde0=await resolveTarget({'arg':_0x50283d[0x0],'contextParent':_0x417142['parentSegment'],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x46cde0))return _0x46cde0['errorCode']===_0x1cedd2(0xce)?(console[_0x1cedd2(0xe6)](a43_0x108e2c['yellow']('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console[_0x1cedd2(0xe6)]('Usage:\x20tdx\x20sg\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)'),console['error'](_0x1cedd2(0xdb)),console[_0x1cedd2(0xe6)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file')):(console[_0x1cedd2(0xe6)](a43_0x108e2c[_0x1cedd2(0xd7)](_0x1cedd2(0xe5)+_0x46cde0[_0x1cedd2(0xde)]+'\x0a')),_0x46cde0[_0x1cedd2(0xc8)]&&console[_0x1cedd2(0xe6)](a43_0x108e2c['cyan'](_0x46cde0[_0x1cedd2(0xc8)]))),0x1;const _0x40de88=_0x46cde0[_0x1cedd2(0xbe)],_0x48465d=_0x46cde0['type']===_0x1cedd2(0xc4)?_0x46cde0[_0x1cedd2(0xe3)]:undefined;if(!_0x48465d&&!existsSync(_0x40de88))return console['error'](a43_0x108e2c[_0x1cedd2(0xd7)]('Error:\x20Directory\x20not\x20found:\x20'+_0x40de88+'\x0a')),0x1;let _0xef8d08;if(_0x48465d){if(!_0x48465d[_0x1cedd2(0xd2)](_0x1cedd2(0xe2))&&!_0x48465d[_0x1cedd2(0xd2)]('.yaml'))return console[_0x1cedd2(0xe6)](a43_0x108e2c[_0x1cedd2(0xd7)]('Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20'+_0x48465d+'\x0a')),0x1;_0xef8d08=[_0x48465d];}else _0xef8d08=findYamlFiles(_0x40de88);if(_0xef8d08[_0x1cedd2(0xcf)]===0x0)return console[_0x1cedd2(0xe6)](a43_0x108e2c['red'](_0x1cedd2(0xe4)+_0x40de88+'\x0a')),0x1;const _0x45d31f=validateYamlFiles(_0xef8d08,_0x40de88),_0x222f38=calculateSummary(_0x45d31f);for(const _0x5b5d61 of _0x45d31f){if(!isValidationResult(_0x5b5d61))continue;const {relativePath:_0x9fe6da,source:_0x45ac19,result:_0x4f86ff,fileType:_0x1f68c9}=_0x5b5d61,_0x1a38eb=_0x1f68c9;if(_0x4f86ff[_0x1cedd2(0xc7)]&&_0x4f86ff[_0x1cedd2(0xd9)][_0x1cedd2(0xcf)]===0x0)_0x1f302e[_0x1cedd2(0xc2)]&&console['log'](a43_0x108e2c[_0x1cedd2(0xda)]('✔\x20'+_0x9fe6da)+a43_0x108e2c[_0x1cedd2(0xbb)]('\x20('+_0x1a38eb+')'));else _0x4f86ff['valid']?(console[_0x1cedd2(0xd6)](a43_0x108e2c['yellow']('⚠\x20'+_0x9fe6da)+a43_0x108e2c[_0x1cedd2(0xbb)]('\x20('+_0x1a38eb+'):\x20'+_0x4f86ff[_0x1cedd2(0xd9)][_0x1cedd2(0xcf)]+_0x1cedd2(0xe7))),console[_0x1cedd2(0xd6)](formatValidationResult(_0x4f86ff,_0x45ac19,_0x9fe6da))):(console[_0x1cedd2(0xd6)](a43_0x108e2c[_0x1cedd2(0xd7)]('✖\x20'+_0x9fe6da)+a43_0x108e2c[_0x1cedd2(0xbb)]('\x20('+_0x1a38eb+_0x1cedd2(0xbf)+_0x4f86ff['errors'][_0x1cedd2(0xcf)]+'\x20error(s)')),console['log'](formatValidationResult(_0x4f86ff,_0x45ac19,_0x9fe6da)));}return console[_0x1cedd2(0xd6)](''),_0x222f38[_0x1cedd2(0xd0)]?(console['log'](a43_0x108e2c[_0x1cedd2(0xd7)]('Validation\x20failed:\x20'+_0x222f38[_0x1cedd2(0xc5)]+_0x1cedd2(0xdc)+_0x222f38['validCount']+_0x1cedd2(0xc9))),_0x222f38['warningCount']>0x0&&console[_0x1cedd2(0xd6)](a43_0x108e2c[_0x1cedd2(0xbc)](_0x222f38['warningCount']+'\x20warning(s)\x20found')),0x1):(console[_0x1cedd2(0xd6)](a43_0x108e2c['green']('✔\x20All\x20'+_0x222f38[_0x1cedd2(0xd5)]+'\x20file(s)\x20valid')),_0x222f38[_0x1cedd2(0xd1)]>0x0&&console[_0x1cedd2(0xd6)](a43_0x108e2c[_0x1cedd2(0xbc)](_0x222f38[_0x1cedd2(0xd1)]+_0x1cedd2(0xd3))),0x0);}}
1
+ const a43_0x10ec86=a43_0x44d3;(function(_0x416a28,_0xa23baa){const _0x3e96ff=a43_0x44d3,_0xa3806e=_0x416a28();while(!![]){try{const _0xf8349d=-parseInt(_0x3e96ff(0x173))/0x1*(parseInt(_0x3e96ff(0x18d))/0x2)+parseInt(_0x3e96ff(0x171))/0x3+-parseInt(_0x3e96ff(0x18b))/0x4*(parseInt(_0x3e96ff(0x166))/0x5)+-parseInt(_0x3e96ff(0x18a))/0x6+parseInt(_0x3e96ff(0x189))/0x7+-parseInt(_0x3e96ff(0x17b))/0x8*(-parseInt(_0x3e96ff(0x185))/0x9)+-parseInt(_0x3e96ff(0x193))/0xa;if(_0xf8349d===_0xa23baa)break;else _0xa3806e['push'](_0xa3806e['shift']());}catch(_0x9cc98d){_0xa3806e['push'](_0xa3806e['shift']());}}}(a43_0x4ebd,0x6e830));import{BaseCommand}from'./command.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';function a43_0x4ebd(){const _0x34fec3=['171wVLLnA','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','segment:validate','red','3215373bgZjXc','2867754DPgmYx','26744ikEGfC','errorCode','187758pGomeA','type','warningCount','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','filePath','endsWith','1204000cjqaai','\x20file(s)\x20valid','✔\x20All\x20','no_parent','.yml','Validate\x20segment\x20and\x20journey\x20YAML\x20files','395qxvVID','.yaml','errors','validCount','hasErrors','):\x20','message','execute','green','log','\x20warning(s)\x20found','1198056ABWqgr','verbose','1jPaVmr','helpText','cyan','file','valid','\x20error(s)','yellow','name','342904wjOwXc','\x20warning(s)','length','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file','error','\x20valid','dim','\x20file(s)\x20with\x20errors,\x20','targetDir','warnings'];a43_0x4ebd=function(){return _0x34fec3;};return a43_0x4ebd();}function a43_0x44d3(_0x218746,_0x3d0da6){_0x218746=_0x218746-0x161;const _0x4ebd65=a43_0x4ebd();let _0x44d39c=_0x4ebd65[_0x218746];return _0x44d39c;}import a43_0x316761 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{[a43_0x10ec86(0x17a)]=a43_0x10ec86(0x187);['description']=a43_0x10ec86(0x165);async[a43_0x10ec86(0x16d)](_0x4a3810){const _0x2172c5=a43_0x10ec86,{options:_0x503047,args:_0x3123cd}=_0x4a3810,_0x485046=_0x503047,_0x25edfd=await resolveTarget({'arg':_0x3123cd[0x0],'contextParent':_0x503047['parentSegment'],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x25edfd))return _0x25edfd[_0x2172c5(0x18c)]===_0x2172c5(0x163)?(console[_0x2172c5(0x17f)](a43_0x316761['yellow']('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console[_0x2172c5(0x17f)]('Usage:\x20tdx\x20sg\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)'),console[_0x2172c5(0x17f)]('\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[_0x2172c5(0x17f)](_0x2172c5(0x17e))):(console[_0x2172c5(0x17f)](a43_0x316761[_0x2172c5(0x188)]('Error:\x20'+_0x25edfd[_0x2172c5(0x16c)]+'\x0a')),_0x25edfd[_0x2172c5(0x174)]&&console[_0x2172c5(0x17f)](a43_0x316761[_0x2172c5(0x175)](_0x25edfd[_0x2172c5(0x174)]))),0x1;const _0x1621ef=_0x25edfd[_0x2172c5(0x183)],_0x399ae8=_0x25edfd[_0x2172c5(0x18e)]===_0x2172c5(0x176)?_0x25edfd[_0x2172c5(0x191)]:undefined;if(!_0x399ae8&&!existsSync(_0x1621ef))return console[_0x2172c5(0x17f)](a43_0x316761[_0x2172c5(0x188)]('Error:\x20Directory\x20not\x20found:\x20'+_0x1621ef+'\x0a')),0x1;let _0x1398d7;if(_0x399ae8){if(!_0x399ae8[_0x2172c5(0x192)](_0x2172c5(0x164))&&!_0x399ae8[_0x2172c5(0x192)](_0x2172c5(0x167)))return console['error'](a43_0x316761['red'](_0x2172c5(0x190)+_0x399ae8+'\x0a')),0x1;_0x1398d7=[_0x399ae8];}else _0x1398d7=findYamlFiles(_0x1621ef);if(_0x1398d7['length']===0x0)return console[_0x2172c5(0x17f)](a43_0x316761[_0x2172c5(0x188)](_0x2172c5(0x186)+_0x1621ef+'\x0a')),0x1;const _0x5aa246=validateYamlFiles(_0x1398d7,_0x1621ef),_0x47bf22=calculateSummary(_0x5aa246);for(const _0x5f1366 of _0x5aa246){if(!isValidationResult(_0x5f1366))continue;const {relativePath:_0x8df668,source:_0x48b46c,result:_0x3afdb4,fileType:_0x10c6e0}=_0x5f1366,_0x3fa1f5=_0x10c6e0;if(_0x3afdb4[_0x2172c5(0x177)]&&_0x3afdb4[_0x2172c5(0x184)][_0x2172c5(0x17d)]===0x0)_0x485046[_0x2172c5(0x172)]&&console[_0x2172c5(0x16f)](a43_0x316761[_0x2172c5(0x16e)]('✔\x20'+_0x8df668)+a43_0x316761[_0x2172c5(0x181)]('\x20('+_0x3fa1f5+')'));else _0x3afdb4[_0x2172c5(0x177)]?(console[_0x2172c5(0x16f)](a43_0x316761[_0x2172c5(0x179)]('⚠\x20'+_0x8df668)+a43_0x316761['dim']('\x20('+_0x3fa1f5+'):\x20'+_0x3afdb4['warnings'][_0x2172c5(0x17d)]+_0x2172c5(0x17c))),console[_0x2172c5(0x16f)](formatValidationResult(_0x3afdb4,_0x48b46c,_0x8df668))):(console['log'](a43_0x316761['red']('✖\x20'+_0x8df668)+a43_0x316761[_0x2172c5(0x181)]('\x20('+_0x3fa1f5+_0x2172c5(0x16b)+_0x3afdb4[_0x2172c5(0x168)][_0x2172c5(0x17d)]+_0x2172c5(0x178))),console[_0x2172c5(0x16f)](formatValidationResult(_0x3afdb4,_0x48b46c,_0x8df668)));}return console[_0x2172c5(0x16f)](''),_0x47bf22[_0x2172c5(0x16a)]?(console['log'](a43_0x316761['red']('Validation\x20failed:\x20'+_0x47bf22['invalidCount']+_0x2172c5(0x182)+_0x47bf22['validCount']+_0x2172c5(0x180))),_0x47bf22[_0x2172c5(0x18f)]>0x0&&console[_0x2172c5(0x16f)](a43_0x316761[_0x2172c5(0x179)](_0x47bf22[_0x2172c5(0x18f)]+'\x20warning(s)\x20found')),0x1):(console[_0x2172c5(0x16f)](a43_0x316761[_0x2172c5(0x16e)](_0x2172c5(0x162)+_0x47bf22[_0x2172c5(0x169)]+_0x2172c5(0x161))),_0x47bf22[_0x2172c5(0x18f)]>0x0&&console[_0x2172c5(0x16f)](a43_0x316761[_0x2172c5(0x179)](_0x47bf22[_0x2172c5(0x18f)]+_0x2172c5(0x170))),0x0);}}
@@ -1 +1 @@
1
- function a44_0x3292(){const _0x28271f=['/e/','92olDVHo','listRecursive','\x5c$&','List\x20folders\x20and\x20child\x20segments','Folder\x20ID:\x20','name','\x27...','length','replace','5071392zkHYQb','96OtpptY','filter','Parent\x20segment\x20context:\x20','Parent\x20ID:\x20','log','test','journeys','✔\x20Built\x20tree\x20with\x20','\x20segment','\x20\x20tdx\x20sg\x20pull\x20\x22My\x20Audience\x22','localeCompare','Resolving\x20parent\x20segment\x20\x27','14199rfiGgN','No\x20items\x20match\x20pattern:\x20','17085695EdNJuv','folderId','verbose',']\x20matching\x20\x27','Building\x20hierarchy\x20tree...','Recursive\x20mode:\x20enabled','listUnified','86832RjlGGa','format','17460hZJCWi','\x20\x20Cause:\x20','jsonl','\x20matching\x20\x27','Resolving\x20path\x20\x27','\x20\x20tdx\x20sg\x20use\x20\x22My\x20Audience\x22','\x20journey','Folder/pattern\x20arg:\x20','includes','1746fkmTrk','(not\x20set)','/j/da','segments','/app/ps/','Listing\x20folders,\x20segments,\x20and\x20journeys...','\x20folder','site','parentId','execute','listWithPattern','folder','type','journey','sort','children','88vPWYoN','error','Use\x20tdx\x20ps\x20list\x20to\x20see\x20available\x20parent\x20segments.','Set\x20a\x20parent\x20segment\x20context\x20first:','folders','json','Error:\x20No\x20parent\x20segment\x20context\x20set.','map','journeyBundleName','651745mprIHL','260316SEWLFU','cause','recursive','resolvePathToResource','segment','data','dim'];a44_0x3292=function(){return _0x28271f;};return a44_0x3292();}const a44_0x3f2396=a44_0x4041;(function(_0x5a0c63,_0x17aaeb){const _0x9828dc=a44_0x4041,_0x1ccee9=_0x5a0c63();while(!![]){try{const _0x6daad0=parseInt(_0x9828dc(0x17e))/0x1*(-parseInt(_0x9828dc(0x168))/0x2)+parseInt(_0x9828dc(0x187))/0x3*(-parseInt(_0x9828dc(0x1a2))/0x4)+-parseInt(_0x9828dc(0x1ab))/0x5+-parseInt(_0x9828dc(0x172))/0x6*(-parseInt(_0x9828dc(0x1ac))/0x7)+-parseInt(_0x9828dc(0x171))/0x8+-parseInt(_0x9828dc(0x192))/0x9*(-parseInt(_0x9828dc(0x189))/0xa)+parseInt(_0x9828dc(0x180))/0xb;if(_0x6daad0===_0x17aaeb)break;else _0x1ccee9['push'](_0x1ccee9['shift']());}catch(_0x1114d1){_0x1ccee9['push'](_0x1ccee9['shift']());}}}(a44_0x3292,0x69a8e));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';function a44_0x4041(_0x556faf,_0x12f569){_0x556faf=_0x556faf-0x168;const _0x32923c=a44_0x3292();let _0x4041f4=_0x32923c[_0x556faf];return _0x4041f4;}import{formatFlatList,formatTree}from'../sdk/util/tree-formatter.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import a44_0x3c23d3 from'chalk';export class SegmentsCommand extends BaseCommand{[a44_0x3f2396(0x16d)]=a44_0x3f2396(0x195);['description']=a44_0x3f2396(0x16b);async[a44_0x3f2396(0x19b)](_0x5cd846){const _0x3b3585=a44_0x3f2396,{options:_0x26e8c7,args:_0x300643}=_0x5cd846,_0x490432=_0x26e8c7[_0x3b3585(0x1ae)],_0x3f7617=_0x300643[0x0];try{const _0xaf745f=_0x26e8c7['parentSegment'];_0x26e8c7[_0x3b3585(0x182)]&&(console[_0x3b3585(0x1a3)]('Site:\x20'+_0x26e8c7[_0x3b3585(0x199)]),console[_0x3b3585(0x1a3)](_0x3b3585(0x174)+(_0xaf745f||_0x3b3585(0x193))),_0x3f7617&&console[_0x3b3585(0x1a3)](_0x3b3585(0x190)+_0x3f7617),_0x490432&&console[_0x3b3585(0x1a3)](_0x3b3585(0x185)));if(!_0xaf745f)return console[_0x3b3585(0x1a3)](_0x3b3585(0x1a8)),console['error'](''),console[_0x3b3585(0x1a3)](_0x3b3585(0x1a5)),console[_0x3b3585(0x1a3)](_0x3b3585(0x17b)),console[_0x3b3585(0x1a3)](_0x3b3585(0x18e)),console[_0x3b3585(0x1a3)](''),console['error'](_0x3b3585(0x1a4)),0x1;const _0x2acd99=_0x3f7617&&(_0x3f7617[_0x3b3585(0x191)]('*')||_0x3f7617['includes']('?'));if(_0x2acd99)return await this['listWithPattern'](_0x5cd846,_0xaf745f,_0x3f7617);const _0x2d01e5=_0x3f7617?_0xaf745f+'/'+_0x3f7617:_0xaf745f;return _0x490432?await this['listRecursive'](_0x5cd846,_0x2d01e5):await this[_0x3b3585(0x186)](_0x5cd846,_0x2d01e5);}catch(_0x1511e9){if(_0x1511e9 instanceof SDKError)return console[_0x3b3585(0x1a3)]('Error:\x20'+_0x1511e9['message']),_0x1511e9[_0x3b3585(0x1ad)]&&console[_0x3b3585(0x1a3)](_0x3b3585(0x18a)+_0x1511e9['cause']),0x1;throw _0x1511e9;}}async[a44_0x3f2396(0x19c)](_0x5ae6be,_0x625d49,_0x285489){const _0x492125=a44_0x3f2396,{options:_0x325df3,tdx:_0x2a4b0e}=_0x5ae6be,_0x418328=await withSpinner(_0x492125(0x17d)+_0x625d49+'\x27...',()=>_0x2a4b0e[_0x492125(0x1b0)][_0x492125(0x1af)](_0x625d49),{'verbose':_0x325df3[_0x492125(0x182)]}),_0x368a47=_0x418328['data'],_0x98bae1=await withSpinner(_0x492125(0x197),()=>_0x2a4b0e[_0x492125(0x1b0)]['listUnifiedWithJourneys'](_0x368a47[_0x492125(0x19a)],_0x368a47[_0x492125(0x181)]),{'verbose':_0x325df3[_0x492125(0x182)]}),{folders:_0x47edd0,segments:_0x1a0118,journeys:_0xa2a398}=_0x98bae1[_0x492125(0x1b1)],_0x5c2286=_0x285489['replace'](/[.+^${}()|[\]\\]/g,_0x492125(0x16a))[_0x492125(0x170)](/\*/g,'.*')[_0x492125(0x170)](/\?/g,'.'),_0x3b1823=new RegExp('^'+_0x5c2286+'$','i'),_0x451062=_0x47edd0[_0x492125(0x173)](_0x264f77=>_0x3b1823[_0x492125(0x177)](_0x264f77[_0x492125(0x16d)])),_0x4f909f=_0x1a0118[_0x492125(0x173)](_0x1bbcde=>_0x3b1823[_0x492125(0x177)](_0x1bbcde[_0x492125(0x16d)])),_0x4fe20f=_0xa2a398[_0x492125(0x173)](_0x12d07c=>_0x3b1823[_0x492125(0x177)](_0x12d07c[_0x492125(0x1aa)])),_0x4d14f6=_0x451062[_0x492125(0x16f)]+_0x4f909f[_0x492125(0x16f)]+_0x4fe20f[_0x492125(0x16f)];console[_0x492125(0x1a3)]('✔\x20Found\x20'+_0x451062['length']+_0x492125(0x198)+(_0x451062[_0x492125(0x16f)]!==0x1?'s':'')+',\x20'+_0x4f909f['length']+_0x492125(0x17a)+(_0x4f909f['length']!==0x1?'s':'')+',\x20and\x20'+_0x4fe20f['length']+'\x20journey'+(_0x4fe20f['length']!==0x1?'s':'')+_0x492125(0x18c)+_0x285489+'\x27');const _0x594183=_0x4f0eb1=>{const _0x53bbce=_0x492125;return getConsoleNextUrl(_0x325df3[_0x53bbce(0x199)],_0x53bbce(0x196)+_0x368a47[_0x53bbce(0x19a)]+_0x53bbce(0x1b3)+_0x4f0eb1);},_0x2b5669=_0x325df3[_0x492125(0x188)]==='json'||_0x325df3['format']==='jsonl';if(_0x2b5669){const _0x193628=[..._0x451062[_0x492125(0x1a9)](_0xb45c35=>({..._0xb45c35,'type':_0x492125(0x19d)})),..._0x4f909f[_0x492125(0x1a9)](_0x3fea93=>({..._0x3fea93,'type':_0x492125(0x1b0),'url':_0x594183(_0x3fea93['id'])})),..._0x4fe20f[_0x492125(0x1a9)](_0x26fb24=>({..._0x26fb24,'name':_0x26fb24[_0x492125(0x1aa)],'type':_0x492125(0x19f)}))][_0x492125(0x1a0)]((_0x1a465a,_0x2d174b)=>_0x1a465a[_0x492125(0x16d)][_0x492125(0x17c)](_0x2d174b[_0x492125(0x16d)]));await handleSDKOutput(_0x193628,_0x325df3);}else{if(_0x4d14f6===0x0)console[_0x492125(0x176)](_0x492125(0x17f)+_0x285489);else{console['log'](a44_0x3c23d3[_0x492125(0x1b2)]('['+_0x625d49+_0x492125(0x183)+_0x285489+'\x27'));const _0x18cc0f=formatFlatList(_0x451062,_0x4f909f,{'showMetadata':!![],'getSegmentUrl':_0x594183},_0x4fe20f);console[_0x492125(0x176)](_0x18cc0f);}}return 0x0;}async['listUnified'](_0x18b332,_0x37ffb8){const _0x206060=a44_0x3f2396,{options:_0x5997c2,tdx:_0x37af3e}=_0x18b332,_0x54f1bf=await withSpinner('Resolving\x20path\x20\x27'+_0x37ffb8+_0x206060(0x16e),()=>_0x37af3e[_0x206060(0x1b0)][_0x206060(0x1af)](_0x37ffb8),{'verbose':_0x5997c2[_0x206060(0x182)]}),_0x31147f=_0x54f1bf[_0x206060(0x1b1)];_0x5997c2[_0x206060(0x182)]&&(console[_0x206060(0x1a3)](_0x206060(0x175)+_0x31147f[_0x206060(0x19a)]),_0x31147f['folderId']&&console[_0x206060(0x1a3)](_0x206060(0x16c)+_0x31147f[_0x206060(0x181)]));const _0x388047=await withSpinner('Listing\x20folders,\x20segments,\x20and\x20journeys...',()=>_0x37af3e['segment']['listUnifiedWithJourneys'](_0x31147f['parentId'],_0x31147f['folderId']),{'verbose':_0x5997c2[_0x206060(0x182)]}),{folders:_0x1cdbf2,segments:_0x424c3a,journeys:_0x3d63dd}=_0x388047[_0x206060(0x1b1)],_0x5be2c1=_0x1cdbf2['length']+_0x424c3a[_0x206060(0x16f)]+_0x3d63dd[_0x206060(0x16f)];console['error']('✔\x20Found\x20'+_0x1cdbf2[_0x206060(0x16f)]+_0x206060(0x198)+(_0x1cdbf2[_0x206060(0x16f)]!==0x1?'s':'')+',\x20'+_0x424c3a[_0x206060(0x16f)]+_0x206060(0x17a)+(_0x424c3a[_0x206060(0x16f)]!==0x1?'s':'')+',\x20and\x20'+_0x3d63dd['length']+_0x206060(0x18f)+(_0x3d63dd[_0x206060(0x16f)]!==0x1?'s':''));const _0x2940af=_0x44adfc=>{const _0x4ebbf7=_0x206060;return getConsoleNextUrl(_0x5997c2[_0x4ebbf7(0x199)],_0x4ebbf7(0x196)+_0x31147f['parentId']+'/e/'+_0x44adfc);},_0x1537a8=_0x3c8c5a=>{const _0x4cab3a=_0x206060;return getConsoleNextUrl(_0x5997c2[_0x4cab3a(0x199)],'/app/ps/'+_0x31147f[_0x4cab3a(0x19a)]+'/e/'+_0x3c8c5a+_0x4cab3a(0x194));},_0x230037=_0x5997c2[_0x206060(0x188)]==='json'||_0x5997c2[_0x206060(0x188)]===_0x206060(0x18b);if(_0x230037){const _0x3f3e64=[..._0x1cdbf2[_0x206060(0x1a9)](_0x45aa4f=>({..._0x45aa4f,'type':_0x206060(0x19d)})),..._0x424c3a[_0x206060(0x1a9)](_0x45f873=>({..._0x45f873,'type':'segment','url':_0x2940af(_0x45f873['id'])})),..._0x3d63dd[_0x206060(0x1a9)](_0x1e5d4c=>({..._0x1e5d4c,'name':_0x1e5d4c['journeyBundleName'],'type':_0x206060(0x19f),'url':_0x1537a8(_0x1e5d4c['id'])}))]['sort']((_0x364c3b,_0x566013)=>_0x364c3b[_0x206060(0x16d)][_0x206060(0x17c)](_0x566013[_0x206060(0x16d)]));await handleSDKOutput(_0x3f3e64,_0x5997c2);}else{if(_0x5be2c1===0x0)console[_0x206060(0x176)](a44_0x3c23d3[_0x206060(0x1b2)]('['+_0x37ffb8+']')),console[_0x206060(0x176)]('(empty)');else{console[_0x206060(0x176)](a44_0x3c23d3[_0x206060(0x1b2)]('['+_0x37ffb8+']'));const _0x1294ea=formatFlatList(_0x1cdbf2,_0x424c3a,{'showMetadata':!![],'getSegmentUrl':_0x2940af,'getJourneyUrl':_0x1537a8},_0x3d63dd);console[_0x206060(0x176)](_0x1294ea);}}return 0x0;}async[a44_0x3f2396(0x169)](_0x4e6c0b,_0x1f975b){const _0x3ffb12=a44_0x3f2396,{options:_0x5955a0,tdx:_0x1cad92}=_0x4e6c0b,_0x3ad697=await withSpinner(_0x3ffb12(0x18d)+_0x1f975b+_0x3ffb12(0x16e),()=>_0x1cad92[_0x3ffb12(0x1b0)][_0x3ffb12(0x1af)](_0x1f975b),{'verbose':_0x5955a0[_0x3ffb12(0x182)]}),_0x1f8833=_0x3ad697[_0x3ffb12(0x1b1)];_0x5955a0[_0x3ffb12(0x182)]&&(console[_0x3ffb12(0x1a3)]('Parent\x20ID:\x20'+_0x1f8833[_0x3ffb12(0x19a)]),_0x1f8833[_0x3ffb12(0x181)]&&console[_0x3ffb12(0x1a3)](_0x3ffb12(0x16c)+_0x1f8833['folderId']));const _0x52feed=_0x5955a0['maxDepth']||0xa,_0xb8d07c=await withSpinner(_0x3ffb12(0x184),()=>_0x1cad92['segment'][_0x3ffb12(0x169)](_0x1f8833[_0x3ffb12(0x19a)],_0x1f8833[_0x3ffb12(0x181)],0x0,_0x52feed),{'verbose':_0x5955a0[_0x3ffb12(0x182)]}),_0x301a8b=_0xb8d07c[_0x3ffb12(0x1b1)],_0x3b5399=_0x1d7a9c=>{const _0x14db62=_0x3ffb12;let _0x4995ed=0x0,_0x1d08d1=0x0,_0x1beb98=0x0;for(const _0x36068d of _0x1d7a9c){if(_0x36068d['type']==='folder')_0x4995ed++;else{if(_0x36068d[_0x14db62(0x19e)]==='segment')_0x1d08d1++;else{if(_0x36068d['type']===_0x14db62(0x19f))_0x1beb98++;}}if(_0x36068d[_0x14db62(0x1a1)]){const _0x3569c4=_0x3b5399(_0x36068d['children']);_0x4995ed+=_0x3569c4['folders'],_0x1d08d1+=_0x3569c4['segments'],_0x1beb98+=_0x3569c4[_0x14db62(0x178)];}}return{'folders':_0x4995ed,'segments':_0x1d08d1,'journeys':_0x1beb98};},_0x1b4be1=_0x3b5399(_0x301a8b);console[_0x3ffb12(0x1a3)](_0x3ffb12(0x179)+_0x1b4be1[_0x3ffb12(0x1a6)]+_0x3ffb12(0x198)+(_0x1b4be1[_0x3ffb12(0x1a6)]!==0x1?'s':'')+',\x20'+_0x1b4be1[_0x3ffb12(0x195)]+_0x3ffb12(0x17a)+(_0x1b4be1[_0x3ffb12(0x195)]!==0x1?'s':'')+',\x20and\x20'+_0x1b4be1[_0x3ffb12(0x178)]+_0x3ffb12(0x18f)+(_0x1b4be1[_0x3ffb12(0x178)]!==0x1?'s':''));const _0x293303=_0x4baa3=>{const _0x3ec6ec=_0x3ffb12;return getConsoleNextUrl(_0x5955a0['site'],_0x3ec6ec(0x196)+_0x1f8833['parentId']+_0x3ec6ec(0x1b3)+_0x4baa3);},_0x2d0be7=_0x5cb9d8=>{const _0x4b85fb=_0x3ffb12;return getConsoleNextUrl(_0x5955a0[_0x4b85fb(0x199)],_0x4b85fb(0x196)+_0x1f8833[_0x4b85fb(0x19a)]+'/e/'+_0x5cb9d8+'/j/da');};if(_0x5955a0[_0x3ffb12(0x188)]===_0x3ffb12(0x1a7)||_0x5955a0[_0x3ffb12(0x188)]==='jsonl')await handleSDKOutput(_0x301a8b,_0x5955a0);else{console[_0x3ffb12(0x176)](a44_0x3c23d3[_0x3ffb12(0x1b2)]('['+_0x1f975b+']'));const _0x26ea9d=formatTree(_0x301a8b,{'showMetadata':!![],'getSegmentUrl':_0x293303,'getJourneyUrl':_0x2d0be7});console[_0x3ffb12(0x176)](_0x26ea9d);}return 0x0;}}
1
+ function a44_0x3027(_0x3d0084,_0x1e9bde){_0x3d0084=_0x3d0084-0xc1;const _0x592dc7=a44_0x592d();let _0x3027b8=_0x592dc7[_0x3d0084];return _0x3027b8;}const a44_0x74999a=a44_0x3027;(function(_0x47186f,_0x49960b){const _0x52f934=a44_0x3027,_0x2659c9=_0x47186f();while(!![]){try{const _0x28a1aa=-parseInt(_0x52f934(0xde))/0x1+-parseInt(_0x52f934(0xfc))/0x2*(parseInt(_0x52f934(0xe2))/0x3)+parseInt(_0x52f934(0xeb))/0x4*(-parseInt(_0x52f934(0xcf))/0x5)+parseInt(_0x52f934(0xd4))/0x6*(-parseInt(_0x52f934(0xd2))/0x7)+parseInt(_0x52f934(0xf0))/0x8*(-parseInt(_0x52f934(0xc1))/0x9)+parseInt(_0x52f934(0xf7))/0xa*(-parseInt(_0x52f934(0xdd))/0xb)+parseInt(_0x52f934(0xd8))/0xc;if(_0x28a1aa===_0x49960b)break;else _0x2659c9['push'](_0x2659c9['shift']());}catch(_0x5cd516){_0x2659c9['push'](_0x2659c9['shift']());}}}(a44_0x592d,0x38a32));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{formatFlatList,formatTree}from'../sdk/util/tree-formatter.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';function a44_0x592d(){const _0x3a49ec=['error','/j/da','folders','\x20journey','resolvePathToResource','map','List\x20folders\x20and\x20child\x20segments','verbose','Folder/pattern\x20arg:\x20','journey','Error:\x20No\x20parent\x20segment\x20context\x20set.','9IaFIgA','log','site','\x20\x20Cause:\x20','includes','Parent\x20segment\x20context:\x20','description','Error:\x20','✔\x20Found\x20','listUnifiedWithJourneys','(empty)','data','parentId','test','5JGxjDZ','journeyBundleName','sort','868798dICfyg','Listing\x20folders,\x20segments,\x20and\x20journeys...','18EYyAUf','dim','Set\x20a\x20parent\x20segment\x20context\x20first:','No\x20items\x20match\x20pattern:\x20','19056900imhSew','listUnified','/app/ps/','/e/','\x20segment','2358730VilvGj','32067fguDfy','json','\x20folder','Resolving\x20parent\x20segment\x20\x27','153nlUeYK','\x5c$&','\x27...','folder','Folder\x20ID:\x20','✔\x20Built\x20tree\x20with\x20','message','\x20\x20tdx\x20sg\x20pull\x20\x22My\x20Audience\x22','parentSegment','587448fdszwz','filter','length','children','Recursive\x20mode:\x20enabled','1408920HuFjKg','Use\x20tdx\x20ps\x20list\x20to\x20see\x20available\x20parent\x20segments.','replace','recursive','cause','Resolving\x20path\x20\x27','format','10UaYWHO','(not\x20set)','maxDepth','segment','localeCompare','16246pZaWte','Parent\x20ID:\x20','Site:\x20','journeys','listWithPattern','\x20\x20tdx\x20sg\x20use\x20\x22My\x20Audience\x22',',\x20and\x20','listRecursive',']\x20matching\x20\x27','Building\x20hierarchy\x20tree...','type','name','folderId','segments','jsonl'];a44_0x592d=function(){return _0x3a49ec;};return a44_0x592d();}import a44_0x301b82 from'chalk';export class SegmentsCommand extends BaseCommand{['name']=a44_0x74999a(0x109);[a44_0x74999a(0xc7)]=a44_0x74999a(0x111);async['execute'](_0x1a2b24){const _0x22e8ff=a44_0x74999a,{options:_0x29d96d,args:_0x2b7a91}=_0x1a2b24,_0x423b9d=_0x29d96d[_0x22e8ff(0xf3)],_0x225af6=_0x2b7a91[0x0];try{const _0x9fb59f=_0x29d96d[_0x22e8ff(0xea)];_0x29d96d[_0x22e8ff(0x112)]&&(console[_0x22e8ff(0x10b)](_0x22e8ff(0xfe)+_0x29d96d[_0x22e8ff(0xc3)]),console[_0x22e8ff(0x10b)](_0x22e8ff(0xc6)+(_0x9fb59f||_0x22e8ff(0xf8))),_0x225af6&&console[_0x22e8ff(0x10b)](_0x22e8ff(0x113)+_0x225af6),_0x423b9d&&console[_0x22e8ff(0x10b)](_0x22e8ff(0xef)));if(!_0x9fb59f)return console[_0x22e8ff(0x10b)](_0x22e8ff(0x115)),console[_0x22e8ff(0x10b)](''),console[_0x22e8ff(0x10b)](_0x22e8ff(0xd6)),console['error'](_0x22e8ff(0xe9)),console[_0x22e8ff(0x10b)](_0x22e8ff(0x101)),console[_0x22e8ff(0x10b)](''),console[_0x22e8ff(0x10b)](_0x22e8ff(0xf1)),0x1;const _0x11acff=_0x225af6&&(_0x225af6[_0x22e8ff(0xc5)]('*')||_0x225af6[_0x22e8ff(0xc5)]('?'));if(_0x11acff)return await this[_0x22e8ff(0x100)](_0x1a2b24,_0x9fb59f,_0x225af6);const _0x9959bc=_0x225af6?_0x9fb59f+'/'+_0x225af6:_0x9fb59f;return _0x423b9d?await this[_0x22e8ff(0x103)](_0x1a2b24,_0x9959bc):await this[_0x22e8ff(0xd9)](_0x1a2b24,_0x9959bc);}catch(_0x5b14ea){if(_0x5b14ea instanceof SDKError)return console[_0x22e8ff(0x10b)](_0x22e8ff(0xc8)+_0x5b14ea[_0x22e8ff(0xe8)]),_0x5b14ea['cause']&&console[_0x22e8ff(0x10b)](_0x22e8ff(0xc4)+_0x5b14ea[_0x22e8ff(0xf4)]),0x1;throw _0x5b14ea;}}async[a44_0x74999a(0x100)](_0x3ee02e,_0x1a2fa7,_0x565491){const _0x12eec3=a44_0x74999a,{options:_0x5409c9,tdx:_0x2c8428}=_0x3ee02e,_0x10fa5c=await withSpinner(_0x12eec3(0xe1)+_0x1a2fa7+_0x12eec3(0xe4),()=>_0x2c8428['segment'][_0x12eec3(0x10f)](_0x1a2fa7),{'verbose':_0x5409c9[_0x12eec3(0x112)]}),_0x3bbca8=_0x10fa5c['data'],_0x4bdb52=await withSpinner(_0x12eec3(0xd3),()=>_0x2c8428[_0x12eec3(0xfa)][_0x12eec3(0xca)](_0x3bbca8[_0x12eec3(0xcd)],_0x3bbca8[_0x12eec3(0x108)]),{'verbose':_0x5409c9[_0x12eec3(0x112)]}),{folders:_0x34878b,segments:_0x4483e5,journeys:_0x5b3b30}=_0x4bdb52[_0x12eec3(0xcc)],_0x248f26=_0x565491['replace'](/[.+^${}()|[\]\\]/g,_0x12eec3(0xe3))[_0x12eec3(0xf2)](/\*/g,'.*')[_0x12eec3(0xf2)](/\?/g,'.'),_0x40da31=new RegExp('^'+_0x248f26+'$','i'),_0x154dce=_0x34878b[_0x12eec3(0xec)](_0x444399=>_0x40da31[_0x12eec3(0xce)](_0x444399[_0x12eec3(0x107)])),_0x2c9a68=_0x4483e5[_0x12eec3(0xec)](_0x529736=>_0x40da31[_0x12eec3(0xce)](_0x529736[_0x12eec3(0x107)])),_0x152389=_0x5b3b30['filter'](_0x58a2fc=>_0x40da31[_0x12eec3(0xce)](_0x58a2fc[_0x12eec3(0xd0)])),_0x40b4ee=_0x154dce['length']+_0x2c9a68[_0x12eec3(0xed)]+_0x152389[_0x12eec3(0xed)];console[_0x12eec3(0x10b)](_0x12eec3(0xc9)+_0x154dce[_0x12eec3(0xed)]+'\x20folder'+(_0x154dce[_0x12eec3(0xed)]!==0x1?'s':'')+',\x20'+_0x2c9a68[_0x12eec3(0xed)]+_0x12eec3(0xdc)+(_0x2c9a68['length']!==0x1?'s':'')+',\x20and\x20'+_0x152389[_0x12eec3(0xed)]+_0x12eec3(0x10e)+(_0x152389[_0x12eec3(0xed)]!==0x1?'s':'')+'\x20matching\x20\x27'+_0x565491+'\x27');const _0x48191d=_0x3d9c14=>{const _0x39d976=_0x12eec3;return getConsoleNextUrl(_0x5409c9[_0x39d976(0xc3)],_0x39d976(0xda)+_0x3bbca8[_0x39d976(0xcd)]+_0x39d976(0xdb)+_0x3d9c14);},_0x3bcbe6=_0x5409c9['format']===_0x12eec3(0xdf)||_0x5409c9['format']==='jsonl';if(_0x3bcbe6){const _0x5b2761=[..._0x154dce['map'](_0x4cb797=>({..._0x4cb797,'type':_0x12eec3(0xe5)})),..._0x2c9a68[_0x12eec3(0x110)](_0xb8144b=>({..._0xb8144b,'type':_0x12eec3(0xfa),'url':_0x48191d(_0xb8144b['id'])})),..._0x152389[_0x12eec3(0x110)](_0x3956ae=>({..._0x3956ae,'name':_0x3956ae[_0x12eec3(0xd0)],'type':_0x12eec3(0x114)}))][_0x12eec3(0xd1)]((_0x29299f,_0x5cdb98)=>_0x29299f[_0x12eec3(0x107)][_0x12eec3(0xfb)](_0x5cdb98[_0x12eec3(0x107)]));await handleSDKOutput(_0x5b2761,_0x5409c9);}else{if(_0x40b4ee===0x0)console['log'](_0x12eec3(0xd7)+_0x565491);else{console[_0x12eec3(0xc2)](a44_0x301b82['dim']('['+_0x1a2fa7+_0x12eec3(0x104)+_0x565491+'\x27'));const _0x50aa36=formatFlatList(_0x154dce,_0x2c9a68,{'showMetadata':!![],'getSegmentUrl':_0x48191d},_0x152389);console[_0x12eec3(0xc2)](_0x50aa36);}}return 0x0;}async[a44_0x74999a(0xd9)](_0x2a0265,_0x2bebf5){const _0x52b36a=a44_0x74999a,{options:_0x46a717,tdx:_0xe112e5}=_0x2a0265,_0x553e0c=await withSpinner(_0x52b36a(0xf5)+_0x2bebf5+_0x52b36a(0xe4),()=>_0xe112e5[_0x52b36a(0xfa)][_0x52b36a(0x10f)](_0x2bebf5),{'verbose':_0x46a717['verbose']}),_0x43879e=_0x553e0c[_0x52b36a(0xcc)];_0x46a717[_0x52b36a(0x112)]&&(console[_0x52b36a(0x10b)](_0x52b36a(0xfd)+_0x43879e[_0x52b36a(0xcd)]),_0x43879e['folderId']&&console[_0x52b36a(0x10b)](_0x52b36a(0xe6)+_0x43879e[_0x52b36a(0x108)]));const _0x4b5cb9=await withSpinner(_0x52b36a(0xd3),()=>_0xe112e5[_0x52b36a(0xfa)][_0x52b36a(0xca)](_0x43879e[_0x52b36a(0xcd)],_0x43879e[_0x52b36a(0x108)]),{'verbose':_0x46a717['verbose']}),{folders:_0x4e5244,segments:_0x1bebfd,journeys:_0x4c8bb5}=_0x4b5cb9['data'],_0xfd6bae=_0x4e5244[_0x52b36a(0xed)]+_0x1bebfd[_0x52b36a(0xed)]+_0x4c8bb5[_0x52b36a(0xed)];console[_0x52b36a(0x10b)](_0x52b36a(0xc9)+_0x4e5244[_0x52b36a(0xed)]+'\x20folder'+(_0x4e5244[_0x52b36a(0xed)]!==0x1?'s':'')+',\x20'+_0x1bebfd[_0x52b36a(0xed)]+_0x52b36a(0xdc)+(_0x1bebfd[_0x52b36a(0xed)]!==0x1?'s':'')+_0x52b36a(0x102)+_0x4c8bb5[_0x52b36a(0xed)]+_0x52b36a(0x10e)+(_0x4c8bb5[_0x52b36a(0xed)]!==0x1?'s':''));const _0x4ae5e7=_0x3a98bd=>{const _0x5407c2=_0x52b36a;return getConsoleNextUrl(_0x46a717['site'],'/app/ps/'+_0x43879e[_0x5407c2(0xcd)]+'/e/'+_0x3a98bd);},_0x6f2544=_0x319948=>{const _0xf276d7=_0x52b36a;return getConsoleNextUrl(_0x46a717[_0xf276d7(0xc3)],'/app/ps/'+_0x43879e[_0xf276d7(0xcd)]+_0xf276d7(0xdb)+_0x319948+'/j/da');},_0x11a995=_0x46a717[_0x52b36a(0xf6)]===_0x52b36a(0xdf)||_0x46a717[_0x52b36a(0xf6)]===_0x52b36a(0x10a);if(_0x11a995){const _0x10bc08=[..._0x4e5244[_0x52b36a(0x110)](_0x12b0d4=>({..._0x12b0d4,'type':_0x52b36a(0xe5)})),..._0x1bebfd['map'](_0x3e7876=>({..._0x3e7876,'type':_0x52b36a(0xfa),'url':_0x4ae5e7(_0x3e7876['id'])})),..._0x4c8bb5[_0x52b36a(0x110)](_0x116685=>({..._0x116685,'name':_0x116685['journeyBundleName'],'type':'journey','url':_0x6f2544(_0x116685['id'])}))][_0x52b36a(0xd1)]((_0x2e498f,_0x190566)=>_0x2e498f['name'][_0x52b36a(0xfb)](_0x190566[_0x52b36a(0x107)]));await handleSDKOutput(_0x10bc08,_0x46a717);}else{if(_0xfd6bae===0x0)console[_0x52b36a(0xc2)](a44_0x301b82[_0x52b36a(0xd5)]('['+_0x2bebf5+']')),console['log'](_0x52b36a(0xcb));else{console['log'](a44_0x301b82['dim']('['+_0x2bebf5+']'));const _0x3fbfcf=formatFlatList(_0x4e5244,_0x1bebfd,{'showMetadata':!![],'getSegmentUrl':_0x4ae5e7,'getJourneyUrl':_0x6f2544},_0x4c8bb5);console['log'](_0x3fbfcf);}}return 0x0;}async['listRecursive'](_0x50691e,_0x4c9abe){const _0x1bb3e7=a44_0x74999a,{options:_0x56bcd6,tdx:_0x2697ac}=_0x50691e,_0x239cdf=await withSpinner(_0x1bb3e7(0xf5)+_0x4c9abe+_0x1bb3e7(0xe4),()=>_0x2697ac[_0x1bb3e7(0xfa)]['resolvePathToResource'](_0x4c9abe),{'verbose':_0x56bcd6[_0x1bb3e7(0x112)]}),_0x4d9294=_0x239cdf[_0x1bb3e7(0xcc)];_0x56bcd6[_0x1bb3e7(0x112)]&&(console[_0x1bb3e7(0x10b)](_0x1bb3e7(0xfd)+_0x4d9294[_0x1bb3e7(0xcd)]),_0x4d9294[_0x1bb3e7(0x108)]&&console[_0x1bb3e7(0x10b)]('Folder\x20ID:\x20'+_0x4d9294['folderId']));const _0x5a14bb=_0x56bcd6[_0x1bb3e7(0xf9)]||0xa,_0x5dd084=await withSpinner(_0x1bb3e7(0x105),()=>_0x2697ac[_0x1bb3e7(0xfa)][_0x1bb3e7(0x103)](_0x4d9294[_0x1bb3e7(0xcd)],_0x4d9294[_0x1bb3e7(0x108)],0x0,_0x5a14bb),{'verbose':_0x56bcd6[_0x1bb3e7(0x112)]}),_0x467284=_0x5dd084[_0x1bb3e7(0xcc)],_0x3fbfc0=_0x546784=>{const _0x12457b=_0x1bb3e7;let _0xb9247e=0x0,_0x406028=0x0,_0x1c38a6=0x0;for(const _0x16eedb of _0x546784){if(_0x16eedb[_0x12457b(0x106)]===_0x12457b(0xe5))_0xb9247e++;else{if(_0x16eedb[_0x12457b(0x106)]===_0x12457b(0xfa))_0x406028++;else{if(_0x16eedb['type']===_0x12457b(0x114))_0x1c38a6++;}}if(_0x16eedb[_0x12457b(0xee)]){const _0x5d8ef7=_0x3fbfc0(_0x16eedb['children']);_0xb9247e+=_0x5d8ef7[_0x12457b(0x10d)],_0x406028+=_0x5d8ef7[_0x12457b(0x109)],_0x1c38a6+=_0x5d8ef7[_0x12457b(0xff)];}}return{'folders':_0xb9247e,'segments':_0x406028,'journeys':_0x1c38a6};},_0x5d3d3d=_0x3fbfc0(_0x467284);console[_0x1bb3e7(0x10b)](_0x1bb3e7(0xe7)+_0x5d3d3d[_0x1bb3e7(0x10d)]+_0x1bb3e7(0xe0)+(_0x5d3d3d[_0x1bb3e7(0x10d)]!==0x1?'s':'')+',\x20'+_0x5d3d3d[_0x1bb3e7(0x109)]+'\x20segment'+(_0x5d3d3d[_0x1bb3e7(0x109)]!==0x1?'s':'')+_0x1bb3e7(0x102)+_0x5d3d3d[_0x1bb3e7(0xff)]+'\x20journey'+(_0x5d3d3d[_0x1bb3e7(0xff)]!==0x1?'s':''));const _0x2920cd=_0x4cbe28=>{const _0x2a3854=_0x1bb3e7;return getConsoleNextUrl(_0x56bcd6[_0x2a3854(0xc3)],_0x2a3854(0xda)+_0x4d9294[_0x2a3854(0xcd)]+'/e/'+_0x4cbe28);},_0x49bd48=_0x5378eb=>{const _0x1706c2=_0x1bb3e7;return getConsoleNextUrl(_0x56bcd6[_0x1706c2(0xc3)],_0x1706c2(0xda)+_0x4d9294[_0x1706c2(0xcd)]+_0x1706c2(0xdb)+_0x5378eb+_0x1706c2(0x10c));};if(_0x56bcd6[_0x1bb3e7(0xf6)]==='json'||_0x56bcd6['format']===_0x1bb3e7(0x10a))await handleSDKOutput(_0x467284,_0x56bcd6);else{console[_0x1bb3e7(0xc2)](a44_0x301b82['dim']('['+_0x4c9abe+']'));const _0x23115e=formatTree(_0x467284,{'showMetadata':!![],'getSegmentUrl':_0x2920cd,'getJourneyUrl':_0x49bd48});console[_0x1bb3e7(0xc2)](_0x23115e);}return 0x0;}}
@@ -1 +1 @@
1
- const a45_0x37cccb=a45_0x5ec7;function a45_0x5ec7(_0x5bbba8,_0x5c6b21){_0x5bbba8=_0x5bbba8-0x144;const _0x1e73e8=a45_0x1e73();let _0x5ec7b1=_0x1e73e8[_0x5bbba8];return _0x5ec7b1;}(function(_0x44f6cc,_0xda5fa8){const _0x4b2555=a45_0x5ec7,_0x4f0f0b=_0x44f6cc();while(!![]){try{const _0x5028c3=parseInt(_0x4b2555(0x144))/0x1+parseInt(_0x4b2555(0x14f))/0x2+-parseInt(_0x4b2555(0x153))/0x3+-parseInt(_0x4b2555(0x147))/0x4+parseInt(_0x4b2555(0x159))/0x5+-parseInt(_0x4b2555(0x16c))/0x6+parseInt(_0x4b2555(0x154))/0x7;if(_0x5028c3===_0xda5fa8)break;else _0x4f0f0b['push'](_0x4f0f0b['shift']());}catch(_0x4c57d1){_0x4f0f0b['push'](_0x4f0f0b['shift']());}}}(a45_0x1e73,0x8be8a));function a45_0x1e73(){const _0x5f1158=['Site:\x20','...','database','execute','✔\x20Retrieved\x20','limit','Catalog:\x20','cause','length','query','\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>','table','6408072BuXANj','921761SNWSva','Limit:\x20','data','4078304KoInwo','message','Usage:\x20tdx\x20show\x20<database.table>','\x20row','verbose','\x20from\x20','Usage:\x20tdx\x20show\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--in\x20<database>\x0a\x0aRun\x20\x27tdx\x20show\x20--help\x27\x20for\x20more\x20options','showTable','1314510JmimUs','catalog','site','show','2048217nqxXyw','4932417TrdTjb','Error:\x20','\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>','Querying\x20','✔\x20Query\x20successful\x20-\x200\x20rows\x20returned','5298730AcDlap','Show\x20table\x20contents','error','description','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','\x20\x20Cause:\x20','validate'];a45_0x1e73=function(){return _0x5f1158;};return a45_0x1e73();}import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';import{parseTableReference,validateTableDescribeReference}from'../utils/table-ref-parser.js';import{withSpinner}from'../utils/spinner.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';export class ShowCommand extends BaseCommand{['name']=a45_0x37cccb(0x152);[a45_0x37cccb(0x15c)]=a45_0x37cccb(0x15a);async[a45_0x37cccb(0x163)](_0x4689b1){const _0x2bd09f=a45_0x37cccb;return this[_0x2bd09f(0x14e)](_0x4689b1);}async[a45_0x37cccb(0x14e)](_0x3b727e){const _0x1deada=a45_0x37cccb,{options:_0x32a048,args:_0x21b84c,tdx:_0x4f1d67}=_0x3b727e;let _0x186772;try{_0x186772=parseTableReference(_0x21b84c[0x0]);const _0x4bd58c=_0x32a048[_0x1deada(0x162)];!_0x186772[_0x1deada(0x162)]&&_0x4bd58c&&(_0x186772[_0x1deada(0x162)]=_0x4bd58c);const _0x4f4660=validateTableDescribeReference(_0x186772);if(_0x4f4660)return console[_0x1deada(0x15b)](_0x1deada(0x155)+_0x4f4660),console[_0x1deada(0x15b)](_0x1deada(0x149)),console[_0x1deada(0x15b)](_0x1deada(0x16a)),console[_0x1deada(0x15b)](_0x1deada(0x156)),0x1;}catch(_0x16e5d6){return console[_0x1deada(0x15b)]('Error:\x20'+_0x16e5d6[_0x1deada(0x148)]),console[_0x1deada(0x15b)](_0x1deada(0x149)),console[_0x1deada(0x15b)](_0x1deada(0x16a)),console[_0x1deada(0x15b)](_0x1deada(0x156)),0x1;}const _0x3b73c4=_0x186772[_0x1deada(0x150)],_0x10aeb1=_0x186772['database'],_0x25465e=_0x186772[_0x1deada(0x16b)],_0x1bb1ef=resolveLimit(_0x32a048[_0x1deada(0x165)],DEFAULT_DISPLAY_LIMIT);try{_0x32a048[_0x1deada(0x14b)]&&(console[_0x1deada(0x15b)](_0x1deada(0x160)+_0x32a048[_0x1deada(0x151)]),_0x3b73c4&&console[_0x1deada(0x15b)](_0x1deada(0x166)+_0x3b73c4),console['error']('Database:\x20'+_0x10aeb1),console[_0x1deada(0x15b)]('Table:\x20'+_0x25465e),console[_0x1deada(0x15b)](_0x1deada(0x145)+_0x1bb1ef));const _0x42616c=_0x3b73c4?_0x3b73c4+'.'+_0x10aeb1+'.'+_0x25465e:_0x10aeb1+'.'+_0x25465e,_0x19954b=await withSpinner(_0x1deada(0x157)+_0x42616c+_0x1deada(0x161),()=>_0x4f1d67[_0x1deada(0x169)][_0x1deada(0x14e)](_0x10aeb1,_0x25465e,_0x1bb1ef,_0x3b73c4),{'verbose':_0x32a048[_0x1deada(0x14b)]}),_0x20d506=_0x19954b[_0x1deada(0x146)],_0x2d9155=_0x20d506[_0x1deada(0x146)];return _0x2d9155[_0x1deada(0x168)]===0x0?console[_0x1deada(0x15b)](_0x1deada(0x158)):console[_0x1deada(0x15b)](_0x1deada(0x164)+_0x2d9155[_0x1deada(0x168)]+_0x1deada(0x14a)+(_0x2d9155[_0x1deada(0x168)]!==0x1?'s':'')+_0x1deada(0x14c)+_0x42616c),await handleSDKOutput(_0x2d9155,_0x32a048),0x0;}catch(_0x59b412){if(_0x59b412 instanceof SDKError)return console['error'](_0x1deada(0x155)+_0x59b412['message']),_0x59b412[_0x1deada(0x167)]&&console[_0x1deada(0x15b)](_0x1deada(0x15e)+_0x59b412[_0x1deada(0x167)]),0x1;throw _0x59b412;}}[a45_0x37cccb(0x15f)](_0x37670f){const _0x22751a=a45_0x37cccb;if(_0x37670f['args']['length']===0x0)return _0x22751a(0x14d);if(_0x37670f['args'][_0x22751a(0x168)]>0x1)return _0x22751a(0x15d);return undefined;}}
1
+ function a45_0x45e9(){const _0x3f8a2d=['58369PEHhEq','253002seCJCi','10ZxVfYF','cause','table','24073Fcahpc','\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>','error','1502980QMYXBx','limit','1488nZbBZh','Error:\x20','7401ZpxFTm','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','8014896qArowc','execute','database','catalog','showTable','\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>','verbose','42ffgCdP','Usage:\x20tdx\x20show\x20<database.table>','query','✔\x20Query\x20successful\x20-\x200\x20rows\x20returned','\x20from\x20','site','name','4046160GbXpHk','description','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','message','Database:\x20','validate','data','\x20\x20Cause:\x20','Site:\x20','length','args'];a45_0x45e9=function(){return _0x3f8a2d;};return a45_0x45e9();}const a45_0x4cebf5=a45_0x49d5;(function(_0x32ac6a,_0x530846){const _0x4709ef=a45_0x49d5,_0x498d04=_0x32ac6a();while(!![]){try{const _0xbc2b14=parseInt(_0x4709ef(0xe7))/0x1+-parseInt(_0x4709ef(0xd5))/0x2*(-parseInt(_0x4709ef(0xcc))/0x3)+parseInt(_0x4709ef(0xdc))/0x4+-parseInt(_0x4709ef(0xc8))/0x5+-parseInt(_0x4709ef(0xe8))/0x6+-parseInt(_0x4709ef(0xec))/0x7*(-parseInt(_0x4709ef(0xca))/0x8)+parseInt(_0x4709ef(0xce))/0x9*(-parseInt(_0x4709ef(0xe9))/0xa);if(_0xbc2b14===_0x530846)break;else _0x498d04['push'](_0x498d04['shift']());}catch(_0x5b0b88){_0x498d04['push'](_0x498d04['shift']());}}}(a45_0x45e9,0x80ebf));import{BaseCommand}from'./command.js';function a45_0x49d5(_0x1e7166,_0x4be810){_0x1e7166=_0x1e7166-0xc8;const _0x45e9b2=a45_0x45e9();let _0x49d528=_0x45e9b2[_0x1e7166];return _0x49d528;}import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';import{parseTableReference,validateTableDescribeReference}from'../utils/table-ref-parser.js';import{withSpinner}from'../utils/spinner.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';export class ShowCommand extends BaseCommand{[a45_0x4cebf5(0xdb)]='show';[a45_0x4cebf5(0xdd)]='Show\x20table\x20contents';async[a45_0x4cebf5(0xcf)](_0x1e15e0){const _0x4d1b8a=a45_0x4cebf5;return this[_0x4d1b8a(0xd2)](_0x1e15e0);}async[a45_0x4cebf5(0xd2)](_0x2de4fb){const _0x15b8f7=a45_0x4cebf5,{options:_0x430cbd,args:_0x1516a7,tdx:_0x5516b7}=_0x2de4fb;let _0x439d1b;try{_0x439d1b=parseTableReference(_0x1516a7[0x0]);const _0x337a11=_0x430cbd[_0x15b8f7(0xd0)];!_0x439d1b[_0x15b8f7(0xd0)]&&_0x337a11&&(_0x439d1b['database']=_0x337a11);const _0x3572b2=validateTableDescribeReference(_0x439d1b);if(_0x3572b2)return console[_0x15b8f7(0xee)](_0x15b8f7(0xcb)+_0x3572b2),console['error'](_0x15b8f7(0xd6)),console[_0x15b8f7(0xee)](_0x15b8f7(0xed)),console[_0x15b8f7(0xee)](_0x15b8f7(0xd3)),0x1;}catch(_0x4352c4){return console['error'](_0x15b8f7(0xcb)+_0x4352c4[_0x15b8f7(0xdf)]),console[_0x15b8f7(0xee)](_0x15b8f7(0xd6)),console[_0x15b8f7(0xee)](_0x15b8f7(0xed)),console['error'](_0x15b8f7(0xd3)),0x1;}const _0x5f0e50=_0x439d1b[_0x15b8f7(0xd1)],_0x2900bf=_0x439d1b[_0x15b8f7(0xd0)],_0x2e9f8a=_0x439d1b[_0x15b8f7(0xeb)],_0x48b47a=resolveLimit(_0x430cbd[_0x15b8f7(0xc9)],DEFAULT_DISPLAY_LIMIT);try{_0x430cbd[_0x15b8f7(0xd4)]&&(console[_0x15b8f7(0xee)](_0x15b8f7(0xe4)+_0x430cbd[_0x15b8f7(0xda)]),_0x5f0e50&&console[_0x15b8f7(0xee)]('Catalog:\x20'+_0x5f0e50),console[_0x15b8f7(0xee)](_0x15b8f7(0xe0)+_0x2900bf),console[_0x15b8f7(0xee)]('Table:\x20'+_0x2e9f8a),console['error']('Limit:\x20'+_0x48b47a));const _0x33d67f=_0x5f0e50?_0x5f0e50+'.'+_0x2900bf+'.'+_0x2e9f8a:_0x2900bf+'.'+_0x2e9f8a,_0x555005=await withSpinner('Querying\x20'+_0x33d67f+'...',()=>_0x5516b7[_0x15b8f7(0xd7)][_0x15b8f7(0xd2)](_0x2900bf,_0x2e9f8a,_0x48b47a,_0x5f0e50),{'verbose':_0x430cbd[_0x15b8f7(0xd4)]}),_0x38c355=_0x555005[_0x15b8f7(0xe2)],_0x273f31=_0x38c355[_0x15b8f7(0xe2)];return _0x273f31[_0x15b8f7(0xe5)]===0x0?console['error'](_0x15b8f7(0xd8)):console[_0x15b8f7(0xee)]('✔\x20Retrieved\x20'+_0x273f31[_0x15b8f7(0xe5)]+'\x20row'+(_0x273f31[_0x15b8f7(0xe5)]!==0x1?'s':'')+_0x15b8f7(0xd9)+_0x33d67f),await handleSDKOutput(_0x273f31,_0x430cbd),0x0;}catch(_0x2778cd){if(_0x2778cd instanceof SDKError)return console['error'](_0x15b8f7(0xcb)+_0x2778cd[_0x15b8f7(0xdf)]),_0x2778cd[_0x15b8f7(0xea)]&&console[_0x15b8f7(0xee)](_0x15b8f7(0xe3)+_0x2778cd['cause']),0x1;throw _0x2778cd;}}[a45_0x4cebf5(0xe1)](_0x19b107){const _0x50b023=a45_0x4cebf5;if(_0x19b107[_0x50b023(0xe6)][_0x50b023(0xe5)]===0x0)return _0x50b023(0xcd);if(_0x19b107['args'][_0x50b023(0xe5)]>0x1)return _0x50b023(0xde);return undefined;}}
@@ -1 +1 @@
1
- const a46_0x47c9ef=a46_0x149d;(function(_0x15044e,_0x16d7f5){const _0x4419e9=a46_0x149d,_0x20c233=_0x15044e();while(!![]){try{const _0x32fc94=-parseInt(_0x4419e9(0x130))/0x1*(-parseInt(_0x4419e9(0x119))/0x2)+parseInt(_0x4419e9(0x10e))/0x3*(-parseInt(_0x4419e9(0x109))/0x4)+-parseInt(_0x4419e9(0x106))/0x5+parseInt(_0x4419e9(0x115))/0x6*(-parseInt(_0x4419e9(0x127))/0x7)+parseInt(_0x4419e9(0x120))/0x8+-parseInt(_0x4419e9(0x108))/0x9*(parseInt(_0x4419e9(0x121))/0xa)+parseInt(_0x4419e9(0x125))/0xb;if(_0x32fc94===_0x16d7f5)break;else _0x20c233['push'](_0x20c233['shift']());}catch(_0x10f62a){_0x20c233['push'](_0x20c233['shift']());}}}(a46_0x135d,0x8238b));import{BaseCommand,printAuthError}from'./command.js';import{resolveAPIKeyAsync}from'../core/config.js';function a46_0x135d(){const _0xa2cc66=['49FZSZqL','Show\x20authentication\x20status\x20and\x20current\x20context','Credential\x20type:\x20','✗\x20Validation\x20failed:\x20','config','email','\x20profile:\x20','dim','jobs','1PDXlER','execute','log','Account\x20ID:','getUserInfo','Name:','(from\x20','5221855UCCTnU','first_name','34947OZqsFd','20280bDqYFW','account_id','Read\x20credential\x20from\x20','No\x20credential\x20found','description','75Jyuvxr','bold','site','name','session','join','cli','453282yweInT','OAuth','TDX_PROFILE\x20env','last_name','770806nPVpIG','displayWithSources','cyan','red','env','yellow','site:\x20','3464776rNmwcT','370zABRjg','message','User:','✓\x20Authentication\x20successful\x0a','17143588QgcBJU','error'];a46_0x135d=function(){return _0xa2cc66;};return a46_0x135d();}import{getOAuthTokens}from'../core/oauth-keychain.js';import{HTTPClientError}from'../sdk/client/http-client.js';import{GlobalContext}from'../core/global-context.js';function a46_0x149d(_0x450bd8,_0x34552d){_0x450bd8=_0x450bd8-0x103;const _0x135d3b=a46_0x135d();let _0x149d38=_0x135d3b[_0x450bd8];return _0x149d38;}import a46_0x4228d2 from'chalk';export class StatusCommand extends BaseCommand{[a46_0x47c9ef(0x111)]='status';[a46_0x47c9ef(0x10d)]=a46_0x47c9ef(0x128);async[a46_0x47c9ef(0x131)](_0x312346){const _0x1e8dad=a46_0x47c9ef,{options:_0x4c67e4,tdx:_0x24ff0a}=_0x312346,_0x489835=_0x4c67e4[_0x1e8dad(0x110)],_0x33a503=new GlobalContext(_0x4c67e4),_0x5068c0=_0x33a503['profile'],_0x1f6a37=_0x33a503['profileSource'],_0x2493c4=_0x1f6a37===_0x1e8dad(0x114)?'CLI\x20flag':_0x1f6a37===_0x1e8dad(0x112)?_0x1e8dad(0x112):_0x1f6a37===_0x1e8dad(0x11d)?_0x1e8dad(0x117):_0x1f6a37===_0x1e8dad(0x12b)?_0x1e8dad(0x12b):null,_0x4a0700=_0x5068c0?a46_0x4228d2[_0x1e8dad(0x11b)](_0x5068c0):a46_0x4228d2['dim']('N/A'),_0x24cb55=_0x2493c4?'\x20'+a46_0x4228d2[_0x1e8dad(0x12e)](_0x1e8dad(0x105)+_0x2493c4+')'):'';console[_0x1e8dad(0x132)](a46_0x4228d2[_0x1e8dad(0x10f)]('tdx')+_0x1e8dad(0x12d)+_0x4a0700+_0x24cb55+'\x20'+a46_0x4228d2[_0x1e8dad(0x12e)]('(')+_0x1e8dad(0x11f)+a46_0x4228d2[_0x1e8dad(0x11b)](_0x489835)+a46_0x4228d2['dim'](')'));const _0x5ae02a=await getOAuthTokens(_0x5068c0);if(_0x5ae02a)console[_0x1e8dad(0x132)](_0x1e8dad(0x129)+a46_0x4228d2['cyan'](_0x1e8dad(0x116)));else{const _0x4bbb63=await resolveAPIKeyAsync(_0x489835,_0x5068c0);if(_0x4bbb63){const {source:_0x1bb038,isDeprecated:_0x512e2e}=_0x4bbb63,_0x2291dd=_0x1e8dad(0x10b)+a46_0x4228d2[_0x1e8dad(0x11b)](_0x1bb038);console['log'](_0x512e2e?a46_0x4228d2[_0x1e8dad(0x11e)](_0x2291dd):_0x2291dd);}else console[_0x1e8dad(0x132)](a46_0x4228d2['yellow'](_0x1e8dad(0x10c)));}let _0x3ded01=![];try{const _0x24a276=await _0x24ff0a[_0x1e8dad(0x12f)][_0x1e8dad(0x103)]();console[_0x1e8dad(0x132)](a46_0x4228d2['green'](_0x1e8dad(0x124))),console[_0x1e8dad(0x132)](a46_0x4228d2['bold'](_0x1e8dad(0x123))+'\x20'+a46_0x4228d2['cyan'](_0x24a276[_0x1e8dad(0x12c)]));if(_0x24a276[_0x1e8dad(0x107)]||_0x24a276[_0x1e8dad(0x118)]){const _0x570f5e=[_0x24a276['first_name'],_0x24a276[_0x1e8dad(0x118)]]['filter'](Boolean)[_0x1e8dad(0x113)]('\x20');console[_0x1e8dad(0x132)](a46_0x4228d2[_0x1e8dad(0x10f)](_0x1e8dad(0x104))+'\x20'+_0x570f5e);}_0x24a276[_0x1e8dad(0x10a)]&&console[_0x1e8dad(0x132)](a46_0x4228d2[_0x1e8dad(0x10f)](_0x1e8dad(0x133))+'\x20'+a46_0x4228d2[_0x1e8dad(0x11e)](_0x24a276['account_id'])),_0x3ded01=!![];}catch(_0x25907f){_0x25907f instanceof HTTPClientError&&_0x25907f['status']===0x191?printAuthError(_0x25907f,!![],_0x5068c0):console[_0x1e8dad(0x126)](a46_0x4228d2[_0x1e8dad(0x11c)](_0x1e8dad(0x12a)+(_0x25907f instanceof Error?_0x25907f[_0x1e8dad(0x122)]:String(_0x25907f))));}return console['log'](),_0x33a503[_0x1e8dad(0x11a)](),_0x3ded01?0x0:0x1;}}
1
+ const a46_0x3652f6=a46_0x6c42;(function(_0x2ce60a,_0x48e957){const _0x55cced=a46_0x6c42,_0x22e0d5=_0x2ce60a();while(!![]){try{const _0x57c418=parseInt(_0x55cced(0xc3))/0x1*(-parseInt(_0x55cced(0xbf))/0x2)+-parseInt(_0x55cced(0xd5))/0x3+-parseInt(_0x55cced(0xb0))/0x4*(-parseInt(_0x55cced(0xc9))/0x5)+-parseInt(_0x55cced(0xbc))/0x6+parseInt(_0x55cced(0xd0))/0x7+parseInt(_0x55cced(0xcf))/0x8*(-parseInt(_0x55cced(0xdb))/0x9)+parseInt(_0x55cced(0xb1))/0xa;if(_0x57c418===_0x48e957)break;else _0x22e0d5['push'](_0x22e0d5['shift']());}catch(_0x416f29){_0x22e0d5['push'](_0x22e0d5['shift']());}}}(a46_0x4a0b,0xa4796));import{BaseCommand,printAuthError}from'./command.js';import{resolveAPIKeyAsync}from'../core/config.js';import{getOAuthTokens}from'../core/oauth-keychain.js';function a46_0x4a0b(){const _0x1cdd7a=['env','yellow','2qCeywT','CLI\x20flag','No\x20credential\x20found','tdx','896489cbKbDq','User:','email','profileSource','cli','\x20profile:\x20','85kNFRrK','✗\x20Validation\x20failed:\x20','status','profile','displayWithSources','Credential\x20type:\x20','10016pTkToT','501935gyOICn','config','log','Show\x20authentication\x20status\x20and\x20current\x20context','account_id','1908696ymBTmK','bold','OAuth','N/A','message','Name:','6849bLhpcw','getUserInfo','TDX_PROFILE\x20env','192020BBvjqA','30698230XmtHon','cyan','dim','(from\x20','green','execute','error','last_name','site:\x20','name','first_name','4790604ujlYgE'];a46_0x4a0b=function(){return _0x1cdd7a;};return a46_0x4a0b();}import{HTTPClientError}from'../sdk/client/http-client.js';import{GlobalContext}from'../core/global-context.js';function a46_0x6c42(_0x4213e0,_0x2c9900){_0x4213e0=_0x4213e0-0xaf;const _0x4a0b35=a46_0x4a0b();let _0x6c4250=_0x4a0b35[_0x4213e0];return _0x6c4250;}import a46_0x4ec9d2 from'chalk';export class StatusCommand extends BaseCommand{[a46_0x3652f6(0xba)]=a46_0x3652f6(0xcb);['description']=a46_0x3652f6(0xd3);async[a46_0x3652f6(0xb6)](_0x380491){const _0x1a6d56=a46_0x3652f6,{options:_0x1c37e1,tdx:_0x4c0d28}=_0x380491,_0x5a43a7=_0x1c37e1['site'],_0x56226c=new GlobalContext(_0x1c37e1),_0x684d4f=_0x56226c[_0x1a6d56(0xcc)],_0x28f2a6=_0x56226c[_0x1a6d56(0xc6)],_0x1d68a0=_0x28f2a6===_0x1a6d56(0xc7)?_0x1a6d56(0xc0):_0x28f2a6==='session'?'session':_0x28f2a6===_0x1a6d56(0xbd)?_0x1a6d56(0xaf):_0x28f2a6===_0x1a6d56(0xd1)?_0x1a6d56(0xd1):null,_0x1f24c0=_0x684d4f?a46_0x4ec9d2['cyan'](_0x684d4f):a46_0x4ec9d2[_0x1a6d56(0xb3)](_0x1a6d56(0xd8)),_0x4f7fe1=_0x1d68a0?'\x20'+a46_0x4ec9d2[_0x1a6d56(0xb3)](_0x1a6d56(0xb4)+_0x1d68a0+')'):'';console[_0x1a6d56(0xd2)](a46_0x4ec9d2[_0x1a6d56(0xd6)](_0x1a6d56(0xc2))+_0x1a6d56(0xc8)+_0x1f24c0+_0x4f7fe1+'\x20'+a46_0x4ec9d2[_0x1a6d56(0xb3)]('(')+_0x1a6d56(0xb9)+a46_0x4ec9d2[_0x1a6d56(0xb2)](_0x5a43a7)+a46_0x4ec9d2['dim'](')'));const _0x2fc083=await getOAuthTokens(_0x684d4f);if(_0x2fc083)console[_0x1a6d56(0xd2)](_0x1a6d56(0xce)+a46_0x4ec9d2[_0x1a6d56(0xb2)](_0x1a6d56(0xd7)));else{const _0x1bee25=await resolveAPIKeyAsync(_0x5a43a7,_0x684d4f);if(_0x1bee25){const {source:_0x48b004,isDeprecated:_0x415f1d}=_0x1bee25,_0x2d7648='Read\x20credential\x20from\x20'+a46_0x4ec9d2[_0x1a6d56(0xb2)](_0x48b004);console[_0x1a6d56(0xd2)](_0x415f1d?a46_0x4ec9d2[_0x1a6d56(0xbe)](_0x2d7648):_0x2d7648);}else console[_0x1a6d56(0xd2)](a46_0x4ec9d2['yellow'](_0x1a6d56(0xc1)));}let _0x2d182a=![];try{const _0x4c5bf6=await _0x4c0d28['jobs'][_0x1a6d56(0xdc)]();console[_0x1a6d56(0xd2)](a46_0x4ec9d2[_0x1a6d56(0xb5)]('✓\x20Authentication\x20successful\x0a')),console['log'](a46_0x4ec9d2['bold'](_0x1a6d56(0xc4))+'\x20'+a46_0x4ec9d2[_0x1a6d56(0xb2)](_0x4c5bf6[_0x1a6d56(0xc5)]));if(_0x4c5bf6['first_name']||_0x4c5bf6[_0x1a6d56(0xb8)]){const _0x1524fb=[_0x4c5bf6[_0x1a6d56(0xbb)],_0x4c5bf6[_0x1a6d56(0xb8)]]['filter'](Boolean)['join']('\x20');console[_0x1a6d56(0xd2)](a46_0x4ec9d2[_0x1a6d56(0xd6)](_0x1a6d56(0xda))+'\x20'+_0x1524fb);}_0x4c5bf6[_0x1a6d56(0xd4)]&&console['log'](a46_0x4ec9d2[_0x1a6d56(0xd6)]('Account\x20ID:')+'\x20'+a46_0x4ec9d2[_0x1a6d56(0xbe)](_0x4c5bf6[_0x1a6d56(0xd4)])),_0x2d182a=!![];}catch(_0x196196){_0x196196 instanceof HTTPClientError&&_0x196196[_0x1a6d56(0xcb)]===0x191?printAuthError(_0x196196,!![],_0x684d4f):console[_0x1a6d56(0xb7)](a46_0x4ec9d2['red'](_0x1a6d56(0xca)+(_0x196196 instanceof Error?_0x196196[_0x1a6d56(0xd9)]:String(_0x196196))));}return console[_0x1a6d56(0xd2)](),_0x56226c[_0x1a6d56(0xcd)](),_0x2d182a?0x0:0x1;}}
@@ -1 +1 @@
1
- const a47_0x56d92a=a47_0x2a59;(function(_0x477d6b,_0x1dffeb){const _0x324286=a47_0x2a59,_0x2f0c8d=_0x477d6b();while(!![]){try{const _0x53d7d6=parseInt(_0x324286(0xbc))/0x1*(-parseInt(_0x324286(0xb1))/0x2)+-parseInt(_0x324286(0xb4))/0x3+parseInt(_0x324286(0x95))/0x4+-parseInt(_0x324286(0xa6))/0x5*(-parseInt(_0x324286(0x9e))/0x6)+parseInt(_0x324286(0x87))/0x7+-parseInt(_0x324286(0x91))/0x8*(-parseInt(_0x324286(0x90))/0x9)+-parseInt(_0x324286(0xbb))/0xa;if(_0x53d7d6===_0x1dffeb)break;else _0x2f0c8d['push'](_0x2f0c8d['shift']());}catch(_0x130195){_0x2f0c8d['push'](_0x2f0c8d['shift']());}}}(a47_0x3ef6,0x253f7));function a47_0x2a59(_0x5b934c,_0x7e3f11){_0x5b934c=_0x5b934c-0x87;const _0x3ef65c=a47_0x3ef6();let _0x2a5953=_0x3ef65c[_0x5b934c];return _0x2a5953;}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';export class TablesCommand extends BaseCommand{[a47_0x56d92a(0xa9)]=a47_0x56d92a(0xb9);[a47_0x56d92a(0xb3)]='List\x20tables\x20in\x20a\x20database';async[a47_0x56d92a(0x9b)](_0x3d9db2){const _0x3525fb=a47_0x56d92a,{options:_0x2e5acb,args:_0x379b1b,tdx:_0x38559c}=_0x3d9db2;let _0x40780f;if(_0x379b1b[_0x3525fb(0x98)]===0x0)_0x40780f={'database':undefined,'table':undefined,'original':''};else{if(_0x379b1b['length']===0x1)try{_0x40780f=parseTableReference(_0x379b1b[0x0]);if(_0x40780f[_0x3525fb(0xa4)]&&!_0x40780f['database']&&!_0x40780f[_0x3525fb(0xa4)][_0x3525fb(0x9c)]('*')&&!_0x40780f[_0x3525fb(0xa4)][_0x3525fb(0x9c)]('?'))return console[_0x3525fb(0xb8)]('Error:\x20Pattern\x20\x27'+_0x379b1b[0x0]+'\x27\x20is\x20ambiguous.'),console[_0x3525fb(0xb8)](_0x3525fb(0xa2)+_0x40780f['table']+'\x27?'),console['error'](_0x3525fb(0x8f)+_0x40780f[_0x3525fb(0xa4)]+_0x3525fb(0x9d)),console[_0x3525fb(0xb8)](_0x3525fb(0x93)+_0x40780f[_0x3525fb(0xa4)]),console['error'](_0x3525fb(0x8e)+_0x40780f[_0x3525fb(0xa4)]),console['error'](''),console[_0x3525fb(0xb8)](_0x3525fb(0xab)+_0x379b1b[0x0]+_0x3525fb(0x8a)+_0x40780f['table']+_0x3525fb(0xa0)),0x1;}catch(_0x254739){return console[_0x3525fb(0xb8)](_0x3525fb(0xb0)+_0x254739['message']),0x1;}else return console['error'](_0x3525fb(0xaf)),console[_0x3525fb(0xb8)](_0x3525fb(0xae)),console[_0x3525fb(0xb8)](_0x3525fb(0xb5)),console[_0x3525fb(0xb8)]('\x20\x20tdx\x20tables\x20\x22mydb.users\x22\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20in\x20database\x20mydb'),console['error'](_0x3525fb(0xaa)),console[_0x3525fb(0xb8)]('Or\x20use\x20--in\x20flag:'),console[_0x3525fb(0xb8)](_0x3525fb(0x92)),0x1;}const _0x32597f=_0x2e5acb[_0x3525fb(0x94)];!_0x40780f['database']&&_0x32597f&&(_0x40780f[_0x3525fb(0x94)]=_0x32597f);try{const _0x1527d4=_0x3e69da=>_0x3e69da&&(_0x3e69da[_0x3525fb(0x9c)]('*')||_0x3e69da[_0x3525fb(0x9c)]('?')),_0x680caf=_0x1527d4(_0x40780f[_0x3525fb(0x94)]);_0x2e5acb[_0x3525fb(0x8c)]&&(console['error'](_0x3525fb(0x9f)+_0x2e5acb[_0x3525fb(0xa5)]),_0x40780f[_0x3525fb(0x94)]?_0x680caf?console[_0x3525fb(0xb8)](_0x3525fb(0x96)+_0x40780f[_0x3525fb(0x94)]):console['error'](_0x3525fb(0xb2)+_0x40780f[_0x3525fb(0x94)]):console[_0x3525fb(0xb8)](_0x3525fb(0xac)),_0x40780f[_0x3525fb(0xa4)]&&console['error'](_0x3525fb(0x97)+_0x40780f[_0x3525fb(0xa4)]));const _0x40afa0=_0x40780f[_0x3525fb(0x94)]&&!_0x680caf?_0x40780f[_0x3525fb(0x94)]:undefined,_0x521873=_0x680caf?_0x40780f['database']:undefined,_0xc155cd=_0x40780f['table'],_0x41c425=resolveLimit(_0x2e5acb[_0x3525fb(0x8b)],DEFAULT_LISTING_LIMIT),_0x571722=await withSpinner(_0x3525fb(0x89),()=>_0x38559c[_0x3525fb(0xa1)][_0x3525fb(0xb7)](_0x40afa0,_0xc155cd,_0x521873,_0x41c425),{'verbose':_0x2e5acb['verbose']}),_0x3786d9=_0x571722[_0x3525fb(0x8d)];if(_0x3786d9['length']===0x0&&_0x40780f[_0x3525fb(0x94)]&&!_0x680caf)return console[_0x3525fb(0xb8)](_0x3525fb(0xa7)),console[_0x3525fb(0xb8)](_0x3525fb(0xad)+_0x40780f[_0x3525fb(0x94)]+_0x3525fb(0x99)),0x1;console['error']('✔\x20Found\x20'+_0x3786d9[_0x3525fb(0x98)]+'\x20table'+(_0x3786d9['length']!==0x1?'s':''));if(isStructuredFormat(_0x2e5acb))await handleSDKOutput(_0x3786d9,{..._0x2e5acb,'limit':_0x41c425});else for(const _0x5e62b7 of _0x3786d9){const _0x580a2b=_0x5e62b7['database_name']?_0x5e62b7[_0x3525fb(0xa3)]+'.':'';console['log'](_0x3525fb(0xa8)+_0x580a2b+_0x5e62b7['table_name']);}return 0x0;}catch(_0x41b3ed){if(_0x41b3ed instanceof SDKError)return console['error'](_0x3525fb(0xb0)+_0x41b3ed[_0x3525fb(0x88)]),_0x41b3ed[_0x3525fb(0xba)]&&console[_0x3525fb(0xb8)](_0x3525fb(0xb6)+_0x41b3ed[_0x3525fb(0xba)]),0x1;throw _0x41b3ed;}}[a47_0x56d92a(0x9a)](_0x3a6d82){return undefined;}}function a47_0x3ef6(){const _0x4c8b3f=['229954qwwbmk','Database:\x20','description','423234AgyKAb','\x20\x20tdx\x20tables\x20\x22mydb.*\x22\x20\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb','\x20\x20Cause:\x20','listTables','error','tables','cause','2462670gEtTac','2jEWxQQ','364532TLPvhe','message','Listing\x20tables...','\x27\x20without\x20wildcards\x20would\x20search\x20for\x20tables\x20named\x20\x27','limit','verbose','data','\x20\x20Or:\x20\x20tdx\x20tables\x20--database\x20','\x20\x20Use:\x20tdx\x20tables\x20\x22','225vAEcXW','95672xAwgOc','\x20\x20tdx\x20tables\x20--in\x20mydb\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb','\x20\x20Or:\x20\x20tdx\x20tables\x20--in\x20','database','860952gSSAPf','Database\x20pattern:\x20','Table\x20pattern:\x20','length','\x27\x20may\x20not\x20exist\x20or\x20contains\x20no\x20tables','validate','execute','includes','.*\x22','198lgBYQU','Site:\x20','\x27\x20across\x20all\x20databases.','query','Did\x20you\x20mean\x20to\x20list\x20all\x20tables\x20from\x20database\x20\x27','database_name','table','site','30845scRauP','✖\x20No\x20tables\x20found','📋\x20','name','\x20\x20tdx\x20tables\x20\x22*.user*\x22\x20\x20\x20\x20\x20\x20\x20->\x20tables\x20matching\x20user*\x20across\x20databases','Note:\x20\x27','Database:\x20all','Database\x20\x27','\x20\x20tdx\x20tables\x20users\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20across\x20all\x20databases','Error:\x20Too\x20many\x20arguments.\x20Use\x20single\x20argument:','Error:\x20'];a47_0x3ef6=function(){return _0x4c8b3f;};return a47_0x3ef6();}
1
+ const a47_0x528622=a47_0x1c78;(function(_0x283660,_0x164b1a){const _0x37dfee=a47_0x1c78,_0x248938=_0x283660();while(!![]){try{const _0x1957f8=parseInt(_0x37dfee(0x151))/0x1*(parseInt(_0x37dfee(0x145))/0x2)+parseInt(_0x37dfee(0x148))/0x3+-parseInt(_0x37dfee(0x144))/0x4+-parseInt(_0x37dfee(0x13f))/0x5+-parseInt(_0x37dfee(0x14d))/0x6*(-parseInt(_0x37dfee(0x166))/0x7)+-parseInt(_0x37dfee(0x14b))/0x8+-parseInt(_0x37dfee(0x141))/0x9*(-parseInt(_0x37dfee(0x169))/0xa);if(_0x1957f8===_0x164b1a)break;else _0x248938['push'](_0x248938['shift']());}catch(_0x3bb459){_0x248938['push'](_0x248938['shift']());}}}(a47_0x3930,0xc17a2));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput,isStructuredFormat}from'../core/command-output.js';function a47_0x3930(){const _0x3cf9bf=['1IGnXjK','log','\x20\x20Or:\x20\x20tdx\x20tables\x20--in\x20','\x27\x20across\x20all\x20databases.','Error:\x20Pattern\x20\x27','\x20\x20Cause:\x20','✔\x20Found\x20','table_name','Or\x20use\x20--in\x20flag:','Site:\x20','\x20\x20tdx\x20tables\x20\x22mydb.users\x22\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20in\x20database\x20mydb','includes','length','name','Note:\x20\x27','Database\x20pattern:\x20','verbose','message','validate','table','Did\x20you\x20mean\x20to\x20list\x20all\x20tables\x20from\x20database\x20\x27','28dVzHtU','tables','✖\x20No\x20tables\x20found','30pidJFR','\x20\x20tdx\x20tables\x20\x22*.user*\x22\x20\x20\x20\x20\x20\x20\x20->\x20tables\x20matching\x20user*\x20across\x20databases','description','data','database_name','\x20\x20Use:\x20tdx\x20tables\x20\x22','database','cause','Error:\x20','listTables','7649070iZYWnC','Error:\x20Too\x20many\x20arguments.\x20Use\x20single\x20argument:','2505141zloqsj','\x20\x20tdx\x20tables\x20--in\x20mydb\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb','List\x20tables\x20in\x20a\x20database','2844860nnqukr','3057646oSCNBx','Listing\x20tables...','query','4216149ZotKPq','error','Database:\x20all','7643216RXEVIR','\x20\x20Or:\x20\x20tdx\x20tables\x20--database\x20','329490qboRLj','Database:\x20','\x27\x20may\x20not\x20exist\x20or\x20contains\x20no\x20tables','📋\x20'];a47_0x3930=function(){return _0x3cf9bf;};return a47_0x3930();}import{parseTableReference}from'../utils/table-ref-parser.js';function a47_0x1c78(_0x541761,_0x247f73){_0x541761=_0x541761-0x13a;const _0x39300b=a47_0x3930();let _0x1c780d=_0x39300b[_0x541761];return _0x1c780d;}import{DEFAULT_LISTING_LIMIT,resolveLimit}from'../core/constants.js';import{withSpinner}from'../utils/spinner.js';export class TablesCommand extends BaseCommand{[a47_0x528622(0x15e)]=a47_0x528622(0x167);[a47_0x528622(0x16b)]=a47_0x528622(0x143);async['execute'](_0x28ba29){const _0x332820=a47_0x528622,{options:_0x2a78a7,args:_0x28723d,tdx:_0x1ffaa7}=_0x28ba29;let _0x2be522;if(_0x28723d[_0x332820(0x15d)]===0x0)_0x2be522={'database':undefined,'table':undefined,'original':''};else{if(_0x28723d[_0x332820(0x15d)]===0x1)try{_0x2be522=parseTableReference(_0x28723d[0x0]);if(_0x2be522[_0x332820(0x164)]&&!_0x2be522[_0x332820(0x13b)]&&!_0x2be522['table'][_0x332820(0x15c)]('*')&&!_0x2be522[_0x332820(0x164)][_0x332820(0x15c)]('?'))return console['error'](_0x332820(0x155)+_0x28723d[0x0]+'\x27\x20is\x20ambiguous.'),console[_0x332820(0x149)](_0x332820(0x165)+_0x2be522[_0x332820(0x164)]+'\x27?'),console[_0x332820(0x149)](_0x332820(0x13a)+_0x2be522['table']+'.*\x22'),console[_0x332820(0x149)](_0x332820(0x153)+_0x2be522[_0x332820(0x164)]),console[_0x332820(0x149)](_0x332820(0x14c)+_0x2be522[_0x332820(0x164)]),console[_0x332820(0x149)](''),console[_0x332820(0x149)](_0x332820(0x15f)+_0x28723d[0x0]+'\x27\x20without\x20wildcards\x20would\x20search\x20for\x20tables\x20named\x20\x27'+_0x2be522[_0x332820(0x164)]+_0x332820(0x154)),0x1;}catch(_0x27dee1){return console[_0x332820(0x149)]('Error:\x20'+_0x27dee1[_0x332820(0x162)]),0x1;}else return console[_0x332820(0x149)](_0x332820(0x140)),console['error']('\x20\x20tdx\x20tables\x20users\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20across\x20all\x20databases'),console[_0x332820(0x149)]('\x20\x20tdx\x20tables\x20\x22mydb.*\x22\x20\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb'),console[_0x332820(0x149)](_0x332820(0x15b)),console[_0x332820(0x149)](_0x332820(0x16a)),console[_0x332820(0x149)](_0x332820(0x159)),console[_0x332820(0x149)](_0x332820(0x142)),0x1;}const _0x46a840=_0x2a78a7[_0x332820(0x13b)];!_0x2be522['database']&&_0x46a840&&(_0x2be522[_0x332820(0x13b)]=_0x46a840);try{const _0x4a31a1=_0x3dc82e=>_0x3dc82e&&(_0x3dc82e[_0x332820(0x15c)]('*')||_0x3dc82e[_0x332820(0x15c)]('?')),_0x39d374=_0x4a31a1(_0x2be522[_0x332820(0x13b)]);_0x2a78a7[_0x332820(0x161)]&&(console[_0x332820(0x149)](_0x332820(0x15a)+_0x2a78a7['site']),_0x2be522['database']?_0x39d374?console[_0x332820(0x149)](_0x332820(0x160)+_0x2be522['database']):console[_0x332820(0x149)](_0x332820(0x14e)+_0x2be522[_0x332820(0x13b)]):console['error'](_0x332820(0x14a)),_0x2be522[_0x332820(0x164)]&&console[_0x332820(0x149)]('Table\x20pattern:\x20'+_0x2be522[_0x332820(0x164)]));const _0x2e8c22=_0x2be522[_0x332820(0x13b)]&&!_0x39d374?_0x2be522[_0x332820(0x13b)]:undefined,_0x177e39=_0x39d374?_0x2be522[_0x332820(0x13b)]:undefined,_0x310a32=_0x2be522[_0x332820(0x164)],_0x7d8fa1=resolveLimit(_0x2a78a7['limit'],DEFAULT_LISTING_LIMIT),_0xb549a6=await withSpinner(_0x332820(0x146),()=>_0x1ffaa7[_0x332820(0x147)][_0x332820(0x13e)](_0x2e8c22,_0x310a32,_0x177e39,_0x7d8fa1),{'verbose':_0x2a78a7[_0x332820(0x161)]}),_0x5b19c8=_0xb549a6[_0x332820(0x16c)];if(_0x5b19c8[_0x332820(0x15d)]===0x0&&_0x2be522[_0x332820(0x13b)]&&!_0x39d374)return console['error'](_0x332820(0x168)),console[_0x332820(0x149)]('Database\x20\x27'+_0x2be522[_0x332820(0x13b)]+_0x332820(0x14f)),0x1;console[_0x332820(0x149)](_0x332820(0x157)+_0x5b19c8[_0x332820(0x15d)]+'\x20table'+(_0x5b19c8[_0x332820(0x15d)]!==0x1?'s':''));if(isStructuredFormat(_0x2a78a7))await handleSDKOutput(_0x5b19c8,{..._0x2a78a7,'limit':_0x7d8fa1});else for(const _0x51628f of _0x5b19c8){const _0x26d671=_0x51628f[_0x332820(0x16d)]?_0x51628f[_0x332820(0x16d)]+'.':'';console[_0x332820(0x152)](_0x332820(0x150)+_0x26d671+_0x51628f[_0x332820(0x158)]);}return 0x0;}catch(_0x31792a){if(_0x31792a instanceof SDKError)return console[_0x332820(0x149)](_0x332820(0x13d)+_0x31792a['message']),_0x31792a[_0x332820(0x13c)]&&console[_0x332820(0x149)](_0x332820(0x156)+_0x31792a['cause']),0x1;throw _0x31792a;}}[a47_0x528622(0x163)](_0x249101){return undefined;}}
@@ -1 +1 @@
1
- const a48_0x5e01a6=a48_0x1cd2;(function(_0x576456,_0x3e43b0){const _0x433a53=a48_0x1cd2,_0x5c6ecd=_0x576456();while(!![]){try{const _0x35617a=parseInt(_0x433a53(0xa4))/0x1+parseInt(_0x433a53(0x99))/0x2+-parseInt(_0x433a53(0x90))/0x3+parseInt(_0x433a53(0x9b))/0x4+-parseInt(_0x433a53(0xad))/0x5*(-parseInt(_0x433a53(0xb5))/0x6)+-parseInt(_0x433a53(0xa6))/0x7+parseInt(_0x433a53(0xa3))/0x8;if(_0x35617a===_0x3e43b0)break;else _0x5c6ecd['push'](_0x5c6ecd['shift']());}catch(_0x41a394){_0x5c6ecd['push'](_0x5c6ecd['shift']());}}}(a48_0x2a03,0xe4fea));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';function a48_0x2a03(){const _0x193a3a=['length','--default\x20can\x20only\x20be\x20used\x20with\x20\x27site\x27\x20or\x20\x27profile\x27.\x20Other\x20resources\x20are\x20session-level\x20only.','\x20\x20\x20\x20\x20\x20\x20tdx\x20unset\x20--default\x20<resource>\x20\x20#\x20Clear\x20default\x20from\x20config\x0a','Invalid\x20resource:\x20','(session:\x20','Usage:\x20tdx\x20unset\x20<resource>\x0a','3878860AShkeb','join','engage_workspace','Error:\x20','agent','\x0aRun\x20\x27tdx\x20unset\x20--help\x27\x20for\x20more\x20options','llm_project','default','6ClYErp','error','session','message','Session\x20','1215294nZHFzY','green','Default\x20site\x20','description','database','validate','profile','cleared','Default\x20profile\x20','342462WcmXPt','\x0aResources:\x20site,\x20database,\x20parent_segment,\x20llm_project,\x20agent,\x20profile,\x20engage_workspace\x0a','5536468vXfARu','\x0aUpdated:\x20','dim','unset','name','log','parent_segment','.\x20Must\x20be\x20one\x20of:\x20','260384cakMJL','518809oSjhwo','site','10775919HTzCaA'];a48_0x2a03=function(){return _0x193a3a;};return a48_0x2a03();}function a48_0x1cd2(_0x20d562,_0x334e0d){_0x20d562=_0x20d562-0x90;const _0x2a03ac=a48_0x2a03();let _0x1cd20f=_0x2a03ac[_0x20d562];return _0x1cd20f;}import a48_0xc0c1b from'chalk';import*as a48_0x5e1cb7 from'node:path';export class UnsetCommand extends BaseCommand{[a48_0x5e01a6(0x9f)]=a48_0x5e01a6(0x9e);[a48_0x5e01a6(0x93)]='Clear\x20session-level\x20or\x20default\x20context\x20values';[a48_0x5e01a6(0x95)](_0x36ae99){const _0x172dc8=a48_0x5e01a6,{args:_0x35f21d,options:_0x25e85e}=_0x36ae99,_0x1ca079=_0x25e85e[_0x172dc8(0xb4)];if(_0x35f21d[_0x172dc8(0xa7)]===0x0)return _0x172dc8(0xac)+_0x172dc8(0xa9)+_0x172dc8(0x9a)+_0x172dc8(0xb2);const _0x546e07=_0x35f21d[0x0],_0x1fc6d6=[_0x172dc8(0xa5),'database','parent_segment',_0x172dc8(0xb3),_0x172dc8(0xb1),'profile','engage_workspace'];if(!_0x1fc6d6['includes'](_0x546e07))return _0x172dc8(0xaa)+_0x546e07+_0x172dc8(0xa2)+_0x1fc6d6[_0x172dc8(0xae)](',\x20');if(_0x1ca079&&_0x546e07!==_0x172dc8(0xa5)&&_0x546e07!==_0x172dc8(0x96))return _0x172dc8(0xa8);return undefined;}async['execute'](_0x28c3f4){const _0x3df8f8=a48_0x5e01a6,{args:_0x3e2104,options:_0x453378}=_0x28c3f4,_0x39227a=_0x453378[_0x3df8f8(0xb4)];cleanExpiredSessions();try{const _0x2a21d3=_0x3e2104[0x0],_0x1c3a6f=a48_0x5e1cb7[_0x3df8f8(0xae)](getConfigDir(),'tdx.json');if(_0x39227a){if(_0x2a21d3===_0x3df8f8(0xa5))return clearDefaultSiteFromUserConfig(),console[_0x3df8f8(0xa0)](_0x3df8f8(0x92)+a48_0xc0c1b[_0x3df8f8(0x91)]('cleared')),console['log'](a48_0xc0c1b[_0x3df8f8(0x9d)]('\x0aUpdated:\x20'+_0x1c3a6f)),0x0;if(_0x2a21d3==='profile')return clearActiveProfileFromUserConfig(),console[_0x3df8f8(0xa0)](_0x3df8f8(0x98)+a48_0xc0c1b['green']('cleared')),console[_0x3df8f8(0xa0)](a48_0xc0c1b[_0x3df8f8(0x9d)](_0x3df8f8(0x9c)+_0x1c3a6f)),0x0;}const _0x496d69=getSessionID(_0x453378[_0x3df8f8(0xb7)]),_0xfa29ec={'site':_0x3df8f8(0xa5),'database':_0x3df8f8(0x94),'parent_segment':_0x3df8f8(0xa1),'llm_project':_0x3df8f8(0xb3),'agent':'llm_agent','profile':'profile','engage_workspace':_0x3df8f8(0xaf)},_0xea4ed3=_0xfa29ec[_0x2a21d3];return _0xea4ed3&&(clearSessionContextField(_0xea4ed3,_0x453378[_0x3df8f8(0xb7)]),console['log'](_0x3df8f8(0xb9)+_0x2a21d3+'\x20'+a48_0xc0c1b[_0x3df8f8(0x91)](_0x3df8f8(0x97))+'\x20'+a48_0xc0c1b[_0x3df8f8(0x9d)](_0x3df8f8(0xab)+_0x496d69+')'))),0x0;}catch(_0x5368f2){return _0x5368f2 instanceof Error&&console[_0x3df8f8(0xb6)](_0x3df8f8(0xb0)+_0x5368f2[_0x3df8f8(0xb8)]),0x1;}}}
1
+ const a48_0x1f5884=a48_0x2cbf;function a48_0x3466(){const _0x24b927=['Invalid\x20resource:\x20','2681NqYNBC','7423200nPSpay','engage_workspace','1392ZdIcpg','Clear\x20session-level\x20or\x20default\x20context\x20values','includes','error','Default\x20profile\x20','cleared','44624hKmwxo','validate','description','dim','join','execute','4UyaqHR','site','\x20\x20\x20\x20\x20\x20\x20tdx\x20unset\x20--default\x20<resource>\x20\x20#\x20Clear\x20default\x20from\x20config\x0a','log','.\x20Must\x20be\x20one\x20of:\x20','session','1133321KGcYtb','\x0aUpdated:\x20','14244gqcpOz','Default\x20site\x20','agent','llm_agent','parent_segment','green','profile','unset','2761215gcUCQo','3964gYGaQb','Session\x20','llm_project','5080779voQODr','Usage:\x20tdx\x20unset\x20<resource>\x0a','333GFJmpe','default','name'];a48_0x3466=function(){return _0x24b927;};return a48_0x3466();}(function(_0x155ea4,_0x4f05e8){const _0x3c88e5=a48_0x2cbf,_0x2da78f=_0x155ea4();while(!![]){try{const _0x2d8d30=parseInt(_0x3c88e5(0x16a))/0x1+parseInt(_0x3c88e5(0x175))/0x2*(-parseInt(_0x3c88e5(0x181))/0x3)+-parseInt(_0x3c88e5(0x18d))/0x4*(-parseInt(_0x3c88e5(0x174))/0x5)+-parseInt(_0x3c88e5(0x16c))/0x6*(-parseInt(_0x3c88e5(0x17e))/0x7)+-parseInt(_0x3c88e5(0x187))/0x8*(-parseInt(_0x3c88e5(0x17a))/0x9)+-parseInt(_0x3c88e5(0x17f))/0xa+-parseInt(_0x3c88e5(0x178))/0xb;if(_0x2d8d30===_0x4f05e8)break;else _0x2da78f['push'](_0x2da78f['shift']());}catch(_0x59a068){_0x2da78f['push'](_0x2da78f['shift']());}}}(a48_0x3466,0xa55d7));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';function a48_0x2cbf(_0x192e9f,_0x49a6ef){_0x192e9f=_0x192e9f-0x167;const _0x34666d=a48_0x3466();let _0x2cbfd7=_0x34666d[_0x192e9f];return _0x2cbfd7;}import a48_0x5715e9 from'chalk';import*as a48_0x459272 from'node:path';export class UnsetCommand extends BaseCommand{[a48_0x1f5884(0x17c)]=a48_0x1f5884(0x173);[a48_0x1f5884(0x189)]=a48_0x1f5884(0x182);[a48_0x1f5884(0x188)](_0x21b3bb){const _0x352c93=a48_0x1f5884,{args:_0x292067,options:_0x3f8943}=_0x21b3bb,_0x7faa5e=_0x3f8943['default'];if(_0x292067['length']===0x0)return _0x352c93(0x179)+_0x352c93(0x18f)+'\x0aResources:\x20site,\x20database,\x20parent_segment,\x20llm_project,\x20agent,\x20profile,\x20engage_workspace\x0a'+'\x0aRun\x20\x27tdx\x20unset\x20--help\x27\x20for\x20more\x20options';const _0x387337=_0x292067[0x0],_0x26721d=[_0x352c93(0x18e),'database',_0x352c93(0x170),_0x352c93(0x177),_0x352c93(0x16e),'profile','engage_workspace'];if(!_0x26721d[_0x352c93(0x183)](_0x387337))return _0x352c93(0x17d)+_0x387337+_0x352c93(0x168)+_0x26721d[_0x352c93(0x18b)](',\x20');if(_0x7faa5e&&_0x387337!==_0x352c93(0x18e)&&_0x387337!==_0x352c93(0x172))return'--default\x20can\x20only\x20be\x20used\x20with\x20\x27site\x27\x20or\x20\x27profile\x27.\x20Other\x20resources\x20are\x20session-level\x20only.';return undefined;}async[a48_0x1f5884(0x18c)](_0x551dae){const _0x4904e1=a48_0x1f5884,{args:_0xef0914,options:_0x1943cb}=_0x551dae,_0x3502b7=_0x1943cb[_0x4904e1(0x17b)];cleanExpiredSessions();try{const _0x367ed9=_0xef0914[0x0],_0x683c40=a48_0x459272['join'](getConfigDir(),'tdx.json');if(_0x3502b7){if(_0x367ed9===_0x4904e1(0x18e))return clearDefaultSiteFromUserConfig(),console[_0x4904e1(0x167)](_0x4904e1(0x16d)+a48_0x5715e9[_0x4904e1(0x171)](_0x4904e1(0x186))),console[_0x4904e1(0x167)](a48_0x5715e9['dim'](_0x4904e1(0x16b)+_0x683c40)),0x0;if(_0x367ed9===_0x4904e1(0x172))return clearActiveProfileFromUserConfig(),console[_0x4904e1(0x167)](_0x4904e1(0x185)+a48_0x5715e9[_0x4904e1(0x171)]('cleared')),console['log'](a48_0x5715e9[_0x4904e1(0x18a)](_0x4904e1(0x16b)+_0x683c40)),0x0;}const _0x32fae1=getSessionID(_0x1943cb['session']),_0x48c291={'site':'site','database':'database','parent_segment':_0x4904e1(0x170),'llm_project':_0x4904e1(0x177),'agent':_0x4904e1(0x16f),'profile':_0x4904e1(0x172),'engage_workspace':_0x4904e1(0x180)},_0x498adc=_0x48c291[_0x367ed9];return _0x498adc&&(clearSessionContextField(_0x498adc,_0x1943cb[_0x4904e1(0x169)]),console[_0x4904e1(0x167)](_0x4904e1(0x176)+_0x367ed9+'\x20'+a48_0x5715e9[_0x4904e1(0x171)](_0x4904e1(0x186))+'\x20'+a48_0x5715e9[_0x4904e1(0x18a)]('(session:\x20'+_0x32fae1+')'))),0x0;}catch(_0x13c302){return _0x13c302 instanceof Error&&console[_0x4904e1(0x184)]('Error:\x20'+_0x13c302['message']),0x1;}}}