@treasuredata/tdx 0.16.4 → 0.16.5

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 (217) 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.d.ts.map +1 -1
  9. package/dist/commands/agent-command.js +1 -1
  10. package/dist/commands/agent-command.js.map +1 -1
  11. package/dist/commands/agent-test-command.d.ts +4 -0
  12. package/dist/commands/agent-test-command.d.ts.map +1 -1
  13. package/dist/commands/agent-test-command.js +1 -1
  14. package/dist/commands/agent-test-command.js.map +1 -1
  15. package/dist/commands/api-command.js +1 -1
  16. package/dist/commands/auth-command.d.ts.map +1 -1
  17. package/dist/commands/auth-command.js +1 -1
  18. package/dist/commands/auth-command.js.map +1 -1
  19. package/dist/commands/chat-command.js +1 -1
  20. package/dist/commands/claude-command.js +1 -1
  21. package/dist/commands/claude-statusline-command.js +1 -1
  22. package/dist/commands/claude-usage-command.js +1 -1
  23. package/dist/commands/command.js +1 -1
  24. package/dist/commands/connection-command.js +1 -1
  25. package/dist/commands/databases.js +1 -1
  26. package/dist/commands/describe.js +1 -1
  27. package/dist/commands/engage-command.js +1 -1
  28. package/dist/commands/job-command.js +1 -1
  29. package/dist/commands/journey-command.js +1 -1
  30. package/dist/commands/journey-validate-command.js +1 -1
  31. package/dist/commands/llm-command.js +1 -1
  32. package/dist/commands/llm-proxy.js +1 -1
  33. package/dist/commands/mcp-command.js +1 -1
  34. package/dist/commands/parent-segment-command.js +1 -1
  35. package/dist/commands/profile-command.d.ts.map +1 -1
  36. package/dist/commands/profile-command.js +1 -1
  37. package/dist/commands/profile-command.js.map +1 -1
  38. package/dist/commands/profiles-command.js +1 -1
  39. package/dist/commands/query-command.js +1 -1
  40. package/dist/commands/segment-command.js +1 -1
  41. package/dist/commands/segment-create-command.js +1 -1
  42. package/dist/commands/segment-fields-command.js +1 -1
  43. package/dist/commands/segment-pull-command.js +1 -1
  44. package/dist/commands/segment-push-command.js +1 -1
  45. package/dist/commands/segment-update-command.js +1 -1
  46. package/dist/commands/segment-use-command.js +1 -1
  47. package/dist/commands/segment-validate-command.js +1 -1
  48. package/dist/commands/segments.js +1 -1
  49. package/dist/commands/show.js +1 -1
  50. package/dist/commands/tables.js +1 -1
  51. package/dist/commands/unset-command.js +1 -1
  52. package/dist/commands/use-command.js +1 -1
  53. package/dist/commands/user-command.js +1 -1
  54. package/dist/commands/workflow-command.js +1 -1
  55. package/dist/core/auth.js +1 -1
  56. package/dist/core/command-output.js +1 -1
  57. package/dist/core/config.d.ts +7 -5
  58. package/dist/core/config.d.ts.map +1 -1
  59. package/dist/core/config.js +1 -1
  60. package/dist/core/config.js.map +1 -1
  61. package/dist/core/connection-cache.d.ts.map +1 -1
  62. package/dist/core/connection-cache.js +1 -1
  63. package/dist/core/connection-cache.js.map +1 -1
  64. package/dist/core/constants.d.ts +22 -0
  65. package/dist/core/constants.d.ts.map +1 -1
  66. package/dist/core/constants.js +1 -1
  67. package/dist/core/constants.js.map +1 -1
  68. package/dist/core/credential-cache.js +1 -1
  69. package/dist/core/global-context.js +1 -1
  70. package/dist/core/keychain.d.ts.map +1 -1
  71. package/dist/core/keychain.js +1 -1
  72. package/dist/core/keychain.js.map +1 -1
  73. package/dist/core/profile.js +1 -1
  74. package/dist/core/project-config.js +1 -1
  75. package/dist/core/session.js +1 -1
  76. package/dist/core/user-cache.d.ts.map +1 -1
  77. package/dist/core/user-cache.js +1 -1
  78. package/dist/core/user-cache.js.map +1 -1
  79. package/dist/core/version.d.ts +2 -2
  80. package/dist/core/version.js +1 -1
  81. package/dist/index.js +1 -1
  82. package/dist/mcp/server.js +1 -1
  83. package/dist/mcp/tools/index.js +1 -1
  84. package/dist/mcp/tools/tdx-run.js +1 -1
  85. package/dist/mcp/tools/tdx-search.js +1 -1
  86. package/dist/mcp/utils.js +1 -1
  87. package/dist/proxy/anthropic-adapter.js +1 -1
  88. package/dist/proxy/claude-usage-tracker.js +1 -1
  89. package/dist/proxy/claude-usage-tracker.js.map +1 -1
  90. package/dist/proxy/context-signature.js +1 -1
  91. package/dist/proxy/conversation-utils.js +1 -1
  92. package/dist/proxy/passthrough-server.js +1 -1
  93. package/dist/proxy/server.js +1 -1
  94. package/dist/proxy/session-cache.js +1 -1
  95. package/dist/proxy/sse-usage-parser.js +1 -1
  96. package/dist/sdk/agent/agent-config.js +1 -1
  97. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  98. package/dist/sdk/agent/agent-yaml.d.ts +2 -0
  99. package/dist/sdk/agent/agent-yaml.d.ts.map +1 -1
  100. package/dist/sdk/agent/agent-yaml.js +1 -1
  101. package/dist/sdk/agent/agent-yaml.js.map +1 -1
  102. package/dist/sdk/agent/test/evaluator.d.ts +3 -6
  103. package/dist/sdk/agent/test/evaluator.d.ts.map +1 -1
  104. package/dist/sdk/agent/test/evaluator.js +1 -1
  105. package/dist/sdk/agent/test/evaluator.js.map +1 -1
  106. package/dist/sdk/agent/test/executor.d.ts +57 -1
  107. package/dist/sdk/agent/test/executor.d.ts.map +1 -1
  108. package/dist/sdk/agent/test/executor.js +1 -1
  109. package/dist/sdk/agent/test/executor.js.map +1 -1
  110. package/dist/sdk/agent/test/index.d.ts +2 -2
  111. package/dist/sdk/agent/test/index.d.ts.map +1 -1
  112. package/dist/sdk/agent/test/index.js +1 -1
  113. package/dist/sdk/agent/test/index.js.map +1 -1
  114. package/dist/sdk/agent/test/output.js +1 -1
  115. package/dist/sdk/agent/test/parser.d.ts.map +1 -1
  116. package/dist/sdk/agent/test/parser.js +1 -1
  117. package/dist/sdk/agent/test/parser.js.map +1 -1
  118. package/dist/sdk/agent/test/types.d.ts +44 -0
  119. package/dist/sdk/agent/test/types.d.ts.map +1 -1
  120. package/dist/sdk/api.js +1 -1
  121. package/dist/sdk/claude-agent/claude-agent-client.js +1 -1
  122. package/dist/sdk/claude-agent/environment.js +1 -1
  123. package/dist/sdk/claude-agent/index.js +1 -1
  124. package/dist/sdk/claude-agent/system-prompts.js +1 -1
  125. package/dist/sdk/client/cdp-api-client.js +1 -1
  126. package/dist/sdk/client/endpoints.js +1 -1
  127. package/dist/sdk/client/endpoints.js.map +1 -1
  128. package/dist/sdk/client/engage-api-client.js +1 -1
  129. package/dist/sdk/client/http-client.js +1 -1
  130. package/dist/sdk/client/llm-api-client.d.ts +6 -0
  131. package/dist/sdk/client/llm-api-client.d.ts.map +1 -1
  132. package/dist/sdk/client/llm-api-client.js +1 -1
  133. package/dist/sdk/client/llm-api-client.js.map +1 -1
  134. package/dist/sdk/client/rate-limiter.js +1 -1
  135. package/dist/sdk/client/td-api-client.js +1 -1
  136. package/dist/sdk/client/trino-api-client.js +1 -1
  137. package/dist/sdk/client/workflow-client.js +1 -1
  138. package/dist/sdk/connection-validator.js +1 -1
  139. package/dist/sdk/connection.js +1 -1
  140. package/dist/sdk/engage.js +1 -1
  141. package/dist/sdk/errors.js +1 -1
  142. package/dist/sdk/index.js +1 -1
  143. package/dist/sdk/io/index.js +1 -1
  144. package/dist/sdk/io/node-filesystem.js +1 -1
  145. package/dist/sdk/job.js +1 -1
  146. package/dist/sdk/journey.js +1 -1
  147. package/dist/sdk/llm/chat-cache.d.ts.map +1 -1
  148. package/dist/sdk/llm/chat-cache.js +1 -1
  149. package/dist/sdk/llm/chat-cache.js.map +1 -1
  150. package/dist/sdk/llm/index.d.ts +11 -3
  151. package/dist/sdk/llm/index.d.ts.map +1 -1
  152. package/dist/sdk/llm/index.js +1 -1
  153. package/dist/sdk/llm/index.js.map +1 -1
  154. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  155. package/dist/sdk/llm/model-aliases.js +1 -1
  156. package/dist/sdk/llm/model-factors.js +1 -1
  157. package/dist/sdk/query/index.js +1 -1
  158. package/dist/sdk/query/sql-parser.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-yaml.js +1 -1
  164. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  165. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  166. package/dist/sdk/segment/pull-workflow.js +1 -1
  167. package/dist/sdk/segment/push-workflow.js +1 -1
  168. package/dist/sdk/segment/resolution-context.js +1 -1
  169. package/dist/sdk/segment/segment-path-parser.js +1 -1
  170. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  171. package/dist/sdk/segment/target-resolution.js +1 -1
  172. package/dist/sdk/segment/tdx-config.js +1 -1
  173. package/dist/sdk/segment/validate-files.js +1 -1
  174. package/dist/sdk/segment/yaml-validator.js +1 -1
  175. package/dist/sdk/segment.js +1 -1
  176. package/dist/sdk/types/index.js +1 -1
  177. package/dist/sdk/types/llm.d.ts +39 -0
  178. package/dist/sdk/types/llm.d.ts.map +1 -1
  179. package/dist/sdk/types/progress.js +1 -1
  180. package/dist/sdk/user.js +1 -1
  181. package/dist/sdk/util/format-detector.js +1 -1
  182. package/dist/sdk/util/formatters.js +1 -1
  183. package/dist/sdk/util/index.js +1 -1
  184. package/dist/sdk/util/tree-formatter.js +1 -1
  185. package/dist/sdk/workflow/clone-workflow.js +1 -1
  186. package/dist/sdk/workflow/index.js +1 -1
  187. package/dist/sdk/workflow/pull-workflow.js +1 -1
  188. package/dist/sdk/workflow/push-workflow.js +1 -1
  189. package/dist/sdk/workflow/tdx-config.js +1 -1
  190. package/dist/sdk/workflow/workflow-utils.js +1 -1
  191. package/dist/utils/async.js +1 -1
  192. package/dist/utils/colors.js +1 -1
  193. package/dist/utils/diff.js +1 -1
  194. package/dist/utils/file-permissions.js +1 -1
  195. package/dist/utils/global-cache.d.ts +88 -0
  196. package/dist/utils/global-cache.d.ts.map +1 -0
  197. package/dist/utils/global-cache.js +1 -0
  198. package/dist/utils/global-cache.js.map +1 -0
  199. package/dist/utils/json-loader.js +1 -1
  200. package/dist/utils/local-cache.d.ts +48 -0
  201. package/dist/utils/local-cache.d.ts.map +1 -0
  202. package/dist/utils/local-cache.js +1 -0
  203. package/dist/utils/local-cache.js.map +1 -0
  204. package/dist/utils/option-validation.js +1 -1
  205. package/dist/utils/port.js +1 -1
  206. package/dist/utils/process.js +1 -1
  207. package/dist/utils/prompt.js +1 -1
  208. package/dist/utils/spinner.js +1 -1
  209. package/dist/utils/sse-parser.js +1 -1
  210. package/dist/utils/string-utils.js +1 -1
  211. package/dist/utils/table-ref-parser.js +1 -1
  212. package/dist/utils/tdx-logger.js +1 -1
  213. package/dist/utils/tdx-logger.js.map +1 -1
  214. package/dist/utils/version-check.d.ts.map +1 -1
  215. package/dist/utils/version-check.js +1 -1
  216. package/dist/utils/version-check.js.map +1 -1
  217. package/package.json +2 -2
@@ -1 +1 @@
1
- const a31_0x16db10=a31_0x36af;function a31_0x3ddf(){const _0x5f34c7=['No\x20','isScoped','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','resolveParentId','join','4611786fTERdF','segment\x20or\x20journey','📁\x20','data','error','createdSegmentIds','setPhase','message','deleted','16918810sNDfFF','parent_name','parentFolder','Resolving\x20parent\x20segment\x20\x27','list','idToName','\x20\x20Activations:\x20','556577ZtcgPi','getJourney','diff','new','length','segment:push','5kqpQhJ','getParent','toString','no_parent','/j/da/je','red','add','798556kxhqed','buildUserMaps','\x20deleted','folders','Scoped\x20to\x20folder:\x20','6149416xkvsfJ','get','toUpdate','yes','scopedFolderPath','green','dryRun','(Journey\x20will\x20be\x20deleted)','connection','.yml','journeysOnly','/e/','yellow','listFolders','segments','description','created','cyan','name','Error:\x20','✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','repeat','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','Fetching\x20existing\x20folders...','✔\x20All\x20journeys\x20are\x20up\x20to\x20date','\x0aPush\x20summary\x20for\x20\x27','Push\x20','\x20\x20📊\x20Segments:','delete','relationships','Error:\x20Directory\x20not\x20found:\x20','dim','\x20to\x20delete','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','state','segmentFolderId','blue','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','New\x20segment:','\x0aValidation\x20failed:','endsWith','225LYoHcO','journey','journeys','errorCode','\x20\x20Segments:\x20','getOutputSchemaWithCache','toDelete','3SYcifq','verbose','\x20unchanged','Site:\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)','yamlConfig','\x20\x20\x20\x20','\x0a✔\x20Push\x20complete','activations','map','Changes\x20to:','site','Fetching\x20users\x20for\x20email\x20resolution...','New\x20journey:','\x20changed','file','toCreate','then','journeyId','Preparing\x20journeys...','all','\x27...','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','\x20\x20🗺️\x20\x20Journeys:','nameToId','helpText','Delete\x20segment:','Fetching\x20parent\x20segment\x20details...','\x20to\x20create','filter','versionNumber','set','results','/app/ps/','\x20new','listJourneysWithDetailsFromParentSegment','parentSegment','\x20to\x20update','journeyBundleId','execute','32936DAOGKR','2066960AncgYi','Aborted.','updated','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','\x20updated','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','journeyBundleName','targetDir','\x20YAML\x20files\x20found','Changes\x20to\x20journey:','\x20folders\x20to\x20create','Source\x20directory:\x20','audienceId','\x20activations]','isNew','segment','.yaml','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','type','push','existingJourney','Fetching\x20existing\x20activations...','folderId','attributes','\x20changes?','\x20\x20Source:\x20','folderPath','Parent\x20segment:\x20','Fetching\x20existing\x20journeys...','cwd'];a31_0x3ddf=function(){return _0x5f34c7;};return a31_0x3ddf();}function a31_0x36af(_0x28a363,_0x471248){_0x28a363=_0x28a363-0x130;const _0x3ddf54=a31_0x3ddf();let _0x36af83=_0x3ddf54[_0x28a363];return _0x36af83;}(function(_0x2d90de,_0x918a1d){const _0x308318=a31_0x36af,_0x3b8da5=_0x2d90de();while(!![]){try{const _0x32f55f=-parseInt(_0x308318(0x196))/0x1+parseInt(_0x308318(0x1a3))/0x2*(parseInt(_0x308318(0x139))/0x3)+parseInt(_0x308318(0x162))/0x4+parseInt(_0x308318(0x19c))/0x5*(-parseInt(_0x308318(0x186))/0x6)+-parseInt(_0x308318(0x1a8))/0x7+parseInt(_0x308318(0x161))/0x8*(parseInt(_0x308318(0x132))/0x9)+parseInt(_0x308318(0x18f))/0xa;if(_0x32f55f===_0x918a1d)break;else _0x3b8da5['push'](_0x3b8da5['shift']());}catch(_0x5ab8fb){_0x3b8da5['push'](_0x3b8da5['shift']());}}}(a31_0x3ddf,0x7bcf8));import{BaseCommand}from'./command.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{generateDiff,formatDiffWithColors}from'../utils/diff.js';import{confirmKey}from'../utils/prompt.js';import{batchAsync}from'../utils/async.js';import{segmentToYamlString,segmentWithActivationsToYaml}from'../sdk/segment/child-segment-yaml.js';import a31_0x2cda6e 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{['name']=a31_0x16db10(0x19b);[a31_0x16db10(0x1b7)]=a31_0x16db10(0x174);async[a31_0x16db10(0x160)](_0xe1aa25){const _0x3d981c=a31_0x16db10,{options:_0x363482,args:_0x38deef,tdx:_0x490c94}=_0xe1aa25,_0x1d463a=_0x363482,_0x282dc9=await resolveTarget({'arg':_0x38deef[0x0],'contextParent':_0x363482[_0x3d981c(0x15d)],'cwd':process[_0x3d981c(0x180)]()});if(!isSuccessfulResolution(_0x282dc9))return _0x282dc9[_0x3d981c(0x135)]===_0x3d981c(0x19f)?(console['error'](a31_0x2cda6e[_0x3d981c(0x1b4)]('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console['error'](_0x3d981c(0x13d)),console[_0x3d981c(0x18a)](_0x3d981c(0x183)),console[_0x3d981c(0x18a)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file')):(console[_0x3d981c(0x18a)](a31_0x2cda6e[_0x3d981c(0x1a1)](_0x3d981c(0x1bb)+_0x282dc9['message']+'\x0a')),_0x282dc9[_0x3d981c(0x152)]&&console[_0x3d981c(0x18a)](a31_0x2cda6e[_0x3d981c(0x1b9)](_0x282dc9[_0x3d981c(0x152)]))),0x1;if(_0x282dc9[_0x3d981c(0x175)]===_0x3d981c(0x190))return console[_0x3d981c(0x18a)](a31_0x2cda6e[_0x3d981c(0x1a1)]('Error:\x20Directory\x20not\x20found:\x20'+_0x282dc9[_0x3d981c(0x16a)]+'\x0a')),console[_0x3d981c(0x18a)](a31_0x2cda6e['cyan']('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;const _0x214f66=_0x282dc9['parentName'],_0x19ca64=_0x282dc9['targetDir'],_0xf1d1d2=_0x282dc9[_0x3d981c(0x175)]===_0x3d981c(0x148)?_0x282dc9['filePath']:undefined,_0xd84ddc=getScopedDetails(_0x282dc9),_0x4e9fb7=_0xd84ddc?.[_0x3d981c(0x182)]??![],_0x5ae5bd=_0xd84ddc?.[_0x3d981c(0x1ac)]??'';if(!existsSync(_0x19ca64))return console['error'](a31_0x2cda6e[_0x3d981c(0x1a1)](_0x3d981c(0x1c6)+_0x19ca64+'\x0a')),console[_0x3d981c(0x18a)](a31_0x2cda6e[_0x3d981c(0x1b9)](_0x3d981c(0x1cd))),0x1;_0x1d463a[_0x3d981c(0x13a)]&&(console[_0x3d981c(0x18a)](_0x3d981c(0x13c)+_0x1d463a[_0x3d981c(0x144)]),console['error'](_0x3d981c(0x17e)+_0x214f66),console[_0x3d981c(0x18a)](_0x3d981c(0x16e)+_0x19ca64),_0x4e9fb7&&console[_0x3d981c(0x18a)](_0x3d981c(0x1a7)+_0x5ae5bd));const _0x9d2496=await withSpinner(_0x3d981c(0x192)+_0x214f66+_0x3d981c(0x14e),()=>_0x490c94['segment'][_0x3d981c(0x184)](_0x214f66),{'verbose':_0x1d463a['verbose']}),_0x277fb6=_0x9d2496[_0x3d981c(0x189)],[_0x59a614,_0x434b1c,_0x30ea27,_0x1a6733,_0x46cab7]=await Promise[_0x3d981c(0x14d)]([withSpinner(_0x3d981c(0x154),()=>_0x490c94[_0x3d981c(0x172)][_0x3d981c(0x19d)](_0x277fb6),{'verbose':_0x1d463a[_0x3d981c(0x13a)]}),withSpinner('Fetching\x20existing\x20segments...',()=>_0x490c94[_0x3d981c(0x172)]['listSegments'](_0x277fb6),{'verbose':_0x1d463a['verbose']}),withSpinner(_0x3d981c(0x1bf),()=>_0x490c94[_0x3d981c(0x172)][_0x3d981c(0x1b5)](_0x277fb6),{'verbose':_0x1d463a[_0x3d981c(0x13a)]}),withSpinner(_0x3d981c(0x17f),()=>_0x490c94[_0x3d981c(0x133)][_0x3d981c(0x15c)](_0x277fb6,{'includeAllVersions':!![]}),{'verbose':_0x1d463a[_0x3d981c(0x13a)]}),withSpinner(_0x3d981c(0x145),()=>_0x490c94['user'][_0x3d981c(0x1a4)](),{'verbose':_0x1d463a[_0x3d981c(0x13a)]})[_0x3d981c(0x14a)](_0x4d1e6c=>_0x4d1e6c['data'])]),_0x53b951=_0x59a614[_0x3d981c(0x189)],_0x9549c2=extractRootFolderId(_0x53b951),_0x4d59b4=_0x434b1c[_0x3d981c(0x189)],_0x2229e5=_0x30ea27[_0x3d981c(0x189)],{journeys:_0x3b0001,activationStepsById:_0x146edd}=_0x1a6733[_0x3d981c(0x189)],_0x1f60ea=new Map(_0x3b0001['map'](_0x3733df=>[_0x3733df['id'],_0x3733df])),_0x3e3db3=_0x3b0001[_0x3d981c(0x142)](_0x214545=>({'id':_0x214545['id'],'name':_0x214545[_0x3d981c(0x17a)]['name'],'journeyBundleName':_0x214545[_0x3d981c(0x17a)][_0x3d981c(0x169)]||'','journeyBundleId':_0x214545[_0x3d981c(0x17a)][_0x3d981c(0x15f)]||'','versionNumber':_0x214545[_0x3d981c(0x17a)][_0x3d981c(0x157)],'description':_0x214545[_0x3d981c(0x17a)][_0x3d981c(0x1b7)],'state':_0x214545['attributes'][_0x3d981c(0x1ca)],'paused':_0x214545[_0x3d981c(0x17a)]['paused'],'audienceId':_0x214545[_0x3d981c(0x17a)][_0x3d981c(0x16f)],'folderId':_0x214545[_0x3d981c(0x1c5)]?.[_0x3d981c(0x191)]?.[_0x3d981c(0x189)]?.['id'],'createdAt':_0x214545[_0x3d981c(0x17a)]['createdAt'],'updatedAt':_0x214545[_0x3d981c(0x17a)]['updatedAt']})),{emailToId:_0x2a2518,idToEmail:_0x48b1b5}=_0x46cab7,_0x184de6=await withSpinner('Fetching\x20connections\x20for\x20name\x20resolution...',async()=>{const _0x2c895b=_0x3d981c,_0xd503e9=await _0x490c94[_0x2c895b(0x1b0)][_0x2c895b(0x193)]();return buildConnectionMaps(_0xd503e9);},{'verbose':_0x1d463a[_0x3d981c(0x13a)]})[_0x3d981c(0x14a)](_0x5f55e6=>_0x5f55e6['data']),_0x35915d=_0x184de6['nameToId'],_0x37962e=_0x184de6[_0x3d981c(0x194)],_0xf66870=_0x184de6['nameToType'],_0x41292a={'emailToIdMap':_0x2a2518,'connectionNameToIdMap':_0x35915d,'connectionNameToTypeMap':_0xf66870,'getSchema':_0x173bbd=>_0x490c94[_0x3d981c(0x1b0)][_0x3d981c(0x137)](_0x173bbd)};let {pathToId:_0x4bc5d7,idToPath:_0x3a84d4}=buildFolderMaps(_0x2229e5);const _0x389cf6=buildSegmentLookupMap(_0x4d59b4,_0x3a84d4),_0x252f3c=buildSegmentNameToIdMap(_0x4d59b4),_0x22cb7d=buildJourneyBundleLookupMap(_0x3e3db3,_0x3a84d4);let _0x17831d;if(_0xf1d1d2){if(!_0xf1d1d2['endsWith'](_0x3d981c(0x1b1))&&!_0xf1d1d2[_0x3d981c(0x131)](_0x3d981c(0x173)))return console[_0x3d981c(0x18a)](a31_0x2cda6e[_0x3d981c(0x1a1)](_0x3d981c(0x14f)+_0xf1d1d2+'\x0a')),0x1;_0x17831d=[_0xf1d1d2];}else _0x17831d=findYamlFiles(_0x19ca64);if(_0x17831d[_0x3d981c(0x19a)]===0x0)return console[_0x3d981c(0x18a)](a31_0x2cda6e[_0x3d981c(0x1a1)](_0x3d981c(0x165)+_0x19ca64+'\x0a')),console['error'](a31_0x2cda6e['cyan'](_0x3d981c(0x1c9))),0x1;let _0x88d12a,_0x2b3463;try{const _0xa0c432=parseAndClassifyYamlFiles(_0x17831d,_0x19ca64,{'skipSegments':_0x1d463a[_0x3d981c(0x1b2)]});_0x88d12a=_0xa0c432[_0x3d981c(0x1b6)],_0x2b3463=_0xa0c432[_0x3d981c(0x134)];const _0xf0219=validateParsedFiles(_0xa0c432,_0x19ca64);if(_0xf0219[_0x3d981c(0x19a)]>0x0)return console[_0x3d981c(0x18a)](a31_0x2cda6e[_0x3d981c(0x1a1)](_0x3d981c(0x130))),console[_0x3d981c(0x18a)](formatValidationErrors(_0xf0219)),console[_0x3d981c(0x18a)](a31_0x2cda6e[_0x3d981c(0x1b4)](_0x3d981c(0x168))),0x1;}catch(_0x552cfc){return console[_0x3d981c(0x18a)](a31_0x2cda6e['red']('Error\x20parsing\x20YAML:\x20'+(_0x552cfc instanceof Error?_0x552cfc[_0x3d981c(0x18d)]:_0x552cfc))),0x1;}if(_0x88d12a[_0x3d981c(0x19a)]===0x0&&_0x2b3463[_0x3d981c(0x19a)]===0x0){const _0x2f2bb9=_0x1d463a[_0x3d981c(0x1b2)]?_0x3d981c(0x133):_0x3d981c(0x187);return console[_0x3d981c(0x18a)](a31_0x2cda6e[_0x3d981c(0x1b4)](_0x3d981c(0x181)+_0x2f2bb9+_0x3d981c(0x16b))),0x0;}const _0x2589aa=new Map();_0x4d59b4[_0x3d981c(0x19a)]>0x0&&!_0x1d463a['journeysOnly']&&await withSpinner(_0x3d981c(0x178),async()=>{await batchAsync(_0x4d59b4,async _0x28a6ad=>{const _0x57a48a=a31_0x36af,_0xb5d0d3=await _0x490c94[_0x57a48a(0x172)]['listActivations'](_0x277fb6,_0x28a6ad['id']);_0x2589aa[_0x57a48a(0x158)](_0x28a6ad['id'],_0xb5d0d3);});},{'verbose':_0x1d463a['verbose']});const {segmentFiles:_0x34aa01,foldersToCreate:_0x2e9412}=await prepareSegmentFiles(_0x88d12a,{'segmentByFolderAndName':_0x389cf6,'activationsBySegmentId':_0x2589aa,'folderPathToId':_0x4bc5d7,'idToEmailMap':_0x48b1b5,'connectionIdToNameMap':_0x37962e},_0x41292a,_0x4e9fb7,_0x5ae5bd),_0x5ccdc8=_0xf1d1d2?[]:findSegmentsToDelete(_0x4d59b4,_0x88d12a[_0x3d981c(0x142)](({yamlConfig:_0x3dcc5f,folderPath:_0x2ebb98})=>({'yamlConfig':_0x3dcc5f,'folderPath':resolveTDFolderPath(_0x2ebb98,_0x4e9fb7,_0x5ae5bd)})),_0x3a84d4,_0x5ae5bd,_0x4e9fb7),{journeyFiles:_0x3d55fe,foldersToCreate:_0x1b9f73}=await withProgressSpinner(_0x3d981c(0x14c),async _0x56636b=>prepareJourneyFiles(_0x2b3463,{'fetchJourney':async _0x41bcb8=>_0x490c94[_0x3d981c(0x133)][_0x3d981c(0x197)](_0x41bcb8[_0x3d981c(0x14b)]),'journeyBundlesByFolderAndName':_0x22cb7d,'folderPathToId':_0x4bc5d7,'idToEmailMap':_0x48b1b5,'connectionIdToNameMap':_0x37962e,'existingSegments':_0x4d59b4,'parentId':_0x277fb6,'deps':_0x490c94,'progress':{'update':_0x43fb54=>{const _0x3e66a7=_0x3d981c;_0x56636b[_0x3e66a7(0x18c)](_0x43fb54),_0x1d463a[_0x3e66a7(0x13a)]&&console[_0x3e66a7(0x18a)]('\x20\x20'+_0x43fb54);}},'journeyById':_0x1f60ea,'activationStepsById':_0x146edd},_0x4e9fb7,_0x5ae5bd),{'verbose':_0x1d463a[_0x3d981c(0x13a)]})[_0x3d981c(0x14a)](_0x11cd60=>_0x11cd60[_0x3d981c(0x189)]);for(const _0x12e0f2 of _0x1b9f73){_0x2e9412[_0x3d981c(0x1a2)](_0x12e0f2);}const _0x1aebd5=_0xf1d1d2?[]:findJourneysToDelete(_0x3e3db3,_0x2b3463[_0x3d981c(0x142)](({yamlConfig:_0x23d393,folderPath:_0x13673a})=>({'yamlConfig':_0x23d393,'folderPath':resolveTDFolderPath(_0x13673a,_0x4e9fb7,_0x5ae5bd)})),_0x3a84d4,_0x5ae5bd,_0x4e9fb7),_0x34fce3=calculatePushStats(_0x34aa01,_0x3d55fe,_0x2e9412,_0x5ccdc8,_0x1aebd5,!!_0x1d463a['delete'],!!_0x1d463a['journeysOnly']),_0x262735=_0x34fce3[_0x3d981c(0x1b6)][_0x3d981c(0x199)],_0x9787b7=_0x34fce3['segments']['changed'],_0x492b3e=_0x34fce3[_0x3d981c(0x1b6)]['unchanged'],_0xd35789=_0x34fce3[_0x3d981c(0x1b6)]['toDelete'],_0x1b0bde=_0x34fce3[_0x3d981c(0x1a6)][_0x3d981c(0x149)],_0x4199f5=_0x34fce3[_0x3d981c(0x134)]['new'],_0xe6756a=_0x34fce3[_0x3d981c(0x134)]['changed'],_0x36e264=_0x34fce3['journeys']['unchanged'],_0x197ae4=_0x34fce3['journeys'][_0x3d981c(0x138)],_0x1fa064=_0x34fce3[_0x3d981c(0x141)][_0x3d981c(0x14d)],_0x1645a2=_0x34fce3['activations'][_0x3d981c(0x149)],_0x3f519f=_0x34fce3['activations'][_0x3d981c(0x1aa)],_0x19950a=_0x34fce3['activations'][_0x3d981c(0x138)];console['error'](_0x3d981c(0x1c1)+_0x214f66+'\x27:');_0x1b0bde[_0x3d981c(0x19a)]>0x0&&console[_0x3d981c(0x18a)]('\x20\x20'+a31_0x2cda6e['blue'](_0x3d981c(0x188)+_0x1b0bde[_0x3d981c(0x19a)]+_0x3d981c(0x16d)));if(!_0x1d463a[_0x3d981c(0x1b2)]){console[_0x3d981c(0x18a)](_0x3d981c(0x1c3)),console[_0x3d981c(0x18a)](_0x3d981c(0x13f)+a31_0x2cda6e['green']('+\x20'+_0x262735[_0x3d981c(0x19a)]+_0x3d981c(0x15b))),console[_0x3d981c(0x18a)](_0x3d981c(0x13f)+a31_0x2cda6e[_0x3d981c(0x1b4)]('~\x20'+_0x9787b7[_0x3d981c(0x19a)]+_0x3d981c(0x147)));if(_0xd35789['length']>0x0)console[_0x3d981c(0x18a)](_0x3d981c(0x13f)+a31_0x2cda6e['red']('-\x20'+_0xd35789['length']+'\x20to\x20delete'));else _0x5ccdc8[_0x3d981c(0x19a)]>0x0&&!_0x1d463a[_0x3d981c(0x1c4)]&&console[_0x3d981c(0x18a)](_0x3d981c(0x13f)+a31_0x2cda6e['dim'](_0x5ccdc8[_0x3d981c(0x19a)]+'\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)'));console[_0x3d981c(0x18a)](_0x3d981c(0x13f)+a31_0x2cda6e[_0x3d981c(0x1c7)]('=\x20'+_0x492b3e['length']+_0x3d981c(0x13b)));}if(_0x3d55fe[_0x3d981c(0x19a)]>0x0||_0x1aebd5[_0x3d981c(0x19a)]>0x0){console[_0x3d981c(0x18a)](_0x3d981c(0x150)),console[_0x3d981c(0x18a)]('\x20\x20\x20\x20'+a31_0x2cda6e[_0x3d981c(0x1ad)]('+\x20'+_0x4199f5[_0x3d981c(0x19a)]+_0x3d981c(0x15b))),console['error'](_0x3d981c(0x13f)+a31_0x2cda6e[_0x3d981c(0x1b4)]('~\x20'+_0xe6756a['length']+_0x3d981c(0x147)));if(_0x197ae4[_0x3d981c(0x19a)]>0x0)console[_0x3d981c(0x18a)](_0x3d981c(0x13f)+a31_0x2cda6e[_0x3d981c(0x1a1)]('-\x20'+_0x197ae4['length']+'\x20to\x20delete'));else _0x1aebd5['length']>0x0&&!_0x1d463a[_0x3d981c(0x1c4)]&&console[_0x3d981c(0x18a)](_0x3d981c(0x13f)+a31_0x2cda6e[_0x3d981c(0x1c7)](_0x1aebd5[_0x3d981c(0x19a)]+'\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)'));console[_0x3d981c(0x18a)](_0x3d981c(0x13f)+a31_0x2cda6e[_0x3d981c(0x1c7)]('=\x20'+_0x36e264[_0x3d981c(0x19a)]+_0x3d981c(0x13b)));}_0x1fa064[_0x3d981c(0x19a)]>0x0&&!_0x1d463a[_0x3d981c(0x1b2)]&&(console[_0x3d981c(0x18a)](''),console[_0x3d981c(0x18a)]('\x20\x20Activations:'),_0x1645a2['length']>0x0&&console[_0x3d981c(0x18a)](_0x3d981c(0x13f)+a31_0x2cda6e[_0x3d981c(0x1ad)]('+\x20'+_0x1645a2['length']+_0x3d981c(0x155))),_0x3f519f[_0x3d981c(0x19a)]>0x0&&console[_0x3d981c(0x18a)](_0x3d981c(0x13f)+a31_0x2cda6e[_0x3d981c(0x1b4)]('~\x20'+_0x3f519f[_0x3d981c(0x19a)]+_0x3d981c(0x15e))),_0x19950a[_0x3d981c(0x19a)]>0x0&&console[_0x3d981c(0x18a)](_0x3d981c(0x13f)+a31_0x2cda6e['red']('-\x20'+_0x19950a[_0x3d981c(0x19a)]+_0x3d981c(0x1c8))));console[_0x3d981c(0x18a)](_0x3d981c(0x17c)+a31_0x2cda6e[_0x3d981c(0x1b9)](_0x19ca64)+'\x0a');if(_0x1b0bde[_0x3d981c(0x19a)]>0x0){console[_0x3d981c(0x18a)]('Folders\x20to\x20create:');for(const _0x156569 of _0x1b0bde){console[_0x3d981c(0x18a)]('\x20\x20'+a31_0x2cda6e[_0x3d981c(0x1cc)]('+')+'\x20'+_0x156569);}console[_0x3d981c(0x18a)]('');}if(_0x262735[_0x3d981c(0x19a)]>0x0&&!_0x1d463a[_0x3d981c(0x1b2)])for(const _0x32980a of _0x262735){const _0x518a26=_0x32980a[_0x3d981c(0x17d)]?_0x32980a[_0x3d981c(0x17d)]+'/'+_0x32980a[_0x3d981c(0x13e)]['name']:_0x32980a['yamlConfig'][_0x3d981c(0x1ba)],_0x54212c=_0x32980a[_0x3d981c(0x13e)][_0x3d981c(0x141)]?.[_0x3d981c(0x19a)]||0x0,_0x136545=_0x54212c>0x0?a31_0x2cda6e[_0x3d981c(0x1c7)]('\x20['+_0x54212c+_0x3d981c(0x170)):'';console['error']('\x0a'+a31_0x2cda6e[_0x3d981c(0x1ad)](_0x3d981c(0x1ce))+'\x20'+_0x518a26+_0x136545),console['error']('─'['repeat'](0x3c)),_0x32980a[_0x3d981c(0x198)]&&console[_0x3d981c(0x18a)](_0x32980a['diff']),console['error']('─'[_0x3d981c(0x1bd)](0x3c));}if(_0xd35789[_0x3d981c(0x19a)]>0x0&&!_0x1d463a[_0x3d981c(0x1b2)])for(const _0x4d3324 of _0xd35789){const _0x35b411=_0x4d3324[_0x3d981c(0x1cb)]?_0x3a84d4['get'](_0x4d3324['segmentFolderId'][_0x3d981c(0x19e)]())||'':'',_0x55f886=_0x35b411?_0x35b411+'/'+_0x4d3324[_0x3d981c(0x1ba)]:_0x4d3324['name'],_0x5c2c81=_0x2589aa['get'](_0x4d3324['id'])||[],_0x2c551d=_0x5c2c81[_0x3d981c(0x19a)]>0x0?a31_0x2cda6e[_0x3d981c(0x1c7)]('\x20['+_0x5c2c81[_0x3d981c(0x19a)]+'\x20activations]'):'';console[_0x3d981c(0x18a)]('\x0a'+a31_0x2cda6e[_0x3d981c(0x1a1)](_0x3d981c(0x153))+'\x20'+_0x55f886+_0x2c551d),console[_0x3d981c(0x18a)]('─'[_0x3d981c(0x1bd)](0x3c));const _0x46bd92=segmentWithActivationsToYaml(_0x4d3324,_0x5c2c81,undefined,_0x48b1b5,_0x37962e),_0x41c788=segmentToYamlString(_0x46bd92),_0x1e1dd7=generateDiff(_0x41c788,'');console[_0x3d981c(0x18a)](formatDiffWithColors(_0x1e1dd7)),console[_0x3d981c(0x18a)]('─'[_0x3d981c(0x1bd)](0x3c));}const _0x2e432b=_0x34aa01[_0x3d981c(0x156)](_0x1db990=>!_0x1db990['isNew']&&_0x1db990[_0x3d981c(0x198)]);if(_0x2e432b[_0x3d981c(0x19a)]>0x0&&!_0x1d463a['journeysOnly'])for(const _0x26c49c of _0x2e432b){const _0x560383=_0x26c49c['folderPath']?_0x26c49c['folderPath']+'/'+_0x26c49c['yamlConfig'][_0x3d981c(0x1ba)]:_0x26c49c[_0x3d981c(0x13e)][_0x3d981c(0x1ba)];console[_0x3d981c(0x18a)]('\x0a'+a31_0x2cda6e[_0x3d981c(0x1b4)](_0x3d981c(0x143))+'\x20'+_0x560383),console[_0x3d981c(0x18a)]('─'[_0x3d981c(0x1bd)](0x3c)),console['error'](_0x26c49c[_0x3d981c(0x198)]),console[_0x3d981c(0x18a)]('─'[_0x3d981c(0x1bd)](0x3c));}if(_0x4199f5[_0x3d981c(0x19a)]>0x0)for(const _0x48d31b of _0x4199f5){const _0xc210bf=_0x48d31b[_0x3d981c(0x17d)]?_0x48d31b[_0x3d981c(0x17d)]+'/'+_0x48d31b['yamlConfig']['name']:_0x48d31b['yamlConfig'][_0x3d981c(0x1ba)];console[_0x3d981c(0x18a)]('\x0a'+a31_0x2cda6e[_0x3d981c(0x1ad)](_0x3d981c(0x146))+'\x20'+_0xc210bf),console[_0x3d981c(0x18a)]('─'[_0x3d981c(0x1bd)](0x3c)),_0x48d31b['diff']&&console[_0x3d981c(0x18a)](_0x48d31b[_0x3d981c(0x198)]),console['error']('─'[_0x3d981c(0x1bd)](0x3c));}const _0x13cc6c=_0x3d55fe['filter'](_0xdc7af2=>!_0xdc7af2[_0x3d981c(0x171)]&&_0xdc7af2[_0x3d981c(0x198)]);if(_0x13cc6c[_0x3d981c(0x19a)]>0x0)for(const _0x56af26 of _0x13cc6c){const _0x313eca=_0x56af26[_0x3d981c(0x17d)]?_0x56af26[_0x3d981c(0x17d)]+'/'+_0x56af26['yamlConfig'][_0x3d981c(0x1ba)]:_0x56af26[_0x3d981c(0x13e)][_0x3d981c(0x1ba)];console[_0x3d981c(0x18a)]('\x0a'+a31_0x2cda6e[_0x3d981c(0x1b4)](_0x3d981c(0x16c))+'\x20'+_0x313eca),console[_0x3d981c(0x18a)]('─'[_0x3d981c(0x1bd)](0x3c)),console[_0x3d981c(0x18a)](_0x56af26['diff']),console[_0x3d981c(0x18a)]('─'[_0x3d981c(0x1bd)](0x3c));}if(_0x197ae4[_0x3d981c(0x19a)]>0x0)for(const _0x13e8d9 of _0x197ae4){const _0x842a07=_0x13e8d9[_0x3d981c(0x179)]?_0x3a84d4[_0x3d981c(0x1a9)](_0x13e8d9['folderId'])||'':'',_0x42a9d9=_0x842a07?_0x842a07+'/'+_0x13e8d9['journeyBundleName']:_0x13e8d9[_0x3d981c(0x169)];console[_0x3d981c(0x18a)]('\x0a'+a31_0x2cda6e[_0x3d981c(0x1a1)]('Delete\x20journey:')+'\x20'+_0x42a9d9),console[_0x3d981c(0x18a)]('─'['repeat'](0x3c)),console[_0x3d981c(0x18a)](a31_0x2cda6e[_0x3d981c(0x1a1)](_0x3d981c(0x1af))),console[_0x3d981c(0x18a)]('─'[_0x3d981c(0x1bd)](0x3c));}if(_0x1d463a[_0x3d981c(0x1ae)])return console[_0x3d981c(0x18a)](a31_0x2cda6e[_0x3d981c(0x1b4)](_0x3d981c(0x166))),0x0;const _0x4ed55a=_0x1d463a[_0x3d981c(0x1b2)]?![]:_0x262735[_0x3d981c(0x19a)]>0x0||_0x9787b7[_0x3d981c(0x19a)]>0x0||_0xd35789[_0x3d981c(0x19a)]>0x0,_0x5b78a8=_0x4199f5['length']>0x0||_0xe6756a[_0x3d981c(0x19a)]>0x0||_0x197ae4[_0x3d981c(0x19a)]>0x0,_0x491c0a=_0x1d463a[_0x3d981c(0x1b2)]?![]:_0x1fa064[_0x3d981c(0x19a)]>0x0,_0xb54366=_0x1b0bde[_0x3d981c(0x19a)]>0x0;if(!_0x4ed55a&&!_0x5b78a8&&!_0x491c0a&&!_0xb54366){const _0x4a7bc9=_0x1d463a[_0x3d981c(0x1b2)]?_0x3d981c(0x1c0):_0x3d981c(0x1bc);console[_0x3d981c(0x18a)](a31_0x2cda6e[_0x3d981c(0x1ad)](_0x4a7bc9));if(_0xf1d1d2&&_0x36e264[_0x3d981c(0x19a)]===0x1){const _0xd7f290=_0x36e264[0x0];if(_0xd7f290[_0x3d981c(0x177)]?.['id']){const _0xbf524=getConsoleNextUrl(_0x1d463a[_0x3d981c(0x144)],_0x3d981c(0x15a)+_0x277fb6+_0x3d981c(0x1b3)+_0xd7f290[_0x3d981c(0x177)]['id']+_0x3d981c(0x1a0));console['error']('\x20\x20'+a31_0x2cda6e[_0x3d981c(0x1b9)](_0xbf524));}}return 0x0;}const _0x4dfce3=_0x1d463a[_0x3d981c(0x1b2)]?_0x4199f5['length']+_0xe6756a[_0x3d981c(0x19a)]+_0x197ae4[_0x3d981c(0x19a)]+_0x1b0bde[_0x3d981c(0x19a)]:_0x262735[_0x3d981c(0x19a)]+_0x9787b7[_0x3d981c(0x19a)]+_0xd35789[_0x3d981c(0x19a)]+_0x4199f5['length']+_0xe6756a[_0x3d981c(0x19a)]+_0x197ae4[_0x3d981c(0x19a)]+_0x1b0bde[_0x3d981c(0x19a)]+_0x1fa064[_0x3d981c(0x19a)];if(!_0x1d463a[_0x3d981c(0x1ab)]&&_0x4dfce3>0x0){const _0x8fe338=await confirmKey(_0x3d981c(0x1c2)+_0x4dfce3+_0x3d981c(0x17b));if(!_0x8fe338)return console['error'](_0x3d981c(0x163)),0x1;}const _0x9c7dcc={'withProgress':async(_0x1d0e27,_0x2c1d35)=>{const _0x933f4=_0x3d981c,_0x338197=await withSpinner(_0x1d0e27,_0x2c1d35,{'verbose':_0x1d463a[_0x933f4(0x13a)]});return{'data':_0x338197[_0x933f4(0x189)]};},'logInfo':_0x31128b=>console[_0x3d981c(0x18a)](a31_0x2cda6e['blue']('✔\x20'+_0x31128b)),'logSuccess':_0x214c37=>console[_0x3d981c(0x18a)](a31_0x2cda6e[_0x3d981c(0x1ad)]('✔\x20'+_0x214c37)),'logWarning':_0x16ba7e=>console[_0x3d981c(0x18a)](a31_0x2cda6e[_0x3d981c(0x1b4)]('⚠\x20'+_0x16ba7e)),'logDeleted':_0x1a7536=>console[_0x3d981c(0x18a)](a31_0x2cda6e[_0x3d981c(0x1a1)]('✔\x20'+_0x1a7536))},_0x12fa25={'segment':_0x490c94['segment'],'journey':_0x490c94[_0x3d981c(0x133)],'user':_0x490c94['user'],'connection':_0x490c94[_0x3d981c(0x1b0)]};_0x1b0bde[_0x3d981c(0x19a)]>0x0&&(_0x4bc5d7=await executePushFolders(_0x12fa25,_0x1b0bde,_0x4bc5d7,{'parentId':_0x277fb6},_0x9c7dcc));const _0x11fda6={'rootFolderId':_0x9549c2,'folderPathToId':_0x4bc5d7,'folderIdToPath':_0x3a84d4,'segmentNameToId':_0x252f3c,'activationsBySegmentId':_0x2589aa,'emailToIdMap':_0x2a2518,'idToEmailMap':_0x48b1b5,'connectionNameToIdMap':_0x184de6[_0x3d981c(0x151)],'connectionIdToNameMap':_0x184de6[_0x3d981c(0x194)],'connectionNameToTypeMap':_0xf66870},_0x1fce7a=await executePushSegments(_0x12fa25,_0x1d463a[_0x3d981c(0x1b2)]?[]:_0x34aa01,_0x11fda6,{'parentId':_0x277fb6},_0x9c7dcc),_0x18a911=_0x1fce7a[_0x3d981c(0x1b8)],_0x3d3909=_0x1fce7a['updated'],_0x37164c=_0x1fce7a[_0x3d981c(0x141)]['created'],_0x4cb91e=_0x1fce7a[_0x3d981c(0x141)][_0x3d981c(0x164)],_0x3f3e67=_0x1fce7a[_0x3d981c(0x141)][_0x3d981c(0x18e)],_0x2ad8f6=await executePushSegmentDeletions(_0x12fa25,_0x1d463a[_0x3d981c(0x1b2)]?[]:_0xd35789,_0x9c7dcc);let _0x4c2f2a=0x0,_0x5c847f=0x0,_0x275cbe=0x0;const _0x190687=new Map(_0x252f3c);for(const [_0x2fcc68,_0x4880d0]of _0x1fce7a[_0x3d981c(0x18b)]){_0x190687[_0x3d981c(0x158)](_0x2fcc68,_0x4880d0);}if(_0x3d55fe[_0x3d981c(0x19a)]>0x0){const _0x229deb={..._0x11fda6,'segmentNameToId':_0x190687,'existingSegments':_0x4d59b4,'activationContext':_0x41292a},_0x15b9fe=await executePushJourneys(_0x12fa25,_0x3d55fe,_0x229deb,{'parentId':_0x277fb6,'rootFolderId':_0x9549c2,'verbose':_0x1d463a['verbose']},_0x9c7dcc);_0x4c2f2a=_0x15b9fe[_0x3d981c(0x1b8)],_0x5c847f=_0x15b9fe['updated'];if(_0xf1d1d2&&_0x15b9fe[_0x3d981c(0x159)][_0x3d981c(0x19a)]===0x1){const _0x2b33f0=_0x15b9fe['results'][0x0];if(_0x2b33f0[_0x3d981c(0x14b)]){const _0x1cc975=getConsoleNextUrl(_0x1d463a[_0x3d981c(0x144)],'/app/ps/'+_0x277fb6+_0x3d981c(0x1b3)+_0x2b33f0[_0x3d981c(0x14b)]+_0x3d981c(0x1a0));console['error']('\x20\x20'+a31_0x2cda6e[_0x3d981c(0x1b9)](_0x1cc975));}}}for(const _0x37d2ee of _0x197ae4){console[_0x3d981c(0x18a)](a31_0x2cda6e[_0x3d981c(0x1b4)](_0x3d981c(0x1be)+_0x37d2ee[_0x3d981c(0x169)])),_0x275cbe++;}const _0x47f6fc=[];if(_0x18a911>0x0)_0x47f6fc[_0x3d981c(0x176)](_0x18a911+'\x20created');if(_0x3d3909>0x0)_0x47f6fc[_0x3d981c(0x176)](_0x3d3909+_0x3d981c(0x167));if(_0x2ad8f6>0x0)_0x47f6fc[_0x3d981c(0x176)](_0x2ad8f6+_0x3d981c(0x1a5));const _0x18dcfe=[];if(_0x4c2f2a>0x0)_0x18dcfe['push'](_0x4c2f2a+'\x20created');if(_0x5c847f>0x0)_0x18dcfe[_0x3d981c(0x176)](_0x5c847f+_0x3d981c(0x167));if(_0x275cbe>0x0)_0x18dcfe[_0x3d981c(0x176)](_0x275cbe+_0x3d981c(0x1a5));const _0x98d9b=[];if(_0x37164c>0x0)_0x98d9b[_0x3d981c(0x176)](_0x37164c+'\x20created');if(_0x4cb91e>0x0)_0x98d9b[_0x3d981c(0x176)](_0x4cb91e+_0x3d981c(0x167));if(_0x3f3e67>0x0)_0x98d9b['push'](_0x3f3e67+'\x20deleted');return console['error'](a31_0x2cda6e[_0x3d981c(0x1ad)](_0x3d981c(0x140))),_0x47f6fc['length']>0x0&&!_0x1d463a[_0x3d981c(0x1b2)]&&console[_0x3d981c(0x18a)](_0x3d981c(0x136)+_0x47f6fc[_0x3d981c(0x185)](',\x20')),_0x18dcfe['length']>0x0&&console[_0x3d981c(0x18a)]('\x20\x20Journeys:\x20'+_0x18dcfe['join'](',\x20')),_0x98d9b['length']>0x0&&!_0x1d463a[_0x3d981c(0x1b2)]&&console[_0x3d981c(0x18a)](_0x3d981c(0x195)+_0x98d9b[_0x3d981c(0x185)](',\x20')),0x0;}}
1
+ const a31_0x354a77=a31_0x53da;(function(_0x157e6f,_0x18fafa){const _0x2f2d52=a31_0x53da,_0x41f706=_0x157e6f();while(!![]){try{const _0x25ea8b=-parseInt(_0x2f2d52(0x101))/0x1+-parseInt(_0x2f2d52(0x177))/0x2+parseInt(_0x2f2d52(0x118))/0x3*(parseInt(_0x2f2d52(0x16c))/0x4)+-parseInt(_0x2f2d52(0x129))/0x5*(parseInt(_0x2f2d52(0x142))/0x6)+-parseInt(_0x2f2d52(0x137))/0x7+parseInt(_0x2f2d52(0x123))/0x8*(-parseInt(_0x2f2d52(0x14e))/0x9)+parseInt(_0x2f2d52(0x16a))/0xa;if(_0x25ea8b===_0x18fafa)break;else _0x41f706['push'](_0x41f706['shift']());}catch(_0x102e00){_0x41f706['push'](_0x41f706['shift']());}}}(a31_0x13eb,0x25588));import{BaseCommand}from'./command.js';function a31_0x53da(_0x3b6a38,_0x3bd4b6){_0x3b6a38=_0x3b6a38-0xef;const _0x13eb24=a31_0x13eb();let _0x53da0f=_0x13eb24[_0x3b6a38];return _0x53da0f;}import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{generateDiff,formatDiffWithColors}from'../utils/diff.js';import{confirmKey}from'../utils/prompt.js';import{batchAsync}from'../utils/async.js';import{segmentToYamlString,segmentWithActivationsToYaml}from'../sdk/segment/child-segment-yaml.js';import a31_0x48e3f1 from'chalk';import{existsSync}from'fs';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{resolveTarget,isSuccessfulResolution,getScopedDetails}from'../sdk/segment/target-resolution.js';function a31_0x13eb(){const _0x4c82c1=['Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','journeyBundleId','dryRun','no_parent','filter','get','Error\x20parsing\x20YAML:\x20','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','232080ZakRDQ','New\x20journey:','unchanged','nameToType','targetDir','segmentFolderId','buildUserMaps','red','length','\x20\x20\x20\x20','results','nameToId','user','parent_name','activations','\x20activations]','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','file','diff','updatedAt','getOutputSchemaWithCache','📁\x20','yamlConfig','endsWith','verbose','delete','New\x20segment:','Site:\x20','errorCode','No\x20','\x20new','then','yellow','folderPath','51388ErAEDk','audienceId','data','\x20\x20Activations:','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)','execute','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','description','\x20to\x20create','/e/','createdSegmentIds','join','connection','segment','folders','idToName','\x20\x20🗺️\x20\x20Journeys:','\x20changes?','\x0aPush\x20summary\x20for\x20\x27','journeys','\x20deleted','journeyBundleName','38697atDFTm','toDelete','repeat','Push\x20','add','Fetching\x20existing\x20activations...','cyan','toString','\x20created','Preparing\x20journeys...','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','104NrIdzt','push','\x20to\x20delete','Scoped\x20to\x20folder:\x20','Fetching\x20existing\x20segments...','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','60140MpSvSQ','created','parentSegment','\x20updated','/j/da/je','\x20unchanged','toUpdate','type','scopedFolderPath','site','Source\x20directory:\x20','listJourneysWithDetailsFromParentSegment','folderId','\x20\x20Activations:\x20','1262842rBcAyI','(Journey\x20will\x20be\x20deleted)','listFolders','.yml','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','Fetching\x20existing\x20journeys...','error','segments','paused','setPhase','isScoped','90bgezwg','green','cwd','existingJourney','set','\x0a✔\x20Push\x20complete','parentFolder','journeysOnly','parentName','\x0aValidation\x20failed:','Delete\x20journey:','relationships','21033VBonsE','map','Parent\x20segment:\x20','\x27...','resolveParentId','Folders\x20to\x20create:','name','attributes','/app/ps/','getParent','Fetching\x20users\x20for\x20email\x20resolution...','dim','✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','\x20\x20Journeys:\x20','journey','message','updated','toCreate','\x20\x20Source:\x20','all','Error:\x20','isNew','versionNumber','helpText','Resolving\x20parent\x20segment\x20\x27','getJourney','blue','journeyId','4923200OiVZuS','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','68hpnSvT','Error:\x20Directory\x20not\x20found:\x20','segment:push'];a31_0x13eb=function(){return _0x4c82c1;};return a31_0x13eb();}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{[a31_0x354a77(0x154)]=a31_0x354a77(0x16e);[a31_0x354a77(0x109)]=a31_0x354a77(0xef);async[a31_0x354a77(0x106)](_0x4d4294){const _0x293e83=a31_0x354a77,{options:_0x1d192c,args:_0x3cef83,tdx:_0x59818d}=_0x4d4294,_0x335f4b=_0x1d192c,_0x25a98b=await resolveTarget({'arg':_0x3cef83[0x0],'contextParent':_0x1d192c[_0x293e83(0x12b)],'cwd':process[_0x293e83(0x144)]()});if(!isSuccessfulResolution(_0x25a98b))return _0x25a98b[_0x293e83(0xfb)]===_0x293e83(0x172)?(console[_0x293e83(0x13d)](a31_0x48e3f1[_0x293e83(0xff)](_0x293e83(0x176))),console[_0x293e83(0x13d)](_0x293e83(0x105)),console['error'](_0x293e83(0x128)),console['error']('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file')):(console['error'](a31_0x48e3f1[_0x293e83(0x17e)](_0x293e83(0x162)+_0x25a98b[_0x293e83(0x15d)]+'\x0a')),_0x25a98b['helpText']&&console[_0x293e83(0x13d)](a31_0x48e3f1[_0x293e83(0x11e)](_0x25a98b[_0x293e83(0x165)]))),0x1;if(_0x25a98b[_0x293e83(0x130)]===_0x293e83(0x184))return console[_0x293e83(0x13d)](a31_0x48e3f1[_0x293e83(0x17e)](_0x293e83(0x16d)+_0x25a98b[_0x293e83(0x17b)]+'\x0a')),console[_0x293e83(0x13d)](a31_0x48e3f1[_0x293e83(0x11e)](_0x293e83(0x13b))),0x1;const _0x148afe=_0x25a98b[_0x293e83(0x14a)],_0x5c509c=_0x25a98b[_0x293e83(0x17b)],_0x3a8ee8=_0x25a98b[_0x293e83(0x130)]===_0x293e83(0xf0)?_0x25a98b['filePath']:undefined,_0x1cdbaf=getScopedDetails(_0x25a98b),_0x10e279=_0x1cdbaf?.[_0x293e83(0x141)]??![],_0x5549e3=_0x1cdbaf?.[_0x293e83(0x131)]??'';if(!existsSync(_0x5c509c))return console['error'](a31_0x48e3f1[_0x293e83(0x17e)]('Error:\x20Directory\x20not\x20found:\x20'+_0x5c509c+'\x0a')),console[_0x293e83(0x13d)](a31_0x48e3f1[_0x293e83(0x11e)](_0x293e83(0x13b))),0x1;_0x335f4b['verbose']&&(console['error'](_0x293e83(0xfa)+_0x335f4b['site']),console[_0x293e83(0x13d)](_0x293e83(0x150)+_0x148afe),console[_0x293e83(0x13d)](_0x293e83(0x133)+_0x5c509c),_0x10e279&&console[_0x293e83(0x13d)](_0x293e83(0x126)+_0x5549e3));const _0x19ef03=await withSpinner(_0x293e83(0x166)+_0x148afe+_0x293e83(0x151),()=>_0x59818d[_0x293e83(0x10f)][_0x293e83(0x152)](_0x148afe),{'verbose':_0x335f4b[_0x293e83(0xf7)]}),_0x43e40c=_0x19ef03['data'],[_0x4c499d,_0x11a645,_0x3cd4f2,_0x22a8f2,_0x223271]=await Promise[_0x293e83(0x161)]([withSpinner('Fetching\x20parent\x20segment\x20details...',()=>_0x59818d['segment'][_0x293e83(0x157)](_0x43e40c),{'verbose':_0x335f4b[_0x293e83(0xf7)]}),withSpinner(_0x293e83(0x127),()=>_0x59818d[_0x293e83(0x10f)]['listSegments'](_0x43e40c),{'verbose':_0x335f4b[_0x293e83(0xf7)]}),withSpinner('Fetching\x20existing\x20folders...',()=>_0x59818d[_0x293e83(0x10f)][_0x293e83(0x139)](_0x43e40c),{'verbose':_0x335f4b['verbose']}),withSpinner(_0x293e83(0x13c),()=>_0x59818d[_0x293e83(0x15c)][_0x293e83(0x134)](_0x43e40c,{'includeAllVersions':!![]}),{'verbose':_0x335f4b[_0x293e83(0xf7)]}),withSpinner(_0x293e83(0x158),()=>_0x59818d[_0x293e83(0x183)][_0x293e83(0x17d)](),{'verbose':_0x335f4b['verbose']})['then'](_0x7b0799=>_0x7b0799[_0x293e83(0x103)])]),_0x595ebd=_0x4c499d[_0x293e83(0x103)],_0x224261=extractRootFolderId(_0x595ebd),_0x5093e7=_0x11a645['data'],_0x2b2989=_0x3cd4f2[_0x293e83(0x103)],{journeys:_0x1408fa,activationStepsById:_0x4c92ae}=_0x22a8f2[_0x293e83(0x103)],_0x1f35ee=new Map(_0x1408fa['map'](_0x291923=>[_0x291923['id'],_0x291923])),_0x5edbb7=_0x1408fa[_0x293e83(0x14f)](_0x164792=>({'id':_0x164792['id'],'name':_0x164792[_0x293e83(0x155)][_0x293e83(0x154)],'journeyBundleName':_0x164792['attributes']['journeyBundleName']||'','journeyBundleId':_0x164792[_0x293e83(0x155)][_0x293e83(0x170)]||'','versionNumber':_0x164792[_0x293e83(0x155)][_0x293e83(0x164)],'description':_0x164792[_0x293e83(0x155)][_0x293e83(0x109)],'state':_0x164792['attributes']['state'],'paused':_0x164792['attributes'][_0x293e83(0x13f)],'audienceId':_0x164792[_0x293e83(0x155)][_0x293e83(0x102)],'folderId':_0x164792[_0x293e83(0x14d)]?.[_0x293e83(0x148)]?.[_0x293e83(0x103)]?.['id'],'createdAt':_0x164792['attributes']['createdAt'],'updatedAt':_0x164792[_0x293e83(0x155)][_0x293e83(0xf2)]})),{emailToId:_0x2c702a,idToEmail:_0x2aa706}=_0x223271,_0x5749c6=await withSpinner('Fetching\x20connections\x20for\x20name\x20resolution...',async()=>{const _0x5494ef=_0x293e83,_0x233056=await _0x59818d[_0x5494ef(0x10e)]['list']();return buildConnectionMaps(_0x233056);},{'verbose':_0x335f4b['verbose']})[_0x293e83(0xfe)](_0x15a582=>_0x15a582[_0x293e83(0x103)]),_0x9910f=_0x5749c6[_0x293e83(0x182)],_0x58dc40=_0x5749c6[_0x293e83(0x111)],_0x32e6fb=_0x5749c6[_0x293e83(0x17a)],_0x3d5973={'emailToIdMap':_0x2c702a,'connectionNameToIdMap':_0x9910f,'connectionNameToTypeMap':_0x32e6fb,'getSchema':_0x23e95f=>_0x59818d[_0x293e83(0x10e)][_0x293e83(0xf3)](_0x23e95f)};let {pathToId:_0x4930d0,idToPath:_0x25d9b1}=buildFolderMaps(_0x2b2989);const _0x2daf12=buildSegmentLookupMap(_0x5093e7,_0x25d9b1),_0x4314de=buildSegmentNameToIdMap(_0x5093e7),_0x45f931=buildJourneyBundleLookupMap(_0x5edbb7,_0x25d9b1);let _0xf1bdb4;if(_0x3a8ee8){if(!_0x3a8ee8['endsWith'](_0x293e83(0x13a))&&!_0x3a8ee8[_0x293e83(0xf6)]('.yaml'))return console[_0x293e83(0x13d)](a31_0x48e3f1[_0x293e83(0x17e)](_0x293e83(0x107)+_0x3a8ee8+'\x0a')),0x1;_0xf1bdb4=[_0x3a8ee8];}else _0xf1bdb4=findYamlFiles(_0x5c509c);if(_0xf1bdb4[_0x293e83(0x17f)]===0x0)return console[_0x293e83(0x13d)](a31_0x48e3f1[_0x293e83(0x17e)](_0x293e83(0x122)+_0x5c509c+'\x0a')),console[_0x293e83(0x13d)](a31_0x48e3f1[_0x293e83(0x11e)](_0x293e83(0x16f))),0x1;let _0x438692,_0x120fd9;try{const _0x2bcb38=parseAndClassifyYamlFiles(_0xf1bdb4,_0x5c509c,{'skipSegments':_0x335f4b[_0x293e83(0x149)]});_0x438692=_0x2bcb38[_0x293e83(0x13e)],_0x120fd9=_0x2bcb38[_0x293e83(0x115)];const _0x2a21ab=validateParsedFiles(_0x2bcb38,_0x5c509c);if(_0x2a21ab[_0x293e83(0x17f)]>0x0)return console[_0x293e83(0x13d)](a31_0x48e3f1[_0x293e83(0x17e)](_0x293e83(0x14b))),console[_0x293e83(0x13d)](formatValidationErrors(_0x2a21ab)),console['error'](a31_0x48e3f1['yellow'](_0x293e83(0x108))),0x1;}catch(_0x3235d2){return console[_0x293e83(0x13d)](a31_0x48e3f1[_0x293e83(0x17e)](_0x293e83(0x175)+(_0x3235d2 instanceof Error?_0x3235d2[_0x293e83(0x15d)]:_0x3235d2))),0x1;}if(_0x438692['length']===0x0&&_0x120fd9[_0x293e83(0x17f)]===0x0){const _0x13eb9d=_0x335f4b[_0x293e83(0x149)]?_0x293e83(0x15c):'segment\x20or\x20journey';return console[_0x293e83(0x13d)](a31_0x48e3f1[_0x293e83(0xff)](_0x293e83(0xfc)+_0x13eb9d+'\x20YAML\x20files\x20found')),0x0;}const _0x3aa86c=new Map();_0x5093e7[_0x293e83(0x17f)]>0x0&&!_0x335f4b[_0x293e83(0x149)]&&await withSpinner(_0x293e83(0x11d),async()=>{await batchAsync(_0x5093e7,async _0x54fae7=>{const _0x36ad65=a31_0x53da,_0x370eea=await _0x59818d['segment']['listActivations'](_0x43e40c,_0x54fae7['id']);_0x3aa86c[_0x36ad65(0x146)](_0x54fae7['id'],_0x370eea);});},{'verbose':_0x335f4b[_0x293e83(0xf7)]});const {segmentFiles:_0xfe6b94,foldersToCreate:_0x59b504}=await prepareSegmentFiles(_0x438692,{'segmentByFolderAndName':_0x2daf12,'activationsBySegmentId':_0x3aa86c,'folderPathToId':_0x4930d0,'idToEmailMap':_0x2aa706,'connectionIdToNameMap':_0x58dc40},_0x3d5973,_0x10e279,_0x5549e3),_0x4c8b46=_0x3a8ee8?[]:findSegmentsToDelete(_0x5093e7,_0x438692[_0x293e83(0x14f)](({yamlConfig:_0x116e54,folderPath:_0x18e4cd})=>({'yamlConfig':_0x116e54,'folderPath':resolveTDFolderPath(_0x18e4cd,_0x10e279,_0x5549e3)})),_0x25d9b1,_0x5549e3,_0x10e279),{journeyFiles:_0x269da6,foldersToCreate:_0x3a7e5b}=await withProgressSpinner(_0x293e83(0x121),async _0x4213c5=>prepareJourneyFiles(_0x120fd9,{'fetchJourney':async _0xea9d41=>_0x59818d[_0x293e83(0x15c)][_0x293e83(0x167)](_0xea9d41[_0x293e83(0x169)]),'journeyBundlesByFolderAndName':_0x45f931,'folderPathToId':_0x4930d0,'idToEmailMap':_0x2aa706,'connectionIdToNameMap':_0x58dc40,'existingSegments':_0x5093e7,'parentId':_0x43e40c,'deps':_0x59818d,'progress':{'update':_0x56b52b=>{const _0x34a91a=_0x293e83;_0x4213c5[_0x34a91a(0x140)](_0x56b52b),_0x335f4b[_0x34a91a(0xf7)]&&console[_0x34a91a(0x13d)]('\x20\x20'+_0x56b52b);}},'journeyById':_0x1f35ee,'activationStepsById':_0x4c92ae},_0x10e279,_0x5549e3),{'verbose':_0x335f4b['verbose']})[_0x293e83(0xfe)](_0xf391fa=>_0xf391fa[_0x293e83(0x103)]);for(const _0x31cbe0 of _0x3a7e5b){_0x59b504[_0x293e83(0x11c)](_0x31cbe0);}const _0x1afa21=_0x3a8ee8?[]:findJourneysToDelete(_0x5edbb7,_0x120fd9[_0x293e83(0x14f)](({yamlConfig:_0x4515e6,folderPath:_0x584e5b})=>({'yamlConfig':_0x4515e6,'folderPath':resolveTDFolderPath(_0x584e5b,_0x10e279,_0x5549e3)})),_0x25d9b1,_0x5549e3,_0x10e279),_0x189bc1=calculatePushStats(_0xfe6b94,_0x269da6,_0x59b504,_0x4c8b46,_0x1afa21,!!_0x335f4b[_0x293e83(0xf8)],!!_0x335f4b['journeysOnly']),_0x32fb03=_0x189bc1[_0x293e83(0x13e)]['new'],_0x15d08f=_0x189bc1[_0x293e83(0x13e)]['changed'],_0x35bc3f=_0x189bc1[_0x293e83(0x13e)][_0x293e83(0x179)],_0x15f08b=_0x189bc1[_0x293e83(0x13e)][_0x293e83(0x119)],_0x3054b7=_0x189bc1[_0x293e83(0x110)][_0x293e83(0x15f)],_0x1370d3=_0x189bc1['journeys']['new'],_0x37c36a=_0x189bc1[_0x293e83(0x115)]['changed'],_0x483c59=_0x189bc1[_0x293e83(0x115)]['unchanged'],_0x29005a=_0x189bc1['journeys']['toDelete'],_0x5a0504=_0x189bc1['activations'][_0x293e83(0x161)],_0x484878=_0x189bc1['activations'][_0x293e83(0x15f)],_0x361f8c=_0x189bc1[_0x293e83(0x185)][_0x293e83(0x12f)],_0x3b657c=_0x189bc1[_0x293e83(0x185)][_0x293e83(0x119)];console[_0x293e83(0x13d)](_0x293e83(0x114)+_0x148afe+'\x27:');_0x3054b7['length']>0x0&&console[_0x293e83(0x13d)]('\x20\x20'+a31_0x48e3f1['blue'](_0x293e83(0xf4)+_0x3054b7[_0x293e83(0x17f)]+'\x20folders\x20to\x20create'));if(!_0x335f4b[_0x293e83(0x149)]){console[_0x293e83(0x13d)]('\x20\x20📊\x20Segments:'),console[_0x293e83(0x13d)](_0x293e83(0x180)+a31_0x48e3f1[_0x293e83(0x143)]('+\x20'+_0x32fb03[_0x293e83(0x17f)]+_0x293e83(0xfd))),console[_0x293e83(0x13d)](_0x293e83(0x180)+a31_0x48e3f1[_0x293e83(0xff)]('~\x20'+_0x15d08f[_0x293e83(0x17f)]+'\x20changed'));if(_0x15f08b[_0x293e83(0x17f)]>0x0)console[_0x293e83(0x13d)](_0x293e83(0x180)+a31_0x48e3f1[_0x293e83(0x17e)]('-\x20'+_0x15f08b['length']+'\x20to\x20delete'));else _0x4c8b46[_0x293e83(0x17f)]>0x0&&!_0x335f4b[_0x293e83(0xf8)]&&console['error'](_0x293e83(0x180)+a31_0x48e3f1[_0x293e83(0x159)](_0x4c8b46[_0x293e83(0x17f)]+_0x293e83(0x16b)));console['error']('\x20\x20\x20\x20'+a31_0x48e3f1[_0x293e83(0x159)]('=\x20'+_0x35bc3f[_0x293e83(0x17f)]+_0x293e83(0x12e)));}if(_0x269da6[_0x293e83(0x17f)]>0x0||_0x1afa21['length']>0x0){console[_0x293e83(0x13d)](_0x293e83(0x112)),console[_0x293e83(0x13d)](_0x293e83(0x180)+a31_0x48e3f1['green']('+\x20'+_0x1370d3[_0x293e83(0x17f)]+'\x20new')),console['error'](_0x293e83(0x180)+a31_0x48e3f1[_0x293e83(0xff)]('~\x20'+_0x37c36a[_0x293e83(0x17f)]+'\x20changed'));if(_0x29005a['length']>0x0)console[_0x293e83(0x13d)](_0x293e83(0x180)+a31_0x48e3f1[_0x293e83(0x17e)]('-\x20'+_0x29005a['length']+_0x293e83(0x125)));else _0x1afa21[_0x293e83(0x17f)]>0x0&&!_0x335f4b[_0x293e83(0xf8)]&&console[_0x293e83(0x13d)](_0x293e83(0x180)+a31_0x48e3f1[_0x293e83(0x159)](_0x1afa21['length']+_0x293e83(0x16b)));console[_0x293e83(0x13d)](_0x293e83(0x180)+a31_0x48e3f1['dim']('=\x20'+_0x483c59[_0x293e83(0x17f)]+_0x293e83(0x12e)));}_0x5a0504[_0x293e83(0x17f)]>0x0&&!_0x335f4b[_0x293e83(0x149)]&&(console[_0x293e83(0x13d)](''),console['error'](_0x293e83(0x104)),_0x484878['length']>0x0&&console[_0x293e83(0x13d)]('\x20\x20\x20\x20'+a31_0x48e3f1[_0x293e83(0x143)]('+\x20'+_0x484878[_0x293e83(0x17f)]+_0x293e83(0x10a))),_0x361f8c[_0x293e83(0x17f)]>0x0&&console[_0x293e83(0x13d)](_0x293e83(0x180)+a31_0x48e3f1[_0x293e83(0xff)]('~\x20'+_0x361f8c[_0x293e83(0x17f)]+'\x20to\x20update')),_0x3b657c[_0x293e83(0x17f)]>0x0&&console[_0x293e83(0x13d)](_0x293e83(0x180)+a31_0x48e3f1['red']('-\x20'+_0x3b657c[_0x293e83(0x17f)]+_0x293e83(0x125))));console[_0x293e83(0x13d)](_0x293e83(0x160)+a31_0x48e3f1[_0x293e83(0x11e)](_0x5c509c)+'\x0a');if(_0x3054b7[_0x293e83(0x17f)]>0x0){console[_0x293e83(0x13d)](_0x293e83(0x153));for(const _0xa235b3 of _0x3054b7){console[_0x293e83(0x13d)]('\x20\x20'+a31_0x48e3f1[_0x293e83(0x168)]('+')+'\x20'+_0xa235b3);}console[_0x293e83(0x13d)]('');}if(_0x32fb03['length']>0x0&&!_0x335f4b['journeysOnly'])for(const _0x1bdb88 of _0x32fb03){const _0x31b464=_0x1bdb88[_0x293e83(0x100)]?_0x1bdb88['folderPath']+'/'+_0x1bdb88['yamlConfig'][_0x293e83(0x154)]:_0x1bdb88[_0x293e83(0xf5)][_0x293e83(0x154)],_0x5bc470=_0x1bdb88[_0x293e83(0xf5)][_0x293e83(0x185)]?.[_0x293e83(0x17f)]||0x0,_0x41492d=_0x5bc470>0x0?a31_0x48e3f1[_0x293e83(0x159)]('\x20['+_0x5bc470+_0x293e83(0x186)):'';console[_0x293e83(0x13d)]('\x0a'+a31_0x48e3f1['green'](_0x293e83(0xf9))+'\x20'+_0x31b464+_0x41492d),console[_0x293e83(0x13d)]('─'[_0x293e83(0x11a)](0x3c)),_0x1bdb88[_0x293e83(0xf1)]&&console[_0x293e83(0x13d)](_0x1bdb88[_0x293e83(0xf1)]),console[_0x293e83(0x13d)]('─'[_0x293e83(0x11a)](0x3c));}if(_0x15f08b[_0x293e83(0x17f)]>0x0&&!_0x335f4b[_0x293e83(0x149)])for(const _0x4cbaec of _0x15f08b){const _0x51612a=_0x4cbaec[_0x293e83(0x17c)]?_0x25d9b1['get'](_0x4cbaec[_0x293e83(0x17c)][_0x293e83(0x11f)]())||'':'',_0x530fb8=_0x51612a?_0x51612a+'/'+_0x4cbaec['name']:_0x4cbaec[_0x293e83(0x154)],_0x1be40f=_0x3aa86c[_0x293e83(0x174)](_0x4cbaec['id'])||[],_0x260fb7=_0x1be40f[_0x293e83(0x17f)]>0x0?a31_0x48e3f1[_0x293e83(0x159)]('\x20['+_0x1be40f['length']+_0x293e83(0x186)):'';console[_0x293e83(0x13d)]('\x0a'+a31_0x48e3f1[_0x293e83(0x17e)]('Delete\x20segment:')+'\x20'+_0x530fb8+_0x260fb7),console[_0x293e83(0x13d)]('─'[_0x293e83(0x11a)](0x3c));const _0x29a388=segmentWithActivationsToYaml(_0x4cbaec,_0x1be40f,undefined,_0x2aa706,_0x58dc40),_0x243852=segmentToYamlString(_0x29a388),_0x264d55=generateDiff(_0x243852,'');console['error'](formatDiffWithColors(_0x264d55)),console[_0x293e83(0x13d)]('─'[_0x293e83(0x11a)](0x3c));}const _0x26e79a=_0xfe6b94[_0x293e83(0x173)](_0x3027e1=>!_0x3027e1['isNew']&&_0x3027e1[_0x293e83(0xf1)]);if(_0x26e79a[_0x293e83(0x17f)]>0x0&&!_0x335f4b['journeysOnly'])for(const _0x493fd0 of _0x26e79a){const _0x9c22af=_0x493fd0['folderPath']?_0x493fd0[_0x293e83(0x100)]+'/'+_0x493fd0[_0x293e83(0xf5)][_0x293e83(0x154)]:_0x493fd0[_0x293e83(0xf5)][_0x293e83(0x154)];console[_0x293e83(0x13d)]('\x0a'+a31_0x48e3f1[_0x293e83(0xff)]('Changes\x20to:')+'\x20'+_0x9c22af),console[_0x293e83(0x13d)]('─'[_0x293e83(0x11a)](0x3c)),console[_0x293e83(0x13d)](_0x493fd0[_0x293e83(0xf1)]),console[_0x293e83(0x13d)]('─'['repeat'](0x3c));}if(_0x1370d3[_0x293e83(0x17f)]>0x0)for(const _0x292a64 of _0x1370d3){const _0x499271=_0x292a64['folderPath']?_0x292a64[_0x293e83(0x100)]+'/'+_0x292a64[_0x293e83(0xf5)][_0x293e83(0x154)]:_0x292a64[_0x293e83(0xf5)][_0x293e83(0x154)];console['error']('\x0a'+a31_0x48e3f1[_0x293e83(0x143)](_0x293e83(0x178))+'\x20'+_0x499271),console[_0x293e83(0x13d)]('─'[_0x293e83(0x11a)](0x3c)),_0x292a64[_0x293e83(0xf1)]&&console[_0x293e83(0x13d)](_0x292a64['diff']),console[_0x293e83(0x13d)]('─'[_0x293e83(0x11a)](0x3c));}const _0x548d3f=_0x269da6['filter'](_0x19adb0=>!_0x19adb0[_0x293e83(0x163)]&&_0x19adb0[_0x293e83(0xf1)]);if(_0x548d3f[_0x293e83(0x17f)]>0x0)for(const _0x3ed85c of _0x548d3f){const _0x22d936=_0x3ed85c[_0x293e83(0x100)]?_0x3ed85c[_0x293e83(0x100)]+'/'+_0x3ed85c[_0x293e83(0xf5)][_0x293e83(0x154)]:_0x3ed85c['yamlConfig'][_0x293e83(0x154)];console[_0x293e83(0x13d)]('\x0a'+a31_0x48e3f1[_0x293e83(0xff)]('Changes\x20to\x20journey:')+'\x20'+_0x22d936),console[_0x293e83(0x13d)]('─'[_0x293e83(0x11a)](0x3c)),console[_0x293e83(0x13d)](_0x3ed85c[_0x293e83(0xf1)]),console[_0x293e83(0x13d)]('─'[_0x293e83(0x11a)](0x3c));}if(_0x29005a['length']>0x0)for(const _0x8f01db of _0x29005a){const _0x1424b2=_0x8f01db[_0x293e83(0x135)]?_0x25d9b1[_0x293e83(0x174)](_0x8f01db[_0x293e83(0x135)])||'':'',_0x494cb2=_0x1424b2?_0x1424b2+'/'+_0x8f01db[_0x293e83(0x117)]:_0x8f01db[_0x293e83(0x117)];console[_0x293e83(0x13d)]('\x0a'+a31_0x48e3f1[_0x293e83(0x17e)](_0x293e83(0x14c))+'\x20'+_0x494cb2),console[_0x293e83(0x13d)]('─'['repeat'](0x3c)),console['error'](a31_0x48e3f1[_0x293e83(0x17e)](_0x293e83(0x138))),console['error']('─'[_0x293e83(0x11a)](0x3c));}if(_0x335f4b[_0x293e83(0x171)])return console['error'](a31_0x48e3f1[_0x293e83(0xff)](_0x293e83(0x187))),0x0;const _0x49a6ee=_0x335f4b['journeysOnly']?![]:_0x32fb03[_0x293e83(0x17f)]>0x0||_0x15d08f['length']>0x0||_0x15f08b[_0x293e83(0x17f)]>0x0,_0x18879d=_0x1370d3[_0x293e83(0x17f)]>0x0||_0x37c36a[_0x293e83(0x17f)]>0x0||_0x29005a['length']>0x0,_0x203c2c=_0x335f4b[_0x293e83(0x149)]?![]:_0x5a0504['length']>0x0,_0x579fb5=_0x3054b7[_0x293e83(0x17f)]>0x0;if(!_0x49a6ee&&!_0x18879d&&!_0x203c2c&&!_0x579fb5){const _0x12d682=_0x335f4b[_0x293e83(0x149)]?'✔\x20All\x20journeys\x20are\x20up\x20to\x20date':_0x293e83(0x15a);console['error'](a31_0x48e3f1[_0x293e83(0x143)](_0x12d682));if(_0x3a8ee8&&_0x483c59['length']===0x1){const _0xcd1c59=_0x483c59[0x0];if(_0xcd1c59[_0x293e83(0x145)]?.['id']){const _0x335f77=getConsoleNextUrl(_0x335f4b['site'],_0x293e83(0x156)+_0x43e40c+'/e/'+_0xcd1c59[_0x293e83(0x145)]['id']+_0x293e83(0x12d));console['error']('\x20\x20'+a31_0x48e3f1[_0x293e83(0x11e)](_0x335f77));}}return 0x0;}const _0x14a56f=_0x335f4b[_0x293e83(0x149)]?_0x1370d3[_0x293e83(0x17f)]+_0x37c36a['length']+_0x29005a[_0x293e83(0x17f)]+_0x3054b7[_0x293e83(0x17f)]:_0x32fb03[_0x293e83(0x17f)]+_0x15d08f['length']+_0x15f08b['length']+_0x1370d3[_0x293e83(0x17f)]+_0x37c36a['length']+_0x29005a[_0x293e83(0x17f)]+_0x3054b7[_0x293e83(0x17f)]+_0x5a0504[_0x293e83(0x17f)];if(!_0x335f4b['yes']&&_0x14a56f>0x0){const _0x166c45=await confirmKey(_0x293e83(0x11b)+_0x14a56f+_0x293e83(0x113));if(!_0x166c45)return console[_0x293e83(0x13d)]('Aborted.'),0x1;}const _0x2ff0b7={'withProgress':async(_0x13acb5,_0x42e158)=>{const _0xa4ca85=await withSpinner(_0x13acb5,_0x42e158,{'verbose':_0x335f4b['verbose']});return{'data':_0xa4ca85['data']};},'logInfo':_0x879561=>console['error'](a31_0x48e3f1[_0x293e83(0x168)]('✔\x20'+_0x879561)),'logSuccess':_0x19c16b=>console[_0x293e83(0x13d)](a31_0x48e3f1['green']('✔\x20'+_0x19c16b)),'logWarning':_0x5eba3e=>console['error'](a31_0x48e3f1[_0x293e83(0xff)]('⚠\x20'+_0x5eba3e)),'logDeleted':_0x1c08a7=>console[_0x293e83(0x13d)](a31_0x48e3f1[_0x293e83(0x17e)]('✔\x20'+_0x1c08a7))},_0xf265ac={'segment':_0x59818d['segment'],'journey':_0x59818d[_0x293e83(0x15c)],'user':_0x59818d[_0x293e83(0x183)],'connection':_0x59818d[_0x293e83(0x10e)]};_0x3054b7[_0x293e83(0x17f)]>0x0&&(_0x4930d0=await executePushFolders(_0xf265ac,_0x3054b7,_0x4930d0,{'parentId':_0x43e40c},_0x2ff0b7));const _0x3e5453={'rootFolderId':_0x224261,'folderPathToId':_0x4930d0,'folderIdToPath':_0x25d9b1,'segmentNameToId':_0x4314de,'activationsBySegmentId':_0x3aa86c,'emailToIdMap':_0x2c702a,'idToEmailMap':_0x2aa706,'connectionNameToIdMap':_0x5749c6[_0x293e83(0x182)],'connectionIdToNameMap':_0x5749c6[_0x293e83(0x111)],'connectionNameToTypeMap':_0x32e6fb},_0x38a4f0=await executePushSegments(_0xf265ac,_0x335f4b['journeysOnly']?[]:_0xfe6b94,_0x3e5453,{'parentId':_0x43e40c},_0x2ff0b7),_0x744ffe=_0x38a4f0[_0x293e83(0x12a)],_0x11b537=_0x38a4f0[_0x293e83(0x15e)],_0x596836=_0x38a4f0['activations'][_0x293e83(0x12a)],_0x37138b=_0x38a4f0[_0x293e83(0x185)]['updated'],_0xb5a706=_0x38a4f0[_0x293e83(0x185)]['deleted'],_0x2a40e3=await executePushSegmentDeletions(_0xf265ac,_0x335f4b['journeysOnly']?[]:_0x15f08b,_0x2ff0b7);let _0x43d430=0x0,_0x2bf1a6=0x0,_0x8018ee=0x0;const _0xd687f6=new Map(_0x4314de);for(const [_0x15afbd,_0x2f69b9]of _0x38a4f0[_0x293e83(0x10c)]){_0xd687f6[_0x293e83(0x146)](_0x15afbd,_0x2f69b9);}if(_0x269da6[_0x293e83(0x17f)]>0x0){const _0x3faf25={..._0x3e5453,'segmentNameToId':_0xd687f6,'existingSegments':_0x5093e7,'activationContext':_0x3d5973},_0x5a6544=await executePushJourneys(_0xf265ac,_0x269da6,_0x3faf25,{'parentId':_0x43e40c,'rootFolderId':_0x224261,'verbose':_0x335f4b[_0x293e83(0xf7)]},_0x2ff0b7);_0x43d430=_0x5a6544[_0x293e83(0x12a)],_0x2bf1a6=_0x5a6544['updated'];if(_0x3a8ee8&&_0x5a6544['results'][_0x293e83(0x17f)]===0x1){const _0x29c731=_0x5a6544[_0x293e83(0x181)][0x0];if(_0x29c731[_0x293e83(0x169)]){const _0x5c2f53=getConsoleNextUrl(_0x335f4b[_0x293e83(0x132)],'/app/ps/'+_0x43e40c+_0x293e83(0x10b)+_0x29c731['journeyId']+_0x293e83(0x12d));console[_0x293e83(0x13d)]('\x20\x20'+a31_0x48e3f1[_0x293e83(0x11e)](_0x5c2f53));}}}for(const _0x59742c of _0x29005a){console[_0x293e83(0x13d)](a31_0x48e3f1[_0x293e83(0xff)]('⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20'+_0x59742c['journeyBundleName'])),_0x8018ee++;}const _0x96ec51=[];if(_0x744ffe>0x0)_0x96ec51['push'](_0x744ffe+_0x293e83(0x120));if(_0x11b537>0x0)_0x96ec51[_0x293e83(0x124)](_0x11b537+'\x20updated');if(_0x2a40e3>0x0)_0x96ec51[_0x293e83(0x124)](_0x2a40e3+_0x293e83(0x116));const _0x4f7b18=[];if(_0x43d430>0x0)_0x4f7b18['push'](_0x43d430+_0x293e83(0x120));if(_0x2bf1a6>0x0)_0x4f7b18[_0x293e83(0x124)](_0x2bf1a6+_0x293e83(0x12c));if(_0x8018ee>0x0)_0x4f7b18['push'](_0x8018ee+_0x293e83(0x116));const _0xa859b3=[];if(_0x596836>0x0)_0xa859b3['push'](_0x596836+_0x293e83(0x120));if(_0x37138b>0x0)_0xa859b3[_0x293e83(0x124)](_0x37138b+_0x293e83(0x12c));if(_0xb5a706>0x0)_0xa859b3[_0x293e83(0x124)](_0xb5a706+_0x293e83(0x116));return console[_0x293e83(0x13d)](a31_0x48e3f1['green'](_0x293e83(0x147))),_0x96ec51[_0x293e83(0x17f)]>0x0&&!_0x335f4b[_0x293e83(0x149)]&&console['error']('\x20\x20Segments:\x20'+_0x96ec51[_0x293e83(0x10d)](',\x20')),_0x4f7b18['length']>0x0&&console[_0x293e83(0x13d)](_0x293e83(0x15b)+_0x4f7b18['join'](',\x20')),_0xa859b3['length']>0x0&&!_0x335f4b[_0x293e83(0x149)]&&console[_0x293e83(0x13d)](_0x293e83(0x136)+_0xa859b3[_0x293e83(0x10d)](',\x20')),0x0;}}
@@ -1 +1 @@
1
- const a32_0x1281d1=a32_0xd69a;(function(_0x130e65,_0x2fd81b){const _0x394d4d=a32_0xd69a,_0x53efe6=_0x130e65();while(!![]){try{const _0x501df4=-parseInt(_0x394d4d(0x184))/0x1+-parseInt(_0x394d4d(0x174))/0x2*(-parseInt(_0x394d4d(0x171))/0x3)+-parseInt(_0x394d4d(0x16d))/0x4*(-parseInt(_0x394d4d(0x16c))/0x5)+-parseInt(_0x394d4d(0x18c))/0x6*(parseInt(_0x394d4d(0x177))/0x7)+-parseInt(_0x394d4d(0x164))/0x8*(-parseInt(_0x394d4d(0x182))/0x9)+parseInt(_0x394d4d(0x175))/0xa+-parseInt(_0x394d4d(0x188))/0xb;if(_0x501df4===_0x2fd81b)break;else _0x53efe6['push'](_0x53efe6['shift']());}catch(_0x38f721){_0x53efe6['push'](_0x53efe6['shift']());}}}(a32_0x5de4,0xa3509));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';function a32_0x5de4(){const _0x3f14a9=['data','993300EVkmUT','.\x20Only\x20child\x20segments\x20can\x20be\x20updated.','Resolved\x20relative\x20path\x20to:\x20','error','\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22','verbose','\x20\x20\x20Path:\x20','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','⚠\x20Deprecation\x20warning:\x20`segment\x20update`\x20is\x20deprecated.','424nJVtQO','description','segmentName','Resolving\x20folder\x20\x27','Parent\x20ID:\x20','resolvePathToResource','Error:\x20Cannot\x20update\x20','segment','740IsQMPB','27812MhuWhB','resolveFolderId','yellow','segmentPath','10779oDwfxf','type','✔\x20Updated\x20segment\x20\x27','236fXLLXa','6744860XYMFVR','Segment\x20ID:\x20','14BoHwXh','length','execute','Resolved\x20type:\x20','parentId','kind','Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]','Resolved\x20folder\x20ID:\x20','rule','folder','Resolving\x20path\x20\x27','117225cYRZxh','Segment\x20ID\x20missing\x20from\x20resolved\x20path','460512sdZniq','segmentId','Updating\x20segment\x20\x27','name','14930080hgBUuf','segment:update','\x27...'];a32_0x5de4=function(){return _0x3f14a9;};return a32_0x5de4();}import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';function a32_0xd69a(_0x3b64e1,_0xa1950d){_0x3b64e1=_0x3b64e1-0x163;const _0x5de458=a32_0x5de4();let _0xd69a65=_0x5de458[_0x3b64e1];return _0xd69a65;}import{SDKError,ErrorCode}from'../sdk/index.js';import a32_0x2e4f4e from'chalk';export class SegmentUpdateCommand extends BaseCommand{['name']=a32_0x1281d1(0x189);[a32_0x1281d1(0x165)]='Update\x20existing\x20child\x20segment';async[a32_0x1281d1(0x179)](_0x21f0e9){const _0x515598=a32_0x1281d1;console[_0x515598(0x18f)](a32_0x2e4f4e[_0x515598(0x16f)](_0x515598(0x163))),console['error'](a32_0x2e4f4e[_0x515598(0x16f)](_0x515598(0x193)));const {options:_0x1d2556,args:_0x179101,tdx:_0x342914}=_0x21f0e9,_0x11e86e=_0x1d2556;if(_0x179101[_0x515598(0x178)]===0x0)return console['error']('Error:\x20Segment\x20path\x20or\x20name\x20is\x20required'),console[_0x515598(0x18f)](_0x515598(0x17d)),console[_0x515598(0x18f)]('Examples:'),console[_0x515598(0x18f)](_0x515598(0x190)),console['error']('\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context'),0x1;const _0x2b6be1=_0x179101[0x0],_0x83e6d1=_0x1d2556[_0x515598(0x170)];let _0xba3d5e=_0x2b6be1;_0x83e6d1&&!_0x2b6be1['includes']('/')&&(_0xba3d5e=_0x83e6d1+'/'+_0x2b6be1,_0x11e86e[_0x515598(0x191)]&&console[_0x515598(0x18f)](_0x515598(0x18e)+_0xba3d5e));const _0x17ece1=await withSpinner(_0x515598(0x181)+_0xba3d5e+_0x515598(0x18a),()=>_0x342914[_0x515598(0x16b)][_0x515598(0x169)](_0xba3d5e),{'verbose':_0x11e86e['verbose']}),_0x11ec3d=_0x17ece1[_0x515598(0x18b)];_0x11e86e[_0x515598(0x191)]&&console[_0x515598(0x18f)](_0x515598(0x17a)+_0x11ec3d[_0x515598(0x172)]);if(_0x11ec3d[_0x515598(0x172)]!==_0x515598(0x16b))return console[_0x515598(0x18f)](_0x515598(0x16a)+_0x11ec3d['type']+_0x515598(0x18d)),console[_0x515598(0x18f)]('Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]'),0x1;if(!_0x11ec3d[_0x515598(0x185)])throw new SDKError(ErrorCode['INTERNAL'],_0x515598(0x183));const _0x5e14c5=_0x11ec3d[_0x515598(0x17b)],_0x2f109c=_0x11ec3d[_0x515598(0x185)];_0x11e86e[_0x515598(0x191)]&&(console[_0x515598(0x18f)](_0x515598(0x168)+_0x5e14c5),console[_0x515598(0x18f)](_0x515598(0x176)+_0x2f109c));let _0x148c81;if(_0x11e86e[_0x515598(0x180)]){const _0x610b28=_0x11e86e[_0x515598(0x180)],_0x29fb2e=await withSpinner(_0x515598(0x167)+_0x610b28+_0x515598(0x18a),()=>_0x342914[_0x515598(0x16b)][_0x515598(0x16e)](_0x5e14c5,_0x610b28),{'verbose':_0x11e86e[_0x515598(0x191)]});_0x148c81=parseInt(_0x29fb2e[_0x515598(0x18b)],0xa),_0x11e86e[_0x515598(0x191)]&&console['error'](_0x515598(0x17e)+_0x148c81);}const _0x524527=await loadJSONFromOptions(_0x11e86e[_0x515598(0x17f)],_0x11e86e['ruleFile']),_0x8a1a6b={'name':_0x11e86e[_0x515598(0x187)],'description':_0x11e86e['description'],'rule':_0x524527,'kind':_0x11e86e[_0x515598(0x17c)]!==undefined?parseInt(_0x11e86e[_0x515598(0x17c)],0xa):undefined,'segmentFolderId':_0x148c81},_0x251a3f=await withSpinner(_0x515598(0x186)+_0x11ec3d[_0x515598(0x166)]+_0x515598(0x18a),()=>_0x342914[_0x515598(0x16b)]['updateSegmentById'](_0x5e14c5,_0x2f109c,_0x8a1a6b),{'verbose':_0x11e86e[_0x515598(0x191)]}),_0x5d7a42=_0x251a3f[_0x515598(0x18b)];return console['error'](_0x515598(0x173)+_0x5d7a42[_0x515598(0x187)]+'\x27'),_0xba3d5e!==_0x2b6be1&&console[_0x515598(0x18f)](_0x515598(0x192)+_0xba3d5e),await handleSDKOutput([_0x5d7a42],_0x11e86e),0x0;}}
1
+ const a32_0x2233cd=a32_0x591f;function a32_0x236a(){const _0x503755=['Update\x20existing\x20child\x20segment','description','946128YJAFfU','✔\x20Updated\x20segment\x20\x27','INTERNAL','updateSegmentById','198cHjMeX','Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]','segmentName','\x27...','resolveFolderId','348360StYfRN','Resolving\x20folder\x20\x27','Resolved\x20relative\x20path\x20to:\x20','verbose','Segment\x20ID\x20missing\x20from\x20resolved\x20path','resolvePathToResource','5CQPzur','149341GrqGsB','ruleFile','segmentId','segmentPath','name','\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','8710240VOuUpK','25047aLXLDy','584zChPBa','2416953PMMtll','Parent\x20ID:\x20','Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]','segment','4RZhsyK','error','Resolving\x20path\x20\x27','length','Updating\x20segment\x20\x27','11274lhUYFm','Segment\x20ID:\x20','execute','kind','type','yellow','Examples:','Resolved\x20folder\x20ID:\x20','Error:\x20Cannot\x20update\x20','data','folder'];a32_0x236a=function(){return _0x503755;};return a32_0x236a();}(function(_0x4e2080,_0x1f95db){const _0x37f938=a32_0x591f,_0x2582ae=_0x4e2080();while(!![]){try{const _0x318c5b=-parseInt(_0x37f938(0x163))/0x1+-parseInt(_0x37f938(0x182))/0x2+parseInt(_0x37f938(0x16c))/0x3*(-parseInt(_0x37f938(0x170))/0x4)+parseInt(_0x37f938(0x162))/0x5*(-parseInt(_0x37f938(0x175))/0x6)+parseInt(_0x37f938(0x169))/0x7+-parseInt(_0x37f938(0x16b))/0x8*(-parseInt(_0x37f938(0x16a))/0x9)+parseInt(_0x37f938(0x15c))/0xa*(parseInt(_0x37f938(0x157))/0xb);if(_0x318c5b===_0x1f95db)break;else _0x2582ae['push'](_0x2582ae['shift']());}catch(_0x50f019){_0x2582ae['push'](_0x2582ae['shift']());}}}(a32_0x236a,0x9d5f0));import{BaseCommand}from'./command.js';function a32_0x591f(_0x5b5ab3,_0x29218d){_0x5b5ab3=_0x5b5ab3-0x154;const _0x236aa8=a32_0x236a();let _0x591f5e=_0x236aa8[_0x5b5ab3];return _0x591f5e;}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 a32_0x3741e1 from'chalk';export class SegmentUpdateCommand extends BaseCommand{['name']='segment:update';[a32_0x2233cd(0x181)]=a32_0x2233cd(0x180);async[a32_0x2233cd(0x177)](_0x4e4bbd){const _0xc8d04c=a32_0x2233cd;console[_0xc8d04c(0x171)](a32_0x3741e1[_0xc8d04c(0x17a)]('⚠\x20Deprecation\x20warning:\x20`segment\x20update`\x20is\x20deprecated.')),console[_0xc8d04c(0x171)](a32_0x3741e1[_0xc8d04c(0x17a)]('\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a'));const {options:_0x3c4b4e,args:_0x29b431,tdx:_0x41e940}=_0x4e4bbd,_0x4cc3e1=_0x3c4b4e;if(_0x29b431[_0xc8d04c(0x173)]===0x0)return console['error']('Error:\x20Segment\x20path\x20or\x20name\x20is\x20required'),console['error'](_0xc8d04c(0x16e)),console['error'](_0xc8d04c(0x17b)),console[_0xc8d04c(0x171)]('\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22'),console['error'](_0xc8d04c(0x168)),0x1;const _0x2adec9=_0x29b431[0x0],_0x442f69=_0x3c4b4e[_0xc8d04c(0x166)];let _0x228bed=_0x2adec9;_0x442f69&&!_0x2adec9['includes']('/')&&(_0x228bed=_0x442f69+'/'+_0x2adec9,_0x4cc3e1[_0xc8d04c(0x15f)]&&console[_0xc8d04c(0x171)](_0xc8d04c(0x15e)+_0x228bed));const _0x5536bc=await withSpinner(_0xc8d04c(0x172)+_0x228bed+_0xc8d04c(0x15a),()=>_0x41e940[_0xc8d04c(0x16f)][_0xc8d04c(0x161)](_0x228bed),{'verbose':_0x4cc3e1['verbose']}),_0x7b8566=_0x5536bc[_0xc8d04c(0x17e)];_0x4cc3e1[_0xc8d04c(0x15f)]&&console['error']('Resolved\x20type:\x20'+_0x7b8566[_0xc8d04c(0x179)]);if(_0x7b8566[_0xc8d04c(0x179)]!==_0xc8d04c(0x16f))return console[_0xc8d04c(0x171)](_0xc8d04c(0x17d)+_0x7b8566[_0xc8d04c(0x179)]+'.\x20Only\x20child\x20segments\x20can\x20be\x20updated.'),console[_0xc8d04c(0x171)](_0xc8d04c(0x158)),0x1;if(!_0x7b8566[_0xc8d04c(0x165)])throw new SDKError(ErrorCode[_0xc8d04c(0x155)],_0xc8d04c(0x160));const _0x39fbfa=_0x7b8566['parentId'],_0x6c5fa4=_0x7b8566[_0xc8d04c(0x165)];_0x4cc3e1[_0xc8d04c(0x15f)]&&(console[_0xc8d04c(0x171)](_0xc8d04c(0x16d)+_0x39fbfa),console['error'](_0xc8d04c(0x176)+_0x6c5fa4));let _0x370d4f;if(_0x4cc3e1[_0xc8d04c(0x17f)]){const _0x2124c1=_0x4cc3e1[_0xc8d04c(0x17f)],_0x19c68b=await withSpinner(_0xc8d04c(0x15d)+_0x2124c1+_0xc8d04c(0x15a),()=>_0x41e940['segment'][_0xc8d04c(0x15b)](_0x39fbfa,_0x2124c1),{'verbose':_0x4cc3e1['verbose']});_0x370d4f=parseInt(_0x19c68b['data'],0xa),_0x4cc3e1[_0xc8d04c(0x15f)]&&console['error'](_0xc8d04c(0x17c)+_0x370d4f);}const _0x5122fd=await loadJSONFromOptions(_0x4cc3e1['rule'],_0x4cc3e1[_0xc8d04c(0x164)]),_0x3369b8={'name':_0x4cc3e1[_0xc8d04c(0x167)],'description':_0x4cc3e1[_0xc8d04c(0x181)],'rule':_0x5122fd,'kind':_0x4cc3e1[_0xc8d04c(0x178)]!==undefined?parseInt(_0x4cc3e1['kind'],0xa):undefined,'segmentFolderId':_0x370d4f},_0x33890a=await withSpinner(_0xc8d04c(0x174)+_0x7b8566[_0xc8d04c(0x159)]+_0xc8d04c(0x15a),()=>_0x41e940['segment'][_0xc8d04c(0x156)](_0x39fbfa,_0x6c5fa4,_0x3369b8),{'verbose':_0x4cc3e1['verbose']}),_0x50d570=_0x33890a[_0xc8d04c(0x17e)];return console['error'](_0xc8d04c(0x154)+_0x50d570['name']+'\x27'),_0x228bed!==_0x2adec9&&console[_0xc8d04c(0x171)]('\x20\x20\x20Path:\x20'+_0x228bed),await handleSDKOutput([_0x50d570],_0x4cc3e1),0x0;}}
@@ -1 +1 @@
1
- const a33_0x38a3e6=a33_0x312a;(function(_0xf36978,_0x5b331f){const _0x4355e0=a33_0x312a,_0x156e8e=_0xf36978();while(!![]){try{const _0x5d093b=-parseInt(_0x4355e0(0x1a3))/0x1*(parseInt(_0x4355e0(0x1cb))/0x2)+parseInt(_0x4355e0(0x1d1))/0x3+parseInt(_0x4355e0(0x1a1))/0x4+-parseInt(_0x4355e0(0x1cc))/0x5+-parseInt(_0x4355e0(0x1ac))/0x6*(-parseInt(_0x4355e0(0x1c4))/0x7)+parseInt(_0x4355e0(0x19f))/0x8+parseInt(_0x4355e0(0x1c2))/0x9;if(_0x5d093b===_0x5b331f)break;else _0x156e8e['push'](_0x156e8e['shift']());}catch(_0x335213){_0x156e8e['push'](_0x156e8e['shift']());}}}(a33_0x5e8d,0x530c9));import{existsSync,statSync}from'fs';import a33_0x50e8dc from'chalk';function a33_0x5e8d(){const _0x219224=['Resolving\x20path\x20\x27','error','parentName','data','execute','type','585696uNUdlO','slice','991844dYbEzU','segments','1uocOhR','Folder\x20ID:\x20','Resolved\x20relative\x20path\x20to:\x20','verbose','Target\x20path:\x20','segmentPath','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22','folderPath','name','1728bTJHSQ','Usage:\x20tdx\x20segment\x20use\x20<path>','Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.','segment:use','Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context','Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>','log','Site:\x20','Use:\x20tdx\x20segment\x20use\x20','length','Examples:','parentId','✔\x20Context\x20cleared.\x20Back\x20to\x20root.','Parent\x20ID:\x20','folderId','✔\x20Context\x20set\x20to:\x20','isAbsolute','dim','fullPath','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','segment','description','4152996rNsreV','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22','280VMMJKS','isDirectory','split','config','red','resolvePathToResource','Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.','838330BcrtJj','754865wIgrPk','\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context','cyan','green','\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent','348510LBYdxP','Set\x20current\x20segment/folder\x20context\x20for\x20navigation','session'];a33_0x5e8d=function(){return _0x219224;};return a33_0x5e8d();}function a33_0x312a(_0x5503d1,_0x2d20ce){_0x5503d1=_0x5503d1-0x197;const _0x5e8d6f=a33_0x5e8d();let _0x312aa8=_0x5e8d6f[_0x5503d1];return _0x312aa8;}import{BaseCommand}from'./command.js';import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';import{parsePath,normalizePath}from'../sdk/segment/segment-path-parser.js';import{findTdxConfig}from'../sdk/segment/tdx-config.js';export class SegmentUseCommand extends BaseCommand{[a33_0x38a3e6(0x1ab)]=a33_0x38a3e6(0x1af);[a33_0x38a3e6(0x1c1)]=a33_0x38a3e6(0x197);async[a33_0x38a3e6(0x19d)](_0x373290){const _0x40ab74=a33_0x38a3e6,{options:_0x20630a,args:_0x5ad31c,tdx:_0x25ad4a}=_0x373290;if(_0x5ad31c[_0x40ab74(0x1b5)]===0x0)return console[_0x40ab74(0x19a)](a33_0x50e8dc[_0x40ab74(0x1c8)]('Error:\x20Path\x20is\x20required\x0a')),console['error'](_0x40ab74(0x1ad)),console[_0x40ab74(0x19a)](_0x40ab74(0x1b6)),console['error'](_0x40ab74(0x1a9)),console[_0x40ab74(0x19a)](_0x40ab74(0x1c3)),console[_0x40ab74(0x19a)](_0x40ab74(0x1cd)),console[_0x40ab74(0x19a)](_0x40ab74(0x1d0)),0x1;const _0x8a4e4f=_0x5ad31c[0x0],_0x1bbf4f=_0x20630a[_0x40ab74(0x198)];try{if(_0x8a4e4f==='/')return saveSessionContext({'segment_path':undefined},_0x1bbf4f),console[_0x40ab74(0x1b2)](a33_0x50e8dc[_0x40ab74(0x1cf)](_0x40ab74(0x1b8))),0x0;if(existsSync(_0x8a4e4f)&&statSync(_0x8a4e4f)[_0x40ab74(0x1c5)]()){let _0x316643;try{_0x316643=findTdxConfig(_0x8a4e4f);}catch{return console[_0x40ab74(0x19a)](a33_0x50e8dc[_0x40ab74(0x1c8)]('Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20'+_0x8a4e4f)),console[_0x40ab74(0x19a)](a33_0x50e8dc[_0x40ab74(0x1ce)](_0x40ab74(0x1bf))),0x1;}const _0x44f9c9=_0x316643[_0x40ab74(0x1c7)]['parent_segment'];return saveSessionContext({'segment_path':_0x44f9c9,'parent_segment':_0x44f9c9},_0x1bbf4f),console[_0x40ab74(0x1b2)](a33_0x50e8dc[_0x40ab74(0x1cf)](_0x40ab74(0x1bb)+a33_0x50e8dc[_0x40ab74(0x1ce)](_0x44f9c9))),0x0;}const _0x317cb3=_0x20630a[_0x40ab74(0x1a8)];let _0x324743=_0x8a4e4f;const _0x167c0f=parsePath(_0x8a4e4f);if(!_0x167c0f[_0x40ab74(0x1bc)]){if(!_0x317cb3)return console[_0x40ab74(0x19a)](a33_0x50e8dc[_0x40ab74(0x1c8)](_0x40ab74(0x1ae))),console[_0x40ab74(0x19a)](a33_0x50e8dc[_0x40ab74(0x1ce)](_0x40ab74(0x1b1))),0x1;if(_0x8a4e4f==='..'){const _0xd7a2c=_0x317cb3[_0x40ab74(0x1c6)]('/')[_0x40ab74(0x1a0)](0x0,-0x1)['join']('/');_0x324743=_0xd7a2c||'/';}else _0x8a4e4f==='.'?_0x324743=_0x317cb3:_0x324743=_0x317cb3+'/'+_0x8a4e4f;_0x20630a[_0x40ab74(0x1a6)]&&console[_0x40ab74(0x19a)](_0x40ab74(0x1a5)+_0x324743);}if(_0x324743==='/'||_0x324743==='')return saveSessionContext({'segment_path':undefined},_0x1bbf4f),console[_0x40ab74(0x1b2)](a33_0x50e8dc[_0x40ab74(0x1cf)](_0x40ab74(0x1b8))),0x0;_0x324743=normalizePath(_0x324743);const _0x3a3e67=parsePath(_0x324743)[_0x40ab74(0x1a2)];if(_0x3a3e67[_0x40ab74(0x1b5)]===0x0)return saveSessionContext({'segment_path':undefined},_0x1bbf4f),console[_0x40ab74(0x1b2)](a33_0x50e8dc[_0x40ab74(0x1cf)](_0x40ab74(0x1b8))),0x0;_0x20630a[_0x40ab74(0x1a6)]&&(console['error'](_0x40ab74(0x1b3)+_0x20630a['site']),console['error'](_0x40ab74(0x1a7)+_0x324743));const _0x3302bf=await withSpinner(_0x40ab74(0x199)+_0x324743+'\x27...',()=>_0x25ad4a[_0x40ab74(0x1c0)][_0x40ab74(0x1c9)](_0x324743),{'verbose':_0x20630a['verbose']}),_0x1785a2=_0x3302bf[_0x40ab74(0x19c)];_0x20630a[_0x40ab74(0x1a6)]&&(console['error']('Resolved\x20path\x20type:\x20'+_0x1785a2[_0x40ab74(0x19e)]),console[_0x40ab74(0x19a)](_0x40ab74(0x1b9)+_0x1785a2[_0x40ab74(0x1b7)]),_0x1785a2[_0x40ab74(0x1ba)]&&console[_0x40ab74(0x19a)](_0x40ab74(0x1a4)+_0x1785a2[_0x40ab74(0x1ba)]));if(_0x1785a2[_0x40ab74(0x19e)]==='segment')return console[_0x40ab74(0x19a)](a33_0x50e8dc[_0x40ab74(0x1c8)](_0x40ab74(0x1ca))),console[_0x40ab74(0x19a)]('Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.'),console['error'](a33_0x50e8dc[_0x40ab74(0x1ce)](_0x40ab74(0x1b4)+_0x1785a2[_0x40ab74(0x19b)]+(_0x1785a2[_0x40ab74(0x1aa)]?'/'+_0x1785a2[_0x40ab74(0x1aa)]['join']('/'):''))),0x1;return saveSessionContext({'segment_path':_0x1785a2['fullPath'],'parent_segment':_0x1785a2['parentName']},_0x1bbf4f),console[_0x40ab74(0x1b2)](a33_0x50e8dc[_0x40ab74(0x1cf)]('✔\x20Context\x20set\x20to:\x20'+a33_0x50e8dc[_0x40ab74(0x1ce)](_0x1785a2[_0x40ab74(0x1be)]))),_0x20630a[_0x40ab74(0x1a6)]&&(console['error'](a33_0x50e8dc[_0x40ab74(0x1bd)](_0x40ab74(0x1b0))),console['error'](a33_0x50e8dc['dim']('Use\x20\x22tdx\x20use\x22\x20to\x20see\x20all\x20context\x20parameters'))),0x0;}catch(_0x2c935a){throw _0x2c935a;}}}
1
+ const a33_0x373258=a33_0x2494;function a33_0x2fe2(){const _0x1aecba=['Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.','log','slice','session','Site:\x20','green','961010pRgzSY','resolvePathToResource','join','24pLpmGg','Use\x20\x22tdx\x20use\x22\x20to\x20see\x20all\x20context\x20parameters','parentId','length','517pCspQT','Examples:','Folder\x20ID:\x20','4XwUELR','\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context','folderPath','✔\x20Context\x20set\x20to:\x20','verbose','error','512340xZhpeu','Set\x20current\x20segment/folder\x20context\x20for\x20navigation','Resolved\x20relative\x20path\x20to:\x20','isAbsolute','55793bZKcNz','Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.','segment:use','96EouyuV','Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','execute','Target\x20path:\x20','red','site','Parent\x20ID:\x20','\x27...','Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>','name','dim','folderId','Resolved\x20path\x20type:\x20','isDirectory','1872498alFzFT','Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.','Resolving\x20path\x20\x27','parent_segment','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22','segments','995169ijYqem','fullPath','Usage:\x20tdx\x20segment\x20use\x20<path>','cyan','Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context','15820371hqYdpD','description','split','type','segmentPath','✔\x20Context\x20cleared.\x20Back\x20to\x20root.','parentName','432408YBXIgY','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure'];a33_0x2fe2=function(){return _0x1aecba;};return a33_0x2fe2();}(function(_0x2befd1,_0x5d78ba){const _0x3067ac=a33_0x2494,_0x44667e=_0x2befd1();while(!![]){try{const _0x581a51=-parseInt(_0x3067ac(0x1b1))/0x1*(parseInt(_0x3067ac(0x1a7))/0x2)+-parseInt(_0x3067ac(0x183))/0x3+-parseInt(_0x3067ac(0x195))/0x4+parseInt(_0x3067ac(0x19d))/0x5*(parseInt(_0x3067ac(0x1a0))/0x6)+parseInt(_0x3067ac(0x189))/0x7*(parseInt(_0x3067ac(0x175))/0x8)+parseInt(_0x3067ac(0x18e))/0x9+parseInt(_0x3067ac(0x1ad))/0xa*(-parseInt(_0x3067ac(0x1a4))/0xb);if(_0x581a51===_0x5d78ba)break;else _0x44667e['push'](_0x44667e['shift']());}catch(_0x3701c7){_0x44667e['push'](_0x44667e['shift']());}}}(a33_0x2fe2,0xef72b));import{existsSync,statSync}from'fs';import a33_0x2b1ae5 from'chalk';import{BaseCommand}from'./command.js';import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';import{parsePath,normalizePath}from'../sdk/segment/segment-path-parser.js';function a33_0x2494(_0xfaab8f,_0x1f6fbd){_0xfaab8f=_0xfaab8f-0x175;const _0x2fe253=a33_0x2fe2();let _0x2494e2=_0x2fe253[_0xfaab8f];return _0x2494e2;}import{findTdxConfig}from'../sdk/segment/tdx-config.js';export class SegmentUseCommand extends BaseCommand{[a33_0x373258(0x17e)]=a33_0x373258(0x1b3);[a33_0x373258(0x18f)]=a33_0x373258(0x1ae);async[a33_0x373258(0x177)](_0x4ee2b0){const _0x4bdebe=a33_0x373258,{options:_0x2bcec4,args:_0x48fd04,tdx:_0x3d40b8}=_0x4ee2b0;if(_0x48fd04[_0x4bdebe(0x1a3)]===0x0)return console[_0x4bdebe(0x1ac)](a33_0x2b1ae5[_0x4bdebe(0x179)]('Error:\x20Path\x20is\x20required\x0a')),console[_0x4bdebe(0x1ac)](_0x4bdebe(0x18b)),console['error'](_0x4bdebe(0x1a5)),console['error']('\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22'),console[_0x4bdebe(0x1ac)](_0x4bdebe(0x187)),console[_0x4bdebe(0x1ac)](_0x4bdebe(0x1a8)),console[_0x4bdebe(0x1ac)]('\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent'),0x1;const _0x1d61de=_0x48fd04[0x0],_0x14b986=_0x2bcec4[_0x4bdebe(0x19a)];try{if(_0x1d61de==='/')return saveSessionContext({'segment_path':undefined},_0x14b986),console[_0x4bdebe(0x198)](a33_0x2b1ae5['green'](_0x4bdebe(0x193))),0x0;if(existsSync(_0x1d61de)&&statSync(_0x1d61de)[_0x4bdebe(0x182)]()){let _0x234183;try{_0x234183=findTdxConfig(_0x1d61de);}catch{return console[_0x4bdebe(0x1ac)](a33_0x2b1ae5[_0x4bdebe(0x179)](_0x4bdebe(0x176)+_0x1d61de)),console['error'](a33_0x2b1ae5[_0x4bdebe(0x18c)](_0x4bdebe(0x196))),0x1;}const _0x2448c9=_0x234183['config'][_0x4bdebe(0x186)];return saveSessionContext({'segment_path':_0x2448c9,'parent_segment':_0x2448c9},_0x14b986),console['log'](a33_0x2b1ae5[_0x4bdebe(0x19c)](_0x4bdebe(0x1aa)+a33_0x2b1ae5[_0x4bdebe(0x18c)](_0x2448c9))),0x0;}const _0x2b5fc8=_0x2bcec4[_0x4bdebe(0x192)];let _0xfade4e=_0x1d61de;const _0x2f83c7=parsePath(_0x1d61de);if(!_0x2f83c7[_0x4bdebe(0x1b0)]){if(!_0x2b5fc8)return console['error'](a33_0x2b1ae5[_0x4bdebe(0x179)](_0x4bdebe(0x197))),console[_0x4bdebe(0x1ac)](a33_0x2b1ae5[_0x4bdebe(0x18c)](_0x4bdebe(0x17d))),0x1;if(_0x1d61de==='..'){const _0xd03aba=_0x2b5fc8[_0x4bdebe(0x190)]('/')[_0x4bdebe(0x199)](0x0,-0x1)[_0x4bdebe(0x19f)]('/');_0xfade4e=_0xd03aba||'/';}else _0x1d61de==='.'?_0xfade4e=_0x2b5fc8:_0xfade4e=_0x2b5fc8+'/'+_0x1d61de;_0x2bcec4['verbose']&&console[_0x4bdebe(0x1ac)](_0x4bdebe(0x1af)+_0xfade4e);}if(_0xfade4e==='/'||_0xfade4e==='')return saveSessionContext({'segment_path':undefined},_0x14b986),console[_0x4bdebe(0x198)](a33_0x2b1ae5[_0x4bdebe(0x19c)](_0x4bdebe(0x193))),0x0;_0xfade4e=normalizePath(_0xfade4e);const _0x531068=parsePath(_0xfade4e)[_0x4bdebe(0x188)];if(_0x531068[_0x4bdebe(0x1a3)]===0x0)return saveSessionContext({'segment_path':undefined},_0x14b986),console['log'](a33_0x2b1ae5[_0x4bdebe(0x19c)](_0x4bdebe(0x193))),0x0;_0x2bcec4['verbose']&&(console[_0x4bdebe(0x1ac)](_0x4bdebe(0x19b)+_0x2bcec4[_0x4bdebe(0x17a)]),console[_0x4bdebe(0x1ac)](_0x4bdebe(0x178)+_0xfade4e));const _0x584f47=await withSpinner(_0x4bdebe(0x185)+_0xfade4e+_0x4bdebe(0x17c),()=>_0x3d40b8['segment'][_0x4bdebe(0x19e)](_0xfade4e),{'verbose':_0x2bcec4[_0x4bdebe(0x1ab)]}),_0x599f20=_0x584f47['data'];_0x2bcec4[_0x4bdebe(0x1ab)]&&(console[_0x4bdebe(0x1ac)](_0x4bdebe(0x181)+_0x599f20[_0x4bdebe(0x191)]),console[_0x4bdebe(0x1ac)](_0x4bdebe(0x17b)+_0x599f20[_0x4bdebe(0x1a2)]),_0x599f20['folderId']&&console['error'](_0x4bdebe(0x1a6)+_0x599f20[_0x4bdebe(0x180)]));if(_0x599f20[_0x4bdebe(0x191)]==='segment')return console['error'](a33_0x2b1ae5[_0x4bdebe(0x179)](_0x4bdebe(0x184))),console[_0x4bdebe(0x1ac)](_0x4bdebe(0x1b2)),console[_0x4bdebe(0x1ac)](a33_0x2b1ae5[_0x4bdebe(0x18c)]('Use:\x20tdx\x20segment\x20use\x20'+_0x599f20[_0x4bdebe(0x194)]+(_0x599f20['folderPath']?'/'+_0x599f20[_0x4bdebe(0x1a9)][_0x4bdebe(0x19f)]('/'):''))),0x1;return saveSessionContext({'segment_path':_0x599f20[_0x4bdebe(0x18a)],'parent_segment':_0x599f20[_0x4bdebe(0x194)]},_0x14b986),console[_0x4bdebe(0x198)](a33_0x2b1ae5['green']('✔\x20Context\x20set\x20to:\x20'+a33_0x2b1ae5[_0x4bdebe(0x18c)](_0x599f20[_0x4bdebe(0x18a)]))),_0x2bcec4['verbose']&&(console[_0x4bdebe(0x1ac)](a33_0x2b1ae5[_0x4bdebe(0x17f)](_0x4bdebe(0x18d))),console[_0x4bdebe(0x1ac)](a33_0x2b1ae5[_0x4bdebe(0x17f)](_0x4bdebe(0x1a1)))),0x0;}catch(_0x345ecd){throw _0x345ecd;}}}
@@ -1 +1 @@
1
- const a34_0x202fda=a34_0x2ed9;(function(_0x1e5d07,_0x96acea){const _0x2a655f=a34_0x2ed9,_0x446c46=_0x1e5d07();while(!![]){try{const _0x2524c0=parseInt(_0x2a655f(0x134))/0x1+parseInt(_0x2a655f(0x125))/0x2*(-parseInt(_0x2a655f(0x141))/0x3)+-parseInt(_0x2a655f(0x13f))/0x4*(parseInt(_0x2a655f(0x11e))/0x5)+parseInt(_0x2a655f(0x14e))/0x6*(parseInt(_0x2a655f(0x145))/0x7)+-parseInt(_0x2a655f(0x140))/0x8+-parseInt(_0x2a655f(0x131))/0x9*(-parseInt(_0x2a655f(0x124))/0xa)+parseInt(_0x2a655f(0x123))/0xb;if(_0x2524c0===_0x96acea)break;else _0x446c46['push'](_0x446c46['shift']());}catch(_0x209af8){_0x446c46['push'](_0x446c46['shift']());}}}(a34_0x3398,0x68ac6));function a34_0x2ed9(_0x51c5f8,_0x4d5309){_0x51c5f8=_0x51c5f8-0x11d;const _0x339883=a34_0x3398();let _0x2ed91d=_0x339883[_0x51c5f8];return _0x2ed91d;}import{BaseCommand}from'./command.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';function a34_0x3398(){const _0x33a121=['segment:validate','cwd','9036ecCpor','.yaml','\x20warning(s)','41214wQcbeH','dim','parentSegment','\x20file(s)\x20with\x20errors,\x20','verbose','execute','invalidCount','\x20file(s)\x20valid','errorCode','warnings','red','188LVtVCN','6159560vPZmzl','3iUEDlc','\x20error(s)','yellow','errors','392ZKqdxZ','description','\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','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','error','targetDir','Usage:\x20tdx\x20sg\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)','warningCount','cyan','29334TBrxZC','helpText','name','message','76530AzuFbf','type','validCount','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','✔\x20All\x20','16752472VVcfNG','940xoCZtW','28514jhGaMH','):\x20','.yml','log','green','\x20valid','length','endsWith','Error:\x20Directory\x20not\x20found:\x20','file'];a34_0x3398=function(){return _0x33a121;};return a34_0x3398();}import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';import a34_0x272416 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{[a34_0x202fda(0x150)]=a34_0x202fda(0x12f);[a34_0x202fda(0x146)]='Validate\x20segment\x20and\x20journey\x20YAML\x20files';async[a34_0x202fda(0x139)](_0x38a6fa){const _0x365173=a34_0x202fda,{options:_0x1ce665,args:_0x4fd2ec}=_0x38a6fa,_0x2e9e3b=_0x1ce665,_0x431fee=await resolveTarget({'arg':_0x4fd2ec[0x0],'contextParent':_0x1ce665[_0x365173(0x136)],'cwd':process[_0x365173(0x130)]()});if(!isSuccessfulResolution(_0x431fee))return _0x431fee[_0x365173(0x13c)]==='no_parent'?(console['error'](a34_0x272416['yellow'](_0x365173(0x148))),console['error'](_0x365173(0x14b)),console['error'](_0x365173(0x147)),console[_0x365173(0x149)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file')):(console[_0x365173(0x149)](a34_0x272416[_0x365173(0x13e)]('Error:\x20'+_0x431fee[_0x365173(0x11d)]+'\x0a')),_0x431fee[_0x365173(0x14f)]&&console['error'](a34_0x272416[_0x365173(0x14d)](_0x431fee[_0x365173(0x14f)]))),0x1;const _0x3d076e=_0x431fee[_0x365173(0x14a)],_0x2f57ac=_0x431fee[_0x365173(0x11f)]===_0x365173(0x12e)?_0x431fee['filePath']:undefined;if(!_0x2f57ac&&!existsSync(_0x3d076e))return console[_0x365173(0x149)](a34_0x272416[_0x365173(0x13e)](_0x365173(0x12d)+_0x3d076e+'\x0a')),0x1;let _0x164040;if(_0x2f57ac){if(!_0x2f57ac[_0x365173(0x12c)](_0x365173(0x127))&&!_0x2f57ac[_0x365173(0x12c)](_0x365173(0x132)))return console['error'](a34_0x272416[_0x365173(0x13e)]('Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20'+_0x2f57ac+'\x0a')),0x1;_0x164040=[_0x2f57ac];}else _0x164040=findYamlFiles(_0x3d076e);if(_0x164040['length']===0x0)return console['error'](a34_0x272416[_0x365173(0x13e)](_0x365173(0x121)+_0x3d076e+'\x0a')),0x1;const _0xe10a97=validateYamlFiles(_0x164040,_0x3d076e),_0x720474=calculateSummary(_0xe10a97);for(const _0x1aba7d of _0xe10a97){if(!isValidationResult(_0x1aba7d))continue;const {relativePath:_0x2419c4,source:_0x2b7a39,result:_0xbf0485,fileType:_0xa9141}=_0x1aba7d,_0x1ebdcc=_0xa9141;if(_0xbf0485['valid']&&_0xbf0485['warnings']['length']===0x0)_0x2e9e3b[_0x365173(0x138)]&&console[_0x365173(0x128)](a34_0x272416['green']('✔\x20'+_0x2419c4)+a34_0x272416['dim']('\x20('+_0x1ebdcc+')'));else _0xbf0485['valid']?(console[_0x365173(0x128)](a34_0x272416[_0x365173(0x143)]('⚠\x20'+_0x2419c4)+a34_0x272416['dim']('\x20('+_0x1ebdcc+_0x365173(0x126)+_0xbf0485[_0x365173(0x13d)][_0x365173(0x12b)]+_0x365173(0x133))),console['log'](formatValidationResult(_0xbf0485,_0x2b7a39,_0x2419c4))):(console[_0x365173(0x128)](a34_0x272416[_0x365173(0x13e)]('✖\x20'+_0x2419c4)+a34_0x272416[_0x365173(0x135)]('\x20('+_0x1ebdcc+_0x365173(0x126)+_0xbf0485[_0x365173(0x144)]['length']+_0x365173(0x142))),console[_0x365173(0x128)](formatValidationResult(_0xbf0485,_0x2b7a39,_0x2419c4)));}return console['log'](''),_0x720474['hasErrors']?(console[_0x365173(0x128)](a34_0x272416['red']('Validation\x20failed:\x20'+_0x720474[_0x365173(0x13a)]+_0x365173(0x137)+_0x720474['validCount']+_0x365173(0x12a))),_0x720474[_0x365173(0x14c)]>0x0&&console[_0x365173(0x128)](a34_0x272416[_0x365173(0x143)](_0x720474[_0x365173(0x14c)]+'\x20warning(s)\x20found')),0x1):(console[_0x365173(0x128)](a34_0x272416[_0x365173(0x129)](_0x365173(0x122)+_0x720474[_0x365173(0x120)]+_0x365173(0x13b))),_0x720474[_0x365173(0x14c)]>0x0&&console[_0x365173(0x128)](a34_0x272416['yellow'](_0x720474[_0x365173(0x14c)]+'\x20warning(s)\x20found')),0x0);}}
1
+ function a34_0x123b(){const _0x484931=['no_parent','\x20warning(s)\x20found','Error:\x20Directory\x20not\x20found:\x20','warningCount','description','validCount','file','dim','hasErrors','15993YlmCgy','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file','parentSegment','warnings','5133989nUsUJX','cwd','red','error','type','6lcWcPE','message','length','510135yHNdJR','128209nOwqXW','log','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','\x20warning(s)','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','):\x20','19867650KFtoDo','green','yellow','targetDir','\x20file(s)\x20valid','execute','name','3530312VgxlzU','4472SdUjZa','errors','invalidCount','\x20error(s)','filePath','helpText','Error:\x20','endsWith','\x20valid','\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','847948uBssJu','\x20file(s)\x20with\x20errors,\x20','Validation\x20failed:\x20','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','valid','.yaml','segment:validate','Usage:\x20tdx\x20sg\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)','cyan','5EYZYsY'];a34_0x123b=function(){return _0x484931;};return a34_0x123b();}const a34_0x18fc5a=a34_0x2ad7;(function(_0x2d1542,_0x58f1cb){const _0xae82bf=a34_0x2ad7,_0x35907d=_0x2d1542();while(!![]){try{const _0x593710=parseInt(_0xae82bf(0xb8))/0x1+-parseInt(_0xae82bf(0xd0))/0x2+-parseInt(_0xae82bf(0xb7))/0x3+parseInt(_0xae82bf(0xc5))/0x4*(-parseInt(_0xae82bf(0xd9))/0x5)+-parseInt(_0xae82bf(0xb4))/0x6*(parseInt(_0xae82bf(0xaf))/0x7)+-parseInt(_0xae82bf(0xc6))/0x8*(-parseInt(_0xae82bf(0xab))/0x9)+parseInt(_0xae82bf(0xbe))/0xa;if(_0x593710===_0x58f1cb)break;else _0x35907d['push'](_0x35907d['shift']());}catch(_0x4c7fa7){_0x35907d['push'](_0x35907d['shift']());}}}(a34_0x123b,0xdb4f5));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 a34_0x1e0a3f from'chalk';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';function a34_0x2ad7(_0x1bc5ed,_0x51891c){_0x1bc5ed=_0x1bc5ed-0xab;const _0x123b29=a34_0x123b();let _0x2ad7fc=_0x123b29[_0x1bc5ed];return _0x2ad7fc;}import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class SegmentValidateCommand extends BaseCommand{[a34_0x18fc5a(0xc4)]=a34_0x18fc5a(0xd6);[a34_0x18fc5a(0xde)]='Validate\x20segment\x20and\x20journey\x20YAML\x20files';async[a34_0x18fc5a(0xc3)](_0x2d8c2c){const _0x254cf0=a34_0x18fc5a,{options:_0xc4de26,args:_0x4f586b}=_0x2d8c2c,_0x500260=_0xc4de26,_0x5fe7cf=await resolveTarget({'arg':_0x4f586b[0x0],'contextParent':_0xc4de26[_0x254cf0(0xad)],'cwd':process[_0x254cf0(0xb0)]()});if(!isSuccessfulResolution(_0x5fe7cf))return _0x5fe7cf['errorCode']===_0x254cf0(0xda)?(console[_0x254cf0(0xb2)](a34_0x1e0a3f[_0x254cf0(0xc0)](_0x254cf0(0xba))),console[_0x254cf0(0xb2)](_0x254cf0(0xd7)),console[_0x254cf0(0xb2)](_0x254cf0(0xcf)),console['error'](_0x254cf0(0xac))):(console[_0x254cf0(0xb2)](a34_0x1e0a3f[_0x254cf0(0xb1)](_0x254cf0(0xcc)+_0x5fe7cf[_0x254cf0(0xb5)]+'\x0a')),_0x5fe7cf['helpText']&&console['error'](a34_0x1e0a3f[_0x254cf0(0xd8)](_0x5fe7cf[_0x254cf0(0xcb)]))),0x1;const _0x110504=_0x5fe7cf[_0x254cf0(0xc1)],_0x16335f=_0x5fe7cf[_0x254cf0(0xb3)]===_0x254cf0(0xe0)?_0x5fe7cf[_0x254cf0(0xca)]:undefined;if(!_0x16335f&&!existsSync(_0x110504))return console[_0x254cf0(0xb2)](a34_0x1e0a3f[_0x254cf0(0xb1)](_0x254cf0(0xdc)+_0x110504+'\x0a')),0x1;let _0x53b476;if(_0x16335f){if(!_0x16335f[_0x254cf0(0xcd)]('.yml')&&!_0x16335f[_0x254cf0(0xcd)](_0x254cf0(0xd5)))return console[_0x254cf0(0xb2)](a34_0x1e0a3f['red'](_0x254cf0(0xd3)+_0x16335f+'\x0a')),0x1;_0x53b476=[_0x16335f];}else _0x53b476=findYamlFiles(_0x110504);if(_0x53b476[_0x254cf0(0xb6)]===0x0)return console['error'](a34_0x1e0a3f[_0x254cf0(0xb1)](_0x254cf0(0xbc)+_0x110504+'\x0a')),0x1;const _0x5f7f13=validateYamlFiles(_0x53b476,_0x110504),_0x539025=calculateSummary(_0x5f7f13);for(const _0x14cf4b of _0x5f7f13){if(!isValidationResult(_0x14cf4b))continue;const {relativePath:_0x17d84d,source:_0x56c0ac,result:_0x17812b,fileType:_0x251e8c}=_0x14cf4b,_0x3e8db5=_0x251e8c;if(_0x17812b[_0x254cf0(0xd4)]&&_0x17812b[_0x254cf0(0xae)]['length']===0x0)_0x500260['verbose']&&console[_0x254cf0(0xb9)](a34_0x1e0a3f[_0x254cf0(0xbf)]('✔\x20'+_0x17d84d)+a34_0x1e0a3f[_0x254cf0(0xe1)]('\x20('+_0x3e8db5+')'));else _0x17812b[_0x254cf0(0xd4)]?(console[_0x254cf0(0xb9)](a34_0x1e0a3f[_0x254cf0(0xc0)]('⚠\x20'+_0x17d84d)+a34_0x1e0a3f[_0x254cf0(0xe1)]('\x20('+_0x3e8db5+_0x254cf0(0xbd)+_0x17812b[_0x254cf0(0xae)][_0x254cf0(0xb6)]+_0x254cf0(0xbb))),console[_0x254cf0(0xb9)](formatValidationResult(_0x17812b,_0x56c0ac,_0x17d84d))):(console['log'](a34_0x1e0a3f[_0x254cf0(0xb1)]('✖\x20'+_0x17d84d)+a34_0x1e0a3f[_0x254cf0(0xe1)]('\x20('+_0x3e8db5+_0x254cf0(0xbd)+_0x17812b[_0x254cf0(0xc7)][_0x254cf0(0xb6)]+_0x254cf0(0xc9))),console[_0x254cf0(0xb9)](formatValidationResult(_0x17812b,_0x56c0ac,_0x17d84d)));}return console['log'](''),_0x539025[_0x254cf0(0xe2)]?(console[_0x254cf0(0xb9)](a34_0x1e0a3f[_0x254cf0(0xb1)](_0x254cf0(0xd2)+_0x539025[_0x254cf0(0xc8)]+_0x254cf0(0xd1)+_0x539025[_0x254cf0(0xdf)]+_0x254cf0(0xce))),_0x539025[_0x254cf0(0xdd)]>0x0&&console['log'](a34_0x1e0a3f['yellow'](_0x539025[_0x254cf0(0xdd)]+_0x254cf0(0xdb))),0x1):(console[_0x254cf0(0xb9)](a34_0x1e0a3f['green']('✔\x20All\x20'+_0x539025[_0x254cf0(0xdf)]+_0x254cf0(0xc2))),_0x539025['warningCount']>0x0&&console['log'](a34_0x1e0a3f[_0x254cf0(0xc0)](_0x539025[_0x254cf0(0xdd)]+_0x254cf0(0xdb))),0x0);}}
@@ -1 +1 @@
1
- const a35_0x442d58=a35_0x3ddf;(function(_0x39d229,_0x144628){const _0x5839d0=a35_0x3ddf,_0x296343=_0x39d229();while(!![]){try{const _0x3be87a=parseInt(_0x5839d0(0x1ee))/0x1+parseInt(_0x5839d0(0x1d7))/0x2*(parseInt(_0x5839d0(0x1d1))/0x3)+-parseInt(_0x5839d0(0x1e1))/0x4+parseInt(_0x5839d0(0x202))/0x5+parseInt(_0x5839d0(0x1d9))/0x6+-parseInt(_0x5839d0(0x217))/0x7+-parseInt(_0x5839d0(0x1ce))/0x8;if(_0x3be87a===_0x144628)break;else _0x296343['push'](_0x296343['shift']());}catch(_0x4aa443){_0x296343['push'](_0x296343['shift']());}}}(a35_0x3084,0x4349b));function a35_0x3ddf(_0x1db2db,_0x54c7ed){_0x1db2db=_0x1db2db-0x1cd;const _0x3084c6=a35_0x3084();let _0x3ddf8b=_0x3084c6[_0x1db2db];return _0x3ddf8b;}import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{formatFlatList,formatTree}from'../sdk/util/tree-formatter.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import a35_0x1d6dbb from'chalk';function a35_0x3084(){const _0x257c01=['476731DYgLlp','dim','folders','segments','folderId','(not\x20set)','segment','resolvePathToResource','recursive','children','\x20journey','Folder/pattern\x20arg:\x20','/j/da','Recursive\x20mode:\x20enabled','(empty)','listWithPattern','/app/ps/','✔\x20Built\x20tree\x20with\x20','\x20matching\x20\x27','\x27...','487620QgTJIN','\x20\x20tdx\x20sg\x20use\x20\x22My\x20Audience\x22','includes','journeyBundleName','site',']\x20matching\x20\x27','✔\x20Found\x20','\x20folder','parentId','verbose','cause','type','test','Building\x20hierarchy\x20tree...','Use\x20tdx\x20ps\x20list\x20to\x20see\x20available\x20parent\x20segments.','Resolving\x20path\x20\x27','localeCompare','folder','journey','Error:\x20','length','154336PTpCrP','name',',\x20and\x20','7841168YrxUds','\x20segment','replace','990393YkJIIA','Parent\x20segment\x20context:\x20','Parent\x20ID:\x20','listUnifiedWithJourneys','Resolving\x20parent\x20segment\x20\x27','\x20\x20tdx\x20sg\x20pull\x20\x22My\x20Audience\x22','2nVMFCc','maxDepth','2666856nZouzX','map','json','filter','listRecursive','List\x20folders\x20and\x20child\x20segments','Error:\x20No\x20parent\x20segment\x20context\x20set.','Site:\x20','284228MBzwqR','jsonl','sort','listUnified','/e/','error','log','Folder\x20ID:\x20','description','data','No\x20items\x20match\x20pattern:\x20','format','journeys'];a35_0x3084=function(){return _0x257c01;};return a35_0x3084();}export class SegmentsCommand extends BaseCommand{[a35_0x442d58(0x218)]=a35_0x442d58(0x1f1);[a35_0x442d58(0x1e9)]=a35_0x442d58(0x1de);async['execute'](_0x4255c6){const _0x46d286=a35_0x442d58,{options:_0x322930,args:_0x5c0da9}=_0x4255c6,_0x4986ba=_0x322930[_0x46d286(0x1f6)],_0x30758e=_0x5c0da9[0x0];try{const _0x162fc3=_0x322930['parentSegment'];_0x322930[_0x46d286(0x20b)]&&(console[_0x46d286(0x1e6)](_0x46d286(0x1e0)+_0x322930[_0x46d286(0x206)]),console[_0x46d286(0x1e6)](_0x46d286(0x1d2)+(_0x162fc3||_0x46d286(0x1f3))),_0x30758e&&console['error'](_0x46d286(0x1f9)+_0x30758e),_0x4986ba&&console['error'](_0x46d286(0x1fb)));if(!_0x162fc3)return console['error'](_0x46d286(0x1df)),console[_0x46d286(0x1e6)](''),console[_0x46d286(0x1e6)]('Set\x20a\x20parent\x20segment\x20context\x20first:'),console[_0x46d286(0x1e6)](_0x46d286(0x1d6)),console[_0x46d286(0x1e6)](_0x46d286(0x203)),console[_0x46d286(0x1e6)](''),console[_0x46d286(0x1e6)](_0x46d286(0x210)),0x1;const _0x1050ba=_0x30758e&&(_0x30758e[_0x46d286(0x204)]('*')||_0x30758e[_0x46d286(0x204)]('?'));if(_0x1050ba)return await this['listWithPattern'](_0x4255c6,_0x162fc3,_0x30758e);const _0x16b883=_0x30758e?_0x162fc3+'/'+_0x30758e:_0x162fc3;return _0x4986ba?await this[_0x46d286(0x1dd)](_0x4255c6,_0x16b883):await this[_0x46d286(0x1e4)](_0x4255c6,_0x16b883);}catch(_0x80c49e){if(_0x80c49e instanceof SDKError)return console[_0x46d286(0x1e6)](_0x46d286(0x215)+_0x80c49e['message']),_0x80c49e['cause']&&console['error']('\x20\x20Cause:\x20'+_0x80c49e[_0x46d286(0x20c)]),0x1;throw _0x80c49e;}}async[a35_0x442d58(0x1fd)](_0x171afc,_0x5aba00,_0x3e6cba){const _0x308a52=a35_0x442d58,{options:_0x53200e,tdx:_0x4c9bae}=_0x171afc,_0x19c742=await withSpinner(_0x308a52(0x1d5)+_0x5aba00+_0x308a52(0x201),()=>_0x4c9bae[_0x308a52(0x1f4)][_0x308a52(0x1f5)](_0x5aba00),{'verbose':_0x53200e[_0x308a52(0x20b)]}),_0x552e0a=_0x19c742[_0x308a52(0x1ea)],_0x29764c=await withSpinner('Listing\x20folders,\x20segments,\x20and\x20journeys...',()=>_0x4c9bae[_0x308a52(0x1f4)][_0x308a52(0x1d4)](_0x552e0a[_0x308a52(0x20a)],_0x552e0a[_0x308a52(0x1f2)]),{'verbose':_0x53200e[_0x308a52(0x20b)]}),{folders:_0x75e1aa,segments:_0x3d4241,journeys:_0x3c6b10}=_0x29764c[_0x308a52(0x1ea)],_0x5cf29b=_0x3e6cba['replace'](/[.+^${}()|[\]\\]/g,'\x5c$&')[_0x308a52(0x1d0)](/\*/g,'.*')[_0x308a52(0x1d0)](/\?/g,'.'),_0x3b8d80=new RegExp('^'+_0x5cf29b+'$','i'),_0x16c249=_0x75e1aa[_0x308a52(0x1dc)](_0x414e3e=>_0x3b8d80[_0x308a52(0x20e)](_0x414e3e[_0x308a52(0x218)])),_0x199e4=_0x3d4241['filter'](_0x39a745=>_0x3b8d80['test'](_0x39a745['name'])),_0x5b3e5c=_0x3c6b10[_0x308a52(0x1dc)](_0x3166a4=>_0x3b8d80['test'](_0x3166a4[_0x308a52(0x205)])),_0x4a1530=_0x16c249[_0x308a52(0x216)]+_0x199e4[_0x308a52(0x216)]+_0x5b3e5c[_0x308a52(0x216)];console['error']('✔\x20Found\x20'+_0x16c249[_0x308a52(0x216)]+_0x308a52(0x209)+(_0x16c249[_0x308a52(0x216)]!==0x1?'s':'')+',\x20'+_0x199e4[_0x308a52(0x216)]+_0x308a52(0x1cf)+(_0x199e4[_0x308a52(0x216)]!==0x1?'s':'')+_0x308a52(0x1cd)+_0x5b3e5c['length']+_0x308a52(0x1f8)+(_0x5b3e5c[_0x308a52(0x216)]!==0x1?'s':'')+_0x308a52(0x200)+_0x3e6cba+'\x27');const _0x3f3539=_0x32ec2f=>{const _0x4de1fb=_0x308a52;return getConsoleNextUrl(_0x53200e[_0x4de1fb(0x206)],_0x4de1fb(0x1fe)+_0x552e0a[_0x4de1fb(0x20a)]+_0x4de1fb(0x1e5)+_0x32ec2f);},_0x100cd4=_0x53200e[_0x308a52(0x1ec)]==='json'||_0x53200e['format']===_0x308a52(0x1e2);if(_0x100cd4){const _0x3ad91f=[..._0x16c249['map'](_0x30e869=>({..._0x30e869,'type':_0x308a52(0x213)})),..._0x199e4[_0x308a52(0x1da)](_0x5749eb=>({..._0x5749eb,'type':'segment','url':_0x3f3539(_0x5749eb['id'])})),..._0x5b3e5c[_0x308a52(0x1da)](_0x27acb8=>({..._0x27acb8,'name':_0x27acb8[_0x308a52(0x205)],'type':'journey'}))][_0x308a52(0x1e3)]((_0x41eb20,_0x5c5f7f)=>_0x41eb20[_0x308a52(0x218)][_0x308a52(0x212)](_0x5c5f7f[_0x308a52(0x218)]));await handleSDKOutput(_0x3ad91f,_0x53200e);}else{if(_0x4a1530===0x0)console[_0x308a52(0x1e7)](_0x308a52(0x1eb)+_0x3e6cba);else{console[_0x308a52(0x1e7)](a35_0x1d6dbb[_0x308a52(0x1ef)]('['+_0x5aba00+_0x308a52(0x207)+_0x3e6cba+'\x27'));const _0x44f4a7=formatFlatList(_0x16c249,_0x199e4,{'showMetadata':!![],'getSegmentUrl':_0x3f3539},_0x5b3e5c);console[_0x308a52(0x1e7)](_0x44f4a7);}}return 0x0;}async[a35_0x442d58(0x1e4)](_0x1b4f62,_0x1dbb2e){const _0x598b2e=a35_0x442d58,{options:_0x5c0e50,tdx:_0xf5cf80}=_0x1b4f62,_0x46dc54=await withSpinner(_0x598b2e(0x211)+_0x1dbb2e+'\x27...',()=>_0xf5cf80[_0x598b2e(0x1f4)][_0x598b2e(0x1f5)](_0x1dbb2e),{'verbose':_0x5c0e50[_0x598b2e(0x20b)]}),_0x4fba29=_0x46dc54['data'];_0x5c0e50[_0x598b2e(0x20b)]&&(console[_0x598b2e(0x1e6)](_0x598b2e(0x1d3)+_0x4fba29['parentId']),_0x4fba29[_0x598b2e(0x1f2)]&&console[_0x598b2e(0x1e6)](_0x598b2e(0x1e8)+_0x4fba29['folderId']));const _0x1f5c5c=await withSpinner('Listing\x20folders,\x20segments,\x20and\x20journeys...',()=>_0xf5cf80[_0x598b2e(0x1f4)]['listUnifiedWithJourneys'](_0x4fba29['parentId'],_0x4fba29[_0x598b2e(0x1f2)]),{'verbose':_0x5c0e50[_0x598b2e(0x20b)]}),{folders:_0x45ceb1,segments:_0x443b7f,journeys:_0x22cbe4}=_0x1f5c5c['data'],_0x4198b6=_0x45ceb1['length']+_0x443b7f['length']+_0x22cbe4['length'];console[_0x598b2e(0x1e6)](_0x598b2e(0x208)+_0x45ceb1[_0x598b2e(0x216)]+_0x598b2e(0x209)+(_0x45ceb1['length']!==0x1?'s':'')+',\x20'+_0x443b7f['length']+_0x598b2e(0x1cf)+(_0x443b7f[_0x598b2e(0x216)]!==0x1?'s':'')+',\x20and\x20'+_0x22cbe4[_0x598b2e(0x216)]+_0x598b2e(0x1f8)+(_0x22cbe4[_0x598b2e(0x216)]!==0x1?'s':''));const _0x5aebc6=_0x5a5276=>{const _0x4711fe=_0x598b2e;return getConsoleNextUrl(_0x5c0e50[_0x4711fe(0x206)],_0x4711fe(0x1fe)+_0x4fba29['parentId']+_0x4711fe(0x1e5)+_0x5a5276);},_0x283145=_0x688823=>{const _0x2b44fc=_0x598b2e;return getConsoleNextUrl(_0x5c0e50['site'],_0x2b44fc(0x1fe)+_0x4fba29[_0x2b44fc(0x20a)]+_0x2b44fc(0x1e5)+_0x688823+_0x2b44fc(0x1fa));},_0x4719da=_0x5c0e50[_0x598b2e(0x1ec)]===_0x598b2e(0x1db)||_0x5c0e50[_0x598b2e(0x1ec)]===_0x598b2e(0x1e2);if(_0x4719da){const _0x47462c=[..._0x45ceb1['map'](_0x1ffd0c=>({..._0x1ffd0c,'type':_0x598b2e(0x213)})),..._0x443b7f[_0x598b2e(0x1da)](_0x47055f=>({..._0x47055f,'type':_0x598b2e(0x1f4),'url':_0x5aebc6(_0x47055f['id'])})),..._0x22cbe4[_0x598b2e(0x1da)](_0x2903e6=>({..._0x2903e6,'name':_0x2903e6[_0x598b2e(0x205)],'type':_0x598b2e(0x214),'url':_0x283145(_0x2903e6['id'])}))][_0x598b2e(0x1e3)]((_0x89c7fe,_0x320b26)=>_0x89c7fe[_0x598b2e(0x218)][_0x598b2e(0x212)](_0x320b26['name']));await handleSDKOutput(_0x47462c,_0x5c0e50);}else{if(_0x4198b6===0x0)console[_0x598b2e(0x1e7)](a35_0x1d6dbb[_0x598b2e(0x1ef)]('['+_0x1dbb2e+']')),console[_0x598b2e(0x1e7)](_0x598b2e(0x1fc));else{console[_0x598b2e(0x1e7)](a35_0x1d6dbb[_0x598b2e(0x1ef)]('['+_0x1dbb2e+']'));const _0x3d8c71=formatFlatList(_0x45ceb1,_0x443b7f,{'showMetadata':!![],'getSegmentUrl':_0x5aebc6,'getJourneyUrl':_0x283145},_0x22cbe4);console[_0x598b2e(0x1e7)](_0x3d8c71);}}return 0x0;}async[a35_0x442d58(0x1dd)](_0x1168df,_0x4922c5){const _0x4143a5=a35_0x442d58,{options:_0x132f13,tdx:_0x1a154e}=_0x1168df,_0x34f380=await withSpinner(_0x4143a5(0x211)+_0x4922c5+_0x4143a5(0x201),()=>_0x1a154e['segment']['resolvePathToResource'](_0x4922c5),{'verbose':_0x132f13['verbose']}),_0x8d705c=_0x34f380[_0x4143a5(0x1ea)];_0x132f13[_0x4143a5(0x20b)]&&(console['error'](_0x4143a5(0x1d3)+_0x8d705c[_0x4143a5(0x20a)]),_0x8d705c[_0x4143a5(0x1f2)]&&console[_0x4143a5(0x1e6)]('Folder\x20ID:\x20'+_0x8d705c['folderId']));const _0xe3228f=_0x132f13[_0x4143a5(0x1d8)]||0xa,_0x54b693=await withSpinner(_0x4143a5(0x20f),()=>_0x1a154e[_0x4143a5(0x1f4)][_0x4143a5(0x1dd)](_0x8d705c[_0x4143a5(0x20a)],_0x8d705c[_0x4143a5(0x1f2)],0x0,_0xe3228f),{'verbose':_0x132f13[_0x4143a5(0x20b)]}),_0x9835da=_0x54b693[_0x4143a5(0x1ea)],_0x4f0bb1=_0x112c04=>{const _0x1d9dee=_0x4143a5;let _0x246627=0x0,_0x289fa6=0x0,_0xea28a3=0x0;for(const _0x35c6e7 of _0x112c04){if(_0x35c6e7[_0x1d9dee(0x20d)]===_0x1d9dee(0x213))_0x246627++;else{if(_0x35c6e7['type']===_0x1d9dee(0x1f4))_0x289fa6++;else{if(_0x35c6e7[_0x1d9dee(0x20d)]===_0x1d9dee(0x214))_0xea28a3++;}}if(_0x35c6e7[_0x1d9dee(0x1f7)]){const _0x2d7e4f=_0x4f0bb1(_0x35c6e7[_0x1d9dee(0x1f7)]);_0x246627+=_0x2d7e4f['folders'],_0x289fa6+=_0x2d7e4f[_0x1d9dee(0x1f1)],_0xea28a3+=_0x2d7e4f['journeys'];}}return{'folders':_0x246627,'segments':_0x289fa6,'journeys':_0xea28a3};},_0x149712=_0x4f0bb1(_0x9835da);console[_0x4143a5(0x1e6)](_0x4143a5(0x1ff)+_0x149712[_0x4143a5(0x1f0)]+'\x20folder'+(_0x149712[_0x4143a5(0x1f0)]!==0x1?'s':'')+',\x20'+_0x149712[_0x4143a5(0x1f1)]+_0x4143a5(0x1cf)+(_0x149712['segments']!==0x1?'s':'')+_0x4143a5(0x1cd)+_0x149712[_0x4143a5(0x1ed)]+_0x4143a5(0x1f8)+(_0x149712[_0x4143a5(0x1ed)]!==0x1?'s':''));const _0x3aa097=_0x53b03e=>{const _0x47239f=_0x4143a5;return getConsoleNextUrl(_0x132f13[_0x47239f(0x206)],_0x47239f(0x1fe)+_0x8d705c[_0x47239f(0x20a)]+'/e/'+_0x53b03e);},_0x57ce20=_0x2b48c6=>{const _0x5371a1=_0x4143a5;return getConsoleNextUrl(_0x132f13[_0x5371a1(0x206)],_0x5371a1(0x1fe)+_0x8d705c[_0x5371a1(0x20a)]+_0x5371a1(0x1e5)+_0x2b48c6+_0x5371a1(0x1fa));};if(_0x132f13[_0x4143a5(0x1ec)]==='json'||_0x132f13[_0x4143a5(0x1ec)]===_0x4143a5(0x1e2))await handleSDKOutput(_0x9835da,_0x132f13);else{console[_0x4143a5(0x1e7)](a35_0x1d6dbb['dim']('['+_0x4922c5+']'));const _0x33239f=formatTree(_0x9835da,{'showMetadata':!![],'getSegmentUrl':_0x3aa097,'getJourneyUrl':_0x57ce20});console['log'](_0x33239f);}return 0x0;}}
1
+ const a35_0x2be35d=a35_0x42bd;(function(_0x4dabbd,_0x6e8547){const _0x4ab718=a35_0x42bd,_0xaf522c=_0x4dabbd();while(!![]){try{const _0x485807=parseInt(_0x4ab718(0x11c))/0x1*(-parseInt(_0x4ab718(0xf6))/0x2)+parseInt(_0x4ab718(0xfd))/0x3+-parseInt(_0x4ab718(0xf0))/0x4*(-parseInt(_0x4ab718(0x116))/0x5)+-parseInt(_0x4ab718(0xd4))/0x6*(-parseInt(_0x4ab718(0xce))/0x7)+-parseInt(_0x4ab718(0xfa))/0x8*(parseInt(_0x4ab718(0xd0))/0x9)+-parseInt(_0x4ab718(0xec))/0xa+-parseInt(_0x4ab718(0xdb))/0xb;if(_0x485807===_0x6e8547)break;else _0xaf522c['push'](_0xaf522c['shift']());}catch(_0x3b7b59){_0xaf522c['push'](_0xaf522c['shift']());}}}(a35_0x205b,0x3bc39));import{BaseCommand}from'./command.js';function a35_0x205b(){const _0x335242=['✔\x20Found\x20','616924TBwzBP','\x5c$&','error','No\x20items\x20match\x20pattern:\x20','Set\x20a\x20parent\x20segment\x20context\x20first:','recursive','log','\x20matching\x20\x27','listUnified','filter','children',',\x20and\x20','type','journey','dim','Recursive\x20mode:\x20enabled','journeyBundleName','3398990RbmLkO','\x27...','Error:\x20','includes','24jjjCUG','/app/ps/','folder','Resolving\x20parent\x20segment\x20\x27','\x20folder','segments','62jEbHhQ','message','parentId','Error:\x20No\x20parent\x20segment\x20context\x20set.','40cdTFcW','segment','\x20journey','1034685WSvcJv','execute','test','journeys','listWithPattern','format','List\x20folders\x20and\x20child\x20segments','\x20segment','listUnifiedWithJourneys','resolvePathToResource','jsonl','json','✔\x20Built\x20tree\x20with\x20','map','Use\x20tdx\x20ps\x20list\x20to\x20see\x20available\x20parent\x20segments.','Site:\x20','replace','\x20\x20tdx\x20sg\x20use\x20\x22My\x20Audience\x22','folderId','verbose','data','/j/da','description','Parent\x20ID:\x20','Folder\x20ID:\x20','389060fVUaPY','cause','sort','length','Parent\x20segment\x20context:\x20','\x20\x20Cause:\x20','703bGgdCn','Listing\x20folders,\x20segments,\x20and\x20journeys...',']\x20matching\x20\x27','698579dlBxTh','(empty)','448191KKoLjH','parentSegment','/e/','Resolving\x20path\x20\x27','6xhnpAU','Building\x20hierarchy\x20tree...','name','folders','listRecursive','site'];a35_0x205b=function(){return _0x335242;};return a35_0x205b();}function a35_0x42bd(_0x25e13b,_0x5102d4){_0x25e13b=_0x25e13b-0xcd;const _0x205ba6=a35_0x205b();let _0x42bd57=_0x205ba6[_0x25e13b];return _0x42bd57;}import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{formatFlatList,formatTree}from'../sdk/util/tree-formatter.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import a35_0xa56120 from'chalk';export class SegmentsCommand extends BaseCommand{['name']='segments';[a35_0x2be35d(0x113)]=a35_0x2be35d(0x103);async[a35_0x2be35d(0xfe)](_0x1b4d13){const _0x821080=a35_0x2be35d,{options:_0x507a4a,args:_0x1c29c6}=_0x1b4d13,_0x324e97=_0x507a4a[_0x821080(0xe0)],_0x5efc5f=_0x1c29c6[0x0];try{const _0x3da41b=_0x507a4a[_0x821080(0xd1)];_0x507a4a[_0x821080(0x110)]&&(console[_0x821080(0xdd)](_0x821080(0x10c)+_0x507a4a[_0x821080(0xd9)]),console[_0x821080(0xdd)](_0x821080(0x11a)+(_0x3da41b||'(not\x20set)')),_0x5efc5f&&console[_0x821080(0xdd)]('Folder/pattern\x20arg:\x20'+_0x5efc5f),_0x324e97&&console[_0x821080(0xdd)](_0x821080(0xea)));if(!_0x3da41b)return console[_0x821080(0xdd)](_0x821080(0xf9)),console[_0x821080(0xdd)](''),console[_0x821080(0xdd)](_0x821080(0xdf)),console['error']('\x20\x20tdx\x20sg\x20pull\x20\x22My\x20Audience\x22'),console['error'](_0x821080(0x10e)),console[_0x821080(0xdd)](''),console[_0x821080(0xdd)](_0x821080(0x10b)),0x1;const _0x111190=_0x5efc5f&&(_0x5efc5f[_0x821080(0xef)]('*')||_0x5efc5f[_0x821080(0xef)]('?'));if(_0x111190)return await this[_0x821080(0x101)](_0x1b4d13,_0x3da41b,_0x5efc5f);const _0x53e959=_0x5efc5f?_0x3da41b+'/'+_0x5efc5f:_0x3da41b;return _0x324e97?await this[_0x821080(0xd8)](_0x1b4d13,_0x53e959):await this[_0x821080(0xe3)](_0x1b4d13,_0x53e959);}catch(_0x4d4920){if(_0x4d4920 instanceof SDKError)return console['error'](_0x821080(0xee)+_0x4d4920[_0x821080(0xf7)]),_0x4d4920[_0x821080(0x117)]&&console[_0x821080(0xdd)](_0x821080(0x11b)+_0x4d4920['cause']),0x1;throw _0x4d4920;}}async[a35_0x2be35d(0x101)](_0x4e30d3,_0x57310c,_0x254071){const _0x3a9d3d=a35_0x2be35d,{options:_0x571a92,tdx:_0x1ae4d9}=_0x4e30d3,_0x8f683f=await withSpinner(_0x3a9d3d(0xf3)+_0x57310c+_0x3a9d3d(0xed),()=>_0x1ae4d9[_0x3a9d3d(0xfb)][_0x3a9d3d(0x106)](_0x57310c),{'verbose':_0x571a92['verbose']}),_0x3ebed8=_0x8f683f[_0x3a9d3d(0x111)],_0x360216=await withSpinner(_0x3a9d3d(0x11d),()=>_0x1ae4d9['segment'][_0x3a9d3d(0x105)](_0x3ebed8[_0x3a9d3d(0xf8)],_0x3ebed8['folderId']),{'verbose':_0x571a92['verbose']}),{folders:_0x4aa701,segments:_0xfa3057,journeys:_0x30e797}=_0x360216[_0x3a9d3d(0x111)],_0x327cf8=_0x254071[_0x3a9d3d(0x10d)](/[.+^${}()|[\]\\]/g,_0x3a9d3d(0xdc))['replace'](/\*/g,'.*')[_0x3a9d3d(0x10d)](/\?/g,'.'),_0xd688ff=new RegExp('^'+_0x327cf8+'$','i'),_0x2d4c72=_0x4aa701[_0x3a9d3d(0xe4)](_0x21282b=>_0xd688ff[_0x3a9d3d(0xff)](_0x21282b[_0x3a9d3d(0xd6)])),_0x589d34=_0xfa3057['filter'](_0x2356ce=>_0xd688ff['test'](_0x2356ce[_0x3a9d3d(0xd6)])),_0x796af9=_0x30e797[_0x3a9d3d(0xe4)](_0x119f89=>_0xd688ff['test'](_0x119f89[_0x3a9d3d(0xeb)])),_0x5c8aea=_0x2d4c72[_0x3a9d3d(0x119)]+_0x589d34[_0x3a9d3d(0x119)]+_0x796af9[_0x3a9d3d(0x119)];console['error'](_0x3a9d3d(0xda)+_0x2d4c72[_0x3a9d3d(0x119)]+_0x3a9d3d(0xf4)+(_0x2d4c72[_0x3a9d3d(0x119)]!==0x1?'s':'')+',\x20'+_0x589d34['length']+_0x3a9d3d(0x104)+(_0x589d34['length']!==0x1?'s':'')+_0x3a9d3d(0xe6)+_0x796af9[_0x3a9d3d(0x119)]+_0x3a9d3d(0xfc)+(_0x796af9['length']!==0x1?'s':'')+_0x3a9d3d(0xe2)+_0x254071+'\x27');const _0x48b363=_0x48c053=>{const _0x46db6c=_0x3a9d3d;return getConsoleNextUrl(_0x571a92[_0x46db6c(0xd9)],_0x46db6c(0xf1)+_0x3ebed8[_0x46db6c(0xf8)]+_0x46db6c(0xd2)+_0x48c053);},_0x4780c4=_0x571a92[_0x3a9d3d(0x102)]===_0x3a9d3d(0x108)||_0x571a92[_0x3a9d3d(0x102)]===_0x3a9d3d(0x107);if(_0x4780c4){const _0x5b6380=[..._0x2d4c72[_0x3a9d3d(0x10a)](_0xc9fb7a=>({..._0xc9fb7a,'type':'folder'})),..._0x589d34[_0x3a9d3d(0x10a)](_0x56eca3=>({..._0x56eca3,'type':_0x3a9d3d(0xfb),'url':_0x48b363(_0x56eca3['id'])})),..._0x796af9[_0x3a9d3d(0x10a)](_0x5478c0=>({..._0x5478c0,'name':_0x5478c0['journeyBundleName'],'type':_0x3a9d3d(0xe8)}))][_0x3a9d3d(0x118)]((_0x2bfe64,_0x2b845a)=>_0x2bfe64[_0x3a9d3d(0xd6)]['localeCompare'](_0x2b845a['name']));await handleSDKOutput(_0x5b6380,_0x571a92);}else{if(_0x5c8aea===0x0)console['log'](_0x3a9d3d(0xde)+_0x254071);else{console[_0x3a9d3d(0xe1)](a35_0xa56120[_0x3a9d3d(0xe9)]('['+_0x57310c+_0x3a9d3d(0xcd)+_0x254071+'\x27'));const _0x1de26e=formatFlatList(_0x2d4c72,_0x589d34,{'showMetadata':!![],'getSegmentUrl':_0x48b363},_0x796af9);console[_0x3a9d3d(0xe1)](_0x1de26e);}}return 0x0;}async[a35_0x2be35d(0xe3)](_0x448a4d,_0x9ff55b){const _0x58c02e=a35_0x2be35d,{options:_0x36c6f1,tdx:_0xa7f8f4}=_0x448a4d,_0x1bae45=await withSpinner(_0x58c02e(0xd3)+_0x9ff55b+_0x58c02e(0xed),()=>_0xa7f8f4[_0x58c02e(0xfb)][_0x58c02e(0x106)](_0x9ff55b),{'verbose':_0x36c6f1['verbose']}),_0x1bcf2f=_0x1bae45[_0x58c02e(0x111)];_0x36c6f1['verbose']&&(console[_0x58c02e(0xdd)]('Parent\x20ID:\x20'+_0x1bcf2f[_0x58c02e(0xf8)]),_0x1bcf2f[_0x58c02e(0x10f)]&&console['error']('Folder\x20ID:\x20'+_0x1bcf2f['folderId']));const _0x272696=await withSpinner('Listing\x20folders,\x20segments,\x20and\x20journeys...',()=>_0xa7f8f4[_0x58c02e(0xfb)][_0x58c02e(0x105)](_0x1bcf2f['parentId'],_0x1bcf2f[_0x58c02e(0x10f)]),{'verbose':_0x36c6f1[_0x58c02e(0x110)]}),{folders:_0x375354,segments:_0x10c4e9,journeys:_0x4dc9e2}=_0x272696[_0x58c02e(0x111)],_0x7b3779=_0x375354[_0x58c02e(0x119)]+_0x10c4e9['length']+_0x4dc9e2['length'];console['error'](_0x58c02e(0xda)+_0x375354['length']+_0x58c02e(0xf4)+(_0x375354['length']!==0x1?'s':'')+',\x20'+_0x10c4e9[_0x58c02e(0x119)]+_0x58c02e(0x104)+(_0x10c4e9[_0x58c02e(0x119)]!==0x1?'s':'')+',\x20and\x20'+_0x4dc9e2[_0x58c02e(0x119)]+_0x58c02e(0xfc)+(_0x4dc9e2[_0x58c02e(0x119)]!==0x1?'s':''));const _0x45bf52=_0x15c288=>{const _0x29c858=_0x58c02e;return getConsoleNextUrl(_0x36c6f1['site'],_0x29c858(0xf1)+_0x1bcf2f[_0x29c858(0xf8)]+_0x29c858(0xd2)+_0x15c288);},_0x30b117=_0x48f2ac=>{const _0x2936e3=_0x58c02e;return getConsoleNextUrl(_0x36c6f1[_0x2936e3(0xd9)],'/app/ps/'+_0x1bcf2f['parentId']+'/e/'+_0x48f2ac+_0x2936e3(0x112));},_0x2c30cc=_0x36c6f1[_0x58c02e(0x102)]===_0x58c02e(0x108)||_0x36c6f1[_0x58c02e(0x102)]===_0x58c02e(0x107);if(_0x2c30cc){const _0x341d6d=[..._0x375354['map'](_0x10c2fe=>({..._0x10c2fe,'type':'folder'})),..._0x10c4e9[_0x58c02e(0x10a)](_0x8654c3=>({..._0x8654c3,'type':_0x58c02e(0xfb),'url':_0x45bf52(_0x8654c3['id'])})),..._0x4dc9e2[_0x58c02e(0x10a)](_0x3962d9=>({..._0x3962d9,'name':_0x3962d9[_0x58c02e(0xeb)],'type':_0x58c02e(0xe8),'url':_0x30b117(_0x3962d9['id'])}))]['sort']((_0x2b8601,_0x1da6f2)=>_0x2b8601[_0x58c02e(0xd6)]['localeCompare'](_0x1da6f2[_0x58c02e(0xd6)]));await handleSDKOutput(_0x341d6d,_0x36c6f1);}else{if(_0x7b3779===0x0)console[_0x58c02e(0xe1)](a35_0xa56120[_0x58c02e(0xe9)]('['+_0x9ff55b+']')),console[_0x58c02e(0xe1)](_0x58c02e(0xcf));else{console[_0x58c02e(0xe1)](a35_0xa56120[_0x58c02e(0xe9)]('['+_0x9ff55b+']'));const _0x174d7a=formatFlatList(_0x375354,_0x10c4e9,{'showMetadata':!![],'getSegmentUrl':_0x45bf52,'getJourneyUrl':_0x30b117},_0x4dc9e2);console[_0x58c02e(0xe1)](_0x174d7a);}}return 0x0;}async[a35_0x2be35d(0xd8)](_0x3180fb,_0x50f293){const _0xe5286f=a35_0x2be35d,{options:_0x195b6e,tdx:_0x1af324}=_0x3180fb,_0x4c78db=await withSpinner(_0xe5286f(0xd3)+_0x50f293+_0xe5286f(0xed),()=>_0x1af324[_0xe5286f(0xfb)][_0xe5286f(0x106)](_0x50f293),{'verbose':_0x195b6e[_0xe5286f(0x110)]}),_0x159f30=_0x4c78db['data'];_0x195b6e[_0xe5286f(0x110)]&&(console[_0xe5286f(0xdd)](_0xe5286f(0x114)+_0x159f30[_0xe5286f(0xf8)]),_0x159f30['folderId']&&console[_0xe5286f(0xdd)](_0xe5286f(0x115)+_0x159f30[_0xe5286f(0x10f)]));const _0x592d35=_0x195b6e['maxDepth']||0xa,_0x41be93=await withSpinner(_0xe5286f(0xd5),()=>_0x1af324[_0xe5286f(0xfb)][_0xe5286f(0xd8)](_0x159f30[_0xe5286f(0xf8)],_0x159f30[_0xe5286f(0x10f)],0x0,_0x592d35),{'verbose':_0x195b6e['verbose']}),_0x269b57=_0x41be93[_0xe5286f(0x111)],_0x321024=_0x3e3cdd=>{const _0x222b47=_0xe5286f;let _0x403c6a=0x0,_0x3aae74=0x0,_0x2baa27=0x0;for(const _0x19338a of _0x3e3cdd){if(_0x19338a[_0x222b47(0xe7)]===_0x222b47(0xf2))_0x403c6a++;else{if(_0x19338a['type']===_0x222b47(0xfb))_0x3aae74++;else{if(_0x19338a[_0x222b47(0xe7)]==='journey')_0x2baa27++;}}if(_0x19338a['children']){const _0x10aae1=_0x321024(_0x19338a[_0x222b47(0xe5)]);_0x403c6a+=_0x10aae1[_0x222b47(0xd7)],_0x3aae74+=_0x10aae1[_0x222b47(0xf5)],_0x2baa27+=_0x10aae1[_0x222b47(0x100)];}}return{'folders':_0x403c6a,'segments':_0x3aae74,'journeys':_0x2baa27};},_0x4e5961=_0x321024(_0x269b57);console[_0xe5286f(0xdd)](_0xe5286f(0x109)+_0x4e5961[_0xe5286f(0xd7)]+_0xe5286f(0xf4)+(_0x4e5961[_0xe5286f(0xd7)]!==0x1?'s':'')+',\x20'+_0x4e5961[_0xe5286f(0xf5)]+_0xe5286f(0x104)+(_0x4e5961[_0xe5286f(0xf5)]!==0x1?'s':'')+_0xe5286f(0xe6)+_0x4e5961[_0xe5286f(0x100)]+'\x20journey'+(_0x4e5961[_0xe5286f(0x100)]!==0x1?'s':''));const _0x4a01a7=_0x401cb2=>{const _0x4dda88=_0xe5286f;return getConsoleNextUrl(_0x195b6e[_0x4dda88(0xd9)],_0x4dda88(0xf1)+_0x159f30[_0x4dda88(0xf8)]+_0x4dda88(0xd2)+_0x401cb2);},_0x2d7c41=_0x192fa6=>{const _0x12c6a9=_0xe5286f;return getConsoleNextUrl(_0x195b6e['site'],'/app/ps/'+_0x159f30['parentId']+_0x12c6a9(0xd2)+_0x192fa6+_0x12c6a9(0x112));};if(_0x195b6e[_0xe5286f(0x102)]===_0xe5286f(0x108)||_0x195b6e[_0xe5286f(0x102)]===_0xe5286f(0x107))await handleSDKOutput(_0x269b57,_0x195b6e);else{console[_0xe5286f(0xe1)](a35_0xa56120[_0xe5286f(0xe9)]('['+_0x50f293+']'));const _0x1b6649=formatTree(_0x269b57,{'showMetadata':!![],'getSegmentUrl':_0x4a01a7,'getJourneyUrl':_0x2d7c41});console[_0xe5286f(0xe1)](_0x1b6649);}return 0x0;}}
@@ -1 +1 @@
1
- function a36_0x4fe8(){const _0x2902e7=['Error:\x20','\x20\x20Cause:\x20','verbose','database','10274TRaxjz','...','Catalog:\x20','Too\x20many\x20arguments\x0aUsage:\x20tdx\x20show\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>\x0a\x0aRun\x20\x27tdx\x20show\x20--help\x27\x20for\x20more\x20options','\x20row','message','✔\x20Query\x20successful\x20-\x200\x20rows\x20returned','error','256GthOfx','show','\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>','description','length','limit','Limit:\x20','Usage:\x20tdx\x20show\x20<database.table>','cause','11130beHoXB','table','validate','1039339DtdINv','\x20from\x20','Querying\x20','95601168QCFtpJ','site','30897dlfqnm','2367CpnUsV','6824hxRojJ','792hdqYpp','1439049jvFeKh','35925RpIWpw','showTable','\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>','66ZBPFjW','query','Usage:\x20tdx\x20show\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--in\x20<database>\x0a\x0aRun\x20\x27tdx\x20show\x20--help\x27\x20for\x20more\x20options','data'];a36_0x4fe8=function(){return _0x2902e7;};return a36_0x4fe8();}const a36_0x2d6828=a36_0x2db5;(function(_0x3cb967,_0x1dd997){const _0x366930=a36_0x2db5,_0x2c611d=_0x3cb967();while(!![]){try{const _0xe61541=-parseInt(_0x366930(0x170))/0x1+parseInt(_0x366930(0x184))/0x2*(-parseInt(_0x366930(0x16c))/0x3)+-parseInt(_0x366930(0x16f))/0x4*(parseInt(_0x366930(0x171))/0x5)+-parseInt(_0x366930(0x174))/0x6*(parseInt(_0x366930(0x190))/0x7)+parseInt(_0x366930(0x16e))/0x8*(-parseInt(_0x366930(0x16d))/0x9)+-parseInt(_0x366930(0x18d))/0xa*(parseInt(_0x366930(0x17c))/0xb)+parseInt(_0x366930(0x16a))/0xc;if(_0xe61541===_0x1dd997)break;else _0x2c611d['push'](_0x2c611d['shift']());}catch(_0x2e1b27){_0x2c611d['push'](_0x2c611d['shift']());}}}(a36_0x4fe8,0xd9355));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';import{parseTableReference,validateTableDescribeReference}from'../utils/table-ref-parser.js';function a36_0x2db5(_0x19fe77,_0x49243d){_0x19fe77=_0x19fe77-0x168;const _0x4fe8ea=a36_0x4fe8();let _0x2db512=_0x4fe8ea[_0x19fe77];return _0x2db512;}import{withSpinner}from'../utils/spinner.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';export class ShowCommand extends BaseCommand{['name']=a36_0x2d6828(0x185);[a36_0x2d6828(0x187)]='Show\x20table\x20contents';async['execute'](_0x394c62){return this['showTable'](_0x394c62);}async[a36_0x2d6828(0x172)](_0x76ae5){const _0x1e8a38=a36_0x2d6828,{options:_0xb7b32e,args:_0x57b3f3,tdx:_0xebbd53}=_0x76ae5;let _0x3cc1a2;try{_0x3cc1a2=parseTableReference(_0x57b3f3[0x0]);const _0x5c793b=_0xb7b32e[_0x1e8a38(0x17b)];!_0x3cc1a2[_0x1e8a38(0x17b)]&&_0x5c793b&&(_0x3cc1a2[_0x1e8a38(0x17b)]=_0x5c793b);const _0x262672=validateTableDescribeReference(_0x3cc1a2);if(_0x262672)return console['error'](_0x1e8a38(0x178)+_0x262672),console[_0x1e8a38(0x183)](_0x1e8a38(0x18b)),console[_0x1e8a38(0x183)](_0x1e8a38(0x186)),console[_0x1e8a38(0x183)](_0x1e8a38(0x173)),0x1;}catch(_0x838c4b){return console['error'](_0x1e8a38(0x178)+_0x838c4b[_0x1e8a38(0x181)]),console[_0x1e8a38(0x183)](_0x1e8a38(0x18b)),console[_0x1e8a38(0x183)](_0x1e8a38(0x186)),console[_0x1e8a38(0x183)](_0x1e8a38(0x173)),0x1;}const _0x4f1a3e=_0x3cc1a2['catalog'],_0x21a420=_0x3cc1a2['database'],_0xdda4d8=_0x3cc1a2[_0x1e8a38(0x18e)],_0x5ed367=resolveLimit(_0xb7b32e[_0x1e8a38(0x189)],DEFAULT_DISPLAY_LIMIT);try{_0xb7b32e['verbose']&&(console['error']('Site:\x20'+_0xb7b32e[_0x1e8a38(0x16b)]),_0x4f1a3e&&console[_0x1e8a38(0x183)](_0x1e8a38(0x17e)+_0x4f1a3e),console[_0x1e8a38(0x183)]('Database:\x20'+_0x21a420),console[_0x1e8a38(0x183)]('Table:\x20'+_0xdda4d8),console[_0x1e8a38(0x183)](_0x1e8a38(0x18a)+_0x5ed367));const _0x5b52a7=_0x4f1a3e?_0x4f1a3e+'.'+_0x21a420+'.'+_0xdda4d8:_0x21a420+'.'+_0xdda4d8,_0x50c940=await withSpinner(_0x1e8a38(0x169)+_0x5b52a7+_0x1e8a38(0x17d),()=>_0xebbd53[_0x1e8a38(0x175)][_0x1e8a38(0x172)](_0x21a420,_0xdda4d8,_0x5ed367,_0x4f1a3e),{'verbose':_0xb7b32e[_0x1e8a38(0x17a)]}),_0x3c4303=_0x50c940['data'],_0x4a74dd=_0x3c4303[_0x1e8a38(0x177)];return _0x4a74dd[_0x1e8a38(0x188)]===0x0?console[_0x1e8a38(0x183)](_0x1e8a38(0x182)):console[_0x1e8a38(0x183)]('✔\x20Retrieved\x20'+_0x4a74dd[_0x1e8a38(0x188)]+_0x1e8a38(0x180)+(_0x4a74dd[_0x1e8a38(0x188)]!==0x1?'s':'')+_0x1e8a38(0x168)+_0x5b52a7),await handleSDKOutput(_0x4a74dd,_0xb7b32e),0x0;}catch(_0x202532){if(_0x202532 instanceof SDKError)return console['error'](_0x1e8a38(0x178)+_0x202532['message']),_0x202532['cause']&&console[_0x1e8a38(0x183)](_0x1e8a38(0x179)+_0x202532[_0x1e8a38(0x18c)]),0x1;throw _0x202532;}}[a36_0x2d6828(0x18f)](_0x434fb5){const _0x569a1b=a36_0x2d6828;if(_0x434fb5['args'][_0x569a1b(0x188)]===0x0)return _0x569a1b(0x176);if(_0x434fb5['args'][_0x569a1b(0x188)]>0x1)return _0x569a1b(0x17f);return undefined;}}
1
+ const a36_0x2e8eef=a36_0x4ab1;(function(_0x5e26d5,_0x475d0b){const _0x581dd2=a36_0x4ab1,_0x2e8cee=_0x5e26d5();while(!![]){try{const _0x1999f=-parseInt(_0x581dd2(0x128))/0x1+parseInt(_0x581dd2(0x147))/0x2+parseInt(_0x581dd2(0x139))/0x3+-parseInt(_0x581dd2(0x12a))/0x4*(-parseInt(_0x581dd2(0x145))/0x5)+parseInt(_0x581dd2(0x143))/0x6*(parseInt(_0x581dd2(0x135))/0x7)+parseInt(_0x581dd2(0x140))/0x8+-parseInt(_0x581dd2(0x148))/0x9;if(_0x1999f===_0x475d0b)break;else _0x2e8cee['push'](_0x2e8cee['shift']());}catch(_0x4fd7bd){_0x2e8cee['push'](_0x2e8cee['shift']());}}}(a36_0x2bb9,0x62beb));import{BaseCommand}from'./command.js';function a36_0x4ab1(_0x3dd687,_0x356da1){_0x3dd687=_0x3dd687-0x11e;const _0x2bb9b1=a36_0x2bb9();let _0x4ab192=_0x2bb9b1[_0x3dd687];return _0x4ab192;}import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';import{parseTableReference,validateTableDescribeReference}from'../utils/table-ref-parser.js';function a36_0x2bb9(){const _0x5d60cb=['data','1030398IaIbVZ','error','260AQbbBu','\x20row','1214132HAzHCh','17745426MWARQx','query','Show\x20table\x20contents','Database:\x20','\x20\x20Cause:\x20','\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>','database','catalog','name','execute','verbose','325656QCoIDr','cause','33844arFqNj','\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>','table','args','Querying\x20','length','✔\x20Query\x20successful\x20-\x200\x20rows\x20returned','Usage:\x20tdx\x20show\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--in\x20<database>\x0a\x0aRun\x20\x27tdx\x20show\x20--help\x27\x20for\x20more\x20options','showTable','message','site','21lsGdvz','\x20from\x20','show','Usage:\x20tdx\x20show\x20<database.table>','1770099hEJCeR','Site:\x20','validate','limit','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','description','Error:\x20','4396472OfaVfm','Limit:\x20'];a36_0x2bb9=function(){return _0x5d60cb;};return a36_0x2bb9();}import{withSpinner}from'../utils/spinner.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';export class ShowCommand extends BaseCommand{[a36_0x2e8eef(0x125)]=a36_0x2e8eef(0x137);[a36_0x2e8eef(0x13e)]=a36_0x2e8eef(0x11f);async[a36_0x2e8eef(0x126)](_0x50fd02){const _0x8e1c39=a36_0x2e8eef;return this[_0x8e1c39(0x132)](_0x50fd02);}async['showTable'](_0x9da2e0){const _0x30f759=a36_0x2e8eef,{options:_0x1492c1,args:_0x56ba63,tdx:_0x541e0b}=_0x9da2e0;let _0x31d4cd;try{_0x31d4cd=parseTableReference(_0x56ba63[0x0]);const _0x5ce370=_0x1492c1['database'];!_0x31d4cd['database']&&_0x5ce370&&(_0x31d4cd[_0x30f759(0x123)]=_0x5ce370);const _0x1551d0=validateTableDescribeReference(_0x31d4cd);if(_0x1551d0)return console[_0x30f759(0x144)](_0x30f759(0x13f)+_0x1551d0),console['error']('Usage:\x20tdx\x20show\x20<database.table>'),console[_0x30f759(0x144)](_0x30f759(0x12b)),console['error']('\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>'),0x1;}catch(_0x146a01){return console['error'](_0x30f759(0x13f)+_0x146a01[_0x30f759(0x133)]),console[_0x30f759(0x144)](_0x30f759(0x138)),console['error']('\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>'),console[_0x30f759(0x144)](_0x30f759(0x122)),0x1;}const _0x18e44b=_0x31d4cd[_0x30f759(0x124)],_0x3aca15=_0x31d4cd[_0x30f759(0x123)],_0x30523e=_0x31d4cd[_0x30f759(0x12c)],_0x3187f7=resolveLimit(_0x1492c1[_0x30f759(0x13c)],DEFAULT_DISPLAY_LIMIT);try{_0x1492c1[_0x30f759(0x127)]&&(console[_0x30f759(0x144)](_0x30f759(0x13a)+_0x1492c1[_0x30f759(0x134)]),_0x18e44b&&console[_0x30f759(0x144)]('Catalog:\x20'+_0x18e44b),console[_0x30f759(0x144)](_0x30f759(0x120)+_0x3aca15),console['error']('Table:\x20'+_0x30523e),console[_0x30f759(0x144)](_0x30f759(0x141)+_0x3187f7));const _0x45c1d5=_0x18e44b?_0x18e44b+'.'+_0x3aca15+'.'+_0x30523e:_0x3aca15+'.'+_0x30523e,_0x2c9f68=await withSpinner(_0x30f759(0x12e)+_0x45c1d5+'...',()=>_0x541e0b[_0x30f759(0x11e)]['showTable'](_0x3aca15,_0x30523e,_0x3187f7,_0x18e44b),{'verbose':_0x1492c1[_0x30f759(0x127)]}),_0x7274ac=_0x2c9f68[_0x30f759(0x142)],_0x5ddf7b=_0x7274ac['data'];return _0x5ddf7b[_0x30f759(0x12f)]===0x0?console[_0x30f759(0x144)](_0x30f759(0x130)):console['error']('✔\x20Retrieved\x20'+_0x5ddf7b['length']+_0x30f759(0x146)+(_0x5ddf7b[_0x30f759(0x12f)]!==0x1?'s':'')+_0x30f759(0x136)+_0x45c1d5),await handleSDKOutput(_0x5ddf7b,_0x1492c1),0x0;}catch(_0x4da96b){if(_0x4da96b instanceof SDKError)return console[_0x30f759(0x144)]('Error:\x20'+_0x4da96b[_0x30f759(0x133)]),_0x4da96b[_0x30f759(0x129)]&&console['error'](_0x30f759(0x121)+_0x4da96b[_0x30f759(0x129)]),0x1;throw _0x4da96b;}}[a36_0x2e8eef(0x13b)](_0x4f01c2){const _0x4b3bea=a36_0x2e8eef;if(_0x4f01c2[_0x4b3bea(0x12d)][_0x4b3bea(0x12f)]===0x0)return _0x4b3bea(0x131);if(_0x4f01c2[_0x4b3bea(0x12d)][_0x4b3bea(0x12f)]>0x1)return _0x4b3bea(0x13d);return undefined;}}
@@ -1 +1 @@
1
- const a37_0xe69ed7=a37_0x2e14;(function(_0x22a77e,_0xaba1c2){const _0x38f1c9=a37_0x2e14,_0x3edfff=_0x22a77e();while(!![]){try{const _0x418bc8=parseInt(_0x38f1c9(0x9b))/0x1+parseInt(_0x38f1c9(0xbd))/0x2*(parseInt(_0x38f1c9(0xb3))/0x3)+-parseInt(_0x38f1c9(0xaa))/0x4+parseInt(_0x38f1c9(0x9c))/0x5+parseInt(_0x38f1c9(0xbb))/0x6+-parseInt(_0x38f1c9(0xa4))/0x7*(parseInt(_0x38f1c9(0xb8))/0x8)+parseInt(_0x38f1c9(0xba))/0x9*(-parseInt(_0x38f1c9(0xb5))/0xa);if(_0x418bc8===_0xaba1c2)break;else _0x3edfff['push'](_0x3edfff['shift']());}catch(_0x393cb7){_0x3edfff['push'](_0x3edfff['shift']());}}}(a37_0x15c2,0xd7133));function a37_0x15c2(){const _0x2f4bf8=['database','\x20\x20tdx\x20tables\x20\x22mydb.*\x22\x20\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb','verbose','message','tables','1128492QFOOzT','includes','Database:\x20','name','Error:\x20Too\x20many\x20arguments.\x20Use\x20single\x20argument:','\x20\x20Or:\x20\x20tdx\x20tables\x20--in\x20','table','\x27\x20without\x20wildcards\x20would\x20search\x20for\x20tables\x20named\x20\x27','\x20\x20Or:\x20\x20tdx\x20tables\x20--database\x20','262410nvfFqS','\x27\x20is\x20ambiguous.','10mugOsD','limit','\x20\x20tdx\x20tables\x20--in\x20mydb\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb','1592znLZAU','length','1179621ejbJjg','1379340CmSrsY','\x27\x20may\x20not\x20exist\x20or\x20contains\x20no\x20tables','12lVyuAw','Note:\x20\x27','Listing\x20tables...','Table\x20pattern:\x20','✖\x20No\x20tables\x20found','\x20\x20tdx\x20tables\x20\x22mydb.users\x22\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20in\x20database\x20mydb','listTables','Error:\x20','773559PGbzJn','6427170nYsrFh','error','validate','cause','data','\x20\x20tdx\x20tables\x20\x22*.user*\x22\x20\x20\x20\x20\x20\x20\x20->\x20tables\x20matching\x20user*\x20across\x20databases','Error:\x20Pattern\x20\x27','\x20\x20tdx\x20tables\x20users\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20across\x20all\x20databases','53452fwrwmA'];a37_0x15c2=function(){return _0x2f4bf8;};return a37_0x15c2();}import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';function a37_0x2e14(_0x40aec6,_0x31c612){_0x40aec6=_0x40aec6-0x9b;const _0x15c226=a37_0x15c2();let _0x2e141e=_0x15c226[_0x40aec6];return _0x2e141e;}import{handleSDKOutput}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{[a37_0xe69ed7(0xad)]=a37_0xe69ed7(0xa9);['description']='List\x20tables\x20in\x20a\x20database';async['execute'](_0x1631c1){const _0x1836da=a37_0xe69ed7,{options:_0x5b769c,args:_0x327613,tdx:_0x3229ae}=_0x1631c1;let _0x34cb25;if(_0x327613['length']===0x0)_0x34cb25={'database':undefined,'table':undefined,'original':''};else{if(_0x327613['length']===0x1)try{_0x34cb25=parseTableReference(_0x327613[0x0]);if(_0x34cb25[_0x1836da(0xb0)]&&!_0x34cb25[_0x1836da(0xa5)]&&!_0x34cb25[_0x1836da(0xb0)][_0x1836da(0xab)]('*')&&!_0x34cb25[_0x1836da(0xb0)][_0x1836da(0xab)]('?'))return console[_0x1836da(0x9d)](_0x1836da(0xa2)+_0x327613[0x0]+_0x1836da(0xb4)),console[_0x1836da(0x9d)]('Did\x20you\x20mean\x20to\x20list\x20all\x20tables\x20from\x20database\x20\x27'+_0x34cb25['table']+'\x27?'),console['error']('\x20\x20Use:\x20tdx\x20tables\x20\x22'+_0x34cb25[_0x1836da(0xb0)]+'.*\x22'),console['error'](_0x1836da(0xaf)+_0x34cb25['table']),console[_0x1836da(0x9d)](_0x1836da(0xb2)+_0x34cb25[_0x1836da(0xb0)]),console['error'](''),console['error'](_0x1836da(0xbe)+_0x327613[0x0]+_0x1836da(0xb1)+_0x34cb25[_0x1836da(0xb0)]+'\x27\x20across\x20all\x20databases.'),0x1;}catch(_0x34e3ef){return console[_0x1836da(0x9d)](_0x1836da(0xc4)+_0x34e3ef[_0x1836da(0xa8)]),0x1;}else return console[_0x1836da(0x9d)](_0x1836da(0xae)),console['error'](_0x1836da(0xa3)),console[_0x1836da(0x9d)](_0x1836da(0xa6)),console[_0x1836da(0x9d)](_0x1836da(0xc2)),console[_0x1836da(0x9d)](_0x1836da(0xa1)),console[_0x1836da(0x9d)]('Or\x20use\x20--in\x20flag:'),console[_0x1836da(0x9d)](_0x1836da(0xb7)),0x1;}const _0xedeafe=_0x5b769c['database'];!_0x34cb25[_0x1836da(0xa5)]&&_0xedeafe&&(_0x34cb25[_0x1836da(0xa5)]=_0xedeafe);try{const _0x1ec773=_0x3d4407=>_0x3d4407&&(_0x3d4407[_0x1836da(0xab)]('*')||_0x3d4407['includes']('?')),_0x7f7f38=_0x1ec773(_0x34cb25[_0x1836da(0xa5)]);_0x5b769c['verbose']&&(console['error']('Site:\x20'+_0x5b769c['site']),_0x34cb25[_0x1836da(0xa5)]?_0x7f7f38?console[_0x1836da(0x9d)]('Database\x20pattern:\x20'+_0x34cb25[_0x1836da(0xa5)]):console[_0x1836da(0x9d)](_0x1836da(0xac)+_0x34cb25['database']):console[_0x1836da(0x9d)]('Database:\x20all'),_0x34cb25[_0x1836da(0xb0)]&&console[_0x1836da(0x9d)](_0x1836da(0xc0)+_0x34cb25[_0x1836da(0xb0)]));const _0xb321c0=_0x34cb25['database']&&!_0x7f7f38?_0x34cb25[_0x1836da(0xa5)]:undefined,_0x307f01=_0x7f7f38?_0x34cb25['database']:undefined,_0x2ac473=_0x34cb25[_0x1836da(0xb0)],_0x24e7f3=resolveLimit(_0x5b769c[_0x1836da(0xb6)],DEFAULT_LISTING_LIMIT),_0x9bcf8b=await withSpinner(_0x1836da(0xbf),()=>_0x3229ae['query'][_0x1836da(0xc3)](_0xb321c0,_0x2ac473,_0x307f01,_0x24e7f3),{'verbose':_0x5b769c[_0x1836da(0xa7)]}),_0x39e870=_0x9bcf8b[_0x1836da(0xa0)];if(_0x39e870[_0x1836da(0xb9)]===0x0&&_0x34cb25['database']&&!_0x7f7f38)return console[_0x1836da(0x9d)](_0x1836da(0xc1)),console[_0x1836da(0x9d)]('Database\x20\x27'+_0x34cb25[_0x1836da(0xa5)]+_0x1836da(0xbc)),0x1;return console[_0x1836da(0x9d)]('✔\x20Found\x20'+_0x39e870[_0x1836da(0xb9)]+'\x20table'+(_0x39e870[_0x1836da(0xb9)]!==0x1?'s':'')),await handleSDKOutput(_0x39e870,{..._0x5b769c,'limit':_0x24e7f3}),0x0;}catch(_0x26e57a){if(_0x26e57a instanceof SDKError)return console[_0x1836da(0x9d)](_0x1836da(0xc4)+_0x26e57a[_0x1836da(0xa8)]),_0x26e57a[_0x1836da(0x9f)]&&console[_0x1836da(0x9d)]('\x20\x20Cause:\x20'+_0x26e57a[_0x1836da(0x9f)]),0x1;throw _0x26e57a;}}[a37_0xe69ed7(0x9e)](_0x3526fc){return undefined;}}
1
+ function a37_0x3d39(_0x482827,_0x199984){_0x482827=_0x482827-0x1da;const _0xb2c2fa=a37_0xb2c2();let _0x3d396f=_0xb2c2fa[_0x482827];return _0x3d396f;}const a37_0x213904=a37_0x3d39;(function(_0x5050d5,_0x35ce38){const _0x3586ce=a37_0x3d39,_0x5ddf23=_0x5050d5();while(!![]){try{const _0x49e017=-parseInt(_0x3586ce(0x1f5))/0x1*(-parseInt(_0x3586ce(0x1e9))/0x2)+-parseInt(_0x3586ce(0x206))/0x3*(-parseInt(_0x3586ce(0x1df))/0x4)+parseInt(_0x3586ce(0x1f6))/0x5+parseInt(_0x3586ce(0x1fc))/0x6+parseInt(_0x3586ce(0x208))/0x7+-parseInt(_0x3586ce(0x1fe))/0x8*(-parseInt(_0x3586ce(0x1f9))/0x9)+-parseInt(_0x3586ce(0x1ff))/0xa;if(_0x49e017===_0x35ce38)break;else _0x5ddf23['push'](_0x5ddf23['shift']());}catch(_0x2742e8){_0x5ddf23['push'](_0x5ddf23['shift']());}}}(a37_0xb2c2,0x2b712));import{BaseCommand}from'./command.js';function a37_0xb2c2(){const _0x583bfd=['Error:\x20Pattern\x20\x27','1719046GMLfBy','includes','Error:\x20','\x27\x20may\x20not\x20exist\x20or\x20contains\x20no\x20tables','Listing\x20tables...','Or\x20use\x20--in\x20flag:','Did\x20you\x20mean\x20to\x20list\x20all\x20tables\x20from\x20database\x20\x27','Note:\x20\x27','\x20\x20tdx\x20tables\x20users\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20across\x20all\x20databases','4KCxEyG','message','✔\x20Found\x20','✖\x20No\x20tables\x20found','\x20\x20Or:\x20\x20tdx\x20tables\x20--in\x20','database','listTables','description','error','\x27\x20without\x20wildcards\x20would\x20search\x20for\x20tables\x20named\x20\x27','194rrnSvD','Database:\x20all','site','\x20\x20Or:\x20\x20tdx\x20tables\x20--database\x20','verbose','Error:\x20Too\x20many\x20arguments.\x20Use\x20single\x20argument:','cause','table','tables','\x20table','\x20\x20tdx\x20tables\x20--in\x20mydb\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb','\x20\x20tdx\x20tables\x20\x22*.user*\x22\x20\x20\x20\x20\x20\x20\x20->\x20tables\x20matching\x20user*\x20across\x20databases','121GclQRO','67575WIgJEJ','\x27\x20is\x20ambiguous.','\x20\x20tdx\x20tables\x20\x22mydb.*\x22\x20\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb','878814GGlkil','name','Database:\x20','131658HsJYxu','Database\x20\x27','24qzbTFp','5564160spUtan','\x20\x20Use:\x20tdx\x20tables\x20\x22','execute','\x20\x20Cause:\x20','Site:\x20','Table\x20pattern:\x20','length','445929VXKzDT'];a37_0xb2c2=function(){return _0x583bfd;};return a37_0xb2c2();}import{SDKError}from'../sdk/index.js';import{handleSDKOutput}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{[a37_0x213904(0x1fa)]=a37_0x213904(0x1f1);[a37_0x213904(0x1e6)]='List\x20tables\x20in\x20a\x20database';async[a37_0x213904(0x201)](_0x226fb1){const _0x53345b=a37_0x213904,{options:_0x4497e6,args:_0x448053,tdx:_0x2b115b}=_0x226fb1;let _0x2ae18c;if(_0x448053['length']===0x0)_0x2ae18c={'database':undefined,'table':undefined,'original':''};else{if(_0x448053[_0x53345b(0x205)]===0x1)try{_0x2ae18c=parseTableReference(_0x448053[0x0]);if(_0x2ae18c[_0x53345b(0x1f0)]&&!_0x2ae18c[_0x53345b(0x1e4)]&&!_0x2ae18c[_0x53345b(0x1f0)][_0x53345b(0x209)]('*')&&!_0x2ae18c[_0x53345b(0x1f0)]['includes']('?'))return console[_0x53345b(0x1e7)](_0x53345b(0x207)+_0x448053[0x0]+_0x53345b(0x1f7)),console['error'](_0x53345b(0x1dc)+_0x2ae18c['table']+'\x27?'),console[_0x53345b(0x1e7)](_0x53345b(0x200)+_0x2ae18c[_0x53345b(0x1f0)]+'.*\x22'),console[_0x53345b(0x1e7)](_0x53345b(0x1e3)+_0x2ae18c[_0x53345b(0x1f0)]),console['error'](_0x53345b(0x1ec)+_0x2ae18c[_0x53345b(0x1f0)]),console['error'](''),console[_0x53345b(0x1e7)](_0x53345b(0x1dd)+_0x448053[0x0]+_0x53345b(0x1e8)+_0x2ae18c[_0x53345b(0x1f0)]+'\x27\x20across\x20all\x20databases.'),0x1;}catch(_0x552791){return console[_0x53345b(0x1e7)](_0x53345b(0x20a)+_0x552791[_0x53345b(0x1e0)]),0x1;}else return console[_0x53345b(0x1e7)](_0x53345b(0x1ee)),console[_0x53345b(0x1e7)](_0x53345b(0x1de)),console[_0x53345b(0x1e7)](_0x53345b(0x1f8)),console[_0x53345b(0x1e7)]('\x20\x20tdx\x20tables\x20\x22mydb.users\x22\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20in\x20database\x20mydb'),console['error'](_0x53345b(0x1f4)),console['error'](_0x53345b(0x1db)),console[_0x53345b(0x1e7)](_0x53345b(0x1f3)),0x1;}const _0x2d378a=_0x4497e6['database'];!_0x2ae18c[_0x53345b(0x1e4)]&&_0x2d378a&&(_0x2ae18c[_0x53345b(0x1e4)]=_0x2d378a);try{const _0x5c8e63=_0x150e50=>_0x150e50&&(_0x150e50[_0x53345b(0x209)]('*')||_0x150e50['includes']('?')),_0x48d8ff=_0x5c8e63(_0x2ae18c[_0x53345b(0x1e4)]);_0x4497e6[_0x53345b(0x1ed)]&&(console[_0x53345b(0x1e7)](_0x53345b(0x203)+_0x4497e6[_0x53345b(0x1eb)]),_0x2ae18c['database']?_0x48d8ff?console[_0x53345b(0x1e7)]('Database\x20pattern:\x20'+_0x2ae18c[_0x53345b(0x1e4)]):console['error'](_0x53345b(0x1fb)+_0x2ae18c[_0x53345b(0x1e4)]):console[_0x53345b(0x1e7)](_0x53345b(0x1ea)),_0x2ae18c[_0x53345b(0x1f0)]&&console[_0x53345b(0x1e7)](_0x53345b(0x204)+_0x2ae18c['table']));const _0x25a01a=_0x2ae18c[_0x53345b(0x1e4)]&&!_0x48d8ff?_0x2ae18c[_0x53345b(0x1e4)]:undefined,_0x16cdc1=_0x48d8ff?_0x2ae18c[_0x53345b(0x1e4)]:undefined,_0x446947=_0x2ae18c['table'],_0x4f488f=resolveLimit(_0x4497e6['limit'],DEFAULT_LISTING_LIMIT),_0x380419=await withSpinner(_0x53345b(0x1da),()=>_0x2b115b['query'][_0x53345b(0x1e5)](_0x25a01a,_0x446947,_0x16cdc1,_0x4f488f),{'verbose':_0x4497e6[_0x53345b(0x1ed)]}),_0x555e4e=_0x380419['data'];if(_0x555e4e[_0x53345b(0x205)]===0x0&&_0x2ae18c['database']&&!_0x48d8ff)return console[_0x53345b(0x1e7)](_0x53345b(0x1e2)),console[_0x53345b(0x1e7)](_0x53345b(0x1fd)+_0x2ae18c[_0x53345b(0x1e4)]+_0x53345b(0x20b)),0x1;return console[_0x53345b(0x1e7)](_0x53345b(0x1e1)+_0x555e4e[_0x53345b(0x205)]+_0x53345b(0x1f2)+(_0x555e4e[_0x53345b(0x205)]!==0x1?'s':'')),await handleSDKOutput(_0x555e4e,{..._0x4497e6,'limit':_0x4f488f}),0x0;}catch(_0x59a2d0){if(_0x59a2d0 instanceof SDKError)return console[_0x53345b(0x1e7)]('Error:\x20'+_0x59a2d0['message']),_0x59a2d0[_0x53345b(0x1ef)]&&console[_0x53345b(0x1e7)](_0x53345b(0x202)+_0x59a2d0['cause']),0x1;throw _0x59a2d0;}}['validate'](_0x2dbc3e){return undefined;}}
@@ -1 +1 @@
1
- const a38_0x34b4f5=a38_0x2844;function a38_0x5b18(){const _0x55987b=['\x0aUpdated:\x20','Default\x20site\x20','.\x20Must\x20be\x20one\x20of:\x20','llm_agent','engage_workspace','length','agent','default','Clear\x20session-level\x20or\x20default\x20context\x20values','tdx.json','2653590JqcTRw','\x0aRun\x20\x27tdx\x20unset\x20--help\x27\x20for\x20more\x20options','2524291xOTJIh','llm_project','session','Session\x20','98566WeUKzY','name','\x20\x20\x20\x20\x20\x20\x20tdx\x20unset\x20--default\x20<resource>\x20\x20#\x20Clear\x20default\x20from\x20config\x0a','45480cYIWLM','log','cleared','5551860FIveXC','Invalid\x20resource:\x20','\x0aResources:\x20site,\x20database,\x20parent_segment,\x20llm_project,\x20agent,\x20profile,\x20engage_workspace\x0a','Usage:\x20tdx\x20unset\x20<resource>\x0a','parent_segment','dim','profile','3wicjcW','2911248UqUKCh','site','join','green','(session:\x20','message','toString','1115638JgWlZT','unset','includes','validate'];a38_0x5b18=function(){return _0x55987b;};return a38_0x5b18();}(function(_0x29f64e,_0x30d1ca){const _0x3b2501=a38_0x2844,_0xcde765=_0x29f64e();while(!![]){try{const _0x5f4f33=-parseInt(_0x3b2501(0x11a))/0x1+parseInt(_0x3b2501(0x12f))/0x2+-parseInt(_0x3b2501(0x127))/0x3*(-parseInt(_0x3b2501(0x11d))/0x4)+parseInt(_0x3b2501(0x114))/0x5+-parseInt(_0x3b2501(0x120))/0x6+parseInt(_0x3b2501(0x116))/0x7+parseInt(_0x3b2501(0x128))/0x8;if(_0x5f4f33===_0x30d1ca)break;else _0xcde765['push'](_0xcde765['shift']());}catch(_0x2d7ba6){_0xcde765['push'](_0xcde765['shift']());}}}(a38_0x5b18,0xc3726));import{BaseCommand}from'./command.js';function a38_0x2844(_0x1f5ca0,_0x29bb80){_0x1f5ca0=_0x1f5ca0-0x108;const _0x5b18d0=a38_0x5b18();let _0x2844cb=_0x5b18d0[_0x1f5ca0];return _0x2844cb;}import{getCurrentSessionPID,cleanExpiredSessions,clearSessionContextField}from'../core/session.js';import{clearDefaultSiteFromUserConfig,clearActiveProfileFromUserConfig}from'../core/profile.js';import{getConfigDir}from'../core/config.js';import a38_0xf73962 from'chalk';import*as a38_0x34ab67 from'node:path';export class UnsetCommand extends BaseCommand{[a38_0x34b4f5(0x11b)]=a38_0x34b4f5(0x130);['description']=a38_0x34b4f5(0x112);[a38_0x34b4f5(0x109)](_0x1cf832){const _0x1ec296=a38_0x34b4f5,{args:_0x53a582,options:_0x434c7a}=_0x1cf832,_0x52d7a8=_0x434c7a[_0x1ec296(0x111)];if(_0x53a582[_0x1ec296(0x10f)]===0x0)return _0x1ec296(0x123)+_0x1ec296(0x11c)+_0x1ec296(0x122)+_0x1ec296(0x115);const _0x5832af=_0x53a582[0x0],_0x2cbc22=[_0x1ec296(0x129),'database',_0x1ec296(0x124),_0x1ec296(0x117),_0x1ec296(0x110),_0x1ec296(0x126),_0x1ec296(0x10e)];if(!_0x2cbc22[_0x1ec296(0x108)](_0x5832af))return _0x1ec296(0x121)+_0x5832af+_0x1ec296(0x10c)+_0x2cbc22[_0x1ec296(0x12a)](',\x20');if(_0x52d7a8&&_0x5832af!=='site'&&_0x5832af!==_0x1ec296(0x126))return'--default\x20can\x20only\x20be\x20used\x20with\x20\x27site\x27\x20or\x20\x27profile\x27.\x20Other\x20resources\x20are\x20session-level\x20only.';return undefined;}async['execute'](_0x54f811){const _0x33712e=a38_0x34b4f5,{args:_0x165f48,options:_0x3c4874}=_0x54f811,_0x3e1b09=_0x3c4874[_0x33712e(0x111)];cleanExpiredSessions();try{const _0x53ac4b=_0x165f48[0x0],_0x39b26b=a38_0x34ab67['join'](getConfigDir(),_0x33712e(0x113));if(_0x3e1b09){if(_0x53ac4b==='site')return clearDefaultSiteFromUserConfig(),console[_0x33712e(0x11e)](_0x33712e(0x10b)+a38_0xf73962[_0x33712e(0x12b)](_0x33712e(0x11f))),console['log'](a38_0xf73962[_0x33712e(0x125)](_0x33712e(0x10a)+_0x39b26b)),0x0;if(_0x53ac4b===_0x33712e(0x126))return clearActiveProfileFromUserConfig(),console[_0x33712e(0x11e)]('Default\x20profile\x20'+a38_0xf73962[_0x33712e(0x12b)](_0x33712e(0x11f))),console['log'](a38_0xf73962['dim'](_0x33712e(0x10a)+_0x39b26b)),0x0;}const _0x420a78=_0x3c4874[_0x33712e(0x118)]||getCurrentSessionPID()[_0x33712e(0x12e)](),_0x24c433={'site':'site','database':'database','parent_segment':_0x33712e(0x124),'llm_project':_0x33712e(0x117),'agent':_0x33712e(0x10d),'profile':_0x33712e(0x126),'engage_workspace':_0x33712e(0x10e)},_0x4756b3=_0x24c433[_0x53ac4b];return _0x4756b3&&(clearSessionContextField(_0x4756b3,_0x3c4874[_0x33712e(0x118)]),console[_0x33712e(0x11e)](_0x33712e(0x119)+_0x53ac4b+'\x20'+a38_0xf73962[_0x33712e(0x12b)](_0x33712e(0x11f))+'\x20'+a38_0xf73962[_0x33712e(0x125)](_0x33712e(0x12c)+_0x420a78+')'))),0x0;}catch(_0x5e06ff){return _0x5e06ff instanceof Error&&console['error']('Error:\x20'+_0x5e06ff[_0x33712e(0x12d)]),0x1;}}}
1
+ const a38_0x12543a=a38_0x50bb;(function(_0x3abdb8,_0x4223ab){const _0x5ca2e3=a38_0x50bb,_0x5449e5=_0x3abdb8();while(!![]){try{const _0x1758db=-parseInt(_0x5ca2e3(0x1d5))/0x1*(-parseInt(_0x5ca2e3(0x1d4))/0x2)+parseInt(_0x5ca2e3(0x1e8))/0x3+parseInt(_0x5ca2e3(0x1cf))/0x4*(-parseInt(_0x5ca2e3(0x1cd))/0x5)+parseInt(_0x5ca2e3(0x1c6))/0x6+-parseInt(_0x5ca2e3(0x1e4))/0x7+parseInt(_0x5ca2e3(0x1cb))/0x8+parseInt(_0x5ca2e3(0x1d3))/0x9*(-parseInt(_0x5ca2e3(0x1c4))/0xa);if(_0x1758db===_0x4223ab)break;else _0x5449e5['push'](_0x5449e5['shift']());}catch(_0x459846){_0x5449e5['push'](_0x5449e5['shift']());}}}(a38_0x5513,0x84fd0));import{BaseCommand}from'./command.js';import{getCurrentSessionPID,cleanExpiredSessions,clearSessionContextField}from'../core/session.js';import{clearDefaultSiteFromUserConfig,clearActiveProfileFromUserConfig}from'../core/profile.js';import{getConfigDir}from'../core/config.js';function a38_0x50bb(_0x666b1f,_0x34de74){_0x666b1f=_0x666b1f-0x1c1;const _0x551304=a38_0x5513();let _0x50bbe3=_0x551304[_0x666b1f];return _0x50bbe3;}function a38_0x5513(){const _0x317be7=['llm_project','site','8427144DkNjLH','\x20\x20\x20\x20\x20\x20\x20tdx\x20unset\x20--default\x20<resource>\x20\x20#\x20Clear\x20default\x20from\x20config\x0a','29515nCPpKo','database','444rVzsrF','Clear\x20session-level\x20or\x20default\x20context\x20values','Invalid\x20resource:\x20','Default\x20site\x20','9Rhymlh','1477834gLjuka','1BsdwRO','llm_agent','join','profile','\x0aUpdated:\x20','Error:\x20','(session:\x20','session','green','dim','toString','cleared','\x0aResources:\x20site,\x20database,\x20parent_segment,\x20llm_project,\x20agent,\x20profile,\x20engage_workspace\x0a','message','Default\x20profile\x20','1966979bpDaEa','--default\x20can\x20only\x20be\x20used\x20with\x20\x27site\x27\x20or\x20\x27profile\x27.\x20Other\x20resources\x20are\x20session-level\x20only.','Usage:\x20tdx\x20unset\x20<resource>\x0a','engage_workspace','1972491Oqvobu','default','\x0aRun\x20\x27tdx\x20unset\x20--help\x27\x20for\x20more\x20options','log','error','12911810lCaeOv','Session\x20','1933944IIUMbL','parent_segment','description'];a38_0x5513=function(){return _0x317be7;};return a38_0x5513();}import a38_0x42ca06 from'chalk';import*as a38_0x5a92ff from'node:path';export class UnsetCommand extends BaseCommand{['name']='unset';[a38_0x12543a(0x1c8)]=a38_0x12543a(0x1d0);['validate'](_0xbfc9e2){const _0x473255=a38_0x12543a,{args:_0x1a6b40,options:_0x4eb4fa}=_0xbfc9e2,_0x3191c3=_0x4eb4fa[_0x473255(0x1e9)];if(_0x1a6b40['length']===0x0)return _0x473255(0x1e6)+_0x473255(0x1cc)+_0x473255(0x1e1)+_0x473255(0x1c1);const _0x214e71=_0x1a6b40[0x0],_0x23c7d8=[_0x473255(0x1ca),_0x473255(0x1ce),_0x473255(0x1c7),_0x473255(0x1c9),'agent','profile',_0x473255(0x1e7)];if(!_0x23c7d8['includes'](_0x214e71))return _0x473255(0x1d1)+_0x214e71+'.\x20Must\x20be\x20one\x20of:\x20'+_0x23c7d8[_0x473255(0x1d7)](',\x20');if(_0x3191c3&&_0x214e71!==_0x473255(0x1ca)&&_0x214e71!==_0x473255(0x1d8))return _0x473255(0x1e5);return undefined;}async['execute'](_0x51bebe){const _0x125bb0=a38_0x12543a,{args:_0x1ef9dc,options:_0x19989c}=_0x51bebe,_0x178ee6=_0x19989c[_0x125bb0(0x1e9)];cleanExpiredSessions();try{const _0x3575d1=_0x1ef9dc[0x0],_0x3b9b34=a38_0x5a92ff[_0x125bb0(0x1d7)](getConfigDir(),'tdx.json');if(_0x178ee6){if(_0x3575d1===_0x125bb0(0x1ca))return clearDefaultSiteFromUserConfig(),console[_0x125bb0(0x1c2)](_0x125bb0(0x1d2)+a38_0x42ca06['green'](_0x125bb0(0x1e0))),console[_0x125bb0(0x1c2)](a38_0x42ca06[_0x125bb0(0x1de)](_0x125bb0(0x1d9)+_0x3b9b34)),0x0;if(_0x3575d1===_0x125bb0(0x1d8))return clearActiveProfileFromUserConfig(),console[_0x125bb0(0x1c2)](_0x125bb0(0x1e3)+a38_0x42ca06[_0x125bb0(0x1dd)](_0x125bb0(0x1e0))),console[_0x125bb0(0x1c2)](a38_0x42ca06['dim'](_0x125bb0(0x1d9)+_0x3b9b34)),0x0;}const _0x2b178e=_0x19989c[_0x125bb0(0x1dc)]||getCurrentSessionPID()[_0x125bb0(0x1df)](),_0x5436ed={'site':_0x125bb0(0x1ca),'database':_0x125bb0(0x1ce),'parent_segment':_0x125bb0(0x1c7),'llm_project':_0x125bb0(0x1c9),'agent':_0x125bb0(0x1d6),'profile':_0x125bb0(0x1d8),'engage_workspace':_0x125bb0(0x1e7)},_0x2980d4=_0x5436ed[_0x3575d1];return _0x2980d4&&(clearSessionContextField(_0x2980d4,_0x19989c[_0x125bb0(0x1dc)]),console[_0x125bb0(0x1c2)](_0x125bb0(0x1c5)+_0x3575d1+'\x20'+a38_0x42ca06[_0x125bb0(0x1dd)]('cleared')+'\x20'+a38_0x42ca06['dim'](_0x125bb0(0x1db)+_0x2b178e+')'))),0x0;}catch(_0x1c57bf){return _0x1c57bf instanceof Error&&console[_0x125bb0(0x1c3)](_0x125bb0(0x1da)+_0x1c57bf[_0x125bb0(0x1e2)]),0x1;}}}