halo-fe 1.0.6 → 1.0.8
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/main.js +2209 -1813
- package/dist/{vendor-underscore-DVTek3G4.js → vendor-underscore-B0BCaBxV.js} +58 -58
- package/esm/coms/RichText.vue.d.ts +1 -1
- package/esm/coms/Timer.vue.d.ts +20 -0
- package/esm/coms/index.d.ts +4 -1
- package/esm/coms/tables/Table.vue.d.ts +2 -0
- package/esm/coms/tables/index.d.ts +1 -0
- package/esm/coms/tabs/Tab.vue.d.ts +12 -0
- package/esm/coms/tabs/TabPane.vue.d.ts +2 -0
- package/esm/coms/tabs/index.d.ts +2 -0
- package/esm/coms/tabs/types/TabProps.d.ts +7 -0
- package/esm/coms/tabs/types/index.d.ts +2 -0
- package/esm/drivers/IDisposable.d.ts +10 -0
- package/esm/drivers/bridges/IBridge.d.ts +1 -5
- package/esm/drivers/builders/Builder.d.ts +8 -0
- package/esm/drivers/builders/BuilderFactory.d.ts +9 -0
- package/esm/drivers/builders/IBuilder.d.ts +7 -0
- package/esm/drivers/builders/implement/JsonBuilder.d.ts +5 -0
- package/esm/drivers/builders/implement/MongoBuilder.d.ts +5 -0
- package/esm/drivers/builders/implement/MySqlBuilder.d.ts +5 -0
- package/esm/drivers/builders/implement/SqlBuilder.d.ts +5 -0
- package/esm/drivers/builders/index.d.ts +2 -0
- package/esm/drivers/cdns/CdnFactory.d.ts +1 -1
- package/esm/drivers/cdns/ICdn.d.ts +2 -1
- package/esm/drivers/cdns/implements/BootCdn.d.ts +2 -2
- package/esm/drivers/cdns/implements/JsdelivrCdn.d.ts +2 -2
- package/esm/drivers/cdns/implements/LocalCdn.d.ts +1 -2
- package/esm/drivers/cdns/implements/StaticFileCdn.d.ts +2 -2
- package/esm/drivers/cdns/implements/UnpkgCdn.d.ts +2 -2
- package/esm/drivers/encoders/EncoderFactory.d.ts +1 -1
- package/esm/drivers/encoders/index.d.ts +2 -2
- package/esm/drivers/excels/Excel.d.ts +10 -0
- package/esm/drivers/excels/ExcelFactory.d.ts +1 -1
- package/esm/drivers/excels/IExcel.d.ts +2 -9
- package/esm/drivers/excels/implements/XlsxExcel.d.ts +4 -4
- package/esm/drivers/excels/index.d.ts +2 -2
- package/esm/drivers/explainers/ExplainerFactory.d.ts +1 -1
- package/esm/drivers/explainers/IExplainer.d.ts +1 -1
- package/esm/drivers/explainers/implement/JsonExplainer.d.ts +3 -0
- package/esm/drivers/factories/Factories.d.ts +55 -0
- package/esm/drivers/factories/implement/CdnFactory.d.ts +13 -0
- package/esm/drivers/factories/implement/EncoderFactory.d.ts +17 -0
- package/esm/drivers/factories/implement/ExcelFactory.d.ts +13 -0
- package/esm/drivers/factories/implement/ExplainerFactory.d.ts +6 -0
- package/esm/drivers/factories/implement/FeatureFactory.d.ts +13 -0
- package/esm/drivers/factories/implement/HasherFactory.d.ts +11 -0
- package/esm/drivers/factories/implement/HttpFactory.d.ts +18 -0
- package/esm/drivers/factories/implement/ProviderFactory.d.ts +18 -0
- package/esm/drivers/factories/implement/SignerFactory.d.ts +13 -0
- package/esm/drivers/factories/implement/SsoFactory.d.ts +17 -0
- package/esm/drivers/factories/implement/TaskFactory.d.ts +9 -0
- package/esm/drivers/factories/implement/VideoFactory.d.ts +3 -0
- package/esm/drivers/factories/implement/VoiceFactory.d.ts +6 -0
- package/esm/drivers/factories/implement/index.d.ts +11 -0
- package/esm/drivers/factories/index.d.ts +5 -26
- package/esm/drivers/features/FeatureFactory.d.ts +1 -1
- package/esm/drivers/features/IFeature.d.ts +1 -1
- package/esm/drivers/features/index.d.ts +2 -2
- package/esm/drivers/hashers/HasherFactory.d.ts +1 -1
- package/esm/drivers/hashers/IHasher.d.ts +0 -1
- package/esm/drivers/hashers/index.d.ts +2 -2
- package/esm/drivers/https/HttpFactory.d.ts +6 -1
- package/esm/drivers/https/IHttp.d.ts +2 -6
- package/esm/drivers/https/index.d.ts +2 -2
- package/esm/drivers/index.d.ts +3 -1
- package/esm/drivers/providers/IProvider.d.ts +5 -1
- package/esm/drivers/providers/Provider.d.ts +9 -9
- package/esm/drivers/providers/ProviderFactory.d.ts +5 -1
- package/esm/drivers/providers/implements/CookieProvider.d.ts +15 -1
- package/esm/drivers/providers/implements/StorageProvider.d.ts +29 -0
- package/esm/drivers/providers/index.d.ts +2 -2
- package/esm/drivers/signers/ISigner.d.ts +1 -1
- package/esm/drivers/signers/SignerFactory.d.ts +1 -1
- package/esm/drivers/signers/index.d.ts +2 -2
- package/esm/drivers/ssos/ISso.d.ts +5 -8
- package/esm/drivers/ssos/Sso.d.ts +18 -0
- package/esm/drivers/ssos/SsoFactory.d.ts +2 -3
- package/esm/drivers/ssos/entities/SsoUser.d.ts +6 -0
- package/esm/drivers/ssos/implements/AnonymousSso.d.ts +11 -9
- package/esm/drivers/ssos/implements/BearerSso.d.ts +11 -10
- package/esm/drivers/ssos/implements/NioSso.d.ts +9 -7
- package/esm/drivers/ssos/implements/SecretSso.d.ts +9 -9
- package/esm/drivers/ssos/implements/WeiXinSso.d.ts +4 -7
- package/esm/drivers/ssos/index.d.ts +3 -2
- package/esm/drivers/tasks/ITask.d.ts +19 -0
- package/esm/drivers/tasks/Task.d.ts +12 -0
- package/esm/drivers/tasks/TaskFactory.d.ts +9 -0
- package/esm/drivers/tasks/implement/MemoryTask.d.ts +13 -0
- package/esm/drivers/tasks/index.d.ts +3 -0
- package/esm/drivers/types/IDispose.d.ts +10 -0
- package/esm/drivers/types/IDriver.d.ts +10 -0
- package/esm/drivers/types/IOpen.d.ts +10 -0
- package/esm/drivers/types/index.d.ts +4 -0
- package/esm/drivers/videos/IVideo.d.ts +4 -0
- package/esm/drivers/videos/VideoFactory.d.ts +4 -1
- package/esm/drivers/videos/index.d.ts +2 -1
- package/esm/drivers/voices/IVoice.d.ts +2 -2
- package/esm/drivers/voices/Voice.d.ts +5 -2
- package/esm/drivers/voices/VoiceFactory.d.ts +1 -1
- package/esm/drivers/voices/index.d.ts +2 -1
- package/esm/factories/Factories.d.ts +55 -0
- package/esm/factories/Factory.d.ts +38 -0
- package/esm/factories/IFactory.d.ts +27 -0
- package/esm/factories/index.d.ts +26 -0
- package/esm/factorying/Factories.d.ts +59 -0
- package/esm/factorying/Factory.d.ts +38 -0
- package/esm/factorying/IFactory.d.ts +27 -0
- package/esm/factorying/index.d.ts +23 -0
- package/esm/helpers/ArrayHelper.d.ts +45 -32
- package/esm/helpers/DictionaryHelper.d.ts +12 -0
- package/esm/helpers/DomHelper.d.ts +4 -0
- package/esm/helpers/HtmlHelper.d.ts +4 -0
- package/esm/helpers/MathHelper.d.ts +16 -12
- package/esm/helpers/StringHelper.d.ts +4 -4
- package/esm/helpers/TimeHelper.d.ts +1 -1
- package/esm/helpers/index.d.ts +1 -2
- package/esm/main.d.ts +1 -0
- package/esm/plugins/Ref.d.ts +7 -0
- package/esm/plugins/index.d.ts +2 -1
- package/esm/svcs/SvcFactory.d.ts +1 -1
- package/esm/svcs/implement/SettingSvc.d.ts +24 -0
- package/esm/svcs/index.d.ts +28 -3
- package/esm/utilities/ListDelta.d.ts +10 -0
- package/esm/utilities/index.d.ts +4 -3
- package/package.json +9 -9
@@ -0,0 +1,18 @@
|
|
1
|
+
import ISso from "./ISso";
|
2
|
+
import SsoUser from "./entities/SsoUser";
|
3
|
+
/**
|
4
|
+
* 单点登录基类
|
5
|
+
*/
|
6
|
+
declare abstract class Sso implements ISso {
|
7
|
+
type: string;
|
8
|
+
abstract open(auth: {
|
9
|
+
url: string;
|
10
|
+
app_id: string;
|
11
|
+
}): Promise<void>;
|
12
|
+
abstract getAuth(token: string, timestamp: number, sign: string, platform: string, env: string): string;
|
13
|
+
abstract getUser(): Promise<SsoUser>;
|
14
|
+
abstract login(form: any): Promise<any>;
|
15
|
+
abstract loginUrl(callback_url: string): string;
|
16
|
+
abstract logout(): Promise<void>;
|
17
|
+
}
|
18
|
+
export default Sso;
|
@@ -1,12 +1,11 @@
|
|
1
1
|
import ISso from "./ISso";
|
2
|
-
import Factory from "
|
2
|
+
import Factory from "../../factorying/Factory";
|
3
3
|
/**
|
4
4
|
* SSO工厂类
|
5
|
-
* @extends {Factory<ISso>}
|
6
5
|
*/
|
7
6
|
declare class SsoFactory extends Factory<ISso> {
|
8
7
|
/**
|
9
|
-
*
|
8
|
+
* 获取实例
|
10
9
|
*/
|
11
10
|
getInstances(): ISso[];
|
12
11
|
/**
|
@@ -1,18 +1,20 @@
|
|
1
|
-
import
|
2
|
-
|
1
|
+
import Sso from "../Sso";
|
2
|
+
import SsoUser from "../entities/SsoUser";
|
3
|
+
import { IProvider } from "../../providers";
|
4
|
+
declare class AnonymousSso extends Sso {
|
3
5
|
type: string;
|
6
|
+
/**
|
7
|
+
* 数据库提供程序
|
8
|
+
*/
|
9
|
+
provider: IProvider;
|
4
10
|
open(auth: {
|
5
11
|
url: string;
|
6
12
|
app_id: string;
|
7
|
-
}): void
|
13
|
+
}): Promise<void>;
|
8
14
|
login(form: any): Promise<any>;
|
9
15
|
loginUrl(callback_url: string): string;
|
10
|
-
getUser():
|
11
|
-
userId: string;
|
12
|
-
token: string;
|
13
|
-
secret: string;
|
14
|
-
};
|
16
|
+
getUser(): Promise<SsoUser>;
|
15
17
|
getAuth(token: string, timestamp: number, signature: string, env: string): string;
|
16
|
-
logout(): void
|
18
|
+
logout(): Promise<void>;
|
17
19
|
}
|
18
20
|
export default AnonymousSso;
|
@@ -1,22 +1,23 @@
|
|
1
|
-
import
|
1
|
+
import Sso from "../Sso";
|
2
|
+
import { IProvider } from "../../providers";
|
3
|
+
import SsoUser from "../entities/SsoUser";
|
2
4
|
/**
|
3
5
|
* 默认登录授权
|
4
6
|
*/
|
5
|
-
declare class BearerSso implements
|
7
|
+
declare class BearerSso implements Sso {
|
6
8
|
type: string;
|
7
|
-
|
9
|
+
/**
|
10
|
+
* 数据库提供程序
|
11
|
+
*/
|
12
|
+
provider: IProvider;
|
8
13
|
open(auth: {
|
9
14
|
url: string;
|
10
15
|
app_id: string;
|
11
|
-
}): void
|
16
|
+
}): Promise<void>;
|
12
17
|
login(form: any): Promise<any>;
|
13
18
|
loginUrl(callback_url: string): string;
|
14
|
-
getUser():
|
15
|
-
userId: string;
|
16
|
-
token: string;
|
17
|
-
secret: string;
|
18
|
-
};
|
19
|
+
getUser(): Promise<SsoUser>;
|
19
20
|
getAuth(token: string, timestamp: number, signature: string, platform?: string, env?: string): string;
|
20
|
-
logout(): void
|
21
|
+
logout(): Promise<void>;
|
21
22
|
}
|
22
23
|
export default BearerSso;
|
@@ -1,4 +1,6 @@
|
|
1
1
|
import ISso from "../ISso";
|
2
|
+
import SsoUser from "../entities/SsoUser";
|
3
|
+
import { IProvider } from "../../providers";
|
2
4
|
/**
|
3
5
|
* NIO SSO实现
|
4
6
|
*/
|
@@ -6,18 +8,18 @@ declare class NioSso implements ISso {
|
|
6
8
|
type: string;
|
7
9
|
url: string;
|
8
10
|
app_id: string;
|
11
|
+
/**
|
12
|
+
* 数据库提供程序
|
13
|
+
*/
|
14
|
+
provider: IProvider;
|
9
15
|
open(auth: {
|
10
16
|
url: string;
|
11
17
|
app_id: string;
|
12
|
-
}): void
|
18
|
+
}): Promise<void>;
|
13
19
|
login(form: any): Promise<any>;
|
14
20
|
loginUrl(callback_url: string): string;
|
15
|
-
getUser():
|
16
|
-
userId: string;
|
17
|
-
token: string;
|
18
|
-
secret: string;
|
19
|
-
};
|
21
|
+
getUser(): Promise<SsoUser>;
|
20
22
|
getAuth(token: string, timestamp: number, signature: string, env: string): string;
|
21
|
-
logout(): void
|
23
|
+
logout(): Promise<void>;
|
22
24
|
}
|
23
25
|
export default NioSso;
|
@@ -1,20 +1,20 @@
|
|
1
1
|
import ISso from "../ISso";
|
2
|
-
import {
|
2
|
+
import { IProvider } from "../../providers";
|
3
|
+
import SsoUser from "../entities/SsoUser";
|
3
4
|
declare class SecretSso implements ISso {
|
4
5
|
type: string;
|
5
|
-
|
6
|
+
/**
|
7
|
+
* 数据库提供程序
|
8
|
+
*/
|
9
|
+
provider: IProvider;
|
6
10
|
open(auth: {
|
7
11
|
url: string;
|
8
12
|
app_id: string;
|
9
|
-
}): void
|
13
|
+
}): Promise<void>;
|
10
14
|
login(form: any): Promise<any>;
|
11
15
|
loginUrl(callback_url: string): string;
|
12
|
-
getUser():
|
13
|
-
userId: string;
|
14
|
-
token: string;
|
15
|
-
secret: string;
|
16
|
-
};
|
16
|
+
getUser(): Promise<SsoUser>;
|
17
17
|
getAuth(token: string, timestamp: number, signature: string, env: string): string;
|
18
|
-
logout(): void
|
18
|
+
logout(): Promise<void>;
|
19
19
|
}
|
20
20
|
export default SecretSso;
|
@@ -1,4 +1,5 @@
|
|
1
1
|
import ISso from "../ISso";
|
2
|
+
import SsoUser from "../entities/SsoUser";
|
2
3
|
/**
|
3
4
|
* 微信登录
|
4
5
|
*/
|
@@ -6,15 +7,11 @@ declare class WeiXinSso implements ISso {
|
|
6
7
|
type: string;
|
7
8
|
open(auth: {
|
8
9
|
url: string;
|
9
|
-
}): void
|
10
|
+
}): Promise<void>;
|
10
11
|
login(form: any): Promise<any>;
|
11
12
|
loginUrl(callback_url: string): string;
|
12
|
-
getUser():
|
13
|
-
userId: string;
|
14
|
-
token: string;
|
15
|
-
secret: string;
|
16
|
-
};
|
13
|
+
getUser(): Promise<SsoUser>;
|
17
14
|
getAuth(token: string, timestamp: number, signature: string, env: string): string;
|
18
|
-
logout(): void
|
15
|
+
logout(): Promise<void>;
|
19
16
|
}
|
20
17
|
export default WeiXinSso;
|
@@ -0,0 +1,19 @@
|
|
1
|
+
import { IDriver, IDispose } from "../types";
|
2
|
+
/**
|
3
|
+
* 任务接口
|
4
|
+
*/
|
5
|
+
interface ITask extends IDriver, IDispose {
|
6
|
+
/**
|
7
|
+
* 多线程执行任务,会在主线程空闲时按顺序执行
|
8
|
+
*/
|
9
|
+
execute<T>(entities: T[], threads: number, handler: (chunk: T[], index: number) => Promise<void>): Promise<void>;
|
10
|
+
/**
|
11
|
+
* 按照频控去执行任务
|
12
|
+
*/
|
13
|
+
executeFrequency<T>(entities: T[], frequency: number, threads: number, handler: (chunk: T[], index: number) => Promise<void>): Promise<void>;
|
14
|
+
/**
|
15
|
+
* 每间隔指定时间执行指定任务
|
16
|
+
*/
|
17
|
+
interval(ms: number, task: () => void): void;
|
18
|
+
}
|
19
|
+
export default ITask;
|
@@ -0,0 +1,12 @@
|
|
1
|
+
import ITask from "./ITask";
|
2
|
+
/**
|
3
|
+
* 任务基类
|
4
|
+
*/
|
5
|
+
declare abstract class Task implements ITask {
|
6
|
+
type: string;
|
7
|
+
abstract execute<T>(entities: T[], threads: number, handler: (chunk: T[], index: number) => Promise<void>): Promise<void>;
|
8
|
+
abstract executeFrequency<T>(entities: T[], frequency: number, threads: number, handler: (chunk: T[], index: number) => Promise<void>): Promise<void>;
|
9
|
+
abstract interval(ms: number, task: () => void): void;
|
10
|
+
abstract dispose(): void;
|
11
|
+
}
|
12
|
+
export default Task;
|
@@ -0,0 +1,13 @@
|
|
1
|
+
import Task from "../Task";
|
2
|
+
/**
|
3
|
+
* 内存任务
|
4
|
+
*/
|
5
|
+
declare class MemoryTask extends Task {
|
6
|
+
type: string;
|
7
|
+
intervalTimeout: any;
|
8
|
+
execute<T>(entities: T[], threads: number, handler: (chunk: T[], index: number) => Promise<void>): Promise<void>;
|
9
|
+
executeFrequency<T>(entities: T[], frequency: number, threads: number, handler: (chunk: T[], index: number) => Promise<void>): Promise<void>;
|
10
|
+
interval(ms: number, task: () => void): void;
|
11
|
+
dispose(): void;
|
12
|
+
}
|
13
|
+
export default MemoryTask;
|
@@ -1 +1,2 @@
|
|
1
|
-
|
1
|
+
import VideoFactory from "./VideoFactory";
|
2
|
+
export { VideoFactory };
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import IDriver from "../
|
1
|
+
import { IDriver } from "../types";
|
2
2
|
export interface IVoice extends IDriver {
|
3
3
|
/**
|
4
4
|
* 开始录音
|
@@ -11,5 +11,5 @@ export interface IVoice extends IDriver {
|
|
11
11
|
/**
|
12
12
|
* 下载录音
|
13
13
|
*/
|
14
|
-
download():
|
14
|
+
download(): void;
|
15
15
|
}
|
@@ -1,8 +1,11 @@
|
|
1
1
|
import { IVoice } from "./IVoice";
|
2
|
+
/**
|
3
|
+
* 声音处理基类
|
4
|
+
*/
|
2
5
|
declare abstract class Voice implements IVoice {
|
3
6
|
type: string;
|
4
|
-
abstract download(): any;
|
5
|
-
abstract endRecord(): any;
|
6
7
|
abstract startRecord(): string;
|
8
|
+
abstract download(): void;
|
9
|
+
abstract endRecord(): string;
|
7
10
|
}
|
8
11
|
export default Voice;
|
@@ -1 +1,2 @@
|
|
1
|
-
|
1
|
+
import VoiceFactory from "./VoiceFactory";
|
2
|
+
export { VoiceFactory };
|
@@ -0,0 +1,55 @@
|
|
1
|
+
import { CdnFactory, EncoderFactory, ExcelFactory, ExplainerFactory, FeatureFactory, HasherFactory, HttpFactory, ProviderFactory, SignerFactory, SsoFactory } from "../drivers";
|
2
|
+
/**
|
3
|
+
* 驱动工厂类
|
4
|
+
*/
|
5
|
+
declare class Factories {
|
6
|
+
/**
|
7
|
+
* 工厂缓存
|
8
|
+
*/
|
9
|
+
static mappings: {};
|
10
|
+
/**
|
11
|
+
* 并缓存工厂实例
|
12
|
+
*/
|
13
|
+
static create<T>(name: string, type: any): T;
|
14
|
+
/**
|
15
|
+
*CDN工厂
|
16
|
+
*/
|
17
|
+
static get cdn(): CdnFactory;
|
18
|
+
/**
|
19
|
+
*编码器工厂
|
20
|
+
*/
|
21
|
+
static get encoder(): EncoderFactory;
|
22
|
+
/**
|
23
|
+
*Excel工厂
|
24
|
+
*/
|
25
|
+
static get excel(): ExcelFactory;
|
26
|
+
/**
|
27
|
+
*Explainer工厂
|
28
|
+
*/
|
29
|
+
static get explainer(): ExplainerFactory;
|
30
|
+
/**
|
31
|
+
*特征工厂
|
32
|
+
*/
|
33
|
+
static get feature(): FeatureFactory;
|
34
|
+
/**
|
35
|
+
*哈希工厂
|
36
|
+
*/
|
37
|
+
static get hasher(): HasherFactory;
|
38
|
+
/**
|
39
|
+
*提供程序工厂
|
40
|
+
*/
|
41
|
+
static get provider(): ProviderFactory;
|
42
|
+
/**
|
43
|
+
*Http请求工厂
|
44
|
+
*/
|
45
|
+
static get http(): HttpFactory;
|
46
|
+
/**
|
47
|
+
*签名工厂
|
48
|
+
*/
|
49
|
+
static get signer(): SignerFactory;
|
50
|
+
/**
|
51
|
+
*SSO工厂
|
52
|
+
*/
|
53
|
+
static get sso(): SsoFactory;
|
54
|
+
}
|
55
|
+
export default Factories;
|
@@ -0,0 +1,38 @@
|
|
1
|
+
import IFactory from "./IFactory";
|
2
|
+
import IDriver from "../drivers/IDriver";
|
3
|
+
import { Ref } from "../plugins";
|
4
|
+
/**
|
5
|
+
* 工厂基类
|
6
|
+
*/
|
7
|
+
declare abstract class Factory<T extends IDriver> implements IFactory<T> {
|
8
|
+
/**
|
9
|
+
* 开启
|
10
|
+
*/
|
11
|
+
open(): void;
|
12
|
+
/**
|
13
|
+
* 实例集合
|
14
|
+
* 或者使用:Record<string, string>
|
15
|
+
*/
|
16
|
+
private instances;
|
17
|
+
/**
|
18
|
+
* 获取当前驱动所有实例
|
19
|
+
*/
|
20
|
+
abstract getInstances(): T[];
|
21
|
+
/**
|
22
|
+
* 创建指定类型驱动
|
23
|
+
*/
|
24
|
+
create(type: string, conn?: string): Promise<T>;
|
25
|
+
/**
|
26
|
+
* 根据主键创建驱动,并返回加载后的驱动信息
|
27
|
+
*/
|
28
|
+
createById(id: number, driverRef?: Ref<any>): Promise<T>;
|
29
|
+
/**
|
30
|
+
* 从缓存中获取指定名称的驱动,不存在则创建并执行初始化
|
31
|
+
*/
|
32
|
+
createIfAbsent(name: string, type?: string, open?: (entity: T) => void): Promise<T>;
|
33
|
+
/**
|
34
|
+
* 加载驱动明细
|
35
|
+
*/
|
36
|
+
loadDriver(id: number): Promise<any>;
|
37
|
+
}
|
38
|
+
export default Factory;
|
@@ -0,0 +1,27 @@
|
|
1
|
+
import { Ref } from "../plugins";
|
2
|
+
/**
|
3
|
+
* 工厂接口
|
4
|
+
*/
|
5
|
+
interface IFactory<T> {
|
6
|
+
/**
|
7
|
+
* 开启工厂
|
8
|
+
*/
|
9
|
+
open(): void;
|
10
|
+
/**
|
11
|
+
* 获取当前驱动所有实例
|
12
|
+
*/
|
13
|
+
getInstances(): T[];
|
14
|
+
/**
|
15
|
+
* 创建指定类型的实例
|
16
|
+
*/
|
17
|
+
create(type: string, conn?: string): Promise<T>;
|
18
|
+
/**
|
19
|
+
* 根据主键创建驱动,并返回加载后的驱动信息
|
20
|
+
*/
|
21
|
+
createById(id: number, driverRef?: Ref<any>): Promise<T>;
|
22
|
+
/**
|
23
|
+
* 从缓存中获取指定名称的驱动,不存在则创建并执行初始化
|
24
|
+
*/
|
25
|
+
createIfAbsent(name: string, type: string, open?: (entity: T) => void): Promise<T>;
|
26
|
+
}
|
27
|
+
export default IFactory;
|
@@ -0,0 +1,26 @@
|
|
1
|
+
import Factories from "./Factories";
|
2
|
+
import { IEncoder } from "../drivers/encoders";
|
3
|
+
import { IHttp } from "../drivers/https";
|
4
|
+
import { IHasher } from "../drivers/hashers";
|
5
|
+
import { IProvider } from "../drivers";
|
6
|
+
/**
|
7
|
+
* 默认base64编码
|
8
|
+
*/
|
9
|
+
declare let base64: IEncoder;
|
10
|
+
/**
|
11
|
+
* 默认Http请求对象
|
12
|
+
*/
|
13
|
+
declare let http: IHttp;
|
14
|
+
/**
|
15
|
+
* MD5 hash计算
|
16
|
+
*/
|
17
|
+
declare let md5: IHasher;
|
18
|
+
/**
|
19
|
+
* 默认Storage
|
20
|
+
*/
|
21
|
+
declare let storage: IProvider;
|
22
|
+
/**
|
23
|
+
* 初始化默认驱动实例
|
24
|
+
*/
|
25
|
+
declare let initDriver: () => Promise<void>;
|
26
|
+
export { Factories, base64, http, md5, storage, initDriver };
|
@@ -0,0 +1,59 @@
|
|
1
|
+
import { CdnFactory, EncoderFactory, ExcelFactory, ExplainerFactory, FeatureFactory, HasherFactory, HttpFactory, ProviderFactory, SignerFactory, SsoFactory, TaskFactory } from "../drivers";
|
2
|
+
/**
|
3
|
+
* 驱动工厂类
|
4
|
+
*/
|
5
|
+
declare class Factories {
|
6
|
+
/**
|
7
|
+
* 工厂缓存
|
8
|
+
*/
|
9
|
+
static mappings: {};
|
10
|
+
/**
|
11
|
+
* 并缓存工厂实例
|
12
|
+
*/
|
13
|
+
static create<T>(type: any): T;
|
14
|
+
/**
|
15
|
+
*CDN工厂
|
16
|
+
*/
|
17
|
+
static get cdn(): CdnFactory;
|
18
|
+
/**
|
19
|
+
*编码器工厂
|
20
|
+
*/
|
21
|
+
static get encoder(): EncoderFactory;
|
22
|
+
/**
|
23
|
+
*Excel工厂
|
24
|
+
*/
|
25
|
+
static get excel(): ExcelFactory;
|
26
|
+
/**
|
27
|
+
*Explainer工厂
|
28
|
+
*/
|
29
|
+
static get explainer(): ExplainerFactory;
|
30
|
+
/**
|
31
|
+
*特征工厂
|
32
|
+
*/
|
33
|
+
static get feature(): FeatureFactory;
|
34
|
+
/**
|
35
|
+
*哈希工厂
|
36
|
+
*/
|
37
|
+
static get hasher(): HasherFactory;
|
38
|
+
/**
|
39
|
+
*Http请求工厂
|
40
|
+
*/
|
41
|
+
static get http(): HttpFactory;
|
42
|
+
/**
|
43
|
+
*提供程序工厂
|
44
|
+
*/
|
45
|
+
static get provider(): ProviderFactory;
|
46
|
+
/**
|
47
|
+
*签名工厂
|
48
|
+
*/
|
49
|
+
static get signer(): SignerFactory;
|
50
|
+
/**
|
51
|
+
*SSO工厂
|
52
|
+
*/
|
53
|
+
static get sso(): SsoFactory;
|
54
|
+
/**
|
55
|
+
*Task工厂
|
56
|
+
*/
|
57
|
+
static get task(): TaskFactory;
|
58
|
+
}
|
59
|
+
export default Factories;
|
@@ -0,0 +1,38 @@
|
|
1
|
+
import IFactory from "./IFactory";
|
2
|
+
import IDriver from "../drivers/types/IDriver";
|
3
|
+
import { Ref } from "../plugins";
|
4
|
+
/**
|
5
|
+
* 工厂基类
|
6
|
+
*/
|
7
|
+
declare abstract class Factory<T extends IDriver> implements IFactory<T> {
|
8
|
+
/**
|
9
|
+
* 开启
|
10
|
+
*/
|
11
|
+
open(): void;
|
12
|
+
/**
|
13
|
+
* 实例集合
|
14
|
+
* 或者使用:Record<string, string>
|
15
|
+
*/
|
16
|
+
private instances;
|
17
|
+
/**
|
18
|
+
* 获取当前驱动所有实例
|
19
|
+
*/
|
20
|
+
abstract getInstances(): T[];
|
21
|
+
/**
|
22
|
+
* 创建指定类型驱动
|
23
|
+
*/
|
24
|
+
create(type: string, conn?: string): Promise<T>;
|
25
|
+
/**
|
26
|
+
* 根据主键创建驱动,并返回加载后的驱动信息
|
27
|
+
*/
|
28
|
+
createById(id: number, driverRef?: Ref<any>): Promise<T>;
|
29
|
+
/**
|
30
|
+
* 从缓存中获取指定名称的驱动,不存在则创建并执行初始化
|
31
|
+
*/
|
32
|
+
createIfAbsent(name: string, type?: string, open?: (entity: T) => void): Promise<T>;
|
33
|
+
/**
|
34
|
+
* 加载驱动明细
|
35
|
+
*/
|
36
|
+
loadDriver(id: number): Promise<any>;
|
37
|
+
}
|
38
|
+
export default Factory;
|
@@ -0,0 +1,27 @@
|
|
1
|
+
import { Ref } from "../plugins";
|
2
|
+
/**
|
3
|
+
* 工厂接口
|
4
|
+
*/
|
5
|
+
interface IFactory<T> {
|
6
|
+
/**
|
7
|
+
* 开启工厂
|
8
|
+
*/
|
9
|
+
open(): void;
|
10
|
+
/**
|
11
|
+
* 获取当前驱动所有实例
|
12
|
+
*/
|
13
|
+
getInstances(): T[];
|
14
|
+
/**
|
15
|
+
* 创建指定类型的实例
|
16
|
+
*/
|
17
|
+
create(type: string, conn?: string): Promise<T>;
|
18
|
+
/**
|
19
|
+
* 根据主键创建驱动,并返回加载后的驱动信息
|
20
|
+
*/
|
21
|
+
createById(id: number, driverRef?: Ref<any>): Promise<T>;
|
22
|
+
/**
|
23
|
+
* 从缓存中获取指定名称的驱动,不存在则创建并执行初始化
|
24
|
+
*/
|
25
|
+
createIfAbsent(name: string, type: string, open?: (entity: T) => void): Promise<T>;
|
26
|
+
}
|
27
|
+
export default IFactory;
|
@@ -0,0 +1,23 @@
|
|
1
|
+
import Factories from "./Factories";
|
2
|
+
import { IEncoder, IHasher, IHttp, IProvider } from "../drivers";
|
3
|
+
/**
|
4
|
+
* 默认base64编码
|
5
|
+
*/
|
6
|
+
declare let base64: IEncoder;
|
7
|
+
/**
|
8
|
+
* 默认Http请求对象
|
9
|
+
*/
|
10
|
+
declare let http: IHttp;
|
11
|
+
/**
|
12
|
+
* MD5 hash计算
|
13
|
+
*/
|
14
|
+
declare let md5: IHasher;
|
15
|
+
/**
|
16
|
+
* 默认Storage
|
17
|
+
*/
|
18
|
+
declare let storage: IProvider;
|
19
|
+
/**
|
20
|
+
* 初始化默认驱动实例
|
21
|
+
*/
|
22
|
+
declare let initDriver: () => Promise<void>;
|
23
|
+
export { base64, http, md5, storage, initDriver, Factories };
|