@treasuredata/tdx 0.20.0 β†’ 0.20.1

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 (197) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.d.ts.map +1 -1
  5. package/dist/cli.js +1 -1
  6. package/dist/cli.js.map +1 -1
  7. package/dist/commands/activations.js +1 -1
  8. package/dist/commands/agent-command.js +1 -1
  9. package/dist/commands/agent-test-command.js +1 -1
  10. package/dist/commands/api-command.js +1 -1
  11. package/dist/commands/auth-command.js +1 -1
  12. package/dist/commands/chat-command.js +1 -1
  13. package/dist/commands/claude-command.d.ts +9 -0
  14. package/dist/commands/claude-command.d.ts.map +1 -1
  15. package/dist/commands/claude-command.js +1 -1
  16. package/dist/commands/claude-command.js.map +1 -1
  17. package/dist/commands/claude-statusline-command.js +1 -1
  18. package/dist/commands/claude-usage-command.js +1 -1
  19. package/dist/commands/command.js +1 -1
  20. package/dist/commands/connection-command.js +1 -1
  21. package/dist/commands/databases.js +1 -1
  22. package/dist/commands/describe.js +1 -1
  23. package/dist/commands/engage-command.js +1 -1
  24. package/dist/commands/job-command.js +1 -1
  25. package/dist/commands/journey-command.js +1 -1
  26. package/dist/commands/journey-validate-command.js +1 -1
  27. package/dist/commands/llm-command.d.ts +12 -0
  28. package/dist/commands/llm-command.d.ts.map +1 -1
  29. package/dist/commands/llm-command.js +1 -1
  30. package/dist/commands/llm-command.js.map +1 -1
  31. package/dist/commands/llm-proxy.js +1 -1
  32. package/dist/commands/mcp-command.js +1 -1
  33. package/dist/commands/parent-segment-command.js +1 -1
  34. package/dist/commands/profile-command.js +1 -1
  35. package/dist/commands/profiles-command.js +1 -1
  36. package/dist/commands/query-command.js +1 -1
  37. package/dist/commands/schedule-command.js +1 -1
  38. package/dist/commands/segment-command.js +1 -1
  39. package/dist/commands/segment-create-command.js +1 -1
  40. package/dist/commands/segment-fields-command.js +1 -1
  41. package/dist/commands/segment-pull-command.js +1 -1
  42. package/dist/commands/segment-push-command.js +1 -1
  43. package/dist/commands/segment-update-command.js +1 -1
  44. package/dist/commands/segment-use-command.js +1 -1
  45. package/dist/commands/segment-validate-command.js +1 -1
  46. package/dist/commands/segments.js +1 -1
  47. package/dist/commands/show.js +1 -1
  48. package/dist/commands/status-command.js +1 -1
  49. package/dist/commands/tables.js +1 -1
  50. package/dist/commands/unset-command.js +1 -1
  51. package/dist/commands/use-command.js +1 -1
  52. package/dist/commands/user-command.js +1 -1
  53. package/dist/commands/workflow-command.js +1 -1
  54. package/dist/core/auth.js +1 -1
  55. package/dist/core/command-output.js +1 -1
  56. package/dist/core/config.d.ts +5 -0
  57. package/dist/core/config.d.ts.map +1 -1
  58. package/dist/core/config.js +1 -1
  59. package/dist/core/config.js.map +1 -1
  60. package/dist/core/connection-cache.js +1 -1
  61. package/dist/core/constants.js +1 -1
  62. package/dist/core/credential-cache.js +1 -1
  63. package/dist/core/global-context.js +1 -1
  64. package/dist/core/keychain.js +1 -1
  65. package/dist/core/profile.js +1 -1
  66. package/dist/core/project-config.js +1 -1
  67. package/dist/core/session.js +1 -1
  68. package/dist/core/user-cache.js +1 -1
  69. package/dist/core/version.js +1 -1
  70. package/dist/index.js +1 -1
  71. package/dist/mcp/server.js +1 -1
  72. package/dist/mcp/tools/index.js +1 -1
  73. package/dist/mcp/tools/tdx-run.js +1 -1
  74. package/dist/mcp/tools/tdx-search.js +1 -1
  75. package/dist/mcp/utils.js +1 -1
  76. package/dist/proxy/anthropic-adapter.js +1 -1
  77. package/dist/proxy/claude-usage-tracker.js +1 -1
  78. package/dist/proxy/context-signature.js +1 -1
  79. package/dist/proxy/conversation-utils.js +1 -1
  80. package/dist/proxy/passthrough-server.d.ts.map +1 -1
  81. package/dist/proxy/passthrough-server.js +1 -1
  82. package/dist/proxy/passthrough-server.js.map +1 -1
  83. package/dist/proxy/server.js +1 -1
  84. package/dist/proxy/session-cache.js +1 -1
  85. package/dist/proxy/sse-usage-parser.js +1 -1
  86. package/dist/sdk/agent/agent-config.js +1 -1
  87. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  88. package/dist/sdk/agent/agent-yaml.js +1 -1
  89. package/dist/sdk/agent/test/evaluator.js +1 -1
  90. package/dist/sdk/agent/test/executor.js +1 -1
  91. package/dist/sdk/agent/test/index.js +1 -1
  92. package/dist/sdk/agent/test/output.js +1 -1
  93. package/dist/sdk/agent/test/parser.js +1 -1
  94. package/dist/sdk/api.js +1 -1
  95. package/dist/sdk/client/cdp-api-client.js +1 -1
  96. package/dist/sdk/client/endpoints.js +1 -1
  97. package/dist/sdk/client/engage-api-client.js +1 -1
  98. package/dist/sdk/client/http-client.js +1 -1
  99. package/dist/sdk/client/llm-api-client.d.ts +7 -1
  100. package/dist/sdk/client/llm-api-client.d.ts.map +1 -1
  101. package/dist/sdk/client/llm-api-client.js +1 -1
  102. package/dist/sdk/client/llm-api-client.js.map +1 -1
  103. package/dist/sdk/client/rate-limiter.js +1 -1
  104. package/dist/sdk/client/td-api-client.js +1 -1
  105. package/dist/sdk/client/trino-api-client.js +1 -1
  106. package/dist/sdk/client/workflow-client.js +1 -1
  107. package/dist/sdk/connection-validator.js +1 -1
  108. package/dist/sdk/connection.js +1 -1
  109. package/dist/sdk/engage.js +1 -1
  110. package/dist/sdk/errors.js +1 -1
  111. package/dist/sdk/index.js +1 -1
  112. package/dist/sdk/index.js.map +1 -1
  113. package/dist/sdk/io/index.js +1 -1
  114. package/dist/sdk/io/node-filesystem.js +1 -1
  115. package/dist/sdk/job.js +1 -1
  116. package/dist/sdk/journey.js +1 -1
  117. package/dist/sdk/llm/chat-cache.js +1 -1
  118. package/dist/sdk/llm/index.d.ts +15 -1
  119. package/dist/sdk/llm/index.d.ts.map +1 -1
  120. package/dist/sdk/llm/index.js +1 -1
  121. package/dist/sdk/llm/index.js.map +1 -1
  122. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  123. package/dist/sdk/llm/model-aliases.js +1 -1
  124. package/dist/sdk/llm/model-factors.js +1 -1
  125. package/dist/sdk/query/index.js +1 -1
  126. package/dist/sdk/query/sql-parser.js +1 -1
  127. package/dist/sdk/schedule.js +1 -1
  128. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  129. package/dist/sdk/segment/fields-display.js +1 -1
  130. package/dist/sdk/segment/file-discovery.js +1 -1
  131. package/dist/sdk/segment/journey-utils.js +1 -1
  132. package/dist/sdk/segment/journey-yaml.js +1 -1
  133. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  134. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  135. package/dist/sdk/segment/pull-workflow.js +1 -1
  136. package/dist/sdk/segment/push-workflow.js +1 -1
  137. package/dist/sdk/segment/resolution-context.js +1 -1
  138. package/dist/sdk/segment/segment-path-parser.js +1 -1
  139. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  140. package/dist/sdk/segment/target-resolution.js +1 -1
  141. package/dist/sdk/segment/tdx-config.js +1 -1
  142. package/dist/sdk/segment/validate-files.js +1 -1
  143. package/dist/sdk/segment/yaml-validator.js +1 -1
  144. package/dist/sdk/segment.js +1 -1
  145. package/dist/sdk/types/index.d.ts +1 -1
  146. package/dist/sdk/types/index.d.ts.map +1 -1
  147. package/dist/sdk/types/index.js +1 -1
  148. package/dist/sdk/types/index.js.map +1 -1
  149. package/dist/sdk/types/llm.d.ts +8 -0
  150. package/dist/sdk/types/llm.d.ts.map +1 -1
  151. package/dist/sdk/types/progress.js +1 -1
  152. package/dist/sdk/user.js +1 -1
  153. package/dist/sdk/util/format-detector.js +1 -1
  154. package/dist/sdk/util/formatters.js +1 -1
  155. package/dist/sdk/util/index.js +1 -1
  156. package/dist/sdk/util/tree-formatter.js +1 -1
  157. package/dist/sdk/workflow/archive-validation.js +1 -1
  158. package/dist/sdk/workflow/clone-workflow.js +1 -1
  159. package/dist/sdk/workflow/index.js +1 -1
  160. package/dist/sdk/workflow/pull-workflow.js +1 -1
  161. package/dist/sdk/workflow/push-workflow.js +1 -1
  162. package/dist/sdk/workflow/tdx-config.js +1 -1
  163. package/dist/sdk/workflow/workflow-utils.js +1 -1
  164. package/dist/test-utils/command-runner.js +1 -1
  165. package/dist/test-utils/factories.js +1 -1
  166. package/dist/test-utils/fixtures.js +1 -1
  167. package/dist/test-utils/http-mock.js +1 -1
  168. package/dist/test-utils/index.js +1 -1
  169. package/dist/utils/async.js +1 -1
  170. package/dist/utils/colors.js +1 -1
  171. package/dist/utils/diff.js +1 -1
  172. package/dist/utils/file-permissions.js +1 -1
  173. package/dist/utils/global-cache.js +1 -1
  174. package/dist/utils/json-loader.js +1 -1
  175. package/dist/utils/local-cache.js +1 -1
  176. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  177. package/dist/utils/logger/formatters/index.js +1 -1
  178. package/dist/utils/logger/handlers/console-handler.js +1 -1
  179. package/dist/utils/logger/handlers/file-handler.js +1 -1
  180. package/dist/utils/logger/handlers/index.js +1 -1
  181. package/dist/utils/logger/handlers/null-handler.js +1 -1
  182. package/dist/utils/logger/index.js +1 -1
  183. package/dist/utils/logger/logger.js +1 -1
  184. package/dist/utils/logger/types.js +1 -1
  185. package/dist/utils/option-validation.js +1 -1
  186. package/dist/utils/port.js +1 -1
  187. package/dist/utils/process.d.ts.map +1 -1
  188. package/dist/utils/process.js +1 -1
  189. package/dist/utils/process.js.map +1 -1
  190. package/dist/utils/prompt.js +1 -1
  191. package/dist/utils/spinner.js +1 -1
  192. package/dist/utils/sse-parser.js +1 -1
  193. package/dist/utils/string-utils.js +1 -1
  194. package/dist/utils/table-ref-parser.js +1 -1
  195. package/dist/utils/tdx-logger.js +1 -1
  196. package/dist/utils/version-check.js +1 -1
  197. package/package.json +1 -1
@@ -1 +1 @@
1
- const a28_0xfea2b9=a28_0x5ad7;function a28_0x5ad7(_0x128f23,_0x4bfea0){_0x128f23=_0x128f23-0x19b;const _0x3ada4d=a28_0x3ada();let _0x5ad730=_0x3ada4d[_0x128f23];return _0x5ad730;}(function(_0x34973b,_0x4c1e63){const _0x5080f3=a28_0x5ad7,_0x48b674=_0x34973b();while(!![]){try{const _0x4dccbf=-parseInt(_0x5080f3(0x22c))/0x1+-parseInt(_0x5080f3(0x1b6))/0x2+parseInt(_0x5080f3(0x228))/0x3+parseInt(_0x5080f3(0x237))/0x4*(parseInt(_0x5080f3(0x202))/0x5)+-parseInt(_0x5080f3(0x238))/0x6+-parseInt(_0x5080f3(0x1bd))/0x7*(parseInt(_0x5080f3(0x1b1))/0x8)+parseInt(_0x5080f3(0x1a7))/0x9*(parseInt(_0x5080f3(0x229))/0xa);if(_0x4dccbf===_0x4c1e63)break;else _0x48b674['push'](_0x48b674['shift']());}catch(_0x1f05a1){_0x48b674['push'](_0x48b674['shift']());}}}(a28_0x3ada,0x2ab7b));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 a28_0x3ada(){const _0x2638ff=['Parent\x20segment:\x20','Get\x20SQL\x20query\x20for\x20child\x20segment','34274XqEPWO','segmentId','Error:\x20Folder\x20or\x20segment\x20name,\x20or\x20YAML\x20file\x20path\x20is\x20required','log','message','/app/ps/','Fetching\x20SQL\x20for\x20segment...','Fetching\x20segment\x20details...','List\x20segment\x20folders\x20under\x20a\x20parent\x20segment','Usage:\x20tdx\x20sg\x20sql\x20<name>','description','517948WQhgFY','293952xPtZrS','segment:sql','Target\x20path:\x20','includes','getSegmentSQL','Resolving\x20path\x20\x27','type','Error:\x20Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.','Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>','query','Usage:\x20tdx\x20segment\x20describe\x20<path>','folderId','Execute\x20child\x20segment\x20SQL\x20query\x20and\x20show\x20results','100521jgdnLx','listFolders','Error:\x20Cannot\x20execute\x20query\x20for\x20parent\x20segment\x20with\x20this\x20command.','segmentPath','\x27\x20with\x20ID:\x20','jsonl','/e/','Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)','Parent\x20ID:\x20','data','16hmmnpH','test','\x20\x20tdx\x20sg\x20view\x20segments/my-audience/premium-users.yml','\x20\x20Segment\x20name:\x20','site','338650QkbsBG','segment:folder:show','segment:folder:list','Folder\x20name:\x20','Resolving\x20folder\x20\x27','Show\x20segment\x20folder\x20details','jobId','865298JebYiT','Show\x20folder\x20or\x20child\x20segment\x20details','Site:\x20','replace','length','Folder\x20ID:\x20','resolveParentId','format','parentFolder','Error:\x20Cannot\x20show\x20schema\x20for\x20a\x20folder.','\x20rows\x20','Resolving\x20\x27','Resolved\x20relative\x20path\x20to:\x20','Error:\x20Cannot\x20open\x20folder\x20in\x20web\x20browser.\x20Use\x20a\x20segment\x20name\x20instead.','\x20\x20tdx\x20sg\x20view\x20\x22Marketing\x22\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20folder\x20details','execute','Folder\x20ID\x20missing\x20from\x20resolved\x20path','json','cause','Creating\x20folder\x20\x27','\x20\x20Cause:\x20','resolvePathToResource','parentSegment','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20desc\x20<path/to/segment.yml>','segment:describe','SQL\x20query:\x0a','Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]','web','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22','Resolving\x20parent\x20folder\x20\x27','Resolving\x20parent\x20segment\x20\x27','getFolder','resolveFolderId','getSegment','segment:desc','getParent','SEGMENT_FOLDER_NOT_FOUND','stats','Listing\x20folders\x20for\x20parent\x20\x27','βœ”\x20Found\x20','toLocaleString','name','\x20\x20Full\x20path:\x20','Show\x20segment\x20or\x20folder\x20details','verbose','Error:\x20Parent\x20segment\x20name\x20is\x20required','Error:\x20Cannot\x20view\x20parent\x20segment\x20details\x20with\x20this\x20command.','folder','Resolved\x20folder\x20ID:\x20','Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','βœ”\x20Created\x20folder\x20\x27','Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.','parent','Use:\x20tdx\x20sg\x20view\x20<name>\x20\x20#\x20To\x20show\x20folder\x20details','Segment\x20ID:\x20','\x27...','Use:\x20tdx\x20ps\x20show','trim','Resolved\x20parent\x20folder\x20ID:\x20','\x20\x20tdx\x20sg\x20show\x20segments/my-audience/premium-users.yml','Error:\x20Cannot\x20show\x20schema\x20for\x20parent\x20segment\x20with\x20this\x20command.','segmentName','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20show\x20<path/to/segment.yml>','Examples:','information_schema','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20sql\x20<path/to/segment.yml>','Usage:\x20tdx\x20sg\x20view\x20<name>\x20[-w]','cyan','10icMHxc','segment','\x20\x20tdx\x20sg\x20desc\x20\x22Premium\x20Users\x22','Create\x20segment\x20folder\x20for\x20organization','Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required','\x20\x20tdx\x20sg\x20desc\x20segments/my-audience/premium-users.yml','segment:show','processedRows','createFolder','Use:\x20tdx\x20ps\x20view','Show\x20child\x20segment\x20schema\x20(column\x20types)','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20view\x20<path/to/segment.yml>','Use:\x20tdx\x20ps\x20desc','Use:\x20tdx\x20ps\x20sql','folderPath','Segment\x20ID\x20missing\x20from\x20resolved\x20path','Resolved\x20type:\x20','Fetching\x20folder\x20details...','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20-w\x20\x20#\x20Open\x20segment\x20in\x20web\x20browser','Executing\x20segment\x20query...','Fetching\x20folder\x20\x27','fullPath','SEGMENT_NOT_FOUND','Error:\x20Folder\x20reference\x20is\x20required','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','Fetching\x20parent\x20segment\x20details...','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','INVALID_ARGUMENT','error','parentId','Parent\x20name:\x20','Resolved\x20parent\x20ID:\x20','Error:\x20','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','SELECT\x20*\x20FROM\x20(\x0a','limit','segment:folder:create','\x20\x20Parent\x20segment:\x20','644322QMwZUZ','180cBBnPS'];a28_0x3ada=function(){return _0x2638ff;};return a28_0x3ada();}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 a28_0x2fa847 from'chalk';async function resolveSegmentTarget(_0x544ce0,_0x29896b,_0x3488ad){const _0x23e313=a28_0x5ad7;if(isYamlFilePath(_0x544ce0))try{const _0x4701fb=await resolveYamlFilePath(_0x544ce0);return _0x3488ad&&(console['error']('Resolved\x20YAML\x20file:\x20'+_0x544ce0),console[_0x23e313(0x21e)](_0x23e313(0x227)+_0x4701fb[_0x23e313(0x1d3)]),console['error'](_0x23e313(0x1b4)+_0x4701fb[_0x23e313(0x1fb)]),console[_0x23e313(0x21e)]('\x20\x20Folder\x20path:\x20'+(_0x4701fb[_0x23e313(0x210)]||'(root)')),console[_0x23e313(0x21e)](_0x23e313(0x1e7)+_0x4701fb[_0x23e313(0x217)])),_0x4701fb[_0x23e313(0x217)];}catch(_0x329448){throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x23e313(0x223)+_0x329448[_0x23e313(0x230)]);}if(!_0x29896b)throw new SDKError(ErrorCode[_0x23e313(0x21d)],'No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22');return _0x29896b+'/'+_0x544ce0;}export class SegmentDescribeCommand extends BaseCommand{[a28_0xfea2b9(0x1e6)]=a28_0xfea2b9(0x1d5);['description']=a28_0xfea2b9(0x1e8);async[a28_0xfea2b9(0x1cc)](_0x5872be){const _0x1379c9=a28_0xfea2b9,{options:_0x34b4cb,args:_0x403e8f,tdx:_0x41f4cf}=_0x5872be,_0x1c78ab=_0x403e8f[0x0],_0x55f312=!_0x1c78ab&&!!_0x34b4cb[_0x1379c9(0x1d3)],_0x5ab977=_0x1c78ab||_0x34b4cb[_0x1379c9(0x1d3)];if(!_0x5ab977)return console['error']('Error:\x20Path\x20or\x20name\x20is\x20required'),console['error'](_0x1379c9(0x1a4)),console[_0x1379c9(0x21e)]('Examples:'),console[_0x1379c9(0x21e)]('\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22'),console[_0x1379c9(0x21e)](_0x1379c9(0x1d9)),console['error']('\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context'),console['error'](_0x1379c9(0x1ef)),0x1;try{const _0x968cbf=_0x34b4cb[_0x1379c9(0x1aa)];let _0x2b8bb6=_0x5ab977;!_0x55f312&&_0x968cbf&&!_0x5ab977[_0x1379c9(0x19d)]('/')&&(_0x2b8bb6=_0x968cbf+'/'+_0x5ab977,_0x34b4cb[_0x1379c9(0x1e9)]&&console[_0x1379c9(0x21e)](_0x1379c9(0x1c9)+_0x2b8bb6));const _0x4d39e6=await withSpinner(_0x1379c9(0x19f)+_0x2b8bb6+_0x1379c9(0x1f5),()=>_0x41f4cf[_0x1379c9(0x203)][_0x1379c9(0x1d2)](_0x2b8bb6),{'verbose':_0x34b4cb[_0x1379c9(0x1e9)]}),_0x3f8d46=_0x4d39e6[_0x1379c9(0x1b0)];_0x34b4cb['verbose']&&(console[_0x1379c9(0x21e)](_0x1379c9(0x212)+_0x3f8d46[_0x1379c9(0x1a0)]),console['error']('Parent\x20ID:\x20'+_0x3f8d46[_0x1379c9(0x21f)]),_0x3f8d46[_0x1379c9(0x1a5)]&&console[_0x1379c9(0x21e)](_0x1379c9(0x1c2)+_0x3f8d46[_0x1379c9(0x1a5)]),_0x3f8d46[_0x1379c9(0x22d)]&&console['error'](_0x1379c9(0x1f4)+_0x3f8d46[_0x1379c9(0x22d)]));if(_0x3f8d46[_0x1379c9(0x1a0)]===_0x1379c9(0x1f2)){const _0x3799b4=await withSpinner(_0x1379c9(0x21b),()=>_0x41f4cf[_0x1379c9(0x203)][_0x1379c9(0x1e0)](_0x3f8d46['parentId']),{'verbose':_0x34b4cb[_0x1379c9(0x1e9)]});await handleSingleObjectOutput(_0x3799b4[_0x1379c9(0x1b0)],_0x34b4cb);}else{if(_0x3f8d46['type']===_0x1379c9(0x1ec)){if(!_0x3f8d46[_0x1379c9(0x1a5)])throw new SDKError(ErrorCode[_0x1379c9(0x1e1)],_0x1379c9(0x1cd));const _0x17d4bb=await withSpinner('Fetching\x20folder\x20details...',()=>_0x41f4cf[_0x1379c9(0x203)][_0x1379c9(0x1dc)](_0x3f8d46[_0x1379c9(0x1a5)]),{'verbose':_0x34b4cb[_0x1379c9(0x1e9)]});await handleSingleObjectOutput(_0x17d4bb[_0x1379c9(0x1b0)],_0x34b4cb);}else{if(_0x3f8d46[_0x1379c9(0x1a0)]===_0x1379c9(0x203)){if(!_0x3f8d46['segmentId'])throw new SDKError(ErrorCode[_0x1379c9(0x218)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x4c8ad4=await withSpinner(_0x1379c9(0x233),()=>_0x41f4cf[_0x1379c9(0x203)][_0x1379c9(0x1de)](_0x3f8d46['parentId'],_0x3f8d46[_0x1379c9(0x22d)]),{'verbose':_0x34b4cb[_0x1379c9(0x1e9)]});await handleSingleObjectOutput(_0x4c8ad4[_0x1379c9(0x1b0)],_0x34b4cb);}}}return 0x0;}catch(_0x133868){if(_0x133868 instanceof SDKError)return console[_0x1379c9(0x21e)](_0x1379c9(0x222)+_0x133868[_0x1379c9(0x230)]),_0x133868['cause']&&console['error']('\x20\x20Cause:\x20'+_0x133868[_0x1379c9(0x1cf)]),0x1;throw _0x133868;}}}export class SegmentShowCommand extends BaseCommand{['name']=a28_0xfea2b9(0x208);[a28_0xfea2b9(0x236)]=a28_0xfea2b9(0x1a6);async['execute'](_0x214686){const _0x18e0a0=a28_0xfea2b9,{options:_0x52e07a,args:_0x579671,tdx:_0x18fe48}=_0x214686,_0x2212e1=_0x579671[0x0];if(!_0x2212e1)return console[_0x18e0a0(0x21e)]('Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required'),console[_0x18e0a0(0x21e)]('Usage:\x20tdx\x20sg\x20show\x20<name>'),console[_0x18e0a0(0x21e)](_0x18e0a0(0x1fc)),console[_0x18e0a0(0x21e)]('Examples:'),console[_0x18e0a0(0x21e)]('\x20\x20tdx\x20sg\x20show\x20\x22Premium\x20Users\x22'),console['error'](_0x18e0a0(0x1f9)),0x1;try{const _0x5306ba=_0x52e07a['parentSegment'],_0x176605=await resolveSegmentTarget(_0x2212e1,_0x5306ba,_0x52e07a[_0x18e0a0(0x1e9)]);_0x52e07a[_0x18e0a0(0x1e9)]&&console[_0x18e0a0(0x21e)](_0x18e0a0(0x19c)+_0x176605);const _0x559c81=await withSpinner(_0x18e0a0(0x1c8)+_0x2212e1+_0x18e0a0(0x1f5),()=>_0x18fe48[_0x18e0a0(0x203)][_0x18e0a0(0x1d2)](_0x176605),{'verbose':_0x52e07a[_0x18e0a0(0x1e9)]}),_0x3cf9cf=_0x559c81[_0x18e0a0(0x1b0)];_0x52e07a[_0x18e0a0(0x1e9)]&&(console[_0x18e0a0(0x21e)](_0x18e0a0(0x212)+_0x3cf9cf[_0x18e0a0(0x1a0)]),console[_0x18e0a0(0x21e)](_0x18e0a0(0x1af)+_0x3cf9cf[_0x18e0a0(0x21f)]));if(_0x3cf9cf[_0x18e0a0(0x1a0)]===_0x18e0a0(0x1ec))return console['error'](_0x18e0a0(0x1f1)),console['error'](_0x18e0a0(0x1f3)),0x1;if(_0x3cf9cf[_0x18e0a0(0x1a0)]===_0x18e0a0(0x1f2))return console[_0x18e0a0(0x21e)](_0x18e0a0(0x1a9)),console[_0x18e0a0(0x21e)](_0x18e0a0(0x1f6)),0x1;if(!_0x3cf9cf[_0x18e0a0(0x22d)])throw new SDKError(ErrorCode[_0x18e0a0(0x218)],_0x18e0a0(0x211));const _0x61e0a=await withSpinner(_0x18e0a0(0x232),()=>_0x18fe48[_0x18e0a0(0x203)]['getSegmentSQL'](_0x3cf9cf[_0x18e0a0(0x21f)],_0x3cf9cf[_0x18e0a0(0x22d)]),{'verbose':_0x52e07a[_0x18e0a0(0x1e9)]});let _0x30a4e7=_0x61e0a[_0x18e0a0(0x1b0)];const _0x217f15=resolveLimit(_0x52e07a[_0x18e0a0(0x225)],DEFAULT_DISPLAY_LIMIT),_0x448fe1=/\bLIMIT\s+\d+/i[_0x18e0a0(0x1b2)](_0x30a4e7);!_0x448fe1&&(_0x30a4e7=_0x30a4e7[_0x18e0a0(0x1f7)]()[_0x18e0a0(0x1c0)](/;+$/,''),_0x30a4e7=_0x18e0a0(0x224)+_0x30a4e7+_0x18e0a0(0x21c)+_0x217f15);_0x52e07a[_0x18e0a0(0x1e9)]&&console[_0x18e0a0(0x21e)](_0x18e0a0(0x1d6)+_0x30a4e7);const _0x1cc036=await withProgressSpinner(_0x18e0a0(0x215),async _0x4b1a88=>{const _0xd3cf48=_0x18e0a0,_0x137ff0=await _0x18fe48[_0xd3cf48(0x1a3)][_0xd3cf48(0x1cc)](_0x30a4e7,{'catalog':'td','schema':_0xd3cf48(0x1fe),'onJobId':_0x2a197c=>{_0x4b1a88['setJobId'](_0x2a197c);}});return _0x137ff0;},{'verbose':_0x52e07a[_0x18e0a0(0x1e9)]}),_0x4efe65=_0x1cc036['data'],_0x1f3631=_0x4efe65[_0x18e0a0(0x1bc)]?'\x20[Job\x20ID:\x20'+_0x4efe65['jobId']+']':'';return console[_0x18e0a0(0x21e)]('βœ”\x20Query\x20completed:\x20Processed\x20'+_0x4efe65[_0x18e0a0(0x1e2)][_0x18e0a0(0x209)][_0x18e0a0(0x1e5)]()+_0x18e0a0(0x1c7)+('in\x20'+formatElapsed(_0x4efe65[_0x18e0a0(0x1e2)]['elapsedTimeMillis'])+_0x1f3631)),await handleQueryOutput(_0x4efe65,_0x52e07a),0x0;}catch(_0x232742){if(_0x232742 instanceof SDKError)return console[_0x18e0a0(0x21e)]('βœ–\x20Query\x20failed\x20['+_0x232742['code']+']'),console[_0x18e0a0(0x21e)]('\x0a'+_0x232742['message']),0x1;throw _0x232742;}}}export class SegmentFolderListCommand extends BaseCommand{['name']=a28_0xfea2b9(0x1b8);['description']=a28_0xfea2b9(0x234);async[a28_0xfea2b9(0x1cc)](_0x5a0639){const _0x8397d3=a28_0xfea2b9,{options:_0x161e93,args:_0x250ec0,tdx:_0x1a4702}=_0x5a0639;if(_0x250ec0[_0x8397d3(0x1c1)]===0x0)return console[_0x8397d3(0x21e)](_0x8397d3(0x1ea)),console[_0x8397d3(0x21e)]('Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>'),0x1;const _0x119099=_0x250ec0[0x0];try{_0x161e93['verbose']&&(console[_0x8397d3(0x21e)]('Site:\x20'+_0x161e93[_0x8397d3(0x1b5)]),console[_0x8397d3(0x21e)]('Parent\x20name:\x20'+_0x119099));const _0x5ca707=await withSpinner(_0x8397d3(0x1db)+_0x119099+_0x8397d3(0x1f5),()=>_0x1a4702[_0x8397d3(0x203)][_0x8397d3(0x1c3)](_0x119099),{'verbose':_0x161e93[_0x8397d3(0x1e9)]}),_0x5b081a=_0x5ca707['data'];_0x161e93[_0x8397d3(0x1e9)]&&console[_0x8397d3(0x21e)](_0x8397d3(0x221)+_0x5b081a);const _0x31062c=await withSpinner(_0x8397d3(0x1e3)+_0x119099+'\x27...',()=>_0x1a4702['segment'][_0x8397d3(0x1a8)](_0x5b081a),{'verbose':_0x161e93[_0x8397d3(0x1e9)]}),_0x2844fc=_0x31062c[_0x8397d3(0x1b0)];return console[_0x8397d3(0x21e)](_0x8397d3(0x1e4)+_0x2844fc[_0x8397d3(0x1c1)]+'\x20folder'+(_0x2844fc[_0x8397d3(0x1c1)]!==0x1?'s':'')),await handleSDKOutput(_0x2844fc,_0x161e93),0x0;}catch(_0x425c93){if(_0x425c93 instanceof SDKError)return console['error']('Error:\x20'+_0x425c93[_0x8397d3(0x230)]),_0x425c93[_0x8397d3(0x1cf)]&&console[_0x8397d3(0x21e)](_0x8397d3(0x1d1)+_0x425c93['cause']),0x1;throw _0x425c93;}}}export class SegmentFolderShowCommand extends BaseCommand{[a28_0xfea2b9(0x1e6)]=a28_0xfea2b9(0x1b7);[a28_0xfea2b9(0x236)]=a28_0xfea2b9(0x1bb);async[a28_0xfea2b9(0x1cc)](_0x1d9f2b){const _0x1da478=a28_0xfea2b9,{options:_0x588122,args:_0x5f2ad4,tdx:_0x33b115}=_0x1d9f2b;if(_0x5f2ad4[_0x1da478(0x1c1)]===0x0)return console[_0x1da478(0x21e)](_0x1da478(0x219)),console[_0x1da478(0x21e)](_0x1da478(0x1a2)),0x1;try{const {parentId:_0x5293e7,childId:_0x34722d}=parseSegmentRef(_0x5f2ad4[0x0]);_0x588122['verbose']&&(console[_0x1da478(0x21e)](_0x1da478(0x1bf)+_0x588122['site']),console['error'](_0x1da478(0x220)+_0x5293e7),_0x34722d&&console[_0x1da478(0x21e)]('Folder\x20name:\x20'+_0x34722d));if(!_0x34722d)return console['error'](_0x1da478(0x1ae)),0x1;const _0x7254ec=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x5293e7+_0x1da478(0x1f5),()=>_0x33b115['segment'][_0x1da478(0x1c3)](_0x5293e7),{'verbose':_0x588122[_0x1da478(0x1e9)]}),_0x9df2a3=_0x7254ec['data'];_0x588122[_0x1da478(0x1e9)]&&console[_0x1da478(0x21e)](_0x1da478(0x221)+_0x9df2a3);const _0x30acff=await withSpinner(_0x1da478(0x1ba)+_0x34722d+_0x1da478(0x1f5),()=>_0x33b115[_0x1da478(0x203)][_0x1da478(0x1dd)](_0x9df2a3,_0x34722d),{'verbose':_0x588122[_0x1da478(0x1e9)]}),_0x3d37e5=_0x30acff[_0x1da478(0x1b0)];_0x588122[_0x1da478(0x1e9)]&&console['error'](_0x1da478(0x1ed)+_0x3d37e5);const _0x512e58=await withSpinner(_0x1da478(0x216)+_0x34722d+_0x1da478(0x1f5),()=>_0x33b115[_0x1da478(0x203)][_0x1da478(0x1dc)](_0x3d37e5),{'verbose':_0x588122[_0x1da478(0x1e9)]});return await handleSDKOutput([_0x512e58[_0x1da478(0x1b0)]],_0x588122),0x0;}catch(_0x5e6cfc){if(_0x5e6cfc instanceof SDKError)return console[_0x1da478(0x21e)](_0x1da478(0x222)+_0x5e6cfc[_0x1da478(0x230)]),_0x5e6cfc['cause']&&console['error'](_0x1da478(0x1d1)+_0x5e6cfc[_0x1da478(0x1cf)]),0x1;throw _0x5e6cfc;}}}export class SegmentSQLCommand extends BaseCommand{[a28_0xfea2b9(0x1e6)]=a28_0xfea2b9(0x19b);['description']=a28_0xfea2b9(0x22b);async[a28_0xfea2b9(0x1cc)](_0x34eecd){const _0x237d3a=a28_0xfea2b9,{options:_0x22f0e5,args:_0x8b765d,tdx:_0x19a99f}=_0x34eecd,_0x584516=_0x8b765d[0x0];if(!_0x584516)return console[_0x237d3a(0x21e)](_0x237d3a(0x1ee)),console[_0x237d3a(0x21e)](_0x237d3a(0x235)),console[_0x237d3a(0x21e)](_0x237d3a(0x1ff)),console[_0x237d3a(0x21e)](_0x237d3a(0x1fd)),console[_0x237d3a(0x21e)]('\x20\x20tdx\x20sg\x20sql\x20\x22Premium\x20Users\x22'),console[_0x237d3a(0x21e)]('\x20\x20tdx\x20sg\x20sql\x20segments/my-audience/premium-users.yml'),0x1;try{const _0x4f5c64=_0x22f0e5['parentSegment'],_0x5b8623=await resolveSegmentTarget(_0x584516,_0x4f5c64,_0x22f0e5[_0x237d3a(0x1e9)]);_0x22f0e5[_0x237d3a(0x1e9)]&&console[_0x237d3a(0x21e)]('Target\x20path:\x20'+_0x5b8623);const _0x3c8eba=await withSpinner(_0x237d3a(0x1c8)+_0x584516+_0x237d3a(0x1f5),()=>_0x19a99f[_0x237d3a(0x203)][_0x237d3a(0x1d2)](_0x5b8623),{'verbose':_0x22f0e5[_0x237d3a(0x1e9)]}),_0x30a898=_0x3c8eba[_0x237d3a(0x1b0)];_0x22f0e5[_0x237d3a(0x1e9)]&&(console[_0x237d3a(0x21e)](_0x237d3a(0x212)+_0x30a898[_0x237d3a(0x1a0)]),console[_0x237d3a(0x21e)](_0x237d3a(0x1af)+_0x30a898['parentId']));if(_0x30a898[_0x237d3a(0x1a0)]===_0x237d3a(0x1ec))return console[_0x237d3a(0x21e)](_0x237d3a(0x1a1)),console[_0x237d3a(0x21e)]('Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.'),0x1;if(_0x30a898[_0x237d3a(0x1a0)]===_0x237d3a(0x1f2))return console['error']('Error:\x20Cannot\x20get\x20SQL\x20for\x20parent\x20segment\x20with\x20this\x20command.'),console[_0x237d3a(0x21e)](_0x237d3a(0x20f)),0x1;if(!_0x30a898[_0x237d3a(0x22d)])throw new SDKError(ErrorCode[_0x237d3a(0x218)],_0x237d3a(0x211));const _0xde156a=await withSpinner(_0x237d3a(0x232),()=>_0x19a99f[_0x237d3a(0x203)][_0x237d3a(0x19e)](_0x30a898[_0x237d3a(0x21f)],_0x30a898[_0x237d3a(0x22d)]),{'verbose':_0x22f0e5[_0x237d3a(0x1e9)]}),_0x2a95da=_0xde156a[_0x237d3a(0x1b0)];return _0x22f0e5[_0x237d3a(0x1c4)]===_0x237d3a(0x1ce)||_0x22f0e5[_0x237d3a(0x1c4)]===_0x237d3a(0x1ac)?await handleSDKOutput([{'sql':_0x2a95da}],_0x22f0e5):console[_0x237d3a(0x22f)](_0x2a95da),0x0;}catch(_0x3d3b12){if(_0x3d3b12 instanceof SDKError)return console['error']('Error:\x20'+_0x3d3b12[_0x237d3a(0x230)]),_0x3d3b12[_0x237d3a(0x1cf)]&&console[_0x237d3a(0x21e)]('\x20\x20Cause:\x20'+_0x3d3b12[_0x237d3a(0x1cf)]),0x1;throw _0x3d3b12;}}}export class SegmentFolderCreateCommand extends BaseCommand{[a28_0xfea2b9(0x1e6)]=a28_0xfea2b9(0x226);[a28_0xfea2b9(0x236)]=a28_0xfea2b9(0x205);async['execute'](_0x2b9afb){const _0x38bba6=a28_0xfea2b9,{options:_0xb599c4,args:_0x4d4cd5,tdx:_0x540318}=_0x2b9afb,_0x19a357=_0xb599c4;if(_0x4d4cd5[_0x38bba6(0x1c1)]<0x2)return console['error'](_0x38bba6(0x206)),console[_0x38bba6(0x21e)](_0x38bba6(0x1d7)),0x1;const _0x41aa58=_0x4d4cd5[0x0],_0x556cd0=_0x4d4cd5[0x1];_0x19a357['verbose']&&(console[_0x38bba6(0x21e)](_0x38bba6(0x1bf)+_0x19a357[_0x38bba6(0x1b5)]),console[_0x38bba6(0x21e)](_0x38bba6(0x22a)+_0x41aa58),console[_0x38bba6(0x21e)](_0x38bba6(0x1b9)+_0x556cd0));let _0x4851b9;if(_0x19a357[_0x38bba6(0x1c5)]){const _0x86943c=_0x19a357[_0x38bba6(0x1c5)],_0x302c20=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x41aa58+_0x38bba6(0x1f5),()=>_0x540318[_0x38bba6(0x203)]['resolveParentId'](_0x41aa58),{'verbose':_0x19a357[_0x38bba6(0x1e9)]}),_0x132665=_0x302c20[_0x38bba6(0x1b0)],_0x2e3d71=await withSpinner(_0x38bba6(0x1da)+_0x86943c+_0x38bba6(0x1f5),()=>_0x540318[_0x38bba6(0x203)][_0x38bba6(0x1dd)](_0x132665,_0x86943c),{'verbose':_0x19a357['verbose']});_0x4851b9=_0x2e3d71['data'],_0x19a357['verbose']&&console['error'](_0x38bba6(0x1f8)+_0x4851b9);}const _0x33ba5f={'name':_0x556cd0,'description':_0x19a357['description'],'parentFolderId':_0x4851b9},_0x1b1dc3=await withSpinner(_0x38bba6(0x1d0)+_0x556cd0+_0x38bba6(0x1f5),()=>_0x540318[_0x38bba6(0x203)][_0x38bba6(0x20a)](_0x41aa58,_0x33ba5f),{'verbose':_0x19a357[_0x38bba6(0x1e9)]}),_0x203866=_0x1b1dc3[_0x38bba6(0x1b0)];return console[_0x38bba6(0x21e)](_0x38bba6(0x1f0)+_0x203866[_0x38bba6(0x1e6)]+_0x38bba6(0x1ab)+_0x203866['id']),await handleSDKOutput([_0x203866],_0x19a357),0x0;}}export class SegmentViewCommand extends BaseCommand{[a28_0xfea2b9(0x1e6)]='segment:view';[a28_0xfea2b9(0x236)]=a28_0xfea2b9(0x1be);async[a28_0xfea2b9(0x1cc)](_0x343954){const _0x19f3b3=a28_0xfea2b9,{options:_0x5a0583,args:_0xe38ffa,tdx:_0x5cdd79}=_0x343954,_0x206970=_0xe38ffa[0x0];if(!_0x206970)return console[_0x19f3b3(0x21e)](_0x19f3b3(0x22e)),console[_0x19f3b3(0x21e)](_0x19f3b3(0x200)),console[_0x19f3b3(0x21e)](_0x19f3b3(0x20d)),console['error']('Options:'),console[_0x19f3b3(0x21e)]('\x20\x20-w,\x20--web\x20\x20Open\x20segment\x20in\x20web\x20browser'),console[_0x19f3b3(0x21e)](_0x19f3b3(0x1fd)),console[_0x19f3b3(0x21e)](_0x19f3b3(0x1cb)),console[_0x19f3b3(0x21e)]('\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20\x20\x20\x20\x20#\x20View\x20child\x20segment\x20details'),console[_0x19f3b3(0x21e)](_0x19f3b3(0x214)),console[_0x19f3b3(0x21e)](_0x19f3b3(0x1b3)),0x1;try{const _0x31dba0=_0x5a0583[_0x19f3b3(0x1d3)],_0x2639ed=await resolveSegmentTarget(_0x206970,_0x31dba0,_0x5a0583[_0x19f3b3(0x1e9)]);_0x5a0583[_0x19f3b3(0x1e9)]&&console[_0x19f3b3(0x21e)](_0x19f3b3(0x19c)+_0x2639ed);const _0x392cf1=await withSpinner('Resolving\x20\x27'+_0x206970+_0x19f3b3(0x1f5),()=>_0x5cdd79[_0x19f3b3(0x203)][_0x19f3b3(0x1d2)](_0x2639ed),{'verbose':_0x5a0583[_0x19f3b3(0x1e9)]}),_0x2bf988=_0x392cf1[_0x19f3b3(0x1b0)];_0x5a0583[_0x19f3b3(0x1e9)]&&(console[_0x19f3b3(0x21e)]('Resolved\x20type:\x20'+_0x2bf988[_0x19f3b3(0x1a0)]),console['error'](_0x19f3b3(0x1af)+_0x2bf988[_0x19f3b3(0x21f)]),_0x2bf988[_0x19f3b3(0x1a5)]&&console[_0x19f3b3(0x21e)]('Folder\x20ID:\x20'+_0x2bf988[_0x19f3b3(0x1a5)]),_0x2bf988['segmentId']&&console[_0x19f3b3(0x21e)](_0x19f3b3(0x1f4)+_0x2bf988['segmentId']));if(_0x5a0583[_0x19f3b3(0x1d8)]){if(_0x2bf988[_0x19f3b3(0x1a0)]===_0x19f3b3(0x1ec))return console[_0x19f3b3(0x21e)](_0x19f3b3(0x1ca)),0x1;if(_0x2bf988[_0x19f3b3(0x1a0)]==='parent')return console[_0x19f3b3(0x21e)]('Error:\x20Cannot\x20open\x20parent\x20segment\x20with\x20this\x20command.'),console[_0x19f3b3(0x21e)]('Use:\x20tdx\x20ps\x20view\x20-w'),0x1;if(!_0x2bf988[_0x19f3b3(0x22d)])throw new SDKError(ErrorCode[_0x19f3b3(0x218)],_0x19f3b3(0x211));const _0x392f31=getConsoleNextUrl(_0x5a0583[_0x19f3b3(0x1b5)],_0x19f3b3(0x231)+_0x2bf988[_0x19f3b3(0x21f)]+_0x19f3b3(0x1ad)+_0x2bf988[_0x19f3b3(0x22d)]);return console[_0x19f3b3(0x21e)](a28_0x2fa847['green']('βœ”')+'\x20Opening\x20'+a28_0x2fa847[_0x19f3b3(0x201)](_0x392f31)),openBrowser(_0x392f31),0x0;}if(_0x2bf988[_0x19f3b3(0x1a0)]===_0x19f3b3(0x1ec)){if(!_0x2bf988[_0x19f3b3(0x1a5)])throw new SDKError(ErrorCode[_0x19f3b3(0x1e1)],_0x19f3b3(0x1cd));const _0x5b4a8f=await withSpinner(_0x19f3b3(0x213),()=>_0x5cdd79[_0x19f3b3(0x203)][_0x19f3b3(0x1dc)](_0x2bf988[_0x19f3b3(0x1a5)]),{'verbose':_0x5a0583[_0x19f3b3(0x1e9)]});await handleSingleObjectOutput(_0x5b4a8f[_0x19f3b3(0x1b0)],_0x5a0583);}else{if(_0x2bf988[_0x19f3b3(0x1a0)]===_0x19f3b3(0x203)){if(!_0x2bf988[_0x19f3b3(0x22d)])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x19f3b3(0x211));const _0x181e60=await withSpinner(_0x19f3b3(0x233),()=>_0x5cdd79['segment'][_0x19f3b3(0x1de)](_0x2bf988[_0x19f3b3(0x21f)],_0x2bf988[_0x19f3b3(0x22d)]),{'verbose':_0x5a0583[_0x19f3b3(0x1e9)]}),_0x29ae9a=getConsoleNextUrl(_0x5a0583[_0x19f3b3(0x1b5)],_0x19f3b3(0x231)+_0x2bf988['parentId']+'/e/'+_0x2bf988[_0x19f3b3(0x22d)]),_0x1e9975=_0x181e60[_0x19f3b3(0x1b0)];_0x1e9975['url']=_0x29ae9a,await handleSingleObjectOutput(_0x1e9975,_0x5a0583);}else return console[_0x19f3b3(0x21e)](_0x19f3b3(0x1eb)),console[_0x19f3b3(0x21e)](_0x19f3b3(0x20b)),0x1;}return 0x0;}catch(_0x1881fc){if(_0x1881fc instanceof SDKError)return console[_0x19f3b3(0x21e)](_0x19f3b3(0x222)+_0x1881fc[_0x19f3b3(0x230)]),_0x1881fc[_0x19f3b3(0x1cf)]&&console['error'](_0x19f3b3(0x1d1)+_0x1881fc[_0x19f3b3(0x1cf)]),0x1;throw _0x1881fc;}}}export const SegmentInfoCommand=SegmentViewCommand;export class SegmentDescCommand extends BaseCommand{['name']=a28_0xfea2b9(0x1df);[a28_0xfea2b9(0x236)]=a28_0xfea2b9(0x20c);async[a28_0xfea2b9(0x1cc)](_0x268817){const _0x51cdac=a28_0xfea2b9,{options:_0x3265ab,args:_0x125785,tdx:_0x95d1ce}=_0x268817,_0x4bbdd7=_0x125785[0x0];if(!_0x4bbdd7)return console[_0x51cdac(0x21e)](_0x51cdac(0x1ee)),console['error']('Usage:\x20tdx\x20sg\x20desc\x20<name>'),console['error'](_0x51cdac(0x1d4)),console[_0x51cdac(0x21e)]('Examples:'),console[_0x51cdac(0x21e)](_0x51cdac(0x204)),console['error'](_0x51cdac(0x207)),0x1;try{const _0x2ee31f=_0x3265ab[_0x51cdac(0x1d3)],_0x482fa9=await resolveSegmentTarget(_0x4bbdd7,_0x2ee31f,_0x3265ab[_0x51cdac(0x1e9)]);_0x3265ab[_0x51cdac(0x1e9)]&&console[_0x51cdac(0x21e)]('Target\x20path:\x20'+_0x482fa9);const _0x1bd847=await withSpinner(_0x51cdac(0x1c8)+_0x4bbdd7+_0x51cdac(0x1f5),()=>_0x95d1ce[_0x51cdac(0x203)][_0x51cdac(0x1d2)](_0x482fa9),{'verbose':_0x3265ab[_0x51cdac(0x1e9)]}),_0x57d35d=_0x1bd847['data'];_0x3265ab['verbose']&&(console[_0x51cdac(0x21e)](_0x51cdac(0x212)+_0x57d35d[_0x51cdac(0x1a0)]),console[_0x51cdac(0x21e)]('Parent\x20ID:\x20'+_0x57d35d[_0x51cdac(0x21f)]));if(_0x57d35d[_0x51cdac(0x1a0)]===_0x51cdac(0x1ec))return console['error'](_0x51cdac(0x1c6)),console[_0x51cdac(0x21e)](_0x51cdac(0x21a)),0x1;if(_0x57d35d['type']===_0x51cdac(0x1f2))return console[_0x51cdac(0x21e)](_0x51cdac(0x1fa)),console['error'](_0x51cdac(0x20e)),0x1;if(!_0x57d35d[_0x51cdac(0x22d)])throw new SDKError(ErrorCode[_0x51cdac(0x218)],_0x51cdac(0x211));const _0x88a1fb=await withSpinner(_0x51cdac(0x232),()=>_0x95d1ce['segment'][_0x51cdac(0x19e)](_0x57d35d[_0x51cdac(0x21f)],_0x57d35d['segmentId']),{'verbose':_0x3265ab[_0x51cdac(0x1e9)]}),_0x59d8d2=_0x88a1fb[_0x51cdac(0x1b0)],_0x5ca07d=await executeSchemaQuery(_0x59d8d2,_0x95d1ce,_0x3265ab);return await handleQueryOutput(_0x5ca07d,_0x3265ab),0x0;}catch(_0x3f33ea){if(_0x3f33ea instanceof SDKError)return console[_0x51cdac(0x21e)](_0x51cdac(0x222)+_0x3f33ea[_0x51cdac(0x230)]),_0x3f33ea[_0x51cdac(0x1cf)]&&console[_0x51cdac(0x21e)]('\x20\x20Cause:\x20'+_0x3f33ea[_0x51cdac(0x1cf)]),0x1;throw _0x3f33ea;}}}
1
+ const a28_0x4aabba=a28_0x11aa;(function(_0x3ef6c4,_0xc53b67){const _0x29b0c9=a28_0x11aa,_0x5e91a4=_0x3ef6c4();while(!![]){try{const _0x5c5c28=parseInt(_0x29b0c9(0x1b7))/0x1+parseInt(_0x29b0c9(0x195))/0x2*(parseInt(_0x29b0c9(0x1c0))/0x3)+parseInt(_0x29b0c9(0x16f))/0x4+-parseInt(_0x29b0c9(0x1f3))/0x5*(-parseInt(_0x29b0c9(0x193))/0x6)+parseInt(_0x29b0c9(0x18d))/0x7*(-parseInt(_0x29b0c9(0x1ab))/0x8)+parseInt(_0x29b0c9(0x17d))/0x9+-parseInt(_0x29b0c9(0x179))/0xa;if(_0x5c5c28===_0xc53b67)break;else _0x5e91a4['push'](_0x5e91a4['shift']());}catch(_0x4002a6){_0x5e91a4['push'](_0x5e91a4['shift']());}}}(a28_0x5d1a,0xc7658));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';import{openBrowser}from'../utils/process.js';import a28_0x16e550 from'chalk';async function resolveSegmentTarget(_0xb9fce2,_0x54272f,_0x259470){const _0x32388b=a28_0x11aa;if(isYamlFilePath(_0xb9fce2))try{const _0x261fb8=await resolveYamlFilePath(_0xb9fce2);return _0x259470&&(console[_0x32388b(0x1d0)](_0x32388b(0x1be)+_0xb9fce2),console[_0x32388b(0x1d0)]('\x20\x20Parent\x20segment:\x20'+_0x261fb8['parentSegment']),console[_0x32388b(0x1d0)](_0x32388b(0x1b2)+_0x261fb8[_0x32388b(0x175)]),console[_0x32388b(0x1d0)]('\x20\x20Folder\x20path:\x20'+(_0x261fb8['folderPath']||_0x32388b(0x1c9))),console[_0x32388b(0x1d0)](_0x32388b(0x1f7)+_0x261fb8[_0x32388b(0x1fb)])),_0x261fb8[_0x32388b(0x1fb)];}catch(_0x4d3e78){throw new SDKError(ErrorCode[_0x32388b(0x19a)],'Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20'+_0x4d3e78[_0x32388b(0x1c2)]);}if(!_0x54272f)throw new SDKError(ErrorCode[_0x32388b(0x19a)],'No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22');return _0x54272f+'/'+_0xb9fce2;}export class SegmentDescribeCommand extends BaseCommand{[a28_0x4aabba(0x1a4)]=a28_0x4aabba(0x1cc);[a28_0x4aabba(0x161)]='Show\x20segment\x20or\x20folder\x20details';async[a28_0x4aabba(0x1da)](_0x45220c){const _0x2b3514=a28_0x4aabba,{options:_0x2b1d27,args:_0x1d26fc,tdx:_0x285dcd}=_0x45220c,_0x345c53=_0x1d26fc[0x0],_0x45e562=!_0x345c53&&!!_0x2b1d27['parentSegment'],_0x272b54=_0x345c53||_0x2b1d27[_0x2b3514(0x1c7)];if(!_0x272b54)return console['error'](_0x2b3514(0x1c8)),console[_0x2b3514(0x1d0)](_0x2b3514(0x1db)),console['error']('Examples:'),console[_0x2b3514(0x1d0)](_0x2b3514(0x1fc)),console[_0x2b3514(0x1d0)](_0x2b3514(0x1f9)),console['error']('\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context'),console['error'](_0x2b3514(0x1ee)),0x1;try{const _0x56538b=_0x2b1d27[_0x2b3514(0x1f1)];let _0x548690=_0x272b54;!_0x45e562&&_0x56538b&&!_0x272b54[_0x2b3514(0x171)]('/')&&(_0x548690=_0x56538b+'/'+_0x272b54,_0x2b1d27[_0x2b3514(0x18c)]&&console[_0x2b3514(0x1d0)](_0x2b3514(0x186)+_0x548690));const _0x1706e3=await withSpinner('Resolving\x20path\x20\x27'+_0x548690+_0x2b3514(0x1b8),()=>_0x285dcd[_0x2b3514(0x1f0)][_0x2b3514(0x17b)](_0x548690),{'verbose':_0x2b1d27['verbose']}),_0x45d72a=_0x1706e3['data'];_0x2b1d27[_0x2b3514(0x18c)]&&(console[_0x2b3514(0x1d0)](_0x2b3514(0x1e7)+_0x45d72a[_0x2b3514(0x19c)]),console['error'](_0x2b3514(0x194)+_0x45d72a[_0x2b3514(0x1cd)]),_0x45d72a[_0x2b3514(0x167)]&&console[_0x2b3514(0x1d0)]('Folder\x20ID:\x20'+_0x45d72a[_0x2b3514(0x167)]),_0x45d72a['segmentId']&&console[_0x2b3514(0x1d0)](_0x2b3514(0x19b)+_0x45d72a[_0x2b3514(0x1c6)]));if(_0x45d72a[_0x2b3514(0x19c)]==='parent'){const _0x4fe3b5=await withSpinner(_0x2b3514(0x185),()=>_0x285dcd[_0x2b3514(0x1f0)][_0x2b3514(0x1dd)](_0x45d72a['parentId']),{'verbose':_0x2b1d27[_0x2b3514(0x18c)]});await handleSingleObjectOutput(_0x4fe3b5[_0x2b3514(0x1b5)],_0x2b1d27);}else{if(_0x45d72a[_0x2b3514(0x19c)]===_0x2b3514(0x1f5)){if(!_0x45d72a[_0x2b3514(0x167)])throw new SDKError(ErrorCode['SEGMENT_FOLDER_NOT_FOUND'],_0x2b3514(0x1f8));const _0x10b901=await withSpinner(_0x2b3514(0x1bb),()=>_0x285dcd[_0x2b3514(0x1f0)][_0x2b3514(0x1b4)](_0x45d72a['folderId']),{'verbose':_0x2b1d27[_0x2b3514(0x18c)]});await handleSingleObjectOutput(_0x10b901[_0x2b3514(0x1b5)],_0x2b1d27);}else{if(_0x45d72a[_0x2b3514(0x19c)]===_0x2b3514(0x1f0)){if(!_0x45d72a[_0x2b3514(0x1c6)])throw new SDKError(ErrorCode[_0x2b3514(0x1b9)],_0x2b3514(0x17f));const _0x16c761=await withSpinner('Fetching\x20segment\x20details...',()=>_0x285dcd[_0x2b3514(0x1f0)]['getSegment'](_0x45d72a[_0x2b3514(0x1cd)],_0x45d72a['segmentId']),{'verbose':_0x2b1d27[_0x2b3514(0x18c)]});await handleSingleObjectOutput(_0x16c761['data'],_0x2b1d27);}}}return 0x0;}catch(_0x38c955){if(_0x38c955 instanceof SDKError)return console[_0x2b3514(0x1d0)](_0x2b3514(0x1c3)+_0x38c955[_0x2b3514(0x1c2)]),_0x38c955[_0x2b3514(0x1f6)]&&console['error']('\x20\x20Cause:\x20'+_0x38c955[_0x2b3514(0x1f6)]),0x1;throw _0x38c955;}}}export class SegmentShowCommand extends BaseCommand{[a28_0x4aabba(0x1a4)]=a28_0x4aabba(0x18a);[a28_0x4aabba(0x161)]=a28_0x4aabba(0x160);async[a28_0x4aabba(0x1da)](_0x1a61c4){const _0x3ca743=a28_0x4aabba,{options:_0x5b9204,args:_0x557f64,tdx:_0x2cd4bb}=_0x1a61c4,_0x4f8590=_0x557f64[0x0];if(!_0x4f8590)return console[_0x3ca743(0x1d0)](_0x3ca743(0x16b)),console[_0x3ca743(0x1d0)](_0x3ca743(0x1eb)),console[_0x3ca743(0x1d0)](_0x3ca743(0x18f)),console['error']('Examples:'),console[_0x3ca743(0x1d0)](_0x3ca743(0x173)),console[_0x3ca743(0x1d0)](_0x3ca743(0x17c)),0x1;try{const _0x37c857=_0x5b9204[_0x3ca743(0x1c7)],_0x55dcc5=await resolveSegmentTarget(_0x4f8590,_0x37c857,_0x5b9204['verbose']);_0x5b9204['verbose']&&console[_0x3ca743(0x1d0)](_0x3ca743(0x176)+_0x55dcc5);const _0x3ca194=await withSpinner('Resolving\x20\x27'+_0x4f8590+_0x3ca743(0x1b8),()=>_0x2cd4bb[_0x3ca743(0x1f0)][_0x3ca743(0x17b)](_0x55dcc5),{'verbose':_0x5b9204['verbose']}),_0x57139c=_0x3ca194[_0x3ca743(0x1b5)];_0x5b9204[_0x3ca743(0x18c)]&&(console[_0x3ca743(0x1d0)](_0x3ca743(0x1e7)+_0x57139c[_0x3ca743(0x19c)]),console[_0x3ca743(0x1d0)]('Parent\x20ID:\x20'+_0x57139c['parentId']));if(_0x57139c[_0x3ca743(0x19c)]===_0x3ca743(0x1f5))return console[_0x3ca743(0x1d0)](_0x3ca743(0x1ca)),console[_0x3ca743(0x1d0)]('Use:\x20tdx\x20sg\x20view\x20<name>\x20\x20#\x20To\x20show\x20folder\x20details'),0x1;if(_0x57139c[_0x3ca743(0x19c)]==='parent')return console[_0x3ca743(0x1d0)]('Error:\x20Cannot\x20execute\x20query\x20for\x20parent\x20segment\x20with\x20this\x20command.'),console[_0x3ca743(0x1d0)](_0x3ca743(0x1cb)),0x1;if(!_0x57139c[_0x3ca743(0x1c6)])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x58f5e2=await withSpinner('Fetching\x20SQL\x20for\x20segment...',()=>_0x2cd4bb[_0x3ca743(0x1f0)][_0x3ca743(0x1a8)](_0x57139c['parentId'],_0x57139c[_0x3ca743(0x1c6)]),{'verbose':_0x5b9204[_0x3ca743(0x18c)]});let _0x5108d4=_0x58f5e2[_0x3ca743(0x1b5)];const _0x35f072=resolveLimit(_0x5b9204[_0x3ca743(0x18b)],DEFAULT_DISPLAY_LIMIT),_0x58e87e=/\bLIMIT\s+\d+/i[_0x3ca743(0x16d)](_0x5108d4);!_0x58e87e&&(_0x5108d4=_0x5108d4['trim']()['replace'](/;+$/,''),_0x5108d4=_0x3ca743(0x1d5)+_0x5108d4+'\x0a)\x20AS\x20segment_query\x0aLIMIT\x20'+_0x35f072);_0x5b9204[_0x3ca743(0x18c)]&&console[_0x3ca743(0x1d0)](_0x3ca743(0x168)+_0x5108d4);const _0x398fc1=await withProgressSpinner(_0x3ca743(0x17e),async _0x49390d=>{const _0x35fef7=_0x3ca743,_0x202df2=await _0x2cd4bb[_0x35fef7(0x184)][_0x35fef7(0x1da)](_0x5108d4,{'catalog':'td','schema':_0x35fef7(0x166),'onJobId':_0x480608=>{const _0x2beb9b=_0x35fef7;_0x49390d[_0x2beb9b(0x1a3)](_0x480608);}});return _0x202df2;},{'verbose':_0x5b9204[_0x3ca743(0x18c)]}),_0x483466=_0x398fc1[_0x3ca743(0x1b5)],_0x475ab3=_0x483466[_0x3ca743(0x192)]?_0x3ca743(0x19f)+_0x483466[_0x3ca743(0x192)]+']':'';return console[_0x3ca743(0x1d0)](_0x3ca743(0x180)+_0x483466['stats']['processedRows'][_0x3ca743(0x1ed)]()+_0x3ca743(0x1ea)+(_0x3ca743(0x1a2)+formatElapsed(_0x483466[_0x3ca743(0x1d1)][_0x3ca743(0x16a)])+_0x475ab3)),await handleQueryOutput(_0x483466,_0x5b9204),0x0;}catch(_0x2c2b70){if(_0x2c2b70 instanceof SDKError)return console[_0x3ca743(0x1d0)](_0x3ca743(0x1d6)+_0x2c2b70[_0x3ca743(0x1d3)]+']'),console[_0x3ca743(0x1d0)]('\x0a'+_0x2c2b70[_0x3ca743(0x1c2)]),0x1;throw _0x2c2b70;}}}export class SegmentFolderListCommand extends BaseCommand{[a28_0x4aabba(0x1a4)]=a28_0x4aabba(0x1f4);['description']=a28_0x4aabba(0x177);async[a28_0x4aabba(0x1da)](_0xad9284){const _0x242324=a28_0x4aabba,{options:_0x43e170,args:_0x48f696,tdx:_0x4054b8}=_0xad9284;if(_0x48f696['length']===0x0)return console[_0x242324(0x1d0)]('Error:\x20Parent\x20segment\x20name\x20is\x20required'),console[_0x242324(0x1d0)](_0x242324(0x1ec)),0x1;const _0x2a1dad=_0x48f696[0x0];try{_0x43e170[_0x242324(0x18c)]&&(console[_0x242324(0x1d0)]('Site:\x20'+_0x43e170[_0x242324(0x1e6)]),console['error'](_0x242324(0x169)+_0x2a1dad));const _0x4d8c94=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x2a1dad+_0x242324(0x1b8),()=>_0x4054b8['segment'][_0x242324(0x1bc)](_0x2a1dad),{'verbose':_0x43e170[_0x242324(0x18c)]}),_0x3bdc0c=_0x4d8c94[_0x242324(0x1b5)];_0x43e170['verbose']&&console[_0x242324(0x1d0)](_0x242324(0x162)+_0x3bdc0c);const _0x3b6947=await withSpinner(_0x242324(0x1a6)+_0x2a1dad+'\x27...',()=>_0x4054b8[_0x242324(0x1f0)][_0x242324(0x1f2)](_0x3bdc0c),{'verbose':_0x43e170[_0x242324(0x18c)]}),_0x133c3d=_0x3b6947[_0x242324(0x1b5)];return console['error'](_0x242324(0x1bd)+_0x133c3d[_0x242324(0x178)]+_0x242324(0x198)+(_0x133c3d['length']!==0x1?'s':'')),await handleSDKOutput(_0x133c3d,_0x43e170),0x0;}catch(_0x238307){if(_0x238307 instanceof SDKError)return console[_0x242324(0x1d0)](_0x242324(0x1c3)+_0x238307[_0x242324(0x1c2)]),_0x238307[_0x242324(0x1f6)]&&console[_0x242324(0x1d0)](_0x242324(0x174)+_0x238307[_0x242324(0x1f6)]),0x1;throw _0x238307;}}}export class SegmentFolderShowCommand extends BaseCommand{[a28_0x4aabba(0x1a4)]=a28_0x4aabba(0x1e3);[a28_0x4aabba(0x161)]=a28_0x4aabba(0x1ba);async['execute'](_0x3e6af2){const _0x533141=a28_0x4aabba,{options:_0x2dccc2,args:_0x3a0b7c,tdx:_0x30bdec}=_0x3e6af2;if(_0x3a0b7c[_0x533141(0x178)]===0x0)return console[_0x533141(0x1d0)](_0x533141(0x1c1)),console[_0x533141(0x1d0)](_0x533141(0x191)),0x1;try{const {parentId:_0xce2e2b,childId:_0x24af8b}=parseSegmentRef(_0x3a0b7c[0x0]);_0x2dccc2[_0x533141(0x18c)]&&(console[_0x533141(0x1d0)](_0x533141(0x183)+_0x2dccc2[_0x533141(0x1e6)]),console[_0x533141(0x1d0)](_0x533141(0x169)+_0xce2e2b),_0x24af8b&&console[_0x533141(0x1d0)](_0x533141(0x1aa)+_0x24af8b));if(!_0x24af8b)return console[_0x533141(0x1d0)](_0x533141(0x16c)),0x1;const _0x1daf38=await withSpinner(_0x533141(0x182)+_0xce2e2b+_0x533141(0x1b8),()=>_0x30bdec[_0x533141(0x1f0)][_0x533141(0x1bc)](_0xce2e2b),{'verbose':_0x2dccc2[_0x533141(0x18c)]}),_0x492175=_0x1daf38['data'];_0x2dccc2[_0x533141(0x18c)]&&console[_0x533141(0x1d0)](_0x533141(0x162)+_0x492175);const _0x17a76f=await withSpinner(_0x533141(0x188)+_0x24af8b+_0x533141(0x1b8),()=>_0x30bdec['segment'][_0x533141(0x190)](_0x492175,_0x24af8b),{'verbose':_0x2dccc2[_0x533141(0x18c)]}),_0x14bc8f=_0x17a76f[_0x533141(0x1b5)];_0x2dccc2['verbose']&&console[_0x533141(0x1d0)]('Resolved\x20folder\x20ID:\x20'+_0x14bc8f);const _0x53985c=await withSpinner(_0x533141(0x1ef)+_0x24af8b+_0x533141(0x1b8),()=>_0x30bdec['segment']['getFolder'](_0x14bc8f),{'verbose':_0x2dccc2[_0x533141(0x18c)]});return await handleSDKOutput([_0x53985c['data']],_0x2dccc2),0x0;}catch(_0x43aeed){if(_0x43aeed instanceof SDKError)return console['error'](_0x533141(0x1c3)+_0x43aeed[_0x533141(0x1c2)]),_0x43aeed[_0x533141(0x1f6)]&&console[_0x533141(0x1d0)](_0x533141(0x174)+_0x43aeed['cause']),0x1;throw _0x43aeed;}}}export class SegmentSQLCommand extends BaseCommand{['name']=a28_0x4aabba(0x1af);[a28_0x4aabba(0x161)]='Get\x20SQL\x20query\x20for\x20child\x20segment';async[a28_0x4aabba(0x1da)](_0xf0f6c1){const _0x24b7e3=a28_0x4aabba,{options:_0x1fd6f3,args:_0x301421,tdx:_0x9b927a}=_0xf0f6c1,_0xf935d=_0x301421[0x0];if(!_0xf935d)return console[_0x24b7e3(0x1d0)](_0x24b7e3(0x16b)),console['error'](_0x24b7e3(0x16e)),console[_0x24b7e3(0x1d0)](_0x24b7e3(0x19d)),console[_0x24b7e3(0x1d0)](_0x24b7e3(0x1e1)),console[_0x24b7e3(0x1d0)](_0x24b7e3(0x1d8)),console[_0x24b7e3(0x1d0)](_0x24b7e3(0x1d9)),0x1;try{const _0x228613=_0x1fd6f3[_0x24b7e3(0x1c7)],_0x534069=await resolveSegmentTarget(_0xf935d,_0x228613,_0x1fd6f3[_0x24b7e3(0x18c)]);_0x1fd6f3[_0x24b7e3(0x18c)]&&console['error'](_0x24b7e3(0x176)+_0x534069);const _0x442fd4=await withSpinner('Resolving\x20\x27'+_0xf935d+_0x24b7e3(0x1b8),()=>_0x9b927a['segment'][_0x24b7e3(0x17b)](_0x534069),{'verbose':_0x1fd6f3[_0x24b7e3(0x18c)]}),_0x521871=_0x442fd4[_0x24b7e3(0x1b5)];_0x1fd6f3[_0x24b7e3(0x18c)]&&(console[_0x24b7e3(0x1d0)](_0x24b7e3(0x1e7)+_0x521871[_0x24b7e3(0x19c)]),console[_0x24b7e3(0x1d0)](_0x24b7e3(0x194)+_0x521871['parentId']));if(_0x521871[_0x24b7e3(0x19c)]===_0x24b7e3(0x1f5))return console['error'](_0x24b7e3(0x1bf)),console[_0x24b7e3(0x1d0)](_0x24b7e3(0x196)),0x1;if(_0x521871[_0x24b7e3(0x19c)]===_0x24b7e3(0x18e))return console[_0x24b7e3(0x1d0)]('Error:\x20Cannot\x20get\x20SQL\x20for\x20parent\x20segment\x20with\x20this\x20command.'),console[_0x24b7e3(0x1d0)](_0x24b7e3(0x1de)),0x1;if(!_0x521871[_0x24b7e3(0x1c6)])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x24b7e3(0x17f));const _0x39f45a=await withSpinner(_0x24b7e3(0x1a5),()=>_0x9b927a[_0x24b7e3(0x1f0)][_0x24b7e3(0x1a8)](_0x521871[_0x24b7e3(0x1cd)],_0x521871[_0x24b7e3(0x1c6)]),{'verbose':_0x1fd6f3[_0x24b7e3(0x18c)]}),_0x4b7603=_0x39f45a[_0x24b7e3(0x1b5)];return _0x1fd6f3[_0x24b7e3(0x197)]===_0x24b7e3(0x1b1)||_0x1fd6f3[_0x24b7e3(0x197)]===_0x24b7e3(0x1e8)?await handleSDKOutput([{'sql':_0x4b7603}],_0x1fd6f3):console[_0x24b7e3(0x1ac)](_0x4b7603),0x0;}catch(_0x34140d){if(_0x34140d instanceof SDKError)return console[_0x24b7e3(0x1d0)](_0x24b7e3(0x1c3)+_0x34140d[_0x24b7e3(0x1c2)]),_0x34140d['cause']&&console[_0x24b7e3(0x1d0)](_0x24b7e3(0x174)+_0x34140d['cause']),0x1;throw _0x34140d;}}}export class SegmentFolderCreateCommand extends BaseCommand{[a28_0x4aabba(0x1a4)]=a28_0x4aabba(0x1a7);[a28_0x4aabba(0x161)]=a28_0x4aabba(0x189);async[a28_0x4aabba(0x1da)](_0x235f25){const _0xd47028=a28_0x4aabba,{options:_0x1d8019,args:_0x5b3dd6,tdx:_0x1a3b68}=_0x235f25,_0x3511e7=_0x1d8019;if(_0x5b3dd6[_0xd47028(0x178)]<0x2)return console[_0xd47028(0x1d0)](_0xd47028(0x1a1)),console[_0xd47028(0x1d0)](_0xd47028(0x1b0)),0x1;const _0x386b53=_0x5b3dd6[0x0],_0x2255e0=_0x5b3dd6[0x1];_0x3511e7[_0xd47028(0x18c)]&&(console[_0xd47028(0x1d0)]('Site:\x20'+_0x3511e7[_0xd47028(0x1e6)]),console[_0xd47028(0x1d0)](_0xd47028(0x1d4)+_0x386b53),console[_0xd47028(0x1d0)]('Folder\x20name:\x20'+_0x2255e0));let _0x1f34f6;if(_0x3511e7[_0xd47028(0x1e0)]){const _0x36149d=_0x3511e7[_0xd47028(0x1e0)],_0x460513=await withSpinner(_0xd47028(0x182)+_0x386b53+'\x27...',()=>_0x1a3b68[_0xd47028(0x1f0)][_0xd47028(0x1bc)](_0x386b53),{'verbose':_0x3511e7[_0xd47028(0x18c)]}),_0x51d55d=_0x460513[_0xd47028(0x1b5)],_0x341d41=await withSpinner('Resolving\x20parent\x20folder\x20\x27'+_0x36149d+_0xd47028(0x1b8),()=>_0x1a3b68[_0xd47028(0x1f0)]['resolveFolderId'](_0x51d55d,_0x36149d),{'verbose':_0x3511e7[_0xd47028(0x18c)]});_0x1f34f6=_0x341d41[_0xd47028(0x1b5)],_0x3511e7[_0xd47028(0x18c)]&&console[_0xd47028(0x1d0)](_0xd47028(0x199)+_0x1f34f6);}const _0x498124={'name':_0x2255e0,'description':_0x3511e7[_0xd47028(0x161)],'parentFolderId':_0x1f34f6},_0x2fb56f=await withSpinner(_0xd47028(0x19e)+_0x2255e0+_0xd47028(0x1b8),()=>_0x1a3b68['segment'][_0xd47028(0x1cf)](_0x386b53,_0x498124),{'verbose':_0x3511e7[_0xd47028(0x18c)]}),_0x4ba0b7=_0x2fb56f[_0xd47028(0x1b5)];return console[_0xd47028(0x1d0)](_0xd47028(0x1a0)+_0x4ba0b7['name']+'\x27\x20with\x20ID:\x20'+_0x4ba0b7['id']),await handleSDKOutput([_0x4ba0b7],_0x3511e7),0x0;}}function a28_0x11aa(_0x64645a,_0x105fe6){_0x64645a=_0x64645a-0x15f;const _0x5d1a66=a28_0x5d1a();let _0x11aa77=_0x5d1a66[_0x64645a];return _0x11aa77;}function a28_0x5d1a(){const _0x23632d=['folderId','SQL\x20query:\x0a','Parent\x20name:\x20','elapsedTimeMillis','Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required','Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)','test','Usage:\x20tdx\x20sg\x20sql\x20<name>','1917000VDNewF','Folder\x20ID:\x20','includes','getSegment','\x20\x20tdx\x20sg\x20show\x20\x22Premium\x20Users\x22','\x20\x20Cause:\x20','segmentName','Target\x20path:\x20','List\x20segment\x20folders\x20under\x20a\x20parent\x20segment','length','29899590xoUxtt','/app/ps/','resolvePathToResource','\x20\x20tdx\x20sg\x20show\x20segments/my-audience/premium-users.yml','12466008flXJkN','Executing\x20segment\x20query...','Segment\x20ID\x20missing\x20from\x20resolved\x20path','βœ”\x20Query\x20completed:\x20Processed\x20','Error:\x20Cannot\x20view\x20parent\x20segment\x20details\x20with\x20this\x20command.','Resolving\x20parent\x20segment\x20\x27','Site:\x20','query','Fetching\x20parent\x20segment\x20details...','Resolved\x20relative\x20path\x20to:\x20','\x20\x20tdx\x20sg\x20view\x20segments/my-audience/premium-users.yml','Resolving\x20folder\x20\x27','Create\x20segment\x20folder\x20for\x20organization','segment:show','limit','verbose','157283XOublg','parent','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20show\x20<path/to/segment.yml>','resolveFolderId','Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>','jobId','1003974TViDuy','Parent\x20ID:\x20','279326mxzhSX','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','format','\x20folder','Resolved\x20parent\x20folder\x20ID:\x20','INVALID_ARGUMENT','Segment\x20ID:\x20','type','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20sql\x20<path/to/segment.yml>','Creating\x20folder\x20\x27','\x20[Job\x20ID:\x20','βœ”\x20Created\x20folder\x20\x27','Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required','in\x20','setJobId','name','Fetching\x20SQL\x20for\x20segment...','Listing\x20folders\x20for\x20parent\x20\x27','segment:folder:create','getSegmentSQL','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20view\x20<path/to/segment.yml>','Folder\x20name:\x20','272qQCVmE','log','Error:\x20Cannot\x20open\x20parent\x20segment\x20with\x20this\x20command.','Use:\x20tdx\x20ps\x20view\x20-w','segment:sql','Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]','json','\x20\x20Segment\x20name:\x20','\x20\x20tdx\x20sg\x20view\x20\x22Marketing\x22\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20folder\x20details','getFolder','data','\x20Opening\x20','500662HdWGjy','\x27...','SEGMENT_NOT_FOUND','Show\x20segment\x20folder\x20details','Fetching\x20folder\x20details...','resolveParentId','βœ”\x20Found\x20','Resolved\x20YAML\x20file:\x20','Error:\x20Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.','33lHbJjW','Error:\x20Folder\x20reference\x20is\x20required','message','Error:\x20','Fetching\x20segment\x20details...','Use:\x20tdx\x20ps\x20desc','segmentId','parentSegment','Error:\x20Path\x20or\x20name\x20is\x20required','(root)','Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.','Use:\x20tdx\x20ps\x20show','segment:describe','parentId','cyan','createFolder','error','stats','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20-w\x20\x20#\x20Open\x20segment\x20in\x20web\x20browser','code','Parent\x20segment:\x20','SELECT\x20*\x20FROM\x20(\x0a','βœ–\x20Query\x20failed\x20[','Usage:\x20tdx\x20sg\x20view\x20<name>\x20[-w]','\x20\x20tdx\x20sg\x20sql\x20\x22Premium\x20Users\x22','\x20\x20tdx\x20sg\x20sql\x20segments/my-audience/premium-users.yml','execute','Usage:\x20tdx\x20segment\x20describe\x20<path>','\x20\x20tdx\x20sg\x20desc\x20\x22Premium\x20Users\x22','getParent','Use:\x20tdx\x20ps\x20sql','/e/','parentFolder','Examples:','Resolving\x20\x27','segment:folder:show','url','Usage:\x20tdx\x20sg\x20desc\x20<name>','site','Resolved\x20type:\x20','jsonl','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20\x20\x20\x20\x20#\x20View\x20child\x20segment\x20details','\x20rows\x20','Usage:\x20tdx\x20sg\x20show\x20<name>','Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>','toLocaleString','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','Fetching\x20folder\x20\x27','segment','segmentPath','listFolders','20jRPpnP','segment:folder:list','folder','cause','\x20\x20Full\x20path:\x20','Folder\x20ID\x20missing\x20from\x20resolved\x20path','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22','web','fullPath','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22','green','Error:\x20Folder\x20or\x20segment\x20name,\x20or\x20YAML\x20file\x20path\x20is\x20required','Execute\x20child\x20segment\x20SQL\x20query\x20and\x20show\x20results','description','Resolved\x20parent\x20ID:\x20','segment:view','Error:\x20Cannot\x20show\x20schema\x20for\x20a\x20folder.','Use:\x20tdx\x20ps\x20view','information_schema'];a28_0x5d1a=function(){return _0x23632d;};return a28_0x5d1a();}export class SegmentViewCommand extends BaseCommand{[a28_0x4aabba(0x1a4)]=a28_0x4aabba(0x163);['description']='Show\x20folder\x20or\x20child\x20segment\x20details';async[a28_0x4aabba(0x1da)](_0xbc676){const _0x1bf912=a28_0x4aabba,{options:_0x47b49c,args:_0x1955f7,tdx:_0x676d89}=_0xbc676,_0x37741c=_0x1955f7[0x0];if(!_0x37741c)return console[_0x1bf912(0x1d0)](_0x1bf912(0x15f)),console['error'](_0x1bf912(0x1d7)),console[_0x1bf912(0x1d0)](_0x1bf912(0x1a9)),console['error']('Options:'),console[_0x1bf912(0x1d0)]('\x20\x20-w,\x20--web\x20\x20Open\x20segment\x20in\x20web\x20browser'),console[_0x1bf912(0x1d0)](_0x1bf912(0x1e1)),console[_0x1bf912(0x1d0)](_0x1bf912(0x1b3)),console[_0x1bf912(0x1d0)](_0x1bf912(0x1e9)),console['error'](_0x1bf912(0x1d2)),console[_0x1bf912(0x1d0)](_0x1bf912(0x187)),0x1;try{const _0x3a1975=_0x47b49c[_0x1bf912(0x1c7)],_0x124b27=await resolveSegmentTarget(_0x37741c,_0x3a1975,_0x47b49c['verbose']);_0x47b49c[_0x1bf912(0x18c)]&&console[_0x1bf912(0x1d0)](_0x1bf912(0x176)+_0x124b27);const _0x52ee39=await withSpinner(_0x1bf912(0x1e2)+_0x37741c+_0x1bf912(0x1b8),()=>_0x676d89[_0x1bf912(0x1f0)][_0x1bf912(0x17b)](_0x124b27),{'verbose':_0x47b49c['verbose']}),_0x2ddb3c=_0x52ee39['data'];_0x47b49c[_0x1bf912(0x18c)]&&(console[_0x1bf912(0x1d0)](_0x1bf912(0x1e7)+_0x2ddb3c[_0x1bf912(0x19c)]),console[_0x1bf912(0x1d0)](_0x1bf912(0x194)+_0x2ddb3c[_0x1bf912(0x1cd)]),_0x2ddb3c['folderId']&&console[_0x1bf912(0x1d0)](_0x1bf912(0x170)+_0x2ddb3c[_0x1bf912(0x167)]),_0x2ddb3c[_0x1bf912(0x1c6)]&&console[_0x1bf912(0x1d0)](_0x1bf912(0x19b)+_0x2ddb3c[_0x1bf912(0x1c6)]));if(_0x47b49c[_0x1bf912(0x1fa)]){if(_0x2ddb3c[_0x1bf912(0x19c)]==='folder')return console[_0x1bf912(0x1d0)]('Error:\x20Cannot\x20open\x20folder\x20in\x20web\x20browser.\x20Use\x20a\x20segment\x20name\x20instead.'),0x1;if(_0x2ddb3c[_0x1bf912(0x19c)]===_0x1bf912(0x18e))return console[_0x1bf912(0x1d0)](_0x1bf912(0x1ad)),console[_0x1bf912(0x1d0)](_0x1bf912(0x1ae)),0x1;if(!_0x2ddb3c[_0x1bf912(0x1c6)])throw new SDKError(ErrorCode[_0x1bf912(0x1b9)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x257db3=getConsoleNextUrl(_0x47b49c[_0x1bf912(0x1e6)],_0x1bf912(0x17a)+_0x2ddb3c['parentId']+_0x1bf912(0x1df)+_0x2ddb3c[_0x1bf912(0x1c6)]);return console['error'](a28_0x16e550[_0x1bf912(0x1fd)]('βœ”')+_0x1bf912(0x1b6)+a28_0x16e550[_0x1bf912(0x1ce)](_0x257db3)),openBrowser(_0x257db3),0x0;}if(_0x2ddb3c[_0x1bf912(0x19c)]===_0x1bf912(0x1f5)){if(!_0x2ddb3c['folderId'])throw new SDKError(ErrorCode['SEGMENT_FOLDER_NOT_FOUND'],_0x1bf912(0x1f8));const _0x58879b=await withSpinner('Fetching\x20folder\x20details...',()=>_0x676d89[_0x1bf912(0x1f0)][_0x1bf912(0x1b4)](_0x2ddb3c[_0x1bf912(0x167)]),{'verbose':_0x47b49c['verbose']});await handleSingleObjectOutput(_0x58879b[_0x1bf912(0x1b5)],_0x47b49c);}else{if(_0x2ddb3c[_0x1bf912(0x19c)]===_0x1bf912(0x1f0)){if(!_0x2ddb3c[_0x1bf912(0x1c6)])throw new SDKError(ErrorCode[_0x1bf912(0x1b9)],_0x1bf912(0x17f));const _0x17bcb0=await withSpinner(_0x1bf912(0x1c4),()=>_0x676d89[_0x1bf912(0x1f0)][_0x1bf912(0x172)](_0x2ddb3c['parentId'],_0x2ddb3c[_0x1bf912(0x1c6)]),{'verbose':_0x47b49c[_0x1bf912(0x18c)]}),_0x511009=getConsoleNextUrl(_0x47b49c[_0x1bf912(0x1e6)],_0x1bf912(0x17a)+_0x2ddb3c[_0x1bf912(0x1cd)]+'/e/'+_0x2ddb3c[_0x1bf912(0x1c6)]),_0x511226=_0x17bcb0[_0x1bf912(0x1b5)];_0x511226[_0x1bf912(0x1e4)]=_0x511009,await handleSingleObjectOutput(_0x511226,_0x47b49c);}else return console[_0x1bf912(0x1d0)](_0x1bf912(0x181)),console[_0x1bf912(0x1d0)](_0x1bf912(0x165)),0x1;}return 0x0;}catch(_0x3504df){if(_0x3504df instanceof SDKError)return console[_0x1bf912(0x1d0)](_0x1bf912(0x1c3)+_0x3504df[_0x1bf912(0x1c2)]),_0x3504df[_0x1bf912(0x1f6)]&&console['error'](_0x1bf912(0x174)+_0x3504df[_0x1bf912(0x1f6)]),0x1;throw _0x3504df;}}}export const SegmentInfoCommand=SegmentViewCommand;export class SegmentDescCommand extends BaseCommand{[a28_0x4aabba(0x1a4)]='segment:desc';[a28_0x4aabba(0x161)]='Show\x20child\x20segment\x20schema\x20(column\x20types)';async[a28_0x4aabba(0x1da)](_0x6b81d7){const _0x3f569a=a28_0x4aabba,{options:_0x32112f,args:_0x1a41e6,tdx:_0x16b083}=_0x6b81d7,_0x1dca92=_0x1a41e6[0x0];if(!_0x1dca92)return console[_0x3f569a(0x1d0)](_0x3f569a(0x16b)),console[_0x3f569a(0x1d0)](_0x3f569a(0x1e5)),console[_0x3f569a(0x1d0)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20desc\x20<path/to/segment.yml>'),console['error'](_0x3f569a(0x1e1)),console[_0x3f569a(0x1d0)](_0x3f569a(0x1dc)),console['error']('\x20\x20tdx\x20sg\x20desc\x20segments/my-audience/premium-users.yml'),0x1;try{const _0x129c78=_0x32112f['parentSegment'],_0x5ecbfd=await resolveSegmentTarget(_0x1dca92,_0x129c78,_0x32112f[_0x3f569a(0x18c)]);_0x32112f[_0x3f569a(0x18c)]&&console[_0x3f569a(0x1d0)](_0x3f569a(0x176)+_0x5ecbfd);const _0x555b2f=await withSpinner(_0x3f569a(0x1e2)+_0x1dca92+_0x3f569a(0x1b8),()=>_0x16b083[_0x3f569a(0x1f0)][_0x3f569a(0x17b)](_0x5ecbfd),{'verbose':_0x32112f[_0x3f569a(0x18c)]}),_0x48a17f=_0x555b2f[_0x3f569a(0x1b5)];_0x32112f[_0x3f569a(0x18c)]&&(console[_0x3f569a(0x1d0)]('Resolved\x20type:\x20'+_0x48a17f[_0x3f569a(0x19c)]),console['error'](_0x3f569a(0x194)+_0x48a17f[_0x3f569a(0x1cd)]));if(_0x48a17f[_0x3f569a(0x19c)]===_0x3f569a(0x1f5))return console[_0x3f569a(0x1d0)](_0x3f569a(0x164)),console[_0x3f569a(0x1d0)]('Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.'),0x1;if(_0x48a17f[_0x3f569a(0x19c)]==='parent')return console[_0x3f569a(0x1d0)]('Error:\x20Cannot\x20show\x20schema\x20for\x20parent\x20segment\x20with\x20this\x20command.'),console[_0x3f569a(0x1d0)](_0x3f569a(0x1c5)),0x1;if(!_0x48a17f[_0x3f569a(0x1c6)])throw new SDKError(ErrorCode[_0x3f569a(0x1b9)],_0x3f569a(0x17f));const _0x23744e=await withSpinner(_0x3f569a(0x1a5),()=>_0x16b083[_0x3f569a(0x1f0)][_0x3f569a(0x1a8)](_0x48a17f[_0x3f569a(0x1cd)],_0x48a17f[_0x3f569a(0x1c6)]),{'verbose':_0x32112f[_0x3f569a(0x18c)]}),_0x1d3c0e=_0x23744e[_0x3f569a(0x1b5)],_0x52b73c=await executeSchemaQuery(_0x1d3c0e,_0x16b083,_0x32112f);return await handleQueryOutput(_0x52b73c,_0x32112f),0x0;}catch(_0x3b3c9c){if(_0x3b3c9c instanceof SDKError)return console[_0x3f569a(0x1d0)](_0x3f569a(0x1c3)+_0x3b3c9c[_0x3f569a(0x1c2)]),_0x3b3c9c[_0x3f569a(0x1f6)]&&console[_0x3f569a(0x1d0)](_0x3f569a(0x174)+_0x3b3c9c[_0x3f569a(0x1f6)]),0x1;throw _0x3b3c9c;}}}
@@ -1 +1 @@
1
- function a29_0x28d9(){const _0x3e0f7c=['\x20\x20\x20Path:\x20','Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.','114112kuCjym','Resolved\x20relative\x20path\x20to:\x20','verbose','Parent\x20path:\x20','description','Parent:\x20','375fmgjgs','segment','Site:\x20','name','\x27...','Examples:','segmentPath','kind','βœ”\x20Created\x20segment\x20\x27','resolveParentId','Target\x20path:\x20','segment:create','Segment\x20name:\x20','231882AXrpor','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27','folder','Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]','rule','Resolved\x20folder\x20ID:\x20','Resolving\x20parent\x20segment\x20\x27','6mCvUWe','Resolving\x20folder\x20path\x20\x27','ruleFile','data','length','3785928RFDDFZ','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','403291mPezIv','noCountPopulation','26736AAoqqo','createSegment','type','error','site','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','⚠\x20Deprecation\x20warning:\x20`segment\x20create`\x20is\x20deprecated.','830mkOmFU','segments','1719117YTqrKC','yellow','folderId','103563dsITVY','Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]','parent','resolvePathToResource'];a29_0x28d9=function(){return _0x3e0f7c;};return a29_0x28d9();}function a29_0x5a63(_0xdbe01d,_0x2b4c3e){_0xdbe01d=_0xdbe01d-0x185;const _0x28d974=a29_0x28d9();let _0x5a63d3=_0x28d974[_0xdbe01d];return _0x5a63d3;}const a29_0x474677=a29_0x5a63;(function(_0x2e93d5,_0x22e9f7){const _0x1a3f38=a29_0x5a63,_0x4d7f40=_0x2e93d5();while(!![]){try{const _0x1934c7=-parseInt(_0x1a3f38(0x18d))/0x1*(parseInt(_0x1a3f38(0x1a8))/0x2)+parseInt(_0x1a3f38(0x19f))/0x3+-parseInt(_0x1a3f38(0x196))/0x4*(parseInt(_0x1a3f38(0x1ae))/0x5)+parseInt(_0x1a3f38(0x186))/0x6+parseInt(_0x1a3f38(0x194))/0x7+-parseInt(_0x1a3f38(0x192))/0x8+parseInt(_0x1a3f38(0x1a2))/0x9*(parseInt(_0x1a3f38(0x19d))/0xa);if(_0x1934c7===_0x22e9f7)break;else _0x4d7f40['push'](_0x4d7f40['shift']());}catch(_0x22defa){_0x4d7f40['push'](_0x4d7f40['shift']());}}}(a29_0x28d9,0x4b12f));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{parsePath,getParentPath,getBaseName}from'../sdk/segment/segment-path-parser.js';import a29_0x2edec2 from'chalk';export class SegmentCreateCommand extends BaseCommand{[a29_0x474677(0x1b1)]=a29_0x474677(0x1b9);[a29_0x474677(0x1ac)]='Create\x20child\x20segment\x20with\x20filtering\x20rules';async['execute'](_0x5cf47f){const _0x5b9a46=a29_0x474677;console[_0x5b9a46(0x199)](a29_0x2edec2[_0x5b9a46(0x1a0)](_0x5b9a46(0x19c))),console[_0x5b9a46(0x199)](a29_0x2edec2[_0x5b9a46(0x1a0)](_0x5b9a46(0x193)));const {options:_0x213639,args:_0x326bdf,tdx:_0x130ee3}=_0x5cf47f,_0x4b64f1=_0x213639;if(_0x326bdf[_0x5b9a46(0x191)]===0x0)return console[_0x5b9a46(0x199)](_0x5b9a46(0x19b)),console[_0x5b9a46(0x199)](_0x5b9a46(0x1a3)),console[_0x5b9a46(0x199)](_0x5b9a46(0x1b3)),console[_0x5b9a46(0x199)](_0x5b9a46(0x187)),console['error']('\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27'),console[_0x5b9a46(0x199)]('\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context'),0x1;const _0x1a8afc=_0x326bdf[0x0],_0x38ada2=_0x213639[_0x5b9a46(0x1b4)];let _0x58416e=_0x1a8afc;_0x38ada2&&!_0x1a8afc['includes']('/')&&(_0x58416e=_0x38ada2+'/'+_0x1a8afc,_0x4b64f1['verbose']&&console[_0x5b9a46(0x199)](_0x5b9a46(0x1a9)+_0x58416e));const _0x334998=parsePath(_0x58416e);if(_0x334998[_0x5b9a46(0x19e)][_0x5b9a46(0x191)]<0x2)return console[_0x5b9a46(0x199)]('Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)'),console[_0x5b9a46(0x199)](_0x5b9a46(0x189)),0x1;const _0x19f28a=_0x334998[_0x5b9a46(0x19e)][0x0],_0x19a2a3=getBaseName(_0x58416e),_0x467fe5=getParentPath(_0x58416e);_0x4b64f1[_0x5b9a46(0x1aa)]&&(console[_0x5b9a46(0x199)](_0x5b9a46(0x1b0)+_0x4b64f1[_0x5b9a46(0x19a)]),console[_0x5b9a46(0x199)](_0x5b9a46(0x1b8)+_0x58416e),console['error'](_0x5b9a46(0x1ad)+_0x19f28a),console[_0x5b9a46(0x199)](_0x5b9a46(0x185)+_0x19a2a3),console[_0x5b9a46(0x199)](_0x5b9a46(0x1ab)+_0x467fe5));const _0x42cf45=await withSpinner(_0x5b9a46(0x18c)+_0x19f28a+'\x27...',()=>_0x130ee3[_0x5b9a46(0x1af)][_0x5b9a46(0x1b7)](_0x19f28a),{'verbose':_0x4b64f1[_0x5b9a46(0x1aa)]}),_0xf1a7e3=_0x42cf45[_0x5b9a46(0x190)];let _0x358485;if(_0x334998['segments'][_0x5b9a46(0x191)]>0x2){const _0x1bdd6c=await withSpinner(_0x5b9a46(0x18e)+_0x467fe5+_0x5b9a46(0x1b2),()=>_0x130ee3[_0x5b9a46(0x1af)][_0x5b9a46(0x1a5)](_0x467fe5),{'verbose':_0x4b64f1[_0x5b9a46(0x1aa)]}),_0x1b3439=_0x1bdd6c[_0x5b9a46(0x190)];if(_0x1b3439[_0x5b9a46(0x198)]!=='folder'&&_0x1b3439['type']!==_0x5b9a46(0x1a4))return console[_0x5b9a46(0x199)](_0x5b9a46(0x1a7)),0x1;_0x358485=_0x1b3439[_0x5b9a46(0x1a1)];}else{if(_0x4b64f1[_0x5b9a46(0x188)]){const _0x4a9a93=await withSpinner('Resolving\x20folder\x20\x27'+_0x4b64f1[_0x5b9a46(0x188)]+_0x5b9a46(0x1b2),()=>_0x130ee3[_0x5b9a46(0x1af)]['resolveFolderId'](_0xf1a7e3,_0x4b64f1[_0x5b9a46(0x188)]),{'verbose':_0x4b64f1[_0x5b9a46(0x1aa)]});_0x358485=_0x4a9a93[_0x5b9a46(0x190)];}}_0x4b64f1['verbose']&&_0x358485&&console[_0x5b9a46(0x199)](_0x5b9a46(0x18b)+_0x358485);const _0x1676bc=await loadJSONFromOptions(_0x4b64f1[_0x5b9a46(0x18a)],_0x4b64f1[_0x5b9a46(0x18f)]),_0x37c0a6={'name':_0x19a2a3,'description':_0x4b64f1['description'],'rule':_0x1676bc,'kind':_0x4b64f1[_0x5b9a46(0x1b5)]!==undefined?parseInt(_0x4b64f1['kind'],0xa):undefined,'isVisible':_0x4b64f1['invisible']?![]:undefined,'segmentFolderId':_0x358485,'countPopulation':_0x4b64f1[_0x5b9a46(0x195)]?![]:undefined},_0x4242a7=await withSpinner('Creating\x20segment\x20\x27'+_0x19a2a3+_0x5b9a46(0x1b2),()=>_0x130ee3[_0x5b9a46(0x1af)][_0x5b9a46(0x197)](_0xf1a7e3,_0x37c0a6),{'verbose':_0x4b64f1[_0x5b9a46(0x1aa)]}),_0x136221=_0x4242a7[_0x5b9a46(0x190)];return console[_0x5b9a46(0x199)](_0x5b9a46(0x1b6)+_0x136221[_0x5b9a46(0x1b1)]+'\x27\x20with\x20ID:\x20'+_0x136221['id']),_0x58416e!==_0x1a8afc&&console[_0x5b9a46(0x199)](_0x5b9a46(0x1a6)+_0x58416e),await handleSDKOutput([_0x136221],_0x4b64f1),0x0;}}
1
+ const a29_0x9569de=a29_0x21c6;(function(_0x2c1145,_0x3efc9d){const _0x2fba56=a29_0x21c6,_0x58444d=_0x2c1145();while(!![]){try{const _0x3a2be7=-parseInt(_0x2fba56(0x12a))/0x1+parseInt(_0x2fba56(0x132))/0x2+parseInt(_0x2fba56(0x123))/0x3*(-parseInt(_0x2fba56(0x125))/0x4)+parseInt(_0x2fba56(0x13d))/0x5*(parseInt(_0x2fba56(0x134))/0x6)+parseInt(_0x2fba56(0x14e))/0x7+parseInt(_0x2fba56(0x119))/0x8+-parseInt(_0x2fba56(0x141))/0x9*(parseInt(_0x2fba56(0x128))/0xa);if(_0x3a2be7===_0x3efc9d)break;else _0x58444d['push'](_0x58444d['shift']());}catch(_0x5d46b9){_0x58444d['push'](_0x58444d['shift']());}}}(a29_0x5036,0xad13b));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 a29_0x5036(){const _0x5aed8c=['yellow','Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.','5119135YOkACU','kind','10209376DVZZcg','description','execute','parent','Resolved\x20relative\x20path\x20to:\x20','includes','ruleFile','segment','segment:create','length','24qjAHPZ','Resolving\x20folder\x20path\x20\x27','68088XLzzic','Parent\x20path:\x20','data','12420570dPQDEn','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','285559YZOYvl','Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]','site','resolveParentId','invisible','segments','noCountPopulation','createSegment','902476GGNgrR','Segment\x20name:\x20','6iAcQnv','βœ”\x20Created\x20segment\x20\x27','resolveFolderId','Target\x20path:\x20','Create\x20child\x20segment\x20with\x20filtering\x20rules','Resolving\x20parent\x20segment\x20\x27','\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','folder','rule','5780285dJDYsg','\x27...','Resolved\x20folder\x20ID:\x20','Site:\x20','18rUXFGf','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','name','resolvePathToResource','\x27\x20with\x20ID:\x20','⚠\x20Deprecation\x20warning:\x20`segment\x20create`\x20is\x20deprecated.','Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)','verbose','folderId','error','Parent:\x20'];a29_0x5036=function(){return _0x5aed8c;};return a29_0x5036();}import{parsePath,getParentPath,getBaseName}from'../sdk/segment/segment-path-parser.js';import a29_0x2ac491 from'chalk';function a29_0x21c6(_0x241a96,_0x2dad50){_0x241a96=_0x241a96-0x118;const _0x5036c8=a29_0x5036();let _0x21c654=_0x5036c8[_0x241a96];return _0x21c654;}export class SegmentCreateCommand extends BaseCommand{['name']=a29_0x9569de(0x121);[a29_0x9569de(0x11a)]=a29_0x9569de(0x138);async[a29_0x9569de(0x11b)](_0x188f7e){const _0x1dff93=a29_0x9569de;console['error'](a29_0x2ac491[_0x1dff93(0x14c)](_0x1dff93(0x146))),console['error'](a29_0x2ac491[_0x1dff93(0x14c)](_0x1dff93(0x129)));const {options:_0x426833,args:_0x5e244f,tdx:_0x55ed77}=_0x188f7e,_0x42f4f8=_0x426833;if(_0x5e244f[_0x1dff93(0x122)]===0x0)return console[_0x1dff93(0x14a)](_0x1dff93(0x142)),console[_0x1dff93(0x14a)](_0x1dff93(0x12b)),console['error']('Examples:'),console['error']('\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27'),console[_0x1dff93(0x14a)]('\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27'),console[_0x1dff93(0x14a)](_0x1dff93(0x13a)),0x1;const _0x859b02=_0x5e244f[0x0],_0x491796=_0x426833['segmentPath'];let _0x4cebf0=_0x859b02;_0x491796&&!_0x859b02[_0x1dff93(0x11e)]('/')&&(_0x4cebf0=_0x491796+'/'+_0x859b02,_0x42f4f8[_0x1dff93(0x148)]&&console[_0x1dff93(0x14a)](_0x1dff93(0x11d)+_0x4cebf0));const _0x4d8a07=parsePath(_0x4cebf0);if(_0x4d8a07[_0x1dff93(0x12f)][_0x1dff93(0x122)]<0x2)return console[_0x1dff93(0x14a)](_0x1dff93(0x147)),console[_0x1dff93(0x14a)]('Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]'),0x1;const _0x5697fe=_0x4d8a07['segments'][0x0],_0x71cc72=getBaseName(_0x4cebf0),_0x2bc906=getParentPath(_0x4cebf0);_0x42f4f8['verbose']&&(console[_0x1dff93(0x14a)](_0x1dff93(0x140)+_0x42f4f8[_0x1dff93(0x12c)]),console['error'](_0x1dff93(0x137)+_0x4cebf0),console[_0x1dff93(0x14a)](_0x1dff93(0x14b)+_0x5697fe),console[_0x1dff93(0x14a)](_0x1dff93(0x133)+_0x71cc72),console['error'](_0x1dff93(0x126)+_0x2bc906));const _0xdabfa5=await withSpinner(_0x1dff93(0x139)+_0x5697fe+_0x1dff93(0x13e),()=>_0x55ed77[_0x1dff93(0x120)][_0x1dff93(0x12d)](_0x5697fe),{'verbose':_0x42f4f8[_0x1dff93(0x148)]}),_0x3e20a0=_0xdabfa5['data'];let _0x577a56;if(_0x4d8a07[_0x1dff93(0x12f)][_0x1dff93(0x122)]>0x2){const _0x124aa7=await withSpinner(_0x1dff93(0x124)+_0x2bc906+_0x1dff93(0x13e),()=>_0x55ed77[_0x1dff93(0x120)][_0x1dff93(0x144)](_0x2bc906),{'verbose':_0x42f4f8['verbose']}),_0x5daf92=_0x124aa7[_0x1dff93(0x127)];if(_0x5daf92['type']!==_0x1dff93(0x13b)&&_0x5daf92['type']!==_0x1dff93(0x11c))return console[_0x1dff93(0x14a)](_0x1dff93(0x14d)),0x1;_0x577a56=_0x5daf92[_0x1dff93(0x149)];}else{if(_0x42f4f8['folder']){const _0x47f779=await withSpinner('Resolving\x20folder\x20\x27'+_0x42f4f8[_0x1dff93(0x13b)]+_0x1dff93(0x13e),()=>_0x55ed77[_0x1dff93(0x120)][_0x1dff93(0x136)](_0x3e20a0,_0x42f4f8[_0x1dff93(0x13b)]),{'verbose':_0x42f4f8['verbose']});_0x577a56=_0x47f779[_0x1dff93(0x127)];}}_0x42f4f8[_0x1dff93(0x148)]&&_0x577a56&&console[_0x1dff93(0x14a)](_0x1dff93(0x13f)+_0x577a56);const _0xa18358=await loadJSONFromOptions(_0x42f4f8[_0x1dff93(0x13c)],_0x42f4f8[_0x1dff93(0x11f)]),_0x2e3dfd={'name':_0x71cc72,'description':_0x42f4f8[_0x1dff93(0x11a)],'rule':_0xa18358,'kind':_0x42f4f8[_0x1dff93(0x118)]!==undefined?parseInt(_0x42f4f8[_0x1dff93(0x118)],0xa):undefined,'isVisible':_0x42f4f8[_0x1dff93(0x12e)]?![]:undefined,'segmentFolderId':_0x577a56,'countPopulation':_0x42f4f8[_0x1dff93(0x130)]?![]:undefined},_0x38c47e=await withSpinner('Creating\x20segment\x20\x27'+_0x71cc72+_0x1dff93(0x13e),()=>_0x55ed77[_0x1dff93(0x120)][_0x1dff93(0x131)](_0x3e20a0,_0x2e3dfd),{'verbose':_0x42f4f8[_0x1dff93(0x148)]}),_0x44d1d7=_0x38c47e[_0x1dff93(0x127)];return console[_0x1dff93(0x14a)](_0x1dff93(0x135)+_0x44d1d7[_0x1dff93(0x143)]+_0x1dff93(0x145)+_0x44d1d7['id']),_0x4cebf0!==_0x859b02&&console[_0x1dff93(0x14a)]('\x20\x20\x20Path:\x20'+_0x4cebf0),await handleSDKOutput([_0x44d1d7],_0x42f4f8),0x0;}}
@@ -1 +1 @@
1
- function a30_0x3acb(_0x4948e5,_0x255d0d){_0x4948e5=_0x4948e5-0x130;const _0x2acddb=a30_0x2acd();let _0x3acb08=_0x2acddb[_0x4948e5];return _0x3acb08;}const a30_0x43e214=a30_0x3acb;(function(_0x241582,_0x3eded2){const _0x1e3620=a30_0x3acb,_0x22623f=_0x241582();while(!![]){try{const _0x1b97f9=parseInt(_0x1e3620(0x137))/0x1+parseInt(_0x1e3620(0x13d))/0x2+parseInt(_0x1e3620(0x142))/0x3+-parseInt(_0x1e3620(0x148))/0x4+parseInt(_0x1e3620(0x141))/0x5*(parseInt(_0x1e3620(0x146))/0x6)+-parseInt(_0x1e3620(0x133))/0x7*(-parseInt(_0x1e3620(0x14b))/0x8)+-parseInt(_0x1e3620(0x14a))/0x9*(parseInt(_0x1e3620(0x13b))/0xa);if(_0x1b97f9===_0x3eded2)break;else _0x22623f['push'](_0x22623f['shift']());}catch(_0x5bb90c){_0x22623f['push'](_0x22623f['shift']());}}}(a30_0x2acd,0xa2a81));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';function a30_0x2acd(){const _0x26ed05=['site','verbose','name','292932Bxvxty','Site:\x20','Listing\x20fields\x20for\x20\x27','data','20dRIStx','List\x20available\x20fields\x20for\x20segmentation','292942ZCdrVC','segment','length','segment:fields','5TvFade','1280712mvNoBY','description','json','\x27...','6627918jqGUBc','Error:\x20Parent\x20segment\x20name\x20is\x20required','471732Xjmpsl','parentSegment','9170721csMrdr','64VejexM','execute','error','jsonl','744758YhsijO'];a30_0x2acd=function(){return _0x26ed05;};return a30_0x2acd();}import{withSpinner}from'../utils/spinner.js';import{displayFieldsHumanReadable}from'../sdk/segment/fields-display.js';export class SegmentFieldsCommand extends BaseCommand{[a30_0x43e214(0x136)]=a30_0x43e214(0x140);[a30_0x43e214(0x143)]=a30_0x43e214(0x13c);async[a30_0x43e214(0x130)](_0x3711dd){const _0x382040=a30_0x43e214,{options:_0x4d080f,args:_0x3c6663,tdx:_0x1379e5}=_0x3711dd,_0x3ec3f7=_0x3c6663[0x0]||_0x4d080f[_0x382040(0x149)];if(!_0x3ec3f7)return console[_0x382040(0x131)](_0x382040(0x147)),console['error']('Usage:\x20tdx\x20segment\x20fields\x20<parent_name>'),console[_0x382040(0x131)]('\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>'),0x1;_0x4d080f[_0x382040(0x135)]&&(console[_0x382040(0x131)](_0x382040(0x138)+_0x4d080f[_0x382040(0x134)]),console[_0x382040(0x131)]('Parent\x20segment:\x20'+_0x3ec3f7));const _0x5b0154=await withSpinner(_0x382040(0x139)+_0x3ec3f7+_0x382040(0x145),()=>_0x1379e5[_0x382040(0x13e)]['listFields'](_0x3ec3f7),{'verbose':_0x4d080f[_0x382040(0x135)]}),_0x5e07e8=_0x5b0154[_0x382040(0x13a)];console[_0x382040(0x131)]('βœ”\x20Found\x20'+_0x5e07e8['length']+'\x20field'+(_0x5e07e8[_0x382040(0x13f)]!==0x1?'s':''));if(_0x4d080f[_0x382040(0x144)]||_0x4d080f[_0x382040(0x132)])return await handleSDKOutput(_0x5e07e8,_0x4d080f),0x0;return displayFieldsHumanReadable(_0x5e07e8,_0x3ec3f7),0x0;}}
1
+ const a30_0x5bd1d5=a30_0x2223;(function(_0x474988,_0x23491b){const _0x3b6af4=a30_0x2223,_0x1c0a06=_0x474988();while(!![]){try{const _0x5963c5=parseInt(_0x3b6af4(0xfd))/0x1*(-parseInt(_0x3b6af4(0xf8))/0x2)+parseInt(_0x3b6af4(0xfb))/0x3*(-parseInt(_0x3b6af4(0x100))/0x4)+parseInt(_0x3b6af4(0x10f))/0x5*(parseInt(_0x3b6af4(0xf5))/0x6)+parseInt(_0x3b6af4(0x10c))/0x7*(parseInt(_0x3b6af4(0x106))/0x8)+-parseInt(_0x3b6af4(0xfc))/0x9+-parseInt(_0x3b6af4(0x103))/0xa+parseInt(_0x3b6af4(0xfa))/0xb;if(_0x5963c5===_0x23491b)break;else _0x1c0a06['push'](_0x1c0a06['shift']());}catch(_0x51d25e){_0x1c0a06['push'](_0x1c0a06['shift']());}}}(a30_0x3a08,0x3758f));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';function a30_0x2223(_0x1ea77f,_0x166b25){_0x1ea77f=_0x1ea77f-0xf4;const _0x3a0837=a30_0x3a08();let _0x22232c=_0x3a0837[_0x1ea77f];return _0x22232c;}function a30_0x3a08(){const _0xe6135e=['error','259eEKerv','jsonl','execute','1819085KsxMGI','length','6cDSDQb','segment:fields','json','316676sUwVyT','\x20field','7120058RJwTNx','3jMvrMo','40293DuBVpX','1saQPEp','data','Error:\x20Parent\x20segment\x20name\x20is\x20required','1070596hIIaCf','verbose','Site:\x20','4102790SHLNnz','Usage:\x20tdx\x20segment\x20fields\x20<parent_name>','parentSegment','12184NJaYrl','\x27...','name','Parent\x20segment:\x20','List\x20available\x20fields\x20for\x20segmentation'];a30_0x3a08=function(){return _0xe6135e;};return a30_0x3a08();}import{displayFieldsHumanReadable}from'../sdk/segment/fields-display.js';export class SegmentFieldsCommand extends BaseCommand{[a30_0x5bd1d5(0x108)]=a30_0x5bd1d5(0xf6);['description']=a30_0x5bd1d5(0x10a);async[a30_0x5bd1d5(0x10e)](_0x11396e){const _0x472d28=a30_0x5bd1d5,{options:_0x5e63fc,args:_0x3cc454,tdx:_0x402475}=_0x11396e,_0x28b53b=_0x3cc454[0x0]||_0x5e63fc[_0x472d28(0x105)];if(!_0x28b53b)return console[_0x472d28(0x10b)](_0x472d28(0xff)),console[_0x472d28(0x10b)](_0x472d28(0x104)),console[_0x472d28(0x10b)]('\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>'),0x1;_0x5e63fc[_0x472d28(0x101)]&&(console['error'](_0x472d28(0x102)+_0x5e63fc['site']),console[_0x472d28(0x10b)](_0x472d28(0x109)+_0x28b53b));const _0x3fd91d=await withSpinner('Listing\x20fields\x20for\x20\x27'+_0x28b53b+_0x472d28(0x107),()=>_0x402475['segment']['listFields'](_0x28b53b),{'verbose':_0x5e63fc['verbose']}),_0x5978db=_0x3fd91d[_0x472d28(0xfe)];console['error']('βœ”\x20Found\x20'+_0x5978db[_0x472d28(0xf4)]+_0x472d28(0xf9)+(_0x5978db[_0x472d28(0xf4)]!==0x1?'s':''));if(_0x5e63fc[_0x472d28(0xf7)]||_0x5e63fc[_0x472d28(0x10d)])return await handleSDKOutput(_0x5978db,_0x5e63fc),0x0;return displayFieldsHumanReadable(_0x5978db,_0x28b53b),0x0;}}
@@ -1 +1 @@
1
- const a31_0x1f5227=a31_0x2222;(function(_0x137426,_0x351b23){const _0x2c99dd=a31_0x2222,_0x679ab9=_0x137426();while(!![]){try{const _0x239b7e=parseInt(_0x2c99dd(0xf3))/0x1*(parseInt(_0x2c99dd(0xeb))/0x2)+parseInt(_0x2c99dd(0xd0))/0x3+-parseInt(_0x2c99dd(0xfd))/0x4*(parseInt(_0x2c99dd(0xfc))/0x5)+-parseInt(_0x2c99dd(0xdb))/0x6+parseInt(_0x2c99dd(0xe8))/0x7*(parseInt(_0x2c99dd(0xc2))/0x8)+-parseInt(_0x2c99dd(0xfa))/0x9+-parseInt(_0x2c99dd(0xda))/0xa;if(_0x239b7e===_0x351b23)break;else _0x679ab9['push'](_0x679ab9['shift']());}catch(_0x48daaf){_0x679ab9['push'](_0x679ab9['shift']());}}}(a31_0x258a,0xbde6f));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{saveSessionContext}from'../core/session.js';import a31_0x13cb9e from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';function a31_0x2222(_0x1920a6,_0x55b89a){_0x1920a6=_0x1920a6-0xb7;const _0x258abd=a31_0x258a();let _0x2222d8=_0x258abd[_0x1920a6];return _0x2222d8;}import a31_0x3febc9 from'path';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';function a31_0x258a(){const _0x15b451=['35PBNfDV','execute','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','10OqxTMr','\x20with\x20','parentName','helpText','Target\x20resource:\x20','cwd','\x20=\x20','files','255681aqtCNO','-\x20no\x20files\x20written','yellow','\x20activations','\x20files\x20to\x20','red','green','2076129GBALyO','\x20unchanged\x20files','50Accplw','131168SRBzTb','\x20versions)','\x20journeys','βœ”\x20All\x20files\x20are\x20up\x20to\x20date','dim','activations','segment:pull','βœ”\x20Pulled\x20','\x20\x20πŸ—ΊοΈ\x20\x20','verbose','description','repeat','journeyVersions','segments','cyan','Write\x20','Aborted.','journeys','716024tkLLAm','absolutePath','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file','error','no_parent','targetDir','resourceName','dryRun','Error:\x20','relativePath','file','pullSegments','\x0aChanges\x20to\x20\x27','hasChanges','2266587tLfQqy','content','filter','data','yes','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)','name','\x0aError:','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent','Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files','11099880dMawHY','210126DyhbNA','utf-8','\x20files?','length','counts','\x0aPull\x20summary\x20for\x20\x27','diff','setPhase','isNew','session','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','\x20\x20🎯\x20','βœ”\x20Context\x20set:\x20'];a31_0x258a=function(){return _0x15b451;};return a31_0x258a();}export{buildFolderIdToPathMap as buildFolderPathMap}from'../sdk/segment/resolution-context.js';export class SegmentPullCommand extends BaseCommand{[a31_0x1f5227(0xd6)]=a31_0x1f5227(0x103);[a31_0x1f5227(0xba)]=a31_0x1f5227(0xd9);async[a31_0x1f5227(0xe9)](_0x30e3ad){const _0x4898a2=a31_0x1f5227,{options:_0x1aebcf,args:_0x1fe4ef,tdx:_0x3158b8}=_0x30e3ad,_0xe6762f=_0x1aebcf,_0x5a7636=await resolveTarget({'arg':_0x1fe4ef[0x0],'contextParent':_0x1aebcf['parentSegment'],'cwd':process[_0x4898a2(0xf0)]()});if(!isSuccessfulResolution(_0x5a7636))return _0x5a7636['errorCode']===_0x4898a2(0xc6)?(console[_0x4898a2(0xc5)](a31_0x13cb9e[_0x4898a2(0xf5)]('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console[_0x4898a2(0xc5)](_0x4898a2(0xd5)),console[_0x4898a2(0xc5)](_0x4898a2(0xd8)),console[_0x4898a2(0xc5)](_0x4898a2(0xc4))):(console[_0x4898a2(0xc5)](a31_0x13cb9e[_0x4898a2(0xf8)](_0x4898a2(0xca)+_0x5a7636['message']+'\x0a')),_0x5a7636[_0x4898a2(0xee)]&&console['error'](a31_0x13cb9e[_0x4898a2(0xbe)](_0x5a7636[_0x4898a2(0xee)]))),0x1;const _0x248974=_0x5a7636['parentName'],_0x43a1eb=_0x5a7636[_0x4898a2(0xc7)],_0x173394=_0x5a7636['type']===_0x4898a2(0xcc)?_0x5a7636[_0x4898a2(0xc8)]:undefined;_0xe6762f['verbose']&&(console['error']('Site:\x20'+_0xe6762f['site']),console[_0x4898a2(0xc5)]('Parent\x20segment:\x20'+_0x248974),_0x173394&&console[_0x4898a2(0xc5)](_0x4898a2(0xef)+_0x173394));const _0x41b053=await withProgressSpinner('Pulling\x20segments\x20from\x20\x27'+_0x248974+'\x27...',_0x49dc18=>_0x3158b8['segment'][_0x4898a2(0xcd)](_0x248974,{'targetDir':_0x43a1eb,'targetResourceName':_0x173394,'verbose':_0xe6762f[_0x4898a2(0xb9)],'progress':{'update':_0x3dd822=>{const _0xfee598=_0x4898a2;_0x49dc18[_0xfee598(0xe2)](_0x3dd822),_0xe6762f[_0xfee598(0xb9)]&&console['error']('\x20\x20'+_0x3dd822);}}}),{'verbose':_0xe6762f['verbose']}),_0x2b9b79=_0x41b053[_0x4898a2(0xd3)];if(_0x2b9b79[_0x4898a2(0xdf)][_0x4898a2(0xbd)]===0x0&&_0x2b9b79['counts'][_0x4898a2(0xc1)]===0x0)return console[_0x4898a2(0xc5)](a31_0x13cb9e[_0x4898a2(0xf5)]('No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27'+_0x2b9b79[_0x4898a2(0xed)]+'\x27')),0x0;const _0x21ec9b=_0x2b9b79['files'][_0x4898a2(0xd2)](_0x5a369e=>_0x5a369e[_0x4898a2(0xe3)]),_0x56777d=_0x2b9b79[_0x4898a2(0xf2)][_0x4898a2(0xd2)](_0x37b632=>!_0x37b632['isNew']&&_0x37b632['hasChanges']),_0x533aa8=_0x2b9b79[_0x4898a2(0xf2)][_0x4898a2(0xd2)](_0x49029a=>!_0x49029a[_0x4898a2(0xe3)]&&!_0x49029a[_0x4898a2(0xcf)]);console[_0x4898a2(0xc5)](_0x4898a2(0xe0)+_0x2b9b79['parentName']+'\x27:'),console['error'](_0x4898a2(0xe6)+a31_0x13cb9e[_0x4898a2(0xbe)](_0x2b9b79[_0x4898a2(0xdf)][_0x4898a2(0xbd)]+'\x20segments')+_0x4898a2(0xec)+a31_0x13cb9e['cyan'](_0x2b9b79[_0x4898a2(0xdf)][_0x4898a2(0x102)]+_0x4898a2(0xf6)));if(_0x2b9b79[_0x4898a2(0xdf)][_0x4898a2(0xc1)]>0x0){const _0x3e19df=_0x2b9b79[_0x4898a2(0xdf)][_0x4898a2(0xbc)]>_0x2b9b79[_0x4898a2(0xdf)]['journeys']?'\x20('+_0x2b9b79[_0x4898a2(0xdf)][_0x4898a2(0xbc)]+_0x4898a2(0xfe):'';console[_0x4898a2(0xc5)](_0x4898a2(0xb8)+a31_0x13cb9e['cyan'](_0x2b9b79[_0x4898a2(0xdf)][_0x4898a2(0xc1)]+_0x4898a2(0xff))+a31_0x13cb9e['dim'](_0x3e19df));}console[_0x4898a2(0xc5)]('\x20\x20'+a31_0x13cb9e[_0x4898a2(0xf9)]('+\x20'+_0x21ec9b[_0x4898a2(0xde)]+'\x20new\x20files')),console[_0x4898a2(0xc5)]('\x20\x20'+a31_0x13cb9e[_0x4898a2(0xf5)]('~\x20'+_0x56777d[_0x4898a2(0xde)]+'\x20changed\x20files')),console[_0x4898a2(0xc5)]('\x20\x20'+a31_0x13cb9e[_0x4898a2(0x101)]('=\x20'+_0x533aa8[_0x4898a2(0xde)]+_0x4898a2(0xfb))),console['error']('\x20\x20Target:\x20'+a31_0x13cb9e[_0x4898a2(0xbe)](_0x2b9b79[_0x4898a2(0xc7)])+'\x0a');if(_0x56777d[_0x4898a2(0xde)]>0x0)for(const _0x222dd6 of _0x56777d){console[_0x4898a2(0xc5)](_0x4898a2(0xce)+_0x222dd6[_0x4898a2(0xcb)]+'\x27:'),console['error']('─'[_0x4898a2(0xbb)](0x3c)),console[_0x4898a2(0xc5)](_0x222dd6[_0x4898a2(0xe1)]),console[_0x4898a2(0xc5)]('─'[_0x4898a2(0xbb)](0x3c));}if(_0xe6762f[_0x4898a2(0xc9)])return console[_0x4898a2(0xc5)](a31_0x13cb9e[_0x4898a2(0xf5)](_0x4898a2(0xea))),0x0;if(_0x21ec9b[_0x4898a2(0xde)]===0x0&&_0x56777d[_0x4898a2(0xde)]===0x0)return console[_0x4898a2(0xc5)](a31_0x13cb9e[_0x4898a2(0xf9)](_0x4898a2(0x100))),saveSessionContext({'parent_segment':_0x2b9b79[_0x4898a2(0xed)]},_0xe6762f[_0x4898a2(0xe4)]),console[_0x4898a2(0xc5)](a31_0x13cb9e['green'](_0x4898a2(0xe7)+a31_0x13cb9e[_0x4898a2(0x101)]('parent_segment')+'\x20=\x20'+a31_0x13cb9e[_0x4898a2(0xbe)](_0x2b9b79['parentName']))),0x0;if(!_0xe6762f[_0x4898a2(0xd4)]){if(!isInteractive())return console['error'](a31_0x13cb9e['red'](_0x4898a2(0xd7)),_0x4898a2(0xe5)),console[_0x4898a2(0xc5)](a31_0x13cb9e[_0x4898a2(0x101)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x136779=await confirmKey(_0x4898a2(0xbf)+(_0x21ec9b['length']+_0x56777d[_0x4898a2(0xde)])+_0x4898a2(0xdd));if(!_0x136779)return console[_0x4898a2(0xc5)](a31_0x13cb9e[_0x4898a2(0xf5)](_0x4898a2(0xc0)),_0x4898a2(0xf4)),0x1;}for(const _0x2a5210 of _0x2b9b79[_0x4898a2(0xf2)]){if(_0x2a5210[_0x4898a2(0xe3)]||_0x2a5210[_0x4898a2(0xcf)]){const _0x179187=a31_0x3febc9['dirname'](_0x2a5210[_0x4898a2(0xc3)]);!existsSync(_0x179187)&&mkdirSync(_0x179187,{'recursive':!![]}),writeFileSync(_0x2a5210[_0x4898a2(0xc3)],_0x2a5210[_0x4898a2(0xd1)],_0x4898a2(0xdc));}}return console[_0x4898a2(0xc5)](a31_0x13cb9e[_0x4898a2(0xf9)](_0x4898a2(0xb7)+(_0x21ec9b['length']+_0x56777d['length'])+_0x4898a2(0xf7)+_0x2b9b79[_0x4898a2(0xc7)])),saveSessionContext({'parent_segment':_0x2b9b79[_0x4898a2(0xed)]},_0xe6762f['session']),console[_0x4898a2(0xc5)](a31_0x13cb9e['green'](_0x4898a2(0xe7)+a31_0x13cb9e[_0x4898a2(0x101)]('parent_segment')+_0x4898a2(0xf1)+a31_0x13cb9e[_0x4898a2(0xbe)](_0x2b9b79['parentName']))),0x0;}}
1
+ const a31_0x3dfbdc=a31_0x2a5a;(function(_0x166b7f,_0x4f3468){const _0x4c0c7d=a31_0x2a5a,_0x438e19=_0x166b7f();while(!![]){try{const _0x454b9b=-parseInt(_0x4c0c7d(0x1e8))/0x1+parseInt(_0x4c0c7d(0x230))/0x2+-parseInt(_0x4c0c7d(0x1ec))/0x3+-parseInt(_0x4c0c7d(0x209))/0x4+-parseInt(_0x4c0c7d(0x1f1))/0x5+-parseInt(_0x4c0c7d(0x1fc))/0x6+parseInt(_0x4c0c7d(0x229))/0x7;if(_0x454b9b===_0x4f3468)break;else _0x438e19['push'](_0x438e19['shift']());}catch(_0x11ba87){_0x438e19['push'](_0x438e19['shift']());}}}(a31_0x57a3,0x9441a));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{saveSessionContext}from'../core/session.js';import a31_0x4765c5 from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';function a31_0x57a3(){const _0x4ab462=['yes','cyan','\x20files?','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)','cwd','4974354uaRumW','data','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent','Target\x20resource:\x20','isNew','targetDir','verbose','parentSegment','resourceName','Parent\x20segment:\x20','segment:pull','\x20versions)','dim','960940YrZhiN','message','yellow','parent_segment','journeys','session','content','\x20\x20🎯\x20','description','files','absolutePath','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','-\x20no\x20files\x20written','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','dirname','βœ”\x20Context\x20set:\x20','red','\x20=\x20','parentName','\x20\x20Target:\x20','type','journeyVersions','\x20segments','file','\x20activations','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file','length','dryRun','\x27...','error','pullSegments','helpText','17279920fxtZYU','\x20\x20πŸ—ΊοΈ\x20\x20','filter','counts','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','\x0aChanges\x20to\x20\x27','\x20with\x20','2032460xQmgSw','βœ”\x20Pulled\x20','setPhase','Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files','280202ktNwGy','activations','\x20journeys','repeat','3194925AWgWoI','\x0aPull\x20summary\x20for\x20\x27','\x20files\x20to\x20','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','errorCode','2315305wRijoY','\x20changed\x20files','Site:\x20','no_parent','green','hasChanges'];a31_0x57a3=function(){return _0x4ab462;};return a31_0x57a3();}import a31_0x218e1c from'path';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';function a31_0x2a5a(_0x6fa80f,_0x2538e6){_0x6fa80f=_0x6fa80f-0x1e8;const _0x57a39c=a31_0x57a3();let _0x2a5a65=_0x57a39c[_0x6fa80f];return _0x2a5a65;}export{buildFolderIdToPathMap as buildFolderPathMap}from'../sdk/segment/resolution-context.js';export class SegmentPullCommand extends BaseCommand{['name']=a31_0x3dfbdc(0x206);[a31_0x3dfbdc(0x211)]=a31_0x3dfbdc(0x233);async['execute'](_0x4ab3e2){const _0x4a4f57=a31_0x3dfbdc,{options:_0x348ef8,args:_0x2f9c3b,tdx:_0x33f553}=_0x4ab3e2,_0x531a5e=_0x348ef8,_0x46b4d5=await resolveTarget({'arg':_0x2f9c3b[0x0],'contextParent':_0x348ef8[_0x4a4f57(0x203)],'cwd':process[_0x4a4f57(0x1fb)]()});if(!isSuccessfulResolution(_0x46b4d5))return _0x46b4d5[_0x4a4f57(0x1f0)]===_0x4a4f57(0x1f4)?(console[_0x4a4f57(0x226)](a31_0x4765c5[_0x4a4f57(0x20b)](_0x4a4f57(0x214))),console[_0x4a4f57(0x226)](_0x4a4f57(0x1fa)),console[_0x4a4f57(0x226)](_0x4a4f57(0x1fe)),console[_0x4a4f57(0x226)](_0x4a4f57(0x222))):(console['error'](a31_0x4765c5[_0x4a4f57(0x219)]('Error:\x20'+_0x46b4d5[_0x4a4f57(0x20a)]+'\x0a')),_0x46b4d5['helpText']&&console[_0x4a4f57(0x226)](a31_0x4765c5[_0x4a4f57(0x1f8)](_0x46b4d5[_0x4a4f57(0x228)]))),0x1;const _0x4aa1f8=_0x46b4d5['parentName'],_0x129be3=_0x46b4d5[_0x4a4f57(0x201)],_0x216bc7=_0x46b4d5[_0x4a4f57(0x21d)]===_0x4a4f57(0x220)?_0x46b4d5[_0x4a4f57(0x204)]:undefined;_0x531a5e[_0x4a4f57(0x202)]&&(console['error'](_0x4a4f57(0x1f3)+_0x531a5e['site']),console[_0x4a4f57(0x226)](_0x4a4f57(0x205)+_0x4aa1f8),_0x216bc7&&console['error'](_0x4a4f57(0x1ff)+_0x216bc7));const _0xf256b7=await withProgressSpinner('Pulling\x20segments\x20from\x20\x27'+_0x4aa1f8+_0x4a4f57(0x225),_0x5d8ed6=>_0x33f553['segment'][_0x4a4f57(0x227)](_0x4aa1f8,{'targetDir':_0x129be3,'targetResourceName':_0x216bc7,'verbose':_0x531a5e[_0x4a4f57(0x202)],'progress':{'update':_0x2d76e1=>{const _0x43ed91=_0x4a4f57;_0x5d8ed6[_0x43ed91(0x232)](_0x2d76e1),_0x531a5e[_0x43ed91(0x202)]&&console['error']('\x20\x20'+_0x2d76e1);}}}),{'verbose':_0x531a5e[_0x4a4f57(0x202)]}),_0x1e03b4=_0xf256b7[_0x4a4f57(0x1fd)];if(_0x1e03b4[_0x4a4f57(0x22c)]['segments']===0x0&&_0x1e03b4[_0x4a4f57(0x22c)][_0x4a4f57(0x20d)]===0x0)return console[_0x4a4f57(0x226)](a31_0x4765c5[_0x4a4f57(0x20b)]('No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27'+_0x1e03b4[_0x4a4f57(0x21b)]+'\x27')),0x0;const _0x54c6ca=_0x1e03b4[_0x4a4f57(0x212)][_0x4a4f57(0x22b)](_0x417c1d=>_0x417c1d[_0x4a4f57(0x200)]),_0x329d61=_0x1e03b4[_0x4a4f57(0x212)]['filter'](_0x5c986a=>!_0x5c986a[_0x4a4f57(0x200)]&&_0x5c986a[_0x4a4f57(0x1f6)]),_0x6b2ac2=_0x1e03b4[_0x4a4f57(0x212)][_0x4a4f57(0x22b)](_0x50405a=>!_0x50405a[_0x4a4f57(0x200)]&&!_0x50405a[_0x4a4f57(0x1f6)]);console[_0x4a4f57(0x226)](_0x4a4f57(0x1ed)+_0x1e03b4[_0x4a4f57(0x21b)]+'\x27:'),console[_0x4a4f57(0x226)](_0x4a4f57(0x210)+a31_0x4765c5[_0x4a4f57(0x1f8)](_0x1e03b4[_0x4a4f57(0x22c)]['segments']+_0x4a4f57(0x21f))+_0x4a4f57(0x22f)+a31_0x4765c5['cyan'](_0x1e03b4[_0x4a4f57(0x22c)][_0x4a4f57(0x1e9)]+_0x4a4f57(0x221)));if(_0x1e03b4[_0x4a4f57(0x22c)][_0x4a4f57(0x20d)]>0x0){const _0x97eef1=_0x1e03b4[_0x4a4f57(0x22c)][_0x4a4f57(0x21e)]>_0x1e03b4[_0x4a4f57(0x22c)]['journeys']?'\x20('+_0x1e03b4['counts'][_0x4a4f57(0x21e)]+_0x4a4f57(0x207):'';console[_0x4a4f57(0x226)](_0x4a4f57(0x22a)+a31_0x4765c5[_0x4a4f57(0x1f8)](_0x1e03b4[_0x4a4f57(0x22c)][_0x4a4f57(0x20d)]+_0x4a4f57(0x1ea))+a31_0x4765c5['dim'](_0x97eef1));}console['error']('\x20\x20'+a31_0x4765c5[_0x4a4f57(0x1f5)]('+\x20'+_0x54c6ca[_0x4a4f57(0x223)]+'\x20new\x20files')),console[_0x4a4f57(0x226)]('\x20\x20'+a31_0x4765c5[_0x4a4f57(0x20b)]('~\x20'+_0x329d61['length']+_0x4a4f57(0x1f2))),console[_0x4a4f57(0x226)]('\x20\x20'+a31_0x4765c5[_0x4a4f57(0x208)]('=\x20'+_0x6b2ac2[_0x4a4f57(0x223)]+'\x20unchanged\x20files')),console[_0x4a4f57(0x226)](_0x4a4f57(0x21c)+a31_0x4765c5[_0x4a4f57(0x1f8)](_0x1e03b4[_0x4a4f57(0x201)])+'\x0a');if(_0x329d61['length']>0x0)for(const _0x11a192 of _0x329d61){console[_0x4a4f57(0x226)](_0x4a4f57(0x22e)+_0x11a192['relativePath']+'\x27:'),console[_0x4a4f57(0x226)]('─'[_0x4a4f57(0x1eb)](0x3c)),console[_0x4a4f57(0x226)](_0x11a192['diff']),console['error']('─'[_0x4a4f57(0x1eb)](0x3c));}if(_0x531a5e[_0x4a4f57(0x224)])return console[_0x4a4f57(0x226)](a31_0x4765c5['yellow'](_0x4a4f57(0x216))),0x0;if(_0x54c6ca['length']===0x0&&_0x329d61[_0x4a4f57(0x223)]===0x0)return console[_0x4a4f57(0x226)](a31_0x4765c5[_0x4a4f57(0x1f5)]('βœ”\x20All\x20files\x20are\x20up\x20to\x20date')),saveSessionContext({'parent_segment':_0x1e03b4[_0x4a4f57(0x21b)]},_0x531a5e[_0x4a4f57(0x20e)]),console[_0x4a4f57(0x226)](a31_0x4765c5[_0x4a4f57(0x1f5)]('βœ”\x20Context\x20set:\x20'+a31_0x4765c5[_0x4a4f57(0x208)](_0x4a4f57(0x20c))+_0x4a4f57(0x21a)+a31_0x4765c5['cyan'](_0x1e03b4[_0x4a4f57(0x21b)]))),0x0;if(!_0x531a5e[_0x4a4f57(0x1f7)]){if(!isInteractive())return console[_0x4a4f57(0x226)](a31_0x4765c5['red']('\x0aError:'),_0x4a4f57(0x22d)),console['error'](a31_0x4765c5[_0x4a4f57(0x208)](_0x4a4f57(0x1ef))),0x1;const _0x15f9a8=await confirmKey('Write\x20'+(_0x54c6ca['length']+_0x329d61['length'])+_0x4a4f57(0x1f9));if(!_0x15f9a8)return console['error'](a31_0x4765c5[_0x4a4f57(0x20b)]('Aborted.'),_0x4a4f57(0x215)),0x1;}for(const _0x139305 of _0x1e03b4[_0x4a4f57(0x212)]){if(_0x139305[_0x4a4f57(0x200)]||_0x139305[_0x4a4f57(0x1f6)]){const _0x14aad5=a31_0x218e1c[_0x4a4f57(0x217)](_0x139305['absolutePath']);!existsSync(_0x14aad5)&&mkdirSync(_0x14aad5,{'recursive':!![]}),writeFileSync(_0x139305[_0x4a4f57(0x213)],_0x139305[_0x4a4f57(0x20f)],'utf-8');}}return console[_0x4a4f57(0x226)](a31_0x4765c5[_0x4a4f57(0x1f5)](_0x4a4f57(0x231)+(_0x54c6ca[_0x4a4f57(0x223)]+_0x329d61[_0x4a4f57(0x223)])+_0x4a4f57(0x1ee)+_0x1e03b4[_0x4a4f57(0x201)])),saveSessionContext({'parent_segment':_0x1e03b4[_0x4a4f57(0x21b)]},_0x531a5e[_0x4a4f57(0x20e)]),console['error'](a31_0x4765c5[_0x4a4f57(0x1f5)](_0x4a4f57(0x218)+a31_0x4765c5[_0x4a4f57(0x208)](_0x4a4f57(0x20c))+'\x20=\x20'+a31_0x4765c5[_0x4a4f57(0x1f8)](_0x1e03b4[_0x4a4f57(0x21b)]))),0x0;}}
@@ -1 +1 @@
1
- const a32_0x56ec86=a32_0x5532;(function(_0x32146a,_0x49b336){const _0xa9fd46=a32_0x5532,_0x35b4da=_0x32146a();while(!![]){try{const _0xa90d8d=parseInt(_0xa9fd46(0x1c7))/0x1*(parseInt(_0xa9fd46(0x1a3))/0x2)+-parseInt(_0xa9fd46(0x15e))/0x3+parseInt(_0xa9fd46(0x19e))/0x4+-parseInt(_0xa9fd46(0x186))/0x5*(parseInt(_0xa9fd46(0x1e2))/0x6)+-parseInt(_0xa9fd46(0x185))/0x7*(parseInt(_0xa9fd46(0x1ea))/0x8)+parseInt(_0xa9fd46(0x161))/0x9*(-parseInt(_0xa9fd46(0x1de))/0xa)+parseInt(_0xa9fd46(0x1aa))/0xb;if(_0xa90d8d===_0x49b336)break;else _0x35b4da['push'](_0x35b4da['shift']());}catch(_0x4baa1c){_0x35b4da['push'](_0x35b4da['shift']());}}}(a32_0x5ce3,0x82ea4));import{BaseCommand}from'./command.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';function a32_0x5532(_0xb7c2b,_0x1eaeaa){_0xb7c2b=_0xb7c2b-0x153;const _0x5ce38c=a32_0x5ce3();let _0x5532a2=_0x5ce38c[_0xb7c2b];return _0x5532a2;}import{generateDiff,formatDiffWithColors}from'../utils/diff.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{batchAsync}from'../utils/async.js';import{segmentToYamlString,segmentWithActivationsToYaml}from'../sdk/segment/child-segment-yaml.js';import a32_0x4d4cc0 from'chalk';import{existsSync}from'fs';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{resolveTarget,isSuccessfulResolution,getScopedDetails}from'../sdk/segment/target-resolution.js';import{buildFolderMaps}from'../sdk/segment/resolution-context.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{resolveTDFolderPath,findSegmentsToDelete,findJourneysToDelete,buildSegmentLookupMap,buildSegmentNameToIdMap,buildJourneyBundleLookupMap,parseAndClassifyYamlFiles,validateParsedFiles,formatValidationErrors,extractRootFolderId,buildConnectionMaps,calculatePushStats,prepareSegmentFiles,prepareJourneyFiles,executePushSegments,executePushFolders,executePushSegmentDeletions,executePushJourneys}from'../sdk/segment/push-workflow.js';function a32_0x5ce3(){const _0xd0a43=['Fetching\x20users\x20for\x20email\x20resolution...','type','filter','274434LAAxQX','nameToId','Site:\x20','resolveParentId','getParent','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','listActivations','isNew','136JDZflp','repeat','folders','description','\x20folders\x20to\x20create','toCreate','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','filePath','\x0aValidation\x20failed:','New\x20journey:','isScoped','map','then','existingJourney','2231355xVdrqH','setPhase','name','9aIsOod','segments','yes','Folders\x20to\x20create:','Fetching\x20existing\x20journeys...','getJourney','Error\x20parsing\x20YAML:\x20','journey','listSegments','journeys','set','Push\x20','new','\x20\x20πŸ“Š\x20Segments:','state','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','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)','red','error','journeyId','site','Changes\x20to:','unchanged','createdSegmentIds','delete','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','\x20\x20πŸ—ΊοΈ\x20\x20Journeys:','Source\x20directory:\x20','toUpdate','updated','Fetching\x20existing\x20folders...','list','\x20\x20Source:\x20','user','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','180446XDOZEw','15rfQgWl','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','segment','parentName','idToName','No\x20','yamlConfig','\x20changed','helpText','\x20\x20Activations:','βœ”\x20All\x20journeys\x20are\x20up\x20to\x20date','buildUserMaps','endsWith','blue','activations','yellow','\x20created','parentSegment','/app/ps/','journeysOnly','\x20to\x20update','Error:\x20Directory\x20not\x20found:\x20','\x20\x20\x20\x20','data','1544448HfWFbV','\x20new','\x20unchanged','Scoped\x20to\x20folder:\x20','toDelete','2iOWDxX','(Journey\x20will\x20be\x20deleted)','scopedFolderPath','cyan','no_parent','/j/da/je','\x0aError:','15306500iFePMP','\x20updated','errorCode','πŸ“\x20','\x20\x20Segments:\x20','Resolving\x20parent\x20segment\x20\x27','green','Parent\x20segment:\x20','dim','journeyBundleId','Fetching\x20existing\x20segments...','segment\x20or\x20journey','\x20to\x20create','push','results','\x20changes?','length','all','Preparing\x20journeys...','Delete\x20segment:','\x20deleted','folderPath','βœ”\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','\x20to\x20delete','get','add','targetDir','created','\x20activations]','506393qXRNxB','paused','join','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','verbose','diff','toString','parentFolder','Aborted.','.yaml','connection','message','/e/','Fetching\x20connections\x20for\x20name\x20resolution...','attributes','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','changed','deleted','\x20YAML\x20files\x20found','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','dryRun','versionNumber','journeyBundleName','4285490sJBUle'];a32_0x5ce3=function(){return _0xd0a43;};return a32_0x5ce3();}export class SegmentPushCommand extends BaseCommand{[a32_0x56ec86(0x160)]='segment:push';[a32_0x56ec86(0x153)]=a32_0x56ec86(0x184);async['execute'](_0x4b3cd3){const _0x468eda=a32_0x56ec86,{options:_0x3f2608,args:_0xa49c66,tdx:_0xd7e9ef}=_0x4b3cd3,_0x26f0c8=_0x3f2608,_0x4c2a80=await resolveTarget({'arg':_0xa49c66[0x0],'contextParent':_0x3f2608[_0x468eda(0x197)],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x4c2a80))return _0x4c2a80[_0x468eda(0x1ac)]===_0x468eda(0x1a7)?(console[_0x468eda(0x174)](a32_0x4d4cc0[_0x468eda(0x195)](_0x468eda(0x156))),console[_0x468eda(0x174)](_0x468eda(0x172)),console[_0x468eda(0x174)](_0x468eda(0x1d6)),console[_0x468eda(0x174)]('\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[_0x468eda(0x174)](a32_0x4d4cc0[_0x468eda(0x173)]('Error:\x20'+_0x4c2a80[_0x468eda(0x1d2)]+'\x0a')),_0x4c2a80[_0x468eda(0x18e)]&&console['error'](a32_0x4d4cc0[_0x468eda(0x1a6)](_0x4c2a80['helpText']))),0x1;if(_0x4c2a80[_0x468eda(0x1e0)]==='parent_name')return console[_0x468eda(0x174)](a32_0x4d4cc0['red'](_0x468eda(0x19b)+_0x4c2a80[_0x468eda(0x1c4)]+'\x0a')),console[_0x468eda(0x174)](a32_0x4d4cc0[_0x468eda(0x1a6)]('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;const _0x3e9b70=_0x4c2a80[_0x468eda(0x189)],_0x242d46=_0x4c2a80[_0x468eda(0x1c4)],_0x3fb7f0=_0x4c2a80[_0x468eda(0x1e0)]==='file'?_0x4c2a80[_0x468eda(0x157)]:undefined,_0x1d6468=getScopedDetails(_0x4c2a80),_0x4fac47=_0x1d6468?.[_0x468eda(0x15a)]??![],_0x143744=_0x1d6468?.[_0x468eda(0x1a5)]??'';if(!existsSync(_0x242d46))return console['error'](a32_0x4d4cc0['red']('Error:\x20Directory\x20not\x20found:\x20'+_0x242d46+'\x0a')),console[_0x468eda(0x174)](a32_0x4d4cc0[_0x468eda(0x1a6)](_0x468eda(0x171))),0x1;_0x26f0c8['verbose']&&(console[_0x468eda(0x174)](_0x468eda(0x1e4)+_0x26f0c8['site']),console[_0x468eda(0x174)](_0x468eda(0x1b1)+_0x3e9b70),console[_0x468eda(0x174)](_0x468eda(0x17d)+_0x242d46),_0x4fac47&&console['error'](_0x468eda(0x1a1)+_0x143744));const _0x366d0e=await withSpinner(_0x468eda(0x1af)+_0x3e9b70+'\x27...',()=>_0xd7e9ef[_0x468eda(0x188)][_0x468eda(0x1e5)](_0x3e9b70),{'verbose':_0x26f0c8[_0x468eda(0x1cb)]}),_0xafeda5=_0x366d0e[_0x468eda(0x19d)],[_0x435336,_0x160b37,_0x13a30e,_0x622ac2,_0x39ed77]=await Promise[_0x468eda(0x1bb)]([withSpinner('Fetching\x20parent\x20segment\x20details...',()=>_0xd7e9ef[_0x468eda(0x188)][_0x468eda(0x1e6)](_0xafeda5),{'verbose':_0x26f0c8['verbose']}),withSpinner(_0x468eda(0x1b4),()=>_0xd7e9ef['segment'][_0x468eda(0x169)](_0xafeda5),{'verbose':_0x26f0c8[_0x468eda(0x1cb)]}),withSpinner(_0x468eda(0x180),()=>_0xd7e9ef['segment']['listFolders'](_0xafeda5),{'verbose':_0x26f0c8[_0x468eda(0x1cb)]}),withSpinner(_0x468eda(0x165),()=>_0xd7e9ef['journey']['listJourneysWithDetailsFromParentSegment'](_0xafeda5,{'includeAllVersions':!![]}),{'verbose':_0x26f0c8[_0x468eda(0x1cb)]}),withSpinner(_0x468eda(0x1df),()=>_0xd7e9ef[_0x468eda(0x183)][_0x468eda(0x191)](),{'verbose':_0x26f0c8[_0x468eda(0x1cb)]})[_0x468eda(0x15c)](_0x5f45db=>_0x5f45db['data'])]),_0x28ea77=_0x435336[_0x468eda(0x19d)],_0x116de1=extractRootFolderId(_0x28ea77),_0xdb339f=_0x160b37[_0x468eda(0x19d)],_0x2638e4=_0x13a30e[_0x468eda(0x19d)],{journeys:_0x126256,activationStepsById:_0x410842}=_0x622ac2[_0x468eda(0x19d)],_0x4d40d1=new Map(_0x126256[_0x468eda(0x15b)](_0x21bd48=>[_0x21bd48['id'],_0x21bd48])),_0x288cd3=_0x126256['map'](_0x2d116b=>({'id':_0x2d116b['id'],'name':_0x2d116b['attributes'][_0x468eda(0x160)],'journeyBundleName':_0x2d116b[_0x468eda(0x1d5)][_0x468eda(0x1dd)]||'','journeyBundleId':_0x2d116b[_0x468eda(0x1d5)][_0x468eda(0x1b3)]||'','versionNumber':_0x2d116b[_0x468eda(0x1d5)][_0x468eda(0x1dc)],'description':_0x2d116b[_0x468eda(0x1d5)]['description'],'state':_0x2d116b['attributes'][_0x468eda(0x16f)],'paused':_0x2d116b[_0x468eda(0x1d5)][_0x468eda(0x1c8)],'audienceId':_0x2d116b['attributes']['audienceId'],'folderId':_0x2d116b['relationships']?.[_0x468eda(0x1ce)]?.[_0x468eda(0x19d)]?.['id'],'createdAt':_0x2d116b[_0x468eda(0x1d5)]['createdAt'],'updatedAt':_0x2d116b['attributes']['updatedAt']})),{emailToId:_0x4b83c3,idToEmail:_0x222683}=_0x39ed77,_0x4c570d=await withSpinner(_0x468eda(0x1d4),async()=>{const _0x41604d=_0x468eda,_0x45386f=await _0xd7e9ef['connection'][_0x41604d(0x181)]();return buildConnectionMaps(_0x45386f);},{'verbose':_0x26f0c8['verbose']})[_0x468eda(0x15c)](_0x2448f2=>_0x2448f2['data']),_0x31ce57=_0x4c570d[_0x468eda(0x1e3)],_0x1b410d=_0x4c570d[_0x468eda(0x18a)],_0x1ae000=_0x4c570d['nameToType'],_0x17087f={'emailToIdMap':_0x4b83c3,'connectionNameToIdMap':_0x31ce57,'connectionNameToTypeMap':_0x1ae000,'getSchema':_0x3d9ff1=>_0xd7e9ef[_0x468eda(0x1d1)]['getOutputSchemaWithCache'](_0x3d9ff1)};let {pathToId:_0x5b4a41,idToPath:_0x44e367}=buildFolderMaps(_0x2638e4);const _0x489191=buildSegmentLookupMap(_0xdb339f,_0x44e367),_0x56d7d5=buildSegmentNameToIdMap(_0xdb339f),_0xd8d219=buildJourneyBundleLookupMap(_0x288cd3,_0x44e367);let _0x1827ed;if(_0x3fb7f0){if(!_0x3fb7f0['endsWith']('.yml')&&!_0x3fb7f0[_0x468eda(0x192)](_0x468eda(0x1d0)))return console[_0x468eda(0x174)](a32_0x4d4cc0[_0x468eda(0x173)](_0x468eda(0x1e7)+_0x3fb7f0+'\x0a')),0x1;_0x1827ed=[_0x3fb7f0];}else _0x1827ed=findYamlFiles(_0x242d46);if(_0x1827ed[_0x468eda(0x1ba)]===0x0)return console['error'](a32_0x4d4cc0[_0x468eda(0x173)]('Error:\x20No\x20YAML\x20files\x20found\x20in\x20'+_0x242d46+'\x0a')),console['error'](a32_0x4d4cc0[_0x468eda(0x1a6)](_0x468eda(0x17b))),0x1;let _0x4d8ce5,_0x2bc766;try{const _0x503be5=parseAndClassifyYamlFiles(_0x1827ed,_0x242d46,{'skipSegments':_0x26f0c8['journeysOnly']});_0x4d8ce5=_0x503be5[_0x468eda(0x162)],_0x2bc766=_0x503be5[_0x468eda(0x16a)];const _0x224b23=validateParsedFiles(_0x503be5,_0x242d46);if(_0x224b23[_0x468eda(0x1ba)]>0x0)return console['error'](a32_0x4d4cc0[_0x468eda(0x173)](_0x468eda(0x158))),console[_0x468eda(0x174)](formatValidationErrors(_0x224b23)),console['error'](a32_0x4d4cc0[_0x468eda(0x195)]('\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.')),0x1;}catch(_0x438fae){return console[_0x468eda(0x174)](a32_0x4d4cc0[_0x468eda(0x173)](_0x468eda(0x167)+(_0x438fae instanceof Error?_0x438fae[_0x468eda(0x1d2)]:_0x438fae))),0x1;}if(_0x4d8ce5[_0x468eda(0x1ba)]===0x0&&_0x2bc766['length']===0x0){const _0x92b4b1=_0x26f0c8[_0x468eda(0x199)]?'journey':_0x468eda(0x1b5);return console[_0x468eda(0x174)](a32_0x4d4cc0[_0x468eda(0x195)](_0x468eda(0x18b)+_0x92b4b1+_0x468eda(0x1d9))),0x0;}const _0x56d545=new Map();_0xdb339f[_0x468eda(0x1ba)]>0x0&&!_0x26f0c8[_0x468eda(0x199)]&&await withSpinner('Fetching\x20existing\x20activations...',async()=>{await batchAsync(_0xdb339f,async _0x4151a5=>{const _0x3c5300=a32_0x5532,_0xe0f7b2=await _0xd7e9ef['segment'][_0x3c5300(0x1e8)](_0xafeda5,_0x4151a5['id']);_0x56d545[_0x3c5300(0x16b)](_0x4151a5['id'],_0xe0f7b2);});},{'verbose':_0x26f0c8['verbose']});const {segmentFiles:_0x3135aa,foldersToCreate:_0x394760}=await prepareSegmentFiles(_0x4d8ce5,{'segmentByFolderAndName':_0x489191,'activationsBySegmentId':_0x56d545,'folderPathToId':_0x5b4a41,'idToEmailMap':_0x222683,'connectionIdToNameMap':_0x1b410d},_0x17087f,_0x4fac47,_0x143744),_0x28f51a=_0x3fb7f0?[]:findSegmentsToDelete(_0xdb339f,_0x4d8ce5[_0x468eda(0x15b)](({yamlConfig:_0x3f572d,folderPath:_0x58c674})=>({'yamlConfig':_0x3f572d,'folderPath':resolveTDFolderPath(_0x58c674,_0x4fac47,_0x143744)})),_0x44e367,_0x143744,_0x4fac47),{journeyFiles:_0x3a7416,foldersToCreate:_0x25da73}=await withProgressSpinner(_0x468eda(0x1bc),async _0x11e9b0=>prepareJourneyFiles(_0x2bc766,{'fetchJourney':async _0xf8ff60=>_0xd7e9ef[_0x468eda(0x168)][_0x468eda(0x166)](_0xf8ff60[_0x468eda(0x175)]),'journeyBundlesByFolderAndName':_0xd8d219,'folderPathToId':_0x5b4a41,'idToEmailMap':_0x222683,'connectionIdToNameMap':_0x1b410d,'existingSegments':_0xdb339f,'parentId':_0xafeda5,'deps':_0xd7e9ef,'progress':{'update':_0xe36ef2=>{const _0x8bea65=_0x468eda;_0x11e9b0[_0x8bea65(0x15f)](_0xe36ef2),_0x26f0c8['verbose']&&console['error']('\x20\x20'+_0xe36ef2);}},'journeyById':_0x4d40d1,'activationStepsById':_0x410842},_0x4fac47,_0x143744),{'verbose':_0x26f0c8['verbose']})[_0x468eda(0x15c)](_0x53c1d0=>_0x53c1d0[_0x468eda(0x19d)]);for(const _0x48f53d of _0x25da73){_0x394760[_0x468eda(0x1c3)](_0x48f53d);}const _0x5d8b11=_0x3fb7f0?[]:findJourneysToDelete(_0x288cd3,_0x2bc766[_0x468eda(0x15b)](({yamlConfig:_0x35ea88,folderPath:_0x1991dc})=>({'yamlConfig':_0x35ea88,'folderPath':resolveTDFolderPath(_0x1991dc,_0x4fac47,_0x143744)})),_0x44e367,_0x143744,_0x4fac47),_0x5a7fd2=calculatePushStats(_0x3135aa,_0x3a7416,_0x394760,_0x28f51a,_0x5d8b11,!!_0x26f0c8[_0x468eda(0x17a)],!!_0x26f0c8[_0x468eda(0x199)]),_0x292430=_0x5a7fd2[_0x468eda(0x162)][_0x468eda(0x16d)],_0x378371=_0x5a7fd2[_0x468eda(0x162)]['changed'],_0x143e03=_0x5a7fd2['segments'][_0x468eda(0x178)],_0x3b5667=_0x5a7fd2[_0x468eda(0x162)][_0x468eda(0x1a2)],_0x534e8e=_0x5a7fd2[_0x468eda(0x1ec)][_0x468eda(0x155)],_0x730010=_0x5a7fd2[_0x468eda(0x16a)][_0x468eda(0x16d)],_0x5980e4=_0x5a7fd2['journeys'][_0x468eda(0x1d7)],_0x2cb2aa=_0x5a7fd2['journeys']['unchanged'],_0x3a0b56=_0x5a7fd2[_0x468eda(0x16a)][_0x468eda(0x1a2)],_0x44f573=_0x5a7fd2[_0x468eda(0x194)][_0x468eda(0x1bb)],_0x38d0d2=_0x5a7fd2[_0x468eda(0x194)][_0x468eda(0x155)],_0x581ed4=_0x5a7fd2[_0x468eda(0x194)][_0x468eda(0x17e)],_0x1bb550=_0x5a7fd2[_0x468eda(0x194)][_0x468eda(0x1a2)];console[_0x468eda(0x174)]('\x0aPush\x20summary\x20for\x20\x27'+_0x3e9b70+'\x27:');_0x534e8e[_0x468eda(0x1ba)]>0x0&&console[_0x468eda(0x174)]('\x20\x20'+a32_0x4d4cc0[_0x468eda(0x193)](_0x468eda(0x1ad)+_0x534e8e[_0x468eda(0x1ba)]+_0x468eda(0x154)));if(!_0x26f0c8[_0x468eda(0x199)]){console[_0x468eda(0x174)](_0x468eda(0x16e)),console[_0x468eda(0x174)]('\x20\x20\x20\x20'+a32_0x4d4cc0[_0x468eda(0x1b0)]('+\x20'+_0x292430[_0x468eda(0x1ba)]+_0x468eda(0x19f))),console[_0x468eda(0x174)](_0x468eda(0x19c)+a32_0x4d4cc0['yellow']('~\x20'+_0x378371[_0x468eda(0x1ba)]+_0x468eda(0x18d)));if(_0x3b5667[_0x468eda(0x1ba)]>0x0)console[_0x468eda(0x174)]('\x20\x20\x20\x20'+a32_0x4d4cc0['red']('-\x20'+_0x3b5667[_0x468eda(0x1ba)]+'\x20to\x20delete'));else _0x28f51a[_0x468eda(0x1ba)]>0x0&&!_0x26f0c8['delete']&&console[_0x468eda(0x174)](_0x468eda(0x19c)+a32_0x4d4cc0[_0x468eda(0x1b2)](_0x28f51a['length']+_0x468eda(0x170)));console[_0x468eda(0x174)](_0x468eda(0x19c)+a32_0x4d4cc0['dim']('=\x20'+_0x143e03[_0x468eda(0x1ba)]+_0x468eda(0x1a0)));}if(_0x3a7416[_0x468eda(0x1ba)]>0x0||_0x5d8b11[_0x468eda(0x1ba)]>0x0){console[_0x468eda(0x174)](_0x468eda(0x17c)),console[_0x468eda(0x174)](_0x468eda(0x19c)+a32_0x4d4cc0[_0x468eda(0x1b0)]('+\x20'+_0x730010['length']+'\x20new')),console['error'](_0x468eda(0x19c)+a32_0x4d4cc0['yellow']('~\x20'+_0x5980e4[_0x468eda(0x1ba)]+_0x468eda(0x18d)));if(_0x3a0b56[_0x468eda(0x1ba)]>0x0)console[_0x468eda(0x174)](_0x468eda(0x19c)+a32_0x4d4cc0[_0x468eda(0x173)]('-\x20'+_0x3a0b56[_0x468eda(0x1ba)]+_0x468eda(0x1c1)));else _0x5d8b11[_0x468eda(0x1ba)]>0x0&&!_0x26f0c8['delete']&&console['error'](_0x468eda(0x19c)+a32_0x4d4cc0['dim'](_0x5d8b11[_0x468eda(0x1ba)]+_0x468eda(0x170)));console[_0x468eda(0x174)](_0x468eda(0x19c)+a32_0x4d4cc0['dim']('=\x20'+_0x2cb2aa[_0x468eda(0x1ba)]+_0x468eda(0x1a0)));}_0x44f573[_0x468eda(0x1ba)]>0x0&&!_0x26f0c8[_0x468eda(0x199)]&&(console[_0x468eda(0x174)](''),console['error'](_0x468eda(0x18f)),_0x38d0d2[_0x468eda(0x1ba)]>0x0&&console['error'](_0x468eda(0x19c)+a32_0x4d4cc0[_0x468eda(0x1b0)]('+\x20'+_0x38d0d2[_0x468eda(0x1ba)]+_0x468eda(0x1b6))),_0x581ed4['length']>0x0&&console[_0x468eda(0x174)](_0x468eda(0x19c)+a32_0x4d4cc0[_0x468eda(0x195)]('~\x20'+_0x581ed4[_0x468eda(0x1ba)]+_0x468eda(0x19a))),_0x1bb550[_0x468eda(0x1ba)]>0x0&&console[_0x468eda(0x174)](_0x468eda(0x19c)+a32_0x4d4cc0[_0x468eda(0x173)]('-\x20'+_0x1bb550[_0x468eda(0x1ba)]+'\x20to\x20delete')));console['error'](_0x468eda(0x182)+a32_0x4d4cc0['cyan'](_0x242d46)+'\x0a');if(_0x534e8e[_0x468eda(0x1ba)]>0x0){console['error'](_0x468eda(0x164));for(const _0x481ed1 of _0x534e8e){console['error']('\x20\x20'+a32_0x4d4cc0['blue']('+')+'\x20'+_0x481ed1);}console['error']('');}if(_0x292430['length']>0x0&&!_0x26f0c8[_0x468eda(0x199)])for(const _0x35c79e of _0x292430){const _0x574160=_0x35c79e[_0x468eda(0x1bf)]?_0x35c79e[_0x468eda(0x1bf)]+'/'+_0x35c79e[_0x468eda(0x18c)][_0x468eda(0x160)]:_0x35c79e[_0x468eda(0x18c)][_0x468eda(0x160)],_0x2ecfa9=_0x35c79e[_0x468eda(0x18c)][_0x468eda(0x194)]?.['length']||0x0,_0x1f2027=_0x2ecfa9>0x0?a32_0x4d4cc0['dim']('\x20['+_0x2ecfa9+_0x468eda(0x1c6)):'';console['error']('\x0a'+a32_0x4d4cc0['green']('New\x20segment:')+'\x20'+_0x574160+_0x1f2027),console[_0x468eda(0x174)]('─'[_0x468eda(0x1eb)](0x3c)),_0x35c79e['diff']&&console[_0x468eda(0x174)](_0x35c79e[_0x468eda(0x1cc)]),console[_0x468eda(0x174)]('─'[_0x468eda(0x1eb)](0x3c));}if(_0x3b5667[_0x468eda(0x1ba)]>0x0&&!_0x26f0c8[_0x468eda(0x199)])for(const _0x2db139 of _0x3b5667){const _0x48b810=_0x2db139['segmentFolderId']?_0x44e367[_0x468eda(0x1c2)](_0x2db139['segmentFolderId'][_0x468eda(0x1cd)]())||'':'',_0x3afe53=_0x48b810?_0x48b810+'/'+_0x2db139[_0x468eda(0x160)]:_0x2db139[_0x468eda(0x160)],_0x2c8c48=_0x56d545['get'](_0x2db139['id'])||[],_0x27342c=_0x2c8c48[_0x468eda(0x1ba)]>0x0?a32_0x4d4cc0[_0x468eda(0x1b2)]('\x20['+_0x2c8c48['length']+_0x468eda(0x1c6)):'';console[_0x468eda(0x174)]('\x0a'+a32_0x4d4cc0['red'](_0x468eda(0x1bd))+'\x20'+_0x3afe53+_0x27342c),console[_0x468eda(0x174)]('─'[_0x468eda(0x1eb)](0x3c));const _0x9674de=segmentWithActivationsToYaml(_0x2db139,_0x2c8c48,undefined,_0x222683,_0x1b410d),_0x3b34b5=segmentToYamlString(_0x9674de),_0x953575=generateDiff(_0x3b34b5,'');console['error'](formatDiffWithColors(_0x953575)),console[_0x468eda(0x174)]('─'[_0x468eda(0x1eb)](0x3c));}const _0x66988c=_0x3135aa[_0x468eda(0x1e1)](_0x2799a6=>!_0x2799a6[_0x468eda(0x1e9)]&&_0x2799a6[_0x468eda(0x1cc)]);if(_0x66988c[_0x468eda(0x1ba)]>0x0&&!_0x26f0c8[_0x468eda(0x199)])for(const _0x2600ec of _0x66988c){const _0x1e32b1=_0x2600ec[_0x468eda(0x1bf)]?_0x2600ec['folderPath']+'/'+_0x2600ec['yamlConfig']['name']:_0x2600ec[_0x468eda(0x18c)][_0x468eda(0x160)];console['error']('\x0a'+a32_0x4d4cc0['yellow'](_0x468eda(0x177))+'\x20'+_0x1e32b1),console[_0x468eda(0x174)]('─'[_0x468eda(0x1eb)](0x3c)),console[_0x468eda(0x174)](_0x2600ec[_0x468eda(0x1cc)]),console[_0x468eda(0x174)]('─'[_0x468eda(0x1eb)](0x3c));}if(_0x730010['length']>0x0)for(const _0x542179 of _0x730010){const _0x50fdea=_0x542179[_0x468eda(0x1bf)]?_0x542179[_0x468eda(0x1bf)]+'/'+_0x542179['yamlConfig'][_0x468eda(0x160)]:_0x542179[_0x468eda(0x18c)][_0x468eda(0x160)];console[_0x468eda(0x174)]('\x0a'+a32_0x4d4cc0[_0x468eda(0x1b0)](_0x468eda(0x159))+'\x20'+_0x50fdea),console[_0x468eda(0x174)]('─'[_0x468eda(0x1eb)](0x3c)),_0x542179[_0x468eda(0x1cc)]&&console[_0x468eda(0x174)](_0x542179[_0x468eda(0x1cc)]),console[_0x468eda(0x174)]('─'['repeat'](0x3c));}const _0x561009=_0x3a7416[_0x468eda(0x1e1)](_0x89c181=>!_0x89c181[_0x468eda(0x1e9)]&&_0x89c181[_0x468eda(0x1cc)]);if(_0x561009[_0x468eda(0x1ba)]>0x0)for(const _0x3ccf58 of _0x561009){const _0x4ce288=_0x3ccf58[_0x468eda(0x1bf)]?_0x3ccf58[_0x468eda(0x1bf)]+'/'+_0x3ccf58[_0x468eda(0x18c)]['name']:_0x3ccf58[_0x468eda(0x18c)][_0x468eda(0x160)];console[_0x468eda(0x174)]('\x0a'+a32_0x4d4cc0['yellow']('Changes\x20to\x20journey:')+'\x20'+_0x4ce288),console[_0x468eda(0x174)]('─'['repeat'](0x3c)),console[_0x468eda(0x174)](_0x3ccf58[_0x468eda(0x1cc)]),console[_0x468eda(0x174)]('─'[_0x468eda(0x1eb)](0x3c));}if(_0x3a0b56['length']>0x0)for(const _0x8c1a43 of _0x3a0b56){const _0x46e3c4=_0x8c1a43['folderId']?_0x44e367['get'](_0x8c1a43['folderId'])||'':'',_0x42ae00=_0x46e3c4?_0x46e3c4+'/'+_0x8c1a43[_0x468eda(0x1dd)]:_0x8c1a43[_0x468eda(0x1dd)];console['error']('\x0a'+a32_0x4d4cc0[_0x468eda(0x173)]('Delete\x20journey:')+'\x20'+_0x42ae00),console[_0x468eda(0x174)]('─'[_0x468eda(0x1eb)](0x3c)),console[_0x468eda(0x174)](a32_0x4d4cc0[_0x468eda(0x173)](_0x468eda(0x1a4))),console[_0x468eda(0x174)]('─'[_0x468eda(0x1eb)](0x3c));}if(_0x26f0c8[_0x468eda(0x1db)])return console[_0x468eda(0x174)](a32_0x4d4cc0[_0x468eda(0x195)]('\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made')),0x0;const _0x1981ed=_0x26f0c8['journeysOnly']?![]:_0x292430['length']>0x0||_0x378371[_0x468eda(0x1ba)]>0x0||_0x3b5667['length']>0x0,_0x341099=_0x730010[_0x468eda(0x1ba)]>0x0||_0x5980e4[_0x468eda(0x1ba)]>0x0||_0x3a0b56['length']>0x0,_0x3beb48=_0x26f0c8[_0x468eda(0x199)]?![]:_0x44f573[_0x468eda(0x1ba)]>0x0,_0x1b7bbf=_0x534e8e[_0x468eda(0x1ba)]>0x0;if(!_0x1981ed&&!_0x341099&&!_0x3beb48&&!_0x1b7bbf){const _0x1e8357=_0x26f0c8[_0x468eda(0x199)]?_0x468eda(0x190):_0x468eda(0x1c0);console[_0x468eda(0x174)](a32_0x4d4cc0[_0x468eda(0x1b0)](_0x1e8357));if(_0x3fb7f0&&_0x2cb2aa[_0x468eda(0x1ba)]===0x1){const _0x1c3515=_0x2cb2aa[0x0];if(_0x1c3515[_0x468eda(0x15d)]?.['id']){const _0x207ec3=getConsoleNextUrl(_0x26f0c8[_0x468eda(0x176)],_0x468eda(0x198)+_0xafeda5+_0x468eda(0x1d3)+_0x1c3515[_0x468eda(0x15d)]['id']+_0x468eda(0x1a8));console[_0x468eda(0x174)]('\x20\x20'+a32_0x4d4cc0['cyan'](_0x207ec3));}}return 0x0;}const _0x470fc7=_0x26f0c8[_0x468eda(0x199)]?_0x730010[_0x468eda(0x1ba)]+_0x5980e4[_0x468eda(0x1ba)]+_0x3a0b56['length']+_0x534e8e[_0x468eda(0x1ba)]:_0x292430[_0x468eda(0x1ba)]+_0x378371[_0x468eda(0x1ba)]+_0x3b5667[_0x468eda(0x1ba)]+_0x730010[_0x468eda(0x1ba)]+_0x5980e4[_0x468eda(0x1ba)]+_0x3a0b56[_0x468eda(0x1ba)]+_0x534e8e[_0x468eda(0x1ba)]+_0x44f573['length'];if(!_0x26f0c8[_0x468eda(0x163)]&&_0x470fc7>0x0){if(!isInteractive())return console[_0x468eda(0x174)](a32_0x4d4cc0[_0x468eda(0x173)](_0x468eda(0x1a9)),_0x468eda(0x1da)),console['error'](a32_0x4d4cc0[_0x468eda(0x1b2)](_0x468eda(0x187))),0x1;const _0x6c90e7=await confirmKey(_0x468eda(0x16c)+_0x470fc7+_0x468eda(0x1b9));if(!_0x6c90e7)return console['error'](a32_0x4d4cc0[_0x468eda(0x195)](_0x468eda(0x1cf))),0x1;}const _0x5c4a3f={'withProgress':async(_0x3043c7,_0x4cb5b0)=>{const _0x41eca1=_0x468eda,_0x3725ca=await withSpinner(_0x3043c7,_0x4cb5b0,{'verbose':_0x26f0c8['verbose']});return{'data':_0x3725ca[_0x41eca1(0x19d)]};},'logInfo':_0x335213=>console[_0x468eda(0x174)](a32_0x4d4cc0[_0x468eda(0x193)]('βœ”\x20'+_0x335213)),'logSuccess':_0x297b67=>console[_0x468eda(0x174)](a32_0x4d4cc0[_0x468eda(0x1b0)]('βœ”\x20'+_0x297b67)),'logWarning':_0x1c8ade=>console[_0x468eda(0x174)](a32_0x4d4cc0[_0x468eda(0x195)]('⚠\x20'+_0x1c8ade)),'logDeleted':_0x3abc38=>console[_0x468eda(0x174)](a32_0x4d4cc0[_0x468eda(0x173)]('βœ”\x20'+_0x3abc38))},_0x2bbd31={'segment':_0xd7e9ef[_0x468eda(0x188)],'journey':_0xd7e9ef[_0x468eda(0x168)],'user':_0xd7e9ef[_0x468eda(0x183)],'connection':_0xd7e9ef[_0x468eda(0x1d1)]};_0x534e8e[_0x468eda(0x1ba)]>0x0&&(_0x5b4a41=await executePushFolders(_0x2bbd31,_0x534e8e,_0x5b4a41,{'parentId':_0xafeda5},_0x5c4a3f));const _0x413c2a={'rootFolderId':_0x116de1,'folderPathToId':_0x5b4a41,'folderIdToPath':_0x44e367,'segmentNameToId':_0x56d7d5,'activationsBySegmentId':_0x56d545,'emailToIdMap':_0x4b83c3,'idToEmailMap':_0x222683,'connectionNameToIdMap':_0x4c570d['nameToId'],'connectionIdToNameMap':_0x4c570d[_0x468eda(0x18a)],'connectionNameToTypeMap':_0x1ae000},_0x2de8d1=await executePushSegments(_0x2bbd31,_0x26f0c8[_0x468eda(0x199)]?[]:_0x3135aa,_0x413c2a,{'parentId':_0xafeda5},_0x5c4a3f),_0x30567=_0x2de8d1[_0x468eda(0x1c5)],_0x5343ba=_0x2de8d1['updated'],_0x5dec41=_0x2de8d1[_0x468eda(0x194)][_0x468eda(0x1c5)],_0x47ca6f=_0x2de8d1[_0x468eda(0x194)]['updated'],_0x3a4ddf=_0x2de8d1[_0x468eda(0x194)][_0x468eda(0x1d8)],_0x5ea4d3=await executePushSegmentDeletions(_0x2bbd31,_0x26f0c8[_0x468eda(0x199)]?[]:_0x3b5667,_0x5c4a3f);let _0x32da82=0x0,_0x2a9695=0x0,_0x5a3342=0x0;const _0xc77e66=new Map(_0x56d7d5);for(const [_0x3a1aa0,_0xcf642e]of _0x2de8d1[_0x468eda(0x179)]){_0xc77e66[_0x468eda(0x16b)](_0x3a1aa0,_0xcf642e);}if(_0x3a7416[_0x468eda(0x1ba)]>0x0){const _0x135c9f={..._0x413c2a,'segmentNameToId':_0xc77e66,'existingSegments':_0xdb339f,'activationContext':_0x17087f},_0x5d08e8=await executePushJourneys(_0x2bbd31,_0x3a7416,_0x135c9f,{'parentId':_0xafeda5,'rootFolderId':_0x116de1,'verbose':_0x26f0c8['verbose']},_0x5c4a3f);_0x32da82=_0x5d08e8[_0x468eda(0x1c5)],_0x2a9695=_0x5d08e8[_0x468eda(0x17f)];if(_0x3fb7f0&&_0x5d08e8[_0x468eda(0x1b8)][_0x468eda(0x1ba)]===0x1){const _0x19919c=_0x5d08e8[_0x468eda(0x1b8)][0x0];if(_0x19919c[_0x468eda(0x175)]){const _0x12772e=getConsoleNextUrl(_0x26f0c8[_0x468eda(0x176)],_0x468eda(0x198)+_0xafeda5+_0x468eda(0x1d3)+_0x19919c['journeyId']+_0x468eda(0x1a8));console['error']('\x20\x20'+a32_0x4d4cc0['cyan'](_0x12772e));}}}for(const _0x868669 of _0x3a0b56){console['error'](a32_0x4d4cc0[_0x468eda(0x195)](_0x468eda(0x1ca)+_0x868669[_0x468eda(0x1dd)])),_0x5a3342++;}const _0xeb0efb=[];if(_0x30567>0x0)_0xeb0efb['push'](_0x30567+'\x20created');if(_0x5343ba>0x0)_0xeb0efb[_0x468eda(0x1b7)](_0x5343ba+_0x468eda(0x1ab));if(_0x5ea4d3>0x0)_0xeb0efb[_0x468eda(0x1b7)](_0x5ea4d3+'\x20deleted');const _0x16b30b=[];if(_0x32da82>0x0)_0x16b30b[_0x468eda(0x1b7)](_0x32da82+_0x468eda(0x196));if(_0x2a9695>0x0)_0x16b30b[_0x468eda(0x1b7)](_0x2a9695+_0x468eda(0x1ab));if(_0x5a3342>0x0)_0x16b30b[_0x468eda(0x1b7)](_0x5a3342+_0x468eda(0x1be));const _0x1b3d94=[];if(_0x5dec41>0x0)_0x1b3d94[_0x468eda(0x1b7)](_0x5dec41+_0x468eda(0x196));if(_0x47ca6f>0x0)_0x1b3d94[_0x468eda(0x1b7)](_0x47ca6f+_0x468eda(0x1ab));if(_0x3a4ddf>0x0)_0x1b3d94[_0x468eda(0x1b7)](_0x3a4ddf+_0x468eda(0x1be));return console['error'](a32_0x4d4cc0[_0x468eda(0x1b0)]('\x0aβœ”\x20Push\x20complete')),_0xeb0efb['length']>0x0&&!_0x26f0c8['journeysOnly']&&console[_0x468eda(0x174)](_0x468eda(0x1ae)+_0xeb0efb[_0x468eda(0x1c9)](',\x20')),_0x16b30b[_0x468eda(0x1ba)]>0x0&&console[_0x468eda(0x174)]('\x20\x20Journeys:\x20'+_0x16b30b['join'](',\x20')),_0x1b3d94[_0x468eda(0x1ba)]>0x0&&!_0x26f0c8[_0x468eda(0x199)]&&console[_0x468eda(0x174)]('\x20\x20Activations:\x20'+_0x1b3d94['join'](',\x20')),0x0;}}
1
+ const a32_0x29c238=a32_0x50dd;(function(_0x36b55a,_0x46db3d){const _0x29296a=a32_0x50dd,_0x5a7312=_0x36b55a();while(!![]){try{const _0x55cc61=parseInt(_0x29296a(0x133))/0x1*(parseInt(_0x29296a(0x12d))/0x2)+parseInt(_0x29296a(0xf2))/0x3+parseInt(_0x29296a(0xe2))/0x4*(-parseInt(_0x29296a(0x136))/0x5)+-parseInt(_0x29296a(0x108))/0x6*(-parseInt(_0x29296a(0x14f))/0x7)+-parseInt(_0x29296a(0xef))/0x8+parseInt(_0x29296a(0x10f))/0x9+-parseInt(_0x29296a(0x122))/0xa;if(_0x55cc61===_0x46db3d)break;else _0x5a7312['push'](_0x5a7312['shift']());}catch(_0x211704){_0x5a7312['push'](_0x5a7312['shift']());}}}(a32_0x4061,0x311f5));import{BaseCommand}from'./command.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';function a32_0x4061(){const _0xf3c01e=['attributes','audienceId','journeyId','user','71617vquQTR','nameToType','get','error','Fetching\x20existing\x20segments...','Fetching\x20existing\x20folders...','Error:\x20Directory\x20not\x20found:\x20','changed','updated','\x20changes?','filePath','cwd','\x27...','.yml','listActivations','.yaml','\x20unchanged','dim','\x20\x20Source:\x20','yes','filter','parent_name','state','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','unchanged','parentFolder','Preparing\x20journeys...','Fetching\x20parent\x20segment\x20details...','\x20\x20\x20\x20','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','Error\x20parsing\x20YAML:\x20','created','repeat','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','folderId','blue','segmentFolderId','parentName','no_parent','getJourney','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','journeyBundleName','red','then','13428kUfIkz','activations','endsWith','length','\x0aβœ”\x20Push\x20complete','results','list','\x20\x20πŸ“Š\x20Segments:','segments','createdAt','journeys','folderPath','description','918296qkZSph','listSegments','errorCode','25395HWmXzy','resolveParentId','all','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','createdSegmentIds','dryRun','updatedAt','set','nameToId','targetDir','getOutputSchemaWithCache','buildUserMaps','βœ”\x20All\x20journeys\x20are\x20up\x20to\x20date','data','/e/','type','/app/ps/','No\x20','delete','\x20\x20Journeys:\x20','Usage:\x20tdx\x20sg\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20(requires\x20context)','Fetching\x20existing\x20journeys...','138yDkNUS','segment:push','file','\x20deleted','\x20new','Fetching\x20users\x20for\x20email\x20resolution...','\x20created','1143360kFTOwG','isNew','idToName','execute','journey','\x20to\x20update','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','site','toDelete','existingJourney','join','\x20changed','journeysOnly','paused','parentSegment','add','βœ”\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','794510dCOUrn','setPhase','name','\x20to\x20delete','toCreate','\x20\x20Activations:\x20','scopedFolderPath','listJourneysWithDetailsFromParentSegment','\x20\x20Activations:','relationships','/j/da/je','82808ZKhrDC','green','helpText','verbose','Aborted.','πŸ“\x20','7uFWaaj','yamlConfig','yellow','395UJULCI','segment\x20or\x20journey','New\x20journey:','message','\x20activations]','push','diff','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','folders','\x20updated','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','Error:\x20','cyan','new','segment','\x0aPush\x20summary\x20for\x20\x27','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file','Folders\x20to\x20create:','connection','map','Resolving\x20parent\x20segment\x20\x27'];a32_0x4061=function(){return _0xf3c01e;};return a32_0x4061();}import{generateDiff,formatDiffWithColors}from'../utils/diff.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{batchAsync}from'../utils/async.js';import{segmentToYamlString,segmentWithActivationsToYaml}from'../sdk/segment/child-segment-yaml.js';import a32_0x3d67a8 from'chalk';import{existsSync}from'fs';function a32_0x50dd(_0x451670,_0x2864f3){_0x451670=_0x451670-0xd0;const _0x4061c5=a32_0x4061();let _0x50dd7a=_0x4061c5[_0x451670];return _0x50dd7a;}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{[a32_0x29c238(0x124)]=a32_0x29c238(0x109);[a32_0x29c238(0xee)]=a32_0x29c238(0xf5);async[a32_0x29c238(0x112)](_0x3cc3df){const _0x45570d=a32_0x29c238,{options:_0x275fe2,args:_0x46e823,tdx:_0x18d21f}=_0x3cc3df,_0x35bb2f=_0x275fe2,_0x462480=await resolveTarget({'arg':_0x46e823[0x0],'contextParent':_0x275fe2[_0x45570d(0x11e)],'cwd':process[_0x45570d(0x15a)]()});if(!isSuccessfulResolution(_0x462480))return _0x462480[_0x45570d(0xf1)]===_0x45570d(0xdc)?(console['error'](a32_0x3d67a8[_0x45570d(0x135)](_0x45570d(0x121))),console[_0x45570d(0x152)](_0x45570d(0x106)),console['error'](_0x45570d(0x140)),console[_0x45570d(0x152)](_0x45570d(0x146))):(console['error'](a32_0x3d67a8[_0x45570d(0xe0)](_0x45570d(0x141)+_0x462480['message']+'\x0a')),_0x462480[_0x45570d(0x12f)]&&console[_0x45570d(0x152)](a32_0x3d67a8[_0x45570d(0x142)](_0x462480[_0x45570d(0x12f)]))),0x1;if(_0x462480[_0x45570d(0x101)]===_0x45570d(0x164))return console[_0x45570d(0x152)](a32_0x3d67a8[_0x45570d(0xe0)](_0x45570d(0x155)+_0x462480[_0x45570d(0xfb)]+'\x0a')),console[_0x45570d(0x152)](a32_0x3d67a8[_0x45570d(0x142)]('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;const _0x23b743=_0x462480[_0x45570d(0xdb)],_0x3c23d8=_0x462480[_0x45570d(0xfb)],_0x1a1b7b=_0x462480['type']===_0x45570d(0x10a)?_0x462480[_0x45570d(0x159)]:undefined,_0x27882a=getScopedDetails(_0x462480),_0x65ebe2=_0x27882a?.['isScoped']??![],_0x3833ec=_0x27882a?.[_0x45570d(0x128)]??'';if(!existsSync(_0x3c23d8))return console[_0x45570d(0x152)](a32_0x3d67a8['red'](_0x45570d(0x155)+_0x3c23d8+'\x0a')),console[_0x45570d(0x152)](a32_0x3d67a8['cyan']('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;_0x35bb2f[_0x45570d(0x130)]&&(console[_0x45570d(0x152)]('Site:\x20'+_0x35bb2f[_0x45570d(0x117)]),console[_0x45570d(0x152)]('Parent\x20segment:\x20'+_0x23b743),console[_0x45570d(0x152)]('Source\x20directory:\x20'+_0x3c23d8),_0x65ebe2&&console[_0x45570d(0x152)]('Scoped\x20to\x20folder:\x20'+_0x3833ec));const _0x201b1f=await withSpinner(_0x45570d(0x14a)+_0x23b743+_0x45570d(0x15b),()=>_0x18d21f[_0x45570d(0x144)][_0x45570d(0xf3)](_0x23b743),{'verbose':_0x35bb2f['verbose']}),_0x15cdb6=_0x201b1f[_0x45570d(0xff)],[_0x94d6a5,_0x424d53,_0x14182f,_0x33765b,_0x5f498d]=await Promise[_0x45570d(0xf4)]([withSpinner(_0x45570d(0xd1),()=>_0x18d21f[_0x45570d(0x144)]['getParent'](_0x15cdb6),{'verbose':_0x35bb2f[_0x45570d(0x130)]}),withSpinner(_0x45570d(0x153),()=>_0x18d21f['segment'][_0x45570d(0xf0)](_0x15cdb6),{'verbose':_0x35bb2f[_0x45570d(0x130)]}),withSpinner(_0x45570d(0x154),()=>_0x18d21f[_0x45570d(0x144)]['listFolders'](_0x15cdb6),{'verbose':_0x35bb2f[_0x45570d(0x130)]}),withSpinner(_0x45570d(0x107),()=>_0x18d21f[_0x45570d(0x113)][_0x45570d(0x129)](_0x15cdb6,{'includeAllVersions':!![]}),{'verbose':_0x35bb2f[_0x45570d(0x130)]}),withSpinner(_0x45570d(0x10d),()=>_0x18d21f[_0x45570d(0x14e)][_0x45570d(0xfd)](),{'verbose':_0x35bb2f['verbose']})[_0x45570d(0xe1)](_0x28b9aa=>_0x28b9aa[_0x45570d(0xff)])]),_0x213fce=_0x94d6a5[_0x45570d(0xff)],_0x4695bf=extractRootFolderId(_0x213fce),_0x4b323a=_0x424d53[_0x45570d(0xff)],_0x49ea76=_0x14182f[_0x45570d(0xff)],{journeys:_0x26473c,activationStepsById:_0x5f1a27}=_0x33765b[_0x45570d(0xff)],_0x558820=new Map(_0x26473c[_0x45570d(0x149)](_0x38b796=>[_0x38b796['id'],_0x38b796])),_0x536ffe=_0x26473c[_0x45570d(0x149)](_0xa9eda8=>({'id':_0xa9eda8['id'],'name':_0xa9eda8[_0x45570d(0x14b)][_0x45570d(0x124)],'journeyBundleName':_0xa9eda8[_0x45570d(0x14b)][_0x45570d(0xdf)]||'','journeyBundleId':_0xa9eda8[_0x45570d(0x14b)]['journeyBundleId']||'','versionNumber':_0xa9eda8[_0x45570d(0x14b)]['versionNumber'],'description':_0xa9eda8[_0x45570d(0x14b)][_0x45570d(0xee)],'state':_0xa9eda8['attributes'][_0x45570d(0x165)],'paused':_0xa9eda8[_0x45570d(0x14b)][_0x45570d(0x11d)],'audienceId':_0xa9eda8['attributes'][_0x45570d(0x14c)],'folderId':_0xa9eda8[_0x45570d(0x12b)]?.[_0x45570d(0x168)]?.[_0x45570d(0xff)]?.['id'],'createdAt':_0xa9eda8[_0x45570d(0x14b)][_0x45570d(0xeb)],'updatedAt':_0xa9eda8[_0x45570d(0x14b)][_0x45570d(0xf8)]})),{emailToId:_0x5e15d8,idToEmail:_0x4d07e2}=_0x5f498d,_0x3e8d17=await withSpinner('Fetching\x20connections\x20for\x20name\x20resolution...',async()=>{const _0xf154e8=_0x45570d,_0x13c1d4=await _0x18d21f[_0xf154e8(0x148)][_0xf154e8(0xe8)]();return buildConnectionMaps(_0x13c1d4);},{'verbose':_0x35bb2f[_0x45570d(0x130)]})['then'](_0x4b1090=>_0x4b1090[_0x45570d(0xff)]),_0x3c783d=_0x3e8d17[_0x45570d(0xfa)],_0x2932be=_0x3e8d17[_0x45570d(0x111)],_0x19631a=_0x3e8d17[_0x45570d(0x150)],_0x175b4b={'emailToIdMap':_0x5e15d8,'connectionNameToIdMap':_0x3c783d,'connectionNameToTypeMap':_0x19631a,'getSchema':_0x56e95f=>_0x18d21f[_0x45570d(0x148)][_0x45570d(0xfc)](_0x56e95f)};let {pathToId:_0x571a05,idToPath:_0x50d6c7}=buildFolderMaps(_0x49ea76);const _0x1842a3=buildSegmentLookupMap(_0x4b323a,_0x50d6c7),_0x709e84=buildSegmentNameToIdMap(_0x4b323a),_0x210db5=buildJourneyBundleLookupMap(_0x536ffe,_0x50d6c7);let _0x4a3b4d;if(_0x1a1b7b){if(!_0x1a1b7b['endsWith'](_0x45570d(0x15c))&&!_0x1a1b7b[_0x45570d(0xe4)](_0x45570d(0x15e)))return console[_0x45570d(0x152)](a32_0x3d67a8['red'](_0x45570d(0x116)+_0x1a1b7b+'\x0a')),0x1;_0x4a3b4d=[_0x1a1b7b];}else _0x4a3b4d=findYamlFiles(_0x3c23d8);if(_0x4a3b4d['length']===0x0)return console[_0x45570d(0x152)](a32_0x3d67a8[_0x45570d(0xe0)](_0x45570d(0xd3)+_0x3c23d8+'\x0a')),console[_0x45570d(0x152)](a32_0x3d67a8[_0x45570d(0x142)](_0x45570d(0x13d))),0x1;let _0x1c8693,_0x38a154;try{const _0x5e5424=parseAndClassifyYamlFiles(_0x4a3b4d,_0x3c23d8,{'skipSegments':_0x35bb2f['journeysOnly']});_0x1c8693=_0x5e5424[_0x45570d(0xea)],_0x38a154=_0x5e5424[_0x45570d(0xec)];const _0x23e905=validateParsedFiles(_0x5e5424,_0x3c23d8);if(_0x23e905[_0x45570d(0xe5)]>0x0)return console[_0x45570d(0x152)](a32_0x3d67a8[_0x45570d(0xe0)]('\x0aValidation\x20failed:')),console[_0x45570d(0x152)](formatValidationErrors(_0x23e905)),console[_0x45570d(0x152)](a32_0x3d67a8[_0x45570d(0x135)]('\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.')),0x1;}catch(_0x4c3409){return console[_0x45570d(0x152)](a32_0x3d67a8[_0x45570d(0xe0)](_0x45570d(0xd4)+(_0x4c3409 instanceof Error?_0x4c3409[_0x45570d(0x139)]:_0x4c3409))),0x1;}if(_0x1c8693[_0x45570d(0xe5)]===0x0&&_0x38a154[_0x45570d(0xe5)]===0x0){const _0x24158e=_0x35bb2f['journeysOnly']?_0x45570d(0x113):_0x45570d(0x137);return console[_0x45570d(0x152)](a32_0x3d67a8[_0x45570d(0x135)](_0x45570d(0x103)+_0x24158e+'\x20YAML\x20files\x20found')),0x0;}const _0x36343e=new Map();_0x4b323a[_0x45570d(0xe5)]>0x0&&!_0x35bb2f[_0x45570d(0x11c)]&&await withSpinner('Fetching\x20existing\x20activations...',async()=>{await batchAsync(_0x4b323a,async _0x230e07=>{const _0x32c688=a32_0x50dd,_0x45a0c2=await _0x18d21f[_0x32c688(0x144)][_0x32c688(0x15d)](_0x15cdb6,_0x230e07['id']);_0x36343e[_0x32c688(0xf9)](_0x230e07['id'],_0x45a0c2);});},{'verbose':_0x35bb2f['verbose']});const {segmentFiles:_0x1d07ae,foldersToCreate:_0x4962b4}=await prepareSegmentFiles(_0x1c8693,{'segmentByFolderAndName':_0x1842a3,'activationsBySegmentId':_0x36343e,'folderPathToId':_0x571a05,'idToEmailMap':_0x4d07e2,'connectionIdToNameMap':_0x2932be},_0x175b4b,_0x65ebe2,_0x3833ec),_0x33161c=_0x1a1b7b?[]:findSegmentsToDelete(_0x4b323a,_0x1c8693[_0x45570d(0x149)](({yamlConfig:_0x317e55,folderPath:_0x3482fa})=>({'yamlConfig':_0x317e55,'folderPath':resolveTDFolderPath(_0x3482fa,_0x65ebe2,_0x3833ec)})),_0x50d6c7,_0x3833ec,_0x65ebe2),{journeyFiles:_0x44c25d,foldersToCreate:_0x461749}=await withProgressSpinner(_0x45570d(0xd0),async _0x8b9fe=>prepareJourneyFiles(_0x38a154,{'fetchJourney':async _0x1d457b=>_0x18d21f['journey'][_0x45570d(0xdd)](_0x1d457b[_0x45570d(0x14d)]),'journeyBundlesByFolderAndName':_0x210db5,'folderPathToId':_0x571a05,'idToEmailMap':_0x4d07e2,'connectionIdToNameMap':_0x2932be,'existingSegments':_0x4b323a,'parentId':_0x15cdb6,'deps':_0x18d21f,'progress':{'update':_0x689261=>{const _0x1a8e3d=_0x45570d;_0x8b9fe[_0x1a8e3d(0x123)](_0x689261),_0x35bb2f['verbose']&&console['error']('\x20\x20'+_0x689261);}},'journeyById':_0x558820,'activationStepsById':_0x5f1a27},_0x65ebe2,_0x3833ec),{'verbose':_0x35bb2f[_0x45570d(0x130)]})[_0x45570d(0xe1)](_0x284151=>_0x284151[_0x45570d(0xff)]);for(const _0x4388d4 of _0x461749){_0x4962b4[_0x45570d(0x11f)](_0x4388d4);}const _0x20cdd3=_0x1a1b7b?[]:findJourneysToDelete(_0x536ffe,_0x38a154[_0x45570d(0x149)](({yamlConfig:_0x35690a,folderPath:_0x5bb0f8})=>({'yamlConfig':_0x35690a,'folderPath':resolveTDFolderPath(_0x5bb0f8,_0x65ebe2,_0x3833ec)})),_0x50d6c7,_0x3833ec,_0x65ebe2),_0x10ae14=calculatePushStats(_0x1d07ae,_0x44c25d,_0x4962b4,_0x33161c,_0x20cdd3,!!_0x35bb2f[_0x45570d(0x104)],!!_0x35bb2f[_0x45570d(0x11c)]),_0x65d4dd=_0x10ae14[_0x45570d(0xea)][_0x45570d(0x143)],_0x20efcf=_0x10ae14['segments']['changed'],_0x543082=_0x10ae14[_0x45570d(0xea)][_0x45570d(0x167)],_0x3d952a=_0x10ae14['segments']['toDelete'],_0x3d1b46=_0x10ae14[_0x45570d(0x13e)][_0x45570d(0x126)],_0x150d93=_0x10ae14[_0x45570d(0xec)][_0x45570d(0x143)],_0x4ed5a3=_0x10ae14[_0x45570d(0xec)][_0x45570d(0x156)],_0x167f25=_0x10ae14[_0x45570d(0xec)][_0x45570d(0x167)],_0x56c3f5=_0x10ae14[_0x45570d(0xec)][_0x45570d(0x118)],_0x5bbad3=_0x10ae14[_0x45570d(0xe3)]['all'],_0x59f594=_0x10ae14[_0x45570d(0xe3)][_0x45570d(0x126)],_0x424124=_0x10ae14[_0x45570d(0xe3)]['toUpdate'],_0x19f0e6=_0x10ae14[_0x45570d(0xe3)][_0x45570d(0x118)];console[_0x45570d(0x152)](_0x45570d(0x145)+_0x23b743+'\x27:');_0x3d1b46[_0x45570d(0xe5)]>0x0&&console[_0x45570d(0x152)]('\x20\x20'+a32_0x3d67a8[_0x45570d(0xd9)](_0x45570d(0x132)+_0x3d1b46[_0x45570d(0xe5)]+'\x20folders\x20to\x20create'));if(!_0x35bb2f[_0x45570d(0x11c)]){console[_0x45570d(0x152)](_0x45570d(0xe9)),console[_0x45570d(0x152)]('\x20\x20\x20\x20'+a32_0x3d67a8[_0x45570d(0x12e)]('+\x20'+_0x65d4dd['length']+_0x45570d(0x10c))),console[_0x45570d(0x152)](_0x45570d(0xd2)+a32_0x3d67a8[_0x45570d(0x135)]('~\x20'+_0x20efcf[_0x45570d(0xe5)]+_0x45570d(0x11b)));if(_0x3d952a[_0x45570d(0xe5)]>0x0)console['error'](_0x45570d(0xd2)+a32_0x3d67a8[_0x45570d(0xe0)]('-\x20'+_0x3d952a['length']+_0x45570d(0x125)));else _0x33161c[_0x45570d(0xe5)]>0x0&&!_0x35bb2f[_0x45570d(0x104)]&&console['error'](_0x45570d(0xd2)+a32_0x3d67a8[_0x45570d(0x160)](_0x33161c['length']+'\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)'));console[_0x45570d(0x152)](_0x45570d(0xd2)+a32_0x3d67a8[_0x45570d(0x160)]('=\x20'+_0x543082['length']+_0x45570d(0x15f)));}if(_0x44c25d[_0x45570d(0xe5)]>0x0||_0x20cdd3[_0x45570d(0xe5)]>0x0){console[_0x45570d(0x152)]('\x20\x20πŸ—ΊοΈ\x20\x20Journeys:'),console[_0x45570d(0x152)](_0x45570d(0xd2)+a32_0x3d67a8['green']('+\x20'+_0x150d93[_0x45570d(0xe5)]+'\x20new')),console[_0x45570d(0x152)](_0x45570d(0xd2)+a32_0x3d67a8['yellow']('~\x20'+_0x4ed5a3[_0x45570d(0xe5)]+'\x20changed'));if(_0x56c3f5[_0x45570d(0xe5)]>0x0)console[_0x45570d(0x152)](_0x45570d(0xd2)+a32_0x3d67a8[_0x45570d(0xe0)]('-\x20'+_0x56c3f5['length']+_0x45570d(0x125)));else _0x20cdd3[_0x45570d(0xe5)]>0x0&&!_0x35bb2f[_0x45570d(0x104)]&&console['error'](_0x45570d(0xd2)+a32_0x3d67a8['dim'](_0x20cdd3['length']+_0x45570d(0xde)));console[_0x45570d(0x152)]('\x20\x20\x20\x20'+a32_0x3d67a8['dim']('=\x20'+_0x167f25[_0x45570d(0xe5)]+_0x45570d(0x15f)));}_0x5bbad3['length']>0x0&&!_0x35bb2f['journeysOnly']&&(console[_0x45570d(0x152)](''),console[_0x45570d(0x152)](_0x45570d(0x12a)),_0x59f594[_0x45570d(0xe5)]>0x0&&console['error'](_0x45570d(0xd2)+a32_0x3d67a8[_0x45570d(0x12e)]('+\x20'+_0x59f594[_0x45570d(0xe5)]+'\x20to\x20create')),_0x424124[_0x45570d(0xe5)]>0x0&&console['error'](_0x45570d(0xd2)+a32_0x3d67a8[_0x45570d(0x135)]('~\x20'+_0x424124['length']+_0x45570d(0x114))),_0x19f0e6[_0x45570d(0xe5)]>0x0&&console['error'](_0x45570d(0xd2)+a32_0x3d67a8[_0x45570d(0xe0)]('-\x20'+_0x19f0e6['length']+_0x45570d(0x125))));console[_0x45570d(0x152)](_0x45570d(0x161)+a32_0x3d67a8[_0x45570d(0x142)](_0x3c23d8)+'\x0a');if(_0x3d1b46['length']>0x0){console[_0x45570d(0x152)](_0x45570d(0x147));for(const _0x131271 of _0x3d1b46){console[_0x45570d(0x152)]('\x20\x20'+a32_0x3d67a8['blue']('+')+'\x20'+_0x131271);}console['error']('');}if(_0x65d4dd[_0x45570d(0xe5)]>0x0&&!_0x35bb2f[_0x45570d(0x11c)])for(const _0x153c20 of _0x65d4dd){const _0x55c371=_0x153c20[_0x45570d(0xed)]?_0x153c20[_0x45570d(0xed)]+'/'+_0x153c20[_0x45570d(0x134)][_0x45570d(0x124)]:_0x153c20['yamlConfig'][_0x45570d(0x124)],_0x580507=_0x153c20[_0x45570d(0x134)][_0x45570d(0xe3)]?.[_0x45570d(0xe5)]||0x0,_0x48c85c=_0x580507>0x0?a32_0x3d67a8[_0x45570d(0x160)]('\x20['+_0x580507+_0x45570d(0x13a)):'';console[_0x45570d(0x152)]('\x0a'+a32_0x3d67a8['green']('New\x20segment:')+'\x20'+_0x55c371+_0x48c85c),console[_0x45570d(0x152)]('─'[_0x45570d(0xd6)](0x3c)),_0x153c20['diff']&&console[_0x45570d(0x152)](_0x153c20['diff']),console[_0x45570d(0x152)]('─'['repeat'](0x3c));}if(_0x3d952a[_0x45570d(0xe5)]>0x0&&!_0x35bb2f[_0x45570d(0x11c)])for(const _0x48be7f of _0x3d952a){const _0x11a801=_0x48be7f[_0x45570d(0xda)]?_0x50d6c7['get'](_0x48be7f['segmentFolderId']['toString']())||'':'',_0x9e2d7d=_0x11a801?_0x11a801+'/'+_0x48be7f['name']:_0x48be7f[_0x45570d(0x124)],_0x2c8f1a=_0x36343e[_0x45570d(0x151)](_0x48be7f['id'])||[],_0x1acd5f=_0x2c8f1a['length']>0x0?a32_0x3d67a8[_0x45570d(0x160)]('\x20['+_0x2c8f1a[_0x45570d(0xe5)]+_0x45570d(0x13a)):'';console[_0x45570d(0x152)]('\x0a'+a32_0x3d67a8[_0x45570d(0xe0)]('Delete\x20segment:')+'\x20'+_0x9e2d7d+_0x1acd5f),console['error']('─'[_0x45570d(0xd6)](0x3c));const _0x209ec9=segmentWithActivationsToYaml(_0x48be7f,_0x2c8f1a,undefined,_0x4d07e2,_0x2932be),_0x1b8c94=segmentToYamlString(_0x209ec9),_0x23bba1=generateDiff(_0x1b8c94,'');console['error'](formatDiffWithColors(_0x23bba1)),console[_0x45570d(0x152)]('─'[_0x45570d(0xd6)](0x3c));}const _0x4d0e61=_0x1d07ae[_0x45570d(0x163)](_0x338b10=>!_0x338b10[_0x45570d(0x110)]&&_0x338b10['diff']);if(_0x4d0e61[_0x45570d(0xe5)]>0x0&&!_0x35bb2f[_0x45570d(0x11c)])for(const _0x129b3e of _0x4d0e61){const _0x1bb3fa=_0x129b3e[_0x45570d(0xed)]?_0x129b3e[_0x45570d(0xed)]+'/'+_0x129b3e[_0x45570d(0x134)][_0x45570d(0x124)]:_0x129b3e['yamlConfig'][_0x45570d(0x124)];console[_0x45570d(0x152)]('\x0a'+a32_0x3d67a8[_0x45570d(0x135)]('Changes\x20to:')+'\x20'+_0x1bb3fa),console[_0x45570d(0x152)]('─'[_0x45570d(0xd6)](0x3c)),console[_0x45570d(0x152)](_0x129b3e[_0x45570d(0x13c)]),console['error']('─'[_0x45570d(0xd6)](0x3c));}if(_0x150d93[_0x45570d(0xe5)]>0x0)for(const _0x43f594 of _0x150d93){const _0x59f601=_0x43f594[_0x45570d(0xed)]?_0x43f594['folderPath']+'/'+_0x43f594[_0x45570d(0x134)][_0x45570d(0x124)]:_0x43f594[_0x45570d(0x134)][_0x45570d(0x124)];console[_0x45570d(0x152)]('\x0a'+a32_0x3d67a8[_0x45570d(0x12e)](_0x45570d(0x138))+'\x20'+_0x59f601),console['error']('─'[_0x45570d(0xd6)](0x3c)),_0x43f594[_0x45570d(0x13c)]&&console['error'](_0x43f594[_0x45570d(0x13c)]),console[_0x45570d(0x152)]('─'[_0x45570d(0xd6)](0x3c));}const _0x53a4e4=_0x44c25d[_0x45570d(0x163)](_0x10ed81=>!_0x10ed81[_0x45570d(0x110)]&&_0x10ed81[_0x45570d(0x13c)]);if(_0x53a4e4[_0x45570d(0xe5)]>0x0)for(const _0x2ff7eb of _0x53a4e4){const _0x357f2f=_0x2ff7eb[_0x45570d(0xed)]?_0x2ff7eb[_0x45570d(0xed)]+'/'+_0x2ff7eb['yamlConfig'][_0x45570d(0x124)]:_0x2ff7eb['yamlConfig'][_0x45570d(0x124)];console['error']('\x0a'+a32_0x3d67a8[_0x45570d(0x135)]('Changes\x20to\x20journey:')+'\x20'+_0x357f2f),console['error']('─'[_0x45570d(0xd6)](0x3c)),console[_0x45570d(0x152)](_0x2ff7eb[_0x45570d(0x13c)]),console['error']('─'[_0x45570d(0xd6)](0x3c));}if(_0x56c3f5[_0x45570d(0xe5)]>0x0)for(const _0x599b0c of _0x56c3f5){const _0x3525ce=_0x599b0c[_0x45570d(0xd8)]?_0x50d6c7[_0x45570d(0x151)](_0x599b0c[_0x45570d(0xd8)])||'':'',_0x5cdbf2=_0x3525ce?_0x3525ce+'/'+_0x599b0c[_0x45570d(0xdf)]:_0x599b0c['journeyBundleName'];console[_0x45570d(0x152)]('\x0a'+a32_0x3d67a8[_0x45570d(0xe0)]('Delete\x20journey:')+'\x20'+_0x5cdbf2),console[_0x45570d(0x152)]('─'['repeat'](0x3c)),console[_0x45570d(0x152)](a32_0x3d67a8['red']('(Journey\x20will\x20be\x20deleted)')),console[_0x45570d(0x152)]('─'[_0x45570d(0xd6)](0x3c));}if(_0x35bb2f[_0x45570d(0xf7)])return console[_0x45570d(0x152)](a32_0x3d67a8[_0x45570d(0x135)](_0x45570d(0x166))),0x0;const _0x297265=_0x35bb2f['journeysOnly']?![]:_0x65d4dd[_0x45570d(0xe5)]>0x0||_0x20efcf[_0x45570d(0xe5)]>0x0||_0x3d952a[_0x45570d(0xe5)]>0x0,_0x51dd21=_0x150d93[_0x45570d(0xe5)]>0x0||_0x4ed5a3[_0x45570d(0xe5)]>0x0||_0x56c3f5['length']>0x0,_0x14a3a4=_0x35bb2f[_0x45570d(0x11c)]?![]:_0x5bbad3[_0x45570d(0xe5)]>0x0,_0x7efeb3=_0x3d1b46[_0x45570d(0xe5)]>0x0;if(!_0x297265&&!_0x51dd21&&!_0x14a3a4&&!_0x7efeb3){const _0x4beaae=_0x35bb2f['journeysOnly']?_0x45570d(0xfe):_0x45570d(0x120);console[_0x45570d(0x152)](a32_0x3d67a8[_0x45570d(0x12e)](_0x4beaae));if(_0x1a1b7b&&_0x167f25['length']===0x1){const _0x3d2e58=_0x167f25[0x0];if(_0x3d2e58[_0x45570d(0x119)]?.['id']){const _0x220a8b=getConsoleNextUrl(_0x35bb2f[_0x45570d(0x117)],_0x45570d(0x102)+_0x15cdb6+_0x45570d(0x100)+_0x3d2e58[_0x45570d(0x119)]['id']+_0x45570d(0x12c));console[_0x45570d(0x152)]('\x20\x20'+a32_0x3d67a8['cyan'](_0x220a8b));}}return 0x0;}const _0x2ef936=_0x35bb2f[_0x45570d(0x11c)]?_0x150d93[_0x45570d(0xe5)]+_0x4ed5a3[_0x45570d(0xe5)]+_0x56c3f5['length']+_0x3d1b46['length']:_0x65d4dd[_0x45570d(0xe5)]+_0x20efcf[_0x45570d(0xe5)]+_0x3d952a[_0x45570d(0xe5)]+_0x150d93[_0x45570d(0xe5)]+_0x4ed5a3[_0x45570d(0xe5)]+_0x56c3f5[_0x45570d(0xe5)]+_0x3d1b46[_0x45570d(0xe5)]+_0x5bbad3[_0x45570d(0xe5)];if(!_0x35bb2f[_0x45570d(0x162)]&&_0x2ef936>0x0){if(!isInteractive())return console[_0x45570d(0x152)](a32_0x3d67a8[_0x45570d(0xe0)]('\x0aError:'),_0x45570d(0x115)),console[_0x45570d(0x152)](a32_0x3d67a8['dim'](_0x45570d(0xd7))),0x1;const _0x108634=await confirmKey('Push\x20'+_0x2ef936+_0x45570d(0x158));if(!_0x108634)return console[_0x45570d(0x152)](a32_0x3d67a8['yellow'](_0x45570d(0x131))),0x1;}const _0x4fc351={'withProgress':async(_0x589bd7,_0x40567d)=>{const _0xe51029=_0x45570d,_0x473a23=await withSpinner(_0x589bd7,_0x40567d,{'verbose':_0x35bb2f[_0xe51029(0x130)]});return{'data':_0x473a23[_0xe51029(0xff)]};},'logInfo':_0x5d0b8a=>console['error'](a32_0x3d67a8[_0x45570d(0xd9)]('βœ”\x20'+_0x5d0b8a)),'logSuccess':_0x56191f=>console[_0x45570d(0x152)](a32_0x3d67a8[_0x45570d(0x12e)]('βœ”\x20'+_0x56191f)),'logWarning':_0xd73035=>console[_0x45570d(0x152)](a32_0x3d67a8[_0x45570d(0x135)]('⚠\x20'+_0xd73035)),'logDeleted':_0x118c8c=>console['error'](a32_0x3d67a8[_0x45570d(0xe0)]('βœ”\x20'+_0x118c8c))},_0x9faacc={'segment':_0x18d21f['segment'],'journey':_0x18d21f[_0x45570d(0x113)],'user':_0x18d21f[_0x45570d(0x14e)],'connection':_0x18d21f[_0x45570d(0x148)]};_0x3d1b46['length']>0x0&&(_0x571a05=await executePushFolders(_0x9faacc,_0x3d1b46,_0x571a05,{'parentId':_0x15cdb6},_0x4fc351));const _0x1cffb8={'rootFolderId':_0x4695bf,'folderPathToId':_0x571a05,'folderIdToPath':_0x50d6c7,'segmentNameToId':_0x709e84,'activationsBySegmentId':_0x36343e,'emailToIdMap':_0x5e15d8,'idToEmailMap':_0x4d07e2,'connectionNameToIdMap':_0x3e8d17[_0x45570d(0xfa)],'connectionIdToNameMap':_0x3e8d17['idToName'],'connectionNameToTypeMap':_0x19631a},_0x59996e=await executePushSegments(_0x9faacc,_0x35bb2f[_0x45570d(0x11c)]?[]:_0x1d07ae,_0x1cffb8,{'parentId':_0x15cdb6},_0x4fc351),_0x5f2065=_0x59996e[_0x45570d(0xd5)],_0x72a607=_0x59996e[_0x45570d(0x157)],_0x5808a4=_0x59996e['activations'][_0x45570d(0xd5)],_0x5522b9=_0x59996e['activations'][_0x45570d(0x157)],_0x44813c=_0x59996e[_0x45570d(0xe3)]['deleted'],_0x2b1797=await executePushSegmentDeletions(_0x9faacc,_0x35bb2f[_0x45570d(0x11c)]?[]:_0x3d952a,_0x4fc351);let _0x266775=0x0,_0x2cd829=0x0,_0x48e435=0x0;const _0x436331=new Map(_0x709e84);for(const [_0x5d518c,_0x23eeb7]of _0x59996e[_0x45570d(0xf6)]){_0x436331[_0x45570d(0xf9)](_0x5d518c,_0x23eeb7);}if(_0x44c25d[_0x45570d(0xe5)]>0x0){const _0x3be308={..._0x1cffb8,'segmentNameToId':_0x436331,'existingSegments':_0x4b323a,'activationContext':_0x175b4b},_0x76f0ef=await executePushJourneys(_0x9faacc,_0x44c25d,_0x3be308,{'parentId':_0x15cdb6,'rootFolderId':_0x4695bf,'verbose':_0x35bb2f[_0x45570d(0x130)]},_0x4fc351);_0x266775=_0x76f0ef[_0x45570d(0xd5)],_0x2cd829=_0x76f0ef[_0x45570d(0x157)];if(_0x1a1b7b&&_0x76f0ef['results']['length']===0x1){const _0x1ef8f1=_0x76f0ef[_0x45570d(0xe7)][0x0];if(_0x1ef8f1[_0x45570d(0x14d)]){const _0x2c53b8=getConsoleNextUrl(_0x35bb2f[_0x45570d(0x117)],_0x45570d(0x102)+_0x15cdb6+_0x45570d(0x100)+_0x1ef8f1['journeyId']+_0x45570d(0x12c));console['error']('\x20\x20'+a32_0x3d67a8['cyan'](_0x2c53b8));}}}for(const _0x559131 of _0x56c3f5){console[_0x45570d(0x152)](a32_0x3d67a8[_0x45570d(0x135)]('⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20'+_0x559131['journeyBundleName'])),_0x48e435++;}const _0x196e1e=[];if(_0x5f2065>0x0)_0x196e1e[_0x45570d(0x13b)](_0x5f2065+_0x45570d(0x10e));if(_0x72a607>0x0)_0x196e1e[_0x45570d(0x13b)](_0x72a607+_0x45570d(0x13f));if(_0x2b1797>0x0)_0x196e1e[_0x45570d(0x13b)](_0x2b1797+'\x20deleted');const _0xc4cdd=[];if(_0x266775>0x0)_0xc4cdd[_0x45570d(0x13b)](_0x266775+_0x45570d(0x10e));if(_0x2cd829>0x0)_0xc4cdd['push'](_0x2cd829+_0x45570d(0x13f));if(_0x48e435>0x0)_0xc4cdd[_0x45570d(0x13b)](_0x48e435+'\x20deleted');const _0x4506a3=[];if(_0x5808a4>0x0)_0x4506a3[_0x45570d(0x13b)](_0x5808a4+'\x20created');if(_0x5522b9>0x0)_0x4506a3[_0x45570d(0x13b)](_0x5522b9+_0x45570d(0x13f));if(_0x44813c>0x0)_0x4506a3['push'](_0x44813c+_0x45570d(0x10b));return console['error'](a32_0x3d67a8[_0x45570d(0x12e)](_0x45570d(0xe6))),_0x196e1e['length']>0x0&&!_0x35bb2f[_0x45570d(0x11c)]&&console[_0x45570d(0x152)]('\x20\x20Segments:\x20'+_0x196e1e[_0x45570d(0x11a)](',\x20')),_0xc4cdd[_0x45570d(0xe5)]>0x0&&console[_0x45570d(0x152)](_0x45570d(0x105)+_0xc4cdd[_0x45570d(0x11a)](',\x20')),_0x4506a3[_0x45570d(0xe5)]>0x0&&!_0x35bb2f[_0x45570d(0x11c)]&&console[_0x45570d(0x152)](_0x45570d(0x127)+_0x4506a3[_0x45570d(0x11a)](',\x20')),0x0;}}
@@ -1 +1 @@
1
- const a33_0x57e17d=a33_0x39f3;(function(_0x4e09a4,_0x28ff60){const _0x1f2513=a33_0x39f3,_0x45e0cc=_0x4e09a4();while(!![]){try{const _0x1f59d6=parseInt(_0x1f2513(0xba))/0x1+-parseInt(_0x1f2513(0xb6))/0x2+-parseInt(_0x1f2513(0xae))/0x3+-parseInt(_0x1f2513(0xa4))/0x4+-parseInt(_0x1f2513(0x9f))/0x5*(parseInt(_0x1f2513(0xa5))/0x6)+-parseInt(_0x1f2513(0xaf))/0x7+parseInt(_0x1f2513(0xc2))/0x8;if(_0x1f59d6===_0x28ff60)break;else _0x45e0cc['push'](_0x45e0cc['shift']());}catch(_0xe8a083){_0x45e0cc['push'](_0x45e0cc['shift']());}}}(a33_0x4fbe,0xdaef9));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';function a33_0x39f3(_0x2df3bf,_0x33a226){_0x2df3bf=_0x2df3bf-0x98;const _0x4fbe64=a33_0x4fbe();let _0x39f3ab=_0x4fbe64[_0x2df3bf];return _0x39f3ab;}import{loadJSONFromOptions}from'../utils/json-loader.js';import{SDKError,ErrorCode}from'../sdk/index.js';import a33_0x2ce27d from'chalk';export class SegmentUpdateCommand extends BaseCommand{[a33_0x57e17d(0xbf)]='segment:update';['description']=a33_0x57e17d(0x98);async[a33_0x57e17d(0xb8)](_0x52aa03){const _0x5b002f=a33_0x57e17d;console[_0x5b002f(0xc5)](a33_0x2ce27d[_0x5b002f(0xbe)](_0x5b002f(0xa9))),console[_0x5b002f(0xc5)](a33_0x2ce27d['yellow'](_0x5b002f(0xbd)));const {options:_0x5096a8,args:_0x24e623,tdx:_0x54d74b}=_0x52aa03,_0x4f3cfe=_0x5096a8;if(_0x24e623['length']===0x0)return console[_0x5b002f(0xc5)]('Error:\x20Segment\x20path\x20or\x20name\x20is\x20required'),console[_0x5b002f(0xc5)](_0x5b002f(0xaa)),console['error'](_0x5b002f(0xa6)),console['error']('\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22'),console[_0x5b002f(0xc5)](_0x5b002f(0xa1)),0x1;const _0x872862=_0x24e623[0x0],_0xd5fa12=_0x5096a8[_0x5b002f(0x9d)];let _0x156048=_0x872862;_0xd5fa12&&!_0x872862['includes']('/')&&(_0x156048=_0xd5fa12+'/'+_0x872862,_0x4f3cfe[_0x5b002f(0xb5)]&&console[_0x5b002f(0xc5)](_0x5b002f(0xb4)+_0x156048));const _0x483b2e=await withSpinner(_0x5b002f(0xbb)+_0x156048+_0x5b002f(0xa8),()=>_0x54d74b[_0x5b002f(0x9e)]['resolvePathToResource'](_0x156048),{'verbose':_0x4f3cfe[_0x5b002f(0xb5)]}),_0x25d0bd=_0x483b2e['data'];_0x4f3cfe[_0x5b002f(0xb5)]&&console[_0x5b002f(0xc5)]('Resolved\x20type:\x20'+_0x25d0bd['type']);if(_0x25d0bd['type']!==_0x5b002f(0x9e))return console['error'](_0x5b002f(0x9c)+_0x25d0bd[_0x5b002f(0xc4)]+_0x5b002f(0xc0)),console[_0x5b002f(0xc5)](_0x5b002f(0xa7)),0x1;if(!_0x25d0bd[_0x5b002f(0xc3)])throw new SDKError(ErrorCode[_0x5b002f(0xa2)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x282272=_0x25d0bd[_0x5b002f(0x9a)],_0x3b7ebe=_0x25d0bd['segmentId'];_0x4f3cfe[_0x5b002f(0xb5)]&&(console['error'](_0x5b002f(0xab)+_0x282272),console['error'](_0x5b002f(0xc1)+_0x3b7ebe));let _0x59daf8;if(_0x4f3cfe['folder']){const _0x1e64eb=_0x4f3cfe[_0x5b002f(0xb9)],_0xd0bff3=await withSpinner(_0x5b002f(0xb2)+_0x1e64eb+'\x27...',()=>_0x54d74b[_0x5b002f(0x9e)]['resolveFolderId'](_0x282272,_0x1e64eb),{'verbose':_0x4f3cfe[_0x5b002f(0xb5)]});_0x59daf8=parseInt(_0xd0bff3[_0x5b002f(0xb3)],0xa),_0x4f3cfe[_0x5b002f(0xb5)]&&console[_0x5b002f(0xc5)](_0x5b002f(0xad)+_0x59daf8);}const _0x5a675a=await loadJSONFromOptions(_0x4f3cfe[_0x5b002f(0xb1)],_0x4f3cfe[_0x5b002f(0xa3)]),_0x5567e6={'name':_0x4f3cfe[_0x5b002f(0xbf)],'description':_0x4f3cfe[_0x5b002f(0x99)],'rule':_0x5a675a,'kind':_0x4f3cfe[_0x5b002f(0xb7)]!==undefined?parseInt(_0x4f3cfe[_0x5b002f(0xb7)],0xa):undefined,'segmentFolderId':_0x59daf8},_0x26fc0d=await withSpinner(_0x5b002f(0xac)+_0x25d0bd[_0x5b002f(0xa0)]+_0x5b002f(0xa8),()=>_0x54d74b[_0x5b002f(0x9e)][_0x5b002f(0x9b)](_0x282272,_0x3b7ebe,_0x5567e6),{'verbose':_0x4f3cfe[_0x5b002f(0xb5)]}),_0x301ce2=_0x26fc0d[_0x5b002f(0xb3)];return console[_0x5b002f(0xc5)](_0x5b002f(0xb0)+_0x301ce2[_0x5b002f(0xbf)]+'\x27'),_0x156048!==_0x872862&&console[_0x5b002f(0xc5)](_0x5b002f(0xbc)+_0x156048),await handleSDKOutput([_0x301ce2],_0x4f3cfe),0x0;}}function a33_0x4fbe(){const _0x279428=['2763614TSnXgH','kind','execute','folder','1149821etPIzR','Resolving\x20path\x20\x27','\x20\x20\x20Path:\x20','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','yellow','name','.\x20Only\x20child\x20segments\x20can\x20be\x20updated.','Segment\x20ID:\x20','39712176lBtsWx','segmentId','type','error','Update\x20existing\x20child\x20segment','description','parentId','updateSegmentById','Error:\x20Cannot\x20update\x20','segmentPath','segment','233765cVsror','segmentName','\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','INTERNAL','ruleFile','2088880upmlYp','96jXOyYN','Examples:','Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]','\x27...','⚠\x20Deprecation\x20warning:\x20`segment\x20update`\x20is\x20deprecated.','Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]','Parent\x20ID:\x20','Updating\x20segment\x20\x27','Resolved\x20folder\x20ID:\x20','3232908wdRStC','10411597QCwJRT','βœ”\x20Updated\x20segment\x20\x27','rule','Resolving\x20folder\x20\x27','data','Resolved\x20relative\x20path\x20to:\x20','verbose'];a33_0x4fbe=function(){return _0x279428;};return a33_0x4fbe();}
1
+ function a33_0x3497(_0x2979f9,_0xbd0e8e){_0x2979f9=_0x2979f9-0x171;const _0x2db44a=a33_0x2db4();let _0x349791=_0x2db44a[_0x2979f9];return _0x349791;}const a33_0xdceb02=a33_0x3497;(function(_0x4e0834,_0x96c387){const _0x4b0d0e=a33_0x3497,_0x2f4bf3=_0x4e0834();while(!![]){try{const _0x42c6b8=parseInt(_0x4b0d0e(0x18d))/0x1*(-parseInt(_0x4b0d0e(0x197))/0x2)+parseInt(_0x4b0d0e(0x198))/0x3+parseInt(_0x4b0d0e(0x18b))/0x4*(-parseInt(_0x4b0d0e(0x172))/0x5)+parseInt(_0x4b0d0e(0x189))/0x6*(-parseInt(_0x4b0d0e(0x179))/0x7)+-parseInt(_0x4b0d0e(0x18a))/0x8+-parseInt(_0x4b0d0e(0x187))/0x9*(-parseInt(_0x4b0d0e(0x17a))/0xa)+parseInt(_0x4b0d0e(0x1a2))/0xb;if(_0x42c6b8===_0x96c387)break;else _0x2f4bf3['push'](_0x2f4bf3['shift']());}catch(_0x29943f){_0x2f4bf3['push'](_0x2f4bf3['shift']());}}}(a33_0x2db4,0xc780b));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{SDKError,ErrorCode}from'../sdk/index.js';function a33_0x2db4(){const _0x2fd898=['type','191044woWeop','1308264oWuQxW','Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]','.\x20Only\x20child\x20segments\x20can\x20be\x20updated.','rule','\x27...','data','Resolved\x20type:\x20','Resolving\x20folder\x20\x27','\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22','Update\x20existing\x20child\x20segment','34702393kNxIjm','Examples:','βœ”\x20Updated\x20segment\x20\x27','segmentId','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','5BDVLnT','Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]','\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','description','Segment\x20ID:\x20','Resolved\x20relative\x20path\x20to:\x20','segment','1908459eeKYPn','170530PgdKdg','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','⚠\x20Deprecation\x20warning:\x20`segment\x20update`\x20is\x20deprecated.','includes','error','name','updateSegmentById','\x20\x20\x20Path:\x20','resolvePathToResource','Segment\x20ID\x20missing\x20from\x20resolved\x20path','Parent\x20ID:\x20','Resolved\x20folder\x20ID:\x20','kind','342OAvjck','ruleFile','24FNsjGM','6861648VcFDhV','926648ZAmsjD','Resolving\x20path\x20\x27','13AkPNNt','yellow','length','Error:\x20Cannot\x20update\x20','INTERNAL','execute','segmentPath','verbose','Updating\x20segment\x20\x27'];a33_0x2db4=function(){return _0x2fd898;};return a33_0x2db4();}import a33_0x2b8ed8 from'chalk';export class SegmentUpdateCommand extends BaseCommand{[a33_0xdceb02(0x17f)]='segment:update';[a33_0xdceb02(0x175)]=a33_0xdceb02(0x1a1);async[a33_0xdceb02(0x192)](_0x12cc5a){const _0x583bb8=a33_0xdceb02;console[_0x583bb8(0x17e)](a33_0x2b8ed8[_0x583bb8(0x18e)](_0x583bb8(0x17c))),console[_0x583bb8(0x17e)](a33_0x2b8ed8[_0x583bb8(0x18e)](_0x583bb8(0x17b)));const {options:_0x597fc7,args:_0x4780c8,tdx:_0x6cbd93}=_0x12cc5a,_0x23ecee=_0x597fc7;if(_0x4780c8[_0x583bb8(0x18f)]===0x0)return console['error'](_0x583bb8(0x171)),console[_0x583bb8(0x17e)](_0x583bb8(0x199)),console[_0x583bb8(0x17e)](_0x583bb8(0x1a3)),console[_0x583bb8(0x17e)](_0x583bb8(0x1a0)),console['error'](_0x583bb8(0x174)),0x1;const _0x7e5be4=_0x4780c8[0x0],_0x2b2b34=_0x597fc7[_0x583bb8(0x193)];let _0xbd6e39=_0x7e5be4;_0x2b2b34&&!_0x7e5be4[_0x583bb8(0x17d)]('/')&&(_0xbd6e39=_0x2b2b34+'/'+_0x7e5be4,_0x23ecee[_0x583bb8(0x194)]&&console[_0x583bb8(0x17e)](_0x583bb8(0x177)+_0xbd6e39));const _0x285ba9=await withSpinner(_0x583bb8(0x18c)+_0xbd6e39+_0x583bb8(0x19c),()=>_0x6cbd93[_0x583bb8(0x178)][_0x583bb8(0x182)](_0xbd6e39),{'verbose':_0x23ecee[_0x583bb8(0x194)]}),_0xace4e8=_0x285ba9[_0x583bb8(0x19d)];_0x23ecee[_0x583bb8(0x194)]&&console['error'](_0x583bb8(0x19e)+_0xace4e8['type']);if(_0xace4e8['type']!==_0x583bb8(0x178))return console[_0x583bb8(0x17e)](_0x583bb8(0x190)+_0xace4e8[_0x583bb8(0x196)]+_0x583bb8(0x19a)),console[_0x583bb8(0x17e)](_0x583bb8(0x173)),0x1;if(!_0xace4e8[_0x583bb8(0x1a5)])throw new SDKError(ErrorCode[_0x583bb8(0x191)],_0x583bb8(0x183));const _0x3dc78e=_0xace4e8['parentId'],_0x20de00=_0xace4e8[_0x583bb8(0x1a5)];_0x23ecee[_0x583bb8(0x194)]&&(console[_0x583bb8(0x17e)](_0x583bb8(0x184)+_0x3dc78e),console[_0x583bb8(0x17e)](_0x583bb8(0x176)+_0x20de00));let _0xef87be;if(_0x23ecee['folder']){const _0x4c2b23=_0x23ecee['folder'],_0xb92faf=await withSpinner(_0x583bb8(0x19f)+_0x4c2b23+_0x583bb8(0x19c),()=>_0x6cbd93['segment']['resolveFolderId'](_0x3dc78e,_0x4c2b23),{'verbose':_0x23ecee['verbose']});_0xef87be=parseInt(_0xb92faf['data'],0xa),_0x23ecee[_0x583bb8(0x194)]&&console[_0x583bb8(0x17e)](_0x583bb8(0x185)+_0xef87be);}const _0x4fea2c=await loadJSONFromOptions(_0x23ecee[_0x583bb8(0x19b)],_0x23ecee[_0x583bb8(0x188)]),_0x5630b6={'name':_0x23ecee[_0x583bb8(0x17f)],'description':_0x23ecee['description'],'rule':_0x4fea2c,'kind':_0x23ecee[_0x583bb8(0x186)]!==undefined?parseInt(_0x23ecee[_0x583bb8(0x186)],0xa):undefined,'segmentFolderId':_0xef87be},_0x1c5dab=await withSpinner(_0x583bb8(0x195)+_0xace4e8['segmentName']+_0x583bb8(0x19c),()=>_0x6cbd93[_0x583bb8(0x178)][_0x583bb8(0x180)](_0x3dc78e,_0x20de00,_0x5630b6),{'verbose':_0x23ecee['verbose']}),_0x8cd01d=_0x1c5dab['data'];return console[_0x583bb8(0x17e)](_0x583bb8(0x1a4)+_0x8cd01d['name']+'\x27'),_0xbd6e39!==_0x7e5be4&&console['error'](_0x583bb8(0x181)+_0xbd6e39),await handleSDKOutput([_0x8cd01d],_0x23ecee),0x0;}}
@@ -1 +1 @@
1
- const a34_0x16a301=a34_0x5b38;(function(_0x42ce0c,_0x7ffaf2){const _0x374867=a34_0x5b38,_0x4913aa=_0x42ce0c();while(!![]){try{const _0x515bfc=parseInt(_0x374867(0x105))/0x1*(parseInt(_0x374867(0x107))/0x2)+-parseInt(_0x374867(0xf8))/0x3*(parseInt(_0x374867(0xfd))/0x4)+parseInt(_0x374867(0x10c))/0x5+-parseInt(_0x374867(0x10a))/0x6+-parseInt(_0x374867(0xed))/0x7+-parseInt(_0x374867(0x109))/0x8+parseInt(_0x374867(0xfc))/0x9*(parseInt(_0x374867(0xfe))/0xa);if(_0x515bfc===_0x7ffaf2)break;else _0x4913aa['push'](_0x4913aa['shift']());}catch(_0x3b0f9a){_0x4913aa['push'](_0x4913aa['shift']());}}}(a34_0xa577,0x887da));import{existsSync,statSync}from'fs';function a34_0x5b38(_0x5520c2,_0x34b887){_0x5520c2=_0x5520c2-0xe4;const _0xa577d2=a34_0xa577();let _0x5b3813=_0xa577d2[_0x5520c2];return _0x5b3813;}import a34_0x350b31 from'chalk';import{BaseCommand}from'./command.js';import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';import{parsePath,normalizePath}from'../sdk/segment/segment-path-parser.js';function a34_0xa577(){const _0x320bb0=['Resolved\x20relative\x20path\x20to:\x20','cyan','session','3069213XfKzeg','segmentPath','\x27...','error','folderPath','isDirectory','join','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22','Usage:\x20tdx\x20segment\x20use\x20<path>','description','Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>','1235505Heoqao','βœ”\x20Context\x20set\x20to:\x20','\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context','segments','520173XquHMD','4kaLlze','90oTjQBr','Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context','data','green','verbose','split','Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.','210499OkoMWz','\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent','6gQRVuA','fullPath','2636048cwNDYo','1537224lSkpHR','length','4217000aVjFxE','parent_segment','execute','Parent\x20ID:\x20','slice','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','parentName','Folder\x20ID:\x20','log','segment:use','βœ”\x20Context\x20cleared.\x20Back\x20to\x20root.','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22','segment','site','Error:\x20Path\x20is\x20required\x0a','Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.','Resolved\x20path\x20type:\x20','Site:\x20','Use\x20\x22tdx\x20use\x22\x20to\x20see\x20all\x20context\x20parameters','folderId','dim','red','config','Resolving\x20path\x20\x27','Use:\x20tdx\x20segment\x20use\x20','Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.','type'];a34_0xa577=function(){return _0x320bb0;};return a34_0xa577();}import{findTdxConfig}from'../sdk/segment/tdx-config.js';export class SegmentUseCommand extends BaseCommand{['name']=a34_0x16a301(0x115);[a34_0x16a301(0xf6)]='Set\x20current\x20segment/folder\x20context\x20for\x20navigation';async[a34_0x16a301(0x10e)](_0x174da7){const _0x587022=a34_0x16a301,{options:_0x4cc7a6,args:_0x1d3d9d,tdx:_0x22631f}=_0x174da7;if(_0x1d3d9d[_0x587022(0x10b)]===0x0)return console[_0x587022(0xf0)](a34_0x350b31[_0x587022(0xe4)](_0x587022(0x11a))),console[_0x587022(0xf0)](_0x587022(0xf5)),console[_0x587022(0xf0)]('Examples:'),console['error'](_0x587022(0x117)),console[_0x587022(0xf0)](_0x587022(0xf4)),console[_0x587022(0xf0)](_0x587022(0xfa)),console[_0x587022(0xf0)](_0x587022(0x106)),0x1;const _0x219789=_0x1d3d9d[0x0],_0x57c69d=_0x4cc7a6[_0x587022(0xec)];try{if(_0x219789==='/')return saveSessionContext({'segment_path':undefined},_0x57c69d),console['log'](a34_0x350b31[_0x587022(0x101)](_0x587022(0x116))),0x0;if(existsSync(_0x219789)&&statSync(_0x219789)[_0x587022(0xf2)]()){let _0x43e46b;try{_0x43e46b=findTdxConfig(_0x219789);}catch{return console[_0x587022(0xf0)](a34_0x350b31[_0x587022(0xe4)]('Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20'+_0x219789)),console[_0x587022(0xf0)](a34_0x350b31['cyan'](_0x587022(0x111))),0x1;}const _0x3e7d9f=_0x43e46b[_0x587022(0xe5)][_0x587022(0x10d)];return saveSessionContext({'segment_path':_0x3e7d9f,'parent_segment':_0x3e7d9f},_0x57c69d),console[_0x587022(0x114)](a34_0x350b31[_0x587022(0x101)]('βœ”\x20Context\x20set\x20to:\x20'+a34_0x350b31[_0x587022(0xeb)](_0x3e7d9f))),0x0;}const _0x3a55b4=_0x4cc7a6[_0x587022(0xee)];let _0x3ce581=_0x219789;const _0x3fa083=parsePath(_0x219789);if(!_0x3fa083['isAbsolute']){if(!_0x3a55b4)return console[_0x587022(0xf0)](a34_0x350b31['red'](_0x587022(0x104))),console[_0x587022(0xf0)](a34_0x350b31[_0x587022(0xeb)](_0x587022(0xf7))),0x1;if(_0x219789==='..'){const _0x1deb24=_0x3a55b4[_0x587022(0x103)]('/')[_0x587022(0x110)](0x0,-0x1)[_0x587022(0xf3)]('/');_0x3ce581=_0x1deb24||'/';}else _0x219789==='.'?_0x3ce581=_0x3a55b4:_0x3ce581=_0x3a55b4+'/'+_0x219789;_0x4cc7a6[_0x587022(0x102)]&&console['error'](_0x587022(0xea)+_0x3ce581);}if(_0x3ce581==='/'||_0x3ce581==='')return saveSessionContext({'segment_path':undefined},_0x57c69d),console[_0x587022(0x114)](a34_0x350b31[_0x587022(0x101)]('βœ”\x20Context\x20cleared.\x20Back\x20to\x20root.')),0x0;_0x3ce581=normalizePath(_0x3ce581);const _0x5dd652=parsePath(_0x3ce581)[_0x587022(0xfb)];if(_0x5dd652['length']===0x0)return saveSessionContext({'segment_path':undefined},_0x57c69d),console[_0x587022(0x114)](a34_0x350b31[_0x587022(0x101)](_0x587022(0x116))),0x0;_0x4cc7a6[_0x587022(0x102)]&&(console[_0x587022(0xf0)](_0x587022(0x11d)+_0x4cc7a6[_0x587022(0x119)]),console['error']('Target\x20path:\x20'+_0x3ce581));const _0x9aca87=await withSpinner(_0x587022(0xe6)+_0x3ce581+_0x587022(0xef),()=>_0x22631f[_0x587022(0x118)]['resolvePathToResource'](_0x3ce581),{'verbose':_0x4cc7a6['verbose']}),_0x550321=_0x9aca87[_0x587022(0x100)];_0x4cc7a6['verbose']&&(console['error'](_0x587022(0x11c)+_0x550321[_0x587022(0xe9)]),console[_0x587022(0xf0)](_0x587022(0x10f)+_0x550321['parentId']),_0x550321[_0x587022(0x11f)]&&console[_0x587022(0xf0)](_0x587022(0x113)+_0x550321[_0x587022(0x11f)]));if(_0x550321[_0x587022(0xe9)]===_0x587022(0x118))return console['error'](a34_0x350b31[_0x587022(0xe4)](_0x587022(0x11b))),console[_0x587022(0xf0)](_0x587022(0xe8)),console[_0x587022(0xf0)](a34_0x350b31[_0x587022(0xeb)](_0x587022(0xe7)+_0x550321[_0x587022(0x112)]+(_0x550321['folderPath']?'/'+_0x550321[_0x587022(0xf1)][_0x587022(0xf3)]('/'):''))),0x1;return saveSessionContext({'segment_path':_0x550321[_0x587022(0x108)],'parent_segment':_0x550321[_0x587022(0x112)]},_0x57c69d),console[_0x587022(0x114)](a34_0x350b31['green'](_0x587022(0xf9)+a34_0x350b31['cyan'](_0x550321['fullPath']))),_0x4cc7a6[_0x587022(0x102)]&&(console[_0x587022(0xf0)](a34_0x350b31[_0x587022(0x120)](_0x587022(0xff))),console[_0x587022(0xf0)](a34_0x350b31['dim'](_0x587022(0x11e)))),0x0;}catch(_0x27b76f){throw _0x27b76f;}}}
1
+ const a34_0x31a12a=a34_0x2c7b;(function(_0x1f0ca,_0x3c99aa){const _0x30b1a5=a34_0x2c7b,_0x100c5b=_0x1f0ca();while(!![]){try{const _0x33c635=parseInt(_0x30b1a5(0x189))/0x1*(parseInt(_0x30b1a5(0x180))/0x2)+parseInt(_0x30b1a5(0x1a2))/0x3*(parseInt(_0x30b1a5(0x17e))/0x4)+parseInt(_0x30b1a5(0x191))/0x5+parseInt(_0x30b1a5(0x19f))/0x6+-parseInt(_0x30b1a5(0x181))/0x7*(parseInt(_0x30b1a5(0x19c))/0x8)+-parseInt(_0x30b1a5(0x1a0))/0x9*(parseInt(_0x30b1a5(0x176))/0xa)+-parseInt(_0x30b1a5(0x16e))/0xb*(parseInt(_0x30b1a5(0x16a))/0xc);if(_0x33c635===_0x3c99aa)break;else _0x100c5b['push'](_0x100c5b['shift']());}catch(_0x2f862b){_0x100c5b['push'](_0x100c5b['shift']());}}}(a34_0x42f5,0xc98bd));import{existsSync,statSync}from'fs';import a34_0x4a2ba3 from'chalk';function a34_0x2c7b(_0x241dbb,_0x27de84){_0x241dbb=_0x241dbb-0x166;const _0x42f5cb=a34_0x42f5();let _0x2c7bec=_0x42f5cb[_0x241dbb];return _0x2c7bec;}import{BaseCommand}from'./command.js';import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';import{parsePath,normalizePath}from'../sdk/segment/segment-path-parser.js';function a34_0x42f5(){const _0x1d6f8e=['33UkdAbx','resolvePathToResource','\x27...','join','cyan','site','Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.','Set\x20current\x20segment/folder\x20context\x20for\x20navigation','10TqwGTj','segments','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22','session','verbose','βœ”\x20Context\x20set\x20to:\x20','length','Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.','260hdcVZB','folderId','1156654YTlIAW','266TzVvik','Target\x20path:\x20','config','segmentPath','description','Folder\x20ID:\x20','Resolved\x20relative\x20path\x20to:\x20','Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.','1pstvAM','Parent\x20ID:\x20','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\x20#\x20Clear\x20context','Examples:','Use:\x20tdx\x20segment\x20use\x20','segment:use','parentId','686540DvyLzs','green','folderPath','fullPath','segment','βœ”\x20Context\x20cleared.\x20Back\x20to\x20root.','red','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22','Resolved\x20path\x20type:\x20','Error:\x20Path\x20is\x20required\x0a','parent_segment','52888FREfLG','error','data','9639822WdrSsP','6331698XkXKjc','dim','5736TDpemm','execute','Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','isDirectory','parentName','split','Usage:\x20tdx\x20segment\x20use\x20<path>','log','\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent','2665116AUylEs','type','slice','Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context'];a34_0x42f5=function(){return _0x1d6f8e;};return a34_0x42f5();}import{findTdxConfig}from'../sdk/segment/tdx-config.js';export class SegmentUseCommand extends BaseCommand{['name']=a34_0x31a12a(0x18f);[a34_0x31a12a(0x185)]=a34_0x31a12a(0x175);async[a34_0x31a12a(0x1a3)](_0x111140){const _0x2e07b1=a34_0x31a12a,{options:_0x490082,args:_0x17573d,tdx:_0x986178}=_0x111140;if(_0x17573d[_0x2e07b1(0x17c)]===0x0)return console[_0x2e07b1(0x19d)](a34_0x4a2ba3['red'](_0x2e07b1(0x19a))),console[_0x2e07b1(0x19d)](_0x2e07b1(0x167)),console[_0x2e07b1(0x19d)](_0x2e07b1(0x18d)),console[_0x2e07b1(0x19d)](_0x2e07b1(0x198)),console[_0x2e07b1(0x19d)](_0x2e07b1(0x178)),console[_0x2e07b1(0x19d)](_0x2e07b1(0x18c)),console['error'](_0x2e07b1(0x169)),0x1;const _0x295e2e=_0x17573d[0x0],_0x227bb9=_0x490082[_0x2e07b1(0x179)];try{if(_0x295e2e==='/')return saveSessionContext({'segment_path':undefined},_0x227bb9),console[_0x2e07b1(0x168)](a34_0x4a2ba3[_0x2e07b1(0x192)](_0x2e07b1(0x196))),0x0;if(existsSync(_0x295e2e)&&statSync(_0x295e2e)[_0x2e07b1(0x1a5)]()){let _0x1b8d86;try{_0x1b8d86=findTdxConfig(_0x295e2e);}catch{return console[_0x2e07b1(0x19d)](a34_0x4a2ba3[_0x2e07b1(0x197)](_0x2e07b1(0x1a4)+_0x295e2e)),console[_0x2e07b1(0x19d)](a34_0x4a2ba3[_0x2e07b1(0x172)]('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;}const _0xba9e10=_0x1b8d86[_0x2e07b1(0x183)][_0x2e07b1(0x19b)];return saveSessionContext({'segment_path':_0xba9e10,'parent_segment':_0xba9e10},_0x227bb9),console[_0x2e07b1(0x168)](a34_0x4a2ba3[_0x2e07b1(0x192)](_0x2e07b1(0x17b)+a34_0x4a2ba3[_0x2e07b1(0x172)](_0xba9e10))),0x0;}const _0x1e3900=_0x490082[_0x2e07b1(0x184)];let _0x2899da=_0x295e2e;const _0x3c70cf=parsePath(_0x295e2e);if(!_0x3c70cf['isAbsolute']){if(!_0x1e3900)return console[_0x2e07b1(0x19d)](a34_0x4a2ba3[_0x2e07b1(0x197)](_0x2e07b1(0x17d))),console[_0x2e07b1(0x19d)](a34_0x4a2ba3['cyan']('Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>')),0x1;if(_0x295e2e==='..'){const _0x1eeb21=_0x1e3900[_0x2e07b1(0x166)]('/')[_0x2e07b1(0x16c)](0x0,-0x1)[_0x2e07b1(0x171)]('/');_0x2899da=_0x1eeb21||'/';}else _0x295e2e==='.'?_0x2899da=_0x1e3900:_0x2899da=_0x1e3900+'/'+_0x295e2e;_0x490082['verbose']&&console[_0x2e07b1(0x19d)](_0x2e07b1(0x187)+_0x2899da);}if(_0x2899da==='/'||_0x2899da==='')return saveSessionContext({'segment_path':undefined},_0x227bb9),console[_0x2e07b1(0x168)](a34_0x4a2ba3[_0x2e07b1(0x192)](_0x2e07b1(0x196))),0x0;_0x2899da=normalizePath(_0x2899da);const _0x133dd0=parsePath(_0x2899da)[_0x2e07b1(0x177)];if(_0x133dd0['length']===0x0)return saveSessionContext({'segment_path':undefined},_0x227bb9),console[_0x2e07b1(0x168)](a34_0x4a2ba3[_0x2e07b1(0x192)](_0x2e07b1(0x196))),0x0;_0x490082[_0x2e07b1(0x17a)]&&(console[_0x2e07b1(0x19d)]('Site:\x20'+_0x490082[_0x2e07b1(0x173)]),console['error'](_0x2e07b1(0x182)+_0x2899da));const _0x45859b=await withSpinner('Resolving\x20path\x20\x27'+_0x2899da+_0x2e07b1(0x170),()=>_0x986178[_0x2e07b1(0x195)][_0x2e07b1(0x16f)](_0x2899da),{'verbose':_0x490082['verbose']}),_0x509761=_0x45859b[_0x2e07b1(0x19e)];_0x490082[_0x2e07b1(0x17a)]&&(console[_0x2e07b1(0x19d)](_0x2e07b1(0x199)+_0x509761[_0x2e07b1(0x16b)]),console[_0x2e07b1(0x19d)](_0x2e07b1(0x18a)+_0x509761[_0x2e07b1(0x190)]),_0x509761[_0x2e07b1(0x17f)]&&console[_0x2e07b1(0x19d)](_0x2e07b1(0x186)+_0x509761[_0x2e07b1(0x17f)]));if(_0x509761[_0x2e07b1(0x16b)]===_0x2e07b1(0x195))return console[_0x2e07b1(0x19d)](a34_0x4a2ba3[_0x2e07b1(0x197)](_0x2e07b1(0x188))),console[_0x2e07b1(0x19d)](_0x2e07b1(0x174)),console['error'](a34_0x4a2ba3[_0x2e07b1(0x172)](_0x2e07b1(0x18e)+_0x509761[_0x2e07b1(0x1a6)]+(_0x509761['folderPath']?'/'+_0x509761[_0x2e07b1(0x193)][_0x2e07b1(0x171)]('/'):''))),0x1;return saveSessionContext({'segment_path':_0x509761[_0x2e07b1(0x194)],'parent_segment':_0x509761[_0x2e07b1(0x1a6)]},_0x227bb9),console['log'](a34_0x4a2ba3[_0x2e07b1(0x192)](_0x2e07b1(0x17b)+a34_0x4a2ba3[_0x2e07b1(0x172)](_0x509761[_0x2e07b1(0x194)]))),_0x490082[_0x2e07b1(0x17a)]&&(console['error'](a34_0x4a2ba3[_0x2e07b1(0x1a1)](_0x2e07b1(0x16d))),console[_0x2e07b1(0x19d)](a34_0x4a2ba3[_0x2e07b1(0x1a1)](_0x2e07b1(0x18b)))),0x0;}catch(_0x13cb0a){throw _0x13cb0a;}}}