@treasuredata/tdx 2026.3.23 → 2026.3.25

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 (203) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.js +1 -1
  5. package/dist/commands/activations.js +1 -1
  6. package/dist/commands/agent-command.js +1 -1
  7. package/dist/commands/agent-test-command.js +1 -1
  8. package/dist/commands/api-command.js +1 -1
  9. package/dist/commands/auth-command.js +1 -1
  10. package/dist/commands/auth-login-command.js +1 -1
  11. package/dist/commands/chat-command.js +1 -1
  12. package/dist/commands/claude-command.js +1 -1
  13. package/dist/commands/claude-statusline-command.js +1 -1
  14. package/dist/commands/claude-usage-command.js +1 -1
  15. package/dist/commands/command.js +1 -1
  16. package/dist/commands/connection-command.js +1 -1
  17. package/dist/commands/databases.js +1 -1
  18. package/dist/commands/delivery-command.js +1 -1
  19. package/dist/commands/describe.js +1 -1
  20. package/dist/commands/engage-campaign-pull-command.js +1 -1
  21. package/dist/commands/engage-campaign-push-command.js +1 -1
  22. package/dist/commands/engage-campaign-validate-command.js +1 -1
  23. package/dist/commands/engage-command.js +1 -1
  24. package/dist/commands/engage-template-pull-command.js +1 -1
  25. package/dist/commands/engage-template-push-command.js +1 -1
  26. package/dist/commands/engage-template-validate-command.js +1 -1
  27. package/dist/commands/job-command.js +1 -1
  28. package/dist/commands/journey-command.js +1 -1
  29. package/dist/commands/journey-validate-command.js +1 -1
  30. package/dist/commands/llm-command.js +1 -1
  31. package/dist/commands/mcp-command.js +1 -1
  32. package/dist/commands/parent-segment-command.js +1 -1
  33. package/dist/commands/policy-command.js +1 -1
  34. package/dist/commands/profile-command.js +1 -1
  35. package/dist/commands/profiles-command.js +1 -1
  36. package/dist/commands/query-command.js +1 -1
  37. package/dist/commands/schedule-command.js +1 -1
  38. package/dist/commands/segment-command.js +1 -1
  39. package/dist/commands/segment-create-command.js +1 -1
  40. package/dist/commands/segment-fields-command.js +1 -1
  41. package/dist/commands/segment-pull-command.js +1 -1
  42. package/dist/commands/segment-push-command.js +1 -1
  43. package/dist/commands/segment-update-command.js +1 -1
  44. package/dist/commands/segment-use-command.js +1 -1
  45. package/dist/commands/segment-validate-command.js +1 -1
  46. package/dist/commands/segments.js +1 -1
  47. package/dist/commands/show.js +1 -1
  48. package/dist/commands/status-command.js +1 -1
  49. package/dist/commands/tables.js +1 -1
  50. package/dist/commands/unset-command.js +1 -1
  51. package/dist/commands/upgrade-command.js +1 -1
  52. package/dist/commands/use-command.js +1 -1
  53. package/dist/commands/user-command.js +1 -1
  54. package/dist/commands/workflow-command.js +1 -1
  55. package/dist/core/auth.js +1 -1
  56. package/dist/core/command-output.js +1 -1
  57. package/dist/core/config.js +1 -1
  58. package/dist/core/connection-cache.js +1 -1
  59. package/dist/core/constants.js +1 -1
  60. package/dist/core/credential-cache.js +1 -1
  61. package/dist/core/global-context.js +1 -1
  62. package/dist/core/keychain.js +1 -1
  63. package/dist/core/oauth-keychain.js +1 -1
  64. package/dist/core/oauth.js +1 -1
  65. package/dist/core/profile.js +1 -1
  66. package/dist/core/project-config.js +1 -1
  67. package/dist/core/session.js +1 -1
  68. package/dist/core/user-cache.js +1 -1
  69. package/dist/core/version.js +1 -1
  70. package/dist/index.js +1 -1
  71. package/dist/mcp/server.js +1 -1
  72. package/dist/mcp/tools/index.js +1 -1
  73. package/dist/mcp/tools/tdx-run.js +1 -1
  74. package/dist/mcp/tools/tdx-search.js +1 -1
  75. package/dist/mcp/utils.js +1 -1
  76. package/dist/proxy/claude-usage-tracker.js +1 -1
  77. package/dist/proxy/passthrough-server.js +1 -1
  78. package/dist/proxy/sse-usage-parser.js +1 -1
  79. package/dist/sdk/agent/agent-config.js +1 -1
  80. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  81. package/dist/sdk/agent/agent-yaml.js +1 -1
  82. package/dist/sdk/agent/test/evaluator.js +1 -1
  83. package/dist/sdk/agent/test/executor.js +1 -1
  84. package/dist/sdk/agent/test/index.js +1 -1
  85. package/dist/sdk/agent/test/output.js +1 -1
  86. package/dist/sdk/agent/test/parser.js +1 -1
  87. package/dist/sdk/agent/tool-target-registry.js +1 -1
  88. package/dist/sdk/api.js +1 -1
  89. package/dist/sdk/client/cdp-api-client.js +1 -1
  90. package/dist/sdk/client/delivery-api-client.js +1 -1
  91. package/dist/sdk/client/endpoints.js +1 -1
  92. package/dist/sdk/client/engage-api-client.js +1 -1
  93. package/dist/sdk/client/http-client.js +1 -1
  94. package/dist/sdk/client/llm-api-client.js +1 -1
  95. package/dist/sdk/client/oauth-refresh.js +1 -1
  96. package/dist/sdk/client/rate-limiter.js +1 -1
  97. package/dist/sdk/client/td-api-client.js +1 -1
  98. package/dist/sdk/client/trino-api-client.js +1 -1
  99. package/dist/sdk/client/workflow-client.js +1 -1
  100. package/dist/sdk/connection-validator.js +1 -1
  101. package/dist/sdk/connection.js +1 -1
  102. package/dist/sdk/delivery.js +1 -1
  103. package/dist/sdk/engage/campaign-pull.js +1 -1
  104. package/dist/sdk/engage/campaign-push.js +1 -1
  105. package/dist/sdk/engage/campaign-validator.js +1 -1
  106. package/dist/sdk/engage/campaign-yaml.js +1 -1
  107. package/dist/sdk/engage/template-pull.js +1 -1
  108. package/dist/sdk/engage/template-push.js +1 -1
  109. package/dist/sdk/engage/template-validator.js +1 -1
  110. package/dist/sdk/engage/template-yaml.js +1 -1
  111. package/dist/sdk/engage/types/campaign-def.js +1 -1
  112. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  113. package/dist/sdk/engage/types/template-schema.js +1 -1
  114. package/dist/sdk/engage.js +1 -1
  115. package/dist/sdk/errors.js +1 -1
  116. package/dist/sdk/index.js +1 -1
  117. package/dist/sdk/io/index.js +1 -1
  118. package/dist/sdk/io/node-filesystem.js +1 -1
  119. package/dist/sdk/job.js +1 -1
  120. package/dist/sdk/journey.js +1 -1
  121. package/dist/sdk/llm/chat-cache.js +1 -1
  122. package/dist/sdk/llm/index.js +1 -1
  123. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  124. package/dist/sdk/llm/model-factors.js +1 -1
  125. package/dist/sdk/personalization.js +1 -1
  126. package/dist/sdk/policy.js +1 -1
  127. package/dist/sdk/query/index.js +1 -1
  128. package/dist/sdk/query/sql-parser.js +1 -1
  129. package/dist/sdk/realtime.js +1 -1
  130. package/dist/sdk/schedule.js +1 -1
  131. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  132. package/dist/sdk/segment/fields-display.js +1 -1
  133. package/dist/sdk/segment/file-discovery.js +1 -1
  134. package/dist/sdk/segment/journey-utils.js +1 -1
  135. package/dist/sdk/segment/journey-validator.js +1 -1
  136. package/dist/sdk/segment/journey-yaml.js +1 -1
  137. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  138. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  139. package/dist/sdk/segment/pull-workflow.js +1 -1
  140. package/dist/sdk/segment/push-recovery.js +1 -1
  141. package/dist/sdk/segment/push-workflow.js +1 -1
  142. package/dist/sdk/segment/resolution-context.js +1 -1
  143. package/dist/sdk/segment/segment-path-parser.js +1 -1
  144. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  145. package/dist/sdk/segment/segment-validator.js +1 -1
  146. package/dist/sdk/segment/target-resolution.js +1 -1
  147. package/dist/sdk/segment/tdx-config.js +1 -1
  148. package/dist/sdk/segment/types/activation-schema.js +1 -1
  149. package/dist/sdk/segment/types/journey-def.js +1 -1
  150. package/dist/sdk/segment/types/journey-schema.js +1 -1
  151. package/dist/sdk/segment/types/segment-def.js +1 -1
  152. package/dist/sdk/segment/types/segment-schema.js +1 -1
  153. package/dist/sdk/segment/validate-files.js +1 -1
  154. package/dist/sdk/segment/yaml-validator.js +1 -1
  155. package/dist/sdk/segment.js +1 -1
  156. package/dist/sdk/types/index.js +1 -1
  157. package/dist/sdk/types/progress.js +1 -1
  158. package/dist/sdk/user.js +1 -1
  159. package/dist/sdk/util/format-detector.js +1 -1
  160. package/dist/sdk/util/formatters.js +1 -1
  161. package/dist/sdk/util/index.js +1 -1
  162. package/dist/sdk/util/paginate.js +1 -1
  163. package/dist/sdk/util/tree-formatter.js +1 -1
  164. package/dist/sdk/workflow/archive-validation.js +1 -1
  165. package/dist/sdk/workflow/clone-workflow.js +1 -1
  166. package/dist/sdk/workflow/index.js +1 -1
  167. package/dist/sdk/workflow/pull-workflow.js +1 -1
  168. package/dist/sdk/workflow/push-workflow.js +1 -1
  169. package/dist/sdk/workflow/tdx-config.js +1 -1
  170. package/dist/sdk/workflow/workflow-utils.js +1 -1
  171. package/dist/test-utils/command-runner.js +1 -1
  172. package/dist/test-utils/factories.js +1 -1
  173. package/dist/test-utils/fixtures.js +1 -1
  174. package/dist/test-utils/http-mock.js +1 -1
  175. package/dist/test-utils/index.js +1 -1
  176. package/dist/utils/async.js +1 -1
  177. package/dist/utils/colors.js +1 -1
  178. package/dist/utils/diff.js +1 -1
  179. package/dist/utils/file-permissions.js +1 -1
  180. package/dist/utils/file-reader.js +1 -1
  181. package/dist/utils/github-releases.js +1 -1
  182. package/dist/utils/global-cache.js +1 -1
  183. package/dist/utils/json-loader.js +1 -1
  184. package/dist/utils/local-cache.js +1 -1
  185. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  186. package/dist/utils/logger/formatters/index.js +1 -1
  187. package/dist/utils/logger/handlers/console-handler.js +1 -1
  188. package/dist/utils/logger/handlers/file-handler.js +1 -1
  189. package/dist/utils/logger/handlers/index.js +1 -1
  190. package/dist/utils/logger/handlers/null-handler.js +1 -1
  191. package/dist/utils/logger/index.js +1 -1
  192. package/dist/utils/logger/logger.js +1 -1
  193. package/dist/utils/logger/types.js +1 -1
  194. package/dist/utils/option-validation.js +1 -1
  195. package/dist/utils/process.js +1 -1
  196. package/dist/utils/prompt.js +1 -1
  197. package/dist/utils/spinner.js +1 -1
  198. package/dist/utils/sse-parser.js +1 -1
  199. package/dist/utils/string-utils.js +1 -1
  200. package/dist/utils/table-ref-parser.js +1 -1
  201. package/dist/utils/tdx-logger.js +1 -1
  202. package/dist/utils/version-check.js +1 -1
  203. package/package.json +1 -1
@@ -1 +1 @@
1
- const a34_0x854774=a34_0x3445;(function(_0x3f280d,_0x47b49b){const _0x46e624=a34_0x3445,_0x4c3a07=_0x3f280d();while(!![]){try{const _0x39d130=parseInt(_0x46e624(0x131))/0x1+-parseInt(_0x46e624(0x13d))/0x2+-parseInt(_0x46e624(0x146))/0x3*(-parseInt(_0x46e624(0x12b))/0x4)+-parseInt(_0x46e624(0x128))/0x5+-parseInt(_0x46e624(0x143))/0x6*(-parseInt(_0x46e624(0x14a))/0x7)+parseInt(_0x46e624(0x13f))/0x8+-parseInt(_0x46e624(0x123))/0x9*(parseInt(_0x46e624(0x148))/0xa);if(_0x39d130===_0x47b49b)break;else _0x4c3a07['push'](_0x4c3a07['shift']());}catch(_0x5e4583){_0x4c3a07['push'](_0x4c3a07['shift']());}}}(a34_0x507b,0xd656c));function a34_0x3445(_0x16b99e,_0x49ece4){_0x16b99e=_0x16b99e-0x11b;const _0x507b07=a34_0x507b();let _0x34455c=_0x507b07[_0x16b99e];return _0x34455c;}import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleQueryOutput,formatQueryOutput,resolveOutputOptions}from'../core/command-output.js';import{readSqlStatementsFromFile,readSqlStatementsFromStdin,splitSqlStatements,isSqlFilePath}from'../sdk/query/sql-parser.js';function a34_0x507b(){const _0x15b577=['length','7mMDiPl','query','error','validate','Cannot\x20specify\x20both\x20SQL\x20argument\x20and\x20--file\x20option','message','\x20-\x20','database','execute','site','72stzGUs','\x20rows\x20','Schema:\x20','Statement\x20','jobId','500210gfTbyp','setExtra','description','60DqrSnW','verbose','Executing\x20query...','processedRows','totalSplits','completedSplits','641580UUadTd','information_schema','output','\x20splits','setJobId','Query\x20completed:\x20Processed\x20','args','elapsedTimeMillis','SQL:\x20','stats','Error:\x20','setPhase','2893270cDIHwE','options','9686000QhCNwO','file','join','\x0aAll\x20results\x20saved\x20to\x20','3056712iaYSQF','state','Executing\x20query\x20[','75351nrAWEw','Site:\x20','392410egfYuv'];a34_0x507b=function(){return _0x15b577;};return a34_0x507b();}import{writeFileSync}from'fs';import{withProgressSpinner,formatElapsed}from'../utils/spinner.js';import{formatRows}from'../sdk/util/formatters.js';export class QueryCommand extends BaseCommand{['name']=a34_0x854774(0x14b);[a34_0x854774(0x12a)]='Run\x20Trino\x20queries\x20(streaming)';async[a34_0x854774(0x121)](_0x25e8e){const _0xacdad1=a34_0x854774,{options:_0x3a772d,args:_0x45d8c5,tdx:_0x140cbd}=_0x25e8e,_0x1d8b11={..._0x3a772d,'limitStructuredFormats':!![]},_0x3c0bd5=_0x45d8c5[0x0],_0x44c341=_0x3a772d[_0xacdad1(0x140)];let _0x48189b;try{if(_0x44c341)_0x48189b=readSqlStatementsFromFile(_0x44c341);else{if(_0x3c0bd5==='-')_0x48189b=await readSqlStatementsFromStdin();else{if(_0x3c0bd5&&isSqlFilePath(_0x3c0bd5))_0x48189b=readSqlStatementsFromFile(_0x3c0bd5);else{if(_0x3c0bd5)_0x48189b=splitSqlStatements(_0x3c0bd5);else throw new Error('No\x20SQL\x20provided');}}}}catch(_0x113a77){return console[_0xacdad1(0x11b)](_0xacdad1(0x13b)+_0x113a77['message']),0x1;}const _0xd81a64=_0x3a772d[_0xacdad1(0x120)]||_0xacdad1(0x132),_0x227de8=_0x3a772d['catalog'];try{const _0x480440=[],_0x1bbfee=!!_0x3a772d['output'];for(let _0x41e84c=0x0;_0x41e84c<_0x48189b[_0xacdad1(0x149)];_0x41e84c++){const _0x41e99f=_0x48189b[_0x41e84c],_0x43bed0=_0x41e84c+0x1,_0x2145e9=_0x48189b['length'],_0x4f28dc=_0x2145e9>0x1;_0x3a772d[_0xacdad1(0x12c)]&&(console[_0xacdad1(0x11b)]('\x0a'+(_0x4f28dc?'Statement\x20'+_0x43bed0+'/'+_0x2145e9+':':'')),console[_0xacdad1(0x11b)](_0xacdad1(0x147)+_0x3a772d[_0xacdad1(0x122)]),console[_0xacdad1(0x11b)]('Catalog:\x20'+(_0x227de8||'td')),console[_0xacdad1(0x11b)](_0xacdad1(0x125)+_0xd81a64),console[_0xacdad1(0x11b)](_0xacdad1(0x139)+_0x41e99f));const _0x4d3e3f=_0x4f28dc?'Executing\x20statement\x20'+_0x43bed0+'/'+_0x2145e9+'...':_0xacdad1(0x12d);try{const _0xa746e0=await withProgressSpinner(_0x4d3e3f,async _0xe7bc66=>{const _0x7502b8=await _0x140cbd['query']['execute'](_0x41e99f,{'catalog':_0x227de8,'schema':_0xd81a64,'onJobId':_0x3a2d1f=>{const _0x28eee4=a34_0x3445;_0xe7bc66[_0x28eee4(0x135)](_0x3a2d1f);},'onProgress':_0x21b686=>{const _0x5212e3=a34_0x3445;_0xe7bc66[_0x5212e3(0x13c)](_0x5212e3(0x145)+_0x21b686[_0x5212e3(0x144)]+']'),_0xe7bc66[_0x5212e3(0x129)](formatRows(_0x21b686[_0x5212e3(0x12e)])+'\x20rows\x20'+_0x21b686[_0x5212e3(0x130)]+'/'+_0x21b686[_0x5212e3(0x12f)]+_0x5212e3(0x134));}});return _0x7502b8;},{'verbose':_0x3a772d[_0xacdad1(0x12c)]}),_0xdd2a7a=_0xa746e0['data'],_0x188c41=_0xdd2a7a[_0xacdad1(0x127)]?'\x20[Job\x20ID:\x20'+_0xdd2a7a[_0xacdad1(0x127)]+']':'',_0x4e4aca=_0x4f28dc?_0xacdad1(0x126)+_0x43bed0+'/'+_0x2145e9+_0xacdad1(0x11f):'';console['error']('✔\x20'+_0x4e4aca+_0xacdad1(0x136)+formatRows(_0xdd2a7a[_0xacdad1(0x13a)][_0xacdad1(0x12e)])+_0xacdad1(0x124)+('in\x20'+formatElapsed(_0xdd2a7a[_0xacdad1(0x13a)][_0xacdad1(0x138)])+_0x188c41));if(_0x4f28dc&&_0x1bbfee){const _0x4073e5=resolveOutputOptions(_0x1d8b11),_0x3324d5=await formatQueryOutput(_0xdd2a7a,_0x4073e5);_0x480440['push'](_0x3324d5);}else await handleQueryOutput(_0xdd2a7a,_0x1d8b11);}catch(_0x4bb646){const _0x30a9bd=_0x4f28dc?_0xacdad1(0x126)+_0x43bed0+'/'+_0x2145e9+':\x0a':'',_0x4470e8=_0x4bb646 instanceof SDKError?_0x4bb646['originalMessage']:_0x4bb646[_0xacdad1(0x11e)];return console[_0xacdad1(0x11b)](''+_0x30a9bd+_0x4470e8),0x1;}}if(_0x48189b['length']>0x1&&_0x1bbfee&&_0x480440['length']>0x0){const _0x540110=_0x480440[_0xacdad1(0x141)]('\x0a');writeFileSync(_0x3a772d[_0xacdad1(0x133)],_0x540110),console[_0xacdad1(0x11b)](_0xacdad1(0x142)+_0x3a772d[_0xacdad1(0x133)]);}return 0x0;}catch(_0x5959f9){throw _0x5959f9;}}[a34_0x854774(0x11c)](_0x30f1b6){const _0x5ab84d=a34_0x854774,_0x2b4f6e=_0x30f1b6[_0x5ab84d(0x137)][0x0],_0x46001f=_0x30f1b6[_0x5ab84d(0x13e)][_0x5ab84d(0x140)];if(!_0x2b4f6e&&!_0x46001f)return'Usage:\x20tdx\x20query\x20\x22SELECT\x20*\x20FROM\x20table\x22\x0a\x20\x20\x20or:\x20tdx\x20query\x20query.sql\x0a\x20\x20\x20or:\x20echo\x20\x22SELECT\x201\x22\x20|\x20tdx\x20query\x20-\x0a\x0aRun\x20\x27tdx\x20query\x20--help\x27\x20for\x20more\x20options';if(_0x2b4f6e&&_0x46001f)return _0x5ab84d(0x11d);return undefined;}}
1
+ const a34_0x16f7ea=a34_0x3f3d;(function(_0x4389d8,_0x36cfe7){const _0x192d32=a34_0x3f3d,_0x2938f8=_0x4389d8();while(!![]){try{const _0x11af85=parseInt(_0x192d32(0x1b0))/0x1+parseInt(_0x192d32(0x1a3))/0x2*(-parseInt(_0x192d32(0x1a2))/0x3)+parseInt(_0x192d32(0x1a5))/0x4*(-parseInt(_0x192d32(0x17f))/0x5)+-parseInt(_0x192d32(0x18f))/0x6*(parseInt(_0x192d32(0x185))/0x7)+-parseInt(_0x192d32(0x198))/0x8*(-parseInt(_0x192d32(0x19a))/0x9)+parseInt(_0x192d32(0x1aa))/0xa+-parseInt(_0x192d32(0x1b3))/0xb*(parseInt(_0x192d32(0x194))/0xc);if(_0x11af85===_0x36cfe7)break;else _0x2938f8['push'](_0x2938f8['shift']());}catch(_0x12f15c){_0x2938f8['push'](_0x2938f8['shift']());}}}(a34_0x54ce,0xd0489));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleQueryOutput,formatQueryOutput,resolveOutputOptions}from'../core/command-output.js';function a34_0x3f3d(_0x430bba,_0xe077f4){_0x430bba=_0x430bba-0x17e;const _0x54ce3f=a34_0x54ce();let _0x3f3da4=_0x54ce3f[_0x430bba];return _0x3f3da4;}import{readSqlStatementsFromFile,readSqlStatementsFromStdin,splitSqlStatements,isSqlFilePath}from'../sdk/query/sql-parser.js';import{writeFileSync}from'fs';import{withProgressSpinner,formatElapsed}from'../utils/spinner.js';function a34_0x54ce(){const _0x9e6e5f=['in\x20','execute','1161202KoIKGf','\x20rows\x20','Cannot\x20specify\x20both\x20SQL\x20argument\x20and\x20--file\x20option','11AVEUFd','query','\x0aAll\x20results\x20saved\x20to\x20','No\x20SQL\x20provided','args','754405zhUuGN','Executing\x20query\x20[','totalSplits','completedSplits','validate','Executing\x20query...','154KjaJPL','stats','database','processedRows','error','Usage:\x20tdx\x20query\x20\x22SELECT\x20*\x20FROM\x20table\x22\x0a\x20\x20\x20or:\x20tdx\x20query\x20query.sql\x0a\x20\x20\x20or:\x20echo\x20\x22SELECT\x201\x22\x20|\x20tdx\x20query\x20-\x0a\x0aRun\x20\x27tdx\x20query\x20--help\x27\x20for\x20more\x20options','Error:\x20','name','information_schema','Statement\x20','251514fSdUiZ','output','jobId','setExtra','SQL:\x20','2645652VbhtYh','\x20[Job\x20ID:\x20','Run\x20Trino\x20queries\x20(streaming)','elapsedTimeMillis','64VjCXUf','setPhase','1643283htKyyQ','Query\x20completed:\x20Processed\x20','description','join','file','...','setJobId','Catalog:\x20','21gXqWnU','174332HaeRYN','length','4TEjQRN','state','message','push','data','1349630mVGbIh','originalMessage','verbose','Executing\x20statement\x20'];a34_0x54ce=function(){return _0x9e6e5f;};return a34_0x54ce();}import{formatRows}from'../sdk/util/formatters.js';export class QueryCommand extends BaseCommand{[a34_0x16f7ea(0x18c)]=a34_0x16f7ea(0x1b4);[a34_0x16f7ea(0x19c)]=a34_0x16f7ea(0x196);async[a34_0x16f7ea(0x1af)](_0x1c2774){const _0x51b748=a34_0x16f7ea,{options:_0x518900,args:_0x3b75bc,tdx:_0x568802}=_0x1c2774,_0x2fbb92={..._0x518900,'limitStructuredFormats':!![]},_0x18b833=_0x3b75bc[0x0],_0x19a503=_0x518900['file'];let _0x5df2ee;try{if(_0x19a503)_0x5df2ee=readSqlStatementsFromFile(_0x19a503);else{if(_0x18b833==='-')_0x5df2ee=await readSqlStatementsFromStdin();else{if(_0x18b833&&isSqlFilePath(_0x18b833))_0x5df2ee=readSqlStatementsFromFile(_0x18b833);else{if(_0x18b833)_0x5df2ee=splitSqlStatements(_0x18b833);else throw new Error(_0x51b748(0x1b6));}}}}catch(_0x56bb4a){return console[_0x51b748(0x189)](_0x51b748(0x18b)+_0x56bb4a[_0x51b748(0x1a7)]),0x1;}const _0x297abe=_0x518900[_0x51b748(0x187)]||_0x51b748(0x18d),_0x5244e7=_0x518900['catalog'];try{const _0x2d71a2=[],_0x20e8bf=!!_0x518900[_0x51b748(0x190)];for(let _0x2344a7=0x0;_0x2344a7<_0x5df2ee[_0x51b748(0x1a4)];_0x2344a7++){const _0x34be80=_0x5df2ee[_0x2344a7],_0x2e4582=_0x2344a7+0x1,_0xa4a6ab=_0x5df2ee['length'],_0x3f1ac4=_0xa4a6ab>0x1;_0x518900[_0x51b748(0x1ac)]&&(console[_0x51b748(0x189)]('\x0a'+(_0x3f1ac4?_0x51b748(0x18e)+_0x2e4582+'/'+_0xa4a6ab+':':'')),console[_0x51b748(0x189)]('Site:\x20'+_0x518900['site']),console[_0x51b748(0x189)](_0x51b748(0x1a1)+(_0x5244e7||'td')),console[_0x51b748(0x189)]('Schema:\x20'+_0x297abe),console[_0x51b748(0x189)](_0x51b748(0x193)+_0x34be80));const _0x163021=_0x3f1ac4?_0x51b748(0x1ad)+_0x2e4582+'/'+_0xa4a6ab+_0x51b748(0x19f):_0x51b748(0x184);try{const _0x34c6af=await withProgressSpinner(_0x163021,async _0x4a33ec=>{const _0x331834=_0x51b748,_0xc91282=await _0x568802[_0x331834(0x1b4)][_0x331834(0x1af)](_0x34be80,{'catalog':_0x5244e7,'schema':_0x297abe,'onJobId':_0x2b47b2=>{const _0x181402=_0x331834;_0x4a33ec[_0x181402(0x1a0)](_0x2b47b2);},'onProgress':_0x46a999=>{const _0x5d3509=_0x331834;_0x4a33ec[_0x5d3509(0x199)](_0x5d3509(0x180)+_0x46a999[_0x5d3509(0x1a6)]+']'),_0x4a33ec[_0x5d3509(0x192)](formatRows(_0x46a999[_0x5d3509(0x188)])+_0x5d3509(0x1b1)+_0x46a999[_0x5d3509(0x182)]+'/'+_0x46a999[_0x5d3509(0x181)]+'\x20splits');}});return _0xc91282;},{'verbose':_0x518900[_0x51b748(0x1ac)]}),_0x808de2=_0x34c6af[_0x51b748(0x1a9)],_0x31e953=_0x808de2[_0x51b748(0x191)]?_0x51b748(0x195)+_0x808de2[_0x51b748(0x191)]+']':'',_0x29a1b7=_0x3f1ac4?'Statement\x20'+_0x2e4582+'/'+_0xa4a6ab+'\x20-\x20':'';console['error']('✔\x20'+_0x29a1b7+_0x51b748(0x19b)+formatRows(_0x808de2[_0x51b748(0x186)][_0x51b748(0x188)])+_0x51b748(0x1b1)+(_0x51b748(0x1ae)+formatElapsed(_0x808de2[_0x51b748(0x186)][_0x51b748(0x197)])+_0x31e953));if(_0x3f1ac4&&_0x20e8bf){const _0x22fc31=resolveOutputOptions(_0x2fbb92),_0xb5fbf1=await formatQueryOutput(_0x808de2,_0x22fc31);_0x2d71a2[_0x51b748(0x1a8)](_0xb5fbf1);}else await handleQueryOutput(_0x808de2,_0x2fbb92);}catch(_0x493989){const _0x688b1b=_0x3f1ac4?_0x51b748(0x18e)+_0x2e4582+'/'+_0xa4a6ab+':\x0a':'',_0x5129a9=_0x493989 instanceof SDKError?_0x493989[_0x51b748(0x1ab)]:_0x493989[_0x51b748(0x1a7)];return console[_0x51b748(0x189)](''+_0x688b1b+_0x5129a9),0x1;}}if(_0x5df2ee[_0x51b748(0x1a4)]>0x1&&_0x20e8bf&&_0x2d71a2['length']>0x0){const _0x1b5e0c=_0x2d71a2[_0x51b748(0x19d)]('\x0a');writeFileSync(_0x518900[_0x51b748(0x190)],_0x1b5e0c),console[_0x51b748(0x189)](_0x51b748(0x1b5)+_0x518900[_0x51b748(0x190)]);}return 0x0;}catch(_0x4fafaf){throw _0x4fafaf;}}[a34_0x16f7ea(0x183)](_0x4b3bd6){const _0x498395=a34_0x16f7ea,_0x5e938c=_0x4b3bd6[_0x498395(0x17e)][0x0],_0x1f8241=_0x4b3bd6['options'][_0x498395(0x19e)];if(!_0x5e938c&&!_0x1f8241)return _0x498395(0x18a);if(_0x5e938c&&_0x1f8241)return _0x498395(0x1b2);return undefined;}}
@@ -1 +1 @@
1
- const a35_0x18fe06=a35_0x5189;(function(_0x509a18,_0x1646e6){const _0x5b08fe=a35_0x5189,_0x413f20=_0x509a18();while(!![]){try{const _0x4b633f=-parseInt(_0x5b08fe(0x113))/0x1*(-parseInt(_0x5b08fe(0x139))/0x2)+-parseInt(_0x5b08fe(0xce))/0x3+-parseInt(_0x5b08fe(0x140))/0x4*(parseInt(_0x5b08fe(0x108))/0x5)+parseInt(_0x5b08fe(0xfc))/0x6*(parseInt(_0x5b08fe(0x13b))/0x7)+parseInt(_0x5b08fe(0x10c))/0x8+parseInt(_0x5b08fe(0xcf))/0x9*(-parseInt(_0x5b08fe(0xe3))/0xa)+-parseInt(_0x5b08fe(0xd8))/0xb;if(_0x4b633f===_0x1646e6)break;else _0x413f20['push'](_0x413f20['shift']());}catch(_0x51f0bc){_0x413f20['push'](_0x413f20['shift']());}}}(a35_0x3d47,0x7b39e));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput,writeOutput}from'../core/command-output.js';function a35_0x3d47(){const _0x1a301d=['27268YTJgBd','Show\x20schedule\x20execution\x20history','jobs','Getting\x20schedule\x20details...','schedule:run','schedule:update','Found\x20','schedule:create','run','limit','\x20\x20→\x20','just\x20now','Showing\x20first\x20','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20run\x20<name>\x20[--time\x20<iso8601>]\x20[--num\x20<1-10>]','Schedule\x20updated:\x20','nextRun','create','Updating\x20schedule:\x20','ies','type','error','engineVersion','yes','status','Listing\x20scheduled\x20queries...','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20delete\x20<name>','toLocaleDateString','abs','Creating\x20schedule...','\x20\x20Database:\x20','timezone','validate','time_zone','1071882depdWX','18FMpOUk','schedule:show','description','No\x20scheduled\x20queries\x20found','\x20created','query','statusIcon','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20update\x20<name>\x20[options]','output','5749986TyTHNG','...','\x20matching\x20\x22','priority','\x20\x20Cron:\x20','h\x20ago','retryLimit','has_next_page','Schedule\x20deleted:\x20','\x20(showing\x20','join','2273900LpoYfH','\x20\x20Timezone:\x20','Schedule\x20run\x20submitted:\x20','name','Run\x20a\x20scheduled\x20query\x20immediately','job_id','file','next_run_at','Cancelled','Failed\x20to\x20read\x20file:\x20','user','trim','max','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20create\x20<name>\x20-d\x20<db>\x20--file\x20<path>\x20[options]','d\x20ago','schedule:history','options','format','cron','schedules','show','Query\x20file\x20is\x20empty','update','delay','/app/queries/editor?queryId=','36cgyaqC','listQueries','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20history\x20<name>\x20[--from\x20<n>]\x20[--to\x20<n>]','last_job','success','delete','Getting\x20schedule\x20history...','red','\x20scheduled\x20quer','round','Running\x20schedule:\x20','args','15uqkToH','At\x20least\x20one\x20option\x20must\x20be\x20provided\x20to\x20update','table','schedule:delete','4898928LvCWYN','list','Schedule\x20created:\x20','from','count','length','m\x20ago','3fsJPmF','pagination','end_at','database','history','\x20(use\x20--limit\x20to\x20see\x20more)','getTime','verbose','green','(unnamed)','keys','executing_user_id','site','\x20schedules','in\x20','num','📅\x20','never','engine_version','INVALID_ARGUMENT','Update\x20a\x20scheduled\x20query','lastRun','created_at','\x22...','start_at','soon','execute','entries','map','repeat','padEnd','data','dim','\x20job','Show\x20schedule\x20details','result','\x20\x20Type:\x20','queries','313594IpYlCJ','ended_at','906766gqWYpk','retry_limit','user_name','utf-8','tsv'];a35_0x3d47=function(){return _0x1a301d;};return a35_0x3d47();}import{withSpinner}from'../utils/spinner.js';import{confirm}from'../utils/prompt.js';import{readFileSync}from'fs';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{hyperlink}from'../sdk/util/formatters.js';import a35_0x33fcc0 from'chalk';function formatRelativeTime(_0x58cd59){const _0x47ba88=a35_0x5189,_0x4f5706=new Date(_0x58cd59),_0x4ab25e=new Date(),_0x3a96a4=_0x4f5706[_0x47ba88(0x119)]()-_0x4ab25e[_0x47ba88(0x119)](),_0x49a153=Math[_0x47ba88(0xc8)](_0x3a96a4)/0x3e8,_0xe48698=_0x3a96a4<0x0;if(_0x49a153<0x3c)return _0xe48698?_0x47ba88(0x14b):_0x47ba88(0x12c);else{if(_0x49a153<0xe10){const _0x10ce9d=Math['round'](_0x49a153/0x3c);return _0xe48698?_0x10ce9d+_0x47ba88(0x112):_0x47ba88(0x121)+_0x10ce9d+'m';}else{if(_0x49a153<0x15180){const _0x20bb3a=Math[_0x47ba88(0x105)](_0x49a153/0xe10);return _0xe48698?_0x20bb3a+_0x47ba88(0xdd):_0x47ba88(0x121)+_0x20bb3a+'h';}else{if(_0x49a153<0x93a80){const _0xbabdfa=Math['round'](_0x49a153/0x15180);return _0xe48698?_0xbabdfa+_0x47ba88(0xf1):_0x47ba88(0x121)+_0xbabdfa+'d';}else return _0x4f5706[_0x47ba88(0xc7)]();}}}}export class ScheduleListCommand extends BaseCommand{['name']='schedule:list';[a35_0x18fe06(0xd1)]='List\x20scheduled\x20queries';async['execute'](_0xb93212){const _0x365156=a35_0x18fe06,{options:_0x3dbbb1,args:_0x59ea55,tdx:_0x1e99cd}=_0xb93212,_0x5114fe=resolveLimit(_0x3dbbb1[_0x365156(0x149)],DEFAULT_DISPLAY_LIMIT),_0x4a2fb6=_0x59ea55[0x0],_0x3f3da0=_0x4a2fb6?'Searching\x20scheduled\x20queries\x20matching\x20\x22'+_0x4a2fb6+_0x365156(0x12a):_0x365156(0xc5),_0x116bc6=await withSpinner(_0x3f3da0,()=>_0x1e99cd[_0x365156(0xf6)][_0x365156(0xfd)]({'limit':_0x5114fe,'scheduled':!![],'pattern':_0x4a2fb6}),{'verbose':_0x3dbbb1[_0x365156(0x11a)]}),_0x47c542=_0x116bc6['data'][_0x365156(0x138)],_0x1e4e7a=_0x116bc6[_0x365156(0x132)][_0x365156(0x114)][_0x365156(0xdf)],_0x5968b3=_0x4a2fb6?_0x365156(0xda)+_0x4a2fb6+'\x22':'';_0x1e4e7a?console['error'](_0x365156(0x14c)+_0x47c542['length']+_0x365156(0x120)+_0x5968b3+_0x365156(0x118)):console['error']('Found\x20'+_0x47c542[_0x365156(0x111)]+_0x365156(0x104)+(_0x47c542[_0x365156(0x111)]!==0x1?_0x365156(0x152):'y')+_0x5968b3);if(_0x3dbbb1['format']==='json'||_0x3dbbb1[_0x365156(0xf4)]==='jsonl'||_0x3dbbb1[_0x365156(0xf4)]===_0x365156(0x10a)||_0x3dbbb1[_0x365156(0xf4)]===_0x365156(0x13f)){const _0x11dde9=_0x47c542[_0x365156(0x12f)](_0x42c6e2=>({'id':_0x42c6e2['id'],'name':_0x42c6e2[_0x365156(0xe6)],'cron':_0x42c6e2['cron'],'database':_0x42c6e2[_0x365156(0x116)]?.[_0x365156(0xe6)],'type':_0x42c6e2['type'],'timezone':_0x42c6e2[_0x365156(0xcd)],'user_name':_0x42c6e2[_0x365156(0xed)]?.[_0x365156(0xe6)],'updated_at':_0x42c6e2['updated_at'],'next_run_at':_0x42c6e2['next_run_at'],'last_job_status':_0x42c6e2[_0x365156(0xff)]?.['status']}));await handleSDKOutput(_0x11dde9,_0x3dbbb1);}else{if(_0x47c542[_0x365156(0x111)]===0x0)console['log'](_0x365156(0xd2));else{const _0x51e300=_0x3dbbb1[_0x365156(0x11f)],_0x10137e=_0x47c542[_0x365156(0x12f)](_0x598b30=>{const _0x3a62e9=_0x365156,_0x20466d=_0x598b30[_0x3a62e9(0xff)]?.[_0x3a62e9(0xc4)]?_0x598b30[_0x3a62e9(0xff)]['status']===_0x3a62e9(0x100)?'✓':'✗':'-',_0x3d9896=_0x598b30['last_job']?.[_0x3a62e9(0x13a)]?formatRelativeTime(_0x598b30[_0x3a62e9(0xff)]['ended_at']):_0x3a62e9(0x124),_0x446ea7=_0x598b30[_0x3a62e9(0xea)]?formatRelativeTime(_0x598b30[_0x3a62e9(0xea)]):'-',_0xde96b6=_0x598b30[_0x3a62e9(0xf5)]||'',_0x406127=_0x598b30[_0x3a62e9(0xe6)]||_0x3a62e9(0x11c),_0x2e220e=getConsoleUrl(_0x51e300,_0x3a62e9(0xfb)+_0x598b30['id']);return{'statusIcon':_0x20466d,'lastRun':_0x3d9896,'nextRun':_0x446ea7,'cron':_0xde96b6,'name':_0x406127,'queryUrl':_0x2e220e,'status':_0x598b30[_0x3a62e9(0xff)]?.[_0x3a62e9(0xc4)]};}),_0x4704eb=Math[_0x365156(0xef)](..._0x10137e[_0x365156(0x12f)](_0x3684f8=>_0x3684f8[_0x365156(0x128)][_0x365156(0x111)])),_0x808d5d=Math['max'](..._0x10137e[_0x365156(0x12f)](_0x2936c4=>_0x2936c4[_0x365156(0x14f)][_0x365156(0x111)])),_0x5d584c=Math[_0x365156(0xef)](..._0x10137e['map'](_0x261497=>_0x261497[_0x365156(0xf5)]['length'])),_0x325936=_0x10137e[_0x365156(0x12f)](_0x26f10f=>{const _0xf444d5=_0x365156,_0x17053b=_0x26f10f[_0xf444d5(0xc4)]===_0xf444d5(0x100)?a35_0x33fcc0[_0xf444d5(0x11b)](_0x26f10f['statusIcon']):_0x26f10f[_0xf444d5(0xc4)]===_0xf444d5(0x154)?a35_0x33fcc0[_0xf444d5(0x103)](_0x26f10f['statusIcon']):a35_0x33fcc0[_0xf444d5(0x133)](_0x26f10f[_0xf444d5(0xd5)]),_0x2d3cfb=_0x26f10f[_0xf444d5(0x128)][_0xf444d5(0x131)](_0x4704eb),_0x4de3f1=_0x26f10f[_0xf444d5(0x14f)][_0xf444d5(0x131)](_0x808d5d),_0x483edf=_0x26f10f[_0xf444d5(0xf5)]?a35_0x33fcc0['cyan'](_0x26f10f[_0xf444d5(0xf5)][_0xf444d5(0x131)](_0x5d584c)):'\x20'[_0xf444d5(0x130)](_0x5d584c),_0x3a3a1d=hyperlink(_0x26f10f[_0xf444d5(0xe6)],_0x26f10f['queryUrl']);return _0xf444d5(0x123)+_0x17053b+'\x20'+_0x2d3cfb+_0xf444d5(0x14a)+_0x4de3f1+'\x20\x20'+_0x483edf+'\x20\x20'+_0x3a3a1d;});await writeOutput(_0x325936[_0x365156(0xe2)]('\x0a'),_0x3dbbb1[_0x365156(0xd7)],_0x365156(0x10d));}}return 0x0;}}function a35_0x5189(_0x55b9b0,_0x5d8a11){_0x55b9b0=_0x55b9b0-0xc3;const _0x3d4711=a35_0x3d47();let _0x518968=_0x3d4711[_0x55b9b0];return _0x518968;}export class ScheduleShowCommand extends BaseCommand{[a35_0x18fe06(0xe6)]=a35_0x18fe06(0xd0);['description']=a35_0x18fe06(0x135);[a35_0x18fe06(0xcc)](_0xb5928){const _0x23057a=a35_0x18fe06,_0x2c4bbb=_0xb5928[_0x23057a(0x107)][0x0];if(!_0x2c4bbb)return'Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20show\x20<name>';return undefined;}async['execute'](_0x34399b){const _0x3b3fb0=a35_0x18fe06,{options:_0x13e611,args:_0x50ad35,tdx:_0x435646}=_0x34399b,_0x2e2287=_0x50ad35[0x0],_0x28372f=await withSpinner(_0x3b3fb0(0x143),()=>_0x435646[_0x3b3fb0(0xf6)][_0x3b3fb0(0xf7)](_0x2e2287),{'verbose':_0x13e611[_0x3b3fb0(0x11a)]}),_0x295f5b=_0x28372f[_0x3b3fb0(0x132)],_0x2e2763={'name':_0x295f5b[_0x3b3fb0(0xe6)],'cron':_0x295f5b['cron'],'database':_0x295f5b[_0x3b3fb0(0x116)],'type':_0x295f5b[_0x3b3fb0(0x153)],'timezone':_0x295f5b[_0x3b3fb0(0xcb)],'user_name':_0x295f5b[_0x3b3fb0(0x13d)],'created_at':_0x295f5b[_0x3b3fb0(0x129)],'engine_version':_0x295f5b['engine_version'],'executing_user_id':_0x295f5b[_0x3b3fb0(0x11e)],'query':_0x295f5b[_0x3b3fb0(0xd4)],'delay':_0x295f5b[_0x3b3fb0(0xfa)],'priority':_0x295f5b[_0x3b3fb0(0xdb)],'retry_limit':_0x295f5b['retry_limit'],..._0x295f5b['result']&&{'result':_0x295f5b[_0x3b3fb0(0x136)]}};return await handleSingleObjectOutput(_0x2e2763,_0x13e611),0x0;}}export class ScheduleCreateCommand extends BaseCommand{[a35_0x18fe06(0xe6)]=a35_0x18fe06(0x147);['description']='Create\x20a\x20scheduled\x20query';[a35_0x18fe06(0xcc)](_0x30f109){const _0x393e15=a35_0x18fe06,_0x21ac1a=_0x30f109[_0x393e15(0x107)][0x0];if(!_0x21ac1a)return _0x393e15(0xf0);const _0x35589b=_0x30f109[_0x393e15(0xf3)];if(!_0x35589b[_0x393e15(0x116)])return'Database\x20is\x20required\x0aUsage:\x20job\x20schedule\x20create\x20<name>\x20-d\x20<db>\x20--file\x20<path>\x20[options]';return undefined;}async[a35_0x18fe06(0x12d)](_0x546c7a){const _0x1d79d2=a35_0x18fe06,{options:_0x48414a,args:_0x3cb4a0,tdx:_0x2cee2a}=_0x546c7a,_0x3e5d5a=_0x3cb4a0[0x0],_0xf33146=_0x48414a,_0x4e9203=_0xf33146[_0x1d79d2(0x116)],_0x218974=_0xf33146[_0x1d79d2(0xe9)],_0x1a4d78=_0xf33146['type']||'trino';let _0x23b7ad;try{_0x23b7ad=readFileSync(_0x218974,'utf-8')[_0x1d79d2(0xee)]();}catch(_0x4f7800){throw new SDKError(ErrorCode[_0x1d79d2(0x126)],_0x1d79d2(0xec)+_0x218974,_0x4f7800 instanceof Error?_0x4f7800:undefined);}if(!_0x23b7ad)throw new SDKError(ErrorCode[_0x1d79d2(0x126)],_0x1d79d2(0xf8));const _0x1987a6={'database':_0x4e9203,'query':_0x23b7ad,'type':_0x1a4d78};if(_0xf33146['cron'])_0x1987a6[_0x1d79d2(0xf5)]=_0xf33146['cron'];if(_0xf33146[_0x1d79d2(0xcb)])_0x1987a6['timezone']=_0xf33146[_0x1d79d2(0xcb)];if(_0xf33146['delay']!==undefined)_0x1987a6['delay']=Number(_0xf33146[_0x1d79d2(0xfa)]);if(_0xf33146[_0x1d79d2(0xdb)]!==undefined)_0x1987a6[_0x1d79d2(0xdb)]=Number(_0xf33146[_0x1d79d2(0xdb)]);if(_0xf33146[_0x1d79d2(0xde)]!==undefined)_0x1987a6[_0x1d79d2(0x13c)]=Number(_0xf33146[_0x1d79d2(0xde)]);if(_0xf33146['engineVersion'])_0x1987a6[_0x1d79d2(0x125)]=_0xf33146[_0x1d79d2(0x155)];if(_0xf33146['result'])_0x1987a6['result']=_0xf33146[_0x1d79d2(0x136)];if(_0x48414a[_0x1d79d2(0x11a)]){console[_0x1d79d2(0x154)]('Creating\x20schedule:\x20'+_0x3e5d5a),console[_0x1d79d2(0x154)](_0x1d79d2(0xca)+_0x4e9203),console['error'](_0x1d79d2(0x137)+_0x1a4d78);if(_0x1987a6['cron'])console['error'](_0x1d79d2(0xdc)+_0x1987a6[_0x1d79d2(0xf5)]);if(_0x1987a6[_0x1d79d2(0xcb)])console[_0x1d79d2(0x154)](_0x1d79d2(0xe4)+_0x1987a6['timezone']);}const _0x12f347=await withSpinner(_0x1d79d2(0xc9),()=>_0x2cee2a[_0x1d79d2(0xf6)][_0x1d79d2(0x150)](_0x3e5d5a,_0x1987a6),{'verbose':_0x48414a[_0x1d79d2(0x11a)]});return console[_0x1d79d2(0x154)](_0x1d79d2(0x10e)+_0x12f347[_0x1d79d2(0x132)][_0x1d79d2(0xe6)]),await handleSingleObjectOutput(_0x12f347[_0x1d79d2(0x132)],_0x48414a),0x0;}}export class ScheduleUpdateCommand extends BaseCommand{[a35_0x18fe06(0xe6)]=a35_0x18fe06(0x145);[a35_0x18fe06(0xd1)]=a35_0x18fe06(0x127);[a35_0x18fe06(0xcc)](_0x5e766f){const _0x41535a=a35_0x18fe06,_0x2bdb18=_0x5e766f['args'][0x0];if(!_0x2bdb18)return _0x41535a(0xd6);return undefined;}async[a35_0x18fe06(0x12d)](_0x5b3162){const _0x30bcb2=a35_0x18fe06,{options:_0x5f2fa5,args:_0x4c883e,tdx:_0x3c02e0}=_0x5b3162,_0x139121=_0x4c883e[0x0],_0x2c3abc=_0x5f2fa5,_0x28bb37={};if(_0x2c3abc['database'])_0x28bb37[_0x30bcb2(0x116)]=_0x2c3abc['database'];if(_0x2c3abc[_0x30bcb2(0x153)])_0x28bb37['type']=_0x2c3abc[_0x30bcb2(0x153)];if(_0x2c3abc[_0x30bcb2(0xf5)])_0x28bb37[_0x30bcb2(0xf5)]=_0x2c3abc[_0x30bcb2(0xf5)];if(_0x2c3abc[_0x30bcb2(0xcb)])_0x28bb37[_0x30bcb2(0xcb)]=_0x2c3abc[_0x30bcb2(0xcb)];if(_0x2c3abc[_0x30bcb2(0xfa)]!==undefined)_0x28bb37[_0x30bcb2(0xfa)]=Number(_0x2c3abc['delay']);if(_0x2c3abc[_0x30bcb2(0xdb)]!==undefined)_0x28bb37['priority']=Number(_0x2c3abc['priority']);if(_0x2c3abc[_0x30bcb2(0xde)]!==undefined)_0x28bb37[_0x30bcb2(0x13c)]=Number(_0x2c3abc[_0x30bcb2(0xde)]);if(_0x2c3abc['engineVersion'])_0x28bb37[_0x30bcb2(0x125)]=_0x2c3abc['engineVersion'];if(_0x2c3abc[_0x30bcb2(0x136)])_0x28bb37[_0x30bcb2(0x136)]=_0x2c3abc[_0x30bcb2(0x136)];if(_0x2c3abc['file'])try{_0x28bb37[_0x30bcb2(0xd4)]=readFileSync(_0x2c3abc[_0x30bcb2(0xe9)],_0x30bcb2(0x13e))[_0x30bcb2(0xee)]();}catch(_0x58aaa4){throw new SDKError(ErrorCode[_0x30bcb2(0x126)],_0x30bcb2(0xec)+_0x2c3abc[_0x30bcb2(0xe9)],_0x58aaa4 instanceof Error?_0x58aaa4:undefined);}if(Object[_0x30bcb2(0x11d)](_0x28bb37)[_0x30bcb2(0x111)]===0x0)throw new SDKError(ErrorCode[_0x30bcb2(0x126)],_0x30bcb2(0x109));if(_0x5f2fa5['verbose']){console[_0x30bcb2(0x154)](_0x30bcb2(0x151)+_0x139121);for(const [_0x36003f,_0x2ecd2b]of Object[_0x30bcb2(0x12e)](_0x28bb37)){_0x36003f===_0x30bcb2(0xd4)?console['error']('\x20\x20'+_0x36003f+':\x20'+_0x2ecd2b['substring'](0x0,0x32)+_0x30bcb2(0xd9)):console[_0x30bcb2(0x154)]('\x20\x20'+_0x36003f+':\x20'+_0x2ecd2b);}}const _0xc7f752=await withSpinner('Updating\x20schedule...',()=>_0x3c02e0[_0x30bcb2(0xf6)][_0x30bcb2(0xf9)](_0x139121,_0x28bb37),{'verbose':_0x5f2fa5[_0x30bcb2(0x11a)]});return console[_0x30bcb2(0x154)](_0x30bcb2(0x14e)+_0xc7f752[_0x30bcb2(0x132)][_0x30bcb2(0xe6)]),await handleSingleObjectOutput(_0xc7f752[_0x30bcb2(0x132)],_0x5f2fa5),0x0;}}export class ScheduleDeleteCommand extends BaseCommand{[a35_0x18fe06(0xe6)]=a35_0x18fe06(0x10b);['description']='Delete\x20a\x20scheduled\x20query';[a35_0x18fe06(0xcc)](_0xa4c81e){const _0x15b94b=a35_0x18fe06,_0x27f092=_0xa4c81e['args'][0x0];if(!_0x27f092)return _0x15b94b(0xc6);return undefined;}async[a35_0x18fe06(0x12d)](_0x51d68a){const _0x439ea1=a35_0x18fe06,{options:_0x6e50f2,args:_0x12b7a2,tdx:_0x1bf886}=_0x51d68a,_0x505417=_0x12b7a2[0x0];if(!_0x6e50f2[_0x439ea1(0xc3)]){const _0x2550af=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20schedule\x20\x22'+_0x505417+'\x22?');if(!_0x2550af)return console[_0x439ea1(0x154)](_0x439ea1(0xeb)),0x0;}const _0x559efb=await withSpinner('Deleting\x20schedule...',()=>_0x1bf886[_0x439ea1(0xf6)][_0x439ea1(0x101)](_0x505417),{'verbose':_0x6e50f2[_0x439ea1(0x11a)]});return console[_0x439ea1(0x154)](_0x439ea1(0xe0)+_0x559efb[_0x439ea1(0x132)][_0x439ea1(0xe6)]),0x0;}}export class ScheduleRunCommand extends BaseCommand{[a35_0x18fe06(0xe6)]=a35_0x18fe06(0x144);[a35_0x18fe06(0xd1)]=a35_0x18fe06(0xe7);['validate'](_0x2c7b89){const _0x59a159=a35_0x18fe06,_0x1da660=_0x2c7b89[_0x59a159(0x107)][0x0];if(!_0x1da660)return _0x59a159(0x14d);return undefined;}async[a35_0x18fe06(0x12d)](_0x39d79d){const _0xd72eaa=a35_0x18fe06,{options:_0x1e6795,args:_0x44f9db,tdx:_0x280bcc}=_0x39d79d,_0x2dbbe1=_0x44f9db[0x0],_0x50d2b0=_0x1e6795,_0x36b561=_0x50d2b0['time'],_0x37e2b6=_0x50d2b0[_0xd72eaa(0x122)]!==undefined?Number(_0x50d2b0[_0xd72eaa(0x122)]):undefined;if(_0x1e6795[_0xd72eaa(0x11a)]){console[_0xd72eaa(0x154)](_0xd72eaa(0x106)+_0x2dbbe1);if(_0x36b561)console['error']('\x20\x20Time:\x20'+_0x36b561);if(_0x37e2b6)console[_0xd72eaa(0x154)]('\x20\x20Num:\x20'+_0x37e2b6);}const _0x5144ee=await withSpinner('Running\x20schedule...',()=>_0x280bcc[_0xd72eaa(0xf6)][_0xd72eaa(0x148)](_0x2dbbe1,{'time':_0x36b561,'num':_0x37e2b6}),{'verbose':_0x1e6795[_0xd72eaa(0x11a)]}),_0x138bf5=_0x5144ee[_0xd72eaa(0x132)][_0xd72eaa(0x142)];console[_0xd72eaa(0x154)](_0xd72eaa(0xe5)+_0x138bf5['length']+_0xd72eaa(0x134)+(_0x138bf5[_0xd72eaa(0x111)]!==0x1?'s':'')+_0xd72eaa(0xd3));for(const _0x4282c8 of _0x138bf5){console[_0xd72eaa(0x154)]('\x20\x20Job\x20ID:\x20'+_0x4282c8[_0xd72eaa(0xe8)]);}return await handleSDKOutput(_0x138bf5,_0x1e6795),0x0;}}export class ScheduleHistoryCommand extends BaseCommand{[a35_0x18fe06(0xe6)]=a35_0x18fe06(0xf2);[a35_0x18fe06(0xd1)]=a35_0x18fe06(0x141);[a35_0x18fe06(0xcc)](_0x22dc68){const _0xbb0157=a35_0x18fe06,_0x4fa879=_0x22dc68[_0xbb0157(0x107)][0x0];if(!_0x4fa879)return _0xbb0157(0xfe);return undefined;}async[a35_0x18fe06(0x12d)](_0x71ec50){const _0x23b701=a35_0x18fe06,{options:_0x360640,args:_0x20f54a,tdx:_0x46a7fd}=_0x71ec50,_0x4f8ec3=_0x20f54a[0x0],_0x154682=_0x360640,_0x327658=_0x154682[_0x23b701(0x10f)]!==undefined?Number(_0x154682[_0x23b701(0x10f)]):undefined,_0x35d270=_0x154682['to']!==undefined?Number(_0x154682['to']):undefined,_0x527d0c=await withSpinner(_0x23b701(0x102),()=>_0x46a7fd['schedules'][_0x23b701(0x117)](_0x4f8ec3,{'from':_0x327658,'to':_0x35d270}),{'verbose':_0x360640[_0x23b701(0x11a)]}),_0x4e6c96=_0x527d0c[_0x23b701(0x132)];console[_0x23b701(0x154)](_0x23b701(0x146)+_0x4e6c96['count']+'\x20execution'+(_0x4e6c96[_0x23b701(0x110)]!==0x1?'s':'')+_0x23b701(0xe1)+_0x4e6c96[_0x23b701(0x10f)]+'-'+_0x4e6c96['to']+')');const _0x17dd2b=_0x4e6c96[_0x23b701(0x117)][_0x23b701(0x12f)](_0x506fba=>({'job_id':_0x506fba[_0x23b701(0xe8)],'type':_0x506fba[_0x23b701(0x153)],'status':_0x506fba[_0x23b701(0xc4)],'scheduled_at':_0x506fba['scheduled_at'],'created_at':_0x506fba[_0x23b701(0x129)],'start_at':_0x506fba[_0x23b701(0x12b)],'end_at':_0x506fba[_0x23b701(0x115)]}));return await handleSDKOutput(_0x17dd2b,_0x360640),0x0;}}
1
+ const a35_0x1ec585=a35_0x26c2;(function(_0x56c62b,_0x270498){const _0x11c6c9=a35_0x26c2,_0x512e84=_0x56c62b();while(!![]){try{const _0x9115f0=parseInt(_0x11c6c9(0xe5))/0x1+parseInt(_0x11c6c9(0xcf))/0x2*(parseInt(_0x11c6c9(0xaf))/0x3)+-parseInt(_0x11c6c9(0xd2))/0x4+parseInt(_0x11c6c9(0xe2))/0x5+parseInt(_0x11c6c9(0x80))/0x6+-parseInt(_0x11c6c9(0xeb))/0x7+-parseInt(_0x11c6c9(0xb1))/0x8;if(_0x9115f0===_0x270498)break;else _0x512e84['push'](_0x512e84['shift']());}catch(_0x3de4d0){_0x512e84['push'](_0x512e84['shift']());}}}(a35_0x27aa,0x429be));import{BaseCommand}from'./command.js';function a35_0x26c2(_0x24a689,_0x220184){_0x24a689=_0x24a689-0x65;const _0x27aa62=a35_0x27aa();let _0x26c238=_0x27aa62[_0x24a689];return _0x26c238;}function a35_0x27aa(){const _0x3e6df4=['Getting\x20schedule\x20details...','has_next_page','List\x20scheduled\x20queries','job_id','success','queries','Create\x20a\x20scheduled\x20query','type','length','retryLimit','Getting\x20schedule\x20history...','join','2022560xFzegX','num','Schedule\x20run\x20submitted:\x20','404219DKTdiy','verbose','user','timezone','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20update\x20<name>\x20[options]','args','2986249QBhOFJ','priority','table','format','count','ended_at','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20run\x20<name>\x20[--time\x20<iso8601>]\x20[--num\x20<1-10>]','Delete\x20a\x20scheduled\x20query','engine_version','lastRun','history','red','last_job','never','Creating\x20schedule:\x20','time','...','end_at','show','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20create\x20<name>\x20-d\x20<db>\x20--file\x20<path>\x20[options]','options','create','Listing\x20scheduled\x20queries...','trino','Update\x20a\x20scheduled\x20query','Searching\x20scheduled\x20queries\x20matching\x20\x22','query','file','in\x20','cron','padEnd','1214364zHzwbU','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20show\x20<name>','tsv','soon','schedule:update','delete','Schedule\x20updated:\x20','nextRun','Updating\x20schedule...','substring','next_run_at','Show\x20schedule\x20details','engineVersion','scheduled_at','\x20\x20→\x20','run','updated_at','Updating\x20schedule:\x20','result','max','INVALID_ARGUMENT','from','Running\x20schedule...','No\x20scheduled\x20queries\x20found','/app/queries/editor?queryId=','status','Failed\x20to\x20read\x20file:\x20','statusIcon','execute','database','delay','green','\x22...','jobs','user_name','schedule:create','repeat','limit','name','Running\x20schedule:\x20','map','dim','retry_limit','schedules','validate','queryUrl','\x20scheduled\x20quer','3dUiCUx','At\x20least\x20one\x20option\x20must\x20be\x20provided\x20to\x20update','1272224iMcXYS','Schedule\x20deleted:\x20','\x20(showing\x20','\x20matching\x20\x22','log','pagination','created_at','h\x20ago','time_zone','Cancelled','keys','Schedule\x20created:\x20','yes','(unnamed)','utf-8','data','Showing\x20first\x20','jsonl','\x20created','Query\x20file\x20is\x20empty','\x20\x20Job\x20ID:\x20','schedule:run','Creating\x20schedule...','d\x20ago','error','\x20\x20Num:\x20','\x20\x20Database:\x20','site','round','getTime','258058tWFuzU','Found\x20','description','1126756lKLafg','schedule:list','📅\x20','\x20job'];a35_0x27aa=function(){return _0x3e6df4;};return a35_0x27aa();}import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput,writeOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{confirm}from'../utils/prompt.js';import{readFileSync}from'fs';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{hyperlink}from'../sdk/util/formatters.js';import a35_0x263868 from'chalk';function formatRelativeTime(_0x4b2ea3){const _0x5c4ed0=a35_0x26c2,_0x2273ab=new Date(_0x4b2ea3),_0x2d75ca=new Date(),_0x4f6f41=_0x2273ab[_0x5c4ed0(0xce)]()-_0x2d75ca['getTime'](),_0x54976c=Math['abs'](_0x4f6f41)/0x3e8,_0xda2f25=_0x4f6f41<0x0;if(_0x54976c<0x3c)return _0xda2f25?'just\x20now':_0x5c4ed0(0x83);else{if(_0x54976c<0xe10){const _0x4022ce=Math[_0x5c4ed0(0xcd)](_0x54976c/0x3c);return _0xda2f25?_0x4022ce+'m\x20ago':_0x5c4ed0(0x7d)+_0x4022ce+'m';}else{if(_0x54976c<0x15180){const _0x47279a=Math[_0x5c4ed0(0xcd)](_0x54976c/0xe10);return _0xda2f25?_0x47279a+_0x5c4ed0(0xb8):'in\x20'+_0x47279a+'h';}else{if(_0x54976c<0x93a80){const _0x3e6846=Math[_0x5c4ed0(0xcd)](_0x54976c/0x15180);return _0xda2f25?_0x3e6846+_0x5c4ed0(0xc8):_0x5c4ed0(0x7d)+_0x3e6846+'d';}else return _0x2273ab['toLocaleDateString']();}}}}export class ScheduleListCommand extends BaseCommand{['name']=a35_0x1ec585(0xd3);[a35_0x1ec585(0xd1)]=a35_0x1ec585(0xd8);async[a35_0x1ec585(0x9c)](_0x209d3a){const _0x118f33=a35_0x1ec585,{options:_0x1da2ef,args:_0x5d94eb,tdx:_0x47ce65}=_0x209d3a,_0x511a30=resolveLimit(_0x1da2ef[_0x118f33(0xa5)],DEFAULT_DISPLAY_LIMIT),_0x159dd4=_0x5d94eb[0x0],_0xc92e13=_0x159dd4?_0x118f33(0x7a)+_0x159dd4+_0x118f33(0xa0):_0x118f33(0x77),_0x1829af=await withSpinner(_0xc92e13,()=>_0x47ce65[_0x118f33(0xab)]['listQueries']({'limit':_0x511a30,'scheduled':!![],'pattern':_0x159dd4}),{'verbose':_0x1da2ef[_0x118f33(0xe6)]}),_0x33cc64=_0x1829af[_0x118f33(0xc0)][_0x118f33(0xdb)],_0x327f95=_0x1829af[_0x118f33(0xc0)][_0x118f33(0xb6)][_0x118f33(0xd7)],_0x329a31=_0x159dd4?_0x118f33(0xb4)+_0x159dd4+'\x22':'';_0x327f95?console[_0x118f33(0xc9)](_0x118f33(0xc1)+_0x33cc64['length']+'\x20schedules'+_0x329a31+'\x20(use\x20--limit\x20to\x20see\x20more)'):console[_0x118f33(0xc9)](_0x118f33(0xd0)+_0x33cc64[_0x118f33(0xde)]+_0x118f33(0xae)+(_0x33cc64['length']!==0x1?'ies':'y')+_0x329a31);if(_0x1da2ef[_0x118f33(0xee)]==='json'||_0x1da2ef[_0x118f33(0xee)]===_0x118f33(0xc2)||_0x1da2ef['format']===_0x118f33(0xed)||_0x1da2ef[_0x118f33(0xee)]===_0x118f33(0x82)){const _0x281898=_0x33cc64[_0x118f33(0xa8)](_0x81e069=>({'id':_0x81e069['id'],'name':_0x81e069[_0x118f33(0xa6)],'cron':_0x81e069[_0x118f33(0x7e)],'database':_0x81e069['database']?.['name'],'type':_0x81e069['type'],'timezone':_0x81e069[_0x118f33(0xb9)],'user_name':_0x81e069[_0x118f33(0xe7)]?.[_0x118f33(0xa6)],'updated_at':_0x81e069[_0x118f33(0x90)],'next_run_at':_0x81e069[_0x118f33(0x8a)],'last_job_status':_0x81e069[_0x118f33(0x6d)]?.[_0x118f33(0x99)]}));await handleSDKOutput(_0x281898,_0x1da2ef);}else{if(_0x33cc64['length']===0x0)console[_0x118f33(0xb5)](_0x118f33(0x97));else{const _0x1e0af7=_0x1da2ef[_0x118f33(0xcc)],_0xaff628=_0x33cc64[_0x118f33(0xa8)](_0x1bc16d=>{const _0x1878de=_0x118f33,_0x205238=_0x1bc16d[_0x1878de(0x6d)]?.[_0x1878de(0x99)]?_0x1bc16d[_0x1878de(0x6d)][_0x1878de(0x99)]===_0x1878de(0xda)?'✓':'✗':'-',_0x44f8e3=_0x1bc16d[_0x1878de(0x6d)]?.[_0x1878de(0x66)]?formatRelativeTime(_0x1bc16d['last_job'][_0x1878de(0x66)]):_0x1878de(0x6e),_0xc0c6ca=_0x1bc16d[_0x1878de(0x8a)]?formatRelativeTime(_0x1bc16d[_0x1878de(0x8a)]):'-',_0x76107d=_0x1bc16d['cron']||'',_0xc90771=_0x1bc16d[_0x1878de(0xa6)]||_0x1878de(0xbe),_0x466f9f=getConsoleUrl(_0x1e0af7,_0x1878de(0x98)+_0x1bc16d['id']);return{'statusIcon':_0x205238,'lastRun':_0x44f8e3,'nextRun':_0xc0c6ca,'cron':_0x76107d,'name':_0xc90771,'queryUrl':_0x466f9f,'status':_0x1bc16d[_0x1878de(0x6d)]?.[_0x1878de(0x99)]};}),_0x30853b=Math[_0x118f33(0x93)](..._0xaff628['map'](_0x40a4dc=>_0x40a4dc[_0x118f33(0x6a)][_0x118f33(0xde)])),_0x181902=Math[_0x118f33(0x93)](..._0xaff628[_0x118f33(0xa8)](_0x377289=>_0x377289[_0x118f33(0x87)][_0x118f33(0xde)])),_0x102fd0=Math[_0x118f33(0x93)](..._0xaff628[_0x118f33(0xa8)](_0x31e09a=>_0x31e09a['cron'][_0x118f33(0xde)])),_0x19672c=_0xaff628[_0x118f33(0xa8)](_0x17b3d8=>{const _0x1376be=_0x118f33,_0x358fc4=_0x17b3d8[_0x1376be(0x99)]===_0x1376be(0xda)?a35_0x263868[_0x1376be(0x9f)](_0x17b3d8[_0x1376be(0x9b)]):_0x17b3d8['status']===_0x1376be(0xc9)?a35_0x263868[_0x1376be(0x6c)](_0x17b3d8[_0x1376be(0x9b)]):a35_0x263868[_0x1376be(0xa9)](_0x17b3d8[_0x1376be(0x9b)]),_0x29dbb6=_0x17b3d8[_0x1376be(0x6a)][_0x1376be(0x7f)](_0x30853b),_0x462360=_0x17b3d8['nextRun'][_0x1376be(0x7f)](_0x181902),_0x1a14a7=_0x17b3d8['cron']?a35_0x263868['cyan'](_0x17b3d8[_0x1376be(0x7e)][_0x1376be(0x7f)](_0x102fd0)):'\x20'[_0x1376be(0xa4)](_0x102fd0),_0x3f3398=hyperlink(_0x17b3d8[_0x1376be(0xa6)],_0x17b3d8[_0x1376be(0xad)]);return _0x1376be(0xd4)+_0x358fc4+'\x20'+_0x29dbb6+_0x1376be(0x8e)+_0x462360+'\x20\x20'+_0x1a14a7+'\x20\x20'+_0x3f3398;});await writeOutput(_0x19672c[_0x118f33(0xe1)]('\x0a'),_0x1da2ef['output'],'list');}}return 0x0;}}export class ScheduleShowCommand extends BaseCommand{['name']='schedule:show';[a35_0x1ec585(0xd1)]=a35_0x1ec585(0x8b);[a35_0x1ec585(0xac)](_0x56b8b3){const _0x22822d=a35_0x1ec585,_0x1b91c9=_0x56b8b3[_0x22822d(0xea)][0x0];if(!_0x1b91c9)return _0x22822d(0x81);return undefined;}async[a35_0x1ec585(0x9c)](_0x517d59){const _0x3458aa=a35_0x1ec585,{options:_0x4a86ae,args:_0x124ea6,tdx:_0x5c7cce}=_0x517d59,_0x483ae5=_0x124ea6[0x0],_0x381a71=await withSpinner(_0x3458aa(0xd6),()=>_0x5c7cce[_0x3458aa(0xab)][_0x3458aa(0x73)](_0x483ae5),{'verbose':_0x4a86ae[_0x3458aa(0xe6)]}),_0x4621ad=_0x381a71['data'],_0xbb45f6={'name':_0x4621ad[_0x3458aa(0xa6)],'cron':_0x4621ad[_0x3458aa(0x7e)],'database':_0x4621ad[_0x3458aa(0x9d)],'type':_0x4621ad['type'],'timezone':_0x4621ad[_0x3458aa(0xe8)],'user_name':_0x4621ad[_0x3458aa(0xa2)],'created_at':_0x4621ad[_0x3458aa(0xb7)],'engine_version':_0x4621ad['engine_version'],'executing_user_id':_0x4621ad['executing_user_id'],'query':_0x4621ad[_0x3458aa(0x7b)],'delay':_0x4621ad['delay'],'priority':_0x4621ad[_0x3458aa(0xec)],'retry_limit':_0x4621ad[_0x3458aa(0xaa)],..._0x4621ad['result']&&{'result':_0x4621ad['result']}};return await handleSingleObjectOutput(_0xbb45f6,_0x4a86ae),0x0;}}export class ScheduleCreateCommand extends BaseCommand{[a35_0x1ec585(0xa6)]=a35_0x1ec585(0xa3);[a35_0x1ec585(0xd1)]=a35_0x1ec585(0xdc);[a35_0x1ec585(0xac)](_0x2e9717){const _0x3185a7=a35_0x1ec585,_0x18cf42=_0x2e9717[_0x3185a7(0xea)][0x0];if(!_0x18cf42)return _0x3185a7(0x74);const _0x17adeb=_0x2e9717[_0x3185a7(0x75)];if(!_0x17adeb[_0x3185a7(0x9d)])return'Database\x20is\x20required\x0aUsage:\x20job\x20schedule\x20create\x20<name>\x20-d\x20<db>\x20--file\x20<path>\x20[options]';return undefined;}async[a35_0x1ec585(0x9c)](_0x4bb4cd){const _0x5b14f6=a35_0x1ec585,{options:_0x123a75,args:_0x3efc40,tdx:_0x22fd71}=_0x4bb4cd,_0xa71f1c=_0x3efc40[0x0],_0x1c0fdb=_0x123a75,_0x2061ba=_0x1c0fdb['database'],_0x581124=_0x1c0fdb[_0x5b14f6(0x7c)],_0x66d754=_0x1c0fdb[_0x5b14f6(0xdd)]||_0x5b14f6(0x78);let _0x155ef2;try{_0x155ef2=readFileSync(_0x581124,_0x5b14f6(0xbf))['trim']();}catch(_0x4b7b2d){throw new SDKError(ErrorCode[_0x5b14f6(0x94)],_0x5b14f6(0x9a)+_0x581124,_0x4b7b2d instanceof Error?_0x4b7b2d:undefined);}if(!_0x155ef2)throw new SDKError(ErrorCode[_0x5b14f6(0x94)],_0x5b14f6(0xc4));const _0x4a37d7={'database':_0x2061ba,'query':_0x155ef2,'type':_0x66d754};if(_0x1c0fdb[_0x5b14f6(0x7e)])_0x4a37d7['cron']=_0x1c0fdb[_0x5b14f6(0x7e)];if(_0x1c0fdb[_0x5b14f6(0xe8)])_0x4a37d7[_0x5b14f6(0xe8)]=_0x1c0fdb[_0x5b14f6(0xe8)];if(_0x1c0fdb['delay']!==undefined)_0x4a37d7[_0x5b14f6(0x9e)]=Number(_0x1c0fdb['delay']);if(_0x1c0fdb[_0x5b14f6(0xec)]!==undefined)_0x4a37d7[_0x5b14f6(0xec)]=Number(_0x1c0fdb[_0x5b14f6(0xec)]);if(_0x1c0fdb[_0x5b14f6(0xdf)]!==undefined)_0x4a37d7[_0x5b14f6(0xaa)]=Number(_0x1c0fdb[_0x5b14f6(0xdf)]);if(_0x1c0fdb['engineVersion'])_0x4a37d7[_0x5b14f6(0x69)]=_0x1c0fdb['engineVersion'];if(_0x1c0fdb[_0x5b14f6(0x92)])_0x4a37d7[_0x5b14f6(0x92)]=_0x1c0fdb['result'];if(_0x123a75['verbose']){console['error'](_0x5b14f6(0x6f)+_0xa71f1c),console['error'](_0x5b14f6(0xcb)+_0x2061ba),console['error']('\x20\x20Type:\x20'+_0x66d754);if(_0x4a37d7[_0x5b14f6(0x7e)])console[_0x5b14f6(0xc9)]('\x20\x20Cron:\x20'+_0x4a37d7[_0x5b14f6(0x7e)]);if(_0x4a37d7[_0x5b14f6(0xe8)])console[_0x5b14f6(0xc9)]('\x20\x20Timezone:\x20'+_0x4a37d7['timezone']);}const _0x2f9e99=await withSpinner(_0x5b14f6(0xc7),()=>_0x22fd71[_0x5b14f6(0xab)][_0x5b14f6(0x76)](_0xa71f1c,_0x4a37d7),{'verbose':_0x123a75[_0x5b14f6(0xe6)]});return console[_0x5b14f6(0xc9)](_0x5b14f6(0xbc)+_0x2f9e99[_0x5b14f6(0xc0)][_0x5b14f6(0xa6)]),await handleSingleObjectOutput(_0x2f9e99[_0x5b14f6(0xc0)],_0x123a75),0x0;}}export class ScheduleUpdateCommand extends BaseCommand{['name']=a35_0x1ec585(0x84);['description']=a35_0x1ec585(0x79);[a35_0x1ec585(0xac)](_0x4df4c4){const _0x4baab1=a35_0x1ec585,_0x52d7cf=_0x4df4c4[_0x4baab1(0xea)][0x0];if(!_0x52d7cf)return _0x4baab1(0xe9);return undefined;}async[a35_0x1ec585(0x9c)](_0x103ba6){const _0x1a80ee=a35_0x1ec585,{options:_0x5b8b2d,args:_0x595e5d,tdx:_0x37f692}=_0x103ba6,_0x54c16b=_0x595e5d[0x0],_0x1b768e=_0x5b8b2d,_0x84e2ea={};if(_0x1b768e[_0x1a80ee(0x9d)])_0x84e2ea[_0x1a80ee(0x9d)]=_0x1b768e[_0x1a80ee(0x9d)];if(_0x1b768e[_0x1a80ee(0xdd)])_0x84e2ea[_0x1a80ee(0xdd)]=_0x1b768e[_0x1a80ee(0xdd)];if(_0x1b768e[_0x1a80ee(0x7e)])_0x84e2ea['cron']=_0x1b768e[_0x1a80ee(0x7e)];if(_0x1b768e['timezone'])_0x84e2ea[_0x1a80ee(0xe8)]=_0x1b768e['timezone'];if(_0x1b768e[_0x1a80ee(0x9e)]!==undefined)_0x84e2ea[_0x1a80ee(0x9e)]=Number(_0x1b768e[_0x1a80ee(0x9e)]);if(_0x1b768e[_0x1a80ee(0xec)]!==undefined)_0x84e2ea['priority']=Number(_0x1b768e[_0x1a80ee(0xec)]);if(_0x1b768e[_0x1a80ee(0xdf)]!==undefined)_0x84e2ea['retry_limit']=Number(_0x1b768e[_0x1a80ee(0xdf)]);if(_0x1b768e[_0x1a80ee(0x8c)])_0x84e2ea[_0x1a80ee(0x69)]=_0x1b768e['engineVersion'];if(_0x1b768e[_0x1a80ee(0x92)])_0x84e2ea[_0x1a80ee(0x92)]=_0x1b768e[_0x1a80ee(0x92)];if(_0x1b768e[_0x1a80ee(0x7c)])try{_0x84e2ea[_0x1a80ee(0x7b)]=readFileSync(_0x1b768e['file'],'utf-8')['trim']();}catch(_0x4cd70f){throw new SDKError(ErrorCode[_0x1a80ee(0x94)],_0x1a80ee(0x9a)+_0x1b768e['file'],_0x4cd70f instanceof Error?_0x4cd70f:undefined);}if(Object[_0x1a80ee(0xbb)](_0x84e2ea)['length']===0x0)throw new SDKError(ErrorCode[_0x1a80ee(0x94)],_0x1a80ee(0xb0));if(_0x5b8b2d[_0x1a80ee(0xe6)]){console[_0x1a80ee(0xc9)](_0x1a80ee(0x91)+_0x54c16b);for(const [_0xcdb87c,_0x37f9a5]of Object['entries'](_0x84e2ea)){_0xcdb87c===_0x1a80ee(0x7b)?console[_0x1a80ee(0xc9)]('\x20\x20'+_0xcdb87c+':\x20'+_0x37f9a5[_0x1a80ee(0x89)](0x0,0x32)+_0x1a80ee(0x71)):console[_0x1a80ee(0xc9)]('\x20\x20'+_0xcdb87c+':\x20'+_0x37f9a5);}}const _0x199ec0=await withSpinner(_0x1a80ee(0x88),()=>_0x37f692[_0x1a80ee(0xab)]['update'](_0x54c16b,_0x84e2ea),{'verbose':_0x5b8b2d['verbose']});return console[_0x1a80ee(0xc9)](_0x1a80ee(0x86)+_0x199ec0[_0x1a80ee(0xc0)][_0x1a80ee(0xa6)]),await handleSingleObjectOutput(_0x199ec0[_0x1a80ee(0xc0)],_0x5b8b2d),0x0;}}export class ScheduleDeleteCommand extends BaseCommand{[a35_0x1ec585(0xa6)]='schedule:delete';[a35_0x1ec585(0xd1)]=a35_0x1ec585(0x68);[a35_0x1ec585(0xac)](_0x524316){const _0xd4b8=a35_0x1ec585,_0x37da68=_0x524316[_0xd4b8(0xea)][0x0];if(!_0x37da68)return'Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20delete\x20<name>';return undefined;}async[a35_0x1ec585(0x9c)](_0x119b8b){const _0x30c20f=a35_0x1ec585,{options:_0x55e17a,args:_0x407786,tdx:_0x2b00f0}=_0x119b8b,_0x534b96=_0x407786[0x0];if(!_0x55e17a[_0x30c20f(0xbd)]){const _0x1757ed=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20schedule\x20\x22'+_0x534b96+'\x22?');if(!_0x1757ed)return console[_0x30c20f(0xc9)](_0x30c20f(0xba)),0x0;}const _0x898aa=await withSpinner('Deleting\x20schedule...',()=>_0x2b00f0[_0x30c20f(0xab)][_0x30c20f(0x85)](_0x534b96),{'verbose':_0x55e17a[_0x30c20f(0xe6)]});return console[_0x30c20f(0xc9)](_0x30c20f(0xb2)+_0x898aa[_0x30c20f(0xc0)][_0x30c20f(0xa6)]),0x0;}}export class ScheduleRunCommand extends BaseCommand{[a35_0x1ec585(0xa6)]=a35_0x1ec585(0xc6);[a35_0x1ec585(0xd1)]='Run\x20a\x20scheduled\x20query\x20immediately';['validate'](_0xb77e66){const _0x30d620=a35_0x1ec585,_0x507b65=_0xb77e66[_0x30d620(0xea)][0x0];if(!_0x507b65)return _0x30d620(0x67);return undefined;}async[a35_0x1ec585(0x9c)](_0x4557f1){const _0x46da7d=a35_0x1ec585,{options:_0x29b1f4,args:_0x5ef4d0,tdx:_0x42af59}=_0x4557f1,_0x5ed3c3=_0x5ef4d0[0x0],_0x10330b=_0x29b1f4,_0x54b0ba=_0x10330b[_0x46da7d(0x70)],_0x26ee52=_0x10330b['num']!==undefined?Number(_0x10330b[_0x46da7d(0xe3)]):undefined;if(_0x29b1f4[_0x46da7d(0xe6)]){console[_0x46da7d(0xc9)](_0x46da7d(0xa7)+_0x5ed3c3);if(_0x54b0ba)console[_0x46da7d(0xc9)]('\x20\x20Time:\x20'+_0x54b0ba);if(_0x26ee52)console[_0x46da7d(0xc9)](_0x46da7d(0xca)+_0x26ee52);}const _0x3460ca=await withSpinner(_0x46da7d(0x96),()=>_0x42af59[_0x46da7d(0xab)][_0x46da7d(0x8f)](_0x5ed3c3,{'time':_0x54b0ba,'num':_0x26ee52}),{'verbose':_0x29b1f4[_0x46da7d(0xe6)]}),_0x2b1620=_0x3460ca[_0x46da7d(0xc0)][_0x46da7d(0xa1)];console[_0x46da7d(0xc9)](_0x46da7d(0xe4)+_0x2b1620[_0x46da7d(0xde)]+_0x46da7d(0xd5)+(_0x2b1620[_0x46da7d(0xde)]!==0x1?'s':'')+_0x46da7d(0xc3));for(const _0x48defc of _0x2b1620){console[_0x46da7d(0xc9)](_0x46da7d(0xc5)+_0x48defc[_0x46da7d(0xd9)]);}return await handleSDKOutput(_0x2b1620,_0x29b1f4),0x0;}}export class ScheduleHistoryCommand extends BaseCommand{['name']='schedule:history';[a35_0x1ec585(0xd1)]='Show\x20schedule\x20execution\x20history';[a35_0x1ec585(0xac)](_0x4ef8e8){const _0x508348=_0x4ef8e8['args'][0x0];if(!_0x508348)return'Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20history\x20<name>\x20[--from\x20<n>]\x20[--to\x20<n>]';return undefined;}async[a35_0x1ec585(0x9c)](_0xd92a4){const _0x333733=a35_0x1ec585,{options:_0x4b78cd,args:_0x290560,tdx:_0x148d85}=_0xd92a4,_0x294821=_0x290560[0x0],_0x2355a3=_0x4b78cd,_0x4b2a41=_0x2355a3[_0x333733(0x95)]!==undefined?Number(_0x2355a3['from']):undefined,_0x490e3a=_0x2355a3['to']!==undefined?Number(_0x2355a3['to']):undefined,_0x40b733=await withSpinner(_0x333733(0xe0),()=>_0x148d85['schedules'][_0x333733(0x6b)](_0x294821,{'from':_0x4b2a41,'to':_0x490e3a}),{'verbose':_0x4b78cd[_0x333733(0xe6)]}),_0x2475b5=_0x40b733[_0x333733(0xc0)];console['error'](_0x333733(0xd0)+_0x2475b5[_0x333733(0x65)]+'\x20execution'+(_0x2475b5[_0x333733(0x65)]!==0x1?'s':'')+_0x333733(0xb3)+_0x2475b5[_0x333733(0x95)]+'-'+_0x2475b5['to']+')');const _0x5aac13=_0x2475b5['history'][_0x333733(0xa8)](_0x33574f=>({'job_id':_0x33574f[_0x333733(0xd9)],'type':_0x33574f[_0x333733(0xdd)],'status':_0x33574f['status'],'scheduled_at':_0x33574f[_0x333733(0x8d)],'created_at':_0x33574f[_0x333733(0xb7)],'start_at':_0x33574f['start_at'],'end_at':_0x33574f[_0x333733(0x72)]}));return await handleSDKOutput(_0x5aac13,_0x4b78cd),0x0;}}
@@ -1 +1 @@
1
- const a36_0x41001a=a36_0x128f;(function(_0x148920,_0x1043f){const _0x182c9a=a36_0x128f,_0x5b0e16=_0x148920();while(!![]){try{const _0x953a6c=-parseInt(_0x182c9a(0x18d))/0x1*(parseInt(_0x182c9a(0x112))/0x2)+-parseInt(_0x182c9a(0x14c))/0x3*(-parseInt(_0x182c9a(0x177))/0x4)+-parseInt(_0x182c9a(0x19b))/0x5+-parseInt(_0x182c9a(0x122))/0x6*(parseInt(_0x182c9a(0x165))/0x7)+parseInt(_0x182c9a(0x11d))/0x8+parseInt(_0x182c9a(0x12d))/0x9+-parseInt(_0x182c9a(0x16b))/0xa*(-parseInt(_0x182c9a(0x113))/0xb);if(_0x953a6c===_0x1043f)break;else _0x5b0e16['push'](_0x5b0e16['shift']());}catch(_0x2364a8){_0x5b0e16['push'](_0x5b0e16['shift']());}}}(a36_0x58be,0xc322e));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner,formatElapsed}from'../utils/spinner.js';import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{executeSchemaQuery}from'../sdk/segment/fields-display.js';import{isYamlFilePath,resolveYamlFilePath}from'../sdk/segment/segment-path-parser.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';function a36_0x128f(_0x19171f,_0x51b908){_0x19171f=_0x19171f-0xfb;const _0x58be7b=a36_0x58be();let _0x128f16=_0x58be7b[_0x19171f];return _0x128f16;}import{openBrowser}from'../utils/process.js';import a36_0x2cd0a4 from'chalk';async function resolveSegmentTarget(_0x267fb7,_0x5aa48f,_0x51ebfb){const _0x346bbc=a36_0x128f;if(isYamlFilePath(_0x267fb7))try{const _0x3298ab=await resolveYamlFilePath(_0x267fb7);return _0x51ebfb&&(console[_0x346bbc(0x127)]('Resolved\x20YAML\x20file:\x20'+_0x267fb7),console[_0x346bbc(0x127)]('\x20\x20Parent\x20segment:\x20'+_0x3298ab[_0x346bbc(0x180)]),console[_0x346bbc(0x127)](_0x346bbc(0x146)+_0x3298ab[_0x346bbc(0x16e)]),console[_0x346bbc(0x127)](_0x346bbc(0x194)+(_0x3298ab[_0x346bbc(0x147)]||_0x346bbc(0x1a1))),console['error'](_0x346bbc(0x132)+_0x3298ab[_0x346bbc(0x178)])),_0x3298ab[_0x346bbc(0x178)];}catch(_0xff9848){throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x346bbc(0x171)+_0xff9848[_0x346bbc(0x156)]);}if(!_0x5aa48f)throw new SDKError(ErrorCode[_0x346bbc(0x16c)],'No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22');return _0x5aa48f+'/'+_0x267fb7;}export class SegmentDescribeCommand extends BaseCommand{[a36_0x41001a(0xfd)]=a36_0x41001a(0x119);[a36_0x41001a(0x15b)]='Show\x20segment\x20or\x20folder\x20details';async['execute'](_0x1e3052){const _0x31b7d9=a36_0x41001a,{options:_0xfb8f66,args:_0x38cac9,tdx:_0x1aaa2b}=_0x1e3052,_0x31c079=_0x38cac9[0x0],_0x6ccbd2=!_0x31c079&&!!_0xfb8f66[_0x31b7d9(0x180)],_0x4c4dbc=_0x31c079||_0xfb8f66[_0x31b7d9(0x180)];if(!_0x4c4dbc)return console[_0x31b7d9(0x127)](_0x31b7d9(0x1a3)),console[_0x31b7d9(0x127)](_0x31b7d9(0x128)),console[_0x31b7d9(0x127)](_0x31b7d9(0x109)),console['error']('\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22'),console[_0x31b7d9(0x127)]('\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22'),console[_0x31b7d9(0x127)](_0x31b7d9(0x172)),console[_0x31b7d9(0x127)](_0x31b7d9(0x14e)),0x1;try{const _0x5b0e52=_0xfb8f66['segmentPath'];let _0x513ee0=_0x4c4dbc;!_0x6ccbd2&&_0x5b0e52&&!_0x4c4dbc[_0x31b7d9(0x185)]('/')&&(_0x513ee0=_0x5b0e52+'/'+_0x4c4dbc,_0xfb8f66['verbose']&&console[_0x31b7d9(0x127)](_0x31b7d9(0x192)+_0x513ee0));const _0xb9f4a5=await withSpinner('Resolving\x20path\x20\x27'+_0x513ee0+_0x31b7d9(0x155),()=>_0x1aaa2b[_0x31b7d9(0x150)][_0x31b7d9(0x14b)](_0x513ee0),{'verbose':_0xfb8f66[_0x31b7d9(0x18f)]}),_0x3e3935=_0xb9f4a5[_0x31b7d9(0x136)];_0xfb8f66[_0x31b7d9(0x18f)]&&(console[_0x31b7d9(0x127)](_0x31b7d9(0x102)+_0x3e3935[_0x31b7d9(0x10e)]),console[_0x31b7d9(0x127)]('Parent\x20ID:\x20'+_0x3e3935[_0x31b7d9(0x169)]),_0x3e3935['folderId']&&console[_0x31b7d9(0x127)](_0x31b7d9(0x19f)+_0x3e3935[_0x31b7d9(0x148)]),_0x3e3935[_0x31b7d9(0x10f)]&&console[_0x31b7d9(0x127)](_0x31b7d9(0x1a4)+_0x3e3935[_0x31b7d9(0x10f)]));if(_0x3e3935[_0x31b7d9(0x10e)]===_0x31b7d9(0x134)){const _0x5e12ec=await withSpinner(_0x31b7d9(0x173),()=>_0x1aaa2b[_0x31b7d9(0x150)][_0x31b7d9(0x11c)](_0x3e3935['parentId']),{'verbose':_0xfb8f66[_0x31b7d9(0x18f)]});await handleSingleObjectOutput(_0x5e12ec[_0x31b7d9(0x136)],_0xfb8f66);}else{if(_0x3e3935[_0x31b7d9(0x10e)]===_0x31b7d9(0x17f)){if(!_0x3e3935[_0x31b7d9(0x148)])throw new SDKError(ErrorCode[_0x31b7d9(0x19e)],_0x31b7d9(0x141));const _0x54e1f9=await withSpinner(_0x31b7d9(0x199),()=>_0x1aaa2b[_0x31b7d9(0x150)][_0x31b7d9(0x13c)](_0x3e3935[_0x31b7d9(0x148)]),{'verbose':_0xfb8f66['verbose']});await handleSingleObjectOutput(_0x54e1f9['data'],_0xfb8f66);}else{if(_0x3e3935[_0x31b7d9(0x10e)]==='segment'){if(!_0x3e3935[_0x31b7d9(0x10f)])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x17466d=await withSpinner('Fetching\x20segment\x20details...',()=>_0x1aaa2b[_0x31b7d9(0x150)][_0x31b7d9(0x138)](_0x3e3935[_0x31b7d9(0x169)],_0x3e3935['segmentId']),{'verbose':_0xfb8f66[_0x31b7d9(0x18f)]});await handleSingleObjectOutput(_0x17466d[_0x31b7d9(0x136)],_0xfb8f66);}}}return 0x0;}catch(_0x586349){if(_0x586349 instanceof SDKError)return console[_0x31b7d9(0x127)](_0x31b7d9(0x126)+_0x586349[_0x31b7d9(0x156)]),_0x586349[_0x31b7d9(0x108)]&&console[_0x31b7d9(0x127)](_0x31b7d9(0x15e)+_0x586349[_0x31b7d9(0x108)]),0x1;throw _0x586349;}}}export class SegmentShowCommand extends BaseCommand{[a36_0x41001a(0xfd)]=a36_0x41001a(0x166);['description']=a36_0x41001a(0x159);async['execute'](_0x2b2674){const _0x4f8926=a36_0x41001a,{options:_0x5ed9ca,args:_0x2c5d2b,tdx:_0xaa7892}=_0x2b2674,_0x2df1ef=_0x2c5d2b[0x0];if(!_0x2df1ef)return console[_0x4f8926(0x127)](_0x4f8926(0x19c)),console[_0x4f8926(0x127)](_0x4f8926(0x116)),console['error'](_0x4f8926(0x117)),console['error']('Examples:'),console[_0x4f8926(0x127)](_0x4f8926(0x12c)),console[_0x4f8926(0x127)](_0x4f8926(0x167)),0x1;try{const _0x2c4214=_0x5ed9ca[_0x4f8926(0x180)],_0x21604e=await resolveSegmentTarget(_0x2df1ef,_0x2c4214,_0x5ed9ca[_0x4f8926(0x18f)]);_0x5ed9ca['verbose']&&console['error']('Target\x20path:\x20'+_0x21604e);const _0x11a5ec=await withSpinner(_0x4f8926(0x153)+_0x2df1ef+_0x4f8926(0x155),()=>_0xaa7892[_0x4f8926(0x150)][_0x4f8926(0x14b)](_0x21604e),{'verbose':_0x5ed9ca[_0x4f8926(0x18f)]}),_0x148dc2=_0x11a5ec[_0x4f8926(0x136)];_0x5ed9ca[_0x4f8926(0x18f)]&&(console[_0x4f8926(0x127)](_0x4f8926(0x102)+_0x148dc2['type']),console[_0x4f8926(0x127)](_0x4f8926(0x14d)+_0x148dc2[_0x4f8926(0x169)]));if(_0x148dc2[_0x4f8926(0x10e)]===_0x4f8926(0x17f))return console[_0x4f8926(0x127)](_0x4f8926(0x160)),console[_0x4f8926(0x127)](_0x4f8926(0x193)),0x1;if(_0x148dc2[_0x4f8926(0x10e)]===_0x4f8926(0x134))return console['error'](_0x4f8926(0x124)),console[_0x4f8926(0x127)](_0x4f8926(0x145)),0x1;if(!_0x148dc2[_0x4f8926(0x10f)])throw new SDKError(ErrorCode[_0x4f8926(0x107)],_0x4f8926(0x103));const _0xfc7373=await withSpinner(_0x4f8926(0x164),()=>_0xaa7892[_0x4f8926(0x150)]['getSegmentSQL'](_0x148dc2['parentId'],_0x148dc2['segmentId']),{'verbose':_0x5ed9ca[_0x4f8926(0x18f)]});let _0x43d448=_0xfc7373[_0x4f8926(0x136)];const _0x308911=resolveLimit(_0x5ed9ca[_0x4f8926(0x135)],DEFAULT_DISPLAY_LIMIT),_0x412ea8=/\bLIMIT\s+\d+/i['test'](_0x43d448);!_0x412ea8&&(_0x43d448=_0x43d448[_0x4f8926(0x15a)]()['replace'](/;+$/,''),_0x43d448=_0x4f8926(0x144)+_0x43d448+_0x4f8926(0x18e)+_0x308911);_0x5ed9ca[_0x4f8926(0x18f)]&&console[_0x4f8926(0x127)](_0x4f8926(0x163)+_0x43d448);const _0x1aeafb=await withProgressSpinner(_0x4f8926(0x13a),async _0x495bbb=>{const _0x3ace91=_0x4f8926,_0x128792=await _0xaa7892['query'][_0x3ace91(0x183)](_0x43d448,{'catalog':'td','schema':_0x3ace91(0x125),'onJobId':_0x549eee=>{_0x495bbb['setJobId'](_0x549eee);}});return _0x128792;},{'verbose':_0x5ed9ca[_0x4f8926(0x18f)]}),_0x28afd8=_0x1aeafb[_0x4f8926(0x136)],_0x576255=_0x28afd8['jobId']?_0x4f8926(0x179)+_0x28afd8[_0x4f8926(0x197)]+']':'';return console['error'](_0x4f8926(0x143)+_0x28afd8['stats'][_0x4f8926(0x13d)]['toLocaleString']()+'\x20rows\x20'+('in\x20'+formatElapsed(_0x28afd8[_0x4f8926(0x15c)][_0x4f8926(0x175)])+_0x576255)),await handleQueryOutput(_0x28afd8,_0x5ed9ca),0x0;}catch(_0x2ef519){if(_0x2ef519 instanceof SDKError)return console[_0x4f8926(0x127)](_0x4f8926(0x187)+_0x2ef519[_0x4f8926(0x129)]+']'),console[_0x4f8926(0x127)]('\x0a'+_0x2ef519[_0x4f8926(0x156)]),0x1;throw _0x2ef519;}}}export class SegmentFolderListCommand extends BaseCommand{['name']=a36_0x41001a(0x162);[a36_0x41001a(0x15b)]=a36_0x41001a(0x19d);async[a36_0x41001a(0x183)](_0x24f3bc){const _0x14c464=a36_0x41001a,{options:_0x5e5298,args:_0x9db189,tdx:_0x2de87a}=_0x24f3bc;if(_0x9db189[_0x14c464(0x17c)]===0x0)return console[_0x14c464(0x127)](_0x14c464(0x15d)),console['error'](_0x14c464(0x10d)),0x1;const _0x7eb8c7=_0x9db189[0x0];try{_0x5e5298[_0x14c464(0x18f)]&&(console[_0x14c464(0x127)]('Site:\x20'+_0x5e5298[_0x14c464(0x16d)]),console['error'](_0x14c464(0x111)+_0x7eb8c7));const _0x4ed2ec=await withSpinner(_0x14c464(0x174)+_0x7eb8c7+_0x14c464(0x155),()=>_0x2de87a[_0x14c464(0x150)][_0x14c464(0x11a)](_0x7eb8c7),{'verbose':_0x5e5298[_0x14c464(0x18f)]}),_0x9f0125=_0x4ed2ec[_0x14c464(0x136)];_0x5e5298[_0x14c464(0x18f)]&&console[_0x14c464(0x127)]('Resolved\x20parent\x20ID:\x20'+_0x9f0125);const _0x1061fa=await withSpinner(_0x14c464(0x101)+_0x7eb8c7+_0x14c464(0x155),()=>_0x2de87a['segment'][_0x14c464(0x168)](_0x9f0125),{'verbose':_0x5e5298[_0x14c464(0x18f)]}),_0x1a5d49=_0x1061fa[_0x14c464(0x136)];return console[_0x14c464(0x127)]('✔\x20Found\x20'+_0x1a5d49[_0x14c464(0x17c)]+_0x14c464(0x100)+(_0x1a5d49[_0x14c464(0x17c)]!==0x1?'s':'')),await handleSDKOutput(_0x1a5d49,_0x5e5298),0x0;}catch(_0x5a9c82){if(_0x5a9c82 instanceof SDKError)return console['error']('Error:\x20'+_0x5a9c82['message']),_0x5a9c82[_0x14c464(0x108)]&&console[_0x14c464(0x127)](_0x14c464(0x15e)+_0x5a9c82[_0x14c464(0x108)]),0x1;throw _0x5a9c82;}}}export class SegmentFolderShowCommand extends BaseCommand{[a36_0x41001a(0xfd)]='segment:folder:show';['description']='Show\x20segment\x20folder\x20details';async[a36_0x41001a(0x183)](_0x13d52e){const _0x5657e1=a36_0x41001a,{options:_0x349325,args:_0x9b7b69,tdx:_0x60e3e7}=_0x13d52e;if(_0x9b7b69[_0x5657e1(0x17c)]===0x0)return console[_0x5657e1(0x127)](_0x5657e1(0x18a)),console[_0x5657e1(0x127)](_0x5657e1(0x17e)),0x1;try{const {parentId:_0x27aded,childId:_0x1bcf5e}=parseSegmentRef(_0x9b7b69[0x0]);_0x349325[_0x5657e1(0x18f)]&&(console['error'](_0x5657e1(0x1a0)+_0x349325['site']),console[_0x5657e1(0x127)](_0x5657e1(0x111)+_0x27aded),_0x1bcf5e&&console[_0x5657e1(0x127)](_0x5657e1(0x1a2)+_0x1bcf5e));if(!_0x1bcf5e)return console['error'](_0x5657e1(0x157)),0x1;const _0x55795b=await withSpinner(_0x5657e1(0x174)+_0x27aded+_0x5657e1(0x155),()=>_0x60e3e7[_0x5657e1(0x150)]['resolveParentId'](_0x27aded),{'verbose':_0x349325['verbose']}),_0xd5dbfa=_0x55795b[_0x5657e1(0x136)];_0x349325[_0x5657e1(0x18f)]&&console[_0x5657e1(0x127)](_0x5657e1(0x14a)+_0xd5dbfa);const _0x9474c7=await withSpinner(_0x5657e1(0x17a)+_0x1bcf5e+'\x27...',()=>_0x60e3e7['segment'][_0x5657e1(0x158)](_0xd5dbfa,_0x1bcf5e),{'verbose':_0x349325[_0x5657e1(0x18f)]}),_0x4ae28b=_0x9474c7['data'];_0x349325['verbose']&&console['error'](_0x5657e1(0x18b)+_0x4ae28b);const _0xf77e4e=await withSpinner('Fetching\x20folder\x20\x27'+_0x1bcf5e+_0x5657e1(0x155),()=>_0x60e3e7[_0x5657e1(0x150)]['getFolder'](_0x4ae28b),{'verbose':_0x349325[_0x5657e1(0x18f)]});return await handleSDKOutput([_0xf77e4e[_0x5657e1(0x136)]],_0x349325),0x0;}catch(_0x5a42df){if(_0x5a42df instanceof SDKError)return console['error'](_0x5657e1(0x126)+_0x5a42df[_0x5657e1(0x156)]),_0x5a42df[_0x5657e1(0x108)]&&console['error'](_0x5657e1(0x15e)+_0x5a42df[_0x5657e1(0x108)]),0x1;throw _0x5a42df;}}}export class SegmentSQLCommand extends BaseCommand{[a36_0x41001a(0xfd)]='segment:sql';['description']='Get\x20SQL\x20query\x20for\x20child\x20segment';async[a36_0x41001a(0x183)](_0x29eca5){const _0x10fe02=a36_0x41001a,{options:_0x5be754,args:_0xd8bd2a}=_0x29eca5,_0x15fea4=_0x5be754,_0x5f3231=_0x15fea4[_0x10fe02(0x137)],_0x10a709=_0xd8bd2a[0x0];if(!_0x10a709&&!_0x5f3231)return console[_0x10fe02(0x127)](a36_0x2cd0a4[_0x10fe02(0x188)](_0x10fe02(0x198))),console[_0x10fe02(0x127)](_0x10fe02(0xfb)),console[_0x10fe02(0x127)](_0x10fe02(0x184)),console[_0x10fe02(0x127)](_0x10fe02(0x19a)),console[_0x10fe02(0x127)](_0x10fe02(0x109)),console[_0x10fe02(0x127)](_0x10fe02(0x10b)),console['error']('\x20\x20tdx\x20sg\x20sql\x20--path\x20segments/my-audience/premium-users.yml'),0x1;if(_0x10a709&&_0x5f3231)return console[_0x10fe02(0x127)](a36_0x2cd0a4[_0x10fe02(0x188)](_0x10fe02(0x142))),0x1;try{let _0x308725;if(_0x5f3231)_0x308725=await this[_0x10fe02(0x133)](_0x5f3231,_0x29eca5);else{if(isYamlFilePath(_0x10a709))return console[_0x10fe02(0x127)](a36_0x2cd0a4[_0x10fe02(0x188)](_0x10fe02(0xff))),console[_0x10fe02(0x127)](_0x10fe02(0x115)+_0x10a709),0x1;else _0x308725=await this['getSQLFromServerSegment'](_0x10a709,_0x29eca5);}return _0x5be754[_0x10fe02(0x130)]==='json'||_0x5be754[_0x10fe02(0x130)]===_0x10fe02(0x12e)?await handleSDKOutput([{'sql':_0x308725}],_0x5be754):console[_0x10fe02(0xfe)](_0x308725),0x0;}catch(_0x19a87f){if(_0x19a87f instanceof SDKError)return console['error'](_0x10fe02(0x126)+_0x19a87f[_0x10fe02(0x156)]),_0x19a87f[_0x10fe02(0x108)]&&console[_0x10fe02(0x127)](_0x10fe02(0x15e)+_0x19a87f['cause']),0x1;throw _0x19a87f;}}async[a36_0x41001a(0x133)](_0xfc835d,_0x57c344){const _0x3b59bd=a36_0x41001a,{options:_0x42e19d,tdx:_0x4783a5}=_0x57c344;let _0x5a8eed;try{_0x5a8eed=await resolveYamlFilePath(_0xfc835d);}catch(_0x4f4805){throw new SDKError(ErrorCode[_0x3b59bd(0x16c)],_0x3b59bd(0x171)+_0x4f4805[_0x3b59bd(0x156)]);}_0x42e19d[_0x3b59bd(0x18f)]&&console[_0x3b59bd(0x127)](_0x3b59bd(0x176)+_0x5a8eed[_0x3b59bd(0x180)]+'/'+_0x5a8eed['segmentName']);const _0x4aa139=await withSpinner(_0x3b59bd(0x195),()=>_0x4783a5[_0x3b59bd(0x150)]['getSegmentSQLFromYaml'](_0x5a8eed[_0x3b59bd(0x17b)],_0x5a8eed[_0x3b59bd(0x180)],_0x5a8eed['segmentName']),{'verbose':_0x42e19d[_0x3b59bd(0x18f)]});return _0x4aa139[_0x3b59bd(0x136)];}async[a36_0x41001a(0x14f)](_0x31c4dd,_0x22616a){const _0xe3198a=a36_0x41001a,{options:_0x237a1d,tdx:_0x2804c2}=_0x22616a,_0x2ae194=_0x237a1d[_0xe3198a(0x180)],_0x38ae8b=await resolveSegmentTarget(_0x31c4dd,_0x2ae194,_0x237a1d[_0xe3198a(0x18f)]);_0x237a1d[_0xe3198a(0x18f)]&&console[_0xe3198a(0x127)](_0xe3198a(0x152)+_0x38ae8b);const _0x58df78=await withSpinner(_0xe3198a(0x153)+_0x31c4dd+_0xe3198a(0x155),()=>_0x2804c2['segment']['resolvePathToResource'](_0x38ae8b),{'verbose':_0x237a1d[_0xe3198a(0x18f)]}),_0x4fc507=_0x58df78[_0xe3198a(0x136)];_0x237a1d[_0xe3198a(0x18f)]&&(console['error']('Resolved\x20type:\x20'+_0x4fc507['type']),console['error'](_0xe3198a(0x14d)+_0x4fc507['parentId']));if(_0x4fc507['type']===_0xe3198a(0x17f))throw new SDKError(ErrorCode[_0xe3198a(0x16c)],_0xe3198a(0x10a));if(_0x4fc507[_0xe3198a(0x10e)]===_0xe3198a(0x134))throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0xe3198a(0x106));if(!_0x4fc507[_0xe3198a(0x10f)])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0xe3198a(0x103));const _0x29b881=await withSpinner(_0xe3198a(0x164),()=>_0x2804c2[_0xe3198a(0x150)][_0xe3198a(0x110)](_0x4fc507[_0xe3198a(0x169)],_0x4fc507['segmentId']),{'verbose':_0x237a1d[_0xe3198a(0x18f)]});return _0x29b881['data'];}}function a36_0x58be(){const _0x2c4f5b=['/e/','getParent','10388552pvQBtL','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','segment:view','✔\x20Created\x20folder\x20\x27','\x20\x20tdx\x20sg\x20desc\x20segments/my-audience/premium-users.yml','9457146ExSOUd','\x20\x20tdx\x20sg\x20view\x20segments/my-audience/premium-users.yml','Error:\x20Cannot\x20execute\x20query\x20for\x20parent\x20segment\x20with\x20this\x20command.','information_schema','Error:\x20','error','Usage:\x20tdx\x20segment\x20describe\x20<path>','code','Use:\x20tdx\x20ps\x20view','Create\x20segment\x20folder\x20for\x20organization','\x20\x20tdx\x20sg\x20show\x20\x22Premium\x20Users\x22','2311965NjvqeU','jsonl','Error:\x20Cannot\x20open\x20parent\x20segment\x20with\x20this\x20command.','format','Error:\x20Cannot\x20show\x20schema\x20for\x20a\x20folder.','\x20\x20Full\x20path:\x20','getSQLFromYamlFile','parent','limit','data','path','getSegment','Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required','Executing\x20segment\x20query...','Resolving\x20parent\x20folder\x20\x27','getFolder','processedRows','/app/ps/','Usage:\x20tdx\x20sg\x20desc\x20<name>','Resolved\x20parent\x20folder\x20ID:\x20','Folder\x20ID\x20missing\x20from\x20resolved\x20path','Error:\x20Specify\x20either\x20segment\x20name\x20or\x20--path,\x20not\x20both','✔\x20Query\x20completed:\x20Processed\x20','SELECT\x20*\x20FROM\x20(\x0a','Use:\x20tdx\x20ps\x20show','\x20\x20Segment\x20name:\x20','folderPath','folderId','segment:desc','Resolved\x20parent\x20ID:\x20','resolvePathToResource','456657sKaRKo','Parent\x20ID:\x20','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','getSQLFromServerSegment','segment','cyan','Target\x20path:\x20','Resolving\x20\x27','Parent\x20segment:\x20','\x27...','message','Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)','resolveFolderId','Execute\x20child\x20segment\x20SQL\x20query\x20and\x20show\x20results','trim','description','stats','Error:\x20Parent\x20segment\x20name\x20is\x20required','\x20\x20Cause:\x20','Fetching\x20segment\x20details...','Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.','Use:\x20tdx\x20ps\x20desc','segment:folder:list','SQL\x20query:\x0a','Fetching\x20SQL\x20for\x20segment...','7gqBTwo','segment:show','\x20\x20tdx\x20sg\x20show\x20segments/my-audience/premium-users.yml','listFolders','parentId','Error:\x20Cannot\x20show\x20schema\x20for\x20parent\x20segment\x20with\x20this\x20command.','1993030RaNUsr','INVALID_ARGUMENT','site','segmentName','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20desc\x20<path/to/segment.yml>','url','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','Fetching\x20parent\x20segment\x20details...','Resolving\x20parent\x20segment\x20\x27','elapsedTimeMillis','Resolved:\x20','28SHhlxJ','fullPath','\x20[Job\x20ID:\x20','Resolving\x20folder\x20\x27','content','length','green','Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>','folder','parentSegment','createFolder','Options:','execute','\x20\x20Server-side\x20segment:\x20\x20tdx\x20sg\x20sql\x20<name>','includes','Creating\x20folder\x20\x27','✖\x20Query\x20failed\x20[','red','Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]','Error:\x20Folder\x20reference\x20is\x20required','Resolved\x20folder\x20ID:\x20','\x20\x20tdx\x20sg\x20desc\x20\x22Premium\x20Users\x22','2XDhfGq','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','verbose','Show\x20folder\x20or\x20child\x20segment\x20details','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20\x20\x20\x20\x20#\x20View\x20child\x20segment\x20details','Resolved\x20relative\x20path\x20to:\x20','Use:\x20tdx\x20sg\x20view\x20<name>\x20\x20#\x20To\x20show\x20folder\x20details','\x20\x20Folder\x20path:\x20','Fetching\x20SQL\x20from\x20rule...','Use:\x20tdx\x20ps\x20view\x20-w','jobId','Error:\x20Segment\x20name\x20or\x20--path\x20is\x20required','Fetching\x20folder\x20details...','\x20\x20Local\x20YAML\x20file:\x20\x20\x20\x20\x20\x20tdx\x20sg\x20sql\x20--path\x20<file-path>','1717590PLyRzZ','Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required','List\x20segment\x20folders\x20under\x20a\x20parent\x20segment','SEGMENT_FOLDER_NOT_FOUND','Folder\x20ID:\x20','Site:\x20','(root)','Folder\x20name:\x20','Error:\x20Path\x20or\x20name\x20is\x20required','Segment\x20ID:\x20','Usage:','segment:folder:create','name','log','Error:\x20YAML\x20file\x20paths\x20must\x20be\x20specified\x20with\x20--path\x20option','\x20folder','Listing\x20folders\x20for\x20parent\x20\x27','Resolved\x20type:\x20','Segment\x20ID\x20missing\x20from\x20resolved\x20path','Show\x20child\x20segment\x20schema\x20(column\x20types)','Error:\x20Cannot\x20open\x20folder\x20in\x20web\x20browser.\x20Use\x20a\x20segment\x20name\x20instead.','Cannot\x20get\x20SQL\x20for\x20parent\x20segment\x20with\x20this\x20command.\x20Use:\x20tdx\x20ps\x20sql','SEGMENT_NOT_FOUND','cause','Examples:','Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.\x20Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','\x20\x20tdx\x20sg\x20sql\x20\x22Premium\x20Users\x22','\x20Opening\x20','Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>','type','segmentId','getSegmentSQL','Parent\x20name:\x20','1097818KIeZBf','66PabZFJ','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20-w\x20\x20#\x20Open\x20segment\x20in\x20web\x20browser','\x20\x20tdx\x20sg\x20sql\x20--path\x20','Usage:\x20tdx\x20sg\x20show\x20<name>','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20show\x20<path/to/segment.yml>','\x20\x20tdx\x20sg\x20view\x20\x22Marketing\x22\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20folder\x20details','segment:describe','resolveParentId'];a36_0x58be=function(){return _0x2c4f5b;};return a36_0x58be();}export class SegmentFolderCreateCommand extends BaseCommand{[a36_0x41001a(0xfd)]=a36_0x41001a(0xfc);[a36_0x41001a(0x15b)]=a36_0x41001a(0x12b);async[a36_0x41001a(0x183)](_0x3e9a93){const _0x411e0d=a36_0x41001a,{options:_0x3a5cfd,args:_0x1b8653,tdx:_0x12b86d}=_0x3e9a93,_0x14c647=_0x3a5cfd;if(_0x1b8653['length']<0x2)return console[_0x411e0d(0x127)](_0x411e0d(0x139)),console[_0x411e0d(0x127)](_0x411e0d(0x189)),0x1;const _0x1f81a4=_0x1b8653[0x0],_0x29ecd9=_0x1b8653[0x1];_0x14c647['verbose']&&(console[_0x411e0d(0x127)]('Site:\x20'+_0x14c647[_0x411e0d(0x16d)]),console[_0x411e0d(0x127)](_0x411e0d(0x154)+_0x1f81a4),console[_0x411e0d(0x127)](_0x411e0d(0x1a2)+_0x29ecd9));let _0x33a5b1;if(_0x14c647['parentFolder']){const _0xc68ec6=_0x14c647['parentFolder'],_0x3952f3=await withSpinner(_0x411e0d(0x174)+_0x1f81a4+_0x411e0d(0x155),()=>_0x12b86d[_0x411e0d(0x150)][_0x411e0d(0x11a)](_0x1f81a4),{'verbose':_0x14c647['verbose']}),_0x26cff8=_0x3952f3[_0x411e0d(0x136)],_0xbf88bf=await withSpinner(_0x411e0d(0x13b)+_0xc68ec6+_0x411e0d(0x155),()=>_0x12b86d[_0x411e0d(0x150)][_0x411e0d(0x158)](_0x26cff8,_0xc68ec6),{'verbose':_0x14c647[_0x411e0d(0x18f)]});_0x33a5b1=_0xbf88bf['data'],_0x14c647[_0x411e0d(0x18f)]&&console[_0x411e0d(0x127)](_0x411e0d(0x140)+_0x33a5b1);}const _0x322292={'name':_0x29ecd9,'description':_0x14c647[_0x411e0d(0x15b)],'parentFolderId':_0x33a5b1},_0x5f0a7f=await withSpinner(_0x411e0d(0x186)+_0x29ecd9+_0x411e0d(0x155),()=>_0x12b86d[_0x411e0d(0x150)][_0x411e0d(0x181)](_0x1f81a4,_0x322292),{'verbose':_0x14c647[_0x411e0d(0x18f)]}),_0x424b7d=_0x5f0a7f[_0x411e0d(0x136)];return console[_0x411e0d(0x127)](_0x411e0d(0x120)+_0x424b7d[_0x411e0d(0xfd)]+'\x27\x20with\x20ID:\x20'+_0x424b7d['id']),await handleSDKOutput([_0x424b7d],_0x14c647),0x0;}}export class SegmentViewCommand extends BaseCommand{[a36_0x41001a(0xfd)]=a36_0x41001a(0x11f);['description']=a36_0x41001a(0x190);async[a36_0x41001a(0x183)](_0x28d3c0){const _0x5c434f=a36_0x41001a,{options:_0x3c4817,args:_0x38c952,tdx:_0x8c35f2}=_0x28d3c0,_0x4625c7=_0x38c952[0x0];if(!_0x4625c7)return console[_0x5c434f(0x127)]('Error:\x20Folder\x20or\x20segment\x20name,\x20or\x20YAML\x20file\x20path\x20is\x20required'),console[_0x5c434f(0x127)]('Usage:\x20tdx\x20sg\x20view\x20<name>\x20[-w]'),console[_0x5c434f(0x127)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20view\x20<path/to/segment.yml>'),console[_0x5c434f(0x127)](_0x5c434f(0x182)),console['error']('\x20\x20-w,\x20--web\x20\x20Open\x20segment\x20in\x20web\x20browser'),console[_0x5c434f(0x127)](_0x5c434f(0x109)),console[_0x5c434f(0x127)](_0x5c434f(0x118)),console[_0x5c434f(0x127)](_0x5c434f(0x191)),console[_0x5c434f(0x127)](_0x5c434f(0x114)),console[_0x5c434f(0x127)](_0x5c434f(0x123)),0x1;try{const _0x1d152f=_0x3c4817['parentSegment'],_0x4678d7=await resolveSegmentTarget(_0x4625c7,_0x1d152f,_0x3c4817[_0x5c434f(0x18f)]);_0x3c4817[_0x5c434f(0x18f)]&&console[_0x5c434f(0x127)]('Target\x20path:\x20'+_0x4678d7);const _0x2704e4=await withSpinner(_0x5c434f(0x153)+_0x4625c7+_0x5c434f(0x155),()=>_0x8c35f2[_0x5c434f(0x150)]['resolvePathToResource'](_0x4678d7),{'verbose':_0x3c4817['verbose']}),_0x5767a6=_0x2704e4['data'];_0x3c4817[_0x5c434f(0x18f)]&&(console[_0x5c434f(0x127)](_0x5c434f(0x102)+_0x5767a6[_0x5c434f(0x10e)]),console[_0x5c434f(0x127)]('Parent\x20ID:\x20'+_0x5767a6[_0x5c434f(0x169)]),_0x5767a6[_0x5c434f(0x148)]&&console[_0x5c434f(0x127)](_0x5c434f(0x19f)+_0x5767a6[_0x5c434f(0x148)]),_0x5767a6[_0x5c434f(0x10f)]&&console['error'](_0x5c434f(0x1a4)+_0x5767a6[_0x5c434f(0x10f)]));if(_0x3c4817['web']){if(_0x5767a6[_0x5c434f(0x10e)]==='folder')return console[_0x5c434f(0x127)](_0x5c434f(0x105)),0x1;if(_0x5767a6['type']===_0x5c434f(0x134))return console[_0x5c434f(0x127)](_0x5c434f(0x12f)),console[_0x5c434f(0x127)](_0x5c434f(0x196)),0x1;if(!_0x5767a6['segmentId'])throw new SDKError(ErrorCode[_0x5c434f(0x107)],_0x5c434f(0x103));const _0x1735e1=getConsoleNextUrl(_0x3c4817[_0x5c434f(0x16d)],_0x5c434f(0x13e)+_0x5767a6[_0x5c434f(0x169)]+_0x5c434f(0x11b)+_0x5767a6[_0x5c434f(0x10f)]);return console[_0x5c434f(0x127)](a36_0x2cd0a4[_0x5c434f(0x17d)]('✔')+_0x5c434f(0x10c)+a36_0x2cd0a4[_0x5c434f(0x151)](_0x1735e1)),openBrowser(_0x1735e1),0x0;}if(_0x5767a6['type']===_0x5c434f(0x17f)){if(!_0x5767a6['folderId'])throw new SDKError(ErrorCode[_0x5c434f(0x19e)],'Folder\x20ID\x20missing\x20from\x20resolved\x20path');const _0x27895a=await withSpinner('Fetching\x20folder\x20details...',()=>_0x8c35f2['segment'][_0x5c434f(0x13c)](_0x5767a6[_0x5c434f(0x148)]),{'verbose':_0x3c4817[_0x5c434f(0x18f)]});await handleSingleObjectOutput(_0x27895a[_0x5c434f(0x136)],_0x3c4817);}else{if(_0x5767a6[_0x5c434f(0x10e)]==='segment'){if(!_0x5767a6[_0x5c434f(0x10f)])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x5c434f(0x103));const _0x2a0f78=await withSpinner(_0x5c434f(0x15f),()=>_0x8c35f2['segment'][_0x5c434f(0x138)](_0x5767a6[_0x5c434f(0x169)],_0x5767a6[_0x5c434f(0x10f)]),{'verbose':_0x3c4817[_0x5c434f(0x18f)]}),_0x393a0b=getConsoleNextUrl(_0x3c4817[_0x5c434f(0x16d)],_0x5c434f(0x13e)+_0x5767a6['parentId']+_0x5c434f(0x11b)+_0x5767a6['segmentId']),_0x56141b=_0x2a0f78['data'];_0x56141b[_0x5c434f(0x170)]=_0x393a0b,await handleSingleObjectOutput(_0x56141b,_0x3c4817);}else return console[_0x5c434f(0x127)]('Error:\x20Cannot\x20view\x20parent\x20segment\x20details\x20with\x20this\x20command.'),console['error'](_0x5c434f(0x12a)),0x1;}return 0x0;}catch(_0x6e288c){if(_0x6e288c instanceof SDKError)return console['error'](_0x5c434f(0x126)+_0x6e288c[_0x5c434f(0x156)]),_0x6e288c['cause']&&console[_0x5c434f(0x127)](_0x5c434f(0x15e)+_0x6e288c[_0x5c434f(0x108)]),0x1;throw _0x6e288c;}}}export const SegmentInfoCommand=SegmentViewCommand;export class SegmentDescCommand extends BaseCommand{[a36_0x41001a(0xfd)]=a36_0x41001a(0x149);[a36_0x41001a(0x15b)]=a36_0x41001a(0x104);async['execute'](_0x493e7c){const _0x44a321=a36_0x41001a,{options:_0x49273c,args:_0x1e6ad5,tdx:_0x478524}=_0x493e7c,_0x982b7a=_0x1e6ad5[0x0];if(!_0x982b7a)return console[_0x44a321(0x127)](_0x44a321(0x19c)),console[_0x44a321(0x127)](_0x44a321(0x13f)),console[_0x44a321(0x127)](_0x44a321(0x16f)),console[_0x44a321(0x127)](_0x44a321(0x109)),console[_0x44a321(0x127)](_0x44a321(0x18c)),console[_0x44a321(0x127)](_0x44a321(0x121)),0x1;try{const _0x360d85=_0x49273c[_0x44a321(0x180)],_0x28d7d1=await resolveSegmentTarget(_0x982b7a,_0x360d85,_0x49273c[_0x44a321(0x18f)]);_0x49273c['verbose']&&console[_0x44a321(0x127)](_0x44a321(0x152)+_0x28d7d1);const _0x43d16b=await withSpinner(_0x44a321(0x153)+_0x982b7a+'\x27...',()=>_0x478524['segment'][_0x44a321(0x14b)](_0x28d7d1),{'verbose':_0x49273c[_0x44a321(0x18f)]}),_0x3ec5f5=_0x43d16b[_0x44a321(0x136)];_0x49273c[_0x44a321(0x18f)]&&(console[_0x44a321(0x127)](_0x44a321(0x102)+_0x3ec5f5[_0x44a321(0x10e)]),console[_0x44a321(0x127)](_0x44a321(0x14d)+_0x3ec5f5['parentId']));if(_0x3ec5f5['type']===_0x44a321(0x17f))return console['error'](_0x44a321(0x131)),console['error'](_0x44a321(0x11e)),0x1;if(_0x3ec5f5['type']===_0x44a321(0x134))return console[_0x44a321(0x127)](_0x44a321(0x16a)),console['error'](_0x44a321(0x161)),0x1;if(!_0x3ec5f5[_0x44a321(0x10f)])throw new SDKError(ErrorCode[_0x44a321(0x107)],_0x44a321(0x103));const _0x504416=await withSpinner(_0x44a321(0x164),()=>_0x478524[_0x44a321(0x150)][_0x44a321(0x110)](_0x3ec5f5[_0x44a321(0x169)],_0x3ec5f5[_0x44a321(0x10f)]),{'verbose':_0x49273c[_0x44a321(0x18f)]}),_0x14e98d=_0x504416[_0x44a321(0x136)],_0x1558c6=await executeSchemaQuery(_0x14e98d,_0x478524,_0x49273c);return await handleQueryOutput(_0x1558c6,_0x49273c),0x0;}catch(_0x456787){if(_0x456787 instanceof SDKError)return console[_0x44a321(0x127)](_0x44a321(0x126)+_0x456787[_0x44a321(0x156)]),_0x456787[_0x44a321(0x108)]&&console['error'](_0x44a321(0x15e)+_0x456787['cause']),0x1;throw _0x456787;}}}
1
+ const a36_0x5c5596=a36_0x3c10;(function(_0x2e72ff,_0x5f0a83){const _0x536daa=a36_0x3c10,_0x3ffc14=_0x2e72ff();while(!![]){try{const _0x5e7f2e=-parseInt(_0x536daa(0x270))/0x1+parseInt(_0x536daa(0x227))/0x2+parseInt(_0x536daa(0x223))/0x3+parseInt(_0x536daa(0x212))/0x4*(-parseInt(_0x536daa(0x247))/0x5)+parseInt(_0x536daa(0x1cf))/0x6*(parseInt(_0x536daa(0x237))/0x7)+parseInt(_0x536daa(0x21f))/0x8+parseInt(_0x536daa(0x230))/0x9;if(_0x5e7f2e===_0x5f0a83)break;else _0x3ffc14['push'](_0x3ffc14['shift']());}catch(_0x6bcc05){_0x3ffc14['push'](_0x3ffc14['shift']());}}}(a36_0x1da0,0xdc509));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';function a36_0x3c10(_0x42a132,_0x4b822c){_0x42a132=_0x42a132-0x1cd;const _0x1da04b=a36_0x1da0();let _0x3c10b6=_0x1da04b[_0x42a132];return _0x3c10b6;}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 a36_0x56827b from'chalk';async function resolveSegmentTarget(_0x55a7ae,_0x3395c5,_0x14520d){const _0x583f72=a36_0x3c10;if(isYamlFilePath(_0x55a7ae))try{const _0x4d5589=await resolveYamlFilePath(_0x55a7ae);return _0x14520d&&(console['error'](_0x583f72(0x1d4)+_0x55a7ae),console[_0x583f72(0x1d7)]('\x20\x20Parent\x20segment:\x20'+_0x4d5589[_0x583f72(0x249)]),console['error'](_0x583f72(0x1fa)+_0x4d5589['segmentName']),console[_0x583f72(0x1d7)]('\x20\x20Folder\x20path:\x20'+(_0x4d5589['folderPath']||_0x583f72(0x1fd))),console[_0x583f72(0x1d7)](_0x583f72(0x1df)+_0x4d5589[_0x583f72(0x221)])),_0x4d5589[_0x583f72(0x221)];}catch(_0x19c8fe){throw new SDKError(ErrorCode[_0x583f72(0x258)],'Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20'+_0x19c8fe[_0x583f72(0x232)]);}if(!_0x3395c5)throw new SDKError(ErrorCode[_0x583f72(0x258)],_0x583f72(0x1d5));return _0x3395c5+'/'+_0x55a7ae;}export class SegmentDescribeCommand extends BaseCommand{[a36_0x5c5596(0x1fb)]='segment:describe';[a36_0x5c5596(0x1d3)]=a36_0x5c5596(0x26b);async['execute'](_0x4bef27){const _0x1c3313=a36_0x5c5596,{options:_0x2d8b40,args:_0x186a7c,tdx:_0x3280f4}=_0x4bef27,_0x134ea6=_0x186a7c[0x0],_0x52b82b=!_0x134ea6&&!!_0x2d8b40[_0x1c3313(0x249)],_0x189a2b=_0x134ea6||_0x2d8b40[_0x1c3313(0x249)];if(!_0x189a2b)return console[_0x1c3313(0x1d7)](_0x1c3313(0x200)),console['error'](_0x1c3313(0x1d6)),console[_0x1c3313(0x1d7)](_0x1c3313(0x1db)),console[_0x1c3313(0x1d7)]('\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22'),console['error'](_0x1c3313(0x23c)),console[_0x1c3313(0x1d7)](_0x1c3313(0x1e9)),console[_0x1c3313(0x1d7)]('\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>'),0x1;try{const _0x549f8c=_0x2d8b40['segmentPath'];let _0x5731c2=_0x189a2b;!_0x52b82b&&_0x549f8c&&!_0x189a2b[_0x1c3313(0x1fc)]('/')&&(_0x5731c2=_0x549f8c+'/'+_0x189a2b,_0x2d8b40[_0x1c3313(0x1fe)]&&console[_0x1c3313(0x1d7)](_0x1c3313(0x23b)+_0x5731c2));const _0x3f414e=await withSpinner(_0x1c3313(0x205)+_0x5731c2+_0x1c3313(0x24c),()=>_0x3280f4[_0x1c3313(0x215)][_0x1c3313(0x1e4)](_0x5731c2),{'verbose':_0x2d8b40[_0x1c3313(0x1fe)]}),_0x83e1bf=_0x3f414e['data'];_0x2d8b40[_0x1c3313(0x1fe)]&&(console[_0x1c3313(0x1d7)]('Resolved\x20type:\x20'+_0x83e1bf[_0x1c3313(0x25d)]),console[_0x1c3313(0x1d7)](_0x1c3313(0x20a)+_0x83e1bf[_0x1c3313(0x244)]),_0x83e1bf['folderId']&&console[_0x1c3313(0x1d7)]('Folder\x20ID:\x20'+_0x83e1bf[_0x1c3313(0x24e)]),_0x83e1bf[_0x1c3313(0x222)]&&console[_0x1c3313(0x1d7)](_0x1c3313(0x254)+_0x83e1bf[_0x1c3313(0x222)]));if(_0x83e1bf['type']===_0x1c3313(0x20e)){const _0x4f588f=await withSpinner(_0x1c3313(0x1ea),()=>_0x3280f4['segment'][_0x1c3313(0x217)](_0x83e1bf[_0x1c3313(0x244)]),{'verbose':_0x2d8b40[_0x1c3313(0x1fe)]});await handleSingleObjectOutput(_0x4f588f[_0x1c3313(0x1e7)],_0x2d8b40);}else{if(_0x83e1bf[_0x1c3313(0x25d)]===_0x1c3313(0x233)){if(!_0x83e1bf[_0x1c3313(0x24e)])throw new SDKError(ErrorCode['SEGMENT_FOLDER_NOT_FOUND'],'Folder\x20ID\x20missing\x20from\x20resolved\x20path');const _0x784874=await withSpinner('Fetching\x20folder\x20details...',()=>_0x3280f4[_0x1c3313(0x215)][_0x1c3313(0x26e)](_0x83e1bf['folderId']),{'verbose':_0x2d8b40[_0x1c3313(0x1fe)]});await handleSingleObjectOutput(_0x784874[_0x1c3313(0x1e7)],_0x2d8b40);}else{if(_0x83e1bf[_0x1c3313(0x25d)]==='segment'){if(!_0x83e1bf[_0x1c3313(0x222)])throw new SDKError(ErrorCode[_0x1c3313(0x1f2)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x56d4f9=await withSpinner(_0x1c3313(0x24f),()=>_0x3280f4[_0x1c3313(0x215)]['getSegment'](_0x83e1bf['parentId'],_0x83e1bf[_0x1c3313(0x222)]),{'verbose':_0x2d8b40[_0x1c3313(0x1fe)]});await handleSingleObjectOutput(_0x56d4f9['data'],_0x2d8b40);}}}return 0x0;}catch(_0x40070c){if(_0x40070c instanceof SDKError)return console[_0x1c3313(0x1d7)]('Error:\x20'+_0x40070c[_0x1c3313(0x232)]),_0x40070c['cause']&&console[_0x1c3313(0x1d7)](_0x1c3313(0x25a)+_0x40070c[_0x1c3313(0x1d1)]),0x1;throw _0x40070c;}}}export class SegmentShowCommand extends BaseCommand{[a36_0x5c5596(0x1fb)]=a36_0x5c5596(0x23f);[a36_0x5c5596(0x1d3)]=a36_0x5c5596(0x1d9);async['execute'](_0x526a2d){const _0x24f342=a36_0x5c5596,{options:_0x54ad81,args:_0x5d8e09,tdx:_0x5751d1}=_0x526a2d,_0x42a2cf=_0x5d8e09[0x0];if(!_0x42a2cf)return console[_0x24f342(0x1d7)](_0x24f342(0x263)),console[_0x24f342(0x1d7)](_0x24f342(0x1eb)),console['error'](_0x24f342(0x26c)),console['error'](_0x24f342(0x1db)),console[_0x24f342(0x1d7)]('\x20\x20tdx\x20sg\x20show\x20\x22Premium\x20Users\x22'),console[_0x24f342(0x1d7)](_0x24f342(0x228)),0x1;try{const _0x5c1148=_0x54ad81[_0x24f342(0x249)],_0x3dd0ff=await resolveSegmentTarget(_0x42a2cf,_0x5c1148,_0x54ad81['verbose']);_0x54ad81[_0x24f342(0x1fe)]&&console[_0x24f342(0x1d7)](_0x24f342(0x20b)+_0x3dd0ff);const _0x5a2c6a=await withSpinner('Resolving\x20\x27'+_0x42a2cf+'\x27...',()=>_0x5751d1[_0x24f342(0x215)][_0x24f342(0x1e4)](_0x3dd0ff),{'verbose':_0x54ad81[_0x24f342(0x1fe)]}),_0x5bcbca=_0x5a2c6a[_0x24f342(0x1e7)];_0x54ad81['verbose']&&(console[_0x24f342(0x1d7)](_0x24f342(0x1ed)+_0x5bcbca[_0x24f342(0x25d)]),console[_0x24f342(0x1d7)](_0x24f342(0x20a)+_0x5bcbca[_0x24f342(0x244)]));if(_0x5bcbca['type']===_0x24f342(0x233))return console[_0x24f342(0x1d7)]('Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.'),console[_0x24f342(0x1d7)]('Use:\x20tdx\x20sg\x20view\x20<name>\x20\x20#\x20To\x20show\x20folder\x20details'),0x1;if(_0x5bcbca[_0x24f342(0x25d)]===_0x24f342(0x20e))return console[_0x24f342(0x1d7)](_0x24f342(0x23d)),console[_0x24f342(0x1d7)](_0x24f342(0x22e)),0x1;if(!_0x5bcbca[_0x24f342(0x222)])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x24f342(0x206));const _0x45b4b4=await withSpinner(_0x24f342(0x242),()=>_0x5751d1[_0x24f342(0x215)][_0x24f342(0x1f7)](_0x5bcbca['parentId'],_0x5bcbca[_0x24f342(0x222)]),{'verbose':_0x54ad81['verbose']});let _0x1ba74a=_0x45b4b4[_0x24f342(0x1e7)];const _0xe6b58f=resolveLimit(_0x54ad81[_0x24f342(0x1e8)],DEFAULT_DISPLAY_LIMIT),_0x1f7156=/\bLIMIT\s+\d+/i[_0x24f342(0x26a)](_0x1ba74a);!_0x1f7156&&(_0x1ba74a=_0x1ba74a[_0x24f342(0x266)]()[_0x24f342(0x25e)](/;+$/,''),_0x1ba74a=_0x24f342(0x259)+_0x1ba74a+_0x24f342(0x234)+_0xe6b58f);_0x54ad81['verbose']&&console[_0x24f342(0x1d7)]('SQL\x20query:\x0a'+_0x1ba74a);const _0x3fe816=await withProgressSpinner(_0x24f342(0x1e1),async _0x29c10d=>{const _0x4cf88d=_0x24f342,_0x3c14ca=await _0x5751d1['query'][_0x4cf88d(0x214)](_0x1ba74a,{'catalog':'td','schema':'information_schema','onJobId':_0x291f75=>{_0x29c10d['setJobId'](_0x291f75);}});return _0x3c14ca;},{'verbose':_0x54ad81[_0x24f342(0x1fe)]}),_0x31d5c0=_0x3fe816[_0x24f342(0x1e7)],_0x284907=_0x31d5c0[_0x24f342(0x24b)]?_0x24f342(0x25f)+_0x31d5c0[_0x24f342(0x24b)]+']':'';return console[_0x24f342(0x1d7)](_0x24f342(0x253)+_0x31d5c0['stats'][_0x24f342(0x262)][_0x24f342(0x1e2)]()+_0x24f342(0x204)+('in\x20'+formatElapsed(_0x31d5c0[_0x24f342(0x224)][_0x24f342(0x1f6)])+_0x284907)),await handleQueryOutput(_0x31d5c0,_0x54ad81),0x0;}catch(_0x36387b){if(_0x36387b instanceof SDKError)return console[_0x24f342(0x1d7)](_0x24f342(0x20d)+_0x36387b[_0x24f342(0x21d)]+']'),console[_0x24f342(0x1d7)]('\x0a'+_0x36387b[_0x24f342(0x232)]),0x1;throw _0x36387b;}}}function a36_0x1da0(){const _0x307da7=['verbose','Show\x20segment\x20folder\x20details','Error:\x20Path\x20or\x20name\x20is\x20required','Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]','green','getSegmentSQLFromYaml','\x20rows\x20','Resolving\x20path\x20\x27','Segment\x20ID\x20missing\x20from\x20resolved\x20path','segment:view','Error:\x20Parent\x20segment\x20name\x20is\x20required','Error:\x20Folder\x20or\x20segment\x20name,\x20or\x20YAML\x20file\x20path\x20is\x20required','Parent\x20ID:\x20','Target\x20path:\x20','Error:\x20','✖\x20Query\x20failed\x20[','parent','Use:\x20tdx\x20ps\x20view\x20-w','getSQLFromServerSegment','Resolved:\x20','7004RJcewu','\x20\x20tdx\x20sg\x20view\x20segments/my-audience/premium-users.yml','execute','segment','createFolder','getParent','segment:folder:list','cyan','Use:\x20tdx\x20ps\x20desc','Resolved\x20folder\x20ID:\x20','segmentName','code','Get\x20SQL\x20query\x20for\x20child\x20segment','2938888HQnItM','✔\x20Found\x20','fullPath','segmentId','790170wRYBig','stats','parentFolder','Error:\x20Cannot\x20view\x20parent\x20segment\x20details\x20with\x20this\x20command.','311902UJYJeM','\x20\x20tdx\x20sg\x20show\x20segments/my-audience/premium-users.yml','Site:\x20','Error:\x20Cannot\x20open\x20folder\x20in\x20web\x20browser.\x20Use\x20a\x20segment\x20name\x20instead.','Show\x20child\x20segment\x20schema\x20(column\x20types)','SEGMENT_FOLDER_NOT_FOUND','Create\x20segment\x20folder\x20for\x20organization','Use:\x20tdx\x20ps\x20show','Usage:\x20tdx\x20sg\x20view\x20<name>\x20[-w]','18874827ZEVlRM','Folder\x20ID:\x20','message','folder','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','site','Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.\x20Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','161LXHZTH','Fetching\x20folder\x20\x27','\x20\x20tdx\x20sg\x20desc\x20\x22Premium\x20Users\x22','Usage:\x20tdx\x20sg\x20desc\x20<name>','Resolved\x20relative\x20path\x20to:\x20','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22','Error:\x20Cannot\x20execute\x20query\x20for\x20parent\x20segment\x20with\x20this\x20command.','getSQLFromYamlFile','segment:show','\x20\x20tdx\x20sg\x20sql\x20\x22Premium\x20Users\x22','Error:\x20Cannot\x20open\x20parent\x20segment\x20with\x20this\x20command.','Fetching\x20SQL\x20for\x20segment...','Error:\x20Folder\x20reference\x20is\x20required','parentId','web','length','4915HhngtE','Resolving\x20parent\x20segment\x20\x27','parentSegment','segment:desc','jobId','\x27...','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','folderId','Fetching\x20segment\x20details...','\x20\x20-w,\x20--web\x20\x20Open\x20segment\x20in\x20web\x20browser','Listing\x20folders\x20for\x20parent\x20\x27','json','✔\x20Query\x20completed:\x20Processed\x20','Segment\x20ID:\x20','Resolving\x20\x27','log','segment:folder:show','INVALID_ARGUMENT','SELECT\x20*\x20FROM\x20(\x0a','\x20\x20Cause:\x20','Resolving\x20parent\x20folder\x20\x27','Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required','type','replace','\x20[Job\x20ID:\x20','\x20\x20Server-side\x20segment:\x20\x20tdx\x20sg\x20sql\x20<name>','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20desc\x20<path/to/segment.yml>','processedRows','Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required','Parent\x20name:\x20','Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>','trim','Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>','Error:\x20Specify\x20either\x20segment\x20name\x20or\x20--path,\x20not\x20both','resolveFolderId','test','Show\x20segment\x20or\x20folder\x20details','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20show\x20<path/to/segment.yml>','Parent\x20segment:\x20','getFolder','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','1330246tPaTBP','format','Resolved\x20parent\x20ID:\x20','Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)','279126GUsFJr','Error:\x20Segment\x20name\x20or\x20--path\x20is\x20required','cause','\x20folder','description','Resolved\x20YAML\x20file:\x20','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','Usage:\x20tdx\x20segment\x20describe\x20<path>','error','url','Execute\x20child\x20segment\x20SQL\x20query\x20and\x20show\x20results','Error:\x20Cannot\x20show\x20schema\x20for\x20parent\x20segment\x20with\x20this\x20command.','Examples:','red','Cannot\x20get\x20SQL\x20for\x20parent\x20segment\x20with\x20this\x20command.\x20Use:\x20tdx\x20ps\x20sql','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20-w\x20\x20#\x20Open\x20segment\x20in\x20web\x20browser','\x20\x20Full\x20path:\x20','content','Executing\x20segment\x20query...','toLocaleString','/e/','resolvePathToResource','path','Use:\x20tdx\x20ps\x20view','data','limit','\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','Fetching\x20parent\x20segment\x20details...','Usage:\x20tdx\x20sg\x20show\x20<name>','Error:\x20Cannot\x20show\x20schema\x20for\x20a\x20folder.','Resolved\x20type:\x20','Usage:','Creating\x20folder\x20\x27','/app/ps/','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20view\x20<path/to/segment.yml>','SEGMENT_NOT_FOUND','resolveParentId','Options:','Folder\x20name:\x20','elapsedTimeMillis','getSegmentSQL','listFolders','List\x20segment\x20folders\x20under\x20a\x20parent\x20segment','\x20\x20Segment\x20name:\x20','name','includes','(root)'];a36_0x1da0=function(){return _0x307da7;};return a36_0x1da0();}export class SegmentFolderListCommand extends BaseCommand{[a36_0x5c5596(0x1fb)]=a36_0x5c5596(0x218);['description']=a36_0x5c5596(0x1f9);async['execute'](_0x21d9c6){const _0x3544a9=a36_0x5c5596,{options:_0x120e71,args:_0x32b9ff,tdx:_0x602e49}=_0x21d9c6;if(_0x32b9ff[_0x3544a9(0x246)]===0x0)return console[_0x3544a9(0x1d7)](_0x3544a9(0x208)),console[_0x3544a9(0x1d7)](_0x3544a9(0x265)),0x1;const _0x35a379=_0x32b9ff[0x0];try{_0x120e71[_0x3544a9(0x1fe)]&&(console['error'](_0x3544a9(0x229)+_0x120e71['site']),console[_0x3544a9(0x1d7)](_0x3544a9(0x264)+_0x35a379));const _0x2ad46e=await withSpinner(_0x3544a9(0x248)+_0x35a379+_0x3544a9(0x24c),()=>_0x602e49['segment']['resolveParentId'](_0x35a379),{'verbose':_0x120e71[_0x3544a9(0x1fe)]}),_0x16020d=_0x2ad46e[_0x3544a9(0x1e7)];_0x120e71['verbose']&&console[_0x3544a9(0x1d7)](_0x3544a9(0x1cd)+_0x16020d);const _0x214477=await withSpinner(_0x3544a9(0x251)+_0x35a379+_0x3544a9(0x24c),()=>_0x602e49[_0x3544a9(0x215)][_0x3544a9(0x1f8)](_0x16020d),{'verbose':_0x120e71[_0x3544a9(0x1fe)]}),_0x15835a=_0x214477[_0x3544a9(0x1e7)];return console['error'](_0x3544a9(0x220)+_0x15835a['length']+_0x3544a9(0x1d2)+(_0x15835a[_0x3544a9(0x246)]!==0x1?'s':'')),await handleSDKOutput(_0x15835a,_0x120e71),0x0;}catch(_0x19d1bb){if(_0x19d1bb instanceof SDKError)return console['error'](_0x3544a9(0x20c)+_0x19d1bb['message']),_0x19d1bb['cause']&&console['error'](_0x3544a9(0x25a)+_0x19d1bb['cause']),0x1;throw _0x19d1bb;}}}export class SegmentFolderShowCommand extends BaseCommand{[a36_0x5c5596(0x1fb)]=a36_0x5c5596(0x257);[a36_0x5c5596(0x1d3)]=a36_0x5c5596(0x1ff);async[a36_0x5c5596(0x214)](_0x1f71b9){const _0xb504c0=a36_0x5c5596,{options:_0x208de2,args:_0x4b9225,tdx:_0x5f3bb6}=_0x1f71b9;if(_0x4b9225[_0xb504c0(0x246)]===0x0)return console['error'](_0xb504c0(0x243)),console[_0xb504c0(0x1d7)](_0xb504c0(0x267)),0x1;try{const {parentId:_0xbff0e6,childId:_0x314a0f}=parseSegmentRef(_0x4b9225[0x0]);_0x208de2[_0xb504c0(0x1fe)]&&(console['error'](_0xb504c0(0x229)+_0x208de2[_0xb504c0(0x235)]),console[_0xb504c0(0x1d7)](_0xb504c0(0x264)+_0xbff0e6),_0x314a0f&&console[_0xb504c0(0x1d7)](_0xb504c0(0x1f5)+_0x314a0f));if(!_0x314a0f)return console[_0xb504c0(0x1d7)](_0xb504c0(0x1ce)),0x1;const _0xd9b946=await withSpinner(_0xb504c0(0x248)+_0xbff0e6+_0xb504c0(0x24c),()=>_0x5f3bb6[_0xb504c0(0x215)][_0xb504c0(0x1f3)](_0xbff0e6),{'verbose':_0x208de2['verbose']}),_0x80305b=_0xd9b946[_0xb504c0(0x1e7)];_0x208de2[_0xb504c0(0x1fe)]&&console[_0xb504c0(0x1d7)](_0xb504c0(0x1cd)+_0x80305b);const _0x453f14=await withSpinner('Resolving\x20folder\x20\x27'+_0x314a0f+'\x27...',()=>_0x5f3bb6['segment'][_0xb504c0(0x269)](_0x80305b,_0x314a0f),{'verbose':_0x208de2[_0xb504c0(0x1fe)]}),_0x5d45fd=_0x453f14[_0xb504c0(0x1e7)];_0x208de2[_0xb504c0(0x1fe)]&&console[_0xb504c0(0x1d7)](_0xb504c0(0x21b)+_0x5d45fd);const _0x3abb4c=await withSpinner(_0xb504c0(0x238)+_0x314a0f+_0xb504c0(0x24c),()=>_0x5f3bb6[_0xb504c0(0x215)][_0xb504c0(0x26e)](_0x5d45fd),{'verbose':_0x208de2[_0xb504c0(0x1fe)]});return await handleSDKOutput([_0x3abb4c[_0xb504c0(0x1e7)]],_0x208de2),0x0;}catch(_0x35aca8){if(_0x35aca8 instanceof SDKError)return console[_0xb504c0(0x1d7)](_0xb504c0(0x20c)+_0x35aca8[_0xb504c0(0x232)]),_0x35aca8[_0xb504c0(0x1d1)]&&console[_0xb504c0(0x1d7)](_0xb504c0(0x25a)+_0x35aca8['cause']),0x1;throw _0x35aca8;}}}export class SegmentSQLCommand extends BaseCommand{[a36_0x5c5596(0x1fb)]='segment:sql';['description']=a36_0x5c5596(0x21e);async[a36_0x5c5596(0x214)](_0x26bdfb){const _0x40c2f4=a36_0x5c5596,{options:_0x19ec12,args:_0x3643b8}=_0x26bdfb,_0x3dbf98=_0x19ec12,_0x1c3b87=_0x3dbf98[_0x40c2f4(0x1e5)],_0x59c15b=_0x3643b8[0x0];if(!_0x59c15b&&!_0x1c3b87)return console[_0x40c2f4(0x1d7)](a36_0x56827b['red'](_0x40c2f4(0x1d0))),console[_0x40c2f4(0x1d7)](_0x40c2f4(0x1ee)),console[_0x40c2f4(0x1d7)](_0x40c2f4(0x260)),console['error']('\x20\x20Local\x20YAML\x20file:\x20\x20\x20\x20\x20\x20tdx\x20sg\x20sql\x20--path\x20<file-path>'),console[_0x40c2f4(0x1d7)]('Examples:'),console[_0x40c2f4(0x1d7)](_0x40c2f4(0x240)),console[_0x40c2f4(0x1d7)]('\x20\x20tdx\x20sg\x20sql\x20--path\x20segments/my-audience/premium-users.yml'),0x1;if(_0x59c15b&&_0x1c3b87)return console[_0x40c2f4(0x1d7)](a36_0x56827b[_0x40c2f4(0x1dc)](_0x40c2f4(0x268))),0x1;try{let _0x3b79fb;if(_0x1c3b87)_0x3b79fb=await this[_0x40c2f4(0x23e)](_0x1c3b87,_0x26bdfb);else{if(isYamlFilePath(_0x59c15b))return console[_0x40c2f4(0x1d7)](a36_0x56827b[_0x40c2f4(0x1dc)]('Error:\x20YAML\x20file\x20paths\x20must\x20be\x20specified\x20with\x20--path\x20option')),console[_0x40c2f4(0x1d7)]('\x20\x20tdx\x20sg\x20sql\x20--path\x20'+_0x59c15b),0x1;else _0x3b79fb=await this[_0x40c2f4(0x210)](_0x59c15b,_0x26bdfb);}return _0x19ec12[_0x40c2f4(0x271)]===_0x40c2f4(0x252)||_0x19ec12[_0x40c2f4(0x271)]==='jsonl'?await handleSDKOutput([{'sql':_0x3b79fb}],_0x19ec12):console[_0x40c2f4(0x256)](_0x3b79fb),0x0;}catch(_0x5ec32c){if(_0x5ec32c instanceof SDKError)return console[_0x40c2f4(0x1d7)](_0x40c2f4(0x20c)+_0x5ec32c[_0x40c2f4(0x232)]),_0x5ec32c[_0x40c2f4(0x1d1)]&&console[_0x40c2f4(0x1d7)](_0x40c2f4(0x25a)+_0x5ec32c[_0x40c2f4(0x1d1)]),0x1;throw _0x5ec32c;}}async['getSQLFromYamlFile'](_0x3e83f7,_0xb3e9b3){const _0x33ff9f=a36_0x5c5596,{options:_0x3b5040,tdx:_0x357c2e}=_0xb3e9b3;let _0x4c4fdc;try{_0x4c4fdc=await resolveYamlFilePath(_0x3e83f7);}catch(_0x1591f9){throw new SDKError(ErrorCode[_0x33ff9f(0x258)],_0x33ff9f(0x26f)+_0x1591f9[_0x33ff9f(0x232)]);}_0x3b5040[_0x33ff9f(0x1fe)]&&console[_0x33ff9f(0x1d7)](_0x33ff9f(0x211)+_0x4c4fdc[_0x33ff9f(0x249)]+'/'+_0x4c4fdc[_0x33ff9f(0x21c)]);const _0x545729=await withSpinner('Fetching\x20SQL\x20from\x20rule...',()=>_0x357c2e[_0x33ff9f(0x215)][_0x33ff9f(0x203)](_0x4c4fdc[_0x33ff9f(0x1e0)],_0x4c4fdc[_0x33ff9f(0x249)],_0x4c4fdc[_0x33ff9f(0x21c)]),{'verbose':_0x3b5040[_0x33ff9f(0x1fe)]});return _0x545729['data'];}async[a36_0x5c5596(0x210)](_0x2b2d72,_0xa6c1a8){const _0x3f4678=a36_0x5c5596,{options:_0x5c8fde,tdx:_0x46b16f}=_0xa6c1a8,_0x3cf937=_0x5c8fde[_0x3f4678(0x249)],_0x322654=await resolveSegmentTarget(_0x2b2d72,_0x3cf937,_0x5c8fde[_0x3f4678(0x1fe)]);_0x5c8fde[_0x3f4678(0x1fe)]&&console[_0x3f4678(0x1d7)](_0x3f4678(0x20b)+_0x322654);const _0x3b3224=await withSpinner(_0x3f4678(0x255)+_0x2b2d72+_0x3f4678(0x24c),()=>_0x46b16f[_0x3f4678(0x215)][_0x3f4678(0x1e4)](_0x322654),{'verbose':_0x5c8fde[_0x3f4678(0x1fe)]}),_0x266049=_0x3b3224[_0x3f4678(0x1e7)];_0x5c8fde[_0x3f4678(0x1fe)]&&(console[_0x3f4678(0x1d7)](_0x3f4678(0x1ed)+_0x266049[_0x3f4678(0x25d)]),console[_0x3f4678(0x1d7)](_0x3f4678(0x20a)+_0x266049['parentId']));if(_0x266049[_0x3f4678(0x25d)]===_0x3f4678(0x233))throw new SDKError(ErrorCode[_0x3f4678(0x258)],_0x3f4678(0x236));if(_0x266049[_0x3f4678(0x25d)]==='parent')throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x3f4678(0x1dd));if(!_0x266049[_0x3f4678(0x222)])throw new SDKError(ErrorCode[_0x3f4678(0x1f2)],_0x3f4678(0x206));const _0x342d95=await withSpinner(_0x3f4678(0x242),()=>_0x46b16f[_0x3f4678(0x215)]['getSegmentSQL'](_0x266049[_0x3f4678(0x244)],_0x266049[_0x3f4678(0x222)]),{'verbose':_0x5c8fde[_0x3f4678(0x1fe)]});return _0x342d95['data'];}}export class SegmentFolderCreateCommand extends BaseCommand{[a36_0x5c5596(0x1fb)]='segment:folder:create';[a36_0x5c5596(0x1d3)]=a36_0x5c5596(0x22d);async[a36_0x5c5596(0x214)](_0x463da8){const _0x379076=a36_0x5c5596,{options:_0x56fa1e,args:_0x2d2e9e,tdx:_0x33277b}=_0x463da8,_0x59e83e=_0x56fa1e;if(_0x2d2e9e[_0x379076(0x246)]<0x2)return console['error'](_0x379076(0x25c)),console[_0x379076(0x1d7)](_0x379076(0x201)),0x1;const _0xeb2427=_0x2d2e9e[0x0],_0x20a449=_0x2d2e9e[0x1];_0x59e83e[_0x379076(0x1fe)]&&(console[_0x379076(0x1d7)](_0x379076(0x229)+_0x59e83e[_0x379076(0x235)]),console['error'](_0x379076(0x26d)+_0xeb2427),console['error'](_0x379076(0x1f5)+_0x20a449));let _0x5d46a3;if(_0x59e83e[_0x379076(0x225)]){const _0x427fe8=_0x59e83e[_0x379076(0x225)],_0x14d0d2=await withSpinner(_0x379076(0x248)+_0xeb2427+_0x379076(0x24c),()=>_0x33277b[_0x379076(0x215)][_0x379076(0x1f3)](_0xeb2427),{'verbose':_0x59e83e[_0x379076(0x1fe)]}),_0x3dc280=_0x14d0d2['data'],_0x5c0eba=await withSpinner(_0x379076(0x25b)+_0x427fe8+'\x27...',()=>_0x33277b[_0x379076(0x215)][_0x379076(0x269)](_0x3dc280,_0x427fe8),{'verbose':_0x59e83e['verbose']});_0x5d46a3=_0x5c0eba[_0x379076(0x1e7)],_0x59e83e[_0x379076(0x1fe)]&&console[_0x379076(0x1d7)]('Resolved\x20parent\x20folder\x20ID:\x20'+_0x5d46a3);}const _0x273918={'name':_0x20a449,'description':_0x59e83e[_0x379076(0x1d3)],'parentFolderId':_0x5d46a3},_0x48b4d0=await withSpinner(_0x379076(0x1ef)+_0x20a449+_0x379076(0x24c),()=>_0x33277b['segment'][_0x379076(0x216)](_0xeb2427,_0x273918),{'verbose':_0x59e83e[_0x379076(0x1fe)]}),_0x20ea5d=_0x48b4d0[_0x379076(0x1e7)];return console[_0x379076(0x1d7)]('✔\x20Created\x20folder\x20\x27'+_0x20ea5d[_0x379076(0x1fb)]+'\x27\x20with\x20ID:\x20'+_0x20ea5d['id']),await handleSDKOutput([_0x20ea5d],_0x59e83e),0x0;}}export class SegmentViewCommand extends BaseCommand{['name']=a36_0x5c5596(0x207);['description']='Show\x20folder\x20or\x20child\x20segment\x20details';async[a36_0x5c5596(0x214)](_0x930bf){const _0x2c2c28=a36_0x5c5596,{options:_0x40f464,args:_0x1528a2,tdx:_0x298bd1}=_0x930bf,_0x1c5cf6=_0x1528a2[0x0];if(!_0x1c5cf6)return console[_0x2c2c28(0x1d7)](_0x2c2c28(0x209)),console['error'](_0x2c2c28(0x22f)),console['error'](_0x2c2c28(0x1f1)),console[_0x2c2c28(0x1d7)](_0x2c2c28(0x1f4)),console['error'](_0x2c2c28(0x250)),console[_0x2c2c28(0x1d7)](_0x2c2c28(0x1db)),console[_0x2c2c28(0x1d7)]('\x20\x20tdx\x20sg\x20view\x20\x22Marketing\x22\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20folder\x20details'),console[_0x2c2c28(0x1d7)]('\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20\x20\x20\x20\x20#\x20View\x20child\x20segment\x20details'),console[_0x2c2c28(0x1d7)](_0x2c2c28(0x1de)),console[_0x2c2c28(0x1d7)](_0x2c2c28(0x213)),0x1;try{const _0x2bbd3c=_0x40f464[_0x2c2c28(0x249)],_0x6eeb5f=await resolveSegmentTarget(_0x1c5cf6,_0x2bbd3c,_0x40f464[_0x2c2c28(0x1fe)]);_0x40f464[_0x2c2c28(0x1fe)]&&console['error'](_0x2c2c28(0x20b)+_0x6eeb5f);const _0x2c73fb=await withSpinner(_0x2c2c28(0x255)+_0x1c5cf6+_0x2c2c28(0x24c),()=>_0x298bd1['segment'][_0x2c2c28(0x1e4)](_0x6eeb5f),{'verbose':_0x40f464[_0x2c2c28(0x1fe)]}),_0x414c6e=_0x2c73fb['data'];_0x40f464[_0x2c2c28(0x1fe)]&&(console[_0x2c2c28(0x1d7)](_0x2c2c28(0x1ed)+_0x414c6e[_0x2c2c28(0x25d)]),console[_0x2c2c28(0x1d7)](_0x2c2c28(0x20a)+_0x414c6e[_0x2c2c28(0x244)]),_0x414c6e['folderId']&&console[_0x2c2c28(0x1d7)](_0x2c2c28(0x231)+_0x414c6e[_0x2c2c28(0x24e)]),_0x414c6e[_0x2c2c28(0x222)]&&console['error']('Segment\x20ID:\x20'+_0x414c6e[_0x2c2c28(0x222)]));if(_0x40f464[_0x2c2c28(0x245)]){if(_0x414c6e[_0x2c2c28(0x25d)]==='folder')return console[_0x2c2c28(0x1d7)](_0x2c2c28(0x22a)),0x1;if(_0x414c6e['type']===_0x2c2c28(0x20e))return console[_0x2c2c28(0x1d7)](_0x2c2c28(0x241)),console[_0x2c2c28(0x1d7)](_0x2c2c28(0x20f)),0x1;if(!_0x414c6e['segmentId'])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x2c2c28(0x206));const _0x9671a8=getConsoleNextUrl(_0x40f464['site'],_0x2c2c28(0x1f0)+_0x414c6e[_0x2c2c28(0x244)]+_0x2c2c28(0x1e3)+_0x414c6e[_0x2c2c28(0x222)]);return console[_0x2c2c28(0x1d7)](a36_0x56827b[_0x2c2c28(0x202)]('✔')+'\x20Opening\x20'+a36_0x56827b[_0x2c2c28(0x219)](_0x9671a8)),openBrowser(_0x9671a8),0x0;}if(_0x414c6e['type']===_0x2c2c28(0x233)){if(!_0x414c6e['folderId'])throw new SDKError(ErrorCode[_0x2c2c28(0x22c)],'Folder\x20ID\x20missing\x20from\x20resolved\x20path');const _0x30974d=await withSpinner('Fetching\x20folder\x20details...',()=>_0x298bd1[_0x2c2c28(0x215)]['getFolder'](_0x414c6e[_0x2c2c28(0x24e)]),{'verbose':_0x40f464[_0x2c2c28(0x1fe)]});await handleSingleObjectOutput(_0x30974d[_0x2c2c28(0x1e7)],_0x40f464);}else{if(_0x414c6e[_0x2c2c28(0x25d)]===_0x2c2c28(0x215)){if(!_0x414c6e['segmentId'])throw new SDKError(ErrorCode[_0x2c2c28(0x1f2)],_0x2c2c28(0x206));const _0x3b2b59=await withSpinner(_0x2c2c28(0x24f),()=>_0x298bd1['segment']['getSegment'](_0x414c6e[_0x2c2c28(0x244)],_0x414c6e[_0x2c2c28(0x222)]),{'verbose':_0x40f464['verbose']}),_0x50a9fc=getConsoleNextUrl(_0x40f464[_0x2c2c28(0x235)],_0x2c2c28(0x1f0)+_0x414c6e[_0x2c2c28(0x244)]+'/e/'+_0x414c6e[_0x2c2c28(0x222)]),_0x47ba63=_0x3b2b59[_0x2c2c28(0x1e7)];_0x47ba63[_0x2c2c28(0x1d8)]=_0x50a9fc,await handleSingleObjectOutput(_0x47ba63,_0x40f464);}else return console[_0x2c2c28(0x1d7)](_0x2c2c28(0x226)),console[_0x2c2c28(0x1d7)](_0x2c2c28(0x1e6)),0x1;}return 0x0;}catch(_0x360fef){if(_0x360fef instanceof SDKError)return console[_0x2c2c28(0x1d7)](_0x2c2c28(0x20c)+_0x360fef[_0x2c2c28(0x232)]),_0x360fef[_0x2c2c28(0x1d1)]&&console[_0x2c2c28(0x1d7)]('\x20\x20Cause:\x20'+_0x360fef['cause']),0x1;throw _0x360fef;}}}export const SegmentInfoCommand=SegmentViewCommand;export class SegmentDescCommand extends BaseCommand{[a36_0x5c5596(0x1fb)]=a36_0x5c5596(0x24a);['description']=a36_0x5c5596(0x22b);async[a36_0x5c5596(0x214)](_0x1284ed){const _0x40032b=a36_0x5c5596,{options:_0x5dd91c,args:_0x2e6e81,tdx:_0x4fefa7}=_0x1284ed,_0x55727f=_0x2e6e81[0x0];if(!_0x55727f)return console[_0x40032b(0x1d7)](_0x40032b(0x263)),console['error'](_0x40032b(0x23a)),console[_0x40032b(0x1d7)](_0x40032b(0x261)),console[_0x40032b(0x1d7)]('Examples:'),console[_0x40032b(0x1d7)](_0x40032b(0x239)),console[_0x40032b(0x1d7)]('\x20\x20tdx\x20sg\x20desc\x20segments/my-audience/premium-users.yml'),0x1;try{const _0x421669=_0x5dd91c[_0x40032b(0x249)],_0x595198=await resolveSegmentTarget(_0x55727f,_0x421669,_0x5dd91c[_0x40032b(0x1fe)]);_0x5dd91c[_0x40032b(0x1fe)]&&console[_0x40032b(0x1d7)](_0x40032b(0x20b)+_0x595198);const _0x305f58=await withSpinner(_0x40032b(0x255)+_0x55727f+'\x27...',()=>_0x4fefa7[_0x40032b(0x215)]['resolvePathToResource'](_0x595198),{'verbose':_0x5dd91c['verbose']}),_0x10e387=_0x305f58['data'];_0x5dd91c[_0x40032b(0x1fe)]&&(console['error'](_0x40032b(0x1ed)+_0x10e387['type']),console[_0x40032b(0x1d7)](_0x40032b(0x20a)+_0x10e387[_0x40032b(0x244)]));if(_0x10e387[_0x40032b(0x25d)]===_0x40032b(0x233))return console[_0x40032b(0x1d7)](_0x40032b(0x1ec)),console[_0x40032b(0x1d7)](_0x40032b(0x24d)),0x1;if(_0x10e387['type']===_0x40032b(0x20e))return console[_0x40032b(0x1d7)](_0x40032b(0x1da)),console[_0x40032b(0x1d7)](_0x40032b(0x21a)),0x1;if(!_0x10e387['segmentId'])throw new SDKError(ErrorCode[_0x40032b(0x1f2)],_0x40032b(0x206));const _0xbcb7d1=await withSpinner('Fetching\x20SQL\x20for\x20segment...',()=>_0x4fefa7['segment'][_0x40032b(0x1f7)](_0x10e387[_0x40032b(0x244)],_0x10e387['segmentId']),{'verbose':_0x5dd91c['verbose']}),_0xc8fafc=_0xbcb7d1[_0x40032b(0x1e7)],_0x2b5185=await executeSchemaQuery(_0xc8fafc,_0x4fefa7,_0x5dd91c);return await handleQueryOutput(_0x2b5185,_0x5dd91c),0x0;}catch(_0x335b3d){if(_0x335b3d instanceof SDKError)return console[_0x40032b(0x1d7)](_0x40032b(0x20c)+_0x335b3d[_0x40032b(0x232)]),_0x335b3d[_0x40032b(0x1d1)]&&console[_0x40032b(0x1d7)](_0x40032b(0x25a)+_0x335b3d[_0x40032b(0x1d1)]),0x1;throw _0x335b3d;}}}
@@ -1 +1 @@
1
- const a37_0x1b05b0=a37_0x17bd;(function(_0x2d9171,_0x2d4a2e){const _0x594454=a37_0x17bd,_0x4d8f09=_0x2d9171();while(!![]){try{const _0x40fb3c=parseInt(_0x594454(0x122))/0x1+parseInt(_0x594454(0x157))/0x2+-parseInt(_0x594454(0x13c))/0x3+-parseInt(_0x594454(0x156))/0x4*(-parseInt(_0x594454(0x129))/0x5)+-parseInt(_0x594454(0x139))/0x6*(parseInt(_0x594454(0x143))/0x7)+parseInt(_0x594454(0x145))/0x8*(-parseInt(_0x594454(0x11f))/0x9)+-parseInt(_0x594454(0x12d))/0xa*(-parseInt(_0x594454(0x144))/0xb);if(_0x40fb3c===_0x2d4a2e)break;else _0x4d8f09['push'](_0x4d8f09['shift']());}catch(_0x32ff32){_0x4d8f09['push'](_0x4d8f09['shift']());}}}(a37_0x5198,0x97d96));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';function a37_0x5198(){const _0x29be82=['segment:create','noCountPopulation','includes','resolveParentId','name','✔\x20Created\x20segment\x20\x27','error','Examples:','Resolved\x20relative\x20path\x20to:\x20','parent','segmentPath','9132DKQTPc','description','Parent:\x20','3215670mGOjOT','Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]','Resolving\x20folder\x20\x27','\x27...','Site:\x20','Resolving\x20folder\x20path\x20\x27','invisible','2779YaEDOj','11IccQlf','120YOAKNA','data','resolvePathToResource','segments','\x27\x20with\x20ID:\x20','yellow','Parent\x20path:\x20','Resolving\x20parent\x20segment\x20\x27','Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.','Segment\x20name:\x20','Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]','⚠\x20Deprecation\x20warning:\x20`segment\x20create`\x20is\x20deprecated.','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','Target\x20path:\x20','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','rule','length','16EgtEop','1913150RdYEwR','segment','51687MflqOY','type','kind','500491jyXLGK','\x20\x20\x20Path:\x20','ruleFile','Resolved\x20folder\x20ID:\x20','verbose','folder','Creating\x20segment\x20\x27','1144495QLUmvm','execute','Create\x20child\x20segment\x20with\x20filtering\x20rules','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27','115810pbrVUY'];a37_0x5198=function(){return _0x29be82;};return a37_0x5198();}import{loadJSONFromOptions}from'../utils/json-loader.js';import{parsePath,getParentPath,getBaseName}from'../sdk/segment/segment-path-parser.js';import a37_0x4ebc07 from'chalk';function a37_0x17bd(_0x586fcc,_0x3a00b6){_0x586fcc=_0x586fcc-0x11f;const _0x51989c=a37_0x5198();let _0x17bdcd=_0x51989c[_0x586fcc];return _0x17bdcd;}export class SegmentCreateCommand extends BaseCommand{[a37_0x1b05b0(0x132)]=a37_0x1b05b0(0x12e);[a37_0x1b05b0(0x13a)]=a37_0x1b05b0(0x12b);async[a37_0x1b05b0(0x12a)](_0x4ef04d){const _0xb1cb8f=a37_0x1b05b0;console['error'](a37_0x4ebc07['yellow'](_0xb1cb8f(0x150))),console[_0xb1cb8f(0x134)](a37_0x4ebc07[_0xb1cb8f(0x14a)](_0xb1cb8f(0x153)));const {options:_0x18fcd4,args:_0x4c67fb,tdx:_0x55daab}=_0x4ef04d,_0x30fdbe=_0x18fcd4;if(_0x4c67fb[_0xb1cb8f(0x155)]===0x0)return console[_0xb1cb8f(0x134)](_0xb1cb8f(0x151)),console[_0xb1cb8f(0x134)](_0xb1cb8f(0x14f)),console[_0xb1cb8f(0x134)](_0xb1cb8f(0x135)),console[_0xb1cb8f(0x134)](_0xb1cb8f(0x12c)),console[_0xb1cb8f(0x134)]('\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27'),console['error']('\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context'),0x1;const _0x40d9f7=_0x4c67fb[0x0],_0x2f4431=_0x18fcd4[_0xb1cb8f(0x138)];let _0x2bdffe=_0x40d9f7;_0x2f4431&&!_0x40d9f7[_0xb1cb8f(0x130)]('/')&&(_0x2bdffe=_0x2f4431+'/'+_0x40d9f7,_0x30fdbe['verbose']&&console['error'](_0xb1cb8f(0x136)+_0x2bdffe));const _0x5ab2a6=parsePath(_0x2bdffe);if(_0x5ab2a6[_0xb1cb8f(0x148)]['length']<0x2)return console[_0xb1cb8f(0x134)]('Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)'),console['error'](_0xb1cb8f(0x13d)),0x1;const _0x2dbbed=_0x5ab2a6[_0xb1cb8f(0x148)][0x0],_0x3a203e=getBaseName(_0x2bdffe),_0x417b24=getParentPath(_0x2bdffe);_0x30fdbe[_0xb1cb8f(0x126)]&&(console['error'](_0xb1cb8f(0x140)+_0x30fdbe['site']),console['error'](_0xb1cb8f(0x152)+_0x2bdffe),console['error'](_0xb1cb8f(0x13b)+_0x2dbbed),console['error'](_0xb1cb8f(0x14e)+_0x3a203e),console['error'](_0xb1cb8f(0x14b)+_0x417b24));const _0x6314bc=await withSpinner(_0xb1cb8f(0x14c)+_0x2dbbed+'\x27...',()=>_0x55daab[_0xb1cb8f(0x158)][_0xb1cb8f(0x131)](_0x2dbbed),{'verbose':_0x30fdbe[_0xb1cb8f(0x126)]}),_0x34ce27=_0x6314bc[_0xb1cb8f(0x146)];let _0x221f75;if(_0x5ab2a6['segments'][_0xb1cb8f(0x155)]>0x2){const _0x582c2c=await withSpinner(_0xb1cb8f(0x141)+_0x417b24+_0xb1cb8f(0x13f),()=>_0x55daab[_0xb1cb8f(0x158)][_0xb1cb8f(0x147)](_0x417b24),{'verbose':_0x30fdbe[_0xb1cb8f(0x126)]}),_0x560885=_0x582c2c[_0xb1cb8f(0x146)];if(_0x560885[_0xb1cb8f(0x120)]!==_0xb1cb8f(0x127)&&_0x560885[_0xb1cb8f(0x120)]!==_0xb1cb8f(0x137))return console['error'](_0xb1cb8f(0x14d)),0x1;_0x221f75=_0x560885['folderId'];}else{if(_0x30fdbe[_0xb1cb8f(0x127)]){const _0x4fef10=await withSpinner(_0xb1cb8f(0x13e)+_0x30fdbe[_0xb1cb8f(0x127)]+_0xb1cb8f(0x13f),()=>_0x55daab['segment']['resolveFolderId'](_0x34ce27,_0x30fdbe[_0xb1cb8f(0x127)]),{'verbose':_0x30fdbe['verbose']});_0x221f75=_0x4fef10[_0xb1cb8f(0x146)];}}_0x30fdbe[_0xb1cb8f(0x126)]&&_0x221f75&&console['error'](_0xb1cb8f(0x125)+_0x221f75);const _0x166b86=await loadJSONFromOptions(_0x30fdbe[_0xb1cb8f(0x154)],_0x30fdbe[_0xb1cb8f(0x124)]),_0x176940={'name':_0x3a203e,'description':_0x30fdbe[_0xb1cb8f(0x13a)],'rule':_0x166b86,'kind':_0x30fdbe[_0xb1cb8f(0x121)]!==undefined?parseInt(_0x30fdbe[_0xb1cb8f(0x121)],0xa):undefined,'isVisible':_0x30fdbe[_0xb1cb8f(0x142)]?![]:undefined,'segmentFolderId':_0x221f75,'countPopulation':_0x30fdbe[_0xb1cb8f(0x12f)]?![]:undefined},_0x1462a2=await withSpinner(_0xb1cb8f(0x128)+_0x3a203e+_0xb1cb8f(0x13f),()=>_0x55daab[_0xb1cb8f(0x158)]['createSegment'](_0x34ce27,_0x176940),{'verbose':_0x30fdbe['verbose']}),_0x3b1575=_0x1462a2[_0xb1cb8f(0x146)];return console[_0xb1cb8f(0x134)](_0xb1cb8f(0x133)+_0x3b1575[_0xb1cb8f(0x132)]+_0xb1cb8f(0x149)+_0x3b1575['id']),_0x2bdffe!==_0x40d9f7&&console['error'](_0xb1cb8f(0x123)+_0x2bdffe),await handleSDKOutput([_0x3b1575],_0x30fdbe),0x0;}}
1
+ const a37_0xe9563=a37_0x92fe;(function(_0x42b96a,_0x428a4b){const _0x5ac83f=a37_0x92fe,_0x466712=_0x42b96a();while(!![]){try{const _0xd1e06c=-parseInt(_0x5ac83f(0x1ef))/0x1+-parseInt(_0x5ac83f(0x1e8))/0x2*(parseInt(_0x5ac83f(0x1dc))/0x3)+-parseInt(_0x5ac83f(0x1f6))/0x4+parseInt(_0x5ac83f(0x1e1))/0x5+-parseInt(_0x5ac83f(0x1fe))/0x6+parseInt(_0x5ac83f(0x1cc))/0x7+parseInt(_0x5ac83f(0x1d4))/0x8;if(_0xd1e06c===_0x428a4b)break;else _0x466712['push'](_0x466712['shift']());}catch(_0x2caf82){_0x466712['push'](_0x466712['shift']());}}}(a37_0x18c2,0x554a1));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';function a37_0x92fe(_0xcde186,_0x163e24){_0xcde186=_0xcde186-0x1ca;const _0x18c268=a37_0x18c2();let _0x92febe=_0x18c268[_0xcde186];return _0x92febe;}import{parsePath,getParentPath,getBaseName}from'../sdk/segment/segment-path-parser.js';import a37_0x187ced from'chalk';function a37_0x18c2(){const _0x341960=['✔\x20Created\x20segment\x20\x27','\x20\x20\x20Path:\x20','error','name','Create\x20child\x20segment\x20with\x20filtering\x20rules','Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)','978066RssqsD','segments','\x27\x20with\x20ID:\x20','Resolving\x20parent\x20segment\x20\x27','4848466opVLrQ','Resolved\x20relative\x20path\x20to:\x20','execute','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27','segment','resolveFolderId','folderId','4600584jJwIUi','segmentPath','createSegment','length','⚠\x20Deprecation\x20warning:\x20`segment\x20create`\x20is\x20deprecated.','resolveParentId','\x27...','Examples:','3AQkfnl','Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]','Resolved\x20folder\x20ID:\x20','type','Segment\x20name:\x20','452315nIMlfM','description','folder','\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','Creating\x20segment\x20\x27','data','Parent:\x20','255476VjKOZU','segment:create','resolvePathToResource','Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27','verbose','Resolving\x20folder\x20\x27','561510OpNefX','kind','invisible','Resolving\x20folder\x20path\x20\x27','yellow','rule','noCountPopulation','626280BwSatt','ruleFile'];a37_0x18c2=function(){return _0x341960;};return a37_0x18c2();}export class SegmentCreateCommand extends BaseCommand{[a37_0xe9563(0x1fb)]=a37_0xe9563(0x1e9);[a37_0xe9563(0x1e2)]=a37_0xe9563(0x1fc);async[a37_0xe9563(0x1ce)](_0x49a595){const _0x4392c7=a37_0xe9563;console['error'](a37_0x187ced[_0x4392c7(0x1f3)](_0x4392c7(0x1d8))),console[_0x4392c7(0x1fa)](a37_0x187ced[_0x4392c7(0x1f3)]('\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a'));const {options:_0x545be1,args:_0xca4279,tdx:_0x5acc5c}=_0x49a595,_0x5f359b=_0x545be1;if(_0xca4279[_0x4392c7(0x1d7)]===0x0)return console[_0x4392c7(0x1fa)](_0x4392c7(0x1cf)),console[_0x4392c7(0x1fa)](_0x4392c7(0x1eb)),console[_0x4392c7(0x1fa)](_0x4392c7(0x1db)),console['error'](_0x4392c7(0x1d0)),console[_0x4392c7(0x1fa)](_0x4392c7(0x1ec)),console[_0x4392c7(0x1fa)](_0x4392c7(0x1e4)),0x1;const _0x24e2b3=_0xca4279[0x0],_0x25a608=_0x545be1[_0x4392c7(0x1d5)];let _0x4fb789=_0x24e2b3;_0x25a608&&!_0x24e2b3['includes']('/')&&(_0x4fb789=_0x25a608+'/'+_0x24e2b3,_0x5f359b[_0x4392c7(0x1ed)]&&console['error'](_0x4392c7(0x1cd)+_0x4fb789));const _0x4a5a82=parsePath(_0x4fb789);if(_0x4a5a82[_0x4392c7(0x1ff)][_0x4392c7(0x1d7)]<0x2)return console['error'](_0x4392c7(0x1fd)),console['error'](_0x4392c7(0x1dd)),0x1;const _0x4fafa9=_0x4a5a82['segments'][0x0],_0x3a3657=getBaseName(_0x4fb789),_0x3ba7f3=getParentPath(_0x4fb789);_0x5f359b[_0x4392c7(0x1ed)]&&(console[_0x4392c7(0x1fa)]('Site:\x20'+_0x5f359b['site']),console[_0x4392c7(0x1fa)]('Target\x20path:\x20'+_0x4fb789),console[_0x4392c7(0x1fa)](_0x4392c7(0x1e7)+_0x4fafa9),console[_0x4392c7(0x1fa)](_0x4392c7(0x1e0)+_0x3a3657),console[_0x4392c7(0x1fa)]('Parent\x20path:\x20'+_0x3ba7f3));const _0x58b6f4=await withSpinner(_0x4392c7(0x1cb)+_0x4fafa9+'\x27...',()=>_0x5acc5c[_0x4392c7(0x1d1)][_0x4392c7(0x1d9)](_0x4fafa9),{'verbose':_0x5f359b['verbose']}),_0x31ebf4=_0x58b6f4[_0x4392c7(0x1e6)];let _0x5a2f46;if(_0x4a5a82[_0x4392c7(0x1ff)][_0x4392c7(0x1d7)]>0x2){const _0x5855f5=await withSpinner(_0x4392c7(0x1f2)+_0x3ba7f3+_0x4392c7(0x1da),()=>_0x5acc5c[_0x4392c7(0x1d1)][_0x4392c7(0x1ea)](_0x3ba7f3),{'verbose':_0x5f359b[_0x4392c7(0x1ed)]}),_0x4ac560=_0x5855f5[_0x4392c7(0x1e6)];if(_0x4ac560[_0x4392c7(0x1df)]!==_0x4392c7(0x1e3)&&_0x4ac560[_0x4392c7(0x1df)]!=='parent')return console['error']('Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.'),0x1;_0x5a2f46=_0x4ac560[_0x4392c7(0x1d3)];}else{if(_0x5f359b['folder']){const _0x1d25d1=await withSpinner(_0x4392c7(0x1ee)+_0x5f359b[_0x4392c7(0x1e3)]+_0x4392c7(0x1da),()=>_0x5acc5c['segment'][_0x4392c7(0x1d2)](_0x31ebf4,_0x5f359b['folder']),{'verbose':_0x5f359b[_0x4392c7(0x1ed)]});_0x5a2f46=_0x1d25d1['data'];}}_0x5f359b['verbose']&&_0x5a2f46&&console[_0x4392c7(0x1fa)](_0x4392c7(0x1de)+_0x5a2f46);const _0x4ff80=await loadJSONFromOptions(_0x5f359b[_0x4392c7(0x1f4)],_0x5f359b[_0x4392c7(0x1f7)]),_0x8609d8={'name':_0x3a3657,'description':_0x5f359b[_0x4392c7(0x1e2)],'rule':_0x4ff80,'kind':_0x5f359b[_0x4392c7(0x1f0)]!==undefined?parseInt(_0x5f359b[_0x4392c7(0x1f0)],0xa):undefined,'isVisible':_0x5f359b[_0x4392c7(0x1f1)]?![]:undefined,'segmentFolderId':_0x5a2f46,'countPopulation':_0x5f359b[_0x4392c7(0x1f5)]?![]:undefined},_0x4ed605=await withSpinner(_0x4392c7(0x1e5)+_0x3a3657+_0x4392c7(0x1da),()=>_0x5acc5c['segment'][_0x4392c7(0x1d6)](_0x31ebf4,_0x8609d8),{'verbose':_0x5f359b['verbose']}),_0xc72208=_0x4ed605[_0x4392c7(0x1e6)];return console[_0x4392c7(0x1fa)](_0x4392c7(0x1f8)+_0xc72208[_0x4392c7(0x1fb)]+_0x4392c7(0x1ca)+_0xc72208['id']),_0x4fb789!==_0x24e2b3&&console[_0x4392c7(0x1fa)](_0x4392c7(0x1f9)+_0x4fb789),await handleSDKOutput([_0xc72208],_0x5f359b),0x0;}}
@@ -1 +1 @@
1
- function a38_0x4e34(){const _0x451ed9=['verbose','466552gkbFGX','segment','25CkGZlk','8lGHGSS','\x20field','data','8bECGde','listFields','Listing\x20fields\x20for\x20\x27','✔\x20Found\x20','12370lbOtyY','parentSegment','Site:\x20','3110580RPsYQP','Usage:\x20tdx\x20segment\x20fields\x20<parent_name>','Parent\x20segment:\x20','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','jsonl','44172rMoDLQ','error','name','720282Nrpzhr','\x27...','3885126dGrLbB','segment:fields','length','2882uOehYS','json','execute','2059020NNmnno'];a38_0x4e34=function(){return _0x451ed9;};return a38_0x4e34();}const a38_0x5b243e=a38_0x5db6;(function(_0x5d4d16,_0x33274a){const _0x3765b4=a38_0x5db6,_0x4822aa=_0x5d4d16();while(!![]){try{const _0x4ea285=parseInt(_0x3765b4(0x113))/0x1*(-parseInt(_0x3765b4(0x107))/0x2)+parseInt(_0x3765b4(0x11e))/0x3+-parseInt(_0x3765b4(0x120))/0x4+-parseInt(_0x3765b4(0x103))/0x5*(parseInt(_0x3765b4(0x116))/0x6)+-parseInt(_0x3765b4(0x118))/0x7*(-parseInt(_0x3765b4(0x104))/0x8)+parseInt(_0x3765b4(0x10e))/0x9+-parseInt(_0x3765b4(0x10b))/0xa*(parseInt(_0x3765b4(0x11b))/0xb);if(_0x4ea285===_0x33274a)break;else _0x4822aa['push'](_0x4822aa['shift']());}catch(_0x278027){_0x4822aa['push'](_0x4822aa['shift']());}}}(a38_0x4e34,0x5a2ab));import{BaseCommand}from'./command.js';function a38_0x5db6(_0x24e228,_0xd50d9f){_0x24e228=_0x24e228-0x102;const _0x4e34d2=a38_0x4e34();let _0x5db688=_0x4e34d2[_0x24e228];return _0x5db688;}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{[a38_0x5b243e(0x115)]=a38_0x5b243e(0x119);['description']='List\x20available\x20fields\x20for\x20segmentation';async[a38_0x5b243e(0x11d)](_0x56a4d1){const _0x557c92=a38_0x5b243e,{options:_0x4dac51,args:_0x34e8d7,tdx:_0x123d50}=_0x56a4d1,_0x1671f9=_0x34e8d7[0x0]||_0x4dac51[_0x557c92(0x10c)];if(!_0x1671f9)return console[_0x557c92(0x114)]('Error:\x20Parent\x20segment\x20name\x20is\x20required'),console[_0x557c92(0x114)](_0x557c92(0x10f)),console[_0x557c92(0x114)](_0x557c92(0x111)),0x1;_0x4dac51[_0x557c92(0x11f)]&&(console['error'](_0x557c92(0x10d)+_0x4dac51['site']),console['error'](_0x557c92(0x110)+_0x1671f9));const _0x2c0f97=await withSpinner(_0x557c92(0x109)+_0x1671f9+_0x557c92(0x117),()=>_0x123d50[_0x557c92(0x102)][_0x557c92(0x108)](_0x1671f9),{'verbose':_0x4dac51['verbose']}),_0xd2e53e=_0x2c0f97[_0x557c92(0x106)];console['error'](_0x557c92(0x10a)+_0xd2e53e[_0x557c92(0x11a)]+_0x557c92(0x105)+(_0xd2e53e[_0x557c92(0x11a)]!==0x1?'s':''));if(_0x4dac51[_0x557c92(0x11c)]||_0x4dac51[_0x557c92(0x112)])return await handleSDKOutput(_0xd2e53e,_0x4dac51),0x0;return displayFieldsHumanReadable(_0xd2e53e,_0x1671f9),0x0;}}
1
+ const a38_0x8f6d93=a38_0x10d1;(function(_0x5ad817,_0x961435){const _0x399891=a38_0x10d1,_0x3c48c9=_0x5ad817();while(!![]){try{const _0x4d87ab=-parseInt(_0x399891(0x16a))/0x1*(-parseInt(_0x399891(0x16c))/0x2)+parseInt(_0x399891(0x17f))/0x3+-parseInt(_0x399891(0x183))/0x4+parseInt(_0x399891(0x178))/0x5*(parseInt(_0x399891(0x186))/0x6)+parseInt(_0x399891(0x184))/0x7*(parseInt(_0x399891(0x177))/0x8)+parseInt(_0x399891(0x17e))/0x9+-parseInt(_0x399891(0x16e))/0xa*(parseInt(_0x399891(0x175))/0xb);if(_0x4d87ab===_0x961435)break;else _0x3c48c9['push'](_0x3c48c9['shift']());}catch(_0xc48935){_0x3c48c9['push'](_0x3c48c9['shift']());}}}(a38_0x4f0e,0xf1c73));function a38_0x4f0e(){const _0xc4e215=['json','7640nqemxt','3310hNgjmZ','length','Usage:\x20tdx\x20segment\x20fields\x20<parent_name>','Listing\x20fields\x20for\x20\x27','description','verbose','3197979sBwEoo','1086702LslGTs','List\x20available\x20fields\x20for\x20segmentation','segment:fields','segment','7594988nNHWVH','504meYmgC','listFields','9078LLdUjO','\x27...','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','error','89WDFSrl','data','41194EThSGa','execute','7319940DIyDGt','\x20field','parentSegment','site','name','Site:\x20','✔\x20Found\x20','11EPjbiR'];a38_0x4f0e=function(){return _0xc4e215;};return a38_0x4f0e();}import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';function a38_0x10d1(_0x166281,_0x342ae6){_0x166281=_0x166281-0x168;const _0x4f0ef7=a38_0x4f0e();let _0x10d104=_0x4f0ef7[_0x166281];return _0x10d104;}import{withSpinner}from'../utils/spinner.js';import{displayFieldsHumanReadable}from'../sdk/segment/fields-display.js';export class SegmentFieldsCommand extends BaseCommand{[a38_0x8f6d93(0x172)]=a38_0x8f6d93(0x181);[a38_0x8f6d93(0x17c)]=a38_0x8f6d93(0x180);async[a38_0x8f6d93(0x16d)](_0x10f5e5){const _0x50a693=a38_0x8f6d93,{options:_0x34c4cd,args:_0x63136c,tdx:_0x5517e7}=_0x10f5e5,_0x2aad8a=_0x63136c[0x0]||_0x34c4cd[_0x50a693(0x170)];if(!_0x2aad8a)return console[_0x50a693(0x169)]('Error:\x20Parent\x20segment\x20name\x20is\x20required'),console[_0x50a693(0x169)](_0x50a693(0x17a)),console[_0x50a693(0x169)](_0x50a693(0x168)),0x1;_0x34c4cd[_0x50a693(0x17d)]&&(console[_0x50a693(0x169)](_0x50a693(0x173)+_0x34c4cd[_0x50a693(0x171)]),console[_0x50a693(0x169)]('Parent\x20segment:\x20'+_0x2aad8a));const _0x4d0d65=await withSpinner(_0x50a693(0x17b)+_0x2aad8a+_0x50a693(0x187),()=>_0x5517e7[_0x50a693(0x182)][_0x50a693(0x185)](_0x2aad8a),{'verbose':_0x34c4cd[_0x50a693(0x17d)]}),_0x4b54c6=_0x4d0d65[_0x50a693(0x16b)];console['error'](_0x50a693(0x174)+_0x4b54c6[_0x50a693(0x179)]+_0x50a693(0x16f)+(_0x4b54c6[_0x50a693(0x179)]!==0x1?'s':''));if(_0x34c4cd[_0x50a693(0x176)]||_0x34c4cd['jsonl'])return await handleSDKOutput(_0x4b54c6,_0x34c4cd),0x0;return displayFieldsHumanReadable(_0x4b54c6,_0x2aad8a),0x0;}}
@@ -1 +1 @@
1
- const a39_0x1576af=a39_0x297a;(function(_0x2b8957,_0x52968b){const _0x20fdce=a39_0x297a,_0x11ef8b=_0x2b8957();while(!![]){try{const _0x5eb2a2=parseInt(_0x20fdce(0xd0))/0x1+-parseInt(_0x20fdce(0xd7))/0x2*(parseInt(_0x20fdce(0xbc))/0x3)+parseInt(_0x20fdce(0xea))/0x4+-parseInt(_0x20fdce(0xc3))/0x5+-parseInt(_0x20fdce(0xcc))/0x6*(-parseInt(_0x20fdce(0xe1))/0x7)+-parseInt(_0x20fdce(0xa8))/0x8+parseInt(_0x20fdce(0xbe))/0x9*(parseInt(_0x20fdce(0xf3))/0xa);if(_0x5eb2a2===_0x52968b)break;else _0x11ef8b['push'](_0x11ef8b['shift']());}catch(_0x27535b){_0x11ef8b['push'](_0x11ef8b['shift']());}}}(a39_0x800a,0x558ff));function a39_0x800a(){const _0x2ca172=['filter','223926NSOdic','Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files','3303jlthBR','No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27','Aborted.','counts','Pulling\x20segments\x20from\x20\x27','3103010KWMqNM','execute','dim','✔\x20Pulled\x20','diff','repeat','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent','journeyVersions','\x20files\x20to\x20','82722mEkRHW','\x20versions)','message','cyan','649874EneHUm','content','absolutePath','verbose','journeys','hasChanges','\x20\x20🗺️\x20\x20','10EvZsMG','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','Site:\x20','isNew','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','site','resourceName','yellow','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','dryRun','119VXOEIC','relativePath','files','\x20new\x20files','\x27...','activations','segments','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','-\x20no\x20files\x20written','1818688TLAaHo','description','data','segment:pull','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)','pullSegments','dirname','targetDir','session','18340gcANHq','\x20activations','parentName','\x20\x20🎯\x20','5341824nfmYFi','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file','\x0aError:','helpText','\x20journeys','yes','✔\x20All\x20files\x20are\x20up\x20to\x20date','\x20unchanged\x20files','green','\x20changed\x20files','red','length','segment','name','\x20=\x20','file','✔\x20Context\x20set:\x20','error','\x20segments'];a39_0x800a=function(){return _0x2ca172;};return a39_0x800a();}import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';function a39_0x297a(_0x2501fa,_0x59929d){_0x2501fa=_0x2501fa-0xa8;const _0x800a21=a39_0x800a();let _0x297aa6=_0x800a21[_0x2501fa];return _0x297aa6;}import{saveSessionContext}from'../core/session.js';import a39_0x5572c1 from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';import a39_0x2e4317 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{[a39_0x1576af(0xb5)]=a39_0x1576af(0xed);[a39_0x1576af(0xeb)]=a39_0x1576af(0xbd);async[a39_0x1576af(0xc4)](_0x30e3a0){const _0x3376d1=a39_0x1576af,{options:_0x113543,args:_0x54ce78,tdx:_0x39b921}=_0x30e3a0,_0x533a85=_0x113543,_0x5f1ffc=await resolveTarget({'arg':_0x54ce78[0x0],'contextParent':_0x113543['parentSegment'],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x5f1ffc))return _0x5f1ffc['errorCode']==='no_parent'?(console['error'](a39_0x5572c1[_0x3376d1(0xde)](_0x3376d1(0xd8))),console[_0x3376d1(0xb9)](_0x3376d1(0xee)),console[_0x3376d1(0xb9)](_0x3376d1(0xc9)),console[_0x3376d1(0xb9)](_0x3376d1(0xa9))):(console[_0x3376d1(0xb9)](a39_0x5572c1[_0x3376d1(0xb2)]('Error:\x20'+_0x5f1ffc[_0x3376d1(0xce)]+'\x0a')),_0x5f1ffc['helpText']&&console[_0x3376d1(0xb9)](a39_0x5572c1[_0x3376d1(0xcf)](_0x5f1ffc[_0x3376d1(0xab)]))),0x1;const _0x434afd=_0x5f1ffc[_0x3376d1(0xf5)],_0x70f78c=_0x5f1ffc[_0x3376d1(0xf1)],_0xbeeb03=_0x5f1ffc['type']===_0x3376d1(0xb7)?_0x5f1ffc[_0x3376d1(0xdd)]:undefined;_0x533a85[_0x3376d1(0xd3)]&&(console['error'](_0x3376d1(0xd9)+_0x533a85[_0x3376d1(0xdc)]),console[_0x3376d1(0xb9)]('Parent\x20segment:\x20'+_0x434afd),_0xbeeb03&&console[_0x3376d1(0xb9)]('Target\x20resource:\x20'+_0xbeeb03));const _0x213e63=await withProgressSpinner(_0x3376d1(0xc2)+_0x434afd+_0x3376d1(0xe5),_0xecd65=>_0x39b921[_0x3376d1(0xb4)][_0x3376d1(0xef)](_0x434afd,{'targetDir':_0x70f78c,'targetResourceName':_0xbeeb03,'verbose':_0x533a85[_0x3376d1(0xd3)],'progress':{'update':_0x340fd3=>{const _0x407e75=_0x3376d1;_0xecd65['setPhase'](_0x340fd3),_0x533a85[_0x407e75(0xd3)]&&console[_0x407e75(0xb9)]('\x20\x20'+_0x340fd3);}}}),{'verbose':_0x533a85[_0x3376d1(0xd3)]}),_0x91241=_0x213e63[_0x3376d1(0xec)];if(_0x91241[_0x3376d1(0xc1)][_0x3376d1(0xe7)]===0x0&&_0x91241[_0x3376d1(0xc1)][_0x3376d1(0xd4)]===0x0)return console[_0x3376d1(0xb9)](a39_0x5572c1[_0x3376d1(0xde)](_0x3376d1(0xbf)+_0x91241['parentName']+'\x27')),0x0;const _0x5f4e2e=_0x91241[_0x3376d1(0xe3)][_0x3376d1(0xbb)](_0x499237=>_0x499237['isNew']),_0x120a8c=_0x91241[_0x3376d1(0xe3)][_0x3376d1(0xbb)](_0x3ec8d3=>!_0x3ec8d3['isNew']&&_0x3ec8d3['hasChanges']),_0x586b4c=_0x91241['files']['filter'](_0x3252d1=>!_0x3252d1[_0x3376d1(0xda)]&&!_0x3252d1['hasChanges']);console[_0x3376d1(0xb9)]('\x0aPull\x20summary\x20for\x20\x27'+_0x91241[_0x3376d1(0xf5)]+'\x27:'),console[_0x3376d1(0xb9)](_0x3376d1(0xf6)+a39_0x5572c1['cyan'](_0x91241[_0x3376d1(0xc1)][_0x3376d1(0xe7)]+_0x3376d1(0xba))+'\x20with\x20'+a39_0x5572c1['cyan'](_0x91241[_0x3376d1(0xc1)][_0x3376d1(0xe6)]+_0x3376d1(0xf4)));if(_0x91241['counts']['journeys']>0x0){const _0x3a58c5=_0x91241[_0x3376d1(0xc1)][_0x3376d1(0xca)]>_0x91241[_0x3376d1(0xc1)]['journeys']?'\x20('+_0x91241['counts']['journeyVersions']+_0x3376d1(0xcd):'';console[_0x3376d1(0xb9)](_0x3376d1(0xd6)+a39_0x5572c1['cyan'](_0x91241['counts']['journeys']+_0x3376d1(0xac))+a39_0x5572c1['dim'](_0x3a58c5));}console[_0x3376d1(0xb9)]('\x20\x20'+a39_0x5572c1[_0x3376d1(0xb0)]('+\x20'+_0x5f4e2e[_0x3376d1(0xb3)]+_0x3376d1(0xe4))),console[_0x3376d1(0xb9)]('\x20\x20'+a39_0x5572c1[_0x3376d1(0xde)]('~\x20'+_0x120a8c[_0x3376d1(0xb3)]+_0x3376d1(0xb1))),console[_0x3376d1(0xb9)]('\x20\x20'+a39_0x5572c1[_0x3376d1(0xc5)]('=\x20'+_0x586b4c['length']+_0x3376d1(0xaf))),console[_0x3376d1(0xb9)]('\x20\x20Target:\x20'+a39_0x5572c1[_0x3376d1(0xcf)](_0x91241[_0x3376d1(0xf1)])+'\x0a');if(_0x120a8c[_0x3376d1(0xb3)]>0x0)for(const _0x865445 of _0x120a8c){console['error']('\x0aChanges\x20to\x20\x27'+_0x865445[_0x3376d1(0xe2)]+'\x27:'),console[_0x3376d1(0xb9)]('─'[_0x3376d1(0xc8)](0x3c)),console[_0x3376d1(0xb9)](_0x865445[_0x3376d1(0xc7)]),console[_0x3376d1(0xb9)]('─'['repeat'](0x3c));}if(_0x533a85[_0x3376d1(0xe0)])return console['error'](a39_0x5572c1[_0x3376d1(0xde)](_0x3376d1(0xdf))),0x0;if(_0x5f4e2e[_0x3376d1(0xb3)]===0x0&&_0x120a8c['length']===0x0)return console[_0x3376d1(0xb9)](a39_0x5572c1[_0x3376d1(0xb0)](_0x3376d1(0xae))),saveSessionContext({'parent_segment':_0x91241[_0x3376d1(0xf5)]},_0x533a85[_0x3376d1(0xf2)]),console[_0x3376d1(0xb9)](a39_0x5572c1[_0x3376d1(0xb0)](_0x3376d1(0xb8)+a39_0x5572c1[_0x3376d1(0xc5)]('parent_segment')+_0x3376d1(0xb6)+a39_0x5572c1['cyan'](_0x91241['parentName']))),0x0;if(!_0x533a85[_0x3376d1(0xad)]){if(!isInteractive())return console[_0x3376d1(0xb9)](a39_0x5572c1['red'](_0x3376d1(0xaa)),_0x3376d1(0xdb)),console['error'](a39_0x5572c1['dim'](_0x3376d1(0xe8))),0x1;const _0x23b056=await confirmKey('Write\x20'+(_0x5f4e2e['length']+_0x120a8c[_0x3376d1(0xb3)])+'\x20files?');if(!_0x23b056)return console[_0x3376d1(0xb9)](a39_0x5572c1['yellow'](_0x3376d1(0xc0)),_0x3376d1(0xe9)),0x1;}for(const _0x448a3f of _0x91241[_0x3376d1(0xe3)]){if(_0x448a3f[_0x3376d1(0xda)]||_0x448a3f[_0x3376d1(0xd5)]){const _0xcc47bc=a39_0x2e4317[_0x3376d1(0xf0)](_0x448a3f['absolutePath']);!existsSync(_0xcc47bc)&&mkdirSync(_0xcc47bc,{'recursive':!![]}),writeFileSync(_0x448a3f[_0x3376d1(0xd2)],_0x448a3f[_0x3376d1(0xd1)],'utf-8');}}return console[_0x3376d1(0xb9)](a39_0x5572c1['green'](_0x3376d1(0xc6)+(_0x5f4e2e[_0x3376d1(0xb3)]+_0x120a8c[_0x3376d1(0xb3)])+_0x3376d1(0xcb)+_0x91241['targetDir'])),saveSessionContext({'parent_segment':_0x91241[_0x3376d1(0xf5)]},_0x533a85[_0x3376d1(0xf2)]),console['error'](a39_0x5572c1[_0x3376d1(0xb0)](_0x3376d1(0xb8)+a39_0x5572c1[_0x3376d1(0xc5)]('parent_segment')+_0x3376d1(0xb6)+a39_0x5572c1[_0x3376d1(0xcf)](_0x91241[_0x3376d1(0xf5)]))),0x0;}}
1
+ const a39_0xfaccec=a39_0x120b;(function(_0x488ef4,_0x195c65){const _0x2e6bc8=a39_0x120b,_0x2463ee=_0x488ef4();while(!![]){try{const _0x3585e5=parseInt(_0x2e6bc8(0x160))/0x1*(-parseInt(_0x2e6bc8(0x187))/0x2)+parseInt(_0x2e6bc8(0x15b))/0x3+parseInt(_0x2e6bc8(0x173))/0x4+parseInt(_0x2e6bc8(0x177))/0x5+parseInt(_0x2e6bc8(0x167))/0x6*(parseInt(_0x2e6bc8(0x146))/0x7)+-parseInt(_0x2e6bc8(0x17d))/0x8+parseInt(_0x2e6bc8(0x168))/0x9*(-parseInt(_0x2e6bc8(0x179))/0xa);if(_0x3585e5===_0x195c65)break;else _0x2463ee['push'](_0x2463ee['shift']());}catch(_0x44de65){_0x2463ee['push'](_0x2463ee['shift']());}}}(a39_0x2473,0x436e4));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 a39_0x1f4ec0 from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';function a39_0x120b(_0x142903,_0x737032){_0x142903=_0x142903-0x146;const _0x247318=a39_0x2473();let _0x120b0e=_0x247318[_0x142903];return _0x120b0e;}import a39_0x1718de from'path';function a39_0x2473(){const _0x59e9c7=['cyan','\x20\x20🎯\x20','site','\x20new\x20files','relativePath','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','pullSegments','1824904tOlLNg','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)','errorCode','verbose','2043860djQxFf','journeys','10kbrFpY','counts','absolutePath','segment','3506040ITmjHN','\x20segments','\x20files?','filter','Site:\x20','red','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent','dryRun','helpText','Aborted.','2wkgUcV','content','\x20activations','-\x20no\x20files\x20written','dirname','segments','\x27...','Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files','repeat','error','segment:pull','\x20changed\x20files','file','2595719QMkatf','setPhase','\x20files\x20to\x20','hasChanges','\x20versions)','targetDir','\x20=\x20','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','Target\x20resource:\x20','activations','Parent\x20segment:\x20','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','name','green','\x20\x20Target:\x20','dim','No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27','parentSegment','✔\x20Pulled\x20','resourceName','description','1605864sEEgYb','✔\x20Context\x20set:\x20','\x20\x20🗺️\x20\x20','\x0aError:','isNew','517711BEyQbn','files','session','type','yellow','\x20unchanged\x20files','journeyVersions','6hllZDa','4850469AOGXUV','parentName','no_parent','length'];a39_0x2473=function(){return _0x59e9c7;};return a39_0x2473();}import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';export{buildFolderIdToPathMap as buildFolderPathMap}from'../sdk/segment/resolution-context.js';export class SegmentPullCommand extends BaseCommand{[a39_0xfaccec(0x152)]=a39_0xfaccec(0x191);[a39_0xfaccec(0x15a)]=a39_0xfaccec(0x18e);async['execute'](_0x512597){const _0x1fa2a3=a39_0xfaccec,{options:_0x58c119,args:_0x4d3cb5,tdx:_0x30e7ea}=_0x512597,_0x279a1b=_0x58c119,_0x222252=await resolveTarget({'arg':_0x4d3cb5[0x0],'contextParent':_0x58c119[_0x1fa2a3(0x157)],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x222252))return _0x222252[_0x1fa2a3(0x175)]===_0x1fa2a3(0x16a)?(console[_0x1fa2a3(0x190)](a39_0x1f4ec0[_0x1fa2a3(0x164)](_0x1fa2a3(0x14d))),console[_0x1fa2a3(0x190)](_0x1fa2a3(0x174)),console[_0x1fa2a3(0x190)](_0x1fa2a3(0x183)),console[_0x1fa2a3(0x190)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file')):(console[_0x1fa2a3(0x190)](a39_0x1f4ec0[_0x1fa2a3(0x182)]('Error:\x20'+_0x222252['message']+'\x0a')),_0x222252[_0x1fa2a3(0x185)]&&console[_0x1fa2a3(0x190)](a39_0x1f4ec0[_0x1fa2a3(0x16c)](_0x222252[_0x1fa2a3(0x185)]))),0x1;const _0x4460da=_0x222252[_0x1fa2a3(0x169)],_0x2678ed=_0x222252[_0x1fa2a3(0x14b)],_0x1e450f=_0x222252[_0x1fa2a3(0x163)]===_0x1fa2a3(0x193)?_0x222252[_0x1fa2a3(0x159)]:undefined;_0x279a1b[_0x1fa2a3(0x176)]&&(console[_0x1fa2a3(0x190)](_0x1fa2a3(0x181)+_0x279a1b[_0x1fa2a3(0x16e)]),console[_0x1fa2a3(0x190)](_0x1fa2a3(0x150)+_0x4460da),_0x1e450f&&console[_0x1fa2a3(0x190)](_0x1fa2a3(0x14e)+_0x1e450f));const _0x40c9f2=await withProgressSpinner('Pulling\x20segments\x20from\x20\x27'+_0x4460da+_0x1fa2a3(0x18d),_0x425ddd=>_0x30e7ea[_0x1fa2a3(0x17c)][_0x1fa2a3(0x172)](_0x4460da,{'targetDir':_0x2678ed,'targetResourceName':_0x1e450f,'verbose':_0x279a1b[_0x1fa2a3(0x176)],'progress':{'update':_0x3b60fd=>{const _0x41318e=_0x1fa2a3;_0x425ddd[_0x41318e(0x147)](_0x3b60fd),_0x279a1b[_0x41318e(0x176)]&&console['error']('\x20\x20'+_0x3b60fd);}}}),{'verbose':_0x279a1b[_0x1fa2a3(0x176)]}),_0x26b198=_0x40c9f2['data'];if(_0x26b198[_0x1fa2a3(0x17a)][_0x1fa2a3(0x18c)]===0x0&&_0x26b198[_0x1fa2a3(0x17a)][_0x1fa2a3(0x178)]===0x0)return console[_0x1fa2a3(0x190)](a39_0x1f4ec0[_0x1fa2a3(0x164)](_0x1fa2a3(0x156)+_0x26b198[_0x1fa2a3(0x169)]+'\x27')),0x0;const _0x2664a3=_0x26b198['files'][_0x1fa2a3(0x180)](_0x5a2541=>_0x5a2541['isNew']),_0x44b923=_0x26b198[_0x1fa2a3(0x161)][_0x1fa2a3(0x180)](_0x5ce10b=>!_0x5ce10b[_0x1fa2a3(0x15f)]&&_0x5ce10b[_0x1fa2a3(0x149)]),_0x441d91=_0x26b198[_0x1fa2a3(0x161)][_0x1fa2a3(0x180)](_0x458b3e=>!_0x458b3e[_0x1fa2a3(0x15f)]&&!_0x458b3e[_0x1fa2a3(0x149)]);console['error']('\x0aPull\x20summary\x20for\x20\x27'+_0x26b198['parentName']+'\x27:'),console[_0x1fa2a3(0x190)](_0x1fa2a3(0x16d)+a39_0x1f4ec0[_0x1fa2a3(0x16c)](_0x26b198['counts']['segments']+_0x1fa2a3(0x17e))+'\x20with\x20'+a39_0x1f4ec0[_0x1fa2a3(0x16c)](_0x26b198[_0x1fa2a3(0x17a)][_0x1fa2a3(0x14f)]+_0x1fa2a3(0x189)));if(_0x26b198[_0x1fa2a3(0x17a)][_0x1fa2a3(0x178)]>0x0){const _0x425735=_0x26b198[_0x1fa2a3(0x17a)][_0x1fa2a3(0x166)]>_0x26b198[_0x1fa2a3(0x17a)][_0x1fa2a3(0x178)]?'\x20('+_0x26b198[_0x1fa2a3(0x17a)][_0x1fa2a3(0x166)]+_0x1fa2a3(0x14a):'';console[_0x1fa2a3(0x190)](_0x1fa2a3(0x15d)+a39_0x1f4ec0[_0x1fa2a3(0x16c)](_0x26b198[_0x1fa2a3(0x17a)][_0x1fa2a3(0x178)]+'\x20journeys')+a39_0x1f4ec0[_0x1fa2a3(0x155)](_0x425735));}console[_0x1fa2a3(0x190)]('\x20\x20'+a39_0x1f4ec0['green']('+\x20'+_0x2664a3[_0x1fa2a3(0x16b)]+_0x1fa2a3(0x16f))),console['error']('\x20\x20'+a39_0x1f4ec0[_0x1fa2a3(0x164)]('~\x20'+_0x44b923[_0x1fa2a3(0x16b)]+_0x1fa2a3(0x192))),console[_0x1fa2a3(0x190)]('\x20\x20'+a39_0x1f4ec0['dim']('=\x20'+_0x441d91[_0x1fa2a3(0x16b)]+_0x1fa2a3(0x165))),console['error'](_0x1fa2a3(0x154)+a39_0x1f4ec0[_0x1fa2a3(0x16c)](_0x26b198[_0x1fa2a3(0x14b)])+'\x0a');if(_0x44b923['length']>0x0)for(const _0x1b4902 of _0x44b923){console[_0x1fa2a3(0x190)]('\x0aChanges\x20to\x20\x27'+_0x1b4902[_0x1fa2a3(0x170)]+'\x27:'),console['error']('─'['repeat'](0x3c)),console['error'](_0x1b4902['diff']),console[_0x1fa2a3(0x190)]('─'[_0x1fa2a3(0x18f)](0x3c));}if(_0x279a1b[_0x1fa2a3(0x184)])return console[_0x1fa2a3(0x190)](a39_0x1f4ec0['yellow'](_0x1fa2a3(0x171))),0x0;if(_0x2664a3['length']===0x0&&_0x44b923['length']===0x0)return console[_0x1fa2a3(0x190)](a39_0x1f4ec0[_0x1fa2a3(0x153)]('✔\x20All\x20files\x20are\x20up\x20to\x20date')),saveSessionContext({'parent_segment':_0x26b198[_0x1fa2a3(0x169)]},_0x279a1b[_0x1fa2a3(0x162)]),console[_0x1fa2a3(0x190)](a39_0x1f4ec0[_0x1fa2a3(0x153)](_0x1fa2a3(0x15c)+a39_0x1f4ec0[_0x1fa2a3(0x155)]('parent_segment')+'\x20=\x20'+a39_0x1f4ec0[_0x1fa2a3(0x16c)](_0x26b198[_0x1fa2a3(0x169)]))),0x0;if(!_0x279a1b['yes']){if(!isInteractive())return console['error'](a39_0x1f4ec0[_0x1fa2a3(0x182)](_0x1fa2a3(0x15e)),_0x1fa2a3(0x151)),console[_0x1fa2a3(0x190)](a39_0x1f4ec0['dim']('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x27fce2=await confirmKey('Write\x20'+(_0x2664a3['length']+_0x44b923[_0x1fa2a3(0x16b)])+_0x1fa2a3(0x17f));if(!_0x27fce2)return console['error'](a39_0x1f4ec0[_0x1fa2a3(0x164)](_0x1fa2a3(0x186)),_0x1fa2a3(0x18a)),0x1;}for(const _0x623548 of _0x26b198[_0x1fa2a3(0x161)]){if(_0x623548[_0x1fa2a3(0x15f)]||_0x623548[_0x1fa2a3(0x149)]){const _0x403f51=a39_0x1718de[_0x1fa2a3(0x18b)](_0x623548[_0x1fa2a3(0x17b)]);!existsSync(_0x403f51)&&mkdirSync(_0x403f51,{'recursive':!![]}),writeFileSync(_0x623548[_0x1fa2a3(0x17b)],_0x623548[_0x1fa2a3(0x188)],'utf-8');}}return console['error'](a39_0x1f4ec0['green'](_0x1fa2a3(0x158)+(_0x2664a3[_0x1fa2a3(0x16b)]+_0x44b923[_0x1fa2a3(0x16b)])+_0x1fa2a3(0x148)+_0x26b198[_0x1fa2a3(0x14b)])),saveSessionContext({'parent_segment':_0x26b198[_0x1fa2a3(0x169)]},_0x279a1b['session']),console[_0x1fa2a3(0x190)](a39_0x1f4ec0['green'](_0x1fa2a3(0x15c)+a39_0x1f4ec0[_0x1fa2a3(0x155)]('parent_segment')+_0x1fa2a3(0x14c)+a39_0x1f4ec0[_0x1fa2a3(0x16c)](_0x26b198[_0x1fa2a3(0x169)]))),0x0;}}