@treasuredata/tdx 2026.3.20 → 2026.3.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (223) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.d.ts +1 -1
  4. package/dist/cli-categories.js +1 -1
  5. package/dist/cli-categories.js.map +1 -1
  6. package/dist/cli.d.ts.map +1 -1
  7. package/dist/cli.js +1 -1
  8. package/dist/cli.js.map +1 -1
  9. package/dist/commands/activations.js +1 -1
  10. package/dist/commands/agent-command.js +1 -1
  11. package/dist/commands/agent-test-command.js +1 -1
  12. package/dist/commands/api-command.js +1 -1
  13. package/dist/commands/auth-command.js +1 -1
  14. package/dist/commands/auth-login-command.js +1 -1
  15. package/dist/commands/chat-command.js +1 -1
  16. package/dist/commands/claude-command.js +1 -1
  17. package/dist/commands/claude-statusline-command.js +1 -1
  18. package/dist/commands/claude-usage-command.js +1 -1
  19. package/dist/commands/command.js +1 -1
  20. package/dist/commands/connection-command.js +1 -1
  21. package/dist/commands/databases.js +1 -1
  22. package/dist/commands/delivery-command.js +1 -1
  23. package/dist/commands/describe.js +1 -1
  24. package/dist/commands/engage-campaign-pull-command.js +1 -1
  25. package/dist/commands/engage-campaign-push-command.js +1 -1
  26. package/dist/commands/engage-campaign-validate-command.js +1 -1
  27. package/dist/commands/engage-command.js +1 -1
  28. package/dist/commands/engage-template-pull-command.js +1 -1
  29. package/dist/commands/engage-template-push-command.js +1 -1
  30. package/dist/commands/engage-template-validate-command.js +1 -1
  31. package/dist/commands/job-command.js +1 -1
  32. package/dist/commands/journey-command.js +1 -1
  33. package/dist/commands/journey-validate-command.js +1 -1
  34. package/dist/commands/llm-command.js +1 -1
  35. package/dist/commands/mcp-command.js +1 -1
  36. package/dist/commands/parent-segment-command.js +1 -1
  37. package/dist/commands/policy-command.d.ts +33 -0
  38. package/dist/commands/policy-command.d.ts.map +1 -0
  39. package/dist/commands/policy-command.js +1 -0
  40. package/dist/commands/policy-command.js.map +1 -0
  41. package/dist/commands/profile-command.js +1 -1
  42. package/dist/commands/profiles-command.js +1 -1
  43. package/dist/commands/query-command.js +1 -1
  44. package/dist/commands/schedule-command.js +1 -1
  45. package/dist/commands/segment-command.js +1 -1
  46. package/dist/commands/segment-create-command.js +1 -1
  47. package/dist/commands/segment-fields-command.js +1 -1
  48. package/dist/commands/segment-pull-command.js +1 -1
  49. package/dist/commands/segment-push-command.js +1 -1
  50. package/dist/commands/segment-update-command.js +1 -1
  51. package/dist/commands/segment-use-command.js +1 -1
  52. package/dist/commands/segment-validate-command.js +1 -1
  53. package/dist/commands/segments.js +1 -1
  54. package/dist/commands/show.js +1 -1
  55. package/dist/commands/status-command.js +1 -1
  56. package/dist/commands/tables.js +1 -1
  57. package/dist/commands/unset-command.js +1 -1
  58. package/dist/commands/upgrade-command.js +1 -1
  59. package/dist/commands/use-command.js +1 -1
  60. package/dist/commands/user-command.js +1 -1
  61. package/dist/commands/workflow-command.js +1 -1
  62. package/dist/core/auth.js +1 -1
  63. package/dist/core/command-output.js +1 -1
  64. package/dist/core/config.js +1 -1
  65. package/dist/core/connection-cache.js +1 -1
  66. package/dist/core/constants.js +1 -1
  67. package/dist/core/credential-cache.js +1 -1
  68. package/dist/core/global-context.js +1 -1
  69. package/dist/core/keychain.js +1 -1
  70. package/dist/core/oauth-keychain.js +1 -1
  71. package/dist/core/oauth.js +1 -1
  72. package/dist/core/profile.js +1 -1
  73. package/dist/core/project-config.js +1 -1
  74. package/dist/core/session.js +1 -1
  75. package/dist/core/user-cache.js +1 -1
  76. package/dist/core/version.js +1 -1
  77. package/dist/index.js +1 -1
  78. package/dist/mcp/server.js +1 -1
  79. package/dist/mcp/tools/index.js +1 -1
  80. package/dist/mcp/tools/tdx-run.js +1 -1
  81. package/dist/mcp/tools/tdx-search.js +1 -1
  82. package/dist/mcp/utils.js +1 -1
  83. package/dist/proxy/claude-usage-tracker.js +1 -1
  84. package/dist/proxy/passthrough-server.js +1 -1
  85. package/dist/proxy/sse-usage-parser.js +1 -1
  86. package/dist/sdk/agent/agent-config.js +1 -1
  87. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  88. package/dist/sdk/agent/agent-yaml.js +1 -1
  89. package/dist/sdk/agent/test/evaluator.js +1 -1
  90. package/dist/sdk/agent/test/executor.js +1 -1
  91. package/dist/sdk/agent/test/index.js +1 -1
  92. package/dist/sdk/agent/test/output.js +1 -1
  93. package/dist/sdk/agent/test/parser.js +1 -1
  94. package/dist/sdk/agent/tool-target-registry.js +1 -1
  95. package/dist/sdk/api.js +1 -1
  96. package/dist/sdk/client/cdp-api-client.js +1 -1
  97. package/dist/sdk/client/delivery-api-client.js +1 -1
  98. package/dist/sdk/client/endpoints.js +1 -1
  99. package/dist/sdk/client/engage-api-client.js +1 -1
  100. package/dist/sdk/client/http-client.js +1 -1
  101. package/dist/sdk/client/llm-api-client.js +1 -1
  102. package/dist/sdk/client/oauth-refresh.js +1 -1
  103. package/dist/sdk/client/rate-limiter.js +1 -1
  104. package/dist/sdk/client/td-api-client.js +1 -1
  105. package/dist/sdk/client/trino-api-client.js +1 -1
  106. package/dist/sdk/client/workflow-client.js +1 -1
  107. package/dist/sdk/connection-validator.js +1 -1
  108. package/dist/sdk/connection.js +1 -1
  109. package/dist/sdk/delivery.js +1 -1
  110. package/dist/sdk/engage/campaign-pull.js +1 -1
  111. package/dist/sdk/engage/campaign-push.js +1 -1
  112. package/dist/sdk/engage/campaign-validator.js +1 -1
  113. package/dist/sdk/engage/campaign-yaml.js +1 -1
  114. package/dist/sdk/engage/template-pull.js +1 -1
  115. package/dist/sdk/engage/template-push.js +1 -1
  116. package/dist/sdk/engage/template-validator.js +1 -1
  117. package/dist/sdk/engage/template-yaml.js +1 -1
  118. package/dist/sdk/engage/types/campaign-def.js +1 -1
  119. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  120. package/dist/sdk/engage/types/template-schema.js +1 -1
  121. package/dist/sdk/engage.js +1 -1
  122. package/dist/sdk/errors.js +1 -1
  123. package/dist/sdk/index.d.ts +7 -0
  124. package/dist/sdk/index.d.ts.map +1 -1
  125. package/dist/sdk/index.js +1 -1
  126. package/dist/sdk/index.js.map +1 -1
  127. package/dist/sdk/io/index.js +1 -1
  128. package/dist/sdk/io/node-filesystem.js +1 -1
  129. package/dist/sdk/job.js +1 -1
  130. package/dist/sdk/journey.js +1 -1
  131. package/dist/sdk/llm/chat-cache.js +1 -1
  132. package/dist/sdk/llm/index.js +1 -1
  133. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  134. package/dist/sdk/llm/model-factors.js +1 -1
  135. package/dist/sdk/personalization.js +1 -1
  136. package/dist/sdk/policy.d.ts +41 -0
  137. package/dist/sdk/policy.d.ts.map +1 -0
  138. package/dist/sdk/policy.js +1 -0
  139. package/dist/sdk/policy.js.map +1 -0
  140. package/dist/sdk/query/index.js +1 -1
  141. package/dist/sdk/query/sql-parser.js +1 -1
  142. package/dist/sdk/realtime.js +1 -1
  143. package/dist/sdk/schedule.js +1 -1
  144. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  145. package/dist/sdk/segment/fields-display.js +1 -1
  146. package/dist/sdk/segment/file-discovery.js +1 -1
  147. package/dist/sdk/segment/journey-utils.js +1 -1
  148. package/dist/sdk/segment/journey-validator.js +1 -1
  149. package/dist/sdk/segment/journey-yaml.js +1 -1
  150. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  151. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  152. package/dist/sdk/segment/pull-workflow.js +1 -1
  153. package/dist/sdk/segment/push-recovery.js +1 -1
  154. package/dist/sdk/segment/push-workflow.js +1 -1
  155. package/dist/sdk/segment/resolution-context.js +1 -1
  156. package/dist/sdk/segment/segment-path-parser.js +1 -1
  157. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  158. package/dist/sdk/segment/segment-validator.js +1 -1
  159. package/dist/sdk/segment/target-resolution.js +1 -1
  160. package/dist/sdk/segment/tdx-config.js +1 -1
  161. package/dist/sdk/segment/types/activation-schema.js +1 -1
  162. package/dist/sdk/segment/types/journey-def.js +1 -1
  163. package/dist/sdk/segment/types/journey-schema.js +1 -1
  164. package/dist/sdk/segment/types/segment-def.js +1 -1
  165. package/dist/sdk/segment/types/segment-schema.js +1 -1
  166. package/dist/sdk/segment/validate-files.js +1 -1
  167. package/dist/sdk/segment/yaml-validator.js +1 -1
  168. package/dist/sdk/segment.js +1 -1
  169. package/dist/sdk/types/index.d.ts +1 -0
  170. package/dist/sdk/types/index.d.ts.map +1 -1
  171. package/dist/sdk/types/index.js +1 -1
  172. package/dist/sdk/types/index.js.map +1 -1
  173. package/dist/sdk/types/policy.d.ts +58 -0
  174. package/dist/sdk/types/policy.d.ts.map +1 -0
  175. package/dist/sdk/types/policy.js +1 -0
  176. package/dist/sdk/types/policy.js.map +1 -0
  177. package/dist/sdk/types/progress.js +1 -1
  178. package/dist/sdk/user.js +1 -1
  179. package/dist/sdk/util/format-detector.js +1 -1
  180. package/dist/sdk/util/formatters.js +1 -1
  181. package/dist/sdk/util/index.js +1 -1
  182. package/dist/sdk/util/paginate.js +1 -1
  183. package/dist/sdk/util/tree-formatter.js +1 -1
  184. package/dist/sdk/workflow/archive-validation.js +1 -1
  185. package/dist/sdk/workflow/clone-workflow.js +1 -1
  186. package/dist/sdk/workflow/index.js +1 -1
  187. package/dist/sdk/workflow/pull-workflow.js +1 -1
  188. package/dist/sdk/workflow/push-workflow.js +1 -1
  189. package/dist/sdk/workflow/tdx-config.js +1 -1
  190. package/dist/sdk/workflow/workflow-utils.js +1 -1
  191. package/dist/test-utils/command-runner.js +1 -1
  192. package/dist/test-utils/factories.js +1 -1
  193. package/dist/test-utils/fixtures.js +1 -1
  194. package/dist/test-utils/http-mock.js +1 -1
  195. package/dist/test-utils/index.js +1 -1
  196. package/dist/utils/async.js +1 -1
  197. package/dist/utils/colors.js +1 -1
  198. package/dist/utils/diff.js +1 -1
  199. package/dist/utils/file-permissions.js +1 -1
  200. package/dist/utils/file-reader.js +1 -1
  201. package/dist/utils/github-releases.js +1 -1
  202. package/dist/utils/global-cache.js +1 -1
  203. package/dist/utils/json-loader.js +1 -1
  204. package/dist/utils/local-cache.js +1 -1
  205. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  206. package/dist/utils/logger/formatters/index.js +1 -1
  207. package/dist/utils/logger/handlers/console-handler.js +1 -1
  208. package/dist/utils/logger/handlers/file-handler.js +1 -1
  209. package/dist/utils/logger/handlers/index.js +1 -1
  210. package/dist/utils/logger/handlers/null-handler.js +1 -1
  211. package/dist/utils/logger/index.js +1 -1
  212. package/dist/utils/logger/logger.js +1 -1
  213. package/dist/utils/logger/types.js +1 -1
  214. package/dist/utils/option-validation.js +1 -1
  215. package/dist/utils/process.js +1 -1
  216. package/dist/utils/prompt.js +1 -1
  217. package/dist/utils/spinner.js +1 -1
  218. package/dist/utils/sse-parser.js +1 -1
  219. package/dist/utils/string-utils.js +1 -1
  220. package/dist/utils/table-ref-parser.js +1 -1
  221. package/dist/utils/tdx-logger.js +1 -1
  222. package/dist/utils/version-check.js +1 -1
  223. package/package.json +1 -1
@@ -1 +1 @@
1
- const a39_0x407809=a39_0xcbab;function a39_0xcbab(_0x475088,_0xbc354a){_0x475088=_0x475088-0x19c;const _0x17c9e4=a39_0x17c9();let _0xcbab37=_0x17c9e4[_0x475088];return _0xcbab37;}(function(_0x299faf,_0x4acb0b){const _0x38196b=a39_0xcbab,_0x981383=_0x299faf();while(!![]){try{const _0x98edba=-parseInt(_0x38196b(0x1c0))/0x1*(parseInt(_0x38196b(0x1c9))/0x2)+parseInt(_0x38196b(0x1ba))/0x3*(-parseInt(_0x38196b(0x1f8))/0x4)+-parseInt(_0x38196b(0x1d6))/0x5+-parseInt(_0x38196b(0x1cf))/0x6+-parseInt(_0x38196b(0x1ee))/0x7+-parseInt(_0x38196b(0x1df))/0x8*(-parseInt(_0x38196b(0x1d9))/0x9)+parseInt(_0x38196b(0x235))/0xa;if(_0x98edba===_0x4acb0b)break;else _0x981383['push'](_0x981383['shift']());}catch(_0x179efc){_0x981383['push'](_0x981383['shift']());}}}(a39_0x17c9,0x5c3b2));import{BaseCommand}from'./command.js';function a39_0x17c9(){const _0x48fe92=['toDelete','push','attributes','\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20','Resolving\x20parent\x20segment\x20\x27','Delete\x20journey:','folderId','Error\x20parsing\x20YAML:\x20','Parent\x20segment:\x20','(Journey\x20will\x20be\x20deleted)','repeat','journey','Scoped\x20to\x20folder:\x20','\x20\x20🗺️\x20\x20Journeys:','New\x20segment:','segment\x20or\x20journey','no_parent','.yml','3TcWhaP','segmentFolderId','segments','\x20changed','segment','\x27...','7047gBwfqd','\x20folders\x20to\x20create','results','/e/','relationships','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','\x20to\x20update','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','26VmbGel','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','dryRun','existingSegment','\x20changes?','Site:\x20','147642JhdFqY','parentName','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','Fetching\x20connections\x20for\x20name\x20resolution...','journeys','diff','segment:push','3008050CrWOsI','yes','cyan','171tswzht','green','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','connection','new','nameToType','33032NjFzoA','targetDir','verbose','listActivations','Changes\x20to:','parentSegment','journeyBundleName','\x20YAML\x20files\x20found','\x20updated','join','execute','error','site','blue','/app/ps/','1495592sRJMda','user','\x0a✔\x20Push\x20complete','state','buildUserMaps','\x20created','createdAt','Fetching\x20existing\x20activations...','journeysOnly','folderPath','2678964MeuNJs','isNew','\x20to\x20delete','length','nameToId','Changes\x20to\x20journey:','getOutputSchemaWithCache','created','isScoped','toCreate','file','cwd','\x20\x20Segments:\x20','changed','type','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','endsWith','\x20deleted','updated','scopedFolderPath','\x20\x20\x20\x20','journeyId','toUpdate','getJourney','versionNumber','message','data','red','Delete\x20segment:','idToName','\x20\x20Source:\x20','\x20unchanged','existingJourney','list','\x20activations]','deleted','set','setPhase','Fetching\x20existing\x20data...','\x20\x20📊\x20Segments:','folders','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','name','all','\x0aPush\x20summary\x20for\x20\x27','helpText','journeyBundleId','activations','listSegments','map','yamlConfig','audienceId','\x20new','listJourneysWithDetailsFromParentSegment','description','Preparing\x20journeys...','/sb/da/esr','createdSegmentIds','/j/da/je','Error:\x20Directory\x20not\x20found:\x20','19005520hpgQdl','Push\x20','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','resolveParentId','errorCode','parent_name','New\x20journey:','\x20\x20Activations:\x20','\x0aValidation\x20failed:','.yaml','delete','📁\x20','yellow','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','✔\x20All\x20journeys\x20are\x20up\x20to\x20date','paused','dim','then','updatedAt','get'];a39_0x17c9=function(){return _0x48fe92;};return a39_0x17c9();}import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{generateDiff,formatDiffWithColors}from'../utils/diff.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{batchAsync}from'../utils/async.js';import{segmentToYamlString,segmentWithActivationsToYaml}from'../sdk/segment/child-segment-yaml.js';import a39_0x320717 from'chalk';import{existsSync}from'fs';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{resolveTarget,isSuccessfulResolution,getScopedDetails}from'../sdk/segment/target-resolution.js';import{buildFolderMaps}from'../sdk/segment/resolution-context.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{resolveTDFolderPath,findSegmentsToDelete,findJourneysToDelete,buildSegmentLookupMap,buildSegmentNameToIdMap,buildJourneyBundleLookupMap,parseAndClassifyYamlFiles,validateParsedFiles,formatValidationErrors,extractRootFolderId,buildConnectionMaps,calculatePushStats,prepareSegmentFiles,prepareJourneyFiles,executePushSegments,executePushFolders,executePushSegmentDeletions,executePushJourneys}from'../sdk/segment/push-workflow.js';export class SegmentPushCommand extends BaseCommand{[a39_0x407809(0x223)]=a39_0x407809(0x1d5);['description']=a39_0x407809(0x1c7);async[a39_0x407809(0x1e9)](_0x53718f){const _0xe57bcf=a39_0x407809,{options:_0x49774f,args:_0x34c195,tdx:_0x46419}=_0x53718f,_0x565639=_0x49774f,_0x59ff7a=await resolveTarget({'arg':_0x34c195[0x0],'contextParent':_0x49774f[_0xe57bcf(0x1e4)],'cwd':process[_0xe57bcf(0x203)]()});if(!isSuccessfulResolution(_0x59ff7a))return _0x59ff7a[_0xe57bcf(0x239)]===_0xe57bcf(0x1b8)?(console[_0xe57bcf(0x1ea)](a39_0x320717[_0xe57bcf(0x1a0)](_0xe57bcf(0x237))),console[_0xe57bcf(0x1ea)]('Usage:\x20tdx\x20sg\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20(requires\x20context)'),console['error'](_0xe57bcf(0x1c5)),console[_0xe57bcf(0x1ea)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file')):(console[_0xe57bcf(0x1ea)](a39_0x320717[_0xe57bcf(0x214)]('Error:\x20'+_0x59ff7a['message']+'\x0a')),_0x59ff7a[_0xe57bcf(0x226)]&&console['error'](a39_0x320717[_0xe57bcf(0x1d8)](_0x59ff7a[_0xe57bcf(0x226)]))),0x1;if(_0x59ff7a[_0xe57bcf(0x206)]===_0xe57bcf(0x23a))return console[_0xe57bcf(0x1ea)](a39_0x320717[_0xe57bcf(0x214)](_0xe57bcf(0x234)+_0x59ff7a[_0xe57bcf(0x1e0)]+'\x0a')),console[_0xe57bcf(0x1ea)](a39_0x320717['cyan'](_0xe57bcf(0x207))),0x1;const _0x4c47ff=_0x59ff7a[_0xe57bcf(0x1d0)],_0x46313f=_0x59ff7a[_0xe57bcf(0x1e0)],_0x268dc2=_0x59ff7a['type']===_0xe57bcf(0x202)?_0x59ff7a['filePath']:undefined,_0x310d9a=getScopedDetails(_0x59ff7a),_0x3bf1e7=_0x310d9a?.[_0xe57bcf(0x200)]??![],_0x2af325=_0x310d9a?.[_0xe57bcf(0x20c)]??'';if(!existsSync(_0x46313f))return console[_0xe57bcf(0x1ea)](a39_0x320717[_0xe57bcf(0x214)](_0xe57bcf(0x234)+_0x46313f+'\x0a')),console[_0xe57bcf(0x1ea)](a39_0x320717[_0xe57bcf(0x1d8)](_0xe57bcf(0x207))),0x1;_0x565639[_0xe57bcf(0x1e1)]&&(console[_0xe57bcf(0x1ea)](_0xe57bcf(0x1ce)+_0x565639['site']),console[_0xe57bcf(0x1ea)](_0xe57bcf(0x1b0)+_0x4c47ff),console[_0xe57bcf(0x1ea)]('Source\x20directory:\x20'+_0x46313f),_0x3bf1e7&&console[_0xe57bcf(0x1ea)](_0xe57bcf(0x1b4)+_0x2af325));const _0x3fdcd7=await withSpinner(_0xe57bcf(0x1ac)+_0x4c47ff+_0xe57bcf(0x1bf),()=>_0x46419[_0xe57bcf(0x1be)][_0xe57bcf(0x238)](_0x4c47ff),{'verbose':_0x565639['verbose']}),_0x45d092=_0x3fdcd7[_0xe57bcf(0x213)],{parentSegmentResult:_0x73cc84,segmentsResult:_0x443d07,foldersResult:_0x21cab3,journeysWithDetailsResult:_0x366ba0,userMaps:_0x3fd701}=await withSpinner(_0xe57bcf(0x21f),async()=>{const _0x312a2d=_0xe57bcf,[_0x41af3e,_0x435b4d,_0x9205a9,_0x19ea9f,_0x3fc8f3]=await Promise[_0x312a2d(0x224)]([_0x46419[_0x312a2d(0x1be)]['getParent'](_0x45d092),_0x46419[_0x312a2d(0x1be)][_0x312a2d(0x229)](_0x45d092),_0x46419[_0x312a2d(0x1be)]['listFolders'](_0x45d092),_0x46419[_0x312a2d(0x1b3)][_0x312a2d(0x22e)](_0x45d092,{'includeAllVersions':!![]}),_0x46419[_0x312a2d(0x1ef)][_0x312a2d(0x1f2)]()]);return{'parentSegmentResult':_0x41af3e,'segmentsResult':_0x435b4d,'foldersResult':_0x9205a9,'journeysWithDetailsResult':_0x19ea9f,'userMaps':_0x3fc8f3};},{'verbose':_0x565639[_0xe57bcf(0x1e1)]})['then'](_0xe3df22=>_0xe3df22[_0xe57bcf(0x213)]),_0x2de7f2=_0x73cc84,_0x1a7416=extractRootFolderId(_0x2de7f2),_0x3e79e8=_0x443d07,_0x5c896b=_0x21cab3,{journeys:_0x42a06f,activationStepsById:_0x3887f2}=_0x366ba0,_0x2e240f=new Map(_0x42a06f['map'](_0x5086e5=>[_0x5086e5['id'],_0x5086e5])),_0x2e4f42=_0x42a06f[_0xe57bcf(0x22a)](_0x29046d=>({'id':_0x29046d['id'],'name':_0x29046d[_0xe57bcf(0x1aa)]['name'],'journeyBundleName':_0x29046d[_0xe57bcf(0x1aa)][_0xe57bcf(0x1e5)]||'','journeyBundleId':_0x29046d[_0xe57bcf(0x1aa)][_0xe57bcf(0x227)]||'','versionNumber':_0x29046d[_0xe57bcf(0x1aa)][_0xe57bcf(0x211)],'description':_0x29046d['attributes'][_0xe57bcf(0x22f)],'state':_0x29046d[_0xe57bcf(0x1aa)][_0xe57bcf(0x1f1)],'paused':_0x29046d['attributes'][_0xe57bcf(0x1a3)],'audienceId':_0x29046d['attributes'][_0xe57bcf(0x22c)],'folderId':_0x29046d[_0xe57bcf(0x1c4)]?.['parentFolder']?.[_0xe57bcf(0x213)]?.['id'],'createdAt':_0x29046d[_0xe57bcf(0x1aa)][_0xe57bcf(0x1f4)],'updatedAt':_0x29046d[_0xe57bcf(0x1aa)][_0xe57bcf(0x1a6)]})),{emailToId:_0x104eb4,idToEmail:_0x5a9b61}=_0x3fd701,_0xa9a82f=await withSpinner(_0xe57bcf(0x1d2),async()=>{const _0x38af27=_0xe57bcf,_0x4af08c=await _0x46419[_0x38af27(0x1dc)][_0x38af27(0x21a)]();return buildConnectionMaps(_0x4af08c);},{'verbose':_0x565639[_0xe57bcf(0x1e1)]})[_0xe57bcf(0x1a5)](_0x37ab40=>_0x37ab40[_0xe57bcf(0x213)]),_0x4e3582=_0xa9a82f['nameToId'],_0x818ea6=_0xa9a82f[_0xe57bcf(0x216)],_0x5d85a5=_0xa9a82f[_0xe57bcf(0x1de)],_0x33affa={'emailToIdMap':_0x104eb4,'connectionNameToIdMap':_0x4e3582,'connectionNameToTypeMap':_0x5d85a5,'getSchema':_0x230650=>_0x46419[_0xe57bcf(0x1dc)][_0xe57bcf(0x1fe)](_0x230650)};let {pathToId:_0x5e96ef,idToPath:_0x5ac8d8}=buildFolderMaps(_0x5c896b);const _0xea3b79=buildSegmentLookupMap(_0x3e79e8,_0x5ac8d8),_0x1157f7=buildSegmentNameToIdMap(_0x3e79e8),_0x3b887a=buildJourneyBundleLookupMap(_0x2e4f42,_0x5ac8d8);let _0x5e7bca;if(_0x268dc2){if(!_0x268dc2[_0xe57bcf(0x209)](_0xe57bcf(0x1b9))&&!_0x268dc2[_0xe57bcf(0x209)](_0xe57bcf(0x19d)))return console[_0xe57bcf(0x1ea)](a39_0x320717[_0xe57bcf(0x214)](_0xe57bcf(0x1ca)+_0x268dc2+'\x0a')),0x1;_0x5e7bca=[_0x268dc2];}else _0x5e7bca=findYamlFiles(_0x46313f);if(_0x5e7bca[_0xe57bcf(0x1fb)]===0x0)return console[_0xe57bcf(0x1ea)](a39_0x320717['red'](_0xe57bcf(0x1d1)+_0x46313f+'\x0a')),console[_0xe57bcf(0x1ea)](a39_0x320717[_0xe57bcf(0x1d8)]('Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files')),0x1;let _0x41c3f2,_0x16fffe;try{const _0x243eb7=parseAndClassifyYamlFiles(_0x5e7bca,_0x46313f,{'skipSegments':_0x565639[_0xe57bcf(0x1f6)]});_0x41c3f2=_0x243eb7[_0xe57bcf(0x1bc)],_0x16fffe=_0x243eb7[_0xe57bcf(0x1d3)];const _0x20c9ef=validateParsedFiles(_0x243eb7,_0x46313f);if(_0x20c9ef[_0xe57bcf(0x1fb)]>0x0)return console[_0xe57bcf(0x1ea)](a39_0x320717['red'](_0xe57bcf(0x19c))),console[_0xe57bcf(0x1ea)](formatValidationErrors(_0x20c9ef)),console[_0xe57bcf(0x1ea)](a39_0x320717[_0xe57bcf(0x1a0)](_0xe57bcf(0x1db))),0x1;}catch(_0x4c81b6){return console[_0xe57bcf(0x1ea)](a39_0x320717[_0xe57bcf(0x214)](_0xe57bcf(0x1af)+(_0x4c81b6 instanceof Error?_0x4c81b6[_0xe57bcf(0x212)]:_0x4c81b6))),0x1;}if(_0x41c3f2[_0xe57bcf(0x1fb)]===0x0&&_0x16fffe[_0xe57bcf(0x1fb)]===0x0){const _0x5f241b=_0x565639[_0xe57bcf(0x1f6)]?'journey':_0xe57bcf(0x1b7);return console['error'](a39_0x320717[_0xe57bcf(0x1a0)]('No\x20'+_0x5f241b+_0xe57bcf(0x1e6))),0x0;}const _0x9a66d2=new Map();_0x3e79e8[_0xe57bcf(0x1fb)]>0x0&&!_0x565639[_0xe57bcf(0x1f6)]&&await withSpinner(_0xe57bcf(0x1f5),async()=>{await batchAsync(_0x3e79e8,async _0x231104=>{const _0x51dd39=a39_0xcbab,_0x3d7e7d=await _0x46419['segment'][_0x51dd39(0x1e2)](_0x45d092,_0x231104['id']);_0x9a66d2['set'](_0x231104['id'],_0x3d7e7d);});},{'verbose':_0x565639[_0xe57bcf(0x1e1)]});const {segmentFiles:_0x10b2e0,foldersToCreate:_0x57defc}=await prepareSegmentFiles(_0x41c3f2,{'segmentByFolderAndName':_0xea3b79,'activationsBySegmentId':_0x9a66d2,'folderPathToId':_0x5e96ef,'idToEmailMap':_0x5a9b61,'connectionIdToNameMap':_0x818ea6},_0x33affa,_0x3bf1e7,_0x2af325),_0x30f092=_0x268dc2?[]:findSegmentsToDelete(_0x3e79e8,_0x41c3f2[_0xe57bcf(0x22a)](({yamlConfig:_0x218c32,folderPath:_0x5e04bf})=>({'yamlConfig':_0x218c32,'folderPath':resolveTDFolderPath(_0x5e04bf,_0x3bf1e7,_0x2af325)})),_0x5ac8d8,_0x2af325,_0x3bf1e7),{journeyFiles:_0x41e325,foldersToCreate:_0x1b3994}=await withProgressSpinner(_0xe57bcf(0x230),async _0x4bdfbf=>prepareJourneyFiles(_0x16fffe,{'fetchJourney':async _0x3696eb=>_0x46419[_0xe57bcf(0x1b3)][_0xe57bcf(0x210)](_0x3696eb[_0xe57bcf(0x20e)]),'journeyBundlesByFolderAndName':_0x3b887a,'folderPathToId':_0x5e96ef,'idToEmailMap':_0x5a9b61,'connectionIdToNameMap':_0x818ea6,'existingSegments':_0x3e79e8,'parentId':_0x45d092,'deps':_0x46419,'progress':{'update':_0x13950b=>{const _0x6c338d=_0xe57bcf;_0x4bdfbf[_0x6c338d(0x21e)](_0x13950b),_0x565639[_0x6c338d(0x1e1)]&&console[_0x6c338d(0x1ea)]('\x20\x20'+_0x13950b);}},'journeyById':_0x2e240f,'activationStepsById':_0x3887f2},_0x3bf1e7,_0x2af325),{'verbose':_0x565639[_0xe57bcf(0x1e1)]})[_0xe57bcf(0x1a5)](_0x300ba1=>_0x300ba1[_0xe57bcf(0x213)]);for(const _0x4b0af7 of _0x1b3994){_0x57defc['add'](_0x4b0af7);}const _0x3d3fa1=_0x268dc2?[]:findJourneysToDelete(_0x2e4f42,_0x16fffe[_0xe57bcf(0x22a)](({yamlConfig:_0x5984f2,folderPath:_0x38ac33})=>({'yamlConfig':_0x5984f2,'folderPath':resolveTDFolderPath(_0x38ac33,_0x3bf1e7,_0x2af325)})),_0x5ac8d8,_0x2af325,_0x3bf1e7),_0xfd06fd=calculatePushStats(_0x10b2e0,_0x41e325,_0x57defc,_0x30f092,_0x3d3fa1,!!_0x565639[_0xe57bcf(0x19e)],!!_0x565639[_0xe57bcf(0x1f6)]),_0x292cbe=_0xfd06fd['segments'][_0xe57bcf(0x1dd)],_0x5ebd28=_0xfd06fd[_0xe57bcf(0x1bc)][_0xe57bcf(0x205)],_0x58fc29=_0xfd06fd[_0xe57bcf(0x1bc)]['unchanged'],_0xf94c0b=_0xfd06fd[_0xe57bcf(0x1bc)][_0xe57bcf(0x1a8)],_0x25d0f2=_0xfd06fd[_0xe57bcf(0x221)][_0xe57bcf(0x201)],_0x250d7b=_0xfd06fd[_0xe57bcf(0x1d3)][_0xe57bcf(0x1dd)],_0x3e15d3=_0xfd06fd[_0xe57bcf(0x1d3)]['changed'],_0x550c81=_0xfd06fd[_0xe57bcf(0x1d3)]['unchanged'],_0x18b3bc=_0xfd06fd[_0xe57bcf(0x1d3)][_0xe57bcf(0x1a8)],_0x58a7ec=_0xfd06fd[_0xe57bcf(0x228)][_0xe57bcf(0x224)],_0x554f41=_0xfd06fd['activations']['toCreate'],_0x4fca37=_0xfd06fd[_0xe57bcf(0x228)][_0xe57bcf(0x20f)],_0x57c0ba=_0xfd06fd[_0xe57bcf(0x228)][_0xe57bcf(0x1a8)];console[_0xe57bcf(0x1ea)](_0xe57bcf(0x225)+_0x4c47ff+'\x27:');_0x25d0f2['length']>0x0&&console['error']('\x20\x20'+a39_0x320717[_0xe57bcf(0x1ec)](_0xe57bcf(0x19f)+_0x25d0f2[_0xe57bcf(0x1fb)]+_0xe57bcf(0x1c1)));if(!_0x565639[_0xe57bcf(0x1f6)]){console[_0xe57bcf(0x1ea)](_0xe57bcf(0x220)),console[_0xe57bcf(0x1ea)](_0xe57bcf(0x20d)+a39_0x320717[_0xe57bcf(0x1da)]('+\x20'+_0x292cbe['length']+_0xe57bcf(0x22d))),console['error'](_0xe57bcf(0x20d)+a39_0x320717[_0xe57bcf(0x1a0)]('~\x20'+_0x5ebd28['length']+'\x20changed'));if(_0xf94c0b['length']>0x0)console[_0xe57bcf(0x1ea)](_0xe57bcf(0x20d)+a39_0x320717[_0xe57bcf(0x214)]('-\x20'+_0xf94c0b[_0xe57bcf(0x1fb)]+'\x20to\x20delete'));else _0x30f092[_0xe57bcf(0x1fb)]>0x0&&!_0x565639['delete']&&console[_0xe57bcf(0x1ea)]('\x20\x20\x20\x20'+a39_0x320717[_0xe57bcf(0x1a4)](_0x30f092[_0xe57bcf(0x1fb)]+'\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)'));console[_0xe57bcf(0x1ea)](_0xe57bcf(0x20d)+a39_0x320717['dim']('=\x20'+_0x58fc29[_0xe57bcf(0x1fb)]+_0xe57bcf(0x218)));}if(_0x41e325['length']>0x0||_0x3d3fa1[_0xe57bcf(0x1fb)]>0x0){console[_0xe57bcf(0x1ea)](_0xe57bcf(0x1b5)),console[_0xe57bcf(0x1ea)](_0xe57bcf(0x20d)+a39_0x320717['green']('+\x20'+_0x250d7b[_0xe57bcf(0x1fb)]+_0xe57bcf(0x22d))),console[_0xe57bcf(0x1ea)](_0xe57bcf(0x20d)+a39_0x320717[_0xe57bcf(0x1a0)]('~\x20'+_0x3e15d3[_0xe57bcf(0x1fb)]+_0xe57bcf(0x1bd)));if(_0x18b3bc[_0xe57bcf(0x1fb)]>0x0)console['error'](_0xe57bcf(0x20d)+a39_0x320717[_0xe57bcf(0x214)]('-\x20'+_0x18b3bc[_0xe57bcf(0x1fb)]+'\x20to\x20delete'));else _0x3d3fa1['length']>0x0&&!_0x565639[_0xe57bcf(0x19e)]&&console[_0xe57bcf(0x1ea)](_0xe57bcf(0x20d)+a39_0x320717[_0xe57bcf(0x1a4)](_0x3d3fa1[_0xe57bcf(0x1fb)]+_0xe57bcf(0x1a1)));console[_0xe57bcf(0x1ea)](_0xe57bcf(0x20d)+a39_0x320717[_0xe57bcf(0x1a4)]('=\x20'+_0x550c81['length']+_0xe57bcf(0x218)));}_0x58a7ec['length']>0x0&&!_0x565639['journeysOnly']&&(console[_0xe57bcf(0x1ea)](''),console['error']('\x20\x20Activations:'),_0x554f41[_0xe57bcf(0x1fb)]>0x0&&console[_0xe57bcf(0x1ea)](_0xe57bcf(0x20d)+a39_0x320717[_0xe57bcf(0x1da)]('+\x20'+_0x554f41['length']+'\x20to\x20create')),_0x4fca37['length']>0x0&&console['error'](_0xe57bcf(0x20d)+a39_0x320717['yellow']('~\x20'+_0x4fca37[_0xe57bcf(0x1fb)]+_0xe57bcf(0x1c6))),_0x57c0ba['length']>0x0&&console[_0xe57bcf(0x1ea)]('\x20\x20\x20\x20'+a39_0x320717[_0xe57bcf(0x214)]('-\x20'+_0x57c0ba[_0xe57bcf(0x1fb)]+_0xe57bcf(0x1fa))));console['error'](_0xe57bcf(0x217)+a39_0x320717[_0xe57bcf(0x1d8)](_0x46313f)+'\x0a');if(_0x25d0f2[_0xe57bcf(0x1fb)]>0x0){console[_0xe57bcf(0x1ea)]('Folders\x20to\x20create:');for(const _0x11c217 of _0x25d0f2){console[_0xe57bcf(0x1ea)]('\x20\x20'+a39_0x320717[_0xe57bcf(0x1ec)]('+')+'\x20'+_0x11c217);}console[_0xe57bcf(0x1ea)]('');}if(_0x292cbe['length']>0x0&&!_0x565639[_0xe57bcf(0x1f6)])for(const _0x38578e of _0x292cbe){const _0x403589=_0x38578e[_0xe57bcf(0x1f7)]?_0x38578e[_0xe57bcf(0x1f7)]+'/'+_0x38578e[_0xe57bcf(0x22b)][_0xe57bcf(0x223)]:_0x38578e[_0xe57bcf(0x22b)]['name'],_0x5afa43=_0x38578e[_0xe57bcf(0x22b)][_0xe57bcf(0x228)]?.['length']||0x0,_0x22c922=_0x5afa43>0x0?a39_0x320717['dim']('\x20['+_0x5afa43+_0xe57bcf(0x21b)):'';console[_0xe57bcf(0x1ea)]('\x0a'+a39_0x320717[_0xe57bcf(0x1da)](_0xe57bcf(0x1b6))+'\x20'+_0x403589+_0x22c922),console[_0xe57bcf(0x1ea)]('─'[_0xe57bcf(0x1b2)](0x3c)),_0x38578e[_0xe57bcf(0x1d4)]&&console['error'](_0x38578e[_0xe57bcf(0x1d4)]),console['error']('─'[_0xe57bcf(0x1b2)](0x3c));}if(_0xf94c0b['length']>0x0&&!_0x565639[_0xe57bcf(0x1f6)])for(const _0x2b036e of _0xf94c0b){const _0x9436e6=_0x2b036e['segmentFolderId']?_0x5ac8d8['get'](_0x2b036e[_0xe57bcf(0x1bb)]['toString']())||'':'',_0x2e5d12=_0x9436e6?_0x9436e6+'/'+_0x2b036e[_0xe57bcf(0x223)]:_0x2b036e[_0xe57bcf(0x223)],_0x1cec9a=_0x9a66d2[_0xe57bcf(0x1a7)](_0x2b036e['id'])||[],_0x120618=_0x1cec9a['length']>0x0?a39_0x320717[_0xe57bcf(0x1a4)]('\x20['+_0x1cec9a['length']+_0xe57bcf(0x21b)):'';console[_0xe57bcf(0x1ea)]('\x0a'+a39_0x320717[_0xe57bcf(0x214)](_0xe57bcf(0x215))+'\x20'+_0x2e5d12+_0x120618),console['error']('─'[_0xe57bcf(0x1b2)](0x3c));const _0x20ad6a=segmentWithActivationsToYaml(_0x2b036e,_0x1cec9a,undefined,_0x5a9b61,_0x818ea6),_0x34ee9d=segmentToYamlString(_0x20ad6a),_0x24b763=generateDiff(_0x34ee9d,'');console[_0xe57bcf(0x1ea)](formatDiffWithColors(_0x24b763)),console[_0xe57bcf(0x1ea)]('─'[_0xe57bcf(0x1b2)](0x3c));}const _0x2acfcb=_0x10b2e0['filter'](_0x5d0879=>!_0x5d0879[_0xe57bcf(0x1f9)]&&_0x5d0879['diff']);if(_0x2acfcb[_0xe57bcf(0x1fb)]>0x0&&!_0x565639[_0xe57bcf(0x1f6)])for(const _0x444c85 of _0x2acfcb){const _0x16a1e7=_0x444c85[_0xe57bcf(0x1f7)]?_0x444c85[_0xe57bcf(0x1f7)]+'/'+_0x444c85[_0xe57bcf(0x22b)]['name']:_0x444c85[_0xe57bcf(0x22b)][_0xe57bcf(0x223)];console['error']('\x0a'+a39_0x320717['yellow'](_0xe57bcf(0x1e3))+'\x20'+_0x16a1e7),console['error']('─'[_0xe57bcf(0x1b2)](0x3c)),console[_0xe57bcf(0x1ea)](_0x444c85[_0xe57bcf(0x1d4)]),console[_0xe57bcf(0x1ea)]('─'[_0xe57bcf(0x1b2)](0x3c));}if(_0x250d7b[_0xe57bcf(0x1fb)]>0x0)for(const _0x5281d1 of _0x250d7b){const _0x2c56cc=_0x5281d1[_0xe57bcf(0x1f7)]?_0x5281d1[_0xe57bcf(0x1f7)]+'/'+_0x5281d1[_0xe57bcf(0x22b)][_0xe57bcf(0x223)]:_0x5281d1['yamlConfig'][_0xe57bcf(0x223)];console[_0xe57bcf(0x1ea)]('\x0a'+a39_0x320717['green'](_0xe57bcf(0x23b))+'\x20'+_0x2c56cc),console['error']('─'[_0xe57bcf(0x1b2)](0x3c)),_0x5281d1['diff']&&console[_0xe57bcf(0x1ea)](_0x5281d1['diff']),console[_0xe57bcf(0x1ea)]('─'[_0xe57bcf(0x1b2)](0x3c));}const _0x2e8188=_0x41e325['filter'](_0x1291dc=>!_0x1291dc['isNew']&&_0x1291dc[_0xe57bcf(0x1d4)]);if(_0x2e8188[_0xe57bcf(0x1fb)]>0x0)for(const _0x15dea2 of _0x2e8188){const _0x24bc4a=_0x15dea2[_0xe57bcf(0x1f7)]?_0x15dea2[_0xe57bcf(0x1f7)]+'/'+_0x15dea2[_0xe57bcf(0x22b)][_0xe57bcf(0x223)]:_0x15dea2[_0xe57bcf(0x22b)][_0xe57bcf(0x223)];console[_0xe57bcf(0x1ea)]('\x0a'+a39_0x320717[_0xe57bcf(0x1a0)](_0xe57bcf(0x1fd))+'\x20'+_0x24bc4a),console[_0xe57bcf(0x1ea)]('─'[_0xe57bcf(0x1b2)](0x3c)),console[_0xe57bcf(0x1ea)](_0x15dea2[_0xe57bcf(0x1d4)]),console[_0xe57bcf(0x1ea)]('─'['repeat'](0x3c));}if(_0x18b3bc[_0xe57bcf(0x1fb)]>0x0)for(const _0x106b7b of _0x18b3bc){const _0x388095=_0x106b7b[_0xe57bcf(0x1ae)]?_0x5ac8d8[_0xe57bcf(0x1a7)](_0x106b7b[_0xe57bcf(0x1ae)])||'':'',_0x3d1f00=_0x388095?_0x388095+'/'+_0x106b7b[_0xe57bcf(0x1e5)]:_0x106b7b[_0xe57bcf(0x1e5)];console[_0xe57bcf(0x1ea)]('\x0a'+a39_0x320717[_0xe57bcf(0x214)](_0xe57bcf(0x1ad))+'\x20'+_0x3d1f00),console[_0xe57bcf(0x1ea)]('─'['repeat'](0x3c)),console[_0xe57bcf(0x1ea)](a39_0x320717[_0xe57bcf(0x214)](_0xe57bcf(0x1b1))),console[_0xe57bcf(0x1ea)]('─'[_0xe57bcf(0x1b2)](0x3c));}if(_0x565639[_0xe57bcf(0x1cb)])return console[_0xe57bcf(0x1ea)](a39_0x320717[_0xe57bcf(0x1a0)](_0xe57bcf(0x222))),0x0;const _0x2a1de3=_0x565639[_0xe57bcf(0x1f6)]?![]:_0x292cbe[_0xe57bcf(0x1fb)]>0x0||_0x5ebd28[_0xe57bcf(0x1fb)]>0x0||_0xf94c0b[_0xe57bcf(0x1fb)]>0x0,_0x340381=_0x250d7b[_0xe57bcf(0x1fb)]>0x0||_0x3e15d3[_0xe57bcf(0x1fb)]>0x0||_0x18b3bc[_0xe57bcf(0x1fb)]>0x0,_0xad1e67=_0x565639[_0xe57bcf(0x1f6)]?![]:_0x58a7ec[_0xe57bcf(0x1fb)]>0x0,_0x2419c9=_0x25d0f2['length']>0x0;if(!_0x2a1de3&&!_0x340381&&!_0xad1e67&&!_0x2419c9){const _0x33d990=_0x565639[_0xe57bcf(0x1f6)]?_0xe57bcf(0x1a2):'✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date';console[_0xe57bcf(0x1ea)](a39_0x320717[_0xe57bcf(0x1da)](_0x33d990));if(_0x268dc2&&_0x58fc29['length']===0x1){const _0x4f4319=_0x58fc29[0x0];if(_0x4f4319[_0xe57bcf(0x1cc)]?.['id']){const _0x26203e=getConsoleNextUrl(_0x565639[_0xe57bcf(0x1eb)],_0xe57bcf(0x1ed)+_0x45d092+_0xe57bcf(0x1c3)+_0x4f4319[_0xe57bcf(0x1cc)]['id']+_0xe57bcf(0x231));console[_0xe57bcf(0x1ea)](_0xe57bcf(0x1ab)+a39_0x320717[_0xe57bcf(0x1d8)](_0x26203e));}}if(_0x268dc2&&_0x550c81[_0xe57bcf(0x1fb)]===0x1){const _0x36dca7=_0x550c81[0x0];if(_0x36dca7[_0xe57bcf(0x219)]?.['id']){const _0x3aa730=getConsoleNextUrl(_0x565639[_0xe57bcf(0x1eb)],'/app/ps/'+_0x45d092+_0xe57bcf(0x1c3)+_0x36dca7[_0xe57bcf(0x219)]['id']+'/j/da/je');console[_0xe57bcf(0x1ea)]('\x20\x20'+a39_0x320717[_0xe57bcf(0x1d8)](_0x3aa730));}}return 0x0;}const _0x645e2e=_0x565639[_0xe57bcf(0x1f6)]?_0x250d7b[_0xe57bcf(0x1fb)]+_0x3e15d3[_0xe57bcf(0x1fb)]+_0x18b3bc[_0xe57bcf(0x1fb)]+_0x25d0f2[_0xe57bcf(0x1fb)]:_0x292cbe[_0xe57bcf(0x1fb)]+_0x5ebd28[_0xe57bcf(0x1fb)]+_0xf94c0b[_0xe57bcf(0x1fb)]+_0x250d7b[_0xe57bcf(0x1fb)]+_0x3e15d3[_0xe57bcf(0x1fb)]+_0x18b3bc['length']+_0x25d0f2[_0xe57bcf(0x1fb)]+_0x58a7ec[_0xe57bcf(0x1fb)];if(!_0x565639[_0xe57bcf(0x1d7)]&&_0x645e2e>0x0){if(!isInteractive())return console[_0xe57bcf(0x1ea)](a39_0x320717[_0xe57bcf(0x214)]('\x0aError:'),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0xe57bcf(0x1ea)](a39_0x320717[_0xe57bcf(0x1a4)](_0xe57bcf(0x208))),0x1;const _0x26298d=await confirmKey(_0xe57bcf(0x236)+_0x645e2e+_0xe57bcf(0x1cd));if(!_0x26298d)return console[_0xe57bcf(0x1ea)](a39_0x320717[_0xe57bcf(0x1a0)]('Aborted.')),0x1;}const _0x4b75fe={'withProgress':async(_0x31a580,_0x1eeb10)=>{const _0x314942=_0xe57bcf,_0x1bb4bb=await withSpinner(_0x31a580,_0x1eeb10,{'verbose':_0x565639['verbose']});return{'data':_0x1bb4bb[_0x314942(0x213)]};},'logInfo':_0x5d28c3=>console[_0xe57bcf(0x1ea)](a39_0x320717[_0xe57bcf(0x1ec)]('✔\x20'+_0x5d28c3)),'logSuccess':_0x48b87b=>console[_0xe57bcf(0x1ea)](a39_0x320717['green']('✔\x20'+_0x48b87b)),'logWarning':_0x169020=>console[_0xe57bcf(0x1ea)](a39_0x320717['yellow']('⚠\x20'+_0x169020)),'logDeleted':_0x113156=>console['error'](a39_0x320717[_0xe57bcf(0x214)]('✔\x20'+_0x113156))},_0x2468f9={'segment':_0x46419['segment'],'journey':_0x46419[_0xe57bcf(0x1b3)],'user':_0x46419[_0xe57bcf(0x1ef)],'connection':_0x46419[_0xe57bcf(0x1dc)]};_0x25d0f2[_0xe57bcf(0x1fb)]>0x0&&(_0x5e96ef=await executePushFolders(_0x2468f9,_0x25d0f2,_0x5e96ef,{'parentId':_0x45d092},_0x4b75fe));const _0x4a63eb={'rootFolderId':_0x1a7416,'folderPathToId':_0x5e96ef,'folderIdToPath':_0x5ac8d8,'segmentNameToId':_0x1157f7,'activationsBySegmentId':_0x9a66d2,'emailToIdMap':_0x104eb4,'idToEmailMap':_0x5a9b61,'connectionNameToIdMap':_0xa9a82f[_0xe57bcf(0x1fc)],'connectionIdToNameMap':_0xa9a82f[_0xe57bcf(0x216)],'connectionNameToTypeMap':_0x5d85a5},_0x2a1e9d=await executePushSegments(_0x2468f9,_0x565639[_0xe57bcf(0x1f6)]?[]:_0x10b2e0,_0x4a63eb,{'parentId':_0x45d092},_0x4b75fe),_0x3ff1f1=_0x2a1e9d[_0xe57bcf(0x1ff)],_0x314e91=_0x2a1e9d[_0xe57bcf(0x20b)],_0x58cc3c=_0x2a1e9d[_0xe57bcf(0x228)][_0xe57bcf(0x1ff)],_0xba49fe=_0x2a1e9d['activations']['updated'],_0x205433=_0x2a1e9d[_0xe57bcf(0x228)][_0xe57bcf(0x21c)];let _0x5a1adf;if(_0x268dc2&&_0x10b2e0[_0xe57bcf(0x1fb)]===0x1){const _0x5d4f0d=_0x10b2e0[0x0];_0x5a1adf=_0x5d4f0d[_0xe57bcf(0x1cc)]?.['id']??_0x2a1e9d[_0xe57bcf(0x232)]['get'](_0x5d4f0d['yamlConfig'][_0xe57bcf(0x223)]);}const _0x15ea72=await executePushSegmentDeletions(_0x2468f9,_0x565639[_0xe57bcf(0x1f6)]?[]:_0xf94c0b,_0x4b75fe);let _0x40e9cd=0x0,_0xf54358=0x0,_0x24cc24=0x0;const _0x224435=new Map(_0x1157f7);for(const [_0x4e6a46,_0x1429be]of _0x2a1e9d['createdSegmentIds']){_0x224435[_0xe57bcf(0x21d)](_0x4e6a46,_0x1429be);}if(_0x41e325['length']>0x0){const _0x1e143f={..._0x4a63eb,'segmentNameToId':_0x224435,'existingSegments':_0x3e79e8,'activationContext':_0x33affa},_0x37b452=await executePushJourneys(_0x2468f9,_0x41e325,_0x1e143f,{'parentId':_0x45d092,'rootFolderId':_0x1a7416,'verbose':_0x565639[_0xe57bcf(0x1e1)]},_0x4b75fe);_0x40e9cd=_0x37b452[_0xe57bcf(0x1ff)],_0xf54358=_0x37b452[_0xe57bcf(0x20b)];if(_0x268dc2&&_0x37b452[_0xe57bcf(0x1c2)][_0xe57bcf(0x1fb)]===0x1){const _0x4b8bd8=_0x37b452[_0xe57bcf(0x1c2)][0x0];if(_0x4b8bd8['journeyId']){const _0x135770=getConsoleNextUrl(_0x565639[_0xe57bcf(0x1eb)],_0xe57bcf(0x1ed)+_0x45d092+_0xe57bcf(0x1c3)+_0x4b8bd8[_0xe57bcf(0x20e)]+_0xe57bcf(0x233));console[_0xe57bcf(0x1ea)]('\x20\x20'+a39_0x320717[_0xe57bcf(0x1d8)](_0x135770));}}}for(const _0x548baa of _0x18b3bc){console['error'](a39_0x320717[_0xe57bcf(0x1a0)](_0xe57bcf(0x1c8)+_0x548baa[_0xe57bcf(0x1e5)])),_0x24cc24++;}const _0x4f6adc=[];if(_0x3ff1f1>0x0)_0x4f6adc[_0xe57bcf(0x1a9)](_0x3ff1f1+_0xe57bcf(0x1f3));if(_0x314e91>0x0)_0x4f6adc[_0xe57bcf(0x1a9)](_0x314e91+'\x20updated');if(_0x15ea72>0x0)_0x4f6adc[_0xe57bcf(0x1a9)](_0x15ea72+_0xe57bcf(0x20a));const _0x35e08e=[];if(_0x40e9cd>0x0)_0x35e08e[_0xe57bcf(0x1a9)](_0x40e9cd+'\x20created');if(_0xf54358>0x0)_0x35e08e[_0xe57bcf(0x1a9)](_0xf54358+_0xe57bcf(0x1e7));if(_0x24cc24>0x0)_0x35e08e[_0xe57bcf(0x1a9)](_0x24cc24+'\x20deleted');const _0x43769f=[];if(_0x58cc3c>0x0)_0x43769f[_0xe57bcf(0x1a9)](_0x58cc3c+_0xe57bcf(0x1f3));if(_0xba49fe>0x0)_0x43769f[_0xe57bcf(0x1a9)](_0xba49fe+_0xe57bcf(0x1e7));if(_0x205433>0x0)_0x43769f['push'](_0x205433+'\x20deleted');console[_0xe57bcf(0x1ea)](a39_0x320717[_0xe57bcf(0x1da)](_0xe57bcf(0x1f0)));_0x4f6adc[_0xe57bcf(0x1fb)]>0x0&&!_0x565639[_0xe57bcf(0x1f6)]&&console[_0xe57bcf(0x1ea)](_0xe57bcf(0x204)+_0x4f6adc['join'](',\x20'));_0x35e08e[_0xe57bcf(0x1fb)]>0x0&&console['error']('\x20\x20Journeys:\x20'+_0x35e08e[_0xe57bcf(0x1e8)](',\x20'));_0x43769f[_0xe57bcf(0x1fb)]>0x0&&!_0x565639[_0xe57bcf(0x1f6)]&&console['error'](_0xe57bcf(0x23c)+_0x43769f[_0xe57bcf(0x1e8)](',\x20'));if(_0x5a1adf){const _0x5ac147=getConsoleNextUrl(_0x565639[_0xe57bcf(0x1eb)],_0xe57bcf(0x1ed)+_0x45d092+_0xe57bcf(0x1c3)+_0x5a1adf+_0xe57bcf(0x231));console[_0xe57bcf(0x1ea)](_0xe57bcf(0x1ab)+a39_0x320717['cyan'](_0x5ac147));}return 0x0;}}
1
+ function a40_0x42d2(_0x4b297c,_0x493ad4){_0x4b297c=_0x4b297c-0x7d;const _0x2161b0=a40_0x2161();let _0x42d24b=_0x2161b0[_0x4b297c];return _0x42d24b;}const a40_0x3b2e81=a40_0x42d2;(function(_0x2f185f,_0x7762c2){const _0x37ccfb=a40_0x42d2,_0x634ff4=_0x2f185f();while(!![]){try{const _0x1471b0=-parseInt(_0x37ccfb(0xd3))/0x1*(-parseInt(_0x37ccfb(0xc8))/0x2)+parseInt(_0x37ccfb(0x9e))/0x3*(-parseInt(_0x37ccfb(0xd2))/0x4)+-parseInt(_0x37ccfb(0x10e))/0x5+parseInt(_0x37ccfb(0xb3))/0x6+parseInt(_0x37ccfb(0xe1))/0x7+-parseInt(_0x37ccfb(0x8c))/0x8+parseInt(_0x37ccfb(0x91))/0x9;if(_0x1471b0===_0x7762c2)break;else _0x634ff4['push'](_0x634ff4['shift']());}catch(_0x59dff0){_0x634ff4['push'](_0x634ff4['shift']());}}}(a40_0x2161,0xbe9a3));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_0x7eaf6d 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_0x2161(){const _0x577e23=['repeat','yes','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','\x20new','listSegments','cwd','Resolving\x20parent\x20segment\x20\x27','24uABvPI','unchanged','parentFolder','map','Preparing\x20journeys...','resolveParentId','Fetching\x20existing\x20data...','helpText','\x20\x20Source:\x20','name','4GMbAbq','31134DZkAeu','getJourney','journeyBundleName','segments','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','endsWith','segment:push','Push\x20','listActivations','getOutputSchemaWithCache','\x20\x20Activations:\x20','\x20\x20Journeys:\x20','toCreate','listFolders','10858022YbtuQP','\x20to\x20delete','📁\x20','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','add','join','.yml','Fetching\x20existing\x20activations...','Error:\x20Directory\x20not\x20found:\x20','error','createdSegmentIds','isScoped','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','nameToId','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','/e/','\x20deleted','\x20changed','✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','diff','cyan','versionNumber','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','/j/da/je','No\x20','journeyId','audienceId','folders','verbose','toDelete','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','isNew','existingJourney','journeysOnly','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','targetDir','errorCode','\x20folders\x20to\x20create','Folders\x20to\x20create:','nameToType','/sb/da/esr','connection','delete','type','parentName','5928435aVeQjt','created','\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20','\x20to\x20update','Aborted.','\x0a✔\x20Push\x20complete','\x20\x20\x20\x20','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','toString','Changes\x20to:','paused','\x0aPush\x20summary\x20for\x20\x27','set','attributes','\x20updated','idToName','all','activations','8871272vLRXjd','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file','data','filter','length','8059545pHjriG','site','green','\x20activations]','/app/ps/','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','red','dim','results','folderPath','push','then','Source\x20directory:\x20','347457PFbJhx','journeys','buildUserMaps','blue','relationships','Fetching\x20connections\x20for\x20name\x20resolution...','\x20YAML\x20files\x20found','Delete\x20journey:','existingSegment','scopedFolderPath','updated','\x20created','segmentFolderId','yamlConfig','folderId','\x0aValidation\x20failed:','parentSegment','execute','segment\x20or\x20journey','new','.yaml','2225178qShXmg','filePath','New\x20journey:','journey','dryRun','✔\x20All\x20journeys\x20are\x20up\x20to\x20date','segment','state','yellow','Changes\x20to\x20journey:','description','user','file','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files'];a40_0x2161=function(){return _0x577e23;};return a40_0x2161();}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_0x3b2e81(0xd1)]=a40_0x3b2e81(0xd9);[a40_0x3b2e81(0xbd)]=a40_0x3b2e81(0x103);async[a40_0x3b2e81(0xaf)](_0x4aec34){const _0x46ff65=a40_0x3b2e81,{options:_0x174b49,args:_0x30f4c1,tdx:_0x4efe7b}=_0x4aec34,_0x5b2931=_0x174b49,_0xdfb7c2=await resolveTarget({'arg':_0x30f4c1[0x0],'contextParent':_0x174b49[_0x46ff65(0xae)],'cwd':process[_0x46ff65(0xc6)]()});if(!isSuccessfulResolution(_0xdfb7c2))return _0xdfb7c2[_0x46ff65(0x105)]==='no_parent'?(console[_0x46ff65(0xea)](a40_0x7eaf6d[_0x46ff65(0xbb)](_0x46ff65(0xff))),console[_0x46ff65(0xea)]('Usage:\x20tdx\x20sg\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20(requires\x20context)'),console[_0x46ff65(0xea)](_0x46ff65(0xf7)),console[_0x46ff65(0xea)](_0x46ff65(0x8d))):(console[_0x46ff65(0xea)](a40_0x7eaf6d['red']('Error:\x20'+_0xdfb7c2['message']+'\x0a')),_0xdfb7c2[_0x46ff65(0xcf)]&&console['error'](a40_0x7eaf6d[_0x46ff65(0xf5)](_0xdfb7c2[_0x46ff65(0xcf)]))),0x1;if(_0xdfb7c2[_0x46ff65(0x10c)]==='parent_name')return console[_0x46ff65(0xea)](a40_0x7eaf6d[_0x46ff65(0x97)]('Error:\x20Directory\x20not\x20found:\x20'+_0xdfb7c2[_0x46ff65(0x104)]+'\x0a')),console['error'](a40_0x7eaf6d[_0x46ff65(0xf5)](_0x46ff65(0xe4))),0x1;const _0x2490fc=_0xdfb7c2[_0x46ff65(0x10d)],_0xfce0e=_0xdfb7c2[_0x46ff65(0x104)],_0x28602a=_0xdfb7c2['type']===_0x46ff65(0xbf)?_0xdfb7c2[_0x46ff65(0xb4)]:undefined,_0x3be430=getScopedDetails(_0xdfb7c2),_0x1d0bb9=_0x3be430?.[_0x46ff65(0xec)]??![],_0x48f524=_0x3be430?.[_0x46ff65(0xa7)]??'';if(!existsSync(_0xfce0e))return console[_0x46ff65(0xea)](a40_0x7eaf6d[_0x46ff65(0x97)](_0x46ff65(0xe9)+_0xfce0e+'\x0a')),console[_0x46ff65(0xea)](a40_0x7eaf6d[_0x46ff65(0xf5)](_0x46ff65(0xe4))),0x1;_0x5b2931[_0x46ff65(0xfd)]&&(console[_0x46ff65(0xea)]('Site:\x20'+_0x5b2931[_0x46ff65(0x92)]),console[_0x46ff65(0xea)]('Parent\x20segment:\x20'+_0x2490fc),console[_0x46ff65(0xea)](_0x46ff65(0x9d)+_0xfce0e),_0x1d0bb9&&console['error']('Scoped\x20to\x20folder:\x20'+_0x48f524));const _0x1325b0=await withSpinner(_0x46ff65(0xc7)+_0x2490fc+'\x27...',()=>_0x4efe7b['segment'][_0x46ff65(0xcd)](_0x2490fc),{'verbose':_0x5b2931['verbose']}),_0x211185=_0x1325b0[_0x46ff65(0x8e)],{parentSegmentResult:_0x47b9b9,segmentsResult:_0x1223e7,foldersResult:_0x17322d,journeysWithDetailsResult:_0x4fba05,userMaps:_0xabe7a0}=await withSpinner(_0x46ff65(0xce),async()=>{const _0x3ce3f3=_0x46ff65,[_0x577770,_0x2b9722,_0x450400,_0x100b01,_0x400c00]=await Promise[_0x3ce3f3(0x8a)]([_0x4efe7b[_0x3ce3f3(0xb9)]['getParent'](_0x211185),_0x4efe7b[_0x3ce3f3(0xb9)][_0x3ce3f3(0xc5)](_0x211185),_0x4efe7b[_0x3ce3f3(0xb9)][_0x3ce3f3(0xe0)](_0x211185),_0x4efe7b['journey']['listJourneysWithDetailsFromParentSegment'](_0x211185,{'includeAllVersions':!![]}),_0x4efe7b[_0x3ce3f3(0xbe)][_0x3ce3f3(0xa0)]()]);return{'parentSegmentResult':_0x577770,'segmentsResult':_0x2b9722,'foldersResult':_0x450400,'journeysWithDetailsResult':_0x100b01,'userMaps':_0x400c00};},{'verbose':_0x5b2931[_0x46ff65(0xfd)]})[_0x46ff65(0x9c)](_0x2f0ef3=>_0x2f0ef3[_0x46ff65(0x8e)]),_0x94097d=_0x47b9b9,_0x2b31bf=extractRootFolderId(_0x94097d),_0xd4ea33=_0x1223e7,_0x5edf6f=_0x17322d,{journeys:_0x573b05,activationStepsById:_0x1e2fce}=_0x4fba05,_0x486cb7=new Map(_0x573b05['map'](_0x1fdc3a=>[_0x1fdc3a['id'],_0x1fdc3a])),_0x25658e=_0x573b05[_0x46ff65(0xcb)](_0x1a07d8=>({'id':_0x1a07d8['id'],'name':_0x1a07d8[_0x46ff65(0x87)][_0x46ff65(0xd1)],'journeyBundleName':_0x1a07d8[_0x46ff65(0x87)][_0x46ff65(0xd5)]||'','journeyBundleId':_0x1a07d8[_0x46ff65(0x87)]['journeyBundleId']||'','versionNumber':_0x1a07d8['attributes'][_0x46ff65(0xf6)],'description':_0x1a07d8['attributes'][_0x46ff65(0xbd)],'state':_0x1a07d8[_0x46ff65(0x87)][_0x46ff65(0xba)],'paused':_0x1a07d8['attributes'][_0x46ff65(0x84)],'audienceId':_0x1a07d8[_0x46ff65(0x87)][_0x46ff65(0xfb)],'folderId':_0x1a07d8[_0x46ff65(0xa2)]?.[_0x46ff65(0xca)]?.[_0x46ff65(0x8e)]?.['id'],'createdAt':_0x1a07d8[_0x46ff65(0x87)]['createdAt'],'updatedAt':_0x1a07d8[_0x46ff65(0x87)]['updatedAt']})),{emailToId:_0x1ba1e6,idToEmail:_0x2a9164}=_0xabe7a0,_0x10d59a=await withSpinner(_0x46ff65(0xa3),async()=>{const _0x45feae=_0x46ff65,_0x1ac61f=await _0x4efe7b[_0x45feae(0x10a)]['list']();return buildConnectionMaps(_0x1ac61f);},{'verbose':_0x5b2931[_0x46ff65(0xfd)]})[_0x46ff65(0x9c)](_0x31db68=>_0x31db68['data']),_0x5ed6be=_0x10d59a[_0x46ff65(0xee)],_0x1c6f28=_0x10d59a[_0x46ff65(0x89)],_0x3f010f=_0x10d59a[_0x46ff65(0x108)],_0x3ccb19={'emailToIdMap':_0x1ba1e6,'connectionNameToIdMap':_0x5ed6be,'connectionNameToTypeMap':_0x3f010f,'getSchema':_0x6e5935=>_0x4efe7b[_0x46ff65(0x10a)][_0x46ff65(0xdc)](_0x6e5935)};let {pathToId:_0x41cd50,idToPath:_0x267c16}=buildFolderMaps(_0x5edf6f);const _0x32b7f2=buildSegmentLookupMap(_0xd4ea33,_0x267c16),_0x1182de=buildSegmentNameToIdMap(_0xd4ea33),_0x39b346=buildJourneyBundleLookupMap(_0x25658e,_0x267c16);let _0xab53ff;if(_0x28602a){if(!_0x28602a['endsWith'](_0x46ff65(0xe7))&&!_0x28602a[_0x46ff65(0xd8)](_0x46ff65(0xb2)))return console[_0x46ff65(0xea)](a40_0x7eaf6d['red']('Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20'+_0x28602a+'\x0a')),0x1;_0xab53ff=[_0x28602a];}else _0xab53ff=findYamlFiles(_0xfce0e);if(_0xab53ff[_0x46ff65(0x90)]===0x0)return console[_0x46ff65(0xea)](a40_0x7eaf6d[_0x46ff65(0x97)](_0x46ff65(0x96)+_0xfce0e+'\x0a')),console[_0x46ff65(0xea)](a40_0x7eaf6d['cyan'](_0x46ff65(0xc0))),0x1;let _0x471228,_0x4a9241;try{const _0x3ab596=parseAndClassifyYamlFiles(_0xab53ff,_0xfce0e,{'skipSegments':_0x5b2931[_0x46ff65(0x102)]});_0x471228=_0x3ab596['segments'],_0x4a9241=_0x3ab596['journeys'];const _0x886d11=validateParsedFiles(_0x3ab596,_0xfce0e);if(_0x886d11[_0x46ff65(0x90)]>0x0)return console[_0x46ff65(0xea)](a40_0x7eaf6d[_0x46ff65(0x97)](_0x46ff65(0xad))),console[_0x46ff65(0xea)](formatValidationErrors(_0x886d11)),console[_0x46ff65(0xea)](a40_0x7eaf6d[_0x46ff65(0xbb)](_0x46ff65(0xef))),0x1;}catch(_0x239dc8){return console[_0x46ff65(0xea)](a40_0x7eaf6d[_0x46ff65(0x97)]('Error\x20parsing\x20YAML:\x20'+(_0x239dc8 instanceof Error?_0x239dc8['message']:_0x239dc8))),0x1;}if(_0x471228['length']===0x0&&_0x4a9241['length']===0x0){const _0x2fbbd4=_0x5b2931[_0x46ff65(0x102)]?_0x46ff65(0xb6):_0x46ff65(0xb0);return console[_0x46ff65(0xea)](a40_0x7eaf6d[_0x46ff65(0xbb)](_0x46ff65(0xf9)+_0x2fbbd4+_0x46ff65(0xa4))),0x0;}const _0x3239b4=new Map();_0xd4ea33[_0x46ff65(0x90)]>0x0&&!_0x5b2931[_0x46ff65(0x102)]&&await withSpinner(_0x46ff65(0xe8),async()=>{await batchAsync(_0xd4ea33,async _0x16d52f=>{const _0x2f96fe=a40_0x42d2,_0x520b0b=await _0x4efe7b[_0x2f96fe(0xb9)][_0x2f96fe(0xdb)](_0x211185,_0x16d52f['id']);_0x3239b4[_0x2f96fe(0x86)](_0x16d52f['id'],_0x520b0b);});},{'verbose':_0x5b2931[_0x46ff65(0xfd)]});const {segmentFiles:_0x4b6312,foldersToCreate:_0x208bd5}=await prepareSegmentFiles(_0x471228,{'segmentByFolderAndName':_0x32b7f2,'activationsBySegmentId':_0x3239b4,'folderPathToId':_0x41cd50,'idToEmailMap':_0x2a9164,'connectionIdToNameMap':_0x1c6f28},_0x3ccb19,_0x1d0bb9,_0x48f524),_0x8f8ba2=_0x28602a?[]:findSegmentsToDelete(_0xd4ea33,_0x471228[_0x46ff65(0xcb)](({yamlConfig:_0x5b65ae,folderPath:_0x552baa})=>({'yamlConfig':_0x5b65ae,'folderPath':resolveTDFolderPath(_0x552baa,_0x1d0bb9,_0x48f524)})),_0x267c16,_0x48f524,_0x1d0bb9),{journeyFiles:_0x431c55,foldersToCreate:_0xcfc2c6}=await withProgressSpinner(_0x46ff65(0xcc),async _0x1e0b74=>prepareJourneyFiles(_0x4a9241,{'fetchJourney':async _0x1828b7=>_0x4efe7b[_0x46ff65(0xb6)][_0x46ff65(0xd4)](_0x1828b7[_0x46ff65(0xfa)]),'journeyBundlesByFolderAndName':_0x39b346,'folderPathToId':_0x41cd50,'idToEmailMap':_0x2a9164,'connectionIdToNameMap':_0x1c6f28,'existingSegments':_0xd4ea33,'parentId':_0x211185,'deps':_0x4efe7b,'progress':{'update':_0x29e782=>{_0x1e0b74['setPhase'](_0x29e782),_0x5b2931['verbose']&&console['error']('\x20\x20'+_0x29e782);}},'journeyById':_0x486cb7,'activationStepsById':_0x1e2fce},_0x1d0bb9,_0x48f524),{'verbose':_0x5b2931['verbose']})[_0x46ff65(0x9c)](_0x59ca9e=>_0x59ca9e[_0x46ff65(0x8e)]);for(const _0x4e5671 of _0xcfc2c6){_0x208bd5[_0x46ff65(0xe5)](_0x4e5671);}const _0x28ce98=_0x28602a?[]:findJourneysToDelete(_0x25658e,_0x4a9241[_0x46ff65(0xcb)](({yamlConfig:_0x1de08b,folderPath:_0x75b3a6})=>({'yamlConfig':_0x1de08b,'folderPath':resolveTDFolderPath(_0x75b3a6,_0x1d0bb9,_0x48f524)})),_0x267c16,_0x48f524,_0x1d0bb9),_0xbf4efe=calculatePushStats(_0x4b6312,_0x431c55,_0x208bd5,_0x8f8ba2,_0x28ce98,!!_0x5b2931[_0x46ff65(0x10b)],!!_0x5b2931[_0x46ff65(0x102)]),_0x54801e=_0xbf4efe['segments']['new'],_0x5c09bf=_0xbf4efe['segments']['changed'],_0x187c21=_0xbf4efe[_0x46ff65(0xd6)][_0x46ff65(0xc9)],_0x4ce36c=_0xbf4efe[_0x46ff65(0xd6)][_0x46ff65(0xfe)],_0x460bf2=_0xbf4efe[_0x46ff65(0xfc)]['toCreate'],_0x1704e3=_0xbf4efe[_0x46ff65(0x9f)][_0x46ff65(0xb1)],_0x1900d1=_0xbf4efe['journeys']['changed'],_0x89a4eb=_0xbf4efe[_0x46ff65(0x9f)][_0x46ff65(0xc9)],_0x4a1a5b=_0xbf4efe[_0x46ff65(0x9f)][_0x46ff65(0xfe)],_0x41ed84=_0xbf4efe[_0x46ff65(0x8b)][_0x46ff65(0x8a)],_0x556b45=_0xbf4efe[_0x46ff65(0x8b)][_0x46ff65(0xdf)],_0x373b54=_0xbf4efe[_0x46ff65(0x8b)]['toUpdate'],_0x29425a=_0xbf4efe['activations'][_0x46ff65(0xfe)];console['error'](_0x46ff65(0x85)+_0x2490fc+'\x27:');_0x460bf2[_0x46ff65(0x90)]>0x0&&console['error']('\x20\x20'+a40_0x7eaf6d['blue'](_0x46ff65(0xe3)+_0x460bf2[_0x46ff65(0x90)]+_0x46ff65(0x106)));if(!_0x5b2931[_0x46ff65(0x102)]){console[_0x46ff65(0xea)]('\x20\x20📊\x20Segments:'),console[_0x46ff65(0xea)](_0x46ff65(0x80)+a40_0x7eaf6d[_0x46ff65(0x93)]('+\x20'+_0x54801e[_0x46ff65(0x90)]+_0x46ff65(0xc4))),console['error'](_0x46ff65(0x80)+a40_0x7eaf6d[_0x46ff65(0xbb)]('~\x20'+_0x5c09bf[_0x46ff65(0x90)]+_0x46ff65(0xf2)));if(_0x4ce36c[_0x46ff65(0x90)]>0x0)console[_0x46ff65(0xea)](_0x46ff65(0x80)+a40_0x7eaf6d[_0x46ff65(0x97)]('-\x20'+_0x4ce36c[_0x46ff65(0x90)]+_0x46ff65(0xe2)));else _0x8f8ba2[_0x46ff65(0x90)]>0x0&&!_0x5b2931[_0x46ff65(0x10b)]&&console[_0x46ff65(0xea)](_0x46ff65(0x80)+a40_0x7eaf6d[_0x46ff65(0x98)](_0x8f8ba2[_0x46ff65(0x90)]+_0x46ff65(0x81)));console[_0x46ff65(0xea)](_0x46ff65(0x80)+a40_0x7eaf6d[_0x46ff65(0x98)]('=\x20'+_0x187c21[_0x46ff65(0x90)]+'\x20unchanged'));}if(_0x431c55[_0x46ff65(0x90)]>0x0||_0x28ce98[_0x46ff65(0x90)]>0x0){console['error']('\x20\x20🗺️\x20\x20Journeys:'),console[_0x46ff65(0xea)](_0x46ff65(0x80)+a40_0x7eaf6d[_0x46ff65(0x93)]('+\x20'+_0x1704e3[_0x46ff65(0x90)]+'\x20new')),console[_0x46ff65(0xea)]('\x20\x20\x20\x20'+a40_0x7eaf6d['yellow']('~\x20'+_0x1900d1[_0x46ff65(0x90)]+'\x20changed'));if(_0x4a1a5b['length']>0x0)console['error'](_0x46ff65(0x80)+a40_0x7eaf6d[_0x46ff65(0x97)]('-\x20'+_0x4a1a5b[_0x46ff65(0x90)]+_0x46ff65(0xe2)));else _0x28ce98['length']>0x0&&!_0x5b2931[_0x46ff65(0x10b)]&&console[_0x46ff65(0xea)](_0x46ff65(0x80)+a40_0x7eaf6d['dim'](_0x28ce98[_0x46ff65(0x90)]+'\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)'));console[_0x46ff65(0xea)]('\x20\x20\x20\x20'+a40_0x7eaf6d['dim']('=\x20'+_0x89a4eb[_0x46ff65(0x90)]+'\x20unchanged'));}_0x41ed84[_0x46ff65(0x90)]>0x0&&!_0x5b2931[_0x46ff65(0x102)]&&(console[_0x46ff65(0xea)](''),console[_0x46ff65(0xea)]('\x20\x20Activations:'),_0x556b45[_0x46ff65(0x90)]>0x0&&console[_0x46ff65(0xea)]('\x20\x20\x20\x20'+a40_0x7eaf6d[_0x46ff65(0x93)]('+\x20'+_0x556b45[_0x46ff65(0x90)]+'\x20to\x20create')),_0x373b54['length']>0x0&&console[_0x46ff65(0xea)](_0x46ff65(0x80)+a40_0x7eaf6d[_0x46ff65(0xbb)]('~\x20'+_0x373b54[_0x46ff65(0x90)]+_0x46ff65(0x7d))),_0x29425a[_0x46ff65(0x90)]>0x0&&console[_0x46ff65(0xea)](_0x46ff65(0x80)+a40_0x7eaf6d[_0x46ff65(0x97)]('-\x20'+_0x29425a[_0x46ff65(0x90)]+_0x46ff65(0xe2))));console['error'](_0x46ff65(0xd0)+a40_0x7eaf6d[_0x46ff65(0xf5)](_0xfce0e)+'\x0a');if(_0x460bf2[_0x46ff65(0x90)]>0x0){console[_0x46ff65(0xea)](_0x46ff65(0x107));for(const _0x1a58f7 of _0x460bf2){console[_0x46ff65(0xea)]('\x20\x20'+a40_0x7eaf6d[_0x46ff65(0xa1)]('+')+'\x20'+_0x1a58f7);}console[_0x46ff65(0xea)]('');}if(_0x54801e['length']>0x0&&!_0x5b2931[_0x46ff65(0x102)])for(const _0x3f1e2c of _0x54801e){const _0x2a3364=_0x3f1e2c[_0x46ff65(0x9a)]?_0x3f1e2c[_0x46ff65(0x9a)]+'/'+_0x3f1e2c[_0x46ff65(0xab)][_0x46ff65(0xd1)]:_0x3f1e2c[_0x46ff65(0xab)][_0x46ff65(0xd1)],_0x1f9cb4=_0x3f1e2c[_0x46ff65(0xab)][_0x46ff65(0x8b)]?.[_0x46ff65(0x90)]||0x0,_0x24b766=_0x1f9cb4>0x0?a40_0x7eaf6d['dim']('\x20['+_0x1f9cb4+_0x46ff65(0x94)):'';console[_0x46ff65(0xea)]('\x0a'+a40_0x7eaf6d[_0x46ff65(0x93)]('New\x20segment:')+'\x20'+_0x2a3364+_0x24b766),console[_0x46ff65(0xea)]('─'[_0x46ff65(0xc1)](0x3c)),_0x3f1e2c[_0x46ff65(0xf4)]&&console['error'](_0x3f1e2c[_0x46ff65(0xf4)]),console[_0x46ff65(0xea)]('─'[_0x46ff65(0xc1)](0x3c));}if(_0x4ce36c[_0x46ff65(0x90)]>0x0&&!_0x5b2931[_0x46ff65(0x102)])for(const _0x5e1549 of _0x4ce36c){const _0x33b7d5=_0x5e1549['segmentFolderId']?_0x267c16['get'](_0x5e1549[_0x46ff65(0xaa)][_0x46ff65(0x82)]())||'':'',_0x430c5a=_0x33b7d5?_0x33b7d5+'/'+_0x5e1549[_0x46ff65(0xd1)]:_0x5e1549[_0x46ff65(0xd1)],_0x44d35c=_0x3239b4['get'](_0x5e1549['id'])||[],_0x412cfb=_0x44d35c[_0x46ff65(0x90)]>0x0?a40_0x7eaf6d[_0x46ff65(0x98)]('\x20['+_0x44d35c[_0x46ff65(0x90)]+_0x46ff65(0x94)):'';console[_0x46ff65(0xea)]('\x0a'+a40_0x7eaf6d[_0x46ff65(0x97)]('Delete\x20segment:')+'\x20'+_0x430c5a+_0x412cfb),console[_0x46ff65(0xea)]('─'[_0x46ff65(0xc1)](0x3c));const _0x2a75e5=segmentWithActivationsToYaml(_0x5e1549,_0x44d35c,undefined,_0x2a9164,_0x1c6f28),_0x484be2=segmentToYamlString(_0x2a75e5),_0x1d5cfb=generateDiff(_0x484be2,'');console[_0x46ff65(0xea)](formatDiffWithColors(_0x1d5cfb)),console[_0x46ff65(0xea)]('─'[_0x46ff65(0xc1)](0x3c));}const _0x4cbab2=_0x4b6312['filter'](_0x3d0809=>!_0x3d0809['isNew']&&_0x3d0809[_0x46ff65(0xf4)]);if(_0x4cbab2[_0x46ff65(0x90)]>0x0&&!_0x5b2931[_0x46ff65(0x102)])for(const _0x197d6d of _0x4cbab2){const _0x92355f=_0x197d6d['folderPath']?_0x197d6d['folderPath']+'/'+_0x197d6d[_0x46ff65(0xab)][_0x46ff65(0xd1)]:_0x197d6d[_0x46ff65(0xab)][_0x46ff65(0xd1)];console[_0x46ff65(0xea)]('\x0a'+a40_0x7eaf6d[_0x46ff65(0xbb)](_0x46ff65(0x83))+'\x20'+_0x92355f),console['error']('─'['repeat'](0x3c)),console[_0x46ff65(0xea)](_0x197d6d[_0x46ff65(0xf4)]),console[_0x46ff65(0xea)]('─'['repeat'](0x3c));}if(_0x1704e3[_0x46ff65(0x90)]>0x0)for(const _0x1bf9cb of _0x1704e3){const _0x4b37a5=_0x1bf9cb[_0x46ff65(0x9a)]?_0x1bf9cb[_0x46ff65(0x9a)]+'/'+_0x1bf9cb[_0x46ff65(0xab)][_0x46ff65(0xd1)]:_0x1bf9cb[_0x46ff65(0xab)][_0x46ff65(0xd1)];console[_0x46ff65(0xea)]('\x0a'+a40_0x7eaf6d['green'](_0x46ff65(0xb5))+'\x20'+_0x4b37a5),console['error']('─'[_0x46ff65(0xc1)](0x3c)),_0x1bf9cb[_0x46ff65(0xf4)]&&console[_0x46ff65(0xea)](_0x1bf9cb['diff']),console[_0x46ff65(0xea)]('─'[_0x46ff65(0xc1)](0x3c));}const _0x560fc3=_0x431c55[_0x46ff65(0x8f)](_0x473b2e=>!_0x473b2e[_0x46ff65(0x100)]&&_0x473b2e[_0x46ff65(0xf4)]);if(_0x560fc3[_0x46ff65(0x90)]>0x0)for(const _0x3ad462 of _0x560fc3){const _0x2d0032=_0x3ad462[_0x46ff65(0x9a)]?_0x3ad462['folderPath']+'/'+_0x3ad462[_0x46ff65(0xab)][_0x46ff65(0xd1)]:_0x3ad462[_0x46ff65(0xab)][_0x46ff65(0xd1)];console[_0x46ff65(0xea)]('\x0a'+a40_0x7eaf6d[_0x46ff65(0xbb)](_0x46ff65(0xbc))+'\x20'+_0x2d0032),console[_0x46ff65(0xea)]('─'[_0x46ff65(0xc1)](0x3c)),console[_0x46ff65(0xea)](_0x3ad462['diff']),console[_0x46ff65(0xea)]('─'['repeat'](0x3c));}if(_0x4a1a5b[_0x46ff65(0x90)]>0x0)for(const _0x248174 of _0x4a1a5b){const _0x14137c=_0x248174[_0x46ff65(0xac)]?_0x267c16['get'](_0x248174['folderId'])||'':'',_0x271b6d=_0x14137c?_0x14137c+'/'+_0x248174[_0x46ff65(0xd5)]:_0x248174[_0x46ff65(0xd5)];console[_0x46ff65(0xea)]('\x0a'+a40_0x7eaf6d['red'](_0x46ff65(0xa5))+'\x20'+_0x271b6d),console[_0x46ff65(0xea)]('─'[_0x46ff65(0xc1)](0x3c)),console[_0x46ff65(0xea)](a40_0x7eaf6d['red']('(Journey\x20will\x20be\x20deleted)')),console[_0x46ff65(0xea)]('─'[_0x46ff65(0xc1)](0x3c));}if(_0x5b2931[_0x46ff65(0xb7)])return console[_0x46ff65(0xea)](a40_0x7eaf6d[_0x46ff65(0xbb)]('\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made')),0x0;const _0x2b6fd4=_0x5b2931[_0x46ff65(0x102)]?![]:_0x54801e[_0x46ff65(0x90)]>0x0||_0x5c09bf[_0x46ff65(0x90)]>0x0||_0x4ce36c[_0x46ff65(0x90)]>0x0,_0x5d7dc1=_0x1704e3['length']>0x0||_0x1900d1[_0x46ff65(0x90)]>0x0||_0x4a1a5b[_0x46ff65(0x90)]>0x0,_0x9b7795=_0x5b2931['journeysOnly']?![]:_0x41ed84['length']>0x0,_0x5e9caa=_0x460bf2[_0x46ff65(0x90)]>0x0;if(!_0x2b6fd4&&!_0x5d7dc1&&!_0x9b7795&&!_0x5e9caa){const _0xf8fc1=_0x5b2931[_0x46ff65(0x102)]?_0x46ff65(0xb8):_0x46ff65(0xf3);console[_0x46ff65(0xea)](a40_0x7eaf6d[_0x46ff65(0x93)](_0xf8fc1));if(_0x28602a&&_0x187c21[_0x46ff65(0x90)]===0x1){const _0x6dc4e1=_0x187c21[0x0];if(_0x6dc4e1[_0x46ff65(0xa6)]?.['id']){const _0x150fd3=getConsoleNextUrl(_0x5b2931[_0x46ff65(0x92)],_0x46ff65(0x95)+_0x211185+_0x46ff65(0xf0)+_0x6dc4e1['existingSegment']['id']+_0x46ff65(0x109));console[_0x46ff65(0xea)](_0x46ff65(0x110)+a40_0x7eaf6d[_0x46ff65(0xf5)](_0x150fd3));}}if(_0x28602a&&_0x89a4eb[_0x46ff65(0x90)]===0x1){const _0x25e258=_0x89a4eb[0x0];if(_0x25e258[_0x46ff65(0x101)]?.['id']){const _0x29d3cf=getConsoleNextUrl(_0x5b2931['site'],'/app/ps/'+_0x211185+_0x46ff65(0xf0)+_0x25e258['existingJourney']['id']+'/j/da/je');console[_0x46ff65(0xea)]('\x20\x20'+a40_0x7eaf6d[_0x46ff65(0xf5)](_0x29d3cf));}}return 0x0;}const _0x1cb719=_0x5b2931['journeysOnly']?_0x1704e3[_0x46ff65(0x90)]+_0x1900d1[_0x46ff65(0x90)]+_0x4a1a5b[_0x46ff65(0x90)]+_0x460bf2['length']:_0x54801e[_0x46ff65(0x90)]+_0x5c09bf[_0x46ff65(0x90)]+_0x4ce36c[_0x46ff65(0x90)]+_0x1704e3[_0x46ff65(0x90)]+_0x1900d1[_0x46ff65(0x90)]+_0x4a1a5b[_0x46ff65(0x90)]+_0x460bf2[_0x46ff65(0x90)]+_0x41ed84[_0x46ff65(0x90)];if(!_0x5b2931[_0x46ff65(0xc2)]&&_0x1cb719>0x0){if(!isInteractive())return console[_0x46ff65(0xea)](a40_0x7eaf6d[_0x46ff65(0x97)]('\x0aError:'),_0x46ff65(0xc3)),console['error'](a40_0x7eaf6d['dim'](_0x46ff65(0xed))),0x1;const _0x4ffea9=await confirmKey(_0x46ff65(0xda)+_0x1cb719+'\x20changes?');if(!_0x4ffea9)return console[_0x46ff65(0xea)](a40_0x7eaf6d[_0x46ff65(0xbb)](_0x46ff65(0x7e))),0x1;}const _0x5bb532={'withProgress':async(_0x1a683e,_0x5f053a)=>{const _0x293389=_0x46ff65,_0x3ffbea=await withSpinner(_0x1a683e,_0x5f053a,{'verbose':_0x5b2931[_0x293389(0xfd)]});return{'data':_0x3ffbea[_0x293389(0x8e)]};},'logInfo':_0x505493=>console[_0x46ff65(0xea)](a40_0x7eaf6d[_0x46ff65(0xa1)]('✔\x20'+_0x505493)),'logSuccess':_0x5c4120=>console[_0x46ff65(0xea)](a40_0x7eaf6d['green']('✔\x20'+_0x5c4120)),'logWarning':_0x23efe3=>console[_0x46ff65(0xea)](a40_0x7eaf6d['yellow']('⚠\x20'+_0x23efe3)),'logDeleted':_0x3de8cd=>console['error'](a40_0x7eaf6d[_0x46ff65(0x97)]('✔\x20'+_0x3de8cd))},_0x5039ec={'segment':_0x4efe7b['segment'],'journey':_0x4efe7b['journey'],'user':_0x4efe7b[_0x46ff65(0xbe)],'connection':_0x4efe7b[_0x46ff65(0x10a)]};_0x460bf2[_0x46ff65(0x90)]>0x0&&(_0x41cd50=await executePushFolders(_0x5039ec,_0x460bf2,_0x41cd50,{'parentId':_0x211185},_0x5bb532));const _0x4f7428={'rootFolderId':_0x2b31bf,'folderPathToId':_0x41cd50,'folderIdToPath':_0x267c16,'segmentNameToId':_0x1182de,'activationsBySegmentId':_0x3239b4,'emailToIdMap':_0x1ba1e6,'idToEmailMap':_0x2a9164,'connectionNameToIdMap':_0x10d59a[_0x46ff65(0xee)],'connectionIdToNameMap':_0x10d59a[_0x46ff65(0x89)],'connectionNameToTypeMap':_0x3f010f},_0x441b16=await executePushSegments(_0x5039ec,_0x5b2931[_0x46ff65(0x102)]?[]:_0x4b6312,_0x4f7428,{'parentId':_0x211185},_0x5bb532),_0x328be6=_0x441b16[_0x46ff65(0x10f)],_0x503f31=_0x441b16['updated'],_0x24a226=_0x441b16[_0x46ff65(0x8b)][_0x46ff65(0x10f)],_0x3858bc=_0x441b16[_0x46ff65(0x8b)][_0x46ff65(0xa8)],_0x217eb4=_0x441b16[_0x46ff65(0x8b)]['deleted'];let _0x33c27e;if(_0x28602a&&_0x4b6312['length']===0x1){const _0x1fe266=_0x4b6312[0x0];_0x33c27e=_0x1fe266[_0x46ff65(0xa6)]?.['id']??_0x441b16['createdSegmentIds']['get'](_0x1fe266[_0x46ff65(0xab)][_0x46ff65(0xd1)]);}const _0x5a019c=await executePushSegmentDeletions(_0x5039ec,_0x5b2931[_0x46ff65(0x102)]?[]:_0x4ce36c,_0x5bb532);let _0x3933fb=0x0,_0x789372=0x0,_0x3f6944=0x0;const _0x288126=new Map(_0x1182de);for(const [_0x53ff0c,_0x2ddb82]of _0x441b16[_0x46ff65(0xeb)]){_0x288126[_0x46ff65(0x86)](_0x53ff0c,_0x2ddb82);}if(_0x431c55[_0x46ff65(0x90)]>0x0){const _0x7bc1c8={..._0x4f7428,'segmentNameToId':_0x288126,'existingSegments':_0xd4ea33,'activationContext':_0x3ccb19},_0x14424c=await executePushJourneys(_0x5039ec,_0x431c55,_0x7bc1c8,{'parentId':_0x211185,'rootFolderId':_0x2b31bf,'verbose':_0x5b2931[_0x46ff65(0xfd)]},_0x5bb532);_0x3933fb=_0x14424c[_0x46ff65(0x10f)],_0x789372=_0x14424c[_0x46ff65(0xa8)];if(_0x28602a&&_0x14424c[_0x46ff65(0x99)][_0x46ff65(0x90)]===0x1){const _0x5d33b7=_0x14424c[_0x46ff65(0x99)][0x0];if(_0x5d33b7[_0x46ff65(0xfa)]){const _0x3001c4=getConsoleNextUrl(_0x5b2931[_0x46ff65(0x92)],_0x46ff65(0x95)+_0x211185+'/e/'+_0x5d33b7[_0x46ff65(0xfa)]+_0x46ff65(0xf8));console[_0x46ff65(0xea)]('\x20\x20'+a40_0x7eaf6d['cyan'](_0x3001c4));}}}for(const _0x9276cf of _0x4a1a5b){console[_0x46ff65(0xea)](a40_0x7eaf6d[_0x46ff65(0xbb)](_0x46ff65(0xd7)+_0x9276cf[_0x46ff65(0xd5)])),_0x3f6944++;}const _0x33e5ad=[];if(_0x328be6>0x0)_0x33e5ad[_0x46ff65(0x9b)](_0x328be6+'\x20created');if(_0x503f31>0x0)_0x33e5ad[_0x46ff65(0x9b)](_0x503f31+_0x46ff65(0x88));if(_0x5a019c>0x0)_0x33e5ad['push'](_0x5a019c+_0x46ff65(0xf1));const _0x288c9e=[];if(_0x3933fb>0x0)_0x288c9e['push'](_0x3933fb+_0x46ff65(0xa9));if(_0x789372>0x0)_0x288c9e[_0x46ff65(0x9b)](_0x789372+_0x46ff65(0x88));if(_0x3f6944>0x0)_0x288c9e[_0x46ff65(0x9b)](_0x3f6944+'\x20deleted');const _0x188424=[];if(_0x24a226>0x0)_0x188424[_0x46ff65(0x9b)](_0x24a226+_0x46ff65(0xa9));if(_0x3858bc>0x0)_0x188424['push'](_0x3858bc+_0x46ff65(0x88));if(_0x217eb4>0x0)_0x188424['push'](_0x217eb4+_0x46ff65(0xf1));console[_0x46ff65(0xea)](a40_0x7eaf6d[_0x46ff65(0x93)](_0x46ff65(0x7f)));_0x33e5ad[_0x46ff65(0x90)]>0x0&&!_0x5b2931['journeysOnly']&&console[_0x46ff65(0xea)]('\x20\x20Segments:\x20'+_0x33e5ad['join'](',\x20'));_0x288c9e['length']>0x0&&console[_0x46ff65(0xea)](_0x46ff65(0xde)+_0x288c9e[_0x46ff65(0xe6)](',\x20'));_0x188424[_0x46ff65(0x90)]>0x0&&!_0x5b2931['journeysOnly']&&console['error'](_0x46ff65(0xdd)+_0x188424[_0x46ff65(0xe6)](',\x20'));if(_0x33c27e){const _0x389f5a=getConsoleNextUrl(_0x5b2931[_0x46ff65(0x92)],_0x46ff65(0x95)+_0x211185+'/e/'+_0x33c27e+'/sb/da/esr');console[_0x46ff65(0xea)](_0x46ff65(0x110)+a40_0x7eaf6d[_0x46ff65(0xf5)](_0x389f5a));}return 0x0;}}
@@ -1 +1 @@
1
- function a40_0x46a3(){const _0x1cb135=['Resolved\x20relative\x20path\x20to:\x20','\x27...','yellow','type','1463FKZlTZ','data','Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]','resolveFolderId','INTERNAL','11168PBzXkG','kind','Update\x20existing\x20child\x20segment','segmentName','\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22','246880yQTyDx','\x20\x20\x20Path:\x20','name','description','verbose','segmentId','Error:\x20Cannot\x20update\x20','length','12164wsylLu','Resolving\x20path\x20\x27','3Vgmqyb','updateSegmentById','Resolved\x20folder\x20ID:\x20','parentId','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','Resolved\x20type:\x20','1286880zyaiHI','Segment\x20ID:\x20','⚠\x20Deprecation\x20warning:\x20`segment\x20update`\x20is\x20deprecated.','1161802qxWtYR','rule','segment:update','5311782fFPewj','segment','1200517qYbsyF','5131zmauBL','570qnsYWX','error','\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','folder','Parent\x20ID:\x20','Examples:','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required'];a40_0x46a3=function(){return _0x1cb135;};return a40_0x46a3();}function a40_0x302e(_0x568b0b,_0x5dd899){_0x568b0b=_0x568b0b-0x80;const _0x46a3ce=a40_0x46a3();let _0x302e54=_0x46a3ce[_0x568b0b];return _0x302e54;}const a40_0x55fd99=a40_0x302e;(function(_0x121700,_0x5e4f9f){const _0x9a8f71=a40_0x302e,_0x43bdf2=_0x121700();while(!![]){try{const _0x2c551d=parseInt(_0x9a8f71(0xad))/0x1+parseInt(_0x9a8f71(0xa8))/0x2*(parseInt(_0x9a8f71(0x9f))/0x3)+parseInt(_0x9a8f71(0x9d))/0x4*(parseInt(_0x9a8f71(0x80))/0x5)+parseInt(_0x9a8f71(0xa5))/0x6+parseInt(_0x9a8f71(0xae))/0x7*(parseInt(_0x9a8f71(0x90))/0x8)+parseInt(_0x9a8f71(0xab))/0x9+-parseInt(_0x9a8f71(0x95))/0xa*(parseInt(_0x9a8f71(0x8b))/0xb);if(_0x2c551d===_0x5e4f9f)break;else _0x43bdf2['push'](_0x43bdf2['shift']());}catch(_0x1990a8){_0x43bdf2['push'](_0x43bdf2['shift']());}}}(a40_0x46a3,0xa4316));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{SDKError,ErrorCode}from'../sdk/index.js';import a40_0x3a58aa from'chalk';export class SegmentUpdateCommand extends BaseCommand{[a40_0x55fd99(0x97)]=a40_0x55fd99(0xaa);['description']=a40_0x55fd99(0x92);async['execute'](_0x5c07cc){const _0x347d51=a40_0x55fd99;console[_0x347d51(0x81)](a40_0x3a58aa[_0x347d51(0x89)](_0x347d51(0xa7))),console[_0x347d51(0x81)](a40_0x3a58aa[_0x347d51(0x89)](_0x347d51(0xa3)));const {options:_0x1e7fc0,args:_0x1b767b,tdx:_0x157cb3}=_0x5c07cc,_0x2b815a=_0x1e7fc0;if(_0x1b767b[_0x347d51(0x9c)]===0x0)return console[_0x347d51(0x81)](_0x347d51(0x86)),console[_0x347d51(0x81)](_0x347d51(0x8d)),console['error'](_0x347d51(0x85)),console[_0x347d51(0x81)](_0x347d51(0x94)),console[_0x347d51(0x81)](_0x347d51(0x82)),0x1;const _0x3baa13=_0x1b767b[0x0],_0x549c4f=_0x1e7fc0['segmentPath'];let _0x3bdf02=_0x3baa13;_0x549c4f&&!_0x3baa13['includes']('/')&&(_0x3bdf02=_0x549c4f+'/'+_0x3baa13,_0x2b815a[_0x347d51(0x99)]&&console[_0x347d51(0x81)](_0x347d51(0x87)+_0x3bdf02));const _0x1a3983=await withSpinner(_0x347d51(0x9e)+_0x3bdf02+_0x347d51(0x88),()=>_0x157cb3[_0x347d51(0xac)]['resolvePathToResource'](_0x3bdf02),{'verbose':_0x2b815a[_0x347d51(0x99)]}),_0x189d1b=_0x1a3983[_0x347d51(0x8c)];_0x2b815a[_0x347d51(0x99)]&&console[_0x347d51(0x81)](_0x347d51(0xa4)+_0x189d1b[_0x347d51(0x8a)]);if(_0x189d1b[_0x347d51(0x8a)]!==_0x347d51(0xac))return console[_0x347d51(0x81)](_0x347d51(0x9b)+_0x189d1b[_0x347d51(0x8a)]+'.\x20Only\x20child\x20segments\x20can\x20be\x20updated.'),console['error']('Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]'),0x1;if(!_0x189d1b[_0x347d51(0x9a)])throw new SDKError(ErrorCode[_0x347d51(0x8f)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x2246de=_0x189d1b[_0x347d51(0xa2)],_0x83f11f=_0x189d1b[_0x347d51(0x9a)];_0x2b815a['verbose']&&(console[_0x347d51(0x81)](_0x347d51(0x84)+_0x2246de),console[_0x347d51(0x81)](_0x347d51(0xa6)+_0x83f11f));let _0x16cecc;if(_0x2b815a['folder']){const _0x2b92fe=_0x2b815a[_0x347d51(0x83)],_0x5d4c80=await withSpinner('Resolving\x20folder\x20\x27'+_0x2b92fe+_0x347d51(0x88),()=>_0x157cb3[_0x347d51(0xac)][_0x347d51(0x8e)](_0x2246de,_0x2b92fe),{'verbose':_0x2b815a[_0x347d51(0x99)]});_0x16cecc=parseInt(_0x5d4c80[_0x347d51(0x8c)],0xa),_0x2b815a[_0x347d51(0x99)]&&console[_0x347d51(0x81)](_0x347d51(0xa1)+_0x16cecc);}const _0xb0f6cf=await loadJSONFromOptions(_0x2b815a[_0x347d51(0xa9)],_0x2b815a['ruleFile']),_0x57e9cc={'name':_0x2b815a[_0x347d51(0x97)],'description':_0x2b815a[_0x347d51(0x98)],'rule':_0xb0f6cf,'kind':_0x2b815a['kind']!==undefined?parseInt(_0x2b815a[_0x347d51(0x91)],0xa):undefined,'segmentFolderId':_0x16cecc},_0x5d4972=await withSpinner('Updating\x20segment\x20\x27'+_0x189d1b[_0x347d51(0x93)]+_0x347d51(0x88),()=>_0x157cb3[_0x347d51(0xac)][_0x347d51(0xa0)](_0x2246de,_0x83f11f,_0x57e9cc),{'verbose':_0x2b815a[_0x347d51(0x99)]}),_0x5ab696=_0x5d4972[_0x347d51(0x8c)];return console[_0x347d51(0x81)]('✔\x20Updated\x20segment\x20\x27'+_0x5ab696[_0x347d51(0x97)]+'\x27'),_0x3bdf02!==_0x3baa13&&console[_0x347d51(0x81)](_0x347d51(0x96)+_0x3bdf02),await handleSDKOutput([_0x5ab696],_0x2b815a),0x0;}}
1
+ const a41_0x52bd90=a41_0xf8e5;(function(_0x78fccd,_0x11d3cd){const _0x3651de=a41_0xf8e5,_0x1fb6fa=_0x78fccd();while(!![]){try{const _0x17e264=parseInt(_0x3651de(0x123))/0x1*(parseInt(_0x3651de(0x11b))/0x2)+-parseInt(_0x3651de(0x118))/0x3*(-parseInt(_0x3651de(0x11a))/0x4)+parseInt(_0x3651de(0xfe))/0x5+-parseInt(_0x3651de(0x107))/0x6+parseInt(_0x3651de(0x11d))/0x7+-parseInt(_0x3651de(0x114))/0x8*(-parseInt(_0x3651de(0x110))/0x9)+-parseInt(_0x3651de(0x100))/0xa;if(_0x17e264===_0x11d3cd)break;else _0x1fb6fa['push'](_0x1fb6fa['shift']());}catch(_0x2b57ce){_0x1fb6fa['push'](_0x1fb6fa['shift']());}}}(a41_0xd1cf,0xaa69b));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';function a41_0xd1cf(){const _0x50948a=['name','segmentId','2450835NEpKpQ','\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','26862780XfbsNF','length','Update\x20existing\x20child\x20segment','rule','Parent\x20ID:\x20','updateSegmentById','✔\x20Updated\x20segment\x20\x27','5642382RbedBH','\x27...','Resolving\x20path\x20\x27','folder','error','segment','Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]','segmentPath','includes','18HFehSW','verbose','resolvePathToResource','parentId','2749016EBHEht','data','Resolving\x20folder\x20\x27','ruleFile','1707JStmnZ','segment:update','8088GWbfea','283722XLvsCn','description','5039986QhiKlW','execute','INTERNAL','.\x20Only\x20child\x20segments\x20can\x20be\x20updated.','type','Error:\x20Cannot\x20update\x20','9oZFBIY','Segment\x20ID:\x20','Resolved\x20type:\x20','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]','yellow','\x20\x20\x20Path:\x20','Segment\x20ID\x20missing\x20from\x20resolved\x20path','kind','\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22','Updating\x20segment\x20\x27'];a41_0xd1cf=function(){return _0x50948a;};return a41_0xd1cf();}import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';function a41_0xf8e5(_0x5d7c14,_0x561d4c){_0x5d7c14=_0x5d7c14-0xf3;const _0xd1cf74=a41_0xd1cf();let _0xf8e593=_0xd1cf74[_0x5d7c14];return _0xf8e593;}import{SDKError,ErrorCode}from'../sdk/index.js';import a41_0x4ae866 from'chalk';export class SegmentUpdateCommand extends BaseCommand{[a41_0x52bd90(0xfc)]=a41_0x52bd90(0x119);[a41_0x52bd90(0x11c)]=a41_0x52bd90(0x102);async[a41_0x52bd90(0x11e)](_0x13ccd3){const _0x185d85=a41_0x52bd90;console[_0x185d85(0x10b)](a41_0x4ae866[_0x185d85(0xf6)]('⚠\x20Deprecation\x20warning:\x20`segment\x20update`\x20is\x20deprecated.')),console[_0x185d85(0x10b)](a41_0x4ae866[_0x185d85(0xf6)](_0x185d85(0xf4)));const {options:_0x2d9e14,args:_0x4b9f8b,tdx:_0xde1305}=_0x13ccd3,_0x37b716=_0x2d9e14;if(_0x4b9f8b[_0x185d85(0x101)]===0x0)return console[_0x185d85(0x10b)]('Error:\x20Segment\x20path\x20or\x20name\x20is\x20required'),console['error'](_0x185d85(0x10d)),console[_0x185d85(0x10b)]('Examples:'),console[_0x185d85(0x10b)](_0x185d85(0xfa)),console[_0x185d85(0x10b)](_0x185d85(0xff)),0x1;const _0x1e0790=_0x4b9f8b[0x0],_0x1a3f05=_0x2d9e14[_0x185d85(0x10e)];let _0x232444=_0x1e0790;_0x1a3f05&&!_0x1e0790[_0x185d85(0x10f)]('/')&&(_0x232444=_0x1a3f05+'/'+_0x1e0790,_0x37b716[_0x185d85(0x111)]&&console['error']('Resolved\x20relative\x20path\x20to:\x20'+_0x232444));const _0x2000a3=await withSpinner(_0x185d85(0x109)+_0x232444+_0x185d85(0x108),()=>_0xde1305['segment'][_0x185d85(0x112)](_0x232444),{'verbose':_0x37b716[_0x185d85(0x111)]}),_0x388c1a=_0x2000a3['data'];_0x37b716[_0x185d85(0x111)]&&console[_0x185d85(0x10b)](_0x185d85(0xf3)+_0x388c1a[_0x185d85(0x121)]);if(_0x388c1a['type']!=='segment')return console[_0x185d85(0x10b)](_0x185d85(0x122)+_0x388c1a[_0x185d85(0x121)]+_0x185d85(0x120)),console['error'](_0x185d85(0xf5)),0x1;if(!_0x388c1a[_0x185d85(0xfd)])throw new SDKError(ErrorCode[_0x185d85(0x11f)],_0x185d85(0xf8));const _0x32479f=_0x388c1a[_0x185d85(0x113)],_0x105964=_0x388c1a[_0x185d85(0xfd)];_0x37b716[_0x185d85(0x111)]&&(console[_0x185d85(0x10b)](_0x185d85(0x104)+_0x32479f),console['error'](_0x185d85(0x124)+_0x105964));let _0x3bcf98;if(_0x37b716[_0x185d85(0x10a)]){const _0x53aea5=_0x37b716[_0x185d85(0x10a)],_0x9d7f3=await withSpinner(_0x185d85(0x116)+_0x53aea5+'\x27...',()=>_0xde1305[_0x185d85(0x10c)]['resolveFolderId'](_0x32479f,_0x53aea5),{'verbose':_0x37b716[_0x185d85(0x111)]});_0x3bcf98=parseInt(_0x9d7f3['data'],0xa),_0x37b716['verbose']&&console[_0x185d85(0x10b)]('Resolved\x20folder\x20ID:\x20'+_0x3bcf98);}const _0x17e2d2=await loadJSONFromOptions(_0x37b716[_0x185d85(0x103)],_0x37b716[_0x185d85(0x117)]),_0x58ac34={'name':_0x37b716[_0x185d85(0xfc)],'description':_0x37b716[_0x185d85(0x11c)],'rule':_0x17e2d2,'kind':_0x37b716[_0x185d85(0xf9)]!==undefined?parseInt(_0x37b716[_0x185d85(0xf9)],0xa):undefined,'segmentFolderId':_0x3bcf98},_0x366209=await withSpinner(_0x185d85(0xfb)+_0x388c1a['segmentName']+_0x185d85(0x108),()=>_0xde1305['segment'][_0x185d85(0x105)](_0x32479f,_0x105964,_0x58ac34),{'verbose':_0x37b716[_0x185d85(0x111)]}),_0x2f2fe3=_0x366209[_0x185d85(0x115)];return console[_0x185d85(0x10b)](_0x185d85(0x106)+_0x2f2fe3[_0x185d85(0xfc)]+'\x27'),_0x232444!==_0x1e0790&&console['error'](_0x185d85(0xf7)+_0x232444),await handleSDKOutput([_0x2f2fe3],_0x37b716),0x0;}}
@@ -1 +1 @@
1
- const a41_0x28861d=a41_0x4b98;function a41_0x251a(){const _0x3c8831=['\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22','isAbsolute','segments','split','execute','parentId','folderPath','parentName','152343hzAoZn','folderId','data','type','segment','Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','Examples:','2132NZweif','error','slice','3458574mfJpMI','fullPath','cyan','segment:use','red','Use\x20\x22tdx\x20use\x22\x20to\x20see\x20all\x20context\x20parameters','Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context','Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.','Target\x20path:\x20','Site:\x20','session','dim','11152810HPaiYC','green','\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context','isDirectory','Resolved\x20relative\x20path\x20to:\x20','5361208trHfjo','309323POzJYO','Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>','resolvePathToResource','join','Resolving\x20path\x20\x27','Folder\x20ID:\x20','Error:\x20Path\x20is\x20required\x0a','2995lSZXdR','\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent','site','log','8hBbEdH','Set\x20current\x20segment/folder\x20context\x20for\x20navigation','Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.','verbose','name','description','9oiEZfX','✔\x20Context\x20cleared.\x20Back\x20to\x20root.','Resolved\x20path\x20type:\x20','1934226vZDoBA','segmentPath','Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.','\x27...'];a41_0x251a=function(){return _0x3c8831;};return a41_0x251a();}(function(_0x492d62,_0xa570d3){const _0xaf7043=a41_0x4b98,_0x50a9f9=_0x492d62();while(!![]){try{const _0x25598e=-parseInt(_0xaf7043(0x77))/0x1+-parseInt(_0xaf7043(0x82))/0x2*(parseInt(_0xaf7043(0x97))/0x3)+parseInt(_0xaf7043(0x9e))/0x4*(parseInt(_0xaf7043(0x7e))/0x5)+-parseInt(_0xaf7043(0x8b))/0x6+parseInt(_0xaf7043(0xa1))/0x7+-parseInt(_0xaf7043(0x76))/0x8*(parseInt(_0xaf7043(0x88))/0x9)+parseInt(_0xaf7043(0x71))/0xa;if(_0x25598e===_0xa570d3)break;else _0x50a9f9['push'](_0x50a9f9['shift']());}catch(_0x43e30f){_0x50a9f9['push'](_0x50a9f9['shift']());}}}(a41_0x251a,0x676ed));function a41_0x4b98(_0x3fc556,_0x52d75a){_0x3fc556=_0x3fc556-0x67;const _0x251ab0=a41_0x251a();let _0x4b984b=_0x251ab0[_0x3fc556];return _0x4b984b;}import{existsSync,statSync}from'fs';import a41_0x24aef8 from'chalk';import{BaseCommand}from'./command.js';import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';import{parsePath,normalizePath}from'../sdk/segment/segment-path-parser.js';import{findTdxConfig}from'../sdk/segment/tdx-config.js';export class SegmentUseCommand extends BaseCommand{[a41_0x28861d(0x86)]=a41_0x28861d(0x68);[a41_0x28861d(0x87)]=a41_0x28861d(0x83);async[a41_0x28861d(0x93)](_0x255d3a){const _0x2132d1=a41_0x28861d,{options:_0x5e6c0a,args:_0x235576,tdx:_0x508c3f}=_0x255d3a;if(_0x235576['length']===0x0)return console[_0x2132d1(0x9f)](a41_0x24aef8[_0x2132d1(0x69)](_0x2132d1(0x7d))),console[_0x2132d1(0x9f)]('Usage:\x20tdx\x20segment\x20use\x20<path>'),console[_0x2132d1(0x9f)](_0x2132d1(0x9d)),console['error']('\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22'),console[_0x2132d1(0x9f)](_0x2132d1(0x8f)),console[_0x2132d1(0x9f)](_0x2132d1(0x73)),console[_0x2132d1(0x9f)](_0x2132d1(0x7f)),0x1;const _0x59149b=_0x235576[0x0],_0x41a650=_0x5e6c0a[_0x2132d1(0x6f)];try{if(_0x59149b==='/')return saveSessionContext({'segment_path':undefined},_0x41a650),console[_0x2132d1(0x81)](a41_0x24aef8[_0x2132d1(0x72)](_0x2132d1(0x89))),0x0;if(existsSync(_0x59149b)&&statSync(_0x59149b)[_0x2132d1(0x74)]()){let _0x1485aa;try{_0x1485aa=findTdxConfig(_0x59149b);}catch{return console['error'](a41_0x24aef8['red'](_0x2132d1(0x9c)+_0x59149b)),console[_0x2132d1(0x9f)](a41_0x24aef8[_0x2132d1(0x67)]('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;}const _0x5c1610=_0x1485aa['config']['parent_segment'];return saveSessionContext({'segment_path':_0x5c1610,'parent_segment':_0x5c1610},_0x41a650),console[_0x2132d1(0x81)](a41_0x24aef8[_0x2132d1(0x72)]('✔\x20Context\x20set\x20to:\x20'+a41_0x24aef8[_0x2132d1(0x67)](_0x5c1610))),0x0;}const _0x1a11dd=_0x5e6c0a[_0x2132d1(0x8c)];let _0x255c6d=_0x59149b;const _0x2c9147=parsePath(_0x59149b);if(!_0x2c9147[_0x2132d1(0x90)]){if(!_0x1a11dd)return console[_0x2132d1(0x9f)](a41_0x24aef8[_0x2132d1(0x69)](_0x2132d1(0x8d))),console[_0x2132d1(0x9f)](a41_0x24aef8[_0x2132d1(0x67)](_0x2132d1(0x78))),0x1;if(_0x59149b==='..'){const _0x5de617=_0x1a11dd[_0x2132d1(0x92)]('/')[_0x2132d1(0xa0)](0x0,-0x1)[_0x2132d1(0x7a)]('/');_0x255c6d=_0x5de617||'/';}else _0x59149b==='.'?_0x255c6d=_0x1a11dd:_0x255c6d=_0x1a11dd+'/'+_0x59149b;_0x5e6c0a[_0x2132d1(0x85)]&&console[_0x2132d1(0x9f)](_0x2132d1(0x75)+_0x255c6d);}if(_0x255c6d==='/'||_0x255c6d==='')return saveSessionContext({'segment_path':undefined},_0x41a650),console[_0x2132d1(0x81)](a41_0x24aef8[_0x2132d1(0x72)]('✔\x20Context\x20cleared.\x20Back\x20to\x20root.')),0x0;_0x255c6d=normalizePath(_0x255c6d);const _0x167a64=parsePath(_0x255c6d)[_0x2132d1(0x91)];if(_0x167a64['length']===0x0)return saveSessionContext({'segment_path':undefined},_0x41a650),console[_0x2132d1(0x81)](a41_0x24aef8['green'](_0x2132d1(0x89))),0x0;_0x5e6c0a['verbose']&&(console[_0x2132d1(0x9f)](_0x2132d1(0x6e)+_0x5e6c0a[_0x2132d1(0x80)]),console[_0x2132d1(0x9f)](_0x2132d1(0x6d)+_0x255c6d));const _0x2c09f2=await withSpinner(_0x2132d1(0x7b)+_0x255c6d+_0x2132d1(0x8e),()=>_0x508c3f[_0x2132d1(0x9b)][_0x2132d1(0x79)](_0x255c6d),{'verbose':_0x5e6c0a[_0x2132d1(0x85)]}),_0x11d7f2=_0x2c09f2[_0x2132d1(0x99)];_0x5e6c0a[_0x2132d1(0x85)]&&(console['error'](_0x2132d1(0x8a)+_0x11d7f2['type']),console['error']('Parent\x20ID:\x20'+_0x11d7f2[_0x2132d1(0x94)]),_0x11d7f2[_0x2132d1(0x98)]&&console[_0x2132d1(0x9f)](_0x2132d1(0x7c)+_0x11d7f2[_0x2132d1(0x98)]));if(_0x11d7f2[_0x2132d1(0x9a)]===_0x2132d1(0x9b))return console[_0x2132d1(0x9f)](a41_0x24aef8[_0x2132d1(0x69)](_0x2132d1(0x6c))),console[_0x2132d1(0x9f)](_0x2132d1(0x84)),console[_0x2132d1(0x9f)](a41_0x24aef8['cyan']('Use:\x20tdx\x20segment\x20use\x20'+_0x11d7f2[_0x2132d1(0x96)]+(_0x11d7f2[_0x2132d1(0x95)]?'/'+_0x11d7f2[_0x2132d1(0x95)][_0x2132d1(0x7a)]('/'):''))),0x1;return saveSessionContext({'segment_path':_0x11d7f2['fullPath'],'parent_segment':_0x11d7f2[_0x2132d1(0x96)]},_0x41a650),console['log'](a41_0x24aef8['green']('✔\x20Context\x20set\x20to:\x20'+a41_0x24aef8['cyan'](_0x11d7f2[_0x2132d1(0xa2)]))),_0x5e6c0a[_0x2132d1(0x85)]&&(console[_0x2132d1(0x9f)](a41_0x24aef8['dim'](_0x2132d1(0x6b))),console[_0x2132d1(0x9f)](a41_0x24aef8[_0x2132d1(0x70)](_0x2132d1(0x6a)))),0x0;}catch(_0x1db4f1){throw _0x1db4f1;}}}
1
+ const a42_0x1c0cdf=a42_0x5ed1;function a42_0xed03(){const _0x1882ff=['length','11ltivvh','✔\x20Context\x20set\x20to:\x20','parentId','log','segments','fullPath','Target\x20path:\x20','name','208NgGDcY','\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context','dim','segmentPath','✔\x20Context\x20cleared.\x20Back\x20to\x20root.','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22','3183498YLEVfO','\x27...','session','Usage:\x20tdx\x20segment\x20use\x20<path>','slice','resolvePathToResource','Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>','Use:\x20tdx\x20segment\x20use\x20','1599798HKuGlo','green','Error:\x20Path\x20is\x20required\x0a','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22','Set\x20current\x20segment/folder\x20context\x20for\x20navigation','78753OLGxDd','type','5DgLdzf','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','execute','folderId','join','verbose','folderPath','Resolved\x20relative\x20path\x20to:\x20','17550500HClXTk','Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context','Examples:','Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','site','segment','44RtUDsU','Parent\x20ID:\x20','\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent','Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.','split','error','red','880052QfNGHN','cyan','310399khISxa','parent_segment','parentName','102445vmDPxx','Resolving\x20path\x20\x27','Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.','Folder\x20ID:\x20','isAbsolute'];a42_0xed03=function(){return _0x1882ff;};return a42_0xed03();}(function(_0xe4d4c1,_0x289b32){const _0x5a4d7f=a42_0x5ed1,_0x1103d4=_0xe4d4c1();while(!![]){try{const _0x58ba23=-parseInt(_0x5a4d7f(0xaf))/0x1+-parseInt(_0x5a4d7f(0xad))/0x2+-parseInt(_0x5a4d7f(0x96))/0x3*(-parseInt(_0x5a4d7f(0xa6))/0x4)+-parseInt(_0x5a4d7f(0x98))/0x5*(parseInt(_0x5a4d7f(0x91))/0x6)+parseInt(_0x5a4d7f(0xb2))/0x7*(-parseInt(_0x5a4d7f(0xc0))/0x8)+-parseInt(_0x5a4d7f(0xc6))/0x9+-parseInt(_0x5a4d7f(0xa0))/0xa*(-parseInt(_0x5a4d7f(0xb8))/0xb);if(_0x58ba23===_0x289b32)break;else _0x1103d4['push'](_0x1103d4['shift']());}catch(_0x1726e1){_0x1103d4['push'](_0x1103d4['shift']());}}}(a42_0xed03,0x476a9));import{existsSync,statSync}from'fs';import a42_0x3950cd from'chalk';import{BaseCommand}from'./command.js';import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';function a42_0x5ed1(_0x35f384,_0x3c3599){_0x35f384=_0x35f384-0x91;const _0xed032c=a42_0xed03();let _0x5ed14e=_0xed032c[_0x35f384];return _0x5ed14e;}import{parsePath,normalizePath}from'../sdk/segment/segment-path-parser.js';import{findTdxConfig}from'../sdk/segment/tdx-config.js';export class SegmentUseCommand extends BaseCommand{[a42_0x1c0cdf(0xbf)]='segment:use';['description']=a42_0x1c0cdf(0x95);async[a42_0x1c0cdf(0x9a)](_0x2b9129){const _0x3e8d98=a42_0x1c0cdf,{options:_0x468e5f,args:_0x4e80cb,tdx:_0x5e6424}=_0x2b9129;if(_0x4e80cb['length']===0x0)return console['error'](a42_0x3950cd[_0x3e8d98(0xac)](_0x3e8d98(0x93))),console['error'](_0x3e8d98(0xc9)),console['error'](_0x3e8d98(0xa2)),console['error'](_0x3e8d98(0x94)),console[_0x3e8d98(0xab)](_0x3e8d98(0xc5)),console[_0x3e8d98(0xab)](_0x3e8d98(0xc1)),console[_0x3e8d98(0xab)](_0x3e8d98(0xa8)),0x1;const _0x1cf952=_0x4e80cb[0x0],_0x3545ce=_0x468e5f[_0x3e8d98(0xc8)];try{if(_0x1cf952==='/')return saveSessionContext({'segment_path':undefined},_0x3545ce),console[_0x3e8d98(0xbb)](a42_0x3950cd[_0x3e8d98(0x92)]('✔\x20Context\x20cleared.\x20Back\x20to\x20root.')),0x0;if(existsSync(_0x1cf952)&&statSync(_0x1cf952)['isDirectory']()){let _0x3f4b2b;try{_0x3f4b2b=findTdxConfig(_0x1cf952);}catch{return console[_0x3e8d98(0xab)](a42_0x3950cd[_0x3e8d98(0xac)](_0x3e8d98(0xa3)+_0x1cf952)),console[_0x3e8d98(0xab)](a42_0x3950cd[_0x3e8d98(0xae)](_0x3e8d98(0x99))),0x1;}const _0xd63bc9=_0x3f4b2b['config'][_0x3e8d98(0xb0)];return saveSessionContext({'segment_path':_0xd63bc9,'parent_segment':_0xd63bc9},_0x3545ce),console[_0x3e8d98(0xbb)](a42_0x3950cd[_0x3e8d98(0x92)](_0x3e8d98(0xb9)+a42_0x3950cd[_0x3e8d98(0xae)](_0xd63bc9))),0x0;}const _0x51941d=_0x468e5f[_0x3e8d98(0xc3)];let _0x2df6a3=_0x1cf952;const _0x87fcfa=parsePath(_0x1cf952);if(!_0x87fcfa[_0x3e8d98(0xb6)]){if(!_0x51941d)return console['error'](a42_0x3950cd[_0x3e8d98(0xac)]('Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.')),console[_0x3e8d98(0xab)](a42_0x3950cd[_0x3e8d98(0xae)](_0x3e8d98(0xcc))),0x1;if(_0x1cf952==='..'){const _0x164d2b=_0x51941d[_0x3e8d98(0xaa)]('/')[_0x3e8d98(0xca)](0x0,-0x1)[_0x3e8d98(0x9c)]('/');_0x2df6a3=_0x164d2b||'/';}else _0x1cf952==='.'?_0x2df6a3=_0x51941d:_0x2df6a3=_0x51941d+'/'+_0x1cf952;_0x468e5f[_0x3e8d98(0x9d)]&&console[_0x3e8d98(0xab)](_0x3e8d98(0x9f)+_0x2df6a3);}if(_0x2df6a3==='/'||_0x2df6a3==='')return saveSessionContext({'segment_path':undefined},_0x3545ce),console[_0x3e8d98(0xbb)](a42_0x3950cd[_0x3e8d98(0x92)](_0x3e8d98(0xc4))),0x0;_0x2df6a3=normalizePath(_0x2df6a3);const _0xe503f6=parsePath(_0x2df6a3)[_0x3e8d98(0xbc)];if(_0xe503f6[_0x3e8d98(0xb7)]===0x0)return saveSessionContext({'segment_path':undefined},_0x3545ce),console['log'](a42_0x3950cd[_0x3e8d98(0x92)](_0x3e8d98(0xc4))),0x0;_0x468e5f[_0x3e8d98(0x9d)]&&(console[_0x3e8d98(0xab)]('Site:\x20'+_0x468e5f[_0x3e8d98(0xa4)]),console['error'](_0x3e8d98(0xbe)+_0x2df6a3));const _0x17cd1a=await withSpinner(_0x3e8d98(0xb3)+_0x2df6a3+_0x3e8d98(0xc7),()=>_0x5e6424[_0x3e8d98(0xa5)][_0x3e8d98(0xcb)](_0x2df6a3),{'verbose':_0x468e5f['verbose']}),_0x3334a7=_0x17cd1a['data'];_0x468e5f[_0x3e8d98(0x9d)]&&(console[_0x3e8d98(0xab)]('Resolved\x20path\x20type:\x20'+_0x3334a7[_0x3e8d98(0x97)]),console[_0x3e8d98(0xab)](_0x3e8d98(0xa7)+_0x3334a7[_0x3e8d98(0xba)]),_0x3334a7[_0x3e8d98(0x9b)]&&console[_0x3e8d98(0xab)](_0x3e8d98(0xb5)+_0x3334a7[_0x3e8d98(0x9b)]));if(_0x3334a7[_0x3e8d98(0x97)]===_0x3e8d98(0xa5))return console[_0x3e8d98(0xab)](a42_0x3950cd[_0x3e8d98(0xac)](_0x3e8d98(0xa9))),console[_0x3e8d98(0xab)](_0x3e8d98(0xb4)),console[_0x3e8d98(0xab)](a42_0x3950cd[_0x3e8d98(0xae)](_0x3e8d98(0xcd)+_0x3334a7[_0x3e8d98(0xb1)]+(_0x3334a7[_0x3e8d98(0x9e)]?'/'+_0x3334a7[_0x3e8d98(0x9e)][_0x3e8d98(0x9c)]('/'):''))),0x1;return saveSessionContext({'segment_path':_0x3334a7[_0x3e8d98(0xbd)],'parent_segment':_0x3334a7[_0x3e8d98(0xb1)]},_0x3545ce),console[_0x3e8d98(0xbb)](a42_0x3950cd[_0x3e8d98(0x92)](_0x3e8d98(0xb9)+a42_0x3950cd[_0x3e8d98(0xae)](_0x3334a7[_0x3e8d98(0xbd)]))),_0x468e5f[_0x3e8d98(0x9d)]&&(console['error'](a42_0x3950cd[_0x3e8d98(0xc2)](_0x3e8d98(0xa1))),console[_0x3e8d98(0xab)](a42_0x3950cd[_0x3e8d98(0xc2)]('Use\x20\x22tdx\x20use\x22\x20to\x20see\x20all\x20context\x20parameters'))),0x0;}catch(_0x3848aa){throw _0x3848aa;}}}
@@ -1 +1 @@
1
- const a42_0x1dfb6c=a42_0x4224;(function(_0x29fc72,_0x555daf){const _0x39d02e=a42_0x4224,_0x1c95c9=_0x29fc72();while(!![]){try{const _0x2a3634=parseInt(_0x39d02e(0x17b))/0x1*(parseInt(_0x39d02e(0x185))/0x2)+-parseInt(_0x39d02e(0x155))/0x3+parseInt(_0x39d02e(0x17d))/0x4*(parseInt(_0x39d02e(0x15b))/0x5)+-parseInt(_0x39d02e(0x16a))/0x6*(parseInt(_0x39d02e(0x167))/0x7)+parseInt(_0x39d02e(0x184))/0x8*(parseInt(_0x39d02e(0x18a))/0x9)+parseInt(_0x39d02e(0x17a))/0xa+-parseInt(_0x39d02e(0x180))/0xb;if(_0x2a3634===_0x555daf)break;else _0x1c95c9['push'](_0x1c95c9['shift']());}catch(_0x5cc850){_0x1c95c9['push'](_0x1c95c9['shift']());}}}(a42_0x4edf,0x39c45));import{BaseCommand}from'./command.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';function a42_0x4edf(){const _0xaf921d=['filePath','red','hasErrors','Usage:\x20tdx\x20sg\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)','invalidCount','.yaml','type','execute','\x20warning(s)','\x20error(s)','green','1786950JWCepe','424530Gyllrn','yellow','4bSLeud','parentSegment','helpText','2379872NsWCkG','):\x20','no_parent','targetDir','857768VcNrrS','2SeyHhy','valid','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','warnings','cyan','9iROFGe','Validate\x20segment\x20and\x20journey\x20YAML\x20files','659535ZIJzlZ','\x20valid','errorCode','endsWith','dim','Error:\x20','1963050kiOzMz','message','length','file','Validation\x20failed:\x20','error','log','.yml','cwd','✔\x20All\x20','errors','segment:validate','14NKuvEe','name','\x20warning(s)\x20found','1290738mukJfc','validCount','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','verbose','warningCount'];a42_0x4edf=function(){return _0xaf921d;};return a42_0x4edf();}import{findYamlFiles}from'../sdk/segment/file-discovery.js';function a42_0x4224(_0x2e9299,_0x2a2b6a){_0x2e9299=_0x2e9299-0x154;const _0x4edf85=a42_0x4edf();let _0x422469=_0x4edf85[_0x2e9299];return _0x422469;}import{existsSync}from'fs';import a42_0x1aab21 from'chalk';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class SegmentValidateCommand extends BaseCommand{[a42_0x1dfb6c(0x168)]=a42_0x1dfb6c(0x166);['description']=a42_0x1dfb6c(0x154);async[a42_0x1dfb6c(0x176)](_0x820b34){const _0x3b19fb=a42_0x1dfb6c,{options:_0x45c2f6,args:_0x5c81dc}=_0x820b34,_0x1e84f7=_0x45c2f6,_0x35f295=await resolveTarget({'arg':_0x5c81dc[0x0],'contextParent':_0x45c2f6[_0x3b19fb(0x17e)],'cwd':process[_0x3b19fb(0x163)]()});if(!isSuccessfulResolution(_0x35f295))return _0x35f295[_0x3b19fb(0x157)]===_0x3b19fb(0x182)?(console[_0x3b19fb(0x160)](a42_0x1aab21[_0x3b19fb(0x17c)]('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console[_0x3b19fb(0x160)](_0x3b19fb(0x172)),console[_0x3b19fb(0x160)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20validate\x20.\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20current\x20directory'),console[_0x3b19fb(0x160)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file')):(console['error'](a42_0x1aab21[_0x3b19fb(0x170)](_0x3b19fb(0x15a)+_0x35f295[_0x3b19fb(0x15c)]+'\x0a')),_0x35f295[_0x3b19fb(0x17f)]&&console[_0x3b19fb(0x160)](a42_0x1aab21[_0x3b19fb(0x189)](_0x35f295[_0x3b19fb(0x17f)]))),0x1;const _0x2ea5a9=_0x35f295[_0x3b19fb(0x183)],_0x4d60e3=_0x35f295[_0x3b19fb(0x175)]===_0x3b19fb(0x15e)?_0x35f295[_0x3b19fb(0x16f)]:undefined;if(!_0x4d60e3&&!existsSync(_0x2ea5a9))return console['error'](a42_0x1aab21[_0x3b19fb(0x170)]('Error:\x20Directory\x20not\x20found:\x20'+_0x2ea5a9+'\x0a')),0x1;let _0x4b74dd;if(_0x4d60e3){if(!_0x4d60e3['endsWith'](_0x3b19fb(0x162))&&!_0x4d60e3[_0x3b19fb(0x158)](_0x3b19fb(0x174)))return console['error'](a42_0x1aab21['red'](_0x3b19fb(0x187)+_0x4d60e3+'\x0a')),0x1;_0x4b74dd=[_0x4d60e3];}else _0x4b74dd=findYamlFiles(_0x2ea5a9);if(_0x4b74dd['length']===0x0)return console[_0x3b19fb(0x160)](a42_0x1aab21[_0x3b19fb(0x170)](_0x3b19fb(0x16c)+_0x2ea5a9+'\x0a')),0x1;const _0x3e42aa=validateYamlFiles(_0x4b74dd,_0x2ea5a9),_0x54ed9f=calculateSummary(_0x3e42aa);for(const _0x5f3496 of _0x3e42aa){if(!isValidationResult(_0x5f3496))continue;const {relativePath:_0x3c513a,source:_0x1a99e6,result:_0xdf625c,fileType:_0x4b8965}=_0x5f3496,_0x3e1f4b=_0x4b8965;if(_0xdf625c[_0x3b19fb(0x186)]&&_0xdf625c[_0x3b19fb(0x188)][_0x3b19fb(0x15d)]===0x0)_0x1e84f7[_0x3b19fb(0x16d)]&&console[_0x3b19fb(0x161)](a42_0x1aab21[_0x3b19fb(0x179)]('✔\x20'+_0x3c513a)+a42_0x1aab21[_0x3b19fb(0x159)]('\x20('+_0x3e1f4b+')'));else _0xdf625c[_0x3b19fb(0x186)]?(console[_0x3b19fb(0x161)](a42_0x1aab21[_0x3b19fb(0x17c)]('⚠\x20'+_0x3c513a)+a42_0x1aab21[_0x3b19fb(0x159)]('\x20('+_0x3e1f4b+_0x3b19fb(0x181)+_0xdf625c[_0x3b19fb(0x188)][_0x3b19fb(0x15d)]+_0x3b19fb(0x177))),console[_0x3b19fb(0x161)](formatValidationResult(_0xdf625c,_0x1a99e6,_0x3c513a))):(console[_0x3b19fb(0x161)](a42_0x1aab21[_0x3b19fb(0x170)]('✖\x20'+_0x3c513a)+a42_0x1aab21[_0x3b19fb(0x159)]('\x20('+_0x3e1f4b+_0x3b19fb(0x181)+_0xdf625c[_0x3b19fb(0x165)]['length']+_0x3b19fb(0x178))),console[_0x3b19fb(0x161)](formatValidationResult(_0xdf625c,_0x1a99e6,_0x3c513a)));}return console[_0x3b19fb(0x161)](''),_0x54ed9f[_0x3b19fb(0x171)]?(console['log'](a42_0x1aab21[_0x3b19fb(0x170)](_0x3b19fb(0x15f)+_0x54ed9f[_0x3b19fb(0x173)]+'\x20file(s)\x20with\x20errors,\x20'+_0x54ed9f[_0x3b19fb(0x16b)]+_0x3b19fb(0x156))),_0x54ed9f['warningCount']>0x0&&console[_0x3b19fb(0x161)](a42_0x1aab21[_0x3b19fb(0x17c)](_0x54ed9f[_0x3b19fb(0x16e)]+_0x3b19fb(0x169))),0x1):(console[_0x3b19fb(0x161)](a42_0x1aab21[_0x3b19fb(0x179)](_0x3b19fb(0x164)+_0x54ed9f[_0x3b19fb(0x16b)]+'\x20file(s)\x20valid')),_0x54ed9f[_0x3b19fb(0x16e)]>0x0&&console[_0x3b19fb(0x161)](a42_0x1aab21['yellow'](_0x54ed9f['warningCount']+'\x20warning(s)\x20found')),0x0);}}
1
+ function a43_0x5b33(){const _0x114d6a=['\x20file(s)\x20with\x20errors,\x20','parentSegment','\x20error(s)','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','file','warningCount','type','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file','3280842jptQMg','yellow','134980WVDPIO','green','message','\x20warning(s)','265gLroBp','hasErrors','warnings','description','.yaml','invalidCount','18oEoWDw','3288144jZXJYy','cyan','\x20valid','valid','segment:validate','execute','43270180DylUBi','cwd','768726YwvODy','no_parent','8340689ySoXmK','Usage:\x20tdx\x20sg\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)','validCount','log','endsWith','\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','66644XFFUuE','):\x20','red','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','Validate\x20segment\x20and\x20journey\x20YAML\x20files','helpText','\x20warning(s)\x20found','dim','3boeeLz','error','Validation\x20failed:\x20','length','errors','Error:\x20'];a43_0x5b33=function(){return _0x114d6a;};return a43_0x5b33();}const a43_0x204ed2=a43_0x8236;(function(_0x2978e9,_0x581172){const _0x1c8623=a43_0x8236,_0x2afe1e=_0x2978e9();while(!![]){try{const _0x591bf1=parseInt(_0x1c8623(0xd7))/0x1+-parseInt(_0x1c8623(0xea))/0x2*(parseInt(_0x1c8623(0xc7))/0x3)+-parseInt(_0x1c8623(0xf2))/0x4*(parseInt(_0x1c8623(0xdb))/0x5)+-parseInt(_0x1c8623(0xd5))/0x6+-parseInt(_0x1c8623(0xec))/0x7+parseInt(_0x1c8623(0xe2))/0x8*(-parseInt(_0x1c8623(0xe1))/0x9)+parseInt(_0x1c8623(0xe8))/0xa;if(_0x591bf1===_0x581172)break;else _0x2afe1e['push'](_0x2afe1e['shift']());}catch(_0xfe79b4){_0x2afe1e['push'](_0x2afe1e['shift']());}}}(a43_0x5b33,0x9ad78));import{BaseCommand}from'./command.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';function a43_0x8236(_0x13c406,_0x194d06){_0x13c406=_0x13c406-0xc5;const _0x5b332c=a43_0x5b33();let _0x823687=_0x5b332c[_0x13c406];return _0x823687;}import{existsSync}from'fs';import a43_0x896f20 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{['name']=a43_0x204ed2(0xe6);[a43_0x204ed2(0xde)]=a43_0x204ed2(0xf6);async[a43_0x204ed2(0xe7)](_0x3f8ec5){const _0x58d565=a43_0x204ed2,{options:_0x5d6698,args:_0x2a9727}=_0x3f8ec5,_0x58bab2=_0x5d6698,_0x2edd2e=await resolveTarget({'arg':_0x2a9727[0x0],'contextParent':_0x5d6698[_0x58d565(0xce)],'cwd':process[_0x58d565(0xe9)]()});if(!isSuccessfulResolution(_0x2edd2e))return _0x2edd2e['errorCode']===_0x58d565(0xeb)?(console['error'](a43_0x896f20[_0x58d565(0xd6)]('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console[_0x58d565(0xc8)](_0x58d565(0xed)),console[_0x58d565(0xc8)](_0x58d565(0xf1)),console['error'](_0x58d565(0xd4))):(console[_0x58d565(0xc8)](a43_0x896f20[_0x58d565(0xf4)](_0x58d565(0xcc)+_0x2edd2e[_0x58d565(0xd9)]+'\x0a')),_0x2edd2e[_0x58d565(0xf7)]&&console[_0x58d565(0xc8)](a43_0x896f20[_0x58d565(0xe3)](_0x2edd2e[_0x58d565(0xf7)]))),0x1;const _0x166df4=_0x2edd2e['targetDir'],_0x466b2e=_0x2edd2e[_0x58d565(0xd3)]===_0x58d565(0xd1)?_0x2edd2e['filePath']:undefined;if(!_0x466b2e&&!existsSync(_0x166df4))return console['error'](a43_0x896f20[_0x58d565(0xf4)]('Error:\x20Directory\x20not\x20found:\x20'+_0x166df4+'\x0a')),0x1;let _0xbacfc0;if(_0x466b2e){if(!_0x466b2e[_0x58d565(0xf0)]('.yml')&&!_0x466b2e[_0x58d565(0xf0)](_0x58d565(0xdf)))return console[_0x58d565(0xc8)](a43_0x896f20[_0x58d565(0xf4)](_0x58d565(0xd0)+_0x466b2e+'\x0a')),0x1;_0xbacfc0=[_0x466b2e];}else _0xbacfc0=findYamlFiles(_0x166df4);if(_0xbacfc0['length']===0x0)return console['error'](a43_0x896f20['red'](_0x58d565(0xf5)+_0x166df4+'\x0a')),0x1;const _0x4e9939=validateYamlFiles(_0xbacfc0,_0x166df4),_0xf436cb=calculateSummary(_0x4e9939);for(const _0x5443cb of _0x4e9939){if(!isValidationResult(_0x5443cb))continue;const {relativePath:_0x19f4a8,source:_0x4a13c0,result:_0x4ac109,fileType:_0x2de7c9}=_0x5443cb,_0x5c726a=_0x2de7c9;if(_0x4ac109[_0x58d565(0xe5)]&&_0x4ac109[_0x58d565(0xdd)][_0x58d565(0xca)]===0x0)_0x58bab2['verbose']&&console[_0x58d565(0xef)](a43_0x896f20['green']('✔\x20'+_0x19f4a8)+a43_0x896f20[_0x58d565(0xc6)]('\x20('+_0x5c726a+')'));else _0x4ac109['valid']?(console[_0x58d565(0xef)](a43_0x896f20[_0x58d565(0xd6)]('⚠\x20'+_0x19f4a8)+a43_0x896f20[_0x58d565(0xc6)]('\x20('+_0x5c726a+_0x58d565(0xf3)+_0x4ac109[_0x58d565(0xdd)][_0x58d565(0xca)]+_0x58d565(0xda))),console[_0x58d565(0xef)](formatValidationResult(_0x4ac109,_0x4a13c0,_0x19f4a8))):(console[_0x58d565(0xef)](a43_0x896f20[_0x58d565(0xf4)]('✖\x20'+_0x19f4a8)+a43_0x896f20[_0x58d565(0xc6)]('\x20('+_0x5c726a+'):\x20'+_0x4ac109[_0x58d565(0xcb)]['length']+_0x58d565(0xcf))),console[_0x58d565(0xef)](formatValidationResult(_0x4ac109,_0x4a13c0,_0x19f4a8)));}return console[_0x58d565(0xef)](''),_0xf436cb[_0x58d565(0xdc)]?(console[_0x58d565(0xef)](a43_0x896f20['red'](_0x58d565(0xc9)+_0xf436cb[_0x58d565(0xe0)]+_0x58d565(0xcd)+_0xf436cb[_0x58d565(0xee)]+_0x58d565(0xe4))),_0xf436cb[_0x58d565(0xd2)]>0x0&&console[_0x58d565(0xef)](a43_0x896f20[_0x58d565(0xd6)](_0xf436cb[_0x58d565(0xd2)]+'\x20warning(s)\x20found')),0x1):(console[_0x58d565(0xef)](a43_0x896f20[_0x58d565(0xd8)]('✔\x20All\x20'+_0xf436cb[_0x58d565(0xee)]+'\x20file(s)\x20valid')),_0xf436cb[_0x58d565(0xd2)]>0x0&&console[_0x58d565(0xef)](a43_0x896f20[_0x58d565(0xd6)](_0xf436cb[_0x58d565(0xd2)]+_0x58d565(0xc5))),0x0);}}
@@ -1 +1 @@
1
- const a43_0x3b508=a43_0x1643;(function(_0x3d7c12,_0x4c77e3){const _0x285831=a43_0x1643,_0x2d19a5=_0x3d7c12();while(!![]){try{const _0x485332=-parseInt(_0x285831(0x117))/0x1+-parseInt(_0x285831(0x118))/0x2+-parseInt(_0x285831(0x130))/0x3*(parseInt(_0x285831(0x127))/0x4)+-parseInt(_0x285831(0x104))/0x5+parseInt(_0x285831(0x11c))/0x6*(-parseInt(_0x285831(0x143))/0x7)+-parseInt(_0x285831(0x124))/0x8+parseInt(_0x285831(0x105))/0x9*(parseInt(_0x285831(0x14b))/0xa);if(_0x485332===_0x4c77e3)break;else _0x2d19a5['push'](_0x2d19a5['shift']());}catch(_0x568d46){_0x2d19a5['push'](_0x2d19a5['shift']());}}}(a43_0x2abe,0x80f7d));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';function a43_0x1643(_0x20502c,_0x505463){_0x20502c=_0x20502c-0x102;const _0x2abeb0=a43_0x2abe();let _0x16434b=_0x2abeb0[_0x20502c];return _0x16434b;}import{withSpinner}from'../utils/spinner.js';function a43_0x2abe(){const _0x356121=['/j/da','Folder\x20ID:\x20','Site:\x20','dim','maxDepth','children','map','3220776BGylGA','length','No\x20items\x20match\x20pattern:\x20','8lgDrsT','Resolving\x20path\x20\x27','Folder/pattern\x20arg:\x20','\x20matching\x20\x27','segments','cause',',\x20and\x20','(not\x20set)','filter','1159941yOdokT','replace','error','listRecursive','journeyBundleName','Set\x20a\x20parent\x20segment\x20context\x20first:','List\x20folders\x20and\x20child\x20segments','message','sort','\x20\x20tdx\x20sg\x20use\x20\x22My\x20Audience\x22','/app/ps/','Recursive\x20mode:\x20enabled','log','\x20\x20Cause:\x20','Listing\x20folders,\x20segments,\x20and\x20journeys...','jsonl','folders','Error:\x20No\x20parent\x20segment\x20context\x20set.','\x27...','7XsXhxd','localeCompare','name','recursive','parentSegment','site','Parent\x20segment\x20context:\x20','execute','110duSYcm','Building\x20hierarchy\x20tree...','parentId','/e/','description','\x20segment','listWithPattern','includes','listUnifiedWithJourneys','journeys','3059810DNkcrg','2906991eFlMKa','\x20journey','journey','(empty)','Error:\x20','\x20folder','verbose','\x5c$&','Parent\x20ID:\x20','data','type','folderId','✔\x20Built\x20tree\x20with\x20','test','format',']\x20matching\x20\x27','segment','folder','426015osxZAh','979818rAWHYc','listUnified','\x20\x20tdx\x20sg\x20pull\x20\x22My\x20Audience\x22','resolvePathToResource','1925754onrLxa'];a43_0x2abe=function(){return _0x356121;};return a43_0x2abe();}import{formatFlatList,formatTree}from'../sdk/util/tree-formatter.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import a43_0x3826f4 from'chalk';export class SegmentsCommand extends BaseCommand{[a43_0x3b508(0x145)]=a43_0x3b508(0x12b);[a43_0x3b508(0x14f)]=a43_0x3b508(0x136);async[a43_0x3b508(0x14a)](_0x35ca68){const _0x16ce90=a43_0x3b508,{options:_0x5b983c,args:_0x128ab9}=_0x35ca68,_0x22a42f=_0x5b983c[_0x16ce90(0x146)],_0x68b1c5=_0x128ab9[0x0];try{const _0x143985=_0x5b983c[_0x16ce90(0x147)];_0x5b983c[_0x16ce90(0x10b)]&&(console[_0x16ce90(0x132)](_0x16ce90(0x11f)+_0x5b983c['site']),console['error'](_0x16ce90(0x149)+(_0x143985||_0x16ce90(0x12e))),_0x68b1c5&&console[_0x16ce90(0x132)](_0x16ce90(0x129)+_0x68b1c5),_0x22a42f&&console['error'](_0x16ce90(0x13b)));if(!_0x143985)return console[_0x16ce90(0x132)](_0x16ce90(0x141)),console[_0x16ce90(0x132)](''),console[_0x16ce90(0x132)](_0x16ce90(0x135)),console[_0x16ce90(0x132)](_0x16ce90(0x11a)),console[_0x16ce90(0x132)](_0x16ce90(0x139)),console[_0x16ce90(0x132)](''),console[_0x16ce90(0x132)]('Use\x20tdx\x20ps\x20list\x20to\x20see\x20available\x20parent\x20segments.'),0x1;const _0x4c64e8=_0x68b1c5&&(_0x68b1c5[_0x16ce90(0x152)]('*')||_0x68b1c5[_0x16ce90(0x152)]('?'));if(_0x4c64e8)return await this[_0x16ce90(0x151)](_0x35ca68,_0x143985,_0x68b1c5);const _0x279ef0=_0x68b1c5?_0x143985+'/'+_0x68b1c5:_0x143985;return _0x22a42f?await this[_0x16ce90(0x133)](_0x35ca68,_0x279ef0):await this[_0x16ce90(0x119)](_0x35ca68,_0x279ef0);}catch(_0x1305fb){if(_0x1305fb instanceof SDKError)return console[_0x16ce90(0x132)](_0x16ce90(0x109)+_0x1305fb[_0x16ce90(0x137)]),_0x1305fb[_0x16ce90(0x12c)]&&console['error'](_0x16ce90(0x13d)+_0x1305fb[_0x16ce90(0x12c)]),0x1;throw _0x1305fb;}}async[a43_0x3b508(0x151)](_0x2842bf,_0x461fb1,_0x3aea21){const _0x144ab0=a43_0x3b508,{options:_0x66cc03,tdx:_0x63c162}=_0x2842bf,_0x4c57e1=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x461fb1+_0x144ab0(0x142),()=>_0x63c162['segment'][_0x144ab0(0x11b)](_0x461fb1),{'verbose':_0x66cc03[_0x144ab0(0x10b)]}),_0x5ab779=_0x4c57e1['data'],_0x499dfb=await withSpinner(_0x144ab0(0x13e),()=>_0x63c162[_0x144ab0(0x115)][_0x144ab0(0x102)](_0x5ab779[_0x144ab0(0x14d)],_0x5ab779[_0x144ab0(0x110)]),{'verbose':_0x66cc03[_0x144ab0(0x10b)]}),{folders:_0x4f6ff2,segments:_0x4c099f,journeys:_0x24db71}=_0x499dfb['data'],_0x1b977c=_0x3aea21[_0x144ab0(0x131)](/[.+^${}()|[\]\\]/g,_0x144ab0(0x10c))[_0x144ab0(0x131)](/\*/g,'.*')['replace'](/\?/g,'.'),_0x3fd7ac=new RegExp('^'+_0x1b977c+'$','i'),_0x44f4d8=_0x4f6ff2[_0x144ab0(0x12f)](_0x4d92ea=>_0x3fd7ac[_0x144ab0(0x112)](_0x4d92ea[_0x144ab0(0x145)])),_0x10352c=_0x4c099f['filter'](_0x575366=>_0x3fd7ac[_0x144ab0(0x112)](_0x575366[_0x144ab0(0x145)])),_0x35ff57=_0x24db71['filter'](_0x2446d9=>_0x3fd7ac[_0x144ab0(0x112)](_0x2446d9[_0x144ab0(0x134)])),_0xa499b4=_0x44f4d8[_0x144ab0(0x125)]+_0x10352c[_0x144ab0(0x125)]+_0x35ff57[_0x144ab0(0x125)];console[_0x144ab0(0x132)]('✔\x20Found\x20'+_0x44f4d8[_0x144ab0(0x125)]+'\x20folder'+(_0x44f4d8['length']!==0x1?'s':'')+',\x20'+_0x10352c[_0x144ab0(0x125)]+_0x144ab0(0x150)+(_0x10352c[_0x144ab0(0x125)]!==0x1?'s':'')+_0x144ab0(0x12d)+_0x35ff57[_0x144ab0(0x125)]+'\x20journey'+(_0x35ff57['length']!==0x1?'s':'')+_0x144ab0(0x12a)+_0x3aea21+'\x27');const _0x20bd4e=_0x48ab66=>{const _0x3a3c22=_0x144ab0;return getConsoleNextUrl(_0x66cc03[_0x3a3c22(0x148)],_0x3a3c22(0x13a)+_0x5ab779[_0x3a3c22(0x14d)]+'/e/'+_0x48ab66);},_0x3de353=_0x66cc03[_0x144ab0(0x113)]==='json'||_0x66cc03[_0x144ab0(0x113)]===_0x144ab0(0x13f);if(_0x3de353){const _0x2c0607=[..._0x44f4d8[_0x144ab0(0x123)](_0x4dc4e1=>({..._0x4dc4e1,'type':_0x144ab0(0x116)})),..._0x10352c[_0x144ab0(0x123)](_0xb7cae8=>({..._0xb7cae8,'type':_0x144ab0(0x115),'url':_0x20bd4e(_0xb7cae8['id'])})),..._0x35ff57['map'](_0x45532a=>({..._0x45532a,'name':_0x45532a['journeyBundleName'],'type':_0x144ab0(0x107)}))]['sort']((_0x321546,_0x522339)=>_0x321546['name'][_0x144ab0(0x144)](_0x522339[_0x144ab0(0x145)]));await handleSDKOutput(_0x2c0607,_0x66cc03);}else{if(_0xa499b4===0x0)console['log'](_0x144ab0(0x126)+_0x3aea21);else{console[_0x144ab0(0x13c)](a43_0x3826f4[_0x144ab0(0x120)]('['+_0x461fb1+_0x144ab0(0x114)+_0x3aea21+'\x27'));const _0x2f2f70=formatFlatList(_0x44f4d8,_0x10352c,{'showMetadata':!![],'getSegmentUrl':_0x20bd4e},_0x35ff57);console['log'](_0x2f2f70);}}return 0x0;}async[a43_0x3b508(0x119)](_0x428b55,_0x4b5014){const _0x41ac6d=a43_0x3b508,{options:_0x196e72,tdx:_0x2b3a4a}=_0x428b55,_0x587f80=await withSpinner('Resolving\x20path\x20\x27'+_0x4b5014+_0x41ac6d(0x142),()=>_0x2b3a4a[_0x41ac6d(0x115)][_0x41ac6d(0x11b)](_0x4b5014),{'verbose':_0x196e72[_0x41ac6d(0x10b)]}),_0x195d46=_0x587f80[_0x41ac6d(0x10e)];_0x196e72['verbose']&&(console[_0x41ac6d(0x132)](_0x41ac6d(0x10d)+_0x195d46[_0x41ac6d(0x14d)]),_0x195d46['folderId']&&console[_0x41ac6d(0x132)](_0x41ac6d(0x11e)+_0x195d46['folderId']));const _0x1aee6e=await withSpinner(_0x41ac6d(0x13e),()=>_0x2b3a4a[_0x41ac6d(0x115)][_0x41ac6d(0x102)](_0x195d46[_0x41ac6d(0x14d)],_0x195d46[_0x41ac6d(0x110)]),{'verbose':_0x196e72[_0x41ac6d(0x10b)]}),{folders:_0x41bc1f,segments:_0x42f6fc,journeys:_0x4b8b38}=_0x1aee6e[_0x41ac6d(0x10e)],_0x24d042=_0x41bc1f[_0x41ac6d(0x125)]+_0x42f6fc[_0x41ac6d(0x125)]+_0x4b8b38[_0x41ac6d(0x125)];console[_0x41ac6d(0x132)]('✔\x20Found\x20'+_0x41bc1f[_0x41ac6d(0x125)]+_0x41ac6d(0x10a)+(_0x41bc1f[_0x41ac6d(0x125)]!==0x1?'s':'')+',\x20'+_0x42f6fc[_0x41ac6d(0x125)]+'\x20segment'+(_0x42f6fc[_0x41ac6d(0x125)]!==0x1?'s':'')+_0x41ac6d(0x12d)+_0x4b8b38['length']+_0x41ac6d(0x106)+(_0x4b8b38[_0x41ac6d(0x125)]!==0x1?'s':''));const _0x442a22=_0x33184e=>{const _0x2ad470=_0x41ac6d;return getConsoleNextUrl(_0x196e72[_0x2ad470(0x148)],_0x2ad470(0x13a)+_0x195d46[_0x2ad470(0x14d)]+_0x2ad470(0x14e)+_0x33184e);},_0x1285d9=_0x148b75=>{const _0x49e421=_0x41ac6d;return getConsoleNextUrl(_0x196e72[_0x49e421(0x148)],_0x49e421(0x13a)+_0x195d46[_0x49e421(0x14d)]+_0x49e421(0x14e)+_0x148b75+'/j/da');},_0x4bfa2c=_0x196e72[_0x41ac6d(0x113)]==='json'||_0x196e72[_0x41ac6d(0x113)]===_0x41ac6d(0x13f);if(_0x4bfa2c){const _0x7abd78=[..._0x41bc1f['map'](_0x5a612c=>({..._0x5a612c,'type':_0x41ac6d(0x116)})),..._0x42f6fc[_0x41ac6d(0x123)](_0x259493=>({..._0x259493,'type':_0x41ac6d(0x115),'url':_0x442a22(_0x259493['id'])})),..._0x4b8b38['map'](_0x1f4549=>({..._0x1f4549,'name':_0x1f4549[_0x41ac6d(0x134)],'type':_0x41ac6d(0x107),'url':_0x1285d9(_0x1f4549['id'])}))][_0x41ac6d(0x138)]((_0x517cd6,_0x453a55)=>_0x517cd6[_0x41ac6d(0x145)][_0x41ac6d(0x144)](_0x453a55[_0x41ac6d(0x145)]));await handleSDKOutput(_0x7abd78,_0x196e72);}else{if(_0x24d042===0x0)console[_0x41ac6d(0x13c)](a43_0x3826f4[_0x41ac6d(0x120)]('['+_0x4b5014+']')),console[_0x41ac6d(0x13c)](_0x41ac6d(0x108));else{console[_0x41ac6d(0x13c)](a43_0x3826f4[_0x41ac6d(0x120)]('['+_0x4b5014+']'));const _0x895eef=formatFlatList(_0x41bc1f,_0x42f6fc,{'showMetadata':!![],'getSegmentUrl':_0x442a22,'getJourneyUrl':_0x1285d9},_0x4b8b38);console['log'](_0x895eef);}}return 0x0;}async[a43_0x3b508(0x133)](_0x1e93c1,_0x36f1eb){const _0x4a5cc5=a43_0x3b508,{options:_0x58a167,tdx:_0x3a467f}=_0x1e93c1,_0x2a32df=await withSpinner(_0x4a5cc5(0x128)+_0x36f1eb+_0x4a5cc5(0x142),()=>_0x3a467f[_0x4a5cc5(0x115)][_0x4a5cc5(0x11b)](_0x36f1eb),{'verbose':_0x58a167[_0x4a5cc5(0x10b)]}),_0x246d95=_0x2a32df[_0x4a5cc5(0x10e)];_0x58a167[_0x4a5cc5(0x10b)]&&(console[_0x4a5cc5(0x132)](_0x4a5cc5(0x10d)+_0x246d95[_0x4a5cc5(0x14d)]),_0x246d95[_0x4a5cc5(0x110)]&&console[_0x4a5cc5(0x132)](_0x4a5cc5(0x11e)+_0x246d95[_0x4a5cc5(0x110)]));const _0x4bae36=_0x58a167[_0x4a5cc5(0x121)]||0xa,_0x231da3=await withSpinner(_0x4a5cc5(0x14c),()=>_0x3a467f['segment'][_0x4a5cc5(0x133)](_0x246d95['parentId'],_0x246d95['folderId'],0x0,_0x4bae36),{'verbose':_0x58a167[_0x4a5cc5(0x10b)]}),_0x26e1b7=_0x231da3[_0x4a5cc5(0x10e)],_0x4cf8bc=_0x7d4225=>{const _0x53c86f=_0x4a5cc5;let _0x306448=0x0,_0x2a71e1=0x0,_0x16ee12=0x0;for(const _0x3cbd0a of _0x7d4225){if(_0x3cbd0a[_0x53c86f(0x10f)]===_0x53c86f(0x116))_0x306448++;else{if(_0x3cbd0a['type']==='segment')_0x2a71e1++;else{if(_0x3cbd0a[_0x53c86f(0x10f)]===_0x53c86f(0x107))_0x16ee12++;}}if(_0x3cbd0a[_0x53c86f(0x122)]){const _0x34f1aa=_0x4cf8bc(_0x3cbd0a['children']);_0x306448+=_0x34f1aa[_0x53c86f(0x140)],_0x2a71e1+=_0x34f1aa['segments'],_0x16ee12+=_0x34f1aa[_0x53c86f(0x103)];}}return{'folders':_0x306448,'segments':_0x2a71e1,'journeys':_0x16ee12};},_0x890247=_0x4cf8bc(_0x26e1b7);console[_0x4a5cc5(0x132)](_0x4a5cc5(0x111)+_0x890247[_0x4a5cc5(0x140)]+_0x4a5cc5(0x10a)+(_0x890247[_0x4a5cc5(0x140)]!==0x1?'s':'')+',\x20'+_0x890247[_0x4a5cc5(0x12b)]+_0x4a5cc5(0x150)+(_0x890247[_0x4a5cc5(0x12b)]!==0x1?'s':'')+_0x4a5cc5(0x12d)+_0x890247[_0x4a5cc5(0x103)]+_0x4a5cc5(0x106)+(_0x890247[_0x4a5cc5(0x103)]!==0x1?'s':''));const _0x20cf47=_0x488525=>{const _0x3d95d1=_0x4a5cc5;return getConsoleNextUrl(_0x58a167[_0x3d95d1(0x148)],_0x3d95d1(0x13a)+_0x246d95[_0x3d95d1(0x14d)]+_0x3d95d1(0x14e)+_0x488525);},_0x5dfa66=_0x3b6ab7=>{const _0x578849=_0x4a5cc5;return getConsoleNextUrl(_0x58a167[_0x578849(0x148)],_0x578849(0x13a)+_0x246d95[_0x578849(0x14d)]+'/e/'+_0x3b6ab7+_0x578849(0x11d));};if(_0x58a167[_0x4a5cc5(0x113)]==='json'||_0x58a167[_0x4a5cc5(0x113)]===_0x4a5cc5(0x13f))await handleSDKOutput(_0x26e1b7,_0x58a167);else{console['log'](a43_0x3826f4[_0x4a5cc5(0x120)]('['+_0x36f1eb+']'));const _0x398a56=formatTree(_0x26e1b7,{'showMetadata':!![],'getSegmentUrl':_0x20cf47,'getJourneyUrl':_0x5dfa66});console['log'](_0x398a56);}return 0x0;}}
1
+ const a44_0x48886d=a44_0xf27c;(function(_0x4c0fc6,_0x56bb99){const _0x55eba4=a44_0xf27c,_0x144552=_0x4c0fc6();while(!![]){try{const _0x130c71=-parseInt(_0x55eba4(0x1ef))/0x1+parseInt(_0x55eba4(0x1d6))/0x2+-parseInt(_0x55eba4(0x1c2))/0x3+-parseInt(_0x55eba4(0x1e4))/0x4+parseInt(_0x55eba4(0x1eb))/0x5*(-parseInt(_0x55eba4(0x1f1))/0x6)+parseInt(_0x55eba4(0x1e7))/0x7*(-parseInt(_0x55eba4(0x1d9))/0x8)+-parseInt(_0x55eba4(0x1b7))/0x9*(-parseInt(_0x55eba4(0x1c8))/0xa);if(_0x130c71===_0x56bb99)break;else _0x144552['push'](_0x144552['shift']());}catch(_0x34e71e){_0x144552['push'](_0x144552['shift']());}}}(a44_0x3787,0xc3703));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';function a44_0xf27c(_0x8c1349,_0x20aaa7){_0x8c1349=_0x8c1349-0x1b3;const _0x37876b=a44_0x3787();let _0xf27c4d=_0x37876b[_0x8c1349];return _0xf27c4d;}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_0x3787(){const _0x291359=['type','localeCompare','104EMuluK','folders','\x27...','List\x20folders\x20and\x20child\x20segments','replace','Parent\x20segment\x20context:\x20','\x20\x20Cause:\x20','Resolving\x20path\x20\x27','children','sort','journeys','899972BsZiSQ','/j/da','/app/ps/','342181tEjMxU','Error:\x20No\x20parent\x20segment\x20context\x20set.','\x5c$&','dim','290yIJtUg','error','jsonl','Recursive\x20mode:\x20enabled','367847mdKuoF','format','98778pipEiN','Folder\x20ID:\x20','Resolving\x20parent\x20segment\x20\x27','folder','✔\x20Built\x20tree\x20with\x20','recursive','parentId','(empty)','listRecursive','site','json','Listing\x20folders,\x20segments,\x20and\x20journeys...','journeyBundleName','/e/','message','verbose','resolvePathToResource','\x20matching\x20\x27',']\x20matching\x20\x27','✔\x20Found\x20','listUnified','folderId','2907bqYBGS','filter','map','length','Parent\x20ID:\x20','Error:\x20','parentSegment','Site:\x20','data','cause','\x20folder','4634646ywjqfw','includes','\x20journey','\x20segment',',\x20and\x20','\x20\x20tdx\x20sg\x20use\x20\x22My\x20Audience\x22','113530ZOFpES','description','Set\x20a\x20parent\x20segment\x20context\x20first:','segment','Building\x20hierarchy\x20tree...','maxDepth','name','log','listUnifiedWithJourneys','execute','segments','test','journey','Use\x20tdx\x20ps\x20list\x20to\x20see\x20available\x20parent\x20segments.','1723102uXGWrf'];a44_0x3787=function(){return _0x291359;};return a44_0x3787();}import a44_0x389449 from'chalk';export class SegmentsCommand extends BaseCommand{[a44_0x48886d(0x1ce)]=a44_0x48886d(0x1d2);[a44_0x48886d(0x1c9)]=a44_0x48886d(0x1dc);async[a44_0x48886d(0x1d1)](_0x79e02f){const _0x500d83=a44_0x48886d,{options:_0x1639b1,args:_0x15a18a}=_0x79e02f,_0x1da925=_0x1639b1[_0x500d83(0x1f6)],_0x3f6179=_0x15a18a[0x0];try{const _0x361515=_0x1639b1[_0x500d83(0x1bd)];_0x1639b1[_0x500d83(0x200)]&&(console[_0x500d83(0x1ec)](_0x500d83(0x1be)+_0x1639b1['site']),console[_0x500d83(0x1ec)](_0x500d83(0x1de)+(_0x361515||'(not\x20set)')),_0x3f6179&&console[_0x500d83(0x1ec)]('Folder/pattern\x20arg:\x20'+_0x3f6179),_0x1da925&&console[_0x500d83(0x1ec)](_0x500d83(0x1ee)));if(!_0x361515)return console[_0x500d83(0x1ec)](_0x500d83(0x1e8)),console[_0x500d83(0x1ec)](''),console[_0x500d83(0x1ec)](_0x500d83(0x1ca)),console[_0x500d83(0x1ec)]('\x20\x20tdx\x20sg\x20pull\x20\x22My\x20Audience\x22'),console[_0x500d83(0x1ec)](_0x500d83(0x1c7)),console['error'](''),console[_0x500d83(0x1ec)](_0x500d83(0x1d5)),0x1;const _0x5820ce=_0x3f6179&&(_0x3f6179['includes']('*')||_0x3f6179[_0x500d83(0x1c3)]('?'));if(_0x5820ce)return await this['listWithPattern'](_0x79e02f,_0x361515,_0x3f6179);const _0x11659d=_0x3f6179?_0x361515+'/'+_0x3f6179:_0x361515;return _0x1da925?await this[_0x500d83(0x1f9)](_0x79e02f,_0x11659d):await this['listUnified'](_0x79e02f,_0x11659d);}catch(_0xfbbbb6){if(_0xfbbbb6 instanceof SDKError)return console['error'](_0x500d83(0x1bc)+_0xfbbbb6[_0x500d83(0x1ff)]),_0xfbbbb6[_0x500d83(0x1c0)]&&console[_0x500d83(0x1ec)](_0x500d83(0x1df)+_0xfbbbb6['cause']),0x1;throw _0xfbbbb6;}}async['listWithPattern'](_0x537057,_0x59f588,_0x1fa38b){const _0x2d77cd=a44_0x48886d,{options:_0xa60b16,tdx:_0x574614}=_0x537057,_0x97ae0f=await withSpinner(_0x2d77cd(0x1f3)+_0x59f588+'\x27...',()=>_0x574614[_0x2d77cd(0x1cb)]['resolvePathToResource'](_0x59f588),{'verbose':_0xa60b16[_0x2d77cd(0x200)]}),_0x21c457=_0x97ae0f[_0x2d77cd(0x1bf)],_0x367714=await withSpinner(_0x2d77cd(0x1fc),()=>_0x574614[_0x2d77cd(0x1cb)][_0x2d77cd(0x1d0)](_0x21c457['parentId'],_0x21c457[_0x2d77cd(0x1b6)]),{'verbose':_0xa60b16[_0x2d77cd(0x200)]}),{folders:_0x406df,segments:_0x64ede6,journeys:_0x57db63}=_0x367714[_0x2d77cd(0x1bf)],_0x3b00f4=_0x1fa38b[_0x2d77cd(0x1dd)](/[.+^${}()|[\]\\]/g,_0x2d77cd(0x1e9))['replace'](/\*/g,'.*')[_0x2d77cd(0x1dd)](/\?/g,'.'),_0x5152f6=new RegExp('^'+_0x3b00f4+'$','i'),_0xfc0f3e=_0x406df[_0x2d77cd(0x1b8)](_0x181aba=>_0x5152f6[_0x2d77cd(0x1d3)](_0x181aba[_0x2d77cd(0x1ce)])),_0x4c6892=_0x64ede6[_0x2d77cd(0x1b8)](_0x26cd57=>_0x5152f6[_0x2d77cd(0x1d3)](_0x26cd57[_0x2d77cd(0x1ce)])),_0x454fd6=_0x57db63[_0x2d77cd(0x1b8)](_0x1a30a6=>_0x5152f6[_0x2d77cd(0x1d3)](_0x1a30a6[_0x2d77cd(0x1fd)])),_0x1c1e8e=_0xfc0f3e['length']+_0x4c6892[_0x2d77cd(0x1ba)]+_0x454fd6[_0x2d77cd(0x1ba)];console[_0x2d77cd(0x1ec)](_0x2d77cd(0x1b4)+_0xfc0f3e[_0x2d77cd(0x1ba)]+_0x2d77cd(0x1c1)+(_0xfc0f3e[_0x2d77cd(0x1ba)]!==0x1?'s':'')+',\x20'+_0x4c6892[_0x2d77cd(0x1ba)]+_0x2d77cd(0x1c5)+(_0x4c6892[_0x2d77cd(0x1ba)]!==0x1?'s':'')+_0x2d77cd(0x1c6)+_0x454fd6[_0x2d77cd(0x1ba)]+_0x2d77cd(0x1c4)+(_0x454fd6[_0x2d77cd(0x1ba)]!==0x1?'s':'')+_0x2d77cd(0x202)+_0x1fa38b+'\x27');const _0x505d46=_0x27b415=>{const _0x409b71=_0x2d77cd;return getConsoleNextUrl(_0xa60b16[_0x409b71(0x1fa)],_0x409b71(0x1e6)+_0x21c457[_0x409b71(0x1f7)]+_0x409b71(0x1fe)+_0x27b415);},_0x311d86=_0xa60b16[_0x2d77cd(0x1f0)]===_0x2d77cd(0x1fb)||_0xa60b16['format']===_0x2d77cd(0x1ed);if(_0x311d86){const _0x10f243=[..._0xfc0f3e['map'](_0x5e24c4=>({..._0x5e24c4,'type':_0x2d77cd(0x1f4)})),..._0x4c6892[_0x2d77cd(0x1b9)](_0x419ac4=>({..._0x419ac4,'type':_0x2d77cd(0x1cb),'url':_0x505d46(_0x419ac4['id'])})),..._0x454fd6[_0x2d77cd(0x1b9)](_0x308ef6=>({..._0x308ef6,'name':_0x308ef6[_0x2d77cd(0x1fd)],'type':_0x2d77cd(0x1d4)}))][_0x2d77cd(0x1e2)]((_0x4e36d8,_0x8339ba)=>_0x4e36d8[_0x2d77cd(0x1ce)][_0x2d77cd(0x1d8)](_0x8339ba[_0x2d77cd(0x1ce)]));await handleSDKOutput(_0x10f243,_0xa60b16);}else{if(_0x1c1e8e===0x0)console[_0x2d77cd(0x1cf)]('No\x20items\x20match\x20pattern:\x20'+_0x1fa38b);else{console['log'](a44_0x389449[_0x2d77cd(0x1ea)]('['+_0x59f588+_0x2d77cd(0x1b3)+_0x1fa38b+'\x27'));const _0x4fc96e=formatFlatList(_0xfc0f3e,_0x4c6892,{'showMetadata':!![],'getSegmentUrl':_0x505d46},_0x454fd6);console['log'](_0x4fc96e);}}return 0x0;}async[a44_0x48886d(0x1b5)](_0xe8b3f0,_0x277634){const _0x41d16f=a44_0x48886d,{options:_0x7d2dce,tdx:_0x53f67b}=_0xe8b3f0,_0xe5a65d=await withSpinner('Resolving\x20path\x20\x27'+_0x277634+_0x41d16f(0x1db),()=>_0x53f67b['segment']['resolvePathToResource'](_0x277634),{'verbose':_0x7d2dce[_0x41d16f(0x200)]}),_0x4a9276=_0xe5a65d[_0x41d16f(0x1bf)];_0x7d2dce[_0x41d16f(0x200)]&&(console[_0x41d16f(0x1ec)](_0x41d16f(0x1bb)+_0x4a9276[_0x41d16f(0x1f7)]),_0x4a9276['folderId']&&console[_0x41d16f(0x1ec)](_0x41d16f(0x1f2)+_0x4a9276['folderId']));const _0xc4f1e2=await withSpinner(_0x41d16f(0x1fc),()=>_0x53f67b[_0x41d16f(0x1cb)][_0x41d16f(0x1d0)](_0x4a9276['parentId'],_0x4a9276[_0x41d16f(0x1b6)]),{'verbose':_0x7d2dce[_0x41d16f(0x200)]}),{folders:_0x369a6a,segments:_0x55143e,journeys:_0x5ec205}=_0xc4f1e2[_0x41d16f(0x1bf)],_0x1b7a21=_0x369a6a[_0x41d16f(0x1ba)]+_0x55143e[_0x41d16f(0x1ba)]+_0x5ec205[_0x41d16f(0x1ba)];console[_0x41d16f(0x1ec)]('✔\x20Found\x20'+_0x369a6a[_0x41d16f(0x1ba)]+'\x20folder'+(_0x369a6a[_0x41d16f(0x1ba)]!==0x1?'s':'')+',\x20'+_0x55143e[_0x41d16f(0x1ba)]+_0x41d16f(0x1c5)+(_0x55143e[_0x41d16f(0x1ba)]!==0x1?'s':'')+',\x20and\x20'+_0x5ec205[_0x41d16f(0x1ba)]+_0x41d16f(0x1c4)+(_0x5ec205[_0x41d16f(0x1ba)]!==0x1?'s':''));const _0x210215=_0xeab791=>{const _0x42c72f=_0x41d16f;return getConsoleNextUrl(_0x7d2dce[_0x42c72f(0x1fa)],_0x42c72f(0x1e6)+_0x4a9276['parentId']+'/e/'+_0xeab791);},_0x18ff11=_0x435731=>{const _0x1494dc=_0x41d16f;return getConsoleNextUrl(_0x7d2dce[_0x1494dc(0x1fa)],_0x1494dc(0x1e6)+_0x4a9276[_0x1494dc(0x1f7)]+_0x1494dc(0x1fe)+_0x435731+_0x1494dc(0x1e5));},_0x35b7d1=_0x7d2dce['format']===_0x41d16f(0x1fb)||_0x7d2dce[_0x41d16f(0x1f0)]==='jsonl';if(_0x35b7d1){const _0x1e3db6=[..._0x369a6a[_0x41d16f(0x1b9)](_0x2eaa4c=>({..._0x2eaa4c,'type':_0x41d16f(0x1f4)})),..._0x55143e['map'](_0x2e0fb1=>({..._0x2e0fb1,'type':_0x41d16f(0x1cb),'url':_0x210215(_0x2e0fb1['id'])})),..._0x5ec205[_0x41d16f(0x1b9)](_0x1266fa=>({..._0x1266fa,'name':_0x1266fa[_0x41d16f(0x1fd)],'type':_0x41d16f(0x1d4),'url':_0x18ff11(_0x1266fa['id'])}))][_0x41d16f(0x1e2)]((_0x589fee,_0x46bb64)=>_0x589fee[_0x41d16f(0x1ce)]['localeCompare'](_0x46bb64[_0x41d16f(0x1ce)]));await handleSDKOutput(_0x1e3db6,_0x7d2dce);}else{if(_0x1b7a21===0x0)console[_0x41d16f(0x1cf)](a44_0x389449[_0x41d16f(0x1ea)]('['+_0x277634+']')),console[_0x41d16f(0x1cf)](_0x41d16f(0x1f8));else{console[_0x41d16f(0x1cf)](a44_0x389449['dim']('['+_0x277634+']'));const _0x2508b4=formatFlatList(_0x369a6a,_0x55143e,{'showMetadata':!![],'getSegmentUrl':_0x210215,'getJourneyUrl':_0x18ff11},_0x5ec205);console[_0x41d16f(0x1cf)](_0x2508b4);}}return 0x0;}async['listRecursive'](_0x4de7e5,_0x1c49c9){const _0x16f79b=a44_0x48886d,{options:_0x14b734,tdx:_0x45215c}=_0x4de7e5,_0x45e7a2=await withSpinner(_0x16f79b(0x1e0)+_0x1c49c9+_0x16f79b(0x1db),()=>_0x45215c[_0x16f79b(0x1cb)][_0x16f79b(0x201)](_0x1c49c9),{'verbose':_0x14b734[_0x16f79b(0x200)]}),_0x51b679=_0x45e7a2[_0x16f79b(0x1bf)];_0x14b734[_0x16f79b(0x200)]&&(console[_0x16f79b(0x1ec)](_0x16f79b(0x1bb)+_0x51b679[_0x16f79b(0x1f7)]),_0x51b679[_0x16f79b(0x1b6)]&&console[_0x16f79b(0x1ec)](_0x16f79b(0x1f2)+_0x51b679[_0x16f79b(0x1b6)]));const _0x14b699=_0x14b734[_0x16f79b(0x1cd)]||0xa,_0x1b08c2=await withSpinner(_0x16f79b(0x1cc),()=>_0x45215c[_0x16f79b(0x1cb)][_0x16f79b(0x1f9)](_0x51b679[_0x16f79b(0x1f7)],_0x51b679['folderId'],0x0,_0x14b699),{'verbose':_0x14b734[_0x16f79b(0x200)]}),_0x54201b=_0x1b08c2['data'],_0x323e92=_0x33f43d=>{const _0x2584c1=_0x16f79b;let _0x32af3f=0x0,_0x352ba9=0x0,_0x225ee8=0x0;for(const _0xcda32b of _0x33f43d){if(_0xcda32b[_0x2584c1(0x1d7)]===_0x2584c1(0x1f4))_0x32af3f++;else{if(_0xcda32b[_0x2584c1(0x1d7)]===_0x2584c1(0x1cb))_0x352ba9++;else{if(_0xcda32b[_0x2584c1(0x1d7)]===_0x2584c1(0x1d4))_0x225ee8++;}}if(_0xcda32b['children']){const _0x164dbb=_0x323e92(_0xcda32b[_0x2584c1(0x1e1)]);_0x32af3f+=_0x164dbb[_0x2584c1(0x1da)],_0x352ba9+=_0x164dbb[_0x2584c1(0x1d2)],_0x225ee8+=_0x164dbb[_0x2584c1(0x1e3)];}}return{'folders':_0x32af3f,'segments':_0x352ba9,'journeys':_0x225ee8};},_0x27bfff=_0x323e92(_0x54201b);console[_0x16f79b(0x1ec)](_0x16f79b(0x1f5)+_0x27bfff[_0x16f79b(0x1da)]+'\x20folder'+(_0x27bfff['folders']!==0x1?'s':'')+',\x20'+_0x27bfff[_0x16f79b(0x1d2)]+_0x16f79b(0x1c5)+(_0x27bfff[_0x16f79b(0x1d2)]!==0x1?'s':'')+_0x16f79b(0x1c6)+_0x27bfff['journeys']+_0x16f79b(0x1c4)+(_0x27bfff['journeys']!==0x1?'s':''));const _0x16d3d1=_0x4e19e2=>{const _0x5a3ffa=_0x16f79b;return getConsoleNextUrl(_0x14b734[_0x5a3ffa(0x1fa)],_0x5a3ffa(0x1e6)+_0x51b679['parentId']+_0x5a3ffa(0x1fe)+_0x4e19e2);},_0x496cab=_0xb37d33=>{const _0xcc59c8=_0x16f79b;return getConsoleNextUrl(_0x14b734[_0xcc59c8(0x1fa)],_0xcc59c8(0x1e6)+_0x51b679[_0xcc59c8(0x1f7)]+_0xcc59c8(0x1fe)+_0xb37d33+'/j/da');};if(_0x14b734[_0x16f79b(0x1f0)]===_0x16f79b(0x1fb)||_0x14b734['format']===_0x16f79b(0x1ed))await handleSDKOutput(_0x54201b,_0x14b734);else{console[_0x16f79b(0x1cf)](a44_0x389449[_0x16f79b(0x1ea)]('['+_0x1c49c9+']'));const _0x4b859e=formatTree(_0x54201b,{'showMetadata':!![],'getSegmentUrl':_0x16d3d1,'getJourneyUrl':_0x496cab});console[_0x16f79b(0x1cf)](_0x4b859e);}return 0x0;}}
@@ -1 +1 @@
1
- const a44_0x57b848=a44_0x597d;(function(_0x89d8b1,_0x3b20ef){const _0x42cb83=a44_0x597d,_0x5ca496=_0x89d8b1();while(!![]){try{const _0x1fa3f0=-parseInt(_0x42cb83(0x1ba))/0x1+parseInt(_0x42cb83(0x1a6))/0x2*(-parseInt(_0x42cb83(0x19a))/0x3)+parseInt(_0x42cb83(0x1bd))/0x4*(-parseInt(_0x42cb83(0x1c0))/0x5)+-parseInt(_0x42cb83(0x1a1))/0x6+-parseInt(_0x42cb83(0x1b4))/0x7+parseInt(_0x42cb83(0x19b))/0x8*(parseInt(_0x42cb83(0x1a3))/0x9)+parseInt(_0x42cb83(0x1ae))/0xa;if(_0x1fa3f0===_0x3b20ef)break;else _0x5ca496['push'](_0x5ca496['shift']());}catch(_0x2a6d80){_0x5ca496['push'](_0x5ca496['shift']());}}}(a44_0x1a34,0xcc288));function a44_0x1a34(){const _0x538f54=['\x20\x20Cause:\x20','2673282zWUJMM','data','297ZEmOuc','✔\x20Query\x20successful\x20-\x200\x20rows\x20returned','Too\x20many\x20arguments\x0aUsage:\x20tdx\x20show\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>\x0a\x0aRun\x20\x27tdx\x20show\x20--help\x27\x20for\x20more\x20options','3009794axqZAz','\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>','Site:\x20','site','✔\x20Retrieved\x20','verbose','\x20row','\x20from\x20','61001960WLNEkJ','showTable','length','args','limit','database','4539059NmhNJN','Limit:\x20','Database:\x20','Usage:\x20tdx\x20show\x20<database.table>','cause','validate','1650750HdXVNL','name','Error:\x20','24BZmPOd','execute','Querying\x20','1270895EpyTIy','table','Catalog:\x20','\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>','description','3bTjAPf','123816UbTqSe','...','error','query','Usage:\x20tdx\x20show\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--in\x20<database>\x0a\x0aRun\x20\x27tdx\x20show\x20--help\x27\x20for\x20more\x20options'];a44_0x1a34=function(){return _0x538f54;};return a44_0x1a34();}import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';function a44_0x597d(_0x7a72f0,_0xbde5ed){_0x7a72f0=_0x7a72f0-0x19a;const _0x1a347a=a44_0x1a34();let _0x597da3=_0x1a347a[_0x7a72f0];return _0x597da3;}import{handleSDKOutput}from'../core/command-output.js';import{parseTableReference,validateTableDescribeReference}from'../utils/table-ref-parser.js';import{withSpinner}from'../utils/spinner.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';export class ShowCommand extends BaseCommand{[a44_0x57b848(0x1bb)]='show';[a44_0x57b848(0x1c4)]='Show\x20table\x20contents';async[a44_0x57b848(0x1be)](_0x124e58){return this['showTable'](_0x124e58);}async[a44_0x57b848(0x1af)](_0x545d9f){const _0xdd031=a44_0x57b848,{options:_0x50b4f9,args:_0x441057,tdx:_0x57eb32}=_0x545d9f;let _0x56ddea;try{_0x56ddea=parseTableReference(_0x441057[0x0]);const _0x44db8b=_0x50b4f9['database'];!_0x56ddea['database']&&_0x44db8b&&(_0x56ddea[_0xdd031(0x1b3)]=_0x44db8b);const _0x21d45a=validateTableDescribeReference(_0x56ddea);if(_0x21d45a)return console[_0xdd031(0x19d)](_0xdd031(0x1bc)+_0x21d45a),console[_0xdd031(0x19d)](_0xdd031(0x1b7)),console[_0xdd031(0x19d)](_0xdd031(0x1a7)),console[_0xdd031(0x19d)]('\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>'),0x1;}catch(_0x55d849){return console[_0xdd031(0x19d)](_0xdd031(0x1bc)+_0x55d849['message']),console[_0xdd031(0x19d)](_0xdd031(0x1b7)),console[_0xdd031(0x19d)](_0xdd031(0x1a7)),console['error'](_0xdd031(0x1c3)),0x1;}const _0x1ecceb=_0x56ddea['catalog'],_0x532d58=_0x56ddea[_0xdd031(0x1b3)],_0x5b465c=_0x56ddea[_0xdd031(0x1c1)],_0x5ca10b=resolveLimit(_0x50b4f9[_0xdd031(0x1b2)],DEFAULT_DISPLAY_LIMIT);try{_0x50b4f9[_0xdd031(0x1ab)]&&(console[_0xdd031(0x19d)](_0xdd031(0x1a8)+_0x50b4f9[_0xdd031(0x1a9)]),_0x1ecceb&&console[_0xdd031(0x19d)](_0xdd031(0x1c2)+_0x1ecceb),console[_0xdd031(0x19d)](_0xdd031(0x1b6)+_0x532d58),console[_0xdd031(0x19d)]('Table:\x20'+_0x5b465c),console[_0xdd031(0x19d)](_0xdd031(0x1b5)+_0x5ca10b));const _0x4dd7b9=_0x1ecceb?_0x1ecceb+'.'+_0x532d58+'.'+_0x5b465c:_0x532d58+'.'+_0x5b465c,_0x182884=await withSpinner(_0xdd031(0x1bf)+_0x4dd7b9+_0xdd031(0x19c),()=>_0x57eb32[_0xdd031(0x19e)][_0xdd031(0x1af)](_0x532d58,_0x5b465c,_0x5ca10b,_0x1ecceb),{'verbose':_0x50b4f9['verbose']}),_0x5ca9f8=_0x182884[_0xdd031(0x1a2)],_0x585056=_0x5ca9f8[_0xdd031(0x1a2)];return _0x585056['length']===0x0?console['error'](_0xdd031(0x1a4)):console[_0xdd031(0x19d)](_0xdd031(0x1aa)+_0x585056[_0xdd031(0x1b0)]+_0xdd031(0x1ac)+(_0x585056[_0xdd031(0x1b0)]!==0x1?'s':'')+_0xdd031(0x1ad)+_0x4dd7b9),await handleSDKOutput(_0x585056,_0x50b4f9),0x0;}catch(_0x20de22){if(_0x20de22 instanceof SDKError)return console[_0xdd031(0x19d)](_0xdd031(0x1bc)+_0x20de22['message']),_0x20de22[_0xdd031(0x1b8)]&&console['error'](_0xdd031(0x1a0)+_0x20de22[_0xdd031(0x1b8)]),0x1;throw _0x20de22;}}[a44_0x57b848(0x1b9)](_0x430985){const _0x16f397=a44_0x57b848;if(_0x430985[_0x16f397(0x1b1)][_0x16f397(0x1b0)]===0x0)return _0x16f397(0x19f);if(_0x430985[_0x16f397(0x1b1)][_0x16f397(0x1b0)]>0x1)return _0x16f397(0x1a5);return undefined;}}
1
+ function a45_0xf405(_0x3dcc4a,_0x4b11e5){_0x3dcc4a=_0x3dcc4a-0x11e;const _0x515335=a45_0x5153();let _0xf4054c=_0x515335[_0x3dcc4a];return _0xf4054c;}const a45_0xb03ed=a45_0xf405;(function(_0xa20b0,_0x46cb40){const _0x46360b=a45_0xf405,_0x3073ac=_0xa20b0();while(!![]){try{const _0x4c55c8=-parseInt(_0x46360b(0x12b))/0x1+parseInt(_0x46360b(0x12d))/0x2*(parseInt(_0x46360b(0x134))/0x3)+-parseInt(_0x46360b(0x141))/0x4+parseInt(_0x46360b(0x133))/0x5+-parseInt(_0x46360b(0x13b))/0x6*(parseInt(_0x46360b(0x123))/0x7)+parseInt(_0x46360b(0x132))/0x8+parseInt(_0x46360b(0x130))/0x9*(parseInt(_0x46360b(0x127))/0xa);if(_0x4c55c8===_0x46cb40)break;else _0x3073ac['push'](_0x3073ac['shift']());}catch(_0x3b702b){_0x3073ac['push'](_0x3073ac['shift']());}}}(a45_0x5153,0x223ac));function a45_0x5153(){const _0x51890f=['\x20row','228155HZmDjh','args','39580ihaEbf','site','Show\x20table\x20contents','42165ycTWuz','table','1073992SwVULL','815475GrSoRr','15oitYHZ','showTable','verbose','\x20\x20Cause:\x20','query','✔\x20Query\x20successful\x20-\x200\x20rows\x20returned','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','12SsOlWy','length','execute','Site:\x20','Database:\x20','Limit:\x20','587792UXZfcx','✔\x20Retrieved\x20','error','Error:\x20','\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>','validate','data','description','message','Table:\x20','\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>','452522RnPugf','cause','Usage:\x20tdx\x20show\x20<database.table>','Querying\x20','530aWxuZP','Catalog:\x20','database'];a45_0x5153=function(){return _0x51890f;};return a45_0x5153();}import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';import{parseTableReference,validateTableDescribeReference}from'../utils/table-ref-parser.js';import{withSpinner}from'../utils/spinner.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';export class ShowCommand extends BaseCommand{['name']='show';[a45_0xb03ed(0x11f)]=a45_0xb03ed(0x12f);async[a45_0xb03ed(0x13d)](_0x25500f){const _0x530e46=a45_0xb03ed;return this[_0x530e46(0x135)](_0x25500f);}async['showTable'](_0x479061){const _0x3423d1=a45_0xb03ed,{options:_0xb5d837,args:_0x3ba0ee,tdx:_0x3ef6ea}=_0x479061;let _0x38071d;try{_0x38071d=parseTableReference(_0x3ba0ee[0x0]);const _0x3eed67=_0xb5d837[_0x3423d1(0x129)];!_0x38071d[_0x3423d1(0x129)]&&_0x3eed67&&(_0x38071d[_0x3423d1(0x129)]=_0x3eed67);const _0x1fa544=validateTableDescribeReference(_0x38071d);if(_0x1fa544)return console['error'](_0x3423d1(0x144)+_0x1fa544),console['error']('Usage:\x20tdx\x20show\x20<database.table>'),console['error']('\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>'),console[_0x3423d1(0x143)](_0x3423d1(0x122)),0x1;}catch(_0x263390){return console[_0x3423d1(0x143)](_0x3423d1(0x144)+_0x263390['message']),console[_0x3423d1(0x143)](_0x3423d1(0x125)),console[_0x3423d1(0x143)](_0x3423d1(0x145)),console[_0x3423d1(0x143)](_0x3423d1(0x122)),0x1;}const _0x446107=_0x38071d['catalog'],_0x5d7fb7=_0x38071d[_0x3423d1(0x129)],_0x2845dc=_0x38071d[_0x3423d1(0x131)],_0x5e3f99=resolveLimit(_0xb5d837['limit'],DEFAULT_DISPLAY_LIMIT);try{_0xb5d837[_0x3423d1(0x136)]&&(console[_0x3423d1(0x143)](_0x3423d1(0x13e)+_0xb5d837[_0x3423d1(0x12e)]),_0x446107&&console['error'](_0x3423d1(0x128)+_0x446107),console[_0x3423d1(0x143)](_0x3423d1(0x13f)+_0x5d7fb7),console[_0x3423d1(0x143)](_0x3423d1(0x121)+_0x2845dc),console[_0x3423d1(0x143)](_0x3423d1(0x140)+_0x5e3f99));const _0x425394=_0x446107?_0x446107+'.'+_0x5d7fb7+'.'+_0x2845dc:_0x5d7fb7+'.'+_0x2845dc,_0x23e7c5=await withSpinner(_0x3423d1(0x126)+_0x425394+'...',()=>_0x3ef6ea[_0x3423d1(0x138)][_0x3423d1(0x135)](_0x5d7fb7,_0x2845dc,_0x5e3f99,_0x446107),{'verbose':_0xb5d837[_0x3423d1(0x136)]}),_0x2d12ef=_0x23e7c5[_0x3423d1(0x11e)],_0x44b72d=_0x2d12ef[_0x3423d1(0x11e)];return _0x44b72d[_0x3423d1(0x13c)]===0x0?console[_0x3423d1(0x143)](_0x3423d1(0x139)):console[_0x3423d1(0x143)](_0x3423d1(0x142)+_0x44b72d[_0x3423d1(0x13c)]+_0x3423d1(0x12a)+(_0x44b72d[_0x3423d1(0x13c)]!==0x1?'s':'')+'\x20from\x20'+_0x425394),await handleSDKOutput(_0x44b72d,_0xb5d837),0x0;}catch(_0x39a77a){if(_0x39a77a instanceof SDKError)return console[_0x3423d1(0x143)](_0x3423d1(0x144)+_0x39a77a[_0x3423d1(0x120)]),_0x39a77a[_0x3423d1(0x124)]&&console[_0x3423d1(0x143)](_0x3423d1(0x137)+_0x39a77a[_0x3423d1(0x124)]),0x1;throw _0x39a77a;}}[a45_0xb03ed(0x146)](_0x5588c8){const _0x2e943e=a45_0xb03ed;if(_0x5588c8['args'][_0x2e943e(0x13c)]===0x0)return _0x2e943e(0x13a);if(_0x5588c8[_0x2e943e(0x12c)][_0x2e943e(0x13c)]>0x1)return'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';return undefined;}}
@@ -1 +1 @@
1
- const a45_0x5cd667=a45_0x54b6;(function(_0x514c18,_0x5794e1){const _0x580e75=a45_0x54b6,_0x243e17=_0x514c18();while(!![]){try{const _0x112e1f=-parseInt(_0x580e75(0xa8))/0x1*(-parseInt(_0x580e75(0xc7))/0x2)+parseInt(_0x580e75(0xb6))/0x3+-parseInt(_0x580e75(0xc3))/0x4*(parseInt(_0x580e75(0xd1))/0x5)+-parseInt(_0x580e75(0xcb))/0x6+-parseInt(_0x580e75(0xc1))/0x7*(parseInt(_0x580e75(0xd8))/0x8)+-parseInt(_0x580e75(0xb7))/0x9+parseInt(_0x580e75(0xce))/0xa;if(_0x112e1f===_0x5794e1)break;else _0x243e17['push'](_0x243e17['shift']());}catch(_0x5d14ad){_0x243e17['push'](_0x243e17['shift']());}}}(a45_0x4e0f,0x5bf5f));import{BaseCommand,printAuthError}from'./command.js';import{resolveAPIKeyAsync}from'../core/config.js';import{getOAuthTokens}from'../core/oauth-keychain.js';import{HTTPClientError}from'../sdk/client/http-client.js';function a45_0x54b6(_0x1a4d2d,_0x5d8468){_0x1a4d2d=_0x1a4d2d-0xa5;const _0x4e0fc3=a45_0x4e0f();let _0x54b6fd=_0x4e0fc3[_0x1a4d2d];return _0x54b6fd;}import{GlobalContext}from'../core/global-context.js';import a45_0xc67129 from'chalk';function a45_0x4e0f(){const _0x5d6c24=['getUserInfo','env','\x20profile:\x20','35LRRHpu','jobs','944236heYkjl','profileSource','Name:','displayWithSources','834630ybrUnN','filter','Credential\x20type:\x20','bold','1595688pPIDnP','cli','No\x20credential\x20found','11606140Kjwzgp','Read\x20credential\x20from\x20','name','10FljiRQ','(from\x20','site:\x20','execute','red','tdx','last_name','153776NNGUwe','message','email','description','1uDfdXr','CLI\x20flag','N/A','error','config','first_name','yellow','cyan','green','Show\x20authentication\x20status\x20and\x20current\x20context','✓\x20Authentication\x20successful\x0a','✗\x20Validation\x20failed:\x20','join','account_id','445146gaqsnk','4639176OzrnQK','profile','log','OAuth','site','Account\x20ID:','dim'];a45_0x4e0f=function(){return _0x5d6c24;};return a45_0x4e0f();}export class StatusCommand extends BaseCommand{[a45_0x5cd667(0xd0)]='status';[a45_0x5cd667(0xa7)]=a45_0x5cd667(0xb1);async[a45_0x5cd667(0xd4)](_0x327cf8){const _0x41771e=a45_0x5cd667,{options:_0x3b72c3,tdx:_0x4fb141}=_0x327cf8,_0x233109=_0x3b72c3[_0x41771e(0xbb)],_0x1db1b0=new GlobalContext(_0x3b72c3),_0x36e020=_0x1db1b0[_0x41771e(0xb8)],_0x403047=_0x1db1b0[_0x41771e(0xc4)],_0x4f2ca4=_0x403047===_0x41771e(0xcc)?_0x41771e(0xa9):_0x403047==='session'?'session':_0x403047===_0x41771e(0xbf)?'TDX_PROFILE\x20env':_0x403047===_0x41771e(0xac)?_0x41771e(0xac):null,_0xca07fc=_0x36e020?a45_0xc67129[_0x41771e(0xaf)](_0x36e020):a45_0xc67129[_0x41771e(0xbd)](_0x41771e(0xaa)),_0x3be454=_0x4f2ca4?'\x20'+a45_0xc67129['dim'](_0x41771e(0xd2)+_0x4f2ca4+')'):'';console[_0x41771e(0xb9)](a45_0xc67129['bold'](_0x41771e(0xd6))+_0x41771e(0xc0)+_0xca07fc+_0x3be454+'\x20'+a45_0xc67129['dim']('(')+_0x41771e(0xd3)+a45_0xc67129[_0x41771e(0xaf)](_0x233109)+a45_0xc67129['dim'](')'));const _0x2a8102=await getOAuthTokens(_0x36e020);if(_0x2a8102)console[_0x41771e(0xb9)](_0x41771e(0xc9)+a45_0xc67129[_0x41771e(0xaf)](_0x41771e(0xba)));else{const _0x2db8a9=await resolveAPIKeyAsync(_0x233109,_0x36e020);if(_0x2db8a9){const {source:_0x45130a,isDeprecated:_0x5e6c45}=_0x2db8a9,_0x29e732=_0x41771e(0xcf)+a45_0xc67129['cyan'](_0x45130a);console[_0x41771e(0xb9)](_0x5e6c45?a45_0xc67129[_0x41771e(0xae)](_0x29e732):_0x29e732);}else console[_0x41771e(0xb9)](a45_0xc67129[_0x41771e(0xae)](_0x41771e(0xcd)));}let _0x217e07=![];try{const _0x138b60=await _0x4fb141[_0x41771e(0xc2)][_0x41771e(0xbe)]();console[_0x41771e(0xb9)](a45_0xc67129[_0x41771e(0xb0)](_0x41771e(0xb2))),console[_0x41771e(0xb9)](a45_0xc67129[_0x41771e(0xca)]('User:')+'\x20'+a45_0xc67129['cyan'](_0x138b60[_0x41771e(0xa6)]));if(_0x138b60[_0x41771e(0xad)]||_0x138b60[_0x41771e(0xd7)]){const _0x4d717a=[_0x138b60[_0x41771e(0xad)],_0x138b60['last_name']][_0x41771e(0xc8)](Boolean)[_0x41771e(0xb4)]('\x20');console[_0x41771e(0xb9)](a45_0xc67129[_0x41771e(0xca)](_0x41771e(0xc5))+'\x20'+_0x4d717a);}_0x138b60[_0x41771e(0xb5)]&&console['log'](a45_0xc67129['bold'](_0x41771e(0xbc))+'\x20'+a45_0xc67129[_0x41771e(0xae)](_0x138b60['account_id'])),_0x217e07=!![];}catch(_0x469908){_0x469908 instanceof HTTPClientError&&_0x469908['status']===0x191?printAuthError(_0x469908,!![],_0x36e020):console[_0x41771e(0xab)](a45_0xc67129[_0x41771e(0xd5)](_0x41771e(0xb3)+(_0x469908 instanceof Error?_0x469908[_0x41771e(0xa5)]:String(_0x469908))));}return console[_0x41771e(0xb9)](),_0x1db1b0[_0x41771e(0xc6)](),_0x217e07?0x0:0x1;}}
1
+ function a46_0x1e5e(){const _0x3ece49=['10BLEdzp','TDX_PROFILE\x20env','33LUnNAW','Account\x20ID:','198898qkOkFj','jobs','session','profileSource','3782yGCjBw','execute','status','N/A','last_name','bold','dim','profile','cli','account_id','cyan','581000HBwdZy','7909ybHktX','User:','site:\x20','tdx','log','getUserInfo','displayWithSources','Name:','✓\x20Authentication\x20successful\x0a','env','CLI\x20flag','12yrTjdV','yellow','Show\x20authentication\x20status\x20and\x20current\x20context','512756SGddva','4572yzTbfY','No\x20credential\x20found','join','92570WshpnT','\x20profile:\x20','9zepTJb','306514czGmOB','green','red','first_name','Credential\x20type:\x20','✗\x20Validation\x20failed:\x20','config'];a46_0x1e5e=function(){return _0x3ece49;};return a46_0x1e5e();}const a46_0x16af0a=a46_0x106c;(function(_0xf73757,_0x19c8ae){const _0x33a760=a46_0x106c,_0x1984f4=_0xf73757();while(!![]){try{const _0x341ea2=parseInt(_0x33a760(0x1e9))/0x1+parseInt(_0x33a760(0x1c8))/0x2*(-parseInt(_0x33a760(0x1c2))/0x3)+parseInt(_0x33a760(0x1e2))/0x4*(-parseInt(_0x33a760(0x1c0))/0x5)+-parseInt(_0x33a760(0x1df))/0x6*(parseInt(_0x33a760(0x1c4))/0x7)+-parseInt(_0x33a760(0x1d3))/0x8+-parseInt(_0x33a760(0x1e8))/0x9*(parseInt(_0x33a760(0x1e6))/0xa)+-parseInt(_0x33a760(0x1d4))/0xb*(-parseInt(_0x33a760(0x1e3))/0xc);if(_0x341ea2===_0x19c8ae)break;else _0x1984f4['push'](_0x1984f4['shift']());}catch(_0x3af66b){_0x1984f4['push'](_0x1984f4['shift']());}}}(a46_0x1e5e,0x282d4));function a46_0x106c(_0x2366ea,_0x54f615){_0x2366ea=_0x2366ea-0x1be;const _0x1e5e7a=a46_0x1e5e();let _0x106c5b=_0x1e5e7a[_0x2366ea];return _0x106c5b;}import{BaseCommand,printAuthError}from'./command.js';import{resolveAPIKeyAsync}from'../core/config.js';import{getOAuthTokens}from'../core/oauth-keychain.js';import{HTTPClientError}from'../sdk/client/http-client.js';import{GlobalContext}from'../core/global-context.js';import a46_0x3a5289 from'chalk';export class StatusCommand extends BaseCommand{['name']=a46_0x16af0a(0x1ca);['description']=a46_0x16af0a(0x1e1);async[a46_0x16af0a(0x1c9)](_0x572495){const _0x24072a=a46_0x16af0a,{options:_0x16b744,tdx:_0x45e19a}=_0x572495,_0x2614d5=_0x16b744['site'],_0xab5135=new GlobalContext(_0x16b744),_0x31218a=_0xab5135[_0x24072a(0x1cf)],_0x15d81a=_0xab5135[_0x24072a(0x1c7)],_0x1bcab3=_0x15d81a===_0x24072a(0x1d0)?_0x24072a(0x1de):_0x15d81a===_0x24072a(0x1c6)?_0x24072a(0x1c6):_0x15d81a===_0x24072a(0x1dd)?_0x24072a(0x1c1):_0x15d81a===_0x24072a(0x1bf)?_0x24072a(0x1bf):null,_0x36332a=_0x31218a?a46_0x3a5289['cyan'](_0x31218a):a46_0x3a5289['dim'](_0x24072a(0x1cb)),_0x472a98=_0x1bcab3?'\x20'+a46_0x3a5289[_0x24072a(0x1ce)]('(from\x20'+_0x1bcab3+')'):'';console[_0x24072a(0x1d8)](a46_0x3a5289[_0x24072a(0x1cd)](_0x24072a(0x1d7))+_0x24072a(0x1e7)+_0x36332a+_0x472a98+'\x20'+a46_0x3a5289['dim']('(')+_0x24072a(0x1d6)+a46_0x3a5289[_0x24072a(0x1d2)](_0x2614d5)+a46_0x3a5289[_0x24072a(0x1ce)](')'));const _0x3e8132=await getOAuthTokens(_0x31218a);if(_0x3e8132)console[_0x24072a(0x1d8)](_0x24072a(0x1ed)+a46_0x3a5289[_0x24072a(0x1d2)]('OAuth'));else{const _0x445ed4=await resolveAPIKeyAsync(_0x2614d5,_0x31218a);if(_0x445ed4){const {source:_0x329694,isDeprecated:_0x497df8}=_0x445ed4,_0x1a0bed='Read\x20credential\x20from\x20'+a46_0x3a5289[_0x24072a(0x1d2)](_0x329694);console[_0x24072a(0x1d8)](_0x497df8?a46_0x3a5289[_0x24072a(0x1e0)](_0x1a0bed):_0x1a0bed);}else console[_0x24072a(0x1d8)](a46_0x3a5289['yellow'](_0x24072a(0x1e4)));}let _0xe8e3a3=![];try{const _0x5d2301=await _0x45e19a[_0x24072a(0x1c5)][_0x24072a(0x1d9)]();console[_0x24072a(0x1d8)](a46_0x3a5289[_0x24072a(0x1ea)](_0x24072a(0x1dc))),console[_0x24072a(0x1d8)](a46_0x3a5289[_0x24072a(0x1cd)](_0x24072a(0x1d5))+'\x20'+a46_0x3a5289[_0x24072a(0x1d2)](_0x5d2301['email']));if(_0x5d2301['first_name']||_0x5d2301[_0x24072a(0x1cc)]){const _0x311682=[_0x5d2301[_0x24072a(0x1ec)],_0x5d2301[_0x24072a(0x1cc)]]['filter'](Boolean)[_0x24072a(0x1e5)]('\x20');console[_0x24072a(0x1d8)](a46_0x3a5289[_0x24072a(0x1cd)](_0x24072a(0x1db))+'\x20'+_0x311682);}_0x5d2301[_0x24072a(0x1d1)]&&console[_0x24072a(0x1d8)](a46_0x3a5289[_0x24072a(0x1cd)](_0x24072a(0x1c3))+'\x20'+a46_0x3a5289[_0x24072a(0x1e0)](_0x5d2301[_0x24072a(0x1d1)])),_0xe8e3a3=!![];}catch(_0x361f71){_0x361f71 instanceof HTTPClientError&&_0x361f71['status']===0x191?printAuthError(_0x361f71,!![],_0x31218a):console['error'](a46_0x3a5289[_0x24072a(0x1eb)](_0x24072a(0x1be)+(_0x361f71 instanceof Error?_0x361f71['message']:String(_0x361f71))));}return console[_0x24072a(0x1d8)](),_0xab5135[_0x24072a(0x1da)](),_0xe8e3a3?0x0:0x1;}}
@@ -1 +1 @@
1
- const a46_0x26214=a46_0x295b;(function(_0x12a58a,_0xb33fd7){const _0x26530f=a46_0x295b,_0xbc7d13=_0x12a58a();while(!![]){try{const _0x1a5931=parseInt(_0x26530f(0xc5))/0x1*(-parseInt(_0x26530f(0xcf))/0x2)+-parseInt(_0x26530f(0xce))/0x3+-parseInt(_0x26530f(0xda))/0x4*(-parseInt(_0x26530f(0xe2))/0x5)+-parseInt(_0x26530f(0xc4))/0x6*(parseInt(_0x26530f(0xde))/0x7)+parseInt(_0x26530f(0xd6))/0x8*(-parseInt(_0x26530f(0xc6))/0x9)+parseInt(_0x26530f(0xe0))/0xa+parseInt(_0x26530f(0xbe))/0xb;if(_0x1a5931===_0xb33fd7)break;else _0xbc7d13['push'](_0xbc7d13['shift']());}catch(_0xc62f87){_0xbc7d13['push'](_0xbc7d13['shift']());}}}(a46_0x4fb7,0x473ed));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput,isStructuredFormat}from'../core/command-output.js';import{parseTableReference}from'../utils/table-ref-parser.js';import{DEFAULT_LISTING_LIMIT,resolveLimit}from'../core/constants.js';import{withSpinner}from'../utils/spinner.js';function a46_0x4fb7(){const _0x4463c1=['\x20\x20tdx\x20tables\x20users\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20across\x20all\x20databases','683811ZqIhFY','2mBYWji','✔\x20Found\x20','📋\x20','\x20\x20Or:\x20\x20tdx\x20tables\x20--in\x20','Did\x20you\x20mean\x20to\x20list\x20all\x20tables\x20from\x20database\x20\x27','✖\x20No\x20tables\x20found','includes','8aGrQRB','query','database','verbose','751864lUMGHR','cause','\x20\x20Use:\x20tdx\x20tables\x20\x22','\x20\x20tdx\x20tables\x20\x22mydb.*\x22\x20\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb','2737819vbIANf','Or\x20use\x20--in\x20flag:','711150QUFsBA','database_name','15qkcnlP','Table\x20pattern:\x20','\x20\x20tdx\x20tables\x20--in\x20mydb\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb','log','\x27\x20without\x20wildcards\x20would\x20search\x20for\x20tables\x20named\x20\x27','message','length','Error:\x20','\x27\x20is\x20ambiguous.','Error:\x20Pattern\x20\x27','table','name','11376112COnpVF','Error:\x20Too\x20many\x20arguments.\x20Use\x20single\x20argument:','site','Database:\x20','error','List\x20tables\x20in\x20a\x20database','6yLjXXH','427609qddbRy','2976489TSqqgi','\x27\x20may\x20not\x20exist\x20or\x20contains\x20no\x20tables','validate','Site:\x20','\x20\x20Cause:\x20','data','Note:\x20\x27'];a46_0x4fb7=function(){return _0x4463c1;};return a46_0x4fb7();}function a46_0x295b(_0x15fd64,_0x117d7b){_0x15fd64=_0x15fd64-0xbb;const _0x4fb791=a46_0x4fb7();let _0x295b0a=_0x4fb791[_0x15fd64];return _0x295b0a;}export class TablesCommand extends BaseCommand{[a46_0x26214(0xbd)]='tables';['description']=a46_0x26214(0xc3);async['execute'](_0x35b77e){const _0x4886cb=a46_0x26214,{options:_0x5231d9,args:_0x45e610,tdx:_0x84efce}=_0x35b77e;let _0x44eba6;if(_0x45e610['length']===0x0)_0x44eba6={'database':undefined,'table':undefined,'original':''};else{if(_0x45e610['length']===0x1)try{_0x44eba6=parseTableReference(_0x45e610[0x0]);if(_0x44eba6[_0x4886cb(0xbc)]&&!_0x44eba6[_0x4886cb(0xd8)]&&!_0x44eba6[_0x4886cb(0xbc)][_0x4886cb(0xd5)]('*')&&!_0x44eba6[_0x4886cb(0xbc)]['includes']('?'))return console[_0x4886cb(0xc2)](_0x4886cb(0xbb)+_0x45e610[0x0]+_0x4886cb(0xea)),console[_0x4886cb(0xc2)](_0x4886cb(0xd3)+_0x44eba6[_0x4886cb(0xbc)]+'\x27?'),console[_0x4886cb(0xc2)](_0x4886cb(0xdc)+_0x44eba6[_0x4886cb(0xbc)]+'.*\x22'),console[_0x4886cb(0xc2)](_0x4886cb(0xd2)+_0x44eba6['table']),console[_0x4886cb(0xc2)]('\x20\x20Or:\x20\x20tdx\x20tables\x20--database\x20'+_0x44eba6[_0x4886cb(0xbc)]),console[_0x4886cb(0xc2)](''),console[_0x4886cb(0xc2)](_0x4886cb(0xcc)+_0x45e610[0x0]+_0x4886cb(0xe6)+_0x44eba6['table']+'\x27\x20across\x20all\x20databases.'),0x1;}catch(_0x1026ba){return console['error'](_0x4886cb(0xe9)+_0x1026ba[_0x4886cb(0xe7)]),0x1;}else return console[_0x4886cb(0xc2)](_0x4886cb(0xbf)),console[_0x4886cb(0xc2)](_0x4886cb(0xcd)),console[_0x4886cb(0xc2)](_0x4886cb(0xdd)),console[_0x4886cb(0xc2)]('\x20\x20tdx\x20tables\x20\x22mydb.users\x22\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20in\x20database\x20mydb'),console[_0x4886cb(0xc2)]('\x20\x20tdx\x20tables\x20\x22*.user*\x22\x20\x20\x20\x20\x20\x20\x20->\x20tables\x20matching\x20user*\x20across\x20databases'),console['error'](_0x4886cb(0xdf)),console[_0x4886cb(0xc2)](_0x4886cb(0xe4)),0x1;}const _0x1fe060=_0x5231d9[_0x4886cb(0xd8)];!_0x44eba6[_0x4886cb(0xd8)]&&_0x1fe060&&(_0x44eba6[_0x4886cb(0xd8)]=_0x1fe060);try{const _0x557fd5=_0x25f561=>_0x25f561&&(_0x25f561[_0x4886cb(0xd5)]('*')||_0x25f561['includes']('?')),_0x267e21=_0x557fd5(_0x44eba6[_0x4886cb(0xd8)]);_0x5231d9['verbose']&&(console[_0x4886cb(0xc2)](_0x4886cb(0xc9)+_0x5231d9[_0x4886cb(0xc0)]),_0x44eba6[_0x4886cb(0xd8)]?_0x267e21?console['error']('Database\x20pattern:\x20'+_0x44eba6['database']):console[_0x4886cb(0xc2)](_0x4886cb(0xc1)+_0x44eba6[_0x4886cb(0xd8)]):console['error']('Database:\x20all'),_0x44eba6[_0x4886cb(0xbc)]&&console[_0x4886cb(0xc2)](_0x4886cb(0xe3)+_0x44eba6[_0x4886cb(0xbc)]));const _0x47fd7e=_0x44eba6[_0x4886cb(0xd8)]&&!_0x267e21?_0x44eba6['database']:undefined,_0x24681e=_0x267e21?_0x44eba6['database']:undefined,_0x447543=_0x44eba6[_0x4886cb(0xbc)],_0xd5b927=resolveLimit(_0x5231d9['limit'],DEFAULT_LISTING_LIMIT),_0x3c7ea3=await withSpinner('Listing\x20tables...',()=>_0x84efce[_0x4886cb(0xd7)]['listTables'](_0x47fd7e,_0x447543,_0x24681e,_0xd5b927),{'verbose':_0x5231d9[_0x4886cb(0xd9)]}),_0x50352f=_0x3c7ea3[_0x4886cb(0xcb)];if(_0x50352f[_0x4886cb(0xe8)]===0x0&&_0x44eba6[_0x4886cb(0xd8)]&&!_0x267e21)return console['error'](_0x4886cb(0xd4)),console[_0x4886cb(0xc2)]('Database\x20\x27'+_0x44eba6[_0x4886cb(0xd8)]+_0x4886cb(0xc7)),0x1;console[_0x4886cb(0xc2)](_0x4886cb(0xd0)+_0x50352f[_0x4886cb(0xe8)]+'\x20table'+(_0x50352f[_0x4886cb(0xe8)]!==0x1?'s':''));if(isStructuredFormat(_0x5231d9))await handleSDKOutput(_0x50352f,{..._0x5231d9,'limit':_0xd5b927});else for(const _0x132148 of _0x50352f){const _0x1132ce=_0x132148[_0x4886cb(0xe1)]?_0x132148['database_name']+'.':'';console[_0x4886cb(0xe5)](_0x4886cb(0xd1)+_0x1132ce+_0x132148['table_name']);}return 0x0;}catch(_0x5214ef){if(_0x5214ef instanceof SDKError)return console['error'](_0x4886cb(0xe9)+_0x5214ef[_0x4886cb(0xe7)]),_0x5214ef['cause']&&console['error'](_0x4886cb(0xca)+_0x5214ef[_0x4886cb(0xdb)]),0x1;throw _0x5214ef;}}[a46_0x26214(0xc8)](_0x30a58f){return undefined;}}
1
+ const a47_0x3d57cc=a47_0x4b38;(function(_0x447b31,_0x4fe3a3){const _0x23982a=a47_0x4b38,_0x5da29c=_0x447b31();while(!![]){try{const _0x25723a=-parseInt(_0x23982a(0x9b))/0x1+parseInt(_0x23982a(0xc0))/0x2*(-parseInt(_0x23982a(0xb2))/0x3)+-parseInt(_0x23982a(0x9f))/0x4+-parseInt(_0x23982a(0xb5))/0x5+parseInt(_0x23982a(0xbd))/0x6*(-parseInt(_0x23982a(0x97))/0x7)+-parseInt(_0x23982a(0xc8))/0x8*(-parseInt(_0x23982a(0xb0))/0x9)+parseInt(_0x23982a(0xc1))/0xa*(parseInt(_0x23982a(0xa4))/0xb);if(_0x25723a===_0x4fe3a3)break;else _0x5da29c['push'](_0x5da29c['shift']());}catch(_0x16e9f2){_0x5da29c['push'](_0x5da29c['shift']());}}}(a47_0x319c,0xb451c));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';function a47_0x319c(){const _0xe74315=['15xBeEKX','\x20\x20tdx\x20tables\x20--in\x20mydb\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb','Site:\x20','4777175XgFtiC','log','Listing\x20tables...','length','Or\x20use\x20--in\x20flag:','\x20table','site','\x20\x20tdx\x20tables\x20\x22mydb.*\x22\x20\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb','509952imphtG','validate','error','223226jBShjU','74430WlZFqx','📋\x20','Note:\x20\x27','Database:\x20all','message','✔\x20Found\x20','Error:\x20Pattern\x20\x27','16MmNUtt','listTables','table','77wDXLwm','✖\x20No\x20tables\x20found','database','\x27\x20without\x20wildcards\x20would\x20search\x20for\x20tables\x20named\x20\x27','66541XPCZhZ','verbose','\x27\x20may\x20not\x20exist\x20or\x20contains\x20no\x20tables','tables','557104ipAWVa','limit','query','Error:\x20','\x20\x20Or:\x20\x20tdx\x20tables\x20--database\x20','3905cmDHnn','Database:\x20','Did\x20you\x20mean\x20to\x20list\x20all\x20tables\x20from\x20database\x20\x27','\x27\x20across\x20all\x20databases.','\x20\x20Use:\x20tdx\x20tables\x20\x22','\x20\x20tdx\x20tables\x20users\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20across\x20all\x20databases','.*\x22','database_name','name','cause','includes','execute','3377484hkpcap','Database\x20\x27'];a47_0x319c=function(){return _0xe74315;};return a47_0x319c();}import{DEFAULT_LISTING_LIMIT,resolveLimit}from'../core/constants.js';function a47_0x4b38(_0x4bc4ca,_0x31a1f2){_0x4bc4ca=_0x4bc4ca-0x96;const _0x319cb4=a47_0x319c();let _0x4b383c=_0x319cb4[_0x4bc4ca];return _0x4b383c;}import{withSpinner}from'../utils/spinner.js';export class TablesCommand extends BaseCommand{[a47_0x3d57cc(0xac)]=a47_0x3d57cc(0x9e);['description']='List\x20tables\x20in\x20a\x20database';async[a47_0x3d57cc(0xaf)](_0x5bcf3c){const _0x2d28c5=a47_0x3d57cc,{options:_0x52705e,args:_0x117b0e,tdx:_0x235c66}=_0x5bcf3c;let _0x5468d2;if(_0x117b0e[_0x2d28c5(0xb8)]===0x0)_0x5468d2={'database':undefined,'table':undefined,'original':''};else{if(_0x117b0e[_0x2d28c5(0xb8)]===0x1)try{_0x5468d2=parseTableReference(_0x117b0e[0x0]);if(_0x5468d2[_0x2d28c5(0x96)]&&!_0x5468d2[_0x2d28c5(0x99)]&&!_0x5468d2[_0x2d28c5(0x96)][_0x2d28c5(0xae)]('*')&&!_0x5468d2['table']['includes']('?'))return console[_0x2d28c5(0xbf)](_0x2d28c5(0xc7)+_0x117b0e[0x0]+'\x27\x20is\x20ambiguous.'),console[_0x2d28c5(0xbf)](_0x2d28c5(0xa6)+_0x5468d2[_0x2d28c5(0x96)]+'\x27?'),console[_0x2d28c5(0xbf)](_0x2d28c5(0xa8)+_0x5468d2['table']+_0x2d28c5(0xaa)),console[_0x2d28c5(0xbf)]('\x20\x20Or:\x20\x20tdx\x20tables\x20--in\x20'+_0x5468d2[_0x2d28c5(0x96)]),console['error'](_0x2d28c5(0xa3)+_0x5468d2['table']),console[_0x2d28c5(0xbf)](''),console[_0x2d28c5(0xbf)](_0x2d28c5(0xc3)+_0x117b0e[0x0]+_0x2d28c5(0x9a)+_0x5468d2[_0x2d28c5(0x96)]+_0x2d28c5(0xa7)),0x1;}catch(_0x1f045a){return console['error'](_0x2d28c5(0xa2)+_0x1f045a['message']),0x1;}else return console[_0x2d28c5(0xbf)]('Error:\x20Too\x20many\x20arguments.\x20Use\x20single\x20argument:'),console[_0x2d28c5(0xbf)](_0x2d28c5(0xa9)),console[_0x2d28c5(0xbf)](_0x2d28c5(0xbc)),console[_0x2d28c5(0xbf)]('\x20\x20tdx\x20tables\x20\x22mydb.users\x22\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20in\x20database\x20mydb'),console[_0x2d28c5(0xbf)]('\x20\x20tdx\x20tables\x20\x22*.user*\x22\x20\x20\x20\x20\x20\x20\x20->\x20tables\x20matching\x20user*\x20across\x20databases'),console[_0x2d28c5(0xbf)](_0x2d28c5(0xb9)),console[_0x2d28c5(0xbf)](_0x2d28c5(0xb3)),0x1;}const _0x482860=_0x52705e['database'];!_0x5468d2[_0x2d28c5(0x99)]&&_0x482860&&(_0x5468d2[_0x2d28c5(0x99)]=_0x482860);try{const _0x2bfe0d=_0x18027b=>_0x18027b&&(_0x18027b[_0x2d28c5(0xae)]('*')||_0x18027b[_0x2d28c5(0xae)]('?')),_0x597c9a=_0x2bfe0d(_0x5468d2[_0x2d28c5(0x99)]);_0x52705e['verbose']&&(console[_0x2d28c5(0xbf)](_0x2d28c5(0xb4)+_0x52705e[_0x2d28c5(0xbb)]),_0x5468d2[_0x2d28c5(0x99)]?_0x597c9a?console[_0x2d28c5(0xbf)]('Database\x20pattern:\x20'+_0x5468d2[_0x2d28c5(0x99)]):console[_0x2d28c5(0xbf)](_0x2d28c5(0xa5)+_0x5468d2[_0x2d28c5(0x99)]):console['error'](_0x2d28c5(0xc4)),_0x5468d2[_0x2d28c5(0x96)]&&console[_0x2d28c5(0xbf)]('Table\x20pattern:\x20'+_0x5468d2[_0x2d28c5(0x96)]));const _0x7ce6de=_0x5468d2['database']&&!_0x597c9a?_0x5468d2['database']:undefined,_0x314c71=_0x597c9a?_0x5468d2[_0x2d28c5(0x99)]:undefined,_0x51dd81=_0x5468d2['table'],_0x273b2e=resolveLimit(_0x52705e[_0x2d28c5(0xa0)],DEFAULT_LISTING_LIMIT),_0x3b7387=await withSpinner(_0x2d28c5(0xb7),()=>_0x235c66[_0x2d28c5(0xa1)][_0x2d28c5(0xc9)](_0x7ce6de,_0x51dd81,_0x314c71,_0x273b2e),{'verbose':_0x52705e[_0x2d28c5(0x9c)]}),_0x2bc291=_0x3b7387['data'];if(_0x2bc291[_0x2d28c5(0xb8)]===0x0&&_0x5468d2[_0x2d28c5(0x99)]&&!_0x597c9a)return console[_0x2d28c5(0xbf)](_0x2d28c5(0x98)),console['error'](_0x2d28c5(0xb1)+_0x5468d2[_0x2d28c5(0x99)]+_0x2d28c5(0x9d)),0x1;console[_0x2d28c5(0xbf)](_0x2d28c5(0xc6)+_0x2bc291[_0x2d28c5(0xb8)]+_0x2d28c5(0xba)+(_0x2bc291[_0x2d28c5(0xb8)]!==0x1?'s':''));if(isStructuredFormat(_0x52705e))await handleSDKOutput(_0x2bc291,{..._0x52705e,'limit':_0x273b2e});else for(const _0x532629 of _0x2bc291){const _0xfaae18=_0x532629['database_name']?_0x532629[_0x2d28c5(0xab)]+'.':'';console[_0x2d28c5(0xb6)](_0x2d28c5(0xc2)+_0xfaae18+_0x532629['table_name']);}return 0x0;}catch(_0x5a133b){if(_0x5a133b instanceof SDKError)return console[_0x2d28c5(0xbf)](_0x2d28c5(0xa2)+_0x5a133b[_0x2d28c5(0xc5)]),_0x5a133b[_0x2d28c5(0xad)]&&console[_0x2d28c5(0xbf)]('\x20\x20Cause:\x20'+_0x5a133b['cause']),0x1;throw _0x5a133b;}}[a47_0x3d57cc(0xbe)](_0x8e38da){return undefined;}}
@@ -1 +1 @@
1
- const a47_0x305139=a47_0x342f;function a47_0x342f(_0x3e7b2e,_0x48a1f1){_0x3e7b2e=_0x3e7b2e-0x143;const _0x13c987=a47_0x13c9();let _0x342f53=_0x13c987[_0x3e7b2e];return _0x342f53;}(function(_0x3f4b70,_0x45ab72){const _0x2ba95d=a47_0x342f,_0x1a6ee1=_0x3f4b70();while(!![]){try{const _0xc7e85d=-parseInt(_0x2ba95d(0x15d))/0x1+-parseInt(_0x2ba95d(0x14a))/0x2*(-parseInt(_0x2ba95d(0x15f))/0x3)+-parseInt(_0x2ba95d(0x164))/0x4+parseInt(_0x2ba95d(0x14e))/0x5*(-parseInt(_0x2ba95d(0x160))/0x6)+parseInt(_0x2ba95d(0x14d))/0x7*(parseInt(_0x2ba95d(0x143))/0x8)+-parseInt(_0x2ba95d(0x15b))/0x9+parseInt(_0x2ba95d(0x16b))/0xa*(parseInt(_0x2ba95d(0x15a))/0xb);if(_0xc7e85d===_0x45ab72)break;else _0x1a6ee1['push'](_0x1a6ee1['shift']());}catch(_0x427521){_0x1a6ee1['push'](_0x1a6ee1['shift']());}}}(a47_0x13c9,0xbec2d));function a47_0x13c9(){const _0x5c3f5c=['cleared','3458703cRhYrn','6qeNANh','site','default','database','5243268OsgbvV','message','profile','description','includes','Clear\x20session-level\x20or\x20default\x20context\x20values','parent_segment','9550Gitsrj','log','352wyjsxQ','Default\x20site\x20','join','agent','(session:\x20','llm_project','green','2XAshGG','unset','dim','179963dhcwpG','6551870mWYGEx','\x0aUpdated:\x20','session','Error:\x20','engage_workspace','Session\x20','llm_agent','\x0aResources:\x20site,\x20database,\x20parent_segment,\x20llm_project,\x20agent,\x20profile,\x20engage_workspace\x0a','execute','Default\x20profile\x20','Invalid\x20resource:\x20','--default\x20can\x20only\x20be\x20used\x20with\x20\x27site\x27\x20or\x20\x27profile\x27.\x20Other\x20resources\x20are\x20session-level\x20only.','30899hYhcBh','2206215ABAeHG','name','1319009EWkhDk'];a47_0x13c9=function(){return _0x5c3f5c;};return a47_0x13c9();}import{BaseCommand}from'./command.js';import{getSessionID,cleanExpiredSessions,clearSessionContextField}from'../core/session.js';import{clearDefaultSiteFromUserConfig,clearActiveProfileFromUserConfig}from'../core/profile.js';import{getConfigDir}from'../core/config.js';import a47_0x3b3ed8 from'chalk';import*as a47_0x529fd2 from'node:path';export class UnsetCommand extends BaseCommand{[a47_0x305139(0x15c)]=a47_0x305139(0x14b);[a47_0x305139(0x167)]=a47_0x305139(0x169);['validate'](_0x3e7f98){const _0x22c6c6=a47_0x305139,{args:_0x4442e7,options:_0x22ebcd}=_0x3e7f98,_0x482a53=_0x22ebcd[_0x22c6c6(0x162)];if(_0x4442e7['length']===0x0)return'Usage:\x20tdx\x20unset\x20<resource>\x0a'+'\x20\x20\x20\x20\x20\x20\x20tdx\x20unset\x20--default\x20<resource>\x20\x20#\x20Clear\x20default\x20from\x20config\x0a'+_0x22c6c6(0x155)+'\x0aRun\x20\x27tdx\x20unset\x20--help\x27\x20for\x20more\x20options';const _0x295a14=_0x4442e7[0x0],_0x1b3d81=['site',_0x22c6c6(0x163),_0x22c6c6(0x16a),'llm_project',_0x22c6c6(0x146),_0x22c6c6(0x166),_0x22c6c6(0x152)];if(!_0x1b3d81[_0x22c6c6(0x168)](_0x295a14))return _0x22c6c6(0x158)+_0x295a14+'.\x20Must\x20be\x20one\x20of:\x20'+_0x1b3d81[_0x22c6c6(0x145)](',\x20');if(_0x482a53&&_0x295a14!==_0x22c6c6(0x161)&&_0x295a14!=='profile')return _0x22c6c6(0x159);return undefined;}async[a47_0x305139(0x156)](_0x594906){const _0x358906=a47_0x305139,{args:_0x59595c,options:_0x36d3be}=_0x594906,_0x201cbb=_0x36d3be[_0x358906(0x162)];cleanExpiredSessions();try{const _0x3c86aa=_0x59595c[0x0],_0x46d60c=a47_0x529fd2[_0x358906(0x145)](getConfigDir(),'tdx.json');if(_0x201cbb){if(_0x3c86aa===_0x358906(0x161))return clearDefaultSiteFromUserConfig(),console['log'](_0x358906(0x144)+a47_0x3b3ed8[_0x358906(0x149)](_0x358906(0x15e))),console[_0x358906(0x16c)](a47_0x3b3ed8[_0x358906(0x14c)](_0x358906(0x14f)+_0x46d60c)),0x0;if(_0x3c86aa===_0x358906(0x166))return clearActiveProfileFromUserConfig(),console[_0x358906(0x16c)](_0x358906(0x157)+a47_0x3b3ed8[_0x358906(0x149)](_0x358906(0x15e))),console[_0x358906(0x16c)](a47_0x3b3ed8[_0x358906(0x14c)](_0x358906(0x14f)+_0x46d60c)),0x0;}const _0x1f4c10=getSessionID(_0x36d3be[_0x358906(0x150)]),_0x5c5255={'site':_0x358906(0x161),'database':_0x358906(0x163),'parent_segment':_0x358906(0x16a),'llm_project':_0x358906(0x148),'agent':_0x358906(0x154),'profile':_0x358906(0x166),'engage_workspace':_0x358906(0x152)},_0x30a38c=_0x5c5255[_0x3c86aa];return _0x30a38c&&(clearSessionContextField(_0x30a38c,_0x36d3be[_0x358906(0x150)]),console['log'](_0x358906(0x153)+_0x3c86aa+'\x20'+a47_0x3b3ed8[_0x358906(0x149)](_0x358906(0x15e))+'\x20'+a47_0x3b3ed8['dim'](_0x358906(0x147)+_0x1f4c10+')'))),0x0;}catch(_0x53ca29){return _0x53ca29 instanceof Error&&console['error'](_0x358906(0x151)+_0x53ca29[_0x358906(0x165)]),0x1;}}}
1
+ const a48_0x5cd58e=a48_0x1c19;function a48_0x1c19(_0x5986d3,_0x1e4236){_0x5986d3=_0x5986d3-0xd0;const _0x224e36=a48_0x224e();let _0x1c19bf=_0x224e36[_0x5986d3];return _0x1c19bf;}(function(_0x243bd4,_0x5b82c0){const _0x2a929f=a48_0x1c19,_0x24cca9=_0x243bd4();while(!![]){try{const _0x6fec99=-parseInt(_0x2a929f(0xe9))/0x1+-parseInt(_0x2a929f(0xd1))/0x2*(parseInt(_0x2a929f(0xe4))/0x3)+parseInt(_0x2a929f(0xe3))/0x4*(-parseInt(_0x2a929f(0xda))/0x5)+parseInt(_0x2a929f(0xe2))/0x6*(parseInt(_0x2a929f(0xed))/0x7)+parseInt(_0x2a929f(0xfb))/0x8*(parseInt(_0x2a929f(0xf7))/0x9)+parseInt(_0x2a929f(0xd0))/0xa+parseInt(_0x2a929f(0xde))/0xb*(-parseInt(_0x2a929f(0xd6))/0xc);if(_0x6fec99===_0x5b82c0)break;else _0x24cca9['push'](_0x24cca9['shift']());}catch(_0x397178){_0x24cca9['push'](_0x24cca9['shift']());}}}(a48_0x224e,0xf37bd));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_0x224e(){const _0x16b121=['default','message','Error:\x20','database','1835062yAABcj','\x0aResources:\x20site,\x20database,\x20parent_segment,\x20llm_project,\x20agent,\x20profile,\x20engage_workspace\x0a','agent','length','4639082WlLaYW','error','description','site','\x0aRun\x20\x27tdx\x20unset\x20--help\x27\x20for\x20more\x20options','Usage:\x20tdx\x20unset\x20<resource>\x0a','cleared','includes','validate','profile','451971oPLsdr','\x0aUpdated:\x20','session','engage_workspace','232ZBImLl','19611690XtMjfL','810lBUCEC','tdx.json','llm_project','parent_segment','Session\x20','73092dKtMtG','dim','unset','llm_agent','5NJyTrY','Default\x20profile\x20','log','name','979GCKyRr','green','.\x20Must\x20be\x20one\x20of:\x20','join','12KdNAYT','2255068KyAgus','5961Hcbmvb'];a48_0x224e=function(){return _0x16b121;};return a48_0x224e();}import a48_0x405223 from'chalk';import*as a48_0x496433 from'node:path';export class UnsetCommand extends BaseCommand{[a48_0x5cd58e(0xdd)]=a48_0x5cd58e(0xd8);[a48_0x5cd58e(0xef)]='Clear\x20session-level\x20or\x20default\x20context\x20values';[a48_0x5cd58e(0xf5)](_0x371aa0){const _0x3a3708=a48_0x5cd58e,{args:_0x36b2da,options:_0x1f54bf}=_0x371aa0,_0x2fc4a6=_0x1f54bf[_0x3a3708(0xe5)];if(_0x36b2da[_0x3a3708(0xec)]===0x0)return _0x3a3708(0xf2)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20unset\x20--default\x20<resource>\x20\x20#\x20Clear\x20default\x20from\x20config\x0a'+_0x3a3708(0xea)+_0x3a3708(0xf1);const _0xb5a505=_0x36b2da[0x0],_0x7266c7=[_0x3a3708(0xf0),'database','parent_segment',_0x3a3708(0xd3),_0x3a3708(0xeb),_0x3a3708(0xf6),_0x3a3708(0xfa)];if(!_0x7266c7[_0x3a3708(0xf4)](_0xb5a505))return'Invalid\x20resource:\x20'+_0xb5a505+_0x3a3708(0xe0)+_0x7266c7[_0x3a3708(0xe1)](',\x20');if(_0x2fc4a6&&_0xb5a505!=='site'&&_0xb5a505!==_0x3a3708(0xf6))return'--default\x20can\x20only\x20be\x20used\x20with\x20\x27site\x27\x20or\x20\x27profile\x27.\x20Other\x20resources\x20are\x20session-level\x20only.';return undefined;}async['execute'](_0x57a039){const _0x5cbf0f=a48_0x5cd58e,{args:_0x4fbe33,options:_0x3f4af9}=_0x57a039,_0xdbd454=_0x3f4af9[_0x5cbf0f(0xe5)];cleanExpiredSessions();try{const _0x798fdd=_0x4fbe33[0x0],_0x2aea6a=a48_0x496433[_0x5cbf0f(0xe1)](getConfigDir(),_0x5cbf0f(0xd2));if(_0xdbd454){if(_0x798fdd===_0x5cbf0f(0xf0))return clearDefaultSiteFromUserConfig(),console[_0x5cbf0f(0xdc)]('Default\x20site\x20'+a48_0x405223['green'](_0x5cbf0f(0xf3))),console[_0x5cbf0f(0xdc)](a48_0x405223[_0x5cbf0f(0xd7)]('\x0aUpdated:\x20'+_0x2aea6a)),0x0;if(_0x798fdd===_0x5cbf0f(0xf6))return clearActiveProfileFromUserConfig(),console[_0x5cbf0f(0xdc)](_0x5cbf0f(0xdb)+a48_0x405223['green'](_0x5cbf0f(0xf3))),console[_0x5cbf0f(0xdc)](a48_0x405223[_0x5cbf0f(0xd7)](_0x5cbf0f(0xf8)+_0x2aea6a)),0x0;}const _0xd96e46=getSessionID(_0x3f4af9[_0x5cbf0f(0xf9)]),_0x440e07={'site':_0x5cbf0f(0xf0),'database':_0x5cbf0f(0xe8),'parent_segment':_0x5cbf0f(0xd4),'llm_project':_0x5cbf0f(0xd3),'agent':_0x5cbf0f(0xd9),'profile':_0x5cbf0f(0xf6),'engage_workspace':_0x5cbf0f(0xfa)},_0x578d35=_0x440e07[_0x798fdd];return _0x578d35&&(clearSessionContextField(_0x578d35,_0x3f4af9[_0x5cbf0f(0xf9)]),console['log'](_0x5cbf0f(0xd5)+_0x798fdd+'\x20'+a48_0x405223[_0x5cbf0f(0xdf)]('cleared')+'\x20'+a48_0x405223[_0x5cbf0f(0xd7)]('(session:\x20'+_0xd96e46+')'))),0x0;}catch(_0x299c97){return _0x299c97 instanceof Error&&console[_0x5cbf0f(0xee)](_0x5cbf0f(0xe7)+_0x299c97[_0x5cbf0f(0xe6)]),0x1;}}}