@pisell/core 1.0.45 → 1.0.46
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/es/app/app.d.ts +8 -8
- package/es/app/index.d.ts +1 -1
- package/es/applicationManager/application.d.ts +2 -2
- package/es/cmd/const.d.ts +5 -5
- package/es/history/index.d.ts +4 -3
- package/es/hooks/useStore/index.d.ts +1 -1
- package/es/locales/type.d.ts +3 -3
- package/es/logger/index.d.ts +1 -1
- package/es/models/index.d.ts +6 -5
- package/es/pubsub/index.d.ts +1 -1
- package/es/request/cache.d.ts +1 -1
- package/es/request/config.js +5 -0
- package/es/request/index.js +68 -24
- package/es/request/pisell2Request.d.ts +1 -1
- package/es/request/type.d.ts +6 -1
- package/es/routes/index.d.ts +2 -2
- package/es/socket/types.d.ts +1 -1
- package/es/tasks/type.d.ts +4 -4
- package/es/utils/adaptiveThrottle/index.d.ts +2 -2
- package/es/variables/index.d.ts +3 -3
- package/lib/app/app.d.ts +8 -8
- package/lib/app/index.d.ts +1 -1
- package/lib/applicationManager/application.d.ts +2 -2
- package/lib/aws/index.js +0 -3
- package/lib/cmd/const.d.ts +5 -5
- package/lib/cmd/const.js +5 -5
- package/lib/cmd/index.js +0 -2
- package/lib/cookie/index.js +4 -2
- package/lib/data/index.js +0 -3
- package/lib/history/index.d.ts +4 -3
- package/lib/hooks/useStore/index.d.ts +1 -1
- package/lib/locales/index.js +94 -95
- package/lib/locales/type.d.ts +3 -3
- package/lib/logger/index.d.ts +1 -1
- package/lib/models/index.d.ts +6 -5
- package/lib/pubsub/index.d.ts +1 -1
- package/lib/pubsub/index.js +3 -1
- package/lib/request/cache.d.ts +1 -1
- package/lib/request/config.js +5 -0
- package/lib/request/index.js +50 -21
- package/lib/request/pisell2Request.d.ts +1 -1
- package/lib/request/type.d.ts +6 -1
- package/lib/routes/index.d.ts +2 -2
- package/lib/routes/index.js +1 -3
- package/lib/socket/components/SocketMonitorPage.js +12 -6
- package/lib/socket/heartbeat.js +5 -10
- package/lib/socket/index.js +3 -1
- package/lib/socket/monitor.js +24 -26
- package/lib/socket/reconnect.js +3 -10
- package/lib/socket/socket.js +10 -12
- package/lib/socket/types.d.ts +1 -1
- package/lib/storage/index.js +24 -25
- package/lib/tasks/index.js +329 -333
- package/lib/tasks/type.d.ts +4 -4
- package/lib/utils/adaptiveThrottle/index.d.ts +2 -2
- package/lib/variables/index.d.ts +3 -3
- package/package.json +1 -1
package/es/app/app.d.ts
CHANGED
|
@@ -43,17 +43,17 @@ declare class App {
|
|
|
43
43
|
locales: Locales;
|
|
44
44
|
models: {
|
|
45
45
|
getStore: () => import("../models").Store;
|
|
46
|
-
StoreProvider:
|
|
46
|
+
StoreProvider: typeof import("react-redux").Provider;
|
|
47
47
|
setConfig: (models: any[]) => void;
|
|
48
48
|
};
|
|
49
49
|
request: {
|
|
50
|
-
get: (url: string, data: any, config: import("
|
|
51
|
-
post: (url: string, data: any, config: import("
|
|
52
|
-
put: (url: string, data: any, config: import("
|
|
53
|
-
remove: (url: string, data: any, config: import("
|
|
54
|
-
custom: (url: string, config: import("
|
|
55
|
-
setConfig: (newConfig: Partial<import("
|
|
56
|
-
getConfig: () => import("
|
|
50
|
+
get: (url: string, data: any, config: import("@").RequestSetting | undefined) => Promise<any>;
|
|
51
|
+
post: (url: string, data: any, config: import("@").RequestSetting | undefined) => Promise<any>;
|
|
52
|
+
put: (url: string, data: any, config: import("@").RequestSetting | undefined) => Promise<any>;
|
|
53
|
+
remove: (url: string, data: any, config: import("@").RequestSetting | undefined) => Promise<any>;
|
|
54
|
+
custom: (url: string, config: import("@").RequestSetting | undefined) => any;
|
|
55
|
+
setConfig: (newConfig: Partial<import("@").RequestConfig>) => void;
|
|
56
|
+
getConfig: () => import("@").RequestConfig;
|
|
57
57
|
};
|
|
58
58
|
storage: Storage;
|
|
59
59
|
menuManager: MenuManager;
|
package/es/app/index.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ import { MenuItem } from '../menuManager/index';
|
|
|
5
5
|
* 应用接口类型定义
|
|
6
6
|
* @description 描述应用中单个页面、组件或功能的接口结构
|
|
7
7
|
*/
|
|
8
|
-
export
|
|
8
|
+
export type ApplicationInterface = {
|
|
9
9
|
page_type: 'low_code' | 'code';
|
|
10
10
|
page_id: number | string;
|
|
11
11
|
page_code: string;
|
|
@@ -29,7 +29,7 @@ export declare type ApplicationInterface = {
|
|
|
29
29
|
* 应用数据类型定义
|
|
30
30
|
* @description 描述完整应用的数据结构,包含应用的基本信息、接口、功能等
|
|
31
31
|
*/
|
|
32
|
-
export
|
|
32
|
+
export type ApplicationData = {
|
|
33
33
|
/** 应用唯一标识 */
|
|
34
34
|
app_id: number;
|
|
35
35
|
/** 应用名称 */
|
package/es/cmd/const.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
export declare enum CMDCoreEnum {
|
|
2
|
-
CMD_CONNECT,
|
|
3
|
-
CMD_DISCONNECT,
|
|
4
|
-
CMD_RECONNECT,
|
|
5
|
-
CMD_MESSAGE,
|
|
6
|
-
CMD_ERROR
|
|
2
|
+
CMD_CONNECT = "cmd.connect",
|
|
3
|
+
CMD_DISCONNECT = "cmd.disconnect",
|
|
4
|
+
CMD_RECONNECT = "cmd.reconnect",
|
|
5
|
+
CMD_MESSAGE = "cmd.message",
|
|
6
|
+
CMD_ERROR = "cmd.error"
|
|
7
7
|
}
|
|
8
8
|
declare const _default: {
|
|
9
9
|
CMDCoreEnum: typeof CMDCoreEnum;
|
package/es/history/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { LocationDescriptor } from "history";
|
|
2
2
|
import type { History as HistoryType } from "history";
|
|
3
|
+
import { useHistory, useLocation, useParams } from "react-router-dom";
|
|
3
4
|
import App from "../app";
|
|
4
5
|
export interface HistoryOptions {
|
|
5
6
|
basename?: string;
|
|
@@ -7,9 +8,9 @@ export interface HistoryOptions {
|
|
|
7
8
|
}
|
|
8
9
|
export declare class History {
|
|
9
10
|
instance: HistoryType<unknown>;
|
|
10
|
-
useHistory:
|
|
11
|
-
useLocation:
|
|
12
|
-
useParams:
|
|
11
|
+
useHistory: typeof useHistory;
|
|
12
|
+
useLocation: typeof useLocation;
|
|
13
|
+
useParams: typeof useParams;
|
|
13
14
|
app: App;
|
|
14
15
|
interceptor?: (path: LocationDescriptor<unknown>, state: unknown, next: () => void) => void;
|
|
15
16
|
constructor(app: App, options?: HistoryOptions);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ModelsState } from "../../models";
|
|
2
2
|
declare const useStore: <T extends "global", D extends keyof ModelsState[T]>(props: {
|
|
3
3
|
models: T;
|
|
4
|
-
key?: D
|
|
4
|
+
key?: D;
|
|
5
5
|
}) => D extends undefined ? ModelsState[T] : ModelsState[T][D];
|
|
6
6
|
export default useStore;
|
package/es/locales/type.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
1
|
+
export type Locale = 'original' | 'en' | 'zh-CN' | 'zh-HK' | string;
|
|
2
|
+
export type MultiLanguage = {
|
|
3
3
|
[key in Locale]: string;
|
|
4
4
|
};
|
|
5
5
|
export interface LibraryItem {
|
|
@@ -16,4 +16,4 @@ export interface LocaleConfig {
|
|
|
16
16
|
[key in Locale]: LibraryItem;
|
|
17
17
|
};
|
|
18
18
|
}
|
|
19
|
-
export
|
|
19
|
+
export type LoadLibraryByUrlParams = (string | Promise<LibraryItem> | (() => Promise<LibraryItem>) | LibraryItem)[];
|
package/es/logger/index.d.ts
CHANGED
package/es/models/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import hooks from '../hooks';
|
|
2
|
+
import { Provider as StoreProvider } from "react-redux";
|
|
2
3
|
declare const models: import("./global").GlobalModal[];
|
|
3
|
-
|
|
4
|
+
type ModalsType = (typeof models[number]);
|
|
4
5
|
export interface Store {
|
|
5
6
|
getDataByModel: typeof getDataByModel;
|
|
6
7
|
useStore: typeof hooks.useStore;
|
|
@@ -9,8 +10,8 @@ export interface Store {
|
|
|
9
10
|
dispatch: any;
|
|
10
11
|
getState: any;
|
|
11
12
|
}
|
|
12
|
-
export
|
|
13
|
-
export
|
|
13
|
+
export type ModelsNames = ModalsType['namespace'];
|
|
14
|
+
export type ModelsState = {
|
|
14
15
|
[K in (ModalsType['namespace'])]: Extract<ModalsType, {
|
|
15
16
|
namespace: K;
|
|
16
17
|
}>['state'];
|
|
@@ -24,7 +25,7 @@ export declare type ModelsState = {
|
|
|
24
25
|
* @Author: zhiwei.Wang
|
|
25
26
|
* @Date: 2024-09-03 11:07
|
|
26
27
|
*/
|
|
27
|
-
declare const getDataByModel: <T extends "global", D extends keyof ModelsState[T]>(model: string, key?: D
|
|
28
|
+
declare const getDataByModel: <T extends "global", D extends keyof ModelsState[T]>(model: string, key?: D) => D extends undefined ? ModelsState[T] : ModelsState[T][D];
|
|
28
29
|
/**
|
|
29
30
|
* @title: 设置数据到store
|
|
30
31
|
* @description:
|
|
@@ -38,7 +39,7 @@ declare const getDataByModel: <T extends "global", D extends keyof ModelsState[T
|
|
|
38
39
|
declare const setDataByModel: <T extends "global", D extends keyof ModelsState[T]>(model: string, key: any, value: any) => void;
|
|
39
40
|
declare const _default: {
|
|
40
41
|
getStore: () => Store;
|
|
41
|
-
StoreProvider:
|
|
42
|
+
StoreProvider: typeof StoreProvider;
|
|
42
43
|
setConfig: (models: any[]) => void;
|
|
43
44
|
};
|
|
44
45
|
export default _default;
|
package/es/pubsub/index.d.ts
CHANGED
package/es/request/cache.d.ts
CHANGED
package/es/request/config.js
CHANGED
|
@@ -10,6 +10,11 @@ import { mergeWith } from 'lodash';
|
|
|
10
10
|
var defaultConfig = {
|
|
11
11
|
axiosConfig: axiosConfig,
|
|
12
12
|
storage: new Storage(),
|
|
13
|
+
logger: {
|
|
14
|
+
maxRequestCount: 6,
|
|
15
|
+
maxRequestTime: 5000,
|
|
16
|
+
filterUrls: []
|
|
17
|
+
},
|
|
13
18
|
requestCallbacks: {
|
|
14
19
|
200: function _(resData) {
|
|
15
20
|
var res = resData.res,
|
package/es/request/index.js
CHANGED
|
@@ -11,6 +11,8 @@ import { createSignal } from "./cancelToken";
|
|
|
11
11
|
import { axiosConfig } from "./constants";
|
|
12
12
|
import { cacheFn } from "./cache";
|
|
13
13
|
import { interceptorsRequest, interceptorsResponse, interceptorsRequestError, interceptorsResponseError, requestCallback } from "./utils";
|
|
14
|
+
// @ts-ignore
|
|
15
|
+
import { getUniqueId } from "@pisell/utils";
|
|
14
16
|
import axios from "axios";
|
|
15
17
|
import { getConfig, setConfig } from "./config";
|
|
16
18
|
import { getApp } from "../app";
|
|
@@ -22,44 +24,84 @@ axiosInstance.interceptors.request.use(interceptorsRequest, interceptorsRequestE
|
|
|
22
24
|
|
|
23
25
|
// 响应拦截器
|
|
24
26
|
axiosInstance.interceptors.response.use(interceptorsResponse, interceptorsResponseError);
|
|
27
|
+
|
|
28
|
+
// 请求计数
|
|
29
|
+
var requestCount = 0;
|
|
30
|
+
var isFilterUrl = function isFilterUrl(url) {
|
|
31
|
+
var _logger$filterUrls;
|
|
32
|
+
var _getConfig = getConfig(),
|
|
33
|
+
logger = _getConfig.logger;
|
|
34
|
+
return logger === null || logger === void 0 || (_logger$filterUrls = logger.filterUrls) === null || _logger$filterUrls === void 0 ? void 0 : _logger$filterUrls.some(function (filterUrl) {
|
|
35
|
+
return url.includes(filterUrl);
|
|
36
|
+
});
|
|
37
|
+
};
|
|
25
38
|
export var createRequest = function createRequest(props) {
|
|
26
39
|
var data = props.data,
|
|
27
40
|
config = props.config,
|
|
28
41
|
method = props.method,
|
|
29
42
|
url = props.url;
|
|
30
|
-
var
|
|
31
|
-
getUrl =
|
|
43
|
+
var _getConfig2 = getConfig(),
|
|
44
|
+
getUrl = _getConfig2.getUrl,
|
|
45
|
+
logger = _getConfig2.logger;
|
|
32
46
|
var startTime = Date.now(); // 记录请求开始时间
|
|
47
|
+
var app = getApp();
|
|
48
|
+
var requestId = getUniqueId();
|
|
49
|
+
|
|
50
|
+
// 请求计数增加
|
|
51
|
+
requestCount++;
|
|
52
|
+
|
|
53
|
+
// 记录请求开始日志
|
|
54
|
+
app.logger.addLog({
|
|
55
|
+
type: 'info',
|
|
56
|
+
title: "[ Request ]: Start - ".concat(requestId),
|
|
57
|
+
metadata: {
|
|
58
|
+
url: url,
|
|
59
|
+
data: data,
|
|
60
|
+
method: method
|
|
61
|
+
}
|
|
62
|
+
});
|
|
33
63
|
|
|
64
|
+
// 如果请求计数超过最大请求数,则记录为警告日志
|
|
65
|
+
if (requestCount > ((logger === null || logger === void 0 ? void 0 : logger.maxRequestCount) || 6)) {
|
|
66
|
+
app.logger.addLog({
|
|
67
|
+
type: 'warning',
|
|
68
|
+
title: "[ Request ]: Max Request Count - ".concat(requestCount),
|
|
69
|
+
metadata: {
|
|
70
|
+
requestCount: requestCount
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
}
|
|
34
74
|
return new Promise(function (resolve, reject) {
|
|
35
75
|
var _method = method === "remove" ? "delete" : method;
|
|
36
|
-
var _url = getUrl === null || getUrl === void 0 ? void 0 : getUrl(props);
|
|
76
|
+
var _url = (getUrl === null || getUrl === void 0 ? void 0 : getUrl(props)) || '';
|
|
37
77
|
|
|
38
78
|
// 请求完成处理函数
|
|
39
|
-
var handleRequestComplete = function handleRequestComplete(result) {
|
|
40
|
-
var isError = arguments.length >
|
|
79
|
+
var handleRequestComplete = function handleRequestComplete(url, result) {
|
|
80
|
+
var isError = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
81
|
+
var requestId = arguments.length > 3 ? arguments[3] : undefined;
|
|
41
82
|
try {
|
|
42
83
|
var endTime = Date.now();
|
|
43
84
|
var duration = endTime - startTime;
|
|
85
|
+
var maxRequestTime = (logger === null || logger === void 0 ? void 0 : logger.maxRequestTime) || 5000;
|
|
44
86
|
|
|
45
|
-
//
|
|
46
|
-
if (
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
data: data,
|
|
55
|
-
method: _method,
|
|
56
|
-
duration: "".concat((duration / 1000).toFixed(2), "s"),
|
|
57
|
-
timestamp: new Date(startTime).toISOString(),
|
|
58
|
-
isError: isError
|
|
59
|
-
}
|
|
60
|
-
});
|
|
61
|
-
}
|
|
87
|
+
// 如果请求URL在过滤列表中,则不判断超时时间
|
|
88
|
+
if (isFilterUrl(url)) {
|
|
89
|
+
maxRequestTime = 99999999;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
// 如果请求错误或者请求超过5秒,则记录为错误日志
|
|
93
|
+
var type = duration > maxRequestTime ? 'warning' : 'info';
|
|
94
|
+
if (isError) {
|
|
95
|
+
type = 'error';
|
|
62
96
|
}
|
|
97
|
+
app.logger.addLog({
|
|
98
|
+
type: type,
|
|
99
|
+
title: "[ Request ]: Complete - ".concat(requestId),
|
|
100
|
+
metadata: {
|
|
101
|
+
error: isError ? JSON.stringify(result) : '',
|
|
102
|
+
duration: "".concat((duration / 1000).toFixed(2), "s")
|
|
103
|
+
}
|
|
104
|
+
});
|
|
63
105
|
} catch (error) {}
|
|
64
106
|
return result;
|
|
65
107
|
};
|
|
@@ -68,7 +110,7 @@ export var createRequest = function createRequest(props) {
|
|
|
68
110
|
}, config), _objectSpread({
|
|
69
111
|
params: !["post", "put"].includes(_method) ? data : null
|
|
70
112
|
}, config)).then(function (res) {
|
|
71
|
-
handleRequestComplete(res, false);
|
|
113
|
+
handleRequestComplete(_url, res, false, requestId);
|
|
72
114
|
requestCallback({
|
|
73
115
|
res: res,
|
|
74
116
|
reject: reject,
|
|
@@ -76,13 +118,15 @@ export var createRequest = function createRequest(props) {
|
|
|
76
118
|
props: props
|
|
77
119
|
});
|
|
78
120
|
}).catch(function (err) {
|
|
79
|
-
handleRequestComplete(err, true);
|
|
121
|
+
handleRequestComplete(_url, err, true, requestId);
|
|
80
122
|
requestCallback({
|
|
81
123
|
err: err,
|
|
82
124
|
reject: reject,
|
|
83
125
|
resolve: resolve,
|
|
84
126
|
props: props
|
|
85
127
|
});
|
|
128
|
+
}).finally(function () {
|
|
129
|
+
requestCount--;
|
|
86
130
|
});
|
|
87
131
|
});
|
|
88
132
|
};
|
package/es/request/type.d.ts
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import { CreateAxiosDefaults } from "axios";
|
|
2
2
|
import { CacheType } from './cache';
|
|
3
3
|
export interface RequestConfig {
|
|
4
|
+
logger: {
|
|
5
|
+
maxRequestCount: number;
|
|
6
|
+
maxRequestTime: number;
|
|
7
|
+
filterUrls: string[];
|
|
8
|
+
};
|
|
4
9
|
interceptorsRequest?: ((value: any) => any | Promise<any>) | null;
|
|
5
10
|
interceptorsRequestError?: ((error: any) => any) | null;
|
|
6
11
|
interceptorsResponse?: any;
|
|
@@ -26,7 +31,7 @@ export declare enum RequestModeENUM {
|
|
|
26
31
|
REMOTE_LOCAL = "remote_local",
|
|
27
32
|
OS_SERVER = "os_server"
|
|
28
33
|
}
|
|
29
|
-
export
|
|
34
|
+
export type RequestModeType = RequestModeENUM.LOCAL | RequestModeENUM.REMOTE | RequestModeENUM.LOCAL_REMOTE | RequestModeENUM.REMOTE_LOCAL | RequestModeENUM.OS_SERVER;
|
|
30
35
|
export interface CacheProps {
|
|
31
36
|
key?: string;
|
|
32
37
|
type?: CacheType;
|
package/es/routes/index.d.ts
CHANGED
|
@@ -20,9 +20,9 @@ export declare class RouterManager {
|
|
|
20
20
|
get(name: string): RouteType;
|
|
21
21
|
has(name: string): boolean;
|
|
22
22
|
remove(name: string): void;
|
|
23
|
-
renderComponent(item: RouteType, children?: React.ReactNode): string | number | boolean | React.
|
|
23
|
+
renderComponent(item: RouteType, children?: React.ReactNode): string | number | boolean | Iterable<React.ReactNode> | React.JSX.Element | null | undefined;
|
|
24
24
|
getPageByRoute(route: string): ApplicationInterface | undefined;
|
|
25
25
|
getRouterComponent({ fallback }: {
|
|
26
26
|
fallback?: React.ReactNode;
|
|
27
|
-
}): JSX.Element[];
|
|
27
|
+
}): React.JSX.Element[];
|
|
28
28
|
}
|
package/es/socket/types.d.ts
CHANGED
package/es/tasks/type.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export
|
|
1
|
+
export type TaskRunStatus = "pending" | "in-progress" | "success" | "failure";
|
|
2
2
|
export interface Task {
|
|
3
3
|
id?: string;
|
|
4
4
|
type?: "local" | "cloud";
|
|
@@ -37,9 +37,9 @@ export interface Task {
|
|
|
37
37
|
export interface TaskConfig {
|
|
38
38
|
tasks: Task[];
|
|
39
39
|
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
40
|
+
type TaskModuleName = string;
|
|
41
|
+
type TaskQueueName = string;
|
|
42
|
+
type TaskStatus = "uncompleted" | "completed";
|
|
43
43
|
export interface TaskQueue {
|
|
44
44
|
status: TaskStatus;
|
|
45
45
|
tasks: Task[];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export
|
|
1
|
+
export type ThrottleLevel = number;
|
|
2
2
|
export interface ThrottleExecuteContext {
|
|
3
3
|
/** 事务唯一 key */
|
|
4
4
|
key: string;
|
|
@@ -11,7 +11,7 @@ export interface ThrottleExecuteContext {
|
|
|
11
11
|
/** 上一次执行时间 */
|
|
12
12
|
lastExecuteTime: number;
|
|
13
13
|
}
|
|
14
|
-
export
|
|
14
|
+
export type ThrottleHandler = (ctx: ThrottleExecuteContext) => void | Promise<void>;
|
|
15
15
|
export declare const DEFAULT_THROTTLE_INTERVALS: number[];
|
|
16
16
|
export declare class AdaptiveThrottle {
|
|
17
17
|
private store;
|
package/es/variables/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export
|
|
1
|
+
export type VariableMap = Record<string, string>;
|
|
2
2
|
declare const _default: {
|
|
3
|
-
setConfig: (newConfig: Partial<import("
|
|
4
|
-
getConfig: () => import("
|
|
3
|
+
setConfig: (newConfig: Partial<import("@").VariablesConfig>) => void;
|
|
4
|
+
getConfig: () => import("@").VariablesConfig;
|
|
5
5
|
};
|
|
6
6
|
export default _default;
|
package/lib/app/app.d.ts
CHANGED
|
@@ -43,17 +43,17 @@ declare class App {
|
|
|
43
43
|
locales: Locales;
|
|
44
44
|
models: {
|
|
45
45
|
getStore: () => import("../models").Store;
|
|
46
|
-
StoreProvider:
|
|
46
|
+
StoreProvider: typeof import("react-redux").Provider;
|
|
47
47
|
setConfig: (models: any[]) => void;
|
|
48
48
|
};
|
|
49
49
|
request: {
|
|
50
|
-
get: (url: string, data: any, config: import("
|
|
51
|
-
post: (url: string, data: any, config: import("
|
|
52
|
-
put: (url: string, data: any, config: import("
|
|
53
|
-
remove: (url: string, data: any, config: import("
|
|
54
|
-
custom: (url: string, config: import("
|
|
55
|
-
setConfig: (newConfig: Partial<import("
|
|
56
|
-
getConfig: () => import("
|
|
50
|
+
get: (url: string, data: any, config: import("@").RequestSetting | undefined) => Promise<any>;
|
|
51
|
+
post: (url: string, data: any, config: import("@").RequestSetting | undefined) => Promise<any>;
|
|
52
|
+
put: (url: string, data: any, config: import("@").RequestSetting | undefined) => Promise<any>;
|
|
53
|
+
remove: (url: string, data: any, config: import("@").RequestSetting | undefined) => Promise<any>;
|
|
54
|
+
custom: (url: string, config: import("@").RequestSetting | undefined) => any;
|
|
55
|
+
setConfig: (newConfig: Partial<import("@").RequestConfig>) => void;
|
|
56
|
+
getConfig: () => import("@").RequestConfig;
|
|
57
57
|
};
|
|
58
58
|
storage: Storage;
|
|
59
59
|
menuManager: MenuManager;
|
package/lib/app/index.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ import { MenuItem } from '../menuManager/index';
|
|
|
5
5
|
* 应用接口类型定义
|
|
6
6
|
* @description 描述应用中单个页面、组件或功能的接口结构
|
|
7
7
|
*/
|
|
8
|
-
export
|
|
8
|
+
export type ApplicationInterface = {
|
|
9
9
|
page_type: 'low_code' | 'code';
|
|
10
10
|
page_id: number | string;
|
|
11
11
|
page_code: string;
|
|
@@ -29,7 +29,7 @@ export declare type ApplicationInterface = {
|
|
|
29
29
|
* 应用数据类型定义
|
|
30
30
|
* @description 描述完整应用的数据结构,包含应用的基本信息、接口、功能等
|
|
31
31
|
*/
|
|
32
|
-
export
|
|
32
|
+
export type ApplicationData = {
|
|
33
33
|
/** 应用唯一标识 */
|
|
34
34
|
app_id: number;
|
|
35
35
|
/** 应用名称 */
|
package/lib/aws/index.js
CHANGED
package/lib/cmd/const.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
export declare enum CMDCoreEnum {
|
|
2
|
-
CMD_CONNECT,
|
|
3
|
-
CMD_DISCONNECT,
|
|
4
|
-
CMD_RECONNECT,
|
|
5
|
-
CMD_MESSAGE,
|
|
6
|
-
CMD_ERROR
|
|
2
|
+
CMD_CONNECT = "cmd.connect",
|
|
3
|
+
CMD_DISCONNECT = "cmd.disconnect",
|
|
4
|
+
CMD_RECONNECT = "cmd.reconnect",
|
|
5
|
+
CMD_MESSAGE = "cmd.message",
|
|
6
|
+
CMD_ERROR = "cmd.error"
|
|
7
7
|
}
|
|
8
8
|
declare const _default: {
|
|
9
9
|
CMDCoreEnum: typeof CMDCoreEnum;
|
package/lib/cmd/const.js
CHANGED
|
@@ -25,11 +25,11 @@ __export(const_exports, {
|
|
|
25
25
|
module.exports = __toCommonJS(const_exports);
|
|
26
26
|
var prefix = "cmd";
|
|
27
27
|
var CMDCoreEnum = ((CMDCoreEnum2) => {
|
|
28
|
-
CMDCoreEnum2["CMD_CONNECT"] = `${prefix}.connect
|
|
29
|
-
CMDCoreEnum2["CMD_DISCONNECT"] = `${prefix}.disconnect
|
|
30
|
-
CMDCoreEnum2["CMD_RECONNECT"] = `${prefix}.reconnect
|
|
31
|
-
CMDCoreEnum2["CMD_MESSAGE"] = `${prefix}.message
|
|
32
|
-
CMDCoreEnum2["CMD_ERROR"] = `${prefix}.error
|
|
28
|
+
CMDCoreEnum2[CMDCoreEnum2["CMD_CONNECT"] = `${prefix}.connect`] = "CMD_CONNECT";
|
|
29
|
+
CMDCoreEnum2[CMDCoreEnum2["CMD_DISCONNECT"] = `${prefix}.disconnect`] = "CMD_DISCONNECT";
|
|
30
|
+
CMDCoreEnum2[CMDCoreEnum2["CMD_RECONNECT"] = `${prefix}.reconnect`] = "CMD_RECONNECT";
|
|
31
|
+
CMDCoreEnum2[CMDCoreEnum2["CMD_MESSAGE"] = `${prefix}.message`] = "CMD_MESSAGE";
|
|
32
|
+
CMDCoreEnum2[CMDCoreEnum2["CMD_ERROR"] = `${prefix}.error`] = "CMD_ERROR";
|
|
33
33
|
return CMDCoreEnum2;
|
|
34
34
|
})(CMDCoreEnum || {});
|
|
35
35
|
var const_default = { CMDCoreEnum };
|
package/lib/cmd/index.js
CHANGED
package/lib/cookie/index.js
CHANGED
|
@@ -35,8 +35,10 @@ function getCookie(name) {
|
|
|
35
35
|
const ca = document.cookie.split(";");
|
|
36
36
|
for (let i = 0; i < ca.length; i++) {
|
|
37
37
|
let c = ca[i];
|
|
38
|
-
while (c.charAt(0) === " ")
|
|
39
|
-
|
|
38
|
+
while (c.charAt(0) === " ")
|
|
39
|
+
c = c.substring(1, c.length);
|
|
40
|
+
if (c.indexOf(nameEQ) === 0)
|
|
41
|
+
return c.substring(nameEQ.length, c.length);
|
|
40
42
|
}
|
|
41
43
|
return null;
|
|
42
44
|
}
|
package/lib/data/index.js
CHANGED
package/lib/history/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { LocationDescriptor } from "history";
|
|
2
2
|
import type { History as HistoryType } from "history";
|
|
3
|
+
import { useHistory, useLocation, useParams } from "react-router-dom";
|
|
3
4
|
import App from "../app";
|
|
4
5
|
export interface HistoryOptions {
|
|
5
6
|
basename?: string;
|
|
@@ -7,9 +8,9 @@ export interface HistoryOptions {
|
|
|
7
8
|
}
|
|
8
9
|
export declare class History {
|
|
9
10
|
instance: HistoryType<unknown>;
|
|
10
|
-
useHistory:
|
|
11
|
-
useLocation:
|
|
12
|
-
useParams:
|
|
11
|
+
useHistory: typeof useHistory;
|
|
12
|
+
useLocation: typeof useLocation;
|
|
13
|
+
useParams: typeof useParams;
|
|
13
14
|
app: App;
|
|
14
15
|
interceptor?: (path: LocationDescriptor<unknown>, state: unknown, next: () => void) => void;
|
|
15
16
|
constructor(app: App, options?: HistoryOptions);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ModelsState } from "../../models";
|
|
2
2
|
declare const useStore: <T extends "global", D extends keyof ModelsState[T]>(props: {
|
|
3
3
|
models: T;
|
|
4
|
-
key?: D
|
|
4
|
+
key?: D;
|
|
5
5
|
}) => D extends undefined ? ModelsState[T] : ModelsState[T][D];
|
|
6
6
|
export default useStore;
|