@meet-im/lxcli 0.0.10 → 0.0.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.
@@ -31,7 +31,7 @@ export async function jsonRpcCall(gateway, method, params, pat) {
31
31
  const response = result.data;
32
32
  // JSON-RPC 层错误
33
33
  if (response.error) {
34
- outputCliError('NETWORK_ERROR', response.error.message, {
34
+ outputCliError('API_ERROR', response.error.message, {
35
35
  code: response.error.code,
36
36
  data: response.error.data,
37
37
  requestId,
@@ -41,7 +41,7 @@ export async function jsonRpcCall(gateway, method, params, pat) {
41
41
  return undefined;
42
42
  }
43
43
  if (response.result === undefined) {
44
- outputCliError('NETWORK_ERROR', 'No result returned from Kanboard API', {
44
+ outputCliError('API_ERROR', 'No result returned from Kanboard API', {
45
45
  method,
46
46
  params,
47
47
  requestId,
@@ -62,8 +62,13 @@ export declare const CLI_ERROR_CODES: {
62
62
  readonly reason: "networkError";
63
63
  readonly exitCode: 5;
64
64
  };
65
- readonly UPGRADE_CHECK_FAILED: {
65
+ readonly API_ERROR: {
66
66
  readonly code: 50002;
67
+ readonly reason: "apiError";
68
+ readonly exitCode: 1;
69
+ };
70
+ readonly UPGRADE_CHECK_FAILED: {
71
+ readonly code: 50003;
67
72
  readonly reason: "upgradeCheckFailed";
68
73
  readonly exitCode: 5;
69
74
  };
@@ -111,6 +116,10 @@ export declare function getErrorMeta(key: CliErrorKey): {
111
116
  readonly exitCode: 5;
112
117
  } | {
113
118
  readonly code: 50002;
119
+ readonly reason: "apiError";
120
+ readonly exitCode: 1;
121
+ } | {
122
+ readonly code: 50003;
114
123
  readonly reason: "upgradeCheckFailed";
115
124
  readonly exitCode: 5;
116
125
  };
@@ -23,7 +23,8 @@ export const CLI_ERROR_CODES = {
23
23
  CONFIG_READ_ERROR: { code: 40001, reason: 'configReadError', exitCode: CLI_EXIT_CODES.INTERNAL },
24
24
  CONFIG_WRITE_ERROR: { code: 40002, reason: 'configWriteError', exitCode: CLI_EXIT_CODES.INTERNAL },
25
25
  NETWORK_ERROR: { code: 50001, reason: 'networkError', exitCode: CLI_EXIT_CODES.INTERNAL },
26
- UPGRADE_CHECK_FAILED: { code: 50002, reason: 'upgradeCheckFailed', exitCode: CLI_EXIT_CODES.INTERNAL },
26
+ API_ERROR: { code: 50002, reason: 'apiError', exitCode: CLI_EXIT_CODES.GENERAL },
27
+ UPGRADE_CHECK_FAILED: { code: 50003, reason: 'upgradeCheckFailed', exitCode: CLI_EXIT_CODES.INTERNAL },
27
28
  };
28
29
  export function getErrorMeta(key) {
29
30
  return CLI_ERROR_CODES[key];
package/dist/index.js CHANGED
@@ -46,7 +46,7 @@ export function normalizeCliArgv(argv) {
46
46
  program
47
47
  .name('lxcli')
48
48
  .description('连续科技命令行工具')
49
- .version(pkg.version);
49
+ .version(pkg.version, '-v, --version');
50
50
  // 无子命令时显示帮助
51
51
  program.action(() => {
52
52
  program.outputHelp();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@meet-im/lxcli",
3
- "version": "0.0.10",
3
+ "version": "0.0.11",
4
4
  "description": "连续科技命令行工具",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",