@ttmg/cli 0.3.5 → 0.3.6-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -6536,6 +6536,21 @@ async function request({ url, method, data, headers, params, }) {
6536
6536
  const config = getTTMGRC();
6537
6537
  const cookie = config?.cookie;
6538
6538
  const proxyConfig = getAxiosProxyConfig();
6539
+ // 打印请求信息
6540
+ console.log('\n========== API Request ==========');
6541
+ console.log('URL:', url);
6542
+ console.log('Method:', method);
6543
+ console.log('Headers:', JSON.stringify({
6544
+ Cookie: cookie,
6545
+ ...(headers || {}),
6546
+ }, null, 2));
6547
+ if (params) {
6548
+ console.log('Query Params:', JSON.stringify(params, null, 2));
6549
+ }
6550
+ if (data) {
6551
+ console.log('Request Body:', JSON.stringify(data, null, 2));
6552
+ }
6553
+ console.log('=================================\n');
6539
6554
  try {
6540
6555
  const res = await axios({
6541
6556
  url,
@@ -6550,6 +6565,12 @@ async function request({ url, method, data, headers, params, }) {
6550
6565
  },
6551
6566
  ...proxyConfig,
6552
6567
  });
6568
+ // 打印响应信息
6569
+ console.log('\n========== API Response ==========');
6570
+ console.log('Status:', res?.status);
6571
+ console.log('LogID:', res?.headers['x-tt-logid']);
6572
+ console.log('Data:', JSON.stringify(res.data, null, 2));
6573
+ console.log('==================================\n');
6553
6574
  // @ts-ignore
6554
6575
  return {
6555
6576
  data: res.data,
@@ -6561,6 +6582,12 @@ async function request({ url, method, data, headers, params, }) {
6561
6582
  };
6562
6583
  }
6563
6584
  catch (err) {
6585
+ // 打印错误响应
6586
+ console.log('\n========== API Error ==========');
6587
+ console.log('Status:', err?.response?.status);
6588
+ console.log('LogID:', err?.response?.headers['x-tt-logid']);
6589
+ console.log('Error:', JSON.stringify(err?.response?.data, null, 2));
6590
+ console.log('================================\n');
6564
6591
  // @ts-ignore
6565
6592
  return {
6566
6593
  data: null,
@@ -10652,7 +10679,7 @@ async function upload({ clientKey, note = '--', dir, }) {
10652
10679
  }
10653
10680
  }
10654
10681
 
10655
- var version = "0.3.5";
10682
+ var version = "0.3.6-beta.2";
10656
10683
  var pkg = {
10657
10684
  version: version};
10658
10685