@treasuredata/tdx 0.19.2 → 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 (205) 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.d.ts.map +1 -1
  49. package/dist/commands/status-command.js +1 -1
  50. package/dist/commands/status-command.js.map +1 -1
  51. package/dist/commands/tables.js +1 -1
  52. package/dist/commands/unset-command.js +1 -1
  53. package/dist/commands/use-command.js +1 -1
  54. package/dist/commands/user-command.js +1 -1
  55. package/dist/commands/workflow-command.js +1 -1
  56. package/dist/core/auth.d.ts +2 -2
  57. package/dist/core/auth.d.ts.map +1 -1
  58. package/dist/core/auth.js +1 -1
  59. package/dist/core/auth.js.map +1 -1
  60. package/dist/core/command-output.js +1 -1
  61. package/dist/core/config.d.ts +17 -20
  62. package/dist/core/config.d.ts.map +1 -1
  63. package/dist/core/config.js +1 -1
  64. package/dist/core/config.js.map +1 -1
  65. package/dist/core/connection-cache.js +1 -1
  66. package/dist/core/constants.js +1 -1
  67. package/dist/core/credential-cache.js +1 -1
  68. package/dist/core/global-context.d.ts +3 -0
  69. package/dist/core/global-context.d.ts.map +1 -1
  70. package/dist/core/global-context.js +1 -1
  71. package/dist/core/global-context.js.map +1 -1
  72. package/dist/core/keychain.js +1 -1
  73. package/dist/core/profile.js +1 -1
  74. package/dist/core/project-config.js +1 -1
  75. package/dist/core/session.js +1 -1
  76. package/dist/core/user-cache.js +1 -1
  77. package/dist/core/version.js +1 -1
  78. package/dist/index.js +1 -1
  79. package/dist/mcp/server.js +1 -1
  80. package/dist/mcp/tools/index.js +1 -1
  81. package/dist/mcp/tools/tdx-run.js +1 -1
  82. package/dist/mcp/tools/tdx-search.js +1 -1
  83. package/dist/mcp/utils.js +1 -1
  84. package/dist/proxy/anthropic-adapter.js +1 -1
  85. package/dist/proxy/claude-usage-tracker.js +1 -1
  86. package/dist/proxy/context-signature.js +1 -1
  87. package/dist/proxy/conversation-utils.js +1 -1
  88. package/dist/proxy/passthrough-server.d.ts.map +1 -1
  89. package/dist/proxy/passthrough-server.js +1 -1
  90. package/dist/proxy/passthrough-server.js.map +1 -1
  91. package/dist/proxy/server.js +1 -1
  92. package/dist/proxy/session-cache.js +1 -1
  93. package/dist/proxy/sse-usage-parser.js +1 -1
  94. package/dist/sdk/agent/agent-config.js +1 -1
  95. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  96. package/dist/sdk/agent/agent-yaml.js +1 -1
  97. package/dist/sdk/agent/test/evaluator.js +1 -1
  98. package/dist/sdk/agent/test/executor.js +1 -1
  99. package/dist/sdk/agent/test/index.js +1 -1
  100. package/dist/sdk/agent/test/output.js +1 -1
  101. package/dist/sdk/agent/test/parser.js +1 -1
  102. package/dist/sdk/api.js +1 -1
  103. package/dist/sdk/client/cdp-api-client.js +1 -1
  104. package/dist/sdk/client/endpoints.js +1 -1
  105. package/dist/sdk/client/engage-api-client.js +1 -1
  106. package/dist/sdk/client/http-client.js +1 -1
  107. package/dist/sdk/client/llm-api-client.d.ts +7 -1
  108. package/dist/sdk/client/llm-api-client.d.ts.map +1 -1
  109. package/dist/sdk/client/llm-api-client.js +1 -1
  110. package/dist/sdk/client/llm-api-client.js.map +1 -1
  111. package/dist/sdk/client/rate-limiter.js +1 -1
  112. package/dist/sdk/client/td-api-client.js +1 -1
  113. package/dist/sdk/client/trino-api-client.js +1 -1
  114. package/dist/sdk/client/workflow-client.js +1 -1
  115. package/dist/sdk/connection-validator.js +1 -1
  116. package/dist/sdk/connection.js +1 -1
  117. package/dist/sdk/engage.js +1 -1
  118. package/dist/sdk/errors.js +1 -1
  119. package/dist/sdk/index.js +1 -1
  120. package/dist/sdk/index.js.map +1 -1
  121. package/dist/sdk/io/index.js +1 -1
  122. package/dist/sdk/io/node-filesystem.js +1 -1
  123. package/dist/sdk/job.js +1 -1
  124. package/dist/sdk/journey.js +1 -1
  125. package/dist/sdk/llm/chat-cache.js +1 -1
  126. package/dist/sdk/llm/index.d.ts +15 -1
  127. package/dist/sdk/llm/index.d.ts.map +1 -1
  128. package/dist/sdk/llm/index.js +1 -1
  129. package/dist/sdk/llm/index.js.map +1 -1
  130. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  131. package/dist/sdk/llm/model-aliases.js +1 -1
  132. package/dist/sdk/llm/model-factors.js +1 -1
  133. package/dist/sdk/query/index.js +1 -1
  134. package/dist/sdk/query/sql-parser.js +1 -1
  135. package/dist/sdk/schedule.js +1 -1
  136. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  137. package/dist/sdk/segment/fields-display.js +1 -1
  138. package/dist/sdk/segment/file-discovery.js +1 -1
  139. package/dist/sdk/segment/journey-utils.js +1 -1
  140. package/dist/sdk/segment/journey-yaml.js +1 -1
  141. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  142. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  143. package/dist/sdk/segment/pull-workflow.js +1 -1
  144. package/dist/sdk/segment/push-workflow.js +1 -1
  145. package/dist/sdk/segment/resolution-context.js +1 -1
  146. package/dist/sdk/segment/segment-path-parser.js +1 -1
  147. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  148. package/dist/sdk/segment/target-resolution.js +1 -1
  149. package/dist/sdk/segment/tdx-config.js +1 -1
  150. package/dist/sdk/segment/validate-files.js +1 -1
  151. package/dist/sdk/segment/yaml-validator.js +1 -1
  152. package/dist/sdk/segment.js +1 -1
  153. package/dist/sdk/types/index.d.ts +1 -1
  154. package/dist/sdk/types/index.d.ts.map +1 -1
  155. package/dist/sdk/types/index.js +1 -1
  156. package/dist/sdk/types/index.js.map +1 -1
  157. package/dist/sdk/types/llm.d.ts +8 -0
  158. package/dist/sdk/types/llm.d.ts.map +1 -1
  159. package/dist/sdk/types/progress.js +1 -1
  160. package/dist/sdk/user.js +1 -1
  161. package/dist/sdk/util/format-detector.js +1 -1
  162. package/dist/sdk/util/formatters.js +1 -1
  163. package/dist/sdk/util/index.js +1 -1
  164. package/dist/sdk/util/tree-formatter.js +1 -1
  165. package/dist/sdk/workflow/archive-validation.js +1 -1
  166. package/dist/sdk/workflow/clone-workflow.js +1 -1
  167. package/dist/sdk/workflow/index.js +1 -1
  168. package/dist/sdk/workflow/pull-workflow.js +1 -1
  169. package/dist/sdk/workflow/push-workflow.js +1 -1
  170. package/dist/sdk/workflow/tdx-config.js +1 -1
  171. package/dist/sdk/workflow/workflow-utils.js +1 -1
  172. package/dist/test-utils/command-runner.js +1 -1
  173. package/dist/test-utils/factories.js +1 -1
  174. package/dist/test-utils/fixtures.js +1 -1
  175. package/dist/test-utils/http-mock.js +1 -1
  176. package/dist/test-utils/index.js +1 -1
  177. package/dist/utils/async.js +1 -1
  178. package/dist/utils/colors.js +1 -1
  179. package/dist/utils/diff.js +1 -1
  180. package/dist/utils/file-permissions.js +1 -1
  181. package/dist/utils/global-cache.js +1 -1
  182. package/dist/utils/json-loader.js +1 -1
  183. package/dist/utils/local-cache.js +1 -1
  184. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  185. package/dist/utils/logger/formatters/index.js +1 -1
  186. package/dist/utils/logger/handlers/console-handler.js +1 -1
  187. package/dist/utils/logger/handlers/file-handler.js +1 -1
  188. package/dist/utils/logger/handlers/index.js +1 -1
  189. package/dist/utils/logger/handlers/null-handler.js +1 -1
  190. package/dist/utils/logger/index.js +1 -1
  191. package/dist/utils/logger/logger.js +1 -1
  192. package/dist/utils/logger/types.js +1 -1
  193. package/dist/utils/option-validation.js +1 -1
  194. package/dist/utils/port.js +1 -1
  195. package/dist/utils/process.d.ts.map +1 -1
  196. package/dist/utils/process.js +1 -1
  197. package/dist/utils/process.js.map +1 -1
  198. package/dist/utils/prompt.js +1 -1
  199. package/dist/utils/spinner.js +1 -1
  200. package/dist/utils/sse-parser.js +1 -1
  201. package/dist/utils/string-utils.js +1 -1
  202. package/dist/utils/table-ref-parser.js +1 -1
  203. package/dist/utils/tdx-logger.js +1 -1
  204. package/dist/utils/version-check.js +1 -1
  205. package/package.json +1 -1
@@ -1 +1 @@
1
- const a28_0x1cc6d6=a28_0x4741;function a28_0x4741(_0x44bf49,_0x1e820b){_0x44bf49=_0x44bf49-0x1d7;const _0x8d301a=a28_0x8d30();let _0x474188=_0x8d301a[_0x44bf49];return _0x474188;}(function(_0x3da773,_0x2943b0){const _0x4ca46c=a28_0x4741,_0x2df40c=_0x3da773();while(!![]){try{const _0x3b7657=-parseInt(_0x4ca46c(0x23b))/0x1+-parseInt(_0x4ca46c(0x252))/0x2+-parseInt(_0x4ca46c(0x1df))/0x3*(-parseInt(_0x4ca46c(0x237))/0x4)+parseInt(_0x4ca46c(0x251))/0x5*(-parseInt(_0x4ca46c(0x259))/0x6)+-parseInt(_0x4ca46c(0x1f5))/0x7+-parseInt(_0x4ca46c(0x245))/0x8*(-parseInt(_0x4ca46c(0x1f7))/0x9)+-parseInt(_0x4ca46c(0x223))/0xa*(-parseInt(_0x4ca46c(0x264))/0xb);if(_0x3b7657===_0x2943b0)break;else _0x2df40c['push'](_0x2df40c['shift']());}catch(_0x5e15d0){_0x2df40c['push'](_0x2df40c['shift']());}}}(a28_0x8d30,0xda821));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_0x25882a from'chalk';async function resolveSegmentTarget(_0x4528d0,_0x224af2,_0x571a59){const _0x23ff01=a28_0x4741;if(isYamlFilePath(_0x4528d0))try{const _0x2b117a=await resolveYamlFilePath(_0x4528d0);return _0x571a59&&(console[_0x23ff01(0x1d7)](_0x23ff01(0x200)+_0x4528d0),console[_0x23ff01(0x1d7)](_0x23ff01(0x257)+_0x2b117a[_0x23ff01(0x225)]),console[_0x23ff01(0x1d7)]('\x20\x20Segment\x20name:\x20'+_0x2b117a[_0x23ff01(0x250)]),console[_0x23ff01(0x1d7)](_0x23ff01(0x21e)+(_0x2b117a[_0x23ff01(0x1e1)]||_0x23ff01(0x1dc))),console[_0x23ff01(0x1d7)](_0x23ff01(0x1d8)+_0x2b117a[_0x23ff01(0x1ec)])),_0x2b117a['fullPath'];}catch(_0x34aee7){throw new SDKError(ErrorCode[_0x23ff01(0x1eb)],_0x23ff01(0x241)+_0x34aee7['message']);}if(!_0x224af2)throw new SDKError(ErrorCode[_0x23ff01(0x1eb)],_0x23ff01(0x26e));return _0x224af2+'/'+_0x4528d0;}function a28_0x8d30(){const _0x4e03f9=['Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','Error:\x20Cannot\x20open\x20folder\x20in\x20web\x20browser.\x20Use\x20a\x20segment\x20name\x20instead.','information_schema','stats','Target\x20path:\x20','Segment\x20ID:\x20','Segment\x20ID\x20missing\x20from\x20resolved\x20path','segmentName','185yPwwgP','22158UhRQvY','SQL\x20query:\x0a','Error:\x20Cannot\x20view\x20parent\x20segment\x20details\x20with\x20this\x20command.','/e/','Folder\x20name:\x20','\x20\x20Parent\x20segment:\x20','SELECT\x20*\x20FROM\x20(\x0a','37734AMnVkt','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','Parent\x20ID:\x20','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','test','Fetching\x20SQL\x20for\x20segment...','Show\x20child\x20segment\x20schema\x20(column\x20types)','Error:\x20Cannot\x20show\x20schema\x20for\x20parent\x20segment\x20with\x20this\x20command.','Resolved\x20relative\x20path\x20to:\x20','segmentId','Resolving\x20parent\x20segment\x20\x27','13607ZUrIuS','/app/ps/','getParent','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20sql\x20<path/to/segment.yml>','length','List\x20segment\x20folders\x20under\x20a\x20parent\x20segment','url','Error:\x20','getFolder','segment','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20show\x20<path/to/segment.yml>','\x20\x20tdx\x20sg\x20view\x20segments/my-audience/premium-users.yml','listFolders','segment:folder:show','getSegmentSQL','Examples:','\x20\x20tdx\x20sg\x20desc\x20\x22Premium\x20Users\x22','error','\x20\x20Full\x20path:\x20','Site:\x20','Error:\x20Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.','resolveParentId','(root)','Resolving\x20folder\x20\x27','\x20rows\x20','2905971PnDLZY','Folder\x20ID:\x20','folderPath','green','✔\x20Query\x20completed:\x20Processed\x20','parent','Error:\x20Parent\x20segment\x20name\x20is\x20required','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20view\x20<path/to/segment.yml>','cyan','Fetching\x20folder\x20\x27','Folder\x20ID\x20missing\x20from\x20resolved\x20path','Resolved\x20parent\x20ID:\x20','INVALID_ARGUMENT','fullPath','segment:desc','Usage:\x20tdx\x20sg\x20sql\x20<name>','Show\x20segment\x20folder\x20details','\x20\x20tdx\x20sg\x20sql\x20\x22Premium\x20Users\x22','resolvePathToResource','✔\x20Found\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20desc\x20<path/to/segment.yml>','data','10471993PsjQAa','Use:\x20tdx\x20ps\x20view\x20-w','1269iYKQgU','replace','segment:view','json','Error:\x20Folder\x20reference\x20is\x20required','processedRows','Fetching\x20segment\x20details...','site','Show\x20segment\x20or\x20folder\x20details','Resolved\x20YAML\x20file:\x20','Use:\x20tdx\x20ps\x20view','Error:\x20Path\x20or\x20name\x20is\x20required','Executing\x20segment\x20query...','message','getSegment','SEGMENT_NOT_FOUND','\x20\x20tdx\x20sg\x20show\x20segments/my-audience/premium-users.yml','web','Use:\x20tdx\x20ps\x20sql','verbose','Usage:\x20tdx\x20sg\x20show\x20<name>','in\x20','Error:\x20Cannot\x20execute\x20query\x20for\x20parent\x20segment\x20with\x20this\x20command.','limit','Listing\x20folders\x20for\x20parent\x20\x27','Fetching\x20parent\x20segment\x20details...','Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required','segment:sql','resolveFolderId','createFolder','Resolved\x20folder\x20ID:\x20','Resolved\x20type:\x20','name','Use:\x20tdx\x20sg\x20view\x20<name>\x20\x20#\x20To\x20show\x20folder\x20details','segment:folder:list','Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>','type','Options:','Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)','\x20\x20Folder\x20path:\x20','\x20[Job\x20ID:\x20','Parent\x20segment:\x20','Resolving\x20parent\x20folder\x20\x27','\x20\x20Cause:\x20','22190KTYXgs','elapsedTimeMillis','parentSegment','parentFolder','query','Create\x20segment\x20folder\x20for\x20organization','code','description','\x20\x20tdx\x20sg\x20sql\x20segments/my-audience/premium-users.yml','Creating\x20folder\x20\x27','jobId','Execute\x20child\x20segment\x20SQL\x20query\x20and\x20show\x20results','\x20\x20tdx\x20sg\x20desc\x20segments/my-audience/premium-users.yml','\x27...','parentId','Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]','trim','\x20Opening\x20','Get\x20SQL\x20query\x20for\x20child\x20segment','cause','4GvAEJP','\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20-w\x20\x20#\x20Open\x20segment\x20in\x20web\x20browser','folderId','1151254NFIieS','✔\x20Created\x20folder\x20\x27','folder','Resolved\x20parent\x20folder\x20ID:\x20','log','Resolving\x20\x27','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','segment:folder:create','\x20\x20tdx\x20sg\x20view\x20\x22Marketing\x22\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20folder\x20details','execute','4112Egganc','Fetching\x20folder\x20details...','SEGMENT_FOLDER_NOT_FOUND','jsonl'];a28_0x8d30=function(){return _0x4e03f9;};return a28_0x8d30();}export class SegmentDescribeCommand extends BaseCommand{[a28_0x1cc6d6(0x217)]='segment:describe';[a28_0x1cc6d6(0x22a)]=a28_0x1cc6d6(0x1ff);async[a28_0x1cc6d6(0x244)](_0x5dda41){const _0x3c2f9c=a28_0x1cc6d6,{options:_0x2db915,args:_0x55f7ba,tdx:_0x57b0ca}=_0x5dda41,_0x477115=_0x55f7ba[0x0],_0x1f76ba=!_0x477115&&!!_0x2db915[_0x3c2f9c(0x225)],_0x2af825=_0x477115||_0x2db915['parentSegment'];if(!_0x2af825)return console[_0x3c2f9c(0x1d7)](_0x3c2f9c(0x202)),console[_0x3c2f9c(0x1d7)]('Usage:\x20tdx\x20segment\x20describe\x20<path>'),console[_0x3c2f9c(0x1d7)]('Examples:'),console[_0x3c2f9c(0x1d7)]('\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22'),console[_0x3c2f9c(0x1d7)]('\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22'),console[_0x3c2f9c(0x1d7)](_0x3c2f9c(0x238)),console['error'](_0x3c2f9c(0x25a)),0x1;try{const _0x4bf585=_0x2db915['segmentPath'];let _0x4f569f=_0x2af825;!_0x1f76ba&&_0x4bf585&&!_0x2af825['includes']('/')&&(_0x4f569f=_0x4bf585+'/'+_0x2af825,_0x2db915[_0x3c2f9c(0x20a)]&&console[_0x3c2f9c(0x1d7)](_0x3c2f9c(0x261)+_0x4f569f));const _0x20d90e=await withSpinner('Resolving\x20path\x20\x27'+_0x4f569f+_0x3c2f9c(0x230),()=>_0x57b0ca[_0x3c2f9c(0x26d)][_0x3c2f9c(0x1f1)](_0x4f569f),{'verbose':_0x2db915[_0x3c2f9c(0x20a)]}),_0xaf9f7b=_0x20d90e['data'];_0x2db915[_0x3c2f9c(0x20a)]&&(console['error'](_0x3c2f9c(0x216)+_0xaf9f7b[_0x3c2f9c(0x21b)]),console[_0x3c2f9c(0x1d7)]('Parent\x20ID:\x20'+_0xaf9f7b['parentId']),_0xaf9f7b['folderId']&&console['error'](_0x3c2f9c(0x1e0)+_0xaf9f7b[_0x3c2f9c(0x23a)]),_0xaf9f7b['segmentId']&&console[_0x3c2f9c(0x1d7)](_0x3c2f9c(0x24e)+_0xaf9f7b[_0x3c2f9c(0x262)]));if(_0xaf9f7b[_0x3c2f9c(0x21b)]===_0x3c2f9c(0x1e4)){const _0x4093eb=await withSpinner(_0x3c2f9c(0x210),()=>_0x57b0ca['segment'][_0x3c2f9c(0x266)](_0xaf9f7b['parentId']),{'verbose':_0x2db915[_0x3c2f9c(0x20a)]});await handleSingleObjectOutput(_0x4093eb[_0x3c2f9c(0x1f4)],_0x2db915);}else{if(_0xaf9f7b['type']===_0x3c2f9c(0x23d)){if(!_0xaf9f7b[_0x3c2f9c(0x23a)])throw new SDKError(ErrorCode['SEGMENT_FOLDER_NOT_FOUND'],_0x3c2f9c(0x1e9));const _0x65a7b8=await withSpinner('Fetching\x20folder\x20details...',()=>_0x57b0ca['segment'][_0x3c2f9c(0x26c)](_0xaf9f7b[_0x3c2f9c(0x23a)]),{'verbose':_0x2db915['verbose']});await handleSingleObjectOutput(_0x65a7b8['data'],_0x2db915);}else{if(_0xaf9f7b['type']===_0x3c2f9c(0x26d)){if(!_0xaf9f7b['segmentId'])throw new SDKError(ErrorCode[_0x3c2f9c(0x206)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x1b5ca1=await withSpinner(_0x3c2f9c(0x1fd),()=>_0x57b0ca[_0x3c2f9c(0x26d)][_0x3c2f9c(0x205)](_0xaf9f7b['parentId'],_0xaf9f7b[_0x3c2f9c(0x262)]),{'verbose':_0x2db915['verbose']});await handleSingleObjectOutput(_0x1b5ca1['data'],_0x2db915);}}}return 0x0;}catch(_0x40f51a){if(_0x40f51a instanceof SDKError)return console[_0x3c2f9c(0x1d7)](_0x3c2f9c(0x26b)+_0x40f51a['message']),_0x40f51a['cause']&&console[_0x3c2f9c(0x1d7)](_0x3c2f9c(0x222)+_0x40f51a[_0x3c2f9c(0x236)]),0x1;throw _0x40f51a;}}}export class SegmentShowCommand extends BaseCommand{[a28_0x1cc6d6(0x217)]='segment:show';[a28_0x1cc6d6(0x22a)]=a28_0x1cc6d6(0x22e);async[a28_0x1cc6d6(0x244)](_0x448444){const _0x59b02e=a28_0x1cc6d6,{options:_0x33dd94,args:_0x4250b4,tdx:_0x591744}=_0x448444,_0x2087c8=_0x4250b4[0x0];if(!_0x2087c8)return console[_0x59b02e(0x1d7)](_0x59b02e(0x211)),console[_0x59b02e(0x1d7)](_0x59b02e(0x20b)),console[_0x59b02e(0x1d7)](_0x59b02e(0x26f)),console[_0x59b02e(0x1d7)](_0x59b02e(0x274)),console[_0x59b02e(0x1d7)]('\x20\x20tdx\x20sg\x20show\x20\x22Premium\x20Users\x22'),console[_0x59b02e(0x1d7)](_0x59b02e(0x207)),0x1;try{const _0xaee842=_0x33dd94[_0x59b02e(0x225)],_0x355805=await resolveSegmentTarget(_0x2087c8,_0xaee842,_0x33dd94['verbose']);_0x33dd94[_0x59b02e(0x20a)]&&console[_0x59b02e(0x1d7)](_0x59b02e(0x24d)+_0x355805);const _0x597072=await withSpinner('Resolving\x20\x27'+_0x2087c8+_0x59b02e(0x230),()=>_0x591744[_0x59b02e(0x26d)]['resolvePathToResource'](_0x355805),{'verbose':_0x33dd94[_0x59b02e(0x20a)]}),_0x596d54=_0x597072[_0x59b02e(0x1f4)];_0x33dd94['verbose']&&(console[_0x59b02e(0x1d7)](_0x59b02e(0x216)+_0x596d54[_0x59b02e(0x21b)]),console[_0x59b02e(0x1d7)](_0x59b02e(0x25b)+_0x596d54[_0x59b02e(0x231)]));if(_0x596d54['type']===_0x59b02e(0x23d))return console[_0x59b02e(0x1d7)]('Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.'),console[_0x59b02e(0x1d7)](_0x59b02e(0x218)),0x1;if(_0x596d54[_0x59b02e(0x21b)]==='parent')return console['error'](_0x59b02e(0x20d)),console['error']('Use:\x20tdx\x20ps\x20show'),0x1;if(!_0x596d54[_0x59b02e(0x262)])throw new SDKError(ErrorCode[_0x59b02e(0x206)],_0x59b02e(0x24f));const _0xf92ebf=await withSpinner(_0x59b02e(0x25e),()=>_0x591744[_0x59b02e(0x26d)][_0x59b02e(0x273)](_0x596d54[_0x59b02e(0x231)],_0x596d54['segmentId']),{'verbose':_0x33dd94[_0x59b02e(0x20a)]});let _0x47fd2c=_0xf92ebf[_0x59b02e(0x1f4)];const _0x36e295=resolveLimit(_0x33dd94[_0x59b02e(0x20e)],DEFAULT_DISPLAY_LIMIT),_0x1495dd=/\bLIMIT\s+\d+/i[_0x59b02e(0x25d)](_0x47fd2c);!_0x1495dd&&(_0x47fd2c=_0x47fd2c[_0x59b02e(0x233)]()[_0x59b02e(0x1f8)](/;+$/,''),_0x47fd2c=_0x59b02e(0x258)+_0x47fd2c+_0x59b02e(0x25c)+_0x36e295);_0x33dd94[_0x59b02e(0x20a)]&&console['error'](_0x59b02e(0x253)+_0x47fd2c);const _0xe7f596=await withProgressSpinner(_0x59b02e(0x203),async _0x4b7a94=>{const _0x19a9ed=_0x59b02e,_0x5868c6=await _0x591744[_0x19a9ed(0x227)][_0x19a9ed(0x244)](_0x47fd2c,{'catalog':'td','schema':_0x19a9ed(0x24b),'onJobId':_0x2924f7=>{_0x4b7a94['setJobId'](_0x2924f7);}});return _0x5868c6;},{'verbose':_0x33dd94[_0x59b02e(0x20a)]}),_0x4fa3bf=_0xe7f596[_0x59b02e(0x1f4)],_0x4c8f37=_0x4fa3bf[_0x59b02e(0x22d)]?_0x59b02e(0x21f)+_0x4fa3bf[_0x59b02e(0x22d)]+']':'';return console[_0x59b02e(0x1d7)](_0x59b02e(0x1e3)+_0x4fa3bf['stats'][_0x59b02e(0x1fc)]['toLocaleString']()+_0x59b02e(0x1de)+(_0x59b02e(0x20c)+formatElapsed(_0x4fa3bf[_0x59b02e(0x24c)][_0x59b02e(0x224)])+_0x4c8f37)),await handleQueryOutput(_0x4fa3bf,_0x33dd94),0x0;}catch(_0x3ee2e9){if(_0x3ee2e9 instanceof SDKError)return console[_0x59b02e(0x1d7)]('✖\x20Query\x20failed\x20['+_0x3ee2e9[_0x59b02e(0x229)]+']'),console[_0x59b02e(0x1d7)]('\x0a'+_0x3ee2e9[_0x59b02e(0x204)]),0x1;throw _0x3ee2e9;}}}export class SegmentFolderListCommand extends BaseCommand{[a28_0x1cc6d6(0x217)]=a28_0x1cc6d6(0x219);[a28_0x1cc6d6(0x22a)]=a28_0x1cc6d6(0x269);async[a28_0x1cc6d6(0x244)](_0x22cbde){const _0x13d11d=a28_0x1cc6d6,{options:_0x12c504,args:_0x5941ec,tdx:_0x456ec3}=_0x22cbde;if(_0x5941ec[_0x13d11d(0x268)]===0x0)return console[_0x13d11d(0x1d7)](_0x13d11d(0x1e5)),console['error']('Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>'),0x1;const _0xdf847=_0x5941ec[0x0];try{_0x12c504[_0x13d11d(0x20a)]&&(console[_0x13d11d(0x1d7)](_0x13d11d(0x1d9)+_0x12c504[_0x13d11d(0x1fe)]),console[_0x13d11d(0x1d7)]('Parent\x20name:\x20'+_0xdf847));const _0x10eedb=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0xdf847+'\x27...',()=>_0x456ec3[_0x13d11d(0x26d)][_0x13d11d(0x1db)](_0xdf847),{'verbose':_0x12c504[_0x13d11d(0x20a)]}),_0x39189f=_0x10eedb['data'];_0x12c504[_0x13d11d(0x20a)]&&console[_0x13d11d(0x1d7)]('Resolved\x20parent\x20ID:\x20'+_0x39189f);const _0x4bcfbf=await withSpinner(_0x13d11d(0x20f)+_0xdf847+'\x27...',()=>_0x456ec3['segment'][_0x13d11d(0x271)](_0x39189f),{'verbose':_0x12c504[_0x13d11d(0x20a)]}),_0x9286d1=_0x4bcfbf[_0x13d11d(0x1f4)];return console[_0x13d11d(0x1d7)](_0x13d11d(0x1f2)+_0x9286d1[_0x13d11d(0x268)]+'\x20folder'+(_0x9286d1[_0x13d11d(0x268)]!==0x1?'s':'')),await handleSDKOutput(_0x9286d1,_0x12c504),0x0;}catch(_0x43dd01){if(_0x43dd01 instanceof SDKError)return console[_0x13d11d(0x1d7)]('Error:\x20'+_0x43dd01[_0x13d11d(0x204)]),_0x43dd01[_0x13d11d(0x236)]&&console[_0x13d11d(0x1d7)](_0x13d11d(0x222)+_0x43dd01['cause']),0x1;throw _0x43dd01;}}}export class SegmentFolderShowCommand extends BaseCommand{[a28_0x1cc6d6(0x217)]=a28_0x1cc6d6(0x272);['description']=a28_0x1cc6d6(0x1ef);async['execute'](_0x191b9c){const _0x14e163=a28_0x1cc6d6,{options:_0x5e5453,args:_0x463a01,tdx:_0x594fb1}=_0x191b9c;if(_0x463a01[_0x14e163(0x268)]===0x0)return console['error'](_0x14e163(0x1fb)),console[_0x14e163(0x1d7)](_0x14e163(0x21a)),0x1;try{const {parentId:_0x43fcf2,childId:_0x5be078}=parseSegmentRef(_0x463a01[0x0]);_0x5e5453[_0x14e163(0x20a)]&&(console['error'](_0x14e163(0x1d9)+_0x5e5453[_0x14e163(0x1fe)]),console['error']('Parent\x20name:\x20'+_0x43fcf2),_0x5be078&&console[_0x14e163(0x1d7)](_0x14e163(0x256)+_0x5be078));if(!_0x5be078)return console[_0x14e163(0x1d7)](_0x14e163(0x21d)),0x1;const _0x39c757=await withSpinner(_0x14e163(0x263)+_0x43fcf2+_0x14e163(0x230),()=>_0x594fb1[_0x14e163(0x26d)][_0x14e163(0x1db)](_0x43fcf2),{'verbose':_0x5e5453['verbose']}),_0xf944f5=_0x39c757[_0x14e163(0x1f4)];_0x5e5453['verbose']&&console[_0x14e163(0x1d7)](_0x14e163(0x1ea)+_0xf944f5);const _0x3c7a94=await withSpinner(_0x14e163(0x1dd)+_0x5be078+'\x27...',()=>_0x594fb1[_0x14e163(0x26d)][_0x14e163(0x213)](_0xf944f5,_0x5be078),{'verbose':_0x5e5453[_0x14e163(0x20a)]}),_0x378e5e=_0x3c7a94[_0x14e163(0x1f4)];_0x5e5453[_0x14e163(0x20a)]&&console['error'](_0x14e163(0x215)+_0x378e5e);const _0x234cd9=await withSpinner(_0x14e163(0x1e8)+_0x5be078+_0x14e163(0x230),()=>_0x594fb1['segment'][_0x14e163(0x26c)](_0x378e5e),{'verbose':_0x5e5453[_0x14e163(0x20a)]});return await handleSDKOutput([_0x234cd9[_0x14e163(0x1f4)]],_0x5e5453),0x0;}catch(_0x223035){if(_0x223035 instanceof SDKError)return console[_0x14e163(0x1d7)](_0x14e163(0x26b)+_0x223035['message']),_0x223035[_0x14e163(0x236)]&&console[_0x14e163(0x1d7)](_0x14e163(0x222)+_0x223035[_0x14e163(0x236)]),0x1;throw _0x223035;}}}export class SegmentSQLCommand extends BaseCommand{['name']=a28_0x1cc6d6(0x212);['description']=a28_0x1cc6d6(0x235);async[a28_0x1cc6d6(0x244)](_0x24a8dc){const _0x111cd8=a28_0x1cc6d6,{options:_0x426b51,args:_0x48f403,tdx:_0x43161c}=_0x24a8dc,_0x19dd6c=_0x48f403[0x0];if(!_0x19dd6c)return console[_0x111cd8(0x1d7)](_0x111cd8(0x211)),console['error'](_0x111cd8(0x1ee)),console[_0x111cd8(0x1d7)](_0x111cd8(0x267)),console[_0x111cd8(0x1d7)](_0x111cd8(0x274)),console[_0x111cd8(0x1d7)](_0x111cd8(0x1f0)),console['error'](_0x111cd8(0x22b)),0x1;try{const _0x53d7a8=_0x426b51[_0x111cd8(0x225)],_0x19a762=await resolveSegmentTarget(_0x19dd6c,_0x53d7a8,_0x426b51[_0x111cd8(0x20a)]);_0x426b51[_0x111cd8(0x20a)]&&console[_0x111cd8(0x1d7)](_0x111cd8(0x24d)+_0x19a762);const _0x29d481=await withSpinner(_0x111cd8(0x240)+_0x19dd6c+_0x111cd8(0x230),()=>_0x43161c[_0x111cd8(0x26d)][_0x111cd8(0x1f1)](_0x19a762),{'verbose':_0x426b51[_0x111cd8(0x20a)]}),_0xc5374a=_0x29d481['data'];_0x426b51[_0x111cd8(0x20a)]&&(console[_0x111cd8(0x1d7)]('Resolved\x20type:\x20'+_0xc5374a[_0x111cd8(0x21b)]),console[_0x111cd8(0x1d7)](_0x111cd8(0x25b)+_0xc5374a[_0x111cd8(0x231)]));if(_0xc5374a['type']===_0x111cd8(0x23d))return console[_0x111cd8(0x1d7)](_0x111cd8(0x1da)),console['error'](_0x111cd8(0x249)),0x1;if(_0xc5374a[_0x111cd8(0x21b)]===_0x111cd8(0x1e4))return console[_0x111cd8(0x1d7)]('Error:\x20Cannot\x20get\x20SQL\x20for\x20parent\x20segment\x20with\x20this\x20command.'),console[_0x111cd8(0x1d7)](_0x111cd8(0x209)),0x1;if(!_0xc5374a['segmentId'])throw new SDKError(ErrorCode[_0x111cd8(0x206)],_0x111cd8(0x24f));const _0x186cb9=await withSpinner(_0x111cd8(0x25e),()=>_0x43161c[_0x111cd8(0x26d)][_0x111cd8(0x273)](_0xc5374a['parentId'],_0xc5374a['segmentId']),{'verbose':_0x426b51[_0x111cd8(0x20a)]}),_0x155cdf=_0x186cb9[_0x111cd8(0x1f4)];return _0x426b51['format']===_0x111cd8(0x1fa)||_0x426b51['format']===_0x111cd8(0x248)?await handleSDKOutput([{'sql':_0x155cdf}],_0x426b51):console[_0x111cd8(0x23f)](_0x155cdf),0x0;}catch(_0x531a04){if(_0x531a04 instanceof SDKError)return console[_0x111cd8(0x1d7)](_0x111cd8(0x26b)+_0x531a04[_0x111cd8(0x204)]),_0x531a04['cause']&&console[_0x111cd8(0x1d7)](_0x111cd8(0x222)+_0x531a04['cause']),0x1;throw _0x531a04;}}}export class SegmentFolderCreateCommand extends BaseCommand{[a28_0x1cc6d6(0x217)]=a28_0x1cc6d6(0x242);[a28_0x1cc6d6(0x22a)]=a28_0x1cc6d6(0x228);async[a28_0x1cc6d6(0x244)](_0x38039b){const _0x59b815=a28_0x1cc6d6,{options:_0x5c5f9a,args:_0x308def,tdx:_0x135940}=_0x38039b,_0x1f6f12=_0x5c5f9a;if(_0x308def[_0x59b815(0x268)]<0x2)return console[_0x59b815(0x1d7)]('Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required'),console[_0x59b815(0x1d7)](_0x59b815(0x232)),0x1;const _0x34cf9a=_0x308def[0x0],_0x3e349a=_0x308def[0x1];_0x1f6f12[_0x59b815(0x20a)]&&(console[_0x59b815(0x1d7)](_0x59b815(0x1d9)+_0x1f6f12[_0x59b815(0x1fe)]),console[_0x59b815(0x1d7)](_0x59b815(0x220)+_0x34cf9a),console[_0x59b815(0x1d7)](_0x59b815(0x256)+_0x3e349a));let _0x21565d;if(_0x1f6f12[_0x59b815(0x226)]){const _0x3ad568=_0x1f6f12[_0x59b815(0x226)],_0x25a6ea=await withSpinner(_0x59b815(0x263)+_0x34cf9a+_0x59b815(0x230),()=>_0x135940['segment'][_0x59b815(0x1db)](_0x34cf9a),{'verbose':_0x1f6f12['verbose']}),_0x52da3b=_0x25a6ea['data'],_0xde4a0c=await withSpinner(_0x59b815(0x221)+_0x3ad568+_0x59b815(0x230),()=>_0x135940[_0x59b815(0x26d)][_0x59b815(0x213)](_0x52da3b,_0x3ad568),{'verbose':_0x1f6f12[_0x59b815(0x20a)]});_0x21565d=_0xde4a0c[_0x59b815(0x1f4)],_0x1f6f12[_0x59b815(0x20a)]&&console[_0x59b815(0x1d7)](_0x59b815(0x23e)+_0x21565d);}const _0x8119cb={'name':_0x3e349a,'description':_0x1f6f12[_0x59b815(0x22a)],'parentFolderId':_0x21565d},_0x3872a6=await withSpinner(_0x59b815(0x22c)+_0x3e349a+'\x27...',()=>_0x135940[_0x59b815(0x26d)][_0x59b815(0x214)](_0x34cf9a,_0x8119cb),{'verbose':_0x1f6f12[_0x59b815(0x20a)]}),_0x2c955d=_0x3872a6[_0x59b815(0x1f4)];return console[_0x59b815(0x1d7)](_0x59b815(0x23c)+_0x2c955d[_0x59b815(0x217)]+'\x27\x20with\x20ID:\x20'+_0x2c955d['id']),await handleSDKOutput([_0x2c955d],_0x1f6f12),0x0;}}export class SegmentViewCommand extends BaseCommand{['name']=a28_0x1cc6d6(0x1f9);[a28_0x1cc6d6(0x22a)]='Show\x20folder\x20or\x20child\x20segment\x20details';async['execute'](_0x4d04d7){const _0x4eb96a=a28_0x1cc6d6,{options:_0x5d53a2,args:_0x567a2f,tdx:_0x33a0c8}=_0x4d04d7,_0x449873=_0x567a2f[0x0];if(!_0x449873)return console[_0x4eb96a(0x1d7)]('Error:\x20Folder\x20or\x20segment\x20name,\x20or\x20YAML\x20file\x20path\x20is\x20required'),console[_0x4eb96a(0x1d7)]('Usage:\x20tdx\x20sg\x20view\x20<name>\x20[-w]'),console[_0x4eb96a(0x1d7)](_0x4eb96a(0x1e6)),console[_0x4eb96a(0x1d7)](_0x4eb96a(0x21c)),console[_0x4eb96a(0x1d7)]('\x20\x20-w,\x20--web\x20\x20Open\x20segment\x20in\x20web\x20browser'),console['error'](_0x4eb96a(0x274)),console[_0x4eb96a(0x1d7)](_0x4eb96a(0x243)),console[_0x4eb96a(0x1d7)]('\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20\x20\x20\x20\x20#\x20View\x20child\x20segment\x20details'),console[_0x4eb96a(0x1d7)](_0x4eb96a(0x239)),console[_0x4eb96a(0x1d7)](_0x4eb96a(0x270)),0x1;try{const _0x1bce90=_0x5d53a2[_0x4eb96a(0x225)],_0x2f80ed=await resolveSegmentTarget(_0x449873,_0x1bce90,_0x5d53a2[_0x4eb96a(0x20a)]);_0x5d53a2[_0x4eb96a(0x20a)]&&console['error']('Target\x20path:\x20'+_0x2f80ed);const _0x1083b5=await withSpinner('Resolving\x20\x27'+_0x449873+_0x4eb96a(0x230),()=>_0x33a0c8[_0x4eb96a(0x26d)][_0x4eb96a(0x1f1)](_0x2f80ed),{'verbose':_0x5d53a2[_0x4eb96a(0x20a)]}),_0x4ee758=_0x1083b5[_0x4eb96a(0x1f4)];_0x5d53a2[_0x4eb96a(0x20a)]&&(console['error'](_0x4eb96a(0x216)+_0x4ee758[_0x4eb96a(0x21b)]),console[_0x4eb96a(0x1d7)](_0x4eb96a(0x25b)+_0x4ee758[_0x4eb96a(0x231)]),_0x4ee758[_0x4eb96a(0x23a)]&&console[_0x4eb96a(0x1d7)](_0x4eb96a(0x1e0)+_0x4ee758['folderId']),_0x4ee758[_0x4eb96a(0x262)]&&console[_0x4eb96a(0x1d7)](_0x4eb96a(0x24e)+_0x4ee758[_0x4eb96a(0x262)]));if(_0x5d53a2[_0x4eb96a(0x208)]){if(_0x4ee758[_0x4eb96a(0x21b)]===_0x4eb96a(0x23d))return console[_0x4eb96a(0x1d7)](_0x4eb96a(0x24a)),0x1;if(_0x4ee758[_0x4eb96a(0x21b)]===_0x4eb96a(0x1e4))return console['error']('Error:\x20Cannot\x20open\x20parent\x20segment\x20with\x20this\x20command.'),console[_0x4eb96a(0x1d7)](_0x4eb96a(0x1f6)),0x1;if(!_0x4ee758['segmentId'])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x4eb96a(0x24f));const _0x4fe155=getConsoleNextUrl(_0x5d53a2['site'],_0x4eb96a(0x265)+_0x4ee758[_0x4eb96a(0x231)]+'/e/'+_0x4ee758[_0x4eb96a(0x262)]);return console[_0x4eb96a(0x1d7)](a28_0x25882a[_0x4eb96a(0x1e2)]('✔')+_0x4eb96a(0x234)+a28_0x25882a[_0x4eb96a(0x1e7)](_0x4fe155)),openBrowser(_0x4fe155),0x0;}if(_0x4ee758[_0x4eb96a(0x21b)]===_0x4eb96a(0x23d)){if(!_0x4ee758['folderId'])throw new SDKError(ErrorCode[_0x4eb96a(0x247)],'Folder\x20ID\x20missing\x20from\x20resolved\x20path');const _0x28893f=await withSpinner(_0x4eb96a(0x246),()=>_0x33a0c8['segment'][_0x4eb96a(0x26c)](_0x4ee758[_0x4eb96a(0x23a)]),{'verbose':_0x5d53a2[_0x4eb96a(0x20a)]});await handleSingleObjectOutput(_0x28893f[_0x4eb96a(0x1f4)],_0x5d53a2);}else{if(_0x4ee758[_0x4eb96a(0x21b)]==='segment'){if(!_0x4ee758[_0x4eb96a(0x262)])throw new SDKError(ErrorCode[_0x4eb96a(0x206)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x11e85b=await withSpinner(_0x4eb96a(0x1fd),()=>_0x33a0c8['segment'][_0x4eb96a(0x205)](_0x4ee758[_0x4eb96a(0x231)],_0x4ee758[_0x4eb96a(0x262)]),{'verbose':_0x5d53a2[_0x4eb96a(0x20a)]}),_0x3d1d47=getConsoleNextUrl(_0x5d53a2['site'],'/app/ps/'+_0x4ee758['parentId']+_0x4eb96a(0x255)+_0x4ee758['segmentId']),_0x207197=_0x11e85b[_0x4eb96a(0x1f4)];_0x207197[_0x4eb96a(0x26a)]=_0x3d1d47,await handleSingleObjectOutput(_0x207197,_0x5d53a2);}else return console[_0x4eb96a(0x1d7)](_0x4eb96a(0x254)),console[_0x4eb96a(0x1d7)](_0x4eb96a(0x201)),0x1;}return 0x0;}catch(_0x94138c){if(_0x94138c instanceof SDKError)return console[_0x4eb96a(0x1d7)](_0x4eb96a(0x26b)+_0x94138c['message']),_0x94138c[_0x4eb96a(0x236)]&&console[_0x4eb96a(0x1d7)]('\x20\x20Cause:\x20'+_0x94138c['cause']),0x1;throw _0x94138c;}}}export const SegmentInfoCommand=SegmentViewCommand;export class SegmentDescCommand extends BaseCommand{[a28_0x1cc6d6(0x217)]=a28_0x1cc6d6(0x1ed);[a28_0x1cc6d6(0x22a)]=a28_0x1cc6d6(0x25f);async[a28_0x1cc6d6(0x244)](_0x13953d){const _0x38d8b7=a28_0x1cc6d6,{options:_0x789958,args:_0x46bd19,tdx:_0x2b9fdc}=_0x13953d,_0x713182=_0x46bd19[0x0];if(!_0x713182)return console[_0x38d8b7(0x1d7)](_0x38d8b7(0x211)),console[_0x38d8b7(0x1d7)]('Usage:\x20tdx\x20sg\x20desc\x20<name>'),console[_0x38d8b7(0x1d7)](_0x38d8b7(0x1f3)),console[_0x38d8b7(0x1d7)](_0x38d8b7(0x274)),console[_0x38d8b7(0x1d7)](_0x38d8b7(0x275)),console[_0x38d8b7(0x1d7)](_0x38d8b7(0x22f)),0x1;try{const _0x2fe2c7=_0x789958[_0x38d8b7(0x225)],_0x4747ce=await resolveSegmentTarget(_0x713182,_0x2fe2c7,_0x789958[_0x38d8b7(0x20a)]);_0x789958[_0x38d8b7(0x20a)]&&console[_0x38d8b7(0x1d7)]('Target\x20path:\x20'+_0x4747ce);const _0x5c6f74=await withSpinner(_0x38d8b7(0x240)+_0x713182+'\x27...',()=>_0x2b9fdc['segment'][_0x38d8b7(0x1f1)](_0x4747ce),{'verbose':_0x789958[_0x38d8b7(0x20a)]}),_0x394503=_0x5c6f74[_0x38d8b7(0x1f4)];_0x789958[_0x38d8b7(0x20a)]&&(console[_0x38d8b7(0x1d7)]('Resolved\x20type:\x20'+_0x394503['type']),console['error'](_0x38d8b7(0x25b)+_0x394503[_0x38d8b7(0x231)]));if(_0x394503[_0x38d8b7(0x21b)]===_0x38d8b7(0x23d))return console[_0x38d8b7(0x1d7)]('Error:\x20Cannot\x20show\x20schema\x20for\x20a\x20folder.'),console[_0x38d8b7(0x1d7)](_0x38d8b7(0x249)),0x1;if(_0x394503['type']==='parent')return console[_0x38d8b7(0x1d7)](_0x38d8b7(0x260)),console['error']('Use:\x20tdx\x20ps\x20desc'),0x1;if(!_0x394503['segmentId'])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x38d8b7(0x24f));const _0x12c84f=await withSpinner('Fetching\x20SQL\x20for\x20segment...',()=>_0x2b9fdc['segment']['getSegmentSQL'](_0x394503[_0x38d8b7(0x231)],_0x394503['segmentId']),{'verbose':_0x789958[_0x38d8b7(0x20a)]}),_0x4c9325=_0x12c84f[_0x38d8b7(0x1f4)],_0x545193=await executeSchemaQuery(_0x4c9325,_0x2b9fdc,_0x789958);return await handleQueryOutput(_0x545193,_0x789958),0x0;}catch(_0x44df43){if(_0x44df43 instanceof SDKError)return console[_0x38d8b7(0x1d7)](_0x38d8b7(0x26b)+_0x44df43[_0x38d8b7(0x204)]),_0x44df43[_0x38d8b7(0x236)]&&console[_0x38d8b7(0x1d7)](_0x38d8b7(0x222)+_0x44df43[_0x38d8b7(0x236)]),0x1;throw _0x44df43;}}}
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
- const a29_0x3b878a=a29_0xa45b;(function(_0x227956,_0xa10ad9){const _0x2250b2=a29_0xa45b,_0x4fd7af=_0x227956();while(!![]){try{const _0x52049e=parseInt(_0x2250b2(0x18a))/0x1*(-parseInt(_0x2250b2(0x19c))/0x2)+parseInt(_0x2250b2(0x193))/0x3+-parseInt(_0x2250b2(0x1a2))/0x4*(-parseInt(_0x2250b2(0x1a5))/0x5)+parseInt(_0x2250b2(0x18f))/0x6*(parseInt(_0x2250b2(0x18c))/0x7)+-parseInt(_0x2250b2(0x199))/0x8+parseInt(_0x2250b2(0x186))/0x9*(parseInt(_0x2250b2(0x189))/0xa)+-parseInt(_0x2250b2(0x19d))/0xb*(-parseInt(_0x2250b2(0x183))/0xc);if(_0x52049e===_0xa10ad9)break;else _0x4fd7af['push'](_0x4fd7af['shift']());}catch(_0x594f8f){_0x4fd7af['push'](_0x4fd7af['shift']());}}}(a29_0x5d45,0x291a3));function a29_0xa45b(_0xeef95a,_0x2b3f25){_0xeef95a=_0xeef95a-0x180;const _0x5d450a=a29_0x5d45();let _0xa45b95=_0x5d450a[_0xeef95a];return _0xa45b95;}import{BaseCommand}from'./command.js';function a29_0x5d45(){const _0x269d3a=['Resolving\x20folder\x20path\x20\x27','folder','Parent\x20path:\x20','\x27...','yellow','invisible','verbose','Site:\x20','length','1320ZEcAgW','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27','Resolved\x20relative\x20path\x20to:\x20','18AufMnO','data','Create\x20child\x20segment\x20with\x20filtering\x20rules','51730NOjHUI','102244KwwGIu','segments','427rSWXNS','segment','kind','3018ocEXii','Target\x20path:\x20','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','Resolved\x20folder\x20ID:\x20','144228Fiomhr','⚠\x20Deprecation\x20warning:\x20`segment\x20create`\x20is\x20deprecated.','resolveParentId','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','error','Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]','1109096lhcjns','Creating\x20segment\x20\x27','\x20\x20\x20Path:\x20','2nGreTO','14520KzCoAq','resolveFolderId','resolvePathToResource','site','segmentPath','4TYVzSV','name','folderId','874655CLNgtC','segment:create','\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','includes','Segment\x20name:\x20','Resolving\x20folder\x20\x27','description','rule'];a29_0x5d45=function(){return _0x269d3a;};return a29_0x5d45();}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_0x2018ee from'chalk';export class SegmentCreateCommand extends BaseCommand{[a29_0x3b878a(0x1a3)]=a29_0x3b878a(0x1a6);[a29_0x3b878a(0x1ab)]=a29_0x3b878a(0x188);async['execute'](_0x331dd0){const _0x1aceb2=a29_0x3b878a;console[_0x1aceb2(0x197)](a29_0x2018ee[_0x1aceb2(0x1b1)](_0x1aceb2(0x194))),console[_0x1aceb2(0x197)](a29_0x2018ee[_0x1aceb2(0x1b1)](_0x1aceb2(0x196)));const {options:_0x3271ba,args:_0x2a42d4,tdx:_0x340f39}=_0x331dd0,_0x418452=_0x3271ba;if(_0x2a42d4[_0x1aceb2(0x182)]===0x0)return console[_0x1aceb2(0x197)](_0x1aceb2(0x191)),console[_0x1aceb2(0x197)]('Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]'),console[_0x1aceb2(0x197)]('Examples:'),console[_0x1aceb2(0x197)](_0x1aceb2(0x184)),console[_0x1aceb2(0x197)]('\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27'),console[_0x1aceb2(0x197)](_0x1aceb2(0x1a7)),0x1;const _0x2bcce2=_0x2a42d4[0x0],_0x5f0844=_0x3271ba[_0x1aceb2(0x1a1)];let _0x329bbf=_0x2bcce2;_0x5f0844&&!_0x2bcce2[_0x1aceb2(0x1a8)]('/')&&(_0x329bbf=_0x5f0844+'/'+_0x2bcce2,_0x418452[_0x1aceb2(0x180)]&&console[_0x1aceb2(0x197)](_0x1aceb2(0x185)+_0x329bbf));const _0x4a2251=parsePath(_0x329bbf);if(_0x4a2251['segments']['length']<0x2)return console['error']('Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)'),console[_0x1aceb2(0x197)](_0x1aceb2(0x198)),0x1;const _0x114dc0=_0x4a2251[_0x1aceb2(0x18b)][0x0],_0x3afc08=getBaseName(_0x329bbf),_0xa40d45=getParentPath(_0x329bbf);_0x418452[_0x1aceb2(0x180)]&&(console['error'](_0x1aceb2(0x181)+_0x418452[_0x1aceb2(0x1a0)]),console[_0x1aceb2(0x197)](_0x1aceb2(0x190)+_0x329bbf),console[_0x1aceb2(0x197)]('Parent:\x20'+_0x114dc0),console[_0x1aceb2(0x197)](_0x1aceb2(0x1a9)+_0x3afc08),console[_0x1aceb2(0x197)](_0x1aceb2(0x1af)+_0xa40d45));const _0x104e98=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x114dc0+_0x1aceb2(0x1b0),()=>_0x340f39[_0x1aceb2(0x18d)][_0x1aceb2(0x195)](_0x114dc0),{'verbose':_0x418452['verbose']}),_0x5a8db3=_0x104e98[_0x1aceb2(0x187)];let _0x2b3c02;if(_0x4a2251[_0x1aceb2(0x18b)][_0x1aceb2(0x182)]>0x2){const _0xbf9003=await withSpinner(_0x1aceb2(0x1ad)+_0xa40d45+_0x1aceb2(0x1b0),()=>_0x340f39['segment'][_0x1aceb2(0x19f)](_0xa40d45),{'verbose':_0x418452['verbose']}),_0x3966eb=_0xbf9003[_0x1aceb2(0x187)];if(_0x3966eb['type']!==_0x1aceb2(0x1ae)&&_0x3966eb['type']!=='parent')return console[_0x1aceb2(0x197)]('Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.'),0x1;_0x2b3c02=_0x3966eb[_0x1aceb2(0x1a4)];}else{if(_0x418452[_0x1aceb2(0x1ae)]){const _0x56dec6=await withSpinner(_0x1aceb2(0x1aa)+_0x418452[_0x1aceb2(0x1ae)]+_0x1aceb2(0x1b0),()=>_0x340f39[_0x1aceb2(0x18d)][_0x1aceb2(0x19e)](_0x5a8db3,_0x418452[_0x1aceb2(0x1ae)]),{'verbose':_0x418452[_0x1aceb2(0x180)]});_0x2b3c02=_0x56dec6[_0x1aceb2(0x187)];}}_0x418452[_0x1aceb2(0x180)]&&_0x2b3c02&&console[_0x1aceb2(0x197)](_0x1aceb2(0x192)+_0x2b3c02);const _0x477027=await loadJSONFromOptions(_0x418452[_0x1aceb2(0x1ac)],_0x418452['ruleFile']),_0x4e8643={'name':_0x3afc08,'description':_0x418452[_0x1aceb2(0x1ab)],'rule':_0x477027,'kind':_0x418452[_0x1aceb2(0x18e)]!==undefined?parseInt(_0x418452[_0x1aceb2(0x18e)],0xa):undefined,'isVisible':_0x418452[_0x1aceb2(0x1b2)]?![]:undefined,'segmentFolderId':_0x2b3c02,'countPopulation':_0x418452['noCountPopulation']?![]:undefined},_0x2b8049=await withSpinner(_0x1aceb2(0x19a)+_0x3afc08+_0x1aceb2(0x1b0),()=>_0x340f39[_0x1aceb2(0x18d)]['createSegment'](_0x5a8db3,_0x4e8643),{'verbose':_0x418452[_0x1aceb2(0x180)]}),_0x358c55=_0x2b8049[_0x1aceb2(0x187)];return console[_0x1aceb2(0x197)]('✔\x20Created\x20segment\x20\x27'+_0x358c55[_0x1aceb2(0x1a3)]+'\x27\x20with\x20ID:\x20'+_0x358c55['id']),_0x329bbf!==_0x2bcce2&&console[_0x1aceb2(0x197)](_0x1aceb2(0x19b)+_0x329bbf),await handleSDKOutput([_0x358c55],_0x418452),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
- const a30_0x40bfe1=a30_0x4e9e;function a30_0x3df3(){const _0x3167c1=['execute','✔\x20Found\x20','58424iMIcDm','11979591mKbzRV','162526RQnynb','json','parentSegment','10110dFIavE','2497ajyRys','data','7hIgfXk','4AxEgYe','12nasEmT','error','Listing\x20fields\x20for\x20\x27','length','521825EwlYVs','21zpPMOx','2176626slkVUk','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','verbose','10557UqJKjE','listFields','segment','Parent\x20segment:\x20','\x27...','608MrEcwK','site'];a30_0x3df3=function(){return _0x3167c1;};return a30_0x3df3();}(function(_0x401817,_0x1ced2b){const _0x5789bf=a30_0x4e9e,_0x35fee9=_0x401817();while(!![]){try{const _0x2781b4=parseInt(_0x5789bf(0x13e))/0x1+parseInt(_0x5789bf(0x13c))/0x2*(-parseInt(_0x5789bf(0x14b))/0x3)+-parseInt(_0x5789bf(0x145))/0x4*(-parseInt(_0x5789bf(0x14a))/0x5)+-parseInt(_0x5789bf(0x14c))/0x6*(parseInt(_0x5789bf(0x144))/0x7)+-parseInt(_0x5789bf(0x138))/0x8*(parseInt(_0x5789bf(0x14f))/0x9)+-parseInt(_0x5789bf(0x141))/0xa*(parseInt(_0x5789bf(0x142))/0xb)+-parseInt(_0x5789bf(0x146))/0xc*(-parseInt(_0x5789bf(0x13d))/0xd);if(_0x2781b4===_0x1ced2b)break;else _0x35fee9['push'](_0x35fee9['shift']());}catch(_0x56eac3){_0x35fee9['push'](_0x35fee9['shift']());}}}(a30_0x3df3,0x49da2));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{displayFieldsHumanReadable}from'../sdk/segment/fields-display.js';function a30_0x4e9e(_0x13d85e,_0x175f3c){_0x13d85e=_0x13d85e-0x136;const _0x3df367=a30_0x3df3();let _0x4e9e19=_0x3df367[_0x13d85e];return _0x4e9e19;}export class SegmentFieldsCommand extends BaseCommand{['name']='segment:fields';['description']='List\x20available\x20fields\x20for\x20segmentation';async[a30_0x40bfe1(0x13a)](_0x5a56e8){const _0x206058=a30_0x40bfe1,{options:_0xe9de8d,args:_0x51d155,tdx:_0x6f8c6d}=_0x5a56e8,_0x210a3e=_0x51d155[0x0]||_0xe9de8d[_0x206058(0x140)];if(!_0x210a3e)return console[_0x206058(0x147)]('Error:\x20Parent\x20segment\x20name\x20is\x20required'),console['error']('Usage:\x20tdx\x20segment\x20fields\x20<parent_name>'),console[_0x206058(0x147)](_0x206058(0x14d)),0x1;_0xe9de8d[_0x206058(0x14e)]&&(console[_0x206058(0x147)]('Site:\x20'+_0xe9de8d[_0x206058(0x139)]),console['error'](_0x206058(0x136)+_0x210a3e));const _0x1d368=await withSpinner(_0x206058(0x148)+_0x210a3e+_0x206058(0x137),()=>_0x6f8c6d[_0x206058(0x151)][_0x206058(0x150)](_0x210a3e),{'verbose':_0xe9de8d[_0x206058(0x14e)]}),_0xecc814=_0x1d368[_0x206058(0x143)];console[_0x206058(0x147)](_0x206058(0x13b)+_0xecc814[_0x206058(0x149)]+'\x20field'+(_0xecc814[_0x206058(0x149)]!==0x1?'s':''));if(_0xe9de8d[_0x206058(0x13f)]||_0xe9de8d['jsonl'])return await handleSDKOutput(_0xecc814,_0xe9de8d),0x0;return displayFieldsHumanReadable(_0xecc814,_0x210a3e),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_0x273820=a31_0x3dd0;(function(_0x1c5667,_0x58aa05){const _0x40ed2e=a31_0x3dd0,_0x29f2d7=_0x1c5667();while(!![]){try{const _0xc984a6=-parseInt(_0x40ed2e(0x8c))/0x1+-parseInt(_0x40ed2e(0x94))/0x2*(parseInt(_0x40ed2e(0xab))/0x3)+parseInt(_0x40ed2e(0x9d))/0x4*(-parseInt(_0x40ed2e(0xa6))/0x5)+parseInt(_0x40ed2e(0xb1))/0x6+parseInt(_0x40ed2e(0xad))/0x7*(parseInt(_0x40ed2e(0xa1))/0x8)+parseInt(_0x40ed2e(0x8e))/0x9+parseInt(_0x40ed2e(0x76))/0xa*(-parseInt(_0x40ed2e(0xa2))/0xb);if(_0xc984a6===_0x58aa05)break;else _0x29f2d7['push'](_0x29f2d7['shift']());}catch(_0x1ef96b){_0x29f2d7['push'](_0x29f2d7['shift']());}}}(a31_0x344f,0x43eae));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{saveSessionContext}from'../core/session.js';function a31_0x3dd0(_0x4ba08a,_0x280df2){_0x4ba08a=_0x4ba08a-0x6b;const _0x344ff3=a31_0x344f();let _0x3dd0ad=_0x344ff3[_0x4ba08a];return _0x3dd0ad;}function a31_0x344f(){const _0x110ad9=['57999mlXETL','\x20\x20Target:\x20','4493745vUVgni','name','✔\x20Pulled\x20','parent_segment','\x20new\x20files','parentSegment','2xyeKZr','data','hasChanges','cyan','\x20\x20🗺️\x20\x20','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','cwd','type','8mxzicI','repeat','Aborted.','red','334384HEGFBQ','34507VrdNHa','setPhase','Pulling\x20segments\x20from\x20\x27','errorCode','177215HfsFgj','dirname','segment:pull','\x20files\x20to\x20','\x20segments','446010QyjkiX','✔\x20Context\x20set:\x20','7XzjmlC','parentName','\x20\x20🎯\x20','No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27','1424214tZTfKt','description','no_parent','verbose','Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files','helpText','yellow','files','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)','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','journeyVersions','diff','absolutePath','710FJrnJA','targetDir','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','length','\x0aChanges\x20to\x20\x27','journeys','utf-8','dim','green','resourceName','Site:\x20','\x20journeys','\x20unchanged\x20files','\x20activations','segment','\x20=\x20','counts','error','session','isNew','✔\x20All\x20files\x20are\x20up\x20to\x20date','filter'];a31_0x344f=function(){return _0x110ad9;};return a31_0x344f();}import a31_0x3aa7c5 from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';import a31_0x1f4d12 from'path';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';export{buildFolderIdToPathMap as buildFolderPathMap}from'../sdk/segment/resolution-context.js';export class SegmentPullCommand extends BaseCommand{[a31_0x273820(0x8f)]=a31_0x273820(0xa8);[a31_0x273820(0xb2)]=a31_0x273820(0x6d);async['execute'](_0x1e41c4){const _0x5117af=a31_0x273820,{options:_0x41bf3a,args:_0x18694e,tdx:_0x97125c}=_0x1e41c4,_0x3c97cd=_0x41bf3a,_0x14a0d8=await resolveTarget({'arg':_0x18694e[0x0],'contextParent':_0x41bf3a[_0x5117af(0x93)],'cwd':process[_0x5117af(0x9b)]()});if(!isSuccessfulResolution(_0x14a0d8))return _0x14a0d8[_0x5117af(0xa5)]===_0x5117af(0x6b)?(console[_0x5117af(0x87)](a31_0x3aa7c5['yellow'](_0x5117af(0x99))),console['error'](_0x5117af(0x71)),console[_0x5117af(0x87)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent'),console[_0x5117af(0x87)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file')):(console['error'](a31_0x3aa7c5[_0x5117af(0xa0)]('Error:\x20'+_0x14a0d8['message']+'\x0a')),_0x14a0d8[_0x5117af(0x6e)]&&console[_0x5117af(0x87)](a31_0x3aa7c5[_0x5117af(0x97)](_0x14a0d8[_0x5117af(0x6e)]))),0x1;const _0xcc5937=_0x14a0d8[_0x5117af(0xae)],_0x1376eb=_0x14a0d8['targetDir'],_0x169d68=_0x14a0d8[_0x5117af(0x9c)]==='file'?_0x14a0d8[_0x5117af(0x7f)]:undefined;_0x3c97cd['verbose']&&(console[_0x5117af(0x87)](_0x5117af(0x80)+_0x3c97cd['site']),console[_0x5117af(0x87)]('Parent\x20segment:\x20'+_0xcc5937),_0x169d68&&console[_0x5117af(0x87)]('Target\x20resource:\x20'+_0x169d68));const _0x2c498a=await withProgressSpinner(_0x5117af(0xa4)+_0xcc5937+'\x27...',_0x69d39e=>_0x97125c[_0x5117af(0x84)]['pullSegments'](_0xcc5937,{'targetDir':_0x1376eb,'targetResourceName':_0x169d68,'verbose':_0x3c97cd[_0x5117af(0x6c)],'progress':{'update':_0x4e38ea=>{const _0x25e31c=_0x5117af;_0x69d39e[_0x25e31c(0xa3)](_0x4e38ea),_0x3c97cd[_0x25e31c(0x6c)]&&console[_0x25e31c(0x87)]('\x20\x20'+_0x4e38ea);}}}),{'verbose':_0x3c97cd[_0x5117af(0x6c)]}),_0x4ba30b=_0x2c498a[_0x5117af(0x95)];if(_0x4ba30b[_0x5117af(0x86)]['segments']===0x0&&_0x4ba30b[_0x5117af(0x86)][_0x5117af(0x7b)]===0x0)return console[_0x5117af(0x87)](a31_0x3aa7c5[_0x5117af(0x6f)](_0x5117af(0xb0)+_0x4ba30b[_0x5117af(0xae)]+'\x27')),0x0;const _0x4c255e=_0x4ba30b[_0x5117af(0x70)][_0x5117af(0x8b)](_0x1b3630=>_0x1b3630[_0x5117af(0x89)]),_0x3d9713=_0x4ba30b[_0x5117af(0x70)][_0x5117af(0x8b)](_0x22d72a=>!_0x22d72a[_0x5117af(0x89)]&&_0x22d72a['hasChanges']),_0x311c1c=_0x4ba30b['files'][_0x5117af(0x8b)](_0xfe1614=>!_0xfe1614[_0x5117af(0x89)]&&!_0xfe1614[_0x5117af(0x96)]);console[_0x5117af(0x87)]('\x0aPull\x20summary\x20for\x20\x27'+_0x4ba30b['parentName']+'\x27:'),console[_0x5117af(0x87)](_0x5117af(0xaf)+a31_0x3aa7c5['cyan'](_0x4ba30b[_0x5117af(0x86)]['segments']+_0x5117af(0xaa))+'\x20with\x20'+a31_0x3aa7c5[_0x5117af(0x97)](_0x4ba30b[_0x5117af(0x86)]['activations']+_0x5117af(0x83)));if(_0x4ba30b['counts'][_0x5117af(0x7b)]>0x0){const _0x1d2c0f=_0x4ba30b[_0x5117af(0x86)][_0x5117af(0x73)]>_0x4ba30b[_0x5117af(0x86)]['journeys']?'\x20('+_0x4ba30b[_0x5117af(0x86)][_0x5117af(0x73)]+'\x20versions)':'';console[_0x5117af(0x87)](_0x5117af(0x98)+a31_0x3aa7c5[_0x5117af(0x97)](_0x4ba30b[_0x5117af(0x86)][_0x5117af(0x7b)]+_0x5117af(0x81))+a31_0x3aa7c5['dim'](_0x1d2c0f));}console[_0x5117af(0x87)]('\x20\x20'+a31_0x3aa7c5[_0x5117af(0x7e)]('+\x20'+_0x4c255e[_0x5117af(0x79)]+_0x5117af(0x92))),console[_0x5117af(0x87)]('\x20\x20'+a31_0x3aa7c5[_0x5117af(0x6f)]('~\x20'+_0x3d9713[_0x5117af(0x79)]+'\x20changed\x20files')),console[_0x5117af(0x87)]('\x20\x20'+a31_0x3aa7c5[_0x5117af(0x7d)]('=\x20'+_0x311c1c['length']+_0x5117af(0x82))),console[_0x5117af(0x87)](_0x5117af(0x8d)+a31_0x3aa7c5[_0x5117af(0x97)](_0x4ba30b[_0x5117af(0x77)])+'\x0a');if(_0x3d9713[_0x5117af(0x79)]>0x0)for(const _0x4deaac of _0x3d9713){console[_0x5117af(0x87)](_0x5117af(0x7a)+_0x4deaac['relativePath']+'\x27:'),console['error']('─'[_0x5117af(0x9e)](0x3c)),console[_0x5117af(0x87)](_0x4deaac[_0x5117af(0x74)]),console[_0x5117af(0x87)]('─'['repeat'](0x3c));}if(_0x3c97cd['dryRun'])return console[_0x5117af(0x87)](a31_0x3aa7c5[_0x5117af(0x6f)](_0x5117af(0x9a))),0x0;if(_0x4c255e[_0x5117af(0x79)]===0x0&&_0x3d9713['length']===0x0)return console['error'](a31_0x3aa7c5[_0x5117af(0x7e)](_0x5117af(0x8a))),saveSessionContext({'parent_segment':_0x4ba30b[_0x5117af(0xae)]},_0x3c97cd[_0x5117af(0x88)]),console['error'](a31_0x3aa7c5[_0x5117af(0x7e)](_0x5117af(0xac)+a31_0x3aa7c5[_0x5117af(0x7d)]('parent_segment')+_0x5117af(0x85)+a31_0x3aa7c5[_0x5117af(0x97)](_0x4ba30b[_0x5117af(0xae)]))),0x0;if(!_0x3c97cd['yes']){if(!isInteractive())return console[_0x5117af(0x87)](a31_0x3aa7c5['red']('\x0aError:'),_0x5117af(0x78)),console[_0x5117af(0x87)](a31_0x3aa7c5[_0x5117af(0x7d)](_0x5117af(0x72))),0x1;const _0xe9c2d5=await confirmKey('Write\x20'+(_0x4c255e[_0x5117af(0x79)]+_0x3d9713[_0x5117af(0x79)])+'\x20files?');if(!_0xe9c2d5)return console[_0x5117af(0x87)](a31_0x3aa7c5[_0x5117af(0x6f)](_0x5117af(0x9f)),'-\x20no\x20files\x20written'),0x1;}for(const _0x4754d1 of _0x4ba30b[_0x5117af(0x70)]){if(_0x4754d1[_0x5117af(0x89)]||_0x4754d1[_0x5117af(0x96)]){const _0x5bbd08=a31_0x1f4d12[_0x5117af(0xa7)](_0x4754d1[_0x5117af(0x75)]);!existsSync(_0x5bbd08)&&mkdirSync(_0x5bbd08,{'recursive':!![]}),writeFileSync(_0x4754d1[_0x5117af(0x75)],_0x4754d1['content'],_0x5117af(0x7c));}}return console[_0x5117af(0x87)](a31_0x3aa7c5[_0x5117af(0x7e)](_0x5117af(0x90)+(_0x4c255e[_0x5117af(0x79)]+_0x3d9713['length'])+_0x5117af(0xa9)+_0x4ba30b['targetDir'])),saveSessionContext({'parent_segment':_0x4ba30b['parentName']},_0x3c97cd[_0x5117af(0x88)]),console[_0x5117af(0x87)](a31_0x3aa7c5[_0x5117af(0x7e)](_0x5117af(0xac)+a31_0x3aa7c5['dim'](_0x5117af(0x91))+_0x5117af(0x85)+a31_0x3aa7c5[_0x5117af(0x97)](_0x4ba30b[_0x5117af(0xae)]))),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_0x4da8a3=a32_0x46b9;(function(_0x508bd4,_0x50e2ae){const _0x1412cd=a32_0x46b9,_0x39fd24=_0x508bd4();while(!![]){try{const _0x546080=parseInt(_0x1412cd(0xd1))/0x1*(-parseInt(_0x1412cd(0x9b))/0x2)+parseInt(_0x1412cd(0xaf))/0x3*(parseInt(_0x1412cd(0x100))/0x4)+-parseInt(_0x1412cd(0x73))/0x5*(-parseInt(_0x1412cd(0xb1))/0x6)+parseInt(_0x1412cd(0xcc))/0x7+parseInt(_0x1412cd(0xf6))/0x8*(parseInt(_0x1412cd(0xc2))/0x9)+-parseInt(_0x1412cd(0xc4))/0xa+-parseInt(_0x1412cd(0xb5))/0xb*(parseInt(_0x1412cd(0xf5))/0xc);if(_0x546080===_0x50e2ae)break;else _0x39fd24['push'](_0x39fd24['shift']());}catch(_0x2a747b){_0x39fd24['push'](_0x39fd24['shift']());}}}(a32_0x58d5,0x4aaf3));import{BaseCommand}from'./command.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{generateDiff,formatDiffWithColors}from'../utils/diff.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{batchAsync}from'../utils/async.js';import{segmentToYamlString,segmentWithActivationsToYaml}from'../sdk/segment/child-segment-yaml.js';import a32_0x37e46d from'chalk';import{existsSync}from'fs';function a32_0x58d5(){const _0x24dc0d=['Scoped\x20to\x20folder:\x20','journeys','\x20updated','versionNumber','list','blue','toCreate','diff','\x20to\x20update','createdAt','journey','Resolving\x20parent\x20segment\x20\x27','getOutputSchemaWithCache','journeyBundleId','activations','segments','Parent\x20segment:\x20','updatedAt','length','attributes','segment:push','filePath','verbose','filter','\x20to\x20create','changed','state','results','folderId','name','new','Error:\x20Directory\x20not\x20found:\x20','message','created','segmentFolderId','Fetching\x20users\x20for\x20email\x20resolution...','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','15786AqpWFv','Delete\x20segment:','yellow','repeat','data','✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','user','join','segment','relationships','No\x20','helpText','execute','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','/app/ps/','segment\x20or\x20journey','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)','\x20deleted','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','get','1241397zSQyJL','parentFolder','2034KTDcfm','\x0aPush\x20summary\x20for\x20\x27','\x20\x20📊\x20Segments:','listActivations','154wkiRxl','toDelete','delete','map','listFolders','then','\x20\x20Journeys:\x20','New\x20journey:','getParent','red','yamlConfig','\x20to\x20delete','error','351162Szammu','Fetching\x20parent\x20segment\x20details...','5616860wStptz','listJourneysWithDetailsFromParentSegment','journeyBundleName','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','description','journeysOnly','\x20\x20Segments:\x20','nameToId','4193994lJoqam','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','Changes\x20to:','updated','/j/da/je','70aqYhSW','connection','add','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','Delete\x20journey:','green','Aborted.','setPhase','(Journey\x20will\x20be\x20deleted)','site','\x20folders\x20to\x20create','isNew','dim','errorCode','listSegments','targetDir','createdSegmentIds','cwd','audienceId','\x20unchanged','scopedFolderPath','idToName','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','journeyId','parentSegment','\x20changed','Site:\x20','buildUserMaps','\x0aValidation\x20failed:','\x20activations]','.yml','\x20\x20🗺️\x20\x20Journeys:','all','\x0a✔\x20Push\x20complete','cyan','folderPath','87180OewmyD','8RCGFwQ','yes','\x20\x20Activations:\x20','Fetching\x20existing\x20activations...','Source\x20directory:\x20','New\x20segment:','\x20\x20Source:\x20','endsWith','dryRun','type','4EzYqKS','Fetching\x20existing\x20segments...','existingJourney','paused','no_parent','toUpdate','.yaml','unchanged','\x20new','\x0aError:','Preparing\x20journeys...','file','\x20created','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','/e/','push','parent_name','6930fSQgBL','\x20\x20\x20\x20','set'];a32_0x58d5=function(){return _0x24dc0d;};return a32_0x58d5();}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_0x46b9(_0x1c642c,_0x648bd8){_0x1c642c=_0x1c642c-0x65;const _0x58d564=a32_0x58d5();let _0x46b9d8=_0x58d564[_0x1c642c];return _0x46b9d8;}export class SegmentPushCommand extends BaseCommand{[a32_0x4da8a3(0x93)]=a32_0x4da8a3(0x8a);[a32_0x4da8a3(0xc8)]=a32_0x4da8a3(0xad);async[a32_0x4da8a3(0xa7)](_0x13af07){const _0xb4a282=a32_0x4da8a3,{options:_0x52380d,args:_0x11973e,tdx:_0x57a515}=_0x13af07,_0x3bd338=_0x52380d,_0x532942=await resolveTarget({'arg':_0x11973e[0x0],'contextParent':_0x52380d[_0xb4a282(0xe9)],'cwd':process[_0xb4a282(0xe2)]()});if(!isSuccessfulResolution(_0x532942))return _0x532942[_0xb4a282(0xde)]===_0xb4a282(0x66)?(console['error'](a32_0x37e46d['yellow'](_0xb4a282(0xc7))),console[_0xb4a282(0xc1)](_0xb4a282(0xab)),console[_0xb4a282(0xc1)](_0xb4a282(0xe7)),console[_0xb4a282(0xc1)]('\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[_0xb4a282(0xc1)](a32_0x37e46d['red']('Error:\x20'+_0x532942['message']+'\x0a')),_0x532942[_0xb4a282(0xa6)]&&console[_0xb4a282(0xc1)](a32_0x37e46d[_0xb4a282(0xf3)](_0x532942['helpText']))),0x1;if(_0x532942['type']===_0xb4a282(0x72))return console[_0xb4a282(0xc1)](a32_0x37e46d['red'](_0xb4a282(0x95)+_0x532942[_0xb4a282(0xe0)]+'\x0a')),console[_0xb4a282(0xc1)](a32_0x37e46d[_0xb4a282(0xf3)](_0xb4a282(0xd4))),0x1;const _0xbfe72f=_0x532942['parentName'],_0x517f02=_0x532942[_0xb4a282(0xe0)],_0x122cb0=_0x532942[_0xb4a282(0xff)]===_0xb4a282(0x6d)?_0x532942[_0xb4a282(0x8b)]:undefined,_0x1a0e6a=getScopedDetails(_0x532942),_0x1445df=_0x1a0e6a?.['isScoped']??![],_0x219cfd=_0x1a0e6a?.[_0xb4a282(0xe5)]??'';if(!existsSync(_0x517f02))return console[_0xb4a282(0xc1)](a32_0x37e46d[_0xb4a282(0xbe)](_0xb4a282(0x95)+_0x517f02+'\x0a')),console[_0xb4a282(0xc1)](a32_0x37e46d[_0xb4a282(0xf3)](_0xb4a282(0xd4))),0x1;_0x3bd338['verbose']&&(console['error'](_0xb4a282(0xeb)+_0x3bd338[_0xb4a282(0xda)]),console[_0xb4a282(0xc1)](_0xb4a282(0x86)+_0xbfe72f),console[_0xb4a282(0xc1)](_0xb4a282(0xfa)+_0x517f02),_0x1445df&&console[_0xb4a282(0xc1)](_0xb4a282(0x76)+_0x219cfd));const _0xdaa653=await withSpinner(_0xb4a282(0x81)+_0xbfe72f+'\x27...',()=>_0x57a515['segment']['resolveParentId'](_0xbfe72f),{'verbose':_0x3bd338[_0xb4a282(0x8c)]}),_0x42bbf2=_0xdaa653['data'],[_0x53e80d,_0x4b9a9a,_0x20faef,_0x15cf4c,_0x245c0b]=await Promise[_0xb4a282(0xf1)]([withSpinner(_0xb4a282(0xc3),()=>_0x57a515['segment'][_0xb4a282(0xbd)](_0x42bbf2),{'verbose':_0x3bd338[_0xb4a282(0x8c)]}),withSpinner(_0xb4a282(0x101),()=>_0x57a515[_0xb4a282(0xa3)][_0xb4a282(0xdf)](_0x42bbf2),{'verbose':_0x3bd338[_0xb4a282(0x8c)]}),withSpinner('Fetching\x20existing\x20folders...',()=>_0x57a515['segment'][_0xb4a282(0xb9)](_0x42bbf2),{'verbose':_0x3bd338[_0xb4a282(0x8c)]}),withSpinner('Fetching\x20existing\x20journeys...',()=>_0x57a515['journey'][_0xb4a282(0xc5)](_0x42bbf2,{'includeAllVersions':!![]}),{'verbose':_0x3bd338[_0xb4a282(0x8c)]}),withSpinner(_0xb4a282(0x99),()=>_0x57a515[_0xb4a282(0xa1)][_0xb4a282(0xec)](),{'verbose':_0x3bd338[_0xb4a282(0x8c)]})['then'](_0x538455=>_0x538455[_0xb4a282(0x9f)])]),_0x151ab3=_0x53e80d[_0xb4a282(0x9f)],_0xa7f1dd=extractRootFolderId(_0x151ab3),_0xc74883=_0x4b9a9a[_0xb4a282(0x9f)],_0x301a49=_0x20faef[_0xb4a282(0x9f)],{journeys:_0x407471,activationStepsById:_0x53a9d2}=_0x15cf4c[_0xb4a282(0x9f)],_0x1f8a82=new Map(_0x407471[_0xb4a282(0xb8)](_0xeda30a=>[_0xeda30a['id'],_0xeda30a])),_0x34f51c=_0x407471[_0xb4a282(0xb8)](_0x19b617=>({'id':_0x19b617['id'],'name':_0x19b617[_0xb4a282(0x89)]['name'],'journeyBundleName':_0x19b617['attributes']['journeyBundleName']||'','journeyBundleId':_0x19b617['attributes'][_0xb4a282(0x83)]||'','versionNumber':_0x19b617[_0xb4a282(0x89)][_0xb4a282(0x79)],'description':_0x19b617[_0xb4a282(0x89)][_0xb4a282(0xc8)],'state':_0x19b617['attributes'][_0xb4a282(0x90)],'paused':_0x19b617[_0xb4a282(0x89)][_0xb4a282(0x65)],'audienceId':_0x19b617[_0xb4a282(0x89)][_0xb4a282(0xe3)],'folderId':_0x19b617[_0xb4a282(0xa4)]?.[_0xb4a282(0xb0)]?.[_0xb4a282(0x9f)]?.['id'],'createdAt':_0x19b617[_0xb4a282(0x89)][_0xb4a282(0x7f)],'updatedAt':_0x19b617[_0xb4a282(0x89)][_0xb4a282(0x87)]})),{emailToId:_0xda4a63,idToEmail:_0x24dd65}=_0x245c0b,_0x2e2959=await withSpinner('Fetching\x20connections\x20for\x20name\x20resolution...',async()=>{const _0x5a4c92=_0xb4a282,_0x275d19=await _0x57a515['connection'][_0x5a4c92(0x7a)]();return buildConnectionMaps(_0x275d19);},{'verbose':_0x3bd338[_0xb4a282(0x8c)]})[_0xb4a282(0xba)](_0x1ee153=>_0x1ee153[_0xb4a282(0x9f)]),_0x3bd146=_0x2e2959[_0xb4a282(0xcb)],_0xf80c33=_0x2e2959[_0xb4a282(0xe6)],_0x566346=_0x2e2959['nameToType'],_0x52a89c={'emailToIdMap':_0xda4a63,'connectionNameToIdMap':_0x3bd146,'connectionNameToTypeMap':_0x566346,'getSchema':_0x447eb2=>_0x57a515[_0xb4a282(0xd2)][_0xb4a282(0x82)](_0x447eb2)};let {pathToId:_0x2a317f,idToPath:_0x324742}=buildFolderMaps(_0x301a49);const _0x42e3bf=buildSegmentLookupMap(_0xc74883,_0x324742),_0x5a1b11=buildSegmentNameToIdMap(_0xc74883),_0x389386=buildJourneyBundleLookupMap(_0x34f51c,_0x324742);let _0x413b40;if(_0x122cb0){if(!_0x122cb0[_0xb4a282(0xfd)](_0xb4a282(0xef))&&!_0x122cb0[_0xb4a282(0xfd)](_0xb4a282(0x68)))return console[_0xb4a282(0xc1)](a32_0x37e46d['red']('Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20'+_0x122cb0+'\x0a')),0x1;_0x413b40=[_0x122cb0];}else _0x413b40=findYamlFiles(_0x517f02);if(_0x413b40[_0xb4a282(0x88)]===0x0)return console[_0xb4a282(0xc1)](a32_0x37e46d[_0xb4a282(0xbe)]('Error:\x20No\x20YAML\x20files\x20found\x20in\x20'+_0x517f02+'\x0a')),console[_0xb4a282(0xc1)](a32_0x37e46d['cyan'](_0xb4a282(0x9a))),0x1;let _0x171a7b,_0x39e344;try{const _0x557814=parseAndClassifyYamlFiles(_0x413b40,_0x517f02,{'skipSegments':_0x3bd338[_0xb4a282(0xc9)]});_0x171a7b=_0x557814['segments'],_0x39e344=_0x557814[_0xb4a282(0x77)];const _0x25f6a2=validateParsedFiles(_0x557814,_0x517f02);if(_0x25f6a2[_0xb4a282(0x88)]>0x0)return console[_0xb4a282(0xc1)](a32_0x37e46d[_0xb4a282(0xbe)](_0xb4a282(0xed))),console['error'](formatValidationErrors(_0x25f6a2)),console[_0xb4a282(0xc1)](a32_0x37e46d[_0xb4a282(0x9d)]('\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.')),0x1;}catch(_0x59756a){return console[_0xb4a282(0xc1)](a32_0x37e46d[_0xb4a282(0xbe)]('Error\x20parsing\x20YAML:\x20'+(_0x59756a instanceof Error?_0x59756a[_0xb4a282(0x96)]:_0x59756a))),0x1;}if(_0x171a7b[_0xb4a282(0x88)]===0x0&&_0x39e344['length']===0x0){const _0x545e7e=_0x3bd338[_0xb4a282(0xc9)]?_0xb4a282(0x80):_0xb4a282(0xaa);return console[_0xb4a282(0xc1)](a32_0x37e46d[_0xb4a282(0x9d)](_0xb4a282(0xa5)+_0x545e7e+'\x20YAML\x20files\x20found')),0x0;}const _0x13172a=new Map();_0xc74883[_0xb4a282(0x88)]>0x0&&!_0x3bd338['journeysOnly']&&await withSpinner(_0xb4a282(0xf9),async()=>{await batchAsync(_0xc74883,async _0x56f0aa=>{const _0x5e7a8d=a32_0x46b9,_0x1a08ec=await _0x57a515[_0x5e7a8d(0xa3)][_0x5e7a8d(0xb4)](_0x42bbf2,_0x56f0aa['id']);_0x13172a[_0x5e7a8d(0x75)](_0x56f0aa['id'],_0x1a08ec);});},{'verbose':_0x3bd338[_0xb4a282(0x8c)]});const {segmentFiles:_0x305612,foldersToCreate:_0x15914e}=await prepareSegmentFiles(_0x171a7b,{'segmentByFolderAndName':_0x42e3bf,'activationsBySegmentId':_0x13172a,'folderPathToId':_0x2a317f,'idToEmailMap':_0x24dd65,'connectionIdToNameMap':_0xf80c33},_0x52a89c,_0x1445df,_0x219cfd),_0x4d4ca3=_0x122cb0?[]:findSegmentsToDelete(_0xc74883,_0x171a7b[_0xb4a282(0xb8)](({yamlConfig:_0x520e4e,folderPath:_0x1d294a})=>({'yamlConfig':_0x520e4e,'folderPath':resolveTDFolderPath(_0x1d294a,_0x1445df,_0x219cfd)})),_0x324742,_0x219cfd,_0x1445df),{journeyFiles:_0x296a33,foldersToCreate:_0x14b75f}=await withProgressSpinner(_0xb4a282(0x6c),async _0x5bfe86=>prepareJourneyFiles(_0x39e344,{'fetchJourney':async _0x1367e2=>_0x57a515[_0xb4a282(0x80)]['getJourney'](_0x1367e2[_0xb4a282(0xe8)]),'journeyBundlesByFolderAndName':_0x389386,'folderPathToId':_0x2a317f,'idToEmailMap':_0x24dd65,'connectionIdToNameMap':_0xf80c33,'existingSegments':_0xc74883,'parentId':_0x42bbf2,'deps':_0x57a515,'progress':{'update':_0x12e578=>{const _0x259293=_0xb4a282;_0x5bfe86[_0x259293(0xd8)](_0x12e578),_0x3bd338['verbose']&&console[_0x259293(0xc1)]('\x20\x20'+_0x12e578);}},'journeyById':_0x1f8a82,'activationStepsById':_0x53a9d2},_0x1445df,_0x219cfd),{'verbose':_0x3bd338['verbose']})['then'](_0x5edd53=>_0x5edd53[_0xb4a282(0x9f)]);for(const _0x425123 of _0x14b75f){_0x15914e[_0xb4a282(0xd3)](_0x425123);}const _0x3ecb8a=_0x122cb0?[]:findJourneysToDelete(_0x34f51c,_0x39e344[_0xb4a282(0xb8)](({yamlConfig:_0x36dfb2,folderPath:_0x1109d1})=>({'yamlConfig':_0x36dfb2,'folderPath':resolveTDFolderPath(_0x1109d1,_0x1445df,_0x219cfd)})),_0x324742,_0x219cfd,_0x1445df),_0x10872a=calculatePushStats(_0x305612,_0x296a33,_0x15914e,_0x4d4ca3,_0x3ecb8a,!!_0x3bd338[_0xb4a282(0xb7)],!!_0x3bd338['journeysOnly']),_0x38740d=_0x10872a[_0xb4a282(0x85)][_0xb4a282(0x94)],_0x501f50=_0x10872a[_0xb4a282(0x85)][_0xb4a282(0x8f)],_0x1c7a75=_0x10872a[_0xb4a282(0x85)][_0xb4a282(0x69)],_0x3b47d6=_0x10872a[_0xb4a282(0x85)][_0xb4a282(0xb6)],_0x1d4f98=_0x10872a['folders'][_0xb4a282(0x7c)],_0x4f5a6d=_0x10872a[_0xb4a282(0x77)][_0xb4a282(0x94)],_0x280235=_0x10872a[_0xb4a282(0x77)][_0xb4a282(0x8f)],_0x5ae4a5=_0x10872a[_0xb4a282(0x77)][_0xb4a282(0x69)],_0x4d9177=_0x10872a[_0xb4a282(0x77)][_0xb4a282(0xb6)],_0x7ad65d=_0x10872a[_0xb4a282(0x84)][_0xb4a282(0xf1)],_0x2b916b=_0x10872a[_0xb4a282(0x84)][_0xb4a282(0x7c)],_0x189010=_0x10872a['activations'][_0xb4a282(0x67)],_0x13425d=_0x10872a['activations'][_0xb4a282(0xb6)];console[_0xb4a282(0xc1)](_0xb4a282(0xb2)+_0xbfe72f+'\x27:');_0x1d4f98[_0xb4a282(0x88)]>0x0&&console['error']('\x20\x20'+a32_0x37e46d[_0xb4a282(0x7b)]('📁\x20'+_0x1d4f98[_0xb4a282(0x88)]+_0xb4a282(0xdb)));if(!_0x3bd338[_0xb4a282(0xc9)]){console[_0xb4a282(0xc1)](_0xb4a282(0xb3)),console[_0xb4a282(0xc1)](_0xb4a282(0x74)+a32_0x37e46d[_0xb4a282(0xd6)]('+\x20'+_0x38740d['length']+_0xb4a282(0x6a))),console['error']('\x20\x20\x20\x20'+a32_0x37e46d[_0xb4a282(0x9d)]('~\x20'+_0x501f50[_0xb4a282(0x88)]+_0xb4a282(0xea)));if(_0x3b47d6[_0xb4a282(0x88)]>0x0)console[_0xb4a282(0xc1)]('\x20\x20\x20\x20'+a32_0x37e46d[_0xb4a282(0xbe)]('-\x20'+_0x3b47d6[_0xb4a282(0x88)]+'\x20to\x20delete'));else _0x4d4ca3[_0xb4a282(0x88)]>0x0&&!_0x3bd338[_0xb4a282(0xb7)]&&console['error'](_0xb4a282(0x74)+a32_0x37e46d[_0xb4a282(0xdd)](_0x4d4ca3[_0xb4a282(0x88)]+'\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)'));console[_0xb4a282(0xc1)](_0xb4a282(0x74)+a32_0x37e46d[_0xb4a282(0xdd)]('=\x20'+_0x1c7a75[_0xb4a282(0x88)]+_0xb4a282(0xe4)));}if(_0x296a33[_0xb4a282(0x88)]>0x0||_0x3ecb8a['length']>0x0){console[_0xb4a282(0xc1)](_0xb4a282(0xf0)),console[_0xb4a282(0xc1)](_0xb4a282(0x74)+a32_0x37e46d[_0xb4a282(0xd6)]('+\x20'+_0x4f5a6d[_0xb4a282(0x88)]+_0xb4a282(0x6a))),console[_0xb4a282(0xc1)]('\x20\x20\x20\x20'+a32_0x37e46d[_0xb4a282(0x9d)]('~\x20'+_0x280235[_0xb4a282(0x88)]+_0xb4a282(0xea)));if(_0x4d9177[_0xb4a282(0x88)]>0x0)console[_0xb4a282(0xc1)](_0xb4a282(0x74)+a32_0x37e46d[_0xb4a282(0xbe)]('-\x20'+_0x4d9177[_0xb4a282(0x88)]+'\x20to\x20delete'));else _0x3ecb8a['length']>0x0&&!_0x3bd338[_0xb4a282(0xb7)]&&console[_0xb4a282(0xc1)](_0xb4a282(0x74)+a32_0x37e46d[_0xb4a282(0xdd)](_0x3ecb8a['length']+'\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)'));console[_0xb4a282(0xc1)]('\x20\x20\x20\x20'+a32_0x37e46d[_0xb4a282(0xdd)]('=\x20'+_0x5ae4a5[_0xb4a282(0x88)]+_0xb4a282(0xe4)));}_0x7ad65d['length']>0x0&&!_0x3bd338[_0xb4a282(0xc9)]&&(console['error'](''),console[_0xb4a282(0xc1)]('\x20\x20Activations:'),_0x2b916b['length']>0x0&&console['error'](_0xb4a282(0x74)+a32_0x37e46d['green']('+\x20'+_0x2b916b[_0xb4a282(0x88)]+_0xb4a282(0x8e))),_0x189010[_0xb4a282(0x88)]>0x0&&console[_0xb4a282(0xc1)](_0xb4a282(0x74)+a32_0x37e46d[_0xb4a282(0x9d)]('~\x20'+_0x189010['length']+_0xb4a282(0x7e))),_0x13425d['length']>0x0&&console[_0xb4a282(0xc1)](_0xb4a282(0x74)+a32_0x37e46d[_0xb4a282(0xbe)]('-\x20'+_0x13425d[_0xb4a282(0x88)]+_0xb4a282(0xc0))));console[_0xb4a282(0xc1)](_0xb4a282(0xfc)+a32_0x37e46d[_0xb4a282(0xf3)](_0x517f02)+'\x0a');if(_0x1d4f98[_0xb4a282(0x88)]>0x0){console['error']('Folders\x20to\x20create:');for(const _0x2f05c4 of _0x1d4f98){console[_0xb4a282(0xc1)]('\x20\x20'+a32_0x37e46d[_0xb4a282(0x7b)]('+')+'\x20'+_0x2f05c4);}console['error']('');}if(_0x38740d[_0xb4a282(0x88)]>0x0&&!_0x3bd338['journeysOnly'])for(const _0x9d8ce2 of _0x38740d){const _0x163ad0=_0x9d8ce2[_0xb4a282(0xf4)]?_0x9d8ce2[_0xb4a282(0xf4)]+'/'+_0x9d8ce2[_0xb4a282(0xbf)][_0xb4a282(0x93)]:_0x9d8ce2[_0xb4a282(0xbf)][_0xb4a282(0x93)],_0x52ce78=_0x9d8ce2[_0xb4a282(0xbf)]['activations']?.[_0xb4a282(0x88)]||0x0,_0x14cfe4=_0x52ce78>0x0?a32_0x37e46d['dim']('\x20['+_0x52ce78+_0xb4a282(0xee)):'';console[_0xb4a282(0xc1)]('\x0a'+a32_0x37e46d[_0xb4a282(0xd6)](_0xb4a282(0xfb))+'\x20'+_0x163ad0+_0x14cfe4),console[_0xb4a282(0xc1)]('─'[_0xb4a282(0x9e)](0x3c)),_0x9d8ce2[_0xb4a282(0x7d)]&&console['error'](_0x9d8ce2['diff']),console[_0xb4a282(0xc1)]('─'[_0xb4a282(0x9e)](0x3c));}if(_0x3b47d6[_0xb4a282(0x88)]>0x0&&!_0x3bd338[_0xb4a282(0xc9)])for(const _0x1b0592 of _0x3b47d6){const _0x567b7b=_0x1b0592['segmentFolderId']?_0x324742[_0xb4a282(0xae)](_0x1b0592[_0xb4a282(0x98)]['toString']())||'':'',_0x96bd53=_0x567b7b?_0x567b7b+'/'+_0x1b0592[_0xb4a282(0x93)]:_0x1b0592[_0xb4a282(0x93)],_0x3a65cb=_0x13172a[_0xb4a282(0xae)](_0x1b0592['id'])||[],_0x3f1fcb=_0x3a65cb[_0xb4a282(0x88)]>0x0?a32_0x37e46d['dim']('\x20['+_0x3a65cb[_0xb4a282(0x88)]+'\x20activations]'):'';console['error']('\x0a'+a32_0x37e46d[_0xb4a282(0xbe)](_0xb4a282(0x9c))+'\x20'+_0x96bd53+_0x3f1fcb),console['error']('─'[_0xb4a282(0x9e)](0x3c));const _0x4753ad=segmentWithActivationsToYaml(_0x1b0592,_0x3a65cb,undefined,_0x24dd65,_0xf80c33),_0x3ae3d3=segmentToYamlString(_0x4753ad),_0x284162=generateDiff(_0x3ae3d3,'');console[_0xb4a282(0xc1)](formatDiffWithColors(_0x284162)),console[_0xb4a282(0xc1)]('─'[_0xb4a282(0x9e)](0x3c));}const _0x2cbdba=_0x305612[_0xb4a282(0x8d)](_0x172188=>!_0x172188[_0xb4a282(0xdc)]&&_0x172188['diff']);if(_0x2cbdba[_0xb4a282(0x88)]>0x0&&!_0x3bd338[_0xb4a282(0xc9)])for(const _0x3f21cd of _0x2cbdba){const _0x1d7d1b=_0x3f21cd[_0xb4a282(0xf4)]?_0x3f21cd[_0xb4a282(0xf4)]+'/'+_0x3f21cd[_0xb4a282(0xbf)][_0xb4a282(0x93)]:_0x3f21cd[_0xb4a282(0xbf)]['name'];console[_0xb4a282(0xc1)]('\x0a'+a32_0x37e46d[_0xb4a282(0x9d)](_0xb4a282(0xce))+'\x20'+_0x1d7d1b),console[_0xb4a282(0xc1)]('─'[_0xb4a282(0x9e)](0x3c)),console[_0xb4a282(0xc1)](_0x3f21cd['diff']),console[_0xb4a282(0xc1)]('─'[_0xb4a282(0x9e)](0x3c));}if(_0x4f5a6d[_0xb4a282(0x88)]>0x0)for(const _0x5034e3 of _0x4f5a6d){const _0x91b709=_0x5034e3['folderPath']?_0x5034e3[_0xb4a282(0xf4)]+'/'+_0x5034e3[_0xb4a282(0xbf)][_0xb4a282(0x93)]:_0x5034e3[_0xb4a282(0xbf)][_0xb4a282(0x93)];console[_0xb4a282(0xc1)]('\x0a'+a32_0x37e46d[_0xb4a282(0xd6)](_0xb4a282(0xbc))+'\x20'+_0x91b709),console[_0xb4a282(0xc1)]('─'['repeat'](0x3c)),_0x5034e3[_0xb4a282(0x7d)]&&console[_0xb4a282(0xc1)](_0x5034e3[_0xb4a282(0x7d)]),console[_0xb4a282(0xc1)]('─'['repeat'](0x3c));}const _0x4e2f72=_0x296a33[_0xb4a282(0x8d)](_0xcd1593=>!_0xcd1593[_0xb4a282(0xdc)]&&_0xcd1593[_0xb4a282(0x7d)]);if(_0x4e2f72[_0xb4a282(0x88)]>0x0)for(const _0x45bf9a of _0x4e2f72){const _0x8ed83f=_0x45bf9a[_0xb4a282(0xf4)]?_0x45bf9a[_0xb4a282(0xf4)]+'/'+_0x45bf9a[_0xb4a282(0xbf)][_0xb4a282(0x93)]:_0x45bf9a['yamlConfig'][_0xb4a282(0x93)];console['error']('\x0a'+a32_0x37e46d['yellow']('Changes\x20to\x20journey:')+'\x20'+_0x8ed83f),console[_0xb4a282(0xc1)]('─'['repeat'](0x3c)),console[_0xb4a282(0xc1)](_0x45bf9a[_0xb4a282(0x7d)]),console[_0xb4a282(0xc1)]('─'[_0xb4a282(0x9e)](0x3c));}if(_0x4d9177['length']>0x0)for(const _0x211619 of _0x4d9177){const _0x27873b=_0x211619[_0xb4a282(0x92)]?_0x324742[_0xb4a282(0xae)](_0x211619[_0xb4a282(0x92)])||'':'',_0xabc92e=_0x27873b?_0x27873b+'/'+_0x211619['journeyBundleName']:_0x211619[_0xb4a282(0xc6)];console[_0xb4a282(0xc1)]('\x0a'+a32_0x37e46d[_0xb4a282(0xbe)](_0xb4a282(0xd5))+'\x20'+_0xabc92e),console[_0xb4a282(0xc1)]('─'[_0xb4a282(0x9e)](0x3c)),console[_0xb4a282(0xc1)](a32_0x37e46d['red'](_0xb4a282(0xd9))),console[_0xb4a282(0xc1)]('─'[_0xb4a282(0x9e)](0x3c));}if(_0x3bd338[_0xb4a282(0xfe)])return console[_0xb4a282(0xc1)](a32_0x37e46d[_0xb4a282(0x9d)](_0xb4a282(0xa8))),0x0;const _0x55e9ae=_0x3bd338['journeysOnly']?![]:_0x38740d[_0xb4a282(0x88)]>0x0||_0x501f50[_0xb4a282(0x88)]>0x0||_0x3b47d6[_0xb4a282(0x88)]>0x0,_0x199973=_0x4f5a6d[_0xb4a282(0x88)]>0x0||_0x280235[_0xb4a282(0x88)]>0x0||_0x4d9177[_0xb4a282(0x88)]>0x0,_0x8e7f32=_0x3bd338[_0xb4a282(0xc9)]?![]:_0x7ad65d[_0xb4a282(0x88)]>0x0,_0x9d2d79=_0x1d4f98[_0xb4a282(0x88)]>0x0;if(!_0x55e9ae&&!_0x199973&&!_0x8e7f32&&!_0x9d2d79){const _0x6b874c=_0x3bd338[_0xb4a282(0xc9)]?'✔\x20All\x20journeys\x20are\x20up\x20to\x20date':_0xb4a282(0xa0);console[_0xb4a282(0xc1)](a32_0x37e46d[_0xb4a282(0xd6)](_0x6b874c));if(_0x122cb0&&_0x5ae4a5[_0xb4a282(0x88)]===0x1){const _0x4ea04d=_0x5ae4a5[0x0];if(_0x4ea04d[_0xb4a282(0x102)]?.['id']){const _0x3d68c9=getConsoleNextUrl(_0x3bd338[_0xb4a282(0xda)],_0xb4a282(0xa9)+_0x42bbf2+_0xb4a282(0x70)+_0x4ea04d[_0xb4a282(0x102)]['id']+'/j/da/je');console[_0xb4a282(0xc1)]('\x20\x20'+a32_0x37e46d['cyan'](_0x3d68c9));}}return 0x0;}const _0x14d187=_0x3bd338['journeysOnly']?_0x4f5a6d[_0xb4a282(0x88)]+_0x280235[_0xb4a282(0x88)]+_0x4d9177['length']+_0x1d4f98[_0xb4a282(0x88)]:_0x38740d[_0xb4a282(0x88)]+_0x501f50[_0xb4a282(0x88)]+_0x3b47d6['length']+_0x4f5a6d[_0xb4a282(0x88)]+_0x280235['length']+_0x4d9177[_0xb4a282(0x88)]+_0x1d4f98[_0xb4a282(0x88)]+_0x7ad65d[_0xb4a282(0x88)];if(!_0x3bd338[_0xb4a282(0xf7)]&&_0x14d187>0x0){if(!isInteractive())return console['error'](a32_0x37e46d[_0xb4a282(0xbe)](_0xb4a282(0x6b)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0xb4a282(0xc1)](a32_0x37e46d[_0xb4a282(0xdd)](_0xb4a282(0xcd))),0x1;const _0x4fc1df=await confirmKey('Push\x20'+_0x14d187+'\x20changes?');if(!_0x4fc1df)return console[_0xb4a282(0xc1)](a32_0x37e46d[_0xb4a282(0x9d)](_0xb4a282(0xd7))),0x1;}const _0x4c1a3d={'withProgress':async(_0x47bb61,_0x2aa6ad)=>{const _0xad5ec5=_0xb4a282,_0x199088=await withSpinner(_0x47bb61,_0x2aa6ad,{'verbose':_0x3bd338[_0xad5ec5(0x8c)]});return{'data':_0x199088[_0xad5ec5(0x9f)]};},'logInfo':_0x16b692=>console[_0xb4a282(0xc1)](a32_0x37e46d[_0xb4a282(0x7b)]('✔\x20'+_0x16b692)),'logSuccess':_0x589817=>console['error'](a32_0x37e46d['green']('✔\x20'+_0x589817)),'logWarning':_0x26e9da=>console[_0xb4a282(0xc1)](a32_0x37e46d[_0xb4a282(0x9d)]('⚠\x20'+_0x26e9da)),'logDeleted':_0x12a13a=>console['error'](a32_0x37e46d[_0xb4a282(0xbe)]('✔\x20'+_0x12a13a))},_0x1caa58={'segment':_0x57a515['segment'],'journey':_0x57a515['journey'],'user':_0x57a515[_0xb4a282(0xa1)],'connection':_0x57a515[_0xb4a282(0xd2)]};_0x1d4f98[_0xb4a282(0x88)]>0x0&&(_0x2a317f=await executePushFolders(_0x1caa58,_0x1d4f98,_0x2a317f,{'parentId':_0x42bbf2},_0x4c1a3d));const _0x2e3a42={'rootFolderId':_0xa7f1dd,'folderPathToId':_0x2a317f,'folderIdToPath':_0x324742,'segmentNameToId':_0x5a1b11,'activationsBySegmentId':_0x13172a,'emailToIdMap':_0xda4a63,'idToEmailMap':_0x24dd65,'connectionNameToIdMap':_0x2e2959[_0xb4a282(0xcb)],'connectionIdToNameMap':_0x2e2959['idToName'],'connectionNameToTypeMap':_0x566346},_0x546f01=await executePushSegments(_0x1caa58,_0x3bd338[_0xb4a282(0xc9)]?[]:_0x305612,_0x2e3a42,{'parentId':_0x42bbf2},_0x4c1a3d),_0x3e2e6c=_0x546f01['created'],_0x11fb81=_0x546f01['updated'],_0x35cceb=_0x546f01[_0xb4a282(0x84)]['created'],_0x510bc9=_0x546f01['activations'][_0xb4a282(0xcf)],_0x5495e4=_0x546f01[_0xb4a282(0x84)]['deleted'],_0x4d6187=await executePushSegmentDeletions(_0x1caa58,_0x3bd338['journeysOnly']?[]:_0x3b47d6,_0x4c1a3d);let _0x4d9513=0x0,_0x59e01b=0x0,_0x4f21e3=0x0;const _0x50eb9d=new Map(_0x5a1b11);for(const [_0x56e9e6,_0x10aa27]of _0x546f01[_0xb4a282(0xe1)]){_0x50eb9d['set'](_0x56e9e6,_0x10aa27);}if(_0x296a33[_0xb4a282(0x88)]>0x0){const _0x39ce12={..._0x2e3a42,'segmentNameToId':_0x50eb9d,'existingSegments':_0xc74883,'activationContext':_0x52a89c},_0x316120=await executePushJourneys(_0x1caa58,_0x296a33,_0x39ce12,{'parentId':_0x42bbf2,'rootFolderId':_0xa7f1dd,'verbose':_0x3bd338[_0xb4a282(0x8c)]},_0x4c1a3d);_0x4d9513=_0x316120[_0xb4a282(0x97)],_0x59e01b=_0x316120[_0xb4a282(0xcf)];if(_0x122cb0&&_0x316120[_0xb4a282(0x91)]['length']===0x1){const _0x20324f=_0x316120['results'][0x0];if(_0x20324f[_0xb4a282(0xe8)]){const _0x37c6bc=getConsoleNextUrl(_0x3bd338['site'],_0xb4a282(0xa9)+_0x42bbf2+_0xb4a282(0x70)+_0x20324f[_0xb4a282(0xe8)]+_0xb4a282(0xd0));console[_0xb4a282(0xc1)]('\x20\x20'+a32_0x37e46d[_0xb4a282(0xf3)](_0x37c6bc));}}}for(const _0x57cd33 of _0x4d9177){console['error'](a32_0x37e46d[_0xb4a282(0x9d)](_0xb4a282(0x6f)+_0x57cd33[_0xb4a282(0xc6)])),_0x4f21e3++;}const _0x418913=[];if(_0x3e2e6c>0x0)_0x418913['push'](_0x3e2e6c+'\x20created');if(_0x11fb81>0x0)_0x418913['push'](_0x11fb81+_0xb4a282(0x78));if(_0x4d6187>0x0)_0x418913['push'](_0x4d6187+'\x20deleted');const _0xacffd5=[];if(_0x4d9513>0x0)_0xacffd5[_0xb4a282(0x71)](_0x4d9513+_0xb4a282(0x6e));if(_0x59e01b>0x0)_0xacffd5[_0xb4a282(0x71)](_0x59e01b+_0xb4a282(0x78));if(_0x4f21e3>0x0)_0xacffd5[_0xb4a282(0x71)](_0x4f21e3+_0xb4a282(0xac));const _0x539b6d=[];if(_0x35cceb>0x0)_0x539b6d[_0xb4a282(0x71)](_0x35cceb+_0xb4a282(0x6e));if(_0x510bc9>0x0)_0x539b6d[_0xb4a282(0x71)](_0x510bc9+_0xb4a282(0x78));if(_0x5495e4>0x0)_0x539b6d[_0xb4a282(0x71)](_0x5495e4+'\x20deleted');return console['error'](a32_0x37e46d[_0xb4a282(0xd6)](_0xb4a282(0xf2))),_0x418913[_0xb4a282(0x88)]>0x0&&!_0x3bd338[_0xb4a282(0xc9)]&&console[_0xb4a282(0xc1)](_0xb4a282(0xca)+_0x418913[_0xb4a282(0xa2)](',\x20')),_0xacffd5['length']>0x0&&console[_0xb4a282(0xc1)](_0xb4a282(0xbb)+_0xacffd5[_0xb4a282(0xa2)](',\x20')),_0x539b6d[_0xb4a282(0x88)]>0x0&&!_0x3bd338[_0xb4a282(0xc9)]&&console['error'](_0xb4a282(0xf8)+_0x539b6d[_0xb4a282(0xa2)](',\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_0x46ca41=a33_0x36e3;(function(_0x502b4b,_0x42f947){const _0x1300ff=a33_0x36e3,_0x56c4f9=_0x502b4b();while(!![]){try{const _0x431bfa=parseInt(_0x1300ff(0x106))/0x1*(parseInt(_0x1300ff(0x103))/0x2)+parseInt(_0x1300ff(0x102))/0x3+-parseInt(_0x1300ff(0xf9))/0x4+parseInt(_0x1300ff(0xe7))/0x5+-parseInt(_0x1300ff(0xec))/0x6*(-parseInt(_0x1300ff(0xed))/0x7)+parseInt(_0x1300ff(0xe3))/0x8+-parseInt(_0x1300ff(0xdd))/0x9;if(_0x431bfa===_0x42f947)break;else _0x56c4f9['push'](_0x56c4f9['shift']());}catch(_0x211f63){_0x56c4f9['push'](_0x56c4f9['shift']());}}}(a33_0x51c0,0xc7ad3));import{BaseCommand}from'./command.js';function a33_0x51c0(){const _0x53d372=['includes','Parent\x20ID:\x20','5294452jEioPR','segmentName','.\x20Only\x20child\x20segments\x20can\x20be\x20updated.','\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','verbose','Examples:','execute','yellow','data','4661904fVTsAR','4rLIROV','Update\x20existing\x20child\x20segment','name','96253XxAseu','Segment\x20ID\x20missing\x20from\x20resolved\x20path','Resolving\x20path\x20\x27','error','\x20\x20\x20Path:\x20','30678849fExFAr','length','Error:\x20Cannot\x20update\x20','segment','Resolved\x20type:\x20','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','7558552QUZQFj','Resolved\x20relative\x20path\x20to:\x20','segmentId','description','7529915qxjdyw','\x27...','✔\x20Updated\x20segment\x20\x27','parentId','segment:update','6Grkjqz','9470811CeoNwD','kind','type','\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22','Resolving\x20folder\x20\x27','Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]','⚠\x20Deprecation\x20warning:\x20`segment\x20update`\x20is\x20deprecated.','Resolved\x20folder\x20ID:\x20','resolvePathToResource','Updating\x20segment\x20\x27'];a33_0x51c0=function(){return _0x53d372;};return a33_0x51c0();}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_0x36e3(_0x1c5a00,_0x42687b){_0x1c5a00=_0x1c5a00-0xdb;const _0x51c061=a33_0x51c0();let _0x36e357=_0x51c061[_0x1c5a00];return _0x36e357;}import a33_0x3cfe13 from'chalk';export class SegmentUpdateCommand extends BaseCommand{[a33_0x46ca41(0x105)]=a33_0x46ca41(0xeb);[a33_0x46ca41(0xe6)]=a33_0x46ca41(0x104);async[a33_0x46ca41(0xff)](_0x4955d4){const _0x3310d0=a33_0x46ca41;console['error'](a33_0x3cfe13[_0x3310d0(0x100)](_0x3310d0(0xf3))),console[_0x3310d0(0xdb)](a33_0x3cfe13[_0x3310d0(0x100)]('\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a'));const {options:_0x152141,args:_0x3f4b7a,tdx:_0xe3be6f}=_0x4955d4,_0x3bcf69=_0x152141;if(_0x3f4b7a[_0x3310d0(0xde)]===0x0)return console[_0x3310d0(0xdb)](_0x3310d0(0xe2)),console[_0x3310d0(0xdb)](_0x3310d0(0xf2)),console[_0x3310d0(0xdb)](_0x3310d0(0xfe)),console[_0x3310d0(0xdb)](_0x3310d0(0xf0)),console[_0x3310d0(0xdb)](_0x3310d0(0xfc)),0x1;const _0x136390=_0x3f4b7a[0x0],_0x5e392d=_0x152141['segmentPath'];let _0xa9568f=_0x136390;_0x5e392d&&!_0x136390[_0x3310d0(0xf7)]('/')&&(_0xa9568f=_0x5e392d+'/'+_0x136390,_0x3bcf69[_0x3310d0(0xfd)]&&console[_0x3310d0(0xdb)](_0x3310d0(0xe4)+_0xa9568f));const _0x288a34=await withSpinner(_0x3310d0(0x108)+_0xa9568f+'\x27...',()=>_0xe3be6f['segment'][_0x3310d0(0xf5)](_0xa9568f),{'verbose':_0x3bcf69[_0x3310d0(0xfd)]}),_0x46025a=_0x288a34[_0x3310d0(0x101)];_0x3bcf69['verbose']&&console[_0x3310d0(0xdb)](_0x3310d0(0xe1)+_0x46025a[_0x3310d0(0xef)]);if(_0x46025a[_0x3310d0(0xef)]!==_0x3310d0(0xe0))return console[_0x3310d0(0xdb)](_0x3310d0(0xdf)+_0x46025a['type']+_0x3310d0(0xfb)),console[_0x3310d0(0xdb)]('Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]'),0x1;if(!_0x46025a['segmentId'])throw new SDKError(ErrorCode['INTERNAL'],_0x3310d0(0x107));const _0x4ebc29=_0x46025a[_0x3310d0(0xea)],_0x407857=_0x46025a[_0x3310d0(0xe5)];_0x3bcf69['verbose']&&(console[_0x3310d0(0xdb)](_0x3310d0(0xf8)+_0x4ebc29),console[_0x3310d0(0xdb)]('Segment\x20ID:\x20'+_0x407857));let _0x1e9348;if(_0x3bcf69['folder']){const _0x41efab=_0x3bcf69['folder'],_0x1ed412=await withSpinner(_0x3310d0(0xf1)+_0x41efab+'\x27...',()=>_0xe3be6f[_0x3310d0(0xe0)]['resolveFolderId'](_0x4ebc29,_0x41efab),{'verbose':_0x3bcf69[_0x3310d0(0xfd)]});_0x1e9348=parseInt(_0x1ed412['data'],0xa),_0x3bcf69[_0x3310d0(0xfd)]&&console[_0x3310d0(0xdb)](_0x3310d0(0xf4)+_0x1e9348);}const _0xe1dafb=await loadJSONFromOptions(_0x3bcf69['rule'],_0x3bcf69['ruleFile']),_0x37fd4b={'name':_0x3bcf69[_0x3310d0(0x105)],'description':_0x3bcf69['description'],'rule':_0xe1dafb,'kind':_0x3bcf69[_0x3310d0(0xee)]!==undefined?parseInt(_0x3bcf69[_0x3310d0(0xee)],0xa):undefined,'segmentFolderId':_0x1e9348},_0x46f413=await withSpinner(_0x3310d0(0xf6)+_0x46025a[_0x3310d0(0xfa)]+_0x3310d0(0xe8),()=>_0xe3be6f[_0x3310d0(0xe0)]['updateSegmentById'](_0x4ebc29,_0x407857,_0x37fd4b),{'verbose':_0x3bcf69['verbose']}),_0x34c69c=_0x46f413[_0x3310d0(0x101)];return console[_0x3310d0(0xdb)](_0x3310d0(0xe9)+_0x34c69c['name']+'\x27'),_0xa9568f!==_0x136390&&console[_0x3310d0(0xdb)](_0x3310d0(0xdc)+_0xa9568f),await handleSDKOutput([_0x34c69c],_0x3bcf69),0x0;}}
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
- function a34_0x1a59(_0x549b83,_0x4b1e92){_0x549b83=_0x549b83-0xf6;const _0x5fc276=a34_0x5fc2();let _0x1a597e=_0x5fc276[_0x549b83];return _0x1a597e;}const a34_0x52f42f=a34_0x1a59;(function(_0x4db574,_0x513dcd){const _0x2e3043=a34_0x1a59,_0x29094a=_0x4db574();while(!![]){try{const _0x1268ae=-parseInt(_0x2e3043(0x124))/0x1*(parseInt(_0x2e3043(0xfd))/0x2)+-parseInt(_0x2e3043(0xf7))/0x3*(parseInt(_0x2e3043(0x127))/0x4)+parseInt(_0x2e3043(0x120))/0x5*(parseInt(_0x2e3043(0x12d))/0x6)+parseInt(_0x2e3043(0x114))/0x7+parseInt(_0x2e3043(0x108))/0x8+parseInt(_0x2e3043(0x116))/0x9+-parseInt(_0x2e3043(0x115))/0xa*(parseInt(_0x2e3043(0x10f))/0xb);if(_0x1268ae===_0x513dcd)break;else _0x29094a['push'](_0x29094a['shift']());}catch(_0x4b45ca){_0x29094a['push'](_0x29094a['shift']());}}}(a34_0x5fc2,0x39c99));import{existsSync,statSync}from'fs';import a34_0x23ee4a from'chalk';function a34_0x5fc2(){const _0x1f1fad=['parentName','log','data','2VtQZAa','isAbsolute','config','628bDCLfH','site','segmentPath','Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>','Set\x20current\x20segment/folder\x20context\x20for\x20navigation','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22','6FFeeQm','folderPath','1266mIYnQn','join','\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent','fullPath','Use:\x20tdx\x20segment\x20use\x20','length','97774ionmRZ','Resolving\x20path\x20\x27','folderId','Parent\x20ID:\x20','red','type','execute','green','segment','error','Folder\x20ID:\x20','1707632VkHtcY','Resolved\x20path\x20type:\x20','parent_segment','Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','verbose','\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context','4972451vGjJyL','Use\x20\x22tdx\x20use\x22\x20to\x20see\x20all\x20context\x20parameters','description','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22','✔\x20Context\x20cleared.\x20Back\x20to\x20root.','2370186jMnLwE','20waSobz','3366576RKNozI','dim','Error:\x20Path\x20is\x20required\x0a','Usage:\x20tdx\x20segment\x20use\x20<path>','✔\x20Context\x20set\x20to:\x20','cyan','name','Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.','segment:use','Examples:','1893455bDgNYo'];a34_0x5fc2=function(){return _0x1f1fad;};return a34_0x5fc2();}import{BaseCommand}from'./command.js';import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';import{parsePath,normalizePath}from'../sdk/segment/segment-path-parser.js';import{findTdxConfig}from'../sdk/segment/tdx-config.js';export class SegmentUseCommand extends BaseCommand{[a34_0x52f42f(0x11c)]=a34_0x52f42f(0x11e);[a34_0x52f42f(0x111)]=a34_0x52f42f(0x12b);async[a34_0x52f42f(0x103)](_0x4f0d62){const _0x50c6c3=a34_0x52f42f,{options:_0x442d9f,args:_0x3bf276,tdx:_0x2694e7}=_0x4f0d62;if(_0x3bf276[_0x50c6c3(0xfc)]===0x0)return console[_0x50c6c3(0x106)](a34_0x23ee4a[_0x50c6c3(0x101)](_0x50c6c3(0x118))),console[_0x50c6c3(0x106)](_0x50c6c3(0x119)),console[_0x50c6c3(0x106)](_0x50c6c3(0x11f)),console['error'](_0x50c6c3(0x112)),console['error'](_0x50c6c3(0x12c)),console[_0x50c6c3(0x106)](_0x50c6c3(0x10e)),console['error'](_0x50c6c3(0xf9)),0x1;const _0x58ed57=_0x3bf276[0x0],_0x1d355b=_0x442d9f['session'];try{if(_0x58ed57==='/')return saveSessionContext({'segment_path':undefined},_0x1d355b),console[_0x50c6c3(0x122)](a34_0x23ee4a['green'](_0x50c6c3(0x113))),0x0;if(existsSync(_0x58ed57)&&statSync(_0x58ed57)['isDirectory']()){let _0x2ca323;try{_0x2ca323=findTdxConfig(_0x58ed57);}catch{return console[_0x50c6c3(0x106)](a34_0x23ee4a['red'](_0x50c6c3(0x10b)+_0x58ed57)),console[_0x50c6c3(0x106)](a34_0x23ee4a[_0x50c6c3(0x11b)](_0x50c6c3(0x10c))),0x1;}const _0x10f8b5=_0x2ca323[_0x50c6c3(0x126)][_0x50c6c3(0x10a)];return saveSessionContext({'segment_path':_0x10f8b5,'parent_segment':_0x10f8b5},_0x1d355b),console[_0x50c6c3(0x122)](a34_0x23ee4a[_0x50c6c3(0x104)](_0x50c6c3(0x11a)+a34_0x23ee4a[_0x50c6c3(0x11b)](_0x10f8b5))),0x0;}const _0xdd2b31=_0x442d9f[_0x50c6c3(0x129)];let _0x1ae556=_0x58ed57;const _0x594cbb=parsePath(_0x58ed57);if(!_0x594cbb[_0x50c6c3(0x125)]){if(!_0xdd2b31)return console[_0x50c6c3(0x106)](a34_0x23ee4a[_0x50c6c3(0x101)](_0x50c6c3(0x11d))),console[_0x50c6c3(0x106)](a34_0x23ee4a[_0x50c6c3(0x11b)](_0x50c6c3(0x12a))),0x1;if(_0x58ed57==='..'){const _0x34f6b9=_0xdd2b31['split']('/')['slice'](0x0,-0x1)[_0x50c6c3(0xf8)]('/');_0x1ae556=_0x34f6b9||'/';}else _0x58ed57==='.'?_0x1ae556=_0xdd2b31:_0x1ae556=_0xdd2b31+'/'+_0x58ed57;_0x442d9f[_0x50c6c3(0x10d)]&&console[_0x50c6c3(0x106)]('Resolved\x20relative\x20path\x20to:\x20'+_0x1ae556);}if(_0x1ae556==='/'||_0x1ae556==='')return saveSessionContext({'segment_path':undefined},_0x1d355b),console['log'](a34_0x23ee4a[_0x50c6c3(0x104)](_0x50c6c3(0x113))),0x0;_0x1ae556=normalizePath(_0x1ae556);const _0x191b75=parsePath(_0x1ae556)['segments'];if(_0x191b75[_0x50c6c3(0xfc)]===0x0)return saveSessionContext({'segment_path':undefined},_0x1d355b),console['log'](a34_0x23ee4a[_0x50c6c3(0x104)](_0x50c6c3(0x113))),0x0;_0x442d9f[_0x50c6c3(0x10d)]&&(console[_0x50c6c3(0x106)]('Site:\x20'+_0x442d9f[_0x50c6c3(0x128)]),console[_0x50c6c3(0x106)]('Target\x20path:\x20'+_0x1ae556));const _0x3d936c=await withSpinner(_0x50c6c3(0xfe)+_0x1ae556+'\x27...',()=>_0x2694e7['segment']['resolvePathToResource'](_0x1ae556),{'verbose':_0x442d9f['verbose']}),_0x2cd346=_0x3d936c[_0x50c6c3(0x123)];_0x442d9f[_0x50c6c3(0x10d)]&&(console[_0x50c6c3(0x106)](_0x50c6c3(0x109)+_0x2cd346[_0x50c6c3(0x102)]),console[_0x50c6c3(0x106)](_0x50c6c3(0x100)+_0x2cd346['parentId']),_0x2cd346[_0x50c6c3(0xff)]&&console[_0x50c6c3(0x106)](_0x50c6c3(0x107)+_0x2cd346[_0x50c6c3(0xff)]));if(_0x2cd346[_0x50c6c3(0x102)]===_0x50c6c3(0x105))return console[_0x50c6c3(0x106)](a34_0x23ee4a[_0x50c6c3(0x101)]('Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.')),console['error']('Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.'),console['error'](a34_0x23ee4a['cyan'](_0x50c6c3(0xfb)+_0x2cd346[_0x50c6c3(0x121)]+(_0x2cd346['folderPath']?'/'+_0x2cd346[_0x50c6c3(0xf6)][_0x50c6c3(0xf8)]('/'):''))),0x1;return saveSessionContext({'segment_path':_0x2cd346[_0x50c6c3(0xfa)],'parent_segment':_0x2cd346[_0x50c6c3(0x121)]},_0x1d355b),console[_0x50c6c3(0x122)](a34_0x23ee4a[_0x50c6c3(0x104)]('✔\x20Context\x20set\x20to:\x20'+a34_0x23ee4a[_0x50c6c3(0x11b)](_0x2cd346[_0x50c6c3(0xfa)]))),_0x442d9f[_0x50c6c3(0x10d)]&&(console[_0x50c6c3(0x106)](a34_0x23ee4a['dim']('Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context')),console[_0x50c6c3(0x106)](a34_0x23ee4a[_0x50c6c3(0x117)](_0x50c6c3(0x110)))),0x0;}catch(_0x57fff2){throw _0x57fff2;}}}
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;}}}