@ibiz-template/core 0.0.1-alpha.0 → 0.0.1-alpha.10
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/LICENSE +21 -0
- package/out/constant/core/core.d.ts +23 -0
- package/out/constant/core/core.d.ts.map +1 -0
- package/out/constant/core/core.js +22 -0
- package/out/constant/http-status-message/http-status-message.d.ts +5 -0
- package/out/constant/http-status-message/http-status-message.d.ts.map +1 -0
- package/out/constant/http-status-message/http-status-message.js +20 -0
- package/out/constant/index.d.ts +3 -0
- package/out/constant/index.d.ts.map +1 -0
- package/out/constant/index.js +2 -0
- package/out/context/index.d.ts +38 -3
- package/out/context/index.d.ts.map +1 -1
- package/out/context/index.js +53 -6
- package/out/environment/environment.d.ts +6 -0
- package/out/environment/environment.d.ts.map +1 -0
- package/out/environment/environment.js +11 -0
- package/out/error/http-error/http-error.d.ts +18 -0
- package/out/error/http-error/http-error.d.ts.map +1 -0
- package/out/error/http-error/http-error.js +36 -0
- package/out/error/index.d.ts +3 -0
- package/out/error/index.d.ts.map +1 -0
- package/out/error/index.js +2 -0
- package/out/error/runtime-error/runtime-error.d.ts +15 -0
- package/out/error/runtime-error/runtime-error.d.ts.map +1 -0
- package/out/error/runtime-error/runtime-error.js +15 -0
- package/out/ibizsys.d.ts +44 -0
- package/out/ibizsys.d.ts.map +1 -0
- package/out/ibizsys.js +29 -0
- package/out/index.d.ts +9 -1
- package/out/index.d.ts.map +1 -1
- package/out/index.js +9 -8
- package/out/install.d.ts +9 -0
- package/out/install.d.ts.map +1 -0
- package/out/install.js +16 -0
- package/out/interface/i-environment/i-environment.d.ts +67 -0
- package/out/interface/i-environment/i-environment.d.ts.map +1 -0
- package/out/interface/{i-context/i-context.js → i-environment/i-environment.js} +0 -0
- package/out/interface/index.d.ts +2 -1
- package/out/interface/index.d.ts.map +1 -1
- package/out/interface/org-data/org-data.d.ts +43 -0
- package/out/interface/org-data/org-data.d.ts.map +1 -0
- package/out/interface/org-data/org-data.js +1 -0
- package/out/types.d.ts +48 -0
- package/out/types.d.ts.map +1 -0
- package/out/types.js +1 -0
- package/out/utils/index.d.ts +7 -0
- package/out/utils/index.d.ts.map +1 -0
- package/out/utils/index.js +6 -0
- package/out/utils/interceptor/interceptor.d.ts +13 -0
- package/out/utils/interceptor/interceptor.d.ts.map +1 -0
- package/out/utils/interceptor/interceptor.js +33 -0
- package/out/utils/namespace/namespace.d.ts +148 -0
- package/out/utils/namespace/namespace.d.ts.map +1 -0
- package/out/utils/namespace/namespace.js +216 -0
- package/out/utils/net/http-response.d.ts +94 -0
- package/out/utils/net/http-response.d.ts.map +1 -0
- package/out/utils/net/http-response.js +53 -0
- package/out/utils/net/net.d.ts +123 -0
- package/out/utils/net/net.d.ts.map +1 -0
- package/out/utils/net/net.js +223 -0
- package/out/utils/plural/plural.d.ts +21 -0
- package/out/utils/plural/plural.d.ts.map +1 -0
- package/out/utils/plural/plural.js +25 -0
- package/out/utils/util/util.d.ts +39 -0
- package/out/utils/util/util.d.ts.map +1 -0
- package/out/utils/util/util.js +63 -0
- package/package.json +24 -6
- package/src/constant/core/core.ts +23 -0
- package/src/constant/http-status-message/http-status-message.ts +20 -0
- package/src/constant/index.ts +2 -0
- package/src/context/index.ts +112 -0
- package/src/environment/environment.ts +13 -0
- package/src/error/http-error/http-error.ts +43 -0
- package/src/error/index.ts +2 -0
- package/src/error/runtime-error/runtime-error.ts +14 -0
- package/src/ibizsys.ts +48 -0
- package/src/index.ts +10 -0
- package/src/install.ts +17 -0
- package/src/interface/i-environment/i-environment.ts +72 -0
- package/src/interface/index.ts +2 -0
- package/src/interface/org-data/org-data.ts +42 -0
- package/src/types.ts +54 -0
- package/src/utils/index.ts +6 -0
- package/src/utils/interceptor/interceptor.ts +35 -0
- package/src/utils/namespace/namespace.ts +244 -0
- package/src/utils/net/http-response.ts +113 -0
- package/src/utils/net/net.ts +254 -0
- package/src/utils/plural/plural.ts +27 -0
- package/src/utils/util/util.ts +78 -0
- package/out/interface/i-context/i-context.d.ts +0 -12
- package/out/interface/i-context/i-context.d.ts.map +0 -1
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2022 千反田丷
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 核心全局静态变量
|
|
3
|
+
*
|
|
4
|
+
* @author chitanda
|
|
5
|
+
* @date 2022-07-14 17:07:25
|
|
6
|
+
* @export
|
|
7
|
+
* @enum {number}
|
|
8
|
+
*/
|
|
9
|
+
export declare class CoreConst {
|
|
10
|
+
/**
|
|
11
|
+
* 默认模型服务标识
|
|
12
|
+
*/
|
|
13
|
+
static readonly DEFAULT_MODEL_SERVICE_TAG = "default";
|
|
14
|
+
/**
|
|
15
|
+
* 访问令牌标识
|
|
16
|
+
*
|
|
17
|
+
* @author chitanda
|
|
18
|
+
* @date 2022-07-20 15:07:28
|
|
19
|
+
* @static
|
|
20
|
+
*/
|
|
21
|
+
static readonly TOKEN = "access_token";
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=core.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../../../src/constant/core/core.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,qBAAa,SAAS;IACpB;;OAEG;IACH,MAAM,CAAC,QAAQ,CAAC,yBAAyB,aAAa;IAEtD;;;;;;OAMG;IACH,MAAM,CAAC,QAAQ,CAAC,KAAK,kBAAkB;CACxC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 核心全局静态变量
|
|
3
|
+
*
|
|
4
|
+
* @author chitanda
|
|
5
|
+
* @date 2022-07-14 17:07:25
|
|
6
|
+
* @export
|
|
7
|
+
* @enum {number}
|
|
8
|
+
*/
|
|
9
|
+
export class CoreConst {
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* 默认模型服务标识
|
|
13
|
+
*/
|
|
14
|
+
CoreConst.DEFAULT_MODEL_SERVICE_TAG = 'default';
|
|
15
|
+
/**
|
|
16
|
+
* 访问令牌标识
|
|
17
|
+
*
|
|
18
|
+
* @author chitanda
|
|
19
|
+
* @date 2022-07-20 15:07:28
|
|
20
|
+
* @static
|
|
21
|
+
*/
|
|
22
|
+
CoreConst.TOKEN = 'access_token';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"http-status-message.d.ts","sourceRoot":"","sources":["../../../src/constant/http-status-message/http-status-message.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,sBAAsB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAgBzD,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 请求状态码文本
|
|
3
|
+
*/
|
|
4
|
+
export const HttpStatusMessageConst = {
|
|
5
|
+
200: '服务器成功返回请求的数据。',
|
|
6
|
+
201: '新建或修改数据成功。',
|
|
7
|
+
202: '一个请求已经进入后台排队(异步任务)。',
|
|
8
|
+
204: '删除数据成功。',
|
|
9
|
+
400: '发出的请求有错误,服务器没有进行新建或修改数据的操作。',
|
|
10
|
+
401: '用户没有权限(令牌、用户名、密码错误)。',
|
|
11
|
+
403: '用户得到授权,但是访问是被禁止的。',
|
|
12
|
+
404: '发出的请求针对的是不存在的记录,服务器没有进行操作。',
|
|
13
|
+
406: '请求的格式不可得。',
|
|
14
|
+
410: '请求的资源被永久删除,且不会再得到的。',
|
|
15
|
+
422: '当创建一个对象时,发生一个验证错误。',
|
|
16
|
+
500: '服务器发生错误,请检查服务器。',
|
|
17
|
+
502: '网关错误。',
|
|
18
|
+
503: '服务不可用,服务器暂时过载或维护。',
|
|
19
|
+
504: '网关超时。',
|
|
20
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/constant/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,sBAAsB,EAAE,MAAM,2CAA2C,CAAC"}
|
package/out/context/index.d.ts
CHANGED
|
@@ -1,4 +1,15 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* 上下文代理处理
|
|
3
|
+
*
|
|
4
|
+
* @author chitanda
|
|
5
|
+
* @date 2022-07-14 10:07:45
|
|
6
|
+
* @class IBizContextProxyHandle
|
|
7
|
+
* @implements {ProxyHandler<IBizContext>}
|
|
8
|
+
*/
|
|
9
|
+
export declare class IBizContextProxyHandle implements ProxyHandler<IBizContext> {
|
|
10
|
+
set(target: IBizContext, p: string | symbol, value: unknown): boolean;
|
|
11
|
+
get(target: IBizContext, p: string | symbol, _receiver: unknown): unknown;
|
|
12
|
+
}
|
|
2
13
|
/**
|
|
3
14
|
* 上下文处理类
|
|
4
15
|
*
|
|
@@ -18,15 +29,39 @@ export declare class IBizContext implements IContext {
|
|
|
18
29
|
* @protected
|
|
19
30
|
* @type {(IBizContext | null)}
|
|
20
31
|
*/
|
|
21
|
-
protected
|
|
32
|
+
protected _parent: IContext | null;
|
|
22
33
|
/**
|
|
23
34
|
* Creates an instance of IBizContext.
|
|
24
35
|
*
|
|
25
36
|
* @author chitanda
|
|
26
37
|
* @date 2022-07-14 10:07:15
|
|
27
|
-
* @param {IContext} [context={}]
|
|
38
|
+
* @param {IContext} [context={}] 自身的上下文
|
|
28
39
|
* @param {IBizContext} [parent]
|
|
29
40
|
*/
|
|
30
41
|
constructor(context?: IContext, parent?: IBizContext);
|
|
42
|
+
/**
|
|
43
|
+
* 创建代理
|
|
44
|
+
*
|
|
45
|
+
* @author chitanda
|
|
46
|
+
* @date 2022-07-14 11:07:37
|
|
47
|
+
* @protected
|
|
48
|
+
* @return {*} {IBizContext}
|
|
49
|
+
*/
|
|
50
|
+
protected createProxy(): IBizContext;
|
|
51
|
+
/**
|
|
52
|
+
* 获取所有上下文参数,无多层级默认合并
|
|
53
|
+
*
|
|
54
|
+
* @author chitanda
|
|
55
|
+
* @date 2022-09-28 14:09:20
|
|
56
|
+
* @return {*} {IContext}
|
|
57
|
+
*/
|
|
58
|
+
getContext(): IContext;
|
|
59
|
+
/**
|
|
60
|
+
* 销毁上下文,避免内存泄漏
|
|
61
|
+
*
|
|
62
|
+
* @author chitanda
|
|
63
|
+
* @date 2022-07-14 11:07:45
|
|
64
|
+
*/
|
|
65
|
+
destroy(): void;
|
|
31
66
|
}
|
|
32
67
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/context/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/context/index.ts"],"names":[],"mappings":"AAOA;;;;;;;GAOG;AACH,qBAAa,sBAAuB,YAAW,YAAY,CAAC,WAAW,CAAC;IACtE,GAAG,CAAC,MAAM,EAAE,WAAW,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,OAAO;IAKrE,GAAG,CAAC,MAAM,EAAE,WAAW,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,SAAS,EAAE,OAAO,GAAG,OAAO;CAa1E;AAED;;;;;;;GAOG;AACH,qBAAa,WAAY,YAAW,QAAQ;IAsBvB,OAAO,EAAE,QAAQ;IApBpC,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,GAAG,CAAC;IAE5B;;;;;;;OAOG;IACH,SAAS,CAAC,OAAO,EAAE,QAAQ,GAAG,IAAI,CAAQ;IAE1C;;;;;;;OAOG;gBACgB,OAAO,GAAE,QAAa,EAAE,MAAM,CAAC,EAAE,WAAW;IAO/D;;;;;;;OAOG;IACH,SAAS,CAAC,WAAW,IAAI,WAAW;IAIpC;;;;;;OAMG;IACH,UAAU,IAAI,QAAQ;IAStB;;;;;OAKG;IACH,OAAO,IAAI,IAAI;CAIhB"}
|
package/out/context/index.js
CHANGED
|
@@ -1,20 +1,31 @@
|
|
|
1
|
+
/* eslint-disable no-param-reassign */
|
|
2
|
+
/* eslint-disable no-constructor-return */
|
|
3
|
+
/* eslint-disable no-underscore-dangle */
|
|
4
|
+
/* eslint-disable max-classes-per-file */
|
|
5
|
+
import { clone } from 'lodash-es';
|
|
1
6
|
/**
|
|
2
|
-
*
|
|
7
|
+
* 上下文代理处理
|
|
3
8
|
*
|
|
4
9
|
* @author chitanda
|
|
5
10
|
* @date 2022-07-14 10:07:45
|
|
6
11
|
* @class IBizContextProxyHandle
|
|
7
12
|
* @implements {ProxyHandler<IBizContext>}
|
|
8
13
|
*/
|
|
9
|
-
class IBizContextProxyHandle {
|
|
14
|
+
export class IBizContextProxyHandle {
|
|
10
15
|
set(target, p, value) {
|
|
11
|
-
|
|
16
|
+
target.context[p] = value;
|
|
17
|
+
return true;
|
|
12
18
|
}
|
|
13
19
|
get(target, p, _receiver) {
|
|
14
|
-
if (target
|
|
20
|
+
if (target[p] !== undefined) {
|
|
21
|
+
return target[p];
|
|
22
|
+
}
|
|
23
|
+
if (target.context[p] !== undefined) {
|
|
15
24
|
return target.context[p];
|
|
16
25
|
}
|
|
17
|
-
|
|
26
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
27
|
+
if (target._parent && target._parent[p] !== undefined) {
|
|
28
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
18
29
|
return target._parent[p];
|
|
19
30
|
}
|
|
20
31
|
}
|
|
@@ -33,7 +44,7 @@ export class IBizContext {
|
|
|
33
44
|
*
|
|
34
45
|
* @author chitanda
|
|
35
46
|
* @date 2022-07-14 10:07:15
|
|
36
|
-
* @param {IContext} [context={}]
|
|
47
|
+
* @param {IContext} [context={}] 自身的上下文
|
|
37
48
|
* @param {IBizContext} [parent]
|
|
38
49
|
*/
|
|
39
50
|
constructor(context = {}, parent) {
|
|
@@ -50,6 +61,42 @@ export class IBizContext {
|
|
|
50
61
|
if (parent) {
|
|
51
62
|
this._parent = parent;
|
|
52
63
|
}
|
|
64
|
+
return this.createProxy();
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* 创建代理
|
|
68
|
+
*
|
|
69
|
+
* @author chitanda
|
|
70
|
+
* @date 2022-07-14 11:07:37
|
|
71
|
+
* @protected
|
|
72
|
+
* @return {*} {IBizContext}
|
|
73
|
+
*/
|
|
74
|
+
createProxy() {
|
|
53
75
|
return new Proxy(this, new IBizContextProxyHandle());
|
|
54
76
|
}
|
|
77
|
+
/**
|
|
78
|
+
* 获取所有上下文参数,无多层级默认合并
|
|
79
|
+
*
|
|
80
|
+
* @author chitanda
|
|
81
|
+
* @date 2022-09-28 14:09:20
|
|
82
|
+
* @return {*} {IContext}
|
|
83
|
+
*/
|
|
84
|
+
getContext() {
|
|
85
|
+
if (this.parent) {
|
|
86
|
+
const ctx = this.parent.getContext();
|
|
87
|
+
Object.assign(ctx, clone(this.context));
|
|
88
|
+
return ctx;
|
|
89
|
+
}
|
|
90
|
+
return clone(this.context);
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* 销毁上下文,避免内存泄漏
|
|
94
|
+
*
|
|
95
|
+
* @author chitanda
|
|
96
|
+
* @date 2022-07-14 11:07:45
|
|
97
|
+
*/
|
|
98
|
+
destroy() {
|
|
99
|
+
this.context = {};
|
|
100
|
+
this._parent = null;
|
|
101
|
+
}
|
|
55
102
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"environment.d.ts","sourceRoot":"","sources":["../../src/environment/environment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAE5C;;GAEG;AACH,eAAO,MAAM,WAAW,EAAE,YAOzB,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { AxiosError, AxiosResponse } from 'axios';
|
|
2
|
+
/**
|
|
3
|
+
* 请求异常
|
|
4
|
+
*
|
|
5
|
+
* @author chitanda
|
|
6
|
+
* @date 2022-09-18 17:09:10
|
|
7
|
+
* @export
|
|
8
|
+
* @class HttpError
|
|
9
|
+
* @implements {Error}
|
|
10
|
+
*/
|
|
11
|
+
export declare class HttpError implements Error {
|
|
12
|
+
name: string;
|
|
13
|
+
message: string;
|
|
14
|
+
status: number;
|
|
15
|
+
response?: AxiosResponse;
|
|
16
|
+
constructor(err: AxiosError);
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=http-error.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"http-error.d.ts","sourceRoot":"","sources":["../../../src/error/http-error/http-error.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAGlD;;;;;;;;GAQG;AACH,qBAAa,SAAU,YAAW,KAAK;IACrC,IAAI,EAAE,MAAM,CAAe;IAE3B,OAAO,EAAE,MAAM,CAAC;IAEhB,MAAM,EAAE,MAAM,CAAC;IAEf,QAAQ,CAAC,EAAE,aAAa,CAAC;gBAEb,GAAG,EAAE,UAAU;CAqB5B"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { HttpStatusMessageConst } from '../../constant';
|
|
2
|
+
/**
|
|
3
|
+
* 请求异常
|
|
4
|
+
*
|
|
5
|
+
* @author chitanda
|
|
6
|
+
* @date 2022-09-18 17:09:10
|
|
7
|
+
* @export
|
|
8
|
+
* @class HttpError
|
|
9
|
+
* @implements {Error}
|
|
10
|
+
*/
|
|
11
|
+
export class HttpError {
|
|
12
|
+
constructor(err) {
|
|
13
|
+
this.name = 'HttpError';
|
|
14
|
+
const res = err.response;
|
|
15
|
+
this.response = err.response;
|
|
16
|
+
if (res) {
|
|
17
|
+
if (res.data) {
|
|
18
|
+
this.message = res.data.message;
|
|
19
|
+
}
|
|
20
|
+
else {
|
|
21
|
+
this.message = res.statusText;
|
|
22
|
+
}
|
|
23
|
+
if (!this.message) {
|
|
24
|
+
this.message = HttpStatusMessageConst[res.status];
|
|
25
|
+
}
|
|
26
|
+
if (!this.message) {
|
|
27
|
+
this.message = '网络异常,请稍后重试!';
|
|
28
|
+
}
|
|
29
|
+
this.status = res.status;
|
|
30
|
+
}
|
|
31
|
+
else {
|
|
32
|
+
this.message = err.message;
|
|
33
|
+
this.status = 500;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/error/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 运行时异常
|
|
3
|
+
*
|
|
4
|
+
* @author lxm
|
|
5
|
+
* @date 2022-09-21 18:09:09
|
|
6
|
+
* @export
|
|
7
|
+
* @class RuntimeError
|
|
8
|
+
* @implements {Error}
|
|
9
|
+
*/
|
|
10
|
+
export declare class RuntimeError implements Error {
|
|
11
|
+
message: string;
|
|
12
|
+
name: string;
|
|
13
|
+
constructor(message: string);
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=runtime-error.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime-error.d.ts","sourceRoot":"","sources":["../../../src/error/runtime-error/runtime-error.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,qBAAa,YAAa,YAAW,KAAK;IAGrB,OAAO,EAAE,MAAM;IAFlC,IAAI,EAAE,MAAM,CAAmB;gBAEZ,OAAO,EAAE,MAAM;CACnC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 运行时异常
|
|
3
|
+
*
|
|
4
|
+
* @author lxm
|
|
5
|
+
* @date 2022-09-21 18:09:09
|
|
6
|
+
* @export
|
|
7
|
+
* @class RuntimeError
|
|
8
|
+
* @implements {Error}
|
|
9
|
+
*/
|
|
10
|
+
export class RuntimeError {
|
|
11
|
+
constructor(message) {
|
|
12
|
+
this.message = message;
|
|
13
|
+
this.name = 'Runtime Error';
|
|
14
|
+
}
|
|
15
|
+
}
|
package/out/ibizsys.d.ts
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { OrgData } from './interface';
|
|
2
|
+
import { Net } from './utils';
|
|
3
|
+
/**
|
|
4
|
+
* 全局对象
|
|
5
|
+
*
|
|
6
|
+
* @author chitanda
|
|
7
|
+
* @date 2022-07-19 16:07:50
|
|
8
|
+
* @export
|
|
9
|
+
* @class IBizSys
|
|
10
|
+
*/
|
|
11
|
+
export declare class IBizSys {
|
|
12
|
+
/**
|
|
13
|
+
* 环境变量
|
|
14
|
+
*
|
|
15
|
+
* @author chitanda
|
|
16
|
+
* @date 2022-07-19 18:07:04
|
|
17
|
+
*/
|
|
18
|
+
env: import("./interface").IEnvironment;
|
|
19
|
+
/**
|
|
20
|
+
* 网络请求工具类
|
|
21
|
+
*
|
|
22
|
+
* @author chitanda
|
|
23
|
+
* @date 2022-07-19 17:07:56
|
|
24
|
+
* @type {Net}
|
|
25
|
+
*/
|
|
26
|
+
net: Net;
|
|
27
|
+
/**
|
|
28
|
+
* sass 模式下的中心系统标识
|
|
29
|
+
*
|
|
30
|
+
* @author chitanda
|
|
31
|
+
* @date 2022-07-19 18:07:23
|
|
32
|
+
* @type {string}
|
|
33
|
+
*/
|
|
34
|
+
orgData?: OrgData;
|
|
35
|
+
/**
|
|
36
|
+
* 应用数据
|
|
37
|
+
*
|
|
38
|
+
* @author chitanda
|
|
39
|
+
* @date 2022-07-20 19:07:22
|
|
40
|
+
* @type {IData}
|
|
41
|
+
*/
|
|
42
|
+
appData?: IData;
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=ibizsys.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ibizsys.d.ts","sourceRoot":"","sources":["../src/ibizsys.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,OAAO,EAAE,GAAG,EAAE,MAAM,SAAS,CAAC;AAE9B;;;;;;;GAOG;AACH,qBAAa,OAAO;IAClB;;;;;OAKG;IACH,GAAG,qCAAe;IAElB;;;;;;OAMG;IACH,GAAG,EAAE,GAAG,CAAa;IAErB;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,KAAK,CAAC;CACjB"}
|
package/out/ibizsys.js
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Environment } from './environment/environment';
|
|
2
|
+
import { Net } from './utils';
|
|
3
|
+
/**
|
|
4
|
+
* 全局对象
|
|
5
|
+
*
|
|
6
|
+
* @author chitanda
|
|
7
|
+
* @date 2022-07-19 16:07:50
|
|
8
|
+
* @export
|
|
9
|
+
* @class IBizSys
|
|
10
|
+
*/
|
|
11
|
+
export class IBizSys {
|
|
12
|
+
constructor() {
|
|
13
|
+
/**
|
|
14
|
+
* 环境变量
|
|
15
|
+
*
|
|
16
|
+
* @author chitanda
|
|
17
|
+
* @date 2022-07-19 18:07:04
|
|
18
|
+
*/
|
|
19
|
+
this.env = Environment;
|
|
20
|
+
/**
|
|
21
|
+
* 网络请求工具类
|
|
22
|
+
*
|
|
23
|
+
* @author chitanda
|
|
24
|
+
* @date 2022-07-19 17:07:56
|
|
25
|
+
* @type {Net}
|
|
26
|
+
*/
|
|
27
|
+
this.net = new Net();
|
|
28
|
+
}
|
|
29
|
+
}
|
package/out/index.d.ts
CHANGED
|
@@ -1,2 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
import './types';
|
|
2
|
+
export * from './constant';
|
|
3
|
+
export { IBizContext, IBizContextProxyHandle } from './context';
|
|
4
|
+
export { Environment } from './environment/environment';
|
|
5
|
+
export * from './error';
|
|
6
|
+
export * from './interface';
|
|
7
|
+
export * from './utils';
|
|
8
|
+
export { IBizSys } from './ibizsys';
|
|
9
|
+
export { install } from './install';
|
|
2
10
|
//# sourceMappingURL=index.d.ts.map
|
package/out/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,CAAC;AAEjB,cAAc,YAAY,CAAC;AAC3B,OAAO,EAAE,WAAW,EAAE,sBAAsB,EAAE,MAAM,WAAW,CAAC;AAChE,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC"}
|
package/out/index.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import
|
|
2
|
-
export
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
}
|
|
1
|
+
import './types';
|
|
2
|
+
export * from './constant';
|
|
3
|
+
export { IBizContext, IBizContextProxyHandle } from './context';
|
|
4
|
+
export { Environment } from './environment/environment';
|
|
5
|
+
export * from './error';
|
|
6
|
+
export * from './interface';
|
|
7
|
+
export * from './utils';
|
|
8
|
+
export { IBizSys } from './ibizsys';
|
|
9
|
+
export { install } from './install';
|
package/out/install.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"install.d.ts","sourceRoot":"","sources":["../src/install.ts"],"names":[],"mappings":"AAGA;;;;;;GAMG;AACH,wBAAgB,OAAO,IAAI,IAAI,CAM9B"}
|
package/out/install.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { IBizSys } from './ibizsys';
|
|
2
|
+
import { Interceptor } from './utils';
|
|
3
|
+
/**
|
|
4
|
+
* 初始化全局对象
|
|
5
|
+
*
|
|
6
|
+
* @author chitanda
|
|
7
|
+
* @date 2022-07-19 17:07:37
|
|
8
|
+
* @export
|
|
9
|
+
*/
|
|
10
|
+
export function install() {
|
|
11
|
+
if (window.ibiz) {
|
|
12
|
+
throw new Error('ibiz 已经存在, 无需重复安装');
|
|
13
|
+
}
|
|
14
|
+
window.ibiz = new IBizSys();
|
|
15
|
+
new Interceptor();
|
|
16
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 配置参数
|
|
3
|
+
*
|
|
4
|
+
* @author chitanda
|
|
5
|
+
* @date 2022-07-19 18:07:29
|
|
6
|
+
* @export
|
|
7
|
+
* @interface IEnvironment
|
|
8
|
+
*/
|
|
9
|
+
export interface IEnvironment {
|
|
10
|
+
/**
|
|
11
|
+
* 命名空间
|
|
12
|
+
*
|
|
13
|
+
* @author chitanda
|
|
14
|
+
* @date 2022-09-06 11:09:32
|
|
15
|
+
* @type {string}
|
|
16
|
+
*/
|
|
17
|
+
namespace?: string;
|
|
18
|
+
/**
|
|
19
|
+
* 请求根路径
|
|
20
|
+
*
|
|
21
|
+
* @author chitanda
|
|
22
|
+
* @date 2022-07-19 18:07:58
|
|
23
|
+
* @type {string}
|
|
24
|
+
*/
|
|
25
|
+
baseUrl: string;
|
|
26
|
+
/**
|
|
27
|
+
* 远程模型路径
|
|
28
|
+
*
|
|
29
|
+
* @author chitanda
|
|
30
|
+
* @date 2022-09-22 18:09:25
|
|
31
|
+
* @type {string}
|
|
32
|
+
*/
|
|
33
|
+
remoteModelUrl: string;
|
|
34
|
+
/**
|
|
35
|
+
* 资源文件根路径
|
|
36
|
+
*
|
|
37
|
+
* @author lxm
|
|
38
|
+
* @date 2022-08-25 14:08:08
|
|
39
|
+
* @type {string}
|
|
40
|
+
*/
|
|
41
|
+
assetsUrl: string;
|
|
42
|
+
/**
|
|
43
|
+
* 中心系统标识
|
|
44
|
+
*
|
|
45
|
+
* @author chitanda
|
|
46
|
+
* @date 2022-08-22 23:08:46
|
|
47
|
+
* @type {string}
|
|
48
|
+
*/
|
|
49
|
+
dcSystem: string;
|
|
50
|
+
/**
|
|
51
|
+
* 文件导出
|
|
52
|
+
*
|
|
53
|
+
* @author chitanda
|
|
54
|
+
* @date 2022-08-22 23:08:46
|
|
55
|
+
* @type {string}
|
|
56
|
+
*/
|
|
57
|
+
ExportFile: string;
|
|
58
|
+
/**
|
|
59
|
+
* 文件上传
|
|
60
|
+
*
|
|
61
|
+
* @author chitanda
|
|
62
|
+
* @date 2022-08-22 23:08:46
|
|
63
|
+
* @type {string}
|
|
64
|
+
*/
|
|
65
|
+
UploadFile: string;
|
|
66
|
+
}
|
|
67
|
+
//# sourceMappingURL=i-environment.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"i-environment.d.ts","sourceRoot":"","sources":["../../../src/interface/i-environment/i-environment.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,MAAM,WAAW,YAAY;IAC3B;;;;;;OAMG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;;;;OAMG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;;;;;OAMG;IACH,cAAc,EAAE,MAAM,CAAC;IAEvB;;;;;;OAMG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;;;;;OAMG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;;;;;OAMG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;;;;;OAMG;IACH,UAAU,EAAE,MAAM,CAAC;CACpB"}
|
|
File without changes
|
package/out/interface/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/interface/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/interface/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAC7D,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC"}
|