halo-fe 1.0.0 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/main.js +875 -819
- package/esm/drivers/cdns/CdnFactory.d.ts +4 -2
- package/esm/drivers/encoders/EncoderFactory.d.ts +6 -4
- package/esm/drivers/excels/ExcelFactory.d.ts +4 -2
- package/esm/drivers/explainers/Explainer.d.ts +1 -0
- package/esm/drivers/explainers/ExplainerFactory.d.ts +6 -1
- package/esm/drivers/explainers/IExplainer.d.ts +2 -1
- package/esm/drivers/factories/DriverFactory.d.ts +45 -0
- package/esm/drivers/factories/Factory.d.ts +10 -2
- package/esm/drivers/factories/IFactory.d.ts +5 -1
- package/esm/drivers/features/FeatureFactory.d.ts +4 -2
- package/esm/drivers/hashers/HasherFactory.d.ts +6 -7
- package/esm/drivers/index.d.ts +0 -2
- package/esm/drivers/providers/Provider.d.ts +17 -0
- package/esm/drivers/providers/ProviderFactory.d.ts +9 -2
- package/esm/drivers/providers/implements/IndexedDbProvider.d.ts +2 -2
- package/esm/drivers/providers/implements/StorageProvider.d.ts +4 -0
- package/esm/drivers/requesters/IRequester.d.ts +7 -3
- package/esm/drivers/requesters/Requester.d.ts +1 -0
- package/esm/drivers/requesters/RequesterFactory.d.ts +2 -4
- package/esm/drivers/requesters/entities/HttpRequest.d.ts +2 -2
- package/esm/drivers/requesters/entities/HttpResponse.d.ts +2 -2
- package/esm/drivers/signers/SignerFactory.d.ts +4 -2
- package/esm/drivers/ssos/ISso.d.ts +2 -5
- package/esm/drivers/ssos/SsoFactory.d.ts +8 -2
- package/package.json +1 -1
@@ -1,11 +1,13 @@
|
|
1
1
|
import ICdn from "./ICdn";
|
2
|
+
import Factory from "../factories/Factory";
|
2
3
|
/**
|
3
4
|
* CDN工厂类
|
4
5
|
*/
|
5
|
-
declare class CdnFactory {
|
6
|
+
declare class CdnFactory extends Factory<ICdn> {
|
7
|
+
getInstances(): ICdn[];
|
6
8
|
/**
|
7
9
|
* 获取指定CDN实例
|
8
10
|
*/
|
9
|
-
|
11
|
+
create(type: string, conn?: string): ICdn;
|
10
12
|
}
|
11
13
|
export default CdnFactory;
|
@@ -1,16 +1,18 @@
|
|
1
1
|
import IEncoder from "./IEncoder";
|
2
|
+
import Factory from "../factories/Factory";
|
2
3
|
/**
|
3
4
|
* 编码器工厂
|
4
5
|
*/
|
5
|
-
declare class EncoderFactory {
|
6
|
+
declare class EncoderFactory extends Factory<IEncoder> {
|
7
|
+
getInstances(): IEncoder[];
|
6
8
|
/**
|
7
9
|
* 创建执行类型的Hash实例
|
8
10
|
*/
|
9
|
-
|
10
|
-
private
|
11
|
+
create(type: string, conn?: string): IEncoder;
|
12
|
+
private base64;
|
11
13
|
/**
|
12
14
|
* 获取Base64 编码器对象
|
13
15
|
*/
|
14
|
-
|
16
|
+
getBase64(): IEncoder;
|
15
17
|
}
|
16
18
|
export default EncoderFactory;
|
@@ -1,11 +1,13 @@
|
|
1
1
|
import IExcel from "./IExcel";
|
2
|
+
import Factory from "../factories/Factory";
|
2
3
|
/**
|
3
4
|
* Excel工厂
|
4
5
|
*/
|
5
|
-
declare class ExcelFactory {
|
6
|
+
declare class ExcelFactory extends Factory<IExcel> {
|
7
|
+
getInstances(): IExcel[];
|
6
8
|
/**
|
7
9
|
* 获取Excel实例
|
8
10
|
*/
|
9
|
-
|
11
|
+
create(type: string, conn?: string): IExcel;
|
10
12
|
}
|
11
13
|
export default ExcelFactory;
|
@@ -1,4 +1,13 @@
|
|
1
1
|
import { RequesterFactory } from "../requesters";
|
2
|
+
import EncoderFactory from "../encoders/EncoderFactory";
|
3
|
+
import SignerFactory from "../signers/SignerFactory";
|
4
|
+
import SsoFactory from "../ssos/SsoFactory";
|
5
|
+
import CdnFactory from "../cdns/CdnFactory";
|
6
|
+
import ExplainerFactory from "../explainers/ExplainerFactory";
|
7
|
+
import ExcelFactory from "../excels/ExcelFactory";
|
8
|
+
import FeatureFactory from "../features/FeatureFactory";
|
9
|
+
import HasherFactory from "../hashers/HasherFactory";
|
10
|
+
import ProviderFactory from "../providers/ProviderFactory";
|
2
11
|
/**
|
3
12
|
* 驱动工厂类
|
4
13
|
*/
|
@@ -11,9 +20,45 @@ declare class DriverFactory {
|
|
11
20
|
* 获取并缓存工厂实例
|
12
21
|
*/
|
13
22
|
static create(name: string, type: any): any;
|
23
|
+
/**
|
24
|
+
*获取CDN工厂
|
25
|
+
*/
|
26
|
+
static getCdn(): CdnFactory;
|
27
|
+
/**
|
28
|
+
*获取编码器工厂
|
29
|
+
*/
|
30
|
+
static getEncoder(): EncoderFactory;
|
31
|
+
/**
|
32
|
+
*获取Excel工厂
|
33
|
+
*/
|
34
|
+
static getExcel(): ExcelFactory;
|
35
|
+
/**
|
36
|
+
*获取Explainer工厂
|
37
|
+
*/
|
38
|
+
static getExplainer(): ExplainerFactory;
|
39
|
+
/**
|
40
|
+
*获取特征工厂
|
41
|
+
*/
|
42
|
+
static getFeature(): FeatureFactory;
|
43
|
+
/**
|
44
|
+
*获取哈希工厂
|
45
|
+
*/
|
46
|
+
static getHasher(): HasherFactory;
|
47
|
+
/**
|
48
|
+
*获取提供程序工厂
|
49
|
+
*/
|
50
|
+
static getProvider(): ProviderFactory;
|
14
51
|
/**
|
15
52
|
*获取请求器工厂
|
16
53
|
*/
|
17
54
|
static getRequester(): RequesterFactory;
|
55
|
+
/**
|
56
|
+
*获取签名工厂
|
57
|
+
*/
|
58
|
+
static getSigner(): SignerFactory;
|
59
|
+
/**
|
60
|
+
*获取SSO工厂
|
61
|
+
*/
|
62
|
+
static getSso(): SsoFactory;
|
18
63
|
}
|
19
64
|
export default DriverFactory;
|
@@ -1,8 +1,16 @@
|
|
1
1
|
import IFactory from "./IFactory";
|
2
|
+
import IDriver from "../IDriver";
|
2
3
|
/**
|
3
4
|
* 工厂基类
|
4
5
|
*/
|
5
|
-
declare abstract class Factory<T> implements IFactory<T> {
|
6
|
-
|
6
|
+
declare abstract class Factory<T extends IDriver> implements IFactory<T> {
|
7
|
+
/**
|
8
|
+
* 获取当前驱动所有实例
|
9
|
+
*/
|
10
|
+
abstract getInstances(): T[];
|
11
|
+
/**
|
12
|
+
* 创建指定类型驱动
|
13
|
+
*/
|
14
|
+
create(type: string, conn?: string): T;
|
7
15
|
}
|
8
16
|
export default Factory;
|
@@ -1,11 +1,13 @@
|
|
1
1
|
import IFeature from "./IFeature";
|
2
|
+
import Factory from "../factories/Factory";
|
2
3
|
/**
|
3
4
|
* 特征工厂类
|
4
5
|
*/
|
5
|
-
declare class FeatureFactory {
|
6
|
+
declare class FeatureFactory extends Factory<IFeature> {
|
7
|
+
getInstances(): IFeature[];
|
6
8
|
/**
|
7
9
|
* 获取指定特征实例
|
8
10
|
*/
|
9
|
-
|
11
|
+
create(type: string, conn?: string): IFeature;
|
10
12
|
}
|
11
13
|
export default FeatureFactory;
|
@@ -1,13 +1,12 @@
|
|
1
1
|
import IHasher from "./IHasher";
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
private static md5;
|
2
|
+
import Factory from "../factories/Factory";
|
3
|
+
declare class HasherFactory extends Factory<IHasher> {
|
4
|
+
getInstances(): IHasher[];
|
5
|
+
create(type: string, conn?: string): IHasher;
|
6
|
+
private md5;
|
8
7
|
/**
|
9
8
|
* 获取MD5 Hash对象
|
10
9
|
*/
|
11
|
-
|
10
|
+
getMd5(): IHasher;
|
12
11
|
}
|
13
12
|
export default HasherFactory;
|
package/esm/drivers/index.d.ts
CHANGED
@@ -1,4 +1,3 @@
|
|
1
|
-
import DriverHelper from "./driver-helper";
|
2
1
|
export * from "./excels/index";
|
3
2
|
export * from "./factories/index";
|
4
3
|
export * from "./features/index";
|
@@ -7,4 +6,3 @@ export * from "./providers/index";
|
|
7
6
|
export * from "./requesters/index";
|
8
7
|
export * from "./signers/index";
|
9
8
|
export * from "./ssos/index";
|
10
|
-
export { DriverHelper, };
|
@@ -0,0 +1,17 @@
|
|
1
|
+
import IProvider from "./IProvider";
|
2
|
+
/**
|
3
|
+
* 提供程序基类
|
4
|
+
*/
|
5
|
+
declare abstract class Provider implements IProvider {
|
6
|
+
type: string;
|
7
|
+
createAsync(store: string): Promise<any>;
|
8
|
+
deleteAsync(id: any): Promise<any>;
|
9
|
+
getAsync(id: any): Promise<any>;
|
10
|
+
insertAsync(id: any, entity: any): Promise<any>;
|
11
|
+
openAsync(conn: string): Promise<number>;
|
12
|
+
saveAsync(id: any, entity: any): Promise<any>;
|
13
|
+
updateAsync(id: any, entity: any): Promise<any>;
|
14
|
+
commit(): void;
|
15
|
+
dispose(): void;
|
16
|
+
}
|
17
|
+
export default Provider;
|
@@ -1,11 +1,18 @@
|
|
1
1
|
import IProvider from "./IProvider";
|
2
|
+
import Factory from "../factories/Factory";
|
2
3
|
/**
|
3
4
|
* 数据库提供程序工厂类
|
4
5
|
*/
|
5
|
-
declare class ProviderFactory {
|
6
|
+
declare class ProviderFactory extends Factory<IProvider> {
|
7
|
+
getInstances(): IProvider[];
|
6
8
|
/**
|
7
9
|
* 获取指定类型的提供程序
|
8
10
|
*/
|
9
|
-
|
11
|
+
create(type: string, conn?: string): IProvider;
|
12
|
+
private _default;
|
13
|
+
/**
|
14
|
+
* 获取并开启 指定类型的驱动程序
|
15
|
+
*/
|
16
|
+
getDefault(type: string, store?: string): Promise<IProvider>;
|
10
17
|
}
|
11
18
|
export default ProviderFactory;
|
@@ -1,8 +1,8 @@
|
|
1
|
-
import
|
1
|
+
import Provider from "../Provider";
|
2
2
|
/**
|
3
3
|
* IndexedDB提供程序实现
|
4
4
|
*/
|
5
|
-
declare class IndexedDbProvider
|
5
|
+
declare class IndexedDbProvider extends Provider {
|
6
6
|
type: string;
|
7
7
|
database: string;
|
8
8
|
store: string;
|
@@ -10,12 +10,16 @@ interface IRequester extends IDriver {
|
|
10
10
|
*/
|
11
11
|
open(conn: string): void;
|
12
12
|
/**
|
13
|
-
*
|
13
|
+
* 发送Post请求
|
14
14
|
*/
|
15
|
-
|
15
|
+
post<T>(path: string, body: any): Promise<T>;
|
16
16
|
/**
|
17
17
|
* 发送Post请求
|
18
18
|
*/
|
19
|
-
post(
|
19
|
+
post(path: string, body: any): Promise<HttpResponse>;
|
20
|
+
/**
|
21
|
+
* 发送请求
|
22
|
+
*/
|
23
|
+
send(request: HttpRequest): Promise<HttpResponse>;
|
20
24
|
}
|
21
25
|
export default IRequester;
|
@@ -7,6 +7,7 @@ import HttpResponse from "./entities/HttpResponse";
|
|
7
7
|
declare abstract class Requester implements IRequester {
|
8
8
|
type: string;
|
9
9
|
abstract open(conn: string): void;
|
10
|
+
post(path: string, body: any): Promise<HttpResponse>;
|
10
11
|
abstract send(request: HttpRequest): Promise<HttpResponse>;
|
11
12
|
}
|
12
13
|
export default Requester;
|
@@ -1,13 +1,11 @@
|
|
1
|
-
import DefaultRequester from "./implements/DefaultRequester";
|
2
1
|
import IRequester from "./IRequester";
|
3
|
-
import MkRequester from "./implements/MkRequester";
|
4
2
|
import Factory from "../factories/Factory";
|
5
|
-
import LocalRequester from "./implements/LocalRequester";
|
6
3
|
/**
|
7
4
|
* 请求器工厂类
|
8
5
|
*/
|
9
6
|
declare class RequesterFactory extends Factory<IRequester> {
|
10
|
-
|
7
|
+
getInstances(): IRequester[];
|
8
|
+
create(type: string, conn?: string): IRequester;
|
11
9
|
private _default;
|
12
10
|
/**
|
13
11
|
* 获取默认请求器
|
@@ -2,7 +2,7 @@ import HttpRequest from "./HttpRequest";
|
|
2
2
|
/**
|
3
3
|
* Http响应
|
4
4
|
*/
|
5
|
-
|
5
|
+
declare class HttpResponse {
|
6
6
|
/**
|
7
7
|
* 请求耗时
|
8
8
|
*/
|
@@ -15,5 +15,5 @@ type HttpResponse = {
|
|
15
15
|
* 对应的请求信息
|
16
16
|
*/
|
17
17
|
request: HttpRequest;
|
18
|
-
}
|
18
|
+
}
|
19
19
|
export default HttpResponse;
|
@@ -1,11 +1,13 @@
|
|
1
1
|
import ISigner from "./ISigner";
|
2
|
+
import Factory from "../factories/Factory";
|
2
3
|
/**
|
3
4
|
* 签名工厂类
|
4
5
|
*/
|
5
|
-
declare class SignerFactory {
|
6
|
+
declare class SignerFactory extends Factory<ISigner> {
|
7
|
+
getInstances(): ISigner[];
|
6
8
|
/**
|
7
9
|
* 获取指定签名实例
|
8
10
|
*/
|
9
|
-
|
11
|
+
create(type: string, conn?: string): ISigner;
|
10
12
|
}
|
11
13
|
export default SignerFactory;
|
@@ -1,11 +1,17 @@
|
|
1
1
|
import ISso from "./ISso";
|
2
|
+
import Factory from "../factories/Factory";
|
2
3
|
/**
|
3
4
|
* SSO工厂类
|
5
|
+
* @extends {Factory<ISso>}
|
4
6
|
*/
|
5
|
-
declare class SsoFactory {
|
7
|
+
declare class SsoFactory extends Factory<ISso> {
|
8
|
+
/**
|
9
|
+
* @extends {getInstances}
|
10
|
+
*/
|
11
|
+
getInstances(): ISso[];
|
6
12
|
/**
|
7
13
|
* 获取指定SSO实例
|
8
14
|
*/
|
9
|
-
|
15
|
+
create(type: string, conn?: string): ISso;
|
10
16
|
}
|
11
17
|
export default SsoFactory;
|