halo-fe 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- 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 +44 -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/providers/ProviderFactory.d.ts +9 -2
- 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,12 @@
|
|
1
1
|
import { RequesterFactory } from "../requesters";
|
2
|
+
import EncoderFactory from "../encoders/EncoderFactory";
|
3
|
+
import SignerFactory from "../signers/SignerFactory";
|
4
|
+
import CdnFactory from "../cdns/CdnFactory";
|
5
|
+
import ExplainerFactory from "../explainers/ExplainerFactory";
|
6
|
+
import ExcelFactory from "../excels/ExcelFactory";
|
7
|
+
import FeatureFactory from "../features/FeatureFactory";
|
8
|
+
import HasherFactory from "../hashers/HasherFactory";
|
9
|
+
import ProviderFactory from "../providers/ProviderFactory";
|
2
10
|
/**
|
3
11
|
* 驱动工厂类
|
4
12
|
*/
|
@@ -11,9 +19,45 @@ declare class DriverFactory {
|
|
11
19
|
* 获取并缓存工厂实例
|
12
20
|
*/
|
13
21
|
static create(name: string, type: any): any;
|
22
|
+
/**
|
23
|
+
*获取CDN工厂
|
24
|
+
*/
|
25
|
+
static getCdn(): CdnFactory;
|
26
|
+
/**
|
27
|
+
*获取编码器工厂
|
28
|
+
*/
|
29
|
+
static getEncoder(): EncoderFactory;
|
30
|
+
/**
|
31
|
+
*获取Excel工厂
|
32
|
+
*/
|
33
|
+
static getExcel(): ExcelFactory;
|
34
|
+
/**
|
35
|
+
*获取Explainer工厂
|
36
|
+
*/
|
37
|
+
static getExplainer(): ExplainerFactory;
|
38
|
+
/**
|
39
|
+
*获取特征工厂
|
40
|
+
*/
|
41
|
+
static getFeature(): FeatureFactory;
|
42
|
+
/**
|
43
|
+
*获取哈希工厂
|
44
|
+
*/
|
45
|
+
static getHasher(): HasherFactory;
|
46
|
+
/**
|
47
|
+
*获取提供程序工厂
|
48
|
+
*/
|
49
|
+
static getProvider(): ProviderFactory;
|
14
50
|
/**
|
15
51
|
*获取请求器工厂
|
16
52
|
*/
|
17
53
|
static getRequester(): RequesterFactory;
|
54
|
+
/**
|
55
|
+
*获取签名工厂
|
56
|
+
*/
|
57
|
+
static getSigner(): SignerFactory;
|
58
|
+
/**
|
59
|
+
*获取SSO工厂
|
60
|
+
*/
|
61
|
+
static getSso(): SignerFactory;
|
18
62
|
}
|
19
63
|
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;
|
@@ -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;
|
@@ -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;
|