@x-9lab/xlab 1.0.4 → 1.0.5
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.
|
@@ -1,44 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* 状态详细信息
|
|
3
3
|
*/
|
|
4
|
-
declare const CODE_DETAIL:
|
|
5
|
-
FAIL: {
|
|
6
|
-
errorcode: number;
|
|
7
|
-
msg: string;
|
|
8
|
-
};
|
|
9
|
-
SUCCESS: {
|
|
10
|
-
errorcode: number;
|
|
11
|
-
msg: string;
|
|
12
|
-
};
|
|
13
|
-
BUSY: {
|
|
14
|
-
errorcode: number;
|
|
15
|
-
msg: string;
|
|
16
|
-
};
|
|
17
|
-
WRONG_PARAMETER: {
|
|
18
|
-
errorcode: number;
|
|
19
|
-
msg: string;
|
|
20
|
-
};
|
|
21
|
-
NOT_FOUND: {
|
|
22
|
-
errorcode: number;
|
|
23
|
-
msg: string;
|
|
24
|
-
};
|
|
25
|
-
PERMISSION_DENIED: {
|
|
26
|
-
errorcode: number;
|
|
27
|
-
msg: string;
|
|
28
|
-
};
|
|
29
|
-
SERVER_BUSY: {
|
|
30
|
-
errorcode: number;
|
|
31
|
-
msg: string;
|
|
32
|
-
};
|
|
33
|
-
SERVER_TIMEOUT: {
|
|
34
|
-
errorcode: number;
|
|
35
|
-
msg: string;
|
|
36
|
-
};
|
|
37
|
-
UNCHECK_ERROR: {
|
|
38
|
-
errorcode: number;
|
|
39
|
-
msg: string;
|
|
40
|
-
};
|
|
41
|
-
};
|
|
4
|
+
declare const CODE_DETAIL: XLab.ICodeDetail;
|
|
42
5
|
/**
|
|
43
6
|
* 根据状态码获取错误定义信息
|
|
44
7
|
* @param code 状态码
|
|
@@ -72,88 +35,14 @@ export { getReturnCode };
|
|
|
72
35
|
* 获取错误代码
|
|
73
36
|
* @return 错误代码
|
|
74
37
|
*/
|
|
75
|
-
declare function getCodeDetail():
|
|
76
|
-
FAIL: {
|
|
77
|
-
errorcode: number;
|
|
78
|
-
msg: string;
|
|
79
|
-
};
|
|
80
|
-
SUCCESS: {
|
|
81
|
-
errorcode: number;
|
|
82
|
-
msg: string;
|
|
83
|
-
};
|
|
84
|
-
BUSY: {
|
|
85
|
-
errorcode: number;
|
|
86
|
-
msg: string;
|
|
87
|
-
};
|
|
88
|
-
WRONG_PARAMETER: {
|
|
89
|
-
errorcode: number;
|
|
90
|
-
msg: string;
|
|
91
|
-
};
|
|
92
|
-
NOT_FOUND: {
|
|
93
|
-
errorcode: number;
|
|
94
|
-
msg: string;
|
|
95
|
-
};
|
|
96
|
-
PERMISSION_DENIED: {
|
|
97
|
-
errorcode: number;
|
|
98
|
-
msg: string;
|
|
99
|
-
};
|
|
100
|
-
SERVER_BUSY: {
|
|
101
|
-
errorcode: number;
|
|
102
|
-
msg: string;
|
|
103
|
-
};
|
|
104
|
-
SERVER_TIMEOUT: {
|
|
105
|
-
errorcode: number;
|
|
106
|
-
msg: string;
|
|
107
|
-
};
|
|
108
|
-
UNCHECK_ERROR: {
|
|
109
|
-
errorcode: number;
|
|
110
|
-
msg: string;
|
|
111
|
-
};
|
|
112
|
-
};
|
|
38
|
+
declare function getCodeDetail(): XLab.ICodeDetail;
|
|
113
39
|
export { getCodeDetail };
|
|
114
40
|
/**
|
|
115
41
|
* 设置新的错误代码
|
|
116
42
|
* @param data 新的错误代码数据
|
|
117
43
|
*/
|
|
118
|
-
declare function set(data: XLab.
|
|
44
|
+
declare function set(data: Record<string, XLab.ICodeItem>): void;
|
|
119
45
|
export { set };
|
|
120
46
|
/**错误类型对象 */
|
|
121
|
-
declare const ErrorTypes:
|
|
122
|
-
FAIL: {
|
|
123
|
-
errorcode: number;
|
|
124
|
-
msg: string;
|
|
125
|
-
};
|
|
126
|
-
SUCCESS: {
|
|
127
|
-
errorcode: number;
|
|
128
|
-
msg: string;
|
|
129
|
-
};
|
|
130
|
-
BUSY: {
|
|
131
|
-
errorcode: number;
|
|
132
|
-
msg: string;
|
|
133
|
-
};
|
|
134
|
-
WRONG_PARAMETER: {
|
|
135
|
-
errorcode: number;
|
|
136
|
-
msg: string;
|
|
137
|
-
};
|
|
138
|
-
NOT_FOUND: {
|
|
139
|
-
errorcode: number;
|
|
140
|
-
msg: string;
|
|
141
|
-
};
|
|
142
|
-
PERMISSION_DENIED: {
|
|
143
|
-
errorcode: number;
|
|
144
|
-
msg: string;
|
|
145
|
-
};
|
|
146
|
-
SERVER_BUSY: {
|
|
147
|
-
errorcode: number;
|
|
148
|
-
msg: string;
|
|
149
|
-
};
|
|
150
|
-
SERVER_TIMEOUT: {
|
|
151
|
-
errorcode: number;
|
|
152
|
-
msg: string;
|
|
153
|
-
};
|
|
154
|
-
UNCHECK_ERROR: {
|
|
155
|
-
errorcode: number;
|
|
156
|
-
msg: string;
|
|
157
|
-
};
|
|
158
|
-
};
|
|
47
|
+
declare const ErrorTypes: XLab.ICodeDetail;
|
|
159
48
|
export { ErrorTypes };
|
package/@types/global.d.ts
CHANGED
|
@@ -163,7 +163,30 @@ declare global {
|
|
|
163
163
|
msg: string;
|
|
164
164
|
}
|
|
165
165
|
/**业务错误定义 */
|
|
166
|
-
|
|
166
|
+
interface ICodeDetail {
|
|
167
|
+
/**
|
|
168
|
+
操作失败
|
|
169
|
+
|
|
170
|
+
作为任何未定义失败的默认返回
|
|
171
|
+
*/
|
|
172
|
+
FAIL: ICodeItem;
|
|
173
|
+
/**操作成功 */
|
|
174
|
+
SUCCESS: ICodeItem;
|
|
175
|
+
/**业务繁忙 */
|
|
176
|
+
BUSY: ICodeItem;
|
|
177
|
+
/**参数错误 */
|
|
178
|
+
WRONG_PARAMETER: ICodeItem;
|
|
179
|
+
/**数据不存在 */
|
|
180
|
+
NOT_FOUND: ICodeItem;
|
|
181
|
+
/**没有权限 */
|
|
182
|
+
PERMISSION_DENIED: ICodeItem;
|
|
183
|
+
/**服务繁忙 */
|
|
184
|
+
SERVER_BUSY: ICodeItem;
|
|
185
|
+
/**服务超时 */
|
|
186
|
+
SERVER_TIMEOUT: ICodeItem;
|
|
187
|
+
/**未知错误 */
|
|
188
|
+
UNCHECK_ERROR: ICodeItem;
|
|
189
|
+
}
|
|
167
190
|
/**模块配置 */
|
|
168
191
|
interface XConfig {
|
|
169
192
|
/**watch 模式配置 */
|