@treasuredata/tdx 0.28.1 β†’ 0.28.2

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 (181) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.js +1 -1
  5. package/dist/commands/activations.js +1 -1
  6. package/dist/commands/agent-command.js +1 -1
  7. package/dist/commands/agent-test-command.js +1 -1
  8. package/dist/commands/api-command.js +1 -1
  9. package/dist/commands/auth-command.js +1 -1
  10. package/dist/commands/chat-command.js +1 -1
  11. package/dist/commands/claude-command.js +1 -1
  12. package/dist/commands/claude-statusline-command.js +1 -1
  13. package/dist/commands/claude-usage-command.js +1 -1
  14. package/dist/commands/command.js +1 -1
  15. package/dist/commands/connection-command.js +1 -1
  16. package/dist/commands/databases.js +1 -1
  17. package/dist/commands/delivery-command.js +1 -1
  18. package/dist/commands/describe.js +1 -1
  19. package/dist/commands/engage-campaign-pull-command.js +1 -1
  20. package/dist/commands/engage-campaign-push-command.js +1 -1
  21. package/dist/commands/engage-campaign-validate-command.js +1 -1
  22. package/dist/commands/engage-command.js +1 -1
  23. package/dist/commands/job-command.js +1 -1
  24. package/dist/commands/journey-command.js +1 -1
  25. package/dist/commands/journey-validate-command.js +1 -1
  26. package/dist/commands/llm-command.js +1 -1
  27. package/dist/commands/mcp-command.js +1 -1
  28. package/dist/commands/parent-segment-command.js +1 -1
  29. package/dist/commands/profile-command.js +1 -1
  30. package/dist/commands/profiles-command.js +1 -1
  31. package/dist/commands/query-command.js +1 -1
  32. package/dist/commands/schedule-command.js +1 -1
  33. package/dist/commands/segment-command.js +1 -1
  34. package/dist/commands/segment-create-command.js +1 -1
  35. package/dist/commands/segment-fields-command.js +1 -1
  36. package/dist/commands/segment-pull-command.js +1 -1
  37. package/dist/commands/segment-push-command.js +1 -1
  38. package/dist/commands/segment-update-command.js +1 -1
  39. package/dist/commands/segment-use-command.js +1 -1
  40. package/dist/commands/segment-validate-command.js +1 -1
  41. package/dist/commands/segments.js +1 -1
  42. package/dist/commands/show.js +1 -1
  43. package/dist/commands/status-command.js +1 -1
  44. package/dist/commands/tables.js +1 -1
  45. package/dist/commands/unset-command.js +1 -1
  46. package/dist/commands/use-command.js +1 -1
  47. package/dist/commands/user-command.js +1 -1
  48. package/dist/commands/workflow-command.js +1 -1
  49. package/dist/core/auth.js +1 -1
  50. package/dist/core/command-output.js +1 -1
  51. package/dist/core/config.js +1 -1
  52. package/dist/core/connection-cache.js +1 -1
  53. package/dist/core/constants.js +1 -1
  54. package/dist/core/credential-cache.js +1 -1
  55. package/dist/core/global-context.js +1 -1
  56. package/dist/core/keychain.js +1 -1
  57. package/dist/core/profile.js +1 -1
  58. package/dist/core/project-config.js +1 -1
  59. package/dist/core/session.js +1 -1
  60. package/dist/core/user-cache.js +1 -1
  61. package/dist/core/version.js +1 -1
  62. package/dist/index.js +1 -1
  63. package/dist/mcp/server.js +1 -1
  64. package/dist/mcp/tools/index.js +1 -1
  65. package/dist/mcp/tools/tdx-run.js +1 -1
  66. package/dist/mcp/tools/tdx-search.js +1 -1
  67. package/dist/mcp/utils.js +1 -1
  68. package/dist/proxy/claude-usage-tracker.js +1 -1
  69. package/dist/proxy/passthrough-server.js +1 -1
  70. package/dist/proxy/sse-usage-parser.js +1 -1
  71. package/dist/sdk/agent/agent-config.js +1 -1
  72. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  73. package/dist/sdk/agent/agent-yaml.js +1 -1
  74. package/dist/sdk/agent/test/evaluator.js +1 -1
  75. package/dist/sdk/agent/test/executor.js +1 -1
  76. package/dist/sdk/agent/test/index.js +1 -1
  77. package/dist/sdk/agent/test/output.js +1 -1
  78. package/dist/sdk/agent/test/parser.js +1 -1
  79. package/dist/sdk/agent/tool-target-registry.js +1 -1
  80. package/dist/sdk/api.js +1 -1
  81. package/dist/sdk/client/cdp-api-client.js +1 -1
  82. package/dist/sdk/client/delivery-api-client.js +1 -1
  83. package/dist/sdk/client/endpoints.js +1 -1
  84. package/dist/sdk/client/engage-api-client.js +1 -1
  85. package/dist/sdk/client/http-client.js +1 -1
  86. package/dist/sdk/client/llm-api-client.js +1 -1
  87. package/dist/sdk/client/rate-limiter.js +1 -1
  88. package/dist/sdk/client/td-api-client.js +1 -1
  89. package/dist/sdk/client/trino-api-client.js +1 -1
  90. package/dist/sdk/client/workflow-client.js +1 -1
  91. package/dist/sdk/connection-validator.js +1 -1
  92. package/dist/sdk/connection.js +1 -1
  93. package/dist/sdk/delivery.js +1 -1
  94. package/dist/sdk/engage/campaign-pull.js +1 -1
  95. package/dist/sdk/engage/campaign-push.js +1 -1
  96. package/dist/sdk/engage/campaign-validator.js +1 -1
  97. package/dist/sdk/engage/campaign-yaml.js +1 -1
  98. package/dist/sdk/engage/types/campaign-def.js +1 -1
  99. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  100. package/dist/sdk/engage.js +1 -1
  101. package/dist/sdk/errors.js +1 -1
  102. package/dist/sdk/index.js +1 -1
  103. package/dist/sdk/io/index.js +1 -1
  104. package/dist/sdk/io/node-filesystem.js +1 -1
  105. package/dist/sdk/job.js +1 -1
  106. package/dist/sdk/journey.js +1 -1
  107. package/dist/sdk/llm/chat-cache.js +1 -1
  108. package/dist/sdk/llm/index.js +1 -1
  109. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  110. package/dist/sdk/llm/model-factors.js +1 -1
  111. package/dist/sdk/personalization.js +1 -1
  112. package/dist/sdk/query/index.js +1 -1
  113. package/dist/sdk/query/sql-parser.js +1 -1
  114. package/dist/sdk/realtime.js +1 -1
  115. package/dist/sdk/schedule.js +1 -1
  116. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  117. package/dist/sdk/segment/fields-display.js +1 -1
  118. package/dist/sdk/segment/file-discovery.js +1 -1
  119. package/dist/sdk/segment/journey-utils.js +1 -1
  120. package/dist/sdk/segment/journey-validator.d.ts.map +1 -1
  121. package/dist/sdk/segment/journey-validator.js +1 -1
  122. package/dist/sdk/segment/journey-validator.js.map +1 -1
  123. package/dist/sdk/segment/journey-yaml.js +1 -1
  124. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  125. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  126. package/dist/sdk/segment/pull-workflow.js +1 -1
  127. package/dist/sdk/segment/push-recovery.js +1 -1
  128. package/dist/sdk/segment/push-workflow.js +1 -1
  129. package/dist/sdk/segment/resolution-context.js +1 -1
  130. package/dist/sdk/segment/segment-path-parser.js +1 -1
  131. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  132. package/dist/sdk/segment/target-resolution.js +1 -1
  133. package/dist/sdk/segment/tdx-config.js +1 -1
  134. package/dist/sdk/segment/validate-files.js +1 -1
  135. package/dist/sdk/segment/yaml-validator.js +1 -1
  136. package/dist/sdk/segment.js +1 -1
  137. package/dist/sdk/types/index.js +1 -1
  138. package/dist/sdk/types/progress.js +1 -1
  139. package/dist/sdk/user.js +1 -1
  140. package/dist/sdk/util/format-detector.js +1 -1
  141. package/dist/sdk/util/formatters.js +1 -1
  142. package/dist/sdk/util/index.js +1 -1
  143. package/dist/sdk/util/tree-formatter.js +1 -1
  144. package/dist/sdk/workflow/archive-validation.js +1 -1
  145. package/dist/sdk/workflow/clone-workflow.js +1 -1
  146. package/dist/sdk/workflow/index.js +1 -1
  147. package/dist/sdk/workflow/pull-workflow.js +1 -1
  148. package/dist/sdk/workflow/push-workflow.js +1 -1
  149. package/dist/sdk/workflow/tdx-config.js +1 -1
  150. package/dist/sdk/workflow/workflow-utils.js +1 -1
  151. package/dist/test-utils/command-runner.js +1 -1
  152. package/dist/test-utils/factories.js +1 -1
  153. package/dist/test-utils/fixtures.js +1 -1
  154. package/dist/test-utils/http-mock.js +1 -1
  155. package/dist/test-utils/index.js +1 -1
  156. package/dist/utils/async.js +1 -1
  157. package/dist/utils/colors.js +1 -1
  158. package/dist/utils/diff.js +1 -1
  159. package/dist/utils/file-permissions.js +1 -1
  160. package/dist/utils/global-cache.js +1 -1
  161. package/dist/utils/json-loader.js +1 -1
  162. package/dist/utils/local-cache.js +1 -1
  163. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  164. package/dist/utils/logger/formatters/index.js +1 -1
  165. package/dist/utils/logger/handlers/console-handler.js +1 -1
  166. package/dist/utils/logger/handlers/file-handler.js +1 -1
  167. package/dist/utils/logger/handlers/index.js +1 -1
  168. package/dist/utils/logger/handlers/null-handler.js +1 -1
  169. package/dist/utils/logger/index.js +1 -1
  170. package/dist/utils/logger/logger.js +1 -1
  171. package/dist/utils/logger/types.js +1 -1
  172. package/dist/utils/option-validation.js +1 -1
  173. package/dist/utils/process.js +1 -1
  174. package/dist/utils/prompt.js +1 -1
  175. package/dist/utils/spinner.js +1 -1
  176. package/dist/utils/sse-parser.js +1 -1
  177. package/dist/utils/string-utils.js +1 -1
  178. package/dist/utils/table-ref-parser.js +1 -1
  179. package/dist/utils/tdx-logger.js +1 -1
  180. package/dist/utils/version-check.js +1 -1
  181. package/package.json +1 -1
@@ -1 +1 @@
1
- const a30_0x139cba=a30_0x5266;(function(_0x1e97a7,_0xdc38eb){const _0x16c851=a30_0x5266,_0x40944d=_0x1e97a7();while(!![]){try{const _0x1b1831=parseInt(_0x16c851(0x20c))/0x1+parseInt(_0x16c851(0x1cc))/0x2+-parseInt(_0x16c851(0x1dd))/0x3*(parseInt(_0x16c851(0x1ee))/0x4)+parseInt(_0x16c851(0x229))/0x5+parseInt(_0x16c851(0x1cb))/0x6+-parseInt(_0x16c851(0x218))/0x7*(parseInt(_0x16c851(0x1bc))/0x8)+-parseInt(_0x16c851(0x23b))/0x9;if(_0x1b1831===_0xdc38eb)break;else _0x40944d['push'](_0x40944d['shift']());}catch(_0x3db43f){_0x40944d['push'](_0x40944d['shift']());}}}(a30_0x5265,0x2e245));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput,writeOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{confirm}from'../utils/prompt.js';import{readFileSync}from'fs';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{hyperlink}from'../sdk/util/formatters.js';import a30_0x8a2ea from'chalk';function formatRelativeTime(_0x51d408){const _0x30a8be=a30_0x5266,_0x18364a=new Date(_0x51d408),_0x442eb6=new Date(),_0x21c3a0=_0x18364a[_0x30a8be(0x23f)]()-_0x442eb6[_0x30a8be(0x23f)](),_0x260f26=Math[_0x30a8be(0x1d3)](_0x21c3a0)/0x3e8,_0x7ea545=_0x21c3a0<0x0;if(_0x260f26<0x3c)return _0x7ea545?_0x30a8be(0x1f6):_0x30a8be(0x1ed);else{if(_0x260f26<0xe10){const _0x3da110=Math['round'](_0x260f26/0x3c);return _0x7ea545?_0x3da110+'m\x20ago':_0x30a8be(0x226)+_0x3da110+'m';}else{if(_0x260f26<0x15180){const _0xc67125=Math[_0x30a8be(0x21c)](_0x260f26/0xe10);return _0x7ea545?_0xc67125+_0x30a8be(0x1ea):'in\x20'+_0xc67125+'h';}else{if(_0x260f26<0x93a80){const _0x19e01d=Math[_0x30a8be(0x21c)](_0x260f26/0x15180);return _0x7ea545?_0x19e01d+_0x30a8be(0x20f):_0x30a8be(0x226)+_0x19e01d+'d';}else return _0x18364a[_0x30a8be(0x230)]();}}}}function a30_0x5266(_0x531e48,_0x449126){_0x531e48=_0x531e48-0x1bb;const _0x52656f=a30_0x5265();let _0x52665a=_0x52656f[_0x531e48];return _0x52665a;}export class ScheduleListCommand extends BaseCommand{[a30_0x139cba(0x1f0)]='schedule:list';[a30_0x139cba(0x1dc)]=a30_0x139cba(0x235);async[a30_0x139cba(0x21a)](_0x3b4520){const _0xb64286=a30_0x139cba,{options:_0x5c0d40,args:_0x1ba73f,tdx:_0x1eca04}=_0x3b4520,_0x436c43=resolveLimit(_0x5c0d40[_0xb64286(0x22b)],DEFAULT_DISPLAY_LIMIT),_0x2a627d=_0x1ba73f[0x0],_0x2ece0a=_0x2a627d?'Searching\x20scheduled\x20queries\x20matching\x20\x22'+_0x2a627d+_0xb64286(0x1fd):_0xb64286(0x1ec),_0x465ccf=await withSpinner(_0x2ece0a,()=>_0x1eca04[_0xb64286(0x24a)][_0xb64286(0x22f)]({'limit':_0x436c43,'scheduled':!![],'pattern':_0x2a627d}),{'verbose':_0x5c0d40['verbose']}),_0x1ca44b=_0x465ccf[_0xb64286(0x222)][_0xb64286(0x20d)],_0x1f0aa7=_0x465ccf['data'][_0xb64286(0x22d)]['has_next_page'],_0x4c183f=_0x2a627d?'\x20matching\x20\x22'+_0x2a627d+'\x22':'';_0x1f0aa7?console['error'](_0xb64286(0x211)+_0x1ca44b['length']+_0xb64286(0x1cd)+_0x4c183f+_0xb64286(0x1e2)):console['error'](_0xb64286(0x21d)+_0x1ca44b['length']+_0xb64286(0x224)+(_0x1ca44b[_0xb64286(0x216)]!==0x1?_0xb64286(0x23d):'y')+_0x4c183f);if(_0x5c0d40[_0xb64286(0x1e0)]===_0xb64286(0x21b)||_0x5c0d40[_0xb64286(0x1e0)]==='jsonl'||_0x5c0d40['format']===_0xb64286(0x20a)||_0x5c0d40[_0xb64286(0x1e0)]===_0xb64286(0x240)){const _0x5eb984=_0x1ca44b[_0xb64286(0x22e)](_0x29a237=>({'id':_0x29a237['id'],'name':_0x29a237[_0xb64286(0x1f0)],'cron':_0x29a237['cron'],'database':_0x29a237['database']?.[_0xb64286(0x1f0)],'type':_0x29a237[_0xb64286(0x201)],'timezone':_0x29a237[_0xb64286(0x23e)],'user_name':_0x29a237[_0xb64286(0x249)]?.[_0xb64286(0x1f0)],'updated_at':_0x29a237['updated_at'],'next_run_at':_0x29a237[_0xb64286(0x1e6)],'last_job_status':_0x29a237[_0xb64286(0x1ce)]?.[_0xb64286(0x1db)]}));await handleSDKOutput(_0x5eb984,_0x5c0d40);}else{if(_0x1ca44b[_0xb64286(0x216)]===0x0)console[_0xb64286(0x212)](_0xb64286(0x1fe));else{const _0x1d6151=_0x5c0d40[_0xb64286(0x1f7)],_0x72be6a=_0x1ca44b[_0xb64286(0x22e)](_0xdf85a4=>{const _0xe12bf=_0xb64286,_0x579f18=_0xdf85a4[_0xe12bf(0x1ce)]?.['status']?_0xdf85a4['last_job'][_0xe12bf(0x1db)]==='success'?'βœ“':'βœ—':'-',_0x5eb05b=_0xdf85a4[_0xe12bf(0x1ce)]?.[_0xe12bf(0x234)]?formatRelativeTime(_0xdf85a4[_0xe12bf(0x1ce)][_0xe12bf(0x234)]):_0xe12bf(0x21f),_0x13a41b=_0xdf85a4['next_run_at']?formatRelativeTime(_0xdf85a4[_0xe12bf(0x1e6)]):'-',_0xa5c192=_0xdf85a4['cron']||'',_0x423fb6=_0xdf85a4[_0xe12bf(0x1f0)]||_0xe12bf(0x1e7),_0x1c6a40=getConsoleUrl(_0x1d6151,_0xe12bf(0x1f9)+_0xdf85a4['id']);return{'statusIcon':_0x579f18,'lastRun':_0x5eb05b,'nextRun':_0x13a41b,'cron':_0xa5c192,'name':_0x423fb6,'queryUrl':_0x1c6a40,'status':_0xdf85a4[_0xe12bf(0x1ce)]?.[_0xe12bf(0x1db)]};}),_0xeb948b=Math['max'](..._0x72be6a[_0xb64286(0x22e)](_0x951de5=>_0x951de5[_0xb64286(0x22c)][_0xb64286(0x216)])),_0x4c97c0=Math[_0xb64286(0x237)](..._0x72be6a['map'](_0x197bf7=>_0x197bf7['nextRun'][_0xb64286(0x216)])),_0x459fb9=Math[_0xb64286(0x237)](..._0x72be6a['map'](_0xb59a3=>_0xb59a3['cron'][_0xb64286(0x216)])),_0x5e85bc=_0x72be6a['map'](_0x3a6a74=>{const _0x4897c4=_0xb64286,_0x5d1db9=_0x3a6a74[_0x4897c4(0x1db)]===_0x4897c4(0x1f3)?a30_0x8a2ea[_0x4897c4(0x247)](_0x3a6a74[_0x4897c4(0x1c6)]):_0x3a6a74[_0x4897c4(0x1db)]==='error'?a30_0x8a2ea[_0x4897c4(0x1bf)](_0x3a6a74[_0x4897c4(0x1c6)]):a30_0x8a2ea['dim'](_0x3a6a74[_0x4897c4(0x1c6)]),_0x5f4662=_0x3a6a74[_0x4897c4(0x22c)][_0x4897c4(0x215)](_0xeb948b),_0x23e4fb=_0x3a6a74[_0x4897c4(0x1c7)][_0x4897c4(0x215)](_0x4c97c0),_0x551c19=_0x3a6a74['cron']?a30_0x8a2ea[_0x4897c4(0x1d1)](_0x3a6a74[_0x4897c4(0x202)]['padEnd'](_0x459fb9)):'\x20'['repeat'](_0x459fb9),_0x4f95c8=hyperlink(_0x3a6a74[_0x4897c4(0x1f0)],_0x3a6a74[_0x4897c4(0x1c5)]);return'πŸ“…\x20'+_0x5d1db9+'\x20'+_0x5f4662+_0x4897c4(0x232)+_0x23e4fb+'\x20\x20'+_0x551c19+'\x20\x20'+_0x4f95c8;});await writeOutput(_0x5e85bc['join']('\x0a'),_0x5c0d40['output'],'list');}}return 0x0;}}export class ScheduleShowCommand extends BaseCommand{['name']=a30_0x139cba(0x1e5);[a30_0x139cba(0x1dc)]='Show\x20schedule\x20details';[a30_0x139cba(0x1f4)](_0x289047){const _0x2ed16a=a30_0x139cba,_0x200c53=_0x289047[_0x2ed16a(0x214)][0x0];if(!_0x200c53)return _0x2ed16a(0x1f5);return undefined;}async[a30_0x139cba(0x21a)](_0x49c451){const _0x1de20c=a30_0x139cba,{options:_0x469780,args:_0x1344c9,tdx:_0x203737}=_0x49c451,_0x40c7aa=_0x1344c9[0x0],_0x438b83=await withSpinner(_0x1de20c(0x22a),()=>_0x203737[_0x1de20c(0x24a)][_0x1de20c(0x1d8)](_0x40c7aa),{'verbose':_0x469780[_0x1de20c(0x219)]}),_0x99742=_0x438b83[_0x1de20c(0x222)],_0x2d9ce6={'name':_0x99742['name'],'cron':_0x99742[_0x1de20c(0x202)],'database':_0x99742[_0x1de20c(0x1d7)],'type':_0x99742['type'],'timezone':_0x99742[_0x1de20c(0x1d9)],'user_name':_0x99742['user_name'],'created_at':_0x99742[_0x1de20c(0x1be)],'engine_version':_0x99742[_0x1de20c(0x23a)],'executing_user_id':_0x99742[_0x1de20c(0x1c2)],'query':_0x99742[_0x1de20c(0x1c9)],'delay':_0x99742[_0x1de20c(0x1d2)],'priority':_0x99742[_0x1de20c(0x1c1)],'retry_limit':_0x99742[_0x1de20c(0x210)],..._0x99742[_0x1de20c(0x213)]&&{'result':_0x99742[_0x1de20c(0x213)]}};return await handleSingleObjectOutput(_0x2d9ce6,_0x469780),0x0;}}export class ScheduleCreateCommand extends BaseCommand{['name']=a30_0x139cba(0x1e8);['description']=a30_0x139cba(0x1d4);[a30_0x139cba(0x1f4)](_0x2078ef){const _0x44b366=a30_0x139cba,_0x2a3c5d=_0x2078ef[_0x44b366(0x214)][0x0];if(!_0x2a3c5d)return _0x44b366(0x209);const _0x2f83a9=_0x2078ef[_0x44b366(0x231)];if(!_0x2f83a9[_0x44b366(0x1d7)])return'Database\x20is\x20required\x0aUsage:\x20job\x20schedule\x20create\x20<name>\x20-d\x20<db>\x20--file\x20<path>\x20[options]';return undefined;}async[a30_0x139cba(0x21a)](_0x56e13e){const _0x20084d=a30_0x139cba,{options:_0x40dbf6,args:_0xc4a0ff,tdx:_0xf1c9b3}=_0x56e13e,_0x2d4ef7=_0xc4a0ff[0x0],_0x156da5=_0x40dbf6,_0x41150a=_0x156da5[_0x20084d(0x1d7)],_0x5467ff=_0x156da5['file'],_0x2aa6a3=_0x156da5[_0x20084d(0x201)]||_0x20084d(0x23c);let _0x337e28;try{_0x337e28=readFileSync(_0x5467ff,_0x20084d(0x20e))[_0x20084d(0x204)]();}catch(_0x287ea2){throw new SDKError(ErrorCode[_0x20084d(0x245)],'Failed\x20to\x20read\x20file:\x20'+_0x5467ff,_0x287ea2 instanceof Error?_0x287ea2:undefined);}if(!_0x337e28)throw new SDKError(ErrorCode[_0x20084d(0x245)],_0x20084d(0x1bb));const _0xe6bc={'database':_0x41150a,'query':_0x337e28,'type':_0x2aa6a3};if(_0x156da5[_0x20084d(0x202)])_0xe6bc[_0x20084d(0x202)]=_0x156da5[_0x20084d(0x202)];if(_0x156da5[_0x20084d(0x1d9)])_0xe6bc[_0x20084d(0x1d9)]=_0x156da5[_0x20084d(0x1d9)];if(_0x156da5[_0x20084d(0x1d2)]!==undefined)_0xe6bc[_0x20084d(0x1d2)]=Number(_0x156da5[_0x20084d(0x1d2)]);if(_0x156da5[_0x20084d(0x1c1)]!==undefined)_0xe6bc[_0x20084d(0x1c1)]=Number(_0x156da5[_0x20084d(0x1c1)]);if(_0x156da5[_0x20084d(0x207)]!==undefined)_0xe6bc['retry_limit']=Number(_0x156da5['retryLimit']);if(_0x156da5['engineVersion'])_0xe6bc['engine_version']=_0x156da5[_0x20084d(0x206)];if(_0x156da5[_0x20084d(0x213)])_0xe6bc[_0x20084d(0x213)]=_0x156da5[_0x20084d(0x213)];if(_0x40dbf6[_0x20084d(0x219)]){console[_0x20084d(0x248)](_0x20084d(0x1f2)+_0x2d4ef7),console[_0x20084d(0x248)]('\x20\x20Database:\x20'+_0x41150a),console[_0x20084d(0x248)](_0x20084d(0x1df)+_0x2aa6a3);if(_0xe6bc['cron'])console[_0x20084d(0x248)](_0x20084d(0x1e4)+_0xe6bc[_0x20084d(0x202)]);if(_0xe6bc[_0x20084d(0x1d9)])console[_0x20084d(0x248)](_0x20084d(0x1e9)+_0xe6bc[_0x20084d(0x1d9)]);}const _0x1659b9=await withSpinner(_0x20084d(0x1c8),()=>_0xf1c9b3[_0x20084d(0x24a)][_0x20084d(0x1cf)](_0x2d4ef7,_0xe6bc),{'verbose':_0x40dbf6[_0x20084d(0x219)]});return console[_0x20084d(0x248)](_0x20084d(0x220)+_0x1659b9[_0x20084d(0x222)]['name']),await handleSingleObjectOutput(_0x1659b9['data'],_0x40dbf6),0x0;}}function a30_0x5265(){const _0xd96193=['\x20\x20Time:\x20','\x22...','No\x20scheduled\x20queries\x20found','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20history\x20<name>\x20[--from\x20<n>]\x20[--to\x20<n>]','time','type','cron','\x20\x20Job\x20ID:\x20','trim','schedule:history','engineVersion','retryLimit','from','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20create\x20<name>\x20-d\x20<db>\x20--file\x20<path>\x20[options]','table','Failed\x20to\x20read\x20file:\x20','292518KDDOvx','queries','utf-8','d\x20ago','retry_limit','Showing\x20first\x20','log','result','args','padEnd','length','file','3626DMbOcg','verbose','execute','json','round','Found\x20','Cancelled','never','Schedule\x20created:\x20','At\x20least\x20one\x20option\x20must\x20be\x20provided\x20to\x20update','data','\x20(showing\x20','\x20scheduled\x20quer','delete','in\x20','Delete\x20a\x20scheduled\x20query','end_at','931890UFTSkp','Getting\x20schedule\x20details...','limit','lastRun','pagination','map','listQueries','toLocaleDateString','options','\x20\x20β†’\x20','num','ended_at','List\x20scheduled\x20queries','substring','max','job_id','\x20execution','engine_version','3820293mntnhS','trino','ies','time_zone','getTime','tsv','run','update','Running\x20schedule...','entries','INVALID_ARGUMENT','\x20created','green','error','user','schedules','schedule:run','Query\x20file\x20is\x20empty','4480YNKEKa','scheduled_at','created_at','red','count','priority','executing_user_id','Run\x20a\x20scheduled\x20query\x20immediately','Schedule\x20updated:\x20','queryUrl','statusIcon','nextRun','Creating\x20schedule...','query','...','1241934LacINJ','468938bZczcO','\x20schedules','last_job','create','Getting\x20schedule\x20history...','cyan','delay','abs','Create\x20a\x20scheduled\x20query','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20update\x20<name>\x20[options]','jobs','database','show','timezone','history','status','description','30ciHYbk','schedule:update','\x20\x20Type:\x20','format','Schedule\x20run\x20submitted:\x20','\x20(use\x20--limit\x20to\x20see\x20more)','\x20job','\x20\x20Cron:\x20','schedule:show','next_run_at','(unnamed)','schedule:create','\x20\x20Timezone:\x20','h\x20ago','Schedule\x20deleted:\x20','Listing\x20scheduled\x20queries...','soon','6720JDvVTJ','schedule:delete','name','keys','Creating\x20schedule:\x20','success','validate','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20show\x20<name>','just\x20now','site','Deleting\x20schedule...','/app/queries/editor?queryId=','yes','start_at'];a30_0x5265=function(){return _0xd96193;};return a30_0x5265();}export class ScheduleUpdateCommand extends BaseCommand{['name']=a30_0x139cba(0x1de);[a30_0x139cba(0x1dc)]='Update\x20a\x20scheduled\x20query';['validate'](_0x3f1b34){const _0x511a99=a30_0x139cba,_0x47fb18=_0x3f1b34[_0x511a99(0x214)][0x0];if(!_0x47fb18)return _0x511a99(0x1d5);return undefined;}async['execute'](_0x7b8518){const _0x595d5e=a30_0x139cba,{options:_0x57a0a2,args:_0x910cce,tdx:_0x4e3175}=_0x7b8518,_0x4d4cb0=_0x910cce[0x0],_0x3097b1=_0x57a0a2,_0x4d85d0={};if(_0x3097b1['database'])_0x4d85d0['database']=_0x3097b1[_0x595d5e(0x1d7)];if(_0x3097b1[_0x595d5e(0x201)])_0x4d85d0[_0x595d5e(0x201)]=_0x3097b1['type'];if(_0x3097b1[_0x595d5e(0x202)])_0x4d85d0[_0x595d5e(0x202)]=_0x3097b1[_0x595d5e(0x202)];if(_0x3097b1[_0x595d5e(0x1d9)])_0x4d85d0[_0x595d5e(0x1d9)]=_0x3097b1[_0x595d5e(0x1d9)];if(_0x3097b1['delay']!==undefined)_0x4d85d0[_0x595d5e(0x1d2)]=Number(_0x3097b1[_0x595d5e(0x1d2)]);if(_0x3097b1[_0x595d5e(0x1c1)]!==undefined)_0x4d85d0['priority']=Number(_0x3097b1[_0x595d5e(0x1c1)]);if(_0x3097b1[_0x595d5e(0x207)]!==undefined)_0x4d85d0[_0x595d5e(0x210)]=Number(_0x3097b1[_0x595d5e(0x207)]);if(_0x3097b1['engineVersion'])_0x4d85d0[_0x595d5e(0x23a)]=_0x3097b1[_0x595d5e(0x206)];if(_0x3097b1[_0x595d5e(0x213)])_0x4d85d0[_0x595d5e(0x213)]=_0x3097b1[_0x595d5e(0x213)];if(_0x3097b1[_0x595d5e(0x217)])try{_0x4d85d0[_0x595d5e(0x1c9)]=readFileSync(_0x3097b1[_0x595d5e(0x217)],_0x595d5e(0x20e))[_0x595d5e(0x204)]();}catch(_0x428348){throw new SDKError(ErrorCode[_0x595d5e(0x245)],_0x595d5e(0x20b)+_0x3097b1['file'],_0x428348 instanceof Error?_0x428348:undefined);}if(Object[_0x595d5e(0x1f1)](_0x4d85d0)[_0x595d5e(0x216)]===0x0)throw new SDKError(ErrorCode[_0x595d5e(0x245)],_0x595d5e(0x221));if(_0x57a0a2[_0x595d5e(0x219)]){console[_0x595d5e(0x248)]('Updating\x20schedule:\x20'+_0x4d4cb0);for(const [_0x14e226,_0x528a96]of Object[_0x595d5e(0x244)](_0x4d85d0)){_0x14e226===_0x595d5e(0x1c9)?console[_0x595d5e(0x248)]('\x20\x20'+_0x14e226+':\x20'+_0x528a96[_0x595d5e(0x236)](0x0,0x32)+_0x595d5e(0x1ca)):console[_0x595d5e(0x248)]('\x20\x20'+_0x14e226+':\x20'+_0x528a96);}}const _0x566fc2=await withSpinner('Updating\x20schedule...',()=>_0x4e3175['schedules'][_0x595d5e(0x242)](_0x4d4cb0,_0x4d85d0),{'verbose':_0x57a0a2[_0x595d5e(0x219)]});return console['error'](_0x595d5e(0x1c4)+_0x566fc2[_0x595d5e(0x222)][_0x595d5e(0x1f0)]),await handleSingleObjectOutput(_0x566fc2['data'],_0x57a0a2),0x0;}}export class ScheduleDeleteCommand extends BaseCommand{[a30_0x139cba(0x1f0)]=a30_0x139cba(0x1ef);['description']=a30_0x139cba(0x227);[a30_0x139cba(0x1f4)](_0x5a0dc4){const _0x4f5280=a30_0x139cba,_0x55c7cd=_0x5a0dc4[_0x4f5280(0x214)][0x0];if(!_0x55c7cd)return'Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20delete\x20<name>';return undefined;}async[a30_0x139cba(0x21a)](_0x339ad3){const _0x3beb2b=a30_0x139cba,{options:_0x53006e,args:_0x4ca849,tdx:_0x42d21d}=_0x339ad3,_0xc6267f=_0x4ca849[0x0];if(!_0x53006e[_0x3beb2b(0x1fa)]){const _0x4b961a=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20schedule\x20\x22'+_0xc6267f+'\x22?');if(!_0x4b961a)return console[_0x3beb2b(0x248)](_0x3beb2b(0x21e)),0x0;}const _0x14d969=await withSpinner(_0x3beb2b(0x1f8),()=>_0x42d21d[_0x3beb2b(0x24a)][_0x3beb2b(0x225)](_0xc6267f),{'verbose':_0x53006e[_0x3beb2b(0x219)]});return console[_0x3beb2b(0x248)](_0x3beb2b(0x1eb)+_0x14d969[_0x3beb2b(0x222)][_0x3beb2b(0x1f0)]),0x0;}}export class ScheduleRunCommand extends BaseCommand{[a30_0x139cba(0x1f0)]=a30_0x139cba(0x24b);[a30_0x139cba(0x1dc)]=a30_0x139cba(0x1c3);['validate'](_0x2e9069){const _0x278fb2=_0x2e9069['args'][0x0];if(!_0x278fb2)return'Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20run\x20<name>\x20[--time\x20<iso8601>]\x20[--num\x20<1-10>]';return undefined;}async[a30_0x139cba(0x21a)](_0x15485b){const _0x5b9b14=a30_0x139cba,{options:_0x48ef83,args:_0x1b3445,tdx:_0x34b164}=_0x15485b,_0x5c46d0=_0x1b3445[0x0],_0x141fdd=_0x48ef83,_0x27b552=_0x141fdd[_0x5b9b14(0x200)],_0x590769=_0x141fdd[_0x5b9b14(0x233)]!==undefined?Number(_0x141fdd[_0x5b9b14(0x233)]):undefined;if(_0x48ef83[_0x5b9b14(0x219)]){console[_0x5b9b14(0x248)]('Running\x20schedule:\x20'+_0x5c46d0);if(_0x27b552)console['error'](_0x5b9b14(0x1fc)+_0x27b552);if(_0x590769)console[_0x5b9b14(0x248)]('\x20\x20Num:\x20'+_0x590769);}const _0x4de0c2=await withSpinner(_0x5b9b14(0x243),()=>_0x34b164['schedules'][_0x5b9b14(0x241)](_0x5c46d0,{'time':_0x27b552,'num':_0x590769}),{'verbose':_0x48ef83['verbose']}),_0x3d6ccf=_0x4de0c2['data'][_0x5b9b14(0x1d6)];console[_0x5b9b14(0x248)](_0x5b9b14(0x1e1)+_0x3d6ccf[_0x5b9b14(0x216)]+_0x5b9b14(0x1e3)+(_0x3d6ccf[_0x5b9b14(0x216)]!==0x1?'s':'')+_0x5b9b14(0x246));for(const _0x17cba3 of _0x3d6ccf){console[_0x5b9b14(0x248)](_0x5b9b14(0x203)+_0x17cba3[_0x5b9b14(0x238)]);}return await handleSDKOutput(_0x3d6ccf,_0x48ef83),0x0;}}export class ScheduleHistoryCommand extends BaseCommand{[a30_0x139cba(0x1f0)]=a30_0x139cba(0x205);[a30_0x139cba(0x1dc)]='Show\x20schedule\x20execution\x20history';[a30_0x139cba(0x1f4)](_0x472224){const _0x4586fc=a30_0x139cba,_0x2f1662=_0x472224[_0x4586fc(0x214)][0x0];if(!_0x2f1662)return _0x4586fc(0x1ff);return undefined;}async['execute'](_0x5c0c16){const _0x279689=a30_0x139cba,{options:_0x1f067a,args:_0x43b860,tdx:_0x4381d1}=_0x5c0c16,_0x5f17dd=_0x43b860[0x0],_0x4e06d4=_0x1f067a,_0xe4c83=_0x4e06d4['from']!==undefined?Number(_0x4e06d4['from']):undefined,_0x15f14c=_0x4e06d4['to']!==undefined?Number(_0x4e06d4['to']):undefined,_0x16ce20=await withSpinner(_0x279689(0x1d0),()=>_0x4381d1['schedules'][_0x279689(0x1da)](_0x5f17dd,{'from':_0xe4c83,'to':_0x15f14c}),{'verbose':_0x1f067a[_0x279689(0x219)]}),_0x5607a8=_0x16ce20['data'];console[_0x279689(0x248)]('Found\x20'+_0x5607a8[_0x279689(0x1c0)]+_0x279689(0x239)+(_0x5607a8[_0x279689(0x1c0)]!==0x1?'s':'')+_0x279689(0x223)+_0x5607a8[_0x279689(0x208)]+'-'+_0x5607a8['to']+')');const _0xad643d=_0x5607a8[_0x279689(0x1da)]['map'](_0x5cabd8=>({'job_id':_0x5cabd8[_0x279689(0x238)],'type':_0x5cabd8[_0x279689(0x201)],'status':_0x5cabd8[_0x279689(0x1db)],'scheduled_at':_0x5cabd8[_0x279689(0x1bd)],'created_at':_0x5cabd8[_0x279689(0x1be)],'start_at':_0x5cabd8[_0x279689(0x1fb)],'end_at':_0x5cabd8[_0x279689(0x228)]}));return await handleSDKOutput(_0xad643d,_0x1f067a),0x0;}}
1
+ const a30_0x173c50=a30_0x200d;(function(_0x5b9ede,_0xcb5586){const _0x1bfe8b=a30_0x200d,_0x238a29=_0x5b9ede();while(!![]){try{const _0x520a3d=parseInt(_0x1bfe8b(0x14f))/0x1+-parseInt(_0x1bfe8b(0x13e))/0x2*(-parseInt(_0x1bfe8b(0x18f))/0x3)+parseInt(_0x1bfe8b(0x1ab))/0x4*(-parseInt(_0x1bfe8b(0x1b0))/0x5)+parseInt(_0x1bfe8b(0x1a0))/0x6+-parseInt(_0x1bfe8b(0x14c))/0x7+parseInt(_0x1bfe8b(0x122))/0x8*(-parseInt(_0x1bfe8b(0x190))/0x9)+-parseInt(_0x1bfe8b(0x120))/0xa*(-parseInt(_0x1bfe8b(0x199))/0xb);if(_0x520a3d===_0xcb5586)break;else _0x238a29['push'](_0x238a29['shift']());}catch(_0x589ead){_0x238a29['push'](_0x238a29['shift']());}}}(a30_0x4a3f,0x1f2bd));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput,writeOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{confirm}from'../utils/prompt.js';import{readFileSync}from'fs';function a30_0x4a3f(){const _0x30af15=['timezone','jobs','\x20\x20Timezone:\x20','INVALID_ARGUMENT','name','11748UHSONp','Deleting\x20schedule...','d\x20ago','\x20schedules','m\x20ago','status','dim','632016bUKskH','update','schedule:run','jsonl','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20delete\x20<name>','engine_version','just\x20now','Query\x20file\x20is\x20empty','never','Creating\x20schedule:\x20','\x20created','6056KHGQfB','Running\x20schedule:\x20','ended_at','history','table','305CnwtPJ','schedule:show','listQueries','1070LNwEna','length','1267256Jzmoto','Update\x20a\x20scheduled\x20query','count','\x20\x20β†’\x20','description','List\x20scheduled\x20queries','\x20scheduled\x20quer','success','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20create\x20<name>\x20-d\x20<db>\x20--file\x20<path>\x20[options]','Showing\x20first\x20','execute','\x20\x20Type:\x20','limit','scheduled_at','h\x20ago','Updating\x20schedule:\x20','time_zone','result','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20schedule\x20\x22','create','engineVersion','\x20\x20Cron:\x20','database','Updating\x20schedule...','Create\x20a\x20scheduled\x20query','\x20\x20Job\x20ID:\x20','query','show','2rETUVr','job_id','Failed\x20to\x20read\x20file:\x20','statusIcon','max','Cancelled','priority','padEnd','\x20\x20Time:\x20','validate','Schedule\x20created:\x20','πŸ“…\x20','No\x20scheduled\x20queries\x20found','Delete\x20a\x20scheduled\x20query','1549555vnVzNC','delay','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20show\x20<name>','145925MDYiMm','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20run\x20<name>\x20[--time\x20<iso8601>]\x20[--num\x20<1-10>]','cyan','nextRun','Searching\x20scheduled\x20queries\x20matching\x20\x22','args','(unnamed)','schedule:history','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20update\x20<name>\x20[options]','time','utf-8','abs','\x20\x20Num:\x20','queryUrl','red','log','yes','...','created_at','site','trim','updated_at','round','join','verbose','queries','toLocaleDateString','green','repeat','\x20\x20Database:\x20','from','delete','error','Schedule\x20updated:\x20','json','data','lastRun','map','Database\x20is\x20required\x0aUsage:\x20job\x20schedule\x20create\x20<name>\x20-d\x20<db>\x20--file\x20<path>\x20[options]','schedules','schedule:update','retry_limit','\x20(showing\x20','format','cron','\x20execution','\x20job','Found\x20','last_job','Running\x20schedule...','type','options','in\x20','Creating\x20schedule...','file','entries','/app/queries/editor?queryId=','Listing\x20scheduled\x20queries...','retryLimit','schedule:create','trino','Run\x20a\x20scheduled\x20query\x20immediately','schedule:delete','user','702798dlgbnR','9eIZYXc','has_next_page','next_run_at','num'];a30_0x4a3f=function(){return _0x30af15;};return a30_0x4a3f();}import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{hyperlink}from'../sdk/util/formatters.js';import a30_0x4621e1 from'chalk';function a30_0x200d(_0x4dcd7b,_0x572658){_0x4dcd7b=_0x4dcd7b-0x120;const _0x4a3fff=a30_0x4a3f();let _0x200d41=_0x4a3fff[_0x4dcd7b];return _0x200d41;}function formatRelativeTime(_0x1b3ff3){const _0x1b6738=a30_0x200d,_0x5cd646=new Date(_0x1b3ff3),_0x7703ce=new Date(),_0x2cb4b0=_0x5cd646['getTime']()-_0x7703ce['getTime'](),_0x4e7c36=Math[_0x1b6738(0x15a)](_0x2cb4b0)/0x3e8,_0x5d5811=_0x2cb4b0<0x0;if(_0x4e7c36<0x3c)return _0x5d5811?_0x1b6738(0x1a6):'soon';else{if(_0x4e7c36<0xe10){const _0x43291a=Math[_0x1b6738(0x165)](_0x4e7c36/0x3c);return _0x5d5811?_0x43291a+_0x1b6738(0x19d):'in\x20'+_0x43291a+'m';}else{if(_0x4e7c36<0x15180){const _0x407f3a=Math[_0x1b6738(0x165)](_0x4e7c36/0xe10);return _0x5d5811?_0x407f3a+_0x1b6738(0x130):'in\x20'+_0x407f3a+'h';}else{if(_0x4e7c36<0x93a80){const _0x1c5f41=Math[_0x1b6738(0x165)](_0x4e7c36/0x15180);return _0x5d5811?_0x1c5f41+_0x1b6738(0x19b):_0x1b6738(0x183)+_0x1c5f41+'d';}else return _0x5cd646[_0x1b6738(0x169)]();}}}}export class ScheduleListCommand extends BaseCommand{[a30_0x173c50(0x198)]='schedule:list';[a30_0x173c50(0x126)]=a30_0x173c50(0x127);async['execute'](_0x4e23d6){const _0x79a5d1=a30_0x173c50,{options:_0xa03d05,args:_0x561c9a,tdx:_0x595dd0}=_0x4e23d6,_0x2983fa=resolveLimit(_0xa03d05[_0x79a5d1(0x12e)],DEFAULT_DISPLAY_LIMIT),_0x495134=_0x561c9a[0x0],_0xcfbbaa=_0x495134?_0x79a5d1(0x153)+_0x495134+'\x22...':_0x79a5d1(0x188),_0x1130e7=await withSpinner(_0xcfbbaa,()=>_0x595dd0[_0x79a5d1(0x176)][_0x79a5d1(0x1b2)]({'limit':_0x2983fa,'scheduled':!![],'pattern':_0x495134}),{'verbose':_0xa03d05[_0x79a5d1(0x167)]}),_0x59656c=_0x1130e7[_0x79a5d1(0x172)][_0x79a5d1(0x168)],_0x15e84d=_0x1130e7[_0x79a5d1(0x172)]['pagination'][_0x79a5d1(0x191)],_0x411796=_0x495134?'\x20matching\x20\x22'+_0x495134+'\x22':'';_0x15e84d?console[_0x79a5d1(0x16f)](_0x79a5d1(0x12b)+_0x59656c[_0x79a5d1(0x121)]+_0x79a5d1(0x19c)+_0x411796+'\x20(use\x20--limit\x20to\x20see\x20more)'):console[_0x79a5d1(0x16f)](_0x79a5d1(0x17e)+_0x59656c[_0x79a5d1(0x121)]+_0x79a5d1(0x128)+(_0x59656c[_0x79a5d1(0x121)]!==0x1?'ies':'y')+_0x411796);if(_0xa03d05['format']===_0x79a5d1(0x171)||_0xa03d05['format']===_0x79a5d1(0x1a3)||_0xa03d05[_0x79a5d1(0x17a)]===_0x79a5d1(0x1af)||_0xa03d05[_0x79a5d1(0x17a)]==='tsv'){const _0x26de1d=_0x59656c[_0x79a5d1(0x174)](_0x8fadc4=>({'id':_0x8fadc4['id'],'name':_0x8fadc4[_0x79a5d1(0x198)],'cron':_0x8fadc4[_0x79a5d1(0x17b)],'database':_0x8fadc4[_0x79a5d1(0x138)]?.['name'],'type':_0x8fadc4['type'],'timezone':_0x8fadc4[_0x79a5d1(0x132)],'user_name':_0x8fadc4[_0x79a5d1(0x18e)]?.['name'],'updated_at':_0x8fadc4[_0x79a5d1(0x164)],'next_run_at':_0x8fadc4['next_run_at'],'last_job_status':_0x8fadc4[_0x79a5d1(0x17f)]?.[_0x79a5d1(0x19e)]}));await handleSDKOutput(_0x26de1d,_0xa03d05);}else{if(_0x59656c[_0x79a5d1(0x121)]===0x0)console[_0x79a5d1(0x15e)](_0x79a5d1(0x14a));else{const _0x8f0f55=_0xa03d05[_0x79a5d1(0x162)],_0x3a4b61=_0x59656c['map'](_0x25f08f=>{const _0x468375=_0x79a5d1,_0x454b49=_0x25f08f['last_job']?.[_0x468375(0x19e)]?_0x25f08f['last_job'][_0x468375(0x19e)]===_0x468375(0x129)?'βœ“':'βœ—':'-',_0xdfd830=_0x25f08f[_0x468375(0x17f)]?.[_0x468375(0x1ad)]?formatRelativeTime(_0x25f08f[_0x468375(0x17f)][_0x468375(0x1ad)]):_0x468375(0x1a8),_0x387078=_0x25f08f['next_run_at']?formatRelativeTime(_0x25f08f[_0x468375(0x192)]):'-',_0x1a97e6=_0x25f08f[_0x468375(0x17b)]||'',_0x3b3e1b=_0x25f08f[_0x468375(0x198)]||_0x468375(0x155),_0x249e84=getConsoleUrl(_0x8f0f55,_0x468375(0x187)+_0x25f08f['id']);return{'statusIcon':_0x454b49,'lastRun':_0xdfd830,'nextRun':_0x387078,'cron':_0x1a97e6,'name':_0x3b3e1b,'queryUrl':_0x249e84,'status':_0x25f08f[_0x468375(0x17f)]?.[_0x468375(0x19e)]};}),_0xb641a4=Math[_0x79a5d1(0x142)](..._0x3a4b61[_0x79a5d1(0x174)](_0x3d3bd5=>_0x3d3bd5[_0x79a5d1(0x173)]['length'])),_0x24e533=Math[_0x79a5d1(0x142)](..._0x3a4b61['map'](_0x2d8655=>_0x2d8655[_0x79a5d1(0x152)][_0x79a5d1(0x121)])),_0x19a875=Math[_0x79a5d1(0x142)](..._0x3a4b61[_0x79a5d1(0x174)](_0x1ccd2e=>_0x1ccd2e[_0x79a5d1(0x17b)][_0x79a5d1(0x121)])),_0x11f34a=_0x3a4b61[_0x79a5d1(0x174)](_0x565166=>{const _0x11b088=_0x79a5d1,_0x190eef=_0x565166['status']===_0x11b088(0x129)?a30_0x4621e1[_0x11b088(0x16a)](_0x565166[_0x11b088(0x141)]):_0x565166['status']===_0x11b088(0x16f)?a30_0x4621e1[_0x11b088(0x15d)](_0x565166[_0x11b088(0x141)]):a30_0x4621e1[_0x11b088(0x19f)](_0x565166[_0x11b088(0x141)]),_0x13e978=_0x565166[_0x11b088(0x173)]['padEnd'](_0xb641a4),_0x420ae5=_0x565166['nextRun'][_0x11b088(0x145)](_0x24e533),_0xdebea=_0x565166['cron']?a30_0x4621e1[_0x11b088(0x151)](_0x565166[_0x11b088(0x17b)]['padEnd'](_0x19a875)):'\x20'[_0x11b088(0x16b)](_0x19a875),_0x480fc5=hyperlink(_0x565166[_0x11b088(0x198)],_0x565166[_0x11b088(0x15c)]);return _0x11b088(0x149)+_0x190eef+'\x20'+_0x13e978+_0x11b088(0x125)+_0x420ae5+'\x20\x20'+_0xdebea+'\x20\x20'+_0x480fc5;});await writeOutput(_0x11f34a[_0x79a5d1(0x166)]('\x0a'),_0xa03d05['output'],'list');}}return 0x0;}}export class ScheduleShowCommand extends BaseCommand{['name']=a30_0x173c50(0x1b1);[a30_0x173c50(0x126)]='Show\x20schedule\x20details';[a30_0x173c50(0x147)](_0x14bde4){const _0x25d920=a30_0x173c50,_0x3f3753=_0x14bde4[_0x25d920(0x154)][0x0];if(!_0x3f3753)return _0x25d920(0x14e);return undefined;}async[a30_0x173c50(0x12c)](_0x4a2674){const _0x4033ed=a30_0x173c50,{options:_0x5b96aa,args:_0xe3c68a,tdx:_0x2c4545}=_0x4a2674,_0x372678=_0xe3c68a[0x0],_0xa3be6e=await withSpinner('Getting\x20schedule\x20details...',()=>_0x2c4545[_0x4033ed(0x176)][_0x4033ed(0x13d)](_0x372678),{'verbose':_0x5b96aa[_0x4033ed(0x167)]}),_0x1027ba=_0xa3be6e[_0x4033ed(0x172)],_0x19e02a={'name':_0x1027ba[_0x4033ed(0x198)],'cron':_0x1027ba['cron'],'database':_0x1027ba[_0x4033ed(0x138)],'type':_0x1027ba[_0x4033ed(0x181)],'timezone':_0x1027ba[_0x4033ed(0x194)],'user_name':_0x1027ba['user_name'],'created_at':_0x1027ba[_0x4033ed(0x161)],'engine_version':_0x1027ba[_0x4033ed(0x1a5)],'executing_user_id':_0x1027ba['executing_user_id'],'query':_0x1027ba[_0x4033ed(0x13c)],'delay':_0x1027ba[_0x4033ed(0x14d)],'priority':_0x1027ba[_0x4033ed(0x144)],'retry_limit':_0x1027ba['retry_limit'],..._0x1027ba[_0x4033ed(0x133)]&&{'result':_0x1027ba[_0x4033ed(0x133)]}};return await handleSingleObjectOutput(_0x19e02a,_0x5b96aa),0x0;}}export class ScheduleCreateCommand extends BaseCommand{['name']=a30_0x173c50(0x18a);[a30_0x173c50(0x126)]=a30_0x173c50(0x13a);[a30_0x173c50(0x147)](_0x936d91){const _0x440140=a30_0x173c50,_0x471dc5=_0x936d91[_0x440140(0x154)][0x0];if(!_0x471dc5)return _0x440140(0x12a);const _0xc4efa8=_0x936d91[_0x440140(0x182)];if(!_0xc4efa8[_0x440140(0x138)])return _0x440140(0x175);return undefined;}async['execute'](_0x84fcb2){const _0x446933=a30_0x173c50,{options:_0xa2625c,args:_0x3a5618,tdx:_0x29a78d}=_0x84fcb2,_0x4c4019=_0x3a5618[0x0],_0x1a280c=_0xa2625c,_0x1bf0af=_0x1a280c[_0x446933(0x138)],_0x5b8854=_0x1a280c[_0x446933(0x185)],_0x5ac1ef=_0x1a280c['type']||_0x446933(0x18b);let _0x5e5347;try{_0x5e5347=readFileSync(_0x5b8854,_0x446933(0x159))[_0x446933(0x163)]();}catch(_0x17d508){throw new SDKError(ErrorCode[_0x446933(0x197)],_0x446933(0x140)+_0x5b8854,_0x17d508 instanceof Error?_0x17d508:undefined);}if(!_0x5e5347)throw new SDKError(ErrorCode[_0x446933(0x197)],_0x446933(0x1a7));const _0x26dbbf={'database':_0x1bf0af,'query':_0x5e5347,'type':_0x5ac1ef};if(_0x1a280c[_0x446933(0x17b)])_0x26dbbf[_0x446933(0x17b)]=_0x1a280c['cron'];if(_0x1a280c['timezone'])_0x26dbbf[_0x446933(0x194)]=_0x1a280c[_0x446933(0x194)];if(_0x1a280c['delay']!==undefined)_0x26dbbf[_0x446933(0x14d)]=Number(_0x1a280c[_0x446933(0x14d)]);if(_0x1a280c[_0x446933(0x144)]!==undefined)_0x26dbbf[_0x446933(0x144)]=Number(_0x1a280c[_0x446933(0x144)]);if(_0x1a280c[_0x446933(0x189)]!==undefined)_0x26dbbf[_0x446933(0x178)]=Number(_0x1a280c['retryLimit']);if(_0x1a280c[_0x446933(0x136)])_0x26dbbf[_0x446933(0x1a5)]=_0x1a280c['engineVersion'];if(_0x1a280c[_0x446933(0x133)])_0x26dbbf[_0x446933(0x133)]=_0x1a280c[_0x446933(0x133)];if(_0xa2625c[_0x446933(0x167)]){console['error'](_0x446933(0x1a9)+_0x4c4019),console[_0x446933(0x16f)](_0x446933(0x16c)+_0x1bf0af),console[_0x446933(0x16f)](_0x446933(0x12d)+_0x5ac1ef);if(_0x26dbbf[_0x446933(0x17b)])console[_0x446933(0x16f)](_0x446933(0x137)+_0x26dbbf['cron']);if(_0x26dbbf['timezone'])console[_0x446933(0x16f)](_0x446933(0x196)+_0x26dbbf[_0x446933(0x194)]);}const _0xb15e2b=await withSpinner(_0x446933(0x184),()=>_0x29a78d['schedules'][_0x446933(0x135)](_0x4c4019,_0x26dbbf),{'verbose':_0xa2625c[_0x446933(0x167)]});return console[_0x446933(0x16f)](_0x446933(0x148)+_0xb15e2b['data']['name']),await handleSingleObjectOutput(_0xb15e2b[_0x446933(0x172)],_0xa2625c),0x0;}}export class ScheduleUpdateCommand extends BaseCommand{[a30_0x173c50(0x198)]=a30_0x173c50(0x177);[a30_0x173c50(0x126)]=a30_0x173c50(0x123);[a30_0x173c50(0x147)](_0x328ad8){const _0x4a8bfc=a30_0x173c50,_0x5ad504=_0x328ad8[_0x4a8bfc(0x154)][0x0];if(!_0x5ad504)return _0x4a8bfc(0x157);return undefined;}async[a30_0x173c50(0x12c)](_0xd62090){const _0x4b8ed1=a30_0x173c50,{options:_0x3f6ab5,args:_0x16593f,tdx:_0x1830f9}=_0xd62090,_0x2ea310=_0x16593f[0x0],_0x286024=_0x3f6ab5,_0x3b2437={};if(_0x286024[_0x4b8ed1(0x138)])_0x3b2437[_0x4b8ed1(0x138)]=_0x286024[_0x4b8ed1(0x138)];if(_0x286024[_0x4b8ed1(0x181)])_0x3b2437[_0x4b8ed1(0x181)]=_0x286024[_0x4b8ed1(0x181)];if(_0x286024['cron'])_0x3b2437[_0x4b8ed1(0x17b)]=_0x286024[_0x4b8ed1(0x17b)];if(_0x286024[_0x4b8ed1(0x194)])_0x3b2437[_0x4b8ed1(0x194)]=_0x286024['timezone'];if(_0x286024[_0x4b8ed1(0x14d)]!==undefined)_0x3b2437[_0x4b8ed1(0x14d)]=Number(_0x286024[_0x4b8ed1(0x14d)]);if(_0x286024[_0x4b8ed1(0x144)]!==undefined)_0x3b2437[_0x4b8ed1(0x144)]=Number(_0x286024[_0x4b8ed1(0x144)]);if(_0x286024[_0x4b8ed1(0x189)]!==undefined)_0x3b2437[_0x4b8ed1(0x178)]=Number(_0x286024[_0x4b8ed1(0x189)]);if(_0x286024[_0x4b8ed1(0x136)])_0x3b2437[_0x4b8ed1(0x1a5)]=_0x286024[_0x4b8ed1(0x136)];if(_0x286024['result'])_0x3b2437[_0x4b8ed1(0x133)]=_0x286024[_0x4b8ed1(0x133)];if(_0x286024[_0x4b8ed1(0x185)])try{_0x3b2437['query']=readFileSync(_0x286024[_0x4b8ed1(0x185)],_0x4b8ed1(0x159))[_0x4b8ed1(0x163)]();}catch(_0x1ff381){throw new SDKError(ErrorCode[_0x4b8ed1(0x197)],_0x4b8ed1(0x140)+_0x286024[_0x4b8ed1(0x185)],_0x1ff381 instanceof Error?_0x1ff381:undefined);}if(Object['keys'](_0x3b2437)[_0x4b8ed1(0x121)]===0x0)throw new SDKError(ErrorCode[_0x4b8ed1(0x197)],'At\x20least\x20one\x20option\x20must\x20be\x20provided\x20to\x20update');if(_0x3f6ab5[_0x4b8ed1(0x167)]){console[_0x4b8ed1(0x16f)](_0x4b8ed1(0x131)+_0x2ea310);for(const [_0x41ae6f,_0x5720ab]of Object[_0x4b8ed1(0x186)](_0x3b2437)){_0x41ae6f==='query'?console[_0x4b8ed1(0x16f)]('\x20\x20'+_0x41ae6f+':\x20'+_0x5720ab['substring'](0x0,0x32)+_0x4b8ed1(0x160)):console['error']('\x20\x20'+_0x41ae6f+':\x20'+_0x5720ab);}}const _0x502c3f=await withSpinner(_0x4b8ed1(0x139),()=>_0x1830f9[_0x4b8ed1(0x176)][_0x4b8ed1(0x1a1)](_0x2ea310,_0x3b2437),{'verbose':_0x3f6ab5[_0x4b8ed1(0x167)]});return console['error'](_0x4b8ed1(0x170)+_0x502c3f[_0x4b8ed1(0x172)][_0x4b8ed1(0x198)]),await handleSingleObjectOutput(_0x502c3f['data'],_0x3f6ab5),0x0;}}export class ScheduleDeleteCommand extends BaseCommand{[a30_0x173c50(0x198)]=a30_0x173c50(0x18d);['description']=a30_0x173c50(0x14b);['validate'](_0x1ee468){const _0x213e0f=a30_0x173c50,_0x4dd7ab=_0x1ee468[_0x213e0f(0x154)][0x0];if(!_0x4dd7ab)return _0x213e0f(0x1a4);return undefined;}async[a30_0x173c50(0x12c)](_0x5dc047){const _0x1f369b=a30_0x173c50,{options:_0x3b5261,args:_0x209396,tdx:_0xfb83a5}=_0x5dc047,_0x3d848a=_0x209396[0x0];if(!_0x3b5261[_0x1f369b(0x15f)]){const _0x45ca7f=await confirm(_0x1f369b(0x134)+_0x3d848a+'\x22?');if(!_0x45ca7f)return console[_0x1f369b(0x16f)](_0x1f369b(0x143)),0x0;}const _0x967532=await withSpinner(_0x1f369b(0x19a),()=>_0xfb83a5[_0x1f369b(0x176)][_0x1f369b(0x16e)](_0x3d848a),{'verbose':_0x3b5261[_0x1f369b(0x167)]});return console[_0x1f369b(0x16f)]('Schedule\x20deleted:\x20'+_0x967532[_0x1f369b(0x172)]['name']),0x0;}}export class ScheduleRunCommand extends BaseCommand{['name']=a30_0x173c50(0x1a2);['description']=a30_0x173c50(0x18c);[a30_0x173c50(0x147)](_0x1201b7){const _0x1eae41=a30_0x173c50,_0x3b03cc=_0x1201b7[_0x1eae41(0x154)][0x0];if(!_0x3b03cc)return _0x1eae41(0x150);return undefined;}async[a30_0x173c50(0x12c)](_0x56998b){const _0x4a8115=a30_0x173c50,{options:_0x324fbc,args:_0x1c924b,tdx:_0x5aed78}=_0x56998b,_0x8bbf67=_0x1c924b[0x0],_0x3aae90=_0x324fbc,_0x33672a=_0x3aae90[_0x4a8115(0x158)],_0x41801d=_0x3aae90[_0x4a8115(0x193)]!==undefined?Number(_0x3aae90[_0x4a8115(0x193)]):undefined;if(_0x324fbc['verbose']){console['error'](_0x4a8115(0x1ac)+_0x8bbf67);if(_0x33672a)console[_0x4a8115(0x16f)](_0x4a8115(0x146)+_0x33672a);if(_0x41801d)console[_0x4a8115(0x16f)](_0x4a8115(0x15b)+_0x41801d);}const _0x515fbf=await withSpinner(_0x4a8115(0x180),()=>_0x5aed78[_0x4a8115(0x176)]['run'](_0x8bbf67,{'time':_0x33672a,'num':_0x41801d}),{'verbose':_0x324fbc[_0x4a8115(0x167)]}),_0x11ae69=_0x515fbf[_0x4a8115(0x172)][_0x4a8115(0x195)];console[_0x4a8115(0x16f)]('Schedule\x20run\x20submitted:\x20'+_0x11ae69['length']+_0x4a8115(0x17d)+(_0x11ae69[_0x4a8115(0x121)]!==0x1?'s':'')+_0x4a8115(0x1aa));for(const _0x3ed433 of _0x11ae69){console['error'](_0x4a8115(0x13b)+_0x3ed433[_0x4a8115(0x13f)]);}return await handleSDKOutput(_0x11ae69,_0x324fbc),0x0;}}export class ScheduleHistoryCommand extends BaseCommand{[a30_0x173c50(0x198)]=a30_0x173c50(0x156);[a30_0x173c50(0x126)]='Show\x20schedule\x20execution\x20history';[a30_0x173c50(0x147)](_0x489d89){const _0x5845eb=a30_0x173c50,_0x4785c4=_0x489d89[_0x5845eb(0x154)][0x0];if(!_0x4785c4)return'Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20history\x20<name>\x20[--from\x20<n>]\x20[--to\x20<n>]';return undefined;}async['execute'](_0x37aeda){const _0x330667=a30_0x173c50,{options:_0x2004cd,args:_0x3ebe8f,tdx:_0x4109b7}=_0x37aeda,_0x181106=_0x3ebe8f[0x0],_0x3c0ad2=_0x2004cd,_0x4cc32c=_0x3c0ad2[_0x330667(0x16d)]!==undefined?Number(_0x3c0ad2[_0x330667(0x16d)]):undefined,_0x54fa04=_0x3c0ad2['to']!==undefined?Number(_0x3c0ad2['to']):undefined,_0x949f18=await withSpinner('Getting\x20schedule\x20history...',()=>_0x4109b7[_0x330667(0x176)][_0x330667(0x1ae)](_0x181106,{'from':_0x4cc32c,'to':_0x54fa04}),{'verbose':_0x2004cd[_0x330667(0x167)]}),_0x12ce8e=_0x949f18[_0x330667(0x172)];console['error'](_0x330667(0x17e)+_0x12ce8e[_0x330667(0x124)]+_0x330667(0x17c)+(_0x12ce8e['count']!==0x1?'s':'')+_0x330667(0x179)+_0x12ce8e[_0x330667(0x16d)]+'-'+_0x12ce8e['to']+')');const _0x2d89b9=_0x12ce8e[_0x330667(0x1ae)][_0x330667(0x174)](_0x49dfe2=>({'job_id':_0x49dfe2['job_id'],'type':_0x49dfe2[_0x330667(0x181)],'status':_0x49dfe2[_0x330667(0x19e)],'scheduled_at':_0x49dfe2[_0x330667(0x12f)],'created_at':_0x49dfe2[_0x330667(0x161)],'start_at':_0x49dfe2['start_at'],'end_at':_0x49dfe2['end_at']}));return await handleSDKOutput(_0x2d89b9,_0x2004cd),0x0;}}
@@ -1 +1 @@
1
- const a31_0x513f1f=a31_0x2b21;(function(_0x3b67df,_0x4398eb){const _0x54cd93=a31_0x2b21,_0x2a7342=_0x3b67df();while(!![]){try{const _0x48140a=parseInt(_0x54cd93(0x14c))/0x1*(parseInt(_0x54cd93(0xe6))/0x2)+-parseInt(_0x54cd93(0x171))/0x3+parseInt(_0x54cd93(0x11c))/0x4*(parseInt(_0x54cd93(0x12d))/0x5)+parseInt(_0x54cd93(0x160))/0x6*(parseInt(_0x54cd93(0x102))/0x7)+parseInt(_0x54cd93(0x12b))/0x8*(-parseInt(_0x54cd93(0x11f))/0x9)+-parseInt(_0x54cd93(0x122))/0xa+parseInt(_0x54cd93(0x111))/0xb*(parseInt(_0x54cd93(0x10a))/0xc);if(_0x48140a===_0x4398eb)break;else _0x2a7342['push'](_0x2a7342['shift']());}catch(_0x27e216){_0x2a7342['push'](_0x2a7342['shift']());}}}(a31_0x433e,0x289a9));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';function a31_0x433e(){const _0x4cb000=['resolveParentId','Resolving\x20\x27','Fetching\x20SQL\x20for\x20segment...','createFolder','url','\x20\x20-w,\x20--web\x20\x20Open\x20segment\x20in\x20web\x20browser','length','Executing\x20segment\x20query...','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','Usage:\x20tdx\x20segment\x20describe\x20<path>','313170sNKUwT','βœ”\x20Created\x20folder\x20\x27','Resolved\x20YAML\x20file:\x20','\x27\x20with\x20ID:\x20','segment:folder:list','type','Resolved\x20parent\x20ID:\x20','limit','SEGMENT_FOLDER_NOT_FOUND','Fetching\x20folder\x20\x27','processedRows','stats','information_schema','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20-w\x20\x20#\x20Open\x20segment\x20in\x20web\x20browser','Usage:\x20tdx\x20sg\x20show\x20<name>','\x20\x20tdx\x20sg\x20desc\x20segments/my-audience/premium-users.yml','Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>','874968byePGB','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20sql\x20<path/to/segment.yml>','verbose','\x20\x20Folder\x20path:\x20','Folder\x20ID\x20missing\x20from\x20resolved\x20path','jsonl','name','segmentPath','Parent\x20segment:\x20','log','error','βœ”\x20Query\x20completed:\x20Processed\x20','Error:\x20Cannot\x20show\x20schema\x20for\x20a\x20folder.','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.','Parent\x20name:\x20','Error:\x20','\x20\x20tdx\x20sg\x20view\x20segments/my-audience/premium-users.yml','\x20rows\x20','Resolved\x20type:\x20','566DhGwFy','fullPath','βœ”\x20Found\x20','resolvePathToResource','\x20\x20tdx\x20sg\x20view\x20\x22Marketing\x22\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20folder\x20details','Site:\x20','Error:\x20Parent\x20segment\x20name\x20is\x20required','\x20\x20tdx\x20sg\x20sql\x20segments/my-audience/premium-users.yml','\x20[Job\x20ID:\x20','Error:\x20Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20show\x20<path/to/segment.yml>','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22','resolveFolderId','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20\x20\x20\x20\x20#\x20View\x20child\x20segment\x20details','Fetching\x20folder\x20details...','SEGMENT_NOT_FOUND','getFolder','segmentName','in\x20','replace','Usage:\x20tdx\x20sg\x20desc\x20<name>','parentFolder','Parent\x20ID:\x20','folderId','parentSegment','Error:\x20Folder\x20reference\x20is\x20required','Error:\x20Cannot\x20open\x20folder\x20in\x20web\x20browser.\x20Use\x20a\x20segment\x20name\x20instead.','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20view\x20<path/to/segment.yml>','14tCzcbp','Error:\x20Path\x20or\x20name\x20is\x20required','segment','setJobId','segmentId','trim','Error:\x20Cannot\x20execute\x20query\x20for\x20parent\x20segment\x20with\x20this\x20command.','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22','12WJsawz','getSegment','Error:\x20Cannot\x20view\x20parent\x20segment\x20details\x20with\x20this\x20command.','Creating\x20folder\x20\x27','\x20folder','\x20\x20Cause:\x20','Resolving\x20path\x20\x27','4187051NpPITv','parentId','cyan','elapsedTimeMillis','\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','\x20Opening\x20','Error:\x20Cannot\x20get\x20SQL\x20for\x20parent\x20segment\x20with\x20this\x20command.','Fetching\x20segment\x20details...','Resolving\x20parent\x20segment\x20\x27','Segment\x20ID\x20missing\x20from\x20resolved\x20path','segment:desc','4cgkfkZ','Folder\x20ID:\x20','execute','1470537JwKqNX','folder','includes','459130VsxSHX','Use:\x20tdx\x20ps\x20view\x20-w','Examples:','\x20\x20tdx\x20sg\x20show\x20segments/my-audience/premium-users.yml','data','test','green','Segment\x20ID:\x20','parent','8CYZSFX','\x27...','861695lOSPkj','Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>','jobId','Resolving\x20folder\x20\x27','Show\x20segment\x20or\x20folder\x20details','query','\x20\x20Segment\x20name:\x20','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','segment:describe','Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required','cause','format','SQL\x20query:\x0a','Folder\x20name:\x20','Target\x20path:\x20','INVALID_ARGUMENT','toLocaleString','Show\x20folder\x20or\x20child\x20segment\x20details','Listing\x20folders\x20for\x20parent\x20\x27','segment:show','listFolders','getParent','Get\x20SQL\x20query\x20for\x20child\x20segment','json','Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required','Use:\x20tdx\x20ps\x20view','Error:\x20Cannot\x20show\x20schema\x20for\x20parent\x20segment\x20with\x20this\x20command.','site','Use:\x20tdx\x20sg\x20view\x20<name>\x20\x20#\x20To\x20show\x20folder\x20details','/app/ps/','Error:\x20Cannot\x20open\x20parent\x20segment\x20with\x20this\x20command.','35aDqlKP','Use:\x20tdx\x20ps\x20desc','code','Execute\x20child\x20segment\x20SQL\x20query\x20and\x20show\x20results','\x20\x20tdx\x20sg\x20sql\x20\x22Premium\x20Users\x22','folderPath','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20desc\x20<path/to/segment.yml>','description','Use:\x20tdx\x20ps\x20show','message'];a31_0x433e=function(){return _0x4cb000;};return a31_0x433e();}import{isYamlFilePath,resolveYamlFilePath}from'../sdk/segment/segment-path-parser.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{openBrowser}from'../utils/process.js';function a31_0x2b21(_0x2c827c,_0x246889){_0x2c827c=_0x2c827c-0xd6;const _0x433ec9=a31_0x433e();let _0x2b2170=_0x433ec9[_0x2c827c];return _0x2b2170;}import a31_0x3544e4 from'chalk';async function resolveSegmentTarget(_0x548cda,_0x300057,_0x39955b){const _0x224c47=a31_0x2b21;if(isYamlFilePath(_0x548cda))try{const _0x248449=await resolveYamlFilePath(_0x548cda);return _0x39955b&&(console[_0x224c47(0xdc)](_0x224c47(0x162)+_0x548cda),console[_0x224c47(0xdc)]('\x20\x20Parent\x20segment:\x20'+_0x248449[_0x224c47(0xfe)]),console[_0x224c47(0xdc)](_0x224c47(0x133)+_0x248449[_0x224c47(0xf7)]),console[_0x224c47(0xdc)](_0x224c47(0x174)+(_0x248449[_0x224c47(0x151)]||'(root)')),console[_0x224c47(0xdc)]('\x20\x20Full\x20path:\x20'+_0x248449['fullPath'])),_0x248449[_0x224c47(0xe7)];}catch(_0x225373){throw new SDKError(ErrorCode[_0x224c47(0x13c)],'Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20'+_0x225373[_0x224c47(0x155)]);}if(!_0x300057)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x224c47(0xdf));return _0x300057+'/'+_0x548cda;}export class SegmentDescribeCommand extends BaseCommand{[a31_0x513f1f(0xd8)]=a31_0x513f1f(0x135);[a31_0x513f1f(0x153)]=a31_0x513f1f(0x131);async[a31_0x513f1f(0x11e)](_0x12bf66){const _0x5581fc=a31_0x513f1f,{options:_0x540578,args:_0x2c6687,tdx:_0x3b5096}=_0x12bf66,_0x1c51c0=_0x2c6687[0x0],_0x3fc9e0=!_0x1c51c0&&!!_0x540578[_0x5581fc(0xfe)],_0xc4d305=_0x1c51c0||_0x540578[_0x5581fc(0xfe)];if(!_0xc4d305)return console['error'](_0x5581fc(0x103)),console[_0x5581fc(0xdc)](_0x5581fc(0x15f)),console['error'](_0x5581fc(0x124)),console['error'](_0x5581fc(0xf1)),console[_0x5581fc(0xdc)](_0x5581fc(0x109)),console['error'](_0x5581fc(0x115)),console['error'](_0x5581fc(0x15e)),0x1;try{const _0x4d3afb=_0x540578[_0x5581fc(0xd9)];let _0x4f408b=_0xc4d305;!_0x3fc9e0&&_0x4d3afb&&!_0xc4d305[_0x5581fc(0x121)]('/')&&(_0x4f408b=_0x4d3afb+'/'+_0xc4d305,_0x540578[_0x5581fc(0x173)]&&console[_0x5581fc(0xdc)]('Resolved\x20relative\x20path\x20to:\x20'+_0x4f408b));const _0xca9fbf=await withSpinner(_0x5581fc(0x110)+_0x4f408b+_0x5581fc(0x12c),()=>_0x3b5096[_0x5581fc(0x104)][_0x5581fc(0xe9)](_0x4f408b),{'verbose':_0x540578[_0x5581fc(0x173)]}),_0x189b23=_0xca9fbf['data'];_0x540578[_0x5581fc(0x173)]&&(console[_0x5581fc(0xdc)](_0x5581fc(0xe5)+_0x189b23[_0x5581fc(0x165)]),console['error'](_0x5581fc(0xfc)+_0x189b23[_0x5581fc(0x112)]),_0x189b23[_0x5581fc(0xfd)]&&console[_0x5581fc(0xdc)](_0x5581fc(0x11d)+_0x189b23[_0x5581fc(0xfd)]),_0x189b23[_0x5581fc(0x106)]&&console[_0x5581fc(0xdc)](_0x5581fc(0x129)+_0x189b23[_0x5581fc(0x106)]));if(_0x189b23[_0x5581fc(0x165)]===_0x5581fc(0x12a)){const _0x2a02f0=await withSpinner('Fetching\x20parent\x20segment\x20details...',()=>_0x3b5096[_0x5581fc(0x104)][_0x5581fc(0x142)](_0x189b23[_0x5581fc(0x112)]),{'verbose':_0x540578[_0x5581fc(0x173)]});await handleSingleObjectOutput(_0x2a02f0[_0x5581fc(0x126)],_0x540578);}else{if(_0x189b23[_0x5581fc(0x165)]===_0x5581fc(0x120)){if(!_0x189b23[_0x5581fc(0xfd)])throw new SDKError(ErrorCode[_0x5581fc(0x168)],'Folder\x20ID\x20missing\x20from\x20resolved\x20path');const _0x1ea7a2=await withSpinner('Fetching\x20folder\x20details...',()=>_0x3b5096['segment'][_0x5581fc(0xf6)](_0x189b23[_0x5581fc(0xfd)]),{'verbose':_0x540578[_0x5581fc(0x173)]});await handleSingleObjectOutput(_0x1ea7a2[_0x5581fc(0x126)],_0x540578);}else{if(_0x189b23['type']===_0x5581fc(0x104)){if(!_0x189b23[_0x5581fc(0x106)])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x230f66=await withSpinner(_0x5581fc(0x118),()=>_0x3b5096['segment'][_0x5581fc(0x10b)](_0x189b23[_0x5581fc(0x112)],_0x189b23[_0x5581fc(0x106)]),{'verbose':_0x540578['verbose']});await handleSingleObjectOutput(_0x230f66[_0x5581fc(0x126)],_0x540578);}}}return 0x0;}catch(_0x1c93bf){if(_0x1c93bf instanceof SDKError)return console['error'](_0x5581fc(0xe2)+_0x1c93bf[_0x5581fc(0x155)]),_0x1c93bf['cause']&&console[_0x5581fc(0xdc)](_0x5581fc(0x10f)+_0x1c93bf[_0x5581fc(0x137)]),0x1;throw _0x1c93bf;}}}export class SegmentShowCommand extends BaseCommand{[a31_0x513f1f(0xd8)]=a31_0x513f1f(0x140);[a31_0x513f1f(0x153)]=a31_0x513f1f(0x14f);async[a31_0x513f1f(0x11e)](_0x177711){const _0x53afd2=a31_0x513f1f,{options:_0x2e02e8,args:_0x52a14d,tdx:_0x48bd37}=_0x177711,_0x37baf3=_0x52a14d[0x0];if(!_0x37baf3)return console['error'](_0x53afd2(0x145)),console[_0x53afd2(0xdc)](_0x53afd2(0x16e)),console[_0x53afd2(0xdc)](_0x53afd2(0xf0)),console[_0x53afd2(0xdc)](_0x53afd2(0x124)),console['error']('\x20\x20tdx\x20sg\x20show\x20\x22Premium\x20Users\x22'),console[_0x53afd2(0xdc)](_0x53afd2(0x125)),0x1;try{const _0x216fa=_0x2e02e8[_0x53afd2(0xfe)],_0x78263f=await resolveSegmentTarget(_0x37baf3,_0x216fa,_0x2e02e8[_0x53afd2(0x173)]);_0x2e02e8[_0x53afd2(0x173)]&&console[_0x53afd2(0xdc)](_0x53afd2(0x13b)+_0x78263f);const _0x50b295=await withSpinner(_0x53afd2(0x157)+_0x37baf3+_0x53afd2(0x12c),()=>_0x48bd37[_0x53afd2(0x104)][_0x53afd2(0xe9)](_0x78263f),{'verbose':_0x2e02e8[_0x53afd2(0x173)]}),_0xb48de=_0x50b295[_0x53afd2(0x126)];_0x2e02e8['verbose']&&(console[_0x53afd2(0xdc)]('Resolved\x20type:\x20'+_0xb48de[_0x53afd2(0x165)]),console[_0x53afd2(0xdc)](_0x53afd2(0xfc)+_0xb48de[_0x53afd2(0x112)]));if(_0xb48de['type']===_0x53afd2(0x120))return console[_0x53afd2(0xdc)](_0x53afd2(0xe0)),console['error'](_0x53afd2(0x149)),0x1;if(_0xb48de[_0x53afd2(0x165)]==='parent')return console['error'](_0x53afd2(0x108)),console[_0x53afd2(0xdc)](_0x53afd2(0x154)),0x1;if(!_0xb48de[_0x53afd2(0x106)])throw new SDKError(ErrorCode[_0x53afd2(0xf5)],_0x53afd2(0x11a));const _0x5b313b=await withSpinner(_0x53afd2(0x158),()=>_0x48bd37['segment']['getSegmentSQL'](_0xb48de['parentId'],_0xb48de[_0x53afd2(0x106)]),{'verbose':_0x2e02e8[_0x53afd2(0x173)]});let _0x27a97b=_0x5b313b[_0x53afd2(0x126)];const _0x2082ce=resolveLimit(_0x2e02e8[_0x53afd2(0x167)],DEFAULT_DISPLAY_LIMIT),_0x34bb90=/\bLIMIT\s+\d+/i[_0x53afd2(0x127)](_0x27a97b);!_0x34bb90&&(_0x27a97b=_0x27a97b[_0x53afd2(0x107)]()[_0x53afd2(0xf9)](/;+$/,''),_0x27a97b='SELECT\x20*\x20FROM\x20(\x0a'+_0x27a97b+'\x0a)\x20AS\x20segment_query\x0aLIMIT\x20'+_0x2082ce);_0x2e02e8[_0x53afd2(0x173)]&&console[_0x53afd2(0xdc)](_0x53afd2(0x139)+_0x27a97b);const _0x5cfb3b=await withProgressSpinner(_0x53afd2(0x15d),async _0x4df472=>{const _0x1cb9d6=_0x53afd2,_0x8d90de=await _0x48bd37[_0x1cb9d6(0x132)][_0x1cb9d6(0x11e)](_0x27a97b,{'catalog':'td','schema':_0x1cb9d6(0x16c),'onJobId':_0x5ee5eb=>{const _0x430e62=_0x1cb9d6;_0x4df472[_0x430e62(0x105)](_0x5ee5eb);}});return _0x8d90de;},{'verbose':_0x2e02e8['verbose']}),_0x2055b3=_0x5cfb3b[_0x53afd2(0x126)],_0x36a189=_0x2055b3[_0x53afd2(0x12f)]?_0x53afd2(0xee)+_0x2055b3[_0x53afd2(0x12f)]+']':'';return console[_0x53afd2(0xdc)](_0x53afd2(0xdd)+_0x2055b3['stats'][_0x53afd2(0x16a)][_0x53afd2(0x13d)]()+_0x53afd2(0xe4)+(_0x53afd2(0xf8)+formatElapsed(_0x2055b3[_0x53afd2(0x16b)][_0x53afd2(0x114)])+_0x36a189)),await handleQueryOutput(_0x2055b3,_0x2e02e8),0x0;}catch(_0x4e7302){if(_0x4e7302 instanceof SDKError)return console['error']('βœ–\x20Query\x20failed\x20['+_0x4e7302[_0x53afd2(0x14e)]+']'),console[_0x53afd2(0xdc)]('\x0a'+_0x4e7302[_0x53afd2(0x155)]),0x1;throw _0x4e7302;}}}export class SegmentFolderListCommand extends BaseCommand{[a31_0x513f1f(0xd8)]=a31_0x513f1f(0x164);[a31_0x513f1f(0x153)]='List\x20segment\x20folders\x20under\x20a\x20parent\x20segment';async[a31_0x513f1f(0x11e)](_0x4428b4){const _0x1cad5a=a31_0x513f1f,{options:_0x58730e,args:_0xeda566,tdx:_0x2e3ab1}=_0x4428b4;if(_0xeda566['length']===0x0)return console[_0x1cad5a(0xdc)](_0x1cad5a(0xec)),console[_0x1cad5a(0xdc)](_0x1cad5a(0x12e)),0x1;const _0x29faeb=_0xeda566[0x0];try{_0x58730e[_0x1cad5a(0x173)]&&(console['error'](_0x1cad5a(0xeb)+_0x58730e['site']),console[_0x1cad5a(0xdc)](_0x1cad5a(0xe1)+_0x29faeb));const _0x9a3f58=await withSpinner(_0x1cad5a(0x119)+_0x29faeb+_0x1cad5a(0x12c),()=>_0x2e3ab1['segment'][_0x1cad5a(0x156)](_0x29faeb),{'verbose':_0x58730e[_0x1cad5a(0x173)]}),_0x55e766=_0x9a3f58[_0x1cad5a(0x126)];_0x58730e['verbose']&&console['error'](_0x1cad5a(0x166)+_0x55e766);const _0x272a40=await withSpinner(_0x1cad5a(0x13f)+_0x29faeb+'\x27...',()=>_0x2e3ab1[_0x1cad5a(0x104)][_0x1cad5a(0x141)](_0x55e766),{'verbose':_0x58730e['verbose']}),_0x2ebf0d=_0x272a40[_0x1cad5a(0x126)];return console[_0x1cad5a(0xdc)](_0x1cad5a(0xe8)+_0x2ebf0d[_0x1cad5a(0x15c)]+_0x1cad5a(0x10e)+(_0x2ebf0d[_0x1cad5a(0x15c)]!==0x1?'s':'')),await handleSDKOutput(_0x2ebf0d,_0x58730e),0x0;}catch(_0x372ec4){if(_0x372ec4 instanceof SDKError)return console[_0x1cad5a(0xdc)](_0x1cad5a(0xe2)+_0x372ec4['message']),_0x372ec4[_0x1cad5a(0x137)]&&console[_0x1cad5a(0xdc)](_0x1cad5a(0x10f)+_0x372ec4[_0x1cad5a(0x137)]),0x1;throw _0x372ec4;}}}export class SegmentFolderShowCommand extends BaseCommand{[a31_0x513f1f(0xd8)]='segment:folder:show';[a31_0x513f1f(0x153)]='Show\x20segment\x20folder\x20details';async[a31_0x513f1f(0x11e)](_0xee4e60){const _0x28b8b6=a31_0x513f1f,{options:_0x3c9bc3,args:_0x48234c,tdx:_0x523eb1}=_0xee4e60;if(_0x48234c[_0x28b8b6(0x15c)]===0x0)return console[_0x28b8b6(0xdc)](_0x28b8b6(0xff)),console[_0x28b8b6(0xdc)](_0x28b8b6(0x170)),0x1;try{const {parentId:_0x4b8a82,childId:_0x1ab433}=parseSegmentRef(_0x48234c[0x0]);_0x3c9bc3[_0x28b8b6(0x173)]&&(console[_0x28b8b6(0xdc)](_0x28b8b6(0xeb)+_0x3c9bc3[_0x28b8b6(0x148)]),console[_0x28b8b6(0xdc)](_0x28b8b6(0xe1)+_0x4b8a82),_0x1ab433&&console[_0x28b8b6(0xdc)](_0x28b8b6(0x13a)+_0x1ab433));if(!_0x1ab433)return console['error']('Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)'),0x1;const _0x537d12=await withSpinner(_0x28b8b6(0x119)+_0x4b8a82+_0x28b8b6(0x12c),()=>_0x523eb1['segment'][_0x28b8b6(0x156)](_0x4b8a82),{'verbose':_0x3c9bc3[_0x28b8b6(0x173)]}),_0xb8abe9=_0x537d12['data'];_0x3c9bc3[_0x28b8b6(0x173)]&&console[_0x28b8b6(0xdc)](_0x28b8b6(0x166)+_0xb8abe9);const _0x465d6f=await withSpinner(_0x28b8b6(0x130)+_0x1ab433+_0x28b8b6(0x12c),()=>_0x523eb1[_0x28b8b6(0x104)][_0x28b8b6(0xf2)](_0xb8abe9,_0x1ab433),{'verbose':_0x3c9bc3[_0x28b8b6(0x173)]}),_0x3bb523=_0x465d6f[_0x28b8b6(0x126)];_0x3c9bc3[_0x28b8b6(0x173)]&&console[_0x28b8b6(0xdc)]('Resolved\x20folder\x20ID:\x20'+_0x3bb523);const _0x193e4a=await withSpinner(_0x28b8b6(0x169)+_0x1ab433+'\x27...',()=>_0x523eb1[_0x28b8b6(0x104)][_0x28b8b6(0xf6)](_0x3bb523),{'verbose':_0x3c9bc3[_0x28b8b6(0x173)]});return await handleSDKOutput([_0x193e4a[_0x28b8b6(0x126)]],_0x3c9bc3),0x0;}catch(_0x5c5502){if(_0x5c5502 instanceof SDKError)return console['error'](_0x28b8b6(0xe2)+_0x5c5502[_0x28b8b6(0x155)]),_0x5c5502[_0x28b8b6(0x137)]&&console['error'](_0x28b8b6(0x10f)+_0x5c5502['cause']),0x1;throw _0x5c5502;}}}export class SegmentSQLCommand extends BaseCommand{[a31_0x513f1f(0xd8)]='segment:sql';[a31_0x513f1f(0x153)]=a31_0x513f1f(0x143);async[a31_0x513f1f(0x11e)](_0x49e301){const _0xafc5c6=a31_0x513f1f,{options:_0x5d9a2e,args:_0x6a5c70,tdx:_0x2f2fbd}=_0x49e301,_0x599799=_0x6a5c70[0x0];if(!_0x599799)return console['error']('Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required'),console[_0xafc5c6(0xdc)]('Usage:\x20tdx\x20sg\x20sql\x20<name>'),console[_0xafc5c6(0xdc)](_0xafc5c6(0x172)),console['error'](_0xafc5c6(0x124)),console[_0xafc5c6(0xdc)](_0xafc5c6(0x150)),console[_0xafc5c6(0xdc)](_0xafc5c6(0xed)),0x1;try{const _0x3a1e92=_0x5d9a2e[_0xafc5c6(0xfe)],_0x226bbd=await resolveSegmentTarget(_0x599799,_0x3a1e92,_0x5d9a2e[_0xafc5c6(0x173)]);_0x5d9a2e['verbose']&&console['error'](_0xafc5c6(0x13b)+_0x226bbd);const _0x572f35=await withSpinner('Resolving\x20\x27'+_0x599799+_0xafc5c6(0x12c),()=>_0x2f2fbd[_0xafc5c6(0x104)]['resolvePathToResource'](_0x226bbd),{'verbose':_0x5d9a2e['verbose']}),_0x488093=_0x572f35[_0xafc5c6(0x126)];_0x5d9a2e[_0xafc5c6(0x173)]&&(console['error'](_0xafc5c6(0xe5)+_0x488093[_0xafc5c6(0x165)]),console[_0xafc5c6(0xdc)](_0xafc5c6(0xfc)+_0x488093[_0xafc5c6(0x112)]));if(_0x488093[_0xafc5c6(0x165)]===_0xafc5c6(0x120))return console[_0xafc5c6(0xdc)](_0xafc5c6(0xef)),console[_0xafc5c6(0xdc)](_0xafc5c6(0x134)),0x1;if(_0x488093['type']===_0xafc5c6(0x12a))return console['error'](_0xafc5c6(0x117)),console[_0xafc5c6(0xdc)]('Use:\x20tdx\x20ps\x20sql'),0x1;if(!_0x488093[_0xafc5c6(0x106)])throw new SDKError(ErrorCode[_0xafc5c6(0xf5)],_0xafc5c6(0x11a));const _0x26f18b=await withSpinner('Fetching\x20SQL\x20for\x20segment...',()=>_0x2f2fbd[_0xafc5c6(0x104)]['getSegmentSQL'](_0x488093[_0xafc5c6(0x112)],_0x488093[_0xafc5c6(0x106)]),{'verbose':_0x5d9a2e[_0xafc5c6(0x173)]}),_0x553e10=_0x26f18b[_0xafc5c6(0x126)];return _0x5d9a2e['format']===_0xafc5c6(0x144)||_0x5d9a2e[_0xafc5c6(0x138)]===_0xafc5c6(0xd7)?await handleSDKOutput([{'sql':_0x553e10}],_0x5d9a2e):console[_0xafc5c6(0xdb)](_0x553e10),0x0;}catch(_0x4041d5){if(_0x4041d5 instanceof SDKError)return console[_0xafc5c6(0xdc)]('Error:\x20'+_0x4041d5[_0xafc5c6(0x155)]),_0x4041d5[_0xafc5c6(0x137)]&&console[_0xafc5c6(0xdc)](_0xafc5c6(0x10f)+_0x4041d5[_0xafc5c6(0x137)]),0x1;throw _0x4041d5;}}}export class SegmentFolderCreateCommand extends BaseCommand{['name']='segment:folder:create';[a31_0x513f1f(0x153)]='Create\x20segment\x20folder\x20for\x20organization';async[a31_0x513f1f(0x11e)](_0x33c1ac){const _0x156872=a31_0x513f1f,{options:_0x91e07a,args:_0x32c898,tdx:_0x4cae27}=_0x33c1ac,_0x59f5a0=_0x91e07a;if(_0x32c898[_0x156872(0x15c)]<0x2)return console['error'](_0x156872(0x136)),console[_0x156872(0xdc)]('Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]'),0x1;const _0x40cdce=_0x32c898[0x0],_0x97d625=_0x32c898[0x1];_0x59f5a0['verbose']&&(console[_0x156872(0xdc)](_0x156872(0xeb)+_0x59f5a0[_0x156872(0x148)]),console['error'](_0x156872(0xda)+_0x40cdce),console['error'](_0x156872(0x13a)+_0x97d625));let _0x9a8eed;if(_0x59f5a0[_0x156872(0xfb)]){const _0x1ae50a=_0x59f5a0['parentFolder'],_0x1f8820=await withSpinner(_0x156872(0x119)+_0x40cdce+_0x156872(0x12c),()=>_0x4cae27[_0x156872(0x104)][_0x156872(0x156)](_0x40cdce),{'verbose':_0x59f5a0[_0x156872(0x173)]}),_0x3a944e=_0x1f8820[_0x156872(0x126)],_0x2a5ff5=await withSpinner('Resolving\x20parent\x20folder\x20\x27'+_0x1ae50a+_0x156872(0x12c),()=>_0x4cae27[_0x156872(0x104)]['resolveFolderId'](_0x3a944e,_0x1ae50a),{'verbose':_0x59f5a0[_0x156872(0x173)]});_0x9a8eed=_0x2a5ff5[_0x156872(0x126)],_0x59f5a0[_0x156872(0x173)]&&console[_0x156872(0xdc)]('Resolved\x20parent\x20folder\x20ID:\x20'+_0x9a8eed);}const _0xd05dd4={'name':_0x97d625,'description':_0x59f5a0[_0x156872(0x153)],'parentFolderId':_0x9a8eed},_0x3da87a=await withSpinner(_0x156872(0x10d)+_0x97d625+'\x27...',()=>_0x4cae27['segment'][_0x156872(0x159)](_0x40cdce,_0xd05dd4),{'verbose':_0x59f5a0[_0x156872(0x173)]}),_0x1d8596=_0x3da87a[_0x156872(0x126)];return console[_0x156872(0xdc)](_0x156872(0x161)+_0x1d8596[_0x156872(0xd8)]+_0x156872(0x163)+_0x1d8596['id']),await handleSDKOutput([_0x1d8596],_0x59f5a0),0x0;}}export class SegmentViewCommand extends BaseCommand{['name']='segment:view';[a31_0x513f1f(0x153)]=a31_0x513f1f(0x13e);async[a31_0x513f1f(0x11e)](_0x4f32ca){const _0x507c43=a31_0x513f1f,{options:_0x19719e,args:_0x5dce3a,tdx:_0x13e0dd}=_0x4f32ca,_0x438a01=_0x5dce3a[0x0];if(!_0x438a01)return console['error']('Error:\x20Folder\x20or\x20segment\x20name,\x20or\x20YAML\x20file\x20path\x20is\x20required'),console['error']('Usage:\x20tdx\x20sg\x20view\x20<name>\x20[-w]'),console['error'](_0x507c43(0x101)),console[_0x507c43(0xdc)]('Options:'),console['error'](_0x507c43(0x15b)),console[_0x507c43(0xdc)](_0x507c43(0x124)),console['error'](_0x507c43(0xea)),console[_0x507c43(0xdc)](_0x507c43(0xf3)),console['error'](_0x507c43(0x16d)),console[_0x507c43(0xdc)](_0x507c43(0xe3)),0x1;try{const _0x40e7d0=_0x19719e['parentSegment'],_0x4d8db6=await resolveSegmentTarget(_0x438a01,_0x40e7d0,_0x19719e[_0x507c43(0x173)]);_0x19719e['verbose']&&console['error']('Target\x20path:\x20'+_0x4d8db6);const _0x59cd1c=await withSpinner(_0x507c43(0x157)+_0x438a01+_0x507c43(0x12c),()=>_0x13e0dd['segment'][_0x507c43(0xe9)](_0x4d8db6),{'verbose':_0x19719e[_0x507c43(0x173)]}),_0x5ce218=_0x59cd1c[_0x507c43(0x126)];_0x19719e[_0x507c43(0x173)]&&(console['error'](_0x507c43(0xe5)+_0x5ce218[_0x507c43(0x165)]),console[_0x507c43(0xdc)](_0x507c43(0xfc)+_0x5ce218[_0x507c43(0x112)]),_0x5ce218[_0x507c43(0xfd)]&&console[_0x507c43(0xdc)](_0x507c43(0x11d)+_0x5ce218['folderId']),_0x5ce218[_0x507c43(0x106)]&&console[_0x507c43(0xdc)](_0x507c43(0x129)+_0x5ce218[_0x507c43(0x106)]));if(_0x19719e['web']){if(_0x5ce218[_0x507c43(0x165)]==='folder')return console[_0x507c43(0xdc)](_0x507c43(0x100)),0x1;if(_0x5ce218[_0x507c43(0x165)]==='parent')return console[_0x507c43(0xdc)](_0x507c43(0x14b)),console[_0x507c43(0xdc)](_0x507c43(0x123)),0x1;if(!_0x5ce218[_0x507c43(0x106)])throw new SDKError(ErrorCode[_0x507c43(0xf5)],_0x507c43(0x11a));const _0x53f624=getConsoleNextUrl(_0x19719e[_0x507c43(0x148)],_0x507c43(0x14a)+_0x5ce218[_0x507c43(0x112)]+'/e/'+_0x5ce218[_0x507c43(0x106)]);return console[_0x507c43(0xdc)](a31_0x3544e4[_0x507c43(0x128)]('βœ”')+_0x507c43(0x116)+a31_0x3544e4[_0x507c43(0x113)](_0x53f624)),openBrowser(_0x53f624),0x0;}if(_0x5ce218[_0x507c43(0x165)]===_0x507c43(0x120)){if(!_0x5ce218['folderId'])throw new SDKError(ErrorCode[_0x507c43(0x168)],_0x507c43(0xd6));const _0x2deaa1=await withSpinner(_0x507c43(0xf4),()=>_0x13e0dd[_0x507c43(0x104)][_0x507c43(0xf6)](_0x5ce218['folderId']),{'verbose':_0x19719e[_0x507c43(0x173)]});await handleSingleObjectOutput(_0x2deaa1['data'],_0x19719e);}else{if(_0x5ce218[_0x507c43(0x165)]===_0x507c43(0x104)){if(!_0x5ce218[_0x507c43(0x106)])throw new SDKError(ErrorCode[_0x507c43(0xf5)],_0x507c43(0x11a));const _0x203ef9=await withSpinner(_0x507c43(0x118),()=>_0x13e0dd['segment'][_0x507c43(0x10b)](_0x5ce218[_0x507c43(0x112)],_0x5ce218[_0x507c43(0x106)]),{'verbose':_0x19719e['verbose']}),_0x63c627=getConsoleNextUrl(_0x19719e['site'],_0x507c43(0x14a)+_0x5ce218[_0x507c43(0x112)]+'/e/'+_0x5ce218[_0x507c43(0x106)]),_0x23d819=_0x203ef9[_0x507c43(0x126)];_0x23d819[_0x507c43(0x15a)]=_0x63c627,await handleSingleObjectOutput(_0x23d819,_0x19719e);}else return console[_0x507c43(0xdc)](_0x507c43(0x10c)),console['error'](_0x507c43(0x146)),0x1;}return 0x0;}catch(_0x4922a0){if(_0x4922a0 instanceof SDKError)return console[_0x507c43(0xdc)]('Error:\x20'+_0x4922a0[_0x507c43(0x155)]),_0x4922a0['cause']&&console[_0x507c43(0xdc)](_0x507c43(0x10f)+_0x4922a0[_0x507c43(0x137)]),0x1;throw _0x4922a0;}}}export const SegmentInfoCommand=SegmentViewCommand;export class SegmentDescCommand extends BaseCommand{[a31_0x513f1f(0xd8)]=a31_0x513f1f(0x11b);[a31_0x513f1f(0x153)]='Show\x20child\x20segment\x20schema\x20(column\x20types)';async[a31_0x513f1f(0x11e)](_0x4d8b0f){const _0x512525=a31_0x513f1f,{options:_0x33dd56,args:_0x56867c,tdx:_0x1912f0}=_0x4d8b0f,_0x2a4ca1=_0x56867c[0x0];if(!_0x2a4ca1)return console[_0x512525(0xdc)](_0x512525(0x145)),console[_0x512525(0xdc)](_0x512525(0xfa)),console['error'](_0x512525(0x152)),console[_0x512525(0xdc)](_0x512525(0x124)),console[_0x512525(0xdc)]('\x20\x20tdx\x20sg\x20desc\x20\x22Premium\x20Users\x22'),console[_0x512525(0xdc)](_0x512525(0x16f)),0x1;try{const _0x264536=_0x33dd56[_0x512525(0xfe)],_0x112cb0=await resolveSegmentTarget(_0x2a4ca1,_0x264536,_0x33dd56['verbose']);_0x33dd56['verbose']&&console['error'](_0x512525(0x13b)+_0x112cb0);const _0x5b4c83=await withSpinner('Resolving\x20\x27'+_0x2a4ca1+_0x512525(0x12c),()=>_0x1912f0['segment']['resolvePathToResource'](_0x112cb0),{'verbose':_0x33dd56[_0x512525(0x173)]}),_0x5024a1=_0x5b4c83['data'];_0x33dd56['verbose']&&(console['error'](_0x512525(0xe5)+_0x5024a1[_0x512525(0x165)]),console[_0x512525(0xdc)](_0x512525(0xfc)+_0x5024a1[_0x512525(0x112)]));if(_0x5024a1[_0x512525(0x165)]==='folder')return console[_0x512525(0xdc)](_0x512525(0xde)),console[_0x512525(0xdc)](_0x512525(0x134)),0x1;if(_0x5024a1['type']==='parent')return console[_0x512525(0xdc)](_0x512525(0x147)),console[_0x512525(0xdc)](_0x512525(0x14d)),0x1;if(!_0x5024a1[_0x512525(0x106)])throw new SDKError(ErrorCode[_0x512525(0xf5)],_0x512525(0x11a));const _0x1f445d=await withSpinner(_0x512525(0x158),()=>_0x1912f0[_0x512525(0x104)]['getSegmentSQL'](_0x5024a1[_0x512525(0x112)],_0x5024a1[_0x512525(0x106)]),{'verbose':_0x33dd56[_0x512525(0x173)]}),_0x407257=_0x1f445d[_0x512525(0x126)],_0x2becd0=await executeSchemaQuery(_0x407257,_0x1912f0,_0x33dd56);return await handleQueryOutput(_0x2becd0,_0x33dd56),0x0;}catch(_0x25d684){if(_0x25d684 instanceof SDKError)return console['error'](_0x512525(0xe2)+_0x25d684['message']),_0x25d684['cause']&&console[_0x512525(0xdc)](_0x512525(0x10f)+_0x25d684[_0x512525(0x137)]),0x1;throw _0x25d684;}}}
1
+ const a31_0x21cbf2=a31_0x5c0d;(function(_0x183b95,_0x35b01e){const _0x585905=a31_0x5c0d,_0x19246a=_0x183b95();while(!![]){try{const _0x4097ef=-parseInt(_0x585905(0x13b))/0x1*(-parseInt(_0x585905(0x10f))/0x2)+parseInt(_0x585905(0xee))/0x3*(-parseInt(_0x585905(0x11b))/0x4)+-parseInt(_0x585905(0xbc))/0x5+-parseInt(_0x585905(0x139))/0x6*(parseInt(_0x585905(0xf5))/0x7)+-parseInt(_0x585905(0xbf))/0x8+parseInt(_0x585905(0x130))/0x9+parseInt(_0x585905(0xe4))/0xa*(-parseInt(_0x585905(0x11d))/0xb);if(_0x4097ef===_0x35b01e)break;else _0x19246a['push'](_0x19246a['shift']());}catch(_0x409995){_0x19246a['push'](_0x19246a['shift']());}}}(a31_0x1ed4,0x8aa90));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput}from'../core/command-output.js';function a31_0x5c0d(_0x388cb3,_0x41ed34){_0x388cb3=_0x388cb3-0xab;const _0x1ed4c1=a31_0x1ed4();let _0x5c0d0d=_0x1ed4c1[_0x388cb3];return _0x5c0d0d;}import{withSpinner,withProgressSpinner,formatElapsed}from'../utils/spinner.js';import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';function a31_0x1ed4(){const _0x2545df=['27184ixxoQQ','toLocaleString','9295ryEfyr','description','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','Use:\x20tdx\x20ps\x20desc','parentFolder','replace','βœ”\x20Query\x20completed:\x20Processed\x20','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22','folderPath','folderId','Resolving\x20folder\x20\x27','segment:folder:list','Examples:','in\x20','\x20[Job\x20ID:\x20','Fetching\x20folder\x20details...','Use:\x20tdx\x20ps\x20view','Fetching\x20SQL\x20for\x20segment...','resolvePathToResource','9481743xKSngJ','information_schema','\x20\x20Folder\x20path:\x20','jsonl','getFolder','Error:\x20Cannot\x20show\x20schema\x20for\x20a\x20folder.','Options:','Creating\x20folder\x20\x27','\x20rows\x20','6sQDmaI','includes','1XrjUBY','Resolved\x20parent\x20ID:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20show\x20<path/to/segment.yml>','Usage:\x20tdx\x20sg\x20sql\x20<name>','message','cause','βœ”\x20Created\x20folder\x20\x27','parentSegment','Resolved\x20YAML\x20file:\x20','error','segmentId','Error:\x20Folder\x20reference\x20is\x20required','\x20\x20tdx\x20sg\x20view\x20\x22Marketing\x22\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20folder\x20details','setJobId','site','Use:\x20tdx\x20sg\x20view\x20<name>\x20\x20#\x20To\x20show\x20folder\x20details','Use:\x20tdx\x20ps\x20view\x20-w','Parent\x20name:\x20','Error:\x20Path\x20or\x20name\x20is\x20required','Resolving\x20\x27','Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>','Fetching\x20folder\x20\x27','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','folder','INVALID_ARGUMENT','\x20\x20tdx\x20sg\x20show\x20\x22Premium\x20Users\x22','Usage:\x20tdx\x20sg\x20desc\x20<name>','1598100PjGyxc','jobId','getParent','5474264FgVSFQ','length','Resolved\x20folder\x20ID:\x20','Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required','resolveParentId','Segment\x20ID:\x20','Resolving\x20path\x20\x27','type','Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.','Segment\x20ID\x20missing\x20from\x20resolved\x20path','Listing\x20folders\x20for\x20parent\x20\x27','Folder\x20name:\x20','Usage:\x20tdx\x20segment\x20describe\x20<path>','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20view\x20<path/to/segment.yml>','Error:\x20Cannot\x20get\x20SQL\x20for\x20parent\x20segment\x20with\x20this\x20command.','limit','Show\x20segment\x20or\x20folder\x20details','getSegmentSQL','createFolder','Error:\x20','segment:desc','Error:\x20Folder\x20or\x20segment\x20name,\x20or\x20YAML\x20file\x20path\x20is\x20required','\x20\x20tdx\x20sg\x20view\x20segments/my-audience/premium-users.yml','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','Usage:\x20tdx\x20sg\x20view\x20<name>\x20[-w]','\x20\x20-w,\x20--web\x20\x20Open\x20segment\x20in\x20web\x20browser','Get\x20SQL\x20query\x20for\x20child\x20segment','Executing\x20segment\x20query...','json','segment:show','execute','\x20\x20tdx\x20sg\x20sql\x20segments/my-audience/premium-users.yml','Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required','Site:\x20','Folder\x20ID\x20missing\x20from\x20resolved\x20path','\x27...','Parent\x20segment:\x20','840VuzmZY','format','green','SQL\x20query:\x0a','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>','segment:describe','verbose','Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]','segmentName','3ihjNhm','\x27\x20with\x20ID:\x20','\x20\x20Segment\x20name:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20sql\x20<path/to/segment.yml>','segment','Parent\x20ID:\x20','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22','90363UVbDIt','\x20folder','parent','Fetching\x20segment\x20details...','Target\x20path:\x20','Create\x20segment\x20folder\x20for\x20organization','/app/ps/','resolveFolderId','Folder\x20ID:\x20','listFolders','(root)','query','/e/','name','\x20\x20tdx\x20sg\x20sql\x20\x22Premium\x20Users\x22','Error:\x20Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.','Resolved\x20type:\x20','SEGMENT_FOLDER_NOT_FOUND','segment:folder:show','code','\x20\x20Cause:\x20','SEGMENT_NOT_FOUND','Show\x20folder\x20or\x20child\x20segment\x20details','trim','parentId','List\x20segment\x20folders\x20under\x20a\x20parent\x20segment','1218026hvcYEQ','stats','βœ”\x20Found\x20','Resolved\x20relative\x20path\x20to:\x20','data','segment:view','SELECT\x20*\x20FROM\x20(\x0a','getSegment','fullPath','Resolving\x20parent\x20segment\x20\x27','Usage:\x20tdx\x20sg\x20show\x20<name>','Resolved\x20parent\x20folder\x20ID:\x20'];a31_0x1ed4=function(){return _0x2545df;};return a31_0x1ed4();}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 a31_0xe2ca85 from'chalk';async function resolveSegmentTarget(_0x35e45f,_0x5efd87,_0x451060){const _0x10e7cc=a31_0x5c0d;if(isYamlFilePath(_0x35e45f))try{const _0x5b09fa=await resolveYamlFilePath(_0x35e45f);return _0x451060&&(console[_0x10e7cc(0x144)](_0x10e7cc(0x143)+_0x35e45f),console[_0x10e7cc(0x144)]('\x20\x20Parent\x20segment:\x20'+_0x5b09fa[_0x10e7cc(0x142)]),console[_0x10e7cc(0x144)](_0x10e7cc(0xf0)+_0x5b09fa[_0x10e7cc(0xed)]),console['error'](_0x10e7cc(0x132)+(_0x5b09fa[_0x10e7cc(0x125)]||_0x10e7cc(0xff))),console['error']('\x20\x20Full\x20path:\x20'+_0x5b09fa['fullPath'])),_0x5b09fa[_0x10e7cc(0x117)];}catch(_0x2d525c){throw new SDKError(ErrorCode[_0x10e7cc(0xb9)],_0x10e7cc(0xd6)+_0x2d525c[_0x10e7cc(0x13f)]);}if(!_0x5efd87)throw new SDKError(ErrorCode[_0x10e7cc(0xb9)],_0x10e7cc(0xe8));return _0x5efd87+'/'+_0x35e45f;}export class SegmentDescribeCommand extends BaseCommand{[a31_0x21cbf2(0x102)]=a31_0x21cbf2(0xea);[a31_0x21cbf2(0x11e)]=a31_0x21cbf2(0xcf);async['execute'](_0x5d6397){const _0x14c2e9=a31_0x21cbf2,{options:_0x1127ce,args:_0x2994a0,tdx:_0xa1ecb0}=_0x5d6397,_0x434041=_0x2994a0[0x0],_0x227fb9=!_0x434041&&!!_0x1127ce[_0x14c2e9(0x142)],_0x98bd3=_0x434041||_0x1127ce[_0x14c2e9(0x142)];if(!_0x98bd3)return console[_0x14c2e9(0x144)](_0x14c2e9(0xb3)),console['error'](_0x14c2e9(0xcb)),console['error'](_0x14c2e9(0x129)),console['error'](_0x14c2e9(0xf4)),console[_0x14c2e9(0x144)](_0x14c2e9(0x124)),console['error']('\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context'),console[_0x14c2e9(0x144)](_0x14c2e9(0xb7)),0x1;try{const _0x1214bf=_0x1127ce['segmentPath'];let _0x27eccb=_0x98bd3;!_0x227fb9&&_0x1214bf&&!_0x98bd3[_0x14c2e9(0x13a)]('/')&&(_0x27eccb=_0x1214bf+'/'+_0x98bd3,_0x1127ce['verbose']&&console[_0x14c2e9(0x144)](_0x14c2e9(0x112)+_0x27eccb));const _0x31db2c=await withSpinner(_0x14c2e9(0xc5)+_0x27eccb+'\x27...',()=>_0xa1ecb0[_0x14c2e9(0xf2)]['resolvePathToResource'](_0x27eccb),{'verbose':_0x1127ce[_0x14c2e9(0xeb)]}),_0x37ecb7=_0x31db2c[_0x14c2e9(0x113)];_0x1127ce[_0x14c2e9(0xeb)]&&(console[_0x14c2e9(0x144)](_0x14c2e9(0x105)+_0x37ecb7[_0x14c2e9(0xc6)]),console['error']('Parent\x20ID:\x20'+_0x37ecb7[_0x14c2e9(0x10d)]),_0x37ecb7[_0x14c2e9(0x126)]&&console[_0x14c2e9(0x144)](_0x14c2e9(0xfd)+_0x37ecb7[_0x14c2e9(0x126)]),_0x37ecb7[_0x14c2e9(0xab)]&&console[_0x14c2e9(0x144)](_0x14c2e9(0xc4)+_0x37ecb7[_0x14c2e9(0xab)]));if(_0x37ecb7[_0x14c2e9(0xc6)]===_0x14c2e9(0xf7)){const _0x1557de=await withSpinner('Fetching\x20parent\x20segment\x20details...',()=>_0xa1ecb0[_0x14c2e9(0xf2)][_0x14c2e9(0xbe)](_0x37ecb7[_0x14c2e9(0x10d)]),{'verbose':_0x1127ce[_0x14c2e9(0xeb)]});await handleSingleObjectOutput(_0x1557de[_0x14c2e9(0x113)],_0x1127ce);}else{if(_0x37ecb7['type']===_0x14c2e9(0xb8)){if(!_0x37ecb7[_0x14c2e9(0x126)])throw new SDKError(ErrorCode[_0x14c2e9(0x106)],'Folder\x20ID\x20missing\x20from\x20resolved\x20path');const _0x4a72d6=await withSpinner('Fetching\x20folder\x20details...',()=>_0xa1ecb0[_0x14c2e9(0xf2)][_0x14c2e9(0x134)](_0x37ecb7[_0x14c2e9(0x126)]),{'verbose':_0x1127ce[_0x14c2e9(0xeb)]});await handleSingleObjectOutput(_0x4a72d6[_0x14c2e9(0x113)],_0x1127ce);}else{if(_0x37ecb7[_0x14c2e9(0xc6)]===_0x14c2e9(0xf2)){if(!_0x37ecb7[_0x14c2e9(0xab)])throw new SDKError(ErrorCode[_0x14c2e9(0x10a)],_0x14c2e9(0xc8));const _0x29d319=await withSpinner(_0x14c2e9(0xf8),()=>_0xa1ecb0[_0x14c2e9(0xf2)]['getSegment'](_0x37ecb7[_0x14c2e9(0x10d)],_0x37ecb7['segmentId']),{'verbose':_0x1127ce[_0x14c2e9(0xeb)]});await handleSingleObjectOutput(_0x29d319[_0x14c2e9(0x113)],_0x1127ce);}}}return 0x0;}catch(_0x3b27b9){if(_0x3b27b9 instanceof SDKError)return console['error'](_0x14c2e9(0xd2)+_0x3b27b9[_0x14c2e9(0x13f)]),_0x3b27b9[_0x14c2e9(0x140)]&&console[_0x14c2e9(0x144)](_0x14c2e9(0x109)+_0x3b27b9['cause']),0x1;throw _0x3b27b9;}}}export class SegmentShowCommand extends BaseCommand{[a31_0x21cbf2(0x102)]=a31_0x21cbf2(0xdc);[a31_0x21cbf2(0x11e)]='Execute\x20child\x20segment\x20SQL\x20query\x20and\x20show\x20results';async[a31_0x21cbf2(0xdd)](_0x92d7dc){const _0x5cc12b=a31_0x21cbf2,{options:_0x329f20,args:_0x216e8a,tdx:_0x4646e9}=_0x92d7dc,_0x194847=_0x216e8a[0x0];if(!_0x194847)return console['error'](_0x5cc12b(0xc2)),console[_0x5cc12b(0x144)](_0x5cc12b(0x119)),console['error'](_0x5cc12b(0x13d)),console['error']('Examples:'),console[_0x5cc12b(0x144)](_0x5cc12b(0xba)),console[_0x5cc12b(0x144)]('\x20\x20tdx\x20sg\x20show\x20segments/my-audience/premium-users.yml'),0x1;try{const _0x417c65=_0x329f20[_0x5cc12b(0x142)],_0x3e519c=await resolveSegmentTarget(_0x194847,_0x417c65,_0x329f20[_0x5cc12b(0xeb)]);_0x329f20[_0x5cc12b(0xeb)]&&console[_0x5cc12b(0x144)](_0x5cc12b(0xf9)+_0x3e519c);const _0x23b42c=await withSpinner(_0x5cc12b(0xb4)+_0x194847+_0x5cc12b(0xe2),()=>_0x4646e9[_0x5cc12b(0xf2)][_0x5cc12b(0x12f)](_0x3e519c),{'verbose':_0x329f20[_0x5cc12b(0xeb)]}),_0x5c5e04=_0x23b42c[_0x5cc12b(0x113)];_0x329f20[_0x5cc12b(0xeb)]&&(console['error'](_0x5cc12b(0x105)+_0x5c5e04[_0x5cc12b(0xc6)]),console[_0x5cc12b(0x144)](_0x5cc12b(0xf3)+_0x5c5e04[_0x5cc12b(0x10d)]));if(_0x5c5e04[_0x5cc12b(0xc6)]===_0x5cc12b(0xb8))return console[_0x5cc12b(0x144)](_0x5cc12b(0xc7)),console[_0x5cc12b(0x144)](_0x5cc12b(0xb0)),0x1;if(_0x5c5e04[_0x5cc12b(0xc6)]===_0x5cc12b(0xf7))return console[_0x5cc12b(0x144)]('Error:\x20Cannot\x20execute\x20query\x20for\x20parent\x20segment\x20with\x20this\x20command.'),console[_0x5cc12b(0x144)]('Use:\x20tdx\x20ps\x20show'),0x1;if(!_0x5c5e04[_0x5cc12b(0xab)])throw new SDKError(ErrorCode[_0x5cc12b(0x10a)],_0x5cc12b(0xc8));const _0x20885b=await withSpinner(_0x5cc12b(0x12e),()=>_0x4646e9[_0x5cc12b(0xf2)][_0x5cc12b(0xd0)](_0x5c5e04[_0x5cc12b(0x10d)],_0x5c5e04[_0x5cc12b(0xab)]),{'verbose':_0x329f20[_0x5cc12b(0xeb)]});let _0x33d8ad=_0x20885b['data'];const _0x1e11d9=resolveLimit(_0x329f20[_0x5cc12b(0xce)],DEFAULT_DISPLAY_LIMIT),_0x206f36=/\bLIMIT\s+\d+/i['test'](_0x33d8ad);!_0x206f36&&(_0x33d8ad=_0x33d8ad[_0x5cc12b(0x10c)]()[_0x5cc12b(0x122)](/;+$/,''),_0x33d8ad=_0x5cc12b(0x115)+_0x33d8ad+'\x0a)\x20AS\x20segment_query\x0aLIMIT\x20'+_0x1e11d9);_0x329f20['verbose']&&console[_0x5cc12b(0x144)](_0x5cc12b(0xe7)+_0x33d8ad);const _0x4a3036=await withProgressSpinner(_0x5cc12b(0xda),async _0x420677=>{const _0x371317=_0x5cc12b,_0x470657=await _0x4646e9[_0x371317(0x100)][_0x371317(0xdd)](_0x33d8ad,{'catalog':'td','schema':_0x371317(0x131),'onJobId':_0x2bf59b=>{const _0x292afc=_0x371317;_0x420677[_0x292afc(0xae)](_0x2bf59b);}});return _0x470657;},{'verbose':_0x329f20[_0x5cc12b(0xeb)]}),_0x5dfd4f=_0x4a3036[_0x5cc12b(0x113)],_0x3737d2=_0x5dfd4f[_0x5cc12b(0xbd)]?_0x5cc12b(0x12b)+_0x5dfd4f[_0x5cc12b(0xbd)]+']':'';return console[_0x5cc12b(0x144)](_0x5cc12b(0x123)+_0x5dfd4f[_0x5cc12b(0x110)]['processedRows'][_0x5cc12b(0x11c)]()+_0x5cc12b(0x138)+(_0x5cc12b(0x12a)+formatElapsed(_0x5dfd4f[_0x5cc12b(0x110)]['elapsedTimeMillis'])+_0x3737d2)),await handleQueryOutput(_0x5dfd4f,_0x329f20),0x0;}catch(_0x3198ab){if(_0x3198ab instanceof SDKError)return console[_0x5cc12b(0x144)]('βœ–\x20Query\x20failed\x20['+_0x3198ab[_0x5cc12b(0x108)]+']'),console[_0x5cc12b(0x144)]('\x0a'+_0x3198ab[_0x5cc12b(0x13f)]),0x1;throw _0x3198ab;}}}export class SegmentFolderListCommand extends BaseCommand{[a31_0x21cbf2(0x102)]=a31_0x21cbf2(0x128);[a31_0x21cbf2(0x11e)]=a31_0x21cbf2(0x10e);async[a31_0x21cbf2(0xdd)](_0x50e32f){const _0x3dc20d=a31_0x21cbf2,{options:_0x3874c0,args:_0x2554a3,tdx:_0x2df849}=_0x50e32f;if(_0x2554a3[_0x3dc20d(0xc0)]===0x0)return console['error']('Error:\x20Parent\x20segment\x20name\x20is\x20required'),console[_0x3dc20d(0x144)](_0x3dc20d(0xe9)),0x1;const _0x28cf8a=_0x2554a3[0x0];try{_0x3874c0[_0x3dc20d(0xeb)]&&(console['error'](_0x3dc20d(0xe0)+_0x3874c0[_0x3dc20d(0xaf)]),console[_0x3dc20d(0x144)](_0x3dc20d(0xb2)+_0x28cf8a));const _0x29cfd0=await withSpinner(_0x3dc20d(0x118)+_0x28cf8a+_0x3dc20d(0xe2),()=>_0x2df849['segment'][_0x3dc20d(0xc3)](_0x28cf8a),{'verbose':_0x3874c0['verbose']}),_0x4bf86c=_0x29cfd0[_0x3dc20d(0x113)];_0x3874c0[_0x3dc20d(0xeb)]&&console[_0x3dc20d(0x144)]('Resolved\x20parent\x20ID:\x20'+_0x4bf86c);const _0x31d929=await withSpinner(_0x3dc20d(0xc9)+_0x28cf8a+_0x3dc20d(0xe2),()=>_0x2df849[_0x3dc20d(0xf2)][_0x3dc20d(0xfe)](_0x4bf86c),{'verbose':_0x3874c0[_0x3dc20d(0xeb)]}),_0x41b0db=_0x31d929['data'];return console['error'](_0x3dc20d(0x111)+_0x41b0db[_0x3dc20d(0xc0)]+_0x3dc20d(0xf6)+(_0x41b0db[_0x3dc20d(0xc0)]!==0x1?'s':'')),await handleSDKOutput(_0x41b0db,_0x3874c0),0x0;}catch(_0x28c1f5){if(_0x28c1f5 instanceof SDKError)return console[_0x3dc20d(0x144)](_0x3dc20d(0xd2)+_0x28c1f5[_0x3dc20d(0x13f)]),_0x28c1f5[_0x3dc20d(0x140)]&&console[_0x3dc20d(0x144)](_0x3dc20d(0x109)+_0x28c1f5[_0x3dc20d(0x140)]),0x1;throw _0x28c1f5;}}}export class SegmentFolderShowCommand extends BaseCommand{[a31_0x21cbf2(0x102)]=a31_0x21cbf2(0x107);[a31_0x21cbf2(0x11e)]='Show\x20segment\x20folder\x20details';async[a31_0x21cbf2(0xdd)](_0xe5fc2d){const _0x3137d6=a31_0x21cbf2,{options:_0x207941,args:_0x34b1fc,tdx:_0x631bd0}=_0xe5fc2d;if(_0x34b1fc['length']===0x0)return console['error'](_0x3137d6(0xac)),console[_0x3137d6(0x144)](_0x3137d6(0xb5)),0x1;try{const {parentId:_0x5c508d,childId:_0x7f4ba7}=parseSegmentRef(_0x34b1fc[0x0]);_0x207941['verbose']&&(console[_0x3137d6(0x144)](_0x3137d6(0xe0)+_0x207941[_0x3137d6(0xaf)]),console[_0x3137d6(0x144)]('Parent\x20name:\x20'+_0x5c508d),_0x7f4ba7&&console['error'](_0x3137d6(0xca)+_0x7f4ba7));if(!_0x7f4ba7)return console[_0x3137d6(0x144)]('Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)'),0x1;const _0x141a36=await withSpinner(_0x3137d6(0x118)+_0x5c508d+_0x3137d6(0xe2),()=>_0x631bd0[_0x3137d6(0xf2)][_0x3137d6(0xc3)](_0x5c508d),{'verbose':_0x207941[_0x3137d6(0xeb)]}),_0x359bd7=_0x141a36[_0x3137d6(0x113)];_0x207941[_0x3137d6(0xeb)]&&console['error'](_0x3137d6(0x13c)+_0x359bd7);const _0x38a12b=await withSpinner(_0x3137d6(0x127)+_0x7f4ba7+_0x3137d6(0xe2),()=>_0x631bd0[_0x3137d6(0xf2)]['resolveFolderId'](_0x359bd7,_0x7f4ba7),{'verbose':_0x207941[_0x3137d6(0xeb)]}),_0x52e309=_0x38a12b[_0x3137d6(0x113)];_0x207941[_0x3137d6(0xeb)]&&console['error'](_0x3137d6(0xc1)+_0x52e309);const _0x121414=await withSpinner(_0x3137d6(0xb6)+_0x7f4ba7+'\x27...',()=>_0x631bd0['segment'][_0x3137d6(0x134)](_0x52e309),{'verbose':_0x207941[_0x3137d6(0xeb)]});return await handleSDKOutput([_0x121414['data']],_0x207941),0x0;}catch(_0x2b8956){if(_0x2b8956 instanceof SDKError)return console[_0x3137d6(0x144)]('Error:\x20'+_0x2b8956[_0x3137d6(0x13f)]),_0x2b8956[_0x3137d6(0x140)]&&console[_0x3137d6(0x144)](_0x3137d6(0x109)+_0x2b8956[_0x3137d6(0x140)]),0x1;throw _0x2b8956;}}}export class SegmentSQLCommand extends BaseCommand{['name']='segment:sql';[a31_0x21cbf2(0x11e)]=a31_0x21cbf2(0xd9);async[a31_0x21cbf2(0xdd)](_0x327522){const _0x3390cd=a31_0x21cbf2,{options:_0x3c4a10,args:_0x513845,tdx:_0x2bd91a}=_0x327522,_0x323838=_0x513845[0x0];if(!_0x323838)return console[_0x3390cd(0x144)](_0x3390cd(0xc2)),console['error'](_0x3390cd(0x13e)),console['error'](_0x3390cd(0xf1)),console[_0x3390cd(0x144)](_0x3390cd(0x129)),console[_0x3390cd(0x144)](_0x3390cd(0x103)),console[_0x3390cd(0x144)](_0x3390cd(0xde)),0x1;try{const _0x3e37e9=_0x3c4a10[_0x3390cd(0x142)],_0x446969=await resolveSegmentTarget(_0x323838,_0x3e37e9,_0x3c4a10[_0x3390cd(0xeb)]);_0x3c4a10[_0x3390cd(0xeb)]&&console[_0x3390cd(0x144)](_0x3390cd(0xf9)+_0x446969);const _0x1c5a56=await withSpinner(_0x3390cd(0xb4)+_0x323838+_0x3390cd(0xe2),()=>_0x2bd91a[_0x3390cd(0xf2)][_0x3390cd(0x12f)](_0x446969),{'verbose':_0x3c4a10[_0x3390cd(0xeb)]}),_0x130a06=_0x1c5a56[_0x3390cd(0x113)];_0x3c4a10[_0x3390cd(0xeb)]&&(console['error']('Resolved\x20type:\x20'+_0x130a06[_0x3390cd(0xc6)]),console['error'](_0x3390cd(0xf3)+_0x130a06[_0x3390cd(0x10d)]));if(_0x130a06['type']===_0x3390cd(0xb8))return console['error'](_0x3390cd(0x104)),console[_0x3390cd(0x144)](_0x3390cd(0x11f)),0x1;if(_0x130a06['type']===_0x3390cd(0xf7))return console[_0x3390cd(0x144)](_0x3390cd(0xcd)),console[_0x3390cd(0x144)]('Use:\x20tdx\x20ps\x20sql'),0x1;if(!_0x130a06['segmentId'])throw new SDKError(ErrorCode[_0x3390cd(0x10a)],_0x3390cd(0xc8));const _0x44c5a8=await withSpinner(_0x3390cd(0x12e),()=>_0x2bd91a[_0x3390cd(0xf2)][_0x3390cd(0xd0)](_0x130a06[_0x3390cd(0x10d)],_0x130a06[_0x3390cd(0xab)]),{'verbose':_0x3c4a10[_0x3390cd(0xeb)]}),_0x520931=_0x44c5a8['data'];return _0x3c4a10[_0x3390cd(0xe5)]===_0x3390cd(0xdb)||_0x3c4a10['format']===_0x3390cd(0x133)?await handleSDKOutput([{'sql':_0x520931}],_0x3c4a10):console['log'](_0x520931),0x0;}catch(_0x5c091e){if(_0x5c091e instanceof SDKError)return console[_0x3390cd(0x144)](_0x3390cd(0xd2)+_0x5c091e[_0x3390cd(0x13f)]),_0x5c091e['cause']&&console[_0x3390cd(0x144)]('\x20\x20Cause:\x20'+_0x5c091e['cause']),0x1;throw _0x5c091e;}}}export class SegmentFolderCreateCommand extends BaseCommand{['name']='segment:folder:create';[a31_0x21cbf2(0x11e)]=a31_0x21cbf2(0xfa);async[a31_0x21cbf2(0xdd)](_0x2abee5){const _0x2fd7b5=a31_0x21cbf2,{options:_0x3285d5,args:_0x83cfaf,tdx:_0x5b9dce}=_0x2abee5,_0x546edc=_0x3285d5;if(_0x83cfaf['length']<0x2)return console['error'](_0x2fd7b5(0xdf)),console[_0x2fd7b5(0x144)](_0x2fd7b5(0xec)),0x1;const _0x268317=_0x83cfaf[0x0],_0x45785d=_0x83cfaf[0x1];_0x546edc[_0x2fd7b5(0xeb)]&&(console[_0x2fd7b5(0x144)]('Site:\x20'+_0x546edc[_0x2fd7b5(0xaf)]),console['error'](_0x2fd7b5(0xe3)+_0x268317),console[_0x2fd7b5(0x144)]('Folder\x20name:\x20'+_0x45785d));let _0x581c15;if(_0x546edc['parentFolder']){const _0x37803e=_0x546edc[_0x2fd7b5(0x121)],_0x4d312e=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x268317+_0x2fd7b5(0xe2),()=>_0x5b9dce[_0x2fd7b5(0xf2)][_0x2fd7b5(0xc3)](_0x268317),{'verbose':_0x546edc[_0x2fd7b5(0xeb)]}),_0x1e4302=_0x4d312e[_0x2fd7b5(0x113)],_0x5896bb=await withSpinner('Resolving\x20parent\x20folder\x20\x27'+_0x37803e+_0x2fd7b5(0xe2),()=>_0x5b9dce[_0x2fd7b5(0xf2)][_0x2fd7b5(0xfc)](_0x1e4302,_0x37803e),{'verbose':_0x546edc[_0x2fd7b5(0xeb)]});_0x581c15=_0x5896bb[_0x2fd7b5(0x113)],_0x546edc['verbose']&&console[_0x2fd7b5(0x144)](_0x2fd7b5(0x11a)+_0x581c15);}const _0x5cc179={'name':_0x45785d,'description':_0x546edc[_0x2fd7b5(0x11e)],'parentFolderId':_0x581c15},_0x3f975f=await withSpinner(_0x2fd7b5(0x137)+_0x45785d+_0x2fd7b5(0xe2),()=>_0x5b9dce[_0x2fd7b5(0xf2)][_0x2fd7b5(0xd1)](_0x268317,_0x5cc179),{'verbose':_0x546edc[_0x2fd7b5(0xeb)]}),_0x187f2b=_0x3f975f[_0x2fd7b5(0x113)];return console[_0x2fd7b5(0x144)](_0x2fd7b5(0x141)+_0x187f2b[_0x2fd7b5(0x102)]+_0x2fd7b5(0xef)+_0x187f2b['id']),await handleSDKOutput([_0x187f2b],_0x546edc),0x0;}}export class SegmentViewCommand extends BaseCommand{['name']=a31_0x21cbf2(0x114);[a31_0x21cbf2(0x11e)]=a31_0x21cbf2(0x10b);async[a31_0x21cbf2(0xdd)](_0x54c2b4){const _0x52a050=a31_0x21cbf2,{options:_0x45a849,args:_0x45ba91,tdx:_0x4d23a2}=_0x54c2b4,_0x56bd1e=_0x45ba91[0x0];if(!_0x56bd1e)return console[_0x52a050(0x144)](_0x52a050(0xd4)),console['error'](_0x52a050(0xd7)),console[_0x52a050(0x144)](_0x52a050(0xcc)),console['error'](_0x52a050(0x136)),console[_0x52a050(0x144)](_0x52a050(0xd8)),console['error']('Examples:'),console[_0x52a050(0x144)](_0x52a050(0xad)),console['error']('\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20\x20\x20\x20\x20#\x20View\x20child\x20segment\x20details'),console[_0x52a050(0x144)]('\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20-w\x20\x20#\x20Open\x20segment\x20in\x20web\x20browser'),console[_0x52a050(0x144)](_0x52a050(0xd5)),0x1;try{const _0x466fcb=_0x45a849[_0x52a050(0x142)],_0x387554=await resolveSegmentTarget(_0x56bd1e,_0x466fcb,_0x45a849[_0x52a050(0xeb)]);_0x45a849[_0x52a050(0xeb)]&&console[_0x52a050(0x144)](_0x52a050(0xf9)+_0x387554);const _0xd56931=await withSpinner(_0x52a050(0xb4)+_0x56bd1e+_0x52a050(0xe2),()=>_0x4d23a2[_0x52a050(0xf2)][_0x52a050(0x12f)](_0x387554),{'verbose':_0x45a849['verbose']}),_0x1d9aa4=_0xd56931[_0x52a050(0x113)];_0x45a849[_0x52a050(0xeb)]&&(console[_0x52a050(0x144)](_0x52a050(0x105)+_0x1d9aa4[_0x52a050(0xc6)]),console[_0x52a050(0x144)]('Parent\x20ID:\x20'+_0x1d9aa4[_0x52a050(0x10d)]),_0x1d9aa4[_0x52a050(0x126)]&&console[_0x52a050(0x144)](_0x52a050(0xfd)+_0x1d9aa4[_0x52a050(0x126)]),_0x1d9aa4[_0x52a050(0xab)]&&console[_0x52a050(0x144)](_0x52a050(0xc4)+_0x1d9aa4[_0x52a050(0xab)]));if(_0x45a849['web']){if(_0x1d9aa4[_0x52a050(0xc6)]===_0x52a050(0xb8))return console[_0x52a050(0x144)]('Error:\x20Cannot\x20open\x20folder\x20in\x20web\x20browser.\x20Use\x20a\x20segment\x20name\x20instead.'),0x1;if(_0x1d9aa4[_0x52a050(0xc6)]===_0x52a050(0xf7))return console[_0x52a050(0x144)]('Error:\x20Cannot\x20open\x20parent\x20segment\x20with\x20this\x20command.'),console[_0x52a050(0x144)](_0x52a050(0xb1)),0x1;if(!_0x1d9aa4[_0x52a050(0xab)])throw new SDKError(ErrorCode[_0x52a050(0x10a)],_0x52a050(0xc8));const _0x2fdb03=getConsoleNextUrl(_0x45a849[_0x52a050(0xaf)],_0x52a050(0xfb)+_0x1d9aa4['parentId']+_0x52a050(0x101)+_0x1d9aa4[_0x52a050(0xab)]);return console[_0x52a050(0x144)](a31_0xe2ca85[_0x52a050(0xe6)]('βœ”')+'\x20Opening\x20'+a31_0xe2ca85['cyan'](_0x2fdb03)),openBrowser(_0x2fdb03),0x0;}if(_0x1d9aa4[_0x52a050(0xc6)]===_0x52a050(0xb8)){if(!_0x1d9aa4[_0x52a050(0x126)])throw new SDKError(ErrorCode['SEGMENT_FOLDER_NOT_FOUND'],_0x52a050(0xe1));const _0x57868d=await withSpinner(_0x52a050(0x12c),()=>_0x4d23a2[_0x52a050(0xf2)][_0x52a050(0x134)](_0x1d9aa4['folderId']),{'verbose':_0x45a849[_0x52a050(0xeb)]});await handleSingleObjectOutput(_0x57868d[_0x52a050(0x113)],_0x45a849);}else{if(_0x1d9aa4['type']===_0x52a050(0xf2)){if(!_0x1d9aa4['segmentId'])throw new SDKError(ErrorCode[_0x52a050(0x10a)],_0x52a050(0xc8));const _0x37f171=await withSpinner(_0x52a050(0xf8),()=>_0x4d23a2['segment'][_0x52a050(0x116)](_0x1d9aa4[_0x52a050(0x10d)],_0x1d9aa4['segmentId']),{'verbose':_0x45a849[_0x52a050(0xeb)]}),_0x311961=getConsoleNextUrl(_0x45a849[_0x52a050(0xaf)],'/app/ps/'+_0x1d9aa4[_0x52a050(0x10d)]+'/e/'+_0x1d9aa4['segmentId']),_0x41352b=_0x37f171[_0x52a050(0x113)];_0x41352b['url']=_0x311961,await handleSingleObjectOutput(_0x41352b,_0x45a849);}else return console[_0x52a050(0x144)]('Error:\x20Cannot\x20view\x20parent\x20segment\x20details\x20with\x20this\x20command.'),console['error'](_0x52a050(0x12d)),0x1;}return 0x0;}catch(_0x40efda){if(_0x40efda instanceof SDKError)return console[_0x52a050(0x144)](_0x52a050(0xd2)+_0x40efda[_0x52a050(0x13f)]),_0x40efda[_0x52a050(0x140)]&&console[_0x52a050(0x144)](_0x52a050(0x109)+_0x40efda[_0x52a050(0x140)]),0x1;throw _0x40efda;}}}export const SegmentInfoCommand=SegmentViewCommand;export class SegmentDescCommand extends BaseCommand{[a31_0x21cbf2(0x102)]=a31_0x21cbf2(0xd3);[a31_0x21cbf2(0x11e)]='Show\x20child\x20segment\x20schema\x20(column\x20types)';async['execute'](_0x307b3d){const _0x123a3e=a31_0x21cbf2,{options:_0x48b59f,args:_0x13a944,tdx:_0x10a131}=_0x307b3d,_0x384aba=_0x13a944[0x0];if(!_0x384aba)return console[_0x123a3e(0x144)](_0x123a3e(0xc2)),console[_0x123a3e(0x144)](_0x123a3e(0xbb)),console[_0x123a3e(0x144)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20desc\x20<path/to/segment.yml>'),console[_0x123a3e(0x144)](_0x123a3e(0x129)),console['error']('\x20\x20tdx\x20sg\x20desc\x20\x22Premium\x20Users\x22'),console[_0x123a3e(0x144)]('\x20\x20tdx\x20sg\x20desc\x20segments/my-audience/premium-users.yml'),0x1;try{const _0x39b24b=_0x48b59f[_0x123a3e(0x142)],_0x54fac3=await resolveSegmentTarget(_0x384aba,_0x39b24b,_0x48b59f[_0x123a3e(0xeb)]);_0x48b59f[_0x123a3e(0xeb)]&&console[_0x123a3e(0x144)](_0x123a3e(0xf9)+_0x54fac3);const _0x6ed541=await withSpinner('Resolving\x20\x27'+_0x384aba+_0x123a3e(0xe2),()=>_0x10a131[_0x123a3e(0xf2)][_0x123a3e(0x12f)](_0x54fac3),{'verbose':_0x48b59f[_0x123a3e(0xeb)]}),_0x3ebee7=_0x6ed541['data'];_0x48b59f[_0x123a3e(0xeb)]&&(console[_0x123a3e(0x144)](_0x123a3e(0x105)+_0x3ebee7[_0x123a3e(0xc6)]),console[_0x123a3e(0x144)]('Parent\x20ID:\x20'+_0x3ebee7['parentId']));if(_0x3ebee7[_0x123a3e(0xc6)]===_0x123a3e(0xb8))return console['error'](_0x123a3e(0x135)),console['error'](_0x123a3e(0x11f)),0x1;if(_0x3ebee7[_0x123a3e(0xc6)]===_0x123a3e(0xf7))return console[_0x123a3e(0x144)]('Error:\x20Cannot\x20show\x20schema\x20for\x20parent\x20segment\x20with\x20this\x20command.'),console[_0x123a3e(0x144)](_0x123a3e(0x120)),0x1;if(!_0x3ebee7[_0x123a3e(0xab)])throw new SDKError(ErrorCode[_0x123a3e(0x10a)],_0x123a3e(0xc8));const _0x418e18=await withSpinner(_0x123a3e(0x12e),()=>_0x10a131['segment'][_0x123a3e(0xd0)](_0x3ebee7['parentId'],_0x3ebee7[_0x123a3e(0xab)]),{'verbose':_0x48b59f[_0x123a3e(0xeb)]}),_0x1f40b0=_0x418e18[_0x123a3e(0x113)],_0x48fa33=await executeSchemaQuery(_0x1f40b0,_0x10a131,_0x48b59f);return await handleQueryOutput(_0x48fa33,_0x48b59f),0x0;}catch(_0x2ee6d0){if(_0x2ee6d0 instanceof SDKError)return console[_0x123a3e(0x144)](_0x123a3e(0xd2)+_0x2ee6d0[_0x123a3e(0x13f)]),_0x2ee6d0[_0x123a3e(0x140)]&&console[_0x123a3e(0x144)](_0x123a3e(0x109)+_0x2ee6d0[_0x123a3e(0x140)]),0x1;throw _0x2ee6d0;}}}
@@ -1 +1 @@
1
- function a32_0x6647(_0x5e8323,_0xee7459){_0x5e8323=_0x5e8323-0x1f3;const _0x2e72bb=a32_0x2e72();let _0x6647ba=_0x2e72bb[_0x5e8323];return _0x6647ba;}const a32_0x5f369d=a32_0x6647;(function(_0x4fbe99,_0x1c5b43){const _0x202c3c=a32_0x6647,_0x1fe56e=_0x4fbe99();while(!![]){try{const _0x1fbabe=parseInt(_0x202c3c(0x1f3))/0x1+parseInt(_0x202c3c(0x218))/0x2+-parseInt(_0x202c3c(0x20d))/0x3+parseInt(_0x202c3c(0x20e))/0x4*(-parseInt(_0x202c3c(0x200))/0x5)+-parseInt(_0x202c3c(0x21d))/0x6*(parseInt(_0x202c3c(0x201))/0x7)+parseInt(_0x202c3c(0x215))/0x8*(parseInt(_0x202c3c(0x211))/0x9)+-parseInt(_0x202c3c(0x203))/0xa*(-parseInt(_0x202c3c(0x213))/0xb);if(_0x1fbabe===_0x1c5b43)break;else _0x1fe56e['push'](_0x1fe56e['shift']());}catch(_0x50b0f4){_0x1fe56e['push'](_0x1fe56e['shift']());}}}(a32_0x2e72,0x8f0c8));function a32_0x2e72(){const _0x258956=['1510530otoKLG','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','folder','data','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27','length','noCountPopulation','Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)','site','folderId','372423Svnwuw','54596DhHZmi','segment','parent','1103076qiCeVh','Resolving\x20folder\x20\x27','11QcoMmR','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27','40suYkgD','ruleFile','\x27...','36360fEOLgt','Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]','βœ”\x20Created\x20segment\x20\x27','Examples:','description','658518GbwOAe','Resolved\x20relative\x20path\x20to:\x20','includes','Create\x20child\x20segment\x20with\x20filtering\x20rules','Site:\x20','597939UDscJT','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','name','resolveFolderId','createSegment','Resolved\x20folder\x20ID:\x20','segments','yellow','resolveParentId','error','type','Segment\x20name:\x20','verbose','165GfyMQp','14aydslR','Parent\x20path:\x20'];a32_0x2e72=function(){return _0x258956;};return a32_0x2e72();}import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{parsePath,getParentPath,getBaseName}from'../sdk/segment/segment-path-parser.js';import a32_0x2c29bc from'chalk';export class SegmentCreateCommand extends BaseCommand{[a32_0x5f369d(0x1f5)]='segment:create';[a32_0x5f369d(0x21c)]=a32_0x5f369d(0x220);async['execute'](_0x332a66){const _0x35d56b=a32_0x5f369d;console[_0x35d56b(0x1fc)](a32_0x2c29bc[_0x35d56b(0x1fa)]('⚠\x20Deprecation\x20warning:\x20`segment\x20create`\x20is\x20deprecated.')),console[_0x35d56b(0x1fc)](a32_0x2c29bc['yellow'](_0x35d56b(0x1f4)));const {options:_0x4d292e,args:_0x5eec42,tdx:_0x14d930}=_0x332a66,_0x46290a=_0x4d292e;if(_0x5eec42[_0x35d56b(0x208)]===0x0)return console[_0x35d56b(0x1fc)](_0x35d56b(0x204)),console[_0x35d56b(0x1fc)](_0x35d56b(0x219)),console[_0x35d56b(0x1fc)](_0x35d56b(0x21b)),console[_0x35d56b(0x1fc)](_0x35d56b(0x214)),console[_0x35d56b(0x1fc)](_0x35d56b(0x207)),console[_0x35d56b(0x1fc)]('\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context'),0x1;const _0x5c75cc=_0x5eec42[0x0],_0x10c13f=_0x4d292e['segmentPath'];let _0x27a717=_0x5c75cc;_0x10c13f&&!_0x5c75cc[_0x35d56b(0x21f)]('/')&&(_0x27a717=_0x10c13f+'/'+_0x5c75cc,_0x46290a[_0x35d56b(0x1ff)]&&console[_0x35d56b(0x1fc)](_0x35d56b(0x21e)+_0x27a717));const _0x354ab2=parsePath(_0x27a717);if(_0x354ab2['segments'][_0x35d56b(0x208)]<0x2)return console[_0x35d56b(0x1fc)](_0x35d56b(0x20a)),console[_0x35d56b(0x1fc)]('Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]'),0x1;const _0x410a19=_0x354ab2['segments'][0x0],_0x52bdce=getBaseName(_0x27a717),_0x4572ba=getParentPath(_0x27a717);_0x46290a[_0x35d56b(0x1ff)]&&(console[_0x35d56b(0x1fc)](_0x35d56b(0x221)+_0x46290a[_0x35d56b(0x20b)]),console[_0x35d56b(0x1fc)]('Target\x20path:\x20'+_0x27a717),console[_0x35d56b(0x1fc)]('Parent:\x20'+_0x410a19),console[_0x35d56b(0x1fc)](_0x35d56b(0x1fe)+_0x52bdce),console[_0x35d56b(0x1fc)](_0x35d56b(0x202)+_0x4572ba));const _0x40a2a2=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x410a19+_0x35d56b(0x217),()=>_0x14d930[_0x35d56b(0x20f)][_0x35d56b(0x1fb)](_0x410a19),{'verbose':_0x46290a[_0x35d56b(0x1ff)]}),_0x20c5a5=_0x40a2a2[_0x35d56b(0x206)];let _0x4bd14c;if(_0x354ab2[_0x35d56b(0x1f9)][_0x35d56b(0x208)]>0x2){const _0x2a0700=await withSpinner('Resolving\x20folder\x20path\x20\x27'+_0x4572ba+'\x27...',()=>_0x14d930['segment']['resolvePathToResource'](_0x4572ba),{'verbose':_0x46290a[_0x35d56b(0x1ff)]}),_0xeab912=_0x2a0700[_0x35d56b(0x206)];if(_0xeab912[_0x35d56b(0x1fd)]!==_0x35d56b(0x205)&&_0xeab912[_0x35d56b(0x1fd)]!==_0x35d56b(0x210))return console[_0x35d56b(0x1fc)]('Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.'),0x1;_0x4bd14c=_0xeab912[_0x35d56b(0x20c)];}else{if(_0x46290a['folder']){const _0x4b9bbe=await withSpinner(_0x35d56b(0x212)+_0x46290a['folder']+_0x35d56b(0x217),()=>_0x14d930[_0x35d56b(0x20f)][_0x35d56b(0x1f6)](_0x20c5a5,_0x46290a['folder']),{'verbose':_0x46290a[_0x35d56b(0x1ff)]});_0x4bd14c=_0x4b9bbe[_0x35d56b(0x206)];}}_0x46290a['verbose']&&_0x4bd14c&&console[_0x35d56b(0x1fc)](_0x35d56b(0x1f8)+_0x4bd14c);const _0x13d79a=await loadJSONFromOptions(_0x46290a['rule'],_0x46290a[_0x35d56b(0x216)]),_0x2a4990={'name':_0x52bdce,'description':_0x46290a['description'],'rule':_0x13d79a,'kind':_0x46290a['kind']!==undefined?parseInt(_0x46290a['kind'],0xa):undefined,'isVisible':_0x46290a['invisible']?![]:undefined,'segmentFolderId':_0x4bd14c,'countPopulation':_0x46290a[_0x35d56b(0x209)]?![]:undefined},_0x4e7adc=await withSpinner('Creating\x20segment\x20\x27'+_0x52bdce+_0x35d56b(0x217),()=>_0x14d930[_0x35d56b(0x20f)][_0x35d56b(0x1f7)](_0x20c5a5,_0x2a4990),{'verbose':_0x46290a[_0x35d56b(0x1ff)]}),_0xe0b7fc=_0x4e7adc[_0x35d56b(0x206)];return console['error'](_0x35d56b(0x21a)+_0xe0b7fc['name']+'\x27\x20with\x20ID:\x20'+_0xe0b7fc['id']),_0x27a717!==_0x5c75cc&&console['error']('\x20\x20\x20Path:\x20'+_0x27a717),await handleSDKOutput([_0xe0b7fc],_0x46290a),0x0;}}
1
+ function a32_0x4790(){const _0x5ddece=['328515juuTtO','ruleFile','135kbiQMV','\x27...','Resolving\x20folder\x20\x27','verbose','includes','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','Parent:\x20','9697680kluiRp','Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]','Site:\x20','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','1840908BpVIJF','Create\x20child\x20segment\x20with\x20filtering\x20rules','Creating\x20segment\x20\x27','\x27\x20with\x20ID:\x20','rule','⚠\x20Deprecation\x20warning:\x20`segment\x20create`\x20is\x20deprecated.','\x20\x20\x20Path:\x20','7mmROjW','name','1935022NnHAWv','Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)','yellow','createSegment','error','Resolved\x20folder\x20ID:\x20','segments','Parent\x20path:\x20','βœ”\x20Created\x20segment\x20\x27','segment:create','segmentPath','2587185RziViO','Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]','data','resolvePathToResource','Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.','length','segment','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27','Resolving\x20parent\x20segment\x20\x27','resolveFolderId','2455264fIwefg','1ulDlVf','folder','resolveParentId','87864uzNGfu','type','Resolved\x20relative\x20path\x20to:\x20','Segment\x20name:\x20','parent'];a32_0x4790=function(){return _0x5ddece;};return a32_0x4790();}const a32_0x28b4ad=a32_0x5a64;(function(_0x59e019,_0x24c04c){const _0x1cc1dc=a32_0x5a64,_0x32ab7e=_0x59e019();while(!![]){try{const _0x3eebbf=parseInt(_0x1cc1dc(0x19a))/0x1*(-parseInt(_0x1cc1dc(0x1b9))/0x2)+parseInt(_0x1cc1dc(0x1a2))/0x3+-parseInt(_0x1cc1dc(0x1b0))/0x4+-parseInt(_0x1cc1dc(0x1a4))/0x5*(-parseInt(_0x1cc1dc(0x19d))/0x6)+-parseInt(_0x1cc1dc(0x1b7))/0x7*(-parseInt(_0x1cc1dc(0x199))/0x8)+parseInt(_0x1cc1dc(0x18f))/0x9+parseInt(_0x1cc1dc(0x1ac))/0xa;if(_0x3eebbf===_0x24c04c)break;else _0x32ab7e['push'](_0x32ab7e['shift']());}catch(_0x3ba124){_0x32ab7e['push'](_0x32ab7e['shift']());}}}(a32_0x4790,0x9c910));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';function a32_0x5a64(_0x1cbb7c,_0x40aa7f){_0x1cbb7c=_0x1cbb7c-0x18b;const _0x4790d1=a32_0x4790();let _0x5a640d=_0x4790d1[_0x1cbb7c];return _0x5a640d;}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 a32_0x5b4c3d from'chalk';export class SegmentCreateCommand extends BaseCommand{[a32_0x28b4ad(0x1b8)]=a32_0x28b4ad(0x18d);['description']=a32_0x28b4ad(0x1b1);async['execute'](_0x1d2b10){const _0x30d0b2=a32_0x28b4ad;console[_0x30d0b2(0x1bd)](a32_0x5b4c3d[_0x30d0b2(0x1bb)](_0x30d0b2(0x1b5))),console[_0x30d0b2(0x1bd)](a32_0x5b4c3d[_0x30d0b2(0x1bb)](_0x30d0b2(0x1af)));const {options:_0x34a5d8,args:_0x52ff3d,tdx:_0x3e470c}=_0x1d2b10,_0x39accd=_0x34a5d8;if(_0x52ff3d['length']===0x0)return console[_0x30d0b2(0x1bd)](_0x30d0b2(0x1aa)),console['error'](_0x30d0b2(0x1ad)),console[_0x30d0b2(0x1bd)]('Examples:'),console['error'](_0x30d0b2(0x1a9)),console[_0x30d0b2(0x1bd)](_0x30d0b2(0x196)),console[_0x30d0b2(0x1bd)]('\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context'),0x1;const _0x20313f=_0x52ff3d[0x0],_0x1280e2=_0x34a5d8[_0x30d0b2(0x18e)];let _0x1fcd93=_0x20313f;_0x1280e2&&!_0x20313f[_0x30d0b2(0x1a8)]('/')&&(_0x1fcd93=_0x1280e2+'/'+_0x20313f,_0x39accd[_0x30d0b2(0x1a7)]&&console['error'](_0x30d0b2(0x19f)+_0x1fcd93));const _0x290b7b=parsePath(_0x1fcd93);if(_0x290b7b['segments'][_0x30d0b2(0x194)]<0x2)return console[_0x30d0b2(0x1bd)](_0x30d0b2(0x1ba)),console[_0x30d0b2(0x1bd)](_0x30d0b2(0x190)),0x1;const _0x4aa022=_0x290b7b[_0x30d0b2(0x1bf)][0x0],_0x5809fb=getBaseName(_0x1fcd93),_0x4eaed7=getParentPath(_0x1fcd93);_0x39accd[_0x30d0b2(0x1a7)]&&(console[_0x30d0b2(0x1bd)](_0x30d0b2(0x1ae)+_0x39accd['site']),console[_0x30d0b2(0x1bd)]('Target\x20path:\x20'+_0x1fcd93),console[_0x30d0b2(0x1bd)](_0x30d0b2(0x1ab)+_0x4aa022),console[_0x30d0b2(0x1bd)](_0x30d0b2(0x1a0)+_0x5809fb),console['error'](_0x30d0b2(0x18b)+_0x4eaed7));const _0x1ef539=await withSpinner(_0x30d0b2(0x197)+_0x4aa022+_0x30d0b2(0x1a5),()=>_0x3e470c[_0x30d0b2(0x195)][_0x30d0b2(0x19c)](_0x4aa022),{'verbose':_0x39accd[_0x30d0b2(0x1a7)]}),_0x5a8a56=_0x1ef539['data'];let _0x1e461b;if(_0x290b7b[_0x30d0b2(0x1bf)][_0x30d0b2(0x194)]>0x2){const _0x51c7a3=await withSpinner('Resolving\x20folder\x20path\x20\x27'+_0x4eaed7+_0x30d0b2(0x1a5),()=>_0x3e470c[_0x30d0b2(0x195)][_0x30d0b2(0x192)](_0x4eaed7),{'verbose':_0x39accd[_0x30d0b2(0x1a7)]}),_0x3ebd3e=_0x51c7a3[_0x30d0b2(0x191)];if(_0x3ebd3e['type']!==_0x30d0b2(0x19b)&&_0x3ebd3e[_0x30d0b2(0x19e)]!==_0x30d0b2(0x1a1))return console[_0x30d0b2(0x1bd)](_0x30d0b2(0x193)),0x1;_0x1e461b=_0x3ebd3e['folderId'];}else{if(_0x39accd[_0x30d0b2(0x19b)]){const _0x518eb0=await withSpinner(_0x30d0b2(0x1a6)+_0x39accd[_0x30d0b2(0x19b)]+_0x30d0b2(0x1a5),()=>_0x3e470c['segment'][_0x30d0b2(0x198)](_0x5a8a56,_0x39accd[_0x30d0b2(0x19b)]),{'verbose':_0x39accd[_0x30d0b2(0x1a7)]});_0x1e461b=_0x518eb0[_0x30d0b2(0x191)];}}_0x39accd[_0x30d0b2(0x1a7)]&&_0x1e461b&&console['error'](_0x30d0b2(0x1be)+_0x1e461b);const _0x39c20c=await loadJSONFromOptions(_0x39accd[_0x30d0b2(0x1b4)],_0x39accd[_0x30d0b2(0x1a3)]),_0x542e01={'name':_0x5809fb,'description':_0x39accd['description'],'rule':_0x39c20c,'kind':_0x39accd['kind']!==undefined?parseInt(_0x39accd['kind'],0xa):undefined,'isVisible':_0x39accd['invisible']?![]:undefined,'segmentFolderId':_0x1e461b,'countPopulation':_0x39accd['noCountPopulation']?![]:undefined},_0x517126=await withSpinner(_0x30d0b2(0x1b2)+_0x5809fb+_0x30d0b2(0x1a5),()=>_0x3e470c[_0x30d0b2(0x195)][_0x30d0b2(0x1bc)](_0x5a8a56,_0x542e01),{'verbose':_0x39accd[_0x30d0b2(0x1a7)]}),_0x2d8c33=_0x517126[_0x30d0b2(0x191)];return console[_0x30d0b2(0x1bd)](_0x30d0b2(0x18c)+_0x2d8c33['name']+_0x30d0b2(0x1b3)+_0x2d8c33['id']),_0x1fcd93!==_0x20313f&&console[_0x30d0b2(0x1bd)](_0x30d0b2(0x1b6)+_0x1fcd93),await handleSDKOutput([_0x2d8c33],_0x39accd),0x0;}}
@@ -1 +1 @@
1
- const a33_0x224617=a33_0x1576;(function(_0x1ba86b,_0x184304){const _0x11aa57=a33_0x1576,_0xf85f11=_0x1ba86b();while(!![]){try{const _0x5869f0=-parseInt(_0x11aa57(0x14c))/0x1*(parseInt(_0x11aa57(0x146))/0x2)+-parseInt(_0x11aa57(0x13b))/0x3+parseInt(_0x11aa57(0x157))/0x4*(parseInt(_0x11aa57(0x13f))/0x5)+parseInt(_0x11aa57(0x149))/0x6+-parseInt(_0x11aa57(0x148))/0x7*(-parseInt(_0x11aa57(0x14d))/0x8)+parseInt(_0x11aa57(0x155))/0x9*(parseInt(_0x11aa57(0x144))/0xa)+parseInt(_0x11aa57(0x153))/0xb*(parseInt(_0x11aa57(0x13e))/0xc);if(_0x5869f0===_0x184304)break;else _0xf85f11['push'](_0xf85f11['shift']());}catch(_0x200bd9){_0xf85f11['push'](_0xf85f11['shift']());}}}(a33_0x19d6,0x89f0e));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';function a33_0x1576(_0x28a58f,_0x4707aa){_0x28a58f=_0x28a58f-0x13a;const _0x19d665=a33_0x19d6();let _0x1576ad=_0x19d665[_0x28a58f];return _0x1576ad;}import{withSpinner}from'../utils/spinner.js';import{displayFieldsHumanReadable}from'../sdk/segment/fields-display.js';export class SegmentFieldsCommand extends BaseCommand{[a33_0x224617(0x152)]=a33_0x224617(0x145);['description']=a33_0x224617(0x150);async[a33_0x224617(0x159)](_0x2657da){const _0x3d3cef=a33_0x224617,{options:_0x3981d9,args:_0x1f54c3,tdx:_0x1fca43}=_0x2657da,_0x2437cc=_0x1f54c3[0x0]||_0x3981d9[_0x3d3cef(0x14a)];if(!_0x2437cc)return console[_0x3d3cef(0x14f)]('Error:\x20Parent\x20segment\x20name\x20is\x20required'),console[_0x3d3cef(0x14f)](_0x3d3cef(0x141)),console[_0x3d3cef(0x14f)](_0x3d3cef(0x14e)),0x1;_0x3981d9[_0x3d3cef(0x147)]&&(console[_0x3d3cef(0x14f)](_0x3d3cef(0x143)+_0x3981d9[_0x3d3cef(0x142)]),console['error'](_0x3d3cef(0x140)+_0x2437cc));const _0x347f94=await withSpinner(_0x3d3cef(0x156)+_0x2437cc+_0x3d3cef(0x154),()=>_0x1fca43[_0x3d3cef(0x151)][_0x3d3cef(0x14b)](_0x2437cc),{'verbose':_0x3981d9['verbose']}),_0x4c4eec=_0x347f94[_0x3d3cef(0x13a)];console[_0x3d3cef(0x14f)](_0x3d3cef(0x13d)+_0x4c4eec[_0x3d3cef(0x13c)]+_0x3d3cef(0x158)+(_0x4c4eec[_0x3d3cef(0x13c)]!==0x1?'s':''));if(_0x3981d9['json']||_0x3981d9['jsonl'])return await handleSDKOutput(_0x4c4eec,_0x3981d9),0x0;return displayFieldsHumanReadable(_0x4c4eec,_0x2437cc),0x0;}}function a33_0x19d6(){const _0x2a6a56=['parentSegment','listFields','3ItzbVc','1128KLJqgf','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','error','List\x20available\x20fields\x20for\x20segmentation','segment','name','4251621DCAsqz','\x27...','729REnwqH','Listing\x20fields\x20for\x20\x27','4JZEHTZ','\x20field','execute','data','2390994nizKOY','length','βœ”\x20Found\x20','12IUkgAR','5519420dasgMv','Parent\x20segment:\x20','Usage:\x20tdx\x20segment\x20fields\x20<parent_name>','site','Site:\x20','3190cMGjrZ','segment:fields','571382EQTvCJ','verbose','25221AsRdTJ','1168920GObkLy'];a33_0x19d6=function(){return _0x2a6a56;};return a33_0x19d6();}
1
+ const a33_0x102240=a33_0x846f;function a33_0x5c4a(){const _0x966947=['\x20field','Error:\x20Parent\x20segment\x20name\x20is\x20required','verbose','1473ExZjkT','segment','453418MjOXVe','data','List\x20available\x20fields\x20for\x20segmentation','Usage:\x20tdx\x20segment\x20fields\x20<parent_name>','2928105HShOHb','βœ”\x20Found\x20','listFields','366299hNZWZL','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','error','name','1921530vwCsFb','json','length','2799300WeamAz','860mpkSte','56dpVowW','\x27...','execute','Site:\x20','description','1114684hHJauz','Parent\x20segment:\x20','site','jsonl','segment:fields'];a33_0x5c4a=function(){return _0x966947;};return a33_0x5c4a();}(function(_0x4a9936,_0x5f1fc6){const _0x4d8f2f=a33_0x846f,_0x4d6720=_0x4a9936();while(!![]){try{const _0x424f65=-parseInt(_0x4d8f2f(0xb2))/0x1+parseInt(_0x4d8f2f(0xba))/0x2*(parseInt(_0x4d8f2f(0xa9))/0x3)+-parseInt(_0x4d8f2f(0xa1))/0x4+parseInt(_0x4d8f2f(0xb6))/0x5+parseInt(_0x4d8f2f(0xb9))/0x6+parseInt(_0x4d8f2f(0xab))/0x7*(-parseInt(_0x4d8f2f(0x9c))/0x8)+parseInt(_0x4d8f2f(0xaf))/0x9;if(_0x424f65===_0x5f1fc6)break;else _0x4d6720['push'](_0x4d6720['shift']());}catch(_0x4407d9){_0x4d6720['push'](_0x4d6720['shift']());}}}(a33_0x5c4a,0x468af));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';function a33_0x846f(_0x58f7ea,_0x3428e0){_0x58f7ea=_0x58f7ea-0x9c;const _0x5c4a7a=a33_0x5c4a();let _0x846fd=_0x5c4a7a[_0x58f7ea];return _0x846fd;}import{withSpinner}from'../utils/spinner.js';import{displayFieldsHumanReadable}from'../sdk/segment/fields-display.js';export class SegmentFieldsCommand extends BaseCommand{[a33_0x102240(0xb5)]=a33_0x102240(0xa5);[a33_0x102240(0xa0)]=a33_0x102240(0xad);async[a33_0x102240(0x9e)](_0x174e9f){const _0x5f4612=a33_0x102240,{options:_0x6f1559,args:_0x14c19e,tdx:_0xbaa19d}=_0x174e9f,_0x113a51=_0x14c19e[0x0]||_0x6f1559['parentSegment'];if(!_0x113a51)return console['error'](_0x5f4612(0xa7)),console['error'](_0x5f4612(0xae)),console['error'](_0x5f4612(0xb3)),0x1;_0x6f1559[_0x5f4612(0xa8)]&&(console[_0x5f4612(0xb4)](_0x5f4612(0x9f)+_0x6f1559[_0x5f4612(0xa3)]),console[_0x5f4612(0xb4)](_0x5f4612(0xa2)+_0x113a51));const _0x44df5c=await withSpinner('Listing\x20fields\x20for\x20\x27'+_0x113a51+_0x5f4612(0x9d),()=>_0xbaa19d[_0x5f4612(0xaa)][_0x5f4612(0xb1)](_0x113a51),{'verbose':_0x6f1559[_0x5f4612(0xa8)]}),_0x4516ba=_0x44df5c[_0x5f4612(0xac)];console[_0x5f4612(0xb4)](_0x5f4612(0xb0)+_0x4516ba[_0x5f4612(0xb8)]+_0x5f4612(0xa6)+(_0x4516ba[_0x5f4612(0xb8)]!==0x1?'s':''));if(_0x6f1559[_0x5f4612(0xb7)]||_0x6f1559[_0x5f4612(0xa4)])return await handleSDKOutput(_0x4516ba,_0x6f1559),0x0;return displayFieldsHumanReadable(_0x4516ba,_0x113a51),0x0;}}
@@ -1 +1 @@
1
- function a34_0x4fe6(){const _0x265e07=['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)','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','filter','10260QwWsiW','\x20new\x20files','-\x20no\x20files\x20written','helpText','dryRun','6437328cskDdB','resourceName','\x20files\x20to\x20','\x20activations','\x20segments','Aborted.','message','segments','type','pullSegments','files','10mxcjpU','name','\x20\x20πŸ—ΊοΈ\x20\x20','absolutePath','866270dhviAc','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','βœ”\x20All\x20files\x20are\x20up\x20to\x20date','parentName','yellow','\x20changed\x20files','green','Site:\x20','cwd','\x27...','\x20with\x20','40488LeRhyc','\x20unchanged\x20files','journeys','counts','\x20=\x20','\x20journeys','\x20\x20🎯\x20','data','repeat','content','segment','description','Parent\x20segment:\x20','10064388qDSfOm','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','setPhase','881640XCceOX','error','activations','dirname','yes','targetDir','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent','isNew','Error:\x20','segment:pull','no_parent','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file','218145NaSgYV','No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27','parent_segment','hasChanges','889xrncxG','red','\x0aError:','Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files','length','parentSegment','execute','\x20versions)','11FdcAGc','file','verbose','dim','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','cyan','Write\x20','errorCode','session','3429cAPAoR','diff','1LuHWhT'];a34_0x4fe6=function(){return _0x265e07;};return a34_0x4fe6();}const a34_0x25c01c=a34_0x4072;(function(_0x42cc65,_0x22d132){const _0x5524cc=a34_0x4072,_0x11f7db=_0x42cc65();while(!![]){try{const _0x2d6557=parseInt(_0x5524cc(0x123))/0x1*(parseInt(_0x5524cc(0xe5))/0x2)+parseInt(_0x5524cc(0x10c))/0x3+-parseInt(_0x5524cc(0x100))/0x4*(-parseInt(_0x5524cc(0xe1))/0x5)+parseInt(_0x5524cc(0xf0))/0x6*(-parseInt(_0x5524cc(0x110))/0x7)+parseInt(_0x5524cc(0x12c))/0x8+-parseInt(_0x5524cc(0x121))/0x9*(-parseInt(_0x5524cc(0x127))/0xa)+-parseInt(_0x5524cc(0x118))/0xb*(parseInt(_0x5524cc(0xfd))/0xc);if(_0x2d6557===_0x22d132)break;else _0x11f7db['push'](_0x11f7db['shift']());}catch(_0x3ac49a){_0x11f7db['push'](_0x11f7db['shift']());}}}(a34_0x4fe6,0x6d053));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';function a34_0x4072(_0x39654d,_0x555671){_0x39654d=_0x39654d-0xdb;const _0x4fe62c=a34_0x4fe6();let _0x40722a=_0x4fe62c[_0x39654d];return _0x40722a;}import{saveSessionContext}from'../core/session.js';import a34_0x4f0138 from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';import a34_0x46d70b 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{[a34_0x25c01c(0xe2)]=a34_0x25c01c(0x109);[a34_0x25c01c(0xfb)]=a34_0x25c01c(0x113);async[a34_0x25c01c(0x116)](_0x3cc0ca){const _0x1f67b2=a34_0x25c01c,{options:_0x532dc7,args:_0x4870c9,tdx:_0x3e23a4}=_0x3cc0ca,_0x1dda09=_0x532dc7,_0x43b181=await resolveTarget({'arg':_0x4870c9[0x0],'contextParent':_0x532dc7[_0x1f67b2(0x115)],'cwd':process[_0x1f67b2(0xed)]()});if(!isSuccessfulResolution(_0x43b181))return _0x43b181[_0x1f67b2(0x11f)]===_0x1f67b2(0x10a)?(console['error'](a34_0x4f0138[_0x1f67b2(0xe9)](_0x1f67b2(0xe6))),console['error'](_0x1f67b2(0x124)),console[_0x1f67b2(0x101)](_0x1f67b2(0x106)),console[_0x1f67b2(0x101)](_0x1f67b2(0x10b))):(console[_0x1f67b2(0x101)](a34_0x4f0138[_0x1f67b2(0x111)](_0x1f67b2(0x108)+_0x43b181[_0x1f67b2(0xdc)]+'\x0a')),_0x43b181['helpText']&&console[_0x1f67b2(0x101)](a34_0x4f0138[_0x1f67b2(0x11d)](_0x43b181[_0x1f67b2(0x12a)]))),0x1;const _0x248d78=_0x43b181[_0x1f67b2(0xe8)],_0x29591d=_0x43b181[_0x1f67b2(0x105)],_0x15c794=_0x43b181[_0x1f67b2(0xde)]===_0x1f67b2(0x119)?_0x43b181[_0x1f67b2(0x12d)]:undefined;_0x1dda09[_0x1f67b2(0x11a)]&&(console[_0x1f67b2(0x101)](_0x1f67b2(0xec)+_0x1dda09['site']),console[_0x1f67b2(0x101)](_0x1f67b2(0xfc)+_0x248d78),_0x15c794&&console[_0x1f67b2(0x101)]('Target\x20resource:\x20'+_0x15c794));const _0x9a86df=await withProgressSpinner('Pulling\x20segments\x20from\x20\x27'+_0x248d78+_0x1f67b2(0xee),_0x54385b=>_0x3e23a4[_0x1f67b2(0xfa)][_0x1f67b2(0xdf)](_0x248d78,{'targetDir':_0x29591d,'targetResourceName':_0x15c794,'verbose':_0x1dda09[_0x1f67b2(0x11a)],'progress':{'update':_0x2b91b3=>{const _0x3792c2=_0x1f67b2;_0x54385b[_0x3792c2(0xff)](_0x2b91b3),_0x1dda09['verbose']&&console[_0x3792c2(0x101)]('\x20\x20'+_0x2b91b3);}}}),{'verbose':_0x1dda09[_0x1f67b2(0x11a)]}),_0x1d2bb7=_0x9a86df[_0x1f67b2(0xf7)];if(_0x1d2bb7[_0x1f67b2(0xf3)][_0x1f67b2(0xdd)]===0x0&&_0x1d2bb7[_0x1f67b2(0xf3)][_0x1f67b2(0xf2)]===0x0)return console[_0x1f67b2(0x101)](a34_0x4f0138[_0x1f67b2(0xe9)](_0x1f67b2(0x10d)+_0x1d2bb7[_0x1f67b2(0xe8)]+'\x27')),0x0;const _0x328f71=_0x1d2bb7['files']['filter'](_0x380571=>_0x380571[_0x1f67b2(0x107)]),_0x454dff=_0x1d2bb7[_0x1f67b2(0xe0)][_0x1f67b2(0x126)](_0x4af827=>!_0x4af827[_0x1f67b2(0x107)]&&_0x4af827[_0x1f67b2(0x10f)]),_0x16e208=_0x1d2bb7[_0x1f67b2(0xe0)][_0x1f67b2(0x126)](_0x5eaf44=>!_0x5eaf44[_0x1f67b2(0x107)]&&!_0x5eaf44['hasChanges']);console[_0x1f67b2(0x101)]('\x0aPull\x20summary\x20for\x20\x27'+_0x1d2bb7[_0x1f67b2(0xe8)]+'\x27:'),console[_0x1f67b2(0x101)](_0x1f67b2(0xf6)+a34_0x4f0138[_0x1f67b2(0x11d)](_0x1d2bb7[_0x1f67b2(0xf3)][_0x1f67b2(0xdd)]+_0x1f67b2(0x130))+_0x1f67b2(0xef)+a34_0x4f0138[_0x1f67b2(0x11d)](_0x1d2bb7[_0x1f67b2(0xf3)][_0x1f67b2(0x102)]+_0x1f67b2(0x12f)));if(_0x1d2bb7[_0x1f67b2(0xf3)][_0x1f67b2(0xf2)]>0x0){const _0x1d40a6=_0x1d2bb7[_0x1f67b2(0xf3)]['journeyVersions']>_0x1d2bb7['counts'][_0x1f67b2(0xf2)]?'\x20('+_0x1d2bb7[_0x1f67b2(0xf3)]['journeyVersions']+_0x1f67b2(0x117):'';console[_0x1f67b2(0x101)](_0x1f67b2(0xe3)+a34_0x4f0138['cyan'](_0x1d2bb7[_0x1f67b2(0xf3)][_0x1f67b2(0xf2)]+_0x1f67b2(0xf5))+a34_0x4f0138[_0x1f67b2(0x11b)](_0x1d40a6));}console[_0x1f67b2(0x101)]('\x20\x20'+a34_0x4f0138[_0x1f67b2(0xeb)]('+\x20'+_0x328f71['length']+_0x1f67b2(0x128))),console[_0x1f67b2(0x101)]('\x20\x20'+a34_0x4f0138['yellow']('~\x20'+_0x454dff[_0x1f67b2(0x114)]+_0x1f67b2(0xea))),console[_0x1f67b2(0x101)]('\x20\x20'+a34_0x4f0138['dim']('=\x20'+_0x16e208[_0x1f67b2(0x114)]+_0x1f67b2(0xf1))),console[_0x1f67b2(0x101)]('\x20\x20Target:\x20'+a34_0x4f0138[_0x1f67b2(0x11d)](_0x1d2bb7['targetDir'])+'\x0a');if(_0x454dff[_0x1f67b2(0x114)]>0x0)for(const _0x5329e6 of _0x454dff){console[_0x1f67b2(0x101)]('\x0aChanges\x20to\x20\x27'+_0x5329e6['relativePath']+'\x27:'),console[_0x1f67b2(0x101)]('─'[_0x1f67b2(0xf8)](0x3c)),console[_0x1f67b2(0x101)](_0x5329e6[_0x1f67b2(0x122)]),console[_0x1f67b2(0x101)]('─'[_0x1f67b2(0xf8)](0x3c));}if(_0x1dda09[_0x1f67b2(0x12b)])return console[_0x1f67b2(0x101)](a34_0x4f0138[_0x1f67b2(0xe9)](_0x1f67b2(0xfe))),0x0;if(_0x328f71[_0x1f67b2(0x114)]===0x0&&_0x454dff['length']===0x0)return console['error'](a34_0x4f0138[_0x1f67b2(0xeb)](_0x1f67b2(0xe7))),saveSessionContext({'parent_segment':_0x1d2bb7[_0x1f67b2(0xe8)]},_0x1dda09[_0x1f67b2(0x120)]),console[_0x1f67b2(0x101)](a34_0x4f0138[_0x1f67b2(0xeb)]('βœ”\x20Context\x20set:\x20'+a34_0x4f0138[_0x1f67b2(0x11b)]('parent_segment')+_0x1f67b2(0xf4)+a34_0x4f0138[_0x1f67b2(0x11d)](_0x1d2bb7['parentName']))),0x0;if(!_0x1dda09[_0x1f67b2(0x104)]){if(!isInteractive())return console[_0x1f67b2(0x101)](a34_0x4f0138[_0x1f67b2(0x111)](_0x1f67b2(0x112)),_0x1f67b2(0x125)),console[_0x1f67b2(0x101)](a34_0x4f0138[_0x1f67b2(0x11b)](_0x1f67b2(0x11c))),0x1;const _0x174837=await confirmKey(_0x1f67b2(0x11e)+(_0x328f71[_0x1f67b2(0x114)]+_0x454dff['length'])+'\x20files?');if(!_0x174837)return console[_0x1f67b2(0x101)](a34_0x4f0138[_0x1f67b2(0xe9)](_0x1f67b2(0xdb)),_0x1f67b2(0x129)),0x1;}for(const _0x522bce of _0x1d2bb7[_0x1f67b2(0xe0)]){if(_0x522bce[_0x1f67b2(0x107)]||_0x522bce[_0x1f67b2(0x10f)]){const _0x2e5744=a34_0x46d70b[_0x1f67b2(0x103)](_0x522bce['absolutePath']);!existsSync(_0x2e5744)&&mkdirSync(_0x2e5744,{'recursive':!![]}),writeFileSync(_0x522bce[_0x1f67b2(0xe4)],_0x522bce[_0x1f67b2(0xf9)],'utf-8');}}return console['error'](a34_0x4f0138[_0x1f67b2(0xeb)]('βœ”\x20Pulled\x20'+(_0x328f71[_0x1f67b2(0x114)]+_0x454dff[_0x1f67b2(0x114)])+_0x1f67b2(0x12e)+_0x1d2bb7[_0x1f67b2(0x105)])),saveSessionContext({'parent_segment':_0x1d2bb7[_0x1f67b2(0xe8)]},_0x1dda09[_0x1f67b2(0x120)]),console[_0x1f67b2(0x101)](a34_0x4f0138[_0x1f67b2(0xeb)]('βœ”\x20Context\x20set:\x20'+a34_0x4f0138['dim'](_0x1f67b2(0x10e))+_0x1f67b2(0xf4)+a34_0x4f0138[_0x1f67b2(0x11d)](_0x1d2bb7[_0x1f67b2(0xe8)]))),0x0;}}
1
+ function a34_0x3242(_0xaca39c,_0x528ab5){_0xaca39c=_0xaca39c-0xc9;const _0xa749ea=a34_0xa749();let _0x3242f5=_0xa749ea[_0xaca39c];return _0x3242f5;}function a34_0xa749(){const _0x3cd2d6=['Parent\x20segment:\x20','1614219CfewwY','\x20\x20Target:\x20','no_parent','Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files','\x0aError:','1995012sGIzZn','198kERMAN','\x20with\x20','file','activations','cyan','resourceName','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','4993500sTWjZR','helpText','dirname','diff','dryRun','journeyVersions','length','\x27...','files','journeys','Target\x20resource:\x20','βœ”\x20Pulled\x20','targetDir','381941iWiaXG','parentName','8304375ReqKxn','\x20changed\x20files','isNew','yellow','yes','16573644wVWnNx','parent_segment','\x20unchanged\x20files','segments','session','Aborted.','relativePath','segment','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','143633cmprKl','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent','green','\x20files\x20to\x20','Write\x20','description','hasChanges','error','\x20activations','execute','Site:\x20','\x20\x20🎯\x20','\x0aPull\x20summary\x20for\x20\x27','\x20=\x20','repeat','absolutePath','pullSegments','segment:pull','data','32jBCCcx','\x20journeys','\x20new\x20files','\x20segments','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','content','\x20\x20πŸ—ΊοΈ\x20\x20','\x0aChanges\x20to\x20\x27','filter','errorCode','site','βœ”\x20Context\x20set:\x20','dim','counts','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','message','red','verbose','Error:\x20','name','No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27'];a34_0xa749=function(){return _0x3cd2d6;};return a34_0xa749();}const a34_0x1547ad=a34_0x3242;(function(_0xdd188b,_0x51f2fa){const _0x464e3b=a34_0x3242,_0x4448f7=_0xdd188b();while(!![]){try{const _0x39bcc5=-parseInt(_0x464e3b(0x110))/0x1+-parseInt(_0x464e3b(0xeb))/0x2+-parseInt(_0x464e3b(0xe6))/0x3+-parseInt(_0x464e3b(0xf3))/0x4+-parseInt(_0x464e3b(0x102))/0x5+parseInt(_0x464e3b(0xec))/0x6*(-parseInt(_0x464e3b(0x100))/0x7)+-parseInt(_0x464e3b(0xd0))/0x8*(-parseInt(_0x464e3b(0x107))/0x9);if(_0x39bcc5===_0x51f2fa)break;else _0x4448f7['push'](_0x4448f7['shift']());}catch(_0x2b0d5a){_0x4448f7['push'](_0x4448f7['shift']());}}}(a34_0xa749,0xee87f));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 a34_0xe6bdd4 from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';import a34_0x1be48b 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{[a34_0x1547ad(0xe3)]=a34_0x1547ad(0xce);[a34_0x1547ad(0x115)]=a34_0x1547ad(0xe9);async[a34_0x1547ad(0x119)](_0x3796f3){const _0x124ad8=a34_0x1547ad,{options:_0x457e0d,args:_0x5cec9f,tdx:_0xa92ce0}=_0x3796f3,_0x35e385=_0x457e0d,_0x116429=await resolveTarget({'arg':_0x5cec9f[0x0],'contextParent':_0x457e0d['parentSegment'],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x116429))return _0x116429[_0x124ad8(0xd9)]===_0x124ad8(0xe8)?(console[_0x124ad8(0x117)](a34_0xe6bdd4[_0x124ad8(0x105)](_0x124ad8(0xde))),console['error']('Usage:\x20tdx\x20sg\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20(requires\x20context\x20or\x20tdx.json)'),console['error'](_0x124ad8(0x111)),console[_0x124ad8(0x117)]('\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'](a34_0xe6bdd4[_0x124ad8(0xe0)](_0x124ad8(0xe2)+_0x116429[_0x124ad8(0xdf)]+'\x0a')),_0x116429[_0x124ad8(0xf4)]&&console[_0x124ad8(0x117)](a34_0xe6bdd4[_0x124ad8(0xf0)](_0x116429[_0x124ad8(0xf4)]))),0x1;const _0x508139=_0x116429[_0x124ad8(0x101)],_0x16353b=_0x116429['targetDir'],_0x18e23f=_0x116429['type']===_0x124ad8(0xee)?_0x116429[_0x124ad8(0xf1)]:undefined;_0x35e385[_0x124ad8(0xe1)]&&(console['error'](_0x124ad8(0x11a)+_0x35e385[_0x124ad8(0xda)]),console[_0x124ad8(0x117)](_0x124ad8(0xe5)+_0x508139),_0x18e23f&&console['error'](_0x124ad8(0xfd)+_0x18e23f));const _0x1c8e93=await withProgressSpinner('Pulling\x20segments\x20from\x20\x27'+_0x508139+_0x124ad8(0xfa),_0x27b0a7=>_0xa92ce0[_0x124ad8(0x10e)][_0x124ad8(0xcd)](_0x508139,{'targetDir':_0x16353b,'targetResourceName':_0x18e23f,'verbose':_0x35e385[_0x124ad8(0xe1)],'progress':{'update':_0xa388fb=>{const _0x282b9b=_0x124ad8;_0x27b0a7['setPhase'](_0xa388fb),_0x35e385[_0x282b9b(0xe1)]&&console[_0x282b9b(0x117)]('\x20\x20'+_0xa388fb);}}}),{'verbose':_0x35e385[_0x124ad8(0xe1)]}),_0x1b8aed=_0x1c8e93[_0x124ad8(0xcf)];if(_0x1b8aed[_0x124ad8(0xdd)][_0x124ad8(0x10a)]===0x0&&_0x1b8aed[_0x124ad8(0xdd)][_0x124ad8(0xfc)]===0x0)return console[_0x124ad8(0x117)](a34_0xe6bdd4[_0x124ad8(0x105)](_0x124ad8(0xe4)+_0x1b8aed[_0x124ad8(0x101)]+'\x27')),0x0;const _0x33765b=_0x1b8aed[_0x124ad8(0xfb)]['filter'](_0xc2c305=>_0xc2c305[_0x124ad8(0x104)]),_0x194112=_0x1b8aed[_0x124ad8(0xfb)][_0x124ad8(0xd8)](_0x1d1dc7=>!_0x1d1dc7[_0x124ad8(0x104)]&&_0x1d1dc7['hasChanges']),_0x123d15=_0x1b8aed[_0x124ad8(0xfb)][_0x124ad8(0xd8)](_0x1df1fd=>!_0x1df1fd[_0x124ad8(0x104)]&&!_0x1df1fd[_0x124ad8(0x116)]);console['error'](_0x124ad8(0xc9)+_0x1b8aed['parentName']+'\x27:'),console[_0x124ad8(0x117)](_0x124ad8(0x11b)+a34_0xe6bdd4['cyan'](_0x1b8aed[_0x124ad8(0xdd)][_0x124ad8(0x10a)]+_0x124ad8(0xd3))+_0x124ad8(0xed)+a34_0xe6bdd4['cyan'](_0x1b8aed[_0x124ad8(0xdd)][_0x124ad8(0xef)]+_0x124ad8(0x118)));if(_0x1b8aed[_0x124ad8(0xdd)]['journeys']>0x0){const _0x524cc0=_0x1b8aed[_0x124ad8(0xdd)][_0x124ad8(0xf8)]>_0x1b8aed['counts']['journeys']?'\x20('+_0x1b8aed[_0x124ad8(0xdd)][_0x124ad8(0xf8)]+'\x20versions)':'';console['error'](_0x124ad8(0xd6)+a34_0xe6bdd4[_0x124ad8(0xf0)](_0x1b8aed[_0x124ad8(0xdd)][_0x124ad8(0xfc)]+_0x124ad8(0xd1))+a34_0xe6bdd4[_0x124ad8(0xdc)](_0x524cc0));}console[_0x124ad8(0x117)]('\x20\x20'+a34_0xe6bdd4['green']('+\x20'+_0x33765b['length']+_0x124ad8(0xd2))),console[_0x124ad8(0x117)]('\x20\x20'+a34_0xe6bdd4[_0x124ad8(0x105)]('~\x20'+_0x194112[_0x124ad8(0xf9)]+_0x124ad8(0x103))),console['error']('\x20\x20'+a34_0xe6bdd4[_0x124ad8(0xdc)]('=\x20'+_0x123d15['length']+_0x124ad8(0x109))),console[_0x124ad8(0x117)](_0x124ad8(0xe7)+a34_0xe6bdd4[_0x124ad8(0xf0)](_0x1b8aed[_0x124ad8(0xff)])+'\x0a');if(_0x194112[_0x124ad8(0xf9)]>0x0)for(const _0x4898ae of _0x194112){console[_0x124ad8(0x117)](_0x124ad8(0xd7)+_0x4898ae[_0x124ad8(0x10d)]+'\x27:'),console[_0x124ad8(0x117)]('─'[_0x124ad8(0xcb)](0x3c)),console[_0x124ad8(0x117)](_0x4898ae[_0x124ad8(0xf6)]),console[_0x124ad8(0x117)]('─'[_0x124ad8(0xcb)](0x3c));}if(_0x35e385[_0x124ad8(0xf7)])return console[_0x124ad8(0x117)](a34_0xe6bdd4[_0x124ad8(0x105)](_0x124ad8(0xd4))),0x0;if(_0x33765b['length']===0x0&&_0x194112[_0x124ad8(0xf9)]===0x0)return console[_0x124ad8(0x117)](a34_0xe6bdd4[_0x124ad8(0x112)]('βœ”\x20All\x20files\x20are\x20up\x20to\x20date')),saveSessionContext({'parent_segment':_0x1b8aed[_0x124ad8(0x101)]},_0x35e385[_0x124ad8(0x10b)]),console[_0x124ad8(0x117)](a34_0xe6bdd4[_0x124ad8(0x112)](_0x124ad8(0xdb)+a34_0xe6bdd4[_0x124ad8(0xdc)](_0x124ad8(0x108))+_0x124ad8(0xca)+a34_0xe6bdd4[_0x124ad8(0xf0)](_0x1b8aed[_0x124ad8(0x101)]))),0x0;if(!_0x35e385[_0x124ad8(0x106)]){if(!isInteractive())return console[_0x124ad8(0x117)](a34_0xe6bdd4[_0x124ad8(0xe0)](_0x124ad8(0xea)),_0x124ad8(0xf2)),console[_0x124ad8(0x117)](a34_0xe6bdd4['dim'](_0x124ad8(0x10f))),0x1;const _0x2a590f=await confirmKey(_0x124ad8(0x114)+(_0x33765b[_0x124ad8(0xf9)]+_0x194112['length'])+'\x20files?');if(!_0x2a590f)return console[_0x124ad8(0x117)](a34_0xe6bdd4['yellow'](_0x124ad8(0x10c)),'-\x20no\x20files\x20written'),0x1;}for(const _0x23c6da of _0x1b8aed[_0x124ad8(0xfb)]){if(_0x23c6da[_0x124ad8(0x104)]||_0x23c6da[_0x124ad8(0x116)]){const _0x14c2e6=a34_0x1be48b[_0x124ad8(0xf5)](_0x23c6da['absolutePath']);!existsSync(_0x14c2e6)&&mkdirSync(_0x14c2e6,{'recursive':!![]}),writeFileSync(_0x23c6da[_0x124ad8(0xcc)],_0x23c6da[_0x124ad8(0xd5)],'utf-8');}}return console['error'](a34_0xe6bdd4[_0x124ad8(0x112)](_0x124ad8(0xfe)+(_0x33765b['length']+_0x194112['length'])+_0x124ad8(0x113)+_0x1b8aed[_0x124ad8(0xff)])),saveSessionContext({'parent_segment':_0x1b8aed[_0x124ad8(0x101)]},_0x35e385[_0x124ad8(0x10b)]),console[_0x124ad8(0x117)](a34_0xe6bdd4['green'](_0x124ad8(0xdb)+a34_0xe6bdd4[_0x124ad8(0xdc)](_0x124ad8(0x108))+_0x124ad8(0xca)+a34_0xe6bdd4[_0x124ad8(0xf0)](_0x1b8aed[_0x124ad8(0x101)]))),0x0;}}
@@ -1 +1 @@
1
- const a35_0x4174f4=a35_0x28f2;(function(_0x2b6279,_0x27c401){const _0x83856a=a35_0x28f2,_0x4557eb=_0x2b6279();while(!![]){try{const _0x96a27d=-parseInt(_0x83856a(0xf2))/0x1+-parseInt(_0x83856a(0x124))/0x2+-parseInt(_0x83856a(0xef))/0x3+parseInt(_0x83856a(0x140))/0x4*(parseInt(_0x83856a(0xe3))/0x5)+-parseInt(_0x83856a(0x13a))/0x6+-parseInt(_0x83856a(0x100))/0x7+parseInt(_0x83856a(0xdd))/0x8;if(_0x96a27d===_0x27c401)break;else _0x4557eb['push'](_0x4557eb['shift']());}catch(_0x3acbb8){_0x4557eb['push'](_0x4557eb['shift']());}}}(a35_0x475e,0xa59e1));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 a35_0x591012 from'chalk';import{existsSync}from'fs';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{resolveTarget,isSuccessfulResolution,getScopedDetails}from'../sdk/segment/target-resolution.js';import{buildFolderMaps}from'../sdk/segment/resolution-context.js';function a35_0x475e(){const _0xb151e1=['dim','.yaml','journeyBundleName','filter','\x20unchanged','cyan','/app/ps/','push','listFolders','\x20\x20\x20\x20','\x20changed','toDelete','isNew','then','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','listSegments','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','Fetching\x20existing\x20data...','activations','name','attributes','\x0aPush\x20summary\x20for\x20\x27','folders','site','\x20\x20Activations:\x20','filePath','yellow','deleted','resolveParentId','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','getOutputSchemaWithCache','\x20folders\x20to\x20create','\x27...','\x20activations]','errorCode','audienceId','33059800ydnkrB','new','\x20to\x20create','Fetching\x20connections\x20for\x20name\x20resolution...','folderId','Scoped\x20to\x20folder:\x20','1263105Bjzrsd','length','journeys','segment\x20or\x20journey','error','βœ”\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','.yml','Changes\x20to\x20journey:','getParent','isScoped','New\x20journey:','parent_name','421230tWlgml','Error\x20parsing\x20YAML:\x20','journeyId','1324108dHiRrA','scopedFolderPath','list','Folders\x20to\x20create:','state','updated','versionNumber','repeat','parentName','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','toString','join','Changes\x20to:','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','3239915zWVQbr','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','\x20\x20Source:\x20','Preparing\x20journeys...','\x20created','type','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file','user','helpText','dryRun','folderPath','no_parent','yamlConfig','endsWith','journeysOnly','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','delete','listJourneysWithDetailsFromParentSegment','\x20deleted','file','getJourney','add','Delete\x20journey:','description','toUpdate','green','execute','createdSegmentIds','\x20\x20πŸ“Š\x20Segments:','red','diff','segments','\x20to\x20delete','changed','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)','message','2506060uenoPg','all','Parent\x20segment:\x20','data','\x0aValidation\x20failed:','No\x20','updatedAt','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','blue','journey','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','\x20\x20Segments:\x20','toCreate','\x20YAML\x20files\x20found','Delete\x20segment:','created','targetDir','Source\x20directory:\x20','verbose','\x20updated','πŸ“\x20','paused','3158004vqNvBc','/e/','yes','Error:\x20Directory\x20not\x20found:\x20','/j/da/je','\x20\x20Activations:','4CJpdox','connection','results','\x20new','nameToId','journeyBundleId','segment','\x20\x20πŸ—ΊοΈ\x20\x20Journeys:','existingJourney','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','Site:\x20','Push\x20','idToName','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','get','\x20\x20Journeys:\x20','map'];a35_0x475e=function(){return _0xb151e1;};return a35_0x475e();}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 a35_0x28f2(_0x5034f1,_0x89085b){_0x5034f1=_0x5034f1-0xc3;const _0x475ed1=a35_0x475e();let _0x28f295=_0x475ed1[_0x5034f1];return _0x28f295;}export class SegmentPushCommand extends BaseCommand{[a35_0x4174f4(0xcc)]='segment:push';[a35_0x4174f4(0x117)]='Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments';async[a35_0x4174f4(0x11a)](_0x4f95ac){const _0x2e1d05=a35_0x4174f4,{options:_0x21d277,args:_0x421b91,tdx:_0x5081d0}=_0x4f95ac,_0x1b953e=_0x21d277,_0x17102a=await resolveTarget({'arg':_0x421b91[0x0],'contextParent':_0x21d277['parentSegment'],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x17102a))return _0x17102a[_0x2e1d05(0xdb)]===_0x2e1d05(0x10b)?(console[_0x2e1d05(0xe7)](a35_0x591012['yellow'](_0x2e1d05(0xff))),console[_0x2e1d05(0xe7)](_0x2e1d05(0x122)),console[_0x2e1d05(0xe7)](_0x2e1d05(0xc7)),console['error'](_0x2e1d05(0x106))):(console[_0x2e1d05(0xe7)](a35_0x591012[_0x2e1d05(0x11d)]('Error:\x20'+_0x17102a[_0x2e1d05(0x123)]+'\x0a')),_0x17102a[_0x2e1d05(0x108)]&&console[_0x2e1d05(0xe7)](a35_0x591012[_0x2e1d05(0x156)](_0x17102a[_0x2e1d05(0x108)]))),0x1;if(_0x17102a['type']===_0x2e1d05(0xee))return console['error'](a35_0x591012['red'](_0x2e1d05(0x13d)+_0x17102a[_0x2e1d05(0x134)]+'\x0a')),console[_0x2e1d05(0xe7)](a35_0x591012[_0x2e1d05(0x156)]('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;const _0x235df9=_0x17102a[_0x2e1d05(0xfa)],_0x7251bb=_0x17102a[_0x2e1d05(0x134)],_0x4b981c=_0x17102a[_0x2e1d05(0x105)]===_0x2e1d05(0x113)?_0x17102a[_0x2e1d05(0xd2)]:undefined,_0x3eb90d=getScopedDetails(_0x17102a),_0x10f14e=_0x3eb90d?.[_0x2e1d05(0xec)]??![],_0x55aa96=_0x3eb90d?.[_0x2e1d05(0xf3)]??'';if(!existsSync(_0x7251bb))return console[_0x2e1d05(0xe7)](a35_0x591012[_0x2e1d05(0x11d)](_0x2e1d05(0x13d)+_0x7251bb+'\x0a')),console[_0x2e1d05(0xe7)](a35_0x591012[_0x2e1d05(0x156)](_0x2e1d05(0x10f))),0x1;_0x1b953e[_0x2e1d05(0x136)]&&(console[_0x2e1d05(0xe7)](_0x2e1d05(0x14a)+_0x1b953e[_0x2e1d05(0xd0)]),console[_0x2e1d05(0xe7)](_0x2e1d05(0x126)+_0x235df9),console[_0x2e1d05(0xe7)](_0x2e1d05(0x135)+_0x7251bb),_0x10f14e&&console[_0x2e1d05(0xe7)](_0x2e1d05(0xe2)+_0x55aa96));const _0xd50786=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x235df9+_0x2e1d05(0xd9),()=>_0x5081d0[_0x2e1d05(0x146)][_0x2e1d05(0xd5)](_0x235df9),{'verbose':_0x1b953e[_0x2e1d05(0x136)]}),_0x4eec11=_0xd50786['data'],{parentSegmentResult:_0x3ac8e6,segmentsResult:_0x2aebcb,foldersResult:_0x507637,journeysWithDetailsResult:_0x428987,userMaps:_0x2a0262}=await withSpinner(_0x2e1d05(0xca),async()=>{const _0x1a664a=_0x2e1d05,[_0x52cf94,_0x2bff53,_0x11f2b7,_0x1eb997,_0xbe7c1e]=await Promise[_0x1a664a(0x125)]([_0x5081d0[_0x1a664a(0x146)][_0x1a664a(0xeb)](_0x4eec11),_0x5081d0[_0x1a664a(0x146)][_0x1a664a(0xc8)](_0x4eec11),_0x5081d0[_0x1a664a(0x146)][_0x1a664a(0x159)](_0x4eec11),_0x5081d0[_0x1a664a(0x12d)][_0x1a664a(0x111)](_0x4eec11,{'includeAllVersions':!![]}),_0x5081d0[_0x1a664a(0x107)]['buildUserMaps']()]);return{'parentSegmentResult':_0x52cf94,'segmentsResult':_0x2bff53,'foldersResult':_0x11f2b7,'journeysWithDetailsResult':_0x1eb997,'userMaps':_0xbe7c1e};},{'verbose':_0x1b953e[_0x2e1d05(0x136)]})[_0x2e1d05(0xc6)](_0x103db1=>_0x103db1[_0x2e1d05(0x127)]),_0x2069f3=_0x3ac8e6,_0x4863f2=extractRootFolderId(_0x2069f3),_0x3b2a40=_0x2aebcb,_0x4e0b0b=_0x507637,{journeys:_0x290d0c,activationStepsById:_0xe6eb04}=_0x428987,_0x33ad83=new Map(_0x290d0c[_0x2e1d05(0x150)](_0x34c072=>[_0x34c072['id'],_0x34c072])),_0x1c7bfb=_0x290d0c['map'](_0x1b359a=>({'id':_0x1b359a['id'],'name':_0x1b359a[_0x2e1d05(0xcd)][_0x2e1d05(0xcc)],'journeyBundleName':_0x1b359a[_0x2e1d05(0xcd)]['journeyBundleName']||'','journeyBundleId':_0x1b359a['attributes'][_0x2e1d05(0x145)]||'','versionNumber':_0x1b359a[_0x2e1d05(0xcd)][_0x2e1d05(0xf8)],'description':_0x1b359a[_0x2e1d05(0xcd)]['description'],'state':_0x1b359a[_0x2e1d05(0xcd)][_0x2e1d05(0xf6)],'paused':_0x1b359a[_0x2e1d05(0xcd)][_0x2e1d05(0x139)],'audienceId':_0x1b359a[_0x2e1d05(0xcd)][_0x2e1d05(0xdc)],'folderId':_0x1b359a['relationships']?.['parentFolder']?.[_0x2e1d05(0x127)]?.['id'],'createdAt':_0x1b359a[_0x2e1d05(0xcd)]['createdAt'],'updatedAt':_0x1b359a[_0x2e1d05(0xcd)][_0x2e1d05(0x12a)]})),{emailToId:_0x42999b,idToEmail:_0x3f05b7}=_0x2a0262,_0x4eaea7=await withSpinner(_0x2e1d05(0xe0),async()=>{const _0x9e68d1=_0x2e1d05,_0x8fcb2b=await _0x5081d0[_0x9e68d1(0x141)][_0x9e68d1(0xf4)]();return buildConnectionMaps(_0x8fcb2b);},{'verbose':_0x1b953e[_0x2e1d05(0x136)]})['then'](_0x2f2f45=>_0x2f2f45[_0x2e1d05(0x127)]),_0xf0a0fa=_0x4eaea7[_0x2e1d05(0x144)],_0x3f72f8=_0x4eaea7['idToName'],_0x467443=_0x4eaea7['nameToType'],_0x2cbab8={'emailToIdMap':_0x42999b,'connectionNameToIdMap':_0xf0a0fa,'connectionNameToTypeMap':_0x467443,'getSchema':_0x156d28=>_0x5081d0[_0x2e1d05(0x141)][_0x2e1d05(0xd7)](_0x156d28)};let {pathToId:_0x496e9a,idToPath:_0x2107be}=buildFolderMaps(_0x4e0b0b);const _0x390576=buildSegmentLookupMap(_0x3b2a40,_0x2107be),_0x5d9a5b=buildSegmentNameToIdMap(_0x3b2a40),_0x5cb285=buildJourneyBundleLookupMap(_0x1c7bfb,_0x2107be);let _0x26cc82;if(_0x4b981c){if(!_0x4b981c[_0x2e1d05(0x10d)](_0x2e1d05(0xe9))&&!_0x4b981c[_0x2e1d05(0x10d)](_0x2e1d05(0x152)))return console[_0x2e1d05(0xe7)](a35_0x591012[_0x2e1d05(0x11d)](_0x2e1d05(0x12e)+_0x4b981c+'\x0a')),0x1;_0x26cc82=[_0x4b981c];}else _0x26cc82=findYamlFiles(_0x7251bb);if(_0x26cc82[_0x2e1d05(0xe4)]===0x0)return console[_0x2e1d05(0xe7)](a35_0x591012[_0x2e1d05(0x11d)](_0x2e1d05(0x149)+_0x7251bb+'\x0a')),console[_0x2e1d05(0xe7)](a35_0x591012['cyan']('Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files')),0x1;let _0x2fb651,_0x2cf8ad;try{const _0xc69e98=parseAndClassifyYamlFiles(_0x26cc82,_0x7251bb,{'skipSegments':_0x1b953e[_0x2e1d05(0x10e)]});_0x2fb651=_0xc69e98['segments'],_0x2cf8ad=_0xc69e98[_0x2e1d05(0xe5)];const _0x236de3=validateParsedFiles(_0xc69e98,_0x7251bb);if(_0x236de3[_0x2e1d05(0xe4)]>0x0)return console[_0x2e1d05(0xe7)](a35_0x591012[_0x2e1d05(0x11d)](_0x2e1d05(0x128))),console[_0x2e1d05(0xe7)](formatValidationErrors(_0x236de3)),console[_0x2e1d05(0xe7)](a35_0x591012[_0x2e1d05(0xd3)](_0x2e1d05(0x12b))),0x1;}catch(_0xc36152){return console[_0x2e1d05(0xe7)](a35_0x591012[_0x2e1d05(0x11d)](_0x2e1d05(0xf0)+(_0xc36152 instanceof Error?_0xc36152[_0x2e1d05(0x123)]:_0xc36152))),0x1;}if(_0x2fb651['length']===0x0&&_0x2cf8ad[_0x2e1d05(0xe4)]===0x0){const _0x1a3eb7=_0x1b953e[_0x2e1d05(0x10e)]?_0x2e1d05(0x12d):_0x2e1d05(0xe6);return console[_0x2e1d05(0xe7)](a35_0x591012[_0x2e1d05(0xd3)](_0x2e1d05(0x129)+_0x1a3eb7+_0x2e1d05(0x131))),0x0;}const _0x45bdb6=new Map();_0x3b2a40[_0x2e1d05(0xe4)]>0x0&&!_0x1b953e[_0x2e1d05(0x10e)]&&await withSpinner('Fetching\x20existing\x20activations...',async()=>{await batchAsync(_0x3b2a40,async _0x59ed92=>{const _0x372a15=a35_0x28f2,_0x5ce11e=await _0x5081d0[_0x372a15(0x146)]['listActivations'](_0x4eec11,_0x59ed92['id']);_0x45bdb6['set'](_0x59ed92['id'],_0x5ce11e);});},{'verbose':_0x1b953e[_0x2e1d05(0x136)]});const {segmentFiles:_0x2a75db,foldersToCreate:_0x287be8}=await prepareSegmentFiles(_0x2fb651,{'segmentByFolderAndName':_0x390576,'activationsBySegmentId':_0x45bdb6,'folderPathToId':_0x496e9a,'idToEmailMap':_0x3f05b7,'connectionIdToNameMap':_0x3f72f8},_0x2cbab8,_0x10f14e,_0x55aa96),_0x18c5f8=_0x4b981c?[]:findSegmentsToDelete(_0x3b2a40,_0x2fb651[_0x2e1d05(0x150)](({yamlConfig:_0x213110,folderPath:_0x4a6e68})=>({'yamlConfig':_0x213110,'folderPath':resolveTDFolderPath(_0x4a6e68,_0x10f14e,_0x55aa96)})),_0x2107be,_0x55aa96,_0x10f14e),{journeyFiles:_0x2fae7e,foldersToCreate:_0x2c1e70}=await withProgressSpinner(_0x2e1d05(0x103),async _0x475b9a=>prepareJourneyFiles(_0x2cf8ad,{'fetchJourney':async _0x5e2c55=>_0x5081d0[_0x2e1d05(0x12d)][_0x2e1d05(0x114)](_0x5e2c55[_0x2e1d05(0xf1)]),'journeyBundlesByFolderAndName':_0x5cb285,'folderPathToId':_0x496e9a,'idToEmailMap':_0x3f05b7,'connectionIdToNameMap':_0x3f72f8,'existingSegments':_0x3b2a40,'parentId':_0x4eec11,'deps':_0x5081d0,'progress':{'update':_0x43cc8d=>{const _0x389b35=_0x2e1d05;_0x475b9a['setPhase'](_0x43cc8d),_0x1b953e[_0x389b35(0x136)]&&console[_0x389b35(0xe7)]('\x20\x20'+_0x43cc8d);}},'journeyById':_0x33ad83,'activationStepsById':_0xe6eb04},_0x10f14e,_0x55aa96),{'verbose':_0x1b953e[_0x2e1d05(0x136)]})['then'](_0x46dd67=>_0x46dd67['data']);for(const _0x3cf688 of _0x2c1e70){_0x287be8[_0x2e1d05(0x115)](_0x3cf688);}const _0x5a4146=_0x4b981c?[]:findJourneysToDelete(_0x1c7bfb,_0x2cf8ad['map'](({yamlConfig:_0x1ce5a4,folderPath:_0x23e795})=>({'yamlConfig':_0x1ce5a4,'folderPath':resolveTDFolderPath(_0x23e795,_0x10f14e,_0x55aa96)})),_0x2107be,_0x55aa96,_0x10f14e),_0x189188=calculatePushStats(_0x2a75db,_0x2fae7e,_0x287be8,_0x18c5f8,_0x5a4146,!!_0x1b953e[_0x2e1d05(0x110)],!!_0x1b953e[_0x2e1d05(0x10e)]),_0x9e9a6f=_0x189188[_0x2e1d05(0x11f)][_0x2e1d05(0xde)],_0x27af47=_0x189188[_0x2e1d05(0x11f)][_0x2e1d05(0x121)],_0x4642d8=_0x189188[_0x2e1d05(0x11f)]['unchanged'],_0x5a67a5=_0x189188[_0x2e1d05(0x11f)][_0x2e1d05(0xc4)],_0x1a473d=_0x189188[_0x2e1d05(0xcf)][_0x2e1d05(0x130)],_0x1db17d=_0x189188['journeys']['new'],_0xfe2798=_0x189188[_0x2e1d05(0xe5)][_0x2e1d05(0x121)],_0x33c091=_0x189188[_0x2e1d05(0xe5)]['unchanged'],_0x226c0b=_0x189188[_0x2e1d05(0xe5)][_0x2e1d05(0xc4)],_0x1233d5=_0x189188['activations'][_0x2e1d05(0x125)],_0x47a7c0=_0x189188['activations'][_0x2e1d05(0x130)],_0x3a6fc9=_0x189188['activations'][_0x2e1d05(0x118)],_0x1ab9da=_0x189188[_0x2e1d05(0xcb)][_0x2e1d05(0xc4)];console['error'](_0x2e1d05(0xce)+_0x235df9+'\x27:');_0x1a473d[_0x2e1d05(0xe4)]>0x0&&console[_0x2e1d05(0xe7)]('\x20\x20'+a35_0x591012['blue'](_0x2e1d05(0x138)+_0x1a473d['length']+_0x2e1d05(0xd8)));if(!_0x1b953e['journeysOnly']){console[_0x2e1d05(0xe7)](_0x2e1d05(0x11c)),console[_0x2e1d05(0xe7)]('\x20\x20\x20\x20'+a35_0x591012['green']('+\x20'+_0x9e9a6f['length']+_0x2e1d05(0x143))),console[_0x2e1d05(0xe7)](_0x2e1d05(0x15a)+a35_0x591012['yellow']('~\x20'+_0x27af47['length']+_0x2e1d05(0xc3)));if(_0x5a67a5['length']>0x0)console[_0x2e1d05(0xe7)]('\x20\x20\x20\x20'+a35_0x591012[_0x2e1d05(0x11d)]('-\x20'+_0x5a67a5['length']+_0x2e1d05(0x120)));else _0x18c5f8[_0x2e1d05(0xe4)]>0x0&&!_0x1b953e[_0x2e1d05(0x110)]&&console['error'](_0x2e1d05(0x15a)+a35_0x591012[_0x2e1d05(0x151)](_0x18c5f8['length']+_0x2e1d05(0x101)));console['error'](_0x2e1d05(0x15a)+a35_0x591012[_0x2e1d05(0x151)]('=\x20'+_0x4642d8[_0x2e1d05(0xe4)]+_0x2e1d05(0x155)));}if(_0x2fae7e[_0x2e1d05(0xe4)]>0x0||_0x5a4146[_0x2e1d05(0xe4)]>0x0){console['error'](_0x2e1d05(0x147)),console[_0x2e1d05(0xe7)](_0x2e1d05(0x15a)+a35_0x591012[_0x2e1d05(0x119)]('+\x20'+_0x1db17d[_0x2e1d05(0xe4)]+_0x2e1d05(0x143))),console['error'](_0x2e1d05(0x15a)+a35_0x591012['yellow']('~\x20'+_0xfe2798[_0x2e1d05(0xe4)]+_0x2e1d05(0xc3)));if(_0x226c0b[_0x2e1d05(0xe4)]>0x0)console[_0x2e1d05(0xe7)](_0x2e1d05(0x15a)+a35_0x591012[_0x2e1d05(0x11d)]('-\x20'+_0x226c0b[_0x2e1d05(0xe4)]+_0x2e1d05(0x120)));else _0x5a4146[_0x2e1d05(0xe4)]>0x0&&!_0x1b953e['delete']&&console['error'](_0x2e1d05(0x15a)+a35_0x591012['dim'](_0x5a4146[_0x2e1d05(0xe4)]+_0x2e1d05(0x101)));console['error']('\x20\x20\x20\x20'+a35_0x591012[_0x2e1d05(0x151)]('=\x20'+_0x33c091[_0x2e1d05(0xe4)]+_0x2e1d05(0x155)));}_0x1233d5[_0x2e1d05(0xe4)]>0x0&&!_0x1b953e[_0x2e1d05(0x10e)]&&(console[_0x2e1d05(0xe7)](''),console[_0x2e1d05(0xe7)](_0x2e1d05(0x13f)),_0x47a7c0[_0x2e1d05(0xe4)]>0x0&&console[_0x2e1d05(0xe7)]('\x20\x20\x20\x20'+a35_0x591012['green']('+\x20'+_0x47a7c0['length']+_0x2e1d05(0xdf))),_0x3a6fc9[_0x2e1d05(0xe4)]>0x0&&console[_0x2e1d05(0xe7)](_0x2e1d05(0x15a)+a35_0x591012[_0x2e1d05(0xd3)]('~\x20'+_0x3a6fc9[_0x2e1d05(0xe4)]+'\x20to\x20update')),_0x1ab9da[_0x2e1d05(0xe4)]>0x0&&console['error'](_0x2e1d05(0x15a)+a35_0x591012[_0x2e1d05(0x11d)]('-\x20'+_0x1ab9da['length']+_0x2e1d05(0x120))));console['error'](_0x2e1d05(0x102)+a35_0x591012[_0x2e1d05(0x156)](_0x7251bb)+'\x0a');if(_0x1a473d[_0x2e1d05(0xe4)]>0x0){console[_0x2e1d05(0xe7)](_0x2e1d05(0xf5));for(const _0x4e1668 of _0x1a473d){console[_0x2e1d05(0xe7)]('\x20\x20'+a35_0x591012[_0x2e1d05(0x12c)]('+')+'\x20'+_0x4e1668);}console['error']('');}if(_0x9e9a6f[_0x2e1d05(0xe4)]>0x0&&!_0x1b953e[_0x2e1d05(0x10e)])for(const _0x733434 of _0x9e9a6f){const _0x503587=_0x733434[_0x2e1d05(0x10a)]?_0x733434[_0x2e1d05(0x10a)]+'/'+_0x733434['yamlConfig'][_0x2e1d05(0xcc)]:_0x733434['yamlConfig'][_0x2e1d05(0xcc)],_0x36de9d=_0x733434[_0x2e1d05(0x10c)][_0x2e1d05(0xcb)]?.[_0x2e1d05(0xe4)]||0x0,_0x44087b=_0x36de9d>0x0?a35_0x591012[_0x2e1d05(0x151)]('\x20['+_0x36de9d+_0x2e1d05(0xda)):'';console['error']('\x0a'+a35_0x591012['green']('New\x20segment:')+'\x20'+_0x503587+_0x44087b),console[_0x2e1d05(0xe7)]('─'['repeat'](0x3c)),_0x733434['diff']&&console['error'](_0x733434['diff']),console[_0x2e1d05(0xe7)]('─'[_0x2e1d05(0xf9)](0x3c));}if(_0x5a67a5[_0x2e1d05(0xe4)]>0x0&&!_0x1b953e[_0x2e1d05(0x10e)])for(const _0x2f2c01 of _0x5a67a5){const _0x53f484=_0x2f2c01['segmentFolderId']?_0x2107be[_0x2e1d05(0x14e)](_0x2f2c01['segmentFolderId'][_0x2e1d05(0xfc)]())||'':'',_0x31a774=_0x53f484?_0x53f484+'/'+_0x2f2c01[_0x2e1d05(0xcc)]:_0x2f2c01[_0x2e1d05(0xcc)],_0x54f9e3=_0x45bdb6[_0x2e1d05(0x14e)](_0x2f2c01['id'])||[],_0x3a34e6=_0x54f9e3[_0x2e1d05(0xe4)]>0x0?a35_0x591012[_0x2e1d05(0x151)]('\x20['+_0x54f9e3[_0x2e1d05(0xe4)]+'\x20activations]'):'';console[_0x2e1d05(0xe7)]('\x0a'+a35_0x591012[_0x2e1d05(0x11d)](_0x2e1d05(0x132))+'\x20'+_0x31a774+_0x3a34e6),console[_0x2e1d05(0xe7)]('─'['repeat'](0x3c));const _0x14efa4=segmentWithActivationsToYaml(_0x2f2c01,_0x54f9e3,undefined,_0x3f05b7,_0x3f72f8),_0x3bb4f8=segmentToYamlString(_0x14efa4),_0x9a9400=generateDiff(_0x3bb4f8,'');console[_0x2e1d05(0xe7)](formatDiffWithColors(_0x9a9400)),console['error']('─'['repeat'](0x3c));}const _0x5cb1a8=_0x2a75db[_0x2e1d05(0x154)](_0x1e4fba=>!_0x1e4fba[_0x2e1d05(0xc5)]&&_0x1e4fba[_0x2e1d05(0x11e)]);if(_0x5cb1a8[_0x2e1d05(0xe4)]>0x0&&!_0x1b953e['journeysOnly'])for(const _0x3d1d59 of _0x5cb1a8){const _0x4c57b9=_0x3d1d59['folderPath']?_0x3d1d59[_0x2e1d05(0x10a)]+'/'+_0x3d1d59['yamlConfig'][_0x2e1d05(0xcc)]:_0x3d1d59[_0x2e1d05(0x10c)]['name'];console[_0x2e1d05(0xe7)]('\x0a'+a35_0x591012['yellow'](_0x2e1d05(0xfe))+'\x20'+_0x4c57b9),console[_0x2e1d05(0xe7)]('─'[_0x2e1d05(0xf9)](0x3c)),console[_0x2e1d05(0xe7)](_0x3d1d59[_0x2e1d05(0x11e)]),console['error']('─'['repeat'](0x3c));}if(_0x1db17d[_0x2e1d05(0xe4)]>0x0)for(const _0xdd0a74 of _0x1db17d){const _0x45bf57=_0xdd0a74[_0x2e1d05(0x10a)]?_0xdd0a74['folderPath']+'/'+_0xdd0a74[_0x2e1d05(0x10c)]['name']:_0xdd0a74[_0x2e1d05(0x10c)]['name'];console[_0x2e1d05(0xe7)]('\x0a'+a35_0x591012['green'](_0x2e1d05(0xed))+'\x20'+_0x45bf57),console[_0x2e1d05(0xe7)]('─'[_0x2e1d05(0xf9)](0x3c)),_0xdd0a74['diff']&&console[_0x2e1d05(0xe7)](_0xdd0a74['diff']),console['error']('─'[_0x2e1d05(0xf9)](0x3c));}const _0x50c23f=_0x2fae7e[_0x2e1d05(0x154)](_0x3f0c80=>!_0x3f0c80[_0x2e1d05(0xc5)]&&_0x3f0c80['diff']);if(_0x50c23f[_0x2e1d05(0xe4)]>0x0)for(const _0x391cf8 of _0x50c23f){const _0xb2423e=_0x391cf8['folderPath']?_0x391cf8[_0x2e1d05(0x10a)]+'/'+_0x391cf8[_0x2e1d05(0x10c)][_0x2e1d05(0xcc)]:_0x391cf8['yamlConfig'][_0x2e1d05(0xcc)];console['error']('\x0a'+a35_0x591012[_0x2e1d05(0xd3)](_0x2e1d05(0xea))+'\x20'+_0xb2423e),console[_0x2e1d05(0xe7)]('─'['repeat'](0x3c)),console[_0x2e1d05(0xe7)](_0x391cf8[_0x2e1d05(0x11e)]),console['error']('─'[_0x2e1d05(0xf9)](0x3c));}if(_0x226c0b[_0x2e1d05(0xe4)]>0x0)for(const _0x1f224a of _0x226c0b){const _0x1fdf14=_0x1f224a[_0x2e1d05(0xe1)]?_0x2107be['get'](_0x1f224a[_0x2e1d05(0xe1)])||'':'',_0x1540ab=_0x1fdf14?_0x1fdf14+'/'+_0x1f224a[_0x2e1d05(0x153)]:_0x1f224a['journeyBundleName'];console[_0x2e1d05(0xe7)]('\x0a'+a35_0x591012[_0x2e1d05(0x11d)](_0x2e1d05(0x116))+'\x20'+_0x1540ab),console['error']('─'[_0x2e1d05(0xf9)](0x3c)),console[_0x2e1d05(0xe7)](a35_0x591012[_0x2e1d05(0x11d)]('(Journey\x20will\x20be\x20deleted)')),console['error']('─'['repeat'](0x3c));}if(_0x1b953e[_0x2e1d05(0x109)])return console[_0x2e1d05(0xe7)](a35_0x591012[_0x2e1d05(0xd3)](_0x2e1d05(0xfb))),0x0;const _0x25b57b=_0x1b953e[_0x2e1d05(0x10e)]?![]:_0x9e9a6f[_0x2e1d05(0xe4)]>0x0||_0x27af47[_0x2e1d05(0xe4)]>0x0||_0x5a67a5[_0x2e1d05(0xe4)]>0x0,_0x3a6bf4=_0x1db17d['length']>0x0||_0xfe2798[_0x2e1d05(0xe4)]>0x0||_0x226c0b['length']>0x0,_0x4ee3dd=_0x1b953e['journeysOnly']?![]:_0x1233d5[_0x2e1d05(0xe4)]>0x0,_0x3a0d3a=_0x1a473d[_0x2e1d05(0xe4)]>0x0;if(!_0x25b57b&&!_0x3a6bf4&&!_0x4ee3dd&&!_0x3a0d3a){const _0x2a7741=_0x1b953e['journeysOnly']?'βœ”\x20All\x20journeys\x20are\x20up\x20to\x20date':_0x2e1d05(0xe8);console['error'](a35_0x591012['green'](_0x2a7741));if(_0x4b981c&&_0x33c091['length']===0x1){const _0x5e4e27=_0x33c091[0x0];if(_0x5e4e27[_0x2e1d05(0x148)]?.['id']){const _0x3bc2b8=getConsoleNextUrl(_0x1b953e['site'],_0x2e1d05(0x157)+_0x4eec11+_0x2e1d05(0x13b)+_0x5e4e27[_0x2e1d05(0x148)]['id']+_0x2e1d05(0x13e));console[_0x2e1d05(0xe7)]('\x20\x20'+a35_0x591012['cyan'](_0x3bc2b8));}}return 0x0;}const _0xfe468f=_0x1b953e[_0x2e1d05(0x10e)]?_0x1db17d['length']+_0xfe2798[_0x2e1d05(0xe4)]+_0x226c0b[_0x2e1d05(0xe4)]+_0x1a473d['length']:_0x9e9a6f['length']+_0x27af47[_0x2e1d05(0xe4)]+_0x5a67a5[_0x2e1d05(0xe4)]+_0x1db17d[_0x2e1d05(0xe4)]+_0xfe2798['length']+_0x226c0b[_0x2e1d05(0xe4)]+_0x1a473d[_0x2e1d05(0xe4)]+_0x1233d5['length'];if(!_0x1b953e[_0x2e1d05(0x13c)]&&_0xfe468f>0x0){if(!isInteractive())return console[_0x2e1d05(0xe7)](a35_0x591012[_0x2e1d05(0x11d)]('\x0aError:'),_0x2e1d05(0xd6)),console[_0x2e1d05(0xe7)](a35_0x591012[_0x2e1d05(0x151)](_0x2e1d05(0x14d))),0x1;const _0x9cc18d=await confirmKey(_0x2e1d05(0x14b)+_0xfe468f+'\x20changes?');if(!_0x9cc18d)return console[_0x2e1d05(0xe7)](a35_0x591012['yellow']('Aborted.')),0x1;}const _0x7e771b={'withProgress':async(_0x305ab7,_0x2039fc)=>{const _0x3e105c=_0x2e1d05,_0x404141=await withSpinner(_0x305ab7,_0x2039fc,{'verbose':_0x1b953e[_0x3e105c(0x136)]});return{'data':_0x404141[_0x3e105c(0x127)]};},'logInfo':_0x1308c9=>console[_0x2e1d05(0xe7)](a35_0x591012[_0x2e1d05(0x12c)]('βœ”\x20'+_0x1308c9)),'logSuccess':_0x1a1759=>console['error'](a35_0x591012['green']('βœ”\x20'+_0x1a1759)),'logWarning':_0x8904fb=>console[_0x2e1d05(0xe7)](a35_0x591012[_0x2e1d05(0xd3)]('⚠\x20'+_0x8904fb)),'logDeleted':_0xdcd70f=>console[_0x2e1d05(0xe7)](a35_0x591012['red']('βœ”\x20'+_0xdcd70f))},_0x2f047c={'segment':_0x5081d0[_0x2e1d05(0x146)],'journey':_0x5081d0[_0x2e1d05(0x12d)],'user':_0x5081d0['user'],'connection':_0x5081d0[_0x2e1d05(0x141)]};_0x1a473d[_0x2e1d05(0xe4)]>0x0&&(_0x496e9a=await executePushFolders(_0x2f047c,_0x1a473d,_0x496e9a,{'parentId':_0x4eec11},_0x7e771b));const _0x1154c1={'rootFolderId':_0x4863f2,'folderPathToId':_0x496e9a,'folderIdToPath':_0x2107be,'segmentNameToId':_0x5d9a5b,'activationsBySegmentId':_0x45bdb6,'emailToIdMap':_0x42999b,'idToEmailMap':_0x3f05b7,'connectionNameToIdMap':_0x4eaea7[_0x2e1d05(0x144)],'connectionIdToNameMap':_0x4eaea7[_0x2e1d05(0x14c)],'connectionNameToTypeMap':_0x467443},_0x531a6e=await executePushSegments(_0x2f047c,_0x1b953e[_0x2e1d05(0x10e)]?[]:_0x2a75db,_0x1154c1,{'parentId':_0x4eec11},_0x7e771b),_0x4610d1=_0x531a6e[_0x2e1d05(0x133)],_0x2a2122=_0x531a6e[_0x2e1d05(0xf7)],_0x20b06d=_0x531a6e[_0x2e1d05(0xcb)][_0x2e1d05(0x133)],_0x399dec=_0x531a6e['activations'][_0x2e1d05(0xf7)],_0x4b93ce=_0x531a6e[_0x2e1d05(0xcb)][_0x2e1d05(0xd4)],_0x239f2e=await executePushSegmentDeletions(_0x2f047c,_0x1b953e[_0x2e1d05(0x10e)]?[]:_0x5a67a5,_0x7e771b);let _0x2f56aa=0x0,_0x245ac1=0x0,_0x236e60=0x0;const _0x3127e3=new Map(_0x5d9a5b);for(const [_0x9a0569,_0x4b6fb2]of _0x531a6e[_0x2e1d05(0x11b)]){_0x3127e3['set'](_0x9a0569,_0x4b6fb2);}if(_0x2fae7e[_0x2e1d05(0xe4)]>0x0){const _0x569a03={..._0x1154c1,'segmentNameToId':_0x3127e3,'existingSegments':_0x3b2a40,'activationContext':_0x2cbab8},_0x4fcb23=await executePushJourneys(_0x2f047c,_0x2fae7e,_0x569a03,{'parentId':_0x4eec11,'rootFolderId':_0x4863f2,'verbose':_0x1b953e[_0x2e1d05(0x136)]},_0x7e771b);_0x2f56aa=_0x4fcb23[_0x2e1d05(0x133)],_0x245ac1=_0x4fcb23[_0x2e1d05(0xf7)];if(_0x4b981c&&_0x4fcb23[_0x2e1d05(0x142)][_0x2e1d05(0xe4)]===0x1){const _0x3dfc5b=_0x4fcb23[_0x2e1d05(0x142)][0x0];if(_0x3dfc5b[_0x2e1d05(0xf1)]){const _0x2eb749=getConsoleNextUrl(_0x1b953e['site'],_0x2e1d05(0x157)+_0x4eec11+'/e/'+_0x3dfc5b[_0x2e1d05(0xf1)]+_0x2e1d05(0x13e));console[_0x2e1d05(0xe7)]('\x20\x20'+a35_0x591012[_0x2e1d05(0x156)](_0x2eb749));}}}for(const _0xddc496 of _0x226c0b){console['error'](a35_0x591012[_0x2e1d05(0xd3)](_0x2e1d05(0xc9)+_0xddc496[_0x2e1d05(0x153)])),_0x236e60++;}const _0x52e360=[];if(_0x4610d1>0x0)_0x52e360[_0x2e1d05(0x158)](_0x4610d1+_0x2e1d05(0x104));if(_0x2a2122>0x0)_0x52e360[_0x2e1d05(0x158)](_0x2a2122+_0x2e1d05(0x137));if(_0x239f2e>0x0)_0x52e360[_0x2e1d05(0x158)](_0x239f2e+'\x20deleted');const _0x136565=[];if(_0x2f56aa>0x0)_0x136565['push'](_0x2f56aa+_0x2e1d05(0x104));if(_0x245ac1>0x0)_0x136565[_0x2e1d05(0x158)](_0x245ac1+_0x2e1d05(0x137));if(_0x236e60>0x0)_0x136565['push'](_0x236e60+_0x2e1d05(0x112));const _0x4893e7=[];if(_0x20b06d>0x0)_0x4893e7[_0x2e1d05(0x158)](_0x20b06d+_0x2e1d05(0x104));if(_0x399dec>0x0)_0x4893e7[_0x2e1d05(0x158)](_0x399dec+_0x2e1d05(0x137));if(_0x4b93ce>0x0)_0x4893e7[_0x2e1d05(0x158)](_0x4b93ce+_0x2e1d05(0x112));return console[_0x2e1d05(0xe7)](a35_0x591012[_0x2e1d05(0x119)]('\x0aβœ”\x20Push\x20complete')),_0x52e360[_0x2e1d05(0xe4)]>0x0&&!_0x1b953e[_0x2e1d05(0x10e)]&&console['error'](_0x2e1d05(0x12f)+_0x52e360[_0x2e1d05(0xfd)](',\x20')),_0x136565[_0x2e1d05(0xe4)]>0x0&&console[_0x2e1d05(0xe7)](_0x2e1d05(0x14f)+_0x136565['join'](',\x20')),_0x4893e7[_0x2e1d05(0xe4)]>0x0&&!_0x1b953e[_0x2e1d05(0x10e)]&&console[_0x2e1d05(0xe7)](_0x2e1d05(0xd1)+_0x4893e7[_0x2e1d05(0xfd)](',\x20')),0x0;}}
1
+ const a35_0xbc02cc=a35_0x4411;(function(_0x42d631,_0x15bee6){const _0x10c9df=a35_0x4411,_0x372312=_0x42d631();while(!![]){try{const _0x2dc407=parseInt(_0x10c9df(0xc9))/0x1+-parseInt(_0x10c9df(0xcd))/0x2+-parseInt(_0x10c9df(0xee))/0x3*(parseInt(_0x10c9df(0x118))/0x4)+parseInt(_0x10c9df(0xae))/0x5+parseInt(_0x10c9df(0xce))/0x6+parseInt(_0x10c9df(0x10b))/0x7*(-parseInt(_0x10c9df(0xc5))/0x8)+parseInt(_0x10c9df(0xb6))/0x9*(parseInt(_0x10c9df(0x12f))/0xa);if(_0x2dc407===_0x15bee6)break;else _0x372312['push'](_0x372312['shift']());}catch(_0x5a7d43){_0x372312['push'](_0x372312['shift']());}}}(a35_0x538b,0x3a321));import{BaseCommand}from'./command.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{generateDiff,formatDiffWithColors}from'../utils/diff.js';function a35_0x538b(){const _0x28a624=['yes','journeysOnly','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','45qyUGvU','\x20\x20πŸ“Š\x20Segments:','changed','\x20unchanged','yamlConfig','\x0aβœ”\x20Push\x20complete','scopedFolderPath','\x0aError:','cyan','getOutputSchemaWithCache','state','green','unchanged','Delete\x20journey:','set','224FkEaup','folderId','dryRun','.yml','117602hriewO','parentSegment','all','updated','556328XcEGtt','1436064kjltqO','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','\x20\x20πŸ—ΊοΈ\x20\x20Journeys:','repeat','Fetching\x20existing\x20data...','activations','/j/da/je','toString','message','toCreate','parentName','Changes\x20to:','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','\x20to\x20create','length','existingJourney','πŸ“\x20','\x20activations]','folderPath','blue','file','New\x20segment:','\x20\x20Activations:','map','segmentFolderId','journey','filter','New\x20journey:','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','attributes','type','journeys','6sEAbsx','new','data','nameToId','listFolders','journeyId','\x20created','red','segment\x20or\x20journey','Parent\x20segment:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','/e/','push','isNew','journeyBundleName','journeyBundleId','parent_name','dim','error','segments','join','folders','\x20changed','versionNumber','Resolving\x20parent\x20segment\x20\x27','created','then','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','listJourneysWithDetailsFromParentSegment','58317DpElXI','listActivations','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','Changes\x20to\x20journey:','setPhase','toUpdate','connection','\x20new','errorCode','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','\x20\x20\x20\x20','getJourney','232780LTONkQ','(Journey\x20will\x20be\x20deleted)','description','Push\x20','\x20updated','delete','execute','Fetching\x20connections\x20for\x20name\x20resolution...','Error:\x20Directory\x20not\x20found:\x20','parentFolder','Aborted.','\x20folders\x20to\x20create','Error\x20parsing\x20YAML:\x20','getParent','results','Error:\x20','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','segment','\x0aValidation\x20failed:','yellow','βœ”\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','site','\x20changes?','175150YslQCW','Folders\x20to\x20create:','diff','verbose','\x20deleted','user','βœ”\x20All\x20journeys\x20are\x20up\x20to\x20date','get','segment:push','targetDir','endsWith','\x20\x20Journeys:\x20','name','Source\x20directory:\x20','relationships','idToName','\x20\x20Source:\x20','\x20to\x20delete','Scoped\x20to\x20folder:\x20','deleted','2108350zAqiOl','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','no_parent','toDelete','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files'];a35_0x538b=function(){return _0x28a624;};return a35_0x538b();}import{confirmKey,isInteractive}from'../utils/prompt.js';function a35_0x4411(_0xc6a784,_0x18521d){_0xc6a784=_0xc6a784-0xac;const _0x538b1a=a35_0x538b();let _0x441197=_0x538b1a[_0xc6a784];return _0x441197;}import{batchAsync}from'../utils/async.js';import{segmentToYamlString,segmentWithActivationsToYaml}from'../sdk/segment/child-segment-yaml.js';import a35_0x49a32b from'chalk';import{existsSync}from'fs';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{resolveTarget,isSuccessfulResolution,getScopedDetails}from'../sdk/segment/target-resolution.js';import{buildFolderMaps}from'../sdk/segment/resolution-context.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{resolveTDFolderPath,findSegmentsToDelete,findJourneysToDelete,buildSegmentLookupMap,buildSegmentNameToIdMap,buildJourneyBundleLookupMap,parseAndClassifyYamlFiles,validateParsedFiles,formatValidationErrors,extractRootFolderId,buildConnectionMaps,calculatePushStats,prepareSegmentFiles,prepareJourneyFiles,executePushSegments,executePushFolders,executePushSegmentDeletions,executePushJourneys}from'../sdk/segment/push-workflow.js';export class SegmentPushCommand extends BaseCommand{[a35_0xbc02cc(0x13b)]=a35_0xbc02cc(0x137);[a35_0xbc02cc(0x11a)]=a35_0xbc02cc(0x115);async[a35_0xbc02cc(0x11e)](_0x4fe48){const _0x2028eb=a35_0xbc02cc,{options:_0x38363f,args:_0x1c107d,tdx:_0x2de074}=_0x4fe48,_0x2ceab2=_0x38363f,_0x4df4ef=await resolveTarget({'arg':_0x1c107d[0x0],'contextParent':_0x38363f[_0x2028eb(0xca)],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x4df4ef))return _0x4df4ef[_0x2028eb(0x113)]===_0x2028eb(0xb0)?(console[_0x2028eb(0x100)](a35_0x49a32b[_0x2028eb(0x12b)]('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console['error']('Usage:\x20tdx\x20sg\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20(requires\x20context)'),console[_0x2028eb(0x100)](_0x2028eb(0xf8)),console[_0x2028eb(0x100)](_0x2028eb(0x114))):(console[_0x2028eb(0x100)](a35_0x49a32b['red'](_0x2028eb(0x127)+_0x4df4ef['message']+'\x0a')),_0x4df4ef['helpText']&&console['error'](a35_0x49a32b[_0x2028eb(0xbe)](_0x4df4ef['helpText']))),0x1;if(_0x4df4ef[_0x2028eb(0xec)]===_0x2028eb(0xfe))return console['error'](a35_0x49a32b[_0x2028eb(0xf5)](_0x2028eb(0x120)+_0x4df4ef['targetDir']+'\x0a')),console[_0x2028eb(0x100)](a35_0x49a32b[_0x2028eb(0xbe)](_0x2028eb(0xcf))),0x1;const _0x55bbda=_0x4df4ef[_0x2028eb(0xd8)],_0x4cc21a=_0x4df4ef[_0x2028eb(0x138)],_0x3a85dd=_0x4df4ef[_0x2028eb(0xec)]===_0x2028eb(0xe2)?_0x4df4ef['filePath']:undefined,_0x2cbd4a=getScopedDetails(_0x4df4ef),_0x2e5bd9=_0x2cbd4a?.['isScoped']??![],_0x39660e=_0x2cbd4a?.[_0x2028eb(0xbc)]??'';if(!existsSync(_0x4cc21a))return console[_0x2028eb(0x100)](a35_0x49a32b[_0x2028eb(0xf5)](_0x2028eb(0x120)+_0x4cc21a+'\x0a')),console[_0x2028eb(0x100)](a35_0x49a32b[_0x2028eb(0xbe)](_0x2028eb(0xcf))),0x1;_0x2ceab2[_0x2028eb(0x132)]&&(console[_0x2028eb(0x100)]('Site:\x20'+_0x2ceab2[_0x2028eb(0x12d)]),console[_0x2028eb(0x100)](_0x2028eb(0xf7)+_0x55bbda),console['error'](_0x2028eb(0x13c)+_0x4cc21a),_0x2e5bd9&&console[_0x2028eb(0x100)](_0x2028eb(0xac)+_0x39660e));const _0x235bd3=await withSpinner(_0x2028eb(0x106)+_0x55bbda+'\x27...',()=>_0x2de074[_0x2028eb(0x129)]['resolveParentId'](_0x55bbda),{'verbose':_0x2ceab2[_0x2028eb(0x132)]}),_0x122245=_0x235bd3[_0x2028eb(0xf0)],{parentSegmentResult:_0x52426a,segmentsResult:_0x48bfd7,foldersResult:_0x2773e5,journeysWithDetailsResult:_0x169d0c,userMaps:_0x2dc2d}=await withSpinner(_0x2028eb(0xd2),async()=>{const _0x2699d6=_0x2028eb,[_0x2c7b81,_0x2ce8e7,_0xefa78c,_0x3f339a,_0x25152c]=await Promise[_0x2699d6(0xcb)]([_0x2de074['segment'][_0x2699d6(0x125)](_0x122245),_0x2de074[_0x2699d6(0x129)]['listSegments'](_0x122245),_0x2de074[_0x2699d6(0x129)][_0x2699d6(0xf2)](_0x122245),_0x2de074[_0x2699d6(0xe7)][_0x2699d6(0x10a)](_0x122245,{'includeAllVersions':!![]}),_0x2de074[_0x2699d6(0x134)]['buildUserMaps']()]);return{'parentSegmentResult':_0x2c7b81,'segmentsResult':_0x2ce8e7,'foldersResult':_0xefa78c,'journeysWithDetailsResult':_0x3f339a,'userMaps':_0x25152c};},{'verbose':_0x2ceab2['verbose']})[_0x2028eb(0x108)](_0x2f1be1=>_0x2f1be1['data']),_0x3e4254=_0x52426a,_0x3daec3=extractRootFolderId(_0x3e4254),_0x37e410=_0x48bfd7,_0x2e7198=_0x2773e5,{journeys:_0x3885f6,activationStepsById:_0x50d112}=_0x169d0c,_0x2a3628=new Map(_0x3885f6[_0x2028eb(0xe5)](_0x38d86d=>[_0x38d86d['id'],_0x38d86d])),_0x357b49=_0x3885f6['map'](_0x32657c=>({'id':_0x32657c['id'],'name':_0x32657c[_0x2028eb(0xeb)][_0x2028eb(0x13b)],'journeyBundleName':_0x32657c[_0x2028eb(0xeb)]['journeyBundleName']||'','journeyBundleId':_0x32657c[_0x2028eb(0xeb)][_0x2028eb(0xfd)]||'','versionNumber':_0x32657c[_0x2028eb(0xeb)][_0x2028eb(0x105)],'description':_0x32657c[_0x2028eb(0xeb)][_0x2028eb(0x11a)],'state':_0x32657c[_0x2028eb(0xeb)][_0x2028eb(0xc0)],'paused':_0x32657c[_0x2028eb(0xeb)]['paused'],'audienceId':_0x32657c['attributes']['audienceId'],'folderId':_0x32657c[_0x2028eb(0x13d)]?.[_0x2028eb(0x121)]?.[_0x2028eb(0xf0)]?.['id'],'createdAt':_0x32657c[_0x2028eb(0xeb)]['createdAt'],'updatedAt':_0x32657c[_0x2028eb(0xeb)]['updatedAt']})),{emailToId:_0x4a10e3,idToEmail:_0x180aee}=_0x2dc2d,_0x7dce52=await withSpinner(_0x2028eb(0x11f),async()=>{const _0x4a4031=_0x2028eb,_0x1e3a88=await _0x2de074[_0x4a4031(0x111)]['list']();return buildConnectionMaps(_0x1e3a88);},{'verbose':_0x2ceab2['verbose']})[_0x2028eb(0x108)](_0x572db6=>_0x572db6[_0x2028eb(0xf0)]),_0xa0cd6=_0x7dce52['nameToId'],_0x1f099a=_0x7dce52[_0x2028eb(0x13e)],_0x5d9205=_0x7dce52['nameToType'],_0x30f224={'emailToIdMap':_0x4a10e3,'connectionNameToIdMap':_0xa0cd6,'connectionNameToTypeMap':_0x5d9205,'getSchema':_0x102cb2=>_0x2de074['connection'][_0x2028eb(0xbf)](_0x102cb2)};let {pathToId:_0x354b5c,idToPath:_0x54b16d}=buildFolderMaps(_0x2e7198);const _0x1e19bf=buildSegmentLookupMap(_0x37e410,_0x54b16d),_0x44e1b5=buildSegmentNameToIdMap(_0x37e410),_0x3e23e2=buildJourneyBundleLookupMap(_0x357b49,_0x54b16d);let _0x188475;if(_0x3a85dd){if(!_0x3a85dd['endsWith'](_0x2028eb(0xc8))&&!_0x3a85dd[_0x2028eb(0x139)]('.yaml'))return console['error'](a35_0x49a32b['red'](_0x2028eb(0xea)+_0x3a85dd+'\x0a')),0x1;_0x188475=[_0x3a85dd];}else _0x188475=findYamlFiles(_0x4cc21a);if(_0x188475[_0x2028eb(0xdc)]===0x0)return console[_0x2028eb(0x100)](a35_0x49a32b['red'](_0x2028eb(0xb5)+_0x4cc21a+'\x0a')),console[_0x2028eb(0x100)](a35_0x49a32b[_0x2028eb(0xbe)](_0x2028eb(0xb2))),0x1;let _0x5266f8,_0x12b8f1;try{const _0xba8c8e=parseAndClassifyYamlFiles(_0x188475,_0x4cc21a,{'skipSegments':_0x2ceab2[_0x2028eb(0xb4)]});_0x5266f8=_0xba8c8e['segments'],_0x12b8f1=_0xba8c8e['journeys'];const _0xd1beb5=validateParsedFiles(_0xba8c8e,_0x4cc21a);if(_0xd1beb5[_0x2028eb(0xdc)]>0x0)return console[_0x2028eb(0x100)](a35_0x49a32b['red'](_0x2028eb(0x12a))),console[_0x2028eb(0x100)](formatValidationErrors(_0xd1beb5)),console[_0x2028eb(0x100)](a35_0x49a32b[_0x2028eb(0x12b)](_0x2028eb(0x109))),0x1;}catch(_0x47b897){return console[_0x2028eb(0x100)](a35_0x49a32b[_0x2028eb(0xf5)](_0x2028eb(0x124)+(_0x47b897 instanceof Error?_0x47b897[_0x2028eb(0xd6)]:_0x47b897))),0x1;}if(_0x5266f8[_0x2028eb(0xdc)]===0x0&&_0x12b8f1[_0x2028eb(0xdc)]===0x0){const _0xf54ee5=_0x2ceab2[_0x2028eb(0xb4)]?_0x2028eb(0xe7):_0x2028eb(0xf6);return console['error'](a35_0x49a32b[_0x2028eb(0x12b)]('No\x20'+_0xf54ee5+'\x20YAML\x20files\x20found')),0x0;}const _0x3a87b0=new Map();_0x37e410['length']>0x0&&!_0x2ceab2[_0x2028eb(0xb4)]&&await withSpinner('Fetching\x20existing\x20activations...',async()=>{await batchAsync(_0x37e410,async _0x2b3595=>{const _0x3c0b46=a35_0x4411,_0x11079f=await _0x2de074[_0x3c0b46(0x129)][_0x3c0b46(0x10c)](_0x122245,_0x2b3595['id']);_0x3a87b0[_0x3c0b46(0xc4)](_0x2b3595['id'],_0x11079f);});},{'verbose':_0x2ceab2[_0x2028eb(0x132)]});const {segmentFiles:_0x5b2276,foldersToCreate:_0x38fecc}=await prepareSegmentFiles(_0x5266f8,{'segmentByFolderAndName':_0x1e19bf,'activationsBySegmentId':_0x3a87b0,'folderPathToId':_0x354b5c,'idToEmailMap':_0x180aee,'connectionIdToNameMap':_0x1f099a},_0x30f224,_0x2e5bd9,_0x39660e),_0x31ffe1=_0x3a85dd?[]:findSegmentsToDelete(_0x37e410,_0x5266f8[_0x2028eb(0xe5)](({yamlConfig:_0x143e7e,folderPath:_0x5aaf75})=>({'yamlConfig':_0x143e7e,'folderPath':resolveTDFolderPath(_0x5aaf75,_0x2e5bd9,_0x39660e)})),_0x54b16d,_0x39660e,_0x2e5bd9),{journeyFiles:_0xebdd7a,foldersToCreate:_0x141d45}=await withProgressSpinner('Preparing\x20journeys...',async _0x596258=>prepareJourneyFiles(_0x12b8f1,{'fetchJourney':async _0x1c3d9d=>_0x2de074[_0x2028eb(0xe7)][_0x2028eb(0x117)](_0x1c3d9d[_0x2028eb(0xf3)]),'journeyBundlesByFolderAndName':_0x3e23e2,'folderPathToId':_0x354b5c,'idToEmailMap':_0x180aee,'connectionIdToNameMap':_0x1f099a,'existingSegments':_0x37e410,'parentId':_0x122245,'deps':_0x2de074,'progress':{'update':_0x10a640=>{const _0x277cba=_0x2028eb;_0x596258[_0x277cba(0x10f)](_0x10a640),_0x2ceab2[_0x277cba(0x132)]&&console['error']('\x20\x20'+_0x10a640);}},'journeyById':_0x2a3628,'activationStepsById':_0x50d112},_0x2e5bd9,_0x39660e),{'verbose':_0x2ceab2[_0x2028eb(0x132)]})[_0x2028eb(0x108)](_0x256d75=>_0x256d75['data']);for(const _0x39819e of _0x141d45){_0x38fecc['add'](_0x39819e);}const _0x505b82=_0x3a85dd?[]:findJourneysToDelete(_0x357b49,_0x12b8f1['map'](({yamlConfig:_0x2be74d,folderPath:_0x43f773})=>({'yamlConfig':_0x2be74d,'folderPath':resolveTDFolderPath(_0x43f773,_0x2e5bd9,_0x39660e)})),_0x54b16d,_0x39660e,_0x2e5bd9),_0x55dc0c=calculatePushStats(_0x5b2276,_0xebdd7a,_0x38fecc,_0x31ffe1,_0x505b82,!!_0x2ceab2[_0x2028eb(0x11d)],!!_0x2ceab2[_0x2028eb(0xb4)]),_0x1c8d8a=_0x55dc0c[_0x2028eb(0x101)][_0x2028eb(0xef)],_0x3628ac=_0x55dc0c[_0x2028eb(0x101)][_0x2028eb(0xb8)],_0xef851a=_0x55dc0c[_0x2028eb(0x101)]['unchanged'],_0x42af08=_0x55dc0c[_0x2028eb(0x101)][_0x2028eb(0xb1)],_0x16ace4=_0x55dc0c[_0x2028eb(0x103)]['toCreate'],_0x486fd6=_0x55dc0c[_0x2028eb(0xed)][_0x2028eb(0xef)],_0x10424b=_0x55dc0c[_0x2028eb(0xed)]['changed'],_0x5773c6=_0x55dc0c[_0x2028eb(0xed)][_0x2028eb(0xc2)],_0x398c59=_0x55dc0c[_0x2028eb(0xed)][_0x2028eb(0xb1)],_0x5aa7dc=_0x55dc0c[_0x2028eb(0xd3)][_0x2028eb(0xcb)],_0x355513=_0x55dc0c[_0x2028eb(0xd3)][_0x2028eb(0xd7)],_0x5911b4=_0x55dc0c[_0x2028eb(0xd3)][_0x2028eb(0x110)],_0xaa96eb=_0x55dc0c[_0x2028eb(0xd3)][_0x2028eb(0xb1)];console[_0x2028eb(0x100)]('\x0aPush\x20summary\x20for\x20\x27'+_0x55bbda+'\x27:');_0x16ace4[_0x2028eb(0xdc)]>0x0&&console['error']('\x20\x20'+a35_0x49a32b[_0x2028eb(0xe1)](_0x2028eb(0xde)+_0x16ace4['length']+_0x2028eb(0x123)));if(!_0x2ceab2[_0x2028eb(0xb4)]){console[_0x2028eb(0x100)](_0x2028eb(0xb7)),console[_0x2028eb(0x100)]('\x20\x20\x20\x20'+a35_0x49a32b[_0x2028eb(0xc1)]('+\x20'+_0x1c8d8a['length']+_0x2028eb(0x112))),console[_0x2028eb(0x100)](_0x2028eb(0x116)+a35_0x49a32b[_0x2028eb(0x12b)]('~\x20'+_0x3628ac[_0x2028eb(0xdc)]+'\x20changed'));if(_0x42af08[_0x2028eb(0xdc)]>0x0)console[_0x2028eb(0x100)](_0x2028eb(0x116)+a35_0x49a32b[_0x2028eb(0xf5)]('-\x20'+_0x42af08[_0x2028eb(0xdc)]+_0x2028eb(0x140)));else _0x31ffe1[_0x2028eb(0xdc)]>0x0&&!_0x2ceab2[_0x2028eb(0x11d)]&&console[_0x2028eb(0x100)]('\x20\x20\x20\x20'+a35_0x49a32b[_0x2028eb(0xff)](_0x31ffe1[_0x2028eb(0xdc)]+_0x2028eb(0x10d)));console['error'](_0x2028eb(0x116)+a35_0x49a32b['dim']('=\x20'+_0xef851a['length']+'\x20unchanged'));}if(_0xebdd7a[_0x2028eb(0xdc)]>0x0||_0x505b82[_0x2028eb(0xdc)]>0x0){console[_0x2028eb(0x100)](_0x2028eb(0xd0)),console[_0x2028eb(0x100)](_0x2028eb(0x116)+a35_0x49a32b[_0x2028eb(0xc1)]('+\x20'+_0x486fd6[_0x2028eb(0xdc)]+_0x2028eb(0x112))),console[_0x2028eb(0x100)](_0x2028eb(0x116)+a35_0x49a32b['yellow']('~\x20'+_0x10424b[_0x2028eb(0xdc)]+_0x2028eb(0x104)));if(_0x398c59[_0x2028eb(0xdc)]>0x0)console[_0x2028eb(0x100)](_0x2028eb(0x116)+a35_0x49a32b[_0x2028eb(0xf5)]('-\x20'+_0x398c59['length']+_0x2028eb(0x140)));else _0x505b82[_0x2028eb(0xdc)]>0x0&&!_0x2ceab2[_0x2028eb(0x11d)]&&console['error'](_0x2028eb(0x116)+a35_0x49a32b['dim'](_0x505b82[_0x2028eb(0xdc)]+_0x2028eb(0x10d)));console[_0x2028eb(0x100)](_0x2028eb(0x116)+a35_0x49a32b[_0x2028eb(0xff)]('=\x20'+_0x5773c6[_0x2028eb(0xdc)]+_0x2028eb(0xb9)));}_0x5aa7dc[_0x2028eb(0xdc)]>0x0&&!_0x2ceab2[_0x2028eb(0xb4)]&&(console[_0x2028eb(0x100)](''),console[_0x2028eb(0x100)](_0x2028eb(0xe4)),_0x355513['length']>0x0&&console[_0x2028eb(0x100)](_0x2028eb(0x116)+a35_0x49a32b[_0x2028eb(0xc1)]('+\x20'+_0x355513[_0x2028eb(0xdc)]+_0x2028eb(0xdb))),_0x5911b4['length']>0x0&&console['error'](_0x2028eb(0x116)+a35_0x49a32b[_0x2028eb(0x12b)]('~\x20'+_0x5911b4[_0x2028eb(0xdc)]+'\x20to\x20update')),_0xaa96eb[_0x2028eb(0xdc)]>0x0&&console[_0x2028eb(0x100)](_0x2028eb(0x116)+a35_0x49a32b[_0x2028eb(0xf5)]('-\x20'+_0xaa96eb[_0x2028eb(0xdc)]+_0x2028eb(0x140))));console[_0x2028eb(0x100)](_0x2028eb(0x13f)+a35_0x49a32b[_0x2028eb(0xbe)](_0x4cc21a)+'\x0a');if(_0x16ace4[_0x2028eb(0xdc)]>0x0){console[_0x2028eb(0x100)](_0x2028eb(0x130));for(const _0x77fba7 of _0x16ace4){console[_0x2028eb(0x100)]('\x20\x20'+a35_0x49a32b[_0x2028eb(0xe1)]('+')+'\x20'+_0x77fba7);}console[_0x2028eb(0x100)]('');}if(_0x1c8d8a[_0x2028eb(0xdc)]>0x0&&!_0x2ceab2[_0x2028eb(0xb4)])for(const _0x28b13a of _0x1c8d8a){const _0x2c629b=_0x28b13a[_0x2028eb(0xe0)]?_0x28b13a[_0x2028eb(0xe0)]+'/'+_0x28b13a[_0x2028eb(0xba)]['name']:_0x28b13a['yamlConfig'][_0x2028eb(0x13b)],_0x37b3fa=_0x28b13a['yamlConfig'][_0x2028eb(0xd3)]?.[_0x2028eb(0xdc)]||0x0,_0x3a7744=_0x37b3fa>0x0?a35_0x49a32b[_0x2028eb(0xff)]('\x20['+_0x37b3fa+'\x20activations]'):'';console[_0x2028eb(0x100)]('\x0a'+a35_0x49a32b['green'](_0x2028eb(0xe3))+'\x20'+_0x2c629b+_0x3a7744),console[_0x2028eb(0x100)]('─'[_0x2028eb(0xd1)](0x3c)),_0x28b13a[_0x2028eb(0x131)]&&console[_0x2028eb(0x100)](_0x28b13a['diff']),console[_0x2028eb(0x100)]('─'[_0x2028eb(0xd1)](0x3c));}if(_0x42af08['length']>0x0&&!_0x2ceab2[_0x2028eb(0xb4)])for(const _0x109a13 of _0x42af08){const _0xe2b25d=_0x109a13[_0x2028eb(0xe6)]?_0x54b16d[_0x2028eb(0x136)](_0x109a13[_0x2028eb(0xe6)][_0x2028eb(0xd5)]())||'':'',_0x3310fb=_0xe2b25d?_0xe2b25d+'/'+_0x109a13[_0x2028eb(0x13b)]:_0x109a13[_0x2028eb(0x13b)],_0x26e899=_0x3a87b0['get'](_0x109a13['id'])||[],_0x4e67b8=_0x26e899['length']>0x0?a35_0x49a32b['dim']('\x20['+_0x26e899[_0x2028eb(0xdc)]+_0x2028eb(0xdf)):'';console[_0x2028eb(0x100)]('\x0a'+a35_0x49a32b[_0x2028eb(0xf5)]('Delete\x20segment:')+'\x20'+_0x3310fb+_0x4e67b8),console['error']('─'[_0x2028eb(0xd1)](0x3c));const _0x3d1660=segmentWithActivationsToYaml(_0x109a13,_0x26e899,undefined,_0x180aee,_0x1f099a),_0x241a04=segmentToYamlString(_0x3d1660),_0x289689=generateDiff(_0x241a04,'');console[_0x2028eb(0x100)](formatDiffWithColors(_0x289689)),console[_0x2028eb(0x100)]('─'[_0x2028eb(0xd1)](0x3c));}const _0x4d2677=_0x5b2276[_0x2028eb(0xe8)](_0x2cee2f=>!_0x2cee2f[_0x2028eb(0xfb)]&&_0x2cee2f[_0x2028eb(0x131)]);if(_0x4d2677[_0x2028eb(0xdc)]>0x0&&!_0x2ceab2[_0x2028eb(0xb4)])for(const _0x2cad70 of _0x4d2677){const _0x24c521=_0x2cad70[_0x2028eb(0xe0)]?_0x2cad70[_0x2028eb(0xe0)]+'/'+_0x2cad70[_0x2028eb(0xba)][_0x2028eb(0x13b)]:_0x2cad70[_0x2028eb(0xba)][_0x2028eb(0x13b)];console[_0x2028eb(0x100)]('\x0a'+a35_0x49a32b[_0x2028eb(0x12b)](_0x2028eb(0xd9))+'\x20'+_0x24c521),console[_0x2028eb(0x100)]('─'['repeat'](0x3c)),console['error'](_0x2cad70[_0x2028eb(0x131)]),console[_0x2028eb(0x100)]('─'[_0x2028eb(0xd1)](0x3c));}if(_0x486fd6[_0x2028eb(0xdc)]>0x0)for(const _0x10c276 of _0x486fd6){const _0x3e4db7=_0x10c276[_0x2028eb(0xe0)]?_0x10c276[_0x2028eb(0xe0)]+'/'+_0x10c276[_0x2028eb(0xba)]['name']:_0x10c276[_0x2028eb(0xba)]['name'];console[_0x2028eb(0x100)]('\x0a'+a35_0x49a32b[_0x2028eb(0xc1)](_0x2028eb(0xe9))+'\x20'+_0x3e4db7),console[_0x2028eb(0x100)]('─'[_0x2028eb(0xd1)](0x3c)),_0x10c276[_0x2028eb(0x131)]&&console[_0x2028eb(0x100)](_0x10c276['diff']),console['error']('─'['repeat'](0x3c));}const _0x5a743a=_0xebdd7a['filter'](_0x4963f9=>!_0x4963f9[_0x2028eb(0xfb)]&&_0x4963f9[_0x2028eb(0x131)]);if(_0x5a743a[_0x2028eb(0xdc)]>0x0)for(const _0x326a95 of _0x5a743a){const _0xd23177=_0x326a95['folderPath']?_0x326a95['folderPath']+'/'+_0x326a95[_0x2028eb(0xba)][_0x2028eb(0x13b)]:_0x326a95['yamlConfig']['name'];console['error']('\x0a'+a35_0x49a32b[_0x2028eb(0x12b)](_0x2028eb(0x10e))+'\x20'+_0xd23177),console[_0x2028eb(0x100)]('─'[_0x2028eb(0xd1)](0x3c)),console['error'](_0x326a95[_0x2028eb(0x131)]),console['error']('─'[_0x2028eb(0xd1)](0x3c));}if(_0x398c59[_0x2028eb(0xdc)]>0x0)for(const _0x3caf28 of _0x398c59){const _0x3bea47=_0x3caf28[_0x2028eb(0xc6)]?_0x54b16d['get'](_0x3caf28[_0x2028eb(0xc6)])||'':'',_0x55903d=_0x3bea47?_0x3bea47+'/'+_0x3caf28[_0x2028eb(0xfc)]:_0x3caf28['journeyBundleName'];console['error']('\x0a'+a35_0x49a32b[_0x2028eb(0xf5)](_0x2028eb(0xc3))+'\x20'+_0x55903d),console['error']('─'[_0x2028eb(0xd1)](0x3c)),console[_0x2028eb(0x100)](a35_0x49a32b[_0x2028eb(0xf5)](_0x2028eb(0x119))),console[_0x2028eb(0x100)]('─'[_0x2028eb(0xd1)](0x3c));}if(_0x2ceab2[_0x2028eb(0xc7)])return console[_0x2028eb(0x100)](a35_0x49a32b[_0x2028eb(0x12b)](_0x2028eb(0xaf))),0x0;const _0x92f17b=_0x2ceab2['journeysOnly']?![]:_0x1c8d8a[_0x2028eb(0xdc)]>0x0||_0x3628ac[_0x2028eb(0xdc)]>0x0||_0x42af08[_0x2028eb(0xdc)]>0x0,_0x2a641f=_0x486fd6[_0x2028eb(0xdc)]>0x0||_0x10424b[_0x2028eb(0xdc)]>0x0||_0x398c59[_0x2028eb(0xdc)]>0x0,_0x30b27d=_0x2ceab2['journeysOnly']?![]:_0x5aa7dc[_0x2028eb(0xdc)]>0x0,_0x5cbedc=_0x16ace4[_0x2028eb(0xdc)]>0x0;if(!_0x92f17b&&!_0x2a641f&&!_0x30b27d&&!_0x5cbedc){const _0x25229c=_0x2ceab2[_0x2028eb(0xb4)]?_0x2028eb(0x135):_0x2028eb(0x12c);console[_0x2028eb(0x100)](a35_0x49a32b[_0x2028eb(0xc1)](_0x25229c));if(_0x3a85dd&&_0x5773c6[_0x2028eb(0xdc)]===0x1){const _0x10fcda=_0x5773c6[0x0];if(_0x10fcda[_0x2028eb(0xdd)]?.['id']){const _0x6f6bb3=getConsoleNextUrl(_0x2ceab2['site'],'/app/ps/'+_0x122245+_0x2028eb(0xf9)+_0x10fcda[_0x2028eb(0xdd)]['id']+_0x2028eb(0xd4));console[_0x2028eb(0x100)]('\x20\x20'+a35_0x49a32b[_0x2028eb(0xbe)](_0x6f6bb3));}}return 0x0;}const _0x5a4c85=_0x2ceab2[_0x2028eb(0xb4)]?_0x486fd6['length']+_0x10424b[_0x2028eb(0xdc)]+_0x398c59[_0x2028eb(0xdc)]+_0x16ace4[_0x2028eb(0xdc)]:_0x1c8d8a[_0x2028eb(0xdc)]+_0x3628ac[_0x2028eb(0xdc)]+_0x42af08['length']+_0x486fd6[_0x2028eb(0xdc)]+_0x10424b[_0x2028eb(0xdc)]+_0x398c59[_0x2028eb(0xdc)]+_0x16ace4['length']+_0x5aa7dc[_0x2028eb(0xdc)];if(!_0x2ceab2[_0x2028eb(0xb3)]&&_0x5a4c85>0x0){if(!isInteractive())return console[_0x2028eb(0x100)](a35_0x49a32b[_0x2028eb(0xf5)](_0x2028eb(0xbd)),_0x2028eb(0x128)),console['error'](a35_0x49a32b[_0x2028eb(0xff)](_0x2028eb(0xda))),0x1;const _0x32579e=await confirmKey(_0x2028eb(0x11b)+_0x5a4c85+_0x2028eb(0x12e));if(!_0x32579e)return console[_0x2028eb(0x100)](a35_0x49a32b[_0x2028eb(0x12b)](_0x2028eb(0x122))),0x1;}const _0x29c36f={'withProgress':async(_0x594662,_0x448768)=>{const _0x1c69c7=_0x2028eb,_0x400d51=await withSpinner(_0x594662,_0x448768,{'verbose':_0x2ceab2[_0x1c69c7(0x132)]});return{'data':_0x400d51[_0x1c69c7(0xf0)]};},'logInfo':_0x79741c=>console[_0x2028eb(0x100)](a35_0x49a32b['blue']('βœ”\x20'+_0x79741c)),'logSuccess':_0x2f1257=>console[_0x2028eb(0x100)](a35_0x49a32b[_0x2028eb(0xc1)]('βœ”\x20'+_0x2f1257)),'logWarning':_0x1aee50=>console[_0x2028eb(0x100)](a35_0x49a32b[_0x2028eb(0x12b)]('⚠\x20'+_0x1aee50)),'logDeleted':_0x22fb51=>console[_0x2028eb(0x100)](a35_0x49a32b[_0x2028eb(0xf5)]('βœ”\x20'+_0x22fb51))},_0x31f47b={'segment':_0x2de074[_0x2028eb(0x129)],'journey':_0x2de074['journey'],'user':_0x2de074[_0x2028eb(0x134)],'connection':_0x2de074['connection']};_0x16ace4[_0x2028eb(0xdc)]>0x0&&(_0x354b5c=await executePushFolders(_0x31f47b,_0x16ace4,_0x354b5c,{'parentId':_0x122245},_0x29c36f));const _0x2c96eb={'rootFolderId':_0x3daec3,'folderPathToId':_0x354b5c,'folderIdToPath':_0x54b16d,'segmentNameToId':_0x44e1b5,'activationsBySegmentId':_0x3a87b0,'emailToIdMap':_0x4a10e3,'idToEmailMap':_0x180aee,'connectionNameToIdMap':_0x7dce52[_0x2028eb(0xf1)],'connectionIdToNameMap':_0x7dce52[_0x2028eb(0x13e)],'connectionNameToTypeMap':_0x5d9205},_0x3eb7e3=await executePushSegments(_0x31f47b,_0x2ceab2[_0x2028eb(0xb4)]?[]:_0x5b2276,_0x2c96eb,{'parentId':_0x122245},_0x29c36f),_0xfc3978=_0x3eb7e3[_0x2028eb(0x107)],_0x3b0f04=_0x3eb7e3[_0x2028eb(0xcc)],_0x3ea425=_0x3eb7e3['activations'][_0x2028eb(0x107)],_0x3aebcd=_0x3eb7e3[_0x2028eb(0xd3)][_0x2028eb(0xcc)],_0x3026b9=_0x3eb7e3[_0x2028eb(0xd3)][_0x2028eb(0xad)],_0x79ea10=await executePushSegmentDeletions(_0x31f47b,_0x2ceab2['journeysOnly']?[]:_0x42af08,_0x29c36f);let _0x1d0314=0x0,_0x26bbc1=0x0,_0x45e281=0x0;const _0x5e76aa=new Map(_0x44e1b5);for(const [_0x189897,_0x4eee16]of _0x3eb7e3['createdSegmentIds']){_0x5e76aa[_0x2028eb(0xc4)](_0x189897,_0x4eee16);}if(_0xebdd7a[_0x2028eb(0xdc)]>0x0){const _0x522550={..._0x2c96eb,'segmentNameToId':_0x5e76aa,'existingSegments':_0x37e410,'activationContext':_0x30f224},_0x2cbf3d=await executePushJourneys(_0x31f47b,_0xebdd7a,_0x522550,{'parentId':_0x122245,'rootFolderId':_0x3daec3,'verbose':_0x2ceab2['verbose']},_0x29c36f);_0x1d0314=_0x2cbf3d[_0x2028eb(0x107)],_0x26bbc1=_0x2cbf3d['updated'];if(_0x3a85dd&&_0x2cbf3d[_0x2028eb(0x126)]['length']===0x1){const _0x35b196=_0x2cbf3d[_0x2028eb(0x126)][0x0];if(_0x35b196[_0x2028eb(0xf3)]){const _0x184dc8=getConsoleNextUrl(_0x2ceab2[_0x2028eb(0x12d)],'/app/ps/'+_0x122245+_0x2028eb(0xf9)+_0x35b196[_0x2028eb(0xf3)]+_0x2028eb(0xd4));console['error']('\x20\x20'+a35_0x49a32b[_0x2028eb(0xbe)](_0x184dc8));}}}for(const _0x37e2b of _0x398c59){console[_0x2028eb(0x100)](a35_0x49a32b[_0x2028eb(0x12b)]('⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20'+_0x37e2b[_0x2028eb(0xfc)])),_0x45e281++;}const _0xd7504b=[];if(_0xfc3978>0x0)_0xd7504b[_0x2028eb(0xfa)](_0xfc3978+_0x2028eb(0xf4));if(_0x3b0f04>0x0)_0xd7504b[_0x2028eb(0xfa)](_0x3b0f04+'\x20updated');if(_0x79ea10>0x0)_0xd7504b[_0x2028eb(0xfa)](_0x79ea10+'\x20deleted');const _0xf865c7=[];if(_0x1d0314>0x0)_0xf865c7['push'](_0x1d0314+_0x2028eb(0xf4));if(_0x26bbc1>0x0)_0xf865c7[_0x2028eb(0xfa)](_0x26bbc1+_0x2028eb(0x11c));if(_0x45e281>0x0)_0xf865c7[_0x2028eb(0xfa)](_0x45e281+_0x2028eb(0x133));const _0x56ae6e=[];if(_0x3ea425>0x0)_0x56ae6e[_0x2028eb(0xfa)](_0x3ea425+_0x2028eb(0xf4));if(_0x3aebcd>0x0)_0x56ae6e[_0x2028eb(0xfa)](_0x3aebcd+_0x2028eb(0x11c));if(_0x3026b9>0x0)_0x56ae6e[_0x2028eb(0xfa)](_0x3026b9+_0x2028eb(0x133));return console['error'](a35_0x49a32b[_0x2028eb(0xc1)](_0x2028eb(0xbb))),_0xd7504b[_0x2028eb(0xdc)]>0x0&&!_0x2ceab2[_0x2028eb(0xb4)]&&console[_0x2028eb(0x100)]('\x20\x20Segments:\x20'+_0xd7504b['join'](',\x20')),_0xf865c7[_0x2028eb(0xdc)]>0x0&&console[_0x2028eb(0x100)](_0x2028eb(0x13a)+_0xf865c7[_0x2028eb(0x102)](',\x20')),_0x56ae6e[_0x2028eb(0xdc)]>0x0&&!_0x2ceab2[_0x2028eb(0xb4)]&&console['error']('\x20\x20Activations:\x20'+_0x56ae6e[_0x2028eb(0x102)](',\x20')),0x0;}}