@biorate/connector 0.20.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/CHANGELOG.md +17 -0
- package/LICENSE +22 -0
- package/README.md +59 -0
- package/dist/index.js +14 -0
- package/dist/index.js.map +1 -0
- package/dist/src/errors.js +11 -0
- package/dist/src/errors.js.map +1 -0
- package/dist/src/index.js +66 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/interfaces.js +3 -0
- package/dist/src/interfaces.js.map +1 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -0
- package/index.d.ts +12 -0
- package/index.ts +1 -0
- package/package.json +29 -0
- package/src/errors.ts +7 -0
- package/src/index.ts +105 -0
- package/src/interfaces.ts +5 -0
- package/tests/__mocks__/index.ts +31 -0
- package/tests/index.spec.ts +19 -0
- package/tsconfig.build.json +5 -0
- package/tsconfig.json +6 -0
package/CHANGELOG.md
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
# Change Log
|
2
|
+
|
3
|
+
All notable changes to this project will be documented in this file.
|
4
|
+
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
5
|
+
|
6
|
+
# [0.20.0](https://github.com/biorate/core/compare/v0.19.1...v0.20.0) (2022-04-08)
|
7
|
+
|
8
|
+
|
9
|
+
### Bug Fixes
|
10
|
+
|
11
|
+
* **connector:** index.d.ts added ([c069419](https://github.com/biorate/core/commit/c0694193ef191b071f1f331a217946d92d83d265))
|
12
|
+
|
13
|
+
|
14
|
+
### Features
|
15
|
+
|
16
|
+
* **connector:** interface draft ([7823de3](https://github.com/biorate/core/commit/7823de359381edd7503152c522f99ae3666812f8))
|
17
|
+
* **connector:** module added ([375d472](https://github.com/biorate/core/commit/375d472d6ad4933e8b5baec640ba6c5439b06d7e))
|
package/LICENSE
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2021-present Leonid Levkin (llevkin)
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
package/README.md
ADDED
@@ -0,0 +1,59 @@
|
|
1
|
+
# Connector
|
2
|
+
|
3
|
+
Connector interface
|
4
|
+
|
5
|
+
### Examples:
|
6
|
+
|
7
|
+
```ts
|
8
|
+
import { Connector, IConnector } from '../..';
|
9
|
+
import { inject, container, Types, Core } from '@biorate/inversion';
|
10
|
+
import { IConfig, Config } from '@biorate/config';
|
11
|
+
|
12
|
+
export class Connection {
|
13
|
+
public name: string;
|
14
|
+
|
15
|
+
public constructor(name: string) {
|
16
|
+
this.name = name;
|
17
|
+
}
|
18
|
+
}
|
19
|
+
|
20
|
+
export class TestConnector extends Connector<{ name: string }, Connection> {
|
21
|
+
protected namespace = 'TestConnector';
|
22
|
+
|
23
|
+
protected async connect(config) {
|
24
|
+
return new Connection(config.name);
|
25
|
+
}
|
26
|
+
}
|
27
|
+
|
28
|
+
export class Root extends Core() {
|
29
|
+
@inject(TestConnector) public connector: IConnector<{ name: string }, Connection>;
|
30
|
+
}
|
31
|
+
|
32
|
+
container.bind(Types.Config).to(Config).inSingletonScope();
|
33
|
+
container.bind(TestConnector).toSelf().inSingletonScope();
|
34
|
+
container.bind(Root).toSelf().inSingletonScope();
|
35
|
+
|
36
|
+
container.get<IConfig>(Types.Config).merge({
|
37
|
+
TestConnector: [{ name: 'test-connection' }],
|
38
|
+
});
|
39
|
+
|
40
|
+
(async () => {
|
41
|
+
const root = container.get<Root>(Root);
|
42
|
+
await root.$run();
|
43
|
+
console.log(root.connector.connection('test-connection')); // Connection { name: 'test-connection' }
|
44
|
+
})();
|
45
|
+
```
|
46
|
+
|
47
|
+
### Learn
|
48
|
+
|
49
|
+
- Documentation can be found here - [docs](https://biorate.github.io/core/modules/connector.html).
|
50
|
+
|
51
|
+
### Release History
|
52
|
+
|
53
|
+
See the [CHANGELOG](https://github.com/biorate/core/blob/master/packages/%40biorate/connector/CHANGELOG.md)
|
54
|
+
|
55
|
+
### License
|
56
|
+
|
57
|
+
[MIT](https://github.com/biorate/core/blob/master/packages/%40biorate/connector/LICENSE)
|
58
|
+
|
59
|
+
Copyright (c) 2021-present [Leonid Levkin (llevkin)](mailto:llevkin@yandex.ru)
|
package/dist/index.js
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
3
|
+
if (k2 === undefined) k2 = k;
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
5
|
+
}) : (function(o, m, k, k2) {
|
6
|
+
if (k2 === undefined) k2 = k;
|
7
|
+
o[k2] = m[k];
|
8
|
+
}));
|
9
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
10
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
11
|
+
};
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
13
|
+
__exportStar(require("./src"), exports);
|
14
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,wCAAsB"}
|
@@ -0,0 +1,11 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.ConnectorConnectionNotExistsError = void 0;
|
4
|
+
const errors_1 = require("@biorate/errors");
|
5
|
+
class ConnectorConnectionNotExistsError extends errors_1.BaseError {
|
6
|
+
constructor(type, name) {
|
7
|
+
super(`Connection not exists: [%s]:[%s]`, [type, name]);
|
8
|
+
}
|
9
|
+
}
|
10
|
+
exports.ConnectorConnectionNotExistsError = ConnectorConnectionNotExistsError;
|
11
|
+
//# sourceMappingURL=errors.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/errors.ts"],"names":[],"mappings":";;;AAAA,4CAA4C;AAE5C,MAAa,iCAAkC,SAAQ,kBAAS;IAC9D,YAAmB,IAAY,EAAE,IAAY;QAC3C,KAAK,CAAC,kCAAkC,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC;IAC1D,CAAC;CACF;AAJD,8EAIC"}
|
@@ -0,0 +1,66 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
3
|
+
if (k2 === undefined) k2 = k;
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
5
|
+
}) : (function(o, m, k, k2) {
|
6
|
+
if (k2 === undefined) k2 = k;
|
7
|
+
o[k2] = m[k];
|
8
|
+
}));
|
9
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
10
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
11
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
12
|
+
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;
|
13
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
14
|
+
};
|
15
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
16
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
17
|
+
};
|
18
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
19
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
20
|
+
};
|
21
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
22
|
+
exports.Connector = void 0;
|
23
|
+
const inversion_1 = require("@biorate/inversion");
|
24
|
+
const errors_1 = require("./errors");
|
25
|
+
__exportStar(require("./errors"), exports);
|
26
|
+
__exportStar(require("./interfaces"), exports);
|
27
|
+
let Connector = class Connector {
|
28
|
+
constructor() {
|
29
|
+
this.connections = new Map();
|
30
|
+
this.current = null;
|
31
|
+
}
|
32
|
+
use(name) {
|
33
|
+
if (!this.connections.has(name))
|
34
|
+
throw new errors_1.ConnectorConnectionNotExistsError(this.constructor.name, name);
|
35
|
+
this.current = this.connections.get(name);
|
36
|
+
}
|
37
|
+
connection(name) {
|
38
|
+
if (!name)
|
39
|
+
return this.current;
|
40
|
+
if (!this.connections.has(name))
|
41
|
+
throw new errors_1.ConnectorConnectionNotExistsError(this.constructor.name, name);
|
42
|
+
return this.connections.get(name);
|
43
|
+
}
|
44
|
+
async initialize() {
|
45
|
+
for (const config of this.config.get(this.namespace, [])) {
|
46
|
+
this.connections.set(config.name, await this.connect(config));
|
47
|
+
if (!this.current)
|
48
|
+
this.current = this.connections.get(config.name);
|
49
|
+
}
|
50
|
+
}
|
51
|
+
};
|
52
|
+
__decorate([
|
53
|
+
(0, inversion_1.inject)(inversion_1.Types.Config),
|
54
|
+
__metadata("design:type", Object)
|
55
|
+
], Connector.prototype, "config", void 0);
|
56
|
+
__decorate([
|
57
|
+
(0, inversion_1.init)(),
|
58
|
+
__metadata("design:type", Function),
|
59
|
+
__metadata("design:paramtypes", []),
|
60
|
+
__metadata("design:returntype", Promise)
|
61
|
+
], Connector.prototype, "initialize", null);
|
62
|
+
Connector = __decorate([
|
63
|
+
(0, inversion_1.injectable)()
|
64
|
+
], Connector);
|
65
|
+
exports.Connector = Connector;
|
66
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,kDAAqE;AAGrE,qCAA6D;AAC7D,2CAAyB;AACzB,+CAA6B;AAkD7B,IAAsB,SAAS,GAA/B,MAAsB,SAAS;IAA/B;QAckB,gBAAW,GAAG,IAAI,GAAG,EAAa,CAAC;QAI5C,YAAO,GAAM,IAAI,CAAC;IA+B3B,CAAC;IAvBQ,GAAG,CAAC,IAAY;QACrB,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC;YAC7B,MAAM,IAAI,0CAAiC,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QAC3E,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IAC5C,CAAC;IAIM,UAAU,CAAC,IAAa;QAC7B,IAAI,CAAC,IAAI;YAAE,OAAO,IAAI,CAAC,OAAO,CAAC;QAC/B,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC;YAC7B,MAAM,IAAI,0CAAiC,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QAC3E,OAAO,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IACpC,CAAC;IAIiB,KAAK,CAAC,UAAU;QAChC,KAAK,MAAM,MAAM,IAAI,IAAI,CAAC,MAAM,CAAC,GAAG,CAAM,IAAI,CAAC,SAAS,EAAE,EAAE,CAAC,EAAE;YAC7D,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC;YAC9D,IAAI,CAAC,IAAI,CAAC,OAAO;gBAAE,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;SACrE;IACH,CAAC;CACF,CAAA;AA3CuB;IAArB,IAAA,kBAAM,EAAC,iBAAK,CAAC,MAAM,CAAC;;yCAA2B;AAqCxC;IAAP,IAAA,gBAAI,GAAE;;;;2CAKN;AAhDmB,SAAS;IAD9B,IAAA,sBAAU,GAAE;GACS,SAAS,CAiD9B;AAjDqB,8BAAS"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../src/interfaces.ts"],"names":[],"mappings":""}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"program":{"fileNames":["../../../../node_modules/typescript/lib/lib.es5.d.ts","../../../../node_modules/typescript/lib/lib.es2015.d.ts","../../../../node_modules/typescript/lib/lib.es2016.d.ts","../../../../node_modules/typescript/lib/lib.es2017.d.ts","../../../../node_modules/typescript/lib/lib.es2018.d.ts","../../../../node_modules/typescript/lib/lib.es2019.d.ts","../../../../node_modules/typescript/lib/lib.es2020.d.ts","../../../../node_modules/typescript/lib/lib.dom.d.ts","../../../../node_modules/typescript/lib/lib.dom.iterable.d.ts","../../../../node_modules/typescript/lib/lib.webworker.importscripts.d.ts","../../../../node_modules/typescript/lib/lib.scripthost.d.ts","../../../../node_modules/typescript/lib/lib.es2015.core.d.ts","../../../../node_modules/typescript/lib/lib.es2015.collection.d.ts","../../../../node_modules/typescript/lib/lib.es2015.generator.d.ts","../../../../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../../../node_modules/typescript/lib/lib.es2015.promise.d.ts","../../../../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../../../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../../../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../../../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../../../node_modules/typescript/lib/lib.es2017.object.d.ts","../../../../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../../../node_modules/typescript/lib/lib.es2017.string.d.ts","../../../../node_modules/typescript/lib/lib.es2017.intl.d.ts","../../../../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../../../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../../../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../../../node_modules/typescript/lib/lib.es2018.intl.d.ts","../../../../node_modules/typescript/lib/lib.es2018.promise.d.ts","../../../../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../../../node_modules/typescript/lib/lib.es2019.array.d.ts","../../../../node_modules/typescript/lib/lib.es2019.object.d.ts","../../../../node_modules/typescript/lib/lib.es2019.string.d.ts","../../../../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../../../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../../../node_modules/typescript/lib/lib.es2020.promise.d.ts","../../../../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../../../node_modules/typescript/lib/lib.es2020.string.d.ts","../../../../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../../../node_modules/typescript/lib/lib.es2020.intl.d.ts","../../../../node_modules/typescript/lib/lib.esnext.intl.d.ts","../../../../node_modules/typescript/lib/lib.es2017.full.d.ts","../../inversion/node_modules/reflect-metadata/index.d.ts","../../inversion/node_modules/inversify/lib/constants/metadata_keys.d.ts","../../inversion/node_modules/inversify/lib/interfaces/interfaces.d.ts","../../inversion/node_modules/inversify/lib/container/container.d.ts","../../inversion/node_modules/inversify/lib/constants/literal_types.d.ts","../../inversion/node_modules/inversify/lib/container/container_module.d.ts","../../inversion/node_modules/inversify/lib/annotation/injectable.d.ts","../../inversion/node_modules/inversify/lib/annotation/tagged.d.ts","../../inversion/node_modules/inversify/lib/annotation/named.d.ts","../../inversion/node_modules/inversify/lib/annotation/inject.d.ts","../../inversion/node_modules/inversify/lib/annotation/optional.d.ts","../../inversion/node_modules/inversify/lib/annotation/unmanaged.d.ts","../../inversion/node_modules/inversify/lib/annotation/multi_inject.d.ts","../../inversion/node_modules/inversify/lib/annotation/target_name.d.ts","../../inversion/node_modules/inversify/lib/annotation/post_construct.d.ts","../../inversion/node_modules/inversify/lib/planning/metadata_reader.d.ts","../../inversion/node_modules/inversify/lib/utils/id.d.ts","../../inversion/node_modules/inversify/lib/annotation/decorator_utils.d.ts","../../inversion/node_modules/inversify/lib/syntax/constraint_helpers.d.ts","../../inversion/node_modules/inversify/lib/utils/serialization.d.ts","../../inversion/node_modules/inversify/lib/utils/binding_utils.d.ts","../../inversion/node_modules/inversify/lib/inversify.d.ts","../../inversion/node_modules/inversify-inject-decorators/dts/index.d.ts","../../inversion/interfaces.ts","../../symbolic/src/index.ts","../../symbolic/index.ts","../../inversion/src/labels.ts","../../inversion/src/inversify.ts","../../../../node_modules/reflect-metadata/index.d.ts","../../../../node_modules/@types/lodash/common/common.d.ts","../../../../node_modules/@types/lodash/common/array.d.ts","../../../../node_modules/@types/lodash/common/collection.d.ts","../../../../node_modules/@types/lodash/common/date.d.ts","../../../../node_modules/@types/lodash/common/function.d.ts","../../../../node_modules/@types/lodash/common/lang.d.ts","../../../../node_modules/@types/lodash/common/math.d.ts","../../../../node_modules/@types/lodash/common/number.d.ts","../../../../node_modules/@types/lodash/common/object.d.ts","../../../../node_modules/@types/lodash/common/seq.d.ts","../../../../node_modules/@types/lodash/common/string.d.ts","../../../../node_modules/@types/lodash/common/util.d.ts","../../../../node_modules/@types/lodash/index.d.ts","../../errors/index.ts","../../tools/src/errors.ts","../../tools/src/env.ts","../../tools/src/path.ts","../../tools/src/object.ts","../../tools/interfaces.ts","../../tools/src/define.ts","../../tools/src/timer.ts","../../tools/src/events.ts","../../tools/src/buffer.ts","../../tools/src/index.ts","../../tools/index.ts","../../lifecycled/src/index.ts","../../lifecycled/index.ts","../../inversion/src/index.ts","../../inversion/index.ts","../../config/src/errors.ts","../../config/src/interfaces.ts","../../config/src/index.ts","../../config/index.ts","../src/interfaces.ts","../src/errors.ts","../src/index.ts","../index.ts","../../../../node_modules/@types/babel-types/index.d.ts","../../../../node_modules/@babel/types/lib/index.d.ts","../../../../node_modules/@types/babel__traverse/index.d.ts","../../../../node_modules/@types/babylon/index.d.ts","../../../../node_modules/@types/chai/index.d.ts","../../../../node_modules/@types/eslint/helpers.d.ts","../../../../node_modules/@types/json-schema/index.d.ts","../../../../node_modules/@types/estree/index.d.ts","../../../../node_modules/@types/eslint/index.d.ts","../../../../node_modules/@types/eslint-scope/index.d.ts","../../../../node_modules/@types/node/assert.d.ts","../../../../node_modules/@types/node/assert/strict.d.ts","../../../../node_modules/@types/node/globals.d.ts","../../../../node_modules/@types/node/async_hooks.d.ts","../../../../node_modules/@types/node/buffer.d.ts","../../../../node_modules/@types/node/child_process.d.ts","../../../../node_modules/@types/node/cluster.d.ts","../../../../node_modules/@types/node/console.d.ts","../../../../node_modules/@types/node/constants.d.ts","../../../../node_modules/@types/node/crypto.d.ts","../../../../node_modules/@types/node/dgram.d.ts","../../../../node_modules/@types/node/diagnostics_channel.d.ts","../../../../node_modules/@types/node/dns.d.ts","../../../../node_modules/@types/node/dns/promises.d.ts","../../../../node_modules/@types/node/domain.d.ts","../../../../node_modules/@types/node/events.d.ts","../../../../node_modules/@types/node/fs.d.ts","../../../../node_modules/@types/node/fs/promises.d.ts","../../../../node_modules/@types/node/http.d.ts","../../../../node_modules/@types/node/http2.d.ts","../../../../node_modules/@types/node/https.d.ts","../../../../node_modules/@types/node/inspector.d.ts","../../../../node_modules/@types/node/module.d.ts","../../../../node_modules/@types/node/net.d.ts","../../../../node_modules/@types/node/os.d.ts","../../../../node_modules/@types/node/path.d.ts","../../../../node_modules/@types/node/perf_hooks.d.ts","../../../../node_modules/@types/node/process.d.ts","../../../../node_modules/@types/node/punycode.d.ts","../../../../node_modules/@types/node/querystring.d.ts","../../../../node_modules/@types/node/readline.d.ts","../../../../node_modules/@types/node/repl.d.ts","../../../../node_modules/@types/node/stream.d.ts","../../../../node_modules/@types/node/stream/promises.d.ts","../../../../node_modules/@types/node/stream/consumers.d.ts","../../../../node_modules/@types/node/stream/web.d.ts","../../../../node_modules/@types/node/string_decoder.d.ts","../../../../node_modules/@types/node/timers.d.ts","../../../../node_modules/@types/node/timers/promises.d.ts","../../../../node_modules/@types/node/tls.d.ts","../../../../node_modules/@types/node/trace_events.d.ts","../../../../node_modules/@types/node/tty.d.ts","../../../../node_modules/@types/node/url.d.ts","../../../../node_modules/@types/node/util.d.ts","../../../../node_modules/@types/node/v8.d.ts","../../../../node_modules/@types/node/vm.d.ts","../../../../node_modules/@types/node/wasi.d.ts","../../../../node_modules/@types/node/worker_threads.d.ts","../../../../node_modules/@types/node/zlib.d.ts","../../../../node_modules/@types/node/globals.global.d.ts","../../../../node_modules/@types/node/index.d.ts","../../../../node_modules/@types/minimatch/index.d.ts","../../../../node_modules/@types/glob/index.d.ts","../../../../node_modules/@types/graceful-fs/index.d.ts","../../../../node_modules/@types/istanbul-lib-coverage/index.d.ts","../../../../node_modules/@types/istanbul-lib-report/index.d.ts","../../../../node_modules/@types/istanbul-reports/index.d.ts","../../../../node_modules/@types/minimist/index.d.ts","../../../../node_modules/@types/mocha/index.d.ts","../../../../node_modules/@types/normalize-package-data/index.d.ts","../../../../node_modules/@types/parse-json/index.d.ts","../../../../node_modules/@types/prettier/index.d.ts","../../../../node_modules/@types/stack-utils/index.d.ts","../../../../node_modules/@types/yargs-parser/index.d.ts","../../../../node_modules/@types/yargs/index.d.ts"],"fileInfos":[{"version":"89f78430e422a0f06d13019d60d5a45b37ec2d28e67eb647f73b1b0d19a46b72","affectsGlobalScope":true},"dc47c4fa66b9b9890cf076304de2a9c5201e94b740cffdf09f87296d877d71f6","7a387c58583dfca701b6c85e0adaf43fb17d590fb16d5b2dc0a2fbd89f35c467","8a12173c586e95f4433e0c6dc446bc88346be73ffe9ca6eec7aa63c8f3dca7f9","5f4e733ced4e129482ae2186aae29fde948ab7182844c3a5a51dd346182c7b06","e6b724280c694a9f588847f754198fb96c43d805f065c3a5b28bbc9594541c84","e21c071ca3e1b4a815d5f04a7475adcaeea5d64367e840dd0154096d705c3940",{"version":"abba1071bfd89e55e88a054b0c851ea3e8a494c340d0f3fab19eb18f6afb0c9e","affectsGlobalScope":true},{"version":"927cb2b60048e1395b183bf74b2b80a75bdb1dbe384e1d9fac654313ea2fb136","affectsGlobalScope":true},{"version":"7fac8cb5fc820bc2a59ae11ef1c5b38d3832c6d0dfaec5acdb5569137d09a481","affectsGlobalScope":true},{"version":"097a57355ded99c68e6df1b738990448e0bf170e606707df5a7c0481ff2427cd","affectsGlobalScope":true},{"version":"d8996609230d17e90484a2dd58f22668f9a05a3bfe00bfb1d6271171e54a31fb","affectsGlobalScope":true},{"version":"43fb1d932e4966a39a41b464a12a81899d9ae5f2c829063f5571b6b87e6d2f9c","affectsGlobalScope":true},{"version":"cdccba9a388c2ee3fd6ad4018c640a471a6c060e96f1232062223063b0a5ac6a","affectsGlobalScope":true},{"version":"4378fc8122ec9d1a685b01eb66c46f62aba6b239ca7228bb6483bcf8259ee493","affectsGlobalScope":true},{"version":"0d5f52b3174bee6edb81260ebcd792692c32c81fd55499d69531496f3f2b25e7","affectsGlobalScope":true},{"version":"810627a82ac06fb5166da5ada4159c4ec11978dfbb0805fe804c86406dab8357","affectsGlobalScope":true},{"version":"62d80405c46c3f4c527ee657ae9d43fda65a0bf582292429aea1e69144a522a6","affectsGlobalScope":true},{"version":"3013574108c36fd3aaca79764002b3717da09725a36a6fc02eac386593110f93","affectsGlobalScope":true},{"version":"75ec0bdd727d887f1b79ed6619412ea72ba3c81d92d0787ccb64bab18d261f14","affectsGlobalScope":true},{"version":"3be5a1453daa63e031d266bf342f3943603873d890ab8b9ada95e22389389006","affectsGlobalScope":true},{"version":"17bb1fc99591b00515502d264fa55dc8370c45c5298f4a5c2083557dccba5a2a","affectsGlobalScope":true},{"version":"7ce9f0bde3307ca1f944119f6365f2d776d281a393b576a18a2f2893a2d75c98","affectsGlobalScope":true},{"version":"6a6b173e739a6a99629a8594bfb294cc7329bfb7b227f12e1f7c11bc163b8577","affectsGlobalScope":true},{"version":"12a310447c5d23c7d0d5ca2af606e3bd08afda69100166730ab92c62999ebb9d","affectsGlobalScope":true},{"version":"b0124885ef82641903d232172577f2ceb5d3e60aed4da1153bab4221e1f6dd4e","affectsGlobalScope":true},{"version":"0eb85d6c590b0d577919a79e0084fa1744c1beba6fd0d4e951432fa1ede5510a","affectsGlobalScope":true},{"version":"da233fc1c8a377ba9e0bed690a73c290d843c2c3d23a7bd7ec5cd3d7d73ba1e0","affectsGlobalScope":true},{"version":"d154ea5bb7f7f9001ed9153e876b2d5b8f5c2bb9ec02b3ae0d239ec769f1f2ae","affectsGlobalScope":true},{"version":"bb2d3fb05a1d2ffbca947cc7cbc95d23e1d053d6595391bd325deb265a18d36c","affectsGlobalScope":true},{"version":"c80df75850fea5caa2afe43b9949338ce4e2de086f91713e9af1a06f973872b8","affectsGlobalScope":true},{"version":"9d57b2b5d15838ed094aa9ff1299eecef40b190722eb619bac4616657a05f951","affectsGlobalScope":true},{"version":"6c51b5dd26a2c31dbf37f00cfc32b2aa6a92e19c995aefb5b97a3a64f1ac99de","affectsGlobalScope":true},{"version":"6e7997ef61de3132e4d4b2250e75343f487903ddf5370e7ce33cf1b9db9a63ed","affectsGlobalScope":true},{"version":"2ad234885a4240522efccd77de6c7d99eecf9b4de0914adb9a35c0c22433f993","affectsGlobalScope":true},{"version":"1b3fe904465430e030c93239a348f05e1be80640d91f2f004c3512c2c2c89f34","affectsGlobalScope":true},{"version":"3787b83e297de7c315d55d4a7c546ae28e5f6c0a361b7a1dcec1f1f50a54ef11","affectsGlobalScope":true},{"version":"e7e8e1d368290e9295ef18ca23f405cf40d5456fa9f20db6373a61ca45f75f40","affectsGlobalScope":true},{"version":"faf0221ae0465363c842ce6aa8a0cbda5d9296940a8e26c86e04cc4081eea21e","affectsGlobalScope":true},{"version":"06393d13ea207a1bfe08ec8d7be562549c5e2da8983f2ee074e00002629d1871","affectsGlobalScope":true},{"version":"d071129cba6a5f2700be09c86c07ad2791ab67d4e5ed1eb301d6746c62745ea4","affectsGlobalScope":true},{"version":"10bbdc1981b8d9310ee75bfac28ee0477bb2353e8529da8cff7cb26c409cb5e8","affectsGlobalScope":true},"d2f31f19e1ba6ed59be9259d660a239d9a3fcbbc8e038c6b2009bde34b175fed",{"version":"8d6d51a5118d000ed3bfe6e1dd1335bebfff3fef23cd2af2f84a24d30f90cc90","affectsGlobalScope":true},"e72fe8c20f176ecfbb89b47e0956ad5af5c79d00a813db6adf32d7a323827bde","234ded1b44862f6c114c060f11e4cfd2fbace2a0988b886c4d2273da64721ca3","15c78ee71828fbcff296ef228440f459fefa3d7afaa4ed5dcf473ef67729ce28","223c30250c2d0774405136fe412f0c654acbd1f5ebc80d711d0a4413ced11520","d21addb8e9f07e85fe34b65dd38d156b2d29491585eb3a2d3754c85ff024dc78","45f14437278936644e7aa944a9d7b3213cc74173a9d0a6e78994de43caccb6d7","43769897ae7ca754acaffec5dfb909d10510fb2be0d0afa5cb4eec91b4c9805a","188fd1724740c445a782b9e953879097edef90434ff76fdc420acfbd58b1bcf6","3bdef47778e6ef0896e60bc227562685efedb3aee3fb132b5a968e892b0bff0b","f81c99df7c78e3ad3b6eacbaa5d5a2d36bcab1ea029b1998ede9151861502a9d","9fd895b4e65cc84529969de404b2221a95a955a57544febdc76189689696b040","c656a8d0be8f60c6818d5c60ec56fbe61de252cffb98b760dc0ba5518e85b86a","1f0a68bc4e44a72d2e3ce81967f6001df5d29428549b310054df0fa1bf588203","d9df733eeb4fc5ca64d6dfcaa3efc429a9fa7d183ce796df0e5049c1acd1eaa7","617d9598bd1dbc6b4e19ebabc5564b3fb9a95589f52eefb4c04396f292f7d1ef","c624c0d0d777a670e2b2d8003ec91519e93048963a3236aeab1ec55a8529c382","5436e41fb86218a81a15f6517dc47736924b4a31d1b04a2ca4405556a7bdd303","388e00b3c8426cf875a3b764a1d2f4d1669f05e587ad511fb7d61684e3fc5352","21a9fdf5ec213b187243a4fee33cce7055a0e25dd2ab6fd5eb53d9063bda1297","8ea54168630a0cbd9127985d4190ad962ad55123d78e855d7e505a7bf042bc2d","f15dd6db666e773db7ae7eba550607eeede04d16819dc7a5abf546f15a4b989a","961700b34af98c4b8049a6a8580195d3c5d07b7d82d3944587b8cabc70a00129","ae11ffbbb53d65a0b217333581526d5d280398df5c212d511f22ab2f5c6991f1","92e9e32485f6fea2ca0e00d30d7f66ce47402bfe0c6db4273e380daf6c0e63c8","80a3bbe0e4fdfaac2c0a8b92a3ed66d3ded5e8f454c5790c8d593872fc1197f1","665e3f8e4b15f4fa90b182edd6de96ce49676325024b12b29950bbc91827063b","bcf97adb421d37536e9d201274f72bb9deaac5e465cede7650fffd69a55875c9",{"version":"8d6d51a5118d000ed3bfe6e1dd1335bebfff3fef23cd2af2f84a24d30f90cc90","affectsGlobalScope":true},"675e702f2032766a91eeadee64f51014c64688525da99dccd8178f0c599f13a8","fe4a2042d087990ebfc7dc0142d5aaf5a152e4baea86b45f283f103ec1e871ea","d88a479cccf787b4aa82362150fbeba5211a32dbfafa7b92ba6995ecaf9a1a89","187119ff4f9553676a884e296089e131e8cc01691c546273b1d0089c3533ce42","c24ad9be9adf28f0927e3d9d9e9cec1c677022356f241ccbbfb97bfe8fb3d1a1","0ec0998e2d085e8ea54266f547976ae152c9dd6cdb9ac4d8a520a230f5ebae84","9364c7566b0be2f7b70ff5285eb34686f83ccb01bda529b82d23b2a844653bfb","00baffbe8a2f2e4875367479489b5d43b5fc1429ecb4a4cc98cfc3009095f52a","ae9930989ed57478eb03b9b80ad3efa7a3eacdfeff0f78ecf7894c4963a64f93","3c92b6dfd43cc1c2485d9eba5ff0b74a19bb8725b692773ef1d66dac48cda4bd","3e59f00ab03c33717b3130066d4debb272da90eeded4935ff0604c2bc25a5cae","6ac6f24aff52e62c3950461aa17eab26e3a156927858e6b654baef0058b4cd1e",{"version":"0714e2046df66c0e93c3330d30dbc0565b3e8cd3ee302cf99e4ede6220e5fec8","affectsGlobalScope":true},"d47a7e17d32b099d75e6288b67324de01a0587e5b8f2ed5c6289a8a7567e1be0","96a3cd0508294f8476c0b9634684e410a122e4c41f4f2b3a27a417d23e8296e2","4eb9bbb381dd5cfbd9f21408444c38ad579cba4de3e1c857019091dbf7c9a031","e76aaff856531ff082869f9a820bb1a0b2d0713365396b3997c5fe9b457bb73c","bd642322f25c6eaccb1049adda0086b486da4084a3c112fa9499c66fc2873d3f","8498554c116ec8289c7fe33ed67e36ba801a7e8acdd04ce32c9e864448738bc0","135facafb712b318733713fafdb7e2768e459f96e4971908c75d52956ac645c4","dfd544a9e06dbdb0c7c0a52d5ae5f7ca980fe04c65cd0ee9de4860ac2d38374b","da53b3f81accffc2e119cf2b1e4a5da3bad86042fe9ce4169166750644de5c0c","513ec76301e5d66ba0f5194a9be459c0f595beb1c5fb6e31a5d1c3e920a8b4bd","ebcf1781ee9aa2534792360c2dee38697372f31e24c8c33e35bfa414207ce72f","e0538e0a052324c35c22e22f61f1fe733eed97e68cb6e00aeac901f5e6e4e95c","54c2d7502e8ca2cf2b568e395874d810a76c649ffa9e1939e85fb5b775e89404","80a3bbe0e4fdfaac2c0a8b92a3ed66d3ded5e8f454c5790c8d593872fc1197f1","c4b26d58e06671d2c62928ee929e0f862bd6b4404199bd3a1fd87cea6cf8f3b5","80a3bbe0e4fdfaac2c0a8b92a3ed66d3ded5e8f454c5790c8d593872fc1197f1","0e2becb7a24e44ae138fe34d93c7a6583d738cd3347720b725e986e9c59a6d19","bdfe71979c31b7fd6391fe3882cab028d3ee39fe751218580af0e056fb6734aa","59cbe8a6f12f3526c804d9560d40e3d089bb7ad021ae950a480c357c1f79cab7","80a3bbe0e4fdfaac2c0a8b92a3ed66d3ded5e8f454c5790c8d593872fc1197f1","74cd4d584057abad4efb096883f496c098a0f9c802d1b1666c20ee4ead5cc6c0","364d890be1c074ff8aa1d3ef5a8e711f4f2b17ea69121719d937a0f15d376bf9","e23123f8831b4d6b4461d112e59fc1c8bebe6922d222527984f5d39fd2e1514f","80a3bbe0e4fdfaac2c0a8b92a3ed66d3ded5e8f454c5790c8d593872fc1197f1","75925c52e539a150d822acf3d43f41075d6c371215be27e0c81215a79a802fb4","d5d7b68f5369a210c235cd65458369888f8b839192d088c964f21cab3ac954db","3b043cf9a81854a72963fdb57d1884fc4da1cf5be69b5e0a4c5b751e58cb6d88","b76275b4a94b85da9e4b6b1f8c2b619b996560f9e6030a454260240210a39dd8",{"version":"c8747693e5872ad5ef3aa016731a06915e1c34dae987829d9aa5bd40c7a2c54b","affectsGlobalScope":true},{"version":"64d4b35c5456adf258d2cf56c341e203a073253f229ef3208fc0d5020253b241","affectsGlobalScope":true},"0359682c54e487c4cab2b53b2b4d35cc8dea4d9914bc6abcdb5701f8b8e745a4","7d7c8ef7d48a035142c07dae60545ecc0e4af4c337742760cb09726f2f8e31db","8566fa84085caa46340393b1704ecd368491918fb45bd688d6e89736aec73a2f","dc33ce27fbeaf0ea3da556c80a6cc8af9d13eb443088c8f25cdc39fca8e756f6","0d5a2ee1fdfa82740e0103389b9efd6bfe145a20018a2da3c02b89666181f4d9","a69c09dbea52352f479d3e7ac949fde3d17b195abe90b045d619f747b38d6d1a",{"version":"92d63add669d18ebc349efbacd88966d6f2ccdddfb1b880b2db98ae3aa7bf7c4","affectsGlobalScope":true},"ccc94049a9841fe47abe5baef6be9a38fc6228807974ae675fb15dc22531b4be",{"version":"9acfe4d1ff027015151ce81d60797b04b52bffe97ad8310bb0ec2e8fd61e1303","affectsGlobalScope":true},"95843d5cfafced8f3f8a5ce57d2335f0bcd361b9483587d12a25e4bd403b8216","afc6e96061af46bcff47246158caee7e056f5288783f2d83d6858cd25be1c565",{"version":"34f5bcac12b36d70304b73de5f5aab3bb91bd9919f984be80579ebcad03a624e","affectsGlobalScope":true},"82408ed3e959ddc60d3e9904481b5a8dc16469928257af22a3f7d1a3bc7fd8c4","2f520601649a893e6a49a8851ebfcf4be8ce090dc1281c2a08a871cb04e8251f","f50c975ab7b50e25a69e3d8a3773894125b44e9698924105f23b812bf7488baf","2b8c764f856a1dd0a9a2bf23e5efddbff157de8138b0754010be561ae5fcaa90","76650408392bf49a8fbf3e2b6b302712a92d76af77b06e2da1cc8077359c4409","0af3121e68297b2247dd331c0d24dba599e50736a7517a5622d5591aae4a3122","6972fca26f6e9bd56197568d4379f99071a90766e06b4fcb5920a0130a9202be",{"version":"4a2628e95962c8ab756121faa3ac2ed348112ff7a87b5c286dd2cc3326546b4c","affectsGlobalScope":true},"80793b2277f31baa199234daed806fff0fb11491d1ebd3357e520c3558063f00","a049a59a02009fc023684fcfaf0ac526fe36c35dcc5d2b7d620c1750ba11b083","196fee5541bfd59699dab615fee2ae7a6f5fe0a6337bcbbfd656ebf1ae329a63","160cc6e3d06938535bc887754afe5798c22d81ce83a9792ebfe2371a70f2ffc2","4b9a003b5c556c96784132945bb41c655ea11273b1917f5c8d0c154dd5fd20dd","a458dc78104cc80048ac24fdc02fe6dce254838094c2f25641b3f954d9721241",{"version":"e8b18c6385ff784228a6f369694fcf1a6b475355ba89090a88de13587a9391d5","affectsGlobalScope":true},"eecd493fc62c4dba3d988e2d7dff63299bf12ab49f5c9021dfef8dcc1ff2089e","abc1c425b2ad6720433f40f1877abfa4223f0f3dd486c9c28c492179ca183cb6","945a841f9a591197154c85386bc5a1467d42d325104bb36db51bc566bbb240be","10c39ce1df102994b47d4bc0c71aa9a6aea76f4651a5ec51914431f50bc883a1",{"version":"8207e7e6db9aa5fc7e61c8f17ba74cf9c115d26f51f91ee93f790815a7ea9dfb","affectsGlobalScope":true},"9f1069b9e2c051737b1f9b4f1baf50e4a63385a6a89c32235549ae87fc3d5492","ee18f2da7a037c6ceeb112a084e485aead9ea166980bf433474559eac1b46553","29c2706fa0cc49a2bd90c83234da33d08bb9554ecec675e91c1f85087f5a5324","0acbf26bf958f9e80c1ffa587b74749d2697b75b484062d36e103c137c562bc3","d7838022c7dab596357a9604b9c6adffe37dc34085ce0779c958ce9545bd7139","1b952304137851e45bc009785de89ada562d9376177c97e37702e39e60c2f1ff",{"version":"806ef4cac3b3d9fa4a48d849c8e084d7c72fcd7b16d76e06049a9ed742ff79c0","affectsGlobalScope":true},"a7971f9fb2a32ec7788ec6cda9d7a33c02023dfe9a62db2030ad1359649d8050","c33a6ea7147af60d8e98f1ac127047f4b0d4e2ce28b8f08ff3de07ca7cc00637",{"version":"b42b47e17b8ece2424ae8039feb944c2e3ba4b262986aebd582e51efbdca93dc","affectsGlobalScope":true},"664d8f2d59164f2e08c543981453893bc7e003e4dfd29651ce09db13e9457980","2408611d9b4146e35d1dbd1f443ccd8e187c74614a54b80300728277529dbf11","998a3de5237518c0b3ac00a11b3b4417affb008aa20aedee52f3fdae3cb86151","ad41008ffe077206e1811fc873f4d9005b5fd7f6ab52bb6118fef600815a5cb4","d88ecca73348e7c337541c4b8b60a50aca5e87384f6b8a422fc6603c637e4c21","badae0df9a8016ac36994b0a0e7b82ba6aaa3528e175a8c3cb161e4683eec03e","c3db860bcaaaeb3bbc23f353bbda1f8ab82756c8d5e973bebb3953cb09ea68f2","235a53595bd20b0b0eeb1a29cb2887c67c48375e92f03749b2488fbd46d0b1a0","bc09393cd4cd13f69cf1366d4236fbae5359bb550f0de4e15767e9a91d63dfb1","9c266243b01545e11d2733a55ad02b4c00ecdbda99c561cd1674f96e89cdc958","c71155c05fc76ff948a4759abc1cb9feec036509f500174bc18dad4c7827a60c",{"version":"ab9b9a36e5284fd8d3bf2f7d5fcbc60052f25f27e4d20954782099282c60d23e","affectsGlobalScope":true},"1503a452a67127e5c2da794d1c7c44344d5038373aae16c9b03ac964db159edd","8841e2aa774b89bd23302dede20663306dc1b9902431ac64b24be8b8d0e3f649","fd326577c62145816fe1acc306c734c2396487f76719d3785d4e825b34540b33","3ebae8c00411116a66fca65b08228ea0cf0b72724701f9b854442100aab55aba","8b06ac3faeacb8484d84ddb44571d8f410697f98d7bfa86c0fda60373a9f5215","7eb06594824ada538b1d8b48c3925a83e7db792f47a081a62cf3e5c4e23cf0ee","f5638f7c2f12a9a1a57b5c41b3c1ea7db3876c003bab68e6a57afd6bcc169af0","209e814e8e71aec74f69686a9506dd7610b97ab59dcee9446266446f72a76d05",{"version":"5f186a758a616c107c70e8918db4630d063bd782f22e6e0b17573b125765b40b","affectsGlobalScope":true},"6fa0008bf91a4cc9c8963bace4bba0bd6865cbfa29c3e3ccc461155660fb113a","2b8264b2fefd7367e0f20e2c04eed5d3038831fe00f5efbc110ff0131aab899b","501260c8b07a6e423fb6ebdea704e732ad529208e4fbbc517836fac8f8ae8895","b0d10e46cfe3f6c476b69af02eaa38e4ccc7430221ce3109ae84bb9fb8282298","f7e133b20ee2669b6c0e5d7f0cd510868c57cd64b283e68c7f598e30ce9d76d2","6ba73232c9d3267ca36ddb83e335d474d2c0e167481e3dec416c782894e11438"],"options":{"allowSyntheticDefaultImports":true,"declaration":false,"emitDecoratorMetadata":true,"experimentalDecorators":true,"jsx":2,"module":1,"outDir":"./","removeComments":true,"sourceMap":true,"target":4},"fileIdsList":[[163],[111,163],[110,163],[117,118,163],[115,116,117,163],[135,136,163,170,171],[136,163,170],[163,174],[163,175],[73,75,76,77,78,79,80,81,82,83,84,85,163],[73,74,76,77,78,79,80,81,82,83,84,85,163],[74,75,76,77,78,79,80,81,82,83,84,85,163],[73,74,75,77,78,79,80,81,82,83,84,85,163],[73,74,75,76,78,79,80,81,82,83,84,85,163],[73,74,75,76,77,79,80,81,82,83,84,85,163],[73,74,75,76,77,78,80,81,82,83,84,85,163],[73,74,75,76,77,78,79,81,82,83,84,85,163],[73,74,75,76,77,78,79,80,82,83,84,85,163],[73,74,75,76,77,78,79,80,81,83,84,85,163],[73,74,75,76,77,78,79,80,81,82,84,85,163],[73,74,75,76,77,78,79,80,81,82,83,85,163],[73,74,75,76,77,78,79,80,81,82,83,84,163],[120,163],[123,163],[124,129,163],[125,135,136,143,152,162,163],[125,126,135,143,163],[127,163],[128,129,136,144,163],[129,152,159,163],[130,132,135,143,163],[131,163],[132,133,163],[134,135,163],[135,163],[135,136,137,152,162,163],[135,136,137,152,163],[138,143,152,162,163],[135,136,138,139,143,152,159,162,163],[138,140,152,159,162,163],[120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169],[135,141,163],[142,162,163],[132,135,143,152,163],[144,163],[145,163],[123,146,163],[147,161,163,167],[148,163],[149,163],[135,150,163],[150,151,163,165],[135,152,153,154,163],[152,154,163],[152,153,163],[155,163],[156,163],[135,157,158,163],[157,158,163],[129,143,159,163],[160,163],[143,161,163],[124,138,149,162,163],[129,163],[152,163,164],[163,165],[163,166],[124,129,135,137,146,152,162,163,165,167],[152,163,168],[163,183],[104,163],[85,86,163],[85,101,102,103,163],[85,163],[108,163],[86,163],[101,105,106,107,163],[100,163],[65,163],[46,163],[45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,163],[44,70,71,99,163],[65,66,67,70,163],[69,163],[98,163],[44,85,97,163],[68,163],[91,96,163],[87,163],[91,163],[87,88,89,90,92,93,94,95,163]],"referencedMap":[[111,1],[110,1],[112,2],[113,3],[114,1],[119,4],[115,1],[118,5],[117,1],[172,6],[173,7],[174,1],[175,8],[176,9],[116,1],[74,10],[75,11],[73,12],[76,13],[77,14],[78,15],[79,16],[80,17],[81,18],[82,19],[83,20],[84,21],[85,22],[171,1],[177,1],[178,1],[120,23],[121,23],[123,24],[124,25],[125,26],[126,27],[127,28],[128,29],[129,30],[130,31],[131,32],[132,33],[133,33],[134,34],[135,35],[136,36],[137,37],[122,1],[169,1],[138,38],[139,39],[140,40],[170,41],[141,42],[142,43],[143,44],[144,45],[145,46],[146,47],[147,48],[148,49],[149,50],[150,51],[151,52],[152,53],[154,54],[153,55],[155,56],[156,57],[157,58],[158,59],[159,60],[160,61],[161,62],[162,63],[163,64],[164,65],[165,66],[166,67],[167,68],[168,69],[179,1],[180,1],[181,1],[182,1],[183,1],[184,70],[72,1],[8,1],[9,1],[13,1],[12,1],[2,1],[14,1],[15,1],[16,1],[17,1],[18,1],[19,1],[20,1],[21,1],[3,1],[4,1],[43,1],[25,1],[22,1],[23,1],[24,1],[26,1],[27,1],[28,1],[5,1],[29,1],[30,1],[31,1],[32,1],[6,1],[33,1],[34,1],[35,1],[36,1],[7,1],[41,1],[37,1],[38,1],[39,1],[40,1],[1,1],[42,1],[11,1],[10,1],[105,71],[102,72],[104,73],[103,74],[109,75],[107,76],[108,77],[106,1],[86,1],[101,78],[67,1],[66,79],[61,80],[53,80],[50,1],[56,80],[52,1],[54,1],[58,1],[51,1],[57,1],[55,1],[48,80],[45,1],[47,80],[49,80],[46,1],[65,81],[59,80],[62,80],[64,79],[60,1],[63,80],[44,1],[100,82],[71,83],[70,84],[99,85],[98,86],[69,87],[68,1],[97,88],[91,1],[95,89],[92,90],[88,1],[87,76],[94,1],[96,91],[90,1],[89,46],[93,1]],"exportedModulesMap":[[111,1],[110,1],[112,2],[113,3],[114,1],[119,4],[115,1],[118,5],[117,1],[172,6],[173,7],[174,1],[175,8],[176,9],[116,1],[74,10],[75,11],[73,12],[76,13],[77,14],[78,15],[79,16],[80,17],[81,18],[82,19],[83,20],[84,21],[85,22],[171,1],[177,1],[178,1],[120,23],[121,23],[123,24],[124,25],[125,26],[126,27],[127,28],[128,29],[129,30],[130,31],[131,32],[132,33],[133,33],[134,34],[135,35],[136,36],[137,37],[122,1],[169,1],[138,38],[139,39],[140,40],[170,41],[141,42],[142,43],[143,44],[144,45],[145,46],[146,47],[147,48],[148,49],[149,50],[150,51],[151,52],[152,53],[154,54],[153,55],[155,56],[156,57],[157,58],[158,59],[159,60],[160,61],[161,62],[162,63],[163,64],[164,65],[165,66],[166,67],[167,68],[168,69],[179,1],[180,1],[181,1],[182,1],[183,1],[184,70],[72,1],[8,1],[9,1],[13,1],[12,1],[2,1],[14,1],[15,1],[16,1],[17,1],[18,1],[19,1],[20,1],[21,1],[3,1],[4,1],[43,1],[25,1],[22,1],[23,1],[24,1],[26,1],[27,1],[28,1],[5,1],[29,1],[30,1],[31,1],[32,1],[6,1],[33,1],[34,1],[35,1],[36,1],[7,1],[41,1],[37,1],[38,1],[39,1],[40,1],[1,1],[42,1],[11,1],[10,1],[105,71],[102,72],[104,73],[103,74],[109,75],[107,76],[108,77],[106,1],[86,1],[101,78],[67,1],[66,79],[61,80],[53,80],[50,1],[56,80],[52,1],[54,1],[58,1],[51,1],[57,1],[55,1],[48,80],[45,1],[47,80],[49,80],[46,1],[65,81],[59,80],[62,80],[64,79],[60,1],[63,80],[44,1],[100,82],[71,83],[70,84],[99,85],[98,86],[69,87],[68,1],[97,88],[91,1],[95,89],[92,90],[88,1],[87,76],[94,1],[96,91],[90,1],[89,46],[93,1]],"semanticDiagnosticsPerFile":[111,110,112,113,114,119,115,118,117,172,173,174,175,176,116,74,75,73,76,77,78,79,80,81,82,83,84,85,171,177,178,120,121,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,122,169,138,139,140,170,141,142,143,144,145,146,147,148,149,150,151,152,154,153,155,156,157,158,159,160,161,162,163,164,165,166,167,168,179,180,181,182,183,184,72,8,9,13,12,2,14,15,16,17,18,19,20,21,3,4,43,25,22,23,24,26,27,28,5,29,30,31,32,6,33,34,35,36,7,41,37,38,39,40,1,42,11,10,105,102,104,103,109,107,108,106,86,101,67,66,61,53,50,56,52,54,58,51,57,55,48,45,47,49,46,65,59,62,64,60,63,44,100,71,70,99,98,69,68,97,91,95,92,88,87,94,96,90,89,93]},"version":"4.5.5"}
|
package/index.d.ts
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
import { IConnector } from './src';
|
2
|
+
|
3
|
+
declare module '@biorate/connector' {
|
4
|
+
export class Connector<C extends { name: string }, T = any>
|
5
|
+
implements IConnector<C, T>
|
6
|
+
{
|
7
|
+
public readonly connections: Map<string, T>;
|
8
|
+
public current: T;
|
9
|
+
public use(name: string): void;
|
10
|
+
public connection(name?: string): T;
|
11
|
+
}
|
12
|
+
}
|
package/index.ts
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
export * from './src';
|
package/package.json
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
{
|
2
|
+
"name": "@biorate/connector",
|
3
|
+
"version": "0.20.0",
|
4
|
+
"description": "Connector interface",
|
5
|
+
"main": "dist",
|
6
|
+
"scripts": {
|
7
|
+
"build": "npx tsc -p ./tsconfig.build.json --outDir ./dist",
|
8
|
+
"test": "npx nyc --reporter=lcov --reporter=text-summary -- npx mocha -r ts-node/register tests/**/*.spec.ts",
|
9
|
+
"prepublishOnly": "npm run build"
|
10
|
+
},
|
11
|
+
"repository": {
|
12
|
+
"type": "git",
|
13
|
+
"url": "git+https://github.com/biorate/core.git",
|
14
|
+
"directory": "packages/@biorate/connector"
|
15
|
+
},
|
16
|
+
"publishConfig": {
|
17
|
+
"access": "public"
|
18
|
+
},
|
19
|
+
"homepage": "https://biorate.github.io/core",
|
20
|
+
"keywords": [],
|
21
|
+
"author": "llevkin",
|
22
|
+
"license": "MIT",
|
23
|
+
"dependencies": {
|
24
|
+
"@biorate/config": "0.20.0",
|
25
|
+
"@biorate/errors": "0.20.0",
|
26
|
+
"@biorate/inversion": "0.20.0"
|
27
|
+
},
|
28
|
+
"gitHead": "358dcd2cf2cd8ce2ef9fff9d1584fb3b8508d6dd"
|
29
|
+
}
|
package/src/errors.ts
ADDED
package/src/index.ts
ADDED
@@ -0,0 +1,105 @@
|
|
1
|
+
import { init, inject, injectable, Types } from '@biorate/inversion';
|
2
|
+
import { IConfig } from '@biorate/config';
|
3
|
+
import { IConnector } from './interfaces';
|
4
|
+
import { ConnectorConnectionNotExistsError } from './errors';
|
5
|
+
export * from './errors';
|
6
|
+
export * from './interfaces';
|
7
|
+
|
8
|
+
/**
|
9
|
+
* @description Connector interface
|
10
|
+
*
|
11
|
+
* ### Features:
|
12
|
+
* - Common interface for all connectors
|
13
|
+
*
|
14
|
+
* @example
|
15
|
+
* ```
|
16
|
+
* import { Connector, IConnector } from '../..';
|
17
|
+
* import { inject, container, Types, Core } from '@biorate/inversion';
|
18
|
+
* import { IConfig, Config } from '@biorate/config';
|
19
|
+
*
|
20
|
+
* export class Connection {
|
21
|
+
* public name: string;
|
22
|
+
*
|
23
|
+
* public constructor(name: string) {
|
24
|
+
* this.name = name;
|
25
|
+
* }
|
26
|
+
* }
|
27
|
+
*
|
28
|
+
* export class TestConnector extends Connector<{ name: string }, Connection> {
|
29
|
+
* protected namespace = 'TestConnector';
|
30
|
+
*
|
31
|
+
* protected async connect(config) {
|
32
|
+
* return new Connection(config.name);
|
33
|
+
* }
|
34
|
+
* }
|
35
|
+
*
|
36
|
+
* export class Root extends Core() {
|
37
|
+
* @inject(TestConnector) public connector: IConnector<{ name: string }, Connection>;
|
38
|
+
* }
|
39
|
+
*
|
40
|
+
* container.bind(Types.Config).to(Config).inSingletonScope();
|
41
|
+
* container.bind(TestConnector).toSelf().inSingletonScope();
|
42
|
+
* container.bind(Root).toSelf().inSingletonScope();
|
43
|
+
*
|
44
|
+
* container.get<IConfig>(Types.Config).merge({
|
45
|
+
* TestConnector: [{ name: 'test-connection' }],
|
46
|
+
* });
|
47
|
+
*
|
48
|
+
* (async () => {
|
49
|
+
* const root = container.get<Root>(Root);
|
50
|
+
* await root.$run();
|
51
|
+
* console.log(root.connector.connection('test-connection')); // Connection { name: 'test-connection' }
|
52
|
+
* })();
|
53
|
+
* ```
|
54
|
+
*/
|
55
|
+
@injectable()
|
56
|
+
export abstract class Connector<C extends { name: string }, T = any>
|
57
|
+
implements IConnector<C, T>
|
58
|
+
{
|
59
|
+
/**
|
60
|
+
* @description Config dependency
|
61
|
+
*/
|
62
|
+
@inject(Types.Config) protected config: IConfig;
|
63
|
+
/**
|
64
|
+
* @description Namespace path for fetching configuration
|
65
|
+
*/
|
66
|
+
protected abstract readonly namespace: string;
|
67
|
+
/**
|
68
|
+
* @description Connections storage
|
69
|
+
*/
|
70
|
+
public readonly connections = new Map<string, T>();
|
71
|
+
/**
|
72
|
+
* @description Link to selected (used) connection
|
73
|
+
*/
|
74
|
+
public current: T = null;
|
75
|
+
/**
|
76
|
+
* @description Abstract method describing connection
|
77
|
+
*/
|
78
|
+
protected abstract connect(config: C): Promise<T>;
|
79
|
+
/**
|
80
|
+
* @description Method for change current connection
|
81
|
+
*/
|
82
|
+
public use(name: string) {
|
83
|
+
if (!this.connections.has(name))
|
84
|
+
throw new ConnectorConnectionNotExistsError(this.constructor.name, name);
|
85
|
+
this.current = this.connections.get(name);
|
86
|
+
}
|
87
|
+
/**
|
88
|
+
* @description Method for get existed the connection
|
89
|
+
*/
|
90
|
+
public connection(name?: string) {
|
91
|
+
if (!name) return this.current;
|
92
|
+
if (!this.connections.has(name))
|
93
|
+
throw new ConnectorConnectionNotExistsError(this.constructor.name, name);
|
94
|
+
return this.connections.get(name);
|
95
|
+
}
|
96
|
+
/**
|
97
|
+
* @description Initialize method
|
98
|
+
*/
|
99
|
+
@init() protected async initialize() {
|
100
|
+
for (const config of this.config.get<C[]>(this.namespace, [])) {
|
101
|
+
this.connections.set(config.name, await this.connect(config));
|
102
|
+
if (!this.current) this.current = this.connections.get(config.name);
|
103
|
+
}
|
104
|
+
}
|
105
|
+
}
|
@@ -0,0 +1,31 @@
|
|
1
|
+
import { Connector, IConnector } from '../..';
|
2
|
+
import { inject, container, Types, Core } from '@biorate/inversion';
|
3
|
+
import { IConfig, Config } from '@biorate/config';
|
4
|
+
|
5
|
+
export class Connection {
|
6
|
+
public name: string;
|
7
|
+
|
8
|
+
public constructor(name: string) {
|
9
|
+
this.name = name;
|
10
|
+
}
|
11
|
+
}
|
12
|
+
|
13
|
+
export class TestConnector extends Connector<{ name: string }, Connection> {
|
14
|
+
protected namespace = 'TestConnector';
|
15
|
+
|
16
|
+
protected async connect(config) {
|
17
|
+
return new Connection(config.name);
|
18
|
+
}
|
19
|
+
}
|
20
|
+
|
21
|
+
export class Root extends Core() {
|
22
|
+
@inject(TestConnector) public connector: IConnector<{ name: string }, Connection>;
|
23
|
+
}
|
24
|
+
|
25
|
+
container.bind(Types.Config).to(Config).inSingletonScope();
|
26
|
+
container.bind(TestConnector).toSelf().inSingletonScope();
|
27
|
+
container.bind(Root).toSelf().inSingletonScope();
|
28
|
+
|
29
|
+
container.get<IConfig>(Types.Config).merge({
|
30
|
+
TestConnector: [{ name: 'test-connection' }],
|
31
|
+
});
|
@@ -0,0 +1,19 @@
|
|
1
|
+
import { expect } from 'chai';
|
2
|
+
import { container } from '@biorate/inversion';
|
3
|
+
import { Root, Connection } from './__mocks__';
|
4
|
+
|
5
|
+
describe('@biorate/connector', function () {
|
6
|
+
let root: Root;
|
7
|
+
this.timeout(3e4);
|
8
|
+
|
9
|
+
before(async () => {
|
10
|
+
root = container.get<Root>(Root);
|
11
|
+
await root.$run();
|
12
|
+
});
|
13
|
+
|
14
|
+
it('get connection', () => {
|
15
|
+
expect(root.connector.connection('test-connection'))
|
16
|
+
.to.be.an.instanceof(Connection)
|
17
|
+
.to.have.property('name', 'test-connection');
|
18
|
+
});
|
19
|
+
});
|