@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.
- package/LICENSE +21 -0
- package/README.md +1 -0
- package/cell.yml +8 -0
- package/lib/common/annotation/autorpc.d.ts +6 -0
- package/lib/common/annotation/autorpc.d.ts.map +1 -0
- package/lib/common/annotation/autorpc.js +19 -0
- package/lib/common/annotation/autorpc.js.map +1 -0
- package/lib/common/annotation/detached/autorpc.d.ts +3 -0
- package/lib/common/annotation/detached/autorpc.d.ts.map +1 -0
- package/lib/common/annotation/detached/autorpc.js +15 -0
- package/lib/common/annotation/detached/autorpc.js.map +1 -0
- package/lib/common/annotation/detached/index.d.ts +2 -0
- package/lib/common/annotation/detached/index.d.ts.map +1 -0
- package/lib/common/annotation/detached/index.js +18 -0
- package/lib/common/annotation/detached/index.js.map +1 -0
- package/lib/common/annotation/index.d.ts +3 -0
- package/lib/common/annotation/index.d.ts.map +1 -0
- package/lib/common/annotation/index.js +19 -0
- package/lib/common/annotation/index.js.map +1 -0
- package/lib/common/annotation/rpc.d.ts +20 -0
- package/lib/common/annotation/rpc.d.ts.map +1 -0
- package/lib/common/annotation/rpc.js +41 -0
- package/lib/common/annotation/rpc.js.map +1 -0
- package/lib/common/channal/channel-protocol.d.ts +52 -0
- package/lib/common/channal/channel-protocol.d.ts.map +1 -0
- package/lib/common/channal/channel-protocol.js +38 -0
- package/lib/common/channal/channel-protocol.js.map +1 -0
- package/lib/common/channal/http-channel.d.ts +9 -0
- package/lib/common/channal/http-channel.d.ts.map +1 -0
- package/lib/common/channal/http-channel.js +26 -0
- package/lib/common/channal/http-channel.js.map +1 -0
- package/lib/common/channal/index.d.ts +3 -0
- package/lib/common/channal/index.d.ts.map +1 -0
- package/lib/common/channal/index.js +19 -0
- package/lib/common/channal/index.js.map +1 -0
- package/lib/common/constants.d.ts +2 -0
- package/lib/common/constants.d.ts.map +1 -0
- package/lib/common/constants.js +5 -0
- package/lib/common/constants.js.map +1 -0
- package/lib/common/converter/converter-protocol.d.ts +7 -0
- package/lib/common/converter/converter-protocol.d.ts.map +1 -0
- package/lib/common/converter/converter-protocol.js +6 -0
- package/lib/common/converter/converter-protocol.js.map +1 -0
- package/lib/common/converter/index.d.ts +2 -0
- package/lib/common/converter/index.d.ts.map +1 -0
- package/lib/common/converter/index.js +18 -0
- package/lib/common/converter/index.js.map +1 -0
- package/lib/common/endpoint/endpoint-protocol.d.ts +5 -0
- package/lib/common/endpoint/endpoint-protocol.d.ts.map +1 -0
- package/lib/common/endpoint/endpoint-protocol.js +5 -0
- package/lib/common/endpoint/endpoint-protocol.js.map +1 -0
- package/lib/common/endpoint/endpoint-resolver.d.ts +13 -0
- package/lib/common/endpoint/endpoint-resolver.d.ts.map +1 -0
- package/lib/common/endpoint/endpoint-resolver.js +61 -0
- package/lib/common/endpoint/endpoint-resolver.js.map +1 -0
- package/lib/common/endpoint/index.d.ts +3 -0
- package/lib/common/endpoint/index.d.ts.map +1 -0
- package/lib/common/endpoint/index.js +19 -0
- package/lib/common/endpoint/index.js.map +1 -0
- package/lib/common/error/error.d.ts +6 -0
- package/lib/common/error/error.d.ts.map +1 -0
- package/lib/common/error/error.js +12 -0
- package/lib/common/error/error.js.map +1 -0
- package/lib/common/error/index.d.ts +2 -0
- package/lib/common/error/index.d.ts.map +1 -0
- package/lib/common/error/index.js +18 -0
- package/lib/common/error/index.js.map +1 -0
- package/lib/common/factory/connection-factory.d.ts +10 -0
- package/lib/common/factory/connection-factory.d.ts.map +1 -0
- package/lib/common/factory/connection-factory.js +28 -0
- package/lib/common/factory/connection-factory.js.map +1 -0
- package/lib/common/factory/index.d.ts +5 -0
- package/lib/common/factory/index.d.ts.map +1 -0
- package/lib/common/factory/index.js +21 -0
- package/lib/common/factory/index.js.map +1 -0
- package/lib/common/factory/proxy-factory.d.ts +57 -0
- package/lib/common/factory/proxy-factory.d.ts.map +1 -0
- package/lib/common/factory/proxy-factory.js +182 -0
- package/lib/common/factory/proxy-factory.js.map +1 -0
- package/lib/common/factory/reader.d.ts +16 -0
- package/lib/common/factory/reader.d.ts.map +1 -0
- package/lib/common/factory/reader.js +48 -0
- package/lib/common/factory/reader.js.map +1 -0
- package/lib/common/factory/writer.d.ts +10 -0
- package/lib/common/factory/writer.d.ts.map +1 -0
- package/lib/common/factory/writer.js +25 -0
- package/lib/common/factory/writer.js.map +1 -0
- package/lib/common/handler/connection-handler.d.ts +7 -0
- package/lib/common/handler/connection-handler.d.ts.map +1 -0
- package/lib/common/handler/connection-handler.js +8 -0
- package/lib/common/handler/connection-handler.js.map +1 -0
- package/lib/common/handler/handler-protocol.d.ts +7 -0
- package/lib/common/handler/handler-protocol.d.ts.map +1 -0
- package/lib/common/handler/handler-protocol.js +5 -0
- package/lib/common/handler/handler-protocol.js.map +1 -0
- package/lib/common/handler/index.d.ts +3 -0
- package/lib/common/handler/index.d.ts.map +1 -0
- package/lib/common/handler/index.js +19 -0
- package/lib/common/handler/index.js.map +1 -0
- package/lib/common/index.d.ts +12 -0
- package/lib/common/index.d.ts.map +1 -0
- package/lib/common/index.js +28 -0
- package/lib/common/index.js.map +1 -0
- package/lib/common/module.d.ts +4 -0
- package/lib/common/module.d.ts.map +1 -0
- package/lib/common/module.js +22 -0
- package/lib/common/module.js.map +1 -0
- package/lib/common/processor/client-config-processor.d.ts +6 -0
- package/lib/common/processor/client-config-processor.d.ts.map +1 -0
- package/lib/common/processor/client-config-processor.js +20 -0
- package/lib/common/processor/client-config-processor.js.map +1 -0
- package/lib/common/processor/index.d.ts +3 -0
- package/lib/common/processor/index.d.ts.map +1 -0
- package/lib/common/processor/index.js +19 -0
- package/lib/common/processor/index.js.map +1 -0
- package/lib/common/processor/processor-protocol.d.ts +6 -0
- package/lib/common/processor/processor-protocol.d.ts.map +1 -0
- package/lib/common/processor/processor-protocol.js +5 -0
- package/lib/common/processor/processor-protocol.js.map +1 -0
- package/lib/common/proxy/delegating-http-proxy-creator.d.ts +24 -0
- package/lib/common/proxy/delegating-http-proxy-creator.d.ts.map +1 -0
- package/lib/common/proxy/delegating-http-proxy-creator.js +89 -0
- package/lib/common/proxy/delegating-http-proxy-creator.js.map +1 -0
- package/lib/common/proxy/http-proxy-creator.d.ts +43 -0
- package/lib/common/proxy/http-proxy-creator.d.ts.map +1 -0
- package/lib/common/proxy/http-proxy-creator.js +137 -0
- package/lib/common/proxy/http-proxy-creator.js.map +1 -0
- package/lib/common/proxy/index.d.ts +5 -0
- package/lib/common/proxy/index.d.ts.map +1 -0
- package/lib/common/proxy/index.js +21 -0
- package/lib/common/proxy/index.js.map +1 -0
- package/lib/common/proxy/proxy-protocol.d.ts +22 -0
- package/lib/common/proxy/proxy-protocol.d.ts.map +1 -0
- package/lib/common/proxy/proxy-protocol.js +6 -0
- package/lib/common/proxy/proxy-protocol.js.map +1 -0
- package/lib/common/proxy/proxy-provider.d.ts +10 -0
- package/lib/common/proxy/proxy-provider.d.ts.map +1 -0
- package/lib/common/proxy/proxy-provider.js +43 -0
- package/lib/common/proxy/proxy-provider.js.map +1 -0
- package/lib/common/utils/converter-util.d.ts +8 -0
- package/lib/common/utils/converter-util.d.ts.map +1 -0
- package/lib/common/utils/converter-util.js +32 -0
- package/lib/common/utils/converter-util.js.map +1 -0
- package/lib/common/utils/index.d.ts +4 -0
- package/lib/common/utils/index.d.ts.map +1 -0
- package/lib/common/utils/index.js +20 -0
- package/lib/common/utils/index.js.map +1 -0
- package/lib/common/utils/logger.d.ts +9 -0
- package/lib/common/utils/logger.d.ts.map +1 -0
- package/lib/common/utils/logger.js +22 -0
- package/lib/common/utils/logger.js.map +1 -0
- package/lib/common/utils/rpc-util.d.ts +13 -0
- package/lib/common/utils/rpc-util.d.ts.map +1 -0
- package/lib/common/utils/rpc-util.js +46 -0
- package/lib/common/utils/rpc-util.js.map +1 -0
- package/lib/node/channel/channel-manager.d.ts +10 -0
- package/lib/node/channel/channel-manager.d.ts.map +1 -0
- package/lib/node/channel/channel-manager.js +59 -0
- package/lib/node/channel/channel-manager.js.map +1 -0
- package/lib/node/channel/channel-middleware.d.ts +8 -0
- package/lib/node/channel/channel-middleware.d.ts.map +1 -0
- package/lib/node/channel/channel-middleware.js +40 -0
- package/lib/node/channel/channel-middleware.js.map +1 -0
- package/lib/node/channel/channel-protocol.d.ts +13 -0
- package/lib/node/channel/channel-protocol.d.ts.map +1 -0
- package/lib/node/channel/channel-protocol.js +9 -0
- package/lib/node/channel/channel-protocol.js.map +1 -0
- package/lib/node/channel/channel-strategy.d.ts +10 -0
- package/lib/node/channel/channel-strategy.d.ts.map +1 -0
- package/lib/node/channel/channel-strategy.js +64 -0
- package/lib/node/channel/channel-strategy.js.map +1 -0
- package/lib/node/channel/index.d.ts +5 -0
- package/lib/node/channel/index.d.ts.map +1 -0
- package/lib/node/channel/index.js +21 -0
- package/lib/node/channel/index.js.map +1 -0
- package/lib/node/handler/handler-adapter.d.ts +14 -0
- package/lib/node/handler/handler-adapter.d.ts.map +1 -0
- package/lib/node/handler/handler-adapter.js +55 -0
- package/lib/node/handler/handler-adapter.js.map +1 -0
- package/lib/node/handler/handler-protocol.d.ts +2 -0
- package/lib/node/handler/handler-protocol.d.ts.map +1 -0
- package/lib/node/handler/handler-protocol.js +5 -0
- package/lib/node/handler/handler-protocol.js.map +1 -0
- package/lib/node/handler/index.d.ts +3 -0
- package/lib/node/handler/index.d.ts.map +1 -0
- package/lib/node/handler/index.js +19 -0
- package/lib/node/handler/index.js.map +1 -0
- package/lib/node/index.d.ts +3 -0
- package/lib/node/index.d.ts.map +1 -0
- package/lib/node/index.js +19 -0
- package/lib/node/index.js.map +1 -0
- package/lib/node/module.d.ts +4 -0
- package/lib/node/module.d.ts.map +1 -0
- package/lib/node/module.js +6 -0
- package/lib/node/module.js.map +1 -0
- package/lib/package.spec.d.ts +1 -0
- package/lib/package.spec.d.ts.map +1 -0
- package/lib/package.spec.js +4 -0
- package/lib/package.spec.js.map +1 -0
- package/package.json +45 -0
- package/src/common/annotation/autorpc.ts +17 -0
- package/src/common/annotation/detached/autorpc.ts +12 -0
- package/src/common/annotation/detached/index.ts +1 -0
- package/src/common/annotation/index.ts +2 -0
- package/src/common/annotation/rpc.ts +41 -0
- package/src/common/channal/channel-protocol.ts +82 -0
- package/src/common/channal/http-channel.ts +30 -0
- package/src/common/channal/index.ts +2 -0
- package/src/common/constants.ts +1 -0
- package/src/common/converter/converter-protocol.ts +8 -0
- package/src/common/converter/index.ts +1 -0
- package/src/common/endpoint/endpoint-protocol.ts +5 -0
- package/src/common/endpoint/endpoint-resolver.ts +46 -0
- package/src/common/endpoint/index.ts +2 -0
- package/src/common/error/error.ts +7 -0
- package/src/common/error/index.ts +1 -0
- package/src/common/factory/connection-factory.ts +21 -0
- package/src/common/factory/index.ts +4 -0
- package/src/common/factory/proxy-factory.ts +219 -0
- package/src/common/factory/reader.ts +50 -0
- package/src/common/factory/writer.ts +26 -0
- package/src/common/handler/connection-handler.ts +7 -0
- package/src/common/handler/handler-protocol.ts +8 -0
- package/src/common/handler/index.ts +2 -0
- package/src/common/index.ts +11 -0
- package/src/common/module.ts +21 -0
- package/src/common/processor/client-config-processor.ts +12 -0
- package/src/common/processor/index.ts +2 -0
- package/src/common/processor/processor-protocol.ts +7 -0
- package/src/common/proxy/delegating-http-proxy-creator.ts +68 -0
- package/src/common/proxy/http-proxy-creator.ts +179 -0
- package/src/common/proxy/index.ts +5 -0
- package/src/common/proxy/proxy-protocol.ts +26 -0
- package/src/common/proxy/proxy-provider.ts +29 -0
- package/src/common/utils/converter-util.ts +29 -0
- package/src/common/utils/index.ts +3 -0
- package/src/common/utils/logger.ts +23 -0
- package/src/common/utils/rpc-util.ts +46 -0
- package/src/node/channel/channel-manager.ts +44 -0
- package/src/node/channel/channel-middleware.ts +27 -0
- package/src/node/channel/channel-protocol.ts +21 -0
- package/src/node/channel/channel-strategy.ts +56 -0
- package/src/node/channel/index.ts +4 -0
- package/src/node/handler/handler-adapter.ts +38 -0
- package/src/node/handler/handler-protocol.ts +1 -0
- package/src/node/handler/index.ts +2 -0
- package/src/node/index.ts +2 -0
- package/src/node/module.ts +4 -0
- package/src/package.spec.ts +4 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/common/handler/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,uDAAqC;AACrC,qDAAmC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export * from './annotation';
|
|
2
|
+
export * from './channal';
|
|
3
|
+
export * from './endpoint';
|
|
4
|
+
export * from './error';
|
|
5
|
+
export * from './factory';
|
|
6
|
+
export * from './handler';
|
|
7
|
+
export * from './proxy';
|
|
8
|
+
export * from './utils';
|
|
9
|
+
export * from './constants';
|
|
10
|
+
export * from './converter';
|
|
11
|
+
export * from './processor';
|
|
12
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/common/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
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("./annotation"), exports);
|
|
18
|
+
__exportStar(require("./channal"), exports);
|
|
19
|
+
__exportStar(require("./endpoint"), exports);
|
|
20
|
+
__exportStar(require("./error"), exports);
|
|
21
|
+
__exportStar(require("./factory"), exports);
|
|
22
|
+
__exportStar(require("./handler"), exports);
|
|
23
|
+
__exportStar(require("./proxy"), exports);
|
|
24
|
+
__exportStar(require("./utils"), exports);
|
|
25
|
+
__exportStar(require("./constants"), exports);
|
|
26
|
+
__exportStar(require("./converter"), exports);
|
|
27
|
+
__exportStar(require("./processor"), exports);
|
|
28
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/common/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAA6B;AAC7B,4CAA0B;AAC1B,6CAA2B;AAC3B,0CAAwB;AACxB,4CAA0B;AAC1B,4CAA0B;AAC1B,0CAAwB;AACxB,0CAAwB;AACxB,8CAA4B;AAC5B,8CAA4B;AAC5B,8CAA4B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../src/common/module.ts"],"names":[],"mappings":"AAIA,OAAO,SAAS,CAAC;;AAEjB,wBAcG"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const core_1 = require("@celljs/core");
|
|
4
|
+
const proxy_1 = require("./proxy");
|
|
5
|
+
const annotation_1 = require("./annotation");
|
|
6
|
+
const utils_1 = require("./utils");
|
|
7
|
+
require("./index");
|
|
8
|
+
exports.default = (0, core_1.autoBind)(bind => {
|
|
9
|
+
bind(annotation_1.RPC).toDynamicValue(ctx => {
|
|
10
|
+
var _a;
|
|
11
|
+
const id = (_a = ctx.currentRequest.target.getCustomTags()) === null || _a === void 0 ? void 0 : _a.find(m => m.key === annotation_1.ID_KEY).value;
|
|
12
|
+
const path = utils_1.RpcUtil.toPath(id);
|
|
13
|
+
const proxyProvider = ctx.container.get(proxy_1.ProxyProvider);
|
|
14
|
+
const errorConverters = utils_1.ConverterUtil.getGlobalErrorConverters(ctx.container);
|
|
15
|
+
const errorConverter = utils_1.ConverterUtil.getErrorConverters(id, ctx.container);
|
|
16
|
+
if (errorConverter) {
|
|
17
|
+
errorConverters.push(errorConverter);
|
|
18
|
+
}
|
|
19
|
+
return proxyProvider.provide(path, errorConverters);
|
|
20
|
+
});
|
|
21
|
+
});
|
|
22
|
+
//# sourceMappingURL=module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"module.js","sourceRoot":"","sources":["../../src/common/module.ts"],"names":[],"mappings":";;AAAA,uCAAwC;AACxC,mCAAwC;AACxC,6CAA2C;AAC3C,mCAAiD;AACjD,mBAAiB;AAEjB,kBAAe,IAAA,eAAQ,EAAC,IAAI,CAAC,EAAE;IAE3B,IAAI,CAAC,gBAAG,CAAC,CAAC,cAAc,CAAC,GAAG,CAAC,EAAE;;QAC3B,MAAM,EAAE,GAAG,MAAA,GAAG,CAAC,cAAc,CAAC,MAAM,CAAC,aAAa,EAAE,0CAAE,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,KAAK,mBAAM,EAAG,KAAK,CAAC;QACzF,MAAM,IAAI,GAAG,eAAO,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;QAChC,MAAM,aAAa,GAAG,GAAG,CAAC,SAAS,CAAC,GAAG,CAAgB,qBAAa,CAAC,CAAC;QACtE,MAAM,eAAe,GAAG,qBAAa,CAAC,wBAAwB,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;QAC9E,MAAM,cAAc,GAAG,qBAAa,CAAC,kBAAkB,CAAC,EAAE,EAAE,GAAG,CAAC,SAAS,CAAC,CAAC;QAC3E,IAAI,cAAc,EAAE;YAChB,eAAe,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;SACxC;QACD,OAAO,aAAa,CAAC,OAAO,CAAC,IAAI,EAAE,eAAe,CAAC,CAAC;IACxD,CAAC,CAAC,CAAC;AAEP,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ClientConfigProcessor } from './processor-protocol';
|
|
2
|
+
import { AxiosRequestConfig } from 'axios';
|
|
3
|
+
export declare class NoOpClientConfigProcessor implements ClientConfigProcessor {
|
|
4
|
+
process(config: AxiosRequestConfig): Promise<void>;
|
|
5
|
+
}
|
|
6
|
+
//# sourceMappingURL=client-config-processor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client-config-processor.d.ts","sourceRoot":"","sources":["../../../src/common/processor/client-config-processor.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,EAAE,kBAAkB,EAAE,MAAM,OAAO,CAAC;AAE3C,qBACa,yBAA0B,YAAW,qBAAqB;IAE7D,OAAO,CAAC,MAAM,EAAE,kBAAkB,GAAG,OAAO,CAAC,IAAI,CAAC;CAI3D"}
|
|
@@ -0,0 +1,20 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.NoOpClientConfigProcessor = void 0;
|
|
10
|
+
const core_1 = require("@celljs/core");
|
|
11
|
+
const processor_protocol_1 = require("./processor-protocol");
|
|
12
|
+
let NoOpClientConfigProcessor = class NoOpClientConfigProcessor {
|
|
13
|
+
async process(config) {
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
NoOpClientConfigProcessor = __decorate([
|
|
17
|
+
(0, core_1.Component)(processor_protocol_1.ClientConfigProcessor)
|
|
18
|
+
], NoOpClientConfigProcessor);
|
|
19
|
+
exports.NoOpClientConfigProcessor = NoOpClientConfigProcessor;
|
|
20
|
+
//# sourceMappingURL=client-config-processor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client-config-processor.js","sourceRoot":"","sources":["../../../src/common/processor/client-config-processor.ts"],"names":[],"mappings":";;;;;;;;;AAAA,uCAAyC;AACzC,6DAA6D;AAItD,IAAM,yBAAyB,GAA/B,MAAM,yBAAyB;IAElC,KAAK,CAAC,OAAO,CAAC,MAA0B;IAExC,CAAC;CAEJ,CAAA;AANY,yBAAyB;IADrC,IAAA,gBAAS,EAAC,0CAAqB,CAAC;GACpB,yBAAyB,CAMrC;AANY,8DAAyB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/common/processor/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,2BAA2B,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("./processor-protocol"), exports);
|
|
18
|
+
__exportStar(require("./client-config-processor"), exports);
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/common/processor/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,uDAAqC;AACrC,4DAA0C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"processor-protocol.d.ts","sourceRoot":"","sources":["../../../src/common/processor/processor-protocol.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,OAAO,CAAC;AAE3C,eAAO,MAAM,qBAAqB,eAAkC,CAAC;AAErE,MAAM,WAAW,qBAAqB;IAClC,OAAO,CAAC,MAAM,EAAE,kBAAkB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACtD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"processor-protocol.js","sourceRoot":"","sources":["../../../src/common/processor/processor-protocol.ts"],"names":[],"mappings":";;;AAEa,QAAA,qBAAqB,GAAG,MAAM,CAAC,uBAAuB,CAAC,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { RestOperations } from '@celljs/http';
|
|
2
|
+
import { ProxyCreator } from './proxy-protocol';
|
|
3
|
+
import { EndpointResolver } from '../endpoint';
|
|
4
|
+
import { ConnnectionFactory, JsonRpcProxy } from '../factory';
|
|
5
|
+
import { Channel } from '../channal';
|
|
6
|
+
import { ErrorConverter } from '../converter';
|
|
7
|
+
import { AxiosRequestConfig } from 'axios';
|
|
8
|
+
import { ClientConfigProcessor } from '../processor';
|
|
9
|
+
export declare class DelegatingHttpProxyCreator implements ProxyCreator {
|
|
10
|
+
protected connnectionFactory: ConnnectionFactory<Channel>;
|
|
11
|
+
protected endpointResolver: EndpointResolver;
|
|
12
|
+
protected restOperations: RestOperations;
|
|
13
|
+
protected clientConfigProcessor: ClientConfigProcessor;
|
|
14
|
+
protected readonly clientConfig: AxiosRequestConfig;
|
|
15
|
+
protected readonly maxCount: number;
|
|
16
|
+
protected readonly maxLength: number;
|
|
17
|
+
protected readonly timerDelay: number;
|
|
18
|
+
protected readonly enabled: boolean;
|
|
19
|
+
protected delegate: ProxyCreator;
|
|
20
|
+
protected init(): void;
|
|
21
|
+
create<T extends object>(path: string, errorConverters?: ErrorConverter[], target?: object | undefined): JsonRpcProxy<T>;
|
|
22
|
+
support(path: string): number;
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=delegating-http-proxy-creator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delegating-http-proxy-creator.d.ts","sourceRoot":"","sources":["../../../src/common/proxy/delegating-http-proxy-creator.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC9D,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAGrD,qBACa,0BAA2B,YAAW,YAAY;IAG3D,SAAS,CAAC,kBAAkB,EAAE,kBAAkB,CAAC,OAAO,CAAC,CAAC;IAG1D,SAAS,CAAC,gBAAgB,EAAE,gBAAgB,CAAC;IAG7C,SAAS,CAAC,cAAc,EAAE,cAAc,CAAC;IAGzC,SAAS,CAAC,qBAAqB,EAAE,qBAAqB,CAAC;IAGvD,SAAS,CAAC,QAAQ,CAAC,YAAY,EAAE,kBAAkB,CAAC;IAGpD,SAAS,CAAC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAGpC,SAAS,CAAC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAGrC,SAAS,CAAC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAGtC,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAEpC,SAAS,CAAC,QAAQ,EAAE,YAAY,CAAC;IAGjC,SAAS,CAAC,IAAI;IAgBd,MAAM,CAAC,CAAC,SAAS,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,eAAe,CAAC,EAAE,cAAc,EAAE,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,YAAY,CAAC,CAAC,CAAC;IAIxH,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;CAGhC"}
|
|
@@ -0,0 +1,89 @@
|
|
|
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.DelegatingHttpProxyCreator = void 0;
|
|
13
|
+
const core_1 = require("@celljs/core");
|
|
14
|
+
const http_1 = require("@celljs/http");
|
|
15
|
+
const proxy_protocol_1 = require("./proxy-protocol");
|
|
16
|
+
const endpoint_1 = require("../endpoint");
|
|
17
|
+
const factory_1 = require("../factory");
|
|
18
|
+
const processor_1 = require("../processor");
|
|
19
|
+
const http_proxy_creator_1 = require("./http-proxy-creator");
|
|
20
|
+
let DelegatingHttpProxyCreator = class DelegatingHttpProxyCreator {
|
|
21
|
+
init() {
|
|
22
|
+
this.delegate = new http_proxy_creator_1.HttpProxyCreator({
|
|
23
|
+
connnectionFactory: this.connnectionFactory,
|
|
24
|
+
endpointResolver: this.endpointResolver,
|
|
25
|
+
restOperations: this.restOperations,
|
|
26
|
+
clientConfigProcessor: this.clientConfigProcessor,
|
|
27
|
+
clientConfig: this.clientConfig,
|
|
28
|
+
merge: {
|
|
29
|
+
maxCount: this.maxCount,
|
|
30
|
+
maxLength: this.maxLength,
|
|
31
|
+
timerDelay: this.timerDelay,
|
|
32
|
+
enabled: this.enabled
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
create(path, errorConverters, target) {
|
|
37
|
+
return this.delegate.create(path, errorConverters, target);
|
|
38
|
+
}
|
|
39
|
+
support(path) {
|
|
40
|
+
return this.delegate.support(path);
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
__decorate([
|
|
44
|
+
(0, core_1.Autowired)(factory_1.ConnnectionFactory),
|
|
45
|
+
__metadata("design:type", Object)
|
|
46
|
+
], DelegatingHttpProxyCreator.prototype, "connnectionFactory", void 0);
|
|
47
|
+
__decorate([
|
|
48
|
+
(0, core_1.Autowired)(endpoint_1.EndpointResolver),
|
|
49
|
+
__metadata("design:type", Object)
|
|
50
|
+
], DelegatingHttpProxyCreator.prototype, "endpointResolver", void 0);
|
|
51
|
+
__decorate([
|
|
52
|
+
(0, core_1.Autowired)(http_1.RestOperations),
|
|
53
|
+
__metadata("design:type", Function)
|
|
54
|
+
], DelegatingHttpProxyCreator.prototype, "restOperations", void 0);
|
|
55
|
+
__decorate([
|
|
56
|
+
(0, core_1.Autowired)(processor_1.ClientConfigProcessor),
|
|
57
|
+
__metadata("design:type", Object)
|
|
58
|
+
], DelegatingHttpProxyCreator.prototype, "clientConfigProcessor", void 0);
|
|
59
|
+
__decorate([
|
|
60
|
+
(0, core_1.Value)('cell.rpc.client.config'),
|
|
61
|
+
__metadata("design:type", Object)
|
|
62
|
+
], DelegatingHttpProxyCreator.prototype, "clientConfig", void 0);
|
|
63
|
+
__decorate([
|
|
64
|
+
(0, core_1.Value)('cell.rpc.merge.maxCount'),
|
|
65
|
+
__metadata("design:type", Number)
|
|
66
|
+
], DelegatingHttpProxyCreator.prototype, "maxCount", void 0);
|
|
67
|
+
__decorate([
|
|
68
|
+
(0, core_1.Value)('cell.rpc.merge.maxLength'),
|
|
69
|
+
__metadata("design:type", Number)
|
|
70
|
+
], DelegatingHttpProxyCreator.prototype, "maxLength", void 0);
|
|
71
|
+
__decorate([
|
|
72
|
+
(0, core_1.Value)('cell.rpc.merge.timerDelay'),
|
|
73
|
+
__metadata("design:type", Number)
|
|
74
|
+
], DelegatingHttpProxyCreator.prototype, "timerDelay", void 0);
|
|
75
|
+
__decorate([
|
|
76
|
+
(0, core_1.Value)('cell.rpc.merge.enabled'),
|
|
77
|
+
__metadata("design:type", Boolean)
|
|
78
|
+
], DelegatingHttpProxyCreator.prototype, "enabled", void 0);
|
|
79
|
+
__decorate([
|
|
80
|
+
(0, core_1.PostConstruct)(),
|
|
81
|
+
__metadata("design:type", Function),
|
|
82
|
+
__metadata("design:paramtypes", []),
|
|
83
|
+
__metadata("design:returntype", void 0)
|
|
84
|
+
], DelegatingHttpProxyCreator.prototype, "init", null);
|
|
85
|
+
DelegatingHttpProxyCreator = __decorate([
|
|
86
|
+
(0, core_1.Component)(proxy_protocol_1.ProxyCreator)
|
|
87
|
+
], DelegatingHttpProxyCreator);
|
|
88
|
+
exports.DelegatingHttpProxyCreator = DelegatingHttpProxyCreator;
|
|
89
|
+
//# sourceMappingURL=delegating-http-proxy-creator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delegating-http-proxy-creator.js","sourceRoot":"","sources":["../../../src/common/proxy/delegating-http-proxy-creator.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,uCAA0E;AAC1E,uCAA8C;AAC9C,qDAAgD;AAChD,0CAA+C;AAC/C,wCAA8D;AAI9D,4CAAqD;AACrD,6DAAwD;AAGjD,IAAM,0BAA0B,GAAhC,MAAM,0BAA0B;IAgCzB,IAAI;QACV,IAAI,CAAC,QAAQ,GAAG,IAAI,qCAAgB,CAAC;YACjC,kBAAkB,EAAE,IAAI,CAAC,kBAAkB;YAC3C,gBAAgB,EAAE,IAAI,CAAC,gBAAgB;YACvC,cAAc,EAAE,IAAI,CAAC,cAAc;YACnC,qBAAqB,EAAE,IAAI,CAAC,qBAAqB;YACjD,YAAY,EAAE,IAAI,CAAC,YAAY;YAC/B,KAAK,EAAE;gBACH,QAAQ,EAAE,IAAI,CAAC,QAAQ;gBACvB,SAAS,EAAE,IAAI,CAAC,SAAS;gBACzB,UAAU,EAAE,IAAI,CAAC,UAAU;gBAC3B,OAAO,EAAE,IAAI,CAAC,OAAO;aACxB;SACJ,CAAC,CAAC;IACP,CAAC;IAED,MAAM,CAAmB,IAAY,EAAE,eAAkC,EAAE,MAA2B;QAClG,OAAO,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,EAAE,eAAe,EAAE,MAAM,CAAC,CAAC;IAC/D,CAAC;IAED,OAAO,CAAC,IAAY;QAChB,OAAO,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IACvC,CAAC;CACJ,CAAA;AArDG;IAAC,IAAA,gBAAS,EAAC,4BAAkB,CAAC;;sEAC4B;AAE1D;IAAC,IAAA,gBAAS,EAAC,2BAAgB,CAAC;;oEACiB;AAE7C;IAAC,IAAA,gBAAS,EAAC,qBAAc,CAAC;;kEACe;AAEzC;IAAC,IAAA,gBAAS,EAAC,iCAAqB,CAAC;;yEACsB;AAEvD;IAAC,IAAA,YAAK,EAAC,wBAAwB,CAAC;;gEACoB;AAEpD;IAAC,IAAA,YAAK,EAAC,yBAAyB,CAAC;;4DACG;AAEpC;IAAC,IAAA,YAAK,EAAC,0BAA0B,CAAC;;6DACG;AAErC;IAAC,IAAA,YAAK,EAAC,2BAA2B,CAAC;;8DACG;AAEtC;IAAC,IAAA,YAAK,EAAC,wBAAwB,CAAC;;2DACI;AAIpC;IAAC,IAAA,oBAAa,GAAE;;;;sDAef;AA9CQ,0BAA0B;IADtC,IAAA,gBAAS,EAAC,6BAAY,CAAC;GACX,0BAA0B,CAuDtC;AAvDY,gEAA0B"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { RestOperations } from '@celljs/http';
|
|
2
|
+
import { Logger } from 'vscode-jsonrpc';
|
|
3
|
+
import { ProxyCreator, ConnectionOptions, RequestTaskMeta } from './proxy-protocol';
|
|
4
|
+
import { EndpointResolver } from '../endpoint';
|
|
5
|
+
import { ConnnectionFactory, JsonRpcProxy } from '../factory';
|
|
6
|
+
import { Channel } from '../channal';
|
|
7
|
+
import { ErrorConverter } from '../converter';
|
|
8
|
+
import { ConnectionHandler } from '../handler';
|
|
9
|
+
import { AxiosRequestConfig } from 'axios';
|
|
10
|
+
import { ClientConfigProcessor } from '../processor';
|
|
11
|
+
export interface MergeOptions {
|
|
12
|
+
maxCount: number;
|
|
13
|
+
maxLength: number;
|
|
14
|
+
timerDelay: number;
|
|
15
|
+
enabled: boolean;
|
|
16
|
+
}
|
|
17
|
+
export interface HttpProxyCreatorOptions<T> {
|
|
18
|
+
connnectionFactory: ConnnectionFactory<Channel>;
|
|
19
|
+
endpointResolver: EndpointResolver;
|
|
20
|
+
restOperations: RestOperations;
|
|
21
|
+
clientConfigProcessor?: ClientConfigProcessor;
|
|
22
|
+
clientConfig: AxiosRequestConfig;
|
|
23
|
+
merge: T;
|
|
24
|
+
}
|
|
25
|
+
export declare class HttpProxyCreator implements ProxyCreator {
|
|
26
|
+
protected channelIdSeq: number;
|
|
27
|
+
protected requestMap: Map<string, RequestTaskMeta>;
|
|
28
|
+
protected channelMap: Map<number, Channel>;
|
|
29
|
+
protected options: HttpProxyCreatorOptions<MergeOptions>;
|
|
30
|
+
constructor(options: Partial<Omit<HttpProxyCreatorOptions<Partial<MergeOptions>>, 'endpointResolver'>> & Pick<HttpProxyCreatorOptions<Partial<MergeOptions>>, 'endpointResolver'>);
|
|
31
|
+
create<T extends object>(path: string, errorConverters?: ErrorConverter[], target?: object | undefined): JsonRpcProxy<T>;
|
|
32
|
+
support(path: string): number;
|
|
33
|
+
listen(handler: ConnectionHandler, options?: ConnectionOptions): void;
|
|
34
|
+
openChannel(path: string, handler: (channel: Channel) => void, options?: ConnectionOptions): void;
|
|
35
|
+
protected doOpenChannel(path: string, handler: (channel: Channel) => void, options?: ConnectionOptions): void;
|
|
36
|
+
protected createChannel(id: number, path: string): Channel;
|
|
37
|
+
protected executeTask(endpoint: string): Promise<void> | undefined;
|
|
38
|
+
protected canMerge(endpoint: string, content: string): boolean;
|
|
39
|
+
protected pushContent(endpoint: string, content: string): RequestTaskMeta;
|
|
40
|
+
protected createTask(endpoint: string): () => Promise<void>;
|
|
41
|
+
protected createLogger(): Logger;
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=http-proxy-creator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"http-proxy-creator.d.ts","sourceRoot":"","sources":["../../../src/common/proxy/http-proxy-creator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwD,cAAc,EAAgC,MAAM,cAAc,CAAC;AAClI,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACpF,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,kBAAkB,EAA0B,YAAY,EAAuB,MAAM,YAAY,CAAC;AAC3G,OAAO,EAAE,OAAO,EAAe,MAAM,YAAY,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,EAAE,kBAAkB,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAGrD,MAAM,WAAW,YAAY;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,OAAO,CAAC;CACxB;AAED,MAAM,WAAW,uBAAuB,CAAC,CAAC;IAEtC,kBAAkB,EAAE,kBAAkB,CAAC,OAAO,CAAC,CAAC;IAChD,gBAAgB,EAAE,gBAAgB,CAAC;IACnC,cAAc,EAAE,cAAc,CAAC;IAC/B,qBAAqB,CAAC,EAAE,qBAAqB,CAAC;IAC9C,YAAY,EAAE,kBAAkB,CAAC;IACjC,KAAK,EAAE,CAAC,CAAC;CACZ;AAeD,qBAAa,gBAAiB,YAAW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E,MAAM;IAiBvD,SAAS,CAAC,UAAU,CAAC,QAAQ,EAAE,MAAM;IAgCrC,SAAS,CAAC,YAAY,IAAI,MAAM;CAInC"}
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.HttpProxyCreator = void 0;
|
|
4
|
+
const http_1 = require("@celljs/http");
|
|
5
|
+
const factory_1 = require("../factory");
|
|
6
|
+
const channal_1 = require("../channal");
|
|
7
|
+
const utils_1 = require("../utils");
|
|
8
|
+
const DEFAULT_OPTIONS = {
|
|
9
|
+
connnectionFactory: new factory_1.ConnnectionFactoryImpl(),
|
|
10
|
+
restOperations: new http_1.DefaultRestOperationsFactory().create(),
|
|
11
|
+
clientConfig: {},
|
|
12
|
+
merge: {
|
|
13
|
+
maxCount: 100,
|
|
14
|
+
maxLength: 5242880,
|
|
15
|
+
timerDelay: 35,
|
|
16
|
+
enabled: false
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
class HttpProxyCreator {
|
|
20
|
+
constructor(options) {
|
|
21
|
+
this.channelIdSeq = 0;
|
|
22
|
+
this.requestMap = new Map();
|
|
23
|
+
this.channelMap = new Map();
|
|
24
|
+
this.options = Object.assign(Object.assign(Object.assign({}, DEFAULT_OPTIONS), options), { merge: Object.assign(Object.assign({}, DEFAULT_OPTIONS.merge), options.merge) });
|
|
25
|
+
}
|
|
26
|
+
create(path, errorConverters, target) {
|
|
27
|
+
const factory = new factory_1.JsonRpcProxyFactory(target, errorConverters);
|
|
28
|
+
this.options.endpointResolver.resolve(path).then(endpoint => this.listen({
|
|
29
|
+
path: endpoint,
|
|
30
|
+
onConnection: c => factory.listen(c)
|
|
31
|
+
}));
|
|
32
|
+
return factory.createProxy();
|
|
33
|
+
}
|
|
34
|
+
support(path) {
|
|
35
|
+
return 500;
|
|
36
|
+
}
|
|
37
|
+
listen(handler, options) {
|
|
38
|
+
this.openChannel(handler.path, channel => {
|
|
39
|
+
const connection = this.options.connnectionFactory.create(channel, this.createLogger());
|
|
40
|
+
handler.onConnection(connection);
|
|
41
|
+
}, options);
|
|
42
|
+
}
|
|
43
|
+
openChannel(path, handler, options) {
|
|
44
|
+
this.doOpenChannel(path, handler, options);
|
|
45
|
+
}
|
|
46
|
+
doOpenChannel(path, handler, options) {
|
|
47
|
+
const id = this.channelIdSeq++;
|
|
48
|
+
const channel = this.createChannel(id, path);
|
|
49
|
+
handler(channel);
|
|
50
|
+
}
|
|
51
|
+
createChannel(id, path) {
|
|
52
|
+
const parts = path.split('/');
|
|
53
|
+
const serviceName = parts.pop();
|
|
54
|
+
const endpoint = parts.join('/');
|
|
55
|
+
const channel = new channal_1.HttpChannel(id, async (content) => {
|
|
56
|
+
if (this.options.merge.enabled) {
|
|
57
|
+
if (this.canMerge(endpoint, content)) {
|
|
58
|
+
this.pushContent(endpoint, content);
|
|
59
|
+
}
|
|
60
|
+
else {
|
|
61
|
+
this.executeTask(endpoint);
|
|
62
|
+
this.pushContent(endpoint, content);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
else {
|
|
66
|
+
this.pushContent(endpoint, content);
|
|
67
|
+
this.executeTask(endpoint);
|
|
68
|
+
}
|
|
69
|
+
}, serviceName);
|
|
70
|
+
this.channelMap.set(id, channel);
|
|
71
|
+
return channel;
|
|
72
|
+
}
|
|
73
|
+
executeTask(endpoint) {
|
|
74
|
+
const meta = this.requestMap.get(endpoint);
|
|
75
|
+
if (meta) {
|
|
76
|
+
return meta.task();
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
canMerge(endpoint, content) {
|
|
80
|
+
const meta = this.requestMap.get(endpoint);
|
|
81
|
+
if (meta) {
|
|
82
|
+
if (meta.contentLength + content.length > this.options.merge.maxLength ||
|
|
83
|
+
meta.contents.length + 1 > this.options.merge.maxCount) {
|
|
84
|
+
return false;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
return true;
|
|
88
|
+
}
|
|
89
|
+
pushContent(endpoint, content) {
|
|
90
|
+
let meta = this.requestMap.get(endpoint);
|
|
91
|
+
if (!meta) {
|
|
92
|
+
const task = this.createTask(endpoint);
|
|
93
|
+
meta = {
|
|
94
|
+
id: setTimeout(task, this.options.merge.timerDelay),
|
|
95
|
+
contents: [],
|
|
96
|
+
contentLength: 0,
|
|
97
|
+
task
|
|
98
|
+
};
|
|
99
|
+
this.requestMap.set(endpoint, meta);
|
|
100
|
+
}
|
|
101
|
+
meta.contents.push(content);
|
|
102
|
+
meta.contentLength += content.length;
|
|
103
|
+
return meta;
|
|
104
|
+
}
|
|
105
|
+
createTask(endpoint) {
|
|
106
|
+
return async () => {
|
|
107
|
+
var _a;
|
|
108
|
+
const meta = this.requestMap.get(endpoint);
|
|
109
|
+
if (!meta) {
|
|
110
|
+
return;
|
|
111
|
+
}
|
|
112
|
+
clearTimeout(meta.id);
|
|
113
|
+
const contents = meta.contents;
|
|
114
|
+
this.requestMap.delete(endpoint);
|
|
115
|
+
const config = Object.assign({ url: endpoint, method: http_1.HttpMethod.POST, data: contents.length > 1 ? JSON.stringify(contents) : contents[0], headers: {
|
|
116
|
+
[http_1.HttpHeaders.CONTENT_TYPE]: http_1.MediaType.APPLICATION_JSON_UTF8,
|
|
117
|
+
[http_1.HttpHeaders.X_REQUESTED_WITH]: http_1.XML_HTTP_REQUEST
|
|
118
|
+
} }, this.options.clientConfig);
|
|
119
|
+
await ((_a = this.options.clientConfigProcessor) === null || _a === void 0 ? void 0 : _a.process(config));
|
|
120
|
+
const { data } = await this.options.restOperations.request(config);
|
|
121
|
+
if (Array.isArray(data)) {
|
|
122
|
+
for (const message of data) {
|
|
123
|
+
const parsed = JSON.parse(message);
|
|
124
|
+
this.channelMap.get(parsed.id).handleMessage(parsed);
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
else {
|
|
128
|
+
this.channelMap.get(data.id).handleMessage(data);
|
|
129
|
+
}
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
createLogger() {
|
|
133
|
+
return new utils_1.ConsoleLogger();
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
exports.HttpProxyCreator = HttpProxyCreator;
|
|
137
|
+
//# sourceMappingURL=http-proxy-creator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"http-proxy-creator.js","sourceRoot":"","sources":["../../../src/common/proxy/http-proxy-creator.ts"],"names":[],"mappings":";;;AAAA,uCAAkI;AAIlI,wCAA2G;AAC3G,wCAAkD;AAKlD,oCAAyC;AAmBzC,MAAM,eAAe,GAAoE;IACrF,kBAAkB,EAAE,IAAI,gCAAsB,EAAE;IAChD,cAAc,EAAE,IAAI,mCAA4B,EAAE,CAAC,MAAM,EAAE;IAC3D,YAAY,EAAE,EAAE;IAChB,KAAK,EAAE;QACH,QAAQ,EAAE,GAAG;QACb,SAAS,EAAE,OAAO;QAClB,UAAU,EAAE,EAAE;QACd,OAAO,EAAE,KAAK;KACjB;CAEJ,CAAC;AAEF,MAAa,gBAAgB;IAQzB,YACI,OAAqK;QAP/J,iBAAY,GAAG,CAAC,CAAC;QAEjB,eAAU,GAAG,IAAI,GAAG,EAA2B,CAAC;QAChD,eAAU,GAAG,IAAI,GAAG,EAAmB,CAAC;QAK9C,IAAI,CAAC,OAAO,iDAAQ,eAAe,GAAK,OAAO,KAAE,KAAK,kCAAO,eAAe,CAAC,KAAK,GAAK,OAAO,CAAC,KAAK,IAAI,CAAC;IAC7G,CAAC;IAED,MAAM,CAAmB,IAAY,EAAE,eAAkC,EAAE,MAA2B;QAClG,MAAM,OAAO,GAAG,IAAI,6BAAmB,CAAI,MAAM,EAAE,eAAe,CAAC,CAAC;QACpE,IAAI,CAAC,OAAO,CAAC,gBAAgB,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC;YACrE,IAAI,EAAE,QAAQ;YACd,YAAY,EAAE,CAAC,CAAC,E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kBAAW,CAAC,gBAAgB,CAAC,EAAE,uBAAgB;iBACnD,IACE,IAAI,CAAC,OAAO,CAAC,YAAY,CAC/B,CAAC;YACF,MAAM,CAAA,MAAA,IAAI,CAAC,OAAO,CAAC,qBAAqB,0CAAE,OAAO,CAAC,MAAM,CAAC,CAAA,CAAC;YAC1D,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;YACnE,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;gBACrB,KAAK,MAAM,OAAO,IAAI,IAAI,EAAE;oBACxB,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;oBACnC,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAE,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC;iBACzD;aACJ;iBAAM;gBACH,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAE,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;aACrD;QACL,CAAC,CAAC;IACN,CAAC;IAES,YAAY;QAClB,OAAO,IAAI,qBAAa,EAAE,CAAC;IAC/B,CAAC;CAEJ;AAxID,4CAwIC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/common/proxy/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,sBAAsB,CAAC;AACrC,cAAc,iCAAiC,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
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("./proxy-provider"), exports);
|
|
18
|
+
__exportStar(require("./proxy-protocol"), exports);
|
|
19
|
+
__exportStar(require("./http-proxy-creator"), exports);
|
|
20
|
+
__exportStar(require("./delegating-http-proxy-creator"), exports);
|
|
21
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/common/proxy/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,mDAAiC;AACjC,mDAAiC;AACjC,uDAAqC;AACrC,kEAAgD"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { ErrorConverter } from '../converter';
|
|
3
|
+
import { JsonRpcProxy } from '../factory';
|
|
4
|
+
export declare const ProxyProvider: unique symbol;
|
|
5
|
+
export interface ProxyProvider {
|
|
6
|
+
provide<T extends object>(path: string, errorConverters?: ErrorConverter[], target?: object): JsonRpcProxy<T>;
|
|
7
|
+
}
|
|
8
|
+
export declare const ProxyCreator: unique symbol;
|
|
9
|
+
export interface ProxyCreator {
|
|
10
|
+
create<T extends object>(path: string, errorConverters?: ErrorConverter[], target?: object): JsonRpcProxy<T>;
|
|
11
|
+
support(path: string): number;
|
|
12
|
+
}
|
|
13
|
+
export interface ConnectionOptions {
|
|
14
|
+
reconnecting?: boolean;
|
|
15
|
+
}
|
|
16
|
+
export interface RequestTaskMeta {
|
|
17
|
+
id: number | NodeJS.Timeout;
|
|
18
|
+
contentLength: number;
|
|
19
|
+
contents: string[];
|
|
20
|
+
task: () => Promise<void>;
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=proxy-protocol.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"proxy-protocol.d.ts","sourceRoot":"","sources":["../../../src/common/proxy/proxy-protocol.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE1C,eAAO,MAAM,aAAa,eAA0B,CAAC;AAErD,MAAM,WAAW,aAAa;IAC1B,OAAO,CAAC,CAAC,SAAS,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,eAAe,CAAC,EAAE,cAAc,EAAE,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,YAAY,CAAC,CAAC,CAAC,CAAC;CACjH;AAED,eAAO,MAAM,YAAY,eAAyB,CAAC;AAEnD,MAAM,WAAW,YAAY;IACzB,MAAM,CAAC,CAAC,SAAS,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,eAAe,CAAC,EAAE,cAAc,EAAE,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,YAAY,CAAC,CAAC,CAAC,CAAC;IAC7G,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAA;CAChC;AAED,MAAM,WAAW,iBAAiB;IAC9B,YAAY,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED,MAAM,WAAW,eAAe;IAC5B,EAAE,EAAE,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC;IAC5B,aAAa,EAAE,MAAM,CAAC;IACtB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,IAAI,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAC7B"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ProxyCreator = exports.ProxyProvider = void 0;
|
|
4
|
+
exports.ProxyProvider = Symbol('ProxyProvider');
|
|
5
|
+
exports.ProxyCreator = Symbol('ProxyCreator');
|
|
6
|
+
//# sourceMappingURL=proxy-protocol.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"proxy-protocol.js","sourceRoot":"","sources":["../../../src/common/proxy/proxy-protocol.ts"],"names":[],"mappings":";;;AAGa,QAAA,aAAa,GAAG,MAAM,CAAC,eAAe,CAAC,CAAC;AAMxC,QAAA,YAAY,GAAG,MAAM,CAAC,cAAc,CAAC,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ErrorConverter } from '../converter';
|
|
2
|
+
import { JsonRpcProxy } from '../factory';
|
|
3
|
+
import { ProxyProvider, ProxyCreator } from './proxy-protocol';
|
|
4
|
+
export declare class ProxyProviderImpl implements ProxyProvider {
|
|
5
|
+
protected readonly proxyCreators: ProxyCreator[];
|
|
6
|
+
constructor(proxyCreators: ProxyCreator[]);
|
|
7
|
+
provide<T extends object>(path: string, errorConverters?: ErrorConverter[], target?: object): JsonRpcProxy<T>;
|
|
8
|
+
protected prioritize(path: string): ProxyCreator[];
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=proxy-provider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"proxy-provider.d.ts","sourceRoot":"","sources":["../../../src/common/proxy/proxy-provider.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAE/D,qBACa,iBAAkB,YAAW,aAAa;IAI/C,SAAS,CAAC,QAAQ,CAAC,aAAa,EAAE,YAAY,EAAE;gBAA7B,aAAa,EAAE,YAAY,EAAE;IAGpD,OAAO,CAAC,CAAC,SAAS,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,eAAe,CAAC,EAAE,cAAc,EAAE,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,YAAY,CAAC,CAAC,CAAC;IAI7G,SAAS,CAAC,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,YAAY,EAAE;CAWrD"}
|