halo-fe 1.0.7 → 1.0.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (106) hide show
  1. package/dist/main.js +2234 -1871
  2. package/dist/{vendor-underscore-DVTek3G4.js → vendor-underscore-B0BCaBxV.js} +58 -58
  3. package/esm/coms/RichText.vue.d.ts +1 -1
  4. package/esm/coms/Timer.vue.d.ts +20 -0
  5. package/esm/coms/index.d.ts +4 -1
  6. package/esm/coms/tables/Table.vue.d.ts +2 -0
  7. package/esm/coms/tables/index.d.ts +1 -0
  8. package/esm/coms/tabs/Tab.vue.d.ts +12 -0
  9. package/esm/coms/tabs/TabPane.vue.d.ts +2 -0
  10. package/esm/coms/tabs/index.d.ts +2 -0
  11. package/esm/coms/tabs/types/TabProps.d.ts +7 -0
  12. package/esm/coms/tabs/types/index.d.ts +2 -0
  13. package/esm/drivers/IDisposable.d.ts +6 -0
  14. package/esm/drivers/bridges/IBridge.d.ts +1 -5
  15. package/esm/drivers/builders/Builder.d.ts +8 -0
  16. package/esm/drivers/builders/BuilderFactory.d.ts +9 -0
  17. package/esm/drivers/builders/IBuilder.d.ts +7 -0
  18. package/esm/drivers/builders/implement/JsonBuilder.d.ts +5 -0
  19. package/esm/drivers/builders/implement/MongoBuilder.d.ts +5 -0
  20. package/esm/drivers/builders/implement/MySqlBuilder.d.ts +5 -0
  21. package/esm/drivers/builders/implement/SqlBuilder.d.ts +5 -0
  22. package/esm/drivers/builders/index.d.ts +2 -0
  23. package/esm/drivers/cdns/CdnFactory.d.ts +1 -1
  24. package/esm/drivers/cdns/ICdn.d.ts +2 -1
  25. package/esm/drivers/cdns/implements/BootCdn.d.ts +2 -2
  26. package/esm/drivers/cdns/implements/JsdelivrCdn.d.ts +2 -2
  27. package/esm/drivers/cdns/implements/LocalCdn.d.ts +1 -2
  28. package/esm/drivers/cdns/implements/StaticFileCdn.d.ts +2 -2
  29. package/esm/drivers/cdns/implements/UnpkgCdn.d.ts +2 -2
  30. package/esm/drivers/cdns/index.d.ts +2 -1
  31. package/esm/drivers/encoders/EncoderFactory.d.ts +1 -1
  32. package/esm/drivers/encoders/index.d.ts +2 -1
  33. package/esm/drivers/excels/Excel.d.ts +10 -0
  34. package/esm/drivers/excels/ExcelFactory.d.ts +1 -1
  35. package/esm/drivers/excels/IExcel.d.ts +2 -9
  36. package/esm/drivers/excels/implements/XlsxExcel.d.ts +4 -4
  37. package/esm/drivers/excels/index.d.ts +2 -1
  38. package/esm/drivers/explainers/ExplainerFactory.d.ts +1 -1
  39. package/esm/drivers/explainers/IExplainer.d.ts +1 -1
  40. package/esm/drivers/explainers/implement/JsonExplainer.d.ts +3 -0
  41. package/esm/drivers/explainers/index.d.ts +2 -1
  42. package/esm/drivers/features/FeatureFactory.d.ts +1 -1
  43. package/esm/drivers/features/IFeature.d.ts +1 -1
  44. package/esm/drivers/features/index.d.ts +2 -1
  45. package/esm/drivers/hashers/HasherFactory.d.ts +1 -1
  46. package/esm/drivers/hashers/IHasher.d.ts +0 -1
  47. package/esm/drivers/hashers/index.d.ts +2 -1
  48. package/esm/drivers/https/HttpFactory.d.ts +6 -1
  49. package/esm/drivers/https/IHttp.d.ts +2 -6
  50. package/esm/drivers/https/index.d.ts +2 -1
  51. package/esm/drivers/index.d.ts +3 -1
  52. package/esm/drivers/providers/IProvider.d.ts +5 -1
  53. package/esm/drivers/providers/Provider.d.ts +9 -9
  54. package/esm/drivers/providers/ProviderFactory.d.ts +5 -1
  55. package/esm/drivers/providers/implements/CookieProvider.d.ts +15 -1
  56. package/esm/drivers/providers/implements/StorageProvider.d.ts +29 -0
  57. package/esm/drivers/providers/index.d.ts +2 -1
  58. package/esm/drivers/signers/ISigner.d.ts +1 -1
  59. package/esm/drivers/signers/SignerFactory.d.ts +1 -1
  60. package/esm/drivers/signers/index.d.ts +2 -1
  61. package/esm/drivers/ssos/ISso.d.ts +5 -8
  62. package/esm/drivers/ssos/Sso.d.ts +18 -0
  63. package/esm/drivers/ssos/SsoFactory.d.ts +2 -3
  64. package/esm/drivers/ssos/entities/SsoUser.d.ts +6 -0
  65. package/esm/drivers/ssos/implements/AnonymousSso.d.ts +11 -9
  66. package/esm/drivers/ssos/implements/BearerSso.d.ts +11 -10
  67. package/esm/drivers/ssos/implements/NioSso.d.ts +9 -7
  68. package/esm/drivers/ssos/implements/SecretSso.d.ts +9 -9
  69. package/esm/drivers/ssos/implements/WeiXinSso.d.ts +4 -7
  70. package/esm/drivers/ssos/index.d.ts +3 -1
  71. package/esm/drivers/tasks/ITask.d.ts +10 -3
  72. package/esm/drivers/tasks/Task.d.ts +2 -0
  73. package/esm/drivers/tasks/TaskFactory.d.ts +9 -0
  74. package/esm/drivers/tasks/implement/MemoryTask.d.ts +2 -0
  75. package/esm/drivers/tasks/index.d.ts +2 -1
  76. package/esm/drivers/types/IDispose.d.ts +10 -0
  77. package/esm/drivers/types/IDriver.d.ts +10 -0
  78. package/esm/drivers/types/IOpen.d.ts +10 -0
  79. package/esm/drivers/types/index.d.ts +4 -0
  80. package/esm/drivers/videos/IVideo.d.ts +4 -0
  81. package/esm/drivers/videos/VideoFactory.d.ts +4 -1
  82. package/esm/drivers/videos/index.d.ts +2 -1
  83. package/esm/drivers/voices/IVoice.d.ts +2 -2
  84. package/esm/drivers/voices/Voice.d.ts +5 -2
  85. package/esm/drivers/voices/VoiceFactory.d.ts +1 -1
  86. package/esm/drivers/voices/index.d.ts +2 -1
  87. package/esm/factories/Factories.d.ts +55 -0
  88. package/esm/factories/Factory.d.ts +38 -0
  89. package/esm/factories/IFactory.d.ts +27 -0
  90. package/esm/factories/index.d.ts +26 -0
  91. package/esm/factorying/Factories.d.ts +59 -0
  92. package/esm/factorying/Factory.d.ts +38 -0
  93. package/esm/factorying/IFactory.d.ts +27 -0
  94. package/esm/factorying/index.d.ts +23 -0
  95. package/esm/helpers/ArrayHelper.d.ts +44 -32
  96. package/esm/helpers/DictionaryHelper.d.ts +12 -0
  97. package/esm/helpers/TimeHelper.d.ts +1 -1
  98. package/esm/helpers/index.d.ts +1 -2
  99. package/esm/main.d.ts +1 -0
  100. package/esm/plugins/Ref.d.ts +7 -0
  101. package/esm/plugins/index.d.ts +2 -1
  102. package/esm/svcs/implement/SettingSvc.d.ts +24 -0
  103. package/esm/svcs/index.d.ts +26 -2
  104. package/esm/utilities/ListDelta.d.ts +10 -0
  105. package/esm/utilities/index.d.ts +4 -3
  106. package/package.json +8 -8
@@ -0,0 +1,10 @@
1
+ import IExcel from "./IExcel";
2
+ /**
3
+ * Excel操作基类
4
+ */
5
+ declare abstract class Excel implements IExcel {
6
+ type: string;
7
+ abstract open(conn?: string): Promise<void>;
8
+ abstract export(dataRows: any[], name: string): any;
9
+ }
10
+ export default Excel;
@@ -1,5 +1,5 @@
1
1
  import IExcel from "./IExcel";
2
- import Factory from "../factories/Factory";
2
+ import Factory from "../../factorying/Factory";
3
3
  /**
4
4
  * Excel工厂
5
5
  */
@@ -1,15 +1,8 @@
1
+ import { IDriver, IOpen } from "../types";
1
2
  /**
2
3
  * Excel操作接口
3
4
  */
4
- interface IExcel {
5
- /**
6
- * 类型
7
- */
8
- type: string;
9
- /**
10
- * 开启Excel
11
- */
12
- open(conn: string): void;
5
+ interface IExcel extends IDriver, IOpen {
13
6
  /**
14
7
  * 导出数据
15
8
  */
@@ -1,10 +1,10 @@
1
- import IExcel from "../IExcel";
1
+ import Excel from "../Excel";
2
2
  /**
3
3
  * XlsxExcel操作
4
4
  */
5
- declare class XlsxExcel implements IExcel {
5
+ declare class XlsxExcel extends Excel {
6
6
  type: string;
7
- open(conn: string): void;
8
- export(dataRows: any[], name: string): void;
7
+ open(conn: string): Promise<void>;
8
+ export(dataRows: any[], name: string): any;
9
9
  }
10
10
  export default XlsxExcel;
@@ -1,2 +1,3 @@
1
1
  import IExcel from "./IExcel";
2
- export { type IExcel, };
2
+ import ExcelFactory from "./ExcelFactory";
3
+ export { type IExcel, ExcelFactory };
@@ -1,4 +1,4 @@
1
- import Factory from "../factories/Factory";
1
+ import Factory from "../../factorying/Factory";
2
2
  import IExplainer from "./IExplainer";
3
3
  declare class ExplainerFactory extends Factory<IExplainer> {
4
4
  getInstances(): IExplainer[];
@@ -1,4 +1,4 @@
1
- import IDriver from "../IDriver";
1
+ import { IDriver } from "../types";
2
2
  interface IExplainer extends IDriver {
3
3
  }
4
4
  export default IExplainer;
@@ -1,4 +1,7 @@
1
1
  import Explainer from "../Explainer";
2
+ /**
3
+ * Json内容解析器
4
+ */
2
5
  declare class JsonExplainer extends Explainer {
3
6
  }
4
7
  export default JsonExplainer;
@@ -1 +1,2 @@
1
- export {};
1
+ import ExplainerFactory from "./ExplainerFactory";
2
+ export { ExplainerFactory };
@@ -1,5 +1,5 @@
1
1
  import IFeature from "./IFeature";
2
- import Factory from "../factories/Factory";
2
+ import Factory from "../../factorying/Factory";
3
3
  /**
4
4
  * 特征工厂类
5
5
  */
@@ -1,4 +1,4 @@
1
- import IDriver from "../IDriver";
1
+ import { IDriver } from "../types";
2
2
  /**
3
3
  * 特征接口
4
4
  */
@@ -1,2 +1,3 @@
1
1
  import IFeature from "./IFeature";
2
- export { type IFeature };
2
+ import FeatureFactory from "./FeatureFactory";
3
+ export { type IFeature, FeatureFactory };
@@ -1,5 +1,5 @@
1
1
  import IHasher from "./IHasher";
2
- import Factory from "../factories/Factory";
2
+ import Factory from "../../factorying/Factory";
3
3
  declare class HasherFactory extends Factory<IHasher> {
4
4
  getInstances(): IHasher[];
5
5
  create(type: string, conn?: string): Promise<IHasher>;
@@ -12,7 +12,6 @@ interface IHasher {
12
12
  open(conn: string): void;
13
13
  /**
14
14
  * 计算字符串Hash值
15
- * @param value
16
15
  */
17
16
  compute(value: string): Promise<string>;
18
17
  }
@@ -1,2 +1,3 @@
1
1
  import IHasher from "./IHasher";
2
- export { type IHasher };
2
+ import HasherFactory from "./HasherFactory";
3
+ export { type IHasher, HasherFactory };
@@ -1,10 +1,15 @@
1
1
  import IHttp from "./IHttp";
2
- import Factory from "../factories/Factory";
2
+ import Factory from "../../factorying/Factory";
3
+ import { Ref } from "../../plugins";
3
4
  /**
4
5
  * 请求器工厂类
5
6
  */
6
7
  declare class HttpFactory extends Factory<IHttp> {
7
8
  getInstances(): IHttp[];
9
+ /**
10
+ * 创建并开启
11
+ */
12
+ createById(id: number, driverRef?: Ref<any>): Promise<IHttp>;
8
13
  /**
9
14
  * 获取默认请求器
10
15
  */
@@ -1,14 +1,10 @@
1
1
  import HttpRequest from "./entities/HttpRequest";
2
2
  import HttpResponse from "./entities/HttpResponse";
3
- import IDriver from "../IDriver";
3
+ import { IDriver, IOpen } from "../types";
4
4
  /**
5
5
  * 请求器接口
6
6
  */
7
- interface IHttp extends IDriver {
8
- /**
9
- * 开启
10
- */
11
- open(conn: string): Promise<void>;
7
+ interface IHttp extends IDriver, IOpen {
12
8
  /**
13
9
  * 请求时执行
14
10
  */
@@ -1,5 +1,6 @@
1
1
  import IHttp from "./IHttp";
2
+ import HttpFactory from "./HttpFactory";
2
3
  import HttpRequest from "./entities/HttpRequest";
3
4
  import HttpResponse from "./entities/HttpResponse";
4
5
  import HaloHttp from "./implements/HaloHttp";
5
- export { type IHttp, HttpRequest, HttpResponse, HaloHttp };
6
+ export { type IHttp, HttpFactory, HttpRequest, HttpResponse, HaloHttp };
@@ -1,14 +1,16 @@
1
1
  export * from "./bridges";
2
+ export * from "./builders";
2
3
  export * from "./cdns";
3
4
  export * from "./encoders";
4
5
  export * from "./excels";
5
6
  export * from "./explainers";
6
- export * from "./factories";
7
7
  export * from "./features";
8
8
  export * from "./hashers";
9
9
  export * from "./https";
10
10
  export * from "./providers";
11
11
  export * from "./signers";
12
12
  export * from "./ssos";
13
+ export * from "./tasks";
14
+ export * from "./types";
13
15
  export * from "./videos";
14
16
  export * from "./voices";
@@ -1,4 +1,4 @@
1
- import IDriver from "../IDriver";
1
+ import { IDriver } from "../types";
2
2
  /**
3
3
  * 数据库提供程序接口
4
4
  */
@@ -19,6 +19,10 @@ interface IProvider extends IDriver {
19
19
  * 查询数据
20
20
  */
21
21
  getAsync(id: any): Promise<any>;
22
+ /**
23
+ * 查询数据,本质调用上面的重载
24
+ */
25
+ getAsync<T>(id: any): Promise<T>;
22
26
  /**
23
27
  * 添加数据
24
28
  */
@@ -4,14 +4,14 @@ import IProvider from "./IProvider";
4
4
  */
5
5
  declare abstract class Provider implements IProvider {
6
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;
7
+ abstract createAsync(store: string): Promise<any>;
8
+ abstract deleteAsync(id: any): Promise<any>;
9
+ abstract getAsync(id: any): Promise<any>;
10
+ abstract insertAsync(id: any, entity: any): Promise<any>;
11
+ abstract openAsync(conn: string): Promise<number>;
12
+ abstract saveAsync(id: any, entity: any): Promise<any>;
13
+ abstract updateAsync(id: any, entity: any): Promise<any>;
14
+ abstract commit(): void;
15
+ abstract dispose(): void;
16
16
  }
17
17
  export default Provider;
@@ -1,5 +1,5 @@
1
1
  import IProvider from "./IProvider";
2
- import Factory from "../factories/Factory";
2
+ import Factory from "../../factorying/Factory";
3
3
  /**
4
4
  * 数据库提供程序工厂类
5
5
  */
@@ -14,5 +14,9 @@ declare class ProviderFactory extends Factory<IProvider> {
14
14
  * 获取并开启默认驱动程序
15
15
  */
16
16
  getDefault(store: string): Promise<IProvider>;
17
+ /**
18
+ * 获取默认Storage提供程序
19
+ */
20
+ getStorage(): Promise<IProvider>;
17
21
  }
18
22
  export default ProviderFactory;
@@ -1,3 +1,17 @@
1
- declare class CookieProvider {
1
+ import Provider from "../Provider";
2
+ /**
3
+ * Cookie提供程序
4
+ */
5
+ declare class CookieProvider extends Provider {
6
+ type: string;
7
+ openAsync(conn: string): Promise<number>;
8
+ createAsync(store: string): Promise<any>;
9
+ deleteAsync(id: any): Promise<any>;
10
+ getAsync(id: any): Promise<any>;
11
+ insertAsync(id: any, entity: any): Promise<any>;
12
+ saveAsync(id: any, entity: any): Promise<any>;
13
+ updateAsync(id: any, entity: any): Promise<any>;
14
+ commit(): void;
15
+ dispose(): void;
2
16
  }
3
17
  export default CookieProvider;
@@ -1,4 +1,33 @@
1
1
  import Provider from "../Provider";
2
+ /**
3
+ * 本地存储提供程序
4
+ */
2
5
  declare class StorageProvider extends Provider {
6
+ type: string;
7
+ openAsync(conn: string): Promise<number>;
8
+ createAsync(store: string): Promise<any>;
9
+ deleteAsync(id: any): Promise<any>;
10
+ getAsync(id: any): Promise<any>;
11
+ insertAsync(id: any, entity: any): Promise<any>;
12
+ saveAsync(id: any, entity: any): Promise<any>;
13
+ updateAsync(id: any, entity: any): Promise<any>;
14
+ commit(): void;
15
+ dispose(): void;
16
+ /**
17
+ * 获取本地存储
18
+ */
19
+ getEntity: (key: string) => any;
20
+ /**
21
+ * 设置本地存储
22
+ */
23
+ setEntity: (key: string, value: any) => void;
24
+ /**
25
+ * 以5M为基准,获取剩余可用容量(KB)
26
+ */
27
+ getLeftStorage: () => number;
28
+ /**
29
+ * 判断指定值是否能够存储到storage中
30
+ */
31
+ canStorage: (value: object) => boolean;
3
32
  }
4
33
  export default StorageProvider;
@@ -1,2 +1,3 @@
1
1
  import IProvider from "./IProvider";
2
- export { type IProvider, };
2
+ import ProviderFactory from "./ProviderFactory";
3
+ export { type IProvider, ProviderFactory };
@@ -28,6 +28,6 @@ interface ISigner {
28
28
  /**
29
29
  * 释放资源
30
30
  */
31
- dispose(): any;
31
+ dispose(): void;
32
32
  }
33
33
  export default ISigner;
@@ -1,5 +1,5 @@
1
1
  import ISigner from "./ISigner";
2
- import Factory from "../factories/Factory";
2
+ import Factory from "../../factorying/Factory";
3
3
  /**
4
4
  * 签名工厂类
5
5
  */
@@ -1,2 +1,3 @@
1
1
  import ISigner from "./ISigner";
2
- export { type ISigner, };
2
+ import SignerFactory from "./SignerFactory";
3
+ export { type ISigner, SignerFactory };
@@ -1,4 +1,5 @@
1
- import IDriver from "../IDriver";
1
+ import { IDriver } from "../types";
2
+ import SsoUser from "./entities/SsoUser";
2
3
  /**
3
4
  * SSO接口
4
5
  */
@@ -9,7 +10,7 @@ interface ISso extends IDriver {
9
10
  open(auth: {
10
11
  url: string;
11
12
  app_id: string;
12
- }): void;
13
+ }): Promise<void>;
13
14
  /**
14
15
  * 登录
15
16
  */
@@ -21,11 +22,7 @@ interface ISso extends IDriver {
21
22
  /**
22
23
  * 获取用户信息
23
24
  */
24
- getUser(): {
25
- userId: string;
26
- token: string;
27
- secret: string;
28
- };
25
+ getUser(): Promise<SsoUser>;
29
26
  /**
30
27
  * 获取授权头,不能泄露域账号等用户标识
31
28
  */
@@ -33,6 +30,6 @@ interface ISso extends IDriver {
33
30
  /**
34
31
  * 退出
35
32
  */
36
- logout(): void;
33
+ logout(): Promise<void>;
37
34
  }
38
35
  export default ISso;
@@ -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 "../factories/Factory";
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
- * @extends {getInstances}
8
+ * 获取实例
10
9
  */
11
10
  getInstances(): ISso[];
12
11
  /**
@@ -0,0 +1,6 @@
1
+ declare class SsoUser {
2
+ userId: string;
3
+ token: string;
4
+ secret: string;
5
+ }
6
+ export default SsoUser;
@@ -1,18 +1,20 @@
1
- import ISso from "../ISso";
2
- declare class AnonymousSso implements ISso {
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 ISso from "../ISso";
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 ISso {
7
+ declare class BearerSso implements Sso {
6
8
  type: string;
7
- static loginKey: string;
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 { IHttp } from "../../https";
2
+ import { IProvider } from "../../providers";
3
+ import SsoUser from "../entities/SsoUser";
3
4
  declare class SecretSso implements ISso {
4
5
  type: string;
5
- http: IHttp;
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;
@@ -1,2 +1,4 @@
1
1
  import ISso from "./ISso";
2
- export { type ISso, };
2
+ import SsoFactory from "./SsoFactory";
3
+ import SsoUser from "./entities/SsoUser";
4
+ export { type ISso, SsoUser, SsoFactory };
@@ -1,9 +1,16 @@
1
- import IDriver from "../IDriver";
2
- import IDisposable from "../IDisposable";
1
+ import { IDriver, IDispose } from "../types";
3
2
  /**
4
3
  * 任务接口
5
4
  */
6
- interface ITask extends IDriver, IDisposable {
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>;
7
14
  /**
8
15
  * 每间隔指定时间执行指定任务
9
16
  */
@@ -4,6 +4,8 @@ import ITask from "./ITask";
4
4
  */
5
5
  declare abstract class Task implements ITask {
6
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>;
7
9
  abstract interval(ms: number, task: () => void): void;
8
10
  abstract dispose(): void;
9
11
  }
@@ -0,0 +1,9 @@
1
+ import Factory from "../../factorying/Factory";
2
+ import ITask from "./ITask";
3
+ /**
4
+ * 任务工厂类
5
+ */
6
+ declare class TaskFactory extends Factory<ITask> {
7
+ getInstances(): ITask[];
8
+ }
9
+ export default TaskFactory;
@@ -5,6 +5,8 @@ import Task from "../Task";
5
5
  declare class MemoryTask extends Task {
6
6
  type: string;
7
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>;
8
10
  interval(ms: number, task: () => void): void;
9
11
  dispose(): void;
10
12
  }
@@ -1,2 +1,3 @@
1
1
  import ITask from "./ITask";
2
- export { type ITask, };
2
+ import TaskFactory from "./TaskFactory";
3
+ export { type ITask, TaskFactory };
@@ -0,0 +1,10 @@
1
+ /**
2
+ * 可释放接口
3
+ */
4
+ interface IDispose {
5
+ /**
6
+ * 资源释放
7
+ */
8
+ dispose(): void;
9
+ }
10
+ export default IDispose;