@treasuredata/tdx 2026.3.23 → 2026.3.24

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_0x3ce38d=a40_0x5e80;(function(_0x1d98d2,_0x15d3e6){const _0x14b48d=a40_0x5e80,_0x29bb59=_0x1d98d2();while(!![]){try{const _0x29767a=-parseInt(_0x14b48d(0x150))/0x1*(parseInt(_0x14b48d(0x163))/0x2)+parseInt(_0x14b48d(0x193))/0x3+parseInt(_0x14b48d(0x19b))/0x4+parseInt(_0x14b48d(0x171))/0x5*(parseInt(_0x14b48d(0x18a))/0x6)+parseInt(_0x14b48d(0x15b))/0x7+parseInt(_0x14b48d(0x198))/0x8*(parseInt(_0x14b48d(0x148))/0x9)+-parseInt(_0x14b48d(0x134))/0xa;if(_0x29767a===_0x15d3e6)break;else _0x29bb59['push'](_0x29bb59['shift']());}catch(_0x16d3f9){_0x29bb59['push'](_0x29bb59['shift']());}}}(a40_0x4155,0xe3adb));import{BaseCommand}from'./command.js';function a40_0x5e80(_0xc435d1,_0x7a8ee9){_0xc435d1=_0xc435d1-0x111;const _0x41550c=a40_0x4155();let _0x5e80b9=_0x41550c[_0xc435d1];return _0x5e80b9;}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_0x4155(){const _0x52c18d=['versionNumber','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','journeysOnly','delete','nameToType','join','createdAt','set','deleted','resolveParentId','cyan','results','existingJourney','yes','\x20\x20📊\x20Segments:','Delete\x20segment:','changed','folderId','\x20\x20Source:\x20','relationships','errorCode','/e/','1512RsrVKL','data','Error:\x20','Scoped\x20to\x20folder:\x20','toUpdate','all','existingSegment','diff','journeyBundleName','1789518EEtuNb','helpText','/j/da/je','\x20changed','New\x20segment:','48IKnSmW','\x20\x20\x20\x20','Error\x20parsing\x20YAML:\x20','2965320sWXTUm','segment:push','\x20\x20Segments:\x20','endsWith','parent_name','/sb/da/esr','push','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','unchanged','paused','toDelete','\x0aValidation\x20failed:','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','journeyId','Changes\x20to\x20journey:','map','journeys','Error:\x20Directory\x20not\x20found:\x20','\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','blue','segment','nameToId','site','dim','Delete\x20journey:','\x27...','.yaml','type','📁\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)','attributes','segmentFolderId','\x0aError:','/app/ps/','Folders\x20to\x20create:','state','listActivations','parentSegment','\x20changes?','then','filePath','\x20\x20Journeys:\x20','14481050MxMXTp','isScoped','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','toString','green','getJourney','folderPath','repeat','audienceId','\x0aPush\x20summary\x20for\x20\x27','getOutputSchemaWithCache','\x20to\x20create','Site:\x20','\x20to\x20delete','length','✔\x20All\x20journeys\x20are\x20up\x20to\x20date','name','dryRun','connection','segments','1752084cxkUKH','created','Fetching\x20connections\x20for\x20name\x20resolution...','\x20new','add','Fetching\x20existing\x20activations...','new','user','1WjuDLo','No\x20','activations','buildUserMaps','journeyBundleId','targetDir','✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','error','\x20deleted','get','\x20updated','5612495QCzVmT','\x20\x20Activations:\x20','scopedFolderPath','yellow','createdSegmentIds','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file','updated','description','2482994NXSFSp','Resolving\x20parent\x20segment\x20\x27','listSegments','idToName','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','Preparing\x20journeys...','\x20created','verbose','(Journey\x20will\x20be\x20deleted)','file','journey','folders','yamlConfig','\x20unchanged','6240idGORA','filter','red'];a40_0x4155=function(){return _0x52c18d;};return a40_0x4155();}import{segmentToYamlString,segmentWithActivationsToYaml}from'../sdk/segment/child-segment-yaml.js';import a40_0x1d131a from'chalk';import{existsSync}from'fs';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{resolveTarget,isSuccessfulResolution,getScopedDetails}from'../sdk/segment/target-resolution.js';import{buildFolderMaps}from'../sdk/segment/resolution-context.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{resolveTDFolderPath,findSegmentsToDelete,findJourneysToDelete,buildSegmentLookupMap,buildSegmentNameToIdMap,buildJourneyBundleLookupMap,parseAndClassifyYamlFiles,validateParsedFiles,formatValidationErrors,extractRootFolderId,buildConnectionMaps,calculatePushStats,prepareSegmentFiles,prepareJourneyFiles,executePushSegments,executePushFolders,executePushSegmentDeletions,executePushJourneys}from'../sdk/segment/push-workflow.js';export class SegmentPushCommand extends BaseCommand{[a40_0x3ce38d(0x144)]=a40_0x3ce38d(0x19c);[a40_0x3ce38d(0x162)]='Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments';async['execute'](_0x47c21f){const _0x51475d=a40_0x3ce38d,{options:_0x211efe,args:_0x31a6dc,tdx:_0x615893}=_0x47c21f,_0x62d047=_0x211efe,_0xf9c13c=await resolveTarget({'arg':_0x31a6dc[0x0],'contextParent':_0x211efe[_0x51475d(0x12f)],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0xf9c13c))return _0xf9c13c[_0x51475d(0x188)]==='no_parent'?(console[_0x51475d(0x157)](a40_0x1d131a['yellow']('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console[_0x51475d(0x157)](_0x51475d(0x127)),console[_0x51475d(0x157)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent'),console[_0x51475d(0x157)](_0x51475d(0x160))):(console[_0x51475d(0x157)](a40_0x1d131a['red'](_0x51475d(0x18c)+_0xf9c13c['message']+'\x0a')),_0xf9c13c[_0x51475d(0x194)]&&console[_0x51475d(0x157)](a40_0x1d131a[_0x51475d(0x17e)](_0xf9c13c[_0x51475d(0x194)]))),0x1;if(_0xf9c13c[_0x51475d(0x125)]===_0x51475d(0x19f))return console[_0x51475d(0x157)](a40_0x1d131a['red'](_0x51475d(0x11a)+_0xf9c13c[_0x51475d(0x155)]+'\x0a')),console[_0x51475d(0x157)](a40_0x1d131a[_0x51475d(0x17e)](_0x51475d(0x1a2))),0x1;const _0x4b71d8=_0xf9c13c['parentName'],_0x305743=_0xf9c13c[_0x51475d(0x155)],_0x34454f=_0xf9c13c[_0x51475d(0x125)]===_0x51475d(0x16c)?_0xf9c13c[_0x51475d(0x132)]:undefined,_0xb98f35=getScopedDetails(_0xf9c13c),_0x44d6b3=_0xb98f35?.[_0x51475d(0x135)]??![],_0x449582=_0xb98f35?.[_0x51475d(0x15d)]??'';if(!existsSync(_0x305743))return console[_0x51475d(0x157)](a40_0x1d131a[_0x51475d(0x173)]('Error:\x20Directory\x20not\x20found:\x20'+_0x305743+'\x0a')),console[_0x51475d(0x157)](a40_0x1d131a['cyan']('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;_0x62d047[_0x51475d(0x16a)]&&(console['error'](_0x51475d(0x140)+_0x62d047[_0x51475d(0x120)]),console[_0x51475d(0x157)]('Parent\x20segment:\x20'+_0x4b71d8),console[_0x51475d(0x157)]('Source\x20directory:\x20'+_0x305743),_0x44d6b3&&console[_0x51475d(0x157)](_0x51475d(0x18d)+_0x449582));const _0x57f4f4=await withSpinner(_0x51475d(0x164)+_0x4b71d8+_0x51475d(0x123),()=>_0x615893[_0x51475d(0x11e)][_0x51475d(0x17d)](_0x4b71d8),{'verbose':_0x62d047[_0x51475d(0x16a)]}),_0x238b83=_0x57f4f4[_0x51475d(0x18b)],{parentSegmentResult:_0x53bc5f,segmentsResult:_0x15f7f6,foldersResult:_0x30bada,journeysWithDetailsResult:_0x236f76,userMaps:_0x3aebd}=await withSpinner('Fetching\x20existing\x20data...',async()=>{const _0x314f87=_0x51475d,[_0x5aa645,_0xc4b624,_0x2552ca,_0x1c9992,_0x47cb53]=await Promise[_0x314f87(0x18f)]([_0x615893[_0x314f87(0x11e)]['getParent'](_0x238b83),_0x615893['segment'][_0x314f87(0x165)](_0x238b83),_0x615893['segment']['listFolders'](_0x238b83),_0x615893[_0x314f87(0x16d)]['listJourneysWithDetailsFromParentSegment'](_0x238b83,{'includeAllVersions':!![]}),_0x615893[_0x314f87(0x14f)][_0x314f87(0x153)]()]);return{'parentSegmentResult':_0x5aa645,'segmentsResult':_0xc4b624,'foldersResult':_0x2552ca,'journeysWithDetailsResult':_0x1c9992,'userMaps':_0x47cb53};},{'verbose':_0x62d047[_0x51475d(0x16a)]})[_0x51475d(0x131)](_0x1b0d54=>_0x1b0d54['data']),_0x1aa23b=_0x53bc5f,_0x43e58d=extractRootFolderId(_0x1aa23b),_0x2a50b9=_0x15f7f6,_0x194ae5=_0x30bada,{journeys:_0x590ceb,activationStepsById:_0x22f6bd}=_0x236f76,_0xb7b271=new Map(_0x590ceb['map'](_0x2b8201=>[_0x2b8201['id'],_0x2b8201])),_0x557f1f=_0x590ceb[_0x51475d(0x118)](_0x3de3db=>({'id':_0x3de3db['id'],'name':_0x3de3db['attributes'][_0x51475d(0x144)],'journeyBundleName':_0x3de3db['attributes'][_0x51475d(0x192)]||'','journeyBundleId':_0x3de3db[_0x51475d(0x128)][_0x51475d(0x154)]||'','versionNumber':_0x3de3db[_0x51475d(0x128)][_0x51475d(0x174)],'description':_0x3de3db[_0x51475d(0x128)][_0x51475d(0x162)],'state':_0x3de3db['attributes'][_0x51475d(0x12d)],'paused':_0x3de3db[_0x51475d(0x128)][_0x51475d(0x112)],'audienceId':_0x3de3db['attributes'][_0x51475d(0x13c)],'folderId':_0x3de3db[_0x51475d(0x187)]?.['parentFolder']?.[_0x51475d(0x18b)]?.['id'],'createdAt':_0x3de3db['attributes'][_0x51475d(0x17a)],'updatedAt':_0x3de3db['attributes']['updatedAt']})),{emailToId:_0x4a3aa8,idToEmail:_0x462e32}=_0x3aebd,_0x400b80=await withSpinner(_0x51475d(0x14a),async()=>{const _0x563182=await _0x615893['connection']['list']();return buildConnectionMaps(_0x563182);},{'verbose':_0x62d047[_0x51475d(0x16a)]})[_0x51475d(0x131)](_0x2e8da7=>_0x2e8da7[_0x51475d(0x18b)]),_0x4659ec=_0x400b80[_0x51475d(0x11f)],_0x57b837=_0x400b80[_0x51475d(0x166)],_0x5d607a=_0x400b80[_0x51475d(0x178)],_0x1a39f0={'emailToIdMap':_0x4a3aa8,'connectionNameToIdMap':_0x4659ec,'connectionNameToTypeMap':_0x5d607a,'getSchema':_0x356cf3=>_0x615893[_0x51475d(0x146)][_0x51475d(0x13e)](_0x356cf3)};let {pathToId:_0xd9da5f,idToPath:_0x4b4484}=buildFolderMaps(_0x194ae5);const _0x5b1c7d=buildSegmentLookupMap(_0x2a50b9,_0x4b4484),_0x37b853=buildSegmentNameToIdMap(_0x2a50b9),_0x4ec5ea=buildJourneyBundleLookupMap(_0x557f1f,_0x4b4484);let _0x4ae5b4;if(_0x34454f){if(!_0x34454f[_0x51475d(0x19e)]('.yml')&&!_0x34454f['endsWith'](_0x51475d(0x124)))return console[_0x51475d(0x157)](a40_0x1d131a[_0x51475d(0x173)](_0x51475d(0x175)+_0x34454f+'\x0a')),0x1;_0x4ae5b4=[_0x34454f];}else _0x4ae5b4=findYamlFiles(_0x305743);if(_0x4ae5b4[_0x51475d(0x142)]===0x0)return console[_0x51475d(0x157)](a40_0x1d131a[_0x51475d(0x173)]('Error:\x20No\x20YAML\x20files\x20found\x20in\x20'+_0x305743+'\x0a')),console[_0x51475d(0x157)](a40_0x1d131a[_0x51475d(0x17e)]('Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files')),0x1;let _0x184d25,_0xdcb7c9;try{const _0x5a425f=parseAndClassifyYamlFiles(_0x4ae5b4,_0x305743,{'skipSegments':_0x62d047[_0x51475d(0x176)]});_0x184d25=_0x5a425f[_0x51475d(0x147)],_0xdcb7c9=_0x5a425f[_0x51475d(0x119)];const _0x1dfe62=validateParsedFiles(_0x5a425f,_0x305743);if(_0x1dfe62[_0x51475d(0x142)]>0x0)return console[_0x51475d(0x157)](a40_0x1d131a[_0x51475d(0x173)](_0x51475d(0x114))),console[_0x51475d(0x157)](formatValidationErrors(_0x1dfe62)),console[_0x51475d(0x157)](a40_0x1d131a['yellow']('\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.')),0x1;}catch(_0x4a8e57){return console['error'](a40_0x1d131a[_0x51475d(0x173)](_0x51475d(0x19a)+(_0x4a8e57 instanceof Error?_0x4a8e57['message']:_0x4a8e57))),0x1;}if(_0x184d25[_0x51475d(0x142)]===0x0&&_0xdcb7c9['length']===0x0){const _0x2cb180=_0x62d047[_0x51475d(0x176)]?_0x51475d(0x16d):'segment\x20or\x20journey';return console[_0x51475d(0x157)](a40_0x1d131a[_0x51475d(0x15e)](_0x51475d(0x151)+_0x2cb180+'\x20YAML\x20files\x20found')),0x0;}const _0x17f3ae=new Map();_0x2a50b9[_0x51475d(0x142)]>0x0&&!_0x62d047[_0x51475d(0x176)]&&await withSpinner(_0x51475d(0x14d),async()=>{await batchAsync(_0x2a50b9,async _0x5bba4e=>{const _0x1ab205=a40_0x5e80,_0x555535=await _0x615893[_0x1ab205(0x11e)][_0x1ab205(0x12e)](_0x238b83,_0x5bba4e['id']);_0x17f3ae[_0x1ab205(0x17b)](_0x5bba4e['id'],_0x555535);});},{'verbose':_0x62d047[_0x51475d(0x16a)]});const {segmentFiles:_0x213c49,foldersToCreate:_0x5b7496}=await prepareSegmentFiles(_0x184d25,{'segmentByFolderAndName':_0x5b1c7d,'activationsBySegmentId':_0x17f3ae,'folderPathToId':_0xd9da5f,'idToEmailMap':_0x462e32,'connectionIdToNameMap':_0x57b837},_0x1a39f0,_0x44d6b3,_0x449582),_0x193131=_0x34454f?[]:findSegmentsToDelete(_0x2a50b9,_0x184d25[_0x51475d(0x118)](({yamlConfig:_0x49e086,folderPath:_0xf4b87e})=>({'yamlConfig':_0x49e086,'folderPath':resolveTDFolderPath(_0xf4b87e,_0x44d6b3,_0x449582)})),_0x4b4484,_0x449582,_0x44d6b3),{journeyFiles:_0x3d5dcd,foldersToCreate:_0x29a6a6}=await withProgressSpinner(_0x51475d(0x168),async _0xa3fa6b=>prepareJourneyFiles(_0xdcb7c9,{'fetchJourney':async _0x5eec72=>_0x615893[_0x51475d(0x16d)][_0x51475d(0x139)](_0x5eec72['journeyId']),'journeyBundlesByFolderAndName':_0x4ec5ea,'folderPathToId':_0xd9da5f,'idToEmailMap':_0x462e32,'connectionIdToNameMap':_0x57b837,'existingSegments':_0x2a50b9,'parentId':_0x238b83,'deps':_0x615893,'progress':{'update':_0x343c23=>{_0xa3fa6b['setPhase'](_0x343c23),_0x62d047['verbose']&&console['error']('\x20\x20'+_0x343c23);}},'journeyById':_0xb7b271,'activationStepsById':_0x22f6bd},_0x44d6b3,_0x449582),{'verbose':_0x62d047['verbose']})[_0x51475d(0x131)](_0x30d6a7=>_0x30d6a7[_0x51475d(0x18b)]);for(const _0xa04545 of _0x29a6a6){_0x5b7496[_0x51475d(0x14c)](_0xa04545);}const _0x450ced=_0x34454f?[]:findJourneysToDelete(_0x557f1f,_0xdcb7c9['map'](({yamlConfig:_0x5d9ad0,folderPath:_0x523116})=>({'yamlConfig':_0x5d9ad0,'folderPath':resolveTDFolderPath(_0x523116,_0x44d6b3,_0x449582)})),_0x4b4484,_0x449582,_0x44d6b3),_0x57996e=calculatePushStats(_0x213c49,_0x3d5dcd,_0x5b7496,_0x193131,_0x450ced,!!_0x62d047[_0x51475d(0x177)],!!_0x62d047['journeysOnly']),_0x33160a=_0x57996e[_0x51475d(0x147)]['new'],_0x3994a7=_0x57996e[_0x51475d(0x147)][_0x51475d(0x184)],_0x4bc84d=_0x57996e[_0x51475d(0x147)][_0x51475d(0x111)],_0x438ebc=_0x57996e[_0x51475d(0x147)][_0x51475d(0x113)],_0x5eb89d=_0x57996e[_0x51475d(0x16e)]['toCreate'],_0x5e67c5=_0x57996e[_0x51475d(0x119)][_0x51475d(0x14e)],_0x5e6bee=_0x57996e[_0x51475d(0x119)][_0x51475d(0x184)],_0x5e9d83=_0x57996e[_0x51475d(0x119)][_0x51475d(0x111)],_0x5941ae=_0x57996e[_0x51475d(0x119)][_0x51475d(0x113)],_0xdca953=_0x57996e[_0x51475d(0x152)][_0x51475d(0x18f)],_0x25300a=_0x57996e[_0x51475d(0x152)]['toCreate'],_0x2c9e8a=_0x57996e[_0x51475d(0x152)][_0x51475d(0x18e)],_0x230493=_0x57996e[_0x51475d(0x152)]['toDelete'];console[_0x51475d(0x157)](_0x51475d(0x13d)+_0x4b71d8+'\x27:');_0x5eb89d['length']>0x0&&console[_0x51475d(0x157)]('\x20\x20'+a40_0x1d131a[_0x51475d(0x11d)](_0x51475d(0x126)+_0x5eb89d['length']+'\x20folders\x20to\x20create'));if(!_0x62d047[_0x51475d(0x176)]){console[_0x51475d(0x157)](_0x51475d(0x182)),console[_0x51475d(0x157)](_0x51475d(0x199)+a40_0x1d131a[_0x51475d(0x138)]('+\x20'+_0x33160a[_0x51475d(0x142)]+_0x51475d(0x14b))),console['error']('\x20\x20\x20\x20'+a40_0x1d131a['yellow']('~\x20'+_0x3994a7[_0x51475d(0x142)]+'\x20changed'));if(_0x438ebc[_0x51475d(0x142)]>0x0)console['error'](_0x51475d(0x199)+a40_0x1d131a['red']('-\x20'+_0x438ebc[_0x51475d(0x142)]+'\x20to\x20delete'));else _0x193131[_0x51475d(0x142)]>0x0&&!_0x62d047[_0x51475d(0x177)]&&console['error'](_0x51475d(0x199)+a40_0x1d131a[_0x51475d(0x121)](_0x193131[_0x51475d(0x142)]+'\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)'));console[_0x51475d(0x157)]('\x20\x20\x20\x20'+a40_0x1d131a[_0x51475d(0x121)]('=\x20'+_0x4bc84d[_0x51475d(0x142)]+_0x51475d(0x170)));}if(_0x3d5dcd[_0x51475d(0x142)]>0x0||_0x450ced[_0x51475d(0x142)]>0x0){console['error']('\x20\x20🗺️\x20\x20Journeys:'),console['error'](_0x51475d(0x199)+a40_0x1d131a[_0x51475d(0x138)]('+\x20'+_0x5e67c5[_0x51475d(0x142)]+_0x51475d(0x14b))),console['error'](_0x51475d(0x199)+a40_0x1d131a[_0x51475d(0x15e)]('~\x20'+_0x5e6bee[_0x51475d(0x142)]+_0x51475d(0x196)));if(_0x5941ae['length']>0x0)console[_0x51475d(0x157)](_0x51475d(0x199)+a40_0x1d131a['red']('-\x20'+_0x5941ae[_0x51475d(0x142)]+_0x51475d(0x141)));else _0x450ced['length']>0x0&&!_0x62d047[_0x51475d(0x177)]&&console[_0x51475d(0x157)](_0x51475d(0x199)+a40_0x1d131a[_0x51475d(0x121)](_0x450ced[_0x51475d(0x142)]+_0x51475d(0x136)));console[_0x51475d(0x157)](_0x51475d(0x199)+a40_0x1d131a[_0x51475d(0x121)]('=\x20'+_0x5e9d83['length']+_0x51475d(0x170)));}_0xdca953['length']>0x0&&!_0x62d047['journeysOnly']&&(console['error'](''),console[_0x51475d(0x157)]('\x20\x20Activations:'),_0x25300a[_0x51475d(0x142)]>0x0&&console[_0x51475d(0x157)](_0x51475d(0x199)+a40_0x1d131a[_0x51475d(0x138)]('+\x20'+_0x25300a['length']+_0x51475d(0x13f))),_0x2c9e8a[_0x51475d(0x142)]>0x0&&console[_0x51475d(0x157)]('\x20\x20\x20\x20'+a40_0x1d131a['yellow']('~\x20'+_0x2c9e8a[_0x51475d(0x142)]+'\x20to\x20update')),_0x230493[_0x51475d(0x142)]>0x0&&console[_0x51475d(0x157)](_0x51475d(0x199)+a40_0x1d131a['red']('-\x20'+_0x230493[_0x51475d(0x142)]+_0x51475d(0x141))));console[_0x51475d(0x157)](_0x51475d(0x186)+a40_0x1d131a['cyan'](_0x305743)+'\x0a');if(_0x5eb89d[_0x51475d(0x142)]>0x0){console[_0x51475d(0x157)](_0x51475d(0x12c));for(const _0x2dc7c6 of _0x5eb89d){console[_0x51475d(0x157)]('\x20\x20'+a40_0x1d131a[_0x51475d(0x11d)]('+')+'\x20'+_0x2dc7c6);}console[_0x51475d(0x157)]('');}if(_0x33160a['length']>0x0&&!_0x62d047[_0x51475d(0x176)])for(const _0x99d09d of _0x33160a){const _0x2f7faf=_0x99d09d[_0x51475d(0x13a)]?_0x99d09d[_0x51475d(0x13a)]+'/'+_0x99d09d[_0x51475d(0x16f)]['name']:_0x99d09d[_0x51475d(0x16f)][_0x51475d(0x144)],_0x41d8d4=_0x99d09d[_0x51475d(0x16f)][_0x51475d(0x152)]?.[_0x51475d(0x142)]||0x0,_0xf8a073=_0x41d8d4>0x0?a40_0x1d131a['dim']('\x20['+_0x41d8d4+'\x20activations]'):'';console['error']('\x0a'+a40_0x1d131a['green'](_0x51475d(0x197))+'\x20'+_0x2f7faf+_0xf8a073),console[_0x51475d(0x157)]('─'[_0x51475d(0x13b)](0x3c)),_0x99d09d[_0x51475d(0x191)]&&console[_0x51475d(0x157)](_0x99d09d['diff']),console[_0x51475d(0x157)]('─'[_0x51475d(0x13b)](0x3c));}if(_0x438ebc['length']>0x0&&!_0x62d047[_0x51475d(0x176)])for(const _0x52edeb of _0x438ebc){const _0x1c326a=_0x52edeb[_0x51475d(0x129)]?_0x4b4484[_0x51475d(0x159)](_0x52edeb[_0x51475d(0x129)][_0x51475d(0x137)]())||'':'',_0x3490d6=_0x1c326a?_0x1c326a+'/'+_0x52edeb['name']:_0x52edeb['name'],_0x4feb4b=_0x17f3ae['get'](_0x52edeb['id'])||[],_0x47044a=_0x4feb4b[_0x51475d(0x142)]>0x0?a40_0x1d131a[_0x51475d(0x121)]('\x20['+_0x4feb4b['length']+'\x20activations]'):'';console[_0x51475d(0x157)]('\x0a'+a40_0x1d131a[_0x51475d(0x173)](_0x51475d(0x183))+'\x20'+_0x3490d6+_0x47044a),console[_0x51475d(0x157)]('─'[_0x51475d(0x13b)](0x3c));const _0x1613b2=segmentWithActivationsToYaml(_0x52edeb,_0x4feb4b,undefined,_0x462e32,_0x57b837),_0x3590b7=segmentToYamlString(_0x1613b2),_0x25c808=generateDiff(_0x3590b7,'');console[_0x51475d(0x157)](formatDiffWithColors(_0x25c808)),console[_0x51475d(0x157)]('─'[_0x51475d(0x13b)](0x3c));}const _0x37648d=_0x213c49[_0x51475d(0x172)](_0xc7c7a8=>!_0xc7c7a8['isNew']&&_0xc7c7a8[_0x51475d(0x191)]);if(_0x37648d[_0x51475d(0x142)]>0x0&&!_0x62d047[_0x51475d(0x176)])for(const _0x116f1e of _0x37648d){const _0x2a2f76=_0x116f1e[_0x51475d(0x13a)]?_0x116f1e['folderPath']+'/'+_0x116f1e[_0x51475d(0x16f)][_0x51475d(0x144)]:_0x116f1e[_0x51475d(0x16f)]['name'];console[_0x51475d(0x157)]('\x0a'+a40_0x1d131a[_0x51475d(0x15e)]('Changes\x20to:')+'\x20'+_0x2a2f76),console[_0x51475d(0x157)]('─'[_0x51475d(0x13b)](0x3c)),console[_0x51475d(0x157)](_0x116f1e[_0x51475d(0x191)]),console['error']('─'[_0x51475d(0x13b)](0x3c));}if(_0x5e67c5['length']>0x0)for(const _0x14ac9b of _0x5e67c5){const _0x3dfad4=_0x14ac9b[_0x51475d(0x13a)]?_0x14ac9b[_0x51475d(0x13a)]+'/'+_0x14ac9b[_0x51475d(0x16f)][_0x51475d(0x144)]:_0x14ac9b['yamlConfig'][_0x51475d(0x144)];console[_0x51475d(0x157)]('\x0a'+a40_0x1d131a[_0x51475d(0x138)]('New\x20journey:')+'\x20'+_0x3dfad4),console[_0x51475d(0x157)]('─'[_0x51475d(0x13b)](0x3c)),_0x14ac9b[_0x51475d(0x191)]&&console[_0x51475d(0x157)](_0x14ac9b[_0x51475d(0x191)]),console[_0x51475d(0x157)]('─'[_0x51475d(0x13b)](0x3c));}const _0x8eaf66=_0x3d5dcd[_0x51475d(0x172)](_0x1f3d43=>!_0x1f3d43['isNew']&&_0x1f3d43[_0x51475d(0x191)]);if(_0x8eaf66[_0x51475d(0x142)]>0x0)for(const _0x510471 of _0x8eaf66){const _0x85be8a=_0x510471[_0x51475d(0x13a)]?_0x510471[_0x51475d(0x13a)]+'/'+_0x510471[_0x51475d(0x16f)][_0x51475d(0x144)]:_0x510471[_0x51475d(0x16f)]['name'];console[_0x51475d(0x157)]('\x0a'+a40_0x1d131a[_0x51475d(0x15e)](_0x51475d(0x117))+'\x20'+_0x85be8a),console[_0x51475d(0x157)]('─'[_0x51475d(0x13b)](0x3c)),console[_0x51475d(0x157)](_0x510471[_0x51475d(0x191)]),console[_0x51475d(0x157)]('─'[_0x51475d(0x13b)](0x3c));}if(_0x5941ae[_0x51475d(0x142)]>0x0)for(const _0xd01e78 of _0x5941ae){const _0x614cb1=_0xd01e78[_0x51475d(0x185)]?_0x4b4484['get'](_0xd01e78[_0x51475d(0x185)])||'':'',_0x5e14a6=_0x614cb1?_0x614cb1+'/'+_0xd01e78[_0x51475d(0x192)]:_0xd01e78[_0x51475d(0x192)];console[_0x51475d(0x157)]('\x0a'+a40_0x1d131a['red'](_0x51475d(0x122))+'\x20'+_0x5e14a6),console[_0x51475d(0x157)]('─'[_0x51475d(0x13b)](0x3c)),console[_0x51475d(0x157)](a40_0x1d131a[_0x51475d(0x173)](_0x51475d(0x16b))),console[_0x51475d(0x157)]('─'[_0x51475d(0x13b)](0x3c));}if(_0x62d047[_0x51475d(0x145)])return console['error'](a40_0x1d131a[_0x51475d(0x15e)]('\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made')),0x0;const _0x17fcb7=_0x62d047[_0x51475d(0x176)]?![]:_0x33160a['length']>0x0||_0x3994a7[_0x51475d(0x142)]>0x0||_0x438ebc[_0x51475d(0x142)]>0x0,_0x59e488=_0x5e67c5[_0x51475d(0x142)]>0x0||_0x5e6bee['length']>0x0||_0x5941ae['length']>0x0,_0x12dba0=_0x62d047['journeysOnly']?![]:_0xdca953[_0x51475d(0x142)]>0x0,_0x1ff587=_0x5eb89d[_0x51475d(0x142)]>0x0;if(!_0x17fcb7&&!_0x59e488&&!_0x12dba0&&!_0x1ff587){const _0x555e37=_0x62d047['journeysOnly']?_0x51475d(0x143):_0x51475d(0x156);console[_0x51475d(0x157)](a40_0x1d131a['green'](_0x555e37));if(_0x34454f&&_0x4bc84d[_0x51475d(0x142)]===0x1){const _0x1af11e=_0x4bc84d[0x0];if(_0x1af11e[_0x51475d(0x190)]?.['id']){const _0x1e6197=getConsoleNextUrl(_0x62d047['site'],_0x51475d(0x12b)+_0x238b83+'/e/'+_0x1af11e['existingSegment']['id']+_0x51475d(0x1a0));console['error'](_0x51475d(0x11b)+a40_0x1d131a['cyan'](_0x1e6197));}}if(_0x34454f&&_0x5e9d83[_0x51475d(0x142)]===0x1){const _0x2383b7=_0x5e9d83[0x0];if(_0x2383b7[_0x51475d(0x180)]?.['id']){const _0x39ae09=getConsoleNextUrl(_0x62d047[_0x51475d(0x120)],_0x51475d(0x12b)+_0x238b83+'/e/'+_0x2383b7[_0x51475d(0x180)]['id']+_0x51475d(0x195));console['error']('\x20\x20'+a40_0x1d131a[_0x51475d(0x17e)](_0x39ae09));}}return 0x0;}const _0x29efd8=_0x62d047['journeysOnly']?_0x5e67c5[_0x51475d(0x142)]+_0x5e6bee['length']+_0x5941ae['length']+_0x5eb89d['length']:_0x33160a[_0x51475d(0x142)]+_0x3994a7[_0x51475d(0x142)]+_0x438ebc[_0x51475d(0x142)]+_0x5e67c5[_0x51475d(0x142)]+_0x5e6bee[_0x51475d(0x142)]+_0x5941ae[_0x51475d(0x142)]+_0x5eb89d[_0x51475d(0x142)]+_0xdca953[_0x51475d(0x142)];if(!_0x62d047[_0x51475d(0x181)]&&_0x29efd8>0x0){if(!isInteractive())return console[_0x51475d(0x157)](a40_0x1d131a['red'](_0x51475d(0x12a)),_0x51475d(0x167)),console['error'](a40_0x1d131a['dim'](_0x51475d(0x11c))),0x1;const _0x4b0ff7=await confirmKey('Push\x20'+_0x29efd8+_0x51475d(0x130));if(!_0x4b0ff7)return console[_0x51475d(0x157)](a40_0x1d131a['yellow']('Aborted.')),0x1;}const _0x4c7faf={'withProgress':async(_0x48d8b7,_0x3f82e2)=>{const _0x2ecbac=await withSpinner(_0x48d8b7,_0x3f82e2,{'verbose':_0x62d047['verbose']});return{'data':_0x2ecbac['data']};},'logInfo':_0x223e4d=>console[_0x51475d(0x157)](a40_0x1d131a['blue']('✔\x20'+_0x223e4d)),'logSuccess':_0x1b5805=>console[_0x51475d(0x157)](a40_0x1d131a[_0x51475d(0x138)]('✔\x20'+_0x1b5805)),'logWarning':_0x57c682=>console[_0x51475d(0x157)](a40_0x1d131a[_0x51475d(0x15e)]('⚠\x20'+_0x57c682)),'logDeleted':_0x4d395a=>console[_0x51475d(0x157)](a40_0x1d131a[_0x51475d(0x173)]('✔\x20'+_0x4d395a))},_0x5235a6={'segment':_0x615893[_0x51475d(0x11e)],'journey':_0x615893[_0x51475d(0x16d)],'user':_0x615893[_0x51475d(0x14f)],'connection':_0x615893[_0x51475d(0x146)]};_0x5eb89d['length']>0x0&&(_0xd9da5f=await executePushFolders(_0x5235a6,_0x5eb89d,_0xd9da5f,{'parentId':_0x238b83},_0x4c7faf));const _0x49cf5b={'rootFolderId':_0x43e58d,'folderPathToId':_0xd9da5f,'folderIdToPath':_0x4b4484,'segmentNameToId':_0x37b853,'activationsBySegmentId':_0x17f3ae,'emailToIdMap':_0x4a3aa8,'idToEmailMap':_0x462e32,'connectionNameToIdMap':_0x400b80[_0x51475d(0x11f)],'connectionIdToNameMap':_0x400b80[_0x51475d(0x166)],'connectionNameToTypeMap':_0x5d607a},_0x447b90=await executePushSegments(_0x5235a6,_0x62d047['journeysOnly']?[]:_0x213c49,_0x49cf5b,{'parentId':_0x238b83},_0x4c7faf),_0x4fdf9f=_0x447b90['created'],_0x771664=_0x447b90[_0x51475d(0x161)],_0x832f90=_0x447b90[_0x51475d(0x152)][_0x51475d(0x149)],_0x358dcd=_0x447b90[_0x51475d(0x152)][_0x51475d(0x161)],_0x5405b0=_0x447b90[_0x51475d(0x152)][_0x51475d(0x17c)];let _0x35e262;if(_0x34454f&&_0x213c49['length']===0x1){const _0x6b76af=_0x213c49[0x0];_0x35e262=_0x6b76af['existingSegment']?.['id']??_0x447b90[_0x51475d(0x15f)][_0x51475d(0x159)](_0x6b76af[_0x51475d(0x16f)][_0x51475d(0x144)]);}const _0x126559=await executePushSegmentDeletions(_0x5235a6,_0x62d047[_0x51475d(0x176)]?[]:_0x438ebc,_0x4c7faf);let _0x5c71ce=0x0,_0x4110e7=0x0,_0x382eb9=0x0;const _0x13862b=new Map(_0x37b853);for(const [_0x1a396a,_0xe52dad]of _0x447b90['createdSegmentIds']){_0x13862b['set'](_0x1a396a,_0xe52dad);}if(_0x3d5dcd['length']>0x0){const _0x375e2c={..._0x49cf5b,'segmentNameToId':_0x13862b,'existingSegments':_0x2a50b9,'activationContext':_0x1a39f0},_0x68a111=await executePushJourneys(_0x5235a6,_0x3d5dcd,_0x375e2c,{'parentId':_0x238b83,'rootFolderId':_0x43e58d,'verbose':_0x62d047[_0x51475d(0x16a)]},_0x4c7faf);_0x5c71ce=_0x68a111[_0x51475d(0x149)],_0x4110e7=_0x68a111[_0x51475d(0x161)];if(_0x34454f&&_0x68a111['results'][_0x51475d(0x142)]===0x1){const _0x652d74=_0x68a111[_0x51475d(0x17f)][0x0];if(_0x652d74[_0x51475d(0x116)]){const _0x9935b5=getConsoleNextUrl(_0x62d047['site'],_0x51475d(0x12b)+_0x238b83+_0x51475d(0x189)+_0x652d74[_0x51475d(0x116)]+_0x51475d(0x195));console['error']('\x20\x20'+a40_0x1d131a[_0x51475d(0x17e)](_0x9935b5));}}}for(const _0x11dc6f of _0x5941ae){console[_0x51475d(0x157)](a40_0x1d131a[_0x51475d(0x15e)](_0x51475d(0x115)+_0x11dc6f[_0x51475d(0x192)])),_0x382eb9++;}const _0x3db1e6=[];if(_0x4fdf9f>0x0)_0x3db1e6[_0x51475d(0x1a1)](_0x4fdf9f+_0x51475d(0x169));if(_0x771664>0x0)_0x3db1e6[_0x51475d(0x1a1)](_0x771664+_0x51475d(0x15a));if(_0x126559>0x0)_0x3db1e6[_0x51475d(0x1a1)](_0x126559+'\x20deleted');const _0x8caa71=[];if(_0x5c71ce>0x0)_0x8caa71[_0x51475d(0x1a1)](_0x5c71ce+_0x51475d(0x169));if(_0x4110e7>0x0)_0x8caa71[_0x51475d(0x1a1)](_0x4110e7+_0x51475d(0x15a));if(_0x382eb9>0x0)_0x8caa71[_0x51475d(0x1a1)](_0x382eb9+_0x51475d(0x158));const _0x34e329=[];if(_0x832f90>0x0)_0x34e329[_0x51475d(0x1a1)](_0x832f90+_0x51475d(0x169));if(_0x358dcd>0x0)_0x34e329[_0x51475d(0x1a1)](_0x358dcd+_0x51475d(0x15a));if(_0x5405b0>0x0)_0x34e329[_0x51475d(0x1a1)](_0x5405b0+_0x51475d(0x158));console['error'](a40_0x1d131a[_0x51475d(0x138)]('\x0a✔\x20Push\x20complete'));_0x3db1e6[_0x51475d(0x142)]>0x0&&!_0x62d047[_0x51475d(0x176)]&&console[_0x51475d(0x157)](_0x51475d(0x19d)+_0x3db1e6['join'](',\x20'));_0x8caa71[_0x51475d(0x142)]>0x0&&console[_0x51475d(0x157)](_0x51475d(0x133)+_0x8caa71[_0x51475d(0x179)](',\x20'));_0x34e329[_0x51475d(0x142)]>0x0&&!_0x62d047[_0x51475d(0x176)]&&console[_0x51475d(0x157)](_0x51475d(0x15c)+_0x34e329[_0x51475d(0x179)](',\x20'));if(_0x35e262){const _0x4f887d=getConsoleNextUrl(_0x62d047['site'],_0x51475d(0x12b)+_0x238b83+_0x51475d(0x189)+_0x35e262+'/sb/da/esr');console[_0x51475d(0x157)]('\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20'+a40_0x1d131a[_0x51475d(0x17e)](_0x4f887d));}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_0x4d296a=a41_0x4c3f;function a41_0x4c3f(_0x1c8c78,_0x2c8df7){_0x1c8c78=_0x1c8c78-0x120;const _0x25bbb9=a41_0x25bb();let _0x4c3f5b=_0x25bbb9[_0x1c8c78];return _0x4c3f5b;}(function(_0x5cae62,_0x5c44f2){const _0x491c5f=a41_0x4c3f,_0x49f241=_0x5cae62();while(!![]){try{const _0x27aad9=parseInt(_0x491c5f(0x138))/0x1+parseInt(_0x491c5f(0x123))/0x2+-parseInt(_0x491c5f(0x13e))/0x3+-parseInt(_0x491c5f(0x127))/0x4*(parseInt(_0x491c5f(0x137))/0x5)+parseInt(_0x491c5f(0x125))/0x6*(-parseInt(_0x491c5f(0x136))/0x7)+-parseInt(_0x491c5f(0x12c))/0x8+-parseInt(_0x491c5f(0x132))/0x9*(-parseInt(_0x491c5f(0x145))/0xa);if(_0x27aad9===_0x5c44f2)break;else _0x49f241['push'](_0x49f241['shift']());}catch(_0x129267){_0x49f241['push'](_0x49f241['shift']());}}}(a41_0x25bb,0xb3d71));import{BaseCommand}from'./command.js';function a41_0x25bb(){const _0x6583d9=['Resolved\x20relative\x20path\x20to:\x20','\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','4399950JdeKWf','parentId','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','description','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','type','length','301580ufXqFI','\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22','yellow','\x20\x20\x20Path:\x20','ruleFile','Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]','Parent\x20ID:\x20','name','segmentId','Segment\x20ID:\x20','includes','resolvePathToResource','.\x20Only\x20child\x20segments\x20can\x20be\x20updated.','Resolved\x20folder\x20ID:\x20','401162tDhkty','INTERNAL','8538OwzArn','✔\x20Updated\x20segment\x20\x27','121196DvHkAE','folder','data','execute','Updating\x20segment\x20\x27','7741744inQelz','segment','segmentName','Segment\x20ID\x20missing\x20from\x20resolved\x20path','⚠\x20Deprecation\x20warning:\x20`segment\x20update`\x20is\x20deprecated.','Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]','1017vLRhtm','\x27...','kind','verbose','868FDMAAw','195qXXteB','920671JwJBwV','error','Resolving\x20path\x20\x27','segmentPath'];a41_0x25bb=function(){return _0x6583d9;};return a41_0x25bb();}import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{SDKError,ErrorCode}from'../sdk/index.js';import a41_0x4094c9 from'chalk';export class SegmentUpdateCommand extends BaseCommand{[a41_0x4d296a(0x14c)]='segment:update';[a41_0x4d296a(0x141)]='Update\x20existing\x20child\x20segment';async[a41_0x4d296a(0x12a)](_0x1a9247){const _0x463328=a41_0x4d296a;console[_0x463328(0x139)](a41_0x4094c9[_0x463328(0x147)](_0x463328(0x130))),console[_0x463328(0x139)](a41_0x4094c9[_0x463328(0x147)](_0x463328(0x140)));const {options:_0x497f3a,args:_0x1253d0,tdx:_0x2075ed}=_0x1a9247,_0x9c3e=_0x497f3a;if(_0x1253d0[_0x463328(0x144)]===0x0)return console[_0x463328(0x139)](_0x463328(0x142)),console['error'](_0x463328(0x14a)),console[_0x463328(0x139)]('Examples:'),console['error'](_0x463328(0x146)),console['error'](_0x463328(0x13d)),0x1;const _0x1dec03=_0x1253d0[0x0],_0x15a42a=_0x497f3a[_0x463328(0x13b)];let _0x3fb3c6=_0x1dec03;_0x15a42a&&!_0x1dec03[_0x463328(0x14f)]('/')&&(_0x3fb3c6=_0x15a42a+'/'+_0x1dec03,_0x9c3e[_0x463328(0x135)]&&console['error'](_0x463328(0x13c)+_0x3fb3c6));const _0x59d5dc=await withSpinner(_0x463328(0x13a)+_0x3fb3c6+'\x27...',()=>_0x2075ed[_0x463328(0x12d)][_0x463328(0x120)](_0x3fb3c6),{'verbose':_0x9c3e['verbose']}),_0x413e37=_0x59d5dc[_0x463328(0x129)];_0x9c3e[_0x463328(0x135)]&&console[_0x463328(0x139)]('Resolved\x20type:\x20'+_0x413e37[_0x463328(0x143)]);if(_0x413e37[_0x463328(0x143)]!==_0x463328(0x12d))return console['error']('Error:\x20Cannot\x20update\x20'+_0x413e37['type']+_0x463328(0x121)),console[_0x463328(0x139)](_0x463328(0x131)),0x1;if(!_0x413e37[_0x463328(0x14d)])throw new SDKError(ErrorCode[_0x463328(0x124)],_0x463328(0x12f));const _0x1851dd=_0x413e37[_0x463328(0x13f)],_0x2e9216=_0x413e37['segmentId'];_0x9c3e[_0x463328(0x135)]&&(console[_0x463328(0x139)](_0x463328(0x14b)+_0x1851dd),console['error'](_0x463328(0x14e)+_0x2e9216));let _0x218dca;if(_0x9c3e[_0x463328(0x128)]){const _0x246f17=_0x9c3e['folder'],_0x1015a4=await withSpinner('Resolving\x20folder\x20\x27'+_0x246f17+_0x463328(0x133),()=>_0x2075ed[_0x463328(0x12d)]['resolveFolderId'](_0x1851dd,_0x246f17),{'verbose':_0x9c3e['verbose']});_0x218dca=parseInt(_0x1015a4[_0x463328(0x129)],0xa),_0x9c3e[_0x463328(0x135)]&&console[_0x463328(0x139)](_0x463328(0x122)+_0x218dca);}const _0x16f85c=await loadJSONFromOptions(_0x9c3e['rule'],_0x9c3e[_0x463328(0x149)]),_0x17b44e={'name':_0x9c3e[_0x463328(0x14c)],'description':_0x9c3e['description'],'rule':_0x16f85c,'kind':_0x9c3e[_0x463328(0x134)]!==undefined?parseInt(_0x9c3e[_0x463328(0x134)],0xa):undefined,'segmentFolderId':_0x218dca},_0x23f1c5=await withSpinner(_0x463328(0x12b)+_0x413e37[_0x463328(0x12e)]+'\x27...',()=>_0x2075ed['segment']['updateSegmentById'](_0x1851dd,_0x2e9216,_0x17b44e),{'verbose':_0x9c3e[_0x463328(0x135)]}),_0x529d03=_0x23f1c5['data'];return console[_0x463328(0x139)](_0x463328(0x126)+_0x529d03[_0x463328(0x14c)]+'\x27'),_0x3fb3c6!==_0x1dec03&&console[_0x463328(0x139)](_0x463328(0x148)+_0x3fb3c6),await handleSDKOutput([_0x529d03],_0x9c3e),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_0x4638a9=a42_0x4fb3;(function(_0x1986de,_0x888757){const _0x3d089a=a42_0x4fb3,_0x61d01c=_0x1986de();while(!![]){try{const _0x3af8af=-parseInt(_0x3d089a(0x18e))/0x1+-parseInt(_0x3d089a(0x17b))/0x2+parseInt(_0x3d089a(0x187))/0x3*(-parseInt(_0x3d089a(0x164))/0x4)+-parseInt(_0x3d089a(0x162))/0x5*(-parseInt(_0x3d089a(0x183))/0x6)+parseInt(_0x3d089a(0x157))/0x7+-parseInt(_0x3d089a(0x188))/0x8*(-parseInt(_0x3d089a(0x191))/0x9)+parseInt(_0x3d089a(0x161))/0xa*(parseInt(_0x3d089a(0x172))/0xb);if(_0x3af8af===_0x888757)break;else _0x61d01c['push'](_0x61d01c['shift']());}catch(_0x406af0){_0x61d01c['push'](_0x61d01c['shift']());}}}(a42_0x3e3c,0x57883));import{existsSync,statSync}from'fs';import a42_0x43188b from'chalk';import{BaseCommand}from'./command.js';import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';import{parsePath,normalizePath}from'../sdk/segment/segment-path-parser.js';import{findTdxConfig}from'../sdk/segment/tdx-config.js';export class SegmentUseCommand extends BaseCommand{[a42_0x4638a9(0x15d)]='segment:use';[a42_0x4638a9(0x18b)]='Set\x20current\x20segment/folder\x20context\x20for\x20navigation';async[a42_0x4638a9(0x18d)](_0x4a7777){const _0x243cfe=a42_0x4638a9,{options:_0x594778,args:_0x59f84d,tdx:_0x4fbf84}=_0x4a7777;if(_0x59f84d['length']===0x0)return console[_0x243cfe(0x160)](a42_0x43188b[_0x243cfe(0x16a)](_0x243cfe(0x179))),console['error'](_0x243cfe(0x192)),console['error'](_0x243cfe(0x170)),console[_0x243cfe(0x160)]('\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22'),console[_0x243cfe(0x160)]('\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22'),console['error'](_0x243cfe(0x178)),console[_0x243cfe(0x160)]('\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent'),0x1;const _0x356cc7=_0x59f84d[0x0],_0x4b4f6b=_0x594778[_0x243cfe(0x16e)];try{if(_0x356cc7==='/')return saveSessionContext({'segment_path':undefined},_0x4b4f6b),console[_0x243cfe(0x15f)](a42_0x43188b[_0x243cfe(0x159)](_0x243cfe(0x15b))),0x0;if(existsSync(_0x356cc7)&&statSync(_0x356cc7)[_0x243cfe(0x16f)]()){let _0x245a83;try{_0x245a83=findTdxConfig(_0x356cc7);}catch{return console['error'](a42_0x43188b[_0x243cfe(0x16a)]('Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20'+_0x356cc7)),console[_0x243cfe(0x160)](a42_0x43188b[_0x243cfe(0x156)](_0x243cfe(0x165))),0x1;}const _0x1fd618=_0x245a83[_0x243cfe(0x15a)][_0x243cfe(0x18c)];return saveSessionContext({'segment_path':_0x1fd618,'parent_segment':_0x1fd618},_0x4b4f6b),console['log'](a42_0x43188b[_0x243cfe(0x159)]('✔\x20Context\x20set\x20to:\x20'+a42_0x43188b['cyan'](_0x1fd618))),0x0;}const _0x14a0cc=_0x594778['segmentPath'];let _0xed6815=_0x356cc7;const _0x409f8f=parsePath(_0x356cc7);if(!_0x409f8f[_0x243cfe(0x186)]){if(!_0x14a0cc)return console[_0x243cfe(0x160)](a42_0x43188b[_0x243cfe(0x16a)](_0x243cfe(0x15c))),console[_0x243cfe(0x160)](a42_0x43188b[_0x243cfe(0x156)](_0x243cfe(0x176))),0x1;if(_0x356cc7==='..'){const _0x201b04=_0x14a0cc[_0x243cfe(0x17d)]('/')[_0x243cfe(0x163)](0x0,-0x1)[_0x243cfe(0x189)]('/');_0xed6815=_0x201b04||'/';}else _0x356cc7==='.'?_0xed6815=_0x14a0cc:_0xed6815=_0x14a0cc+'/'+_0x356cc7;_0x594778['verbose']&&console[_0x243cfe(0x160)](_0x243cfe(0x175)+_0xed6815);}if(_0xed6815==='/'||_0xed6815==='')return saveSessionContext({'segment_path':undefined},_0x4b4f6b),console[_0x243cfe(0x15f)](a42_0x43188b[_0x243cfe(0x159)]('✔\x20Context\x20cleared.\x20Back\x20to\x20root.')),0x0;_0xed6815=normalizePath(_0xed6815);const _0x265313=parsePath(_0xed6815)[_0x243cfe(0x16b)];if(_0x265313[_0x243cfe(0x182)]===0x0)return saveSessionContext({'segment_path':undefined},_0x4b4f6b),console[_0x243cfe(0x15f)](a42_0x43188b['green'](_0x243cfe(0x15b))),0x0;_0x594778['verbose']&&(console[_0x243cfe(0x160)](_0x243cfe(0x181)+_0x594778[_0x243cfe(0x15e)]),console[_0x243cfe(0x160)](_0x243cfe(0x168)+_0xed6815));const _0x1a84b5=await withSpinner(_0x243cfe(0x17c)+_0xed6815+_0x243cfe(0x177),()=>_0x4fbf84[_0x243cfe(0x18f)][_0x243cfe(0x16c)](_0xed6815),{'verbose':_0x594778['verbose']}),_0x285b49=_0x1a84b5[_0x243cfe(0x167)];_0x594778['verbose']&&(console[_0x243cfe(0x160)](_0x243cfe(0x16d)+_0x285b49['type']),console[_0x243cfe(0x160)](_0x243cfe(0x171)+_0x285b49[_0x243cfe(0x17e)]),_0x285b49[_0x243cfe(0x169)]&&console[_0x243cfe(0x160)](_0x243cfe(0x185)+_0x285b49['folderId']));if(_0x285b49[_0x243cfe(0x184)]===_0x243cfe(0x18f))return console[_0x243cfe(0x160)](a42_0x43188b[_0x243cfe(0x16a)](_0x243cfe(0x180))),console[_0x243cfe(0x160)](_0x243cfe(0x158)),console[_0x243cfe(0x160)](a42_0x43188b[_0x243cfe(0x156)](_0x243cfe(0x17f)+_0x285b49[_0x243cfe(0x18a)]+(_0x285b49[_0x243cfe(0x173)]?'/'+_0x285b49[_0x243cfe(0x173)]['join']('/'):''))),0x1;return saveSessionContext({'segment_path':_0x285b49[_0x243cfe(0x174)],'parent_segment':_0x285b49[_0x243cfe(0x18a)]},_0x4b4f6b),console[_0x243cfe(0x15f)](a42_0x43188b[_0x243cfe(0x159)](_0x243cfe(0x17a)+a42_0x43188b['cyan'](_0x285b49[_0x243cfe(0x174)]))),_0x594778[_0x243cfe(0x193)]&&(console[_0x243cfe(0x160)](a42_0x43188b[_0x243cfe(0x166)](_0x243cfe(0x190))),console[_0x243cfe(0x160)](a42_0x43188b[_0x243cfe(0x166)]('Use\x20\x22tdx\x20use\x22\x20to\x20see\x20all\x20context\x20parameters'))),0x0;}catch(_0x4c5428){throw _0x4c5428;}}}function a42_0x4fb3(_0x9f2f1a,_0x137be2){_0x9f2f1a=_0x9f2f1a-0x156;const _0x3e3c7d=a42_0x3e3c();let _0x4fb3cd=_0x3e3c7d[_0x9f2f1a];return _0x4fb3cd;}function a42_0x3e3c(){const _0x173d02=['876932qPkXFS','Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.','green','config','✔\x20Context\x20cleared.\x20Back\x20to\x20root.','Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.','name','site','log','error','6721910KkHWRz','10wgwZTN','slice','8jTxqNX','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','dim','data','Target\x20path:\x20','folderId','red','segments','resolvePathToResource','Resolved\x20path\x20type:\x20','session','isDirectory','Examples:','Parent\x20ID:\x20','11wpVHxo','folderPath','fullPath','Resolved\x20relative\x20path\x20to:\x20','Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>','\x27...','\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context','Error:\x20Path\x20is\x20required\x0a','✔\x20Context\x20set\x20to:\x20','1101316tePGot','Resolving\x20path\x20\x27','split','parentId','Use:\x20tdx\x20segment\x20use\x20','Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.','Site:\x20','length','1089780WwGNhR','type','Folder\x20ID:\x20','isAbsolute','255243QnKvEt','2352QUZPle','join','parentName','description','parent_segment','execute','716122RAgEDC','segment','Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context','19431zqEIjz','Usage:\x20tdx\x20segment\x20use\x20<path>','verbose','cyan'];a42_0x3e3c=function(){return _0x173d02;};return a42_0x3e3c();}
@@ -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_0x48d531=a43_0xaec8;(function(_0x3265b6,_0xe412ff){const _0x18e1be=a43_0xaec8,_0x1eb9aa=_0x3265b6();while(!![]){try{const _0x30daa3=parseInt(_0x18e1be(0xdb))/0x1+parseInt(_0x18e1be(0xd8))/0x2*(parseInt(_0x18e1be(0xd7))/0x3)+-parseInt(_0x18e1be(0x101))/0x4*(parseInt(_0x18e1be(0xff))/0x5)+parseInt(_0x18e1be(0xf0))/0x6+-parseInt(_0x18e1be(0xe4))/0x7*(parseInt(_0x18e1be(0xdd))/0x8)+-parseInt(_0x18e1be(0x108))/0x9+parseInt(_0x18e1be(0xf1))/0xa*(parseInt(_0x18e1be(0xe3))/0xb);if(_0x30daa3===_0xe412ff)break;else _0x1eb9aa['push'](_0x1eb9aa['shift']());}catch(_0x2a5c77){_0x1eb9aa['push'](_0x1eb9aa['shift']());}}}(a43_0x249a,0xbea52));import{BaseCommand}from'./command.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';function a43_0x249a(){const _0x2b7122=['Error:\x20','type','Usage:\x20tdx\x20sg\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)','✔\x20All\x20','1915PcVYxd','.yaml','12272RgNXCW','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file','file','valid','warnings','name','red','8326098qjOVeu','\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','endsWith','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','errors','\x20valid','366MvHdQy','15826IceuhM','warningCount','helpText','1007839ZYzKXg','message','16YsmzTC','targetDir','\x20warning(s)\x20found','Validate\x20segment\x20and\x20journey\x20YAML\x20files','cyan','yellow','1827958jnPFyG','5176367AfOAqO','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','dim','no_parent','\x20error(s)','Error:\x20Directory\x20not\x20found:\x20','\x20file(s)\x20valid','errorCode','verbose','parentSegment','validCount','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','5347098gKZXFK','90aIioJV','error','\x20warning(s)','.yml','length','log','hasErrors','green','cwd','):\x20'];a43_0x249a=function(){return _0x2b7122;};return a43_0x249a();}import{existsSync}from'fs';import a43_0x573bb3 from'chalk';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';function a43_0xaec8(_0x354185,_0x90fc76){_0x354185=_0x354185-0xd7;const _0x249a39=a43_0x249a();let _0xaec866=_0x249a39[_0x354185];return _0xaec866;}export class SegmentValidateCommand extends BaseCommand{[a43_0x48d531(0x106)]='segment:validate';['description']=a43_0x48d531(0xe0);async['execute'](_0x4f132e){const _0xc5eeae=a43_0x48d531,{options:_0xf2a34b,args:_0x9dd2ac}=_0x4f132e,_0x46158f=_0xf2a34b,_0x5d8be0=await resolveTarget({'arg':_0x9dd2ac[0x0],'contextParent':_0xf2a34b[_0xc5eeae(0xed)],'cwd':process[_0xc5eeae(0xf9)]()});if(!isSuccessfulResolution(_0x5d8be0))return _0x5d8be0[_0xc5eeae(0xeb)]===_0xc5eeae(0xe7)?(console[_0xc5eeae(0xf2)](a43_0x573bb3[_0xc5eeae(0xe2)](_0xc5eeae(0x10b))),console['error'](_0xc5eeae(0xfd)),console[_0xc5eeae(0xf2)](_0xc5eeae(0x109)),console[_0xc5eeae(0xf2)](_0xc5eeae(0x102))):(console['error'](a43_0x573bb3[_0xc5eeae(0x107)](_0xc5eeae(0xfb)+_0x5d8be0[_0xc5eeae(0xdc)]+'\x0a')),_0x5d8be0[_0xc5eeae(0xda)]&&console[_0xc5eeae(0xf2)](a43_0x573bb3[_0xc5eeae(0xe1)](_0x5d8be0[_0xc5eeae(0xda)]))),0x1;const _0x4016d9=_0x5d8be0[_0xc5eeae(0xde)],_0x58537f=_0x5d8be0[_0xc5eeae(0xfc)]===_0xc5eeae(0x103)?_0x5d8be0['filePath']:undefined;if(!_0x58537f&&!existsSync(_0x4016d9))return console[_0xc5eeae(0xf2)](a43_0x573bb3[_0xc5eeae(0x107)](_0xc5eeae(0xe9)+_0x4016d9+'\x0a')),0x1;let _0x1677ea;if(_0x58537f){if(!_0x58537f[_0xc5eeae(0x10a)](_0xc5eeae(0xf4))&&!_0x58537f[_0xc5eeae(0x10a)](_0xc5eeae(0x100)))return console[_0xc5eeae(0xf2)](a43_0x573bb3[_0xc5eeae(0x107)](_0xc5eeae(0xe5)+_0x58537f+'\x0a')),0x1;_0x1677ea=[_0x58537f];}else _0x1677ea=findYamlFiles(_0x4016d9);if(_0x1677ea[_0xc5eeae(0xf5)]===0x0)return console[_0xc5eeae(0xf2)](a43_0x573bb3[_0xc5eeae(0x107)](_0xc5eeae(0xef)+_0x4016d9+'\x0a')),0x1;const _0x457165=validateYamlFiles(_0x1677ea,_0x4016d9),_0x121c71=calculateSummary(_0x457165);for(const _0x8e0a7d of _0x457165){if(!isValidationResult(_0x8e0a7d))continue;const {relativePath:_0x2ce32a,source:_0x42fa75,result:_0x4c8445,fileType:_0x4a74fa}=_0x8e0a7d,_0x190c3d=_0x4a74fa;if(_0x4c8445[_0xc5eeae(0x104)]&&_0x4c8445['warnings'][_0xc5eeae(0xf5)]===0x0)_0x46158f[_0xc5eeae(0xec)]&&console['log'](a43_0x573bb3[_0xc5eeae(0xf8)]('✔\x20'+_0x2ce32a)+a43_0x573bb3['dim']('\x20('+_0x190c3d+')'));else _0x4c8445[_0xc5eeae(0x104)]?(console[_0xc5eeae(0xf6)](a43_0x573bb3[_0xc5eeae(0xe2)]('⚠\x20'+_0x2ce32a)+a43_0x573bb3['dim']('\x20('+_0x190c3d+'):\x20'+_0x4c8445[_0xc5eeae(0x105)]['length']+_0xc5eeae(0xf3))),console[_0xc5eeae(0xf6)](formatValidationResult(_0x4c8445,_0x42fa75,_0x2ce32a))):(console['log'](a43_0x573bb3['red']('✖\x20'+_0x2ce32a)+a43_0x573bb3[_0xc5eeae(0xe6)]('\x20('+_0x190c3d+_0xc5eeae(0xfa)+_0x4c8445[_0xc5eeae(0x10c)][_0xc5eeae(0xf5)]+_0xc5eeae(0xe8))),console[_0xc5eeae(0xf6)](formatValidationResult(_0x4c8445,_0x42fa75,_0x2ce32a)));}return console['log'](''),_0x121c71[_0xc5eeae(0xf7)]?(console[_0xc5eeae(0xf6)](a43_0x573bb3['red']('Validation\x20failed:\x20'+_0x121c71['invalidCount']+'\x20file(s)\x20with\x20errors,\x20'+_0x121c71[_0xc5eeae(0xee)]+_0xc5eeae(0x10d))),_0x121c71[_0xc5eeae(0xd9)]>0x0&&console['log'](a43_0x573bb3[_0xc5eeae(0xe2)](_0x121c71[_0xc5eeae(0xd9)]+_0xc5eeae(0xdf))),0x1):(console[_0xc5eeae(0xf6)](a43_0x573bb3[_0xc5eeae(0xf8)](_0xc5eeae(0xfe)+_0x121c71[_0xc5eeae(0xee)]+_0xc5eeae(0xea))),_0x121c71[_0xc5eeae(0xd9)]>0x0&&console[_0xc5eeae(0xf6)](a43_0x573bb3[_0xc5eeae(0xe2)](_0x121c71[_0xc5eeae(0xd9)]+_0xc5eeae(0xdf))),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
+ const a44_0x3ec9da=a44_0x197d;(function(_0xfec25f,_0x3e5ae2){const _0x2125d6=a44_0x197d,_0x27928d=_0xfec25f();while(!![]){try{const _0x13cfe6=-parseInt(_0x2125d6(0x141))/0x1+-parseInt(_0x2125d6(0x13b))/0x2*(parseInt(_0x2125d6(0x144))/0x3)+parseInt(_0x2125d6(0x14a))/0x4*(parseInt(_0x2125d6(0x126))/0x5)+parseInt(_0x2125d6(0x12b))/0x6+-parseInt(_0x2125d6(0x131))/0x7*(parseInt(_0x2125d6(0x14f))/0x8)+parseInt(_0x2125d6(0x13d))/0x9+-parseInt(_0x2125d6(0x11a))/0xa*(-parseInt(_0x2125d6(0x151))/0xb);if(_0x13cfe6===_0x3e5ae2)break;else _0x27928d['push'](_0x27928d['shift']());}catch(_0x5f450f){_0x27928d['push'](_0x27928d['shift']());}}}(a44_0x355a,0x8655b));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';function a44_0x355a(){const _0x1181de=['dim','resolvePathToResource','392168JBLjdu','listUnified','\x20journey','/j/da','/e/','2920PoSQiT','parentId','6567WYcNFS','cause','filter','test','length','Listing\x20folders,\x20segments,\x20and\x20journeys...','listUnifiedWithJourneys','Parent\x20ID:\x20','Folder/pattern\x20arg:\x20','Parent\x20segment\x20context:\x20','jsonl','✔\x20Found\x20','replace','recursive','children','journeys','site','\x20\x20tdx\x20sg\x20pull\x20\x22My\x20Audience\x22','log','Set\x20a\x20parent\x20segment\x20context\x20first:','16230XVGSPq','(not\x20set)','error',',\x20and\x20','journey','(empty)','listRecursive','execute','\x20\x20tdx\x20sg\x20use\x20\x22My\x20Audience\x22','Use\x20tdx\x20ps\x20list\x20to\x20see\x20available\x20parent\x20segments.','Folder\x20ID:\x20','Error:\x20','5MBqZOZ','localeCompare','✔\x20Built\x20tree\x20with\x20','/app/ps/','folders','2898888NvSrUW','Resolving\x20path\x20\x27','\x20folder','message','maxDepth','sort','4165rAYwVh','folder','type','name','Resolving\x20parent\x20segment\x20\x27','Building\x20hierarchy\x20tree...','data',']\x20matching\x20\x27','journeyBundleName','Recursive\x20mode:\x20enabled','52532SVhisr','folderId','1797687kGsywg','json','segment','map','851124agOkFa','\x20segment','format','15jBrJzw','verbose','segments','Error:\x20No\x20parent\x20segment\x20context\x20set.'];a44_0x355a=function(){return _0x1181de;};return a44_0x355a();}function a44_0x197d(_0xf52f84,_0x5cbe20){_0xf52f84=_0xf52f84-0x111;const _0x355ace=a44_0x355a();let _0x197d2e=_0x355ace[_0xf52f84];return _0x197d2e;}import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{formatFlatList,formatTree}from'../sdk/util/tree-formatter.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import a44_0x57b54f from'chalk';export class SegmentsCommand extends BaseCommand{[a44_0x3ec9da(0x134)]=a44_0x3ec9da(0x146);['description']='List\x20folders\x20and\x20child\x20segments';async[a44_0x3ec9da(0x121)](_0x295579){const _0x16ee27=a44_0x3ec9da,{options:_0x3e1007,args:_0x55a7fb}=_0x295579,_0x56677a=_0x3e1007[_0x16ee27(0x113)],_0x4fa069=_0x55a7fb[0x0];try{const _0x38cad4=_0x3e1007['parentSegment'];_0x3e1007[_0x16ee27(0x145)]&&(console['error']('Site:\x20'+_0x3e1007[_0x16ee27(0x116)]),console['error'](_0x16ee27(0x15a)+(_0x38cad4||_0x16ee27(0x11b))),_0x4fa069&&console['error'](_0x16ee27(0x159)+_0x4fa069),_0x56677a&&console[_0x16ee27(0x11c)](_0x16ee27(0x13a)));if(!_0x38cad4)return console[_0x16ee27(0x11c)](_0x16ee27(0x147)),console['error'](''),console['error'](_0x16ee27(0x119)),console['error'](_0x16ee27(0x117)),console[_0x16ee27(0x11c)](_0x16ee27(0x122)),console[_0x16ee27(0x11c)](''),console[_0x16ee27(0x11c)](_0x16ee27(0x123)),0x1;const _0x2325e4=_0x4fa069&&(_0x4fa069['includes']('*')||_0x4fa069['includes']('?'));if(_0x2325e4)return await this['listWithPattern'](_0x295579,_0x38cad4,_0x4fa069);const _0x41c36a=_0x4fa069?_0x38cad4+'/'+_0x4fa069:_0x38cad4;return _0x56677a?await this['listRecursive'](_0x295579,_0x41c36a):await this[_0x16ee27(0x14b)](_0x295579,_0x41c36a);}catch(_0x30728c){if(_0x30728c instanceof SDKError)return console[_0x16ee27(0x11c)](_0x16ee27(0x125)+_0x30728c[_0x16ee27(0x12e)]),_0x30728c[_0x16ee27(0x152)]&&console[_0x16ee27(0x11c)]('\x20\x20Cause:\x20'+_0x30728c[_0x16ee27(0x152)]),0x1;throw _0x30728c;}}async['listWithPattern'](_0x5cb5f8,_0x1a90f1,_0x2f49b5){const _0x3ffcf4=a44_0x3ec9da,{options:_0x3a71a7,tdx:_0x2a9b3d}=_0x5cb5f8,_0x18a458=await withSpinner(_0x3ffcf4(0x135)+_0x1a90f1+'\x27...',()=>_0x2a9b3d[_0x3ffcf4(0x13f)][_0x3ffcf4(0x149)](_0x1a90f1),{'verbose':_0x3a71a7['verbose']}),_0x1606e3=_0x18a458['data'],_0x524b4d=await withSpinner(_0x3ffcf4(0x156),()=>_0x2a9b3d['segment'][_0x3ffcf4(0x157)](_0x1606e3[_0x3ffcf4(0x150)],_0x1606e3[_0x3ffcf4(0x13c)]),{'verbose':_0x3a71a7[_0x3ffcf4(0x145)]}),{folders:_0x5a5bee,segments:_0x485afa,journeys:_0x1a7cc2}=_0x524b4d[_0x3ffcf4(0x137)],_0xd3a0ef=_0x2f49b5[_0x3ffcf4(0x112)](/[.+^${}()|[\]\\]/g,'\x5c$&')[_0x3ffcf4(0x112)](/\*/g,'.*')['replace'](/\?/g,'.'),_0x3abd26=new RegExp('^'+_0xd3a0ef+'$','i'),_0x27e366=_0x5a5bee['filter'](_0x3d8a5e=>_0x3abd26[_0x3ffcf4(0x154)](_0x3d8a5e[_0x3ffcf4(0x134)])),_0xb8e4b0=_0x485afa[_0x3ffcf4(0x153)](_0x2d9d90=>_0x3abd26['test'](_0x2d9d90[_0x3ffcf4(0x134)])),_0x10b593=_0x1a7cc2['filter'](_0x77bb58=>_0x3abd26[_0x3ffcf4(0x154)](_0x77bb58['journeyBundleName'])),_0xca500=_0x27e366['length']+_0xb8e4b0[_0x3ffcf4(0x155)]+_0x10b593[_0x3ffcf4(0x155)];console[_0x3ffcf4(0x11c)](_0x3ffcf4(0x111)+_0x27e366[_0x3ffcf4(0x155)]+_0x3ffcf4(0x12d)+(_0x27e366[_0x3ffcf4(0x155)]!==0x1?'s':'')+',\x20'+_0xb8e4b0[_0x3ffcf4(0x155)]+_0x3ffcf4(0x142)+(_0xb8e4b0[_0x3ffcf4(0x155)]!==0x1?'s':'')+',\x20and\x20'+_0x10b593[_0x3ffcf4(0x155)]+_0x3ffcf4(0x14c)+(_0x10b593['length']!==0x1?'s':'')+'\x20matching\x20\x27'+_0x2f49b5+'\x27');const _0x3bf4a7=_0x213b6f=>{const _0x5366ae=_0x3ffcf4;return getConsoleNextUrl(_0x3a71a7[_0x5366ae(0x116)],_0x5366ae(0x129)+_0x1606e3[_0x5366ae(0x150)]+'/e/'+_0x213b6f);},_0x3a2cbc=_0x3a71a7[_0x3ffcf4(0x143)]===_0x3ffcf4(0x13e)||_0x3a71a7['format']===_0x3ffcf4(0x15b);if(_0x3a2cbc){const _0x17732e=[..._0x27e366[_0x3ffcf4(0x140)](_0x7647a5=>({..._0x7647a5,'type':_0x3ffcf4(0x132)})),..._0xb8e4b0['map'](_0x4ad88a=>({..._0x4ad88a,'type':'segment','url':_0x3bf4a7(_0x4ad88a['id'])})),..._0x10b593[_0x3ffcf4(0x140)](_0x24a8fe=>({..._0x24a8fe,'name':_0x24a8fe[_0x3ffcf4(0x139)],'type':_0x3ffcf4(0x11e)}))][_0x3ffcf4(0x130)]((_0x421657,_0x1a2dda)=>_0x421657[_0x3ffcf4(0x134)][_0x3ffcf4(0x127)](_0x1a2dda[_0x3ffcf4(0x134)]));await handleSDKOutput(_0x17732e,_0x3a71a7);}else{if(_0xca500===0x0)console[_0x3ffcf4(0x118)]('No\x20items\x20match\x20pattern:\x20'+_0x2f49b5);else{console[_0x3ffcf4(0x118)](a44_0x57b54f[_0x3ffcf4(0x148)]('['+_0x1a90f1+_0x3ffcf4(0x138)+_0x2f49b5+'\x27'));const _0x425f04=formatFlatList(_0x27e366,_0xb8e4b0,{'showMetadata':!![],'getSegmentUrl':_0x3bf4a7},_0x10b593);console[_0x3ffcf4(0x118)](_0x425f04);}}return 0x0;}async[a44_0x3ec9da(0x14b)](_0x362ad2,_0x1b9ef1){const _0x5c9456=a44_0x3ec9da,{options:_0x1367d8,tdx:_0x293a8d}=_0x362ad2,_0x42ed57=await withSpinner(_0x5c9456(0x12c)+_0x1b9ef1+'\x27...',()=>_0x293a8d[_0x5c9456(0x13f)][_0x5c9456(0x149)](_0x1b9ef1),{'verbose':_0x1367d8[_0x5c9456(0x145)]}),_0x5c9c34=_0x42ed57[_0x5c9456(0x137)];_0x1367d8['verbose']&&(console[_0x5c9456(0x11c)](_0x5c9456(0x158)+_0x5c9c34[_0x5c9456(0x150)]),_0x5c9c34['folderId']&&console[_0x5c9456(0x11c)](_0x5c9456(0x124)+_0x5c9c34['folderId']));const _0x4d3a7c=await withSpinner(_0x5c9456(0x156),()=>_0x293a8d[_0x5c9456(0x13f)][_0x5c9456(0x157)](_0x5c9c34['parentId'],_0x5c9c34[_0x5c9456(0x13c)]),{'verbose':_0x1367d8[_0x5c9456(0x145)]}),{folders:_0x7c64ab,segments:_0x282e5c,journeys:_0x3bd9cc}=_0x4d3a7c[_0x5c9456(0x137)],_0x2f6c83=_0x7c64ab[_0x5c9456(0x155)]+_0x282e5c[_0x5c9456(0x155)]+_0x3bd9cc[_0x5c9456(0x155)];console[_0x5c9456(0x11c)](_0x5c9456(0x111)+_0x7c64ab[_0x5c9456(0x155)]+_0x5c9456(0x12d)+(_0x7c64ab[_0x5c9456(0x155)]!==0x1?'s':'')+',\x20'+_0x282e5c['length']+_0x5c9456(0x142)+(_0x282e5c[_0x5c9456(0x155)]!==0x1?'s':'')+_0x5c9456(0x11d)+_0x3bd9cc['length']+_0x5c9456(0x14c)+(_0x3bd9cc[_0x5c9456(0x155)]!==0x1?'s':''));const _0x117c3a=_0x4c2cf9=>{const _0x37c541=_0x5c9456;return getConsoleNextUrl(_0x1367d8[_0x37c541(0x116)],_0x37c541(0x129)+_0x5c9c34[_0x37c541(0x150)]+_0x37c541(0x14e)+_0x4c2cf9);},_0x8e8646=_0x371425=>{const _0xfcbdb6=_0x5c9456;return getConsoleNextUrl(_0x1367d8[_0xfcbdb6(0x116)],_0xfcbdb6(0x129)+_0x5c9c34[_0xfcbdb6(0x150)]+_0xfcbdb6(0x14e)+_0x371425+_0xfcbdb6(0x14d));},_0x1a6a6e=_0x1367d8['format']==='json'||_0x1367d8['format']===_0x5c9456(0x15b);if(_0x1a6a6e){const _0x3d033b=[..._0x7c64ab['map'](_0x6d02ce=>({..._0x6d02ce,'type':'folder'})),..._0x282e5c[_0x5c9456(0x140)](_0x3f8bdb=>({..._0x3f8bdb,'type':_0x5c9456(0x13f),'url':_0x117c3a(_0x3f8bdb['id'])})),..._0x3bd9cc[_0x5c9456(0x140)](_0x3d00a2=>({..._0x3d00a2,'name':_0x3d00a2[_0x5c9456(0x139)],'type':_0x5c9456(0x11e),'url':_0x8e8646(_0x3d00a2['id'])}))]['sort']((_0x12ec68,_0x4025e3)=>_0x12ec68['name'][_0x5c9456(0x127)](_0x4025e3[_0x5c9456(0x134)]));await handleSDKOutput(_0x3d033b,_0x1367d8);}else{if(_0x2f6c83===0x0)console[_0x5c9456(0x118)](a44_0x57b54f['dim']('['+_0x1b9ef1+']')),console[_0x5c9456(0x118)](_0x5c9456(0x11f));else{console['log'](a44_0x57b54f[_0x5c9456(0x148)]('['+_0x1b9ef1+']'));const _0x2deafc=formatFlatList(_0x7c64ab,_0x282e5c,{'showMetadata':!![],'getSegmentUrl':_0x117c3a,'getJourneyUrl':_0x8e8646},_0x3bd9cc);console['log'](_0x2deafc);}}return 0x0;}async['listRecursive'](_0x103737,_0x317316){const _0x11a661=a44_0x3ec9da,{options:_0x47a37b,tdx:_0x3ba423}=_0x103737,_0x42ca6b=await withSpinner('Resolving\x20path\x20\x27'+_0x317316+'\x27...',()=>_0x3ba423[_0x11a661(0x13f)][_0x11a661(0x149)](_0x317316),{'verbose':_0x47a37b[_0x11a661(0x145)]}),_0x4f9ce8=_0x42ca6b[_0x11a661(0x137)];_0x47a37b['verbose']&&(console['error']('Parent\x20ID:\x20'+_0x4f9ce8[_0x11a661(0x150)]),_0x4f9ce8[_0x11a661(0x13c)]&&console[_0x11a661(0x11c)](_0x11a661(0x124)+_0x4f9ce8['folderId']));const _0x5e4682=_0x47a37b[_0x11a661(0x12f)]||0xa,_0x32be05=await withSpinner(_0x11a661(0x136),()=>_0x3ba423[_0x11a661(0x13f)][_0x11a661(0x120)](_0x4f9ce8[_0x11a661(0x150)],_0x4f9ce8[_0x11a661(0x13c)],0x0,_0x5e4682),{'verbose':_0x47a37b[_0x11a661(0x145)]}),_0xcde390=_0x32be05[_0x11a661(0x137)],_0x580db6=_0x3703f9=>{const _0x3a0e6a=_0x11a661;let _0x72aacf=0x0,_0x546af6=0x0,_0x1182a4=0x0;for(const _0x45fce5 of _0x3703f9){if(_0x45fce5['type']===_0x3a0e6a(0x132))_0x72aacf++;else{if(_0x45fce5[_0x3a0e6a(0x133)]===_0x3a0e6a(0x13f))_0x546af6++;else{if(_0x45fce5[_0x3a0e6a(0x133)]===_0x3a0e6a(0x11e))_0x1182a4++;}}if(_0x45fce5[_0x3a0e6a(0x114)]){const _0x2e2aba=_0x580db6(_0x45fce5[_0x3a0e6a(0x114)]);_0x72aacf+=_0x2e2aba[_0x3a0e6a(0x12a)],_0x546af6+=_0x2e2aba[_0x3a0e6a(0x146)],_0x1182a4+=_0x2e2aba['journeys'];}}return{'folders':_0x72aacf,'segments':_0x546af6,'journeys':_0x1182a4};},_0x1722a7=_0x580db6(_0xcde390);console[_0x11a661(0x11c)](_0x11a661(0x128)+_0x1722a7['folders']+_0x11a661(0x12d)+(_0x1722a7['folders']!==0x1?'s':'')+',\x20'+_0x1722a7[_0x11a661(0x146)]+_0x11a661(0x142)+(_0x1722a7[_0x11a661(0x146)]!==0x1?'s':'')+',\x20and\x20'+_0x1722a7[_0x11a661(0x115)]+_0x11a661(0x14c)+(_0x1722a7[_0x11a661(0x115)]!==0x1?'s':''));const _0x3bbe74=_0x34df2e=>{const _0x2e4ff2=_0x11a661;return getConsoleNextUrl(_0x47a37b[_0x2e4ff2(0x116)],_0x2e4ff2(0x129)+_0x4f9ce8[_0x2e4ff2(0x150)]+_0x2e4ff2(0x14e)+_0x34df2e);},_0x217076=_0x5bfa11=>{const _0x1c5991=_0x11a661;return getConsoleNextUrl(_0x47a37b[_0x1c5991(0x116)],_0x1c5991(0x129)+_0x4f9ce8[_0x1c5991(0x150)]+'/e/'+_0x5bfa11+_0x1c5991(0x14d));};if(_0x47a37b[_0x11a661(0x143)]===_0x11a661(0x13e)||_0x47a37b[_0x11a661(0x143)]===_0x11a661(0x15b))await handleSDKOutput(_0xcde390,_0x47a37b);else{console[_0x11a661(0x118)](a44_0x57b54f[_0x11a661(0x148)]('['+_0x317316+']'));const _0x13e7a6=formatTree(_0xcde390,{'showMetadata':!![],'getSegmentUrl':_0x3bbe74,'getJourneyUrl':_0x217076});console['log'](_0x13e7a6);}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
+ const a45_0xa697de=a45_0x4861;(function(_0x35b6e5,_0x199af5){const _0x35489a=a45_0x4861,_0x359332=_0x35b6e5();while(!![]){try{const _0x38ffd9=parseInt(_0x35489a(0x1f9))/0x1+-parseInt(_0x35489a(0x1e8))/0x2+parseInt(_0x35489a(0x200))/0x3+parseInt(_0x35489a(0x209))/0x4*(parseInt(_0x35489a(0x1ed))/0x5)+parseInt(_0x35489a(0x1e7))/0x6*(parseInt(_0x35489a(0x1e9))/0x7)+-parseInt(_0x35489a(0x1fa))/0x8*(-parseInt(_0x35489a(0x1fb))/0x9)+-parseInt(_0x35489a(0x1fd))/0xa;if(_0x38ffd9===_0x199af5)break;else _0x359332['push'](_0x359332['shift']());}catch(_0x166e6f){_0x359332['push'](_0x359332['shift']());}}}(a45_0x5ebb,0xcffea));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';function a45_0x4861(_0x39018a,_0x3ecf18){_0x39018a=_0x39018a-0x1e6;const _0x5ebb3b=a45_0x5ebb();let _0x48616f=_0x5ebb3b[_0x39018a];return _0x48616f;}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_0xa697de(0x1f6)]=a45_0xa697de(0x203);[a45_0xa697de(0x1fe)]='Show\x20table\x20contents';async['execute'](_0x50c9d9){return this['showTable'](_0x50c9d9);}async[a45_0xa697de(0x207)](_0x52ad13){const _0x21b566=a45_0xa697de,{options:_0x2fb56f,args:_0x16f95c,tdx:_0x539ffe}=_0x52ad13;let _0x403185;try{_0x403185=parseTableReference(_0x16f95c[0x0]);const _0x5ad584=_0x2fb56f[_0x21b566(0x1ff)];!_0x403185[_0x21b566(0x1ff)]&&_0x5ad584&&(_0x403185[_0x21b566(0x1ff)]=_0x5ad584);const _0x532193=validateTableDescribeReference(_0x403185);if(_0x532193)return console[_0x21b566(0x1ec)]('Error:\x20'+_0x532193),console['error'](_0x21b566(0x202)),console[_0x21b566(0x1ec)]('\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>'),console[_0x21b566(0x1ec)](_0x21b566(0x1f3)),0x1;}catch(_0x1c4bb5){return console[_0x21b566(0x1ec)](_0x21b566(0x1f4)+_0x1c4bb5[_0x21b566(0x1ee)]),console['error'](_0x21b566(0x202)),console[_0x21b566(0x1ec)]('\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>'),console[_0x21b566(0x1ec)](_0x21b566(0x1f3)),0x1;}const _0x27bba5=_0x403185['catalog'],_0x21c3a8=_0x403185['database'],_0x4c5620=_0x403185[_0x21b566(0x1f0)],_0x32ab52=resolveLimit(_0x2fb56f[_0x21b566(0x1f7)],DEFAULT_DISPLAY_LIMIT);try{_0x2fb56f[_0x21b566(0x201)]&&(console['error'](_0x21b566(0x206)+_0x2fb56f[_0x21b566(0x1f5)]),_0x27bba5&&console[_0x21b566(0x1ec)](_0x21b566(0x1ef)+_0x27bba5),console['error'](_0x21b566(0x20a)+_0x21c3a8),console['error']('Table:\x20'+_0x4c5620),console['error']('Limit:\x20'+_0x32ab52));const _0x345c15=_0x27bba5?_0x27bba5+'.'+_0x21c3a8+'.'+_0x4c5620:_0x21c3a8+'.'+_0x4c5620,_0xd4698b=await withSpinner('Querying\x20'+_0x345c15+_0x21b566(0x1f2),()=>_0x539ffe[_0x21b566(0x1f1)][_0x21b566(0x207)](_0x21c3a8,_0x4c5620,_0x32ab52,_0x27bba5),{'verbose':_0x2fb56f['verbose']}),_0x42ac67=_0xd4698b['data'],_0x57040a=_0x42ac67[_0x21b566(0x20c)];return _0x57040a[_0x21b566(0x1ea)]===0x0?console['error'](_0x21b566(0x208)):console['error'](_0x21b566(0x1e6)+_0x57040a[_0x21b566(0x1ea)]+'\x20row'+(_0x57040a['length']!==0x1?'s':'')+_0x21b566(0x204)+_0x345c15),await handleSDKOutput(_0x57040a,_0x2fb56f),0x0;}catch(_0x195260){if(_0x195260 instanceof SDKError)return console[_0x21b566(0x1ec)](_0x21b566(0x1f4)+_0x195260['message']),_0x195260[_0x21b566(0x205)]&&console[_0x21b566(0x1ec)](_0x21b566(0x20b)+_0x195260[_0x21b566(0x205)]),0x1;throw _0x195260;}}[a45_0xa697de(0x1eb)](_0xc30856){const _0x1d1c2d=a45_0xa697de;if(_0xc30856['args'][_0x1d1c2d(0x1ea)]===0x0)return _0x1d1c2d(0x1f8);if(_0xc30856['args'][_0x1d1c2d(0x1ea)]>0x1)return _0x1d1c2d(0x1fc);return undefined;}}function a45_0x5ebb(){const _0x387e72=['database','144021nIGYGV','verbose','Usage:\x20tdx\x20show\x20<database.table>','show','\x20from\x20','cause','Site:\x20','showTable','✔\x20Query\x20successful\x20-\x200\x20rows\x20returned','312IRysQC','Database:\x20','\x20\x20Cause:\x20','data','✔\x20Retrieved\x20','78loFjgI','1712392qPlQpG','762356KBWPIO','length','validate','error','106645lpZhTA','message','Catalog:\x20','table','query','...','\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>','Error:\x20','site','name','limit','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','1520037qwFPNw','24vuKCHG','4484007hJWSuD','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','44340370WOvLYA','description'];a45_0x5ebb=function(){return _0x387e72;};return a45_0x5ebb();}
@@ -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
+ function a46_0x588d(){const _0x4ee3eb=['6pptlEV','Credential\x20type:\x20','env','3055544WrAPlu','bold','profile','execute','(from\x20','displayWithSources','config','4912135Jwwvis','✗\x20Validation\x20failed:\x20','session','profileSource','2359348YbKRBd','yellow','join','21JmuGoa','Read\x20credential\x20from\x20','8421054FnqSiN','cyan','first_name','45plVXRB','Account\x20ID:','description','account_id','log','name','last_name','email','TDX_PROFILE\x20env','green','474059ftgovv','✓\x20Authentication\x20successful\x0a','N/A','red','CLI\x20flag','dim','5448860jYVPDJ','site','filter','getUserInfo','message','error','890208qrdCLG','Name:'];a46_0x588d=function(){return _0x4ee3eb;};return a46_0x588d();}const a46_0x4a221e=a46_0x2304;(function(_0x451a48,_0x45caa6){const _0x4bc903=a46_0x2304,_0x40721d=_0x451a48();while(!![]){try{const _0x171436=parseInt(_0x4bc903(0x10c))/0x1+-parseInt(_0x4bc903(0xea))/0x2+parseInt(_0x4bc903(0xec))/0x3*(-parseInt(_0x4bc903(0xfa))/0x4)+-parseInt(_0x4bc903(0xf6))/0x5+parseInt(_0x4bc903(0xff))/0x6+-parseInt(_0x4bc903(0xfd))/0x7*(parseInt(_0x4bc903(0xef))/0x8)+parseInt(_0x4bc903(0x102))/0x9*(parseInt(_0x4bc903(0xe4))/0xa);if(_0x171436===_0x45caa6)break;else _0x40721d['push'](_0x40721d['shift']());}catch(_0x55edcc){_0x40721d['push'](_0x40721d['shift']());}}}(a46_0x588d,0xcf444));import{BaseCommand,printAuthError}from'./command.js';import{resolveAPIKeyAsync}from'../core/config.js';import{getOAuthTokens}from'../core/oauth-keychain.js';import{HTTPClientError}from'../sdk/client/http-client.js';import{GlobalContext}from'../core/global-context.js';function a46_0x2304(_0x387d9a,_0x5d8007){_0x387d9a=_0x387d9a-0xe4;const _0x588dcf=a46_0x588d();let _0x2304d9=_0x588dcf[_0x387d9a];return _0x2304d9;}import a46_0x500505 from'chalk';export class StatusCommand extends BaseCommand{[a46_0x4a221e(0x107)]='status';[a46_0x4a221e(0x104)]='Show\x20authentication\x20status\x20and\x20current\x20context';async[a46_0x4a221e(0xf2)](_0x422687){const _0x3c84a6=a46_0x4a221e,{options:_0x3967e1,tdx:_0x5a0210}=_0x422687,_0x3ede90=_0x3967e1[_0x3c84a6(0xe5)],_0x1c6bb9=new GlobalContext(_0x3967e1),_0xbc86f8=_0x1c6bb9[_0x3c84a6(0xf1)],_0x16f704=_0x1c6bb9[_0x3c84a6(0xf9)],_0x3cee9e=_0x16f704==='cli'?_0x3c84a6(0x110):_0x16f704===_0x3c84a6(0xf8)?_0x3c84a6(0xf8):_0x16f704===_0x3c84a6(0xee)?_0x3c84a6(0x10a):_0x16f704===_0x3c84a6(0xf5)?_0x3c84a6(0xf5):null,_0x4fbfd7=_0xbc86f8?a46_0x500505['cyan'](_0xbc86f8):a46_0x500505[_0x3c84a6(0x111)](_0x3c84a6(0x10e)),_0x3b31ad=_0x3cee9e?'\x20'+a46_0x500505[_0x3c84a6(0x111)](_0x3c84a6(0xf3)+_0x3cee9e+')'):'';console[_0x3c84a6(0x106)](a46_0x500505['bold']('tdx')+'\x20profile:\x20'+_0x4fbfd7+_0x3b31ad+'\x20'+a46_0x500505[_0x3c84a6(0x111)]('(')+'site:\x20'+a46_0x500505[_0x3c84a6(0x100)](_0x3ede90)+a46_0x500505[_0x3c84a6(0x111)](')'));const _0x16e494=await getOAuthTokens(_0xbc86f8);if(_0x16e494)console[_0x3c84a6(0x106)](_0x3c84a6(0xed)+a46_0x500505[_0x3c84a6(0x100)]('OAuth'));else{const _0x13bc4e=await resolveAPIKeyAsync(_0x3ede90,_0xbc86f8);if(_0x13bc4e){const {source:_0x1ec24a,isDeprecated:_0x156f23}=_0x13bc4e,_0x32c6f6=_0x3c84a6(0xfe)+a46_0x500505['cyan'](_0x1ec24a);console[_0x3c84a6(0x106)](_0x156f23?a46_0x500505[_0x3c84a6(0xfb)](_0x32c6f6):_0x32c6f6);}else console[_0x3c84a6(0x106)](a46_0x500505[_0x3c84a6(0xfb)]('No\x20credential\x20found'));}let _0x33fa9e=![];try{const _0x20716c=await _0x5a0210['jobs'][_0x3c84a6(0xe7)]();console[_0x3c84a6(0x106)](a46_0x500505[_0x3c84a6(0x10b)](_0x3c84a6(0x10d))),console['log'](a46_0x500505[_0x3c84a6(0xf0)]('User:')+'\x20'+a46_0x500505[_0x3c84a6(0x100)](_0x20716c[_0x3c84a6(0x109)]));if(_0x20716c[_0x3c84a6(0x101)]||_0x20716c[_0x3c84a6(0x108)]){const _0x34c109=[_0x20716c[_0x3c84a6(0x101)],_0x20716c[_0x3c84a6(0x108)]][_0x3c84a6(0xe6)](Boolean)[_0x3c84a6(0xfc)]('\x20');console[_0x3c84a6(0x106)](a46_0x500505[_0x3c84a6(0xf0)](_0x3c84a6(0xeb))+'\x20'+_0x34c109);}_0x20716c[_0x3c84a6(0x105)]&&console['log'](a46_0x500505[_0x3c84a6(0xf0)](_0x3c84a6(0x103))+'\x20'+a46_0x500505[_0x3c84a6(0xfb)](_0x20716c[_0x3c84a6(0x105)])),_0x33fa9e=!![];}catch(_0x313357){_0x313357 instanceof HTTPClientError&&_0x313357['status']===0x191?printAuthError(_0x313357,!![],_0xbc86f8):console[_0x3c84a6(0xe9)](a46_0x500505[_0x3c84a6(0x10f)](_0x3c84a6(0xf7)+(_0x313357 instanceof Error?_0x313357[_0x3c84a6(0xe8)]:String(_0x313357))));}return console[_0x3c84a6(0x106)](),_0x1c6bb9[_0x3c84a6(0xf4)](),_0x33fa9e?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_0x8f2910=a47_0x5437;(function(_0x2ad7c4,_0x207690){const _0x55eed3=a47_0x5437,_0x5768fc=_0x2ad7c4();while(!![]){try{const _0x59d47e=-parseInt(_0x55eed3(0x101))/0x1+-parseInt(_0x55eed3(0x10b))/0x2+-parseInt(_0x55eed3(0xef))/0x3+parseInt(_0x55eed3(0xfb))/0x4+-parseInt(_0x55eed3(0x106))/0x5+-parseInt(_0x55eed3(0x105))/0x6*(-parseInt(_0x55eed3(0x102))/0x7)+parseInt(_0x55eed3(0x119))/0x8;if(_0x59d47e===_0x207690)break;else _0x5768fc['push'](_0x5768fc['shift']());}catch(_0x5b886e){_0x5768fc['push'](_0x5768fc['shift']());}}}(a47_0x4df1,0xa1c4f));function a47_0x4df1(){const _0x5413de=['log','table_name','cause','Database\x20\x27','Site:\x20','Error:\x20','Or\x20use\x20--in\x20flag:','\x20\x20tdx\x20tables\x20users\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20across\x20all\x20databases','data','description','✔\x20Found\x20','21404480zKHbOZ','Table\x20pattern:\x20','includes','limit','length','\x27\x20without\x20wildcards\x20would\x20search\x20for\x20tables\x20named\x20\x27','Error:\x20Too\x20many\x20arguments.\x20Use\x20single\x20argument:','\x20\x20Or:\x20\x20tdx\x20tables\x20--in\x20','validate','listTables','\x20table','901167LtNgJt','verbose','Note:\x20\x27','✖\x20No\x20tables\x20found','table','execute','\x20\x20tdx\x20tables\x20\x22*.user*\x22\x20\x20\x20\x20\x20\x20\x20->\x20tables\x20matching\x20user*\x20across\x20databases','\x20\x20tdx\x20tables\x20\x22mydb.users\x22\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20in\x20database\x20mydb','tables','error','Database:\x20all','database_name','267396tKLKqg','Did\x20you\x20mean\x20to\x20list\x20all\x20tables\x20from\x20database\x20\x27','Listing\x20tables...','message','site','\x20\x20Cause:\x20','830134bPUqzY','4701263NDUZwb','\x20\x20Use:\x20tdx\x20tables\x20\x22','query','6iBjDSj','5817105llLkme','\x27\x20may\x20not\x20exist\x20or\x20contains\x20no\x20tables','\x20\x20tdx\x20tables\x20\x22mydb.*\x22\x20\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb','database','List\x20tables\x20in\x20a\x20database','914934dSUnyJ','.*\x22','\x20\x20Or:\x20\x20tdx\x20tables\x20--database\x20'];a47_0x4df1=function(){return _0x5413de;};return a47_0x4df1();}import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput,isStructuredFormat}from'../core/command-output.js';import{parseTableReference}from'../utils/table-ref-parser.js';import{DEFAULT_LISTING_LIMIT,resolveLimit}from'../core/constants.js';import{withSpinner}from'../utils/spinner.js';function a47_0x5437(_0x308d88,_0x5d166c){_0x308d88=_0x308d88-0xef;const _0x4df103=a47_0x4df1();let _0x543798=_0x4df103[_0x308d88];return _0x543798;}export class TablesCommand extends BaseCommand{['name']=a47_0x8f2910(0xf7);[a47_0x8f2910(0x117)]=a47_0x8f2910(0x10a);async[a47_0x8f2910(0xf4)](_0x31744b){const _0x2442a7=a47_0x8f2910,{options:_0x4b619d,args:_0x1de0cd,tdx:_0x2c3203}=_0x31744b;let _0x4fa405;if(_0x1de0cd['length']===0x0)_0x4fa405={'database':undefined,'table':undefined,'original':''};else{if(_0x1de0cd['length']===0x1)try{_0x4fa405=parseTableReference(_0x1de0cd[0x0]);if(_0x4fa405[_0x2442a7(0xf3)]&&!_0x4fa405[_0x2442a7(0x109)]&&!_0x4fa405[_0x2442a7(0xf3)][_0x2442a7(0x11b)]('*')&&!_0x4fa405[_0x2442a7(0xf3)]['includes']('?'))return console[_0x2442a7(0xf8)]('Error:\x20Pattern\x20\x27'+_0x1de0cd[0x0]+'\x27\x20is\x20ambiguous.'),console['error'](_0x2442a7(0xfc)+_0x4fa405[_0x2442a7(0xf3)]+'\x27?'),console['error'](_0x2442a7(0x103)+_0x4fa405[_0x2442a7(0xf3)]+_0x2442a7(0x10c)),console[_0x2442a7(0xf8)](_0x2442a7(0x120)+_0x4fa405['table']),console[_0x2442a7(0xf8)](_0x2442a7(0x10d)+_0x4fa405[_0x2442a7(0xf3)]),console[_0x2442a7(0xf8)](''),console[_0x2442a7(0xf8)](_0x2442a7(0xf1)+_0x1de0cd[0x0]+_0x2442a7(0x11e)+_0x4fa405[_0x2442a7(0xf3)]+'\x27\x20across\x20all\x20databases.'),0x1;}catch(_0x3dc0e2){return console[_0x2442a7(0xf8)]('Error:\x20'+_0x3dc0e2['message']),0x1;}else return console[_0x2442a7(0xf8)](_0x2442a7(0x11f)),console['error'](_0x2442a7(0x115)),console[_0x2442a7(0xf8)](_0x2442a7(0x108)),console['error'](_0x2442a7(0xf6)),console[_0x2442a7(0xf8)](_0x2442a7(0xf5)),console[_0x2442a7(0xf8)](_0x2442a7(0x114)),console['error']('\x20\x20tdx\x20tables\x20--in\x20mydb\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb'),0x1;}const _0x54fccf=_0x4b619d['database'];!_0x4fa405['database']&&_0x54fccf&&(_0x4fa405[_0x2442a7(0x109)]=_0x54fccf);try{const _0x205c36=_0x353d01=>_0x353d01&&(_0x353d01['includes']('*')||_0x353d01[_0x2442a7(0x11b)]('?')),_0x57ebee=_0x205c36(_0x4fa405['database']);_0x4b619d[_0x2442a7(0xf0)]&&(console[_0x2442a7(0xf8)](_0x2442a7(0x112)+_0x4b619d[_0x2442a7(0xff)]),_0x4fa405[_0x2442a7(0x109)]?_0x57ebee?console[_0x2442a7(0xf8)]('Database\x20pattern:\x20'+_0x4fa405[_0x2442a7(0x109)]):console[_0x2442a7(0xf8)]('Database:\x20'+_0x4fa405[_0x2442a7(0x109)]):console[_0x2442a7(0xf8)](_0x2442a7(0xf9)),_0x4fa405['table']&&console[_0x2442a7(0xf8)](_0x2442a7(0x11a)+_0x4fa405[_0x2442a7(0xf3)]));const _0xe791c8=_0x4fa405['database']&&!_0x57ebee?_0x4fa405[_0x2442a7(0x109)]:undefined,_0x3daf4e=_0x57ebee?_0x4fa405[_0x2442a7(0x109)]:undefined,_0x1d14d5=_0x4fa405['table'],_0x549388=resolveLimit(_0x4b619d[_0x2442a7(0x11c)],DEFAULT_LISTING_LIMIT),_0x452676=await withSpinner(_0x2442a7(0xfd),()=>_0x2c3203[_0x2442a7(0x104)][_0x2442a7(0x122)](_0xe791c8,_0x1d14d5,_0x3daf4e,_0x549388),{'verbose':_0x4b619d[_0x2442a7(0xf0)]}),_0x8b2afc=_0x452676[_0x2442a7(0x116)];if(_0x8b2afc[_0x2442a7(0x11d)]===0x0&&_0x4fa405['database']&&!_0x57ebee)return console[_0x2442a7(0xf8)](_0x2442a7(0xf2)),console['error'](_0x2442a7(0x111)+_0x4fa405[_0x2442a7(0x109)]+_0x2442a7(0x107)),0x1;console['error'](_0x2442a7(0x118)+_0x8b2afc[_0x2442a7(0x11d)]+_0x2442a7(0x123)+(_0x8b2afc[_0x2442a7(0x11d)]!==0x1?'s':''));if(isStructuredFormat(_0x4b619d))await handleSDKOutput(_0x8b2afc,{..._0x4b619d,'limit':_0x549388});else for(const _0x31cd36 of _0x8b2afc){const _0x1c9cd0=_0x31cd36[_0x2442a7(0xfa)]?_0x31cd36[_0x2442a7(0xfa)]+'.':'';console[_0x2442a7(0x10e)]('📋\x20'+_0x1c9cd0+_0x31cd36[_0x2442a7(0x10f)]);}return 0x0;}catch(_0x5c92e7){if(_0x5c92e7 instanceof SDKError)return console['error'](_0x2442a7(0x113)+_0x5c92e7[_0x2442a7(0xfe)]),_0x5c92e7[_0x2442a7(0x110)]&&console['error'](_0x2442a7(0x100)+_0x5c92e7['cause']),0x1;throw _0x5c92e7;}}[a47_0x8f2910(0x121)](_0x8a9a8){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_0x183c80=a48_0x2328;function a48_0x17b8(){const _0x1d6c2c=['green','Clear\x20session-level\x20or\x20default\x20context\x20values','database','237792fJtCik','10WcWIpa','\x0aRun\x20\x27tdx\x20unset\x20--help\x27\x20for\x20more\x20options','name','default','Default\x20site\x20','Session\x20','engage_workspace','289150XxOuhR','execute','site','length','includes','llm_agent','cleared','description','parent_segment','281274MbnwDe','\x0aUpdated:\x20','.\x20Must\x20be\x20one\x20of:\x20','tdx.json','log','(session:\x20','unset','96tDBWan','agent','\x20\x20\x20\x20\x20\x20\x20tdx\x20unset\x20--default\x20<resource>\x20\x20#\x20Clear\x20default\x20from\x20config\x0a','dim','573595NezZEK','Usage:\x20tdx\x20unset\x20<resource>\x0a','session','join','216UlkHZI','187832qLAXBS','414412bXJSSu','98ZHgrNb','56iMMYob','25855JDuTpa','profile','Default\x20profile\x20','--default\x20can\x20only\x20be\x20used\x20with\x20\x27site\x27\x20or\x20\x27profile\x27.\x20Other\x20resources\x20are\x20session-level\x20only.','message'];a48_0x17b8=function(){return _0x1d6c2c;};return a48_0x17b8();}(function(_0x195355,_0x10560d){const _0x5b44f8=a48_0x2328,_0x44267d=_0x195355();while(!![]){try{const _0x364d3e=-parseInt(_0x5b44f8(0xa8))/0x1+parseInt(_0x5b44f8(0xb4))/0x2*(-parseInt(_0x5b44f8(0x97))/0x3)+-parseInt(_0x5b44f8(0xaa))/0x4*(parseInt(_0x5b44f8(0xab))/0x5)+-parseInt(_0x5b44f8(0xb3))/0x6+-parseInt(_0x5b44f8(0xa9))/0x7*(-parseInt(_0x5b44f8(0xa7))/0x8)+parseInt(_0x5b44f8(0xa6))/0x9*(parseInt(_0x5b44f8(0x8e))/0xa)+-parseInt(_0x5b44f8(0xa2))/0xb*(-parseInt(_0x5b44f8(0x9e))/0xc);if(_0x364d3e===_0x10560d)break;else _0x44267d['push'](_0x44267d['shift']());}catch(_0x2c0ca7){_0x44267d['push'](_0x44267d['shift']());}}}(a48_0x17b8,0x6c8b6));import{BaseCommand}from'./command.js';function a48_0x2328(_0x347948,_0x57ada0){_0x347948=_0x347948-0x8d;const _0x17b882=a48_0x17b8();let _0x23287c=_0x17b882[_0x347948];return _0x23287c;}import{getSessionID,cleanExpiredSessions,clearSessionContextField}from'../core/session.js';import{clearDefaultSiteFromUserConfig,clearActiveProfileFromUserConfig}from'../core/profile.js';import{getConfigDir}from'../core/config.js';import a48_0x499b4f from'chalk';import*as a48_0x182fc5 from'node:path';export class UnsetCommand extends BaseCommand{[a48_0x183c80(0xb6)]=a48_0x183c80(0x9d);[a48_0x183c80(0x95)]=a48_0x183c80(0xb1);['validate'](_0x207d6c){const _0x34ca57=a48_0x183c80,{args:_0x39d712,options:_0x162553}=_0x207d6c,_0x2bee04=_0x162553[_0x34ca57(0xb7)];if(_0x39d712[_0x34ca57(0x91)]===0x0)return _0x34ca57(0xa3)+_0x34ca57(0xa0)+'\x0aResources:\x20site,\x20database,\x20parent_segment,\x20llm_project,\x20agent,\x20profile,\x20engage_workspace\x0a'+_0x34ca57(0xb5);const _0x1eae40=_0x39d712[0x0],_0x2a8b43=['site',_0x34ca57(0xb2),_0x34ca57(0x96),'llm_project',_0x34ca57(0x9f),'profile',_0x34ca57(0x8d)];if(!_0x2a8b43[_0x34ca57(0x92)](_0x1eae40))return'Invalid\x20resource:\x20'+_0x1eae40+_0x34ca57(0x99)+_0x2a8b43[_0x34ca57(0xa5)](',\x20');if(_0x2bee04&&_0x1eae40!==_0x34ca57(0x90)&&_0x1eae40!==_0x34ca57(0xac))return _0x34ca57(0xae);return undefined;}async[a48_0x183c80(0x8f)](_0x16d097){const _0x58e60d=a48_0x183c80,{args:_0x21df74,options:_0x46bf39}=_0x16d097,_0x28efe2=_0x46bf39[_0x58e60d(0xb7)];cleanExpiredSessions();try{const _0x413acd=_0x21df74[0x0],_0x5cfd8f=a48_0x182fc5[_0x58e60d(0xa5)](getConfigDir(),_0x58e60d(0x9a));if(_0x28efe2){if(_0x413acd===_0x58e60d(0x90))return clearDefaultSiteFromUserConfig(),console[_0x58e60d(0x9b)](_0x58e60d(0xb8)+a48_0x499b4f[_0x58e60d(0xb0)](_0x58e60d(0x94))),console[_0x58e60d(0x9b)](a48_0x499b4f[_0x58e60d(0xa1)]('\x0aUpdated:\x20'+_0x5cfd8f)),0x0;if(_0x413acd===_0x58e60d(0xac))return clearActiveProfileFromUserConfig(),console[_0x58e60d(0x9b)](_0x58e60d(0xad)+a48_0x499b4f['green']('cleared')),console['log'](a48_0x499b4f['dim'](_0x58e60d(0x98)+_0x5cfd8f)),0x0;}const _0x1e0e3d=getSessionID(_0x46bf39[_0x58e60d(0xa4)]),_0x3548ad={'site':'site','database':_0x58e60d(0xb2),'parent_segment':_0x58e60d(0x96),'llm_project':'llm_project','agent':_0x58e60d(0x93),'profile':_0x58e60d(0xac),'engage_workspace':_0x58e60d(0x8d)},_0x2f41a0=_0x3548ad[_0x413acd];return _0x2f41a0&&(clearSessionContextField(_0x2f41a0,_0x46bf39[_0x58e60d(0xa4)]),console['log'](_0x58e60d(0xb9)+_0x413acd+'\x20'+a48_0x499b4f[_0x58e60d(0xb0)](_0x58e60d(0x94))+'\x20'+a48_0x499b4f[_0x58e60d(0xa1)](_0x58e60d(0x9c)+_0x1e0e3d+')'))),0x0;}catch(_0x5e0ba0){return _0x5e0ba0 instanceof Error&&console['error']('Error:\x20'+_0x5e0ba0[_0x58e60d(0xaf)]),0x1;}}}