@treasuredata/tdx 2026.3.4 → 2026.3.6

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 (231) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.d.ts.map +1 -1
  5. package/dist/cli.js +1 -1
  6. package/dist/cli.js.map +1 -1
  7. package/dist/commands/activations.js +1 -1
  8. package/dist/commands/agent-command.js +1 -1
  9. package/dist/commands/agent-test-command.js +1 -1
  10. package/dist/commands/api-command.js +1 -1
  11. package/dist/commands/auth-command.d.ts.map +1 -1
  12. package/dist/commands/auth-command.js +1 -1
  13. package/dist/commands/auth-command.js.map +1 -1
  14. package/dist/commands/auth-login-command.d.ts +29 -0
  15. package/dist/commands/auth-login-command.d.ts.map +1 -0
  16. package/dist/commands/auth-login-command.js +1 -0
  17. package/dist/commands/auth-login-command.js.map +1 -0
  18. package/dist/commands/chat-command.js +1 -1
  19. package/dist/commands/claude-command.js +1 -1
  20. package/dist/commands/claude-statusline-command.js +1 -1
  21. package/dist/commands/claude-usage-command.js +1 -1
  22. package/dist/commands/command.js +1 -1
  23. package/dist/commands/connection-command.js +1 -1
  24. package/dist/commands/databases.js +1 -1
  25. package/dist/commands/delivery-command.js +1 -1
  26. package/dist/commands/describe.js +1 -1
  27. package/dist/commands/engage-campaign-pull-command.js +1 -1
  28. package/dist/commands/engage-campaign-push-command.js +1 -1
  29. package/dist/commands/engage-campaign-validate-command.js +1 -1
  30. package/dist/commands/engage-command.js +1 -1
  31. package/dist/commands/engage-template-pull-command.js +1 -1
  32. package/dist/commands/engage-template-push-command.js +1 -1
  33. package/dist/commands/engage-template-validate-command.js +1 -1
  34. package/dist/commands/job-command.js +1 -1
  35. package/dist/commands/journey-command.js +1 -1
  36. package/dist/commands/journey-validate-command.js +1 -1
  37. package/dist/commands/llm-command.js +1 -1
  38. package/dist/commands/mcp-command.d.ts.map +1 -1
  39. package/dist/commands/mcp-command.js +1 -1
  40. package/dist/commands/mcp-command.js.map +1 -1
  41. package/dist/commands/parent-segment-command.js +1 -1
  42. package/dist/commands/profile-command.d.ts.map +1 -1
  43. package/dist/commands/profile-command.js +1 -1
  44. package/dist/commands/profile-command.js.map +1 -1
  45. package/dist/commands/profiles-command.js +1 -1
  46. package/dist/commands/query-command.js +1 -1
  47. package/dist/commands/schedule-command.js +1 -1
  48. package/dist/commands/segment-command.js +1 -1
  49. package/dist/commands/segment-create-command.js +1 -1
  50. package/dist/commands/segment-fields-command.js +1 -1
  51. package/dist/commands/segment-pull-command.js +1 -1
  52. package/dist/commands/segment-push-command.js +1 -1
  53. package/dist/commands/segment-update-command.js +1 -1
  54. package/dist/commands/segment-use-command.js +1 -1
  55. package/dist/commands/segment-validate-command.js +1 -1
  56. package/dist/commands/segments.js +1 -1
  57. package/dist/commands/show.js +1 -1
  58. package/dist/commands/status-command.d.ts.map +1 -1
  59. package/dist/commands/status-command.js +1 -1
  60. package/dist/commands/status-command.js.map +1 -1
  61. package/dist/commands/tables.js +1 -1
  62. package/dist/commands/unset-command.js +1 -1
  63. package/dist/commands/upgrade-command.js +1 -1
  64. package/dist/commands/use-command.js +1 -1
  65. package/dist/commands/user-command.js +1 -1
  66. package/dist/commands/workflow-command.js +1 -1
  67. package/dist/core/auth.js +1 -1
  68. package/dist/core/command-output.js +1 -1
  69. package/dist/core/config.js +1 -1
  70. package/dist/core/connection-cache.js +1 -1
  71. package/dist/core/constants.d.ts +11 -0
  72. package/dist/core/constants.d.ts.map +1 -1
  73. package/dist/core/constants.js +1 -1
  74. package/dist/core/constants.js.map +1 -1
  75. package/dist/core/credential-cache.js +1 -1
  76. package/dist/core/global-context.d.ts.map +1 -1
  77. package/dist/core/global-context.js +1 -1
  78. package/dist/core/global-context.js.map +1 -1
  79. package/dist/core/keychain.js +1 -1
  80. package/dist/core/oauth-keychain.d.ts +32 -0
  81. package/dist/core/oauth-keychain.d.ts.map +1 -0
  82. package/dist/core/oauth-keychain.js +1 -0
  83. package/dist/core/oauth-keychain.js.map +1 -0
  84. package/dist/core/oauth.d.ts +112 -0
  85. package/dist/core/oauth.d.ts.map +1 -0
  86. package/dist/core/oauth.js +1 -0
  87. package/dist/core/oauth.js.map +1 -0
  88. package/dist/core/profile.js +1 -1
  89. package/dist/core/project-config.js +1 -1
  90. package/dist/core/session.js +1 -1
  91. package/dist/core/user-cache.js +1 -1
  92. package/dist/core/version.js +1 -1
  93. package/dist/index.js +1 -1
  94. package/dist/mcp/server.js +1 -1
  95. package/dist/mcp/tools/index.js +1 -1
  96. package/dist/mcp/tools/tdx-run.js +1 -1
  97. package/dist/mcp/tools/tdx-search.js +1 -1
  98. package/dist/mcp/utils.js +1 -1
  99. package/dist/proxy/claude-usage-tracker.js +1 -1
  100. package/dist/proxy/passthrough-server.js +1 -1
  101. package/dist/proxy/sse-usage-parser.js +1 -1
  102. package/dist/sdk/agent/agent-config.js +1 -1
  103. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  104. package/dist/sdk/agent/agent-yaml.js +1 -1
  105. package/dist/sdk/agent/test/evaluator.js +1 -1
  106. package/dist/sdk/agent/test/executor.js +1 -1
  107. package/dist/sdk/agent/test/index.js +1 -1
  108. package/dist/sdk/agent/test/output.js +1 -1
  109. package/dist/sdk/agent/test/parser.js +1 -1
  110. package/dist/sdk/agent/tool-target-registry.js +1 -1
  111. package/dist/sdk/api.js +1 -1
  112. package/dist/sdk/client/cdp-api-client.js +1 -1
  113. package/dist/sdk/client/delivery-api-client.js +1 -1
  114. package/dist/sdk/client/endpoints.js +1 -1
  115. package/dist/sdk/client/endpoints.js.map +1 -1
  116. package/dist/sdk/client/engage-api-client.js +1 -1
  117. package/dist/sdk/client/http-client.js +1 -1
  118. package/dist/sdk/client/llm-api-client.js +1 -1
  119. package/dist/sdk/client/oauth-refresh.d.ts +16 -0
  120. package/dist/sdk/client/oauth-refresh.d.ts.map +1 -0
  121. package/dist/sdk/client/oauth-refresh.js +1 -0
  122. package/dist/sdk/client/oauth-refresh.js.map +1 -0
  123. package/dist/sdk/client/rate-limiter.js +1 -1
  124. package/dist/sdk/client/td-api-client.js +1 -1
  125. package/dist/sdk/client/trino-api-client.js +1 -1
  126. package/dist/sdk/client/workflow-client.js +1 -1
  127. package/dist/sdk/connection-validator.js +1 -1
  128. package/dist/sdk/connection.js +1 -1
  129. package/dist/sdk/delivery.js +1 -1
  130. package/dist/sdk/engage/campaign-pull.js +1 -1
  131. package/dist/sdk/engage/campaign-push.js +1 -1
  132. package/dist/sdk/engage/campaign-validator.js +1 -1
  133. package/dist/sdk/engage/campaign-yaml.js +1 -1
  134. package/dist/sdk/engage/template-pull.js +1 -1
  135. package/dist/sdk/engage/template-push.js +1 -1
  136. package/dist/sdk/engage/template-validator.js +1 -1
  137. package/dist/sdk/engage/template-yaml.js +1 -1
  138. package/dist/sdk/engage/types/campaign-def.js +1 -1
  139. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  140. package/dist/sdk/engage/types/template-schema.js +1 -1
  141. package/dist/sdk/engage.js +1 -1
  142. package/dist/sdk/errors.js +1 -1
  143. package/dist/sdk/index.js +1 -1
  144. package/dist/sdk/io/index.js +1 -1
  145. package/dist/sdk/io/node-filesystem.js +1 -1
  146. package/dist/sdk/job.js +1 -1
  147. package/dist/sdk/journey.js +1 -1
  148. package/dist/sdk/llm/chat-cache.js +1 -1
  149. package/dist/sdk/llm/index.js +1 -1
  150. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  151. package/dist/sdk/llm/model-factors.d.ts.map +1 -1
  152. package/dist/sdk/llm/model-factors.js +1 -1
  153. package/dist/sdk/llm/model-factors.js.map +1 -1
  154. package/dist/sdk/personalization.js +1 -1
  155. package/dist/sdk/query/index.js +1 -1
  156. package/dist/sdk/query/sql-parser.js +1 -1
  157. package/dist/sdk/realtime.js +1 -1
  158. package/dist/sdk/schedule.js +1 -1
  159. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  160. package/dist/sdk/segment/fields-display.js +1 -1
  161. package/dist/sdk/segment/file-discovery.js +1 -1
  162. package/dist/sdk/segment/journey-utils.js +1 -1
  163. package/dist/sdk/segment/journey-validator.js +1 -1
  164. package/dist/sdk/segment/journey-yaml.js +1 -1
  165. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  166. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  167. package/dist/sdk/segment/pull-workflow.js +1 -1
  168. package/dist/sdk/segment/push-recovery.js +1 -1
  169. package/dist/sdk/segment/push-workflow.js +1 -1
  170. package/dist/sdk/segment/resolution-context.js +1 -1
  171. package/dist/sdk/segment/segment-path-parser.js +1 -1
  172. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  173. package/dist/sdk/segment/segment-validator.js +1 -1
  174. package/dist/sdk/segment/target-resolution.js +1 -1
  175. package/dist/sdk/segment/tdx-config.js +1 -1
  176. package/dist/sdk/segment/types/activation-schema.js +1 -1
  177. package/dist/sdk/segment/types/journey-def.js +1 -1
  178. package/dist/sdk/segment/types/journey-schema.js +1 -1
  179. package/dist/sdk/segment/types/segment-def.js +1 -1
  180. package/dist/sdk/segment/types/segment-schema.js +1 -1
  181. package/dist/sdk/segment/validate-files.js +1 -1
  182. package/dist/sdk/segment/yaml-validator.js +1 -1
  183. package/dist/sdk/segment.js +1 -1
  184. package/dist/sdk/types/index.js +1 -1
  185. package/dist/sdk/types/progress.js +1 -1
  186. package/dist/sdk/user.js +1 -1
  187. package/dist/sdk/util/format-detector.js +1 -1
  188. package/dist/sdk/util/formatters.js +1 -1
  189. package/dist/sdk/util/index.js +1 -1
  190. package/dist/sdk/util/paginate.js +1 -1
  191. package/dist/sdk/util/tree-formatter.js +1 -1
  192. package/dist/sdk/workflow/archive-validation.js +1 -1
  193. package/dist/sdk/workflow/clone-workflow.js +1 -1
  194. package/dist/sdk/workflow/index.js +1 -1
  195. package/dist/sdk/workflow/pull-workflow.js +1 -1
  196. package/dist/sdk/workflow/push-workflow.js +1 -1
  197. package/dist/sdk/workflow/tdx-config.js +1 -1
  198. package/dist/sdk/workflow/workflow-utils.js +1 -1
  199. package/dist/test-utils/command-runner.js +1 -1
  200. package/dist/test-utils/factories.js +1 -1
  201. package/dist/test-utils/fixtures.js +1 -1
  202. package/dist/test-utils/http-mock.js +1 -1
  203. package/dist/test-utils/index.js +1 -1
  204. package/dist/utils/async.js +1 -1
  205. package/dist/utils/colors.js +1 -1
  206. package/dist/utils/diff.js +1 -1
  207. package/dist/utils/file-permissions.js +1 -1
  208. package/dist/utils/file-reader.js +1 -1
  209. package/dist/utils/github-releases.js +1 -1
  210. package/dist/utils/global-cache.js +1 -1
  211. package/dist/utils/json-loader.js +1 -1
  212. package/dist/utils/local-cache.js +1 -1
  213. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  214. package/dist/utils/logger/formatters/index.js +1 -1
  215. package/dist/utils/logger/handlers/console-handler.js +1 -1
  216. package/dist/utils/logger/handlers/file-handler.js +1 -1
  217. package/dist/utils/logger/handlers/index.js +1 -1
  218. package/dist/utils/logger/handlers/null-handler.js +1 -1
  219. package/dist/utils/logger/index.js +1 -1
  220. package/dist/utils/logger/logger.js +1 -1
  221. package/dist/utils/logger/types.js +1 -1
  222. package/dist/utils/option-validation.js +1 -1
  223. package/dist/utils/process.js +1 -1
  224. package/dist/utils/prompt.js +1 -1
  225. package/dist/utils/spinner.js +1 -1
  226. package/dist/utils/sse-parser.js +1 -1
  227. package/dist/utils/string-utils.js +1 -1
  228. package/dist/utils/table-ref-parser.js +1 -1
  229. package/dist/utils/tdx-logger.js +1 -1
  230. package/dist/utils/version-check.js +1 -1
  231. package/package.json +1 -1
@@ -1 +1 @@
1
- const a38_0x2be8f4=a38_0x4920;(function(_0x5a9dfe,_0x1f03e9){const _0x50fa6d=a38_0x4920,_0x43d44d=_0x5a9dfe();while(!![]){try{const _0x3e93d2=-parseInt(_0x50fa6d(0xb4))/0x1*(parseInt(_0x50fa6d(0x11e))/0x2)+parseInt(_0x50fa6d(0x11d))/0x3*(-parseInt(_0x50fa6d(0xbb))/0x4)+parseInt(_0x50fa6d(0xb7))/0x5*(parseInt(_0x50fa6d(0x11f))/0x6)+parseInt(_0x50fa6d(0x13e))/0x7*(-parseInt(_0x50fa6d(0xee))/0x8)+parseInt(_0x50fa6d(0x12f))/0x9*(parseInt(_0x50fa6d(0x114))/0xa)+-parseInt(_0x50fa6d(0xd3))/0xb+parseInt(_0x50fa6d(0xbe))/0xc*(parseInt(_0x50fa6d(0x12a))/0xd);if(_0x3e93d2===_0x1f03e9)break;else _0x43d44d['push'](_0x43d44d['shift']());}catch(_0xcb4bd3){_0x43d44d['push'](_0x43d44d['shift']());}}}(a38_0x5d16,0xeea06));import{BaseCommand}from'./command.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{generateDiff,formatDiffWithColors}from'../utils/diff.js';import{confirmKey,isInteractive}from'../utils/prompt.js';function a38_0x5d16(){const _0x339d73=['journeyId','user','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','555165pszHiU','isNew','results','changed','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','created','\x20\x20🗺️\x20\x20Journeys:','existingSegment','state','createdAt','\x20changes?','targetDir','\x20unchanged','✔\x20All\x20journeys\x20are\x20up\x20to\x20date','\x0aValidation\x20failed:','7uNFeDq','filePath','Delete\x20journey:','nameToId','dim','cwd','connection','attributes','length','activations','versionNumber','yamlConfig','listFolders','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','getJourney','Folders\x20to\x20create:','(Journey\x20will\x20be\x20deleted)','segments','Push\x20','/e/','Delete\x20segment:','\x20\x20Activations:','387503vItVQE','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file','journey','6025GwTKXA','\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20','folderPath','segment','387736xQpLWJ','journeyBundleName','\x20folders\x20to\x20create','5823828vPehSl','.yml','map','data','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','\x20activations]','Error\x20parsing\x20YAML:\x20','blue','parentFolder','\x27...','error','Preparing\x20journeys...','toString','folders','red','Site:\x20','segmentFolderId','listJourneysWithDetailsFromParentSegment','toCreate','set','Changes\x20to:','200046raiYLM','\x20deleted','\x20changed','all','helpText','type','nameToType','updated','updatedAt','\x20\x20Journeys:\x20','idToName','verbose','name','toDelete','/sb/da/esr','delete','\x20YAML\x20files\x20found','.yaml','Fetching\x20existing\x20activations...','📁\x20','\x20\x20\x20\x20','createdSegmentIds','yellow','existingJourney','add','isScoped','execute','14400264ZFXgyl','\x20to\x20delete','cyan','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','toUpdate','folderId','repeat','join','segment:push','journeyBundleId','parentName','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','listActivations','/j/da/je','/app/ps/','\x20\x20Source:\x20','Fetching\x20connections\x20for\x20name\x20resolution...','new','paused','✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','dryRun','getOutputSchemaWithCache','message','\x20\x20📊\x20Segments:','No\x20','getParent','Error:\x20Directory\x20not\x20found:\x20','Usage:\x20tdx\x20sg\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20(requires\x20context)','setPhase','site','green','journeys','unchanged','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','relationships','diff','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','journeysOnly','130dAIhUX','New\x20journey:','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','then','no_parent','\x20updated','file','\x20created','get','9pXvTru','10TLXkAr','8940WhaOHt','\x20to\x20update','yes','\x20new','buildUserMaps','filter','endsWith','\x20\x20Segments:\x20','parentSegment','push','Changes\x20to\x20journey:','65JUucIT','parent_name'];a38_0x5d16=function(){return _0x339d73;};return a38_0x5d16();}import{batchAsync}from'../utils/async.js';import{segmentToYamlString,segmentWithActivationsToYaml}from'../sdk/segment/child-segment-yaml.js';import a38_0x4e5aba 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';function a38_0x4920(_0x2677ef,_0x3cd941){_0x2677ef=_0x2677ef-0xa9;const _0x5d1606=a38_0x5d16();let _0x4920c9=_0x5d1606[_0x2677ef];return _0x4920c9;}export class SegmentPushCommand extends BaseCommand{[a38_0x2be8f4(0xdf)]=a38_0x2be8f4(0xf6);['description']='Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments';async[a38_0x2be8f4(0xed)](_0x9441d){const _0x3c5a7b=a38_0x2be8f4,{options:_0x19a27f,args:_0x213280,tdx:_0x116ea1}=_0x9441d,_0x52f448=_0x19a27f,_0x1d0c3f=await resolveTarget({'arg':_0x213280[0x0],'contextParent':_0x19a27f[_0x3c5a7b(0x127)],'cwd':process[_0x3c5a7b(0x143)]()});if(!isSuccessfulResolution(_0x1d0c3f))return _0x1d0c3f['errorCode']===_0x3c5a7b(0x118)?(console[_0x3c5a7b(0xc8)](a38_0x4e5aba[_0x3c5a7b(0xe9)]('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console['error'](_0x3c5a7b(0x109)),console[_0x3c5a7b(0xc8)](_0x3c5a7b(0xf9)),console[_0x3c5a7b(0xc8)](_0x3c5a7b(0xb5))):(console['error'](a38_0x4e5aba[_0x3c5a7b(0xcc)]('Error:\x20'+_0x1d0c3f[_0x3c5a7b(0x104)]+'\x0a')),_0x1d0c3f[_0x3c5a7b(0xd7)]&&console['error'](a38_0x4e5aba['cyan'](_0x1d0c3f[_0x3c5a7b(0xd7)]))),0x1;if(_0x1d0c3f[_0x3c5a7b(0xd8)]===_0x3c5a7b(0x12b))return console['error'](a38_0x4e5aba[_0x3c5a7b(0xcc)](_0x3c5a7b(0x108)+_0x1d0c3f[_0x3c5a7b(0x13a)]+'\x0a')),console[_0x3c5a7b(0xc8)](a38_0x4e5aba['cyan'](_0x3c5a7b(0xf1))),0x1;const _0x4dcf5f=_0x1d0c3f[_0x3c5a7b(0xf8)],_0x534f92=_0x1d0c3f['targetDir'],_0x476586=_0x1d0c3f[_0x3c5a7b(0xd8)]===_0x3c5a7b(0x11a)?_0x1d0c3f[_0x3c5a7b(0x13f)]:undefined,_0x353675=getScopedDetails(_0x1d0c3f),_0x1e1e98=_0x353675?.[_0x3c5a7b(0xec)]??![],_0x30f1e9=_0x353675?.['scopedFolderPath']??'';if(!existsSync(_0x534f92))return console[_0x3c5a7b(0xc8)](a38_0x4e5aba[_0x3c5a7b(0xcc)](_0x3c5a7b(0x108)+_0x534f92+'\x0a')),console['error'](a38_0x4e5aba['cyan']('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;_0x52f448['verbose']&&(console[_0x3c5a7b(0xc8)](_0x3c5a7b(0xcd)+_0x52f448[_0x3c5a7b(0x10b)]),console[_0x3c5a7b(0xc8)]('Parent\x20segment:\x20'+_0x4dcf5f),console[_0x3c5a7b(0xc8)]('Source\x20directory:\x20'+_0x534f92),_0x1e1e98&&console['error']('Scoped\x20to\x20folder:\x20'+_0x30f1e9));const _0x1e06ae=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x4dcf5f+_0x3c5a7b(0xc7),()=>_0x116ea1[_0x3c5a7b(0xba)]['resolveParentId'](_0x4dcf5f),{'verbose':_0x52f448[_0x3c5a7b(0xde)]}),_0x491c87=_0x1e06ae[_0x3c5a7b(0xc1)],{parentSegmentResult:_0x2fb39d,segmentsResult:_0x5a7474,foldersResult:_0x171c4a,journeysWithDetailsResult:_0x23bed8,userMaps:_0xd2c566}=await withSpinner('Fetching\x20existing\x20data...',async()=>{const _0x394f70=_0x3c5a7b,[_0x4d56a2,_0x24560c,_0x39c14e,_0x53072e,_0x2f8660]=await Promise[_0x394f70(0xd6)]([_0x116ea1['segment'][_0x394f70(0x107)](_0x491c87),_0x116ea1[_0x394f70(0xba)]['listSegments'](_0x491c87),_0x116ea1[_0x394f70(0xba)][_0x394f70(0xaa)](_0x491c87),_0x116ea1[_0x394f70(0xb6)][_0x394f70(0xcf)](_0x491c87,{'includeAllVersions':!![]}),_0x116ea1[_0x394f70(0x12d)][_0x394f70(0x123)]()]);return{'parentSegmentResult':_0x4d56a2,'segmentsResult':_0x24560c,'foldersResult':_0x39c14e,'journeysWithDetailsResult':_0x53072e,'userMaps':_0x2f8660};},{'verbose':_0x52f448['verbose']})[_0x3c5a7b(0x117)](_0xbe0954=>_0xbe0954['data']),_0x32fc09=_0x2fb39d,_0x5b8603=extractRootFolderId(_0x32fc09),_0xf51a17=_0x5a7474,_0x60eae5=_0x171c4a,{journeys:_0xf05fcb,activationStepsById:_0x186201}=_0x23bed8,_0x54cb8f=new Map(_0xf05fcb[_0x3c5a7b(0xc0)](_0x1fb409=>[_0x1fb409['id'],_0x1fb409])),_0x15086f=_0xf05fcb[_0x3c5a7b(0xc0)](_0x1926ea=>({'id':_0x1926ea['id'],'name':_0x1926ea[_0x3c5a7b(0x145)][_0x3c5a7b(0xdf)],'journeyBundleName':_0x1926ea[_0x3c5a7b(0x145)][_0x3c5a7b(0xbc)]||'','journeyBundleId':_0x1926ea[_0x3c5a7b(0x145)][_0x3c5a7b(0xf7)]||'','versionNumber':_0x1926ea[_0x3c5a7b(0x145)][_0x3c5a7b(0x148)],'description':_0x1926ea['attributes']['description'],'state':_0x1926ea[_0x3c5a7b(0x145)][_0x3c5a7b(0x137)],'paused':_0x1926ea[_0x3c5a7b(0x145)][_0x3c5a7b(0x100)],'audienceId':_0x1926ea['attributes']['audienceId'],'folderId':_0x1926ea[_0x3c5a7b(0x110)]?.[_0x3c5a7b(0xc6)]?.[_0x3c5a7b(0xc1)]?.['id'],'createdAt':_0x1926ea['attributes'][_0x3c5a7b(0x138)],'updatedAt':_0x1926ea['attributes'][_0x3c5a7b(0xdb)]})),{emailToId:_0x13a137,idToEmail:_0x116f92}=_0xd2c566,_0x5c42ee=await withSpinner(_0x3c5a7b(0xfe),async()=>{const _0x4cbf47=await _0x116ea1['connection']['list']();return buildConnectionMaps(_0x4cbf47);},{'verbose':_0x52f448[_0x3c5a7b(0xde)]})[_0x3c5a7b(0x117)](_0x22d454=>_0x22d454[_0x3c5a7b(0xc1)]),_0x17fb2a=_0x5c42ee[_0x3c5a7b(0x141)],_0x5f0336=_0x5c42ee['idToName'],_0x9d4b3b=_0x5c42ee[_0x3c5a7b(0xd9)],_0x47459f={'emailToIdMap':_0x13a137,'connectionNameToIdMap':_0x17fb2a,'connectionNameToTypeMap':_0x9d4b3b,'getSchema':_0x13d778=>_0x116ea1['connection'][_0x3c5a7b(0x103)](_0x13d778)};let {pathToId:_0x5b7fdd,idToPath:_0x1ffb9d}=buildFolderMaps(_0x60eae5);const _0x213935=buildSegmentLookupMap(_0xf51a17,_0x1ffb9d),_0x3fd0ca=buildSegmentNameToIdMap(_0xf51a17),_0x340cc4=buildJourneyBundleLookupMap(_0x15086f,_0x1ffb9d);let _0x3c0a11;if(_0x476586){if(!_0x476586[_0x3c5a7b(0x125)](_0x3c5a7b(0xbf))&&!_0x476586[_0x3c5a7b(0x125)](_0x3c5a7b(0xe4)))return console['error'](a38_0x4e5aba[_0x3c5a7b(0xcc)](_0x3c5a7b(0x12e)+_0x476586+'\x0a')),0x1;_0x3c0a11=[_0x476586];}else _0x3c0a11=findYamlFiles(_0x534f92);if(_0x3c0a11[_0x3c5a7b(0x146)]===0x0)return console['error'](a38_0x4e5aba[_0x3c5a7b(0xcc)]('Error:\x20No\x20YAML\x20files\x20found\x20in\x20'+_0x534f92+'\x0a')),console[_0x3c5a7b(0xc8)](a38_0x4e5aba[_0x3c5a7b(0xf0)](_0x3c5a7b(0x116))),0x1;let _0x14788b,_0x3e35ad;try{const _0x4dd8eb=parseAndClassifyYamlFiles(_0x3c0a11,_0x534f92,{'skipSegments':_0x52f448['journeysOnly']});_0x14788b=_0x4dd8eb[_0x3c5a7b(0xaf)],_0x3e35ad=_0x4dd8eb[_0x3c5a7b(0x10d)];const _0x2e6afe=validateParsedFiles(_0x4dd8eb,_0x534f92);if(_0x2e6afe['length']>0x0)return console[_0x3c5a7b(0xc8)](a38_0x4e5aba[_0x3c5a7b(0xcc)](_0x3c5a7b(0x13d))),console[_0x3c5a7b(0xc8)](formatValidationErrors(_0x2e6afe)),console['error'](a38_0x4e5aba[_0x3c5a7b(0xe9)](_0x3c5a7b(0x10f))),0x1;}catch(_0x5a97f6){return console[_0x3c5a7b(0xc8)](a38_0x4e5aba['red'](_0x3c5a7b(0xc4)+(_0x5a97f6 instanceof Error?_0x5a97f6[_0x3c5a7b(0x104)]:_0x5a97f6))),0x1;}if(_0x14788b[_0x3c5a7b(0x146)]===0x0&&_0x3e35ad[_0x3c5a7b(0x146)]===0x0){const _0x4af2ed=_0x52f448[_0x3c5a7b(0x113)]?_0x3c5a7b(0xb6):'segment\x20or\x20journey';return console[_0x3c5a7b(0xc8)](a38_0x4e5aba[_0x3c5a7b(0xe9)](_0x3c5a7b(0x106)+_0x4af2ed+_0x3c5a7b(0xe3))),0x0;}const _0x264316=new Map();_0xf51a17['length']>0x0&&!_0x52f448['journeysOnly']&&await withSpinner(_0x3c5a7b(0xe5),async()=>{await batchAsync(_0xf51a17,async _0x57388d=>{const _0x1f979e=a38_0x4920,_0x4f5672=await _0x116ea1[_0x1f979e(0xba)][_0x1f979e(0xfa)](_0x491c87,_0x57388d['id']);_0x264316[_0x1f979e(0xd1)](_0x57388d['id'],_0x4f5672);});},{'verbose':_0x52f448[_0x3c5a7b(0xde)]});const {segmentFiles:_0x5dbe71,foldersToCreate:_0x530d03}=await prepareSegmentFiles(_0x14788b,{'segmentByFolderAndName':_0x213935,'activationsBySegmentId':_0x264316,'folderPathToId':_0x5b7fdd,'idToEmailMap':_0x116f92,'connectionIdToNameMap':_0x5f0336},_0x47459f,_0x1e1e98,_0x30f1e9),_0x41f07d=_0x476586?[]:findSegmentsToDelete(_0xf51a17,_0x14788b[_0x3c5a7b(0xc0)](({yamlConfig:_0x128f1e,folderPath:_0x209a49})=>({'yamlConfig':_0x128f1e,'folderPath':resolveTDFolderPath(_0x209a49,_0x1e1e98,_0x30f1e9)})),_0x1ffb9d,_0x30f1e9,_0x1e1e98),{journeyFiles:_0x4e6ea6,foldersToCreate:_0x3bd5c9}=await withProgressSpinner(_0x3c5a7b(0xc9),async _0x3dd72a=>prepareJourneyFiles(_0x3e35ad,{'fetchJourney':async _0x4189b2=>_0x116ea1[_0x3c5a7b(0xb6)][_0x3c5a7b(0xac)](_0x4189b2['journeyId']),'journeyBundlesByFolderAndName':_0x340cc4,'folderPathToId':_0x5b7fdd,'idToEmailMap':_0x116f92,'connectionIdToNameMap':_0x5f0336,'existingSegments':_0xf51a17,'parentId':_0x491c87,'deps':_0x116ea1,'progress':{'update':_0x5bd4a6=>{const _0x5c2d1=_0x3c5a7b;_0x3dd72a[_0x5c2d1(0x10a)](_0x5bd4a6),_0x52f448['verbose']&&console[_0x5c2d1(0xc8)]('\x20\x20'+_0x5bd4a6);}},'journeyById':_0x54cb8f,'activationStepsById':_0x186201},_0x1e1e98,_0x30f1e9),{'verbose':_0x52f448['verbose']})['then'](_0x5975a8=>_0x5975a8[_0x3c5a7b(0xc1)]);for(const _0x40d044 of _0x3bd5c9){_0x530d03[_0x3c5a7b(0xeb)](_0x40d044);}const _0x4ade10=_0x476586?[]:findJourneysToDelete(_0x15086f,_0x3e35ad[_0x3c5a7b(0xc0)](({yamlConfig:_0x265337,folderPath:_0x2efd51})=>({'yamlConfig':_0x265337,'folderPath':resolveTDFolderPath(_0x2efd51,_0x1e1e98,_0x30f1e9)})),_0x1ffb9d,_0x30f1e9,_0x1e1e98),_0x143377=calculatePushStats(_0x5dbe71,_0x4e6ea6,_0x530d03,_0x41f07d,_0x4ade10,!!_0x52f448[_0x3c5a7b(0xe2)],!!_0x52f448['journeysOnly']),_0x548329=_0x143377[_0x3c5a7b(0xaf)][_0x3c5a7b(0xff)],_0x42fc49=_0x143377[_0x3c5a7b(0xaf)][_0x3c5a7b(0x132)],_0x12fc4d=_0x143377[_0x3c5a7b(0xaf)][_0x3c5a7b(0x10e)],_0x5ce1cb=_0x143377[_0x3c5a7b(0xaf)][_0x3c5a7b(0xe0)],_0x3e4467=_0x143377[_0x3c5a7b(0xcb)][_0x3c5a7b(0xd0)],_0x30a19a=_0x143377[_0x3c5a7b(0x10d)][_0x3c5a7b(0xff)],_0x3ac9af=_0x143377[_0x3c5a7b(0x10d)][_0x3c5a7b(0x132)],_0x49669e=_0x143377[_0x3c5a7b(0x10d)][_0x3c5a7b(0x10e)],_0x41325b=_0x143377[_0x3c5a7b(0x10d)]['toDelete'],_0x48ad7d=_0x143377[_0x3c5a7b(0x147)][_0x3c5a7b(0xd6)],_0x83a9c=_0x143377['activations']['toCreate'],_0x8f8b2f=_0x143377[_0x3c5a7b(0x147)][_0x3c5a7b(0xf2)],_0x2a75ae=_0x143377[_0x3c5a7b(0x147)]['toDelete'];console[_0x3c5a7b(0xc8)]('\x0aPush\x20summary\x20for\x20\x27'+_0x4dcf5f+'\x27:');_0x3e4467[_0x3c5a7b(0x146)]>0x0&&console[_0x3c5a7b(0xc8)]('\x20\x20'+a38_0x4e5aba[_0x3c5a7b(0xc5)](_0x3c5a7b(0xe6)+_0x3e4467[_0x3c5a7b(0x146)]+_0x3c5a7b(0xbd)));if(!_0x52f448[_0x3c5a7b(0x113)]){console[_0x3c5a7b(0xc8)](_0x3c5a7b(0x105)),console[_0x3c5a7b(0xc8)](_0x3c5a7b(0xe7)+a38_0x4e5aba[_0x3c5a7b(0x10c)]('+\x20'+_0x548329[_0x3c5a7b(0x146)]+_0x3c5a7b(0x122))),console['error'](_0x3c5a7b(0xe7)+a38_0x4e5aba[_0x3c5a7b(0xe9)]('~\x20'+_0x42fc49[_0x3c5a7b(0x146)]+_0x3c5a7b(0xd5)));if(_0x5ce1cb[_0x3c5a7b(0x146)]>0x0)console['error'](_0x3c5a7b(0xe7)+a38_0x4e5aba[_0x3c5a7b(0xcc)]('-\x20'+_0x5ce1cb[_0x3c5a7b(0x146)]+'\x20to\x20delete'));else _0x41f07d['length']>0x0&&!_0x52f448[_0x3c5a7b(0xe2)]&&console[_0x3c5a7b(0xc8)](_0x3c5a7b(0xe7)+a38_0x4e5aba[_0x3c5a7b(0x142)](_0x41f07d['length']+_0x3c5a7b(0xc2)));console[_0x3c5a7b(0xc8)](_0x3c5a7b(0xe7)+a38_0x4e5aba[_0x3c5a7b(0x142)]('=\x20'+_0x12fc4d['length']+'\x20unchanged'));}if(_0x4e6ea6[_0x3c5a7b(0x146)]>0x0||_0x4ade10[_0x3c5a7b(0x146)]>0x0){console[_0x3c5a7b(0xc8)](_0x3c5a7b(0x135)),console[_0x3c5a7b(0xc8)](_0x3c5a7b(0xe7)+a38_0x4e5aba[_0x3c5a7b(0x10c)]('+\x20'+_0x30a19a[_0x3c5a7b(0x146)]+_0x3c5a7b(0x122))),console['error'](_0x3c5a7b(0xe7)+a38_0x4e5aba[_0x3c5a7b(0xe9)]('~\x20'+_0x3ac9af[_0x3c5a7b(0x146)]+_0x3c5a7b(0xd5)));if(_0x41325b['length']>0x0)console[_0x3c5a7b(0xc8)](_0x3c5a7b(0xe7)+a38_0x4e5aba[_0x3c5a7b(0xcc)]('-\x20'+_0x41325b['length']+_0x3c5a7b(0xef)));else _0x4ade10[_0x3c5a7b(0x146)]>0x0&&!_0x52f448['delete']&&console[_0x3c5a7b(0xc8)](_0x3c5a7b(0xe7)+a38_0x4e5aba[_0x3c5a7b(0x142)](_0x4ade10[_0x3c5a7b(0x146)]+_0x3c5a7b(0xc2)));console['error'](_0x3c5a7b(0xe7)+a38_0x4e5aba['dim']('=\x20'+_0x49669e[_0x3c5a7b(0x146)]+_0x3c5a7b(0x13b)));}_0x48ad7d[_0x3c5a7b(0x146)]>0x0&&!_0x52f448[_0x3c5a7b(0x113)]&&(console[_0x3c5a7b(0xc8)](''),console['error'](_0x3c5a7b(0xb3)),_0x83a9c[_0x3c5a7b(0x146)]>0x0&&console[_0x3c5a7b(0xc8)](_0x3c5a7b(0xe7)+a38_0x4e5aba['green']('+\x20'+_0x83a9c[_0x3c5a7b(0x146)]+'\x20to\x20create')),_0x8f8b2f[_0x3c5a7b(0x146)]>0x0&&console['error'](_0x3c5a7b(0xe7)+a38_0x4e5aba[_0x3c5a7b(0xe9)]('~\x20'+_0x8f8b2f['length']+_0x3c5a7b(0x120))),_0x2a75ae[_0x3c5a7b(0x146)]>0x0&&console[_0x3c5a7b(0xc8)](_0x3c5a7b(0xe7)+a38_0x4e5aba['red']('-\x20'+_0x2a75ae[_0x3c5a7b(0x146)]+_0x3c5a7b(0xef))));console[_0x3c5a7b(0xc8)](_0x3c5a7b(0xfd)+a38_0x4e5aba['cyan'](_0x534f92)+'\x0a');if(_0x3e4467[_0x3c5a7b(0x146)]>0x0){console[_0x3c5a7b(0xc8)](_0x3c5a7b(0xad));for(const _0x1ae734 of _0x3e4467){console['error']('\x20\x20'+a38_0x4e5aba['blue']('+')+'\x20'+_0x1ae734);}console[_0x3c5a7b(0xc8)]('');}if(_0x548329[_0x3c5a7b(0x146)]>0x0&&!_0x52f448[_0x3c5a7b(0x113)])for(const _0x57d1ef of _0x548329){const _0x55d33c=_0x57d1ef[_0x3c5a7b(0xb9)]?_0x57d1ef['folderPath']+'/'+_0x57d1ef[_0x3c5a7b(0xa9)][_0x3c5a7b(0xdf)]:_0x57d1ef[_0x3c5a7b(0xa9)][_0x3c5a7b(0xdf)],_0x760d1e=_0x57d1ef[_0x3c5a7b(0xa9)][_0x3c5a7b(0x147)]?.[_0x3c5a7b(0x146)]||0x0,_0x35b8cc=_0x760d1e>0x0?a38_0x4e5aba[_0x3c5a7b(0x142)]('\x20['+_0x760d1e+'\x20activations]'):'';console[_0x3c5a7b(0xc8)]('\x0a'+a38_0x4e5aba[_0x3c5a7b(0x10c)]('New\x20segment:')+'\x20'+_0x55d33c+_0x35b8cc),console[_0x3c5a7b(0xc8)]('─'['repeat'](0x3c)),_0x57d1ef[_0x3c5a7b(0x111)]&&console['error'](_0x57d1ef['diff']),console['error']('─'['repeat'](0x3c));}if(_0x5ce1cb[_0x3c5a7b(0x146)]>0x0&&!_0x52f448[_0x3c5a7b(0x113)])for(const _0x5cb1f0 of _0x5ce1cb){const _0xa3674e=_0x5cb1f0[_0x3c5a7b(0xce)]?_0x1ffb9d[_0x3c5a7b(0x11c)](_0x5cb1f0[_0x3c5a7b(0xce)][_0x3c5a7b(0xca)]())||'':'',_0x3d9327=_0xa3674e?_0xa3674e+'/'+_0x5cb1f0[_0x3c5a7b(0xdf)]:_0x5cb1f0['name'],_0x2711d2=_0x264316[_0x3c5a7b(0x11c)](_0x5cb1f0['id'])||[],_0x1c7f21=_0x2711d2['length']>0x0?a38_0x4e5aba[_0x3c5a7b(0x142)]('\x20['+_0x2711d2['length']+_0x3c5a7b(0xc3)):'';console[_0x3c5a7b(0xc8)]('\x0a'+a38_0x4e5aba[_0x3c5a7b(0xcc)](_0x3c5a7b(0xb2))+'\x20'+_0x3d9327+_0x1c7f21),console[_0x3c5a7b(0xc8)]('─'[_0x3c5a7b(0xf4)](0x3c));const _0x231636=segmentWithActivationsToYaml(_0x5cb1f0,_0x2711d2,undefined,_0x116f92,_0x5f0336),_0x218ba2=segmentToYamlString(_0x231636),_0x2b49ed=generateDiff(_0x218ba2,'');console['error'](formatDiffWithColors(_0x2b49ed)),console[_0x3c5a7b(0xc8)]('─'[_0x3c5a7b(0xf4)](0x3c));}const _0x26b026=_0x5dbe71[_0x3c5a7b(0x124)](_0x27ca46=>!_0x27ca46['isNew']&&_0x27ca46[_0x3c5a7b(0x111)]);if(_0x26b026[_0x3c5a7b(0x146)]>0x0&&!_0x52f448['journeysOnly'])for(const _0x1e8484 of _0x26b026){const _0xce8a7a=_0x1e8484[_0x3c5a7b(0xb9)]?_0x1e8484[_0x3c5a7b(0xb9)]+'/'+_0x1e8484['yamlConfig'][_0x3c5a7b(0xdf)]:_0x1e8484['yamlConfig']['name'];console[_0x3c5a7b(0xc8)]('\x0a'+a38_0x4e5aba[_0x3c5a7b(0xe9)](_0x3c5a7b(0xd2))+'\x20'+_0xce8a7a),console['error']('─'['repeat'](0x3c)),console[_0x3c5a7b(0xc8)](_0x1e8484[_0x3c5a7b(0x111)]),console[_0x3c5a7b(0xc8)]('─'['repeat'](0x3c));}if(_0x30a19a[_0x3c5a7b(0x146)]>0x0)for(const _0x41b44d of _0x30a19a){const _0x49a774=_0x41b44d[_0x3c5a7b(0xb9)]?_0x41b44d[_0x3c5a7b(0xb9)]+'/'+_0x41b44d[_0x3c5a7b(0xa9)][_0x3c5a7b(0xdf)]:_0x41b44d[_0x3c5a7b(0xa9)][_0x3c5a7b(0xdf)];console['error']('\x0a'+a38_0x4e5aba[_0x3c5a7b(0x10c)](_0x3c5a7b(0x115))+'\x20'+_0x49a774),console[_0x3c5a7b(0xc8)]('─'[_0x3c5a7b(0xf4)](0x3c)),_0x41b44d[_0x3c5a7b(0x111)]&&console[_0x3c5a7b(0xc8)](_0x41b44d[_0x3c5a7b(0x111)]),console[_0x3c5a7b(0xc8)]('─'['repeat'](0x3c));}const _0x42ce37=_0x4e6ea6[_0x3c5a7b(0x124)](_0x21557a=>!_0x21557a[_0x3c5a7b(0x130)]&&_0x21557a[_0x3c5a7b(0x111)]);if(_0x42ce37[_0x3c5a7b(0x146)]>0x0)for(const _0x181be5 of _0x42ce37){const _0x43aed7=_0x181be5[_0x3c5a7b(0xb9)]?_0x181be5['folderPath']+'/'+_0x181be5[_0x3c5a7b(0xa9)]['name']:_0x181be5[_0x3c5a7b(0xa9)][_0x3c5a7b(0xdf)];console[_0x3c5a7b(0xc8)]('\x0a'+a38_0x4e5aba[_0x3c5a7b(0xe9)](_0x3c5a7b(0x129))+'\x20'+_0x43aed7),console[_0x3c5a7b(0xc8)]('─'[_0x3c5a7b(0xf4)](0x3c)),console[_0x3c5a7b(0xc8)](_0x181be5[_0x3c5a7b(0x111)]),console[_0x3c5a7b(0xc8)]('─'[_0x3c5a7b(0xf4)](0x3c));}if(_0x41325b['length']>0x0)for(const _0x429c8a of _0x41325b){const _0x5002ec=_0x429c8a[_0x3c5a7b(0xf3)]?_0x1ffb9d[_0x3c5a7b(0x11c)](_0x429c8a[_0x3c5a7b(0xf3)])||'':'',_0x109662=_0x5002ec?_0x5002ec+'/'+_0x429c8a['journeyBundleName']:_0x429c8a[_0x3c5a7b(0xbc)];console[_0x3c5a7b(0xc8)]('\x0a'+a38_0x4e5aba[_0x3c5a7b(0xcc)](_0x3c5a7b(0x140))+'\x20'+_0x109662),console['error']('─'[_0x3c5a7b(0xf4)](0x3c)),console[_0x3c5a7b(0xc8)](a38_0x4e5aba[_0x3c5a7b(0xcc)](_0x3c5a7b(0xae))),console[_0x3c5a7b(0xc8)]('─'['repeat'](0x3c));}if(_0x52f448[_0x3c5a7b(0x102)])return console['error'](a38_0x4e5aba[_0x3c5a7b(0xe9)]('\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made')),0x0;const _0x4c8329=_0x52f448[_0x3c5a7b(0x113)]?![]:_0x548329['length']>0x0||_0x42fc49[_0x3c5a7b(0x146)]>0x0||_0x5ce1cb[_0x3c5a7b(0x146)]>0x0,_0x283edb=_0x30a19a[_0x3c5a7b(0x146)]>0x0||_0x3ac9af[_0x3c5a7b(0x146)]>0x0||_0x41325b[_0x3c5a7b(0x146)]>0x0,_0x59b218=_0x52f448[_0x3c5a7b(0x113)]?![]:_0x48ad7d['length']>0x0,_0x1fe1b7=_0x3e4467['length']>0x0;if(!_0x4c8329&&!_0x283edb&&!_0x59b218&&!_0x1fe1b7){const _0x6bce9e=_0x52f448['journeysOnly']?_0x3c5a7b(0x13c):_0x3c5a7b(0x101);console['error'](a38_0x4e5aba[_0x3c5a7b(0x10c)](_0x6bce9e));if(_0x476586&&_0x12fc4d[_0x3c5a7b(0x146)]===0x1){const _0x15857a=_0x12fc4d[0x0];if(_0x15857a[_0x3c5a7b(0x136)]?.['id']){const _0x12f8f7=getConsoleNextUrl(_0x52f448[_0x3c5a7b(0x10b)],_0x3c5a7b(0xfc)+_0x491c87+_0x3c5a7b(0xb1)+_0x15857a[_0x3c5a7b(0x136)]['id']+_0x3c5a7b(0xe1));console[_0x3c5a7b(0xc8)](_0x3c5a7b(0xb8)+a38_0x4e5aba['cyan'](_0x12f8f7));}}if(_0x476586&&_0x49669e['length']===0x1){const _0x471786=_0x49669e[0x0];if(_0x471786[_0x3c5a7b(0xea)]?.['id']){const _0x39faf7=getConsoleNextUrl(_0x52f448[_0x3c5a7b(0x10b)],_0x3c5a7b(0xfc)+_0x491c87+_0x3c5a7b(0xb1)+_0x471786['existingJourney']['id']+_0x3c5a7b(0xfb));console[_0x3c5a7b(0xc8)]('\x20\x20'+a38_0x4e5aba['cyan'](_0x39faf7));}}return 0x0;}const _0x166522=_0x52f448[_0x3c5a7b(0x113)]?_0x30a19a[_0x3c5a7b(0x146)]+_0x3ac9af[_0x3c5a7b(0x146)]+_0x41325b[_0x3c5a7b(0x146)]+_0x3e4467['length']:_0x548329['length']+_0x42fc49[_0x3c5a7b(0x146)]+_0x5ce1cb[_0x3c5a7b(0x146)]+_0x30a19a['length']+_0x3ac9af[_0x3c5a7b(0x146)]+_0x41325b['length']+_0x3e4467[_0x3c5a7b(0x146)]+_0x48ad7d[_0x3c5a7b(0x146)];if(!_0x52f448[_0x3c5a7b(0x121)]&&_0x166522>0x0){if(!isInteractive())return console[_0x3c5a7b(0xc8)](a38_0x4e5aba[_0x3c5a7b(0xcc)]('\x0aError:'),_0x3c5a7b(0x112)),console[_0x3c5a7b(0xc8)](a38_0x4e5aba[_0x3c5a7b(0x142)](_0x3c5a7b(0x133))),0x1;const _0x454ccf=await confirmKey(_0x3c5a7b(0xb0)+_0x166522+_0x3c5a7b(0x139));if(!_0x454ccf)return console[_0x3c5a7b(0xc8)](a38_0x4e5aba[_0x3c5a7b(0xe9)]('Aborted.')),0x1;}const _0x26d29d={'withProgress':async(_0x40a06c,_0x37bd72)=>{const _0xbd7340=_0x3c5a7b,_0x8fe8da=await withSpinner(_0x40a06c,_0x37bd72,{'verbose':_0x52f448[_0xbd7340(0xde)]});return{'data':_0x8fe8da[_0xbd7340(0xc1)]};},'logInfo':_0x1271e4=>console['error'](a38_0x4e5aba[_0x3c5a7b(0xc5)]('✔\x20'+_0x1271e4)),'logSuccess':_0x558eb1=>console[_0x3c5a7b(0xc8)](a38_0x4e5aba[_0x3c5a7b(0x10c)]('✔\x20'+_0x558eb1)),'logWarning':_0x356c69=>console[_0x3c5a7b(0xc8)](a38_0x4e5aba[_0x3c5a7b(0xe9)]('⚠\x20'+_0x356c69)),'logDeleted':_0x57bc82=>console[_0x3c5a7b(0xc8)](a38_0x4e5aba[_0x3c5a7b(0xcc)]('✔\x20'+_0x57bc82))},_0x4fe8d7={'segment':_0x116ea1[_0x3c5a7b(0xba)],'journey':_0x116ea1['journey'],'user':_0x116ea1[_0x3c5a7b(0x12d)],'connection':_0x116ea1[_0x3c5a7b(0x144)]};_0x3e4467[_0x3c5a7b(0x146)]>0x0&&(_0x5b7fdd=await executePushFolders(_0x4fe8d7,_0x3e4467,_0x5b7fdd,{'parentId':_0x491c87},_0x26d29d));const _0x15b2ee={'rootFolderId':_0x5b8603,'folderPathToId':_0x5b7fdd,'folderIdToPath':_0x1ffb9d,'segmentNameToId':_0x3fd0ca,'activationsBySegmentId':_0x264316,'emailToIdMap':_0x13a137,'idToEmailMap':_0x116f92,'connectionNameToIdMap':_0x5c42ee['nameToId'],'connectionIdToNameMap':_0x5c42ee[_0x3c5a7b(0xdd)],'connectionNameToTypeMap':_0x9d4b3b},_0x2f6748=await executePushSegments(_0x4fe8d7,_0x52f448[_0x3c5a7b(0x113)]?[]:_0x5dbe71,_0x15b2ee,{'parentId':_0x491c87},_0x26d29d),_0x79f4f1=_0x2f6748[_0x3c5a7b(0x134)],_0x6948f6=_0x2f6748['updated'],_0x172d92=_0x2f6748[_0x3c5a7b(0x147)]['created'],_0x347570=_0x2f6748[_0x3c5a7b(0x147)][_0x3c5a7b(0xda)],_0x4ac78b=_0x2f6748[_0x3c5a7b(0x147)]['deleted'];let _0x49055f;if(_0x476586&&_0x5dbe71[_0x3c5a7b(0x146)]===0x1){const _0xf62acc=_0x5dbe71[0x0];_0x49055f=_0xf62acc[_0x3c5a7b(0x136)]?.['id']??_0x2f6748[_0x3c5a7b(0xe8)][_0x3c5a7b(0x11c)](_0xf62acc['yamlConfig']['name']);}const _0x5959e8=await executePushSegmentDeletions(_0x4fe8d7,_0x52f448['journeysOnly']?[]:_0x5ce1cb,_0x26d29d);let _0x4437a8=0x0,_0x47af50=0x0,_0x59c7e0=0x0;const _0x3cf6e5=new Map(_0x3fd0ca);for(const [_0x33e3b7,_0x4577ec]of _0x2f6748[_0x3c5a7b(0xe8)]){_0x3cf6e5[_0x3c5a7b(0xd1)](_0x33e3b7,_0x4577ec);}if(_0x4e6ea6[_0x3c5a7b(0x146)]>0x0){const _0x560d2d={..._0x15b2ee,'segmentNameToId':_0x3cf6e5,'existingSegments':_0xf51a17,'activationContext':_0x47459f},_0x43c816=await executePushJourneys(_0x4fe8d7,_0x4e6ea6,_0x560d2d,{'parentId':_0x491c87,'rootFolderId':_0x5b8603,'verbose':_0x52f448[_0x3c5a7b(0xde)]},_0x26d29d);_0x4437a8=_0x43c816['created'],_0x47af50=_0x43c816['updated'];if(_0x476586&&_0x43c816[_0x3c5a7b(0x131)]['length']===0x1){const _0x277fe4=_0x43c816[_0x3c5a7b(0x131)][0x0];if(_0x277fe4[_0x3c5a7b(0x12c)]){const _0x93fb2b=getConsoleNextUrl(_0x52f448[_0x3c5a7b(0x10b)],_0x3c5a7b(0xfc)+_0x491c87+_0x3c5a7b(0xb1)+_0x277fe4[_0x3c5a7b(0x12c)]+_0x3c5a7b(0xfb));console[_0x3c5a7b(0xc8)]('\x20\x20'+a38_0x4e5aba[_0x3c5a7b(0xf0)](_0x93fb2b));}}}for(const _0x14fc59 of _0x41325b){console[_0x3c5a7b(0xc8)](a38_0x4e5aba['yellow'](_0x3c5a7b(0xab)+_0x14fc59['journeyBundleName'])),_0x59c7e0++;}const _0x14bc9f=[];if(_0x79f4f1>0x0)_0x14bc9f[_0x3c5a7b(0x128)](_0x79f4f1+_0x3c5a7b(0x11b));if(_0x6948f6>0x0)_0x14bc9f[_0x3c5a7b(0x128)](_0x6948f6+_0x3c5a7b(0x119));if(_0x5959e8>0x0)_0x14bc9f[_0x3c5a7b(0x128)](_0x5959e8+_0x3c5a7b(0xd4));const _0x4ca3df=[];if(_0x4437a8>0x0)_0x4ca3df[_0x3c5a7b(0x128)](_0x4437a8+_0x3c5a7b(0x11b));if(_0x47af50>0x0)_0x4ca3df[_0x3c5a7b(0x128)](_0x47af50+_0x3c5a7b(0x119));if(_0x59c7e0>0x0)_0x4ca3df['push'](_0x59c7e0+_0x3c5a7b(0xd4));const _0x375941=[];if(_0x172d92>0x0)_0x375941[_0x3c5a7b(0x128)](_0x172d92+_0x3c5a7b(0x11b));if(_0x347570>0x0)_0x375941[_0x3c5a7b(0x128)](_0x347570+_0x3c5a7b(0x119));if(_0x4ac78b>0x0)_0x375941[_0x3c5a7b(0x128)](_0x4ac78b+_0x3c5a7b(0xd4));console[_0x3c5a7b(0xc8)](a38_0x4e5aba[_0x3c5a7b(0x10c)]('\x0a✔\x20Push\x20complete'));_0x14bc9f[_0x3c5a7b(0x146)]>0x0&&!_0x52f448[_0x3c5a7b(0x113)]&&console['error'](_0x3c5a7b(0x126)+_0x14bc9f[_0x3c5a7b(0xf5)](',\x20'));_0x4ca3df['length']>0x0&&console[_0x3c5a7b(0xc8)](_0x3c5a7b(0xdc)+_0x4ca3df[_0x3c5a7b(0xf5)](',\x20'));_0x375941[_0x3c5a7b(0x146)]>0x0&&!_0x52f448[_0x3c5a7b(0x113)]&&console[_0x3c5a7b(0xc8)]('\x20\x20Activations:\x20'+_0x375941[_0x3c5a7b(0xf5)](',\x20'));if(_0x49055f){const _0x4a212e=getConsoleNextUrl(_0x52f448[_0x3c5a7b(0x10b)],_0x3c5a7b(0xfc)+_0x491c87+'/e/'+_0x49055f+_0x3c5a7b(0xe1));console[_0x3c5a7b(0xc8)](_0x3c5a7b(0xb8)+a38_0x4e5aba['cyan'](_0x4a212e));}return 0x0;}}
1
+ const a39_0x56fbcf=a39_0x4106;(function(_0x332ef2,_0x215f88){const _0x23c17f=a39_0x4106,_0x427bbd=_0x332ef2();while(!![]){try{const _0x117715=parseInt(_0x23c17f(0x18c))/0x1*(parseInt(_0x23c17f(0x198))/0x2)+-parseInt(_0x23c17f(0x1b7))/0x3+-parseInt(_0x23c17f(0x1ad))/0x4*(-parseInt(_0x23c17f(0x211))/0x5)+parseInt(_0x23c17f(0x1dd))/0x6+parseInt(_0x23c17f(0x1b9))/0x7+parseInt(_0x23c17f(0x1b3))/0x8*(parseInt(_0x23c17f(0x1a8))/0x9)+-parseInt(_0x23c17f(0x1fa))/0xa;if(_0x117715===_0x215f88)break;else _0x427bbd['push'](_0x427bbd['shift']());}catch(_0x4f2522){_0x427bbd['push'](_0x427bbd['shift']());}}}(a39_0x5374,0xcf02c));import{BaseCommand}from'./command.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{generateDiff,formatDiffWithColors}from'../utils/diff.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{batchAsync}from'../utils/async.js';function a39_0x4106(_0x1f0070,_0x3986d6){_0x1f0070=_0x1f0070-0x17b;const _0x5374c4=a39_0x5374();let _0x410695=_0x5374c4[_0x1f0070];return _0x410695;}import{segmentToYamlString,segmentWithActivationsToYaml}from'../sdk/segment/child-segment-yaml.js';function a39_0x5374(){const _0x3bec7a=['\x20new','Fetching\x20existing\x20data...','\x20YAML\x20files\x20found','/sb/da/esr','✔\x20All\x20journeys\x20are\x20up\x20to\x20date','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','journeyBundleName','\x20updated','journey','35538540dCnoUA','attributes','\x20changes?','join','data','\x20\x20Activations:','delete','file','listSegments','connection','\x20\x20\x20\x20','segment','filter','paused','filePath','type','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','Preparing\x20journeys...','Folders\x20to\x20create:','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file','parent_name','resolveParentId','unchanged','1255QMtIRY','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','/j/da/je','getJourney','\x20unchanged','Resolving\x20parent\x20segment\x20\x27','deleted','endsWith','listJourneysWithDetailsFromParentSegment','cwd','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','name','journeysOnly','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','isNew','\x20to\x20create','idToName','\x20\x20🗺️\x20\x20Journeys:','138582MHJZnf','Source\x20directory:\x20','\x20\x20Journeys:\x20','diff','\x20\x20Segments:\x20','updatedAt','folderId','isScoped','map','createdAt','\x20created','segments','22sSaoce','dryRun','\x20deleted','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','buildUserMaps','no_parent','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','segment\x20or\x20journey','helpText','Scoped\x20to\x20folder:\x20','\x20folders\x20to\x20create','Site:\x20','nameToId','\x20activations]','activations','parentName','13377411wroeOR','toString','Delete\x20segment:','toCreate','results','23044BpGNeI','message','yellow','all','yes','journeyId','8MlfpLG','versionNumber','segment:push','error','4893426wObEAh','\x0aError:','8572837GZmjIu','repeat','\x20changed','audienceId','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','parentSegment','changed','user','\x20to\x20delete','description','folderPath','cyan','existingJourney','No\x20','folders','new','journeyBundleId','targetDir','Error:\x20','journeys','push','green','updated','setPhase','yamlConfig','listActivations','dim','site','Fetching\x20existing\x20activations...','verbose','get','state','relationships','Error:\x20Directory\x20not\x20found:\x20','\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20','\x20to\x20update','2108574dVgjWS','blue','createdSegmentIds','execute','created','.yml','New\x20journey:','\x20\x20📊\x20Segments:','length','existingSegment','parentFolder','errorCode','Delete\x20journey:','red','/e/','/app/ps/','.yaml','toDelete','toUpdate','set'];a39_0x5374=function(){return _0x3bec7a;};return a39_0x5374();}import a39_0x3f7344 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_0x56fbcf(0x185)]=a39_0x56fbcf(0x1b5);[a39_0x56fbcf(0x1c2)]=a39_0x56fbcf(0x17b);async[a39_0x56fbcf(0x1e0)](_0x568a12){const _0x1ebfa7=a39_0x56fbcf,{options:_0xdc122f,args:_0x350951,tdx:_0x605cc4}=_0x568a12,_0x2ce474=_0xdc122f,_0x5b5126=await resolveTarget({'arg':_0x350951[0x0],'contextParent':_0xdc122f[_0x1ebfa7(0x1be)],'cwd':process[_0x1ebfa7(0x183)]()});if(!isSuccessfulResolution(_0x5b5126))return _0x5b5126[_0x1ebfa7(0x1e8)]===_0x1ebfa7(0x19d)?(console[_0x1ebfa7(0x1b6)](a39_0x3f7344[_0x1ebfa7(0x1af)](_0x1ebfa7(0x19b))),console[_0x1ebfa7(0x1b6)]('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[_0x1ebfa7(0x1b6)](_0x1ebfa7(0x20a)),console[_0x1ebfa7(0x1b6)](_0x1ebfa7(0x20d))):(console[_0x1ebfa7(0x1b6)](a39_0x3f7344['red'](_0x1ebfa7(0x1cb)+_0x5b5126['message']+'\x0a')),_0x5b5126['helpText']&&console['error'](a39_0x3f7344[_0x1ebfa7(0x1c4)](_0x5b5126[_0x1ebfa7(0x1a0)]))),0x1;if(_0x5b5126[_0x1ebfa7(0x209)]===_0x1ebfa7(0x20e))return console[_0x1ebfa7(0x1b6)](a39_0x3f7344[_0x1ebfa7(0x1ea)](_0x1ebfa7(0x1da)+_0x5b5126['targetDir']+'\x0a')),console[_0x1ebfa7(0x1b6)](a39_0x3f7344['cyan']('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;const _0x3d1910=_0x5b5126[_0x1ebfa7(0x1a7)],_0x4f40bb=_0x5b5126[_0x1ebfa7(0x1ca)],_0x38797e=_0x5b5126[_0x1ebfa7(0x209)]===_0x1ebfa7(0x201)?_0x5b5126[_0x1ebfa7(0x208)]:undefined,_0x5b97b5=getScopedDetails(_0x5b5126),_0x344bfc=_0x5b97b5?.[_0x1ebfa7(0x193)]??![],_0x5a0c2f=_0x5b97b5?.['scopedFolderPath']??'';if(!existsSync(_0x4f40bb))return console[_0x1ebfa7(0x1b6)](a39_0x3f7344[_0x1ebfa7(0x1ea)](_0x1ebfa7(0x1da)+_0x4f40bb+'\x0a')),console[_0x1ebfa7(0x1b6)](a39_0x3f7344[_0x1ebfa7(0x1c4)]('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;_0x2ce474[_0x1ebfa7(0x1d6)]&&(console[_0x1ebfa7(0x1b6)](_0x1ebfa7(0x1a3)+_0x2ce474[_0x1ebfa7(0x1d4)]),console['error']('Parent\x20segment:\x20'+_0x3d1910),console[_0x1ebfa7(0x1b6)](_0x1ebfa7(0x18d)+_0x4f40bb),_0x344bfc&&console['error'](_0x1ebfa7(0x1a1)+_0x5a0c2f));const _0x24acda=await withSpinner(_0x1ebfa7(0x17f)+_0x3d1910+'\x27...',()=>_0x605cc4[_0x1ebfa7(0x205)][_0x1ebfa7(0x20f)](_0x3d1910),{'verbose':_0x2ce474[_0x1ebfa7(0x1d6)]}),_0x26b4fc=_0x24acda['data'],{parentSegmentResult:_0x3b830c,segmentsResult:_0x328b5d,foldersResult:_0x194c5e,journeysWithDetailsResult:_0x2098e8,userMaps:_0x321312}=await withSpinner(_0x1ebfa7(0x1f2),async()=>{const _0x280bc5=_0x1ebfa7,[_0x4a7ce1,_0x505768,_0x18784c,_0x5a7631,_0x1c171d]=await Promise[_0x280bc5(0x1b0)]([_0x605cc4[_0x280bc5(0x205)]['getParent'](_0x26b4fc),_0x605cc4[_0x280bc5(0x205)][_0x280bc5(0x202)](_0x26b4fc),_0x605cc4[_0x280bc5(0x205)]['listFolders'](_0x26b4fc),_0x605cc4['journey'][_0x280bc5(0x182)](_0x26b4fc,{'includeAllVersions':!![]}),_0x605cc4[_0x280bc5(0x1c0)][_0x280bc5(0x19c)]()]);return{'parentSegmentResult':_0x4a7ce1,'segmentsResult':_0x505768,'foldersResult':_0x18784c,'journeysWithDetailsResult':_0x5a7631,'userMaps':_0x1c171d};},{'verbose':_0x2ce474[_0x1ebfa7(0x1d6)]})['then'](_0x31c162=>_0x31c162[_0x1ebfa7(0x1fe)]),_0x51d9f2=_0x3b830c,_0x5dd792=extractRootFolderId(_0x51d9f2),_0x4437d6=_0x328b5d,_0x346221=_0x194c5e,{journeys:_0x5d8c9c,activationStepsById:_0x109a6f}=_0x2098e8,_0x2335c7=new Map(_0x5d8c9c[_0x1ebfa7(0x194)](_0x4f28a5=>[_0x4f28a5['id'],_0x4f28a5])),_0x1e0d9f=_0x5d8c9c[_0x1ebfa7(0x194)](_0xbcd361=>({'id':_0xbcd361['id'],'name':_0xbcd361[_0x1ebfa7(0x1fb)]['name'],'journeyBundleName':_0xbcd361[_0x1ebfa7(0x1fb)][_0x1ebfa7(0x1f7)]||'','journeyBundleId':_0xbcd361[_0x1ebfa7(0x1fb)][_0x1ebfa7(0x1c9)]||'','versionNumber':_0xbcd361[_0x1ebfa7(0x1fb)][_0x1ebfa7(0x1b4)],'description':_0xbcd361['attributes']['description'],'state':_0xbcd361[_0x1ebfa7(0x1fb)][_0x1ebfa7(0x1d8)],'paused':_0xbcd361[_0x1ebfa7(0x1fb)][_0x1ebfa7(0x207)],'audienceId':_0xbcd361[_0x1ebfa7(0x1fb)][_0x1ebfa7(0x1bc)],'folderId':_0xbcd361[_0x1ebfa7(0x1d9)]?.[_0x1ebfa7(0x1e7)]?.[_0x1ebfa7(0x1fe)]?.['id'],'createdAt':_0xbcd361[_0x1ebfa7(0x1fb)][_0x1ebfa7(0x195)],'updatedAt':_0xbcd361['attributes'][_0x1ebfa7(0x191)]})),{emailToId:_0x3e625f,idToEmail:_0x1fa4d3}=_0x321312,_0x6037b1=await withSpinner('Fetching\x20connections\x20for\x20name\x20resolution...',async()=>{const _0x2fc798=_0x1ebfa7,_0x1fb452=await _0x605cc4[_0x2fc798(0x203)]['list']();return buildConnectionMaps(_0x1fb452);},{'verbose':_0x2ce474[_0x1ebfa7(0x1d6)]})['then'](_0x34813e=>_0x34813e[_0x1ebfa7(0x1fe)]),_0x40ffb4=_0x6037b1[_0x1ebfa7(0x1a4)],_0x42af14=_0x6037b1['idToName'],_0x599adc=_0x6037b1['nameToType'],_0x2b3ce6={'emailToIdMap':_0x3e625f,'connectionNameToIdMap':_0x40ffb4,'connectionNameToTypeMap':_0x599adc,'getSchema':_0x2c9bc3=>_0x605cc4['connection']['getOutputSchemaWithCache'](_0x2c9bc3)};let {pathToId:_0x14e649,idToPath:_0x48b5fc}=buildFolderMaps(_0x346221);const _0x6b8145=buildSegmentLookupMap(_0x4437d6,_0x48b5fc),_0x1f1b04=buildSegmentNameToIdMap(_0x4437d6),_0x31ad98=buildJourneyBundleLookupMap(_0x1e0d9f,_0x48b5fc);let _0x334511;if(_0x38797e){if(!_0x38797e[_0x1ebfa7(0x181)](_0x1ebfa7(0x1e2))&&!_0x38797e[_0x1ebfa7(0x181)](_0x1ebfa7(0x1ed)))return console['error'](a39_0x3f7344[_0x1ebfa7(0x1ea)]('Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20'+_0x38797e+'\x0a')),0x1;_0x334511=[_0x38797e];}else _0x334511=findYamlFiles(_0x4f40bb);if(_0x334511[_0x1ebfa7(0x1e5)]===0x0)return console[_0x1ebfa7(0x1b6)](a39_0x3f7344['red'](_0x1ebfa7(0x1bd)+_0x4f40bb+'\x0a')),console[_0x1ebfa7(0x1b6)](a39_0x3f7344['cyan'](_0x1ebfa7(0x184))),0x1;let _0x70eb8c,_0x42edb1;try{const _0x2dbdc5=parseAndClassifyYamlFiles(_0x334511,_0x4f40bb,{'skipSegments':_0x2ce474[_0x1ebfa7(0x186)]});_0x70eb8c=_0x2dbdc5[_0x1ebfa7(0x197)],_0x42edb1=_0x2dbdc5[_0x1ebfa7(0x1cc)];const _0x1ae04b=validateParsedFiles(_0x2dbdc5,_0x4f40bb);if(_0x1ae04b[_0x1ebfa7(0x1e5)]>0x0)return console['error'](a39_0x3f7344[_0x1ebfa7(0x1ea)]('\x0aValidation\x20failed:')),console[_0x1ebfa7(0x1b6)](formatValidationErrors(_0x1ae04b)),console[_0x1ebfa7(0x1b6)](a39_0x3f7344[_0x1ebfa7(0x1af)]('\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.')),0x1;}catch(_0x1cd486){return console[_0x1ebfa7(0x1b6)](a39_0x3f7344[_0x1ebfa7(0x1ea)]('Error\x20parsing\x20YAML:\x20'+(_0x1cd486 instanceof Error?_0x1cd486[_0x1ebfa7(0x1ae)]:_0x1cd486))),0x1;}if(_0x70eb8c[_0x1ebfa7(0x1e5)]===0x0&&_0x42edb1[_0x1ebfa7(0x1e5)]===0x0){const _0x29325e=_0x2ce474[_0x1ebfa7(0x186)]?_0x1ebfa7(0x1f9):_0x1ebfa7(0x19f);return console[_0x1ebfa7(0x1b6)](a39_0x3f7344['yellow'](_0x1ebfa7(0x1c6)+_0x29325e+_0x1ebfa7(0x1f3))),0x0;}const _0x1fbe38=new Map();_0x4437d6[_0x1ebfa7(0x1e5)]>0x0&&!_0x2ce474[_0x1ebfa7(0x186)]&&await withSpinner(_0x1ebfa7(0x1d5),async()=>{await batchAsync(_0x4437d6,async _0x3f04e6=>{const _0x1bb821=a39_0x4106,_0x4498f4=await _0x605cc4['segment'][_0x1bb821(0x1d2)](_0x26b4fc,_0x3f04e6['id']);_0x1fbe38[_0x1bb821(0x1f0)](_0x3f04e6['id'],_0x4498f4);});},{'verbose':_0x2ce474[_0x1ebfa7(0x1d6)]});const {segmentFiles:_0x5c50b9,foldersToCreate:_0x474c57}=await prepareSegmentFiles(_0x70eb8c,{'segmentByFolderAndName':_0x6b8145,'activationsBySegmentId':_0x1fbe38,'folderPathToId':_0x14e649,'idToEmailMap':_0x1fa4d3,'connectionIdToNameMap':_0x42af14},_0x2b3ce6,_0x344bfc,_0x5a0c2f),_0x16f572=_0x38797e?[]:findSegmentsToDelete(_0x4437d6,_0x70eb8c[_0x1ebfa7(0x194)](({yamlConfig:_0x47c540,folderPath:_0x695ae4})=>({'yamlConfig':_0x47c540,'folderPath':resolveTDFolderPath(_0x695ae4,_0x344bfc,_0x5a0c2f)})),_0x48b5fc,_0x5a0c2f,_0x344bfc),{journeyFiles:_0x47a552,foldersToCreate:_0x43b327}=await withProgressSpinner(_0x1ebfa7(0x20b),async _0xf84429=>prepareJourneyFiles(_0x42edb1,{'fetchJourney':async _0x571ba8=>_0x605cc4[_0x1ebfa7(0x1f9)][_0x1ebfa7(0x17d)](_0x571ba8[_0x1ebfa7(0x1b2)]),'journeyBundlesByFolderAndName':_0x31ad98,'folderPathToId':_0x14e649,'idToEmailMap':_0x1fa4d3,'connectionIdToNameMap':_0x42af14,'existingSegments':_0x4437d6,'parentId':_0x26b4fc,'deps':_0x605cc4,'progress':{'update':_0x2c93d2=>{const _0x3ba0d5=_0x1ebfa7;_0xf84429[_0x3ba0d5(0x1d0)](_0x2c93d2),_0x2ce474['verbose']&&console[_0x3ba0d5(0x1b6)]('\x20\x20'+_0x2c93d2);}},'journeyById':_0x2335c7,'activationStepsById':_0x109a6f},_0x344bfc,_0x5a0c2f),{'verbose':_0x2ce474[_0x1ebfa7(0x1d6)]})['then'](_0x4cc9e6=>_0x4cc9e6['data']);for(const _0x1e8fa8 of _0x43b327){_0x474c57['add'](_0x1e8fa8);}const _0xc5bc54=_0x38797e?[]:findJourneysToDelete(_0x1e0d9f,_0x42edb1[_0x1ebfa7(0x194)](({yamlConfig:_0xdec5df,folderPath:_0x40f1b8})=>({'yamlConfig':_0xdec5df,'folderPath':resolveTDFolderPath(_0x40f1b8,_0x344bfc,_0x5a0c2f)})),_0x48b5fc,_0x5a0c2f,_0x344bfc),_0x323c14=calculatePushStats(_0x5c50b9,_0x47a552,_0x474c57,_0x16f572,_0xc5bc54,!!_0x2ce474[_0x1ebfa7(0x200)],!!_0x2ce474[_0x1ebfa7(0x186)]),_0x2dcf82=_0x323c14['segments'][_0x1ebfa7(0x1c8)],_0x575ebe=_0x323c14[_0x1ebfa7(0x197)]['changed'],_0x3bf774=_0x323c14[_0x1ebfa7(0x197)][_0x1ebfa7(0x210)],_0x425613=_0x323c14['segments'][_0x1ebfa7(0x1ee)],_0x3411ee=_0x323c14[_0x1ebfa7(0x1c7)]['toCreate'],_0x420e1e=_0x323c14['journeys']['new'],_0x41cc09=_0x323c14['journeys'][_0x1ebfa7(0x1bf)],_0x2cb846=_0x323c14['journeys'][_0x1ebfa7(0x210)],_0x192e92=_0x323c14[_0x1ebfa7(0x1cc)]['toDelete'],_0x418f8a=_0x323c14['activations'][_0x1ebfa7(0x1b0)],_0x3c90f6=_0x323c14[_0x1ebfa7(0x1a6)][_0x1ebfa7(0x1ab)],_0x3ffdfd=_0x323c14['activations'][_0x1ebfa7(0x1ef)],_0x416d81=_0x323c14[_0x1ebfa7(0x1a6)]['toDelete'];console[_0x1ebfa7(0x1b6)]('\x0aPush\x20summary\x20for\x20\x27'+_0x3d1910+'\x27:');_0x3411ee[_0x1ebfa7(0x1e5)]>0x0&&console[_0x1ebfa7(0x1b6)]('\x20\x20'+a39_0x3f7344[_0x1ebfa7(0x1de)]('📁\x20'+_0x3411ee[_0x1ebfa7(0x1e5)]+_0x1ebfa7(0x1a2)));if(!_0x2ce474['journeysOnly']){console['error'](_0x1ebfa7(0x1e4)),console[_0x1ebfa7(0x1b6)](_0x1ebfa7(0x204)+a39_0x3f7344[_0x1ebfa7(0x1ce)]('+\x20'+_0x2dcf82['length']+_0x1ebfa7(0x1f1))),console[_0x1ebfa7(0x1b6)](_0x1ebfa7(0x204)+a39_0x3f7344['yellow']('~\x20'+_0x575ebe[_0x1ebfa7(0x1e5)]+_0x1ebfa7(0x1bb)));if(_0x425613['length']>0x0)console[_0x1ebfa7(0x1b6)](_0x1ebfa7(0x204)+a39_0x3f7344[_0x1ebfa7(0x1ea)]('-\x20'+_0x425613[_0x1ebfa7(0x1e5)]+'\x20to\x20delete'));else _0x16f572[_0x1ebfa7(0x1e5)]>0x0&&!_0x2ce474[_0x1ebfa7(0x200)]&&console[_0x1ebfa7(0x1b6)](_0x1ebfa7(0x204)+a39_0x3f7344[_0x1ebfa7(0x1d3)](_0x16f572[_0x1ebfa7(0x1e5)]+_0x1ebfa7(0x19e)));console[_0x1ebfa7(0x1b6)](_0x1ebfa7(0x204)+a39_0x3f7344[_0x1ebfa7(0x1d3)]('=\x20'+_0x3bf774[_0x1ebfa7(0x1e5)]+_0x1ebfa7(0x17e)));}if(_0x47a552[_0x1ebfa7(0x1e5)]>0x0||_0xc5bc54[_0x1ebfa7(0x1e5)]>0x0){console[_0x1ebfa7(0x1b6)](_0x1ebfa7(0x18b)),console['error']('\x20\x20\x20\x20'+a39_0x3f7344[_0x1ebfa7(0x1ce)]('+\x20'+_0x420e1e[_0x1ebfa7(0x1e5)]+_0x1ebfa7(0x1f1))),console[_0x1ebfa7(0x1b6)](_0x1ebfa7(0x204)+a39_0x3f7344['yellow']('~\x20'+_0x41cc09[_0x1ebfa7(0x1e5)]+'\x20changed'));if(_0x192e92[_0x1ebfa7(0x1e5)]>0x0)console[_0x1ebfa7(0x1b6)]('\x20\x20\x20\x20'+a39_0x3f7344['red']('-\x20'+_0x192e92[_0x1ebfa7(0x1e5)]+'\x20to\x20delete'));else _0xc5bc54[_0x1ebfa7(0x1e5)]>0x0&&!_0x2ce474[_0x1ebfa7(0x200)]&&console[_0x1ebfa7(0x1b6)]('\x20\x20\x20\x20'+a39_0x3f7344[_0x1ebfa7(0x1d3)](_0xc5bc54[_0x1ebfa7(0x1e5)]+_0x1ebfa7(0x19e)));console[_0x1ebfa7(0x1b6)](_0x1ebfa7(0x204)+a39_0x3f7344[_0x1ebfa7(0x1d3)]('=\x20'+_0x2cb846[_0x1ebfa7(0x1e5)]+_0x1ebfa7(0x17e)));}_0x418f8a[_0x1ebfa7(0x1e5)]>0x0&&!_0x2ce474[_0x1ebfa7(0x186)]&&(console[_0x1ebfa7(0x1b6)](''),console[_0x1ebfa7(0x1b6)](_0x1ebfa7(0x1ff)),_0x3c90f6[_0x1ebfa7(0x1e5)]>0x0&&console[_0x1ebfa7(0x1b6)](_0x1ebfa7(0x204)+a39_0x3f7344[_0x1ebfa7(0x1ce)]('+\x20'+_0x3c90f6['length']+_0x1ebfa7(0x189))),_0x3ffdfd[_0x1ebfa7(0x1e5)]>0x0&&console['error']('\x20\x20\x20\x20'+a39_0x3f7344['yellow']('~\x20'+_0x3ffdfd[_0x1ebfa7(0x1e5)]+_0x1ebfa7(0x1dc))),_0x416d81['length']>0x0&&console[_0x1ebfa7(0x1b6)](_0x1ebfa7(0x204)+a39_0x3f7344[_0x1ebfa7(0x1ea)]('-\x20'+_0x416d81[_0x1ebfa7(0x1e5)]+_0x1ebfa7(0x1c1))));console['error']('\x20\x20Source:\x20'+a39_0x3f7344[_0x1ebfa7(0x1c4)](_0x4f40bb)+'\x0a');if(_0x3411ee[_0x1ebfa7(0x1e5)]>0x0){console['error'](_0x1ebfa7(0x20c));for(const _0x47b279 of _0x3411ee){console[_0x1ebfa7(0x1b6)]('\x20\x20'+a39_0x3f7344[_0x1ebfa7(0x1de)]('+')+'\x20'+_0x47b279);}console[_0x1ebfa7(0x1b6)]('');}if(_0x2dcf82['length']>0x0&&!_0x2ce474[_0x1ebfa7(0x186)])for(const _0x52e78c of _0x2dcf82){const _0x5e32ac=_0x52e78c['folderPath']?_0x52e78c[_0x1ebfa7(0x1c3)]+'/'+_0x52e78c['yamlConfig']['name']:_0x52e78c[_0x1ebfa7(0x1d1)]['name'],_0x515901=_0x52e78c[_0x1ebfa7(0x1d1)]['activations']?.[_0x1ebfa7(0x1e5)]||0x0,_0x2f8dbb=_0x515901>0x0?a39_0x3f7344['dim']('\x20['+_0x515901+_0x1ebfa7(0x1a5)):'';console[_0x1ebfa7(0x1b6)]('\x0a'+a39_0x3f7344[_0x1ebfa7(0x1ce)]('New\x20segment:')+'\x20'+_0x5e32ac+_0x2f8dbb),console[_0x1ebfa7(0x1b6)]('─'[_0x1ebfa7(0x1ba)](0x3c)),_0x52e78c[_0x1ebfa7(0x18f)]&&console[_0x1ebfa7(0x1b6)](_0x52e78c[_0x1ebfa7(0x18f)]),console[_0x1ebfa7(0x1b6)]('─'[_0x1ebfa7(0x1ba)](0x3c));}if(_0x425613[_0x1ebfa7(0x1e5)]>0x0&&!_0x2ce474['journeysOnly'])for(const _0x28a705 of _0x425613){const _0x16c7a2=_0x28a705['segmentFolderId']?_0x48b5fc[_0x1ebfa7(0x1d7)](_0x28a705['segmentFolderId'][_0x1ebfa7(0x1a9)]())||'':'',_0xddd106=_0x16c7a2?_0x16c7a2+'/'+_0x28a705[_0x1ebfa7(0x185)]:_0x28a705['name'],_0x3e0f14=_0x1fbe38[_0x1ebfa7(0x1d7)](_0x28a705['id'])||[],_0x5231c6=_0x3e0f14['length']>0x0?a39_0x3f7344['dim']('\x20['+_0x3e0f14['length']+'\x20activations]'):'';console[_0x1ebfa7(0x1b6)]('\x0a'+a39_0x3f7344['red'](_0x1ebfa7(0x1aa))+'\x20'+_0xddd106+_0x5231c6),console[_0x1ebfa7(0x1b6)]('─'[_0x1ebfa7(0x1ba)](0x3c));const _0x15dff6=segmentWithActivationsToYaml(_0x28a705,_0x3e0f14,undefined,_0x1fa4d3,_0x42af14),_0x41ee1a=segmentToYamlString(_0x15dff6),_0xcd2b30=generateDiff(_0x41ee1a,'');console[_0x1ebfa7(0x1b6)](formatDiffWithColors(_0xcd2b30)),console['error']('─'['repeat'](0x3c));}const _0x235780=_0x5c50b9[_0x1ebfa7(0x206)](_0x424c56=>!_0x424c56[_0x1ebfa7(0x188)]&&_0x424c56[_0x1ebfa7(0x18f)]);if(_0x235780[_0x1ebfa7(0x1e5)]>0x0&&!_0x2ce474[_0x1ebfa7(0x186)])for(const _0x2757ad of _0x235780){const _0x13e891=_0x2757ad[_0x1ebfa7(0x1c3)]?_0x2757ad[_0x1ebfa7(0x1c3)]+'/'+_0x2757ad['yamlConfig'][_0x1ebfa7(0x185)]:_0x2757ad[_0x1ebfa7(0x1d1)]['name'];console['error']('\x0a'+a39_0x3f7344['yellow']('Changes\x20to:')+'\x20'+_0x13e891),console[_0x1ebfa7(0x1b6)]('─'[_0x1ebfa7(0x1ba)](0x3c)),console[_0x1ebfa7(0x1b6)](_0x2757ad['diff']),console[_0x1ebfa7(0x1b6)]('─'[_0x1ebfa7(0x1ba)](0x3c));}if(_0x420e1e[_0x1ebfa7(0x1e5)]>0x0)for(const _0x3e82ef of _0x420e1e){const _0x3607ac=_0x3e82ef[_0x1ebfa7(0x1c3)]?_0x3e82ef[_0x1ebfa7(0x1c3)]+'/'+_0x3e82ef['yamlConfig'][_0x1ebfa7(0x185)]:_0x3e82ef[_0x1ebfa7(0x1d1)][_0x1ebfa7(0x185)];console['error']('\x0a'+a39_0x3f7344[_0x1ebfa7(0x1ce)](_0x1ebfa7(0x1e3))+'\x20'+_0x3607ac),console[_0x1ebfa7(0x1b6)]('─'['repeat'](0x3c)),_0x3e82ef[_0x1ebfa7(0x18f)]&&console['error'](_0x3e82ef[_0x1ebfa7(0x18f)]),console[_0x1ebfa7(0x1b6)]('─'[_0x1ebfa7(0x1ba)](0x3c));}const _0x23c55f=_0x47a552[_0x1ebfa7(0x206)](_0x4524ee=>!_0x4524ee[_0x1ebfa7(0x188)]&&_0x4524ee[_0x1ebfa7(0x18f)]);if(_0x23c55f['length']>0x0)for(const _0x40dc07 of _0x23c55f){const _0x4be684=_0x40dc07[_0x1ebfa7(0x1c3)]?_0x40dc07[_0x1ebfa7(0x1c3)]+'/'+_0x40dc07[_0x1ebfa7(0x1d1)][_0x1ebfa7(0x185)]:_0x40dc07['yamlConfig'][_0x1ebfa7(0x185)];console[_0x1ebfa7(0x1b6)]('\x0a'+a39_0x3f7344['yellow']('Changes\x20to\x20journey:')+'\x20'+_0x4be684),console[_0x1ebfa7(0x1b6)]('─'[_0x1ebfa7(0x1ba)](0x3c)),console[_0x1ebfa7(0x1b6)](_0x40dc07['diff']),console['error']('─'[_0x1ebfa7(0x1ba)](0x3c));}if(_0x192e92[_0x1ebfa7(0x1e5)]>0x0)for(const _0x434590 of _0x192e92){const _0x3e12df=_0x434590[_0x1ebfa7(0x192)]?_0x48b5fc[_0x1ebfa7(0x1d7)](_0x434590[_0x1ebfa7(0x192)])||'':'',_0x128064=_0x3e12df?_0x3e12df+'/'+_0x434590[_0x1ebfa7(0x1f7)]:_0x434590[_0x1ebfa7(0x1f7)];console[_0x1ebfa7(0x1b6)]('\x0a'+a39_0x3f7344[_0x1ebfa7(0x1ea)](_0x1ebfa7(0x1e9))+'\x20'+_0x128064),console[_0x1ebfa7(0x1b6)]('─'[_0x1ebfa7(0x1ba)](0x3c)),console[_0x1ebfa7(0x1b6)](a39_0x3f7344[_0x1ebfa7(0x1ea)]('(Journey\x20will\x20be\x20deleted)')),console[_0x1ebfa7(0x1b6)]('─'['repeat'](0x3c));}if(_0x2ce474[_0x1ebfa7(0x199)])return console[_0x1ebfa7(0x1b6)](a39_0x3f7344[_0x1ebfa7(0x1af)](_0x1ebfa7(0x1f6))),0x0;const _0x9c8d82=_0x2ce474['journeysOnly']?![]:_0x2dcf82[_0x1ebfa7(0x1e5)]>0x0||_0x575ebe[_0x1ebfa7(0x1e5)]>0x0||_0x425613[_0x1ebfa7(0x1e5)]>0x0,_0x562d3c=_0x420e1e[_0x1ebfa7(0x1e5)]>0x0||_0x41cc09['length']>0x0||_0x192e92[_0x1ebfa7(0x1e5)]>0x0,_0x28be3d=_0x2ce474[_0x1ebfa7(0x186)]?![]:_0x418f8a[_0x1ebfa7(0x1e5)]>0x0,_0x3ac517=_0x3411ee[_0x1ebfa7(0x1e5)]>0x0;if(!_0x9c8d82&&!_0x562d3c&&!_0x28be3d&&!_0x3ac517){const _0x486c43=_0x2ce474[_0x1ebfa7(0x186)]?_0x1ebfa7(0x1f5):'✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date';console[_0x1ebfa7(0x1b6)](a39_0x3f7344['green'](_0x486c43));if(_0x38797e&&_0x3bf774['length']===0x1){const _0x373ec0=_0x3bf774[0x0];if(_0x373ec0[_0x1ebfa7(0x1e6)]?.['id']){const _0x226667=getConsoleNextUrl(_0x2ce474['site'],_0x1ebfa7(0x1ec)+_0x26b4fc+'/e/'+_0x373ec0[_0x1ebfa7(0x1e6)]['id']+_0x1ebfa7(0x1f4));console[_0x1ebfa7(0x1b6)](_0x1ebfa7(0x1db)+a39_0x3f7344['cyan'](_0x226667));}}if(_0x38797e&&_0x2cb846[_0x1ebfa7(0x1e5)]===0x1){const _0x1b7642=_0x2cb846[0x0];if(_0x1b7642['existingJourney']?.['id']){const _0x4cde9e=getConsoleNextUrl(_0x2ce474[_0x1ebfa7(0x1d4)],_0x1ebfa7(0x1ec)+_0x26b4fc+'/e/'+_0x1b7642[_0x1ebfa7(0x1c5)]['id']+_0x1ebfa7(0x17c));console[_0x1ebfa7(0x1b6)]('\x20\x20'+a39_0x3f7344[_0x1ebfa7(0x1c4)](_0x4cde9e));}}return 0x0;}const _0x3a92fb=_0x2ce474['journeysOnly']?_0x420e1e['length']+_0x41cc09[_0x1ebfa7(0x1e5)]+_0x192e92[_0x1ebfa7(0x1e5)]+_0x3411ee[_0x1ebfa7(0x1e5)]:_0x2dcf82[_0x1ebfa7(0x1e5)]+_0x575ebe['length']+_0x425613[_0x1ebfa7(0x1e5)]+_0x420e1e[_0x1ebfa7(0x1e5)]+_0x41cc09[_0x1ebfa7(0x1e5)]+_0x192e92[_0x1ebfa7(0x1e5)]+_0x3411ee[_0x1ebfa7(0x1e5)]+_0x418f8a[_0x1ebfa7(0x1e5)];if(!_0x2ce474[_0x1ebfa7(0x1b1)]&&_0x3a92fb>0x0){if(!isInteractive())return console[_0x1ebfa7(0x1b6)](a39_0x3f7344[_0x1ebfa7(0x1ea)](_0x1ebfa7(0x1b8)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x1ebfa7(0x1b6)](a39_0x3f7344[_0x1ebfa7(0x1d3)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x35989a=await confirmKey('Push\x20'+_0x3a92fb+_0x1ebfa7(0x1fc));if(!_0x35989a)return console[_0x1ebfa7(0x1b6)](a39_0x3f7344[_0x1ebfa7(0x1af)]('Aborted.')),0x1;}const _0x5e26e6={'withProgress':async(_0x22be99,_0x87939f)=>{const _0xd6f7f4=_0x1ebfa7,_0xacb18b=await withSpinner(_0x22be99,_0x87939f,{'verbose':_0x2ce474[_0xd6f7f4(0x1d6)]});return{'data':_0xacb18b[_0xd6f7f4(0x1fe)]};},'logInfo':_0x50a092=>console['error'](a39_0x3f7344[_0x1ebfa7(0x1de)]('✔\x20'+_0x50a092)),'logSuccess':_0x4adc27=>console[_0x1ebfa7(0x1b6)](a39_0x3f7344['green']('✔\x20'+_0x4adc27)),'logWarning':_0x31f058=>console['error'](a39_0x3f7344[_0x1ebfa7(0x1af)]('⚠\x20'+_0x31f058)),'logDeleted':_0x5f555b=>console['error'](a39_0x3f7344[_0x1ebfa7(0x1ea)]('✔\x20'+_0x5f555b))},_0x3c97cf={'segment':_0x605cc4[_0x1ebfa7(0x205)],'journey':_0x605cc4['journey'],'user':_0x605cc4[_0x1ebfa7(0x1c0)],'connection':_0x605cc4[_0x1ebfa7(0x203)]};_0x3411ee[_0x1ebfa7(0x1e5)]>0x0&&(_0x14e649=await executePushFolders(_0x3c97cf,_0x3411ee,_0x14e649,{'parentId':_0x26b4fc},_0x5e26e6));const _0x47a9c3={'rootFolderId':_0x5dd792,'folderPathToId':_0x14e649,'folderIdToPath':_0x48b5fc,'segmentNameToId':_0x1f1b04,'activationsBySegmentId':_0x1fbe38,'emailToIdMap':_0x3e625f,'idToEmailMap':_0x1fa4d3,'connectionNameToIdMap':_0x6037b1[_0x1ebfa7(0x1a4)],'connectionIdToNameMap':_0x6037b1[_0x1ebfa7(0x18a)],'connectionNameToTypeMap':_0x599adc},_0x30865c=await executePushSegments(_0x3c97cf,_0x2ce474[_0x1ebfa7(0x186)]?[]:_0x5c50b9,_0x47a9c3,{'parentId':_0x26b4fc},_0x5e26e6),_0x173426=_0x30865c[_0x1ebfa7(0x1e1)],_0x580c3e=_0x30865c[_0x1ebfa7(0x1cf)],_0x3b0eca=_0x30865c[_0x1ebfa7(0x1a6)]['created'],_0x5e3a18=_0x30865c[_0x1ebfa7(0x1a6)][_0x1ebfa7(0x1cf)],_0x1910a3=_0x30865c[_0x1ebfa7(0x1a6)][_0x1ebfa7(0x180)];let _0x9b1c3b;if(_0x38797e&&_0x5c50b9[_0x1ebfa7(0x1e5)]===0x1){const _0x54885d=_0x5c50b9[0x0];_0x9b1c3b=_0x54885d[_0x1ebfa7(0x1e6)]?.['id']??_0x30865c[_0x1ebfa7(0x1df)][_0x1ebfa7(0x1d7)](_0x54885d[_0x1ebfa7(0x1d1)]['name']);}const _0x1ceebf=await executePushSegmentDeletions(_0x3c97cf,_0x2ce474[_0x1ebfa7(0x186)]?[]:_0x425613,_0x5e26e6);let _0x358e50=0x0,_0x55e924=0x0,_0x5b9c92=0x0;const _0x4d263f=new Map(_0x1f1b04);for(const [_0x27cf7d,_0x2f691c]of _0x30865c[_0x1ebfa7(0x1df)]){_0x4d263f['set'](_0x27cf7d,_0x2f691c);}if(_0x47a552[_0x1ebfa7(0x1e5)]>0x0){const _0x51615d={..._0x47a9c3,'segmentNameToId':_0x4d263f,'existingSegments':_0x4437d6,'activationContext':_0x2b3ce6},_0x11dcd2=await executePushJourneys(_0x3c97cf,_0x47a552,_0x51615d,{'parentId':_0x26b4fc,'rootFolderId':_0x5dd792,'verbose':_0x2ce474[_0x1ebfa7(0x1d6)]},_0x5e26e6);_0x358e50=_0x11dcd2[_0x1ebfa7(0x1e1)],_0x55e924=_0x11dcd2[_0x1ebfa7(0x1cf)];if(_0x38797e&&_0x11dcd2[_0x1ebfa7(0x1ac)][_0x1ebfa7(0x1e5)]===0x1){const _0x540c93=_0x11dcd2[_0x1ebfa7(0x1ac)][0x0];if(_0x540c93['journeyId']){const _0x1ad484=getConsoleNextUrl(_0x2ce474[_0x1ebfa7(0x1d4)],_0x1ebfa7(0x1ec)+_0x26b4fc+_0x1ebfa7(0x1eb)+_0x540c93['journeyId']+_0x1ebfa7(0x17c));console[_0x1ebfa7(0x1b6)]('\x20\x20'+a39_0x3f7344[_0x1ebfa7(0x1c4)](_0x1ad484));}}}for(const _0x583b72 of _0x192e92){console[_0x1ebfa7(0x1b6)](a39_0x3f7344['yellow'](_0x1ebfa7(0x187)+_0x583b72['journeyBundleName'])),_0x5b9c92++;}const _0x257d5c=[];if(_0x173426>0x0)_0x257d5c['push'](_0x173426+_0x1ebfa7(0x196));if(_0x580c3e>0x0)_0x257d5c[_0x1ebfa7(0x1cd)](_0x580c3e+'\x20updated');if(_0x1ceebf>0x0)_0x257d5c['push'](_0x1ceebf+'\x20deleted');const _0x15aebd=[];if(_0x358e50>0x0)_0x15aebd[_0x1ebfa7(0x1cd)](_0x358e50+_0x1ebfa7(0x196));if(_0x55e924>0x0)_0x15aebd[_0x1ebfa7(0x1cd)](_0x55e924+_0x1ebfa7(0x1f8));if(_0x5b9c92>0x0)_0x15aebd[_0x1ebfa7(0x1cd)](_0x5b9c92+_0x1ebfa7(0x19a));const _0x78791c=[];if(_0x3b0eca>0x0)_0x78791c['push'](_0x3b0eca+_0x1ebfa7(0x196));if(_0x5e3a18>0x0)_0x78791c[_0x1ebfa7(0x1cd)](_0x5e3a18+_0x1ebfa7(0x1f8));if(_0x1910a3>0x0)_0x78791c[_0x1ebfa7(0x1cd)](_0x1910a3+_0x1ebfa7(0x19a));console[_0x1ebfa7(0x1b6)](a39_0x3f7344[_0x1ebfa7(0x1ce)]('\x0a✔\x20Push\x20complete'));_0x257d5c['length']>0x0&&!_0x2ce474[_0x1ebfa7(0x186)]&&console[_0x1ebfa7(0x1b6)](_0x1ebfa7(0x190)+_0x257d5c[_0x1ebfa7(0x1fd)](',\x20'));_0x15aebd['length']>0x0&&console[_0x1ebfa7(0x1b6)](_0x1ebfa7(0x18e)+_0x15aebd['join'](',\x20'));_0x78791c[_0x1ebfa7(0x1e5)]>0x0&&!_0x2ce474[_0x1ebfa7(0x186)]&&console['error']('\x20\x20Activations:\x20'+_0x78791c[_0x1ebfa7(0x1fd)](',\x20'));if(_0x9b1c3b){const _0x3adb8f=getConsoleNextUrl(_0x2ce474[_0x1ebfa7(0x1d4)],'/app/ps/'+_0x26b4fc+_0x1ebfa7(0x1eb)+_0x9b1c3b+_0x1ebfa7(0x1f4));console['error'](_0x1ebfa7(0x1db)+a39_0x3f7344[_0x1ebfa7(0x1c4)](_0x3adb8f));}return 0x0;}}
@@ -1 +1 @@
1
- const a39_0x4ad2ac=a39_0x4414;(function(_0x202d47,_0x3cf374){const _0x4c5839=a39_0x4414,_0xb13aeb=_0x202d47();while(!![]){try{const _0x11c407=-parseInt(_0x4c5839(0x181))/0x1*(-parseInt(_0x4c5839(0x185))/0x2)+-parseInt(_0x4c5839(0x17c))/0x3*(parseInt(_0x4c5839(0x176))/0x4)+-parseInt(_0x4c5839(0x168))/0x5*(-parseInt(_0x4c5839(0x160))/0x6)+-parseInt(_0x4c5839(0x177))/0x7+parseInt(_0x4c5839(0x188))/0x8+parseInt(_0x4c5839(0x170))/0x9*(parseInt(_0x4c5839(0x16b))/0xa)+-parseInt(_0x4c5839(0x165))/0xb;if(_0x11c407===_0x3cf374)break;else _0xb13aeb['push'](_0xb13aeb['shift']());}catch(_0x4eb0f4){_0xb13aeb['push'](_0xb13aeb['shift']());}}}(a39_0x4153,0xa2489));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';function a39_0x4153(){const _0x18bee2=['folder','Resolved\x20type:\x20','type','updateSegmentById','13953FbmHZq','Updating\x20segment\x20\x27','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','.\x20Only\x20child\x20segments\x20can\x20be\x20updated.','Resolving\x20path\x20\x27','1271359ShkqPd','yellow','Resolved\x20relative\x20path\x20to:\x20','data','2PbLOMK','\x20\x20\x20Path:\x20','error','6790776iSlQCU','includes','122964HurJfI','segment','segmentId','execute','Parent\x20ID:\x20','2316369SGBHjn','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','name','10jzymbn','kind','Error:\x20Cannot\x20update\x20','2612430rFKnQE','\x27...','Segment\x20ID:\x20','Update\x20existing\x20child\x20segment','\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','27qWYHjK','description','ruleFile','resolveFolderId','verbose','Segment\x20ID\x20missing\x20from\x20resolved\x20path','1136OtJoqw','5241229fvwqfp'];a39_0x4153=function(){return _0x18bee2;};return a39_0x4153();}function a39_0x4414(_0x508daf,_0x14104d){_0x508daf=_0x508daf-0x160;const _0x41530c=a39_0x4153();let _0x441450=_0x41530c[_0x508daf];return _0x441450;}import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{SDKError,ErrorCode}from'../sdk/index.js';import a39_0x59e351 from'chalk';export class SegmentUpdateCommand extends BaseCommand{[a39_0x4ad2ac(0x167)]='segment:update';[a39_0x4ad2ac(0x171)]=a39_0x4ad2ac(0x16e);async[a39_0x4ad2ac(0x163)](_0x15ab12){const _0x228e25=a39_0x4ad2ac;console[_0x228e25(0x187)](a39_0x59e351[_0x228e25(0x182)]('⚠\x20Deprecation\x20warning:\x20`segment\x20update`\x20is\x20deprecated.')),console['error'](a39_0x59e351['yellow'](_0x228e25(0x166)));const {options:_0xd2a12d,args:_0x22f197,tdx:_0x212930}=_0x15ab12,_0x102858=_0xd2a12d;if(_0x22f197['length']===0x0)return console[_0x228e25(0x187)](_0x228e25(0x17e)),console[_0x228e25(0x187)]('Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]'),console[_0x228e25(0x187)]('Examples:'),console[_0x228e25(0x187)]('\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22'),console[_0x228e25(0x187)](_0x228e25(0x16f)),0x1;const _0x1cdec4=_0x22f197[0x0],_0x2bf59b=_0xd2a12d['segmentPath'];let _0x21c907=_0x1cdec4;_0x2bf59b&&!_0x1cdec4[_0x228e25(0x189)]('/')&&(_0x21c907=_0x2bf59b+'/'+_0x1cdec4,_0x102858[_0x228e25(0x174)]&&console[_0x228e25(0x187)](_0x228e25(0x183)+_0x21c907));const _0x1eb841=await withSpinner(_0x228e25(0x180)+_0x21c907+'\x27...',()=>_0x212930[_0x228e25(0x161)]['resolvePathToResource'](_0x21c907),{'verbose':_0x102858[_0x228e25(0x174)]}),_0x4074fd=_0x1eb841[_0x228e25(0x184)];_0x102858[_0x228e25(0x174)]&&console[_0x228e25(0x187)](_0x228e25(0x179)+_0x4074fd[_0x228e25(0x17a)]);if(_0x4074fd['type']!=='segment')return console[_0x228e25(0x187)](_0x228e25(0x16a)+_0x4074fd[_0x228e25(0x17a)]+_0x228e25(0x17f)),console[_0x228e25(0x187)]('Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]'),0x1;if(!_0x4074fd[_0x228e25(0x162)])throw new SDKError(ErrorCode['INTERNAL'],_0x228e25(0x175));const _0x1c5ca7=_0x4074fd['parentId'],_0x2b10bf=_0x4074fd[_0x228e25(0x162)];_0x102858[_0x228e25(0x174)]&&(console[_0x228e25(0x187)](_0x228e25(0x164)+_0x1c5ca7),console[_0x228e25(0x187)](_0x228e25(0x16d)+_0x2b10bf));let _0x25c239;if(_0x102858[_0x228e25(0x178)]){const _0x41c5b9=_0x102858['folder'],_0x321d9d=await withSpinner('Resolving\x20folder\x20\x27'+_0x41c5b9+_0x228e25(0x16c),()=>_0x212930[_0x228e25(0x161)][_0x228e25(0x173)](_0x1c5ca7,_0x41c5b9),{'verbose':_0x102858[_0x228e25(0x174)]});_0x25c239=parseInt(_0x321d9d[_0x228e25(0x184)],0xa),_0x102858[_0x228e25(0x174)]&&console[_0x228e25(0x187)]('Resolved\x20folder\x20ID:\x20'+_0x25c239);}const _0x14d894=await loadJSONFromOptions(_0x102858['rule'],_0x102858[_0x228e25(0x172)]),_0x32686f={'name':_0x102858[_0x228e25(0x167)],'description':_0x102858['description'],'rule':_0x14d894,'kind':_0x102858['kind']!==undefined?parseInt(_0x102858[_0x228e25(0x169)],0xa):undefined,'segmentFolderId':_0x25c239},_0x4cf03b=await withSpinner(_0x228e25(0x17d)+_0x4074fd['segmentName']+'\x27...',()=>_0x212930[_0x228e25(0x161)][_0x228e25(0x17b)](_0x1c5ca7,_0x2b10bf,_0x32686f),{'verbose':_0x102858[_0x228e25(0x174)]}),_0x5acf53=_0x4cf03b[_0x228e25(0x184)];return console[_0x228e25(0x187)]('✔\x20Updated\x20segment\x20\x27'+_0x5acf53[_0x228e25(0x167)]+'\x27'),_0x21c907!==_0x1cdec4&&console[_0x228e25(0x187)](_0x228e25(0x186)+_0x21c907),await handleSDKOutput([_0x5acf53],_0x102858),0x0;}}
1
+ const a40_0x274279=a40_0x5569;(function(_0xc67026,_0x5e0e64){const _0x5e8469=a40_0x5569,_0x123bfc=_0xc67026();while(!![]){try{const _0x185f57=parseInt(_0x5e8469(0x16f))/0x1*(parseInt(_0x5e8469(0x15d))/0x2)+parseInt(_0x5e8469(0x163))/0x3*(-parseInt(_0x5e8469(0x164))/0x4)+-parseInt(_0x5e8469(0x173))/0x5*(-parseInt(_0x5e8469(0x14c))/0x6)+-parseInt(_0x5e8469(0x14a))/0x7+parseInt(_0x5e8469(0x16b))/0x8+parseInt(_0x5e8469(0x161))/0x9*(parseInt(_0x5e8469(0x15c))/0xa)+-parseInt(_0x5e8469(0x151))/0xb;if(_0x185f57===_0x5e0e64)break;else _0x123bfc['push'](_0x123bfc['shift']());}catch(_0x2a659d){_0x123bfc['push'](_0x123bfc['shift']());}}}(a40_0x3b06,0xeca1f));function a40_0x5569(_0x3d897d,_0x281208){_0x3d897d=_0x3d897d-0x149;const _0x3b06e6=a40_0x3b06();let _0x5569b9=_0x3b06e6[_0x3d897d];return _0x5569b9;}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_0x181a08 from'chalk';function a40_0x3b06(){const _0x5aff07=['Updating\x20segment\x20\x27','rule','updateSegmentById','✔\x20Updated\x20segment\x20\x27','8144960TAdwsP','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22','yellow','1hqfLQi','Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]','Examples:','kind','505JXESUl','INTERNAL','ruleFile','error','Resolved\x20relative\x20path\x20to:\x20','7398314wwlBlM','Segment\x20ID\x20missing\x20from\x20resolved\x20path','6462gFBXyK','type','name','resolvePathToResource','execute','14620925pGOQEd','\x27...','\x20\x20\x20Path:\x20','Resolved\x20type:\x20','Update\x20existing\x20child\x20segment','verbose','.\x20Only\x20child\x20segments\x20can\x20be\x20updated.','description','\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','parentId','segment','30eMLnun','2883566NTZWny','folder','segment:update','data','2794401evdtUM','Resolving\x20folder\x20\x27','62067STxydb','28zKSDsn','Segment\x20ID:\x20','segmentId'];a40_0x3b06=function(){return _0x5aff07;};return a40_0x3b06();}export class SegmentUpdateCommand extends BaseCommand{['name']=a40_0x274279(0x15f);[a40_0x274279(0x158)]=a40_0x274279(0x155);async[a40_0x274279(0x150)](_0x358282){const _0x3e9f0c=a40_0x274279;console[_0x3e9f0c(0x176)](a40_0x181a08[_0x3e9f0c(0x16e)]('⚠\x20Deprecation\x20warning:\x20`segment\x20update`\x20is\x20deprecated.')),console[_0x3e9f0c(0x176)](a40_0x181a08[_0x3e9f0c(0x16e)](_0x3e9f0c(0x16c)));const {options:_0x5d3b80,args:_0xe643ae,tdx:_0x2dfc5c}=_0x358282,_0x247474=_0x5d3b80;if(_0xe643ae['length']===0x0)return console['error']('Error:\x20Segment\x20path\x20or\x20name\x20is\x20required'),console['error'](_0x3e9f0c(0x170)),console['error'](_0x3e9f0c(0x171)),console[_0x3e9f0c(0x176)](_0x3e9f0c(0x16d)),console[_0x3e9f0c(0x176)](_0x3e9f0c(0x159)),0x1;const _0x36f972=_0xe643ae[0x0],_0x3c31b1=_0x5d3b80['segmentPath'];let _0xd635b=_0x36f972;_0x3c31b1&&!_0x36f972['includes']('/')&&(_0xd635b=_0x3c31b1+'/'+_0x36f972,_0x247474[_0x3e9f0c(0x156)]&&console[_0x3e9f0c(0x176)](_0x3e9f0c(0x149)+_0xd635b));const _0x202a04=await withSpinner('Resolving\x20path\x20\x27'+_0xd635b+'\x27...',()=>_0x2dfc5c[_0x3e9f0c(0x15b)][_0x3e9f0c(0x14f)](_0xd635b),{'verbose':_0x247474['verbose']}),_0x423a9e=_0x202a04['data'];_0x247474[_0x3e9f0c(0x156)]&&console['error'](_0x3e9f0c(0x154)+_0x423a9e['type']);if(_0x423a9e[_0x3e9f0c(0x14d)]!==_0x3e9f0c(0x15b))return console[_0x3e9f0c(0x176)]('Error:\x20Cannot\x20update\x20'+_0x423a9e[_0x3e9f0c(0x14d)]+_0x3e9f0c(0x157)),console['error']('Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]'),0x1;if(!_0x423a9e[_0x3e9f0c(0x166)])throw new SDKError(ErrorCode[_0x3e9f0c(0x174)],_0x3e9f0c(0x14b));const _0x1ce789=_0x423a9e[_0x3e9f0c(0x15a)],_0x1248e5=_0x423a9e['segmentId'];_0x247474[_0x3e9f0c(0x156)]&&(console[_0x3e9f0c(0x176)]('Parent\x20ID:\x20'+_0x1ce789),console[_0x3e9f0c(0x176)](_0x3e9f0c(0x165)+_0x1248e5));let _0x2c7f8b;if(_0x247474[_0x3e9f0c(0x15e)]){const _0x287d16=_0x247474[_0x3e9f0c(0x15e)],_0x34d185=await withSpinner(_0x3e9f0c(0x162)+_0x287d16+_0x3e9f0c(0x152),()=>_0x2dfc5c['segment']['resolveFolderId'](_0x1ce789,_0x287d16),{'verbose':_0x247474['verbose']});_0x2c7f8b=parseInt(_0x34d185[_0x3e9f0c(0x160)],0xa),_0x247474['verbose']&&console[_0x3e9f0c(0x176)]('Resolved\x20folder\x20ID:\x20'+_0x2c7f8b);}const _0x5bd7c0=await loadJSONFromOptions(_0x247474[_0x3e9f0c(0x168)],_0x247474[_0x3e9f0c(0x175)]),_0x3611c4={'name':_0x247474['name'],'description':_0x247474['description'],'rule':_0x5bd7c0,'kind':_0x247474[_0x3e9f0c(0x172)]!==undefined?parseInt(_0x247474[_0x3e9f0c(0x172)],0xa):undefined,'segmentFolderId':_0x2c7f8b},_0x42eb67=await withSpinner(_0x3e9f0c(0x167)+_0x423a9e['segmentName']+_0x3e9f0c(0x152),()=>_0x2dfc5c[_0x3e9f0c(0x15b)][_0x3e9f0c(0x169)](_0x1ce789,_0x1248e5,_0x3611c4),{'verbose':_0x247474[_0x3e9f0c(0x156)]}),_0x4a8e59=_0x42eb67[_0x3e9f0c(0x160)];return console[_0x3e9f0c(0x176)](_0x3e9f0c(0x16a)+_0x4a8e59[_0x3e9f0c(0x14e)]+'\x27'),_0xd635b!==_0x36f972&&console[_0x3e9f0c(0x176)](_0x3e9f0c(0x153)+_0xd635b),await handleSDKOutput([_0x4a8e59],_0x247474),0x0;}}
@@ -1 +1 @@
1
- const a40_0x4b2418=a40_0x4b1a;(function(_0x615be3,_0x437041){const _0x416f11=a40_0x4b1a,_0x5ef622=_0x615be3();while(!![]){try{const _0x13f4bf=parseInt(_0x416f11(0x112))/0x1*(parseInt(_0x416f11(0x115))/0x2)+parseInt(_0x416f11(0x12b))/0x3*(-parseInt(_0x416f11(0x11a))/0x4)+parseInt(_0x416f11(0x116))/0x5*(parseInt(_0x416f11(0x135))/0x6)+-parseInt(_0x416f11(0x136))/0x7+parseInt(_0x416f11(0x123))/0x8*(-parseInt(_0x416f11(0x12a))/0x9)+-parseInt(_0x416f11(0x10d))/0xa*(parseInt(_0x416f11(0x122))/0xb)+parseInt(_0x416f11(0x124))/0xc;if(_0x13f4bf===_0x437041)break;else _0x5ef622['push'](_0x5ef622['shift']());}catch(_0x26ab27){_0x5ef622['push'](_0x5ef622['shift']());}}}(a40_0x3569,0x8529e));import{existsSync,statSync}from'fs';import a40_0x39fb39 from'chalk';import{BaseCommand}from'./command.js';import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';function a40_0x3569(){const _0x14ebeb=['Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>','Target\x20path:\x20','\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context','green','425557cFMaNr','8XguBaL','37465644FLjXVK','Site:\x20','split','red','session','✔\x20Context\x20cleared.\x20Back\x20to\x20root.','8775477lrzbXM','6IwKIbs','Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context','description','execute','Set\x20current\x20segment/folder\x20context\x20for\x20navigation','cyan','Resolving\x20path\x20\x27','\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent','Folder\x20ID:\x20','type','278580HjpUKA','5912473mrOyEM','dim','segments','Parent\x20ID:\x20','Usage:\x20tdx\x20segment\x20use\x20<path>','Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.','name','fullPath','isDirectory','Use:\x20tdx\x20segment\x20use\x20','✔\x20Context\x20set\x20to:\x20','length','parentName','config','parent_segment','parentId','folderId','error','\x27...','join','110dWUGGe','folderPath','segment:use','log','Use\x20\x22tdx\x20use\x22\x20to\x20see\x20all\x20context\x20parameters','2006vdeYlv','isAbsolute','segment','254HTcFhe','5COqbpp','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','verbose','slice','1265284PojCaO','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22','site','segmentPath'];a40_0x3569=function(){return _0x14ebeb;};return a40_0x3569();}function a40_0x4b1a(_0x28af79,_0x4473b7){_0x28af79=_0x28af79-0x105;const _0x35699d=a40_0x3569();let _0x4b1ad1=_0x35699d[_0x28af79];return _0x4b1ad1;}import{parsePath,normalizePath}from'../sdk/segment/segment-path-parser.js';import{findTdxConfig}from'../sdk/segment/tdx-config.js';export class SegmentUseCommand extends BaseCommand{[a40_0x4b2418(0x13c)]=a40_0x4b2418(0x10f);[a40_0x4b2418(0x12d)]=a40_0x4b2418(0x12f);async[a40_0x4b2418(0x12e)](_0x19b63c){const _0x504a24=a40_0x4b2418,{options:_0x20213f,args:_0x190f3a,tdx:_0x4abc3d}=_0x19b63c;if(_0x190f3a[_0x504a24(0x141)]===0x0)return console[_0x504a24(0x10a)](a40_0x39fb39[_0x504a24(0x127)]('Error:\x20Path\x20is\x20required\x0a')),console[_0x504a24(0x10a)](_0x504a24(0x13a)),console[_0x504a24(0x10a)]('Examples:'),console[_0x504a24(0x10a)](_0x504a24(0x11b)),console[_0x504a24(0x10a)]('\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22'),console[_0x504a24(0x10a)](_0x504a24(0x120)),console[_0x504a24(0x10a)](_0x504a24(0x132)),0x1;const _0xf35383=_0x190f3a[0x0],_0x1e0821=_0x20213f[_0x504a24(0x128)];try{if(_0xf35383==='/')return saveSessionContext({'segment_path':undefined},_0x1e0821),console[_0x504a24(0x110)](a40_0x39fb39['green'](_0x504a24(0x129))),0x0;if(existsSync(_0xf35383)&&statSync(_0xf35383)[_0x504a24(0x13e)]()){let _0x3546f5;try{_0x3546f5=findTdxConfig(_0xf35383);}catch{return console[_0x504a24(0x10a)](a40_0x39fb39['red']('Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20'+_0xf35383)),console[_0x504a24(0x10a)](a40_0x39fb39['cyan'](_0x504a24(0x117))),0x1;}const _0x4fdeb5=_0x3546f5[_0x504a24(0x106)][_0x504a24(0x107)];return saveSessionContext({'segment_path':_0x4fdeb5,'parent_segment':_0x4fdeb5},_0x1e0821),console[_0x504a24(0x110)](a40_0x39fb39[_0x504a24(0x121)](_0x504a24(0x140)+a40_0x39fb39[_0x504a24(0x130)](_0x4fdeb5))),0x0;}const _0x280027=_0x20213f[_0x504a24(0x11d)];let _0x519ee7=_0xf35383;const _0x300e87=parsePath(_0xf35383);if(!_0x300e87[_0x504a24(0x113)]){if(!_0x280027)return console['error'](a40_0x39fb39[_0x504a24(0x127)]('Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.')),console[_0x504a24(0x10a)](a40_0x39fb39[_0x504a24(0x130)](_0x504a24(0x11e))),0x1;if(_0xf35383==='..'){const _0x56b0f2=_0x280027[_0x504a24(0x126)]('/')[_0x504a24(0x119)](0x0,-0x1)[_0x504a24(0x10c)]('/');_0x519ee7=_0x56b0f2||'/';}else _0xf35383==='.'?_0x519ee7=_0x280027:_0x519ee7=_0x280027+'/'+_0xf35383;_0x20213f[_0x504a24(0x118)]&&console['error']('Resolved\x20relative\x20path\x20to:\x20'+_0x519ee7);}if(_0x519ee7==='/'||_0x519ee7==='')return saveSessionContext({'segment_path':undefined},_0x1e0821),console[_0x504a24(0x110)](a40_0x39fb39['green'](_0x504a24(0x129))),0x0;_0x519ee7=normalizePath(_0x519ee7);const _0x461a48=parsePath(_0x519ee7)[_0x504a24(0x138)];if(_0x461a48[_0x504a24(0x141)]===0x0)return saveSessionContext({'segment_path':undefined},_0x1e0821),console[_0x504a24(0x110)](a40_0x39fb39[_0x504a24(0x121)]('✔\x20Context\x20cleared.\x20Back\x20to\x20root.')),0x0;_0x20213f['verbose']&&(console[_0x504a24(0x10a)](_0x504a24(0x125)+_0x20213f[_0x504a24(0x11c)]),console['error'](_0x504a24(0x11f)+_0x519ee7));const _0x451b46=await withSpinner(_0x504a24(0x131)+_0x519ee7+_0x504a24(0x10b),()=>_0x4abc3d[_0x504a24(0x114)]['resolvePathToResource'](_0x519ee7),{'verbose':_0x20213f[_0x504a24(0x118)]}),_0x37f87c=_0x451b46['data'];_0x20213f[_0x504a24(0x118)]&&(console[_0x504a24(0x10a)]('Resolved\x20path\x20type:\x20'+_0x37f87c[_0x504a24(0x134)]),console['error'](_0x504a24(0x139)+_0x37f87c[_0x504a24(0x108)]),_0x37f87c[_0x504a24(0x109)]&&console['error'](_0x504a24(0x133)+_0x37f87c[_0x504a24(0x109)]));if(_0x37f87c[_0x504a24(0x134)]===_0x504a24(0x114))return console[_0x504a24(0x10a)](a40_0x39fb39['red'](_0x504a24(0x13b))),console['error']('Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.'),console[_0x504a24(0x10a)](a40_0x39fb39['cyan'](_0x504a24(0x13f)+_0x37f87c[_0x504a24(0x105)]+(_0x37f87c[_0x504a24(0x10e)]?'/'+_0x37f87c[_0x504a24(0x10e)][_0x504a24(0x10c)]('/'):''))),0x1;return saveSessionContext({'segment_path':_0x37f87c[_0x504a24(0x13d)],'parent_segment':_0x37f87c['parentName']},_0x1e0821),console[_0x504a24(0x110)](a40_0x39fb39[_0x504a24(0x121)](_0x504a24(0x140)+a40_0x39fb39[_0x504a24(0x130)](_0x37f87c[_0x504a24(0x13d)]))),_0x20213f[_0x504a24(0x118)]&&(console[_0x504a24(0x10a)](a40_0x39fb39['dim'](_0x504a24(0x12c))),console[_0x504a24(0x10a)](a40_0x39fb39[_0x504a24(0x137)](_0x504a24(0x111)))),0x0;}catch(_0x3e1bbe){throw _0x3e1bbe;}}}
1
+ const a41_0x158802=a41_0x21fe;(function(_0x1457ff,_0x483fe9){const _0x38578f=a41_0x21fe,_0x36cc07=_0x1457ff();while(!![]){try{const _0x45a4ad=-parseInt(_0x38578f(0x79))/0x1+-parseInt(_0x38578f(0x83))/0x2+parseInt(_0x38578f(0x7c))/0x3*(-parseInt(_0x38578f(0xa1))/0x4)+parseInt(_0x38578f(0x8c))/0x5+parseInt(_0x38578f(0x99))/0x6+-parseInt(_0x38578f(0x8f))/0x7*(parseInt(_0x38578f(0xaa))/0x8)+-parseInt(_0x38578f(0x7f))/0x9*(-parseInt(_0x38578f(0x98))/0xa);if(_0x45a4ad===_0x483fe9)break;else _0x36cc07['push'](_0x36cc07['shift']());}catch(_0x1d0b93){_0x36cc07['push'](_0x36cc07['shift']());}}}(a41_0x3619,0x9ebe4));import{existsSync,statSync}from'fs';import a41_0x712c47 from'chalk';import{BaseCommand}from'./command.js';function a41_0x21fe(_0x27af00,_0x1622c2){_0x27af00=_0x27af00-0x6f;const _0x3619fa=a41_0x3619();let _0x21fe9b=_0x3619fa[_0x27af00];return _0x21fe9b;}import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';import{parsePath,normalizePath}from'../sdk/segment/segment-path-parser.js';import{findTdxConfig}from'../sdk/segment/tdx-config.js';function a41_0x3619(){const _0x5ae7b9=['Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>','name','Target\x20path:\x20','type','segment','Set\x20current\x20segment/folder\x20context\x20for\x20navigation','resolvePathToResource','3266575DnqzDu','Examples:','config','21tgvDlX','✔\x20Context\x20cleared.\x20Back\x20to\x20root.','execute','parent_segment','join','Site:\x20','folderPath','log','folderId','10LKruZI','340248Ctxdmp','data','\x27...','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.','segmentPath','\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent','parentName','572SOrPyM','Resolving\x20path\x20\x27','split','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22','Use\x20\x22tdx\x20use\x22\x20to\x20see\x20all\x20context\x20parameters','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22','dim','Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','green','598088VDbUOt','✔\x20Context\x20set\x20to:\x20','Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.','Resolved\x20path\x20type:\x20','Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context','fullPath','Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.','verbose','red','error','cyan','667510yYqkht','Resolved\x20relative\x20path\x20to:\x20','parentId','25608IQuubW','session','length','19436589VylrCL','isDirectory','Error:\x20Path\x20is\x20required\x0a','isAbsolute','213982FwRfoy','Usage:\x20tdx\x20segment\x20use\x20<path>'];a41_0x3619=function(){return _0x5ae7b9;};return a41_0x3619();}export class SegmentUseCommand extends BaseCommand{[a41_0x158802(0x86)]='segment:use';['description']=a41_0x158802(0x8a);async[a41_0x158802(0x91)](_0x396fd9){const _0x2f223d=a41_0x158802,{options:_0x41fd8f,args:_0x2bae19,tdx:_0x283660}=_0x396fd9;if(_0x2bae19[_0x2f223d(0x7e)]===0x0)return console[_0x2f223d(0x77)](a41_0x712c47['red'](_0x2f223d(0x81))),console[_0x2f223d(0x77)](_0x2f223d(0x84)),console['error'](_0x2f223d(0x8d)),console[_0x2f223d(0x77)](_0x2f223d(0xa6)),console['error'](_0x2f223d(0xa4)),console['error']('\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context'),console[_0x2f223d(0x77)](_0x2f223d(0x9f)),0x1;const _0x14ffc7=_0x2bae19[0x0],_0xee5810=_0x41fd8f[_0x2f223d(0x7d)];try{if(_0x14ffc7==='/')return saveSessionContext({'segment_path':undefined},_0xee5810),console[_0x2f223d(0x96)](a41_0x712c47[_0x2f223d(0xa9)](_0x2f223d(0x90))),0x0;if(existsSync(_0x14ffc7)&&statSync(_0x14ffc7)[_0x2f223d(0x80)]()){let _0x575c7a;try{_0x575c7a=findTdxConfig(_0x14ffc7);}catch{return console[_0x2f223d(0x77)](a41_0x712c47['red'](_0x2f223d(0xa8)+_0x14ffc7)),console[_0x2f223d(0x77)](a41_0x712c47[_0x2f223d(0x78)](_0x2f223d(0x9c))),0x1;}const _0x31f26d=_0x575c7a[_0x2f223d(0x8e)][_0x2f223d(0x92)];return saveSessionContext({'segment_path':_0x31f26d,'parent_segment':_0x31f26d},_0xee5810),console[_0x2f223d(0x96)](a41_0x712c47[_0x2f223d(0xa9)](_0x2f223d(0x6f)+a41_0x712c47[_0x2f223d(0x78)](_0x31f26d))),0x0;}const _0x1c0b82=_0x41fd8f[_0x2f223d(0x9e)];let _0x267059=_0x14ffc7;const _0x232ddc=parsePath(_0x14ffc7);if(!_0x232ddc[_0x2f223d(0x82)]){if(!_0x1c0b82)return console[_0x2f223d(0x77)](a41_0x712c47['red'](_0x2f223d(0x74))),console[_0x2f223d(0x77)](a41_0x712c47[_0x2f223d(0x78)](_0x2f223d(0x85))),0x1;if(_0x14ffc7==='..'){const _0x2955b6=_0x1c0b82[_0x2f223d(0xa3)]('/')['slice'](0x0,-0x1)[_0x2f223d(0x93)]('/');_0x267059=_0x2955b6||'/';}else _0x14ffc7==='.'?_0x267059=_0x1c0b82:_0x267059=_0x1c0b82+'/'+_0x14ffc7;_0x41fd8f['verbose']&&console[_0x2f223d(0x77)](_0x2f223d(0x7a)+_0x267059);}if(_0x267059==='/'||_0x267059==='')return saveSessionContext({'segment_path':undefined},_0xee5810),console['log'](a41_0x712c47[_0x2f223d(0xa9)](_0x2f223d(0x90))),0x0;_0x267059=normalizePath(_0x267059);const _0xfd3c49=parsePath(_0x267059)['segments'];if(_0xfd3c49[_0x2f223d(0x7e)]===0x0)return saveSessionContext({'segment_path':undefined},_0xee5810),console[_0x2f223d(0x96)](a41_0x712c47[_0x2f223d(0xa9)](_0x2f223d(0x90))),0x0;_0x41fd8f[_0x2f223d(0x75)]&&(console[_0x2f223d(0x77)](_0x2f223d(0x94)+_0x41fd8f['site']),console[_0x2f223d(0x77)](_0x2f223d(0x87)+_0x267059));const _0x251fc8=await withSpinner(_0x2f223d(0xa2)+_0x267059+_0x2f223d(0x9b),()=>_0x283660[_0x2f223d(0x89)][_0x2f223d(0x8b)](_0x267059),{'verbose':_0x41fd8f[_0x2f223d(0x75)]}),_0x2fa3c3=_0x251fc8[_0x2f223d(0x9a)];_0x41fd8f[_0x2f223d(0x75)]&&(console[_0x2f223d(0x77)](_0x2f223d(0x71)+_0x2fa3c3[_0x2f223d(0x88)]),console[_0x2f223d(0x77)]('Parent\x20ID:\x20'+_0x2fa3c3[_0x2f223d(0x7b)]),_0x2fa3c3[_0x2f223d(0x97)]&&console[_0x2f223d(0x77)]('Folder\x20ID:\x20'+_0x2fa3c3[_0x2f223d(0x97)]));if(_0x2fa3c3[_0x2f223d(0x88)]===_0x2f223d(0x89))return console[_0x2f223d(0x77)](a41_0x712c47[_0x2f223d(0x76)](_0x2f223d(0x9d))),console[_0x2f223d(0x77)](_0x2f223d(0x70)),console[_0x2f223d(0x77)](a41_0x712c47['cyan']('Use:\x20tdx\x20segment\x20use\x20'+_0x2fa3c3[_0x2f223d(0xa0)]+(_0x2fa3c3[_0x2f223d(0x95)]?'/'+_0x2fa3c3['folderPath'][_0x2f223d(0x93)]('/'):''))),0x1;return saveSessionContext({'segment_path':_0x2fa3c3[_0x2f223d(0x73)],'parent_segment':_0x2fa3c3[_0x2f223d(0xa0)]},_0xee5810),console[_0x2f223d(0x96)](a41_0x712c47[_0x2f223d(0xa9)](_0x2f223d(0x6f)+a41_0x712c47[_0x2f223d(0x78)](_0x2fa3c3['fullPath']))),_0x41fd8f[_0x2f223d(0x75)]&&(console[_0x2f223d(0x77)](a41_0x712c47[_0x2f223d(0xa7)](_0x2f223d(0x72))),console[_0x2f223d(0x77)](a41_0x712c47[_0x2f223d(0xa7)](_0x2f223d(0xa5)))),0x0;}catch(_0x208e0e){throw _0x208e0e;}}}
@@ -1 +1 @@
1
- const a41_0x3eb0bd=a41_0x1bd7;(function(_0x19916c,_0x64ec57){const _0x13d445=a41_0x1bd7,_0x1e5bc4=_0x19916c();while(!![]){try{const _0x5d507e=-parseInt(_0x13d445(0x206))/0x1+-parseInt(_0x13d445(0x1e2))/0x2*(-parseInt(_0x13d445(0x200))/0x3)+parseInt(_0x13d445(0x1ea))/0x4+-parseInt(_0x13d445(0x1e9))/0x5+-parseInt(_0x13d445(0x1f1))/0x6+-parseInt(_0x13d445(0x1fb))/0x7*(-parseInt(_0x13d445(0x1dc))/0x8)+-parseInt(_0x13d445(0x1f0))/0x9;if(_0x5d507e===_0x64ec57)break;else _0x1e5bc4['push'](_0x1e5bc4['shift']());}catch(_0x214b16){_0x1e5bc4['push'](_0x1e5bc4['shift']());}}}(a41_0x211c,0xab474));function a41_0x211c(){const _0x59f084=['):\x20','Validation\x20failed:\x20','Error:\x20Directory\x20not\x20found:\x20','errors','file','log','cyan','.yaml','2443ZwUZEy','warnings','no_parent','validCount','✔\x20All\x20','84zFLwBq','type','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','green','hasErrors','227109EZbIKk','description','\x20file(s)\x20with\x20errors,\x20','dim','Error:\x20','verbose','error','.yml','17720Vjyzie','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','\x20warning(s)\x20found','invalidCount','\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','length','12434QGmUHg','cwd','endsWith','execute','red','errorCode','valid','1113735iYPxyw','5417412LotSJF','Usage:\x20tdx\x20sg\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)','warningCount','filePath','segment:validate','yellow','8389062ArIrQa','1307604qfluBh','\x20valid'];a41_0x211c=function(){return _0x59f084;};return a41_0x211c();}function a41_0x1bd7(_0x227554,_0x5b7f41){_0x227554=_0x227554-0x1d6;const _0x211c36=a41_0x211c();let _0x1bd7cd=_0x211c36[_0x227554];return _0x1bd7cd;}import{BaseCommand}from'./command.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';import a41_0xd37cd0 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']=a41_0x3eb0bd(0x1ee);[a41_0x3eb0bd(0x207)]='Validate\x20segment\x20and\x20journey\x20YAML\x20files';async[a41_0x3eb0bd(0x1e5)](_0x2b0c46){const _0x256d9d=a41_0x3eb0bd,{options:_0x9ce4cf,args:_0x3a2444}=_0x2b0c46,_0x59f000=_0x9ce4cf,_0x4fe39d=await resolveTarget({'arg':_0x3a2444[0x0],'contextParent':_0x9ce4cf['parentSegment'],'cwd':process[_0x256d9d(0x1e3)]()});if(!isSuccessfulResolution(_0x4fe39d))return _0x4fe39d[_0x256d9d(0x1e7)]===_0x256d9d(0x1fd)?(console[_0x256d9d(0x1da)](a41_0xd37cd0[_0x256d9d(0x1ef)](_0x256d9d(0x1dd))),console['error'](_0x256d9d(0x1eb)),console[_0x256d9d(0x1da)](_0x256d9d(0x1e0)),console[_0x256d9d(0x1da)](_0x256d9d(0x202))):(console[_0x256d9d(0x1da)](a41_0xd37cd0[_0x256d9d(0x1e6)](_0x256d9d(0x1d8)+_0x4fe39d['message']+'\x0a')),_0x4fe39d['helpText']&&console['error'](a41_0xd37cd0[_0x256d9d(0x1f9)](_0x4fe39d['helpText']))),0x1;const _0x2d033b=_0x4fe39d['targetDir'],_0x3f4687=_0x4fe39d[_0x256d9d(0x201)]===_0x256d9d(0x1f7)?_0x4fe39d[_0x256d9d(0x1ed)]:undefined;if(!_0x3f4687&&!existsSync(_0x2d033b))return console[_0x256d9d(0x1da)](a41_0xd37cd0[_0x256d9d(0x1e6)](_0x256d9d(0x1f5)+_0x2d033b+'\x0a')),0x1;let _0x8f4492;if(_0x3f4687){if(!_0x3f4687[_0x256d9d(0x1e4)](_0x256d9d(0x1db))&&!_0x3f4687[_0x256d9d(0x1e4)](_0x256d9d(0x1fa)))return console[_0x256d9d(0x1da)](a41_0xd37cd0['red'](_0x256d9d(0x203)+_0x3f4687+'\x0a')),0x1;_0x8f4492=[_0x3f4687];}else _0x8f4492=findYamlFiles(_0x2d033b);if(_0x8f4492['length']===0x0)return console[_0x256d9d(0x1da)](a41_0xd37cd0['red']('Error:\x20No\x20YAML\x20files\x20found\x20in\x20'+_0x2d033b+'\x0a')),0x1;const _0x51d1da=validateYamlFiles(_0x8f4492,_0x2d033b),_0x30db6f=calculateSummary(_0x51d1da);for(const _0xee4b8d of _0x51d1da){if(!isValidationResult(_0xee4b8d))continue;const {relativePath:_0x3bd578,source:_0x93af72,result:_0x50c8d3,fileType:_0x1dd99c}=_0xee4b8d,_0x1f6192=_0x1dd99c;if(_0x50c8d3[_0x256d9d(0x1e8)]&&_0x50c8d3['warnings'][_0x256d9d(0x1e1)]===0x0)_0x59f000[_0x256d9d(0x1d9)]&&console[_0x256d9d(0x1f8)](a41_0xd37cd0[_0x256d9d(0x204)]('✔\x20'+_0x3bd578)+a41_0xd37cd0[_0x256d9d(0x1d7)]('\x20('+_0x1f6192+')'));else _0x50c8d3[_0x256d9d(0x1e8)]?(console[_0x256d9d(0x1f8)](a41_0xd37cd0[_0x256d9d(0x1ef)]('⚠\x20'+_0x3bd578)+a41_0xd37cd0['dim']('\x20('+_0x1f6192+'):\x20'+_0x50c8d3[_0x256d9d(0x1fc)][_0x256d9d(0x1e1)]+'\x20warning(s)')),console['log'](formatValidationResult(_0x50c8d3,_0x93af72,_0x3bd578))):(console[_0x256d9d(0x1f8)](a41_0xd37cd0[_0x256d9d(0x1e6)]('✖\x20'+_0x3bd578)+a41_0xd37cd0[_0x256d9d(0x1d7)]('\x20('+_0x1f6192+_0x256d9d(0x1f3)+_0x50c8d3[_0x256d9d(0x1f6)][_0x256d9d(0x1e1)]+'\x20error(s)')),console[_0x256d9d(0x1f8)](formatValidationResult(_0x50c8d3,_0x93af72,_0x3bd578)));}return console[_0x256d9d(0x1f8)](''),_0x30db6f[_0x256d9d(0x205)]?(console[_0x256d9d(0x1f8)](a41_0xd37cd0[_0x256d9d(0x1e6)](_0x256d9d(0x1f4)+_0x30db6f[_0x256d9d(0x1df)]+_0x256d9d(0x1d6)+_0x30db6f[_0x256d9d(0x1fe)]+_0x256d9d(0x1f2))),_0x30db6f['warningCount']>0x0&&console[_0x256d9d(0x1f8)](a41_0xd37cd0[_0x256d9d(0x1ef)](_0x30db6f[_0x256d9d(0x1ec)]+_0x256d9d(0x1de))),0x1):(console[_0x256d9d(0x1f8)](a41_0xd37cd0[_0x256d9d(0x204)](_0x256d9d(0x1ff)+_0x30db6f['validCount']+'\x20file(s)\x20valid')),_0x30db6f[_0x256d9d(0x1ec)]>0x0&&console[_0x256d9d(0x1f8)](a41_0xd37cd0[_0x256d9d(0x1ef)](_0x30db6f[_0x256d9d(0x1ec)]+_0x256d9d(0x1de))),0x0);}}
1
+ const a42_0x1f796b=a42_0x170e;(function(_0xfc70e0,_0x4b4ac4){const _0x2291e1=a42_0x170e,_0x1202eb=_0xfc70e0();while(!![]){try{const _0x4c5973=-parseInt(_0x2291e1(0x1e7))/0x1+parseInt(_0x2291e1(0x1f3))/0x2+parseInt(_0x2291e1(0x1e9))/0x3*(parseInt(_0x2291e1(0x1f5))/0x4)+parseInt(_0x2291e1(0x202))/0x5+parseInt(_0x2291e1(0x1f7))/0x6+parseInt(_0x2291e1(0x208))/0x7*(parseInt(_0x2291e1(0x1eb))/0x8)+-parseInt(_0x2291e1(0x1ff))/0x9;if(_0x4c5973===_0x4b4ac4)break;else _0x1202eb['push'](_0x1202eb['shift']());}catch(_0x28c11c){_0x1202eb['push'](_0x1202eb['shift']());}}}(a42_0x38cc,0x5f942));import{BaseCommand}from'./command.js';function a42_0x38cc(){const _0xc51146=['\x20valid','error','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','Usage:\x20tdx\x20sg\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)','1438500sxzYwu','endsWith','115708deXKBz','yellow','2437242fTZIMu','length','invalidCount','execute','parentSegment','dim','warningCount','validCount','12174957nhSgQj','errorCode','Error:\x20Directory\x20not\x20found:\x20','2416765nQFDer','log','):\x20','\x20error(s)','\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','targetDir','266SPBryq','helpText','valid','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','\x20warning(s)','\x20warning(s)\x20found','\x20file(s)\x20valid','Validate\x20segment\x20and\x20journey\x20YAML\x20files','name','description','635680vUzDuq','errors','63EtIMqN','✔\x20All\x20','34456Yutiog','segment:validate','red','warnings'];a42_0x38cc=function(){return _0xc51146;};return a42_0x38cc();}function a42_0x170e(_0x1931c8,_0x447cd7){_0x1931c8=_0x1931c8-0x1e6;const _0x38cc68=a42_0x38cc();let _0x170e5d=_0x38cc68[_0x1931c8];return _0x170e5d;}import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';import a42_0x38e4c9 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_0x1f796b(0x210)]=a42_0x1f796b(0x1ec);[a42_0x1f796b(0x1e6)]=a42_0x1f796b(0x20f);async[a42_0x1f796b(0x1fa)](_0x4e7908){const _0x530b40=a42_0x1f796b,{options:_0x3725ad,args:_0x2861f6}=_0x4e7908,_0xf07d1f=_0x3725ad,_0x434057=await resolveTarget({'arg':_0x2861f6[0x0],'contextParent':_0x3725ad[_0x530b40(0x1fb)],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x434057))return _0x434057[_0x530b40(0x200)]==='no_parent'?(console[_0x530b40(0x1f0)](a42_0x38e4c9[_0x530b40(0x1f6)](_0x530b40(0x20b))),console['error'](_0x530b40(0x1f2)),console[_0x530b40(0x1f0)](_0x530b40(0x206)),console[_0x530b40(0x1f0)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file')):(console[_0x530b40(0x1f0)](a42_0x38e4c9[_0x530b40(0x1ed)]('Error:\x20'+_0x434057['message']+'\x0a')),_0x434057[_0x530b40(0x209)]&&console[_0x530b40(0x1f0)](a42_0x38e4c9['cyan'](_0x434057['helpText']))),0x1;const _0x3f213f=_0x434057[_0x530b40(0x207)],_0x2f49f6=_0x434057['type']==='file'?_0x434057['filePath']:undefined;if(!_0x2f49f6&&!existsSync(_0x3f213f))return console['error'](a42_0x38e4c9['red'](_0x530b40(0x201)+_0x3f213f+'\x0a')),0x1;let _0x34f63d;if(_0x2f49f6){if(!_0x2f49f6[_0x530b40(0x1f4)]('.yml')&&!_0x2f49f6[_0x530b40(0x1f4)]('.yaml'))return console['error'](a42_0x38e4c9[_0x530b40(0x1ed)]('Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20'+_0x2f49f6+'\x0a')),0x1;_0x34f63d=[_0x2f49f6];}else _0x34f63d=findYamlFiles(_0x3f213f);if(_0x34f63d[_0x530b40(0x1f8)]===0x0)return console[_0x530b40(0x1f0)](a42_0x38e4c9['red'](_0x530b40(0x1f1)+_0x3f213f+'\x0a')),0x1;const _0x300be=validateYamlFiles(_0x34f63d,_0x3f213f),_0x20b8cf=calculateSummary(_0x300be);for(const _0x33cdc0 of _0x300be){if(!isValidationResult(_0x33cdc0))continue;const {relativePath:_0x42d698,source:_0xc9a805,result:_0x27ad47,fileType:_0x45fa8d}=_0x33cdc0,_0x44fb8c=_0x45fa8d;if(_0x27ad47[_0x530b40(0x20a)]&&_0x27ad47[_0x530b40(0x1ee)]['length']===0x0)_0xf07d1f['verbose']&&console['log'](a42_0x38e4c9['green']('✔\x20'+_0x42d698)+a42_0x38e4c9[_0x530b40(0x1fc)]('\x20('+_0x44fb8c+')'));else _0x27ad47[_0x530b40(0x20a)]?(console[_0x530b40(0x203)](a42_0x38e4c9[_0x530b40(0x1f6)]('⚠\x20'+_0x42d698)+a42_0x38e4c9[_0x530b40(0x1fc)]('\x20('+_0x44fb8c+_0x530b40(0x204)+_0x27ad47[_0x530b40(0x1ee)]['length']+_0x530b40(0x20c))),console[_0x530b40(0x203)](formatValidationResult(_0x27ad47,_0xc9a805,_0x42d698))):(console['log'](a42_0x38e4c9['red']('✖\x20'+_0x42d698)+a42_0x38e4c9[_0x530b40(0x1fc)]('\x20('+_0x44fb8c+'):\x20'+_0x27ad47[_0x530b40(0x1e8)][_0x530b40(0x1f8)]+_0x530b40(0x205))),console[_0x530b40(0x203)](formatValidationResult(_0x27ad47,_0xc9a805,_0x42d698)));}return console[_0x530b40(0x203)](''),_0x20b8cf['hasErrors']?(console['log'](a42_0x38e4c9[_0x530b40(0x1ed)]('Validation\x20failed:\x20'+_0x20b8cf[_0x530b40(0x1f9)]+'\x20file(s)\x20with\x20errors,\x20'+_0x20b8cf[_0x530b40(0x1fe)]+_0x530b40(0x1ef))),_0x20b8cf[_0x530b40(0x1fd)]>0x0&&console[_0x530b40(0x203)](a42_0x38e4c9[_0x530b40(0x1f6)](_0x20b8cf[_0x530b40(0x1fd)]+_0x530b40(0x20d))),0x1):(console['log'](a42_0x38e4c9['green'](_0x530b40(0x1ea)+_0x20b8cf[_0x530b40(0x1fe)]+_0x530b40(0x20e))),_0x20b8cf[_0x530b40(0x1fd)]>0x0&&console[_0x530b40(0x203)](a42_0x38e4c9['yellow'](_0x20b8cf[_0x530b40(0x1fd)]+_0x530b40(0x20d))),0x0);}}
@@ -1 +1 @@
1
- const a42_0x587a20=a42_0x1254;function a42_0x2699(){const _0x9deedd=['85274OlviFI','List\x20folders\x20and\x20child\x20segments','listRecursive','\x27...','\x20matching\x20\x27','site','\x5c$&','Use\x20tdx\x20ps\x20list\x20to\x20see\x20available\x20parent\x20segments.','808WzTsXg','2932578XRJDAV','Error:\x20','Error:\x20No\x20parent\x20segment\x20context\x20set.','Recursive\x20mode:\x20enabled','listUnified','log',',\x20and\x20','error','journeys','jsonl','verbose','/e/','8017250EgwtqD','\x20segment','folder','42530580RbVQfJ','test','segments','folderId','segment','length','description','journey','Building\x20hierarchy\x20tree...','cause','2537308pdnnPb','children','journeyBundleName','format','type','listWithPattern','name','/app/ps/','recursive','maxDepth','Resolving\x20path\x20\x27','dim','Folder/pattern\x20arg:\x20','4AnADQY','Set\x20a\x20parent\x20segment\x20context\x20first:','Parent\x20ID:\x20','map','parentId','No\x20items\x20match\x20pattern:\x20','json','data','replace','Listing\x20folders,\x20segments,\x20and\x20journeys...','(empty)','\x20\x20tdx\x20sg\x20pull\x20\x22My\x20Audience\x22','sort','localeCompare','\x20folder','resolvePathToResource','/j/da','✔\x20Found\x20','Folder\x20ID:\x20','1159350XmkpPX','878661CzyeiA','includes','\x20\x20tdx\x20sg\x20use\x20\x22My\x20Audience\x22','filter','message','folders'];a42_0x2699=function(){return _0x9deedd;};return a42_0x2699();}(function(_0x5e5185,_0x3ecd22){const _0x352b8c=a42_0x1254,_0x51067b=_0x5e5185();while(!![]){try{const _0x39ffb7=-parseInt(_0x352b8c(0xf7))/0x1+-parseInt(_0x352b8c(0xd6))/0x2+-parseInt(_0x352b8c(0x106))/0x3*(-parseInt(_0x352b8c(0xe3))/0x4)+-parseInt(_0x352b8c(0x112))/0x5+parseInt(_0x352b8c(0xf6))/0x6+-parseInt(_0x352b8c(0xfd))/0x7*(parseInt(_0x352b8c(0x105))/0x8)+parseInt(_0x352b8c(0xcc))/0x9;if(_0x39ffb7===_0x3ecd22)break;else _0x51067b['push'](_0x51067b['shift']());}catch(_0x1183fb){_0x51067b['push'](_0x51067b['shift']());}}}(a42_0x2699,0xdf718));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';function a42_0x1254(_0x5d9051,_0x472da7){_0x5d9051=_0x5d9051-0xcc;const _0x2699b0=a42_0x2699();let _0x1254c7=_0x2699b0[_0x5d9051];return _0x1254c7;}import{withSpinner}from'../utils/spinner.js';import{formatFlatList,formatTree}from'../sdk/util/tree-formatter.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import a42_0x2a785d from'chalk';export class SegmentsCommand extends BaseCommand{[a42_0x587a20(0xdc)]=a42_0x587a20(0xce);[a42_0x587a20(0xd2)]=a42_0x587a20(0xfe);async['execute'](_0x2090d2){const _0x55143a=a42_0x587a20,{options:_0x43d146,args:_0x394e07}=_0x2090d2,_0x4297a4=_0x43d146[_0x55143a(0xde)],_0x7ed0c2=_0x394e07[0x0];try{const _0x3a47af=_0x43d146['parentSegment'];_0x43d146[_0x55143a(0x110)]&&(console[_0x55143a(0x10d)]('Site:\x20'+_0x43d146[_0x55143a(0x102)]),console[_0x55143a(0x10d)]('Parent\x20segment\x20context:\x20'+(_0x3a47af||'(not\x20set)')),_0x7ed0c2&&console[_0x55143a(0x10d)](_0x55143a(0xe2)+_0x7ed0c2),_0x4297a4&&console['error'](_0x55143a(0x109)));if(!_0x3a47af)return console[_0x55143a(0x10d)](_0x55143a(0x108)),console['error'](''),console[_0x55143a(0x10d)](_0x55143a(0xe4)),console[_0x55143a(0x10d)](_0x55143a(0xee)),console[_0x55143a(0x10d)](_0x55143a(0xf9)),console['error'](''),console[_0x55143a(0x10d)](_0x55143a(0x104)),0x1;const _0x5f0401=_0x7ed0c2&&(_0x7ed0c2[_0x55143a(0xf8)]('*')||_0x7ed0c2[_0x55143a(0xf8)]('?'));if(_0x5f0401)return await this[_0x55143a(0xdb)](_0x2090d2,_0x3a47af,_0x7ed0c2);const _0x4a0344=_0x7ed0c2?_0x3a47af+'/'+_0x7ed0c2:_0x3a47af;return _0x4297a4?await this['listRecursive'](_0x2090d2,_0x4a0344):await this[_0x55143a(0x10a)](_0x2090d2,_0x4a0344);}catch(_0x576131){if(_0x576131 instanceof SDKError)return console['error'](_0x55143a(0x107)+_0x576131[_0x55143a(0xfb)]),_0x576131['cause']&&console[_0x55143a(0x10d)]('\x20\x20Cause:\x20'+_0x576131[_0x55143a(0xd5)]),0x1;throw _0x576131;}}async[a42_0x587a20(0xdb)](_0x4253e5,_0x3b7ce0,_0x3a55f6){const _0x14a8ba=a42_0x587a20,{options:_0x52e12a,tdx:_0x333c0f}=_0x4253e5,_0x5881bd=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x3b7ce0+_0x14a8ba(0x100),()=>_0x333c0f['segment'][_0x14a8ba(0xf2)](_0x3b7ce0),{'verbose':_0x52e12a[_0x14a8ba(0x110)]}),_0x107e84=_0x5881bd[_0x14a8ba(0xea)],_0x5bc2bf=await withSpinner(_0x14a8ba(0xec),()=>_0x333c0f[_0x14a8ba(0xd0)]['listUnifiedWithJourneys'](_0x107e84[_0x14a8ba(0xe7)],_0x107e84[_0x14a8ba(0xcf)]),{'verbose':_0x52e12a[_0x14a8ba(0x110)]}),{folders:_0x391859,segments:_0x46bcac,journeys:_0x54451e}=_0x5bc2bf[_0x14a8ba(0xea)],_0x35db08=_0x3a55f6[_0x14a8ba(0xeb)](/[.+^${}()|[\]\\]/g,_0x14a8ba(0x103))[_0x14a8ba(0xeb)](/\*/g,'.*')[_0x14a8ba(0xeb)](/\?/g,'.'),_0x3b65bd=new RegExp('^'+_0x35db08+'$','i'),_0x4baa7c=_0x391859[_0x14a8ba(0xfa)](_0x3869d3=>_0x3b65bd[_0x14a8ba(0xcd)](_0x3869d3[_0x14a8ba(0xdc)])),_0xc09699=_0x46bcac[_0x14a8ba(0xfa)](_0x4a6d7d=>_0x3b65bd[_0x14a8ba(0xcd)](_0x4a6d7d[_0x14a8ba(0xdc)])),_0x1cad19=_0x54451e[_0x14a8ba(0xfa)](_0x488743=>_0x3b65bd[_0x14a8ba(0xcd)](_0x488743[_0x14a8ba(0xd8)])),_0x5b1195=_0x4baa7c[_0x14a8ba(0xd1)]+_0xc09699[_0x14a8ba(0xd1)]+_0x1cad19[_0x14a8ba(0xd1)];console[_0x14a8ba(0x10d)](_0x14a8ba(0xf4)+_0x4baa7c['length']+_0x14a8ba(0xf1)+(_0x4baa7c[_0x14a8ba(0xd1)]!==0x1?'s':'')+',\x20'+_0xc09699[_0x14a8ba(0xd1)]+'\x20segment'+(_0xc09699[_0x14a8ba(0xd1)]!==0x1?'s':'')+',\x20and\x20'+_0x1cad19[_0x14a8ba(0xd1)]+'\x20journey'+(_0x1cad19[_0x14a8ba(0xd1)]!==0x1?'s':'')+_0x14a8ba(0x101)+_0x3a55f6+'\x27');const _0x2ff5b1=_0x482ee5=>{const _0x157b0c=_0x14a8ba;return getConsoleNextUrl(_0x52e12a[_0x157b0c(0x102)],_0x157b0c(0xdd)+_0x107e84[_0x157b0c(0xe7)]+_0x157b0c(0x111)+_0x482ee5);},_0xfd4845=_0x52e12a[_0x14a8ba(0xd9)]===_0x14a8ba(0xe9)||_0x52e12a[_0x14a8ba(0xd9)]===_0x14a8ba(0x10f);if(_0xfd4845){const _0x380ed6=[..._0x4baa7c[_0x14a8ba(0xe6)](_0x4d8ec2=>({..._0x4d8ec2,'type':_0x14a8ba(0x114)})),..._0xc09699[_0x14a8ba(0xe6)](_0x2d545e=>({..._0x2d545e,'type':_0x14a8ba(0xd0),'url':_0x2ff5b1(_0x2d545e['id'])})),..._0x1cad19['map'](_0x215bed=>({..._0x215bed,'name':_0x215bed['journeyBundleName'],'type':_0x14a8ba(0xd3)}))][_0x14a8ba(0xef)]((_0x272ba,_0x50fb45)=>_0x272ba[_0x14a8ba(0xdc)][_0x14a8ba(0xf0)](_0x50fb45['name']));await handleSDKOutput(_0x380ed6,_0x52e12a);}else{if(_0x5b1195===0x0)console[_0x14a8ba(0x10b)](_0x14a8ba(0xe8)+_0x3a55f6);else{console[_0x14a8ba(0x10b)](a42_0x2a785d['dim']('['+_0x3b7ce0+']\x20matching\x20\x27'+_0x3a55f6+'\x27'));const _0x564134=formatFlatList(_0x4baa7c,_0xc09699,{'showMetadata':!![],'getSegmentUrl':_0x2ff5b1},_0x1cad19);console[_0x14a8ba(0x10b)](_0x564134);}}return 0x0;}async[a42_0x587a20(0x10a)](_0x3ce85c,_0x109358){const _0x35df01=a42_0x587a20,{options:_0x31c71a,tdx:_0x4556c2}=_0x3ce85c,_0x53e96d=await withSpinner(_0x35df01(0xe0)+_0x109358+_0x35df01(0x100),()=>_0x4556c2[_0x35df01(0xd0)][_0x35df01(0xf2)](_0x109358),{'verbose':_0x31c71a[_0x35df01(0x110)]}),_0x49ce15=_0x53e96d['data'];_0x31c71a[_0x35df01(0x110)]&&(console[_0x35df01(0x10d)](_0x35df01(0xe5)+_0x49ce15[_0x35df01(0xe7)]),_0x49ce15[_0x35df01(0xcf)]&&console[_0x35df01(0x10d)](_0x35df01(0xf5)+_0x49ce15[_0x35df01(0xcf)]));const _0x12182e=await withSpinner('Listing\x20folders,\x20segments,\x20and\x20journeys...',()=>_0x4556c2[_0x35df01(0xd0)]['listUnifiedWithJourneys'](_0x49ce15[_0x35df01(0xe7)],_0x49ce15[_0x35df01(0xcf)]),{'verbose':_0x31c71a['verbose']}),{folders:_0x518b15,segments:_0x28329a,journeys:_0x209b02}=_0x12182e[_0x35df01(0xea)],_0x575424=_0x518b15[_0x35df01(0xd1)]+_0x28329a[_0x35df01(0xd1)]+_0x209b02['length'];console[_0x35df01(0x10d)](_0x35df01(0xf4)+_0x518b15['length']+_0x35df01(0xf1)+(_0x518b15[_0x35df01(0xd1)]!==0x1?'s':'')+',\x20'+_0x28329a[_0x35df01(0xd1)]+_0x35df01(0x113)+(_0x28329a[_0x35df01(0xd1)]!==0x1?'s':'')+_0x35df01(0x10c)+_0x209b02['length']+'\x20journey'+(_0x209b02[_0x35df01(0xd1)]!==0x1?'s':''));const _0x4e5009=_0x40c5ae=>{const _0x4e2e5d=_0x35df01;return getConsoleNextUrl(_0x31c71a[_0x4e2e5d(0x102)],'/app/ps/'+_0x49ce15[_0x4e2e5d(0xe7)]+_0x4e2e5d(0x111)+_0x40c5ae);},_0x245ac3=_0x434250=>{const _0x499be9=_0x35df01;return getConsoleNextUrl(_0x31c71a[_0x499be9(0x102)],_0x499be9(0xdd)+_0x49ce15[_0x499be9(0xe7)]+_0x499be9(0x111)+_0x434250+_0x499be9(0xf3));},_0xdae9d1=_0x31c71a[_0x35df01(0xd9)]===_0x35df01(0xe9)||_0x31c71a['format']==='jsonl';if(_0xdae9d1){const _0x4f211a=[..._0x518b15[_0x35df01(0xe6)](_0x5272b3=>({..._0x5272b3,'type':'folder'})),..._0x28329a[_0x35df01(0xe6)](_0x5af14d=>({..._0x5af14d,'type':_0x35df01(0xd0),'url':_0x4e5009(_0x5af14d['id'])})),..._0x209b02[_0x35df01(0xe6)](_0x6b47f0=>({..._0x6b47f0,'name':_0x6b47f0[_0x35df01(0xd8)],'type':_0x35df01(0xd3),'url':_0x245ac3(_0x6b47f0['id'])}))][_0x35df01(0xef)]((_0x43fe75,_0x44dc2c)=>_0x43fe75[_0x35df01(0xdc)][_0x35df01(0xf0)](_0x44dc2c[_0x35df01(0xdc)]));await handleSDKOutput(_0x4f211a,_0x31c71a);}else{if(_0x575424===0x0)console[_0x35df01(0x10b)](a42_0x2a785d[_0x35df01(0xe1)]('['+_0x109358+']')),console[_0x35df01(0x10b)](_0x35df01(0xed));else{console['log'](a42_0x2a785d[_0x35df01(0xe1)]('['+_0x109358+']'));const _0x4599c7=formatFlatList(_0x518b15,_0x28329a,{'showMetadata':!![],'getSegmentUrl':_0x4e5009,'getJourneyUrl':_0x245ac3},_0x209b02);console[_0x35df01(0x10b)](_0x4599c7);}}return 0x0;}async['listRecursive'](_0x19b477,_0x3897ef){const _0x5e1f4e=a42_0x587a20,{options:_0x182851,tdx:_0x28b605}=_0x19b477,_0xf16ad7=await withSpinner(_0x5e1f4e(0xe0)+_0x3897ef+_0x5e1f4e(0x100),()=>_0x28b605[_0x5e1f4e(0xd0)][_0x5e1f4e(0xf2)](_0x3897ef),{'verbose':_0x182851[_0x5e1f4e(0x110)]}),_0x2533d0=_0xf16ad7[_0x5e1f4e(0xea)];_0x182851['verbose']&&(console[_0x5e1f4e(0x10d)](_0x5e1f4e(0xe5)+_0x2533d0[_0x5e1f4e(0xe7)]),_0x2533d0['folderId']&&console['error'](_0x5e1f4e(0xf5)+_0x2533d0[_0x5e1f4e(0xcf)]));const _0xe0925d=_0x182851[_0x5e1f4e(0xdf)]||0xa,_0x35cecf=await withSpinner(_0x5e1f4e(0xd4),()=>_0x28b605['segment'][_0x5e1f4e(0xff)](_0x2533d0[_0x5e1f4e(0xe7)],_0x2533d0[_0x5e1f4e(0xcf)],0x0,_0xe0925d),{'verbose':_0x182851[_0x5e1f4e(0x110)]}),_0x495296=_0x35cecf[_0x5e1f4e(0xea)],_0xccd68=_0x23928f=>{const _0xf2569c=_0x5e1f4e;let _0x331d62=0x0,_0x4851a1=0x0,_0x13769d=0x0;for(const _0x22aca1 of _0x23928f){if(_0x22aca1[_0xf2569c(0xda)]===_0xf2569c(0x114))_0x331d62++;else{if(_0x22aca1[_0xf2569c(0xda)]===_0xf2569c(0xd0))_0x4851a1++;else{if(_0x22aca1[_0xf2569c(0xda)]===_0xf2569c(0xd3))_0x13769d++;}}if(_0x22aca1['children']){const _0x3a9682=_0xccd68(_0x22aca1[_0xf2569c(0xd7)]);_0x331d62+=_0x3a9682[_0xf2569c(0xfc)],_0x4851a1+=_0x3a9682['segments'],_0x13769d+=_0x3a9682[_0xf2569c(0x10e)];}}return{'folders':_0x331d62,'segments':_0x4851a1,'journeys':_0x13769d};},_0x2f8578=_0xccd68(_0x495296);console[_0x5e1f4e(0x10d)]('✔\x20Built\x20tree\x20with\x20'+_0x2f8578[_0x5e1f4e(0xfc)]+_0x5e1f4e(0xf1)+(_0x2f8578['folders']!==0x1?'s':'')+',\x20'+_0x2f8578[_0x5e1f4e(0xce)]+_0x5e1f4e(0x113)+(_0x2f8578['segments']!==0x1?'s':'')+_0x5e1f4e(0x10c)+_0x2f8578[_0x5e1f4e(0x10e)]+'\x20journey'+(_0x2f8578[_0x5e1f4e(0x10e)]!==0x1?'s':''));const _0x494963=_0x36acd9=>{const _0x5640f7=_0x5e1f4e;return getConsoleNextUrl(_0x182851[_0x5640f7(0x102)],_0x5640f7(0xdd)+_0x2533d0['parentId']+_0x5640f7(0x111)+_0x36acd9);},_0x412d15=_0x5bbde4=>{const _0x5a03e2=_0x5e1f4e;return getConsoleNextUrl(_0x182851[_0x5a03e2(0x102)],'/app/ps/'+_0x2533d0[_0x5a03e2(0xe7)]+_0x5a03e2(0x111)+_0x5bbde4+_0x5a03e2(0xf3));};if(_0x182851[_0x5e1f4e(0xd9)]==='json'||_0x182851[_0x5e1f4e(0xd9)]==='jsonl')await handleSDKOutput(_0x495296,_0x182851);else{console['log'](a42_0x2a785d[_0x5e1f4e(0xe1)]('['+_0x3897ef+']'));const _0x43afbb=formatTree(_0x495296,{'showMetadata':!![],'getSegmentUrl':_0x494963,'getJourneyUrl':_0x412d15});console[_0x5e1f4e(0x10b)](_0x43afbb);}return 0x0;}}
1
+ const a43_0x14f7b1=a43_0x296f;(function(_0x22400d,_0x374762){const _0x5d3ada=a43_0x296f,_0x5d3fb8=_0x22400d();while(!![]){try{const _0x34cf3b=parseInt(_0x5d3ada(0x1bd))/0x1*(-parseInt(_0x5d3ada(0x1c9))/0x2)+parseInt(_0x5d3ada(0x1fb))/0x3+-parseInt(_0x5d3ada(0x1ef))/0x4*(parseInt(_0x5d3ada(0x1cf))/0x5)+-parseInt(_0x5d3ada(0x1bc))/0x6+-parseInt(_0x5d3ada(0x1d1))/0x7+-parseInt(_0x5d3ada(0x1d7))/0x8+-parseInt(_0x5d3ada(0x1e9))/0x9*(-parseInt(_0x5d3ada(0x1e4))/0xa);if(_0x34cf3b===_0x374762)break;else _0x5d3fb8['push'](_0x5d3fb8['shift']());}catch(_0x35212d){_0x5d3fb8['push'](_0x5d3fb8['shift']());}}}(a43_0x4607,0xb0b4d));function a43_0x4607(){const _0x41b142=['journeys','9606968DLanmW','resolvePathToResource','json','listRecursive',']\x20matching\x20\x27','/app/ps/','8767896LsuRUA','localeCompare','children','filter','\x27...','(empty)','replace','name','\x20\x20tdx\x20sg\x20pull\x20\x22My\x20Audience\x22','message','journey','\x20folder','List\x20folders\x20and\x20child\x20segments','10hxHWhZ','Listing\x20folders,\x20segments,\x20and\x20journeys...','parentId','(not\x20set)','folderId','53752527otokYJ','✔\x20Built\x20tree\x20with\x20','Recursive\x20mode:\x20enabled','Resolving\x20path\x20\x27','\x20\x20tdx\x20sg\x20use\x20\x22My\x20Audience\x22','\x20journey','4019948KmfIvo','Error:\x20','verbose','No\x20items\x20match\x20pattern:\x20','folders','description','Error:\x20No\x20parent\x20segment\x20context\x20set.','journeyBundleName','✔\x20Found\x20','sort','jsonl','folder','970659UqXmoI','cause','length','segments','/j/da','dim','execute','Parent\x20ID:\x20','test',',\x20and\x20','\x20segment','data','listUnifiedWithJourneys','parentSegment','Resolving\x20parent\x20segment\x20\x27','7751562RCdYvO','5527WxcsYU','/e/','type','log','segment','includes','\x20\x20Cause:\x20','site','Folder\x20ID:\x20','\x20matching\x20\x27','map','listWithPattern','292sGlnTu','listUnified','Site:\x20','error','Set\x20a\x20parent\x20segment\x20context\x20first:','format','5zVAxqv'];a43_0x4607=function(){return _0x41b142;};return a43_0x4607();}import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';function a43_0x296f(_0x2e9017,_0x7682d7){_0x2e9017=_0x2e9017-0x1b2;const _0x4607bc=a43_0x4607();let _0x296fad=_0x4607bc[_0x2e9017];return _0x296fad;}import{formatFlatList,formatTree}from'../sdk/util/tree-formatter.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import a43_0x384e4f from'chalk';export class SegmentsCommand extends BaseCommand{[a43_0x14f7b1(0x1de)]=a43_0x14f7b1(0x1fe);[a43_0x14f7b1(0x1f4)]=a43_0x14f7b1(0x1e3);async[a43_0x14f7b1(0x1b3)](_0x5b4e17){const _0x19f51e=a43_0x14f7b1,{options:_0x40228d,args:_0x13f165}=_0x5b4e17,_0x2eaf44=_0x40228d['recursive'],_0x4d7366=_0x13f165[0x0];try{const _0x2eda28=_0x40228d[_0x19f51e(0x1ba)];_0x40228d[_0x19f51e(0x1f1)]&&(console['error'](_0x19f51e(0x1cb)+_0x40228d[_0x19f51e(0x1c4)]),console['error']('Parent\x20segment\x20context:\x20'+(_0x2eda28||_0x19f51e(0x1e7))),_0x4d7366&&console[_0x19f51e(0x1cc)]('Folder/pattern\x20arg:\x20'+_0x4d7366),_0x2eaf44&&console[_0x19f51e(0x1cc)](_0x19f51e(0x1eb)));if(!_0x2eda28)return console[_0x19f51e(0x1cc)](_0x19f51e(0x1f5)),console[_0x19f51e(0x1cc)](''),console[_0x19f51e(0x1cc)](_0x19f51e(0x1cd)),console[_0x19f51e(0x1cc)](_0x19f51e(0x1df)),console[_0x19f51e(0x1cc)](_0x19f51e(0x1ed)),console[_0x19f51e(0x1cc)](''),console[_0x19f51e(0x1cc)]('Use\x20tdx\x20ps\x20list\x20to\x20see\x20available\x20parent\x20segments.'),0x1;const _0x5d5a9d=_0x4d7366&&(_0x4d7366[_0x19f51e(0x1c2)]('*')||_0x4d7366['includes']('?'));if(_0x5d5a9d)return await this[_0x19f51e(0x1c8)](_0x5b4e17,_0x2eda28,_0x4d7366);const _0x286beb=_0x4d7366?_0x2eda28+'/'+_0x4d7366:_0x2eda28;return _0x2eaf44?await this['listRecursive'](_0x5b4e17,_0x286beb):await this[_0x19f51e(0x1ca)](_0x5b4e17,_0x286beb);}catch(_0x274af5){if(_0x274af5 instanceof SDKError)return console[_0x19f51e(0x1cc)](_0x19f51e(0x1f0)+_0x274af5[_0x19f51e(0x1e0)]),_0x274af5[_0x19f51e(0x1fc)]&&console['error'](_0x19f51e(0x1c3)+_0x274af5[_0x19f51e(0x1fc)]),0x1;throw _0x274af5;}}async[a43_0x14f7b1(0x1c8)](_0xe3973d,_0x546aa0,_0x3ab171){const _0x24a6bb=a43_0x14f7b1,{options:_0x4d5a22,tdx:_0x1d4f69}=_0xe3973d,_0x1e354d=await withSpinner(_0x24a6bb(0x1bb)+_0x546aa0+'\x27...',()=>_0x1d4f69[_0x24a6bb(0x1c1)][_0x24a6bb(0x1d2)](_0x546aa0),{'verbose':_0x4d5a22[_0x24a6bb(0x1f1)]}),_0x555f32=_0x1e354d[_0x24a6bb(0x1b8)],_0x1300c7=await withSpinner(_0x24a6bb(0x1e5),()=>_0x1d4f69['segment']['listUnifiedWithJourneys'](_0x555f32['parentId'],_0x555f32[_0x24a6bb(0x1e8)]),{'verbose':_0x4d5a22['verbose']}),{folders:_0xf62438,segments:_0x26e1a9,journeys:_0x2804dd}=_0x1300c7['data'],_0x89aad8=_0x3ab171[_0x24a6bb(0x1dd)](/[.+^${}()|[\]\\]/g,'\x5c$&')[_0x24a6bb(0x1dd)](/\*/g,'.*')[_0x24a6bb(0x1dd)](/\?/g,'.'),_0xef35bb=new RegExp('^'+_0x89aad8+'$','i'),_0xa01dfb=_0xf62438[_0x24a6bb(0x1da)](_0x4c146a=>_0xef35bb[_0x24a6bb(0x1b5)](_0x4c146a['name'])),_0x370a86=_0x26e1a9['filter'](_0x3676c6=>_0xef35bb['test'](_0x3676c6[_0x24a6bb(0x1de)])),_0xf9f859=_0x2804dd[_0x24a6bb(0x1da)](_0x43f378=>_0xef35bb[_0x24a6bb(0x1b5)](_0x43f378['journeyBundleName'])),_0x2001b2=_0xa01dfb[_0x24a6bb(0x1fd)]+_0x370a86[_0x24a6bb(0x1fd)]+_0xf9f859[_0x24a6bb(0x1fd)];console[_0x24a6bb(0x1cc)](_0x24a6bb(0x1f7)+_0xa01dfb[_0x24a6bb(0x1fd)]+_0x24a6bb(0x1e2)+(_0xa01dfb['length']!==0x1?'s':'')+',\x20'+_0x370a86[_0x24a6bb(0x1fd)]+_0x24a6bb(0x1b7)+(_0x370a86[_0x24a6bb(0x1fd)]!==0x1?'s':'')+_0x24a6bb(0x1b6)+_0xf9f859[_0x24a6bb(0x1fd)]+_0x24a6bb(0x1ee)+(_0xf9f859[_0x24a6bb(0x1fd)]!==0x1?'s':'')+_0x24a6bb(0x1c6)+_0x3ab171+'\x27');const _0x29590e=_0x26a3ee=>{const _0x5417b3=_0x24a6bb;return getConsoleNextUrl(_0x4d5a22[_0x5417b3(0x1c4)],_0x5417b3(0x1d6)+_0x555f32[_0x5417b3(0x1e6)]+'/e/'+_0x26a3ee);},_0x2df9f7=_0x4d5a22['format']===_0x24a6bb(0x1d3)||_0x4d5a22['format']===_0x24a6bb(0x1f9);if(_0x2df9f7){const _0x54e148=[..._0xa01dfb[_0x24a6bb(0x1c7)](_0x4b4daf=>({..._0x4b4daf,'type':_0x24a6bb(0x1fa)})),..._0x370a86['map'](_0x1a9905=>({..._0x1a9905,'type':_0x24a6bb(0x1c1),'url':_0x29590e(_0x1a9905['id'])})),..._0xf9f859[_0x24a6bb(0x1c7)](_0x19653b=>({..._0x19653b,'name':_0x19653b[_0x24a6bb(0x1f6)],'type':_0x24a6bb(0x1e1)}))][_0x24a6bb(0x1f8)]((_0x508be4,_0x4720d8)=>_0x508be4['name'][_0x24a6bb(0x1d8)](_0x4720d8['name']));await handleSDKOutput(_0x54e148,_0x4d5a22);}else{if(_0x2001b2===0x0)console['log'](_0x24a6bb(0x1f2)+_0x3ab171);else{console[_0x24a6bb(0x1c0)](a43_0x384e4f[_0x24a6bb(0x1b2)]('['+_0x546aa0+_0x24a6bb(0x1d5)+_0x3ab171+'\x27'));const _0xd4e9ec=formatFlatList(_0xa01dfb,_0x370a86,{'showMetadata':!![],'getSegmentUrl':_0x29590e},_0xf9f859);console['log'](_0xd4e9ec);}}return 0x0;}async[a43_0x14f7b1(0x1ca)](_0x25bb28,_0x3506d1){const _0xd3167a=a43_0x14f7b1,{options:_0x1e5807,tdx:_0x55c20c}=_0x25bb28,_0x18e40b=await withSpinner(_0xd3167a(0x1ec)+_0x3506d1+_0xd3167a(0x1db),()=>_0x55c20c[_0xd3167a(0x1c1)][_0xd3167a(0x1d2)](_0x3506d1),{'verbose':_0x1e5807[_0xd3167a(0x1f1)]}),_0x508777=_0x18e40b[_0xd3167a(0x1b8)];_0x1e5807[_0xd3167a(0x1f1)]&&(console[_0xd3167a(0x1cc)]('Parent\x20ID:\x20'+_0x508777['parentId']),_0x508777[_0xd3167a(0x1e8)]&&console[_0xd3167a(0x1cc)](_0xd3167a(0x1c5)+_0x508777[_0xd3167a(0x1e8)]));const _0x268655=await withSpinner(_0xd3167a(0x1e5),()=>_0x55c20c[_0xd3167a(0x1c1)][_0xd3167a(0x1b9)](_0x508777[_0xd3167a(0x1e6)],_0x508777[_0xd3167a(0x1e8)]),{'verbose':_0x1e5807[_0xd3167a(0x1f1)]}),{folders:_0x56292a,segments:_0x115d31,journeys:_0x2dd5fa}=_0x268655[_0xd3167a(0x1b8)],_0x4b471a=_0x56292a['length']+_0x115d31[_0xd3167a(0x1fd)]+_0x2dd5fa[_0xd3167a(0x1fd)];console[_0xd3167a(0x1cc)](_0xd3167a(0x1f7)+_0x56292a[_0xd3167a(0x1fd)]+_0xd3167a(0x1e2)+(_0x56292a['length']!==0x1?'s':'')+',\x20'+_0x115d31['length']+'\x20segment'+(_0x115d31[_0xd3167a(0x1fd)]!==0x1?'s':'')+',\x20and\x20'+_0x2dd5fa[_0xd3167a(0x1fd)]+_0xd3167a(0x1ee)+(_0x2dd5fa['length']!==0x1?'s':''));const _0x14ee68=_0xafff9b=>{const _0x4dc94b=_0xd3167a;return getConsoleNextUrl(_0x1e5807[_0x4dc94b(0x1c4)],'/app/ps/'+_0x508777[_0x4dc94b(0x1e6)]+_0x4dc94b(0x1be)+_0xafff9b);},_0x37b760=_0x254929=>{const _0x2161a5=_0xd3167a;return getConsoleNextUrl(_0x1e5807[_0x2161a5(0x1c4)],_0x2161a5(0x1d6)+_0x508777[_0x2161a5(0x1e6)]+_0x2161a5(0x1be)+_0x254929+'/j/da');},_0x288810=_0x1e5807['format']===_0xd3167a(0x1d3)||_0x1e5807[_0xd3167a(0x1ce)]===_0xd3167a(0x1f9);if(_0x288810){const _0x55b485=[..._0x56292a[_0xd3167a(0x1c7)](_0x5eb0a5=>({..._0x5eb0a5,'type':'folder'})),..._0x115d31[_0xd3167a(0x1c7)](_0x3c3193=>({..._0x3c3193,'type':'segment','url':_0x14ee68(_0x3c3193['id'])})),..._0x2dd5fa[_0xd3167a(0x1c7)](_0x42327b=>({..._0x42327b,'name':_0x42327b[_0xd3167a(0x1f6)],'type':_0xd3167a(0x1e1),'url':_0x37b760(_0x42327b['id'])}))][_0xd3167a(0x1f8)]((_0x21a080,_0x4a055e)=>_0x21a080[_0xd3167a(0x1de)][_0xd3167a(0x1d8)](_0x4a055e[_0xd3167a(0x1de)]));await handleSDKOutput(_0x55b485,_0x1e5807);}else{if(_0x4b471a===0x0)console[_0xd3167a(0x1c0)](a43_0x384e4f[_0xd3167a(0x1b2)]('['+_0x3506d1+']')),console['log'](_0xd3167a(0x1dc));else{console[_0xd3167a(0x1c0)](a43_0x384e4f[_0xd3167a(0x1b2)]('['+_0x3506d1+']'));const _0x5f3b06=formatFlatList(_0x56292a,_0x115d31,{'showMetadata':!![],'getSegmentUrl':_0x14ee68,'getJourneyUrl':_0x37b760},_0x2dd5fa);console[_0xd3167a(0x1c0)](_0x5f3b06);}}return 0x0;}async[a43_0x14f7b1(0x1d4)](_0x192be6,_0x511575){const _0x511e1e=a43_0x14f7b1,{options:_0x1a3019,tdx:_0x100cfa}=_0x192be6,_0x30f4b4=await withSpinner(_0x511e1e(0x1ec)+_0x511575+'\x27...',()=>_0x100cfa[_0x511e1e(0x1c1)][_0x511e1e(0x1d2)](_0x511575),{'verbose':_0x1a3019['verbose']}),_0x1512a0=_0x30f4b4[_0x511e1e(0x1b8)];_0x1a3019['verbose']&&(console['error'](_0x511e1e(0x1b4)+_0x1512a0[_0x511e1e(0x1e6)]),_0x1512a0[_0x511e1e(0x1e8)]&&console[_0x511e1e(0x1cc)]('Folder\x20ID:\x20'+_0x1512a0[_0x511e1e(0x1e8)]));const _0x3c3c70=_0x1a3019['maxDepth']||0xa,_0x300a3f=await withSpinner('Building\x20hierarchy\x20tree...',()=>_0x100cfa[_0x511e1e(0x1c1)]['listRecursive'](_0x1512a0[_0x511e1e(0x1e6)],_0x1512a0['folderId'],0x0,_0x3c3c70),{'verbose':_0x1a3019[_0x511e1e(0x1f1)]}),_0x4a6f3a=_0x300a3f['data'],_0x3f5321=_0x303524=>{const _0x5890ec=_0x511e1e;let _0x1c0bf1=0x0,_0x4d7ba9=0x0,_0x2e10e5=0x0;for(const _0x4a75c6 of _0x303524){if(_0x4a75c6[_0x5890ec(0x1bf)]===_0x5890ec(0x1fa))_0x1c0bf1++;else{if(_0x4a75c6[_0x5890ec(0x1bf)]===_0x5890ec(0x1c1))_0x4d7ba9++;else{if(_0x4a75c6['type']===_0x5890ec(0x1e1))_0x2e10e5++;}}if(_0x4a75c6[_0x5890ec(0x1d9)]){const _0x799b37=_0x3f5321(_0x4a75c6['children']);_0x1c0bf1+=_0x799b37[_0x5890ec(0x1f3)],_0x4d7ba9+=_0x799b37[_0x5890ec(0x1fe)],_0x2e10e5+=_0x799b37[_0x5890ec(0x1d0)];}}return{'folders':_0x1c0bf1,'segments':_0x4d7ba9,'journeys':_0x2e10e5};},_0x2ab91b=_0x3f5321(_0x4a6f3a);console['error'](_0x511e1e(0x1ea)+_0x2ab91b[_0x511e1e(0x1f3)]+_0x511e1e(0x1e2)+(_0x2ab91b['folders']!==0x1?'s':'')+',\x20'+_0x2ab91b[_0x511e1e(0x1fe)]+_0x511e1e(0x1b7)+(_0x2ab91b[_0x511e1e(0x1fe)]!==0x1?'s':'')+_0x511e1e(0x1b6)+_0x2ab91b[_0x511e1e(0x1d0)]+_0x511e1e(0x1ee)+(_0x2ab91b['journeys']!==0x1?'s':''));const _0x225e8=_0x1016ec=>{const _0x22f057=_0x511e1e;return getConsoleNextUrl(_0x1a3019[_0x22f057(0x1c4)],_0x22f057(0x1d6)+_0x1512a0['parentId']+_0x22f057(0x1be)+_0x1016ec);},_0x5536d4=_0x595f2b=>{const _0x53e06b=_0x511e1e;return getConsoleNextUrl(_0x1a3019['site'],_0x53e06b(0x1d6)+_0x1512a0[_0x53e06b(0x1e6)]+_0x53e06b(0x1be)+_0x595f2b+_0x53e06b(0x1ff));};if(_0x1a3019[_0x511e1e(0x1ce)]===_0x511e1e(0x1d3)||_0x1a3019['format']==='jsonl')await handleSDKOutput(_0x4a6f3a,_0x1a3019);else{console[_0x511e1e(0x1c0)](a43_0x384e4f[_0x511e1e(0x1b2)]('['+_0x511575+']'));const _0x4a54d4=formatTree(_0x4a6f3a,{'showMetadata':!![],'getSegmentUrl':_0x225e8,'getJourneyUrl':_0x5536d4});console[_0x511e1e(0x1c0)](_0x4a54d4);}return 0x0;}}
@@ -1 +1 @@
1
- function a43_0x1472(_0x2bc917,_0x46af39){_0x2bc917=_0x2bc917-0x1a3;const _0x310dc9=a43_0x310d();let _0x14721d=_0x310dc9[_0x2bc917];return _0x14721d;}const a43_0x2734d9=a43_0x1472;(function(_0x4975dd,_0x24b18e){const _0x4b82b4=a43_0x1472,_0x1f65d1=_0x4975dd();while(!![]){try{const _0x2e7be0=parseInt(_0x4b82b4(0x1c7))/0x1*(parseInt(_0x4b82b4(0x1af))/0x2)+-parseInt(_0x4b82b4(0x1c5))/0x3+-parseInt(_0x4b82b4(0x1bb))/0x4*(-parseInt(_0x4b82b4(0x1b4))/0x5)+parseInt(_0x4b82b4(0x1c4))/0x6+parseInt(_0x4b82b4(0x1c3))/0x7*(-parseInt(_0x4b82b4(0x1bc))/0x8)+parseInt(_0x4b82b4(0x1ca))/0x9*(parseInt(_0x4b82b4(0x1c8))/0xa)+parseInt(_0x4b82b4(0x1a3))/0xb*(-parseInt(_0x4b82b4(0x1ab))/0xc);if(_0x2e7be0===_0x24b18e)break;else _0x1f65d1['push'](_0x1f65d1['shift']());}catch(_0x3fd56e){_0x1f65d1['push'](_0x1f65d1['shift']());}}}(a43_0x310d,0x7ebf1));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';function a43_0x310d(){const _0x10c296=['description','Limit:\x20','✔\x20Retrieved\x20','1204145yhKJOu','query','message','Error:\x20','Table:\x20','verbose','Querying\x20','12bjraoT','8ALCJZa','showTable','Catalog:\x20','site','args','\x20\x20Cause:\x20','validate','2556743teDYkt','2283228NEYRgn','900699OXbDcL','cause','753611sMlSYC','8766430MHPXiC','name','9htvDXC','error','17035084EtZCYR','✔\x20Query\x20successful\x20-\x200\x20rows\x20returned','show','\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>','Site:\x20','length','Database:\x20','database','12MWoGPc','Too\x20many\x20arguments\x0aUsage:\x20tdx\x20show\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>\x0a\x0aRun\x20\x27tdx\x20show\x20--help\x27\x20for\x20more\x20options','\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>','data','2lOfLfO','table'];a43_0x310d=function(){return _0x10c296;};return a43_0x310d();}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{[a43_0x2734d9(0x1c9)]=a43_0x2734d9(0x1a5);[a43_0x2734d9(0x1b1)]='Show\x20table\x20contents';async['execute'](_0x4d7576){const _0x542f4b=a43_0x2734d9;return this[_0x542f4b(0x1bd)](_0x4d7576);}async[a43_0x2734d9(0x1bd)](_0x23a68c){const _0x5c41b4=a43_0x2734d9,{options:_0x2c4fe4,args:_0x19b1ff,tdx:_0x31b36a}=_0x23a68c;let _0xb3298d;try{_0xb3298d=parseTableReference(_0x19b1ff[0x0]);const _0x4b068c=_0x2c4fe4[_0x5c41b4(0x1aa)];!_0xb3298d[_0x5c41b4(0x1aa)]&&_0x4b068c&&(_0xb3298d[_0x5c41b4(0x1aa)]=_0x4b068c);const _0x1d4fcd=validateTableDescribeReference(_0xb3298d);if(_0x1d4fcd)return console[_0x5c41b4(0x1cb)](_0x5c41b4(0x1b7)+_0x1d4fcd),console[_0x5c41b4(0x1cb)]('Usage:\x20tdx\x20show\x20<database.table>'),console[_0x5c41b4(0x1cb)](_0x5c41b4(0x1ad)),console[_0x5c41b4(0x1cb)](_0x5c41b4(0x1a6)),0x1;}catch(_0x20e6ab){return console[_0x5c41b4(0x1cb)]('Error:\x20'+_0x20e6ab['message']),console['error']('Usage:\x20tdx\x20show\x20<database.table>'),console[_0x5c41b4(0x1cb)](_0x5c41b4(0x1ad)),console['error'](_0x5c41b4(0x1a6)),0x1;}const _0x314191=_0xb3298d['catalog'],_0x20955f=_0xb3298d[_0x5c41b4(0x1aa)],_0x1ba4c2=_0xb3298d[_0x5c41b4(0x1b0)],_0x44d4ed=resolveLimit(_0x2c4fe4['limit'],DEFAULT_DISPLAY_LIMIT);try{_0x2c4fe4[_0x5c41b4(0x1b9)]&&(console[_0x5c41b4(0x1cb)](_0x5c41b4(0x1a7)+_0x2c4fe4[_0x5c41b4(0x1bf)]),_0x314191&&console['error'](_0x5c41b4(0x1be)+_0x314191),console[_0x5c41b4(0x1cb)](_0x5c41b4(0x1a9)+_0x20955f),console['error'](_0x5c41b4(0x1b8)+_0x1ba4c2),console['error'](_0x5c41b4(0x1b2)+_0x44d4ed));const _0x19c402=_0x314191?_0x314191+'.'+_0x20955f+'.'+_0x1ba4c2:_0x20955f+'.'+_0x1ba4c2,_0xade9bb=await withSpinner(_0x5c41b4(0x1ba)+_0x19c402+'...',()=>_0x31b36a[_0x5c41b4(0x1b5)][_0x5c41b4(0x1bd)](_0x20955f,_0x1ba4c2,_0x44d4ed,_0x314191),{'verbose':_0x2c4fe4[_0x5c41b4(0x1b9)]}),_0x2cae7f=_0xade9bb[_0x5c41b4(0x1ae)],_0x3dd72c=_0x2cae7f[_0x5c41b4(0x1ae)];return _0x3dd72c[_0x5c41b4(0x1a8)]===0x0?console[_0x5c41b4(0x1cb)](_0x5c41b4(0x1a4)):console['error'](_0x5c41b4(0x1b3)+_0x3dd72c['length']+'\x20row'+(_0x3dd72c['length']!==0x1?'s':'')+'\x20from\x20'+_0x19c402),await handleSDKOutput(_0x3dd72c,_0x2c4fe4),0x0;}catch(_0x4b4934){if(_0x4b4934 instanceof SDKError)return console[_0x5c41b4(0x1cb)](_0x5c41b4(0x1b7)+_0x4b4934[_0x5c41b4(0x1b6)]),_0x4b4934['cause']&&console['error'](_0x5c41b4(0x1c1)+_0x4b4934[_0x5c41b4(0x1c6)]),0x1;throw _0x4b4934;}}[a43_0x2734d9(0x1c2)](_0xf1f3bb){const _0x9821aa=a43_0x2734d9;if(_0xf1f3bb[_0x9821aa(0x1c0)]['length']===0x0)return'Usage:\x20tdx\x20show\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--in\x20<database>\x0a\x0aRun\x20\x27tdx\x20show\x20--help\x27\x20for\x20more\x20options';if(_0xf1f3bb['args'][_0x9821aa(0x1a8)]>0x1)return _0x9821aa(0x1ac);return undefined;}}
1
+ const a44_0x480cf9=a44_0x228b;(function(_0x4e09d7,_0x1c73d3){const _0x140448=a44_0x228b,_0x391cec=_0x4e09d7();while(!![]){try{const _0xfaa7cf=-parseInt(_0x140448(0x167))/0x1+parseInt(_0x140448(0x169))/0x2+-parseInt(_0x140448(0x16e))/0x3+parseInt(_0x140448(0x160))/0x4*(parseInt(_0x140448(0x151))/0x5)+parseInt(_0x140448(0x175))/0x6*(parseInt(_0x140448(0x15b))/0x7)+-parseInt(_0x140448(0x153))/0x8+parseInt(_0x140448(0x15c))/0x9;if(_0xfaa7cf===_0x1c73d3)break;else _0x391cec['push'](_0x391cec['shift']());}catch(_0x38af3f){_0x391cec['push'](_0x391cec['shift']());}}}(a44_0x1351,0x78153));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';function a44_0x228b(_0x1f2475,_0xbfeae6){_0x1f2475=_0x1f2475-0x14e;const _0x135152=a44_0x1351();let _0x228b78=_0x135152[_0x1f2475];return _0x228b78;}function a44_0x1351(){const _0x47f907=['catalog','...','9528jGTBMG','query','✔\x20Retrieved\x20','Error:\x20','message','args','\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>','226067LvjDRY','Catalog:\x20','535072dnOUzq','database','verbose','showTable','length','2309415SQdlfJ','execute','data','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','limit','✔\x20Query\x20successful\x20-\x200\x20rows\x20returned','Site:\x20','23832vvJbyR','name','Limit:\x20','\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>','1505CQrwro','Usage:\x20tdx\x20show\x20<database.table>','7713968tgkiRf','site','validate','Show\x20table\x20contents','error','cause','Table:\x20','Usage:\x20tdx\x20show\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--in\x20<database>\x0a\x0aRun\x20\x27tdx\x20show\x20--help\x27\x20for\x20more\x20options','679tUMbEU','9739575fmbNKz','table'];a44_0x1351=function(){return _0x47f907;};return a44_0x1351();}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_0x480cf9(0x14e)]='show';['description']=a44_0x480cf9(0x156);async[a44_0x480cf9(0x16f)](_0x1ad398){const _0x4278bf=a44_0x480cf9;return this[_0x4278bf(0x16c)](_0x1ad398);}async['showTable'](_0x4559b9){const _0x355423=a44_0x480cf9,{options:_0x4530e4,args:_0x4e53c2,tdx:_0x3bbac4}=_0x4559b9;let _0x4ed3e4;try{_0x4ed3e4=parseTableReference(_0x4e53c2[0x0]);const _0x3fb28b=_0x4530e4[_0x355423(0x16a)];!_0x4ed3e4['database']&&_0x3fb28b&&(_0x4ed3e4['database']=_0x3fb28b);const _0x7a679e=validateTableDescribeReference(_0x4ed3e4);if(_0x7a679e)return console[_0x355423(0x157)]('Error:\x20'+_0x7a679e),console['error']('Usage:\x20tdx\x20show\x20<database.table>'),console[_0x355423(0x157)](_0x355423(0x150)),console[_0x355423(0x157)](_0x355423(0x166)),0x1;}catch(_0x399f95){return console[_0x355423(0x157)](_0x355423(0x163)+_0x399f95[_0x355423(0x164)]),console[_0x355423(0x157)](_0x355423(0x152)),console['error'](_0x355423(0x150)),console[_0x355423(0x157)]('\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>'),0x1;}const _0x1aa4ce=_0x4ed3e4[_0x355423(0x15e)],_0x134b9f=_0x4ed3e4[_0x355423(0x16a)],_0x44a611=_0x4ed3e4[_0x355423(0x15d)],_0x376174=resolveLimit(_0x4530e4[_0x355423(0x172)],DEFAULT_DISPLAY_LIMIT);try{_0x4530e4['verbose']&&(console[_0x355423(0x157)](_0x355423(0x174)+_0x4530e4[_0x355423(0x154)]),_0x1aa4ce&&console[_0x355423(0x157)](_0x355423(0x168)+_0x1aa4ce),console[_0x355423(0x157)]('Database:\x20'+_0x134b9f),console['error'](_0x355423(0x159)+_0x44a611),console[_0x355423(0x157)](_0x355423(0x14f)+_0x376174));const _0x1eca25=_0x1aa4ce?_0x1aa4ce+'.'+_0x134b9f+'.'+_0x44a611:_0x134b9f+'.'+_0x44a611,_0x2a79e1=await withSpinner('Querying\x20'+_0x1eca25+_0x355423(0x15f),()=>_0x3bbac4[_0x355423(0x161)]['showTable'](_0x134b9f,_0x44a611,_0x376174,_0x1aa4ce),{'verbose':_0x4530e4[_0x355423(0x16b)]}),_0x394e0c=_0x2a79e1['data'],_0xbaae61=_0x394e0c[_0x355423(0x170)];return _0xbaae61['length']===0x0?console[_0x355423(0x157)](_0x355423(0x173)):console[_0x355423(0x157)](_0x355423(0x162)+_0xbaae61[_0x355423(0x16d)]+'\x20row'+(_0xbaae61[_0x355423(0x16d)]!==0x1?'s':'')+'\x20from\x20'+_0x1eca25),await handleSDKOutput(_0xbaae61,_0x4530e4),0x0;}catch(_0x475498){if(_0x475498 instanceof SDKError)return console[_0x355423(0x157)]('Error:\x20'+_0x475498[_0x355423(0x164)]),_0x475498[_0x355423(0x158)]&&console['error']('\x20\x20Cause:\x20'+_0x475498['cause']),0x1;throw _0x475498;}}[a44_0x480cf9(0x155)](_0x2de62e){const _0x23e085=a44_0x480cf9;if(_0x2de62e[_0x23e085(0x165)]['length']===0x0)return _0x23e085(0x15a);if(_0x2de62e['args'][_0x23e085(0x16d)]>0x1)return _0x23e085(0x171);return undefined;}}
@@ -1 +1 @@
1
- {"version":3,"file":"status-command.d.ts","sourceRoot":"","sources":["../../src/commands/status-command.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,WAAW,EAAE,KAAK,cAAc,EAAkB,MAAM,cAAc,CAAC;AAOhF;;;GAGG;AACH,qBAAa,aAAc,SAAQ,WAAW;IAC5C,QAAQ,CAAC,IAAI,YAAY;IACzB,QAAQ,CAAC,WAAW,oDAAoD;IAElE,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC;CAwExD"}
1
+ {"version":3,"file":"status-command.d.ts","sourceRoot":"","sources":["../../src/commands/status-command.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,WAAW,EAAE,KAAK,cAAc,EAAkB,MAAM,cAAc,CAAC;AAQhF;;;GAGG;AACH,qBAAa,aAAc,SAAQ,WAAW;IAC5C,QAAQ,CAAC,IAAI,YAAY;IACzB,QAAQ,CAAC,WAAW,oDAAoD;IAElE,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC;CA6ExD"}
@@ -1 +1 @@
1
- function a44_0x1037(_0x4285ac,_0x1ef96b){_0x4285ac=_0x4285ac-0xde;const _0x27cc8d=a44_0x27cc();let _0x10375e=_0x27cc8d[_0x4285ac];return _0x10375e;}const a44_0x22e18e=a44_0x1037;(function(_0x555f63,_0x13dbe3){const _0x565b00=a44_0x1037,_0x4851b0=_0x555f63();while(!![]){try{const _0x509b08=-parseInt(_0x565b00(0x103))/0x1*(-parseInt(_0x565b00(0x10a))/0x2)+-parseInt(_0x565b00(0xf3))/0x3*(parseInt(_0x565b00(0xe3))/0x4)+parseInt(_0x565b00(0x105))/0x5*(-parseInt(_0x565b00(0xfc))/0x6)+parseInt(_0x565b00(0xfd))/0x7*(-parseInt(_0x565b00(0x10c))/0x8)+-parseInt(_0x565b00(0xee))/0x9*(-parseInt(_0x565b00(0xfa))/0xa)+parseInt(_0x565b00(0xe9))/0xb*(parseInt(_0x565b00(0x104))/0xc)+parseInt(_0x565b00(0x10f))/0xd*(parseInt(_0x565b00(0x110))/0xe);if(_0x509b08===_0x13dbe3)break;else _0x4851b0['push'](_0x4851b0['shift']());}catch(_0x3d1036){_0x4851b0['push'](_0x4851b0['shift']());}}}(a44_0x27cc,0xd7473));import{BaseCommand,printAuthError}from'./command.js';function a44_0x27cc(){const _0x4b003e=['19805MpMwEQ','site:\x20','tdx','account_id','profile','678862ryWrlc','join','5488008UQqODv','cli','email','253513iZMCIu','1428ieluQy','first_name','bold','filter','profileSource','✗\x20Validation\x20failed:\x20','No\x20credential\x20found','33248lilaLG','config','CLI\x20flag','Account\x20ID:','status','last_name','15356ieWNEf','yellow','name','log','dim','63KbzJGk','message','cyan','env','site','381XeBjxG','(from\x20','getUserInfo','execute','User:','red','green','44340EahmWC','Read\x20credential\x20from\x20','2166McbxXQ','7UsISDv','jobs','displayWithSources','description','session','error','3yMNtHS','8724peIbvl'];a44_0x27cc=function(){return _0x4b003e;};return a44_0x27cc();}import{resolveAPIKeyAsync}from'../core/config.js';import{HTTPClientError}from'../sdk/client/http-client.js';import{GlobalContext}from'../core/global-context.js';import a44_0x5b19c1 from'chalk';export class StatusCommand extends BaseCommand{[a44_0x22e18e(0xeb)]=a44_0x22e18e(0xe7);[a44_0x22e18e(0x100)]='Show\x20authentication\x20status\x20and\x20current\x20context';async[a44_0x22e18e(0xf6)](_0x3acdf3){const _0x150e57=a44_0x22e18e,{options:_0x1ddd68,tdx:_0x489dd5}=_0x3acdf3,_0x2d43ca=_0x1ddd68[_0x150e57(0xf2)],_0x13b033=new GlobalContext(_0x1ddd68),_0x438a31=_0x13b033[_0x150e57(0x109)],_0x45c3b7=_0x13b033[_0x150e57(0xe0)],_0x13ad6b=_0x45c3b7===_0x150e57(0x10d)?_0x150e57(0xe5):_0x45c3b7==='session'?_0x150e57(0x101):_0x45c3b7===_0x150e57(0xf1)?'TDX_PROFILE\x20env':_0x45c3b7==='config'?_0x150e57(0xe4):null,_0x36953a=_0x438a31?a44_0x5b19c1[_0x150e57(0xf0)](_0x438a31):a44_0x5b19c1['dim']('N/A'),_0x54e76d=_0x13ad6b?'\x20'+a44_0x5b19c1[_0x150e57(0xed)](_0x150e57(0xf4)+_0x13ad6b+')'):'';console[_0x150e57(0xec)](a44_0x5b19c1[_0x150e57(0xde)](_0x150e57(0x107))+'\x20profile:\x20'+_0x36953a+_0x54e76d+'\x20'+a44_0x5b19c1['dim']('(')+_0x150e57(0x106)+a44_0x5b19c1['cyan'](_0x2d43ca)+a44_0x5b19c1[_0x150e57(0xed)](')'));const _0x22530c=await resolveAPIKeyAsync(_0x2d43ca,_0x438a31);if(_0x22530c){const {source:_0x2cd382,isDeprecated:_0xbe25e6}=_0x22530c,_0x54017c=_0x150e57(0xfb)+a44_0x5b19c1[_0x150e57(0xf0)](_0x2cd382);console[_0x150e57(0xec)](_0xbe25e6?a44_0x5b19c1['yellow'](_0x54017c):_0x54017c);}else console[_0x150e57(0xec)](a44_0x5b19c1[_0x150e57(0xea)](_0x150e57(0xe2)));let _0x2fa274=![];try{const _0x5542f8=await _0x489dd5[_0x150e57(0xfe)][_0x150e57(0xf5)]();console['log'](a44_0x5b19c1[_0x150e57(0xf9)]('✓\x20Authentication\x20successful\x0a')),console[_0x150e57(0xec)](a44_0x5b19c1[_0x150e57(0xde)](_0x150e57(0xf7))+'\x20'+a44_0x5b19c1['cyan'](_0x5542f8[_0x150e57(0x10e)]));if(_0x5542f8['first_name']||_0x5542f8['last_name']){const _0x246253=[_0x5542f8[_0x150e57(0x111)],_0x5542f8[_0x150e57(0xe8)]][_0x150e57(0xdf)](Boolean)[_0x150e57(0x10b)]('\x20');console[_0x150e57(0xec)](a44_0x5b19c1[_0x150e57(0xde)]('Name:')+'\x20'+_0x246253);}_0x5542f8[_0x150e57(0x108)]&&console[_0x150e57(0xec)](a44_0x5b19c1[_0x150e57(0xde)](_0x150e57(0xe6))+'\x20'+a44_0x5b19c1[_0x150e57(0xea)](_0x5542f8[_0x150e57(0x108)])),_0x2fa274=!![];}catch(_0x401f7c){_0x401f7c instanceof HTTPClientError&&_0x401f7c[_0x150e57(0xe7)]===0x191?printAuthError(_0x401f7c,!![],_0x438a31):console[_0x150e57(0x102)](a44_0x5b19c1[_0x150e57(0xf8)](_0x150e57(0xe1)+(_0x401f7c instanceof Error?_0x401f7c[_0x150e57(0xef)]:String(_0x401f7c))));}return console['log'](),_0x13b033[_0x150e57(0xff)](),_0x2fa274?0x0:0x1;}}
1
+ const a45_0x323eec=a45_0x14b6;function a45_0x1f57(){const _0x2b81d1=['30576iDYfTn','171aPrLwq','jobs','execute','2006990YtlHsv','962SQkriY','✓\x20Authentication\x20successful\x0a','join','site:\x20','last_name','OAuth','config','8348202njwTJI','No\x20credential\x20found','green','1776fqoTpw','cyan','Account\x20ID:','bold','tdx','3712815mqroCP','yellow','red','Read\x20credential\x20from\x20','Name:','\x20profile:\x20','getUserInfo','4268040pCvJoL','(from\x20','description','displayWithSources','1976eGrzoP','4311435rtDLHK','error','log','filter','session','Credential\x20type:\x20','site','Show\x20authentication\x20status\x20and\x20current\x20context','status','dim','name','profileSource'];a45_0x1f57=function(){return _0x2b81d1;};return a45_0x1f57();}(function(_0x8dc8a0,_0x2f4784){const _0x1b64a9=a45_0x14b6,_0x5acdab=_0x8dc8a0();while(!![]){try{const _0xb73e7c=parseInt(_0x1b64a9(0x16b))/0x1*(parseInt(_0x1b64a9(0x17d))/0x2)+parseInt(_0x1b64a9(0x18c))/0x3+parseInt(_0x1b64a9(0x167))/0x4+parseInt(_0x1b64a9(0x16c))/0x5+parseInt(_0x1b64a9(0x184))/0x6+-parseInt(_0x1b64a9(0x178))/0x7*(parseInt(_0x1b64a9(0x187))/0x8)+parseInt(_0x1b64a9(0x179))/0x9*(-parseInt(_0x1b64a9(0x17c))/0xa);if(_0xb73e7c===_0x2f4784)break;else _0x5acdab['push'](_0x5acdab['shift']());}catch(_0xde4861){_0x5acdab['push'](_0x5acdab['shift']());}}}(a45_0x1f57,0xb12f4));import{BaseCommand,printAuthError}from'./command.js';import{resolveAPIKeyAsync}from'../core/config.js';import{getOAuthTokens}from'../core/oauth-keychain.js';import{HTTPClientError}from'../sdk/client/http-client.js';import{GlobalContext}from'../core/global-context.js';function a45_0x14b6(_0x58e8ea,_0x440ec7){_0x58e8ea=_0x58e8ea-0x167;const _0x1f573c=a45_0x1f57();let _0x14b62d=_0x1f573c[_0x58e8ea];return _0x14b62d;}import a45_0x2f40b8 from'chalk';export class StatusCommand extends BaseCommand{[a45_0x323eec(0x176)]=a45_0x323eec(0x174);[a45_0x323eec(0x169)]=a45_0x323eec(0x173);async[a45_0x323eec(0x17b)](_0x547b8a){const _0xc6daa6=a45_0x323eec,{options:_0x2e2305,tdx:_0x3bba50}=_0x547b8a,_0x53db76=_0x2e2305[_0xc6daa6(0x172)],_0x2427d7=new GlobalContext(_0x2e2305),_0x21c1ce=_0x2427d7['profile'],_0x5f5aec=_0x2427d7[_0xc6daa6(0x177)],_0x33f47f=_0x5f5aec==='cli'?'CLI\x20flag':_0x5f5aec===_0xc6daa6(0x170)?'session':_0x5f5aec==='env'?'TDX_PROFILE\x20env':_0x5f5aec===_0xc6daa6(0x183)?_0xc6daa6(0x183):null,_0x395e99=_0x21c1ce?a45_0x2f40b8[_0xc6daa6(0x188)](_0x21c1ce):a45_0x2f40b8[_0xc6daa6(0x175)]('N/A'),_0x2423ec=_0x33f47f?'\x20'+a45_0x2f40b8['dim'](_0xc6daa6(0x168)+_0x33f47f+')'):'';console[_0xc6daa6(0x16e)](a45_0x2f40b8[_0xc6daa6(0x18a)](_0xc6daa6(0x18b))+_0xc6daa6(0x191)+_0x395e99+_0x2423ec+'\x20'+a45_0x2f40b8[_0xc6daa6(0x175)]('(')+_0xc6daa6(0x180)+a45_0x2f40b8[_0xc6daa6(0x188)](_0x53db76)+a45_0x2f40b8['dim'](')'));const _0x171a46=await getOAuthTokens(_0x21c1ce);if(_0x171a46)console[_0xc6daa6(0x16e)](_0xc6daa6(0x171)+a45_0x2f40b8['cyan'](_0xc6daa6(0x182)));else{const _0x110b74=await resolveAPIKeyAsync(_0x53db76,_0x21c1ce);if(_0x110b74){const {source:_0x577c07,isDeprecated:_0x3d4eb0}=_0x110b74,_0x10be55=_0xc6daa6(0x18f)+a45_0x2f40b8['cyan'](_0x577c07);console[_0xc6daa6(0x16e)](_0x3d4eb0?a45_0x2f40b8[_0xc6daa6(0x18d)](_0x10be55):_0x10be55);}else console[_0xc6daa6(0x16e)](a45_0x2f40b8['yellow'](_0xc6daa6(0x185)));}let _0x3333b8=![];try{const _0x1a58c7=await _0x3bba50[_0xc6daa6(0x17a)][_0xc6daa6(0x192)]();console[_0xc6daa6(0x16e)](a45_0x2f40b8[_0xc6daa6(0x186)](_0xc6daa6(0x17e))),console[_0xc6daa6(0x16e)](a45_0x2f40b8[_0xc6daa6(0x18a)]('User:')+'\x20'+a45_0x2f40b8[_0xc6daa6(0x188)](_0x1a58c7['email']));if(_0x1a58c7['first_name']||_0x1a58c7['last_name']){const _0x4b12dd=[_0x1a58c7['first_name'],_0x1a58c7[_0xc6daa6(0x181)]][_0xc6daa6(0x16f)](Boolean)[_0xc6daa6(0x17f)]('\x20');console['log'](a45_0x2f40b8[_0xc6daa6(0x18a)](_0xc6daa6(0x190))+'\x20'+_0x4b12dd);}_0x1a58c7['account_id']&&console[_0xc6daa6(0x16e)](a45_0x2f40b8[_0xc6daa6(0x18a)](_0xc6daa6(0x189))+'\x20'+a45_0x2f40b8['yellow'](_0x1a58c7['account_id'])),_0x3333b8=!![];}catch(_0x324f5b){_0x324f5b instanceof HTTPClientError&&_0x324f5b['status']===0x191?printAuthError(_0x324f5b,!![],_0x21c1ce):console[_0xc6daa6(0x16d)](a45_0x2f40b8[_0xc6daa6(0x18e)]('✗\x20Validation\x20failed:\x20'+(_0x324f5b instanceof Error?_0x324f5b['message']:String(_0x324f5b))));}return console['log'](),_0x2427d7[_0xc6daa6(0x16a)](),_0x3333b8?0x0:0x1;}}
@@ -1 +1 @@
1
- {"version":3,"file":"status-command.js","sourceRoot":"","sources":["../../src/commands/status-command.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,WAAW,EAAuB,cAAc,EAAE,MAAM,cAAc,CAAC;AAChF,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAEvD,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B;;;GAGG;AACH,MAAM,OAAO,aAAc,SAAQ,WAAW;IACnC,IAAI,GAAG,QAAQ,CAAC;IAChB,WAAW,GAAG,gDAAgD,CAAC;IAExE,KAAK,CAAC,OAAO,CAAC,OAAuB;QACnC,MAAM,EAAE,OAAO,EAAE,GAAG,EAAE,GAAG,OAAO,CAAC;QACjC,MAAM,IAAI,GAAG,OAAO,CAAC,IAAc,CAAC;QAEpC,oEAAoE;QACpE,MAAM,aAAa,GAAG,IAAI,aAAa,CAAC,OAAO,CAAC,CAAC;QACjD,MAAM,OAAO,GAAG,aAAa,CAAC,OAAO,CAAC;QACtC,MAAM,aAAa,GAAG,aAAa,CAAC,aAAa,CAAC;QAElD,oCAAoC;QACpC,MAAM,WAAW,GACf,aAAa,KAAK,KAAK;YACrB,CAAC,CAAC,UAAU;YACZ,CAAC,CAAC,aAAa,KAAK,SAAS;gBAC3B,CAAC,CAAC,SAAS;gBACX,CAAC,CAAC,aAAa,KAAK,KAAK;oBACvB,CAAC,CAAC,iBAAiB;oBACnB,CAAC,CAAC,aAAa,KAAK,QAAQ;wBAC1B,CAAC,CAAC,QAAQ;wBACV,CAAC,CAAC,IAAI,CAAC;QAEjB,kCAAkC;QAClC,MAAM,cAAc,GAAG,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;QACxE,MAAM,aAAa,GAAG,WAAW,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,GAAG,CAAC,SAAS,WAAW,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAClF,OAAO,CAAC,GAAG,CACT,GAAG,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,aAAa,cAAc,GAAG,aAAa,IAAI,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,SAAS,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAC9H,CAAC;QAEF,8CAA8C;QAC9C,MAAM,MAAM,GAAG,MAAM,kBAAkB,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QACvD,IAAI,MAAM,EAAE,CAAC;YACX,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,GAAG,MAAM,CAAC;YACxC,MAAM,OAAO,GAAG,wBAAwB,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC;YAC7D,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;QAC9D,CAAC;aAAM,CAAC;YACN,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,qBAAqB,CAAC,CAAC,CAAC;QACnD,CAAC;QAED,6CAA6C;QAC7C,IAAI,WAAW,GAAG,KAAK,CAAC;QACxB,IAAI,CAAC;YACH,MAAM,QAAQ,GAAG,MAAM,GAAG,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC;YAE9C,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,+BAA+B,CAAC,CAAC,CAAC;YAC1D,OAAO,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;YACpE,IAAI,QAAQ,CAAC,UAAU,IAAI,QAAQ,CAAC,SAAS,EAAE,CAAC;gBAC9C,MAAM,QAAQ,GAAG,CAAC,QAAQ,CAAC,UAAU,EAAE,QAAQ,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;gBACrF,OAAO,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,QAAQ,EAAE,CAAC,CAAC;YACpD,CAAC;YACD,IAAI,QAAQ,CAAC,UAAU,EAAE,CAAC;gBACxB,OAAO,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,IAAI,CAAC,aAAa,CAAC,IAAI,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC;YACnF,CAAC;YACD,WAAW,GAAG,IAAI,CAAC;QACrB,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,IAAI,KAAK,YAAY,eAAe,IAAI,KAAK,CAAC,MAAM,KAAK,GAAG,EAAE,CAAC;gBAC7D,cAAc,CAAC,KAAK,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;YACvC,CAAC;iBAAM,CAAC;gBACN,OAAO,CAAC,KAAK,CACX,KAAK,CAAC,GAAG,CACP,wBAAwB,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CACjF,CACF,CAAC;YACJ,CAAC;QACH,CAAC;QAED,OAAO,CAAC,GAAG,EAAE,CAAC;QAEd,2FAA2F;QAC3F,aAAa,CAAC,kBAAkB,EAAE,CAAC;QAEnC,OAAO,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC7B,CAAC;CACF"}
1
+ {"version":3,"file":"status-command.js","sourceRoot":"","sources":["../../src/commands/status-command.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,WAAW,EAAuB,cAAc,EAAE,MAAM,cAAc,CAAC;AAChF,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAE3D,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B;;;GAGG;AACH,MAAM,OAAO,aAAc,SAAQ,WAAW;IACnC,IAAI,GAAG,QAAQ,CAAC;IAChB,WAAW,GAAG,gDAAgD,CAAC;IAExE,KAAK,CAAC,OAAO,CAAC,OAAuB;QACnC,MAAM,EAAE,OAAO,EAAE,GAAG,EAAE,GAAG,OAAO,CAAC;QACjC,MAAM,IAAI,GAAG,OAAO,CAAC,IAAc,CAAC;QAEpC,oEAAoE;QACpE,MAAM,aAAa,GAAG,IAAI,aAAa,CAAC,OAAO,CAAC,CAAC;QACjD,MAAM,OAAO,GAAG,aAAa,CAAC,OAAO,CAAC;QACtC,MAAM,aAAa,GAAG,aAAa,CAAC,aAAa,CAAC;QAElD,oCAAoC;QACpC,MAAM,WAAW,GACf,aAAa,KAAK,KAAK;YACrB,CAAC,CAAC,UAAU;YACZ,CAAC,CAAC,aAAa,KAAK,SAAS;gBAC3B,CAAC,CAAC,SAAS;gBACX,CAAC,CAAC,aAAa,KAAK,KAAK;oBACvB,CAAC,CAAC,iBAAiB;oBACnB,CAAC,CAAC,aAAa,KAAK,QAAQ;wBAC1B,CAAC,CAAC,QAAQ;wBACV,CAAC,CAAC,IAAI,CAAC;QAEjB,kCAAkC;QAClC,MAAM,cAAc,GAAG,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;QACxE,MAAM,aAAa,GAAG,WAAW,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,GAAG,CAAC,SAAS,WAAW,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAClF,OAAO,CAAC,GAAG,CACT,GAAG,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,aAAa,cAAc,GAAG,aAAa,IAAI,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,SAAS,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAC9H,CAAC;QAEF,8CAA8C;QAC9C,MAAM,WAAW,GAAG,MAAM,cAAc,CAAC,OAAO,CAAC,CAAC;QAClD,IAAI,WAAW,EAAE,CAAC;YAChB,OAAO,CAAC,GAAG,CAAC,oBAAoB,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;QACzD,CAAC;aAAM,CAAC;YACN,MAAM,MAAM,GAAG,MAAM,kBAAkB,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;YACvD,IAAI,MAAM,EAAE,CAAC;gBACX,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,GAAG,MAAM,CAAC;gBACxC,MAAM,OAAO,GAAG,wBAAwB,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC;gBAC7D,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;YAC9D,CAAC;iBAAM,CAAC;gBACN,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,qBAAqB,CAAC,CAAC,CAAC;YACnD,CAAC;QACH,CAAC;QAED,6CAA6C;QAC7C,IAAI,WAAW,GAAG,KAAK,CAAC;QACxB,IAAI,CAAC;YACH,MAAM,QAAQ,GAAG,MAAM,GAAG,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC;YAE9C,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,+BAA+B,CAAC,CAAC,CAAC;YAC1D,OAAO,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;YACpE,IAAI,QAAQ,CAAC,UAAU,IAAI,QAAQ,CAAC,SAAS,EAAE,CAAC;gBAC9C,MAAM,QAAQ,GAAG,CAAC,QAAQ,CAAC,UAAU,EAAE,QAAQ,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;gBACrF,OAAO,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,QAAQ,EAAE,CAAC,CAAC;YACpD,CAAC;YACD,IAAI,QAAQ,CAAC,UAAU,EAAE,CAAC;gBACxB,OAAO,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,IAAI,CAAC,aAAa,CAAC,IAAI,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC;YACnF,CAAC;YACD,WAAW,GAAG,IAAI,CAAC;QACrB,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,IAAI,KAAK,YAAY,eAAe,IAAI,KAAK,CAAC,MAAM,KAAK,GAAG,EAAE,CAAC;gBAC7D,cAAc,CAAC,KAAK,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;YACvC,CAAC;iBAAM,CAAC;gBACN,OAAO,CAAC,KAAK,CACX,KAAK,CAAC,GAAG,CACP,wBAAwB,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CACjF,CACF,CAAC;YACJ,CAAC;QACH,CAAC;QAED,OAAO,CAAC,GAAG,EAAE,CAAC;QAEd,2FAA2F;QAC3F,aAAa,CAAC,kBAAkB,EAAE,CAAC;QAEnC,OAAO,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC7B,CAAC;CACF"}
@@ -1 +1 @@
1
- const a45_0x5a6d7e=a45_0x5c1a;(function(_0x2e7457,_0x4d1fdb){const _0x4f61c4=a45_0x5c1a,_0x24664d=_0x2e7457();while(!![]){try{const _0xe28b90=parseInt(_0x4f61c4(0x20f))/0x1+parseInt(_0x4f61c4(0x1ec))/0x2*(-parseInt(_0x4f61c4(0x1ea))/0x3)+-parseInt(_0x4f61c4(0x1fe))/0x4*(parseInt(_0x4f61c4(0x21d))/0x5)+parseInt(_0x4f61c4(0x215))/0x6+-parseInt(_0x4f61c4(0x20c))/0x7+parseInt(_0x4f61c4(0x218))/0x8*(parseInt(_0x4f61c4(0x206))/0x9)+parseInt(_0x4f61c4(0x1e5))/0xa*(parseInt(_0x4f61c4(0x214))/0xb);if(_0xe28b90===_0x4d1fdb)break;else _0x24664d['push'](_0x24664d['shift']());}catch(_0x4f3dfb){_0x24664d['push'](_0x24664d['shift']());}}}(a45_0x2aef,0x46f35));function a45_0x2aef(){const _0x2c97fd=['2079328IJMZuD','\x20\x20tdx\x20tables\x20\x22mydb.*\x22\x20\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb','Error:\x20Too\x20many\x20arguments.\x20Use\x20single\x20argument:','site','Or\x20use\x20--in\x20flag:','935230afIGaC','60oGDjkg','description','\x20table','query','message','28674YCfpSi','📋\x20','100fcZrZE','Error:\x20','\x20\x20Use:\x20tdx\x20tables\x20\x22','length','Database\x20pattern:\x20','cause','.*\x22','\x20\x20tdx\x20tables\x20\x22*.user*\x22\x20\x20\x20\x20\x20\x20\x20->\x20tables\x20matching\x20user*\x20across\x20databases','\x20\x20tdx\x20tables\x20\x22mydb.users\x22\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20in\x20database\x20mydb','\x20\x20Or:\x20\x20tdx\x20tables\x20--database\x20','\x27\x20is\x20ambiguous.','Table\x20pattern:\x20','Database:\x20','\x20\x20Cause:\x20','\x20\x20Or:\x20\x20tdx\x20tables\x20--in\x20','\x27\x20without\x20wildcards\x20would\x20search\x20for\x20tables\x20named\x20\x27','List\x20tables\x20in\x20a\x20database','log','4FBeioU','Note:\x20\x27','listTables','\x20\x20tdx\x20tables\x20users\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20across\x20all\x20databases','includes','error','verbose','Database\x20\x27','9ltaeKU','limit','Database:\x20all','Listing\x20tables...','\x20\x20tdx\x20tables\x20--in\x20mydb\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb','execute','3685430IQUayA','name','Did\x20you\x20mean\x20to\x20list\x20all\x20tables\x20from\x20database\x20\x27','152383EXHKCg','✔\x20Found\x20','table_name','table','database','1781417pjdJnl','588408oMTbnI','tables','database_name'];a45_0x2aef=function(){return _0x2c97fd;};return a45_0x2aef();}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 a45_0x5c1a(_0x33e83f,_0x2ffc7c){_0x33e83f=_0x33e83f-0x1e5;const _0x2aeff2=a45_0x2aef();let _0x5c1a60=_0x2aeff2[_0x33e83f];return _0x5c1a60;}import{DEFAULT_LISTING_LIMIT,resolveLimit}from'../core/constants.js';import{withSpinner}from'../utils/spinner.js';export class TablesCommand extends BaseCommand{[a45_0x5a6d7e(0x20d)]=a45_0x5a6d7e(0x216);[a45_0x5a6d7e(0x1e6)]=a45_0x5a6d7e(0x1fc);async[a45_0x5a6d7e(0x20b)](_0x13ac2d){const _0x51f321=a45_0x5a6d7e,{options:_0x418abe,args:_0x4aa29d,tdx:_0x16a0fe}=_0x13ac2d;let _0x28be06;if(_0x4aa29d[_0x51f321(0x1ef)]===0x0)_0x28be06={'database':undefined,'table':undefined,'original':''};else{if(_0x4aa29d[_0x51f321(0x1ef)]===0x1)try{_0x28be06=parseTableReference(_0x4aa29d[0x0]);if(_0x28be06[_0x51f321(0x212)]&&!_0x28be06['database']&&!_0x28be06['table'][_0x51f321(0x202)]('*')&&!_0x28be06[_0x51f321(0x212)][_0x51f321(0x202)]('?'))return console[_0x51f321(0x203)]('Error:\x20Pattern\x20\x27'+_0x4aa29d[0x0]+_0x51f321(0x1f6)),console[_0x51f321(0x203)](_0x51f321(0x20e)+_0x28be06[_0x51f321(0x212)]+'\x27?'),console['error'](_0x51f321(0x1ee)+_0x28be06[_0x51f321(0x212)]+_0x51f321(0x1f2)),console[_0x51f321(0x203)](_0x51f321(0x1fa)+_0x28be06[_0x51f321(0x212)]),console[_0x51f321(0x203)](_0x51f321(0x1f5)+_0x28be06[_0x51f321(0x212)]),console[_0x51f321(0x203)](''),console[_0x51f321(0x203)](_0x51f321(0x1ff)+_0x4aa29d[0x0]+_0x51f321(0x1fb)+_0x28be06[_0x51f321(0x212)]+'\x27\x20across\x20all\x20databases.'),0x1;}catch(_0x2b3dd5){return console[_0x51f321(0x203)](_0x51f321(0x1ed)+_0x2b3dd5[_0x51f321(0x1e9)]),0x1;}else return console['error'](_0x51f321(0x21a)),console[_0x51f321(0x203)](_0x51f321(0x201)),console['error'](_0x51f321(0x219)),console['error'](_0x51f321(0x1f4)),console[_0x51f321(0x203)](_0x51f321(0x1f3)),console['error'](_0x51f321(0x21c)),console['error'](_0x51f321(0x20a)),0x1;}const _0x54a7f3=_0x418abe['database'];!_0x28be06['database']&&_0x54a7f3&&(_0x28be06[_0x51f321(0x213)]=_0x54a7f3);try{const _0xbfa93b=_0x5f139b=>_0x5f139b&&(_0x5f139b['includes']('*')||_0x5f139b[_0x51f321(0x202)]('?')),_0x48986a=_0xbfa93b(_0x28be06[_0x51f321(0x213)]);_0x418abe[_0x51f321(0x204)]&&(console['error']('Site:\x20'+_0x418abe[_0x51f321(0x21b)]),_0x28be06['database']?_0x48986a?console[_0x51f321(0x203)](_0x51f321(0x1f0)+_0x28be06['database']):console[_0x51f321(0x203)](_0x51f321(0x1f8)+_0x28be06[_0x51f321(0x213)]):console[_0x51f321(0x203)](_0x51f321(0x208)),_0x28be06[_0x51f321(0x212)]&&console[_0x51f321(0x203)](_0x51f321(0x1f7)+_0x28be06['table']));const _0x373f27=_0x28be06['database']&&!_0x48986a?_0x28be06['database']:undefined,_0x5bcbc1=_0x48986a?_0x28be06[_0x51f321(0x213)]:undefined,_0x3bcecf=_0x28be06[_0x51f321(0x212)],_0x1bb8fd=resolveLimit(_0x418abe[_0x51f321(0x207)],DEFAULT_LISTING_LIMIT),_0x50f38b=await withSpinner(_0x51f321(0x209),()=>_0x16a0fe[_0x51f321(0x1e8)][_0x51f321(0x200)](_0x373f27,_0x3bcecf,_0x5bcbc1,_0x1bb8fd),{'verbose':_0x418abe['verbose']}),_0x49db50=_0x50f38b['data'];if(_0x49db50[_0x51f321(0x1ef)]===0x0&&_0x28be06['database']&&!_0x48986a)return console[_0x51f321(0x203)]('✖\x20No\x20tables\x20found'),console[_0x51f321(0x203)](_0x51f321(0x205)+_0x28be06[_0x51f321(0x213)]+'\x27\x20may\x20not\x20exist\x20or\x20contains\x20no\x20tables'),0x1;console[_0x51f321(0x203)](_0x51f321(0x210)+_0x49db50['length']+_0x51f321(0x1e7)+(_0x49db50[_0x51f321(0x1ef)]!==0x1?'s':''));if(isStructuredFormat(_0x418abe))await handleSDKOutput(_0x49db50,{..._0x418abe,'limit':_0x1bb8fd});else for(const _0x27f014 of _0x49db50){const _0x2b45a1=_0x27f014['database_name']?_0x27f014[_0x51f321(0x217)]+'.':'';console[_0x51f321(0x1fd)](_0x51f321(0x1eb)+_0x2b45a1+_0x27f014[_0x51f321(0x211)]);}return 0x0;}catch(_0x5cb7c8){if(_0x5cb7c8 instanceof SDKError)return console['error']('Error:\x20'+_0x5cb7c8['message']),_0x5cb7c8[_0x51f321(0x1f1)]&&console[_0x51f321(0x203)](_0x51f321(0x1f9)+_0x5cb7c8[_0x51f321(0x1f1)]),0x1;throw _0x5cb7c8;}}['validate'](_0x102b3d){return undefined;}}
1
+ const a46_0x4a3c66=a46_0x17a6;(function(_0x596361,_0x3a43e9){const _0x1a35f9=a46_0x17a6,_0x1a0837=_0x596361();while(!![]){try{const _0x53f001=parseInt(_0x1a35f9(0x20e))/0x1*(parseInt(_0x1a35f9(0x1fa))/0x2)+-parseInt(_0x1a35f9(0x1fb))/0x3*(parseInt(_0x1a35f9(0x210))/0x4)+-parseInt(_0x1a35f9(0x1f9))/0x5*(parseInt(_0x1a35f9(0x211))/0x6)+parseInt(_0x1a35f9(0x213))/0x7*(parseInt(_0x1a35f9(0x1f4))/0x8)+parseInt(_0x1a35f9(0x1e9))/0x9+-parseInt(_0x1a35f9(0x208))/0xa*(parseInt(_0x1a35f9(0x20d))/0xb)+parseInt(_0x1a35f9(0x214))/0xc;if(_0x53f001===_0x3a43e9)break;else _0x1a0837['push'](_0x1a0837['shift']());}catch(_0x36f7a8){_0x1a0837['push'](_0x1a0837['shift']());}}}(a46_0x128c,0xa154e));function a46_0x17a6(_0x50f8e9,_0x56d506){_0x50f8e9=_0x50f8e9-0x1e6;const _0x128c9f=a46_0x128c();let _0x17a6b4=_0x128c9f[_0x50f8e9];return _0x17a6b4;}function a46_0x128c(){const _0x116cf6=['data','1740JPmLQT','\x20\x20tdx\x20tables\x20users\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20across\x20all\x20databases','\x20\x20Use:\x20tdx\x20tables\x20\x22','\x20\x20Cause:\x20','Error:\x20','18997vbsHah','13ZqTbem','name','2732ikcWMG','723696aGwjbf','message','21qTMvJt','1148280qSEfOa','execute','includes','database_name','query','\x27\x20across\x20all\x20databases.','\x27\x20is\x20ambiguous.','Site:\x20','Or\x20use\x20--in\x20flag:','validate','\x20\x20Or:\x20\x20tdx\x20tables\x20--database\x20','limit','database','table','site','4992282UbtoUR','Table\x20pattern:\x20','\x20\x20tdx\x20tables\x20\x22mydb.*\x22\x20\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb','Database:\x20','error','cause','\x20\x20tdx\x20tables\x20\x22*.user*\x22\x20\x20\x20\x20\x20\x20\x20->\x20tables\x20matching\x20user*\x20across\x20databases','Error:\x20Pattern\x20\x27','verbose','\x20\x20tdx\x20tables\x20--in\x20mydb\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb','Database:\x20all','3428568ZenxMb','description','\x27\x20may\x20not\x20exist\x20or\x20contains\x20no\x20tables','tables','log','45KPgNcR','61802qbtRGc','1278JXNXrq','listTables','Did\x20you\x20mean\x20to\x20list\x20all\x20tables\x20from\x20database\x20\x27','length','Database\x20pattern:\x20','table_name','✖\x20No\x20tables\x20found','Database\x20\x27','.*\x22','\x20\x20tdx\x20tables\x20\x22mydb.users\x22\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20in\x20database\x20mydb','Note:\x20\x27','Error:\x20Too\x20many\x20arguments.\x20Use\x20single\x20argument:'];a46_0x128c=function(){return _0x116cf6;};return a46_0x128c();}import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput,isStructuredFormat}from'../core/command-output.js';import{parseTableReference}from'../utils/table-ref-parser.js';import{DEFAULT_LISTING_LIMIT,resolveLimit}from'../core/constants.js';import{withSpinner}from'../utils/spinner.js';export class TablesCommand extends BaseCommand{[a46_0x4a3c66(0x20f)]=a46_0x4a3c66(0x1f7);[a46_0x4a3c66(0x1f5)]='List\x20tables\x20in\x20a\x20database';async[a46_0x4a3c66(0x215)](_0x1d5ae1){const _0x5e8c6c=a46_0x4a3c66,{options:_0x32f7a4,args:_0x49b8dc,tdx:_0x11503d}=_0x1d5ae1;let _0x5719d6;if(_0x49b8dc[_0x5e8c6c(0x1fe)]===0x0)_0x5719d6={'database':undefined,'table':undefined,'original':''};else{if(_0x49b8dc['length']===0x1)try{_0x5719d6=parseTableReference(_0x49b8dc[0x0]);if(_0x5719d6[_0x5e8c6c(0x1e7)]&&!_0x5719d6[_0x5e8c6c(0x1e6)]&&!_0x5719d6[_0x5e8c6c(0x1e7)][_0x5e8c6c(0x216)]('*')&&!_0x5719d6[_0x5e8c6c(0x1e7)][_0x5e8c6c(0x216)]('?'))return console[_0x5e8c6c(0x1ed)](_0x5e8c6c(0x1f0)+_0x49b8dc[0x0]+_0x5e8c6c(0x21a)),console[_0x5e8c6c(0x1ed)](_0x5e8c6c(0x1fd)+_0x5719d6['table']+'\x27?'),console['error'](_0x5e8c6c(0x20a)+_0x5719d6['table']+_0x5e8c6c(0x203)),console[_0x5e8c6c(0x1ed)]('\x20\x20Or:\x20\x20tdx\x20tables\x20--in\x20'+_0x5719d6['table']),console['error'](_0x5e8c6c(0x21e)+_0x5719d6[_0x5e8c6c(0x1e7)]),console[_0x5e8c6c(0x1ed)](''),console['error'](_0x5e8c6c(0x205)+_0x49b8dc[0x0]+'\x27\x20without\x20wildcards\x20would\x20search\x20for\x20tables\x20named\x20\x27'+_0x5719d6[_0x5e8c6c(0x1e7)]+_0x5e8c6c(0x219)),0x1;}catch(_0x2e3185){return console[_0x5e8c6c(0x1ed)](_0x5e8c6c(0x20c)+_0x2e3185['message']),0x1;}else return console[_0x5e8c6c(0x1ed)](_0x5e8c6c(0x206)),console['error'](_0x5e8c6c(0x209)),console[_0x5e8c6c(0x1ed)](_0x5e8c6c(0x1eb)),console[_0x5e8c6c(0x1ed)](_0x5e8c6c(0x204)),console[_0x5e8c6c(0x1ed)](_0x5e8c6c(0x1ef)),console['error'](_0x5e8c6c(0x21c)),console[_0x5e8c6c(0x1ed)](_0x5e8c6c(0x1f2)),0x1;}const _0x36add1=_0x32f7a4['database'];!_0x5719d6[_0x5e8c6c(0x1e6)]&&_0x36add1&&(_0x5719d6[_0x5e8c6c(0x1e6)]=_0x36add1);try{const _0x215334=_0x3d863d=>_0x3d863d&&(_0x3d863d[_0x5e8c6c(0x216)]('*')||_0x3d863d[_0x5e8c6c(0x216)]('?')),_0x21860b=_0x215334(_0x5719d6[_0x5e8c6c(0x1e6)]);_0x32f7a4[_0x5e8c6c(0x1f1)]&&(console[_0x5e8c6c(0x1ed)](_0x5e8c6c(0x21b)+_0x32f7a4[_0x5e8c6c(0x1e8)]),_0x5719d6['database']?_0x21860b?console[_0x5e8c6c(0x1ed)](_0x5e8c6c(0x1ff)+_0x5719d6[_0x5e8c6c(0x1e6)]):console[_0x5e8c6c(0x1ed)](_0x5e8c6c(0x1ec)+_0x5719d6[_0x5e8c6c(0x1e6)]):console['error'](_0x5e8c6c(0x1f3)),_0x5719d6['table']&&console[_0x5e8c6c(0x1ed)](_0x5e8c6c(0x1ea)+_0x5719d6['table']));const _0x27bd93=_0x5719d6[_0x5e8c6c(0x1e6)]&&!_0x21860b?_0x5719d6[_0x5e8c6c(0x1e6)]:undefined,_0x4aa554=_0x21860b?_0x5719d6[_0x5e8c6c(0x1e6)]:undefined,_0x18a6d1=_0x5719d6['table'],_0x20877f=resolveLimit(_0x32f7a4[_0x5e8c6c(0x21f)],DEFAULT_LISTING_LIMIT),_0x5901e5=await withSpinner('Listing\x20tables...',()=>_0x11503d[_0x5e8c6c(0x218)][_0x5e8c6c(0x1fc)](_0x27bd93,_0x18a6d1,_0x4aa554,_0x20877f),{'verbose':_0x32f7a4[_0x5e8c6c(0x1f1)]}),_0x4c27aa=_0x5901e5[_0x5e8c6c(0x207)];if(_0x4c27aa[_0x5e8c6c(0x1fe)]===0x0&&_0x5719d6[_0x5e8c6c(0x1e6)]&&!_0x21860b)return console[_0x5e8c6c(0x1ed)](_0x5e8c6c(0x201)),console['error'](_0x5e8c6c(0x202)+_0x5719d6[_0x5e8c6c(0x1e6)]+_0x5e8c6c(0x1f6)),0x1;console[_0x5e8c6c(0x1ed)]('✔\x20Found\x20'+_0x4c27aa[_0x5e8c6c(0x1fe)]+'\x20table'+(_0x4c27aa[_0x5e8c6c(0x1fe)]!==0x1?'s':''));if(isStructuredFormat(_0x32f7a4))await handleSDKOutput(_0x4c27aa,{..._0x32f7a4,'limit':_0x20877f});else for(const _0x48e401 of _0x4c27aa){const _0x527abe=_0x48e401[_0x5e8c6c(0x217)]?_0x48e401[_0x5e8c6c(0x217)]+'.':'';console[_0x5e8c6c(0x1f8)]('📋\x20'+_0x527abe+_0x48e401[_0x5e8c6c(0x200)]);}return 0x0;}catch(_0x1f0c27){if(_0x1f0c27 instanceof SDKError)return console[_0x5e8c6c(0x1ed)](_0x5e8c6c(0x20c)+_0x1f0c27[_0x5e8c6c(0x212)]),_0x1f0c27['cause']&&console[_0x5e8c6c(0x1ed)](_0x5e8c6c(0x20b)+_0x1f0c27[_0x5e8c6c(0x1ee)]),0x1;throw _0x1f0c27;}}[a46_0x4a3c66(0x21d)](_0x148d13){return undefined;}}