@treasuredata/tdx 2026.3.25 → 2026.3.27

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 (208) 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.d.ts.map +1 -1
  65. package/dist/core/oauth.js +1 -1
  66. package/dist/core/oauth.js.map +1 -1
  67. package/dist/core/profile.js +1 -1
  68. package/dist/core/project-config.js +1 -1
  69. package/dist/core/session.js +1 -1
  70. package/dist/core/user-cache.js +1 -1
  71. package/dist/core/version.js +1 -1
  72. package/dist/index.js +1 -1
  73. package/dist/mcp/server.js +1 -1
  74. package/dist/mcp/tools/index.js +1 -1
  75. package/dist/mcp/tools/tdx-run.js +1 -1
  76. package/dist/mcp/tools/tdx-search.js +1 -1
  77. package/dist/mcp/utils.js +1 -1
  78. package/dist/proxy/claude-usage-tracker.js +1 -1
  79. package/dist/proxy/passthrough-server.js +1 -1
  80. package/dist/proxy/sse-usage-parser.js +1 -1
  81. package/dist/sdk/agent/agent-config.js +1 -1
  82. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  83. package/dist/sdk/agent/agent-yaml.js +1 -1
  84. package/dist/sdk/agent/test/evaluator.js +1 -1
  85. package/dist/sdk/agent/test/executor.js +1 -1
  86. package/dist/sdk/agent/test/index.js +1 -1
  87. package/dist/sdk/agent/test/output.js +1 -1
  88. package/dist/sdk/agent/test/parser.js +1 -1
  89. package/dist/sdk/agent/tool-target-registry.js +1 -1
  90. package/dist/sdk/api.js +1 -1
  91. package/dist/sdk/client/cdp-api-client.js +1 -1
  92. package/dist/sdk/client/delivery-api-client.js +1 -1
  93. package/dist/sdk/client/endpoints.js +1 -1
  94. package/dist/sdk/client/engage-api-client.js +1 -1
  95. package/dist/sdk/client/http-client.js +1 -1
  96. package/dist/sdk/client/llm-api-client.js +1 -1
  97. package/dist/sdk/client/oauth-refresh.js +1 -1
  98. package/dist/sdk/client/rate-limiter.js +1 -1
  99. package/dist/sdk/client/td-api-client.js +1 -1
  100. package/dist/sdk/client/trino-api-client.js +1 -1
  101. package/dist/sdk/client/workflow-client.js +1 -1
  102. package/dist/sdk/connection-validator.js +1 -1
  103. package/dist/sdk/connection.js +1 -1
  104. package/dist/sdk/delivery.js +1 -1
  105. package/dist/sdk/engage/campaign-pull.js +1 -1
  106. package/dist/sdk/engage/campaign-push.js +1 -1
  107. package/dist/sdk/engage/campaign-validator.js +1 -1
  108. package/dist/sdk/engage/campaign-yaml.js +1 -1
  109. package/dist/sdk/engage/template-pull.js +1 -1
  110. package/dist/sdk/engage/template-push.js +1 -1
  111. package/dist/sdk/engage/template-validator.js +1 -1
  112. package/dist/sdk/engage/template-yaml.js +1 -1
  113. package/dist/sdk/engage/types/campaign-def.js +1 -1
  114. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  115. package/dist/sdk/engage/types/template-schema.js +1 -1
  116. package/dist/sdk/engage.js +1 -1
  117. package/dist/sdk/errors.js +1 -1
  118. package/dist/sdk/index.js +1 -1
  119. package/dist/sdk/io/index.js +1 -1
  120. package/dist/sdk/io/node-filesystem.js +1 -1
  121. package/dist/sdk/job.js +1 -1
  122. package/dist/sdk/journey.js +1 -1
  123. package/dist/sdk/llm/chat-cache.js +1 -1
  124. package/dist/sdk/llm/index.js +1 -1
  125. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  126. package/dist/sdk/llm/model-factors.js +1 -1
  127. package/dist/sdk/personalization.js +1 -1
  128. package/dist/sdk/policy.js +1 -1
  129. package/dist/sdk/query/index.js +1 -1
  130. package/dist/sdk/query/sql-parser.js +1 -1
  131. package/dist/sdk/realtime.js +1 -1
  132. package/dist/sdk/schedule.js +1 -1
  133. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  134. package/dist/sdk/segment/fields-display.js +1 -1
  135. package/dist/sdk/segment/file-discovery.js +1 -1
  136. package/dist/sdk/segment/journey-utils.js +1 -1
  137. package/dist/sdk/segment/journey-validator.js +1 -1
  138. package/dist/sdk/segment/journey-yaml.js +1 -1
  139. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  140. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  141. package/dist/sdk/segment/pull-workflow.js +1 -1
  142. package/dist/sdk/segment/push-recovery.js +1 -1
  143. package/dist/sdk/segment/push-workflow.js +1 -1
  144. package/dist/sdk/segment/resolution-context.js +1 -1
  145. package/dist/sdk/segment/segment-path-parser.js +1 -1
  146. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  147. package/dist/sdk/segment/segment-validator.js +1 -1
  148. package/dist/sdk/segment/target-resolution.js +1 -1
  149. package/dist/sdk/segment/tdx-config.js +1 -1
  150. package/dist/sdk/segment/types/activation-schema.js +1 -1
  151. package/dist/sdk/segment/types/journey-def.js +1 -1
  152. package/dist/sdk/segment/types/journey-schema.js +1 -1
  153. package/dist/sdk/segment/types/segment-def.js +1 -1
  154. package/dist/sdk/segment/types/segment-schema.js +1 -1
  155. package/dist/sdk/segment/validate-files.js +1 -1
  156. package/dist/sdk/segment/yaml-validator.js +1 -1
  157. package/dist/sdk/segment.d.ts +5 -0
  158. package/dist/sdk/segment.d.ts.map +1 -1
  159. package/dist/sdk/segment.js +1 -1
  160. package/dist/sdk/segment.js.map +1 -1
  161. package/dist/sdk/types/index.js +1 -1
  162. package/dist/sdk/types/progress.js +1 -1
  163. package/dist/sdk/user.js +1 -1
  164. package/dist/sdk/util/format-detector.js +1 -1
  165. package/dist/sdk/util/formatters.js +1 -1
  166. package/dist/sdk/util/index.js +1 -1
  167. package/dist/sdk/util/paginate.js +1 -1
  168. package/dist/sdk/util/tree-formatter.js +1 -1
  169. package/dist/sdk/workflow/archive-validation.js +1 -1
  170. package/dist/sdk/workflow/clone-workflow.js +1 -1
  171. package/dist/sdk/workflow/index.js +1 -1
  172. package/dist/sdk/workflow/pull-workflow.js +1 -1
  173. package/dist/sdk/workflow/push-workflow.js +1 -1
  174. package/dist/sdk/workflow/tdx-config.js +1 -1
  175. package/dist/sdk/workflow/workflow-utils.js +1 -1
  176. package/dist/test-utils/command-runner.js +1 -1
  177. package/dist/test-utils/factories.js +1 -1
  178. package/dist/test-utils/fixtures.js +1 -1
  179. package/dist/test-utils/http-mock.js +1 -1
  180. package/dist/test-utils/index.js +1 -1
  181. package/dist/utils/async.js +1 -1
  182. package/dist/utils/colors.js +1 -1
  183. package/dist/utils/diff.js +1 -1
  184. package/dist/utils/file-permissions.js +1 -1
  185. package/dist/utils/file-reader.js +1 -1
  186. package/dist/utils/github-releases.js +1 -1
  187. package/dist/utils/global-cache.js +1 -1
  188. package/dist/utils/json-loader.js +1 -1
  189. package/dist/utils/local-cache.js +1 -1
  190. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  191. package/dist/utils/logger/formatters/index.js +1 -1
  192. package/dist/utils/logger/handlers/console-handler.js +1 -1
  193. package/dist/utils/logger/handlers/file-handler.js +1 -1
  194. package/dist/utils/logger/handlers/index.js +1 -1
  195. package/dist/utils/logger/handlers/null-handler.js +1 -1
  196. package/dist/utils/logger/index.js +1 -1
  197. package/dist/utils/logger/logger.js +1 -1
  198. package/dist/utils/logger/types.js +1 -1
  199. package/dist/utils/option-validation.js +1 -1
  200. package/dist/utils/process.js +1 -1
  201. package/dist/utils/prompt.js +1 -1
  202. package/dist/utils/spinner.js +1 -1
  203. package/dist/utils/sse-parser.js +1 -1
  204. package/dist/utils/string-utils.js +1 -1
  205. package/dist/utils/table-ref-parser.js +1 -1
  206. package/dist/utils/tdx-logger.js +1 -1
  207. package/dist/utils/version-check.js +1 -1
  208. package/package.json +1 -1
@@ -1 +1 @@
1
- const a40_0x10856d=a40_0x4eb6;(function(_0x354268,_0x2e4a12){const _0x2cffa3=a40_0x4eb6,_0x5d01d5=_0x354268();while(!![]){try{const _0x1889b9=-parseInt(_0x2cffa3(0x19a))/0x1*(-parseInt(_0x2cffa3(0x16d))/0x2)+-parseInt(_0x2cffa3(0x176))/0x3+-parseInt(_0x2cffa3(0x1ab))/0x4+-parseInt(_0x2cffa3(0x162))/0x5+-parseInt(_0x2cffa3(0x1b1))/0x6+parseInt(_0x2cffa3(0x1a7))/0x7*(-parseInt(_0x2cffa3(0x18c))/0x8)+-parseInt(_0x2cffa3(0x163))/0x9*(-parseInt(_0x2cffa3(0x19d))/0xa);if(_0x1889b9===_0x2e4a12)break;else _0x5d01d5['push'](_0x5d01d5['shift']());}catch(_0x1914ae){_0x5d01d5['push'](_0x5d01d5['shift']());}}}(a40_0x291e,0x45c4b));import{BaseCommand}from'./command.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{generateDiff,formatDiffWithColors}from'../utils/diff.js';import{confirmKey,isInteractive}from'../utils/prompt.js';function a40_0x291e(){const _0x54cc0d=['cyan','journeyBundleName','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','/sb/da/esr','results','\x20\x20Activations:','122430XhqYqt','13410891USBlXN','segments','Fetching\x20connections\x20for\x20name\x20resolution...','Error:\x20','listFolders','toDelete','helpText','setPhase','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','folderPath','20rOWFSg','Fetching\x20existing\x20activations...','verbose','parentName','/j/da/je','\x20to\x20create','filter','/app/ps/','Site:\x20','1328169PWQEgT','Changes\x20to:','push','\x20\x20📊\x20Segments:','add','.yml','Push\x20','segment\x20or\x20journey','dim','message','filePath','all','audienceId','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','Aborted.','isScoped','\x20created','diff','getParent','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','createdSegmentIds','yellow','14192NAvZdi','\x20updated','list','folders','\x27...','journeys','/e/','execute','Error\x20parsing\x20YAML:\x20','yamlConfig','Delete\x20segment:','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','resolveParentId','getOutputSchemaWithCache','659qbVttH','repeat','journeyId','10WBUKPw','\x20to\x20delete','\x0aError:','file','existingSegment','then','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','connection','journeyBundleId','\x20\x20Journeys:\x20','28hTfBIy','red','\x20new','New\x20journey:','1482596iZzcbN','unchanged','green','description','No\x20','Usage:\x20tdx\x20sg\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20(requires\x20context)','2195784TMBIWD','delete','\x20folders\x20to\x20create','idToName','\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20','user','new','\x0aValidation\x20failed:','attributes','\x20to\x20update','folderId','set','toCreate','createdAt','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','updatedAt','updated','segmentFolderId','\x20YAML\x20files\x20found','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','\x20\x20Source:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','\x20deleted','created','blue','\x20unchanged','site','Source\x20directory:\x20','buildUserMaps','journey','name','\x20\x20🗺️\x20\x20Journeys:','data','\x20\x20Segments:\x20','segment','Delete\x20journey:','error','\x20activations]','✔\x20All\x20journeys\x20are\x20up\x20to\x20date','Fetching\x20existing\x20data...','existingJourney','journeysOnly','length','join','\x20\x20\x20\x20','getJourney','relationships','Error:\x20Directory\x20not\x20found:\x20','targetDir','no_parent','Parent\x20segment:\x20','activations','parent_name','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file','map','cwd','nameToType','state','Changes\x20to\x20journey:','get','listActivations','\x20changes?','errorCode','endsWith','Error:\x20No\x20YAML\x20files\x20found\x20in\x20'];a40_0x291e=function(){return _0x54cc0d;};return a40_0x291e();}import{batchAsync}from'../utils/async.js';import{segmentToYamlString,segmentWithActivationsToYaml}from'../sdk/segment/child-segment-yaml.js';import a40_0x46b1d4 from'chalk';import{existsSync}from'fs';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{resolveTarget,isSuccessfulResolution,getScopedDetails}from'../sdk/segment/target-resolution.js';function a40_0x4eb6(_0x35f1c9,_0x2b94df){_0x35f1c9=_0x35f1c9-0x132;const _0x291e41=a40_0x291e();let _0x4eb6f0=_0x291e41[_0x35f1c9];return _0x4eb6f0;}import{buildFolderMaps}from'../sdk/segment/resolution-context.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{resolveTDFolderPath,findSegmentsToDelete,findJourneysToDelete,buildSegmentLookupMap,buildSegmentNameToIdMap,buildJourneyBundleLookupMap,parseAndClassifyYamlFiles,validateParsedFiles,formatValidationErrors,extractRootFolderId,buildConnectionMaps,calculatePushStats,prepareSegmentFiles,prepareJourneyFiles,executePushSegments,executePushFolders,executePushSegmentDeletions,executePushJourneys}from'../sdk/segment/push-workflow.js';export class SegmentPushCommand extends BaseCommand{[a40_0x10856d(0x139)]='segment:push';[a40_0x10856d(0x1ae)]='Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments';async[a40_0x10856d(0x193)](_0x23c6ea){const _0x943831=a40_0x10856d,{options:_0x73d158,args:_0x169425,tdx:_0x1a1291}=_0x23c6ea,_0xca0657=_0x73d158,_0x515e84=await resolveTarget({'arg':_0x169425[0x0],'contextParent':_0x73d158['parentSegment'],'cwd':process[_0x943831(0x152)]()});if(!isSuccessfulResolution(_0x515e84))return _0x515e84[_0x943831(0x159)]===_0x943831(0x14c)?(console[_0x943831(0x13f)](a40_0x46b1d4[_0x943831(0x18b)](_0x943831(0x197))),console['error'](_0x943831(0x1b0)),console[_0x943831(0x13f)](_0x943831(0x1c6)),console['error'](_0x943831(0x150))):(console[_0x943831(0x13f)](a40_0x46b1d4['red'](_0x943831(0x166)+_0x515e84['message']+'\x0a')),_0x515e84[_0x943831(0x169)]&&console[_0x943831(0x13f)](a40_0x46b1d4[_0x943831(0x15c)](_0x515e84[_0x943831(0x169)]))),0x1;if(_0x515e84['type']===_0x943831(0x14f))return console['error'](a40_0x46b1d4[_0x943831(0x1a8)](_0x943831(0x14a)+_0x515e84['targetDir']+'\x0a')),console[_0x943831(0x13f)](a40_0x46b1d4[_0x943831(0x15c)](_0x943831(0x183))),0x1;const _0x502c32=_0x515e84[_0x943831(0x170)],_0xa427ea=_0x515e84[_0x943831(0x14b)],_0x2a311d=_0x515e84['type']===_0x943831(0x1a0)?_0x515e84[_0x943831(0x180)]:undefined,_0x3f0fff=getScopedDetails(_0x515e84),_0x3f7adf=_0x3f0fff?.[_0x943831(0x185)]??![],_0x45186d=_0x3f0fff?.['scopedFolderPath']??'';if(!existsSync(_0xa427ea))return console['error'](a40_0x46b1d4[_0x943831(0x1a8)](_0x943831(0x14a)+_0xa427ea+'\x0a')),console[_0x943831(0x13f)](a40_0x46b1d4[_0x943831(0x15c)](_0x943831(0x183))),0x1;_0xca0657[_0x943831(0x16f)]&&(console[_0x943831(0x13f)](_0x943831(0x175)+_0xca0657[_0x943831(0x135)]),console[_0x943831(0x13f)](_0x943831(0x14d)+_0x502c32),console[_0x943831(0x13f)](_0x943831(0x136)+_0xa427ea),_0x3f7adf&&console[_0x943831(0x13f)]('Scoped\x20to\x20folder:\x20'+_0x45186d));const _0x112f83=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x502c32+_0x943831(0x190),()=>_0x1a1291[_0x943831(0x13d)][_0x943831(0x198)](_0x502c32),{'verbose':_0xca0657[_0x943831(0x16f)]}),_0x189efd=_0x112f83[_0x943831(0x13b)],{parentSegmentResult:_0x4eeac1,segmentsResult:_0x2f53ff,foldersResult:_0x1d6c05,journeysWithDetailsResult:_0x3ee57a,userMaps:_0x1a1177}=await withSpinner(_0x943831(0x142),async()=>{const _0x1af961=_0x943831,[_0x30312a,_0x7e4528,_0x542ae4,_0x28bbc6,_0x444dc8]=await Promise[_0x1af961(0x181)]([_0x1a1291['segment'][_0x1af961(0x188)](_0x189efd),_0x1a1291[_0x1af961(0x13d)]['listSegments'](_0x189efd),_0x1a1291[_0x1af961(0x13d)][_0x1af961(0x167)](_0x189efd),_0x1a1291[_0x1af961(0x138)]['listJourneysWithDetailsFromParentSegment'](_0x189efd,{'includeAllVersions':!![]}),_0x1a1291[_0x1af961(0x1b6)][_0x1af961(0x137)]()]);return{'parentSegmentResult':_0x30312a,'segmentsResult':_0x7e4528,'foldersResult':_0x542ae4,'journeysWithDetailsResult':_0x28bbc6,'userMaps':_0x444dc8};},{'verbose':_0xca0657['verbose']})[_0x943831(0x1a2)](_0x325bed=>_0x325bed[_0x943831(0x13b)]),_0x25605f=_0x4eeac1,_0x49ef83=extractRootFolderId(_0x25605f),_0x5306ec=_0x2f53ff,_0x3b3a0d=_0x1d6c05,{journeys:_0xb738df,activationStepsById:_0x59552e}=_0x3ee57a,_0x4d52d8=new Map(_0xb738df[_0x943831(0x151)](_0x3fd0fc=>[_0x3fd0fc['id'],_0x3fd0fc])),_0x2c9740=_0xb738df[_0x943831(0x151)](_0x49f5fd=>({'id':_0x49f5fd['id'],'name':_0x49f5fd[_0x943831(0x1b9)][_0x943831(0x139)],'journeyBundleName':_0x49f5fd['attributes']['journeyBundleName']||'','journeyBundleId':_0x49f5fd[_0x943831(0x1b9)][_0x943831(0x1a5)]||'','versionNumber':_0x49f5fd['attributes']['versionNumber'],'description':_0x49f5fd[_0x943831(0x1b9)][_0x943831(0x1ae)],'state':_0x49f5fd[_0x943831(0x1b9)][_0x943831(0x154)],'paused':_0x49f5fd[_0x943831(0x1b9)]['paused'],'audienceId':_0x49f5fd[_0x943831(0x1b9)][_0x943831(0x182)],'folderId':_0x49f5fd[_0x943831(0x149)]?.['parentFolder']?.['data']?.['id'],'createdAt':_0x49f5fd[_0x943831(0x1b9)][_0x943831(0x1be)],'updatedAt':_0x49f5fd[_0x943831(0x1b9)][_0x943831(0x1c0)]})),{emailToId:_0x47f032,idToEmail:_0x24ad6c}=_0x1a1177,_0x10cdb6=await withSpinner(_0x943831(0x165),async()=>{const _0x157f9e=_0x943831,_0x5ac270=await _0x1a1291[_0x157f9e(0x1a4)][_0x157f9e(0x18e)]();return buildConnectionMaps(_0x5ac270);},{'verbose':_0xca0657[_0x943831(0x16f)]})[_0x943831(0x1a2)](_0x5aa54d=>_0x5aa54d[_0x943831(0x13b)]),_0x51560a=_0x10cdb6['nameToId'],_0x29311c=_0x10cdb6[_0x943831(0x1b4)],_0x884f7=_0x10cdb6[_0x943831(0x153)],_0x233faf={'emailToIdMap':_0x47f032,'connectionNameToIdMap':_0x51560a,'connectionNameToTypeMap':_0x884f7,'getSchema':_0x5eba2d=>_0x1a1291[_0x943831(0x1a4)][_0x943831(0x199)](_0x5eba2d)};let {pathToId:_0xfa1079,idToPath:_0x4756b9}=buildFolderMaps(_0x3b3a0d);const _0x2a75fc=buildSegmentLookupMap(_0x5306ec,_0x4756b9),_0x1002ac=buildSegmentNameToIdMap(_0x5306ec),_0x5b6f02=buildJourneyBundleLookupMap(_0x2c9740,_0x4756b9);let _0xab2c6;if(_0x2a311d){if(!_0x2a311d[_0x943831(0x15a)](_0x943831(0x17b))&&!_0x2a311d[_0x943831(0x15a)]('.yaml'))return console['error'](a40_0x46b1d4[_0x943831(0x1a8)](_0x943831(0x1a3)+_0x2a311d+'\x0a')),0x1;_0xab2c6=[_0x2a311d];}else _0xab2c6=findYamlFiles(_0xa427ea);if(_0xab2c6['length']===0x0)return console[_0x943831(0x13f)](a40_0x46b1d4[_0x943831(0x1a8)](_0x943831(0x15b)+_0xa427ea+'\x0a')),console[_0x943831(0x13f)](a40_0x46b1d4[_0x943831(0x15c)](_0x943831(0x1c4))),0x1;let _0x31fa64,_0x24eff8;try{const _0x4641d3=parseAndClassifyYamlFiles(_0xab2c6,_0xa427ea,{'skipSegments':_0xca0657[_0x943831(0x144)]});_0x31fa64=_0x4641d3[_0x943831(0x164)],_0x24eff8=_0x4641d3[_0x943831(0x191)];const _0xdf9b70=validateParsedFiles(_0x4641d3,_0xa427ea);if(_0xdf9b70[_0x943831(0x145)]>0x0)return console[_0x943831(0x13f)](a40_0x46b1d4[_0x943831(0x1a8)](_0x943831(0x1b8))),console[_0x943831(0x13f)](formatValidationErrors(_0xdf9b70)),console[_0x943831(0x13f)](a40_0x46b1d4['yellow'](_0x943831(0x15e))),0x1;}catch(_0x1f8be9){return console[_0x943831(0x13f)](a40_0x46b1d4[_0x943831(0x1a8)](_0x943831(0x194)+(_0x1f8be9 instanceof Error?_0x1f8be9[_0x943831(0x17f)]:_0x1f8be9))),0x1;}if(_0x31fa64['length']===0x0&&_0x24eff8[_0x943831(0x145)]===0x0){const _0x3f4a5f=_0xca0657[_0x943831(0x144)]?_0x943831(0x138):_0x943831(0x17d);return console['error'](a40_0x46b1d4[_0x943831(0x18b)](_0x943831(0x1af)+_0x3f4a5f+_0x943831(0x1c3))),0x0;}const _0x3d4888=new Map();_0x5306ec['length']>0x0&&!_0xca0657[_0x943831(0x144)]&&await withSpinner(_0x943831(0x16e),async()=>{await batchAsync(_0x5306ec,async _0x1745d7=>{const _0x379a09=a40_0x4eb6,_0x34b040=await _0x1a1291[_0x379a09(0x13d)][_0x379a09(0x157)](_0x189efd,_0x1745d7['id']);_0x3d4888[_0x379a09(0x1bc)](_0x1745d7['id'],_0x34b040);});},{'verbose':_0xca0657[_0x943831(0x16f)]});const {segmentFiles:_0x55de29,foldersToCreate:_0x145684}=await prepareSegmentFiles(_0x31fa64,{'segmentByFolderAndName':_0x2a75fc,'activationsBySegmentId':_0x3d4888,'folderPathToId':_0xfa1079,'idToEmailMap':_0x24ad6c,'connectionIdToNameMap':_0x29311c},_0x233faf,_0x3f7adf,_0x45186d),_0x580265=_0x2a311d?[]:findSegmentsToDelete(_0x5306ec,_0x31fa64[_0x943831(0x151)](({yamlConfig:_0x5d3156,folderPath:_0x13b4b2})=>({'yamlConfig':_0x5d3156,'folderPath':resolveTDFolderPath(_0x13b4b2,_0x3f7adf,_0x45186d)})),_0x4756b9,_0x45186d,_0x3f7adf),{journeyFiles:_0x48258b,foldersToCreate:_0x159189}=await withProgressSpinner('Preparing\x20journeys...',async _0x2fc4dc=>prepareJourneyFiles(_0x24eff8,{'fetchJourney':async _0x35855e=>_0x1a1291['journey'][_0x943831(0x148)](_0x35855e[_0x943831(0x19c)]),'journeyBundlesByFolderAndName':_0x5b6f02,'folderPathToId':_0xfa1079,'idToEmailMap':_0x24ad6c,'connectionIdToNameMap':_0x29311c,'existingSegments':_0x5306ec,'parentId':_0x189efd,'deps':_0x1a1291,'progress':{'update':_0x483880=>{const _0x2c90d5=_0x943831;_0x2fc4dc[_0x2c90d5(0x16a)](_0x483880),_0xca0657[_0x2c90d5(0x16f)]&&console[_0x2c90d5(0x13f)]('\x20\x20'+_0x483880);}},'journeyById':_0x4d52d8,'activationStepsById':_0x59552e},_0x3f7adf,_0x45186d),{'verbose':_0xca0657[_0x943831(0x16f)]})[_0x943831(0x1a2)](_0x1c44c0=>_0x1c44c0[_0x943831(0x13b)]);for(const _0x260f03 of _0x159189){_0x145684[_0x943831(0x17a)](_0x260f03);}const _0x41d870=_0x2a311d?[]:findJourneysToDelete(_0x2c9740,_0x24eff8[_0x943831(0x151)](({yamlConfig:_0x52e2e6,folderPath:_0x41e885})=>({'yamlConfig':_0x52e2e6,'folderPath':resolveTDFolderPath(_0x41e885,_0x3f7adf,_0x45186d)})),_0x4756b9,_0x45186d,_0x3f7adf),_0x3cb122=calculatePushStats(_0x55de29,_0x48258b,_0x145684,_0x580265,_0x41d870,!!_0xca0657['delete'],!!_0xca0657[_0x943831(0x144)]),_0x3b660e=_0x3cb122[_0x943831(0x164)][_0x943831(0x1b7)],_0xbfa6c4=_0x3cb122[_0x943831(0x164)]['changed'],_0x1b8379=_0x3cb122[_0x943831(0x164)]['unchanged'],_0x10d64f=_0x3cb122[_0x943831(0x164)][_0x943831(0x168)],_0xcce0aa=_0x3cb122[_0x943831(0x18f)][_0x943831(0x1bd)],_0x5091b7=_0x3cb122[_0x943831(0x191)][_0x943831(0x1b7)],_0xb492f9=_0x3cb122[_0x943831(0x191)]['changed'],_0xf6dd6a=_0x3cb122[_0x943831(0x191)][_0x943831(0x1ac)],_0x1690ae=_0x3cb122[_0x943831(0x191)][_0x943831(0x168)],_0x39fe4a=_0x3cb122[_0x943831(0x14e)][_0x943831(0x181)],_0xc422e=_0x3cb122['activations'][_0x943831(0x1bd)],_0x14fa61=_0x3cb122[_0x943831(0x14e)]['toUpdate'],_0x10a15e=_0x3cb122[_0x943831(0x14e)][_0x943831(0x168)];console['error']('\x0aPush\x20summary\x20for\x20\x27'+_0x502c32+'\x27:');_0xcce0aa['length']>0x0&&console[_0x943831(0x13f)]('\x20\x20'+a40_0x46b1d4[_0x943831(0x133)]('📁\x20'+_0xcce0aa[_0x943831(0x145)]+_0x943831(0x1b3)));if(!_0xca0657['journeysOnly']){console['error'](_0x943831(0x179)),console[_0x943831(0x13f)]('\x20\x20\x20\x20'+a40_0x46b1d4['green']('+\x20'+_0x3b660e[_0x943831(0x145)]+_0x943831(0x1a9))),console[_0x943831(0x13f)](_0x943831(0x147)+a40_0x46b1d4[_0x943831(0x18b)]('~\x20'+_0xbfa6c4[_0x943831(0x145)]+'\x20changed'));if(_0x10d64f[_0x943831(0x145)]>0x0)console['error']('\x20\x20\x20\x20'+a40_0x46b1d4[_0x943831(0x1a8)]('-\x20'+_0x10d64f[_0x943831(0x145)]+_0x943831(0x19e)));else _0x580265[_0x943831(0x145)]>0x0&&!_0xca0657[_0x943831(0x1b2)]&&console['error'](_0x943831(0x147)+a40_0x46b1d4[_0x943831(0x17e)](_0x580265[_0x943831(0x145)]+'\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)'));console[_0x943831(0x13f)]('\x20\x20\x20\x20'+a40_0x46b1d4['dim']('=\x20'+_0x1b8379[_0x943831(0x145)]+_0x943831(0x134)));}if(_0x48258b[_0x943831(0x145)]>0x0||_0x41d870['length']>0x0){console[_0x943831(0x13f)](_0x943831(0x13a)),console['error'](_0x943831(0x147)+a40_0x46b1d4[_0x943831(0x1ad)]('+\x20'+_0x5091b7[_0x943831(0x145)]+_0x943831(0x1a9))),console[_0x943831(0x13f)]('\x20\x20\x20\x20'+a40_0x46b1d4[_0x943831(0x18b)]('~\x20'+_0xb492f9[_0x943831(0x145)]+'\x20changed'));if(_0x1690ae['length']>0x0)console[_0x943831(0x13f)](_0x943831(0x147)+a40_0x46b1d4[_0x943831(0x1a8)]('-\x20'+_0x1690ae[_0x943831(0x145)]+_0x943831(0x19e)));else _0x41d870[_0x943831(0x145)]>0x0&&!_0xca0657['delete']&&console[_0x943831(0x13f)](_0x943831(0x147)+a40_0x46b1d4['dim'](_0x41d870['length']+'\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)'));console['error'](_0x943831(0x147)+a40_0x46b1d4['dim']('=\x20'+_0xf6dd6a[_0x943831(0x145)]+'\x20unchanged'));}_0x39fe4a['length']>0x0&&!_0xca0657['journeysOnly']&&(console['error'](''),console['error'](_0x943831(0x161)),_0xc422e['length']>0x0&&console['error'](_0x943831(0x147)+a40_0x46b1d4['green']('+\x20'+_0xc422e[_0x943831(0x145)]+_0x943831(0x172))),_0x14fa61[_0x943831(0x145)]>0x0&&console['error'](_0x943831(0x147)+a40_0x46b1d4[_0x943831(0x18b)]('~\x20'+_0x14fa61['length']+_0x943831(0x1ba))),_0x10a15e[_0x943831(0x145)]>0x0&&console[_0x943831(0x13f)]('\x20\x20\x20\x20'+a40_0x46b1d4['red']('-\x20'+_0x10a15e[_0x943831(0x145)]+_0x943831(0x19e))));console[_0x943831(0x13f)](_0x943831(0x1c5)+a40_0x46b1d4[_0x943831(0x15c)](_0xa427ea)+'\x0a');if(_0xcce0aa[_0x943831(0x145)]>0x0){console[_0x943831(0x13f)]('Folders\x20to\x20create:');for(const _0x4d2172 of _0xcce0aa){console[_0x943831(0x13f)]('\x20\x20'+a40_0x46b1d4[_0x943831(0x133)]('+')+'\x20'+_0x4d2172);}console[_0x943831(0x13f)]('');}if(_0x3b660e[_0x943831(0x145)]>0x0&&!_0xca0657['journeysOnly'])for(const _0x363f12 of _0x3b660e){const _0x7fb19=_0x363f12['folderPath']?_0x363f12[_0x943831(0x16c)]+'/'+_0x363f12[_0x943831(0x195)][_0x943831(0x139)]:_0x363f12[_0x943831(0x195)][_0x943831(0x139)],_0x2503cd=_0x363f12[_0x943831(0x195)][_0x943831(0x14e)]?.['length']||0x0,_0x3a9493=_0x2503cd>0x0?a40_0x46b1d4[_0x943831(0x17e)]('\x20['+_0x2503cd+'\x20activations]'):'';console[_0x943831(0x13f)]('\x0a'+a40_0x46b1d4['green']('New\x20segment:')+'\x20'+_0x7fb19+_0x3a9493),console['error']('─'[_0x943831(0x19b)](0x3c)),_0x363f12[_0x943831(0x187)]&&console['error'](_0x363f12['diff']),console[_0x943831(0x13f)]('─'[_0x943831(0x19b)](0x3c));}if(_0x10d64f['length']>0x0&&!_0xca0657[_0x943831(0x144)])for(const _0x488bff of _0x10d64f){const _0x3f29ad=_0x488bff[_0x943831(0x1c2)]?_0x4756b9[_0x943831(0x156)](_0x488bff[_0x943831(0x1c2)]['toString']())||'':'',_0x5f4e05=_0x3f29ad?_0x3f29ad+'/'+_0x488bff[_0x943831(0x139)]:_0x488bff[_0x943831(0x139)],_0x3313b8=_0x3d4888[_0x943831(0x156)](_0x488bff['id'])||[],_0x3ede45=_0x3313b8[_0x943831(0x145)]>0x0?a40_0x46b1d4['dim']('\x20['+_0x3313b8[_0x943831(0x145)]+_0x943831(0x140)):'';console['error']('\x0a'+a40_0x46b1d4['red'](_0x943831(0x196))+'\x20'+_0x5f4e05+_0x3ede45),console[_0x943831(0x13f)]('─'[_0x943831(0x19b)](0x3c));const _0x2712e8=segmentWithActivationsToYaml(_0x488bff,_0x3313b8,undefined,_0x24ad6c,_0x29311c),_0x4ef740=segmentToYamlString(_0x2712e8),_0x1c0e52=generateDiff(_0x4ef740,'');console[_0x943831(0x13f)](formatDiffWithColors(_0x1c0e52)),console[_0x943831(0x13f)]('─'[_0x943831(0x19b)](0x3c));}const _0x5c3384=_0x55de29[_0x943831(0x173)](_0x10c909=>!_0x10c909['isNew']&&_0x10c909[_0x943831(0x187)]);if(_0x5c3384[_0x943831(0x145)]>0x0&&!_0xca0657['journeysOnly'])for(const _0x33a8a6 of _0x5c3384){const _0x9d6184=_0x33a8a6[_0x943831(0x16c)]?_0x33a8a6['folderPath']+'/'+_0x33a8a6[_0x943831(0x195)]['name']:_0x33a8a6[_0x943831(0x195)][_0x943831(0x139)];console[_0x943831(0x13f)]('\x0a'+a40_0x46b1d4[_0x943831(0x18b)](_0x943831(0x177))+'\x20'+_0x9d6184),console[_0x943831(0x13f)]('─'[_0x943831(0x19b)](0x3c)),console[_0x943831(0x13f)](_0x33a8a6[_0x943831(0x187)]),console['error']('─'['repeat'](0x3c));}if(_0x5091b7[_0x943831(0x145)]>0x0)for(const _0x1f5800 of _0x5091b7){const _0x533694=_0x1f5800[_0x943831(0x16c)]?_0x1f5800[_0x943831(0x16c)]+'/'+_0x1f5800[_0x943831(0x195)][_0x943831(0x139)]:_0x1f5800[_0x943831(0x195)][_0x943831(0x139)];console[_0x943831(0x13f)]('\x0a'+a40_0x46b1d4[_0x943831(0x1ad)](_0x943831(0x1aa))+'\x20'+_0x533694),console[_0x943831(0x13f)]('─'['repeat'](0x3c)),_0x1f5800[_0x943831(0x187)]&&console[_0x943831(0x13f)](_0x1f5800[_0x943831(0x187)]),console['error']('─'[_0x943831(0x19b)](0x3c));}const _0x5284e3=_0x48258b[_0x943831(0x173)](_0x8bac5=>!_0x8bac5['isNew']&&_0x8bac5[_0x943831(0x187)]);if(_0x5284e3['length']>0x0)for(const _0x19578d of _0x5284e3){const _0x4dff01=_0x19578d['folderPath']?_0x19578d[_0x943831(0x16c)]+'/'+_0x19578d['yamlConfig'][_0x943831(0x139)]:_0x19578d[_0x943831(0x195)][_0x943831(0x139)];console[_0x943831(0x13f)]('\x0a'+a40_0x46b1d4[_0x943831(0x18b)](_0x943831(0x155))+'\x20'+_0x4dff01),console['error']('─'[_0x943831(0x19b)](0x3c)),console['error'](_0x19578d[_0x943831(0x187)]),console[_0x943831(0x13f)]('─'[_0x943831(0x19b)](0x3c));}if(_0x1690ae[_0x943831(0x145)]>0x0)for(const _0x440627 of _0x1690ae){const _0x3bffaf=_0x440627[_0x943831(0x1bb)]?_0x4756b9['get'](_0x440627[_0x943831(0x1bb)])||'':'',_0x18be50=_0x3bffaf?_0x3bffaf+'/'+_0x440627['journeyBundleName']:_0x440627[_0x943831(0x15d)];console['error']('\x0a'+a40_0x46b1d4['red'](_0x943831(0x13e))+'\x20'+_0x18be50),console[_0x943831(0x13f)]('─'['repeat'](0x3c)),console[_0x943831(0x13f)](a40_0x46b1d4[_0x943831(0x1a8)]('(Journey\x20will\x20be\x20deleted)')),console[_0x943831(0x13f)]('─'[_0x943831(0x19b)](0x3c));}if(_0xca0657['dryRun'])return console[_0x943831(0x13f)](a40_0x46b1d4[_0x943831(0x18b)](_0x943831(0x1bf))),0x0;const _0x5cc5c8=_0xca0657[_0x943831(0x144)]?![]:_0x3b660e['length']>0x0||_0xbfa6c4[_0x943831(0x145)]>0x0||_0x10d64f[_0x943831(0x145)]>0x0,_0x4a5d53=_0x5091b7[_0x943831(0x145)]>0x0||_0xb492f9[_0x943831(0x145)]>0x0||_0x1690ae[_0x943831(0x145)]>0x0,_0x304bbc=_0xca0657['journeysOnly']?![]:_0x39fe4a[_0x943831(0x145)]>0x0,_0x5ced71=_0xcce0aa['length']>0x0;if(!_0x5cc5c8&&!_0x4a5d53&&!_0x304bbc&&!_0x5ced71){const _0x8497c1=_0xca0657['journeysOnly']?_0x943831(0x141):'✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date';console[_0x943831(0x13f)](a40_0x46b1d4[_0x943831(0x1ad)](_0x8497c1));if(_0x2a311d&&_0x1b8379[_0x943831(0x145)]===0x1){const _0x4d7dea=_0x1b8379[0x0];if(_0x4d7dea[_0x943831(0x1a1)]?.['id']){const _0x915b91=getConsoleNextUrl(_0xca0657['site'],_0x943831(0x174)+_0x189efd+_0x943831(0x192)+_0x4d7dea[_0x943831(0x1a1)]['id']+_0x943831(0x15f));console[_0x943831(0x13f)](_0x943831(0x1b5)+a40_0x46b1d4[_0x943831(0x15c)](_0x915b91));}}if(_0x2a311d&&_0xf6dd6a[_0x943831(0x145)]===0x1){const _0x1535f2=_0xf6dd6a[0x0];if(_0x1535f2[_0x943831(0x143)]?.['id']){const _0x52f67a=getConsoleNextUrl(_0xca0657[_0x943831(0x135)],_0x943831(0x174)+_0x189efd+_0x943831(0x192)+_0x1535f2['existingJourney']['id']+_0x943831(0x171));console[_0x943831(0x13f)]('\x20\x20'+a40_0x46b1d4['cyan'](_0x52f67a));}}return 0x0;}const _0x47b275=_0xca0657['journeysOnly']?_0x5091b7[_0x943831(0x145)]+_0xb492f9[_0x943831(0x145)]+_0x1690ae['length']+_0xcce0aa[_0x943831(0x145)]:_0x3b660e[_0x943831(0x145)]+_0xbfa6c4['length']+_0x10d64f['length']+_0x5091b7['length']+_0xb492f9[_0x943831(0x145)]+_0x1690ae['length']+_0xcce0aa[_0x943831(0x145)]+_0x39fe4a['length'];if(!_0xca0657['yes']&&_0x47b275>0x0){if(!isInteractive())return console[_0x943831(0x13f)](a40_0x46b1d4[_0x943831(0x1a8)](_0x943831(0x19f)),_0x943831(0x189)),console[_0x943831(0x13f)](a40_0x46b1d4[_0x943831(0x17e)](_0x943831(0x16b))),0x1;const _0x48727f=await confirmKey(_0x943831(0x17c)+_0x47b275+_0x943831(0x158));if(!_0x48727f)return console[_0x943831(0x13f)](a40_0x46b1d4[_0x943831(0x18b)](_0x943831(0x184))),0x1;}const _0x2077b5={'withProgress':async(_0x4421f6,_0x490c81)=>{const _0x4b1a80=_0x943831,_0xc58ddd=await withSpinner(_0x4421f6,_0x490c81,{'verbose':_0xca0657[_0x4b1a80(0x16f)]});return{'data':_0xc58ddd[_0x4b1a80(0x13b)]};},'logInfo':_0x2ad473=>console[_0x943831(0x13f)](a40_0x46b1d4[_0x943831(0x133)]('✔\x20'+_0x2ad473)),'logSuccess':_0x126590=>console[_0x943831(0x13f)](a40_0x46b1d4[_0x943831(0x1ad)]('✔\x20'+_0x126590)),'logWarning':_0x5d3ee6=>console[_0x943831(0x13f)](a40_0x46b1d4[_0x943831(0x18b)]('⚠\x20'+_0x5d3ee6)),'logDeleted':_0x305cc1=>console[_0x943831(0x13f)](a40_0x46b1d4[_0x943831(0x1a8)]('✔\x20'+_0x305cc1))},_0x38e4ab={'segment':_0x1a1291[_0x943831(0x13d)],'journey':_0x1a1291['journey'],'user':_0x1a1291[_0x943831(0x1b6)],'connection':_0x1a1291[_0x943831(0x1a4)]};_0xcce0aa[_0x943831(0x145)]>0x0&&(_0xfa1079=await executePushFolders(_0x38e4ab,_0xcce0aa,_0xfa1079,{'parentId':_0x189efd},_0x2077b5));const _0x3552c0={'rootFolderId':_0x49ef83,'folderPathToId':_0xfa1079,'folderIdToPath':_0x4756b9,'segmentNameToId':_0x1002ac,'activationsBySegmentId':_0x3d4888,'emailToIdMap':_0x47f032,'idToEmailMap':_0x24ad6c,'connectionNameToIdMap':_0x10cdb6['nameToId'],'connectionIdToNameMap':_0x10cdb6['idToName'],'connectionNameToTypeMap':_0x884f7},_0x22ab5f=await executePushSegments(_0x38e4ab,_0xca0657[_0x943831(0x144)]?[]:_0x55de29,_0x3552c0,{'parentId':_0x189efd},_0x2077b5),_0x2a829a=_0x22ab5f[_0x943831(0x132)],_0x1a5edf=_0x22ab5f[_0x943831(0x1c1)],_0xb8fa29=_0x22ab5f[_0x943831(0x14e)]['created'],_0x112106=_0x22ab5f[_0x943831(0x14e)][_0x943831(0x1c1)],_0x1aad5d=_0x22ab5f[_0x943831(0x14e)]['deleted'];let _0x476e9f;if(_0x2a311d&&_0x55de29[_0x943831(0x145)]===0x1){const _0x344134=_0x55de29[0x0];_0x476e9f=_0x344134[_0x943831(0x1a1)]?.['id']??_0x22ab5f[_0x943831(0x18a)]['get'](_0x344134[_0x943831(0x195)][_0x943831(0x139)]);}const _0x452126=await executePushSegmentDeletions(_0x38e4ab,_0xca0657[_0x943831(0x144)]?[]:_0x10d64f,_0x2077b5);let _0x2f23d1=0x0,_0x293305=0x0,_0x6a3add=0x0;const _0x4d5bc2=new Map(_0x1002ac);for(const [_0x5a93e7,_0x8abc38]of _0x22ab5f[_0x943831(0x18a)]){_0x4d5bc2['set'](_0x5a93e7,_0x8abc38);}if(_0x48258b[_0x943831(0x145)]>0x0){const _0x99b7c9={..._0x3552c0,'segmentNameToId':_0x4d5bc2,'existingSegments':_0x5306ec,'activationContext':_0x233faf},_0x319260=await executePushJourneys(_0x38e4ab,_0x48258b,_0x99b7c9,{'parentId':_0x189efd,'rootFolderId':_0x49ef83,'verbose':_0xca0657['verbose']},_0x2077b5);_0x2f23d1=_0x319260[_0x943831(0x132)],_0x293305=_0x319260['updated'];if(_0x2a311d&&_0x319260['results'][_0x943831(0x145)]===0x1){const _0x279aca=_0x319260[_0x943831(0x160)][0x0];if(_0x279aca['journeyId']){const _0x97e5b2=getConsoleNextUrl(_0xca0657[_0x943831(0x135)],_0x943831(0x174)+_0x189efd+_0x943831(0x192)+_0x279aca[_0x943831(0x19c)]+_0x943831(0x171));console[_0x943831(0x13f)]('\x20\x20'+a40_0x46b1d4[_0x943831(0x15c)](_0x97e5b2));}}}for(const _0x3678f1 of _0x1690ae){console[_0x943831(0x13f)](a40_0x46b1d4[_0x943831(0x18b)]('⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20'+_0x3678f1[_0x943831(0x15d)])),_0x6a3add++;}const _0x300882=[];if(_0x2a829a>0x0)_0x300882['push'](_0x2a829a+_0x943831(0x186));if(_0x1a5edf>0x0)_0x300882[_0x943831(0x178)](_0x1a5edf+_0x943831(0x18d));if(_0x452126>0x0)_0x300882[_0x943831(0x178)](_0x452126+_0x943831(0x1c7));const _0x2d9a4a=[];if(_0x2f23d1>0x0)_0x2d9a4a[_0x943831(0x178)](_0x2f23d1+_0x943831(0x186));if(_0x293305>0x0)_0x2d9a4a[_0x943831(0x178)](_0x293305+_0x943831(0x18d));if(_0x6a3add>0x0)_0x2d9a4a[_0x943831(0x178)](_0x6a3add+_0x943831(0x1c7));const _0xfcc35a=[];if(_0xb8fa29>0x0)_0xfcc35a[_0x943831(0x178)](_0xb8fa29+_0x943831(0x186));if(_0x112106>0x0)_0xfcc35a[_0x943831(0x178)](_0x112106+_0x943831(0x18d));if(_0x1aad5d>0x0)_0xfcc35a[_0x943831(0x178)](_0x1aad5d+_0x943831(0x1c7));console[_0x943831(0x13f)](a40_0x46b1d4[_0x943831(0x1ad)]('\x0a✔\x20Push\x20complete'));_0x300882['length']>0x0&&!_0xca0657[_0x943831(0x144)]&&console['error'](_0x943831(0x13c)+_0x300882[_0x943831(0x146)](',\x20'));_0x2d9a4a[_0x943831(0x145)]>0x0&&console[_0x943831(0x13f)](_0x943831(0x1a6)+_0x2d9a4a['join'](',\x20'));_0xfcc35a[_0x943831(0x145)]>0x0&&!_0xca0657[_0x943831(0x144)]&&console[_0x943831(0x13f)]('\x20\x20Activations:\x20'+_0xfcc35a[_0x943831(0x146)](',\x20'));if(_0x476e9f){const _0x3d5ce8=getConsoleNextUrl(_0xca0657[_0x943831(0x135)],_0x943831(0x174)+_0x189efd+_0x943831(0x192)+_0x476e9f+_0x943831(0x15f));console[_0x943831(0x13f)](_0x943831(0x1b5)+a40_0x46b1d4['cyan'](_0x3d5ce8));}return 0x0;}}
1
+ function a40_0x5003(){const _0x207d37=['\x20updated','blue','\x20folders\x20to\x20create','type','\x20created','segment\x20or\x20journey','journeyId','set','segmentFolderId','21384jicUBd','.yaml','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','updatedAt','paused','✔\x20All\x20journeys\x20are\x20up\x20to\x20date','existingJourney','new','unchanged','/app/ps/','\x20\x20\x20\x20','green','journeys','/sb/da/esr','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','yellow','activations','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','user','\x20changes?','\x20\x20Segments:\x20','journeysOnly','2802118eNkAzY','delete','resolveParentId','toDelete','targetDir','\x20\x20Activations:','repeat','segment','all','endsWith','state','journey','createdSegmentIds','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','listJourneysWithDetailsFromParentSegment','diff','Delete\x20journey:','/e/','versionNumber','\x20unchanged','message','parentFolder','\x20deleted','dim','listFolders','Resolving\x20parent\x20segment\x20\x27','/j/da/je','isNew','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','Preparing\x20journeys...','folderPath','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','helpText','description','\x20\x20🗺️\x20\x20Journeys:','Error:\x20','toUpdate','108TLzKpT','Aborted.','Changes\x20to:','site','get','connection','scopedFolderPath','data','243730SzSwtM','folderId','yes','New\x20segment:','nameToId','.yml','580820vlKRPB','created','📁\x20','parentSegment','\x20to\x20delete','yamlConfig','\x20YAML\x20files\x20found','getParent','Parent\x20segment:\x20','\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20','164732UNSAog','idToName','name','then','\x0aError:','nameToType','\x20new','\x20\x20Activations:\x20','1IlrFbf','Error\x20parsing\x20YAML:\x20','Scoped\x20to\x20folder:\x20','listSegments','map','red','cyan','updated','verbose','audienceId','Source\x20directory:\x20','buildUserMaps','toString','\x20\x20Journeys:\x20','12LxXjLa','file','toCreate','attributes','\x27...','New\x20journey:','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','12824kArBxz','\x20to\x20create','existingSegment','Delete\x20segment:','parentName','\x0aValidation\x20failed:','✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','Error:\x20Directory\x20not\x20found:\x20','4eWcLTR','getJourney','Changes\x20to\x20journey:','\x20activations]','Site:\x20','Push\x20','689759GjVaPR','length','\x20changed','results','segments','\x20to\x20update','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','journeyBundleName','listActivations','push','dryRun','join','error','errorCode','deleted','setPhase','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)','isScoped'];a40_0x5003=function(){return _0x207d37;};return a40_0x5003();}const a40_0x584493=a40_0x29c6;(function(_0x29047e,_0x26c9d1){const _0x4b598d=a40_0x29c6,_0x40d8e9=_0x29047e();while(!![]){try{const _0x2d1d8c=-parseInt(_0x4b598d(0x206))/0x1*(-parseInt(_0x4b598d(0x1fe))/0x2)+-parseInt(_0x4b598d(0x1aa))/0x3+-parseInt(_0x4b598d(0x223))/0x4*(-parseInt(_0x4b598d(0x1ee))/0x5)+-parseInt(_0x4b598d(0x214))/0x6*(-parseInt(_0x4b598d(0x229))/0x7)+parseInt(_0x4b598d(0x21b))/0x8*(-parseInt(_0x4b598d(0x1e6))/0x9)+parseInt(_0x4b598d(0x1f4))/0xa+-parseInt(_0x4b598d(0x1c1))/0xb;if(_0x2d1d8c===_0x26c9d1)break;else _0x40d8e9['push'](_0x40d8e9['shift']());}catch(_0x46bb25){_0x40d8e9['push'](_0x40d8e9['shift']());}}}(a40_0x5003,0x19ace));import{BaseCommand}from'./command.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{generateDiff,formatDiffWithColors}from'../utils/diff.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{batchAsync}from'../utils/async.js';import{segmentToYamlString,segmentWithActivationsToYaml}from'../sdk/segment/child-segment-yaml.js';import a40_0x35f3da 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';function a40_0x29c6(_0x249990,_0x98097b){_0x249990=_0x249990-0x19d;const _0x500324=a40_0x5003();let _0x29c631=_0x500324[_0x249990];return _0x29c631;}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_0x584493(0x200)]='segment:push';[a40_0x584493(0x1e2)]=a40_0x584493(0x1dd);async['execute'](_0x31f7a2){const _0x493c18=a40_0x584493,{options:_0x1b9c71,args:_0x4d5109,tdx:_0x21c6ec}=_0x31f7a2,_0x5d658f=_0x1b9c71,_0xbc4628=await resolveTarget({'arg':_0x4d5109[0x0],'contextParent':_0x1b9c71[_0x493c18(0x1f7)],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0xbc4628))return _0xbc4628[_0x493c18(0x236)]==='no_parent'?(console[_0x493c18(0x235)](a40_0x35f3da[_0x493c18(0x1b9)](_0x493c18(0x1bb))),console[_0x493c18(0x235)](_0x493c18(0x19f)),console[_0x493c18(0x235)](_0x493c18(0x1ac)),console[_0x493c18(0x235)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file')):(console['error'](a40_0x35f3da['red'](_0x493c18(0x1e4)+_0xbc4628[_0x493c18(0x1d5)]+'\x0a')),_0xbc4628['helpText']&&console[_0x493c18(0x235)](a40_0x35f3da[_0x493c18(0x20c)](_0xbc4628[_0x493c18(0x1e1)]))),0x1;if(_0xbc4628[_0x493c18(0x1a4)]==='parent_name')return console[_0x493c18(0x235)](a40_0x35f3da[_0x493c18(0x20b)]('Error:\x20Directory\x20not\x20found:\x20'+_0xbc4628[_0x493c18(0x1c5)]+'\x0a')),console[_0x493c18(0x235)](a40_0x35f3da[_0x493c18(0x20c)](_0x493c18(0x1e0))),0x1;const _0x1a5201=_0xbc4628[_0x493c18(0x21f)],_0x4fd76c=_0xbc4628[_0x493c18(0x1c5)],_0x3d88a0=_0xbc4628['type']===_0x493c18(0x215)?_0xbc4628['filePath']:undefined,_0x196ff1=getScopedDetails(_0xbc4628),_0x4973b8=_0x196ff1?.[_0x493c18(0x1a0)]??![],_0x1e9e4c=_0x196ff1?.[_0x493c18(0x1ec)]??'';if(!existsSync(_0x4fd76c))return console[_0x493c18(0x235)](a40_0x35f3da[_0x493c18(0x20b)](_0x493c18(0x222)+_0x4fd76c+'\x0a')),console[_0x493c18(0x235)](a40_0x35f3da[_0x493c18(0x20c)]('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;_0x5d658f[_0x493c18(0x20e)]&&(console[_0x493c18(0x235)](_0x493c18(0x227)+_0x5d658f[_0x493c18(0x1e9)]),console[_0x493c18(0x235)](_0x493c18(0x1fc)+_0x1a5201),console[_0x493c18(0x235)](_0x493c18(0x210)+_0x4fd76c),_0x4973b8&&console[_0x493c18(0x235)](_0x493c18(0x208)+_0x1e9e4c));const _0x4af65d=await withSpinner(_0x493c18(0x1da)+_0x1a5201+_0x493c18(0x218),()=>_0x21c6ec[_0x493c18(0x1c8)][_0x493c18(0x1c3)](_0x1a5201),{'verbose':_0x5d658f[_0x493c18(0x20e)]}),_0x271701=_0x4af65d[_0x493c18(0x1ed)],{parentSegmentResult:_0x58089d,segmentsResult:_0x36928b,foldersResult:_0x248701,journeysWithDetailsResult:_0x5875f2,userMaps:_0x57b384}=await withSpinner('Fetching\x20existing\x20data...',async()=>{const _0x343bef=_0x493c18,[_0xeb8260,_0x24bf03,_0x494290,_0x56cf02,_0x45e4f4]=await Promise[_0x343bef(0x1c9)]([_0x21c6ec[_0x343bef(0x1c8)][_0x343bef(0x1fb)](_0x271701),_0x21c6ec[_0x343bef(0x1c8)][_0x343bef(0x209)](_0x271701),_0x21c6ec[_0x343bef(0x1c8)][_0x343bef(0x1d9)](_0x271701),_0x21c6ec['journey'][_0x343bef(0x1cf)](_0x271701,{'includeAllVersions':!![]}),_0x21c6ec[_0x343bef(0x1bd)][_0x343bef(0x211)]()]);return{'parentSegmentResult':_0xeb8260,'segmentsResult':_0x24bf03,'foldersResult':_0x494290,'journeysWithDetailsResult':_0x56cf02,'userMaps':_0x45e4f4};},{'verbose':_0x5d658f[_0x493c18(0x20e)]})['then'](_0x8ccb46=>_0x8ccb46[_0x493c18(0x1ed)]),_0x3dc29a=_0x58089d,_0x5df4b3=extractRootFolderId(_0x3dc29a),_0x1808fd=_0x36928b,_0x379b95=_0x248701,{journeys:_0x550bea,activationStepsById:_0x59f918}=_0x5875f2,_0x5f5779=new Map(_0x550bea[_0x493c18(0x20a)](_0x3d9983=>[_0x3d9983['id'],_0x3d9983])),_0x5110bb=_0x550bea['map'](_0x4d0633=>({'id':_0x4d0633['id'],'name':_0x4d0633['attributes']['name'],'journeyBundleName':_0x4d0633[_0x493c18(0x217)][_0x493c18(0x230)]||'','journeyBundleId':_0x4d0633['attributes']['journeyBundleId']||'','versionNumber':_0x4d0633[_0x493c18(0x217)][_0x493c18(0x1d3)],'description':_0x4d0633[_0x493c18(0x217)][_0x493c18(0x1e2)],'state':_0x4d0633['attributes'][_0x493c18(0x1cb)],'paused':_0x4d0633['attributes'][_0x493c18(0x1ae)],'audienceId':_0x4d0633[_0x493c18(0x217)][_0x493c18(0x20f)],'folderId':_0x4d0633['relationships']?.[_0x493c18(0x1d6)]?.[_0x493c18(0x1ed)]?.['id'],'createdAt':_0x4d0633[_0x493c18(0x217)]['createdAt'],'updatedAt':_0x4d0633[_0x493c18(0x217)][_0x493c18(0x1ad)]})),{emailToId:_0x57dd1c,idToEmail:_0x37c8ee}=_0x57b384,_0x540dca=await withSpinner('Fetching\x20connections\x20for\x20name\x20resolution...',async()=>{const _0x118d57=_0x493c18,_0x9efec6=await _0x21c6ec[_0x118d57(0x1eb)]['list']();return buildConnectionMaps(_0x9efec6);},{'verbose':_0x5d658f['verbose']})['then'](_0x1861b4=>_0x1861b4['data']),_0x3f773f=_0x540dca[_0x493c18(0x1f2)],_0x56c0a6=_0x540dca[_0x493c18(0x1ff)],_0x4137b4=_0x540dca[_0x493c18(0x203)],_0x3f5e02={'emailToIdMap':_0x57dd1c,'connectionNameToIdMap':_0x3f773f,'connectionNameToTypeMap':_0x4137b4,'getSchema':_0x42acba=>_0x21c6ec['connection']['getOutputSchemaWithCache'](_0x42acba)};let {pathToId:_0x5db452,idToPath:_0x28f245}=buildFolderMaps(_0x379b95);const _0x189514=buildSegmentLookupMap(_0x1808fd,_0x28f245),_0x4f5a2d=buildSegmentNameToIdMap(_0x1808fd),_0x12e004=buildJourneyBundleLookupMap(_0x5110bb,_0x28f245);let _0x2a27da;if(_0x3d88a0){if(!_0x3d88a0['endsWith'](_0x493c18(0x1f3))&&!_0x3d88a0[_0x493c18(0x1ca)](_0x493c18(0x1ab)))return console['error'](a40_0x35f3da[_0x493c18(0x20b)](_0x493c18(0x21a)+_0x3d88a0+'\x0a')),0x1;_0x2a27da=[_0x3d88a0];}else _0x2a27da=findYamlFiles(_0x4fd76c);if(_0x2a27da['length']===0x0)return console[_0x493c18(0x235)](a40_0x35f3da[_0x493c18(0x20b)]('Error:\x20No\x20YAML\x20files\x20found\x20in\x20'+_0x4fd76c+'\x0a')),console[_0x493c18(0x235)](a40_0x35f3da[_0x493c18(0x20c)]('Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files')),0x1;let _0x1f21bc,_0x8d366b;try{const _0x49efd2=parseAndClassifyYamlFiles(_0x2a27da,_0x4fd76c,{'skipSegments':_0x5d658f[_0x493c18(0x1c0)]});_0x1f21bc=_0x49efd2['segments'],_0x8d366b=_0x49efd2['journeys'];const _0x1d37d4=validateParsedFiles(_0x49efd2,_0x4fd76c);if(_0x1d37d4[_0x493c18(0x22a)]>0x0)return console[_0x493c18(0x235)](a40_0x35f3da[_0x493c18(0x20b)](_0x493c18(0x220))),console['error'](formatValidationErrors(_0x1d37d4)),console[_0x493c18(0x235)](a40_0x35f3da[_0x493c18(0x1b9)](_0x493c18(0x22f))),0x1;}catch(_0x2ef5b7){return console[_0x493c18(0x235)](a40_0x35f3da[_0x493c18(0x20b)](_0x493c18(0x207)+(_0x2ef5b7 instanceof Error?_0x2ef5b7[_0x493c18(0x1d5)]:_0x2ef5b7))),0x1;}if(_0x1f21bc[_0x493c18(0x22a)]===0x0&&_0x8d366b[_0x493c18(0x22a)]===0x0){const _0x4a81de=_0x5d658f[_0x493c18(0x1c0)]?_0x493c18(0x1cc):_0x493c18(0x1a6);return console[_0x493c18(0x235)](a40_0x35f3da[_0x493c18(0x1b9)]('No\x20'+_0x4a81de+_0x493c18(0x1fa))),0x0;}const _0x38e45a=new Map();_0x1808fd[_0x493c18(0x22a)]>0x0&&!_0x5d658f['journeysOnly']&&await withSpinner('Fetching\x20existing\x20activations...',async()=>{await batchAsync(_0x1808fd,async _0x174103=>{const _0x7e63f1=a40_0x29c6,_0x5836b0=await _0x21c6ec['segment'][_0x7e63f1(0x231)](_0x271701,_0x174103['id']);_0x38e45a[_0x7e63f1(0x1a8)](_0x174103['id'],_0x5836b0);});},{'verbose':_0x5d658f[_0x493c18(0x20e)]});const {segmentFiles:_0x565e12,foldersToCreate:_0x17cba0}=await prepareSegmentFiles(_0x1f21bc,{'segmentByFolderAndName':_0x189514,'activationsBySegmentId':_0x38e45a,'folderPathToId':_0x5db452,'idToEmailMap':_0x37c8ee,'connectionIdToNameMap':_0x56c0a6},_0x3f5e02,_0x4973b8,_0x1e9e4c),_0x2bc97a=_0x3d88a0?[]:findSegmentsToDelete(_0x1808fd,_0x1f21bc[_0x493c18(0x20a)](({yamlConfig:_0x26a97b,folderPath:_0x3d74fe})=>({'yamlConfig':_0x26a97b,'folderPath':resolveTDFolderPath(_0x3d74fe,_0x4973b8,_0x1e9e4c)})),_0x28f245,_0x1e9e4c,_0x4973b8),{journeyFiles:_0xfc6539,foldersToCreate:_0x40f38f}=await withProgressSpinner(_0x493c18(0x1de),async _0x280814=>prepareJourneyFiles(_0x8d366b,{'fetchJourney':async _0x20d286=>_0x21c6ec[_0x493c18(0x1cc)][_0x493c18(0x224)](_0x20d286[_0x493c18(0x1a7)]),'journeyBundlesByFolderAndName':_0x12e004,'folderPathToId':_0x5db452,'idToEmailMap':_0x37c8ee,'connectionIdToNameMap':_0x56c0a6,'existingSegments':_0x1808fd,'parentId':_0x271701,'deps':_0x21c6ec,'progress':{'update':_0x2b45bd=>{const _0x3b38ce=_0x493c18;_0x280814[_0x3b38ce(0x19e)](_0x2b45bd),_0x5d658f[_0x3b38ce(0x20e)]&&console['error']('\x20\x20'+_0x2b45bd);}},'journeyById':_0x5f5779,'activationStepsById':_0x59f918},_0x4973b8,_0x1e9e4c),{'verbose':_0x5d658f[_0x493c18(0x20e)]})[_0x493c18(0x201)](_0x5d6882=>_0x5d6882[_0x493c18(0x1ed)]);for(const _0x2f0c34 of _0x40f38f){_0x17cba0['add'](_0x2f0c34);}const _0x48d809=_0x3d88a0?[]:findJourneysToDelete(_0x5110bb,_0x8d366b[_0x493c18(0x20a)](({yamlConfig:_0x202857,folderPath:_0x9f709d})=>({'yamlConfig':_0x202857,'folderPath':resolveTDFolderPath(_0x9f709d,_0x4973b8,_0x1e9e4c)})),_0x28f245,_0x1e9e4c,_0x4973b8),_0x4e3b23=calculatePushStats(_0x565e12,_0xfc6539,_0x17cba0,_0x2bc97a,_0x48d809,!!_0x5d658f['delete'],!!_0x5d658f[_0x493c18(0x1c0)]),_0x39d9ad=_0x4e3b23[_0x493c18(0x22d)][_0x493c18(0x1b1)],_0x1b01c7=_0x4e3b23[_0x493c18(0x22d)]['changed'],_0x16a54c=_0x4e3b23[_0x493c18(0x22d)]['unchanged'],_0x5e41cd=_0x4e3b23['segments']['toDelete'],_0x345c27=_0x4e3b23['folders'][_0x493c18(0x216)],_0x4c0e9f=_0x4e3b23[_0x493c18(0x1b6)][_0x493c18(0x1b1)],_0x481d31=_0x4e3b23[_0x493c18(0x1b6)]['changed'],_0x51b121=_0x4e3b23[_0x493c18(0x1b6)][_0x493c18(0x1b2)],_0x3a348b=_0x4e3b23['journeys']['toDelete'],_0x42b088=_0x4e3b23[_0x493c18(0x1ba)][_0x493c18(0x1c9)],_0x110ea3=_0x4e3b23[_0x493c18(0x1ba)][_0x493c18(0x216)],_0x2313a7=_0x4e3b23['activations'][_0x493c18(0x1e5)],_0x20b593=_0x4e3b23[_0x493c18(0x1ba)][_0x493c18(0x1c4)];console[_0x493c18(0x235)]('\x0aPush\x20summary\x20for\x20\x27'+_0x1a5201+'\x27:');_0x345c27[_0x493c18(0x22a)]>0x0&&console[_0x493c18(0x235)]('\x20\x20'+a40_0x35f3da[_0x493c18(0x1a2)](_0x493c18(0x1f6)+_0x345c27[_0x493c18(0x22a)]+_0x493c18(0x1a3)));if(!_0x5d658f[_0x493c18(0x1c0)]){console['error']('\x20\x20📊\x20Segments:'),console['error'](_0x493c18(0x1b4)+a40_0x35f3da[_0x493c18(0x1b5)]('+\x20'+_0x39d9ad[_0x493c18(0x22a)]+_0x493c18(0x204))),console['error'](_0x493c18(0x1b4)+a40_0x35f3da[_0x493c18(0x1b9)]('~\x20'+_0x1b01c7['length']+_0x493c18(0x22b)));if(_0x5e41cd[_0x493c18(0x22a)]>0x0)console['error'](_0x493c18(0x1b4)+a40_0x35f3da['red']('-\x20'+_0x5e41cd['length']+_0x493c18(0x1f8)));else _0x2bc97a['length']>0x0&&!_0x5d658f[_0x493c18(0x1c2)]&&console['error'](_0x493c18(0x1b4)+a40_0x35f3da['dim'](_0x2bc97a[_0x493c18(0x22a)]+_0x493c18(0x1bc)));console[_0x493c18(0x235)](_0x493c18(0x1b4)+a40_0x35f3da['dim']('=\x20'+_0x16a54c['length']+'\x20unchanged'));}if(_0xfc6539['length']>0x0||_0x48d809[_0x493c18(0x22a)]>0x0){console['error'](_0x493c18(0x1e3)),console[_0x493c18(0x235)]('\x20\x20\x20\x20'+a40_0x35f3da[_0x493c18(0x1b5)]('+\x20'+_0x4c0e9f[_0x493c18(0x22a)]+_0x493c18(0x204))),console['error'](_0x493c18(0x1b4)+a40_0x35f3da[_0x493c18(0x1b9)]('~\x20'+_0x481d31[_0x493c18(0x22a)]+_0x493c18(0x22b)));if(_0x3a348b['length']>0x0)console[_0x493c18(0x235)]('\x20\x20\x20\x20'+a40_0x35f3da[_0x493c18(0x20b)]('-\x20'+_0x3a348b['length']+_0x493c18(0x1f8)));else _0x48d809[_0x493c18(0x22a)]>0x0&&!_0x5d658f['delete']&&console[_0x493c18(0x235)](_0x493c18(0x1b4)+a40_0x35f3da[_0x493c18(0x1d8)](_0x48d809['length']+'\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)'));console['error']('\x20\x20\x20\x20'+a40_0x35f3da[_0x493c18(0x1d8)]('=\x20'+_0x51b121[_0x493c18(0x22a)]+_0x493c18(0x1d4)));}_0x42b088[_0x493c18(0x22a)]>0x0&&!_0x5d658f['journeysOnly']&&(console[_0x493c18(0x235)](''),console['error'](_0x493c18(0x1c6)),_0x110ea3['length']>0x0&&console[_0x493c18(0x235)]('\x20\x20\x20\x20'+a40_0x35f3da[_0x493c18(0x1b5)]('+\x20'+_0x110ea3[_0x493c18(0x22a)]+_0x493c18(0x21c))),_0x2313a7[_0x493c18(0x22a)]>0x0&&console[_0x493c18(0x235)]('\x20\x20\x20\x20'+a40_0x35f3da[_0x493c18(0x1b9)]('~\x20'+_0x2313a7[_0x493c18(0x22a)]+_0x493c18(0x22e))),_0x20b593[_0x493c18(0x22a)]>0x0&&console[_0x493c18(0x235)](_0x493c18(0x1b4)+a40_0x35f3da[_0x493c18(0x20b)]('-\x20'+_0x20b593['length']+'\x20to\x20delete')));console[_0x493c18(0x235)]('\x20\x20Source:\x20'+a40_0x35f3da['cyan'](_0x4fd76c)+'\x0a');if(_0x345c27[_0x493c18(0x22a)]>0x0){console['error']('Folders\x20to\x20create:');for(const _0x15ef79 of _0x345c27){console['error']('\x20\x20'+a40_0x35f3da[_0x493c18(0x1a2)]('+')+'\x20'+_0x15ef79);}console[_0x493c18(0x235)]('');}if(_0x39d9ad[_0x493c18(0x22a)]>0x0&&!_0x5d658f['journeysOnly'])for(const _0x3a5255 of _0x39d9ad){const _0x154e82=_0x3a5255[_0x493c18(0x1df)]?_0x3a5255['folderPath']+'/'+_0x3a5255['yamlConfig'][_0x493c18(0x200)]:_0x3a5255[_0x493c18(0x1f9)][_0x493c18(0x200)],_0x23c3cf=_0x3a5255[_0x493c18(0x1f9)][_0x493c18(0x1ba)]?.[_0x493c18(0x22a)]||0x0,_0x4a25f5=_0x23c3cf>0x0?a40_0x35f3da[_0x493c18(0x1d8)]('\x20['+_0x23c3cf+_0x493c18(0x226)):'';console[_0x493c18(0x235)]('\x0a'+a40_0x35f3da[_0x493c18(0x1b5)](_0x493c18(0x1f1))+'\x20'+_0x154e82+_0x4a25f5),console[_0x493c18(0x235)]('─'[_0x493c18(0x1c7)](0x3c)),_0x3a5255[_0x493c18(0x1d0)]&&console[_0x493c18(0x235)](_0x3a5255[_0x493c18(0x1d0)]),console[_0x493c18(0x235)]('─'['repeat'](0x3c));}if(_0x5e41cd['length']>0x0&&!_0x5d658f[_0x493c18(0x1c0)])for(const _0x30734a of _0x5e41cd){const _0x3f6156=_0x30734a[_0x493c18(0x1a9)]?_0x28f245[_0x493c18(0x1ea)](_0x30734a[_0x493c18(0x1a9)][_0x493c18(0x212)]())||'':'',_0x567f40=_0x3f6156?_0x3f6156+'/'+_0x30734a[_0x493c18(0x200)]:_0x30734a['name'],_0x4ea76c=_0x38e45a[_0x493c18(0x1ea)](_0x30734a['id'])||[],_0x1a45e0=_0x4ea76c[_0x493c18(0x22a)]>0x0?a40_0x35f3da[_0x493c18(0x1d8)]('\x20['+_0x4ea76c[_0x493c18(0x22a)]+'\x20activations]'):'';console[_0x493c18(0x235)]('\x0a'+a40_0x35f3da[_0x493c18(0x20b)](_0x493c18(0x21e))+'\x20'+_0x567f40+_0x1a45e0),console[_0x493c18(0x235)]('─'[_0x493c18(0x1c7)](0x3c));const _0x3463bb=segmentWithActivationsToYaml(_0x30734a,_0x4ea76c,undefined,_0x37c8ee,_0x56c0a6),_0x52c99b=segmentToYamlString(_0x3463bb),_0xd1ad58=generateDiff(_0x52c99b,'');console['error'](formatDiffWithColors(_0xd1ad58)),console[_0x493c18(0x235)]('─'[_0x493c18(0x1c7)](0x3c));}const _0x5a46aa=_0x565e12['filter'](_0x406ed2=>!_0x406ed2[_0x493c18(0x1dc)]&&_0x406ed2['diff']);if(_0x5a46aa['length']>0x0&&!_0x5d658f[_0x493c18(0x1c0)])for(const _0x1ce15d of _0x5a46aa){const _0x332b07=_0x1ce15d['folderPath']?_0x1ce15d[_0x493c18(0x1df)]+'/'+_0x1ce15d[_0x493c18(0x1f9)][_0x493c18(0x200)]:_0x1ce15d['yamlConfig'][_0x493c18(0x200)];console[_0x493c18(0x235)]('\x0a'+a40_0x35f3da[_0x493c18(0x1b9)](_0x493c18(0x1e8))+'\x20'+_0x332b07),console['error']('─'[_0x493c18(0x1c7)](0x3c)),console[_0x493c18(0x235)](_0x1ce15d[_0x493c18(0x1d0)]),console[_0x493c18(0x235)]('─'['repeat'](0x3c));}if(_0x4c0e9f[_0x493c18(0x22a)]>0x0)for(const _0x39d55d of _0x4c0e9f){const _0x16ee5e=_0x39d55d[_0x493c18(0x1df)]?_0x39d55d[_0x493c18(0x1df)]+'/'+_0x39d55d[_0x493c18(0x1f9)][_0x493c18(0x200)]:_0x39d55d['yamlConfig'][_0x493c18(0x200)];console['error']('\x0a'+a40_0x35f3da['green'](_0x493c18(0x219))+'\x20'+_0x16ee5e),console[_0x493c18(0x235)]('─'['repeat'](0x3c)),_0x39d55d[_0x493c18(0x1d0)]&&console[_0x493c18(0x235)](_0x39d55d['diff']),console[_0x493c18(0x235)]('─'[_0x493c18(0x1c7)](0x3c));}const _0x27446d=_0xfc6539['filter'](_0x137b58=>!_0x137b58[_0x493c18(0x1dc)]&&_0x137b58['diff']);if(_0x27446d[_0x493c18(0x22a)]>0x0)for(const _0x42ff73 of _0x27446d){const _0x769384=_0x42ff73[_0x493c18(0x1df)]?_0x42ff73[_0x493c18(0x1df)]+'/'+_0x42ff73[_0x493c18(0x1f9)][_0x493c18(0x200)]:_0x42ff73[_0x493c18(0x1f9)]['name'];console[_0x493c18(0x235)]('\x0a'+a40_0x35f3da[_0x493c18(0x1b9)](_0x493c18(0x225))+'\x20'+_0x769384),console[_0x493c18(0x235)]('─'[_0x493c18(0x1c7)](0x3c)),console[_0x493c18(0x235)](_0x42ff73[_0x493c18(0x1d0)]),console[_0x493c18(0x235)]('─'[_0x493c18(0x1c7)](0x3c));}if(_0x3a348b[_0x493c18(0x22a)]>0x0)for(const _0x46205c of _0x3a348b){const _0x41fff9=_0x46205c[_0x493c18(0x1ef)]?_0x28f245[_0x493c18(0x1ea)](_0x46205c[_0x493c18(0x1ef)])||'':'',_0x397f5b=_0x41fff9?_0x41fff9+'/'+_0x46205c['journeyBundleName']:_0x46205c[_0x493c18(0x230)];console[_0x493c18(0x235)]('\x0a'+a40_0x35f3da[_0x493c18(0x20b)](_0x493c18(0x1d1))+'\x20'+_0x397f5b),console[_0x493c18(0x235)]('─'[_0x493c18(0x1c7)](0x3c)),console[_0x493c18(0x235)](a40_0x35f3da[_0x493c18(0x20b)]('(Journey\x20will\x20be\x20deleted)')),console['error']('─'[_0x493c18(0x1c7)](0x3c));}if(_0x5d658f[_0x493c18(0x233)])return console['error'](a40_0x35f3da[_0x493c18(0x1b9)]('\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made')),0x0;const _0x25d605=_0x5d658f[_0x493c18(0x1c0)]?![]:_0x39d9ad['length']>0x0||_0x1b01c7[_0x493c18(0x22a)]>0x0||_0x5e41cd['length']>0x0,_0x17008f=_0x4c0e9f[_0x493c18(0x22a)]>0x0||_0x481d31[_0x493c18(0x22a)]>0x0||_0x3a348b['length']>0x0,_0x2b4a25=_0x5d658f[_0x493c18(0x1c0)]?![]:_0x42b088[_0x493c18(0x22a)]>0x0,_0xec1a3d=_0x345c27[_0x493c18(0x22a)]>0x0;if(!_0x25d605&&!_0x17008f&&!_0x2b4a25&&!_0xec1a3d){const _0xce480a=_0x5d658f[_0x493c18(0x1c0)]?_0x493c18(0x1af):_0x493c18(0x221);console[_0x493c18(0x235)](a40_0x35f3da[_0x493c18(0x1b5)](_0xce480a));if(_0x3d88a0&&_0x16a54c[_0x493c18(0x22a)]===0x1){const _0x346d81=_0x16a54c[0x0];if(_0x346d81[_0x493c18(0x21d)]?.['id']){const _0x3371ce=getConsoleNextUrl(_0x5d658f[_0x493c18(0x1e9)],_0x493c18(0x1b3)+_0x271701+_0x493c18(0x1d2)+_0x346d81['existingSegment']['id']+_0x493c18(0x1b7));console[_0x493c18(0x235)](_0x493c18(0x1fd)+a40_0x35f3da[_0x493c18(0x20c)](_0x3371ce));}}if(_0x3d88a0&&_0x51b121[_0x493c18(0x22a)]===0x1){const _0xb08500=_0x51b121[0x0];if(_0xb08500[_0x493c18(0x1b0)]?.['id']){const _0x2a4488=getConsoleNextUrl(_0x5d658f[_0x493c18(0x1e9)],_0x493c18(0x1b3)+_0x271701+_0x493c18(0x1d2)+_0xb08500[_0x493c18(0x1b0)]['id']+_0x493c18(0x1db));console['error']('\x20\x20'+a40_0x35f3da['cyan'](_0x2a4488));}}return 0x0;}const _0x247410=_0x5d658f[_0x493c18(0x1c0)]?_0x4c0e9f[_0x493c18(0x22a)]+_0x481d31['length']+_0x3a348b[_0x493c18(0x22a)]+_0x345c27[_0x493c18(0x22a)]:_0x39d9ad['length']+_0x1b01c7[_0x493c18(0x22a)]+_0x5e41cd['length']+_0x4c0e9f[_0x493c18(0x22a)]+_0x481d31[_0x493c18(0x22a)]+_0x3a348b[_0x493c18(0x22a)]+_0x345c27['length']+_0x42b088[_0x493c18(0x22a)];if(!_0x5d658f[_0x493c18(0x1f0)]&&_0x247410>0x0){if(!isInteractive())return console['error'](a40_0x35f3da[_0x493c18(0x20b)](_0x493c18(0x202)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console['error'](a40_0x35f3da[_0x493c18(0x1d8)](_0x493c18(0x1ce))),0x1;const _0x501ddd=await confirmKey(_0x493c18(0x228)+_0x247410+_0x493c18(0x1be));if(!_0x501ddd)return console[_0x493c18(0x235)](a40_0x35f3da['yellow'](_0x493c18(0x1e7))),0x1;}const _0xe1fb0b={'withProgress':async(_0x359b96,_0x1d75dd)=>{const _0x55d73c=_0x493c18,_0x15235c=await withSpinner(_0x359b96,_0x1d75dd,{'verbose':_0x5d658f['verbose']});return{'data':_0x15235c[_0x55d73c(0x1ed)]};},'logInfo':_0x3f1afa=>console[_0x493c18(0x235)](a40_0x35f3da[_0x493c18(0x1a2)]('✔\x20'+_0x3f1afa)),'logSuccess':_0x158cdb=>console['error'](a40_0x35f3da[_0x493c18(0x1b5)]('✔\x20'+_0x158cdb)),'logWarning':_0x49cf48=>console[_0x493c18(0x235)](a40_0x35f3da['yellow']('⚠\x20'+_0x49cf48)),'logDeleted':_0xc9f815=>console[_0x493c18(0x235)](a40_0x35f3da['red']('✔\x20'+_0xc9f815))},_0x2365de={'segment':_0x21c6ec[_0x493c18(0x1c8)],'journey':_0x21c6ec[_0x493c18(0x1cc)],'user':_0x21c6ec['user'],'connection':_0x21c6ec[_0x493c18(0x1eb)]};_0x345c27['length']>0x0&&(_0x5db452=await executePushFolders(_0x2365de,_0x345c27,_0x5db452,{'parentId':_0x271701},_0xe1fb0b));const _0x4246bc={'rootFolderId':_0x5df4b3,'folderPathToId':_0x5db452,'folderIdToPath':_0x28f245,'segmentNameToId':_0x4f5a2d,'activationsBySegmentId':_0x38e45a,'emailToIdMap':_0x57dd1c,'idToEmailMap':_0x37c8ee,'connectionNameToIdMap':_0x540dca['nameToId'],'connectionIdToNameMap':_0x540dca[_0x493c18(0x1ff)],'connectionNameToTypeMap':_0x4137b4},_0x28836a=await executePushSegments(_0x2365de,_0x5d658f['journeysOnly']?[]:_0x565e12,_0x4246bc,{'parentId':_0x271701},_0xe1fb0b),_0x43fcbe=_0x28836a[_0x493c18(0x1f5)],_0x1795c5=_0x28836a[_0x493c18(0x20d)],_0x237adc=_0x28836a[_0x493c18(0x1ba)]['created'],_0x548a5c=_0x28836a[_0x493c18(0x1ba)]['updated'],_0x108a1a=_0x28836a[_0x493c18(0x1ba)][_0x493c18(0x19d)];let _0x299ba2;if(_0x3d88a0&&_0x565e12[_0x493c18(0x22a)]===0x1){const _0x47b264=_0x565e12[0x0];_0x299ba2=_0x47b264[_0x493c18(0x21d)]?.['id']??_0x28836a[_0x493c18(0x1cd)][_0x493c18(0x1ea)](_0x47b264[_0x493c18(0x1f9)]['name']);}const _0x39e2c4=await executePushSegmentDeletions(_0x2365de,_0x5d658f[_0x493c18(0x1c0)]?[]:_0x5e41cd,_0xe1fb0b);let _0x5af689=0x0,_0xcf4452=0x0,_0x4523e1=0x0;const _0x3b4954=new Map(_0x4f5a2d);for(const [_0x1b0908,_0x5f5d5a]of _0x28836a['createdSegmentIds']){_0x3b4954[_0x493c18(0x1a8)](_0x1b0908,_0x5f5d5a);}if(_0xfc6539[_0x493c18(0x22a)]>0x0){const _0x83b450={..._0x4246bc,'segmentNameToId':_0x3b4954,'existingSegments':_0x1808fd,'activationContext':_0x3f5e02},_0x17b331=await executePushJourneys(_0x2365de,_0xfc6539,_0x83b450,{'parentId':_0x271701,'rootFolderId':_0x5df4b3,'verbose':_0x5d658f[_0x493c18(0x20e)]},_0xe1fb0b);_0x5af689=_0x17b331[_0x493c18(0x1f5)],_0xcf4452=_0x17b331['updated'];if(_0x3d88a0&&_0x17b331[_0x493c18(0x22c)][_0x493c18(0x22a)]===0x1){const _0x1e1d25=_0x17b331[_0x493c18(0x22c)][0x0];if(_0x1e1d25[_0x493c18(0x1a7)]){const _0x487045=getConsoleNextUrl(_0x5d658f['site'],_0x493c18(0x1b3)+_0x271701+_0x493c18(0x1d2)+_0x1e1d25[_0x493c18(0x1a7)]+_0x493c18(0x1db));console[_0x493c18(0x235)]('\x20\x20'+a40_0x35f3da['cyan'](_0x487045));}}}for(const _0xc235f4 of _0x3a348b){console[_0x493c18(0x235)](a40_0x35f3da[_0x493c18(0x1b9)](_0x493c18(0x1b8)+_0xc235f4[_0x493c18(0x230)])),_0x4523e1++;}const _0x3b0708=[];if(_0x43fcbe>0x0)_0x3b0708[_0x493c18(0x232)](_0x43fcbe+'\x20created');if(_0x1795c5>0x0)_0x3b0708[_0x493c18(0x232)](_0x1795c5+_0x493c18(0x1a1));if(_0x39e2c4>0x0)_0x3b0708[_0x493c18(0x232)](_0x39e2c4+_0x493c18(0x1d7));const _0x49ad01=[];if(_0x5af689>0x0)_0x49ad01[_0x493c18(0x232)](_0x5af689+_0x493c18(0x1a5));if(_0xcf4452>0x0)_0x49ad01[_0x493c18(0x232)](_0xcf4452+'\x20updated');if(_0x4523e1>0x0)_0x49ad01[_0x493c18(0x232)](_0x4523e1+_0x493c18(0x1d7));const _0x3ebd19=[];if(_0x237adc>0x0)_0x3ebd19[_0x493c18(0x232)](_0x237adc+_0x493c18(0x1a5));if(_0x548a5c>0x0)_0x3ebd19['push'](_0x548a5c+'\x20updated');if(_0x108a1a>0x0)_0x3ebd19[_0x493c18(0x232)](_0x108a1a+'\x20deleted');console[_0x493c18(0x235)](a40_0x35f3da[_0x493c18(0x1b5)]('\x0a✔\x20Push\x20complete'));_0x3b0708[_0x493c18(0x22a)]>0x0&&!_0x5d658f[_0x493c18(0x1c0)]&&console[_0x493c18(0x235)](_0x493c18(0x1bf)+_0x3b0708[_0x493c18(0x234)](',\x20'));_0x49ad01[_0x493c18(0x22a)]>0x0&&console[_0x493c18(0x235)](_0x493c18(0x213)+_0x49ad01[_0x493c18(0x234)](',\x20'));_0x3ebd19[_0x493c18(0x22a)]>0x0&&!_0x5d658f['journeysOnly']&&console[_0x493c18(0x235)](_0x493c18(0x205)+_0x3ebd19[_0x493c18(0x234)](',\x20'));if(_0x299ba2){const _0x13d1b0=getConsoleNextUrl(_0x5d658f[_0x493c18(0x1e9)],_0x493c18(0x1b3)+_0x271701+_0x493c18(0x1d2)+_0x299ba2+_0x493c18(0x1b7));console['error'](_0x493c18(0x1fd)+a40_0x35f3da[_0x493c18(0x20c)](_0x13d1b0));}return 0x0;}}
@@ -1 +1 @@
1
- const a41_0x393ccf=a41_0x2867;(function(_0x59cee3,_0x2fa900){const _0x2d3472=a41_0x2867,_0x34c4b5=_0x59cee3();while(!![]){try{const _0x4df507=-parseInt(_0x2d3472(0xf8))/0x1*(parseInt(_0x2d3472(0x104))/0x2)+parseInt(_0x2d3472(0x110))/0x3*(-parseInt(_0x2d3472(0x106))/0x4)+-parseInt(_0x2d3472(0xfc))/0x5+-parseInt(_0x2d3472(0x120))/0x6+parseInt(_0x2d3472(0x11a))/0x7*(-parseInt(_0x2d3472(0x10d))/0x8)+-parseInt(_0x2d3472(0xf7))/0x9*(-parseInt(_0x2d3472(0x10e))/0xa)+-parseInt(_0x2d3472(0x112))/0xb*(-parseInt(_0x2d3472(0x109))/0xc);if(_0x4df507===_0x2fa900)break;else _0x34c4b5['push'](_0x34c4b5['shift']());}catch(_0x448e8b){_0x34c4b5['push'](_0x34c4b5['shift']());}}}(a41_0x41a4,0x3e7a3));function a41_0x41a4(){const _0x151b24=['name','segment:update','segment','Parent\x20ID:\x20','description','Segment\x20ID\x20missing\x20from\x20resolved\x20path','segmentPath','7mOmksu','data','INTERNAL','\x27...','Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]','Resolved\x20type:\x20','1844382jSOpLM','⚠\x20Deprecation\x20warning:\x20`segment\x20update`\x20is\x20deprecated.','execute','folder','Update\x20existing\x20child\x20segment','includes','rule','Resolving\x20folder\x20\x27','45qnQesT','7nYdbQJ','kind','Updating\x20segment\x20\x27','yellow','1417510pjfVVy','Resolved\x20relative\x20path\x20to:\x20','verbose','Segment\x20ID:\x20','\x20\x20\x20Path:\x20','\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','Resolved\x20folder\x20ID:\x20','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','120214ltzNhq','.\x20Only\x20child\x20segments\x20can\x20be\x20updated.','7244ycqyWt','type','error','214380ClRUZI','parentId','\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22','✔\x20Updated\x20segment\x20\x27','1375208lxvkCt','610110wXbgMc','ruleFile','222OzUneT','updateSegmentById','781NLbJMi'];a41_0x41a4=function(){return _0x151b24;};return a41_0x41a4();}import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{SDKError,ErrorCode}from'../sdk/index.js';function a41_0x2867(_0x531bfb,_0x590a51){_0x531bfb=_0x531bfb-0xf1;const _0x41a4ef=a41_0x41a4();let _0x286726=_0x41a4ef[_0x531bfb];return _0x286726;}import a41_0x146fc4 from'chalk';export class SegmentUpdateCommand extends BaseCommand{[a41_0x393ccf(0x113)]=a41_0x393ccf(0x114);[a41_0x393ccf(0x117)]=a41_0x393ccf(0xf3);async[a41_0x393ccf(0xf1)](_0x369e18){const _0x5d324d=a41_0x393ccf;console['error'](a41_0x146fc4[_0x5d324d(0xfb)](_0x5d324d(0x121))),console['error'](a41_0x146fc4[_0x5d324d(0xfb)](_0x5d324d(0x103)));const {options:_0x2d57ad,args:_0x68d648,tdx:_0x524216}=_0x369e18,_0x4cee2e=_0x2d57ad;if(_0x68d648['length']===0x0)return console[_0x5d324d(0x108)]('Error:\x20Segment\x20path\x20or\x20name\x20is\x20required'),console[_0x5d324d(0x108)](_0x5d324d(0x11e)),console[_0x5d324d(0x108)]('Examples:'),console[_0x5d324d(0x108)](_0x5d324d(0x10b)),console['error'](_0x5d324d(0x101)),0x1;const _0x54a54a=_0x68d648[0x0],_0x9be270=_0x2d57ad[_0x5d324d(0x119)];let _0x3e608d=_0x54a54a;_0x9be270&&!_0x54a54a[_0x5d324d(0xf4)]('/')&&(_0x3e608d=_0x9be270+'/'+_0x54a54a,_0x4cee2e[_0x5d324d(0xfe)]&&console[_0x5d324d(0x108)](_0x5d324d(0xfd)+_0x3e608d));const _0x1a0e8f=await withSpinner('Resolving\x20path\x20\x27'+_0x3e608d+_0x5d324d(0x11d),()=>_0x524216['segment']['resolvePathToResource'](_0x3e608d),{'verbose':_0x4cee2e[_0x5d324d(0xfe)]}),_0x35d151=_0x1a0e8f['data'];_0x4cee2e['verbose']&&console[_0x5d324d(0x108)](_0x5d324d(0x11f)+_0x35d151[_0x5d324d(0x107)]);if(_0x35d151['type']!==_0x5d324d(0x115))return console[_0x5d324d(0x108)]('Error:\x20Cannot\x20update\x20'+_0x35d151[_0x5d324d(0x107)]+_0x5d324d(0x105)),console[_0x5d324d(0x108)]('Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]'),0x1;if(!_0x35d151['segmentId'])throw new SDKError(ErrorCode[_0x5d324d(0x11c)],_0x5d324d(0x118));const _0x5d791c=_0x35d151[_0x5d324d(0x10a)],_0x30e81e=_0x35d151['segmentId'];_0x4cee2e['verbose']&&(console[_0x5d324d(0x108)](_0x5d324d(0x116)+_0x5d791c),console[_0x5d324d(0x108)](_0x5d324d(0xff)+_0x30e81e));let _0x40d0d9;if(_0x4cee2e[_0x5d324d(0xf2)]){const _0x271b71=_0x4cee2e[_0x5d324d(0xf2)],_0x27526b=await withSpinner(_0x5d324d(0xf6)+_0x271b71+_0x5d324d(0x11d),()=>_0x524216[_0x5d324d(0x115)]['resolveFolderId'](_0x5d791c,_0x271b71),{'verbose':_0x4cee2e[_0x5d324d(0xfe)]});_0x40d0d9=parseInt(_0x27526b[_0x5d324d(0x11b)],0xa),_0x4cee2e[_0x5d324d(0xfe)]&&console[_0x5d324d(0x108)](_0x5d324d(0x102)+_0x40d0d9);}const _0x13a99b=await loadJSONFromOptions(_0x4cee2e[_0x5d324d(0xf5)],_0x4cee2e[_0x5d324d(0x10f)]),_0x5efa93={'name':_0x4cee2e[_0x5d324d(0x113)],'description':_0x4cee2e[_0x5d324d(0x117)],'rule':_0x13a99b,'kind':_0x4cee2e[_0x5d324d(0xf9)]!==undefined?parseInt(_0x4cee2e['kind'],0xa):undefined,'segmentFolderId':_0x40d0d9},_0x577ea8=await withSpinner(_0x5d324d(0xfa)+_0x35d151['segmentName']+_0x5d324d(0x11d),()=>_0x524216[_0x5d324d(0x115)][_0x5d324d(0x111)](_0x5d791c,_0x30e81e,_0x5efa93),{'verbose':_0x4cee2e[_0x5d324d(0xfe)]}),_0x36bd60=_0x577ea8[_0x5d324d(0x11b)];return console[_0x5d324d(0x108)](_0x5d324d(0x10c)+_0x36bd60[_0x5d324d(0x113)]+'\x27'),_0x3e608d!==_0x54a54a&&console['error'](_0x5d324d(0x100)+_0x3e608d),await handleSDKOutput([_0x36bd60],_0x4cee2e),0x0;}}
1
+ const a41_0x29b3f1=a41_0x5663;(function(_0x1fcd6e,_0x3ddb7f){const _0x1958ba=a41_0x5663,_0x15a866=_0x1fcd6e();while(!![]){try{const _0x43a581=parseInt(_0x1958ba(0x190))/0x1+-parseInt(_0x1958ba(0x162))/0x2*(parseInt(_0x1958ba(0x178))/0x3)+parseInt(_0x1958ba(0x17f))/0x4*(-parseInt(_0x1958ba(0x17a))/0x5)+-parseInt(_0x1958ba(0x16e))/0x6*(parseInt(_0x1958ba(0x16d))/0x7)+-parseInt(_0x1958ba(0x179))/0x8*(parseInt(_0x1958ba(0x163))/0x9)+parseInt(_0x1958ba(0x189))/0xa+parseInt(_0x1958ba(0x165))/0xb;if(_0x43a581===_0x3ddb7f)break;else _0x15a866['push'](_0x15a866['shift']());}catch(_0x64c0a2){_0x15a866['push'](_0x15a866['shift']());}}}(a41_0x58ea,0x489df));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';function a41_0x5663(_0x1ba3cf,_0x306dbf){_0x1ba3cf=_0x1ba3cf-0x15f;const _0x58ea7c=a41_0x58ea();let _0x56635b=_0x58ea7c[_0x1ba3cf];return _0x56635b;}import{SDKError,ErrorCode}from'../sdk/index.js';import a41_0x5d6bb9 from'chalk';function a41_0x58ea(){const _0x398514=['Examples:','4WjFIHB','verbose','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','⚠\x20Deprecation\x20warning:\x20`segment\x20update`\x20is\x20deprecated.','type','execute','error','Resolved\x20folder\x20ID:\x20','segment:update','Segment\x20ID\x20missing\x20from\x20resolved\x20path','5631400YhOXQD','Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]','\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22','length','yellow','name','Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]','271787iuZFwG','kind','segmentName','.\x20Only\x20child\x20segments\x20can\x20be\x20updated.','includes','2180hkahiK','27DseQKv','ruleFile','10959674XXiVtf','data','segmentPath','✔\x20Updated\x20segment\x20\x27','Resolving\x20path\x20\x27','INTERNAL','resolvePathToResource','description','3169327NVOjzb','6GmMxIf','\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','segment','parentId','updateSegmentById','Resolved\x20relative\x20path\x20to:\x20','segmentId','\x27...','Update\x20existing\x20child\x20segment','Resolved\x20type:\x20','1611yxznIR','627760opWgaO','1301605Mpxnlv','folder','Parent\x20ID:\x20','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required'];a41_0x58ea=function(){return _0x398514;};return a41_0x58ea();}export class SegmentUpdateCommand extends BaseCommand{['name']=a41_0x29b3f1(0x187);[a41_0x29b3f1(0x16c)]=a41_0x29b3f1(0x176);async[a41_0x29b3f1(0x184)](_0x526775){const _0x13d580=a41_0x29b3f1;console[_0x13d580(0x185)](a41_0x5d6bb9[_0x13d580(0x18d)](_0x13d580(0x182))),console['error'](a41_0x5d6bb9[_0x13d580(0x18d)](_0x13d580(0x181)));const {options:_0x52e492,args:_0x22fe55,tdx:_0x4021c8}=_0x526775,_0x175327=_0x52e492;if(_0x22fe55[_0x13d580(0x18c)]===0x0)return console[_0x13d580(0x185)](_0x13d580(0x17d)),console[_0x13d580(0x185)](_0x13d580(0x18a)),console['error'](_0x13d580(0x17e)),console[_0x13d580(0x185)](_0x13d580(0x18b)),console[_0x13d580(0x185)](_0x13d580(0x16f)),0x1;const _0x554eb3=_0x22fe55[0x0],_0x17d89a=_0x52e492[_0x13d580(0x167)];let _0x1ab9b7=_0x554eb3;_0x17d89a&&!_0x554eb3[_0x13d580(0x161)]('/')&&(_0x1ab9b7=_0x17d89a+'/'+_0x554eb3,_0x175327[_0x13d580(0x180)]&&console['error'](_0x13d580(0x173)+_0x1ab9b7));const _0x1e8bbd=await withSpinner(_0x13d580(0x169)+_0x1ab9b7+_0x13d580(0x175),()=>_0x4021c8[_0x13d580(0x170)][_0x13d580(0x16b)](_0x1ab9b7),{'verbose':_0x175327[_0x13d580(0x180)]}),_0x5031d2=_0x1e8bbd[_0x13d580(0x166)];_0x175327[_0x13d580(0x180)]&&console[_0x13d580(0x185)](_0x13d580(0x177)+_0x5031d2[_0x13d580(0x183)]);if(_0x5031d2[_0x13d580(0x183)]!==_0x13d580(0x170))return console[_0x13d580(0x185)]('Error:\x20Cannot\x20update\x20'+_0x5031d2[_0x13d580(0x183)]+_0x13d580(0x160)),console['error'](_0x13d580(0x18f)),0x1;if(!_0x5031d2['segmentId'])throw new SDKError(ErrorCode[_0x13d580(0x16a)],_0x13d580(0x188));const _0x376944=_0x5031d2[_0x13d580(0x171)],_0x3708a9=_0x5031d2[_0x13d580(0x174)];_0x175327['verbose']&&(console[_0x13d580(0x185)](_0x13d580(0x17c)+_0x376944),console[_0x13d580(0x185)]('Segment\x20ID:\x20'+_0x3708a9));let _0x4da786;if(_0x175327[_0x13d580(0x17b)]){const _0x4cee79=_0x175327[_0x13d580(0x17b)],_0x3cb3ae=await withSpinner('Resolving\x20folder\x20\x27'+_0x4cee79+'\x27...',()=>_0x4021c8['segment']['resolveFolderId'](_0x376944,_0x4cee79),{'verbose':_0x175327['verbose']});_0x4da786=parseInt(_0x3cb3ae[_0x13d580(0x166)],0xa),_0x175327[_0x13d580(0x180)]&&console[_0x13d580(0x185)](_0x13d580(0x186)+_0x4da786);}const _0x47f662=await loadJSONFromOptions(_0x175327['rule'],_0x175327[_0x13d580(0x164)]),_0xdfe133={'name':_0x175327['name'],'description':_0x175327['description'],'rule':_0x47f662,'kind':_0x175327[_0x13d580(0x191)]!==undefined?parseInt(_0x175327['kind'],0xa):undefined,'segmentFolderId':_0x4da786},_0x41d444=await withSpinner('Updating\x20segment\x20\x27'+_0x5031d2[_0x13d580(0x15f)]+_0x13d580(0x175),()=>_0x4021c8[_0x13d580(0x170)][_0x13d580(0x172)](_0x376944,_0x3708a9,_0xdfe133),{'verbose':_0x175327['verbose']}),_0x32ffe1=_0x41d444[_0x13d580(0x166)];return console[_0x13d580(0x185)](_0x13d580(0x168)+_0x32ffe1[_0x13d580(0x18e)]+'\x27'),_0x1ab9b7!==_0x554eb3&&console['error']('\x20\x20\x20Path:\x20'+_0x1ab9b7),await handleSDKOutput([_0x32ffe1],_0x175327),0x0;}}
@@ -1 +1 @@
1
- const a42_0x5c3eb3=a42_0x4cbd;(function(_0x4fa0e5,_0x2b3d36){const _0x429300=a42_0x4cbd,_0x2cb84e=_0x4fa0e5();while(!![]){try{const _0xa30a1f=parseInt(_0x429300(0x182))/0x1*(-parseInt(_0x429300(0x167))/0x2)+parseInt(_0x429300(0x158))/0x3*(parseInt(_0x429300(0x14d))/0x4)+-parseInt(_0x429300(0x180))/0x5*(-parseInt(_0x429300(0x173))/0x6)+-parseInt(_0x429300(0x176))/0x7*(parseInt(_0x429300(0x160))/0x8)+parseInt(_0x429300(0x161))/0x9*(-parseInt(_0x429300(0x170))/0xa)+parseInt(_0x429300(0x166))/0xb+parseInt(_0x429300(0x178))/0xc*(parseInt(_0x429300(0x152))/0xd);if(_0xa30a1f===_0x2b3d36)break;else _0x2cb84e['push'](_0x2cb84e['shift']());}catch(_0x2d714d){_0x2cb84e['push'](_0x2cb84e['shift']());}}}(a42_0x1c1a,0xa4ffc));import{existsSync,statSync}from'fs';import a42_0x881e7d from'chalk';import{BaseCommand}from'./command.js';import{saveSessionContext}from'../core/session.js';function a42_0x1c1a(){const _0x574fb1=['✔\x20Context\x20cleared.\x20Back\x20to\x20root.','830halswD','segment','red','6762GmjFgu','resolvePathToResource','join','1851241UCmwUM','Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.','8668392AlSmKt','Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','green','Resolved\x20path\x20type:\x20','Resolving\x20path\x20\x27','split','description','1575OXsdiL','Resolved\x20relative\x20path\x20to:\x20','6197eYLHry','Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.','isDirectory','segments','Target\x20path:\x20','Usage:\x20tdx\x20segment\x20use\x20<path>','parentId','13556QJpQfI','Examples:','folderId','✔\x20Context\x20set\x20to:\x20','name','13dyrGCl','Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','execute','isAbsolute','folderPath','Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>','648ICdAFL','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22','dim','type','Use\x20\x22tdx\x20use\x22\x20to\x20see\x20all\x20context\x20parameters','parentName','error','cyan','32jsdzsU','44802PQpKpu','fullPath','verbose','slice','log','7733990tjPYXc','118bwdKfh','Use:\x20tdx\x20segment\x20use\x20','parent_segment','\x27...','segmentPath','config','length','\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent'];a42_0x1c1a=function(){return _0x574fb1;};return a42_0x1c1a();}import{withSpinner}from'../utils/spinner.js';import{parsePath,normalizePath}from'../sdk/segment/segment-path-parser.js';function a42_0x4cbd(_0x3fdcc6,_0x274b0f){_0x3fdcc6=_0x3fdcc6-0x14c;const _0x1c1aea=a42_0x1c1a();let _0x4cbddd=_0x1c1aea[_0x3fdcc6];return _0x4cbddd;}import{findTdxConfig}from'../sdk/segment/tdx-config.js';export class SegmentUseCommand extends BaseCommand{[a42_0x5c3eb3(0x151)]='segment:use';[a42_0x5c3eb3(0x17f)]='Set\x20current\x20segment/folder\x20context\x20for\x20navigation';async[a42_0x5c3eb3(0x154)](_0x3e70b6){const _0x24e6b8=a42_0x5c3eb3,{options:_0x4b2c68,args:_0x427822,tdx:_0x152a95}=_0x3e70b6;if(_0x427822[_0x24e6b8(0x16d)]===0x0)return console[_0x24e6b8(0x15e)](a42_0x881e7d[_0x24e6b8(0x172)]('Error:\x20Path\x20is\x20required\x0a')),console[_0x24e6b8(0x15e)](_0x24e6b8(0x187)),console[_0x24e6b8(0x15e)](_0x24e6b8(0x14e)),console[_0x24e6b8(0x15e)]('\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22'),console[_0x24e6b8(0x15e)](_0x24e6b8(0x159)),console[_0x24e6b8(0x15e)]('\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context'),console['error'](_0x24e6b8(0x16e)),0x1;const _0x1fdc48=_0x427822[0x0],_0x4572ab=_0x4b2c68['session'];try{if(_0x1fdc48==='/')return saveSessionContext({'segment_path':undefined},_0x4572ab),console[_0x24e6b8(0x165)](a42_0x881e7d['green'](_0x24e6b8(0x16f))),0x0;if(existsSync(_0x1fdc48)&&statSync(_0x1fdc48)[_0x24e6b8(0x184)]()){let _0x4804a1;try{_0x4804a1=findTdxConfig(_0x1fdc48);}catch{return console[_0x24e6b8(0x15e)](a42_0x881e7d[_0x24e6b8(0x172)](_0x24e6b8(0x153)+_0x1fdc48)),console['error'](a42_0x881e7d[_0x24e6b8(0x15f)](_0x24e6b8(0x17a))),0x1;}const _0x35843e=_0x4804a1[_0x24e6b8(0x16c)][_0x24e6b8(0x169)];return saveSessionContext({'segment_path':_0x35843e,'parent_segment':_0x35843e},_0x4572ab),console[_0x24e6b8(0x165)](a42_0x881e7d['green'](_0x24e6b8(0x150)+a42_0x881e7d[_0x24e6b8(0x15f)](_0x35843e))),0x0;}const _0x359431=_0x4b2c68[_0x24e6b8(0x16b)];let _0x54704a=_0x1fdc48;const _0x1d6675=parsePath(_0x1fdc48);if(!_0x1d6675[_0x24e6b8(0x155)]){if(!_0x359431)return console[_0x24e6b8(0x15e)](a42_0x881e7d['red'](_0x24e6b8(0x183))),console[_0x24e6b8(0x15e)](a42_0x881e7d[_0x24e6b8(0x15f)](_0x24e6b8(0x157))),0x1;if(_0x1fdc48==='..'){const _0x4fc14c=_0x359431[_0x24e6b8(0x17e)]('/')[_0x24e6b8(0x164)](0x0,-0x1)[_0x24e6b8(0x175)]('/');_0x54704a=_0x4fc14c||'/';}else _0x1fdc48==='.'?_0x54704a=_0x359431:_0x54704a=_0x359431+'/'+_0x1fdc48;_0x4b2c68['verbose']&&console[_0x24e6b8(0x15e)](_0x24e6b8(0x181)+_0x54704a);}if(_0x54704a==='/'||_0x54704a==='')return saveSessionContext({'segment_path':undefined},_0x4572ab),console[_0x24e6b8(0x165)](a42_0x881e7d[_0x24e6b8(0x17b)]('✔\x20Context\x20cleared.\x20Back\x20to\x20root.')),0x0;_0x54704a=normalizePath(_0x54704a);const _0x7b6db=parsePath(_0x54704a)[_0x24e6b8(0x185)];if(_0x7b6db[_0x24e6b8(0x16d)]===0x0)return saveSessionContext({'segment_path':undefined},_0x4572ab),console[_0x24e6b8(0x165)](a42_0x881e7d[_0x24e6b8(0x17b)]('✔\x20Context\x20cleared.\x20Back\x20to\x20root.')),0x0;_0x4b2c68[_0x24e6b8(0x163)]&&(console[_0x24e6b8(0x15e)]('Site:\x20'+_0x4b2c68['site']),console[_0x24e6b8(0x15e)](_0x24e6b8(0x186)+_0x54704a));const _0x43b1ee=await withSpinner(_0x24e6b8(0x17d)+_0x54704a+_0x24e6b8(0x16a),()=>_0x152a95[_0x24e6b8(0x171)][_0x24e6b8(0x174)](_0x54704a),{'verbose':_0x4b2c68['verbose']}),_0x55e5ed=_0x43b1ee['data'];_0x4b2c68[_0x24e6b8(0x163)]&&(console[_0x24e6b8(0x15e)](_0x24e6b8(0x17c)+_0x55e5ed[_0x24e6b8(0x15b)]),console[_0x24e6b8(0x15e)]('Parent\x20ID:\x20'+_0x55e5ed[_0x24e6b8(0x14c)]),_0x55e5ed[_0x24e6b8(0x14f)]&&console['error']('Folder\x20ID:\x20'+_0x55e5ed[_0x24e6b8(0x14f)]));if(_0x55e5ed[_0x24e6b8(0x15b)]===_0x24e6b8(0x171))return console[_0x24e6b8(0x15e)](a42_0x881e7d[_0x24e6b8(0x172)](_0x24e6b8(0x179))),console['error'](_0x24e6b8(0x177)),console[_0x24e6b8(0x15e)](a42_0x881e7d[_0x24e6b8(0x15f)](_0x24e6b8(0x168)+_0x55e5ed[_0x24e6b8(0x15d)]+(_0x55e5ed[_0x24e6b8(0x156)]?'/'+_0x55e5ed['folderPath'][_0x24e6b8(0x175)]('/'):''))),0x1;return saveSessionContext({'segment_path':_0x55e5ed[_0x24e6b8(0x162)],'parent_segment':_0x55e5ed[_0x24e6b8(0x15d)]},_0x4572ab),console[_0x24e6b8(0x165)](a42_0x881e7d[_0x24e6b8(0x17b)](_0x24e6b8(0x150)+a42_0x881e7d['cyan'](_0x55e5ed['fullPath']))),_0x4b2c68['verbose']&&(console[_0x24e6b8(0x15e)](a42_0x881e7d[_0x24e6b8(0x15a)]('Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context')),console['error'](a42_0x881e7d[_0x24e6b8(0x15a)](_0x24e6b8(0x15c)))),0x0;}catch(_0x461202){throw _0x461202;}}}
1
+ const a42_0x198d4b=a42_0x340d;(function(_0x50fbaa,_0x5b8bd7){const _0x28046d=a42_0x340d,_0x4513a7=_0x50fbaa();while(!![]){try{const _0x3f9e99=parseInt(_0x28046d(0x143))/0x1+parseInt(_0x28046d(0x13b))/0x2+parseInt(_0x28046d(0x158))/0x3+parseInt(_0x28046d(0x141))/0x4+parseInt(_0x28046d(0x13f))/0x5*(parseInt(_0x28046d(0x154))/0x6)+-parseInt(_0x28046d(0x164))/0x7*(-parseInt(_0x28046d(0x162))/0x8)+parseInt(_0x28046d(0x13a))/0x9*(-parseInt(_0x28046d(0x132))/0xa);if(_0x3f9e99===_0x5b8bd7)break;else _0x4513a7['push'](_0x4513a7['shift']());}catch(_0x2c9227){_0x4513a7['push'](_0x4513a7['shift']());}}}(a42_0x5c8c,0xac4bc));function a42_0x340d(_0x184ea0,_0x3bda45){_0x184ea0=_0x184ea0-0x12e;const _0x5c8c8b=a42_0x5c8c();let _0x340d14=_0x5c8c8b[_0x184ea0];return _0x340d14;}import{existsSync,statSync}from'fs';import a42_0x1028bf 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_0x198d4b(0x159)]='segment:use';['description']='Set\x20current\x20segment/folder\x20context\x20for\x20navigation';async[a42_0x198d4b(0x144)](_0x43e0d2){const _0x498cee=a42_0x198d4b,{options:_0x1bf4ed,args:_0x12da60,tdx:_0x473c9a}=_0x43e0d2;if(_0x12da60[_0x498cee(0x136)]===0x0)return console['error'](a42_0x1028bf[_0x498cee(0x152)](_0x498cee(0x147))),console['error'](_0x498cee(0x14a)),console[_0x498cee(0x131)](_0x498cee(0x133)),console[_0x498cee(0x131)]('\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22'),console[_0x498cee(0x131)](_0x498cee(0x146)),console[_0x498cee(0x131)](_0x498cee(0x138)),console[_0x498cee(0x131)]('\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 _0x49511e=_0x12da60[0x0],_0x11c57b=_0x1bf4ed[_0x498cee(0x14b)];try{if(_0x49511e==='/')return saveSessionContext({'segment_path':undefined},_0x11c57b),console[_0x498cee(0x165)](a42_0x1028bf[_0x498cee(0x15a)]('✔\x20Context\x20cleared.\x20Back\x20to\x20root.')),0x0;if(existsSync(_0x49511e)&&statSync(_0x49511e)['isDirectory']()){let _0x214fb4;try{_0x214fb4=findTdxConfig(_0x49511e);}catch{return console[_0x498cee(0x131)](a42_0x1028bf[_0x498cee(0x152)](_0x498cee(0x145)+_0x49511e)),console['error'](a42_0x1028bf[_0x498cee(0x13d)](_0x498cee(0x151))),0x1;}const _0x3d144f=_0x214fb4[_0x498cee(0x149)][_0x498cee(0x163)];return saveSessionContext({'segment_path':_0x3d144f,'parent_segment':_0x3d144f},_0x11c57b),console[_0x498cee(0x165)](a42_0x1028bf[_0x498cee(0x15a)](_0x498cee(0x156)+a42_0x1028bf[_0x498cee(0x13d)](_0x3d144f))),0x0;}const _0x3ca319=_0x1bf4ed[_0x498cee(0x160)];let _0x41850a=_0x49511e;const _0x32cebd=parsePath(_0x49511e);if(!_0x32cebd[_0x498cee(0x13e)]){if(!_0x3ca319)return console[_0x498cee(0x131)](a42_0x1028bf[_0x498cee(0x152)](_0x498cee(0x15c))),console[_0x498cee(0x131)](a42_0x1028bf[_0x498cee(0x13d)](_0x498cee(0x15e))),0x1;if(_0x49511e==='..'){const _0x50c842=_0x3ca319['split']('/')[_0x498cee(0x148)](0x0,-0x1)['join']('/');_0x41850a=_0x50c842||'/';}else _0x49511e==='.'?_0x41850a=_0x3ca319:_0x41850a=_0x3ca319+'/'+_0x49511e;_0x1bf4ed[_0x498cee(0x15f)]&&console['error']('Resolved\x20relative\x20path\x20to:\x20'+_0x41850a);}if(_0x41850a==='/'||_0x41850a==='')return saveSessionContext({'segment_path':undefined},_0x11c57b),console[_0x498cee(0x165)](a42_0x1028bf['green'](_0x498cee(0x140))),0x0;_0x41850a=normalizePath(_0x41850a);const _0x41b7b9=parsePath(_0x41850a)['segments'];if(_0x41b7b9['length']===0x0)return saveSessionContext({'segment_path':undefined},_0x11c57b),console[_0x498cee(0x165)](a42_0x1028bf[_0x498cee(0x15a)](_0x498cee(0x140))),0x0;_0x1bf4ed[_0x498cee(0x15f)]&&(console[_0x498cee(0x131)]('Site:\x20'+_0x1bf4ed[_0x498cee(0x13c)]),console[_0x498cee(0x131)](_0x498cee(0x157)+_0x41850a));const _0xf563b9=await withSpinner(_0x498cee(0x135)+_0x41850a+'\x27...',()=>_0x473c9a[_0x498cee(0x155)][_0x498cee(0x153)](_0x41850a),{'verbose':_0x1bf4ed[_0x498cee(0x15f)]}),_0x19eb85=_0xf563b9[_0x498cee(0x12f)];_0x1bf4ed[_0x498cee(0x15f)]&&(console[_0x498cee(0x131)](_0x498cee(0x139)+_0x19eb85[_0x498cee(0x15b)]),console['error']('Parent\x20ID:\x20'+_0x19eb85[_0x498cee(0x134)]),_0x19eb85[_0x498cee(0x142)]&&console[_0x498cee(0x131)](_0x498cee(0x15d)+_0x19eb85[_0x498cee(0x142)]));if(_0x19eb85[_0x498cee(0x15b)]===_0x498cee(0x155))return console[_0x498cee(0x131)](a42_0x1028bf['red'](_0x498cee(0x137))),console[_0x498cee(0x131)](_0x498cee(0x130)),console[_0x498cee(0x131)](a42_0x1028bf[_0x498cee(0x13d)]('Use:\x20tdx\x20segment\x20use\x20'+_0x19eb85[_0x498cee(0x14c)]+(_0x19eb85[_0x498cee(0x14f)]?'/'+_0x19eb85[_0x498cee(0x14f)][_0x498cee(0x14e)]('/'):''))),0x1;return saveSessionContext({'segment_path':_0x19eb85['fullPath'],'parent_segment':_0x19eb85['parentName']},_0x11c57b),console['log'](a42_0x1028bf[_0x498cee(0x15a)]('✔\x20Context\x20set\x20to:\x20'+a42_0x1028bf[_0x498cee(0x13d)](_0x19eb85[_0x498cee(0x161)]))),_0x1bf4ed[_0x498cee(0x15f)]&&(console['error'](a42_0x1028bf[_0x498cee(0x150)](_0x498cee(0x14d))),console[_0x498cee(0x131)](a42_0x1028bf[_0x498cee(0x150)](_0x498cee(0x12e)))),0x0;}catch(_0x285947){throw _0x285947;}}}function a42_0x5c8c(){const _0xea8dff=['✔\x20Context\x20set\x20to:\x20','Target\x20path:\x20','3622908brZCNn','name','green','type','Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.','Folder\x20ID:\x20','Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>','verbose','segmentPath','fullPath','192zSAOch','parent_segment','209405jRhJKT','log','Use\x20\x22tdx\x20use\x22\x20to\x20see\x20all\x20context\x20parameters','data','Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.','error','10XoksCs','Examples:','parentId','Resolving\x20path\x20\x27','length','Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.','\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context','Resolved\x20path\x20type:\x20','39623355TFuFyM','1817506kBJBbR','site','cyan','isAbsolute','5TuvCHq','✔\x20Context\x20cleared.\x20Back\x20to\x20root.','2002792ogYDjH','folderId','1352795jqYXay','execute','Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22','Error:\x20Path\x20is\x20required\x0a','slice','config','Usage:\x20tdx\x20segment\x20use\x20<path>','session','parentName','Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context','join','folderPath','dim','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','red','resolvePathToResource','2522862smgEFP','segment'];a42_0x5c8c=function(){return _0xea8dff;};return a42_0x5c8c();}
@@ -1 +1 @@
1
- const a43_0x10ec86=a43_0x44d3;(function(_0x416a28,_0xa23baa){const _0x3e96ff=a43_0x44d3,_0xa3806e=_0x416a28();while(!![]){try{const _0xf8349d=-parseInt(_0x3e96ff(0x173))/0x1*(parseInt(_0x3e96ff(0x18d))/0x2)+parseInt(_0x3e96ff(0x171))/0x3+-parseInt(_0x3e96ff(0x18b))/0x4*(parseInt(_0x3e96ff(0x166))/0x5)+-parseInt(_0x3e96ff(0x18a))/0x6+parseInt(_0x3e96ff(0x189))/0x7+-parseInt(_0x3e96ff(0x17b))/0x8*(-parseInt(_0x3e96ff(0x185))/0x9)+-parseInt(_0x3e96ff(0x193))/0xa;if(_0xf8349d===_0xa23baa)break;else _0xa3806e['push'](_0xa3806e['shift']());}catch(_0x9cc98d){_0xa3806e['push'](_0xa3806e['shift']());}}}(a43_0x4ebd,0x6e830));import{BaseCommand}from'./command.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';function a43_0x4ebd(){const _0x34fec3=['171wVLLnA','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','segment:validate','red','3215373bgZjXc','2867754DPgmYx','26744ikEGfC','errorCode','187758pGomeA','type','warningCount','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','filePath','endsWith','1204000cjqaai','\x20file(s)\x20valid','✔\x20All\x20','no_parent','.yml','Validate\x20segment\x20and\x20journey\x20YAML\x20files','395qxvVID','.yaml','errors','validCount','hasErrors','):\x20','message','execute','green','log','\x20warning(s)\x20found','1198056ABWqgr','verbose','1jPaVmr','helpText','cyan','file','valid','\x20error(s)','yellow','name','342904wjOwXc','\x20warning(s)','length','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file','error','\x20valid','dim','\x20file(s)\x20with\x20errors,\x20','targetDir','warnings'];a43_0x4ebd=function(){return _0x34fec3;};return a43_0x4ebd();}function a43_0x44d3(_0x218746,_0x3d0da6){_0x218746=_0x218746-0x161;const _0x4ebd65=a43_0x4ebd();let _0x44d39c=_0x4ebd65[_0x218746];return _0x44d39c;}import a43_0x316761 from'chalk';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class SegmentValidateCommand extends BaseCommand{[a43_0x10ec86(0x17a)]=a43_0x10ec86(0x187);['description']=a43_0x10ec86(0x165);async[a43_0x10ec86(0x16d)](_0x4a3810){const _0x2172c5=a43_0x10ec86,{options:_0x503047,args:_0x3123cd}=_0x4a3810,_0x485046=_0x503047,_0x25edfd=await resolveTarget({'arg':_0x3123cd[0x0],'contextParent':_0x503047['parentSegment'],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x25edfd))return _0x25edfd[_0x2172c5(0x18c)]===_0x2172c5(0x163)?(console[_0x2172c5(0x17f)](a43_0x316761['yellow']('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console[_0x2172c5(0x17f)]('Usage:\x20tdx\x20sg\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)'),console[_0x2172c5(0x17f)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20validate\x20.\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20current\x20directory'),console[_0x2172c5(0x17f)](_0x2172c5(0x17e))):(console[_0x2172c5(0x17f)](a43_0x316761[_0x2172c5(0x188)]('Error:\x20'+_0x25edfd[_0x2172c5(0x16c)]+'\x0a')),_0x25edfd[_0x2172c5(0x174)]&&console[_0x2172c5(0x17f)](a43_0x316761[_0x2172c5(0x175)](_0x25edfd[_0x2172c5(0x174)]))),0x1;const _0x1621ef=_0x25edfd[_0x2172c5(0x183)],_0x399ae8=_0x25edfd[_0x2172c5(0x18e)]===_0x2172c5(0x176)?_0x25edfd[_0x2172c5(0x191)]:undefined;if(!_0x399ae8&&!existsSync(_0x1621ef))return console[_0x2172c5(0x17f)](a43_0x316761[_0x2172c5(0x188)]('Error:\x20Directory\x20not\x20found:\x20'+_0x1621ef+'\x0a')),0x1;let _0x1398d7;if(_0x399ae8){if(!_0x399ae8[_0x2172c5(0x192)](_0x2172c5(0x164))&&!_0x399ae8[_0x2172c5(0x192)](_0x2172c5(0x167)))return console['error'](a43_0x316761['red'](_0x2172c5(0x190)+_0x399ae8+'\x0a')),0x1;_0x1398d7=[_0x399ae8];}else _0x1398d7=findYamlFiles(_0x1621ef);if(_0x1398d7['length']===0x0)return console[_0x2172c5(0x17f)](a43_0x316761[_0x2172c5(0x188)](_0x2172c5(0x186)+_0x1621ef+'\x0a')),0x1;const _0x5aa246=validateYamlFiles(_0x1398d7,_0x1621ef),_0x47bf22=calculateSummary(_0x5aa246);for(const _0x5f1366 of _0x5aa246){if(!isValidationResult(_0x5f1366))continue;const {relativePath:_0x8df668,source:_0x48b46c,result:_0x3afdb4,fileType:_0x10c6e0}=_0x5f1366,_0x3fa1f5=_0x10c6e0;if(_0x3afdb4[_0x2172c5(0x177)]&&_0x3afdb4[_0x2172c5(0x184)][_0x2172c5(0x17d)]===0x0)_0x485046[_0x2172c5(0x172)]&&console[_0x2172c5(0x16f)](a43_0x316761[_0x2172c5(0x16e)]('✔\x20'+_0x8df668)+a43_0x316761[_0x2172c5(0x181)]('\x20('+_0x3fa1f5+')'));else _0x3afdb4[_0x2172c5(0x177)]?(console[_0x2172c5(0x16f)](a43_0x316761[_0x2172c5(0x179)]('⚠\x20'+_0x8df668)+a43_0x316761['dim']('\x20('+_0x3fa1f5+'):\x20'+_0x3afdb4['warnings'][_0x2172c5(0x17d)]+_0x2172c5(0x17c))),console[_0x2172c5(0x16f)](formatValidationResult(_0x3afdb4,_0x48b46c,_0x8df668))):(console['log'](a43_0x316761['red']('✖\x20'+_0x8df668)+a43_0x316761[_0x2172c5(0x181)]('\x20('+_0x3fa1f5+_0x2172c5(0x16b)+_0x3afdb4[_0x2172c5(0x168)][_0x2172c5(0x17d)]+_0x2172c5(0x178))),console[_0x2172c5(0x16f)](formatValidationResult(_0x3afdb4,_0x48b46c,_0x8df668)));}return console[_0x2172c5(0x16f)](''),_0x47bf22[_0x2172c5(0x16a)]?(console['log'](a43_0x316761['red']('Validation\x20failed:\x20'+_0x47bf22['invalidCount']+_0x2172c5(0x182)+_0x47bf22['validCount']+_0x2172c5(0x180))),_0x47bf22[_0x2172c5(0x18f)]>0x0&&console[_0x2172c5(0x16f)](a43_0x316761[_0x2172c5(0x179)](_0x47bf22[_0x2172c5(0x18f)]+'\x20warning(s)\x20found')),0x1):(console[_0x2172c5(0x16f)](a43_0x316761[_0x2172c5(0x16e)](_0x2172c5(0x162)+_0x47bf22[_0x2172c5(0x169)]+_0x2172c5(0x161))),_0x47bf22[_0x2172c5(0x18f)]>0x0&&console[_0x2172c5(0x16f)](a43_0x316761[_0x2172c5(0x179)](_0x47bf22[_0x2172c5(0x18f)]+_0x2172c5(0x170))),0x0);}}
1
+ function a43_0x3072(){const _0x1285d8=['\x20valid','18BDuOSQ','file','message','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file','name','execute','\x20file(s)\x20valid','2KqLcFw','564410gxWbYq','12GFYyyv','description','Error:\x20Directory\x20not\x20found:\x20','warningCount','18980ELOitD','5419000WYwCHv','Usage:\x20tdx\x20sg\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)','2151jwQcTC','dim','):\x20','targetDir','red','17222381oySYHW','endsWith','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','Validate\x20segment\x20and\x20journey\x20YAML\x20files','\x20file(s)\x20with\x20errors,\x20','errors','no_parent','length','Error:\x20','error','filePath','16lEoUxx','warnings','\x20warning(s)\x20found','\x20warning(s)','yellow','log','295155JltJhA','parentSegment','.yaml','.yml','invalidCount','✔\x20All\x20','green','validCount','verbose','hasErrors','78108hRHwsS','valid','helpText','\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','cyan','type','609994CyRajM'];a43_0x3072=function(){return _0x1285d8;};return a43_0x3072();}function a43_0x4572(_0x53690c,_0x5a0ec3){_0x53690c=_0x53690c-0x121;const _0x3072fd=a43_0x3072();let _0x457238=_0x3072fd[_0x53690c];return _0x457238;}const a43_0xffcef3=a43_0x4572;(function(_0x13f518,_0x2d8f3c){const _0x10da93=a43_0x4572,_0x2430f7=_0x13f518();while(!![]){try{const _0x308875=parseInt(_0x10da93(0x125))/0x1*(-parseInt(_0x10da93(0x12e))/0x2)+-parseInt(_0x10da93(0x157))/0x3*(parseInt(_0x10da93(0x147))/0x4)+-parseInt(_0x10da93(0x12f))/0x5+-parseInt(_0x10da93(0x127))/0x6*(parseInt(_0x10da93(0x14d))/0x7)+-parseInt(_0x10da93(0x135))/0x8+parseInt(_0x10da93(0x137))/0x9*(parseInt(_0x10da93(0x134))/0xa)+-parseInt(_0x10da93(0x13c))/0xb*(-parseInt(_0x10da93(0x130))/0xc);if(_0x308875===_0x2d8f3c)break;else _0x2430f7['push'](_0x2430f7['shift']());}catch(_0x4ba253){_0x2430f7['push'](_0x2430f7['shift']());}}}(a43_0x3072,0x5ed33));import{BaseCommand}from'./command.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';import a43_0x5b37d6 from'chalk';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class SegmentValidateCommand extends BaseCommand{[a43_0xffcef3(0x12b)]='segment:validate';[a43_0xffcef3(0x131)]=a43_0xffcef3(0x13f);async[a43_0xffcef3(0x12c)](_0x10596e){const _0x137b2c=a43_0xffcef3,{options:_0x26d178,args:_0x5ea565}=_0x10596e,_0x2f4ed0=_0x26d178,_0x209d80=await resolveTarget({'arg':_0x5ea565[0x0],'contextParent':_0x26d178[_0x137b2c(0x14e)],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x209d80))return _0x209d80['errorCode']===_0x137b2c(0x142)?(console[_0x137b2c(0x145)](a43_0x5b37d6[_0x137b2c(0x14b)](_0x137b2c(0x13e))),console[_0x137b2c(0x145)](_0x137b2c(0x136)),console[_0x137b2c(0x145)](_0x137b2c(0x122)),console[_0x137b2c(0x145)](_0x137b2c(0x12a))):(console['error'](a43_0x5b37d6[_0x137b2c(0x13b)](_0x137b2c(0x144)+_0x209d80[_0x137b2c(0x129)]+'\x0a')),_0x209d80[_0x137b2c(0x121)]&&console[_0x137b2c(0x145)](a43_0x5b37d6[_0x137b2c(0x123)](_0x209d80[_0x137b2c(0x121)]))),0x1;const _0x1c7dd4=_0x209d80[_0x137b2c(0x13a)],_0x1eb1c=_0x209d80[_0x137b2c(0x124)]===_0x137b2c(0x128)?_0x209d80[_0x137b2c(0x146)]:undefined;if(!_0x1eb1c&&!existsSync(_0x1c7dd4))return console[_0x137b2c(0x145)](a43_0x5b37d6[_0x137b2c(0x13b)](_0x137b2c(0x132)+_0x1c7dd4+'\x0a')),0x1;let _0x4af02b;if(_0x1eb1c){if(!_0x1eb1c[_0x137b2c(0x13d)](_0x137b2c(0x150))&&!_0x1eb1c[_0x137b2c(0x13d)](_0x137b2c(0x14f)))return console[_0x137b2c(0x145)](a43_0x5b37d6[_0x137b2c(0x13b)]('Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20'+_0x1eb1c+'\x0a')),0x1;_0x4af02b=[_0x1eb1c];}else _0x4af02b=findYamlFiles(_0x1c7dd4);if(_0x4af02b[_0x137b2c(0x143)]===0x0)return console[_0x137b2c(0x145)](a43_0x5b37d6[_0x137b2c(0x13b)]('Error:\x20No\x20YAML\x20files\x20found\x20in\x20'+_0x1c7dd4+'\x0a')),0x1;const _0x5743f0=validateYamlFiles(_0x4af02b,_0x1c7dd4),_0x2bc670=calculateSummary(_0x5743f0);for(const _0x41bb25 of _0x5743f0){if(!isValidationResult(_0x41bb25))continue;const {relativePath:_0xf9a9ae,source:_0x3422b6,result:_0x28c9c2,fileType:_0xcfb073}=_0x41bb25,_0x3feb6d=_0xcfb073;if(_0x28c9c2[_0x137b2c(0x158)]&&_0x28c9c2[_0x137b2c(0x148)][_0x137b2c(0x143)]===0x0)_0x2f4ed0[_0x137b2c(0x155)]&&console[_0x137b2c(0x14c)](a43_0x5b37d6[_0x137b2c(0x153)]('✔\x20'+_0xf9a9ae)+a43_0x5b37d6[_0x137b2c(0x138)]('\x20('+_0x3feb6d+')'));else _0x28c9c2[_0x137b2c(0x158)]?(console['log'](a43_0x5b37d6[_0x137b2c(0x14b)]('⚠\x20'+_0xf9a9ae)+a43_0x5b37d6[_0x137b2c(0x138)]('\x20('+_0x3feb6d+'):\x20'+_0x28c9c2[_0x137b2c(0x148)]['length']+_0x137b2c(0x14a))),console[_0x137b2c(0x14c)](formatValidationResult(_0x28c9c2,_0x3422b6,_0xf9a9ae))):(console[_0x137b2c(0x14c)](a43_0x5b37d6['red']('✖\x20'+_0xf9a9ae)+a43_0x5b37d6['dim']('\x20('+_0x3feb6d+_0x137b2c(0x139)+_0x28c9c2[_0x137b2c(0x141)][_0x137b2c(0x143)]+'\x20error(s)')),console[_0x137b2c(0x14c)](formatValidationResult(_0x28c9c2,_0x3422b6,_0xf9a9ae)));}return console[_0x137b2c(0x14c)](''),_0x2bc670[_0x137b2c(0x156)]?(console[_0x137b2c(0x14c)](a43_0x5b37d6[_0x137b2c(0x13b)]('Validation\x20failed:\x20'+_0x2bc670[_0x137b2c(0x151)]+_0x137b2c(0x140)+_0x2bc670[_0x137b2c(0x154)]+_0x137b2c(0x126))),_0x2bc670[_0x137b2c(0x133)]>0x0&&console[_0x137b2c(0x14c)](a43_0x5b37d6[_0x137b2c(0x14b)](_0x2bc670['warningCount']+_0x137b2c(0x149))),0x1):(console[_0x137b2c(0x14c)](a43_0x5b37d6['green'](_0x137b2c(0x152)+_0x2bc670['validCount']+_0x137b2c(0x12d))),_0x2bc670['warningCount']>0x0&&console[_0x137b2c(0x14c)](a43_0x5b37d6[_0x137b2c(0x14b)](_0x2bc670[_0x137b2c(0x133)]+'\x20warning(s)\x20found')),0x0);}}
@@ -1 +1 @@
1
- function a44_0x3027(_0x3d0084,_0x1e9bde){_0x3d0084=_0x3d0084-0xc1;const _0x592dc7=a44_0x592d();let _0x3027b8=_0x592dc7[_0x3d0084];return _0x3027b8;}const a44_0x74999a=a44_0x3027;(function(_0x47186f,_0x49960b){const _0x52f934=a44_0x3027,_0x2659c9=_0x47186f();while(!![]){try{const _0x28a1aa=-parseInt(_0x52f934(0xde))/0x1+-parseInt(_0x52f934(0xfc))/0x2*(parseInt(_0x52f934(0xe2))/0x3)+parseInt(_0x52f934(0xeb))/0x4*(-parseInt(_0x52f934(0xcf))/0x5)+parseInt(_0x52f934(0xd4))/0x6*(-parseInt(_0x52f934(0xd2))/0x7)+parseInt(_0x52f934(0xf0))/0x8*(-parseInt(_0x52f934(0xc1))/0x9)+parseInt(_0x52f934(0xf7))/0xa*(-parseInt(_0x52f934(0xdd))/0xb)+parseInt(_0x52f934(0xd8))/0xc;if(_0x28a1aa===_0x49960b)break;else _0x2659c9['push'](_0x2659c9['shift']());}catch(_0x5cd516){_0x2659c9['push'](_0x2659c9['shift']());}}}(a44_0x592d,0x38a32));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{formatFlatList,formatTree}from'../sdk/util/tree-formatter.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';function a44_0x592d(){const _0x3a49ec=['error','/j/da','folders','\x20journey','resolvePathToResource','map','List\x20folders\x20and\x20child\x20segments','verbose','Folder/pattern\x20arg:\x20','journey','Error:\x20No\x20parent\x20segment\x20context\x20set.','9IaFIgA','log','site','\x20\x20Cause:\x20','includes','Parent\x20segment\x20context:\x20','description','Error:\x20','✔\x20Found\x20','listUnifiedWithJourneys','(empty)','data','parentId','test','5JGxjDZ','journeyBundleName','sort','868798dICfyg','Listing\x20folders,\x20segments,\x20and\x20journeys...','18EYyAUf','dim','Set\x20a\x20parent\x20segment\x20context\x20first:','No\x20items\x20match\x20pattern:\x20','19056900imhSew','listUnified','/app/ps/','/e/','\x20segment','2358730VilvGj','32067fguDfy','json','\x20folder','Resolving\x20parent\x20segment\x20\x27','153nlUeYK','\x5c$&','\x27...','folder','Folder\x20ID:\x20','✔\x20Built\x20tree\x20with\x20','message','\x20\x20tdx\x20sg\x20pull\x20\x22My\x20Audience\x22','parentSegment','587448fdszwz','filter','length','children','Recursive\x20mode:\x20enabled','1408920HuFjKg','Use\x20tdx\x20ps\x20list\x20to\x20see\x20available\x20parent\x20segments.','replace','recursive','cause','Resolving\x20path\x20\x27','format','10UaYWHO','(not\x20set)','maxDepth','segment','localeCompare','16246pZaWte','Parent\x20ID:\x20','Site:\x20','journeys','listWithPattern','\x20\x20tdx\x20sg\x20use\x20\x22My\x20Audience\x22',',\x20and\x20','listRecursive',']\x20matching\x20\x27','Building\x20hierarchy\x20tree...','type','name','folderId','segments','jsonl'];a44_0x592d=function(){return _0x3a49ec;};return a44_0x592d();}import a44_0x301b82 from'chalk';export class SegmentsCommand extends BaseCommand{['name']=a44_0x74999a(0x109);[a44_0x74999a(0xc7)]=a44_0x74999a(0x111);async['execute'](_0x1a2b24){const _0x22e8ff=a44_0x74999a,{options:_0x29d96d,args:_0x2b7a91}=_0x1a2b24,_0x423b9d=_0x29d96d[_0x22e8ff(0xf3)],_0x225af6=_0x2b7a91[0x0];try{const _0x9fb59f=_0x29d96d[_0x22e8ff(0xea)];_0x29d96d[_0x22e8ff(0x112)]&&(console[_0x22e8ff(0x10b)](_0x22e8ff(0xfe)+_0x29d96d[_0x22e8ff(0xc3)]),console[_0x22e8ff(0x10b)](_0x22e8ff(0xc6)+(_0x9fb59f||_0x22e8ff(0xf8))),_0x225af6&&console[_0x22e8ff(0x10b)](_0x22e8ff(0x113)+_0x225af6),_0x423b9d&&console[_0x22e8ff(0x10b)](_0x22e8ff(0xef)));if(!_0x9fb59f)return console[_0x22e8ff(0x10b)](_0x22e8ff(0x115)),console[_0x22e8ff(0x10b)](''),console[_0x22e8ff(0x10b)](_0x22e8ff(0xd6)),console['error'](_0x22e8ff(0xe9)),console[_0x22e8ff(0x10b)](_0x22e8ff(0x101)),console[_0x22e8ff(0x10b)](''),console[_0x22e8ff(0x10b)](_0x22e8ff(0xf1)),0x1;const _0x11acff=_0x225af6&&(_0x225af6[_0x22e8ff(0xc5)]('*')||_0x225af6[_0x22e8ff(0xc5)]('?'));if(_0x11acff)return await this[_0x22e8ff(0x100)](_0x1a2b24,_0x9fb59f,_0x225af6);const _0x9959bc=_0x225af6?_0x9fb59f+'/'+_0x225af6:_0x9fb59f;return _0x423b9d?await this[_0x22e8ff(0x103)](_0x1a2b24,_0x9959bc):await this[_0x22e8ff(0xd9)](_0x1a2b24,_0x9959bc);}catch(_0x5b14ea){if(_0x5b14ea instanceof SDKError)return console[_0x22e8ff(0x10b)](_0x22e8ff(0xc8)+_0x5b14ea[_0x22e8ff(0xe8)]),_0x5b14ea['cause']&&console[_0x22e8ff(0x10b)](_0x22e8ff(0xc4)+_0x5b14ea[_0x22e8ff(0xf4)]),0x1;throw _0x5b14ea;}}async[a44_0x74999a(0x100)](_0x3ee02e,_0x1a2fa7,_0x565491){const _0x12eec3=a44_0x74999a,{options:_0x5409c9,tdx:_0x2c8428}=_0x3ee02e,_0x10fa5c=await withSpinner(_0x12eec3(0xe1)+_0x1a2fa7+_0x12eec3(0xe4),()=>_0x2c8428['segment'][_0x12eec3(0x10f)](_0x1a2fa7),{'verbose':_0x5409c9[_0x12eec3(0x112)]}),_0x3bbca8=_0x10fa5c['data'],_0x4bdb52=await withSpinner(_0x12eec3(0xd3),()=>_0x2c8428[_0x12eec3(0xfa)][_0x12eec3(0xca)](_0x3bbca8[_0x12eec3(0xcd)],_0x3bbca8[_0x12eec3(0x108)]),{'verbose':_0x5409c9[_0x12eec3(0x112)]}),{folders:_0x34878b,segments:_0x4483e5,journeys:_0x5b3b30}=_0x4bdb52[_0x12eec3(0xcc)],_0x248f26=_0x565491['replace'](/[.+^${}()|[\]\\]/g,_0x12eec3(0xe3))[_0x12eec3(0xf2)](/\*/g,'.*')[_0x12eec3(0xf2)](/\?/g,'.'),_0x40da31=new RegExp('^'+_0x248f26+'$','i'),_0x154dce=_0x34878b[_0x12eec3(0xec)](_0x444399=>_0x40da31[_0x12eec3(0xce)](_0x444399[_0x12eec3(0x107)])),_0x2c9a68=_0x4483e5[_0x12eec3(0xec)](_0x529736=>_0x40da31[_0x12eec3(0xce)](_0x529736[_0x12eec3(0x107)])),_0x152389=_0x5b3b30['filter'](_0x58a2fc=>_0x40da31[_0x12eec3(0xce)](_0x58a2fc[_0x12eec3(0xd0)])),_0x40b4ee=_0x154dce['length']+_0x2c9a68[_0x12eec3(0xed)]+_0x152389[_0x12eec3(0xed)];console[_0x12eec3(0x10b)](_0x12eec3(0xc9)+_0x154dce[_0x12eec3(0xed)]+'\x20folder'+(_0x154dce[_0x12eec3(0xed)]!==0x1?'s':'')+',\x20'+_0x2c9a68[_0x12eec3(0xed)]+_0x12eec3(0xdc)+(_0x2c9a68['length']!==0x1?'s':'')+',\x20and\x20'+_0x152389[_0x12eec3(0xed)]+_0x12eec3(0x10e)+(_0x152389[_0x12eec3(0xed)]!==0x1?'s':'')+'\x20matching\x20\x27'+_0x565491+'\x27');const _0x48191d=_0x3d9c14=>{const _0x39d976=_0x12eec3;return getConsoleNextUrl(_0x5409c9[_0x39d976(0xc3)],_0x39d976(0xda)+_0x3bbca8[_0x39d976(0xcd)]+_0x39d976(0xdb)+_0x3d9c14);},_0x3bcbe6=_0x5409c9['format']===_0x12eec3(0xdf)||_0x5409c9['format']==='jsonl';if(_0x3bcbe6){const _0x5b2761=[..._0x154dce['map'](_0x4cb797=>({..._0x4cb797,'type':_0x12eec3(0xe5)})),..._0x2c9a68[_0x12eec3(0x110)](_0xb8144b=>({..._0xb8144b,'type':_0x12eec3(0xfa),'url':_0x48191d(_0xb8144b['id'])})),..._0x152389[_0x12eec3(0x110)](_0x3956ae=>({..._0x3956ae,'name':_0x3956ae[_0x12eec3(0xd0)],'type':_0x12eec3(0x114)}))][_0x12eec3(0xd1)]((_0x29299f,_0x5cdb98)=>_0x29299f[_0x12eec3(0x107)][_0x12eec3(0xfb)](_0x5cdb98[_0x12eec3(0x107)]));await handleSDKOutput(_0x5b2761,_0x5409c9);}else{if(_0x40b4ee===0x0)console['log'](_0x12eec3(0xd7)+_0x565491);else{console[_0x12eec3(0xc2)](a44_0x301b82['dim']('['+_0x1a2fa7+_0x12eec3(0x104)+_0x565491+'\x27'));const _0x50aa36=formatFlatList(_0x154dce,_0x2c9a68,{'showMetadata':!![],'getSegmentUrl':_0x48191d},_0x152389);console[_0x12eec3(0xc2)](_0x50aa36);}}return 0x0;}async[a44_0x74999a(0xd9)](_0x2a0265,_0x2bebf5){const _0x52b36a=a44_0x74999a,{options:_0x46a717,tdx:_0xe112e5}=_0x2a0265,_0x553e0c=await withSpinner(_0x52b36a(0xf5)+_0x2bebf5+_0x52b36a(0xe4),()=>_0xe112e5[_0x52b36a(0xfa)][_0x52b36a(0x10f)](_0x2bebf5),{'verbose':_0x46a717['verbose']}),_0x43879e=_0x553e0c[_0x52b36a(0xcc)];_0x46a717[_0x52b36a(0x112)]&&(console[_0x52b36a(0x10b)](_0x52b36a(0xfd)+_0x43879e[_0x52b36a(0xcd)]),_0x43879e['folderId']&&console[_0x52b36a(0x10b)](_0x52b36a(0xe6)+_0x43879e[_0x52b36a(0x108)]));const _0x4b5cb9=await withSpinner(_0x52b36a(0xd3),()=>_0xe112e5[_0x52b36a(0xfa)][_0x52b36a(0xca)](_0x43879e[_0x52b36a(0xcd)],_0x43879e[_0x52b36a(0x108)]),{'verbose':_0x46a717['verbose']}),{folders:_0x4e5244,segments:_0x1bebfd,journeys:_0x4c8bb5}=_0x4b5cb9['data'],_0xfd6bae=_0x4e5244[_0x52b36a(0xed)]+_0x1bebfd[_0x52b36a(0xed)]+_0x4c8bb5[_0x52b36a(0xed)];console[_0x52b36a(0x10b)](_0x52b36a(0xc9)+_0x4e5244[_0x52b36a(0xed)]+'\x20folder'+(_0x4e5244[_0x52b36a(0xed)]!==0x1?'s':'')+',\x20'+_0x1bebfd[_0x52b36a(0xed)]+_0x52b36a(0xdc)+(_0x1bebfd[_0x52b36a(0xed)]!==0x1?'s':'')+_0x52b36a(0x102)+_0x4c8bb5[_0x52b36a(0xed)]+_0x52b36a(0x10e)+(_0x4c8bb5[_0x52b36a(0xed)]!==0x1?'s':''));const _0x4ae5e7=_0x3a98bd=>{const _0x5407c2=_0x52b36a;return getConsoleNextUrl(_0x46a717['site'],'/app/ps/'+_0x43879e[_0x5407c2(0xcd)]+'/e/'+_0x3a98bd);},_0x6f2544=_0x319948=>{const _0xf276d7=_0x52b36a;return getConsoleNextUrl(_0x46a717[_0xf276d7(0xc3)],'/app/ps/'+_0x43879e[_0xf276d7(0xcd)]+_0xf276d7(0xdb)+_0x319948+'/j/da');},_0x11a995=_0x46a717[_0x52b36a(0xf6)]===_0x52b36a(0xdf)||_0x46a717[_0x52b36a(0xf6)]===_0x52b36a(0x10a);if(_0x11a995){const _0x10bc08=[..._0x4e5244[_0x52b36a(0x110)](_0x12b0d4=>({..._0x12b0d4,'type':_0x52b36a(0xe5)})),..._0x1bebfd['map'](_0x3e7876=>({..._0x3e7876,'type':_0x52b36a(0xfa),'url':_0x4ae5e7(_0x3e7876['id'])})),..._0x4c8bb5[_0x52b36a(0x110)](_0x116685=>({..._0x116685,'name':_0x116685['journeyBundleName'],'type':'journey','url':_0x6f2544(_0x116685['id'])}))][_0x52b36a(0xd1)]((_0x2e498f,_0x190566)=>_0x2e498f['name'][_0x52b36a(0xfb)](_0x190566[_0x52b36a(0x107)]));await handleSDKOutput(_0x10bc08,_0x46a717);}else{if(_0xfd6bae===0x0)console[_0x52b36a(0xc2)](a44_0x301b82[_0x52b36a(0xd5)]('['+_0x2bebf5+']')),console['log'](_0x52b36a(0xcb));else{console['log'](a44_0x301b82['dim']('['+_0x2bebf5+']'));const _0x3fbfcf=formatFlatList(_0x4e5244,_0x1bebfd,{'showMetadata':!![],'getSegmentUrl':_0x4ae5e7,'getJourneyUrl':_0x6f2544},_0x4c8bb5);console['log'](_0x3fbfcf);}}return 0x0;}async['listRecursive'](_0x50691e,_0x4c9abe){const _0x1bb3e7=a44_0x74999a,{options:_0x56bcd6,tdx:_0x2697ac}=_0x50691e,_0x239cdf=await withSpinner(_0x1bb3e7(0xf5)+_0x4c9abe+_0x1bb3e7(0xe4),()=>_0x2697ac[_0x1bb3e7(0xfa)]['resolvePathToResource'](_0x4c9abe),{'verbose':_0x56bcd6[_0x1bb3e7(0x112)]}),_0x4d9294=_0x239cdf[_0x1bb3e7(0xcc)];_0x56bcd6[_0x1bb3e7(0x112)]&&(console[_0x1bb3e7(0x10b)](_0x1bb3e7(0xfd)+_0x4d9294[_0x1bb3e7(0xcd)]),_0x4d9294[_0x1bb3e7(0x108)]&&console[_0x1bb3e7(0x10b)]('Folder\x20ID:\x20'+_0x4d9294['folderId']));const _0x5a14bb=_0x56bcd6[_0x1bb3e7(0xf9)]||0xa,_0x5dd084=await withSpinner(_0x1bb3e7(0x105),()=>_0x2697ac[_0x1bb3e7(0xfa)][_0x1bb3e7(0x103)](_0x4d9294[_0x1bb3e7(0xcd)],_0x4d9294[_0x1bb3e7(0x108)],0x0,_0x5a14bb),{'verbose':_0x56bcd6[_0x1bb3e7(0x112)]}),_0x467284=_0x5dd084[_0x1bb3e7(0xcc)],_0x3fbfc0=_0x546784=>{const _0x12457b=_0x1bb3e7;let _0xb9247e=0x0,_0x406028=0x0,_0x1c38a6=0x0;for(const _0x16eedb of _0x546784){if(_0x16eedb[_0x12457b(0x106)]===_0x12457b(0xe5))_0xb9247e++;else{if(_0x16eedb[_0x12457b(0x106)]===_0x12457b(0xfa))_0x406028++;else{if(_0x16eedb['type']===_0x12457b(0x114))_0x1c38a6++;}}if(_0x16eedb[_0x12457b(0xee)]){const _0x5d8ef7=_0x3fbfc0(_0x16eedb['children']);_0xb9247e+=_0x5d8ef7[_0x12457b(0x10d)],_0x406028+=_0x5d8ef7[_0x12457b(0x109)],_0x1c38a6+=_0x5d8ef7[_0x12457b(0xff)];}}return{'folders':_0xb9247e,'segments':_0x406028,'journeys':_0x1c38a6};},_0x5d3d3d=_0x3fbfc0(_0x467284);console[_0x1bb3e7(0x10b)](_0x1bb3e7(0xe7)+_0x5d3d3d[_0x1bb3e7(0x10d)]+_0x1bb3e7(0xe0)+(_0x5d3d3d[_0x1bb3e7(0x10d)]!==0x1?'s':'')+',\x20'+_0x5d3d3d[_0x1bb3e7(0x109)]+'\x20segment'+(_0x5d3d3d[_0x1bb3e7(0x109)]!==0x1?'s':'')+_0x1bb3e7(0x102)+_0x5d3d3d[_0x1bb3e7(0xff)]+'\x20journey'+(_0x5d3d3d[_0x1bb3e7(0xff)]!==0x1?'s':''));const _0x2920cd=_0x4cbe28=>{const _0x2a3854=_0x1bb3e7;return getConsoleNextUrl(_0x56bcd6[_0x2a3854(0xc3)],_0x2a3854(0xda)+_0x4d9294[_0x2a3854(0xcd)]+'/e/'+_0x4cbe28);},_0x49bd48=_0x5378eb=>{const _0x1706c2=_0x1bb3e7;return getConsoleNextUrl(_0x56bcd6[_0x1706c2(0xc3)],_0x1706c2(0xda)+_0x4d9294[_0x1706c2(0xcd)]+_0x1706c2(0xdb)+_0x5378eb+_0x1706c2(0x10c));};if(_0x56bcd6[_0x1bb3e7(0xf6)]==='json'||_0x56bcd6['format']===_0x1bb3e7(0x10a))await handleSDKOutput(_0x467284,_0x56bcd6);else{console[_0x1bb3e7(0xc2)](a44_0x301b82['dim']('['+_0x4c9abe+']'));const _0x23115e=formatTree(_0x467284,{'showMetadata':!![],'getSegmentUrl':_0x2920cd,'getJourneyUrl':_0x49bd48});console[_0x1bb3e7(0xc2)](_0x23115e);}return 0x0;}}
1
+ const a44_0x38a968=a44_0x1181;(function(_0x4d8930,_0x6964a8){const _0x33be58=a44_0x1181,_0x570a41=_0x4d8930();while(!![]){try{const _0x551ec3=parseInt(_0x33be58(0x1bc))/0x1*(-parseInt(_0x33be58(0x1b2))/0x2)+parseInt(_0x33be58(0x1c1))/0x3*(parseInt(_0x33be58(0x1a0))/0x4)+-parseInt(_0x33be58(0x181))/0x5*(-parseInt(_0x33be58(0x1ca))/0x6)+-parseInt(_0x33be58(0x19d))/0x7+parseInt(_0x33be58(0x1b4))/0x8+parseInt(_0x33be58(0x1c9))/0x9*(-parseInt(_0x33be58(0x196))/0xa)+-parseInt(_0x33be58(0x185))/0xb*(-parseInt(_0x33be58(0x1c4))/0xc);if(_0x551ec3===_0x6964a8)break;else _0x570a41['push'](_0x570a41['shift']());}catch(_0xe7c479){_0x570a41['push'](_0x570a41['shift']());}}}(a44_0xf0a6,0x8c0ec));import{BaseCommand}from'./command.js';function a44_0x1181(_0x5b3e7b,_0xb15f7d){_0x5b3e7b=_0x5b3e7b-0x181;const _0xf0a6ee=a44_0xf0a6();let _0x1181ef=_0xf0a6ee[_0x5b3e7b];return _0x1181ef;}import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{formatFlatList,formatTree}from'../sdk/util/tree-formatter.js';function a44_0xf0a6(){const _0x4c19d6=['2556sdsxSI','children','folders','listUnifiedWithJourneys','site','1819269ybalBE','4766394SECOUB','\x20segment','\x20matching\x20\x27','cause','5sbqlba','segments','name','\x27...','23111gahDaM','localeCompare','listRecursive','json','dim','error','Folder\x20ID:\x20','log','length','listUnified','folder','journeys','/j/da','journey','\x20journey','data','Recursive\x20mode:\x20enabled','10ZDkhYd','format','Site:\x20','Set\x20a\x20parent\x20segment\x20context\x20first:','\x20folder','folderId','segment','5776428AgEemN','type','parentSegment','20GJJOMB','Parent\x20ID:\x20','✔\x20Found\x20','includes','\x20\x20Cause:\x20','Listing\x20folders,\x20segments,\x20and\x20journeys...','Parent\x20segment\x20context:\x20',',\x20and\x20','✔\x20Built\x20tree\x20with\x20','sort','map','No\x20items\x20match\x20pattern:\x20','(empty)','listWithPattern','replace','Use\x20tdx\x20ps\x20list\x20to\x20see\x20available\x20parent\x20segments.','verbose','message','1022AGPQku','Resolving\x20parent\x20segment\x20\x27','783640OYiqAD','journeyBundleName','test','maxDepth','/app/ps/','Error:\x20','filter',']\x20matching\x20\x27','56bjyBPf','Resolving\x20path\x20\x27','parentId','Error:\x20No\x20parent\x20segment\x20context\x20set.','/e/','173862HijRSs','jsonl','resolvePathToResource'];a44_0xf0a6=function(){return _0x4c19d6;};return a44_0xf0a6();}import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import a44_0x3e61a2 from'chalk';export class SegmentsCommand extends BaseCommand{['name']=a44_0x38a968(0x182);['description']='List\x20folders\x20and\x20child\x20segments';async['execute'](_0x57c276){const _0x431cea=a44_0x38a968,{options:_0x1c023c,args:_0x13b7c6}=_0x57c276,_0x39e273=_0x1c023c['recursive'],_0x57922f=_0x13b7c6[0x0];try{const _0x306b55=_0x1c023c[_0x431cea(0x19f)];_0x1c023c[_0x431cea(0x1b0)]&&(console[_0x431cea(0x18a)](_0x431cea(0x198)+_0x1c023c[_0x431cea(0x1c8)]),console[_0x431cea(0x18a)](_0x431cea(0x1a6)+(_0x306b55||'(not\x20set)')),_0x57922f&&console[_0x431cea(0x18a)]('Folder/pattern\x20arg:\x20'+_0x57922f),_0x39e273&&console['error'](_0x431cea(0x195)));if(!_0x306b55)return console['error'](_0x431cea(0x1bf)),console[_0x431cea(0x18a)](''),console[_0x431cea(0x18a)](_0x431cea(0x199)),console['error']('\x20\x20tdx\x20sg\x20pull\x20\x22My\x20Audience\x22'),console[_0x431cea(0x18a)]('\x20\x20tdx\x20sg\x20use\x20\x22My\x20Audience\x22'),console[_0x431cea(0x18a)](''),console[_0x431cea(0x18a)](_0x431cea(0x1af)),0x1;const _0x4153ee=_0x57922f&&(_0x57922f[_0x431cea(0x1a3)]('*')||_0x57922f[_0x431cea(0x1a3)]('?'));if(_0x4153ee)return await this['listWithPattern'](_0x57c276,_0x306b55,_0x57922f);const _0x29bba0=_0x57922f?_0x306b55+'/'+_0x57922f:_0x306b55;return _0x39e273?await this['listRecursive'](_0x57c276,_0x29bba0):await this[_0x431cea(0x18e)](_0x57c276,_0x29bba0);}catch(_0x10a8bb){if(_0x10a8bb instanceof SDKError)return console[_0x431cea(0x18a)](_0x431cea(0x1b9)+_0x10a8bb[_0x431cea(0x1b1)]),_0x10a8bb[_0x431cea(0x1cd)]&&console[_0x431cea(0x18a)](_0x431cea(0x1a4)+_0x10a8bb[_0x431cea(0x1cd)]),0x1;throw _0x10a8bb;}}async[a44_0x38a968(0x1ad)](_0x367c65,_0x1bcdc0,_0x1173dc){const _0x39517f=a44_0x38a968,{options:_0xf59e9f,tdx:_0x2118ca}=_0x367c65,_0x1d3367=await withSpinner(_0x39517f(0x1b3)+_0x1bcdc0+_0x39517f(0x184),()=>_0x2118ca[_0x39517f(0x19c)][_0x39517f(0x1c3)](_0x1bcdc0),{'verbose':_0xf59e9f[_0x39517f(0x1b0)]}),_0x3d9c91=_0x1d3367[_0x39517f(0x194)],_0x16f55b=await withSpinner(_0x39517f(0x1a5),()=>_0x2118ca['segment'][_0x39517f(0x1c7)](_0x3d9c91['parentId'],_0x3d9c91[_0x39517f(0x19b)]),{'verbose':_0xf59e9f[_0x39517f(0x1b0)]}),{folders:_0x3cb2db,segments:_0x46702f,journeys:_0x3779ca}=_0x16f55b[_0x39517f(0x194)],_0x491db0=_0x1173dc['replace'](/[.+^${}()|[\]\\]/g,'\x5c$&')[_0x39517f(0x1ae)](/\*/g,'.*')[_0x39517f(0x1ae)](/\?/g,'.'),_0x3984e8=new RegExp('^'+_0x491db0+'$','i'),_0xbff1fc=_0x3cb2db[_0x39517f(0x1ba)](_0x43cab6=>_0x3984e8[_0x39517f(0x1b6)](_0x43cab6[_0x39517f(0x183)])),_0x45591e=_0x46702f['filter'](_0x124fa6=>_0x3984e8['test'](_0x124fa6[_0x39517f(0x183)])),_0x4a459a=_0x3779ca[_0x39517f(0x1ba)](_0x15cbca=>_0x3984e8[_0x39517f(0x1b6)](_0x15cbca[_0x39517f(0x1b5)])),_0x25a7c3=_0xbff1fc['length']+_0x45591e[_0x39517f(0x18d)]+_0x4a459a[_0x39517f(0x18d)];console['error']('✔\x20Found\x20'+_0xbff1fc[_0x39517f(0x18d)]+_0x39517f(0x19a)+(_0xbff1fc['length']!==0x1?'s':'')+',\x20'+_0x45591e[_0x39517f(0x18d)]+_0x39517f(0x1cb)+(_0x45591e[_0x39517f(0x18d)]!==0x1?'s':'')+_0x39517f(0x1a7)+_0x4a459a[_0x39517f(0x18d)]+'\x20journey'+(_0x4a459a[_0x39517f(0x18d)]!==0x1?'s':'')+_0x39517f(0x1cc)+_0x1173dc+'\x27');const _0x5c76b=_0x3dc013=>{const _0x257547=_0x39517f;return getConsoleNextUrl(_0xf59e9f[_0x257547(0x1c8)],_0x257547(0x1b8)+_0x3d9c91['parentId']+'/e/'+_0x3dc013);},_0x2bd785=_0xf59e9f[_0x39517f(0x197)]===_0x39517f(0x188)||_0xf59e9f[_0x39517f(0x197)]===_0x39517f(0x1c2);if(_0x2bd785){const _0x506d85=[..._0xbff1fc[_0x39517f(0x1aa)](_0x31337d=>({..._0x31337d,'type':_0x39517f(0x18f)})),..._0x45591e['map'](_0x7e91b2=>({..._0x7e91b2,'type':_0x39517f(0x19c),'url':_0x5c76b(_0x7e91b2['id'])})),..._0x4a459a['map'](_0x4818aa=>({..._0x4818aa,'name':_0x4818aa[_0x39517f(0x1b5)],'type':_0x39517f(0x192)}))][_0x39517f(0x1a9)]((_0x529fa6,_0x5f2580)=>_0x529fa6[_0x39517f(0x183)][_0x39517f(0x186)](_0x5f2580[_0x39517f(0x183)]));await handleSDKOutput(_0x506d85,_0xf59e9f);}else{if(_0x25a7c3===0x0)console[_0x39517f(0x18c)](_0x39517f(0x1ab)+_0x1173dc);else{console[_0x39517f(0x18c)](a44_0x3e61a2[_0x39517f(0x189)]('['+_0x1bcdc0+_0x39517f(0x1bb)+_0x1173dc+'\x27'));const _0x4c1ad0=formatFlatList(_0xbff1fc,_0x45591e,{'showMetadata':!![],'getSegmentUrl':_0x5c76b},_0x4a459a);console['log'](_0x4c1ad0);}}return 0x0;}async[a44_0x38a968(0x18e)](_0x51eaff,_0x53e409){const _0x167fe6=a44_0x38a968,{options:_0x2f119b,tdx:_0x423d6f}=_0x51eaff,_0x3a28b0=await withSpinner(_0x167fe6(0x1bd)+_0x53e409+_0x167fe6(0x184),()=>_0x423d6f[_0x167fe6(0x19c)][_0x167fe6(0x1c3)](_0x53e409),{'verbose':_0x2f119b['verbose']}),_0xb1bdba=_0x3a28b0[_0x167fe6(0x194)];_0x2f119b[_0x167fe6(0x1b0)]&&(console[_0x167fe6(0x18a)](_0x167fe6(0x1a1)+_0xb1bdba[_0x167fe6(0x1be)]),_0xb1bdba['folderId']&&console[_0x167fe6(0x18a)](_0x167fe6(0x18b)+_0xb1bdba['folderId']));const _0x2a1435=await withSpinner(_0x167fe6(0x1a5),()=>_0x423d6f[_0x167fe6(0x19c)][_0x167fe6(0x1c7)](_0xb1bdba[_0x167fe6(0x1be)],_0xb1bdba[_0x167fe6(0x19b)]),{'verbose':_0x2f119b['verbose']}),{folders:_0x5060eb,segments:_0x162bb0,journeys:_0x1e5b96}=_0x2a1435[_0x167fe6(0x194)],_0x15617f=_0x5060eb[_0x167fe6(0x18d)]+_0x162bb0[_0x167fe6(0x18d)]+_0x1e5b96[_0x167fe6(0x18d)];console['error'](_0x167fe6(0x1a2)+_0x5060eb[_0x167fe6(0x18d)]+'\x20folder'+(_0x5060eb[_0x167fe6(0x18d)]!==0x1?'s':'')+',\x20'+_0x162bb0['length']+_0x167fe6(0x1cb)+(_0x162bb0['length']!==0x1?'s':'')+_0x167fe6(0x1a7)+_0x1e5b96[_0x167fe6(0x18d)]+_0x167fe6(0x193)+(_0x1e5b96[_0x167fe6(0x18d)]!==0x1?'s':''));const _0x2c9951=_0x5aa1af=>{const _0x513d7a=_0x167fe6;return getConsoleNextUrl(_0x2f119b[_0x513d7a(0x1c8)],'/app/ps/'+_0xb1bdba[_0x513d7a(0x1be)]+'/e/'+_0x5aa1af);},_0x1f7529=_0x46726f=>{const _0x3c952f=_0x167fe6;return getConsoleNextUrl(_0x2f119b[_0x3c952f(0x1c8)],_0x3c952f(0x1b8)+_0xb1bdba[_0x3c952f(0x1be)]+_0x3c952f(0x1c0)+_0x46726f+_0x3c952f(0x191));},_0x3e7b81=_0x2f119b['format']===_0x167fe6(0x188)||_0x2f119b[_0x167fe6(0x197)]===_0x167fe6(0x1c2);if(_0x3e7b81){const _0x31e6a9=[..._0x5060eb['map'](_0x1f7c1b=>({..._0x1f7c1b,'type':_0x167fe6(0x18f)})),..._0x162bb0[_0x167fe6(0x1aa)](_0x3da8d0=>({..._0x3da8d0,'type':'segment','url':_0x2c9951(_0x3da8d0['id'])})),..._0x1e5b96[_0x167fe6(0x1aa)](_0xae39a1=>({..._0xae39a1,'name':_0xae39a1['journeyBundleName'],'type':_0x167fe6(0x192),'url':_0x1f7529(_0xae39a1['id'])}))][_0x167fe6(0x1a9)]((_0x2fcf1a,_0x527fea)=>_0x2fcf1a[_0x167fe6(0x183)][_0x167fe6(0x186)](_0x527fea[_0x167fe6(0x183)]));await handleSDKOutput(_0x31e6a9,_0x2f119b);}else{if(_0x15617f===0x0)console[_0x167fe6(0x18c)](a44_0x3e61a2[_0x167fe6(0x189)]('['+_0x53e409+']')),console[_0x167fe6(0x18c)](_0x167fe6(0x1ac));else{console[_0x167fe6(0x18c)](a44_0x3e61a2[_0x167fe6(0x189)]('['+_0x53e409+']'));const _0x487064=formatFlatList(_0x5060eb,_0x162bb0,{'showMetadata':!![],'getSegmentUrl':_0x2c9951,'getJourneyUrl':_0x1f7529},_0x1e5b96);console[_0x167fe6(0x18c)](_0x487064);}}return 0x0;}async['listRecursive'](_0x4bfc0c,_0x4331cc){const _0x23f406=a44_0x38a968,{options:_0x523baf,tdx:_0x1f6aa4}=_0x4bfc0c,_0x5d0250=await withSpinner(_0x23f406(0x1bd)+_0x4331cc+_0x23f406(0x184),()=>_0x1f6aa4[_0x23f406(0x19c)][_0x23f406(0x1c3)](_0x4331cc),{'verbose':_0x523baf['verbose']}),_0x5e366e=_0x5d0250[_0x23f406(0x194)];_0x523baf[_0x23f406(0x1b0)]&&(console['error'](_0x23f406(0x1a1)+_0x5e366e[_0x23f406(0x1be)]),_0x5e366e[_0x23f406(0x19b)]&&console[_0x23f406(0x18a)](_0x23f406(0x18b)+_0x5e366e[_0x23f406(0x19b)]));const _0x4691ea=_0x523baf[_0x23f406(0x1b7)]||0xa,_0x54a93b=await withSpinner('Building\x20hierarchy\x20tree...',()=>_0x1f6aa4[_0x23f406(0x19c)][_0x23f406(0x187)](_0x5e366e[_0x23f406(0x1be)],_0x5e366e[_0x23f406(0x19b)],0x0,_0x4691ea),{'verbose':_0x523baf[_0x23f406(0x1b0)]}),_0x41ef5c=_0x54a93b[_0x23f406(0x194)],_0x21f7c6=_0x2dcfd8=>{const _0x193362=_0x23f406;let _0x54de1f=0x0,_0x24adfd=0x0,_0x5556a8=0x0;for(const _0x5c9bed of _0x2dcfd8){if(_0x5c9bed[_0x193362(0x19e)]===_0x193362(0x18f))_0x54de1f++;else{if(_0x5c9bed[_0x193362(0x19e)]===_0x193362(0x19c))_0x24adfd++;else{if(_0x5c9bed[_0x193362(0x19e)]===_0x193362(0x192))_0x5556a8++;}}if(_0x5c9bed[_0x193362(0x1c5)]){const _0x373388=_0x21f7c6(_0x5c9bed[_0x193362(0x1c5)]);_0x54de1f+=_0x373388[_0x193362(0x1c6)],_0x24adfd+=_0x373388[_0x193362(0x182)],_0x5556a8+=_0x373388[_0x193362(0x190)];}}return{'folders':_0x54de1f,'segments':_0x24adfd,'journeys':_0x5556a8};},_0x14b634=_0x21f7c6(_0x41ef5c);console[_0x23f406(0x18a)](_0x23f406(0x1a8)+_0x14b634[_0x23f406(0x1c6)]+'\x20folder'+(_0x14b634[_0x23f406(0x1c6)]!==0x1?'s':'')+',\x20'+_0x14b634[_0x23f406(0x182)]+_0x23f406(0x1cb)+(_0x14b634[_0x23f406(0x182)]!==0x1?'s':'')+',\x20and\x20'+_0x14b634['journeys']+_0x23f406(0x193)+(_0x14b634[_0x23f406(0x190)]!==0x1?'s':''));const _0x2463bf=_0x56eb29=>{const _0x5577ac=_0x23f406;return getConsoleNextUrl(_0x523baf[_0x5577ac(0x1c8)],'/app/ps/'+_0x5e366e[_0x5577ac(0x1be)]+_0x5577ac(0x1c0)+_0x56eb29);},_0x4a4a85=_0x1be0ab=>{const _0x54cdce=_0x23f406;return getConsoleNextUrl(_0x523baf['site'],'/app/ps/'+_0x5e366e[_0x54cdce(0x1be)]+_0x54cdce(0x1c0)+_0x1be0ab+'/j/da');};if(_0x523baf[_0x23f406(0x197)]==='json'||_0x523baf['format']==='jsonl')await handleSDKOutput(_0x41ef5c,_0x523baf);else{console[_0x23f406(0x18c)](a44_0x3e61a2[_0x23f406(0x189)]('['+_0x4331cc+']'));const _0x5e79a4=formatTree(_0x41ef5c,{'showMetadata':!![],'getSegmentUrl':_0x2463bf,'getJourneyUrl':_0x4a4a85});console[_0x23f406(0x18c)](_0x5e79a4);}return 0x0;}}
@@ -1 +1 @@
1
- function a45_0x45e9(){const _0x3f8a2d=['58369PEHhEq','253002seCJCi','10ZxVfYF','cause','table','24073Fcahpc','\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>','error','1502980QMYXBx','limit','1488nZbBZh','Error:\x20','7401ZpxFTm','Usage:\x20tdx\x20show\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--in\x20<database>\x0a\x0aRun\x20\x27tdx\x20show\x20--help\x27\x20for\x20more\x20options','8014896qArowc','execute','database','catalog','showTable','\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>','verbose','42ffgCdP','Usage:\x20tdx\x20show\x20<database.table>','query','✔\x20Query\x20successful\x20-\x200\x20rows\x20returned','\x20from\x20','site','name','4046160GbXpHk','description','Too\x20many\x20arguments\x0aUsage:\x20tdx\x20show\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>\x0a\x0aRun\x20\x27tdx\x20show\x20--help\x27\x20for\x20more\x20options','message','Database:\x20','validate','data','\x20\x20Cause:\x20','Site:\x20','length','args'];a45_0x45e9=function(){return _0x3f8a2d;};return a45_0x45e9();}const a45_0x4cebf5=a45_0x49d5;(function(_0x32ac6a,_0x530846){const _0x4709ef=a45_0x49d5,_0x498d04=_0x32ac6a();while(!![]){try{const _0xbc2b14=parseInt(_0x4709ef(0xe7))/0x1+-parseInt(_0x4709ef(0xd5))/0x2*(-parseInt(_0x4709ef(0xcc))/0x3)+parseInt(_0x4709ef(0xdc))/0x4+-parseInt(_0x4709ef(0xc8))/0x5+-parseInt(_0x4709ef(0xe8))/0x6+-parseInt(_0x4709ef(0xec))/0x7*(-parseInt(_0x4709ef(0xca))/0x8)+parseInt(_0x4709ef(0xce))/0x9*(-parseInt(_0x4709ef(0xe9))/0xa);if(_0xbc2b14===_0x530846)break;else _0x498d04['push'](_0x498d04['shift']());}catch(_0x5b0b88){_0x498d04['push'](_0x498d04['shift']());}}}(a45_0x45e9,0x80ebf));import{BaseCommand}from'./command.js';function a45_0x49d5(_0x1e7166,_0x4be810){_0x1e7166=_0x1e7166-0xc8;const _0x45e9b2=a45_0x45e9();let _0x49d528=_0x45e9b2[_0x1e7166];return _0x49d528;}import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';import{parseTableReference,validateTableDescribeReference}from'../utils/table-ref-parser.js';import{withSpinner}from'../utils/spinner.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';export class ShowCommand extends BaseCommand{[a45_0x4cebf5(0xdb)]='show';[a45_0x4cebf5(0xdd)]='Show\x20table\x20contents';async[a45_0x4cebf5(0xcf)](_0x1e15e0){const _0x4d1b8a=a45_0x4cebf5;return this[_0x4d1b8a(0xd2)](_0x1e15e0);}async[a45_0x4cebf5(0xd2)](_0x2de4fb){const _0x15b8f7=a45_0x4cebf5,{options:_0x430cbd,args:_0x1516a7,tdx:_0x5516b7}=_0x2de4fb;let _0x439d1b;try{_0x439d1b=parseTableReference(_0x1516a7[0x0]);const _0x337a11=_0x430cbd[_0x15b8f7(0xd0)];!_0x439d1b[_0x15b8f7(0xd0)]&&_0x337a11&&(_0x439d1b['database']=_0x337a11);const _0x3572b2=validateTableDescribeReference(_0x439d1b);if(_0x3572b2)return console[_0x15b8f7(0xee)](_0x15b8f7(0xcb)+_0x3572b2),console['error'](_0x15b8f7(0xd6)),console[_0x15b8f7(0xee)](_0x15b8f7(0xed)),console[_0x15b8f7(0xee)](_0x15b8f7(0xd3)),0x1;}catch(_0x4352c4){return console['error'](_0x15b8f7(0xcb)+_0x4352c4[_0x15b8f7(0xdf)]),console[_0x15b8f7(0xee)](_0x15b8f7(0xd6)),console[_0x15b8f7(0xee)](_0x15b8f7(0xed)),console['error'](_0x15b8f7(0xd3)),0x1;}const _0x5f0e50=_0x439d1b[_0x15b8f7(0xd1)],_0x2900bf=_0x439d1b[_0x15b8f7(0xd0)],_0x2e9f8a=_0x439d1b[_0x15b8f7(0xeb)],_0x48b47a=resolveLimit(_0x430cbd[_0x15b8f7(0xc9)],DEFAULT_DISPLAY_LIMIT);try{_0x430cbd[_0x15b8f7(0xd4)]&&(console[_0x15b8f7(0xee)](_0x15b8f7(0xe4)+_0x430cbd[_0x15b8f7(0xda)]),_0x5f0e50&&console[_0x15b8f7(0xee)]('Catalog:\x20'+_0x5f0e50),console[_0x15b8f7(0xee)](_0x15b8f7(0xe0)+_0x2900bf),console[_0x15b8f7(0xee)]('Table:\x20'+_0x2e9f8a),console['error']('Limit:\x20'+_0x48b47a));const _0x33d67f=_0x5f0e50?_0x5f0e50+'.'+_0x2900bf+'.'+_0x2e9f8a:_0x2900bf+'.'+_0x2e9f8a,_0x555005=await withSpinner('Querying\x20'+_0x33d67f+'...',()=>_0x5516b7[_0x15b8f7(0xd7)][_0x15b8f7(0xd2)](_0x2900bf,_0x2e9f8a,_0x48b47a,_0x5f0e50),{'verbose':_0x430cbd[_0x15b8f7(0xd4)]}),_0x38c355=_0x555005[_0x15b8f7(0xe2)],_0x273f31=_0x38c355[_0x15b8f7(0xe2)];return _0x273f31[_0x15b8f7(0xe5)]===0x0?console['error'](_0x15b8f7(0xd8)):console[_0x15b8f7(0xee)]('✔\x20Retrieved\x20'+_0x273f31[_0x15b8f7(0xe5)]+'\x20row'+(_0x273f31[_0x15b8f7(0xe5)]!==0x1?'s':'')+_0x15b8f7(0xd9)+_0x33d67f),await handleSDKOutput(_0x273f31,_0x430cbd),0x0;}catch(_0x2778cd){if(_0x2778cd instanceof SDKError)return console['error'](_0x15b8f7(0xcb)+_0x2778cd[_0x15b8f7(0xdf)]),_0x2778cd[_0x15b8f7(0xea)]&&console[_0x15b8f7(0xee)](_0x15b8f7(0xe3)+_0x2778cd['cause']),0x1;throw _0x2778cd;}}[a45_0x4cebf5(0xe1)](_0x19b107){const _0x50b023=a45_0x4cebf5;if(_0x19b107[_0x50b023(0xe6)][_0x50b023(0xe5)]===0x0)return _0x50b023(0xcd);if(_0x19b107['args'][_0x50b023(0xe5)]>0x1)return _0x50b023(0xde);return undefined;}}
1
+ function a45_0x43f3(){const _0x11e8b0=['399748AuUNKK','\x20row','294024xYuYVO','819ryfGXL','\x20\x20Cause:\x20','250864bdGGMW','args','length','Show\x20table\x20contents','Usage:\x20tdx\x20show\x20<database.table>','show','...','site','3242144vaBRFO','4IXjtdR','name','message','41180cOhNWn','4429026PZVAnF','1355196gCbbpz','\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>','✔\x20Query\x20successful\x20-\x200\x20rows\x20returned','error','\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>','Error:\x20','execute','Table:\x20','database','table','showTable','Site:\x20','data','query','limit','✔\x20Retrieved\x20','\x20from\x20','Too\x20many\x20arguments\x0aUsage:\x20tdx\x20show\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>\x0a\x0aRun\x20\x27tdx\x20show\x20--help\x27\x20for\x20more\x20options','5vQzMBP','Catalog:\x20','description','cause','Querying\x20','Database:\x20','validate'];a45_0x43f3=function(){return _0x11e8b0;};return a45_0x43f3();}const a45_0x38ab2b=a45_0x2a4e;(function(_0x57d805,_0x21bbfd){const _0x562051=a45_0x2a4e,_0x1a98ba=_0x57d805();while(!![]){try{const _0xe5a6f3=-parseInt(_0x562051(0x198))/0x1*(-parseInt(_0x562051(0x175))/0x2)+parseInt(_0x562051(0x17a))/0x3+parseInt(_0x562051(0x193))/0x4+parseInt(_0x562051(0x18c))/0x5*(-parseInt(_0x562051(0x195))/0x6)+-parseInt(_0x562051(0x179))/0x7+-parseInt(_0x562051(0x174))/0x8+-parseInt(_0x562051(0x196))/0x9*(-parseInt(_0x562051(0x178))/0xa);if(_0xe5a6f3===_0x21bbfd)break;else _0x1a98ba['push'](_0x1a98ba['shift']());}catch(_0x1f5b84){_0x1a98ba['push'](_0x1a98ba['shift']());}}}(a45_0x43f3,0x53499));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';function a45_0x2a4e(_0x5b0404,_0x30aa1b){_0x5b0404=_0x5b0404-0x171;const _0x43f37d=a45_0x43f3();let _0x2a4edc=_0x43f37d[_0x5b0404];return _0x2a4edc;}import{handleSDKOutput}from'../core/command-output.js';import{parseTableReference,validateTableDescribeReference}from'../utils/table-ref-parser.js';import{withSpinner}from'../utils/spinner.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';export class ShowCommand extends BaseCommand{[a45_0x38ab2b(0x176)]=a45_0x38ab2b(0x171);[a45_0x38ab2b(0x18e)]=a45_0x38ab2b(0x19b);async[a45_0x38ab2b(0x180)](_0xa7aca1){const _0x1c02ef=a45_0x38ab2b;return this[_0x1c02ef(0x184)](_0xa7aca1);}async[a45_0x38ab2b(0x184)](_0x975237){const _0x2ad64f=a45_0x38ab2b,{options:_0x31e34b,args:_0x138cf0,tdx:_0x13eb40}=_0x975237;let _0x54fa8a;try{_0x54fa8a=parseTableReference(_0x138cf0[0x0]);const _0xbaddcc=_0x31e34b[_0x2ad64f(0x182)];!_0x54fa8a[_0x2ad64f(0x182)]&&_0xbaddcc&&(_0x54fa8a[_0x2ad64f(0x182)]=_0xbaddcc);const _0x522e6f=validateTableDescribeReference(_0x54fa8a);if(_0x522e6f)return console[_0x2ad64f(0x17d)](_0x2ad64f(0x17f)+_0x522e6f),console[_0x2ad64f(0x17d)](_0x2ad64f(0x19c)),console[_0x2ad64f(0x17d)]('\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>'),console['error']('\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>'),0x1;}catch(_0x128009){return console[_0x2ad64f(0x17d)](_0x2ad64f(0x17f)+_0x128009[_0x2ad64f(0x177)]),console[_0x2ad64f(0x17d)](_0x2ad64f(0x19c)),console[_0x2ad64f(0x17d)](_0x2ad64f(0x17e)),console['error'](_0x2ad64f(0x17b)),0x1;}const _0x4b62b3=_0x54fa8a['catalog'],_0x519c9b=_0x54fa8a[_0x2ad64f(0x182)],_0x349128=_0x54fa8a[_0x2ad64f(0x183)],_0x3ba3e9=resolveLimit(_0x31e34b[_0x2ad64f(0x188)],DEFAULT_DISPLAY_LIMIT);try{_0x31e34b['verbose']&&(console['error'](_0x2ad64f(0x185)+_0x31e34b[_0x2ad64f(0x173)]),_0x4b62b3&&console[_0x2ad64f(0x17d)](_0x2ad64f(0x18d)+_0x4b62b3),console['error'](_0x2ad64f(0x191)+_0x519c9b),console[_0x2ad64f(0x17d)](_0x2ad64f(0x181)+_0x349128),console['error']('Limit:\x20'+_0x3ba3e9));const _0x146381=_0x4b62b3?_0x4b62b3+'.'+_0x519c9b+'.'+_0x349128:_0x519c9b+'.'+_0x349128,_0x37fb1a=await withSpinner(_0x2ad64f(0x190)+_0x146381+_0x2ad64f(0x172),()=>_0x13eb40[_0x2ad64f(0x187)]['showTable'](_0x519c9b,_0x349128,_0x3ba3e9,_0x4b62b3),{'verbose':_0x31e34b['verbose']}),_0x1e8c6e=_0x37fb1a[_0x2ad64f(0x186)],_0x293f0c=_0x1e8c6e['data'];return _0x293f0c['length']===0x0?console['error'](_0x2ad64f(0x17c)):console[_0x2ad64f(0x17d)](_0x2ad64f(0x189)+_0x293f0c[_0x2ad64f(0x19a)]+_0x2ad64f(0x194)+(_0x293f0c[_0x2ad64f(0x19a)]!==0x1?'s':'')+_0x2ad64f(0x18a)+_0x146381),await handleSDKOutput(_0x293f0c,_0x31e34b),0x0;}catch(_0x49aac8){if(_0x49aac8 instanceof SDKError)return console[_0x2ad64f(0x17d)](_0x2ad64f(0x17f)+_0x49aac8['message']),_0x49aac8[_0x2ad64f(0x18f)]&&console['error'](_0x2ad64f(0x197)+_0x49aac8[_0x2ad64f(0x18f)]),0x1;throw _0x49aac8;}}[a45_0x38ab2b(0x192)](_0x39328a){const _0x19b5b5=a45_0x38ab2b;if(_0x39328a[_0x19b5b5(0x199)][_0x19b5b5(0x19a)]===0x0)return'Usage:\x20tdx\x20show\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--in\x20<database>\x0a\x0aRun\x20\x27tdx\x20show\x20--help\x27\x20for\x20more\x20options';if(_0x39328a[_0x19b5b5(0x199)]['length']>0x1)return _0x19b5b5(0x18b);return undefined;}}
@@ -1 +1 @@
1
- const a46_0x3652f6=a46_0x6c42;(function(_0x2ce60a,_0x48e957){const _0x55cced=a46_0x6c42,_0x22e0d5=_0x2ce60a();while(!![]){try{const _0x57c418=parseInt(_0x55cced(0xc3))/0x1*(-parseInt(_0x55cced(0xbf))/0x2)+-parseInt(_0x55cced(0xd5))/0x3+-parseInt(_0x55cced(0xb0))/0x4*(-parseInt(_0x55cced(0xc9))/0x5)+-parseInt(_0x55cced(0xbc))/0x6+parseInt(_0x55cced(0xd0))/0x7+parseInt(_0x55cced(0xcf))/0x8*(-parseInt(_0x55cced(0xdb))/0x9)+parseInt(_0x55cced(0xb1))/0xa;if(_0x57c418===_0x48e957)break;else _0x22e0d5['push'](_0x22e0d5['shift']());}catch(_0x416f29){_0x22e0d5['push'](_0x22e0d5['shift']());}}}(a46_0x4a0b,0xa4796));import{BaseCommand,printAuthError}from'./command.js';import{resolveAPIKeyAsync}from'../core/config.js';import{getOAuthTokens}from'../core/oauth-keychain.js';function a46_0x4a0b(){const _0x1cdd7a=['env','yellow','2qCeywT','CLI\x20flag','No\x20credential\x20found','tdx','896489cbKbDq','User:','email','profileSource','cli','\x20profile:\x20','85kNFRrK','✗\x20Validation\x20failed:\x20','status','profile','displayWithSources','Credential\x20type:\x20','10016pTkToT','501935gyOICn','config','log','Show\x20authentication\x20status\x20and\x20current\x20context','account_id','1908696ymBTmK','bold','OAuth','N/A','message','Name:','6849bLhpcw','getUserInfo','TDX_PROFILE\x20env','192020BBvjqA','30698230XmtHon','cyan','dim','(from\x20','green','execute','error','last_name','site:\x20','name','first_name','4790604ujlYgE'];a46_0x4a0b=function(){return _0x1cdd7a;};return a46_0x4a0b();}import{HTTPClientError}from'../sdk/client/http-client.js';import{GlobalContext}from'../core/global-context.js';function a46_0x6c42(_0x4213e0,_0x2c9900){_0x4213e0=_0x4213e0-0xaf;const _0x4a0b35=a46_0x4a0b();let _0x6c4250=_0x4a0b35[_0x4213e0];return _0x6c4250;}import a46_0x4ec9d2 from'chalk';export class StatusCommand extends BaseCommand{[a46_0x3652f6(0xba)]=a46_0x3652f6(0xcb);['description']=a46_0x3652f6(0xd3);async[a46_0x3652f6(0xb6)](_0x380491){const _0x1a6d56=a46_0x3652f6,{options:_0x1c37e1,tdx:_0x4c0d28}=_0x380491,_0x5a43a7=_0x1c37e1['site'],_0x56226c=new GlobalContext(_0x1c37e1),_0x684d4f=_0x56226c[_0x1a6d56(0xcc)],_0x28f2a6=_0x56226c[_0x1a6d56(0xc6)],_0x1d68a0=_0x28f2a6===_0x1a6d56(0xc7)?_0x1a6d56(0xc0):_0x28f2a6==='session'?'session':_0x28f2a6===_0x1a6d56(0xbd)?_0x1a6d56(0xaf):_0x28f2a6===_0x1a6d56(0xd1)?_0x1a6d56(0xd1):null,_0x1f24c0=_0x684d4f?a46_0x4ec9d2['cyan'](_0x684d4f):a46_0x4ec9d2[_0x1a6d56(0xb3)](_0x1a6d56(0xd8)),_0x4f7fe1=_0x1d68a0?'\x20'+a46_0x4ec9d2[_0x1a6d56(0xb3)](_0x1a6d56(0xb4)+_0x1d68a0+')'):'';console[_0x1a6d56(0xd2)](a46_0x4ec9d2[_0x1a6d56(0xd6)](_0x1a6d56(0xc2))+_0x1a6d56(0xc8)+_0x1f24c0+_0x4f7fe1+'\x20'+a46_0x4ec9d2[_0x1a6d56(0xb3)]('(')+_0x1a6d56(0xb9)+a46_0x4ec9d2[_0x1a6d56(0xb2)](_0x5a43a7)+a46_0x4ec9d2['dim'](')'));const _0x2fc083=await getOAuthTokens(_0x684d4f);if(_0x2fc083)console[_0x1a6d56(0xd2)](_0x1a6d56(0xce)+a46_0x4ec9d2[_0x1a6d56(0xb2)](_0x1a6d56(0xd7)));else{const _0x1bee25=await resolveAPIKeyAsync(_0x5a43a7,_0x684d4f);if(_0x1bee25){const {source:_0x48b004,isDeprecated:_0x415f1d}=_0x1bee25,_0x2d7648='Read\x20credential\x20from\x20'+a46_0x4ec9d2[_0x1a6d56(0xb2)](_0x48b004);console[_0x1a6d56(0xd2)](_0x415f1d?a46_0x4ec9d2[_0x1a6d56(0xbe)](_0x2d7648):_0x2d7648);}else console[_0x1a6d56(0xd2)](a46_0x4ec9d2['yellow'](_0x1a6d56(0xc1)));}let _0x2d182a=![];try{const _0x4c5bf6=await _0x4c0d28['jobs'][_0x1a6d56(0xdc)]();console[_0x1a6d56(0xd2)](a46_0x4ec9d2[_0x1a6d56(0xb5)]('✓\x20Authentication\x20successful\x0a')),console['log'](a46_0x4ec9d2['bold'](_0x1a6d56(0xc4))+'\x20'+a46_0x4ec9d2[_0x1a6d56(0xb2)](_0x4c5bf6[_0x1a6d56(0xc5)]));if(_0x4c5bf6['first_name']||_0x4c5bf6[_0x1a6d56(0xb8)]){const _0x1524fb=[_0x4c5bf6[_0x1a6d56(0xbb)],_0x4c5bf6[_0x1a6d56(0xb8)]]['filter'](Boolean)['join']('\x20');console[_0x1a6d56(0xd2)](a46_0x4ec9d2[_0x1a6d56(0xd6)](_0x1a6d56(0xda))+'\x20'+_0x1524fb);}_0x4c5bf6[_0x1a6d56(0xd4)]&&console['log'](a46_0x4ec9d2[_0x1a6d56(0xd6)]('Account\x20ID:')+'\x20'+a46_0x4ec9d2[_0x1a6d56(0xbe)](_0x4c5bf6[_0x1a6d56(0xd4)])),_0x2d182a=!![];}catch(_0x196196){_0x196196 instanceof HTTPClientError&&_0x196196[_0x1a6d56(0xcb)]===0x191?printAuthError(_0x196196,!![],_0x684d4f):console[_0x1a6d56(0xb7)](a46_0x4ec9d2['red'](_0x1a6d56(0xca)+(_0x196196 instanceof Error?_0x196196[_0x1a6d56(0xd9)]:String(_0x196196))));}return console[_0x1a6d56(0xd2)](),_0x56226c[_0x1a6d56(0xcd)](),_0x2d182a?0x0:0x1;}}
1
+ const a46_0x7bdb4d=a46_0x259f;(function(_0x4e486d,_0x327f11){const _0x4ed5f2=a46_0x259f,_0x5dedb3=_0x4e486d();while(!![]){try{const _0x4f7183=-parseInt(_0x4ed5f2(0x1d9))/0x1*(parseInt(_0x4ed5f2(0x1ed))/0x2)+-parseInt(_0x4ed5f2(0x1fd))/0x3*(-parseInt(_0x4ed5f2(0x1f4))/0x4)+-parseInt(_0x4ed5f2(0x1e8))/0x5*(parseInt(_0x4ed5f2(0x1e7))/0x6)+-parseInt(_0x4ed5f2(0x1d6))/0x7*(parseInt(_0x4ed5f2(0x201))/0x8)+-parseInt(_0x4ed5f2(0x1d5))/0x9*(parseInt(_0x4ed5f2(0x1e5))/0xa)+parseInt(_0x4ed5f2(0x1fc))/0xb+-parseInt(_0x4ed5f2(0x203))/0xc*(-parseInt(_0x4ed5f2(0x1f5))/0xd);if(_0x4f7183===_0x327f11)break;else _0x5dedb3['push'](_0x5dedb3['shift']());}catch(_0x58120e){_0x5dedb3['push'](_0x5dedb3['shift']());}}}(a46_0x4302,0x73b50));import{BaseCommand,printAuthError}from'./command.js';import{resolveAPIKeyAsync}from'../core/config.js';import{getOAuthTokens}from'../core/oauth-keychain.js';function a46_0x4302(){const _0x31f72c=['Show\x20authentication\x20status\x20and\x20current\x20context','bold','join','18DEmJlr','3353NdErZz','tdx','CLI\x20flag','8ckZGvp','error','config','jobs','User:','site','status','cyan','dim','message','cli','getUserInfo','857980DNccVv','TDX_PROFILE\x20env','80520XPhgHz','200MToSuQ','log','env','name','green','172058PlRQlb','No\x20credential\x20found','profileSource','Account\x20ID:','Credential\x20type:\x20','\x20profile:\x20','filter','753924ydnUzu','13bPVaZJ','N/A','Read\x20credential\x20from\x20','last_name','site:\x20','description','email','10278994ximXhb','15cLkPVj','first_name','profile','✗\x20Validation\x20failed:\x20','5432IaRDGn','session','3827352RowbFU','yellow','Name:'];a46_0x4302=function(){return _0x31f72c;};return a46_0x4302();}import{HTTPClientError}from'../sdk/client/http-client.js';import{GlobalContext}from'../core/global-context.js';import a46_0x3a18fb from'chalk';function a46_0x259f(_0x33bcd8,_0x261153){_0x33bcd8=_0x33bcd8-0x1d1;const _0x4302de=a46_0x4302();let _0x259f26=_0x4302de[_0x33bcd8];return _0x259f26;}export class StatusCommand extends BaseCommand{[a46_0x7bdb4d(0x1eb)]='status';[a46_0x7bdb4d(0x1fa)]=a46_0x7bdb4d(0x1d2);async['execute'](_0x7d7da0){const _0x259c2e=a46_0x7bdb4d,{options:_0x19f702,tdx:_0x3b0a02}=_0x7d7da0,_0x4ffed0=_0x19f702[_0x259c2e(0x1de)],_0x14117d=new GlobalContext(_0x19f702),_0x1cf02c=_0x14117d[_0x259c2e(0x1ff)],_0x32d26e=_0x14117d[_0x259c2e(0x1ef)],_0x3635bc=_0x32d26e===_0x259c2e(0x1e3)?_0x259c2e(0x1d8):_0x32d26e===_0x259c2e(0x202)?_0x259c2e(0x202):_0x32d26e===_0x259c2e(0x1ea)?_0x259c2e(0x1e6):_0x32d26e===_0x259c2e(0x1db)?_0x259c2e(0x1db):null,_0x18f441=_0x1cf02c?a46_0x3a18fb['cyan'](_0x1cf02c):a46_0x3a18fb['dim'](_0x259c2e(0x1f6)),_0x5ecac1=_0x3635bc?'\x20'+a46_0x3a18fb[_0x259c2e(0x1e1)]('(from\x20'+_0x3635bc+')'):'';console[_0x259c2e(0x1e9)](a46_0x3a18fb['bold'](_0x259c2e(0x1d7))+_0x259c2e(0x1f2)+_0x18f441+_0x5ecac1+'\x20'+a46_0x3a18fb[_0x259c2e(0x1e1)]('(')+_0x259c2e(0x1f9)+a46_0x3a18fb[_0x259c2e(0x1e0)](_0x4ffed0)+a46_0x3a18fb['dim'](')'));const _0x10c92b=await getOAuthTokens(_0x1cf02c);if(_0x10c92b)console[_0x259c2e(0x1e9)](_0x259c2e(0x1f1)+a46_0x3a18fb['cyan']('OAuth'));else{const _0x1b0540=await resolveAPIKeyAsync(_0x4ffed0,_0x1cf02c);if(_0x1b0540){const {source:_0x12bd45,isDeprecated:_0x4e0032}=_0x1b0540,_0x238cd0=_0x259c2e(0x1f7)+a46_0x3a18fb[_0x259c2e(0x1e0)](_0x12bd45);console[_0x259c2e(0x1e9)](_0x4e0032?a46_0x3a18fb[_0x259c2e(0x204)](_0x238cd0):_0x238cd0);}else console[_0x259c2e(0x1e9)](a46_0x3a18fb[_0x259c2e(0x204)](_0x259c2e(0x1ee)));}let _0x292bd6=![];try{const _0x5743ce=await _0x3b0a02[_0x259c2e(0x1dc)][_0x259c2e(0x1e4)]();console[_0x259c2e(0x1e9)](a46_0x3a18fb[_0x259c2e(0x1ec)]('✓\x20Authentication\x20successful\x0a')),console[_0x259c2e(0x1e9)](a46_0x3a18fb[_0x259c2e(0x1d3)](_0x259c2e(0x1dd))+'\x20'+a46_0x3a18fb['cyan'](_0x5743ce[_0x259c2e(0x1fb)]));if(_0x5743ce[_0x259c2e(0x1fe)]||_0x5743ce[_0x259c2e(0x1f8)]){const _0x17dbbf=[_0x5743ce[_0x259c2e(0x1fe)],_0x5743ce[_0x259c2e(0x1f8)]][_0x259c2e(0x1f3)](Boolean)[_0x259c2e(0x1d4)]('\x20');console['log'](a46_0x3a18fb['bold'](_0x259c2e(0x1d1))+'\x20'+_0x17dbbf);}_0x5743ce['account_id']&&console[_0x259c2e(0x1e9)](a46_0x3a18fb['bold'](_0x259c2e(0x1f0))+'\x20'+a46_0x3a18fb[_0x259c2e(0x204)](_0x5743ce['account_id'])),_0x292bd6=!![];}catch(_0x5019e3){_0x5019e3 instanceof HTTPClientError&&_0x5019e3[_0x259c2e(0x1df)]===0x191?printAuthError(_0x5019e3,!![],_0x1cf02c):console[_0x259c2e(0x1da)](a46_0x3a18fb['red'](_0x259c2e(0x200)+(_0x5019e3 instanceof Error?_0x5019e3[_0x259c2e(0x1e2)]:String(_0x5019e3))));}return console[_0x259c2e(0x1e9)](),_0x14117d['displayWithSources'](),_0x292bd6?0x0:0x1;}}
@@ -1 +1 @@
1
- const a47_0x528622=a47_0x1c78;(function(_0x283660,_0x164b1a){const _0x37dfee=a47_0x1c78,_0x248938=_0x283660();while(!![]){try{const _0x1957f8=parseInt(_0x37dfee(0x151))/0x1*(parseInt(_0x37dfee(0x145))/0x2)+parseInt(_0x37dfee(0x148))/0x3+-parseInt(_0x37dfee(0x144))/0x4+-parseInt(_0x37dfee(0x13f))/0x5+-parseInt(_0x37dfee(0x14d))/0x6*(-parseInt(_0x37dfee(0x166))/0x7)+-parseInt(_0x37dfee(0x14b))/0x8+-parseInt(_0x37dfee(0x141))/0x9*(-parseInt(_0x37dfee(0x169))/0xa);if(_0x1957f8===_0x164b1a)break;else _0x248938['push'](_0x248938['shift']());}catch(_0x3bb459){_0x248938['push'](_0x248938['shift']());}}}(a47_0x3930,0xc17a2));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput,isStructuredFormat}from'../core/command-output.js';function a47_0x3930(){const _0x3cf9bf=['1IGnXjK','log','\x20\x20Or:\x20\x20tdx\x20tables\x20--in\x20','\x27\x20across\x20all\x20databases.','Error:\x20Pattern\x20\x27','\x20\x20Cause:\x20','✔\x20Found\x20','table_name','Or\x20use\x20--in\x20flag:','Site:\x20','\x20\x20tdx\x20tables\x20\x22mydb.users\x22\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20in\x20database\x20mydb','includes','length','name','Note:\x20\x27','Database\x20pattern:\x20','verbose','message','validate','table','Did\x20you\x20mean\x20to\x20list\x20all\x20tables\x20from\x20database\x20\x27','28dVzHtU','tables','✖\x20No\x20tables\x20found','30pidJFR','\x20\x20tdx\x20tables\x20\x22*.user*\x22\x20\x20\x20\x20\x20\x20\x20->\x20tables\x20matching\x20user*\x20across\x20databases','description','data','database_name','\x20\x20Use:\x20tdx\x20tables\x20\x22','database','cause','Error:\x20','listTables','7649070iZYWnC','Error:\x20Too\x20many\x20arguments.\x20Use\x20single\x20argument:','2505141zloqsj','\x20\x20tdx\x20tables\x20--in\x20mydb\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb','List\x20tables\x20in\x20a\x20database','2844860nnqukr','3057646oSCNBx','Listing\x20tables...','query','4216149ZotKPq','error','Database:\x20all','7643216RXEVIR','\x20\x20Or:\x20\x20tdx\x20tables\x20--database\x20','329490qboRLj','Database:\x20','\x27\x20may\x20not\x20exist\x20or\x20contains\x20no\x20tables','📋\x20'];a47_0x3930=function(){return _0x3cf9bf;};return a47_0x3930();}import{parseTableReference}from'../utils/table-ref-parser.js';function a47_0x1c78(_0x541761,_0x247f73){_0x541761=_0x541761-0x13a;const _0x39300b=a47_0x3930();let _0x1c780d=_0x39300b[_0x541761];return _0x1c780d;}import{DEFAULT_LISTING_LIMIT,resolveLimit}from'../core/constants.js';import{withSpinner}from'../utils/spinner.js';export class TablesCommand extends BaseCommand{[a47_0x528622(0x15e)]=a47_0x528622(0x167);[a47_0x528622(0x16b)]=a47_0x528622(0x143);async['execute'](_0x28ba29){const _0x332820=a47_0x528622,{options:_0x2a78a7,args:_0x28723d,tdx:_0x1ffaa7}=_0x28ba29;let _0x2be522;if(_0x28723d[_0x332820(0x15d)]===0x0)_0x2be522={'database':undefined,'table':undefined,'original':''};else{if(_0x28723d[_0x332820(0x15d)]===0x1)try{_0x2be522=parseTableReference(_0x28723d[0x0]);if(_0x2be522[_0x332820(0x164)]&&!_0x2be522[_0x332820(0x13b)]&&!_0x2be522['table'][_0x332820(0x15c)]('*')&&!_0x2be522[_0x332820(0x164)][_0x332820(0x15c)]('?'))return console['error'](_0x332820(0x155)+_0x28723d[0x0]+'\x27\x20is\x20ambiguous.'),console[_0x332820(0x149)](_0x332820(0x165)+_0x2be522[_0x332820(0x164)]+'\x27?'),console[_0x332820(0x149)](_0x332820(0x13a)+_0x2be522['table']+'.*\x22'),console[_0x332820(0x149)](_0x332820(0x153)+_0x2be522[_0x332820(0x164)]),console[_0x332820(0x149)](_0x332820(0x14c)+_0x2be522[_0x332820(0x164)]),console[_0x332820(0x149)](''),console[_0x332820(0x149)](_0x332820(0x15f)+_0x28723d[0x0]+'\x27\x20without\x20wildcards\x20would\x20search\x20for\x20tables\x20named\x20\x27'+_0x2be522[_0x332820(0x164)]+_0x332820(0x154)),0x1;}catch(_0x27dee1){return console[_0x332820(0x149)]('Error:\x20'+_0x27dee1[_0x332820(0x162)]),0x1;}else return console[_0x332820(0x149)](_0x332820(0x140)),console['error']('\x20\x20tdx\x20tables\x20users\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20across\x20all\x20databases'),console[_0x332820(0x149)]('\x20\x20tdx\x20tables\x20\x22mydb.*\x22\x20\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb'),console[_0x332820(0x149)](_0x332820(0x15b)),console[_0x332820(0x149)](_0x332820(0x16a)),console[_0x332820(0x149)](_0x332820(0x159)),console[_0x332820(0x149)](_0x332820(0x142)),0x1;}const _0x46a840=_0x2a78a7[_0x332820(0x13b)];!_0x2be522['database']&&_0x46a840&&(_0x2be522[_0x332820(0x13b)]=_0x46a840);try{const _0x4a31a1=_0x3dc82e=>_0x3dc82e&&(_0x3dc82e[_0x332820(0x15c)]('*')||_0x3dc82e[_0x332820(0x15c)]('?')),_0x39d374=_0x4a31a1(_0x2be522[_0x332820(0x13b)]);_0x2a78a7[_0x332820(0x161)]&&(console[_0x332820(0x149)](_0x332820(0x15a)+_0x2a78a7['site']),_0x2be522['database']?_0x39d374?console[_0x332820(0x149)](_0x332820(0x160)+_0x2be522['database']):console[_0x332820(0x149)](_0x332820(0x14e)+_0x2be522[_0x332820(0x13b)]):console['error'](_0x332820(0x14a)),_0x2be522[_0x332820(0x164)]&&console[_0x332820(0x149)]('Table\x20pattern:\x20'+_0x2be522[_0x332820(0x164)]));const _0x2e8c22=_0x2be522[_0x332820(0x13b)]&&!_0x39d374?_0x2be522[_0x332820(0x13b)]:undefined,_0x177e39=_0x39d374?_0x2be522[_0x332820(0x13b)]:undefined,_0x310a32=_0x2be522[_0x332820(0x164)],_0x7d8fa1=resolveLimit(_0x2a78a7['limit'],DEFAULT_LISTING_LIMIT),_0xb549a6=await withSpinner(_0x332820(0x146),()=>_0x1ffaa7[_0x332820(0x147)][_0x332820(0x13e)](_0x2e8c22,_0x310a32,_0x177e39,_0x7d8fa1),{'verbose':_0x2a78a7[_0x332820(0x161)]}),_0x5b19c8=_0xb549a6[_0x332820(0x16c)];if(_0x5b19c8[_0x332820(0x15d)]===0x0&&_0x2be522[_0x332820(0x13b)]&&!_0x39d374)return console['error'](_0x332820(0x168)),console[_0x332820(0x149)]('Database\x20\x27'+_0x2be522[_0x332820(0x13b)]+_0x332820(0x14f)),0x1;console[_0x332820(0x149)](_0x332820(0x157)+_0x5b19c8[_0x332820(0x15d)]+'\x20table'+(_0x5b19c8[_0x332820(0x15d)]!==0x1?'s':''));if(isStructuredFormat(_0x2a78a7))await handleSDKOutput(_0x5b19c8,{..._0x2a78a7,'limit':_0x7d8fa1});else for(const _0x51628f of _0x5b19c8){const _0x26d671=_0x51628f[_0x332820(0x16d)]?_0x51628f[_0x332820(0x16d)]+'.':'';console[_0x332820(0x152)](_0x332820(0x150)+_0x26d671+_0x51628f[_0x332820(0x158)]);}return 0x0;}catch(_0x31792a){if(_0x31792a instanceof SDKError)return console[_0x332820(0x149)](_0x332820(0x13d)+_0x31792a['message']),_0x31792a[_0x332820(0x13c)]&&console[_0x332820(0x149)](_0x332820(0x156)+_0x31792a['cause']),0x1;throw _0x31792a;}}[a47_0x528622(0x163)](_0x249101){return undefined;}}
1
+ const a47_0x126ae7=a47_0x1353;function a47_0x1353(_0x2a7f2c,_0xc2f263){_0x2a7f2c=_0x2a7f2c-0x8f;const _0x1333c8=a47_0x1333();let _0x13538b=_0x1333c8[_0x2a7f2c];return _0x13538b;}(function(_0x194343,_0xc9e517){const _0x564fe7=a47_0x1353,_0x1d73ea=_0x194343();while(!![]){try{const _0x291fb9=-parseInt(_0x564fe7(0xaf))/0x1+parseInt(_0x564fe7(0xbf))/0x2+-parseInt(_0x564fe7(0xa2))/0x3*(parseInt(_0x564fe7(0xbe))/0x4)+parseInt(_0x564fe7(0xa9))/0x5*(parseInt(_0x564fe7(0x98))/0x6)+parseInt(_0x564fe7(0xb8))/0x7+parseInt(_0x564fe7(0xc0))/0x8*(parseInt(_0x564fe7(0xaa))/0x9)+-parseInt(_0x564fe7(0xb5))/0xa*(parseInt(_0x564fe7(0xa0))/0xb);if(_0x291fb9===_0xc9e517)break;else _0x1d73ea['push'](_0x1d73ea['shift']());}catch(_0x3daaad){_0x1d73ea['push'](_0x1d73ea['shift']());}}}(a47_0x1333,0x6ffa8));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';function a47_0x1333(){const _0x2ac901=['limit','Error:\x20Pattern\x20\x27','21084SyLfNG','table','\x20\x20Cause:\x20','Did\x20you\x20mean\x20to\x20list\x20all\x20tables\x20from\x20database\x20\x27','error','Error:\x20Too\x20many\x20arguments.\x20Use\x20single\x20argument:','10IuRHnA','.*\x22','Note:\x20\x27','2988384KADNIy','table_name','\x20\x20Or:\x20\x20tdx\x20tables\x20--in\x20','Database\x20pattern:\x20','Site:\x20','name','424mGRQmX','580554qplYJG','8HBnSIU','listTables','📋\x20','\x20\x20tdx\x20tables\x20users\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20across\x20all\x20databases','log','site','\x20\x20tdx\x20tables\x20--in\x20mydb\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb','List\x20tables\x20in\x20a\x20database','✖\x20No\x20tables\x20found','Table\x20pattern:\x20','validate','Listing\x20tables...','description','includes','data','54vbDcex','tables','query','database','execute','Database:\x20all','message','Or\x20use\x20--in\x20flag:','11483890tlNsIT','cause','4443KOnRmX','Database:\x20','length','\x20\x20tdx\x20tables\x20\x22mydb.*\x22\x20\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb','verbose','Error:\x20','\x27\x20without\x20wildcards\x20would\x20search\x20for\x20tables\x20named\x20\x27','47470HsMJRE','7902801oWyxjI','\x27\x20across\x20all\x20databases.','database_name'];a47_0x1333=function(){return _0x2ac901;};return a47_0x1333();}import{withSpinner}from'../utils/spinner.js';export class TablesCommand extends BaseCommand{[a47_0x126ae7(0xbd)]=a47_0x126ae7(0x99);[a47_0x126ae7(0x95)]=a47_0x126ae7(0x90);async[a47_0x126ae7(0x9c)](_0x5a9261){const _0x57a205=a47_0x126ae7,{options:_0x399524,args:_0x230278,tdx:_0x348c1d}=_0x5a9261;let _0x558cee;if(_0x230278['length']===0x0)_0x558cee={'database':undefined,'table':undefined,'original':''};else{if(_0x230278[_0x57a205(0xa4)]===0x1)try{_0x558cee=parseTableReference(_0x230278[0x0]);if(_0x558cee[_0x57a205(0xb0)]&&!_0x558cee[_0x57a205(0x9b)]&&!_0x558cee['table'][_0x57a205(0x96)]('*')&&!_0x558cee[_0x57a205(0xb0)][_0x57a205(0x96)]('?'))return console['error'](_0x57a205(0xae)+_0x230278[0x0]+'\x27\x20is\x20ambiguous.'),console[_0x57a205(0xb3)](_0x57a205(0xb2)+_0x558cee[_0x57a205(0xb0)]+'\x27?'),console['error']('\x20\x20Use:\x20tdx\x20tables\x20\x22'+_0x558cee[_0x57a205(0xb0)]+_0x57a205(0xb6)),console[_0x57a205(0xb3)](_0x57a205(0xba)+_0x558cee[_0x57a205(0xb0)]),console['error']('\x20\x20Or:\x20\x20tdx\x20tables\x20--database\x20'+_0x558cee['table']),console[_0x57a205(0xb3)](''),console[_0x57a205(0xb3)](_0x57a205(0xb7)+_0x230278[0x0]+_0x57a205(0xa8)+_0x558cee[_0x57a205(0xb0)]+_0x57a205(0xab)),0x1;}catch(_0x1bfd49){return console[_0x57a205(0xb3)](_0x57a205(0xa7)+_0x1bfd49[_0x57a205(0x9e)]),0x1;}else return console['error'](_0x57a205(0xb4)),console[_0x57a205(0xb3)](_0x57a205(0xc3)),console[_0x57a205(0xb3)](_0x57a205(0xa5)),console['error']('\x20\x20tdx\x20tables\x20\x22mydb.users\x22\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20in\x20database\x20mydb'),console['error']('\x20\x20tdx\x20tables\x20\x22*.user*\x22\x20\x20\x20\x20\x20\x20\x20->\x20tables\x20matching\x20user*\x20across\x20databases'),console[_0x57a205(0xb3)](_0x57a205(0x9f)),console['error'](_0x57a205(0x8f)),0x1;}const _0xed81a=_0x399524[_0x57a205(0x9b)];!_0x558cee[_0x57a205(0x9b)]&&_0xed81a&&(_0x558cee[_0x57a205(0x9b)]=_0xed81a);try{const _0x9494f7=_0x1c3d2b=>_0x1c3d2b&&(_0x1c3d2b['includes']('*')||_0x1c3d2b[_0x57a205(0x96)]('?')),_0x9b2f5=_0x9494f7(_0x558cee[_0x57a205(0x9b)]);_0x399524[_0x57a205(0xa6)]&&(console[_0x57a205(0xb3)](_0x57a205(0xbc)+_0x399524[_0x57a205(0xc5)]),_0x558cee[_0x57a205(0x9b)]?_0x9b2f5?console[_0x57a205(0xb3)](_0x57a205(0xbb)+_0x558cee[_0x57a205(0x9b)]):console[_0x57a205(0xb3)](_0x57a205(0xa3)+_0x558cee['database']):console[_0x57a205(0xb3)](_0x57a205(0x9d)),_0x558cee['table']&&console[_0x57a205(0xb3)](_0x57a205(0x92)+_0x558cee[_0x57a205(0xb0)]));const _0x575f4b=_0x558cee[_0x57a205(0x9b)]&&!_0x9b2f5?_0x558cee['database']:undefined,_0x221c08=_0x9b2f5?_0x558cee['database']:undefined,_0x22c08d=_0x558cee[_0x57a205(0xb0)],_0x9eca9e=resolveLimit(_0x399524[_0x57a205(0xad)],DEFAULT_LISTING_LIMIT),_0x31d697=await withSpinner(_0x57a205(0x94),()=>_0x348c1d[_0x57a205(0x9a)][_0x57a205(0xc1)](_0x575f4b,_0x22c08d,_0x221c08,_0x9eca9e),{'verbose':_0x399524[_0x57a205(0xa6)]}),_0x539f75=_0x31d697[_0x57a205(0x97)];if(_0x539f75['length']===0x0&&_0x558cee[_0x57a205(0x9b)]&&!_0x9b2f5)return console[_0x57a205(0xb3)](_0x57a205(0x91)),console[_0x57a205(0xb3)]('Database\x20\x27'+_0x558cee['database']+'\x27\x20may\x20not\x20exist\x20or\x20contains\x20no\x20tables'),0x1;console[_0x57a205(0xb3)]('✔\x20Found\x20'+_0x539f75[_0x57a205(0xa4)]+'\x20table'+(_0x539f75[_0x57a205(0xa4)]!==0x1?'s':''));if(isStructuredFormat(_0x399524))await handleSDKOutput(_0x539f75,{..._0x399524,'limit':_0x9eca9e});else for(const _0x439ff5 of _0x539f75){const _0x265c2e=_0x439ff5[_0x57a205(0xac)]?_0x439ff5[_0x57a205(0xac)]+'.':'';console[_0x57a205(0xc4)](_0x57a205(0xc2)+_0x265c2e+_0x439ff5[_0x57a205(0xb9)]);}return 0x0;}catch(_0x2c5fbc){if(_0x2c5fbc instanceof SDKError)return console[_0x57a205(0xb3)](_0x57a205(0xa7)+_0x2c5fbc[_0x57a205(0x9e)]),_0x2c5fbc['cause']&&console[_0x57a205(0xb3)](_0x57a205(0xb1)+_0x2c5fbc[_0x57a205(0xa1)]),0x1;throw _0x2c5fbc;}}[a47_0x126ae7(0x93)](_0x36dbbf){return undefined;}}
@@ -1 +1 @@
1
- const a48_0x1f5884=a48_0x2cbf;function a48_0x3466(){const _0x24b927=['Invalid\x20resource:\x20','2681NqYNBC','7423200nPSpay','engage_workspace','1392ZdIcpg','Clear\x20session-level\x20or\x20default\x20context\x20values','includes','error','Default\x20profile\x20','cleared','44624hKmwxo','validate','description','dim','join','execute','4UyaqHR','site','\x20\x20\x20\x20\x20\x20\x20tdx\x20unset\x20--default\x20<resource>\x20\x20#\x20Clear\x20default\x20from\x20config\x0a','log','.\x20Must\x20be\x20one\x20of:\x20','session','1133321KGcYtb','\x0aUpdated:\x20','14244gqcpOz','Default\x20site\x20','agent','llm_agent','parent_segment','green','profile','unset','2761215gcUCQo','3964gYGaQb','Session\x20','llm_project','5080779voQODr','Usage:\x20tdx\x20unset\x20<resource>\x0a','333GFJmpe','default','name'];a48_0x3466=function(){return _0x24b927;};return a48_0x3466();}(function(_0x155ea4,_0x4f05e8){const _0x3c88e5=a48_0x2cbf,_0x2da78f=_0x155ea4();while(!![]){try{const _0x2d8d30=parseInt(_0x3c88e5(0x16a))/0x1+parseInt(_0x3c88e5(0x175))/0x2*(-parseInt(_0x3c88e5(0x181))/0x3)+-parseInt(_0x3c88e5(0x18d))/0x4*(-parseInt(_0x3c88e5(0x174))/0x5)+-parseInt(_0x3c88e5(0x16c))/0x6*(-parseInt(_0x3c88e5(0x17e))/0x7)+-parseInt(_0x3c88e5(0x187))/0x8*(-parseInt(_0x3c88e5(0x17a))/0x9)+-parseInt(_0x3c88e5(0x17f))/0xa+-parseInt(_0x3c88e5(0x178))/0xb;if(_0x2d8d30===_0x4f05e8)break;else _0x2da78f['push'](_0x2da78f['shift']());}catch(_0x59a068){_0x2da78f['push'](_0x2da78f['shift']());}}}(a48_0x3466,0xa55d7));import{BaseCommand}from'./command.js';import{getSessionID,cleanExpiredSessions,clearSessionContextField}from'../core/session.js';import{clearDefaultSiteFromUserConfig,clearActiveProfileFromUserConfig}from'../core/profile.js';import{getConfigDir}from'../core/config.js';function a48_0x2cbf(_0x192e9f,_0x49a6ef){_0x192e9f=_0x192e9f-0x167;const _0x34666d=a48_0x3466();let _0x2cbfd7=_0x34666d[_0x192e9f];return _0x2cbfd7;}import a48_0x5715e9 from'chalk';import*as a48_0x459272 from'node:path';export class UnsetCommand extends BaseCommand{[a48_0x1f5884(0x17c)]=a48_0x1f5884(0x173);[a48_0x1f5884(0x189)]=a48_0x1f5884(0x182);[a48_0x1f5884(0x188)](_0x21b3bb){const _0x352c93=a48_0x1f5884,{args:_0x292067,options:_0x3f8943}=_0x21b3bb,_0x7faa5e=_0x3f8943['default'];if(_0x292067['length']===0x0)return _0x352c93(0x179)+_0x352c93(0x18f)+'\x0aResources:\x20site,\x20database,\x20parent_segment,\x20llm_project,\x20agent,\x20profile,\x20engage_workspace\x0a'+'\x0aRun\x20\x27tdx\x20unset\x20--help\x27\x20for\x20more\x20options';const _0x387337=_0x292067[0x0],_0x26721d=[_0x352c93(0x18e),'database',_0x352c93(0x170),_0x352c93(0x177),_0x352c93(0x16e),'profile','engage_workspace'];if(!_0x26721d[_0x352c93(0x183)](_0x387337))return _0x352c93(0x17d)+_0x387337+_0x352c93(0x168)+_0x26721d[_0x352c93(0x18b)](',\x20');if(_0x7faa5e&&_0x387337!==_0x352c93(0x18e)&&_0x387337!==_0x352c93(0x172))return'--default\x20can\x20only\x20be\x20used\x20with\x20\x27site\x27\x20or\x20\x27profile\x27.\x20Other\x20resources\x20are\x20session-level\x20only.';return undefined;}async[a48_0x1f5884(0x18c)](_0x551dae){const _0x4904e1=a48_0x1f5884,{args:_0xef0914,options:_0x1943cb}=_0x551dae,_0x3502b7=_0x1943cb[_0x4904e1(0x17b)];cleanExpiredSessions();try{const _0x367ed9=_0xef0914[0x0],_0x683c40=a48_0x459272['join'](getConfigDir(),'tdx.json');if(_0x3502b7){if(_0x367ed9===_0x4904e1(0x18e))return clearDefaultSiteFromUserConfig(),console[_0x4904e1(0x167)](_0x4904e1(0x16d)+a48_0x5715e9[_0x4904e1(0x171)](_0x4904e1(0x186))),console[_0x4904e1(0x167)](a48_0x5715e9['dim'](_0x4904e1(0x16b)+_0x683c40)),0x0;if(_0x367ed9===_0x4904e1(0x172))return clearActiveProfileFromUserConfig(),console[_0x4904e1(0x167)](_0x4904e1(0x185)+a48_0x5715e9[_0x4904e1(0x171)]('cleared')),console['log'](a48_0x5715e9[_0x4904e1(0x18a)](_0x4904e1(0x16b)+_0x683c40)),0x0;}const _0x32fae1=getSessionID(_0x1943cb['session']),_0x48c291={'site':'site','database':'database','parent_segment':_0x4904e1(0x170),'llm_project':_0x4904e1(0x177),'agent':_0x4904e1(0x16f),'profile':_0x4904e1(0x172),'engage_workspace':_0x4904e1(0x180)},_0x498adc=_0x48c291[_0x367ed9];return _0x498adc&&(clearSessionContextField(_0x498adc,_0x1943cb[_0x4904e1(0x169)]),console[_0x4904e1(0x167)](_0x4904e1(0x176)+_0x367ed9+'\x20'+a48_0x5715e9[_0x4904e1(0x171)](_0x4904e1(0x186))+'\x20'+a48_0x5715e9[_0x4904e1(0x18a)]('(session:\x20'+_0x32fae1+')'))),0x0;}catch(_0x13c302){return _0x13c302 instanceof Error&&console[_0x4904e1(0x184)]('Error:\x20'+_0x13c302['message']),0x1;}}}
1
+ function a48_0x26ba(){const _0x5c5a0e=['84557NoHJRB','engage_workspace','Default\x20site\x20','error','50klmxdE','.\x20Must\x20be\x20one\x20of:\x20','9EkiJNt','Session\x20','llm_agent','name','144eQyMcu','Invalid\x20resource:\x20','Default\x20profile\x20','Usage:\x20tdx\x20unset\x20<resource>\x0a','session','616804NVPaWn','site','dim','description','(session:\x20','length','parent_segment','\x0aResources:\x20site,\x20database,\x20parent_segment,\x20llm_project,\x20agent,\x20profile,\x20engage_workspace\x0a','profile','Clear\x20session-level\x20or\x20default\x20context\x20values','35301OvKHri','tdx.json','message','llm_project','37443xNYQdt','128460vdlBtJ','11216XPXpQG','\x0aRun\x20\x27tdx\x20unset\x20--help\x27\x20for\x20more\x20options','unset','log','62ccqXrz','green','109075xRAPaP','includes','database','\x20\x20\x20\x20\x20\x20\x20tdx\x20unset\x20--default\x20<resource>\x20\x20#\x20Clear\x20default\x20from\x20config\x0a','\x0aUpdated:\x20','cleared','--default\x20can\x20only\x20be\x20used\x20with\x20\x27site\x27\x20or\x20\x27profile\x27.\x20Other\x20resources\x20are\x20session-level\x20only.','140xonmXC','default'];a48_0x26ba=function(){return _0x5c5a0e;};return a48_0x26ba();}const a48_0x2a58d0=a48_0x5473;(function(_0x5d021c,_0x15d5ff){const _0x43e72d=a48_0x5473,_0x52bf65=_0x5d021c();while(!![]){try{const _0x3ccdf1=parseInt(_0x43e72d(0x1c0))/0x1+-parseInt(_0x43e72d(0x1a6))/0x2*(-parseInt(_0x43e72d(0x1a0))/0x3)+parseInt(_0x43e72d(0x1af))/0x4*(-parseInt(_0x43e72d(0x1a8))/0x5)+-parseInt(_0x43e72d(0x1bb))/0x6*(-parseInt(_0x43e72d(0x1ca))/0x7)+-parseInt(_0x43e72d(0x1a2))/0x8*(parseInt(_0x43e72d(0x1b7))/0x9)+-parseInt(_0x43e72d(0x1b5))/0xa*(-parseInt(_0x43e72d(0x1b1))/0xb)+parseInt(_0x43e72d(0x1a1))/0xc;if(_0x3ccdf1===_0x15d5ff)break;else _0x52bf65['push'](_0x52bf65['shift']());}catch(_0x1610a4){_0x52bf65['push'](_0x52bf65['shift']());}}}(a48_0x26ba,0x63d80));import{BaseCommand}from'./command.js';import{getSessionID,cleanExpiredSessions,clearSessionContextField}from'../core/session.js';function a48_0x5473(_0x359b10,_0x37ac6d){_0x359b10=_0x359b10-0x19e;const _0x26ba61=a48_0x26ba();let _0x5473e1=_0x26ba61[_0x359b10];return _0x5473e1;}import{clearDefaultSiteFromUserConfig,clearActiveProfileFromUserConfig}from'../core/profile.js';import{getConfigDir}from'../core/config.js';import a48_0x9463f2 from'chalk';import*as a48_0x4eae3a from'node:path';export class UnsetCommand extends BaseCommand{[a48_0x2a58d0(0x1ba)]=a48_0x2a58d0(0x1a4);[a48_0x2a58d0(0x1c3)]=a48_0x2a58d0(0x1c9);['validate'](_0x96ce6b){const _0xfbaa91=a48_0x2a58d0,{args:_0x57d267,options:_0x2ff275}=_0x96ce6b,_0x112a58=_0x2ff275[_0xfbaa91(0x1b0)];if(_0x57d267[_0xfbaa91(0x1c5)]===0x0)return _0xfbaa91(0x1be)+_0xfbaa91(0x1ab)+_0xfbaa91(0x1c7)+_0xfbaa91(0x1a3);const _0x2bb219=_0x57d267[0x0],_0x163156=['site',_0xfbaa91(0x1aa),_0xfbaa91(0x1c6),_0xfbaa91(0x19f),'agent',_0xfbaa91(0x1c8),_0xfbaa91(0x1b2)];if(!_0x163156[_0xfbaa91(0x1a9)](_0x2bb219))return _0xfbaa91(0x1bc)+_0x2bb219+_0xfbaa91(0x1b6)+_0x163156['join'](',\x20');if(_0x112a58&&_0x2bb219!==_0xfbaa91(0x1c1)&&_0x2bb219!=='profile')return _0xfbaa91(0x1ae);return undefined;}async['execute'](_0x4f1dec){const _0x3111fa=a48_0x2a58d0,{args:_0x5d8bdc,options:_0xc90c94}=_0x4f1dec,_0x3813c1=_0xc90c94[_0x3111fa(0x1b0)];cleanExpiredSessions();try{const _0x499e38=_0x5d8bdc[0x0],_0x539d46=a48_0x4eae3a['join'](getConfigDir(),_0x3111fa(0x1cb));if(_0x3813c1){if(_0x499e38==='site')return clearDefaultSiteFromUserConfig(),console[_0x3111fa(0x1a5)](_0x3111fa(0x1b3)+a48_0x9463f2[_0x3111fa(0x1a7)](_0x3111fa(0x1ad))),console[_0x3111fa(0x1a5)](a48_0x9463f2[_0x3111fa(0x1c2)](_0x3111fa(0x1ac)+_0x539d46)),0x0;if(_0x499e38===_0x3111fa(0x1c8))return clearActiveProfileFromUserConfig(),console[_0x3111fa(0x1a5)](_0x3111fa(0x1bd)+a48_0x9463f2[_0x3111fa(0x1a7)](_0x3111fa(0x1ad))),console[_0x3111fa(0x1a5)](a48_0x9463f2[_0x3111fa(0x1c2)](_0x3111fa(0x1ac)+_0x539d46)),0x0;}const _0x305d9e=getSessionID(_0xc90c94['session']),_0x25139d={'site':_0x3111fa(0x1c1),'database':_0x3111fa(0x1aa),'parent_segment':_0x3111fa(0x1c6),'llm_project':_0x3111fa(0x19f),'agent':_0x3111fa(0x1b9),'profile':_0x3111fa(0x1c8),'engage_workspace':'engage_workspace'},_0x5f35f0=_0x25139d[_0x499e38];return _0x5f35f0&&(clearSessionContextField(_0x5f35f0,_0xc90c94[_0x3111fa(0x1bf)]),console[_0x3111fa(0x1a5)](_0x3111fa(0x1b8)+_0x499e38+'\x20'+a48_0x9463f2[_0x3111fa(0x1a7)]('cleared')+'\x20'+a48_0x9463f2[_0x3111fa(0x1c2)](_0x3111fa(0x1c4)+_0x305d9e+')'))),0x0;}catch(_0x5a9492){return _0x5a9492 instanceof Error&&console[_0x3111fa(0x1b4)]('Error:\x20'+_0x5a9492[_0x3111fa(0x19e)]),0x1;}}}