@celljs/rpc 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (249) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +1 -0
  3. package/cell.yml +8 -0
  4. package/lib/common/annotation/autorpc.d.ts +6 -0
  5. package/lib/common/annotation/autorpc.d.ts.map +1 -0
  6. package/lib/common/annotation/autorpc.js +19 -0
  7. package/lib/common/annotation/autorpc.js.map +1 -0
  8. package/lib/common/annotation/detached/autorpc.d.ts +3 -0
  9. package/lib/common/annotation/detached/autorpc.d.ts.map +1 -0
  10. package/lib/common/annotation/detached/autorpc.js +15 -0
  11. package/lib/common/annotation/detached/autorpc.js.map +1 -0
  12. package/lib/common/annotation/detached/index.d.ts +2 -0
  13. package/lib/common/annotation/detached/index.d.ts.map +1 -0
  14. package/lib/common/annotation/detached/index.js +18 -0
  15. package/lib/common/annotation/detached/index.js.map +1 -0
  16. package/lib/common/annotation/index.d.ts +3 -0
  17. package/lib/common/annotation/index.d.ts.map +1 -0
  18. package/lib/common/annotation/index.js +19 -0
  19. package/lib/common/annotation/index.js.map +1 -0
  20. package/lib/common/annotation/rpc.d.ts +20 -0
  21. package/lib/common/annotation/rpc.d.ts.map +1 -0
  22. package/lib/common/annotation/rpc.js +41 -0
  23. package/lib/common/annotation/rpc.js.map +1 -0
  24. package/lib/common/channal/channel-protocol.d.ts +52 -0
  25. package/lib/common/channal/channel-protocol.d.ts.map +1 -0
  26. package/lib/common/channal/channel-protocol.js +38 -0
  27. package/lib/common/channal/channel-protocol.js.map +1 -0
  28. package/lib/common/channal/http-channel.d.ts +9 -0
  29. package/lib/common/channal/http-channel.d.ts.map +1 -0
  30. package/lib/common/channal/http-channel.js +26 -0
  31. package/lib/common/channal/http-channel.js.map +1 -0
  32. package/lib/common/channal/index.d.ts +3 -0
  33. package/lib/common/channal/index.d.ts.map +1 -0
  34. package/lib/common/channal/index.js +19 -0
  35. package/lib/common/channal/index.js.map +1 -0
  36. package/lib/common/constants.d.ts +2 -0
  37. package/lib/common/constants.d.ts.map +1 -0
  38. package/lib/common/constants.js +5 -0
  39. package/lib/common/constants.js.map +1 -0
  40. package/lib/common/converter/converter-protocol.d.ts +7 -0
  41. package/lib/common/converter/converter-protocol.d.ts.map +1 -0
  42. package/lib/common/converter/converter-protocol.js +6 -0
  43. package/lib/common/converter/converter-protocol.js.map +1 -0
  44. package/lib/common/converter/index.d.ts +2 -0
  45. package/lib/common/converter/index.d.ts.map +1 -0
  46. package/lib/common/converter/index.js +18 -0
  47. package/lib/common/converter/index.js.map +1 -0
  48. package/lib/common/endpoint/endpoint-protocol.d.ts +5 -0
  49. package/lib/common/endpoint/endpoint-protocol.d.ts.map +1 -0
  50. package/lib/common/endpoint/endpoint-protocol.js +5 -0
  51. package/lib/common/endpoint/endpoint-protocol.js.map +1 -0
  52. package/lib/common/endpoint/endpoint-resolver.d.ts +13 -0
  53. package/lib/common/endpoint/endpoint-resolver.d.ts.map +1 -0
  54. package/lib/common/endpoint/endpoint-resolver.js +61 -0
  55. package/lib/common/endpoint/endpoint-resolver.js.map +1 -0
  56. package/lib/common/endpoint/index.d.ts +3 -0
  57. package/lib/common/endpoint/index.d.ts.map +1 -0
  58. package/lib/common/endpoint/index.js +19 -0
  59. package/lib/common/endpoint/index.js.map +1 -0
  60. package/lib/common/error/error.d.ts +6 -0
  61. package/lib/common/error/error.d.ts.map +1 -0
  62. package/lib/common/error/error.js +12 -0
  63. package/lib/common/error/error.js.map +1 -0
  64. package/lib/common/error/index.d.ts +2 -0
  65. package/lib/common/error/index.d.ts.map +1 -0
  66. package/lib/common/error/index.js +18 -0
  67. package/lib/common/error/index.js.map +1 -0
  68. package/lib/common/factory/connection-factory.d.ts +10 -0
  69. package/lib/common/factory/connection-factory.d.ts.map +1 -0
  70. package/lib/common/factory/connection-factory.js +28 -0
  71. package/lib/common/factory/connection-factory.js.map +1 -0
  72. package/lib/common/factory/index.d.ts +5 -0
  73. package/lib/common/factory/index.d.ts.map +1 -0
  74. package/lib/common/factory/index.js +21 -0
  75. package/lib/common/factory/index.js.map +1 -0
  76. package/lib/common/factory/proxy-factory.d.ts +57 -0
  77. package/lib/common/factory/proxy-factory.d.ts.map +1 -0
  78. package/lib/common/factory/proxy-factory.js +182 -0
  79. package/lib/common/factory/proxy-factory.js.map +1 -0
  80. package/lib/common/factory/reader.d.ts +16 -0
  81. package/lib/common/factory/reader.d.ts.map +1 -0
  82. package/lib/common/factory/reader.js +48 -0
  83. package/lib/common/factory/reader.js.map +1 -0
  84. package/lib/common/factory/writer.d.ts +10 -0
  85. package/lib/common/factory/writer.d.ts.map +1 -0
  86. package/lib/common/factory/writer.js +25 -0
  87. package/lib/common/factory/writer.js.map +1 -0
  88. package/lib/common/handler/connection-handler.d.ts +7 -0
  89. package/lib/common/handler/connection-handler.d.ts.map +1 -0
  90. package/lib/common/handler/connection-handler.js +8 -0
  91. package/lib/common/handler/connection-handler.js.map +1 -0
  92. package/lib/common/handler/handler-protocol.d.ts +7 -0
  93. package/lib/common/handler/handler-protocol.d.ts.map +1 -0
  94. package/lib/common/handler/handler-protocol.js +5 -0
  95. package/lib/common/handler/handler-protocol.js.map +1 -0
  96. package/lib/common/handler/index.d.ts +3 -0
  97. package/lib/common/handler/index.d.ts.map +1 -0
  98. package/lib/common/handler/index.js +19 -0
  99. package/lib/common/handler/index.js.map +1 -0
  100. package/lib/common/index.d.ts +12 -0
  101. package/lib/common/index.d.ts.map +1 -0
  102. package/lib/common/index.js +28 -0
  103. package/lib/common/index.js.map +1 -0
  104. package/lib/common/module.d.ts +4 -0
  105. package/lib/common/module.d.ts.map +1 -0
  106. package/lib/common/module.js +22 -0
  107. package/lib/common/module.js.map +1 -0
  108. package/lib/common/processor/client-config-processor.d.ts +6 -0
  109. package/lib/common/processor/client-config-processor.d.ts.map +1 -0
  110. package/lib/common/processor/client-config-processor.js +20 -0
  111. package/lib/common/processor/client-config-processor.js.map +1 -0
  112. package/lib/common/processor/index.d.ts +3 -0
  113. package/lib/common/processor/index.d.ts.map +1 -0
  114. package/lib/common/processor/index.js +19 -0
  115. package/lib/common/processor/index.js.map +1 -0
  116. package/lib/common/processor/processor-protocol.d.ts +6 -0
  117. package/lib/common/processor/processor-protocol.d.ts.map +1 -0
  118. package/lib/common/processor/processor-protocol.js +5 -0
  119. package/lib/common/processor/processor-protocol.js.map +1 -0
  120. package/lib/common/proxy/delegating-http-proxy-creator.d.ts +24 -0
  121. package/lib/common/proxy/delegating-http-proxy-creator.d.ts.map +1 -0
  122. package/lib/common/proxy/delegating-http-proxy-creator.js +89 -0
  123. package/lib/common/proxy/delegating-http-proxy-creator.js.map +1 -0
  124. package/lib/common/proxy/http-proxy-creator.d.ts +43 -0
  125. package/lib/common/proxy/http-proxy-creator.d.ts.map +1 -0
  126. package/lib/common/proxy/http-proxy-creator.js +137 -0
  127. package/lib/common/proxy/http-proxy-creator.js.map +1 -0
  128. package/lib/common/proxy/index.d.ts +5 -0
  129. package/lib/common/proxy/index.d.ts.map +1 -0
  130. package/lib/common/proxy/index.js +21 -0
  131. package/lib/common/proxy/index.js.map +1 -0
  132. package/lib/common/proxy/proxy-protocol.d.ts +22 -0
  133. package/lib/common/proxy/proxy-protocol.d.ts.map +1 -0
  134. package/lib/common/proxy/proxy-protocol.js +6 -0
  135. package/lib/common/proxy/proxy-protocol.js.map +1 -0
  136. package/lib/common/proxy/proxy-provider.d.ts +10 -0
  137. package/lib/common/proxy/proxy-provider.d.ts.map +1 -0
  138. package/lib/common/proxy/proxy-provider.js +43 -0
  139. package/lib/common/proxy/proxy-provider.js.map +1 -0
  140. package/lib/common/utils/converter-util.d.ts +8 -0
  141. package/lib/common/utils/converter-util.d.ts.map +1 -0
  142. package/lib/common/utils/converter-util.js +32 -0
  143. package/lib/common/utils/converter-util.js.map +1 -0
  144. package/lib/common/utils/index.d.ts +4 -0
  145. package/lib/common/utils/index.d.ts.map +1 -0
  146. package/lib/common/utils/index.js +20 -0
  147. package/lib/common/utils/index.js.map +1 -0
  148. package/lib/common/utils/logger.d.ts +9 -0
  149. package/lib/common/utils/logger.d.ts.map +1 -0
  150. package/lib/common/utils/logger.js +22 -0
  151. package/lib/common/utils/logger.js.map +1 -0
  152. package/lib/common/utils/rpc-util.d.ts +13 -0
  153. package/lib/common/utils/rpc-util.d.ts.map +1 -0
  154. package/lib/common/utils/rpc-util.js +46 -0
  155. package/lib/common/utils/rpc-util.js.map +1 -0
  156. package/lib/node/channel/channel-manager.d.ts +10 -0
  157. package/lib/node/channel/channel-manager.d.ts.map +1 -0
  158. package/lib/node/channel/channel-manager.js +59 -0
  159. package/lib/node/channel/channel-manager.js.map +1 -0
  160. package/lib/node/channel/channel-middleware.d.ts +8 -0
  161. package/lib/node/channel/channel-middleware.d.ts.map +1 -0
  162. package/lib/node/channel/channel-middleware.js +40 -0
  163. package/lib/node/channel/channel-middleware.js.map +1 -0
  164. package/lib/node/channel/channel-protocol.d.ts +13 -0
  165. package/lib/node/channel/channel-protocol.d.ts.map +1 -0
  166. package/lib/node/channel/channel-protocol.js +9 -0
  167. package/lib/node/channel/channel-protocol.js.map +1 -0
  168. package/lib/node/channel/channel-strategy.d.ts +10 -0
  169. package/lib/node/channel/channel-strategy.d.ts.map +1 -0
  170. package/lib/node/channel/channel-strategy.js +64 -0
  171. package/lib/node/channel/channel-strategy.js.map +1 -0
  172. package/lib/node/channel/index.d.ts +5 -0
  173. package/lib/node/channel/index.d.ts.map +1 -0
  174. package/lib/node/channel/index.js +21 -0
  175. package/lib/node/channel/index.js.map +1 -0
  176. package/lib/node/handler/handler-adapter.d.ts +14 -0
  177. package/lib/node/handler/handler-adapter.d.ts.map +1 -0
  178. package/lib/node/handler/handler-adapter.js +55 -0
  179. package/lib/node/handler/handler-adapter.js.map +1 -0
  180. package/lib/node/handler/handler-protocol.d.ts +2 -0
  181. package/lib/node/handler/handler-protocol.d.ts.map +1 -0
  182. package/lib/node/handler/handler-protocol.js +5 -0
  183. package/lib/node/handler/handler-protocol.js.map +1 -0
  184. package/lib/node/handler/index.d.ts +3 -0
  185. package/lib/node/handler/index.d.ts.map +1 -0
  186. package/lib/node/handler/index.js +19 -0
  187. package/lib/node/handler/index.js.map +1 -0
  188. package/lib/node/index.d.ts +3 -0
  189. package/lib/node/index.d.ts.map +1 -0
  190. package/lib/node/index.js +19 -0
  191. package/lib/node/index.js.map +1 -0
  192. package/lib/node/module.d.ts +4 -0
  193. package/lib/node/module.d.ts.map +1 -0
  194. package/lib/node/module.js +6 -0
  195. package/lib/node/module.js.map +1 -0
  196. package/lib/package.spec.d.ts +1 -0
  197. package/lib/package.spec.d.ts.map +1 -0
  198. package/lib/package.spec.js +4 -0
  199. package/lib/package.spec.js.map +1 -0
  200. package/package.json +45 -0
  201. package/src/common/annotation/autorpc.ts +17 -0
  202. package/src/common/annotation/detached/autorpc.ts +12 -0
  203. package/src/common/annotation/detached/index.ts +1 -0
  204. package/src/common/annotation/index.ts +2 -0
  205. package/src/common/annotation/rpc.ts +41 -0
  206. package/src/common/channal/channel-protocol.ts +82 -0
  207. package/src/common/channal/http-channel.ts +30 -0
  208. package/src/common/channal/index.ts +2 -0
  209. package/src/common/constants.ts +1 -0
  210. package/src/common/converter/converter-protocol.ts +8 -0
  211. package/src/common/converter/index.ts +1 -0
  212. package/src/common/endpoint/endpoint-protocol.ts +5 -0
  213. package/src/common/endpoint/endpoint-resolver.ts +46 -0
  214. package/src/common/endpoint/index.ts +2 -0
  215. package/src/common/error/error.ts +7 -0
  216. package/src/common/error/index.ts +1 -0
  217. package/src/common/factory/connection-factory.ts +21 -0
  218. package/src/common/factory/index.ts +4 -0
  219. package/src/common/factory/proxy-factory.ts +219 -0
  220. package/src/common/factory/reader.ts +50 -0
  221. package/src/common/factory/writer.ts +26 -0
  222. package/src/common/handler/connection-handler.ts +7 -0
  223. package/src/common/handler/handler-protocol.ts +8 -0
  224. package/src/common/handler/index.ts +2 -0
  225. package/src/common/index.ts +11 -0
  226. package/src/common/module.ts +21 -0
  227. package/src/common/processor/client-config-processor.ts +12 -0
  228. package/src/common/processor/index.ts +2 -0
  229. package/src/common/processor/processor-protocol.ts +7 -0
  230. package/src/common/proxy/delegating-http-proxy-creator.ts +68 -0
  231. package/src/common/proxy/http-proxy-creator.ts +179 -0
  232. package/src/common/proxy/index.ts +5 -0
  233. package/src/common/proxy/proxy-protocol.ts +26 -0
  234. package/src/common/proxy/proxy-provider.ts +29 -0
  235. package/src/common/utils/converter-util.ts +29 -0
  236. package/src/common/utils/index.ts +3 -0
  237. package/src/common/utils/logger.ts +23 -0
  238. package/src/common/utils/rpc-util.ts +46 -0
  239. package/src/node/channel/channel-manager.ts +44 -0
  240. package/src/node/channel/channel-middleware.ts +27 -0
  241. package/src/node/channel/channel-protocol.ts +21 -0
  242. package/src/node/channel/channel-strategy.ts +56 -0
  243. package/src/node/channel/index.ts +4 -0
  244. package/src/node/handler/handler-adapter.ts +38 -0
  245. package/src/node/handler/handler-protocol.ts +1 -0
  246. package/src/node/handler/index.ts +2 -0
  247. package/src/node/index.ts +2 -0
  248. package/src/node/module.ts +4 -0
  249. package/src/package.spec.ts +4 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2019 Cellbang
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1 @@
1
+ # Cell - Rpc Component
package/cell.yml ADDED
@@ -0,0 +1,8 @@
1
+ cell:
2
+ rpc:
3
+ path: api
4
+ merge:
5
+ enabled: false
6
+ timerDelay: 35 # 35ms
7
+ maxLength: 5242880 # 5MB
8
+ maxCount: 100
@@ -0,0 +1,6 @@
1
+ import { IdOrAutowiredOptionWithoutMulti, DoInject } from '@celljs/core';
2
+ export declare const RPC: unique symbol;
3
+ export declare const ID_KEY: unique symbol;
4
+ export declare const Autorpc: (idOrOption?: IdOrAutowiredOptionWithoutMulti) => PropertyDecorator & ParameterDecorator;
5
+ export declare const doInjectForAutorpc: DoInject;
6
+ //# sourceMappingURL=autorpc.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"autorpc.d.ts","sourceRoot":"","sources":["../../../src/common/annotation/autorpc.ts"],"names":[],"mappings":"AAAA,OAAO,EAA2B,+BAA+B,EAAE,QAAQ,EAAwC,MAAM,cAAc,CAAC;AAExI,eAAO,MAAM,GAAG,eAAgB,CAAC;AACjC,eAAO,MAAM,MAAM,eAAmB,CAAC;AAEvC,eAAO,MAAM,OAAO,gBAA0B,+BAA+B,KAAG,iBAAiB,GAAG,kBAKnG,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,QAGhC,CAAC"}
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.doInjectForAutorpc = exports.Autorpc = exports.ID_KEY = exports.RPC = void 0;
4
+ const core_1 = require("@celljs/core");
5
+ exports.RPC = Symbol('RPC');
6
+ exports.ID_KEY = Symbol('ID_KEY');
7
+ const Autorpc = function (idOrOption) {
8
+ return (target, targetKey, index) => {
9
+ const option = (0, core_1.parseAutowiredOption)(target, targetKey, index, idOrOption);
10
+ (0, core_1.applyAutowiredDecorator)(option, target, targetKey, index, exports.doInjectForAutorpc);
11
+ };
12
+ };
13
+ exports.Autorpc = Autorpc;
14
+ const doInjectForAutorpc = (option, t, k, i) => {
15
+ (0, core_1.Inject)(exports.RPC)(t, k, i);
16
+ (0, core_1.Tagged)(exports.ID_KEY, option.id)(t, k, i);
17
+ };
18
+ exports.doInjectForAutorpc = doInjectForAutorpc;
19
+ //# sourceMappingURL=autorpc.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"autorpc.js","sourceRoot":"","sources":["../../../src/common/annotation/autorpc.ts"],"names":[],"mappings":";;;AAAA,uCAAwI;AAE3H,QAAA,GAAG,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;AACpB,QAAA,MAAM,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC;AAEhC,MAAM,OAAO,GAAG,UAAU,UAA4C;IACzE,OAAO,CAAC,MAAW,EAAE,SAAiB,EAAE,KAAc,EAAE,EAAE;QACtD,MAAM,MAAM,GAAG,IAAA,2BAAoB,EAAC,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,UAAU,CAAC,CAAC;QAC1E,IAAA,8BAAuB,EAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,0BAAkB,CAAC,CAAC;IAClF,CAAC,CAAC;AACN,CAAC,CAAC;AALW,QAAA,OAAO,WAKlB;AAEK,MAAM,kBAAkB,GAAa,CAAC,MAAM,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE;IAC5D,IAAA,aAAM,EAAC,WAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IACrB,IAAA,aAAM,EAAC,cAAM,EAAE,MAAM,CAAC,EAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;AACxC,CAAC,CAAC;AAHW,QAAA,kBAAkB,sBAG7B"}
@@ -0,0 +1,3 @@
1
+ import { IdOrAutowiredOptionWithoutMulti } from '@celljs/core';
2
+ export declare const Autorpc: (idOrOption?: IdOrAutowiredOptionWithoutMulti) => PropertyDecorator & ParameterDecorator;
3
+ //# sourceMappingURL=autorpc.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"autorpc.d.ts","sourceRoot":"","sources":["../../../../src/common/annotation/detached/autorpc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsD,+BAA+B,EAAwB,MAAM,cAAc,CAAC;AAGzI,eAAO,MAAM,OAAO,gBAA0B,+BAA+B,KAAG,iBAAiB,GAAG,kBAMnG,CAAC"}
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Autorpc = void 0;
4
+ const core_1 = require("@celljs/core");
5
+ const autorpc_1 = require("../autorpc");
6
+ const Autorpc = function (idOrOption) {
7
+ return (target, targetKey, index) => {
8
+ const option = (0, core_1.parseAutowiredOption)(target, targetKey, index, idOrOption);
9
+ option.detached = true;
10
+ (0, core_1.applyAutowiredDecorator)(option, target, targetKey, index, autorpc_1.doInjectForAutorpc, doGetValueForAutorpc);
11
+ };
12
+ };
13
+ exports.Autorpc = Autorpc;
14
+ const doGetValueForAutorpc = (option, t, property) => core_1.ContainerUtil.getTagged(autorpc_1.RPC, autorpc_1.ID_KEY, option.id);
15
+ //# sourceMappingURL=autorpc.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"autorpc.js","sourceRoot":"","sources":["../../../../src/common/annotation/detached/autorpc.ts"],"names":[],"mappings":";;;AAAA,uCAAyI;AACzI,wCAA6D;AAEtD,MAAM,OAAO,GAAG,UAAU,UAA4C;IACzE,OAAO,CAAC,MAAW,EAAE,SAAiB,EAAE,KAAc,EAAE,EAAE;QACtD,MAAM,MAAM,GAAG,IAAA,2BAAoB,EAAC,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,UAAU,CAAC,CAAC;QAC1E,MAAM,CAAC,QAAQ,GAAG,IAAI,CAAC;QACvB,IAAA,8BAAuB,EAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,4BAAkB,EAAE,oBAAoB,CAAC,CAAC;IACxG,CAAC,CAAC;AACN,CAAC,CAAC;AANW,QAAA,OAAO,WAMlB;AAEF,MAAM,oBAAoB,GAAe,CAAC,MAAM,EAAE,CAAC,EAAE,QAAQ,EAAE,EAAE,CAAC,oBAAa,CAAC,SAAS,CAAC,aAAG,EAAE,gBAAM,EAAE,MAAM,CAAC,EAAG,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from './autorpc';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/common/annotation/detached/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC"}
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./autorpc"), exports);
18
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/common/annotation/detached/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4CAA0B"}
@@ -0,0 +1,3 @@
1
+ export * from './rpc';
2
+ export * from './autorpc';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/common/annotation/index.ts"],"names":[],"mappings":"AAAA,cAAc,OAAO,CAAC;AACtB,cAAc,WAAW,CAAC"}
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./rpc"), exports);
18
+ __exportStar(require("./autorpc"), exports);
19
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/common/annotation/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,wCAAsB;AACtB,4CAA0B"}
@@ -0,0 +1,20 @@
1
+ import { ComponentDecorator, ComponentOption } from '@celljs/core';
2
+ export declare const RPC_TAG = "Rpc";
3
+ export declare const Rpc: ComponentDecorator;
4
+ export declare function parseRpcOption(target: any, idOrOption: any): {
5
+ id?: string | symbol | import("inversify/lib/interfaces/interfaces").interfaces.Abstract<any> | import("@celljs/core").ComponentId<any>[] | undefined;
6
+ scope?: import("@celljs/core").Scope | undefined;
7
+ name?: string | number | symbol | undefined;
8
+ tag?: {
9
+ tag: string | number | symbol;
10
+ value: any;
11
+ } | undefined;
12
+ default?: boolean | undefined;
13
+ when?: ((request: import("inversify/lib/interfaces/interfaces").interfaces.Request) => boolean) | undefined;
14
+ rebind?: boolean | undefined;
15
+ proxy?: boolean | undefined;
16
+ sysTags?: string[] | undefined;
17
+ onActivation?: ((context: import("inversify/lib/interfaces/interfaces").interfaces.Context, t: any) => any) | undefined;
18
+ };
19
+ export declare function applyRpcDecorator(option: ComponentOption, target: any): import("@celljs/core").ComponentMetadata;
20
+ //# sourceMappingURL=rpc.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rpc.d.ts","sourceRoot":"","sources":["../../../src/common/annotation/rpc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAA2B,eAAe,EAA2C,MAAM,cAAc,CAAC;AAMrI,eAAO,MAAM,OAAO,QAAQ,CAAC;AAE7B,eAAO,MAAM,GAAG,oBAKf,CAAC;AAEF,wBAAgB,cAAc,CAAC,MAAM,EAAE,GAAG,EAAE,UAAU,EAAE,GAAG;;;;;;;;;;;;;;EAQ1D;AAED,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,eAAe,EAAE,MAAM,EAAE,GAAG,4CAcrE"}
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.applyRpcDecorator = exports.parseRpcOption = exports.Rpc = exports.RPC_TAG = void 0;
4
+ const core_1 = require("@celljs/core");
5
+ const web_1 = require("@celljs/web");
6
+ const handler_1 = require("../handler");
7
+ const factory_1 = require("../factory");
8
+ const utils_1 = require("../utils");
9
+ exports.RPC_TAG = 'Rpc';
10
+ exports.Rpc = function (...idOrOption) {
11
+ return target => {
12
+ const option = parseRpcOption(target, idOrOption);
13
+ applyRpcDecorator(option, target);
14
+ };
15
+ };
16
+ function parseRpcOption(target, idOrOption) {
17
+ const parsed = (0, core_1.parseComponentOption)(target, idOrOption);
18
+ if (idOrOption[0].proxy === undefined) {
19
+ parsed.proxy = true;
20
+ }
21
+ parsed.sysTags.push(web_1.AOP_POINTCUT, exports.RPC_TAG);
22
+ return parsed;
23
+ }
24
+ exports.parseRpcOption = parseRpcOption;
25
+ function applyRpcDecorator(option, target) {
26
+ const { ids } = (0, core_1.applyComponentDecorator)(option, target);
27
+ const id = ids[1] || ids[0];
28
+ return (0, core_1.applyComponentDecorator)({ id: handler_1.ConnectionHandler, onActivation: context => {
29
+ const t = context.container.get(id);
30
+ const pipeManager = context.container.get(web_1.PipeManager);
31
+ const logger = context.container.get(core_1.Logger);
32
+ const errorConverters = utils_1.ConverterUtil.getGlobalErrorConverters(context.container);
33
+ const errorConverter = utils_1.ConverterUtil.getErrorConverters(id, context.container);
34
+ if (errorConverter) {
35
+ errorConverters.push(errorConverter);
36
+ }
37
+ return new factory_1.JsonRpcConnectionHandler(utils_1.RpcUtil.toPath(id), () => t, errorConverters, pipeManager, logger);
38
+ } }, target);
39
+ }
40
+ exports.applyRpcDecorator = applyRpcDecorator;
41
+ //# sourceMappingURL=rpc.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rpc.js","sourceRoot":"","sources":["../../../src/common/annotation/rpc.ts"],"names":[],"mappings":";;;AAAA,uCAAqI;AACrI,qCAAwD;AACxD,wCAA+C;AAC/C,wCAAsD;AACtD,oCAAkD;AAErC,QAAA,OAAO,GAAG,KAAK,CAAC;AAEhB,QAAA,GAAG,GAAuB,UAAU,GAAG,UAAe;IAC/D,OAAO,MAAM,CAAC,EAAE;QACZ,MAAM,MAAM,GAAG,cAAc,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;QAClD,iBAAiB,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACtC,CAAC,CAAC;AACN,CAAC,CAAC;AAEF,SAAgB,cAAc,CAAC,MAAW,EAAE,UAAe;IACvD,MAAM,MAAM,GAAG,IAAA,2BAAoB,EAAC,MAAM,EAAE,UAAU,CAAC,CAAC;IAExD,IAAI,UAAU,CAAC,CAAC,CAAC,CAAC,KAAK,KAAK,SAAS,EAAE;QACnC,MAAM,CAAC,KAAK,GAAG,IAAI,CAAC;KACvB;IACD,MAAM,CAAC,OAAQ,CAAC,IAAI,CAAC,kBAAY,EAAE,eAAO,CAAC,CAAC;IAC5C,OAAO,MAAM,CAAC;AAClB,CAAC;AARD,wCAQC;AAED,SAAgB,iBAAiB,CAAC,MAAuB,EAAE,MAAW;IAClE,MAAM,EAAE,GAAG,EAAE,GAAG,IAAA,8BAAuB,EAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACxD,MAAM,EAAE,GAAG,GAAG,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC;IAC5B,OAAO,IAAA,8BAAuB,EAAC,EAAE,EAAE,EAAE,2BAAiB,EAAE,YAAY,EAAE,OAAO,CAAC,EAAE;YAC5E,MAAM,CAAC,GAAG,OAAO,CAAC,SAAS,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;YACpC,MAAM,WAAW,GAAG,OAAO,CAAC,SAAS,CAAC,GAAG,CAAc,iBAAW,CAAC,CAAC;YACpE,MAAM,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC,GAAG,CAAS,aAAM,CAAC,CAAC;YACrD,MAAM,eAAe,GAAG,qBAAa,CAAC,wBAAwB,CAAC,OAAO,CAAC,SAAsB,CAAC,CAAC;YAC/F,MAAM,cAAc,GAAG,qBAAa,CAAC,kBAAkB,CAAC,EAAE,EAAE,OAAO,CAAC,SAAsB,CAAC,CAAC;YAC5F,IAAI,cAAc,EAAE;gBAChB,eAAe,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;aACxC;YACD,OAAO,IAAI,kCAAwB,CAAC,eAAO,CAAC,MAAM,CAAC,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,CAAC,CAAC;QAC3G,CAAC,EAAC,EAAE,MAAM,CAAC,CAAC;AAChB,CAAC;AAdD,8CAcC"}
@@ -0,0 +1,52 @@
1
+ import { Disposable } from 'vscode-jsonrpc';
2
+ import { DisposableCollection } from '@celljs/core';
3
+ export interface Channel {
4
+ handleMessage(message: Channel.Message): void;
5
+ send(content: string): void;
6
+ onMessage(cb: (data: any) => void): void;
7
+ }
8
+ export declare namespace Channel {
9
+ interface OpenMessage {
10
+ kind: 'open';
11
+ id: number;
12
+ path: string;
13
+ }
14
+ interface ReadyMessage {
15
+ kind: 'ready';
16
+ id: number;
17
+ }
18
+ interface DataMessage {
19
+ kind: 'data';
20
+ id: number;
21
+ content: string;
22
+ }
23
+ interface CloseMessage {
24
+ kind: 'close';
25
+ id: number;
26
+ code: number;
27
+ reason: string;
28
+ }
29
+ interface HttpMessage {
30
+ kind: 'http';
31
+ id: number;
32
+ path?: string;
33
+ content: string;
34
+ }
35
+ type Message = OpenMessage | ReadyMessage | DataMessage | CloseMessage | HttpMessage;
36
+ }
37
+ export declare abstract class AbstractChannel implements Channel, Disposable {
38
+ readonly id: number;
39
+ protected readonly doSend: (content: string) => Promise<void>;
40
+ protected readonly toDispose: DisposableCollection;
41
+ constructor(id: number, doSend: (content: string) => Promise<void>);
42
+ dispose(): void;
43
+ protected checkNotDisposed(): void;
44
+ abstract handleMessage(message: Channel.Message): void;
45
+ abstract doGetMessage(content: string): Channel.Message;
46
+ send(content: string): void;
47
+ protected fireMessage: (data: any) => void;
48
+ onMessage(cb: (data: any) => void): void;
49
+ fireError: (reason: any) => void;
50
+ onError(cb: (reason: any) => void): void;
51
+ }
52
+ //# sourceMappingURL=channel-protocol.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"channel-protocol.d.ts","sourceRoot":"","sources":["../../../src/common/channal/channel-protocol.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAEpD,MAAM,WAAW,OAAO;IACpB,aAAa,CAAC,OAAO,EAAE,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC;IAC9C,IAAI,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,SAAS,CAAC,EAAE,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,IAAI,GAAG,IAAI,CAAC;CAC5C;AAED,yBAAiB,OAAO,CAAC;IACrB,UAAiB,WAAW;QACxB,IAAI,EAAE,MAAM,CAAA;QACZ,EAAE,EAAE,MAAM,CAAA;QACV,IAAI,EAAE,MAAM,CAAA;KACf;IACD,UAAiB,YAAY;QACzB,IAAI,EAAE,OAAO,CAAA;QACb,EAAE,EAAE,MAAM,CAAA;KACb;IACD,UAAiB,WAAW;QACxB,IAAI,EAAE,MAAM,CAAA;QACZ,EAAE,EAAE,MAAM,CAAA;QACV,OAAO,EAAE,MAAM,CAAA;KAClB;IACD,UAAiB,YAAY;QACzB,IAAI,EAAE,OAAO,CAAA;QACb,EAAE,EAAE,MAAM,CAAA;QACV,IAAI,EAAE,MAAM,CAAA;QACZ,MAAM,EAAE,MAAM,CAAA;KACjB;IACD,UAAiB,WAAW;QACxB,IAAI,EAAE,MAAM,CAAA;QACZ,EAAE,EAAE,MAAM,CAAA;QACV,IAAI,CAAC,EAAE,MAAM,CAAA;QACb,OAAO,EAAE,MAAM,CAAA;KAClB;IACD,KAAY,OAAO,GAAG,WAAW,GAAG,YAAY,GAAG,WAAW,GAAG,YAAY,GAAG,WAAW,CAAC;CAC/F;AAED,8BAAsB,eAAgB,YAAW,OAAO,EAAE,UAAU;IAK5D,QAAQ,CAAC,EAAE,EAAE,MAAM;IACnB,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC;IAJjE,SAAS,CAAC,QAAQ,CAAC,SAAS,uBAA8B;gBAG7C,EAAE,EAAE,MAAM,EACA,MAAM,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC;IAGjE,OAAO,IAAI,IAAI;IAIf,SAAS,CAAC,gBAAgB,IAAI,IAAI;IAMlC,QAAQ,CAAC,aAAa,CAAC,OAAO,EAAE,OAAO,CAAC,OAAO,GAAG,IAAI;IAEtD,QAAQ,CAAC,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO;IAEvD,IAAI,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAK3B,SAAS,CAAC,WAAW,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,IAAI,CAAa;IACvD,SAAS,CAAC,EAAE,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,IAAI,GAAG,IAAI;IAMxC,SAAS,EAAE,CAAC,MAAM,EAAE,GAAG,KAAK,IAAI,CAAa;IAC7C,OAAO,CAAC,EAAE,EAAE,CAAC,MAAM,EAAE,GAAG,KAAK,IAAI,GAAG,IAAI;CAM3C"}
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AbstractChannel = void 0;
4
+ const vscode_jsonrpc_1 = require("vscode-jsonrpc");
5
+ const core_1 = require("@celljs/core");
6
+ class AbstractChannel {
7
+ constructor(id, doSend) {
8
+ this.id = id;
9
+ this.doSend = doSend;
10
+ this.toDispose = new core_1.DisposableCollection();
11
+ this.fireMessage = () => { };
12
+ this.fireError = () => { };
13
+ }
14
+ dispose() {
15
+ this.toDispose.dispose();
16
+ }
17
+ checkNotDisposed() {
18
+ if (this.toDispose.disposed) {
19
+ throw new Error('The channel has been disposed.');
20
+ }
21
+ }
22
+ send(content) {
23
+ this.checkNotDisposed();
24
+ this.doSend(JSON.stringify(this.doGetMessage(content)));
25
+ }
26
+ onMessage(cb) {
27
+ this.checkNotDisposed();
28
+ this.fireMessage = cb;
29
+ this.toDispose.push(vscode_jsonrpc_1.Disposable.create(() => this.fireMessage = () => { }));
30
+ }
31
+ onError(cb) {
32
+ this.checkNotDisposed();
33
+ this.fireError = cb;
34
+ this.toDispose.push(vscode_jsonrpc_1.Disposable.create(() => this.fireError = () => { }));
35
+ }
36
+ }
37
+ exports.AbstractChannel = AbstractChannel;
38
+ //# sourceMappingURL=channel-protocol.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"channel-protocol.js","sourceRoot":"","sources":["../../../src/common/channal/channel-protocol.ts"],"names":[],"mappings":";;;AAAA,mDAA4C;AAC5C,uCAAoD;AAsCpD,MAAsB,eAAe;IAIjC,YACa,EAAU,EACA,MAA0C;QADpD,OAAE,GAAF,EAAE,CAAQ;QACA,WAAM,GAAN,MAAM,CAAoC;QAJ9C,cAAS,GAAG,IAAI,2BAAoB,EAAE,CAAC;QA0BhD,gBAAW,GAAwB,GAAG,EAAE,GAAG,CAAC,CAAC;QAOvD,cAAS,GAA0B,GAAG,EAAE,GAAG,CAAC,CAAC;IA5BzC,CAAC;IAEL,OAAO;QACH,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,CAAC;IAC7B,CAAC;IAES,gBAAgB;QACtB,IAAI,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE;YACzB,MAAM,IAAI,KAAK,CAAC,gCAAgC,CAAC,CAAC;SACrD;IACL,CAAC;IAMD,IAAI,CAAC,OAAe;QAChB,IAAI,CAAC,gBAAgB,EAAE,CAAC;QACxB,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IAC5D,CAAC;IAGD,SAAS,CAAC,EAAuB;QAC7B,IAAI,CAAC,gBAAgB,EAAE,CAAC;QACxB,IAAI,CAAC,WAAW,GAAG,EAAE,CAAC;QACtB,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,2BAAU,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,WAAW,GAAG,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC;IAC/E,CAAC;IAGD,OAAO,CAAC,EAAyB;QAC7B,IAAI,CAAC,gBAAgB,EAAE,CAAC;QACxB,IAAI,CAAC,SAAS,GAAG,EAAE,CAAC;QACpB,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,2BAAU,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,SAAS,GAAG,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC;IAC7E,CAAC;CAEJ;AA1CD,0CA0CC"}
@@ -0,0 +1,9 @@
1
+ import { Channel, AbstractChannel } from './channel-protocol';
2
+ export declare class HttpChannel extends AbstractChannel {
3
+ protected readonly path?: string | undefined;
4
+ constructor(id: number, doSend: (content: string) => Promise<void>, path?: string | undefined);
5
+ protected checkNotDisposed(): void;
6
+ handleMessage(message: Channel.HttpMessage): void;
7
+ doGetMessage(content: string): Channel.Message;
8
+ }
9
+ //# sourceMappingURL=http-channel.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"http-channel.d.ts","sourceRoot":"","sources":["../../../src/common/channal/http-channel.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAE9D,qBAAa,WAAY,SAAQ,eAAe;IAKxC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC;gBAFxB,EAAE,EAAE,MAAM,EACV,MAAM,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,EACvB,IAAI,CAAC,oBAAQ;cAKjB,gBAAgB,IAAI,IAAI;IAI3C,aAAa,CAAC,OAAO,EAAE,OAAO,CAAC,WAAW;IAI1C,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO;CASjD"}
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.HttpChannel = void 0;
4
+ const channel_protocol_1 = require("./channel-protocol");
5
+ class HttpChannel extends channel_protocol_1.AbstractChannel {
6
+ constructor(id, doSend, path) {
7
+ super(id, doSend);
8
+ this.path = path;
9
+ }
10
+ checkNotDisposed() {
11
+ // noop
12
+ }
13
+ handleMessage(message) {
14
+ this.fireMessage(message.content);
15
+ }
16
+ doGetMessage(content) {
17
+ return {
18
+ kind: 'http',
19
+ id: this.id,
20
+ path: this.path,
21
+ content
22
+ };
23
+ }
24
+ }
25
+ exports.HttpChannel = HttpChannel;
26
+ //# sourceMappingURL=http-channel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"http-channel.js","sourceRoot":"","sources":["../../../src/common/channal/http-channel.ts"],"names":[],"mappings":";;;AAAA,yDAA8D;AAE9D,MAAa,WAAY,SAAQ,kCAAe;IAE5C,YACI,EAAU,EACV,MAA0C,EACvB,IAAa;QAEhC,KAAK,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC;QAFC,SAAI,GAAJ,IAAI,CAAS;IAGpC,CAAC;IAEkB,gBAAgB;QAC/B,OAAO;IACX,CAAC;IAED,aAAa,CAAC,OAA4B;QACtC,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IACtC,CAAC;IAED,YAAY,CAAC,OAAe;QACxB,OAA4B;YACxB,IAAI,EAAE,MAAM;YACZ,EAAE,EAAE,IAAI,CAAC,EAAE;YACX,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,OAAO;SACV,CAAC;IACN,CAAC;CAEJ;AA3BD,kCA2BC"}
@@ -0,0 +1,3 @@
1
+ export * from './http-channel';
2
+ export * from './channel-protocol';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/common/channal/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC"}
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./http-channel"), exports);
18
+ __exportStar(require("./channel-protocol"), exports);
19
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/common/channal/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,iDAA+B;AAC/B,qDAAmC"}
@@ -0,0 +1,2 @@
1
+ export declare const RPC_PATH = "cell.rpc.path";
2
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/common/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,QAAQ,kBAAkB,CAAC"}
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.RPC_PATH = void 0;
4
+ exports.RPC_PATH = 'cell.rpc.path';
5
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/common/constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,QAAQ,GAAG,eAAe,CAAC"}
@@ -0,0 +1,7 @@
1
+ export declare const ErrorConverter: unique symbol;
2
+ export declare const GlobalConverter: unique symbol;
3
+ export interface ErrorConverter {
4
+ serialize(e: any): any;
5
+ deserialize(e: any): any;
6
+ }
7
+ //# sourceMappingURL=converter-protocol.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"converter-protocol.d.ts","sourceRoot":"","sources":["../../../src/common/converter/converter-protocol.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,cAAc,eAA2B,CAAC;AAEvD,eAAO,MAAM,eAAe,eAA4B,CAAC;AAEzD,MAAM,WAAW,cAAc;IAC3B,SAAS,CAAC,CAAC,EAAE,GAAG,GAAG,GAAG,CAAC;IACvB,WAAW,CAAC,CAAC,EAAE,GAAG,GAAG,GAAG,CAAA;CAC3B"}
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GlobalConverter = exports.ErrorConverter = void 0;
4
+ exports.ErrorConverter = Symbol('ErrorConverter');
5
+ exports.GlobalConverter = Symbol('GlobalConverter');
6
+ //# sourceMappingURL=converter-protocol.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"converter-protocol.js","sourceRoot":"","sources":["../../../src/common/converter/converter-protocol.ts"],"names":[],"mappings":";;;AAAa,QAAA,cAAc,GAAG,MAAM,CAAC,gBAAgB,CAAC,CAAC;AAE1C,QAAA,eAAe,GAAG,MAAM,CAAC,iBAAiB,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from './converter-protocol';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/common/converter/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC"}
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./converter-protocol"), exports);
18
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/common/converter/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,uDAAqC"}
@@ -0,0 +1,5 @@
1
+ export declare const EndpointResolver: unique symbol;
2
+ export interface EndpointResolver {
3
+ resolve(serviceIdentifier: string): Promise<string>;
4
+ }
5
+ //# sourceMappingURL=endpoint-protocol.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"endpoint-protocol.d.ts","sourceRoot":"","sources":["../../../src/common/endpoint/endpoint-protocol.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gBAAgB,eAA6B,CAAC;AAE3D,MAAM,WAAW,gBAAgB;IAC7B,OAAO,CAAC,iBAAiB,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;CACvD"}
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.EndpointResolver = void 0;
4
+ exports.EndpointResolver = Symbol('EndpointResolver');
5
+ //# sourceMappingURL=endpoint-protocol.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"endpoint-protocol.js","sourceRoot":"","sources":["../../../src/common/endpoint/endpoint-protocol.ts"],"names":[],"mappings":";;;AAAa,QAAA,gBAAgB,GAAG,MAAM,CAAC,kBAAkB,CAAC,CAAC"}
@@ -0,0 +1,13 @@
1
+ import { PathResolver } from '@celljs/web';
2
+ import { EndpointResolver } from './endpoint-protocol';
3
+ export declare class EndpointResolverImpl implements EndpointResolver {
4
+ protected readonly endpoint?: {
5
+ [id: string]: string;
6
+ };
7
+ protected readonly defaultEndpoint?: string;
8
+ protected readonly rpcPath: string;
9
+ protected pathResolver: PathResolver;
10
+ protected parsed: Map<string, string>;
11
+ resolve(serviceIdentifier: string): Promise<string>;
12
+ }
13
+ //# sourceMappingURL=endpoint-resolver.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"endpoint-resolver.d.ts","sourceRoot":"","sources":["../../../src/common/endpoint/endpoint-resolver.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3C,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAEvD,qBACa,oBAAqB,YAAW,gBAAgB;IAGzD,SAAS,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE;QAAE,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAC;IAGvD,SAAS,CAAC,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,CAAC;IAG5C,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IAGnC,SAAS,CAAC,YAAY,EAAE,YAAY,CAAC;IAErC,SAAS,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAEhC,OAAO,CAAC,iBAAiB,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;CAsB5D"}
@@ -0,0 +1,61 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.EndpointResolverImpl = void 0;
13
+ const core_1 = require("@celljs/core");
14
+ const constants_1 = require("../constants");
15
+ const web_1 = require("@celljs/web");
16
+ const error_1 = require("../error");
17
+ const endpoint_protocol_1 = require("./endpoint-protocol");
18
+ let EndpointResolverImpl = class EndpointResolverImpl {
19
+ async resolve(serviceIdentifier) {
20
+ let result;
21
+ if (this.endpoint) {
22
+ result = this.endpoint[serviceIdentifier];
23
+ }
24
+ if (/^https?:/i.test(serviceIdentifier)) {
25
+ result = serviceIdentifier;
26
+ }
27
+ if (!result) {
28
+ result = this.defaultEndpoint;
29
+ }
30
+ if (!result && typeof location !== 'undefined') {
31
+ result = `${location.protocol}//${location.host}{rpcPath}/{serviceIdentifier}`;
32
+ }
33
+ if (!result) {
34
+ throw new error_1.EndpointNotFoundError(serviceIdentifier);
35
+ }
36
+ return result
37
+ .replace(/{rpcPath}/g, await this.pathResolver.resolve(this.rpcPath))
38
+ .replace(/{serviceIdentifier}/g, serviceIdentifier);
39
+ }
40
+ };
41
+ __decorate([
42
+ (0, core_1.Value)('cell.rpc.endpoint'),
43
+ __metadata("design:type", Object)
44
+ ], EndpointResolverImpl.prototype, "endpoint", void 0);
45
+ __decorate([
46
+ (0, core_1.Value)('cell.rpc.defaultEndpoint'),
47
+ __metadata("design:type", String)
48
+ ], EndpointResolverImpl.prototype, "defaultEndpoint", void 0);
49
+ __decorate([
50
+ (0, core_1.Value)(constants_1.RPC_PATH),
51
+ __metadata("design:type", String)
52
+ ], EndpointResolverImpl.prototype, "rpcPath", void 0);
53
+ __decorate([
54
+ (0, core_1.Autowired)(web_1.PathResolver),
55
+ __metadata("design:type", Object)
56
+ ], EndpointResolverImpl.prototype, "pathResolver", void 0);
57
+ EndpointResolverImpl = __decorate([
58
+ (0, core_1.Component)(endpoint_protocol_1.EndpointResolver)
59
+ ], EndpointResolverImpl);
60
+ exports.EndpointResolverImpl = EndpointResolverImpl;
61
+ //# sourceMappingURL=endpoint-resolver.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"endpoint-resolver.js","sourceRoot":"","sources":["../../../src/common/endpoint/endpoint-resolver.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,uCAA2D;AAC3D,4CAAwC;AACxC,qCAA2C;AAC3C,oCAAiD;AACjD,2DAAuD;AAGhD,IAAM,oBAAoB,GAA1B,MAAM,oBAAoB;IAgB7B,KAAK,CAAC,OAAO,CAAC,iBAAyB;QACnC,IAAI,MAA0B,CAAC;QAC/B,IAAI,IAAI,CAAC,QAAQ,EAAE;YACf,MAAM,GAAG,IAAI,CAAC,QAAQ,CAAC,iBAAiB,CAAC,CAAC;SAC7C;QACD,IAAI,WAAW,CAAC,IAAI,CAAC,iBAAiB,CAAC,EAAE;YACrC,MAAM,GAAG,iBAAiB,CAAC;SAC9B;QACD,IAAI,CAAC,MAAM,EAAE;YACT,MAAM,GAAG,IAAI,CAAC,eAAe,CAAC;SACjC;QACD,IAAI,CAAC,MAAM,IAAI,OAAO,QAAQ,KAAK,WAAW,EAAE;YAC5C,MAAM,GAAG,GAAG,QAAQ,CAAC,QAAQ,KAAK,QAAQ,CAAC,IAAI,+BAA+B,CAAC;SAClF;QACD,IAAI,CAAC,MAAM,EAAE;YACT,MAAM,IAAI,6BAAqB,CAAC,iBAAiB,CAAC,CAAC;SACtD;QACD,OAAO,MAAM;aACR,OAAO,CAAC,YAAY,EAAE,MAAM,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;aACpE,OAAO,CAAC,sBAAsB,EAAE,iBAAiB,CAAC,CAAC;IAC5D,CAAC;CAEJ,CAAA;AApCG;IAAC,IAAA,YAAK,EAAC,mBAAmB,CAAC;;sDAC4B;AAEvD;IAAC,IAAA,YAAK,EAAC,0BAA0B,CAAC;;6DACU;AAE5C;IAAC,IAAA,YAAK,EAAC,oBAAQ,CAAC;;qDACmB;AAEnC;IAAC,IAAA,gBAAS,EAAC,kBAAY,CAAC;;0DACa;AAZ5B,oBAAoB;IADhC,IAAA,gBAAS,EAAC,oCAAgB,CAAC;GACf,oBAAoB,CAsChC;AAtCY,oDAAoB"}
@@ -0,0 +1,3 @@
1
+ export * from './endpoint-protocol';
2
+ export * from './endpoint-resolver';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/common/endpoint/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC"}