@treasuredata/tdx 0.25.2 → 0.25.4

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 (173) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.d.ts.map +1 -1
  5. package/dist/cli.js +1 -1
  6. package/dist/cli.js.map +1 -1
  7. package/dist/commands/activations.js +1 -1
  8. package/dist/commands/agent-command.js +1 -1
  9. package/dist/commands/agent-test-command.js +1 -1
  10. package/dist/commands/api-command.js +1 -1
  11. package/dist/commands/auth-command.js +1 -1
  12. package/dist/commands/chat-command.js +1 -1
  13. package/dist/commands/claude-command.js +1 -1
  14. package/dist/commands/claude-statusline-command.js +1 -1
  15. package/dist/commands/claude-usage-command.js +1 -1
  16. package/dist/commands/command.js +1 -1
  17. package/dist/commands/connection-command.js +1 -1
  18. package/dist/commands/databases.js +1 -1
  19. package/dist/commands/describe.js +1 -1
  20. package/dist/commands/engage-command.js +1 -1
  21. package/dist/commands/job-command.js +1 -1
  22. package/dist/commands/journey-command.js +1 -1
  23. package/dist/commands/journey-validate-command.js +1 -1
  24. package/dist/commands/llm-command.js +1 -1
  25. package/dist/commands/mcp-command.js +1 -1
  26. package/dist/commands/parent-segment-command.js +1 -1
  27. package/dist/commands/profile-command.js +1 -1
  28. package/dist/commands/profiles-command.js +1 -1
  29. package/dist/commands/query-command.js +1 -1
  30. package/dist/commands/schedule-command.js +1 -1
  31. package/dist/commands/segment-command.js +1 -1
  32. package/dist/commands/segment-create-command.js +1 -1
  33. package/dist/commands/segment-fields-command.js +1 -1
  34. package/dist/commands/segment-pull-command.js +1 -1
  35. package/dist/commands/segment-push-command.js +1 -1
  36. package/dist/commands/segment-update-command.js +1 -1
  37. package/dist/commands/segment-use-command.js +1 -1
  38. package/dist/commands/segment-validate-command.js +1 -1
  39. package/dist/commands/segments.js +1 -1
  40. package/dist/commands/show.js +1 -1
  41. package/dist/commands/status-command.js +1 -1
  42. package/dist/commands/tables.js +1 -1
  43. package/dist/commands/unset-command.js +1 -1
  44. package/dist/commands/use-command.d.ts.map +1 -1
  45. package/dist/commands/use-command.js +1 -1
  46. package/dist/commands/use-command.js.map +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.d.ts +16 -0
  52. package/dist/core/config.d.ts.map +1 -1
  53. package/dist/core/config.js +1 -1
  54. package/dist/core/config.js.map +1 -1
  55. package/dist/core/connection-cache.js +1 -1
  56. package/dist/core/constants.js +1 -1
  57. package/dist/core/credential-cache.js +1 -1
  58. package/dist/core/global-context.js +1 -1
  59. package/dist/core/keychain.js +1 -1
  60. package/dist/core/profile.js +1 -1
  61. package/dist/core/project-config.js +1 -1
  62. package/dist/core/session.js +1 -1
  63. package/dist/core/user-cache.js +1 -1
  64. package/dist/core/version.js +1 -1
  65. package/dist/index.js +1 -1
  66. package/dist/mcp/server.js +1 -1
  67. package/dist/mcp/tools/index.js +1 -1
  68. package/dist/mcp/tools/tdx-run.js +1 -1
  69. package/dist/mcp/tools/tdx-search.js +1 -1
  70. package/dist/mcp/utils.js +1 -1
  71. package/dist/proxy/claude-usage-tracker.js +1 -1
  72. package/dist/proxy/passthrough-server.js +1 -1
  73. package/dist/proxy/sse-usage-parser.js +1 -1
  74. package/dist/sdk/agent/agent-config.js +1 -1
  75. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  76. package/dist/sdk/agent/agent-yaml.js +1 -1
  77. package/dist/sdk/agent/test/evaluator.js +1 -1
  78. package/dist/sdk/agent/test/executor.js +1 -1
  79. package/dist/sdk/agent/test/index.js +1 -1
  80. package/dist/sdk/agent/test/output.js +1 -1
  81. package/dist/sdk/agent/test/parser.js +1 -1
  82. package/dist/sdk/api.js +1 -1
  83. package/dist/sdk/client/cdp-api-client.js +1 -1
  84. package/dist/sdk/client/endpoints.js +1 -1
  85. package/dist/sdk/client/engage-api-client.js +1 -1
  86. package/dist/sdk/client/http-client.js +1 -1
  87. package/dist/sdk/client/llm-api-client.js +1 -1
  88. package/dist/sdk/client/rate-limiter.js +1 -1
  89. package/dist/sdk/client/td-api-client.js +1 -1
  90. package/dist/sdk/client/trino-api-client.js +1 -1
  91. package/dist/sdk/client/workflow-client.js +1 -1
  92. package/dist/sdk/connection-validator.js +1 -1
  93. package/dist/sdk/connection.js +1 -1
  94. package/dist/sdk/engage.js +1 -1
  95. package/dist/sdk/errors.js +1 -1
  96. package/dist/sdk/index.js +1 -1
  97. package/dist/sdk/io/index.js +1 -1
  98. package/dist/sdk/io/node-filesystem.js +1 -1
  99. package/dist/sdk/job.js +1 -1
  100. package/dist/sdk/journey.js +1 -1
  101. package/dist/sdk/llm/chat-cache.js +1 -1
  102. package/dist/sdk/llm/index.js +1 -1
  103. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  104. package/dist/sdk/llm/model-factors.js +1 -1
  105. package/dist/sdk/query/index.js +1 -1
  106. package/dist/sdk/query/sql-parser.js +1 -1
  107. package/dist/sdk/schedule.js +1 -1
  108. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  109. package/dist/sdk/segment/fields-display.js +1 -1
  110. package/dist/sdk/segment/file-discovery.js +1 -1
  111. package/dist/sdk/segment/journey-utils.js +1 -1
  112. package/dist/sdk/segment/journey-yaml.js +1 -1
  113. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  114. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  115. package/dist/sdk/segment/pull-workflow.js +1 -1
  116. package/dist/sdk/segment/push-workflow.js +1 -1
  117. package/dist/sdk/segment/resolution-context.js +1 -1
  118. package/dist/sdk/segment/segment-path-parser.js +1 -1
  119. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  120. package/dist/sdk/segment/target-resolution.js +1 -1
  121. package/dist/sdk/segment/tdx-config.js +1 -1
  122. package/dist/sdk/segment/validate-files.js +1 -1
  123. package/dist/sdk/segment/yaml-validator.js +1 -1
  124. package/dist/sdk/segment.js +1 -1
  125. package/dist/sdk/types/index.js +1 -1
  126. package/dist/sdk/types/progress.js +1 -1
  127. package/dist/sdk/user.js +1 -1
  128. package/dist/sdk/util/format-detector.js +1 -1
  129. package/dist/sdk/util/formatters.js +1 -1
  130. package/dist/sdk/util/index.js +1 -1
  131. package/dist/sdk/util/tree-formatter.js +1 -1
  132. package/dist/sdk/workflow/archive-validation.js +1 -1
  133. package/dist/sdk/workflow/clone-workflow.js +1 -1
  134. package/dist/sdk/workflow/index.js +1 -1
  135. package/dist/sdk/workflow/pull-workflow.js +1 -1
  136. package/dist/sdk/workflow/push-workflow.js +1 -1
  137. package/dist/sdk/workflow/tdx-config.js +1 -1
  138. package/dist/sdk/workflow/workflow-utils.js +1 -1
  139. package/dist/test-utils/command-runner.js +1 -1
  140. package/dist/test-utils/factories.js +1 -1
  141. package/dist/test-utils/fixtures.js +1 -1
  142. package/dist/test-utils/http-mock.js +1 -1
  143. package/dist/test-utils/index.js +1 -1
  144. package/dist/utils/async.js +1 -1
  145. package/dist/utils/colors.js +1 -1
  146. package/dist/utils/diff.js +1 -1
  147. package/dist/utils/file-permissions.js +1 -1
  148. package/dist/utils/global-cache.js +1 -1
  149. package/dist/utils/json-loader.js +1 -1
  150. package/dist/utils/local-cache.js +1 -1
  151. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  152. package/dist/utils/logger/formatters/index.js +1 -1
  153. package/dist/utils/logger/handlers/console-handler.js +1 -1
  154. package/dist/utils/logger/handlers/file-handler.js +1 -1
  155. package/dist/utils/logger/handlers/index.js +1 -1
  156. package/dist/utils/logger/handlers/null-handler.js +1 -1
  157. package/dist/utils/logger/index.js +1 -1
  158. package/dist/utils/logger/logger.js +1 -1
  159. package/dist/utils/logger/types.js +1 -1
  160. package/dist/utils/option-validation.js +1 -1
  161. package/dist/utils/port.js +1 -1
  162. package/dist/utils/process.js +1 -1
  163. package/dist/utils/prompt.js +1 -1
  164. package/dist/utils/spinner.js +1 -1
  165. package/dist/utils/sse-parser.js +1 -1
  166. package/dist/utils/string-utils.js +1 -1
  167. package/dist/utils/table-ref-parser.js +1 -1
  168. package/dist/utils/tdx-logger.js +1 -1
  169. package/dist/utils/version-check.d.ts +4 -1
  170. package/dist/utils/version-check.d.ts.map +1 -1
  171. package/dist/utils/version-check.js +1 -1
  172. package/dist/utils/version-check.js.map +1 -1
  173. package/package.json +2 -1
@@ -1 +1 @@
1
- const a26_0x366fbf=a26_0x345f;(function(_0x21757c,_0x2a5a0d){const _0x5b88d9=a26_0x345f,_0x246804=_0x21757c();while(!![]){try{const _0x2c2815=parseInt(_0x5b88d9(0x161))/0x1*(parseInt(_0x5b88d9(0x18a))/0x2)+parseInt(_0x5b88d9(0x132))/0x3+parseInt(_0x5b88d9(0x19e))/0x4*(parseInt(_0x5b88d9(0x142))/0x5)+parseInt(_0x5b88d9(0x182))/0x6*(parseInt(_0x5b88d9(0x1ab))/0x7)+parseInt(_0x5b88d9(0x1b3))/0x8+-parseInt(_0x5b88d9(0x179))/0x9+-parseInt(_0x5b88d9(0x136))/0xa;if(_0x2c2815===_0x2a5a0d)break;else _0x246804['push'](_0x246804['shift']());}catch(_0x241c59){_0x246804['push'](_0x246804['shift']());}}}(a26_0x1d6a,0x2a4da));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';function a26_0x345f(_0x3b2159,_0x27fcb0){_0x3b2159=_0x3b2159-0x123;const _0x1d6a79=a26_0x1d6a();let _0x345f6b=_0x1d6a79[_0x3b2159];return _0x345f6b;}import{hyperlink}from'../sdk/util/formatters.js';import a26_0x3a0cf3 from'chalk';function formatRelativeTime(_0x5499c6){const _0x4df2ca=a26_0x345f,_0x49eb58=new Date(_0x5499c6),_0x1bb39e=new Date(),_0x2c346a=_0x49eb58[_0x4df2ca(0x16a)]()-_0x1bb39e[_0x4df2ca(0x16a)](),_0x3f6c18=Math[_0x4df2ca(0x1af)](_0x2c346a)/0x3e8,_0x2df02b=_0x2c346a<0x0;if(_0x3f6c18<0x3c)return _0x2df02b?_0x4df2ca(0x176):_0x4df2ca(0x14e);else{if(_0x3f6c18<0xe10){const _0x1f10f6=Math[_0x4df2ca(0x14c)](_0x3f6c18/0x3c);return _0x2df02b?_0x1f10f6+_0x4df2ca(0x13f):'in\x20'+_0x1f10f6+'m';}else{if(_0x3f6c18<0x15180){const _0x3e5c6c=Math[_0x4df2ca(0x14c)](_0x3f6c18/0xe10);return _0x2df02b?_0x3e5c6c+'h\x20ago':'in\x20'+_0x3e5c6c+'h';}else{if(_0x3f6c18<0x93a80){const _0x1f8442=Math[_0x4df2ca(0x14c)](_0x3f6c18/0x15180);return _0x2df02b?_0x1f8442+'d\x20ago':'in\x20'+_0x1f8442+'d';}else return _0x49eb58['toLocaleDateString']();}}}}export class ScheduleListCommand extends BaseCommand{['name']=a26_0x366fbf(0x13c);[a26_0x366fbf(0x192)]=a26_0x366fbf(0x188);async[a26_0x366fbf(0x160)](_0x27ee4e){const _0x54ce4b=a26_0x366fbf,{options:_0x14c881,args:_0x33bf05,tdx:_0x273146}=_0x27ee4e,_0x3547d2=resolveLimit(_0x14c881[_0x54ce4b(0x1a4)],DEFAULT_DISPLAY_LIMIT),_0x26b3a1=_0x33bf05[0x0],_0x3f6582=_0x26b3a1?_0x54ce4b(0x12c)+_0x26b3a1+_0x54ce4b(0x19c):_0x54ce4b(0x12a),_0x170a53=await withSpinner(_0x3f6582,()=>_0x273146[_0x54ce4b(0x181)][_0x54ce4b(0x174)]({'limit':_0x3547d2,'scheduled':!![],'pattern':_0x26b3a1}),{'verbose':_0x14c881[_0x54ce4b(0x19d)]}),_0x155258=_0x170a53['data']['queries'],_0x3fc38f=_0x170a53[_0x54ce4b(0x134)][_0x54ce4b(0x145)][_0x54ce4b(0x12f)],_0x3ff47f=_0x26b3a1?_0x54ce4b(0x164)+_0x26b3a1+'\x22':'';_0x3fc38f?console['error'](_0x54ce4b(0x1ae)+_0x155258[_0x54ce4b(0x175)]+'\x20schedules'+_0x3ff47f+_0x54ce4b(0x150)):console['error'](_0x54ce4b(0x17e)+_0x155258[_0x54ce4b(0x175)]+_0x54ce4b(0x194)+(_0x155258['length']!==0x1?_0x54ce4b(0x17a):'y')+_0x3ff47f);if(_0x14c881[_0x54ce4b(0x133)]===_0x54ce4b(0x15f)||_0x14c881[_0x54ce4b(0x133)]===_0x54ce4b(0x16e)||_0x14c881[_0x54ce4b(0x133)]===_0x54ce4b(0x1a8)||_0x14c881['format']===_0x54ce4b(0x1a0)){const _0x4cd734=_0x155258[_0x54ce4b(0x1a6)](_0x4fcd2d=>({'id':_0x4fcd2d['id'],'name':_0x4fcd2d['name'],'cron':_0x4fcd2d['cron'],'database':_0x4fcd2d[_0x54ce4b(0x17d)]?.['name'],'type':_0x4fcd2d[_0x54ce4b(0x15d)],'timezone':_0x4fcd2d[_0x54ce4b(0x15e)],'user_name':_0x4fcd2d[_0x54ce4b(0x190)]?.[_0x54ce4b(0x196)],'updated_at':_0x4fcd2d[_0x54ce4b(0x12b)],'next_run_at':_0x4fcd2d['next_run_at'],'last_job_status':_0x4fcd2d[_0x54ce4b(0x123)]?.[_0x54ce4b(0x13b)]}));await handleSDKOutput(_0x4cd734,_0x14c881);}else{if(_0x155258['length']===0x0)console[_0x54ce4b(0x19a)](_0x54ce4b(0x144));else{const _0x3003cc=_0x14c881[_0x54ce4b(0x166)],_0xd03617=_0x155258[_0x54ce4b(0x1a6)](_0x3a0dda=>{const _0x59ddf1=_0x54ce4b,_0x4cce91=_0x3a0dda['last_job']?.['status']?_0x3a0dda[_0x59ddf1(0x123)][_0x59ddf1(0x13b)]===_0x59ddf1(0x185)?'✓':'✗':'-',_0xfcb2b9=_0x3a0dda[_0x59ddf1(0x123)]?.['ended_at']?formatRelativeTime(_0x3a0dda[_0x59ddf1(0x123)][_0x59ddf1(0x159)]):_0x59ddf1(0x177),_0x46bc1b=_0x3a0dda[_0x59ddf1(0x1b5)]?formatRelativeTime(_0x3a0dda[_0x59ddf1(0x1b5)]):'-',_0x2213e1=_0x3a0dda[_0x59ddf1(0x1b1)]||'',_0xdf5658=_0x3a0dda[_0x59ddf1(0x196)]||'(unnamed)',_0x358c80=getConsoleUrl(_0x3003cc,_0x59ddf1(0x1a7)+_0x3a0dda['id']);return{'statusIcon':_0x4cce91,'lastRun':_0xfcb2b9,'nextRun':_0x46bc1b,'cron':_0x2213e1,'name':_0xdf5658,'queryUrl':_0x358c80,'status':_0x3a0dda[_0x59ddf1(0x123)]?.[_0x59ddf1(0x13b)]};}),_0xd90d6=Math['max'](..._0xd03617['map'](_0x1d416d=>_0x1d416d[_0x54ce4b(0x173)][_0x54ce4b(0x175)])),_0x3aa98d=Math[_0x54ce4b(0x147)](..._0xd03617[_0x54ce4b(0x1a6)](_0x50a3b6=>_0x50a3b6[_0x54ce4b(0x183)]['length'])),_0x559760=Math['max'](..._0xd03617[_0x54ce4b(0x1a6)](_0x45e172=>_0x45e172[_0x54ce4b(0x1b1)][_0x54ce4b(0x175)])),_0x3e732f=_0xd03617[_0x54ce4b(0x1a6)](_0x494e73=>{const _0x13b525=_0x54ce4b,_0x2325f6=_0x494e73[_0x13b525(0x13b)]==='success'?a26_0x3a0cf3[_0x13b525(0x186)](_0x494e73[_0x13b525(0x149)]):_0x494e73[_0x13b525(0x13b)]==='error'?a26_0x3a0cf3[_0x13b525(0x12d)](_0x494e73[_0x13b525(0x149)]):a26_0x3a0cf3[_0x13b525(0x17c)](_0x494e73[_0x13b525(0x149)]),_0x69368d=_0x494e73['lastRun'][_0x13b525(0x1a2)](_0xd90d6),_0x50cea2=_0x494e73['nextRun'][_0x13b525(0x1a2)](_0x3aa98d),_0x1bc2cd=_0x494e73[_0x13b525(0x1b1)]?a26_0x3a0cf3[_0x13b525(0x13a)](_0x494e73[_0x13b525(0x1b1)][_0x13b525(0x1a2)](_0x559760)):'\x20'[_0x13b525(0x1b2)](_0x559760),_0x372f81=hyperlink(_0x494e73['name'],_0x494e73['queryUrl']);return _0x13b525(0x158)+_0x2325f6+'\x20'+_0x69368d+_0x13b525(0x16b)+_0x50cea2+'\x20\x20'+_0x1bc2cd+'\x20\x20'+_0x372f81;});await writeOutput(_0x3e732f[_0x54ce4b(0x15a)]('\x0a'),_0x14c881[_0x54ce4b(0x15b)],_0x54ce4b(0x124));}}return 0x0;}}export class ScheduleShowCommand extends BaseCommand{[a26_0x366fbf(0x196)]=a26_0x366fbf(0x163);[a26_0x366fbf(0x192)]=a26_0x366fbf(0x14b);['validate'](_0x3d0931){const _0x1d6202=a26_0x366fbf,_0xd3dae1=_0x3d0931[_0x1d6202(0x168)][0x0];if(!_0xd3dae1)return _0x1d6202(0x1ad);return undefined;}async[a26_0x366fbf(0x160)](_0x1d8a64){const _0xde3c54=a26_0x366fbf,{options:_0x4935b0,args:_0x4a7f0a,tdx:_0x3c0626}=_0x1d8a64,_0x59b720=_0x4a7f0a[0x0],_0x1d3e76=await withSpinner(_0xde3c54(0x197),()=>_0x3c0626[_0xde3c54(0x181)][_0xde3c54(0x15c)](_0x59b720),{'verbose':_0x4935b0['verbose']}),_0x3a526c=_0x1d3e76['data'],_0x5acc37={'name':_0x3a526c['name'],'cron':_0x3a526c[_0xde3c54(0x1b1)],'database':_0x3a526c[_0xde3c54(0x17d)],'type':_0x3a526c[_0xde3c54(0x15d)],'timezone':_0x3a526c[_0xde3c54(0x13e)],'user_name':_0x3a526c[_0xde3c54(0x171)],'created_at':_0x3a526c[_0xde3c54(0x184)],'engine_version':_0x3a526c[_0xde3c54(0x141)],'executing_user_id':_0x3a526c['executing_user_id'],'query':_0x3a526c['query'],'delay':_0x3a526c[_0xde3c54(0x18e)],'priority':_0x3a526c[_0xde3c54(0x172)],'retry_limit':_0x3a526c[_0xde3c54(0x17f)],..._0x3a526c[_0xde3c54(0x128)]&&{'result':_0x3a526c[_0xde3c54(0x128)]}};return await handleSingleObjectOutput(_0x5acc37,_0x4935b0),0x0;}}export class ScheduleCreateCommand extends BaseCommand{[a26_0x366fbf(0x196)]=a26_0x366fbf(0x165);[a26_0x366fbf(0x192)]=a26_0x366fbf(0x14f);[a26_0x366fbf(0x151)](_0x3ff682){const _0x176030=a26_0x366fbf,_0x73271f=_0x3ff682[_0x176030(0x168)][0x0];if(!_0x73271f)return _0x176030(0x138);return undefined;}async['execute'](_0x1d0359){const _0x57ecb5=a26_0x366fbf,{options:_0xa01427,args:_0x12a051,tdx:_0x47b6fe}=_0x1d0359,_0x465713=_0x12a051[0x0],_0x15da04=_0xa01427,_0x4f9653=_0x15da04[_0x57ecb5(0x17d)],_0x1747bd=_0x15da04[_0x57ecb5(0x198)],_0x2d7903=_0x15da04[_0x57ecb5(0x15d)]||_0x57ecb5(0x125);let _0x209d7c;try{_0x209d7c=readFileSync(_0x1747bd,_0x57ecb5(0x13d))[_0x57ecb5(0x131)]();}catch(_0x5b1de1){throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x57ecb5(0x157)+_0x1747bd,_0x5b1de1 instanceof Error?_0x5b1de1:undefined);}if(!_0x209d7c)throw new SDKError(ErrorCode[_0x57ecb5(0x155)],_0x57ecb5(0x14d));const _0x3e007c={'database':_0x4f9653,'query':_0x209d7c,'type':_0x2d7903};if(_0x15da04[_0x57ecb5(0x1b1)])_0x3e007c['cron']=_0x15da04[_0x57ecb5(0x1b1)];if(_0x15da04[_0x57ecb5(0x13e)])_0x3e007c['timezone']=_0x15da04['timezone'];if(_0x15da04[_0x57ecb5(0x18e)]!==undefined)_0x3e007c['delay']=Number(_0x15da04[_0x57ecb5(0x18e)]);if(_0x15da04[_0x57ecb5(0x172)]!==undefined)_0x3e007c['priority']=Number(_0x15da04['priority']);if(_0x15da04[_0x57ecb5(0x178)]!==undefined)_0x3e007c[_0x57ecb5(0x17f)]=Number(_0x15da04[_0x57ecb5(0x178)]);if(_0x15da04[_0x57ecb5(0x180)])_0x3e007c[_0x57ecb5(0x141)]=_0x15da04[_0x57ecb5(0x180)];if(_0x15da04['result'])_0x3e007c[_0x57ecb5(0x128)]=_0x15da04[_0x57ecb5(0x128)];if(_0xa01427[_0x57ecb5(0x19d)]){console[_0x57ecb5(0x19b)](_0x57ecb5(0x152)+_0x465713),console[_0x57ecb5(0x19b)]('\x20\x20Database:\x20'+_0x4f9653),console[_0x57ecb5(0x19b)](_0x57ecb5(0x1a9)+_0x2d7903);if(_0x3e007c[_0x57ecb5(0x1b1)])console[_0x57ecb5(0x19b)](_0x57ecb5(0x153)+_0x3e007c[_0x57ecb5(0x1b1)]);if(_0x3e007c[_0x57ecb5(0x13e)])console[_0x57ecb5(0x19b)](_0x57ecb5(0x140)+_0x3e007c[_0x57ecb5(0x13e)]);}const _0x35d5e9=await withSpinner(_0x57ecb5(0x169),()=>_0x47b6fe[_0x57ecb5(0x181)][_0x57ecb5(0x193)](_0x465713,_0x3e007c),{'verbose':_0xa01427[_0x57ecb5(0x19d)]});return console[_0x57ecb5(0x19b)](_0x57ecb5(0x148)+_0x35d5e9[_0x57ecb5(0x134)][_0x57ecb5(0x196)]),await handleSingleObjectOutput(_0x35d5e9[_0x57ecb5(0x134)],_0xa01427),0x0;}}export class ScheduleUpdateCommand extends BaseCommand{['name']=a26_0x366fbf(0x16d);[a26_0x366fbf(0x192)]='Update\x20a\x20scheduled\x20query';[a26_0x366fbf(0x151)](_0x5af4aa){const _0x5f57be=a26_0x366fbf,_0x3fbbbc=_0x5af4aa[_0x5f57be(0x168)][0x0];if(!_0x3fbbbc)return _0x5f57be(0x18f);return undefined;}async[a26_0x366fbf(0x160)](_0x15ff94){const _0x15927f=a26_0x366fbf,{options:_0x39fc13,args:_0x453ac9,tdx:_0xb10908}=_0x15ff94,_0x27f7ad=_0x453ac9[0x0],_0x486eec=_0x39fc13,_0x191deb={};if(_0x486eec[_0x15927f(0x17d)])_0x191deb[_0x15927f(0x17d)]=_0x486eec[_0x15927f(0x17d)];if(_0x486eec[_0x15927f(0x15d)])_0x191deb[_0x15927f(0x15d)]=_0x486eec[_0x15927f(0x15d)];if(_0x486eec[_0x15927f(0x1b1)])_0x191deb[_0x15927f(0x1b1)]=_0x486eec[_0x15927f(0x1b1)];if(_0x486eec['timezone'])_0x191deb[_0x15927f(0x13e)]=_0x486eec[_0x15927f(0x13e)];if(_0x486eec[_0x15927f(0x18e)]!==undefined)_0x191deb['delay']=Number(_0x486eec['delay']);if(_0x486eec[_0x15927f(0x172)]!==undefined)_0x191deb['priority']=Number(_0x486eec[_0x15927f(0x172)]);if(_0x486eec[_0x15927f(0x178)]!==undefined)_0x191deb[_0x15927f(0x17f)]=Number(_0x486eec[_0x15927f(0x178)]);if(_0x486eec[_0x15927f(0x180)])_0x191deb['engine_version']=_0x486eec[_0x15927f(0x180)];if(_0x486eec[_0x15927f(0x128)])_0x191deb[_0x15927f(0x128)]=_0x486eec[_0x15927f(0x128)];if(_0x486eec[_0x15927f(0x198)])try{_0x191deb['query']=readFileSync(_0x486eec[_0x15927f(0x198)],_0x15927f(0x13d))[_0x15927f(0x131)]();}catch(_0x5c4f9e){throw new SDKError(ErrorCode[_0x15927f(0x155)],_0x15927f(0x157)+_0x486eec[_0x15927f(0x198)],_0x5c4f9e instanceof Error?_0x5c4f9e:undefined);}if(Object[_0x15927f(0x1ac)](_0x191deb)['length']===0x0)throw new SDKError(ErrorCode[_0x15927f(0x155)],_0x15927f(0x195));if(_0x39fc13[_0x15927f(0x19d)]){console[_0x15927f(0x19b)](_0x15927f(0x137)+_0x27f7ad);for(const [_0x1519ba,_0x428657]of Object['entries'](_0x191deb)){_0x1519ba===_0x15927f(0x127)?console['error']('\x20\x20'+_0x1519ba+':\x20'+_0x428657[_0x15927f(0x143)](0x0,0x32)+_0x15927f(0x154)):console['error']('\x20\x20'+_0x1519ba+':\x20'+_0x428657);}}const _0x46404a=await withSpinner('Updating\x20schedule...',()=>_0xb10908[_0x15927f(0x181)]['update'](_0x27f7ad,_0x191deb),{'verbose':_0x39fc13[_0x15927f(0x19d)]});return console[_0x15927f(0x19b)](_0x15927f(0x199)+_0x46404a[_0x15927f(0x134)][_0x15927f(0x196)]),await handleSingleObjectOutput(_0x46404a[_0x15927f(0x134)],_0x39fc13),0x0;}}export class ScheduleDeleteCommand extends BaseCommand{['name']=a26_0x366fbf(0x16f);[a26_0x366fbf(0x192)]='Delete\x20a\x20scheduled\x20query';[a26_0x366fbf(0x151)](_0xbdd289){const _0x1e5e78=a26_0x366fbf,_0x312850=_0xbdd289[_0x1e5e78(0x168)][0x0];if(!_0x312850)return _0x1e5e78(0x1aa);return undefined;}async[a26_0x366fbf(0x160)](_0x164b00){const _0x87b788=a26_0x366fbf,{options:_0x38a866,args:_0x41a645,tdx:_0xc00451}=_0x164b00,_0x4a39b0=_0x41a645[0x0];if(!_0x38a866[_0x87b788(0x1a1)]){const _0x57046e=await confirm(_0x87b788(0x16c)+_0x4a39b0+'\x22?');if(!_0x57046e)return console['error'](_0x87b788(0x162)),0x0;}const _0x4f27e7=await withSpinner(_0x87b788(0x18b),()=>_0xc00451[_0x87b788(0x181)]['delete'](_0x4a39b0),{'verbose':_0x38a866['verbose']});return console[_0x87b788(0x19b)](_0x87b788(0x146)+_0x4f27e7[_0x87b788(0x134)][_0x87b788(0x196)]),0x0;}}export class ScheduleRunCommand extends BaseCommand{[a26_0x366fbf(0x196)]=a26_0x366fbf(0x156);[a26_0x366fbf(0x192)]='Run\x20a\x20scheduled\x20query\x20immediately';[a26_0x366fbf(0x151)](_0x58b034){const _0x259769=a26_0x366fbf,_0x27f73d=_0x58b034[_0x259769(0x168)][0x0];if(!_0x27f73d)return _0x259769(0x130);return undefined;}async[a26_0x366fbf(0x160)](_0x32a466){const _0x44c797=a26_0x366fbf,{options:_0x3c81ff,args:_0x30371f,tdx:_0x2c459e}=_0x32a466,_0x54c7b5=_0x30371f[0x0],_0x6ac6e6=_0x3c81ff,_0x4667af=_0x6ac6e6[_0x44c797(0x1a5)],_0x3b0e66=_0x6ac6e6[_0x44c797(0x189)]!==undefined?Number(_0x6ac6e6['num']):undefined;if(_0x3c81ff['verbose']){console['error'](_0x44c797(0x18d)+_0x54c7b5);if(_0x4667af)console[_0x44c797(0x19b)](_0x44c797(0x12e)+_0x4667af);if(_0x3b0e66)console[_0x44c797(0x19b)](_0x44c797(0x1a3)+_0x3b0e66);}const _0x447096=await withSpinner(_0x44c797(0x139),()=>_0x2c459e['schedules'][_0x44c797(0x18c)](_0x54c7b5,{'time':_0x4667af,'num':_0x3b0e66}),{'verbose':_0x3c81ff[_0x44c797(0x19d)]}),_0x311ca5=_0x447096[_0x44c797(0x134)]['jobs'];console[_0x44c797(0x19b)](_0x44c797(0x167)+_0x311ca5['length']+_0x44c797(0x1b4)+(_0x311ca5['length']!==0x1?'s':'')+_0x44c797(0x191));for(const _0x1a9864 of _0x311ca5){console[_0x44c797(0x19b)]('\x20\x20Job\x20ID:\x20'+_0x1a9864[_0x44c797(0x187)]);}return await handleSDKOutput(_0x311ca5,_0x3c81ff),0x0;}}export class ScheduleHistoryCommand extends BaseCommand{[a26_0x366fbf(0x196)]=a26_0x366fbf(0x19f);[a26_0x366fbf(0x192)]='Show\x20schedule\x20execution\x20history';[a26_0x366fbf(0x151)](_0x1dfcdb){const _0x4c78bf=a26_0x366fbf,_0x40a5c2=_0x1dfcdb['args'][0x0];if(!_0x40a5c2)return _0x4c78bf(0x1b0);return undefined;}async[a26_0x366fbf(0x160)](_0x3d9574){const _0x382523=a26_0x366fbf,{options:_0x1cf027,args:_0x537570,tdx:_0x3b5860}=_0x3d9574,_0x2d7b9c=_0x537570[0x0],_0x1ab2a5=_0x1cf027,_0x4be749=_0x1ab2a5[_0x382523(0x135)]!==undefined?Number(_0x1ab2a5['from']):undefined,_0x21ae46=_0x1ab2a5['to']!==undefined?Number(_0x1ab2a5['to']):undefined,_0x52b4d4=await withSpinner('Getting\x20schedule\x20history...',()=>_0x3b5860['schedules'][_0x382523(0x129)](_0x2d7b9c,{'from':_0x4be749,'to':_0x21ae46}),{'verbose':_0x1cf027['verbose']}),_0x28b4d9=_0x52b4d4['data'];console[_0x382523(0x19b)](_0x382523(0x17e)+_0x28b4d9[_0x382523(0x170)]+_0x382523(0x14a)+(_0x28b4d9[_0x382523(0x170)]!==0x1?'s':'')+'\x20(showing\x20'+_0x28b4d9[_0x382523(0x135)]+'-'+_0x28b4d9['to']+')');const _0x213e12=_0x28b4d9[_0x382523(0x129)]['map'](_0x38fbeb=>({'job_id':_0x38fbeb[_0x382523(0x187)],'type':_0x38fbeb[_0x382523(0x15d)],'status':_0x38fbeb[_0x382523(0x13b)],'scheduled_at':_0x38fbeb[_0x382523(0x126)],'created_at':_0x38fbeb[_0x382523(0x184)],'start_at':_0x38fbeb['start_at'],'end_at':_0x38fbeb[_0x382523(0x17b)]}));return await handleSDKOutput(_0x213e12,_0x1cf027),0x0;}}function a26_0x1d6a(){const _0xf88aba=['getTime','\x20\x20→\x20','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20schedule\x20\x22','schedule:update','jsonl','schedule:delete','count','user_name','priority','lastRun','listQueries','length','just\x20now','never','retryLimit','1225800JaqmcB','ies','end_at','dim','database','Found\x20','retry_limit','engineVersion','schedules','345246IwVfbm','nextRun','created_at','success','green','job_id','List\x20scheduled\x20queries','num','6wjTEot','Deleting\x20schedule...','run','Running\x20schedule:\x20','delay','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20update\x20<name>\x20[options]','user','\x20created','description','create','\x20scheduled\x20quer','At\x20least\x20one\x20option\x20must\x20be\x20provided\x20to\x20update','name','Getting\x20schedule\x20details...','file','Schedule\x20updated:\x20','log','error','\x22...','verbose','938996gDWuti','schedule:history','tsv','yes','padEnd','\x20\x20Num:\x20','limit','time','map','/app/queries/editor?queryId=','table','\x20\x20Type:\x20','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20delete\x20<name>','7WSNXuc','keys','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20show\x20<name>','Showing\x20first\x20','abs','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20history\x20<name>\x20[--from\x20<n>]\x20[--to\x20<n>]','cron','repeat','285456HeIjUs','\x20job','next_run_at','last_job','list','trino','scheduled_at','query','result','history','Listing\x20scheduled\x20queries...','updated_at','Searching\x20scheduled\x20queries\x20matching\x20\x22','red','\x20\x20Time:\x20','has_next_page','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20run\x20<name>\x20[--time\x20<iso8601>]\x20[--num\x20<1-10>]','trim','914868nTCuhm','format','data','from','4714530HTDktQ','Updating\x20schedule:\x20','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20create\x20<name>\x20-d\x20<db>\x20--file\x20<path>\x20[options]','Running\x20schedule...','cyan','status','schedule:list','utf-8','timezone','m\x20ago','\x20\x20Timezone:\x20','engine_version','5rCwrCB','substring','No\x20scheduled\x20queries\x20found','pagination','Schedule\x20deleted:\x20','max','Schedule\x20created:\x20','statusIcon','\x20execution','Show\x20schedule\x20details','round','Query\x20file\x20is\x20empty','soon','Create\x20a\x20scheduled\x20query','\x20(use\x20--limit\x20to\x20see\x20more)','validate','Creating\x20schedule:\x20','\x20\x20Cron:\x20','...','INVALID_ARGUMENT','schedule:run','Failed\x20to\x20read\x20file:\x20','📅\x20','ended_at','join','output','show','type','time_zone','json','execute','49333taQtKn','Cancelled','schedule:show','\x20matching\x20\x22','schedule:create','site','Schedule\x20run\x20submitted:\x20','args','Creating\x20schedule...'];a26_0x1d6a=function(){return _0xf88aba;};return a26_0x1d6a();}
1
+ const a26_0x280eb8=a26_0x5e4b;(function(_0x5b4eb2,_0x4bdf79){const _0xd9690d=a26_0x5e4b,_0x238e3d=_0x5b4eb2();while(!![]){try{const _0x3b591a=parseInt(_0xd9690d(0x1fe))/0x1+-parseInt(_0xd9690d(0x173))/0x2*(-parseInt(_0xd9690d(0x1f7))/0x3)+-parseInt(_0xd9690d(0x1ec))/0x4*(parseInt(_0xd9690d(0x1f3))/0x5)+-parseInt(_0xd9690d(0x1bb))/0x6+parseInt(_0xd9690d(0x1c6))/0x7*(parseInt(_0xd9690d(0x1f0))/0x8)+parseInt(_0xd9690d(0x172))/0x9+-parseInt(_0xd9690d(0x1d8))/0xa*(parseInt(_0xd9690d(0x1fa))/0xb);if(_0x3b591a===_0x4bdf79)break;else _0x238e3d['push'](_0x238e3d['shift']());}catch(_0x17bc37){_0x238e3d['push'](_0x238e3d['shift']());}}}(a26_0x2c1f,0x84b54));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';function a26_0x2c1f(){const _0x4872da=['349895gWKRJP','jsonl','\x20\x20Num:\x20','\x20\x20Type:\x20','1419702jjEFbz','Creating\x20schedule:\x20','validate','352nsbfpa','has_next_page','Updating\x20schedule:\x20','delete','972917BFbcQq','from','last_job','(unnamed)','2835531KWDFHB','4DLSPcB','utf-8','schedule:create','queries','Searching\x20scheduled\x20queries\x20matching\x20\x22','args','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20run\x20<name>\x20[--time\x20<iso8601>]\x20[--num\x20<1-10>]','update','count','in\x20','error','INVALID_ARGUMENT','dim','\x20scheduled\x20quer','nextRun','table','start_at','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20create\x20<name>\x20-d\x20<db>\x20--file\x20<path>\x20[options]','user_name','user','end_at','delay','trim','m\x20ago','abs','schedule:update','database','length','\x20\x20Time:\x20','success','...','timezone','time','description','site','jobs','padEnd','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20schedule\x20\x22','file','Schedule\x20updated:\x20','List\x20scheduled\x20queries','schedule:delete','schedules','updated_at','keys','Getting\x20schedule\x20details...','scheduled_at','round','engineVersion','result','name','pagination','green','json','history','Creating\x20schedule...','show','type','lastRun','Showing\x20first\x20','retryLimit','\x20job','num','run','data','d\x20ago','retry_limit','execute','h\x20ago','join','Getting\x20schedule\x20history...','red','3461676fYyLrz','At\x20least\x20one\x20option\x20must\x20be\x20provided\x20to\x20update','Schedule\x20created:\x20','soon','\x20schedules','verbose','ies','substring','\x20\x20Database:\x20','Failed\x20to\x20read\x20file:\x20','priority','214991XKqZoN','Listing\x20scheduled\x20queries...','job_id','next_run_at','executing_user_id','schedule:show','status','tsv','Update\x20a\x20scheduled\x20query','No\x20scheduled\x20queries\x20found','limit','format','Create\x20a\x20scheduled\x20query','created_at','\x20\x20Timezone:\x20','entries','statusIcon','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20delete\x20<name>','73410NsqCsN','\x22...','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20update\x20<name>\x20[options]','query','Schedule\x20run\x20submitted:\x20','Show\x20schedule\x20execution\x20history','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20show\x20<name>','\x20(showing\x20','Show\x20schedule\x20details','\x20execution','cyan','Schedule\x20deleted:\x20','map','create','max','\x20created','queryUrl','log','repeat','just\x20now','52ureoRC','engine_version','📅\x20','listQueries','8CuznhK','ended_at','cron'];a26_0x2c1f=function(){return _0x4872da;};return a26_0x2c1f();}import{readFileSync}from'fs';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';function a26_0x5e4b(_0x5dda9b,_0x224226){_0x5dda9b=_0x5dda9b-0x16f;const _0x2c1f9a=a26_0x2c1f();let _0x5e4b4a=_0x2c1f9a[_0x5dda9b];return _0x5e4b4a;}import{hyperlink}from'../sdk/util/formatters.js';import a26_0x949c9d from'chalk';function formatRelativeTime(_0x49d5f6){const _0x316752=a26_0x5e4b,_0x33f885=new Date(_0x49d5f6),_0x12221b=new Date(),_0x333be7=_0x33f885['getTime']()-_0x12221b['getTime'](),_0x1d2c3b=Math[_0x316752(0x18b)](_0x333be7)/0x3e8,_0x560b8d=_0x333be7<0x0;if(_0x1d2c3b<0x3c)return _0x560b8d?_0x316752(0x1eb):_0x316752(0x1be);else{if(_0x1d2c3b<0xe10){const _0x2ae8db=Math[_0x316752(0x1a2)](_0x1d2c3b/0x3c);return _0x560b8d?_0x2ae8db+_0x316752(0x18a):_0x316752(0x17c)+_0x2ae8db+'m';}else{if(_0x1d2c3b<0x15180){const _0x36a107=Math[_0x316752(0x1a2)](_0x1d2c3b/0xe10);return _0x560b8d?_0x36a107+_0x316752(0x1b7):'in\x20'+_0x36a107+'h';}else{if(_0x1d2c3b<0x93a80){const _0x45f20c=Math[_0x316752(0x1a2)](_0x1d2c3b/0x15180);return _0x560b8d?_0x45f20c+_0x316752(0x1b4):_0x316752(0x17c)+_0x45f20c+'d';}else return _0x33f885['toLocaleDateString']();}}}}export class ScheduleListCommand extends BaseCommand{[a26_0x280eb8(0x1a5)]='schedule:list';[a26_0x280eb8(0x194)]=a26_0x280eb8(0x19b);async[a26_0x280eb8(0x1b6)](_0x2a5e4b){const _0x24f736=a26_0x280eb8,{options:_0x3e165b,args:_0x498a29,tdx:_0x45c6c9}=_0x2a5e4b,_0x3f3ca1=resolveLimit(_0x3e165b[_0x24f736(0x1d0)],DEFAULT_DISPLAY_LIMIT),_0x4d1066=_0x498a29[0x0],_0x22e4f7=_0x4d1066?_0x24f736(0x177)+_0x4d1066+_0x24f736(0x1d9):_0x24f736(0x1c7),_0x136e99=await withSpinner(_0x22e4f7,()=>_0x45c6c9[_0x24f736(0x19d)][_0x24f736(0x1ef)]({'limit':_0x3f3ca1,'scheduled':!![],'pattern':_0x4d1066}),{'verbose':_0x3e165b[_0x24f736(0x1c0)]}),_0x348d18=_0x136e99[_0x24f736(0x1b3)][_0x24f736(0x176)],_0x45e354=_0x136e99['data'][_0x24f736(0x1a6)][_0x24f736(0x1fb)],_0x16a6cc=_0x4d1066?'\x20matching\x20\x22'+_0x4d1066+'\x22':'';_0x45e354?console[_0x24f736(0x17d)](_0x24f736(0x1ae)+_0x348d18[_0x24f736(0x18e)]+_0x24f736(0x1bf)+_0x16a6cc+'\x20(use\x20--limit\x20to\x20see\x20more)'):console['error']('Found\x20'+_0x348d18[_0x24f736(0x18e)]+_0x24f736(0x180)+(_0x348d18[_0x24f736(0x18e)]!==0x1?_0x24f736(0x1c1):'y')+_0x16a6cc);if(_0x3e165b[_0x24f736(0x1d1)]===_0x24f736(0x1a8)||_0x3e165b[_0x24f736(0x1d1)]===_0x24f736(0x1f4)||_0x3e165b['format']===_0x24f736(0x182)||_0x3e165b[_0x24f736(0x1d1)]===_0x24f736(0x1cd)){const _0x1beb45=_0x348d18[_0x24f736(0x1e4)](_0x13571a=>({'id':_0x13571a['id'],'name':_0x13571a[_0x24f736(0x1a5)],'cron':_0x13571a[_0x24f736(0x1f2)],'database':_0x13571a[_0x24f736(0x18d)]?.[_0x24f736(0x1a5)],'type':_0x13571a['type'],'timezone':_0x13571a['time_zone'],'user_name':_0x13571a[_0x24f736(0x186)]?.[_0x24f736(0x1a5)],'updated_at':_0x13571a[_0x24f736(0x19e)],'next_run_at':_0x13571a['next_run_at'],'last_job_status':_0x13571a[_0x24f736(0x170)]?.[_0x24f736(0x1cc)]}));await handleSDKOutput(_0x1beb45,_0x3e165b);}else{if(_0x348d18[_0x24f736(0x18e)]===0x0)console[_0x24f736(0x1e9)](_0x24f736(0x1cf));else{const _0x4cb768=_0x3e165b[_0x24f736(0x195)],_0x186245=_0x348d18[_0x24f736(0x1e4)](_0x435d28=>{const _0x3ae4a6=_0x24f736,_0x5bd242=_0x435d28[_0x3ae4a6(0x170)]?.['status']?_0x435d28['last_job'][_0x3ae4a6(0x1cc)]===_0x3ae4a6(0x190)?'✓':'✗':'-',_0x463e3d=_0x435d28[_0x3ae4a6(0x170)]?.[_0x3ae4a6(0x1f1)]?formatRelativeTime(_0x435d28[_0x3ae4a6(0x170)][_0x3ae4a6(0x1f1)]):'never',_0x597973=_0x435d28[_0x3ae4a6(0x1c9)]?formatRelativeTime(_0x435d28[_0x3ae4a6(0x1c9)]):'-',_0x196f94=_0x435d28[_0x3ae4a6(0x1f2)]||'',_0x36868b=_0x435d28[_0x3ae4a6(0x1a5)]||_0x3ae4a6(0x171),_0x59cb86=getConsoleUrl(_0x4cb768,'/app/queries/editor?queryId='+_0x435d28['id']);return{'statusIcon':_0x5bd242,'lastRun':_0x463e3d,'nextRun':_0x597973,'cron':_0x196f94,'name':_0x36868b,'queryUrl':_0x59cb86,'status':_0x435d28[_0x3ae4a6(0x170)]?.[_0x3ae4a6(0x1cc)]};}),_0x40c562=Math[_0x24f736(0x1e6)](..._0x186245['map'](_0x19013f=>_0x19013f[_0x24f736(0x1ad)]['length'])),_0x3eb6ae=Math[_0x24f736(0x1e6)](..._0x186245[_0x24f736(0x1e4)](_0x123136=>_0x123136[_0x24f736(0x181)]['length'])),_0x1641ab=Math[_0x24f736(0x1e6)](..._0x186245[_0x24f736(0x1e4)](_0x2f04f4=>_0x2f04f4[_0x24f736(0x1f2)][_0x24f736(0x18e)])),_0x548e1d=_0x186245[_0x24f736(0x1e4)](_0x2f61d6=>{const _0x44fe73=_0x24f736,_0x23452e=_0x2f61d6[_0x44fe73(0x1cc)]===_0x44fe73(0x190)?a26_0x949c9d[_0x44fe73(0x1a7)](_0x2f61d6[_0x44fe73(0x1d6)]):_0x2f61d6['status']===_0x44fe73(0x17d)?a26_0x949c9d[_0x44fe73(0x1ba)](_0x2f61d6['statusIcon']):a26_0x949c9d[_0x44fe73(0x17f)](_0x2f61d6['statusIcon']),_0x295e3f=_0x2f61d6['lastRun']['padEnd'](_0x40c562),_0x32dea3=_0x2f61d6[_0x44fe73(0x181)][_0x44fe73(0x197)](_0x3eb6ae),_0x28c73d=_0x2f61d6[_0x44fe73(0x1f2)]?a26_0x949c9d[_0x44fe73(0x1e2)](_0x2f61d6['cron']['padEnd'](_0x1641ab)):'\x20'[_0x44fe73(0x1ea)](_0x1641ab),_0x5b6e83=hyperlink(_0x2f61d6[_0x44fe73(0x1a5)],_0x2f61d6[_0x44fe73(0x1e8)]);return _0x44fe73(0x1ee)+_0x23452e+'\x20'+_0x295e3f+'\x20\x20→\x20'+_0x32dea3+'\x20\x20'+_0x28c73d+'\x20\x20'+_0x5b6e83;});await writeOutput(_0x548e1d[_0x24f736(0x1b8)]('\x0a'),_0x3e165b['output'],'list');}}return 0x0;}}export class ScheduleShowCommand extends BaseCommand{[a26_0x280eb8(0x1a5)]=a26_0x280eb8(0x1cb);[a26_0x280eb8(0x194)]=a26_0x280eb8(0x1e0);['validate'](_0x524b93){const _0x436226=a26_0x280eb8,_0x932ec5=_0x524b93[_0x436226(0x178)][0x0];if(!_0x932ec5)return _0x436226(0x1de);return undefined;}async[a26_0x280eb8(0x1b6)](_0x251ca8){const _0x3bb777=a26_0x280eb8,{options:_0x3e88a6,args:_0x2b014a,tdx:_0x4a02e3}=_0x251ca8,_0x5a08c3=_0x2b014a[0x0],_0x4820b0=await withSpinner(_0x3bb777(0x1a0),()=>_0x4a02e3[_0x3bb777(0x19d)][_0x3bb777(0x1ab)](_0x5a08c3),{'verbose':_0x3e88a6[_0x3bb777(0x1c0)]}),_0x3db886=_0x4820b0[_0x3bb777(0x1b3)],_0x61f3cb={'name':_0x3db886[_0x3bb777(0x1a5)],'cron':_0x3db886[_0x3bb777(0x1f2)],'database':_0x3db886[_0x3bb777(0x18d)],'type':_0x3db886[_0x3bb777(0x1ac)],'timezone':_0x3db886[_0x3bb777(0x192)],'user_name':_0x3db886[_0x3bb777(0x185)],'created_at':_0x3db886[_0x3bb777(0x1d3)],'engine_version':_0x3db886['engine_version'],'executing_user_id':_0x3db886[_0x3bb777(0x1ca)],'query':_0x3db886[_0x3bb777(0x1db)],'delay':_0x3db886['delay'],'priority':_0x3db886[_0x3bb777(0x1c5)],'retry_limit':_0x3db886[_0x3bb777(0x1b5)],..._0x3db886[_0x3bb777(0x1a4)]&&{'result':_0x3db886[_0x3bb777(0x1a4)]}};return await handleSingleObjectOutput(_0x61f3cb,_0x3e88a6),0x0;}}export class ScheduleCreateCommand extends BaseCommand{[a26_0x280eb8(0x1a5)]=a26_0x280eb8(0x175);['description']=a26_0x280eb8(0x1d2);[a26_0x280eb8(0x1f9)](_0x15e76c){const _0x3611c5=a26_0x280eb8,_0x19bb9b=_0x15e76c['args'][0x0];if(!_0x19bb9b)return _0x3611c5(0x184);return undefined;}async[a26_0x280eb8(0x1b6)](_0xc64bed){const _0x52afec=a26_0x280eb8,{options:_0x4506ea,args:_0x54215f,tdx:_0x597311}=_0xc64bed,_0x31ebdb=_0x54215f[0x0],_0x499eb2=_0x4506ea,_0x4a33e7=_0x499eb2[_0x52afec(0x18d)],_0x5796ca=_0x499eb2[_0x52afec(0x199)],_0x4fe7e5=_0x499eb2[_0x52afec(0x1ac)]||'trino';let _0x38397f;try{_0x38397f=readFileSync(_0x5796ca,_0x52afec(0x174))['trim']();}catch(_0x176efd){throw new SDKError(ErrorCode[_0x52afec(0x17e)],_0x52afec(0x1c4)+_0x5796ca,_0x176efd instanceof Error?_0x176efd:undefined);}if(!_0x38397f)throw new SDKError(ErrorCode[_0x52afec(0x17e)],'Query\x20file\x20is\x20empty');const _0x3f6fd0={'database':_0x4a33e7,'query':_0x38397f,'type':_0x4fe7e5};if(_0x499eb2['cron'])_0x3f6fd0[_0x52afec(0x1f2)]=_0x499eb2['cron'];if(_0x499eb2[_0x52afec(0x192)])_0x3f6fd0['timezone']=_0x499eb2[_0x52afec(0x192)];if(_0x499eb2[_0x52afec(0x188)]!==undefined)_0x3f6fd0[_0x52afec(0x188)]=Number(_0x499eb2[_0x52afec(0x188)]);if(_0x499eb2['priority']!==undefined)_0x3f6fd0[_0x52afec(0x1c5)]=Number(_0x499eb2['priority']);if(_0x499eb2[_0x52afec(0x1af)]!==undefined)_0x3f6fd0['retry_limit']=Number(_0x499eb2[_0x52afec(0x1af)]);if(_0x499eb2[_0x52afec(0x1a3)])_0x3f6fd0[_0x52afec(0x1ed)]=_0x499eb2[_0x52afec(0x1a3)];if(_0x499eb2['result'])_0x3f6fd0[_0x52afec(0x1a4)]=_0x499eb2[_0x52afec(0x1a4)];if(_0x4506ea[_0x52afec(0x1c0)]){console[_0x52afec(0x17d)](_0x52afec(0x1f8)+_0x31ebdb),console[_0x52afec(0x17d)](_0x52afec(0x1c3)+_0x4a33e7),console[_0x52afec(0x17d)](_0x52afec(0x1f6)+_0x4fe7e5);if(_0x3f6fd0[_0x52afec(0x1f2)])console[_0x52afec(0x17d)]('\x20\x20Cron:\x20'+_0x3f6fd0[_0x52afec(0x1f2)]);if(_0x3f6fd0[_0x52afec(0x192)])console[_0x52afec(0x17d)](_0x52afec(0x1d4)+_0x3f6fd0[_0x52afec(0x192)]);}const _0x4baac3=await withSpinner(_0x52afec(0x1aa),()=>_0x597311[_0x52afec(0x19d)][_0x52afec(0x1e5)](_0x31ebdb,_0x3f6fd0),{'verbose':_0x4506ea[_0x52afec(0x1c0)]});return console['error'](_0x52afec(0x1bd)+_0x4baac3[_0x52afec(0x1b3)][_0x52afec(0x1a5)]),await handleSingleObjectOutput(_0x4baac3[_0x52afec(0x1b3)],_0x4506ea),0x0;}}export class ScheduleUpdateCommand extends BaseCommand{[a26_0x280eb8(0x1a5)]=a26_0x280eb8(0x18c);['description']=a26_0x280eb8(0x1ce);[a26_0x280eb8(0x1f9)](_0x3cbf24){const _0x8d3d7d=a26_0x280eb8,_0x5b6b83=_0x3cbf24[_0x8d3d7d(0x178)][0x0];if(!_0x5b6b83)return _0x8d3d7d(0x1da);return undefined;}async[a26_0x280eb8(0x1b6)](_0x15c890){const _0x309f11=a26_0x280eb8,{options:_0x54f7d6,args:_0x1c63c1,tdx:_0x105b07}=_0x15c890,_0x275dba=_0x1c63c1[0x0],_0xeb014a=_0x54f7d6,_0x39f019={};if(_0xeb014a[_0x309f11(0x18d)])_0x39f019['database']=_0xeb014a[_0x309f11(0x18d)];if(_0xeb014a['type'])_0x39f019[_0x309f11(0x1ac)]=_0xeb014a[_0x309f11(0x1ac)];if(_0xeb014a[_0x309f11(0x1f2)])_0x39f019[_0x309f11(0x1f2)]=_0xeb014a['cron'];if(_0xeb014a[_0x309f11(0x192)])_0x39f019[_0x309f11(0x192)]=_0xeb014a[_0x309f11(0x192)];if(_0xeb014a['delay']!==undefined)_0x39f019[_0x309f11(0x188)]=Number(_0xeb014a[_0x309f11(0x188)]);if(_0xeb014a['priority']!==undefined)_0x39f019[_0x309f11(0x1c5)]=Number(_0xeb014a[_0x309f11(0x1c5)]);if(_0xeb014a['retryLimit']!==undefined)_0x39f019[_0x309f11(0x1b5)]=Number(_0xeb014a[_0x309f11(0x1af)]);if(_0xeb014a['engineVersion'])_0x39f019[_0x309f11(0x1ed)]=_0xeb014a[_0x309f11(0x1a3)];if(_0xeb014a[_0x309f11(0x1a4)])_0x39f019[_0x309f11(0x1a4)]=_0xeb014a[_0x309f11(0x1a4)];if(_0xeb014a[_0x309f11(0x199)])try{_0x39f019[_0x309f11(0x1db)]=readFileSync(_0xeb014a[_0x309f11(0x199)],_0x309f11(0x174))[_0x309f11(0x189)]();}catch(_0xaa9d68){throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x309f11(0x1c4)+_0xeb014a[_0x309f11(0x199)],_0xaa9d68 instanceof Error?_0xaa9d68:undefined);}if(Object[_0x309f11(0x19f)](_0x39f019)[_0x309f11(0x18e)]===0x0)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x309f11(0x1bc));if(_0x54f7d6[_0x309f11(0x1c0)]){console[_0x309f11(0x17d)](_0x309f11(0x1fc)+_0x275dba);for(const [_0x581ae5,_0x3cdb03]of Object[_0x309f11(0x1d5)](_0x39f019)){_0x581ae5===_0x309f11(0x1db)?console[_0x309f11(0x17d)]('\x20\x20'+_0x581ae5+':\x20'+_0x3cdb03[_0x309f11(0x1c2)](0x0,0x32)+_0x309f11(0x191)):console[_0x309f11(0x17d)]('\x20\x20'+_0x581ae5+':\x20'+_0x3cdb03);}}const _0x1011a4=await withSpinner('Updating\x20schedule...',()=>_0x105b07['schedules'][_0x309f11(0x17a)](_0x275dba,_0x39f019),{'verbose':_0x54f7d6[_0x309f11(0x1c0)]});return console[_0x309f11(0x17d)](_0x309f11(0x19a)+_0x1011a4[_0x309f11(0x1b3)][_0x309f11(0x1a5)]),await handleSingleObjectOutput(_0x1011a4[_0x309f11(0x1b3)],_0x54f7d6),0x0;}}export class ScheduleDeleteCommand extends BaseCommand{[a26_0x280eb8(0x1a5)]=a26_0x280eb8(0x19c);[a26_0x280eb8(0x194)]='Delete\x20a\x20scheduled\x20query';[a26_0x280eb8(0x1f9)](_0x4b052a){const _0x1f3374=a26_0x280eb8,_0x1c113b=_0x4b052a['args'][0x0];if(!_0x1c113b)return _0x1f3374(0x1d7);return undefined;}async[a26_0x280eb8(0x1b6)](_0x444462){const _0x4f2f66=a26_0x280eb8,{options:_0x53b14e,args:_0x15ad55,tdx:_0x5a91f6}=_0x444462,_0x25106e=_0x15ad55[0x0];if(!_0x53b14e['yes']){const _0x245caa=await confirm(_0x4f2f66(0x198)+_0x25106e+'\x22?');if(!_0x245caa)return console[_0x4f2f66(0x17d)]('Cancelled'),0x0;}const _0x15bac7=await withSpinner('Deleting\x20schedule...',()=>_0x5a91f6[_0x4f2f66(0x19d)][_0x4f2f66(0x1fd)](_0x25106e),{'verbose':_0x53b14e[_0x4f2f66(0x1c0)]});return console[_0x4f2f66(0x17d)](_0x4f2f66(0x1e3)+_0x15bac7[_0x4f2f66(0x1b3)][_0x4f2f66(0x1a5)]),0x0;}}export class ScheduleRunCommand extends BaseCommand{[a26_0x280eb8(0x1a5)]='schedule:run';[a26_0x280eb8(0x194)]='Run\x20a\x20scheduled\x20query\x20immediately';[a26_0x280eb8(0x1f9)](_0x41afb4){const _0x57ccda=a26_0x280eb8,_0x42dc83=_0x41afb4[_0x57ccda(0x178)][0x0];if(!_0x42dc83)return _0x57ccda(0x179);return undefined;}async[a26_0x280eb8(0x1b6)](_0x3e9cc7){const _0x1a2d29=a26_0x280eb8,{options:_0x2adcd0,args:_0x1041a4,tdx:_0x15217b}=_0x3e9cc7,_0x297c5e=_0x1041a4[0x0],_0x1c3a18=_0x2adcd0,_0xec778c=_0x1c3a18[_0x1a2d29(0x193)],_0x5ec91d=_0x1c3a18[_0x1a2d29(0x1b1)]!==undefined?Number(_0x1c3a18['num']):undefined;if(_0x2adcd0['verbose']){console[_0x1a2d29(0x17d)]('Running\x20schedule:\x20'+_0x297c5e);if(_0xec778c)console[_0x1a2d29(0x17d)](_0x1a2d29(0x18f)+_0xec778c);if(_0x5ec91d)console[_0x1a2d29(0x17d)](_0x1a2d29(0x1f5)+_0x5ec91d);}const _0x5a95f8=await withSpinner('Running\x20schedule...',()=>_0x15217b[_0x1a2d29(0x19d)][_0x1a2d29(0x1b2)](_0x297c5e,{'time':_0xec778c,'num':_0x5ec91d}),{'verbose':_0x2adcd0[_0x1a2d29(0x1c0)]}),_0xe0f257=_0x5a95f8[_0x1a2d29(0x1b3)][_0x1a2d29(0x196)];console[_0x1a2d29(0x17d)](_0x1a2d29(0x1dc)+_0xe0f257[_0x1a2d29(0x18e)]+_0x1a2d29(0x1b0)+(_0xe0f257[_0x1a2d29(0x18e)]!==0x1?'s':'')+_0x1a2d29(0x1e7));for(const _0x45bbb8 of _0xe0f257){console[_0x1a2d29(0x17d)]('\x20\x20Job\x20ID:\x20'+_0x45bbb8['job_id']);}return await handleSDKOutput(_0xe0f257,_0x2adcd0),0x0;}}export class ScheduleHistoryCommand extends BaseCommand{[a26_0x280eb8(0x1a5)]='schedule:history';['description']=a26_0x280eb8(0x1dd);[a26_0x280eb8(0x1f9)](_0x9693d){const _0x5edf7b=a26_0x280eb8,_0x5b6637=_0x9693d[_0x5edf7b(0x178)][0x0];if(!_0x5b6637)return'Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20history\x20<name>\x20[--from\x20<n>]\x20[--to\x20<n>]';return undefined;}async[a26_0x280eb8(0x1b6)](_0x586a18){const _0x2388fb=a26_0x280eb8,{options:_0x3ad110,args:_0x2edbaa,tdx:_0x205ffd}=_0x586a18,_0x30ac83=_0x2edbaa[0x0],_0x3b2b88=_0x3ad110,_0x4e33a3=_0x3b2b88['from']!==undefined?Number(_0x3b2b88['from']):undefined,_0x329715=_0x3b2b88['to']!==undefined?Number(_0x3b2b88['to']):undefined,_0x3fafea=await withSpinner(_0x2388fb(0x1b9),()=>_0x205ffd[_0x2388fb(0x19d)][_0x2388fb(0x1a9)](_0x30ac83,{'from':_0x4e33a3,'to':_0x329715}),{'verbose':_0x3ad110[_0x2388fb(0x1c0)]}),_0x5264f3=_0x3fafea['data'];console[_0x2388fb(0x17d)]('Found\x20'+_0x5264f3['count']+_0x2388fb(0x1e1)+(_0x5264f3[_0x2388fb(0x17b)]!==0x1?'s':'')+_0x2388fb(0x1df)+_0x5264f3[_0x2388fb(0x16f)]+'-'+_0x5264f3['to']+')');const _0x219d71=_0x5264f3[_0x2388fb(0x1a9)]['map'](_0x5f2ef6=>({'job_id':_0x5f2ef6[_0x2388fb(0x1c8)],'type':_0x5f2ef6[_0x2388fb(0x1ac)],'status':_0x5f2ef6[_0x2388fb(0x1cc)],'scheduled_at':_0x5f2ef6[_0x2388fb(0x1a1)],'created_at':_0x5f2ef6[_0x2388fb(0x1d3)],'start_at':_0x5f2ef6[_0x2388fb(0x183)],'end_at':_0x5f2ef6[_0x2388fb(0x187)]}));return await handleSDKOutput(_0x219d71,_0x3ad110),0x0;}}
@@ -1 +1 @@
1
- function a27_0x18a8(){const _0x311db8=['segmentId','Resolving\x20path\x20\x27','\x20\x20Folder\x20path:\x20','\x20\x20-w,\x20--web\x20\x20Open\x20segment\x20in\x20web\x20browser','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20show\x20<path/to/segment.yml>','trim','Resolving\x20parent\x20segment\x20\x27','folderPath','Execute\x20child\x20segment\x20SQL\x20query\x20and\x20show\x20results','getParent','Use:\x20tdx\x20sg\x20view\x20<name>\x20\x20#\x20To\x20show\x20folder\x20details','format','segment:folder:list','Error:\x20Cannot\x20open\x20parent\x20segment\x20with\x20this\x20command.','Error:\x20','verbose','folderId','\x20folder','Error:\x20Folder\x20reference\x20is\x20required','segment:describe','data','jobId','message','Error:\x20Cannot\x20execute\x20query\x20for\x20parent\x20segment\x20with\x20this\x20command.','\x20Opening\x20','length','Target\x20path:\x20','Site:\x20','Folder\x20name:\x20','Segment\x20ID\x20missing\x20from\x20resolved\x20path','createFolder','Resolved\x20relative\x20path\x20to:\x20','resolveParentId','3629813AGFrlC','Error:\x20Cannot\x20open\x20folder\x20in\x20web\x20browser.\x20Use\x20a\x20segment\x20name\x20instead.','Resolved\x20type:\x20','Parent\x20ID:\x20','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20-w\x20\x20#\x20Open\x20segment\x20in\x20web\x20browser','name','segment:sql','Show\x20segment\x20folder\x20details','cause','segment:folder:show','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20view\x20<path/to/segment.yml>','50WUcmhE','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','\x20\x20Full\x20path:\x20','Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]','getSegment','/e/','/app/ps/','Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required','Show\x20segment\x20or\x20folder\x20details','Fetching\x20folder\x20\x27','\x20\x20Segment\x20name:\x20','Show\x20child\x20segment\x20schema\x20(column\x20types)','115191NsLmtt','limit','log','Fetching\x20segment\x20details...','✔\x20Created\x20folder\x20\x27','Usage:\x20tdx\x20segment\x20describe\x20<path>','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20\x20\x20\x20\x20#\x20View\x20child\x20segment\x20details','Resolved\x20folder\x20ID:\x20','segment:show','18LFlchy','Fetching\x20parent\x20segment\x20details...','Error:\x20Cannot\x20show\x20schema\x20for\x20parent\x20segment\x20with\x20this\x20command.','Error:\x20Cannot\x20view\x20parent\x20segment\x20details\x20with\x20this\x20command.','Get\x20SQL\x20query\x20for\x20child\x20segment','Resolving\x20folder\x20\x27','web','(root)','SQL\x20query:\x0a','Show\x20folder\x20or\x20child\x20segment\x20details','\x20\x20tdx\x20sg\x20desc\x20segments/my-audience/premium-users.yml','SEGMENT_NOT_FOUND','Folder\x20ID:\x20','4796070zFIbpx','listFolders','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','3cRIxKE','elapsedTimeMillis','error','Examples:','✖\x20Query\x20failed\x20[','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','1022940vhqpKj','folder','\x20\x20tdx\x20sg\x20show\x20\x22Premium\x20Users\x22','setJobId','Error:\x20Cannot\x20get\x20SQL\x20for\x20parent\x20segment\x20with\x20this\x20command.','segmentName','Fetching\x20SQL\x20for\x20segment...','\x20\x20Parent\x20segment:\x20','Segment\x20ID:\x20','\x20\x20tdx\x20sg\x20sql\x20segments/my-audience/premium-users.yml','Parent\x20name:\x20','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','segment','fullPath','Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20sql\x20<path/to/segment.yml>','✔\x20Found\x20','Error:\x20Cannot\x20show\x20schema\x20for\x20a\x20folder.','description','718992jBkOGU','Resolving\x20\x27','parentId','Error:\x20Path\x20or\x20name\x20is\x20required','parentSegment','Error:\x20Parent\x20segment\x20name\x20is\x20required','parent','\x27...','site','resolveFolderId','Use:\x20tdx\x20ps\x20view','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20desc\x20<path/to/segment.yml>','stats','64NQxpVv','execute','resolvePathToResource','SELECT\x20*\x20FROM\x20(\x0a','Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)','code','1064896rTEGXF','\x20\x20tdx\x20sg\x20show\x20segments/my-audience/premium-users.yml','processedRows','Listing\x20folders\x20for\x20parent\x20\x27','List\x20segment\x20folders\x20under\x20a\x20parent\x20segment','Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.','\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','Folder\x20ID\x20missing\x20from\x20resolved\x20path','\x20\x20Cause:\x20','Resolved\x20parent\x20ID:\x20','Resolved\x20YAML\x20file:\x20','getFolder','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22','getSegmentSQL','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22','Usage:\x20tdx\x20sg\x20sql\x20<name>','type','\x20\x20tdx\x20sg\x20desc\x20\x22Premium\x20Users\x22','Options:','772724kaUohq','Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>','SEGMENT_FOLDER_NOT_FOUND'];a27_0x18a8=function(){return _0x311db8;};return a27_0x18a8();}const a27_0x338134=a27_0x243a;(function(_0xa57376,_0x1099d7){const _0x378d81=a27_0x243a,_0x35e9c5=_0xa57376();while(!![]){try{const _0x3070c9=parseInt(_0x378d81(0x10e))/0x1+-parseInt(_0x378d81(0xe8))/0x2+-parseInt(_0x378d81(0xcf))/0x3*(-parseInt(_0x378d81(0xd5))/0x4)+parseInt(_0x378d81(0x15f))/0x5+parseInt(_0x378d81(0x152))/0x6*(parseInt(_0x378d81(0xfb))/0x7)+-parseInt(_0x378d81(0xf5))/0x8*(-parseInt(_0x378d81(0x149))/0x9)+-parseInt(_0x378d81(0x13d))/0xa*(parseInt(_0x378d81(0x132))/0xb);if(_0x3070c9===_0x1099d7)break;else _0x35e9c5['push'](_0x35e9c5['shift']());}catch(_0x3a969b){_0x35e9c5['push'](_0x35e9c5['shift']());}}}(a27_0x18a8,0x831ce));function a27_0x243a(_0x6e4964,_0x1963f3){_0x6e4964=_0x6e4964-0xcf;const _0x18a8fa=a27_0x18a8();let _0x243a6b=_0x18a8fa[_0x6e4964];return _0x243a6b;}import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner,formatElapsed}from'../utils/spinner.js';import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{executeSchemaQuery}from'../sdk/segment/fields-display.js';import{isYamlFilePath,resolveYamlFilePath}from'../sdk/segment/segment-path-parser.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{openBrowser}from'../utils/process.js';import a27_0x10fe38 from'chalk';async function resolveSegmentTarget(_0x58c965,_0x2e78cd,_0x2b0ebb){const _0x46a79a=a27_0x243a;if(isYamlFilePath(_0x58c965))try{const _0x1c29bd=await resolveYamlFilePath(_0x58c965);return _0x2b0ebb&&(console[_0x46a79a(0xd1)](_0x46a79a(0x105)+_0x58c965),console[_0x46a79a(0xd1)](_0x46a79a(0xdc)+_0x1c29bd[_0x46a79a(0xec)]),console['error'](_0x46a79a(0x147)+_0x1c29bd[_0x46a79a(0xda)]),console[_0x46a79a(0xd1)](_0x46a79a(0x113)+(_0x1c29bd[_0x46a79a(0x118)]||_0x46a79a(0x159))),console[_0x46a79a(0xd1)](_0x46a79a(0x13f)+_0x1c29bd[_0x46a79a(0xe2)])),_0x1c29bd[_0x46a79a(0xe2)];}catch(_0x419ce6){throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x46a79a(0x13e)+_0x419ce6[_0x46a79a(0x127)]);}if(!_0x2e78cd)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],'No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22');return _0x2e78cd+'/'+_0x58c965;}export class SegmentDescribeCommand extends BaseCommand{[a27_0x338134(0x137)]=a27_0x338134(0x124);['description']=a27_0x338134(0x145);async[a27_0x338134(0xf6)](_0x5022f4){const _0x1dd256=a27_0x338134,{options:_0x434adf,args:_0x55951e,tdx:_0x48ec9d}=_0x5022f4,_0x1e9901=_0x55951e[0x0],_0x52d6c6=!_0x1e9901&&!!_0x434adf[_0x1dd256(0xec)],_0x197732=_0x1e9901||_0x434adf[_0x1dd256(0xec)];if(!_0x197732)return console[_0x1dd256(0xd1)](_0x1dd256(0xeb)),console[_0x1dd256(0xd1)](_0x1dd256(0x14e)),console[_0x1dd256(0xd1)](_0x1dd256(0xd2)),console[_0x1dd256(0xd1)](_0x1dd256(0x107)),console[_0x1dd256(0xd1)](_0x1dd256(0x109)),console[_0x1dd256(0xd1)](_0x1dd256(0x101)),console['error'](_0x1dd256(0xe0)),0x1;try{const _0x38ed90=_0x434adf['segmentPath'];let _0x5a299c=_0x197732;!_0x52d6c6&&_0x38ed90&&!_0x197732['includes']('/')&&(_0x5a299c=_0x38ed90+'/'+_0x197732,_0x434adf[_0x1dd256(0x120)]&&console[_0x1dd256(0xd1)](_0x1dd256(0x130)+_0x5a299c));const _0x5d7ce1=await withSpinner(_0x1dd256(0x112)+_0x5a299c+_0x1dd256(0xef),()=>_0x48ec9d[_0x1dd256(0xe1)][_0x1dd256(0xf7)](_0x5a299c),{'verbose':_0x434adf[_0x1dd256(0x120)]}),_0x4f47d5=_0x5d7ce1[_0x1dd256(0x125)];_0x434adf[_0x1dd256(0x120)]&&(console[_0x1dd256(0xd1)]('Resolved\x20type:\x20'+_0x4f47d5[_0x1dd256(0x10b)]),console['error'](_0x1dd256(0x135)+_0x4f47d5[_0x1dd256(0xea)]),_0x4f47d5[_0x1dd256(0x121)]&&console['error'](_0x1dd256(0x15e)+_0x4f47d5[_0x1dd256(0x121)]),_0x4f47d5['segmentId']&&console[_0x1dd256(0xd1)](_0x1dd256(0xdd)+_0x4f47d5['segmentId']));if(_0x4f47d5[_0x1dd256(0x10b)]===_0x1dd256(0xee)){const _0xe1217c=await withSpinner(_0x1dd256(0x153),()=>_0x48ec9d['segment'][_0x1dd256(0x11a)](_0x4f47d5['parentId']),{'verbose':_0x434adf[_0x1dd256(0x120)]});await handleSingleObjectOutput(_0xe1217c[_0x1dd256(0x125)],_0x434adf);}else{if(_0x4f47d5['type']===_0x1dd256(0xd6)){if(!_0x4f47d5[_0x1dd256(0x121)])throw new SDKError(ErrorCode[_0x1dd256(0x110)],'Folder\x20ID\x20missing\x20from\x20resolved\x20path');const _0x3ec86b=await withSpinner('Fetching\x20folder\x20details...',()=>_0x48ec9d[_0x1dd256(0xe1)][_0x1dd256(0x106)](_0x4f47d5[_0x1dd256(0x121)]),{'verbose':_0x434adf[_0x1dd256(0x120)]});await handleSingleObjectOutput(_0x3ec86b[_0x1dd256(0x125)],_0x434adf);}else{if(_0x4f47d5[_0x1dd256(0x10b)]===_0x1dd256(0xe1)){if(!_0x4f47d5['segmentId'])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x1dd256(0x12e));const _0x1eeaaa=await withSpinner('Fetching\x20segment\x20details...',()=>_0x48ec9d[_0x1dd256(0xe1)]['getSegment'](_0x4f47d5['parentId'],_0x4f47d5['segmentId']),{'verbose':_0x434adf[_0x1dd256(0x120)]});await handleSingleObjectOutput(_0x1eeaaa[_0x1dd256(0x125)],_0x434adf);}}}return 0x0;}catch(_0x2f809b){if(_0x2f809b instanceof SDKError)return console[_0x1dd256(0xd1)](_0x1dd256(0x11f)+_0x2f809b[_0x1dd256(0x127)]),_0x2f809b[_0x1dd256(0x13a)]&&console['error'](_0x1dd256(0x103)+_0x2f809b[_0x1dd256(0x13a)]),0x1;throw _0x2f809b;}}}export class SegmentShowCommand extends BaseCommand{['name']=a27_0x338134(0x151);['description']=a27_0x338134(0x119);async[a27_0x338134(0xf6)](_0x12ec6d){const _0x3efa95=a27_0x338134,{options:_0x506a6f,args:_0x53db63,tdx:_0x458f29}=_0x12ec6d,_0x4c7ed6=_0x53db63[0x0];if(!_0x4c7ed6)return console['error'](_0x3efa95(0xe3)),console[_0x3efa95(0xd1)]('Usage:\x20tdx\x20sg\x20show\x20<name>'),console[_0x3efa95(0xd1)](_0x3efa95(0x115)),console[_0x3efa95(0xd1)]('Examples:'),console[_0x3efa95(0xd1)](_0x3efa95(0xd7)),console[_0x3efa95(0xd1)](_0x3efa95(0xfc)),0x1;try{const _0x2598d0=_0x506a6f[_0x3efa95(0xec)],_0x4ac1c6=await resolveSegmentTarget(_0x4c7ed6,_0x2598d0,_0x506a6f[_0x3efa95(0x120)]);_0x506a6f[_0x3efa95(0x120)]&&console[_0x3efa95(0xd1)](_0x3efa95(0x12b)+_0x4ac1c6);const _0x546174=await withSpinner(_0x3efa95(0xe9)+_0x4c7ed6+_0x3efa95(0xef),()=>_0x458f29[_0x3efa95(0xe1)][_0x3efa95(0xf7)](_0x4ac1c6),{'verbose':_0x506a6f[_0x3efa95(0x120)]}),_0x21290f=_0x546174['data'];_0x506a6f['verbose']&&(console[_0x3efa95(0xd1)]('Resolved\x20type:\x20'+_0x21290f[_0x3efa95(0x10b)]),console[_0x3efa95(0xd1)](_0x3efa95(0x135)+_0x21290f[_0x3efa95(0xea)]));if(_0x21290f[_0x3efa95(0x10b)]===_0x3efa95(0xd6))return console['error'](_0x3efa95(0x100)),console['error'](_0x3efa95(0x11b)),0x1;if(_0x21290f[_0x3efa95(0x10b)]==='parent')return console[_0x3efa95(0xd1)](_0x3efa95(0x128)),console['error']('Use:\x20tdx\x20ps\x20show'),0x1;if(!_0x21290f[_0x3efa95(0x111)])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x3efa95(0x12e));const _0x5e01a6=await withSpinner(_0x3efa95(0xdb),()=>_0x458f29['segment'][_0x3efa95(0x108)](_0x21290f['parentId'],_0x21290f[_0x3efa95(0x111)]),{'verbose':_0x506a6f[_0x3efa95(0x120)]});let _0x2385a9=_0x5e01a6['data'];const _0x527615=resolveLimit(_0x506a6f[_0x3efa95(0x14a)],DEFAULT_DISPLAY_LIMIT),_0x1b65c9=/\bLIMIT\s+\d+/i['test'](_0x2385a9);!_0x1b65c9&&(_0x2385a9=_0x2385a9[_0x3efa95(0x116)]()['replace'](/;+$/,''),_0x2385a9=_0x3efa95(0xf8)+_0x2385a9+_0x3efa95(0xd4)+_0x527615);_0x506a6f[_0x3efa95(0x120)]&&console[_0x3efa95(0xd1)](_0x3efa95(0x15a)+_0x2385a9);const _0x1f4c1f=await withProgressSpinner('Executing\x20segment\x20query...',async _0x3030a8=>{const _0x4c578f=await _0x458f29['query']['execute'](_0x2385a9,{'catalog':'td','schema':'information_schema','onJobId':_0x22b02c=>{const _0x378671=a27_0x243a;_0x3030a8[_0x378671(0xd8)](_0x22b02c);}});return _0x4c578f;},{'verbose':_0x506a6f['verbose']}),_0x3c6bd7=_0x1f4c1f[_0x3efa95(0x125)],_0x5d7d2b=_0x3c6bd7[_0x3efa95(0x126)]?'\x20[Job\x20ID:\x20'+_0x3c6bd7['jobId']+']':'';return console[_0x3efa95(0xd1)]('✔\x20Query\x20completed:\x20Processed\x20'+_0x3c6bd7[_0x3efa95(0xf4)][_0x3efa95(0xfd)]['toLocaleString']()+'\x20rows\x20'+('in\x20'+formatElapsed(_0x3c6bd7[_0x3efa95(0xf4)][_0x3efa95(0xd0)])+_0x5d7d2b)),await handleQueryOutput(_0x3c6bd7,_0x506a6f),0x0;}catch(_0x2a2699){if(_0x2a2699 instanceof SDKError)return console[_0x3efa95(0xd1)](_0x3efa95(0xd3)+_0x2a2699[_0x3efa95(0xfa)]+']'),console[_0x3efa95(0xd1)]('\x0a'+_0x2a2699[_0x3efa95(0x127)]),0x1;throw _0x2a2699;}}}export class SegmentFolderListCommand extends BaseCommand{[a27_0x338134(0x137)]=a27_0x338134(0x11d);[a27_0x338134(0xe7)]=a27_0x338134(0xff);async[a27_0x338134(0xf6)](_0x549fba){const _0x84e0dd=a27_0x338134,{options:_0x2e973e,args:_0x491458,tdx:_0x511690}=_0x549fba;if(_0x491458[_0x84e0dd(0x12a)]===0x0)return console[_0x84e0dd(0xd1)](_0x84e0dd(0xed)),console[_0x84e0dd(0xd1)]('Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>'),0x1;const _0x3e9563=_0x491458[0x0];try{_0x2e973e[_0x84e0dd(0x120)]&&(console[_0x84e0dd(0xd1)](_0x84e0dd(0x12c)+_0x2e973e[_0x84e0dd(0xf0)]),console[_0x84e0dd(0xd1)](_0x84e0dd(0xdf)+_0x3e9563));const _0x4a8792=await withSpinner(_0x84e0dd(0x117)+_0x3e9563+_0x84e0dd(0xef),()=>_0x511690[_0x84e0dd(0xe1)][_0x84e0dd(0x131)](_0x3e9563),{'verbose':_0x2e973e[_0x84e0dd(0x120)]}),_0x33c6df=_0x4a8792['data'];_0x2e973e['verbose']&&console['error'](_0x84e0dd(0x104)+_0x33c6df);const _0x47c3d4=await withSpinner(_0x84e0dd(0xfe)+_0x3e9563+'\x27...',()=>_0x511690[_0x84e0dd(0xe1)][_0x84e0dd(0x160)](_0x33c6df),{'verbose':_0x2e973e[_0x84e0dd(0x120)]}),_0xbd69f6=_0x47c3d4[_0x84e0dd(0x125)];return console['error'](_0x84e0dd(0xe5)+_0xbd69f6['length']+_0x84e0dd(0x122)+(_0xbd69f6['length']!==0x1?'s':'')),await handleSDKOutput(_0xbd69f6,_0x2e973e),0x0;}catch(_0x3b6a8f){if(_0x3b6a8f instanceof SDKError)return console[_0x84e0dd(0xd1)](_0x84e0dd(0x11f)+_0x3b6a8f[_0x84e0dd(0x127)]),_0x3b6a8f['cause']&&console[_0x84e0dd(0xd1)](_0x84e0dd(0x103)+_0x3b6a8f[_0x84e0dd(0x13a)]),0x1;throw _0x3b6a8f;}}}export class SegmentFolderShowCommand extends BaseCommand{[a27_0x338134(0x137)]=a27_0x338134(0x13b);[a27_0x338134(0xe7)]=a27_0x338134(0x139);async[a27_0x338134(0xf6)](_0x5061b2){const _0x213e0d=a27_0x338134,{options:_0x353e13,args:_0x39d557,tdx:_0x5182c0}=_0x5061b2;if(_0x39d557[_0x213e0d(0x12a)]===0x0)return console[_0x213e0d(0xd1)](_0x213e0d(0x123)),console['error'](_0x213e0d(0x10f)),0x1;try{const {parentId:_0x2232db,childId:_0x3c8df8}=parseSegmentRef(_0x39d557[0x0]);_0x353e13[_0x213e0d(0x120)]&&(console[_0x213e0d(0xd1)]('Site:\x20'+_0x353e13[_0x213e0d(0xf0)]),console[_0x213e0d(0xd1)](_0x213e0d(0xdf)+_0x2232db),_0x3c8df8&&console['error'](_0x213e0d(0x12d)+_0x3c8df8));if(!_0x3c8df8)return console[_0x213e0d(0xd1)](_0x213e0d(0xf9)),0x1;const _0x42ec7d=await withSpinner(_0x213e0d(0x117)+_0x2232db+'\x27...',()=>_0x5182c0[_0x213e0d(0xe1)]['resolveParentId'](_0x2232db),{'verbose':_0x353e13[_0x213e0d(0x120)]}),_0x5764a6=_0x42ec7d['data'];_0x353e13[_0x213e0d(0x120)]&&console['error'](_0x213e0d(0x104)+_0x5764a6);const _0x51a4c0=await withSpinner(_0x213e0d(0x157)+_0x3c8df8+_0x213e0d(0xef),()=>_0x5182c0[_0x213e0d(0xe1)][_0x213e0d(0xf1)](_0x5764a6,_0x3c8df8),{'verbose':_0x353e13['verbose']}),_0xc8c9d5=_0x51a4c0[_0x213e0d(0x125)];_0x353e13['verbose']&&console['error'](_0x213e0d(0x150)+_0xc8c9d5);const _0xca07ff=await withSpinner(_0x213e0d(0x146)+_0x3c8df8+'\x27...',()=>_0x5182c0['segment'][_0x213e0d(0x106)](_0xc8c9d5),{'verbose':_0x353e13[_0x213e0d(0x120)]});return await handleSDKOutput([_0xca07ff[_0x213e0d(0x125)]],_0x353e13),0x0;}catch(_0x55cdc3){if(_0x55cdc3 instanceof SDKError)return console[_0x213e0d(0xd1)](_0x213e0d(0x11f)+_0x55cdc3[_0x213e0d(0x127)]),_0x55cdc3[_0x213e0d(0x13a)]&&console[_0x213e0d(0xd1)]('\x20\x20Cause:\x20'+_0x55cdc3[_0x213e0d(0x13a)]),0x1;throw _0x55cdc3;}}}export class SegmentSQLCommand extends BaseCommand{[a27_0x338134(0x137)]=a27_0x338134(0x138);['description']=a27_0x338134(0x156);async[a27_0x338134(0xf6)](_0x438863){const _0x4aedd8=a27_0x338134,{options:_0x54be7f,args:_0x464d0f,tdx:_0x5a816f}=_0x438863,_0x252ef3=_0x464d0f[0x0];if(!_0x252ef3)return console[_0x4aedd8(0xd1)]('Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required'),console['error'](_0x4aedd8(0x10a)),console[_0x4aedd8(0xd1)](_0x4aedd8(0xe4)),console[_0x4aedd8(0xd1)](_0x4aedd8(0xd2)),console[_0x4aedd8(0xd1)]('\x20\x20tdx\x20sg\x20sql\x20\x22Premium\x20Users\x22'),console['error'](_0x4aedd8(0xde)),0x1;try{const _0x2bc572=_0x54be7f[_0x4aedd8(0xec)],_0x4ac165=await resolveSegmentTarget(_0x252ef3,_0x2bc572,_0x54be7f['verbose']);_0x54be7f[_0x4aedd8(0x120)]&&console['error']('Target\x20path:\x20'+_0x4ac165);const _0x2c6a4e=await withSpinner('Resolving\x20\x27'+_0x252ef3+'\x27...',()=>_0x5a816f['segment']['resolvePathToResource'](_0x4ac165),{'verbose':_0x54be7f[_0x4aedd8(0x120)]}),_0x584d2c=_0x2c6a4e[_0x4aedd8(0x125)];_0x54be7f[_0x4aedd8(0x120)]&&(console[_0x4aedd8(0xd1)](_0x4aedd8(0x134)+_0x584d2c[_0x4aedd8(0x10b)]),console[_0x4aedd8(0xd1)]('Parent\x20ID:\x20'+_0x584d2c[_0x4aedd8(0xea)]));if(_0x584d2c['type']===_0x4aedd8(0xd6))return console[_0x4aedd8(0xd1)]('Error:\x20Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.'),console[_0x4aedd8(0xd1)]('Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.'),0x1;if(_0x584d2c[_0x4aedd8(0x10b)]==='parent')return console[_0x4aedd8(0xd1)](_0x4aedd8(0xd9)),console[_0x4aedd8(0xd1)]('Use:\x20tdx\x20ps\x20sql'),0x1;if(!_0x584d2c[_0x4aedd8(0x111)])throw new SDKError(ErrorCode[_0x4aedd8(0x15d)],_0x4aedd8(0x12e));const _0x16daf8=await withSpinner('Fetching\x20SQL\x20for\x20segment...',()=>_0x5a816f[_0x4aedd8(0xe1)][_0x4aedd8(0x108)](_0x584d2c[_0x4aedd8(0xea)],_0x584d2c[_0x4aedd8(0x111)]),{'verbose':_0x54be7f['verbose']}),_0x4f4414=_0x16daf8[_0x4aedd8(0x125)];return _0x54be7f['format']==='json'||_0x54be7f[_0x4aedd8(0x11c)]==='jsonl'?await handleSDKOutput([{'sql':_0x4f4414}],_0x54be7f):console[_0x4aedd8(0x14b)](_0x4f4414),0x0;}catch(_0x45ef56){if(_0x45ef56 instanceof SDKError)return console['error'](_0x4aedd8(0x11f)+_0x45ef56[_0x4aedd8(0x127)]),_0x45ef56['cause']&&console[_0x4aedd8(0xd1)](_0x4aedd8(0x103)+_0x45ef56[_0x4aedd8(0x13a)]),0x1;throw _0x45ef56;}}}export class SegmentFolderCreateCommand extends BaseCommand{[a27_0x338134(0x137)]='segment:folder:create';[a27_0x338134(0xe7)]='Create\x20segment\x20folder\x20for\x20organization';async['execute'](_0x579aed){const _0x5801a4=a27_0x338134,{options:_0x1088b7,args:_0x101add,tdx:_0x545f8d}=_0x579aed,_0x3f6289=_0x1088b7;if(_0x101add['length']<0x2)return console[_0x5801a4(0xd1)](_0x5801a4(0x144)),console[_0x5801a4(0xd1)](_0x5801a4(0x140)),0x1;const _0x370572=_0x101add[0x0],_0x5567cf=_0x101add[0x1];_0x3f6289['verbose']&&(console['error'](_0x5801a4(0x12c)+_0x3f6289[_0x5801a4(0xf0)]),console[_0x5801a4(0xd1)]('Parent\x20segment:\x20'+_0x370572),console[_0x5801a4(0xd1)](_0x5801a4(0x12d)+_0x5567cf));let _0x26ff15;if(_0x3f6289['parentFolder']){const _0x51bc87=_0x3f6289['parentFolder'],_0x5267bb=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x370572+_0x5801a4(0xef),()=>_0x545f8d[_0x5801a4(0xe1)][_0x5801a4(0x131)](_0x370572),{'verbose':_0x3f6289['verbose']}),_0x53a275=_0x5267bb[_0x5801a4(0x125)],_0x231c30=await withSpinner('Resolving\x20parent\x20folder\x20\x27'+_0x51bc87+_0x5801a4(0xef),()=>_0x545f8d[_0x5801a4(0xe1)][_0x5801a4(0xf1)](_0x53a275,_0x51bc87),{'verbose':_0x3f6289[_0x5801a4(0x120)]});_0x26ff15=_0x231c30[_0x5801a4(0x125)],_0x3f6289[_0x5801a4(0x120)]&&console[_0x5801a4(0xd1)]('Resolved\x20parent\x20folder\x20ID:\x20'+_0x26ff15);}const _0x2a0cfe={'name':_0x5567cf,'description':_0x3f6289[_0x5801a4(0xe7)],'parentFolderId':_0x26ff15},_0x56bf0e=await withSpinner('Creating\x20folder\x20\x27'+_0x5567cf+_0x5801a4(0xef),()=>_0x545f8d[_0x5801a4(0xe1)][_0x5801a4(0x12f)](_0x370572,_0x2a0cfe),{'verbose':_0x3f6289['verbose']}),_0x49e91d=_0x56bf0e[_0x5801a4(0x125)];return console['error'](_0x5801a4(0x14d)+_0x49e91d[_0x5801a4(0x137)]+'\x27\x20with\x20ID:\x20'+_0x49e91d['id']),await handleSDKOutput([_0x49e91d],_0x3f6289),0x0;}}export class SegmentViewCommand extends BaseCommand{[a27_0x338134(0x137)]='segment:view';[a27_0x338134(0xe7)]=a27_0x338134(0x15b);async[a27_0x338134(0xf6)](_0x3ae19a){const _0x477003=a27_0x338134,{options:_0x1733e5,args:_0x54f716,tdx:_0x56d80a}=_0x3ae19a,_0x299422=_0x54f716[0x0];if(!_0x299422)return console[_0x477003(0xd1)]('Error:\x20Folder\x20or\x20segment\x20name,\x20or\x20YAML\x20file\x20path\x20is\x20required'),console[_0x477003(0xd1)]('Usage:\x20tdx\x20sg\x20view\x20<name>\x20[-w]'),console[_0x477003(0xd1)](_0x477003(0x13c)),console[_0x477003(0xd1)](_0x477003(0x10d)),console['error'](_0x477003(0x114)),console['error'](_0x477003(0xd2)),console[_0x477003(0xd1)]('\x20\x20tdx\x20sg\x20view\x20\x22Marketing\x22\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20folder\x20details'),console[_0x477003(0xd1)](_0x477003(0x14f)),console[_0x477003(0xd1)](_0x477003(0x136)),console[_0x477003(0xd1)]('\x20\x20tdx\x20sg\x20view\x20segments/my-audience/premium-users.yml'),0x1;try{const _0x1a5f41=_0x1733e5[_0x477003(0xec)],_0x3bf673=await resolveSegmentTarget(_0x299422,_0x1a5f41,_0x1733e5[_0x477003(0x120)]);_0x1733e5[_0x477003(0x120)]&&console[_0x477003(0xd1)](_0x477003(0x12b)+_0x3bf673);const _0x1fc217=await withSpinner('Resolving\x20\x27'+_0x299422+_0x477003(0xef),()=>_0x56d80a[_0x477003(0xe1)]['resolvePathToResource'](_0x3bf673),{'verbose':_0x1733e5[_0x477003(0x120)]}),_0x2acd57=_0x1fc217[_0x477003(0x125)];_0x1733e5[_0x477003(0x120)]&&(console[_0x477003(0xd1)](_0x477003(0x134)+_0x2acd57['type']),console[_0x477003(0xd1)](_0x477003(0x135)+_0x2acd57[_0x477003(0xea)]),_0x2acd57[_0x477003(0x121)]&&console[_0x477003(0xd1)](_0x477003(0x15e)+_0x2acd57['folderId']),_0x2acd57[_0x477003(0x111)]&&console[_0x477003(0xd1)]('Segment\x20ID:\x20'+_0x2acd57[_0x477003(0x111)]));if(_0x1733e5[_0x477003(0x158)]){if(_0x2acd57[_0x477003(0x10b)]==='folder')return console['error'](_0x477003(0x133)),0x1;if(_0x2acd57[_0x477003(0x10b)]===_0x477003(0xee))return console['error'](_0x477003(0x11e)),console[_0x477003(0xd1)]('Use:\x20tdx\x20ps\x20view\x20-w'),0x1;if(!_0x2acd57[_0x477003(0x111)])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x477003(0x12e));const _0x4f32cf=getConsoleNextUrl(_0x1733e5[_0x477003(0xf0)],'/app/ps/'+_0x2acd57[_0x477003(0xea)]+_0x477003(0x142)+_0x2acd57[_0x477003(0x111)]);return console[_0x477003(0xd1)](a27_0x10fe38['green']('✔')+_0x477003(0x129)+a27_0x10fe38['cyan'](_0x4f32cf)),openBrowser(_0x4f32cf),0x0;}if(_0x2acd57[_0x477003(0x10b)]===_0x477003(0xd6)){if(!_0x2acd57[_0x477003(0x121)])throw new SDKError(ErrorCode[_0x477003(0x110)],_0x477003(0x102));const _0x432a7b=await withSpinner('Fetching\x20folder\x20details...',()=>_0x56d80a[_0x477003(0xe1)][_0x477003(0x106)](_0x2acd57[_0x477003(0x121)]),{'verbose':_0x1733e5[_0x477003(0x120)]});await handleSingleObjectOutput(_0x432a7b[_0x477003(0x125)],_0x1733e5);}else{if(_0x2acd57[_0x477003(0x10b)]===_0x477003(0xe1)){if(!_0x2acd57[_0x477003(0x111)])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x477003(0x12e));const _0x13a441=await withSpinner(_0x477003(0x14c),()=>_0x56d80a[_0x477003(0xe1)][_0x477003(0x141)](_0x2acd57[_0x477003(0xea)],_0x2acd57[_0x477003(0x111)]),{'verbose':_0x1733e5[_0x477003(0x120)]}),_0x3bcc6f=getConsoleNextUrl(_0x1733e5['site'],_0x477003(0x143)+_0x2acd57['parentId']+_0x477003(0x142)+_0x2acd57[_0x477003(0x111)]),_0x144cae=_0x13a441['data'];_0x144cae['url']=_0x3bcc6f,await handleSingleObjectOutput(_0x144cae,_0x1733e5);}else return console['error'](_0x477003(0x155)),console[_0x477003(0xd1)](_0x477003(0xf2)),0x1;}return 0x0;}catch(_0xc4f9e){if(_0xc4f9e instanceof SDKError)return console[_0x477003(0xd1)](_0x477003(0x11f)+_0xc4f9e[_0x477003(0x127)]),_0xc4f9e[_0x477003(0x13a)]&&console[_0x477003(0xd1)]('\x20\x20Cause:\x20'+_0xc4f9e['cause']),0x1;throw _0xc4f9e;}}}export const SegmentInfoCommand=SegmentViewCommand;export class SegmentDescCommand extends BaseCommand{[a27_0x338134(0x137)]='segment:desc';[a27_0x338134(0xe7)]=a27_0x338134(0x148);async[a27_0x338134(0xf6)](_0x3ab1c0){const _0xa2de79=a27_0x338134,{options:_0x55c517,args:_0x12d21e,tdx:_0x1d4490}=_0x3ab1c0,_0x2630c4=_0x12d21e[0x0];if(!_0x2630c4)return console[_0xa2de79(0xd1)](_0xa2de79(0xe3)),console[_0xa2de79(0xd1)]('Usage:\x20tdx\x20sg\x20desc\x20<name>'),console[_0xa2de79(0xd1)](_0xa2de79(0xf3)),console[_0xa2de79(0xd1)](_0xa2de79(0xd2)),console[_0xa2de79(0xd1)](_0xa2de79(0x10c)),console['error'](_0xa2de79(0x15c)),0x1;try{const _0x30db44=_0x55c517[_0xa2de79(0xec)],_0x497cc3=await resolveSegmentTarget(_0x2630c4,_0x30db44,_0x55c517[_0xa2de79(0x120)]);_0x55c517[_0xa2de79(0x120)]&&console[_0xa2de79(0xd1)](_0xa2de79(0x12b)+_0x497cc3);const _0x32a1ff=await withSpinner('Resolving\x20\x27'+_0x2630c4+_0xa2de79(0xef),()=>_0x1d4490[_0xa2de79(0xe1)][_0xa2de79(0xf7)](_0x497cc3),{'verbose':_0x55c517['verbose']}),_0x9ba370=_0x32a1ff['data'];_0x55c517[_0xa2de79(0x120)]&&(console[_0xa2de79(0xd1)]('Resolved\x20type:\x20'+_0x9ba370[_0xa2de79(0x10b)]),console[_0xa2de79(0xd1)](_0xa2de79(0x135)+_0x9ba370[_0xa2de79(0xea)]));if(_0x9ba370[_0xa2de79(0x10b)]===_0xa2de79(0xd6))return console[_0xa2de79(0xd1)](_0xa2de79(0xe6)),console['error'](_0xa2de79(0x161)),0x1;if(_0x9ba370[_0xa2de79(0x10b)]===_0xa2de79(0xee))return console[_0xa2de79(0xd1)](_0xa2de79(0x154)),console['error']('Use:\x20tdx\x20ps\x20desc'),0x1;if(!_0x9ba370[_0xa2de79(0x111)])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0xa2de79(0x12e));const _0x5d97c7=await withSpinner('Fetching\x20SQL\x20for\x20segment...',()=>_0x1d4490[_0xa2de79(0xe1)][_0xa2de79(0x108)](_0x9ba370[_0xa2de79(0xea)],_0x9ba370[_0xa2de79(0x111)]),{'verbose':_0x55c517['verbose']}),_0x17263c=_0x5d97c7[_0xa2de79(0x125)],_0x450fc1=await executeSchemaQuery(_0x17263c,_0x1d4490,_0x55c517);return await handleQueryOutput(_0x450fc1,_0x55c517),0x0;}catch(_0x11ad4b){if(_0x11ad4b instanceof SDKError)return console[_0xa2de79(0xd1)](_0xa2de79(0x11f)+_0x11ad4b[_0xa2de79(0x127)]),_0x11ad4b['cause']&&console[_0xa2de79(0xd1)](_0xa2de79(0x103)+_0x11ad4b['cause']),0x1;throw _0x11ad4b;}}}
1
+ const a27_0x40aef0=a27_0x1fb5;(function(_0x476ef6,_0x4eb012){const _0x279c80=a27_0x1fb5,_0x2c1e74=_0x476ef6();while(!![]){try{const _0x226b2b=-parseInt(_0x279c80(0x182))/0x1*(parseInt(_0x279c80(0x164))/0x2)+-parseInt(_0x279c80(0x1a8))/0x3*(parseInt(_0x279c80(0x163))/0x4)+parseInt(_0x279c80(0x17e))/0x5*(-parseInt(_0x279c80(0x14d))/0x6)+parseInt(_0x279c80(0x167))/0x7*(parseInt(_0x279c80(0x188))/0x8)+parseInt(_0x279c80(0x13a))/0x9*(parseInt(_0x279c80(0x16e))/0xa)+-parseInt(_0x279c80(0x174))/0xb*(-parseInt(_0x279c80(0x17b))/0xc)+-parseInt(_0x279c80(0x1b6))/0xd*(-parseInt(_0x279c80(0x137))/0xe);if(_0x226b2b===_0x4eb012)break;else _0x2c1e74['push'](_0x2c1e74['shift']());}catch(_0x213510){_0x2c1e74['push'](_0x2c1e74['shift']());}}}(a27_0x934a,0xde5da));function a27_0x1fb5(_0x144b92,_0x519dd5){_0x144b92=_0x144b92-0x130;const _0x934a29=a27_0x934a();let _0x1fb532=_0x934a29[_0x144b92];return _0x1fb532;}import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner,formatElapsed}from'../utils/spinner.js';import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{executeSchemaQuery}from'../sdk/segment/fields-display.js';import{isYamlFilePath,resolveYamlFilePath}from'../sdk/segment/segment-path-parser.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{openBrowser}from'../utils/process.js';import a27_0x4b55f6 from'chalk';async function resolveSegmentTarget(_0x58e849,_0x6eaf26,_0x2cfa4b){const _0x5cb659=a27_0x1fb5;if(isYamlFilePath(_0x58e849))try{const _0x1ab7f4=await resolveYamlFilePath(_0x58e849);return _0x2cfa4b&&(console[_0x5cb659(0x1ad)](_0x5cb659(0x196)+_0x58e849),console[_0x5cb659(0x1ad)](_0x5cb659(0x162)+_0x1ab7f4[_0x5cb659(0x193)]),console['error'](_0x5cb659(0x1c0)+_0x1ab7f4['segmentName']),console[_0x5cb659(0x1ad)](_0x5cb659(0x1ba)+(_0x1ab7f4[_0x5cb659(0x141)]||'(root)')),console[_0x5cb659(0x1ad)](_0x5cb659(0x1bb)+_0x1ab7f4[_0x5cb659(0x1b7)])),_0x1ab7f4[_0x5cb659(0x1b7)];}catch(_0x279b51){throw new SDKError(ErrorCode[_0x5cb659(0x14f)],_0x5cb659(0x1c5)+_0x279b51[_0x5cb659(0x15b)]);}if(!_0x6eaf26)throw new SDKError(ErrorCode[_0x5cb659(0x14f)],_0x5cb659(0x185));return _0x6eaf26+'/'+_0x58e849;}function a27_0x934a(){const _0x1a6b0e=['query','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','url','web','Site:\x20','\x27\x20with\x20ID:\x20','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22','Usage:\x20tdx\x20sg\x20desc\x20<name>','Use:\x20tdx\x20ps\x20view\x20-w','getFolder','Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)','Error:\x20Folder\x20or\x20segment\x20name,\x20or\x20YAML\x20file\x20path\x20is\x20required','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20\x20\x20\x20\x20#\x20View\x20child\x20segment\x20details','Show\x20child\x20segment\x20schema\x20(column\x20types)','Fetching\x20segment\x20details...','Resolved\x20type:\x20','10654WAuFaH','test','Resolving\x20\x27','36shNige','getSegment','Show\x20segment\x20or\x20folder\x20details','elapsedTimeMillis','information_schema','Resolving\x20parent\x20segment\x20\x27','segment:folder:list','folderPath','Error:\x20Cannot\x20show\x20schema\x20for\x20a\x20folder.','cause','SEGMENT_FOLDER_NOT_FOUND','length','code','Parent\x20name:\x20','segment:desc','Error:\x20Path\x20or\x20name\x20is\x20required','replace','Parent\x20ID:\x20','Executing\x20segment\x20query...','10318452mQIXXd','toLocaleString','INVALID_ARGUMENT','description','parentId','\x20\x20tdx\x20sg\x20desc\x20\x22Premium\x20Users\x22','segment:folder:create','\x20\x20Cause:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20view\x20<path/to/segment.yml>','listFolders','createFolder','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','Execute\x20child\x20segment\x20SQL\x20query\x20and\x20show\x20results','SEGMENT_NOT_FOUND','message','Usage:\x20tdx\x20segment\x20describe\x20<path>','Examples:','/e/','processedRows','Error:\x20Parent\x20segment\x20name\x20is\x20required','Fetching\x20SQL\x20for\x20segment...','\x20\x20Parent\x20segment:\x20','4CZBJxc','2XQwuYc','verbose','Folder\x20ID:\x20','7PaflgZ','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20-w\x20\x20#\x20Open\x20segment\x20in\x20web\x20browser','Resolved\x20folder\x20ID:\x20','Use:\x20tdx\x20ps\x20show','Listing\x20folders\x20for\x20parent\x20\x27','Resolved\x20parent\x20folder\x20ID:\x20','segment:describe','574390qRowax','Error:\x20Cannot\x20open\x20folder\x20in\x20web\x20browser.\x20Use\x20a\x20segment\x20name\x20instead.','Folder\x20ID\x20missing\x20from\x20resolved\x20path','Segment\x20ID:\x20','\x20\x20tdx\x20sg\x20sql\x20\x22Premium\x20Users\x22','parent','1309iknffQ','Segment\x20ID\x20missing\x20from\x20resolved\x20path','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20sql\x20<path/to/segment.yml>','jobId','folderId','in\x20','\x20\x20tdx\x20sg\x20view\x20segments/my-audience/premium-users.yml','173916RTZqoC','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','Error:\x20Cannot\x20execute\x20query\x20for\x20parent\x20segment\x20with\x20this\x20command.','5ppnajz','Resolved\x20relative\x20path\x20to:\x20','Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>','Error:\x20Cannot\x20open\x20parent\x20segment\x20with\x20this\x20command.','369689HRIdPw','getParent','segmentId','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','Resolving\x20folder\x20\x27','segment:show','9912424woYJAG','segment','name','site','\x20rows\x20','trim','\x20\x20tdx\x20sg\x20view\x20\x22Marketing\x22\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20folder\x20details','resolveFolderId','limit','Use:\x20tdx\x20ps\x20desc','resolveParentId','parentSegment','\x27...','Resolving\x20parent\x20folder\x20\x27','Resolved\x20YAML\x20file:\x20','Resolved\x20parent\x20ID:\x20','SELECT\x20*\x20FROM\x20(\x0a','\x20\x20tdx\x20sg\x20show\x20\x22Premium\x20Users\x22','Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>','Show\x20folder\x20or\x20child\x20segment\x20details','Resolving\x20path\x20\x27','Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required','resolvePathToResource','stats','Target\x20path:\x20','Usage:\x20tdx\x20sg\x20sql\x20<name>','Creating\x20folder\x20\x27','✔\x20Created\x20folder\x20\x27','parentFolder','folder','includes','Error:\x20Cannot\x20get\x20SQL\x20for\x20parent\x20segment\x20with\x20this\x20command.','3401493AarPRb','Fetching\x20folder\x20details...','SQL\x20query:\x0a','/app/ps/','Error:\x20Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.','error','segmentPath','Error:\x20Folder\x20reference\x20is\x20required','execute','jsonl','Parent\x20segment:\x20','format','\x20Opening\x20','type','16068cQfNgM','fullPath','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20show\x20<path/to/segment.yml>','data','\x20\x20Folder\x20path:\x20','\x20\x20Full\x20path:\x20','Fetching\x20folder\x20\x27','Usage:\x20tdx\x20sg\x20show\x20<name>','Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.','Create\x20segment\x20folder\x20for\x20organization','\x20\x20Segment\x20name:\x20','getSegmentSQL','\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','Error:\x20'];a27_0x934a=function(){return _0x1a6b0e;};return a27_0x934a();}export class SegmentDescribeCommand extends BaseCommand{[a27_0x40aef0(0x18a)]=a27_0x40aef0(0x16d);[a27_0x40aef0(0x150)]=a27_0x40aef0(0x13c);async[a27_0x40aef0(0x1b0)](_0x421cc5){const _0x33bf4b=a27_0x40aef0,{options:_0xc54bb6,args:_0x18fb70,tdx:_0x318575}=_0x421cc5,_0x1c35b5=_0x18fb70[0x0],_0x5c395a=!_0x1c35b5&&!!_0xc54bb6[_0x33bf4b(0x193)],_0x2c318a=_0x1c35b5||_0xc54bb6['parentSegment'];if(!_0x2c318a)return console[_0x33bf4b(0x1ad)](_0x33bf4b(0x149)),console[_0x33bf4b(0x1ad)](_0x33bf4b(0x15c)),console[_0x33bf4b(0x1ad)](_0x33bf4b(0x15d)),console[_0x33bf4b(0x1ad)]('\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22'),console[_0x33bf4b(0x1ad)](_0x33bf4b(0x1ca)),console['error'](_0x33bf4b(0x1c2)),console[_0x33bf4b(0x1ad)](_0x33bf4b(0x17c)),0x1;try{const _0x48d9cc=_0xc54bb6[_0x33bf4b(0x1ae)];let _0x484972=_0x2c318a;!_0x5c395a&&_0x48d9cc&&!_0x2c318a[_0x33bf4b(0x1a6)]('/')&&(_0x484972=_0x48d9cc+'/'+_0x2c318a,_0xc54bb6['verbose']&&console[_0x33bf4b(0x1ad)](_0x33bf4b(0x17f)+_0x484972));const _0xee793a=await withSpinner(_0x33bf4b(0x19c)+_0x484972+_0x33bf4b(0x194),()=>_0x318575[_0x33bf4b(0x189)][_0x33bf4b(0x19e)](_0x484972),{'verbose':_0xc54bb6[_0x33bf4b(0x165)]}),_0x526424=_0xee793a['data'];_0xc54bb6[_0x33bf4b(0x165)]&&(console['error']('Resolved\x20type:\x20'+_0x526424[_0x33bf4b(0x1b5)]),console[_0x33bf4b(0x1ad)](_0x33bf4b(0x14b)+_0x526424['parentId']),_0x526424['folderId']&&console[_0x33bf4b(0x1ad)](_0x33bf4b(0x166)+_0x526424[_0x33bf4b(0x178)]),_0x526424[_0x33bf4b(0x184)]&&console[_0x33bf4b(0x1ad)](_0x33bf4b(0x171)+_0x526424[_0x33bf4b(0x184)]));if(_0x526424['type']===_0x33bf4b(0x173)){const _0x224b75=await withSpinner('Fetching\x20parent\x20segment\x20details...',()=>_0x318575[_0x33bf4b(0x189)][_0x33bf4b(0x183)](_0x526424[_0x33bf4b(0x151)]),{'verbose':_0xc54bb6[_0x33bf4b(0x165)]});await handleSingleObjectOutput(_0x224b75[_0x33bf4b(0x1b9)],_0xc54bb6);}else{if(_0x526424[_0x33bf4b(0x1b5)]===_0x33bf4b(0x1a5)){if(!_0x526424[_0x33bf4b(0x178)])throw new SDKError(ErrorCode[_0x33bf4b(0x144)],_0x33bf4b(0x170));const _0x5e56e5=await withSpinner(_0x33bf4b(0x1a9),()=>_0x318575[_0x33bf4b(0x189)][_0x33bf4b(0x130)](_0x526424[_0x33bf4b(0x178)]),{'verbose':_0xc54bb6['verbose']});await handleSingleObjectOutput(_0x5e56e5[_0x33bf4b(0x1b9)],_0xc54bb6);}else{if(_0x526424['type']===_0x33bf4b(0x189)){if(!_0x526424[_0x33bf4b(0x184)])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x33bf4b(0x175));const _0x375163=await withSpinner(_0x33bf4b(0x135),()=>_0x318575[_0x33bf4b(0x189)][_0x33bf4b(0x13b)](_0x526424['parentId'],_0x526424[_0x33bf4b(0x184)]),{'verbose':_0xc54bb6[_0x33bf4b(0x165)]});await handleSingleObjectOutput(_0x375163[_0x33bf4b(0x1b9)],_0xc54bb6);}}}return 0x0;}catch(_0x5d8161){if(_0x5d8161 instanceof SDKError)return console[_0x33bf4b(0x1ad)](_0x33bf4b(0x1c3)+_0x5d8161[_0x33bf4b(0x15b)]),_0x5d8161[_0x33bf4b(0x143)]&&console[_0x33bf4b(0x1ad)]('\x20\x20Cause:\x20'+_0x5d8161[_0x33bf4b(0x143)]),0x1;throw _0x5d8161;}}}export class SegmentShowCommand extends BaseCommand{[a27_0x40aef0(0x18a)]=a27_0x40aef0(0x187);[a27_0x40aef0(0x150)]=a27_0x40aef0(0x159);async['execute'](_0x55c496){const _0x150537=a27_0x40aef0,{options:_0xb8aefe,args:_0x313255,tdx:_0x5757ae}=_0x55c496,_0x45c4c0=_0x313255[0x0];if(!_0x45c4c0)return console['error']('Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required'),console[_0x150537(0x1ad)](_0x150537(0x1bd)),console[_0x150537(0x1ad)](_0x150537(0x1b8)),console[_0x150537(0x1ad)](_0x150537(0x15d)),console[_0x150537(0x1ad)](_0x150537(0x199)),console[_0x150537(0x1ad)]('\x20\x20tdx\x20sg\x20show\x20segments/my-audience/premium-users.yml'),0x1;try{const _0x4a936d=_0xb8aefe[_0x150537(0x193)],_0x5c6360=await resolveSegmentTarget(_0x45c4c0,_0x4a936d,_0xb8aefe[_0x150537(0x165)]);_0xb8aefe[_0x150537(0x165)]&&console[_0x150537(0x1ad)](_0x150537(0x1a0)+_0x5c6360);const _0x4ab9e0=await withSpinner('Resolving\x20\x27'+_0x45c4c0+_0x150537(0x194),()=>_0x5757ae[_0x150537(0x189)][_0x150537(0x19e)](_0x5c6360),{'verbose':_0xb8aefe[_0x150537(0x165)]}),_0x340fe5=_0x4ab9e0[_0x150537(0x1b9)];_0xb8aefe[_0x150537(0x165)]&&(console[_0x150537(0x1ad)](_0x150537(0x136)+_0x340fe5[_0x150537(0x1b5)]),console['error'](_0x150537(0x14b)+_0x340fe5[_0x150537(0x151)]));if(_0x340fe5[_0x150537(0x1b5)]===_0x150537(0x1a5))return console[_0x150537(0x1ad)](_0x150537(0x1be)),console['error']('Use:\x20tdx\x20sg\x20view\x20<name>\x20\x20#\x20To\x20show\x20folder\x20details'),0x1;if(_0x340fe5[_0x150537(0x1b5)]===_0x150537(0x173))return console[_0x150537(0x1ad)](_0x150537(0x17d)),console[_0x150537(0x1ad)](_0x150537(0x16a)),0x1;if(!_0x340fe5['segmentId'])throw new SDKError(ErrorCode[_0x150537(0x15a)],_0x150537(0x175));const _0x39e18c=await withSpinner(_0x150537(0x161),()=>_0x5757ae[_0x150537(0x189)]['getSegmentSQL'](_0x340fe5[_0x150537(0x151)],_0x340fe5['segmentId']),{'verbose':_0xb8aefe[_0x150537(0x165)]});let _0x277e00=_0x39e18c['data'];const _0x4f0137=resolveLimit(_0xb8aefe[_0x150537(0x190)],DEFAULT_DISPLAY_LIMIT),_0x2a8d6e=/\bLIMIT\s+\d+/i[_0x150537(0x138)](_0x277e00);!_0x2a8d6e&&(_0x277e00=_0x277e00[_0x150537(0x18d)]()[_0x150537(0x14a)](/;+$/,''),_0x277e00=_0x150537(0x198)+_0x277e00+'\x0a)\x20AS\x20segment_query\x0aLIMIT\x20'+_0x4f0137);_0xb8aefe[_0x150537(0x165)]&&console['error'](_0x150537(0x1aa)+_0x277e00);const _0x381ff2=await withProgressSpinner(_0x150537(0x14c),async _0x4f004b=>{const _0x2b56fe=_0x150537,_0x5f10bb=await _0x5757ae[_0x2b56fe(0x1c4)][_0x2b56fe(0x1b0)](_0x277e00,{'catalog':'td','schema':_0x2b56fe(0x13e),'onJobId':_0x5beb74=>{_0x4f004b['setJobId'](_0x5beb74);}});return _0x5f10bb;},{'verbose':_0xb8aefe['verbose']}),_0x70a1ff=_0x381ff2['data'],_0x507c9b=_0x70a1ff[_0x150537(0x177)]?'\x20[Job\x20ID:\x20'+_0x70a1ff[_0x150537(0x177)]+']':'';return console[_0x150537(0x1ad)]('✔\x20Query\x20completed:\x20Processed\x20'+_0x70a1ff['stats'][_0x150537(0x15f)][_0x150537(0x14e)]()+_0x150537(0x18c)+(_0x150537(0x179)+formatElapsed(_0x70a1ff[_0x150537(0x19f)][_0x150537(0x13d)])+_0x507c9b)),await handleQueryOutput(_0x70a1ff,_0xb8aefe),0x0;}catch(_0x149ea4){if(_0x149ea4 instanceof SDKError)return console[_0x150537(0x1ad)]('✖\x20Query\x20failed\x20['+_0x149ea4[_0x150537(0x146)]+']'),console['error']('\x0a'+_0x149ea4[_0x150537(0x15b)]),0x1;throw _0x149ea4;}}}export class SegmentFolderListCommand extends BaseCommand{[a27_0x40aef0(0x18a)]=a27_0x40aef0(0x140);[a27_0x40aef0(0x150)]='List\x20segment\x20folders\x20under\x20a\x20parent\x20segment';async[a27_0x40aef0(0x1b0)](_0x2b1a19){const _0x530c7c=a27_0x40aef0,{options:_0x39876d,args:_0x3c7211,tdx:_0x51fcb4}=_0x2b1a19;if(_0x3c7211[_0x530c7c(0x145)]===0x0)return console['error'](_0x530c7c(0x160)),console[_0x530c7c(0x1ad)](_0x530c7c(0x180)),0x1;const _0x2231cf=_0x3c7211[0x0];try{_0x39876d[_0x530c7c(0x165)]&&(console[_0x530c7c(0x1ad)](_0x530c7c(0x1c8)+_0x39876d[_0x530c7c(0x18b)]),console[_0x530c7c(0x1ad)]('Parent\x20name:\x20'+_0x2231cf));const _0xe23efa=await withSpinner(_0x530c7c(0x13f)+_0x2231cf+_0x530c7c(0x194),()=>_0x51fcb4[_0x530c7c(0x189)][_0x530c7c(0x192)](_0x2231cf),{'verbose':_0x39876d[_0x530c7c(0x165)]}),_0x3c351c=_0xe23efa[_0x530c7c(0x1b9)];_0x39876d[_0x530c7c(0x165)]&&console['error'](_0x530c7c(0x197)+_0x3c351c);const _0x2ad7e4=await withSpinner(_0x530c7c(0x16b)+_0x2231cf+_0x530c7c(0x194),()=>_0x51fcb4[_0x530c7c(0x189)][_0x530c7c(0x156)](_0x3c351c),{'verbose':_0x39876d[_0x530c7c(0x165)]}),_0x56a57e=_0x2ad7e4[_0x530c7c(0x1b9)];return console[_0x530c7c(0x1ad)]('✔\x20Found\x20'+_0x56a57e[_0x530c7c(0x145)]+'\x20folder'+(_0x56a57e['length']!==0x1?'s':'')),await handleSDKOutput(_0x56a57e,_0x39876d),0x0;}catch(_0x34a495){if(_0x34a495 instanceof SDKError)return console[_0x530c7c(0x1ad)]('Error:\x20'+_0x34a495[_0x530c7c(0x15b)]),_0x34a495[_0x530c7c(0x143)]&&console[_0x530c7c(0x1ad)](_0x530c7c(0x154)+_0x34a495[_0x530c7c(0x143)]),0x1;throw _0x34a495;}}}export class SegmentFolderShowCommand extends BaseCommand{['name']='segment:folder:show';[a27_0x40aef0(0x150)]='Show\x20segment\x20folder\x20details';async['execute'](_0x55639e){const _0x495ac1=a27_0x40aef0,{options:_0x86b1ee,args:_0x3c0f1d,tdx:_0x169035}=_0x55639e;if(_0x3c0f1d[_0x495ac1(0x145)]===0x0)return console[_0x495ac1(0x1ad)](_0x495ac1(0x1af)),console[_0x495ac1(0x1ad)](_0x495ac1(0x19a)),0x1;try{const {parentId:_0x312b4d,childId:_0x3bae26}=parseSegmentRef(_0x3c0f1d[0x0]);_0x86b1ee[_0x495ac1(0x165)]&&(console[_0x495ac1(0x1ad)]('Site:\x20'+_0x86b1ee[_0x495ac1(0x18b)]),console[_0x495ac1(0x1ad)](_0x495ac1(0x147)+_0x312b4d),_0x3bae26&&console[_0x495ac1(0x1ad)]('Folder\x20name:\x20'+_0x3bae26));if(!_0x3bae26)return console[_0x495ac1(0x1ad)](_0x495ac1(0x131)),0x1;const _0x35e5cc=await withSpinner(_0x495ac1(0x13f)+_0x312b4d+_0x495ac1(0x194),()=>_0x169035[_0x495ac1(0x189)][_0x495ac1(0x192)](_0x312b4d),{'verbose':_0x86b1ee[_0x495ac1(0x165)]}),_0x303756=_0x35e5cc[_0x495ac1(0x1b9)];_0x86b1ee[_0x495ac1(0x165)]&&console[_0x495ac1(0x1ad)](_0x495ac1(0x197)+_0x303756);const _0x3d170e=await withSpinner(_0x495ac1(0x186)+_0x3bae26+_0x495ac1(0x194),()=>_0x169035[_0x495ac1(0x189)][_0x495ac1(0x18f)](_0x303756,_0x3bae26),{'verbose':_0x86b1ee[_0x495ac1(0x165)]}),_0x3d0395=_0x3d170e['data'];_0x86b1ee[_0x495ac1(0x165)]&&console[_0x495ac1(0x1ad)](_0x495ac1(0x169)+_0x3d0395);const _0x422be9=await withSpinner(_0x495ac1(0x1bc)+_0x3bae26+_0x495ac1(0x194),()=>_0x169035[_0x495ac1(0x189)][_0x495ac1(0x130)](_0x3d0395),{'verbose':_0x86b1ee[_0x495ac1(0x165)]});return await handleSDKOutput([_0x422be9[_0x495ac1(0x1b9)]],_0x86b1ee),0x0;}catch(_0x52bb82){if(_0x52bb82 instanceof SDKError)return console[_0x495ac1(0x1ad)](_0x495ac1(0x1c3)+_0x52bb82[_0x495ac1(0x15b)]),_0x52bb82['cause']&&console[_0x495ac1(0x1ad)](_0x495ac1(0x154)+_0x52bb82['cause']),0x1;throw _0x52bb82;}}}export class SegmentSQLCommand extends BaseCommand{[a27_0x40aef0(0x18a)]='segment:sql';[a27_0x40aef0(0x150)]='Get\x20SQL\x20query\x20for\x20child\x20segment';async[a27_0x40aef0(0x1b0)](_0x36708a){const _0x36fe0b=a27_0x40aef0,{options:_0x32b4b1,args:_0x3642f5,tdx:_0x14f93b}=_0x36708a,_0x301c33=_0x3642f5[0x0];if(!_0x301c33)return console[_0x36fe0b(0x1ad)]('Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required'),console['error'](_0x36fe0b(0x1a1)),console['error'](_0x36fe0b(0x176)),console['error'](_0x36fe0b(0x15d)),console['error'](_0x36fe0b(0x172)),console[_0x36fe0b(0x1ad)]('\x20\x20tdx\x20sg\x20sql\x20segments/my-audience/premium-users.yml'),0x1;try{const _0x34f0bf=_0x32b4b1[_0x36fe0b(0x193)],_0x30139e=await resolveSegmentTarget(_0x301c33,_0x34f0bf,_0x32b4b1[_0x36fe0b(0x165)]);_0x32b4b1[_0x36fe0b(0x165)]&&console[_0x36fe0b(0x1ad)](_0x36fe0b(0x1a0)+_0x30139e);const _0x3896bb=await withSpinner(_0x36fe0b(0x139)+_0x301c33+_0x36fe0b(0x194),()=>_0x14f93b['segment'][_0x36fe0b(0x19e)](_0x30139e),{'verbose':_0x32b4b1[_0x36fe0b(0x165)]}),_0x180e7f=_0x3896bb['data'];_0x32b4b1[_0x36fe0b(0x165)]&&(console[_0x36fe0b(0x1ad)](_0x36fe0b(0x136)+_0x180e7f['type']),console[_0x36fe0b(0x1ad)](_0x36fe0b(0x14b)+_0x180e7f[_0x36fe0b(0x151)]));if(_0x180e7f[_0x36fe0b(0x1b5)]===_0x36fe0b(0x1a5))return console['error'](_0x36fe0b(0x1ac)),console[_0x36fe0b(0x1ad)](_0x36fe0b(0x158)),0x1;if(_0x180e7f[_0x36fe0b(0x1b5)]===_0x36fe0b(0x173))return console[_0x36fe0b(0x1ad)](_0x36fe0b(0x1a7)),console[_0x36fe0b(0x1ad)]('Use:\x20tdx\x20ps\x20sql'),0x1;if(!_0x180e7f[_0x36fe0b(0x184)])throw new SDKError(ErrorCode[_0x36fe0b(0x15a)],_0x36fe0b(0x175));const _0x19c5d3=await withSpinner('Fetching\x20SQL\x20for\x20segment...',()=>_0x14f93b['segment'][_0x36fe0b(0x1c1)](_0x180e7f[_0x36fe0b(0x151)],_0x180e7f[_0x36fe0b(0x184)]),{'verbose':_0x32b4b1[_0x36fe0b(0x165)]}),_0x3becc0=_0x19c5d3[_0x36fe0b(0x1b9)];return _0x32b4b1[_0x36fe0b(0x1b3)]==='json'||_0x32b4b1[_0x36fe0b(0x1b3)]===_0x36fe0b(0x1b1)?await handleSDKOutput([{'sql':_0x3becc0}],_0x32b4b1):console['log'](_0x3becc0),0x0;}catch(_0x478081){if(_0x478081 instanceof SDKError)return console[_0x36fe0b(0x1ad)](_0x36fe0b(0x1c3)+_0x478081['message']),_0x478081[_0x36fe0b(0x143)]&&console[_0x36fe0b(0x1ad)]('\x20\x20Cause:\x20'+_0x478081[_0x36fe0b(0x143)]),0x1;throw _0x478081;}}}export class SegmentFolderCreateCommand extends BaseCommand{['name']=a27_0x40aef0(0x153);[a27_0x40aef0(0x150)]=a27_0x40aef0(0x1bf);async['execute'](_0x342c15){const _0x3ce287=a27_0x40aef0,{options:_0x3c7f6c,args:_0x48f306,tdx:_0x1aad1a}=_0x342c15,_0x1f1f56=_0x3c7f6c;if(_0x48f306[_0x3ce287(0x145)]<0x2)return console[_0x3ce287(0x1ad)]('Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required'),console[_0x3ce287(0x1ad)]('Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]'),0x1;const _0x26b1de=_0x48f306[0x0],_0x56a5d2=_0x48f306[0x1];_0x1f1f56['verbose']&&(console[_0x3ce287(0x1ad)](_0x3ce287(0x1c8)+_0x1f1f56[_0x3ce287(0x18b)]),console[_0x3ce287(0x1ad)](_0x3ce287(0x1b2)+_0x26b1de),console['error']('Folder\x20name:\x20'+_0x56a5d2));let _0x34c139;if(_0x1f1f56[_0x3ce287(0x1a4)]){const _0x62706b=_0x1f1f56['parentFolder'],_0x1ef2e1=await withSpinner(_0x3ce287(0x13f)+_0x26b1de+_0x3ce287(0x194),()=>_0x1aad1a[_0x3ce287(0x189)][_0x3ce287(0x192)](_0x26b1de),{'verbose':_0x1f1f56['verbose']}),_0x185c59=_0x1ef2e1[_0x3ce287(0x1b9)],_0x53bc0f=await withSpinner(_0x3ce287(0x195)+_0x62706b+'\x27...',()=>_0x1aad1a[_0x3ce287(0x189)][_0x3ce287(0x18f)](_0x185c59,_0x62706b),{'verbose':_0x1f1f56[_0x3ce287(0x165)]});_0x34c139=_0x53bc0f[_0x3ce287(0x1b9)],_0x1f1f56[_0x3ce287(0x165)]&&console[_0x3ce287(0x1ad)](_0x3ce287(0x16c)+_0x34c139);}const _0xdd7c6e={'name':_0x56a5d2,'description':_0x1f1f56[_0x3ce287(0x150)],'parentFolderId':_0x34c139},_0x4b964f=await withSpinner(_0x3ce287(0x1a2)+_0x56a5d2+_0x3ce287(0x194),()=>_0x1aad1a[_0x3ce287(0x189)][_0x3ce287(0x157)](_0x26b1de,_0xdd7c6e),{'verbose':_0x1f1f56[_0x3ce287(0x165)]}),_0x330807=_0x4b964f[_0x3ce287(0x1b9)];return console[_0x3ce287(0x1ad)](_0x3ce287(0x1a3)+_0x330807[_0x3ce287(0x18a)]+_0x3ce287(0x1c9)+_0x330807['id']),await handleSDKOutput([_0x330807],_0x1f1f56),0x0;}}export class SegmentViewCommand extends BaseCommand{['name']='segment:view';[a27_0x40aef0(0x150)]=a27_0x40aef0(0x19b);async['execute'](_0x56852d){const _0x50863b=a27_0x40aef0,{options:_0xe19cc1,args:_0x38f9f7,tdx:_0x1b9a43}=_0x56852d,_0x346a5d=_0x38f9f7[0x0];if(!_0x346a5d)return console['error'](_0x50863b(0x132)),console[_0x50863b(0x1ad)]('Usage:\x20tdx\x20sg\x20view\x20<name>\x20[-w]'),console[_0x50863b(0x1ad)](_0x50863b(0x155)),console['error']('Options:'),console[_0x50863b(0x1ad)]('\x20\x20-w,\x20--web\x20\x20Open\x20segment\x20in\x20web\x20browser'),console[_0x50863b(0x1ad)]('Examples:'),console[_0x50863b(0x1ad)](_0x50863b(0x18e)),console['error'](_0x50863b(0x133)),console[_0x50863b(0x1ad)](_0x50863b(0x168)),console[_0x50863b(0x1ad)](_0x50863b(0x17a)),0x1;try{const _0x48a891=_0xe19cc1[_0x50863b(0x193)],_0x54ed30=await resolveSegmentTarget(_0x346a5d,_0x48a891,_0xe19cc1[_0x50863b(0x165)]);_0xe19cc1[_0x50863b(0x165)]&&console[_0x50863b(0x1ad)](_0x50863b(0x1a0)+_0x54ed30);const _0x20f02b=await withSpinner(_0x50863b(0x139)+_0x346a5d+_0x50863b(0x194),()=>_0x1b9a43[_0x50863b(0x189)][_0x50863b(0x19e)](_0x54ed30),{'verbose':_0xe19cc1[_0x50863b(0x165)]}),_0x374b10=_0x20f02b[_0x50863b(0x1b9)];_0xe19cc1['verbose']&&(console[_0x50863b(0x1ad)](_0x50863b(0x136)+_0x374b10['type']),console['error']('Parent\x20ID:\x20'+_0x374b10[_0x50863b(0x151)]),_0x374b10[_0x50863b(0x178)]&&console[_0x50863b(0x1ad)]('Folder\x20ID:\x20'+_0x374b10[_0x50863b(0x178)]),_0x374b10['segmentId']&&console[_0x50863b(0x1ad)](_0x50863b(0x171)+_0x374b10[_0x50863b(0x184)]));if(_0xe19cc1[_0x50863b(0x1c7)]){if(_0x374b10[_0x50863b(0x1b5)]===_0x50863b(0x1a5))return console[_0x50863b(0x1ad)](_0x50863b(0x16f)),0x1;if(_0x374b10[_0x50863b(0x1b5)]==='parent')return console[_0x50863b(0x1ad)](_0x50863b(0x181)),console[_0x50863b(0x1ad)](_0x50863b(0x1cc)),0x1;if(!_0x374b10[_0x50863b(0x184)])throw new SDKError(ErrorCode[_0x50863b(0x15a)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x19c9f3=getConsoleNextUrl(_0xe19cc1[_0x50863b(0x18b)],_0x50863b(0x1ab)+_0x374b10[_0x50863b(0x151)]+_0x50863b(0x15e)+_0x374b10[_0x50863b(0x184)]);return console[_0x50863b(0x1ad)](a27_0x4b55f6['green']('✔')+_0x50863b(0x1b4)+a27_0x4b55f6['cyan'](_0x19c9f3)),openBrowser(_0x19c9f3),0x0;}if(_0x374b10[_0x50863b(0x1b5)]===_0x50863b(0x1a5)){if(!_0x374b10[_0x50863b(0x178)])throw new SDKError(ErrorCode['SEGMENT_FOLDER_NOT_FOUND'],_0x50863b(0x170));const _0x40914f=await withSpinner(_0x50863b(0x1a9),()=>_0x1b9a43[_0x50863b(0x189)]['getFolder'](_0x374b10[_0x50863b(0x178)]),{'verbose':_0xe19cc1[_0x50863b(0x165)]});await handleSingleObjectOutput(_0x40914f[_0x50863b(0x1b9)],_0xe19cc1);}else{if(_0x374b10[_0x50863b(0x1b5)]===_0x50863b(0x189)){if(!_0x374b10[_0x50863b(0x184)])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x4da820=await withSpinner('Fetching\x20segment\x20details...',()=>_0x1b9a43[_0x50863b(0x189)][_0x50863b(0x13b)](_0x374b10[_0x50863b(0x151)],_0x374b10[_0x50863b(0x184)]),{'verbose':_0xe19cc1['verbose']}),_0x2021b9=getConsoleNextUrl(_0xe19cc1[_0x50863b(0x18b)],_0x50863b(0x1ab)+_0x374b10[_0x50863b(0x151)]+_0x50863b(0x15e)+_0x374b10[_0x50863b(0x184)]),_0x582e49=_0x4da820[_0x50863b(0x1b9)];_0x582e49[_0x50863b(0x1c6)]=_0x2021b9,await handleSingleObjectOutput(_0x582e49,_0xe19cc1);}else return console[_0x50863b(0x1ad)]('Error:\x20Cannot\x20view\x20parent\x20segment\x20details\x20with\x20this\x20command.'),console['error']('Use:\x20tdx\x20ps\x20view'),0x1;}return 0x0;}catch(_0x49fbec){if(_0x49fbec instanceof SDKError)return console[_0x50863b(0x1ad)](_0x50863b(0x1c3)+_0x49fbec[_0x50863b(0x15b)]),_0x49fbec['cause']&&console[_0x50863b(0x1ad)](_0x50863b(0x154)+_0x49fbec['cause']),0x1;throw _0x49fbec;}}}export const SegmentInfoCommand=SegmentViewCommand;export class SegmentDescCommand extends BaseCommand{[a27_0x40aef0(0x18a)]=a27_0x40aef0(0x148);[a27_0x40aef0(0x150)]=a27_0x40aef0(0x134);async[a27_0x40aef0(0x1b0)](_0x1106e2){const _0x48dfad=a27_0x40aef0,{options:_0x60496f,args:_0x419340,tdx:_0x4f1d5f}=_0x1106e2,_0x121919=_0x419340[0x0];if(!_0x121919)return console[_0x48dfad(0x1ad)](_0x48dfad(0x19d)),console[_0x48dfad(0x1ad)](_0x48dfad(0x1cb)),console[_0x48dfad(0x1ad)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20desc\x20<path/to/segment.yml>'),console[_0x48dfad(0x1ad)](_0x48dfad(0x15d)),console[_0x48dfad(0x1ad)](_0x48dfad(0x152)),console[_0x48dfad(0x1ad)]('\x20\x20tdx\x20sg\x20desc\x20segments/my-audience/premium-users.yml'),0x1;try{const _0xb2fc53=_0x60496f[_0x48dfad(0x193)],_0x2b094b=await resolveSegmentTarget(_0x121919,_0xb2fc53,_0x60496f['verbose']);_0x60496f[_0x48dfad(0x165)]&&console[_0x48dfad(0x1ad)](_0x48dfad(0x1a0)+_0x2b094b);const _0x84eaca=await withSpinner(_0x48dfad(0x139)+_0x121919+'\x27...',()=>_0x4f1d5f[_0x48dfad(0x189)][_0x48dfad(0x19e)](_0x2b094b),{'verbose':_0x60496f['verbose']}),_0x2a8da3=_0x84eaca['data'];_0x60496f[_0x48dfad(0x165)]&&(console['error'](_0x48dfad(0x136)+_0x2a8da3[_0x48dfad(0x1b5)]),console[_0x48dfad(0x1ad)](_0x48dfad(0x14b)+_0x2a8da3[_0x48dfad(0x151)]));if(_0x2a8da3['type']===_0x48dfad(0x1a5))return console[_0x48dfad(0x1ad)](_0x48dfad(0x142)),console[_0x48dfad(0x1ad)](_0x48dfad(0x158)),0x1;if(_0x2a8da3[_0x48dfad(0x1b5)]===_0x48dfad(0x173))return console[_0x48dfad(0x1ad)]('Error:\x20Cannot\x20show\x20schema\x20for\x20parent\x20segment\x20with\x20this\x20command.'),console[_0x48dfad(0x1ad)](_0x48dfad(0x191)),0x1;if(!_0x2a8da3['segmentId'])throw new SDKError(ErrorCode[_0x48dfad(0x15a)],_0x48dfad(0x175));const _0x444be0=await withSpinner(_0x48dfad(0x161),()=>_0x4f1d5f[_0x48dfad(0x189)]['getSegmentSQL'](_0x2a8da3[_0x48dfad(0x151)],_0x2a8da3[_0x48dfad(0x184)]),{'verbose':_0x60496f['verbose']}),_0x645861=_0x444be0[_0x48dfad(0x1b9)],_0x7ad97c=await executeSchemaQuery(_0x645861,_0x4f1d5f,_0x60496f);return await handleQueryOutput(_0x7ad97c,_0x60496f),0x0;}catch(_0x46a26e){if(_0x46a26e instanceof SDKError)return console[_0x48dfad(0x1ad)](_0x48dfad(0x1c3)+_0x46a26e['message']),_0x46a26e['cause']&&console['error']('\x20\x20Cause:\x20'+_0x46a26e['cause']),0x1;throw _0x46a26e;}}}
@@ -1 +1 @@
1
- function a28_0x8f23(_0x1b43e6,_0xa27d1e){_0x1b43e6=_0x1b43e6-0x140;const _0x4bfa78=a28_0x4bfa();let _0x8f2300=_0x4bfa78[_0x1b43e6];return _0x8f2300;}function a28_0x4bfa(){const _0x2dcdcd=['3793937BzhNAE','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','Resolving\x20parent\x20segment\x20\x27','length','72zdreTs','806283srAIPC','folder','\x20\x20\x20Path:\x20','type','resolveParentId','ruleFile','segment','4331745PTznRB','invisible','Parent\x20path:\x20','Resolving\x20folder\x20\x27','resolveFolderId','site','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]','description','resolvePathToResource','Target\x20path:\x20','noCountPopulation','1145640DIBXQc','Create\x20child\x20segment\x20with\x20filtering\x20rules','yellow','180MkCDAi','\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','segmentPath','kind','name','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27','segments','error','853XgltFD','Examples:','segment:create','createSegment','includes','Site:\x20','verbose','folderId','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27','\x27\x20with\x20ID:\x20','10635pcwvxf','20936641NHcNjJ','6fKZlVe','rule','Resolved\x20folder\x20ID:\x20','execute','Parent:\x20','1870FkQkBg','data','\x27...'];a28_0x4bfa=function(){return _0x2dcdcd;};return a28_0x4bfa();}const a28_0x19de91=a28_0x8f23;(function(_0x1b8188,_0x3a42c2){const _0x36a124=a28_0x8f23,_0x3678d3=_0x1b8188();while(!![]){try{const _0x146107=parseInt(_0x36a124(0x148))/0x1*(parseInt(_0x36a124(0x159))/0x2)+-parseInt(_0x36a124(0x152))/0x3*(parseInt(_0x36a124(0x140))/0x4)+-parseInt(_0x36a124(0x168))/0x5+parseInt(_0x36a124(0x154))/0x6*(-parseInt(_0x36a124(0x15c))/0x7)+parseInt(_0x36a124(0x160))/0x8*(-parseInt(_0x36a124(0x161))/0x9)+parseInt(_0x36a124(0x174))/0xa+parseInt(_0x36a124(0x153))/0xb;if(_0x146107===_0x3a42c2)break;else _0x3678d3['push'](_0x3678d3['shift']());}catch(_0x6dc294){_0x3678d3['push'](_0x3678d3['shift']());}}}(a28_0x4bfa,0x6bbd6));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 a28_0x3820a5 from'chalk';export class SegmentCreateCommand extends BaseCommand{['name']=a28_0x19de91(0x14a);['description']=a28_0x19de91(0x175);async[a28_0x19de91(0x157)](_0x1250a8){const _0x3d5588=a28_0x19de91;console[_0x3d5588(0x147)](a28_0x3820a5[_0x3d5588(0x176)]('⚠\x20Deprecation\x20warning:\x20`segment\x20create`\x20is\x20deprecated.')),console[_0x3d5588(0x147)](a28_0x3820a5[_0x3d5588(0x176)](_0x3d5588(0x15d)));const {options:_0x1ec617,args:_0x246da3,tdx:_0x2def13}=_0x1250a8,_0x17e07f=_0x1ec617;if(_0x246da3[_0x3d5588(0x15f)]===0x0)return console[_0x3d5588(0x147)](_0x3d5588(0x16e)),console['error']('Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]'),console[_0x3d5588(0x147)](_0x3d5588(0x149)),console[_0x3d5588(0x147)](_0x3d5588(0x150)),console[_0x3d5588(0x147)](_0x3d5588(0x145)),console[_0x3d5588(0x147)](_0x3d5588(0x141)),0x1;const _0x1133c4=_0x246da3[0x0],_0x4e495a=_0x1ec617[_0x3d5588(0x142)];let _0x505097=_0x1133c4;_0x4e495a&&!_0x1133c4[_0x3d5588(0x14c)]('/')&&(_0x505097=_0x4e495a+'/'+_0x1133c4,_0x17e07f[_0x3d5588(0x14e)]&&console[_0x3d5588(0x147)]('Resolved\x20relative\x20path\x20to:\x20'+_0x505097));const _0x2c3de9=parsePath(_0x505097);if(_0x2c3de9[_0x3d5588(0x146)][_0x3d5588(0x15f)]<0x2)return console[_0x3d5588(0x147)]('Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)'),console['error'](_0x3d5588(0x16f)),0x1;const _0x5f42cd=_0x2c3de9[_0x3d5588(0x146)][0x0],_0x3c6685=getBaseName(_0x505097),_0x3b6985=getParentPath(_0x505097);_0x17e07f[_0x3d5588(0x14e)]&&(console[_0x3d5588(0x147)](_0x3d5588(0x14d)+_0x17e07f[_0x3d5588(0x16d)]),console[_0x3d5588(0x147)](_0x3d5588(0x172)+_0x505097),console['error'](_0x3d5588(0x158)+_0x5f42cd),console[_0x3d5588(0x147)]('Segment\x20name:\x20'+_0x3c6685),console[_0x3d5588(0x147)](_0x3d5588(0x16a)+_0x3b6985));const _0x55623d=await withSpinner(_0x3d5588(0x15e)+_0x5f42cd+_0x3d5588(0x15b),()=>_0x2def13['segment'][_0x3d5588(0x165)](_0x5f42cd),{'verbose':_0x17e07f[_0x3d5588(0x14e)]}),_0x2c89d7=_0x55623d[_0x3d5588(0x15a)];let _0x5a84a5;if(_0x2c3de9['segments'][_0x3d5588(0x15f)]>0x2){const _0xec377a=await withSpinner('Resolving\x20folder\x20path\x20\x27'+_0x3b6985+'\x27...',()=>_0x2def13['segment'][_0x3d5588(0x171)](_0x3b6985),{'verbose':_0x17e07f[_0x3d5588(0x14e)]}),_0x42e230=_0xec377a['data'];if(_0x42e230[_0x3d5588(0x164)]!=='folder'&&_0x42e230[_0x3d5588(0x164)]!=='parent')return console['error']('Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.'),0x1;_0x5a84a5=_0x42e230[_0x3d5588(0x14f)];}else{if(_0x17e07f[_0x3d5588(0x162)]){const _0x2b06f9=await withSpinner(_0x3d5588(0x16b)+_0x17e07f[_0x3d5588(0x162)]+_0x3d5588(0x15b),()=>_0x2def13['segment'][_0x3d5588(0x16c)](_0x2c89d7,_0x17e07f['folder']),{'verbose':_0x17e07f[_0x3d5588(0x14e)]});_0x5a84a5=_0x2b06f9[_0x3d5588(0x15a)];}}_0x17e07f[_0x3d5588(0x14e)]&&_0x5a84a5&&console[_0x3d5588(0x147)](_0x3d5588(0x156)+_0x5a84a5);const _0x1fb2a9=await loadJSONFromOptions(_0x17e07f[_0x3d5588(0x155)],_0x17e07f[_0x3d5588(0x166)]),_0x702b51={'name':_0x3c6685,'description':_0x17e07f[_0x3d5588(0x170)],'rule':_0x1fb2a9,'kind':_0x17e07f['kind']!==undefined?parseInt(_0x17e07f[_0x3d5588(0x143)],0xa):undefined,'isVisible':_0x17e07f[_0x3d5588(0x169)]?![]:undefined,'segmentFolderId':_0x5a84a5,'countPopulation':_0x17e07f[_0x3d5588(0x173)]?![]:undefined},_0x42df44=await withSpinner('Creating\x20segment\x20\x27'+_0x3c6685+_0x3d5588(0x15b),()=>_0x2def13[_0x3d5588(0x167)][_0x3d5588(0x14b)](_0x2c89d7,_0x702b51),{'verbose':_0x17e07f[_0x3d5588(0x14e)]}),_0x1d5420=_0x42df44[_0x3d5588(0x15a)];return console[_0x3d5588(0x147)]('✔\x20Created\x20segment\x20\x27'+_0x1d5420[_0x3d5588(0x144)]+_0x3d5588(0x151)+_0x1d5420['id']),_0x505097!==_0x1133c4&&console[_0x3d5588(0x147)](_0x3d5588(0x163)+_0x505097),await handleSDKOutput([_0x1d5420],_0x17e07f),0x0;}}
1
+ const a28_0x2dcbc0=a28_0x5a28;(function(_0x331c76,_0xc168ed){const _0x19df76=a28_0x5a28,_0x2f0fbb=_0x331c76();while(!![]){try{const _0x44a667=-parseInt(_0x19df76(0xd7))/0x1+-parseInt(_0x19df76(0xc3))/0x2*(parseInt(_0x19df76(0xf8))/0x3)+-parseInt(_0x19df76(0xe2))/0x4*(parseInt(_0x19df76(0xdc))/0x5)+parseInt(_0x19df76(0xda))/0x6+-parseInt(_0x19df76(0xf5))/0x7*(-parseInt(_0x19df76(0xe3))/0x8)+parseInt(_0x19df76(0xe1))/0x9*(-parseInt(_0x19df76(0xc2))/0xa)+-parseInt(_0x19df76(0xee))/0xb*(-parseInt(_0x19df76(0xf4))/0xc);if(_0x44a667===_0xc168ed)break;else _0x2f0fbb['push'](_0x2f0fbb['shift']());}catch(_0x53928e){_0x2f0fbb['push'](_0x2f0fbb['shift']());}}}(a28_0xcfa3,0xd590c));import{BaseCommand}from'./command.js';function a28_0xcfa3(){const _0x26e2b5=['rule','length','30fVruQh','3456vaKDET','noCountPopulation','Parent:\x20','Resolving\x20parent\x20segment\x20\x27','parent','error','Resolved\x20folder\x20ID:\x20','kind','✔\x20Created\x20segment\x20\x27','Create\x20child\x20segment\x20with\x20filtering\x20rules','ruleFile','folderId','yellow','verbose','Site:\x20','Resolved\x20relative\x20path\x20to:\x20','\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','data','folder','\x27...','1593188JrliCn','Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]','Examples:','9352872AYIYbu','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27','185pooPBY','resolveFolderId','Resolving\x20folder\x20\x27','resolvePathToResource','execute','1173951ofaOVo','39716UtAnjf','8DxCKDs','Segment\x20name:\x20','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]','includes','Resolving\x20folder\x20path\x20\x27','site','type','\x20\x20\x20Path:\x20','Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.','segment:create','2732851clDNNe','\x27\x20with\x20ID:\x20','description','name','invisible','Parent\x20path:\x20','156MSujVh','461111vfHsOg','segments','resolveParentId','2826koNUvC','segment'];a28_0xcfa3=function(){return _0x26e2b5;};return a28_0xcfa3();}import{handleSDKOutput}from'../core/command-output.js';function a28_0x5a28(_0x22a258,_0x5d030c){_0x22a258=_0x22a258-0xc0;const _0xcfa3b9=a28_0xcfa3();let _0x5a2852=_0xcfa3b9[_0x22a258];return _0x5a2852;}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 a28_0x19e3fb from'chalk';export class SegmentCreateCommand extends BaseCommand{[a28_0x2dcbc0(0xf1)]=a28_0x2dcbc0(0xed);[a28_0x2dcbc0(0xf0)]=a28_0x2dcbc0(0xcc);async[a28_0x2dcbc0(0xe0)](_0x4d7dca){const _0x41302d=a28_0x2dcbc0;console[_0x41302d(0xc8)](a28_0x19e3fb[_0x41302d(0xcf)]('⚠\x20Deprecation\x20warning:\x20`segment\x20create`\x20is\x20deprecated.')),console[_0x41302d(0xc8)](a28_0x19e3fb['yellow']('\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a'));const {options:_0x27cbf8,args:_0x134fda,tdx:_0xdb681f}=_0x4d7dca,_0x5b460e=_0x27cbf8;if(_0x134fda[_0x41302d(0xc1)]===0x0)return console[_0x41302d(0xc8)](_0x41302d(0xe5)),console['error'](_0x41302d(0xd8)),console['error'](_0x41302d(0xd9)),console['error']('\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27'),console['error'](_0x41302d(0xdb)),console[_0x41302d(0xc8)](_0x41302d(0xd3)),0x1;const _0x2cc789=_0x134fda[0x0],_0x4ad6c8=_0x27cbf8['segmentPath'];let _0x3a9d6d=_0x2cc789;_0x4ad6c8&&!_0x2cc789[_0x41302d(0xe7)]('/')&&(_0x3a9d6d=_0x4ad6c8+'/'+_0x2cc789,_0x5b460e['verbose']&&console[_0x41302d(0xc8)](_0x41302d(0xd2)+_0x3a9d6d));const _0x5507a5=parsePath(_0x3a9d6d);if(_0x5507a5[_0x41302d(0xf6)][_0x41302d(0xc1)]<0x2)return console['error']('Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)'),console[_0x41302d(0xc8)](_0x41302d(0xe6)),0x1;const _0x1b96bb=_0x5507a5['segments'][0x0],_0x23a22c=getBaseName(_0x3a9d6d),_0x965499=getParentPath(_0x3a9d6d);_0x5b460e['verbose']&&(console[_0x41302d(0xc8)](_0x41302d(0xd1)+_0x5b460e[_0x41302d(0xe9)]),console[_0x41302d(0xc8)]('Target\x20path:\x20'+_0x3a9d6d),console['error'](_0x41302d(0xc5)+_0x1b96bb),console[_0x41302d(0xc8)](_0x41302d(0xe4)+_0x23a22c),console[_0x41302d(0xc8)](_0x41302d(0xf3)+_0x965499));const _0x576957=await withSpinner(_0x41302d(0xc6)+_0x1b96bb+'\x27...',()=>_0xdb681f[_0x41302d(0xf9)][_0x41302d(0xf7)](_0x1b96bb),{'verbose':_0x5b460e['verbose']}),_0x58842b=_0x576957['data'];let _0x205dd3;if(_0x5507a5[_0x41302d(0xf6)][_0x41302d(0xc1)]>0x2){const _0x5a33ec=await withSpinner(_0x41302d(0xe8)+_0x965499+_0x41302d(0xd6),()=>_0xdb681f['segment'][_0x41302d(0xdf)](_0x965499),{'verbose':_0x5b460e[_0x41302d(0xd0)]}),_0x5934e6=_0x5a33ec['data'];if(_0x5934e6[_0x41302d(0xea)]!==_0x41302d(0xd5)&&_0x5934e6[_0x41302d(0xea)]!==_0x41302d(0xc7))return console[_0x41302d(0xc8)](_0x41302d(0xec)),0x1;_0x205dd3=_0x5934e6[_0x41302d(0xce)];}else{if(_0x5b460e[_0x41302d(0xd5)]){const _0x130aa5=await withSpinner(_0x41302d(0xde)+_0x5b460e[_0x41302d(0xd5)]+_0x41302d(0xd6),()=>_0xdb681f[_0x41302d(0xf9)][_0x41302d(0xdd)](_0x58842b,_0x5b460e[_0x41302d(0xd5)]),{'verbose':_0x5b460e[_0x41302d(0xd0)]});_0x205dd3=_0x130aa5[_0x41302d(0xd4)];}}_0x5b460e['verbose']&&_0x205dd3&&console[_0x41302d(0xc8)](_0x41302d(0xc9)+_0x205dd3);const _0xd1dc4a=await loadJSONFromOptions(_0x5b460e[_0x41302d(0xc0)],_0x5b460e[_0x41302d(0xcd)]),_0x2adf0b={'name':_0x23a22c,'description':_0x5b460e[_0x41302d(0xf0)],'rule':_0xd1dc4a,'kind':_0x5b460e[_0x41302d(0xca)]!==undefined?parseInt(_0x5b460e[_0x41302d(0xca)],0xa):undefined,'isVisible':_0x5b460e[_0x41302d(0xf2)]?![]:undefined,'segmentFolderId':_0x205dd3,'countPopulation':_0x5b460e[_0x41302d(0xc4)]?![]:undefined},_0x2ba688=await withSpinner('Creating\x20segment\x20\x27'+_0x23a22c+_0x41302d(0xd6),()=>_0xdb681f[_0x41302d(0xf9)]['createSegment'](_0x58842b,_0x2adf0b),{'verbose':_0x5b460e[_0x41302d(0xd0)]}),_0x1a5d22=_0x2ba688['data'];return console[_0x41302d(0xc8)](_0x41302d(0xcb)+_0x1a5d22[_0x41302d(0xf1)]+_0x41302d(0xef)+_0x1a5d22['id']),_0x3a9d6d!==_0x2cc789&&console[_0x41302d(0xc8)](_0x41302d(0xeb)+_0x3a9d6d),await handleSDKOutput([_0x1a5d22],_0x5b460e),0x0;}}
@@ -1 +1 @@
1
- const a29_0x259f2a=a29_0x52e2;(function(_0x52fd90,_0x569f06){const _0xacb32a=a29_0x52e2,_0x532afe=_0x52fd90();while(!![]){try{const _0x1b5f89=parseInt(_0xacb32a(0x1ef))/0x1+parseInt(_0xacb32a(0x1f1))/0x2*(parseInt(_0xacb32a(0x1fc))/0x3)+-parseInt(_0xacb32a(0x1f3))/0x4*(-parseInt(_0xacb32a(0x1f0))/0x5)+parseInt(_0xacb32a(0x1f7))/0x6+-parseInt(_0xacb32a(0x1f5))/0x7*(-parseInt(_0xacb32a(0x1e9))/0x8)+-parseInt(_0xacb32a(0x1f2))/0x9+-parseInt(_0xacb32a(0x1e2))/0xa;if(_0x1b5f89===_0x569f06)break;else _0x532afe['push'](_0x532afe['shift']());}catch(_0x1a701e){_0x532afe['push'](_0x532afe['shift']());}}}(a29_0x191e,0x44637));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';function a29_0x52e2(_0x376337,_0x264cfb){_0x376337=_0x376337-0x1df;const _0x191e06=a29_0x191e();let _0x52e27b=_0x191e06[_0x376337];return _0x52e27b;}function a29_0x191e(){const _0x4e59f6=['\x27...','List\x20available\x20fields\x20for\x20segmentation','execute','length','520569VhvCxT','10miyCan','2jYLNBQ','3950208eTFrGF','1108164WxoStl','name','308oRnSit','\x20field','2959986FbUlFD','error','site','parentSegment','json','766635UlAIVx','description','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','segment','11668880tMGMSA','jsonl','listFields','Usage:\x20tdx\x20segment\x20fields\x20<parent_name>','Site:\x20','Parent\x20segment:\x20','verbose','11344uWcYqo','Listing\x20fields\x20for\x20\x27'];a29_0x191e=function(){return _0x4e59f6;};return a29_0x191e();}import{withSpinner}from'../utils/spinner.js';import{displayFieldsHumanReadable}from'../sdk/segment/fields-display.js';export class SegmentFieldsCommand extends BaseCommand{[a29_0x259f2a(0x1f4)]='segment:fields';[a29_0x259f2a(0x1df)]=a29_0x259f2a(0x1ec);async[a29_0x259f2a(0x1ed)](_0x1e8086){const _0xb34573=a29_0x259f2a,{options:_0x581c49,args:_0x1f23b9,tdx:_0x1b1708}=_0x1e8086,_0x20a2b2=_0x1f23b9[0x0]||_0x581c49[_0xb34573(0x1fa)];if(!_0x20a2b2)return console[_0xb34573(0x1f8)]('Error:\x20Parent\x20segment\x20name\x20is\x20required'),console[_0xb34573(0x1f8)](_0xb34573(0x1e5)),console[_0xb34573(0x1f8)](_0xb34573(0x1e0)),0x1;_0x581c49[_0xb34573(0x1e8)]&&(console[_0xb34573(0x1f8)](_0xb34573(0x1e6)+_0x581c49[_0xb34573(0x1f9)]),console[_0xb34573(0x1f8)](_0xb34573(0x1e7)+_0x20a2b2));const _0x24bc81=await withSpinner(_0xb34573(0x1ea)+_0x20a2b2+_0xb34573(0x1eb),()=>_0x1b1708[_0xb34573(0x1e1)][_0xb34573(0x1e4)](_0x20a2b2),{'verbose':_0x581c49['verbose']}),_0xf79b91=_0x24bc81['data'];console[_0xb34573(0x1f8)]('✔\x20Found\x20'+_0xf79b91[_0xb34573(0x1ee)]+_0xb34573(0x1f6)+(_0xf79b91['length']!==0x1?'s':''));if(_0x581c49[_0xb34573(0x1fb)]||_0x581c49[_0xb34573(0x1e3)])return await handleSDKOutput(_0xf79b91,_0x581c49),0x0;return displayFieldsHumanReadable(_0xf79b91,_0x20a2b2),0x0;}}
1
+ const a29_0x3ef3fc=a29_0x5c66;(function(_0x4c3143,_0x2c4f50){const _0x3a7b4b=a29_0x5c66,_0x5a5ccb=_0x4c3143();while(!![]){try{const _0xadef52=parseInt(_0x3a7b4b(0xa3))/0x1*(-parseInt(_0x3a7b4b(0xb8))/0x2)+-parseInt(_0x3a7b4b(0xb9))/0x3*(parseInt(_0x3a7b4b(0xb6))/0x4)+parseInt(_0x3a7b4b(0xb3))/0x5+-parseInt(_0x3a7b4b(0xac))/0x6*(-parseInt(_0x3a7b4b(0xa5))/0x7)+-parseInt(_0x3a7b4b(0xab))/0x8*(parseInt(_0x3a7b4b(0xa7))/0x9)+parseInt(_0x3a7b4b(0xa0))/0xa*(parseInt(_0x3a7b4b(0xaf))/0xb)+-parseInt(_0x3a7b4b(0x9f))/0xc;if(_0xadef52===_0x2c4f50)break;else _0x5a5ccb['push'](_0x5a5ccb['shift']());}catch(_0x46acb5){_0x5a5ccb['push'](_0x5a5ccb['shift']());}}}(a29_0x5ef0,0xa6c6e));function a29_0x5c66(_0x180f59,_0xa16652){_0x180f59=_0x180f59-0x9f;const _0x5ef0d7=a29_0x5ef0();let _0x5c664c=_0x5ef0d7[_0x180f59];return _0x5c664c;}import{BaseCommand}from'./command.js';function a29_0x5ef0(){const _0x26657b=['23640psehOA','30sIOOOl','error','length','2990889RevGae','listFields','Error:\x20Parent\x20segment\x20name\x20is\x20required','Parent\x20segment:\x20','6182810XjnLnw','execute','jsonl','23988RXPRsO','parentSegment','2dCMzGX','147BpeaEd','Site:\x20','json','site','verbose','\x27...','2083140GcibHD','50IShmnS','data','Usage:\x20tdx\x20segment\x20fields\x20<parent_name>','902981ujOCKY','✔\x20Found\x20','535367bdUKKD','segment','2817vZTkUX','name','segment:fields','List\x20available\x20fields\x20for\x20segmentation'];a29_0x5ef0=function(){return _0x26657b;};return a29_0x5ef0();}import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{displayFieldsHumanReadable}from'../sdk/segment/fields-display.js';export class SegmentFieldsCommand extends BaseCommand{[a29_0x3ef3fc(0xa8)]=a29_0x3ef3fc(0xa9);['description']=a29_0x3ef3fc(0xaa);async[a29_0x3ef3fc(0xb4)](_0x2a0cc1){const _0x172971=a29_0x3ef3fc,{options:_0x1df218,args:_0x4dc865,tdx:_0x72492b}=_0x2a0cc1,_0x3450e7=_0x4dc865[0x0]||_0x1df218[_0x172971(0xb7)];if(!_0x3450e7)return console['error'](_0x172971(0xb1)),console[_0x172971(0xad)](_0x172971(0xa2)),console['error']('\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>'),0x1;_0x1df218[_0x172971(0xbd)]&&(console[_0x172971(0xad)](_0x172971(0xba)+_0x1df218[_0x172971(0xbc)]),console[_0x172971(0xad)](_0x172971(0xb2)+_0x3450e7));const _0x5a365d=await withSpinner('Listing\x20fields\x20for\x20\x27'+_0x3450e7+_0x172971(0xbe),()=>_0x72492b[_0x172971(0xa6)][_0x172971(0xb0)](_0x3450e7),{'verbose':_0x1df218['verbose']}),_0x6ca9af=_0x5a365d[_0x172971(0xa1)];console[_0x172971(0xad)](_0x172971(0xa4)+_0x6ca9af[_0x172971(0xae)]+'\x20field'+(_0x6ca9af[_0x172971(0xae)]!==0x1?'s':''));if(_0x1df218[_0x172971(0xbb)]||_0x1df218[_0x172971(0xb5)])return await handleSDKOutput(_0x6ca9af,_0x1df218),0x0;return displayFieldsHumanReadable(_0x6ca9af,_0x3450e7),0x0;}}
@@ -1 +1 @@
1
- const a30_0xcbd5b8=a30_0x1d9c;function a30_0x289b(){const _0x3723b3=['repeat','cwd','pullSegments','\x20\x20Target:\x20','absolutePath','yellow','60405sSOPlN','error','Target\x20resource:\x20','2935668iOiIWd','dim','10051921lVIkje','parent_segment','length','counts','no_parent','execute','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file','Write\x20','journeys','2283579vMWebK','cyan','red','errorCode','1098mnUTXn','Aborted.','data','3NfZbcc','\x0aChanges\x20to\x20\x27','\x20\x20🎯\x20','No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27','description','\x20activations','green','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent','segment','utf-8','1049044cVofaj','journeyVersions','✔\x20Context\x20set:\x20','16Wnlpoo','\x20\x20🗺️\x20\x20','\x0aError:','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','parentName','segments','resourceName','\x20files?','verbose','Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files','filter','site','segment:pull','1906210nyQUKv','session','Site:\x20','Pulling\x20segments\x20from\x20\x27','10913GGpcwV','content','files','setPhase','yes','-\x20no\x20files\x20written','file','relativePath','\x20segments','\x20with\x20','\x0aPull\x20summary\x20for\x20\x27','targetDir','type','\x20=\x20','dirname','324tWlNsH','\x20changed\x20files','parentSegment','Usage:\x20tdx\x20sg\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20(requires\x20context\x20or\x20tdx.json)','helpText','isNew','12fuuTVU','diff','message'];a30_0x289b=function(){return _0x3723b3;};return a30_0x289b();}(function(_0x4f97f0,_0x3adb7c){const _0x3d89fe=a30_0x1d9c,_0x16ca38=_0x4f97f0();while(!![]){try{const _0x2ffe0a=-parseInt(_0x3d89fe(0xe7))/0x1+-parseInt(_0x3d89fe(0xcb))/0x2*(-parseInt(_0x3d89fe(0xdd))/0x3)+parseInt(_0x3d89fe(0xb9))/0x4*(-parseInt(_0x3d89fe(0xc8))/0x5)+parseInt(_0x3d89fe(0xda))/0x6*(-parseInt(_0x3d89fe(0xaa))/0x7)+-parseInt(_0x3d89fe(0xea))/0x8*(-parseInt(_0x3d89fe(0xd6))/0x9)+parseInt(_0x3d89fe(0xa6))/0xa+-parseInt(_0x3d89fe(0xcd))/0xb*(-parseInt(_0x3d89fe(0xbf))/0xc);if(_0x2ffe0a===_0x3adb7c)break;else _0x16ca38['push'](_0x16ca38['shift']());}catch(_0x33346a){_0x16ca38['push'](_0x16ca38['shift']());}}}(a30_0x289b,0xbb36a));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 a30_0x53a3ee from'chalk';function a30_0x1d9c(_0x12ac55,_0x4903a2){_0x12ac55=_0x12ac55-0xa0;const _0x289b64=a30_0x289b();let _0x1d9caa=_0x289b64[_0x12ac55];return _0x1d9caa;}import{existsSync,mkdirSync,writeFileSync}from'fs';import a30_0x12aeb9 from'path';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';export{buildFolderIdToPathMap as buildFolderPathMap}from'../sdk/segment/resolution-context.js';export class SegmentPullCommand extends BaseCommand{['name']=a30_0xcbd5b8(0xa5);[a30_0xcbd5b8(0xe1)]=a30_0xcbd5b8(0xa2);async[a30_0xcbd5b8(0xd2)](_0x1bc287){const _0x29a8ee=a30_0xcbd5b8,{options:_0x2b8c5f,args:_0xfa2a64,tdx:_0x482d86}=_0x1bc287,_0x53d919=_0x2b8c5f,_0x4a2bbf=await resolveTarget({'arg':_0xfa2a64[0x0],'contextParent':_0x2b8c5f[_0x29a8ee(0xbb)],'cwd':process[_0x29a8ee(0xc3)]()});if(!isSuccessfulResolution(_0x4a2bbf))return _0x4a2bbf[_0x29a8ee(0xd9)]===_0x29a8ee(0xd1)?(console['error'](a30_0x53a3ee[_0x29a8ee(0xc7)]('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console[_0x29a8ee(0xc9)](_0x29a8ee(0xbc)),console[_0x29a8ee(0xc9)](_0x29a8ee(0xe4)),console[_0x29a8ee(0xc9)](_0x29a8ee(0xd3))):(console[_0x29a8ee(0xc9)](a30_0x53a3ee[_0x29a8ee(0xd8)]('Error:\x20'+_0x4a2bbf[_0x29a8ee(0xc1)]+'\x0a')),_0x4a2bbf[_0x29a8ee(0xbd)]&&console[_0x29a8ee(0xc9)](a30_0x53a3ee[_0x29a8ee(0xd7)](_0x4a2bbf[_0x29a8ee(0xbd)]))),0x1;const _0x53bbd4=_0x4a2bbf[_0x29a8ee(0xee)],_0x4abee4=_0x4a2bbf[_0x29a8ee(0xb5)],_0x3e5d20=_0x4a2bbf[_0x29a8ee(0xb6)]===_0x29a8ee(0xb0)?_0x4a2bbf[_0x29a8ee(0xf0)]:undefined;_0x53d919[_0x29a8ee(0xa1)]&&(console[_0x29a8ee(0xc9)](_0x29a8ee(0xa8)+_0x53d919[_0x29a8ee(0xa4)]),console['error']('Parent\x20segment:\x20'+_0x53bbd4),_0x3e5d20&&console[_0x29a8ee(0xc9)](_0x29a8ee(0xca)+_0x3e5d20));const _0x5ca30e=await withProgressSpinner(_0x29a8ee(0xa9)+_0x53bbd4+'\x27...',_0x517fef=>_0x482d86[_0x29a8ee(0xe5)][_0x29a8ee(0xc4)](_0x53bbd4,{'targetDir':_0x4abee4,'targetResourceName':_0x3e5d20,'verbose':_0x53d919['verbose'],'progress':{'update':_0x3d2081=>{const _0x2ffd27=_0x29a8ee;_0x517fef[_0x2ffd27(0xad)](_0x3d2081),_0x53d919[_0x2ffd27(0xa1)]&&console[_0x2ffd27(0xc9)]('\x20\x20'+_0x3d2081);}}}),{'verbose':_0x53d919[_0x29a8ee(0xa1)]}),_0x13b049=_0x5ca30e[_0x29a8ee(0xdc)];if(_0x13b049[_0x29a8ee(0xd0)][_0x29a8ee(0xef)]===0x0&&_0x13b049[_0x29a8ee(0xd0)]['journeys']===0x0)return console[_0x29a8ee(0xc9)](a30_0x53a3ee['yellow'](_0x29a8ee(0xe0)+_0x13b049['parentName']+'\x27')),0x0;const _0x4673fe=_0x13b049[_0x29a8ee(0xac)]['filter'](_0x26f917=>_0x26f917['isNew']),_0x5a37f4=_0x13b049[_0x29a8ee(0xac)]['filter'](_0x26db8e=>!_0x26db8e['isNew']&&_0x26db8e['hasChanges']),_0x1294f5=_0x13b049[_0x29a8ee(0xac)][_0x29a8ee(0xa3)](_0x55eab9=>!_0x55eab9[_0x29a8ee(0xbe)]&&!_0x55eab9['hasChanges']);console[_0x29a8ee(0xc9)](_0x29a8ee(0xb4)+_0x13b049[_0x29a8ee(0xee)]+'\x27:'),console[_0x29a8ee(0xc9)](_0x29a8ee(0xdf)+a30_0x53a3ee[_0x29a8ee(0xd7)](_0x13b049['counts'][_0x29a8ee(0xef)]+_0x29a8ee(0xb2))+_0x29a8ee(0xb3)+a30_0x53a3ee[_0x29a8ee(0xd7)](_0x13b049[_0x29a8ee(0xd0)]['activations']+_0x29a8ee(0xe2)));if(_0x13b049[_0x29a8ee(0xd0)][_0x29a8ee(0xd5)]>0x0){const _0x8bf17e=_0x13b049[_0x29a8ee(0xd0)][_0x29a8ee(0xe8)]>_0x13b049[_0x29a8ee(0xd0)][_0x29a8ee(0xd5)]?'\x20('+_0x13b049[_0x29a8ee(0xd0)][_0x29a8ee(0xe8)]+'\x20versions)':'';console['error'](_0x29a8ee(0xeb)+a30_0x53a3ee[_0x29a8ee(0xd7)](_0x13b049[_0x29a8ee(0xd0)]['journeys']+'\x20journeys')+a30_0x53a3ee[_0x29a8ee(0xcc)](_0x8bf17e));}console[_0x29a8ee(0xc9)]('\x20\x20'+a30_0x53a3ee[_0x29a8ee(0xe3)]('+\x20'+_0x4673fe[_0x29a8ee(0xcf)]+'\x20new\x20files')),console[_0x29a8ee(0xc9)]('\x20\x20'+a30_0x53a3ee[_0x29a8ee(0xc7)]('~\x20'+_0x5a37f4[_0x29a8ee(0xcf)]+_0x29a8ee(0xba))),console['error']('\x20\x20'+a30_0x53a3ee['dim']('=\x20'+_0x1294f5['length']+'\x20unchanged\x20files')),console[_0x29a8ee(0xc9)](_0x29a8ee(0xc5)+a30_0x53a3ee['cyan'](_0x13b049[_0x29a8ee(0xb5)])+'\x0a');if(_0x5a37f4[_0x29a8ee(0xcf)]>0x0)for(const _0x599de1 of _0x5a37f4){console[_0x29a8ee(0xc9)](_0x29a8ee(0xde)+_0x599de1[_0x29a8ee(0xb1)]+'\x27:'),console[_0x29a8ee(0xc9)]('─'[_0x29a8ee(0xc2)](0x3c)),console['error'](_0x599de1[_0x29a8ee(0xc0)]),console['error']('─'['repeat'](0x3c));}if(_0x53d919['dryRun'])return console[_0x29a8ee(0xc9)](a30_0x53a3ee[_0x29a8ee(0xc7)](_0x29a8ee(0xed))),0x0;if(_0x4673fe[_0x29a8ee(0xcf)]===0x0&&_0x5a37f4['length']===0x0)return console['error'](a30_0x53a3ee[_0x29a8ee(0xe3)]('✔\x20All\x20files\x20are\x20up\x20to\x20date')),saveSessionContext({'parent_segment':_0x13b049[_0x29a8ee(0xee)]},_0x53d919[_0x29a8ee(0xa7)]),console[_0x29a8ee(0xc9)](a30_0x53a3ee[_0x29a8ee(0xe3)](_0x29a8ee(0xe9)+a30_0x53a3ee[_0x29a8ee(0xcc)](_0x29a8ee(0xce))+'\x20=\x20'+a30_0x53a3ee['cyan'](_0x13b049['parentName']))),0x0;if(!_0x53d919[_0x29a8ee(0xae)]){if(!isInteractive())return console[_0x29a8ee(0xc9)](a30_0x53a3ee[_0x29a8ee(0xd8)](_0x29a8ee(0xec)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x29a8ee(0xc9)](a30_0x53a3ee[_0x29a8ee(0xcc)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x59fa91=await confirmKey(_0x29a8ee(0xd4)+(_0x4673fe[_0x29a8ee(0xcf)]+_0x5a37f4[_0x29a8ee(0xcf)])+_0x29a8ee(0xa0));if(!_0x59fa91)return console[_0x29a8ee(0xc9)](a30_0x53a3ee[_0x29a8ee(0xc7)](_0x29a8ee(0xdb)),_0x29a8ee(0xaf)),0x1;}for(const _0x4df00a of _0x13b049[_0x29a8ee(0xac)]){if(_0x4df00a['isNew']||_0x4df00a['hasChanges']){const _0x2e69fe=a30_0x12aeb9[_0x29a8ee(0xb8)](_0x4df00a[_0x29a8ee(0xc6)]);!existsSync(_0x2e69fe)&&mkdirSync(_0x2e69fe,{'recursive':!![]}),writeFileSync(_0x4df00a['absolutePath'],_0x4df00a[_0x29a8ee(0xab)],_0x29a8ee(0xe6));}}return console[_0x29a8ee(0xc9)](a30_0x53a3ee[_0x29a8ee(0xe3)]('✔\x20Pulled\x20'+(_0x4673fe[_0x29a8ee(0xcf)]+_0x5a37f4[_0x29a8ee(0xcf)])+'\x20files\x20to\x20'+_0x13b049[_0x29a8ee(0xb5)])),saveSessionContext({'parent_segment':_0x13b049[_0x29a8ee(0xee)]},_0x53d919[_0x29a8ee(0xa7)]),console[_0x29a8ee(0xc9)](a30_0x53a3ee[_0x29a8ee(0xe3)](_0x29a8ee(0xe9)+a30_0x53a3ee['dim']('parent_segment')+_0x29a8ee(0xb7)+a30_0x53a3ee[_0x29a8ee(0xd7)](_0x13b049[_0x29a8ee(0xee)]))),0x0;}}
1
+ const a30_0x4971d8=a30_0xde02;(function(_0x495646,_0x420e69){const _0x122712=a30_0xde02,_0x3ae939=_0x495646();while(!![]){try{const _0x5ce8f1=parseInt(_0x122712(0xdc))/0x1+parseInt(_0x122712(0x100))/0x2*(parseInt(_0x122712(0xf6))/0x3)+-parseInt(_0x122712(0xea))/0x4+-parseInt(_0x122712(0xfa))/0x5*(parseInt(_0x122712(0x108))/0x6)+parseInt(_0x122712(0x11e))/0x7+-parseInt(_0x122712(0x11a))/0x8*(parseInt(_0x122712(0xeb))/0x9)+parseInt(_0x122712(0x104))/0xa;if(_0x5ce8f1===_0x420e69)break;else _0x3ae939['push'](_0x3ae939['shift']());}catch(_0x218c51){_0x3ae939['push'](_0x3ae939['shift']());}}}(a30_0x43bc,0xb944b));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 a30_0x40bda9 from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';import a30_0x2d8dc6 from'path';function a30_0xde02(_0x3f92f9,_0x4c0f8a){_0x3f92f9=_0x3f92f9-0xc7;const _0x43bc5c=a30_0x43bc();let _0xde02b8=_0x43bc5c[_0x3f92f9];return _0xde02b8;}function a30_0x43bc(){const _0x503d87=['yes','red','cyan','\x20files?','counts','segment','\x20segments','journeyVersions','green','isNew','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)','activations','content','type','1137592hFbMfx','Pulling\x20segments\x20from\x20\x27','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent','setPhase','7795207KpKMAj','data','Site:\x20','\x0aError:','filter','Write\x20','error','verbose','dirname','Target\x20resource:\x20','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','resourceName','relativePath','\x20new\x20files','✔\x20Context\x20set:\x20','\x27...','targetDir','site','segments','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','dim','hasChanges','360778GMOIsl','no_parent','\x20unchanged\x20files','parentSegment','file','parent_segment','Parent\x20segment:\x20','description','repeat','segment:pull','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files','\x20with\x20','\x0aPull\x20summary\x20for\x20\x27','4624680cYpNmv','45cQfzhy','errorCode','length','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file','\x20files\x20to\x20','\x20=\x20','journeys','No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27','cwd','utf-8','✔\x20Pulled\x20','15OYrSek','pullSegments','files','session','50qotgOY','Error:\x20','\x20\x20Target:\x20','helpText','yellow','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','39458Fdycmf','\x20versions)','dryRun','execute','21832800KqeymT','\x20activations','Aborted.','-\x20no\x20files\x20written','678168xbuMcT','message','\x0aChanges\x20to\x20\x27','parentName'];a30_0x43bc=function(){return _0x503d87;};return a30_0x43bc();}import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';export{buildFolderIdToPathMap as buildFolderPathMap}from'../sdk/segment/resolution-context.js';export class SegmentPullCommand extends BaseCommand{['name']=a30_0x4971d8(0xe5);[a30_0x4971d8(0xe3)]=a30_0x4971d8(0xe7);async[a30_0x4971d8(0x103)](_0x3323fa){const _0x13ac8e=a30_0x4971d8,{options:_0x2be8ec,args:_0x3cbebe,tdx:_0x1ef00d}=_0x3323fa,_0x372649=_0x2be8ec,_0x30186b=await resolveTarget({'arg':_0x3cbebe[0x0],'contextParent':_0x2be8ec[_0x13ac8e(0xdf)],'cwd':process[_0x13ac8e(0xf3)]()});if(!isSuccessfulResolution(_0x30186b))return _0x30186b[_0x13ac8e(0xec)]===_0x13ac8e(0xdd)?(console[_0x13ac8e(0xcc)](a30_0x40bda9[_0x13ac8e(0xfe)](_0x13ac8e(0xd0))),console[_0x13ac8e(0xcc)](_0x13ac8e(0x116)),console[_0x13ac8e(0xcc)](_0x13ac8e(0x11c)),console[_0x13ac8e(0xcc)](_0x13ac8e(0xee))):(console[_0x13ac8e(0xcc)](a30_0x40bda9[_0x13ac8e(0x10d)](_0x13ac8e(0xfb)+_0x30186b[_0x13ac8e(0x109)]+'\x0a')),_0x30186b[_0x13ac8e(0xfd)]&&console[_0x13ac8e(0xcc)](a30_0x40bda9['cyan'](_0x30186b[_0x13ac8e(0xfd)]))),0x1;const _0x2b4f5b=_0x30186b[_0x13ac8e(0x10b)],_0x709dff=_0x30186b[_0x13ac8e(0xd6)],_0x3feab4=_0x30186b[_0x13ac8e(0x119)]===_0x13ac8e(0xe0)?_0x30186b[_0x13ac8e(0xd1)]:undefined;_0x372649['verbose']&&(console[_0x13ac8e(0xcc)](_0x13ac8e(0xc8)+_0x372649[_0x13ac8e(0xd7)]),console[_0x13ac8e(0xcc)](_0x13ac8e(0xe2)+_0x2b4f5b),_0x3feab4&&console['error'](_0x13ac8e(0xcf)+_0x3feab4));const _0x47d5bb=await withProgressSpinner(_0x13ac8e(0x11b)+_0x2b4f5b+_0x13ac8e(0xd5),_0x1f54bf=>_0x1ef00d[_0x13ac8e(0x111)][_0x13ac8e(0xf7)](_0x2b4f5b,{'targetDir':_0x709dff,'targetResourceName':_0x3feab4,'verbose':_0x372649[_0x13ac8e(0xcd)],'progress':{'update':_0x38c4fd=>{const _0x273076=_0x13ac8e;_0x1f54bf[_0x273076(0x11d)](_0x38c4fd),_0x372649[_0x273076(0xcd)]&&console[_0x273076(0xcc)]('\x20\x20'+_0x38c4fd);}}}),{'verbose':_0x372649['verbose']}),_0x2de16f=_0x47d5bb[_0x13ac8e(0xc7)];if(_0x2de16f[_0x13ac8e(0x110)][_0x13ac8e(0xd8)]===0x0&&_0x2de16f[_0x13ac8e(0x110)][_0x13ac8e(0xf1)]===0x0)return console[_0x13ac8e(0xcc)](a30_0x40bda9[_0x13ac8e(0xfe)](_0x13ac8e(0xf2)+_0x2de16f[_0x13ac8e(0x10b)]+'\x27')),0x0;const _0x5e82b9=_0x2de16f[_0x13ac8e(0xf8)][_0x13ac8e(0xca)](_0x3fc024=>_0x3fc024[_0x13ac8e(0x115)]),_0x583a4f=_0x2de16f[_0x13ac8e(0xf8)][_0x13ac8e(0xca)](_0x322cbb=>!_0x322cbb[_0x13ac8e(0x115)]&&_0x322cbb[_0x13ac8e(0xdb)]),_0x4d454d=_0x2de16f[_0x13ac8e(0xf8)]['filter'](_0x1db254=>!_0x1db254[_0x13ac8e(0x115)]&&!_0x1db254[_0x13ac8e(0xdb)]);console['error'](_0x13ac8e(0xe9)+_0x2de16f[_0x13ac8e(0x10b)]+'\x27:'),console[_0x13ac8e(0xcc)]('\x20\x20🎯\x20'+a30_0x40bda9[_0x13ac8e(0x10e)](_0x2de16f[_0x13ac8e(0x110)]['segments']+_0x13ac8e(0x112))+_0x13ac8e(0xe8)+a30_0x40bda9[_0x13ac8e(0x10e)](_0x2de16f[_0x13ac8e(0x110)][_0x13ac8e(0x117)]+_0x13ac8e(0x105)));if(_0x2de16f['counts']['journeys']>0x0){const _0x20cf7a=_0x2de16f[_0x13ac8e(0x110)][_0x13ac8e(0x113)]>_0x2de16f['counts'][_0x13ac8e(0xf1)]?'\x20('+_0x2de16f[_0x13ac8e(0x110)][_0x13ac8e(0x113)]+_0x13ac8e(0x101):'';console[_0x13ac8e(0xcc)]('\x20\x20🗺️\x20\x20'+a30_0x40bda9[_0x13ac8e(0x10e)](_0x2de16f[_0x13ac8e(0x110)]['journeys']+'\x20journeys')+a30_0x40bda9[_0x13ac8e(0xda)](_0x20cf7a));}console['error']('\x20\x20'+a30_0x40bda9[_0x13ac8e(0x114)]('+\x20'+_0x5e82b9['length']+_0x13ac8e(0xd3))),console[_0x13ac8e(0xcc)]('\x20\x20'+a30_0x40bda9[_0x13ac8e(0xfe)]('~\x20'+_0x583a4f[_0x13ac8e(0xed)]+'\x20changed\x20files')),console[_0x13ac8e(0xcc)]('\x20\x20'+a30_0x40bda9[_0x13ac8e(0xda)]('=\x20'+_0x4d454d[_0x13ac8e(0xed)]+_0x13ac8e(0xde))),console[_0x13ac8e(0xcc)](_0x13ac8e(0xfc)+a30_0x40bda9[_0x13ac8e(0x10e)](_0x2de16f[_0x13ac8e(0xd6)])+'\x0a');if(_0x583a4f[_0x13ac8e(0xed)]>0x0)for(const _0x5f1db9 of _0x583a4f){console[_0x13ac8e(0xcc)](_0x13ac8e(0x10a)+_0x5f1db9[_0x13ac8e(0xd2)]+'\x27:'),console['error']('─'[_0x13ac8e(0xe4)](0x3c)),console[_0x13ac8e(0xcc)](_0x5f1db9['diff']),console[_0x13ac8e(0xcc)]('─'[_0x13ac8e(0xe4)](0x3c));}if(_0x372649[_0x13ac8e(0x102)])return console[_0x13ac8e(0xcc)](a30_0x40bda9[_0x13ac8e(0xfe)](_0x13ac8e(0xd9))),0x0;if(_0x5e82b9['length']===0x0&&_0x583a4f[_0x13ac8e(0xed)]===0x0)return console[_0x13ac8e(0xcc)](a30_0x40bda9[_0x13ac8e(0x114)]('✔\x20All\x20files\x20are\x20up\x20to\x20date')),saveSessionContext({'parent_segment':_0x2de16f[_0x13ac8e(0x10b)]},_0x372649[_0x13ac8e(0xf9)]),console[_0x13ac8e(0xcc)](a30_0x40bda9[_0x13ac8e(0x114)]('✔\x20Context\x20set:\x20'+a30_0x40bda9['dim'](_0x13ac8e(0xe1))+_0x13ac8e(0xf0)+a30_0x40bda9[_0x13ac8e(0x10e)](_0x2de16f['parentName']))),0x0;if(!_0x372649[_0x13ac8e(0x10c)]){if(!isInteractive())return console[_0x13ac8e(0xcc)](a30_0x40bda9['red'](_0x13ac8e(0xc9)),_0x13ac8e(0xe6)),console[_0x13ac8e(0xcc)](a30_0x40bda9[_0x13ac8e(0xda)](_0x13ac8e(0xff))),0x1;const _0x5c3794=await confirmKey(_0x13ac8e(0xcb)+(_0x5e82b9[_0x13ac8e(0xed)]+_0x583a4f[_0x13ac8e(0xed)])+_0x13ac8e(0x10f));if(!_0x5c3794)return console[_0x13ac8e(0xcc)](a30_0x40bda9[_0x13ac8e(0xfe)](_0x13ac8e(0x106)),_0x13ac8e(0x107)),0x1;}for(const _0x1b16a9 of _0x2de16f['files']){if(_0x1b16a9[_0x13ac8e(0x115)]||_0x1b16a9['hasChanges']){const _0x241c86=a30_0x2d8dc6[_0x13ac8e(0xce)](_0x1b16a9['absolutePath']);!existsSync(_0x241c86)&&mkdirSync(_0x241c86,{'recursive':!![]}),writeFileSync(_0x1b16a9['absolutePath'],_0x1b16a9[_0x13ac8e(0x118)],_0x13ac8e(0xf4));}}return console[_0x13ac8e(0xcc)](a30_0x40bda9['green'](_0x13ac8e(0xf5)+(_0x5e82b9[_0x13ac8e(0xed)]+_0x583a4f[_0x13ac8e(0xed)])+_0x13ac8e(0xef)+_0x2de16f['targetDir'])),saveSessionContext({'parent_segment':_0x2de16f[_0x13ac8e(0x10b)]},_0x372649[_0x13ac8e(0xf9)]),console[_0x13ac8e(0xcc)](a30_0x40bda9[_0x13ac8e(0x114)](_0x13ac8e(0xd4)+a30_0x40bda9[_0x13ac8e(0xda)](_0x13ac8e(0xe1))+_0x13ac8e(0xf0)+a30_0x40bda9[_0x13ac8e(0x10e)](_0x2de16f[_0x13ac8e(0x10b)]))),0x0;}}
@@ -1 +1 @@
1
- const a31_0x13f425=a31_0x2ac1;(function(_0x3e9028,_0x5ea448){const _0x3cb4cb=a31_0x2ac1,_0x2eb12e=_0x3e9028();while(!![]){try{const _0x2c2707=-parseInt(_0x3cb4cb(0x144))/0x1*(parseInt(_0x3cb4cb(0x11a))/0x2)+parseInt(_0x3cb4cb(0x12a))/0x3*(-parseInt(_0x3cb4cb(0x172))/0x4)+-parseInt(_0x3cb4cb(0x116))/0x5+-parseInt(_0x3cb4cb(0x148))/0x6*(parseInt(_0x3cb4cb(0x168))/0x7)+parseInt(_0x3cb4cb(0x11f))/0x8+-parseInt(_0x3cb4cb(0x190))/0x9*(-parseInt(_0x3cb4cb(0x184))/0xa)+parseInt(_0x3cb4cb(0x174))/0xb*(parseInt(_0x3cb4cb(0x1a2))/0xc);if(_0x2c2707===_0x5ea448)break;else _0x2eb12e['push'](_0x2eb12e['shift']());}catch(_0x286363){_0x2eb12e['push'](_0x2eb12e['shift']());}}}(a31_0x120e,0xd5aa0));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';function a31_0x120e(){const _0x1916cc=['parent_name','scopedFolderPath','New\x20segment:','No\x20','\x20\x20Activations:','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','add','connection','then','listSegments','toString','getOutputSchemaWithCache','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','parentName','1163971kCgtBy','\x20\x20\x20\x20','filter','nameToId','582Xomghy','repeat','/app/ps/','folderId','Changes\x20to\x20journey:','\x20to\x20delete','toDelete','green','site','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','yes','Fetching\x20parent\x20segment\x20details...','\x0aPush\x20summary\x20for\x20\x27','name','results','\x20changes?','New\x20journey:','journeyBundleName','relationships','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','dim','/j/da/je','folderPath','updatedAt','parentFolder','\x20\x20Source:\x20','filePath','Parent\x20segment:\x20','\x20activations]','✔\x20All\x20journeys\x20are\x20up\x20to\x20date','new','📁\x20','31353oUmmcg','parentSegment','idToName','Error:\x20Directory\x20not\x20found:\x20','unchanged','all','existingJourney','red','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','activations','2204llusZR','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)','11FeDWIE','join','Fetching\x20existing\x20journeys...','getParent','endsWith','data','\x20to\x20update','type','\x27...','\x20updated','error','toUpdate','✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','journeyId','Source\x20directory:\x20','journeyBundleId','443830nLmUZo','map','\x20YAML\x20files\x20found','cyan','execute','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','\x20changed','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','journey','verbose','toCreate','yellow','99YUjcEC','created','user','buildUserMaps','audienceId','delete','file','folders','getJourney','\x20\x20Activations:\x20','createdSegmentIds','Fetching\x20existing\x20segments...','resolveParentId','blue','\x0a✔\x20Push\x20complete','state','versionNumber','Scoped\x20to\x20folder:\x20','27722220sbxQwN','segment','diff','setPhase','\x0aValidation\x20failed:','\x20to\x20create','segments','isScoped','description','\x20unchanged','length','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file','segment\x20or\x20journey','no_parent','segment:push','attributes','\x20created','changed','journeys','targetDir','createdAt','segmentFolderId','listActivations','Resolving\x20parent\x20segment\x20\x27','3958725fxCCvt','deleted','message','listJourneysWithDetailsFromParentSegment','2MBvxnI','set','Site:\x20','Error\x20parsing\x20YAML:\x20','\x20deleted','10951488JLlCVW','/e/','get','isNew','\x20\x20Segments:\x20','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','helpText','errorCode','journeysOnly','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','4911USyRcH','\x20new','Fetching\x20connections\x20for\x20name\x20resolution...','push','yamlConfig','Fetching\x20existing\x20folders...','Preparing\x20journeys...','Error:\x20','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','updated','cwd','Delete\x20segment:'];a31_0x120e=function(){return _0x1916cc;};return a31_0x120e();}import{batchAsync}from'../utils/async.js';import{segmentToYamlString,segmentWithActivationsToYaml}from'../sdk/segment/child-segment-yaml.js';import a31_0x1739a4 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 a31_0x2ac1(_0x51c34a,_0x2833fb){_0x51c34a=_0x51c34a-0x10e;const _0x120e9d=a31_0x120e();let _0x2ac14e=_0x120e9d[_0x51c34a];return _0x2ac14e;}import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{resolveTDFolderPath,findSegmentsToDelete,findJourneysToDelete,buildSegmentLookupMap,buildSegmentNameToIdMap,buildJourneyBundleLookupMap,parseAndClassifyYamlFiles,validateParsedFiles,formatValidationErrors,extractRootFolderId,buildConnectionMaps,calculatePushStats,prepareSegmentFiles,prepareJourneyFiles,executePushSegments,executePushFolders,executePushSegmentDeletions,executePushJourneys}from'../sdk/segment/push-workflow.js';export class SegmentPushCommand extends BaseCommand{[a31_0x13f425(0x155)]=a31_0x13f425(0x1b0);[a31_0x13f425(0x1aa)]=a31_0x13f425(0x128);async[a31_0x13f425(0x188)](_0x86fda2){const _0x4e5ada=a31_0x13f425,{options:_0x52e41a,args:_0x3f7ce3,tdx:_0x3eed21}=_0x86fda2,_0x2ee0ba=_0x52e41a,_0x21a16d=await resolveTarget({'arg':_0x3f7ce3[0x0],'contextParent':_0x52e41a[_0x4e5ada(0x169)],'cwd':process[_0x4e5ada(0x134)]()});if(!isSuccessfulResolution(_0x21a16d))return _0x21a16d[_0x4e5ada(0x126)]===_0x4e5ada(0x1af)?(console[_0x4e5ada(0x17e)](a31_0x1739a4[_0x4e5ada(0x18f)](_0x4e5ada(0x13b))),console['error'](_0x4e5ada(0x173)),console[_0x4e5ada(0x17e)](_0x4e5ada(0x189)),console['error'](_0x4e5ada(0x1ad))):(console[_0x4e5ada(0x17e)](a31_0x1739a4[_0x4e5ada(0x16f)](_0x4e5ada(0x131)+_0x21a16d[_0x4e5ada(0x118)]+'\x0a')),_0x21a16d[_0x4e5ada(0x125)]&&console[_0x4e5ada(0x17e)](a31_0x1739a4['cyan'](_0x21a16d[_0x4e5ada(0x125)]))),0x1;if(_0x21a16d[_0x4e5ada(0x17b)]===_0x4e5ada(0x136))return console[_0x4e5ada(0x17e)](a31_0x1739a4[_0x4e5ada(0x16f)](_0x4e5ada(0x16b)+_0x21a16d[_0x4e5ada(0x111)]+'\x0a')),console[_0x4e5ada(0x17e)](a31_0x1739a4['cyan'](_0x4e5ada(0x18b))),0x1;const _0x485e2a=_0x21a16d[_0x4e5ada(0x143)],_0x1a36bc=_0x21a16d['targetDir'],_0x456481=_0x21a16d[_0x4e5ada(0x17b)]===_0x4e5ada(0x196)?_0x21a16d[_0x4e5ada(0x162)]:undefined,_0x4f9111=getScopedDetails(_0x21a16d),_0x44e9ba=_0x4f9111?.[_0x4e5ada(0x1a9)]??![],_0xe2116a=_0x4f9111?.[_0x4e5ada(0x137)]??'';if(!existsSync(_0x1a36bc))return console[_0x4e5ada(0x17e)](a31_0x1739a4[_0x4e5ada(0x16f)](_0x4e5ada(0x16b)+_0x1a36bc+'\x0a')),console[_0x4e5ada(0x17e)](a31_0x1739a4[_0x4e5ada(0x187)](_0x4e5ada(0x18b))),0x1;_0x2ee0ba[_0x4e5ada(0x18d)]&&(console[_0x4e5ada(0x17e)](_0x4e5ada(0x11c)+_0x2ee0ba['site']),console[_0x4e5ada(0x17e)](_0x4e5ada(0x163)+_0x485e2a),console[_0x4e5ada(0x17e)](_0x4e5ada(0x182)+_0x1a36bc),_0x44e9ba&&console[_0x4e5ada(0x17e)](_0x4e5ada(0x1a1)+_0xe2116a));const _0x2946b9=await withSpinner(_0x4e5ada(0x115)+_0x485e2a+_0x4e5ada(0x17c),()=>_0x3eed21[_0x4e5ada(0x1a3)][_0x4e5ada(0x19c)](_0x485e2a),{'verbose':_0x2ee0ba['verbose']}),_0x28ff2b=_0x2946b9[_0x4e5ada(0x179)],[_0x5462b3,_0x16990b,_0x43fe1a,_0x3d40a3,_0x57f573]=await Promise[_0x4e5ada(0x16d)]([withSpinner(_0x4e5ada(0x153),()=>_0x3eed21[_0x4e5ada(0x1a3)][_0x4e5ada(0x177)](_0x28ff2b),{'verbose':_0x2ee0ba[_0x4e5ada(0x18d)]}),withSpinner(_0x4e5ada(0x19b),()=>_0x3eed21[_0x4e5ada(0x1a3)][_0x4e5ada(0x13f)](_0x28ff2b),{'verbose':_0x2ee0ba[_0x4e5ada(0x18d)]}),withSpinner(_0x4e5ada(0x12f),()=>_0x3eed21[_0x4e5ada(0x1a3)]['listFolders'](_0x28ff2b),{'verbose':_0x2ee0ba[_0x4e5ada(0x18d)]}),withSpinner(_0x4e5ada(0x176),()=>_0x3eed21[_0x4e5ada(0x18c)][_0x4e5ada(0x119)](_0x28ff2b,{'includeAllVersions':!![]}),{'verbose':_0x2ee0ba['verbose']}),withSpinner('Fetching\x20users\x20for\x20email\x20resolution...',()=>_0x3eed21['user'][_0x4e5ada(0x193)](),{'verbose':_0x2ee0ba[_0x4e5ada(0x18d)]})[_0x4e5ada(0x13e)](_0x39ce9d=>_0x39ce9d[_0x4e5ada(0x179)])]),_0x53d5d0=_0x5462b3[_0x4e5ada(0x179)],_0x2804f3=extractRootFolderId(_0x53d5d0),_0x502b5f=_0x16990b['data'],_0x150520=_0x43fe1a[_0x4e5ada(0x179)],{journeys:_0x362f9f,activationStepsById:_0x6c7807}=_0x3d40a3['data'],_0x217ca4=new Map(_0x362f9f['map'](_0x155214=>[_0x155214['id'],_0x155214])),_0x1c42c4=_0x362f9f['map'](_0x4c71e6=>({'id':_0x4c71e6['id'],'name':_0x4c71e6[_0x4e5ada(0x1b1)][_0x4e5ada(0x155)],'journeyBundleName':_0x4c71e6['attributes'][_0x4e5ada(0x159)]||'','journeyBundleId':_0x4c71e6[_0x4e5ada(0x1b1)][_0x4e5ada(0x183)]||'','versionNumber':_0x4c71e6[_0x4e5ada(0x1b1)][_0x4e5ada(0x1a0)],'description':_0x4c71e6[_0x4e5ada(0x1b1)]['description'],'state':_0x4c71e6['attributes'][_0x4e5ada(0x19f)],'paused':_0x4c71e6[_0x4e5ada(0x1b1)]['paused'],'audienceId':_0x4c71e6[_0x4e5ada(0x1b1)][_0x4e5ada(0x194)],'folderId':_0x4c71e6[_0x4e5ada(0x15a)]?.[_0x4e5ada(0x160)]?.['data']?.['id'],'createdAt':_0x4c71e6[_0x4e5ada(0x1b1)][_0x4e5ada(0x112)],'updatedAt':_0x4c71e6[_0x4e5ada(0x1b1)][_0x4e5ada(0x15f)]})),{emailToId:_0x469223,idToEmail:_0x2d6041}=_0x57f573,_0x23039d=await withSpinner(_0x4e5ada(0x12c),async()=>{const _0x203c81=_0x4e5ada,_0x3bdd9c=await _0x3eed21[_0x203c81(0x13d)]['list']();return buildConnectionMaps(_0x3bdd9c);},{'verbose':_0x2ee0ba[_0x4e5ada(0x18d)]})[_0x4e5ada(0x13e)](_0x1cf5a1=>_0x1cf5a1['data']),_0x3ce2e0=_0x23039d[_0x4e5ada(0x147)],_0x820e12=_0x23039d[_0x4e5ada(0x16a)],_0x20aa72=_0x23039d['nameToType'],_0x315747={'emailToIdMap':_0x469223,'connectionNameToIdMap':_0x3ce2e0,'connectionNameToTypeMap':_0x20aa72,'getSchema':_0x762a62=>_0x3eed21[_0x4e5ada(0x13d)][_0x4e5ada(0x141)](_0x762a62)};let {pathToId:_0x359a17,idToPath:_0x281a5e}=buildFolderMaps(_0x150520);const _0x3de81d=buildSegmentLookupMap(_0x502b5f,_0x281a5e),_0x27e00b=buildSegmentNameToIdMap(_0x502b5f),_0x596d01=buildJourneyBundleLookupMap(_0x1c42c4,_0x281a5e);let _0x407e00;if(_0x456481){if(!_0x456481[_0x4e5ada(0x178)]('.yml')&&!_0x456481[_0x4e5ada(0x178)]('.yaml'))return console[_0x4e5ada(0x17e)](a31_0x1739a4[_0x4e5ada(0x16f)]('Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20'+_0x456481+'\x0a')),0x1;_0x407e00=[_0x456481];}else _0x407e00=findYamlFiles(_0x1a36bc);if(_0x407e00[_0x4e5ada(0x1ac)]===0x0)return console['error'](a31_0x1739a4[_0x4e5ada(0x16f)](_0x4e5ada(0x15b)+_0x1a36bc+'\x0a')),console[_0x4e5ada(0x17e)](a31_0x1739a4[_0x4e5ada(0x187)](_0x4e5ada(0x142))),0x1;let _0x576a53,_0x18df1c;try{const _0x53929d=parseAndClassifyYamlFiles(_0x407e00,_0x1a36bc,{'skipSegments':_0x2ee0ba[_0x4e5ada(0x127)]});_0x576a53=_0x53929d[_0x4e5ada(0x1a8)],_0x18df1c=_0x53929d[_0x4e5ada(0x110)];const _0x3603a1=validateParsedFiles(_0x53929d,_0x1a36bc);if(_0x3603a1['length']>0x0)return console[_0x4e5ada(0x17e)](a31_0x1739a4[_0x4e5ada(0x16f)](_0x4e5ada(0x1a6))),console[_0x4e5ada(0x17e)](formatValidationErrors(_0x3603a1)),console[_0x4e5ada(0x17e)](a31_0x1739a4[_0x4e5ada(0x18f)](_0x4e5ada(0x151))),0x1;}catch(_0x3deb5d){return console[_0x4e5ada(0x17e)](a31_0x1739a4[_0x4e5ada(0x16f)](_0x4e5ada(0x11d)+(_0x3deb5d instanceof Error?_0x3deb5d['message']:_0x3deb5d))),0x1;}if(_0x576a53[_0x4e5ada(0x1ac)]===0x0&&_0x18df1c[_0x4e5ada(0x1ac)]===0x0){const _0x4838a4=_0x2ee0ba[_0x4e5ada(0x127)]?_0x4e5ada(0x18c):_0x4e5ada(0x1ae);return console[_0x4e5ada(0x17e)](a31_0x1739a4['yellow'](_0x4e5ada(0x139)+_0x4838a4+_0x4e5ada(0x186))),0x0;}const _0x18ea07=new Map();_0x502b5f[_0x4e5ada(0x1ac)]>0x0&&!_0x2ee0ba[_0x4e5ada(0x127)]&&await withSpinner('Fetching\x20existing\x20activations...',async()=>{await batchAsync(_0x502b5f,async _0x592b24=>{const _0x2cd505=a31_0x2ac1,_0x1a9f13=await _0x3eed21[_0x2cd505(0x1a3)][_0x2cd505(0x114)](_0x28ff2b,_0x592b24['id']);_0x18ea07[_0x2cd505(0x11b)](_0x592b24['id'],_0x1a9f13);});},{'verbose':_0x2ee0ba['verbose']});const {segmentFiles:_0x4c5c59,foldersToCreate:_0x3ff509}=await prepareSegmentFiles(_0x576a53,{'segmentByFolderAndName':_0x3de81d,'activationsBySegmentId':_0x18ea07,'folderPathToId':_0x359a17,'idToEmailMap':_0x2d6041,'connectionIdToNameMap':_0x820e12},_0x315747,_0x44e9ba,_0xe2116a),_0x1c0d44=_0x456481?[]:findSegmentsToDelete(_0x502b5f,_0x576a53[_0x4e5ada(0x185)](({yamlConfig:_0x281391,folderPath:_0x559d04})=>({'yamlConfig':_0x281391,'folderPath':resolveTDFolderPath(_0x559d04,_0x44e9ba,_0xe2116a)})),_0x281a5e,_0xe2116a,_0x44e9ba),{journeyFiles:_0x2696fe,foldersToCreate:_0x42d122}=await withProgressSpinner(_0x4e5ada(0x130),async _0xda73ab=>prepareJourneyFiles(_0x18df1c,{'fetchJourney':async _0xae5d1=>_0x3eed21[_0x4e5ada(0x18c)][_0x4e5ada(0x198)](_0xae5d1[_0x4e5ada(0x181)]),'journeyBundlesByFolderAndName':_0x596d01,'folderPathToId':_0x359a17,'idToEmailMap':_0x2d6041,'connectionIdToNameMap':_0x820e12,'existingSegments':_0x502b5f,'parentId':_0x28ff2b,'deps':_0x3eed21,'progress':{'update':_0x4fbe22=>{const _0x4023ba=_0x4e5ada;_0xda73ab[_0x4023ba(0x1a5)](_0x4fbe22),_0x2ee0ba[_0x4023ba(0x18d)]&&console['error']('\x20\x20'+_0x4fbe22);}},'journeyById':_0x217ca4,'activationStepsById':_0x6c7807},_0x44e9ba,_0xe2116a),{'verbose':_0x2ee0ba[_0x4e5ada(0x18d)]})[_0x4e5ada(0x13e)](_0x5a1fa0=>_0x5a1fa0[_0x4e5ada(0x179)]);for(const _0x4f5f81 of _0x42d122){_0x3ff509[_0x4e5ada(0x13c)](_0x4f5f81);}const _0x454714=_0x456481?[]:findJourneysToDelete(_0x1c42c4,_0x18df1c[_0x4e5ada(0x185)](({yamlConfig:_0x11d0ce,folderPath:_0x2a9aa3})=>({'yamlConfig':_0x11d0ce,'folderPath':resolveTDFolderPath(_0x2a9aa3,_0x44e9ba,_0xe2116a)})),_0x281a5e,_0xe2116a,_0x44e9ba),_0x1eeb93=calculatePushStats(_0x4c5c59,_0x2696fe,_0x3ff509,_0x1c0d44,_0x454714,!!_0x2ee0ba[_0x4e5ada(0x195)],!!_0x2ee0ba[_0x4e5ada(0x127)]),_0x1326bd=_0x1eeb93['segments'][_0x4e5ada(0x166)],_0x27b92e=_0x1eeb93[_0x4e5ada(0x1a8)][_0x4e5ada(0x10f)],_0x1327f3=_0x1eeb93[_0x4e5ada(0x1a8)][_0x4e5ada(0x16c)],_0x27828f=_0x1eeb93[_0x4e5ada(0x1a8)][_0x4e5ada(0x14e)],_0x5b07ea=_0x1eeb93[_0x4e5ada(0x197)][_0x4e5ada(0x18e)],_0x2a07ea=_0x1eeb93[_0x4e5ada(0x110)][_0x4e5ada(0x166)],_0x35ee4f=_0x1eeb93[_0x4e5ada(0x110)]['changed'],_0x24fedf=_0x1eeb93[_0x4e5ada(0x110)]['unchanged'],_0x2a42bd=_0x1eeb93[_0x4e5ada(0x110)][_0x4e5ada(0x14e)],_0x48aae6=_0x1eeb93[_0x4e5ada(0x171)]['all'],_0x11b1a6=_0x1eeb93[_0x4e5ada(0x171)][_0x4e5ada(0x18e)],_0x1cbf5d=_0x1eeb93[_0x4e5ada(0x171)][_0x4e5ada(0x17f)],_0x4507ca=_0x1eeb93[_0x4e5ada(0x171)][_0x4e5ada(0x14e)];console[_0x4e5ada(0x17e)](_0x4e5ada(0x154)+_0x485e2a+'\x27:');_0x5b07ea[_0x4e5ada(0x1ac)]>0x0&&console[_0x4e5ada(0x17e)]('\x20\x20'+a31_0x1739a4[_0x4e5ada(0x19d)](_0x4e5ada(0x167)+_0x5b07ea['length']+'\x20folders\x20to\x20create'));if(!_0x2ee0ba[_0x4e5ada(0x127)]){console[_0x4e5ada(0x17e)]('\x20\x20📊\x20Segments:'),console[_0x4e5ada(0x17e)]('\x20\x20\x20\x20'+a31_0x1739a4[_0x4e5ada(0x14f)]('+\x20'+_0x1326bd[_0x4e5ada(0x1ac)]+_0x4e5ada(0x12b))),console[_0x4e5ada(0x17e)](_0x4e5ada(0x145)+a31_0x1739a4[_0x4e5ada(0x18f)]('~\x20'+_0x27b92e[_0x4e5ada(0x1ac)]+_0x4e5ada(0x18a)));if(_0x27828f[_0x4e5ada(0x1ac)]>0x0)console['error'](_0x4e5ada(0x145)+a31_0x1739a4['red']('-\x20'+_0x27828f[_0x4e5ada(0x1ac)]+_0x4e5ada(0x14d)));else _0x1c0d44['length']>0x0&&!_0x2ee0ba['delete']&&console[_0x4e5ada(0x17e)](_0x4e5ada(0x145)+a31_0x1739a4[_0x4e5ada(0x15c)](_0x1c0d44[_0x4e5ada(0x1ac)]+_0x4e5ada(0x132)));console[_0x4e5ada(0x17e)](_0x4e5ada(0x145)+a31_0x1739a4[_0x4e5ada(0x15c)]('=\x20'+_0x1327f3[_0x4e5ada(0x1ac)]+_0x4e5ada(0x1ab)));}if(_0x2696fe[_0x4e5ada(0x1ac)]>0x0||_0x454714[_0x4e5ada(0x1ac)]>0x0){console[_0x4e5ada(0x17e)]('\x20\x20🗺️\x20\x20Journeys:'),console['error'](_0x4e5ada(0x145)+a31_0x1739a4[_0x4e5ada(0x14f)]('+\x20'+_0x2a07ea[_0x4e5ada(0x1ac)]+_0x4e5ada(0x12b))),console[_0x4e5ada(0x17e)]('\x20\x20\x20\x20'+a31_0x1739a4[_0x4e5ada(0x18f)]('~\x20'+_0x35ee4f[_0x4e5ada(0x1ac)]+_0x4e5ada(0x18a)));if(_0x2a42bd[_0x4e5ada(0x1ac)]>0x0)console[_0x4e5ada(0x17e)]('\x20\x20\x20\x20'+a31_0x1739a4[_0x4e5ada(0x16f)]('-\x20'+_0x2a42bd[_0x4e5ada(0x1ac)]+_0x4e5ada(0x14d)));else _0x454714[_0x4e5ada(0x1ac)]>0x0&&!_0x2ee0ba[_0x4e5ada(0x195)]&&console[_0x4e5ada(0x17e)](_0x4e5ada(0x145)+a31_0x1739a4['dim'](_0x454714[_0x4e5ada(0x1ac)]+_0x4e5ada(0x132)));console[_0x4e5ada(0x17e)](_0x4e5ada(0x145)+a31_0x1739a4[_0x4e5ada(0x15c)]('=\x20'+_0x24fedf['length']+_0x4e5ada(0x1ab)));}_0x48aae6[_0x4e5ada(0x1ac)]>0x0&&!_0x2ee0ba[_0x4e5ada(0x127)]&&(console[_0x4e5ada(0x17e)](''),console['error'](_0x4e5ada(0x13a)),_0x11b1a6[_0x4e5ada(0x1ac)]>0x0&&console[_0x4e5ada(0x17e)](_0x4e5ada(0x145)+a31_0x1739a4[_0x4e5ada(0x14f)]('+\x20'+_0x11b1a6['length']+_0x4e5ada(0x1a7))),_0x1cbf5d[_0x4e5ada(0x1ac)]>0x0&&console['error']('\x20\x20\x20\x20'+a31_0x1739a4[_0x4e5ada(0x18f)]('~\x20'+_0x1cbf5d[_0x4e5ada(0x1ac)]+_0x4e5ada(0x17a))),_0x4507ca[_0x4e5ada(0x1ac)]>0x0&&console[_0x4e5ada(0x17e)](_0x4e5ada(0x145)+a31_0x1739a4[_0x4e5ada(0x16f)]('-\x20'+_0x4507ca[_0x4e5ada(0x1ac)]+_0x4e5ada(0x14d))));console[_0x4e5ada(0x17e)](_0x4e5ada(0x161)+a31_0x1739a4[_0x4e5ada(0x187)](_0x1a36bc)+'\x0a');if(_0x5b07ea[_0x4e5ada(0x1ac)]>0x0){console['error']('Folders\x20to\x20create:');for(const _0x36543b of _0x5b07ea){console[_0x4e5ada(0x17e)]('\x20\x20'+a31_0x1739a4[_0x4e5ada(0x19d)]('+')+'\x20'+_0x36543b);}console[_0x4e5ada(0x17e)]('');}if(_0x1326bd[_0x4e5ada(0x1ac)]>0x0&&!_0x2ee0ba[_0x4e5ada(0x127)])for(const _0x89f516 of _0x1326bd){const _0x1d22ff=_0x89f516[_0x4e5ada(0x15e)]?_0x89f516[_0x4e5ada(0x15e)]+'/'+_0x89f516[_0x4e5ada(0x12e)][_0x4e5ada(0x155)]:_0x89f516[_0x4e5ada(0x12e)][_0x4e5ada(0x155)],_0x3cf494=_0x89f516[_0x4e5ada(0x12e)][_0x4e5ada(0x171)]?.[_0x4e5ada(0x1ac)]||0x0,_0x6bee60=_0x3cf494>0x0?a31_0x1739a4['dim']('\x20['+_0x3cf494+_0x4e5ada(0x164)):'';console['error']('\x0a'+a31_0x1739a4['green'](_0x4e5ada(0x138))+'\x20'+_0x1d22ff+_0x6bee60),console[_0x4e5ada(0x17e)]('─'[_0x4e5ada(0x149)](0x3c)),_0x89f516[_0x4e5ada(0x1a4)]&&console['error'](_0x89f516['diff']),console['error']('─'['repeat'](0x3c));}if(_0x27828f[_0x4e5ada(0x1ac)]>0x0&&!_0x2ee0ba[_0x4e5ada(0x127)])for(const _0x534d08 of _0x27828f){const _0x3d405e=_0x534d08[_0x4e5ada(0x113)]?_0x281a5e[_0x4e5ada(0x121)](_0x534d08[_0x4e5ada(0x113)][_0x4e5ada(0x140)]())||'':'',_0x19608a=_0x3d405e?_0x3d405e+'/'+_0x534d08['name']:_0x534d08[_0x4e5ada(0x155)],_0x397c6a=_0x18ea07[_0x4e5ada(0x121)](_0x534d08['id'])||[],_0x1adfd5=_0x397c6a[_0x4e5ada(0x1ac)]>0x0?a31_0x1739a4[_0x4e5ada(0x15c)]('\x20['+_0x397c6a[_0x4e5ada(0x1ac)]+_0x4e5ada(0x164)):'';console['error']('\x0a'+a31_0x1739a4[_0x4e5ada(0x16f)](_0x4e5ada(0x135))+'\x20'+_0x19608a+_0x1adfd5),console[_0x4e5ada(0x17e)]('─'['repeat'](0x3c));const _0xd0c5e3=segmentWithActivationsToYaml(_0x534d08,_0x397c6a,undefined,_0x2d6041,_0x820e12),_0x312ae9=segmentToYamlString(_0xd0c5e3),_0x548a94=generateDiff(_0x312ae9,'');console['error'](formatDiffWithColors(_0x548a94)),console['error']('─'[_0x4e5ada(0x149)](0x3c));}const _0x1feec8=_0x4c5c59[_0x4e5ada(0x146)](_0x1d72d0=>!_0x1d72d0[_0x4e5ada(0x122)]&&_0x1d72d0[_0x4e5ada(0x1a4)]);if(_0x1feec8[_0x4e5ada(0x1ac)]>0x0&&!_0x2ee0ba[_0x4e5ada(0x127)])for(const _0x4df82d of _0x1feec8){const _0x579dd5=_0x4df82d['folderPath']?_0x4df82d[_0x4e5ada(0x15e)]+'/'+_0x4df82d[_0x4e5ada(0x12e)]['name']:_0x4df82d['yamlConfig'][_0x4e5ada(0x155)];console[_0x4e5ada(0x17e)]('\x0a'+a31_0x1739a4[_0x4e5ada(0x18f)]('Changes\x20to:')+'\x20'+_0x579dd5),console[_0x4e5ada(0x17e)]('─'[_0x4e5ada(0x149)](0x3c)),console[_0x4e5ada(0x17e)](_0x4df82d['diff']),console[_0x4e5ada(0x17e)]('─'[_0x4e5ada(0x149)](0x3c));}if(_0x2a07ea['length']>0x0)for(const _0x1ad0d4 of _0x2a07ea){const _0x1a69ac=_0x1ad0d4['folderPath']?_0x1ad0d4[_0x4e5ada(0x15e)]+'/'+_0x1ad0d4[_0x4e5ada(0x12e)]['name']:_0x1ad0d4[_0x4e5ada(0x12e)][_0x4e5ada(0x155)];console[_0x4e5ada(0x17e)]('\x0a'+a31_0x1739a4[_0x4e5ada(0x14f)](_0x4e5ada(0x158))+'\x20'+_0x1a69ac),console[_0x4e5ada(0x17e)]('─'[_0x4e5ada(0x149)](0x3c)),_0x1ad0d4['diff']&&console[_0x4e5ada(0x17e)](_0x1ad0d4['diff']),console[_0x4e5ada(0x17e)]('─'[_0x4e5ada(0x149)](0x3c));}const _0x1ef024=_0x2696fe['filter'](_0x24e365=>!_0x24e365['isNew']&&_0x24e365[_0x4e5ada(0x1a4)]);if(_0x1ef024[_0x4e5ada(0x1ac)]>0x0)for(const _0xb6530e of _0x1ef024){const _0x22dd43=_0xb6530e['folderPath']?_0xb6530e[_0x4e5ada(0x15e)]+'/'+_0xb6530e['yamlConfig']['name']:_0xb6530e[_0x4e5ada(0x12e)][_0x4e5ada(0x155)];console[_0x4e5ada(0x17e)]('\x0a'+a31_0x1739a4[_0x4e5ada(0x18f)](_0x4e5ada(0x14c))+'\x20'+_0x22dd43),console['error']('─'['repeat'](0x3c)),console[_0x4e5ada(0x17e)](_0xb6530e[_0x4e5ada(0x1a4)]),console[_0x4e5ada(0x17e)]('─'[_0x4e5ada(0x149)](0x3c));}if(_0x2a42bd['length']>0x0)for(const _0x6c46f4 of _0x2a42bd){const _0x1bf65e=_0x6c46f4[_0x4e5ada(0x14b)]?_0x281a5e['get'](_0x6c46f4[_0x4e5ada(0x14b)])||'':'',_0xa776cd=_0x1bf65e?_0x1bf65e+'/'+_0x6c46f4['journeyBundleName']:_0x6c46f4['journeyBundleName'];console[_0x4e5ada(0x17e)]('\x0a'+a31_0x1739a4['red']('Delete\x20journey:')+'\x20'+_0xa776cd),console[_0x4e5ada(0x17e)]('─'[_0x4e5ada(0x149)](0x3c)),console[_0x4e5ada(0x17e)](a31_0x1739a4['red']('(Journey\x20will\x20be\x20deleted)')),console[_0x4e5ada(0x17e)]('─'[_0x4e5ada(0x149)](0x3c));}if(_0x2ee0ba['dryRun'])return console[_0x4e5ada(0x17e)](a31_0x1739a4['yellow'](_0x4e5ada(0x170))),0x0;const _0x3d6774=_0x2ee0ba[_0x4e5ada(0x127)]?![]:_0x1326bd['length']>0x0||_0x27b92e[_0x4e5ada(0x1ac)]>0x0||_0x27828f[_0x4e5ada(0x1ac)]>0x0,_0x5107d7=_0x2a07ea[_0x4e5ada(0x1ac)]>0x0||_0x35ee4f[_0x4e5ada(0x1ac)]>0x0||_0x2a42bd[_0x4e5ada(0x1ac)]>0x0,_0x257d01=_0x2ee0ba[_0x4e5ada(0x127)]?![]:_0x48aae6[_0x4e5ada(0x1ac)]>0x0,_0x1c8437=_0x5b07ea[_0x4e5ada(0x1ac)]>0x0;if(!_0x3d6774&&!_0x5107d7&&!_0x257d01&&!_0x1c8437){const _0x493683=_0x2ee0ba[_0x4e5ada(0x127)]?_0x4e5ada(0x165):_0x4e5ada(0x180);console[_0x4e5ada(0x17e)](a31_0x1739a4[_0x4e5ada(0x14f)](_0x493683));if(_0x456481&&_0x24fedf[_0x4e5ada(0x1ac)]===0x1){const _0x3ff9c6=_0x24fedf[0x0];if(_0x3ff9c6[_0x4e5ada(0x16e)]?.['id']){const _0x31baf0=getConsoleNextUrl(_0x2ee0ba[_0x4e5ada(0x150)],'/app/ps/'+_0x28ff2b+_0x4e5ada(0x120)+_0x3ff9c6[_0x4e5ada(0x16e)]['id']+_0x4e5ada(0x15d));console[_0x4e5ada(0x17e)]('\x20\x20'+a31_0x1739a4[_0x4e5ada(0x187)](_0x31baf0));}}return 0x0;}const _0x592ac4=_0x2ee0ba['journeysOnly']?_0x2a07ea[_0x4e5ada(0x1ac)]+_0x35ee4f[_0x4e5ada(0x1ac)]+_0x2a42bd[_0x4e5ada(0x1ac)]+_0x5b07ea[_0x4e5ada(0x1ac)]:_0x1326bd['length']+_0x27b92e['length']+_0x27828f[_0x4e5ada(0x1ac)]+_0x2a07ea[_0x4e5ada(0x1ac)]+_0x35ee4f[_0x4e5ada(0x1ac)]+_0x2a42bd[_0x4e5ada(0x1ac)]+_0x5b07ea['length']+_0x48aae6[_0x4e5ada(0x1ac)];if(!_0x2ee0ba[_0x4e5ada(0x152)]&&_0x592ac4>0x0){if(!isInteractive())return console[_0x4e5ada(0x17e)](a31_0x1739a4[_0x4e5ada(0x16f)]('\x0aError:'),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x4e5ada(0x17e)](a31_0x1739a4['dim'](_0x4e5ada(0x124))),0x1;const _0x3e8824=await confirmKey('Push\x20'+_0x592ac4+_0x4e5ada(0x157));if(!_0x3e8824)return console[_0x4e5ada(0x17e)](a31_0x1739a4[_0x4e5ada(0x18f)]('Aborted.')),0x1;}const _0x4dc063={'withProgress':async(_0x49655a,_0x5d1286)=>{const _0x4bde98=_0x4e5ada,_0x546336=await withSpinner(_0x49655a,_0x5d1286,{'verbose':_0x2ee0ba[_0x4bde98(0x18d)]});return{'data':_0x546336[_0x4bde98(0x179)]};},'logInfo':_0x156bf6=>console[_0x4e5ada(0x17e)](a31_0x1739a4[_0x4e5ada(0x19d)]('✔\x20'+_0x156bf6)),'logSuccess':_0x2a05b4=>console[_0x4e5ada(0x17e)](a31_0x1739a4[_0x4e5ada(0x14f)]('✔\x20'+_0x2a05b4)),'logWarning':_0x40409a=>console['error'](a31_0x1739a4[_0x4e5ada(0x18f)]('⚠\x20'+_0x40409a)),'logDeleted':_0x500bde=>console[_0x4e5ada(0x17e)](a31_0x1739a4[_0x4e5ada(0x16f)]('✔\x20'+_0x500bde))},_0x4e7042={'segment':_0x3eed21['segment'],'journey':_0x3eed21[_0x4e5ada(0x18c)],'user':_0x3eed21[_0x4e5ada(0x192)],'connection':_0x3eed21[_0x4e5ada(0x13d)]};_0x5b07ea['length']>0x0&&(_0x359a17=await executePushFolders(_0x4e7042,_0x5b07ea,_0x359a17,{'parentId':_0x28ff2b},_0x4dc063));const _0x2cd625={'rootFolderId':_0x2804f3,'folderPathToId':_0x359a17,'folderIdToPath':_0x281a5e,'segmentNameToId':_0x27e00b,'activationsBySegmentId':_0x18ea07,'emailToIdMap':_0x469223,'idToEmailMap':_0x2d6041,'connectionNameToIdMap':_0x23039d[_0x4e5ada(0x147)],'connectionIdToNameMap':_0x23039d[_0x4e5ada(0x16a)],'connectionNameToTypeMap':_0x20aa72},_0xb5fe93=await executePushSegments(_0x4e7042,_0x2ee0ba['journeysOnly']?[]:_0x4c5c59,_0x2cd625,{'parentId':_0x28ff2b},_0x4dc063),_0x69df71=_0xb5fe93[_0x4e5ada(0x191)],_0x20b2ac=_0xb5fe93[_0x4e5ada(0x133)],_0x5c0ee2=_0xb5fe93[_0x4e5ada(0x171)]['created'],_0x5ea98c=_0xb5fe93[_0x4e5ada(0x171)][_0x4e5ada(0x133)],_0x12605a=_0xb5fe93[_0x4e5ada(0x171)][_0x4e5ada(0x117)],_0x5c9f9f=await executePushSegmentDeletions(_0x4e7042,_0x2ee0ba[_0x4e5ada(0x127)]?[]:_0x27828f,_0x4dc063);let _0x50f2d0=0x0,_0x419aa4=0x0,_0xc2352b=0x0;const _0x775a18=new Map(_0x27e00b);for(const [_0x4ae0e4,_0x425ccd]of _0xb5fe93[_0x4e5ada(0x19a)]){_0x775a18['set'](_0x4ae0e4,_0x425ccd);}if(_0x2696fe[_0x4e5ada(0x1ac)]>0x0){const _0x3ec5a4={..._0x2cd625,'segmentNameToId':_0x775a18,'existingSegments':_0x502b5f,'activationContext':_0x315747},_0x1a01da=await executePushJourneys(_0x4e7042,_0x2696fe,_0x3ec5a4,{'parentId':_0x28ff2b,'rootFolderId':_0x2804f3,'verbose':_0x2ee0ba['verbose']},_0x4dc063);_0x50f2d0=_0x1a01da[_0x4e5ada(0x191)],_0x419aa4=_0x1a01da[_0x4e5ada(0x133)];if(_0x456481&&_0x1a01da[_0x4e5ada(0x156)][_0x4e5ada(0x1ac)]===0x1){const _0x8f09e8=_0x1a01da[_0x4e5ada(0x156)][0x0];if(_0x8f09e8[_0x4e5ada(0x181)]){const _0x2713f6=getConsoleNextUrl(_0x2ee0ba[_0x4e5ada(0x150)],_0x4e5ada(0x14a)+_0x28ff2b+_0x4e5ada(0x120)+_0x8f09e8[_0x4e5ada(0x181)]+_0x4e5ada(0x15d));console[_0x4e5ada(0x17e)]('\x20\x20'+a31_0x1739a4[_0x4e5ada(0x187)](_0x2713f6));}}}for(const _0x274c4a of _0x2a42bd){console[_0x4e5ada(0x17e)](a31_0x1739a4[_0x4e5ada(0x18f)](_0x4e5ada(0x129)+_0x274c4a[_0x4e5ada(0x159)])),_0xc2352b++;}const _0xb4e5a=[];if(_0x69df71>0x0)_0xb4e5a[_0x4e5ada(0x12d)](_0x69df71+_0x4e5ada(0x10e));if(_0x20b2ac>0x0)_0xb4e5a[_0x4e5ada(0x12d)](_0x20b2ac+_0x4e5ada(0x17d));if(_0x5c9f9f>0x0)_0xb4e5a[_0x4e5ada(0x12d)](_0x5c9f9f+_0x4e5ada(0x11e));const _0x43c2c3=[];if(_0x50f2d0>0x0)_0x43c2c3[_0x4e5ada(0x12d)](_0x50f2d0+_0x4e5ada(0x10e));if(_0x419aa4>0x0)_0x43c2c3[_0x4e5ada(0x12d)](_0x419aa4+_0x4e5ada(0x17d));if(_0xc2352b>0x0)_0x43c2c3[_0x4e5ada(0x12d)](_0xc2352b+_0x4e5ada(0x11e));const _0x37a386=[];if(_0x5c0ee2>0x0)_0x37a386[_0x4e5ada(0x12d)](_0x5c0ee2+_0x4e5ada(0x10e));if(_0x5ea98c>0x0)_0x37a386[_0x4e5ada(0x12d)](_0x5ea98c+_0x4e5ada(0x17d));if(_0x12605a>0x0)_0x37a386[_0x4e5ada(0x12d)](_0x12605a+'\x20deleted');return console[_0x4e5ada(0x17e)](a31_0x1739a4[_0x4e5ada(0x14f)](_0x4e5ada(0x19e))),_0xb4e5a[_0x4e5ada(0x1ac)]>0x0&&!_0x2ee0ba['journeysOnly']&&console['error'](_0x4e5ada(0x123)+_0xb4e5a[_0x4e5ada(0x175)](',\x20')),_0x43c2c3[_0x4e5ada(0x1ac)]>0x0&&console[_0x4e5ada(0x17e)]('\x20\x20Journeys:\x20'+_0x43c2c3[_0x4e5ada(0x175)](',\x20')),_0x37a386[_0x4e5ada(0x1ac)]>0x0&&!_0x2ee0ba['journeysOnly']&&console[_0x4e5ada(0x17e)](_0x4e5ada(0x199)+_0x37a386[_0x4e5ada(0x175)](',\x20')),0x0;}}
1
+ const a31_0x4c8f1d=a31_0x1223;(function(_0x446138,_0x3ebc16){const _0x13db5b=a31_0x1223,_0x495e1c=_0x446138();while(!![]){try{const _0x14edb9=parseInt(_0x13db5b(0x184))/0x1+-parseInt(_0x13db5b(0x1a2))/0x2+-parseInt(_0x13db5b(0x209))/0x3*(parseInt(_0x13db5b(0x1d0))/0x4)+-parseInt(_0x13db5b(0x1f5))/0x5*(-parseInt(_0x13db5b(0x183))/0x6)+-parseInt(_0x13db5b(0x18b))/0x7*(parseInt(_0x13db5b(0x17a))/0x8)+-parseInt(_0x13db5b(0x189))/0x9*(parseInt(_0x13db5b(0x1dc))/0xa)+parseInt(_0x13db5b(0x1c3))/0xb*(parseInt(_0x13db5b(0x188))/0xc);if(_0x14edb9===_0x3ebc16)break;else _0x495e1c['push'](_0x495e1c['shift']());}catch(_0x14eb30){_0x495e1c['push'](_0x495e1c['shift']());}}}(a31_0x8a9b,0xb503f));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 a31_0x1a65e1 from'chalk';import{existsSync}from'fs';function a31_0x1223(_0x23c092,_0x42ee73){_0x23c092=_0x23c092-0x175;const _0x8a9b61=a31_0x8a9b();let _0x122303=_0x8a9b61[_0x23c092];return _0x122303;}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 a31_0x8a9b(){const _0x1eb3fc=['journeyId','6483016lOdzgz','Changes\x20to\x20journey:','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','Push\x20','changed','green','paused','\x20YAML\x20files\x20found','\x20to\x20delete','3585522bHYABj','698381vJtblz','list','toDelete','delete','24EtfJqL','315AZUCBs','\x27...','7ZKUhXD','folderPath','New\x20journey:','\x20unchanged','created','\x0aValidation\x20failed:','yamlConfig','\x20deleted','\x20changed','Usage:\x20tdx\x20sg\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20(requires\x20context)','updated','(Journey\x20will\x20be\x20deleted)','join','Fetching\x20existing\x20folders...','\x20\x20\x20\x20','segment','\x20\x20🗺️\x20\x20Journeys:','data','segment\x20or\x20journey','targetDir','journeyBundleId','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','Delete\x20segment:','2225120JNCbhK','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','connection','getOutputSchemaWithCache','new','journeyBundleName','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','diff','\x20folders\x20to\x20create','description','get','attributes','blue','Site:\x20','Source\x20directory:\x20','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','segmentFolderId','isScoped','errorCode','type','length','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','Fetching\x20existing\x20activations...','idToName','Fetching\x20connections\x20for\x20name\x20resolution...','parentFolder','file','Resolving\x20parent\x20segment\x20\x27','push','createdSegmentIds','map','createdAt','\x20changes?','12761683zRvJoz','yellow','yes','/app/ps/','name','dim','no_parent','filter','journey','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','parent_name','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','journeys','560VNDvQu','\x0aPush\x20summary\x20for\x20\x27','\x20new','segments','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','nameToId','getParent','Fetching\x20existing\x20journeys...','filePath','segment:push','site','.yml','163310OXPRYC','parentName','activations','\x0a✔\x20Push\x20complete','New\x20segment:','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','verbose','\x20to\x20create','parentSegment','repeat','cyan','Error\x20parsing\x20YAML:\x20','red','No\x20','Delete\x20journey:','message','\x20\x20Activations:','.yaml','\x20\x20Source:\x20','/e/','listJourneysWithDetailsFromParentSegment','Error:\x20Directory\x20not\x20found:\x20','helpText','dryRun','then','10mhvxSG','isNew','nameToType','\x20created','toString','updatedAt','existingJourney','\x20updated','audienceId','cwd','setPhase','\x20\x20Activations:\x20','state','scopedFolderPath','\x20activations]','Error:\x20','execute','error','endsWith','listFolders','20955MwlZfO','\x20\x20📊\x20Segments:','all','user','journeysOnly','deleted','Folders\x20to\x20create:'];a31_0x8a9b=function(){return _0x1eb3fc;};return a31_0x8a9b();}import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{resolveTDFolderPath,findSegmentsToDelete,findJourneysToDelete,buildSegmentLookupMap,buildSegmentNameToIdMap,buildJourneyBundleLookupMap,parseAndClassifyYamlFiles,validateParsedFiles,formatValidationErrors,extractRootFolderId,buildConnectionMaps,calculatePushStats,prepareSegmentFiles,prepareJourneyFiles,executePushSegments,executePushFolders,executePushSegmentDeletions,executePushJourneys}from'../sdk/segment/push-workflow.js';export class SegmentPushCommand extends BaseCommand{[a31_0x4c8f1d(0x1c7)]=a31_0x4c8f1d(0x1d9);[a31_0x4c8f1d(0x1ab)]=a31_0x4c8f1d(0x1a0);async[a31_0x4c8f1d(0x205)](_0x19032e){const _0x15fe5c=a31_0x4c8f1d,{options:_0x7a161c,args:_0x446e41,tdx:_0x576f2d}=_0x19032e,_0x422ad6=_0x7a161c,_0x3fa8fd=await resolveTarget({'arg':_0x446e41[0x0],'contextParent':_0x7a161c[_0x15fe5c(0x1e4)],'cwd':process[_0x15fe5c(0x1fe)]()});if(!isSuccessfulResolution(_0x3fa8fd))return _0x3fa8fd[_0x15fe5c(0x1b4)]===_0x15fe5c(0x1c9)?(console['error'](a31_0x1a65e1['yellow'](_0x15fe5c(0x1a3))),console[_0x15fe5c(0x206)](_0x15fe5c(0x194)),console[_0x15fe5c(0x206)](_0x15fe5c(0x1ce)),console[_0x15fe5c(0x206)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file')):(console['error'](a31_0x1a65e1[_0x15fe5c(0x1e8)](_0x15fe5c(0x204)+_0x3fa8fd[_0x15fe5c(0x1eb)]+'\x0a')),_0x3fa8fd['helpText']&&console['error'](a31_0x1a65e1[_0x15fe5c(0x1e6)](_0x3fa8fd[_0x15fe5c(0x1f2)]))),0x1;if(_0x3fa8fd[_0x15fe5c(0x1b5)]===_0x15fe5c(0x1cd))return console[_0x15fe5c(0x206)](a31_0x1a65e1[_0x15fe5c(0x1e8)]('Error:\x20Directory\x20not\x20found:\x20'+_0x3fa8fd['targetDir']+'\x0a')),console[_0x15fe5c(0x206)](a31_0x1a65e1[_0x15fe5c(0x1e6)](_0x15fe5c(0x1a8))),0x1;const _0x21f0a4=_0x3fa8fd[_0x15fe5c(0x1dd)],_0x3a82cb=_0x3fa8fd[_0x15fe5c(0x19e)],_0xd54682=_0x3fa8fd['type']===_0x15fe5c(0x1bc)?_0x3fa8fd[_0x15fe5c(0x1d8)]:undefined,_0x520e29=getScopedDetails(_0x3fa8fd),_0x17f431=_0x520e29?.[_0x15fe5c(0x1b3)]??![],_0x23d614=_0x520e29?.[_0x15fe5c(0x202)]??'';if(!existsSync(_0x3a82cb))return console[_0x15fe5c(0x206)](a31_0x1a65e1[_0x15fe5c(0x1e8)](_0x15fe5c(0x1f1)+_0x3a82cb+'\x0a')),console[_0x15fe5c(0x206)](a31_0x1a65e1[_0x15fe5c(0x1e6)](_0x15fe5c(0x1a8))),0x1;_0x422ad6[_0x15fe5c(0x1e2)]&&(console[_0x15fe5c(0x206)](_0x15fe5c(0x1af)+_0x422ad6[_0x15fe5c(0x1da)]),console[_0x15fe5c(0x206)]('Parent\x20segment:\x20'+_0x21f0a4),console[_0x15fe5c(0x206)](_0x15fe5c(0x1b0)+_0x3a82cb),_0x17f431&&console[_0x15fe5c(0x206)]('Scoped\x20to\x20folder:\x20'+_0x23d614));const _0x3b9067=await withSpinner(_0x15fe5c(0x1bd)+_0x21f0a4+_0x15fe5c(0x18a),()=>_0x576f2d[_0x15fe5c(0x19a)]['resolveParentId'](_0x21f0a4),{'verbose':_0x422ad6[_0x15fe5c(0x1e2)]}),_0xb30465=_0x3b9067['data'],[_0x4020cf,_0x2e4b1a,_0x232991,_0x4ff5ef,_0x3e3bc6]=await Promise[_0x15fe5c(0x20b)]([withSpinner('Fetching\x20parent\x20segment\x20details...',()=>_0x576f2d[_0x15fe5c(0x19a)][_0x15fe5c(0x1d6)](_0xb30465),{'verbose':_0x422ad6[_0x15fe5c(0x1e2)]}),withSpinner('Fetching\x20existing\x20segments...',()=>_0x576f2d[_0x15fe5c(0x19a)]['listSegments'](_0xb30465),{'verbose':_0x422ad6[_0x15fe5c(0x1e2)]}),withSpinner(_0x15fe5c(0x198),()=>_0x576f2d['segment'][_0x15fe5c(0x208)](_0xb30465),{'verbose':_0x422ad6[_0x15fe5c(0x1e2)]}),withSpinner(_0x15fe5c(0x1d7),()=>_0x576f2d[_0x15fe5c(0x1cb)][_0x15fe5c(0x1f0)](_0xb30465,{'includeAllVersions':!![]}),{'verbose':_0x422ad6[_0x15fe5c(0x1e2)]}),withSpinner('Fetching\x20users\x20for\x20email\x20resolution...',()=>_0x576f2d[_0x15fe5c(0x175)]['buildUserMaps'](),{'verbose':_0x422ad6['verbose']})[_0x15fe5c(0x1f4)](_0x39d752=>_0x39d752[_0x15fe5c(0x19c)])]),_0x504ad1=_0x4020cf[_0x15fe5c(0x19c)],_0x34dade=extractRootFolderId(_0x504ad1),_0x599cdf=_0x2e4b1a[_0x15fe5c(0x19c)],_0x2cb2cc=_0x232991[_0x15fe5c(0x19c)],{journeys:_0x444a02,activationStepsById:_0x43da4a}=_0x4ff5ef[_0x15fe5c(0x19c)],_0x4c06db=new Map(_0x444a02['map'](_0x2ba83b=>[_0x2ba83b['id'],_0x2ba83b])),_0x6ca23d=_0x444a02[_0x15fe5c(0x1c0)](_0x12ac0e=>({'id':_0x12ac0e['id'],'name':_0x12ac0e['attributes'][_0x15fe5c(0x1c7)],'journeyBundleName':_0x12ac0e[_0x15fe5c(0x1ad)]['journeyBundleName']||'','journeyBundleId':_0x12ac0e[_0x15fe5c(0x1ad)][_0x15fe5c(0x19f)]||'','versionNumber':_0x12ac0e['attributes']['versionNumber'],'description':_0x12ac0e[_0x15fe5c(0x1ad)][_0x15fe5c(0x1ab)],'state':_0x12ac0e['attributes'][_0x15fe5c(0x201)],'paused':_0x12ac0e[_0x15fe5c(0x1ad)][_0x15fe5c(0x180)],'audienceId':_0x12ac0e[_0x15fe5c(0x1ad)][_0x15fe5c(0x1fd)],'folderId':_0x12ac0e['relationships']?.[_0x15fe5c(0x1bb)]?.[_0x15fe5c(0x19c)]?.['id'],'createdAt':_0x12ac0e[_0x15fe5c(0x1ad)][_0x15fe5c(0x1c1)],'updatedAt':_0x12ac0e[_0x15fe5c(0x1ad)][_0x15fe5c(0x1fa)]})),{emailToId:_0x572b7f,idToEmail:_0x38bfad}=_0x3e3bc6,_0xe652b1=await withSpinner(_0x15fe5c(0x1ba),async()=>{const _0x272d69=_0x15fe5c,_0x1d4866=await _0x576f2d[_0x272d69(0x1a4)][_0x272d69(0x185)]();return buildConnectionMaps(_0x1d4866);},{'verbose':_0x422ad6[_0x15fe5c(0x1e2)]})[_0x15fe5c(0x1f4)](_0x2b6c54=>_0x2b6c54[_0x15fe5c(0x19c)]),_0x350bd6=_0xe652b1['nameToId'],_0x577d77=_0xe652b1['idToName'],_0x548cef=_0xe652b1[_0x15fe5c(0x1f7)],_0x4a1e37={'emailToIdMap':_0x572b7f,'connectionNameToIdMap':_0x350bd6,'connectionNameToTypeMap':_0x548cef,'getSchema':_0x38fc72=>_0x576f2d[_0x15fe5c(0x1a4)][_0x15fe5c(0x1a5)](_0x38fc72)};let {pathToId:_0xd114e,idToPath:_0x1ce742}=buildFolderMaps(_0x2cb2cc);const _0x48d677=buildSegmentLookupMap(_0x599cdf,_0x1ce742),_0x275b9a=buildSegmentNameToIdMap(_0x599cdf),_0x141f0e=buildJourneyBundleLookupMap(_0x6ca23d,_0x1ce742);let _0x24e490;if(_0xd54682){if(!_0xd54682[_0x15fe5c(0x207)](_0x15fe5c(0x1db))&&!_0xd54682[_0x15fe5c(0x207)](_0x15fe5c(0x1ed)))return console[_0x15fe5c(0x206)](a31_0x1a65e1[_0x15fe5c(0x1e8)](_0x15fe5c(0x17c)+_0xd54682+'\x0a')),0x1;_0x24e490=[_0xd54682];}else _0x24e490=findYamlFiles(_0x3a82cb);if(_0x24e490[_0x15fe5c(0x1b6)]===0x0)return console[_0x15fe5c(0x206)](a31_0x1a65e1[_0x15fe5c(0x1e8)]('Error:\x20No\x20YAML\x20files\x20found\x20in\x20'+_0x3a82cb+'\x0a')),console[_0x15fe5c(0x206)](a31_0x1a65e1[_0x15fe5c(0x1e6)](_0x15fe5c(0x1b7))),0x1;let _0x2be9a5,_0x1edbe5;try{const _0x49542a=parseAndClassifyYamlFiles(_0x24e490,_0x3a82cb,{'skipSegments':_0x422ad6[_0x15fe5c(0x176)]});_0x2be9a5=_0x49542a[_0x15fe5c(0x1d3)],_0x1edbe5=_0x49542a[_0x15fe5c(0x1cf)];const _0x3b61f5=validateParsedFiles(_0x49542a,_0x3a82cb);if(_0x3b61f5[_0x15fe5c(0x1b6)]>0x0)return console['error'](a31_0x1a65e1[_0x15fe5c(0x1e8)](_0x15fe5c(0x190))),console[_0x15fe5c(0x206)](formatValidationErrors(_0x3b61f5)),console['error'](a31_0x1a65e1['yellow'](_0x15fe5c(0x1d4))),0x1;}catch(_0x1412ce){return console['error'](a31_0x1a65e1[_0x15fe5c(0x1e8)](_0x15fe5c(0x1e7)+(_0x1412ce instanceof Error?_0x1412ce[_0x15fe5c(0x1eb)]:_0x1412ce))),0x1;}if(_0x2be9a5['length']===0x0&&_0x1edbe5['length']===0x0){const _0x388342=_0x422ad6[_0x15fe5c(0x176)]?_0x15fe5c(0x1cb):_0x15fe5c(0x19d);return console[_0x15fe5c(0x206)](a31_0x1a65e1[_0x15fe5c(0x1c4)](_0x15fe5c(0x1e9)+_0x388342+_0x15fe5c(0x181))),0x0;}const _0x16e2f5=new Map();_0x599cdf[_0x15fe5c(0x1b6)]>0x0&&!_0x422ad6[_0x15fe5c(0x176)]&&await withSpinner(_0x15fe5c(0x1b8),async()=>{await batchAsync(_0x599cdf,async _0x222247=>{const _0x1bdc19=a31_0x1223,_0x3a870a=await _0x576f2d[_0x1bdc19(0x19a)]['listActivations'](_0xb30465,_0x222247['id']);_0x16e2f5['set'](_0x222247['id'],_0x3a870a);});},{'verbose':_0x422ad6[_0x15fe5c(0x1e2)]});const {segmentFiles:_0x2fb2da,foldersToCreate:_0x38d5fb}=await prepareSegmentFiles(_0x2be9a5,{'segmentByFolderAndName':_0x48d677,'activationsBySegmentId':_0x16e2f5,'folderPathToId':_0xd114e,'idToEmailMap':_0x38bfad,'connectionIdToNameMap':_0x577d77},_0x4a1e37,_0x17f431,_0x23d614),_0x4a92a7=_0xd54682?[]:findSegmentsToDelete(_0x599cdf,_0x2be9a5[_0x15fe5c(0x1c0)](({yamlConfig:_0x59e238,folderPath:_0x47b299})=>({'yamlConfig':_0x59e238,'folderPath':resolveTDFolderPath(_0x47b299,_0x17f431,_0x23d614)})),_0x1ce742,_0x23d614,_0x17f431),{journeyFiles:_0x269e75,foldersToCreate:_0x2a45d7}=await withProgressSpinner('Preparing\x20journeys...',async _0x397f2f=>prepareJourneyFiles(_0x1edbe5,{'fetchJourney':async _0x2dbac8=>_0x576f2d[_0x15fe5c(0x1cb)]['getJourney'](_0x2dbac8[_0x15fe5c(0x179)]),'journeyBundlesByFolderAndName':_0x141f0e,'folderPathToId':_0xd114e,'idToEmailMap':_0x38bfad,'connectionIdToNameMap':_0x577d77,'existingSegments':_0x599cdf,'parentId':_0xb30465,'deps':_0x576f2d,'progress':{'update':_0xb3f395=>{const _0xc21c9f=_0x15fe5c;_0x397f2f[_0xc21c9f(0x1ff)](_0xb3f395),_0x422ad6[_0xc21c9f(0x1e2)]&&console[_0xc21c9f(0x206)]('\x20\x20'+_0xb3f395);}},'journeyById':_0x4c06db,'activationStepsById':_0x43da4a},_0x17f431,_0x23d614),{'verbose':_0x422ad6[_0x15fe5c(0x1e2)]})[_0x15fe5c(0x1f4)](_0x2e7a41=>_0x2e7a41[_0x15fe5c(0x19c)]);for(const _0x3d931e of _0x2a45d7){_0x38d5fb['add'](_0x3d931e);}const _0x5d9cf9=_0xd54682?[]:findJourneysToDelete(_0x6ca23d,_0x1edbe5['map'](({yamlConfig:_0x14cd4a,folderPath:_0x561c18})=>({'yamlConfig':_0x14cd4a,'folderPath':resolveTDFolderPath(_0x561c18,_0x17f431,_0x23d614)})),_0x1ce742,_0x23d614,_0x17f431),_0x4f1c74=calculatePushStats(_0x2fb2da,_0x269e75,_0x38d5fb,_0x4a92a7,_0x5d9cf9,!!_0x422ad6[_0x15fe5c(0x187)],!!_0x422ad6['journeysOnly']),_0x5c5729=_0x4f1c74[_0x15fe5c(0x1d3)][_0x15fe5c(0x1a6)],_0xc1e05e=_0x4f1c74[_0x15fe5c(0x1d3)]['changed'],_0x5ebf23=_0x4f1c74['segments']['unchanged'],_0x575d00=_0x4f1c74['segments'][_0x15fe5c(0x186)],_0x4272b9=_0x4f1c74['folders']['toCreate'],_0xf32274=_0x4f1c74['journeys'][_0x15fe5c(0x1a6)],_0x975a7c=_0x4f1c74[_0x15fe5c(0x1cf)][_0x15fe5c(0x17e)],_0x4e925b=_0x4f1c74[_0x15fe5c(0x1cf)]['unchanged'],_0x2c2e7f=_0x4f1c74[_0x15fe5c(0x1cf)]['toDelete'],_0x3d09e5=_0x4f1c74[_0x15fe5c(0x1de)][_0x15fe5c(0x20b)],_0x44e731=_0x4f1c74[_0x15fe5c(0x1de)]['toCreate'],_0x12e97c=_0x4f1c74[_0x15fe5c(0x1de)]['toUpdate'],_0x6c4c5b=_0x4f1c74[_0x15fe5c(0x1de)][_0x15fe5c(0x186)];console[_0x15fe5c(0x206)](_0x15fe5c(0x1d1)+_0x21f0a4+'\x27:');_0x4272b9['length']>0x0&&console['error']('\x20\x20'+a31_0x1a65e1[_0x15fe5c(0x1ae)]('📁\x20'+_0x4272b9[_0x15fe5c(0x1b6)]+_0x15fe5c(0x1aa)));if(!_0x422ad6[_0x15fe5c(0x176)]){console['error'](_0x15fe5c(0x20a)),console[_0x15fe5c(0x206)](_0x15fe5c(0x199)+a31_0x1a65e1[_0x15fe5c(0x17f)]('+\x20'+_0x5c5729[_0x15fe5c(0x1b6)]+_0x15fe5c(0x1d2))),console['error'](_0x15fe5c(0x199)+a31_0x1a65e1['yellow']('~\x20'+_0xc1e05e['length']+'\x20changed'));if(_0x575d00[_0x15fe5c(0x1b6)]>0x0)console[_0x15fe5c(0x206)](_0x15fe5c(0x199)+a31_0x1a65e1[_0x15fe5c(0x1e8)]('-\x20'+_0x575d00[_0x15fe5c(0x1b6)]+'\x20to\x20delete'));else _0x4a92a7[_0x15fe5c(0x1b6)]>0x0&&!_0x422ad6[_0x15fe5c(0x187)]&&console['error'](_0x15fe5c(0x199)+a31_0x1a65e1[_0x15fe5c(0x1c8)](_0x4a92a7[_0x15fe5c(0x1b6)]+'\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)'));console['error']('\x20\x20\x20\x20'+a31_0x1a65e1[_0x15fe5c(0x1c8)]('=\x20'+_0x5ebf23['length']+_0x15fe5c(0x18e)));}if(_0x269e75['length']>0x0||_0x5d9cf9[_0x15fe5c(0x1b6)]>0x0){console[_0x15fe5c(0x206)](_0x15fe5c(0x19b)),console[_0x15fe5c(0x206)](_0x15fe5c(0x199)+a31_0x1a65e1[_0x15fe5c(0x17f)]('+\x20'+_0xf32274[_0x15fe5c(0x1b6)]+'\x20new')),console[_0x15fe5c(0x206)](_0x15fe5c(0x199)+a31_0x1a65e1[_0x15fe5c(0x1c4)]('~\x20'+_0x975a7c[_0x15fe5c(0x1b6)]+_0x15fe5c(0x193)));if(_0x2c2e7f[_0x15fe5c(0x1b6)]>0x0)console[_0x15fe5c(0x206)](_0x15fe5c(0x199)+a31_0x1a65e1[_0x15fe5c(0x1e8)]('-\x20'+_0x2c2e7f['length']+_0x15fe5c(0x182)));else _0x5d9cf9[_0x15fe5c(0x1b6)]>0x0&&!_0x422ad6[_0x15fe5c(0x187)]&&console[_0x15fe5c(0x206)](_0x15fe5c(0x199)+a31_0x1a65e1[_0x15fe5c(0x1c8)](_0x5d9cf9[_0x15fe5c(0x1b6)]+_0x15fe5c(0x1b1)));console[_0x15fe5c(0x206)](_0x15fe5c(0x199)+a31_0x1a65e1['dim']('=\x20'+_0x4e925b[_0x15fe5c(0x1b6)]+_0x15fe5c(0x18e)));}_0x3d09e5[_0x15fe5c(0x1b6)]>0x0&&!_0x422ad6[_0x15fe5c(0x176)]&&(console[_0x15fe5c(0x206)](''),console[_0x15fe5c(0x206)](_0x15fe5c(0x1ec)),_0x44e731['length']>0x0&&console['error']('\x20\x20\x20\x20'+a31_0x1a65e1['green']('+\x20'+_0x44e731[_0x15fe5c(0x1b6)]+_0x15fe5c(0x1e3))),_0x12e97c[_0x15fe5c(0x1b6)]>0x0&&console[_0x15fe5c(0x206)](_0x15fe5c(0x199)+a31_0x1a65e1[_0x15fe5c(0x1c4)]('~\x20'+_0x12e97c[_0x15fe5c(0x1b6)]+'\x20to\x20update')),_0x6c4c5b[_0x15fe5c(0x1b6)]>0x0&&console[_0x15fe5c(0x206)]('\x20\x20\x20\x20'+a31_0x1a65e1[_0x15fe5c(0x1e8)]('-\x20'+_0x6c4c5b['length']+_0x15fe5c(0x182))));console[_0x15fe5c(0x206)](_0x15fe5c(0x1ee)+a31_0x1a65e1[_0x15fe5c(0x1e6)](_0x3a82cb)+'\x0a');if(_0x4272b9[_0x15fe5c(0x1b6)]>0x0){console[_0x15fe5c(0x206)](_0x15fe5c(0x178));for(const _0x4ea13e of _0x4272b9){console[_0x15fe5c(0x206)]('\x20\x20'+a31_0x1a65e1[_0x15fe5c(0x1ae)]('+')+'\x20'+_0x4ea13e);}console['error']('');}if(_0x5c5729[_0x15fe5c(0x1b6)]>0x0&&!_0x422ad6[_0x15fe5c(0x176)])for(const _0x591d22 of _0x5c5729){const _0x409def=_0x591d22[_0x15fe5c(0x18c)]?_0x591d22[_0x15fe5c(0x18c)]+'/'+_0x591d22['yamlConfig'][_0x15fe5c(0x1c7)]:_0x591d22[_0x15fe5c(0x191)][_0x15fe5c(0x1c7)],_0x498807=_0x591d22['yamlConfig']['activations']?.[_0x15fe5c(0x1b6)]||0x0,_0x4ab1e6=_0x498807>0x0?a31_0x1a65e1[_0x15fe5c(0x1c8)]('\x20['+_0x498807+_0x15fe5c(0x203)):'';console[_0x15fe5c(0x206)]('\x0a'+a31_0x1a65e1[_0x15fe5c(0x17f)](_0x15fe5c(0x1e0))+'\x20'+_0x409def+_0x4ab1e6),console[_0x15fe5c(0x206)]('─'['repeat'](0x3c)),_0x591d22[_0x15fe5c(0x1a9)]&&console['error'](_0x591d22[_0x15fe5c(0x1a9)]),console[_0x15fe5c(0x206)]('─'['repeat'](0x3c));}if(_0x575d00[_0x15fe5c(0x1b6)]>0x0&&!_0x422ad6[_0x15fe5c(0x176)])for(const _0x5ca8a0 of _0x575d00){const _0x1826bf=_0x5ca8a0[_0x15fe5c(0x1b2)]?_0x1ce742[_0x15fe5c(0x1ac)](_0x5ca8a0[_0x15fe5c(0x1b2)][_0x15fe5c(0x1f9)]())||'':'',_0x47b703=_0x1826bf?_0x1826bf+'/'+_0x5ca8a0[_0x15fe5c(0x1c7)]:_0x5ca8a0[_0x15fe5c(0x1c7)],_0x4ae487=_0x16e2f5[_0x15fe5c(0x1ac)](_0x5ca8a0['id'])||[],_0x4bfbd7=_0x4ae487[_0x15fe5c(0x1b6)]>0x0?a31_0x1a65e1[_0x15fe5c(0x1c8)]('\x20['+_0x4ae487[_0x15fe5c(0x1b6)]+'\x20activations]'):'';console[_0x15fe5c(0x206)]('\x0a'+a31_0x1a65e1[_0x15fe5c(0x1e8)](_0x15fe5c(0x1a1))+'\x20'+_0x47b703+_0x4bfbd7),console[_0x15fe5c(0x206)]('─'[_0x15fe5c(0x1e5)](0x3c));const _0x4b842c=segmentWithActivationsToYaml(_0x5ca8a0,_0x4ae487,undefined,_0x38bfad,_0x577d77),_0x192223=segmentToYamlString(_0x4b842c),_0x3671b8=generateDiff(_0x192223,'');console['error'](formatDiffWithColors(_0x3671b8)),console['error']('─'[_0x15fe5c(0x1e5)](0x3c));}const _0x199f88=_0x2fb2da[_0x15fe5c(0x1ca)](_0xe190b0=>!_0xe190b0['isNew']&&_0xe190b0['diff']);if(_0x199f88[_0x15fe5c(0x1b6)]>0x0&&!_0x422ad6['journeysOnly'])for(const _0x13d532 of _0x199f88){const _0x31385b=_0x13d532[_0x15fe5c(0x18c)]?_0x13d532[_0x15fe5c(0x18c)]+'/'+_0x13d532[_0x15fe5c(0x191)][_0x15fe5c(0x1c7)]:_0x13d532['yamlConfig'][_0x15fe5c(0x1c7)];console[_0x15fe5c(0x206)]('\x0a'+a31_0x1a65e1[_0x15fe5c(0x1c4)]('Changes\x20to:')+'\x20'+_0x31385b),console[_0x15fe5c(0x206)]('─'[_0x15fe5c(0x1e5)](0x3c)),console[_0x15fe5c(0x206)](_0x13d532[_0x15fe5c(0x1a9)]),console[_0x15fe5c(0x206)]('─'[_0x15fe5c(0x1e5)](0x3c));}if(_0xf32274['length']>0x0)for(const _0x3dca01 of _0xf32274){const _0x4fbf70=_0x3dca01[_0x15fe5c(0x18c)]?_0x3dca01[_0x15fe5c(0x18c)]+'/'+_0x3dca01[_0x15fe5c(0x191)][_0x15fe5c(0x1c7)]:_0x3dca01['yamlConfig'][_0x15fe5c(0x1c7)];console[_0x15fe5c(0x206)]('\x0a'+a31_0x1a65e1[_0x15fe5c(0x17f)](_0x15fe5c(0x18d))+'\x20'+_0x4fbf70),console[_0x15fe5c(0x206)]('─'[_0x15fe5c(0x1e5)](0x3c)),_0x3dca01[_0x15fe5c(0x1a9)]&&console[_0x15fe5c(0x206)](_0x3dca01[_0x15fe5c(0x1a9)]),console[_0x15fe5c(0x206)]('─'[_0x15fe5c(0x1e5)](0x3c));}const _0x27a919=_0x269e75['filter'](_0x707190=>!_0x707190[_0x15fe5c(0x1f6)]&&_0x707190[_0x15fe5c(0x1a9)]);if(_0x27a919[_0x15fe5c(0x1b6)]>0x0)for(const _0x395ff4 of _0x27a919){const _0x3b7905=_0x395ff4[_0x15fe5c(0x18c)]?_0x395ff4[_0x15fe5c(0x18c)]+'/'+_0x395ff4[_0x15fe5c(0x191)]['name']:_0x395ff4[_0x15fe5c(0x191)]['name'];console['error']('\x0a'+a31_0x1a65e1['yellow'](_0x15fe5c(0x17b))+'\x20'+_0x3b7905),console[_0x15fe5c(0x206)]('─'[_0x15fe5c(0x1e5)](0x3c)),console[_0x15fe5c(0x206)](_0x395ff4[_0x15fe5c(0x1a9)]),console[_0x15fe5c(0x206)]('─'['repeat'](0x3c));}if(_0x2c2e7f['length']>0x0)for(const _0xbe8165 of _0x2c2e7f){const _0x10188b=_0xbe8165['folderId']?_0x1ce742[_0x15fe5c(0x1ac)](_0xbe8165['folderId'])||'':'',_0x5bf7a4=_0x10188b?_0x10188b+'/'+_0xbe8165[_0x15fe5c(0x1a7)]:_0xbe8165['journeyBundleName'];console[_0x15fe5c(0x206)]('\x0a'+a31_0x1a65e1[_0x15fe5c(0x1e8)](_0x15fe5c(0x1ea))+'\x20'+_0x5bf7a4),console[_0x15fe5c(0x206)]('─'['repeat'](0x3c)),console[_0x15fe5c(0x206)](a31_0x1a65e1['red'](_0x15fe5c(0x196))),console[_0x15fe5c(0x206)]('─'[_0x15fe5c(0x1e5)](0x3c));}if(_0x422ad6[_0x15fe5c(0x1f3)])return console['error'](a31_0x1a65e1['yellow']('\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made')),0x0;const _0x442a38=_0x422ad6[_0x15fe5c(0x176)]?![]:_0x5c5729[_0x15fe5c(0x1b6)]>0x0||_0xc1e05e[_0x15fe5c(0x1b6)]>0x0||_0x575d00['length']>0x0,_0x577676=_0xf32274[_0x15fe5c(0x1b6)]>0x0||_0x975a7c[_0x15fe5c(0x1b6)]>0x0||_0x2c2e7f[_0x15fe5c(0x1b6)]>0x0,_0x1fbb3a=_0x422ad6[_0x15fe5c(0x176)]?![]:_0x3d09e5['length']>0x0,_0x3c8539=_0x4272b9[_0x15fe5c(0x1b6)]>0x0;if(!_0x442a38&&!_0x577676&&!_0x1fbb3a&&!_0x3c8539){const _0x216bdb=_0x422ad6[_0x15fe5c(0x176)]?'✔\x20All\x20journeys\x20are\x20up\x20to\x20date':'✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date';console[_0x15fe5c(0x206)](a31_0x1a65e1[_0x15fe5c(0x17f)](_0x216bdb));if(_0xd54682&&_0x4e925b[_0x15fe5c(0x1b6)]===0x1){const _0x245672=_0x4e925b[0x0];if(_0x245672[_0x15fe5c(0x1fb)]?.['id']){const _0x4775c3=getConsoleNextUrl(_0x422ad6[_0x15fe5c(0x1da)],_0x15fe5c(0x1c6)+_0xb30465+_0x15fe5c(0x1ef)+_0x245672[_0x15fe5c(0x1fb)]['id']+'/j/da/je');console[_0x15fe5c(0x206)]('\x20\x20'+a31_0x1a65e1['cyan'](_0x4775c3));}}return 0x0;}const _0x27da8e=_0x422ad6[_0x15fe5c(0x176)]?_0xf32274[_0x15fe5c(0x1b6)]+_0x975a7c[_0x15fe5c(0x1b6)]+_0x2c2e7f[_0x15fe5c(0x1b6)]+_0x4272b9['length']:_0x5c5729['length']+_0xc1e05e[_0x15fe5c(0x1b6)]+_0x575d00[_0x15fe5c(0x1b6)]+_0xf32274['length']+_0x975a7c['length']+_0x2c2e7f[_0x15fe5c(0x1b6)]+_0x4272b9[_0x15fe5c(0x1b6)]+_0x3d09e5['length'];if(!_0x422ad6[_0x15fe5c(0x1c5)]&&_0x27da8e>0x0){if(!isInteractive())return console[_0x15fe5c(0x206)](a31_0x1a65e1['red']('\x0aError:'),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x15fe5c(0x206)](a31_0x1a65e1[_0x15fe5c(0x1c8)](_0x15fe5c(0x1cc))),0x1;const _0x3996f7=await confirmKey(_0x15fe5c(0x17d)+_0x27da8e+_0x15fe5c(0x1c2));if(!_0x3996f7)return console[_0x15fe5c(0x206)](a31_0x1a65e1[_0x15fe5c(0x1c4)]('Aborted.')),0x1;}const _0x3ea388={'withProgress':async(_0x47ac5b,_0x26e91f)=>{const _0xe2e518=_0x15fe5c,_0x5b7363=await withSpinner(_0x47ac5b,_0x26e91f,{'verbose':_0x422ad6[_0xe2e518(0x1e2)]});return{'data':_0x5b7363['data']};},'logInfo':_0x5a8463=>console[_0x15fe5c(0x206)](a31_0x1a65e1['blue']('✔\x20'+_0x5a8463)),'logSuccess':_0x2815f2=>console[_0x15fe5c(0x206)](a31_0x1a65e1['green']('✔\x20'+_0x2815f2)),'logWarning':_0x53fafe=>console[_0x15fe5c(0x206)](a31_0x1a65e1[_0x15fe5c(0x1c4)]('⚠\x20'+_0x53fafe)),'logDeleted':_0x5b95f7=>console['error'](a31_0x1a65e1[_0x15fe5c(0x1e8)]('✔\x20'+_0x5b95f7))},_0x1db2da={'segment':_0x576f2d[_0x15fe5c(0x19a)],'journey':_0x576f2d[_0x15fe5c(0x1cb)],'user':_0x576f2d[_0x15fe5c(0x175)],'connection':_0x576f2d['connection']};_0x4272b9['length']>0x0&&(_0xd114e=await executePushFolders(_0x1db2da,_0x4272b9,_0xd114e,{'parentId':_0xb30465},_0x3ea388));const _0x68269e={'rootFolderId':_0x34dade,'folderPathToId':_0xd114e,'folderIdToPath':_0x1ce742,'segmentNameToId':_0x275b9a,'activationsBySegmentId':_0x16e2f5,'emailToIdMap':_0x572b7f,'idToEmailMap':_0x38bfad,'connectionNameToIdMap':_0xe652b1[_0x15fe5c(0x1d5)],'connectionIdToNameMap':_0xe652b1[_0x15fe5c(0x1b9)],'connectionNameToTypeMap':_0x548cef},_0xe7ddd=await executePushSegments(_0x1db2da,_0x422ad6['journeysOnly']?[]:_0x2fb2da,_0x68269e,{'parentId':_0xb30465},_0x3ea388),_0x3c2f16=_0xe7ddd[_0x15fe5c(0x18f)],_0x550a3b=_0xe7ddd[_0x15fe5c(0x195)],_0x30a8f0=_0xe7ddd[_0x15fe5c(0x1de)][_0x15fe5c(0x18f)],_0x10743f=_0xe7ddd['activations']['updated'],_0x5585a2=_0xe7ddd[_0x15fe5c(0x1de)][_0x15fe5c(0x177)],_0x29ec8d=await executePushSegmentDeletions(_0x1db2da,_0x422ad6[_0x15fe5c(0x176)]?[]:_0x575d00,_0x3ea388);let _0x4da51c=0x0,_0x3d500c=0x0,_0x4f231d=0x0;const _0x27e9b0=new Map(_0x275b9a);for(const [_0x27a4e4,_0x13dab8]of _0xe7ddd[_0x15fe5c(0x1bf)]){_0x27e9b0['set'](_0x27a4e4,_0x13dab8);}if(_0x269e75['length']>0x0){const _0x2aeea1={..._0x68269e,'segmentNameToId':_0x27e9b0,'existingSegments':_0x599cdf,'activationContext':_0x4a1e37},_0x3d2e52=await executePushJourneys(_0x1db2da,_0x269e75,_0x2aeea1,{'parentId':_0xb30465,'rootFolderId':_0x34dade,'verbose':_0x422ad6[_0x15fe5c(0x1e2)]},_0x3ea388);_0x4da51c=_0x3d2e52['created'],_0x3d500c=_0x3d2e52[_0x15fe5c(0x195)];if(_0xd54682&&_0x3d2e52['results'][_0x15fe5c(0x1b6)]===0x1){const _0x1e0786=_0x3d2e52['results'][0x0];if(_0x1e0786[_0x15fe5c(0x179)]){const _0xf02618=getConsoleNextUrl(_0x422ad6[_0x15fe5c(0x1da)],_0x15fe5c(0x1c6)+_0xb30465+'/e/'+_0x1e0786[_0x15fe5c(0x179)]+'/j/da/je');console['error']('\x20\x20'+a31_0x1a65e1[_0x15fe5c(0x1e6)](_0xf02618));}}}for(const _0x586ef1 of _0x2c2e7f){console['error'](a31_0x1a65e1[_0x15fe5c(0x1c4)](_0x15fe5c(0x1e1)+_0x586ef1[_0x15fe5c(0x1a7)])),_0x4f231d++;}const _0x33aa5f=[];if(_0x3c2f16>0x0)_0x33aa5f[_0x15fe5c(0x1be)](_0x3c2f16+_0x15fe5c(0x1f8));if(_0x550a3b>0x0)_0x33aa5f[_0x15fe5c(0x1be)](_0x550a3b+_0x15fe5c(0x1fc));if(_0x29ec8d>0x0)_0x33aa5f[_0x15fe5c(0x1be)](_0x29ec8d+_0x15fe5c(0x192));const _0x22bb54=[];if(_0x4da51c>0x0)_0x22bb54[_0x15fe5c(0x1be)](_0x4da51c+'\x20created');if(_0x3d500c>0x0)_0x22bb54[_0x15fe5c(0x1be)](_0x3d500c+_0x15fe5c(0x1fc));if(_0x4f231d>0x0)_0x22bb54[_0x15fe5c(0x1be)](_0x4f231d+_0x15fe5c(0x192));const _0x472489=[];if(_0x30a8f0>0x0)_0x472489[_0x15fe5c(0x1be)](_0x30a8f0+_0x15fe5c(0x1f8));if(_0x10743f>0x0)_0x472489[_0x15fe5c(0x1be)](_0x10743f+'\x20updated');if(_0x5585a2>0x0)_0x472489[_0x15fe5c(0x1be)](_0x5585a2+_0x15fe5c(0x192));return console[_0x15fe5c(0x206)](a31_0x1a65e1[_0x15fe5c(0x17f)](_0x15fe5c(0x1df))),_0x33aa5f['length']>0x0&&!_0x422ad6[_0x15fe5c(0x176)]&&console[_0x15fe5c(0x206)]('\x20\x20Segments:\x20'+_0x33aa5f['join'](',\x20')),_0x22bb54['length']>0x0&&console[_0x15fe5c(0x206)]('\x20\x20Journeys:\x20'+_0x22bb54['join'](',\x20')),_0x472489[_0x15fe5c(0x1b6)]>0x0&&!_0x422ad6[_0x15fe5c(0x176)]&&console[_0x15fe5c(0x206)](_0x15fe5c(0x200)+_0x472489[_0x15fe5c(0x197)](',\x20')),0x0;}}