halo-fe 1.0.9 → 1.0.11

Sign up to get free protection for your applications and to get access to all the features.
Files changed (235) hide show
  1. package/dist/assets/@intlify-BISCQg1h.js +2189 -0
  2. package/dist/{vendor-@monaco-editor-DKC4UNw_.js → assets/@monaco-editor-BCDRi0Ti.js} +1 -1
  3. package/dist/assets/@vue-aVYGocXp.js +93 -0
  4. package/dist/assets/clone-DtpAsLoe.js +139 -0
  5. package/dist/{vendor-file-saver-DKXzEV2Q.js → assets/file-saver-Cnua3zoa.js} +1 -1
  6. package/dist/assets/liquidjs-C-LVcoaY.js +2893 -0
  7. package/dist/{vendor-underscore.string-vrHhfBaT.js → assets/underscore.string-oDfap0sE.js} +3 -3
  8. package/dist/{vendor-util-deprecate-BfbfwJhs.js → assets/util-deprecate-BqFawLoO.js} +1 -1
  9. package/dist/assets/vue-i18n-CLr3brPz.js +1670 -0
  10. package/dist/main.js +2383 -1579
  11. package/dist/style.css +1 -1
  12. package/esm/coms/Empty.vue.d.ts +1 -0
  13. package/esm/coms/conditions/Condition.vue.d.ts +12 -0
  14. package/esm/coms/conditions/Index.vue.d.ts +12 -0
  15. package/esm/coms/conditions/index.d.ts +3 -0
  16. package/esm/coms/conditions/types/ConditionGroupProps.d.ts +11 -0
  17. package/esm/coms/conditions/types/ConditionProps.d.ts +18 -0
  18. package/esm/coms/conditions/types/index.d.ts +3 -0
  19. package/esm/coms/{Code.vue.d.ts → controls/Code.vue.d.ts} +11 -3
  20. package/esm/coms/controls/Option.vue.d.ts +2 -0
  21. package/esm/coms/controls/Select.vue.d.ts +2 -0
  22. package/esm/coms/controls/index.d.ts +7 -0
  23. package/esm/coms/{types → controls/types}/CodeEmit.d.ts +1 -1
  24. package/esm/coms/controls/types/CodeProps.d.ts +28 -0
  25. package/esm/coms/controls/types/Range.d.ts +26 -0
  26. package/esm/coms/controls/types/index.d.ts +6 -0
  27. package/esm/coms/index.d.ts +5 -8
  28. package/esm/coms/layouts/index.d.ts +5 -0
  29. package/esm/coms/layouts/types/index.d.ts +2 -0
  30. package/esm/coms/types/index.d.ts +1 -6
  31. package/esm/drivers/bridges/IBridge.d.ts +7 -1
  32. package/esm/drivers/builders/Builder.d.ts +4 -1
  33. package/esm/drivers/builders/BuilderFactory.d.ts +1 -1
  34. package/esm/drivers/builders/IBuilder.d.ts +9 -0
  35. package/esm/drivers/builders/entities/ProviderTable.d.ts +22 -0
  36. package/esm/drivers/builders/entities/index.d.ts +2 -0
  37. package/esm/drivers/builders/implement/JsonBuilder.d.ts +3 -0
  38. package/esm/drivers/builders/implement/MongoBuilder.d.ts +6 -0
  39. package/esm/drivers/builders/implement/MySqlBuilder.d.ts +3 -0
  40. package/esm/drivers/builders/implement/SqlBuilder.d.ts +6 -0
  41. package/esm/drivers/builders/index.d.ts +3 -1
  42. package/esm/drivers/builders/types/ProviderTable.d.ts +6 -0
  43. package/esm/drivers/builders/types/index.d.ts +2 -0
  44. package/esm/drivers/cdns/Cdn.d.ts +20 -7
  45. package/esm/drivers/cdns/CdnFactory.d.ts +1 -1
  46. package/esm/drivers/cdns/ICdn.d.ts +28 -11
  47. package/esm/drivers/cdns/implements/LocalCdn.d.ts +13 -6
  48. package/esm/drivers/cdns/implements/ThirdCdn.d.ts +34 -0
  49. package/esm/drivers/cdns/index.d.ts +2 -1
  50. package/esm/drivers/encoders/Encoder.d.ts +1 -1
  51. package/esm/drivers/encoders/EncoderFactory.d.ts +1 -1
  52. package/esm/drivers/encoders/IEncoder.d.ts +1 -1
  53. package/esm/drivers/encoders/implement/Base64Encoder.d.ts +2 -1
  54. package/esm/drivers/excels/ExcelFactory.d.ts +1 -1
  55. package/esm/drivers/excels/implements/XlsxExcel.d.ts +1 -0
  56. package/esm/drivers/explainers/ExplainerFactory.d.ts +1 -1
  57. package/esm/drivers/features/FeatureFactory.d.ts +1 -1
  58. package/esm/drivers/hashers/Hasher.d.ts +1 -1
  59. package/esm/drivers/hashers/HasherFactory.d.ts +1 -1
  60. package/esm/drivers/hashers/IHasher.d.ts +1 -1
  61. package/esm/drivers/hashers/implement/Md5Hasher.d.ts +2 -1
  62. package/esm/drivers/hashers/implement/Sha256Hasher.d.ts +1 -1
  63. package/esm/drivers/https/Http.d.ts +2 -2
  64. package/esm/drivers/https/HttpFactory.d.ts +1 -1
  65. package/esm/drivers/https/entities/HttpMessage.d.ts +14 -3
  66. package/esm/drivers/https/entities/HttpRequest.d.ts +6 -2
  67. package/esm/drivers/https/implements/DefaultHttp.d.ts +9 -1
  68. package/esm/drivers/index.d.ts +2 -0
  69. package/esm/{plugins/types → drivers/messengers}/IMessenger.d.ts +2 -1
  70. package/esm/drivers/messengers/Messenger.d.ts +15 -0
  71. package/esm/drivers/messengers/MessengerFactory.d.ts +13 -0
  72. package/esm/drivers/messengers/implement/ConsoleMessenger.d.ts +15 -0
  73. package/esm/drivers/messengers/index.d.ts +4 -0
  74. package/esm/drivers/providers/IProvider.d.ts +6 -2
  75. package/esm/drivers/providers/Provider.d.ts +2 -0
  76. package/esm/drivers/providers/ProviderFactory.d.ts +1 -1
  77. package/esm/drivers/providers/helpers/SqlHelper.d.ts +11 -0
  78. package/esm/drivers/providers/helpers/index.d.ts +2 -0
  79. package/esm/drivers/providers/implements/CookieProvider.d.ts +2 -0
  80. package/esm/drivers/providers/implements/IndexedDbProvider.d.ts +2 -0
  81. package/esm/drivers/providers/implements/StorageProvider.d.ts +3 -9
  82. package/esm/drivers/providers/index.d.ts +1 -0
  83. package/esm/drivers/signers/SignerFactory.d.ts +1 -1
  84. package/esm/drivers/ssos/SsoFactory.d.ts +1 -1
  85. package/esm/drivers/tasks/ITask.d.ts +5 -0
  86. package/esm/drivers/tasks/Task.d.ts +1 -0
  87. package/esm/drivers/tasks/TaskFactory.d.ts +1 -1
  88. package/esm/drivers/tasks/implement/MemoryTask.d.ts +15 -0
  89. package/esm/drivers/templates/ITemplate.d.ts +11 -0
  90. package/esm/drivers/templates/Template.d.ts +6 -0
  91. package/esm/drivers/templates/TemplateFactory.d.ts +9 -0
  92. package/esm/drivers/templates/implement/LiquidTemplate.d.ts +6 -0
  93. package/esm/drivers/templates/index.d.ts +3 -0
  94. package/esm/drivers/videos/VideoFactory.d.ts +1 -1
  95. package/esm/drivers/voices/VoiceFactory.d.ts +1 -1
  96. package/esm/factorying/Factories.d.ts +27 -13
  97. package/esm/factorying/Factory.d.ts +16 -8
  98. package/esm/factorying/IFactory.d.ts +6 -6
  99. package/esm/factorying/index.d.ts +12 -3
  100. package/esm/helpers/DictionaryHelper.d.ts +3 -1
  101. package/esm/helpers/DomHelper.d.ts +24 -3
  102. package/esm/helpers/JsonHelper.d.ts +18 -10
  103. package/esm/helpers/ObjectHelper.d.ts +7 -3
  104. package/esm/helpers/TreeHelper.d.ts +1 -1
  105. package/esm/helpers/index.d.ts +1 -2
  106. package/esm/helpers/types/JsonConfig.d.ts +10 -0
  107. package/esm/helpers/types/TreeNodeProp.d.ts +3 -0
  108. package/esm/helpers/types/index.d.ts +2 -1
  109. package/esm/main.d.ts +2 -2
  110. package/esm/plugins/index.d.ts +0 -1
  111. package/esm/svcs/ISvc.d.ts +2 -1
  112. package/esm/svcs/Svc.d.ts +1 -0
  113. package/esm/svcs/SvcFactory.d.ts +4 -1
  114. package/esm/svcs/implement/ConfigSvc.d.ts +4 -0
  115. package/esm/svcs/implement/I18nSvc.d.ts +83 -0
  116. package/esm/svcs/implement/SettingSvc.d.ts +4 -0
  117. package/esm/svcs/implement/index.d.ts +2 -0
  118. package/esm/svcs/index.d.ts +14 -1
  119. package/esm/types/CreateFeOptions.d.ts +24 -0
  120. package/esm/types/{CreateOptions.d.ts → CreatePcOptions.d.ts} +2 -5
  121. package/esm/types/index.d.ts +3 -2
  122. package/esm/utilities/EventUtility.d.ts +11 -0
  123. package/esm/utilities/types/DragOptions.d.ts +2 -2
  124. package/esm/utilities/types/Rect.d.ts +4 -0
  125. package/esm/utilities/types/index.d.ts +2 -2
  126. package/package.json +16 -12
  127. package/dist/vendor-clone-NGbTzSwJ.js +0 -159
  128. package/dist/vendor-crypto-js-DWn5nTKL.js +0 -4997
  129. package/dist/vendor-xlsx-js-style-DMPNZPOx.js +0 -11862
  130. package/esm/coms/types/CodeProps.d.ts +0 -18
  131. package/esm/drivers/IDisposable.d.ts +0 -10
  132. package/esm/drivers/IDriver.d.ts +0 -10
  133. package/esm/drivers/cdns/implements/BootCdn.d.ts +0 -12
  134. package/esm/drivers/cdns/implements/JsdelivrCdn.d.ts +0 -13
  135. package/esm/drivers/cdns/implements/StaticFileCdn.d.ts +0 -16
  136. package/esm/drivers/cdns/implements/UnpkgCdn.d.ts +0 -10
  137. package/esm/drivers/driver-helper.d.ts +0 -46
  138. package/esm/drivers/factories/DriverFactory.d.ts +0 -64
  139. package/esm/drivers/factories/Factories.d.ts +0 -55
  140. package/esm/drivers/factories/Factory.d.ts +0 -25
  141. package/esm/drivers/factories/IFactory.d.ts +0 -18
  142. package/esm/drivers/factories/implement/CdnFactory.d.ts +0 -13
  143. package/esm/drivers/factories/implement/EncoderFactory.d.ts +0 -17
  144. package/esm/drivers/factories/implement/ExcelFactory.d.ts +0 -13
  145. package/esm/drivers/factories/implement/ExplainerFactory.d.ts +0 -6
  146. package/esm/drivers/factories/implement/FeatureFactory.d.ts +0 -13
  147. package/esm/drivers/factories/implement/HasherFactory.d.ts +0 -11
  148. package/esm/drivers/factories/implement/HttpFactory.d.ts +0 -18
  149. package/esm/drivers/factories/implement/ProviderFactory.d.ts +0 -18
  150. package/esm/drivers/factories/implement/SignerFactory.d.ts +0 -13
  151. package/esm/drivers/factories/implement/SsoFactory.d.ts +0 -17
  152. package/esm/drivers/factories/implement/TaskFactory.d.ts +0 -9
  153. package/esm/drivers/factories/implement/VideoFactory.d.ts +0 -3
  154. package/esm/drivers/factories/implement/VoiceFactory.d.ts +0 -6
  155. package/esm/drivers/factories/implement/index.d.ts +0 -11
  156. package/esm/drivers/factories/index.d.ts +0 -21
  157. package/esm/drivers/providers/implements/StorageHelper.d.ts +0 -34
  158. package/esm/drivers/requesters/IRequester.d.ts +0 -25
  159. package/esm/drivers/requesters/Requester.d.ts +0 -13
  160. package/esm/drivers/requesters/RequesterFactory.d.ts +0 -21
  161. package/esm/drivers/requesters/entities/HttpRequest.d.ts +0 -34
  162. package/esm/drivers/requesters/entities/HttpResponse.d.ts +0 -19
  163. package/esm/drivers/requesters/implements/DefaultRequester.d.ts +0 -12
  164. package/esm/drivers/requesters/implements/LocalRequester.d.ts +0 -43
  165. package/esm/drivers/requesters/implements/MkRequester.d.ts +0 -40
  166. package/esm/drivers/requesters/index.d.ts +0 -5
  167. package/esm/factories/Factories.d.ts +0 -55
  168. package/esm/factories/Factory.d.ts +0 -38
  169. package/esm/factories/IFactory.d.ts +0 -27
  170. package/esm/factories/index.d.ts +0 -26
  171. package/esm/helpers/ScriptHelper.d.ts +0 -31
  172. package/esm/helpers/array-helper.d.ts +0 -97
  173. package/esm/helpers/component-helper.d.ts +0 -10
  174. package/esm/helpers/cookie-helper.d.ts +0 -6
  175. package/esm/helpers/dictionary-helper.d.ts +0 -18
  176. package/esm/helpers/dom-helper.d.ts +0 -86
  177. package/esm/helpers/event-helper.d.ts +0 -30
  178. package/esm/helpers/file-helper.d.ts +0 -22
  179. package/esm/helpers/html-helper.d.ts +0 -10
  180. package/esm/helpers/i18n-helper.d.ts +0 -14
  181. package/esm/helpers/image-helper.d.ts +0 -10
  182. package/esm/helpers/json-helper.d.ts +0 -31
  183. package/esm/helpers/math-helper.d.ts +0 -46
  184. package/esm/helpers/micro-helper.d.ts +0 -10
  185. package/esm/helpers/mount-helper.d.ts +0 -14
  186. package/esm/helpers/object-helper.d.ts +0 -34
  187. package/esm/helpers/script-helper.d.ts +0 -31
  188. package/esm/helpers/scroll-helper.d.ts +0 -14
  189. package/esm/helpers/sign-helper.d.ts +0 -14
  190. package/esm/helpers/storage-helper.d.ts +0 -34
  191. package/esm/helpers/string-helper.d.ts +0 -94
  192. package/esm/helpers/task-helper.d.ts +0 -26
  193. package/esm/helpers/time-helper.d.ts +0 -62
  194. package/esm/helpers/tree-helper.d.ts +0 -54
  195. package/esm/helpers/type-helper.d.ts +0 -26
  196. package/esm/helpers/url-helper.d.ts +0 -96
  197. package/esm/plugins/types/IMessager.d.ts +0 -34
  198. package/esm/plugins/types/index.d.ts +0 -10
  199. package/esm/services/SettingService.d.ts +0 -5
  200. package/esm/services/index.d.ts +0 -15
  201. package/esm/servs/IServ.d.ts +0 -6
  202. package/esm/servs/Serv.d.ts +0 -4
  203. package/esm/servs/ServFactory.d.ts +0 -11
  204. package/esm/servs/implement/ConfigServ.d.ts +0 -66
  205. package/esm/servs/implement/DriverServ.d.ts +0 -36
  206. package/esm/servs/implement/EnvServ.d.ts +0 -14
  207. package/esm/servs/implement/LogServ.d.ts +0 -19
  208. package/esm/servs/implement/SettingServ.d.ts +0 -42
  209. package/esm/servs/implement/SocketServ.d.ts +0 -38
  210. package/esm/servs/implement/UserServ.d.ts +0 -47
  211. package/esm/servs/index.d.ts +0 -15
  212. package/esm/stores/config.d.ts +0 -59
  213. package/esm/stores/driver.d.ts +0 -41
  214. package/esm/stores/env.d.ts +0 -12
  215. package/esm/stores/index.d.ts +0 -7
  216. package/esm/stores/log.d.ts +0 -20
  217. package/esm/stores/setting.d.ts +0 -47
  218. package/esm/stores/socket.d.ts +0 -27
  219. package/esm/stores/user.d.ts +0 -44
  220. package/esm/svcs/proxies/driverSvc.d.ts +0 -18
  221. package/esm/svcs/proxies/index.d.ts +0 -2
  222. package/esm/thirds/index.d.ts +0 -8
  223. package/esm/vite.config.d.ts +0 -6
  224. /package/dist/{vendor-moment-h96o7c8I.js → assets/moment-h96o7c8I.js} +0 -0
  225. /package/dist/{vendor-sprintf-js-BPTdvBYM.js → assets/sprintf-js-BPTdvBYM.js} +0 -0
  226. /package/dist/{vendor-state-local-CEworIRt.js → assets/state-local-CEworIRt.js} +0 -0
  227. /package/dist/{vendor-underscore-B0BCaBxV.js → assets/underscore-B0BCaBxV.js} +0 -0
  228. /package/esm/coms/{Compare.vue.d.ts → controls/Compare.vue.d.ts} +0 -0
  229. /package/esm/coms/{RichText.vue.d.ts → controls/RichText.vue.d.ts} +0 -0
  230. /package/esm/coms/{types → controls/types}/RichTextOptions.d.ts +0 -0
  231. /package/esm/coms/{types → controls/types}/RichTextProps.d.ts +0 -0
  232. /package/esm/coms/{Col.vue.d.ts → layouts/Col.vue.d.ts} +0 -0
  233. /package/esm/coms/{Container.vue.d.ts → layouts/Container.vue.d.ts} +0 -0
  234. /package/esm/coms/{Row.vue.d.ts → layouts/Row.vue.d.ts} +0 -0
  235. /package/esm/coms/{types → layouts/types}/RowProps.d.ts +0 -0
@@ -4,7 +4,7 @@ import Factory from "../../factorying/Factory";
4
4
  * 特征工厂类
5
5
  */
6
6
  declare class FeatureFactory extends Factory<IFeature> {
7
- getInstances(): IFeature[];
7
+ get instances(): IFeature[];
8
8
  /**
9
9
  * 获取指定特征实例
10
10
  */
@@ -4,7 +4,7 @@ import IHasher from "./IHasher";
4
4
  */
5
5
  declare abstract class Hasher implements IHasher {
6
6
  type: string;
7
- abstract open(conn: string): void;
7
+ abstract open(conn: string): Promise<void>;
8
8
  abstract compute(value: string): Promise<string>;
9
9
  }
10
10
  export default Hasher;
@@ -1,7 +1,7 @@
1
1
  import IHasher from "./IHasher";
2
2
  import Factory from "../../factorying/Factory";
3
3
  declare class HasherFactory extends Factory<IHasher> {
4
- getInstances(): IHasher[];
4
+ get instances(): IHasher[];
5
5
  create(type: string, conn?: string): Promise<IHasher>;
6
6
  /**
7
7
  * 获取MD5 Hash对象
@@ -9,7 +9,7 @@ interface IHasher {
9
9
  /**
10
10
  * 开启
11
11
  */
12
- open(conn: string): void;
12
+ open(conn: string): Promise<void>;
13
13
  /**
14
14
  * 计算字符串Hash值
15
15
  */
@@ -4,7 +4,8 @@ import Hasher from "../Hasher";
4
4
  */
5
5
  declare class Md5Hasher extends Hasher {
6
6
  type: string;
7
- open(conn: string): void;
7
+ crypto: any;
8
+ open(conn: string): Promise<void>;
8
9
  compute(value: string): Promise<string>;
9
10
  }
10
11
  export default Md5Hasher;
@@ -4,7 +4,7 @@ import Hasher from "../Hasher";
4
4
  */
5
5
  declare class Sha256Hasher extends Hasher {
6
6
  type: string;
7
- open(conn: string): void;
7
+ open(conn: string): Promise<void>;
8
8
  compute(value: string): Promise<string>;
9
9
  }
10
10
  export default Sha256Hasher;
@@ -6,7 +6,7 @@ import HttpResponse from "./entities/HttpResponse";
6
6
  */
7
7
  declare abstract class Http implements IHttp {
8
8
  type: string;
9
- abstract open(conn: string): Promise<void>;
9
+ open(conn: string): Promise<void>;
10
10
  onRequest: (request: HttpRequest) => Promise<void>;
11
11
  onResponse: (response: HttpResponse) => Promise<void>;
12
12
  get(path: string, params?: any): Promise<any>;
@@ -19,6 +19,6 @@ declare abstract class Http implements IHttp {
19
19
  /**
20
20
  * 获取请求消息
21
21
  */
22
- getRequest(method: string, path: string, body?: any): HttpRequest;
22
+ getRequest(method: string, contentType: string, path: string, body?: any): HttpRequest;
23
23
  }
24
24
  export default Http;
@@ -5,7 +5,7 @@ import { Ref } from "../../plugins";
5
5
  * 请求器工厂类
6
6
  */
7
7
  declare class HttpFactory extends Factory<IHttp> {
8
- getInstances(): IHttp[];
8
+ get instances(): IHttp[];
9
9
  /**
10
10
  * 创建并开启
11
11
  */
@@ -3,7 +3,7 @@
3
3
  */
4
4
  declare abstract class HttpMessage {
5
5
  /**
6
- * 实体数据
6
+ * 数据实体
7
7
  */
8
8
  data: any;
9
9
  /**
@@ -11,9 +11,11 @@ declare abstract class HttpMessage {
11
11
  */
12
12
  body: string;
13
13
  /**
14
- * 请求头
14
+ * 请求头,初始化的目的是为了可直接访问值
15
15
  */
16
- headers?: [string, string];
16
+ headers?: {
17
+ [key: string]: string;
18
+ };
17
19
  /**
18
20
  * 内容类型
19
21
  */
@@ -25,8 +27,17 @@ declare abstract class HttpMessage {
25
27
  /**
26
28
  * 添加请求头
27
29
  */
30
+ addHeader(key: string, value: string): void;
31
+ /**
32
+ * 批量添加请求头
33
+ */
28
34
  addHeaders(headers: {
29
35
  [key: string]: string;
30
36
  }): void;
37
+ /**
38
+ * 准备数据体或者数据实体
39
+ * 不能放在getRequest中处理,因为外部会直接调用当前send方法,而不走getRequest
40
+ */
41
+ prepare(): void;
31
42
  }
32
43
  export default HttpMessage;
@@ -4,13 +4,17 @@ import HttpMessage from "./HttpMessage";
4
4
  */
5
5
  declare class HttpRequest extends HttpMessage {
6
6
  /**
7
- * 请求路径
7
+ * 请求唯一标识
8
8
  */
9
- path: string;
9
+ id: string;
10
10
  /**
11
11
  * 请求方法
12
12
  */
13
13
  method: string;
14
+ /**
15
+ * 请求路径
16
+ */
17
+ path: string;
14
18
  /**
15
19
  * 实际请求地址
16
20
  */
@@ -3,11 +3,19 @@ import HttpRequest from "../entities/HttpRequest";
3
3
  import HttpResponse from "../entities/HttpResponse";
4
4
  /**
5
5
  * 默认Http请求器
6
+ * 自动适配:页面请求 和 插件请求,以支持在插件场景下,配置的请求器是Default是,无法使用XmlHttpRequest发起请求
6
7
  */
7
8
  declare class DefaultHttp extends Http {
8
9
  type: string;
9
10
  baseUrl: string;
10
- open(conn: string): Promise<void>;
11
11
  send(request: HttpRequest): Promise<HttpResponse>;
12
+ /**
13
+ * 使用Fetch发送请求,谷歌插件场景专用
14
+ */
15
+ sendWithFetch(request: HttpRequest): Promise<HttpResponse>;
16
+ /**
17
+ * 使用XmlHttpRequest发送请求
18
+ */
19
+ sendWithXmlHttpRequest(request: HttpRequest): Promise<HttpResponse>;
12
20
  }
13
21
  export default DefaultHttp;
@@ -7,10 +7,12 @@ export * from "./explainers";
7
7
  export * from "./features";
8
8
  export * from "./hashers";
9
9
  export * from "./https";
10
+ export * from "./messengers";
10
11
  export * from "./providers";
11
12
  export * from "./signers";
12
13
  export * from "./ssos";
13
14
  export * from "./tasks";
15
+ export * from "./templates";
14
16
  export * from "./types";
15
17
  export * from "./videos";
16
18
  export * from "./voices";
@@ -1,7 +1,8 @@
1
+ import { IDriver } from "../types";
1
2
  /**
2
3
  * 消息提示接口,下游自己定义
3
4
  */
4
- interface IMessenger {
5
+ interface IMessenger extends IDriver {
5
6
  /**
6
7
  * 显示全局成功消息
7
8
  */
@@ -0,0 +1,15 @@
1
+ import IMessenger from "./IMessenger";
2
+ /**
3
+ * 消息提示基类
4
+ */
5
+ declare abstract class Messenger implements IMessenger {
6
+ type: string;
7
+ abstract alert(title: string, message: string, options?: any): void;
8
+ abstract confirm(title: string, message: string, options?: any): Promise<any>;
9
+ abstract error(message: string): void;
10
+ abstract info(message: string): void;
11
+ abstract notify(title: string, message: string, type: string): void;
12
+ abstract success(message: string): void;
13
+ abstract warning(message: string | number): void;
14
+ }
15
+ export default Messenger;
@@ -0,0 +1,13 @@
1
+ import Factory from "../../factorying/Factory";
2
+ import IMessenger from "./IMessenger";
3
+ /**
4
+ * 消息工厂
5
+ */
6
+ declare class MessengerFactory extends Factory<IMessenger> {
7
+ get instances(): IMessenger[];
8
+ /**
9
+ * 获取控制台消息提示类型
10
+ */
11
+ getConsole(): Promise<IMessenger>;
12
+ }
13
+ export default MessengerFactory;
@@ -0,0 +1,15 @@
1
+ import Messenger from "../Messenger";
2
+ /**
3
+ * 控制台消息提示
4
+ */
5
+ declare class ConsoleMessenger extends Messenger {
6
+ type: string;
7
+ alert(title: string, message: string, options?: any): void;
8
+ confirm(title: string, message: string, options?: any): Promise<any>;
9
+ error(message: string): void;
10
+ info(message: string): void;
11
+ notify(title: string, message: string, type: string): void;
12
+ success(message: string): void;
13
+ warning(message: string | number): void;
14
+ }
15
+ export default ConsoleMessenger;
@@ -0,0 +1,4 @@
1
+ import IMessenger from "./IMessenger";
2
+ import Messenger from "./Messenger";
3
+ import MessengerFactory from "./MessengerFactory";
4
+ export { type IMessenger, Messenger, MessengerFactory };
@@ -20,9 +20,9 @@ interface IProvider extends IDriver {
20
20
  */
21
21
  getAsync(id: any): Promise<any>;
22
22
  /**
23
- * 查询数据,本质调用上面的重载
23
+ * 查询强类型数据
24
24
  */
25
- getAsync<T>(id: any): Promise<T>;
25
+ getEntity<T>(id: any): Promise<T>;
26
26
  /**
27
27
  * 添加数据
28
28
  */
@@ -35,6 +35,10 @@ interface IProvider extends IDriver {
35
35
  * 保存数据,entity中的id会被自动赋值成id,所以entity的id属性将不再能使用
36
36
  */
37
37
  saveAsync(id: any, entity: any): Promise<any>;
38
+ /**
39
+ * 保存强类型
40
+ */
41
+ saveEntity<T>(id: any, entity: T): Promise<any>;
38
42
  /**
39
43
  * 删除数据
40
44
  */
@@ -7,9 +7,11 @@ declare abstract class Provider implements IProvider {
7
7
  abstract createAsync(store: string): Promise<any>;
8
8
  abstract deleteAsync(id: any): Promise<any>;
9
9
  abstract getAsync(id: any): Promise<any>;
10
+ abstract getEntity<T>(id: any): Promise<T>;
10
11
  abstract insertAsync(id: any, entity: any): Promise<any>;
11
12
  abstract openAsync(conn: string): Promise<number>;
12
13
  abstract saveAsync(id: any, entity: any): Promise<any>;
14
+ abstract saveEntity<T>(id: any, entity: T): Promise<any>;
13
15
  abstract updateAsync(id: any, entity: any): Promise<any>;
14
16
  abstract commit(): void;
15
17
  abstract dispose(): void;
@@ -4,7 +4,7 @@ import Factory from "../../factorying/Factory";
4
4
  * 数据库提供程序工厂类
5
5
  */
6
6
  declare class ProviderFactory extends Factory<IProvider> {
7
- getInstances(): IProvider[];
7
+ get instances(): IProvider[];
8
8
  /**
9
9
  * 获取指定类型的提供程序
10
10
  */
@@ -0,0 +1,11 @@
1
+ declare class SqlHelper {
2
+ /**
3
+ * 获取实际SQL字段名称
4
+ */
5
+ static getSqlName(name: string): string;
6
+ /**
7
+ * 获取实际SQL字符串值
8
+ */
9
+ static getValue(value: any): any;
10
+ }
11
+ export default SqlHelper;
@@ -0,0 +1,2 @@
1
+ import SqlHelper from "./SqlHelper";
2
+ export { SqlHelper };
@@ -8,6 +8,8 @@ declare class CookieProvider extends Provider {
8
8
  createAsync(store: string): Promise<any>;
9
9
  deleteAsync(id: any): Promise<any>;
10
10
  getAsync(id: any): Promise<any>;
11
+ getEntity<T>(id: any): Promise<T>;
12
+ saveEntity<T>(id: any, entity: T): Promise<any>;
11
13
  insertAsync(id: any, entity: any): Promise<any>;
12
14
  saveAsync(id: any, entity: any): Promise<any>;
13
15
  updateAsync(id: any, entity: any): Promise<any>;
@@ -27,6 +27,7 @@ declare class IndexedDbProvider extends Provider {
27
27
  * 查询数据
28
28
  */
29
29
  getAsync(id: any): Promise<any>;
30
+ getEntity<T>(id: any): Promise<T>;
30
31
  /**
31
32
  * 添加数据
32
33
  */
@@ -39,6 +40,7 @@ declare class IndexedDbProvider extends Provider {
39
40
  * 保存数据,支持代理对象保存
40
41
  */
41
42
  saveAsync(id: any, entity: any): Promise<any>;
43
+ saveEntity<T>(id: any, entity: T): Promise<any>;
42
44
  /**
43
45
  * 删除数据
44
46
  */
@@ -6,21 +6,15 @@ declare class StorageProvider extends Provider {
6
6
  type: string;
7
7
  openAsync(conn: string): Promise<number>;
8
8
  createAsync(store: string): Promise<any>;
9
- deleteAsync(id: any): Promise<any>;
10
9
  getAsync(id: any): Promise<any>;
10
+ getEntity<T>(key: string): Promise<T>;
11
11
  insertAsync(id: any, entity: any): Promise<any>;
12
12
  saveAsync(id: any, entity: any): Promise<any>;
13
+ saveEntity<T>(id: any, entity: T): Promise<any>;
13
14
  updateAsync(id: any, entity: any): Promise<any>;
15
+ deleteAsync(id: any): Promise<any>;
14
16
  commit(): void;
15
17
  dispose(): void;
16
- /**
17
- * 获取本地存储
18
- */
19
- getEntity: (key: string) => any;
20
- /**
21
- * 设置本地存储
22
- */
23
- setEntity: (key: string, value: any) => void;
24
18
  /**
25
19
  * 以5M为基准,获取剩余可用容量(KB)
26
20
  */
@@ -1,3 +1,4 @@
1
1
  import IProvider from "./IProvider";
2
2
  import ProviderFactory from "./ProviderFactory";
3
+ export * from "./helpers";
3
4
  export { type IProvider, ProviderFactory };
@@ -4,7 +4,7 @@ import Factory from "../../factorying/Factory";
4
4
  * 签名工厂类
5
5
  */
6
6
  declare class SignerFactory extends Factory<ISigner> {
7
- getInstances(): ISigner[];
7
+ get instances(): ISigner[];
8
8
  /**
9
9
  * 获取指定签名实例
10
10
  */
@@ -7,7 +7,7 @@ declare class SsoFactory extends Factory<ISso> {
7
7
  /**
8
8
  * 获取实例
9
9
  */
10
- getInstances(): ISso[];
10
+ get instances(): ISso[];
11
11
  /**
12
12
  * 获取指定SSO实例
13
13
  */
@@ -11,6 +11,11 @@ interface ITask extends IDriver, IDispose {
11
11
  * 按照频控去执行任务
12
12
  */
13
13
  executeFrequency<T>(entities: T[], frequency: number, threads: number, handler: (chunk: T[], index: number) => Promise<void>): Promise<void>;
14
+ /**
15
+ * 按照并发数量控制多个任务执行
16
+ * 注意:是相同时间的并发数控制,不是1s内的并发数控制
17
+ */
18
+ concurrent<T>(handler: Promise<T>, limit: number): Promise<T>;
14
19
  /**
15
20
  * 每间隔指定时间执行指定任务
16
21
  */
@@ -6,6 +6,7 @@ declare abstract class Task implements ITask {
6
6
  type: string;
7
7
  abstract execute<T>(entities: T[], threads: number, handler: (chunk: T[], index: number) => Promise<void>): Promise<void>;
8
8
  abstract executeFrequency<T>(entities: T[], frequency: number, threads: number, handler: (chunk: T[], index: number) => Promise<void>): Promise<void>;
9
+ abstract concurrent<T>(handler: Promise<T>, total: number): Promise<T>;
9
10
  abstract interval(ms: number, task: () => void): void;
10
11
  abstract dispose(): void;
11
12
  }
@@ -4,6 +4,6 @@ import ITask from "./ITask";
4
4
  * 任务工厂类
5
5
  */
6
6
  declare class TaskFactory extends Factory<ITask> {
7
- getInstances(): ITask[];
7
+ get instances(): ITask[];
8
8
  }
9
9
  export default TaskFactory;
@@ -7,6 +7,21 @@ declare class MemoryTask extends Task {
7
7
  intervalTimeout: any;
8
8
  execute<T>(entities: T[], threads: number, handler: (chunk: T[], index: number) => Promise<void>): Promise<void>;
9
9
  executeFrequency<T>(entities: T[], frequency: number, threads: number, handler: (chunk: T[], index: number) => Promise<void>): Promise<void>;
10
+ /**
11
+ * 待执行的任务队列
12
+ */
13
+ tasks: Promise<any>[];
14
+ taskLimit: number;
15
+ taskExecuting: number;
16
+ taskResolves: ((value: any) => void)[];
17
+ /**
18
+ * 相同时间的并发数控制,不是1s内的并发数控制
19
+ */
20
+ concurrent<T>(handler: Promise<T>, limit: number): Promise<T>;
21
+ /**
22
+ * 按照并发执行
23
+ */
24
+ private run;
10
25
  interval(ms: number, task: () => void): void;
11
26
  dispose(): void;
12
27
  }
@@ -0,0 +1,11 @@
1
+ import { IDriver } from "../types";
2
+ /**
3
+ * 模板引擎接口
4
+ */
5
+ interface ITemplate extends IDriver {
6
+ /**
7
+ * 模板渲染
8
+ */
9
+ render(template: string, model: any): Promise<string>;
10
+ }
11
+ export default ITemplate;
@@ -0,0 +1,6 @@
1
+ import ITemplate from "./ITemplate";
2
+ declare abstract class Template implements ITemplate {
3
+ type: string;
4
+ abstract render(template: string, model: any): Promise<string>;
5
+ }
6
+ export default Template;
@@ -0,0 +1,9 @@
1
+ import Factory from "../../factorying/Factory";
2
+ import ITemplate from "./ITemplate";
3
+ /**
4
+ * 模板工厂
5
+ */
6
+ declare class TemplateFactory extends Factory<ITemplate> {
7
+ get instances(): ITemplate[];
8
+ }
9
+ export default TemplateFactory;
@@ -0,0 +1,6 @@
1
+ import Template from "../Template";
2
+ declare class LiquidTemplate extends Template {
3
+ type: string;
4
+ render(template: string, model: any): Promise<string>;
5
+ }
6
+ export default LiquidTemplate;
@@ -0,0 +1,3 @@
1
+ import ITemplate from "./ITemplate";
2
+ import TemplateFactory from "./TemplateFactory";
3
+ export { type ITemplate, TemplateFactory };
@@ -1,6 +1,6 @@
1
1
  import Factory from "../../factorying/Factory";
2
2
  import IVideo from "./IVideo";
3
3
  declare class VideoFactory extends Factory<IVideo> {
4
- getInstances(): IVideo[];
4
+ get instances(): IVideo[];
5
5
  }
6
6
  export default VideoFactory;
@@ -1,6 +1,6 @@
1
1
  import Factory from "../../factorying/Factory";
2
2
  import { IVoice } from "./IVoice";
3
3
  declare class VoiceFactory extends Factory<IVoice> {
4
- getInstances(): IVoice[];
4
+ get instances(): IVoice[];
5
5
  }
6
6
  export default VoiceFactory;
@@ -1,4 +1,4 @@
1
- import { CdnFactory, EncoderFactory, ExcelFactory, ExplainerFactory, FeatureFactory, HasherFactory, HttpFactory, ProviderFactory, SignerFactory, SsoFactory, TaskFactory } from "../drivers";
1
+ import { BuilderFactory, CdnFactory, EncoderFactory, ExcelFactory, ExplainerFactory, FeatureFactory, HasherFactory, HttpFactory, MessengerFactory, ProviderFactory, SignerFactory, SsoFactory, TaskFactory, TemplateFactory } from "../drivers";
2
2
  /**
3
3
  * 驱动工厂类
4
4
  */
@@ -6,54 +6,68 @@ declare class Factories {
6
6
  /**
7
7
  * 工厂缓存
8
8
  */
9
- static mappings: {};
9
+ static mappings: {
10
+ [key: string]: any;
11
+ };
10
12
  /**
11
13
  * 并缓存工厂实例
12
14
  */
13
15
  static create<T>(type: any): T;
14
16
  /**
15
- *CDN工厂
17
+ * Builder工厂
18
+ */
19
+ static get builder(): BuilderFactory;
20
+ /**
21
+ * CDN工厂
16
22
  */
17
23
  static get cdn(): CdnFactory;
18
24
  /**
19
- *编码器工厂
25
+ * 编码器工厂
20
26
  */
21
27
  static get encoder(): EncoderFactory;
22
28
  /**
23
- *Excel工厂
29
+ * Excel工厂
24
30
  */
25
31
  static get excel(): ExcelFactory;
26
32
  /**
27
- *Explainer工厂
33
+ * Explainer工厂
28
34
  */
29
35
  static get explainer(): ExplainerFactory;
30
36
  /**
31
- *特征工厂
37
+ * 特征工厂
32
38
  */
33
39
  static get feature(): FeatureFactory;
34
40
  /**
35
- *哈希工厂
41
+ * 哈希工厂
36
42
  */
37
43
  static get hasher(): HasherFactory;
38
44
  /**
39
- *Http请求工厂
45
+ * Http请求工厂
40
46
  */
41
47
  static get http(): HttpFactory;
42
48
  /**
43
- *提供程序工厂
49
+ * 消息提示请求工厂
50
+ */
51
+ static get messenger(): MessengerFactory;
52
+ /**
53
+ * 提供程序工厂
44
54
  */
45
55
  static get provider(): ProviderFactory;
46
56
  /**
47
- *签名工厂
57
+ * 签名工厂
48
58
  */
49
59
  static get signer(): SignerFactory;
50
60
  /**
51
- *SSO工厂
61
+ * SSO工厂
52
62
  */
53
63
  static get sso(): SsoFactory;
54
64
  /**
55
- *Task工厂
65
+ * Task工厂
56
66
  */
57
67
  static get task(): TaskFactory;
68
+ /**
69
+ * 模板工厂
70
+ */
71
+ static get template(): TemplateFactory;
58
72
  }
59
73
  export default Factories;
@@ -6,22 +6,30 @@ import { Ref } from "../plugins";
6
6
  */
7
7
  declare abstract class Factory<T extends IDriver> implements IFactory<T> {
8
8
  /**
9
- * 开启
9
+ * 当前内部驱动的实例集合
10
10
  */
11
- open(): void;
11
+ private _instances;
12
+ /**
13
+ * 获取当前驱动的所有实例
14
+ */
15
+ get instances(): T[];
12
16
  /**
13
- * 实例集合
17
+ * 设置当前驱动的所有实例
18
+ */
19
+ set instances(instances: T[]);
20
+ /**
21
+ * 实例缓存集合
14
22
  * 或者使用:Record<string, string>
15
23
  */
16
- private instances;
24
+ private mappings;
17
25
  /**
18
- * 获取当前驱动所有实例
26
+ * 开启
19
27
  */
20
- abstract getInstances(): T[];
28
+ open(): void;
21
29
  /**
22
30
  * 创建指定类型驱动
23
31
  */
24
- create(type: string, conn?: string): Promise<T>;
32
+ create(type: string): Promise<T>;
25
33
  /**
26
34
  * 根据主键创建驱动,并返回加载后的驱动信息
27
35
  */
@@ -29,7 +37,7 @@ declare abstract class Factory<T extends IDriver> implements IFactory<T> {
29
37
  /**
30
38
  * 从缓存中获取指定名称的驱动,不存在则创建并执行初始化
31
39
  */
32
- createIfAbsent(name: string, type?: string, open?: (entity: T) => void): Promise<T>;
40
+ createIfAbsent(name: string, type?: string, open?: (entity: T) => Promise<void>): Promise<T>;
33
41
  /**
34
42
  * 加载驱动明细
35
43
  */