@treasuredata/tdx 0.14.6 → 0.14.7

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 (142) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.js +1 -1
  5. package/dist/commands/activations.js +1 -1
  6. package/dist/commands/agent-command.js +1 -1
  7. package/dist/commands/api-command.js +1 -1
  8. package/dist/commands/auth-command.js +1 -1
  9. package/dist/commands/chat-command.js +1 -1
  10. package/dist/commands/claude-command.d.ts.map +1 -1
  11. package/dist/commands/claude-command.js +1 -1
  12. package/dist/commands/claude-command.js.map +1 -1
  13. package/dist/commands/claude-statusline-command.js +1 -1
  14. package/dist/commands/claude-usage-command.js +1 -1
  15. package/dist/commands/command.js +1 -1
  16. package/dist/commands/connection-command.js +1 -1
  17. package/dist/commands/databases.js +1 -1
  18. package/dist/commands/describe.js +1 -1
  19. package/dist/commands/engage-command.js +1 -1
  20. package/dist/commands/job-command.js +1 -1
  21. package/dist/commands/journey-command.js +1 -1
  22. package/dist/commands/journey-validate-command.js +1 -1
  23. package/dist/commands/llm-command.js +1 -1
  24. package/dist/commands/llm-proxy.js +1 -1
  25. package/dist/commands/parent-segment-command.js +1 -1
  26. package/dist/commands/profile-command.js +1 -1
  27. package/dist/commands/profiles-command.js +1 -1
  28. package/dist/commands/query-command.js +1 -1
  29. package/dist/commands/segment-command.js +1 -1
  30. package/dist/commands/segment-create-command.js +1 -1
  31. package/dist/commands/segment-fields-command.js +1 -1
  32. package/dist/commands/segment-pull-command.js +1 -1
  33. package/dist/commands/segment-push-command.js +1 -1
  34. package/dist/commands/segment-update-command.js +1 -1
  35. package/dist/commands/segment-use-command.js +1 -1
  36. package/dist/commands/segment-validate-command.js +1 -1
  37. package/dist/commands/segments.js +1 -1
  38. package/dist/commands/show.js +1 -1
  39. package/dist/commands/tables.js +1 -1
  40. package/dist/commands/unset-command.js +1 -1
  41. package/dist/commands/use-command.js +1 -1
  42. package/dist/commands/user-command.js +1 -1
  43. package/dist/commands/workflow-command.js +1 -1
  44. package/dist/core/auth.js +1 -1
  45. package/dist/core/command-output.js +1 -1
  46. package/dist/core/config.js +1 -1
  47. package/dist/core/connection-cache.js +1 -1
  48. package/dist/core/constants.js +1 -1
  49. package/dist/core/credential-cache.js +1 -1
  50. package/dist/core/global-context.js +1 -1
  51. package/dist/core/keychain.js +1 -1
  52. package/dist/core/profile.js +1 -1
  53. package/dist/core/project-config.js +1 -1
  54. package/dist/core/session.js +1 -1
  55. package/dist/core/user-cache.js +1 -1
  56. package/dist/core/version.js +1 -1
  57. package/dist/index.js +1 -1
  58. package/dist/proxy/anthropic-adapter.js +1 -1
  59. package/dist/proxy/claude-usage-tracker.js +1 -1
  60. package/dist/proxy/context-signature.js +1 -1
  61. package/dist/proxy/conversation-utils.js +1 -1
  62. package/dist/proxy/passthrough-server.js +1 -1
  63. package/dist/proxy/server.js +1 -1
  64. package/dist/proxy/session-cache.js +1 -1
  65. package/dist/proxy/sse-usage-parser.js +1 -1
  66. package/dist/sdk/agent/agent-config.js +1 -1
  67. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  68. package/dist/sdk/agent/agent-yaml.js +1 -1
  69. package/dist/sdk/api.js +1 -1
  70. package/dist/sdk/client/cdp-api-client.js +1 -1
  71. package/dist/sdk/client/endpoints.js +1 -1
  72. package/dist/sdk/client/engage-api-client.js +1 -1
  73. package/dist/sdk/client/http-client.d.ts.map +1 -1
  74. package/dist/sdk/client/http-client.js +1 -1
  75. package/dist/sdk/client/http-client.js.map +1 -1
  76. package/dist/sdk/client/llm-api-client.js +1 -1
  77. package/dist/sdk/client/rate-limiter.js +1 -1
  78. package/dist/sdk/client/td-api-client.js +1 -1
  79. package/dist/sdk/client/trino-api-client.js +1 -1
  80. package/dist/sdk/client/workflow-client.js +1 -1
  81. package/dist/sdk/connection-validator.js +1 -1
  82. package/dist/sdk/connection.js +1 -1
  83. package/dist/sdk/engage.js +1 -1
  84. package/dist/sdk/errors.js +1 -1
  85. package/dist/sdk/index.js +1 -1
  86. package/dist/sdk/io/index.js +1 -1
  87. package/dist/sdk/io/node-filesystem.js +1 -1
  88. package/dist/sdk/job.js +1 -1
  89. package/dist/sdk/journey.js +1 -1
  90. package/dist/sdk/llm/chat-cache.js +1 -1
  91. package/dist/sdk/llm/index.js +1 -1
  92. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  93. package/dist/sdk/llm/model-aliases.js +1 -1
  94. package/dist/sdk/llm/model-factors.js +1 -1
  95. package/dist/sdk/query/index.js +1 -1
  96. package/dist/sdk/query/sql-parser.js +1 -1
  97. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  98. package/dist/sdk/segment/fields-display.js +1 -1
  99. package/dist/sdk/segment/file-discovery.js +1 -1
  100. package/dist/sdk/segment/journey-utils.js +1 -1
  101. package/dist/sdk/segment/journey-yaml.js +1 -1
  102. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  103. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  104. package/dist/sdk/segment/pull-workflow.js +1 -1
  105. package/dist/sdk/segment/push-workflow.js +1 -1
  106. package/dist/sdk/segment/resolution-context.js +1 -1
  107. package/dist/sdk/segment/segment-path-parser.js +1 -1
  108. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  109. package/dist/sdk/segment/target-resolution.js +1 -1
  110. package/dist/sdk/segment/tdx-config.js +1 -1
  111. package/dist/sdk/segment/validate-files.js +1 -1
  112. package/dist/sdk/segment/yaml-validator.js +1 -1
  113. package/dist/sdk/segment.js +1 -1
  114. package/dist/sdk/types/index.js +1 -1
  115. package/dist/sdk/types/progress.js +1 -1
  116. package/dist/sdk/user.js +1 -1
  117. package/dist/sdk/util/format-detector.js +1 -1
  118. package/dist/sdk/util/formatters.js +1 -1
  119. package/dist/sdk/util/index.js +1 -1
  120. package/dist/sdk/util/tree-formatter.js +1 -1
  121. package/dist/sdk/workflow/clone-workflow.js +1 -1
  122. package/dist/sdk/workflow/index.js +1 -1
  123. package/dist/sdk/workflow/pull-workflow.js +1 -1
  124. package/dist/sdk/workflow/push-workflow.js +1 -1
  125. package/dist/sdk/workflow/tdx-config.js +1 -1
  126. package/dist/sdk/workflow/workflow-utils.js +1 -1
  127. package/dist/utils/async.js +1 -1
  128. package/dist/utils/colors.js +1 -1
  129. package/dist/utils/diff.js +1 -1
  130. package/dist/utils/file-permissions.js +1 -1
  131. package/dist/utils/json-loader.js +1 -1
  132. package/dist/utils/option-validation.js +1 -1
  133. package/dist/utils/port.js +1 -1
  134. package/dist/utils/process.js +1 -1
  135. package/dist/utils/prompt.js +1 -1
  136. package/dist/utils/spinner.js +1 -1
  137. package/dist/utils/sse-parser.js +1 -1
  138. package/dist/utils/string-utils.js +1 -1
  139. package/dist/utils/table-ref-parser.js +1 -1
  140. package/dist/utils/tdx-logger.js +1 -1
  141. package/dist/utils/version-check.js +1 -1
  142. package/package.json +1 -1
@@ -1 +1 @@
1
- const a25_0x9e26f2=a25_0x775b;(function(_0x397e36,_0x34975e){const _0xb8d1b0=a25_0x775b,_0x116bb8=_0x397e36();while(!![]){try{const _0x31b702=parseInt(_0xb8d1b0(0xe1))/0x1+parseInt(_0xb8d1b0(0xb3))/0x2*(-parseInt(_0xb8d1b0(0xe9))/0x3)+-parseInt(_0xb8d1b0(0x9f))/0x4*(parseInt(_0xb8d1b0(0xea))/0x5)+-parseInt(_0xb8d1b0(0x118))/0x6*(parseInt(_0xb8d1b0(0xc3))/0x7)+-parseInt(_0xb8d1b0(0xef))/0x8+-parseInt(_0xb8d1b0(0xd3))/0x9*(-parseInt(_0xb8d1b0(0xb9))/0xa)+parseInt(_0xb8d1b0(0xfa))/0xb;if(_0x31b702===_0x34975e)break;else _0x116bb8['push'](_0x116bb8['shift']());}catch(_0x948514){_0x116bb8['push'](_0x116bb8['shift']());}}}(a25_0x2862,0x2c465));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner,formatElapsed}from'../utils/spinner.js';import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{executeSchemaQuery}from'../sdk/segment/fields-display.js';import{isYamlFilePath,resolveYamlFilePath}from'../sdk/segment/segment-path-parser.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';function a25_0x2862(){const _0x2c2ccd=['Fetching\x20SQL\x20for\x20segment...','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20-w\x20\x20#\x20Open\x20segment\x20in\x20web\x20browser','Show\x20segment\x20or\x20folder\x20details','Use:\x20tdx\x20ps\x20desc','Usage:\x20tdx\x20segment\x20describe\x20<path>','Use:\x20tdx\x20ps\x20show','setJobId','\x20Opening\x20','Error:\x20Folder\x20reference\x20is\x20required','segment','getParent','\x20\x20tdx\x20sg\x20view\x20\x22Marketing\x22\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20folder\x20details','Resolved\x20folder\x20ID:\x20','Segment\x20ID:\x20','\x20\x20tdx\x20sg\x20view\x20segments/my-audience/premium-users.yml','\x27...','Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)','Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.','in\x20','SEGMENT_FOLDER_NOT_FOUND','Error:\x20Path\x20or\x20name\x20is\x20required','Error:\x20Cannot\x20get\x20SQL\x20for\x20parent\x20segment\x20with\x20this\x20command.','Use:\x20tdx\x20sg\x20view\x20<name>\x20\x20#\x20To\x20show\x20folder\x20details','Resolving\x20parent\x20folder\x20\x27','Fetching\x20folder\x20details...','site','23716onRKWa','✔\x20Query\x20completed:\x20Processed\x20','execute','Execute\x20child\x20segment\x20SQL\x20query\x20and\x20show\x20results','✔\x20Found\x20','elapsedTimeMillis','/app/ps/','folderId','\x20\x20Folder\x20path:\x20','listFolders','jsonl','toLocaleString','Segment\x20ID\x20missing\x20from\x20resolved\x20path','\x20\x20tdx\x20sg\x20desc\x20\x22Premium\x20Users\x22','segmentName','processedRows','\x20\x20Full\x20path:\x20','resolveFolderId','Fetching\x20segment\x20details...','\x20\x20tdx\x20sg\x20show\x20segments/my-audience/premium-users.yml','2KjEOtI','Get\x20SQL\x20query\x20for\x20child\x20segment','segment:folder:create','segment:sql','segmentId','SEGMENT_NOT_FOUND','10ajdbmW','message','\x20\x20tdx\x20sg\x20sql\x20segments/my-audience/premium-users.yml','(root)','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','Parent\x20ID:\x20','getSegmentSQL','Error:\x20Parent\x20segment\x20name\x20is\x20required','getSegment','resolveParentId','502628wqOuvD','SELECT\x20*\x20FROM\x20(\x0a','web','Error:\x20Cannot\x20execute\x20query\x20for\x20parent\x20segment\x20with\x20this\x20command.','parentSegment','parent','Usage:\x20tdx\x20sg\x20show\x20<name>','description','Resolving\x20path\x20\x27','log','\x20[Job\x20ID:\x20','Use:\x20tdx\x20ps\x20view\x20-w','Site:\x20','test','Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>','format','2160711RuDVmj','Parent\x20segment:\x20','Resolving\x20\x27','name','verbose','Error:\x20Cannot\x20open\x20parent\x20segment\x20with\x20this\x20command.','data','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20show\x20<path/to/segment.yml>','Fetching\x20folder\x20\x27','stats','replace','fullPath','✔\x20Created\x20folder\x20\x27','326434BmprfB','includes','getFolder','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22','resolvePathToResource','green','length','\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','697044GDUlOF','295wQmxMo','INVALID_ARGUMENT','Examples:','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22','parentId','518064uPRhMV','List\x20segment\x20folders\x20under\x20a\x20parent\x20segment','Error:\x20','folder','Show\x20folder\x20or\x20child\x20segment\x20details','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20view\x20<path/to/segment.yml>','parentFolder','Folder\x20ID\x20missing\x20from\x20resolved\x20path','segment:folder:show','information_schema','\x20\x20-w,\x20--web\x20\x20Open\x20segment\x20in\x20web\x20browser','6038659fFxrnL','Resolving\x20parent\x20segment\x20\x27','Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required','cause','json','Target\x20path:\x20','Folder\x20ID:\x20','Resolved\x20parent\x20ID:\x20','Fetching\x20parent\x20segment\x20details...','segmentPath','\x20\x20Cause:\x20','segment:folder:list','url','limit','Listing\x20folders\x20for\x20parent\x20\x27','Options:','Executing\x20segment\x20query...','createFolder','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20desc\x20<path/to/segment.yml>','Resolved\x20type:\x20','Error:\x20Folder\x20or\x20segment\x20name,\x20or\x20YAML\x20file\x20path\x20is\x20required','Usage:\x20tdx\x20sg\x20sql\x20<name>','Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>','segment:show','type','/e/','\x27\x20with\x20ID:\x20','\x20\x20Parent\x20segment:\x20','Resolved\x20parent\x20folder\x20ID:\x20','code','24dKMEaq','Parent\x20name:\x20','Error:\x20Cannot\x20view\x20parent\x20segment\x20details\x20with\x20this\x20command.','Use:\x20tdx\x20ps\x20sql','Folder\x20name:\x20','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','Error:\x20Cannot\x20open\x20folder\x20in\x20web\x20browser.\x20Use\x20a\x20segment\x20name\x20instead.','SQL\x20query:\x0a','Usage:\x20tdx\x20sg\x20view\x20<name>\x20[-w]','jobId','error','Usage:\x20tdx\x20sg\x20desc\x20<name>','Creating\x20folder\x20\x27','\x20\x20Segment\x20name:\x20'];a25_0x2862=function(){return _0x2c2ccd;};return a25_0x2862();}import{openBrowser}from'../utils/process.js';import a25_0x17ea3a from'chalk';async function resolveSegmentTarget(_0x2ae3b7,_0x1e9547,_0x30d133){const _0x52ec91=a25_0x775b;if(isYamlFilePath(_0x2ae3b7))try{const _0x473b67=await resolveYamlFilePath(_0x2ae3b7);return _0x30d133&&(console[_0x52ec91(0x81)]('Resolved\x20YAML\x20file:\x20'+_0x2ae3b7),console[_0x52ec91(0x81)](_0x52ec91(0x115)+_0x473b67[_0x52ec91(0xc7)]),console[_0x52ec91(0x81)](_0x52ec91(0x84)+_0x473b67[_0x52ec91(0xad)]),console['error'](_0x52ec91(0xa7)+(_0x473b67['folderPath']||_0x52ec91(0xbc))),console[_0x52ec91(0x81)](_0x52ec91(0xaf)+_0x473b67['fullPath'])),_0x473b67[_0x52ec91(0xdf)];}catch(_0x3aeb2c){throw new SDKError(ErrorCode[_0x52ec91(0xeb)],'Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20'+_0x3aeb2c[_0x52ec91(0xba)]);}if(!_0x1e9547)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x52ec91(0xda));return _0x1e9547+'/'+_0x2ae3b7;}export class SegmentDescribeCommand extends BaseCommand{[a25_0x9e26f2(0xd6)]='segment:describe';[a25_0x9e26f2(0xca)]=a25_0x9e26f2(0x87);async['execute'](_0x25e723){const _0x185354=a25_0x9e26f2,{options:_0x1e5283,args:_0x298bb7,tdx:_0x4caf7d}=_0x25e723,_0x333800=_0x298bb7[0x0],_0x1f772e=!_0x333800&&!!_0x1e5283[_0x185354(0xc7)],_0x12d37e=_0x333800||_0x1e5283[_0x185354(0xc7)];if(!_0x12d37e)return console[_0x185354(0x81)](_0x185354(0x99)),console[_0x185354(0x81)](_0x185354(0x89)),console[_0x185354(0x81)](_0x185354(0xec)),console['error'](_0x185354(0xe4)),console[_0x185354(0x81)](_0x185354(0xed)),console[_0x185354(0x81)](_0x185354(0xe8)),console[_0x185354(0x81)](_0x185354(0xbd)),0x1;try{const _0x25368a=_0x1e5283[_0x185354(0x103)];let _0x569b0f=_0x12d37e;!_0x1f772e&&_0x25368a&&!_0x12d37e[_0x185354(0xe2)]('/')&&(_0x569b0f=_0x25368a+'/'+_0x12d37e,_0x1e5283['verbose']&&console[_0x185354(0x81)]('Resolved\x20relative\x20path\x20to:\x20'+_0x569b0f));const _0x162284=await withSpinner(_0x185354(0xcb)+_0x569b0f+'\x27...',()=>_0x4caf7d['segment'][_0x185354(0xe5)](_0x569b0f),{'verbose':_0x1e5283[_0x185354(0xd7)]}),_0x2c0838=_0x162284[_0x185354(0xd9)];_0x1e5283[_0x185354(0xd7)]&&(console[_0x185354(0x81)](_0x185354(0x10d)+_0x2c0838['type']),console['error'](_0x185354(0xbe)+_0x2c0838[_0x185354(0xee)]),_0x2c0838['folderId']&&console['error'](_0x185354(0x100)+_0x2c0838[_0x185354(0xa6)]),_0x2c0838['segmentId']&&console[_0x185354(0x81)](_0x185354(0x92)+_0x2c0838['segmentId']));if(_0x2c0838[_0x185354(0x112)]===_0x185354(0xc8)){const _0x4f6a02=await withSpinner(_0x185354(0x102),()=>_0x4caf7d[_0x185354(0x8e)][_0x185354(0x8f)](_0x2c0838[_0x185354(0xee)]),{'verbose':_0x1e5283[_0x185354(0xd7)]});await handleSingleObjectOutput(_0x4f6a02[_0x185354(0xd9)],_0x1e5283);}else{if(_0x2c0838['type']===_0x185354(0xf2)){if(!_0x2c0838['folderId'])throw new SDKError(ErrorCode[_0x185354(0x98)],_0x185354(0xf6));const _0x415136=await withSpinner('Fetching\x20folder\x20details...',()=>_0x4caf7d[_0x185354(0x8e)][_0x185354(0xe3)](_0x2c0838[_0x185354(0xa6)]),{'verbose':_0x1e5283[_0x185354(0xd7)]});await handleSingleObjectOutput(_0x415136['data'],_0x1e5283);}else{if(_0x2c0838['type']===_0x185354(0x8e)){if(!_0x2c0838[_0x185354(0xb7)])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x185354(0xab));const _0x26e24c=await withSpinner(_0x185354(0xb1),()=>_0x4caf7d[_0x185354(0x8e)]['getSegment'](_0x2c0838[_0x185354(0xee)],_0x2c0838[_0x185354(0xb7)]),{'verbose':_0x1e5283['verbose']});await handleSingleObjectOutput(_0x26e24c[_0x185354(0xd9)],_0x1e5283);}}}return 0x0;}catch(_0x9f993){if(_0x9f993 instanceof SDKError)return console[_0x185354(0x81)](_0x185354(0xf1)+_0x9f993['message']),_0x9f993[_0x185354(0xfd)]&&console[_0x185354(0x81)](_0x185354(0x104)+_0x9f993[_0x185354(0xfd)]),0x1;throw _0x9f993;}}}export class SegmentShowCommand extends BaseCommand{['name']=a25_0x9e26f2(0x111);[a25_0x9e26f2(0xca)]=a25_0x9e26f2(0xa2);async['execute'](_0x817226){const _0x4891be=a25_0x9e26f2,{options:_0x8982,args:_0x19fb06,tdx:_0x2729cf}=_0x817226,_0x8a3bed=_0x19fb06[0x0];if(!_0x8a3bed)return console[_0x4891be(0x81)](_0x4891be(0xfc)),console[_0x4891be(0x81)](_0x4891be(0xc9)),console['error'](_0x4891be(0xdb)),console[_0x4891be(0x81)]('Examples:'),console[_0x4891be(0x81)]('\x20\x20tdx\x20sg\x20show\x20\x22Premium\x20Users\x22'),console[_0x4891be(0x81)](_0x4891be(0xb2)),0x1;try{const _0x335455=_0x8982[_0x4891be(0xc7)],_0x50bc03=await resolveSegmentTarget(_0x8a3bed,_0x335455,_0x8982[_0x4891be(0xd7)]);_0x8982[_0x4891be(0xd7)]&&console[_0x4891be(0x81)](_0x4891be(0xff)+_0x50bc03);const _0x4ad76d=await withSpinner(_0x4891be(0xd5)+_0x8a3bed+_0x4891be(0x94),()=>_0x2729cf[_0x4891be(0x8e)][_0x4891be(0xe5)](_0x50bc03),{'verbose':_0x8982[_0x4891be(0xd7)]}),_0x592ee5=_0x4ad76d['data'];_0x8982[_0x4891be(0xd7)]&&(console[_0x4891be(0x81)](_0x4891be(0x10d)+_0x592ee5['type']),console[_0x4891be(0x81)](_0x4891be(0xbe)+_0x592ee5[_0x4891be(0xee)]));if(_0x592ee5[_0x4891be(0x112)]===_0x4891be(0xf2))return console[_0x4891be(0x81)](_0x4891be(0x96)),console['error'](_0x4891be(0x9b)),0x1;if(_0x592ee5[_0x4891be(0x112)]===_0x4891be(0xc8))return console[_0x4891be(0x81)](_0x4891be(0xc6)),console[_0x4891be(0x81)](_0x4891be(0x8a)),0x1;if(!_0x592ee5[_0x4891be(0xb7)])throw new SDKError(ErrorCode[_0x4891be(0xb8)],_0x4891be(0xab));const _0xaeaee9=await withSpinner('Fetching\x20SQL\x20for\x20segment...',()=>_0x2729cf['segment']['getSegmentSQL'](_0x592ee5[_0x4891be(0xee)],_0x592ee5[_0x4891be(0xb7)]),{'verbose':_0x8982['verbose']});let _0x4ac0e1=_0xaeaee9[_0x4891be(0xd9)];const _0x45c405=resolveLimit(_0x8982[_0x4891be(0x107)],DEFAULT_DISPLAY_LIMIT),_0x194a68=/\bLIMIT\s+\d+/i[_0x4891be(0xd0)](_0x4ac0e1);!_0x194a68&&(_0x4ac0e1=_0x4ac0e1['trim']()[_0x4891be(0xde)](/;+$/,''),_0x4ac0e1=_0x4891be(0xc4)+_0x4ac0e1+'\x0a)\x20AS\x20segment_query\x0aLIMIT\x20'+_0x45c405);_0x8982[_0x4891be(0xd7)]&&console['error'](_0x4891be(0x7e)+_0x4ac0e1);const _0x3aa86b=await withProgressSpinner(_0x4891be(0x10a),async _0x6e2c98=>{const _0x1375a7=_0x4891be,_0x4e4a1d=await _0x2729cf['query']['execute'](_0x4ac0e1,{'catalog':'td','schema':_0x1375a7(0xf8),'onJobId':_0x1e062f=>{const _0x32347b=_0x1375a7;_0x6e2c98[_0x32347b(0x8b)](_0x1e062f);}});return _0x4e4a1d;},{'verbose':_0x8982[_0x4891be(0xd7)]}),_0x30aa31=_0x3aa86b[_0x4891be(0xd9)],_0x45f1e6=_0x30aa31[_0x4891be(0x80)]?_0x4891be(0xcd)+_0x30aa31[_0x4891be(0x80)]+']':'';return console[_0x4891be(0x81)](_0x4891be(0xa0)+_0x30aa31[_0x4891be(0xdd)][_0x4891be(0xae)][_0x4891be(0xaa)]()+'\x20rows\x20'+(_0x4891be(0x97)+formatElapsed(_0x30aa31['stats'][_0x4891be(0xa4)])+_0x45f1e6)),await handleQueryOutput(_0x30aa31,_0x8982),0x0;}catch(_0x42cc4c){if(_0x42cc4c instanceof SDKError)return console[_0x4891be(0x81)]('✖\x20Query\x20failed\x20['+_0x42cc4c[_0x4891be(0x117)]+']'),console[_0x4891be(0x81)]('\x0a'+_0x42cc4c[_0x4891be(0xba)]),0x1;throw _0x42cc4c;}}}export class SegmentFolderListCommand extends BaseCommand{[a25_0x9e26f2(0xd6)]=a25_0x9e26f2(0x105);['description']=a25_0x9e26f2(0xf0);async[a25_0x9e26f2(0xa1)](_0x26df20){const _0x2a800a=a25_0x9e26f2,{options:_0x246528,args:_0x9a1ecf,tdx:_0x3bdf3f}=_0x26df20;if(_0x9a1ecf['length']===0x0)return console['error'](_0x2a800a(0xc0)),console['error'](_0x2a800a(0x110)),0x1;const _0x8fbd5d=_0x9a1ecf[0x0];try{_0x246528[_0x2a800a(0xd7)]&&(console[_0x2a800a(0x81)](_0x2a800a(0xcf)+_0x246528[_0x2a800a(0x9e)]),console[_0x2a800a(0x81)](_0x2a800a(0x119)+_0x8fbd5d));const _0x47c0af=await withSpinner(_0x2a800a(0xfb)+_0x8fbd5d+_0x2a800a(0x94),()=>_0x3bdf3f['segment'][_0x2a800a(0xc2)](_0x8fbd5d),{'verbose':_0x246528[_0x2a800a(0xd7)]}),_0x2659cb=_0x47c0af['data'];_0x246528['verbose']&&console[_0x2a800a(0x81)](_0x2a800a(0x101)+_0x2659cb);const _0x17b4a8=await withSpinner(_0x2a800a(0x108)+_0x8fbd5d+_0x2a800a(0x94),()=>_0x3bdf3f['segment'][_0x2a800a(0xa8)](_0x2659cb),{'verbose':_0x246528[_0x2a800a(0xd7)]}),_0x4a9793=_0x17b4a8[_0x2a800a(0xd9)];return console['error'](_0x2a800a(0xa3)+_0x4a9793[_0x2a800a(0xe7)]+'\x20folder'+(_0x4a9793[_0x2a800a(0xe7)]!==0x1?'s':'')),await handleSDKOutput(_0x4a9793,_0x246528),0x0;}catch(_0x1c0a5e){if(_0x1c0a5e instanceof SDKError)return console[_0x2a800a(0x81)](_0x2a800a(0xf1)+_0x1c0a5e[_0x2a800a(0xba)]),_0x1c0a5e[_0x2a800a(0xfd)]&&console[_0x2a800a(0x81)]('\x20\x20Cause:\x20'+_0x1c0a5e[_0x2a800a(0xfd)]),0x1;throw _0x1c0a5e;}}}export class SegmentFolderShowCommand extends BaseCommand{[a25_0x9e26f2(0xd6)]=a25_0x9e26f2(0xf7);[a25_0x9e26f2(0xca)]='Show\x20segment\x20folder\x20details';async[a25_0x9e26f2(0xa1)](_0x289036){const _0x37fdd6=a25_0x9e26f2,{options:_0x199a94,args:_0x16b4dd,tdx:_0x5b58ce}=_0x289036;if(_0x16b4dd['length']===0x0)return console[_0x37fdd6(0x81)](_0x37fdd6(0x8d)),console['error'](_0x37fdd6(0xd1)),0x1;try{const {parentId:_0x2e7e,childId:_0x422f23}=parseSegmentRef(_0x16b4dd[0x0]);_0x199a94[_0x37fdd6(0xd7)]&&(console[_0x37fdd6(0x81)](_0x37fdd6(0xcf)+_0x199a94[_0x37fdd6(0x9e)]),console[_0x37fdd6(0x81)](_0x37fdd6(0x119)+_0x2e7e),_0x422f23&&console['error']('Folder\x20name:\x20'+_0x422f23));if(!_0x422f23)return console[_0x37fdd6(0x81)](_0x37fdd6(0x95)),0x1;const _0x47cebd=await withSpinner(_0x37fdd6(0xfb)+_0x2e7e+_0x37fdd6(0x94),()=>_0x5b58ce[_0x37fdd6(0x8e)][_0x37fdd6(0xc2)](_0x2e7e),{'verbose':_0x199a94[_0x37fdd6(0xd7)]}),_0x1946bb=_0x47cebd[_0x37fdd6(0xd9)];_0x199a94[_0x37fdd6(0xd7)]&&console[_0x37fdd6(0x81)]('Resolved\x20parent\x20ID:\x20'+_0x1946bb);const _0x219025=await withSpinner('Resolving\x20folder\x20\x27'+_0x422f23+_0x37fdd6(0x94),()=>_0x5b58ce[_0x37fdd6(0x8e)][_0x37fdd6(0xb0)](_0x1946bb,_0x422f23),{'verbose':_0x199a94['verbose']}),_0x2323ff=_0x219025['data'];_0x199a94[_0x37fdd6(0xd7)]&&console['error'](_0x37fdd6(0x91)+_0x2323ff);const _0x452e36=await withSpinner(_0x37fdd6(0xdc)+_0x422f23+_0x37fdd6(0x94),()=>_0x5b58ce['segment'][_0x37fdd6(0xe3)](_0x2323ff),{'verbose':_0x199a94['verbose']});return await handleSDKOutput([_0x452e36[_0x37fdd6(0xd9)]],_0x199a94),0x0;}catch(_0x3b204d){if(_0x3b204d instanceof SDKError)return console[_0x37fdd6(0x81)](_0x37fdd6(0xf1)+_0x3b204d[_0x37fdd6(0xba)]),_0x3b204d[_0x37fdd6(0xfd)]&&console['error'](_0x37fdd6(0x104)+_0x3b204d[_0x37fdd6(0xfd)]),0x1;throw _0x3b204d;}}}export class SegmentSQLCommand extends BaseCommand{[a25_0x9e26f2(0xd6)]=a25_0x9e26f2(0xb6);[a25_0x9e26f2(0xca)]=a25_0x9e26f2(0xb4);async[a25_0x9e26f2(0xa1)](_0x3a40d2){const _0x5c41ec=a25_0x9e26f2,{options:_0x29f6ca,args:_0x6850ad,tdx:_0x42d634}=_0x3a40d2,_0x4f4462=_0x6850ad[0x0];if(!_0x4f4462)return console[_0x5c41ec(0x81)](_0x5c41ec(0xfc)),console[_0x5c41ec(0x81)](_0x5c41ec(0x10f)),console['error']('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20sql\x20<path/to/segment.yml>'),console[_0x5c41ec(0x81)](_0x5c41ec(0xec)),console[_0x5c41ec(0x81)]('\x20\x20tdx\x20sg\x20sql\x20\x22Premium\x20Users\x22'),console[_0x5c41ec(0x81)](_0x5c41ec(0xbb)),0x1;try{const _0x449432=_0x29f6ca[_0x5c41ec(0xc7)],_0x1530af=await resolveSegmentTarget(_0x4f4462,_0x449432,_0x29f6ca[_0x5c41ec(0xd7)]);_0x29f6ca[_0x5c41ec(0xd7)]&&console[_0x5c41ec(0x81)]('Target\x20path:\x20'+_0x1530af);const _0x421684=await withSpinner(_0x5c41ec(0xd5)+_0x4f4462+_0x5c41ec(0x94),()=>_0x42d634['segment'][_0x5c41ec(0xe5)](_0x1530af),{'verbose':_0x29f6ca[_0x5c41ec(0xd7)]}),_0x1bca3f=_0x421684[_0x5c41ec(0xd9)];_0x29f6ca[_0x5c41ec(0xd7)]&&(console[_0x5c41ec(0x81)](_0x5c41ec(0x10d)+_0x1bca3f[_0x5c41ec(0x112)]),console[_0x5c41ec(0x81)](_0x5c41ec(0xbe)+_0x1bca3f[_0x5c41ec(0xee)]));if(_0x1bca3f[_0x5c41ec(0x112)]===_0x5c41ec(0xf2))return console[_0x5c41ec(0x81)]('Error:\x20Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.'),console['error'](_0x5c41ec(0x7c)),0x1;if(_0x1bca3f[_0x5c41ec(0x112)]===_0x5c41ec(0xc8))return console[_0x5c41ec(0x81)](_0x5c41ec(0x9a)),console['error'](_0x5c41ec(0x11b)),0x1;if(!_0x1bca3f[_0x5c41ec(0xb7)])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x5c41ec(0xab));const _0x3641b1=await withSpinner(_0x5c41ec(0x85),()=>_0x42d634[_0x5c41ec(0x8e)][_0x5c41ec(0xbf)](_0x1bca3f[_0x5c41ec(0xee)],_0x1bca3f[_0x5c41ec(0xb7)]),{'verbose':_0x29f6ca['verbose']}),_0x203597=_0x3641b1[_0x5c41ec(0xd9)];return _0x29f6ca['format']===_0x5c41ec(0xfe)||_0x29f6ca[_0x5c41ec(0xd2)]===_0x5c41ec(0xa9)?await handleSDKOutput([{'sql':_0x203597}],_0x29f6ca):console[_0x5c41ec(0xcc)](_0x203597),0x0;}catch(_0x3b9dc8){if(_0x3b9dc8 instanceof SDKError)return console[_0x5c41ec(0x81)]('Error:\x20'+_0x3b9dc8[_0x5c41ec(0xba)]),_0x3b9dc8[_0x5c41ec(0xfd)]&&console[_0x5c41ec(0x81)](_0x5c41ec(0x104)+_0x3b9dc8['cause']),0x1;throw _0x3b9dc8;}}}export class SegmentFolderCreateCommand extends BaseCommand{[a25_0x9e26f2(0xd6)]=a25_0x9e26f2(0xb5);['description']='Create\x20segment\x20folder\x20for\x20organization';async[a25_0x9e26f2(0xa1)](_0x3cab72){const _0x53c3cf=a25_0x9e26f2,{options:_0x2d1e96,args:_0x59c873,tdx:_0x30888c}=_0x3cab72,_0x596dbb=_0x2d1e96;if(_0x59c873['length']<0x2)return console[_0x53c3cf(0x81)]('Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required'),console[_0x53c3cf(0x81)]('Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]'),0x1;const _0x3d2a48=_0x59c873[0x0],_0x4d28d4=_0x59c873[0x1];_0x596dbb['verbose']&&(console[_0x53c3cf(0x81)](_0x53c3cf(0xcf)+_0x596dbb[_0x53c3cf(0x9e)]),console['error'](_0x53c3cf(0xd4)+_0x3d2a48),console['error'](_0x53c3cf(0x7b)+_0x4d28d4));let _0x4ff18b;if(_0x596dbb[_0x53c3cf(0xf5)]){const _0xfa94a7=_0x596dbb['parentFolder'],_0x41bf6d=await withSpinner(_0x53c3cf(0xfb)+_0x3d2a48+_0x53c3cf(0x94),()=>_0x30888c[_0x53c3cf(0x8e)][_0x53c3cf(0xc2)](_0x3d2a48),{'verbose':_0x596dbb[_0x53c3cf(0xd7)]}),_0x102330=_0x41bf6d['data'],_0x5ef361=await withSpinner(_0x53c3cf(0x9c)+_0xfa94a7+_0x53c3cf(0x94),()=>_0x30888c['segment']['resolveFolderId'](_0x102330,_0xfa94a7),{'verbose':_0x596dbb[_0x53c3cf(0xd7)]});_0x4ff18b=_0x5ef361[_0x53c3cf(0xd9)],_0x596dbb[_0x53c3cf(0xd7)]&&console[_0x53c3cf(0x81)](_0x53c3cf(0x116)+_0x4ff18b);}const _0x18d619={'name':_0x4d28d4,'description':_0x596dbb[_0x53c3cf(0xca)],'parentFolderId':_0x4ff18b},_0x93305f=await withSpinner(_0x53c3cf(0x83)+_0x4d28d4+_0x53c3cf(0x94),()=>_0x30888c[_0x53c3cf(0x8e)][_0x53c3cf(0x10b)](_0x3d2a48,_0x18d619),{'verbose':_0x596dbb[_0x53c3cf(0xd7)]}),_0x543f83=_0x93305f[_0x53c3cf(0xd9)];return console['error'](_0x53c3cf(0xe0)+_0x543f83[_0x53c3cf(0xd6)]+_0x53c3cf(0x114)+_0x543f83['id']),await handleSDKOutput([_0x543f83],_0x596dbb),0x0;}}export class SegmentViewCommand extends BaseCommand{[a25_0x9e26f2(0xd6)]='segment:view';['description']=a25_0x9e26f2(0xf3);async['execute'](_0x238db1){const _0x47fa2c=a25_0x9e26f2,{options:_0x5dd2e2,args:_0x290435,tdx:_0x2c829e}=_0x238db1,_0x1d400a=_0x290435[0x0];if(!_0x1d400a)return console['error'](_0x47fa2c(0x10e)),console[_0x47fa2c(0x81)](_0x47fa2c(0x7f)),console['error'](_0x47fa2c(0xf4)),console[_0x47fa2c(0x81)](_0x47fa2c(0x109)),console['error'](_0x47fa2c(0xf9)),console[_0x47fa2c(0x81)](_0x47fa2c(0xec)),console[_0x47fa2c(0x81)](_0x47fa2c(0x90)),console[_0x47fa2c(0x81)]('\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20\x20\x20\x20\x20#\x20View\x20child\x20segment\x20details'),console[_0x47fa2c(0x81)](_0x47fa2c(0x86)),console[_0x47fa2c(0x81)](_0x47fa2c(0x93)),0x1;try{const _0x37dd82=_0x5dd2e2['parentSegment'],_0x3e0f9b=await resolveSegmentTarget(_0x1d400a,_0x37dd82,_0x5dd2e2[_0x47fa2c(0xd7)]);_0x5dd2e2[_0x47fa2c(0xd7)]&&console['error']('Target\x20path:\x20'+_0x3e0f9b);const _0x2ebe18=await withSpinner(_0x47fa2c(0xd5)+_0x1d400a+_0x47fa2c(0x94),()=>_0x2c829e['segment'][_0x47fa2c(0xe5)](_0x3e0f9b),{'verbose':_0x5dd2e2[_0x47fa2c(0xd7)]}),_0x4ada32=_0x2ebe18[_0x47fa2c(0xd9)];_0x5dd2e2[_0x47fa2c(0xd7)]&&(console['error'](_0x47fa2c(0x10d)+_0x4ada32[_0x47fa2c(0x112)]),console['error'](_0x47fa2c(0xbe)+_0x4ada32['parentId']),_0x4ada32[_0x47fa2c(0xa6)]&&console[_0x47fa2c(0x81)](_0x47fa2c(0x100)+_0x4ada32['folderId']),_0x4ada32['segmentId']&&console[_0x47fa2c(0x81)](_0x47fa2c(0x92)+_0x4ada32[_0x47fa2c(0xb7)]));if(_0x5dd2e2[_0x47fa2c(0xc5)]){if(_0x4ada32[_0x47fa2c(0x112)]==='folder')return console[_0x47fa2c(0x81)](_0x47fa2c(0x7d)),0x1;if(_0x4ada32[_0x47fa2c(0x112)]===_0x47fa2c(0xc8))return console[_0x47fa2c(0x81)](_0x47fa2c(0xd8)),console[_0x47fa2c(0x81)](_0x47fa2c(0xce)),0x1;if(!_0x4ada32['segmentId'])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x47fa2c(0xab));const _0x2ad42d=getConsoleNextUrl(_0x5dd2e2[_0x47fa2c(0x9e)],_0x47fa2c(0xa5)+_0x4ada32[_0x47fa2c(0xee)]+_0x47fa2c(0x113)+_0x4ada32[_0x47fa2c(0xb7)]);return console[_0x47fa2c(0x81)](a25_0x17ea3a[_0x47fa2c(0xe6)]('✔')+_0x47fa2c(0x8c)+a25_0x17ea3a['cyan'](_0x2ad42d)),openBrowser(_0x2ad42d),0x0;}if(_0x4ada32[_0x47fa2c(0x112)]===_0x47fa2c(0xf2)){if(!_0x4ada32[_0x47fa2c(0xa6)])throw new SDKError(ErrorCode['SEGMENT_FOLDER_NOT_FOUND'],'Folder\x20ID\x20missing\x20from\x20resolved\x20path');const _0x19c730=await withSpinner(_0x47fa2c(0x9d),()=>_0x2c829e[_0x47fa2c(0x8e)][_0x47fa2c(0xe3)](_0x4ada32[_0x47fa2c(0xa6)]),{'verbose':_0x5dd2e2[_0x47fa2c(0xd7)]});await handleSingleObjectOutput(_0x19c730[_0x47fa2c(0xd9)],_0x5dd2e2);}else{if(_0x4ada32[_0x47fa2c(0x112)]===_0x47fa2c(0x8e)){if(!_0x4ada32[_0x47fa2c(0xb7)])throw new SDKError(ErrorCode[_0x47fa2c(0xb8)],_0x47fa2c(0xab));const _0x1a55e6=await withSpinner(_0x47fa2c(0xb1),()=>_0x2c829e['segment'][_0x47fa2c(0xc1)](_0x4ada32[_0x47fa2c(0xee)],_0x4ada32[_0x47fa2c(0xb7)]),{'verbose':_0x5dd2e2[_0x47fa2c(0xd7)]}),_0x597338=getConsoleNextUrl(_0x5dd2e2[_0x47fa2c(0x9e)],_0x47fa2c(0xa5)+_0x4ada32[_0x47fa2c(0xee)]+_0x47fa2c(0x113)+_0x4ada32[_0x47fa2c(0xb7)]),_0x7b07c0=_0x1a55e6['data'];_0x7b07c0[_0x47fa2c(0x106)]=_0x597338,await handleSingleObjectOutput(_0x7b07c0,_0x5dd2e2);}else return console['error'](_0x47fa2c(0x11a)),console[_0x47fa2c(0x81)]('Use:\x20tdx\x20ps\x20view'),0x1;}return 0x0;}catch(_0x319dd1){if(_0x319dd1 instanceof SDKError)return console['error']('Error:\x20'+_0x319dd1[_0x47fa2c(0xba)]),_0x319dd1['cause']&&console[_0x47fa2c(0x81)](_0x47fa2c(0x104)+_0x319dd1[_0x47fa2c(0xfd)]),0x1;throw _0x319dd1;}}}function a25_0x775b(_0x3f663e,_0x5733e6){_0x3f663e=_0x3f663e-0x7b;const _0x286277=a25_0x2862();let _0x775bce=_0x286277[_0x3f663e];return _0x775bce;}export const SegmentInfoCommand=SegmentViewCommand;export class SegmentDescCommand extends BaseCommand{[a25_0x9e26f2(0xd6)]='segment:desc';[a25_0x9e26f2(0xca)]='Show\x20child\x20segment\x20schema\x20(column\x20types)';async['execute'](_0x1b681a){const _0x19150c=a25_0x9e26f2,{options:_0x49e236,args:_0x23109e,tdx:_0xf70622}=_0x1b681a,_0x37e1e9=_0x23109e[0x0];if(!_0x37e1e9)return console[_0x19150c(0x81)](_0x19150c(0xfc)),console[_0x19150c(0x81)](_0x19150c(0x82)),console[_0x19150c(0x81)](_0x19150c(0x10c)),console[_0x19150c(0x81)](_0x19150c(0xec)),console[_0x19150c(0x81)](_0x19150c(0xac)),console['error']('\x20\x20tdx\x20sg\x20desc\x20segments/my-audience/premium-users.yml'),0x1;try{const _0x22c16d=_0x49e236[_0x19150c(0xc7)],_0x4847be=await resolveSegmentTarget(_0x37e1e9,_0x22c16d,_0x49e236[_0x19150c(0xd7)]);_0x49e236[_0x19150c(0xd7)]&&console['error']('Target\x20path:\x20'+_0x4847be);const _0x29d331=await withSpinner(_0x19150c(0xd5)+_0x37e1e9+_0x19150c(0x94),()=>_0xf70622[_0x19150c(0x8e)]['resolvePathToResource'](_0x4847be),{'verbose':_0x49e236[_0x19150c(0xd7)]}),_0x386677=_0x29d331['data'];_0x49e236[_0x19150c(0xd7)]&&(console[_0x19150c(0x81)](_0x19150c(0x10d)+_0x386677['type']),console[_0x19150c(0x81)](_0x19150c(0xbe)+_0x386677[_0x19150c(0xee)]));if(_0x386677[_0x19150c(0x112)]==='folder')return console[_0x19150c(0x81)]('Error:\x20Cannot\x20show\x20schema\x20for\x20a\x20folder.'),console['error']('Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.'),0x1;if(_0x386677[_0x19150c(0x112)]===_0x19150c(0xc8))return console['error']('Error:\x20Cannot\x20show\x20schema\x20for\x20parent\x20segment\x20with\x20this\x20command.'),console[_0x19150c(0x81)](_0x19150c(0x88)),0x1;if(!_0x386677[_0x19150c(0xb7)])throw new SDKError(ErrorCode[_0x19150c(0xb8)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x3504de=await withSpinner(_0x19150c(0x85),()=>_0xf70622['segment']['getSegmentSQL'](_0x386677[_0x19150c(0xee)],_0x386677['segmentId']),{'verbose':_0x49e236['verbose']}),_0x47f54e=_0x3504de[_0x19150c(0xd9)],_0xc631ae=await executeSchemaQuery(_0x47f54e,_0xf70622,_0x49e236);return await handleQueryOutput(_0xc631ae,_0x49e236),0x0;}catch(_0x5b795c){if(_0x5b795c instanceof SDKError)return console['error']('Error:\x20'+_0x5b795c[_0x19150c(0xba)]),_0x5b795c[_0x19150c(0xfd)]&&console[_0x19150c(0x81)](_0x19150c(0x104)+_0x5b795c[_0x19150c(0xfd)]),0x1;throw _0x5b795c;}}}
1
+ const a25_0x3f95e6=a25_0x3463;(function(_0x5a6cc8,_0x1fef0a){const _0x4529de=a25_0x3463,_0xd49418=_0x5a6cc8();while(!![]){try{const _0x3b0d84=-parseInt(_0x4529de(0x1f7))/0x1+parseInt(_0x4529de(0x23f))/0x2+-parseInt(_0x4529de(0x253))/0x3*(-parseInt(_0x4529de(0x1c9))/0x4)+parseInt(_0x4529de(0x1fa))/0x5*(parseInt(_0x4529de(0x25a))/0x6)+-parseInt(_0x4529de(0x250))/0x7*(parseInt(_0x4529de(0x1c8))/0x8)+-parseInt(_0x4529de(0x258))/0x9+parseInt(_0x4529de(0x1d3))/0xa;if(_0x3b0d84===_0x1fef0a)break;else _0xd49418['push'](_0xd49418['shift']());}catch(_0x5e66a2){_0xd49418['push'](_0xd49418['shift']());}}}(a25_0x2b47,0x3b552));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner,formatElapsed}from'../utils/spinner.js';import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';function a25_0x2b47(){const _0x4f0373=['Usage:\x20tdx\x20sg\x20view\x20<name>\x20[-w]','segment:folder:show','\x20\x20Cause:\x20','parentSegment','segment:show','Fetching\x20parent\x20segment\x20details...','web','Fetching\x20SQL\x20for\x20segment...','\x27\x20with\x20ID:\x20','getSegment','jobId','✔\x20Found\x20','SEGMENT_NOT_FOUND','resolveFolderId','Error:\x20Path\x20or\x20name\x20is\x20required','Examples:','Use:\x20tdx\x20sg\x20view\x20<name>\x20\x20#\x20To\x20show\x20folder\x20details','listFolders','resolvePathToResource','Use:\x20tdx\x20ps\x20view','Resolving\x20parent\x20segment\x20\x27','Folder\x20ID:\x20','Fetching\x20segment\x20details...','setJobId','message','Folder\x20name:\x20','\x20Opening\x20','Error:\x20Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.','✔\x20Query\x20completed:\x20Processed\x20','/e/','\x20\x20tdx\x20sg\x20desc\x20\x22Premium\x20Users\x22','url','segment:sql','Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]','\x20\x20tdx\x20sg\x20show\x20segments/my-audience/premium-users.yml','Fetching\x20folder\x20details...','segmentId','length','in\x20','segment','Error:\x20','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','Resolved\x20folder\x20ID:\x20','Resolved\x20parent\x20folder\x20ID:\x20','trim','Show\x20folder\x20or\x20child\x20segment\x20details','segment:desc','replace','format','INVALID_ARGUMENT','getFolder','\x20\x20Full\x20path:\x20','330660MULdDD','resolveParentId','segmentName','Creating\x20folder\x20\x27','data','Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.','\x20\x20tdx\x20sg\x20sql\x20segments/my-audience/premium-users.yml','Parent\x20ID:\x20','Resolving\x20path\x20\x27','Resolving\x20parent\x20folder\x20\x27','Show\x20child\x20segment\x20schema\x20(column\x20types)','execute','Use:\x20tdx\x20ps\x20view\x20-w','Error:\x20Cannot\x20open\x20parent\x20segment\x20with\x20this\x20command.','Error:\x20Cannot\x20show\x20schema\x20for\x20a\x20folder.','type','green','7paxYiq','Error:\x20Cannot\x20execute\x20query\x20for\x20parent\x20segment\x20with\x20this\x20command.','Resolved\x20parent\x20ID:\x20','3eQQQSE','error','Parent\x20name:\x20','getSegmentSQL','Resolved\x20relative\x20path\x20to:\x20','3565872RTAUxo','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22','2257284UPmIRA','\x20\x20tdx\x20sg\x20sql\x20\x22Premium\x20Users\x22','parent','Error:\x20Cannot\x20view\x20parent\x20segment\x20details\x20with\x20this\x20command.','segment:folder:list','test','\x20[Job\x20ID:\x20','1896520FghGmI','389392TNEpwL','(root)','jsonl','Fetching\x20folder\x20\x27','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22','segmentPath','List\x20segment\x20folders\x20under\x20a\x20parent\x20segment','log','Site:\x20','Error:\x20Folder\x20reference\x20is\x20required','5729960ORizgH','elapsedTimeMillis','Error:\x20Parent\x20segment\x20name\x20is\x20required','SEGMENT_FOLDER_NOT_FOUND','includes','Target\x20path:\x20','parentId','verbose','\x20\x20Segment\x20name:\x20','SQL\x20query:\x0a','\x20\x20Parent\x20segment:\x20','description','stats','Error:\x20Cannot\x20open\x20folder\x20in\x20web\x20browser.\x20Use\x20a\x20segment\x20name\x20instead.','information_schema','\x27...','folderPath','Segment\x20ID:\x20','name','createFolder','\x20rows\x20','\x20\x20tdx\x20sg\x20view\x20\x22Marketing\x22\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20folder\x20details','fullPath','Resolved\x20YAML\x20file:\x20','Listing\x20folders\x20for\x20parent\x20\x27','Error:\x20Cannot\x20get\x20SQL\x20for\x20parent\x20segment\x20with\x20this\x20command.','segment:view','Folder\x20ID\x20missing\x20from\x20resolved\x20path','✖\x20Query\x20failed\x20[','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','cyan','Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)','/app/ps/','cause','Show\x20segment\x20or\x20folder\x20details','Resolving\x20folder\x20\x27','335589dOobUn','Error:\x20Folder\x20or\x20segment\x20name,\x20or\x20YAML\x20file\x20path\x20is\x20required','segment:describe','5gAmkEa','Resolving\x20\x27','Resolved\x20type:\x20','\x20\x20tdx\x20sg\x20desc\x20segments/my-audience/premium-users.yml','folderId','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20view\x20<path/to/segment.yml>','Segment\x20ID\x20missing\x20from\x20resolved\x20path','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','Use:\x20tdx\x20ps\x20desc','Error:\x20Cannot\x20show\x20schema\x20for\x20parent\x20segment\x20with\x20this\x20command.','site','Use:\x20tdx\x20ps\x20sql','Execute\x20child\x20segment\x20SQL\x20query\x20and\x20show\x20results','Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>','Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required','folder','SELECT\x20*\x20FROM\x20(\x0a'];a25_0x2b47=function(){return _0x4f0373;};return a25_0x2b47();}import{executeSchemaQuery}from'../sdk/segment/fields-display.js';import{isYamlFilePath,resolveYamlFilePath}from'../sdk/segment/segment-path-parser.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{openBrowser}from'../utils/process.js';import a25_0x120088 from'chalk';async function resolveSegmentTarget(_0xc12441,_0x200eb2,_0x44e101){const _0xe44981=a25_0x3463;if(isYamlFilePath(_0xc12441))try{const _0x5147d7=await resolveYamlFilePath(_0xc12441);return _0x44e101&&(console[_0xe44981(0x254)](_0xe44981(0x1ea)+_0xc12441),console['error'](_0xe44981(0x1dd)+_0x5147d7[_0xe44981(0x20e)]),console[_0xe44981(0x254)](_0xe44981(0x1db)+_0x5147d7[_0xe44981(0x241)]),console[_0xe44981(0x254)]('\x20\x20Folder\x20path:\x20'+(_0x5147d7[_0xe44981(0x1e3)]||_0xe44981(0x1ca))),console[_0xe44981(0x254)](_0xe44981(0x23e)+_0x5147d7[_0xe44981(0x1e9)])),_0x5147d7[_0xe44981(0x1e9)];}catch(_0x373c31){throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0xe44981(0x1f0)+_0x373c31[_0xe44981(0x223)]);}if(!_0x200eb2)throw new SDKError(ErrorCode[_0xe44981(0x23c)],_0xe44981(0x234));return _0x200eb2+'/'+_0xc12441;}export class SegmentDescribeCommand extends BaseCommand{[a25_0x3f95e6(0x1e5)]=a25_0x3f95e6(0x1f9);['description']=a25_0x3f95e6(0x1f5);async[a25_0x3f95e6(0x24a)](_0x21875d){const _0x1e1883=a25_0x3f95e6,{options:_0x269a87,args:_0x1af22e,tdx:_0x347aca}=_0x21875d,_0x109d22=_0x1af22e[0x0],_0x363054=!_0x109d22&&!!_0x269a87[_0x1e1883(0x20e)],_0x39d12b=_0x109d22||_0x269a87[_0x1e1883(0x20e)];if(!_0x39d12b)return console['error'](_0x1e1883(0x219)),console[_0x1e1883(0x254)]('Usage:\x20tdx\x20segment\x20describe\x20<path>'),console[_0x1e1883(0x254)](_0x1e1883(0x21a)),console[_0x1e1883(0x254)](_0x1e1883(0x259)),console[_0x1e1883(0x254)](_0x1e1883(0x1cd)),console[_0x1e1883(0x254)]('\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context'),console['error'](_0x1e1883(0x201)),0x1;try{const _0x5a8692=_0x269a87[_0x1e1883(0x1ce)];let _0xdaf8db=_0x39d12b;!_0x363054&&_0x5a8692&&!_0x39d12b[_0x1e1883(0x1d7)]('/')&&(_0xdaf8db=_0x5a8692+'/'+_0x39d12b,_0x269a87[_0x1e1883(0x1da)]&&console[_0x1e1883(0x254)](_0x1e1883(0x257)+_0xdaf8db));const _0x42f970=await withSpinner(_0x1e1883(0x247)+_0xdaf8db+_0x1e1883(0x1e2),()=>_0x347aca[_0x1e1883(0x232)][_0x1e1883(0x21d)](_0xdaf8db),{'verbose':_0x269a87[_0x1e1883(0x1da)]}),_0x4cde32=_0x42f970[_0x1e1883(0x243)];_0x269a87[_0x1e1883(0x1da)]&&(console[_0x1e1883(0x254)]('Resolved\x20type:\x20'+_0x4cde32['type']),console['error']('Parent\x20ID:\x20'+_0x4cde32[_0x1e1883(0x1d9)]),_0x4cde32[_0x1e1883(0x1fe)]&&console[_0x1e1883(0x254)](_0x1e1883(0x220)+_0x4cde32[_0x1e1883(0x1fe)]),_0x4cde32[_0x1e1883(0x22f)]&&console[_0x1e1883(0x254)](_0x1e1883(0x1e4)+_0x4cde32[_0x1e1883(0x22f)]));if(_0x4cde32['type']===_0x1e1883(0x25c)){const _0x35234c=await withSpinner(_0x1e1883(0x210),()=>_0x347aca[_0x1e1883(0x232)]['getParent'](_0x4cde32['parentId']),{'verbose':_0x269a87[_0x1e1883(0x1da)]});await handleSingleObjectOutput(_0x35234c[_0x1e1883(0x243)],_0x269a87);}else{if(_0x4cde32[_0x1e1883(0x24e)]===_0x1e1883(0x209)){if(!_0x4cde32['folderId'])throw new SDKError(ErrorCode['SEGMENT_FOLDER_NOT_FOUND'],_0x1e1883(0x1ee));const _0x4e8eb9=await withSpinner(_0x1e1883(0x22e),()=>_0x347aca[_0x1e1883(0x232)][_0x1e1883(0x23d)](_0x4cde32[_0x1e1883(0x1fe)]),{'verbose':_0x269a87['verbose']});await handleSingleObjectOutput(_0x4e8eb9[_0x1e1883(0x243)],_0x269a87);}else{if(_0x4cde32[_0x1e1883(0x24e)]===_0x1e1883(0x232)){if(!_0x4cde32[_0x1e1883(0x22f)])throw new SDKError(ErrorCode[_0x1e1883(0x217)],_0x1e1883(0x200));const _0x4990c0=await withSpinner(_0x1e1883(0x221),()=>_0x347aca[_0x1e1883(0x232)][_0x1e1883(0x214)](_0x4cde32['parentId'],_0x4cde32[_0x1e1883(0x22f)]),{'verbose':_0x269a87[_0x1e1883(0x1da)]});await handleSingleObjectOutput(_0x4990c0[_0x1e1883(0x243)],_0x269a87);}}}return 0x0;}catch(_0xa28c6d){if(_0xa28c6d instanceof SDKError)return console[_0x1e1883(0x254)](_0x1e1883(0x233)+_0xa28c6d[_0x1e1883(0x223)]),_0xa28c6d[_0x1e1883(0x1f4)]&&console['error'](_0x1e1883(0x20d)+_0xa28c6d['cause']),0x1;throw _0xa28c6d;}}}export class SegmentShowCommand extends BaseCommand{[a25_0x3f95e6(0x1e5)]=a25_0x3f95e6(0x20f);[a25_0x3f95e6(0x1de)]=a25_0x3f95e6(0x206);async[a25_0x3f95e6(0x24a)](_0x54ae44){const _0x612eb=a25_0x3f95e6,{options:_0x168a0d,args:_0x412e39,tdx:_0x365209}=_0x54ae44,_0x2dff95=_0x412e39[0x0];if(!_0x2dff95)return console[_0x612eb(0x254)]('Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required'),console[_0x612eb(0x254)]('Usage:\x20tdx\x20sg\x20show\x20<name>'),console[_0x612eb(0x254)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20show\x20<path/to/segment.yml>'),console[_0x612eb(0x254)]('Examples:'),console[_0x612eb(0x254)]('\x20\x20tdx\x20sg\x20show\x20\x22Premium\x20Users\x22'),console[_0x612eb(0x254)](_0x612eb(0x22d)),0x1;try{const _0x3e704e=_0x168a0d[_0x612eb(0x20e)],_0x4ec11e=await resolveSegmentTarget(_0x2dff95,_0x3e704e,_0x168a0d[_0x612eb(0x1da)]);_0x168a0d[_0x612eb(0x1da)]&&console['error'](_0x612eb(0x1d8)+_0x4ec11e);const _0x1d1ab4=await withSpinner('Resolving\x20\x27'+_0x2dff95+'\x27...',()=>_0x365209[_0x612eb(0x232)][_0x612eb(0x21d)](_0x4ec11e),{'verbose':_0x168a0d['verbose']}),_0xfcf470=_0x1d1ab4[_0x612eb(0x243)];_0x168a0d[_0x612eb(0x1da)]&&(console[_0x612eb(0x254)](_0x612eb(0x1fc)+_0xfcf470[_0x612eb(0x24e)]),console[_0x612eb(0x254)](_0x612eb(0x246)+_0xfcf470[_0x612eb(0x1d9)]));if(_0xfcf470['type']===_0x612eb(0x209))return console[_0x612eb(0x254)](_0x612eb(0x244)),console[_0x612eb(0x254)](_0x612eb(0x21b)),0x1;if(_0xfcf470[_0x612eb(0x24e)]===_0x612eb(0x25c))return console['error'](_0x612eb(0x251)),console[_0x612eb(0x254)]('Use:\x20tdx\x20ps\x20show'),0x1;if(!_0xfcf470[_0x612eb(0x22f)])throw new SDKError(ErrorCode[_0x612eb(0x217)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x2966db=await withSpinner(_0x612eb(0x212),()=>_0x365209[_0x612eb(0x232)][_0x612eb(0x256)](_0xfcf470[_0x612eb(0x1d9)],_0xfcf470[_0x612eb(0x22f)]),{'verbose':_0x168a0d[_0x612eb(0x1da)]});let _0x1bceb0=_0x2966db[_0x612eb(0x243)];const _0x5f1042=resolveLimit(_0x168a0d['limit'],DEFAULT_DISPLAY_LIMIT),_0xf102b1=/\bLIMIT\s+\d+/i[_0x612eb(0x1c6)](_0x1bceb0);!_0xf102b1&&(_0x1bceb0=_0x1bceb0[_0x612eb(0x237)]()[_0x612eb(0x23a)](/;+$/,''),_0x1bceb0=_0x612eb(0x20a)+_0x1bceb0+'\x0a)\x20AS\x20segment_query\x0aLIMIT\x20'+_0x5f1042);_0x168a0d[_0x612eb(0x1da)]&&console[_0x612eb(0x254)](_0x612eb(0x1dc)+_0x1bceb0);const _0x2a6161=await withProgressSpinner('Executing\x20segment\x20query...',async _0x28a2d5=>{const _0x1d486c=_0x612eb,_0x463955=await _0x365209['query'][_0x1d486c(0x24a)](_0x1bceb0,{'catalog':'td','schema':_0x1d486c(0x1e1),'onJobId':_0x46a631=>{const _0x42a8b7=_0x1d486c;_0x28a2d5[_0x42a8b7(0x222)](_0x46a631);}});return _0x463955;},{'verbose':_0x168a0d[_0x612eb(0x1da)]}),_0x1d8e9c=_0x2a6161['data'],_0x49c767=_0x1d8e9c['jobId']?_0x612eb(0x1c7)+_0x1d8e9c[_0x612eb(0x215)]+']':'';return console[_0x612eb(0x254)](_0x612eb(0x227)+_0x1d8e9c[_0x612eb(0x1df)]['processedRows']['toLocaleString']()+_0x612eb(0x1e7)+(_0x612eb(0x231)+formatElapsed(_0x1d8e9c['stats'][_0x612eb(0x1d4)])+_0x49c767)),await handleQueryOutput(_0x1d8e9c,_0x168a0d),0x0;}catch(_0x5f017b){if(_0x5f017b instanceof SDKError)return console['error'](_0x612eb(0x1ef)+_0x5f017b['code']+']'),console[_0x612eb(0x254)]('\x0a'+_0x5f017b['message']),0x1;throw _0x5f017b;}}}export class SegmentFolderListCommand extends BaseCommand{[a25_0x3f95e6(0x1e5)]=a25_0x3f95e6(0x1c5);[a25_0x3f95e6(0x1de)]=a25_0x3f95e6(0x1cf);async['execute'](_0x142cde){const _0x159f20=a25_0x3f95e6,{options:_0x3be13a,args:_0x223933,tdx:_0x1bbd62}=_0x142cde;if(_0x223933[_0x159f20(0x230)]===0x0)return console[_0x159f20(0x254)](_0x159f20(0x1d5)),console['error']('Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>'),0x1;const _0x38313b=_0x223933[0x0];try{_0x3be13a[_0x159f20(0x1da)]&&(console[_0x159f20(0x254)](_0x159f20(0x1d1)+_0x3be13a[_0x159f20(0x204)]),console[_0x159f20(0x254)](_0x159f20(0x255)+_0x38313b));const _0x366c86=await withSpinner(_0x159f20(0x21f)+_0x38313b+_0x159f20(0x1e2),()=>_0x1bbd62[_0x159f20(0x232)][_0x159f20(0x240)](_0x38313b),{'verbose':_0x3be13a[_0x159f20(0x1da)]}),_0x2f75b8=_0x366c86[_0x159f20(0x243)];_0x3be13a[_0x159f20(0x1da)]&&console['error']('Resolved\x20parent\x20ID:\x20'+_0x2f75b8);const _0x9327bd=await withSpinner(_0x159f20(0x1eb)+_0x38313b+_0x159f20(0x1e2),()=>_0x1bbd62['segment'][_0x159f20(0x21c)](_0x2f75b8),{'verbose':_0x3be13a[_0x159f20(0x1da)]}),_0x2c936e=_0x9327bd[_0x159f20(0x243)];return console[_0x159f20(0x254)](_0x159f20(0x216)+_0x2c936e[_0x159f20(0x230)]+'\x20folder'+(_0x2c936e[_0x159f20(0x230)]!==0x1?'s':'')),await handleSDKOutput(_0x2c936e,_0x3be13a),0x0;}catch(_0x26efcb){if(_0x26efcb instanceof SDKError)return console[_0x159f20(0x254)](_0x159f20(0x233)+_0x26efcb[_0x159f20(0x223)]),_0x26efcb[_0x159f20(0x1f4)]&&console[_0x159f20(0x254)](_0x159f20(0x20d)+_0x26efcb['cause']),0x1;throw _0x26efcb;}}}export class SegmentFolderShowCommand extends BaseCommand{[a25_0x3f95e6(0x1e5)]=a25_0x3f95e6(0x20c);[a25_0x3f95e6(0x1de)]='Show\x20segment\x20folder\x20details';async[a25_0x3f95e6(0x24a)](_0x352502){const _0x4bb97c=a25_0x3f95e6,{options:_0x287762,args:_0x45580f,tdx:_0x50929a}=_0x352502;if(_0x45580f['length']===0x0)return console[_0x4bb97c(0x254)](_0x4bb97c(0x1d2)),console['error'](_0x4bb97c(0x207)),0x1;try{const {parentId:_0x1fe250,childId:_0x40c843}=parseSegmentRef(_0x45580f[0x0]);_0x287762[_0x4bb97c(0x1da)]&&(console['error'](_0x4bb97c(0x1d1)+_0x287762[_0x4bb97c(0x204)]),console[_0x4bb97c(0x254)](_0x4bb97c(0x255)+_0x1fe250),_0x40c843&&console['error'](_0x4bb97c(0x224)+_0x40c843));if(!_0x40c843)return console[_0x4bb97c(0x254)](_0x4bb97c(0x1f2)),0x1;const _0x4abfe8=await withSpinner(_0x4bb97c(0x21f)+_0x1fe250+_0x4bb97c(0x1e2),()=>_0x50929a[_0x4bb97c(0x232)]['resolveParentId'](_0x1fe250),{'verbose':_0x287762[_0x4bb97c(0x1da)]}),_0x323b2a=_0x4abfe8[_0x4bb97c(0x243)];_0x287762[_0x4bb97c(0x1da)]&&console[_0x4bb97c(0x254)](_0x4bb97c(0x252)+_0x323b2a);const _0x2e9b5a=await withSpinner(_0x4bb97c(0x1f6)+_0x40c843+_0x4bb97c(0x1e2),()=>_0x50929a[_0x4bb97c(0x232)][_0x4bb97c(0x218)](_0x323b2a,_0x40c843),{'verbose':_0x287762[_0x4bb97c(0x1da)]}),_0x7fbc6d=_0x2e9b5a[_0x4bb97c(0x243)];_0x287762[_0x4bb97c(0x1da)]&&console['error'](_0x4bb97c(0x235)+_0x7fbc6d);const _0x18b7ef=await withSpinner(_0x4bb97c(0x1cc)+_0x40c843+_0x4bb97c(0x1e2),()=>_0x50929a[_0x4bb97c(0x232)][_0x4bb97c(0x23d)](_0x7fbc6d),{'verbose':_0x287762[_0x4bb97c(0x1da)]});return await handleSDKOutput([_0x18b7ef[_0x4bb97c(0x243)]],_0x287762),0x0;}catch(_0x398939){if(_0x398939 instanceof SDKError)return console[_0x4bb97c(0x254)](_0x4bb97c(0x233)+_0x398939['message']),_0x398939[_0x4bb97c(0x1f4)]&&console[_0x4bb97c(0x254)]('\x20\x20Cause:\x20'+_0x398939[_0x4bb97c(0x1f4)]),0x1;throw _0x398939;}}}function a25_0x3463(_0x2d8add,_0x554415){_0x2d8add=_0x2d8add-0x1c5;const _0x2b476f=a25_0x2b47();let _0x34632e=_0x2b476f[_0x2d8add];return _0x34632e;}export class SegmentSQLCommand extends BaseCommand{[a25_0x3f95e6(0x1e5)]=a25_0x3f95e6(0x22b);['description']='Get\x20SQL\x20query\x20for\x20child\x20segment';async[a25_0x3f95e6(0x24a)](_0x50369a){const _0xf14ecf=a25_0x3f95e6,{options:_0x56cad9,args:_0x432e89,tdx:_0x575854}=_0x50369a,_0x2ded48=_0x432e89[0x0];if(!_0x2ded48)return console[_0xf14ecf(0x254)](_0xf14ecf(0x208)),console[_0xf14ecf(0x254)]('Usage:\x20tdx\x20sg\x20sql\x20<name>'),console['error']('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20sql\x20<path/to/segment.yml>'),console[_0xf14ecf(0x254)](_0xf14ecf(0x21a)),console[_0xf14ecf(0x254)](_0xf14ecf(0x25b)),console['error'](_0xf14ecf(0x245)),0x1;try{const _0x4970bc=_0x56cad9[_0xf14ecf(0x20e)],_0x3b44fc=await resolveSegmentTarget(_0x2ded48,_0x4970bc,_0x56cad9[_0xf14ecf(0x1da)]);_0x56cad9['verbose']&&console[_0xf14ecf(0x254)](_0xf14ecf(0x1d8)+_0x3b44fc);const _0x266ca0=await withSpinner(_0xf14ecf(0x1fb)+_0x2ded48+'\x27...',()=>_0x575854['segment'][_0xf14ecf(0x21d)](_0x3b44fc),{'verbose':_0x56cad9[_0xf14ecf(0x1da)]}),_0x27d8ed=_0x266ca0[_0xf14ecf(0x243)];_0x56cad9[_0xf14ecf(0x1da)]&&(console[_0xf14ecf(0x254)](_0xf14ecf(0x1fc)+_0x27d8ed[_0xf14ecf(0x24e)]),console[_0xf14ecf(0x254)](_0xf14ecf(0x246)+_0x27d8ed[_0xf14ecf(0x1d9)]));if(_0x27d8ed[_0xf14ecf(0x24e)]===_0xf14ecf(0x209))return console[_0xf14ecf(0x254)](_0xf14ecf(0x226)),console[_0xf14ecf(0x254)]('Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.'),0x1;if(_0x27d8ed['type']===_0xf14ecf(0x25c))return console['error'](_0xf14ecf(0x1ec)),console[_0xf14ecf(0x254)](_0xf14ecf(0x205)),0x1;if(!_0x27d8ed[_0xf14ecf(0x22f)])throw new SDKError(ErrorCode[_0xf14ecf(0x217)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x173c14=await withSpinner(_0xf14ecf(0x212),()=>_0x575854['segment'][_0xf14ecf(0x256)](_0x27d8ed[_0xf14ecf(0x1d9)],_0x27d8ed[_0xf14ecf(0x22f)]),{'verbose':_0x56cad9['verbose']}),_0x57b153=_0x173c14[_0xf14ecf(0x243)];return _0x56cad9[_0xf14ecf(0x23b)]==='json'||_0x56cad9[_0xf14ecf(0x23b)]===_0xf14ecf(0x1cb)?await handleSDKOutput([{'sql':_0x57b153}],_0x56cad9):console[_0xf14ecf(0x1d0)](_0x57b153),0x0;}catch(_0x235eb7){if(_0x235eb7 instanceof SDKError)return console[_0xf14ecf(0x254)](_0xf14ecf(0x233)+_0x235eb7[_0xf14ecf(0x223)]),_0x235eb7['cause']&&console['error'](_0xf14ecf(0x20d)+_0x235eb7[_0xf14ecf(0x1f4)]),0x1;throw _0x235eb7;}}}export class SegmentFolderCreateCommand extends BaseCommand{[a25_0x3f95e6(0x1e5)]='segment:folder:create';[a25_0x3f95e6(0x1de)]='Create\x20segment\x20folder\x20for\x20organization';async['execute'](_0x2f8f3e){const _0x2303b9=a25_0x3f95e6,{options:_0x1b2499,args:_0x15884b,tdx:_0x454187}=_0x2f8f3e,_0x330660=_0x1b2499;if(_0x15884b[_0x2303b9(0x230)]<0x2)return console['error']('Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required'),console['error'](_0x2303b9(0x22c)),0x1;const _0x547eea=_0x15884b[0x0],_0x21a8ab=_0x15884b[0x1];_0x330660['verbose']&&(console[_0x2303b9(0x254)]('Site:\x20'+_0x330660['site']),console[_0x2303b9(0x254)]('Parent\x20segment:\x20'+_0x547eea),console[_0x2303b9(0x254)](_0x2303b9(0x224)+_0x21a8ab));let _0x3e7657;if(_0x330660['parentFolder']){const _0x2d4c98=_0x330660['parentFolder'],_0x5d4869=await withSpinner(_0x2303b9(0x21f)+_0x547eea+_0x2303b9(0x1e2),()=>_0x454187['segment'][_0x2303b9(0x240)](_0x547eea),{'verbose':_0x330660[_0x2303b9(0x1da)]}),_0x278543=_0x5d4869[_0x2303b9(0x243)],_0xf1957f=await withSpinner(_0x2303b9(0x248)+_0x2d4c98+_0x2303b9(0x1e2),()=>_0x454187[_0x2303b9(0x232)][_0x2303b9(0x218)](_0x278543,_0x2d4c98),{'verbose':_0x330660['verbose']});_0x3e7657=_0xf1957f[_0x2303b9(0x243)],_0x330660[_0x2303b9(0x1da)]&&console[_0x2303b9(0x254)](_0x2303b9(0x236)+_0x3e7657);}const _0x4bedf8={'name':_0x21a8ab,'description':_0x330660[_0x2303b9(0x1de)],'parentFolderId':_0x3e7657},_0x1aac8e=await withSpinner(_0x2303b9(0x242)+_0x21a8ab+'\x27...',()=>_0x454187['segment'][_0x2303b9(0x1e6)](_0x547eea,_0x4bedf8),{'verbose':_0x330660[_0x2303b9(0x1da)]}),_0x46040a=_0x1aac8e['data'];return console[_0x2303b9(0x254)]('✔\x20Created\x20folder\x20\x27'+_0x46040a['name']+_0x2303b9(0x213)+_0x46040a['id']),await handleSDKOutput([_0x46040a],_0x330660),0x0;}}export class SegmentViewCommand extends BaseCommand{['name']=a25_0x3f95e6(0x1ed);[a25_0x3f95e6(0x1de)]=a25_0x3f95e6(0x238);async['execute'](_0x2e0b91){const _0x3bf830=a25_0x3f95e6,{options:_0x59ad4c,args:_0x2846d2,tdx:_0x3ffb06}=_0x2e0b91,_0x59a0fb=_0x2846d2[0x0];if(!_0x59a0fb)return console[_0x3bf830(0x254)](_0x3bf830(0x1f8)),console[_0x3bf830(0x254)](_0x3bf830(0x20b)),console[_0x3bf830(0x254)](_0x3bf830(0x1ff)),console['error']('Options:'),console[_0x3bf830(0x254)]('\x20\x20-w,\x20--web\x20\x20Open\x20segment\x20in\x20web\x20browser'),console[_0x3bf830(0x254)]('Examples:'),console['error'](_0x3bf830(0x1e8)),console['error']('\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20\x20\x20\x20\x20#\x20View\x20child\x20segment\x20details'),console['error']('\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20-w\x20\x20#\x20Open\x20segment\x20in\x20web\x20browser'),console['error']('\x20\x20tdx\x20sg\x20view\x20segments/my-audience/premium-users.yml'),0x1;try{const _0x5eefdb=_0x59ad4c['parentSegment'],_0xd713b0=await resolveSegmentTarget(_0x59a0fb,_0x5eefdb,_0x59ad4c[_0x3bf830(0x1da)]);_0x59ad4c[_0x3bf830(0x1da)]&&console['error'](_0x3bf830(0x1d8)+_0xd713b0);const _0x8e653c=await withSpinner('Resolving\x20\x27'+_0x59a0fb+_0x3bf830(0x1e2),()=>_0x3ffb06[_0x3bf830(0x232)][_0x3bf830(0x21d)](_0xd713b0),{'verbose':_0x59ad4c['verbose']}),_0x19ded9=_0x8e653c[_0x3bf830(0x243)];_0x59ad4c[_0x3bf830(0x1da)]&&(console[_0x3bf830(0x254)](_0x3bf830(0x1fc)+_0x19ded9[_0x3bf830(0x24e)]),console[_0x3bf830(0x254)](_0x3bf830(0x246)+_0x19ded9['parentId']),_0x19ded9[_0x3bf830(0x1fe)]&&console[_0x3bf830(0x254)]('Folder\x20ID:\x20'+_0x19ded9[_0x3bf830(0x1fe)]),_0x19ded9['segmentId']&&console['error']('Segment\x20ID:\x20'+_0x19ded9['segmentId']));if(_0x59ad4c[_0x3bf830(0x211)]){if(_0x19ded9['type']===_0x3bf830(0x209))return console['error'](_0x3bf830(0x1e0)),0x1;if(_0x19ded9[_0x3bf830(0x24e)]==='parent')return console[_0x3bf830(0x254)](_0x3bf830(0x24c)),console[_0x3bf830(0x254)](_0x3bf830(0x24b)),0x1;if(!_0x19ded9[_0x3bf830(0x22f)])throw new SDKError(ErrorCode[_0x3bf830(0x217)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x53f22c=getConsoleNextUrl(_0x59ad4c[_0x3bf830(0x204)],_0x3bf830(0x1f3)+_0x19ded9['parentId']+_0x3bf830(0x228)+_0x19ded9[_0x3bf830(0x22f)]);return console['error'](a25_0x120088[_0x3bf830(0x24f)]('✔')+_0x3bf830(0x225)+a25_0x120088[_0x3bf830(0x1f1)](_0x53f22c)),openBrowser(_0x53f22c),0x0;}if(_0x19ded9[_0x3bf830(0x24e)]==='folder'){if(!_0x19ded9[_0x3bf830(0x1fe)])throw new SDKError(ErrorCode[_0x3bf830(0x1d6)],_0x3bf830(0x1ee));const _0x2de59e=await withSpinner(_0x3bf830(0x22e),()=>_0x3ffb06[_0x3bf830(0x232)][_0x3bf830(0x23d)](_0x19ded9['folderId']),{'verbose':_0x59ad4c[_0x3bf830(0x1da)]});await handleSingleObjectOutput(_0x2de59e[_0x3bf830(0x243)],_0x59ad4c);}else{if(_0x19ded9['type']===_0x3bf830(0x232)){if(!_0x19ded9['segmentId'])throw new SDKError(ErrorCode[_0x3bf830(0x217)],_0x3bf830(0x200));const _0xec969a=await withSpinner(_0x3bf830(0x221),()=>_0x3ffb06[_0x3bf830(0x232)][_0x3bf830(0x214)](_0x19ded9[_0x3bf830(0x1d9)],_0x19ded9[_0x3bf830(0x22f)]),{'verbose':_0x59ad4c[_0x3bf830(0x1da)]}),_0x3b7d12=getConsoleNextUrl(_0x59ad4c['site'],_0x3bf830(0x1f3)+_0x19ded9[_0x3bf830(0x1d9)]+'/e/'+_0x19ded9['segmentId']),_0x4d72c7=_0xec969a[_0x3bf830(0x243)];_0x4d72c7[_0x3bf830(0x22a)]=_0x3b7d12,await handleSingleObjectOutput(_0x4d72c7,_0x59ad4c);}else return console[_0x3bf830(0x254)](_0x3bf830(0x25d)),console[_0x3bf830(0x254)](_0x3bf830(0x21e)),0x1;}return 0x0;}catch(_0x1d512c){if(_0x1d512c instanceof SDKError)return console['error']('Error:\x20'+_0x1d512c[_0x3bf830(0x223)]),_0x1d512c[_0x3bf830(0x1f4)]&&console[_0x3bf830(0x254)]('\x20\x20Cause:\x20'+_0x1d512c[_0x3bf830(0x1f4)]),0x1;throw _0x1d512c;}}}export const SegmentInfoCommand=SegmentViewCommand;export class SegmentDescCommand extends BaseCommand{['name']=a25_0x3f95e6(0x239);['description']=a25_0x3f95e6(0x249);async[a25_0x3f95e6(0x24a)](_0x5203b1){const _0x2454c2=a25_0x3f95e6,{options:_0x3a6a35,args:_0x5358f1,tdx:_0x589d02}=_0x5203b1,_0x4d94d8=_0x5358f1[0x0];if(!_0x4d94d8)return console['error']('Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required'),console[_0x2454c2(0x254)]('Usage:\x20tdx\x20sg\x20desc\x20<name>'),console[_0x2454c2(0x254)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20desc\x20<path/to/segment.yml>'),console['error'](_0x2454c2(0x21a)),console[_0x2454c2(0x254)](_0x2454c2(0x229)),console[_0x2454c2(0x254)](_0x2454c2(0x1fd)),0x1;try{const _0xbc9ca9=_0x3a6a35[_0x2454c2(0x20e)],_0xde2f25=await resolveSegmentTarget(_0x4d94d8,_0xbc9ca9,_0x3a6a35[_0x2454c2(0x1da)]);_0x3a6a35[_0x2454c2(0x1da)]&&console[_0x2454c2(0x254)](_0x2454c2(0x1d8)+_0xde2f25);const _0x31d2ea=await withSpinner(_0x2454c2(0x1fb)+_0x4d94d8+_0x2454c2(0x1e2),()=>_0x589d02['segment']['resolvePathToResource'](_0xde2f25),{'verbose':_0x3a6a35[_0x2454c2(0x1da)]}),_0x1c99fc=_0x31d2ea['data'];_0x3a6a35[_0x2454c2(0x1da)]&&(console[_0x2454c2(0x254)](_0x2454c2(0x1fc)+_0x1c99fc[_0x2454c2(0x24e)]),console[_0x2454c2(0x254)](_0x2454c2(0x246)+_0x1c99fc[_0x2454c2(0x1d9)]));if(_0x1c99fc[_0x2454c2(0x24e)]===_0x2454c2(0x209))return console[_0x2454c2(0x254)](_0x2454c2(0x24d)),console[_0x2454c2(0x254)]('Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.'),0x1;if(_0x1c99fc[_0x2454c2(0x24e)]==='parent')return console[_0x2454c2(0x254)](_0x2454c2(0x203)),console['error'](_0x2454c2(0x202)),0x1;if(!_0x1c99fc[_0x2454c2(0x22f)])throw new SDKError(ErrorCode[_0x2454c2(0x217)],_0x2454c2(0x200));const _0x4b838c=await withSpinner(_0x2454c2(0x212),()=>_0x589d02[_0x2454c2(0x232)][_0x2454c2(0x256)](_0x1c99fc[_0x2454c2(0x1d9)],_0x1c99fc[_0x2454c2(0x22f)]),{'verbose':_0x3a6a35[_0x2454c2(0x1da)]}),_0x2ba750=_0x4b838c[_0x2454c2(0x243)],_0x2f1e64=await executeSchemaQuery(_0x2ba750,_0x589d02,_0x3a6a35);return await handleQueryOutput(_0x2f1e64,_0x3a6a35),0x0;}catch(_0x4a50d1){if(_0x4a50d1 instanceof SDKError)return console[_0x2454c2(0x254)](_0x2454c2(0x233)+_0x4a50d1[_0x2454c2(0x223)]),_0x4a50d1[_0x2454c2(0x1f4)]&&console[_0x2454c2(0x254)](_0x2454c2(0x20d)+_0x4a50d1['cause']),0x1;throw _0x4a50d1;}}}
@@ -1 +1 @@
1
- const a26_0x4e4376=a26_0xbf7a;(function(_0x604bd7,_0x4942f9){const _0x14fa03=a26_0xbf7a,_0x2057c0=_0x604bd7();while(!![]){try{const _0x5eafd6=-parseInt(_0x14fa03(0x157))/0x1*(-parseInt(_0x14fa03(0x15f))/0x2)+parseInt(_0x14fa03(0x14c))/0x3*(parseInt(_0x14fa03(0x141))/0x4)+parseInt(_0x14fa03(0x151))/0x5*(-parseInt(_0x14fa03(0x159))/0x6)+parseInt(_0x14fa03(0x161))/0x7+parseInt(_0x14fa03(0x154))/0x8+parseInt(_0x14fa03(0x136))/0x9*(parseInt(_0x14fa03(0x160))/0xa)+-parseInt(_0x14fa03(0x164))/0xb*(parseInt(_0x14fa03(0x165))/0xc);if(_0x5eafd6===_0x4942f9)break;else _0x2057c0['push'](_0x2057c0['shift']());}catch(_0x4becc8){_0x2057c0['push'](_0x2057c0['shift']());}}}(a26_0x46b1,0x8c77f));import{BaseCommand}from'./command.js';function a26_0xbf7a(_0x21ea74,_0x7846c3){_0x21ea74=_0x21ea74-0x136;const _0x46b1ea=a26_0x46b1();let _0xbf7a87=_0x46b1ea[_0x21ea74];return _0xbf7a87;}import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';function a26_0x46b1(){const _0x44100a=['✔\x20Created\x20segment\x20\x27','yellow','segments','createSegment','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','Parent:\x20','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27','\x27\x20with\x20ID:\x20','220407ZokpWb','ruleFile','\x27...','Segment\x20name:\x20','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27','1946445Pukkya','execute','Examples:','6351448ibToxW','Site:\x20','rule','270BCnupw','description','6avZRAY','kind','folder','includes','Create\x20child\x20segment\x20with\x20filtering\x20rules','Resolved\x20folder\x20ID:\x20','3458TcPalZ','676230VAvdjU','366030vhPEdo','folderId','data','121vLNKlY','2393772YxPhbx','error','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','99TDYZwG','length','Target\x20path:\x20','parent','type','name','verbose','segment','resolvePathToResource','\x20\x20\x20Path:\x20','⚠\x20Deprecation\x20warning:\x20`segment\x20create`\x20is\x20deprecated.','60daqdtw','Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]','noCountPopulation'];a26_0x46b1=function(){return _0x44100a;};return a26_0x46b1();}import{parsePath,getParentPath,getBaseName}from'../sdk/segment/segment-path-parser.js';import a26_0x261f06 from'chalk';export class SegmentCreateCommand extends BaseCommand{[a26_0x4e4376(0x13b)]='segment:create';['description']=a26_0x4e4376(0x15d);async[a26_0x4e4376(0x152)](_0x17c2e5){const _0x57a373=a26_0x4e4376;console['error'](a26_0x261f06[_0x57a373(0x145)](_0x57a373(0x140))),console[_0x57a373(0x166)](a26_0x261f06['yellow'](_0x57a373(0x167)));const {options:_0x156504,args:_0x59210a,tdx:_0x5a4b30}=_0x17c2e5,_0x23226b=_0x156504;if(_0x59210a[_0x57a373(0x137)]===0x0)return console[_0x57a373(0x166)](_0x57a373(0x148)),console['error']('Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]'),console[_0x57a373(0x166)](_0x57a373(0x153)),console['error'](_0x57a373(0x14a)),console['error'](_0x57a373(0x150)),console['error']('\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context'),0x1;const _0x4e57fa=_0x59210a[0x0],_0x3db204=_0x156504['segmentPath'];let _0x3fbb52=_0x4e57fa;_0x3db204&&!_0x4e57fa[_0x57a373(0x15c)]('/')&&(_0x3fbb52=_0x3db204+'/'+_0x4e57fa,_0x23226b[_0x57a373(0x13c)]&&console[_0x57a373(0x166)]('Resolved\x20relative\x20path\x20to:\x20'+_0x3fbb52));const _0x18b181=parsePath(_0x3fbb52);if(_0x18b181['segments'][_0x57a373(0x137)]<0x2)return console[_0x57a373(0x166)]('Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)'),console[_0x57a373(0x166)](_0x57a373(0x142)),0x1;const _0x3e5062=_0x18b181[_0x57a373(0x146)][0x0],_0x34f43b=getBaseName(_0x3fbb52),_0x458d6e=getParentPath(_0x3fbb52);_0x23226b[_0x57a373(0x13c)]&&(console[_0x57a373(0x166)](_0x57a373(0x155)+_0x23226b['site']),console[_0x57a373(0x166)](_0x57a373(0x138)+_0x3fbb52),console[_0x57a373(0x166)](_0x57a373(0x149)+_0x3e5062),console['error'](_0x57a373(0x14f)+_0x34f43b),console[_0x57a373(0x166)]('Parent\x20path:\x20'+_0x458d6e));const _0x38a671=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x3e5062+'\x27...',()=>_0x5a4b30[_0x57a373(0x13d)]['resolveParentId'](_0x3e5062),{'verbose':_0x23226b[_0x57a373(0x13c)]}),_0x499f31=_0x38a671[_0x57a373(0x163)];let _0x37148b;if(_0x18b181['segments'][_0x57a373(0x137)]>0x2){const _0x3fe54f=await withSpinner('Resolving\x20folder\x20path\x20\x27'+_0x458d6e+_0x57a373(0x14e),()=>_0x5a4b30[_0x57a373(0x13d)][_0x57a373(0x13e)](_0x458d6e),{'verbose':_0x23226b['verbose']}),_0x5cf050=_0x3fe54f[_0x57a373(0x163)];if(_0x5cf050['type']!==_0x57a373(0x15b)&&_0x5cf050[_0x57a373(0x13a)]!==_0x57a373(0x139))return console[_0x57a373(0x166)]('Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.'),0x1;_0x37148b=_0x5cf050[_0x57a373(0x162)];}else{if(_0x23226b[_0x57a373(0x15b)]){const _0x1b0309=await withSpinner('Resolving\x20folder\x20\x27'+_0x23226b[_0x57a373(0x15b)]+'\x27...',()=>_0x5a4b30['segment']['resolveFolderId'](_0x499f31,_0x23226b[_0x57a373(0x15b)]),{'verbose':_0x23226b[_0x57a373(0x13c)]});_0x37148b=_0x1b0309[_0x57a373(0x163)];}}_0x23226b[_0x57a373(0x13c)]&&_0x37148b&&console[_0x57a373(0x166)](_0x57a373(0x15e)+_0x37148b);const _0x308bfe=await loadJSONFromOptions(_0x23226b[_0x57a373(0x156)],_0x23226b[_0x57a373(0x14d)]),_0x22a751={'name':_0x34f43b,'description':_0x23226b[_0x57a373(0x158)],'rule':_0x308bfe,'kind':_0x23226b[_0x57a373(0x15a)]!==undefined?parseInt(_0x23226b['kind'],0xa):undefined,'isVisible':_0x23226b['invisible']?![]:undefined,'segmentFolderId':_0x37148b,'countPopulation':_0x23226b[_0x57a373(0x143)]?![]:undefined},_0x6f0fe6=await withSpinner('Creating\x20segment\x20\x27'+_0x34f43b+_0x57a373(0x14e),()=>_0x5a4b30[_0x57a373(0x13d)][_0x57a373(0x147)](_0x499f31,_0x22a751),{'verbose':_0x23226b[_0x57a373(0x13c)]}),_0x34fd20=_0x6f0fe6[_0x57a373(0x163)];return console[_0x57a373(0x166)](_0x57a373(0x144)+_0x34fd20['name']+_0x57a373(0x14b)+_0x34fd20['id']),_0x3fbb52!==_0x4e57fa&&console[_0x57a373(0x166)](_0x57a373(0x13f)+_0x3fbb52),await handleSDKOutput([_0x34fd20],_0x23226b),0x0;}}
1
+ const a26_0x1fc76f=a26_0x30f7;(function(_0x407407,_0x1e0a78){const _0xffcdb0=a26_0x30f7,_0x5b48b3=_0x407407();while(!![]){try{const _0x3a2431=parseInt(_0xffcdb0(0x1be))/0x1*(parseInt(_0xffcdb0(0x1c3))/0x2)+parseInt(_0xffcdb0(0x1ee))/0x3+parseInt(_0xffcdb0(0x1d7))/0x4*(-parseInt(_0xffcdb0(0x1e5))/0x5)+-parseInt(_0xffcdb0(0x1d9))/0x6+-parseInt(_0xffcdb0(0x1c2))/0x7+parseInt(_0xffcdb0(0x1bc))/0x8*(parseInt(_0xffcdb0(0x1c6))/0x9)+-parseInt(_0xffcdb0(0x1d6))/0xa;if(_0x3a2431===_0x1e0a78)break;else _0x5b48b3['push'](_0x5b48b3['shift']());}catch(_0x1d1328){_0x5b48b3['push'](_0x5b48b3['shift']());}}}(a26_0x23d7,0xa7f4d));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';function a26_0x23d7(){const _0x5bcb91=['resolvePathToResource','Target\x20path:\x20','Create\x20child\x20segment\x20with\x20filtering\x20rules','data','error','\x20\x20\x20Path:\x20','✔\x20Created\x20segment\x20\x27','Examples:','Resolving\x20folder\x20\x27','segment','Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]','80595fWbBxo','createSegment','resolveParentId','folderId','segments','Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]','noCountPopulation','Resolving\x20folder\x20path\x20\x27','site','1172556jaNzrj','Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.','type','folder','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','8KzdPoe','verbose','4ZxfZXt','\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','Creating\x20segment\x20\x27','⚠\x20Deprecation\x20warning:\x20`segment\x20create`\x20is\x20deprecated.','5194616bZMECJ','568010phYNFJ','Site:\x20','rule','3823434duBxDz','Resolved\x20folder\x20ID:\x20','resolveFolderId','execute','kind','name','\x27...','Parent\x20path:\x20','Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)','ruleFile','description','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','Resolved\x20relative\x20path\x20to:\x20','length','Parent:\x20','Resolving\x20parent\x20segment\x20\x27','4005470ccxjYB','8MjphWs','yellow','533256kgksFi'];a26_0x23d7=function(){return _0x5bcb91;};return a26_0x23d7();}function a26_0x30f7(_0x5ad204,_0x34ead7){_0x5ad204=_0x5ad204-0x1b9;const _0x23d7af=a26_0x23d7();let _0x30f763=_0x23d7af[_0x5ad204];return _0x30f763;}import{parsePath,getParentPath,getBaseName}from'../sdk/segment/segment-path-parser.js';import a26_0x38b62c from'chalk';export class SegmentCreateCommand extends BaseCommand{[a26_0x1fc76f(0x1cb)]='segment:create';[a26_0x1fc76f(0x1d0)]=a26_0x1fc76f(0x1dc);async[a26_0x1fc76f(0x1c9)](_0x10adab){const _0x25904f=a26_0x1fc76f;console[_0x25904f(0x1de)](a26_0x38b62c[_0x25904f(0x1d8)](_0x25904f(0x1c1))),console['error'](a26_0x38b62c[_0x25904f(0x1d8)](_0x25904f(0x1bb)));const {options:_0x3806db,args:_0x4e7747,tdx:_0x23aab2}=_0x10adab,_0x167f1d=_0x3806db;if(_0x4e7747[_0x25904f(0x1d3)]===0x0)return console[_0x25904f(0x1de)](_0x25904f(0x1d1)),console[_0x25904f(0x1de)](_0x25904f(0x1e4)),console[_0x25904f(0x1de)](_0x25904f(0x1e1)),console['error']('\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27'),console[_0x25904f(0x1de)]('\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27'),console[_0x25904f(0x1de)](_0x25904f(0x1bf)),0x1;const _0x72d46=_0x4e7747[0x0],_0x420e00=_0x3806db['segmentPath'];let _0x56869d=_0x72d46;_0x420e00&&!_0x72d46['includes']('/')&&(_0x56869d=_0x420e00+'/'+_0x72d46,_0x167f1d['verbose']&&console[_0x25904f(0x1de)](_0x25904f(0x1d2)+_0x56869d));const _0x4daf47=parsePath(_0x56869d);if(_0x4daf47[_0x25904f(0x1e9)][_0x25904f(0x1d3)]<0x2)return console[_0x25904f(0x1de)](_0x25904f(0x1ce)),console['error'](_0x25904f(0x1ea)),0x1;const _0x4b56ed=_0x4daf47[_0x25904f(0x1e9)][0x0],_0x424222=getBaseName(_0x56869d),_0xc304dc=getParentPath(_0x56869d);_0x167f1d['verbose']&&(console[_0x25904f(0x1de)](_0x25904f(0x1c4)+_0x167f1d[_0x25904f(0x1ed)]),console[_0x25904f(0x1de)](_0x25904f(0x1db)+_0x56869d),console[_0x25904f(0x1de)](_0x25904f(0x1d4)+_0x4b56ed),console['error']('Segment\x20name:\x20'+_0x424222),console['error'](_0x25904f(0x1cd)+_0xc304dc));const _0x4f2f78=await withSpinner(_0x25904f(0x1d5)+_0x4b56ed+_0x25904f(0x1cc),()=>_0x23aab2[_0x25904f(0x1e3)][_0x25904f(0x1e7)](_0x4b56ed),{'verbose':_0x167f1d[_0x25904f(0x1bd)]}),_0x352400=_0x4f2f78['data'];let _0x201f2a;if(_0x4daf47[_0x25904f(0x1e9)]['length']>0x2){const _0x3b375a=await withSpinner(_0x25904f(0x1ec)+_0xc304dc+_0x25904f(0x1cc),()=>_0x23aab2[_0x25904f(0x1e3)][_0x25904f(0x1da)](_0xc304dc),{'verbose':_0x167f1d[_0x25904f(0x1bd)]}),_0x5c1eb4=_0x3b375a['data'];if(_0x5c1eb4['type']!==_0x25904f(0x1ba)&&_0x5c1eb4[_0x25904f(0x1b9)]!=='parent')return console['error'](_0x25904f(0x1ef)),0x1;_0x201f2a=_0x5c1eb4[_0x25904f(0x1e8)];}else{if(_0x167f1d[_0x25904f(0x1ba)]){const _0x368ecd=await withSpinner(_0x25904f(0x1e2)+_0x167f1d[_0x25904f(0x1ba)]+_0x25904f(0x1cc),()=>_0x23aab2['segment'][_0x25904f(0x1c8)](_0x352400,_0x167f1d[_0x25904f(0x1ba)]),{'verbose':_0x167f1d['verbose']});_0x201f2a=_0x368ecd[_0x25904f(0x1dd)];}}_0x167f1d[_0x25904f(0x1bd)]&&_0x201f2a&&console['error'](_0x25904f(0x1c7)+_0x201f2a);const _0x250c03=await loadJSONFromOptions(_0x167f1d[_0x25904f(0x1c5)],_0x167f1d[_0x25904f(0x1cf)]),_0x3207f8={'name':_0x424222,'description':_0x167f1d['description'],'rule':_0x250c03,'kind':_0x167f1d['kind']!==undefined?parseInt(_0x167f1d[_0x25904f(0x1ca)],0xa):undefined,'isVisible':_0x167f1d['invisible']?![]:undefined,'segmentFolderId':_0x201f2a,'countPopulation':_0x167f1d[_0x25904f(0x1eb)]?![]:undefined},_0x2a229f=await withSpinner(_0x25904f(0x1c0)+_0x424222+'\x27...',()=>_0x23aab2[_0x25904f(0x1e3)][_0x25904f(0x1e6)](_0x352400,_0x3207f8),{'verbose':_0x167f1d[_0x25904f(0x1bd)]}),_0x545d66=_0x2a229f['data'];return console[_0x25904f(0x1de)](_0x25904f(0x1e0)+_0x545d66[_0x25904f(0x1cb)]+'\x27\x20with\x20ID:\x20'+_0x545d66['id']),_0x56869d!==_0x72d46&&console[_0x25904f(0x1de)](_0x25904f(0x1df)+_0x56869d),await handleSDKOutput([_0x545d66],_0x167f1d),0x0;}}
@@ -1 +1 @@
1
- const a27_0x1f038d=a27_0x40f8;function a27_0x34fc(){const _0x2e6b43=['segment','site','191OUMJRJ','error','json','description','\x20field','jsonl','parentSegment','14KvgNIh','execute','Usage:\x20tdx\x20segment\x20fields\x20<parent_name>','1873390TStVXB','229848vDWTtO','Site:\x20','length','1389264rGCeqS','verbose','3849904UxAaUt','12vsOVjz','Error:\x20Parent\x20segment\x20name\x20is\x20required','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','13277560FquebR','Parent\x20segment:\x20','data','469917rawtrj','3802iBbCFd'];a27_0x34fc=function(){return _0x2e6b43;};return a27_0x34fc();}function a27_0x40f8(_0x86b4fa,_0x5366d9){_0x86b4fa=_0x86b4fa-0x155;const _0x34fc58=a27_0x34fc();let _0x40f8d3=_0x34fc58[_0x86b4fa];return _0x40f8d3;}(function(_0x573500,_0x4b024e){const _0x41da3e=a27_0x40f8,_0x7eed83=_0x573500();while(!![]){try{const _0x18f811=parseInt(_0x41da3e(0x158))/0x1*(parseInt(_0x41da3e(0x155))/0x2)+parseInt(_0x41da3e(0x163))/0x3+-parseInt(_0x41da3e(0x169))/0x4*(parseInt(_0x41da3e(0x162))/0x5)+-parseInt(_0x41da3e(0x166))/0x6*(parseInt(_0x41da3e(0x15f))/0x7)+parseInt(_0x41da3e(0x168))/0x8+-parseInt(_0x41da3e(0x16f))/0x9+parseInt(_0x41da3e(0x16c))/0xa;if(_0x18f811===_0x4b024e)break;else _0x7eed83['push'](_0x7eed83['shift']());}catch(_0xc3b615){_0x7eed83['push'](_0x7eed83['shift']());}}}(a27_0x34fc,0x94c56));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{displayFieldsHumanReadable}from'../sdk/segment/fields-display.js';export class SegmentFieldsCommand extends BaseCommand{['name']='segment:fields';[a27_0x1f038d(0x15b)]='List\x20available\x20fields\x20for\x20segmentation';async[a27_0x1f038d(0x160)](_0x12d17c){const _0x53b2e9=a27_0x1f038d,{options:_0x4d1126,args:_0x3b27b9,tdx:_0x35aa6d}=_0x12d17c,_0x23ff17=_0x3b27b9[0x0]||_0x4d1126[_0x53b2e9(0x15e)];if(!_0x23ff17)return console['error'](_0x53b2e9(0x16a)),console['error'](_0x53b2e9(0x161)),console['error'](_0x53b2e9(0x16b)),0x1;_0x4d1126[_0x53b2e9(0x167)]&&(console[_0x53b2e9(0x159)](_0x53b2e9(0x164)+_0x4d1126[_0x53b2e9(0x157)]),console[_0x53b2e9(0x159)](_0x53b2e9(0x16d)+_0x23ff17));const _0x5a6c8a=await withSpinner('Listing\x20fields\x20for\x20\x27'+_0x23ff17+'\x27...',()=>_0x35aa6d[_0x53b2e9(0x156)]['listFields'](_0x23ff17),{'verbose':_0x4d1126[_0x53b2e9(0x167)]}),_0x1dc428=_0x5a6c8a[_0x53b2e9(0x16e)];console[_0x53b2e9(0x159)]('✔\x20Found\x20'+_0x1dc428[_0x53b2e9(0x165)]+_0x53b2e9(0x15c)+(_0x1dc428[_0x53b2e9(0x165)]!==0x1?'s':''));if(_0x4d1126[_0x53b2e9(0x15a)]||_0x4d1126[_0x53b2e9(0x15d)])return await handleSDKOutput(_0x1dc428,_0x4d1126),0x0;return displayFieldsHumanReadable(_0x1dc428,_0x23ff17),0x0;}}
1
+ const a27_0x2d0390=a27_0x11a4;(function(_0x72b521,_0x234a74){const _0xca3be3=a27_0x11a4,_0x53d961=_0x72b521();while(!![]){try{const _0x3756aa=-parseInt(_0xca3be3(0xa3))/0x1+-parseInt(_0xca3be3(0x9d))/0x2*(-parseInt(_0xca3be3(0x9b))/0x3)+-parseInt(_0xca3be3(0xa7))/0x4*(-parseInt(_0xca3be3(0xaf))/0x5)+parseInt(_0xca3be3(0xb0))/0x6*(-parseInt(_0xca3be3(0xb3))/0x7)+-parseInt(_0xca3be3(0x9c))/0x8+-parseInt(_0xca3be3(0xb1))/0x9+-parseInt(_0xca3be3(0xaa))/0xa*(-parseInt(_0xca3be3(0xa0))/0xb);if(_0x3756aa===_0x234a74)break;else _0x53d961['push'](_0x53d961['shift']());}catch(_0x3bedbf){_0x53d961['push'](_0x53d961['shift']());}}}(a27_0x4b5c,0x23fdc));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';function a27_0x4b5c(){const _0x3d28cf=['✔\x20Found\x20','1595vaVcSy','387570lBjqay','1810413seSyqa','segment','21ziIkyl','json','List\x20available\x20fields\x20for\x20segmentation','Site:\x20','description','239283GkBnnP','1121192sdAaLu','4OdqHpN','Usage:\x20tdx\x20segment\x20fields\x20<parent_name>','jsonl','184987gIDXpo','error','verbose','32242ydCbqJ','execute','\x27...','segment:fields','636dppzXm','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','Parent\x20segment:\x20','300HnwbQH','length','name','listFields'];a27_0x4b5c=function(){return _0x3d28cf;};return a27_0x4b5c();}import{displayFieldsHumanReadable}from'../sdk/segment/fields-display.js';function a27_0x11a4(_0x17642f,_0x545155){_0x17642f=_0x17642f-0x98;const _0x4b5c9b=a27_0x4b5c();let _0x11a4e3=_0x4b5c9b[_0x17642f];return _0x11a4e3;}export class SegmentFieldsCommand extends BaseCommand{[a27_0x2d0390(0xac)]=a27_0x2d0390(0xa6);[a27_0x2d0390(0x9a)]=a27_0x2d0390(0x98);async[a27_0x2d0390(0xa4)](_0x2e22f0){const _0x240cba=a27_0x2d0390,{options:_0x23960e,args:_0x506f41,tdx:_0x55f489}=_0x2e22f0,_0xd2318=_0x506f41[0x0]||_0x23960e['parentSegment'];if(!_0xd2318)return console[_0x240cba(0xa1)]('Error:\x20Parent\x20segment\x20name\x20is\x20required'),console[_0x240cba(0xa1)](_0x240cba(0x9e)),console[_0x240cba(0xa1)](_0x240cba(0xa8)),0x1;_0x23960e[_0x240cba(0xa2)]&&(console[_0x240cba(0xa1)](_0x240cba(0x99)+_0x23960e['site']),console['error'](_0x240cba(0xa9)+_0xd2318));const _0x2fc198=await withSpinner('Listing\x20fields\x20for\x20\x27'+_0xd2318+_0x240cba(0xa5),()=>_0x55f489[_0x240cba(0xb2)][_0x240cba(0xad)](_0xd2318),{'verbose':_0x23960e[_0x240cba(0xa2)]}),_0x178f5c=_0x2fc198['data'];console[_0x240cba(0xa1)](_0x240cba(0xae)+_0x178f5c[_0x240cba(0xab)]+'\x20field'+(_0x178f5c['length']!==0x1?'s':''));if(_0x23960e[_0x240cba(0xb4)]||_0x23960e[_0x240cba(0x9f)])return await handleSDKOutput(_0x178f5c,_0x23960e),0x0;return displayFieldsHumanReadable(_0x178f5c,_0xd2318),0x0;}}
@@ -1 +1 @@
1
- const a28_0x4da49e=a28_0x8f85;function a28_0x8f85(_0x4e0936,_0x2354fc){_0x4e0936=_0x4e0936-0x82;const _0x3a6cd0=a28_0x3a6c();let _0x8f8587=_0x3a6cd0[_0x4e0936];return _0x8f8587;}(function(_0x356b47,_0x229131){const _0x32c66a=a28_0x8f85,_0x153a76=_0x356b47();while(!![]){try{const _0x53952b=parseInt(_0x32c66a(0x8d))/0x1+parseInt(_0x32c66a(0xb1))/0x2*(parseInt(_0x32c66a(0x8f))/0x3)+parseInt(_0x32c66a(0xab))/0x4+-parseInt(_0x32c66a(0xae))/0x5*(parseInt(_0x32c66a(0xa3))/0x6)+-parseInt(_0x32c66a(0xa2))/0x7+parseInt(_0x32c66a(0x96))/0x8+-parseInt(_0x32c66a(0xb2))/0x9*(-parseInt(_0x32c66a(0x95))/0xa);if(_0x53952b===_0x229131)break;else _0x153a76['push'](_0x153a76['shift']());}catch(_0x89b9a2){_0x153a76['push'](_0x153a76['shift']());}}}(a28_0x3a6c,0xc5d7c));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey}from'../utils/prompt.js';import{saveSessionContext}from'../core/session.js';import a28_0x5c8c61 from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';import a28_0xb69ade from'path';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';function a28_0x3a6c(){const _0x5850d7=['content','counts','site','activations','\x20\x20Target:\x20','\x20changed\x20files','segments','Error:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent','filter','dryRun','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','Write\x20','\x20activations','\x0aPull\x20summary\x20for\x20\x27','yes','helpText','session','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','dim','\x20files?','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file','\x20journeys','\x20new\x20files','isNew','error','Aborted.','parentSegment','segment','execute','parent_segment','setPhase','utf-8','yellow','absolutePath','file','\x20segments','639833RYaRVy','cyan','255pbdASu','parentName','✔\x20Context\x20set:\x20','\x20versions)','\x20files\x20to\x20','✔\x20Pulled\x20','1540vMrILq','3563984PPMCsa','verbose','pullSegments','diff','journeys','red','files','Site:\x20','\x27...','repeat','No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27','description','7088480WPfdxL','1326eofVBl','hasChanges','resourceName','errorCode','\x20\x20🎯\x20','green','relativePath','targetDir','5140552dRHXoY','\x20\x20🗺️\x20\x20','length','34495sBmqls','Target\x20resource:\x20','journeyVersions','560uGdHSe','55719TXzguf','\x20=\x20','✔\x20All\x20files\x20are\x20up\x20to\x20date','type','dirname','\x20unchanged\x20files'];a28_0x3a6c=function(){return _0x5850d7;};return a28_0x3a6c();}export{buildFolderIdToPathMap as buildFolderPathMap}from'../sdk/segment/resolution-context.js';export class SegmentPullCommand extends BaseCommand{['name']='segment:pull';[a28_0x4da49e(0xa1)]='Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files';async[a28_0x4da49e(0x85)](_0x12e862){const _0x10b38b=a28_0x4da49e,{options:_0xc29031,args:_0x1f214a,tdx:_0x200948}=_0x12e862,_0x8d5fc7=_0xc29031,_0x5d4830=await resolveTarget({'arg':_0x1f214a[0x0],'contextParent':_0xc29031[_0x10b38b(0x83)],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x5d4830))return _0x5d4830[_0x10b38b(0xa6)]==='no_parent'?(console['error'](a28_0x5c8c61[_0x10b38b(0x89)](_0x10b38b(0xc3))),console[_0x10b38b(0xd1)]('Usage:\x20tdx\x20sg\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20(requires\x20context\x20or\x20tdx.json)'),console[_0x10b38b(0xd1)](_0x10b38b(0xc0)),console['error'](_0x10b38b(0xcd))):(console[_0x10b38b(0xd1)](a28_0x5c8c61[_0x10b38b(0x9b)](_0x10b38b(0xbf)+_0x5d4830['message']+'\x0a')),_0x5d4830['helpText']&&console['error'](a28_0x5c8c61[_0x10b38b(0x8e)](_0x5d4830[_0x10b38b(0xc8)]))),0x1;const _0x12a33c=_0x5d4830['parentName'],_0x34cea9=_0x5d4830['targetDir'],_0x19e035=_0x5d4830[_0x10b38b(0xb5)]===_0x10b38b(0x8b)?_0x5d4830[_0x10b38b(0xa5)]:undefined;_0x8d5fc7[_0x10b38b(0x97)]&&(console[_0x10b38b(0xd1)](_0x10b38b(0x9d)+_0x8d5fc7[_0x10b38b(0xba)]),console[_0x10b38b(0xd1)]('Parent\x20segment:\x20'+_0x12a33c),_0x19e035&&console[_0x10b38b(0xd1)](_0x10b38b(0xaf)+_0x19e035));const _0x3d7659=await withProgressSpinner('Pulling\x20segments\x20from\x20\x27'+_0x12a33c+_0x10b38b(0x9e),_0x45246a=>_0x200948[_0x10b38b(0x84)][_0x10b38b(0x98)](_0x12a33c,{'targetDir':_0x34cea9,'targetResourceName':_0x19e035,'verbose':_0x8d5fc7[_0x10b38b(0x97)],'progress':{'update':_0x223f8c=>{const _0x26fcb5=_0x10b38b;_0x45246a[_0x26fcb5(0x87)](_0x223f8c),_0x8d5fc7[_0x26fcb5(0x97)]&&console[_0x26fcb5(0xd1)]('\x20\x20'+_0x223f8c);}}}),{'verbose':_0x8d5fc7['verbose']}),_0x14568f=_0x3d7659['data'];if(_0x14568f[_0x10b38b(0xb9)]['segments']===0x0&&_0x14568f[_0x10b38b(0xb9)][_0x10b38b(0x9a)]===0x0)return console['error'](a28_0x5c8c61[_0x10b38b(0x89)](_0x10b38b(0xa0)+_0x14568f[_0x10b38b(0x90)]+'\x27')),0x0;const _0x1146c4=_0x14568f[_0x10b38b(0x9c)]['filter'](_0x5baeb5=>_0x5baeb5[_0x10b38b(0xd0)]),_0x50a896=_0x14568f['files'][_0x10b38b(0xc1)](_0x24e7f8=>!_0x24e7f8[_0x10b38b(0xd0)]&&_0x24e7f8[_0x10b38b(0xa4)]),_0x3a6eb7=_0x14568f[_0x10b38b(0x9c)]['filter'](_0x5cf96d=>!_0x5cf96d[_0x10b38b(0xd0)]&&!_0x5cf96d['hasChanges']);console[_0x10b38b(0xd1)](_0x10b38b(0xc6)+_0x14568f[_0x10b38b(0x90)]+'\x27:'),console['error'](_0x10b38b(0xa7)+a28_0x5c8c61[_0x10b38b(0x8e)](_0x14568f[_0x10b38b(0xb9)][_0x10b38b(0xbe)]+_0x10b38b(0x8c))+'\x20with\x20'+a28_0x5c8c61[_0x10b38b(0x8e)](_0x14568f[_0x10b38b(0xb9)][_0x10b38b(0xbb)]+_0x10b38b(0xc5)));if(_0x14568f[_0x10b38b(0xb9)][_0x10b38b(0x9a)]>0x0){const _0x2bdf09=_0x14568f[_0x10b38b(0xb9)][_0x10b38b(0xb0)]>_0x14568f[_0x10b38b(0xb9)]['journeys']?'\x20('+_0x14568f[_0x10b38b(0xb9)][_0x10b38b(0xb0)]+_0x10b38b(0x92):'';console['error'](_0x10b38b(0xac)+a28_0x5c8c61[_0x10b38b(0x8e)](_0x14568f['counts'][_0x10b38b(0x9a)]+_0x10b38b(0xce))+a28_0x5c8c61['dim'](_0x2bdf09));}console[_0x10b38b(0xd1)]('\x20\x20'+a28_0x5c8c61[_0x10b38b(0xa8)]('+\x20'+_0x1146c4['length']+_0x10b38b(0xcf))),console[_0x10b38b(0xd1)]('\x20\x20'+a28_0x5c8c61[_0x10b38b(0x89)]('~\x20'+_0x50a896['length']+_0x10b38b(0xbd))),console['error']('\x20\x20'+a28_0x5c8c61[_0x10b38b(0xcb)]('=\x20'+_0x3a6eb7[_0x10b38b(0xad)]+_0x10b38b(0xb7))),console['error'](_0x10b38b(0xbc)+a28_0x5c8c61[_0x10b38b(0x8e)](_0x14568f[_0x10b38b(0xaa)])+'\x0a');if(_0x50a896[_0x10b38b(0xad)]>0x0)for(const _0x3f6526 of _0x50a896){console[_0x10b38b(0xd1)]('\x0aChanges\x20to\x20\x27'+_0x3f6526[_0x10b38b(0xa9)]+'\x27:'),console[_0x10b38b(0xd1)]('─'['repeat'](0x3c)),console[_0x10b38b(0xd1)](_0x3f6526[_0x10b38b(0x99)]),console[_0x10b38b(0xd1)]('─'[_0x10b38b(0x9f)](0x3c));}if(_0x8d5fc7[_0x10b38b(0xc2)])return console[_0x10b38b(0xd1)](a28_0x5c8c61[_0x10b38b(0x89)](_0x10b38b(0xca))),0x0;if(_0x1146c4[_0x10b38b(0xad)]===0x0&&_0x50a896[_0x10b38b(0xad)]===0x0)return console[_0x10b38b(0xd1)](a28_0x5c8c61['green'](_0x10b38b(0xb4))),saveSessionContext({'parent_segment':_0x14568f[_0x10b38b(0x90)]},_0x8d5fc7[_0x10b38b(0xc9)]),console[_0x10b38b(0xd1)](a28_0x5c8c61[_0x10b38b(0xa8)](_0x10b38b(0x91)+a28_0x5c8c61[_0x10b38b(0xcb)](_0x10b38b(0x86))+'\x20=\x20'+a28_0x5c8c61['cyan'](_0x14568f[_0x10b38b(0x90)]))),0x0;if(!_0x8d5fc7[_0x10b38b(0xc7)]){const _0x2b74df=await confirmKey(_0x10b38b(0xc4)+(_0x1146c4[_0x10b38b(0xad)]+_0x50a896[_0x10b38b(0xad)])+_0x10b38b(0xcc));if(!_0x2b74df)return console[_0x10b38b(0xd1)](_0x10b38b(0x82)),0x1;}for(const _0x4d3506 of _0x14568f[_0x10b38b(0x9c)]){if(_0x4d3506[_0x10b38b(0xd0)]||_0x4d3506[_0x10b38b(0xa4)]){const _0x41c35b=a28_0xb69ade[_0x10b38b(0xb6)](_0x4d3506[_0x10b38b(0x8a)]);!existsSync(_0x41c35b)&&mkdirSync(_0x41c35b,{'recursive':!![]}),writeFileSync(_0x4d3506[_0x10b38b(0x8a)],_0x4d3506[_0x10b38b(0xb8)],_0x10b38b(0x88));}}return console[_0x10b38b(0xd1)](a28_0x5c8c61[_0x10b38b(0xa8)](_0x10b38b(0x94)+(_0x1146c4[_0x10b38b(0xad)]+_0x50a896[_0x10b38b(0xad)])+_0x10b38b(0x93)+_0x14568f[_0x10b38b(0xaa)])),saveSessionContext({'parent_segment':_0x14568f[_0x10b38b(0x90)]},_0x8d5fc7['session']),console[_0x10b38b(0xd1)](a28_0x5c8c61[_0x10b38b(0xa8)](_0x10b38b(0x91)+a28_0x5c8c61[_0x10b38b(0xcb)](_0x10b38b(0x86))+_0x10b38b(0xb3)+a28_0x5c8c61['cyan'](_0x14568f[_0x10b38b(0x90)]))),0x0;}}
1
+ const a28_0x8af78c=a28_0x2a7d;(function(_0x252136,_0x828d6c){const _0x15ed33=a28_0x2a7d,_0x2f5e45=_0x252136();while(!![]){try{const _0xa6db64=parseInt(_0x15ed33(0x1d8))/0x1*(parseInt(_0x15ed33(0x1dd))/0x2)+-parseInt(_0x15ed33(0x1c7))/0x3+parseInt(_0x15ed33(0x1b2))/0x4*(-parseInt(_0x15ed33(0x1c6))/0x5)+parseInt(_0x15ed33(0x1d5))/0x6*(-parseInt(_0x15ed33(0x1d7))/0x7)+parseInt(_0x15ed33(0x1b9))/0x8*(parseInt(_0x15ed33(0x197))/0x9)+-parseInt(_0x15ed33(0x1bf))/0xa+parseInt(_0x15ed33(0x19d))/0xb*(parseInt(_0x15ed33(0x1a6))/0xc);if(_0xa6db64===_0x828d6c)break;else _0x2f5e45['push'](_0x2f5e45['shift']());}catch(_0xf809a9){_0x2f5e45['push'](_0x2f5e45['shift']());}}}(a28_0x186f,0xf3a5d));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';function a28_0x186f(){const _0x1df9df=['repeat','\x20versions)','isNew','length','utf-8','\x20unchanged\x20files','parent_segment','data','counts','238494dwuWAM','✔\x20Context\x20set:\x20','301pfJKtn','931478iuFiDj','filter','✔\x20Pulled\x20','resourceName','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','4RsKYQL','yes','file','red','yellow','Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files','segments','\x20files?','3573NZuFwP','Usage:\x20tdx\x20sg\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20(requires\x20context\x20or\x20tdx.json)','helpText','Pulling\x20segments\x20from\x20\x27','journeys','absolutePath','4969030YRYhmm','\x20\x20🎯\x20','session','\x20segments','\x20files\x20to\x20','Parent\x20segment:\x20','error','\x20=\x20','\x20\x20Target:\x20','24wOxLSB','Error:\x20','cyan','activations','targetDir','execute','segment','\x0aChanges\x20to\x20\x27','\x20activations','dim','diff','message','4UweFgJ','green','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file','parentName','No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27','cwd','journeyVersions','31384hLXCEo','Aborted.','Site:\x20','\x20\x20🗺️\x20\x20','segment:pull','hasChanges','3925760TStlwH','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','\x0aPull\x20summary\x20for\x20\x27','content','✔\x20All\x20files\x20are\x20up\x20to\x20date','verbose','files','5501185OlQLVg','371538esIyxX','Write\x20','\x20new\x20files','parentSegment','relativePath'];a28_0x186f=function(){return _0x1df9df;};return a28_0x186f();}import{confirmKey}from'../utils/prompt.js';import{saveSessionContext}from'../core/session.js';import a28_0x3752e5 from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';function a28_0x2a7d(_0x5ecb23,_0x50ae64){_0x5ecb23=_0x5ecb23-0x195;const _0x186fb5=a28_0x186f();let _0x2a7d54=_0x186fb5[_0x5ecb23];return _0x2a7d54;}import a28_0x47d1a8 from'path';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';export{buildFolderIdToPathMap as buildFolderPathMap}from'../sdk/segment/resolution-context.js';export class SegmentPullCommand extends BaseCommand{['name']=a28_0x8af78c(0x1bd);['description']=a28_0x8af78c(0x1e2);async[a28_0x8af78c(0x1ab)](_0x1d44c9){const _0x540c31=a28_0x8af78c,{options:_0xdd37eb,args:_0x258707,tdx:_0x1dd6d3}=_0x1d44c9,_0x501b97=_0xdd37eb,_0x5c0004=await resolveTarget({'arg':_0x258707[0x0],'contextParent':_0xdd37eb[_0x540c31(0x1ca)],'cwd':process[_0x540c31(0x1b7)]()});if(!isSuccessfulResolution(_0x5c0004))return _0x5c0004['errorCode']==='no_parent'?(console[_0x540c31(0x1a3)](a28_0x3752e5[_0x540c31(0x1e1)](_0x540c31(0x1c0))),console[_0x540c31(0x1a3)](_0x540c31(0x198)),console['error']('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent'),console[_0x540c31(0x1a3)](_0x540c31(0x1b4))):(console[_0x540c31(0x1a3)](a28_0x3752e5[_0x540c31(0x1e0)](_0x540c31(0x1a7)+_0x5c0004[_0x540c31(0x1b1)]+'\x0a')),_0x5c0004[_0x540c31(0x199)]&&console[_0x540c31(0x1a3)](a28_0x3752e5['cyan'](_0x5c0004[_0x540c31(0x199)]))),0x1;const _0x41721c=_0x5c0004[_0x540c31(0x1b5)],_0x6e34c5=_0x5c0004['targetDir'],_0x43451b=_0x5c0004['type']===_0x540c31(0x1df)?_0x5c0004[_0x540c31(0x1db)]:undefined;_0x501b97[_0x540c31(0x1c4)]&&(console[_0x540c31(0x1a3)](_0x540c31(0x1bb)+_0x501b97['site']),console[_0x540c31(0x1a3)](_0x540c31(0x1a2)+_0x41721c),_0x43451b&&console['error']('Target\x20resource:\x20'+_0x43451b));const _0x4f6b94=await withProgressSpinner(_0x540c31(0x19a)+_0x41721c+'\x27...',_0x38b40e=>_0x1dd6d3[_0x540c31(0x1ac)]['pullSegments'](_0x41721c,{'targetDir':_0x6e34c5,'targetResourceName':_0x43451b,'verbose':_0x501b97[_0x540c31(0x1c4)],'progress':{'update':_0x39bf0e=>{const _0x315f4d=_0x540c31;_0x38b40e['setPhase'](_0x39bf0e),_0x501b97[_0x315f4d(0x1c4)]&&console['error']('\x20\x20'+_0x39bf0e);}}}),{'verbose':_0x501b97['verbose']}),_0x46aad4=_0x4f6b94[_0x540c31(0x1d3)];if(_0x46aad4['counts'][_0x540c31(0x195)]===0x0&&_0x46aad4[_0x540c31(0x1d4)][_0x540c31(0x19b)]===0x0)return console[_0x540c31(0x1a3)](a28_0x3752e5[_0x540c31(0x1e1)](_0x540c31(0x1b6)+_0x46aad4[_0x540c31(0x1b5)]+'\x27')),0x0;const _0x535df3=_0x46aad4[_0x540c31(0x1c5)]['filter'](_0x552c52=>_0x552c52[_0x540c31(0x1ce)]),_0x41be80=_0x46aad4[_0x540c31(0x1c5)]['filter'](_0x4f90db=>!_0x4f90db[_0x540c31(0x1ce)]&&_0x4f90db[_0x540c31(0x1be)]),_0x2f4e82=_0x46aad4[_0x540c31(0x1c5)][_0x540c31(0x1d9)](_0x4c2646=>!_0x4c2646['isNew']&&!_0x4c2646['hasChanges']);console[_0x540c31(0x1a3)](_0x540c31(0x1c1)+_0x46aad4['parentName']+'\x27:'),console[_0x540c31(0x1a3)](_0x540c31(0x19e)+a28_0x3752e5['cyan'](_0x46aad4[_0x540c31(0x1d4)][_0x540c31(0x195)]+_0x540c31(0x1a0))+'\x20with\x20'+a28_0x3752e5[_0x540c31(0x1a8)](_0x46aad4[_0x540c31(0x1d4)][_0x540c31(0x1a9)]+_0x540c31(0x1ae)));if(_0x46aad4[_0x540c31(0x1d4)]['journeys']>0x0){const _0x2c2c4e=_0x46aad4[_0x540c31(0x1d4)][_0x540c31(0x1b8)]>_0x46aad4[_0x540c31(0x1d4)][_0x540c31(0x19b)]?'\x20('+_0x46aad4[_0x540c31(0x1d4)][_0x540c31(0x1b8)]+_0x540c31(0x1cd):'';console['error'](_0x540c31(0x1bc)+a28_0x3752e5[_0x540c31(0x1a8)](_0x46aad4[_0x540c31(0x1d4)][_0x540c31(0x19b)]+'\x20journeys')+a28_0x3752e5[_0x540c31(0x1af)](_0x2c2c4e));}console[_0x540c31(0x1a3)]('\x20\x20'+a28_0x3752e5[_0x540c31(0x1b3)]('+\x20'+_0x535df3[_0x540c31(0x1cf)]+_0x540c31(0x1c9))),console[_0x540c31(0x1a3)]('\x20\x20'+a28_0x3752e5['yellow']('~\x20'+_0x41be80[_0x540c31(0x1cf)]+'\x20changed\x20files')),console[_0x540c31(0x1a3)]('\x20\x20'+a28_0x3752e5[_0x540c31(0x1af)]('=\x20'+_0x2f4e82['length']+_0x540c31(0x1d1))),console['error'](_0x540c31(0x1a5)+a28_0x3752e5[_0x540c31(0x1a8)](_0x46aad4[_0x540c31(0x1aa)])+'\x0a');if(_0x41be80[_0x540c31(0x1cf)]>0x0)for(const _0x1ac7d5 of _0x41be80){console[_0x540c31(0x1a3)](_0x540c31(0x1ad)+_0x1ac7d5[_0x540c31(0x1cb)]+'\x27:'),console[_0x540c31(0x1a3)]('─'[_0x540c31(0x1cc)](0x3c)),console['error'](_0x1ac7d5[_0x540c31(0x1b0)]),console[_0x540c31(0x1a3)]('─'[_0x540c31(0x1cc)](0x3c));}if(_0x501b97['dryRun'])return console['error'](a28_0x3752e5[_0x540c31(0x1e1)](_0x540c31(0x1dc))),0x0;if(_0x535df3[_0x540c31(0x1cf)]===0x0&&_0x41be80[_0x540c31(0x1cf)]===0x0)return console[_0x540c31(0x1a3)](a28_0x3752e5[_0x540c31(0x1b3)](_0x540c31(0x1c3))),saveSessionContext({'parent_segment':_0x46aad4['parentName']},_0x501b97['session']),console['error'](a28_0x3752e5[_0x540c31(0x1b3)](_0x540c31(0x1d6)+a28_0x3752e5['dim'](_0x540c31(0x1d2))+_0x540c31(0x1a4)+a28_0x3752e5[_0x540c31(0x1a8)](_0x46aad4[_0x540c31(0x1b5)]))),0x0;if(!_0x501b97[_0x540c31(0x1de)]){const _0x55efc0=await confirmKey(_0x540c31(0x1c8)+(_0x535df3['length']+_0x41be80[_0x540c31(0x1cf)])+_0x540c31(0x196));if(!_0x55efc0)return console[_0x540c31(0x1a3)](_0x540c31(0x1ba)),0x1;}for(const _0x2b7949 of _0x46aad4[_0x540c31(0x1c5)]){if(_0x2b7949[_0x540c31(0x1ce)]||_0x2b7949['hasChanges']){const _0x5c6213=a28_0x47d1a8['dirname'](_0x2b7949[_0x540c31(0x19c)]);!existsSync(_0x5c6213)&&mkdirSync(_0x5c6213,{'recursive':!![]}),writeFileSync(_0x2b7949[_0x540c31(0x19c)],_0x2b7949[_0x540c31(0x1c2)],_0x540c31(0x1d0));}}return console[_0x540c31(0x1a3)](a28_0x3752e5[_0x540c31(0x1b3)](_0x540c31(0x1da)+(_0x535df3[_0x540c31(0x1cf)]+_0x41be80['length'])+_0x540c31(0x1a1)+_0x46aad4['targetDir'])),saveSessionContext({'parent_segment':_0x46aad4[_0x540c31(0x1b5)]},_0x501b97[_0x540c31(0x19f)]),console[_0x540c31(0x1a3)](a28_0x3752e5[_0x540c31(0x1b3)](_0x540c31(0x1d6)+a28_0x3752e5['dim'](_0x540c31(0x1d2))+_0x540c31(0x1a4)+a28_0x3752e5[_0x540c31(0x1a8)](_0x46aad4['parentName']))),0x0;}}
@@ -1 +1 @@
1
- const a29_0x148b94=a29_0x23d3;(function(_0x56a632,_0x500ee8){const _0xabb299=a29_0x23d3,_0x169cde=_0x56a632();while(!![]){try{const _0x22b2f6=-parseInt(_0xabb299(0x17a))/0x1*(-parseInt(_0xabb299(0x1c3))/0x2)+parseInt(_0xabb299(0x1d8))/0x3+-parseInt(_0xabb299(0x205))/0x4*(-parseInt(_0xabb299(0x1a3))/0x5)+parseInt(_0xabb299(0x1a0))/0x6*(-parseInt(_0xabb299(0x1f0))/0x7)+parseInt(_0xabb299(0x1aa))/0x8+parseInt(_0xabb299(0x1f1))/0x9*(-parseInt(_0xabb299(0x179))/0xa)+-parseInt(_0xabb299(0x1a8))/0xb*(parseInt(_0xabb299(0x1eb))/0xc);if(_0x22b2f6===_0x500ee8)break;else _0x169cde['push'](_0x169cde['shift']());}catch(_0x44a1e2){_0x169cde['push'](_0x169cde['shift']());}}}(a29_0x26fe,0x2d04c));import{BaseCommand}from'./command.js';function a29_0x23d3(_0x5a4147,_0x44d5bb){_0x5a4147=_0x5a4147-0x16f;const _0x26fe0c=a29_0x26fe();let _0x23d3bf=_0x26fe0c[_0x5a4147];return _0x23d3bf;}import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{generateDiff,formatDiffWithColors}from'../utils/diff.js';import{confirmKey}from'../utils/prompt.js';function a29_0x26fe(){const _0x3aa820=['red','scopedFolderPath','user','name','\x20unchanged','endsWith','error','\x20activations]','\x20\x20📊\x20Segments:','getParent','folderPath','toCreate','getOutputSchemaWithCache','dryRun','Changes\x20to:','4TXCZQi','\x20created','createdSegmentIds','/e/','Delete\x20segment:','unchanged','results','\x20to\x20update','join','push','cyan','message','parentFolder','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','new','855790zZTwEe','1jCZTPh','data','\x20YAML\x20files\x20found','\x20to\x20delete','yellow','then','\x20\x20Activations:','changed','✔\x20All\x20journeys\x20are\x20up\x20to\x20date','repeat','helpText','get','Push\x20','segmentFolderId','Scoped\x20to\x20folder:\x20','Error\x20parsing\x20YAML:\x20','dim','errorCode','parentName','createdAt','Site:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file','isNew','Fetching\x20existing\x20journeys...','Parent\x20segment:\x20','paused','Source\x20directory:\x20','\x20changes?','/j/da/je','\x20updated','Changes\x20to\x20journey:','Fetching\x20existing\x20segments...','deleted','segment:push','\x20\x20Journeys:\x20','idToName','Fetching\x20existing\x20folders...','Error:\x20Directory\x20not\x20found:\x20','30KXPBNf','parentSegment','updated','435555mudkCo','activations','existingJourney','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','add','20317pLFrAu','green','2058808gGNZMV','nameToType','targetDir','set','📁\x20','\x20folders\x20to\x20create','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','description','length','\x20changed','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)','segments','\x0aPush\x20summary\x20for\x20\x27','blue','delete','journeysOnly','(Journey\x20will\x20be\x20deleted)','\x20\x20Source:\x20','type','site','\x0aValidation\x20failed:','map','getJourney','30034bruwey','.yml','\x27...','filePath','filter','listSegments','diff','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','Fetching\x20parent\x20segment\x20details...','journeys','✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','resolveParentId','Fetching\x20users\x20for\x20email\x20resolution...','toString','file','journeyBundleName','\x20\x20Activations:\x20','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','listActivations','all','yamlConfig','1001355QoEFZG','execute','versionNumber','journeyId','verbose','folderId','journey','segment','/app/ps/','.yaml','Error:\x20','yes','Fetching\x20connections\x20for\x20name\x20resolution...','buildUserMaps','listJourneysWithDetailsFromParentSegment','\x20new','attributes','Delete\x20journey:','listFolders','1164nLQodS','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','created','toDelete','\x20deleted','341782YQQhaI','9SqGASK','\x20\x20\x20\x20','connection','parent_name','audienceId'];a29_0x26fe=function(){return _0x3aa820;};return a29_0x26fe();}import{batchAsync}from'../utils/async.js';import{segmentToYamlString,segmentWithActivationsToYaml}from'../sdk/segment/child-segment-yaml.js';import a29_0x59382d 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{[a29_0x148b94(0x1f9)]=a29_0x148b94(0x19b);[a29_0x148b94(0x1b3)]=a29_0x148b94(0x1ec);async[a29_0x148b94(0x1d9)](_0x3ee347){const _0x2fb0ec=a29_0x148b94,{options:_0x53f071,args:_0x15c851,tdx:_0x569999}=_0x3ee347,_0x4965b1=_0x53f071,_0x166c0a=await resolveTarget({'arg':_0x15c851[0x0],'contextParent':_0x53f071[_0x2fb0ec(0x1a1)],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x166c0a))return _0x166c0a[_0x2fb0ec(0x18b)]==='no_parent'?(console[_0x2fb0ec(0x1fc)](a29_0x59382d[_0x2fb0ec(0x17e)](_0x2fb0ec(0x1b1))),console[_0x2fb0ec(0x1fc)](_0x2fb0ec(0x1b6)),console[_0x2fb0ec(0x1fc)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent'),console[_0x2fb0ec(0x1fc)](_0x2fb0ec(0x18f))):(console[_0x2fb0ec(0x1fc)](a29_0x59382d[_0x2fb0ec(0x1f6)](_0x2fb0ec(0x1e2)+_0x166c0a['message']+'\x0a')),_0x166c0a[_0x2fb0ec(0x184)]&&console[_0x2fb0ec(0x1fc)](a29_0x59382d[_0x2fb0ec(0x174)](_0x166c0a[_0x2fb0ec(0x184)]))),0x1;if(_0x166c0a['type']===_0x2fb0ec(0x1f4))return console[_0x2fb0ec(0x1fc)](a29_0x59382d[_0x2fb0ec(0x1f6)](_0x2fb0ec(0x19f)+_0x166c0a[_0x2fb0ec(0x1ac)]+'\x0a')),console[_0x2fb0ec(0x1fc)](a29_0x59382d[_0x2fb0ec(0x174)](_0x2fb0ec(0x1b2))),0x1;const _0x3d98e4=_0x166c0a[_0x2fb0ec(0x18c)],_0x4bf7c2=_0x166c0a[_0x2fb0ec(0x1ac)],_0x3a3ef3=_0x166c0a[_0x2fb0ec(0x1be)]===_0x2fb0ec(0x1d1)?_0x166c0a[_0x2fb0ec(0x1c6)]:undefined,_0x3f8d0a=getScopedDetails(_0x166c0a),_0xf26547=_0x3f8d0a?.['isScoped']??![],_0xdc5e4a=_0x3f8d0a?.[_0x2fb0ec(0x1f7)]??'';if(!existsSync(_0x4bf7c2))return console[_0x2fb0ec(0x1fc)](a29_0x59382d[_0x2fb0ec(0x1f6)](_0x2fb0ec(0x19f)+_0x4bf7c2+'\x0a')),console['error'](a29_0x59382d['cyan'](_0x2fb0ec(0x1b2))),0x1;_0x4965b1[_0x2fb0ec(0x1dc)]&&(console[_0x2fb0ec(0x1fc)](_0x2fb0ec(0x18e)+_0x4965b1[_0x2fb0ec(0x1bf)]),console[_0x2fb0ec(0x1fc)](_0x2fb0ec(0x192)+_0x3d98e4),console[_0x2fb0ec(0x1fc)](_0x2fb0ec(0x194)+_0x4bf7c2),_0xf26547&&console[_0x2fb0ec(0x1fc)](_0x2fb0ec(0x188)+_0xdc5e4a));const _0xfa23ed=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x3d98e4+_0x2fb0ec(0x1c5),()=>_0x569999['segment'][_0x2fb0ec(0x1ce)](_0x3d98e4),{'verbose':_0x4965b1['verbose']}),_0x3a25f2=_0xfa23ed[_0x2fb0ec(0x17b)],[_0x46782b,_0x324d08,_0x1c0160,_0x385815,_0xdc1e5a]=await Promise[_0x2fb0ec(0x1d6)]([withSpinner(_0x2fb0ec(0x1cb),()=>_0x569999['segment'][_0x2fb0ec(0x1ff)](_0x3a25f2),{'verbose':_0x4965b1[_0x2fb0ec(0x1dc)]}),withSpinner(_0x2fb0ec(0x199),()=>_0x569999['segment'][_0x2fb0ec(0x1c8)](_0x3a25f2),{'verbose':_0x4965b1[_0x2fb0ec(0x1dc)]}),withSpinner(_0x2fb0ec(0x19e),()=>_0x569999[_0x2fb0ec(0x1df)][_0x2fb0ec(0x1ea)](_0x3a25f2),{'verbose':_0x4965b1['verbose']}),withSpinner(_0x2fb0ec(0x191),()=>_0x569999[_0x2fb0ec(0x1de)][_0x2fb0ec(0x1e6)](_0x3a25f2,{'includeAllVersions':!![]}),{'verbose':_0x4965b1[_0x2fb0ec(0x1dc)]}),withSpinner(_0x2fb0ec(0x1cf),()=>_0x569999['user'][_0x2fb0ec(0x1e5)](),{'verbose':_0x4965b1['verbose']})['then'](_0x51ba97=>_0x51ba97[_0x2fb0ec(0x17b)])]),_0x44c899=_0x46782b['data'],_0x6336e=extractRootFolderId(_0x44c899),_0x534f9f=_0x324d08[_0x2fb0ec(0x17b)],_0x49ae2b=_0x1c0160['data'],{journeys:_0x6811c,activationStepsById:_0xfa96e}=_0x385815[_0x2fb0ec(0x17b)],_0x31fbb1=new Map(_0x6811c[_0x2fb0ec(0x1c1)](_0x20e1be=>[_0x20e1be['id'],_0x20e1be])),_0x3bb89c=_0x6811c['map'](_0xed34a0=>({'id':_0xed34a0['id'],'name':_0xed34a0[_0x2fb0ec(0x1e8)][_0x2fb0ec(0x1f9)],'journeyBundleName':_0xed34a0[_0x2fb0ec(0x1e8)]['journeyBundleName']||'','journeyBundleId':_0xed34a0[_0x2fb0ec(0x1e8)]['journeyBundleId']||'','versionNumber':_0xed34a0[_0x2fb0ec(0x1e8)][_0x2fb0ec(0x1da)],'description':_0xed34a0[_0x2fb0ec(0x1e8)][_0x2fb0ec(0x1b3)],'state':_0xed34a0['attributes']['state'],'paused':_0xed34a0[_0x2fb0ec(0x1e8)][_0x2fb0ec(0x193)],'audienceId':_0xed34a0[_0x2fb0ec(0x1e8)][_0x2fb0ec(0x1f5)],'folderId':_0xed34a0['relationships']?.[_0x2fb0ec(0x176)]?.[_0x2fb0ec(0x17b)]?.['id'],'createdAt':_0xed34a0[_0x2fb0ec(0x1e8)][_0x2fb0ec(0x18d)],'updatedAt':_0xed34a0[_0x2fb0ec(0x1e8)]['updatedAt']})),{emailToId:_0x52d75b,idToEmail:_0x2796c7}=_0xdc1e5a,_0x24a71a=await withSpinner(_0x2fb0ec(0x1e4),async()=>{const _0x236b8d=_0x2fb0ec,_0x32d319=await _0x569999[_0x236b8d(0x1f3)]['list']();return buildConnectionMaps(_0x32d319);},{'verbose':_0x4965b1[_0x2fb0ec(0x1dc)]})[_0x2fb0ec(0x17f)](_0x1add43=>_0x1add43[_0x2fb0ec(0x17b)]),_0x22262c=_0x24a71a['nameToId'],_0x2d4dd6=_0x24a71a[_0x2fb0ec(0x19d)],_0x4156d7=_0x24a71a[_0x2fb0ec(0x1ab)],_0x3b642d={'emailToIdMap':_0x52d75b,'connectionNameToIdMap':_0x22262c,'connectionNameToTypeMap':_0x4156d7,'getSchema':_0x3be2c3=>_0x569999['connection'][_0x2fb0ec(0x202)](_0x3be2c3)};let {pathToId:_0xd75346,idToPath:_0x4ad80e}=buildFolderMaps(_0x49ae2b);const _0x184ea0=buildSegmentLookupMap(_0x534f9f,_0x4ad80e),_0xb2eb32=buildSegmentNameToIdMap(_0x534f9f),_0x5db5b4=buildJourneyBundleLookupMap(_0x3bb89c,_0x4ad80e);let _0x5dc204;if(_0x3a3ef3){if(!_0x3a3ef3[_0x2fb0ec(0x1fb)](_0x2fb0ec(0x1c4))&&!_0x3a3ef3[_0x2fb0ec(0x1fb)](_0x2fb0ec(0x1e1)))return console['error'](a29_0x59382d[_0x2fb0ec(0x1f6)]('Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20'+_0x3a3ef3+'\x0a')),0x1;_0x5dc204=[_0x3a3ef3];}else _0x5dc204=findYamlFiles(_0x4bf7c2);if(_0x5dc204['length']===0x0)return console[_0x2fb0ec(0x1fc)](a29_0x59382d[_0x2fb0ec(0x1f6)](_0x2fb0ec(0x1a6)+_0x4bf7c2+'\x0a')),console[_0x2fb0ec(0x1fc)](a29_0x59382d[_0x2fb0ec(0x174)](_0x2fb0ec(0x177))),0x1;let _0x4bb2d6,_0x30f8d1;try{const _0x2ce79f=parseAndClassifyYamlFiles(_0x5dc204,_0x4bf7c2,{'skipSegments':_0x4965b1[_0x2fb0ec(0x1bb)]});_0x4bb2d6=_0x2ce79f[_0x2fb0ec(0x1b7)],_0x30f8d1=_0x2ce79f['journeys'];const _0x55d7f8=validateParsedFiles(_0x2ce79f,_0x4bf7c2);if(_0x55d7f8[_0x2fb0ec(0x1b4)]>0x0)return console[_0x2fb0ec(0x1fc)](a29_0x59382d[_0x2fb0ec(0x1f6)](_0x2fb0ec(0x1c0))),console[_0x2fb0ec(0x1fc)](formatValidationErrors(_0x55d7f8)),console[_0x2fb0ec(0x1fc)](a29_0x59382d[_0x2fb0ec(0x17e)]('\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.')),0x1;}catch(_0x40b3d4){return console[_0x2fb0ec(0x1fc)](a29_0x59382d[_0x2fb0ec(0x1f6)](_0x2fb0ec(0x189)+(_0x40b3d4 instanceof Error?_0x40b3d4[_0x2fb0ec(0x175)]:_0x40b3d4))),0x1;}if(_0x4bb2d6[_0x2fb0ec(0x1b4)]===0x0&&_0x30f8d1[_0x2fb0ec(0x1b4)]===0x0){const _0x9cfa3a=_0x4965b1[_0x2fb0ec(0x1bb)]?_0x2fb0ec(0x1de):'segment\x20or\x20journey';return console[_0x2fb0ec(0x1fc)](a29_0x59382d['yellow']('No\x20'+_0x9cfa3a+_0x2fb0ec(0x17c))),0x0;}const _0x12f2f4=new Map();_0x534f9f['length']>0x0&&!_0x4965b1[_0x2fb0ec(0x1bb)]&&await withSpinner('Fetching\x20existing\x20activations...',async()=>{await batchAsync(_0x534f9f,async _0x2193b9=>{const _0x9ce622=a29_0x23d3,_0xd364d8=await _0x569999['segment'][_0x9ce622(0x1d5)](_0x3a25f2,_0x2193b9['id']);_0x12f2f4[_0x9ce622(0x1ad)](_0x2193b9['id'],_0xd364d8);});},{'verbose':_0x4965b1[_0x2fb0ec(0x1dc)]});const {segmentFiles:_0x15922b,foldersToCreate:_0x26cec3}=await prepareSegmentFiles(_0x4bb2d6,{'segmentByFolderAndName':_0x184ea0,'activationsBySegmentId':_0x12f2f4,'folderPathToId':_0xd75346,'idToEmailMap':_0x2796c7,'connectionIdToNameMap':_0x2d4dd6},_0x3b642d,_0xf26547,_0xdc5e4a),_0x176964=_0x3a3ef3?[]:findSegmentsToDelete(_0x534f9f,_0x4bb2d6['map'](({yamlConfig:_0xaf9ee1,folderPath:_0x2ad6e8})=>({'yamlConfig':_0xaf9ee1,'folderPath':resolveTDFolderPath(_0x2ad6e8,_0xf26547,_0xdc5e4a)})),_0x4ad80e,_0xdc5e4a,_0xf26547),{journeyFiles:_0x167354,foldersToCreate:_0x38e6f7}=await withProgressSpinner('Preparing\x20journeys...',async _0x5ab300=>prepareJourneyFiles(_0x30f8d1,{'fetchJourney':async _0x3fa2d9=>_0x569999['journey'][_0x2fb0ec(0x1c2)](_0x3fa2d9[_0x2fb0ec(0x1db)]),'journeyBundlesByFolderAndName':_0x5db5b4,'folderPathToId':_0xd75346,'idToEmailMap':_0x2796c7,'connectionIdToNameMap':_0x2d4dd6,'existingSegments':_0x534f9f,'parentId':_0x3a25f2,'deps':_0x569999,'progress':{'update':_0x59d6b0=>{const _0x184fe8=_0x2fb0ec;_0x5ab300['setPhase'](_0x59d6b0),_0x4965b1[_0x184fe8(0x1dc)]&&console[_0x184fe8(0x1fc)]('\x20\x20'+_0x59d6b0);}},'journeyById':_0x31fbb1,'activationStepsById':_0xfa96e},_0xf26547,_0xdc5e4a),{'verbose':_0x4965b1[_0x2fb0ec(0x1dc)]})[_0x2fb0ec(0x17f)](_0x4ef57f=>_0x4ef57f['data']);for(const _0x190ef3 of _0x38e6f7){_0x26cec3[_0x2fb0ec(0x1a7)](_0x190ef3);}const _0x3c419d=_0x3a3ef3?[]:findJourneysToDelete(_0x3bb89c,_0x30f8d1[_0x2fb0ec(0x1c1)](({yamlConfig:_0x57421d,folderPath:_0x2539c6})=>({'yamlConfig':_0x57421d,'folderPath':resolveTDFolderPath(_0x2539c6,_0xf26547,_0xdc5e4a)})),_0x4ad80e,_0xdc5e4a,_0xf26547),_0x23c23a=calculatePushStats(_0x15922b,_0x167354,_0x26cec3,_0x176964,_0x3c419d,!!_0x4965b1[_0x2fb0ec(0x1ba)],!!_0x4965b1[_0x2fb0ec(0x1bb)]),_0x302f14=_0x23c23a['segments']['new'],_0x317b65=_0x23c23a[_0x2fb0ec(0x1b7)]['changed'],_0x395f41=_0x23c23a[_0x2fb0ec(0x1b7)][_0x2fb0ec(0x16f)],_0x72c0b0=_0x23c23a[_0x2fb0ec(0x1b7)][_0x2fb0ec(0x1ee)],_0x52e2ad=_0x23c23a['folders'][_0x2fb0ec(0x201)],_0x43db94=_0x23c23a['journeys'][_0x2fb0ec(0x178)],_0x5486ed=_0x23c23a[_0x2fb0ec(0x1cc)][_0x2fb0ec(0x181)],_0x337794=_0x23c23a[_0x2fb0ec(0x1cc)]['unchanged'],_0x2bea55=_0x23c23a['journeys'][_0x2fb0ec(0x1ee)],_0x1d455c=_0x23c23a['activations'][_0x2fb0ec(0x1d6)],_0x175787=_0x23c23a[_0x2fb0ec(0x1a4)]['toCreate'],_0x17e8fb=_0x23c23a[_0x2fb0ec(0x1a4)]['toUpdate'],_0x2aaa8e=_0x23c23a[_0x2fb0ec(0x1a4)]['toDelete'];console[_0x2fb0ec(0x1fc)](_0x2fb0ec(0x1b8)+_0x3d98e4+'\x27:');_0x52e2ad['length']>0x0&&console[_0x2fb0ec(0x1fc)]('\x20\x20'+a29_0x59382d[_0x2fb0ec(0x1b9)](_0x2fb0ec(0x1ae)+_0x52e2ad[_0x2fb0ec(0x1b4)]+_0x2fb0ec(0x1af)));if(!_0x4965b1[_0x2fb0ec(0x1bb)]){console[_0x2fb0ec(0x1fc)](_0x2fb0ec(0x1fe)),console[_0x2fb0ec(0x1fc)](_0x2fb0ec(0x1f2)+a29_0x59382d[_0x2fb0ec(0x1a9)]('+\x20'+_0x302f14[_0x2fb0ec(0x1b4)]+_0x2fb0ec(0x1e7))),console[_0x2fb0ec(0x1fc)]('\x20\x20\x20\x20'+a29_0x59382d[_0x2fb0ec(0x17e)]('~\x20'+_0x317b65[_0x2fb0ec(0x1b4)]+_0x2fb0ec(0x1b5)));if(_0x72c0b0[_0x2fb0ec(0x1b4)]>0x0)console[_0x2fb0ec(0x1fc)](_0x2fb0ec(0x1f2)+a29_0x59382d[_0x2fb0ec(0x1f6)]('-\x20'+_0x72c0b0[_0x2fb0ec(0x1b4)]+_0x2fb0ec(0x17d)));else _0x176964[_0x2fb0ec(0x1b4)]>0x0&&!_0x4965b1[_0x2fb0ec(0x1ba)]&&console[_0x2fb0ec(0x1fc)](_0x2fb0ec(0x1f2)+a29_0x59382d[_0x2fb0ec(0x18a)](_0x176964[_0x2fb0ec(0x1b4)]+_0x2fb0ec(0x1b0)));console[_0x2fb0ec(0x1fc)](_0x2fb0ec(0x1f2)+a29_0x59382d['dim']('=\x20'+_0x395f41['length']+_0x2fb0ec(0x1fa)));}if(_0x167354[_0x2fb0ec(0x1b4)]>0x0||_0x3c419d['length']>0x0){console[_0x2fb0ec(0x1fc)]('\x20\x20🗺️\x20\x20Journeys:'),console['error'](_0x2fb0ec(0x1f2)+a29_0x59382d['green']('+\x20'+_0x43db94[_0x2fb0ec(0x1b4)]+_0x2fb0ec(0x1e7))),console['error'](_0x2fb0ec(0x1f2)+a29_0x59382d[_0x2fb0ec(0x17e)]('~\x20'+_0x5486ed[_0x2fb0ec(0x1b4)]+_0x2fb0ec(0x1b5)));if(_0x2bea55['length']>0x0)console[_0x2fb0ec(0x1fc)](_0x2fb0ec(0x1f2)+a29_0x59382d[_0x2fb0ec(0x1f6)]('-\x20'+_0x2bea55[_0x2fb0ec(0x1b4)]+_0x2fb0ec(0x17d)));else _0x3c419d[_0x2fb0ec(0x1b4)]>0x0&&!_0x4965b1['delete']&&console[_0x2fb0ec(0x1fc)](_0x2fb0ec(0x1f2)+a29_0x59382d[_0x2fb0ec(0x18a)](_0x3c419d[_0x2fb0ec(0x1b4)]+_0x2fb0ec(0x1b0)));console['error']('\x20\x20\x20\x20'+a29_0x59382d[_0x2fb0ec(0x18a)]('=\x20'+_0x337794[_0x2fb0ec(0x1b4)]+'\x20unchanged'));}_0x1d455c[_0x2fb0ec(0x1b4)]>0x0&&!_0x4965b1['journeysOnly']&&(console[_0x2fb0ec(0x1fc)](''),console[_0x2fb0ec(0x1fc)](_0x2fb0ec(0x180)),_0x175787['length']>0x0&&console['error'](_0x2fb0ec(0x1f2)+a29_0x59382d[_0x2fb0ec(0x1a9)]('+\x20'+_0x175787['length']+'\x20to\x20create')),_0x17e8fb['length']>0x0&&console[_0x2fb0ec(0x1fc)](_0x2fb0ec(0x1f2)+a29_0x59382d[_0x2fb0ec(0x17e)]('~\x20'+_0x17e8fb[_0x2fb0ec(0x1b4)]+_0x2fb0ec(0x171))),_0x2aaa8e[_0x2fb0ec(0x1b4)]>0x0&&console[_0x2fb0ec(0x1fc)]('\x20\x20\x20\x20'+a29_0x59382d['red']('-\x20'+_0x2aaa8e[_0x2fb0ec(0x1b4)]+_0x2fb0ec(0x17d))));console['error'](_0x2fb0ec(0x1bd)+a29_0x59382d[_0x2fb0ec(0x174)](_0x4bf7c2)+'\x0a');if(_0x52e2ad['length']>0x0){console[_0x2fb0ec(0x1fc)]('Folders\x20to\x20create:');for(const _0x4f5ff5 of _0x52e2ad){console[_0x2fb0ec(0x1fc)]('\x20\x20'+a29_0x59382d['blue']('+')+'\x20'+_0x4f5ff5);}console[_0x2fb0ec(0x1fc)]('');}if(_0x302f14[_0x2fb0ec(0x1b4)]>0x0&&!_0x4965b1[_0x2fb0ec(0x1bb)])for(const _0x50a931 of _0x302f14){const _0x1b4d5a=_0x50a931['folderPath']?_0x50a931[_0x2fb0ec(0x200)]+'/'+_0x50a931[_0x2fb0ec(0x1d7)]['name']:_0x50a931[_0x2fb0ec(0x1d7)][_0x2fb0ec(0x1f9)],_0x494c2e=_0x50a931[_0x2fb0ec(0x1d7)][_0x2fb0ec(0x1a4)]?.[_0x2fb0ec(0x1b4)]||0x0,_0xa8670=_0x494c2e>0x0?a29_0x59382d[_0x2fb0ec(0x18a)]('\x20['+_0x494c2e+_0x2fb0ec(0x1fd)):'';console[_0x2fb0ec(0x1fc)]('\x0a'+a29_0x59382d[_0x2fb0ec(0x1a9)]('New\x20segment:')+'\x20'+_0x1b4d5a+_0xa8670),console['error']('─'[_0x2fb0ec(0x183)](0x3c)),_0x50a931['diff']&&console[_0x2fb0ec(0x1fc)](_0x50a931[_0x2fb0ec(0x1c9)]),console[_0x2fb0ec(0x1fc)]('─'['repeat'](0x3c));}if(_0x72c0b0[_0x2fb0ec(0x1b4)]>0x0&&!_0x4965b1['journeysOnly'])for(const _0x111d34 of _0x72c0b0){const _0xa388b9=_0x111d34[_0x2fb0ec(0x187)]?_0x4ad80e[_0x2fb0ec(0x185)](_0x111d34[_0x2fb0ec(0x187)][_0x2fb0ec(0x1d0)]())||'':'',_0x22a271=_0xa388b9?_0xa388b9+'/'+_0x111d34['name']:_0x111d34[_0x2fb0ec(0x1f9)],_0x3b75da=_0x12f2f4[_0x2fb0ec(0x185)](_0x111d34['id'])||[],_0x464757=_0x3b75da[_0x2fb0ec(0x1b4)]>0x0?a29_0x59382d['dim']('\x20['+_0x3b75da['length']+_0x2fb0ec(0x1fd)):'';console[_0x2fb0ec(0x1fc)]('\x0a'+a29_0x59382d[_0x2fb0ec(0x1f6)](_0x2fb0ec(0x209))+'\x20'+_0x22a271+_0x464757),console[_0x2fb0ec(0x1fc)]('─'[_0x2fb0ec(0x183)](0x3c));const _0x3e203f=segmentWithActivationsToYaml(_0x111d34,_0x3b75da,undefined,_0x2796c7,_0x2d4dd6),_0x382ce4=segmentToYamlString(_0x3e203f),_0x141764=generateDiff(_0x382ce4,'');console[_0x2fb0ec(0x1fc)](formatDiffWithColors(_0x141764)),console['error']('─'['repeat'](0x3c));}const _0x46b6ae=_0x15922b[_0x2fb0ec(0x1c7)](_0x590fbe=>!_0x590fbe[_0x2fb0ec(0x190)]&&_0x590fbe[_0x2fb0ec(0x1c9)]);if(_0x46b6ae[_0x2fb0ec(0x1b4)]>0x0&&!_0x4965b1[_0x2fb0ec(0x1bb)])for(const _0x3129e1 of _0x46b6ae){const _0x317872=_0x3129e1[_0x2fb0ec(0x200)]?_0x3129e1['folderPath']+'/'+_0x3129e1[_0x2fb0ec(0x1d7)][_0x2fb0ec(0x1f9)]:_0x3129e1[_0x2fb0ec(0x1d7)]['name'];console[_0x2fb0ec(0x1fc)]('\x0a'+a29_0x59382d[_0x2fb0ec(0x17e)](_0x2fb0ec(0x204))+'\x20'+_0x317872),console[_0x2fb0ec(0x1fc)]('─'[_0x2fb0ec(0x183)](0x3c)),console[_0x2fb0ec(0x1fc)](_0x3129e1[_0x2fb0ec(0x1c9)]),console[_0x2fb0ec(0x1fc)]('─'[_0x2fb0ec(0x183)](0x3c));}if(_0x43db94[_0x2fb0ec(0x1b4)]>0x0)for(const _0x1de433 of _0x43db94){const _0x4caa01=_0x1de433[_0x2fb0ec(0x200)]?_0x1de433[_0x2fb0ec(0x200)]+'/'+_0x1de433[_0x2fb0ec(0x1d7)][_0x2fb0ec(0x1f9)]:_0x1de433[_0x2fb0ec(0x1d7)]['name'];console[_0x2fb0ec(0x1fc)]('\x0a'+a29_0x59382d[_0x2fb0ec(0x1a9)]('New\x20journey:')+'\x20'+_0x4caa01),console[_0x2fb0ec(0x1fc)]('─'[_0x2fb0ec(0x183)](0x3c)),_0x1de433['diff']&&console[_0x2fb0ec(0x1fc)](_0x1de433[_0x2fb0ec(0x1c9)]),console['error']('─'[_0x2fb0ec(0x183)](0x3c));}const _0x31bdaf=_0x167354[_0x2fb0ec(0x1c7)](_0x39d6d4=>!_0x39d6d4[_0x2fb0ec(0x190)]&&_0x39d6d4[_0x2fb0ec(0x1c9)]);if(_0x31bdaf['length']>0x0)for(const _0x7d3c11 of _0x31bdaf){const _0x5ef378=_0x7d3c11[_0x2fb0ec(0x200)]?_0x7d3c11[_0x2fb0ec(0x200)]+'/'+_0x7d3c11[_0x2fb0ec(0x1d7)][_0x2fb0ec(0x1f9)]:_0x7d3c11[_0x2fb0ec(0x1d7)][_0x2fb0ec(0x1f9)];console[_0x2fb0ec(0x1fc)]('\x0a'+a29_0x59382d[_0x2fb0ec(0x17e)](_0x2fb0ec(0x198))+'\x20'+_0x5ef378),console[_0x2fb0ec(0x1fc)]('─'[_0x2fb0ec(0x183)](0x3c)),console[_0x2fb0ec(0x1fc)](_0x7d3c11['diff']),console[_0x2fb0ec(0x1fc)]('─'[_0x2fb0ec(0x183)](0x3c));}if(_0x2bea55['length']>0x0)for(const _0xbf8851 of _0x2bea55){const _0x36510b=_0xbf8851[_0x2fb0ec(0x1dd)]?_0x4ad80e[_0x2fb0ec(0x185)](_0xbf8851[_0x2fb0ec(0x1dd)])||'':'',_0x13f538=_0x36510b?_0x36510b+'/'+_0xbf8851[_0x2fb0ec(0x1d2)]:_0xbf8851[_0x2fb0ec(0x1d2)];console[_0x2fb0ec(0x1fc)]('\x0a'+a29_0x59382d[_0x2fb0ec(0x1f6)](_0x2fb0ec(0x1e9))+'\x20'+_0x13f538),console[_0x2fb0ec(0x1fc)]('─'[_0x2fb0ec(0x183)](0x3c)),console['error'](a29_0x59382d[_0x2fb0ec(0x1f6)](_0x2fb0ec(0x1bc))),console['error']('─'[_0x2fb0ec(0x183)](0x3c));}if(_0x4965b1[_0x2fb0ec(0x203)])return console[_0x2fb0ec(0x1fc)](a29_0x59382d['yellow'](_0x2fb0ec(0x1d4))),0x0;const _0x37880a=_0x4965b1[_0x2fb0ec(0x1bb)]?![]:_0x302f14[_0x2fb0ec(0x1b4)]>0x0||_0x317b65[_0x2fb0ec(0x1b4)]>0x0||_0x72c0b0[_0x2fb0ec(0x1b4)]>0x0,_0x586451=_0x43db94['length']>0x0||_0x5486ed[_0x2fb0ec(0x1b4)]>0x0||_0x2bea55[_0x2fb0ec(0x1b4)]>0x0,_0x89e42d=_0x4965b1['journeysOnly']?![]:_0x1d455c[_0x2fb0ec(0x1b4)]>0x0,_0x300288=_0x52e2ad[_0x2fb0ec(0x1b4)]>0x0;if(!_0x37880a&&!_0x586451&&!_0x89e42d&&!_0x300288){const _0x2f8b20=_0x4965b1[_0x2fb0ec(0x1bb)]?_0x2fb0ec(0x182):_0x2fb0ec(0x1cd);console['error'](a29_0x59382d[_0x2fb0ec(0x1a9)](_0x2f8b20));if(_0x3a3ef3&&_0x337794[_0x2fb0ec(0x1b4)]===0x1){const _0x1820da=_0x337794[0x0];if(_0x1820da['existingJourney']?.['id']){const _0x2e0957=getConsoleNextUrl(_0x4965b1[_0x2fb0ec(0x1bf)],_0x2fb0ec(0x1e0)+_0x3a25f2+_0x2fb0ec(0x208)+_0x1820da[_0x2fb0ec(0x1a5)]['id']+'/j/da/je');console[_0x2fb0ec(0x1fc)]('\x20\x20'+a29_0x59382d[_0x2fb0ec(0x174)](_0x2e0957));}}return 0x0;}const _0x2efd75=_0x4965b1[_0x2fb0ec(0x1bb)]?_0x43db94[_0x2fb0ec(0x1b4)]+_0x5486ed[_0x2fb0ec(0x1b4)]+_0x2bea55[_0x2fb0ec(0x1b4)]+_0x52e2ad[_0x2fb0ec(0x1b4)]:_0x302f14[_0x2fb0ec(0x1b4)]+_0x317b65[_0x2fb0ec(0x1b4)]+_0x72c0b0[_0x2fb0ec(0x1b4)]+_0x43db94[_0x2fb0ec(0x1b4)]+_0x5486ed[_0x2fb0ec(0x1b4)]+_0x2bea55[_0x2fb0ec(0x1b4)]+_0x52e2ad['length']+_0x1d455c[_0x2fb0ec(0x1b4)];if(!_0x4965b1[_0x2fb0ec(0x1e3)]&&_0x2efd75>0x0){const _0xa0aee0=await confirmKey(_0x2fb0ec(0x186)+_0x2efd75+_0x2fb0ec(0x195));if(!_0xa0aee0)return console[_0x2fb0ec(0x1fc)]('Aborted.'),0x1;}const _0x59c15a={'withProgress':async(_0x17e598,_0x5c42cd)=>{const _0xa88e9f=_0x2fb0ec,_0x5beb94=await withSpinner(_0x17e598,_0x5c42cd,{'verbose':_0x4965b1['verbose']});return{'data':_0x5beb94[_0xa88e9f(0x17b)]};},'logInfo':_0x17ed71=>console['error'](a29_0x59382d[_0x2fb0ec(0x1b9)]('✔\x20'+_0x17ed71)),'logSuccess':_0x20f885=>console['error'](a29_0x59382d['green']('✔\x20'+_0x20f885)),'logWarning':_0x3ea156=>console[_0x2fb0ec(0x1fc)](a29_0x59382d[_0x2fb0ec(0x17e)]('⚠\x20'+_0x3ea156)),'logDeleted':_0x1f5849=>console[_0x2fb0ec(0x1fc)](a29_0x59382d[_0x2fb0ec(0x1f6)]('✔\x20'+_0x1f5849))},_0x21aa4f={'segment':_0x569999[_0x2fb0ec(0x1df)],'journey':_0x569999[_0x2fb0ec(0x1de)],'user':_0x569999[_0x2fb0ec(0x1f8)],'connection':_0x569999[_0x2fb0ec(0x1f3)]};_0x52e2ad['length']>0x0&&(_0xd75346=await executePushFolders(_0x21aa4f,_0x52e2ad,_0xd75346,{'parentId':_0x3a25f2},_0x59c15a));const _0x2673b3={'rootFolderId':_0x6336e,'folderPathToId':_0xd75346,'folderIdToPath':_0x4ad80e,'segmentNameToId':_0xb2eb32,'activationsBySegmentId':_0x12f2f4,'emailToIdMap':_0x52d75b,'idToEmailMap':_0x2796c7,'connectionNameToIdMap':_0x24a71a['nameToId'],'connectionIdToNameMap':_0x24a71a[_0x2fb0ec(0x19d)],'connectionNameToTypeMap':_0x4156d7},_0x511020=await executePushSegments(_0x21aa4f,_0x4965b1[_0x2fb0ec(0x1bb)]?[]:_0x15922b,_0x2673b3,{'parentId':_0x3a25f2},_0x59c15a),_0x592d93=_0x511020[_0x2fb0ec(0x1ed)],_0x44a950=_0x511020[_0x2fb0ec(0x1a2)],_0x395c66=_0x511020[_0x2fb0ec(0x1a4)][_0x2fb0ec(0x1ed)],_0x17a1c0=_0x511020[_0x2fb0ec(0x1a4)][_0x2fb0ec(0x1a2)],_0x4f7300=_0x511020['activations'][_0x2fb0ec(0x19a)],_0x5148a6=await executePushSegmentDeletions(_0x21aa4f,_0x4965b1[_0x2fb0ec(0x1bb)]?[]:_0x72c0b0,_0x59c15a);let _0x3e0031=0x0,_0x179d50=0x0,_0x56a0b8=0x0;const _0xd5614b=new Map(_0xb2eb32);for(const [_0x1f07e8,_0x4684d8]of _0x511020[_0x2fb0ec(0x207)]){_0xd5614b[_0x2fb0ec(0x1ad)](_0x1f07e8,_0x4684d8);}if(_0x167354[_0x2fb0ec(0x1b4)]>0x0){const _0x2fa1e2={..._0x2673b3,'segmentNameToId':_0xd5614b,'existingSegments':_0x534f9f,'activationContext':_0x3b642d},_0x356d77=await executePushJourneys(_0x21aa4f,_0x167354,_0x2fa1e2,{'parentId':_0x3a25f2,'rootFolderId':_0x6336e,'verbose':_0x4965b1['verbose']},_0x59c15a);_0x3e0031=_0x356d77[_0x2fb0ec(0x1ed)],_0x179d50=_0x356d77[_0x2fb0ec(0x1a2)];if(_0x3a3ef3&&_0x356d77[_0x2fb0ec(0x170)][_0x2fb0ec(0x1b4)]===0x1){const _0x12ffab=_0x356d77[_0x2fb0ec(0x170)][0x0];if(_0x12ffab['journeyId']){const _0x93a861=getConsoleNextUrl(_0x4965b1['site'],'/app/ps/'+_0x3a25f2+_0x2fb0ec(0x208)+_0x12ffab[_0x2fb0ec(0x1db)]+_0x2fb0ec(0x196));console[_0x2fb0ec(0x1fc)]('\x20\x20'+a29_0x59382d[_0x2fb0ec(0x174)](_0x93a861));}}}for(const _0x40750b of _0x2bea55){console[_0x2fb0ec(0x1fc)](a29_0x59382d['yellow'](_0x2fb0ec(0x1ca)+_0x40750b['journeyBundleName'])),_0x56a0b8++;}const _0x3569d4=[];if(_0x592d93>0x0)_0x3569d4[_0x2fb0ec(0x173)](_0x592d93+'\x20created');if(_0x44a950>0x0)_0x3569d4['push'](_0x44a950+'\x20updated');if(_0x5148a6>0x0)_0x3569d4['push'](_0x5148a6+'\x20deleted');const _0x4ec1ec=[];if(_0x3e0031>0x0)_0x4ec1ec['push'](_0x3e0031+'\x20created');if(_0x179d50>0x0)_0x4ec1ec[_0x2fb0ec(0x173)](_0x179d50+_0x2fb0ec(0x197));if(_0x56a0b8>0x0)_0x4ec1ec[_0x2fb0ec(0x173)](_0x56a0b8+_0x2fb0ec(0x1ef));const _0x46665c=[];if(_0x395c66>0x0)_0x46665c[_0x2fb0ec(0x173)](_0x395c66+_0x2fb0ec(0x206));if(_0x17a1c0>0x0)_0x46665c[_0x2fb0ec(0x173)](_0x17a1c0+'\x20updated');if(_0x4f7300>0x0)_0x46665c[_0x2fb0ec(0x173)](_0x4f7300+_0x2fb0ec(0x1ef));return console[_0x2fb0ec(0x1fc)](a29_0x59382d['green']('\x0a✔\x20Push\x20complete')),_0x3569d4[_0x2fb0ec(0x1b4)]>0x0&&!_0x4965b1['journeysOnly']&&console['error']('\x20\x20Segments:\x20'+_0x3569d4[_0x2fb0ec(0x172)](',\x20')),_0x4ec1ec['length']>0x0&&console[_0x2fb0ec(0x1fc)](_0x2fb0ec(0x19c)+_0x4ec1ec[_0x2fb0ec(0x172)](',\x20')),_0x46665c[_0x2fb0ec(0x1b4)]>0x0&&!_0x4965b1[_0x2fb0ec(0x1bb)]&&console[_0x2fb0ec(0x1fc)](_0x2fb0ec(0x1d3)+_0x46665c[_0x2fb0ec(0x172)](',\x20')),0x0;}}
1
+ const a29_0x3cf4a0=a29_0x5000;(function(_0x1c53b2,_0x183157){const _0x2e2ab2=a29_0x5000,_0x46a5ff=_0x1c53b2();while(!![]){try{const _0x5a4ccc=parseInt(_0x2e2ab2(0x96))/0x1+parseInt(_0x2e2ab2(0x10f))/0x2*(-parseInt(_0x2e2ab2(0xc0))/0x3)+-parseInt(_0x2e2ab2(0xec))/0x4*(parseInt(_0x2e2ab2(0xdd))/0x5)+parseInt(_0x2e2ab2(0xad))/0x6+parseInt(_0x2e2ab2(0xf3))/0x7+-parseInt(_0x2e2ab2(0xd5))/0x8+parseInt(_0x2e2ab2(0x9c))/0x9;if(_0x5a4ccc===_0x183157)break;else _0x46a5ff['push'](_0x46a5ff['shift']());}catch(_0x46b031){_0x46a5ff['push'](_0x46a5ff['shift']());}}}(a29_0x5326,0x8ad44));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';function a29_0x5000(_0x4748cd,_0x231140){_0x4748cd=_0x4748cd-0x85;const _0x53260d=a29_0x5326();let _0x500027=_0x53260d[_0x4748cd];return _0x500027;}import{batchAsync}from'../utils/async.js';import{segmentToYamlString,segmentWithActivationsToYaml}from'../sdk/segment/child-segment-yaml.js';function a29_0x5326(){const _0x78d223=['cyan','\x20to\x20update','listJourneysWithDetailsFromParentSegment','908626RhnXNu','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','\x20folders\x20to\x20create','relationships','setPhase','parentName','\x20\x20Journeys:\x20','Delete\x20journey:','Fetching\x20existing\x20segments...','\x20to\x20delete','Aborted.','\x20created','Error:\x20','data','Scoped\x20to\x20folder:\x20','changed','\x20deleted','no_parent','red','segments','yellow','toUpdate','\x20YAML\x20files\x20found','.yaml','targetDir','nameToId','Changes\x20to:','isNew','577008WJNQIh','journeyBundleId','add','parent_name','\x20\x20📊\x20Segments:','repeat','1004904fUociK','journeyBundleName','\x20unchanged','toDelete','\x20changed','file','set','verbose','Fetching\x20existing\x20journeys...','\x20\x20Activations:','yes','idToName','Delete\x20segment:','getParent','toCreate','createdAt','\x20\x20Segments:\x20','6690720PWtdDb','site','dim','existingJourney','listSegments','then','description','Error\x20parsing\x20YAML:\x20','Error:\x20Directory\x20not\x20found:\x20','folderId','diff','state','filter','New\x20journey:','updated','/app/ps/','Push\x20','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','green','6VAOcOj','activations','Fetching\x20connections\x20for\x20name\x20resolution...','segment:push','\x20new','get','Site:\x20','segmentFolderId','error','message','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','endsWith','unchanged','join','helpText','\x20activations]','📁\x20','deleted','delete','push','\x20\x20Source:\x20','6250632DOnGRA','dryRun','errorCode','\x20updated','yamlConfig','folderPath','getJourney','/j/da/je','16065KcIIYz','audienceId','folders','new','No\x20','filePath','updatedAt','buildUserMaps','parentSegment','journeysOnly','name','all','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','segment','connection','68yiOLvS','Fetching\x20parent\x20segment\x20details...','toString','type','Fetching\x20existing\x20folders...','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','results','3566052zwjgiN','Fetching\x20users\x20for\x20email\x20resolution...','\x0aValidation\x20failed:','(Journey\x20will\x20be\x20deleted)','✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','blue','map','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','/e/','New\x20segment:','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','journeys','resolveParentId','created','createdSegmentIds','attributes','\x20\x20\x20\x20','\x0aPush\x20summary\x20for\x20\x27','\x20\x20Activations:\x20','length','journeyId','Folders\x20to\x20create:','journey','listFolders','versionNumber'];a29_0x5326=function(){return _0x78d223;};return a29_0x5326();}import a29_0x1bb08c 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']=a29_0x3cf4a0(0xc3);[a29_0x3cf4a0(0xb3)]=a29_0x3cf4a0(0xf1);async['execute'](_0x10ed41){const _0x22d723=a29_0x3cf4a0,{options:_0x2411ea,args:_0x306b11,tdx:_0x552f9b}=_0x10ed41,_0x359a36=_0x2411ea,_0x27fca0=await resolveTarget({'arg':_0x306b11[0x0],'contextParent':_0x2411ea[_0x22d723(0xe5)],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x27fca0))return _0x27fca0[_0x22d723(0xd7)]===_0x22d723(0x8b)?(console['error'](a29_0x1bb08c[_0x22d723(0x8e)](_0x22d723(0xfa))),console[_0x22d723(0xc8)]('Usage:\x20tdx\x20sg\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20(requires\x20context)'),console['error']('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent'),console[_0x22d723(0xc8)]('\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[_0x22d723(0xc8)](a29_0x1bb08c[_0x22d723(0x8c)](_0x22d723(0x86)+_0x27fca0[_0x22d723(0xc9)]+'\x0a')),_0x27fca0['helpText']&&console[_0x22d723(0xc8)](a29_0x1bb08c[_0x22d723(0x10c)](_0x27fca0[_0x22d723(0xce)]))),0x1;if(_0x27fca0[_0x22d723(0xef)]===_0x22d723(0x99))return console[_0x22d723(0xc8)](a29_0x1bb08c[_0x22d723(0x8c)](_0x22d723(0xb5)+_0x27fca0[_0x22d723(0x92)]+'\x0a')),console['error'](a29_0x1bb08c['cyan'](_0x22d723(0xbe))),0x1;const _0x31f66b=_0x27fca0[_0x22d723(0x115)],_0x11dad0=_0x27fca0[_0x22d723(0x92)],_0x5ba0fe=_0x27fca0['type']===_0x22d723(0xa1)?_0x27fca0[_0x22d723(0xe2)]:undefined,_0x55994f=getScopedDetails(_0x27fca0),_0x2edbce=_0x55994f?.['isScoped']??![],_0x492019=_0x55994f?.['scopedFolderPath']??'';if(!existsSync(_0x11dad0))return console[_0x22d723(0xc8)](a29_0x1bb08c[_0x22d723(0x8c)](_0x22d723(0xb5)+_0x11dad0+'\x0a')),console[_0x22d723(0xc8)](a29_0x1bb08c[_0x22d723(0x10c)](_0x22d723(0xbe))),0x1;_0x359a36[_0x22d723(0xa3)]&&(console[_0x22d723(0xc8)](_0x22d723(0xc6)+_0x359a36[_0x22d723(0xae)]),console[_0x22d723(0xc8)]('Parent\x20segment:\x20'+_0x31f66b),console[_0x22d723(0xc8)]('Source\x20directory:\x20'+_0x11dad0),_0x2edbce&&console['error'](_0x22d723(0x88)+_0x492019));const _0x2781c1=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x31f66b+'\x27...',()=>_0x552f9b[_0x22d723(0xea)][_0x22d723(0xff)](_0x31f66b),{'verbose':_0x359a36[_0x22d723(0xa3)]}),_0x352506=_0x2781c1[_0x22d723(0x87)],[_0x36831e,_0x4df887,_0x4b2223,_0xa9ccdf,_0x1b645e]=await Promise['all']([withSpinner(_0x22d723(0xed),()=>_0x552f9b[_0x22d723(0xea)][_0x22d723(0xa9)](_0x352506),{'verbose':_0x359a36[_0x22d723(0xa3)]}),withSpinner(_0x22d723(0x118),()=>_0x552f9b[_0x22d723(0xea)][_0x22d723(0xb1)](_0x352506),{'verbose':_0x359a36[_0x22d723(0xa3)]}),withSpinner(_0x22d723(0xf0),()=>_0x552f9b[_0x22d723(0xea)][_0x22d723(0x10a)](_0x352506),{'verbose':_0x359a36[_0x22d723(0xa3)]}),withSpinner(_0x22d723(0xa4),()=>_0x552f9b['journey'][_0x22d723(0x10e)](_0x352506,{'includeAllVersions':!![]}),{'verbose':_0x359a36[_0x22d723(0xa3)]}),withSpinner(_0x22d723(0xf4),()=>_0x552f9b['user'][_0x22d723(0xe4)](),{'verbose':_0x359a36[_0x22d723(0xa3)]})[_0x22d723(0xb2)](_0x51b165=>_0x51b165[_0x22d723(0x87)])]),_0x3e74cf=_0x36831e[_0x22d723(0x87)],_0x2cd532=extractRootFolderId(_0x3e74cf),_0xbd835b=_0x4df887[_0x22d723(0x87)],_0x18194e=_0x4b2223['data'],{journeys:_0xa2d9c4,activationStepsById:_0x49d4b4}=_0xa9ccdf[_0x22d723(0x87)],_0x179714=new Map(_0xa2d9c4[_0x22d723(0xf9)](_0x1e5ff=>[_0x1e5ff['id'],_0x1e5ff])),_0x5567e5=_0xa2d9c4[_0x22d723(0xf9)](_0x229026=>({'id':_0x229026['id'],'name':_0x229026[_0x22d723(0x102)][_0x22d723(0xe7)],'journeyBundleName':_0x229026[_0x22d723(0x102)][_0x22d723(0x9d)]||'','journeyBundleId':_0x229026[_0x22d723(0x102)][_0x22d723(0x97)]||'','versionNumber':_0x229026['attributes'][_0x22d723(0x10b)],'description':_0x229026[_0x22d723(0x102)][_0x22d723(0xb3)],'state':_0x229026[_0x22d723(0x102)][_0x22d723(0xb8)],'paused':_0x229026[_0x22d723(0x102)]['paused'],'audienceId':_0x229026[_0x22d723(0x102)][_0x22d723(0xde)],'folderId':_0x229026[_0x22d723(0x113)]?.['parentFolder']?.[_0x22d723(0x87)]?.['id'],'createdAt':_0x229026[_0x22d723(0x102)][_0x22d723(0xab)],'updatedAt':_0x229026[_0x22d723(0x102)][_0x22d723(0xe3)]})),{emailToId:_0x24e70e,idToEmail:_0x3c3d64}=_0x1b645e,_0x3f3978=await withSpinner(_0x22d723(0xc2),async()=>{const _0x58b4a4=_0x22d723,_0x5b0848=await _0x552f9b[_0x58b4a4(0xeb)]['list']();return buildConnectionMaps(_0x5b0848);},{'verbose':_0x359a36['verbose']})[_0x22d723(0xb2)](_0x379514=>_0x379514[_0x22d723(0x87)]),_0x18de74=_0x3f3978[_0x22d723(0x93)],_0x530b29=_0x3f3978[_0x22d723(0xa7)],_0x3f6071=_0x3f3978['nameToType'],_0x388e84={'emailToIdMap':_0x24e70e,'connectionNameToIdMap':_0x18de74,'connectionNameToTypeMap':_0x3f6071,'getSchema':_0x446915=>_0x552f9b[_0x22d723(0xeb)]['getOutputSchemaWithCache'](_0x446915)};let {pathToId:_0x36b6b3,idToPath:_0x3cce08}=buildFolderMaps(_0x18194e);const _0x159caa=buildSegmentLookupMap(_0xbd835b,_0x3cce08),_0x8459e6=buildSegmentNameToIdMap(_0xbd835b),_0x4c2c33=buildJourneyBundleLookupMap(_0x5567e5,_0x3cce08);let _0x3a0375;if(_0x5ba0fe){if(!_0x5ba0fe[_0x22d723(0xcb)]('.yml')&&!_0x5ba0fe[_0x22d723(0xcb)](_0x22d723(0x91)))return console[_0x22d723(0xc8)](a29_0x1bb08c[_0x22d723(0x8c)](_0x22d723(0xfd)+_0x5ba0fe+'\x0a')),0x1;_0x3a0375=[_0x5ba0fe];}else _0x3a0375=findYamlFiles(_0x11dad0);if(_0x3a0375['length']===0x0)return console[_0x22d723(0xc8)](a29_0x1bb08c[_0x22d723(0x8c)]('Error:\x20No\x20YAML\x20files\x20found\x20in\x20'+_0x11dad0+'\x0a')),console['error'](a29_0x1bb08c[_0x22d723(0x10c)](_0x22d723(0x111))),0x1;let _0xc386c8,_0x11a5e6;try{const _0x53d055=parseAndClassifyYamlFiles(_0x3a0375,_0x11dad0,{'skipSegments':_0x359a36[_0x22d723(0xe6)]});_0xc386c8=_0x53d055[_0x22d723(0x8d)],_0x11a5e6=_0x53d055['journeys'];const _0x3c0ba3=validateParsedFiles(_0x53d055,_0x11dad0);if(_0x3c0ba3['length']>0x0)return console[_0x22d723(0xc8)](a29_0x1bb08c[_0x22d723(0x8c)](_0x22d723(0xf5))),console[_0x22d723(0xc8)](formatValidationErrors(_0x3c0ba3)),console['error'](a29_0x1bb08c[_0x22d723(0x8e)](_0x22d723(0x110))),0x1;}catch(_0x56101b){return console[_0x22d723(0xc8)](a29_0x1bb08c[_0x22d723(0x8c)](_0x22d723(0xb4)+(_0x56101b instanceof Error?_0x56101b[_0x22d723(0xc9)]:_0x56101b))),0x1;}if(_0xc386c8[_0x22d723(0x106)]===0x0&&_0x11a5e6[_0x22d723(0x106)]===0x0){const _0x53ce43=_0x359a36[_0x22d723(0xe6)]?_0x22d723(0x109):'segment\x20or\x20journey';return console[_0x22d723(0xc8)](a29_0x1bb08c['yellow'](_0x22d723(0xe1)+_0x53ce43+_0x22d723(0x90))),0x0;}const _0x564065=new Map();_0xbd835b[_0x22d723(0x106)]>0x0&&!_0x359a36[_0x22d723(0xe6)]&&await withSpinner('Fetching\x20existing\x20activations...',async()=>{await batchAsync(_0xbd835b,async _0x392b05=>{const _0x6b7a03=a29_0x5000,_0x5e6f09=await _0x552f9b[_0x6b7a03(0xea)]['listActivations'](_0x352506,_0x392b05['id']);_0x564065['set'](_0x392b05['id'],_0x5e6f09);});},{'verbose':_0x359a36[_0x22d723(0xa3)]});const {segmentFiles:_0x2741a1,foldersToCreate:_0x7403f}=await prepareSegmentFiles(_0xc386c8,{'segmentByFolderAndName':_0x159caa,'activationsBySegmentId':_0x564065,'folderPathToId':_0x36b6b3,'idToEmailMap':_0x3c3d64,'connectionIdToNameMap':_0x530b29},_0x388e84,_0x2edbce,_0x492019),_0x481e4b=_0x5ba0fe?[]:findSegmentsToDelete(_0xbd835b,_0xc386c8[_0x22d723(0xf9)](({yamlConfig:_0x12c4b7,folderPath:_0x271810})=>({'yamlConfig':_0x12c4b7,'folderPath':resolveTDFolderPath(_0x271810,_0x2edbce,_0x492019)})),_0x3cce08,_0x492019,_0x2edbce),{journeyFiles:_0x5b3fa0,foldersToCreate:_0x314a85}=await withProgressSpinner('Preparing\x20journeys...',async _0x3cfe59=>prepareJourneyFiles(_0x11a5e6,{'fetchJourney':async _0x4ac996=>_0x552f9b['journey'][_0x22d723(0xdb)](_0x4ac996[_0x22d723(0x107)]),'journeyBundlesByFolderAndName':_0x4c2c33,'folderPathToId':_0x36b6b3,'idToEmailMap':_0x3c3d64,'connectionIdToNameMap':_0x530b29,'existingSegments':_0xbd835b,'parentId':_0x352506,'deps':_0x552f9b,'progress':{'update':_0x378cf7=>{const _0x62d05d=_0x22d723;_0x3cfe59[_0x62d05d(0x114)](_0x378cf7),_0x359a36[_0x62d05d(0xa3)]&&console[_0x62d05d(0xc8)]('\x20\x20'+_0x378cf7);}},'journeyById':_0x179714,'activationStepsById':_0x49d4b4},_0x2edbce,_0x492019),{'verbose':_0x359a36[_0x22d723(0xa3)]})[_0x22d723(0xb2)](_0x881af7=>_0x881af7[_0x22d723(0x87)]);for(const _0x1326e4 of _0x314a85){_0x7403f[_0x22d723(0x98)](_0x1326e4);}const _0x5fcd8d=_0x5ba0fe?[]:findJourneysToDelete(_0x5567e5,_0x11a5e6[_0x22d723(0xf9)](({yamlConfig:_0x35a973,folderPath:_0xe4467e})=>({'yamlConfig':_0x35a973,'folderPath':resolveTDFolderPath(_0xe4467e,_0x2edbce,_0x492019)})),_0x3cce08,_0x492019,_0x2edbce),_0x3f6761=calculatePushStats(_0x2741a1,_0x5b3fa0,_0x7403f,_0x481e4b,_0x5fcd8d,!!_0x359a36[_0x22d723(0xd2)],!!_0x359a36[_0x22d723(0xe6)]),_0x5e23f8=_0x3f6761['segments'][_0x22d723(0xe0)],_0x3f5911=_0x3f6761[_0x22d723(0x8d)]['changed'],_0x3f6346=_0x3f6761[_0x22d723(0x8d)]['unchanged'],_0x29f518=_0x3f6761[_0x22d723(0x8d)][_0x22d723(0x9f)],_0xf09887=_0x3f6761[_0x22d723(0xdf)]['toCreate'],_0x38c0d5=_0x3f6761[_0x22d723(0xfe)][_0x22d723(0xe0)],_0x2aa424=_0x3f6761[_0x22d723(0xfe)][_0x22d723(0x89)],_0x45a8a2=_0x3f6761[_0x22d723(0xfe)][_0x22d723(0xcc)],_0x491338=_0x3f6761[_0x22d723(0xfe)][_0x22d723(0x9f)],_0x4b2f92=_0x3f6761[_0x22d723(0xc1)][_0x22d723(0xe8)],_0x49d7da=_0x3f6761[_0x22d723(0xc1)][_0x22d723(0xaa)],_0x51fb1a=_0x3f6761[_0x22d723(0xc1)][_0x22d723(0x8f)],_0x977554=_0x3f6761['activations'][_0x22d723(0x9f)];console[_0x22d723(0xc8)](_0x22d723(0x104)+_0x31f66b+'\x27:');_0xf09887[_0x22d723(0x106)]>0x0&&console[_0x22d723(0xc8)]('\x20\x20'+a29_0x1bb08c[_0x22d723(0xf8)](_0x22d723(0xd0)+_0xf09887[_0x22d723(0x106)]+_0x22d723(0x112)));if(!_0x359a36[_0x22d723(0xe6)]){console['error'](_0x22d723(0x9a)),console[_0x22d723(0xc8)]('\x20\x20\x20\x20'+a29_0x1bb08c[_0x22d723(0xbf)]('+\x20'+_0x5e23f8[_0x22d723(0x106)]+'\x20new')),console[_0x22d723(0xc8)](_0x22d723(0x103)+a29_0x1bb08c['yellow']('~\x20'+_0x3f5911[_0x22d723(0x106)]+_0x22d723(0xa0)));if(_0x29f518['length']>0x0)console['error']('\x20\x20\x20\x20'+a29_0x1bb08c[_0x22d723(0x8c)]('-\x20'+_0x29f518[_0x22d723(0x106)]+_0x22d723(0x119)));else _0x481e4b[_0x22d723(0x106)]>0x0&&!_0x359a36[_0x22d723(0xd2)]&&console['error'](_0x22d723(0x103)+a29_0x1bb08c[_0x22d723(0xaf)](_0x481e4b[_0x22d723(0x106)]+_0x22d723(0xe9)));console[_0x22d723(0xc8)](_0x22d723(0x103)+a29_0x1bb08c[_0x22d723(0xaf)]('=\x20'+_0x3f6346[_0x22d723(0x106)]+_0x22d723(0x9e)));}if(_0x5b3fa0[_0x22d723(0x106)]>0x0||_0x5fcd8d[_0x22d723(0x106)]>0x0){console['error']('\x20\x20🗺️\x20\x20Journeys:'),console[_0x22d723(0xc8)](_0x22d723(0x103)+a29_0x1bb08c[_0x22d723(0xbf)]('+\x20'+_0x38c0d5[_0x22d723(0x106)]+_0x22d723(0xc4))),console[_0x22d723(0xc8)](_0x22d723(0x103)+a29_0x1bb08c['yellow']('~\x20'+_0x2aa424[_0x22d723(0x106)]+_0x22d723(0xa0)));if(_0x491338[_0x22d723(0x106)]>0x0)console[_0x22d723(0xc8)]('\x20\x20\x20\x20'+a29_0x1bb08c[_0x22d723(0x8c)]('-\x20'+_0x491338['length']+_0x22d723(0x119)));else _0x5fcd8d[_0x22d723(0x106)]>0x0&&!_0x359a36[_0x22d723(0xd2)]&&console[_0x22d723(0xc8)](_0x22d723(0x103)+a29_0x1bb08c[_0x22d723(0xaf)](_0x5fcd8d[_0x22d723(0x106)]+_0x22d723(0xe9)));console[_0x22d723(0xc8)](_0x22d723(0x103)+a29_0x1bb08c['dim']('=\x20'+_0x45a8a2[_0x22d723(0x106)]+_0x22d723(0x9e)));}_0x4b2f92['length']>0x0&&!_0x359a36['journeysOnly']&&(console[_0x22d723(0xc8)](''),console[_0x22d723(0xc8)](_0x22d723(0xa5)),_0x49d7da['length']>0x0&&console[_0x22d723(0xc8)](_0x22d723(0x103)+a29_0x1bb08c[_0x22d723(0xbf)]('+\x20'+_0x49d7da['length']+'\x20to\x20create')),_0x51fb1a['length']>0x0&&console[_0x22d723(0xc8)](_0x22d723(0x103)+a29_0x1bb08c[_0x22d723(0x8e)]('~\x20'+_0x51fb1a[_0x22d723(0x106)]+_0x22d723(0x10d))),_0x977554[_0x22d723(0x106)]>0x0&&console[_0x22d723(0xc8)](_0x22d723(0x103)+a29_0x1bb08c['red']('-\x20'+_0x977554[_0x22d723(0x106)]+_0x22d723(0x119))));console[_0x22d723(0xc8)](_0x22d723(0xd4)+a29_0x1bb08c[_0x22d723(0x10c)](_0x11dad0)+'\x0a');if(_0xf09887[_0x22d723(0x106)]>0x0){console['error'](_0x22d723(0x108));for(const _0x2a0507 of _0xf09887){console['error']('\x20\x20'+a29_0x1bb08c[_0x22d723(0xf8)]('+')+'\x20'+_0x2a0507);}console[_0x22d723(0xc8)]('');}if(_0x5e23f8['length']>0x0&&!_0x359a36['journeysOnly'])for(const _0x48ff4c of _0x5e23f8){const _0x4e6e80=_0x48ff4c[_0x22d723(0xda)]?_0x48ff4c[_0x22d723(0xda)]+'/'+_0x48ff4c[_0x22d723(0xd9)][_0x22d723(0xe7)]:_0x48ff4c[_0x22d723(0xd9)][_0x22d723(0xe7)],_0x5eb2ab=_0x48ff4c[_0x22d723(0xd9)]['activations']?.[_0x22d723(0x106)]||0x0,_0x29bbe5=_0x5eb2ab>0x0?a29_0x1bb08c[_0x22d723(0xaf)]('\x20['+_0x5eb2ab+_0x22d723(0xcf)):'';console[_0x22d723(0xc8)]('\x0a'+a29_0x1bb08c[_0x22d723(0xbf)](_0x22d723(0xfc))+'\x20'+_0x4e6e80+_0x29bbe5),console[_0x22d723(0xc8)]('─'[_0x22d723(0x9b)](0x3c)),_0x48ff4c['diff']&&console[_0x22d723(0xc8)](_0x48ff4c[_0x22d723(0xb7)]),console[_0x22d723(0xc8)]('─'[_0x22d723(0x9b)](0x3c));}if(_0x29f518[_0x22d723(0x106)]>0x0&&!_0x359a36[_0x22d723(0xe6)])for(const _0x242f61 of _0x29f518){const _0x9f06db=_0x242f61[_0x22d723(0xc7)]?_0x3cce08['get'](_0x242f61[_0x22d723(0xc7)][_0x22d723(0xee)]())||'':'',_0xdc371d=_0x9f06db?_0x9f06db+'/'+_0x242f61[_0x22d723(0xe7)]:_0x242f61[_0x22d723(0xe7)],_0x504256=_0x564065[_0x22d723(0xc5)](_0x242f61['id'])||[],_0x4eebbb=_0x504256[_0x22d723(0x106)]>0x0?a29_0x1bb08c[_0x22d723(0xaf)]('\x20['+_0x504256['length']+_0x22d723(0xcf)):'';console[_0x22d723(0xc8)]('\x0a'+a29_0x1bb08c[_0x22d723(0x8c)](_0x22d723(0xa8))+'\x20'+_0xdc371d+_0x4eebbb),console['error']('─'['repeat'](0x3c));const _0x35feb2=segmentWithActivationsToYaml(_0x242f61,_0x504256,undefined,_0x3c3d64,_0x530b29),_0x2c2a4e=segmentToYamlString(_0x35feb2),_0x1f2825=generateDiff(_0x2c2a4e,'');console[_0x22d723(0xc8)](formatDiffWithColors(_0x1f2825)),console['error']('─'[_0x22d723(0x9b)](0x3c));}const _0x358ae9=_0x2741a1[_0x22d723(0xb9)](_0x534877=>!_0x534877[_0x22d723(0x95)]&&_0x534877[_0x22d723(0xb7)]);if(_0x358ae9[_0x22d723(0x106)]>0x0&&!_0x359a36['journeysOnly'])for(const _0x2e7769 of _0x358ae9){const _0x440187=_0x2e7769[_0x22d723(0xda)]?_0x2e7769[_0x22d723(0xda)]+'/'+_0x2e7769[_0x22d723(0xd9)][_0x22d723(0xe7)]:_0x2e7769[_0x22d723(0xd9)]['name'];console[_0x22d723(0xc8)]('\x0a'+a29_0x1bb08c[_0x22d723(0x8e)](_0x22d723(0x94))+'\x20'+_0x440187),console[_0x22d723(0xc8)]('─'[_0x22d723(0x9b)](0x3c)),console[_0x22d723(0xc8)](_0x2e7769['diff']),console[_0x22d723(0xc8)]('─'[_0x22d723(0x9b)](0x3c));}if(_0x38c0d5['length']>0x0)for(const _0x15f5ab of _0x38c0d5){const _0x55f766=_0x15f5ab['folderPath']?_0x15f5ab['folderPath']+'/'+_0x15f5ab[_0x22d723(0xd9)][_0x22d723(0xe7)]:_0x15f5ab[_0x22d723(0xd9)][_0x22d723(0xe7)];console[_0x22d723(0xc8)]('\x0a'+a29_0x1bb08c[_0x22d723(0xbf)](_0x22d723(0xba))+'\x20'+_0x55f766),console[_0x22d723(0xc8)]('─'[_0x22d723(0x9b)](0x3c)),_0x15f5ab[_0x22d723(0xb7)]&&console[_0x22d723(0xc8)](_0x15f5ab[_0x22d723(0xb7)]),console[_0x22d723(0xc8)]('─'['repeat'](0x3c));}const _0x25f582=_0x5b3fa0[_0x22d723(0xb9)](_0x2e81a4=>!_0x2e81a4[_0x22d723(0x95)]&&_0x2e81a4['diff']);if(_0x25f582[_0x22d723(0x106)]>0x0)for(const _0x24e6c1 of _0x25f582){const _0x177962=_0x24e6c1['folderPath']?_0x24e6c1['folderPath']+'/'+_0x24e6c1[_0x22d723(0xd9)][_0x22d723(0xe7)]:_0x24e6c1['yamlConfig'][_0x22d723(0xe7)];console['error']('\x0a'+a29_0x1bb08c['yellow']('Changes\x20to\x20journey:')+'\x20'+_0x177962),console[_0x22d723(0xc8)]('─'[_0x22d723(0x9b)](0x3c)),console['error'](_0x24e6c1['diff']),console[_0x22d723(0xc8)]('─'[_0x22d723(0x9b)](0x3c));}if(_0x491338['length']>0x0)for(const _0x96658d of _0x491338){const _0x38cd32=_0x96658d[_0x22d723(0xb6)]?_0x3cce08['get'](_0x96658d['folderId'])||'':'',_0x4f542d=_0x38cd32?_0x38cd32+'/'+_0x96658d[_0x22d723(0x9d)]:_0x96658d[_0x22d723(0x9d)];console[_0x22d723(0xc8)]('\x0a'+a29_0x1bb08c[_0x22d723(0x8c)](_0x22d723(0x117))+'\x20'+_0x4f542d),console[_0x22d723(0xc8)]('─'[_0x22d723(0x9b)](0x3c)),console[_0x22d723(0xc8)](a29_0x1bb08c['red'](_0x22d723(0xf6))),console[_0x22d723(0xc8)]('─'[_0x22d723(0x9b)](0x3c));}if(_0x359a36[_0x22d723(0xd6)])return console['error'](a29_0x1bb08c['yellow']('\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made')),0x0;const _0x4a6d92=_0x359a36[_0x22d723(0xe6)]?![]:_0x5e23f8['length']>0x0||_0x3f5911[_0x22d723(0x106)]>0x0||_0x29f518[_0x22d723(0x106)]>0x0,_0x40f6c3=_0x38c0d5['length']>0x0||_0x2aa424[_0x22d723(0x106)]>0x0||_0x491338['length']>0x0,_0x1e8dc1=_0x359a36['journeysOnly']?![]:_0x4b2f92[_0x22d723(0x106)]>0x0,_0x1c87e2=_0xf09887[_0x22d723(0x106)]>0x0;if(!_0x4a6d92&&!_0x40f6c3&&!_0x1e8dc1&&!_0x1c87e2){const _0x1f4b53=_0x359a36['journeysOnly']?'✔\x20All\x20journeys\x20are\x20up\x20to\x20date':_0x22d723(0xf7);console[_0x22d723(0xc8)](a29_0x1bb08c[_0x22d723(0xbf)](_0x1f4b53));if(_0x5ba0fe&&_0x45a8a2[_0x22d723(0x106)]===0x1){const _0x4079a6=_0x45a8a2[0x0];if(_0x4079a6[_0x22d723(0xb0)]?.['id']){const _0x109cc4=getConsoleNextUrl(_0x359a36['site'],'/app/ps/'+_0x352506+'/e/'+_0x4079a6[_0x22d723(0xb0)]['id']+_0x22d723(0xdc));console[_0x22d723(0xc8)]('\x20\x20'+a29_0x1bb08c[_0x22d723(0x10c)](_0x109cc4));}}return 0x0;}const _0x18831c=_0x359a36[_0x22d723(0xe6)]?_0x38c0d5[_0x22d723(0x106)]+_0x2aa424[_0x22d723(0x106)]+_0x491338[_0x22d723(0x106)]+_0xf09887[_0x22d723(0x106)]:_0x5e23f8[_0x22d723(0x106)]+_0x3f5911['length']+_0x29f518[_0x22d723(0x106)]+_0x38c0d5[_0x22d723(0x106)]+_0x2aa424['length']+_0x491338[_0x22d723(0x106)]+_0xf09887[_0x22d723(0x106)]+_0x4b2f92[_0x22d723(0x106)];if(!_0x359a36[_0x22d723(0xa6)]&&_0x18831c>0x0){const _0x44531a=await confirmKey(_0x22d723(0xbd)+_0x18831c+'\x20changes?');if(!_0x44531a)return console[_0x22d723(0xc8)](_0x22d723(0x11a)),0x1;}const _0x52c60c={'withProgress':async(_0x1bc85c,_0x84673b)=>{const _0x19dcfe=_0x22d723,_0x2ee8ab=await withSpinner(_0x1bc85c,_0x84673b,{'verbose':_0x359a36[_0x19dcfe(0xa3)]});return{'data':_0x2ee8ab[_0x19dcfe(0x87)]};},'logInfo':_0x7231cd=>console[_0x22d723(0xc8)](a29_0x1bb08c[_0x22d723(0xf8)]('✔\x20'+_0x7231cd)),'logSuccess':_0x9d7bdc=>console['error'](a29_0x1bb08c[_0x22d723(0xbf)]('✔\x20'+_0x9d7bdc)),'logWarning':_0x25787b=>console[_0x22d723(0xc8)](a29_0x1bb08c['yellow']('⚠\x20'+_0x25787b)),'logDeleted':_0x681598=>console[_0x22d723(0xc8)](a29_0x1bb08c[_0x22d723(0x8c)]('✔\x20'+_0x681598))},_0x34948b={'segment':_0x552f9b[_0x22d723(0xea)],'journey':_0x552f9b[_0x22d723(0x109)],'user':_0x552f9b['user'],'connection':_0x552f9b[_0x22d723(0xeb)]};_0xf09887['length']>0x0&&(_0x36b6b3=await executePushFolders(_0x34948b,_0xf09887,_0x36b6b3,{'parentId':_0x352506},_0x52c60c));const _0x2e655d={'rootFolderId':_0x2cd532,'folderPathToId':_0x36b6b3,'folderIdToPath':_0x3cce08,'segmentNameToId':_0x8459e6,'activationsBySegmentId':_0x564065,'emailToIdMap':_0x24e70e,'idToEmailMap':_0x3c3d64,'connectionNameToIdMap':_0x3f3978[_0x22d723(0x93)],'connectionIdToNameMap':_0x3f3978[_0x22d723(0xa7)],'connectionNameToTypeMap':_0x3f6071},_0xbecc56=await executePushSegments(_0x34948b,_0x359a36[_0x22d723(0xe6)]?[]:_0x2741a1,_0x2e655d,{'parentId':_0x352506},_0x52c60c),_0x4c46e0=_0xbecc56[_0x22d723(0x100)],_0x4e35dc=_0xbecc56[_0x22d723(0xbb)],_0x5bbea8=_0xbecc56[_0x22d723(0xc1)][_0x22d723(0x100)],_0x2788d9=_0xbecc56[_0x22d723(0xc1)][_0x22d723(0xbb)],_0x14ac4b=_0xbecc56[_0x22d723(0xc1)][_0x22d723(0xd1)],_0x33583a=await executePushSegmentDeletions(_0x34948b,_0x359a36['journeysOnly']?[]:_0x29f518,_0x52c60c);let _0x364ced=0x0,_0x28f590=0x0,_0x4029de=0x0;const _0x5e7223=new Map(_0x8459e6);for(const [_0x44dbb6,_0x52ad45]of _0xbecc56[_0x22d723(0x101)]){_0x5e7223[_0x22d723(0xa2)](_0x44dbb6,_0x52ad45);}if(_0x5b3fa0['length']>0x0){const _0xcd370c={..._0x2e655d,'segmentNameToId':_0x5e7223,'existingSegments':_0xbd835b,'activationContext':_0x388e84},_0x4780df=await executePushJourneys(_0x34948b,_0x5b3fa0,_0xcd370c,{'parentId':_0x352506,'rootFolderId':_0x2cd532,'verbose':_0x359a36[_0x22d723(0xa3)]},_0x52c60c);_0x364ced=_0x4780df['created'],_0x28f590=_0x4780df['updated'];if(_0x5ba0fe&&_0x4780df[_0x22d723(0xf2)][_0x22d723(0x106)]===0x1){const _0x19f99e=_0x4780df[_0x22d723(0xf2)][0x0];if(_0x19f99e['journeyId']){const _0x3b69a3=getConsoleNextUrl(_0x359a36[_0x22d723(0xae)],_0x22d723(0xbc)+_0x352506+_0x22d723(0xfb)+_0x19f99e[_0x22d723(0x107)]+_0x22d723(0xdc));console[_0x22d723(0xc8)]('\x20\x20'+a29_0x1bb08c[_0x22d723(0x10c)](_0x3b69a3));}}}for(const _0x5134eb of _0x491338){console['error'](a29_0x1bb08c[_0x22d723(0x8e)](_0x22d723(0xca)+_0x5134eb[_0x22d723(0x9d)])),_0x4029de++;}const _0x1045d7=[];if(_0x4c46e0>0x0)_0x1045d7[_0x22d723(0xd3)](_0x4c46e0+_0x22d723(0x85));if(_0x4e35dc>0x0)_0x1045d7['push'](_0x4e35dc+_0x22d723(0xd8));if(_0x33583a>0x0)_0x1045d7[_0x22d723(0xd3)](_0x33583a+_0x22d723(0x8a));const _0x54351f=[];if(_0x364ced>0x0)_0x54351f[_0x22d723(0xd3)](_0x364ced+_0x22d723(0x85));if(_0x28f590>0x0)_0x54351f[_0x22d723(0xd3)](_0x28f590+_0x22d723(0xd8));if(_0x4029de>0x0)_0x54351f[_0x22d723(0xd3)](_0x4029de+_0x22d723(0x8a));const _0x3b3d9d=[];if(_0x5bbea8>0x0)_0x3b3d9d[_0x22d723(0xd3)](_0x5bbea8+_0x22d723(0x85));if(_0x2788d9>0x0)_0x3b3d9d['push'](_0x2788d9+_0x22d723(0xd8));if(_0x14ac4b>0x0)_0x3b3d9d[_0x22d723(0xd3)](_0x14ac4b+'\x20deleted');return console[_0x22d723(0xc8)](a29_0x1bb08c[_0x22d723(0xbf)]('\x0a✔\x20Push\x20complete')),_0x1045d7[_0x22d723(0x106)]>0x0&&!_0x359a36[_0x22d723(0xe6)]&&console[_0x22d723(0xc8)](_0x22d723(0xac)+_0x1045d7['join'](',\x20')),_0x54351f[_0x22d723(0x106)]>0x0&&console[_0x22d723(0xc8)](_0x22d723(0x116)+_0x54351f['join'](',\x20')),_0x3b3d9d[_0x22d723(0x106)]>0x0&&!_0x359a36[_0x22d723(0xe6)]&&console[_0x22d723(0xc8)](_0x22d723(0x105)+_0x3b3d9d[_0x22d723(0xcd)](',\x20')),0x0;}}
@@ -1 +1 @@
1
- const a30_0xdafc2a=a30_0x3e04;(function(_0x47a2df,_0xaba7e3){const _0x151c63=a30_0x3e04,_0x1df8a=_0x47a2df();while(!![]){try{const _0x46e279=parseInt(_0x151c63(0x13c))/0x1*(parseInt(_0x151c63(0x14a))/0x2)+-parseInt(_0x151c63(0x122))/0x3+-parseInt(_0x151c63(0x128))/0x4+-parseInt(_0x151c63(0x152))/0x5*(parseInt(_0x151c63(0x145))/0x6)+-parseInt(_0x151c63(0x137))/0x7*(-parseInt(_0x151c63(0x12e))/0x8)+parseInt(_0x151c63(0x146))/0x9*(-parseInt(_0x151c63(0x148))/0xa)+parseInt(_0x151c63(0x133))/0xb*(parseInt(_0x151c63(0x127))/0xc);if(_0x46e279===_0xaba7e3)break;else _0x1df8a['push'](_0x1df8a['shift']());}catch(_0x4c5d4a){_0x1df8a['push'](_0x1df8a['shift']());}}}(a30_0x238e,0xe4e74));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{SDKError,ErrorCode}from'../sdk/index.js';import a30_0x312428 from'chalk';function a30_0x238e(){const _0x15d51b=['Resolving\x20folder\x20\x27','kind','1312256lNhKFU','Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]','Resolved\x20relative\x20path\x20to:\x20','error','Parent\x20ID:\x20','228745yhTkrS','segment:update','verbose','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','7IphcZy','rule','segment','execute','segmentId','679223iwdKrU','resolvePathToResource','✔\x20Updated\x20segment\x20\x27','parentId','Examples:','Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]','Resolving\x20path\x20\x27','segmentPath','Resolved\x20folder\x20ID:\x20','12eYdfDW','549bbwYKm','.\x20Only\x20child\x20segments\x20can\x20be\x20updated.','55610HbiJym','updateSegmentById','4MIBhYq','yellow','length','\x20\x20\x20Path:\x20','Segment\x20ID:\x20','folder','ruleFile','type','432325DRBJPq','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','1180944TAtMPV','Updating\x20segment\x20\x27','Error:\x20Cannot\x20update\x20','resolveFolderId','name','1068yfuIQk','6119384tUPrZD','Resolved\x20type:\x20','\x27...','description'];a30_0x238e=function(){return _0x15d51b;};return a30_0x238e();}function a30_0x3e04(_0x5e5307,_0x50e513){_0x5e5307=_0x5e5307-0x121;const _0x238e62=a30_0x238e();let _0x3e04db=_0x238e62[_0x5e5307];return _0x3e04db;}export class SegmentUpdateCommand extends BaseCommand{[a30_0xdafc2a(0x126)]=a30_0xdafc2a(0x134);[a30_0xdafc2a(0x12b)]='Update\x20existing\x20child\x20segment';async[a30_0xdafc2a(0x13a)](_0x564cd2){const _0x74f605=a30_0xdafc2a;console[_0x74f605(0x131)](a30_0x312428['yellow']('⚠\x20Deprecation\x20warning:\x20`segment\x20update`\x20is\x20deprecated.')),console[_0x74f605(0x131)](a30_0x312428[_0x74f605(0x14b)](_0x74f605(0x121)));const {options:_0x40e4bb,args:_0xbab58a,tdx:_0x3f5901}=_0x564cd2,_0x1dd898=_0x40e4bb;if(_0xbab58a[_0x74f605(0x14c)]===0x0)return console[_0x74f605(0x131)](_0x74f605(0x136)),console[_0x74f605(0x131)](_0x74f605(0x12f)),console['error'](_0x74f605(0x140)),console[_0x74f605(0x131)]('\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22'),console['error']('\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context'),0x1;const _0x3e20e4=_0xbab58a[0x0],_0x1d7d6f=_0x40e4bb[_0x74f605(0x143)];let _0x902b6e=_0x3e20e4;_0x1d7d6f&&!_0x3e20e4['includes']('/')&&(_0x902b6e=_0x1d7d6f+'/'+_0x3e20e4,_0x1dd898[_0x74f605(0x135)]&&console['error'](_0x74f605(0x130)+_0x902b6e));const _0x59545c=await withSpinner(_0x74f605(0x142)+_0x902b6e+_0x74f605(0x12a),()=>_0x3f5901['segment'][_0x74f605(0x13d)](_0x902b6e),{'verbose':_0x1dd898[_0x74f605(0x135)]}),_0x2e6381=_0x59545c['data'];_0x1dd898[_0x74f605(0x135)]&&console[_0x74f605(0x131)](_0x74f605(0x129)+_0x2e6381['type']);if(_0x2e6381[_0x74f605(0x151)]!=='segment')return console[_0x74f605(0x131)](_0x74f605(0x124)+_0x2e6381['type']+_0x74f605(0x147)),console['error'](_0x74f605(0x141)),0x1;if(!_0x2e6381['segmentId'])throw new SDKError(ErrorCode['INTERNAL'],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x30cd70=_0x2e6381[_0x74f605(0x13f)],_0x1d8d97=_0x2e6381[_0x74f605(0x13b)];_0x1dd898[_0x74f605(0x135)]&&(console[_0x74f605(0x131)](_0x74f605(0x132)+_0x30cd70),console[_0x74f605(0x131)](_0x74f605(0x14e)+_0x1d8d97));let _0x568d03;if(_0x1dd898['folder']){const _0x2d7fd0=_0x1dd898[_0x74f605(0x14f)],_0xbfa751=await withSpinner(_0x74f605(0x12c)+_0x2d7fd0+_0x74f605(0x12a),()=>_0x3f5901['segment'][_0x74f605(0x125)](_0x30cd70,_0x2d7fd0),{'verbose':_0x1dd898['verbose']});_0x568d03=parseInt(_0xbfa751['data'],0xa),_0x1dd898[_0x74f605(0x135)]&&console['error'](_0x74f605(0x144)+_0x568d03);}const _0x6692a8=await loadJSONFromOptions(_0x1dd898[_0x74f605(0x138)],_0x1dd898[_0x74f605(0x150)]),_0x5b8fb0={'name':_0x1dd898['name'],'description':_0x1dd898['description'],'rule':_0x6692a8,'kind':_0x1dd898['kind']!==undefined?parseInt(_0x1dd898[_0x74f605(0x12d)],0xa):undefined,'segmentFolderId':_0x568d03},_0xcd318a=await withSpinner(_0x74f605(0x123)+_0x2e6381['segmentName']+'\x27...',()=>_0x3f5901[_0x74f605(0x139)][_0x74f605(0x149)](_0x30cd70,_0x1d8d97,_0x5b8fb0),{'verbose':_0x1dd898[_0x74f605(0x135)]}),_0x51648a=_0xcd318a['data'];return console['error'](_0x74f605(0x13e)+_0x51648a[_0x74f605(0x126)]+'\x27'),_0x902b6e!==_0x3e20e4&&console[_0x74f605(0x131)](_0x74f605(0x14d)+_0x902b6e),await handleSDKOutput([_0x51648a],_0x1dd898),0x0;}}
1
+ const a30_0x5a94e1=a30_0xd48d;(function(_0x36f338,_0x318950){const _0x25919a=a30_0xd48d,_0x2e5d44=_0x36f338();while(!![]){try{const _0x83fb46=parseInt(_0x25919a(0x138))/0x1+-parseInt(_0x25919a(0x120))/0x2*(parseInt(_0x25919a(0x13d))/0x3)+-parseInt(_0x25919a(0x13c))/0x4*(-parseInt(_0x25919a(0x130))/0x5)+parseInt(_0x25919a(0x12c))/0x6+parseInt(_0x25919a(0x14f))/0x7*(-parseInt(_0x25919a(0x147))/0x8)+-parseInt(_0x25919a(0x13f))/0x9+-parseInt(_0x25919a(0x121))/0xa*(-parseInt(_0x25919a(0x132))/0xb);if(_0x83fb46===_0x318950)break;else _0x2e5d44['push'](_0x2e5d44['shift']());}catch(_0x4adb05){_0x2e5d44['push'](_0x2e5d44['shift']());}}}(a30_0x3bae,0x728e5));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';function a30_0x3bae(){const _0x2ef01a=['20PoBzuB','\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','ruleFile','name','Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]','segment:update','folder','\x27...','Resolved\x20folder\x20ID:\x20','error','includes','2237964CgtDiG','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','Segment\x20ID\x20missing\x20from\x20resolved\x20path','\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22','1616375zdRPMi','Parent\x20ID:\x20','79574tHBMdR','description','yellow','INTERNAL','Resolving\x20path\x20\x27','segmentId','794959eFeAem','resolvePathToResource','rule','Examples:','4QPTfsM','20103dJDYzM','data','2157345roZCwh','Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]','Resolved\x20relative\x20path\x20to:\x20','verbose','Error:\x20Cannot\x20update\x20','type','Segment\x20ID:\x20','parentId','1298696YBSMkg','kind','.\x20Only\x20child\x20segments\x20can\x20be\x20updated.','segmentPath','execute','segment','✔\x20Updated\x20segment\x20\x27','Resolved\x20type:\x20','28mLnECR','44autOCi'];a30_0x3bae=function(){return _0x2ef01a;};return a30_0x3bae();}function a30_0xd48d(_0x1b32af,_0x5966c9){_0x1b32af=_0x1b32af-0x120;const _0x3bae5a=a30_0x3bae();let _0xd48d7d=_0x3bae5a[_0x1b32af];return _0xd48d7d;}import{loadJSONFromOptions}from'../utils/json-loader.js';import{SDKError,ErrorCode}from'../sdk/index.js';import a30_0x435a62 from'chalk';export class SegmentUpdateCommand extends BaseCommand{[a30_0x5a94e1(0x124)]=a30_0x5a94e1(0x126);[a30_0x5a94e1(0x133)]='Update\x20existing\x20child\x20segment';async[a30_0x5a94e1(0x14b)](_0x2c6aeb){const _0x1f79b0=a30_0x5a94e1;console[_0x1f79b0(0x12a)](a30_0x435a62[_0x1f79b0(0x134)]('⚠\x20Deprecation\x20warning:\x20`segment\x20update`\x20is\x20deprecated.')),console['error'](a30_0x435a62[_0x1f79b0(0x134)]('\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a'));const {options:_0x4091a5,args:_0x506447,tdx:_0x21a888}=_0x2c6aeb,_0x1c761e=_0x4091a5;if(_0x506447['length']===0x0)return console[_0x1f79b0(0x12a)](_0x1f79b0(0x12d)),console[_0x1f79b0(0x12a)](_0x1f79b0(0x140)),console[_0x1f79b0(0x12a)](_0x1f79b0(0x13b)),console[_0x1f79b0(0x12a)](_0x1f79b0(0x12f)),console[_0x1f79b0(0x12a)](_0x1f79b0(0x122)),0x1;const _0x14bf32=_0x506447[0x0],_0x48a6ad=_0x4091a5[_0x1f79b0(0x14a)];let _0x5ce0b1=_0x14bf32;_0x48a6ad&&!_0x14bf32[_0x1f79b0(0x12b)]('/')&&(_0x5ce0b1=_0x48a6ad+'/'+_0x14bf32,_0x1c761e['verbose']&&console['error'](_0x1f79b0(0x141)+_0x5ce0b1));const _0x4705bd=await withSpinner(_0x1f79b0(0x136)+_0x5ce0b1+_0x1f79b0(0x128),()=>_0x21a888[_0x1f79b0(0x14c)][_0x1f79b0(0x139)](_0x5ce0b1),{'verbose':_0x1c761e['verbose']}),_0x3f0075=_0x4705bd[_0x1f79b0(0x13e)];_0x1c761e[_0x1f79b0(0x142)]&&console[_0x1f79b0(0x12a)](_0x1f79b0(0x14e)+_0x3f0075[_0x1f79b0(0x144)]);if(_0x3f0075[_0x1f79b0(0x144)]!==_0x1f79b0(0x14c))return console[_0x1f79b0(0x12a)](_0x1f79b0(0x143)+_0x3f0075[_0x1f79b0(0x144)]+_0x1f79b0(0x149)),console[_0x1f79b0(0x12a)](_0x1f79b0(0x125)),0x1;if(!_0x3f0075['segmentId'])throw new SDKError(ErrorCode[_0x1f79b0(0x135)],_0x1f79b0(0x12e));const _0x2ea318=_0x3f0075[_0x1f79b0(0x146)],_0x57d978=_0x3f0075[_0x1f79b0(0x137)];_0x1c761e['verbose']&&(console[_0x1f79b0(0x12a)](_0x1f79b0(0x131)+_0x2ea318),console[_0x1f79b0(0x12a)](_0x1f79b0(0x145)+_0x57d978));let _0x210bfb;if(_0x1c761e[_0x1f79b0(0x127)]){const _0x1de917=_0x1c761e['folder'],_0x3f7191=await withSpinner('Resolving\x20folder\x20\x27'+_0x1de917+'\x27...',()=>_0x21a888[_0x1f79b0(0x14c)]['resolveFolderId'](_0x2ea318,_0x1de917),{'verbose':_0x1c761e['verbose']});_0x210bfb=parseInt(_0x3f7191['data'],0xa),_0x1c761e['verbose']&&console[_0x1f79b0(0x12a)](_0x1f79b0(0x129)+_0x210bfb);}const _0x1a5839=await loadJSONFromOptions(_0x1c761e[_0x1f79b0(0x13a)],_0x1c761e[_0x1f79b0(0x123)]),_0x4f8547={'name':_0x1c761e[_0x1f79b0(0x124)],'description':_0x1c761e[_0x1f79b0(0x133)],'rule':_0x1a5839,'kind':_0x1c761e[_0x1f79b0(0x148)]!==undefined?parseInt(_0x1c761e[_0x1f79b0(0x148)],0xa):undefined,'segmentFolderId':_0x210bfb},_0x14ab46=await withSpinner('Updating\x20segment\x20\x27'+_0x3f0075['segmentName']+_0x1f79b0(0x128),()=>_0x21a888[_0x1f79b0(0x14c)]['updateSegmentById'](_0x2ea318,_0x57d978,_0x4f8547),{'verbose':_0x1c761e[_0x1f79b0(0x142)]}),_0x44efdb=_0x14ab46[_0x1f79b0(0x13e)];return console[_0x1f79b0(0x12a)](_0x1f79b0(0x14d)+_0x44efdb[_0x1f79b0(0x124)]+'\x27'),_0x5ce0b1!==_0x14bf32&&console[_0x1f79b0(0x12a)]('\x20\x20\x20Path:\x20'+_0x5ce0b1),await handleSDKOutput([_0x44efdb],_0x1c761e),0x0;}}
@@ -1 +1 @@
1
- const a31_0x1f8d2f=a31_0x184d;(function(_0x5c43e6,_0xe55e10){const _0x133afc=a31_0x184d,_0x8e9e=_0x5c43e6();while(!![]){try{const _0x378326=-parseInt(_0x133afc(0xd4))/0x1*(-parseInt(_0x133afc(0xc4))/0x2)+-parseInt(_0x133afc(0xea))/0x3*(-parseInt(_0x133afc(0xf4))/0x4)+-parseInt(_0x133afc(0xcb))/0x5+parseInt(_0x133afc(0xd2))/0x6*(-parseInt(_0x133afc(0xf2))/0x7)+parseInt(_0x133afc(0xd7))/0x8*(parseInt(_0x133afc(0xc3))/0x9)+-parseInt(_0x133afc(0xd0))/0xa+parseInt(_0x133afc(0xcd))/0xb;if(_0x378326===_0xe55e10)break;else _0x8e9e['push'](_0x8e9e['shift']());}catch(_0x3b6f7b){_0x8e9e['push'](_0x8e9e['shift']());}}}(a31_0x1963,0x849bf));function a31_0x184d(_0x15c7d7,_0x79724d){_0x15c7d7=_0x15c7d7-0xc1;const _0x1963e5=a31_0x1963();let _0x184d3f=_0x1963e5[_0x15c7d7];return _0x184d3f;}import{existsSync,statSync}from'fs';import a31_0x277721 from'chalk';function a31_0x1963(){const _0x5b756a=['error','Use:\x20tdx\x20segment\x20use\x20','segmentPath','Parent\x20ID:\x20','\x27...','Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.','171jvBGFa','green','cyan','✔\x20Context\x20cleared.\x20Back\x20to\x20root.','session','name','Set\x20current\x20segment/folder\x20context\x20for\x20navigation','Usage:\x20tdx\x20segment\x20use\x20<path>','17437MpDwKb','\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent','58132aYADnj','Resolved\x20relative\x20path\x20to:\x20','Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>','description','Site:\x20','join','segment:use','type','Examples:','parentName','fullPath','14913PsweOh','18128TBqhMn','red','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22','length','folderPath','Use\x20\x22tdx\x20use\x22\x20to\x20see\x20all\x20context\x20parameters','2945720oxdquW','Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context','9059347RONUxt','Folder\x20ID:\x20','folderId','8995460wSLwUu','verbose','1830RRdqAg','dim','91QkmdcI','log','Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.','1520FlEPXP','✔\x20Context\x20set\x20to:\x20','data','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','execute','resolvePathToResource','slice','isDirectory','isAbsolute','segment','segments','\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context','parentId'];a31_0x1963=function(){return _0x5b756a;};return a31_0x1963();}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{[a31_0x1f8d2f(0xef)]=a31_0x1f8d2f(0xfb);[a31_0x1f8d2f(0xf8)]=a31_0x1f8d2f(0xf0);async[a31_0x1f8d2f(0xdb)](_0xffd8b4){const _0x2a83df=a31_0x1f8d2f,{options:_0x58714e,args:_0x2f380b,tdx:_0x557497}=_0xffd8b4;if(_0x2f380b['length']===0x0)return console[_0x2a83df(0xe4)](a31_0x277721[_0x2a83df(0xc5)]('Error:\x20Path\x20is\x20required\x0a')),console['error'](_0x2a83df(0xf1)),console[_0x2a83df(0xe4)](_0x2a83df(0xfd)),console[_0x2a83df(0xe4)](_0x2a83df(0xc6)),console[_0x2a83df(0xe4)](_0x2a83df(0xc7)),console[_0x2a83df(0xe4)](_0x2a83df(0xe2)),console[_0x2a83df(0xe4)](_0x2a83df(0xf3)),0x1;const _0x50ea3a=_0x2f380b[0x0],_0x8778fc=_0x58714e[_0x2a83df(0xee)];try{if(_0x50ea3a==='/')return saveSessionContext({'segment_path':undefined},_0x8778fc),console[_0x2a83df(0xd5)](a31_0x277721[_0x2a83df(0xeb)](_0x2a83df(0xed))),0x0;if(existsSync(_0x50ea3a)&&statSync(_0x50ea3a)[_0x2a83df(0xde)]()){let _0x192d23;try{_0x192d23=findTdxConfig(_0x50ea3a);}catch{return console[_0x2a83df(0xe4)](a31_0x277721['red'](_0x2a83df(0xf6)+_0x50ea3a)),console[_0x2a83df(0xe4)](a31_0x277721[_0x2a83df(0xec)](_0x2a83df(0xda))),0x1;}const _0x54394e=_0x192d23['config']['parent_segment'];return saveSessionContext({'segment_path':_0x54394e,'parent_segment':_0x54394e},_0x8778fc),console[_0x2a83df(0xd5)](a31_0x277721['green']('✔\x20Context\x20set\x20to:\x20'+a31_0x277721[_0x2a83df(0xec)](_0x54394e))),0x0;}const _0x30444d=_0x58714e[_0x2a83df(0xe6)];let _0x5afd7b=_0x50ea3a;const _0x4bbae1=parsePath(_0x50ea3a);if(!_0x4bbae1[_0x2a83df(0xdf)]){if(!_0x30444d)return console[_0x2a83df(0xe4)](a31_0x277721[_0x2a83df(0xc5)](_0x2a83df(0xd6))),console[_0x2a83df(0xe4)](a31_0x277721[_0x2a83df(0xec)](_0x2a83df(0xf7))),0x1;if(_0x50ea3a==='..'){const _0x1826a1=_0x30444d['split']('/')[_0x2a83df(0xdd)](0x0,-0x1)[_0x2a83df(0xfa)]('/');_0x5afd7b=_0x1826a1||'/';}else _0x50ea3a==='.'?_0x5afd7b=_0x30444d:_0x5afd7b=_0x30444d+'/'+_0x50ea3a;_0x58714e[_0x2a83df(0xd1)]&&console['error'](_0x2a83df(0xf5)+_0x5afd7b);}if(_0x5afd7b==='/'||_0x5afd7b==='')return saveSessionContext({'segment_path':undefined},_0x8778fc),console['log'](a31_0x277721[_0x2a83df(0xeb)](_0x2a83df(0xed))),0x0;_0x5afd7b=normalizePath(_0x5afd7b);const _0x137e45=parsePath(_0x5afd7b)[_0x2a83df(0xe1)];if(_0x137e45[_0x2a83df(0xc8)]===0x0)return saveSessionContext({'segment_path':undefined},_0x8778fc),console[_0x2a83df(0xd5)](a31_0x277721[_0x2a83df(0xeb)](_0x2a83df(0xed))),0x0;_0x58714e[_0x2a83df(0xd1)]&&(console[_0x2a83df(0xe4)](_0x2a83df(0xf9)+_0x58714e['site']),console[_0x2a83df(0xe4)]('Target\x20path:\x20'+_0x5afd7b));const _0x1cfa0b=await withSpinner('Resolving\x20path\x20\x27'+_0x5afd7b+_0x2a83df(0xe8),()=>_0x557497[_0x2a83df(0xe0)][_0x2a83df(0xdc)](_0x5afd7b),{'verbose':_0x58714e['verbose']}),_0x12abff=_0x1cfa0b[_0x2a83df(0xd9)];_0x58714e[_0x2a83df(0xd1)]&&(console[_0x2a83df(0xe4)]('Resolved\x20path\x20type:\x20'+_0x12abff[_0x2a83df(0xfc)]),console['error'](_0x2a83df(0xe7)+_0x12abff[_0x2a83df(0xe3)]),_0x12abff[_0x2a83df(0xcf)]&&console[_0x2a83df(0xe4)](_0x2a83df(0xce)+_0x12abff[_0x2a83df(0xcf)]));if(_0x12abff[_0x2a83df(0xfc)]===_0x2a83df(0xe0))return console[_0x2a83df(0xe4)](a31_0x277721[_0x2a83df(0xc5)](_0x2a83df(0xe9))),console[_0x2a83df(0xe4)]('Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.'),console[_0x2a83df(0xe4)](a31_0x277721[_0x2a83df(0xec)](_0x2a83df(0xe5)+_0x12abff['parentName']+(_0x12abff[_0x2a83df(0xc9)]?'/'+_0x12abff[_0x2a83df(0xc9)][_0x2a83df(0xfa)]('/'):''))),0x1;return saveSessionContext({'segment_path':_0x12abff[_0x2a83df(0xc2)],'parent_segment':_0x12abff[_0x2a83df(0xc1)]},_0x8778fc),console[_0x2a83df(0xd5)](a31_0x277721['green'](_0x2a83df(0xd8)+a31_0x277721[_0x2a83df(0xec)](_0x12abff[_0x2a83df(0xc2)]))),_0x58714e[_0x2a83df(0xd1)]&&(console[_0x2a83df(0xe4)](a31_0x277721[_0x2a83df(0xd3)](_0x2a83df(0xcc))),console[_0x2a83df(0xe4)](a31_0x277721[_0x2a83df(0xd3)](_0x2a83df(0xca)))),0x0;}catch(_0x5374c0){throw _0x5374c0;}}}
1
+ const a31_0x1f5fb9=a31_0x3fd7;(function(_0x4e5010,_0x548795){const _0x266c5d=a31_0x3fd7,_0x14a78e=_0x4e5010();while(!![]){try{const _0x4c869b=parseInt(_0x266c5d(0xfc))/0x1*(-parseInt(_0x266c5d(0xe3))/0x2)+parseInt(_0x266c5d(0x114))/0x3*(parseInt(_0x266c5d(0xf4))/0x4)+parseInt(_0x266c5d(0xeb))/0x5+parseInt(_0x266c5d(0x10c))/0x6+parseInt(_0x266c5d(0x107))/0x7*(-parseInt(_0x266c5d(0xe1))/0x8)+-parseInt(_0x266c5d(0x100))/0x9+parseInt(_0x266c5d(0xed))/0xa;if(_0x4c869b===_0x548795)break;else _0x14a78e['push'](_0x14a78e['shift']());}catch(_0x59a60c){_0x14a78e['push'](_0x14a78e['shift']());}}}(a31_0x149b,0xd825f));import{existsSync,statSync}from'fs';import a31_0x3173de from'chalk';function a31_0x3fd7(_0x38cb83,_0x57ba94){_0x38cb83=_0x38cb83-0xe1;const _0x149bb7=a31_0x149b();let _0x3fd70d=_0x149bb7[_0x38cb83];return _0x3fd70d;}import{BaseCommand}from'./command.js';function a31_0x149b(){const _0x2af5c3=['parentName','description','error','Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','log','3OOOBid','segment:use','Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context','Resolved\x20path\x20type:\x20','session','Error:\x20Path\x20is\x20required\x0a','folderPath','434384QNTGvg','Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>','350908HBPAVw','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22','isDirectory','verbose','fullPath','Set\x20current\x20segment/folder\x20context\x20for\x20navigation','cyan','Resolving\x20path\x20\x27','7287120dMlCDW','\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context','10964020SmmQdc','data','Use\x20\x22tdx\x20use\x22\x20to\x20see\x20all\x20context\x20parameters','\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent','Examples:','isAbsolute','red','2647736wIseOk','resolvePathToResource','dim','type','segments','Resolved\x20relative\x20path\x20to:\x20','\x27...','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22','8VbzCpa','length','green','config','12413808GPMxGo','✔\x20Context\x20set\x20to:\x20','segment','site','folderId','segmentPath','✔\x20Context\x20cleared.\x20Back\x20to\x20root.','147myslQR','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.','parent_segment','Target\x20path:\x20','9556710JKHKVh','execute','Use:\x20tdx\x20segment\x20use\x20'];a31_0x149b=function(){return _0x2af5c3;};return a31_0x149b();}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{['name']=a31_0x1f5fb9(0x115);[a31_0x1f5fb9(0x110)]=a31_0x1f5fb9(0xe8);async[a31_0x1f5fb9(0x10d)](_0x27369e){const _0xd295a4=a31_0x1f5fb9,{options:_0x1813bb,args:_0x2f3941,tdx:_0x4803c4}=_0x27369e;if(_0x2f3941[_0xd295a4(0xfd)]===0x0)return console['error'](a31_0x3173de[_0xd295a4(0xf3)](_0xd295a4(0x119))),console['error']('Usage:\x20tdx\x20segment\x20use\x20<path>'),console['error'](_0xd295a4(0xf1)),console[_0xd295a4(0x111)](_0xd295a4(0xe4)),console[_0xd295a4(0x111)](_0xd295a4(0xfb)),console[_0xd295a4(0x111)](_0xd295a4(0xec)),console['error'](_0xd295a4(0xf0)),0x1;const _0x2756fe=_0x2f3941[0x0],_0x2611fb=_0x1813bb[_0xd295a4(0x118)];try{if(_0x2756fe==='/')return saveSessionContext({'segment_path':undefined},_0x2611fb),console[_0xd295a4(0x113)](a31_0x3173de['green'](_0xd295a4(0x106))),0x0;if(existsSync(_0x2756fe)&&statSync(_0x2756fe)[_0xd295a4(0xe5)]()){let _0x40d008;try{_0x40d008=findTdxConfig(_0x2756fe);}catch{return console['error'](a31_0x3173de[_0xd295a4(0xf3)](_0xd295a4(0x112)+_0x2756fe)),console[_0xd295a4(0x111)](a31_0x3173de[_0xd295a4(0xe9)](_0xd295a4(0x108))),0x1;}const _0x1c2338=_0x40d008[_0xd295a4(0xff)][_0xd295a4(0x10a)];return saveSessionContext({'segment_path':_0x1c2338,'parent_segment':_0x1c2338},_0x2611fb),console[_0xd295a4(0x113)](a31_0x3173de[_0xd295a4(0xfe)]('✔\x20Context\x20set\x20to:\x20'+a31_0x3173de['cyan'](_0x1c2338))),0x0;}const _0x43be0b=_0x1813bb[_0xd295a4(0x105)];let _0x4ab791=_0x2756fe;const _0x5ae3e8=parsePath(_0x2756fe);if(!_0x5ae3e8[_0xd295a4(0xf2)]){if(!_0x43be0b)return console[_0xd295a4(0x111)](a31_0x3173de[_0xd295a4(0xf3)]('Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.')),console[_0xd295a4(0x111)](a31_0x3173de[_0xd295a4(0xe9)](_0xd295a4(0xe2))),0x1;if(_0x2756fe==='..'){const _0x4f194f=_0x43be0b['split']('/')['slice'](0x0,-0x1)['join']('/');_0x4ab791=_0x4f194f||'/';}else _0x2756fe==='.'?_0x4ab791=_0x43be0b:_0x4ab791=_0x43be0b+'/'+_0x2756fe;_0x1813bb['verbose']&&console['error'](_0xd295a4(0xf9)+_0x4ab791);}if(_0x4ab791==='/'||_0x4ab791==='')return saveSessionContext({'segment_path':undefined},_0x2611fb),console[_0xd295a4(0x113)](a31_0x3173de[_0xd295a4(0xfe)](_0xd295a4(0x106))),0x0;_0x4ab791=normalizePath(_0x4ab791);const _0x28d6e8=parsePath(_0x4ab791)[_0xd295a4(0xf8)];if(_0x28d6e8['length']===0x0)return saveSessionContext({'segment_path':undefined},_0x2611fb),console[_0xd295a4(0x113)](a31_0x3173de[_0xd295a4(0xfe)](_0xd295a4(0x106))),0x0;_0x1813bb[_0xd295a4(0xe6)]&&(console[_0xd295a4(0x111)]('Site:\x20'+_0x1813bb[_0xd295a4(0x103)]),console[_0xd295a4(0x111)](_0xd295a4(0x10b)+_0x4ab791));const _0x28fcea=await withSpinner(_0xd295a4(0xea)+_0x4ab791+_0xd295a4(0xfa),()=>_0x4803c4['segment'][_0xd295a4(0xf5)](_0x4ab791),{'verbose':_0x1813bb[_0xd295a4(0xe6)]}),_0x329120=_0x28fcea[_0xd295a4(0xee)];_0x1813bb['verbose']&&(console[_0xd295a4(0x111)](_0xd295a4(0x117)+_0x329120['type']),console['error']('Parent\x20ID:\x20'+_0x329120['parentId']),_0x329120[_0xd295a4(0x104)]&&console[_0xd295a4(0x111)]('Folder\x20ID:\x20'+_0x329120[_0xd295a4(0x104)]));if(_0x329120[_0xd295a4(0xf7)]===_0xd295a4(0x102))return console[_0xd295a4(0x111)](a31_0x3173de[_0xd295a4(0xf3)]('Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.')),console[_0xd295a4(0x111)](_0xd295a4(0x109)),console['error'](a31_0x3173de[_0xd295a4(0xe9)](_0xd295a4(0x10e)+_0x329120[_0xd295a4(0x10f)]+(_0x329120[_0xd295a4(0x11a)]?'/'+_0x329120[_0xd295a4(0x11a)]['join']('/'):''))),0x1;return saveSessionContext({'segment_path':_0x329120[_0xd295a4(0xe7)],'parent_segment':_0x329120[_0xd295a4(0x10f)]},_0x2611fb),console[_0xd295a4(0x113)](a31_0x3173de[_0xd295a4(0xfe)](_0xd295a4(0x101)+a31_0x3173de['cyan'](_0x329120[_0xd295a4(0xe7)]))),_0x1813bb[_0xd295a4(0xe6)]&&(console[_0xd295a4(0x111)](a31_0x3173de[_0xd295a4(0xf6)](_0xd295a4(0x116))),console[_0xd295a4(0x111)](a31_0x3173de['dim'](_0xd295a4(0xef)))),0x0;}catch(_0x4bea66){throw _0x4bea66;}}}