@treasuredata/tdx 0.8.10 → 0.8.11

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 (131) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +2 -2
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.js +1 -1
  5. package/dist/client/cdp-api-client.d.ts +10 -1
  6. package/dist/client/cdp-api-client.d.ts.map +1 -1
  7. package/dist/client/cdp-api-client.js +1 -1
  8. package/dist/client/cdp-api-client.js.map +1 -1
  9. package/dist/client/engage-api-client.js +1 -1
  10. package/dist/client/http-client.js +1 -1
  11. package/dist/client/llm-api-client.js +1 -1
  12. package/dist/client/rate-limiter.js +1 -1
  13. package/dist/client/td-api-client.js +1 -1
  14. package/dist/client/trino-api-client.js +1 -1
  15. package/dist/client/workflow-client.js +1 -1
  16. package/dist/commands/activations.js +1 -1
  17. package/dist/commands/api-command.js +1 -1
  18. package/dist/commands/auth-command.js +1 -1
  19. package/dist/commands/chat-command.js +1 -1
  20. package/dist/commands/claude-command.js +1 -1
  21. package/dist/commands/claude-statusline-command.js +1 -1
  22. package/dist/commands/claude-usage-command.js +1 -1
  23. package/dist/commands/command.js +1 -1
  24. package/dist/commands/connection-command.js +1 -1
  25. package/dist/commands/context-command.js +1 -1
  26. package/dist/commands/databases.js +1 -1
  27. package/dist/commands/describe.js +1 -1
  28. package/dist/commands/engage-command.js +1 -1
  29. package/dist/commands/job-command.js +1 -1
  30. package/dist/commands/journey-command.js +1 -1
  31. package/dist/commands/llm-command.js +1 -1
  32. package/dist/commands/llm-proxy.js +1 -1
  33. package/dist/commands/parent-segment-command.js +1 -1
  34. package/dist/commands/profiles-command.js +1 -1
  35. package/dist/commands/query-command.js +1 -1
  36. package/dist/commands/segment-command.js +1 -1
  37. package/dist/commands/segment-create-command.js +1 -1
  38. package/dist/commands/segment-fields-command.js +1 -1
  39. package/dist/commands/segment-pull-command.js +1 -1
  40. package/dist/commands/segment-push-command.d.ts.map +1 -1
  41. package/dist/commands/segment-push-command.js +1 -1
  42. package/dist/commands/segment-push-command.js.map +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/segments.js +1 -1
  46. package/dist/commands/show.js +1 -1
  47. package/dist/commands/tables.js +1 -1
  48. package/dist/commands/use-command.js +1 -1
  49. package/dist/commands/user-command.js +1 -1
  50. package/dist/commands/workflow-command.js +1 -1
  51. package/dist/core/auth.js +1 -1
  52. package/dist/core/config.js +1 -1
  53. package/dist/core/connection-cache.js +1 -1
  54. package/dist/core/credential-cache.js +1 -1
  55. package/dist/core/global-context.js +1 -1
  56. package/dist/core/keychain.js +1 -1
  57. package/dist/core/profile.js +1 -1
  58. package/dist/core/project-config.js +1 -1
  59. package/dist/core/session.js +1 -1
  60. package/dist/core/user-cache.js +1 -1
  61. package/dist/index.js +1 -1
  62. package/dist/proxy/anthropic-adapter.js +1 -1
  63. package/dist/proxy/claude-usage-tracker.js +1 -1
  64. package/dist/proxy/context-signature.js +1 -1
  65. package/dist/proxy/conversation-utils.js +1 -1
  66. package/dist/proxy/server.js +1 -1
  67. package/dist/proxy/session-cache.js +1 -1
  68. package/dist/sdk/api.js +1 -1
  69. package/dist/sdk/connection.js +1 -1
  70. package/dist/sdk/engage.js +1 -1
  71. package/dist/sdk/errors.js +1 -1
  72. package/dist/sdk/index.js +1 -1
  73. package/dist/sdk/job.js +1 -1
  74. package/dist/sdk/journey.d.ts +15 -1
  75. package/dist/sdk/journey.d.ts.map +1 -1
  76. package/dist/sdk/journey.js +1 -1
  77. package/dist/sdk/journey.js.map +1 -1
  78. package/dist/sdk/llm.js +1 -1
  79. package/dist/sdk/query.js +1 -1
  80. package/dist/sdk/segment/child-segment-yaml.d.ts +1 -1
  81. package/dist/sdk/segment/child-segment-yaml.d.ts.map +1 -1
  82. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  83. package/dist/sdk/segment/child-segment-yaml.js.map +1 -1
  84. package/dist/sdk/segment/journey-yaml.d.ts +5 -0
  85. package/dist/sdk/segment/journey-yaml.d.ts.map +1 -1
  86. package/dist/sdk/segment/journey-yaml.js +1 -1
  87. package/dist/sdk/segment/journey-yaml.js.map +1 -1
  88. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  89. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  90. package/dist/sdk/segment.js +1 -1
  91. package/dist/sdk/user.js +1 -1
  92. package/dist/sdk/workflow.js +1 -1
  93. package/dist/types/cdp.d.ts +37 -0
  94. package/dist/types/cdp.d.ts.map +1 -1
  95. package/dist/types/endpoints.js +1 -1
  96. package/dist/types/index.d.ts +1 -1
  97. package/dist/types/index.d.ts.map +1 -1
  98. package/dist/types/index.js +1 -1
  99. package/dist/utils/agent-ref-parser.js +1 -1
  100. package/dist/utils/async.js +1 -1
  101. package/dist/utils/chat-cache.js +1 -1
  102. package/dist/utils/colors.js +1 -1
  103. package/dist/utils/command-output.js +1 -1
  104. package/dist/utils/constants.js +1 -1
  105. package/dist/utils/diff.js +1 -1
  106. package/dist/utils/fields-display.js +1 -1
  107. package/dist/utils/file-permissions.js +1 -1
  108. package/dist/utils/format-detector.js +1 -1
  109. package/dist/utils/formatters.js +1 -1
  110. package/dist/utils/journey-utils.js +1 -1
  111. package/dist/utils/json-loader.js +1 -1
  112. package/dist/utils/llm-backup-utils.js +1 -1
  113. package/dist/utils/model-aliases.js +1 -1
  114. package/dist/utils/model-factors.js +1 -1
  115. package/dist/utils/option-validation.js +1 -1
  116. package/dist/utils/port.js +1 -1
  117. package/dist/utils/process.js +1 -1
  118. package/dist/utils/prompt.js +1 -1
  119. package/dist/utils/segment-path-parser.js +1 -1
  120. package/dist/utils/segment-ref-parser.js +1 -1
  121. package/dist/utils/spinner.js +1 -1
  122. package/dist/utils/sql-parser.js +1 -1
  123. package/dist/utils/sse-parser.js +1 -1
  124. package/dist/utils/string-utils.js +1 -1
  125. package/dist/utils/table-ref-parser.js +1 -1
  126. package/dist/utils/tdx-config.js +1 -1
  127. package/dist/utils/tdx-logger.js +1 -1
  128. package/dist/utils/tree-formatter.js +1 -1
  129. package/dist/utils/version-check.js +1 -1
  130. package/dist/utils/workflow-utils.js +1 -1
  131. package/package.json +1 -1
@@ -1 +1 @@
1
- const a37_0x34e46c=a37_0xca69;(function(_0x24c740,_0x5821e8){const _0x54d3bb=a37_0xca69,_0x1535c4=_0x24c740();while(!![]){try{const _0x13b85a=parseInt(_0x54d3bb(0xb0))/0x1+-parseInt(_0x54d3bb(0xbc))/0x2+parseInt(_0x54d3bb(0xc6))/0x3*(-parseInt(_0x54d3bb(0xe3))/0x4)+parseInt(_0x54d3bb(0xd8))/0x5+parseInt(_0x54d3bb(0xc2))/0x6+-parseInt(_0x54d3bb(0xda))/0x7+-parseInt(_0x54d3bb(0xbb))/0x8*(-parseInt(_0x54d3bb(0xd4))/0x9);if(_0x13b85a===_0x5821e8)break;else _0x1535c4['push'](_0x1535c4['shift']());}catch(_0x305285){_0x1535c4['push'](_0x1535c4['shift']());}}}(a37_0x2e82,0xd6115));import{existsSync,statSync}from'fs';function a37_0xca69(_0x263c47,_0x5bc280){_0x263c47=_0x263c47-0xaf;const _0x2e82e9=a37_0x2e82();let _0xca69c5=_0x2e82e9[_0x263c47];return _0xca69c5;}import a37_0x5f2cd3 from'chalk';import{BaseCommand}from'./command.js';import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';import{parsePath,normalizePath}from'../utils/segment-path-parser.js';function a37_0x2e82(){const _0x3b15e3=['parent_segment','log','Use:\x20tdx\x20segment\x20use\x20','6CBcwrM','execute','Set\x20current\x20segment/folder\x20context\x20for\x20navigation','Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context','name','join','data','red','\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context','Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.','\x27...','session','Use\x20\x22tdx\x20context\x22\x20to\x20see\x20all\x20context\x20parameters','isDirectory','2097KVnhtu','Parent\x20ID:\x20','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22','✔\x20Context\x20cleared.\x20Back\x20to\x20root.','773925PmtRFA','segment','9415644sazeaf','parentName','site','Error:\x20Path\x20is\x20required\x0a','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','folderId','error','slice','dim','1666196iBaqfJ','segmentPath','788306vpjmpD','resolvePathToResource','length','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22','folderPath','type','✔\x20Context\x20set\x20to:\x20','config','Folder\x20ID:\x20','Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.','isAbsolute','62912sQkYKV','2282310enaJVq','segment:use','green','cyan','Resolved\x20relative\x20path\x20to:\x20','verbose','8524578DHQLgx'];a37_0x2e82=function(){return _0x3b15e3;};return a37_0x2e82();}import{findTdxConfig}from'../utils/tdx-config.js';export class SegmentUseCommand extends BaseCommand{[a37_0x34e46c(0xca)]=a37_0x34e46c(0xbd);['description']=a37_0x34e46c(0xc8);async[a37_0x34e46c(0xc7)](_0x4033a3){const _0x2e2daf=a37_0x34e46c,{options:_0x474ca3,args:_0x566f76,tdx:_0x584ea4}=_0x4033a3;if(_0x566f76[_0x2e2daf(0xb2)]===0x0)return console[_0x2e2daf(0xe0)](a37_0x5f2cd3[_0x2e2daf(0xcd)](_0x2e2daf(0xdd))),console[_0x2e2daf(0xe0)]('Usage:\x20tdx\x20segment\x20use\x20<path>'),console[_0x2e2daf(0xe0)]('Examples:'),console[_0x2e2daf(0xe0)](_0x2e2daf(0xb3)),console['error'](_0x2e2daf(0xd6)),console[_0x2e2daf(0xe0)](_0x2e2daf(0xce)),console['error']('\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent'),0x1;const _0x52b36e=_0x566f76[0x0],_0x15458a=_0x474ca3[_0x2e2daf(0xd1)];try{if(_0x52b36e==='/')return saveSessionContext({'segment_path':undefined},_0x15458a),console[_0x2e2daf(0xc4)](a37_0x5f2cd3[_0x2e2daf(0xbe)](_0x2e2daf(0xd7))),0x0;if(existsSync(_0x52b36e)&&statSync(_0x52b36e)[_0x2e2daf(0xd3)]()){let _0x342963;try{_0x342963=findTdxConfig(_0x52b36e);}catch{return console['error'](a37_0x5f2cd3['red']('Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20'+_0x52b36e)),console['error'](a37_0x5f2cd3[_0x2e2daf(0xbf)](_0x2e2daf(0xde))),0x1;}const _0x41b8b0=_0x342963[_0x2e2daf(0xb7)][_0x2e2daf(0xc3)];return saveSessionContext({'segment_path':_0x41b8b0,'parent_segment':_0x41b8b0},_0x15458a),console[_0x2e2daf(0xc4)](a37_0x5f2cd3[_0x2e2daf(0xbe)](_0x2e2daf(0xb6)+a37_0x5f2cd3['cyan'](_0x41b8b0))),0x0;}const _0x426f9f=_0x474ca3[_0x2e2daf(0xaf)];let _0xa0dcd6=_0x52b36e;const _0x2105e0=parsePath(_0x52b36e);if(!_0x2105e0[_0x2e2daf(0xba)]){if(!_0x426f9f)return console[_0x2e2daf(0xe0)](a37_0x5f2cd3[_0x2e2daf(0xcd)](_0x2e2daf(0xb9))),console[_0x2e2daf(0xe0)](a37_0x5f2cd3[_0x2e2daf(0xbf)]('Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>')),0x1;if(_0x52b36e==='..'){const _0x2f5477=_0x426f9f['split']('/')[_0x2e2daf(0xe1)](0x0,-0x1)[_0x2e2daf(0xcb)]('/');_0xa0dcd6=_0x2f5477||'/';}else _0x52b36e==='.'?_0xa0dcd6=_0x426f9f:_0xa0dcd6=_0x426f9f+'/'+_0x52b36e;_0x474ca3['verbose']&&console[_0x2e2daf(0xe0)](_0x2e2daf(0xc0)+_0xa0dcd6);}if(_0xa0dcd6==='/'||_0xa0dcd6==='')return saveSessionContext({'segment_path':undefined},_0x15458a),console[_0x2e2daf(0xc4)](a37_0x5f2cd3[_0x2e2daf(0xbe)](_0x2e2daf(0xd7))),0x0;_0xa0dcd6=normalizePath(_0xa0dcd6);const _0x3eba82=parsePath(_0xa0dcd6)['segments'];if(_0x3eba82[_0x2e2daf(0xb2)]===0x0)return saveSessionContext({'segment_path':undefined},_0x15458a),console[_0x2e2daf(0xc4)](a37_0x5f2cd3['green']('✔\x20Context\x20cleared.\x20Back\x20to\x20root.')),0x0;_0x474ca3['verbose']&&(console[_0x2e2daf(0xe0)]('Site:\x20'+_0x474ca3[_0x2e2daf(0xdc)]),console['error']('Target\x20path:\x20'+_0xa0dcd6));const _0x26906d=await withSpinner('Resolving\x20path\x20\x27'+_0xa0dcd6+_0x2e2daf(0xd0),()=>_0x584ea4['segment'][_0x2e2daf(0xb1)](_0xa0dcd6),{'verbose':_0x474ca3[_0x2e2daf(0xc1)]}),_0x5a5c9f=_0x26906d[_0x2e2daf(0xcc)];_0x474ca3[_0x2e2daf(0xc1)]&&(console[_0x2e2daf(0xe0)]('Resolved\x20path\x20type:\x20'+_0x5a5c9f[_0x2e2daf(0xb5)]),console['error'](_0x2e2daf(0xd5)+_0x5a5c9f['parentId']),_0x5a5c9f['folderId']&&console['error'](_0x2e2daf(0xb8)+_0x5a5c9f[_0x2e2daf(0xdf)]));if(_0x5a5c9f[_0x2e2daf(0xb5)]===_0x2e2daf(0xd9))return console[_0x2e2daf(0xe0)](a37_0x5f2cd3[_0x2e2daf(0xcd)](_0x2e2daf(0xcf))),console[_0x2e2daf(0xe0)]('Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.'),console[_0x2e2daf(0xe0)](a37_0x5f2cd3[_0x2e2daf(0xbf)](_0x2e2daf(0xc5)+_0x5a5c9f['parentName']+(_0x5a5c9f[_0x2e2daf(0xb4)]?'/'+_0x5a5c9f[_0x2e2daf(0xb4)][_0x2e2daf(0xcb)]('/'):''))),0x1;return saveSessionContext({'segment_path':_0x5a5c9f['fullPath'],'parent_segment':_0x5a5c9f[_0x2e2daf(0xdb)]},_0x15458a),console[_0x2e2daf(0xc4)](a37_0x5f2cd3['green'](_0x2e2daf(0xb6)+a37_0x5f2cd3[_0x2e2daf(0xbf)](_0x5a5c9f['fullPath']))),_0x474ca3[_0x2e2daf(0xc1)]&&(console[_0x2e2daf(0xe0)](a37_0x5f2cd3[_0x2e2daf(0xe2)](_0x2e2daf(0xc9))),console['error'](a37_0x5f2cd3[_0x2e2daf(0xe2)](_0x2e2daf(0xd2)))),0x0;}catch(_0x84f243){throw _0x84f243;}}}
1
+ const a37_0x5b5998=a37_0x1c9b;(function(_0x4b28d4,_0x3cc662){const _0x51f9a6=a37_0x1c9b,_0x3536c4=_0x4b28d4();while(!![]){try{const _0x479d15=parseInt(_0x51f9a6(0x9e))/0x1*(-parseInt(_0x51f9a6(0xce))/0x2)+-parseInt(_0x51f9a6(0xc8))/0x3+-parseInt(_0x51f9a6(0xbc))/0x4*(parseInt(_0x51f9a6(0xbe))/0x5)+parseInt(_0x51f9a6(0xa5))/0x6+-parseInt(_0x51f9a6(0xc7))/0x7*(-parseInt(_0x51f9a6(0xc4))/0x8)+-parseInt(_0x51f9a6(0xcf))/0x9+parseInt(_0x51f9a6(0xaa))/0xa;if(_0x479d15===_0x3cc662)break;else _0x3536c4['push'](_0x3536c4['shift']());}catch(_0x3aa753){_0x3536c4['push'](_0x3536c4['shift']());}}}(a37_0x2156,0xa9679));import{existsSync,statSync}from'fs';import a37_0x536541 from'chalk';import{BaseCommand}from'./command.js';import{saveSessionContext}from'../core/session.js';function a37_0x1c9b(_0x3cc281,_0x27ce22){_0x3cc281=_0x3cc281-0x96;const _0x21565a=a37_0x2156();let _0x1c9b79=_0x21565a[_0x3cc281];return _0x1c9b79;}import{withSpinner}from'../utils/spinner.js';import{parsePath,normalizePath}from'../utils/segment-path-parser.js';import{findTdxConfig}from'../utils/tdx-config.js';export class SegmentUseCommand extends BaseCommand{[a37_0x5b5998(0xad)]='segment:use';[a37_0x5b5998(0x97)]=a37_0x5b5998(0xa0);async['execute'](_0x337cec){const _0x4c6eba=a37_0x5b5998,{options:_0x1ebb54,args:_0x13c534,tdx:_0x755aca}=_0x337cec;if(_0x13c534['length']===0x0)return console[_0x4c6eba(0xa2)](a37_0x536541[_0x4c6eba(0xb0)](_0x4c6eba(0xaf))),console[_0x4c6eba(0xa2)](_0x4c6eba(0xb7)),console[_0x4c6eba(0xa2)](_0x4c6eba(0x9f)),console[_0x4c6eba(0xa2)](_0x4c6eba(0xac)),console['error'](_0x4c6eba(0xc2)),console[_0x4c6eba(0xa2)](_0x4c6eba(0xb4)),console[_0x4c6eba(0xa2)]('\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent'),0x1;const _0x3318f3=_0x13c534[0x0],_0x40339a=_0x1ebb54[_0x4c6eba(0xa8)];try{if(_0x3318f3==='/')return saveSessionContext({'segment_path':undefined},_0x40339a),console[_0x4c6eba(0xbb)](a37_0x536541['green']('✔\x20Context\x20cleared.\x20Back\x20to\x20root.')),0x0;if(existsSync(_0x3318f3)&&statSync(_0x3318f3)[_0x4c6eba(0x9d)]()){let _0x21e63b;try{_0x21e63b=findTdxConfig(_0x3318f3);}catch{return console[_0x4c6eba(0xa2)](a37_0x536541['red'](_0x4c6eba(0xbf)+_0x3318f3)),console['error'](a37_0x536541[_0x4c6eba(0xc0)](_0x4c6eba(0x99))),0x1;}const _0x5baf63=_0x21e63b[_0x4c6eba(0x9c)][_0x4c6eba(0xc3)];return saveSessionContext({'segment_path':_0x5baf63,'parent_segment':_0x5baf63},_0x40339a),console['log'](a37_0x536541[_0x4c6eba(0xb6)](_0x4c6eba(0xa3)+a37_0x536541[_0x4c6eba(0xc0)](_0x5baf63))),0x0;}const _0xe18aa4=_0x1ebb54[_0x4c6eba(0xa7)];let _0x92c71e=_0x3318f3;const _0x3b8c55=parsePath(_0x3318f3);if(!_0x3b8c55[_0x4c6eba(0xa6)]){if(!_0xe18aa4)return console[_0x4c6eba(0xa2)](a37_0x536541[_0x4c6eba(0xb0)](_0x4c6eba(0xae))),console[_0x4c6eba(0xa2)](a37_0x536541[_0x4c6eba(0xc0)](_0x4c6eba(0x9a))),0x1;if(_0x3318f3==='..'){const _0x240f13=_0xe18aa4[_0x4c6eba(0xca)]('/')[_0x4c6eba(0xab)](0x0,-0x1)[_0x4c6eba(0xb2)]('/');_0x92c71e=_0x240f13||'/';}else _0x3318f3==='.'?_0x92c71e=_0xe18aa4:_0x92c71e=_0xe18aa4+'/'+_0x3318f3;_0x1ebb54[_0x4c6eba(0xb8)]&&console[_0x4c6eba(0xa2)](_0x4c6eba(0xba)+_0x92c71e);}if(_0x92c71e==='/'||_0x92c71e==='')return saveSessionContext({'segment_path':undefined},_0x40339a),console[_0x4c6eba(0xbb)](a37_0x536541[_0x4c6eba(0xb6)](_0x4c6eba(0xc9))),0x0;_0x92c71e=normalizePath(_0x92c71e);const _0xf9544=parsePath(_0x92c71e)['segments'];if(_0xf9544[_0x4c6eba(0xa4)]===0x0)return saveSessionContext({'segment_path':undefined},_0x40339a),console[_0x4c6eba(0xbb)](a37_0x536541[_0x4c6eba(0xb6)](_0x4c6eba(0xc9))),0x0;_0x1ebb54[_0x4c6eba(0xb8)]&&(console[_0x4c6eba(0xa2)](_0x4c6eba(0xb5)+_0x1ebb54[_0x4c6eba(0xc1)]),console[_0x4c6eba(0xa2)]('Target\x20path:\x20'+_0x92c71e));const _0x15e0bf=await withSpinner('Resolving\x20path\x20\x27'+_0x92c71e+'\x27...',()=>_0x755aca[_0x4c6eba(0x98)][_0x4c6eba(0xb3)](_0x92c71e),{'verbose':_0x1ebb54[_0x4c6eba(0xb8)]}),_0x4f85aa=_0x15e0bf[_0x4c6eba(0xc5)];_0x1ebb54[_0x4c6eba(0xb8)]&&(console[_0x4c6eba(0xa2)]('Resolved\x20path\x20type:\x20'+_0x4f85aa[_0x4c6eba(0xbd)]),console[_0x4c6eba(0xa2)](_0x4c6eba(0xcb)+_0x4f85aa['parentId']),_0x4f85aa[_0x4c6eba(0xcd)]&&console[_0x4c6eba(0xa2)]('Folder\x20ID:\x20'+_0x4f85aa[_0x4c6eba(0xcd)]));if(_0x4f85aa[_0x4c6eba(0xbd)]===_0x4c6eba(0x98))return console['error'](a37_0x536541[_0x4c6eba(0xb0)](_0x4c6eba(0xb9))),console[_0x4c6eba(0xa2)](_0x4c6eba(0xa1)),console[_0x4c6eba(0xa2)](a37_0x536541['cyan']('Use:\x20tdx\x20segment\x20use\x20'+_0x4f85aa[_0x4c6eba(0x96)]+(_0x4f85aa[_0x4c6eba(0xb1)]?'/'+_0x4f85aa[_0x4c6eba(0xb1)]['join']('/'):''))),0x1;return saveSessionContext({'segment_path':_0x4f85aa[_0x4c6eba(0xc6)],'parent_segment':_0x4f85aa['parentName']},_0x40339a),console['log'](a37_0x536541['green'](_0x4c6eba(0xa3)+a37_0x536541[_0x4c6eba(0xc0)](_0x4f85aa[_0x4c6eba(0xc6)]))),_0x1ebb54[_0x4c6eba(0xb8)]&&(console[_0x4c6eba(0xa2)](a37_0x536541['dim'](_0x4c6eba(0xcc))),console[_0x4c6eba(0xa2)](a37_0x536541[_0x4c6eba(0x9b)](_0x4c6eba(0xa9)))),0x0;}catch(_0x282103){throw _0x282103;}}}function a37_0x2156(){const _0x301c78=['\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22','parent_segment','152SUhoWU','data','fullPath','244657ecBBAm','3894141zZkzhG','✔\x20Context\x20cleared.\x20Back\x20to\x20root.','split','Parent\x20ID:\x20','Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context','folderId','6OewVsI','6482520INHNoD','parentName','description','segment','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>','dim','config','isDirectory','145053arAIsr','Examples:','Set\x20current\x20segment/folder\x20context\x20for\x20navigation','Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.','error','✔\x20Context\x20set\x20to:\x20','length','2908374ExaBAy','isAbsolute','segmentPath','session','Use\x20\x22tdx\x20context\x22\x20to\x20see\x20all\x20context\x20parameters','28993640GtBqXT','slice','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22','name','Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.','Error:\x20Path\x20is\x20required\x0a','red','folderPath','join','resolvePathToResource','\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context','Site:\x20','green','Usage:\x20tdx\x20segment\x20use\x20<path>','verbose','Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.','Resolved\x20relative\x20path\x20to:\x20','log','1492DzzxJX','type','12075TXfANN','Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','cyan','site'];a37_0x2156=function(){return _0x301c78;};return a37_0x2156();}
@@ -1 +1 @@
1
- const a38_0x191606=a38_0x4c13;(function(_0x8a35d,_0x5be5a9){const _0x35c242=a38_0x4c13,_0x58afcd=_0x8a35d();while(!![]){try{const _0x4b103b=parseInt(_0x35c242(0x161))/0x1*(-parseInt(_0x35c242(0x173))/0x2)+-parseInt(_0x35c242(0x14b))/0x3+parseInt(_0x35c242(0x15e))/0x4*(parseInt(_0x35c242(0x15c))/0x5)+parseInt(_0x35c242(0x16c))/0x6+parseInt(_0x35c242(0x15a))/0x7*(-parseInt(_0x35c242(0x17b))/0x8)+parseInt(_0x35c242(0x14c))/0x9+-parseInt(_0x35c242(0x177))/0xa*(-parseInt(_0x35c242(0x187))/0xb);if(_0x4b103b===_0x5be5a9)break;else _0x58afcd['push'](_0x58afcd['shift']());}catch(_0x5ce72a){_0x58afcd['push'](_0x58afcd['shift']());}}}(a38_0x41b4,0x244d8));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{formatFlatList,formatTree}from'../utils/tree-formatter.js';import{getConsoleNextUrl}from'../types/endpoints.js';function a38_0x4c13(_0x30c001,_0x51ae3a){_0x30c001=_0x30c001-0x149;const _0x41b41d=a38_0x41b4();let _0x4c1387=_0x41b41d[_0x30c001];return _0x4c1387;}import a38_0x360da9 from'chalk';export class SegmentsCommand extends BaseCommand{[a38_0x191606(0x180)]=a38_0x191606(0x167);[a38_0x191606(0x151)]='List\x20folders\x20and\x20child\x20segments';async[a38_0x191606(0x18f)](_0xa15496){const _0xd21b5d=a38_0x191606,{options:_0x4d07ef,args:_0x5d9120}=_0xa15496,_0x1fd33f=_0x4d07ef['recursive'],_0xb249a5=_0x5d9120[0x0];try{const _0x505f60=_0x4d07ef[_0xd21b5d(0x18d)];_0x4d07ef['verbose']&&(console['error'](_0xd21b5d(0x14f)+_0x4d07ef['site']),console['error'](_0xd21b5d(0x160)+(_0x505f60||'(not\x20set)')),_0xb249a5&&console[_0xd21b5d(0x176)]('Folder/pattern\x20arg:\x20'+_0xb249a5),_0x1fd33f&&console['error']('Recursive\x20mode:\x20enabled'));if(!_0x505f60)return console[_0xd21b5d(0x176)](_0xd21b5d(0x162)),console[_0xd21b5d(0x176)](''),console['error']('Set\x20a\x20parent\x20segment\x20context\x20first:'),console[_0xd21b5d(0x176)](_0xd21b5d(0x164)),console[_0xd21b5d(0x176)](_0xd21b5d(0x165)),console[_0xd21b5d(0x176)](''),console[_0xd21b5d(0x176)](_0xd21b5d(0x149)),0x1;const _0x1369ca=_0xb249a5&&(_0xb249a5[_0xd21b5d(0x17d)]('*')||_0xb249a5[_0xd21b5d(0x17d)]('?'));if(_0x1369ca)return await this[_0xd21b5d(0x15b)](_0xa15496,_0x505f60,_0xb249a5);const _0x2ac6ca=_0xb249a5?_0x505f60+'/'+_0xb249a5:_0x505f60;return _0x1fd33f?await this[_0xd21b5d(0x163)](_0xa15496,_0x2ac6ca):await this[_0xd21b5d(0x154)](_0xa15496,_0x2ac6ca);}catch(_0x42d7b3){if(_0x42d7b3 instanceof SDKError)return console['error'](_0xd21b5d(0x184)+_0x42d7b3[_0xd21b5d(0x181)]),_0x42d7b3[_0xd21b5d(0x150)]&&console[_0xd21b5d(0x176)](_0xd21b5d(0x185)+_0x42d7b3['cause']),0x1;throw _0x42d7b3;}}async[a38_0x191606(0x15b)](_0x4564c3,_0x5551c8,_0x230aa6){const _0x39e810=a38_0x191606,{options:_0x5eadbf,tdx:_0x24e9e3}=_0x4564c3,_0x11d840=_0x5eadbf[_0x39e810(0x191)],_0x141c8d=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x5551c8+_0x39e810(0x192),()=>_0x24e9e3['segment'][_0x39e810(0x155)](_0x5551c8),{'verbose':_0x5eadbf[_0x39e810(0x18b)]}),_0x11e94=_0x141c8d['data'],_0x2376ff=await withSpinner(_0x39e810(0x190),()=>Promise[_0x39e810(0x178)]([_0x24e9e3[_0x39e810(0x17f)][_0x39e810(0x154)](_0x11e94[_0x39e810(0x16a)],_0x11e94['folderId']),_0x24e9e3[_0x39e810(0x18c)]['listJourneysFromParentSegment'](_0x11e94[_0x39e810(0x16a)])]),{'verbose':_0x5eadbf[_0x39e810(0x18b)]}),[_0x3e2290,_0x7836d4]=_0x2376ff[_0x39e810(0x186)],{folders:_0x5c68d9,segments:_0x5dddcc}=_0x3e2290,_0x19b5c8=_0x230aa6['replace'](/[.+^${}()|[\]\\]/g,_0x39e810(0x174))[_0x39e810(0x168)](/\*/g,'.*')[_0x39e810(0x168)](/\?/g,'.'),_0x4365a6=new RegExp('^'+_0x19b5c8+'$','i'),_0x2f8a74=_0x5c68d9[_0x39e810(0x182)](_0x182063=>_0x4365a6['test'](_0x182063['name'])),_0xff155d=_0x5dddcc[_0x39e810(0x182)](_0x3ed96e=>_0x4365a6[_0x39e810(0x159)](_0x3ed96e[_0x39e810(0x180)])),_0x29349e=_0x7836d4[_0x39e810(0x182)](_0x263b01=>_0x4365a6[_0x39e810(0x159)](_0x263b01[_0x39e810(0x16b)])),_0x5962ce=_0x2f8a74['length']+_0xff155d['length']+_0x29349e[_0x39e810(0x15f)];console[_0x39e810(0x176)]('✔\x20Found\x20'+_0x2f8a74[_0x39e810(0x15f)]+_0x39e810(0x152)+(_0x2f8a74[_0x39e810(0x15f)]!==0x1?'s':'')+',\x20'+_0xff155d[_0x39e810(0x15f)]+_0x39e810(0x153)+(_0xff155d[_0x39e810(0x15f)]!==0x1?'s':'')+_0x39e810(0x157)+_0x29349e[_0x39e810(0x15f)]+_0x39e810(0x14a)+(_0x29349e[_0x39e810(0x15f)]!==0x1?'s':'')+'\x20matching\x20\x27'+_0x230aa6+'\x27');const _0x25201f=_0x253b00=>{const _0x2985d7=_0x39e810;return getConsoleNextUrl(_0x5eadbf[_0x2985d7(0x166)],'/app/ps/'+_0x11e94[_0x2985d7(0x16a)]+_0x2985d7(0x17c)+_0x253b00);},_0x17bb8c=_0x5eadbf['format']===_0x39e810(0x156)||_0x5eadbf[_0x39e810(0x169)]===_0x39e810(0x17a);if(_0x17bb8c){const _0x509d8a=[..._0x2f8a74[_0x39e810(0x179)](_0x3af50a=>({..._0x3af50a,'type':_0x39e810(0x16f)})),..._0xff155d['map'](_0x3c3f55=>({..._0x3c3f55,'type':_0x39e810(0x17f),'url':_0x25201f(_0x3c3f55['id'])})),..._0x29349e[_0x39e810(0x179)](_0x15c79a=>({..._0x15c79a,'name':_0x15c79a[_0x39e810(0x16b)],'type':'journey'}))]['sort']((_0x17660b,_0x62da0d)=>_0x17660b[_0x39e810(0x180)][_0x39e810(0x16d)](_0x62da0d[_0x39e810(0x180)]));await handleSDKOutput(_0x509d8a,_0x5eadbf);}else{if(_0x5962ce===0x0)console['log'](_0x39e810(0x16e)+_0x230aa6);else{console[_0x39e810(0x171)](a38_0x360da9[_0x39e810(0x189)]('['+_0x5551c8+']\x20matching\x20\x27'+_0x230aa6+'\x27'));const _0x15d27f=formatFlatList(_0x2f8a74,_0xff155d,{'showMetadata':!![],'showUrl':_0x11d840,'getSegmentUrl':_0x25201f},_0x29349e);console[_0x39e810(0x171)](_0x15d27f);}}return 0x0;}async[a38_0x191606(0x154)](_0x44759f,_0x30de3e){const _0x19bd4b=a38_0x191606,{options:_0x4beb1d,tdx:_0x2bb087}=_0x44759f,_0x267195=_0x4beb1d[_0x19bd4b(0x191)],_0x15cbd0=await withSpinner(_0x19bd4b(0x14d)+_0x30de3e+_0x19bd4b(0x192),()=>_0x2bb087[_0x19bd4b(0x17f)]['resolvePathToResource'](_0x30de3e),{'verbose':_0x4beb1d['verbose']}),_0x5bf517=_0x15cbd0[_0x19bd4b(0x186)];_0x4beb1d[_0x19bd4b(0x18b)]&&(console['error'](_0x19bd4b(0x158)+_0x5bf517[_0x19bd4b(0x16a)]),_0x5bf517[_0x19bd4b(0x172)]&&console['error'](_0x19bd4b(0x18a)+_0x5bf517[_0x19bd4b(0x172)]));const _0x10f289=await withSpinner(_0x19bd4b(0x190),()=>Promise[_0x19bd4b(0x178)]([_0x2bb087['segment'][_0x19bd4b(0x154)](_0x5bf517[_0x19bd4b(0x16a)],_0x5bf517[_0x19bd4b(0x172)]),_0x2bb087[_0x19bd4b(0x18c)][_0x19bd4b(0x170)](_0x5bf517[_0x19bd4b(0x16a)])]),{'verbose':_0x4beb1d[_0x19bd4b(0x18b)]}),[_0x31311d,_0x53911c]=_0x10f289[_0x19bd4b(0x186)],{folders:_0xef3a18,segments:_0x5de175}=_0x31311d,_0x5b367f=_0xef3a18[_0x19bd4b(0x15f)]+_0x5de175[_0x19bd4b(0x15f)]+_0x53911c[_0x19bd4b(0x15f)];console['error'](_0x19bd4b(0x175)+_0xef3a18[_0x19bd4b(0x15f)]+_0x19bd4b(0x152)+(_0xef3a18[_0x19bd4b(0x15f)]!==0x1?'s':'')+',\x20'+_0x5de175['length']+_0x19bd4b(0x153)+(_0x5de175['length']!==0x1?'s':'')+',\x20and\x20'+_0x53911c['length']+_0x19bd4b(0x14a)+(_0x53911c[_0x19bd4b(0x15f)]!==0x1?'s':''));const _0x57d652=_0xfc4977=>{const _0x5a003c=_0x19bd4b;return getConsoleNextUrl(_0x4beb1d[_0x5a003c(0x166)],'/app/ps/'+_0x5bf517['parentId']+_0x5a003c(0x17c)+_0xfc4977);},_0x139975=_0x4beb1d['format']===_0x19bd4b(0x156)||_0x4beb1d['format']===_0x19bd4b(0x17a);if(_0x139975){const _0x1a5e9c=[..._0xef3a18[_0x19bd4b(0x179)](_0x2d9f0d=>({..._0x2d9f0d,'type':'folder'})),..._0x5de175['map'](_0x2cf6fd=>({..._0x2cf6fd,'type':_0x19bd4b(0x17f),'url':_0x57d652(_0x2cf6fd['id'])})),..._0x53911c['map'](_0x5611c4=>({..._0x5611c4,'name':_0x5611c4[_0x19bd4b(0x16b)],'type':_0x19bd4b(0x18c)}))]['sort']((_0x4ac732,_0x4cdd76)=>_0x4ac732[_0x19bd4b(0x180)]['localeCompare'](_0x4cdd76[_0x19bd4b(0x180)]));await handleSDKOutput(_0x1a5e9c,_0x4beb1d);}else{if(_0x5b367f===0x0)console[_0x19bd4b(0x171)](a38_0x360da9[_0x19bd4b(0x189)]('['+_0x30de3e+']')),console[_0x19bd4b(0x171)](_0x19bd4b(0x14e));else{console['log'](a38_0x360da9['dim']('['+_0x30de3e+']'));const _0x2b1ffc=formatFlatList(_0xef3a18,_0x5de175,{'showMetadata':!![],'showUrl':_0x267195,'getSegmentUrl':_0x57d652},_0x53911c);console['log'](_0x2b1ffc);}}return 0x0;}async[a38_0x191606(0x163)](_0x550783,_0x5285b8){const _0x1037de=a38_0x191606,{options:_0x549bc0,tdx:_0x510426}=_0x550783,_0x23bfd9=_0x549bc0[_0x1037de(0x191)],_0x2bd964=await withSpinner(_0x1037de(0x14d)+_0x5285b8+_0x1037de(0x192),()=>_0x510426[_0x1037de(0x17f)][_0x1037de(0x155)](_0x5285b8),{'verbose':_0x549bc0[_0x1037de(0x18b)]}),_0x5b7a6b=_0x2bd964[_0x1037de(0x186)];_0x549bc0[_0x1037de(0x18b)]&&(console['error'](_0x1037de(0x158)+_0x5b7a6b['parentId']),_0x5b7a6b[_0x1037de(0x172)]&&console[_0x1037de(0x176)]('Folder\x20ID:\x20'+_0x5b7a6b[_0x1037de(0x172)]));const _0xf94256=_0x549bc0[_0x1037de(0x183)]||0xa,_0x5cd836=await withSpinner(_0x1037de(0x15d),()=>_0x510426[_0x1037de(0x17f)]['listRecursive'](_0x5b7a6b[_0x1037de(0x16a)],_0x5b7a6b[_0x1037de(0x172)],0x0,_0xf94256),{'verbose':_0x549bc0[_0x1037de(0x18b)]}),_0x28aaea=_0x5cd836[_0x1037de(0x186)];console[_0x1037de(0x176)](_0x1037de(0x17e)+_0x28aaea[_0x1037de(0x15f)]+_0x1037de(0x188));const _0x552f60=_0x5b8776=>{const _0x535b5a=_0x1037de;return getConsoleNextUrl(_0x549bc0[_0x535b5a(0x166)],_0x535b5a(0x18e)+_0x5b7a6b[_0x535b5a(0x16a)]+_0x535b5a(0x17c)+_0x5b8776);};if(_0x549bc0[_0x1037de(0x169)]===_0x1037de(0x156)||_0x549bc0[_0x1037de(0x169)]===_0x1037de(0x17a))await handleSDKOutput(_0x28aaea,_0x549bc0);else{console[_0x1037de(0x171)](a38_0x360da9['dim']('['+_0x5285b8+']'));const _0x1f0866=formatTree(_0x28aaea,{'showMetadata':!![],'showUrl':_0x23bfd9,'getSegmentUrl':_0x552f60});console[_0x1037de(0x171)](_0x1f0866);}return 0x0;}}function a38_0x41b4(){const _0x352129=['web','\x27...','Use\x20tdx\x20ps\x20list\x20to\x20see\x20available\x20parent\x20segments.','\x20journey','171774EbNYjE','283473MofkGB','Resolving\x20path\x20\x27','(empty)','Site:\x20','cause','description','\x20folder','\x20segment','listUnified','resolvePathToResource','json',',\x20and\x20','Parent\x20ID:\x20','test','11004wTzqrg','listWithPattern','945095oOXuAv','Building\x20hierarchy\x20tree...','4aNvUkG','length','Parent\x20segment\x20context:\x20','134089POdnPB','Error:\x20No\x20parent\x20segment\x20context\x20set.','listRecursive','\x20\x20tdx\x20sg\x20pull\x20\x22My\x20Audience\x22','\x20\x20tdx\x20sg\x20use\x20\x22My\x20Audience\x22','site','segments','replace','format','parentId','journeyBundleName','824136bcvJlZ','localeCompare','No\x20items\x20match\x20pattern:\x20','folder','listJourneysFromParentSegment','log','folderId','2dYcACY','\x5c$&','✔\x20Found\x20','error','150eCJskb','all','map','jsonl','976vMQaqe','/e/','includes','✔\x20Built\x20tree\x20with\x20','segment','name','message','filter','maxDepth','Error:\x20','\x20\x20Cause:\x20','data','127567vYeqfM','\x20top-level\x20items','dim','Folder\x20ID:\x20','verbose','journey','parentSegment','/app/ps/','execute','Listing\x20folders,\x20segments,\x20and\x20journeys...'];a38_0x41b4=function(){return _0x352129;};return a38_0x41b4();}
1
+ const a38_0x3b69c5=a38_0x1470;(function(_0x26e4a9,_0xda61ac){const _0x3e8a43=a38_0x1470,_0x3ea68b=_0x26e4a9();while(!![]){try{const _0x2790ff=-parseInt(_0x3e8a43(0xe7))/0x1*(-parseInt(_0x3e8a43(0xc4))/0x2)+parseInt(_0x3e8a43(0xcd))/0x3*(-parseInt(_0x3e8a43(0xdb))/0x4)+parseInt(_0x3e8a43(0xe9))/0x5+parseInt(_0x3e8a43(0xe1))/0x6+-parseInt(_0x3e8a43(0xb3))/0x7+parseInt(_0x3e8a43(0xdd))/0x8*(parseInt(_0x3e8a43(0xd5))/0x9)+-parseInt(_0x3e8a43(0xb6))/0xa*(-parseInt(_0x3e8a43(0xf4))/0xb);if(_0x2790ff===_0xda61ac)break;else _0x3ea68b['push'](_0x3ea68b['shift']());}catch(_0x10172d){_0x3ea68b['push'](_0x3ea68b['shift']());}}}(a38_0x3c47,0x5d24a));function a38_0x3c47(){const _0xa6d072=['✔\x20Found\x20','listUnified','all','\x20top-level\x20items','Error:\x20','58172adUFMI','Building\x20hierarchy\x20tree...','8560XiUTtj','Listing\x20folders,\x20segments,\x20and\x20journeys...','\x20journey','maxDepth','1775916rzkPhm','\x27...','folder','length','name','data','15883qoYSwe','listWithPattern','2295440frYjvP','test','log','\x20\x20Cause:\x20','\x20matching\x20\x27','cause','recursive','web','localeCompare','segment','parentId','121whsntw','resolvePathToResource','sort','format','filter','(not\x20set)','replace','error','parentSegment','\x20folder','Resolving\x20path\x20\x27','Recursive\x20mode:\x20enabled','3295901lJZAhF','verbose','description','142280CKpjad','folderId','\x20segment','journeyBundleName','✔\x20Built\x20tree\x20with\x20','Parent\x20segment\x20context:\x20','No\x20items\x20match\x20pattern:\x20','Folder\x20ID:\x20','segments','\x20\x20tdx\x20sg\x20pull\x20\x22My\x20Audience\x22',',\x20and\x20','Parent\x20ID:\x20','/e/','site','20CyvLiF','Use\x20tdx\x20ps\x20list\x20to\x20see\x20available\x20parent\x20segments.','includes','jsonl','json','listJourneysFromParentSegment','\x5c$&','listRecursive','Resolving\x20parent\x20segment\x20\x27','75FnCgSz','message','map','journey','List\x20folders\x20and\x20child\x20segments','\x20\x20tdx\x20sg\x20use\x20\x22My\x20Audience\x22','dim','Folder/pattern\x20arg:\x20','1224qgUmpw'];a38_0x3c47=function(){return _0xa6d072;};return a38_0x3c47();}function a38_0x1470(_0x529163,_0x3b2786){_0x529163=_0x529163-0xab;const _0x3c4751=a38_0x3c47();let _0x147021=_0x3c4751[_0x529163];return _0x147021;}import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{formatFlatList,formatTree}from'../utils/tree-formatter.js';import{getConsoleNextUrl}from'../types/endpoints.js';import a38_0x2b866f from'chalk';export class SegmentsCommand extends BaseCommand{[a38_0x3b69c5(0xe5)]=a38_0x3b69c5(0xbe);[a38_0x3b69c5(0xb5)]=a38_0x3b69c5(0xd1);async['execute'](_0x419a95){const _0x3399f8=a38_0x3b69c5,{options:_0x4db958,args:_0x13f98d}=_0x419a95,_0x49db68=_0x4db958[_0x3399f8(0xef)],_0x715c1a=_0x13f98d[0x0];try{const _0x5857a3=_0x4db958[_0x3399f8(0xaf)];_0x4db958[_0x3399f8(0xb4)]&&(console[_0x3399f8(0xae)]('Site:\x20'+_0x4db958[_0x3399f8(0xc3)]),console[_0x3399f8(0xae)](_0x3399f8(0xbb)+(_0x5857a3||_0x3399f8(0xac))),_0x715c1a&&console['error'](_0x3399f8(0xd4)+_0x715c1a),_0x49db68&&console[_0x3399f8(0xae)](_0x3399f8(0xb2)));if(!_0x5857a3)return console[_0x3399f8(0xae)]('Error:\x20No\x20parent\x20segment\x20context\x20set.'),console[_0x3399f8(0xae)](''),console[_0x3399f8(0xae)]('Set\x20a\x20parent\x20segment\x20context\x20first:'),console[_0x3399f8(0xae)](_0x3399f8(0xbf)),console[_0x3399f8(0xae)](_0x3399f8(0xd2)),console[_0x3399f8(0xae)](''),console[_0x3399f8(0xae)](_0x3399f8(0xc5)),0x1;const _0x3e28f4=_0x715c1a&&(_0x715c1a[_0x3399f8(0xc6)]('*')||_0x715c1a[_0x3399f8(0xc6)]('?'));if(_0x3e28f4)return await this[_0x3399f8(0xe8)](_0x419a95,_0x5857a3,_0x715c1a);const _0x20783e=_0x715c1a?_0x5857a3+'/'+_0x715c1a:_0x5857a3;return _0x49db68?await this[_0x3399f8(0xcb)](_0x419a95,_0x20783e):await this[_0x3399f8(0xd7)](_0x419a95,_0x20783e);}catch(_0x37f8e0){if(_0x37f8e0 instanceof SDKError)return console['error'](_0x3399f8(0xda)+_0x37f8e0[_0x3399f8(0xce)]),_0x37f8e0[_0x3399f8(0xee)]&&console[_0x3399f8(0xae)](_0x3399f8(0xec)+_0x37f8e0[_0x3399f8(0xee)]),0x1;throw _0x37f8e0;}}async[a38_0x3b69c5(0xe8)](_0x36a6e0,_0xb4fe2b,_0x46eea2){const _0x4c6b1e=a38_0x3b69c5,{options:_0x1f5162,tdx:_0x464e43}=_0x36a6e0,_0x2b736b=_0x1f5162[_0x4c6b1e(0xf0)],_0x1948de=await withSpinner(_0x4c6b1e(0xcc)+_0xb4fe2b+'\x27...',()=>_0x464e43['segment'][_0x4c6b1e(0xf5)](_0xb4fe2b),{'verbose':_0x1f5162[_0x4c6b1e(0xb4)]}),_0x526e19=_0x1948de['data'],_0x5ef20a=await withSpinner(_0x4c6b1e(0xde),()=>Promise[_0x4c6b1e(0xd8)]([_0x464e43['segment'][_0x4c6b1e(0xd7)](_0x526e19[_0x4c6b1e(0xf3)],_0x526e19[_0x4c6b1e(0xb7)]),_0x464e43[_0x4c6b1e(0xd0)][_0x4c6b1e(0xc9)](_0x526e19[_0x4c6b1e(0xf3)])]),{'verbose':_0x1f5162[_0x4c6b1e(0xb4)]}),[_0x162f53,_0x2a66e4]=_0x5ef20a[_0x4c6b1e(0xe6)],{folders:_0x34e610,segments:_0x347a2b}=_0x162f53,_0x4ec745=_0x46eea2[_0x4c6b1e(0xad)](/[.+^${}()|[\]\\]/g,_0x4c6b1e(0xca))['replace'](/\*/g,'.*')['replace'](/\?/g,'.'),_0x26055c=new RegExp('^'+_0x4ec745+'$','i'),_0x59d49b=_0x34e610[_0x4c6b1e(0xab)](_0x53dc96=>_0x26055c[_0x4c6b1e(0xea)](_0x53dc96[_0x4c6b1e(0xe5)])),_0x5307da=_0x347a2b[_0x4c6b1e(0xab)](_0x500cc9=>_0x26055c['test'](_0x500cc9['name'])),_0x2b5f8e=_0x2a66e4['filter'](_0x4da842=>_0x26055c[_0x4c6b1e(0xea)](_0x4da842['journeyBundleName'])),_0x464dbe=_0x59d49b[_0x4c6b1e(0xe4)]+_0x5307da[_0x4c6b1e(0xe4)]+_0x2b5f8e['length'];console[_0x4c6b1e(0xae)](_0x4c6b1e(0xd6)+_0x59d49b[_0x4c6b1e(0xe4)]+_0x4c6b1e(0xb0)+(_0x59d49b[_0x4c6b1e(0xe4)]!==0x1?'s':'')+',\x20'+_0x5307da['length']+'\x20segment'+(_0x5307da['length']!==0x1?'s':'')+_0x4c6b1e(0xc0)+_0x2b5f8e[_0x4c6b1e(0xe4)]+_0x4c6b1e(0xdf)+(_0x2b5f8e[_0x4c6b1e(0xe4)]!==0x1?'s':'')+_0x4c6b1e(0xed)+_0x46eea2+'\x27');const _0x358143=_0x17e4c9=>{const _0x5041c4=_0x4c6b1e;return getConsoleNextUrl(_0x1f5162[_0x5041c4(0xc3)],'/app/ps/'+_0x526e19[_0x5041c4(0xf3)]+_0x5041c4(0xc2)+_0x17e4c9);},_0xdb3cac=_0x1f5162[_0x4c6b1e(0xf7)]==='json'||_0x1f5162['format']===_0x4c6b1e(0xc7);if(_0xdb3cac){const _0x3b2219=[..._0x59d49b[_0x4c6b1e(0xcf)](_0x1a2af8=>({..._0x1a2af8,'type':'folder'})),..._0x5307da[_0x4c6b1e(0xcf)](_0x1e9f9d=>({..._0x1e9f9d,'type':_0x4c6b1e(0xf2),'url':_0x358143(_0x1e9f9d['id'])})),..._0x2b5f8e[_0x4c6b1e(0xcf)](_0x5e7f58=>({..._0x5e7f58,'name':_0x5e7f58[_0x4c6b1e(0xb9)],'type':_0x4c6b1e(0xd0)}))][_0x4c6b1e(0xf6)]((_0x423977,_0x38fc6c)=>_0x423977[_0x4c6b1e(0xe5)][_0x4c6b1e(0xf1)](_0x38fc6c['name']));await handleSDKOutput(_0x3b2219,_0x1f5162);}else{if(_0x464dbe===0x0)console[_0x4c6b1e(0xeb)](_0x4c6b1e(0xbc)+_0x46eea2);else{console['log'](a38_0x2b866f[_0x4c6b1e(0xd3)]('['+_0xb4fe2b+']\x20matching\x20\x27'+_0x46eea2+'\x27'));const _0x1771ef=formatFlatList(_0x59d49b,_0x5307da,{'showMetadata':!![],'showUrl':_0x2b736b,'getSegmentUrl':_0x358143},_0x2b5f8e);console['log'](_0x1771ef);}}return 0x0;}async[a38_0x3b69c5(0xd7)](_0x2c85ec,_0x3f7491){const _0xbd05b8=a38_0x3b69c5,{options:_0x4d3def,tdx:_0x56f77f}=_0x2c85ec,_0x9d9bc2=_0x4d3def['web'],_0x520b1a=await withSpinner(_0xbd05b8(0xb1)+_0x3f7491+_0xbd05b8(0xe2),()=>_0x56f77f[_0xbd05b8(0xf2)]['resolvePathToResource'](_0x3f7491),{'verbose':_0x4d3def[_0xbd05b8(0xb4)]}),_0x40b3e9=_0x520b1a[_0xbd05b8(0xe6)];_0x4d3def[_0xbd05b8(0xb4)]&&(console[_0xbd05b8(0xae)](_0xbd05b8(0xc1)+_0x40b3e9[_0xbd05b8(0xf3)]),_0x40b3e9[_0xbd05b8(0xb7)]&&console['error']('Folder\x20ID:\x20'+_0x40b3e9[_0xbd05b8(0xb7)]));const _0x4f2cfc=await withSpinner(_0xbd05b8(0xde),()=>Promise[_0xbd05b8(0xd8)]([_0x56f77f[_0xbd05b8(0xf2)][_0xbd05b8(0xd7)](_0x40b3e9['parentId'],_0x40b3e9[_0xbd05b8(0xb7)]),_0x56f77f[_0xbd05b8(0xd0)][_0xbd05b8(0xc9)](_0x40b3e9[_0xbd05b8(0xf3)])]),{'verbose':_0x4d3def[_0xbd05b8(0xb4)]}),[_0x1e9d52,_0x3ce74c]=_0x4f2cfc[_0xbd05b8(0xe6)],{folders:_0x3a0ccc,segments:_0x56add3}=_0x1e9d52,_0x5b4105=_0x3a0ccc['length']+_0x56add3[_0xbd05b8(0xe4)]+_0x3ce74c[_0xbd05b8(0xe4)];console[_0xbd05b8(0xae)]('✔\x20Found\x20'+_0x3a0ccc[_0xbd05b8(0xe4)]+_0xbd05b8(0xb0)+(_0x3a0ccc[_0xbd05b8(0xe4)]!==0x1?'s':'')+',\x20'+_0x56add3[_0xbd05b8(0xe4)]+_0xbd05b8(0xb8)+(_0x56add3[_0xbd05b8(0xe4)]!==0x1?'s':'')+_0xbd05b8(0xc0)+_0x3ce74c[_0xbd05b8(0xe4)]+_0xbd05b8(0xdf)+(_0x3ce74c[_0xbd05b8(0xe4)]!==0x1?'s':''));const _0x2c8806=_0x4d433d=>{const _0xa984e8=_0xbd05b8;return getConsoleNextUrl(_0x4d3def['site'],'/app/ps/'+_0x40b3e9[_0xa984e8(0xf3)]+_0xa984e8(0xc2)+_0x4d433d);},_0x4489c1=_0x4d3def['format']===_0xbd05b8(0xc8)||_0x4d3def[_0xbd05b8(0xf7)]===_0xbd05b8(0xc7);if(_0x4489c1){const _0x5b5aa7=[..._0x3a0ccc['map'](_0x2debf2=>({..._0x2debf2,'type':_0xbd05b8(0xe3)})),..._0x56add3[_0xbd05b8(0xcf)](_0x2e052c=>({..._0x2e052c,'type':_0xbd05b8(0xf2),'url':_0x2c8806(_0x2e052c['id'])})),..._0x3ce74c[_0xbd05b8(0xcf)](_0x523f56=>({..._0x523f56,'name':_0x523f56[_0xbd05b8(0xb9)],'type':_0xbd05b8(0xd0)}))][_0xbd05b8(0xf6)]((_0x5840cd,_0x446d24)=>_0x5840cd['name'][_0xbd05b8(0xf1)](_0x446d24[_0xbd05b8(0xe5)]));await handleSDKOutput(_0x5b5aa7,_0x4d3def);}else{if(_0x5b4105===0x0)console['log'](a38_0x2b866f[_0xbd05b8(0xd3)]('['+_0x3f7491+']')),console['log']('(empty)');else{console[_0xbd05b8(0xeb)](a38_0x2b866f[_0xbd05b8(0xd3)]('['+_0x3f7491+']'));const _0x1bbcba=formatFlatList(_0x3a0ccc,_0x56add3,{'showMetadata':!![],'showUrl':_0x9d9bc2,'getSegmentUrl':_0x2c8806},_0x3ce74c);console['log'](_0x1bbcba);}}return 0x0;}async[a38_0x3b69c5(0xcb)](_0x335280,_0x2f4ee1){const _0x41d39d=a38_0x3b69c5,{options:_0x34ed96,tdx:_0x228f91}=_0x335280,_0xf1c2f1=_0x34ed96[_0x41d39d(0xf0)],_0xcfdd41=await withSpinner('Resolving\x20path\x20\x27'+_0x2f4ee1+'\x27...',()=>_0x228f91[_0x41d39d(0xf2)]['resolvePathToResource'](_0x2f4ee1),{'verbose':_0x34ed96[_0x41d39d(0xb4)]}),_0x9cb6e1=_0xcfdd41[_0x41d39d(0xe6)];_0x34ed96[_0x41d39d(0xb4)]&&(console[_0x41d39d(0xae)](_0x41d39d(0xc1)+_0x9cb6e1[_0x41d39d(0xf3)]),_0x9cb6e1['folderId']&&console[_0x41d39d(0xae)](_0x41d39d(0xbd)+_0x9cb6e1[_0x41d39d(0xb7)]));const _0x3d2c3f=_0x34ed96[_0x41d39d(0xe0)]||0xa,_0x24befc=await withSpinner(_0x41d39d(0xdc),()=>_0x228f91[_0x41d39d(0xf2)][_0x41d39d(0xcb)](_0x9cb6e1[_0x41d39d(0xf3)],_0x9cb6e1[_0x41d39d(0xb7)],0x0,_0x3d2c3f),{'verbose':_0x34ed96[_0x41d39d(0xb4)]}),_0x1f6d7c=_0x24befc[_0x41d39d(0xe6)];console[_0x41d39d(0xae)](_0x41d39d(0xba)+_0x1f6d7c['length']+_0x41d39d(0xd9));const _0x414bde=_0x1c5bef=>{const _0x3160aa=_0x41d39d;return getConsoleNextUrl(_0x34ed96[_0x3160aa(0xc3)],'/app/ps/'+_0x9cb6e1['parentId']+_0x3160aa(0xc2)+_0x1c5bef);};if(_0x34ed96[_0x41d39d(0xf7)]==='json'||_0x34ed96['format']===_0x41d39d(0xc7))await handleSDKOutput(_0x1f6d7c,_0x34ed96);else{console[_0x41d39d(0xeb)](a38_0x2b866f[_0x41d39d(0xd3)]('['+_0x2f4ee1+']'));const _0x557493=formatTree(_0x1f6d7c,{'showMetadata':!![],'showUrl':_0xf1c2f1,'getSegmentUrl':_0x414bde});console['log'](_0x557493);}return 0x0;}}
@@ -1 +1 @@
1
- const a39_0x59a2f4=a39_0x4ba7;(function(_0x2dc756,_0x4cdea1){const _0x41e9db=a39_0x4ba7,_0x1126f8=_0x2dc756();while(!![]){try{const _0x33094f=-parseInt(_0x41e9db(0x125))/0x1*(-parseInt(_0x41e9db(0x137))/0x2)+parseInt(_0x41e9db(0x114))/0x3*(parseInt(_0x41e9db(0x132))/0x4)+parseInt(_0x41e9db(0x11a))/0x5+parseInt(_0x41e9db(0x12f))/0x6*(parseInt(_0x41e9db(0x122))/0x7)+-parseInt(_0x41e9db(0x121))/0x8+parseInt(_0x41e9db(0x12b))/0x9+-parseInt(_0x41e9db(0x11b))/0xa;if(_0x33094f===_0x4cdea1)break;else _0x1126f8['push'](_0x1126f8['shift']());}catch(_0x41af08){_0x1126f8['push'](_0x1126f8['shift']());}}}(a39_0x5e7d,0x41194));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';import{parseTableReference,validateTableDescribeReference}from'../utils/table-ref-parser.js';function a39_0x5e7d(){const _0x146747=['Limit:\x20','✔\x20Retrieved\x20','args','60StuQSS','error','data','\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>','message','cause','659880FUGZpN','8109090EdbTKJ','\x20row','\x20\x20Cause:\x20','length','Database:\x20','site','2885104GjTLCs','1131641Wtkgsv','Too\x20many\x20arguments\x0aUsage:\x20tdx\x20show\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>\x0a\x0aRun\x20\x27tdx\x20show\x20--help\x27\x20for\x20more\x20options','Site:\x20','20nUjFiq','table','Error:\x20','Usage:\x20tdx\x20show\x20<database.table>','Show\x20table\x20contents','showTable','1226088GFLDPk','show','validate','\x20from\x20','6KKCmwc','Usage:\x20tdx\x20show\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--in\x20<database>\x0a\x0aRun\x20\x27tdx\x20show\x20--help\x27\x20for\x20more\x20options','Table:\x20','100156FzBxwN','database','\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>','verbose','catalog','50754EFEgfU','description'];a39_0x5e7d=function(){return _0x146747;};return a39_0x5e7d();}function a39_0x4ba7(_0x31ec20,_0x38d76e){_0x31ec20=_0x31ec20-0x112;const _0x5e7d12=a39_0x5e7d();let _0x4ba784=_0x5e7d12[_0x31ec20];return _0x4ba784;}import{withSpinner}from'../utils/spinner.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../utils/constants.js';export class ShowCommand extends BaseCommand{['name']=a39_0x59a2f4(0x12c);[a39_0x59a2f4(0x138)]=a39_0x59a2f4(0x129);async['execute'](_0x7ed1f0){const _0x312f5c=a39_0x59a2f4;return this[_0x312f5c(0x12a)](_0x7ed1f0);}async[a39_0x59a2f4(0x12a)](_0x571032){const _0x239c03=a39_0x59a2f4,{options:_0x59cc5f,args:_0x8ea67d,tdx:_0x4358aa}=_0x571032;let _0x3a217f;try{_0x3a217f=parseTableReference(_0x8ea67d[0x0]);const _0x1bf4d1=_0x59cc5f[_0x239c03(0x133)];!_0x3a217f[_0x239c03(0x133)]&&_0x1bf4d1&&(_0x3a217f[_0x239c03(0x133)]=_0x1bf4d1);const _0x4cdd94=validateTableDescribeReference(_0x3a217f);if(_0x4cdd94)return console['error']('Error:\x20'+_0x4cdd94),console[_0x239c03(0x115)](_0x239c03(0x128)),console[_0x239c03(0x115)](_0x239c03(0x117)),console[_0x239c03(0x115)](_0x239c03(0x134)),0x1;}catch(_0xdb3c8){return console[_0x239c03(0x115)](_0x239c03(0x127)+_0xdb3c8[_0x239c03(0x118)]),console[_0x239c03(0x115)]('Usage:\x20tdx\x20show\x20<database.table>'),console[_0x239c03(0x115)]('\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>'),console[_0x239c03(0x115)](_0x239c03(0x134)),0x1;}const _0x5a3fae=_0x3a217f[_0x239c03(0x136)],_0x2fb3a5=_0x3a217f[_0x239c03(0x133)],_0x492e3c=_0x3a217f[_0x239c03(0x126)],_0x5ac52f=resolveLimit(_0x59cc5f['limit'],DEFAULT_DISPLAY_LIMIT);try{_0x59cc5f[_0x239c03(0x135)]&&(console[_0x239c03(0x115)](_0x239c03(0x124)+_0x59cc5f[_0x239c03(0x120)]),_0x5a3fae&&console[_0x239c03(0x115)]('Catalog:\x20'+_0x5a3fae),console[_0x239c03(0x115)](_0x239c03(0x11f)+_0x2fb3a5),console[_0x239c03(0x115)](_0x239c03(0x131)+_0x492e3c),console[_0x239c03(0x115)](_0x239c03(0x139)+_0x5ac52f));const _0xabbe77=_0x5a3fae?_0x5a3fae+'.'+_0x2fb3a5+'.'+_0x492e3c:_0x2fb3a5+'.'+_0x492e3c,_0x2aed6a=await withSpinner('Querying\x20'+_0xabbe77+'...',()=>_0x4358aa['query']['showTable'](_0x2fb3a5,_0x492e3c,_0x5ac52f,_0x5a3fae),{'verbose':_0x59cc5f['verbose']}),_0x888399=_0x2aed6a[_0x239c03(0x116)],_0x492f61=_0x888399['data'];return _0x492f61[_0x239c03(0x11e)]===0x0?console[_0x239c03(0x115)]('✔\x20Query\x20successful\x20-\x200\x20rows\x20returned'):console[_0x239c03(0x115)](_0x239c03(0x112)+_0x492f61[_0x239c03(0x11e)]+_0x239c03(0x11c)+(_0x492f61['length']!==0x1?'s':'')+_0x239c03(0x12e)+_0xabbe77),await handleSDKOutput(_0x492f61,_0x59cc5f),0x0;}catch(_0x5c2496){if(_0x5c2496 instanceof SDKError)return console['error'](_0x239c03(0x127)+_0x5c2496[_0x239c03(0x118)]),_0x5c2496['cause']&&console['error'](_0x239c03(0x11d)+_0x5c2496[_0x239c03(0x119)]),0x1;throw _0x5c2496;}}[a39_0x59a2f4(0x12d)](_0x51a1c7){const _0x5a313b=a39_0x59a2f4;if(_0x51a1c7[_0x5a313b(0x113)][_0x5a313b(0x11e)]===0x0)return _0x5a313b(0x130);if(_0x51a1c7['args'][_0x5a313b(0x11e)]>0x1)return _0x5a313b(0x123);return undefined;}}
1
+ const a39_0x2d6264=a39_0xa680;(function(_0x26bb49,_0x310e08){const _0x4b40c6=a39_0xa680,_0x1f081a=_0x26bb49();while(!![]){try{const _0x1c4cde=-parseInt(_0x4b40c6(0x19d))/0x1+-parseInt(_0x4b40c6(0x1a2))/0x2*(-parseInt(_0x4b40c6(0x1aa))/0x3)+-parseInt(_0x4b40c6(0x19e))/0x4*(parseInt(_0x4b40c6(0x195))/0x5)+parseInt(_0x4b40c6(0x193))/0x6*(-parseInt(_0x4b40c6(0x18e))/0x7)+parseInt(_0x4b40c6(0x19f))/0x8+parseInt(_0x4b40c6(0x1ae))/0x9+parseInt(_0x4b40c6(0x197))/0xa;if(_0x1c4cde===_0x310e08)break;else _0x1f081a['push'](_0x1f081a['shift']());}catch(_0x568432){_0x1f081a['push'](_0x1f081a['shift']());}}}(a39_0x4030,0xb3552));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';function a39_0x4030(){const _0x3d4c80=['args','7dbxUjY','cause','Catalog:\x20','error','message','7125168uJArji','...','245PHbWxv','verbose','6549190TjZjTv','Usage:\x20tdx\x20show\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--in\x20<database>\x0a\x0aRun\x20\x27tdx\x20show\x20--help\x27\x20for\x20more\x20options','Usage:\x20tdx\x20show\x20<database.table>','Table:\x20','limit','Limit:\x20','442066NrlDen','7268wYbPbU','3386072uwEpBT','Show\x20table\x20contents','✔\x20Retrieved\x20','1198CdSxsA','catalog','execute','Error:\x20','Too\x20many\x20arguments\x0aUsage:\x20tdx\x20show\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>\x0a\x0aRun\x20\x27tdx\x20show\x20--help\x27\x20for\x20more\x20options','description','\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>','site','4035LAeDUk','\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>','length','database','5124060TqjTvK','data','Querying\x20','✔\x20Query\x20successful\x20-\x200\x20rows\x20returned','\x20row','Site:\x20'];a39_0x4030=function(){return _0x3d4c80;};return a39_0x4030();}function a39_0xa680(_0x2d2d83,_0x5a5745){_0x2d2d83=_0x2d2d83-0x188;const _0x4030bd=a39_0x4030();let _0xa68023=_0x4030bd[_0x2d2d83];return _0xa68023;}import{handleSDKOutput}from'../utils/command-output.js';import{parseTableReference,validateTableDescribeReference}from'../utils/table-ref-parser.js';import{withSpinner}from'../utils/spinner.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../utils/constants.js';export class ShowCommand extends BaseCommand{['name']='show';[a39_0x2d6264(0x1a7)]=a39_0x2d6264(0x1a0);async[a39_0x2d6264(0x1a4)](_0x49715b){return this['showTable'](_0x49715b);}async['showTable'](_0x4fcece){const _0x4e847c=a39_0x2d6264,{options:_0x110243,args:_0x3a58c4,tdx:_0x833539}=_0x4fcece;let _0x42b887;try{_0x42b887=parseTableReference(_0x3a58c4[0x0]);const _0xa87e44=_0x110243[_0x4e847c(0x1ad)];!_0x42b887[_0x4e847c(0x1ad)]&&_0xa87e44&&(_0x42b887[_0x4e847c(0x1ad)]=_0xa87e44);const _0x4bea94=validateTableDescribeReference(_0x42b887);if(_0x4bea94)return console[_0x4e847c(0x191)](_0x4e847c(0x1a5)+_0x4bea94),console[_0x4e847c(0x191)](_0x4e847c(0x199)),console[_0x4e847c(0x191)](_0x4e847c(0x1ab)),console[_0x4e847c(0x191)](_0x4e847c(0x1a8)),0x1;}catch(_0x1d0c45){return console['error'](_0x4e847c(0x1a5)+_0x1d0c45[_0x4e847c(0x192)]),console['error']('Usage:\x20tdx\x20show\x20<database.table>'),console[_0x4e847c(0x191)](_0x4e847c(0x1ab)),console[_0x4e847c(0x191)](_0x4e847c(0x1a8)),0x1;}const _0x25820e=_0x42b887[_0x4e847c(0x1a3)],_0x7af1bb=_0x42b887[_0x4e847c(0x1ad)],_0x1c3d93=_0x42b887['table'],_0x3c5161=resolveLimit(_0x110243[_0x4e847c(0x19b)],DEFAULT_DISPLAY_LIMIT);try{_0x110243[_0x4e847c(0x196)]&&(console['error'](_0x4e847c(0x18c)+_0x110243[_0x4e847c(0x1a9)]),_0x25820e&&console[_0x4e847c(0x191)](_0x4e847c(0x190)+_0x25820e),console[_0x4e847c(0x191)]('Database:\x20'+_0x7af1bb),console[_0x4e847c(0x191)](_0x4e847c(0x19a)+_0x1c3d93),console[_0x4e847c(0x191)](_0x4e847c(0x19c)+_0x3c5161));const _0x4860ae=_0x25820e?_0x25820e+'.'+_0x7af1bb+'.'+_0x1c3d93:_0x7af1bb+'.'+_0x1c3d93,_0x4a5b20=await withSpinner(_0x4e847c(0x189)+_0x4860ae+_0x4e847c(0x194),()=>_0x833539['query']['showTable'](_0x7af1bb,_0x1c3d93,_0x3c5161,_0x25820e),{'verbose':_0x110243[_0x4e847c(0x196)]}),_0x2185c7=_0x4a5b20[_0x4e847c(0x188)],_0x186eca=_0x2185c7['data'];return _0x186eca[_0x4e847c(0x1ac)]===0x0?console[_0x4e847c(0x191)](_0x4e847c(0x18a)):console[_0x4e847c(0x191)](_0x4e847c(0x1a1)+_0x186eca[_0x4e847c(0x1ac)]+_0x4e847c(0x18b)+(_0x186eca[_0x4e847c(0x1ac)]!==0x1?'s':'')+'\x20from\x20'+_0x4860ae),await handleSDKOutput(_0x186eca,_0x110243),0x0;}catch(_0x11ef3a){if(_0x11ef3a instanceof SDKError)return console[_0x4e847c(0x191)](_0x4e847c(0x1a5)+_0x11ef3a[_0x4e847c(0x192)]),_0x11ef3a[_0x4e847c(0x18f)]&&console['error']('\x20\x20Cause:\x20'+_0x11ef3a[_0x4e847c(0x18f)]),0x1;throw _0x11ef3a;}}['validate'](_0x548b64){const _0x344889=a39_0x2d6264;if(_0x548b64['args'][_0x344889(0x1ac)]===0x0)return _0x344889(0x198);if(_0x548b64[_0x344889(0x18d)][_0x344889(0x1ac)]>0x1)return _0x344889(0x1a6);return undefined;}}
@@ -1 +1 @@
1
- const a40_0x350797=a40_0x491a;(function(_0x23b81f,_0x55ef68){const _0x2d53fd=a40_0x491a,_0x43ccc3=_0x23b81f();while(!![]){try{const _0x1da778=-parseInt(_0x2d53fd(0x161))/0x1+-parseInt(_0x2d53fd(0x157))/0x2*(-parseInt(_0x2d53fd(0x185))/0x3)+-parseInt(_0x2d53fd(0x167))/0x4*(parseInt(_0x2d53fd(0x16f))/0x5)+parseInt(_0x2d53fd(0x175))/0x6*(-parseInt(_0x2d53fd(0x177))/0x7)+-parseInt(_0x2d53fd(0x171))/0x8*(-parseInt(_0x2d53fd(0x16a))/0x9)+parseInt(_0x2d53fd(0x179))/0xa*(parseInt(_0x2d53fd(0x181))/0xb)+-parseInt(_0x2d53fd(0x174))/0xc*(-parseInt(_0x2d53fd(0x17b))/0xd);if(_0x1da778===_0x55ef68)break;else _0x43ccc3['push'](_0x43ccc3['shift']());}catch(_0x23b062){_0x43ccc3['push'](_0x43ccc3['shift']());}}}(a40_0x380d,0xeec7e));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';function a40_0x380d(){const _0x5f15f9=['1482SZtgZt','Error:\x20Too\x20many\x20arguments.\x20Use\x20single\x20argument:','\x20\x20tdx\x20tables\x20\x22*.user*\x22\x20\x20\x20\x20\x20\x20\x20->\x20tables\x20matching\x20user*\x20across\x20databases','verbose','cause','Did\x20you\x20mean\x20to\x20list\x20all\x20tables\x20from\x20database\x20\x27','5765947KfMLZn','name','limit','\x27\x20is\x20ambiguous.','1046802OevprS','Database\x20\x27','query','\x20\x20Or:\x20\x20tdx\x20tables\x20--in\x20','\x20\x20tdx\x20tables\x20--in\x20mydb\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb','Table\x20pattern:\x20','4qtVGMH','listTables','Error:\x20Pattern\x20\x27','\x20\x20Or:\x20\x20tdx\x20tables\x20--database\x20','Error:\x20','message','✔\x20Found\x20','includes','Database\x20pattern:\x20','\x20table','993331vSYCQB','\x20\x20tdx\x20tables\x20users\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20across\x20all\x20databases','Or\x20use\x20--in\x20flag:','data','Listing\x20tables...','table','9320PPSJgn','error','\x20\x20Use:\x20tdx\x20tables\x20\x22','198rZQQjY','execute','Note:\x20\x27','\x27\x20without\x20wildcards\x20would\x20search\x20for\x20tables\x20named\x20\x27','\x20\x20tdx\x20tables\x20\x22mydb.*\x22\x20\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb','1275SRanKH','length','247048ZzzQVN','\x27\x20may\x20not\x20exist\x20or\x20contains\x20no\x20tables','.*\x22','61860dwDXtW','171516ZaHHEy','\x27\x20across\x20all\x20databases.','238OoVxQI','database','30bsaBVA','validate'];a40_0x380d=function(){return _0x5f15f9;};return a40_0x380d();}function a40_0x491a(_0x5c8a24,_0x5b302c){_0x5c8a24=_0x5c8a24-0x155;const _0x380da6=a40_0x380d();let _0x491a30=_0x380da6[_0x5c8a24];return _0x491a30;}import{parseTableReference}from'../utils/table-ref-parser.js';import{DEFAULT_LISTING_LIMIT,resolveLimit}from'../utils/constants.js';import{withSpinner}from'../utils/spinner.js';export class TablesCommand extends BaseCommand{[a40_0x350797(0x182)]='tables';['description']='List\x20tables\x20in\x20a\x20database';async[a40_0x350797(0x16b)](_0x4db11c){const _0x49e753=a40_0x350797,{options:_0x2291f4,args:_0xde8c07,tdx:_0x22e94f}=_0x4db11c;let _0x143b2f;if(_0xde8c07[_0x49e753(0x170)]===0x0)_0x143b2f={'database':undefined,'table':undefined,'original':''};else{if(_0xde8c07[_0x49e753(0x170)]===0x1)try{_0x143b2f=parseTableReference(_0xde8c07[0x0]);if(_0x143b2f['table']&&!_0x143b2f[_0x49e753(0x178)]&&!_0x143b2f[_0x49e753(0x166)]['includes']('*')&&!_0x143b2f[_0x49e753(0x166)][_0x49e753(0x15e)]('?'))return console[_0x49e753(0x168)](_0x49e753(0x159)+_0xde8c07[0x0]+_0x49e753(0x184)),console[_0x49e753(0x168)](_0x49e753(0x180)+_0x143b2f['table']+'\x27?'),console[_0x49e753(0x168)](_0x49e753(0x169)+_0x143b2f[_0x49e753(0x166)]+_0x49e753(0x173)),console[_0x49e753(0x168)](_0x49e753(0x188)+_0x143b2f['table']),console[_0x49e753(0x168)](_0x49e753(0x15a)+_0x143b2f['table']),console[_0x49e753(0x168)](''),console['error'](_0x49e753(0x16c)+_0xde8c07[0x0]+_0x49e753(0x16d)+_0x143b2f['table']+_0x49e753(0x176)),0x1;}catch(_0x1ab5b3){return console[_0x49e753(0x168)](_0x49e753(0x15b)+_0x1ab5b3[_0x49e753(0x15c)]),0x1;}else return console['error'](_0x49e753(0x17c)),console['error'](_0x49e753(0x162)),console[_0x49e753(0x168)](_0x49e753(0x16e)),console[_0x49e753(0x168)]('\x20\x20tdx\x20tables\x20\x22mydb.users\x22\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20in\x20database\x20mydb'),console['error'](_0x49e753(0x17d)),console[_0x49e753(0x168)](_0x49e753(0x163)),console[_0x49e753(0x168)](_0x49e753(0x155)),0x1;}const _0x3b3649=_0x2291f4[_0x49e753(0x178)];!_0x143b2f[_0x49e753(0x178)]&&_0x3b3649&&(_0x143b2f[_0x49e753(0x178)]=_0x3b3649);try{const _0x430c7b=_0x4e7744=>_0x4e7744&&(_0x4e7744[_0x49e753(0x15e)]('*')||_0x4e7744['includes']('?')),_0x543462=_0x430c7b(_0x143b2f[_0x49e753(0x178)]);_0x2291f4[_0x49e753(0x17e)]&&(console[_0x49e753(0x168)]('Site:\x20'+_0x2291f4['site']),_0x143b2f[_0x49e753(0x178)]?_0x543462?console[_0x49e753(0x168)](_0x49e753(0x15f)+_0x143b2f['database']):console[_0x49e753(0x168)]('Database:\x20'+_0x143b2f[_0x49e753(0x178)]):console['error']('Database:\x20all'),_0x143b2f[_0x49e753(0x166)]&&console[_0x49e753(0x168)](_0x49e753(0x156)+_0x143b2f['table']));const _0x1899ed=_0x143b2f[_0x49e753(0x178)]&&!_0x543462?_0x143b2f[_0x49e753(0x178)]:undefined,_0x52523b=_0x543462?_0x143b2f['database']:undefined,_0x4e9cfb=_0x143b2f[_0x49e753(0x166)],_0x2db5ea=resolveLimit(_0x2291f4[_0x49e753(0x183)],DEFAULT_LISTING_LIMIT),_0x3c04ed=await withSpinner(_0x49e753(0x165),()=>_0x22e94f[_0x49e753(0x187)][_0x49e753(0x158)](_0x1899ed,_0x4e9cfb,_0x52523b,_0x2db5ea),{'verbose':_0x2291f4[_0x49e753(0x17e)]}),_0x5333e7=_0x3c04ed[_0x49e753(0x164)];if(_0x5333e7['length']===0x0&&_0x143b2f[_0x49e753(0x178)]&&!_0x543462)return console['error']('✖\x20No\x20tables\x20found'),console[_0x49e753(0x168)](_0x49e753(0x186)+_0x143b2f[_0x49e753(0x178)]+_0x49e753(0x172)),0x1;return console[_0x49e753(0x168)](_0x49e753(0x15d)+_0x5333e7[_0x49e753(0x170)]+_0x49e753(0x160)+(_0x5333e7['length']!==0x1?'s':'')),await handleSDKOutput(_0x5333e7,{..._0x2291f4,'limit':_0x2db5ea}),0x0;}catch(_0x1b317f){if(_0x1b317f instanceof SDKError)return console[_0x49e753(0x168)]('Error:\x20'+_0x1b317f['message']),_0x1b317f[_0x49e753(0x17f)]&&console[_0x49e753(0x168)]('\x20\x20Cause:\x20'+_0x1b317f['cause']),0x1;throw _0x1b317f;}}[a40_0x350797(0x17a)](_0x5d2949){return undefined;}}
1
+ const a40_0x1d1092=a40_0x2c85;(function(_0x1f132e,_0x114026){const _0x33d7b7=a40_0x2c85,_0x47af63=_0x1f132e();while(!![]){try{const _0x3f6df7=-parseInt(_0x33d7b7(0xa4))/0x1+-parseInt(_0x33d7b7(0x81))/0x2*(parseInt(_0x33d7b7(0x98))/0x3)+-parseInt(_0x33d7b7(0x84))/0x4+-parseInt(_0x33d7b7(0x97))/0x5*(parseInt(_0x33d7b7(0x77))/0x6)+-parseInt(_0x33d7b7(0x96))/0x7+parseInt(_0x33d7b7(0x91))/0x8*(parseInt(_0x33d7b7(0x8b))/0x9)+parseInt(_0x33d7b7(0x83))/0xa;if(_0x3f6df7===_0x114026)break;else _0x47af63['push'](_0x47af63['shift']());}catch(_0x59ed71){_0x47af63['push'](_0x47af63['shift']());}}}(a40_0x1492,0xebc51));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';import{parseTableReference}from'../utils/table-ref-parser.js';function a40_0x1492(){const _0x561d40=['Database:\x20','\x20\x20Cause:\x20','query','data','68jcNDMJ','\x20table','55536970CuSWGR','4633324HEGqqq','Database\x20\x27','Note:\x20\x27','\x27\x20without\x20wildcards\x20would\x20search\x20for\x20tables\x20named\x20\x27','cause','name','Did\x20you\x20mean\x20to\x20list\x20all\x20tables\x20from\x20database\x20\x27','1735623azsUZI','Error:\x20','tables','Listing\x20tables...','\x20\x20tdx\x20tables\x20\x22*.user*\x22\x20\x20\x20\x20\x20\x20\x20->\x20tables\x20matching\x20user*\x20across\x20databases','\x20\x20tdx\x20tables\x20\x22mydb.users\x22\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20in\x20database\x20mydb','72JNoDyl','\x20\x20tdx\x20tables\x20\x22mydb.*\x22\x20\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb','includes','Site:\x20','\x27\x20is\x20ambiguous.','8384530YpfHUD','275LVNKOk','93483aeRzaI','Table\x20pattern:\x20','\x27\x20may\x20not\x20exist\x20or\x20contains\x20no\x20tables','Error:\x20Pattern\x20\x27','message','table','verbose','\x20\x20tdx\x20tables\x20users\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20across\x20all\x20databases','error','validate','\x20\x20Or:\x20\x20tdx\x20tables\x20--database\x20','length','1543682gWQNDW','listTables','.*\x22','148836LsrfxK','database','\x20\x20Use:\x20tdx\x20tables\x20\x22','Database\x20pattern:\x20','execute','✔\x20Found\x20'];a40_0x1492=function(){return _0x561d40;};return a40_0x1492();}import{DEFAULT_LISTING_LIMIT,resolveLimit}from'../utils/constants.js';function a40_0x2c85(_0x2893b8,_0x6f2b6e){_0x2893b8=_0x2893b8-0x75;const _0x1492bd=a40_0x1492();let _0x2c8571=_0x1492bd[_0x2893b8];return _0x2c8571;}import{withSpinner}from'../utils/spinner.js';export class TablesCommand extends BaseCommand{[a40_0x1d1092(0x89)]=a40_0x1d1092(0x8d);['description']='List\x20tables\x20in\x20a\x20database';async[a40_0x1d1092(0x7b)](_0x242f45){const _0x44fb8b=a40_0x1d1092,{options:_0x241314,args:_0x5e3992,tdx:_0x2248b3}=_0x242f45;let _0x497254;if(_0x5e3992[_0x44fb8b(0xa3)]===0x0)_0x497254={'database':undefined,'table':undefined,'original':''};else{if(_0x5e3992[_0x44fb8b(0xa3)]===0x1)try{_0x497254=parseTableReference(_0x5e3992[0x0]);if(_0x497254['table']&&!_0x497254['database']&&!_0x497254[_0x44fb8b(0x9d)][_0x44fb8b(0x93)]('*')&&!_0x497254[_0x44fb8b(0x9d)][_0x44fb8b(0x93)]('?'))return console['error'](_0x44fb8b(0x9b)+_0x5e3992[0x0]+_0x44fb8b(0x95)),console[_0x44fb8b(0xa0)](_0x44fb8b(0x8a)+_0x497254[_0x44fb8b(0x9d)]+'\x27?'),console[_0x44fb8b(0xa0)](_0x44fb8b(0x79)+_0x497254['table']+_0x44fb8b(0x76)),console[_0x44fb8b(0xa0)]('\x20\x20Or:\x20\x20tdx\x20tables\x20--in\x20'+_0x497254[_0x44fb8b(0x9d)]),console['error'](_0x44fb8b(0xa2)+_0x497254[_0x44fb8b(0x9d)]),console[_0x44fb8b(0xa0)](''),console[_0x44fb8b(0xa0)](_0x44fb8b(0x86)+_0x5e3992[0x0]+_0x44fb8b(0x87)+_0x497254[_0x44fb8b(0x9d)]+'\x27\x20across\x20all\x20databases.'),0x1;}catch(_0x1eb25e){return console[_0x44fb8b(0xa0)](_0x44fb8b(0x8c)+_0x1eb25e[_0x44fb8b(0x9c)]),0x1;}else return console[_0x44fb8b(0xa0)]('Error:\x20Too\x20many\x20arguments.\x20Use\x20single\x20argument:'),console[_0x44fb8b(0xa0)](_0x44fb8b(0x9f)),console[_0x44fb8b(0xa0)](_0x44fb8b(0x92)),console['error'](_0x44fb8b(0x90)),console[_0x44fb8b(0xa0)](_0x44fb8b(0x8f)),console[_0x44fb8b(0xa0)]('Or\x20use\x20--in\x20flag:'),console[_0x44fb8b(0xa0)]('\x20\x20tdx\x20tables\x20--in\x20mydb\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb'),0x1;}const _0xfe5c46=_0x241314[_0x44fb8b(0x78)];!_0x497254[_0x44fb8b(0x78)]&&_0xfe5c46&&(_0x497254[_0x44fb8b(0x78)]=_0xfe5c46);try{const _0x15ff89=_0x13d557=>_0x13d557&&(_0x13d557['includes']('*')||_0x13d557[_0x44fb8b(0x93)]('?')),_0x5454bc=_0x15ff89(_0x497254[_0x44fb8b(0x78)]);_0x241314['verbose']&&(console[_0x44fb8b(0xa0)](_0x44fb8b(0x94)+_0x241314['site']),_0x497254[_0x44fb8b(0x78)]?_0x5454bc?console[_0x44fb8b(0xa0)](_0x44fb8b(0x7a)+_0x497254[_0x44fb8b(0x78)]):console[_0x44fb8b(0xa0)](_0x44fb8b(0x7d)+_0x497254[_0x44fb8b(0x78)]):console[_0x44fb8b(0xa0)]('Database:\x20all'),_0x497254[_0x44fb8b(0x9d)]&&console['error'](_0x44fb8b(0x99)+_0x497254[_0x44fb8b(0x9d)]));const _0x476c6a=_0x497254[_0x44fb8b(0x78)]&&!_0x5454bc?_0x497254[_0x44fb8b(0x78)]:undefined,_0x531724=_0x5454bc?_0x497254[_0x44fb8b(0x78)]:undefined,_0x433659=_0x497254[_0x44fb8b(0x9d)],_0x27e421=resolveLimit(_0x241314['limit'],DEFAULT_LISTING_LIMIT),_0x27b6ab=await withSpinner(_0x44fb8b(0x8e),()=>_0x2248b3[_0x44fb8b(0x7f)][_0x44fb8b(0x75)](_0x476c6a,_0x433659,_0x531724,_0x27e421),{'verbose':_0x241314[_0x44fb8b(0x9e)]}),_0x1886ea=_0x27b6ab[_0x44fb8b(0x80)];if(_0x1886ea[_0x44fb8b(0xa3)]===0x0&&_0x497254['database']&&!_0x5454bc)return console[_0x44fb8b(0xa0)]('✖\x20No\x20tables\x20found'),console[_0x44fb8b(0xa0)](_0x44fb8b(0x85)+_0x497254[_0x44fb8b(0x78)]+_0x44fb8b(0x9a)),0x1;return console[_0x44fb8b(0xa0)](_0x44fb8b(0x7c)+_0x1886ea[_0x44fb8b(0xa3)]+_0x44fb8b(0x82)+(_0x1886ea['length']!==0x1?'s':'')),await handleSDKOutput(_0x1886ea,{..._0x241314,'limit':_0x27e421}),0x0;}catch(_0x2c59a8){if(_0x2c59a8 instanceof SDKError)return console[_0x44fb8b(0xa0)](_0x44fb8b(0x8c)+_0x2c59a8['message']),_0x2c59a8[_0x44fb8b(0x88)]&&console['error'](_0x44fb8b(0x7e)+_0x2c59a8['cause']),0x1;throw _0x2c59a8;}}[a40_0x1d1092(0xa1)](_0x59aeb3){return undefined;}}
@@ -1 +1 @@
1
- const a41_0x3597b7=a41_0x3ecc;(function(_0x4c7ce0,_0x426994){const _0x397451=a41_0x3ecc,_0x5dfa11=_0x4c7ce0();while(!![]){try{const _0x1f5700=-parseInt(_0x397451(0x13a))/0x1+-parseInt(_0x397451(0x145))/0x2*(parseInt(_0x397451(0x121))/0x3)+parseInt(_0x397451(0x120))/0x4+parseInt(_0x397451(0x133))/0x5+parseInt(_0x397451(0x137))/0x6+parseInt(_0x397451(0x12c))/0x7*(-parseInt(_0x397451(0x11d))/0x8)+parseInt(_0x397451(0x13c))/0x9;if(_0x1f5700===_0x426994)break;else _0x5dfa11['push'](_0x5dfa11['shift']());}catch(_0x1d33f7){_0x5dfa11['push'](_0x5dfa11['shift']());}}}(a41_0x3d16,0xdf6a9));function a41_0x3ecc(_0x570604,_0x553bf2){_0x570604=_0x570604-0x115;const _0x3d1628=a41_0x3d16();let _0x3ecc03=_0x3d1628[_0x570604];return _0x3ecc03;}import{BaseCommand}from'./command.js';import{saveSessionContext,getCurrentSessionPID,cleanExpiredSessions,clearSessionContext}from'../core/session.js';function a41_0x3d16(){const _0x50a0ca=['error','Error:\x20','3088351zJnhcq','\x0aSet\x20context:\x20tdx\x20use\x20<resource>\x20<value>','parent_segment','Resources:\x20database,\x20parent_segment,\x20llm_project,\x20profile,\x20engage_workspace','database','Set\x20session-level\x20context','debug','1537175shlOBh','cleared','validate','\x0aTip:\x20Use\x20\x27tdx\x20use\x20--clear\x27\x20to\x20clear\x20session\x20overrides','23526gqDYUb','name','.\x20Must\x20be\x20one\x20of:\x20','1656452FWjJHF','session','29903652JbAyUE','\x27\x20does\x20not\x20exist','green','display','(session:\x20','profile','toString','Session\x20context\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20use\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20current\x20context\x0a','2752476KBDmPO','log','includes','Session\x20parent_segment\x20set\x20to:\x20','\x0aUse\x20\x27tdx\x20profiles\x27\x20to\x20see\x20available\x20profiles','displayWithSources','dim','Session\x20database\x20set\x20to:\x20','engage_workspace','8ZeJVET','use','length','3020048hsykBa','3GRQQpB','Session\x20llm_project\x20set\x20to:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20use\x20--clear\x20\x20\x20\x20\x20\x20#\x20Clear\x20session\x20context\x0a','message','description','Session\x20engage_workspace\x20set\x20to:\x20','Session\x20profile\x20set\x20to:\x20','\x0aRun\x20\x27tdx\x20use\x20--help\x27\x20for\x20more\x20options','llm_project'];a41_0x3d16=function(){return _0x50a0ca;};return a41_0x3d16();}import{profileExists}from'../core/profile.js';import{GlobalContext}from'../core/global-context.js';import a41_0x12186b from'chalk';export class UseCommand extends BaseCommand{[a41_0x3597b7(0x138)]=a41_0x3597b7(0x11e);[a41_0x3597b7(0x125)]=a41_0x3597b7(0x131);[a41_0x3597b7(0x135)](_0x4d1702){const _0x417844=a41_0x3597b7,{args:_0x410b7d}=_0x4d1702;if(_0x410b7d[_0x417844(0x11f)]===0x0)return undefined;if(_0x410b7d['length']===0x1)return'Usage:\x20tdx\x20use\x20<resource>\x20<value>\x0a'+_0x417844(0x144)+_0x417844(0x123)+'\x0aResources:\x20database,\x20parent_segment,\x20llm_project,\x20profile,\x20engage_workspace\x0a'+_0x417844(0x128);const _0x58eebc=_0x410b7d[0x0],_0x3d5f67=[_0x417844(0x130),_0x417844(0x12e),_0x417844(0x129),_0x417844(0x141),_0x417844(0x11c)];if(!_0x3d5f67[_0x417844(0x116)](_0x58eebc))return'Invalid\x20resource:\x20'+_0x58eebc+_0x417844(0x139)+_0x3d5f67['join'](',\x20');return undefined;}async['execute'](_0x171dd2){const _0x9b1566=a41_0x3597b7,{args:_0x5bcef6,options:_0x123bcf}=_0x171dd2,_0x3de691=_0x123bcf[_0x9b1566(0x132)],_0x277fee=_0x123bcf['clear'];cleanExpiredSessions();try{if(_0x277fee){clearSessionContext(_0x123bcf[_0x9b1566(0x13b)]);const _0x2f0dfe=_0x123bcf[_0x9b1566(0x13b)]||getCurrentSessionPID()[_0x9b1566(0x142)]();return console[_0x9b1566(0x115)](_0x9b1566(0x143)+a41_0x12186b[_0x9b1566(0x13e)](_0x9b1566(0x134))+'\x20'+a41_0x12186b[_0x9b1566(0x11a)]('(session:\x20'+_0x2f0dfe+')')),0x0;}if(_0x5bcef6[_0x9b1566(0x11f)]===0x0){const _0x875a3=new GlobalContext(_0x123bcf);return _0x3de691?_0x875a3[_0x9b1566(0x119)]():_0x875a3[_0x9b1566(0x13f)](),console[_0x9b1566(0x115)](a41_0x12186b[_0x9b1566(0x11a)](_0x9b1566(0x12d))),console[_0x9b1566(0x115)](a41_0x12186b[_0x9b1566(0x11a)](_0x9b1566(0x12f))),0x0;}const _0x3921ff=_0x5bcef6[0x0],_0xfb39a8=_0x5bcef6[0x1];if(_0x3921ff===_0x9b1566(0x141)){if(!profileExists(_0xfb39a8))return console['error']('Error:\x20Profile\x20\x27'+_0xfb39a8+_0x9b1566(0x13d)),console[_0x9b1566(0x12a)](_0x9b1566(0x118)),0x1;const _0x31629b=_0x123bcf['session']||getCurrentSessionPID()['toString']();return saveSessionContext({'profile':_0xfb39a8},_0x123bcf[_0x9b1566(0x13b)]),console[_0x9b1566(0x115)](_0x9b1566(0x127)+a41_0x12186b[_0x9b1566(0x13e)](_0xfb39a8)+'\x20'+a41_0x12186b[_0x9b1566(0x11a)](_0x9b1566(0x140)+_0x31629b+')')),console['log'](a41_0x12186b[_0x9b1566(0x11a)](_0x9b1566(0x136))),0x0;}const _0xbec0bd={},_0x13367a=_0x123bcf[_0x9b1566(0x13b)]||getCurrentSessionPID()[_0x9b1566(0x142)]();switch(_0x3921ff){case'database':_0xbec0bd[_0x9b1566(0x130)]=_0xfb39a8,console['log'](_0x9b1566(0x11b)+a41_0x12186b[_0x9b1566(0x13e)](_0xfb39a8)+'\x20'+a41_0x12186b[_0x9b1566(0x11a)]('(session:\x20'+_0x13367a+')'));break;case _0x9b1566(0x12e):_0xbec0bd[_0x9b1566(0x12e)]=_0xfb39a8,console[_0x9b1566(0x115)](_0x9b1566(0x117)+a41_0x12186b[_0x9b1566(0x13e)](_0xfb39a8)+'\x20'+a41_0x12186b[_0x9b1566(0x11a)](_0x9b1566(0x140)+_0x13367a+')'));break;case _0x9b1566(0x129):_0xbec0bd[_0x9b1566(0x129)]=_0xfb39a8,console['log'](_0x9b1566(0x122)+a41_0x12186b[_0x9b1566(0x13e)](_0xfb39a8)+'\x20'+a41_0x12186b[_0x9b1566(0x11a)](_0x9b1566(0x140)+_0x13367a+')'));break;case'engage_workspace':_0xbec0bd[_0x9b1566(0x11c)]=_0xfb39a8,console['log'](_0x9b1566(0x126)+a41_0x12186b['green'](_0xfb39a8)+'\x20'+a41_0x12186b[_0x9b1566(0x11a)](_0x9b1566(0x140)+_0x13367a+')'));break;}return saveSessionContext(_0xbec0bd,_0x123bcf['session']),console[_0x9b1566(0x115)](a41_0x12186b[_0x9b1566(0x11a)](_0x9b1566(0x136))),0x0;}catch(_0x25ef31){return _0x25ef31 instanceof Error&&console[_0x9b1566(0x12a)](_0x9b1566(0x12b)+_0x25ef31[_0x9b1566(0x124)]),0x1;}}}
1
+ const a41_0x5b9f72=a41_0x45d8;function a41_0x45d8(_0x3856ad,_0x1a7d3a){_0x3856ad=_0x3856ad-0x138;const _0x2652da=a41_0x2652();let _0x45d8e6=_0x2652da[_0x3856ad];return _0x45d8e6;}(function(_0x5b2e86,_0x19f506){const _0xedbb17=a41_0x45d8,_0x5f4154=_0x5b2e86();while(!![]){try{const _0x16d4e2=-parseInt(_0xedbb17(0x13e))/0x1+-parseInt(_0xedbb17(0x14f))/0x2+-parseInt(_0xedbb17(0x155))/0x3+parseInt(_0xedbb17(0x14a))/0x4*(-parseInt(_0xedbb17(0x13a))/0x5)+parseInt(_0xedbb17(0x157))/0x6*(parseInt(_0xedbb17(0x166))/0x7)+-parseInt(_0xedbb17(0x161))/0x8+parseInt(_0xedbb17(0x160))/0x9*(parseInt(_0xedbb17(0x150))/0xa);if(_0x16d4e2===_0x19f506)break;else _0x5f4154['push'](_0x5f4154['shift']());}catch(_0x445c0b){_0x5f4154['push'](_0x5f4154['shift']());}}}(a41_0x2652,0x924d0));import{BaseCommand}from'./command.js';import{saveSessionContext,getCurrentSessionPID,cleanExpiredSessions,clearSessionContext}from'../core/session.js';import{profileExists}from'../core/profile.js';import{GlobalContext}from'../core/global-context.js';import a41_0x314ea9 from'chalk';function a41_0x2652(){const _0x2c99a6=['join','Resources:\x20database,\x20parent_segment,\x20llm_project,\x20profile,\x20engage_workspace','Usage:\x20tdx\x20use\x20<resource>\x20<value>\x0a','use','Set\x20session-level\x20context','\x20\x20\x20\x20\x20\x20\x20tdx\x20use\x20--clear\x20\x20\x20\x20\x20\x20#\x20Clear\x20session\x20context\x0a','701420oIFzow','dim','parent_segment','description','\x0aResources:\x20database,\x20parent_segment,\x20llm_project,\x20profile,\x20engage_workspace\x0a','271892oNgpwQ','10570wtFJIi','\x0aRun\x20\x27tdx\x20use\x20--help\x27\x20for\x20more\x20options','\x0aSet\x20context:\x20tdx\x20use\x20<resource>\x20<value>','toString','(session:\x20','1077939raSeZx','engage_workspace','126pXLLWY','displayWithSources','includes','Invalid\x20resource:\x20','profile','length','validate','Session\x20database\x20set\x20to:\x20','Error:\x20','19287hlhlyl','302288PJKMxX','session','llm_project','Session\x20profile\x20set\x20to:\x20','\x27\x20does\x20not\x20exist','21070bWETnR','log','error','15WQXMEE','green','Error:\x20Profile\x20\x27','Session\x20engage_workspace\x20set\x20to:\x20','670003OClgOa','Session\x20context\x20','database','name','clear','Session\x20llm_project\x20set\x20to:\x20'];a41_0x2652=function(){return _0x2c99a6;};return a41_0x2652();}export class UseCommand extends BaseCommand{[a41_0x5b9f72(0x141)]=a41_0x5b9f72(0x147);[a41_0x5b9f72(0x14d)]=a41_0x5b9f72(0x148);[a41_0x5b9f72(0x15d)](_0x3503fb){const _0x359530=a41_0x5b9f72,{args:_0x32847a}=_0x3503fb;if(_0x32847a[_0x359530(0x15c)]===0x0)return undefined;if(_0x32847a['length']===0x1)return _0x359530(0x146)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20use\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20current\x20context\x0a'+_0x359530(0x149)+_0x359530(0x14e)+_0x359530(0x151);const _0x1037e8=_0x32847a[0x0],_0x310cd3=[_0x359530(0x140),_0x359530(0x14c),_0x359530(0x163),_0x359530(0x15b),_0x359530(0x156)];if(!_0x310cd3[_0x359530(0x159)](_0x1037e8))return _0x359530(0x15a)+_0x1037e8+'.\x20Must\x20be\x20one\x20of:\x20'+_0x310cd3[_0x359530(0x144)](',\x20');return undefined;}async['execute'](_0x1a4d4d){const _0x4e962d=a41_0x5b9f72,{args:_0x30a886,options:_0x16a333}=_0x1a4d4d,_0x30270a=_0x16a333['debug'],_0x4c1427=_0x16a333[_0x4e962d(0x142)];cleanExpiredSessions();try{if(_0x4c1427){clearSessionContext(_0x16a333[_0x4e962d(0x162)]);const _0xb7dc0c=_0x16a333[_0x4e962d(0x162)]||getCurrentSessionPID()[_0x4e962d(0x153)]();return console[_0x4e962d(0x138)](_0x4e962d(0x13f)+a41_0x314ea9[_0x4e962d(0x13b)]('cleared')+'\x20'+a41_0x314ea9[_0x4e962d(0x14b)](_0x4e962d(0x154)+_0xb7dc0c+')')),0x0;}if(_0x30a886[_0x4e962d(0x15c)]===0x0){const _0x33763f=new GlobalContext(_0x16a333);return _0x30270a?_0x33763f[_0x4e962d(0x158)]():_0x33763f['display'](),console[_0x4e962d(0x138)](a41_0x314ea9[_0x4e962d(0x14b)](_0x4e962d(0x152))),console[_0x4e962d(0x138)](a41_0x314ea9[_0x4e962d(0x14b)](_0x4e962d(0x145))),0x0;}const _0xa88254=_0x30a886[0x0],_0x3959c2=_0x30a886[0x1];if(_0xa88254===_0x4e962d(0x15b)){if(!profileExists(_0x3959c2))return console[_0x4e962d(0x139)](_0x4e962d(0x13c)+_0x3959c2+_0x4e962d(0x165)),console['error']('\x0aUse\x20\x27tdx\x20profiles\x27\x20to\x20see\x20available\x20profiles'),0x1;const _0x2cf027=_0x16a333[_0x4e962d(0x162)]||getCurrentSessionPID()['toString']();return saveSessionContext({'profile':_0x3959c2},_0x16a333[_0x4e962d(0x162)]),console[_0x4e962d(0x138)](_0x4e962d(0x164)+a41_0x314ea9[_0x4e962d(0x13b)](_0x3959c2)+'\x20'+a41_0x314ea9['dim']('(session:\x20'+_0x2cf027+')')),console[_0x4e962d(0x138)](a41_0x314ea9[_0x4e962d(0x14b)]('\x0aTip:\x20Use\x20\x27tdx\x20use\x20--clear\x27\x20to\x20clear\x20session\x20overrides')),0x0;}const _0x19e852={},_0x4ce4fd=_0x16a333['session']||getCurrentSessionPID()[_0x4e962d(0x153)]();switch(_0xa88254){case _0x4e962d(0x140):_0x19e852[_0x4e962d(0x140)]=_0x3959c2,console['log'](_0x4e962d(0x15e)+a41_0x314ea9[_0x4e962d(0x13b)](_0x3959c2)+'\x20'+a41_0x314ea9[_0x4e962d(0x14b)](_0x4e962d(0x154)+_0x4ce4fd+')'));break;case _0x4e962d(0x14c):_0x19e852['parent_segment']=_0x3959c2,console[_0x4e962d(0x138)]('Session\x20parent_segment\x20set\x20to:\x20'+a41_0x314ea9[_0x4e962d(0x13b)](_0x3959c2)+'\x20'+a41_0x314ea9[_0x4e962d(0x14b)](_0x4e962d(0x154)+_0x4ce4fd+')'));break;case _0x4e962d(0x163):_0x19e852[_0x4e962d(0x163)]=_0x3959c2,console['log'](_0x4e962d(0x143)+a41_0x314ea9[_0x4e962d(0x13b)](_0x3959c2)+'\x20'+a41_0x314ea9[_0x4e962d(0x14b)]('(session:\x20'+_0x4ce4fd+')'));break;case _0x4e962d(0x156):_0x19e852[_0x4e962d(0x156)]=_0x3959c2,console[_0x4e962d(0x138)](_0x4e962d(0x13d)+a41_0x314ea9[_0x4e962d(0x13b)](_0x3959c2)+'\x20'+a41_0x314ea9['dim']('(session:\x20'+_0x4ce4fd+')'));break;}return saveSessionContext(_0x19e852,_0x16a333['session']),console['log'](a41_0x314ea9[_0x4e962d(0x14b)]('\x0aTip:\x20Use\x20\x27tdx\x20use\x20--clear\x27\x20to\x20clear\x20session\x20overrides')),0x0;}catch(_0x1d36fe){return _0x1d36fe instanceof Error&&console[_0x4e962d(0x139)](_0x4e962d(0x15f)+_0x1d36fe['message']),0x1;}}}
@@ -1 +1 @@
1
- const a42_0x52ef73=a42_0x119a;(function(_0xecfd95,_0x5e2606){const _0x18d0fd=a42_0x119a,_0x47bec7=_0xecfd95();while(!![]){try{const _0x34f5a6=-parseInt(_0x18d0fd(0x99))/0x1+-parseInt(_0x18d0fd(0x89))/0x2*(-parseInt(_0x18d0fd(0x8f))/0x3)+parseInt(_0x18d0fd(0xa2))/0x4*(parseInt(_0x18d0fd(0x9f))/0x5)+parseInt(_0x18d0fd(0x9c))/0x6*(-parseInt(_0x18d0fd(0x8a))/0x7)+parseInt(_0x18d0fd(0x8c))/0x8+-parseInt(_0x18d0fd(0x90))/0x9+parseInt(_0x18d0fd(0x8d))/0xa;if(_0x34f5a6===_0x5e2606)break;else _0x47bec7['push'](_0x47bec7['shift']());}catch(_0x5ccef6){_0x47bec7['push'](_0x47bec7['shift']());}}}(a42_0x5a9d,0x80bd0));function a42_0x119a(_0x119700,_0xcd57d3){_0x119700=_0x119700-0x89;const _0x5a9dd6=a42_0x5a9d();let _0x119a22=_0x5a9dd6[_0x119700];return _0x119a22;}function a42_0x5a9d(){const _0x2c43c4=['\x20\x20Cause:\x20','List\x20all\x20users\x20in\x20the\x20account','Show\x20current\x20user\x20information','Listing\x20users...','Error:\x20','data','length','user','717791ehKNgo','✔\x20Found\x20','cause','402xPOraG','error','description','40505HAvvmx','user\x20list','message','116UZuBgE','name','getCurrent','2010lCmFZK','20363SrpdKr','verbose','840880ESWtuA','14618870stXoMv','execute','1920FJGdpC','9046080HZhMAB'];a42_0x5a9d=function(){return _0x2c43c4;};return a42_0x5a9d();}import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';export class UserCommand extends BaseCommand{[a42_0x52ef73(0xa3)]=a42_0x52ef73(0x98);[a42_0x52ef73(0x9e)]=a42_0x52ef73(0x93);async[a42_0x52ef73(0x8e)](_0x397f0e){const _0x14c98=a42_0x52ef73,{options:_0x4f8b9c,tdx:_0x5187b9}=_0x397f0e;try{const _0x2caa33=await withSpinner('Fetching\x20user\x20info...',()=>_0x5187b9[_0x14c98(0x98)][_0x14c98(0xa4)](),{'verbose':_0x4f8b9c[_0x14c98(0x8b)]}),_0xdcc789=_0x2caa33[_0x14c98(0x96)];return await handleSingleObjectOutput(_0xdcc789,_0x4f8b9c),0x0;}catch(_0x8d047f){if(_0x8d047f instanceof SDKError)return console[_0x14c98(0x9d)](_0x14c98(0x95)+_0x8d047f[_0x14c98(0xa1)]),_0x8d047f[_0x14c98(0x9b)]&&console[_0x14c98(0x9d)](_0x14c98(0x91)+_0x8d047f['cause']),0x1;throw _0x8d047f;}}}export class UserListCommand extends BaseCommand{['name']=a42_0x52ef73(0xa0);[a42_0x52ef73(0x9e)]=a42_0x52ef73(0x92);async[a42_0x52ef73(0x8e)](_0x38bd1b){const _0x19dfad=a42_0x52ef73,{options:_0x2268e3,tdx:_0x17221d}=_0x38bd1b;try{const _0x18e0d5=await withSpinner(_0x19dfad(0x94),()=>_0x17221d['user']['list'](),{'verbose':_0x2268e3['verbose']}),_0x4be6db=_0x18e0d5['data'];return console[_0x19dfad(0x9d)](_0x19dfad(0x9a)+_0x4be6db[_0x19dfad(0x97)]+'\x20user'+(_0x4be6db['length']!==0x1?'s':'')),await handleSDKOutput(_0x4be6db,_0x2268e3),0x0;}catch(_0x310c03){if(_0x310c03 instanceof SDKError)return console['error'](_0x19dfad(0x95)+_0x310c03['message']),_0x310c03[_0x19dfad(0x9b)]&&console[_0x19dfad(0x9d)](_0x19dfad(0x91)+_0x310c03['cause']),0x1;throw _0x310c03;}}}
1
+ const a42_0x5a56dc=a42_0x1222;function a42_0x1222(_0x245769,_0x47c9d5){_0x245769=_0x245769-0x169;const _0x534c9e=a42_0x534c();let _0x12228b=_0x534c9e[_0x245769];return _0x12228b;}function a42_0x534c(){const _0x270b83=['946670TnXKOk','8314009QaplxF','\x20\x20Cause:\x20','user\x20list','data','6662GqvueV','length','name','List\x20all\x20users\x20in\x20the\x20account','description','15SUdqxa','message','100644JczCxJ','getCurrent','12izJvhs','list','453585VXerZg','23576xktpgs','Fetching\x20user\x20info...','21nXhenK','execute','user','1196718nyZZfe','1677tAvOkV','error','cause','Error:\x20','verbose','1962SUoegr','10dWHqtJ'];a42_0x534c=function(){return _0x270b83;};return a42_0x534c();}(function(_0x36fca1,_0x3ce136){const _0x113034=a42_0x1222,_0x5cbef2=_0x36fca1();while(!![]){try{const _0x7e215=parseInt(_0x113034(0x177))/0x1*(-parseInt(_0x113034(0x172))/0x2)+parseInt(_0x113034(0x17d))/0x3+parseInt(_0x113034(0x17b))/0x4*(parseInt(_0x113034(0x16d))/0x5)+parseInt(_0x113034(0x183))/0x6*(-parseInt(_0x113034(0x180))/0x7)+parseInt(_0x113034(0x17e))/0x8*(parseInt(_0x113034(0x16b))/0x9)+-parseInt(_0x113034(0x16c))/0xa*(-parseInt(_0x113034(0x16e))/0xb)+parseInt(_0x113034(0x179))/0xc*(-parseInt(_0x113034(0x184))/0xd);if(_0x7e215===_0x3ce136)break;else _0x5cbef2['push'](_0x5cbef2['shift']());}catch(_0x4bb1fc){_0x5cbef2['push'](_0x5cbef2['shift']());}}}(a42_0x534c,0x5e88f));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';export class UserCommand extends BaseCommand{['name']=a42_0x5a56dc(0x182);['description']='Show\x20current\x20user\x20information';async[a42_0x5a56dc(0x181)](_0x44a0d0){const _0x291ba6=a42_0x5a56dc,{options:_0x3b6e31,tdx:_0x28966e}=_0x44a0d0;try{const _0x415550=await withSpinner(_0x291ba6(0x17f),()=>_0x28966e[_0x291ba6(0x182)][_0x291ba6(0x17a)](),{'verbose':_0x3b6e31[_0x291ba6(0x16a)]}),_0x55b7b7=_0x415550[_0x291ba6(0x171)];return await handleSingleObjectOutput(_0x55b7b7,_0x3b6e31),0x0;}catch(_0x79e311){if(_0x79e311 instanceof SDKError)return console[_0x291ba6(0x185)](_0x291ba6(0x169)+_0x79e311[_0x291ba6(0x178)]),_0x79e311[_0x291ba6(0x186)]&&console['error'](_0x291ba6(0x16f)+_0x79e311[_0x291ba6(0x186)]),0x1;throw _0x79e311;}}}export class UserListCommand extends BaseCommand{[a42_0x5a56dc(0x174)]=a42_0x5a56dc(0x170);[a42_0x5a56dc(0x176)]=a42_0x5a56dc(0x175);async['execute'](_0x53971c){const _0x483634=a42_0x5a56dc,{options:_0x3ef6d4,tdx:_0x1f0172}=_0x53971c;try{const _0x27b60e=await withSpinner('Listing\x20users...',()=>_0x1f0172[_0x483634(0x182)][_0x483634(0x17c)](),{'verbose':_0x3ef6d4[_0x483634(0x16a)]}),_0x5df943=_0x27b60e[_0x483634(0x171)];return console[_0x483634(0x185)]('✔\x20Found\x20'+_0x5df943[_0x483634(0x173)]+'\x20user'+(_0x5df943['length']!==0x1?'s':'')),await handleSDKOutput(_0x5df943,_0x3ef6d4),0x0;}catch(_0x9dab0){if(_0x9dab0 instanceof SDKError)return console[_0x483634(0x185)](_0x483634(0x169)+_0x9dab0['message']),_0x9dab0['cause']&&console[_0x483634(0x185)](_0x483634(0x16f)+_0x9dab0[_0x483634(0x186)]),0x1;throw _0x9dab0;}}}
@@ -1 +1 @@
1
- const a43_0x5759ce=a43_0x54fe;(function(_0x31542d,_0x23bbe7){const _0x5c72d9=a43_0x54fe,_0x5600da=_0x31542d();while(!![]){try{const _0x4156ae=-parseInt(_0x5c72d9(0x19f))/0x1+parseInt(_0x5c72d9(0x16f))/0x2*(parseInt(_0x5c72d9(0x160))/0x3)+-parseInt(_0x5c72d9(0x17d))/0x4+-parseInt(_0x5c72d9(0x149))/0x5+-parseInt(_0x5c72d9(0x1b8))/0x6+parseInt(_0x5c72d9(0x190))/0x7+-parseInt(_0x5c72d9(0x1cc))/0x8*(-parseInt(_0x5c72d9(0x193))/0x9);if(_0x4156ae===_0x23bbe7)break;else _0x5600da['push'](_0x5600da['shift']());}catch(_0x16bcc4){_0x5600da['push'](_0x5600da['shift']());}}}(a43_0x2a3e,0x66fc1));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{confirm}from'../utils/prompt.js';import{formatBytes}from'../utils/formatters.js';import a43_0x5d36d4 from'prompts';export class WorkflowProjectsCommand extends BaseCommand{[a43_0x5759ce(0x1ce)]=a43_0x5759ce(0x1af);[a43_0x5759ce(0x1ab)]=a43_0x5759ce(0x187);async['execute'](_0x4fcdbf){const _0x49b9ac=a43_0x5759ce,{options:_0x237c22,args:_0x45a166,tdx:_0x1d745e}=_0x4fcdbf,_0x3494df=_0x45a166[0x0];try{_0x237c22[_0x49b9ac(0x1db)]&&_0x3494df&&console['error']('Pattern:\x20'+_0x3494df);const _0x30a304=await withSpinner('Listing\x20workflow\x20projects...',()=>_0x1d745e['workflow'][_0x49b9ac(0x1c8)](_0x3494df,{'limit':_0x237c22['limit']}),{'verbose':_0x237c22[_0x49b9ac(0x1db)]}),_0x1dc60c=_0x30a304[_0x49b9ac(0x1cb)];return console[_0x49b9ac(0x1a6)]('✔\x20Found\x20'+_0x1dc60c[_0x49b9ac(0x179)]+_0x49b9ac(0x175)+(_0x1dc60c[_0x49b9ac(0x179)]!==0x1?'s':'')),await handleSDKOutput(_0x1dc60c,_0x237c22),0x0;}catch(_0x1015b1){if(_0x1015b1 instanceof SDKError)return console[_0x49b9ac(0x1a6)](_0x49b9ac(0x1a9)+_0x1015b1[_0x49b9ac(0x17f)]),_0x1015b1[_0x49b9ac(0x184)]&&console[_0x49b9ac(0x1a6)](_0x49b9ac(0x168)+_0x1015b1['cause']),0x1;throw _0x1015b1;}}}export class WorkflowWorkflowsCommand extends BaseCommand{[a43_0x5759ce(0x1ce)]=a43_0x5759ce(0x19e);[a43_0x5759ce(0x1ab)]='List\x20workflows';async[a43_0x5759ce(0x14d)](_0x274e2d){const _0x4e90a1=a43_0x5759ce,{options:_0x4c1e87,args:_0x54c618,tdx:_0x4c20f5}=_0x274e2d,_0x53f30f=_0x54c618[0x0];try{_0x4c1e87[_0x4e90a1(0x1db)]&&_0x53f30f&&console['error'](_0x4e90a1(0x1be)+_0x53f30f);const _0x1baa7a=await withSpinner(_0x4e90a1(0x1c3),()=>_0x4c20f5['workflow']['workflows'](_0x53f30f,{'limit':_0x4c1e87['limit']}),{'verbose':_0x4c1e87['verbose']}),_0x3cf3f1=_0x1baa7a[_0x4e90a1(0x1cb)];return console[_0x4e90a1(0x1a6)](_0x4e90a1(0x1d2)+_0x3cf3f1[_0x4e90a1(0x179)]+_0x4e90a1(0x1a4)+(_0x3cf3f1[_0x4e90a1(0x179)]!==0x1?'s':'')),await handleSDKOutput(_0x3cf3f1,_0x4c1e87),0x0;}catch(_0x4c790a){if(_0x4c790a instanceof SDKError)return console[_0x4e90a1(0x1a6)](_0x4e90a1(0x1a9)+_0x4c790a[_0x4e90a1(0x17f)]),_0x4c790a[_0x4e90a1(0x184)]&&console['error']('\x20\x20Cause:\x20'+_0x4c790a[_0x4e90a1(0x184)]),0x1;throw _0x4c790a;}}}export class WorkflowSessionsCommand extends BaseCommand{[a43_0x5759ce(0x1ce)]='workflow:sessions';['description']='List\x20workflow\x20execution\x20sessions';async[a43_0x5759ce(0x14d)](_0x489340){const _0x328d88=a43_0x5759ce,{options:_0x33ed87,args:_0x1bbe36,tdx:_0x2f100e}=_0x489340;let _0xdedd27,_0x53ee91;if(_0x1bbe36[0x0]){const _0x1eed44=_0x1bbe36[0x0][_0x328d88(0x1b2)]('.');if(_0x1eed44[_0x328d88(0x179)]===0x1)_0xdedd27=_0x1eed44[0x0];else{if(_0x1eed44['length']===0x2)[_0xdedd27,_0x53ee91]=_0x1eed44;else return console[_0x328d88(0x1a6)](_0x328d88(0x173)),0x1;}}try{if(_0x33ed87[_0x328d88(0x1db)]){if(_0xdedd27&&_0x53ee91)console[_0x328d88(0x1a6)](_0x328d88(0x15c)+_0xdedd27+'.'+_0x53ee91);else _0xdedd27&&console['error'](_0x328d88(0x170)+_0xdedd27);const _0x4fc865=_0x33ed87['status'];_0x4fc865&&console[_0x328d88(0x1a6)]('Status:\x20'+_0x4fc865);}const _0x125bb4=await withSpinner('Listing\x20workflow\x20sessions...',()=>_0x2f100e[_0x328d88(0x178)][_0x328d88(0x150)]({'projectName':_0xdedd27,'workflowName':_0x53ee91,'status':_0x33ed87[_0x328d88(0x1c7)],'fromTime':_0x33ed87[_0x328d88(0x1ad)],'toTime':_0x33ed87['to'],'limit':_0x33ed87[_0x328d88(0x1b7)]}),{'verbose':_0x33ed87[_0x328d88(0x1db)]}),_0x4a718b=_0x125bb4[_0x328d88(0x1cb)];return console[_0x328d88(0x1a6)](_0x328d88(0x1d2)+_0x4a718b[_0x328d88(0x179)]+'\x20session'+(_0x4a718b[_0x328d88(0x179)]!==0x1?'s':'')),await handleSDKOutput(_0x4a718b,_0x33ed87),0x0;}catch(_0x5d4021){if(_0x5d4021 instanceof SDKError)return console[_0x328d88(0x1a6)]('Error:\x20'+_0x5d4021[_0x328d88(0x17f)]),_0x5d4021[_0x328d88(0x184)]&&console[_0x328d88(0x1a6)](_0x328d88(0x168)+_0x5d4021[_0x328d88(0x184)]),0x1;throw _0x5d4021;}}}export class WorkflowAttemptsCommand extends BaseCommand{['name']=a43_0x5759ce(0x164);[a43_0x5759ce(0x1ab)]=a43_0x5759ce(0x1b9);async[a43_0x5759ce(0x14d)](_0x5ec42b){const _0x2fb267=a43_0x5759ce,{options:_0x47e97e,args:_0x10ce82,tdx:_0x46ddd9}=_0x5ec42b;let _0x590969,_0x3d5d8b;if(_0x10ce82[0x0]){const _0x26b0fc=_0x10ce82[0x0][_0x2fb267(0x1b2)]('.');if(_0x26b0fc['length']===0x1)_0x590969=_0x26b0fc[0x0];else{if(_0x26b0fc[_0x2fb267(0x179)]===0x2)[_0x590969,_0x3d5d8b]=_0x26b0fc;else return console[_0x2fb267(0x1a6)](_0x2fb267(0x173)),0x1;}}try{const _0x2ce844=_0x47e97e[_0x2fb267(0x1b6)];if(_0x47e97e['verbose']){if(_0x590969&&_0x3d5d8b)console[_0x2fb267(0x1a6)]('Filter:\x20'+_0x590969+'.'+_0x3d5d8b);else _0x590969&&console[_0x2fb267(0x1a6)](_0x2fb267(0x170)+_0x590969);_0x2ce844&&console[_0x2fb267(0x1a6)](_0x2fb267(0x1d1));}const _0x25c689=await withSpinner(_0x2fb267(0x13f),()=>_0x46ddd9['workflow']['attempts']({'projectName':_0x590969,'workflowName':_0x3d5d8b,'includeRetried':_0x2ce844,'limit':_0x47e97e['limit']}),{'verbose':_0x47e97e[_0x2fb267(0x1db)]}),_0x2d8e88=_0x25c689[_0x2fb267(0x1cb)];return console[_0x2fb267(0x1a6)](_0x2fb267(0x1d2)+_0x2d8e88['length']+_0x2fb267(0x1a5)+(_0x2d8e88['length']!==0x1?'s':'')),await handleSDKOutput(_0x2d8e88,_0x47e97e),0x0;}catch(_0x1370fb){if(_0x1370fb instanceof SDKError)return console[_0x2fb267(0x1a6)]('Error:\x20'+_0x1370fb[_0x2fb267(0x17f)]),_0x1370fb[_0x2fb267(0x184)]&&console[_0x2fb267(0x1a6)]('\x20\x20Cause:\x20'+_0x1370fb[_0x2fb267(0x184)]),0x1;throw _0x1370fb;}}}export class WorkflowAttemptCommand extends BaseCommand{[a43_0x5759ce(0x1ce)]='workflow:attempt';[a43_0x5759ce(0x1ab)]=a43_0x5759ce(0x152);async[a43_0x5759ce(0x14d)](_0x342b51){const _0x46ac1b=a43_0x5759ce,{options:_0x45208e,args:_0x527af7,tdx:_0x3ba499}=_0x342b51,_0x112b04=_0x527af7[0x0];if(!_0x112b04)return console['error'](_0x46ac1b(0x1b4)),0x1;try{_0x45208e[_0x46ac1b(0x1db)]&&console[_0x46ac1b(0x1a6)](_0x46ac1b(0x153)+_0x112b04);const _0x4e37f7=await withSpinner(_0x46ac1b(0x183),()=>_0x3ba499[_0x46ac1b(0x178)][_0x46ac1b(0x1a2)](_0x112b04),{'verbose':_0x45208e[_0x46ac1b(0x1db)]}),_0xfe7828=_0x4e37f7['data'];let _0x2ac0a4;!_0xfe7828[_0x46ac1b(0x1da)]?_0x2ac0a4=_0xfe7828[_0x46ac1b(0x1d6)]?_0x46ac1b(0x158):_0x46ac1b(0x165):_0x2ac0a4=_0xfe7828[_0x46ac1b(0x16c)]?_0x46ac1b(0x16c):_0x46ac1b(0x1a6);let _0x451cf4;if(_0xfe7828[_0x46ac1b(0x1bd)]&&_0xfe7828[_0x46ac1b(0x1c2)]){const _0x56c6c2=new Date(_0xfe7828[_0x46ac1b(0x1bd)])['getTime'](),_0x310b66=new Date(_0xfe7828[_0x46ac1b(0x1c2)])[_0x46ac1b(0x1c9)]();_0x451cf4=Math[_0x46ac1b(0x1c1)]((_0x310b66-_0x56c6c2)/0x3e8);}const _0x24abc4={'attempt_id':_0xfe7828['id'],'status':_0x2ac0a4,..._0xfe7828[_0x46ac1b(0x1c0)]!==undefined&&{'index':_0xfe7828['index']},..._0xfe7828[_0x46ac1b(0x191)]&&{'project':_0xfe7828[_0x46ac1b(0x191)]['name']},..._0xfe7828[_0x46ac1b(0x178)]&&{'workflow':_0xfe7828[_0x46ac1b(0x178)]['name']},..._0xfe7828[_0x46ac1b(0x1cf)]&&{'session_id':_0xfe7828[_0x46ac1b(0x1cf)]},..._0xfe7828[_0x46ac1b(0x199)]&&{'session_time':_0xfe7828[_0x46ac1b(0x199)]},..._0xfe7828[_0x46ac1b(0x15e)]&&{'retry_attempt':_0xfe7828['retryAttemptName']},..._0x451cf4!==undefined&&{'duration_sec':_0x451cf4},..._0xfe7828[_0x46ac1b(0x1bd)]&&{'created_at':_0xfe7828[_0x46ac1b(0x1bd)]},..._0xfe7828[_0x46ac1b(0x1c2)]&&{'finished_at':_0xfe7828[_0x46ac1b(0x1c2)]},...Object[_0x46ac1b(0x1c5)](_0xfe7828['params'])[_0x46ac1b(0x179)]>0x0&&{'params':_0xfe7828[_0x46ac1b(0x1e1)]}};return await handleSingleObjectOutput(_0x24abc4,_0x45208e),0x0;}catch(_0x204156){if(_0x204156 instanceof SDKError)return console[_0x46ac1b(0x1a6)](_0x46ac1b(0x1a9)+_0x204156[_0x46ac1b(0x17f)]),_0x204156[_0x46ac1b(0x184)]&&console[_0x46ac1b(0x1a6)](_0x46ac1b(0x168)+_0x204156[_0x46ac1b(0x184)]),0x1;throw _0x204156;}}}export class WorkflowTasksCommand extends BaseCommand{[a43_0x5759ce(0x1ce)]='workflow:tasks';[a43_0x5759ce(0x1ab)]=a43_0x5759ce(0x19a);async['execute'](_0x477a20){const _0x3eae38=a43_0x5759ce,{options:_0x26d271,args:_0x4d0c6f,tdx:_0x1c10f6}=_0x477a20,_0x2f752d=_0x4d0c6f[0x0];if(!_0x2f752d)return console[_0x3eae38(0x1a6)](_0x3eae38(0x1b4)),0x1;try{const _0x225f10=_0x26d271[_0x3eae38(0x192)];_0x26d271[_0x3eae38(0x1db)]&&(console[_0x3eae38(0x1a6)](_0x3eae38(0x153)+_0x2f752d),_0x225f10&&console[_0x3eae38(0x1a6)]('Including\x20subtasks:\x20yes'));const _0x3c9d42=await withSpinner(_0x3eae38(0x17e),()=>_0x1c10f6['workflow'][_0x3eae38(0x185)](_0x2f752d,_0x225f10||![]),{'verbose':_0x26d271[_0x3eae38(0x1db)]}),_0x99f482=_0x3c9d42[_0x3eae38(0x1cb)];return console[_0x3eae38(0x1a6)](_0x3eae38(0x1d2)+_0x99f482['length']+_0x3eae38(0x1b0)+(_0x99f482[_0x3eae38(0x179)]!==0x1?'s':'')),await handleSDKOutput(_0x99f482,_0x26d271),0x0;}catch(_0x27331f){if(_0x27331f instanceof SDKError)return console[_0x3eae38(0x1a6)](_0x3eae38(0x1a9)+_0x27331f[_0x3eae38(0x17f)]),_0x27331f['cause']&&console[_0x3eae38(0x1a6)](_0x3eae38(0x168)+_0x27331f[_0x3eae38(0x184)]),0x1;throw _0x27331f;}}}export class WorkflowLogsCommand extends BaseCommand{['name']=a43_0x5759ce(0x19c);[a43_0x5759ce(0x1ab)]='Show\x20logs\x20for\x20a\x20workflow\x20attempt';async[a43_0x5759ce(0x14d)](_0x535770){const _0x62d5e6=a43_0x5759ce,{options:_0x39e7ed,args:_0x25e685,tdx:_0x3bd9b2}=_0x535770,_0x12a159=_0x25e685[0x0];let _0x3d56c4=_0x25e685[0x1];if(!_0x12a159)return console[_0x62d5e6(0x1a6)](_0x62d5e6(0x1b4)),0x1;try{_0x39e7ed[_0x62d5e6(0x1db)]&&(console[_0x62d5e6(0x1a6)](_0x62d5e6(0x153)+_0x12a159),_0x3d56c4&&console[_0x62d5e6(0x1a6)](_0x62d5e6(0x1ca)+_0x3d56c4));const _0x523831=await withSpinner(_0x62d5e6(0x144),()=>_0x3bd9b2['workflow'][_0x62d5e6(0x180)](_0x12a159,_0x3d56c4),{'verbose':_0x39e7ed[_0x62d5e6(0x1db)]}),_0xc9ccbc=_0x523831[_0x62d5e6(0x1cb)];if(_0xc9ccbc[_0x62d5e6(0x179)]===0x0)return console['error']('No\x20log\x20files\x20found\x20for\x20this\x20attempt'),0x0;if(!_0x3d56c4&&(_0x39e7ed[_0x62d5e6(0x140)]||_0x39e7ed[_0x62d5e6(0x189)]))return await handleSDKOutput(_0xc9ccbc,_0x39e7ed),0x0;if(!_0x3d56c4){const _0x488a14=_0xc9ccbc[_0x62d5e6(0x1d8)](_0x2a9b66=>({'title':_0x2a9b66[_0x62d5e6(0x15f)]+'\x20('+formatBytes(_0x2a9b66[_0x62d5e6(0x141)])+')','value':_0x2a9b66[_0x62d5e6(0x15f)]})),_0x12f68f=await a43_0x5d36d4({'type':_0x62d5e6(0x1aa),'name':_0x62d5e6(0x1cd),'message':_0x62d5e6(0x14c),'choices':_0x488a14});if(!_0x12f68f[_0x62d5e6(0x1cd)])return console['error'](_0x62d5e6(0x19b)),0x0;_0x3d56c4=_0x12f68f['task'];}const _0x6e91af=await withSpinner('Downloading\x20logs...',()=>_0x3bd9b2[_0x62d5e6(0x178)][_0x62d5e6(0x14e)](_0x12a159,_0x3d56c4),{'verbose':_0x39e7ed[_0x62d5e6(0x1db)]}),_0x83b3d3=_0x6e91af[_0x62d5e6(0x1cb)];return _0x83b3d3?console['log'](_0x83b3d3):console[_0x62d5e6(0x1a6)](_0x62d5e6(0x177)),0x0;}catch(_0x33429e){if(_0x33429e instanceof SDKError)return console['error']('Error:\x20'+_0x33429e['message']),_0x33429e['cause']&&console[_0x62d5e6(0x1a6)](_0x62d5e6(0x168)+_0x33429e['cause']),0x1;throw _0x33429e;}}}export class WorkflowKillCommand extends BaseCommand{[a43_0x5759ce(0x1ce)]=a43_0x5759ce(0x1d9);[a43_0x5759ce(0x1ab)]=a43_0x5759ce(0x1a7);async[a43_0x5759ce(0x14d)](_0x1f559a){const _0x866bcd=a43_0x5759ce,{options:_0x29eceb,args:_0x24d592,tdx:_0x4e406c}=_0x1f559a,_0x5eaac1=_0x24d592[0x0];if(!_0x5eaac1)return console['error'](_0x866bcd(0x1b4)),0x1;try{const _0x243e84=_0x29eceb['reason'];_0x29eceb[_0x866bcd(0x1db)]&&(console[_0x866bcd(0x1a6)]('Attempt\x20ID:\x20'+_0x5eaac1),_0x243e84&&console[_0x866bcd(0x1a6)](_0x866bcd(0x1d7)+_0x243e84));if(!_0x29eceb[_0x866bcd(0x17b)]){const _0xedb1f=await confirm(_0x866bcd(0x18b)+_0x5eaac1+'?');if(!_0xedb1f)return console[_0x866bcd(0x1a6)](_0x866bcd(0x19b)),0x0;}const _0x5534a3=await withSpinner(_0x866bcd(0x1df),()=>_0x4e406c[_0x866bcd(0x178)][_0x866bcd(0x154)](_0x5eaac1,_0x243e84),{'verbose':_0x29eceb['verbose']}),_0x331ee5=_0x5534a3[_0x866bcd(0x1cb)];return console['error']('✔\x20'+_0x331ee5),0x0;}catch(_0x903343){if(_0x903343 instanceof SDKError)return console[_0x866bcd(0x1a6)](_0x866bcd(0x1a9)+_0x903343[_0x866bcd(0x17f)]),_0x903343[_0x866bcd(0x184)]&&console[_0x866bcd(0x1a6)]('\x20\x20Cause:\x20'+_0x903343[_0x866bcd(0x184)]),0x1;throw _0x903343;}}}function a43_0x54fe(_0x3327e1,_0x3187e9){_0x3327e1=_0x3327e1-0x13f;const _0x2a3e56=a43_0x2a3e();let _0x54fe70=_0x2a3e56[_0x3327e1];return _0x54fe70;}export class WorkflowRetryCommand extends BaseCommand{['name']=a43_0x5759ce(0x161);[a43_0x5759ce(0x1ab)]=a43_0x5759ce(0x1a3);async[a43_0x5759ce(0x14d)](_0x1d0714){const _0x13aba4=a43_0x5759ce,{options:_0x359570,args:_0x2a76aa,tdx:_0x11a04f}=_0x1d0714,_0x5ce68e=_0x2a76aa[0x0];if(!_0x5ce68e)return console[_0x13aba4(0x1a6)](_0x13aba4(0x196)),console[_0x13aba4(0x1a6)](_0x13aba4(0x1a0)),0x1;let _0x1c3831=![],_0x2dc192=_0x5ce68e;if(_0x5ce68e[_0x13aba4(0x1e3)](_0x13aba4(0x188)))_0x1c3831=!![],_0x2dc192=_0x5ce68e[_0x13aba4(0x1a8)](0x8);else{if(_0x5ce68e[_0x13aba4(0x1e3)](_0x13aba4(0x15d)))_0x1c3831=![],_0x2dc192=_0x5ce68e[_0x13aba4(0x1a8)](0x8);else return console[_0x13aba4(0x1a6)](_0x13aba4(0x17c)),console['error'](_0x13aba4(0x1a0)),0x1;}try{const _0x1416dc=_0x359570[_0x13aba4(0x148)],_0x4d9e5a=_0x359570[_0x13aba4(0x15b)],_0x4b5d67=_0x359570[_0x13aba4(0x1e1)],_0x3a4be4=_0x359570[_0x13aba4(0x16d)];_0x359570[_0x13aba4(0x1db)]&&(console['error']('Target:\x20'+(_0x1c3831?_0x13aba4(0x18f):_0x13aba4(0x1a2))+'\x20'+_0x2dc192),_0x1416dc&&console[_0x13aba4(0x1a6)]('From\x20task:\x20'+_0x1416dc),_0x4d9e5a&&console[_0x13aba4(0x1a6)]('Resume\x20from:\x20'+_0x4d9e5a),_0x4b5d67&&console[_0x13aba4(0x1a6)](_0x13aba4(0x198)+_0x4b5d67),_0x3a4be4&&console['error'](_0x13aba4(0x16a)));let _0x4479fd;if(_0x4b5d67)try{if(_0x4b5d67[_0x13aba4(0x1e3)]('@')){const _0x2ffd4e=await import('fs/promises'),_0x43aa7f=_0x4b5d67[_0x13aba4(0x1a8)](0x1),_0x3bf86d=await _0x2ffd4e[_0x13aba4(0x147)](_0x43aa7f,_0x13aba4(0x159));_0x4479fd=JSON[_0x13aba4(0x151)](_0x3bf86d);}else _0x4479fd=JSON[_0x13aba4(0x151)](_0x4b5d67);}catch{return console[_0x13aba4(0x1a6)](_0x13aba4(0x174)),0x1;}if(!_0x359570[_0x13aba4(0x17b)]){const _0x385517=await confirm(_0x13aba4(0x1bf)+(_0x1c3831?_0x13aba4(0x18f):_0x13aba4(0x1a2))+'\x20'+_0x2dc192+'?');if(!_0x385517)return console[_0x13aba4(0x1a6)]('Cancelled'),0x0;}let _0x556ea3;_0x1c3831?_0x556ea3=await withSpinner('Retrying\x20session...',()=>_0x11a04f[_0x13aba4(0x178)][_0x13aba4(0x17a)](_0x2dc192,{'fromTask':_0x1416dc,'retryParams':_0x4479fd}),{'verbose':_0x359570['verbose']}):_0x556ea3=await withSpinner('Retrying\x20attempt...',()=>_0x11a04f[_0x13aba4(0x178)][_0x13aba4(0x1ba)](_0x2dc192,{'resumeFrom':_0x4d9e5a,'retryParams':_0x4479fd,'force':_0x3a4be4}),{'verbose':_0x359570[_0x13aba4(0x1db)]});const _0x4136c9=_0x556ea3[_0x13aba4(0x1cb)];return console['error'](_0x13aba4(0x1ae)),console[_0x13aba4(0x1a6)](_0x13aba4(0x162)+_0x4136c9[_0x13aba4(0x1bc)]),console[_0x13aba4(0x1a6)](_0x13aba4(0x1c6)+_0x4136c9[_0x13aba4(0x1cf)]),0x0;}catch(_0x52f6a0){if(_0x52f6a0 instanceof SDKError)return console['error'](_0x13aba4(0x1a9)+_0x52f6a0[_0x13aba4(0x17f)]),_0x52f6a0[_0x13aba4(0x184)]&&console[_0x13aba4(0x1a6)](_0x13aba4(0x168)+_0x52f6a0[_0x13aba4(0x184)]),0x1;throw _0x52f6a0;}}}function a43_0x2a3e(){const _0x36a9f3=['No\x20log\x20content\x20found','workflow','length','retrySession','yes','Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22','3234064BuHIiy','Getting\x20attempt\x20tasks...','message','logFiles','Error:\x20Invalid\x20parameter\x20format:\x20','\x20\x20Revision:\x20','Getting\x20attempt\x20details...','cause','tasks','✔\x20Downloaded\x20','List\x20all\x20workflow\x20projects','session:','format','param','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20','workflow:push','\x20\x20Workflow:\x20','projectName','session','4204382YiYrAQ','project','includeSubtasks','9TOtZWk','Workflow:\x20','run','Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required','✔\x20Pushed\x20','Params:\x20','sessionTime','Show\x20tasks\x20for\x20an\x20attempt','Cancelled','workflow:logs','Revision:\x20','workflow:workflows','613258WHMOny','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','\x20\x20Location:\x20','attempt','Retry\x20a\x20session\x20or\x20attempt','\x20workflow','\x20attempt','error','Kill\x20a\x20running\x20attempt','substring','Error:\x20','select','description','Start\x20a\x20workflow\x20run','from','✔\x20Retry\x20started','workflow:projects','\x20task','projectId','split','\x22?\x20This\x20cannot\x20be\x20undone.','Error:\x20Attempt\x20ID\x20is\x20required','workflow:run','includeRetried','limit','4359420QrrSDm','List\x20workflow\x20attempts','retryAttempt','\x20\x20Project\x20ID:\x20','attemptId','createdAt','Project\x20filter:\x20','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','index','round','finishedAt','Listing\x20workflows...','Usage:\x20workflow:download\x20<project-name>\x20[output-dir]','keys','\x20\x20Session\x20ID:\x20','status','projects','getTime','Task\x20name:\x20','data','14586344kMWliM','task','name','sessionId','download','Include\x20retried:\x20yes','✔\x20Found\x20','stat','\x20\x20Files\x20extracted:\x20','filesExtracted','cancelRequested','Reason:\x20','map','workflow:kill','done','verbose','Parameters:\x20','revision','\x20\x20Project:\x20','Killing\x20attempt...','isDirectory','params','Output\x20directory:\x20','startsWith','Listing\x20workflow\x20attempts...','json','fileSize','Downloading\x20project\x20','\x20is\x20not\x20a\x20directory','Fetching\x20log\x20files...','indexOf','workflow:delete','readFile','fromTask','2316855GFObgp','Deleting\x20project\x20','Project\x20directory:\x20','Select\x20a\x20task\x20to\x20view\x20logs:','execute','logs','Error:\x20Workflow\x20identifier\x20is\x20required','sessions','parse','Show\x20specific\x20attempt\x20details','Attempt\x20ID:\x20','kill','Validation:\x20skipped','✔\x20Workflow\x20run\x20started','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22','canceling','utf-8','workflow:download','resumeFrom','Filter:\x20','attempt:','retryAttemptName','taskName','1828863EIouVl','workflow:retry','\x20\x20New\x20attempt\x20ID:\x20','Expected\x20format:\x20--param\x20key=value','workflow:attempts','running','...','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required','\x20\x20Cause:\x20','delete','Force:\x20yes','Usage:\x20workflow\x20run\x20<project.workflow>\x20[options]','success','force','skipValidation','2eBmSHm','Filter:\x20project=','✔\x20Deleted\x20project\x20','Session\x20time:\x20','Error:\x20Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','Error:\x20Invalid\x20JSON\x20in\x20--params','\x20project','Error:\x20Project\x20name\x20is\x20required'];a43_0x2a3e=function(){return _0x36a9f3;};return a43_0x2a3e();}export class WorkflowRunCommand extends BaseCommand{['name']=a43_0x5759ce(0x1b5);[a43_0x5759ce(0x1ab)]=a43_0x5759ce(0x1ac);async[a43_0x5759ce(0x14d)](_0x5e468c){const _0x492439=a43_0x5759ce,{options:_0x4e78f0,args:_0x3fb2f4,tdx:_0x3cd2c4}=_0x5e468c,_0x3ffe86=_0x3fb2f4[0x0];if(!_0x3ffe86)return console[_0x492439(0x1a6)](_0x492439(0x14f)),console[_0x492439(0x1a6)](_0x492439(0x16b)),0x1;const _0x17aaea=_0x4e78f0[_0x492439(0x18a)],_0x33d165=_0x4e78f0[_0x492439(0x199)],_0x3206d8={};if(_0x17aaea&&Array['isArray'](_0x17aaea))for(const _0x4a35c7 of _0x17aaea){const _0x276231=_0x4a35c7[_0x492439(0x145)]('=');if(_0x276231===-0x1)return console[_0x492439(0x1a6)](_0x492439(0x181)+_0x4a35c7),console[_0x492439(0x1a6)](_0x492439(0x163)),0x1;const _0x157d22=_0x4a35c7['substring'](0x0,_0x276231),_0x326b30=_0x4a35c7['substring'](_0x276231+0x1);try{_0x3206d8[_0x157d22]=JSON[_0x492439(0x151)](_0x326b30);}catch{_0x3206d8[_0x157d22]=_0x326b30;}}_0x4e78f0['verbose']&&(console[_0x492439(0x1a6)](_0x492439(0x194)+_0x3ffe86),Object[_0x492439(0x1c5)](_0x3206d8)[_0x492439(0x179)]>0x0&&console[_0x492439(0x1a6)](_0x492439(0x1dc)+JSON['stringify'](_0x3206d8)),_0x33d165&&console['error'](_0x492439(0x172)+_0x33d165));const _0x5afb00=await withSpinner('Starting\x20workflow\x20run...',()=>_0x3cd2c4[_0x492439(0x178)][_0x492439(0x195)](_0x3ffe86,_0x3206d8,{'sessionTime':_0x33d165}),{'verbose':_0x4e78f0[_0x492439(0x1db)]}),_0x1e5e25=_0x5afb00[_0x492439(0x1cb)];return console['error'](_0x492439(0x156)),console[_0x492439(0x1a6)]('\x20\x20Attempt\x20ID:\x20'+_0x1e5e25['id']),console[_0x492439(0x1a6)](_0x492439(0x1c6)+_0x1e5e25[_0x492439(0x1cf)]),console[_0x492439(0x1a6)](_0x492439(0x1de)+_0x1e5e25['project']?.[_0x492439(0x1ce)]),console[_0x492439(0x1a6)](_0x492439(0x18d)+_0x1e5e25['workflow']?.[_0x492439(0x1ce)]),0x0;}}export class WorkflowDownloadCommand extends BaseCommand{['name']=a43_0x5759ce(0x15a);[a43_0x5759ce(0x1ab)]='Download\x20workflow\x20project\x20from\x20Treasure\x20Data';async[a43_0x5759ce(0x14d)](_0x304240){const _0x282188=a43_0x5759ce,{options:_0x341349,args:_0x5bdf6d,tdx:_0x5411aa}=_0x304240,_0x159a24=_0x5bdf6d[0x0],_0xf0606d=_0x5bdf6d[0x1]||'.';if(!_0x159a24)return console[_0x282188(0x1a6)](_0x282188(0x176)),console[_0x282188(0x1a6)](_0x282188(0x1c4)),0x1;const _0x1f877c=_0x341349[_0x282188(0x1dd)];_0x341349[_0x282188(0x1db)]&&(console[_0x282188(0x1a6)]('Project:\x20'+_0x159a24),console[_0x282188(0x1a6)](_0x282188(0x1e2)+_0xf0606d),_0x1f877c&&console[_0x282188(0x1a6)](_0x282188(0x19d)+_0x1f877c));const _0x59e7da=await withSpinner(_0x282188(0x142)+_0x159a24+_0x282188(0x166),()=>_0x5411aa[_0x282188(0x178)][_0x282188(0x1d0)](_0x159a24,_0xf0606d,{'revision':_0x1f877c}),{'verbose':_0x341349[_0x282188(0x1db)]}),_0x4debd5=_0x59e7da[_0x282188(0x1cb)];return console[_0x282188(0x1a6)](_0x282188(0x186)+_0x4debd5[_0x282188(0x18e)]),console[_0x282188(0x1a6)]('\x20\x20Revision:\x20'+_0x4debd5[_0x282188(0x1dd)]),console[_0x282188(0x1a6)](_0x282188(0x1d4)+_0x4debd5[_0x282188(0x1d5)]),console['error'](_0x282188(0x1a1)+_0xf0606d+'/'+_0x4debd5[_0x282188(0x18e)]),0x0;}}export class WorkflowPushCommand extends BaseCommand{[a43_0x5759ce(0x1ce)]=a43_0x5759ce(0x18c);[a43_0x5759ce(0x1ab)]='Push\x20workflow\x20project\x20to\x20Treasure\x20Data';async[a43_0x5759ce(0x14d)](_0x488b7e){const _0x352a0d=a43_0x5759ce,{options:_0x1ce9df,args:_0x1e4888,tdx:_0x546ef5}=_0x488b7e;let _0x2ae18d='.',_0x2e9ac7=_0x1ce9df[_0x352a0d(0x1ce)];if(_0x1e4888[0x0]){const {promises:_0x29aa8c}=await import('fs');try{const _0x2fd756=await _0x29aa8c[_0x352a0d(0x1d3)](_0x1e4888[0x0]);if(_0x2fd756[_0x352a0d(0x1e0)]())_0x2ae18d=_0x1e4888[0x0];else return console[_0x352a0d(0x1a6)](_0x352a0d(0x1a9)+_0x1e4888[0x0]+_0x352a0d(0x143)),0x1;}catch{_0x2e9ac7=_0x1e4888[0x0],_0x2ae18d='.';}}const _0x2b8f45=_0x1ce9df[_0x352a0d(0x1dd)],_0x3413ab=_0x1ce9df[_0x352a0d(0x16e)];_0x1ce9df[_0x352a0d(0x1db)]&&(console[_0x352a0d(0x1a6)](_0x352a0d(0x14b)+_0x2ae18d),_0x2e9ac7&&console['error']('Project\x20name:\x20'+_0x2e9ac7),_0x2b8f45&&console[_0x352a0d(0x1a6)](_0x352a0d(0x19d)+_0x2b8f45),_0x3413ab&&console['error'](_0x352a0d(0x155)));const _0x2189a7=await withSpinner('Pushing\x20workflow\x20project...',()=>_0x546ef5[_0x352a0d(0x178)]['push'](_0x2ae18d,{'projectName':_0x2e9ac7,'revision':_0x2b8f45,'skipValidation':_0x3413ab}),{'verbose':_0x1ce9df[_0x352a0d(0x1db)]}),_0x2d1503=_0x2189a7[_0x352a0d(0x1cb)];return console[_0x352a0d(0x1a6)](_0x352a0d(0x197)+_0x2d1503[_0x352a0d(0x18e)]),console[_0x352a0d(0x1a6)](_0x352a0d(0x1bb)+_0x2d1503[_0x352a0d(0x1b1)]),console[_0x352a0d(0x1a6)](_0x352a0d(0x182)+_0x2d1503['revision']),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{[a43_0x5759ce(0x1ce)]=a43_0x5759ce(0x146);[a43_0x5759ce(0x1ab)]='Delete\x20workflow\x20project\x20from\x20Treasure\x20Data';async[a43_0x5759ce(0x14d)](_0x2894bf){const _0x16ab89=a43_0x5759ce,{options:_0x477eba,args:_0x5586f1,tdx:_0x540838}=_0x2894bf,_0x5882c0=_0x5586f1[0x0];if(!_0x5882c0)return console[_0x16ab89(0x1a6)](_0x16ab89(0x167)),console['error']('Usage:\x20workflow:delete\x20<project-name-or-id>'),0x1;_0x477eba[_0x16ab89(0x1db)]&&console[_0x16ab89(0x1a6)]('Project:\x20'+_0x5882c0);if(!_0x477eba[_0x16ab89(0x17b)]){const _0x58f57c=await confirm(_0x16ab89(0x157)+_0x5882c0+_0x16ab89(0x1b3));if(!_0x58f57c)return console[_0x16ab89(0x1a6)](_0x16ab89(0x19b)),0x0;}const _0x15692d=await withSpinner(_0x16ab89(0x14a)+_0x5882c0+_0x16ab89(0x166),()=>_0x540838[_0x16ab89(0x178)][_0x16ab89(0x169)](_0x5882c0),{'verbose':_0x477eba[_0x16ab89(0x1db)]}),_0x238642=_0x15692d[_0x16ab89(0x1cb)];return console[_0x16ab89(0x1a6)](_0x16ab89(0x171)+_0x238642[_0x16ab89(0x18e)]),console[_0x16ab89(0x1a6)](_0x16ab89(0x1bb)+_0x238642[_0x16ab89(0x1b1)]),0x0;}}
1
+ const a43_0xdb3bee=a43_0x4f89;(function(_0x5cfff0,_0xfb5da5){const _0x3d8357=a43_0x4f89,_0x461c6f=_0x5cfff0();while(!![]){try{const _0x28f5a3=parseInt(_0x3d8357(0xd8))/0x1*(parseInt(_0x3d8357(0x12a))/0x2)+-parseInt(_0x3d8357(0x136))/0x3+-parseInt(_0x3d8357(0xcf))/0x4+-parseInt(_0x3d8357(0x13c))/0x5*(parseInt(_0x3d8357(0xc0))/0x6)+parseInt(_0x3d8357(0x128))/0x7*(parseInt(_0x3d8357(0x124))/0x8)+-parseInt(_0x3d8357(0x138))/0x9+-parseInt(_0x3d8357(0x12b))/0xa*(-parseInt(_0x3d8357(0xbd))/0xb);if(_0x28f5a3===_0xfb5da5)break;else _0x461c6f['push'](_0x461c6f['shift']());}catch(_0x4635d0){_0x461c6f['push'](_0x461c6f['shift']());}}}(a43_0x2ca6,0x87e07));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';function a43_0x2ca6(){const _0x47c2a0=['Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','Show\x20logs\x20for\x20a\x20workflow\x20attempt','607704AflsUH','Pushing\x20workflow\x20project...','\x20workflow','includeSubtasks','error','No\x20log\x20content\x20found','startsWith','\x20\x20Revision:\x20','success','5poeQor','Filter:\x20','tasks','Target:\x20','indexOf','workflow:logs','attempt','stringify','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','Force:\x20yes','attempt:','param','workflow:workflows','Session\x20time:\x20','Deleting\x20project\x20','verbose','retrySession','skipValidation','Project\x20name:\x20','Error:\x20Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','log','createdAt','format','Listing\x20workflow\x20sessions...','Error:\x20Invalid\x20JSON\x20in\x20--params','stat','Attempt\x20ID:\x20','message','project','retryAttemptName','Resume\x20from:\x20','workflow:delete','Revision:\x20','canceling','kill','projectName','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22','session:','\x20\x20Cause:\x20','fileSize','List\x20workflow\x20attempts','data','workflow:kill','Parameters:\x20','Listing\x20workflow\x20projects...','workflow:projects','isDirectory','projectId','Cancelled','✔\x20Found\x20','projects','Show\x20tasks\x20for\x20an\x20attempt','substring','select','\x22?\x20This\x20cannot\x20be\x20undone.','running','\x20\x20Project:\x20','Pattern:\x20','Including\x20subtasks:\x20yes','workflow:attempt','limit','cause','length','Error:\x20Attempt\x20ID\x20is\x20required','List\x20all\x20workflow\x20projects','\x20session','\x20\x20Files\x20extracted:\x20','✔\x20Deleted\x20project\x20','taskName','No\x20log\x20files\x20found\x20for\x20this\x20attempt','Starting\x20workflow\x20run...','execute','✔\x20Workflow\x20run\x20started','workflow:retry','resumeFrom','Downloading\x20project\x20','72dFaWwE','\x20\x20Project\x20ID:\x20','attemptId','run','85155iROlHe','Filter:\x20project=','95474ZwrrtM','26121300frseZB','round','Project\x20filter:\x20','Getting\x20attempt\x20tasks...','workflow:download','Error:\x20Workflow\x20identifier\x20is\x20required','reason','workflow','parse','getTime','isArray','2168010AHOnUU','workflow:tasks','9103149TDsoXf','Reason:\x20','\x20\x20New\x20attempt\x20ID:\x20','Error:\x20','20SVHCfc','Fetching\x20log\x20files...','✔\x20Pushed\x20','Project:\x20','sessionId','session','...','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required','json','Listing\x20workflows...','Params:\x20','Usage:\x20workflow\x20run\x20<project.workflow>\x20[options]','download','Killing\x20attempt...','sessionTime','Listing\x20workflow\x20attempts...','\x20project','Push\x20workflow\x20project\x20to\x20Treasure\x20Data','Include\x20retried:\x20yes','List\x20workflows','Status:\x20','Select\x20a\x20task\x20to\x20view\x20logs:','Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20','\x20\x20Session\x20ID:\x20','yes','task','finishedAt','List\x20workflow\x20execution\x20sessions','Start\x20a\x20workflow\x20run','Workflow:\x20','\x20\x20Location:\x20','done','\x20is\x20not\x20a\x20directory','✔\x20Downloaded\x20','delete','Error:\x20Invalid\x20parameter\x20format:\x20','keys','params','index','\x20\x20Workflow:\x20','Expected\x20format:\x20--param\x20key=value','✔\x20Retry\x20started','workflow:push','11fzydAE','Error:\x20Project\x20name\x20is\x20required','cancelRequested','776538sRxJis','Project\x20directory:\x20','Show\x20specific\x20attempt\x20details','revision','Output\x20directory:\x20','description','From\x20task:\x20','name','workflows','Getting\x20attempt\x20details...','push','status','split'];a43_0x2ca6=function(){return _0x47c2a0;};return a43_0x2ca6();}import{handleSDKOutput,handleSingleObjectOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{confirm}from'../utils/prompt.js';import{formatBytes}from'../utils/formatters.js';import a43_0x9087d from'prompts';export class WorkflowProjectsCommand extends BaseCommand{[a43_0xdb3bee(0xc7)]=a43_0xdb3bee(0x105);[a43_0xdb3bee(0xc5)]=a43_0xdb3bee(0x118);async[a43_0xdb3bee(0x11f)](_0x5386eb){const _0x83db86=a43_0xdb3bee,{options:_0x106953,args:_0x2d4524,tdx:_0x4faee8}=_0x5386eb,_0x5e3a84=_0x2d4524[0x0];try{_0x106953[_0x83db86(0xe7)]&&_0x5e3a84&&console[_0x83db86(0xd3)](_0x83db86(0x111)+_0x5e3a84);const _0x3081a1=await withSpinner(_0x83db86(0x104),()=>_0x4faee8['workflow'][_0x83db86(0x10a)](_0x5e3a84,{'limit':_0x106953[_0x83db86(0x114)]}),{'verbose':_0x106953[_0x83db86(0xe7)]}),_0x1bc9dd=_0x3081a1['data'];return console[_0x83db86(0xd3)](_0x83db86(0x109)+_0x1bc9dd[_0x83db86(0x116)]+_0x83db86(0xa1)+(_0x1bc9dd['length']!==0x1?'s':'')),await handleSDKOutput(_0x1bc9dd,_0x106953),0x0;}catch(_0x377117){if(_0x377117 instanceof SDKError)return console[_0x83db86(0xd3)]('Error:\x20'+_0x377117[_0x83db86(0xf3)]),_0x377117[_0x83db86(0x115)]&&console[_0x83db86(0xd3)](_0x83db86(0xfe)+_0x377117[_0x83db86(0x115)]),0x1;throw _0x377117;}}}export class WorkflowWorkflowsCommand extends BaseCommand{[a43_0xdb3bee(0xc7)]=a43_0xdb3bee(0xe4);[a43_0xdb3bee(0xc5)]=a43_0xdb3bee(0xa4);async[a43_0xdb3bee(0x11f)](_0x2bbf5b){const _0x238860=a43_0xdb3bee,{options:_0x1fb142,args:_0x1ee934,tdx:_0x59c391}=_0x2bbf5b,_0x4b4608=_0x1ee934[0x0];try{_0x1fb142[_0x238860(0xe7)]&&_0x4b4608&&console[_0x238860(0xd3)](_0x238860(0x12d)+_0x4b4608);const _0x2d2c50=await withSpinner(_0x238860(0x9a),()=>_0x59c391[_0x238860(0x132)][_0x238860(0xc8)](_0x4b4608,{'limit':_0x1fb142[_0x238860(0x114)]}),{'verbose':_0x1fb142[_0x238860(0xe7)]}),_0x57d3a2=_0x2d2c50[_0x238860(0x101)];return console[_0x238860(0xd3)](_0x238860(0x109)+_0x57d3a2['length']+_0x238860(0xd1)+(_0x57d3a2[_0x238860(0x116)]!==0x1?'s':'')),await handleSDKOutput(_0x57d3a2,_0x1fb142),0x0;}catch(_0x3b7ed4){if(_0x3b7ed4 instanceof SDKError)return console[_0x238860(0xd3)]('Error:\x20'+_0x3b7ed4[_0x238860(0xf3)]),_0x3b7ed4[_0x238860(0x115)]&&console[_0x238860(0xd3)](_0x238860(0xfe)+_0x3b7ed4[_0x238860(0x115)]),0x1;throw _0x3b7ed4;}}}export class WorkflowSessionsCommand extends BaseCommand{['name']='workflow:sessions';[a43_0xdb3bee(0xc5)]=a43_0xdb3bee(0xad);async[a43_0xdb3bee(0x11f)](_0x9c7f49){const _0xb14e60=a43_0xdb3bee,{options:_0x1ac2f7,args:_0x7fb136,tdx:_0x279aff}=_0x9c7f49;let _0x2d1f7f,_0x2e2254;if(_0x7fb136[0x0]){const _0x1484e0=_0x7fb136[0x0][_0xb14e60(0xcc)]('.');if(_0x1484e0[_0xb14e60(0x116)]===0x1)_0x2d1f7f=_0x1484e0[0x0];else{if(_0x1484e0[_0xb14e60(0x116)]===0x2)[_0x2d1f7f,_0x2e2254]=_0x1484e0;else return console['error'](_0xb14e60(0xeb)),0x1;}}try{if(_0x1ac2f7[_0xb14e60(0xe7)]){if(_0x2d1f7f&&_0x2e2254)console['error']('Filter:\x20'+_0x2d1f7f+'.'+_0x2e2254);else _0x2d1f7f&&console[_0xb14e60(0xd3)](_0xb14e60(0x129)+_0x2d1f7f);const _0xc19c4c=_0x1ac2f7[_0xb14e60(0xcb)];_0xc19c4c&&console[_0xb14e60(0xd3)](_0xb14e60(0xa5)+_0xc19c4c);}const _0x18b2e5=await withSpinner(_0xb14e60(0xef),()=>_0x279aff[_0xb14e60(0x132)]['sessions']({'projectName':_0x2d1f7f,'workflowName':_0x2e2254,'status':_0x1ac2f7['status'],'fromTime':_0x1ac2f7['from'],'toTime':_0x1ac2f7['to'],'limit':_0x1ac2f7[_0xb14e60(0x114)]}),{'verbose':_0x1ac2f7[_0xb14e60(0xe7)]}),_0x5b592f=_0x18b2e5[_0xb14e60(0x101)];return console[_0xb14e60(0xd3)]('✔\x20Found\x20'+_0x5b592f['length']+_0xb14e60(0x119)+(_0x5b592f[_0xb14e60(0x116)]!==0x1?'s':'')),await handleSDKOutput(_0x5b592f,_0x1ac2f7),0x0;}catch(_0x85c1df){if(_0x85c1df instanceof SDKError)return console[_0xb14e60(0xd3)]('Error:\x20'+_0x85c1df[_0xb14e60(0xf3)]),_0x85c1df['cause']&&console[_0xb14e60(0xd3)](_0xb14e60(0xfe)+_0x85c1df[_0xb14e60(0x115)]),0x1;throw _0x85c1df;}}}export class WorkflowAttemptsCommand extends BaseCommand{['name']='workflow:attempts';['description']=a43_0xdb3bee(0x100);async['execute'](_0x346f28){const _0x33da45=a43_0xdb3bee,{options:_0x315cef,args:_0x45c97c,tdx:_0x4f17c7}=_0x346f28;let _0x2e12cc,_0x126c27;if(_0x45c97c[0x0]){const _0x4d4368=_0x45c97c[0x0][_0x33da45(0xcc)]('.');if(_0x4d4368[_0x33da45(0x116)]===0x1)_0x2e12cc=_0x4d4368[0x0];else{if(_0x4d4368[_0x33da45(0x116)]===0x2)[_0x2e12cc,_0x126c27]=_0x4d4368;else return console['error'](_0x33da45(0xeb)),0x1;}}try{const _0x492f49=_0x315cef['includeRetried'];if(_0x315cef['verbose']){if(_0x2e12cc&&_0x126c27)console['error'](_0x33da45(0xd9)+_0x2e12cc+'.'+_0x126c27);else _0x2e12cc&&console[_0x33da45(0xd3)]('Filter:\x20project='+_0x2e12cc);_0x492f49&&console[_0x33da45(0xd3)](_0x33da45(0xa3));}const _0x37c480=await withSpinner(_0x33da45(0xa0),()=>_0x4f17c7[_0x33da45(0x132)]['attempts']({'projectName':_0x2e12cc,'workflowName':_0x126c27,'includeRetried':_0x492f49,'limit':_0x315cef[_0x33da45(0x114)]}),{'verbose':_0x315cef['verbose']}),_0x2dca1e=_0x37c480[_0x33da45(0x101)];return console[_0x33da45(0xd3)](_0x33da45(0x109)+_0x2dca1e[_0x33da45(0x116)]+'\x20attempt'+(_0x2dca1e[_0x33da45(0x116)]!==0x1?'s':'')),await handleSDKOutput(_0x2dca1e,_0x315cef),0x0;}catch(_0x55d2a7){if(_0x55d2a7 instanceof SDKError)return console['error'](_0x33da45(0x13b)+_0x55d2a7[_0x33da45(0xf3)]),_0x55d2a7[_0x33da45(0x115)]&&console[_0x33da45(0xd3)](_0x33da45(0xfe)+_0x55d2a7[_0x33da45(0x115)]),0x1;throw _0x55d2a7;}}}export class WorkflowAttemptCommand extends BaseCommand{[a43_0xdb3bee(0xc7)]=a43_0xdb3bee(0x113);[a43_0xdb3bee(0xc5)]=a43_0xdb3bee(0xc2);async[a43_0xdb3bee(0x11f)](_0x2960d5){const _0x421b2e=a43_0xdb3bee,{options:_0x19afce,args:_0x352471,tdx:_0x59a7fe}=_0x2960d5,_0x594796=_0x352471[0x0];if(!_0x594796)return console[_0x421b2e(0xd3)](_0x421b2e(0x117)),0x1;try{_0x19afce[_0x421b2e(0xe7)]&&console[_0x421b2e(0xd3)](_0x421b2e(0xf2)+_0x594796);const _0xfc2917=await withSpinner(_0x421b2e(0xc9),()=>_0x59a7fe[_0x421b2e(0x132)][_0x421b2e(0xde)](_0x594796),{'verbose':_0x19afce[_0x421b2e(0xe7)]}),_0x3eaea9=_0xfc2917[_0x421b2e(0x101)];let _0x5570eb;!_0x3eaea9[_0x421b2e(0xb1)]?_0x5570eb=_0x3eaea9[_0x421b2e(0xbf)]?_0x421b2e(0xf9):_0x421b2e(0x10f):_0x5570eb=_0x3eaea9[_0x421b2e(0xd7)]?_0x421b2e(0xd7):_0x421b2e(0xd3);let _0x1912ad;if(_0x3eaea9[_0x421b2e(0xed)]&&_0x3eaea9[_0x421b2e(0xac)]){const _0x2f7a1b=new Date(_0x3eaea9['createdAt'])[_0x421b2e(0x134)](),_0x2774d2=new Date(_0x3eaea9[_0x421b2e(0xac)])['getTime']();_0x1912ad=Math[_0x421b2e(0x12c)]((_0x2774d2-_0x2f7a1b)/0x3e8);}const _0x53e38d={'attempt_id':_0x3eaea9['id'],'status':_0x5570eb,..._0x3eaea9[_0x421b2e(0xb8)]!==undefined&&{'index':_0x3eaea9[_0x421b2e(0xb8)]},..._0x3eaea9['project']&&{'project':_0x3eaea9[_0x421b2e(0xf4)][_0x421b2e(0xc7)]},..._0x3eaea9[_0x421b2e(0x132)]&&{'workflow':_0x3eaea9[_0x421b2e(0x132)][_0x421b2e(0xc7)]},..._0x3eaea9['sessionId']&&{'session_id':_0x3eaea9[_0x421b2e(0x140)]},..._0x3eaea9['sessionTime']&&{'session_time':_0x3eaea9[_0x421b2e(0x9f)]},..._0x3eaea9['retryAttemptName']&&{'retry_attempt':_0x3eaea9[_0x421b2e(0xf5)]},..._0x1912ad!==undefined&&{'duration_sec':_0x1912ad},..._0x3eaea9[_0x421b2e(0xed)]&&{'created_at':_0x3eaea9[_0x421b2e(0xed)]},..._0x3eaea9['finishedAt']&&{'finished_at':_0x3eaea9[_0x421b2e(0xac)]},...Object[_0x421b2e(0xb6)](_0x3eaea9[_0x421b2e(0xb7)])[_0x421b2e(0x116)]>0x0&&{'params':_0x3eaea9[_0x421b2e(0xb7)]}};return await handleSingleObjectOutput(_0x53e38d,_0x19afce),0x0;}catch(_0xcec737){if(_0xcec737 instanceof SDKError)return console[_0x421b2e(0xd3)](_0x421b2e(0x13b)+_0xcec737[_0x421b2e(0xf3)]),_0xcec737[_0x421b2e(0x115)]&&console['error'](_0x421b2e(0xfe)+_0xcec737['cause']),0x1;throw _0xcec737;}}}export class WorkflowTasksCommand extends BaseCommand{[a43_0xdb3bee(0xc7)]=a43_0xdb3bee(0x137);[a43_0xdb3bee(0xc5)]=a43_0xdb3bee(0x10b);async[a43_0xdb3bee(0x11f)](_0x594be0){const _0x190778=a43_0xdb3bee,{options:_0x33a7e5,args:_0x45c8ee,tdx:_0x384900}=_0x594be0,_0x318380=_0x45c8ee[0x0];if(!_0x318380)return console[_0x190778(0xd3)]('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;try{const _0x5cbc62=_0x33a7e5[_0x190778(0xd2)];_0x33a7e5[_0x190778(0xe7)]&&(console[_0x190778(0xd3)]('Attempt\x20ID:\x20'+_0x318380),_0x5cbc62&&console[_0x190778(0xd3)](_0x190778(0x112)));const _0x5a6ff1=await withSpinner(_0x190778(0x12e),()=>_0x384900[_0x190778(0x132)][_0x190778(0xda)](_0x318380,_0x5cbc62||![]),{'verbose':_0x33a7e5[_0x190778(0xe7)]}),_0x2fdbe3=_0x5a6ff1['data'];return console[_0x190778(0xd3)]('✔\x20Found\x20'+_0x2fdbe3[_0x190778(0x116)]+'\x20task'+(_0x2fdbe3[_0x190778(0x116)]!==0x1?'s':'')),await handleSDKOutput(_0x2fdbe3,_0x33a7e5),0x0;}catch(_0x5935a9){if(_0x5935a9 instanceof SDKError)return console[_0x190778(0xd3)](_0x190778(0x13b)+_0x5935a9[_0x190778(0xf3)]),_0x5935a9[_0x190778(0x115)]&&console[_0x190778(0xd3)](_0x190778(0xfe)+_0x5935a9[_0x190778(0x115)]),0x1;throw _0x5935a9;}}}export class WorkflowLogsCommand extends BaseCommand{[a43_0xdb3bee(0xc7)]=a43_0xdb3bee(0xdd);[a43_0xdb3bee(0xc5)]=a43_0xdb3bee(0xce);async[a43_0xdb3bee(0x11f)](_0x20642f){const _0x4b9e97=a43_0xdb3bee,{options:_0x55d43a,args:_0x453087,tdx:_0x14e612}=_0x20642f,_0x424e58=_0x453087[0x0];let _0x581c92=_0x453087[0x1];if(!_0x424e58)return console[_0x4b9e97(0xd3)](_0x4b9e97(0x117)),0x1;try{_0x55d43a['verbose']&&(console[_0x4b9e97(0xd3)](_0x4b9e97(0xf2)+_0x424e58),_0x581c92&&console['error']('Task\x20name:\x20'+_0x581c92));const _0x50d52b=await withSpinner(_0x4b9e97(0x13d),()=>_0x14e612['workflow']['logFiles'](_0x424e58,_0x581c92),{'verbose':_0x55d43a['verbose']}),_0x47c0f8=_0x50d52b['data'];if(_0x47c0f8['length']===0x0)return console[_0x4b9e97(0xd3)](_0x4b9e97(0x11d)),0x0;if(!_0x581c92&&(_0x55d43a[_0x4b9e97(0x144)]||_0x55d43a[_0x4b9e97(0xee)]))return await handleSDKOutput(_0x47c0f8,_0x55d43a),0x0;if(!_0x581c92){const _0x28037e=_0x47c0f8['map'](_0x3469f0=>({'title':_0x3469f0['taskName']+'\x20('+formatBytes(_0x3469f0[_0x4b9e97(0xff)])+')','value':_0x3469f0[_0x4b9e97(0x11c)]})),_0x1c6ad7=await a43_0x9087d({'type':_0x4b9e97(0x10d),'name':_0x4b9e97(0xab),'message':_0x4b9e97(0xa6),'choices':_0x28037e});if(!_0x1c6ad7[_0x4b9e97(0xab)])return console[_0x4b9e97(0xd3)]('Cancelled'),0x0;_0x581c92=_0x1c6ad7[_0x4b9e97(0xab)];}const _0x598246=await withSpinner('Downloading\x20logs...',()=>_0x14e612[_0x4b9e97(0x132)]['logs'](_0x424e58,_0x581c92),{'verbose':_0x55d43a['verbose']}),_0x584a5d=_0x598246[_0x4b9e97(0x101)];return _0x584a5d?console[_0x4b9e97(0xec)](_0x584a5d):console[_0x4b9e97(0xd3)](_0x4b9e97(0xd4)),0x0;}catch(_0x34d3a7){if(_0x34d3a7 instanceof SDKError)return console[_0x4b9e97(0xd3)](_0x4b9e97(0x13b)+_0x34d3a7[_0x4b9e97(0xf3)]),_0x34d3a7[_0x4b9e97(0x115)]&&console['error'](_0x4b9e97(0xfe)+_0x34d3a7[_0x4b9e97(0x115)]),0x1;throw _0x34d3a7;}}}export class WorkflowKillCommand extends BaseCommand{[a43_0xdb3bee(0xc7)]=a43_0xdb3bee(0x102);[a43_0xdb3bee(0xc5)]='Kill\x20a\x20running\x20attempt';async[a43_0xdb3bee(0x11f)](_0x44e4fb){const _0x47a385=a43_0xdb3bee,{options:_0xddf6a5,args:_0x11121c,tdx:_0x3bc941}=_0x44e4fb,_0x44defe=_0x11121c[0x0];if(!_0x44defe)return console[_0x47a385(0xd3)](_0x47a385(0x117)),0x1;try{const _0xf379ab=_0xddf6a5[_0x47a385(0x131)];_0xddf6a5[_0x47a385(0xe7)]&&(console['error'](_0x47a385(0xf2)+_0x44defe),_0xf379ab&&console['error'](_0x47a385(0x139)+_0xf379ab));if(!_0xddf6a5[_0x47a385(0xaa)]){const _0x24f04b=await confirm(_0x47a385(0xa8)+_0x44defe+'?');if(!_0x24f04b)return console[_0x47a385(0xd3)](_0x47a385(0x108)),0x0;}const _0x402f32=await withSpinner(_0x47a385(0x9e),()=>_0x3bc941['workflow'][_0x47a385(0xfa)](_0x44defe,_0xf379ab),{'verbose':_0xddf6a5[_0x47a385(0xe7)]}),_0x17ae4f=_0x402f32[_0x47a385(0x101)];return console[_0x47a385(0xd3)]('✔\x20'+_0x17ae4f),0x0;}catch(_0x4c22be){if(_0x4c22be instanceof SDKError)return console['error'](_0x47a385(0x13b)+_0x4c22be[_0x47a385(0xf3)]),_0x4c22be[_0x47a385(0x115)]&&console[_0x47a385(0xd3)](_0x47a385(0xfe)+_0x4c22be['cause']),0x1;throw _0x4c22be;}}}export class WorkflowRetryCommand extends BaseCommand{[a43_0xdb3bee(0xc7)]=a43_0xdb3bee(0x121);['description']='Retry\x20a\x20session\x20or\x20attempt';async['execute'](_0xc8599b){const _0x485688=a43_0xdb3bee,{options:_0x32134b,args:_0x68348d,tdx:_0x33899f}=_0xc8599b,_0x14f698=_0x68348d[0x0];if(!_0x14f698)return console[_0x485688(0xd3)]('Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required'),console[_0x485688(0xd3)](_0x485688(0xcd)),0x1;let _0x1bcbc2=![],_0x38f7f8=_0x14f698;if(_0x14f698[_0x485688(0xd5)](_0x485688(0xfd)))_0x1bcbc2=!![],_0x38f7f8=_0x14f698[_0x485688(0x10c)](0x8);else{if(_0x14f698[_0x485688(0xd5)](_0x485688(0xe2)))_0x1bcbc2=![],_0x38f7f8=_0x14f698[_0x485688(0x10c)](0x8);else return console[_0x485688(0xd3)](_0x485688(0xa7)),console['error'](_0x485688(0xcd)),0x1;}try{const _0x3556ee=_0x32134b['fromTask'],_0x315201=_0x32134b[_0x485688(0x122)],_0x404bfc=_0x32134b[_0x485688(0xb7)],_0x378f1a=_0x32134b['force'];_0x32134b[_0x485688(0xe7)]&&(console[_0x485688(0xd3)](_0x485688(0xdb)+(_0x1bcbc2?'session':_0x485688(0xde))+'\x20'+_0x38f7f8),_0x3556ee&&console[_0x485688(0xd3)](_0x485688(0xc6)+_0x3556ee),_0x315201&&console[_0x485688(0xd3)](_0x485688(0xf6)+_0x315201),_0x404bfc&&console['error'](_0x485688(0x9b)+_0x404bfc),_0x378f1a&&console[_0x485688(0xd3)](_0x485688(0xe1)));let _0x34fba5;if(_0x404bfc)try{if(_0x404bfc[_0x485688(0xd5)]('@')){const _0x5a6974=await import('fs/promises'),_0x128f86=_0x404bfc[_0x485688(0x10c)](0x1),_0xeb67fd=await _0x5a6974['readFile'](_0x128f86,'utf-8');_0x34fba5=JSON['parse'](_0xeb67fd);}else _0x34fba5=JSON[_0x485688(0x133)](_0x404bfc);}catch{return console[_0x485688(0xd3)](_0x485688(0xf0)),0x1;}if(!_0x32134b[_0x485688(0xaa)]){const _0x8c0ab2=await confirm(_0x485688(0xe0)+(_0x1bcbc2?_0x485688(0x141):_0x485688(0xde))+'\x20'+_0x38f7f8+'?');if(!_0x8c0ab2)return console['error']('Cancelled'),0x0;}let _0x3404f6;_0x1bcbc2?_0x3404f6=await withSpinner('Retrying\x20session...',()=>_0x33899f[_0x485688(0x132)][_0x485688(0xe8)](_0x38f7f8,{'fromTask':_0x3556ee,'retryParams':_0x34fba5}),{'verbose':_0x32134b[_0x485688(0xe7)]}):_0x3404f6=await withSpinner('Retrying\x20attempt...',()=>_0x33899f[_0x485688(0x132)]['retryAttempt'](_0x38f7f8,{'resumeFrom':_0x315201,'retryParams':_0x34fba5,'force':_0x378f1a}),{'verbose':_0x32134b[_0x485688(0xe7)]});const _0x4ebf2a=_0x3404f6['data'];return console[_0x485688(0xd3)](_0x485688(0xbb)),console[_0x485688(0xd3)](_0x485688(0x13a)+_0x4ebf2a[_0x485688(0x126)]),console[_0x485688(0xd3)](_0x485688(0xa9)+_0x4ebf2a[_0x485688(0x140)]),0x0;}catch(_0x12b305){if(_0x12b305 instanceof SDKError)return console[_0x485688(0xd3)](_0x485688(0x13b)+_0x12b305[_0x485688(0xf3)]),_0x12b305['cause']&&console['error'](_0x485688(0xfe)+_0x12b305['cause']),0x1;throw _0x12b305;}}}export class WorkflowRunCommand extends BaseCommand{['name']='workflow:run';[a43_0xdb3bee(0xc5)]=a43_0xdb3bee(0xae);async[a43_0xdb3bee(0x11f)](_0xbb489c){const _0x1a9eeb=a43_0xdb3bee,{options:_0x19d1cf,args:_0x5646ed,tdx:_0x48272e}=_0xbb489c,_0x174791=_0x5646ed[0x0];if(!_0x174791)return console['error'](_0x1a9eeb(0x130)),console['error'](_0x1a9eeb(0x9c)),0x1;const _0x3c200c=_0x19d1cf[_0x1a9eeb(0xe3)],_0x496337=_0x19d1cf[_0x1a9eeb(0x9f)],_0x28cd92={};if(_0x3c200c&&Array[_0x1a9eeb(0x135)](_0x3c200c))for(const _0xf623a8 of _0x3c200c){const _0x16e389=_0xf623a8[_0x1a9eeb(0xdc)]('=');if(_0x16e389===-0x1)return console[_0x1a9eeb(0xd3)](_0x1a9eeb(0xb5)+_0xf623a8),console[_0x1a9eeb(0xd3)](_0x1a9eeb(0xba)),0x1;const _0x51cece=_0xf623a8['substring'](0x0,_0x16e389),_0x4898e6=_0xf623a8[_0x1a9eeb(0x10c)](_0x16e389+0x1);try{_0x28cd92[_0x51cece]=JSON[_0x1a9eeb(0x133)](_0x4898e6);}catch{_0x28cd92[_0x51cece]=_0x4898e6;}}_0x19d1cf[_0x1a9eeb(0xe7)]&&(console[_0x1a9eeb(0xd3)](_0x1a9eeb(0xaf)+_0x174791),Object[_0x1a9eeb(0xb6)](_0x28cd92)[_0x1a9eeb(0x116)]>0x0&&console[_0x1a9eeb(0xd3)](_0x1a9eeb(0x103)+JSON[_0x1a9eeb(0xdf)](_0x28cd92)),_0x496337&&console[_0x1a9eeb(0xd3)](_0x1a9eeb(0xe5)+_0x496337));const _0x24804a=await withSpinner(_0x1a9eeb(0x11e),()=>_0x48272e[_0x1a9eeb(0x132)][_0x1a9eeb(0x127)](_0x174791,_0x28cd92,{'sessionTime':_0x496337}),{'verbose':_0x19d1cf[_0x1a9eeb(0xe7)]}),_0x50f933=_0x24804a[_0x1a9eeb(0x101)];return console[_0x1a9eeb(0xd3)](_0x1a9eeb(0x120)),console['error']('\x20\x20Attempt\x20ID:\x20'+_0x50f933['id']),console[_0x1a9eeb(0xd3)](_0x1a9eeb(0xa9)+_0x50f933[_0x1a9eeb(0x140)]),console[_0x1a9eeb(0xd3)](_0x1a9eeb(0x110)+_0x50f933[_0x1a9eeb(0xf4)]?.[_0x1a9eeb(0xc7)]),console[_0x1a9eeb(0xd3)](_0x1a9eeb(0xb9)+_0x50f933['workflow']?.[_0x1a9eeb(0xc7)]),0x0;}}function a43_0x4f89(_0x173ba1,_0xecf0d){_0x173ba1=_0x173ba1-0x9a;const _0x2ca629=a43_0x2ca6();let _0x4f89e3=_0x2ca629[_0x173ba1];return _0x4f89e3;}export class WorkflowDownloadCommand extends BaseCommand{[a43_0xdb3bee(0xc7)]=a43_0xdb3bee(0x12f);[a43_0xdb3bee(0xc5)]='Download\x20workflow\x20project\x20from\x20Treasure\x20Data';async['execute'](_0x22de76){const _0x5d6615=a43_0xdb3bee,{options:_0x3a5dae,args:_0x189eac,tdx:_0x170b08}=_0x22de76,_0x17f681=_0x189eac[0x0],_0x55f54b=_0x189eac[0x1]||'.';if(!_0x17f681)return console[_0x5d6615(0xd3)](_0x5d6615(0xbe)),console['error']('Usage:\x20workflow:download\x20<project-name>\x20[output-dir]'),0x1;const _0x4a862b=_0x3a5dae[_0x5d6615(0xc3)];_0x3a5dae[_0x5d6615(0xe7)]&&(console[_0x5d6615(0xd3)]('Project:\x20'+_0x17f681),console['error'](_0x5d6615(0xc4)+_0x55f54b),_0x4a862b&&console[_0x5d6615(0xd3)]('Revision:\x20'+_0x4a862b));const _0x54d735=await withSpinner(_0x5d6615(0x123)+_0x17f681+_0x5d6615(0x142),()=>_0x170b08['workflow'][_0x5d6615(0x9d)](_0x17f681,_0x55f54b,{'revision':_0x4a862b}),{'verbose':_0x3a5dae[_0x5d6615(0xe7)]}),_0x2bfe5d=_0x54d735[_0x5d6615(0x101)];return console[_0x5d6615(0xd3)](_0x5d6615(0xb3)+_0x2bfe5d['projectName']),console[_0x5d6615(0xd3)]('\x20\x20Revision:\x20'+_0x2bfe5d[_0x5d6615(0xc3)]),console[_0x5d6615(0xd3)](_0x5d6615(0x11a)+_0x2bfe5d['filesExtracted']),console[_0x5d6615(0xd3)](_0x5d6615(0xb0)+_0x55f54b+'/'+_0x2bfe5d[_0x5d6615(0xfb)]),0x0;}}export class WorkflowPushCommand extends BaseCommand{[a43_0xdb3bee(0xc7)]=a43_0xdb3bee(0xbc);[a43_0xdb3bee(0xc5)]=a43_0xdb3bee(0xa2);async[a43_0xdb3bee(0x11f)](_0x52bc0d){const _0x4e4506=a43_0xdb3bee,{options:_0x147574,args:_0x5a2743,tdx:_0x487d7d}=_0x52bc0d;let _0x55f1c7='.',_0x4473fc=_0x147574[_0x4e4506(0xc7)];if(_0x5a2743[0x0]){const {promises:_0x484892}=await import('fs');try{const _0x32500d=await _0x484892[_0x4e4506(0xf1)](_0x5a2743[0x0]);if(_0x32500d[_0x4e4506(0x106)]())_0x55f1c7=_0x5a2743[0x0];else return console[_0x4e4506(0xd3)](_0x4e4506(0x13b)+_0x5a2743[0x0]+_0x4e4506(0xb2)),0x1;}catch{_0x4473fc=_0x5a2743[0x0],_0x55f1c7='.';}}const _0x259725=_0x147574[_0x4e4506(0xc3)],_0x1ac870=_0x147574[_0x4e4506(0xe9)];_0x147574['verbose']&&(console['error'](_0x4e4506(0xc1)+_0x55f1c7),_0x4473fc&&console[_0x4e4506(0xd3)](_0x4e4506(0xea)+_0x4473fc),_0x259725&&console[_0x4e4506(0xd3)](_0x4e4506(0xf8)+_0x259725),_0x1ac870&&console[_0x4e4506(0xd3)]('Validation:\x20skipped'));const _0x1e8921=await withSpinner(_0x4e4506(0xd0),()=>_0x487d7d['workflow'][_0x4e4506(0xca)](_0x55f1c7,{'projectName':_0x4473fc,'revision':_0x259725,'skipValidation':_0x1ac870}),{'verbose':_0x147574[_0x4e4506(0xe7)]}),_0x2976b7=_0x1e8921[_0x4e4506(0x101)];return console[_0x4e4506(0xd3)](_0x4e4506(0x13e)+_0x2976b7[_0x4e4506(0xfb)]),console[_0x4e4506(0xd3)]('\x20\x20Project\x20ID:\x20'+_0x2976b7[_0x4e4506(0x107)]),console[_0x4e4506(0xd3)](_0x4e4506(0xd6)+_0x2976b7[_0x4e4506(0xc3)]),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{['name']=a43_0xdb3bee(0xf7);[a43_0xdb3bee(0xc5)]='Delete\x20workflow\x20project\x20from\x20Treasure\x20Data';async[a43_0xdb3bee(0x11f)](_0x561d2d){const _0x512ebf=a43_0xdb3bee,{options:_0xbdaabc,args:_0x8d2739,tdx:_0x4f41d2}=_0x561d2d,_0x2b89ee=_0x8d2739[0x0];if(!_0x2b89ee)return console[_0x512ebf(0xd3)](_0x512ebf(0x143)),console[_0x512ebf(0xd3)]('Usage:\x20workflow:delete\x20<project-name-or-id>'),0x1;_0xbdaabc['verbose']&&console[_0x512ebf(0xd3)](_0x512ebf(0x13f)+_0x2b89ee);if(!_0xbdaabc[_0x512ebf(0xaa)]){const _0x7a773=await confirm(_0x512ebf(0xfc)+_0x2b89ee+_0x512ebf(0x10e));if(!_0x7a773)return console[_0x512ebf(0xd3)]('Cancelled'),0x0;}const _0x454505=await withSpinner(_0x512ebf(0xe6)+_0x2b89ee+_0x512ebf(0x142),()=>_0x4f41d2[_0x512ebf(0x132)][_0x512ebf(0xb4)](_0x2b89ee),{'verbose':_0xbdaabc[_0x512ebf(0xe7)]}),_0x8fefbf=_0x454505[_0x512ebf(0x101)];return console['error'](_0x512ebf(0x11b)+_0x8fefbf[_0x512ebf(0xfb)]),console[_0x512ebf(0xd3)](_0x512ebf(0x125)+_0x8fefbf[_0x512ebf(0x107)]),0x0;}}
package/dist/core/auth.js CHANGED
@@ -1 +1 @@
1
- (function(_0x5534aa,_0x4a21ff){const _0x34c545=a44_0x3980,_0x12f7e5=_0x5534aa();while(!![]){try{const _0x331509=-parseInt(_0x34c545(0x1a8))/0x1*(-parseInt(_0x34c545(0x1aa))/0x2)+parseInt(_0x34c545(0x1a9))/0x3+-parseInt(_0x34c545(0x19e))/0x4+-parseInt(_0x34c545(0x1a6))/0x5+-parseInt(_0x34c545(0x1ae))/0x6+-parseInt(_0x34c545(0x1ad))/0x7+-parseInt(_0x34c545(0x1ab))/0x8*(-parseInt(_0x34c545(0x1ac))/0x9);if(_0x331509===_0x4a21ff)break;else _0x12f7e5['push'](_0x12f7e5['shift']());}catch(_0x2c1cd8){_0x12f7e5['push'](_0x12f7e5['shift']());}}}(a44_0x3682,0x4c4b5));import{platform}from'os';import{readFileSync}from'fs';function a44_0x3980(_0x295ccb,_0x3d9b29){_0x295ccb=_0x295ccb-0x19d;const _0x368258=a44_0x3682();let _0x398006=_0x368258[_0x295ccb];return _0x398006;}import{fileURLToPath}from'url';function a44_0x3682(){const _0x34125e=['../../package.json','Authorization','tdx/','2516535XwBRMV','X-Trino-User','16403wnjHDL','1503660eXyHfP','28GgOnTn','29096NfnZfH','2511vZAYcS','3621653DKEhQi','2331810PAPCrF','replace','95052KDrZtl','length','tdx','entries','version'];a44_0x3682=function(){return _0x34125e;};return a44_0x3682();}import{dirname,join}from'path';import{getAPIKey}from'./config.js';export function getVersion(){const _0xc538c7=a44_0x3980;try{const _0x4963de=fileURLToPath(import.meta.url),_0x41c693=dirname(_0x4963de),_0x53c3fd=join(_0x41c693,_0xc538c7(0x1a3)),_0xf15eb8=JSON['parse'](readFileSync(_0x53c3fd,'utf-8'));return _0xf15eb8[_0xc538c7(0x1a2)];}catch{return'0.0.0';}}export function getUserAgent(){const _0x555ba4=a44_0x3980,_0x36b529=getVersion(),_0x13f43d=platform(),_0x3b20a5=process[_0x555ba4(0x1a2)][_0x555ba4(0x19d)]('v','');return _0x555ba4(0x1a5)+_0x36b529+'\x20('+_0x13f43d+';\x20node/'+_0x3b20a5+')';}export function getAuthHeaders(_0x6861ca,_0x189e36){const _0x60f046=a44_0x3980,_0x5edb32=getVersion(),_0x16351c={'User-Agent':getUserAgent(),'X-TD-Client':_0x60f046(0x1a0),'X-TD-Client-Version':_0x5edb32};return _0x189e36&&(_0x16351c['Authorization']='TD1\x20'+_0x189e36),_0x16351c;}export function toHeaderRecord(_0x3a05d6){const _0x23810e=a44_0x3980,_0x71258b={};for(const [_0x10f21e,_0x52de10]of Object[_0x23810e(0x1a1)](_0x3a05d6)){_0x52de10!==undefined&&(_0x71258b[_0x10f21e]=_0x52de10);}return _0x71258b;}export function getTrinoHeaders(_0x3f4a09,_0x259314){const _0x42c8da=a44_0x3980,_0x12ad7d=getAuthHeaders(_0x3f4a09,_0x259314),_0x2b2540=toHeaderRecord(_0x12ad7d);return delete _0x2b2540[_0x42c8da(0x1a4)],_0x259314&&(_0x2b2540[_0x42c8da(0x1a7)]=_0x259314),_0x2b2540;}export function hasAPIKey(_0x1e7eee){const _0x3c3fa6=a44_0x3980,_0x240ecf=getAPIKey(_0x1e7eee);return _0x240ecf!==undefined&&_0x240ecf[_0x3c3fa6(0x19f)]>0x0;}
1
+ (function(_0x4b01a1,_0x462736){const _0x166858=a44_0x4b1b,_0x33d4a7=_0x4b01a1();while(!![]){try{const _0x3617c9=-parseInt(_0x166858(0x178))/0x1*(-parseInt(_0x166858(0x17a))/0x2)+parseInt(_0x166858(0x179))/0x3*(-parseInt(_0x166858(0x17b))/0x4)+parseInt(_0x166858(0x17e))/0x5*(-parseInt(_0x166858(0x181))/0x6)+-parseInt(_0x166858(0x175))/0x7+parseInt(_0x166858(0x173))/0x8*(parseInt(_0x166858(0x17c))/0x9)+parseInt(_0x166858(0x172))/0xa+parseInt(_0x166858(0x182))/0xb;if(_0x3617c9===_0x462736)break;else _0x33d4a7['push'](_0x33d4a7['shift']());}catch(_0x806b73){_0x33d4a7['push'](_0x33d4a7['shift']());}}}(a44_0x3df7,0xcab43));import{platform}from'os';function a44_0x4b1b(_0x10eb44,_0x27ba5a){_0x10eb44=_0x10eb44-0x170;const _0x3df780=a44_0x3df7();let _0x4b1b54=_0x3df780[_0x10eb44];return _0x4b1b54;}import{readFileSync}from'fs';import{fileURLToPath}from'url';import{dirname,join}from'path';import{getAPIKey}from'./config.js';export function getVersion(){const _0x20f0cf=a44_0x4b1b;try{const _0x157700=fileURLToPath(import.meta.url),_0x264ef5=dirname(_0x157700),_0x4b847a=join(_0x264ef5,'../../package.json'),_0x54803b=JSON[_0x20f0cf(0x17d)](readFileSync(_0x4b847a,_0x20f0cf(0x17f)));return _0x54803b[_0x20f0cf(0x183)];}catch{return _0x20f0cf(0x174);}}function a44_0x3df7(){const _0xf1a433=['9mvwWEQ','parse','205GwqWPy','utf-8','entries','135114Iimsrx','15852804EWiOAx','version','length','Authorization','tdx','TD1\x20','1278950njrxlQ','11388248EdmszU','0.0.0','6180664zjEyUb',';\x20node/','tdx/','1500fcgWXO','24pydqMn','1262OUgPdW','651292EjMbEh'];a44_0x3df7=function(){return _0xf1a433;};return a44_0x3df7();}export function getUserAgent(){const _0xd560b5=a44_0x4b1b,_0x4ad9ba=getVersion(),_0x21b04e=platform(),_0x414504=process[_0xd560b5(0x183)]['replace']('v','');return _0xd560b5(0x177)+_0x4ad9ba+'\x20('+_0x21b04e+_0xd560b5(0x176)+_0x414504+')';}export function getAuthHeaders(_0x3c8278,_0x47b86f){const _0x3496f7=a44_0x4b1b,_0x42e87a=getVersion(),_0x319e69={'User-Agent':getUserAgent(),'X-TD-Client':_0x3496f7(0x170),'X-TD-Client-Version':_0x42e87a};return _0x47b86f&&(_0x319e69['Authorization']=_0x3496f7(0x171)+_0x47b86f),_0x319e69;}export function toHeaderRecord(_0x5d6ce6){const _0x4a9f91=a44_0x4b1b,_0x57e9de={};for(const [_0x2d7546,_0x42ecf1]of Object[_0x4a9f91(0x180)](_0x5d6ce6)){_0x42ecf1!==undefined&&(_0x57e9de[_0x2d7546]=_0x42ecf1);}return _0x57e9de;}export function getTrinoHeaders(_0x1f7649,_0x24ff44){const _0x37f700=a44_0x4b1b,_0x3627a6=getAuthHeaders(_0x1f7649,_0x24ff44),_0x5b94b5=toHeaderRecord(_0x3627a6);return delete _0x5b94b5[_0x37f700(0x185)],_0x24ff44&&(_0x5b94b5['X-Trino-User']=_0x24ff44),_0x5b94b5;}export function hasAPIKey(_0x1bc5f3){const _0xc380d5=a44_0x4b1b,_0x421330=getAPIKey(_0x1bc5f3);return _0x421330!==undefined&&_0x421330[_0xc380d5(0x184)]>0x0;}
@@ -1 +1 @@
1
- (function(_0x1e1ff4,_0x12c630){const _0x396976=a45_0x15c5,_0x1b9e77=_0x1e1ff4();while(!![]){try{const _0x4c904e=-parseInt(_0x396976(0x107))/0x1*(parseInt(_0x396976(0x105))/0x2)+parseInt(_0x396976(0xc5))/0x3*(-parseInt(_0x396976(0xf5))/0x4)+parseInt(_0x396976(0xff))/0x5*(parseInt(_0x396976(0xea))/0x6)+-parseInt(_0x396976(0xf8))/0x7*(-parseInt(_0x396976(0xb8))/0x8)+parseInt(_0x396976(0xd1))/0x9*(parseInt(_0x396976(0xfd))/0xa)+-parseInt(_0x396976(0xe9))/0xb*(parseInt(_0x396976(0xe2))/0xc)+parseInt(_0x396976(0xd3))/0xd*(parseInt(_0x396976(0xca))/0xe);if(_0x4c904e===_0x12c630)break;else _0x1b9e77['push'](_0x1b9e77['shift']());}catch(_0x1e851f){_0x1b9e77['push'](_0x1b9e77['shift']());}}}(a45_0x5d6e,0xe0026));import{homedir}from'os';import{join}from'path';import{existsSync,readFileSync,writeFileSync,mkdirSync,unlinkSync}from'fs';import*as a45_0x3241dd from'node:fs';import*as a45_0x71f558 from'node:path';function a45_0x5d6e(){const _0x35b775=['site','Warning:\x20Using\x20TD_API_KEY\x20is\x20deprecated.\x20Please\x20use\x20TDX_API_KEY\x20instead.\x0a','TD_API_KEY_','14WKvlvU','⚠\x20Failed\x20to\x20migrate\x20API\x20key\x20to\x20keychain:\x20','source','profiles','apiKey','tdx.json','\x20\x20For\x20profile-specific\x20keys,\x20use\x20TDX_API_KEY_<PROFILE>\x20(e.g.,\x20','36GcblKi','startsWith','11045879eLDmIE','us01','entries','parse','some','Warning:\x20Failed\x20to\x20read\x20','TDX_CACHE_DIR','endsWith','.env.','keychain\x20(profile:\x20','filter','⚠\x20Cleaned\x20up\x20API\x20keys\x20from\x20legacy\x20.env\x20file','TDX_API_KEY_','\x20env\x20var','stg-jp01','33972ozJiNi','TDX_API_KEY\x20env\x20var','warn','TDX_CONFIG_DIR','join','yellow','toUpperCase','2629TilmCp','43698mtpURh','dev-us01','dev-eu01','readFileSync','TD_API_KEY\x20env\x20var\x20(deprecated)','stg-ap03','apiKeys','llm_default_project.','.cache','keychain','name','3067532PMNXMk','existsSync','stg-us01','7lTPKgP','TDX_API_KEY','includes','legacy\x20.env\x20file','jp01','3987930gCKdqw','account_info.json','20BNESqO','llm_default_project','slice','stringify','string','\x27,\x20defaulting\x20to\x20us01','6TBmoGN','⚠\x20Migrated\x20API\x20key\x20from\x20.env\x20to\x20secure\x20keychain\x20storage','396682BUkJyV','accountId','split','tdx','8616744MKOgiO','replace','map','.json','Warning:\x20Unknown\x20site\x20\x27','ap02','TD_API_KEY','trim','env','eu01','number','ap03','utf-8','3wRrtIb','.config'];a45_0x5d6e=function(){return _0x35b775;};return a45_0x5d6e();}import{SITE_ALIASES}from'../types/index.js';import{validateSecureFilePermissions}from'../utils/file-permissions.js';import{getKeychainAPIKey,saveKeychainAPIKey,isKeychainAvailable}from'./keychain.js';import{getCachedCredential,setCachedCredential}from'./credential-cache.js';import a45_0x5a6362 from'chalk';export function getConfigDir(){const _0x256155=a45_0x15c5;return process[_0x256155(0xc0)][_0x256155(0xe5)]||join(homedir(),_0x256155(0xc6),_0x256155(0x10a));}export function getConfigFile(){return join(getConfigDir(),'.env');}export function getConfigFilePath(_0x48cfb1){const _0x4cb2a9=a45_0x15c5,_0xe9d57c=getConfigDir();return _0x48cfb1?a45_0x71f558[_0x4cb2a9(0xe6)](_0xe9d57c,_0x4cb2a9(0xdb)+_0x48cfb1):getConfigFile();}export function getCacheDir(){const _0x19a07e=a45_0x15c5;return process[_0x19a07e(0xc0)][_0x19a07e(0xd9)]||join(homedir(),_0x19a07e(0xf2),_0x19a07e(0x10a));}export function getLLMProjectCacheFile(_0x4c7a47){const _0x1d5794=a45_0x15c5,_0x46968f=_0x4c7a47?_0x1d5794(0xf1)+_0x4c7a47:_0x1d5794(0x100);return join(getCacheDir(),_0x46968f);}export function readCachedLLMProject(_0x5d4961){const _0x2178fe=a45_0x15c5;try{const _0xc0ae09=getLLMProjectCacheFile(_0x5d4961);if(!existsSync(_0xc0ae09))return null;const _0x580f49=readFileSync(_0xc0ae09,_0x2178fe(0xc4))[_0x2178fe(0xbf)]();try{const _0x5659cd=JSON[_0x2178fe(0xd6)](_0x580f49);if(_0x5659cd&&typeof _0x5659cd['id']===_0x2178fe(0x103)&&typeof _0x5659cd[_0x2178fe(0xf4)]===_0x2178fe(0x103))return _0x5659cd;}catch{}return null;}catch{return null;}}export function writeCachedLLMProject(_0x409cab,_0x922947,_0x5b5d5a){const _0x5e6541=a45_0x15c5;try{const _0x28cbec=getCacheDir(),_0x54ea0b=getLLMProjectCacheFile(_0x5b5d5a);!existsSync(_0x28cbec)&&mkdirSync(_0x28cbec,{'recursive':!![]});const _0x3ec66e={'name':_0x409cab,'id':_0x922947};writeFileSync(_0x54ea0b,JSON[_0x5e6541(0x102)](_0x3ec66e),_0x5e6541(0xc4));}catch{}}export function getAccountInfoCacheFile(_0x22cfb2){const _0x1b5a56=a45_0x15c5,_0x3614df=_0x22cfb2?'account_info.'+_0x22cfb2+_0x1b5a56(0xbb):_0x1b5a56(0xfe);return join(getCacheDir(),_0x3614df);}export function readCachedAccountInfo(_0x5a09d0){const _0x367d26=a45_0x15c5;try{const _0x52b753=getAccountInfoCacheFile(_0x5a09d0);if(!existsSync(_0x52b753))return null;const _0x4a9111=readFileSync(_0x52b753,'utf-8')[_0x367d26(0xbf)](),_0xba6bc7=JSON['parse'](_0x4a9111);if(_0xba6bc7&&typeof _0xba6bc7[_0x367d26(0xc7)]===_0x367d26(0x103)&&typeof _0xba6bc7[_0x367d26(0x108)]===_0x367d26(0xc2))return _0xba6bc7;return null;}catch{return null;}}export function writeCachedAccountInfo(_0x1c69d8,_0x246dc6,_0x5f9737){const _0xf48100=a45_0x15c5;try{const _0x2308b1=getCacheDir(),_0x54c0f2=getAccountInfoCacheFile(_0x5f9737);!existsSync(_0x2308b1)&&mkdirSync(_0x2308b1,{'recursive':!![]});const _0x59c084={'site':_0x1c69d8,'accountId':_0x246dc6,'cachedAt':new Date()['toISOString']()};writeFileSync(_0x54c0f2,JSON[_0xf48100(0x102)](_0x59c084),_0xf48100(0xc4));}catch{}}export function parseEnvFile(_0x5ece61){const _0x2e15eb=a45_0x15c5,_0x1975dd={};for(const _0x39511c of _0x5ece61[_0x2e15eb(0x109)]('\x0a')){const _0x1b3ab5=_0x39511c[_0x2e15eb(0xbf)]();if(!_0x1b3ab5||_0x1b3ab5[_0x2e15eb(0xd2)]('#'))continue;const _0x18e176=_0x1b3ab5['match'](/^([^=]+)=(.*)$/);if(_0x18e176){const _0x4dde11=_0x18e176[0x1][_0x2e15eb(0xbf)]();let _0x4e51e1=_0x18e176[0x2][_0x2e15eb(0xbf)]();(_0x4e51e1[_0x2e15eb(0xd2)]('\x22')&&_0x4e51e1['endsWith']('\x22')||_0x4e51e1[_0x2e15eb(0xd2)]('\x27')&&_0x4e51e1[_0x2e15eb(0xda)]('\x27'))&&(_0x4e51e1=_0x4e51e1[_0x2e15eb(0x101)](0x1,-0x1)),_0x1975dd[_0x4dde11]=_0x4e51e1;}}return _0x1975dd;}export function readUserConfig(){const _0x8b888c=a45_0x15c5,_0x8c53a2=getConfigFile();if(!existsSync(_0x8c53a2))return{};try{const _0x2cb209=readFileSync(_0x8c53a2,_0x8b888c(0xc4));return parseEnvFile(_0x2cb209);}catch(_0x337f8c){return console[_0x8b888c(0xe4)]('Warning:\x20Failed\x20to\x20read\x20config\x20file\x20'+_0x8c53a2+':',_0x337f8c),{};}}export function resolveSite(_0x44ee50){const _0x52215f=a45_0x15c5,_0x3f2f0e=[_0x52215f(0xd4),_0x52215f(0xfc),_0x52215f(0xc1),_0x52215f(0xbd),_0x52215f(0xc3),'dev-us01',_0x52215f(0xec),_0x52215f(0xf7),_0x52215f(0xe1),_0x52215f(0xef)];if(_0x3f2f0e[_0x52215f(0xfa)](_0x44ee50))return _0x44ee50;if(_0x44ee50 in SITE_ALIASES)return SITE_ALIASES[_0x44ee50];return console['warn'](_0x52215f(0xbc)+_0x44ee50+_0x52215f(0x104)),_0x52215f(0xd4);}let cachedUserConfig=null;export function loadUserConfigOnce(){return cachedUserConfig===null&&(cachedUserConfig=readUserConfig()),cachedUserConfig;}export function clearConfigCache(){cachedUserConfig=null;}export function getAPIKey(_0x2e8d04,_0x54bd3f){const _0x1daca4=a45_0x15c5,_0x328775=_0x54bd3f||getActiveProfileName();if(_0x328775){const _0x1b6765=_0x1daca4(0xdf)+normalizeProfileForEnvVar(_0x328775);if(process[_0x1daca4(0xc0)][_0x1b6765])return process[_0x1daca4(0xc0)][_0x1b6765];}if(process['env']['TDX_API_KEY'])return process[_0x1daca4(0xc0)][_0x1daca4(0xf9)];if(process[_0x1daca4(0xc0)][_0x1daca4(0xbe)])return process[_0x1daca4(0xc0)][_0x1daca4(0xbe)];const _0x90408c=_0x2e8d04[_0x1daca4(0xe8)]()['replace'](/-/g,'_'),_0x2c9629=_0x1daca4(0xc9)+_0x90408c;if(_0x328775){const _0x35879b=loadProfileEnv(_0x328775);if(_0x35879b){if(_0x35879b[_0x2c9629])return _0x35879b[_0x2c9629];if(_0x35879b['TD_API_KEY'])return _0x35879b[_0x1daca4(0xbe)];}}const _0x4d7d1d=loadUserConfigOnce();if(_0x4d7d1d[_0x2c9629])return _0x4d7d1d[_0x2c9629];if(_0x4d7d1d[_0x1daca4(0xbe)])return _0x4d7d1d[_0x1daca4(0xbe)];return undefined;}export function normalizeProfileForEnvVar(_0x24dc0e){const _0x16be70=a45_0x15c5;return _0x24dc0e[_0x16be70(0xe8)]()[_0x16be70(0xb9)](/[^A-Z0-9]/g,'_');}function a45_0x15c5(_0x915f48,_0x1ba9dc){_0x915f48=_0x915f48-0xb8;const _0x5d6e74=a45_0x5d6e();let _0x15c5d3=_0x5d6e74[_0x915f48];return _0x15c5d3;}export async function resolveAPIKeyAsync(_0x18982d,_0x31252c){const _0x2cdc6b=a45_0x15c5,_0x1ee92d=_0x31252c||getActiveProfileName()||undefined;if(_0x1ee92d){const _0x2cbe74=_0x2cdc6b(0xdf)+normalizeProfileForEnvVar(_0x1ee92d);if(process['env'][_0x2cbe74])return{'apiKey':process[_0x2cdc6b(0xc0)][_0x2cbe74],'source':_0x2cbe74+_0x2cdc6b(0xe0),'isDeprecated':![]};const _0x47c146=getCachedCredential(_0x18982d,_0x1ee92d);if(_0x47c146)return{'apiKey':_0x47c146,'source':_0x2cdc6b(0xdc)+_0x1ee92d+')','isDeprecated':![]};const _0x385bbf=await getKeychainAPIKey(_0x1ee92d);if(_0x385bbf)return setCachedCredential(_0x385bbf,_0x18982d,_0x1ee92d),{'apiKey':_0x385bbf,'source':_0x2cdc6b(0xdc)+_0x1ee92d+')','isDeprecated':![]};}if(process[_0x2cdc6b(0xc0)]['TDX_API_KEY'])return{'apiKey':process['env'][_0x2cdc6b(0xf9)],'source':_0x2cdc6b(0xe3),'isDeprecated':![]};if(!_0x1ee92d){const _0x19167c=getCachedCredential(_0x18982d,undefined);if(_0x19167c)return{'apiKey':_0x19167c,'source':_0x2cdc6b(0xf3),'isDeprecated':![]};const _0x337c74=await getKeychainAPIKey(undefined);if(_0x337c74)return setCachedCredential(_0x337c74,_0x18982d,undefined),{'apiKey':_0x337c74,'source':_0x2cdc6b(0xf3),'isDeprecated':![]};}if(process[_0x2cdc6b(0xc0)][_0x2cdc6b(0xbe)])return{'apiKey':process[_0x2cdc6b(0xc0)][_0x2cdc6b(0xbe)],'source':_0x2cdc6b(0xee),'isDeprecated':!![]};const _0x363db5=getLegacyEnvAPIKey(_0x18982d,_0x1ee92d);if(_0x363db5){const _0x43e69d=await isKeychainAvailable();if(_0x43e69d)try{await saveKeychainAPIKey(_0x363db5,_0x1ee92d),setCachedCredential(_0x363db5,_0x18982d,_0x1ee92d);const _0x439691=getConfigFilePath(_0x1ee92d);cleanupLegacyEnvFile(_0x439691)&&console[_0x2cdc6b(0xe4)](a45_0x5a6362[_0x2cdc6b(0xe7)](_0x2cdc6b(0x106)));}catch(_0x438168){console[_0x2cdc6b(0xe4)](a45_0x5a6362[_0x2cdc6b(0xe7)](_0x2cdc6b(0xcb)+_0x438168));}const _0x428e0a=_0x1ee92d?'legacy\x20.env\x20file\x20(profile:\x20'+_0x1ee92d+')':_0x2cdc6b(0xfb);return{'apiKey':_0x363db5,'source':_0x428e0a,'isDeprecated':!![]};}return null;}export async function getAPIKeyAsync(_0x47f1a5,_0x5cd59e,_0x498792=!![]){const _0x235667=a45_0x15c5,_0x345f1e=await resolveAPIKeyAsync(_0x47f1a5,_0x5cd59e);if(!_0x345f1e)return undefined;if(_0x498792&&_0x345f1e['isDeprecated']&&_0x345f1e[_0x235667(0xcc)]['includes'](_0x235667(0xbe))){const _0x2eabcf=_0x5cd59e||getActiveProfileName()||undefined,_0x238be3=_0x2eabcf?_0x235667(0xdf)+normalizeProfileForEnvVar(_0x2eabcf):'TDX_API_KEY_<PROFILE>';console[_0x235667(0xe4)](a45_0x5a6362[_0x235667(0xe7)](_0x235667(0xc8)+(_0x235667(0xd0)+_0x238be3+').')));}return _0x345f1e[_0x235667(0xce)];}function getLegacyEnvAPIKey(_0x42b361,_0x221224){const _0x16ba55=a45_0x15c5,_0x242b9c=_0x42b361['toUpperCase']()[_0x16ba55(0xb9)](/-/g,'_'),_0x3f91aa=_0x16ba55(0xc9)+_0x242b9c;if(_0x221224){const _0x4da2ad=loadProfileEnv(_0x221224);if(_0x4da2ad){if(_0x4da2ad[_0x3f91aa])return _0x4da2ad[_0x3f91aa];if(_0x4da2ad[_0x16ba55(0xbe)])return _0x4da2ad[_0x16ba55(0xbe)];}}const _0x2165ec=loadUserConfigOnce();if(_0x2165ec[_0x3f91aa])return _0x2165ec[_0x3f91aa];if(_0x2165ec[_0x16ba55(0xbe)])return _0x2165ec[_0x16ba55(0xbe)];return undefined;}function cleanupLegacyEnvFile(_0x4fb33a){const _0x1035d7=a45_0x15c5;if(!existsSync(_0x4fb33a))return![];try{const _0x685e7e=readFileSync(_0x4fb33a,_0x1035d7(0xc4)),_0x549737=_0x685e7e[_0x1035d7(0x109)]('\x0a'),_0xa0c758=_0x549737[_0x1035d7(0xdd)](_0x207533=>{const _0xcff125=_0x1035d7,_0x28c4bc=_0x207533[_0xcff125(0xbf)]();if(!_0x28c4bc||_0x28c4bc[_0xcff125(0xd2)]('#'))return!![];const [_0x573657]=_0x28c4bc[_0xcff125(0x109)]('=');return!_0x573657[_0xcff125(0xd2)]('TD_API_KEY');}),_0x5beaf7=_0xa0c758[_0x1035d7(0xd7)](_0xe5f56a=>{const _0x212dfd=_0xe5f56a['trim']();return _0x212dfd&&!_0x212dfd['startsWith']('#');});if(!_0x5beaf7)return unlinkSync(_0x4fb33a),!![];return writeFileSync(_0x4fb33a,_0xa0c758[_0x1035d7(0xe6)]('\x0a'),{'mode':0x180}),!![];}catch{return![];}}function loadProfileEnv(_0x353262){const _0x3c208a=a45_0x15c5,_0x1101e7=a45_0x71f558[_0x3c208a(0xe6)](getConfigDir(),_0x3c208a(0xdb)+_0x353262);if(a45_0x3241dd[_0x3c208a(0xf6)](_0x1101e7)){validateSecureFilePermissions(_0x1101e7);try{const _0x220df8=a45_0x3241dd[_0x3c208a(0xed)](_0x1101e7,'utf-8');return parseEnvFile(_0x220df8);}catch(_0x28aaba){console[_0x3c208a(0xe4)]('Warning:\x20Failed\x20to\x20load\x20'+_0x1101e7+':\x20'+_0x28aaba);}}const _0x22fdac=a45_0x71f558[_0x3c208a(0xe6)](getConfigDir(),_0x3c208a(0xcd),_0x353262,'.env');if(a45_0x3241dd[_0x3c208a(0xf6)](_0x22fdac)){validateSecureFilePermissions(_0x22fdac);try{const _0x289fae=a45_0x3241dd[_0x3c208a(0xed)](_0x22fdac,_0x3c208a(0xc4));return parseEnvFile(_0x289fae);}catch(_0x3ce68b){return console[_0x3c208a(0xe4)]('Warning:\x20Failed\x20to\x20load\x20'+_0x22fdac+':\x20'+_0x3ce68b),null;}}return null;}function getActiveProfileName(){const _0x4951d5=a45_0x15c5,_0x63f5e=a45_0x71f558[_0x4951d5(0xe6)](getConfigDir(),_0x4951d5(0xcf));if(!a45_0x3241dd[_0x4951d5(0xf6)](_0x63f5e))return null;try{const _0x32b386=a45_0x3241dd[_0x4951d5(0xed)](_0x63f5e,'utf-8'),_0x1ff59b=JSON[_0x4951d5(0xd6)](_0x32b386);return _0x1ff59b['profile']||null;}catch{return null;}}export function saveAPIKey(_0x2a326e,_0x2749f8,_0x7c267e){const _0x3ebae7=a45_0x15c5,_0x3e4b4d=getConfigDir(),_0x4dc0dc=getConfigFilePath(_0x7c267e);!existsSync(_0x3e4b4d)&&mkdirSync(_0x3e4b4d,{'recursive':!![],'mode':0x1c0});let _0x21d997={};if(existsSync(_0x4dc0dc))try{const _0x41891d=readFileSync(_0x4dc0dc,_0x3ebae7(0xc4));_0x21d997=parseEnvFile(_0x41891d);}catch(_0x5688d3){console['warn'](_0x3ebae7(0xd8)+_0x4dc0dc+':',_0x5688d3);}const _0x35c91d=_0x2a326e[_0x3ebae7(0xe8)]()[_0x3ebae7(0xb9)](/-/g,'_');_0x21d997[_0x3ebae7(0xc9)+_0x35c91d]=_0x2749f8;const _0x398cf9=Object[_0x3ebae7(0xd5)](_0x21d997)[_0x3ebae7(0xba)](([_0x5f5c73,_0x3908d3])=>_0x5f5c73+'='+_0x3908d3);writeFileSync(_0x4dc0dc,_0x398cf9[_0x3ebae7(0xe6)]('\x0a')+'\x0a',{'mode':0x180});}export async function saveAPIKeyAsync(_0x3b587c,_0x1632da,_0x33c14b){const _0x629d92=a45_0x15c5;await saveKeychainAPIKey(_0x3b587c,_0x33c14b),setCachedCredential(_0x3b587c,_0x1632da,_0x33c14b);const _0x396486=getConfigFilePath(_0x33c14b);cleanupLegacyEnvFile(_0x396486)&&console['warn'](a45_0x5a6362['yellow'](_0x629d92(0xde)));}export function loadConfig(){const _0x2c773b=a45_0x15c5,_0xddf1be={'apiKeys':{},'defaultSite':_0x2c773b(0xd4)},_0x25d042=[_0x2c773b(0xd4),'jp01','eu01','ap02',_0x2c773b(0xc3),_0x2c773b(0xeb),_0x2c773b(0xec),'stg-us01','stg-jp01',_0x2c773b(0xef)];for(const _0x7f37f4 of _0x25d042){const _0x333dc0=getAPIKey(_0x7f37f4);_0x333dc0&&(_0xddf1be[_0x2c773b(0xf0)][_0x7f37f4]=_0x333dc0);}return _0xddf1be;}
1
+ (function(_0x461a0e,_0x5086a0){const _0x3a0cb8=a45_0x4065,_0x54f77c=_0x461a0e();while(!![]){try{const _0x43b2f7=parseInt(_0x3a0cb8(0x1db))/0x1*(parseInt(_0x3a0cb8(0x1da))/0x2)+-parseInt(_0x3a0cb8(0x1d8))/0x3*(parseInt(_0x3a0cb8(0x1cb))/0x4)+parseInt(_0x3a0cb8(0x1d7))/0x5*(-parseInt(_0x3a0cb8(0x1df))/0x6)+parseInt(_0x3a0cb8(0x1e0))/0x7*(-parseInt(_0x3a0cb8(0x1ef))/0x8)+parseInt(_0x3a0cb8(0x1f6))/0x9*(-parseInt(_0x3a0cb8(0x20c))/0xa)+-parseInt(_0x3a0cb8(0x1d1))/0xb*(-parseInt(_0x3a0cb8(0x1d4))/0xc)+parseInt(_0x3a0cb8(0x204))/0xd*(parseInt(_0x3a0cb8(0x1ed))/0xe);if(_0x43b2f7===_0x5086a0)break;else _0x54f77c['push'](_0x54f77c['shift']());}catch(_0x1f72ea){_0x54f77c['push'](_0x54f77c['shift']());}}}(a45_0x8e54,0x8e0f1));import{homedir}from'os';import{join}from'path';import{existsSync,readFileSync,writeFileSync,mkdirSync,unlinkSync}from'fs';import*as a45_0x109a07 from'node:fs';import*as a45_0x127b04 from'node:path';import{SITE_ALIASES}from'../types/index.js';import{validateSecureFilePermissions}from'../utils/file-permissions.js';import{getKeychainAPIKey,saveKeychainAPIKey,isKeychainAvailable}from'./keychain.js';import{getCachedCredential,setCachedCredential}from'./credential-cache.js';import a45_0x2e3f95 from'chalk';export function getConfigDir(){const _0x53b3c9=a45_0x4065;return process[_0x53b3c9(0x1d2)][_0x53b3c9(0x1fc)]||join(homedir(),_0x53b3c9(0x1fa),_0x53b3c9(0x1ce));}export function getConfigFile(){const _0x49cbb2=a45_0x4065;return join(getConfigDir(),_0x49cbb2(0x1e3));}export function getConfigFilePath(_0x572e73){const _0x32ffd0=a45_0x4065,_0x4afa04=getConfigDir();return _0x572e73?a45_0x127b04['join'](_0x4afa04,_0x32ffd0(0x1d6)+_0x572e73):getConfigFile();}export function getCacheDir(){const _0x6d700=a45_0x4065;return process['env']['TDX_CACHE_DIR']||join(homedir(),'.cache',_0x6d700(0x1ce));}export function getLLMProjectCacheFile(_0x468b96){const _0xd75707=a45_0x4065,_0x4c79e1=_0x468b96?'llm_default_project.'+_0x468b96:_0xd75707(0x1cd);return join(getCacheDir(),_0x4c79e1);}export function readCachedLLMProject(_0x518fe9){const _0x1fd72b=a45_0x4065;try{const _0x5783de=getLLMProjectCacheFile(_0x518fe9);if(!existsSync(_0x5783de))return null;const _0x1652ef=readFileSync(_0x5783de,_0x1fd72b(0x1fb))[_0x1fd72b(0x1e1)]();try{const _0x23fc2a=JSON[_0x1fd72b(0x210)](_0x1652ef);if(_0x23fc2a&&typeof _0x23fc2a['id']==='string'&&typeof _0x23fc2a[_0x1fd72b(0x1c8)]===_0x1fd72b(0x203))return _0x23fc2a;}catch{}return null;}catch{return null;}}export function writeCachedLLMProject(_0x45fc02,_0x3570f0,_0x433f41){const _0x5fabdb=a45_0x4065;try{const _0x42023b=getCacheDir(),_0x5180a5=getLLMProjectCacheFile(_0x433f41);!existsSync(_0x42023b)&&mkdirSync(_0x42023b,{'recursive':!![]});const _0x47f074={'name':_0x45fc02,'id':_0x3570f0};writeFileSync(_0x5180a5,JSON[_0x5fabdb(0x1fe)](_0x47f074),_0x5fabdb(0x1fb));}catch{}}export function getAccountInfoCacheFile(_0x515493){const _0x1691a9=a45_0x4065,_0x4a86ac=_0x515493?_0x1691a9(0x1f5)+_0x515493+_0x1691a9(0x205):'account_info.json';return join(getCacheDir(),_0x4a86ac);}export function readCachedAccountInfo(_0x3f633c){const _0x3512fa=a45_0x4065;try{const _0x45c5b7=getAccountInfoCacheFile(_0x3f633c);if(!existsSync(_0x45c5b7))return null;const _0x459edc=readFileSync(_0x45c5b7,_0x3512fa(0x1fb))[_0x3512fa(0x1e1)](),_0x263f4a=JSON[_0x3512fa(0x210)](_0x459edc);if(_0x263f4a&&typeof _0x263f4a[_0x3512fa(0x1e6)]===_0x3512fa(0x203)&&typeof _0x263f4a['accountId']===_0x3512fa(0x1c4))return _0x263f4a;return null;}catch{return null;}}export function writeCachedAccountInfo(_0x56a791,_0x414cf0,_0x2ed5f6){const _0x42a863=a45_0x4065;try{const _0xaac387=getCacheDir(),_0x5a66e1=getAccountInfoCacheFile(_0x2ed5f6);!existsSync(_0xaac387)&&mkdirSync(_0xaac387,{'recursive':!![]});const _0x2ab662={'site':_0x56a791,'accountId':_0x414cf0,'cachedAt':new Date()[_0x42a863(0x1ec)]()};writeFileSync(_0x5a66e1,JSON[_0x42a863(0x1fe)](_0x2ab662),_0x42a863(0x1fb));}catch{}}export function parseEnvFile(_0x102e37){const _0x44834f=a45_0x4065,_0x1ab854={};for(const _0x920dba of _0x102e37[_0x44834f(0x1c6)]('\x0a')){const _0x15525d=_0x920dba[_0x44834f(0x1e1)]();if(!_0x15525d||_0x15525d[_0x44834f(0x1e2)]('#'))continue;const _0x4064a3=_0x15525d[_0x44834f(0x1e5)](/^([^=]+)=(.*)$/);if(_0x4064a3){const _0x4b847d=_0x4064a3[0x1][_0x44834f(0x1e1)]();let _0x15d32b=_0x4064a3[0x2][_0x44834f(0x1e1)]();(_0x15d32b['startsWith']('\x22')&&_0x15d32b['endsWith']('\x22')||_0x15d32b['startsWith']('\x27')&&_0x15d32b[_0x44834f(0x1f1)]('\x27'))&&(_0x15d32b=_0x15d32b[_0x44834f(0x1c7)](0x1,-0x1)),_0x1ab854[_0x4b847d]=_0x15d32b;}}return _0x1ab854;}export function readUserConfig(){const _0x4628ba=a45_0x4065,_0x36a4de=getConfigFile();if(!existsSync(_0x36a4de))return{};try{const _0x47e870=readFileSync(_0x36a4de,_0x4628ba(0x1fb));return parseEnvFile(_0x47e870);}catch(_0x1a3dfb){return console[_0x4628ba(0x1c3)](_0x4628ba(0x1ea)+_0x36a4de+':',_0x1a3dfb),{};}}export function resolveSite(_0x501b07){const _0x235a1e=a45_0x4065,_0x445f0a=['us01',_0x235a1e(0x1f9),_0x235a1e(0x1ff),_0x235a1e(0x209),_0x235a1e(0x1f2),_0x235a1e(0x1c9),_0x235a1e(0x1cf),_0x235a1e(0x1e8),_0x235a1e(0x206),'stg-ap03'];if(_0x445f0a[_0x235a1e(0x201)](_0x501b07))return _0x501b07;if(_0x501b07 in SITE_ALIASES)return SITE_ALIASES[_0x501b07];return console['warn']('Warning:\x20Unknown\x20site\x20\x27'+_0x501b07+'\x27,\x20defaulting\x20to\x20us01'),_0x235a1e(0x1f4);}let cachedUserConfig=null;export function loadUserConfigOnce(){return cachedUserConfig===null&&(cachedUserConfig=readUserConfig()),cachedUserConfig;}export function clearConfigCache(){cachedUserConfig=null;}export function getAPIKey(_0x49653c,_0x2d6737){const _0x1fcfa9=a45_0x4065,_0x3d7046=_0x2d6737||getActiveProfileName();if(_0x3d7046){const _0x36afe5=_0x1fcfa9(0x208)+normalizeProfileForEnvVar(_0x3d7046);if(process[_0x1fcfa9(0x1d2)][_0x36afe5])return process[_0x1fcfa9(0x1d2)][_0x36afe5];}if(process['env']['TDX_API_KEY'])return process['env'][_0x1fcfa9(0x200)];if(process[_0x1fcfa9(0x1d2)][_0x1fcfa9(0x1f7)])return process[_0x1fcfa9(0x1d2)][_0x1fcfa9(0x1f7)];const _0x454f1b=_0x49653c[_0x1fcfa9(0x1ca)]()[_0x1fcfa9(0x20f)](/-/g,'_'),_0x36a47b=_0x1fcfa9(0x20a)+_0x454f1b;if(_0x3d7046){const _0x5e9752=loadProfileEnv(_0x3d7046);if(_0x5e9752){if(_0x5e9752[_0x36a47b])return _0x5e9752[_0x36a47b];if(_0x5e9752[_0x1fcfa9(0x1f7)])return _0x5e9752[_0x1fcfa9(0x1f7)];}}const _0x3e6f09=loadUserConfigOnce();if(_0x3e6f09[_0x36a47b])return _0x3e6f09[_0x36a47b];if(_0x3e6f09[_0x1fcfa9(0x1f7)])return _0x3e6f09[_0x1fcfa9(0x1f7)];return undefined;}export function normalizeProfileForEnvVar(_0x456f3){const _0x46d8dc=a45_0x4065;return _0x456f3['toUpperCase']()[_0x46d8dc(0x20f)](/[^A-Z0-9]/g,'_');}export async function resolveAPIKeyAsync(_0x2904a0,_0x4cd781){const _0xc66ca0=a45_0x4065,_0x389710=_0x4cd781||getActiveProfileName()||undefined;if(_0x389710){const _0x84d73=_0xc66ca0(0x208)+normalizeProfileForEnvVar(_0x389710);if(process['env'][_0x84d73])return{'apiKey':process[_0xc66ca0(0x1d2)][_0x84d73],'source':_0x84d73+'\x20env\x20var','isDeprecated':![]};const _0x278015=getCachedCredential(_0x2904a0,_0x389710);if(_0x278015)return{'apiKey':_0x278015,'source':_0xc66ca0(0x1d3)+_0x389710+')','isDeprecated':![]};const _0x357b02=await getKeychainAPIKey(_0x389710);if(_0x357b02)return setCachedCredential(_0x357b02,_0x2904a0,_0x389710),{'apiKey':_0x357b02,'source':_0xc66ca0(0x1d3)+_0x389710+')','isDeprecated':![]};}if(process[_0xc66ca0(0x1d2)][_0xc66ca0(0x200)])return{'apiKey':process[_0xc66ca0(0x1d2)][_0xc66ca0(0x200)],'source':_0xc66ca0(0x1d0),'isDeprecated':![]};if(!_0x389710){const _0x3054a3=getCachedCredential(_0x2904a0,undefined);if(_0x3054a3)return{'apiKey':_0x3054a3,'source':_0xc66ca0(0x1f3),'isDeprecated':![]};const _0x1b6b64=await getKeychainAPIKey(undefined);if(_0x1b6b64)return setCachedCredential(_0x1b6b64,_0x2904a0,undefined),{'apiKey':_0x1b6b64,'source':_0xc66ca0(0x1f3),'isDeprecated':![]};}if(process[_0xc66ca0(0x1d2)][_0xc66ca0(0x1f7)])return{'apiKey':process['env'][_0xc66ca0(0x1f7)],'source':_0xc66ca0(0x1fd),'isDeprecated':!![]};const _0x2fc6bb=getLegacyEnvAPIKey(_0x2904a0,_0x389710);if(_0x2fc6bb){const _0x5622fd=await isKeychainAvailable();if(_0x5622fd)try{await saveKeychainAPIKey(_0x2fc6bb,_0x389710),setCachedCredential(_0x2fc6bb,_0x2904a0,_0x389710);const _0x19437f=getConfigFilePath(_0x389710);cleanupLegacyEnvFile(_0x19437f)&&console[_0xc66ca0(0x1c3)](a45_0x2e3f95['yellow'](_0xc66ca0(0x20b)));}catch(_0x5107bf){console['warn'](a45_0x2e3f95['yellow'](_0xc66ca0(0x1eb)+_0x5107bf));}const _0x20c3f1=_0x389710?'legacy\x20.env\x20file\x20(profile:\x20'+_0x389710+')':_0xc66ca0(0x202);return{'apiKey':_0x2fc6bb,'source':_0x20c3f1,'isDeprecated':!![]};}return null;}function a45_0x8e54(){const _0x4aebd1=['⚠\x20Migrated\x20API\x20key\x20from\x20.env\x20to\x20secure\x20keychain\x20storage','27240QBDpch','\x20\x20For\x20profile-specific\x20keys,\x20use\x20TDX_API_KEY_<PROFILE>\x20(e.g.,\x20','Warning:\x20Failed\x20to\x20read\x20','replace','parse','warn','number','isDeprecated','split','slice','name','dev-us01','toUpperCase','18612TuoGNB','yellow','llm_default_project','tdx','dev-eu01','TDX_API_KEY\x20env\x20var','5850152TPdTca','env','keychain\x20(profile:\x20','12SjHukF','profile','.env.','15DDbqCP','591ZvdiBK','join','52PHOILz','16452EyZEgq','existsSync','filter','Warning:\x20Failed\x20to\x20load\x20','731346eKylIQ','259rCUKSV','trim','startsWith','.env','Warning:\x20Using\x20TD_API_KEY\x20is\x20deprecated.\x20Please\x20use\x20TDX_API_KEY\x20instead.\x0a','match','site','apiKey','stg-us01','entries','Warning:\x20Failed\x20to\x20read\x20config\x20file\x20','⚠\x20Failed\x20to\x20migrate\x20API\x20key\x20to\x20keychain:\x20','toISOString','31485202mUxoJS','source','249440ctrzRR','apiKeys','endsWith','ap03','keychain','us01','account_info.','630eXPsWd','TD_API_KEY','map','jp01','.config','utf-8','TDX_CONFIG_DIR','TD_API_KEY\x20env\x20var\x20(deprecated)','stringify','eu01','TDX_API_KEY','includes','legacy\x20.env\x20file','string','13FxZNuG','.json','stg-jp01','tdx.json','TDX_API_KEY_','ap02','TD_API_KEY_'];a45_0x8e54=function(){return _0x4aebd1;};return a45_0x8e54();}export async function getAPIKeyAsync(_0x5730f9,_0x385c6f,_0x4b0343=!![]){const _0x2be38b=a45_0x4065,_0x574658=await resolveAPIKeyAsync(_0x5730f9,_0x385c6f);if(!_0x574658)return undefined;if(_0x4b0343&&_0x574658[_0x2be38b(0x1c5)]&&_0x574658[_0x2be38b(0x1ee)][_0x2be38b(0x201)](_0x2be38b(0x1f7))){const _0x22b913=_0x385c6f||getActiveProfileName()||undefined,_0x3c6add=_0x22b913?_0x2be38b(0x208)+normalizeProfileForEnvVar(_0x22b913):'TDX_API_KEY_<PROFILE>';console[_0x2be38b(0x1c3)](a45_0x2e3f95[_0x2be38b(0x1cc)](_0x2be38b(0x1e4)+(_0x2be38b(0x20d)+_0x3c6add+').')));}return _0x574658[_0x2be38b(0x1e7)];}function getLegacyEnvAPIKey(_0x118ce1,_0x3a14cd){const _0x1267ad=a45_0x4065,_0x311575=_0x118ce1[_0x1267ad(0x1ca)]()[_0x1267ad(0x20f)](/-/g,'_'),_0xcf9ed6='TD_API_KEY_'+_0x311575;if(_0x3a14cd){const _0x490c5e=loadProfileEnv(_0x3a14cd);if(_0x490c5e){if(_0x490c5e[_0xcf9ed6])return _0x490c5e[_0xcf9ed6];if(_0x490c5e[_0x1267ad(0x1f7)])return _0x490c5e['TD_API_KEY'];}}const _0x136500=loadUserConfigOnce();if(_0x136500[_0xcf9ed6])return _0x136500[_0xcf9ed6];if(_0x136500[_0x1267ad(0x1f7)])return _0x136500['TD_API_KEY'];return undefined;}function cleanupLegacyEnvFile(_0x3b9c78){const _0x5efa20=a45_0x4065;if(!existsSync(_0x3b9c78))return![];try{const _0x2ee806=readFileSync(_0x3b9c78,'utf-8'),_0x552286=_0x2ee806[_0x5efa20(0x1c6)]('\x0a'),_0x3f4328=_0x552286[_0x5efa20(0x1dd)](_0x4c8b7f=>{const _0x574696=_0x5efa20,_0xb50c1d=_0x4c8b7f[_0x574696(0x1e1)]();if(!_0xb50c1d||_0xb50c1d[_0x574696(0x1e2)]('#'))return!![];const [_0x1b48ca]=_0xb50c1d[_0x574696(0x1c6)]('=');return!_0x1b48ca['startsWith'](_0x574696(0x1f7));}),_0x19c6ef=_0x3f4328['some'](_0x46de0d=>{const _0x4ad66a=_0x5efa20,_0x5afd20=_0x46de0d[_0x4ad66a(0x1e1)]();return _0x5afd20&&!_0x5afd20[_0x4ad66a(0x1e2)]('#');});if(!_0x19c6ef)return unlinkSync(_0x3b9c78),!![];return writeFileSync(_0x3b9c78,_0x3f4328[_0x5efa20(0x1d9)]('\x0a'),{'mode':0x180}),!![];}catch{return![];}}function loadProfileEnv(_0x59c756){const _0x4be1cd=a45_0x4065,_0x4355b1=a45_0x127b04[_0x4be1cd(0x1d9)](getConfigDir(),'.env.'+_0x59c756);if(a45_0x109a07[_0x4be1cd(0x1dc)](_0x4355b1)){validateSecureFilePermissions(_0x4355b1);try{const _0x186c88=a45_0x109a07['readFileSync'](_0x4355b1,_0x4be1cd(0x1fb));return parseEnvFile(_0x186c88);}catch(_0x30cb22){console['warn']('Warning:\x20Failed\x20to\x20load\x20'+_0x4355b1+':\x20'+_0x30cb22);}}const _0x244333=a45_0x127b04[_0x4be1cd(0x1d9)](getConfigDir(),'profiles',_0x59c756,_0x4be1cd(0x1e3));if(a45_0x109a07[_0x4be1cd(0x1dc)](_0x244333)){validateSecureFilePermissions(_0x244333);try{const _0x23bbfc=a45_0x109a07['readFileSync'](_0x244333,_0x4be1cd(0x1fb));return parseEnvFile(_0x23bbfc);}catch(_0x2cc1e4){return console['warn'](_0x4be1cd(0x1de)+_0x244333+':\x20'+_0x2cc1e4),null;}}return null;}function getActiveProfileName(){const _0x15cbe3=a45_0x4065,_0x2b96fb=a45_0x127b04[_0x15cbe3(0x1d9)](getConfigDir(),_0x15cbe3(0x207));if(!a45_0x109a07[_0x15cbe3(0x1dc)](_0x2b96fb))return null;try{const _0x550f86=a45_0x109a07['readFileSync'](_0x2b96fb,_0x15cbe3(0x1fb)),_0x70e5ac=JSON[_0x15cbe3(0x210)](_0x550f86);return _0x70e5ac[_0x15cbe3(0x1d5)]||null;}catch{return null;}}function a45_0x4065(_0x223cbe,_0x533849){_0x223cbe=_0x223cbe-0x1c3;const _0x8e547=a45_0x8e54();let _0x406589=_0x8e547[_0x223cbe];return _0x406589;}export function saveAPIKey(_0x4f3609,_0x1b0473,_0x462d3a){const _0x3b4972=a45_0x4065,_0x1f7083=getConfigDir(),_0x5f480e=getConfigFilePath(_0x462d3a);!existsSync(_0x1f7083)&&mkdirSync(_0x1f7083,{'recursive':!![],'mode':0x1c0});let _0x5a455f={};if(existsSync(_0x5f480e))try{const _0x81c501=readFileSync(_0x5f480e,'utf-8');_0x5a455f=parseEnvFile(_0x81c501);}catch(_0x429e62){console[_0x3b4972(0x1c3)](_0x3b4972(0x20e)+_0x5f480e+':',_0x429e62);}const _0x48b38c=_0x4f3609[_0x3b4972(0x1ca)]()[_0x3b4972(0x20f)](/-/g,'_');_0x5a455f[_0x3b4972(0x20a)+_0x48b38c]=_0x1b0473;const _0x6da4d1=Object[_0x3b4972(0x1e9)](_0x5a455f)[_0x3b4972(0x1f8)](([_0x398e82,_0x451c91])=>_0x398e82+'='+_0x451c91);writeFileSync(_0x5f480e,_0x6da4d1[_0x3b4972(0x1d9)]('\x0a')+'\x0a',{'mode':0x180});}export async function saveAPIKeyAsync(_0x59a026,_0x294493,_0x5bf292){const _0xc7ad3=a45_0x4065;await saveKeychainAPIKey(_0x59a026,_0x5bf292),setCachedCredential(_0x59a026,_0x294493,_0x5bf292);const _0xcc7d4d=getConfigFilePath(_0x5bf292);cleanupLegacyEnvFile(_0xcc7d4d)&&console['warn'](a45_0x2e3f95[_0xc7ad3(0x1cc)]('⚠\x20Cleaned\x20up\x20API\x20keys\x20from\x20legacy\x20.env\x20file'));}export function loadConfig(){const _0x1dfceb=a45_0x4065,_0x17cf43={'apiKeys':{},'defaultSite':'us01'},_0x1e039d=[_0x1dfceb(0x1f4),_0x1dfceb(0x1f9),_0x1dfceb(0x1ff),_0x1dfceb(0x209),_0x1dfceb(0x1f2),_0x1dfceb(0x1c9),'dev-eu01',_0x1dfceb(0x1e8),_0x1dfceb(0x206),'stg-ap03'];for(const _0x4cb5e4 of _0x1e039d){const _0x390c13=getAPIKey(_0x4cb5e4);_0x390c13&&(_0x17cf43[_0x1dfceb(0x1f0)][_0x4cb5e4]=_0x390c13);}return _0x17cf43;}
@@ -1 +1 @@
1
- function a46_0x45b8(){const _0x395507=['connections','6324590xkAmzK','stringify','46554ohzjvD','parse','39GNQkxu','475021ydJHpy','1908186VsiTOe','12023330fMEYON','9269144fJvCJs','utf-8','7028073bjZJIA','4tWpoTY','connections-','now','.json','7znEQWe'];a46_0x45b8=function(){return _0x395507;};return a46_0x45b8();}(function(_0x4810fe,_0x80fb13){const _0x641c54=a46_0x3a47,_0x4e2390=_0x4810fe();while(!![]){try{const _0x43caff=-parseInt(_0x641c54(0x1d8))/0x1+-parseInt(_0x641c54(0x1d5))/0x2*(-parseInt(_0x641c54(0x1d7))/0x3)+-parseInt(_0x641c54(0x1cd))/0x4*(-parseInt(_0x641c54(0x1d3))/0x5)+parseInt(_0x641c54(0x1d9))/0x6+-parseInt(_0x641c54(0x1d1))/0x7*(parseInt(_0x641c54(0x1db))/0x8)+-parseInt(_0x641c54(0x1cc))/0x9+parseInt(_0x641c54(0x1da))/0xa;if(_0x43caff===_0x80fb13)break;else _0x4e2390['push'](_0x4e2390['shift']());}catch(_0x18f56b){_0x4e2390['push'](_0x4e2390['shift']());}}}(a46_0x45b8,0xa462a));function a46_0x3a47(_0x3134c9,_0x529739){_0x3134c9=_0x3134c9-0x1cc;const _0x45b8e9=a46_0x45b8();let _0x3a471b=_0x45b8e9[_0x3134c9];return _0x3a471b;}import{existsSync,mkdirSync,readFileSync,writeFileSync,unlinkSync}from'fs';import{join}from'path';import{getCacheDir}from'./config.js';function getCacheFilePath(_0x547cf1){const _0xbd7cf1=a46_0x3a47,_0x4d416d=_0x547cf1||'default';return join(getCacheDir(),_0xbd7cf1(0x1ce)+_0x4d416d+_0xbd7cf1(0x1d0));}export function loadCachedConnections(_0x238004){const _0x49c1b2=a46_0x3a47,_0x23fd7b=getCacheFilePath(_0x238004);if(!existsSync(_0x23fd7b))return null;try{const _0x4f8edc=readFileSync(_0x23fd7b,_0x49c1b2(0x1dc)),_0x14644d=JSON[_0x49c1b2(0x1d6)](_0x4f8edc);return _0x14644d[_0x49c1b2(0x1d2)];}catch{return null;}}export function saveCachedConnections(_0x3f4714,_0x5cf131){const _0x4de7c5=a46_0x3a47,_0x35a120=getCacheDir();!existsSync(_0x35a120)&&mkdirSync(_0x35a120,{'recursive':!![]});const _0x5f0a2c=getCacheFilePath(_0x3f4714),_0x1e11a7={'connections':_0x5cf131,'cachedAt':Date[_0x4de7c5(0x1cf)]()};writeFileSync(_0x5f0a2c,JSON[_0x4de7c5(0x1d4)](_0x1e11a7,null,0x2),_0x4de7c5(0x1dc));}export function clearConnectionCache(_0x15bb60){const _0x376878=getCacheFilePath(_0x15bb60);if(existsSync(_0x376878))try{unlinkSync(_0x376878);}catch{}}
1
+ (function(_0xdd47dd,_0x59bb3a){const _0x390973=a46_0x2489,_0x19271c=_0xdd47dd();while(!![]){try{const _0x54847a=-parseInt(_0x390973(0x10d))/0x1*(-parseInt(_0x390973(0x103))/0x2)+-parseInt(_0x390973(0x10e))/0x3*(-parseInt(_0x390973(0x105))/0x4)+parseInt(_0x390973(0x10c))/0x5*(-parseInt(_0x390973(0x111))/0x6)+parseInt(_0x390973(0x101))/0x7*(-parseInt(_0x390973(0xff))/0x8)+-parseInt(_0x390973(0x110))/0x9*(-parseInt(_0x390973(0x109))/0xa)+-parseInt(_0x390973(0x104))/0xb*(parseInt(_0x390973(0xfe))/0xc)+-parseInt(_0x390973(0xfd))/0xd*(-parseInt(_0x390973(0x102))/0xe);if(_0x54847a===_0x59bb3a)break;else _0x19271c['push'](_0x19271c['shift']());}catch(_0x4c29ab){_0x19271c['push'](_0x19271c['shift']());}}}(a46_0x507a,0x4a0c2));import{existsSync,mkdirSync,readFileSync,writeFileSync,unlinkSync}from'fs';import{join}from'path';import{getCacheDir}from'./config.js';function a46_0x507a(){const _0x5e30fc=['12jVFZux','213176MyqmpJ','connections-','119wWArkX','7629538qnPiwb','93418tpWJDb','5481509RwmJGn','172vaYVHb','now','utf-8','default','130lrhPWf','connections','.json','10dQfKlL','5WFsWFE','19161elGThr','parse','369765zzKVaX','997926uKYtvZ','13IdpmsX'];a46_0x507a=function(){return _0x5e30fc;};return a46_0x507a();}function a46_0x2489(_0x11c91f,_0x46c9fe){_0x11c91f=_0x11c91f-0xfd;const _0x507ae6=a46_0x507a();let _0x248923=_0x507ae6[_0x11c91f];return _0x248923;}function getCacheFilePath(_0x58d7e7){const _0x504c0a=a46_0x2489,_0x1267a1=_0x58d7e7||_0x504c0a(0x108);return join(getCacheDir(),_0x504c0a(0x100)+_0x1267a1+_0x504c0a(0x10b));}export function loadCachedConnections(_0x288a15){const _0x4d252a=a46_0x2489,_0x114c94=getCacheFilePath(_0x288a15);if(!existsSync(_0x114c94))return null;try{const _0x185d63=readFileSync(_0x114c94,_0x4d252a(0x107)),_0x53a4ee=JSON[_0x4d252a(0x10f)](_0x185d63);return _0x53a4ee[_0x4d252a(0x10a)];}catch{return null;}}export function saveCachedConnections(_0x52fb54,_0x56e4dc){const _0x8c3b9a=a46_0x2489,_0x46a938=getCacheDir();!existsSync(_0x46a938)&&mkdirSync(_0x46a938,{'recursive':!![]});const _0x118295=getCacheFilePath(_0x52fb54),_0x462923={'connections':_0x56e4dc,'cachedAt':Date[_0x8c3b9a(0x106)]()};writeFileSync(_0x118295,JSON['stringify'](_0x462923,null,0x2),'utf-8');}export function clearConnectionCache(_0x42e445){const _0x3c11d0=getCacheFilePath(_0x42e445);if(existsSync(_0x3c11d0))try{unlinkSync(_0x3c11d0);}catch{}}
@@ -1 +1 @@
1
- (function(_0x51a977,_0x222714){const _0x23a81a=a47_0xe08d,_0x3e38c5=_0x51a977();while(!![]){try{const _0x240923=parseInt(_0x23a81a(0x17e))/0x1+parseInt(_0x23a81a(0x180))/0x2+parseInt(_0x23a81a(0x176))/0x3*(-parseInt(_0x23a81a(0x179))/0x4)+parseInt(_0x23a81a(0x173))/0x5+parseInt(_0x23a81a(0x17c))/0x6+parseInt(_0x23a81a(0x175))/0x7+parseInt(_0x23a81a(0x178))/0x8*(-parseInt(_0x23a81a(0x17f))/0x9);if(_0x240923===_0x222714)break;else _0x3e38c5['push'](_0x3e38c5['shift']());}catch(_0x479bb6){_0x3e38c5['push'](_0x3e38c5['shift']());}}}(a47_0x5de4,0x3c5ae));const cache=new Map(),CACHE_TTL_MS=0x5*0x3c*0x3e8;function a47_0x5de4(){const _0x19a3df=['60RQXqZL','__default_profile__','loadedAt','2438502PIidjg','now','45413XOZgmi','19233OwWEZf','716330PEMDQN','clear','set','1926220ZBkRDb','__default_site__','2967307eDlEay','59403qrPKYr','delete','4024FCAmHl'];a47_0x5de4=function(){return _0x19a3df;};return a47_0x5de4();}function getCacheKey(_0x5c4e37,_0x570d40){const _0x1ce5c9=a47_0xe08d,_0x36f6bc=_0x5c4e37||_0x1ce5c9(0x174),_0x50364e=_0x570d40||_0x1ce5c9(0x17a);return _0x36f6bc+':'+_0x50364e;}export function getCachedCredential(_0x3cb829,_0x28d144){const _0xeaf6f8=a47_0xe08d,_0x546e19=getCacheKey(_0x3cb829,_0x28d144),_0x5acb42=cache['get'](_0x546e19);if(!_0x5acb42)return null;if(Date['now']()-_0x5acb42[_0xeaf6f8(0x17b)]>CACHE_TTL_MS)return cache[_0xeaf6f8(0x177)](_0x546e19),null;return _0x5acb42['apiKey'];}export function setCachedCredential(_0xecb2b2,_0x1ac7a9,_0x32369c){const _0x4d209b=a47_0xe08d,_0x34a13a=getCacheKey(_0x1ac7a9,_0x32369c);cache[_0x4d209b(0x182)](_0x34a13a,{'apiKey':_0xecb2b2,'loadedAt':Date[_0x4d209b(0x17d)]()});}function a47_0xe08d(_0x339863,_0x382187){_0x339863=_0x339863-0x173;const _0x5de4ff=a47_0x5de4();let _0xe08d27=_0x5de4ff[_0x339863];return _0xe08d27;}export function clearCredentialCache(){const _0x156cae=a47_0xe08d;cache[_0x156cae(0x181)]();}export function clearCachedCredential(_0x54e70a,_0x5d00de){const _0x1ad3a1=a47_0xe08d,_0x43226c=getCacheKey(_0x54e70a,_0x5d00de);cache[_0x1ad3a1(0x177)](_0x43226c);}
1
+ (function(_0x58d48a,_0xdf5120){const _0xa4d767=a47_0x5793,_0x212eb3=_0x58d48a();while(!![]){try{const _0x34dd0c=-parseInt(_0xa4d767(0x141))/0x1*(parseInt(_0xa4d767(0x13d))/0x2)+parseInt(_0xa4d767(0x13e))/0x3+-parseInt(_0xa4d767(0x138))/0x4*(parseInt(_0xa4d767(0x135))/0x5)+parseInt(_0xa4d767(0x132))/0x6*(-parseInt(_0xa4d767(0x144))/0x7)+parseInt(_0xa4d767(0x13f))/0x8+parseInt(_0xa4d767(0x137))/0x9+parseInt(_0xa4d767(0x143))/0xa*(parseInt(_0xa4d767(0x13b))/0xb);if(_0x34dd0c===_0xdf5120)break;else _0x212eb3['push'](_0x212eb3['shift']());}catch(_0x167e59){_0x212eb3['push'](_0x212eb3['shift']());}}}(a47_0x2a7d,0xdcd61));const cache=new Map(),CACHE_TTL_MS=0x5*0x3c*0x3e8;function getCacheKey(_0x3c38ca,_0x585796){const _0x2aa1da=a47_0x5793,_0xabbe6=_0x3c38ca||_0x2aa1da(0x139),_0x174446=_0x585796||_0x2aa1da(0x131);return _0xabbe6+':'+_0x174446;}function a47_0x2a7d(){const _0x41aaee=['delete','256986myTzuU','set','10nEIanA','160195ecyxpD','__default_profile__','204tFWGyk','apiKey','now','165XiEHuL','clear','16068276mQhAQT','118212tOWEQD','__default_site__','get','671473rmCoSS','loadedAt','10gRVTVa','2867628BSBRmX','9124248suRasR'];a47_0x2a7d=function(){return _0x41aaee;};return a47_0x2a7d();}function a47_0x5793(_0x233024,_0x2f5ee2){_0x233024=_0x233024-0x131;const _0x2a7db0=a47_0x2a7d();let _0x57936f=_0x2a7db0[_0x233024];return _0x57936f;}export function getCachedCredential(_0x2ef48d,_0x4d8ea8){const _0x2d15df=a47_0x5793,_0xeb61e2=getCacheKey(_0x2ef48d,_0x4d8ea8),_0x1546e6=cache[_0x2d15df(0x13a)](_0xeb61e2);if(!_0x1546e6)return null;if(Date['now']()-_0x1546e6[_0x2d15df(0x13c)]>CACHE_TTL_MS)return cache[_0x2d15df(0x140)](_0xeb61e2),null;return _0x1546e6[_0x2d15df(0x133)];}export function setCachedCredential(_0x4a429e,_0x36f435,_0x30fe69){const _0x4c7fc6=a47_0x5793,_0x5ffa17=getCacheKey(_0x36f435,_0x30fe69);cache[_0x4c7fc6(0x142)](_0x5ffa17,{'apiKey':_0x4a429e,'loadedAt':Date[_0x4c7fc6(0x134)]()});}export function clearCredentialCache(){const _0x4c0128=a47_0x5793;cache[_0x4c0128(0x136)]();}export function clearCachedCredential(_0xa35f71,_0xccf6c){const _0x4798d8=a47_0x5793,_0x5bd2b5=getCacheKey(_0xa35f71,_0xccf6c);cache[_0x4798d8(0x140)](_0x5bd2b5);}